(globalThis["webpackChunkverso"] = globalThis["webpackChunkverso"] || []).push([[2181],{ /***/ 69006: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; Object.defineProperty(exports, "loadBoomerang", ({ enumerable: true, get: function get() { return _loadBoomerang["default"]; } })); var _react = _interopRequireDefault(__webpack_require__(96540)); var _propTypes = _interopRequireDefault(__webpack_require__(5556)); var _loadBoomerang = _interopRequireWildcard(__webpack_require__(18326)); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /** * Sends Real User Metrics (RUM) data back home * @class * @extends ReactComponent * @see https://github.com/SOASTA/boomerang * * To build a new version of boomerang, git clone that project, change the plugins.json, and rebuild */ var Boomerang = /*#__PURE__*/function (_React$Component) { _inherits(Boomerang, _React$Component); var _super = _createSuper(Boomerang); function Boomerang() { _classCallCheck(this, Boomerang); return _super.apply(this, arguments); } _createClass(Boomerang, [{ key: "componentDidMount", value: function componentDidMount() { (0, _loadBoomerang["default"])(this.props); } }, { key: "shouldComponentUpdate", value: function shouldComponentUpdate() { // never redraw return false; } }, { key: "render", value: function render() { // never draw return null; } }]); return Boomerang; }(_react["default"].Component); Boomerang.propTypes = { autoRun: _propTypes["default"].bool, onLog: _propTypes["default"].func, sample: _propTypes["default"].number.isRequired, tags: _propTypes["default"].object.isRequired }; Boomerang.defaultProps = { sample: _loadBoomerang.DEFAULT_SAMPLE, tags: _loadBoomerang.DEFAULT_TAGS }; var _default = Boomerang; exports["default"] = _default; /***/ }), /***/ 49659: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DEFAULT_ID = exports.DEFAULT_APP_VERSION = exports.APP_VERSION_MAP = void 0; exports.addCondeProperties = addCondeProperties; exports["default"] = void 0; exports.getAppVersion = getAppVersion; exports.getExperimentBuckets = getExperimentBuckets; exports.getExperimentLabels = getExperimentLabels; exports.getIdFromCookie = getIdFromCookie; exports.getViewportTag = getViewportTag; exports.isMobile = isMobile; exports.readCookie = readCookie; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var DEFAULT_ID = 'not-set'; exports.DEFAULT_ID = DEFAULT_ID; var DEFAULT_APP_VERSION = 'legacy'; exports.DEFAULT_APP_VERSION = DEFAULT_APP_VERSION; var APP_VERSION_MAP = { 'multi-tenant': 'verso' }; /** * Determines if the current page view is mobile or not based on the UA string. * * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent * * @param {string} userAgent The user agent string for the current page view. * @returns {boolean} True for mobile UA; false for non-mobile UA. */ exports.APP_VERSION_MAP = APP_VERSION_MAP; function isMobile(userAgent) { return userAgent && userAgent.indexOf('Mobi') > -1; } /** * Gets the bucketed viewport width for the current page view. * * @param {number} width The viewport width. * @param {number[]} viewportSizes The possible viewport width buckets. * @returns {string} The bucket that the width belongs in. */ function getViewportTag(width, viewportSizes) { var cursor = 0; var low = 0; var high = viewportSizes[cursor]; while (high && high < width) { cursor++; low = high; high = viewportSizes[cursor]; } return [low, high ? '-' + high : '+'].join(''); } /** * Get the value of a cookie. * * @param {string} name Cookie name. * @returns {string|null} Returns the value of the cookie or null if not found. */ function readCookie(name) { var nameEQ = "".concat(name, "="); if (!document || !document.cookie || typeof document.cookie !== 'string') { return null; } var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) === ' ') { c = c.substring(1, c.length); } if (c.indexOf(nameEQ) === 0) { return c.substring(nameEQ.length, c.length); } } return null; } /** * Gets the value of a cookie with a default. * * @param {string} cookieName - The cookie to get. * @returns {string} Returns the value of the cookie or default value if not found. */ function getIdFromCookie(cookieName) { return readCookie(cookieName) || DEFAULT_ID; } /** * Get the app version for that produces a beacon. * * @param {Object} state - The app's state. * @returns {string} The app version. */ function getAppVersion(state) { var version = state && state.transformed && state.transformed.coreDataLayer && state.transformed.coreDataLayer.site && state.transformed.coreDataLayer.site.appVersion ? state.transformed.coreDataLayer.site.appVersion : DEFAULT_APP_VERSION; return APP_VERSION_MAP[version] || version; } /** * Gets experiment values * * @param {array} experimentAssignments Experiment assignments. * @returns {string} Comma separated experiment labels. */ function getExperimentLabels(experimentAssignments) { if (experimentAssignments.length < 1) { return 'empty'; } var experimentLabels = []; for (var i = 0; i < experimentAssignments.length; i++) { if (experimentAssignments[i] && experimentAssignments[i].experimentLabel) { var experimentLabel = experimentAssignments[i].experimentLabel; experimentLabels.push(experimentLabel); } } return experimentLabels.join(','); } /** * Gets experiment buckets value * * @param {array} experimentAssignments Experiment assignments. * @returns {string} * @returns {string} Comma separated experiment buckets */ function getExperimentBuckets(experimentAssignments) { if (experimentAssignments.length < 1) { return 'empty'; } var experimentBuckets = []; for (var i = 0; i < experimentAssignments.length; i++) { if (experimentAssignments[i] && experimentAssignments[i].bucketLabel) { var experimentBucket = experimentAssignments[i].bucketLabel; experimentBuckets.push(experimentBucket); } } return experimentBuckets.join(','); } /** * Add custom properties that are useful for us in particular * * @param {Boomerang} BOOMR - boomerang instance * @param {Object} props - some object * @param {Object} [condeTagMap={}] - map of functions to add custom Condé tags * @returns {undefined} undefined */ function addCondeProperties(BOOMR, props) { var condeTagMap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; // so we can estimate true metrics (multiple this value by number of events) var tags = _objectSpread({ sample: props.sample }, props.tags); Object.keys(condeTagMap).forEach(function (key) { if (!tags[key]) { tags[key] = condeTagMap[key](props); } }); Object.keys(tags).forEach(function (value) { return BOOMR.addVar('tag.' + value, tags[value] + ''); }); } var _default = { addCondeProperties: addCondeProperties, getViewportTag: getViewportTag, getIdFromCookie: getIdFromCookie, getAppVersion: getAppVersion, getExperimentLabels: getExperimentLabels, getExperimentBuckets: getExperimentBuckets }; exports["default"] = _default; /***/ }), /***/ 39898: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; exports.handleEventFired = handleEventFired; exports.injectIFrame = injectIFrame; /** * Injects an iframe safely into the document * @param {Document} d - some document * @param {string} scriptURL - some url * @returns {undefined} undefined */ function injectIFrame(d, scriptURL) { var iFrame = d.createElement('iframe'); // eslint-disable-next-line no-script-url iFrame.src = 'javascript:void(0)'; (iFrame.frameElement || iFrame).style.cssText = 'width: 0; height: 0; border: 0'; var where = d.getElementsByTagName('script')[0]; if (!where || !where.parentNode) { // if we're in some unknown place, do nothing return; } where.parentNode.insertBefore(iFrame, where); var doc; var dom; try { doc = iFrame.contentWindow.document; } catch (e) { dom = d.domain; iFrame.src = "javascript:var d=document.open();d.domain='".concat(dom, "';void(0);"); doc = iFrame.contentWindow.document; } doc.open()._l = function () { var js = this.createElement('script'); if (dom) { this.domain = dom; } js.id = 'boomr-if-as'; js.src = scriptURL; this.body.appendChild(js); }; doc.write(''); doc.close(); } /** * @param {Document} d - some document * @param {string} eventName - some event name * @param {Function} fn - e.detail.BOOMR is a reference to the BOOMR global object * @returns {undefined} undefined */ function handleEventFired(d, eventName, fn) { if (d.addEventListener) { d.addEventListener(eventName, function (e) { return fn(e); }); } else if (d.attachEvent) { // IE 6, 7, 8 we use onPropertyChange and look for propertyName === "onBoomerangLoaded" d.attachEvent('onpropertychange', function (e) { if (!e) { e = event; // eslint-disable-line no-restricted-globals } if (e.propertyName === eventName) { fn(e); } }); } } var _default = { handleEventFired: handleEventFired, injectIFrame: injectIFrame }; exports["default"] = _default; /***/ }), /***/ 18326: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = exports.DEFAULT_TAGS = exports.DEFAULT_SAMPLE = void 0; var _dom = __webpack_require__(39898); var _commonTagging = __webpack_require__(49659); var DEFAULT_SAMPLE = 0.1; exports.DEFAULT_SAMPLE = DEFAULT_SAMPLE; var DEFAULT_TAGS = {}; exports.DEFAULT_TAGS = DEFAULT_TAGS; var boomerangURL = 'https://rum.condenastdigital.com/client/boomerang-1.0.c0cbec6da22c38733fef2a494104b4816b956fea.min.js'; var servicePath = 'https://rum.condenastdigital.com/beacon'; var commonViewportSizes = [640, 768, 1024, 1280, 1600]; var condeProperties = { mobile: function mobile() { return (0, _commonTagging.isMobile)(navigator.userAgent); }, viewport: function viewport() { return (0, _commonTagging.getViewportTag)(window.innerWidth, commonViewportSizes); }, xid: function xid() { return (0, _commonTagging.getIdFromCookie)('CN_xid'); }, cnpid: function cnpid() { return (0, _commonTagging.getIdFromCookie)('pID'); }, // Boomerang uses `pid` already. Adding namespace to differentiate sid: function sid() { return (0, _commonTagging.getIdFromCookie)('sID'); }, app: function app() { return (0, _commonTagging.getAppVersion)(window.__PRELOADED_STATE__); } }; /** * Start the boomerang instance after its ready * * @param {Boomerang} BOOMR - Boomerang instance * @param {Object} options - options * @returns {undefined} undefined */ function startBoomerang(BOOMR, options) { var onLog = options.onLog; var autoRun = options.autoRun !== false; BOOMR.init({ autorun: autoRun, beacon_type: 'POST', beacon_url: servicePath, log: onLog || null, // don't log unless given a log function site_domain: false, // disable all cookies (otherwise this is the domain that they are assigned to) // user_ip: '10.0.0.1', // mostly used for bandwidth measurement tool and cookies, so not used RT: { cookies: false }, Continuity: { sendLog: false, sendTimeline: false } }); BOOMR.subscribe('before_beacon', function () { var consentRequired = 'no'; if (window.cns && window.cns.config && window.cns.config.config && window.cns.config.config.consentRequired === true) { consentRequired = window.cns.config.config.consentRequired === true ? 'yes' : 'no'; } BOOMR.addVar('tag.consent_required', consentRequired); if (window.OptanonActiveGroups) { BOOMR.addVar('tag.optanon_active_groups', window.OptanonActiveGroups); } BOOMR.addVar('tag.gdpr_applies', 'not-set'); BOOMR.addVar('tag.consent_status', 'not-set'); if (window.__tcfapi) { window.__tcfapi('getTCData', 2, function (tData) { if (tData) { BOOMR.addVar('tag.gdpr_applies', tData.gdprApplies); BOOMR.addVar('tag.consent_status', tData.eventStatus); } }); } BOOMR.addVar('tag.experiment_labels', 'not-set'); BOOMR.addVar('tag.experiment_buckets', 'not-set'); if (window.experiments && window.experiments && window.experiments.assignments && Array.isArray(window.experiments.assignments)) { BOOMR.addVar('tag.experiment_labels', (0, _commonTagging.getExperimentLabels)(window.experiments.assignments)); BOOMR.addVar('tag.experiment_buckets', (0, _commonTagging.getExperimentBuckets)(window.experiments.assignments)); } }); } /** * Load and start the Boomerang script for sample set of users. * * @see https://github.com/SOASTA/boomerang * @param {Object} [options] - options * @param {number} options.sample - ratio of users to sample (0 to 1) * @param {Object} options.tags - custom tags to send to Boomerang * @param {bool} options.autoRun - set to false to disable automatic running if you want to call BOOMR.page_ready() yourself * @param {Function} options.onLog - log function * @returns {undefined} undefined */ function loadBoomerang(_ref) { var _ref$sample = _ref.sample, sample = _ref$sample === void 0 ? DEFAULT_SAMPLE : _ref$sample, _ref$tags = _ref.tags, tags = _ref$tags === void 0 ? DEFAULT_TAGS : _ref$tags, _ref$autoRun = _ref.autoRun, autoRun = _ref$autoRun === void 0 ? undefined : _ref$autoRun, _ref$onLog = _ref.onLog, onLog = _ref$onLog === void 0 ? undefined : _ref$onLog; var options = { sample: sample, tags: tags, autoRun: autoRun, onLog: onLog }; if (Math.random() > options.sample) { return; } var d = document; (0, _dom.injectIFrame)(d, boomerangURL); (0, _dom.handleEventFired)(d, 'onBoomerangLoaded', function (e) { if (e.detail.BOOMR) { var BOOMR = e.detail.BOOMR; startBoomerang(BOOMR, options); (0, _commonTagging.addCondeProperties)(BOOMR, options, condeProperties); } }); } var _default = loadBoomerang; exports["default"] = _default; /***/ }), /***/ 78768: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var _require = __webpack_require__(50310), validator = _require.validator, revalidator = _require.revalidator, devalidator = _require.devalidator, decoder = _require.decoder, auditor = _require.auditor; var _require2 = __webpack_require__(31213), paymentNegotiation = _require2.paymentNegotiation; module.exports = { validator: validator, revalidator: revalidator, devalidator: devalidator, decoder: decoder, auditor: auditor, paymentNegotiation: paymentNegotiation }; /***/ }), /***/ 15661: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var zipObject = __webpack_require__(47248); var toDateString = function toDateString(unit) { return { day: 'Date', hour: 'Hours', month: 'Month', year: 'FullYear' }[unit] || 'Date'; }; var addTime = function addTime(date, _ref) { var count = _ref.count, unit = _ref.unit; var clone = new Date(date); var setTime = 'setUTC' + toDateString(unit); var getTime = 'getUTC' + toDateString(unit); clone[setTime](clone[getTime]() + parseInt(count)); return clone; }; var toEpochTime = function toEpochTime(date, _ref2) { var count = _ref2.count, unit = _ref2.unit; return Date.parse(addTime(date, { count: count, unit: unit })); }; var sampleTag = function sampleTag(content) { return content.functionalTags.map(function (tag) { return tag.match(/paywall-sample-for-([0-9]+)-(hour|day|month|year)/); }).filter(function (match) { return !!match; }).map(function (match) { return match && zipObject([null, 'count', 'unit'], match); }).sort(function (a, b) { return toEpochTime(Date.now(), b) - toEpochTime(Date.now(), a); }).shift(); }; /** * Can the content be sampled? * * Content can be sampled if it falls within a sampling period that commences * when the content is published. * * The duration of the sampling period is determined by the presence of a functional * tag that follows the pattern: * paywall-sample-for-- * where count is a number and unit is hour(s), day(s), month(s), or year(s) * For example: * paywall-sample-for-1-hour * paywall-sample-for-5-days * paywall-sample-for-2-months * paywall-sample-for-1-year * * If the content is tagged with a count of 0, the content cannot be sampled. * For example: * paywall-sample-for-0-days * * If no sample tag is added, the content can always be sampled. * * @param {Object} content - Content object * @param {Array} content.functionalTags - List of functional tags * @param {String} content.publishDate - date of publication * @returns {Boolean} True if content can be sampled */ function canBeSampled(content) { if (!sampleTag(content)) { return true; } var _sampleTag = sampleTag(content), count = _sampleTag.count, unit = _sampleTag.unit; var sampleDeadline = toEpochTime(content.publishDate, { count: count, unit: unit }); return Date.now() < sampleDeadline; } module.exports = { addTime: addTime, canBeSampled: canBeSampled }; /***/ }), /***/ 44535: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Content Classifiers var _require = __webpack_require__(88696), isPaywalled = _require.isPaywalled; var _require2 = __webpack_require__(60843), isScoped = _require2.isScoped; var _require3 = __webpack_require__(15661), canBeSampled = _require3.canBeSampled; module.exports = { isPaywalled: isPaywalled, isScoped: isScoped, canBeSampled: canBeSampled }; /***/ }), /***/ 88696: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var includes = __webpack_require__(79859); var PAYWALL_EXCLUDE_TAG = 'paywall-exclude'; /** * Is content behind a paywall * * Every article is behind the paywall except for: * - branded content * - content with the paywall-exclude functional tag * - content with a modelName not included in config.modelNames * @param {Object} content - Content object * @param {String} content.contentType - type of content * @param {Array} content.functionalTags - List of functional tags * @param {boolean} content.isPreview - If content is for editorial preview * @param {Object} config - Config object * @param {Array} config.contentTypes - List of paywalled content types * @returns {Boolean} True if content is paywalled */ function isPaywalled(content, config) { if (!includes(config.contentTypes, content.contentType) || content.isPreview) { return false; } return !includes(content.functionalTags, PAYWALL_EXCLUDE_TAG); } module.exports = { isPaywalled: isPaywalled }; /***/ }), /***/ 60843: /***/ ((module) => { "use strict"; /** * isScoped = is content scoped to a given payment scope * * @param {Object} content - Content object * @param {String} content.channelSlug - the channel slug * @param {String} scope - the payment scope * @returns {Boolean} scoped */ function isScoped(content, scope) { var strategies = { 'sponsorship': function sponsorship() { return true; }, 'ad-pro': function adPro(_ref) { var channelSlug = _ref.channelSlug; return channelSlug === scope; }, 'wired-adfree': function wiredAdfree() { return true; }, 'wired-adrich': function wiredAdrich() { return true; } }; var strategy = strategies[scope]; return scope && strategy && strategy(content); } module.exports = { isScoped: isScoped }; /***/ }), /***/ 31213: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var assign = __webpack_require__(86139); var concat = __webpack_require__(92078); var every = __webpack_require__(19747); var has = __webpack_require__(61448); var includes = __webpack_require__(79859); var map = __webpack_require__(55378); var pick = __webpack_require__(44383); var sortBy = __webpack_require__(33031); var uniq = __webpack_require__(63375); var zipObject = __webpack_require__(47248); var _require = __webpack_require__(44535), isPaywalled = _require.isPaywalled, isScoped = _require.isScoped, canBeSampled = _require.canBeSampled; var validFormsOfPayment = ['sub', // Magazine Subscription 'pass', // Access Pass 'asmp', // Free Sample for Authenticated Users 'usmp', // Free Sample for Unauthenticated Users 'sample', // Free Sample 'free', // Free Content 'tmp' // Temporal free access for newsletter subscribers ]; var validScopesOfPayment = ['sponsorship', // sponsorship takeover 'ad-pro', // Architectural Digest Pro 'wired-adfree', // Wired - Ad Free Experience 'wired-adrich' // Wired - Ad Rich Experience ]; var conditionsOfPayment = function conditionsOfPayment(payment) { return { 'sub': function sub() { return true; }, 'tmp': function tmp() { return true; }, 'pass': function pass(content) { return isScoped(content, payment.scope); }, 'asmp': function asmp(content, config) { return isPaywalled(content, config) && isScoped(content, payment.scope) && canBeSampled(content); }, 'usmp': function usmp(content, config) { return isPaywalled(content, config) && isScoped(content, payment.scope) && canBeSampled(content); }, 'sample': function sample(content, config) { return isPaywalled(content, config) && canBeSampled(content); }, 'free': function free(content, config) { return !isPaywalled(content, config); } }[payment.form]; }; var hasProps = function hasProps(obj, props) { return every(props, function (prop) { return has(obj, prop); }); }; var contentProps = ['channelSlug', 'contentType', 'functionalTags']; var configProps = ['acceptableForms', 'acceptableScopes', 'contentTypes']; /** * paymentNegotiation * * @param {String} tender - request accept-payment header * * @param {Object} content - Content Object * @param {String} content.channelSlug - Type of content * @param {String} content.contentType - Type of content * @param {Array} content.functionalTags - Functional tags on content * @param {boolean} content.isPreview - Is content for preview * * @param {Object} config - Configuration Object * @param {Array} config.acceptableForms - acceptable forms of payment * @param {Array} config.acceptableScopes - acceptable scopes of payment * @param {Array} config.contentTypes - list of paywalled content types * * @returns {Payment} acceptedPayment - accepted payment * @returns {String} acceptedPayment.form - Accepted payment form * @returns {String} acceptedPayment.scope - Content payment scope * @returns {String} acceptedPayment.scopedForm - Scoped accepted payment form * * @returns {Array} acceptableFormsOfTenderedPayment - acceptable forms of payment that were tendered */ function paymentNegotiation(tender, content, config) { if (typeof tender !== 'string') { throw new Error('Payment Service: Invalid Tender'); } if (!hasProps(content, contentProps)) { throw new Error('Payment Service: Invalid Content'); } if (!hasProps(config, configProps)) { throw new Error('Payment Service: Invalid Config'); } var patternFor = function patternFor(form) { return '\\b((' + form + ')(-([^,; $]+))*)(;\\s*q=\\s*([\\.0-9]+))*\\b'; }; var matchingForms = function matchingForms(form) { return tender.match(new RegExp(patternFor(form), 'g')) || []; }; var paymentValues = function paymentValues(form) { return function (string) { return string.match(new RegExp(patternFor(form))) || []; }; }; var paymentKeys = [null, 'scopedForm', 'form', null, 'scope', null, 'quality']; var matchingTender = function matchingTender(form) { return matchingForms(form).map(paymentValues(form)); }; var convertToAPayment = function convertToAPayment(values) { return zipObject(paymentKeys, values); }; var tenderedPayments = validFormsOfPayment.map(matchingTender).reduce(concat, []).map(convertToAPayment); var hasAConfiguredFormOfPayment = function hasAConfiguredFormOfPayment(_ref) { var form = _ref.form; return includes(config.acceptableForms, form); }; var hasAKnownScopeOfPayment = function hasAKnownScopeOfPayment(_ref2) { var scope = _ref2.scope; return !scope || includes(validScopesOfPayment, scope); }; var hasAConfiguredScopeOfPayment = function hasAConfiguredScopeOfPayment(_ref3) { var scope = _ref3.scope; return !scope || includes(config.acceptableScopes, scope); }; var setADefaultQuality = function setADefaultQuality(payment) { return assign({ quality: '1.0' }, payment); }; var isPaymentAcceptable = function isPaymentAcceptable(payment) { return conditionsOfPayment(payment)(content, config); }; var acceptablePayments = tenderedPayments.filter(hasAConfiguredFormOfPayment).filter(hasAKnownScopeOfPayment).filter(hasAConfiguredScopeOfPayment).map(setADefaultQuality).filter(isPaymentAcceptable); var paymentsSortedByQuality = sortBy(acceptablePayments, 'quality'); var higestQualityPayment = paymentsSortedByQuality.pop() || { form: '' }; var acceptedPayment = pick(higestQualityPayment, ['form', 'scope', 'scopedForm']); var acceptableFormsOfTenderedPayment = uniq(map(acceptablePayments, 'form')); var contentClassifiers = { isPaywalled: isPaywalled(content, config), canBeSampled: canBeSampled(content) }; return { acceptedPayment: acceptedPayment, acceptableFormsOfTenderedPayment: acceptableFormsOfTenderedPayment, contentClassifiers: contentClassifiers }; } module.exports = { paymentNegotiation: paymentNegotiation }; /***/ }), /***/ 59794: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var includes = __webpack_require__(79859); var find = __webpack_require__(7309); var trim = __webpack_require__(44826); var _require = __webpack_require__(75749), oneYearInSeconds = _require.oneYearInSeconds; /* * cookie - a CRUD service for storing validation tokens in cookies * * parameters: * document - the web page document * domain - the desired cookie domain or subdomain * */ module.exports = function cookie(_ref) { var document = _ref.document, domain = _ref.domain; var localhosts = ['localhost', '0.0.0.0', '127.0.0.1']; if (document.location) { if (includes(localhosts, document.location.hostname)) { domain = null; } if (document.location.hostname.match(/^local\./)) { domain = null; } } function write(name, value) { var timeToLiveInSeconds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : oneYearInSeconds; var date = new Date(); date.setTime(date.getTime() + timeToLiveInSeconds * 1000); if (domain) { document.cookie = name + '=' + value + ';path=/;domain=' + domain + ';expires=' + date.toUTCString() + ';secure;'; } else { document.cookie = name + '=' + value + ';path=/;expires=' + date.toUTCString() + ';'; } } function remove(name) { if (domain) { document.cookie = name + '=;path=/;domain=' + domain + ';expires=Thu, 01 Jan 1970 00:00:01 GMT;secure;'; } else { document.cookie = name + '=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;'; } } function read(name) { var cookies = document.cookie; if (!cookies || !cookies.length || !name) { return; } var kvPairs = cookies.split(';').map(function (kv) { return kv.split('=').map(trim); }); var _ref2 = find(kvPairs, function (_ref4) { var _ref5 = _slicedToArray(_ref4, 1), key = _ref5[0]; return key === name; }) || [], _ref3 = _slicedToArray(_ref2, 2), value = _ref3[1]; return value; } return { write: write, remove: remove, read: read }; }; /***/ }), /***/ 75749: /***/ ((module) => { "use strict"; var now = function now() { return new Date(Date.now()); }; var asYYYYMMDD = function asYYYYMMDD(date) { return date.getUTCFullYear() * 10000 + (date.getUTCMonth() + 1) * 100 + date.getUTCDate(); }; var getCurrentDate = function getCurrentDate() { return asYYYYMMDD(now()); }; var oneYearInSeconds = 31557600; var fourWeeksInSeconds = 2419200; module.exports = { getCurrentDate: getCurrentDate, oneYearInSeconds: oneYearInSeconds, fourWeeksInSeconds: fourWeeksInSeconds }; /***/ }), /***/ 34833: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var flow = __webpack_require__(49870); var get = __webpack_require__(58156); var isEmpty = __webpack_require__(62193); var set = __webpack_require__(63560); var apply = function apply(func, src) { var dest = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : src; return function (context) { return set(context, dest, func(get(context, src))); }; }; var tokens = { sample: 'smp', asmp: 'asmp', usmp: 'usmp', sub: 'sub', pass: 'pass', tmp: 'tmp' }; var convertFormsToTokens = function convertFormsToTokens(forms) { return forms ? forms.map(function (form) { return tokens[form]; }) : undefined; }; var defaults = ['smp', 'asmp', 'usmp', 'sub', 'pass', 'tmp']; var withFallback = function withFallback(fallback) { return function (value) { return isEmpty(value) ? fallback : value; }; }; var setFallback = withFallback(defaults); var known = ['smp', 'asmp', 'usmp', 'sub', 'pass', 'tmp']; var restrictToKnown = function restrictToKnown(values) { return values.filter(function (token) { return known.includes(token); }); }; var extract = function extract(path) { return function (context) { return get(context, path); }; }; var decodable = flow([apply(convertFormsToTokens, 'acceptableForms', 'decodableTokens'), apply(setFallback, 'decodableTokens'), apply(restrictToKnown, 'decodableTokens'), extract('decodableTokens')]); module.exports = { decodable: decodable, defaults: defaults }; /***/ }), /***/ 50310: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var _require = __webpack_require__(78151), validator = _require.validator, revalidator = _require.revalidator, devalidator = _require.devalidator, decoder = _require.decoder, auditor = _require.auditor; module.exports = { validator: validator, revalidator: revalidator, devalidator: devalidator, decoder: decoder, auditor: auditor }; /***/ }), /***/ 48130: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var base64 = __webpack_require__(85914); /** * codec - This module is responsible for working with JWT * tokens in the browser. */ function codec() { function encode() { console.warn('Encoding JWT tokens in the browser is not supported'); return; } /** * decode - extract the body from a JWT into an object * @param {string} a JWT * @returns {Object} - body on success * @returns {undefined} - undefined on error */ function decode(string) { if (!string) { console.warn('Cannot decode a missing JWT token'); return; } var _string$split = string.split('.'), _string$split2 = _slicedToArray(_string$split, 2), body = _string$split2[1]; if (!body) { console.warn('Cannot decode an improperly formatted JWT token'); return; } var jsonString = void 0; try { jsonString = base64.decode(body); } catch (error) { console.warn('Cannot base64 decode the JWT token'); console.warn(error.toString()); return; } var data = void 0; try { data = JSON.parse(jsonString); } catch (error) { console.warn('Cannot parse the JWT token as JSON'); console.warn(error.toString()); return; } return data; } /** * validate - determine if the format of a JWT is valid * @param {string} a JWT * @returns {boolean} - valid or not valid */ function validate(string) { return !!decode(string); } return { encode: encode, decode: decode, validate: validate }; } module.exports = { codec: codec }; /***/ }), /***/ 91468: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // JWT manipulation var _require = __webpack_require__(59794), cookie = _require.cookie; var _require2 = __webpack_require__(48130), codec = _require2.codec; var operators = __webpack_require__(68658); var tokens = __webpack_require__(37268); module.exports = { cookie: cookie, codec: codec, operators: operators, tokens: tokens }; /***/ }), /***/ 83421: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var set = __webpack_require__(63560); var cookie = __webpack_require__(59794); var tokens = __webpack_require__(37268); var _require = __webpack_require__(48130), codec = _require.codec; module.exports = function (context) { var read = function read() { return cookie(context).read(tokens.asmp); }; var decode = function decode() { return codec(context).decode(read()); }; var addDecodedTokenTo = function addDecodedTokenTo(object) { var token = read(); if (!token) { return; } var payload = decode(); if (!payload) { return; } set(object, 'asmp', payload); }; var updateTokenInStore = function updateTokenInStore() { var storage = context.storage; if (!storage) { return; } var token = read(); if (token) { storage.setItem(tokens.asmp, token); } else { storage.removeItem(tokens.asmp); } }; return { read: read, decode: decode, addDecodedTokenTo: addDecodedTokenTo, updateTokenInStore: updateTokenInStore }; }; /***/ }), /***/ 36029: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var set = __webpack_require__(63560); var cookie = __webpack_require__(59794); var _require = __webpack_require__(75749), fourWeeksInSeconds = _require.fourWeeksInSeconds; var tokens = __webpack_require__(37268); module.exports = function (context) { var read = function read() { return cookie(context).read(tokens.audit); }; var write = function write(value) { return cookie(context).write(tokens.audit, value, fourWeeksInSeconds); }; var updateToken = function updateToken(body) { if (body.requestSuccess && body.tokens && body.tokens.audit) { write(body.tokens.audit); } return body; }; var addEncodedTokenTo = function addEncodedTokenTo(object) { set(object, 'audit', 1); }; var updateTokenInStore = function updateTokenInStore() { var storage = context.storage; if (!storage) { return; } var token = read(); if (token) { storage.setItem(tokens.audit, token); } else { storage.removeItem(tokens.audit); } }; return { read: read, write: write, addEncodedTokenTo: addEncodedTokenTo, updateToken: updateToken, updateTokenInStore: updateTokenInStore }; }; /***/ }), /***/ 1246: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var set = __webpack_require__(63560); var cookie = __webpack_require__(59794); var tokens = __webpack_require__(37268); var _require = __webpack_require__(48130), codec = _require.codec; module.exports = function (context) { var read = function read() { return cookie(context).read(tokens.auth); }; var decode = function decode() { return codec(context).decode(read()); }; var addDecodedTokenTo = function addDecodedTokenTo(object) { var token = read(); if (!token) { return; } var payload = decode(); if (!payload) { return; } set(object, 'auth', payload); }; var addEncodedTokenTo = function addEncodedTokenTo(object) { var token = read(); if (!token) { return; } set(object, 'auth', token); }; var updateTokenInStore = function updateTokenInStore() { var storage = context.storage; if (!storage) { return; } var token = read(); if (token) { storage.setItem(tokens.auth, token); } else { storage.removeItem(tokens.auth); } }; return { read: read, decode: decode, addDecodedTokenTo: addDecodedTokenTo, addEncodedTokenTo: addEncodedTokenTo, updateTokenInStore: updateTokenInStore }; }; /***/ }), /***/ 27737: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var set = __webpack_require__(63560); var cookie = __webpack_require__(59794); var tokens = __webpack_require__(37268); module.exports = function (context) { var read = function read() { return cookie(context).read(tokens.events); }; var decode = function decode() { var events = read(); if (!events) { return []; } return events.split(',').map(function (event) { return event.trim(); }).map(function (event) { return { event: event }; }); }; var remove = function remove() { return cookie(context).remove(tokens.events); }; var addDecodedTokenTo = function addDecodedTokenTo(object) { var token = read(); if (!token) { return; } var payload = decode(); if (!payload) { return; } set(object, 'events', payload); }; var updateTokenInStore = function updateTokenInStore() { var storage = context.storage; if (!storage) { return; } var token = read(); if (token) { storage.setItem(tokens.events, token); } else { storage.removeItem(tokens.events); } }; return { read: read, decode: decode, remove: remove, addDecodedTokenTo: addDecodedTokenTo, updateTokenInStore: updateTokenInStore }; }; /***/ }), /***/ 68658: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var curry = __webpack_require__(49747); var auth = __webpack_require__(1246); var openid = __webpack_require__(54629); var smp = __webpack_require__(95142); var asmp = __webpack_require__(83421); var usmp = __webpack_require__(52489); var pass = __webpack_require__(21521); var sub = __webpack_require__(72308); var tmp = __webpack_require__(2655); var events = __webpack_require__(27737); var audit = __webpack_require__(36029); var modules = { auth: auth, openid: openid, smp: smp, asmp: asmp, usmp: usmp, pass: pass, sub: sub, tmp: tmp, events: events, audit: audit }; module.exports = function (context) { return { read: function read(form) { return modules[form](context).read(); }, decode: function decode(form) { return modules[form](context).decode(); }, write: function write(value) { return function (form) { return modules[form](context).write(value); }; }, remove: function remove(form) { return modules[form](context).remove(); }, addDecodedTokenTo: function addDecodedTokenTo(object) { return function (form) { return modules[form](context).addDecodedTokenTo(object); }; }, addEncodedTokenTo: function addEncodedTokenTo(object) { return function (form) { return modules[form](context).addEncodedTokenTo(object); }; }, removeInvalidToken: function removeInvalidToken(form) { return modules[form](context).removeInvalidToken(); }, requiresRevalidation: function requiresRevalidation(form) { return modules[form](context).requiresRevalidation(); }, isMissing: function isMissing(form) { return modules[form](context).isMissing(); }, updateToken: curry(function (body, form) { return modules[form](context).updateToken(body); }), updateTokenInStore: function updateTokenInStore(form) { return modules[form](context).updateTokenInStore(); } }; }; /***/ }), /***/ 54629: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var set = __webpack_require__(63560); var cookie = __webpack_require__(59794); var tokens = __webpack_require__(37268); var _require = __webpack_require__(48130), codec = _require.codec; module.exports = function (context) { var read = function read() { return cookie(context).read(tokens.openid); }; var decode = function decode() { return codec(context).decode(read()); }; var addDecodedTokenTo = function addDecodedTokenTo(object) { var token = read(); if (!token) { return; } var payload = decode(); if (!payload) { return; } set(object, 'openid', payload); }; var addEncodedTokenTo = function addEncodedTokenTo(object) { var token = read(); if (!token) { return; } set(object, 'openid', token); }; var updateTokenInStore = function updateTokenInStore() { var storage = context.storage; if (!storage) { return; } var token = read(); if (token) { storage.setItem(tokens.openid, token); } else { storage.removeItem(tokens.openid); } }; return { read: read, decode: decode, addDecodedTokenTo: addDecodedTokenTo, addEncodedTokenTo: addEncodedTokenTo, updateTokenInStore: updateTokenInStore }; }; /***/ }), /***/ 21521: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var set = __webpack_require__(63560); var cookie = __webpack_require__(59794); var tokens = __webpack_require__(37268); var _require = __webpack_require__(48130), codec = _require.codec; var _require2 = __webpack_require__(75749), getCurrentDate = _require2.getCurrentDate; module.exports = function (context) { var read = function read() { return cookie(context).read(tokens.pass); }; var decode = function decode() { return codec(context).decode(read()); }; var write = function write(value) { return cookie(context).write(tokens.pass, value); }; var remove = function remove() { return cookie(context).remove(tokens.pass); }; var removeInvalidToken = function removeInvalidToken() { read() && decode() || remove(); }; var requiresRevalidation = function requiresRevalidation() { var token = read(); if (!token) { return; } var payload = decode(); if (!payload || !payload.exp) { return; } var length = payload.exp.toString().length; var currentDate = getCurrentDate(); var exp = Number(payload.exp); return length == 8 && currentDate > exp || length == 6 && currentDate > exp * 100 + 31; }; var isMissing = function isMissing() { var token = read(); if (!token) { return true; } var payload = decode(); if (!payload) { return true; } return false; }; var addDecodedTokenTo = function addDecodedTokenTo(object) { var token = read(); if (!token) { return; } var payload = decode(); if (!payload) { return; } set(object, 'pass', payload); }; var addEncodedTokenTo = function addEncodedTokenTo(object) { var token = read(); if (!token) { return; } set(object, 'pass', token); }; var removeExistingToken = function removeExistingToken(body) { if (body.requestSuccess && body.removeExistingToken) { remove(); } return body; }; var replaceWithNewToken = function replaceWithNewToken(body) { if (body.requestSuccess && body.replaceWithNewToken && body.tokens && body.tokens.pass) { write(body.tokens.pass); } return body; }; var updateToken = function updateToken(body) { removeExistingToken(body); replaceWithNewToken(body); return body; }; var updateTokenInStore = function updateTokenInStore() { var storage = context.storage; if (!storage) { return; } var token = read(); if (token) { storage.setItem(tokens.pass, token); } else { storage.removeItem(tokens.pass); } }; return { read: read, decode: decode, write: write, remove: remove, addDecodedTokenTo: addDecodedTokenTo, addEncodedTokenTo: addEncodedTokenTo, removeInvalidToken: removeInvalidToken, requiresRevalidation: requiresRevalidation, isMissing: isMissing, updateToken: updateToken, updateTokenInStore: updateTokenInStore }; }; /***/ }), /***/ 95142: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var set = __webpack_require__(63560); var cookie = __webpack_require__(59794); var tokens = __webpack_require__(37268); var _require = __webpack_require__(48130), codec = _require.codec; module.exports = function (context) { var read = function read() { return cookie(context).read(tokens.smp); }; var decode = function decode() { return codec(context).decode(read()); }; var addDecodedTokenTo = function addDecodedTokenTo(object) { var token = read(); if (!token) { return; } var payload = decode(); if (!payload) { return; } set(object, 'sample', payload); }; var updateTokenInStore = function updateTokenInStore() { var storage = context.storage; if (!storage) { return; } var token = read(); if (token) { storage.setItem(tokens.smp, token); } else { storage.removeItem(tokens.smp); } }; return { read: read, decode: decode, addDecodedTokenTo: addDecodedTokenTo, updateTokenInStore: updateTokenInStore }; }; /***/ }), /***/ 72308: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var set = __webpack_require__(63560); var cookie = __webpack_require__(59794); var tokens = __webpack_require__(37268); var _require = __webpack_require__(48130), codec = _require.codec; var _require2 = __webpack_require__(75749), getCurrentDate = _require2.getCurrentDate; module.exports = function (context) { var read = function read() { return cookie(context).read(tokens.sub); }; var decode = function decode() { return codec(context).decode(read()); }; var write = function write(value) { return cookie(context).write(tokens.sub, value); }; var remove = function remove() { return cookie(context).remove(tokens.sub); }; var removeInvalidToken = function removeInvalidToken() { read() && decode() || remove(); }; var requiresRevalidation = function requiresRevalidation() { var token = read(); if (!token) { return; } var payload = decode(); if (!payload || !payload.exp) { return; } var length = payload.exp.toString().length; var currentDate = getCurrentDate(); var exp = Number(payload.exp); return length === 8 && currentDate > exp || length === 6 && currentDate > exp * 100 + 31; }; var isMissing = function isMissing() { var token = read(); if (!token) { return true; } var payload = decode(); if (!payload) { return true; } return false; }; var addDecodedTokenTo = function addDecodedTokenTo(object) { var token = read(); if (!token) { return; } var payload = decode(); if (!payload) { return; } set(object, 'sub', payload); }; var addEncodedTokenTo = function addEncodedTokenTo(object) { var token = read(); if (!token) { return; } set(object, 'sub', token); }; var removeExistingToken = function removeExistingToken(body) { if (body.requestSuccess && body.removeExistingToken) { remove(); } return body; }; var replaceWithNewToken = function replaceWithNewToken(body) { if (body.requestSuccess && body.replaceWithNewToken && body.tokens && body.tokens.sub) { write(body.tokens.sub); } return body; }; var updateToken = function updateToken(body) { removeExistingToken(body); replaceWithNewToken(body); return body; }; var updateTokenInStore = function updateTokenInStore() { var storage = context.storage; if (!storage) { return; } var token = read(); if (token) { storage.setItem(tokens.sub, token); } else { storage.removeItem(tokens.sub); } }; return { read: read, decode: decode, write: write, remove: remove, addDecodedTokenTo: addDecodedTokenTo, addEncodedTokenTo: addEncodedTokenTo, removeInvalidToken: removeInvalidToken, requiresRevalidation: requiresRevalidation, isMissing: isMissing, updateToken: updateToken, updateTokenInStore: updateTokenInStore }; }; /***/ }), /***/ 2655: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var set = __webpack_require__(63560); var cookie = __webpack_require__(59794); var tokens = __webpack_require__(37268); var _require = __webpack_require__(48130), codec = _require.codec; module.exports = function (context) { var read = function read() { return cookie(context).read(tokens.tmp); }; var decode = function decode() { return codec(context).decode(read()); }; var addDecodedTokenTo = function addDecodedTokenTo(object) { var token = read(); if (!token) { return; } var payload = decode(); if (!payload) { return; } set(object, 'tmp', payload); }; var addEncodedTokenTo = function addEncodedTokenTo(object) { var token = read(); if (!token) { return; } set(object, 'tmp', token); }; var updateTokenInStore = function updateTokenInStore() { var storage = context.storage; if (!storage) { return; } var token = read(); if (token) { storage.setItem(tokens.tmp, token); } else { storage.removeItem(tokens.tmp); } }; return { read: read, decode: decode, addDecodedTokenTo: addDecodedTokenTo, addEncodedTokenTo: addEncodedTokenTo, updateTokenInStore: updateTokenInStore }; }; /***/ }), /***/ 52489: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var set = __webpack_require__(63560); var cookie = __webpack_require__(59794); var tokens = __webpack_require__(37268); var _require = __webpack_require__(48130), codec = _require.codec; module.exports = function (context) { var read = function read() { return cookie(context).read(tokens.usmp); }; var decode = function decode() { return codec(context).decode(read()); }; var addDecodedTokenTo = function addDecodedTokenTo(object) { var token = read(); if (!token) { return; } var payload = decode(); if (!payload) { return; } set(object, 'usmp', payload); }; var updateTokenInStore = function updateTokenInStore() { var storage = context.storage; if (!storage) { return; } var token = read(); if (token) { storage.setItem(tokens.usmp, token); } else { storage.removeItem(tokens.usmp); } }; return { read: read, decode: decode, addDecodedTokenTo: addDecodedTokenTo, updateTokenInStore: updateTokenInStore }; }; /***/ }), /***/ 37268: /***/ ((module) => { "use strict"; // Token names module.exports = { auth: 'CN_userAuth', openid: 'CN_token_id', smp: 'pay_ent_smp', asmp: 'pay_ent_asmp', usmp: 'pay_ent_usmp', sub: 'pay_ent_sub', pass: 'pay_ent_pass', tmp: 'pay_ent_tmp', events: 'pay_events', audit: 'pay_audit' }; /***/ }), /***/ 56930: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /* * Legacy - Authentication * * Methods to work with legacy implementations of Authentication * * This file should be removed when brands utilize the Verso Authentication * methodology * */ var cookie = __webpack_require__(59794); /* * Read authentication token from context based on token value provided, * currently 'amg_user_partner' */ module.exports = function (context) { var read = function read() { return cookie(context).read('amg_user_partner'); }; return { read: read }; }; /***/ }), /***/ 33272: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /* * Legacy * * Tools that are responsible for providing support related to legacy * configurations of brands. * */ var authentication = __webpack_require__(56930); module.exports = { authentication: authentication }; /***/ }), /***/ 86363: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var flow = __webpack_require__(49870); var get = __webpack_require__(58156); var isEmpty = __webpack_require__(62193); var set = __webpack_require__(63560); var apply = function apply(func, src) { var dest = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : src; return function (context) { return set(context, dest, func(get(context, src))); }; }; var defaults = ['pass', 'sub']; var withFallback = function withFallback(fallback) { return function (value) { return isEmpty(value) ? fallback : value; }; }; var setFallbackForms = withFallback(defaults); var known = ['pass', 'sub']; var isKnown = function isKnown(form) { return known.includes(form); }; var restrictToKnown = function restrictToKnown(values) { return values.filter(isKnown); }; var extract = function extract(path) { return function (context) { return get(context, path); }; }; var validatable = flow([apply(setFallbackForms, 'acceptableForms', 'validatableForms'), apply(restrictToKnown, 'validatableForms'), extract('validatableForms')]); module.exports = { defaults: defaults, validatable: validatable }; /***/ }), /***/ 11553: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var flow = __webpack_require__(49870); var get = __webpack_require__(58156); var set = __webpack_require__(63560); var apply = function apply(func, src) { var dest = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : src; return function (context) { return set(context, dest, func(get(context, src))); }; }; var defaults = ['ad-pro']; var withFallback = function withFallback(fallback) { return function (value) { return !value ? fallback : value; }; }; var setFallback = withFallback(defaults); var known = ['ad-pro', 'wired-adfree', 'wired-adrich']; var isKnown = function isKnown(scope) { return known.includes(scope); }; var restrictToKnown = function restrictToKnown(values) { return values.filter(isKnown); }; var extract = function extract(path) { return function (context) { return get(context, path); }; }; var validatable = flow([apply(setFallback, 'acceptableScopes', 'validatableScopes'), apply(restrictToKnown, 'validatableScopes'), extract('validatableScopes')]); module.exports = { defaults: defaults, validatable: validatable }; /***/ }), /***/ 87601: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // External API requests var _require = __webpack_require__(69146), revalidate = _require.revalidate; var _require2 = __webpack_require__(13707), validate = _require2.validate; module.exports = { revalidate: revalidate, validate: validate }; /***/ }), /***/ 69146: /***/ ((module) => { "use strict"; /* * revalidate request - a POST request to the revalidate endpoint * * parameters: * client - a network client dependency that defaults to fetch * payload - request body in JSON * server - optional revalidation server * */ var revalidate = function revalidate(_ref) { var _ref$client = _ref.client, client = _ref$client === undefined ? fetch : _ref$client, _ref$payload = _ref.payload, payload = _ref$payload === undefined ? {} : _ref$payload, _ref$server = _ref.server, server = _ref$server === undefined ? '' : _ref$server; var path = server + '/api/payment/revalidate'; var options = { method: 'POST', headers: { 'accept': 'application/json', 'content-type': 'application/json' }, credentials: 'same-origin', cache: 'no-cache', body: JSON.stringify(payload) }; if (server) { options.mode = 'cors'; options.credentials = 'include'; } var assertResponseBodyIsPresent = function assertResponseBodyIsPresent(body) { if (!body) { throw new Error('Revalidate request: Empty response body'); } return body; }; var assertRequestIsSuccessful = function assertRequestIsSuccessful(body) { if (!body.requestSuccess) { throw new Error('Revalidate request: ' + body.message); } return body; }; return client(path, options).then(function (response) { return response.json(); }).then(assertResponseBodyIsPresent).then(assertRequestIsSuccessful); }; module.exports = { revalidate: revalidate }; /***/ }), /***/ 13707: /***/ ((module) => { "use strict"; /* * validate request - a POST request to the validation endpoint * * parameters: * client - a network client dependency that defaults to fetch * payload - request body in JSON * server - optional revalidation server * */ var validate = function validate(_ref) { var _ref$client = _ref.client, client = _ref$client === undefined ? fetch : _ref$client, _ref$payload = _ref.payload, payload = _ref$payload === undefined ? {} : _ref$payload, _ref$server = _ref.server, server = _ref$server === undefined ? '' : _ref$server; var path = server + '/api/payment/validate'; var options = { method: 'POST', headers: { 'accept': 'application/json', 'content-type': 'application/json' }, credentials: 'same-origin', cache: 'no-cache', body: JSON.stringify(payload) }; if (server) { options.mode = 'cors'; options.credentials = 'include'; } var assertResponseBodyIsPresent = function assertResponseBodyIsPresent(body) { if (!body) { throw new Error('Validate request: Empty response body'); } return body; }; var assertRequestIsSuccessful = function assertRequestIsSuccessful(body) { if (!body.requestSuccess) { throw new Error('Validate request: ' + body.message); } return body; }; return client(path, options).then(function (response) { return response.json(); }).then(assertResponseBodyIsPresent).then(assertRequestIsSuccessful); }; module.exports = { validate: validate }; /***/ }), /***/ 6021: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var jwt = __webpack_require__(91468); var requests = __webpack_require__(87601); var _require = __webpack_require__(33272), legacyAuthentication = _require.authentication; var paymentForm = __webpack_require__(86363); var paymentScope = __webpack_require__(11553); var mirror = __webpack_require__(60684); var noAuditRequired = Promise.resolve({ requestSuccess: true, message: 'No audit required' }); var noCorrectiveActionRequired = Promise.resolve({ requestSuccess: true, message: 'No corrective action required' }); /* * auditor - a service for auditing the correctness of * authentication and entitlement state. * * The only abnormal state that the auditor is designed to detect * currently is the one where a subscriber has an authentication * token but no entitlement token. Some of our Safari users may be * in this state due to changes in cookie retention policies of * browsers associated with Intelligent Tracking Prevention * (ITP 2.1). If the state is detected a validation request is * made to restore the entitlement tokens. * * Once an audit occurs, an audit token is stored as a cookie in * the user's browser that prevents being re-audited for a period * of one month. * * context: * domain - the cookie domain where the token is stored * document - the web page document * acceptableForms - the list of acceptable forms of payment * acceptableScopes - the list of acceptable payment scopes * client - optional request client * server - optional validation server * storage - optional - storage object from browser (e.g., localStorage) * */ var factory = function factory(context) { return function () { var acceptableForms = paymentForm.validatable(context); var acceptableScopes = paymentScope.validatable(context); var _jwt$operators = jwt.operators(context), read = _jwt$operators.read, isMissing = _jwt$operators.isMissing, updateToken = _jwt$operators.updateToken, addEncodedTokenTo = _jwt$operators.addEncodedTokenTo; // No audit required when one has been recently performed var audit = read('audit'); if (audit) { return noAuditRequired; } // No corrective action required unless the user is authenticated var auth = read('auth'); var openid = read('openid'); var amgUuid = legacyAuthentication(context).read(); if (!auth && !openid && !amgUuid) { return noCorrectiveActionRequired; } // No corrective action required unless an entitlement token is missing var tokensToCorrect = acceptableForms.filter(isMissing); if (tokensToCorrect.length === 0) { return noCorrectiveActionRequired; } var updateTokensInCookieJar = function updateTokensInCookieJar(response) { var isSameOriginRequest = !context.server; if (isSameOriginRequest) { return response; } updateToken(response, 'audit'); tokensToCorrect.forEach(updateToken(response)); return response; }; var updateTokensInStorage = function updateTokensInStorage(response) { return mirror(context).execute().then(function () { return response; }); }; var tokens = {}; var addToken = addEncodedTokenTo(tokens); addToken('auth'); addToken('openid'); addToken('audit'); context.payload = { tokens: tokens, amgUuid: amgUuid, acceptableForms: acceptableForms, acceptableScopes: acceptableScopes }; return requests.validate(context).then(updateTokensInCookieJar).then(updateTokensInStorage); }; }; module.exports = function (context) { return { name: 'auditor', execute: factory(context) }; }; /***/ }), /***/ 45779: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var get = __webpack_require__(58156); var set = __webpack_require__(63560); var jwt = __webpack_require__(91468); var entitlementToken = __webpack_require__(34833); var mirror = __webpack_require__(60684); /* * decoder - a service for decoding payment related tokens * * Two interfaces are available for working with this service: * * context: * document - required document object from browser * document.cookie - optional cookies available on the page * client - optional request client * storage - optional - storage object from browser (e.g., localStorage) * * context: * headers - HTTP header object * headers.cookie - cookie header included with the request or response * client - optional request client * storage - optional - storage object from browser (e.g., localStorage) * */ var decoder = function decoder(context) { var headers = context.headers, document = context.document; if (headers) { set(context, 'document.cookie', get(context, 'headers.cookie')); } if (!headers && !document) { throw new Error('A header or document object must be passed to this service.'); } mirror(context).sync.execute(); var tokens = {}; var decodableTokens = entitlementToken.decodable(context); var paymentTokens = ['events']; var _jwt$operators = jwt.operators(context), addDecodedTokenTo = _jwt$operators.addDecodedTokenTo; decodableTokens.forEach(addDecodedTokenTo(tokens)); paymentTokens.forEach(addDecodedTokenTo(tokens)); return tokens; }; module.exports = function (context) { return { name: 'decoder', execute: function execute() { return Promise.resolve(decoder(context)); }, sync: { execute: function execute() { return decoder(context); } } }; }; /***/ }), /***/ 87360: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var jwt = __webpack_require__(91468); var paymentForm = __webpack_require__(86363); var mirror = __webpack_require__(60684); /* * devalidator - a service for devalidating entitlement * tokens by removing them * * context: * domain - the cookie domain where the token is stored * document - the web page document * acceptableForms - acceptable forms of payment * storage - optional - storage object from browser (e.g., localStorage) * */ var factory = function factory(context) { return function () { var updateTokensInCookieJar = function updateTokensInCookieJar(response) { var paymentForms = paymentForm.validatable(context); var _jwt$operators = jwt.operators(context), remove = _jwt$operators.remove; paymentForms.forEach(remove); return response; }; var updateTokensInStorage = function updateTokensInStorage(response) { return mirror(context).execute().then(function () { return response; }); }; return Promise.resolve().then(updateTokensInCookieJar).then(updateTokensInStorage); }; }; module.exports = function (context) { return { name: 'devalidator', execute: factory(context) }; }; /***/ }), /***/ 78151: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var auditor = __webpack_require__(6021); var decoder = __webpack_require__(45779); var validator = __webpack_require__(92317); var revalidator = __webpack_require__(91354); var devalidator = __webpack_require__(87360); /* * Validation services * * Services that are responsible for all actions and business logic * related to entitlement tokens. * */ module.exports = { auditor: auditor, decoder: decoder, validator: validator, revalidator: revalidator, devalidator: devalidator }; /***/ }), /***/ 60684: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var jwt = __webpack_require__(91468); var entitlementToken = __webpack_require__(34833); /* * mirror - a service for mirroring tokens to local storage * * context: * document.cookie - required - cookies available on the page * storage - optional - storage object from browser (e.g., localStorage) * client - optional - request client * */ var mirror = function mirror(context) { var decodableTokens = entitlementToken.decodable(context); var _jwt$operators = jwt.operators(context), updateTokenInStore = _jwt$operators.updateTokenInStore; decodableTokens.forEach(updateTokenInStore); }; module.exports = function (context) { return { name: 'mirror', execute: function execute() { return Promise.resolve(mirror(context)); }, sync: { execute: function execute() { return mirror(context); } } }; }; /***/ }), /***/ 91354: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var jwt = __webpack_require__(91468); var requests = __webpack_require__(87601); var _require = __webpack_require__(33272), legacyAuthentication = _require.authentication; var paymentForm = __webpack_require__(86363); var paymentScope = __webpack_require__(11553); var mirror = __webpack_require__(60684); var noRevalidationRequired = Promise.resolve({ requestSuccess: true, message: 'No revalidation required' }); /* * revalidator - a service for revalidating entitlements * by updating/removing entitlement tokens * * context: * domain - the cookie domain where the token is stored * document - the web page document * client - optional request client * server - optional revalidation server * acceptableForms - acceptable forms of payment * acceptableScopes - acceptable payment scopes * storage - optional - storage object from browser (e.g., localStorage) * */ var factory = function factory(context) { return function () { var acceptableForms = paymentForm.validatable(context); var acceptableScopes = paymentScope.validatable(context); var _jwt$operators = jwt.operators(context), removeInvalidToken = _jwt$operators.removeInvalidToken, requiresRevalidation = _jwt$operators.requiresRevalidation, updateToken = _jwt$operators.updateToken, addEncodedTokenTo = _jwt$operators.addEncodedTokenTo; var updateTokensInCookieJar = function updateTokensInCookieJar(response) { var isSameOriginRequest = !context.server; if (isSameOriginRequest) { return response; } acceptableForms.forEach(updateToken(response)); return response; }; var updateTokensInStorage = function updateTokensInStorage(response) { return mirror(context).execute().then(function () { return response; }); }; acceptableForms.forEach(removeInvalidToken); var revalidationForms = acceptableForms.filter(requiresRevalidation); if (revalidationForms.length === 0) { return noRevalidationRequired; } var tokens = {}; var addToken = addEncodedTokenTo(tokens); addToken('auth'); addToken('openid'); revalidationForms.forEach(addToken); context.payload = { tokens: tokens, amgUuid: legacyAuthentication(context).read(), acceptableForms: acceptableForms, acceptableScopes: acceptableScopes }; return requests.revalidate(context).then(updateTokensInCookieJar).then(updateTokensInStorage); }; }; module.exports = function (context) { return { name: 'revalidator', execute: factory(context) }; }; /***/ }), /***/ 92317: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var requests = __webpack_require__(87601); var jwt = __webpack_require__(91468); var paymentForm = __webpack_require__(86363); var paymentScope = __webpack_require__(11553); var mirror = __webpack_require__(60684); var notIdentified = Promise.resolve({ message: 'User is not identified', requestSuccess: true }); /* * validator - a service for creating tokens that * validate when a user has paid for content * * context: * domain - the cookie domain where the token is to be stored * document - the web page document * client - optional request client (defaults to fetch) * server - optional revalidation server * acceptableForms - acceptable forms of payment * acceptableScopes - acceptable payment scopes * storage - optional - storage object from browser (e.g., localStorage) * */ var factory = function factory(context) { return function () { var acceptableForms = paymentForm.validatable(context); var acceptableScopes = paymentScope.validatable(context); var _jwt$operators = jwt.operators(context), updateToken = _jwt$operators.updateToken, addEncodedTokenTo = _jwt$operators.addEncodedTokenTo; var updateTokensInCookieJar = function updateTokensInCookieJar(response) { var isSameOriginRequest = !context.server; if (isSameOriginRequest) { return response; } acceptableForms.forEach(updateToken(response)); return response; }; var updateTokensInStorage = function updateTokensInStorage(response) { return mirror(context).execute().then(function () { return response; }); }; var tokens = {}; var addToken = addEncodedTokenTo(tokens); addToken('auth'); addToken('openid'); acceptableForms.forEach(addToken); if (!tokens.auth && !tokens.openid) { return notIdentified; } context.payload = { tokens: tokens, acceptableForms: acceptableForms, acceptableScopes: acceptableScopes }; return requests.validate(context).then(updateTokensInCookieJar).then(updateTokensInStorage); }; }; module.exports = function (context) { return { name: 'validator', execute: factory(context) }; }; /***/ }), /***/ 14961: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ var $protobuf = __webpack_require__(26946); // Common aliases var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); $root.id_mapper = (function() { /** * Namespace id_mapper. * @exports id_mapper * @namespace */ var id_mapper = {}; id_mapper.AssociationsResult = (function() { /** * Properties of an AssociationsResult. * @memberof id_mapper * @interface IAssociationsResult * @property {Array.|null} [idSets] AssociationsResult idSets */ /** * Constructs a new AssociationsResult. * @memberof id_mapper * @classdesc Represents an AssociationsResult. * @implements IAssociationsResult * @constructor * @param {id_mapper.IAssociationsResult=} [properties] Properties to set */ function AssociationsResult(properties) { this.idSets = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * AssociationsResult idSets. * @member {Array.} idSets * @memberof id_mapper.AssociationsResult * @instance */ AssociationsResult.prototype.idSets = $util.emptyArray; /** * Creates a new AssociationsResult instance using the specified properties. * @function create * @memberof id_mapper.AssociationsResult * @static * @param {id_mapper.IAssociationsResult=} [properties] Properties to set * @returns {id_mapper.AssociationsResult} AssociationsResult instance */ AssociationsResult.create = function create(properties) { return new AssociationsResult(properties); }; /** * Encodes the specified AssociationsResult message. Does not implicitly {@link id_mapper.AssociationsResult.verify|verify} messages. * @function encode * @memberof id_mapper.AssociationsResult * @static * @param {id_mapper.IAssociationsResult} message AssociationsResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ AssociationsResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.idSets != null && message.idSets.length) for (var i = 0; i < message.idSets.length; ++i) $root.id_mapper.IdSet.encode(message.idSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** * Encodes the specified AssociationsResult message, length delimited. Does not implicitly {@link id_mapper.AssociationsResult.verify|verify} messages. * @function encodeDelimited * @memberof id_mapper.AssociationsResult * @static * @param {id_mapper.IAssociationsResult} message AssociationsResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ AssociationsResult.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an AssociationsResult message from the specified reader or buffer. * @function decode * @memberof id_mapper.AssociationsResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {id_mapper.AssociationsResult} AssociationsResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ AssociationsResult.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.id_mapper.AssociationsResult(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (!(message.idSets && message.idSets.length)) message.idSets = []; message.idSets.push($root.id_mapper.IdSet.decode(reader, reader.uint32())); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an AssociationsResult message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof id_mapper.AssociationsResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {id_mapper.AssociationsResult} AssociationsResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ AssociationsResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an AssociationsResult message. * @function verify * @memberof id_mapper.AssociationsResult * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ AssociationsResult.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.idSets != null && message.hasOwnProperty("idSets")) { if (!Array.isArray(message.idSets)) return "idSets: array expected"; for (var i = 0; i < message.idSets.length; ++i) { var error = $root.id_mapper.IdSet.verify(message.idSets[i]); if (error) return "idSets." + error; } } return null; }; /** * Creates an AssociationsResult message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof id_mapper.AssociationsResult * @static * @param {Object.} object Plain object * @returns {id_mapper.AssociationsResult} AssociationsResult */ AssociationsResult.fromObject = function fromObject(object) { if (object instanceof $root.id_mapper.AssociationsResult) return object; var message = new $root.id_mapper.AssociationsResult(); if (object.idSets) { if (!Array.isArray(object.idSets)) throw TypeError(".id_mapper.AssociationsResult.idSets: array expected"); message.idSets = []; for (var i = 0; i < object.idSets.length; ++i) { if (typeof object.idSets[i] !== "object") throw TypeError(".id_mapper.AssociationsResult.idSets: object expected"); message.idSets[i] = $root.id_mapper.IdSet.fromObject(object.idSets[i]); } } return message; }; /** * Creates a plain object from an AssociationsResult message. Also converts values to other types if specified. * @function toObject * @memberof id_mapper.AssociationsResult * @static * @param {id_mapper.AssociationsResult} message AssociationsResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ AssociationsResult.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.idSets = []; if (message.idSets && message.idSets.length) { object.idSets = []; for (var j = 0; j < message.idSets.length; ++j) object.idSets[j] = $root.id_mapper.IdSet.toObject(message.idSets[j], options); } return object; }; /** * Converts this AssociationsResult to JSON. * @function toJSON * @memberof id_mapper.AssociationsResult * @instance * @returns {Object.} JSON object */ AssociationsResult.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for AssociationsResult * @function getTypeUrl * @memberof id_mapper.AssociationsResult * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ AssociationsResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/id_mapper.AssociationsResult"; }; return AssociationsResult; })(); id_mapper.AssociationsRequest = (function() { /** * Properties of an AssociationsRequest. * @memberof id_mapper * @interface IAssociationsRequest * @property {google.protobuf.IFieldMask|null} [fieldMask] AssociationsRequest fieldMask * @property {Array.|null} [idSets] AssociationsRequest idSets */ /** * Constructs a new AssociationsRequest. * @memberof id_mapper * @classdesc Represents an AssociationsRequest. * @implements IAssociationsRequest * @constructor * @param {id_mapper.IAssociationsRequest=} [properties] Properties to set */ function AssociationsRequest(properties) { this.idSets = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * AssociationsRequest fieldMask. * @member {google.protobuf.IFieldMask|null|undefined} fieldMask * @memberof id_mapper.AssociationsRequest * @instance */ AssociationsRequest.prototype.fieldMask = null; /** * AssociationsRequest idSets. * @member {Array.} idSets * @memberof id_mapper.AssociationsRequest * @instance */ AssociationsRequest.prototype.idSets = $util.emptyArray; /** * Creates a new AssociationsRequest instance using the specified properties. * @function create * @memberof id_mapper.AssociationsRequest * @static * @param {id_mapper.IAssociationsRequest=} [properties] Properties to set * @returns {id_mapper.AssociationsRequest} AssociationsRequest instance */ AssociationsRequest.create = function create(properties) { return new AssociationsRequest(properties); }; /** * Encodes the specified AssociationsRequest message. Does not implicitly {@link id_mapper.AssociationsRequest.verify|verify} messages. * @function encode * @memberof id_mapper.AssociationsRequest * @static * @param {id_mapper.IAssociationsRequest} message AssociationsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ AssociationsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.idSets != null && message.idSets.length) for (var i = 0; i < message.idSets.length; ++i) $root.id_mapper.IdSet.encode(message.idSets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** * Encodes the specified AssociationsRequest message, length delimited. Does not implicitly {@link id_mapper.AssociationsRequest.verify|verify} messages. * @function encodeDelimited * @memberof id_mapper.AssociationsRequest * @static * @param {id_mapper.IAssociationsRequest} message AssociationsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ AssociationsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an AssociationsRequest message from the specified reader or buffer. * @function decode * @memberof id_mapper.AssociationsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {id_mapper.AssociationsRequest} AssociationsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ AssociationsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.id_mapper.AssociationsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } case 2: { if (!(message.idSets && message.idSets.length)) message.idSets = []; message.idSets.push($root.id_mapper.IdSet.decode(reader, reader.uint32())); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an AssociationsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof id_mapper.AssociationsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {id_mapper.AssociationsRequest} AssociationsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ AssociationsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an AssociationsRequest message. * @function verify * @memberof id_mapper.AssociationsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ AssociationsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); if (error) return "fieldMask." + error; } if (message.idSets != null && message.hasOwnProperty("idSets")) { if (!Array.isArray(message.idSets)) return "idSets: array expected"; for (var i = 0; i < message.idSets.length; ++i) { var error = $root.id_mapper.IdSet.verify(message.idSets[i]); if (error) return "idSets." + error; } } return null; }; /** * Creates an AssociationsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof id_mapper.AssociationsRequest * @static * @param {Object.} object Plain object * @returns {id_mapper.AssociationsRequest} AssociationsRequest */ AssociationsRequest.fromObject = function fromObject(object) { if (object instanceof $root.id_mapper.AssociationsRequest) return object; var message = new $root.id_mapper.AssociationsRequest(); if (object.fieldMask != null) { if (typeof object.fieldMask !== "object") throw TypeError(".id_mapper.AssociationsRequest.fieldMask: object expected"); message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); } if (object.idSets) { if (!Array.isArray(object.idSets)) throw TypeError(".id_mapper.AssociationsRequest.idSets: array expected"); message.idSets = []; for (var i = 0; i < object.idSets.length; ++i) { if (typeof object.idSets[i] !== "object") throw TypeError(".id_mapper.AssociationsRequest.idSets: object expected"); message.idSets[i] = $root.id_mapper.IdSet.fromObject(object.idSets[i]); } } return message; }; /** * Creates a plain object from an AssociationsRequest message. Also converts values to other types if specified. * @function toObject * @memberof id_mapper.AssociationsRequest * @static * @param {id_mapper.AssociationsRequest} message AssociationsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ AssociationsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.idSets = []; if (options.defaults) object.fieldMask = null; if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); if (message.idSets && message.idSets.length) { object.idSets = []; for (var j = 0; j < message.idSets.length; ++j) object.idSets[j] = $root.id_mapper.IdSet.toObject(message.idSets[j], options); } return object; }; /** * Converts this AssociationsRequest to JSON. * @function toJSON * @memberof id_mapper.AssociationsRequest * @instance * @returns {Object.} JSON object */ AssociationsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for AssociationsRequest * @function getTypeUrl * @memberof id_mapper.AssociationsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ AssociationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/id_mapper.AssociationsRequest"; }; return AssociationsRequest; })(); id_mapper.AssociationsResponse = (function() { /** * Properties of an AssociationsResponse. * @memberof id_mapper * @interface IAssociationsResponse * @property {Array.|null} [result] AssociationsResponse result */ /** * Constructs a new AssociationsResponse. * @memberof id_mapper * @classdesc Represents an AssociationsResponse. * @implements IAssociationsResponse * @constructor * @param {id_mapper.IAssociationsResponse=} [properties] Properties to set */ function AssociationsResponse(properties) { this.result = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * AssociationsResponse result. * @member {Array.} result * @memberof id_mapper.AssociationsResponse * @instance */ AssociationsResponse.prototype.result = $util.emptyArray; /** * Creates a new AssociationsResponse instance using the specified properties. * @function create * @memberof id_mapper.AssociationsResponse * @static * @param {id_mapper.IAssociationsResponse=} [properties] Properties to set * @returns {id_mapper.AssociationsResponse} AssociationsResponse instance */ AssociationsResponse.create = function create(properties) { return new AssociationsResponse(properties); }; /** * Encodes the specified AssociationsResponse message. Does not implicitly {@link id_mapper.AssociationsResponse.verify|verify} messages. * @function encode * @memberof id_mapper.AssociationsResponse * @static * @param {id_mapper.IAssociationsResponse} message AssociationsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ AssociationsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.result != null && message.result.length) for (var i = 0; i < message.result.length; ++i) $root.id_mapper.AssociationsResult.encode(message.result[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** * Encodes the specified AssociationsResponse message, length delimited. Does not implicitly {@link id_mapper.AssociationsResponse.verify|verify} messages. * @function encodeDelimited * @memberof id_mapper.AssociationsResponse * @static * @param {id_mapper.IAssociationsResponse} message AssociationsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ AssociationsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an AssociationsResponse message from the specified reader or buffer. * @function decode * @memberof id_mapper.AssociationsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {id_mapper.AssociationsResponse} AssociationsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ AssociationsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.id_mapper.AssociationsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (!(message.result && message.result.length)) message.result = []; message.result.push($root.id_mapper.AssociationsResult.decode(reader, reader.uint32())); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an AssociationsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof id_mapper.AssociationsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {id_mapper.AssociationsResponse} AssociationsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ AssociationsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an AssociationsResponse message. * @function verify * @memberof id_mapper.AssociationsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ AssociationsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.result != null && message.hasOwnProperty("result")) { if (!Array.isArray(message.result)) return "result: array expected"; for (var i = 0; i < message.result.length; ++i) { var error = $root.id_mapper.AssociationsResult.verify(message.result[i]); if (error) return "result." + error; } } return null; }; /** * Creates an AssociationsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof id_mapper.AssociationsResponse * @static * @param {Object.} object Plain object * @returns {id_mapper.AssociationsResponse} AssociationsResponse */ AssociationsResponse.fromObject = function fromObject(object) { if (object instanceof $root.id_mapper.AssociationsResponse) return object; var message = new $root.id_mapper.AssociationsResponse(); if (object.result) { if (!Array.isArray(object.result)) throw TypeError(".id_mapper.AssociationsResponse.result: array expected"); message.result = []; for (var i = 0; i < object.result.length; ++i) { if (typeof object.result[i] !== "object") throw TypeError(".id_mapper.AssociationsResponse.result: object expected"); message.result[i] = $root.id_mapper.AssociationsResult.fromObject(object.result[i]); } } return message; }; /** * Creates a plain object from an AssociationsResponse message. Also converts values to other types if specified. * @function toObject * @memberof id_mapper.AssociationsResponse * @static * @param {id_mapper.AssociationsResponse} message AssociationsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ AssociationsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.result = []; if (message.result && message.result.length) { object.result = []; for (var j = 0; j < message.result.length; ++j) object.result[j] = $root.id_mapper.AssociationsResult.toObject(message.result[j], options); } return object; }; /** * Converts this AssociationsResponse to JSON. * @function toJSON * @memberof id_mapper.AssociationsResponse * @instance * @returns {Object.} JSON object */ AssociationsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for AssociationsResponse * @function getTypeUrl * @memberof id_mapper.AssociationsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ AssociationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/id_mapper.AssociationsResponse"; }; return AssociationsResponse; })(); /** * IdType enum. * @name id_mapper.IdType * @enum {number} * @property {number} UNRECOGNIZED=0 UNRECOGNIZED value * @property {number} xid=1 xid value * @property {number} XID=1 XID value * @property {number} amg=2 amg value * @property {number} AMG=2 AMG value * @property {number} permutive=3 permutive value * @property {number} PERMUTIVE=3 PERMUTIVE value * @property {number} email_sha256=4 email_sha256 value * @property {number} emailhash=4 emailhash value * @property {number} EMAILHASH=4 EMAILHASH value */ id_mapper.IdType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "UNRECOGNIZED"] = 0; values[valuesById[1] = "xid"] = 1; values["XID"] = 1; values[valuesById[2] = "amg"] = 2; values["AMG"] = 2; values[valuesById[3] = "permutive"] = 3; values["PERMUTIVE"] = 3; values[valuesById[4] = "email_sha256"] = 4; values["emailhash"] = 4; values["EMAILHASH"] = 4; return values; })(); id_mapper.Id = (function() { /** * Properties of an Id. * @memberof id_mapper * @interface IId * @property {id_mapper.IdType|null} [type] Id type * @property {string|null} [value] Id value */ /** * Constructs a new Id. * @memberof id_mapper * @classdesc Represents an Id. * @implements IId * @constructor * @param {id_mapper.IId=} [properties] Properties to set */ function Id(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Id type. * @member {id_mapper.IdType} type * @memberof id_mapper.Id * @instance */ Id.prototype.type = 0; /** * Id value. * @member {string} value * @memberof id_mapper.Id * @instance */ Id.prototype.value = ""; /** * Creates a new Id instance using the specified properties. * @function create * @memberof id_mapper.Id * @static * @param {id_mapper.IId=} [properties] Properties to set * @returns {id_mapper.Id} Id instance */ Id.create = function create(properties) { return new Id(properties); }; /** * Encodes the specified Id message. Does not implicitly {@link id_mapper.Id.verify|verify} messages. * @function encode * @memberof id_mapper.Id * @static * @param {id_mapper.IId} message Id message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Id.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); if (message.value != null && Object.hasOwnProperty.call(message, "value")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); return writer; }; /** * Encodes the specified Id message, length delimited. Does not implicitly {@link id_mapper.Id.verify|verify} messages. * @function encodeDelimited * @memberof id_mapper.Id * @static * @param {id_mapper.IId} message Id message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Id.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an Id message from the specified reader or buffer. * @function decode * @memberof id_mapper.Id * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {id_mapper.Id} Id * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Id.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.id_mapper.Id(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { message.type = reader.int32(); break; } case 2: { message.value = reader.string(); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an Id message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof id_mapper.Id * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {id_mapper.Id} Id * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Id.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an Id message. * @function verify * @memberof id_mapper.Id * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Id.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.type != null && message.hasOwnProperty("type")) switch (message.type) { default: return "type: enum value expected"; case 0: case 1: case 1: case 2: case 2: case 3: case 3: case 4: case 4: case 4: break; } if (message.value != null && message.hasOwnProperty("value")) if (!$util.isString(message.value)) return "value: string expected"; return null; }; /** * Creates an Id message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof id_mapper.Id * @static * @param {Object.} object Plain object * @returns {id_mapper.Id} Id */ Id.fromObject = function fromObject(object) { if (object instanceof $root.id_mapper.Id) return object; var message = new $root.id_mapper.Id(); switch (object.type) { default: if (typeof object.type === "number") { message.type = object.type; break; } break; case "UNRECOGNIZED": case 0: message.type = 0; break; case "xid": case 1: message.type = 1; break; case "XID": case 1: message.type = 1; break; case "amg": case 2: message.type = 2; break; case "AMG": case 2: message.type = 2; break; case "permutive": case 3: message.type = 3; break; case "PERMUTIVE": case 3: message.type = 3; break; case "email_sha256": case 4: message.type = 4; break; case "emailhash": case 4: message.type = 4; break; case "EMAILHASH": case 4: message.type = 4; break; } if (object.value != null) message.value = String(object.value); return message; }; /** * Creates a plain object from an Id message. Also converts values to other types if specified. * @function toObject * @memberof id_mapper.Id * @static * @param {id_mapper.Id} message Id * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Id.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.type = options.enums === String ? "UNRECOGNIZED" : 0; object.value = ""; } if (message.type != null && message.hasOwnProperty("type")) object.type = options.enums === String ? $root.id_mapper.IdType[message.type] === undefined ? message.type : $root.id_mapper.IdType[message.type] : message.type; if (message.value != null && message.hasOwnProperty("value")) object.value = message.value; return object; }; /** * Converts this Id to JSON. * @function toJSON * @memberof id_mapper.Id * @instance * @returns {Object.} JSON object */ Id.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for Id * @function getTypeUrl * @memberof id_mapper.Id * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ Id.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/id_mapper.Id"; }; return Id; })(); id_mapper.IdSet = (function() { /** * Properties of an IdSet. * @memberof id_mapper * @interface IIdSet * @property {string|null} [idmProfileId] IdSet idmProfileId * @property {Array.|null} [ids] IdSet ids */ /** * Constructs a new IdSet. * @memberof id_mapper * @classdesc Represents an IdSet. * @implements IIdSet * @constructor * @param {id_mapper.IIdSet=} [properties] Properties to set */ function IdSet(properties) { this.ids = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * IdSet idmProfileId. * @member {string} idmProfileId * @memberof id_mapper.IdSet * @instance */ IdSet.prototype.idmProfileId = ""; /** * IdSet ids. * @member {Array.} ids * @memberof id_mapper.IdSet * @instance */ IdSet.prototype.ids = $util.emptyArray; /** * Creates a new IdSet instance using the specified properties. * @function create * @memberof id_mapper.IdSet * @static * @param {id_mapper.IIdSet=} [properties] Properties to set * @returns {id_mapper.IdSet} IdSet instance */ IdSet.create = function create(properties) { return new IdSet(properties); }; /** * Encodes the specified IdSet message. Does not implicitly {@link id_mapper.IdSet.verify|verify} messages. * @function encode * @memberof id_mapper.IdSet * @static * @param {id_mapper.IIdSet} message IdSet message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ IdSet.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.idmProfileId != null && Object.hasOwnProperty.call(message, "idmProfileId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.idmProfileId); if (message.ids != null && message.ids.length) for (var i = 0; i < message.ids.length; ++i) $root.id_mapper.Id.encode(message.ids[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** * Encodes the specified IdSet message, length delimited. Does not implicitly {@link id_mapper.IdSet.verify|verify} messages. * @function encodeDelimited * @memberof id_mapper.IdSet * @static * @param {id_mapper.IIdSet} message IdSet message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ IdSet.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an IdSet message from the specified reader or buffer. * @function decode * @memberof id_mapper.IdSet * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {id_mapper.IdSet} IdSet * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ IdSet.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.id_mapper.IdSet(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { message.idmProfileId = reader.string(); break; } case 2: { if (!(message.ids && message.ids.length)) message.ids = []; message.ids.push($root.id_mapper.Id.decode(reader, reader.uint32())); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an IdSet message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof id_mapper.IdSet * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {id_mapper.IdSet} IdSet * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ IdSet.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an IdSet message. * @function verify * @memberof id_mapper.IdSet * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ IdSet.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.idmProfileId != null && message.hasOwnProperty("idmProfileId")) if (!$util.isString(message.idmProfileId)) return "idmProfileId: string expected"; if (message.ids != null && message.hasOwnProperty("ids")) { if (!Array.isArray(message.ids)) return "ids: array expected"; for (var i = 0; i < message.ids.length; ++i) { var error = $root.id_mapper.Id.verify(message.ids[i]); if (error) return "ids." + error; } } return null; }; /** * Creates an IdSet message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof id_mapper.IdSet * @static * @param {Object.} object Plain object * @returns {id_mapper.IdSet} IdSet */ IdSet.fromObject = function fromObject(object) { if (object instanceof $root.id_mapper.IdSet) return object; var message = new $root.id_mapper.IdSet(); if (object.idmProfileId != null) message.idmProfileId = String(object.idmProfileId); if (object.ids) { if (!Array.isArray(object.ids)) throw TypeError(".id_mapper.IdSet.ids: array expected"); message.ids = []; for (var i = 0; i < object.ids.length; ++i) { if (typeof object.ids[i] !== "object") throw TypeError(".id_mapper.IdSet.ids: object expected"); message.ids[i] = $root.id_mapper.Id.fromObject(object.ids[i]); } } return message; }; /** * Creates a plain object from an IdSet message. Also converts values to other types if specified. * @function toObject * @memberof id_mapper.IdSet * @static * @param {id_mapper.IdSet} message IdSet * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ IdSet.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.ids = []; if (options.defaults) object.idmProfileId = ""; if (message.idmProfileId != null && message.hasOwnProperty("idmProfileId")) object.idmProfileId = message.idmProfileId; if (message.ids && message.ids.length) { object.ids = []; for (var j = 0; j < message.ids.length; ++j) object.ids[j] = $root.id_mapper.Id.toObject(message.ids[j], options); } return object; }; /** * Converts this IdSet to JSON. * @function toJSON * @memberof id_mapper.IdSet * @instance * @returns {Object.} JSON object */ IdSet.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for IdSet * @function getTypeUrl * @memberof id_mapper.IdSet * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ IdSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/id_mapper.IdSet"; }; return IdSet; })(); return id_mapper; })(); $root.google = (function() { /** * Namespace google. * @exports google * @namespace */ var google = {}; google.protobuf = (function() { /** * Namespace protobuf. * @memberof google * @namespace */ var protobuf = {}; protobuf.FieldMask = (function() { /** * Properties of a FieldMask. * @memberof google.protobuf * @interface IFieldMask * @property {Array.|null} [paths] FieldMask paths */ /** * Constructs a new FieldMask. * @memberof google.protobuf * @classdesc Represents a FieldMask. * @implements IFieldMask * @constructor * @param {google.protobuf.IFieldMask=} [properties] Properties to set */ function FieldMask(properties) { this.paths = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * FieldMask paths. * @member {Array.} paths * @memberof google.protobuf.FieldMask * @instance */ FieldMask.prototype.paths = $util.emptyArray; /** * Creates a new FieldMask instance using the specified properties. * @function create * @memberof google.protobuf.FieldMask * @static * @param {google.protobuf.IFieldMask=} [properties] Properties to set * @returns {google.protobuf.FieldMask} FieldMask instance */ FieldMask.create = function create(properties) { return new FieldMask(properties); }; /** * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. * @function encode * @memberof google.protobuf.FieldMask * @static * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FieldMask.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.paths != null && message.paths.length) for (var i = 0; i < message.paths.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); return writer; }; /** * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.FieldMask * @static * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FieldMask.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a FieldMask message from the specified reader or buffer. * @function decode * @memberof google.protobuf.FieldMask * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.FieldMask} FieldMask * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FieldMask.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (!(message.paths && message.paths.length)) message.paths = []; message.paths.push(reader.string()); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a FieldMask message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.FieldMask * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.FieldMask} FieldMask * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FieldMask.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a FieldMask message. * @function verify * @memberof google.protobuf.FieldMask * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ FieldMask.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.paths != null && message.hasOwnProperty("paths")) { if (!Array.isArray(message.paths)) return "paths: array expected"; for (var i = 0; i < message.paths.length; ++i) if (!$util.isString(message.paths[i])) return "paths: string[] expected"; } return null; }; /** * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.FieldMask * @static * @param {Object.} object Plain object * @returns {google.protobuf.FieldMask} FieldMask */ FieldMask.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.FieldMask) return object; var message = new $root.google.protobuf.FieldMask(); if (object.paths) { if (!Array.isArray(object.paths)) throw TypeError(".google.protobuf.FieldMask.paths: array expected"); message.paths = []; for (var i = 0; i < object.paths.length; ++i) message.paths[i] = String(object.paths[i]); } return message; }; /** * Creates a plain object from a FieldMask message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.FieldMask * @static * @param {google.protobuf.FieldMask} message FieldMask * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ FieldMask.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.paths = []; if (message.paths && message.paths.length) { object.paths = []; for (var j = 0; j < message.paths.length; ++j) object.paths[j] = message.paths[j]; } return object; }; /** * Converts this FieldMask to JSON. * @function toJSON * @memberof google.protobuf.FieldMask * @instance * @returns {Object.} JSON object */ FieldMask.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for FieldMask * @function getTypeUrl * @memberof google.protobuf.FieldMask * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/google.protobuf.FieldMask"; }; return FieldMask; })(); return protobuf; })(); return google; })(); module.exports = $root; /***/ }), /***/ 82669: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * A JsonML node represented as an Array or string value * @typedef {Array/string} JsonML */ /** * Determine if a value is an Array * * @param {any} val - parameter to be evaluated * @return {boolean} true if an Array instance */ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } var isArray = Array.isArray || function isArray(val) { return val instanceof Array; }; /** * Identify if JsonML node represents a DocumentFragment * * @param {JsonML} jml - JsonML node * @return {boolean} true if representing a DocumentFragment */ exports.isFragment = function isFragment(jml) { return isArray(jml) && jml[0] === ''; }; /** * Identify if value is a raw Markup element * * @param {any} value - value to test * @return {boolean} true if representing a raw Markup element */ var isMarkup = exports.isMarkup = function isMarkup(value) { return value && value.isMarkup === true || false; }; /** * Get the element tag name for the current JsonML node * * @param {JsonML} jml - JsonML node * @return {string} tag name if available, otherwise an empty string */ exports.getTagName = function getTagName(jml) { return jml[0] || ''; }; /** * Identify if a parameter is a string * * @param {any} str - parameter to evaluate * @return {boolean} true if a string literal */ function isString(str) { return typeof str === 'string'; } /** * Identify a valid JsonML node (element) * * @param {any} jml - parameter to evaluate * @return {boolean} true if a valid JsonML node */ var isElement = exports.isElement = function isElement(jml) { return isArray(jml) && isString(jml[0]) || isString(jml); }; /** * Identify a JsonML attributes object * * @param {any} jml - parameter to evaluate * @return {boolean} true if an attributes object */ var isAttributes = exports.isAttributes = function isAttributes(jml) { return !!jml && _typeof(jml) === 'object' && !isArray(jml); }; /** * Determine if a JsonML node has an associated attributes object * Will return true even if attributes are empty * * @param {JsonML} jml - JsonML node * @return {boolean} true if the node has an attributes object */ var hasAttributes = exports.hasAttributes = function hasAttributes(jml) { if (!isElement(jml)) { throw new SyntaxError('invalid JsonML'); } return isAttributes(jml[1]); }; /** * Get attributes associated with a JsonML node and optionally initialize an empty object * * @param {JsonML} jml - JsonML node * @param {boolean} [addIfMissing] - optionally initialize an empty attributes object * @return {Object} JsonML attributes */ var getAttributes = exports.getAttributes = function getAttributes(jml, addIfMissing) { if (hasAttributes(jml)) { return jml[1]; } if (!addIfMissing) { return {}; } // need to add an attribute object var name = jml.shift(); var attr = {}; jml.unshift(attr); jml.unshift(name || ''); return attr; }; /** * Add attributes to a JsonML node * * @param {JsonML} jml - JsonML node * @param {Object} attr - JsonML attributes * @return {undefined} undefined */ var addAttributes = exports.addAttributes = function addAttributes(jml, attr) { if (!isElement(jml) || !isAttributes(attr)) { throw new SyntaxError('invalid JsonML'); } if (!isAttributes(jml[1])) { // just insert attributes var name = jml.shift(); jml.unshift(attr); jml.unshift(name || ''); return; } // merge attribute objects var old = jml[1]; for (var key in attr) { if (attr.hasOwnProperty(key)) { old[key] = attr[key]; } } }; /** * Get an attribute by name * * @param {JsonML} jml - JsonML node * @param {string} key - attribute name * @return {any} attribute value or undefined */ exports.getAttribute = function getAttribute(jml, key) { if (!hasAttributes(jml)) { return undefined; } return jml[1][key]; }; exports.setAttribute = function setAttribute(jml, key, value) { getAttributes(jml, true)[key] = value; }; exports.appendChild = function appendChild(parent, child) { if (!isArray(parent)) { throw new SyntaxError('invalid JsonML'); } if (isArray(child) && child[0] === '') { // result was multiple JsonML sub-trees (i.e. documentFragment) var fragments = child.slice(1); // directly append children while (fragments.length) { appendChild(parent, fragments.shift(), arguments[2]); } } else if (child && 'object' === _typeof(child)) { if (isArray(child)) { if (!isElement(child)) { throw new SyntaxError('invalid JsonML'); } if (typeof arguments[2] === 'function') { // onAppend callback for JBST use arguments[2](parent, child); } // result was a JsonML node parent.push(child); } else if (isMarkup(child)) { // result was a JsonML node parent.push(child); } else { // result was JsonML attributes addAttributes(parent, child); } } else if ('undefined' !== typeof child && child !== null) { // must convert to string or JsonML will discard child = String(child); // skip processing empty string literals if (child && parent.length > 1 && 'string' === typeof parent[parent.length - 1]) { // combine strings parent[parent.length - 1] += child; } else if (child || !parent.length) { // append parent.push(child); } } }; /** * Get child nodes of a JsonML node * * @param {JsonML} jml - JsonML node * @return {JsonML[]} child nodes */ exports.getChildren = function getChildren(jml) { if (hasAttributes(jml)) { return jml.slice(2); } return jml.slice(1); }; /***/ }), /***/ 54831: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(96540)); var _utils = _interopRequireDefault(__webpack_require__(82669)); var _isFunction = _interopRequireDefault(__webpack_require__(1882)); var _utils2 = __webpack_require__(23243); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /** * JsonmlToReact class */ var JsonmlToReact = exports["default"] = /*#__PURE__*/function () { /** * Constructor * @param {Object} converters - Aditional converters */ function JsonmlToReact(converters) { _classCallCheck(this, JsonmlToReact); this.converters = Object.assign({}, _utils2.reactConverters, converters); } /** * Visit JsonML nodes recursively and convert to React * @param {Array} node - JsonML structure * @param {Number} index - Node index to be used as key * @param {Object} [data] - Data to be passed to the converters * @returns {Object} React component * @private */ _createClass(JsonmlToReact, [{ key: "_visit", value: function _visit(node, index, data) { var _this = this; // Is leaf node if (!node || typeof node === 'string') { return node; } var rawAttrs = Object.assign({}, _utils["default"].getAttributes(node)); var tag = _utils["default"].getTagName(node); var converter = this.converters[tag]; var result = (0, _isFunction["default"])(converter) ? converter(rawAttrs, data) : {}; var type = result.type || tag; var resultProps = result.props || rawAttrs || {}; var props = Object.assign({}, (0, _utils2.filter)(resultProps, function (key) { return key !== 'class'; }), { className: resultProps.className || resultProps["class"], key: index, style: rawAttrs.style && (0, _utils2.toStyleObject)(rawAttrs.style) }); // If it's a void element, don't create children if (_utils2.voidElementTags[type]) { return _react["default"].createElement(tag, props); } var children = _utils["default"].getChildren(node) || []; return _react["default"].createElement.apply(_react["default"], [type, props].concat(_toConsumableArray(children.map(function (child, index) { return _this._visit(child, index, data); })))); } /** * Convert JsonML to React component * @param {Array} jsonml - JsonML structure * @param {Object} [data] - Data to be passed to the converters * @returns {Object} React component */ }, { key: "convert", value: function convert(jsonml, data) { return this._visit(jsonml, 0, data); } }]); return JsonmlToReact; }(); /***/ }), /***/ 1165: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function get() { return _JsonmlToReact["default"]; } })); var _JsonmlToReact = _interopRequireDefault(__webpack_require__(54831)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /***/ }), /***/ 23243: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.filter = filter; exports.reactHTMLTags = exports.reactConverters = void 0; exports.toStyleObject = toStyleObject; exports.voidElementTags = void 0; var _camelCase = _interopRequireDefault(__webpack_require__(84058)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /** * Returns a copy of an object, with specific keys omitted * * @param {Object} obj - Source object * @param {Function} filterFn - function to check if a key/val pair should be retained * @returns {Object} a new object omitting keys */ function filter(obj, filterFn) { return Object.keys(obj).reduce(function (acc, key) { if (filterFn(key, obj[key])) { acc[key] = obj[key]; } return acc; }, {}); } /** * React HTML tags */ var reactHTMLTags = exports.reactHTMLTags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', 'circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan']; /** * List of "void element" tags * lifted from React source * https://github.com/facebook/react/blob/6a659606415d4853026df6e6d525274fdc7d35ea/src/renderers/dom/shared/ReactDOMComponent.js#L443 */ var voidElementTags = exports.voidElementTags = { area: true, base: true, br: true, col: true, embed: true, hr: true, img: true, input: true, keygen: true, link: true, meta: true, param: true, source: true, track: true, wbr: true, menuitem: true }; /** * Object with converters for the React tags */ var reactConverters = exports.reactConverters = reactHTMLTags.reduce(function (acc, type) { acc[type] = type; return acc; }, {}); /** * CSS style to React style object * @param {String} styleCSS - CSS style string * @returns {Object} - React style object */ function toStyleObject(styleCSS) { var style = {}; styleCSS.split(/;\s*/g).forEach(function (rule) { var _rule$split = rule.split(/:\s*/g), _rule$split2 = _slicedToArray(_rule$split, 2), key = _rule$split2[0], value = _rule$split2[1]; style[(0, _camelCase["default"])(key)] = value; }); return style; } /***/ }), /***/ 84300: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { A: () => (/* binding */ createCache) }); ;// ./node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js /* Based off glamor's StyleSheet, thanks Sunil ❤️ high performance StyleSheet for css-in-js systems - uses multiple style tags behind the scenes for millions of rules - uses `insertRule` for appending in production for *much* faster performance // usage import { StyleSheet } from '@emotion/sheet' let styleSheet = new StyleSheet({ key: '', container: document.head }) styleSheet.insert('#box { border: 1px solid red; }') - appends a css rule into the stylesheet styleSheet.flush() - empties the stylesheet of all its contents */ // $FlowFixMe function sheetForTag(tag) { if (tag.sheet) { // $FlowFixMe return tag.sheet; } // this weirdness brought to you by firefox /* istanbul ignore next */ for (var i = 0; i < document.styleSheets.length; i++) { if (document.styleSheets[i].ownerNode === tag) { // $FlowFixMe return document.styleSheets[i]; } } } function createStyleElement(options) { var tag = document.createElement('style'); tag.setAttribute('data-emotion', options.key); if (options.nonce !== undefined) { tag.setAttribute('nonce', options.nonce); } tag.appendChild(document.createTextNode('')); tag.setAttribute('data-s', ''); return tag; } var StyleSheet = /*#__PURE__*/function () { // Using Node instead of HTMLElement since container may be a ShadowRoot function StyleSheet(options) { var _this = this; this._insertTag = function (tag) { var before; if (_this.tags.length === 0) { if (_this.insertionPoint) { before = _this.insertionPoint.nextSibling; } else if (_this.prepend) { before = _this.container.firstChild; } else { before = _this.before; } } else { before = _this.tags[_this.tags.length - 1].nextSibling; } _this.container.insertBefore(tag, before); _this.tags.push(tag); }; this.isSpeedy = options.speedy === undefined ? "production" === 'production' : options.speedy; this.tags = []; this.ctr = 0; this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets this.key = options.key; this.container = options.container; this.prepend = options.prepend; this.insertionPoint = options.insertionPoint; this.before = null; } var _proto = StyleSheet.prototype; _proto.hydrate = function hydrate(nodes) { nodes.forEach(this._insertTag); }; _proto.insert = function insert(rule) { // the max length is how many rules we have per style tag, it's 65000 in speedy mode // it's 1 in dev because we insert source maps that map a single rule to a location // and you can only have one source map per style tag if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) { this._insertTag(createStyleElement(this)); } var tag = this.tags[this.tags.length - 1]; if (false) { var isImportRule; } if (this.isSpeedy) { var sheet = sheetForTag(tag); try { // this is the ultrafast version, works across browsers // the big drawback is that the css won't be editable in devtools sheet.insertRule(rule, sheet.cssRules.length); } catch (e) { if (false) {} } } else { tag.appendChild(document.createTextNode(rule)); } this.ctr++; }; _proto.flush = function flush() { // $FlowFixMe this.tags.forEach(function (tag) { return tag.parentNode && tag.parentNode.removeChild(tag); }); this.tags = []; this.ctr = 0; if (false) {} }; return StyleSheet; }(); ;// ./node_modules/stylis/src/Utility.js /** * @param {number} * @return {number} */ var abs = Math.abs /** * @param {number} * @return {string} */ var Utility_from = String.fromCharCode /** * @param {object} * @return {object} */ var Utility_assign = Object.assign /** * @param {string} value * @param {number} length * @return {number} */ function hash (value, length) { return Utility_charat(value, 0) ^ 45 ? (((((((length << 2) ^ Utility_charat(value, 0)) << 2) ^ Utility_charat(value, 1)) << 2) ^ Utility_charat(value, 2)) << 2) ^ Utility_charat(value, 3) : 0 } /** * @param {string} value * @return {string} */ function trim (value) { return value.trim() } /** * @param {string} value * @param {RegExp} pattern * @return {string?} */ function Utility_match (value, pattern) { return (value = pattern.exec(value)) ? value[0] : value } /** * @param {string} value * @param {(string|RegExp)} pattern * @param {string} replacement * @return {string} */ function Utility_replace (value, pattern, replacement) { return value.replace(pattern, replacement) } /** * @param {string} value * @param {string} search * @return {number} */ function indexof (value, search) { return value.indexOf(search) } /** * @param {string} value * @param {number} index * @return {number} */ function Utility_charat (value, index) { return value.charCodeAt(index) | 0 } /** * @param {string} value * @param {number} begin * @param {number} end * @return {string} */ function Utility_substr (value, begin, end) { return value.slice(begin, end) } /** * @param {string} value * @return {number} */ function Utility_strlen (value) { return value.length } /** * @param {any[]} value * @return {number} */ function Utility_sizeof (value) { return value.length } /** * @param {any} value * @param {any[]} array * @return {any} */ function Utility_append (value, array) { return array.push(value), value } /** * @param {string[]} array * @param {function} callback * @return {string} */ function Utility_combine (array, callback) { return array.map(callback).join('') } ;// ./node_modules/stylis/src/Tokenizer.js var line = 1 var column = 1 var Tokenizer_length = 0 var position = 0 var character = 0 var characters = '' /** * @param {string} value * @param {object | null} root * @param {object | null} parent * @param {string} type * @param {string[] | string} props * @param {object[] | string} children * @param {number} length */ function node (value, root, parent, type, props, children, length) { return {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''} } /** * @param {object} root * @param {object} props * @return {object} */ function Tokenizer_copy (root, props) { return Utility_assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props) } /** * @return {number} */ function Tokenizer_char () { return character } /** * @return {number} */ function prev () { character = position > 0 ? Utility_charat(characters, --position) : 0 if (column--, character === 10) column = 1, line-- return character } /** * @return {number} */ function next () { character = position < Tokenizer_length ? Utility_charat(characters, position++) : 0 if (column++, character === 10) column = 1, line++ return character } /** * @return {number} */ function peek () { return Utility_charat(characters, position) } /** * @return {number} */ function caret () { return position } /** * @param {number} begin * @param {number} end * @return {string} */ function slice (begin, end) { return Utility_substr(characters, begin, end) } /** * @param {number} type * @return {number} */ function token (type) { switch (type) { // \0 \t \n \r \s whitespace token case 0: case 9: case 10: case 13: case 32: return 5 // ! + , / > @ ~ isolate token case 33: case 43: case 44: case 47: case 62: case 64: case 126: // ; { } breakpoint token case 59: case 123: case 125: return 4 // : accompanied token case 58: return 3 // " ' ( [ opening delimit token case 34: case 39: case 40: case 91: return 2 // ) ] closing delimit token case 41: case 93: return 1 } return 0 } /** * @param {string} value * @return {any[]} */ function alloc (value) { return line = column = 1, Tokenizer_length = Utility_strlen(characters = value), position = 0, [] } /** * @param {any} value * @return {any} */ function dealloc (value) { return characters = '', value } /** * @param {number} type * @return {string} */ function delimit (type) { return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type))) } /** * @param {string} value * @return {string[]} */ function Tokenizer_tokenize (value) { return dealloc(tokenizer(alloc(value))) } /** * @param {number} type * @return {string} */ function whitespace (type) { while (character = peek()) if (character < 33) next() else break return token(type) > 2 || token(character) > 3 ? '' : ' ' } /** * @param {string[]} children * @return {string[]} */ function tokenizer (children) { while (next()) switch (token(character)) { case 0: append(identifier(position - 1), children) break case 2: append(delimit(character), children) break default: append(from(character), children) } return children } /** * @param {number} index * @param {number} count * @return {string} */ function escaping (index, count) { while (--count && next()) // not 0-9 A-F a-f if (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97)) break return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32)) } /** * @param {number} type * @return {number} */ function delimiter (type) { while (next()) switch (character) { // ] ) " ' case type: return position // " ' case 34: case 39: if (type !== 34 && type !== 39) delimiter(character) break // ( case 40: if (type === 41) delimiter(type) break // \ case 92: next() break } return position } /** * @param {number} type * @param {number} index * @return {number} */ function commenter (type, index) { while (next()) // // if (type + character === 47 + 10) break // /* else if (type + character === 42 + 42 && peek() === 47) break return '/*' + slice(index, position - 1) + '*' + Utility_from(type === 47 ? type : next()) } /** * @param {number} index * @return {string} */ function identifier (index) { while (!token(peek())) next() return slice(index, position) } ;// ./node_modules/stylis/src/Enum.js var Enum_MS = '-ms-' var Enum_MOZ = '-moz-' var Enum_WEBKIT = '-webkit-' var COMMENT = 'comm' var Enum_RULESET = 'rule' var Enum_DECLARATION = 'decl' var PAGE = '@page' var MEDIA = '@media' var IMPORT = '@import' var CHARSET = '@charset' var VIEWPORT = '@viewport' var SUPPORTS = '@supports' var DOCUMENT = '@document' var NAMESPACE = '@namespace' var Enum_KEYFRAMES = '@keyframes' var FONT_FACE = '@font-face' var COUNTER_STYLE = '@counter-style' var FONT_FEATURE_VALUES = '@font-feature-values' var LAYER = '@layer' ;// ./node_modules/stylis/src/Serializer.js /** * @param {object[]} children * @param {function} callback * @return {string} */ function Serializer_serialize (children, callback) { var output = '' var length = Utility_sizeof(children) for (var i = 0; i < length; i++) output += callback(children[i], i, children, callback) || '' return output } /** * @param {object} element * @param {number} index * @param {object[]} children * @param {function} callback * @return {string} */ function stringify (element, index, children, callback) { switch (element.type) { case LAYER: if (element.children.length) break case IMPORT: case Enum_DECLARATION: return element.return = element.return || element.value case COMMENT: return '' case Enum_KEYFRAMES: return element.return = element.value + '{' + Serializer_serialize(element.children, callback) + '}' case Enum_RULESET: element.value = element.props.join(',') } return Utility_strlen(children = Serializer_serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : '' } ;// ./node_modules/stylis/src/Middleware.js /** * @param {function[]} collection * @return {function} */ function middleware (collection) { var length = Utility_sizeof(collection) return function (element, index, children, callback) { var output = '' for (var i = 0; i < length; i++) output += collection[i](element, index, children, callback) || '' return output } } /** * @param {function} callback * @return {function} */ function rulesheet (callback) { return function (element) { if (!element.root) if (element = element.return) callback(element) } } /** * @param {object} element * @param {number} index * @param {object[]} children * @param {function} callback */ function prefixer (element, index, children, callback) { if (element.length > -1) if (!element.return) switch (element.type) { case DECLARATION: element.return = prefix(element.value, element.length, children) return case KEYFRAMES: return serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback) case RULESET: if (element.length) return combine(element.props, function (value) { switch (match(value, /(::plac\w+|:read-\w+)/)) { // :read-(only|write) case ':read-only': case ':read-write': return serialize([copy(element, {props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]})], callback) // :placeholder case '::placeholder': return serialize([ copy(element, {props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]}), copy(element, {props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]}), copy(element, {props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]}) ], callback) } return '' }) } } /** * @param {object} element * @param {number} index * @param {object[]} children */ function namespace (element) { switch (element.type) { case RULESET: element.props = element.props.map(function (value) { return combine(tokenize(value), function (value, index, children) { switch (charat(value, 0)) { // \f case 12: return substr(value, 1, strlen(value)) // \0 ( + > ~ case 0: case 40: case 43: case 62: case 126: return value // : case 58: if (children[++index] === 'global') children[index] = '', children[++index] = '\f' + substr(children[index], index = 1, -1) // \s case 32: return index === 1 ? '' : value default: switch (index) { case 0: element = value return sizeof(children) > 1 ? '' : value case index = sizeof(children) - 1: case 2: return index === 2 ? value + element + element : value + element default: return value } } }) }) } } ;// ./node_modules/stylis/src/Parser.js /** * @param {string} value * @return {object[]} */ function compile (value) { return dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value)) } /** * @param {string} value * @param {object} root * @param {object?} parent * @param {string[]} rule * @param {string[]} rules * @param {string[]} rulesets * @param {number[]} pseudo * @param {number[]} points * @param {string[]} declarations * @return {object} */ function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) { var index = 0 var offset = 0 var length = pseudo var atrule = 0 var property = 0 var previous = 0 var variable = 1 var scanning = 1 var ampersand = 1 var character = 0 var type = '' var props = rules var children = rulesets var reference = rule var characters = type while (scanning) switch (previous = character, character = next()) { // ( case 40: if (previous != 108 && Utility_charat(characters, length - 1) == 58) { if (indexof(characters += Utility_replace(delimit(character), '&', '&\f'), '&\f') != -1) ampersand = -1 break } // " ' [ case 34: case 39: case 91: characters += delimit(character) break // \t \n \r \s case 9: case 10: case 13: case 32: characters += whitespace(previous) break // \ case 92: characters += escaping(caret() - 1, 7) continue // / case 47: switch (peek()) { case 42: case 47: Utility_append(comment(commenter(next(), caret()), root, parent), declarations) break default: characters += '/' } break // { case 123 * variable: points[index++] = Utility_strlen(characters) * ampersand // } ; \0 case 125 * variable: case 59: case 0: switch (character) { // \0 } case 0: case 125: scanning = 0 // ; case 59 + offset: if (ampersand == -1) characters = Utility_replace(characters, /\f/g, '') if (property > 0 && (Utility_strlen(characters) - length)) Utility_append(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(Utility_replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations) break // @ ; case 59: characters += ';' // { rule/at-rule default: Utility_append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets) if (character === 123) if (offset === 0) parse(characters, root, reference, reference, props, rulesets, length, points, children) else switch (atrule === 99 && Utility_charat(characters, 3) === 110 ? 100 : atrule) { // d l m s case 100: case 108: case 109: case 115: parse(value, reference, reference, rule && Utility_append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children) break default: parse(characters, reference, reference, reference, [''], children, 0, points, children) } } index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo break // : case 58: length = 1 + Utility_strlen(characters), property = previous default: if (variable < 1) if (character == 123) --variable else if (character == 125 && variable++ == 0 && prev() == 125) continue switch (characters += Utility_from(character), character * variable) { // & case 38: ampersand = offset > 0 ? 1 : (characters += '\f', -1) break // , case 44: points[index++] = (Utility_strlen(characters) - 1) * ampersand, ampersand = 1 break // @ case 64: // - if (peek() === 45) characters += delimit(next()) atrule = peek(), offset = length = Utility_strlen(type = characters += identifier(caret())), character++ break // - case 45: if (previous === 45 && Utility_strlen(characters) == 2) variable = 0 } } return rulesets } /** * @param {string} value * @param {object} root * @param {object?} parent * @param {number} index * @param {number} offset * @param {string[]} rules * @param {number[]} points * @param {string} type * @param {string[]} props * @param {string[]} children * @param {number} length * @return {object} */ function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) { var post = offset - 1 var rule = offset === 0 ? rules : [''] var size = Utility_sizeof(rule) for (var i = 0, j = 0, k = 0; i < index; ++i) for (var x = 0, y = Utility_substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x) if (z = trim(j > 0 ? rule[x] + ' ' + y : Utility_replace(y, /&\f/g, rule[x]))) props[k++] = z return node(value, root, parent, offset === 0 ? Enum_RULESET : type, props, children, length) } /** * @param {number} value * @param {object} root * @param {object?} parent * @return {object} */ function comment (value, root, parent) { return node(value, root, parent, COMMENT, Utility_from(Tokenizer_char()), Utility_substr(value, 2, -2), 0) } /** * @param {string} value * @param {object} root * @param {object?} parent * @param {number} length * @return {object} */ function declaration (value, root, parent, length) { return node(value, root, parent, Enum_DECLARATION, Utility_substr(value, 0, length), Utility_substr(value, length + 1, -1), length) } ;// ./node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) { var previous = 0; var character = 0; while (true) { previous = character; character = peek(); // &\f if (previous === 38 && character === 12) { points[index] = 1; } if (token(character)) { break; } next(); } return slice(begin, position); }; var toRules = function toRules(parsed, points) { // pretend we've started with a comma var index = -1; var character = 44; do { switch (token(character)) { case 0: // &\f if (character === 38 && peek() === 12) { // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings // stylis inserts \f after & to know when & where it should replace this sequence with the context selector // and when it should just concatenate the outer and inner selectors // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here points[index] = 1; } parsed[index] += identifierWithPointTracking(position - 1, points, index); break; case 2: parsed[index] += delimit(character); break; case 4: // comma if (character === 44) { // colon parsed[++index] = peek() === 58 ? '&\f' : ''; points[index] = parsed[index].length; break; } // fallthrough default: parsed[index] += Utility_from(character); } } while (character = next()); return parsed; }; var getRules = function getRules(value, points) { return dealloc(toRules(alloc(value), points)); }; // WeakSet would be more appropriate, but only WeakMap is supported in IE11 var fixedElements = /* #__PURE__ */new WeakMap(); var compat = function compat(element) { if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo // negative .length indicates that this rule has been already prefixed element.length < 1) { return; } var value = element.value, parent = element.parent; var isImplicitRule = element.column === parent.column && element.line === parent.line; while (parent.type !== 'rule') { parent = parent.parent; if (!parent) return; } // short-circuit for the simplest case if (element.props.length === 1 && value.charCodeAt(0) !== 58 /* colon */ && !fixedElements.get(parent)) { return; } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level) // then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent" if (isImplicitRule) { return; } fixedElements.set(element, true); var points = []; var rules = getRules(value, points); var parentRules = parent.props; for (var i = 0, k = 0; i < rules.length; i++) { for (var j = 0; j < parentRules.length; j++, k++) { element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i]; } } }; var removeLabel = function removeLabel(element) { if (element.type === 'decl') { var value = element.value; if ( // charcode for l value.charCodeAt(0) === 108 && // charcode for b value.charCodeAt(2) === 98) { // this ignores label element["return"] = ''; element.value = ''; } } }; var ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason'; var isIgnoringComment = function isIgnoringComment(element) { return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1; }; var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) { return function (element, index, children) { if (element.type !== 'rule' || cache.compat) return; var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g); if (unsafePseudoClasses) { var isNested = !!element.parent; // in nested rules comments become children of the "auto-inserted" rule and that's always the `element.parent` // // considering this input: // .a { // .b /* comm */ {} // color: hotpink; // } // we get output corresponding to this: // .a { // & { // /* comm */ // color: hotpink; // } // .b {} // } var commentContainer = isNested ? element.parent.children : // global rule at the root level children; for (var i = commentContainer.length - 1; i >= 0; i--) { var node = commentContainer[i]; if (node.line < element.line) { break; } // it is quite weird but comments are *usually* put at `column: element.column - 1` // so we seek *from the end* for the node that is earlier than the rule's `element` and check that // this will also match inputs like this: // .a { // /* comm */ // .b {} // } // // but that is fine // // it would be the easiest to change the placement of the comment to be the first child of the rule: // .a { // .b { /* comm */ } // } // with such inputs we wouldn't have to search for the comment at all // TODO: consider changing this comment placement in the next major version if (node.column < element.column) { if (isIgnoringComment(node)) { return; } break; } } unsafePseudoClasses.forEach(function (unsafePseudoClass) { console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\"."); }); } }; }; var isImportRule = function isImportRule(element) { return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64; }; var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) { for (var i = index - 1; i >= 0; i--) { if (!isImportRule(children[i])) { return true; } } return false; }; // use this to remove incorrect elements from further processing // so they don't get handed to the `sheet` (or anything else) // as that could potentially lead to additional logs which in turn could be overhelming to the user var nullifyElement = function nullifyElement(element) { element.type = ''; element.value = ''; element["return"] = ''; element.children = ''; element.props = ''; }; var incorrectImportAlarm = function incorrectImportAlarm(element, index, children) { if (!isImportRule(element)) { return; } if (element.parent) { console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles."); nullifyElement(element); } else if (isPrependedWithRegularRules(index, children)) { console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."); nullifyElement(element); } }; /* eslint-disable no-fallthrough */ function emotion_cache_browser_esm_prefix(value, length) { switch (hash(value, length)) { // color-adjust case 5103: return Enum_WEBKIT + 'print-' + value + value; // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function) case 5737: case 4201: case 3177: case 3433: case 1641: case 4457: case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break case 5572: case 6356: case 5844: case 3191: case 6645: case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite, case 6391: case 5879: case 5623: case 6135: case 4599: case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width) case 4215: case 6389: case 5109: case 5365: case 5621: case 3829: return Enum_WEBKIT + value + value; // appearance, user-select, transform, hyphens, text-size-adjust case 5349: case 4246: case 4810: case 6968: case 2756: return Enum_WEBKIT + value + Enum_MOZ + value + Enum_MS + value + value; // flex, flex-direction case 6828: case 4268: return Enum_WEBKIT + value + Enum_MS + value + value; // order case 6165: return Enum_WEBKIT + value + Enum_MS + 'flex-' + value + value; // align-items case 5187: return Enum_WEBKIT + value + Utility_replace(value, /(\w+).+(:[^]+)/, Enum_WEBKIT + 'box-$1$2' + Enum_MS + 'flex-$1$2') + value; // align-self case 5443: return Enum_WEBKIT + value + Enum_MS + 'flex-item-' + Utility_replace(value, /flex-|-self/, '') + value; // align-content case 4675: return Enum_WEBKIT + value + Enum_MS + 'flex-line-pack' + Utility_replace(value, /align-content|flex-|-self/, '') + value; // flex-shrink case 5548: return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, 'shrink', 'negative') + value; // flex-basis case 5292: return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, 'basis', 'preferred-size') + value; // flex-grow case 6060: return Enum_WEBKIT + 'box-' + Utility_replace(value, '-grow', '') + Enum_WEBKIT + value + Enum_MS + Utility_replace(value, 'grow', 'positive') + value; // transition case 4554: return Enum_WEBKIT + Utility_replace(value, /([^-])(transform)/g, '$1' + Enum_WEBKIT + '$2') + value; // cursor case 6187: return Utility_replace(Utility_replace(Utility_replace(value, /(zoom-|grab)/, Enum_WEBKIT + '$1'), /(image-set)/, Enum_WEBKIT + '$1'), value, '') + value; // background, background-image case 5495: case 3959: return Utility_replace(value, /(image-set\([^]*)/, Enum_WEBKIT + '$1' + '$`$1'); // justify-content case 4968: return Utility_replace(Utility_replace(value, /(.+:)(flex-)?(.*)/, Enum_WEBKIT + 'box-pack:$3' + Enum_MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + Enum_WEBKIT + value + value; // (margin|padding)-inline-(start|end) case 4095: case 3583: case 4068: case 2532: return Utility_replace(value, /(.+)-inline(.+)/, Enum_WEBKIT + '$1$2') + value; // (min|max)?(width|height|inline-size|block-size) case 8116: case 7059: case 5753: case 5535: case 5445: case 5701: case 4933: case 4677: case 5533: case 5789: case 5021: case 4765: // stretch, max-content, min-content, fill-available if (Utility_strlen(value) - 1 - length > 6) switch (Utility_charat(value, length + 1)) { // (m)ax-content, (m)in-content case 109: // - if (Utility_charat(value, length + 4) !== 45) break; // (f)ill-available, (f)it-content case 102: return Utility_replace(value, /(.+:)(.+)-([^]+)/, '$1' + Enum_WEBKIT + '$2-$3' + '$1' + Enum_MOZ + (Utility_charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value; // (s)tretch case 115: return ~indexof(value, 'stretch') ? emotion_cache_browser_esm_prefix(Utility_replace(value, 'stretch', 'fill-available'), length) + value : value; } break; // position: sticky case 4949: // (s)ticky? if (Utility_charat(value, length + 1) !== 115) break; // display: (flex|inline-flex) case 6444: switch (Utility_charat(value, Utility_strlen(value) - 3 - (~indexof(value, '!important') && 10))) { // stic(k)y case 107: return Utility_replace(value, ':', ':' + Enum_WEBKIT) + value; // (inline-)?fl(e)x case 101: return Utility_replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + Enum_WEBKIT + (Utility_charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + Enum_WEBKIT + '$2$3' + '$1' + Enum_MS + '$2box$3') + value; } break; // writing-mode case 5936: switch (Utility_charat(value, length + 11)) { // vertical-l(r) case 114: return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value; // vertical-r(l) case 108: return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value; // horizontal(-)tb case 45: return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value; } return Enum_WEBKIT + value + Enum_MS + value + value; } return value; } var emotion_cache_browser_esm_prefixer = function prefixer(element, index, children, callback) { if (element.length > -1) if (!element["return"]) switch (element.type) { case Enum_DECLARATION: element["return"] = emotion_cache_browser_esm_prefix(element.value, element.length); break; case Enum_KEYFRAMES: return Serializer_serialize([Tokenizer_copy(element, { value: Utility_replace(element.value, '@', '@' + Enum_WEBKIT) })], callback); case Enum_RULESET: if (element.length) return Utility_combine(element.props, function (value) { switch (Utility_match(value, /(::plac\w+|:read-\w+)/)) { // :read-(only|write) case ':read-only': case ':read-write': return Serializer_serialize([Tokenizer_copy(element, { props: [Utility_replace(value, /:(read-\w+)/, ':' + Enum_MOZ + '$1')] })], callback); // :placeholder case '::placeholder': return Serializer_serialize([Tokenizer_copy(element, { props: [Utility_replace(value, /:(plac\w+)/, ':' + Enum_WEBKIT + 'input-$1')] }), Tokenizer_copy(element, { props: [Utility_replace(value, /:(plac\w+)/, ':' + Enum_MOZ + '$1')] }), Tokenizer_copy(element, { props: [Utility_replace(value, /:(plac\w+)/, Enum_MS + 'input-$1')] })], callback); } return ''; }); } }; var defaultStylisPlugins = [emotion_cache_browser_esm_prefixer]; var createCache = function createCache(options) { var key = options.key; if (false) {} if (key === 'css') { var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be) // note this very very intentionally targets all style elements regardless of the key to ensure // that creating a cache works inside of render of a React component Array.prototype.forEach.call(ssrStyles, function (node) { // we want to only move elements which have a space in the data-emotion attribute value // because that indicates that it is an Emotion 11 server-side rendered style elements // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes) // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles // will not result in the Emotion 10 styles being destroyed var dataEmotionAttribute = node.getAttribute('data-emotion'); if (dataEmotionAttribute.indexOf(' ') === -1) { return; } document.head.appendChild(node); node.setAttribute('data-s', ''); }); } var stylisPlugins = options.stylisPlugins || defaultStylisPlugins; if (false) {} var inserted = {}; var container; var nodesToHydrate = []; { container = options.container || document.head; Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which // means that the style elements we're looking at are only Emotion 11 server-rendered style elements document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) { var attrib = node.getAttribute("data-emotion").split(' '); // $FlowFixMe for (var i = 1; i < attrib.length; i++) { inserted[attrib[i]] = true; } nodesToHydrate.push(node); }); } var _insert; var omnipresentPlugins = [compat, removeLabel]; if (false) {} { var currentSheet; var finalizingPlugins = [stringify, false ? 0 : rulesheet(function (rule) { currentSheet.insert(rule); })]; var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins)); var stylis = function stylis(styles) { return Serializer_serialize(compile(styles), serializer); }; _insert = function insert(selector, serialized, sheet, shouldCache) { currentSheet = sheet; if (false) {} stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles); if (shouldCache) { cache.inserted[serialized.name] = true; } }; } var cache = { key: key, sheet: new StyleSheet({ key: key, container: container, nonce: options.nonce, speedy: options.speedy, prepend: options.prepend, insertionPoint: options.insertionPoint }), nonce: options.nonce, inserted: inserted, registered: {}, insert: _insert }; cache.sheet.hydrate(nodesToHydrate); return cache; }; /***/ }), /***/ 35137: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ A: () => (/* binding */ murmur2) /* harmony export */ }); /* eslint-disable */ // Inspired by https://github.com/garycourt/murmurhash-js // Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86 function murmur2(str) { // 'm' and 'r' are mixing constants generated offline. // They're not really 'magic', they just happen to work well. // const m = 0x5bd1e995; // const r = 24; // Initialize the hash var h = 0; // Mix 4 bytes at a time into the hash var k, i = 0, len = str.length; for (; len >= 4; ++i, len -= 4) { k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24; k = /* Math.imul(k, m): */ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16); k ^= /* k >>> r: */ k >>> 24; h = /* Math.imul(k, m): */ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^ /* Math.imul(h, m): */ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); } // Handle the last few bytes of the input array switch (len) { case 3: h ^= (str.charCodeAt(i + 2) & 0xff) << 16; case 2: h ^= (str.charCodeAt(i + 1) & 0xff) << 8; case 1: h ^= str.charCodeAt(i) & 0xff; h = /* Math.imul(h, m): */ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); } // Do a few final mixes of the hash to ensure the last few // bytes are well-incorporated. h ^= h >>> 13; h = /* Math.imul(h, m): */ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); return ((h ^ h >>> 15) >>> 0).toString(36); } /***/ }), /***/ 52537: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { C: () => (/* binding */ CacheProvider), E: () => (/* binding */ Emotion$1), c: () => (/* binding */ createEmotionProps), h: () => (/* binding */ emotion_element_c39617d8_browser_esm_hasOwnProperty) }); // UNUSED EXPORTS: T, _, a, b, i, u, w // EXTERNAL MODULE: ./node_modules/react/index.js var react = __webpack_require__(96540); // EXTERNAL MODULE: ./node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js + 7 modules var emotion_cache_browser_esm = __webpack_require__(84300); ;// ./node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js var isBrowser = true; function getRegisteredStyles(registered, registeredStyles, classNames) { var rawClassName = ''; classNames.split(' ').forEach(function (className) { if (registered[className] !== undefined) { registeredStyles.push(registered[className] + ";"); } else if (className) { rawClassName += className + " "; } }); return rawClassName; } var registerStyles = function registerStyles(cache, serialized, isStringTag) { var className = cache.key + "-" + serialized.name; if ( // we only need to add the styles to the registered cache if the // class name could be used further down // the tree but if it's a string tag, we know it won't // so we don't have to add it to registered cache. // this improves memory usage since we can avoid storing the whole style string (isStringTag === false || // we need to always store it if we're in compat mode and // in node since emotion-server relies on whether a style is in // the registered cache to know whether a style is global or not // also, note that this check will be dead code eliminated in the browser isBrowser === false ) && cache.registered[className] === undefined) { cache.registered[className] = serialized.styles; } }; var insertStyles = function insertStyles(cache, serialized, isStringTag) { registerStyles(cache, serialized, isStringTag); var className = cache.key + "-" + serialized.name; if (cache.inserted[serialized.name] === undefined) { var current = serialized; do { cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true); current = current.next; } while (current !== undefined); } }; // EXTERNAL MODULE: ./node_modules/@emotion/serialize/dist/emotion-serialize.esm.js var emotion_serialize_esm = __webpack_require__(23917); // EXTERNAL MODULE: ./node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js var emotion_use_insertion_effect_with_fallbacks_browser_esm = __webpack_require__(71287); ;// ./node_modules/@emotion/react/dist/emotion-element-c39617d8.browser.esm.js var emotion_element_c39617d8_browser_esm_isBrowser = "object" !== 'undefined'; var emotion_element_c39617d8_browser_esm_hasOwnProperty = {}.hasOwnProperty; var EmotionCacheContext = /* #__PURE__ */react.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case // because this module is primarily intended for the browser and node // but it's also required in react native and similar environments sometimes // and we could have a special build just for that // but this is much easier and the native packages // might use a different theme context in the future anyway typeof HTMLElement !== 'undefined' ? /* #__PURE__ */(0,emotion_cache_browser_esm/* default */.A)({ key: 'css' }) : null); if (false) {} var CacheProvider = EmotionCacheContext.Provider; var __unsafe_useEmotionCache = function useEmotionCache() { return useContext(EmotionCacheContext); }; var withEmotionCache = function withEmotionCache(func) { // $FlowFixMe return /*#__PURE__*/(0,react.forwardRef)(function (props, ref) { // the cache will never be null in the browser var cache = (0,react.useContext)(EmotionCacheContext); return func(props, cache, ref); }); }; if (!emotion_element_c39617d8_browser_esm_isBrowser) { withEmotionCache = function withEmotionCache(func) { return function (props) { var cache = (0,react.useContext)(EmotionCacheContext); if (cache === null) { // yes, we're potentially creating this on every render // it doesn't actually matter though since it's only on the server // so there will only every be a single render // that could change in the future because of suspense and etc. but for now, // this works and i don't want to optimise for a future thing that we aren't sure about cache = (0,emotion_cache_browser_esm/* default */.A)({ key: 'css' }); return /*#__PURE__*/react.createElement(EmotionCacheContext.Provider, { value: cache }, func(props, cache)); } else { return func(props, cache); } }; }; } var ThemeContext = /* #__PURE__ */react.createContext({}); if (false) {} var useTheme = function useTheme() { return React.useContext(ThemeContext); }; var getTheme = function getTheme(outerTheme, theme) { if (typeof theme === 'function') { var mergedTheme = theme(outerTheme); if (false) {} return mergedTheme; } if (false) {} return _extends({}, outerTheme, theme); }; var createCacheWithTheme = /* #__PURE__ */(/* unused pure expression or super */ null && (weakMemoize(function (outerTheme) { return weakMemoize(function (theme) { return getTheme(outerTheme, theme); }); }))); var ThemeProvider = function ThemeProvider(props) { var theme = React.useContext(ThemeContext); if (props.theme !== theme) { theme = createCacheWithTheme(theme)(props.theme); } return /*#__PURE__*/React.createElement(ThemeContext.Provider, { value: theme }, props.children); }; function withTheme(Component) { var componentName = Component.displayName || Component.name || 'Component'; var render = function render(props, ref) { var theme = React.useContext(ThemeContext); return /*#__PURE__*/React.createElement(Component, _extends({ theme: theme, ref: ref }, props)); }; // $FlowFixMe var WithTheme = /*#__PURE__*/React.forwardRef(render); WithTheme.displayName = "WithTheme(" + componentName + ")"; return hoistNonReactStatics(WithTheme, Component); } var getLastPart = function getLastPart(functionName) { // The match may be something like 'Object.createEmotionProps' or // 'Loader.prototype.render' var parts = functionName.split('.'); return parts[parts.length - 1]; }; var getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) { // V8 var match = /^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(line); if (match) return getLastPart(match[1]); // Safari / Firefox match = /^([A-Za-z0-9$.]+)@/.exec(line); if (match) return getLastPart(match[1]); return undefined; }; var internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS // identifiers, thus we only need to replace what is a valid character for JS, // but not for CSS. var sanitizeIdentifier = function sanitizeIdentifier(identifier) { return identifier.replace(/\$/g, '-'); }; var getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) { if (!stackTrace) return undefined; var lines = stackTrace.split('\n'); for (var i = 0; i < lines.length; i++) { var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just "Error" if (!functionName) continue; // If we reach one of these, we have gone too far and should quit if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an // uppercase letter if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName); } return undefined; }; var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__'; var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__'; var createEmotionProps = function createEmotionProps(type, props) { if (false) {} var newProps = {}; for (var key in props) { if (emotion_element_c39617d8_browser_esm_hasOwnProperty.call(props, key)) { newProps[key] = props[key]; } } newProps[typePropName] = type; // For performance, only call getLabelFromStackTrace in development and when // the label hasn't already been computed if (false) { var label; } return newProps; }; var Insertion = function Insertion(_ref) { var cache = _ref.cache, serialized = _ref.serialized, isStringTag = _ref.isStringTag; registerStyles(cache, serialized, isStringTag); (0,emotion_use_insertion_effect_with_fallbacks_browser_esm/* useInsertionEffectAlwaysWithSyncFallback */.s)(function () { return insertStyles(cache, serialized, isStringTag); }); return null; }; var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) { var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works // not passing the registered cache to serializeStyles because it would // make certain babel optimisations not possible if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) { cssProp = cache.registered[cssProp]; } var WrappedComponent = props[typePropName]; var registeredStyles = [cssProp]; var className = ''; if (typeof props.className === 'string') { className = getRegisteredStyles(cache.registered, registeredStyles, props.className); } else if (props.className != null) { className = props.className + " "; } var serialized = (0,emotion_serialize_esm/* serializeStyles */.J)(registeredStyles, undefined, react.useContext(ThemeContext)); if (false) { var labelFromStack; } className += cache.key + "-" + serialized.name; var newProps = {}; for (var key in props) { if (emotion_element_c39617d8_browser_esm_hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && ( true || 0)) { newProps[key] = props[key]; } } newProps.ref = ref; newProps.className = className; return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(Insertion, { cache: cache, serialized: serialized, isStringTag: typeof WrappedComponent === 'string' }), /*#__PURE__*/react.createElement(WrappedComponent, newProps)); }); if (false) {} var Emotion$1 = Emotion; /***/ }), /***/ 17437: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AH: () => (/* binding */ css), /* harmony export */ Y: () => (/* binding */ jsx), /* harmony export */ i7: () => (/* binding */ keyframes) /* harmony export */ }); /* unused harmony exports ClassNames, Global, createElement */ /* harmony import */ var _emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(52537); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96540); /* harmony import */ var _emotion_use_insertion_effect_with_fallbacks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71287); /* harmony import */ var _emotion_serialize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23917); /* harmony import */ var _emotion_cache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(84300); /* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4146); /* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_4__); var pkg = { name: "@emotion/react", version: "11.11.1", main: "dist/emotion-react.cjs.js", module: "dist/emotion-react.esm.js", browser: { "./dist/emotion-react.esm.js": "./dist/emotion-react.browser.esm.js" }, exports: { ".": { module: { worker: "./dist/emotion-react.worker.esm.js", browser: "./dist/emotion-react.browser.esm.js", "default": "./dist/emotion-react.esm.js" }, "import": "./dist/emotion-react.cjs.mjs", "default": "./dist/emotion-react.cjs.js" }, "./jsx-runtime": { module: { worker: "./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js", browser: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js", "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js" }, "import": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs", "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js" }, "./_isolated-hnrs": { module: { worker: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js", browser: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js", "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js" }, "import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs", "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js" }, "./jsx-dev-runtime": { module: { worker: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js", browser: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js", "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js" }, "import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs", "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js" }, "./package.json": "./package.json", "./types/css-prop": "./types/css-prop.d.ts", "./macro": { types: { "import": "./macro.d.mts", "default": "./macro.d.ts" }, "default": "./macro.js" } }, types: "types/index.d.ts", files: [ "src", "dist", "jsx-runtime", "jsx-dev-runtime", "_isolated-hnrs", "types/*.d.ts", "macro.*" ], sideEffects: false, author: "Emotion Contributors", license: "MIT", scripts: { "test:typescript": "dtslint types" }, dependencies: { "@babel/runtime": "^7.18.3", "@emotion/babel-plugin": "^11.11.0", "@emotion/cache": "^11.11.0", "@emotion/serialize": "^1.1.2", "@emotion/use-insertion-effect-with-fallbacks": "^1.0.1", "@emotion/utils": "^1.2.1", "@emotion/weak-memoize": "^0.3.1", "hoist-non-react-statics": "^3.3.1" }, peerDependencies: { react: ">=16.8.0" }, peerDependenciesMeta: { "@types/react": { optional: true } }, devDependencies: { "@definitelytyped/dtslint": "0.0.112", "@emotion/css": "11.11.0", "@emotion/css-prettifier": "1.1.3", "@emotion/server": "11.11.0", "@emotion/styled": "11.11.0", "html-tag-names": "^1.1.2", react: "16.14.0", "svg-tag-names": "^1.1.1", typescript: "^4.5.5" }, repository: "https://github.com/emotion-js/emotion/tree/main/packages/react", publishConfig: { access: "public" }, "umd:main": "dist/emotion-react.umd.min.js", preconstruct: { entrypoints: [ "./index.js", "./jsx-runtime.js", "./jsx-dev-runtime.js", "./_isolated-hnrs.js" ], umdName: "emotionReact", exports: { envConditions: [ "browser", "worker" ], extra: { "./types/css-prop": "./types/css-prop.d.ts", "./macro": { types: { "import": "./macro.d.mts", "default": "./macro.d.ts" }, "default": "./macro.js" } } } } }; var jsx = function jsx(type, props) { var args = arguments; if (props == null || !_emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_5__.h.call(props, 'css')) { // $FlowFixMe return react__WEBPACK_IMPORTED_MODULE_0__.createElement.apply(undefined, args); } var argsLength = args.length; var createElementArgArray = new Array(argsLength); createElementArgArray[0] = _emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_5__.E; createElementArgArray[1] = (0,_emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_5__.c)(type, props); for (var i = 2; i < argsLength; i++) { createElementArgArray[i] = args[i]; } // $FlowFixMe return react__WEBPACK_IMPORTED_MODULE_0__.createElement.apply(null, createElementArgArray); }; var warnedAboutCssPropForGlobal = false; // maintain place over rerenders. // initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild // initial client-side render from SSR, use place of hydrating tag var Global = /* #__PURE__ */(/* unused pure expression or super */ null && (withEmotionCache(function (props, cache) { if (false) {} var styles = props.styles; var serialized = serializeStyles([styles], undefined, React.useContext(ThemeContext)); if (!isBrowser$1) { var _ref; var serializedNames = serialized.name; var serializedStyles = serialized.styles; var next = serialized.next; while (next !== undefined) { serializedNames += ' ' + next.name; serializedStyles += next.styles; next = next.next; } var shouldCache = cache.compat === true; var rules = cache.insert("", { name: serializedNames, styles: serializedStyles }, cache.sheet, shouldCache); if (shouldCache) { return null; } return /*#__PURE__*/React.createElement("style", (_ref = {}, _ref["data-emotion"] = cache.key + "-global " + serializedNames, _ref.dangerouslySetInnerHTML = { __html: rules }, _ref.nonce = cache.sheet.nonce, _ref)); } // yes, i know these hooks are used conditionally // but it is based on a constant that will never change at runtime // it's effectively like having two implementations and switching them out // so it's not actually breaking anything var sheetRef = React.useRef(); useInsertionEffectWithLayoutFallback(function () { var key = cache.key + "-global"; // use case of https://github.com/emotion-js/emotion/issues/2675 var sheet = new cache.sheet.constructor({ key: key, nonce: cache.sheet.nonce, container: cache.sheet.container, speedy: cache.sheet.isSpeedy }); var rehydrating = false; // $FlowFixMe var node = document.querySelector("style[data-emotion=\"" + key + " " + serialized.name + "\"]"); if (cache.sheet.tags.length) { sheet.before = cache.sheet.tags[0]; } if (node !== null) { rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other s node.setAttribute('data-emotion', key); sheet.hydrate([node]); } sheetRef.current = [sheet, rehydrating]; return function () { sheet.flush(); }; }, [cache]); useInsertionEffectWithLayoutFallback(function () { var sheetRefCurrent = sheetRef.current; var sheet = sheetRefCurrent[0], rehydrating = sheetRefCurrent[1]; if (rehydrating) { sheetRefCurrent[1] = false; return; } if (serialized.next !== undefined) { // insert keyframes insertStyles(cache, serialized.next, true); } if (sheet.tags.length) { // if this doesn't exist then it will be null so the style element will be appended var element = sheet.tags[sheet.tags.length - 1].nextElementSibling; sheet.before = element; sheet.flush(); } cache.insert("", serialized, sheet, false); }, [cache, serialized.name]); return null; }))); if (false) {} function css() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return (0,_emotion_serialize__WEBPACK_IMPORTED_MODULE_2__/* .serializeStyles */ .J)(args); } var keyframes = function keyframes() { var insertable = css.apply(void 0, arguments); var name = "animation-" + insertable.name; // $FlowFixMe return { name: name, styles: "@keyframes " + name + "{" + insertable.styles + "}", anim: 1, toString: function toString() { return "_EMO_" + this.name + "_" + this.styles + "_EMO_"; } }; }; var classnames = function classnames(args) { var len = args.length; var i = 0; var cls = ''; for (; i < len; i++) { var arg = args[i]; if (arg == null) continue; var toAdd = void 0; switch (typeof arg) { case 'boolean': break; case 'object': { if (Array.isArray(arg)) { toAdd = classnames(arg); } else { if (false) {} toAdd = ''; for (var k in arg) { if (arg[k] && k) { toAdd && (toAdd += ' '); toAdd += k; } } } break; } default: { toAdd = arg; } } if (toAdd) { cls && (cls += ' '); cls += toAdd; } } return cls; }; function merge(registered, css, className) { var registeredStyles = []; var rawClassName = getRegisteredStyles(registered, registeredStyles, className); if (registeredStyles.length < 2) { return className; } return rawClassName + css(registeredStyles); } var Insertion = function Insertion(_ref) { var cache = _ref.cache, serializedArr = _ref.serializedArr; useInsertionEffectAlwaysWithSyncFallback(function () { for (var i = 0; i < serializedArr.length; i++) { insertStyles(cache, serializedArr[i], false); } }); return null; }; var ClassNames = /* #__PURE__ */(/* unused pure expression or super */ null && (withEmotionCache(function (props, cache) { var hasRendered = false; var serializedArr = []; var css = function css() { if (hasRendered && "production" !== 'production') {} for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var serialized = serializeStyles(args, cache.registered); serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx` registerStyles(cache, serialized, false); return cache.key + "-" + serialized.name; }; var cx = function cx() { if (hasRendered && "production" !== 'production') {} for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return merge(cache.registered, css, classnames(args)); }; var content = { css: css, cx: cx, theme: React.useContext(ThemeContext) }; var ele = props.children(content); hasRendered = true; return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, { cache: cache, serializedArr: serializedArr }), ele); }))); if (false) {} if (false) { var globalKey, globalContext, isTestEnv, isBrowser; } /***/ }), /***/ 91545: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ A: () => (/* binding */ memoize) /* harmony export */ }); function memoize(fn) { var cache = Object.create(null); return function (arg) { if (cache[arg] === undefined) cache[arg] = fn(arg); return cache[arg]; }; } /***/ }), /***/ 69209: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ A: () => (/* binding */ unitlessKeys) /* harmony export */ }); var unitlessKeys = { animationIterationCount: 1, aspectRatio: 1, borderImageOutset: 1, borderImageSlice: 1, borderImageWidth: 1, boxFlex: 1, boxFlexGroup: 1, boxOrdinalGroup: 1, columnCount: 1, columns: 1, flex: 1, flexGrow: 1, flexPositive: 1, flexShrink: 1, flexNegative: 1, flexOrder: 1, gridRow: 1, gridRowEnd: 1, gridRowSpan: 1, gridRowStart: 1, gridColumn: 1, gridColumnEnd: 1, gridColumnSpan: 1, gridColumnStart: 1, msGridRow: 1, msGridRowSpan: 1, msGridColumn: 1, msGridColumnSpan: 1, fontWeight: 1, lineHeight: 1, opacity: 1, order: 1, orphans: 1, scale: 1, tabSize: 1, widows: 1, zIndex: 1, zoom: 1, WebkitLineClamp: 1, // SVG-related properties fillOpacity: 1, floodOpacity: 1, stopOpacity: 1, strokeDasharray: 1, strokeDashoffset: 1, strokeMiterlimit: 1, strokeOpacity: 1, strokeWidth: 1 }; /***/ }), /***/ 71287: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; var react__WEBPACK_IMPORTED_MODULE_0___namespace_cache; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ s: () => (/* binding */ useInsertionEffectAlwaysWithSyncFallback) /* harmony export */ }); /* unused harmony export useInsertionEffectWithLayoutFallback */ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96540); var syncFallback = function syncFallback(create) { return create(); }; var useInsertionEffect = /*#__PURE__*/ (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache || (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache = __webpack_require__.t(react__WEBPACK_IMPORTED_MODULE_0__, 2)))['useInsertion' + 'Effect'] ? /*#__PURE__*/ (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache || (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache = __webpack_require__.t(react__WEBPACK_IMPORTED_MODULE_0__, 2)))['useInsertion' + 'Effect'] : false; var useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback; var useInsertionEffectWithLayoutFallback = useInsertionEffect || react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect; /***/ }), /***/ 63066: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var growthbook = __webpack_require__(200); var React = __webpack_require__(96540); function _interopNamespace(e) { if (e && e.__esModule) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n["default"] = e; return Object.freeze(n); } var React__namespace = /*#__PURE__*/_interopNamespace(React); function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } /** @deprecated */ const GrowthBookContext = /*#__PURE__*/React__namespace.createContext({}); /** @deprecated */ async function getGrowthBookSSRData(context) { // Server-side GrowthBook instance const gb = new growthbook.GrowthBook({ ...context }); // Load feature flags from network if needed if (context.clientKey) { await gb.init(); } const data = { attributes: gb.getAttributes(), features: gb.getFeatures() }; gb.destroy(); return data; } /** @deprecated */ function useGrowthBookSSR(data) { const gb = useGrowthBook(); // Only do this once to avoid infinite loops const isFirst = React__namespace.useRef(true); if (gb && isFirst.current) { gb.setFeatures(data.features); gb.setAttributes(data.attributes); isFirst.current = false; } } function useExperiment(exp) { const { growthbook } = React__namespace.useContext(GrowthBookContext); return growthbook.run(exp); } function useFeature(id) { const growthbook = useGrowthBook(); return growthbook.evalFeature(id); } function useFeatureIsOn(id) { const growthbook = useGrowthBook(); return growthbook.isOn(id); } function useFeatureValue(id, fallback) { const growthbook = useGrowthBook(); return growthbook.getFeatureValue(id, fallback); } function useGrowthBook() { const { growthbook } = React__namespace.useContext(GrowthBookContext); if (!growthbook) { throw new Error("Missing or invalid GrowthBookProvider"); } return growthbook; } function FeaturesReady({ children, timeout, fallback }) { const gb = useGrowthBook(); const [hitTimeout, setHitTimeout] = React__namespace.useState(false); const ready = gb ? gb.ready : false; React__namespace.useEffect(() => { if (timeout && !ready) { const timer = setTimeout(() => { gb && gb.log("FeaturesReady timed out waiting for features to load", { timeout }); setHitTimeout(true); }, timeout); return () => clearTimeout(timer); } }, [timeout, ready, gb]); return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, ready || hitTimeout ? children : fallback || null); } function IfFeatureEnabled({ children, feature }) { return useFeature(feature).on ? /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, children) : null; } function FeatureString(props) { const value = useFeature(props.feature).value; if (value !== null) { return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, value); } return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, props.default); } const withRunExperiment = Component => { // eslint-disable-next-line const withRunExperimentWrapper = props => /*#__PURE__*/React__namespace.createElement(GrowthBookContext.Consumer, null, ({ growthbook }) => { return /*#__PURE__*/React__namespace.createElement(Component, _extends({}, props, { runExperiment: exp => growthbook.run(exp) })); }); return withRunExperimentWrapper; }; withRunExperiment.displayName = "WithRunExperiment"; const GrowthBookProvider = ({ children, growthbook }) => { // Tell growthbook how to re-render our app (for dev mode integration) // eslint-disable-next-line const [_, setRenderCount] = React__namespace.useState(0); React__namespace.useEffect(() => { if (!growthbook || !growthbook.setRenderer) return; growthbook.setRenderer(() => { setRenderCount(v => v + 1); }); return () => { growthbook.setRenderer(() => { // do nothing }); }; }, [growthbook]); return /*#__PURE__*/React__namespace.createElement(GrowthBookContext.Provider, { value: { growthbook } }, children); }; Object.defineProperty(exports, "BrowserCookieStickyBucketService", ({ enumerable: true, get: function () { return growthbook.BrowserCookieStickyBucketService; } })); Object.defineProperty(exports, "ExpressCookieStickyBucketService", ({ enumerable: true, get: function () { return growthbook.ExpressCookieStickyBucketService; } })); Object.defineProperty(exports, "GrowthBook", ({ enumerable: true, get: function () { return growthbook.GrowthBook; } })); Object.defineProperty(exports, "LocalStorageStickyBucketService", ({ enumerable: true, get: function () { return growthbook.LocalStorageStickyBucketService; } })); Object.defineProperty(exports, "RedisStickyBucketService", ({ enumerable: true, get: function () { return growthbook.RedisStickyBucketService; } })); Object.defineProperty(exports, "StickyBucketService", ({ enumerable: true, get: function () { return growthbook.StickyBucketService; } })); Object.defineProperty(exports, "clearCache", ({ enumerable: true, get: function () { return growthbook.clearCache; } })); Object.defineProperty(exports, "configureCache", ({ enumerable: true, get: function () { return growthbook.configureCache; } })); Object.defineProperty(exports, "getPolyfills", ({ enumerable: true, get: function () { return growthbook.getPolyfills; } })); Object.defineProperty(exports, "helpers", ({ enumerable: true, get: function () { return growthbook.helpers; } })); Object.defineProperty(exports, "prefetchPayload", ({ enumerable: true, get: function () { return growthbook.prefetchPayload; } })); Object.defineProperty(exports, "setPolyfills", ({ enumerable: true, get: function () { return growthbook.setPolyfills; } })); exports.FeatureString = FeatureString; exports.FeaturesReady = FeaturesReady; exports.GrowthBookContext = GrowthBookContext; exports.GrowthBookProvider = GrowthBookProvider; exports.IfFeatureEnabled = IfFeatureEnabled; exports.getGrowthBookSSRData = getGrowthBookSSRData; exports.useExperiment = useExperiment; exports.useFeature = useFeature; exports.useFeatureIsOn = useFeatureIsOn; exports.useFeatureValue = useFeatureValue; exports.useGrowthBook = useGrowthBook; exports.useGrowthBookSSR = useGrowthBookSSR; exports.withRunExperiment = withRunExperiment; //# sourceMappingURL=index.js.map /***/ }), /***/ 96328: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.GrowthBook = void 0; exports.prefetchPayload = prefetchPayload; var _domMutator = _interopRequireDefault(__webpack_require__(99591)); var _util = __webpack_require__(5106); var _featureRepository = __webpack_require__(86707); var _core = __webpack_require__(13569); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const isBrowser = true && typeof document !== "undefined"; const SDK_VERSION = (0, _util.loadSDKVersion)(); class GrowthBook { // context is technically private, but some tools depend on it so we can't mangle the name // Properties and methods that start with "_" are mangled by Terser (saves ~150 bytes) constructor(options) { options = options || {}; // These properties are all initialized in the constructor instead of above // This saves ~80 bytes in the final output this.version = SDK_VERSION; this._options = this.context = options; this._renderer = options.renderer || null; this._trackedExperiments = new Set(); this._completedChangeIds = new Set(); this._trackedFeatures = {}; this.debug = !!options.debug; this._subscriptions = new Set(); this.ready = false; this._assigned = new Map(); this._activeAutoExperiments = new Map(); this._triggeredExpKeys = new Set(); this._initialized = false; this._redirectedUrl = ""; this._deferredTrackingCalls = new Map(); this._autoExperimentsAllowed = !options.disableExperimentsOnLoad; this._destroyCallbacks = []; this.logs = []; this.log = this.log.bind(this); this._saveDeferredTrack = this._saveDeferredTrack.bind(this); this._fireSubscriptions = this._fireSubscriptions.bind(this); this._recordChangedId = this._recordChangedId.bind(this); if (options.remoteEval) { if (options.decryptionKey) { throw new Error("Encryption is not available for remoteEval"); } if (!options.clientKey) { throw new Error("Missing clientKey"); } let isGbHost = false; try { isGbHost = !!new URL(options.apiHost || "").hostname.match(/growthbook\.io$/i); } catch (e) { // ignore invalid URLs } if (isGbHost) { throw new Error("Cannot use remoteEval on GrowthBook Cloud"); } } else { if (options.cacheKeyAttributes) { throw new Error("cacheKeyAttributes are only used for remoteEval"); } } if (options.stickyBucketService) { const s = options.stickyBucketService; this._saveStickyBucketAssignmentDoc = doc => { return s.saveAssignments(doc); }; } if (options.plugins) { for (const plugin of options.plugins) { plugin(this); } } if (options.features) { this.ready = true; } if (isBrowser && options.enableDevMode) { window._growthbook = this; document.dispatchEvent(new Event("gbloaded")); } if (options.experiments) { this.ready = true; this._updateAllAutoExperiments(); } // Hydrate sticky bucket service if (this._options.stickyBucketService && this._options.stickyBucketAssignmentDocs) { for (const key in this._options.stickyBucketAssignmentDocs) { const doc = this._options.stickyBucketAssignmentDocs[key]; if (doc) { this._options.stickyBucketService.saveAssignments(doc).catch(() => { // Ignore hydration errors }); } } } // Legacy - passing in features/experiments into the constructor instead of using init if (this.ready) { this.refreshStickyBuckets(this.getPayload()); } } async setPayload(payload) { this._payload = payload; const data = await (0, _core.decryptPayload)(payload, this._options.decryptionKey); this._decryptedPayload = data; await this.refreshStickyBuckets(data); if (data.features) { this._options.features = data.features; } if (data.savedGroups) { this._options.savedGroups = data.savedGroups; } if (data.experiments) { this._options.experiments = data.experiments; this._updateAllAutoExperiments(); } this.ready = true; this._render(); } initSync(options) { this._initialized = true; const payload = options.payload; if (payload.encryptedExperiments || payload.encryptedFeatures) { throw new Error("initSync does not support encrypted payloads"); } if (this._options.stickyBucketService && !this._options.stickyBucketAssignmentDocs) { this._options.stickyBucketAssignmentDocs = this.generateStickyBucketAssignmentDocsSync(this._options.stickyBucketService, payload); } this._payload = payload; this._decryptedPayload = payload; if (payload.features) { this._options.features = payload.features; } if (payload.experiments) { this._options.experiments = payload.experiments; this._updateAllAutoExperiments(); } this.ready = true; (0, _featureRepository.startStreaming)(this, options); return this; } async init(options) { this._initialized = true; options = options || {}; if (options.cacheSettings) { (0, _featureRepository.configureCache)(options.cacheSettings); } if (options.payload) { await this.setPayload(options.payload); (0, _featureRepository.startStreaming)(this, options); return { success: true, source: "init" }; } else { const { data, ...res } = await this._refresh({ ...options, allowStale: true }); (0, _featureRepository.startStreaming)(this, options); await this.setPayload(data || {}); return res; } } /** @deprecated Use {@link init} */ async loadFeatures(options) { options = options || {}; await this.init({ skipCache: options.skipCache, timeout: options.timeout, streaming: (this._options.backgroundSync ?? true) && (options.autoRefresh || this._options.subscribeToChanges) }); } async refreshFeatures(options) { const res = await this._refresh({ ...(options || {}), allowStale: false }); if (res.data) { await this.setPayload(res.data); } } getApiInfo() { return [this.getApiHosts().apiHost, this.getClientKey()]; } getApiHosts() { return (0, _core.getApiHosts)(this._options); } getClientKey() { return this._options.clientKey || ""; } getPayload() { return this._payload || { features: this.getFeatures(), experiments: this.getExperiments() }; } getDecryptedPayload() { return this._decryptedPayload || this.getPayload(); } isRemoteEval() { return this._options.remoteEval || false; } getCacheKeyAttributes() { return this._options.cacheKeyAttributes; } async _refresh(_ref) { let { timeout, skipCache, allowStale, streaming } = _ref; if (!this._options.clientKey) { throw new Error("Missing clientKey"); } // Trigger refresh in feature repository return (0, _featureRepository.refreshFeatures)({ instance: this, timeout, skipCache: skipCache || this._options.disableCache, allowStale, backgroundSync: streaming ?? this._options.backgroundSync ?? true }); } _render() { if (this._renderer) { try { this._renderer(); } catch (e) { console.error("Failed to render", e); } } } /** @deprecated Use {@link setPayload} */ setFeatures(features) { this._options.features = features; this.ready = true; this._render(); } /** @deprecated Use {@link setPayload} */ async setEncryptedFeatures(encryptedString, decryptionKey, subtle) { const featuresJSON = await (0, _util.decrypt)(encryptedString, decryptionKey || this._options.decryptionKey, subtle); this.setFeatures(JSON.parse(featuresJSON)); } /** @deprecated Use {@link setPayload} */ setExperiments(experiments) { this._options.experiments = experiments; this.ready = true; this._updateAllAutoExperiments(); } /** @deprecated Use {@link setPayload} */ async setEncryptedExperiments(encryptedString, decryptionKey, subtle) { const experimentsJSON = await (0, _util.decrypt)(encryptedString, decryptionKey || this._options.decryptionKey, subtle); this.setExperiments(JSON.parse(experimentsJSON)); } async setAttributes(attributes) { this._options.attributes = attributes; if (this._options.stickyBucketService) { await this.refreshStickyBuckets(); } if (this._options.remoteEval) { await this._refreshForRemoteEval(); return; } this._render(); this._updateAllAutoExperiments(); } async updateAttributes(attributes) { return this.setAttributes({ ...this._options.attributes, ...attributes }); } async setAttributeOverrides(overrides) { this._options.attributeOverrides = overrides; if (this._options.stickyBucketService) { await this.refreshStickyBuckets(); } if (this._options.remoteEval) { await this._refreshForRemoteEval(); return; } this._render(); this._updateAllAutoExperiments(); } async setForcedVariations(vars) { this._options.forcedVariations = vars || {}; if (this._options.remoteEval) { await this._refreshForRemoteEval(); return; } this._render(); this._updateAllAutoExperiments(); } // eslint-disable-next-line setForcedFeatures(map) { this._options.forcedFeatureValues = map; this._render(); } async setURL(url) { if (url === this._options.url) return; this._options.url = url; this._redirectedUrl = ""; if (this._options.remoteEval) { await this._refreshForRemoteEval(); this._updateAllAutoExperiments(true); return; } this._updateAllAutoExperiments(true); } getAttributes() { return { ...this._options.attributes, ...this._options.attributeOverrides }; } getForcedVariations() { return this._options.forcedVariations || {}; } getForcedFeatures() { // eslint-disable-next-line return this._options.forcedFeatureValues || new Map(); } getStickyBucketAssignmentDocs() { return this._options.stickyBucketAssignmentDocs || {}; } getUrl() { return this._options.url || ""; } getFeatures() { return this._options.features || {}; } getExperiments() { return this._options.experiments || []; } getCompletedChangeIds() { return Array.from(this._completedChangeIds); } subscribe(cb) { this._subscriptions.add(cb); return () => { this._subscriptions.delete(cb); }; } async _refreshForRemoteEval() { if (!this._options.remoteEval) return; if (!this._initialized) return; const res = await this._refresh({ allowStale: false }); if (res.data) { await this.setPayload(res.data); } } getAllResults() { return new Map(this._assigned); } onDestroy(cb) { this._destroyCallbacks.push(cb); } isDestroyed() { return !!this._destroyed; } destroy() { this._destroyed = true; // Custom callbacks // Do this first in case it needs access to the below data that is cleared this._destroyCallbacks.forEach(cb => { try { cb(); } catch (e) { console.error(e); } }); // Release references to save memory this._subscriptions.clear(); this._assigned.clear(); this._trackedExperiments.clear(); this._completedChangeIds.clear(); this._deferredTrackingCalls.clear(); this._trackedFeatures = {}; this._destroyCallbacks = []; this._payload = undefined; this._saveStickyBucketAssignmentDoc = undefined; (0, _featureRepository.unsubscribe)(this); this.logs = []; if (isBrowser && window._growthbook === this) { delete window._growthbook; } // Undo any active auto experiments this._activeAutoExperiments.forEach(exp => { exp.undo(); }); this._activeAutoExperiments.clear(); this._triggeredExpKeys.clear(); } setRenderer(renderer) { this._renderer = renderer; } forceVariation(key, variation) { this._options.forcedVariations = this._options.forcedVariations || {}; this._options.forcedVariations[key] = variation; if (this._options.remoteEval) { this._refreshForRemoteEval(); return; } this._updateAllAutoExperiments(); this._render(); } run(experiment) { const { result } = (0, _core.runExperiment)(experiment, null, this._getEvalContext()); this._fireSubscriptions(experiment, result); return result; } triggerExperiment(key) { this._triggeredExpKeys.add(key); if (!this._options.experiments) return null; const experiments = this._options.experiments.filter(exp => exp.key === key); return experiments.map(exp => { return this._runAutoExperiment(exp); }).filter(res => res !== null); } triggerAutoExperiments() { this._autoExperimentsAllowed = true; this._updateAllAutoExperiments(true); } _getEvalContext() { return { user: this._getUserContext(), global: this._getGlobalContext(), stack: { evaluatedFeatures: new Set() } }; } _getUserContext() { return { attributes: this._options.user ? { ...this._options.user, ...this._options.attributes } : this._options.attributes, enableDevMode: this._options.enableDevMode, blockedChangeIds: this._options.blockedChangeIds, stickyBucketAssignmentDocs: this._options.stickyBucketAssignmentDocs, url: this._getContextUrl(), forcedVariations: this._options.forcedVariations, forcedFeatureValues: this._options.forcedFeatureValues, attributeOverrides: this._options.attributeOverrides, saveStickyBucketAssignmentDoc: this._saveStickyBucketAssignmentDoc, trackingCallback: this._options.trackingCallback, onFeatureUsage: this._options.onFeatureUsage, devLogs: this.logs, trackedExperiments: this._trackedExperiments, trackedFeatureUsage: this._trackedFeatures }; } _getGlobalContext() { return { features: this._options.features, experiments: this._options.experiments, log: this.log, enabled: this._options.enabled, qaMode: this._options.qaMode, savedGroups: this._options.savedGroups, groups: this._options.groups, overrides: this._options.overrides, onExperimentEval: this._subscriptions.size > 0 ? this._fireSubscriptions : undefined, recordChangeId: this._recordChangedId, saveDeferredTrack: this._saveDeferredTrack, eventLogger: this._options.eventLogger }; } _runAutoExperiment(experiment, forceRerun) { const existing = this._activeAutoExperiments.get(experiment); // If this is a manual experiment and it's not already running, skip if (experiment.manual && !this._triggeredExpKeys.has(experiment.key) && !existing) return null; // Check if this particular experiment is blocked by options settings // For example, if all visualEditor experiments are disabled const isBlocked = this._isAutoExperimentBlockedByContext(experiment); if (isBlocked) { false && 0; } let result; let trackingCall; // Run the experiment (if blocked exclude) if (isBlocked) { result = (0, _core.getExperimentResult)(this._getEvalContext(), experiment, -1, false, ""); } else { ({ result, trackingCall } = (0, _core.runExperiment)(experiment, null, this._getEvalContext())); this._fireSubscriptions(experiment, result); } // A hash to quickly tell if the assigned value changed const valueHash = JSON.stringify(result.value); // If the changes are already active, no need to re-apply them if (!forceRerun && result.inExperiment && existing && existing.valueHash === valueHash) { return result; } // Undo any existing changes if (existing) this._undoActiveAutoExperiment(experiment); // Apply new changes if (result.inExperiment) { const changeType = (0, _util.getAutoExperimentChangeType)(experiment); if (changeType === "redirect" && result.value.urlRedirect && experiment.urlPatterns) { const url = experiment.persistQueryString ? (0, _util.mergeQueryStrings)(this._getContextUrl(), result.value.urlRedirect) : result.value.urlRedirect; if ((0, _util.isURLTargeted)(url, experiment.urlPatterns)) { this.log("Skipping redirect because original URL matches redirect URL", { id: experiment.key }); return result; } this._redirectedUrl = url; const { navigate, delay } = this._getNavigateFunction(); if (navigate) { if (isBrowser) { // Wait for the possibly-async tracking callback, bound by min and max delays Promise.all([...(trackingCall ? [(0, _util.promiseTimeout)(trackingCall, this._options.maxNavigateDelay ?? 1000)] : []), new Promise(resolve => window.setTimeout(resolve, this._options.navigateDelay ?? delay))]).then(() => { try { navigate(url); } catch (e) { console.error(e); } }); } else { try { navigate(url); } catch (e) { console.error(e); } } } } else if (changeType === "visual") { const undo = this._options.applyDomChangesCallback ? this._options.applyDomChangesCallback(result.value) : this._applyDOMChanges(result.value); if (undo) { this._activeAutoExperiments.set(experiment, { undo, valueHash }); } } } return result; } _undoActiveAutoExperiment(exp) { const data = this._activeAutoExperiments.get(exp); if (data) { data.undo(); this._activeAutoExperiments.delete(exp); } } _updateAllAutoExperiments(forceRerun) { if (!this._autoExperimentsAllowed) return; const experiments = this._options.experiments || []; // Stop any experiments that are no longer defined const keys = new Set(experiments); this._activeAutoExperiments.forEach((v, k) => { if (!keys.has(k)) { v.undo(); this._activeAutoExperiments.delete(k); } }); // Re-run all new/updated experiments for (const exp of experiments) { const result = this._runAutoExperiment(exp, forceRerun); // Once you're in a redirect experiment, break out of the loop and don't run any further experiments if (result !== null && result !== void 0 && result.inExperiment && (0, _util.getAutoExperimentChangeType)(exp) === "redirect") { break; } } } _fireSubscriptions(experiment, result) { const key = experiment.key; // If assigned variation has changed, fire subscriptions const prev = this._assigned.get(key); // TODO: what if the experiment definition has changed? if (!prev || prev.result.inExperiment !== result.inExperiment || prev.result.variationId !== result.variationId) { this._assigned.set(key, { experiment, result }); this._subscriptions.forEach(cb => { try { cb(experiment, result); } catch (e) { console.error(e); } }); } } _recordChangedId(id) { this._completedChangeIds.add(id); } isOn(key) { return this.evalFeature(key).on; } isOff(key) { return this.evalFeature(key).off; } getFeatureValue(key, defaultValue) { const value = this.evalFeature(key).value; return value === null ? defaultValue : value; } /** * @deprecated Use {@link evalFeature} * @param id */ // eslint-disable-next-line feature(id) { return this.evalFeature(id); } evalFeature(id) { return (0, _core.evalFeature)(id, this._getEvalContext()); } log(msg, ctx) { if (!this.debug) return; if (this._options.log) this._options.log(msg, ctx);else console.log(msg, ctx); } getDeferredTrackingCalls() { return Array.from(this._deferredTrackingCalls.values()); } setDeferredTrackingCalls(calls) { this._deferredTrackingCalls = new Map(calls.filter(c => c && c.experiment && c.result).map(c => { return [(0, _core.getExperimentDedupeKey)(c.experiment, c.result), c]; })); } async fireDeferredTrackingCalls() { if (!this._options.trackingCallback) return; const promises = []; this._deferredTrackingCalls.forEach(call => { if (!call || !call.experiment || !call.result) { console.error("Invalid deferred tracking call", { call: call }); } else { promises.push(this._options.trackingCallback(call.experiment, call.result)); } }); this._deferredTrackingCalls.clear(); await Promise.all(promises); } setTrackingCallback(callback) { this._options.trackingCallback = callback; this.fireDeferredTrackingCalls(); } setEventLogger(logger) { this._options.eventLogger = logger; } async logEvent(eventName, properties) { if (this._destroyed) { console.error("Cannot log event to destroyed GrowthBook instance"); return; } if (this._options.enableDevMode) { this.logs.push({ eventName, properties, timestamp: Date.now().toString(), logType: "event" }); } if (this._options.eventLogger) { try { await this._options.eventLogger(eventName, properties || {}, this._getUserContext()); } catch (e) { console.error(e); } } else { console.error("No event logger configured"); } } _saveDeferredTrack(data) { this._deferredTrackingCalls.set((0, _core.getExperimentDedupeKey)(data.experiment, data.result), data); } _getContextUrl() { return this._options.url || (isBrowser ? window.location.href : ""); } _isAutoExperimentBlockedByContext(experiment) { const changeType = (0, _util.getAutoExperimentChangeType)(experiment); if (changeType === "visual") { if (this._options.disableVisualExperiments) return true; if (this._options.disableJsInjection) { if (experiment.variations.some(v => v.js)) { return true; } } } else if (changeType === "redirect") { if (this._options.disableUrlRedirectExperiments) return true; // Validate URLs try { const current = new URL(this._getContextUrl()); for (const v of experiment.variations) { if (!v || !v.urlRedirect) continue; const url = new URL(v.urlRedirect); // If we're blocking cross origin redirects, block if the protocol or host is different if (this._options.disableCrossOriginUrlRedirectExperiments) { if (url.protocol !== current.protocol) return true; if (url.host !== current.host) return true; } } } catch (e) { // Problem parsing one of the URLs this.log("Error parsing current or redirect URL", { id: experiment.key, error: e }); return true; } } else { // Block any unknown changeTypes return true; } if (experiment.changeId && (this._options.blockedChangeIds || []).includes(experiment.changeId)) { return true; } return false; } getRedirectUrl() { return this._redirectedUrl; } _getNavigateFunction() { if (this._options.navigate) { return { navigate: this._options.navigate, delay: 0 }; } else if (isBrowser) { return { navigate: url => { window.location.replace(url); }, delay: 100 }; } return { navigate: null, delay: 0 }; } _applyDOMChanges(changes) { if (!isBrowser) return; const undo = []; if (changes.css) { const s = document.createElement("style"); s.innerHTML = changes.css; document.head.appendChild(s); undo.push(() => s.remove()); } if (changes.js) { const script = document.createElement("script"); script.innerHTML = changes.js; if (this._options.jsInjectionNonce) { script.nonce = this._options.jsInjectionNonce; } document.head.appendChild(script); undo.push(() => script.remove()); } if (changes.domMutations) { changes.domMutations.forEach(mutation => { undo.push(_domMutator.default.declarative(mutation).revert); }); } return () => { undo.forEach(fn => fn()); }; } async refreshStickyBuckets(data) { if (this._options.stickyBucketService) { const ctx = this._getEvalContext(); const docs = await (0, _core.getAllStickyBucketAssignmentDocs)(ctx, this._options.stickyBucketService, data); this._options.stickyBucketAssignmentDocs = docs; } } generateStickyBucketAssignmentDocsSync(stickyBucketService, payload) { if (!("getAllAssignmentsSync" in stickyBucketService)) { console.error("generating StickyBucketAssignmentDocs docs requires StickyBucketServiceSync"); return; } const ctx = this._getEvalContext(); const attributes = (0, _core.getStickyBucketAttributes)(ctx, payload); return stickyBucketService.getAllAssignmentsSync(attributes); } inDevMode() { return !!this._options.enableDevMode; } } exports.GrowthBook = GrowthBook; async function prefetchPayload(options) { // Create a temporary instance, just to fetch the payload const instance = new GrowthBook(options); await (0, _featureRepository.refreshFeatures)({ instance, skipCache: options.skipCache, allowStale: false, backgroundSync: options.streaming }); instance.destroy(); } //# sourceMappingURL=GrowthBook.js.map /***/ }), /***/ 84555: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.UserScopedGrowthBook = exports.GrowthBookClient = void 0; var _util = __webpack_require__(5106); var _featureRepository = __webpack_require__(86707); var _core = __webpack_require__(13569); const SDK_VERSION = (0, _util.loadSDKVersion)(); class GrowthBookClient { // Properties and methods that start with "_" are mangled by Terser (saves ~150 bytes) constructor(options) { options = options || {}; // These properties are all initialized in the constructor instead of above // This saves ~80 bytes in the final output this.version = SDK_VERSION; this._options = options; this.debug = !!options.debug; this.ready = false; this._features = {}; this._experiments = []; this.log = this.log.bind(this); if (options.plugins) { for (const plugin of options.plugins) { plugin(this); } } } async setPayload(payload) { this._payload = payload; const data = await (0, _core.decryptPayload)(payload, this._options.decryptionKey); this._decryptedPayload = data; if (data.features) { this._features = data.features; } if (data.experiments) { this._experiments = data.experiments; } if (data.savedGroups) { this._options.savedGroups = data.savedGroups; } this.ready = true; } initSync(options) { const payload = options.payload; if (payload.encryptedExperiments || payload.encryptedFeatures) { throw new Error("initSync does not support encrypted payloads"); } this._payload = payload; this._decryptedPayload = payload; if (payload.features) { this._features = payload.features; } if (payload.experiments) { this._experiments = payload.experiments; } this.ready = true; (0, _featureRepository.startStreaming)(this, options); return this; } async init(options) { options = options || {}; if (options.cacheSettings) { (0, _featureRepository.configureCache)(options.cacheSettings); } if (options.payload) { await this.setPayload(options.payload); (0, _featureRepository.startStreaming)(this, options); return { success: true, source: "init" }; } else { const { data, ...res } = await this._refresh({ ...options, allowStale: true }); (0, _featureRepository.startStreaming)(this, options); await this.setPayload(data || {}); return res; } } async refreshFeatures(options) { const res = await this._refresh({ ...(options || {}), allowStale: false }); if (res.data) { await this.setPayload(res.data); } } getApiInfo() { return [this.getApiHosts().apiHost, this.getClientKey()]; } getApiHosts() { return (0, _core.getApiHosts)(this._options); } getClientKey() { return this._options.clientKey || ""; } getPayload() { return this._payload || { features: this.getFeatures(), experiments: this._experiments || [] }; } getDecryptedPayload() { return this._decryptedPayload || this.getPayload(); } async _refresh(_ref) { let { timeout, skipCache, allowStale, streaming } = _ref; if (!this._options.clientKey) { throw new Error("Missing clientKey"); } // Trigger refresh in feature repository return (0, _featureRepository.refreshFeatures)({ instance: this, timeout, skipCache: skipCache || this._options.disableCache, allowStale, backgroundSync: streaming ?? true }); } getFeatures() { return this._features || {}; } getGlobalAttributes() { return this._options.globalAttributes || {}; } setGlobalAttributes(attributes) { this._options.globalAttributes = attributes; } destroy() { this._destroyed = true; (0, _featureRepository.unsubscribe)(this); // Release references to save memory this._features = {}; this._experiments = []; this._decryptedPayload = undefined; this._payload = undefined; this._options = {}; } isDestroyed() { return !!this._destroyed; } setEventLogger(logger) { this._options.eventLogger = logger; } logEvent(eventName, properties, userContext) { if (this._options.eventLogger) { const ctx = this._getEvalContext(userContext); this._options.eventLogger(eventName, properties, ctx.user); } } runInlineExperiment(experiment, userContext) { const { result } = (0, _core.runExperiment)(experiment, null, this._getEvalContext(userContext)); return result; } _getEvalContext(userContext) { if (this._options.globalAttributes) { userContext = { ...userContext, attributes: { ...this._options.globalAttributes, ...userContext.attributes } }; } return { user: userContext, global: this._getGlobalContext(), stack: { evaluatedFeatures: new Set() } }; } _getGlobalContext() { return { features: this._features, experiments: this._experiments, log: this.log, enabled: this._options.enabled, qaMode: this._options.qaMode, savedGroups: this._options.savedGroups, forcedFeatureValues: this._options.forcedFeatureValues, forcedVariations: this._options.forcedVariations, trackingCallback: this._options.trackingCallback, onFeatureUsage: this._options.onFeatureUsage }; } isOn(key, userContext) { return this.evalFeature(key, userContext).on; } isOff(key, userContext) { return this.evalFeature(key, userContext).off; } getFeatureValue(key, defaultValue, userContext) { const value = this.evalFeature(key, userContext).value; return value === null ? defaultValue : value; } evalFeature(id, userContext) { return (0, _core.evalFeature)(id, this._getEvalContext(userContext)); } log(msg, ctx) { if (!this.debug) return; if (this._options.log) this._options.log(msg, ctx);else console.log(msg, ctx); } setTrackingCallback(callback) { this._options.trackingCallback = callback; } async applyStickyBuckets(partialContext, stickyBucketService) { const ctx = this._getEvalContext(partialContext); const stickyBucketAssignmentDocs = await (0, _core.getAllStickyBucketAssignmentDocs)(ctx, stickyBucketService); return { ...partialContext, stickyBucketAssignmentDocs, saveStickyBucketAssignmentDoc: doc => stickyBucketService.saveAssignments(doc) }; } createScopedInstance(userContext, userPlugins) { return new UserScopedGrowthBook(this, userContext, [...(this._options.plugins || []), ...(userPlugins || [])]); } } exports.GrowthBookClient = GrowthBookClient; class UserScopedGrowthBook { constructor(gb, userContext, plugins) { this._gb = gb; this._userContext = userContext; this.logs = []; this._userContext.trackedExperiments = this._userContext.trackedExperiments || new Set(); this._userContext.trackedFeatureUsage = this._userContext.trackedFeatureUsage || {}; this._userContext.devLogs = this.logs; if (plugins) { for (const plugin of plugins) { plugin(this); } } } runInlineExperiment(experiment) { return this._gb.runInlineExperiment(experiment, this._userContext); } isOn(key) { return this._gb.isOn(key, this._userContext); } isOff(key) { return this._gb.isOff(key, this._userContext); } getFeatureValue(key, defaultValue) { return this._gb.getFeatureValue(key, defaultValue, this._userContext); } evalFeature(id) { return this._gb.evalFeature(id, this._userContext); } logEvent(eventName, properties) { if (this._userContext.enableDevMode) { this.logs.push({ eventName, properties, timestamp: Date.now().toString(), logType: "event" }); } this._gb.logEvent(eventName, properties || {}, this._userContext); } setTrackingCallback(cb) { this._userContext.trackingCallback = cb; } getApiInfo() { return this._gb.getApiInfo(); } getClientKey() { return this._gb.getClientKey(); } setURL(url) { this._userContext.url = url; } updateAttributes(attributes) { this._userContext.attributes = { ...this._userContext.attributes, ...attributes }; } setAttributeOverrides(overrides) { this._userContext.attributeOverrides = overrides; } async setForcedVariations(vars) { this._userContext.forcedVariations = vars || {}; } // eslint-disable-next-line setForcedFeatures(map) { this._userContext.forcedFeatureValues = map; } getUserContext() { return this._userContext; } getVersion() { return SDK_VERSION; } getDecryptedPayload() { return this._gb.getDecryptedPayload(); } inDevMode() { return !!this._userContext.enableDevMode; } } exports.UserScopedGrowthBook = UserScopedGrowthBook; //# sourceMappingURL=GrowthBookClient.js.map /***/ }), /***/ 13569: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.EVENT_FEATURE_EVALUATED = exports.EVENT_EXPERIMENT_VIEWED = void 0; exports.decryptPayload = decryptPayload; exports.evalFeature = evalFeature; exports.getAllStickyBucketAssignmentDocs = getAllStickyBucketAssignmentDocs; exports.getApiHosts = getApiHosts; exports.getExperimentDedupeKey = getExperimentDedupeKey; exports.getExperimentResult = getExperimentResult; exports.getHashAttribute = getHashAttribute; exports.getStickyBucketAttributeKey = getStickyBucketAttributeKey; exports.getStickyBucketAttributes = getStickyBucketAttributes; exports.runExperiment = runExperiment; var _mongrule = __webpack_require__(12427); var _util = __webpack_require__(5106); const EVENT_FEATURE_EVALUATED = "Feature Evaluated"; exports.EVENT_FEATURE_EVALUATED = EVENT_FEATURE_EVALUATED; const EVENT_EXPERIMENT_VIEWED = "Experiment Viewed"; exports.EVENT_EXPERIMENT_VIEWED = EVENT_EXPERIMENT_VIEWED; function getForcedFeatureValues(ctx) { // Merge user and global values const ret = new Map(); if (ctx.global.forcedFeatureValues) { ctx.global.forcedFeatureValues.forEach((v, k) => ret.set(k, v)); } if (ctx.user.forcedFeatureValues) { ctx.user.forcedFeatureValues.forEach((v, k) => ret.set(k, v)); } return ret; } function getForcedVariations(ctx) { // Merge user and global values if (ctx.global.forcedVariations && ctx.user.forcedVariations) { return { ...ctx.global.forcedVariations, ...ctx.user.forcedVariations }; } else if (ctx.global.forcedVariations) { return ctx.global.forcedVariations; } else if (ctx.user.forcedVariations) { return ctx.user.forcedVariations; } else { return {}; } } async function safeCall(fn) { try { await fn(); } catch (e) { // Do nothing } } function onExperimentViewed(ctx, experiment, result) { // Make sure a tracking callback is only fired once per unique experiment if (ctx.user.trackedExperiments) { const k = getExperimentDedupeKey(experiment, result); if (ctx.user.trackedExperiments.has(k)) { return []; } ctx.user.trackedExperiments.add(k); } if (ctx.user.enableDevMode && ctx.user.devLogs) { ctx.user.devLogs.push({ experiment, result, timestamp: Date.now().toString(), logType: "experiment" }); } const calls = []; if (ctx.global.trackingCallback) { const cb = ctx.global.trackingCallback; calls.push(safeCall(() => cb(experiment, result, ctx.user))); } if (ctx.user.trackingCallback) { const cb = ctx.user.trackingCallback; calls.push(safeCall(() => cb(experiment, result))); } if (ctx.global.eventLogger) { const cb = ctx.global.eventLogger; calls.push(safeCall(() => cb(EVENT_EXPERIMENT_VIEWED, { experimentId: experiment.key, variationId: result.key, hashAttribute: result.hashAttribute, hashValue: result.hashValue }, ctx.user))); } return calls; } function onFeatureUsage(ctx, key, ret) { // Only track a feature once, unless the assigned value changed if (ctx.user.trackedFeatureUsage) { const stringifiedValue = JSON.stringify(ret.value); if (ctx.user.trackedFeatureUsage[key] === stringifiedValue) return; ctx.user.trackedFeatureUsage[key] = stringifiedValue; if (ctx.user.enableDevMode && ctx.user.devLogs) { ctx.user.devLogs.push({ featureKey: key, result: ret, timestamp: Date.now().toString(), logType: "feature" }); } } if (ctx.global.onFeatureUsage) { const cb = ctx.global.onFeatureUsage; safeCall(() => cb(key, ret, ctx.user)); } if (ctx.user.onFeatureUsage) { const cb = ctx.user.onFeatureUsage; safeCall(() => cb(key, ret)); } if (ctx.global.eventLogger) { const cb = ctx.global.eventLogger; safeCall(() => cb(EVENT_FEATURE_EVALUATED, { feature: key, source: ret.source, value: ret.value, ruleId: ret.source === "defaultValue" ? "$default" : ret.ruleId || "", variationId: ret.experimentResult ? ret.experimentResult.key : "" }, ctx.user)); } } function evalFeature(id, ctx) { if (ctx.stack.evaluatedFeatures.has(id)) { false && 0; return getFeatureResult(ctx, id, null, "cyclicPrerequisite"); } ctx.stack.evaluatedFeatures.add(id); ctx.stack.id = id; // Global override const forcedValues = getForcedFeatureValues(ctx); if (forcedValues.has(id)) { false && 0; return getFeatureResult(ctx, id, forcedValues.get(id), "override"); } // Unknown feature id if (!ctx.global.features || !ctx.global.features[id]) { false && 0; return getFeatureResult(ctx, id, null, "unknownFeature"); } // Get the feature const feature = ctx.global.features[id]; // Loop through the rules if (feature.rules) { const evaluatedFeatures = new Set(ctx.stack.evaluatedFeatures); rules: for (const rule of feature.rules) { // If there are prerequisite flag(s), evaluate them if (rule.parentConditions) { for (const parentCondition of rule.parentConditions) { ctx.stack.evaluatedFeatures = new Set(evaluatedFeatures); const parentResult = evalFeature(parentCondition.id, ctx); // break out for cyclic prerequisites if (parentResult.source === "cyclicPrerequisite") { return getFeatureResult(ctx, id, null, "cyclicPrerequisite"); } const evalObj = { value: parentResult.value }; const evaled = (0, _mongrule.evalCondition)(evalObj, parentCondition.condition || {}); if (!evaled) { // blocking prerequisite eval failed: feature evaluation fails if (parentCondition.gate) { false && 0; return getFeatureResult(ctx, id, null, "prerequisite"); } // non-blocking prerequisite eval failed: break out of parentConditions loop, jump to the next rule false && 0; continue rules; } } } // If there are filters for who is included (e.g. namespaces) if (rule.filters && isFilteredOut(rule.filters, ctx)) { false && 0; continue; } // Feature value is being forced if ("force" in rule) { // If it's a conditional rule, skip if the condition doesn't pass if (rule.condition && !conditionPasses(rule.condition, ctx)) { false && 0; continue; } // If this is a percentage rollout, skip if not included if (!isIncludedInRollout(ctx, rule.seed || id, rule.hashAttribute, ctx.user.saveStickyBucketAssignmentDoc && !rule.disableStickyBucketing ? rule.fallbackAttribute : undefined, rule.range, rule.coverage, rule.hashVersion)) { false && 0; continue; } false && 0; // If this was a remotely evaluated experiment, fire the tracking callbacks if (rule.tracks) { rule.tracks.forEach(t => { const calls = onExperimentViewed(ctx, t.experiment, t.result); if (!calls.length && ctx.global.saveDeferredTrack) { ctx.global.saveDeferredTrack({ experiment: t.experiment, result: t.result }); } }); } return getFeatureResult(ctx, id, rule.force, "force", rule.id); } if (!rule.variations) { false && 0; continue; } // For experiment rules, run an experiment const exp = { variations: rule.variations, key: rule.key || id }; if ("coverage" in rule) exp.coverage = rule.coverage; if (rule.weights) exp.weights = rule.weights; if (rule.hashAttribute) exp.hashAttribute = rule.hashAttribute; if (rule.fallbackAttribute) exp.fallbackAttribute = rule.fallbackAttribute; if (rule.disableStickyBucketing) exp.disableStickyBucketing = rule.disableStickyBucketing; if (rule.bucketVersion !== undefined) exp.bucketVersion = rule.bucketVersion; if (rule.minBucketVersion !== undefined) exp.minBucketVersion = rule.minBucketVersion; if (rule.namespace) exp.namespace = rule.namespace; if (rule.meta) exp.meta = rule.meta; if (rule.ranges) exp.ranges = rule.ranges; if (rule.name) exp.name = rule.name; if (rule.phase) exp.phase = rule.phase; if (rule.seed) exp.seed = rule.seed; if (rule.hashVersion) exp.hashVersion = rule.hashVersion; if (rule.filters) exp.filters = rule.filters; if (rule.condition) exp.condition = rule.condition; // Only return a value if the user is part of the experiment const { result } = runExperiment(exp, id, ctx); ctx.global.onExperimentEval && ctx.global.onExperimentEval(exp, result); if (result.inExperiment && !result.passthrough) { return getFeatureResult(ctx, id, result.value, "experiment", rule.id, exp, result); } } } false && 0; // Fall back to using the default value return getFeatureResult(ctx, id, feature.defaultValue === undefined ? null : feature.defaultValue, "defaultValue"); } function runExperiment(experiment, featureId, ctx) { const key = experiment.key; const numVariations = experiment.variations.length; // 1. If experiment has less than 2 variations, return immediately if (numVariations < 2) { false && 0; return { result: getExperimentResult(ctx, experiment, -1, false, featureId) }; } // 2. If the context is disabled, return immediately if (ctx.global.enabled === false || ctx.user.enabled === false) { false && 0; return { result: getExperimentResult(ctx, experiment, -1, false, featureId) }; } // 2.5. Merge in experiment overrides from the context experiment = mergeOverrides(experiment, ctx); // 2.6 New, more powerful URL targeting if (experiment.urlPatterns && !(0, _util.isURLTargeted)(ctx.user.url || "", experiment.urlPatterns)) { false && 0; return { result: getExperimentResult(ctx, experiment, -1, false, featureId) }; } // 3. If a variation is forced from a querystring, return the forced variation const qsOverride = (0, _util.getQueryStringOverride)(key, ctx.user.url || "", numVariations); if (qsOverride !== null) { false && 0; return { result: getExperimentResult(ctx, experiment, qsOverride, false, featureId) }; } // 4. If a variation is forced in the context, return the forced variation const forcedVariations = getForcedVariations(ctx); if (key in forcedVariations) { const variation = forcedVariations[key]; false && 0; return { result: getExperimentResult(ctx, experiment, variation, false, featureId) }; } // 5. Exclude if a draft experiment or not active if (experiment.status === "draft" || experiment.active === false) { false && 0; return { result: getExperimentResult(ctx, experiment, -1, false, featureId) }; } // 6. Get the hash attribute and return if empty const { hashAttribute, hashValue } = getHashAttribute(ctx, experiment.hashAttribute, ctx.user.saveStickyBucketAssignmentDoc && !experiment.disableStickyBucketing ? experiment.fallbackAttribute : undefined); if (!hashValue) { false && 0; return { result: getExperimentResult(ctx, experiment, -1, false, featureId) }; } let assigned = -1; let foundStickyBucket = false; let stickyBucketVersionIsBlocked = false; if (ctx.user.saveStickyBucketAssignmentDoc && !experiment.disableStickyBucketing) { const { variation, versionIsBlocked } = getStickyBucketVariation({ ctx, expKey: experiment.key, expBucketVersion: experiment.bucketVersion, expHashAttribute: experiment.hashAttribute, expFallbackAttribute: experiment.fallbackAttribute, expMinBucketVersion: experiment.minBucketVersion, expMeta: experiment.meta }); foundStickyBucket = variation >= 0; assigned = variation; stickyBucketVersionIsBlocked = !!versionIsBlocked; } // Some checks are not needed if we already have a sticky bucket if (!foundStickyBucket) { // 7. Exclude if user is filtered out (used to be called "namespace") if (experiment.filters) { if (isFilteredOut(experiment.filters, ctx)) { false && 0; return { result: getExperimentResult(ctx, experiment, -1, false, featureId) }; } } else if (experiment.namespace && !(0, _util.inNamespace)(hashValue, experiment.namespace)) { false && 0; return { result: getExperimentResult(ctx, experiment, -1, false, featureId) }; } // 7.5. Exclude if experiment.include returns false or throws if (experiment.include && !(0, _util.isIncluded)(experiment.include)) { false && 0; return { result: getExperimentResult(ctx, experiment, -1, false, featureId) }; } // 8. Exclude if condition is false if (experiment.condition && !conditionPasses(experiment.condition, ctx)) { false && 0; return { result: getExperimentResult(ctx, experiment, -1, false, featureId) }; } // 8.05. Exclude if prerequisites are not met if (experiment.parentConditions) { const evaluatedFeatures = new Set(ctx.stack.evaluatedFeatures); for (const parentCondition of experiment.parentConditions) { ctx.stack.evaluatedFeatures = new Set(evaluatedFeatures); const parentResult = evalFeature(parentCondition.id, ctx); // break out for cyclic prerequisites if (parentResult.source === "cyclicPrerequisite") { return { result: getExperimentResult(ctx, experiment, -1, false, featureId) }; } const evalObj = { value: parentResult.value }; if (!(0, _mongrule.evalCondition)(evalObj, parentCondition.condition || {})) { false && 0; return { result: getExperimentResult(ctx, experiment, -1, false, featureId) }; } } } // 8.1. Exclude if user is not in a required group if (experiment.groups && !hasGroupOverlap(experiment.groups, ctx)) { false && 0; return { result: getExperimentResult(ctx, experiment, -1, false, featureId) }; } } // 8.2. Old style URL targeting if (experiment.url && !urlIsValid(experiment.url, ctx)) { false && 0; return { result: getExperimentResult(ctx, experiment, -1, false, featureId) }; } // 9. Get the variation from the sticky bucket or get bucket ranges and choose variation const n = (0, _util.hash)(experiment.seed || key, hashValue, experiment.hashVersion || 1); if (n === null) { false && 0; return { result: getExperimentResult(ctx, experiment, -1, false, featureId) }; } if (!foundStickyBucket) { const ranges = experiment.ranges || (0, _util.getBucketRanges)(numVariations, experiment.coverage === undefined ? 1 : experiment.coverage, experiment.weights); assigned = (0, _util.chooseVariation)(n, ranges); } // 9.5 Unenroll if any prior sticky buckets are blocked by version if (stickyBucketVersionIsBlocked) { false && 0; return { result: getExperimentResult(ctx, experiment, -1, false, featureId, undefined, true) }; } // 10. Return if not in experiment if (assigned < 0) { false && 0; return { result: getExperimentResult(ctx, experiment, -1, false, featureId) }; } // 11. Experiment has a forced variation if ("force" in experiment) { false && 0; return { result: getExperimentResult(ctx, experiment, experiment.force === undefined ? -1 : experiment.force, false, featureId) }; } // 12. Exclude if in QA mode if (ctx.global.qaMode || ctx.user.qaMode) { false && 0; return { result: getExperimentResult(ctx, experiment, -1, false, featureId) }; } // 12.5. Exclude if experiment is stopped if (experiment.status === "stopped") { false && 0; return { result: getExperimentResult(ctx, experiment, -1, false, featureId) }; } // 13. Build the result object const result = getExperimentResult(ctx, experiment, assigned, true, featureId, n, foundStickyBucket); // 13.5. Persist sticky bucket if (ctx.user.saveStickyBucketAssignmentDoc && !experiment.disableStickyBucketing) { const { changed, key: attrKey, doc } = generateStickyBucketAssignmentDoc(ctx, hashAttribute, (0, _util.toString)(hashValue), { [getStickyBucketExperimentKey(experiment.key, experiment.bucketVersion)]: result.key }); if (changed) { // update local docs ctx.user.stickyBucketAssignmentDocs = ctx.user.stickyBucketAssignmentDocs || {}; ctx.user.stickyBucketAssignmentDocs[attrKey] = doc; // save doc ctx.user.saveStickyBucketAssignmentDoc(doc); } } // 14. Fire the tracking callback(s) // Store the promise in case we're awaiting it (ex: browser url redirects) const trackingCalls = onExperimentViewed(ctx, experiment, result); if (trackingCalls.length === 0 && ctx.global.saveDeferredTrack) { ctx.global.saveDeferredTrack({ experiment, result }); } const trackingCall = !trackingCalls.length ? undefined : trackingCalls.length === 1 ? trackingCalls[0] : Promise.all(trackingCalls).then(() => {}); // 14.1 Keep track of completed changeIds "changeId" in experiment && experiment.changeId && ctx.global.recordChangeId && ctx.global.recordChangeId(experiment.changeId); // 15. Return the result false && 0; return { result, trackingCall }; } function getFeatureResult(ctx, key, value, source, ruleId, experiment, result) { const ret = { value, on: !!value, off: !value, source, ruleId: ruleId || "" }; if (experiment) ret.experiment = experiment; if (result) ret.experimentResult = result; // Track the usage of this feature in real-time if (source !== "override") { onFeatureUsage(ctx, key, ret); } return ret; } function getAttributes(ctx) { return { ...ctx.user.attributes, ...ctx.user.attributeOverrides }; } function conditionPasses(condition, ctx) { return (0, _mongrule.evalCondition)(getAttributes(ctx), condition, ctx.global.savedGroups || {}); } function isFilteredOut(filters, ctx) { return filters.some(filter => { const { hashValue } = getHashAttribute(ctx, filter.attribute); if (!hashValue) return true; const n = (0, _util.hash)(filter.seed, hashValue, filter.hashVersion || 2); if (n === null) return true; return !filter.ranges.some(r => (0, _util.inRange)(n, r)); }); } function isIncludedInRollout(ctx, seed, hashAttribute, fallbackAttribute, range, coverage, hashVersion) { if (!range && coverage === undefined) return true; if (!range && coverage === 0) return false; const { hashValue } = getHashAttribute(ctx, hashAttribute, fallbackAttribute); if (!hashValue) { return false; } const n = (0, _util.hash)(seed, hashValue, hashVersion || 1); if (n === null) return false; return range ? (0, _util.inRange)(n, range) : coverage !== undefined ? n <= coverage : true; } function getExperimentResult(ctx, experiment, variationIndex, hashUsed, featureId, bucket, stickyBucketUsed) { let inExperiment = true; // If assigned variation is not valid, use the baseline and mark the user as not in the experiment if (variationIndex < 0 || variationIndex >= experiment.variations.length) { variationIndex = 0; inExperiment = false; } const { hashAttribute, hashValue } = getHashAttribute(ctx, experiment.hashAttribute, ctx.user.saveStickyBucketAssignmentDoc && !experiment.disableStickyBucketing ? experiment.fallbackAttribute : undefined); const meta = experiment.meta ? experiment.meta[variationIndex] : {}; const res = { key: meta.key || "" + variationIndex, featureId, inExperiment, hashUsed, variationId: variationIndex, value: experiment.variations[variationIndex], hashAttribute, hashValue, stickyBucketUsed: !!stickyBucketUsed }; if (meta.name) res.name = meta.name; if (bucket !== undefined) res.bucket = bucket; if (meta.passthrough) res.passthrough = meta.passthrough; return res; } function mergeOverrides(experiment, ctx) { const key = experiment.key; const o = ctx.global.overrides; if (o && o[key]) { experiment = Object.assign({}, experiment, o[key]); if (typeof experiment.url === "string") { experiment.url = (0, _util.getUrlRegExp)( // eslint-disable-next-line experiment.url); } } return experiment; } function getHashAttribute(ctx, attr, fallback) { let hashAttribute = attr || "id"; // eslint-disable-next-line @typescript-eslint/no-explicit-any let hashValue = ""; const attributes = getAttributes(ctx); if (attributes[hashAttribute]) { hashValue = attributes[hashAttribute]; } // if no match, try fallback if (!hashValue && fallback) { if (attributes[fallback]) { hashValue = attributes[fallback]; } if (hashValue) { hashAttribute = fallback; } } return { hashAttribute, hashValue }; } function urlIsValid(urlRegex, ctx) { const url = ctx.user.url; if (!url) return false; const pathOnly = url.replace(/^https?:\/\//, "").replace(/^[^/]*\//, "/"); if (urlRegex.test(url)) return true; if (urlRegex.test(pathOnly)) return true; return false; } function hasGroupOverlap(expGroups, ctx) { const groups = ctx.global.groups || {}; for (let i = 0; i < expGroups.length; i++) { if (groups[expGroups[i]]) return true; } return false; } function getStickyBucketVariation(_ref) { let { ctx, expKey, expBucketVersion, expHashAttribute, expFallbackAttribute, expMinBucketVersion, expMeta } = _ref; expBucketVersion = expBucketVersion || 0; expMinBucketVersion = expMinBucketVersion || 0; expHashAttribute = expHashAttribute || "id"; expMeta = expMeta || []; const id = getStickyBucketExperimentKey(expKey, expBucketVersion); const assignments = getStickyBucketAssignments(ctx, expHashAttribute, expFallbackAttribute); // users with any blocked bucket version (0 to minExperimentBucketVersion) are excluded from the test if (expMinBucketVersion > 0) { for (let i = 0; i <= expMinBucketVersion; i++) { const blockedKey = getStickyBucketExperimentKey(expKey, i); if (assignments[blockedKey] !== undefined) { return { variation: -1, versionIsBlocked: true }; } } } const variationKey = assignments[id]; if (variationKey === undefined) // no assignment found return { variation: -1 }; const variation = expMeta.findIndex(m => m.key === variationKey); if (variation < 0) // invalid assignment, treat as "no assignment found" return { variation: -1 }; return { variation }; } function getStickyBucketExperimentKey(experimentKey, experimentBucketVersion) { experimentBucketVersion = experimentBucketVersion || 0; return `${experimentKey}__${experimentBucketVersion}`; } function getStickyBucketAttributeKey(attributeName, attributeValue) { return `${attributeName}||${attributeValue}`; } function getStickyBucketAssignments(ctx, expHashAttribute, expFallbackAttribute) { if (!ctx.user.stickyBucketAssignmentDocs) return {}; const { hashAttribute, hashValue } = getHashAttribute(ctx, expHashAttribute); const hashKey = getStickyBucketAttributeKey(hashAttribute, (0, _util.toString)(hashValue)); const { hashAttribute: fallbackAttribute, hashValue: fallbackValue } = getHashAttribute(ctx, expFallbackAttribute); const fallbackKey = fallbackValue ? getStickyBucketAttributeKey(fallbackAttribute, (0, _util.toString)(fallbackValue)) : null; const assignments = {}; if (fallbackKey && ctx.user.stickyBucketAssignmentDocs[fallbackKey]) { Object.assign(assignments, ctx.user.stickyBucketAssignmentDocs[fallbackKey].assignments || {}); } if (ctx.user.stickyBucketAssignmentDocs[hashKey]) { Object.assign(assignments, ctx.user.stickyBucketAssignmentDocs[hashKey].assignments || {}); } return assignments; } function generateStickyBucketAssignmentDoc(ctx, attributeName, attributeValue, assignments) { const key = getStickyBucketAttributeKey(attributeName, attributeValue); const existingAssignments = ctx.user.stickyBucketAssignmentDocs && ctx.user.stickyBucketAssignmentDocs[key] ? ctx.user.stickyBucketAssignmentDocs[key].assignments || {} : {}; const newAssignments = { ...existingAssignments, ...assignments }; const changed = JSON.stringify(existingAssignments) !== JSON.stringify(newAssignments); return { key, doc: { attributeName, attributeValue, assignments: newAssignments }, changed }; } function deriveStickyBucketIdentifierAttributes(ctx, data) { const attributes = new Set(); const features = data && data.features ? data.features : ctx.global.features || {}; const experiments = data && data.experiments ? data.experiments : ctx.global.experiments || []; Object.keys(features).forEach(id => { const feature = features[id]; if (feature.rules) { for (const rule of feature.rules) { if (rule.variations) { attributes.add(rule.hashAttribute || "id"); if (rule.fallbackAttribute) { attributes.add(rule.fallbackAttribute); } } } } }); experiments.map(experiment => { attributes.add(experiment.hashAttribute || "id"); if (experiment.fallbackAttribute) { attributes.add(experiment.fallbackAttribute); } }); return Array.from(attributes); } async function getAllStickyBucketAssignmentDocs(ctx, stickyBucketService, data) { const attributes = getStickyBucketAttributes(ctx, data); return stickyBucketService.getAllAssignments(attributes); } function getStickyBucketAttributes(ctx, data) { const attributes = {}; const stickyBucketIdentifierAttributes = deriveStickyBucketIdentifierAttributes(ctx, data); stickyBucketIdentifierAttributes.forEach(attr => { const { hashValue } = getHashAttribute(ctx, attr); attributes[attr] = (0, _util.toString)(hashValue); }); return attributes; } async function decryptPayload(data, decryptionKey, subtle) { data = { ...data }; if (data.encryptedFeatures) { try { data.features = JSON.parse(await (0, _util.decrypt)(data.encryptedFeatures, decryptionKey, subtle)); } catch (e) { console.error(e); } delete data.encryptedFeatures; } if (data.encryptedExperiments) { try { data.experiments = JSON.parse(await (0, _util.decrypt)(data.encryptedExperiments, decryptionKey, subtle)); } catch (e) { console.error(e); } delete data.encryptedExperiments; } if (data.encryptedSavedGroups) { try { data.savedGroups = JSON.parse(await (0, _util.decrypt)(data.encryptedSavedGroups, decryptionKey, subtle)); } catch (e) { console.error(e); } delete data.encryptedSavedGroups; } return data; } function getApiHosts(options) { const defaultHost = options.apiHost || "https://cdn.growthbook.io"; return { apiHost: defaultHost.replace(/\/*$/, ""), streamingHost: (options.streamingHost || defaultHost).replace(/\/*$/, ""), apiRequestHeaders: options.apiHostRequestHeaders, streamingHostRequestHeaders: options.streamingHostRequestHeaders }; } function getExperimentDedupeKey(experiment, result) { return result.hashAttribute + result.hashValue + experiment.key + result.variationId; } //# sourceMappingURL=core.js.map /***/ }), /***/ 86707: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.clearCache = clearCache; exports.configureCache = configureCache; exports.helpers = void 0; exports.onHidden = onHidden; exports.onVisible = onVisible; exports.refreshFeatures = refreshFeatures; exports.setPolyfills = setPolyfills; exports.startStreaming = startStreaming; exports.unsubscribe = unsubscribe; var _util = __webpack_require__(5106); // Config settings const cacheSettings = { // Consider a fetch stale after 1 minute staleTTL: 1000 * 60, // Max time to keep a fetch in cache (4 hours default) maxAge: 1000 * 60 * 60 * 4, cacheKey: "gbFeaturesCache", backgroundSync: true, maxEntries: 10, disableIdleStreams: false, idleStreamInterval: 20000, disableCache: false }; const polyfills = (0, _util.getPolyfills)(); const helpers = { fetchFeaturesCall: _ref => { let { host, clientKey, headers } = _ref; return polyfills.fetch(`${host}/api/features/${clientKey}`, { headers }); }, fetchRemoteEvalCall: _ref2 => { let { host, clientKey, payload, headers } = _ref2; const options = { method: "POST", headers: { "Content-Type": "application/json", ...headers }, body: JSON.stringify(payload) }; return polyfills.fetch(`${host}/api/eval/${clientKey}`, options); }, eventSourceCall: _ref3 => { let { host, clientKey, headers } = _ref3; if (headers) { return new polyfills.EventSource(`${host}/sub/${clientKey}`, { headers }); } return new polyfills.EventSource(`${host}/sub/${clientKey}`); }, startIdleListener: () => { let idleTimeout; const isBrowser = true && typeof document !== "undefined"; if (!isBrowser) return; const onVisibilityChange = () => { if (document.visibilityState === "visible") { window.clearTimeout(idleTimeout); onVisible(); } else if (document.visibilityState === "hidden") { idleTimeout = window.setTimeout(onHidden, cacheSettings.idleStreamInterval); } }; document.addEventListener("visibilitychange", onVisibilityChange); return () => document.removeEventListener("visibilitychange", onVisibilityChange); }, stopIdleListener: () => { // No-op, replaced by startIdleListener } }; exports.helpers = helpers; try { if (globalThis.localStorage) { polyfills.localStorage = globalThis.localStorage; } } catch (e) { // Ignore localStorage errors } // Global state const subscribedInstances = new Map(); let cacheInitialized = false; const cache = new Map(); const activeFetches = new Map(); const streams = new Map(); const supportsSSE = new Set(); // Public functions function setPolyfills(overrides) { Object.assign(polyfills, overrides); } function configureCache(overrides) { Object.assign(cacheSettings, overrides); if (!cacheSettings.backgroundSync) { clearAutoRefresh(); } } async function clearCache() { cache.clear(); activeFetches.clear(); clearAutoRefresh(); cacheInitialized = false; await updatePersistentCache(); } // Get or fetch features and refresh the SDK instance async function refreshFeatures(_ref4) { let { instance, timeout, skipCache, allowStale, backgroundSync } = _ref4; if (!backgroundSync) { cacheSettings.backgroundSync = false; } return fetchFeaturesWithCache({ instance, allowStale, timeout, skipCache }); } // Subscribe a GrowthBook instance to feature changes function subscribe(instance) { const key = getKey(instance); const subs = subscribedInstances.get(key) || new Set(); subs.add(instance); subscribedInstances.set(key, subs); } function unsubscribe(instance) { subscribedInstances.forEach(s => s.delete(instance)); } function onHidden() { streams.forEach(channel => { if (!channel) return; channel.state = "idle"; disableChannel(channel); }); } function onVisible() { streams.forEach(channel => { if (!channel) return; if (channel.state !== "idle") return; enableChannel(channel); }); } // Private functions async function updatePersistentCache() { try { if (!polyfills.localStorage) return; await polyfills.localStorage.setItem(cacheSettings.cacheKey, JSON.stringify(Array.from(cache.entries()))); } catch (e) { // Ignore localStorage errors } } // SWR wrapper for fetching features. May indirectly or directly start SSE streaming. async function fetchFeaturesWithCache(_ref5) { let { instance, allowStale, timeout, skipCache } = _ref5; const key = getKey(instance); const cacheKey = getCacheKey(instance); const now = new Date(); const minStaleAt = new Date(now.getTime() - cacheSettings.maxAge + cacheSettings.staleTTL); await initializeCache(); const existing = !cacheSettings.disableCache && !skipCache ? cache.get(cacheKey) : undefined; if (existing && (allowStale || existing.staleAt > now) && existing.staleAt > minStaleAt) { // Restore from cache whether SSE is supported if (existing.sse) supportsSSE.add(key); // Reload features in the background if stale if (existing.staleAt < now) { fetchFeatures(instance); } // Otherwise, if we don't need to refresh now, start a background sync else { startAutoRefresh(instance); } return { data: existing.data, success: true, source: "cache" }; } else { const res = await (0, _util.promiseTimeout)(fetchFeatures(instance), timeout); return res || { data: null, success: false, source: "timeout", error: new Error("Timeout") }; } } function getKey(instance) { const [apiHost, clientKey] = instance.getApiInfo(); return `${apiHost}||${clientKey}`; } function getCacheKey(instance) { const baseKey = getKey(instance); if (!("isRemoteEval" in instance) || !instance.isRemoteEval()) return baseKey; const attributes = instance.getAttributes(); const cacheKeyAttributes = instance.getCacheKeyAttributes() || Object.keys(instance.getAttributes()); const ca = {}; cacheKeyAttributes.forEach(key => { ca[key] = attributes[key]; }); const fv = instance.getForcedVariations(); const url = instance.getUrl(); return `${baseKey}||${JSON.stringify({ ca, fv, url })}`; } // Populate cache from localStorage (if available) async function initializeCache() { if (cacheInitialized) return; cacheInitialized = true; try { if (polyfills.localStorage) { const value = await polyfills.localStorage.getItem(cacheSettings.cacheKey); if (!cacheSettings.disableCache && value) { const parsed = JSON.parse(value); if (parsed && Array.isArray(parsed)) { parsed.forEach(_ref6 => { let [key, data] = _ref6; cache.set(key, { ...data, staleAt: new Date(data.staleAt) }); }); } cleanupCache(); } } } catch (e) { // Ignore localStorage errors } if (!cacheSettings.disableIdleStreams) { const cleanupFn = helpers.startIdleListener(); if (cleanupFn) { helpers.stopIdleListener = cleanupFn; } } } // Enforce the maxEntries limit function cleanupCache() { const entriesWithTimestamps = Array.from(cache.entries()).map(_ref7 => { let [key, value] = _ref7; return { key, staleAt: value.staleAt.getTime() }; }).sort((a, b) => a.staleAt - b.staleAt); const entriesToRemoveCount = Math.min(Math.max(0, cache.size - cacheSettings.maxEntries), cache.size); for (let i = 0; i < entriesToRemoveCount; i++) { cache.delete(entriesWithTimestamps[i].key); } } // Called whenever new features are fetched from the API function onNewFeatureData(key, cacheKey, data) { // If contents haven't changed, ignore the update, extend the stale TTL const version = data.dateUpdated || ""; const staleAt = new Date(Date.now() + cacheSettings.staleTTL); const existing = !cacheSettings.disableCache ? cache.get(cacheKey) : undefined; if (existing && version && existing.version === version) { existing.staleAt = staleAt; updatePersistentCache(); return; } if (!cacheSettings.disableCache) { // Update in-memory cache cache.set(cacheKey, { data, version, staleAt, sse: supportsSSE.has(key) }); cleanupCache(); } // Update local storage (don't await this, just update asynchronously) updatePersistentCache(); // Update features for all subscribed GrowthBook instances const instances = subscribedInstances.get(key); instances && instances.forEach(instance => refreshInstance(instance, data)); } async function refreshInstance(instance, data) { await instance.setPayload(data || instance.getPayload()); } // Fetch the features payload from helper function or from in-mem injected payload async function fetchFeatures(instance) { const { apiHost, apiRequestHeaders } = instance.getApiHosts(); const clientKey = instance.getClientKey(); const remoteEval = "isRemoteEval" in instance && instance.isRemoteEval(); const key = getKey(instance); const cacheKey = getCacheKey(instance); let promise = activeFetches.get(cacheKey); if (!promise) { const fetcher = remoteEval ? helpers.fetchRemoteEvalCall({ host: apiHost, clientKey, payload: { attributes: instance.getAttributes(), forcedVariations: instance.getForcedVariations(), forcedFeatures: Array.from(instance.getForcedFeatures().entries()), url: instance.getUrl() }, headers: apiRequestHeaders }) : helpers.fetchFeaturesCall({ host: apiHost, clientKey, headers: apiRequestHeaders }); // TODO: auto-retry if status code indicates a temporary error promise = fetcher.then(res => { if (!res.ok) { throw new Error(`HTTP error: ${res.status}`); } if (res.headers.get("x-sse-support") === "enabled") { supportsSSE.add(key); } return res.json(); }).then(data => { onNewFeatureData(key, cacheKey, data); startAutoRefresh(instance); activeFetches.delete(cacheKey); return { data, success: true, source: "network" }; }).catch(e => { false && 0; activeFetches.delete(cacheKey); return { data: null, source: "error", success: false, error: e }; }); activeFetches.set(cacheKey, promise); } return promise; } // Start SSE streaming, listens to feature payload changes and triggers a refresh or re-fetch function startAutoRefresh(instance) { let forceSSE = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; const key = getKey(instance); const cacheKey = getCacheKey(instance); const { streamingHost, streamingHostRequestHeaders } = instance.getApiHosts(); const clientKey = instance.getClientKey(); if (forceSSE) { supportsSSE.add(key); } if (cacheSettings.backgroundSync && supportsSSE.has(key) && polyfills.EventSource) { if (streams.has(key)) return; const channel = { src: null, host: streamingHost, clientKey, headers: streamingHostRequestHeaders, cb: event => { try { if (event.type === "features-updated") { const instances = subscribedInstances.get(key); instances && instances.forEach(instance => { fetchFeatures(instance); }); } else if (event.type === "features") { const json = JSON.parse(event.data); onNewFeatureData(key, cacheKey, json); } // Reset error count on success channel.errors = 0; } catch (e) { false && 0; onSSEError(channel); } }, errors: 0, state: "active" }; streams.set(key, channel); enableChannel(channel); } } function onSSEError(channel) { if (channel.state === "idle") return; channel.errors++; if (channel.errors > 3 || channel.src && channel.src.readyState === 2) { // exponential backoff after 4 errors, with jitter const delay = Math.pow(3, channel.errors - 3) * (1000 + Math.random() * 1000); disableChannel(channel); setTimeout(() => { if (["idle", "active"].includes(channel.state)) return; enableChannel(channel); }, Math.min(delay, 300000)); // 5 minutes max } } function disableChannel(channel) { if (!channel.src) return; channel.src.onopen = null; channel.src.onerror = null; channel.src.close(); channel.src = null; if (channel.state === "active") { channel.state = "disabled"; } } function enableChannel(channel) { channel.src = helpers.eventSourceCall({ host: channel.host, clientKey: channel.clientKey, headers: channel.headers }); channel.state = "active"; channel.src.addEventListener("features", channel.cb); channel.src.addEventListener("features-updated", channel.cb); channel.src.onerror = () => onSSEError(channel); channel.src.onopen = () => { channel.errors = 0; }; } function destroyChannel(channel, key) { disableChannel(channel); streams.delete(key); } function clearAutoRefresh() { // Clear list of which keys are auto-updated supportsSSE.clear(); // Stop listening for any SSE events streams.forEach(destroyChannel); // Remove all references to GrowthBook instances subscribedInstances.clear(); // Run the idle stream cleanup function helpers.stopIdleListener(); } function startStreaming(instance, options) { if (options.streaming) { if (!instance.getClientKey()) { throw new Error("Must specify clientKey to enable streaming"); } if (options.payload) { startAutoRefresh(instance, true); } subscribe(instance); } } //# sourceMappingURL=feature-repository.js.map /***/ }), /***/ 200: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "BrowserCookieStickyBucketService", ({ enumerable: true, get: function () { return _stickyBucketService.BrowserCookieStickyBucketService; } })); Object.defineProperty(exports, "EVENT_EXPERIMENT_VIEWED", ({ enumerable: true, get: function () { return _core.EVENT_EXPERIMENT_VIEWED; } })); Object.defineProperty(exports, "EVENT_FEATURE_EVALUATED", ({ enumerable: true, get: function () { return _core.EVENT_FEATURE_EVALUATED; } })); Object.defineProperty(exports, "ExpressCookieStickyBucketService", ({ enumerable: true, get: function () { return _stickyBucketService.ExpressCookieStickyBucketService; } })); Object.defineProperty(exports, "GrowthBook", ({ enumerable: true, get: function () { return _GrowthBook.GrowthBook; } })); Object.defineProperty(exports, "GrowthBookClient", ({ enumerable: true, get: function () { return _GrowthBookClient.GrowthBookClient; } })); Object.defineProperty(exports, "GrowthBookMultiUser", ({ enumerable: true, get: function () { return _GrowthBookClient.GrowthBookClient; } })); Object.defineProperty(exports, "LocalStorageStickyBucketService", ({ enumerable: true, get: function () { return _stickyBucketService.LocalStorageStickyBucketService; } })); Object.defineProperty(exports, "RedisStickyBucketService", ({ enumerable: true, get: function () { return _stickyBucketService.RedisStickyBucketService; } })); Object.defineProperty(exports, "StickyBucketService", ({ enumerable: true, get: function () { return _stickyBucketService.StickyBucketService; } })); Object.defineProperty(exports, "StickyBucketServiceSync", ({ enumerable: true, get: function () { return _stickyBucketService.StickyBucketServiceSync; } })); Object.defineProperty(exports, "UserScopedGrowthBook", ({ enumerable: true, get: function () { return _GrowthBookClient.UserScopedGrowthBook; } })); Object.defineProperty(exports, "clearCache", ({ enumerable: true, get: function () { return _featureRepository.clearCache; } })); Object.defineProperty(exports, "configureCache", ({ enumerable: true, get: function () { return _featureRepository.configureCache; } })); Object.defineProperty(exports, "evalCondition", ({ enumerable: true, get: function () { return _mongrule.evalCondition; } })); Object.defineProperty(exports, "getAutoExperimentChangeType", ({ enumerable: true, get: function () { return _util.getAutoExperimentChangeType; } })); Object.defineProperty(exports, "getPolyfills", ({ enumerable: true, get: function () { return _util.getPolyfills; } })); Object.defineProperty(exports, "helpers", ({ enumerable: true, get: function () { return _featureRepository.helpers; } })); Object.defineProperty(exports, "isURLTargeted", ({ enumerable: true, get: function () { return _util.isURLTargeted; } })); Object.defineProperty(exports, "onHidden", ({ enumerable: true, get: function () { return _featureRepository.onHidden; } })); Object.defineProperty(exports, "onVisible", ({ enumerable: true, get: function () { return _featureRepository.onVisible; } })); Object.defineProperty(exports, "paddedVersionString", ({ enumerable: true, get: function () { return _util.paddedVersionString; } })); Object.defineProperty(exports, "prefetchPayload", ({ enumerable: true, get: function () { return _GrowthBook.prefetchPayload; } })); Object.defineProperty(exports, "setPolyfills", ({ enumerable: true, get: function () { return _featureRepository.setPolyfills; } })); var _featureRepository = __webpack_require__(86707); var _GrowthBook = __webpack_require__(96328); var _GrowthBookClient = __webpack_require__(84555); var _stickyBucketService = __webpack_require__(74350); var _mongrule = __webpack_require__(12427); var _util = __webpack_require__(5106); var _core = __webpack_require__(13569); //# sourceMappingURL=index.js.map /***/ }), /***/ 12427: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.evalCondition = evalCondition; var _util = __webpack_require__(5106); /* eslint-disable @typescript-eslint/no-explicit-any */ const _regexCache = {}; // The top-level condition evaluation function function evalCondition(obj, condition, // Must be included for `condition` to correctly evaluate group Operators savedGroups) { savedGroups = savedGroups || {}; // Condition is an object, keys are either specific operators or object paths // values are either arguments for operators or conditions for paths for (const [k, v] of Object.entries(condition)) { switch (k) { case "$or": if (!evalOr(obj, v, savedGroups)) return false; break; case "$nor": if (evalOr(obj, v, savedGroups)) return false; break; case "$and": if (!evalAnd(obj, v, savedGroups)) return false; break; case "$not": if (evalCondition(obj, v, savedGroups)) return false; break; default: if (!evalConditionValue(v, getPath(obj, k), savedGroups)) return false; } } return true; } // Return value at dot-separated path of an object function getPath(obj, path) { const parts = path.split("."); let current = obj; for (let i = 0; i < parts.length; i++) { if (current && typeof current === "object" && parts[i] in current) { current = current[parts[i]]; } else { return null; } } return current; } // Transform a regex string into a real RegExp object function getRegex(regex) { if (!_regexCache[regex]) { _regexCache[regex] = new RegExp(regex.replace(/([^\\])\//g, "$1\\/")); } return _regexCache[regex]; } // Evaluate a single value against a condition function evalConditionValue(condition, value, savedGroups) { // Simple equality comparisons if (typeof condition === "string") { return value + "" === condition; } if (typeof condition === "number") { return value * 1 === condition; } if (typeof condition === "boolean") { return value !== null && !!value === condition; } if (condition === null) { return value === null; } if (Array.isArray(condition) || !isOperatorObject(condition)) { return JSON.stringify(value) === JSON.stringify(condition); } // This is a special operator condition and we should evaluate each one separately for (const op in condition) { if (!evalOperatorCondition(op, value, condition[op], savedGroups)) { return false; } } return true; } // If the object has only keys that start with '$' function isOperatorObject(obj) { const keys = Object.keys(obj); return keys.length > 0 && keys.filter(k => k[0] === "$").length === keys.length; } // Return the data type of a value function getType(v) { if (v === null) return "null"; if (Array.isArray(v)) return "array"; const t = typeof v; if (["string", "number", "boolean", "object", "undefined"].includes(t)) { return t; } return "unknown"; } // At least one element of actual must match the expected condition/value function elemMatch(actual, expected, savedGroups) { if (!Array.isArray(actual)) return false; const check = isOperatorObject(expected) ? v => evalConditionValue(expected, v, savedGroups) : v => evalCondition(v, expected, savedGroups); for (let i = 0; i < actual.length; i++) { if (actual[i] && check(actual[i])) { return true; } } return false; } function isIn(actual, expected) { // Do an intersection if attribute is an array if (Array.isArray(actual)) { return actual.some(el => expected.includes(el)); } return expected.includes(actual); } // Evaluate a single operator condition function evalOperatorCondition(operator, actual, expected, savedGroups) { switch (operator) { case "$veq": return (0, _util.paddedVersionString)(actual) === (0, _util.paddedVersionString)(expected); case "$vne": return (0, _util.paddedVersionString)(actual) !== (0, _util.paddedVersionString)(expected); case "$vgt": return (0, _util.paddedVersionString)(actual) > (0, _util.paddedVersionString)(expected); case "$vgte": return (0, _util.paddedVersionString)(actual) >= (0, _util.paddedVersionString)(expected); case "$vlt": return (0, _util.paddedVersionString)(actual) < (0, _util.paddedVersionString)(expected); case "$vlte": return (0, _util.paddedVersionString)(actual) <= (0, _util.paddedVersionString)(expected); case "$eq": return actual === expected; case "$ne": return actual !== expected; case "$lt": return actual < expected; case "$lte": return actual <= expected; case "$gt": return actual > expected; case "$gte": return actual >= expected; case "$exists": // Using `!=` and `==` instead of strict checks so it also matches for undefined return expected ? actual != null : actual == null; case "$in": if (!Array.isArray(expected)) return false; return isIn(actual, expected); case "$inGroup": return isIn(actual, savedGroups[expected] || []); case "$notInGroup": return !isIn(actual, savedGroups[expected] || []); case "$nin": if (!Array.isArray(expected)) return false; return !isIn(actual, expected); case "$not": return !evalConditionValue(expected, actual, savedGroups); case "$size": if (!Array.isArray(actual)) return false; return evalConditionValue(expected, actual.length, savedGroups); case "$elemMatch": return elemMatch(actual, expected, savedGroups); case "$all": if (!Array.isArray(actual)) return false; for (let i = 0; i < expected.length; i++) { let passed = false; for (let j = 0; j < actual.length; j++) { if (evalConditionValue(expected[i], actual[j], savedGroups)) { passed = true; break; } } if (!passed) return false; } return true; case "$regex": try { return getRegex(expected).test(actual); } catch (e) { return false; } case "$type": return getType(actual) === expected; default: console.error("Unknown operator: " + operator); return false; } } // Recursive $or rule function evalOr(obj, conditions, savedGroups) { if (!conditions.length) return true; for (let i = 0; i < conditions.length; i++) { if (evalCondition(obj, conditions[i], savedGroups)) { return true; } } return false; } // Recursive $and rule function evalAnd(obj, conditions, savedGroups) { for (let i = 0; i < conditions.length; i++) { if (!evalCondition(obj, conditions[i], savedGroups)) { return false; } } return true; } //# sourceMappingURL=mongrule.js.map /***/ }), /***/ 74350: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.StickyBucketServiceSync = exports.StickyBucketService = exports.RedisStickyBucketService = exports.LocalStorageStickyBucketService = exports.ExpressCookieStickyBucketService = exports.BrowserCookieStickyBucketService = void 0; var _util = __webpack_require__(5106); var _core = __webpack_require__(13569); /** * Responsible for reading and writing documents which describe sticky bucket assignments. */ class StickyBucketService { constructor(opts) { opts = opts || {}; this.prefix = opts.prefix || ""; } /** * The SDK calls getAllAssignments to populate sticky buckets. This in turn will * typically loop through individual getAssignments calls. However, some StickyBucketService * instances (i.e. Redis) will instead perform a multi-query inside getAllAssignments instead. */ async getAllAssignments(attributes) { const docs = {}; (await Promise.all(Object.entries(attributes).map(_ref => { let [attributeName, attributeValue] = _ref; return this.getAssignments(attributeName, attributeValue); }))).forEach(doc => { if (doc) { const key = (0, _core.getStickyBucketAttributeKey)(doc.attributeName, doc.attributeValue); docs[key] = doc; } }); return docs; } getKey(attributeName, attributeValue) { return `${this.prefix}${attributeName}||${attributeValue}`; } } exports.StickyBucketService = StickyBucketService; class StickyBucketServiceSync extends StickyBucketService { async getAssignments(attributeName, attributeValue) { return this.getAssignmentsSync(attributeName, attributeValue); } async saveAssignments(doc) { this.saveAssignmentsSync(doc); } getAllAssignmentsSync(attributes) { const docs = {}; Object.entries(attributes).map(_ref2 => { let [attributeName, attributeValue] = _ref2; return this.getAssignmentsSync(attributeName, attributeValue); }).forEach(doc => { if (doc) { const key = (0, _core.getStickyBucketAttributeKey)(doc.attributeName, doc.attributeValue); docs[key] = doc; } }); return docs; } } exports.StickyBucketServiceSync = StickyBucketServiceSync; class LocalStorageStickyBucketService extends StickyBucketService { constructor(opts) { opts = opts || {}; super(); this.prefix = opts.prefix || "gbStickyBuckets__"; try { this.localStorage = opts.localStorage || globalThis.localStorage; } catch (e) { // Ignore localStorage errors } } async getAssignments(attributeName, attributeValue) { const key = this.getKey(attributeName, attributeValue); let doc = null; if (!this.localStorage) return doc; try { const raw = (await this.localStorage.getItem(key)) || "{}"; const data = JSON.parse(raw); if (data.attributeName && data.attributeValue && data.assignments) { doc = data; } } catch (e) { // Ignore localStorage errors } return doc; } async saveAssignments(doc) { const key = this.getKey(doc.attributeName, doc.attributeValue); if (!this.localStorage) return; try { await this.localStorage.setItem(key, JSON.stringify(doc)); } catch (e) { // Ignore localStorage errors } } } exports.LocalStorageStickyBucketService = LocalStorageStickyBucketService; class ExpressCookieStickyBucketService extends StickyBucketServiceSync { /** * Intended to be used with cookieParser() middleware from npm: 'cookie-parser'. * Assumes: * - reading a cookie is automatically decoded via decodeURIComponent() or similar * - writing a cookie name & value must be manually encoded via encodeURIComponent() or similar * - all cookie bodies are JSON encoded strings and are manually encoded/decoded */ constructor(_ref3) { let { prefix = "gbStickyBuckets__", req, res, cookieAttributes = { maxAge: 180 * 24 * 3600 * 1000 } // 180 days } = _ref3; super(); this.prefix = prefix; this.req = req; this.res = res; this.cookieAttributes = cookieAttributes; } getAssignmentsSync(attributeName, attributeValue) { const key = this.getKey(attributeName, attributeValue); let doc = null; if (!this.req) return doc; try { const raw = this.req.cookies[key] || "{}"; const data = JSON.parse(raw); if (data.attributeName && data.attributeValue && data.assignments) { doc = data; } } catch (e) { // Ignore cookie errors } return doc; } saveAssignmentsSync(doc) { const key = this.getKey(doc.attributeName, doc.attributeValue); if (!this.res) return; const str = JSON.stringify(doc); this.res.cookie(encodeURIComponent(key), encodeURIComponent(str), this.cookieAttributes); } } exports.ExpressCookieStickyBucketService = ExpressCookieStickyBucketService; class BrowserCookieStickyBucketService extends StickyBucketServiceSync { /** * Intended to be used with npm: 'js-cookie'. * Assumes: * - reading a cookie is automatically decoded via decodeURIComponent() or similar * - writing a cookie name & value is automatically encoded via encodeURIComponent() or similar * - all cookie bodies are JSON encoded strings and are manually encoded/decoded */ constructor(_ref4) { let { prefix = "gbStickyBuckets__", jsCookie, cookieAttributes = { expires: 180 } // 180 days } = _ref4; super(); this.prefix = prefix; this.jsCookie = jsCookie; this.cookieAttributes = cookieAttributes; } getAssignmentsSync(attributeName, attributeValue) { const key = this.getKey(attributeName, attributeValue); let doc = null; if (!this.jsCookie) return doc; try { const raw = this.jsCookie.get(key); const data = JSON.parse(raw || "{}"); if (data.attributeName && data.attributeValue && data.assignments) { doc = data; } } catch (e) { // Ignore cookie errors } return doc; } async saveAssignmentsSync(doc) { const key = this.getKey(doc.attributeName, doc.attributeValue); if (!this.jsCookie) return; const str = JSON.stringify(doc); this.jsCookie.set(key, str, this.cookieAttributes); } } exports.BrowserCookieStickyBucketService = BrowserCookieStickyBucketService; class RedisStickyBucketService extends StickyBucketService { /** Intended to be used with npm: 'ioredis'. **/ constructor(_ref5) { let { redis } = _ref5; super(); this.redis = redis; } async getAllAssignments(attributes) { const docs = {}; const keys = Object.entries(attributes).map(_ref6 => { let [attributeName, attributeValue] = _ref6; return (0, _core.getStickyBucketAttributeKey)(attributeName, attributeValue); }); if (!this.redis) return docs; await this.redis.mget(...keys).then(values => { values.forEach(raw => { try { const data = JSON.parse(raw || "{}"); if (data.attributeName && "attributeValue" in data && data.assignments) { const key = (0, _core.getStickyBucketAttributeKey)(data.attributeName, (0, _util.toString)(data.attributeValue)); docs[key] = data; } } catch (e) { // ignore redis doc parse errors } }); }); return docs; } async getAssignments(_attributeName, _attributeValue) { // not implemented return null; } async saveAssignments(doc) { const key = this.getKey(doc.attributeName, doc.attributeValue); if (!this.redis) return; await this.redis.set(key, JSON.stringify(doc)); } } exports.RedisStickyBucketService = RedisStickyBucketService; //# sourceMappingURL=sticky-bucket-service.js.map /***/ }), /***/ 5106: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.chooseVariation = chooseVariation; exports.decrypt = decrypt; exports.getAutoExperimentChangeType = getAutoExperimentChangeType; exports.getBucketRanges = getBucketRanges; exports.getEqualWeights = getEqualWeights; exports.getPolyfills = getPolyfills; exports.getQueryStringOverride = getQueryStringOverride; exports.getUrlRegExp = getUrlRegExp; exports.hash = hash; exports.inNamespace = inNamespace; exports.inRange = inRange; exports.isIncluded = isIncluded; exports.isURLTargeted = isURLTargeted; exports.loadSDKVersion = loadSDKVersion; exports.mergeQueryStrings = mergeQueryStrings; exports.paddedVersionString = paddedVersionString; exports.promiseTimeout = promiseTimeout; exports.toString = toString; const polyfills = { fetch: globalThis.fetch ? globalThis.fetch.bind(globalThis) : undefined, SubtleCrypto: globalThis.crypto ? globalThis.crypto.subtle : undefined, EventSource: globalThis.EventSource }; function getPolyfills() { return polyfills; } function hashFnv32a(str) { let hval = 0x811c9dc5; const l = str.length; for (let i = 0; i < l; i++) { hval ^= str.charCodeAt(i); hval += (hval << 1) + (hval << 4) + (hval << 7) + (hval << 8) + (hval << 24); } return hval >>> 0; } function hash(seed, value, version) { // New unbiased hashing algorithm if (version === 2) { return hashFnv32a(hashFnv32a(seed + value) + "") % 10000 / 10000; } // Original biased hashing algorithm (keep for backwards compatibility) if (version === 1) { return hashFnv32a(value + seed) % 1000 / 1000; } // Unknown hash version return null; } function getEqualWeights(n) { if (n <= 0) return []; return new Array(n).fill(1 / n); } function inRange(n, range) { return n >= range[0] && n < range[1]; } function inNamespace(hashValue, namespace) { const n = hash("__" + namespace[0], hashValue, 1); if (n === null) return false; return n >= namespace[1] && n < namespace[2]; } function chooseVariation(n, ranges) { for (let i = 0; i < ranges.length; i++) { if (inRange(n, ranges[i])) { return i; } } return -1; } function getUrlRegExp(regexString) { try { const escaped = regexString.replace(/([^\\])\//g, "$1\\/"); return new RegExp(escaped); } catch (e) { console.error(e); return undefined; } } function isURLTargeted(url, targets) { if (!targets.length) return false; let hasIncludeRules = false; let isIncluded = false; for (let i = 0; i < targets.length; i++) { const match = _evalURLTarget(url, targets[i].type, targets[i].pattern); if (targets[i].include === false) { if (match) return false; } else { hasIncludeRules = true; if (match) isIncluded = true; } } return isIncluded || !hasIncludeRules; } function _evalSimpleUrlPart(actual, pattern, isPath) { try { // Escape special regex characters and change wildcard `_____` to `.*` let escaped = pattern.replace(/[*.+?^${}()|[\]\\]/g, "\\$&").replace(/_____/g, ".*"); if (isPath) { // When matching pathname, make leading/trailing slashes optional escaped = "\\/?" + escaped.replace(/(^\/|\/$)/g, "") + "\\/?"; } const regex = new RegExp("^" + escaped + "$", "i"); return regex.test(actual); } catch (e) { return false; } } function _evalSimpleUrlTarget(actual, pattern) { try { // If a protocol is missing, but a host is specified, add `https://` to the front // Use "_____" as the wildcard since `*` is not a valid hostname in some browsers const expected = new URL(pattern.replace(/^([^:/?]*)\./i, "https://$1.").replace(/\*/g, "_____"), "https://_____"); // Compare each part of the URL separately const comps = [[actual.host, expected.host, false], [actual.pathname, expected.pathname, true]]; // We only want to compare hashes if it's explicitly being targeted if (expected.hash) { comps.push([actual.hash, expected.hash, false]); } expected.searchParams.forEach((v, k) => { comps.push([actual.searchParams.get(k) || "", v, false]); }); // If any comparisons fail, the whole thing fails return !comps.some(data => !_evalSimpleUrlPart(data[0], data[1], data[2])); } catch (e) { return false; } } function _evalURLTarget(url, type, pattern) { try { const parsed = new URL(url, "https://_"); if (type === "regex") { const regex = getUrlRegExp(pattern); if (!regex) return false; return regex.test(parsed.href) || regex.test(parsed.href.substring(parsed.origin.length)); } else if (type === "simple") { return _evalSimpleUrlTarget(parsed, pattern); } return false; } catch (e) { return false; } } function getBucketRanges(numVariations, coverage, weights) { coverage = coverage === undefined ? 1 : coverage; // Make sure coverage is within bounds if (coverage < 0) { if (false) {} coverage = 0; } else if (coverage > 1) { if (false) {} coverage = 1; } // Default to equal weights if missing or invalid const equal = getEqualWeights(numVariations); weights = weights || equal; if (weights.length !== numVariations) { if (false) {} weights = equal; } // If weights don't add up to 1 (or close to it), default to equal weights const totalWeight = weights.reduce((w, sum) => sum + w, 0); if (totalWeight < 0.99 || totalWeight > 1.01) { if (false) {} weights = equal; } // Covert weights to ranges let cumulative = 0; return weights.map(w => { const start = cumulative; cumulative += w; return [start, start + coverage * w]; }); } function getQueryStringOverride(id, url, numVariations) { if (!url) { return null; } const search = url.split("?")[1]; if (!search) { return null; } const match = search.replace(/#.*/, "") // Get rid of anchor .split("&") // Split into key/value pairs .map(kv => kv.split("=", 2)).filter(_ref => { let [k] = _ref; return k === id; }) // Look for key that matches the experiment id .map(_ref2 => { let [, v] = _ref2; return parseInt(v); }); // Parse the value into an integer if (match.length > 0 && match[0] >= 0 && match[0] < numVariations) return match[0]; return null; } function isIncluded(include) { try { return include(); } catch (e) { console.error(e); return false; } } const base64ToBuf = b => Uint8Array.from(atob(b), c => c.charCodeAt(0)); async function decrypt(encryptedString, decryptionKey, subtle) { decryptionKey = decryptionKey || ""; subtle = subtle || globalThis.crypto && globalThis.crypto.subtle || polyfills.SubtleCrypto; if (!subtle) { throw new Error("No SubtleCrypto implementation found"); } try { const key = await subtle.importKey("raw", base64ToBuf(decryptionKey), { name: "AES-CBC", length: 128 }, true, ["encrypt", "decrypt"]); const [iv, cipherText] = encryptedString.split("."); const plainTextBuffer = await subtle.decrypt({ name: "AES-CBC", iv: base64ToBuf(iv) }, key, base64ToBuf(cipherText)); return new TextDecoder().decode(plainTextBuffer); } catch (e) { throw new Error("Failed to decrypt"); } } // eslint-disable-next-line @typescript-eslint/no-explicit-any function toString(input) { if (typeof input === "string") return input; return JSON.stringify(input); } // eslint-disable-next-line @typescript-eslint/no-explicit-any function paddedVersionString(input) { if (typeof input === "number") { input = input + ""; } if (!input || typeof input !== "string") { input = "0"; } // Remove build info and leading `v` if any // Split version into parts (both core version numbers and pre-release tags) // "v1.2.3-rc.1+build123" -> ["1","2","3","rc","1"] const parts = input.replace(/(^v|\+.*$)/g, "").split(/[-.]/); // If it's SemVer without a pre-release, add `~` to the end // ["1","0","0"] -> ["1","0","0","~"] // "~" is the largest ASCII character, so this will make "1.0.0" greater than "1.0.0-beta" for example if (parts.length === 3) { parts.push("~"); } // Left pad each numeric part with spaces so string comparisons will work ("9">"10", but " 9"<"10") // Then, join back together into a single string return parts.map(v => v.match(/^[0-9]+$/) ? v.padStart(5, " ") : v).join("-"); } function loadSDKVersion() { let version; try { // @ts-expect-error right-hand value to be replaced by build with string literal version = "1.6.1"; } catch (e) { version = ""; } return version; } function mergeQueryStrings(oldUrl, newUrl) { let currUrl; let redirectUrl; try { currUrl = new URL(oldUrl); redirectUrl = new URL(newUrl); } catch (e) { console.error(`Unable to merge query strings: ${e}`); return newUrl; } currUrl.searchParams.forEach((value, key) => { // skip if search param already exists in redirectUrl if (redirectUrl.searchParams.has(key)) { return; } redirectUrl.searchParams.set(key, value); }); return redirectUrl.toString(); } function isObj(x) { return typeof x === "object" && x !== null; } function getAutoExperimentChangeType(exp) { if (exp.urlPatterns && exp.variations.some(variation => isObj(variation) && "urlRedirect" in variation)) { return "redirect"; } else if (exp.variations.some(variation => isObj(variation) && (variation.domMutations || "js" in variation || "css" in variation))) { return "visual"; } return "unknown"; } // Guarantee the promise always resolves within {timeout} ms // Resolved value will be `null` when there's an error or it takes too long // Note: The promise will continue running in the background, even if the timeout is hit async function promiseTimeout(promise, timeout) { return new Promise(resolve => { let resolved = false; let timer; const finish = data => { if (resolved) return; resolved = true; timer && clearTimeout(timer); resolve(data || null); }; if (timeout) { timer = setTimeout(() => finish(), timeout); } promise.then(data => finish(data)).catch(() => finish()); }); } //# sourceMappingURL=util.js.map /***/ }), /***/ 18045: /***/ ((module) => { "use strict"; module.exports = asPromise; /** * Callback as used by {@link util.asPromise}. * @typedef asPromiseCallback * @type {function} * @param {Error|null} error Error, if any * @param {...*} params Additional arguments * @returns {undefined} */ /** * Returns a promise from a node-style callback function. * @memberof util * @param {asPromiseCallback} fn Function to call * @param {*} ctx Function context * @param {...*} params Function arguments * @returns {Promise<*>} Promisified function */ function asPromise(fn, ctx/*, varargs */) { var params = new Array(arguments.length - 1), offset = 0, index = 2, pending = true; while (index < arguments.length) params[offset++] = arguments[index++]; return new Promise(function executor(resolve, reject) { params[offset] = function callback(err/*, varargs */) { if (pending) { pending = false; if (err) reject(err); else { var params = new Array(arguments.length - 1), offset = 0; while (offset < params.length) params[offset++] = arguments[offset]; resolve.apply(null, params); } } }; try { fn.apply(ctx || null, params); } catch (err) { if (pending) { pending = false; reject(err); } } }); } /***/ }), /***/ 8839: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * A minimal base64 implementation for number arrays. * @memberof util * @namespace */ var base64 = exports; /** * Calculates the byte length of a base64 encoded string. * @param {string} string Base64 encoded string * @returns {number} Byte length */ base64.length = function length(string) { var p = string.length; if (!p) return 0; var n = 0; while (--p % 4 > 1 && string.charAt(p) === "=") ++n; return Math.ceil(string.length * 3) / 4 - n; }; // Base64 encoding table var b64 = new Array(64); // Base64 decoding table var s64 = new Array(123); // 65..90, 97..122, 48..57, 43, 47 for (var i = 0; i < 64;) s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; /** * Encodes a buffer to a base64 encoded string. * @param {Uint8Array} buffer Source buffer * @param {number} start Source start * @param {number} end Source end * @returns {string} Base64 encoded string */ base64.encode = function encode(buffer, start, end) { var parts = null, chunk = []; var i = 0, // output index j = 0, // goto index t; // temporary while (start < end) { var b = buffer[start++]; switch (j) { case 0: chunk[i++] = b64[b >> 2]; t = (b & 3) << 4; j = 1; break; case 1: chunk[i++] = b64[t | b >> 4]; t = (b & 15) << 2; j = 2; break; case 2: chunk[i++] = b64[t | b >> 6]; chunk[i++] = b64[b & 63]; j = 0; break; } if (i > 8191) { (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); i = 0; } } if (j) { chunk[i++] = b64[t]; chunk[i++] = 61; if (j === 1) chunk[i++] = 61; } if (parts) { if (i) parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); return parts.join(""); } return String.fromCharCode.apply(String, chunk.slice(0, i)); }; var invalidEncoding = "invalid encoding"; /** * Decodes a base64 encoded string to a buffer. * @param {string} string Source string * @param {Uint8Array} buffer Destination buffer * @param {number} offset Destination offset * @returns {number} Number of bytes written * @throws {Error} If encoding is invalid */ base64.decode = function decode(string, buffer, offset) { var start = offset; var j = 0, // goto index t; // temporary for (var i = 0; i < string.length;) { var c = string.charCodeAt(i++); if (c === 61 && j > 1) break; if ((c = s64[c]) === undefined) throw Error(invalidEncoding); switch (j) { case 0: t = c; j = 1; break; case 1: buffer[offset++] = t << 2 | (c & 48) >> 4; t = c; j = 2; break; case 2: buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; t = c; j = 3; break; case 3: buffer[offset++] = (t & 3) << 6 | c; j = 0; break; } } if (j === 1) throw Error(invalidEncoding); return offset - start; }; /** * Tests if the specified string appears to be base64 encoded. * @param {string} string String to test * @returns {boolean} `true` if probably base64 encoded, otherwise false */ base64.test = function test(string) { return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string); }; /***/ }), /***/ 24358: /***/ ((module) => { "use strict"; module.exports = EventEmitter; /** * Constructs a new event emitter instance. * @classdesc A minimal event emitter. * @memberof util * @constructor */ function EventEmitter() { /** * Registered listeners. * @type {Object.} * @private */ this._listeners = {}; } /** * Registers an event listener. * @param {string} evt Event name * @param {function} fn Listener * @param {*} [ctx] Listener context * @returns {util.EventEmitter} `this` */ EventEmitter.prototype.on = function on(evt, fn, ctx) { (this._listeners[evt] || (this._listeners[evt] = [])).push({ fn : fn, ctx : ctx || this }); return this; }; /** * Removes an event listener or any matching listeners if arguments are omitted. * @param {string} [evt] Event name. Removes all listeners if omitted. * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted. * @returns {util.EventEmitter} `this` */ EventEmitter.prototype.off = function off(evt, fn) { if (evt === undefined) this._listeners = {}; else { if (fn === undefined) this._listeners[evt] = []; else { var listeners = this._listeners[evt]; for (var i = 0; i < listeners.length;) if (listeners[i].fn === fn) listeners.splice(i, 1); else ++i; } } return this; }; /** * Emits an event by calling its listeners with the specified arguments. * @param {string} evt Event name * @param {...*} args Arguments * @returns {util.EventEmitter} `this` */ EventEmitter.prototype.emit = function emit(evt) { var listeners = this._listeners[evt]; if (listeners) { var args = [], i = 1; for (; i < arguments.length;) args.push(arguments[i++]); for (i = 0; i < listeners.length;) listeners[i].fn.apply(listeners[i++].ctx, args); } return this; }; /***/ }), /***/ 49410: /***/ ((module) => { "use strict"; module.exports = factory(factory); /** * Reads / writes floats / doubles from / to buffers. * @name util.float * @namespace */ /** * Writes a 32 bit float to a buffer using little endian byte order. * @name util.float.writeFloatLE * @function * @param {number} val Value to write * @param {Uint8Array} buf Target buffer * @param {number} pos Target buffer offset * @returns {undefined} */ /** * Writes a 32 bit float to a buffer using big endian byte order. * @name util.float.writeFloatBE * @function * @param {number} val Value to write * @param {Uint8Array} buf Target buffer * @param {number} pos Target buffer offset * @returns {undefined} */ /** * Reads a 32 bit float from a buffer using little endian byte order. * @name util.float.readFloatLE * @function * @param {Uint8Array} buf Source buffer * @param {number} pos Source buffer offset * @returns {number} Value read */ /** * Reads a 32 bit float from a buffer using big endian byte order. * @name util.float.readFloatBE * @function * @param {Uint8Array} buf Source buffer * @param {number} pos Source buffer offset * @returns {number} Value read */ /** * Writes a 64 bit double to a buffer using little endian byte order. * @name util.float.writeDoubleLE * @function * @param {number} val Value to write * @param {Uint8Array} buf Target buffer * @param {number} pos Target buffer offset * @returns {undefined} */ /** * Writes a 64 bit double to a buffer using big endian byte order. * @name util.float.writeDoubleBE * @function * @param {number} val Value to write * @param {Uint8Array} buf Target buffer * @param {number} pos Target buffer offset * @returns {undefined} */ /** * Reads a 64 bit double from a buffer using little endian byte order. * @name util.float.readDoubleLE * @function * @param {Uint8Array} buf Source buffer * @param {number} pos Source buffer offset * @returns {number} Value read */ /** * Reads a 64 bit double from a buffer using big endian byte order. * @name util.float.readDoubleBE * @function * @param {Uint8Array} buf Source buffer * @param {number} pos Source buffer offset * @returns {number} Value read */ // Factory function for the purpose of node-based testing in modified global environments function factory(exports) { // float: typed array if (typeof Float32Array !== "undefined") (function() { var f32 = new Float32Array([ -0 ]), f8b = new Uint8Array(f32.buffer), le = f8b[3] === 128; function writeFloat_f32_cpy(val, buf, pos) { f32[0] = val; buf[pos ] = f8b[0]; buf[pos + 1] = f8b[1]; buf[pos + 2] = f8b[2]; buf[pos + 3] = f8b[3]; } function writeFloat_f32_rev(val, buf, pos) { f32[0] = val; buf[pos ] = f8b[3]; buf[pos + 1] = f8b[2]; buf[pos + 2] = f8b[1]; buf[pos + 3] = f8b[0]; } /* istanbul ignore next */ exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; /* istanbul ignore next */ exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; function readFloat_f32_cpy(buf, pos) { f8b[0] = buf[pos ]; f8b[1] = buf[pos + 1]; f8b[2] = buf[pos + 2]; f8b[3] = buf[pos + 3]; return f32[0]; } function readFloat_f32_rev(buf, pos) { f8b[3] = buf[pos ]; f8b[2] = buf[pos + 1]; f8b[1] = buf[pos + 2]; f8b[0] = buf[pos + 3]; return f32[0]; } /* istanbul ignore next */ exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; /* istanbul ignore next */ exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; // float: ieee754 })(); else (function() { function writeFloat_ieee754(writeUint, val, buf, pos) { var sign = val < 0 ? 1 : 0; if (sign) val = -val; if (val === 0) writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos); else if (isNaN(val)) writeUint(2143289344, buf, pos); else if (val > 3.4028234663852886e+38) // +-Infinity writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); else if (val < 1.1754943508222875e-38) // denormal writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos); else { var exponent = Math.floor(Math.log(val) / Math.LN2), mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); } } exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); function readFloat_ieee754(readUint, buf, pos) { var uint = readUint(buf, pos), sign = (uint >> 31) * 2 + 1, exponent = uint >>> 23 & 255, mantissa = uint & 8388607; return exponent === 255 ? mantissa ? NaN : sign * Infinity : exponent === 0 // denormal ? sign * 1.401298464324817e-45 * mantissa : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); } exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE); exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE); })(); // double: typed array if (typeof Float64Array !== "undefined") (function() { var f64 = new Float64Array([-0]), f8b = new Uint8Array(f64.buffer), le = f8b[7] === 128; function writeDouble_f64_cpy(val, buf, pos) { f64[0] = val; buf[pos ] = f8b[0]; buf[pos + 1] = f8b[1]; buf[pos + 2] = f8b[2]; buf[pos + 3] = f8b[3]; buf[pos + 4] = f8b[4]; buf[pos + 5] = f8b[5]; buf[pos + 6] = f8b[6]; buf[pos + 7] = f8b[7]; } function writeDouble_f64_rev(val, buf, pos) { f64[0] = val; buf[pos ] = f8b[7]; buf[pos + 1] = f8b[6]; buf[pos + 2] = f8b[5]; buf[pos + 3] = f8b[4]; buf[pos + 4] = f8b[3]; buf[pos + 5] = f8b[2]; buf[pos + 6] = f8b[1]; buf[pos + 7] = f8b[0]; } /* istanbul ignore next */ exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; /* istanbul ignore next */ exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; function readDouble_f64_cpy(buf, pos) { f8b[0] = buf[pos ]; f8b[1] = buf[pos + 1]; f8b[2] = buf[pos + 2]; f8b[3] = buf[pos + 3]; f8b[4] = buf[pos + 4]; f8b[5] = buf[pos + 5]; f8b[6] = buf[pos + 6]; f8b[7] = buf[pos + 7]; return f64[0]; } function readDouble_f64_rev(buf, pos) { f8b[7] = buf[pos ]; f8b[6] = buf[pos + 1]; f8b[5] = buf[pos + 2]; f8b[4] = buf[pos + 3]; f8b[3] = buf[pos + 4]; f8b[2] = buf[pos + 5]; f8b[1] = buf[pos + 6]; f8b[0] = buf[pos + 7]; return f64[0]; } /* istanbul ignore next */ exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; /* istanbul ignore next */ exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; // double: ieee754 })(); else (function() { function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { var sign = val < 0 ? 1 : 0; if (sign) val = -val; if (val === 0) { writeUint(0, buf, pos + off0); writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1); } else if (isNaN(val)) { writeUint(0, buf, pos + off0); writeUint(2146959360, buf, pos + off1); } else if (val > 1.7976931348623157e+308) { // +-Infinity writeUint(0, buf, pos + off0); writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); } else { var mantissa; if (val < 2.2250738585072014e-308) { // denormal mantissa = val / 5e-324; writeUint(mantissa >>> 0, buf, pos + off0); writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); } else { var exponent = Math.floor(Math.log(val) / Math.LN2); if (exponent === 1024) exponent = 1023; mantissa = val * Math.pow(2, -exponent); writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); } } } exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); function readDouble_ieee754(readUint, off0, off1, buf, pos) { var lo = readUint(buf, pos + off0), hi = readUint(buf, pos + off1); var sign = (hi >> 31) * 2 + 1, exponent = hi >>> 20 & 2047, mantissa = 4294967296 * (hi & 1048575) + lo; return exponent === 2047 ? mantissa ? NaN : sign * Infinity : exponent === 0 // denormal ? sign * 5e-324 * mantissa : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); } exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); })(); return exports; } // uint helpers function writeUintLE(val, buf, pos) { buf[pos ] = val & 255; buf[pos + 1] = val >>> 8 & 255; buf[pos + 2] = val >>> 16 & 255; buf[pos + 3] = val >>> 24; } function writeUintBE(val, buf, pos) { buf[pos ] = val >>> 24; buf[pos + 1] = val >>> 16 & 255; buf[pos + 2] = val >>> 8 & 255; buf[pos + 3] = val & 255; } function readUintLE(buf, pos) { return (buf[pos ] | buf[pos + 1] << 8 | buf[pos + 2] << 16 | buf[pos + 3] << 24) >>> 0; } function readUintBE(buf, pos) { return (buf[pos ] << 24 | buf[pos + 1] << 16 | buf[pos + 2] << 8 | buf[pos + 3]) >>> 0; } /***/ }), /***/ 84153: /***/ ((module) => { "use strict"; module.exports = inquire; /** * Requires a module only if available. * @memberof util * @param {string} moduleName Module to require * @returns {?Object} Required module if available and not empty, otherwise `null` */ function inquire(moduleName) { try { var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval if (mod && (mod.length || Object.keys(mod).length)) return mod; } catch (e) {} // eslint-disable-line no-empty return null; } /***/ }), /***/ 99390: /***/ ((module) => { "use strict"; module.exports = pool; /** * An allocator as used by {@link util.pool}. * @typedef PoolAllocator * @type {function} * @param {number} size Buffer size * @returns {Uint8Array} Buffer */ /** * A slicer as used by {@link util.pool}. * @typedef PoolSlicer * @type {function} * @param {number} start Start offset * @param {number} end End offset * @returns {Uint8Array} Buffer slice * @this {Uint8Array} */ /** * A general purpose buffer pool. * @memberof util * @function * @param {PoolAllocator} alloc Allocator * @param {PoolSlicer} slice Slicer * @param {number} [size=8192] Slab size * @returns {PoolAllocator} Pooled allocator */ function pool(alloc, slice, size) { var SIZE = size || 8192; var MAX = SIZE >>> 1; var slab = null; var offset = SIZE; return function pool_alloc(size) { if (size < 1 || size > MAX) return alloc(size); if (offset + size > SIZE) { slab = alloc(SIZE); offset = 0; } var buf = slice.call(slab, offset, offset += size); if (offset & 7) // align to 32 bit offset = (offset | 7) + 1; return buf; }; } /***/ }), /***/ 81447: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * A minimal UTF8 implementation for number arrays. * @memberof util * @namespace */ var utf8 = exports; /** * Calculates the UTF8 byte length of a string. * @param {string} string String * @returns {number} Byte length */ utf8.length = function utf8_length(string) { var len = 0, c = 0; for (var i = 0; i < string.length; ++i) { c = string.charCodeAt(i); if (c < 128) len += 1; else if (c < 2048) len += 2; else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { ++i; len += 4; } else len += 3; } return len; }; /** * Reads UTF8 bytes as a string. * @param {Uint8Array} buffer Source buffer * @param {number} start Source start * @param {number} end Source end * @returns {string} String read */ utf8.read = function utf8_read(buffer, start, end) { var len = end - start; if (len < 1) return ""; var parts = null, chunk = [], i = 0, // char offset t; // temporary while (start < end) { t = buffer[start++]; if (t < 128) chunk[i++] = t; else if (t > 191 && t < 224) chunk[i++] = (t & 31) << 6 | buffer[start++] & 63; else if (t > 239 && t < 365) { t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000; chunk[i++] = 0xD800 + (t >> 10); chunk[i++] = 0xDC00 + (t & 1023); } else chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; if (i > 8191) { (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); i = 0; } } if (parts) { if (i) parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); return parts.join(""); } return String.fromCharCode.apply(String, chunk.slice(0, i)); }; /** * Writes a string as UTF8 bytes. * @param {string} string Source string * @param {Uint8Array} buffer Destination buffer * @param {number} offset Destination offset * @returns {number} Bytes written */ utf8.write = function utf8_write(string, buffer, offset) { var start = offset, c1, // character 1 c2; // character 2 for (var i = 0; i < string.length; ++i) { c1 = string.charCodeAt(i); if (c1 < 128) { buffer[offset++] = c1; } else if (c1 < 2048) { buffer[offset++] = c1 >> 6 | 192; buffer[offset++] = c1 & 63 | 128; } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); ++i; buffer[offset++] = c1 >> 18 | 240; buffer[offset++] = c1 >> 12 & 63 | 128; buffer[offset++] = c1 >> 6 & 63 | 128; buffer[offset++] = c1 & 63 | 128; } else { buffer[offset++] = c1 >> 12 | 224; buffer[offset++] = c1 >> 6 & 63 | 128; buffer[offset++] = c1 & 63 | 128; } } return offset - start; }; /***/ }), /***/ 93719: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { composeWithDevTools: () => (/* binding */ esm_composeWithDevTools), composeWithDevToolsDevelopmentOnly: () => (/* reexport */ composeWithDevTools), composeWithDevToolsLogOnly: () => (/* reexport */ logOnly_composeWithDevTools), composeWithDevToolsLogOnlyInProduction: () => (/* reexport */ logOnlyInProduction_composeWithDevTools), devToolsEnhancer: () => (/* binding */ esm_devToolsEnhancer), devToolsEnhancerDevelopmentOnly: () => (/* reexport */ devToolsEnhancer), devToolsEnhancerLogOnly: () => (/* reexport */ logOnly_devToolsEnhancer), devToolsEnhancerLogOnlyInProduction: () => (/* reexport */ logOnlyInProduction_devToolsEnhancer) }); // EXTERNAL MODULE: ./node_modules/redux/es/redux.js var redux = __webpack_require__(82960); ;// ./node_modules/@redux-devtools/extension/lib/esm/developmentOnly.js function extensionComposeStub() { for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) { funcs[_key] = arguments[_key]; } if (funcs.length === 0) return undefined; if (typeof funcs[0] === 'object') return redux.compose; return (0,redux.compose)(...funcs); } const composeWithDevTools = false ? 0 : extensionComposeStub; const devToolsEnhancer = false ? 0 : function () { return function (noop) { return noop; }; }; ;// ./node_modules/@redux-devtools/extension/lib/esm/utils/assign.js const objectKeys = Object.keys || function (obj) { const keys = []; for (const key in obj) { if ({}.hasOwnProperty.call(obj, key)) keys.push(key); } return keys; }; function assign_assign(obj, newKey, newValue) { const keys = objectKeys(obj); const copy = {}; for (let i = 0, l = keys.length; i < l; i++) { const key = keys[i]; copy[key] = obj[key]; } copy[newKey] = newValue; return copy; } ;// ./node_modules/@redux-devtools/extension/lib/esm/logOnly.js function enhancer(options) { const config = options || {}; config.features = { pause: true, export: true, test: true }; config.type = 'redux'; if (config.autoPause === undefined) config.autoPause = true; if (config.latency === undefined) config.latency = 500; return function (createStore) { return function (reducer, preloadedState) { const store = createStore(reducer, preloadedState); const origDispatch = store.dispatch; const devTools = window.__REDUX_DEVTOOLS_EXTENSION__.connect(config); devTools.init(store.getState()); const dispatch = function (action) { const r = origDispatch(action); devTools.send(action, store.getState()); return r; }; if (Object.assign) return Object.assign(store, { dispatch: dispatch }); return assign_assign(store, 'dispatch', dispatch); }; }; } function composeWithEnhancer(config) { return function () { return (0,redux.compose)((0,redux.compose)(...arguments), enhancer(config)); }; } function logOnly_composeWithDevTools() { for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) { funcs[_key] = arguments[_key]; } if ( true && window.__REDUX_DEVTOOLS_EXTENSION__) { if (funcs.length === 0) return enhancer(); if (typeof funcs[0] === 'object') return composeWithEnhancer(funcs[0]); return composeWithEnhancer()(...funcs); } if (funcs.length === 0) return undefined; if (typeof funcs[0] === 'object') return redux.compose; return (0,redux.compose)(...funcs); } const logOnly_devToolsEnhancer = true && window.__REDUX_DEVTOOLS_EXTENSION__ ? enhancer : function () { return function (noop) { return noop; }; }; ;// ./node_modules/@redux-devtools/extension/lib/esm/logOnlyInProduction.js function logOnlyInProduction_extensionComposeStub() { for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) { funcs[_key] = arguments[_key]; } if (funcs.length === 0) return undefined; if (typeof funcs[0] === 'object') return compose; return compose(...funcs); } const logOnlyInProduction_composeWithDevTools = true ? logOnly_composeWithDevTools : 0; const logOnlyInProduction_devToolsEnhancer = true ? logOnly_devToolsEnhancer : 0; ;// ./node_modules/@redux-devtools/extension/lib/esm/index.js function esm_extensionComposeStub() { for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) { funcs[_key] = arguments[_key]; } if (funcs.length === 0) return undefined; if (typeof funcs[0] === 'object') return redux.compose; return (0,redux.compose)(...funcs); } const esm_composeWithDevTools = true && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : esm_extensionComposeStub; const esm_devToolsEnhancer = true && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function () { return function (noop) { return noop; }; }; /***/ }), /***/ 5857: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var tabbable = __webpack_require__(10818); var focusin = __webpack_require__(88175); var polyfilled = false; function init(element) { // lazily polyfill focusin for firefox if (!polyfilled) { focusin.polyfill(); polyfilled = true; } function focus() { (tabbable(element)[0] || element).focus() } function onFocusIn(event) { if (element !== event.target && !element.contains(event.target)) { focus(); } } focus(); document.addEventListener('focusin', onFocusIn); return function teardown() { document.removeEventListener('focusin', onFocusIn); }; } var teardownFn; exports.scopeFocus = function(element) { if (teardownFn) teardownFn(); teardownFn = init(element); }; exports.unscopeFocus = function() { if (teardownFn) teardownFn(); teardownFn = null; }; /***/ }), /***/ 59828: /***/ ((__unused_webpack_module, exports) => { "use strict"; var storedFocusElement; exports.storeFocus = function() { storedFocusElement = document.activeElement; }; exports.clearStoredFocus = function() { storedFocusElement = null; }; exports.restoreFocus = function() { if (!storedFocusElement) return; try { storedFocusElement.focus(); } catch (err) {} storedFocusElement = null; }; /***/ }), /***/ 85914: /***/ (function(module, exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); var __WEBPACK_AMD_DEFINE_RESULT__;/*! http://mths.be/base64 v0.1.0 by @mathias | MIT license */ ;(function(root) { // Detect free variables `exports`. var freeExports = true && exports; // Detect free variable `module`. var freeModule = true && module && module.exports == freeExports && module; // Detect free variable `global`, from Node.js or Browserified code, and use // it as `root`. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g; if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { root = freeGlobal; } /*--------------------------------------------------------------------------*/ var InvalidCharacterError = function(message) { this.message = message; }; InvalidCharacterError.prototype = new Error; InvalidCharacterError.prototype.name = 'InvalidCharacterError'; var error = function(message) { // Note: the error messages used throughout this file match those used by // the native `atob`/`btoa` implementation in Chromium. throw new InvalidCharacterError(message); }; var TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; // http://whatwg.org/html/common-microsyntaxes.html#space-character var REGEX_SPACE_CHARACTERS = /[\t\n\f\r ]/g; // `decode` is designed to be fully compatible with `atob` as described in the // HTML Standard. http://whatwg.org/html/webappapis.html#dom-windowbase64-atob // The optimized base64-decoding algorithm used is based on @atk’s excellent // implementation. https://gist.github.com/atk/1020396 var decode = function(input) { input = String(input) .replace(REGEX_SPACE_CHARACTERS, ''); var length = input.length; if (length % 4 == 0) { input = input.replace(/==?$/, ''); length = input.length; } if ( length % 4 == 1 || // http://whatwg.org/C#alphanumeric-ascii-characters /[^+a-zA-Z0-9/]/.test(input) ) { error( 'Invalid character: the string to be decoded is not correctly encoded.' ); } var bitCounter = 0; var bitStorage; var buffer; var output = ''; var position = -1; while (++position < length) { buffer = TABLE.indexOf(input.charAt(position)); bitStorage = bitCounter % 4 ? bitStorage * 64 + buffer : buffer; // Unless this is the first of a group of 4 characters… if (bitCounter++ % 4) { // …convert the first 8 bits to a single ASCII character. output += String.fromCharCode( 0xFF & bitStorage >> (-2 * bitCounter & 6) ); } } return output; }; // `encode` is designed to be fully compatible with `btoa` as described in the // HTML Standard: http://whatwg.org/html/webappapis.html#dom-windowbase64-btoa var encode = function(input) { input = String(input); if (/[^\0-\xFF]/.test(input)) { // Note: no need to special-case astral symbols here, as surrogates are // matched, and the input is supposed to only contain ASCII anyway. error( 'The string to be encoded contains characters outside of the ' + 'Latin1 range.' ); } var padding = input.length % 3; var output = ''; var position = -1; var a; var b; var c; var d; var buffer; // Make sure any padding is handled outside of the loop. var length = input.length - padding; while (++position < length) { // Read three bytes, i.e. 24 bits. a = input.charCodeAt(position) << 16; b = input.charCodeAt(++position) << 8; c = input.charCodeAt(++position); buffer = a + b + c; // Turn the 24 bits into four chunks of 6 bits each, and append the // matching character for each of them to the output. output += ( TABLE.charAt(buffer >> 18 & 0x3F) + TABLE.charAt(buffer >> 12 & 0x3F) + TABLE.charAt(buffer >> 6 & 0x3F) + TABLE.charAt(buffer & 0x3F) ); } if (padding == 2) { a = input.charCodeAt(position) << 8; b = input.charCodeAt(++position); buffer = a + b; output += ( TABLE.charAt(buffer >> 10) + TABLE.charAt((buffer >> 4) & 0x3F) + TABLE.charAt((buffer << 2) & 0x3F) + '=' ); } else if (padding == 1) { buffer = input.charCodeAt(position); output += ( TABLE.charAt(buffer >> 2) + TABLE.charAt((buffer << 4) & 0x3F) + '==' ); } return output; }; var base64 = { 'encode': encode, 'decode': decode, 'version': '0.1.0' }; // Some AMD build optimizers, like r.js, check for specific condition patterns // like the following: if ( true ) { !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return base64; }).call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else { var key; } }(this)); /***/ }), /***/ 24208: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ clearAllBodyScrollLocks: () => (/* binding */ clearAllBodyScrollLocks), /* harmony export */ disableBodyScroll: () => (/* binding */ disableBodyScroll), /* harmony export */ enableBodyScroll: () => (/* binding */ enableBodyScroll) /* harmony export */ }); function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } // Older browsers don't support event options, feature detect it. // Adopted and modified solution from Bohdan Didukh (2017) // https://stackoverflow.com/questions/41594997/ios-10-safari-prevent-scrolling-behind-a-fixed-overlay-and-maintain-scroll-posi var hasPassiveEvents = false; if (true) { var passiveTestOptions = { get passive() { hasPassiveEvents = true; return undefined; } }; window.addEventListener('testPassive', null, passiveTestOptions); window.removeEventListener('testPassive', null, passiveTestOptions); } var isIosDevice = true && window.navigator && window.navigator.platform && (/iP(ad|hone|od)/.test(window.navigator.platform) || window.navigator.platform === 'MacIntel' && window.navigator.maxTouchPoints > 1); var locks = []; var documentListenerAdded = false; var initialClientY = -1; var previousBodyOverflowSetting = void 0; var previousBodyPaddingRight = void 0; // returns true if `el` should be allowed to receive touchmove events. var allowTouchMove = function allowTouchMove(el) { return locks.some(function (lock) { if (lock.options.allowTouchMove && lock.options.allowTouchMove(el)) { return true; } return false; }); }; var preventDefault = function preventDefault(rawEvent) { var e = rawEvent || window.event; // For the case whereby consumers adds a touchmove event listener to document. // Recall that we do document.addEventListener('touchmove', preventDefault, { passive: false }) // in disableBodyScroll - so if we provide this opportunity to allowTouchMove, then // the touchmove event on document will break. if (allowTouchMove(e.target)) { return true; } // Do not prevent if the event has more than one touch (usually meaning this is a multi touch gesture like pinch to zoom). if (e.touches.length > 1) return true; if (e.preventDefault) e.preventDefault(); return false; }; var setOverflowHidden = function setOverflowHidden(options) { // If previousBodyPaddingRight is already set, don't set it again. if (previousBodyPaddingRight === undefined) { var _reserveScrollBarGap = !!options && options.reserveScrollBarGap === true; var scrollBarGap = window.innerWidth - document.documentElement.clientWidth; if (_reserveScrollBarGap && scrollBarGap > 0) { previousBodyPaddingRight = document.body.style.paddingRight; document.body.style.paddingRight = scrollBarGap + 'px'; } } // If previousBodyOverflowSetting is already set, don't set it again. if (previousBodyOverflowSetting === undefined) { previousBodyOverflowSetting = document.body.style.overflow; document.body.style.overflow = 'hidden'; } }; var restoreOverflowSetting = function restoreOverflowSetting() { if (previousBodyPaddingRight !== undefined) { document.body.style.paddingRight = previousBodyPaddingRight; // Restore previousBodyPaddingRight to undefined so setOverflowHidden knows it // can be set again. previousBodyPaddingRight = undefined; } if (previousBodyOverflowSetting !== undefined) { document.body.style.overflow = previousBodyOverflowSetting; // Restore previousBodyOverflowSetting to undefined // so setOverflowHidden knows it can be set again. previousBodyOverflowSetting = undefined; } }; // https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight#Problems_and_solutions var isTargetElementTotallyScrolled = function isTargetElementTotallyScrolled(targetElement) { return targetElement ? targetElement.scrollHeight - targetElement.scrollTop <= targetElement.clientHeight : false; }; var handleScroll = function handleScroll(event, targetElement) { var clientY = event.targetTouches[0].clientY - initialClientY; if (allowTouchMove(event.target)) { return false; } if (targetElement && targetElement.scrollTop === 0 && clientY > 0) { // element is at the top of its scroll. return preventDefault(event); } if (isTargetElementTotallyScrolled(targetElement) && clientY < 0) { // element is at the bottom of its scroll. return preventDefault(event); } event.stopPropagation(); return true; }; var disableBodyScroll = function disableBodyScroll(targetElement, options) { // targetElement must be provided if (!targetElement) { // eslint-disable-next-line no-console console.error('disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.'); return; } // disableBodyScroll must not have been called on this targetElement before if (locks.some(function (lock) { return lock.targetElement === targetElement; })) { return; } var lock = { targetElement: targetElement, options: options || {} }; locks = [].concat(_toConsumableArray(locks), [lock]); if (isIosDevice) { targetElement.ontouchstart = function (event) { if (event.targetTouches.length === 1) { // detect single touch. initialClientY = event.targetTouches[0].clientY; } }; targetElement.ontouchmove = function (event) { if (event.targetTouches.length === 1) { // detect single touch. handleScroll(event, targetElement); } }; if (!documentListenerAdded) { document.addEventListener('touchmove', preventDefault, hasPassiveEvents ? { passive: false } : undefined); documentListenerAdded = true; } } else { setOverflowHidden(options); } }; var clearAllBodyScrollLocks = function clearAllBodyScrollLocks() { if (isIosDevice) { // Clear all locks ontouchstart/ontouchmove handlers, and the references. locks.forEach(function (lock) { lock.targetElement.ontouchstart = null; lock.targetElement.ontouchmove = null; }); if (documentListenerAdded) { document.removeEventListener('touchmove', preventDefault, hasPassiveEvents ? { passive: false } : undefined); documentListenerAdded = false; } // Reset initial clientY. initialClientY = -1; } else { restoreOverflowSetting(); } locks = []; }; var enableBodyScroll = function enableBodyScroll(targetElement) { if (!targetElement) { // eslint-disable-next-line no-console console.error('enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.'); return; } locks = locks.filter(function (lock) { return lock.targetElement !== targetElement; }); if (isIosDevice) { targetElement.ontouchstart = null; targetElement.ontouchmove = null; if (documentListenerAdded && locks.length === 0) { document.removeEventListener('touchmove', preventDefault, hasPassiveEvents ? { passive: false } : undefined); documentListenerAdded = false; } } else if (!locks.length) { restoreOverflowSetting(); } }; /***/ }), /***/ 52566: /***/ ((__unused_webpack_module, exports) => { /*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */ /* vim: set ts=2: */ /*exported CRC32 */ var CRC32; (function (factory) { /*jshint ignore:start */ /*eslint-disable */ if(typeof DO_NOT_EXPORT_CRC === 'undefined') { if(true) { factory(exports); } else {} } else { factory(CRC32 = {}); } /*eslint-enable */ /*jshint ignore:end */ }(function(CRC32) { CRC32.version = '1.2.2'; /*global Int32Array */ function signed_crc_table() { var c = 0, table = new Array(256); for(var n =0; n != 256; ++n){ c = n; c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); table[n] = c; } return typeof Int32Array !== 'undefined' ? new Int32Array(table) : table; } var T0 = signed_crc_table(); function slice_by_16_tables(T) { var c = 0, v = 0, n = 0, table = typeof Int32Array !== 'undefined' ? new Int32Array(4096) : new Array(4096) ; for(n = 0; n != 256; ++n) table[n] = T[n]; for(n = 0; n != 256; ++n) { v = T[n]; for(c = 256 + n; c < 4096; c += 256) v = table[c] = (v >>> 8) ^ T[v & 0xFF]; } var out = []; for(n = 1; n != 16; ++n) out[n - 1] = typeof Int32Array !== 'undefined' ? table.subarray(n * 256, n * 256 + 256) : table.slice(n * 256, n * 256 + 256); return out; } var TT = slice_by_16_tables(T0); var T1 = TT[0], T2 = TT[1], T3 = TT[2], T4 = TT[3], T5 = TT[4]; var T6 = TT[5], T7 = TT[6], T8 = TT[7], T9 = TT[8], Ta = TT[9]; var Tb = TT[10], Tc = TT[11], Td = TT[12], Te = TT[13], Tf = TT[14]; function crc32_bstr(bstr, seed) { var C = seed ^ -1; for(var i = 0, L = bstr.length; i < L;) C = (C>>>8) ^ T0[(C^bstr.charCodeAt(i++))&0xFF]; return ~C; } function crc32_buf(B, seed) { var C = seed ^ -1, L = B.length - 15, i = 0; for(; i < L;) C = Tf[B[i++] ^ (C & 255)] ^ Te[B[i++] ^ ((C >> 8) & 255)] ^ Td[B[i++] ^ ((C >> 16) & 255)] ^ Tc[B[i++] ^ (C >>> 24)] ^ Tb[B[i++]] ^ Ta[B[i++]] ^ T9[B[i++]] ^ T8[B[i++]] ^ T7[B[i++]] ^ T6[B[i++]] ^ T5[B[i++]] ^ T4[B[i++]] ^ T3[B[i++]] ^ T2[B[i++]] ^ T1[B[i++]] ^ T0[B[i++]]; L += 15; while(i < L) C = (C>>>8) ^ T0[(C^B[i++])&0xFF]; return ~C; } function crc32_str(str, seed) { var C = seed ^ -1; for(var i = 0, L = str.length, c = 0, d = 0; i < L;) { c = str.charCodeAt(i++); if(c < 0x80) { C = (C>>>8) ^ T0[(C^c)&0xFF]; } else if(c < 0x800) { C = (C>>>8) ^ T0[(C ^ (192|((c>>6)&31)))&0xFF]; C = (C>>>8) ^ T0[(C ^ (128|(c&63)))&0xFF]; } else if(c >= 0xD800 && c < 0xE000) { c = (c&1023)+64; d = str.charCodeAt(i++)&1023; C = (C>>>8) ^ T0[(C ^ (240|((c>>8)&7)))&0xFF]; C = (C>>>8) ^ T0[(C ^ (128|((c>>2)&63)))&0xFF]; C = (C>>>8) ^ T0[(C ^ (128|((d>>6)&15)|((c&3)<<4)))&0xFF]; C = (C>>>8) ^ T0[(C ^ (128|(d&63)))&0xFF]; } else { C = (C>>>8) ^ T0[(C ^ (224|((c>>12)&15)))&0xFF]; C = (C>>>8) ^ T0[(C ^ (128|((c>>6)&63)))&0xFF]; C = (C>>>8) ^ T0[(C ^ (128|(c&63)))&0xFF]; } } return ~C; } CRC32.table = T0; // $FlowIgnore CRC32.bstr = crc32_bstr; // $FlowIgnore CRC32.buf = crc32_buf; // $FlowIgnore CRC32.str = crc32_str; })); /***/ }), /***/ 99591: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ connectGlobalObserver: () => (/* binding */ connectGlobalObserver), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ disconnectGlobalObserver: () => (/* binding */ disconnectGlobalObserver), /* harmony export */ validAttributeName: () => (/* binding */ validAttributeName) /* harmony export */ }); var validAttributeName = /^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/; var nullController = { revert: function revert() {} }; var elements = /*#__PURE__*/new Map(); var mutations = /*#__PURE__*/new Set(); function getObserverInit(attr) { return attr === 'html' ? { childList: true, subtree: true, attributes: true, characterData: true } : { childList: false, subtree: false, attributes: true, attributeFilter: [attr] }; } function getElementRecord(element) { var record = elements.get(element); if (!record) { record = { element: element, attributes: {} }; elements.set(element, record); } return record; } function createElementPropertyRecord(el, attr, getCurrentValue, setValue, mutationRunner) { var currentValue = getCurrentValue(el); var record = { isDirty: false, originalValue: currentValue, virtualValue: currentValue, mutations: [], el: el, _positionTimeout: null, observer: new MutationObserver(function () { // enact a 1 second timeout that blocks subsequent firing of the // observer until the timeout is complete. This will prevent multiple // mutations from firing in quick succession, which can cause the // mutation to be reverted before the DOM has a chance to update. if (attr === 'position' && record._positionTimeout) return;else if (attr === 'position') record._positionTimeout = setTimeout(function () { record._positionTimeout = null; }, 1000); var currentValue = getCurrentValue(el); if (attr === 'position' && currentValue.parentNode === record.virtualValue.parentNode && currentValue.insertBeforeNode === record.virtualValue.insertBeforeNode) return; if (currentValue === record.virtualValue) return; record.originalValue = currentValue; mutationRunner(record); }), mutationRunner: mutationRunner, setValue: setValue, getCurrentValue: getCurrentValue }; if (attr === 'position' && el.parentNode) { record.observer.observe(el.parentNode, { childList: true, subtree: true, attributes: false, characterData: false }); } else { record.observer.observe(el, getObserverInit(attr)); } return record; } function queueIfNeeded(val, record) { var currentVal = record.getCurrentValue(record.el); record.virtualValue = val; if (val && typeof val !== 'string') { if (!currentVal || val.parentNode !== currentVal.parentNode || val.insertBeforeNode !== currentVal.insertBeforeNode) { record.isDirty = true; runDOMUpdates(); } } else if (val !== currentVal) { record.isDirty = true; runDOMUpdates(); } } function htmlMutationRunner(record) { var val = record.originalValue; record.mutations.forEach(function (m) { return val = m.mutate(val); }); queueIfNeeded(getTransformedHTML(val), record); } function classMutationRunner(record) { var val = new Set(record.originalValue.split(/\s+/).filter(Boolean)); record.mutations.forEach(function (m) { return m.mutate(val); }); queueIfNeeded(Array.from(val).filter(Boolean).join(' '), record); } function attrMutationRunner(record) { var val = record.originalValue; record.mutations.forEach(function (m) { return val = m.mutate(val); }); queueIfNeeded(val, record); } function _loadDOMNodes(_ref) { var parentSelector = _ref.parentSelector, insertBeforeSelector = _ref.insertBeforeSelector; var parentNode = document.querySelector(parentSelector); if (!parentNode) return null; var insertBeforeNode = insertBeforeSelector ? document.querySelector(insertBeforeSelector) : null; if (insertBeforeSelector && !insertBeforeNode) return null; return { parentNode: parentNode, insertBeforeNode: insertBeforeNode }; } function positionMutationRunner(record) { var val = record.originalValue; record.mutations.forEach(function (m) { var selectors = m.mutate(); var newNodes = _loadDOMNodes(selectors); val = newNodes || val; }); queueIfNeeded(val, record); } var getHTMLValue = function getHTMLValue(el) { return el.innerHTML; }; var setHTMLValue = function setHTMLValue(el, value) { return el.innerHTML = value; }; function getElementHTMLRecord(element) { var elementRecord = getElementRecord(element); if (!elementRecord.html) { elementRecord.html = createElementPropertyRecord(element, 'html', getHTMLValue, setHTMLValue, htmlMutationRunner); } return elementRecord.html; } var getElementPosition = function getElementPosition(el) { return { parentNode: el.parentElement, insertBeforeNode: el.nextElementSibling }; }; var setElementPosition = function setElementPosition(el, value) { if (value.insertBeforeNode && !value.parentNode.contains(value.insertBeforeNode)) { // skip position mutation - insertBeforeNode not a child of parent. happens // when mutation observer for indvidual element fires out of order return; } value.parentNode.insertBefore(el, value.insertBeforeNode); }; function getElementPositionRecord(element) { var elementRecord = getElementRecord(element); if (!elementRecord.position) { elementRecord.position = createElementPropertyRecord(element, 'position', getElementPosition, setElementPosition, positionMutationRunner); } return elementRecord.position; } var setClassValue = function setClassValue(el, val) { return val ? el.className = val : el.removeAttribute('class'); }; var getClassValue = function getClassValue(el) { return el.className; }; function getElementClassRecord(el) { var elementRecord = getElementRecord(el); if (!elementRecord.classes) { elementRecord.classes = createElementPropertyRecord(el, 'class', getClassValue, setClassValue, classMutationRunner); } return elementRecord.classes; } var getAttrValue = function getAttrValue(attrName) { return function (el) { var _el$getAttribute; return (_el$getAttribute = el.getAttribute(attrName)) != null ? _el$getAttribute : null; }; }; var setAttrValue = function setAttrValue(attrName) { return function (el, val) { return val !== null ? el.setAttribute(attrName, val) : el.removeAttribute(attrName); }; }; function getElementAttributeRecord(el, attr) { var elementRecord = getElementRecord(el); if (!elementRecord.attributes[attr]) { elementRecord.attributes[attr] = createElementPropertyRecord(el, attr, getAttrValue(attr), setAttrValue(attr), attrMutationRunner); } return elementRecord.attributes[attr]; } function deleteElementPropertyRecord(el, attr) { var element = elements.get(el); if (!element) return; if (attr === 'html') { var _element$html, _element$html$observe; (_element$html = element.html) == null ? void 0 : (_element$html$observe = _element$html.observer) == null ? void 0 : _element$html$observe.disconnect(); delete element.html; } else if (attr === 'class') { var _element$classes, _element$classes$obse; (_element$classes = element.classes) == null ? void 0 : (_element$classes$obse = _element$classes.observer) == null ? void 0 : _element$classes$obse.disconnect(); delete element.classes; } else if (attr === 'position') { var _element$position, _element$position$obs; (_element$position = element.position) == null ? void 0 : (_element$position$obs = _element$position.observer) == null ? void 0 : _element$position$obs.disconnect(); delete element.position; } else { var _element$attributes, _element$attributes$a, _element$attributes$a2; (_element$attributes = element.attributes) == null ? void 0 : (_element$attributes$a = _element$attributes[attr]) == null ? void 0 : (_element$attributes$a2 = _element$attributes$a.observer) == null ? void 0 : _element$attributes$a2.disconnect(); delete element.attributes[attr]; } } var transformContainer; function getTransformedHTML(html) { if (!transformContainer) { transformContainer = document.createElement('div'); } transformContainer.innerHTML = html; return transformContainer.innerHTML; } function setPropertyValue(el, attr, m) { if (!m.isDirty) return; m.isDirty = false; var val = m.virtualValue; if (!m.mutations.length) { deleteElementPropertyRecord(el, attr); } m.setValue(el, val); } function setValue(m, el) { m.html && setPropertyValue(el, 'html', m.html); m.classes && setPropertyValue(el, 'class', m.classes); m.position && setPropertyValue(el, 'position', m.position); Object.keys(m.attributes).forEach(function (attr) { setPropertyValue(el, attr, m.attributes[attr]); }); } function runDOMUpdates() { elements.forEach(setValue); } // find or create ElementPropertyRecord, add mutation to it, then run function startMutating(mutation, element) { var record = null; if (mutation.kind === 'html') { record = getElementHTMLRecord(element); } else if (mutation.kind === 'class') { record = getElementClassRecord(element); } else if (mutation.kind === 'attribute') { record = getElementAttributeRecord(element, mutation.attribute); } else if (mutation.kind === 'position') { record = getElementPositionRecord(element); } if (!record) return; record.mutations.push(mutation); record.mutationRunner(record); } // get (existing) ElementPropertyRecord, remove mutation from it, then run function stopMutating(mutation, el) { var record = null; if (mutation.kind === 'html') { record = getElementHTMLRecord(el); } else if (mutation.kind === 'class') { record = getElementClassRecord(el); } else if (mutation.kind === 'attribute') { record = getElementAttributeRecord(el, mutation.attribute); } else if (mutation.kind === 'position') { record = getElementPositionRecord(el); } if (!record) return; var index = record.mutations.indexOf(mutation); if (index !== -1) record.mutations.splice(index, 1); record.mutationRunner(record); } // maintain list of elements associated with mutation function refreshElementsSet(mutation) { // if a position mutation has already found an element to move, don't move // any more elements if (mutation.kind === 'position' && mutation.elements.size === 1) return; var existingElements = new Set(mutation.elements); var matchingElements = document.querySelectorAll(mutation.selector); matchingElements.forEach(function (el) { if (!existingElements.has(el)) { mutation.elements.add(el); startMutating(mutation, el); } }); } function revertMutation(mutation) { mutation.elements.forEach(function (el) { return stopMutating(mutation, el); }); mutation.elements.clear(); mutations["delete"](mutation); } function refreshAllElementSets() { mutations.forEach(refreshElementsSet); } // Observer for elements that don't exist in the DOM yet var observer; function disconnectGlobalObserver() { observer && observer.disconnect(); } function connectGlobalObserver() { if (typeof document === 'undefined') return; if (!observer) { observer = new MutationObserver(function () { refreshAllElementSets(); }); } refreshAllElementSets(); observer.observe(document.documentElement, { childList: true, subtree: true, attributes: false, characterData: false }); } // run on init connectGlobalObserver(); function newMutation(m) { // Not in a browser if (typeof document === 'undefined') return nullController; // add to global index of mutations mutations.add(m); // run refresh on init to establish list of elements associated w/ mutation refreshElementsSet(m); return { revert: function revert() { revertMutation(m); } }; } function html(selector, mutate) { return newMutation({ kind: 'html', elements: new Set(), mutate: mutate, selector: selector }); } function position(selector, mutate) { return newMutation({ kind: 'position', elements: new Set(), mutate: mutate, selector: selector }); } function classes(selector, mutate) { return newMutation({ kind: 'class', elements: new Set(), mutate: mutate, selector: selector }); } function attribute(selector, attribute, mutate) { if (!validAttributeName.test(attribute)) return nullController; if (attribute === 'class' || attribute === 'className') { return classes(selector, function (classnames) { var mutatedClassnames = mutate(Array.from(classnames).join(' ')); classnames.clear(); if (!mutatedClassnames) return; mutatedClassnames.split(/\s+/g).filter(Boolean).forEach(function (c) { return classnames.add(c); }); }); } return newMutation({ kind: 'attribute', attribute: attribute, elements: new Set(), mutate: mutate, selector: selector }); } function declarative(_ref2) { var selector = _ref2.selector, action = _ref2.action, value = _ref2.value, attr = _ref2.attribute, parentSelector = _ref2.parentSelector, insertBeforeSelector = _ref2.insertBeforeSelector; if (attr === 'html') { if (action === 'append') { return html(selector, function (val) { return val + (value != null ? value : ''); }); } else if (action === 'set') { return html(selector, function () { return value != null ? value : ''; }); } } else if (attr === 'class') { if (action === 'append') { return classes(selector, function (val) { if (value) val.add(value); }); } else if (action === 'remove') { return classes(selector, function (val) { if (value) val["delete"](value); }); } else if (action === 'set') { return classes(selector, function (val) { val.clear(); if (value) val.add(value); }); } } else if (attr === 'position') { if (action === 'set' && parentSelector) { return position(selector, function () { return { insertBeforeSelector: insertBeforeSelector, parentSelector: parentSelector }; }); } } else { if (action === 'append') { return attribute(selector, attr, function (val) { return val !== null ? val + (value != null ? value : '') : value != null ? value : ''; }); } else if (action === 'set') { return attribute(selector, attr, function () { return value != null ? value : ''; }); } else if (action === 'remove') { return attribute(selector, attr, function () { return null; }); } } return nullController; } var index = { html: html, classes: classes, attribute: attribute, position: position, declarative: declarative }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (index); //# sourceMappingURL=dom-mutator.esm.js.map /***/ }), /***/ 50411: /***/ ((module, exports, __webpack_require__) => { var __WEBPACK_AMD_DEFINE_RESULT__;/*! Copyright (c) 2015 Jed Watson. Based on code that is Copyright 2013-2015, Facebook, Inc. All rights reserved. */ /* global define */ (function () { 'use strict'; var canUseDOM = !!( true && window.document && window.document.createElement ); var ExecutionEnvironment = { canUseDOM: canUseDOM, canUseWorkers: typeof Worker !== 'undefined', canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent), canUseViewport: canUseDOM && !!window.screen }; if (true) { !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () { return ExecutionEnvironment; }).call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else {} }()); /***/ }), /***/ 88175: /***/ ((module) => { /* from https://gist.github.com/nuxodin/9250e56a3ce6c0446efa */ function polyfill () { var w = window var d = w.document if (w.onfocusin === undefined) { d.addEventListener('focus', addPolyfill, true) d.addEventListener('blur', addPolyfill, true) d.addEventListener('focusin', removePolyfill, true) d.addEventListener('focusout', removePolyfill, true) } function addPolyfill (e) { var type = e.type === 'focus' ? 'focusin' : 'focusout' var event = new window.CustomEvent(type, { bubbles: true, cancelable: false }) event.c1Generated = true e.target.dispatchEvent(event) } function removePolyfill (e) { if (!e.c1Generated) { d.removeEventListener('focus', addPolyfill, true) d.removeEventListener('blur', addPolyfill, true) d.removeEventListener('focusin', removePolyfill, true) d.removeEventListener('focusout', removePolyfill, true) } setTimeout(function () { d.removeEventListener('focusin', removePolyfill, true) d.removeEventListener('focusout', removePolyfill, true) }) } } module.exports = { polyfill: polyfill } /***/ }), /***/ 4146: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var reactIs = __webpack_require__(73404); /** * Copyright 2015, Yahoo! Inc. * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. */ var REACT_STATICS = { childContextTypes: true, contextType: true, contextTypes: true, defaultProps: true, displayName: true, getDefaultProps: true, getDerivedStateFromError: true, getDerivedStateFromProps: true, mixins: true, propTypes: true, type: true }; var KNOWN_STATICS = { name: true, length: true, prototype: true, caller: true, callee: true, arguments: true, arity: true }; var FORWARD_REF_STATICS = { '$$typeof': true, render: true, defaultProps: true, displayName: true, propTypes: true }; var MEMO_STATICS = { '$$typeof': true, compare: true, defaultProps: true, displayName: true, propTypes: true, type: true }; var TYPE_STATICS = {}; TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS; TYPE_STATICS[reactIs.Memo] = MEMO_STATICS; function getStatics(component) { // React v16.11 and below if (reactIs.isMemo(component)) { return MEMO_STATICS; } // React v16.12 and above return TYPE_STATICS[component['$$typeof']] || REACT_STATICS; } var defineProperty = Object.defineProperty; var getOwnPropertyNames = Object.getOwnPropertyNames; var getOwnPropertySymbols = Object.getOwnPropertySymbols; var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var getPrototypeOf = Object.getPrototypeOf; var objectPrototype = Object.prototype; function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components if (objectPrototype) { var inheritedComponent = getPrototypeOf(sourceComponent); if (inheritedComponent && inheritedComponent !== objectPrototype) { hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); } } var keys = getOwnPropertyNames(sourceComponent); if (getOwnPropertySymbols) { keys = keys.concat(getOwnPropertySymbols(sourceComponent)); } var targetStatics = getStatics(targetComponent); var sourceStatics = getStatics(sourceComponent); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { var descriptor = getOwnPropertyDescriptor(sourceComponent, key); try { // Avoid failures from read-only properties defineProperty(targetComponent, key, descriptor); } catch (e) {} } } } return targetComponent; } module.exports = hoistNonReactStatics; /***/ }), /***/ 63945: /***/ ((module) => { /** * A specialized version of `baseAggregator` for arrays. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform keys. * @param {Object} accumulator The initial aggregated object. * @returns {Function} Returns `accumulator`. */ function arrayAggregator(array, setter, iteratee, accumulator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { var value = array[index]; setter(accumulator, value, iteratee(value), array); } return accumulator; } module.exports = arrayAggregator; /***/ }), /***/ 17277: /***/ ((module) => { /** * A specialized version of `_.every` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false`. */ function arrayEvery(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (!predicate(array[index], index, array)) { return false; } } return true; } module.exports = arrayEvery; /***/ }), /***/ 18567: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var copyArray = __webpack_require__(23007), shuffleSelf = __webpack_require__(7410); /** * A specialized version of `_.shuffle` for arrays. * * @private * @param {Array} array The array to shuffle. * @returns {Array} Returns the new shuffled array. */ function arrayShuffle(array) { return shuffleSelf(copyArray(array)); } module.exports = arrayShuffle; /***/ }), /***/ 84810: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseEach = __webpack_require__(80909); /** * Aggregates elements of `collection` on `accumulator` with keys transformed * by `iteratee` and values set by `setter`. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform keys. * @param {Object} accumulator The initial aggregated object. * @returns {Function} Returns `accumulator`. */ function baseAggregator(collection, setter, iteratee, accumulator) { baseEach(collection, function(value, key, collection) { setter(accumulator, value, iteratee(value), collection); }); return accumulator; } module.exports = baseAggregator; /***/ }), /***/ 87133: /***/ ((module) => { /** * The base implementation of `_.clamp` which doesn't coerce arguments. * * @private * @param {number} number The number to clamp. * @param {number} [lower] The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the clamped number. */ function baseClamp(number, lower, upper) { if (number === number) { if (upper !== undefined) { number = number <= upper ? number : upper; } if (lower !== undefined) { number = number >= lower ? number : lower; } } return number; } module.exports = baseClamp; /***/ }), /***/ 83915: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var SetCache = __webpack_require__(38859), arrayIncludes = __webpack_require__(15325), arrayIncludesWith = __webpack_require__(29905), arrayMap = __webpack_require__(34932), baseUnary = __webpack_require__(27301), cacheHas = __webpack_require__(19219); /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; /** * The base implementation of methods like `_.difference` without support * for excluding multiple arrays or iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Array} values The values to exclude. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. */ function baseDifference(array, values, iteratee, comparator) { var index = -1, includes = arrayIncludes, isCommon = true, length = array.length, result = [], valuesLength = values.length; if (!length) { return result; } if (iteratee) { values = arrayMap(values, baseUnary(iteratee)); } if (comparator) { includes = arrayIncludesWith; isCommon = false; } else if (values.length >= LARGE_ARRAY_SIZE) { includes = cacheHas; isCommon = false; values = new SetCache(values); } outer: while (++index < length) { var value = array[index], computed = iteratee == null ? value : iteratee(value); value = (comparator || value !== 0) ? value : 0; if (isCommon && computed === computed) { var valuesIndex = valuesLength; while (valuesIndex--) { if (values[valuesIndex] === computed) { continue outer; } } result.push(value); } else if (!includes(values, computed, comparator)) { result.push(value); } } return result; } module.exports = baseDifference; /***/ }), /***/ 23777: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseEach = __webpack_require__(80909); /** * The base implementation of `_.every` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false` */ function baseEvery(collection, predicate) { var result = true; baseEach(collection, function(value, index, collection) { result = !!predicate(value, index, collection); return result; }); return result; } module.exports = baseEvery; /***/ }), /***/ 16574: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseEach = __webpack_require__(80909); /** * The base implementation of `_.filter` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function baseFilter(collection, predicate) { var result = []; baseEach(collection, function(value, index, collection) { if (predicate(value, index, collection)) { result.push(value); } }); return result; } module.exports = baseFilter; /***/ }), /***/ 53220: /***/ ((module) => { /** * The base implementation of methods like `_.findKey` and `_.findLastKey`, * without support for iteratee shorthands, which iterates over `collection` * using `eachFunc`. * * @private * @param {Array|Object} collection The collection to inspect. * @param {Function} predicate The function invoked per iteration. * @param {Function} eachFunc The function to iterate over `collection`. * @returns {*} Returns the found element or its key, else `undefined`. */ function baseFindKey(collection, predicate, eachFunc) { var result; eachFunc(collection, function(value, key, collection) { if (predicate(value, key, collection)) { result = key; return false; } }); return result; } module.exports = baseFindKey; /***/ }), /***/ 20426: /***/ ((module) => { /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * The base implementation of `_.has` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHas(object, key) { return object != null && hasOwnProperty.call(object, key); } module.exports = baseHas; /***/ }), /***/ 5128: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseEach = __webpack_require__(80909), isArrayLike = __webpack_require__(64894); /** * The base implementation of `_.map` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function baseMap(collection, iteratee) { var index = -1, result = isArrayLike(collection) ? Array(collection.length) : []; baseEach(collection, function(value, key, collection) { result[++index] = iteratee(value, key, collection); }); return result; } module.exports = baseMap; /***/ }), /***/ 46155: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var arrayMap = __webpack_require__(34932), baseGet = __webpack_require__(47422), baseIteratee = __webpack_require__(15389), baseMap = __webpack_require__(5128), baseSortBy = __webpack_require__(73937), baseUnary = __webpack_require__(27301), compareMultiple = __webpack_require__(43714), identity = __webpack_require__(83488), isArray = __webpack_require__(56449); /** * The base implementation of `_.orderBy` without param guards. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. * @param {string[]} orders The sort orders of `iteratees`. * @returns {Array} Returns the new sorted array. */ function baseOrderBy(collection, iteratees, orders) { if (iteratees.length) { iteratees = arrayMap(iteratees, function(iteratee) { if (isArray(iteratee)) { return function(value) { return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); } } return iteratee; }); } else { iteratees = [identity]; } var index = -1; iteratees = arrayMap(iteratees, baseUnary(baseIteratee)); var result = baseMap(collection, function(value, key, collection) { var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); }); return { 'criteria': criteria, 'index': ++index, 'value': value }; }); return baseSortBy(result, function(object, other) { return compareMultiple(object, other, orders); }); } module.exports = baseOrderBy; /***/ }), /***/ 13195: /***/ ((module) => { /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeFloor = Math.floor, nativeRandom = Math.random; /** * The base implementation of `_.random` without support for returning * floating-point numbers. * * @private * @param {number} lower The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the random number. */ function baseRandom(lower, upper) { return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); } module.exports = baseRandom; /***/ }), /***/ 85558: /***/ ((module) => { /** * The base implementation of `_.reduce` and `_.reduceRight`, without support * for iteratee shorthands, which iterates over `collection` using `eachFunc`. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} accumulator The initial value. * @param {boolean} initAccum Specify using the first or last element of * `collection` as the initial value. * @param {Function} eachFunc The function to iterate over `collection`. * @returns {*} Returns the accumulated value. */ function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { eachFunc(collection, function(value, index, collection) { accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection); }); return accumulator; } module.exports = baseReduce; /***/ }), /***/ 4171: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var shuffleSelf = __webpack_require__(7410), values = __webpack_require__(35880); /** * The base implementation of `_.shuffle`. * * @private * @param {Array|Object} collection The collection to shuffle. * @returns {Array} Returns the new shuffled array. */ function baseShuffle(collection) { return shuffleSelf(values(collection)); } module.exports = baseShuffle; /***/ }), /***/ 73937: /***/ ((module) => { /** * The base implementation of `_.sortBy` which uses `comparer` to define the * sort order of `array` and replaces criteria objects with their corresponding * values. * * @private * @param {Array} array The array to sort. * @param {Function} comparer The function to define sort order. * @returns {Array} Returns `array`. */ function baseSortBy(array, comparer) { var length = array.length; array.sort(comparer); while (length--) { array[length] = array[length].value; } return array; } module.exports = baseSortBy; /***/ }), /***/ 30514: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var arrayMap = __webpack_require__(34932); /** * The base implementation of `_.values` and `_.valuesIn` which creates an * array of `object` property values corresponding to the property names * of `props`. * * @private * @param {Object} object The object to query. * @param {Array} props The property names to get values for. * @returns {Object} Returns the array of property values. */ function baseValues(object, props) { return arrayMap(props, function(key) { return object[key]; }); } module.exports = baseValues; /***/ }), /***/ 51234: /***/ ((module) => { /** * This base implementation of `_.zipObject` which assigns values using `assignFunc`. * * @private * @param {Array} props The property identifiers. * @param {Array} values The property values. * @param {Function} assignFunc The function to assign values. * @returns {Object} Returns the new object. */ function baseZipObject(props, values, assignFunc) { var index = -1, length = props.length, valsLength = values.length, result = {}; while (++index < length) { var value = index < valsLength ? values[index] : undefined; assignFunc(result, props[index], value); } return result; } module.exports = baseZipObject; /***/ }), /***/ 23875: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseIndexOf = __webpack_require__(96131); /** * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol * that is not found in the character symbols. * * @private * @param {Array} strSymbols The string symbols to inspect. * @param {Array} chrSymbols The character symbols to find. * @returns {number} Returns the index of the last unmatched string symbol. */ function charsEndIndex(strSymbols, chrSymbols) { var index = strSymbols.length; while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} return index; } module.exports = charsEndIndex; /***/ }), /***/ 28380: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseIndexOf = __webpack_require__(96131); /** * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol * that is not found in the character symbols. * * @private * @param {Array} strSymbols The string symbols to inspect. * @param {Array} chrSymbols The character symbols to find. * @returns {number} Returns the index of the first unmatched string symbol. */ function charsStartIndex(strSymbols, chrSymbols) { var index = -1, length = strSymbols.length; while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} return index; } module.exports = charsStartIndex; /***/ }), /***/ 53730: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isSymbol = __webpack_require__(44394); /** * Compares values to sort them in ascending order. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {number} Returns the sort order indicator for `value`. */ function compareAscending(value, other) { if (value !== other) { var valIsDefined = value !== undefined, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value); var othIsDefined = other !== undefined, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other); if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || (valIsNull && othIsDefined && othIsReflexive) || (!valIsDefined && othIsReflexive) || !valIsReflexive) { return 1; } if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || (othIsNull && valIsDefined && valIsReflexive) || (!othIsDefined && valIsReflexive) || !othIsReflexive) { return -1; } } return 0; } module.exports = compareAscending; /***/ }), /***/ 43714: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var compareAscending = __webpack_require__(53730); /** * Used by `_.orderBy` to compare multiple properties of a value to another * and stable sort them. * * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, * specify an order of "desc" for descending or "asc" for ascending sort order * of corresponding values. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {boolean[]|string[]} orders The order to sort by for each property. * @returns {number} Returns the sort order indicator for `object`. */ function compareMultiple(object, other, orders) { var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length; while (++index < length) { var result = compareAscending(objCriteria[index], othCriteria[index]); if (result) { if (index >= ordersLength) { return result; } var order = orders[index]; return result * (order == 'desc' ? -1 : 1); } } // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications // that causes it, under certain circumstances, to provide the same value for // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 // for more details. // // This also ensures a stable sort in V8 and other engines. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. return object.index - other.index; } module.exports = compareMultiple; /***/ }), /***/ 42000: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var arrayAggregator = __webpack_require__(63945), baseAggregator = __webpack_require__(84810), baseIteratee = __webpack_require__(15389), isArray = __webpack_require__(56449); /** * Creates a function like `_.groupBy`. * * @private * @param {Function} setter The function to set accumulator values. * @param {Function} [initializer] The accumulator object initializer. * @returns {Function} Returns the new aggregator function. */ function createAggregator(setter, initializer) { return function(collection, iteratee) { var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {}; return func(collection, setter, baseIteratee(iteratee, 2), accumulator); }; } module.exports = createAggregator; /***/ }), /***/ 7410: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseRandom = __webpack_require__(13195); /** * A specialized version of `_.shuffle` which mutates and sets the size of `array`. * * @private * @param {Array} array The array to shuffle. * @param {number} [size=array.length] The size of `array`. * @returns {Array} Returns `array`. */ function shuffleSelf(array, size) { var index = -1, length = array.length, lastIndex = length - 1; size = size === undefined ? length : size; while (++index < size) { var rand = baseRandom(index, lastIndex), value = array[rand]; array[rand] = array[index]; array[index] = value; } array.length = size; return array; } module.exports = shuffleSelf; /***/ }), /***/ 21013: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseSlice = __webpack_require__(25160), isIterateeCall = __webpack_require__(36800), toInteger = __webpack_require__(61489); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeCeil = Math.ceil, nativeMax = Math.max; /** * Creates an array of elements split into groups the length of `size`. * If `array` can't be split evenly, the final chunk will be the remaining * elements. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to process. * @param {number} [size=1] The length of each chunk * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the new array of chunks. * @example * * _.chunk(['a', 'b', 'c', 'd'], 2); * // => [['a', 'b'], ['c', 'd']] * * _.chunk(['a', 'b', 'c', 'd'], 3); * // => [['a', 'b', 'c'], ['d']] */ function chunk(array, size, guard) { if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { size = 1; } else { size = nativeMax(toInteger(size), 0); } var length = array == null ? 0 : array.length; if (!length || size < 1) { return []; } var index = 0, resIndex = 0, result = Array(nativeCeil(length / size)); while (index < length) { result[resIndex++] = baseSlice(array, index, (index += size)); } return result; } module.exports = chunk; /***/ }), /***/ 78659: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseClamp = __webpack_require__(87133), toNumber = __webpack_require__(99374); /** * Clamps `number` within the inclusive `lower` and `upper` bounds. * * @static * @memberOf _ * @since 4.0.0 * @category Number * @param {number} number The number to clamp. * @param {number} [lower] The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the clamped number. * @example * * _.clamp(-10, -5, 5); * // => -5 * * _.clamp(10, -5, 5); * // => 5 */ function clamp(number, lower, upper) { if (upper === undefined) { upper = lower; lower = undefined; } if (upper !== undefined) { upper = toNumber(upper); upper = upper === upper ? upper : 0; } if (lower !== undefined) { lower = toNumber(lower); lower = lower === lower ? lower : 0; } return baseClamp(toNumber(number), lower, upper); } module.exports = clamp; /***/ }), /***/ 83673: /***/ ((module) => { /** * Creates an array with all falsey values removed. The values `false`, `null`, * `0`, `""`, `undefined`, and `NaN` are falsey. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to compact. * @returns {Array} Returns the new array of filtered values. * @example * * _.compact([0, 1, false, 2, '', 3]); * // => [1, 2, 3] */ function compact(array) { var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (value) { result[resIndex++] = value; } } return result; } module.exports = compact; /***/ }), /***/ 92078: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var arrayPush = __webpack_require__(14528), baseFlatten = __webpack_require__(83120), copyArray = __webpack_require__(23007), isArray = __webpack_require__(56449); /** * Creates a new array concatenating `array` with any additional arrays * and/or values. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to concatenate. * @param {...*} [values] The values to concatenate. * @returns {Array} Returns the new concatenated array. * @example * * var array = [1]; * var other = _.concat(array, 2, [3], [[4]]); * * console.log(other); * // => [1, 2, 3, [4]] * * console.log(array); * // => [1] */ function concat() { var length = arguments.length; if (!length) { return []; } var args = Array(length - 1), array = arguments[0], index = length; while (index--) { args[index - 1] = arguments[index]; } return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); } module.exports = concat; /***/ }), /***/ 64889: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseDifference = __webpack_require__(83915), baseFlatten = __webpack_require__(83120), baseRest = __webpack_require__(69302), isArrayLikeObject = __webpack_require__(83693), last = __webpack_require__(68090); /** * This method is like `_.difference` except that it accepts `comparator` * which is invoked to compare elements of `array` to `values`. The order and * references of result values are determined by the first array. The comparator * is invoked with two arguments: (arrVal, othVal). * * **Note:** Unlike `_.pullAllWith`, this method returns a new array. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); * // => [{ 'x': 2, 'y': 1 }] */ var differenceWith = baseRest(function(array, values) { var comparator = last(values); if (isArrayLikeObject(comparator)) { comparator = undefined; } return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) : []; }); module.exports = differenceWith; /***/ }), /***/ 19747: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var arrayEvery = __webpack_require__(17277), baseEvery = __webpack_require__(23777), baseIteratee = __webpack_require__(15389), isArray = __webpack_require__(56449), isIterateeCall = __webpack_require__(36800); /** * Checks if `predicate` returns truthy for **all** elements of `collection`. * Iteration is stopped once `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index|key, collection). * * **Note:** This method returns `true` for * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of * elements of empty collections. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false`. * @example * * _.every([true, 1, null, 'yes'], Boolean); * // => false * * var users = [ * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': false } * ]; * * // The `_.matches` iteratee shorthand. * _.every(users, { 'user': 'barney', 'active': false }); * // => false * * // The `_.matchesProperty` iteratee shorthand. * _.every(users, ['active', false]); * // => true * * // The `_.property` iteratee shorthand. * _.every(users, 'active'); * // => false */ function every(collection, predicate, guard) { var func = isArray(collection) ? arrayEvery : baseEvery; if (guard && isIterateeCall(collection, predicate, guard)) { predicate = undefined; } return func(collection, baseIteratee(predicate, 3)); } module.exports = every; /***/ }), /***/ 87612: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var arrayFilter = __webpack_require__(79770), baseFilter = __webpack_require__(16574), baseIteratee = __webpack_require__(15389), isArray = __webpack_require__(56449); /** * Iterates over elements of `collection`, returning an array of all elements * `predicate` returns truthy for. The predicate is invoked with three * arguments: (value, index|key, collection). * * **Note:** Unlike `_.remove`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @see _.reject * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': true }, * { 'user': 'fred', 'age': 40, 'active': false } * ]; * * _.filter(users, function(o) { return !o.active; }); * // => objects for ['fred'] * * // The `_.matches` iteratee shorthand. * _.filter(users, { 'age': 36, 'active': true }); * // => objects for ['barney'] * * // The `_.matchesProperty` iteratee shorthand. * _.filter(users, ['active', false]); * // => objects for ['fred'] * * // The `_.property` iteratee shorthand. * _.filter(users, 'active'); * // => objects for ['barney'] * * // Combining several predicates using `_.overEvery` or `_.overSome`. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); * // => objects for ['fred', 'barney'] */ function filter(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; return func(collection, baseIteratee(predicate, 3)); } module.exports = filter; /***/ }), /***/ 7309: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var createFind = __webpack_require__(62006), findIndex = __webpack_require__(24713); /** * Iterates over elements of `collection`, returning the first element * `predicate` returns truthy for. The predicate is invoked with three * arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {*} Returns the matched element, else `undefined`. * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': true }, * { 'user': 'fred', 'age': 40, 'active': false }, * { 'user': 'pebbles', 'age': 1, 'active': true } * ]; * * _.find(users, function(o) { return o.age < 40; }); * // => object for 'barney' * * // The `_.matches` iteratee shorthand. * _.find(users, { 'age': 1, 'active': true }); * // => object for 'pebbles' * * // The `_.matchesProperty` iteratee shorthand. * _.find(users, ['active', false]); * // => object for 'fred' * * // The `_.property` iteratee shorthand. * _.find(users, 'active'); * // => object for 'barney' */ var find = createFind(findIndex); module.exports = find; /***/ }), /***/ 24713: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseFindIndex = __webpack_require__(2523), baseIteratee = __webpack_require__(15389), toInteger = __webpack_require__(61489); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; /** * This method is like `_.find` except that it returns the index of the first * element `predicate` returns truthy for instead of the element itself. * * @static * @memberOf _ * @since 1.1.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. * @example * * var users = [ * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': true } * ]; * * _.findIndex(users, function(o) { return o.user == 'barney'; }); * // => 0 * * // The `_.matches` iteratee shorthand. * _.findIndex(users, { 'user': 'fred', 'active': false }); * // => 1 * * // The `_.matchesProperty` iteratee shorthand. * _.findIndex(users, ['active', false]); * // => 0 * * // The `_.property` iteratee shorthand. * _.findIndex(users, 'active'); * // => 2 */ function findIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = fromIndex == null ? 0 : toInteger(fromIndex); if (index < 0) { index = nativeMax(length + index, 0); } return baseFindIndex(array, baseIteratee(predicate, 3), index); } module.exports = findIndex; /***/ }), /***/ 20826: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseFindKey = __webpack_require__(53220), baseForOwn = __webpack_require__(30641), baseIteratee = __webpack_require__(15389); /** * This method is like `_.find` except that it returns the key of the first * element `predicate` returns truthy for instead of the element itself. * * @static * @memberOf _ * @since 1.1.0 * @category Object * @param {Object} object The object to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {string|undefined} Returns the key of the matched element, * else `undefined`. * @example * * var users = { * 'barney': { 'age': 36, 'active': true }, * 'fred': { 'age': 40, 'active': false }, * 'pebbles': { 'age': 1, 'active': true } * }; * * _.findKey(users, function(o) { return o.age < 40; }); * // => 'barney' (iteration order is not guaranteed) * * // The `_.matches` iteratee shorthand. * _.findKey(users, { 'age': 1, 'active': true }); * // => 'pebbles' * * // The `_.matchesProperty` iteratee shorthand. * _.findKey(users, ['active', false]); * // => 'fred' * * // The `_.property` iteratee shorthand. * _.findKey(users, 'active'); * // => 'barney' */ function findKey(object, predicate) { return baseFindKey(object, baseIteratee(predicate, 3), baseForOwn); } module.exports = findKey; /***/ }), /***/ 94394: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseAssignValue = __webpack_require__(43360), createAggregator = __webpack_require__(42000); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The order of grouped values * is determined by the order they occur in `collection`. The corresponding * value of each key is an array of elements responsible for generating the * key. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * * _.groupBy([6.1, 4.2, 6.3], Math.floor); * // => { '4': [4.2], '6': [6.1, 6.3] } * * // The `_.property` iteratee shorthand. * _.groupBy(['one', 'two', 'three'], 'length'); * // => { '3': ['one', 'two'], '5': ['three'] } */ var groupBy = createAggregator(function(result, value, key) { if (hasOwnProperty.call(result, key)) { result[key].push(value); } else { baseAssignValue(result, key, [value]); } }); module.exports = groupBy; /***/ }), /***/ 61448: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseHas = __webpack_require__(20426), hasPath = __webpack_require__(49326); /** * Checks if `path` is a direct property of `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * * var object = { 'a': { 'b': 2 } }; * var other = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.has(object, 'a'); * // => true * * _.has(object, 'a.b'); * // => true * * _.has(object, ['a', 'b']); * // => true * * _.has(other, 'a'); * // => false */ function has(object, path) { return object != null && hasPath(object, path, baseHas); } module.exports = has; /***/ }), /***/ 79859: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseIndexOf = __webpack_require__(96131), isArrayLike = __webpack_require__(64894), isString = __webpack_require__(85015), toInteger = __webpack_require__(61489), values = __webpack_require__(35880); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; /** * Checks if `value` is in `collection`. If `collection` is a string, it's * checked for a substring of `value`, otherwise * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * is used for equality comparisons. If `fromIndex` is negative, it's used as * the offset from the end of `collection`. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object|string} collection The collection to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. * @returns {boolean} Returns `true` if `value` is found, else `false`. * @example * * _.includes([1, 2, 3], 1); * // => true * * _.includes([1, 2, 3], 1, 2); * // => false * * _.includes({ 'a': 1, 'b': 2 }, 1); * // => true * * _.includes('abcd', 'bc'); * // => true */ function includes(collection, value, fromIndex, guard) { collection = isArrayLike(collection) ? collection : values(collection); fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; var length = collection.length; if (fromIndex < 0) { fromIndex = nativeMax(length + fromIndex, 0); } return isString(collection) ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) : (!!length && baseIndexOf(collection, value, fromIndex) > -1); } module.exports = includes; /***/ }), /***/ 85015: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseGetTag = __webpack_require__(72552), isArray = __webpack_require__(56449), isObjectLike = __webpack_require__(40346); /** `Object#toString` result references. */ var stringTag = '[object String]'; /** * Checks if `value` is classified as a `String` primitive or object. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a string, else `false`. * @example * * _.isString('abc'); * // => true * * _.isString(1); * // => false */ function isString(value) { return typeof value == 'string' || (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); } module.exports = isString; /***/ }), /***/ 20249: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var createCompounder = __webpack_require__(45539); /** * Converts `string` to * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the kebab cased string. * @example * * _.kebabCase('Foo Bar'); * // => 'foo-bar' * * _.kebabCase('fooBar'); * // => 'foo-bar' * * _.kebabCase('__FOO_BAR__'); * // => 'foo-bar' */ var kebabCase = createCompounder(function(result, word, index) { return result + (index ? '-' : '') + word.toLowerCase(); }); module.exports = kebabCase; /***/ }), /***/ 55378: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var arrayMap = __webpack_require__(34932), baseIteratee = __webpack_require__(15389), baseMap = __webpack_require__(5128), isArray = __webpack_require__(56449); /** * Creates an array of values by running each element in `collection` thru * `iteratee`. The iteratee is invoked with three arguments: * (value, index|key, collection). * * Many lodash methods are guarded to work as iteratees for methods like * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. * * The guarded methods are: * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, * `template`, `trim`, `trimEnd`, `trimStart`, and `words` * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new mapped array. * @example * * function square(n) { * return n * n; * } * * _.map([4, 8], square); * // => [16, 64] * * _.map({ 'a': 4, 'b': 8 }, square); * // => [16, 64] (iteration order is not guaranteed) * * var users = [ * { 'user': 'barney' }, * { 'user': 'fred' } * ]; * * // The `_.property` iteratee shorthand. * _.map(users, 'user'); * // => ['barney', 'fred'] */ function map(collection, iteratee) { var func = isArray(collection) ? arrayMap : baseMap; return func(collection, baseIteratee(iteratee, 3)); } module.exports = map; /***/ }), /***/ 42877: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseOrderBy = __webpack_require__(46155), isArray = __webpack_require__(56449); /** * This method is like `_.sortBy` except that it allows specifying the sort * orders of the iteratees to sort by. If `orders` is unspecified, all values * are sorted in ascending order. Otherwise, specify an order of "desc" for * descending or "asc" for ascending sort order of corresponding values. * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] * The iteratees to sort by. * @param {string[]} [orders] The sort orders of `iteratees`. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. * @returns {Array} Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 34 }, * { 'user': 'fred', 'age': 40 }, * { 'user': 'barney', 'age': 36 } * ]; * * // Sort by `user` in ascending order and by `age` in descending order. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] */ function orderBy(collection, iteratees, orders, guard) { if (collection == null) { return []; } if (!isArray(iteratees)) { iteratees = iteratees == null ? [] : [iteratees]; } orders = guard ? undefined : orders; if (!isArray(orders)) { orders = orders == null ? [] : [orders]; } return baseOrderBy(collection, iteratees, orders); } module.exports = orderBy; /***/ }), /***/ 40860: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var arrayReduce = __webpack_require__(40882), baseEach = __webpack_require__(80909), baseIteratee = __webpack_require__(15389), baseReduce = __webpack_require__(85558), isArray = __webpack_require__(56449); /** * Reduces `collection` to a value which is the accumulated result of running * each element in `collection` thru `iteratee`, where each successive * invocation is supplied the return value of the previous. If `accumulator` * is not given, the first element of `collection` is used as the initial * value. The iteratee is invoked with four arguments: * (accumulator, value, index|key, collection). * * Many lodash methods are guarded to work as iteratees for methods like * `_.reduce`, `_.reduceRight`, and `_.transform`. * * The guarded methods are: * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, * and `sortBy` * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The initial value. * @returns {*} Returns the accumulated value. * @see _.reduceRight * @example * * _.reduce([1, 2], function(sum, n) { * return sum + n; * }, 0); * // => 3 * * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { * (result[value] || (result[value] = [])).push(key); * return result; * }, {}); * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) */ function reduce(collection, iteratee, accumulator) { var func = isArray(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3; return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach); } module.exports = reduce; /***/ }), /***/ 36049: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var arrayShuffle = __webpack_require__(18567), baseShuffle = __webpack_require__(4171), isArray = __webpack_require__(56449); /** * Creates an array of shuffled values, using a version of the * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to shuffle. * @returns {Array} Returns the new shuffled array. * @example * * _.shuffle([1, 2, 3, 4]); * // => [4, 1, 3, 2] */ function shuffle(collection) { var func = isArray(collection) ? arrayShuffle : baseShuffle; return func(collection); } module.exports = shuffle; /***/ }), /***/ 4124: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var createCompounder = __webpack_require__(45539); /** * Converts `string` to * [snake case](https://en.wikipedia.org/wiki/Snake_case). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the snake cased string. * @example * * _.snakeCase('Foo Bar'); * // => 'foo_bar' * * _.snakeCase('fooBar'); * // => 'foo_bar' * * _.snakeCase('--FOO-BAR--'); * // => 'foo_bar' */ var snakeCase = createCompounder(function(result, word, index) { return result + (index ? '_' : '') + word.toLowerCase(); }); module.exports = snakeCase; /***/ }), /***/ 33031: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseFlatten = __webpack_require__(83120), baseOrderBy = __webpack_require__(46155), baseRest = __webpack_require__(69302), isIterateeCall = __webpack_require__(36800); /** * Creates an array of elements, sorted in ascending order by the results of * running each element in a collection thru each iteratee. This method * performs a stable sort, that is, it preserves the original sort order of * equal elements. The iteratees are invoked with one argument: (value). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {...(Function|Function[])} [iteratees=[_.identity]] * The iteratees to sort by. * @returns {Array} Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 30 }, * { 'user': 'barney', 'age': 34 } * ]; * * _.sortBy(users, [function(o) { return o.user; }]); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] * * _.sortBy(users, ['user', 'age']); * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] */ var sortBy = baseRest(function(collection, iteratees) { if (collection == null) { return []; } var length = iteratees.length; if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { iteratees = []; } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { iteratees = [iteratees[0]]; } return baseOrderBy(collection, baseFlatten(iteratees, 1), []); }); module.exports = sortBy; /***/ }), /***/ 90128: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var createCompounder = __webpack_require__(45539), upperFirst = __webpack_require__(55808); /** * Converts `string` to * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). * * @static * @memberOf _ * @since 3.1.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the start cased string. * @example * * _.startCase('--foo-bar--'); * // => 'Foo Bar' * * _.startCase('fooBar'); * // => 'Foo Bar' * * _.startCase('__FOO_BAR__'); * // => 'FOO BAR' */ var startCase = createCompounder(function(result, word, index) { return result + (index ? ' ' : '') + upperFirst(word); }); module.exports = startCase; /***/ }), /***/ 69752: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var arrayEach = __webpack_require__(83729), baseCreate = __webpack_require__(39344), baseForOwn = __webpack_require__(30641), baseIteratee = __webpack_require__(15389), getPrototype = __webpack_require__(28879), isArray = __webpack_require__(56449), isBuffer = __webpack_require__(3656), isFunction = __webpack_require__(1882), isObject = __webpack_require__(23805), isTypedArray = __webpack_require__(37167); /** * An alternative to `_.reduce`; this method transforms `object` to a new * `accumulator` object which is the result of running each of its own * enumerable string keyed properties thru `iteratee`, with each invocation * potentially mutating the `accumulator` object. If `accumulator` is not * provided, a new object with the same `[[Prototype]]` will be used. The * iteratee is invoked with four arguments: (accumulator, value, key, object). * Iteratee functions may exit iteration early by explicitly returning `false`. * * @static * @memberOf _ * @since 1.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The custom accumulator value. * @returns {*} Returns the accumulated value. * @example * * _.transform([2, 3, 4], function(result, n) { * result.push(n *= n); * return n % 2 == 0; * }, []); * // => [4, 9] * * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { * (result[value] || (result[value] = [])).push(key); * }, {}); * // => { '1': ['a', 'c'], '2': ['b'] } */ function transform(object, iteratee, accumulator) { var isArr = isArray(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object); iteratee = baseIteratee(iteratee, 4); if (accumulator == null) { var Ctor = object && object.constructor; if (isArrLike) { accumulator = isArr ? new Ctor : []; } else if (isObject(object)) { accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; } else { accumulator = {}; } } (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { return iteratee(accumulator, value, index, object); }); return accumulator; } module.exports = transform; /***/ }), /***/ 44826: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseToString = __webpack_require__(77556), baseTrim = __webpack_require__(54128), castSlice = __webpack_require__(28754), charsEndIndex = __webpack_require__(23875), charsStartIndex = __webpack_require__(28380), stringToArray = __webpack_require__(63912), toString = __webpack_require__(13222); /** * Removes leading and trailing whitespace or specified characters from `string`. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to trim. * @param {string} [chars=whitespace] The characters to trim. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the trimmed string. * @example * * _.trim(' abc '); * // => 'abc' * * _.trim('-_-abc-_-', '_-'); * // => 'abc' * * _.map([' foo ', ' bar '], _.trim); * // => ['foo', 'bar'] */ function trim(string, chars, guard) { string = toString(string); if (string && (guard || chars === undefined)) { return baseTrim(string); } if (!string || !(chars = baseToString(chars))) { return string; } var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start = charsStartIndex(strSymbols, chrSymbols), end = charsEndIndex(strSymbols, chrSymbols) + 1; return castSlice(strSymbols, start, end).join(''); } module.exports = trim; /***/ }), /***/ 63375: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseUniq = __webpack_require__(55765); /** * Creates a duplicate-free version of an array, using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons, in which only the first occurrence of each element * is kept. The order of result values is determined by the order they occur * in the array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @returns {Array} Returns the new duplicate free array. * @example * * _.uniq([2, 1, 2]); * // => [2, 1] */ function uniq(array) { return (array && array.length) ? baseUniq(array) : []; } module.exports = uniq; /***/ }), /***/ 35880: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseValues = __webpack_require__(30514), keys = __webpack_require__(95950); /** * Creates an array of the own enumerable string keyed property values of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property values. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.values(new Foo); * // => [1, 2] (iteration order is not guaranteed) * * _.values('hi'); * // => ['h', 'i'] */ function values(object) { return object == null ? [] : baseValues(object, keys(object)); } module.exports = values; /***/ }), /***/ 47248: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var assignValue = __webpack_require__(16547), baseZipObject = __webpack_require__(51234); /** * This method is like `_.fromPairs` except that it accepts two arrays, * one of property identifiers and one of corresponding values. * * @static * @memberOf _ * @since 0.4.0 * @category Array * @param {Array} [props=[]] The property identifiers. * @param {Array} [values=[]] The property values. * @returns {Object} Returns the new object. * @example * * _.zipObject(['a', 'b'], [1, 2]); * // => { 'a': 1, 'b': 2 } */ function zipObject(props, values) { return baseZipObject(props || [], values || [], assignValue); } module.exports = zipObject; /***/ }), /***/ 84743: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var moment = module.exports = __webpack_require__(56639); moment.tz.load(__webpack_require__(35878)); /***/ }), /***/ 56639: /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;//! moment-timezone.js //! version : 0.5.43 //! Copyright (c) JS Foundation and other contributors //! license : MIT //! github.com/moment/moment-timezone (function (root, factory) { "use strict"; /*global define*/ if ( true && module.exports) { module.exports = factory(__webpack_require__(95093)); // Node } else if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(95093)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); // AMD } else {} }(this, function (moment) { "use strict"; // Resolves es6 module loading issue if (moment.version === undefined && moment.default) { moment = moment.default; } // Do not load moment-timezone a second time. // if (moment.tz !== undefined) { // logError('Moment Timezone ' + moment.tz.version + ' was already loaded ' + (moment.tz.dataVersion ? 'with data from ' : 'without any data') + moment.tz.dataVersion); // return moment; // } var VERSION = "0.5.43", zones = {}, links = {}, countries = {}, names = {}, guesses = {}, cachedGuess; if (!moment || typeof moment.version !== 'string') { logError('Moment Timezone requires Moment.js. See https://momentjs.com/timezone/docs/#/use-it/browser/'); } var momentVersion = moment.version.split('.'), major = +momentVersion[0], minor = +momentVersion[1]; // Moment.js version check if (major < 2 || (major === 2 && minor < 6)) { logError('Moment Timezone requires Moment.js >= 2.6.0. You are using Moment.js ' + moment.version + '. See momentjs.com'); } /************************************ Unpacking ************************************/ function charCodeToInt(charCode) { if (charCode > 96) { return charCode - 87; } else if (charCode > 64) { return charCode - 29; } return charCode - 48; } function unpackBase60(string) { var i = 0, parts = string.split('.'), whole = parts[0], fractional = parts[1] || '', multiplier = 1, num, out = 0, sign = 1; // handle negative numbers if (string.charCodeAt(0) === 45) { i = 1; sign = -1; } // handle digits before the decimal for (i; i < whole.length; i++) { num = charCodeToInt(whole.charCodeAt(i)); out = 60 * out + num; } // handle digits after the decimal for (i = 0; i < fractional.length; i++) { multiplier = multiplier / 60; num = charCodeToInt(fractional.charCodeAt(i)); out += num * multiplier; } return out * sign; } function arrayToInt (array) { for (var i = 0; i < array.length; i++) { array[i] = unpackBase60(array[i]); } } function intToUntil (array, length) { for (var i = 0; i < length; i++) { array[i] = Math.round((array[i - 1] || 0) + (array[i] * 60000)); // minutes to milliseconds } array[length - 1] = Infinity; } function mapIndices (source, indices) { var out = [], i; for (i = 0; i < indices.length; i++) { out[i] = source[indices[i]]; } return out; } function unpack (string) { var data = string.split('|'), offsets = data[2].split(' '), indices = data[3].split(''), untils = data[4].split(' '); arrayToInt(offsets); arrayToInt(indices); arrayToInt(untils); intToUntil(untils, indices.length); return { name : data[0], abbrs : mapIndices(data[1].split(' '), indices), offsets : mapIndices(offsets, indices), untils : untils, population : data[5] | 0 }; } /************************************ Zone object ************************************/ function Zone (packedString) { if (packedString) { this._set(unpack(packedString)); } } Zone.prototype = { _set : function (unpacked) { this.name = unpacked.name; this.abbrs = unpacked.abbrs; this.untils = unpacked.untils; this.offsets = unpacked.offsets; this.population = unpacked.population; }, _index : function (timestamp) { var target = +timestamp, untils = this.untils, i; for (i = 0; i < untils.length; i++) { if (target < untils[i]) { return i; } } }, countries : function () { var zone_name = this.name; return Object.keys(countries).filter(function (country_code) { return countries[country_code].zones.indexOf(zone_name) !== -1; }); }, parse : function (timestamp) { var target = +timestamp, offsets = this.offsets, untils = this.untils, max = untils.length - 1, offset, offsetNext, offsetPrev, i; for (i = 0; i < max; i++) { offset = offsets[i]; offsetNext = offsets[i + 1]; offsetPrev = offsets[i ? i - 1 : i]; if (offset < offsetNext && tz.moveAmbiguousForward) { offset = offsetNext; } else if (offset > offsetPrev && tz.moveInvalidForward) { offset = offsetPrev; } if (target < untils[i] - (offset * 60000)) { return offsets[i]; } } return offsets[max]; }, abbr : function (mom) { return this.abbrs[this._index(mom)]; }, offset : function (mom) { logError("zone.offset has been deprecated in favor of zone.utcOffset"); return this.offsets[this._index(mom)]; }, utcOffset : function (mom) { return this.offsets[this._index(mom)]; } }; /************************************ Country object ************************************/ function Country (country_name, zone_names) { this.name = country_name; this.zones = zone_names; } /************************************ Current Timezone ************************************/ function OffsetAt(at) { var timeString = at.toTimeString(); var abbr = timeString.match(/\([a-z ]+\)/i); if (abbr && abbr[0]) { // 17:56:31 GMT-0600 (CST) // 17:56:31 GMT-0600 (Central Standard Time) abbr = abbr[0].match(/[A-Z]/g); abbr = abbr ? abbr.join('') : undefined; } else { // 17:56:31 CST // 17:56:31 GMT+0800 (台北標準時間) abbr = timeString.match(/[A-Z]{3,5}/g); abbr = abbr ? abbr[0] : undefined; } if (abbr === 'GMT') { abbr = undefined; } this.at = +at; this.abbr = abbr; this.offset = at.getTimezoneOffset(); } function ZoneScore(zone) { this.zone = zone; this.offsetScore = 0; this.abbrScore = 0; } ZoneScore.prototype.scoreOffsetAt = function (offsetAt) { this.offsetScore += Math.abs(this.zone.utcOffset(offsetAt.at) - offsetAt.offset); if (this.zone.abbr(offsetAt.at).replace(/[^A-Z]/g, '') !== offsetAt.abbr) { this.abbrScore++; } }; function findChange(low, high) { var mid, diff; while ((diff = ((high.at - low.at) / 12e4 | 0) * 6e4)) { mid = new OffsetAt(new Date(low.at + diff)); if (mid.offset === low.offset) { low = mid; } else { high = mid; } } return low; } function userOffsets() { var startYear = new Date().getFullYear() - 2, last = new OffsetAt(new Date(startYear, 0, 1)), offsets = [last], change, next, i; for (i = 1; i < 48; i++) { next = new OffsetAt(new Date(startYear, i, 1)); if (next.offset !== last.offset) { change = findChange(last, next); offsets.push(change); offsets.push(new OffsetAt(new Date(change.at + 6e4))); } last = next; } for (i = 0; i < 4; i++) { offsets.push(new OffsetAt(new Date(startYear + i, 0, 1))); offsets.push(new OffsetAt(new Date(startYear + i, 6, 1))); } return offsets; } function sortZoneScores (a, b) { if (a.offsetScore !== b.offsetScore) { return a.offsetScore - b.offsetScore; } if (a.abbrScore !== b.abbrScore) { return a.abbrScore - b.abbrScore; } if (a.zone.population !== b.zone.population) { return b.zone.population - a.zone.population; } return b.zone.name.localeCompare(a.zone.name); } function addToGuesses (name, offsets) { var i, offset; arrayToInt(offsets); for (i = 0; i < offsets.length; i++) { offset = offsets[i]; guesses[offset] = guesses[offset] || {}; guesses[offset][name] = true; } } function guessesForUserOffsets (offsets) { var offsetsLength = offsets.length, filteredGuesses = {}, out = [], i, j, guessesOffset; for (i = 0; i < offsetsLength; i++) { guessesOffset = guesses[offsets[i].offset] || {}; for (j in guessesOffset) { if (guessesOffset.hasOwnProperty(j)) { filteredGuesses[j] = true; } } } for (i in filteredGuesses) { if (filteredGuesses.hasOwnProperty(i)) { out.push(names[i]); } } return out; } function rebuildGuess () { // use Intl API when available and returning valid time zone try { var intlName = Intl.DateTimeFormat().resolvedOptions().timeZone; if (intlName && intlName.length > 3) { var name = names[normalizeName(intlName)]; if (name) { return name; } logError("Moment Timezone found " + intlName + " from the Intl api, but did not have that data loaded."); } } catch (e) { // Intl unavailable, fall back to manual guessing. } var offsets = userOffsets(), offsetsLength = offsets.length, guesses = guessesForUserOffsets(offsets), zoneScores = [], zoneScore, i, j; for (i = 0; i < guesses.length; i++) { zoneScore = new ZoneScore(getZone(guesses[i]), offsetsLength); for (j = 0; j < offsetsLength; j++) { zoneScore.scoreOffsetAt(offsets[j]); } zoneScores.push(zoneScore); } zoneScores.sort(sortZoneScores); return zoneScores.length > 0 ? zoneScores[0].zone.name : undefined; } function guess (ignoreCache) { if (!cachedGuess || ignoreCache) { cachedGuess = rebuildGuess(); } return cachedGuess; } /************************************ Global Methods ************************************/ function normalizeName (name) { return (name || '').toLowerCase().replace(/\//g, '_'); } function addZone (packed) { var i, name, split, normalized; if (typeof packed === "string") { packed = [packed]; } for (i = 0; i < packed.length; i++) { split = packed[i].split('|'); name = split[0]; normalized = normalizeName(name); zones[normalized] = packed[i]; names[normalized] = name; addToGuesses(normalized, split[2].split(' ')); } } function getZone (name, caller) { name = normalizeName(name); var zone = zones[name]; var link; if (zone instanceof Zone) { return zone; } if (typeof zone === 'string') { zone = new Zone(zone); zones[name] = zone; return zone; } // Pass getZone to prevent recursion more than 1 level deep if (links[name] && caller !== getZone && (link = getZone(links[name], getZone))) { zone = zones[name] = new Zone(); zone._set(link); zone.name = names[name]; return zone; } return null; } function getNames () { var i, out = []; for (i in names) { if (names.hasOwnProperty(i) && (zones[i] || zones[links[i]]) && names[i]) { out.push(names[i]); } } return out.sort(); } function getCountryNames () { return Object.keys(countries); } function addLink (aliases) { var i, alias, normal0, normal1; if (typeof aliases === "string") { aliases = [aliases]; } for (i = 0; i < aliases.length; i++) { alias = aliases[i].split('|'); normal0 = normalizeName(alias[0]); normal1 = normalizeName(alias[1]); links[normal0] = normal1; names[normal0] = alias[0]; links[normal1] = normal0; names[normal1] = alias[1]; } } function addCountries (data) { var i, country_code, country_zones, split; if (!data || !data.length) return; for (i = 0; i < data.length; i++) { split = data[i].split('|'); country_code = split[0].toUpperCase(); country_zones = split[1].split(' '); countries[country_code] = new Country( country_code, country_zones ); } } function getCountry (name) { name = name.toUpperCase(); return countries[name] || null; } function zonesForCountry(country, with_offset) { country = getCountry(country); if (!country) return null; var zones = country.zones.sort(); if (with_offset) { return zones.map(function (zone_name) { var zone = getZone(zone_name); return { name: zone_name, offset: zone.utcOffset(new Date()) }; }); } return zones; } function loadData (data) { addZone(data.zones); addLink(data.links); addCountries(data.countries); tz.dataVersion = data.version; } function zoneExists (name) { if (!zoneExists.didShowError) { zoneExists.didShowError = true; logError("moment.tz.zoneExists('" + name + "') has been deprecated in favor of !moment.tz.zone('" + name + "')"); } return !!getZone(name); } function needsOffset (m) { var isUnixTimestamp = (m._f === 'X' || m._f === 'x'); return !!(m._a && (m._tzm === undefined) && !isUnixTimestamp); } function logError (message) { if (typeof console !== 'undefined' && typeof console.error === 'function') { console.error(message); } } /************************************ moment.tz namespace ************************************/ function tz (input) { var args = Array.prototype.slice.call(arguments, 0, -1), name = arguments[arguments.length - 1], zone = getZone(name), out = moment.utc.apply(null, args); if (zone && !moment.isMoment(input) && needsOffset(out)) { out.add(zone.parse(out), 'minutes'); } out.tz(name); return out; } tz.version = VERSION; tz.dataVersion = ''; tz._zones = zones; tz._links = links; tz._names = names; tz._countries = countries; tz.add = addZone; tz.link = addLink; tz.load = loadData; tz.zone = getZone; tz.zoneExists = zoneExists; // deprecated in 0.1.0 tz.guess = guess; tz.names = getNames; tz.Zone = Zone; tz.unpack = unpack; tz.unpackBase60 = unpackBase60; tz.needsOffset = needsOffset; tz.moveInvalidForward = true; tz.moveAmbiguousForward = false; tz.countries = getCountryNames; tz.zonesForCountry = zonesForCountry; /************************************ Interface with Moment.js ************************************/ var fn = moment.fn; moment.tz = tz; moment.defaultZone = null; moment.updateOffset = function (mom, keepTime) { var zone = moment.defaultZone, offset; if (mom._z === undefined) { if (zone && needsOffset(mom) && !mom._isUTC) { mom._d = moment.utc(mom._a)._d; mom.utc().add(zone.parse(mom), 'minutes'); } mom._z = zone; } if (mom._z) { offset = mom._z.utcOffset(mom); if (Math.abs(offset) < 16) { offset = offset / 60; } if (mom.utcOffset !== undefined) { var z = mom._z; mom.utcOffset(-offset, keepTime); mom._z = z; } else { mom.zone(offset, keepTime); } } }; fn.tz = function (name, keepTime) { if (name) { if (typeof name !== 'string') { throw new Error('Time zone name must be a string, got ' + name + ' [' + typeof name + ']'); } this._z = getZone(name); if (this._z) { moment.updateOffset(this, keepTime); } else { logError("Moment Timezone has no data for " + name + ". See http://momentjs.com/timezone/docs/#/data-loading/."); } return this; } if (this._z) { return this._z.name; } }; function abbrWrap (old) { return function () { if (this._z) { return this._z.abbr(this); } return old.call(this); }; } function resetZoneWrap (old) { return function () { this._z = null; return old.apply(this, arguments); }; } function resetZoneWrap2 (old) { return function () { if (arguments.length > 0) this._z = null; return old.apply(this, arguments); }; } fn.zoneName = abbrWrap(fn.zoneName); fn.zoneAbbr = abbrWrap(fn.zoneAbbr); fn.utc = resetZoneWrap(fn.utc); fn.local = resetZoneWrap(fn.local); fn.utcOffset = resetZoneWrap2(fn.utcOffset); moment.tz.setDefault = function(name) { if (major < 2 || (major === 2 && minor < 9)) { logError('Moment Timezone setDefault() requires Moment.js >= 2.9.0. You are using Moment.js ' + moment.version + '.'); } moment.defaultZone = name ? getZone(name) : null; return moment; }; // Cloning a moment should include the _z property. var momentProperties = moment.momentProperties; if (Object.prototype.toString.call(momentProperties) === '[object Array]') { // moment 2.8.1+ momentProperties.push('_z'); momentProperties.push('_a'); } else if (momentProperties) { // moment 2.7.0 momentProperties._z = null; } // INJECT DATA return moment; })); /***/ }), /***/ 26946: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // minimal library entry point. module.exports = __webpack_require__(24394); /***/ }), /***/ 24394: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var protobuf = exports; /** * Build type, one of `"full"`, `"light"` or `"minimal"`. * @name build * @type {string} * @const */ protobuf.build = "minimal"; // Serialization protobuf.Writer = __webpack_require__(63449); protobuf.BufferWriter = __webpack_require__(60818); protobuf.Reader = __webpack_require__(16237); protobuf.BufferReader = __webpack_require__(33158); // Utility protobuf.util = __webpack_require__(93610); protobuf.rpc = __webpack_require__(95047); protobuf.roots = __webpack_require__(64529); protobuf.configure = configure; /* istanbul ignore next */ /** * Reconfigures the library according to the environment. * @returns {undefined} */ function configure() { protobuf.util._configure(); protobuf.Writer._configure(protobuf.BufferWriter); protobuf.Reader._configure(protobuf.BufferReader); } // Set up buffer utility according to the environment configure(); /***/ }), /***/ 16237: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = Reader; var util = __webpack_require__(93610); var BufferReader; // cyclic var LongBits = util.LongBits, utf8 = util.utf8; /* istanbul ignore next */ function indexOutOfRange(reader, writeLength) { return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); } /** * Constructs a new reader instance using the specified buffer. * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. * @constructor * @param {Uint8Array} buffer Buffer to read from */ function Reader(buffer) { /** * Read buffer. * @type {Uint8Array} */ this.buf = buffer; /** * Read buffer position. * @type {number} */ this.pos = 0; /** * Read buffer length. * @type {number} */ this.len = buffer.length; } var create_array = typeof Uint8Array !== "undefined" ? function create_typed_array(buffer) { if (buffer instanceof Uint8Array || Array.isArray(buffer)) return new Reader(buffer); throw Error("illegal buffer"); } /* istanbul ignore next */ : function create_array(buffer) { if (Array.isArray(buffer)) return new Reader(buffer); throw Error("illegal buffer"); }; var create = function create() { return util.Buffer ? function create_buffer_setup(buffer) { return (Reader.create = function create_buffer(buffer) { return util.Buffer.isBuffer(buffer) ? new BufferReader(buffer) /* istanbul ignore next */ : create_array(buffer); })(buffer); } /* istanbul ignore next */ : create_array; }; /** * Creates a new reader using the specified buffer. * @function * @param {Uint8Array|Buffer} buffer Buffer to read from * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} * @throws {Error} If `buffer` is not a valid buffer */ Reader.create = create(); Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice; /** * Reads a varint as an unsigned 32 bit value. * @function * @returns {number} Value read */ Reader.prototype.uint32 = (function read_uint32_setup() { var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!) return function read_uint32() { value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value; value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value; value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value; value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value; value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value; /* istanbul ignore if */ if ((this.pos += 5) > this.len) { this.pos = this.len; throw indexOutOfRange(this, 10); } return value; }; })(); /** * Reads a varint as a signed 32 bit value. * @returns {number} Value read */ Reader.prototype.int32 = function read_int32() { return this.uint32() | 0; }; /** * Reads a zig-zag encoded varint as a signed 32 bit value. * @returns {number} Value read */ Reader.prototype.sint32 = function read_sint32() { var value = this.uint32(); return value >>> 1 ^ -(value & 1) | 0; }; /* eslint-disable no-invalid-this */ function readLongVarint() { // tends to deopt with local vars for octet etc. var bits = new LongBits(0, 0); var i = 0; if (this.len - this.pos > 4) { // fast route (lo) for (; i < 4; ++i) { // 1st..4th bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; if (this.buf[this.pos++] < 128) return bits; } // 5th bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; if (this.buf[this.pos++] < 128) return bits; i = 0; } else { for (; i < 3; ++i) { /* istanbul ignore if */ if (this.pos >= this.len) throw indexOutOfRange(this); // 1st..3th bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; if (this.buf[this.pos++] < 128) return bits; } // 4th bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; return bits; } if (this.len - this.pos > 4) { // fast route (hi) for (; i < 5; ++i) { // 6th..10th bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; if (this.buf[this.pos++] < 128) return bits; } } else { for (; i < 5; ++i) { /* istanbul ignore if */ if (this.pos >= this.len) throw indexOutOfRange(this); // 6th..10th bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; if (this.buf[this.pos++] < 128) return bits; } } /* istanbul ignore next */ throw Error("invalid varint encoding"); } /* eslint-enable no-invalid-this */ /** * Reads a varint as a signed 64 bit value. * @name Reader#int64 * @function * @returns {Long} Value read */ /** * Reads a varint as an unsigned 64 bit value. * @name Reader#uint64 * @function * @returns {Long} Value read */ /** * Reads a zig-zag encoded varint as a signed 64 bit value. * @name Reader#sint64 * @function * @returns {Long} Value read */ /** * Reads a varint as a boolean. * @returns {boolean} Value read */ Reader.prototype.bool = function read_bool() { return this.uint32() !== 0; }; function readFixed32_end(buf, end) { // note that this uses `end`, not `pos` return (buf[end - 4] | buf[end - 3] << 8 | buf[end - 2] << 16 | buf[end - 1] << 24) >>> 0; } /** * Reads fixed 32 bits as an unsigned 32 bit integer. * @returns {number} Value read */ Reader.prototype.fixed32 = function read_fixed32() { /* istanbul ignore if */ if (this.pos + 4 > this.len) throw indexOutOfRange(this, 4); return readFixed32_end(this.buf, this.pos += 4); }; /** * Reads fixed 32 bits as a signed 32 bit integer. * @returns {number} Value read */ Reader.prototype.sfixed32 = function read_sfixed32() { /* istanbul ignore if */ if (this.pos + 4 > this.len) throw indexOutOfRange(this, 4); return readFixed32_end(this.buf, this.pos += 4) | 0; }; /* eslint-disable no-invalid-this */ function readFixed64(/* this: Reader */) { /* istanbul ignore if */ if (this.pos + 8 > this.len) throw indexOutOfRange(this, 8); return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); } /* eslint-enable no-invalid-this */ /** * Reads fixed 64 bits. * @name Reader#fixed64 * @function * @returns {Long} Value read */ /** * Reads zig-zag encoded fixed 64 bits. * @name Reader#sfixed64 * @function * @returns {Long} Value read */ /** * Reads a float (32 bit) as a number. * @function * @returns {number} Value read */ Reader.prototype.float = function read_float() { /* istanbul ignore if */ if (this.pos + 4 > this.len) throw indexOutOfRange(this, 4); var value = util.float.readFloatLE(this.buf, this.pos); this.pos += 4; return value; }; /** * Reads a double (64 bit float) as a number. * @function * @returns {number} Value read */ Reader.prototype.double = function read_double() { /* istanbul ignore if */ if (this.pos + 8 > this.len) throw indexOutOfRange(this, 4); var value = util.float.readDoubleLE(this.buf, this.pos); this.pos += 8; return value; }; /** * Reads a sequence of bytes preceeded by its length as a varint. * @returns {Uint8Array} Value read */ Reader.prototype.bytes = function read_bytes() { var length = this.uint32(), start = this.pos, end = this.pos + length; /* istanbul ignore if */ if (end > this.len) throw indexOutOfRange(this, length); this.pos += length; if (Array.isArray(this.buf)) // plain array return this.buf.slice(start, end); if (start === end) { // fix for IE 10/Win8 and others' subarray returning array of size 1 var nativeBuffer = util.Buffer; return nativeBuffer ? nativeBuffer.alloc(0) : new this.buf.constructor(0); } return this._slice.call(this.buf, start, end); }; /** * Reads a string preceeded by its byte length as a varint. * @returns {string} Value read */ Reader.prototype.string = function read_string() { var bytes = this.bytes(); return utf8.read(bytes, 0, bytes.length); }; /** * Skips the specified number of bytes if specified, otherwise skips a varint. * @param {number} [length] Length if known, otherwise a varint is assumed * @returns {Reader} `this` */ Reader.prototype.skip = function skip(length) { if (typeof length === "number") { /* istanbul ignore if */ if (this.pos + length > this.len) throw indexOutOfRange(this, length); this.pos += length; } else { do { /* istanbul ignore if */ if (this.pos >= this.len) throw indexOutOfRange(this); } while (this.buf[this.pos++] & 128); } return this; }; /** * Skips the next element of the specified wire type. * @param {number} wireType Wire type received * @returns {Reader} `this` */ Reader.prototype.skipType = function(wireType) { switch (wireType) { case 0: this.skip(); break; case 1: this.skip(8); break; case 2: this.skip(this.uint32()); break; case 3: while ((wireType = this.uint32() & 7) !== 4) { this.skipType(wireType); } break; case 5: this.skip(4); break; /* istanbul ignore next */ default: throw Error("invalid wire type " + wireType + " at offset " + this.pos); } return this; }; Reader._configure = function(BufferReader_) { BufferReader = BufferReader_; Reader.create = create(); BufferReader._configure(); var fn = util.Long ? "toLong" : /* istanbul ignore next */ "toNumber"; util.merge(Reader.prototype, { int64: function read_int64() { return readLongVarint.call(this)[fn](false); }, uint64: function read_uint64() { return readLongVarint.call(this)[fn](true); }, sint64: function read_sint64() { return readLongVarint.call(this).zzDecode()[fn](false); }, fixed64: function read_fixed64() { return readFixed64.call(this)[fn](true); }, sfixed64: function read_sfixed64() { return readFixed64.call(this)[fn](false); } }); }; /***/ }), /***/ 33158: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = BufferReader; // extends Reader var Reader = __webpack_require__(16237); (BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; var util = __webpack_require__(93610); /** * Constructs a new buffer reader instance. * @classdesc Wire format reader using node buffers. * @extends Reader * @constructor * @param {Buffer} buffer Buffer to read from */ function BufferReader(buffer) { Reader.call(this, buffer); /** * Read buffer. * @name BufferReader#buf * @type {Buffer} */ } BufferReader._configure = function () { /* istanbul ignore else */ if (util.Buffer) BufferReader.prototype._slice = util.Buffer.prototype.slice; }; /** * @override */ BufferReader.prototype.string = function read_string_buffer() { var len = this.uint32(); // modifies pos return this.buf.utf8Slice ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)) : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + len, this.len)); }; /** * Reads a sequence of bytes preceeded by its length as a varint. * @name BufferReader#bytes * @function * @returns {Buffer} Value read */ BufferReader._configure(); /***/ }), /***/ 64529: /***/ ((module) => { "use strict"; module.exports = {}; /** * Named roots. * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). * Can also be used manually to make roots available across modules. * @name roots * @type {Object.} * @example * // pbjs -r myroot -o compiled.js ... * * // in another module: * require("./compiled.js"); * * // in any subsequent module: * var root = protobuf.roots["myroot"]; */ /***/ }), /***/ 95047: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Streaming RPC helpers. * @namespace */ var rpc = exports; /** * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. * @typedef RPCImpl * @type {function} * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called * @param {Uint8Array} requestData Request data * @param {RPCImplCallback} callback Callback function * @returns {undefined} * @example * function rpcImpl(method, requestData, callback) { * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code * throw Error("no such method"); * asynchronouslyObtainAResponse(requestData, function(err, responseData) { * callback(err, responseData); * }); * } */ /** * Node-style callback as used by {@link RPCImpl}. * @typedef RPCImplCallback * @type {function} * @param {Error|null} error Error, if any, otherwise `null` * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error * @returns {undefined} */ rpc.Service = __webpack_require__(27595); /***/ }), /***/ 27595: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = Service; var util = __webpack_require__(93610); // Extends EventEmitter (Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; /** * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. * * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. * @typedef rpc.ServiceMethodCallback * @template TRes extends Message * @type {function} * @param {Error|null} error Error, if any * @param {TRes} [response] Response message * @returns {undefined} */ /** * A service method part of a {@link rpc.Service} as created by {@link Service.create}. * @typedef rpc.ServiceMethod * @template TReq extends Message * @template TRes extends Message * @type {function} * @param {TReq|Properties} request Request message or plain object * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` */ /** * Constructs a new RPC service instance. * @classdesc An RPC service as returned by {@link Service#create}. * @exports rpc.Service * @extends util.EventEmitter * @constructor * @param {RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ function Service(rpcImpl, requestDelimited, responseDelimited) { if (typeof rpcImpl !== "function") throw TypeError("rpcImpl must be a function"); util.EventEmitter.call(this); /** * RPC implementation. Becomes `null` once the service is ended. * @type {RPCImpl|null} */ this.rpcImpl = rpcImpl; /** * Whether requests are length-delimited. * @type {boolean} */ this.requestDelimited = Boolean(requestDelimited); /** * Whether responses are length-delimited. * @type {boolean} */ this.responseDelimited = Boolean(responseDelimited); } /** * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. * @param {Method|rpc.ServiceMethod} method Reflected or static method * @param {Constructor} requestCtor Request constructor * @param {Constructor} responseCtor Response constructor * @param {TReq|Properties} request Request message or plain object * @param {rpc.ServiceMethodCallback} callback Service callback * @returns {undefined} * @template TReq extends Message * @template TRes extends Message */ Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { if (!request) throw TypeError("request must be specified"); var self = this; if (!callback) return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request); if (!self.rpcImpl) { setTimeout(function() { callback(Error("already ended")); }, 0); return undefined; } try { return self.rpcImpl( method, requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), function rpcCallback(err, response) { if (err) { self.emit("error", err, method); return callback(err); } if (response === null) { self.end(/* endedByRPC */ true); return undefined; } if (!(response instanceof responseCtor)) { try { response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response); } catch (err) { self.emit("error", err, method); return callback(err); } } self.emit("data", response, method); return callback(null, response); } ); } catch (err) { self.emit("error", err, method); setTimeout(function() { callback(err); }, 0); return undefined; } }; /** * Ends this service and emits the `end` event. * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. * @returns {rpc.Service} `this` */ Service.prototype.end = function end(endedByRPC) { if (this.rpcImpl) { if (!endedByRPC) // signal end to rpcImpl this.rpcImpl(null, null, null); this.rpcImpl = null; this.emit("end").off(); } return this; }; /***/ }), /***/ 32239: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = LongBits; var util = __webpack_require__(93610); /** * Constructs new long bits. * @classdesc Helper class for working with the low and high bits of a 64 bit value. * @memberof util * @constructor * @param {number} lo Low 32 bits, unsigned * @param {number} hi High 32 bits, unsigned */ function LongBits(lo, hi) { // note that the casts below are theoretically unnecessary as of today, but older statically // generated converter code might still call the ctor with signed 32bits. kept for compat. /** * Low bits. * @type {number} */ this.lo = lo >>> 0; /** * High bits. * @type {number} */ this.hi = hi >>> 0; } /** * Zero bits. * @memberof util.LongBits * @type {util.LongBits} */ var zero = LongBits.zero = new LongBits(0, 0); zero.toNumber = function() { return 0; }; zero.zzEncode = zero.zzDecode = function() { return this; }; zero.length = function() { return 1; }; /** * Zero hash. * @memberof util.LongBits * @type {string} */ var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; /** * Constructs new long bits from the specified number. * @param {number} value Value * @returns {util.LongBits} Instance */ LongBits.fromNumber = function fromNumber(value) { if (value === 0) return zero; var sign = value < 0; if (sign) value = -value; var lo = value >>> 0, hi = (value - lo) / 4294967296 >>> 0; if (sign) { hi = ~hi >>> 0; lo = ~lo >>> 0; if (++lo > 4294967295) { lo = 0; if (++hi > 4294967295) hi = 0; } } return new LongBits(lo, hi); }; /** * Constructs new long bits from a number, long or string. * @param {Long|number|string} value Value * @returns {util.LongBits} Instance */ LongBits.from = function from(value) { if (typeof value === "number") return LongBits.fromNumber(value); if (util.isString(value)) { /* istanbul ignore else */ if (util.Long) value = util.Long.fromString(value); else return LongBits.fromNumber(parseInt(value, 10)); } return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; }; /** * Converts this long bits to a possibly unsafe JavaScript number. * @param {boolean} [unsigned=false] Whether unsigned or not * @returns {number} Possibly unsafe number */ LongBits.prototype.toNumber = function toNumber(unsigned) { if (!unsigned && this.hi >>> 31) { var lo = ~this.lo + 1 >>> 0, hi = ~this.hi >>> 0; if (!lo) hi = hi + 1 >>> 0; return -(lo + hi * 4294967296); } return this.lo + this.hi * 4294967296; }; /** * Converts this long bits to a long. * @param {boolean} [unsigned=false] Whether unsigned or not * @returns {Long} Long */ LongBits.prototype.toLong = function toLong(unsigned) { return util.Long ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) /* istanbul ignore next */ : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; }; var charCodeAt = String.prototype.charCodeAt; /** * Constructs new long bits from the specified 8 characters long hash. * @param {string} hash Hash * @returns {util.LongBits} Bits */ LongBits.fromHash = function fromHash(hash) { if (hash === zeroHash) return zero; return new LongBits( ( charCodeAt.call(hash, 0) | charCodeAt.call(hash, 1) << 8 | charCodeAt.call(hash, 2) << 16 | charCodeAt.call(hash, 3) << 24) >>> 0 , ( charCodeAt.call(hash, 4) | charCodeAt.call(hash, 5) << 8 | charCodeAt.call(hash, 6) << 16 | charCodeAt.call(hash, 7) << 24) >>> 0 ); }; /** * Converts this long bits to a 8 characters long hash. * @returns {string} Hash */ LongBits.prototype.toHash = function toHash() { return String.fromCharCode( this.lo & 255, this.lo >>> 8 & 255, this.lo >>> 16 & 255, this.lo >>> 24 , this.hi & 255, this.hi >>> 8 & 255, this.hi >>> 16 & 255, this.hi >>> 24 ); }; /** * Zig-zag encodes this long bits. * @returns {util.LongBits} `this` */ LongBits.prototype.zzEncode = function zzEncode() { var mask = this.hi >> 31; this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; this.lo = ( this.lo << 1 ^ mask) >>> 0; return this; }; /** * Zig-zag decodes this long bits. * @returns {util.LongBits} `this` */ LongBits.prototype.zzDecode = function zzDecode() { var mask = -(this.lo & 1); this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; this.hi = ( this.hi >>> 1 ^ mask) >>> 0; return this; }; /** * Calculates the length of this longbits when encoded as a varint. * @returns {number} Length */ LongBits.prototype.length = function length() { var part0 = this.lo, part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, part2 = this.hi >>> 24; return part2 === 0 ? part1 === 0 ? part0 < 16384 ? part0 < 128 ? 1 : 2 : part0 < 2097152 ? 3 : 4 : part1 < 16384 ? part1 < 128 ? 5 : 6 : part1 < 2097152 ? 7 : 8 : part2 < 128 ? 9 : 10; }; /***/ }), /***/ 93610: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var util = exports; // used to return a Promise where callback is omitted util.asPromise = __webpack_require__(18045); // converts to / from base64 encoded strings util.base64 = __webpack_require__(8839); // base class of rpc.Service util.EventEmitter = __webpack_require__(24358); // float handling accross browsers util.float = __webpack_require__(49410); // requires modules optionally and hides the call from bundlers util.inquire = __webpack_require__(84153); // converts to / from utf8 encoded strings util.utf8 = __webpack_require__(81447); // provides a node-like buffer pool in the browser util.pool = __webpack_require__(99390); // utility to work with the low and high bits of a 64 bit value util.LongBits = __webpack_require__(32239); /** * Whether running within node or not. * @memberof util * @type {boolean} */ util.isNode = Boolean(typeof __webpack_require__.g !== "undefined" && __webpack_require__.g && __webpack_require__.g.process && __webpack_require__.g.process.versions && __webpack_require__.g.process.versions.node); /** * Global object reference. * @memberof util * @type {Object} */ util.global = util.isNode && __webpack_require__.g || true && window || typeof self !== "undefined" && self || this; // eslint-disable-line no-invalid-this /** * An immuable empty array. * @memberof util * @type {Array.<*>} * @const */ util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes /** * An immutable empty object. * @type {Object} * @const */ util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes /** * Tests if the specified value is an integer. * @function * @param {*} value Value to test * @returns {boolean} `true` if the value is an integer */ util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) { return typeof value === "number" && isFinite(value) && Math.floor(value) === value; }; /** * Tests if the specified value is a string. * @param {*} value Value to test * @returns {boolean} `true` if the value is a string */ util.isString = function isString(value) { return typeof value === "string" || value instanceof String; }; /** * Tests if the specified value is a non-null object. * @param {*} value Value to test * @returns {boolean} `true` if the value is a non-null object */ util.isObject = function isObject(value) { return value && typeof value === "object"; }; /** * Checks if a property on a message is considered to be present. * This is an alias of {@link util.isSet}. * @function * @param {Object} obj Plain object or message instance * @param {string} prop Property name * @returns {boolean} `true` if considered to be present, otherwise `false` */ util.isset = /** * Checks if a property on a message is considered to be present. * @param {Object} obj Plain object or message instance * @param {string} prop Property name * @returns {boolean} `true` if considered to be present, otherwise `false` */ util.isSet = function isSet(obj, prop) { var value = obj[prop]; if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; return false; }; /** * Any compatible Buffer instance. * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. * @interface Buffer * @extends Uint8Array */ /** * Node's Buffer class if available. * @type {Constructor} */ util.Buffer = (function() { try { var Buffer = util.inquire("buffer").Buffer; // refuse to use non-node buffers if not explicitly assigned (perf reasons): return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null; } catch (e) { /* istanbul ignore next */ return null; } })(); // Internal alias of or polyfull for Buffer.from. util._Buffer_from = null; // Internal alias of or polyfill for Buffer.allocUnsafe. util._Buffer_allocUnsafe = null; /** * Creates a new buffer of whatever type supported by the environment. * @param {number|number[]} [sizeOrArray=0] Buffer size or number array * @returns {Uint8Array|Buffer} Buffer */ util.newBuffer = function newBuffer(sizeOrArray) { /* istanbul ignore next */ return typeof sizeOrArray === "number" ? util.Buffer ? util._Buffer_allocUnsafe(sizeOrArray) : new util.Array(sizeOrArray) : util.Buffer ? util._Buffer_from(sizeOrArray) : typeof Uint8Array === "undefined" ? sizeOrArray : new Uint8Array(sizeOrArray); }; /** * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. * @type {Constructor} */ util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array; /** * Any compatible Long instance. * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. * @interface Long * @property {number} low Low bits * @property {number} high High bits * @property {boolean} unsigned Whether unsigned or not */ /** * Long.js's Long class if available. * @type {Constructor} */ util.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long || /* istanbul ignore next */ util.global.Long || util.inquire("long"); /** * Regular expression used to verify 2 bit (`bool`) map keys. * @type {RegExp} * @const */ util.key2Re = /^true|false|0|1$/; /** * Regular expression used to verify 32 bit (`int32` etc.) map keys. * @type {RegExp} * @const */ util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; /** * Regular expression used to verify 64 bit (`int64` etc.) map keys. * @type {RegExp} * @const */ util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; /** * Converts a number or long to an 8 characters long hash string. * @param {Long|number} value Value to convert * @returns {string} Hash */ util.longToHash = function longToHash(value) { return value ? util.LongBits.from(value).toHash() : util.LongBits.zeroHash; }; /** * Converts an 8 characters long hash string to a long or number. * @param {string} hash Hash * @param {boolean} [unsigned=false] Whether unsigned or not * @returns {Long|number} Original value */ util.longFromHash = function longFromHash(hash, unsigned) { var bits = util.LongBits.fromHash(hash); if (util.Long) return util.Long.fromBits(bits.lo, bits.hi, unsigned); return bits.toNumber(Boolean(unsigned)); }; /** * Merges the properties of the source object into the destination object. * @memberof util * @param {Object.} dst Destination object * @param {Object.} src Source object * @param {boolean} [ifNotSet=false] Merges only if the key is not already set * @returns {Object.} Destination object */ function merge(dst, src, ifNotSet) { // used by converters for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) if (dst[keys[i]] === undefined || !ifNotSet) dst[keys[i]] = src[keys[i]]; return dst; } util.merge = merge; /** * Converts the first character of a string to lower case. * @param {string} str String to convert * @returns {string} Converted string */ util.lcFirst = function lcFirst(str) { return str.charAt(0).toLowerCase() + str.substring(1); }; /** * Creates a custom error constructor. * @memberof util * @param {string} name Error name * @returns {Constructor} Custom error constructor */ function newError(name) { function CustomError(message, properties) { if (!(this instanceof CustomError)) return new CustomError(message, properties); // Error.call(this, message); // ^ just returns a new error instance because the ctor can be called as a function Object.defineProperty(this, "message", { get: function() { return message; } }); /* istanbul ignore next */ if (Error.captureStackTrace) // node Error.captureStackTrace(this, CustomError); else Object.defineProperty(this, "stack", { value: new Error().stack || "" }); if (properties) merge(this, properties); } CustomError.prototype = Object.create(Error.prototype, { constructor: { value: CustomError, writable: true, enumerable: false, configurable: true, }, name: { get: function get() { return name; }, set: undefined, enumerable: false, // configurable: false would accurately preserve the behavior of // the original, but I'm guessing that was not intentional. // For an actual error subclass, this property would // be configurable. configurable: true, }, toString: { value: function value() { return this.name + ": " + this.message; }, writable: true, enumerable: false, configurable: true, }, }); return CustomError; } util.newError = newError; /** * Constructs a new protocol error. * @classdesc Error subclass indicating a protocol specifc error. * @memberof util * @extends Error * @template T extends Message * @constructor * @param {string} message Error message * @param {Object.} [properties] Additional properties * @example * try { * MyMessage.decode(someBuffer); // throws if required fields are missing * } catch (e) { * if (e instanceof ProtocolError && e.instance) * console.log("decoded so far: " + JSON.stringify(e.instance)); * } */ util.ProtocolError = newError("ProtocolError"); /** * So far decoded message instance. * @name util.ProtocolError#instance * @type {Message} */ /** * A OneOf getter as returned by {@link util.oneOfGetter}. * @typedef OneOfGetter * @type {function} * @returns {string|undefined} Set field name, if any */ /** * Builds a getter for a oneof's present field name. * @param {string[]} fieldNames Field names * @returns {OneOfGetter} Unbound getter */ util.oneOfGetter = function getOneOf(fieldNames) { var fieldMap = {}; for (var i = 0; i < fieldNames.length; ++i) fieldMap[fieldNames[i]] = 1; /** * @returns {string|undefined} Set field name, if any * @this Object * @ignore */ return function() { // eslint-disable-line consistent-return for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i) if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null) return keys[i]; }; }; /** * A OneOf setter as returned by {@link util.oneOfSetter}. * @typedef OneOfSetter * @type {function} * @param {string|undefined} value Field name * @returns {undefined} */ /** * Builds a setter for a oneof's present field name. * @param {string[]} fieldNames Field names * @returns {OneOfSetter} Unbound setter */ util.oneOfSetter = function setOneOf(fieldNames) { /** * @param {string} name Field name * @returns {undefined} * @this Object * @ignore */ return function(name) { for (var i = 0; i < fieldNames.length; ++i) if (fieldNames[i] !== name) delete this[fieldNames[i]]; }; }; /** * Default conversion options used for {@link Message#toJSON} implementations. * * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: * * - Longs become strings * - Enums become string keys * - Bytes become base64 encoded strings * - (Sub-)Messages become plain objects * - Maps become plain objects with all string keys * - Repeated fields become arrays * - NaN and Infinity for float and double fields become strings * * @type {IConversionOptions} * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json */ util.toJSONOptions = { longs: String, enums: String, bytes: String, json: true }; // Sets up buffer utility according to the environment (called in index-minimal) util._configure = function() { var Buffer = util.Buffer; /* istanbul ignore if */ if (!Buffer) { util._Buffer_from = util._Buffer_allocUnsafe = null; return; } // because node 4.x buffers are incompatible & immutable // see: https://github.com/dcodeIO/protobuf.js/pull/665 util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || /* istanbul ignore next */ function Buffer_from(value, encoding) { return new Buffer(value, encoding); }; util._Buffer_allocUnsafe = Buffer.allocUnsafe || /* istanbul ignore next */ function Buffer_allocUnsafe(size) { return new Buffer(size); }; }; /***/ }), /***/ 63449: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = Writer; var util = __webpack_require__(93610); var BufferWriter; // cyclic var LongBits = util.LongBits, base64 = util.base64, utf8 = util.utf8; /** * Constructs a new writer operation instance. * @classdesc Scheduled writer operation. * @constructor * @param {function(*, Uint8Array, number)} fn Function to call * @param {number} len Value byte length * @param {*} val Value to write * @ignore */ function Op(fn, len, val) { /** * Function to call. * @type {function(Uint8Array, number, *)} */ this.fn = fn; /** * Value byte length. * @type {number} */ this.len = len; /** * Next operation. * @type {Writer.Op|undefined} */ this.next = undefined; /** * Value to write. * @type {*} */ this.val = val; // type varies } /* istanbul ignore next */ function noop() {} // eslint-disable-line no-empty-function /** * Constructs a new writer state instance. * @classdesc Copied writer state. * @memberof Writer * @constructor * @param {Writer} writer Writer to copy state from * @ignore */ function State(writer) { /** * Current head. * @type {Writer.Op} */ this.head = writer.head; /** * Current tail. * @type {Writer.Op} */ this.tail = writer.tail; /** * Current buffer length. * @type {number} */ this.len = writer.len; /** * Next state. * @type {State|null} */ this.next = writer.states; } /** * Constructs a new writer instance. * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. * @constructor */ function Writer() { /** * Current length. * @type {number} */ this.len = 0; /** * Operations head. * @type {Object} */ this.head = new Op(noop, 0, 0); /** * Operations tail * @type {Object} */ this.tail = this.head; /** * Linked forked states. * @type {Object|null} */ this.states = null; // When a value is written, the writer calculates its byte length and puts it into a linked // list of operations to perform when finish() is called. This both allows us to allocate // buffers of the exact required size and reduces the amount of work we have to do compared // to first calculating over objects and then encoding over objects. In our case, the encoding // part is just a linked list walk calling operations with already prepared values. } var create = function create() { return util.Buffer ? function create_buffer_setup() { return (Writer.create = function create_buffer() { return new BufferWriter(); })(); } /* istanbul ignore next */ : function create_array() { return new Writer(); }; }; /** * Creates a new writer. * @function * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} */ Writer.create = create(); /** * Allocates a buffer of the specified size. * @param {number} size Buffer size * @returns {Uint8Array} Buffer */ Writer.alloc = function alloc(size) { return new util.Array(size); }; // Use Uint8Array buffer pool in the browser, just like node does with buffers /* istanbul ignore else */ if (util.Array !== Array) Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); /** * Pushes a new operation to the queue. * @param {function(Uint8Array, number, *)} fn Function to call * @param {number} len Value byte length * @param {number} val Value to write * @returns {Writer} `this` * @private */ Writer.prototype._push = function push(fn, len, val) { this.tail = this.tail.next = new Op(fn, len, val); this.len += len; return this; }; function writeByte(val, buf, pos) { buf[pos] = val & 255; } function writeVarint32(val, buf, pos) { while (val > 127) { buf[pos++] = val & 127 | 128; val >>>= 7; } buf[pos] = val; } /** * Constructs a new varint writer operation instance. * @classdesc Scheduled varint writer operation. * @extends Op * @constructor * @param {number} len Value byte length * @param {number} val Value to write * @ignore */ function VarintOp(len, val) { this.len = len; this.next = undefined; this.val = val; } VarintOp.prototype = Object.create(Op.prototype); VarintOp.prototype.fn = writeVarint32; /** * Writes an unsigned 32 bit value as a varint. * @param {number} value Value to write * @returns {Writer} `this` */ Writer.prototype.uint32 = function write_uint32(value) { // here, the call to this.push has been inlined and a varint specific Op subclass is used. // uint32 is by far the most frequently used operation and benefits significantly from this. this.len += (this.tail = this.tail.next = new VarintOp( (value = value >>> 0) < 128 ? 1 : value < 16384 ? 2 : value < 2097152 ? 3 : value < 268435456 ? 4 : 5, value)).len; return this; }; /** * Writes a signed 32 bit value as a varint. * @function * @param {number} value Value to write * @returns {Writer} `this` */ Writer.prototype.int32 = function write_int32(value) { return value < 0 ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec : this.uint32(value); }; /** * Writes a 32 bit value as a varint, zig-zag encoded. * @param {number} value Value to write * @returns {Writer} `this` */ Writer.prototype.sint32 = function write_sint32(value) { return this.uint32((value << 1 ^ value >> 31) >>> 0); }; function writeVarint64(val, buf, pos) { while (val.hi) { buf[pos++] = val.lo & 127 | 128; val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; val.hi >>>= 7; } while (val.lo > 127) { buf[pos++] = val.lo & 127 | 128; val.lo = val.lo >>> 7; } buf[pos++] = val.lo; } /** * Writes an unsigned 64 bit value as a varint. * @param {Long|number|string} value Value to write * @returns {Writer} `this` * @throws {TypeError} If `value` is a string and no long library is present. */ Writer.prototype.uint64 = function write_uint64(value) { var bits = LongBits.from(value); return this._push(writeVarint64, bits.length(), bits); }; /** * Writes a signed 64 bit value as a varint. * @function * @param {Long|number|string} value Value to write * @returns {Writer} `this` * @throws {TypeError} If `value` is a string and no long library is present. */ Writer.prototype.int64 = Writer.prototype.uint64; /** * Writes a signed 64 bit value as a varint, zig-zag encoded. * @param {Long|number|string} value Value to write * @returns {Writer} `this` * @throws {TypeError} If `value` is a string and no long library is present. */ Writer.prototype.sint64 = function write_sint64(value) { var bits = LongBits.from(value).zzEncode(); return this._push(writeVarint64, bits.length(), bits); }; /** * Writes a boolish value as a varint. * @param {boolean} value Value to write * @returns {Writer} `this` */ Writer.prototype.bool = function write_bool(value) { return this._push(writeByte, 1, value ? 1 : 0); }; function writeFixed32(val, buf, pos) { buf[pos ] = val & 255; buf[pos + 1] = val >>> 8 & 255; buf[pos + 2] = val >>> 16 & 255; buf[pos + 3] = val >>> 24; } /** * Writes an unsigned 32 bit value as fixed 32 bits. * @param {number} value Value to write * @returns {Writer} `this` */ Writer.prototype.fixed32 = function write_fixed32(value) { return this._push(writeFixed32, 4, value >>> 0); }; /** * Writes a signed 32 bit value as fixed 32 bits. * @function * @param {number} value Value to write * @returns {Writer} `this` */ Writer.prototype.sfixed32 = Writer.prototype.fixed32; /** * Writes an unsigned 64 bit value as fixed 64 bits. * @param {Long|number|string} value Value to write * @returns {Writer} `this` * @throws {TypeError} If `value` is a string and no long library is present. */ Writer.prototype.fixed64 = function write_fixed64(value) { var bits = LongBits.from(value); return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); }; /** * Writes a signed 64 bit value as fixed 64 bits. * @function * @param {Long|number|string} value Value to write * @returns {Writer} `this` * @throws {TypeError} If `value` is a string and no long library is present. */ Writer.prototype.sfixed64 = Writer.prototype.fixed64; /** * Writes a float (32 bit). * @function * @param {number} value Value to write * @returns {Writer} `this` */ Writer.prototype.float = function write_float(value) { return this._push(util.float.writeFloatLE, 4, value); }; /** * Writes a double (64 bit float). * @function * @param {number} value Value to write * @returns {Writer} `this` */ Writer.prototype.double = function write_double(value) { return this._push(util.float.writeDoubleLE, 8, value); }; var writeBytes = util.Array.prototype.set ? function writeBytes_set(val, buf, pos) { buf.set(val, pos); // also works for plain array values } /* istanbul ignore next */ : function writeBytes_for(val, buf, pos) { for (var i = 0; i < val.length; ++i) buf[pos + i] = val[i]; }; /** * Writes a sequence of bytes. * @param {Uint8Array|string} value Buffer or base64 encoded string to write * @returns {Writer} `this` */ Writer.prototype.bytes = function write_bytes(value) { var len = value.length >>> 0; if (!len) return this._push(writeByte, 1, 0); if (util.isString(value)) { var buf = Writer.alloc(len = base64.length(value)); base64.decode(value, buf, 0); value = buf; } return this.uint32(len)._push(writeBytes, len, value); }; /** * Writes a string. * @param {string} value Value to write * @returns {Writer} `this` */ Writer.prototype.string = function write_string(value) { var len = utf8.length(value); return len ? this.uint32(len)._push(utf8.write, len, value) : this._push(writeByte, 1, 0); }; /** * Forks this writer's state by pushing it to a stack. * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. * @returns {Writer} `this` */ Writer.prototype.fork = function fork() { this.states = new State(this); this.head = this.tail = new Op(noop, 0, 0); this.len = 0; return this; }; /** * Resets this instance to the last state. * @returns {Writer} `this` */ Writer.prototype.reset = function reset() { if (this.states) { this.head = this.states.head; this.tail = this.states.tail; this.len = this.states.len; this.states = this.states.next; } else { this.head = this.tail = new Op(noop, 0, 0); this.len = 0; } return this; }; /** * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. * @returns {Writer} `this` */ Writer.prototype.ldelim = function ldelim() { var head = this.head, tail = this.tail, len = this.len; this.reset().uint32(len); if (len) { this.tail.next = head.next; // skip noop this.tail = tail; this.len += len; } return this; }; /** * Finishes the write operation. * @returns {Uint8Array} Finished buffer */ Writer.prototype.finish = function finish() { var head = this.head.next, // skip noop buf = this.constructor.alloc(this.len), pos = 0; while (head) { head.fn(head.val, buf, pos); pos += head.len; head = head.next; } // this.head = this.tail = null; return buf; }; Writer._configure = function(BufferWriter_) { BufferWriter = BufferWriter_; Writer.create = create(); BufferWriter._configure(); }; /***/ }), /***/ 60818: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = BufferWriter; // extends Writer var Writer = __webpack_require__(63449); (BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; var util = __webpack_require__(93610); /** * Constructs a new buffer writer instance. * @classdesc Wire format writer using node buffers. * @extends Writer * @constructor */ function BufferWriter() { Writer.call(this); } BufferWriter._configure = function () { /** * Allocates a buffer of the specified size. * @function * @param {number} size Buffer size * @returns {Buffer} Buffer */ BufferWriter.alloc = util._Buffer_allocUnsafe; BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === "set" ? function writeBytesBuffer_set(val, buf, pos) { buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) // also works for plain array values } /* istanbul ignore next */ : function writeBytesBuffer_copy(val, buf, pos) { if (val.copy) // Buffer values val.copy(buf, pos, 0, val.length); else for (var i = 0; i < val.length;) // plain array values buf[pos++] = val[i++]; }; }; /** * @override */ BufferWriter.prototype.bytes = function write_bytes_buffer(value) { if (util.isString(value)) value = util._Buffer_from(value, "base64"); var len = value.length >>> 0; this.uint32(len); if (len) this._push(BufferWriter.writeBytesBuffer, len, value); return this; }; function writeStringBuffer(val, buf, pos) { if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions) util.utf8.write(val, buf, pos); else if (buf.utf8Write) buf.utf8Write(val, pos); else buf.write(val, pos); } /** * @override */ BufferWriter.prototype.string = function write_string_buffer(value) { var len = util.Buffer.byteLength(value); this.uint32(len); if (len) this._push(writeStringBuffer, len, value); return this; }; /** * Finishes the write operation. * @name BufferWriter#finish * @function * @returns {Buffer} Finished buffer */ BufferWriter._configure(); /***/ }), /***/ 40961: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; function checkDCE() { /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ if ( typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function' ) { return; } if (false) {} try { // Verify that the code above has been dead code eliminated (DCE'd). __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE); } catch (err) { // DevTools shouldn't crash React, no matter what. // We should still report in case we break this code. console.error(err); } } if (true) { // DCE check should happen before ReactDOM bundle executes so that // DevTools can report bad minification during injection. checkDCE(); module.exports = __webpack_require__(22551); } else {} /***/ }), /***/ 54237: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; exports.__esModule = true; var _react = __webpack_require__(96540); var _react2 = _interopRequireDefault(_react); var _propTypes = __webpack_require__(5556); var _propTypes2 = _interopRequireDefault(_propTypes); var _GatewayRegistry = __webpack_require__(50258); var _GatewayRegistry2 = _interopRequireDefault(_GatewayRegistry); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Gateway = function (_React$Component) { _inherits(Gateway, _React$Component); function Gateway(props, context) { _classCallCheck(this, Gateway); var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context)); _this.gatewayRegistry = context.gatewayRegistry; return _this; } Gateway.prototype.componentWillMount = function componentWillMount() { this.id = this.gatewayRegistry.register(this.props.into, this.props.children); this.renderIntoGatewayNode(this.props); }; Gateway.prototype.componentWillReceiveProps = function componentWillReceiveProps(props) { this.gatewayRegistry.clearChild(this.props.into, this.id); this.renderIntoGatewayNode(props); }; Gateway.prototype.componentWillUnmount = function componentWillUnmount() { this.gatewayRegistry.unregister(this.props.into, this.id); }; Gateway.prototype.renderIntoGatewayNode = function renderIntoGatewayNode(props) { this.gatewayRegistry.addChild(this.props.into, this.id, props.children); }; Gateway.prototype.render = function render() { return null; }; return Gateway; }(_react2.default.Component); Gateway.contextTypes = { gatewayRegistry: _propTypes2.default.instanceOf(_GatewayRegistry2.default).isRequired }; Gateway.propTypes = { into: _propTypes2.default.string.isRequired, children: _propTypes2.default.node }; exports["default"] = Gateway; /***/ }), /***/ 60405: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; exports.__esModule = true; var _react = __webpack_require__(96540); var _react2 = _interopRequireDefault(_react); var _propTypes = __webpack_require__(5556); var _propTypes2 = _interopRequireDefault(_propTypes); var _GatewayRegistry = __webpack_require__(50258); var _GatewayRegistry2 = _interopRequireDefault(_GatewayRegistry); var _reactPropTypes = __webpack_require__(70014); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var GatewayDest = function (_React$Component) { _inherits(GatewayDest, _React$Component); function GatewayDest(props, context) { _classCallCheck(this, GatewayDest); var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context)); _this.state = { children: null }; _this.gatewayRegistry = context.gatewayRegistry; return _this; } GatewayDest.prototype.componentWillMount = function componentWillMount() { this.gatewayRegistry.addContainer(this.props.name, this); }; GatewayDest.prototype.componentWillUnmount = function componentWillUnmount() { this.gatewayRegistry.removeContainer(this.props.name, this); }; GatewayDest.prototype.render = function render() { var _props = this.props, component = _props.component, tagName = _props.tagName, attrs = _objectWithoutProperties(_props, ['component', 'tagName']); delete attrs.name; return _react2.default.createElement(component || tagName || 'div', attrs, this.state.children); }; return GatewayDest; }(_react2.default.Component); GatewayDest.contextTypes = { gatewayRegistry: _propTypes2.default.instanceOf(_GatewayRegistry2.default).isRequired }; GatewayDest.propTypes = { name: _propTypes2.default.string.isRequired, tagName: (0, _reactPropTypes.deprecated)(_propTypes2.default.string, 'Use "component" instead.'), component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]) }; exports["default"] = GatewayDest; /***/ }), /***/ 28644: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; exports.__esModule = true; var _react = __webpack_require__(96540); var _react2 = _interopRequireDefault(_react); var _propTypes = __webpack_require__(5556); var _propTypes2 = _interopRequireDefault(_propTypes); var _GatewayRegistry = __webpack_require__(50258); var _GatewayRegistry2 = _interopRequireDefault(_GatewayRegistry); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var GatewayProvider = function (_React$Component) { _inherits(GatewayProvider, _React$Component); GatewayProvider.prototype.getChildContext = function getChildContext() { return { gatewayRegistry: this.gatewayRegistry }; }; function GatewayProvider(props, context) { _classCallCheck(this, GatewayProvider); var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context)); _this.gatewayRegistry = new _GatewayRegistry2.default(); return _this; } GatewayProvider.prototype.render = function render() { return this.props.children; }; return GatewayProvider; }(_react2.default.Component); GatewayProvider.childContextTypes = { gatewayRegistry: _propTypes2.default.instanceOf(_GatewayRegistry2.default).isRequired }; GatewayProvider.propTypes = { children: _propTypes2.default.element }; exports["default"] = GatewayProvider; /***/ }), /***/ 50258: /***/ ((__unused_webpack_module, exports) => { "use strict"; exports.__esModule = true; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var GatewayRegistry = function () { function GatewayRegistry() { _classCallCheck(this, GatewayRegistry); this._containers = {}; this._children = {}; // Unique key for children of a gateway this._currentId = 0; } GatewayRegistry.prototype._renderContainer = function _renderContainer(name) { var _this = this; if (!this._containers[name] || !this._children[name]) { return; } this._containers[name].setState({ children: Object.keys(this._children[name]).sort().map(function (id) { return _this._children[name][id]; }) }); }; GatewayRegistry.prototype.addContainer = function addContainer(name, container) { this._containers[name] = container; this._renderContainer(name); }; GatewayRegistry.prototype.removeContainer = function removeContainer(name) { this._containers[name] = null; }; GatewayRegistry.prototype.addChild = function addChild(name, gatewayId, child) { this._children[name][gatewayId] = child; this._renderContainer(name); }; GatewayRegistry.prototype.clearChild = function clearChild(name, gatewayId) { delete this._children[name][gatewayId]; }; GatewayRegistry.prototype.register = function register(name, child) { this._children[name] = this._children[name] || {}; var gatewayId = name + "_" + this._currentId; this._children[name][gatewayId] = child; this._currentId += 1; return gatewayId; }; GatewayRegistry.prototype.unregister = function unregister(name, gatewayId) { this.clearChild(name, gatewayId); this._renderContainer(name); }; return GatewayRegistry; }(); exports["default"] = GatewayRegistry; /***/ }), /***/ 10103: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; exports.__esModule = true; exports.GatewayRegistry = exports.GatewayProvider = exports.GatewayDest = exports.Gateway = undefined; var _Gateway2 = __webpack_require__(54237); var _Gateway3 = _interopRequireDefault(_Gateway2); var _GatewayDest2 = __webpack_require__(60405); var _GatewayDest3 = _interopRequireDefault(_GatewayDest2); var _GatewayProvider2 = __webpack_require__(28644); var _GatewayProvider3 = _interopRequireDefault(_GatewayProvider2); var _GatewayRegistry2 = __webpack_require__(50258); var _GatewayRegistry3 = _interopRequireDefault(_GatewayRegistry2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.Gateway = _Gateway3.default; exports.GatewayDest = _GatewayDest3.default; exports.GatewayProvider = _GatewayProvider3.default; exports.GatewayRegistry = _GatewayRegistry3.default; /***/ }), /***/ 71345: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ polyfill: () => (/* binding */ polyfill) /* harmony export */ }); /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ function componentWillMount() { // Call this.constructor.gDSFP to support sub-classes. var state = this.constructor.getDerivedStateFromProps(this.props, this.state); if (state !== null && state !== undefined) { this.setState(state); } } function componentWillReceiveProps(nextProps) { // Call this.constructor.gDSFP to support sub-classes. // Use the setState() updater to ensure state isn't stale in certain edge cases. function updater(prevState) { var state = this.constructor.getDerivedStateFromProps(nextProps, prevState); return state !== null && state !== undefined ? state : null; } // Binding "this" is important for shallow renderer support. this.setState(updater.bind(this)); } function componentWillUpdate(nextProps, nextState) { try { var prevProps = this.props; var prevState = this.state; this.props = nextProps; this.state = nextState; this.__reactInternalSnapshotFlag = true; this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate( prevProps, prevState ); } finally { this.props = prevProps; this.state = prevState; } } // React may warn about cWM/cWRP/cWU methods being deprecated. // Add a flag to suppress these warnings for this special case. componentWillMount.__suppressDeprecationWarning = true; componentWillReceiveProps.__suppressDeprecationWarning = true; componentWillUpdate.__suppressDeprecationWarning = true; function polyfill(Component) { var prototype = Component.prototype; if (!prototype || !prototype.isReactComponent) { throw new Error('Can only polyfill class components'); } if ( typeof Component.getDerivedStateFromProps !== 'function' && typeof prototype.getSnapshotBeforeUpdate !== 'function' ) { return Component; } // If new component APIs are defined, "unsafe" lifecycles won't be called. // Error if any of these lifecycles are present, // Because they would work differently between older and newer (16.3+) versions of React. var foundWillMountName = null; var foundWillReceivePropsName = null; var foundWillUpdateName = null; if (typeof prototype.componentWillMount === 'function') { foundWillMountName = 'componentWillMount'; } else if (typeof prototype.UNSAFE_componentWillMount === 'function') { foundWillMountName = 'UNSAFE_componentWillMount'; } if (typeof prototype.componentWillReceiveProps === 'function') { foundWillReceivePropsName = 'componentWillReceiveProps'; } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') { foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps'; } if (typeof prototype.componentWillUpdate === 'function') { foundWillUpdateName = 'componentWillUpdate'; } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') { foundWillUpdateName = 'UNSAFE_componentWillUpdate'; } if ( foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null ) { var componentName = Component.displayName || Component.name; var newApiName = typeof Component.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()'; throw Error( 'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + componentName + ' uses ' + newApiName + ' but also contains the following legacy lifecycles:' + (foundWillMountName !== null ? '\n ' + foundWillMountName : '') + (foundWillReceivePropsName !== null ? '\n ' + foundWillReceivePropsName : '') + (foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : '') + '\n\nThe above lifecycles should be removed. Learn more about this warning here:\n' + 'https://fb.me/react-async-component-lifecycle-hooks' ); } // React <= 16.2 does not support static getDerivedStateFromProps. // As a workaround, use cWM and cWRP to invoke the new static lifecycle. // Newer versions of React will ignore these lifecycles if gDSFP exists. if (typeof Component.getDerivedStateFromProps === 'function') { prototype.componentWillMount = componentWillMount; prototype.componentWillReceiveProps = componentWillReceiveProps; } // React <= 16.2 does not support getSnapshotBeforeUpdate. // As a workaround, use cWU to invoke the new lifecycle. // Newer versions of React will ignore that lifecycle if gSBU exists. if (typeof prototype.getSnapshotBeforeUpdate === 'function') { if (typeof prototype.componentDidUpdate !== 'function') { throw new Error( 'Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype' ); } prototype.componentWillUpdate = componentWillUpdate; var componentDidUpdate = prototype.componentDidUpdate; prototype.componentDidUpdate = function componentDidUpdatePolyfill( prevProps, prevState, maybeSnapshot ) { // 16.3+ will not execute our will-update method; // It will pass a snapshot value to did-update though. // Older versions will require our polyfilled will-update value. // We need to handle both cases, but can't just check for the presence of "maybeSnapshot", // Because for <= 15.x versions this might be a "prevContext" object. // We also can't just check "__reactInternalSnapshot", // Because get-snapshot might return a falsy value. // So check for the explicit __reactInternalSnapshotFlag flag to determine behavior. var snapshot = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : maybeSnapshot; componentDidUpdate.call(this, prevProps, prevState, snapshot); }; } return Component; } /***/ }), /***/ 1720: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.bodyOpenClassName = exports.portalClassName = undefined; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _react = __webpack_require__(96540); var _react2 = _interopRequireDefault(_react); var _reactDom = __webpack_require__(40961); var _reactDom2 = _interopRequireDefault(_reactDom); var _propTypes = __webpack_require__(5556); var _propTypes2 = _interopRequireDefault(_propTypes); var _ModalPortal = __webpack_require__(29090); var _ModalPortal2 = _interopRequireDefault(_ModalPortal); var _ariaAppHider = __webpack_require__(76462); var ariaAppHider = _interopRequireWildcard(_ariaAppHider); var _safeHTMLElement = __webpack_require__(60834); var _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement); var _reactLifecyclesCompat = __webpack_require__(71345); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var portalClassName = exports.portalClassName = "ReactModalPortal"; var bodyOpenClassName = exports.bodyOpenClassName = "ReactModal__Body--open"; var isReact16 = _safeHTMLElement.canUseDOM && _reactDom2.default.createPortal !== undefined; var getCreatePortal = function getCreatePortal() { return isReact16 ? _reactDom2.default.createPortal : _reactDom2.default.unstable_renderSubtreeIntoContainer; }; function getParentElement(parentSelector) { return parentSelector(); } var Modal = function (_Component) { _inherits(Modal, _Component); function Modal() { var _ref; var _temp, _this, _ret; _classCallCheck(this, Modal); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Modal.__proto__ || Object.getPrototypeOf(Modal)).call.apply(_ref, [this].concat(args))), _this), _this.removePortal = function () { !isReact16 && _reactDom2.default.unmountComponentAtNode(_this.node); var parent = getParentElement(_this.props.parentSelector); if (parent && parent.contains(_this.node)) { parent.removeChild(_this.node); } else { // eslint-disable-next-line no-console console.warn('React-Modal: "parentSelector" prop did not returned any DOM ' + "element. Make sure that the parent element is unmounted to " + "avoid any memory leaks."); } }, _this.portalRef = function (ref) { _this.portal = ref; }, _this.renderPortal = function (props) { var createPortal = getCreatePortal(); var portal = createPortal(_this, _react2.default.createElement(_ModalPortal2.default, _extends({ defaultStyles: Modal.defaultStyles }, props)), _this.node); _this.portalRef(portal); }, _temp), _possibleConstructorReturn(_this, _ret); } _createClass(Modal, [{ key: "componentDidMount", value: function componentDidMount() { if (!_safeHTMLElement.canUseDOM) return; if (!isReact16) { this.node = document.createElement("div"); } this.node.className = this.props.portalClassName; var parent = getParentElement(this.props.parentSelector); parent.appendChild(this.node); !isReact16 && this.renderPortal(this.props); } }, { key: "getSnapshotBeforeUpdate", value: function getSnapshotBeforeUpdate(prevProps) { var prevParent = getParentElement(prevProps.parentSelector); var nextParent = getParentElement(this.props.parentSelector); return { prevParent: prevParent, nextParent: nextParent }; } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps, _, snapshot) { if (!_safeHTMLElement.canUseDOM) return; var _props = this.props, isOpen = _props.isOpen, portalClassName = _props.portalClassName; if (prevProps.portalClassName !== portalClassName) { this.node.className = portalClassName; } var prevParent = snapshot.prevParent, nextParent = snapshot.nextParent; if (nextParent !== prevParent) { prevParent.removeChild(this.node); nextParent.appendChild(this.node); } // Stop unnecessary renders if modal is remaining closed if (!prevProps.isOpen && !isOpen) return; !isReact16 && this.renderPortal(this.props); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { if (!_safeHTMLElement.canUseDOM || !this.node || !this.portal) return; var state = this.portal.state; var now = Date.now(); var closesAt = state.isOpen && this.props.closeTimeoutMS && (state.closesAt || now + this.props.closeTimeoutMS); if (closesAt) { if (!state.beforeClose) { this.portal.closeWithTimeout(); } setTimeout(this.removePortal, closesAt - now); } else { this.removePortal(); } } }, { key: "render", value: function render() { if (!_safeHTMLElement.canUseDOM || !isReact16) { return null; } if (!this.node && isReact16) { this.node = document.createElement("div"); } var createPortal = getCreatePortal(); return createPortal(_react2.default.createElement(_ModalPortal2.default, _extends({ ref: this.portalRef, defaultStyles: Modal.defaultStyles }, this.props)), this.node); } }], [{ key: "setAppElement", value: function setAppElement(element) { ariaAppHider.setElement(element); } /* eslint-disable react/no-unused-prop-types */ /* eslint-enable react/no-unused-prop-types */ }]); return Modal; }(_react.Component); Modal.propTypes = { isOpen: _propTypes2.default.bool.isRequired, style: _propTypes2.default.shape({ content: _propTypes2.default.object, overlay: _propTypes2.default.object }), portalClassName: _propTypes2.default.string, bodyOpenClassName: _propTypes2.default.string, htmlOpenClassName: _propTypes2.default.string, className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({ base: _propTypes2.default.string.isRequired, afterOpen: _propTypes2.default.string.isRequired, beforeClose: _propTypes2.default.string.isRequired })]), overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({ base: _propTypes2.default.string.isRequired, afterOpen: _propTypes2.default.string.isRequired, beforeClose: _propTypes2.default.string.isRequired })]), appElement: _propTypes2.default.instanceOf(_safeHTMLElement2.default), onAfterOpen: _propTypes2.default.func, onRequestClose: _propTypes2.default.func, closeTimeoutMS: _propTypes2.default.number, ariaHideApp: _propTypes2.default.bool, shouldFocusAfterRender: _propTypes2.default.bool, shouldCloseOnOverlayClick: _propTypes2.default.bool, shouldReturnFocusAfterClose: _propTypes2.default.bool, preventScroll: _propTypes2.default.bool, parentSelector: _propTypes2.default.func, aria: _propTypes2.default.object, data: _propTypes2.default.object, role: _propTypes2.default.string, contentLabel: _propTypes2.default.string, shouldCloseOnEsc: _propTypes2.default.bool, overlayRef: _propTypes2.default.func, contentRef: _propTypes2.default.func, id: _propTypes2.default.string, overlayElement: _propTypes2.default.func, contentElement: _propTypes2.default.func }; Modal.defaultProps = { isOpen: false, portalClassName: portalClassName, bodyOpenClassName: bodyOpenClassName, role: "dialog", ariaHideApp: true, closeTimeoutMS: 0, shouldFocusAfterRender: true, shouldCloseOnEsc: true, shouldCloseOnOverlayClick: true, shouldReturnFocusAfterClose: true, preventScroll: false, parentSelector: function parentSelector() { return document.body; }, overlayElement: function overlayElement(props, contentEl) { return _react2.default.createElement( "div", props, contentEl ); }, contentElement: function contentElement(props, children) { return _react2.default.createElement( "div", props, children ); } }; Modal.defaultStyles = { overlay: { position: "fixed", top: 0, left: 0, right: 0, bottom: 0, backgroundColor: "rgba(255, 255, 255, 0.75)" }, content: { position: "absolute", top: "40px", left: "40px", right: "40px", bottom: "40px", border: "1px solid #ccc", background: "#fff", overflow: "auto", WebkitOverflowScrolling: "touch", borderRadius: "4px", outline: "none", padding: "20px" } }; (0, _reactLifecyclesCompat.polyfill)(Modal); exports["default"] = Modal; /***/ }), /***/ 29090: /***/ ((module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _react = __webpack_require__(96540); var _propTypes = __webpack_require__(5556); var _propTypes2 = _interopRequireDefault(_propTypes); var _focusManager = __webpack_require__(27791); var focusManager = _interopRequireWildcard(_focusManager); var _scopeTab = __webpack_require__(57067); var _scopeTab2 = _interopRequireDefault(_scopeTab); var _ariaAppHider = __webpack_require__(76462); var ariaAppHider = _interopRequireWildcard(_ariaAppHider); var _classList = __webpack_require__(24838); var classList = _interopRequireWildcard(_classList); var _safeHTMLElement = __webpack_require__(60834); var _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement); var _portalOpenInstances = __webpack_require__(49628); var _portalOpenInstances2 = _interopRequireDefault(_portalOpenInstances); __webpack_require__(77727); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // so that our CSS is statically analyzable var CLASS_NAMES = { overlay: "ReactModal__Overlay", content: "ReactModal__Content" }; var TAB_KEY = 9; var ESC_KEY = 27; var ariaHiddenInstances = 0; var ModalPortal = function (_Component) { _inherits(ModalPortal, _Component); function ModalPortal(props) { _classCallCheck(this, ModalPortal); var _this = _possibleConstructorReturn(this, (ModalPortal.__proto__ || Object.getPrototypeOf(ModalPortal)).call(this, props)); _this.setOverlayRef = function (overlay) { _this.overlay = overlay; _this.props.overlayRef && _this.props.overlayRef(overlay); }; _this.setContentRef = function (content) { _this.content = content; _this.props.contentRef && _this.props.contentRef(content); }; _this.afterClose = function () { var _this$props = _this.props, appElement = _this$props.appElement, ariaHideApp = _this$props.ariaHideApp, htmlOpenClassName = _this$props.htmlOpenClassName, bodyOpenClassName = _this$props.bodyOpenClassName; // Remove classes. bodyOpenClassName && classList.remove(document.body, bodyOpenClassName); htmlOpenClassName && classList.remove(document.getElementsByTagName("html")[0], htmlOpenClassName); // Reset aria-hidden attribute if all modals have been removed if (ariaHideApp && ariaHiddenInstances > 0) { ariaHiddenInstances -= 1; if (ariaHiddenInstances === 0) { ariaAppHider.show(appElement); } } if (_this.props.shouldFocusAfterRender) { if (_this.props.shouldReturnFocusAfterClose) { focusManager.returnFocus(_this.props.preventScroll); focusManager.teardownScopedFocus(); } else { focusManager.popWithoutFocus(); } } if (_this.props.onAfterClose) { _this.props.onAfterClose(); } _portalOpenInstances2.default.deregister(_this); }; _this.open = function () { _this.beforeOpen(); if (_this.state.afterOpen && _this.state.beforeClose) { clearTimeout(_this.closeTimer); _this.setState({ beforeClose: false }); } else { if (_this.props.shouldFocusAfterRender) { focusManager.setupScopedFocus(_this.node); focusManager.markForFocusLater(); } _this.setState({ isOpen: true }, function () { _this.setState({ afterOpen: true }); if (_this.props.isOpen && _this.props.onAfterOpen) { _this.props.onAfterOpen({ overlayEl: _this.overlay, contentEl: _this.content }); } }); } }; _this.close = function () { if (_this.props.closeTimeoutMS > 0) { _this.closeWithTimeout(); } else { _this.closeWithoutTimeout(); } }; _this.focusContent = function () { return _this.content && !_this.contentHasFocus() && _this.content.focus({ preventScroll: true }); }; _this.closeWithTimeout = function () { var closesAt = Date.now() + _this.props.closeTimeoutMS; _this.setState({ beforeClose: true, closesAt: closesAt }, function () { _this.closeTimer = setTimeout(_this.closeWithoutTimeout, _this.state.closesAt - Date.now()); }); }; _this.closeWithoutTimeout = function () { _this.setState({ beforeClose: false, isOpen: false, afterOpen: false, closesAt: null }, _this.afterClose); }; _this.handleKeyDown = function (event) { if (event.keyCode === TAB_KEY) { (0, _scopeTab2.default)(_this.content, event); } if (_this.props.shouldCloseOnEsc && event.keyCode === ESC_KEY) { event.stopPropagation(); _this.requestClose(event); } }; _this.handleOverlayOnClick = function (event) { if (_this.shouldClose === null) { _this.shouldClose = true; } if (_this.shouldClose && _this.props.shouldCloseOnOverlayClick) { if (_this.ownerHandlesClose()) { _this.requestClose(event); } else { _this.focusContent(); } } _this.shouldClose = null; }; _this.handleContentOnMouseUp = function () { _this.shouldClose = false; }; _this.handleOverlayOnMouseDown = function (event) { if (!_this.props.shouldCloseOnOverlayClick && event.target == _this.overlay) { event.preventDefault(); } }; _this.handleContentOnClick = function () { _this.shouldClose = false; }; _this.handleContentOnMouseDown = function () { _this.shouldClose = false; }; _this.requestClose = function (event) { return _this.ownerHandlesClose() && _this.props.onRequestClose(event); }; _this.ownerHandlesClose = function () { return _this.props.onRequestClose; }; _this.shouldBeClosed = function () { return !_this.state.isOpen && !_this.state.beforeClose; }; _this.contentHasFocus = function () { return document.activeElement === _this.content || _this.content.contains(document.activeElement); }; _this.buildClassName = function (which, additional) { var classNames = (typeof additional === "undefined" ? "undefined" : _typeof(additional)) === "object" ? additional : { base: CLASS_NAMES[which], afterOpen: CLASS_NAMES[which] + "--after-open", beforeClose: CLASS_NAMES[which] + "--before-close" }; var className = classNames.base; if (_this.state.afterOpen) { className = className + " " + classNames.afterOpen; } if (_this.state.beforeClose) { className = className + " " + classNames.beforeClose; } return typeof additional === "string" && additional ? className + " " + additional : className; }; _this.attributesFromObject = function (prefix, items) { return Object.keys(items).reduce(function (acc, name) { acc[prefix + "-" + name] = items[name]; return acc; }, {}); }; _this.state = { afterOpen: false, beforeClose: false }; _this.shouldClose = null; _this.moveFromContentToOverlay = null; return _this; } _createClass(ModalPortal, [{ key: "componentDidMount", value: function componentDidMount() { if (this.props.isOpen) { this.open(); } } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps, prevState) { if (false) {} if (this.props.isOpen && !prevProps.isOpen) { this.open(); } else if (!this.props.isOpen && prevProps.isOpen) { this.close(); } // Focus only needs to be set once when the modal is being opened if (this.props.shouldFocusAfterRender && this.state.isOpen && !prevState.isOpen) { this.focusContent(); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { if (this.state.isOpen) { this.afterClose(); } clearTimeout(this.closeTimer); } }, { key: "beforeOpen", value: function beforeOpen() { var _props = this.props, appElement = _props.appElement, ariaHideApp = _props.ariaHideApp, htmlOpenClassName = _props.htmlOpenClassName, bodyOpenClassName = _props.bodyOpenClassName; // Add classes. bodyOpenClassName && classList.add(document.body, bodyOpenClassName); htmlOpenClassName && classList.add(document.getElementsByTagName("html")[0], htmlOpenClassName); if (ariaHideApp) { ariaHiddenInstances += 1; ariaAppHider.hide(appElement); } _portalOpenInstances2.default.register(this); } // Don't steal focus from inner elements }, { key: "render", value: function render() { var _props2 = this.props, id = _props2.id, className = _props2.className, overlayClassName = _props2.overlayClassName, defaultStyles = _props2.defaultStyles, children = _props2.children; var contentStyles = className ? {} : defaultStyles.content; var overlayStyles = overlayClassName ? {} : defaultStyles.overlay; if (this.shouldBeClosed()) { return null; } var overlayProps = { ref: this.setOverlayRef, className: this.buildClassName("overlay", overlayClassName), style: _extends({}, overlayStyles, this.props.style.overlay), onClick: this.handleOverlayOnClick, onMouseDown: this.handleOverlayOnMouseDown }; var contentProps = _extends({ id: id, ref: this.setContentRef, style: _extends({}, contentStyles, this.props.style.content), className: this.buildClassName("content", className), tabIndex: "-1", onKeyDown: this.handleKeyDown, onMouseDown: this.handleContentOnMouseDown, onMouseUp: this.handleContentOnMouseUp, onClick: this.handleContentOnClick, role: this.props.role, "aria-label": this.props.contentLabel }, this.attributesFromObject("aria", _extends({ modal: true }, this.props.aria)), this.attributesFromObject("data", this.props.data || {}), { "data-testid": this.props.testId }); var contentElement = this.props.contentElement(contentProps, children); return this.props.overlayElement(overlayProps, contentElement); } }]); return ModalPortal; }(_react.Component); ModalPortal.defaultProps = { style: { overlay: {}, content: {} }, defaultStyles: {} }; ModalPortal.propTypes = { isOpen: _propTypes2.default.bool.isRequired, defaultStyles: _propTypes2.default.shape({ content: _propTypes2.default.object, overlay: _propTypes2.default.object }), style: _propTypes2.default.shape({ content: _propTypes2.default.object, overlay: _propTypes2.default.object }), className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]), overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]), bodyOpenClassName: _propTypes2.default.string, htmlOpenClassName: _propTypes2.default.string, ariaHideApp: _propTypes2.default.bool, appElement: _propTypes2.default.instanceOf(_safeHTMLElement2.default), onAfterOpen: _propTypes2.default.func, onAfterClose: _propTypes2.default.func, onRequestClose: _propTypes2.default.func, closeTimeoutMS: _propTypes2.default.number, shouldFocusAfterRender: _propTypes2.default.bool, shouldCloseOnOverlayClick: _propTypes2.default.bool, shouldReturnFocusAfterClose: _propTypes2.default.bool, preventScroll: _propTypes2.default.bool, role: _propTypes2.default.string, contentLabel: _propTypes2.default.string, aria: _propTypes2.default.object, data: _propTypes2.default.object, children: _propTypes2.default.node, shouldCloseOnEsc: _propTypes2.default.bool, overlayRef: _propTypes2.default.func, contentRef: _propTypes2.default.func, id: _propTypes2.default.string, overlayElement: _propTypes2.default.func, contentElement: _propTypes2.default.func, testId: _propTypes2.default.string }; exports["default"] = ModalPortal; module.exports = exports["default"]; /***/ }), /***/ 76462: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.assertNodeList = assertNodeList; exports.setElement = setElement; exports.validateElement = validateElement; exports.hide = hide; exports.show = show; exports.documentNotReadyOrSSRTesting = documentNotReadyOrSSRTesting; exports.resetForTesting = resetForTesting; var _warning = __webpack_require__(9771); var _warning2 = _interopRequireDefault(_warning); var _safeHTMLElement = __webpack_require__(60834); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var globalElement = null; function assertNodeList(nodeList, selector) { if (!nodeList || !nodeList.length) { throw new Error("react-modal: No elements were found for selector " + selector + "."); } } function setElement(element) { var useElement = element; if (typeof useElement === "string" && _safeHTMLElement.canUseDOM) { var el = document.querySelectorAll(useElement); assertNodeList(el, useElement); useElement = "length" in el ? el[0] : el; } globalElement = useElement || globalElement; return globalElement; } function validateElement(appElement) { if (!appElement && !globalElement) { (0, _warning2.default)(false, ["react-modal: App element is not defined.", "Please use `Modal.setAppElement(el)` or set `appElement={el}`.", "This is needed so screen readers don't see main content", "when modal is opened. It is not recommended, but you can opt-out", "by setting `ariaHideApp={false}`."].join(" ")); return false; } return true; } function hide(appElement) { if (validateElement(appElement)) { (appElement || globalElement).setAttribute("aria-hidden", "true"); } } function show(appElement) { if (validateElement(appElement)) { (appElement || globalElement).removeAttribute("aria-hidden"); } } function documentNotReadyOrSSRTesting() { globalElement = null; } function resetForTesting() { globalElement = null; } /***/ }), /***/ 77727: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var _portalOpenInstances = __webpack_require__(49628); var _portalOpenInstances2 = _interopRequireDefault(_portalOpenInstances); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // Body focus trap see Issue #742 var before = void 0, after = void 0, instances = []; function focusContent() { if (instances.length === 0) { if (false) {} return; } instances[instances.length - 1].focusContent(); } function bodyTrap(eventType, openInstances) { if (!before || !after) { before = document.createElement("div"); before.setAttribute("data-react-modal-body-trap", ""); before.style.position = "absolute"; before.style.opacity = "0"; before.setAttribute("tabindex", "0"); before.addEventListener("focus", focusContent); after = before.cloneNode(); after.addEventListener("focus", focusContent); } instances = openInstances; if (instances.length > 0) { // Add focus trap if (document.body.firstChild !== before) { document.body.insertBefore(before, document.body.firstChild); } if (document.body.lastChild !== after) { document.body.appendChild(after); } } else { // Remove focus trap if (before.parentElement) { before.parentElement.removeChild(before); } if (after.parentElement) { after.parentElement.removeChild(after); } } } _portalOpenInstances2.default.subscribe(bodyTrap); /***/ }), /***/ 24838: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.dumpClassLists = dumpClassLists; var htmlClassList = {}; var docBodyClassList = {}; function dumpClassLists() { if (false) { var _x, x, buffer, classes; } } /** * Track the number of reference of a class. * @param {object} poll The poll to receive the reference. * @param {string} className The class name. * @return {string} */ var incrementReference = function incrementReference(poll, className) { if (!poll[className]) { poll[className] = 0; } poll[className] += 1; return className; }; /** * Drop the reference of a class. * @param {object} poll The poll to receive the reference. * @param {string} className The class name. * @return {string} */ var decrementReference = function decrementReference(poll, className) { if (poll[className]) { poll[className] -= 1; } return className; }; /** * Track a class and add to the given class list. * @param {Object} classListRef A class list of an element. * @param {Object} poll The poll to be used. * @param {Array} classes The list of classes to be tracked. */ var trackClass = function trackClass(classListRef, poll, classes) { classes.forEach(function (className) { incrementReference(poll, className); classListRef.add(className); }); }; /** * Untrack a class and remove from the given class list if the reference * reaches 0. * @param {Object} classListRef A class list of an element. * @param {Object} poll The poll to be used. * @param {Array} classes The list of classes to be untracked. */ var untrackClass = function untrackClass(classListRef, poll, classes) { classes.forEach(function (className) { decrementReference(poll, className); poll[className] === 0 && classListRef.remove(className); }); }; /** * Public inferface to add classes to the document.body. * @param {string} bodyClass The class string to be added. * It may contain more then one class * with ' ' as separator. */ var add = exports.add = function add(element, classString) { return trackClass(element.classList, element.nodeName.toLowerCase() == "html" ? htmlClassList : docBodyClassList, classString.split(" ")); }; /** * Public inferface to remove classes from the document.body. * @param {string} bodyClass The class string to be added. * It may contain more then one class * with ' ' as separator. */ var remove = exports.remove = function remove(element, classString) { return untrackClass(element.classList, element.nodeName.toLowerCase() == "html" ? htmlClassList : docBodyClassList, classString.split(" ")); }; /***/ }), /***/ 27791: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.handleBlur = handleBlur; exports.handleFocus = handleFocus; exports.markForFocusLater = markForFocusLater; exports.returnFocus = returnFocus; exports.popWithoutFocus = popWithoutFocus; exports.setupScopedFocus = setupScopedFocus; exports.teardownScopedFocus = teardownScopedFocus; var _tabbable = __webpack_require__(42411); var _tabbable2 = _interopRequireDefault(_tabbable); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var focusLaterElements = []; var modalElement = null; var needToFocus = false; function handleBlur() { needToFocus = true; } function handleFocus() { if (needToFocus) { needToFocus = false; if (!modalElement) { return; } // need to see how jQuery shims document.on('focusin') so we don't need the // setTimeout, firefox doesn't support focusin, if it did, we could focus // the element outside of a setTimeout. Side-effect of this implementation // is that the document.body gets focus, and then we focus our element right // after, seems fine. setTimeout(function () { if (modalElement.contains(document.activeElement)) { return; } var el = (0, _tabbable2.default)(modalElement)[0] || modalElement; el.focus(); }, 0); } } function markForFocusLater() { focusLaterElements.push(document.activeElement); } /* eslint-disable no-console */ function returnFocus() { var preventScroll = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var toFocus = null; try { if (focusLaterElements.length !== 0) { toFocus = focusLaterElements.pop(); toFocus.focus({ preventScroll: preventScroll }); } return; } catch (e) { console.warn(["You tried to return focus to", toFocus, "but it is not in the DOM anymore"].join(" ")); } } /* eslint-enable no-console */ function popWithoutFocus() { focusLaterElements.length > 0 && focusLaterElements.pop(); } function setupScopedFocus(element) { modalElement = element; if (window.addEventListener) { window.addEventListener("blur", handleBlur, false); document.addEventListener("focus", handleFocus, true); } else { window.attachEvent("onBlur", handleBlur); document.attachEvent("onFocus", handleFocus); } } function teardownScopedFocus() { modalElement = null; if (window.addEventListener) { window.removeEventListener("blur", handleBlur); document.removeEventListener("focus", handleFocus); } else { window.detachEvent("onBlur", handleBlur); document.detachEvent("onFocus", handleFocus); } } /***/ }), /***/ 49628: /***/ ((module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } // Tracks portals that are open and emits events to subscribers var PortalOpenInstances = function PortalOpenInstances() { var _this = this; _classCallCheck(this, PortalOpenInstances); this.register = function (openInstance) { if (_this.openInstances.indexOf(openInstance) !== -1) { if (false) {} return; } _this.openInstances.push(openInstance); _this.emit("register"); }; this.deregister = function (openInstance) { var index = _this.openInstances.indexOf(openInstance); if (index === -1) { if (false) {} return; } _this.openInstances.splice(index, 1); _this.emit("deregister"); }; this.subscribe = function (callback) { _this.subscribers.push(callback); }; this.emit = function (eventType) { _this.subscribers.forEach(function (subscriber) { return subscriber(eventType, // shallow copy to avoid accidental mutation _this.openInstances.slice()); }); }; this.openInstances = []; this.subscribers = []; }; var portalOpenInstances = new PortalOpenInstances(); exports["default"] = portalOpenInstances; module.exports = exports["default"]; /***/ }), /***/ 60834: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.canUseDOM = undefined; var _exenv = __webpack_require__(50411); var _exenv2 = _interopRequireDefault(_exenv); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var EE = _exenv2.default; var SafeHTMLElement = EE.canUseDOM ? window.HTMLElement : {}; var canUseDOM = exports.canUseDOM = EE.canUseDOM; exports["default"] = SafeHTMLElement; /***/ }), /***/ 57067: /***/ ((module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = scopeTab; var _tabbable = __webpack_require__(42411); var _tabbable2 = _interopRequireDefault(_tabbable); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function scopeTab(node, event) { var tabbable = (0, _tabbable2.default)(node); if (!tabbable.length) { // Do nothing, since there are no elements that can receive focus. event.preventDefault(); return; } var target = void 0; var shiftKey = event.shiftKey; var head = tabbable[0]; var tail = tabbable[tabbable.length - 1]; // proceed with default browser behavior on tab. // Focus on last element on shift + tab. if (node === document.activeElement) { if (!shiftKey) return; target = tail; } if (tail === document.activeElement && !shiftKey) { target = head; } if (head === document.activeElement && shiftKey) { target = tail; } if (target) { event.preventDefault(); target.focus(); return; } // Safari radio issue. // // Safari does not move the focus to the radio button, // so we need to force it to really walk through all elements. // // This is very error prone, since we are trying to guess // if it is a safari browser from the first occurence between // chrome or safari. // // The chrome user agent contains the first ocurrence // as the 'chrome/version' and later the 'safari/version'. var checkSafari = /(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent); var isSafariDesktop = checkSafari != null && checkSafari[1] != "Chrome" && /\biPod\b|\biPad\b/g.exec(navigator.userAgent) == null; // If we are not in safari desktop, let the browser control // the focus if (!isSafariDesktop) return; var x = tabbable.indexOf(document.activeElement); if (x > -1) { x += shiftKey ? -1 : 1; } target = tabbable[x]; // If the tabbable element does not exist, // focus head/tail based on shiftKey if (typeof target === "undefined") { event.preventDefault(); target = shiftKey ? tail : head; target.focus(); return; } event.preventDefault(); target.focus(); } module.exports = exports["default"]; /***/ }), /***/ 42411: /***/ ((module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = findTabbableDescendants; /*! * Adapted from jQuery UI core * * http://jqueryui.com * * Copyright 2014 jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * http://api.jqueryui.com/category/ui-core/ */ var tabbableNode = /input|select|textarea|button|object/; function hidesContents(element) { var zeroSize = element.offsetWidth <= 0 && element.offsetHeight <= 0; // If the node is empty, this is good enough if (zeroSize && !element.innerHTML) return true; // Otherwise we need to check some styles var style = window.getComputedStyle(element); return zeroSize ? style.getPropertyValue("overflow") !== "visible" || // if 'overflow: visible' set, check if there is actually any overflow element.scrollWidth <= 0 && element.scrollHeight <= 0 : style.getPropertyValue("display") == "none"; } function visible(element) { var parentElement = element; while (parentElement) { if (parentElement === document.body) break; if (hidesContents(parentElement)) return false; parentElement = parentElement.parentNode; } return true; } function focusable(element, isTabIndexNotNaN) { var nodeName = element.nodeName.toLowerCase(); var res = tabbableNode.test(nodeName) && !element.disabled || (nodeName === "a" ? element.href || isTabIndexNotNaN : isTabIndexNotNaN); return res && visible(element); } function tabbable(element) { var tabIndex = element.getAttribute("tabindex"); if (tabIndex === null) tabIndex = undefined; var isTabIndexNaN = isNaN(tabIndex); return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN); } function findTabbableDescendants(element) { return [].slice.call(element.querySelectorAll("*"), 0).filter(tabbable); } module.exports = exports["default"]; /***/ }), /***/ 20312: /***/ ((module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var _Modal = __webpack_require__(1720); var _Modal2 = _interopRequireDefault(_Modal); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports["default"] = _Modal2.default; module.exports = exports["default"]; /***/ }), /***/ 3603: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; exports.__esModule = true; var _react = __webpack_require__(96540); var _react2 = _interopRequireDefault(_react); var _propTypes = __webpack_require__(5556); var _propTypes2 = _interopRequireDefault(_propTypes); var _a11yFocusScope = __webpack_require__(5857); var _a11yFocusScope2 = _interopRequireDefault(_a11yFocusScope); var _a11yFocusStore = __webpack_require__(59828); var _a11yFocusStore2 = _interopRequireDefault(_a11yFocusStore); var _exenv = __webpack_require__(50411); var _exenv2 = _interopRequireDefault(_exenv); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function setFocusOn(applicationElement, element) { _a11yFocusStore2.default.storeFocus(); if (applicationElement) applicationElement.setAttribute('aria-hidden', 'true'); _a11yFocusScope2.default.scopeFocus(element); } function resetFocus(applicationElement) { _a11yFocusScope2.default.unscopeFocus(); if (applicationElement) applicationElement.removeAttribute('aria-hidden'); _a11yFocusStore2.default.restoreFocus(); } var ReactModal2 = function (_React$Component) { _inherits(ReactModal2, _React$Component); function ReactModal2() { var _temp, _this, _ret; _classCallCheck(this, ReactModal2); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.backdropMouseDown = false, _this.backdropMouseUp = false, _this.handleDocumentKeydown = function (event) { if (_this.props.closeOnEsc && event.keyCode === 27) { _this.props.onClose(); } }, _this.handleBackdropMouseDown = function (event) { _this.backdropMouseDown = !_this.modal.contains(event.target); }, _this.handleBackdropMouseUp = function (event) { _this.backdropMouseUp = !_this.modal.contains(event.target); }, _this.handleBackdropClick = function () { if (_this.props.closeOnBackdropClick && _this.backdropMouseDown && _this.backdropMouseUp) { _this.props.onClose(); } _this.backdropMouseDown = false; _this.backdropMouseUp = false; }, _this.handleModalClick = function (event) { event.stopPropagation(); }, _temp), _possibleConstructorReturn(_this, _ret); } ReactModal2.getApplicationElement = function getApplicationElement() { console.warn('`ReactModal2.getApplicationElement` needs to be set for accessibility reasons'); }; ReactModal2.prototype.componentDidMount = function componentDidMount() { if (_exenv2.default.canUseDOM) { setFocusOn(ReactModal2.getApplicationElement(), this.modal); document.addEventListener('keydown', this.handleDocumentKeydown); } }; ReactModal2.prototype.componentWillUnmount = function componentWillUnmount() { if (_exenv2.default.canUseDOM) { resetFocus(ReactModal2.getApplicationElement()); document.removeEventListener('keydown', this.handleDocumentKeydown); } }; ReactModal2.prototype.render = function render() { var _this2 = this; return _react2.default.createElement( 'div', { ref: function ref(i) { return _this2.backdrop = i; }, className: this.props.backdropClassName, style: this.props.backdropStyles, onMouseDown: this.handleBackdropMouseDown, onMouseUp: this.handleBackdropMouseUp, onClick: this.handleBackdropClick }, _react2.default.createElement( 'div', { ref: function ref(i) { return _this2.modal = i; }, className: this.props.modalClassName, style: this.props.modalStyles, onClick: this.handleModalClick, tabIndex: '-1' }, this.props.children ) ); }; return ReactModal2; }(_react2.default.Component); ReactModal2.propTypes = { onClose: _propTypes2.default.func.isRequired, closeOnEsc: _propTypes2.default.bool, closeOnBackdropClick: _propTypes2.default.bool, backdropClassName: _propTypes2.default.string, backdropStyles: _propTypes2.default.object, modalClassName: _propTypes2.default.string, modalStyles: _propTypes2.default.object }; ReactModal2.defaultProps = { closeOnEsc: true, closeOnBackdropClick: true }; exports["default"] = ReactModal2; /***/ }), /***/ 48690: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; __webpack_unused_export__ = true; exports.A = undefined; var _Modal = __webpack_require__(3603); var _Modal2 = _interopRequireDefault(_Modal); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.A = _Modal2.default; /***/ }), /***/ 58861: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; exports.__esModule = true; exports["default"] = all; var _createChainableTypeChecker = __webpack_require__(88654); var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function all() { for (var _len = arguments.length, validators = Array(_len), _key = 0; _key < _len; _key++) { validators[_key] = arguments[_key]; } function allPropTypes() { for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } var error = null; validators.forEach(function (validator) { if (error != null) { return; } var result = validator.apply(undefined, args); if (result != null) { error = result; } }); return error; } return (0, _createChainableTypeChecker2.default)(allPropTypes); } /***/ }), /***/ 44866: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; exports.__esModule = true; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; var _react = __webpack_require__(96540); var _react2 = _interopRequireDefault(_react); var _createChainableTypeChecker = __webpack_require__(88654); var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue); if (_react2.default.isValidElement(propValue)) { return new Error('Invalid ' + location + ' `' + propFullName + '` of type ReactElement ' + ('supplied to `' + componentName + '`, expected a ReactComponent or a ') + 'DOMElement. You can usually obtain a ReactComponent or DOMElement ' + 'from a ReactElement by attaching a ref to it.'); } if ((propType !== 'object' || typeof propValue.render !== 'function') && propValue.nodeType !== 1) { return new Error('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected a ReactComponent or a ') + 'DOMElement.'); } return null; } exports["default"] = (0, _createChainableTypeChecker2.default)(validate); /***/ }), /***/ 71225: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; exports.__esModule = true; exports["default"] = deprecated; var _warning = __webpack_require__(29038); var _warning2 = _interopRequireDefault(_warning); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var warned = {}; function deprecated(validator, reason) { return function validate(props, propName, componentName, location, propFullName) { var componentNameSafe = componentName || '<>'; var propFullNameSafe = propFullName || propName; if (props[propName] != null) { var messageKey = componentName + '.' + propName; (0, _warning2.default)(warned[messageKey], 'The ' + location + ' `' + propFullNameSafe + '` of ' + ('`' + componentNameSafe + '` is deprecated. ' + reason + '.')); warned[messageKey] = true; } for (var _len = arguments.length, args = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) { args[_key - 5] = arguments[_key]; } return validator.apply(undefined, [props, propName, componentName, location, propFullName].concat(args)); }; } /* eslint-disable no-underscore-dangle */ function _resetWarned() { warned = {}; } deprecated._resetWarned = _resetWarned; /* eslint-enable no-underscore-dangle */ /***/ }), /***/ 69802: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; exports.__esModule = true; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; var _react = __webpack_require__(96540); var _react2 = _interopRequireDefault(_react); var _createChainableTypeChecker = __webpack_require__(88654); var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function elementType(props, propName, componentName, location, propFullName) { var propValue = props[propName]; var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue); if (_react2.default.isValidElement(propValue)) { return new Error('Invalid ' + location + ' `' + propFullName + '` of type ReactElement ' + ('supplied to `' + componentName + '`, expected an element type (a string ') + 'or a ReactClass).'); } if (propType !== 'function' && propType !== 'string') { return new Error('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected an element type (a string ') + 'or a ReactClass).'); } return null; } exports["default"] = (0, _createChainableTypeChecker2.default)(elementType); /***/ }), /***/ 70014: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; exports.__esModule = true; exports.isRequiredForA11y = exports.elementType = exports.deprecated = exports.componentOrElement = exports.all = undefined; var _all2 = __webpack_require__(58861); var _all3 = _interopRequireDefault(_all2); var _componentOrElement2 = __webpack_require__(44866); var _componentOrElement3 = _interopRequireDefault(_componentOrElement2); var _deprecated2 = __webpack_require__(71225); var _deprecated3 = _interopRequireDefault(_deprecated2); var _elementType2 = __webpack_require__(69802); var _elementType3 = _interopRequireDefault(_elementType2); var _isRequiredForA11y2 = __webpack_require__(6794); var _isRequiredForA11y3 = _interopRequireDefault(_isRequiredForA11y2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.all = _all3.default; exports.componentOrElement = _componentOrElement3.default; exports.deprecated = _deprecated3.default; exports.elementType = _elementType3.default; exports.isRequiredForA11y = _isRequiredForA11y3.default; /***/ }), /***/ 6794: /***/ ((__unused_webpack_module, exports) => { "use strict"; exports.__esModule = true; exports["default"] = isRequiredForA11y; function isRequiredForA11y(validator) { return function validate(props, propName, componentName, location, propFullName) { var componentNameSafe = componentName || '<>'; var propFullNameSafe = propFullName || propName; if (props[propName] == null) { return new Error('The ' + location + ' `' + propFullNameSafe + '` is required to make ' + ('`' + componentNameSafe + '` accessible for users of assistive ') + 'technologies such as screen readers.'); } for (var _len = arguments.length, args = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) { args[_key - 5] = arguments[_key]; } return validator.apply(undefined, [props, propName, componentName, location, propFullName].concat(args)); }; } /***/ }), /***/ 88654: /***/ ((__unused_webpack_module, exports) => { "use strict"; exports.__esModule = true; exports["default"] = createChainableTypeChecker; /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ // Mostly taken from ReactPropTypes. function createChainableTypeChecker(validate) { function checkType(isRequired, props, propName, componentName, location, propFullName) { var componentNameSafe = componentName || '<>'; var propFullNameSafe = propFullName || propName; if (props[propName] == null) { if (isRequired) { return new Error('Required ' + location + ' `' + propFullNameSafe + '` was not specified ' + ('in `' + componentNameSafe + '`.')); } return null; } for (var _len = arguments.length, args = Array(_len > 6 ? _len - 6 : 0), _key = 6; _key < _len; _key++) { args[_key - 6] = arguments[_key]; } return validate.apply(undefined, [props, propName, componentNameSafe, location, propFullNameSafe].concat(args)); } var chainedCheckType = checkType.bind(null, false); chainedCheckType.isRequired = checkType.bind(null, true); return chainedCheckType; } /***/ }), /***/ 29038: /***/ ((module) => { "use strict"; /** * Copyright 2014-2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ /** * Similar to invariant but only logs a warning if the condition is not met. * This can be used to log issues in development environments in critical * paths. Removing the logging code for production environments will keep the * same logic and follow the same code paths. */ var warning = function() {}; if (false) {} module.exports = warning; /***/ }), /***/ 11541: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { A: () => (/* binding */ AsyncSelect$1) }); // UNUSED EXPORTS: useAsync // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js var esm_extends = __webpack_require__(58168); // EXTERNAL MODULE: ./node_modules/react/index.js var react = __webpack_require__(96540); // EXTERNAL MODULE: ./node_modules/react-select/dist/Select-ef7c0426.esm.js + 12 modules var Select_ef7c0426_esm = __webpack_require__(8546); // EXTERNAL MODULE: ./node_modules/react-select/dist/useStateManager-7e1e8489.esm.js var useStateManager_7e1e8489_esm = __webpack_require__(30455); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js var defineProperty = __webpack_require__(64467); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js var objectSpread2 = __webpack_require__(89379); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 3 modules var slicedToArray = __webpack_require__(80296); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js var objectWithoutProperties = __webpack_require__(80045); // EXTERNAL MODULE: ./node_modules/react-select/dist/index-641ee5b8.esm.js + 4 modules var index_641ee5b8_esm = __webpack_require__(16804); ;// ./node_modules/react-select/dist/useAsync-c64f5536.esm.js var _excluded = ["defaultOptions", "cacheOptions", "loadOptions", "options", "isLoading", "onInputChange", "filterOption"]; function useAsync(_ref) { var _ref$defaultOptions = _ref.defaultOptions, propsDefaultOptions = _ref$defaultOptions === void 0 ? false : _ref$defaultOptions, _ref$cacheOptions = _ref.cacheOptions, cacheOptions = _ref$cacheOptions === void 0 ? false : _ref$cacheOptions, propsLoadOptions = _ref.loadOptions; _ref.options; var _ref$isLoading = _ref.isLoading, propsIsLoading = _ref$isLoading === void 0 ? false : _ref$isLoading, propsOnInputChange = _ref.onInputChange, _ref$filterOption = _ref.filterOption, filterOption = _ref$filterOption === void 0 ? null : _ref$filterOption, restSelectProps = (0,objectWithoutProperties/* default */.A)(_ref, _excluded); var propsInputValue = restSelectProps.inputValue; var lastRequest = (0,react.useRef)(undefined); var mounted = (0,react.useRef)(false); var _useState = (0,react.useState)(Array.isArray(propsDefaultOptions) ? propsDefaultOptions : undefined), _useState2 = (0,slicedToArray/* default */.A)(_useState, 2), defaultOptions = _useState2[0], setDefaultOptions = _useState2[1]; var _useState3 = (0,react.useState)(typeof propsInputValue !== 'undefined' ? propsInputValue : ''), _useState4 = (0,slicedToArray/* default */.A)(_useState3, 2), stateInputValue = _useState4[0], setStateInputValue = _useState4[1]; var _useState5 = (0,react.useState)(propsDefaultOptions === true), _useState6 = (0,slicedToArray/* default */.A)(_useState5, 2), isLoading = _useState6[0], setIsLoading = _useState6[1]; var _useState7 = (0,react.useState)(undefined), _useState8 = (0,slicedToArray/* default */.A)(_useState7, 2), loadedInputValue = _useState8[0], setLoadedInputValue = _useState8[1]; var _useState9 = (0,react.useState)([]), _useState10 = (0,slicedToArray/* default */.A)(_useState9, 2), loadedOptions = _useState10[0], setLoadedOptions = _useState10[1]; var _useState11 = (0,react.useState)(false), _useState12 = (0,slicedToArray/* default */.A)(_useState11, 2), passEmptyOptions = _useState12[0], setPassEmptyOptions = _useState12[1]; var _useState13 = (0,react.useState)({}), _useState14 = (0,slicedToArray/* default */.A)(_useState13, 2), optionsCache = _useState14[0], setOptionsCache = _useState14[1]; var _useState15 = (0,react.useState)(undefined), _useState16 = (0,slicedToArray/* default */.A)(_useState15, 2), prevDefaultOptions = _useState16[0], setPrevDefaultOptions = _useState16[1]; var _useState17 = (0,react.useState)(undefined), _useState18 = (0,slicedToArray/* default */.A)(_useState17, 2), prevCacheOptions = _useState18[0], setPrevCacheOptions = _useState18[1]; if (cacheOptions !== prevCacheOptions) { setOptionsCache({}); setPrevCacheOptions(cacheOptions); } if (propsDefaultOptions !== prevDefaultOptions) { setDefaultOptions(Array.isArray(propsDefaultOptions) ? propsDefaultOptions : undefined); setPrevDefaultOptions(propsDefaultOptions); } (0,react.useEffect)(function () { mounted.current = true; return function () { mounted.current = false; }; }, []); var loadOptions = (0,react.useCallback)(function (inputValue, callback) { if (!propsLoadOptions) return callback(); var loader = propsLoadOptions(inputValue, callback); if (loader && typeof loader.then === 'function') { loader.then(callback, function () { return callback(); }); } }, [propsLoadOptions]); (0,react.useEffect)(function () { if (propsDefaultOptions === true) { loadOptions(stateInputValue, function (options) { if (!mounted.current) return; setDefaultOptions(options || []); setIsLoading(!!lastRequest.current); }); } // NOTE: this effect is designed to only run when the component mounts, // so we don't want to include any hook dependencies // eslint-disable-next-line react-hooks/exhaustive-deps }, []); var onInputChange = (0,react.useCallback)(function (newValue, actionMeta) { var inputValue = (0,index_641ee5b8_esm.L)(newValue, actionMeta, propsOnInputChange); if (!inputValue) { lastRequest.current = undefined; setStateInputValue(''); setLoadedInputValue(''); setLoadedOptions([]); setIsLoading(false); setPassEmptyOptions(false); return; } if (cacheOptions && optionsCache[inputValue]) { setStateInputValue(inputValue); setLoadedInputValue(inputValue); setLoadedOptions(optionsCache[inputValue]); setIsLoading(false); setPassEmptyOptions(false); } else { var request = lastRequest.current = {}; setStateInputValue(inputValue); setIsLoading(true); setPassEmptyOptions(!loadedInputValue); loadOptions(inputValue, function (options) { if (!mounted) return; if (request !== lastRequest.current) return; lastRequest.current = undefined; setIsLoading(false); setLoadedInputValue(inputValue); setLoadedOptions(options || []); setPassEmptyOptions(false); setOptionsCache(options ? (0,objectSpread2/* default */.A)((0,objectSpread2/* default */.A)({}, optionsCache), {}, (0,defineProperty/* default */.A)({}, inputValue, options)) : optionsCache); }); } }, [cacheOptions, loadOptions, loadedInputValue, optionsCache, propsOnInputChange]); var options = passEmptyOptions ? [] : stateInputValue && loadedInputValue ? loadedOptions : defaultOptions || []; return (0,objectSpread2/* default */.A)((0,objectSpread2/* default */.A)({}, restSelectProps), {}, { options: options, isLoading: isLoading || propsIsLoading, onInputChange: onInputChange, filterOption: filterOption }); } // EXTERNAL MODULE: ./node_modules/react-dom/index.js var react_dom = __webpack_require__(40961); // EXTERNAL MODULE: ./node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js var use_isomorphic_layout_effect_browser_esm = __webpack_require__(27003); ;// ./node_modules/react-select/async/dist/react-select-async.esm.js var AsyncSelect = /*#__PURE__*/(0,react.forwardRef)(function (props, ref) { var stateManagedProps = useAsync(props); var selectProps = (0,useStateManager_7e1e8489_esm.u)(stateManagedProps); return /*#__PURE__*/react.createElement(Select_ef7c0426_esm.S, (0,esm_extends/* default */.A)({ ref: ref }, selectProps)); }); var AsyncSelect$1 = AsyncSelect; /***/ }), /***/ 8546: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { S: () => (/* binding */ Select), c: () => (/* binding */ createFilter), d: () => (/* binding */ defaultTheme), m: () => (/* binding */ mergeStyles) }); // UNUSED EXPORTS: a, b, g // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js var esm_extends = __webpack_require__(58168); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js var objectSpread2 = __webpack_require__(89379); ;// ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js + 1 modules var toPropertyKey = __webpack_require__(20816); ;// ./node_modules/@babel/runtime/helpers/esm/createClass.js function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, (0,toPropertyKey/* default */.A)(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js var setPrototypeOf = __webpack_require__(63662); ;// ./node_modules/@babel/runtime/helpers/esm/inherits.js function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && (0,setPrototypeOf/* default */.A)(t, e); } ;// ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } ;// ./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js var esm_typeof = __webpack_require__(82284); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js var assertThisInitialized = __webpack_require__(9417); ;// ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js function _possibleConstructorReturn(t, e) { if (e && ("object" == (0,esm_typeof/* default */.A)(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return (0,assertThisInitialized/* default */.A)(t); } ;// ./node_modules/@babel/runtime/helpers/esm/createSuper.js function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; } // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js var arrayLikeToArray = __webpack_require__(43145); ;// ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js function _arrayWithoutHoles(r) { if (Array.isArray(r)) return (0,arrayLikeToArray/* default */.A)(r); } ;// ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js var unsupportedIterableToArray = __webpack_require__(27800); ;// ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } ;// ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || (0,unsupportedIterableToArray/* default */.A)(r) || _nonIterableSpread(); } // EXTERNAL MODULE: ./node_modules/react/index.js var react = __webpack_require__(96540); // EXTERNAL MODULE: ./node_modules/react-select/dist/index-641ee5b8.esm.js + 4 modules var index_641ee5b8_esm = __webpack_require__(16804); // EXTERNAL MODULE: ./node_modules/@emotion/react/dist/emotion-react.browser.esm.js var emotion_react_browser_esm = __webpack_require__(17437); ;// ./node_modules/memoize-one/dist/memoize-one.esm.js var safeIsNaN = Number.isNaN || function ponyfill(value) { return typeof value === 'number' && value !== value; }; function isEqual(first, second) { if (first === second) { return true; } if (safeIsNaN(first) && safeIsNaN(second)) { return true; } return false; } function areInputsEqual(newInputs, lastInputs) { if (newInputs.length !== lastInputs.length) { return false; } for (var i = 0; i < newInputs.length; i++) { if (!isEqual(newInputs[i], lastInputs[i])) { return false; } } return true; } function memoizeOne(resultFn, isEqual) { if (isEqual === void 0) { isEqual = areInputsEqual; } var cache = null; function memoized() { var newArgs = []; for (var _i = 0; _i < arguments.length; _i++) { newArgs[_i] = arguments[_i]; } if (cache && cache.lastThis === this && isEqual(newArgs, cache.lastArgs)) { return cache.lastResult; } var lastResult = resultFn.apply(this, newArgs); cache = { lastResult: lastResult, lastArgs: newArgs, lastThis: this, }; return lastResult; } memoized.clear = function clear() { cache = null; }; return memoized; } // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js var objectWithoutProperties = __webpack_require__(80045); ;// ./node_modules/react-select/dist/Select-ef7c0426.esm.js function _EMOTION_STRINGIFIED_CSS_ERROR__$2() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } // Assistive text to describe visual elements. Hidden for sighted users. var _ref = true ? { name: "7pg0cj-a11yText", styles: "label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap" } : 0; var A11yText = function A11yText(props) { return (0,emotion_react_browser_esm/* jsx */.Y)("span", (0,esm_extends/* default */.A)({ css: _ref }, props)); }; var A11yText$1 = A11yText; var defaultAriaLiveMessages = { guidance: function guidance(props) { var isSearchable = props.isSearchable, isMulti = props.isMulti, tabSelectsValue = props.tabSelectsValue, context = props.context, isInitialFocus = props.isInitialFocus; switch (context) { case 'menu': return "Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(tabSelectsValue ? ', press Tab to select the option and exit the menu' : '', "."); case 'input': return isInitialFocus ? "".concat(props['aria-label'] || 'Select', " is focused ").concat(isSearchable ? ',type to refine list' : '', ", press Down to open the menu, ").concat(isMulti ? ' press left to focus selected values' : '') : ''; case 'value': return 'Use left and right to toggle between focused values, press Backspace to remove the currently focused value'; default: return ''; } }, onChange: function onChange(props) { var action = props.action, _props$label = props.label, label = _props$label === void 0 ? '' : _props$label, labels = props.labels, isDisabled = props.isDisabled; switch (action) { case 'deselect-option': case 'pop-value': case 'remove-value': return "option ".concat(label, ", deselected."); case 'clear': return 'All selected options have been cleared.'; case 'initial-input-focus': return "option".concat(labels.length > 1 ? 's' : '', " ").concat(labels.join(','), ", selected."); case 'select-option': return isDisabled ? "option ".concat(label, " is disabled. Select another option.") : "option ".concat(label, ", selected."); default: return ''; } }, onFocus: function onFocus(props) { var context = props.context, focused = props.focused, options = props.options, _props$label2 = props.label, label = _props$label2 === void 0 ? '' : _props$label2, selectValue = props.selectValue, isDisabled = props.isDisabled, isSelected = props.isSelected, isAppleDevice = props.isAppleDevice; var getArrayIndex = function getArrayIndex(arr, item) { return arr && arr.length ? "".concat(arr.indexOf(item) + 1, " of ").concat(arr.length) : ''; }; if (context === 'value' && selectValue) { return "value ".concat(label, " focused, ").concat(getArrayIndex(selectValue, focused), "."); } if (context === 'menu' && isAppleDevice) { var disabled = isDisabled ? ' disabled' : ''; var status = "".concat(isSelected ? ' selected' : '').concat(disabled); return "".concat(label).concat(status, ", ").concat(getArrayIndex(options, focused), "."); } return ''; }, onFilter: function onFilter(props) { var inputValue = props.inputValue, resultsMessage = props.resultsMessage; return "".concat(resultsMessage).concat(inputValue ? ' for search term ' + inputValue : '', "."); } }; var LiveRegion = function LiveRegion(props) { var ariaSelection = props.ariaSelection, focusedOption = props.focusedOption, focusedValue = props.focusedValue, focusableOptions = props.focusableOptions, isFocused = props.isFocused, selectValue = props.selectValue, selectProps = props.selectProps, id = props.id, isAppleDevice = props.isAppleDevice; var ariaLiveMessages = selectProps.ariaLiveMessages, getOptionLabel = selectProps.getOptionLabel, inputValue = selectProps.inputValue, isMulti = selectProps.isMulti, isOptionDisabled = selectProps.isOptionDisabled, isSearchable = selectProps.isSearchable, menuIsOpen = selectProps.menuIsOpen, options = selectProps.options, screenReaderStatus = selectProps.screenReaderStatus, tabSelectsValue = selectProps.tabSelectsValue, isLoading = selectProps.isLoading; var ariaLabel = selectProps['aria-label']; var ariaLive = selectProps['aria-live']; // Update aria live message configuration when prop changes var messages = (0,react.useMemo)(function () { return (0,objectSpread2/* default */.A)((0,objectSpread2/* default */.A)({}, defaultAriaLiveMessages), ariaLiveMessages || {}); }, [ariaLiveMessages]); // Update aria live selected option when prop changes var ariaSelected = (0,react.useMemo)(function () { var message = ''; if (ariaSelection && messages.onChange) { var option = ariaSelection.option, selectedOptions = ariaSelection.options, removedValue = ariaSelection.removedValue, removedValues = ariaSelection.removedValues, value = ariaSelection.value; // select-option when !isMulti does not return option so we assume selected option is value var asOption = function asOption(val) { return !Array.isArray(val) ? val : null; }; // If there is just one item from the action then get its label var selected = removedValue || option || asOption(value); var label = selected ? getOptionLabel(selected) : ''; // If there are multiple items from the action then return an array of labels var multiSelected = selectedOptions || removedValues || undefined; var labels = multiSelected ? multiSelected.map(getOptionLabel) : []; var onChangeProps = (0,objectSpread2/* default */.A)({ // multiSelected items are usually items that have already been selected // or set by the user as a default value so we assume they are not disabled isDisabled: selected && isOptionDisabled(selected, selectValue), label: label, labels: labels }, ariaSelection); message = messages.onChange(onChangeProps); } return message; }, [ariaSelection, messages, isOptionDisabled, selectValue, getOptionLabel]); var ariaFocused = (0,react.useMemo)(function () { var focusMsg = ''; var focused = focusedOption || focusedValue; var isSelected = !!(focusedOption && selectValue && selectValue.includes(focusedOption)); if (focused && messages.onFocus) { var onFocusProps = { focused: focused, label: getOptionLabel(focused), isDisabled: isOptionDisabled(focused, selectValue), isSelected: isSelected, options: focusableOptions, context: focused === focusedOption ? 'menu' : 'value', selectValue: selectValue, isAppleDevice: isAppleDevice }; focusMsg = messages.onFocus(onFocusProps); } return focusMsg; }, [focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue, isAppleDevice]); var ariaResults = (0,react.useMemo)(function () { var resultsMsg = ''; if (menuIsOpen && options.length && !isLoading && messages.onFilter) { var resultsMessage = screenReaderStatus({ count: focusableOptions.length }); resultsMsg = messages.onFilter({ inputValue: inputValue, resultsMessage: resultsMessage }); } return resultsMsg; }, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]); var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus'; var ariaGuidance = (0,react.useMemo)(function () { var guidanceMsg = ''; if (messages.guidance) { var context = focusedValue ? 'value' : menuIsOpen ? 'menu' : 'input'; guidanceMsg = messages.guidance({ 'aria-label': ariaLabel, context: context, isDisabled: focusedOption && isOptionDisabled(focusedOption, selectValue), isMulti: isMulti, isSearchable: isSearchable, tabSelectsValue: tabSelectsValue, isInitialFocus: isInitialFocus }); } return guidanceMsg; }, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue, isInitialFocus]); var ScreenReaderText = (0,emotion_react_browser_esm/* jsx */.Y)(react.Fragment, null, (0,emotion_react_browser_esm/* jsx */.Y)("span", { id: "aria-selection" }, ariaSelected), (0,emotion_react_browser_esm/* jsx */.Y)("span", { id: "aria-focused" }, ariaFocused), (0,emotion_react_browser_esm/* jsx */.Y)("span", { id: "aria-results" }, ariaResults), (0,emotion_react_browser_esm/* jsx */.Y)("span", { id: "aria-guidance" }, ariaGuidance)); return (0,emotion_react_browser_esm/* jsx */.Y)(react.Fragment, null, (0,emotion_react_browser_esm/* jsx */.Y)(A11yText$1, { id: id }, isInitialFocus && ScreenReaderText), (0,emotion_react_browser_esm/* jsx */.Y)(A11yText$1, { "aria-live": ariaLive, "aria-atomic": "false", "aria-relevant": "additions text", role: "log" }, isFocused && !isInitialFocus && ScreenReaderText)); }; var LiveRegion$1 = LiveRegion; var diacritics = [{ base: 'A', letters: "A\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F" }, { base: 'AA', letters: "\uA732" }, { base: 'AE', letters: "\xC6\u01FC\u01E2" }, { base: 'AO', letters: "\uA734" }, { base: 'AU', letters: "\uA736" }, { base: 'AV', letters: "\uA738\uA73A" }, { base: 'AY', letters: "\uA73C" }, { base: 'B', letters: "B\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181" }, { base: 'C', letters: "C\u24B8\uFF23\u0106\u0108\u010A\u010C\xC7\u1E08\u0187\u023B\uA73E" }, { base: 'D', letters: "D\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779" }, { base: 'DZ', letters: "\u01F1\u01C4" }, { base: 'Dz', letters: "\u01F2\u01C5" }, { base: 'E', letters: "E\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E" }, { base: 'F', letters: "F\u24BB\uFF26\u1E1E\u0191\uA77B" }, { base: 'G', letters: "G\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E" }, { base: 'H', letters: "H\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D" }, { base: 'I', letters: "I\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197" }, { base: 'J', letters: "J\u24BF\uFF2A\u0134\u0248" }, { base: 'K', letters: "K\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2" }, { base: 'L', letters: "L\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780" }, { base: 'LJ', letters: "\u01C7" }, { base: 'Lj', letters: "\u01C8" }, { base: 'M', letters: "M\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C" }, { base: 'N', letters: "N\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4" }, { base: 'NJ', letters: "\u01CA" }, { base: 'Nj', letters: "\u01CB" }, { base: 'O', letters: "O\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C" }, { base: 'OI', letters: "\u01A2" }, { base: 'OO', letters: "\uA74E" }, { base: 'OU', letters: "\u0222" }, { base: 'P', letters: "P\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754" }, { base: 'Q', letters: "Q\u24C6\uFF31\uA756\uA758\u024A" }, { base: 'R', letters: "R\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782" }, { base: 'S', letters: "S\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784" }, { base: 'T', letters: "T\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786" }, { base: 'TZ', letters: "\uA728" }, { base: 'U', letters: "U\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244" }, { base: 'V', letters: "V\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245" }, { base: 'VY', letters: "\uA760" }, { base: 'W', letters: "W\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72" }, { base: 'X', letters: "X\u24CD\uFF38\u1E8A\u1E8C" }, { base: 'Y', letters: "Y\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE" }, { base: 'Z', letters: "Z\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762" }, { base: 'a', letters: "a\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250" }, { base: 'aa', letters: "\uA733" }, { base: 'ae', letters: "\xE6\u01FD\u01E3" }, { base: 'ao', letters: "\uA735" }, { base: 'au', letters: "\uA737" }, { base: 'av', letters: "\uA739\uA73B" }, { base: 'ay', letters: "\uA73D" }, { base: 'b', letters: "b\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253" }, { base: 'c', letters: "c\u24D2\uFF43\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184" }, { base: 'd', letters: "d\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A" }, { base: 'dz', letters: "\u01F3\u01C6" }, { base: 'e', letters: "e\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD" }, { base: 'f', letters: "f\u24D5\uFF46\u1E1F\u0192\uA77C" }, { base: 'g', letters: "g\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F" }, { base: 'h', letters: "h\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265" }, { base: 'hv', letters: "\u0195" }, { base: 'i', letters: "i\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131" }, { base: 'j', letters: "j\u24D9\uFF4A\u0135\u01F0\u0249" }, { base: 'k', letters: "k\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3" }, { base: 'l', letters: "l\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747" }, { base: 'lj', letters: "\u01C9" }, { base: 'm', letters: "m\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F" }, { base: 'n', letters: "n\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5" }, { base: 'nj', letters: "\u01CC" }, { base: 'o', letters: "o\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\u0254\uA74B\uA74D\u0275" }, { base: 'oi', letters: "\u01A3" }, { base: 'ou', letters: "\u0223" }, { base: 'oo', letters: "\uA74F" }, { base: 'p', letters: "p\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755" }, { base: 'q', letters: "q\u24E0\uFF51\u024B\uA757\uA759" }, { base: 'r', letters: "r\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783" }, { base: 's', letters: "s\u24E2\uFF53\xDF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B" }, { base: 't', letters: "t\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787" }, { base: 'tz', letters: "\uA729" }, { base: 'u', letters: "u\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289" }, { base: 'v', letters: "v\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C" }, { base: 'vy', letters: "\uA761" }, { base: 'w', letters: "w\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73" }, { base: 'x', letters: "x\u24E7\uFF58\u1E8B\u1E8D" }, { base: 'y', letters: "y\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF" }, { base: 'z', letters: "z\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763" }]; var anyDiacritic = new RegExp('[' + diacritics.map(function (d) { return d.letters; }).join('') + ']', 'g'); var diacriticToBase = {}; for (var i = 0; i < diacritics.length; i++) { var diacritic = diacritics[i]; for (var j = 0; j < diacritic.letters.length; j++) { diacriticToBase[diacritic.letters[j]] = diacritic.base; } } var stripDiacritics = function stripDiacritics(str) { return str.replace(anyDiacritic, function (match) { return diacriticToBase[match]; }); }; var memoizedStripDiacriticsForInput = memoizeOne(stripDiacritics); var trimString = function trimString(str) { return str.replace(/^\s+|\s+$/g, ''); }; var defaultStringify = function defaultStringify(option) { return "".concat(option.label, " ").concat(option.value); }; var createFilter = function createFilter(config) { return function (option, rawInput) { // eslint-disable-next-line no-underscore-dangle if (option.data.__isNew__) return true; var _ignoreCase$ignoreAcc = (0,objectSpread2/* default */.A)({ ignoreCase: true, ignoreAccents: true, stringify: defaultStringify, trim: true, matchFrom: 'any' }, config), ignoreCase = _ignoreCase$ignoreAcc.ignoreCase, ignoreAccents = _ignoreCase$ignoreAcc.ignoreAccents, stringify = _ignoreCase$ignoreAcc.stringify, trim = _ignoreCase$ignoreAcc.trim, matchFrom = _ignoreCase$ignoreAcc.matchFrom; var input = trim ? trimString(rawInput) : rawInput; var candidate = trim ? trimString(stringify(option)) : stringify(option); if (ignoreCase) { input = input.toLowerCase(); candidate = candidate.toLowerCase(); } if (ignoreAccents) { input = memoizedStripDiacriticsForInput(input); candidate = stripDiacritics(candidate); } return matchFrom === 'start' ? candidate.substr(0, input.length) === input : candidate.indexOf(input) > -1; }; }; var _excluded = ["innerRef"]; function DummyInput(_ref) { var innerRef = _ref.innerRef, props = (0,objectWithoutProperties/* default */.A)(_ref, _excluded); // Remove animation props not meant for HTML elements var filteredProps = (0,index_641ee5b8_esm.r)(props, 'onExited', 'in', 'enter', 'exit', 'appear'); return (0,emotion_react_browser_esm/* jsx */.Y)("input", (0,esm_extends/* default */.A)({ ref: innerRef }, filteredProps, { css: /*#__PURE__*/(0,emotion_react_browser_esm/* css */.AH)({ label: 'dummyInput', // get rid of any default styles background: 0, border: 0, // important! this hides the flashing cursor caretColor: 'transparent', fontSize: 'inherit', gridArea: '1 / 1 / 2 / 3', outline: 0, padding: 0, // important! without `width` browsers won't allow focus width: 1, // remove cursor on desktop color: 'transparent', // remove cursor on mobile whilst maintaining "scroll into view" behaviour left: -100, opacity: 0, position: 'relative', transform: 'scale(.01)' }, true ? "" : 0, true ? "" : 0) })); } var cancelScroll = function cancelScroll(event) { if (event.cancelable) event.preventDefault(); event.stopPropagation(); }; function useScrollCapture(_ref) { var isEnabled = _ref.isEnabled, onBottomArrive = _ref.onBottomArrive, onBottomLeave = _ref.onBottomLeave, onTopArrive = _ref.onTopArrive, onTopLeave = _ref.onTopLeave; var isBottom = (0,react.useRef)(false); var isTop = (0,react.useRef)(false); var touchStart = (0,react.useRef)(0); var scrollTarget = (0,react.useRef)(null); var handleEventDelta = (0,react.useCallback)(function (event, delta) { if (scrollTarget.current === null) return; var _scrollTarget$current = scrollTarget.current, scrollTop = _scrollTarget$current.scrollTop, scrollHeight = _scrollTarget$current.scrollHeight, clientHeight = _scrollTarget$current.clientHeight; var target = scrollTarget.current; var isDeltaPositive = delta > 0; var availableScroll = scrollHeight - clientHeight - scrollTop; var shouldCancelScroll = false; // reset bottom/top flags if (availableScroll > delta && isBottom.current) { if (onBottomLeave) onBottomLeave(event); isBottom.current = false; } if (isDeltaPositive && isTop.current) { if (onTopLeave) onTopLeave(event); isTop.current = false; } // bottom limit if (isDeltaPositive && delta > availableScroll) { if (onBottomArrive && !isBottom.current) { onBottomArrive(event); } target.scrollTop = scrollHeight; shouldCancelScroll = true; isBottom.current = true; // top limit } else if (!isDeltaPositive && -delta > scrollTop) { if (onTopArrive && !isTop.current) { onTopArrive(event); } target.scrollTop = 0; shouldCancelScroll = true; isTop.current = true; } // cancel scroll if (shouldCancelScroll) { cancelScroll(event); } }, [onBottomArrive, onBottomLeave, onTopArrive, onTopLeave]); var onWheel = (0,react.useCallback)(function (event) { handleEventDelta(event, event.deltaY); }, [handleEventDelta]); var onTouchStart = (0,react.useCallback)(function (event) { // set touch start so we can calculate touchmove delta touchStart.current = event.changedTouches[0].clientY; }, []); var onTouchMove = (0,react.useCallback)(function (event) { var deltaY = touchStart.current - event.changedTouches[0].clientY; handleEventDelta(event, deltaY); }, [handleEventDelta]); var startListening = (0,react.useCallback)(function (el) { // bail early if no element is available to attach to if (!el) return; var notPassive = index_641ee5b8_esm.s ? { passive: false } : false; el.addEventListener('wheel', onWheel, notPassive); el.addEventListener('touchstart', onTouchStart, notPassive); el.addEventListener('touchmove', onTouchMove, notPassive); }, [onTouchMove, onTouchStart, onWheel]); var stopListening = (0,react.useCallback)(function (el) { // bail early if no element is available to detach from if (!el) return; el.removeEventListener('wheel', onWheel, false); el.removeEventListener('touchstart', onTouchStart, false); el.removeEventListener('touchmove', onTouchMove, false); }, [onTouchMove, onTouchStart, onWheel]); (0,react.useEffect)(function () { if (!isEnabled) return; var element = scrollTarget.current; startListening(element); return function () { stopListening(element); }; }, [isEnabled, startListening, stopListening]); return function (element) { scrollTarget.current = element; }; } var STYLE_KEYS = ['boxSizing', 'height', 'overflow', 'paddingRight', 'position']; var LOCK_STYLES = { boxSizing: 'border-box', // account for possible declaration `width: 100%;` on body overflow: 'hidden', position: 'relative', height: '100%' }; function preventTouchMove(e) { if (e.cancelable) e.preventDefault(); } function allowTouchMove(e) { e.stopPropagation(); } function preventInertiaScroll() { var top = this.scrollTop; var totalScroll = this.scrollHeight; var currentScroll = top + this.offsetHeight; if (top === 0) { this.scrollTop = 1; } else if (currentScroll === totalScroll) { this.scrollTop = top - 1; } } // `ontouchstart` check works on most browsers // `maxTouchPoints` works on IE10/11 and Surface function isTouchDevice() { return 'ontouchstart' in window || navigator.maxTouchPoints; } var canUseDOM = !!( true && window.document && window.document.createElement); var activeScrollLocks = 0; var listenerOptions = { capture: false, passive: false }; function useScrollLock(_ref) { var isEnabled = _ref.isEnabled, _ref$accountForScroll = _ref.accountForScrollbars, accountForScrollbars = _ref$accountForScroll === void 0 ? true : _ref$accountForScroll; var originalStyles = (0,react.useRef)({}); var scrollTarget = (0,react.useRef)(null); var addScrollLock = (0,react.useCallback)(function (touchScrollTarget) { if (!canUseDOM) return; var target = document.body; var targetStyle = target && target.style; if (accountForScrollbars) { // store any styles already applied to the body STYLE_KEYS.forEach(function (key) { var val = targetStyle && targetStyle[key]; originalStyles.current[key] = val; }); } // apply the lock styles and padding if this is the first scroll lock if (accountForScrollbars && activeScrollLocks < 1) { var currentPadding = parseInt(originalStyles.current.paddingRight, 10) || 0; var clientWidth = document.body ? document.body.clientWidth : 0; var adjustedPadding = window.innerWidth - clientWidth + currentPadding || 0; Object.keys(LOCK_STYLES).forEach(function (key) { var val = LOCK_STYLES[key]; if (targetStyle) { targetStyle[key] = val; } }); if (targetStyle) { targetStyle.paddingRight = "".concat(adjustedPadding, "px"); } } // account for touch devices if (target && isTouchDevice()) { // Mobile Safari ignores { overflow: hidden } declaration on the body. target.addEventListener('touchmove', preventTouchMove, listenerOptions); // Allow scroll on provided target if (touchScrollTarget) { touchScrollTarget.addEventListener('touchstart', preventInertiaScroll, listenerOptions); touchScrollTarget.addEventListener('touchmove', allowTouchMove, listenerOptions); } } // increment active scroll locks activeScrollLocks += 1; }, [accountForScrollbars]); var removeScrollLock = (0,react.useCallback)(function (touchScrollTarget) { if (!canUseDOM) return; var target = document.body; var targetStyle = target && target.style; // safely decrement active scroll locks activeScrollLocks = Math.max(activeScrollLocks - 1, 0); // reapply original body styles, if any if (accountForScrollbars && activeScrollLocks < 1) { STYLE_KEYS.forEach(function (key) { var val = originalStyles.current[key]; if (targetStyle) { targetStyle[key] = val; } }); } // remove touch listeners if (target && isTouchDevice()) { target.removeEventListener('touchmove', preventTouchMove, listenerOptions); if (touchScrollTarget) { touchScrollTarget.removeEventListener('touchstart', preventInertiaScroll, listenerOptions); touchScrollTarget.removeEventListener('touchmove', allowTouchMove, listenerOptions); } } }, [accountForScrollbars]); (0,react.useEffect)(function () { if (!isEnabled) return; var element = scrollTarget.current; addScrollLock(element); return function () { removeScrollLock(element); }; }, [isEnabled, addScrollLock, removeScrollLock]); return function (element) { scrollTarget.current = element; }; } function _EMOTION_STRINGIFIED_CSS_ERROR__$1() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } var blurSelectInput = function blurSelectInput(event) { var element = event.target; return element.ownerDocument.activeElement && element.ownerDocument.activeElement.blur(); }; var _ref2$1 = true ? { name: "1kfdb0e", styles: "position:fixed;left:0;bottom:0;right:0;top:0" } : 0; function ScrollManager(_ref) { var children = _ref.children, lockEnabled = _ref.lockEnabled, _ref$captureEnabled = _ref.captureEnabled, captureEnabled = _ref$captureEnabled === void 0 ? true : _ref$captureEnabled, onBottomArrive = _ref.onBottomArrive, onBottomLeave = _ref.onBottomLeave, onTopArrive = _ref.onTopArrive, onTopLeave = _ref.onTopLeave; var setScrollCaptureTarget = useScrollCapture({ isEnabled: captureEnabled, onBottomArrive: onBottomArrive, onBottomLeave: onBottomLeave, onTopArrive: onTopArrive, onTopLeave: onTopLeave }); var setScrollLockTarget = useScrollLock({ isEnabled: lockEnabled }); var targetRef = function targetRef(element) { setScrollCaptureTarget(element); setScrollLockTarget(element); }; return (0,emotion_react_browser_esm/* jsx */.Y)(react.Fragment, null, lockEnabled && (0,emotion_react_browser_esm/* jsx */.Y)("div", { onClick: blurSelectInput, css: _ref2$1 }), children(targetRef)); } function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } var _ref2 = true ? { name: "1a0ro4n-requiredInput", styles: "label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%" } : 0; var RequiredInput = function RequiredInput(_ref) { var name = _ref.name, onFocus = _ref.onFocus; return (0,emotion_react_browser_esm/* jsx */.Y)("input", { required: true, name: name, tabIndex: -1, "aria-hidden": "true", onFocus: onFocus, css: _ref2 // Prevent `Switching from uncontrolled to controlled` error , value: "", onChange: function onChange() {} }); }; var RequiredInput$1 = RequiredInput; /// function testPlatform(re) { var _window$navigator$use; return true && window.navigator != null ? re.test(((_window$navigator$use = window.navigator['userAgentData']) === null || _window$navigator$use === void 0 ? void 0 : _window$navigator$use.platform) || window.navigator.platform) : false; } function isIPhone() { return testPlatform(/^iPhone/i); } function isMac() { return testPlatform(/^Mac/i); } function isIPad() { return testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support. isMac() && navigator.maxTouchPoints > 1; } function isIOS() { return isIPhone() || isIPad(); } function isAppleDevice() { return isMac() || isIOS(); } var formatGroupLabel = function formatGroupLabel(group) { return group.label; }; var getOptionLabel$1 = function getOptionLabel(option) { return option.label; }; var getOptionValue$1 = function getOptionValue(option) { return option.value; }; var isOptionDisabled = function isOptionDisabled(option) { return !!option.isDisabled; }; var defaultStyles = { clearIndicator: index_641ee5b8_esm.a, container: index_641ee5b8_esm.b, control: index_641ee5b8_esm.d, dropdownIndicator: index_641ee5b8_esm.e, group: index_641ee5b8_esm.g, groupHeading: index_641ee5b8_esm.f, indicatorsContainer: index_641ee5b8_esm.i, indicatorSeparator: index_641ee5b8_esm.h, input: index_641ee5b8_esm.j, loadingIndicator: index_641ee5b8_esm.l, loadingMessage: index_641ee5b8_esm.k, menu: index_641ee5b8_esm.m, menuList: index_641ee5b8_esm.n, menuPortal: index_641ee5b8_esm.o, multiValue: index_641ee5b8_esm.p, multiValueLabel: index_641ee5b8_esm.q, multiValueRemove: index_641ee5b8_esm.t, noOptionsMessage: index_641ee5b8_esm.u, option: index_641ee5b8_esm.v, placeholder: index_641ee5b8_esm.w, singleValue: index_641ee5b8_esm.x, valueContainer: index_641ee5b8_esm.y }; // Merge Utility // Allows consumers to extend a base Select with additional styles function mergeStyles(source) { var target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; // initialize with source styles var styles = (0,objectSpread2/* default */.A)({}, source); // massage in target styles Object.keys(target).forEach(function (keyAsString) { var key = keyAsString; if (source[key]) { styles[key] = function (rsCss, props) { return target[key](source[key](rsCss, props), props); }; } else { styles[key] = target[key]; } }); return styles; } var colors = { primary: '#2684FF', primary75: '#4C9AFF', primary50: '#B2D4FF', primary25: '#DEEBFF', danger: '#DE350B', dangerLight: '#FFBDAD', neutral0: 'hsl(0, 0%, 100%)', neutral5: 'hsl(0, 0%, 95%)', neutral10: 'hsl(0, 0%, 90%)', neutral20: 'hsl(0, 0%, 80%)', neutral30: 'hsl(0, 0%, 70%)', neutral40: 'hsl(0, 0%, 60%)', neutral50: 'hsl(0, 0%, 50%)', neutral60: 'hsl(0, 0%, 40%)', neutral70: 'hsl(0, 0%, 30%)', neutral80: 'hsl(0, 0%, 20%)', neutral90: 'hsl(0, 0%, 10%)' }; var borderRadius = 4; // Used to calculate consistent margin/padding on elements var baseUnit = 4; // The minimum height of the control var controlHeight = 38; // The amount of space between the control and menu */ var menuGutter = baseUnit * 2; var spacing = { baseUnit: baseUnit, controlHeight: controlHeight, menuGutter: menuGutter }; var defaultTheme = { borderRadius: borderRadius, colors: colors, spacing: spacing }; var defaultProps = { 'aria-live': 'polite', backspaceRemovesValue: true, blurInputOnSelect: (0,index_641ee5b8_esm.z)(), captureMenuScroll: !(0,index_641ee5b8_esm.z)(), classNames: {}, closeMenuOnSelect: true, closeMenuOnScroll: false, components: {}, controlShouldRenderValue: true, escapeClearsValue: false, filterOption: createFilter(), formatGroupLabel: formatGroupLabel, getOptionLabel: getOptionLabel$1, getOptionValue: getOptionValue$1, isDisabled: false, isLoading: false, isMulti: false, isRtl: false, isSearchable: true, isOptionDisabled: isOptionDisabled, loadingMessage: function loadingMessage() { return 'Loading...'; }, maxMenuHeight: 300, minMenuHeight: 140, menuIsOpen: false, menuPlacement: 'bottom', menuPosition: 'absolute', menuShouldBlockScroll: false, menuShouldScrollIntoView: !(0,index_641ee5b8_esm.A)(), noOptionsMessage: function noOptionsMessage() { return 'No options'; }, openMenuOnFocus: false, openMenuOnClick: true, options: [], pageSize: 5, placeholder: 'Select...', screenReaderStatus: function screenReaderStatus(_ref) { var count = _ref.count; return "".concat(count, " result").concat(count !== 1 ? 's' : '', " available"); }, styles: {}, tabIndex: 0, tabSelectsValue: true, unstyled: false }; function toCategorizedOption(props, option, selectValue, index) { var isDisabled = _isOptionDisabled(props, option, selectValue); var isSelected = _isOptionSelected(props, option, selectValue); var label = getOptionLabel(props, option); var value = getOptionValue(props, option); return { type: 'option', data: option, isDisabled: isDisabled, isSelected: isSelected, label: label, value: value, index: index }; } function buildCategorizedOptions(props, selectValue) { return props.options.map(function (groupOrOption, groupOrOptionIndex) { if ('options' in groupOrOption) { var categorizedOptions = groupOrOption.options.map(function (option, optionIndex) { return toCategorizedOption(props, option, selectValue, optionIndex); }).filter(function (categorizedOption) { return isFocusable(props, categorizedOption); }); return categorizedOptions.length > 0 ? { type: 'group', data: groupOrOption, options: categorizedOptions, index: groupOrOptionIndex } : undefined; } var categorizedOption = toCategorizedOption(props, groupOrOption, selectValue, groupOrOptionIndex); return isFocusable(props, categorizedOption) ? categorizedOption : undefined; }).filter(index_641ee5b8_esm.K); } function buildFocusableOptionsFromCategorizedOptions(categorizedOptions) { return categorizedOptions.reduce(function (optionsAccumulator, categorizedOption) { if (categorizedOption.type === 'group') { optionsAccumulator.push.apply(optionsAccumulator, _toConsumableArray(categorizedOption.options.map(function (option) { return option.data; }))); } else { optionsAccumulator.push(categorizedOption.data); } return optionsAccumulator; }, []); } function buildFocusableOptionsWithIds(categorizedOptions, optionId) { return categorizedOptions.reduce(function (optionsAccumulator, categorizedOption) { if (categorizedOption.type === 'group') { optionsAccumulator.push.apply(optionsAccumulator, _toConsumableArray(categorizedOption.options.map(function (option) { return { data: option.data, id: "".concat(optionId, "-").concat(categorizedOption.index, "-").concat(option.index) }; }))); } else { optionsAccumulator.push({ data: categorizedOption.data, id: "".concat(optionId, "-").concat(categorizedOption.index) }); } return optionsAccumulator; }, []); } function buildFocusableOptions(props, selectValue) { return buildFocusableOptionsFromCategorizedOptions(buildCategorizedOptions(props, selectValue)); } function isFocusable(props, categorizedOption) { var _props$inputValue = props.inputValue, inputValue = _props$inputValue === void 0 ? '' : _props$inputValue; var data = categorizedOption.data, isSelected = categorizedOption.isSelected, label = categorizedOption.label, value = categorizedOption.value; return (!shouldHideSelectedOptions(props) || !isSelected) && _filterOption(props, { label: label, value: value, data: data }, inputValue); } function getNextFocusedValue(state, nextSelectValue) { var focusedValue = state.focusedValue, lastSelectValue = state.selectValue; var lastFocusedIndex = lastSelectValue.indexOf(focusedValue); if (lastFocusedIndex > -1) { var nextFocusedIndex = nextSelectValue.indexOf(focusedValue); if (nextFocusedIndex > -1) { // the focused value is still in the selectValue, return it return focusedValue; } else if (lastFocusedIndex < nextSelectValue.length) { // the focusedValue is not present in the next selectValue array by // reference, so return the new value at the same index return nextSelectValue[lastFocusedIndex]; } } return null; } function getNextFocusedOption(state, options) { var lastFocusedOption = state.focusedOption; return lastFocusedOption && options.indexOf(lastFocusedOption) > -1 ? lastFocusedOption : options[0]; } var getFocusedOptionId = function getFocusedOptionId(focusableOptionsWithIds, focusedOption) { var _focusableOptionsWith; var focusedOptionId = (_focusableOptionsWith = focusableOptionsWithIds.find(function (option) { return option.data === focusedOption; })) === null || _focusableOptionsWith === void 0 ? void 0 : _focusableOptionsWith.id; return focusedOptionId || null; }; var getOptionLabel = function getOptionLabel(props, data) { return props.getOptionLabel(data); }; var getOptionValue = function getOptionValue(props, data) { return props.getOptionValue(data); }; function _isOptionDisabled(props, option, selectValue) { return typeof props.isOptionDisabled === 'function' ? props.isOptionDisabled(option, selectValue) : false; } function _isOptionSelected(props, option, selectValue) { if (selectValue.indexOf(option) > -1) return true; if (typeof props.isOptionSelected === 'function') { return props.isOptionSelected(option, selectValue); } var candidate = getOptionValue(props, option); return selectValue.some(function (i) { return getOptionValue(props, i) === candidate; }); } function _filterOption(props, option, inputValue) { return props.filterOption ? props.filterOption(option, inputValue) : true; } var shouldHideSelectedOptions = function shouldHideSelectedOptions(props) { var hideSelectedOptions = props.hideSelectedOptions, isMulti = props.isMulti; if (hideSelectedOptions === undefined) return isMulti; return hideSelectedOptions; }; var instanceId = 1; var Select = /*#__PURE__*/function (_Component) { _inherits(Select, _Component); var _super = _createSuper(Select); // Misc. Instance Properties // ------------------------------ // TODO // Refs // ------------------------------ // Lifecycle // ------------------------------ function Select(_props) { var _this; _classCallCheck(this, Select); _this = _super.call(this, _props); _this.state = { ariaSelection: null, focusedOption: null, focusedOptionId: null, focusableOptionsWithIds: [], focusedValue: null, inputIsHidden: false, isFocused: false, selectValue: [], clearFocusValueOnUpdate: false, prevWasFocused: false, inputIsHiddenAfterUpdate: undefined, prevProps: undefined, instancePrefix: '', isAppleDevice: false }; _this.blockOptionHover = false; _this.isComposing = false; _this.commonProps = void 0; _this.initialTouchX = 0; _this.initialTouchY = 0; _this.openAfterFocus = false; _this.scrollToFocusedOptionOnUpdate = false; _this.userIsDragging = void 0; _this.controlRef = null; _this.getControlRef = function (ref) { _this.controlRef = ref; }; _this.focusedOptionRef = null; _this.getFocusedOptionRef = function (ref) { _this.focusedOptionRef = ref; }; _this.menuListRef = null; _this.getMenuListRef = function (ref) { _this.menuListRef = ref; }; _this.inputRef = null; _this.getInputRef = function (ref) { _this.inputRef = ref; }; _this.focus = _this.focusInput; _this.blur = _this.blurInput; _this.onChange = function (newValue, actionMeta) { var _this$props = _this.props, onChange = _this$props.onChange, name = _this$props.name; actionMeta.name = name; _this.ariaOnChange(newValue, actionMeta); onChange(newValue, actionMeta); }; _this.setValue = function (newValue, action, option) { var _this$props2 = _this.props, closeMenuOnSelect = _this$props2.closeMenuOnSelect, isMulti = _this$props2.isMulti, inputValue = _this$props2.inputValue; _this.onInputChange('', { action: 'set-value', prevInputValue: inputValue }); if (closeMenuOnSelect) { _this.setState({ inputIsHiddenAfterUpdate: !isMulti }); _this.onMenuClose(); } // when the select value should change, we should reset focusedValue _this.setState({ clearFocusValueOnUpdate: true }); _this.onChange(newValue, { action: action, option: option }); }; _this.selectOption = function (newValue) { var _this$props3 = _this.props, blurInputOnSelect = _this$props3.blurInputOnSelect, isMulti = _this$props3.isMulti, name = _this$props3.name; var selectValue = _this.state.selectValue; var deselected = isMulti && _this.isOptionSelected(newValue, selectValue); var isDisabled = _this.isOptionDisabled(newValue, selectValue); if (deselected) { var candidate = _this.getOptionValue(newValue); _this.setValue((0,index_641ee5b8_esm.B)(selectValue.filter(function (i) { return _this.getOptionValue(i) !== candidate; })), 'deselect-option', newValue); } else if (!isDisabled) { // Select option if option is not disabled if (isMulti) { _this.setValue((0,index_641ee5b8_esm.B)([].concat(_toConsumableArray(selectValue), [newValue])), 'select-option', newValue); } else { _this.setValue((0,index_641ee5b8_esm.C)(newValue), 'select-option'); } } else { _this.ariaOnChange((0,index_641ee5b8_esm.C)(newValue), { action: 'select-option', option: newValue, name: name }); return; } if (blurInputOnSelect) { _this.blurInput(); } }; _this.removeValue = function (removedValue) { var isMulti = _this.props.isMulti; var selectValue = _this.state.selectValue; var candidate = _this.getOptionValue(removedValue); var newValueArray = selectValue.filter(function (i) { return _this.getOptionValue(i) !== candidate; }); var newValue = (0,index_641ee5b8_esm.D)(isMulti, newValueArray, newValueArray[0] || null); _this.onChange(newValue, { action: 'remove-value', removedValue: removedValue }); _this.focusInput(); }; _this.clearValue = function () { var selectValue = _this.state.selectValue; _this.onChange((0,index_641ee5b8_esm.D)(_this.props.isMulti, [], null), { action: 'clear', removedValues: selectValue }); }; _this.popValue = function () { var isMulti = _this.props.isMulti; var selectValue = _this.state.selectValue; var lastSelectedValue = selectValue[selectValue.length - 1]; var newValueArray = selectValue.slice(0, selectValue.length - 1); var newValue = (0,index_641ee5b8_esm.D)(isMulti, newValueArray, newValueArray[0] || null); if (lastSelectedValue) { _this.onChange(newValue, { action: 'pop-value', removedValue: lastSelectedValue }); } }; _this.getFocusedOptionId = function (focusedOption) { return getFocusedOptionId(_this.state.focusableOptionsWithIds, focusedOption); }; _this.getFocusableOptionsWithIds = function () { return buildFocusableOptionsWithIds(buildCategorizedOptions(_this.props, _this.state.selectValue), _this.getElementId('option')); }; _this.getValue = function () { return _this.state.selectValue; }; _this.cx = function () { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return index_641ee5b8_esm.E.apply(void 0, [_this.props.classNamePrefix].concat(args)); }; _this.getOptionLabel = function (data) { return getOptionLabel(_this.props, data); }; _this.getOptionValue = function (data) { return getOptionValue(_this.props, data); }; _this.getStyles = function (key, props) { var unstyled = _this.props.unstyled; var base = defaultStyles[key](props, unstyled); base.boxSizing = 'border-box'; var custom = _this.props.styles[key]; return custom ? custom(base, props) : base; }; _this.getClassNames = function (key, props) { var _this$props$className, _this$props$className2; return (_this$props$className = (_this$props$className2 = _this.props.classNames)[key]) === null || _this$props$className === void 0 ? void 0 : _this$props$className.call(_this$props$className2, props); }; _this.getElementId = function (element) { return "".concat(_this.state.instancePrefix, "-").concat(element); }; _this.getComponents = function () { return (0,index_641ee5b8_esm.F)(_this.props); }; _this.buildCategorizedOptions = function () { return buildCategorizedOptions(_this.props, _this.state.selectValue); }; _this.getCategorizedOptions = function () { return _this.props.menuIsOpen ? _this.buildCategorizedOptions() : []; }; _this.buildFocusableOptions = function () { return buildFocusableOptionsFromCategorizedOptions(_this.buildCategorizedOptions()); }; _this.getFocusableOptions = function () { return _this.props.menuIsOpen ? _this.buildFocusableOptions() : []; }; _this.ariaOnChange = function (value, actionMeta) { _this.setState({ ariaSelection: (0,objectSpread2/* default */.A)({ value: value }, actionMeta) }); }; _this.onMenuMouseDown = function (event) { if (event.button !== 0) { return; } event.stopPropagation(); event.preventDefault(); _this.focusInput(); }; _this.onMenuMouseMove = function (event) { _this.blockOptionHover = false; }; _this.onControlMouseDown = function (event) { // Event captured by dropdown indicator if (event.defaultPrevented) { return; } var openMenuOnClick = _this.props.openMenuOnClick; if (!_this.state.isFocused) { if (openMenuOnClick) { _this.openAfterFocus = true; } _this.focusInput(); } else if (!_this.props.menuIsOpen) { if (openMenuOnClick) { _this.openMenu('first'); } } else { if (event.target.tagName !== 'INPUT' && event.target.tagName !== 'TEXTAREA') { _this.onMenuClose(); } } if (event.target.tagName !== 'INPUT' && event.target.tagName !== 'TEXTAREA') { event.preventDefault(); } }; _this.onDropdownIndicatorMouseDown = function (event) { // ignore mouse events that weren't triggered by the primary button if (event && event.type === 'mousedown' && event.button !== 0) { return; } if (_this.props.isDisabled) return; var _this$props4 = _this.props, isMulti = _this$props4.isMulti, menuIsOpen = _this$props4.menuIsOpen; _this.focusInput(); if (menuIsOpen) { _this.setState({ inputIsHiddenAfterUpdate: !isMulti }); _this.onMenuClose(); } else { _this.openMenu('first'); } event.preventDefault(); }; _this.onClearIndicatorMouseDown = function (event) { // ignore mouse events that weren't triggered by the primary button if (event && event.type === 'mousedown' && event.button !== 0) { return; } _this.clearValue(); event.preventDefault(); _this.openAfterFocus = false; if (event.type === 'touchend') { _this.focusInput(); } else { setTimeout(function () { return _this.focusInput(); }); } }; _this.onScroll = function (event) { if (typeof _this.props.closeMenuOnScroll === 'boolean') { if (event.target instanceof HTMLElement && (0,index_641ee5b8_esm.G)(event.target)) { _this.props.onMenuClose(); } } else if (typeof _this.props.closeMenuOnScroll === 'function') { if (_this.props.closeMenuOnScroll(event)) { _this.props.onMenuClose(); } } }; _this.onCompositionStart = function () { _this.isComposing = true; }; _this.onCompositionEnd = function () { _this.isComposing = false; }; _this.onTouchStart = function (_ref2) { var touches = _ref2.touches; var touch = touches && touches.item(0); if (!touch) { return; } _this.initialTouchX = touch.clientX; _this.initialTouchY = touch.clientY; _this.userIsDragging = false; }; _this.onTouchMove = function (_ref3) { var touches = _ref3.touches; var touch = touches && touches.item(0); if (!touch) { return; } var deltaX = Math.abs(touch.clientX - _this.initialTouchX); var deltaY = Math.abs(touch.clientY - _this.initialTouchY); var moveThreshold = 5; _this.userIsDragging = deltaX > moveThreshold || deltaY > moveThreshold; }; _this.onTouchEnd = function (event) { if (_this.userIsDragging) return; // close the menu if the user taps outside // we're checking on event.target here instead of event.currentTarget, because we want to assert information // on events on child elements, not the document (which we've attached this handler to). if (_this.controlRef && !_this.controlRef.contains(event.target) && _this.menuListRef && !_this.menuListRef.contains(event.target)) { _this.blurInput(); } // reset move vars _this.initialTouchX = 0; _this.initialTouchY = 0; }; _this.onControlTouchEnd = function (event) { if (_this.userIsDragging) return; _this.onControlMouseDown(event); }; _this.onClearIndicatorTouchEnd = function (event) { if (_this.userIsDragging) return; _this.onClearIndicatorMouseDown(event); }; _this.onDropdownIndicatorTouchEnd = function (event) { if (_this.userIsDragging) return; _this.onDropdownIndicatorMouseDown(event); }; _this.handleInputChange = function (event) { var prevInputValue = _this.props.inputValue; var inputValue = event.currentTarget.value; _this.setState({ inputIsHiddenAfterUpdate: false }); _this.onInputChange(inputValue, { action: 'input-change', prevInputValue: prevInputValue }); if (!_this.props.menuIsOpen) { _this.onMenuOpen(); } }; _this.onInputFocus = function (event) { if (_this.props.onFocus) { _this.props.onFocus(event); } _this.setState({ inputIsHiddenAfterUpdate: false, isFocused: true }); if (_this.openAfterFocus || _this.props.openMenuOnFocus) { _this.openMenu('first'); } _this.openAfterFocus = false; }; _this.onInputBlur = function (event) { var prevInputValue = _this.props.inputValue; if (_this.menuListRef && _this.menuListRef.contains(document.activeElement)) { _this.inputRef.focus(); return; } if (_this.props.onBlur) { _this.props.onBlur(event); } _this.onInputChange('', { action: 'input-blur', prevInputValue: prevInputValue }); _this.onMenuClose(); _this.setState({ focusedValue: null, isFocused: false }); }; _this.onOptionHover = function (focusedOption) { if (_this.blockOptionHover || _this.state.focusedOption === focusedOption) { return; } var options = _this.getFocusableOptions(); var focusedOptionIndex = options.indexOf(focusedOption); _this.setState({ focusedOption: focusedOption, focusedOptionId: focusedOptionIndex > -1 ? _this.getFocusedOptionId(focusedOption) : null }); }; _this.shouldHideSelectedOptions = function () { return shouldHideSelectedOptions(_this.props); }; _this.onValueInputFocus = function (e) { e.preventDefault(); e.stopPropagation(); _this.focus(); }; _this.onKeyDown = function (event) { var _this$props5 = _this.props, isMulti = _this$props5.isMulti, backspaceRemovesValue = _this$props5.backspaceRemovesValue, escapeClearsValue = _this$props5.escapeClearsValue, inputValue = _this$props5.inputValue, isClearable = _this$props5.isClearable, isDisabled = _this$props5.isDisabled, menuIsOpen = _this$props5.menuIsOpen, onKeyDown = _this$props5.onKeyDown, tabSelectsValue = _this$props5.tabSelectsValue, openMenuOnFocus = _this$props5.openMenuOnFocus; var _this$state = _this.state, focusedOption = _this$state.focusedOption, focusedValue = _this$state.focusedValue, selectValue = _this$state.selectValue; if (isDisabled) return; if (typeof onKeyDown === 'function') { onKeyDown(event); if (event.defaultPrevented) { return; } } // Block option hover events when the user has just pressed a key _this.blockOptionHover = true; switch (event.key) { case 'ArrowLeft': if (!isMulti || inputValue) return; _this.focusValue('previous'); break; case 'ArrowRight': if (!isMulti || inputValue) return; _this.focusValue('next'); break; case 'Delete': case 'Backspace': if (inputValue) return; if (focusedValue) { _this.removeValue(focusedValue); } else { if (!backspaceRemovesValue) return; if (isMulti) { _this.popValue(); } else if (isClearable) { _this.clearValue(); } } break; case 'Tab': if (_this.isComposing) return; if (event.shiftKey || !menuIsOpen || !tabSelectsValue || !focusedOption || // don't capture the event if the menu opens on focus and the focused // option is already selected; it breaks the flow of navigation openMenuOnFocus && _this.isOptionSelected(focusedOption, selectValue)) { return; } _this.selectOption(focusedOption); break; case 'Enter': if (event.keyCode === 229) { // ignore the keydown event from an Input Method Editor(IME) // ref. https://www.w3.org/TR/uievents/#determine-keydown-keyup-keyCode break; } if (menuIsOpen) { if (!focusedOption) return; if (_this.isComposing) return; _this.selectOption(focusedOption); break; } return; case 'Escape': if (menuIsOpen) { _this.setState({ inputIsHiddenAfterUpdate: false }); _this.onInputChange('', { action: 'menu-close', prevInputValue: inputValue }); _this.onMenuClose(); } else if (isClearable && escapeClearsValue) { _this.clearValue(); } break; case ' ': // space if (inputValue) { return; } if (!menuIsOpen) { _this.openMenu('first'); break; } if (!focusedOption) return; _this.selectOption(focusedOption); break; case 'ArrowUp': if (menuIsOpen) { _this.focusOption('up'); } else { _this.openMenu('last'); } break; case 'ArrowDown': if (menuIsOpen) { _this.focusOption('down'); } else { _this.openMenu('first'); } break; case 'PageUp': if (!menuIsOpen) return; _this.focusOption('pageup'); break; case 'PageDown': if (!menuIsOpen) return; _this.focusOption('pagedown'); break; case 'Home': if (!menuIsOpen) return; _this.focusOption('first'); break; case 'End': if (!menuIsOpen) return; _this.focusOption('last'); break; default: return; } event.preventDefault(); }; _this.state.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId); _this.state.selectValue = (0,index_641ee5b8_esm.H)(_props.value); // Set focusedOption if menuIsOpen is set on init (e.g. defaultMenuIsOpen) if (_props.menuIsOpen && _this.state.selectValue.length) { var focusableOptionsWithIds = _this.getFocusableOptionsWithIds(); var focusableOptions = _this.buildFocusableOptions(); var optionIndex = focusableOptions.indexOf(_this.state.selectValue[0]); _this.state.focusableOptionsWithIds = focusableOptionsWithIds; _this.state.focusedOption = focusableOptions[optionIndex]; _this.state.focusedOptionId = getFocusedOptionId(focusableOptionsWithIds, focusableOptions[optionIndex]); } return _this; } _createClass(Select, [{ key: "componentDidMount", value: function componentDidMount() { this.startListeningComposition(); this.startListeningToTouch(); if (this.props.closeMenuOnScroll && document && document.addEventListener) { // Listen to all scroll events, and filter them out inside of 'onScroll' document.addEventListener('scroll', this.onScroll, true); } if (this.props.autoFocus) { this.focusInput(); } // Scroll focusedOption into view if menuIsOpen is set on mount (e.g. defaultMenuIsOpen) if (this.props.menuIsOpen && this.state.focusedOption && this.menuListRef && this.focusedOptionRef) { (0,index_641ee5b8_esm.I)(this.menuListRef, this.focusedOptionRef); } if (isAppleDevice()) { // eslint-disable-next-line react/no-did-mount-set-state this.setState({ isAppleDevice: true }); } } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var _this$props6 = this.props, isDisabled = _this$props6.isDisabled, menuIsOpen = _this$props6.menuIsOpen; var isFocused = this.state.isFocused; if ( // ensure focus is restored correctly when the control becomes enabled isFocused && !isDisabled && prevProps.isDisabled || // ensure focus is on the Input when the menu opens isFocused && menuIsOpen && !prevProps.menuIsOpen) { this.focusInput(); } if (isFocused && isDisabled && !prevProps.isDisabled) { // ensure select state gets blurred in case Select is programmatically disabled while focused // eslint-disable-next-line react/no-did-update-set-state this.setState({ isFocused: false }, this.onMenuClose); } else if (!isFocused && !isDisabled && prevProps.isDisabled && this.inputRef === document.activeElement) { // ensure select state gets focused in case Select is programatically re-enabled while focused (Firefox) // eslint-disable-next-line react/no-did-update-set-state this.setState({ isFocused: true }); } // scroll the focused option into view if necessary if (this.menuListRef && this.focusedOptionRef && this.scrollToFocusedOptionOnUpdate) { (0,index_641ee5b8_esm.I)(this.menuListRef, this.focusedOptionRef); this.scrollToFocusedOptionOnUpdate = false; } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.stopListeningComposition(); this.stopListeningToTouch(); document.removeEventListener('scroll', this.onScroll, true); } // ============================== // Consumer Handlers // ============================== }, { key: "onMenuOpen", value: function onMenuOpen() { this.props.onMenuOpen(); } }, { key: "onMenuClose", value: function onMenuClose() { this.onInputChange('', { action: 'menu-close', prevInputValue: this.props.inputValue }); this.props.onMenuClose(); } }, { key: "onInputChange", value: function onInputChange(newValue, actionMeta) { this.props.onInputChange(newValue, actionMeta); } // ============================== // Methods // ============================== }, { key: "focusInput", value: function focusInput() { if (!this.inputRef) return; this.inputRef.focus(); } }, { key: "blurInput", value: function blurInput() { if (!this.inputRef) return; this.inputRef.blur(); } // aliased for consumers }, { key: "openMenu", value: function openMenu(focusOption) { var _this2 = this; var _this$state2 = this.state, selectValue = _this$state2.selectValue, isFocused = _this$state2.isFocused; var focusableOptions = this.buildFocusableOptions(); var openAtIndex = focusOption === 'first' ? 0 : focusableOptions.length - 1; if (!this.props.isMulti) { var selectedIndex = focusableOptions.indexOf(selectValue[0]); if (selectedIndex > -1) { openAtIndex = selectedIndex; } } // only scroll if the menu isn't already open this.scrollToFocusedOptionOnUpdate = !(isFocused && this.menuListRef); this.setState({ inputIsHiddenAfterUpdate: false, focusedValue: null, focusedOption: focusableOptions[openAtIndex], focusedOptionId: this.getFocusedOptionId(focusableOptions[openAtIndex]) }, function () { return _this2.onMenuOpen(); }); } }, { key: "focusValue", value: function focusValue(direction) { var _this$state3 = this.state, selectValue = _this$state3.selectValue, focusedValue = _this$state3.focusedValue; // Only multiselects support value focusing if (!this.props.isMulti) return; this.setState({ focusedOption: null }); var focusedIndex = selectValue.indexOf(focusedValue); if (!focusedValue) { focusedIndex = -1; } var lastIndex = selectValue.length - 1; var nextFocus = -1; if (!selectValue.length) return; switch (direction) { case 'previous': if (focusedIndex === 0) { // don't cycle from the start to the end nextFocus = 0; } else if (focusedIndex === -1) { // if nothing is focused, focus the last value first nextFocus = lastIndex; } else { nextFocus = focusedIndex - 1; } break; case 'next': if (focusedIndex > -1 && focusedIndex < lastIndex) { nextFocus = focusedIndex + 1; } break; } this.setState({ inputIsHidden: nextFocus !== -1, focusedValue: selectValue[nextFocus] }); } }, { key: "focusOption", value: function focusOption() { var direction = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'first'; var pageSize = this.props.pageSize; var focusedOption = this.state.focusedOption; var options = this.getFocusableOptions(); if (!options.length) return; var nextFocus = 0; // handles 'first' var focusedIndex = options.indexOf(focusedOption); if (!focusedOption) { focusedIndex = -1; } if (direction === 'up') { nextFocus = focusedIndex > 0 ? focusedIndex - 1 : options.length - 1; } else if (direction === 'down') { nextFocus = (focusedIndex + 1) % options.length; } else if (direction === 'pageup') { nextFocus = focusedIndex - pageSize; if (nextFocus < 0) nextFocus = 0; } else if (direction === 'pagedown') { nextFocus = focusedIndex + pageSize; if (nextFocus > options.length - 1) nextFocus = options.length - 1; } else if (direction === 'last') { nextFocus = options.length - 1; } this.scrollToFocusedOptionOnUpdate = true; this.setState({ focusedOption: options[nextFocus], focusedValue: null, focusedOptionId: this.getFocusedOptionId(options[nextFocus]) }); } }, { key: "getTheme", value: // ============================== // Getters // ============================== function getTheme() { // Use the default theme if there are no customisations. if (!this.props.theme) { return defaultTheme; } // If the theme prop is a function, assume the function // knows how to merge the passed-in default theme with // its own modifications. if (typeof this.props.theme === 'function') { return this.props.theme(defaultTheme); } // Otherwise, if a plain theme object was passed in, // overlay it with the default theme. return (0,objectSpread2/* default */.A)((0,objectSpread2/* default */.A)({}, defaultTheme), this.props.theme); } }, { key: "getCommonProps", value: function getCommonProps() { var clearValue = this.clearValue, cx = this.cx, getStyles = this.getStyles, getClassNames = this.getClassNames, getValue = this.getValue, selectOption = this.selectOption, setValue = this.setValue, props = this.props; var isMulti = props.isMulti, isRtl = props.isRtl, options = props.options; var hasValue = this.hasValue(); return { clearValue: clearValue, cx: cx, getStyles: getStyles, getClassNames: getClassNames, getValue: getValue, hasValue: hasValue, isMulti: isMulti, isRtl: isRtl, options: options, selectOption: selectOption, selectProps: props, setValue: setValue, theme: this.getTheme() }; } }, { key: "hasValue", value: function hasValue() { var selectValue = this.state.selectValue; return selectValue.length > 0; } }, { key: "hasOptions", value: function hasOptions() { return !!this.getFocusableOptions().length; } }, { key: "isClearable", value: function isClearable() { var _this$props7 = this.props, isClearable = _this$props7.isClearable, isMulti = _this$props7.isMulti; // single select, by default, IS NOT clearable // multi select, by default, IS clearable if (isClearable === undefined) return isMulti; return isClearable; } }, { key: "isOptionDisabled", value: function isOptionDisabled(option, selectValue) { return _isOptionDisabled(this.props, option, selectValue); } }, { key: "isOptionSelected", value: function isOptionSelected(option, selectValue) { return _isOptionSelected(this.props, option, selectValue); } }, { key: "filterOption", value: function filterOption(option, inputValue) { return _filterOption(this.props, option, inputValue); } }, { key: "formatOptionLabel", value: function formatOptionLabel(data, context) { if (typeof this.props.formatOptionLabel === 'function') { var _inputValue = this.props.inputValue; var _selectValue = this.state.selectValue; return this.props.formatOptionLabel(data, { context: context, inputValue: _inputValue, selectValue: _selectValue }); } else { return this.getOptionLabel(data); } } }, { key: "formatGroupLabel", value: function formatGroupLabel(data) { return this.props.formatGroupLabel(data); } // ============================== // Mouse Handlers // ============================== }, { key: "startListeningComposition", value: // ============================== // Composition Handlers // ============================== function startListeningComposition() { if (document && document.addEventListener) { document.addEventListener('compositionstart', this.onCompositionStart, false); document.addEventListener('compositionend', this.onCompositionEnd, false); } } }, { key: "stopListeningComposition", value: function stopListeningComposition() { if (document && document.removeEventListener) { document.removeEventListener('compositionstart', this.onCompositionStart); document.removeEventListener('compositionend', this.onCompositionEnd); } } }, { key: "startListeningToTouch", value: // ============================== // Touch Handlers // ============================== function startListeningToTouch() { if (document && document.addEventListener) { document.addEventListener('touchstart', this.onTouchStart, false); document.addEventListener('touchmove', this.onTouchMove, false); document.addEventListener('touchend', this.onTouchEnd, false); } } }, { key: "stopListeningToTouch", value: function stopListeningToTouch() { if (document && document.removeEventListener) { document.removeEventListener('touchstart', this.onTouchStart); document.removeEventListener('touchmove', this.onTouchMove); document.removeEventListener('touchend', this.onTouchEnd); } } }, { key: "renderInput", value: // ============================== // Renderers // ============================== function renderInput() { var _this$props8 = this.props, isDisabled = _this$props8.isDisabled, isSearchable = _this$props8.isSearchable, inputId = _this$props8.inputId, inputValue = _this$props8.inputValue, tabIndex = _this$props8.tabIndex, form = _this$props8.form, menuIsOpen = _this$props8.menuIsOpen, required = _this$props8.required; var _this$getComponents = this.getComponents(), Input = _this$getComponents.Input; var _this$state4 = this.state, inputIsHidden = _this$state4.inputIsHidden, ariaSelection = _this$state4.ariaSelection; var commonProps = this.commonProps; var id = inputId || this.getElementId('input'); // aria attributes makes the JSX "noisy", separated for clarity var ariaAttributes = (0,objectSpread2/* default */.A)((0,objectSpread2/* default */.A)((0,objectSpread2/* default */.A)({ 'aria-autocomplete': 'list', 'aria-expanded': menuIsOpen, 'aria-haspopup': true, 'aria-errormessage': this.props['aria-errormessage'], 'aria-invalid': this.props['aria-invalid'], 'aria-label': this.props['aria-label'], 'aria-labelledby': this.props['aria-labelledby'], 'aria-required': required, role: 'combobox', 'aria-activedescendant': this.state.isAppleDevice ? undefined : this.state.focusedOptionId || '' }, menuIsOpen && { 'aria-controls': this.getElementId('listbox') }), !isSearchable && { 'aria-readonly': true }), this.hasValue() ? (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus' && { 'aria-describedby': this.getElementId('live-region') } : { 'aria-describedby': this.getElementId('placeholder') }); if (!isSearchable) { // use a dummy input to maintain focus/blur functionality return /*#__PURE__*/react.createElement(DummyInput, (0,esm_extends/* default */.A)({ id: id, innerRef: this.getInputRef, onBlur: this.onInputBlur, onChange: index_641ee5b8_esm.J, onFocus: this.onInputFocus, disabled: isDisabled, tabIndex: tabIndex, inputMode: "none", form: form, value: "" }, ariaAttributes)); } return /*#__PURE__*/react.createElement(Input, (0,esm_extends/* default */.A)({}, commonProps, { autoCapitalize: "none", autoComplete: "off", autoCorrect: "off", id: id, innerRef: this.getInputRef, isDisabled: isDisabled, isHidden: inputIsHidden, onBlur: this.onInputBlur, onChange: this.handleInputChange, onFocus: this.onInputFocus, spellCheck: "false", tabIndex: tabIndex, form: form, type: "text", value: inputValue }, ariaAttributes)); } }, { key: "renderPlaceholderOrValue", value: function renderPlaceholderOrValue() { var _this3 = this; var _this$getComponents2 = this.getComponents(), MultiValue = _this$getComponents2.MultiValue, MultiValueContainer = _this$getComponents2.MultiValueContainer, MultiValueLabel = _this$getComponents2.MultiValueLabel, MultiValueRemove = _this$getComponents2.MultiValueRemove, SingleValue = _this$getComponents2.SingleValue, Placeholder = _this$getComponents2.Placeholder; var commonProps = this.commonProps; var _this$props9 = this.props, controlShouldRenderValue = _this$props9.controlShouldRenderValue, isDisabled = _this$props9.isDisabled, isMulti = _this$props9.isMulti, inputValue = _this$props9.inputValue, placeholder = _this$props9.placeholder; var _this$state5 = this.state, selectValue = _this$state5.selectValue, focusedValue = _this$state5.focusedValue, isFocused = _this$state5.isFocused; if (!this.hasValue() || !controlShouldRenderValue) { return inputValue ? null : /*#__PURE__*/react.createElement(Placeholder, (0,esm_extends/* default */.A)({}, commonProps, { key: "placeholder", isDisabled: isDisabled, isFocused: isFocused, innerProps: { id: this.getElementId('placeholder') } }), placeholder); } if (isMulti) { return selectValue.map(function (opt, index) { var isOptionFocused = opt === focusedValue; var key = "".concat(_this3.getOptionLabel(opt), "-").concat(_this3.getOptionValue(opt)); return /*#__PURE__*/react.createElement(MultiValue, (0,esm_extends/* default */.A)({}, commonProps, { components: { Container: MultiValueContainer, Label: MultiValueLabel, Remove: MultiValueRemove }, isFocused: isOptionFocused, isDisabled: isDisabled, key: key, index: index, removeProps: { onClick: function onClick() { return _this3.removeValue(opt); }, onTouchEnd: function onTouchEnd() { return _this3.removeValue(opt); }, onMouseDown: function onMouseDown(e) { e.preventDefault(); } }, data: opt }), _this3.formatOptionLabel(opt, 'value')); }); } if (inputValue) { return null; } var singleValue = selectValue[0]; return /*#__PURE__*/react.createElement(SingleValue, (0,esm_extends/* default */.A)({}, commonProps, { data: singleValue, isDisabled: isDisabled }), this.formatOptionLabel(singleValue, 'value')); } }, { key: "renderClearIndicator", value: function renderClearIndicator() { var _this$getComponents3 = this.getComponents(), ClearIndicator = _this$getComponents3.ClearIndicator; var commonProps = this.commonProps; var _this$props10 = this.props, isDisabled = _this$props10.isDisabled, isLoading = _this$props10.isLoading; var isFocused = this.state.isFocused; if (!this.isClearable() || !ClearIndicator || isDisabled || !this.hasValue() || isLoading) { return null; } var innerProps = { onMouseDown: this.onClearIndicatorMouseDown, onTouchEnd: this.onClearIndicatorTouchEnd, 'aria-hidden': 'true' }; return /*#__PURE__*/react.createElement(ClearIndicator, (0,esm_extends/* default */.A)({}, commonProps, { innerProps: innerProps, isFocused: isFocused })); } }, { key: "renderLoadingIndicator", value: function renderLoadingIndicator() { var _this$getComponents4 = this.getComponents(), LoadingIndicator = _this$getComponents4.LoadingIndicator; var commonProps = this.commonProps; var _this$props11 = this.props, isDisabled = _this$props11.isDisabled, isLoading = _this$props11.isLoading; var isFocused = this.state.isFocused; if (!LoadingIndicator || !isLoading) return null; var innerProps = { 'aria-hidden': 'true' }; return /*#__PURE__*/react.createElement(LoadingIndicator, (0,esm_extends/* default */.A)({}, commonProps, { innerProps: innerProps, isDisabled: isDisabled, isFocused: isFocused })); } }, { key: "renderIndicatorSeparator", value: function renderIndicatorSeparator() { var _this$getComponents5 = this.getComponents(), DropdownIndicator = _this$getComponents5.DropdownIndicator, IndicatorSeparator = _this$getComponents5.IndicatorSeparator; // separator doesn't make sense without the dropdown indicator if (!DropdownIndicator || !IndicatorSeparator) return null; var commonProps = this.commonProps; var isDisabled = this.props.isDisabled; var isFocused = this.state.isFocused; return /*#__PURE__*/react.createElement(IndicatorSeparator, (0,esm_extends/* default */.A)({}, commonProps, { isDisabled: isDisabled, isFocused: isFocused })); } }, { key: "renderDropdownIndicator", value: function renderDropdownIndicator() { var _this$getComponents6 = this.getComponents(), DropdownIndicator = _this$getComponents6.DropdownIndicator; if (!DropdownIndicator) return null; var commonProps = this.commonProps; var isDisabled = this.props.isDisabled; var isFocused = this.state.isFocused; var innerProps = { onMouseDown: this.onDropdownIndicatorMouseDown, onTouchEnd: this.onDropdownIndicatorTouchEnd, 'aria-hidden': 'true' }; return /*#__PURE__*/react.createElement(DropdownIndicator, (0,esm_extends/* default */.A)({}, commonProps, { innerProps: innerProps, isDisabled: isDisabled, isFocused: isFocused })); } }, { key: "renderMenu", value: function renderMenu() { var _this4 = this; var _this$getComponents7 = this.getComponents(), Group = _this$getComponents7.Group, GroupHeading = _this$getComponents7.GroupHeading, Menu = _this$getComponents7.Menu, MenuList = _this$getComponents7.MenuList, MenuPortal = _this$getComponents7.MenuPortal, LoadingMessage = _this$getComponents7.LoadingMessage, NoOptionsMessage = _this$getComponents7.NoOptionsMessage, Option = _this$getComponents7.Option; var commonProps = this.commonProps; var focusedOption = this.state.focusedOption; var _this$props12 = this.props, captureMenuScroll = _this$props12.captureMenuScroll, inputValue = _this$props12.inputValue, isLoading = _this$props12.isLoading, loadingMessage = _this$props12.loadingMessage, minMenuHeight = _this$props12.minMenuHeight, maxMenuHeight = _this$props12.maxMenuHeight, menuIsOpen = _this$props12.menuIsOpen, menuPlacement = _this$props12.menuPlacement, menuPosition = _this$props12.menuPosition, menuPortalTarget = _this$props12.menuPortalTarget, menuShouldBlockScroll = _this$props12.menuShouldBlockScroll, menuShouldScrollIntoView = _this$props12.menuShouldScrollIntoView, noOptionsMessage = _this$props12.noOptionsMessage, onMenuScrollToTop = _this$props12.onMenuScrollToTop, onMenuScrollToBottom = _this$props12.onMenuScrollToBottom; if (!menuIsOpen) return null; // TODO: Internal Option Type here var render = function render(props, id) { var type = props.type, data = props.data, isDisabled = props.isDisabled, isSelected = props.isSelected, label = props.label, value = props.value; var isFocused = focusedOption === data; var onHover = isDisabled ? undefined : function () { return _this4.onOptionHover(data); }; var onSelect = isDisabled ? undefined : function () { return _this4.selectOption(data); }; var optionId = "".concat(_this4.getElementId('option'), "-").concat(id); var innerProps = { id: optionId, onClick: onSelect, onMouseMove: onHover, onMouseOver: onHover, tabIndex: -1, role: 'option', 'aria-selected': _this4.state.isAppleDevice ? undefined : isSelected // is not supported on Apple devices }; return /*#__PURE__*/react.createElement(Option, (0,esm_extends/* default */.A)({}, commonProps, { innerProps: innerProps, data: data, isDisabled: isDisabled, isSelected: isSelected, key: optionId, label: label, type: type, value: value, isFocused: isFocused, innerRef: isFocused ? _this4.getFocusedOptionRef : undefined }), _this4.formatOptionLabel(props.data, 'menu')); }; var menuUI; if (this.hasOptions()) { menuUI = this.getCategorizedOptions().map(function (item) { if (item.type === 'group') { var _data = item.data, options = item.options, groupIndex = item.index; var groupId = "".concat(_this4.getElementId('group'), "-").concat(groupIndex); var headingId = "".concat(groupId, "-heading"); return /*#__PURE__*/react.createElement(Group, (0,esm_extends/* default */.A)({}, commonProps, { key: groupId, data: _data, options: options, Heading: GroupHeading, headingProps: { id: headingId, data: item.data }, label: _this4.formatGroupLabel(item.data) }), item.options.map(function (option) { return render(option, "".concat(groupIndex, "-").concat(option.index)); })); } else if (item.type === 'option') { return render(item, "".concat(item.index)); } }); } else if (isLoading) { var message = loadingMessage({ inputValue: inputValue }); if (message === null) return null; menuUI = /*#__PURE__*/react.createElement(LoadingMessage, commonProps, message); } else { var _message = noOptionsMessage({ inputValue: inputValue }); if (_message === null) return null; menuUI = /*#__PURE__*/react.createElement(NoOptionsMessage, commonProps, _message); } var menuPlacementProps = { minMenuHeight: minMenuHeight, maxMenuHeight: maxMenuHeight, menuPlacement: menuPlacement, menuPosition: menuPosition, menuShouldScrollIntoView: menuShouldScrollIntoView }; var menuElement = /*#__PURE__*/react.createElement(index_641ee5b8_esm.M, (0,esm_extends/* default */.A)({}, commonProps, menuPlacementProps), function (_ref4) { var ref = _ref4.ref, _ref4$placerProps = _ref4.placerProps, placement = _ref4$placerProps.placement, maxHeight = _ref4$placerProps.maxHeight; return /*#__PURE__*/react.createElement(Menu, (0,esm_extends/* default */.A)({}, commonProps, menuPlacementProps, { innerRef: ref, innerProps: { onMouseDown: _this4.onMenuMouseDown, onMouseMove: _this4.onMenuMouseMove }, isLoading: isLoading, placement: placement }), /*#__PURE__*/react.createElement(ScrollManager, { captureEnabled: captureMenuScroll, onTopArrive: onMenuScrollToTop, onBottomArrive: onMenuScrollToBottom, lockEnabled: menuShouldBlockScroll }, function (scrollTargetRef) { return /*#__PURE__*/react.createElement(MenuList, (0,esm_extends/* default */.A)({}, commonProps, { innerRef: function innerRef(instance) { _this4.getMenuListRef(instance); scrollTargetRef(instance); }, innerProps: { role: 'listbox', 'aria-multiselectable': commonProps.isMulti, id: _this4.getElementId('listbox') }, isLoading: isLoading, maxHeight: maxHeight, focusedOption: focusedOption }), menuUI); })); }); // positioning behaviour is almost identical for portalled and fixed, // so we use the same component. the actual portalling logic is forked // within the component based on `menuPosition` return menuPortalTarget || menuPosition === 'fixed' ? /*#__PURE__*/react.createElement(MenuPortal, (0,esm_extends/* default */.A)({}, commonProps, { appendTo: menuPortalTarget, controlElement: this.controlRef, menuPlacement: menuPlacement, menuPosition: menuPosition }), menuElement) : menuElement; } }, { key: "renderFormField", value: function renderFormField() { var _this5 = this; var _this$props13 = this.props, delimiter = _this$props13.delimiter, isDisabled = _this$props13.isDisabled, isMulti = _this$props13.isMulti, name = _this$props13.name, required = _this$props13.required; var selectValue = this.state.selectValue; if (required && !this.hasValue() && !isDisabled) { return /*#__PURE__*/react.createElement(RequiredInput$1, { name: name, onFocus: this.onValueInputFocus }); } if (!name || isDisabled) return; if (isMulti) { if (delimiter) { var value = selectValue.map(function (opt) { return _this5.getOptionValue(opt); }).join(delimiter); return /*#__PURE__*/react.createElement("input", { name: name, type: "hidden", value: value }); } else { var input = selectValue.length > 0 ? selectValue.map(function (opt, i) { return /*#__PURE__*/react.createElement("input", { key: "i-".concat(i), name: name, type: "hidden", value: _this5.getOptionValue(opt) }); }) : /*#__PURE__*/react.createElement("input", { name: name, type: "hidden", value: "" }); return /*#__PURE__*/react.createElement("div", null, input); } } else { var _value = selectValue[0] ? this.getOptionValue(selectValue[0]) : ''; return /*#__PURE__*/react.createElement("input", { name: name, type: "hidden", value: _value }); } } }, { key: "renderLiveRegion", value: function renderLiveRegion() { var commonProps = this.commonProps; var _this$state6 = this.state, ariaSelection = _this$state6.ariaSelection, focusedOption = _this$state6.focusedOption, focusedValue = _this$state6.focusedValue, isFocused = _this$state6.isFocused, selectValue = _this$state6.selectValue; var focusableOptions = this.getFocusableOptions(); return /*#__PURE__*/react.createElement(LiveRegion$1, (0,esm_extends/* default */.A)({}, commonProps, { id: this.getElementId('live-region'), ariaSelection: ariaSelection, focusedOption: focusedOption, focusedValue: focusedValue, isFocused: isFocused, selectValue: selectValue, focusableOptions: focusableOptions, isAppleDevice: this.state.isAppleDevice })); } }, { key: "render", value: function render() { var _this$getComponents8 = this.getComponents(), Control = _this$getComponents8.Control, IndicatorsContainer = _this$getComponents8.IndicatorsContainer, SelectContainer = _this$getComponents8.SelectContainer, ValueContainer = _this$getComponents8.ValueContainer; var _this$props14 = this.props, className = _this$props14.className, id = _this$props14.id, isDisabled = _this$props14.isDisabled, menuIsOpen = _this$props14.menuIsOpen; var isFocused = this.state.isFocused; var commonProps = this.commonProps = this.getCommonProps(); return /*#__PURE__*/react.createElement(SelectContainer, (0,esm_extends/* default */.A)({}, commonProps, { className: className, innerProps: { id: id, onKeyDown: this.onKeyDown }, isDisabled: isDisabled, isFocused: isFocused }), this.renderLiveRegion(), /*#__PURE__*/react.createElement(Control, (0,esm_extends/* default */.A)({}, commonProps, { innerRef: this.getControlRef, innerProps: { onMouseDown: this.onControlMouseDown, onTouchEnd: this.onControlTouchEnd }, isDisabled: isDisabled, isFocused: isFocused, menuIsOpen: menuIsOpen }), /*#__PURE__*/react.createElement(ValueContainer, (0,esm_extends/* default */.A)({}, commonProps, { isDisabled: isDisabled }), this.renderPlaceholderOrValue(), this.renderInput()), /*#__PURE__*/react.createElement(IndicatorsContainer, (0,esm_extends/* default */.A)({}, commonProps, { isDisabled: isDisabled }), this.renderClearIndicator(), this.renderLoadingIndicator(), this.renderIndicatorSeparator(), this.renderDropdownIndicator())), this.renderMenu(), this.renderFormField()); } }], [{ key: "getDerivedStateFromProps", value: function getDerivedStateFromProps(props, state) { var prevProps = state.prevProps, clearFocusValueOnUpdate = state.clearFocusValueOnUpdate, inputIsHiddenAfterUpdate = state.inputIsHiddenAfterUpdate, ariaSelection = state.ariaSelection, isFocused = state.isFocused, prevWasFocused = state.prevWasFocused, instancePrefix = state.instancePrefix; var options = props.options, value = props.value, menuIsOpen = props.menuIsOpen, inputValue = props.inputValue, isMulti = props.isMulti; var selectValue = (0,index_641ee5b8_esm.H)(value); var newMenuOptionsState = {}; if (prevProps && (value !== prevProps.value || options !== prevProps.options || menuIsOpen !== prevProps.menuIsOpen || inputValue !== prevProps.inputValue)) { var focusableOptions = menuIsOpen ? buildFocusableOptions(props, selectValue) : []; var focusableOptionsWithIds = menuIsOpen ? buildFocusableOptionsWithIds(buildCategorizedOptions(props, selectValue), "".concat(instancePrefix, "-option")) : []; var focusedValue = clearFocusValueOnUpdate ? getNextFocusedValue(state, selectValue) : null; var focusedOption = getNextFocusedOption(state, focusableOptions); var focusedOptionId = getFocusedOptionId(focusableOptionsWithIds, focusedOption); newMenuOptionsState = { selectValue: selectValue, focusedOption: focusedOption, focusedOptionId: focusedOptionId, focusableOptionsWithIds: focusableOptionsWithIds, focusedValue: focusedValue, clearFocusValueOnUpdate: false }; } // some updates should toggle the state of the input visibility var newInputIsHiddenState = inputIsHiddenAfterUpdate != null && props !== prevProps ? { inputIsHidden: inputIsHiddenAfterUpdate, inputIsHiddenAfterUpdate: undefined } : {}; var newAriaSelection = ariaSelection; var hasKeptFocus = isFocused && prevWasFocused; if (isFocused && !hasKeptFocus) { // If `value` or `defaultValue` props are not empty then announce them // when the Select is initially focused newAriaSelection = { value: (0,index_641ee5b8_esm.D)(isMulti, selectValue, selectValue[0] || null), options: selectValue, action: 'initial-input-focus' }; hasKeptFocus = !prevWasFocused; } // If the 'initial-input-focus' action has been set already // then reset the ariaSelection to null if ((ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus') { newAriaSelection = null; } return (0,objectSpread2/* default */.A)((0,objectSpread2/* default */.A)((0,objectSpread2/* default */.A)({}, newMenuOptionsState), newInputIsHiddenState), {}, { prevProps: props, ariaSelection: newAriaSelection, prevWasFocused: hasKeptFocus }); } }]); return Select; }(react.Component); Select.defaultProps = defaultProps; /***/ }), /***/ 16804: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { A: () => (/* binding */ isMobileDevice), B: () => (/* binding */ multiValueAsValue), C: () => (/* binding */ singleValueAsValue), D: () => (/* binding */ valueTernary), E: () => (/* binding */ classNames), F: () => (/* binding */ defaultComponents), G: () => (/* binding */ isDocumentElement), H: () => (/* binding */ cleanValue), I: () => (/* binding */ scrollIntoView), J: () => (/* binding */ noop), K: () => (/* binding */ notNullish), L: () => (/* binding */ handleInputChange), M: () => (/* binding */ MenuPlacer), a: () => (/* binding */ clearIndicatorCSS), b: () => (/* binding */ containerCSS), c: () => (/* binding */ components), d: () => (/* binding */ css$1), e: () => (/* binding */ dropdownIndicatorCSS), f: () => (/* binding */ groupHeadingCSS), g: () => (/* binding */ groupCSS), h: () => (/* binding */ indicatorSeparatorCSS), i: () => (/* binding */ indicatorsContainerCSS), j: () => (/* binding */ inputCSS), k: () => (/* binding */ loadingMessageCSS), l: () => (/* binding */ loadingIndicatorCSS), m: () => (/* binding */ menuCSS), n: () => (/* binding */ menuListCSS), o: () => (/* binding */ menuPortalCSS), p: () => (/* binding */ multiValueCSS), q: () => (/* binding */ multiValueLabelCSS), r: () => (/* binding */ removeProps), s: () => (/* binding */ supportsPassiveEvents), t: () => (/* binding */ multiValueRemoveCSS), u: () => (/* binding */ noOptionsMessageCSS), v: () => (/* binding */ optionCSS), w: () => (/* binding */ placeholderCSS), x: () => (/* binding */ css), y: () => (/* binding */ valueContainerCSS), z: () => (/* binding */ isTouchCapable) }); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js var objectSpread2 = __webpack_require__(89379); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js var esm_extends = __webpack_require__(58168); // EXTERNAL MODULE: ./node_modules/@emotion/react/dist/emotion-react.browser.esm.js var emotion_react_browser_esm = __webpack_require__(17437); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 3 modules var slicedToArray = __webpack_require__(80296); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js var objectWithoutProperties = __webpack_require__(80045); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js var esm_typeof = __webpack_require__(82284); ;// ./node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); } // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js var defineProperty = __webpack_require__(64467); // EXTERNAL MODULE: ./node_modules/react/index.js var react = __webpack_require__(96540); // EXTERNAL MODULE: ./node_modules/react-dom/index.js var react_dom = __webpack_require__(40961); ;// ./node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs const sides = (/* unused pure expression or super */ null && (['top', 'right', 'bottom', 'left'])); const alignments = (/* unused pure expression or super */ null && (['start', 'end'])); const placements = /*#__PURE__*/(/* unused pure expression or super */ null && (sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []))); const min = Math.min; const max = Math.max; const round = Math.round; const floor = Math.floor; const createCoords = v => ({ x: v, y: v }); const oppositeSideMap = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; const oppositeAlignmentMap = { start: 'end', end: 'start' }; function clamp(start, value, end) { return max(start, min(value, end)); } function evaluate(value, param) { return typeof value === 'function' ? value(param) : value; } function getSide(placement) { return placement.split('-')[0]; } function getAlignment(placement) { return placement.split('-')[1]; } function getOppositeAxis(axis) { return axis === 'x' ? 'y' : 'x'; } function getAxisLength(axis) { return axis === 'y' ? 'height' : 'width'; } function getSideAxis(placement) { return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x'; } function getAlignmentAxis(placement) { return getOppositeAxis(getSideAxis(placement)); } function getAlignmentSides(placement, rects, rtl) { if (rtl === void 0) { rtl = false; } const alignment = getAlignment(placement); const alignmentAxis = getAlignmentAxis(placement); const length = getAxisLength(alignmentAxis); let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top'; if (rects.reference[length] > rects.floating[length]) { mainAlignmentSide = getOppositePlacement(mainAlignmentSide); } return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)]; } function getExpandedPlacements(placement) { const oppositePlacement = getOppositePlacement(placement); return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)]; } function getOppositeAlignmentPlacement(placement) { return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]); } function getSideList(side, isStart, rtl) { const lr = ['left', 'right']; const rl = ['right', 'left']; const tb = ['top', 'bottom']; const bt = ['bottom', 'top']; switch (side) { case 'top': case 'bottom': if (rtl) return isStart ? rl : lr; return isStart ? lr : rl; case 'left': case 'right': return isStart ? tb : bt; default: return []; } } function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { const alignment = getAlignment(placement); let list = getSideList(getSide(placement), direction === 'start', rtl); if (alignment) { list = list.map(side => side + "-" + alignment); if (flipAlignment) { list = list.concat(list.map(getOppositeAlignmentPlacement)); } } return list; } function getOppositePlacement(placement) { return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]); } function expandPaddingObject(padding) { return { top: 0, right: 0, bottom: 0, left: 0, ...padding }; } function getPaddingObject(padding) { return typeof padding !== 'number' ? expandPaddingObject(padding) : { top: padding, right: padding, bottom: padding, left: padding }; } function rectToClientRect(rect) { return { ...rect, top: rect.y, left: rect.x, right: rect.x + rect.width, bottom: rect.y + rect.height }; } ;// ./node_modules/@floating-ui/utils/dom/dist/floating-ui.utils.dom.mjs function getNodeName(node) { if (isNode(node)) { return (node.nodeName || '').toLowerCase(); } // Mocked nodes in testing environments may not be instances of Node. By // returning `#document` an infinite loop won't occur. // https://github.com/floating-ui/floating-ui/issues/2317 return '#document'; } function getWindow(node) { var _node$ownerDocument; return (node == null ? void 0 : (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; } function getDocumentElement(node) { var _ref; return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; } function isNode(value) { return value instanceof Node || value instanceof getWindow(value).Node; } function isElement(value) { return value instanceof Element || value instanceof getWindow(value).Element; } function isHTMLElement(value) { return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement; } function isShadowRoot(value) { // Browsers without `ShadowRoot` support. if (typeof ShadowRoot === 'undefined') { return false; } return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot; } function isOverflowElement(element) { const { overflow, overflowX, overflowY, display } = floating_ui_utils_dom_getComputedStyle(element); return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display); } function isTableElement(element) { return ['table', 'td', 'th'].includes(getNodeName(element)); } function isContainingBlock(element) { const webkit = isWebKit(); const css = floating_ui_utils_dom_getComputedStyle(element); // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value)); } function getContainingBlock(element) { let currentNode = getParentNode(element); while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { if (isContainingBlock(currentNode)) { return currentNode; } else { currentNode = getParentNode(currentNode); } } return null; } function isWebKit() { if (typeof CSS === 'undefined' || !CSS.supports) return false; return CSS.supports('-webkit-backdrop-filter', 'none'); } function isLastTraversableNode(node) { return ['html', 'body', '#document'].includes(getNodeName(node)); } function floating_ui_utils_dom_getComputedStyle(element) { return getWindow(element).getComputedStyle(element); } function getNodeScroll(element) { if (isElement(element)) { return { scrollLeft: element.scrollLeft, scrollTop: element.scrollTop }; } return { scrollLeft: element.pageXOffset, scrollTop: element.pageYOffset }; } function getParentNode(node) { if (getNodeName(node) === 'html') { return node; } const result = // Step into the shadow DOM of the parent of a slotted node. node.assignedSlot || // DOM Element detected. node.parentNode || // ShadowRoot detected. isShadowRoot(node) && node.host || // Fallback. getDocumentElement(node); return isShadowRoot(result) ? result.host : result; } function getNearestOverflowAncestor(node) { const parentNode = getParentNode(node); if (isLastTraversableNode(parentNode)) { return node.ownerDocument ? node.ownerDocument.body : node.body; } if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { return parentNode; } return getNearestOverflowAncestor(parentNode); } function getOverflowAncestors(node, list, traverseIframes) { var _node$ownerDocument2; if (list === void 0) { list = []; } if (traverseIframes === void 0) { traverseIframes = true; } const scrollableAncestor = getNearestOverflowAncestor(node); const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); const win = getWindow(scrollableAncestor); if (isBody) { return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []); } return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); } ;// ./node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs function getCssDimensions(element) { const css = floating_ui_utils_dom_getComputedStyle(element); // In testing environments, the `width` and `height` properties are empty // strings for SVG elements, returning NaN. Fallback to `0` in this case. let width = parseFloat(css.width) || 0; let height = parseFloat(css.height) || 0; const hasOffset = isHTMLElement(element); const offsetWidth = hasOffset ? element.offsetWidth : width; const offsetHeight = hasOffset ? element.offsetHeight : height; const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; if (shouldFallback) { width = offsetWidth; height = offsetHeight; } return { width, height, $: shouldFallback }; } function unwrapElement(element) { return !isElement(element) ? element.contextElement : element; } function getScale(element) { const domElement = unwrapElement(element); if (!isHTMLElement(domElement)) { return createCoords(1); } const rect = domElement.getBoundingClientRect(); const { width, height, $ } = getCssDimensions(domElement); let x = ($ ? round(rect.width) : rect.width) / width; let y = ($ ? round(rect.height) : rect.height) / height; // 0, NaN, or Infinity should always fallback to 1. if (!x || !Number.isFinite(x)) { x = 1; } if (!y || !Number.isFinite(y)) { y = 1; } return { x, y }; } const noOffsets = /*#__PURE__*/createCoords(0); function getVisualOffsets(element) { const win = getWindow(element); if (!isWebKit() || !win.visualViewport) { return noOffsets; } return { x: win.visualViewport.offsetLeft, y: win.visualViewport.offsetTop }; } function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { if (isFixed === void 0) { isFixed = false; } if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) { return false; } return isFixed; } function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { if (includeScale === void 0) { includeScale = false; } if (isFixedStrategy === void 0) { isFixedStrategy = false; } const clientRect = element.getBoundingClientRect(); const domElement = unwrapElement(element); let scale = createCoords(1); if (includeScale) { if (offsetParent) { if (isElement(offsetParent)) { scale = getScale(offsetParent); } } else { scale = getScale(element); } } const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0); let x = (clientRect.left + visualOffsets.x) / scale.x; let y = (clientRect.top + visualOffsets.y) / scale.y; let width = clientRect.width / scale.x; let height = clientRect.height / scale.y; if (domElement) { const win = getWindow(domElement); const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; let currentIFrame = win.frameElement; while (currentIFrame && offsetParent && offsetWin !== win) { const iframeScale = getScale(currentIFrame); const iframeRect = currentIFrame.getBoundingClientRect(); const css = floating_ui_utils_dom_getComputedStyle(currentIFrame); const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; x *= iframeScale.x; y *= iframeScale.y; width *= iframeScale.x; height *= iframeScale.y; x += left; y += top; currentIFrame = getWindow(currentIFrame).frameElement; } } return rectToClientRect({ width, height, x, y }); } function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { let { rect, offsetParent, strategy } = _ref; const isOffsetParentAnElement = isHTMLElement(offsetParent); const documentElement = getDocumentElement(offsetParent); if (offsetParent === documentElement) { return rect; } let scroll = { scrollLeft: 0, scrollTop: 0 }; let scale = createCoords(1); const offsets = createCoords(0); if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') { if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { scroll = getNodeScroll(offsetParent); } if (isHTMLElement(offsetParent)) { const offsetRect = getBoundingClientRect(offsetParent); scale = getScale(offsetParent); offsets.x = offsetRect.x + offsetParent.clientLeft; offsets.y = offsetRect.y + offsetParent.clientTop; } } return { width: rect.width * scale.x, height: rect.height * scale.y, x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x, y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y }; } function getClientRects(element) { return Array.from(element.getClientRects()); } function getWindowScrollBarX(element) { // If has a CSS width greater than the viewport, then this will be // incorrect for RTL. return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft; } // Gets the entire size of the scrollable document area, even extending outside // of the `` and `` rect bounds if horizontally scrollable. function getDocumentRect(element) { const html = getDocumentElement(element); const scroll = getNodeScroll(element); const body = element.ownerDocument.body; const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); let x = -scroll.scrollLeft + getWindowScrollBarX(element); const y = -scroll.scrollTop; if (floating_ui_utils_dom_getComputedStyle(body).direction === 'rtl') { x += max(html.clientWidth, body.clientWidth) - width; } return { width, height, x, y }; } function getViewportRect(element, strategy) { const win = getWindow(element); const html = getDocumentElement(element); const visualViewport = win.visualViewport; let width = html.clientWidth; let height = html.clientHeight; let x = 0; let y = 0; if (visualViewport) { width = visualViewport.width; height = visualViewport.height; const visualViewportBased = isWebKit(); if (!visualViewportBased || visualViewportBased && strategy === 'fixed') { x = visualViewport.offsetLeft; y = visualViewport.offsetTop; } } return { width, height, x, y }; } // Returns the inner client rect, subtracting scrollbars if present. function getInnerBoundingClientRect(element, strategy) { const clientRect = getBoundingClientRect(element, true, strategy === 'fixed'); const top = clientRect.top + element.clientTop; const left = clientRect.left + element.clientLeft; const scale = isHTMLElement(element) ? getScale(element) : createCoords(1); const width = element.clientWidth * scale.x; const height = element.clientHeight * scale.y; const x = left * scale.x; const y = top * scale.y; return { width, height, x, y }; } function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { let rect; if (clippingAncestor === 'viewport') { rect = getViewportRect(element, strategy); } else if (clippingAncestor === 'document') { rect = getDocumentRect(getDocumentElement(element)); } else if (isElement(clippingAncestor)) { rect = getInnerBoundingClientRect(clippingAncestor, strategy); } else { const visualOffsets = getVisualOffsets(element); rect = { ...clippingAncestor, x: clippingAncestor.x - visualOffsets.x, y: clippingAncestor.y - visualOffsets.y }; } return rectToClientRect(rect); } function hasFixedPositionAncestor(element, stopNode) { const parentNode = getParentNode(element); if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { return false; } return floating_ui_utils_dom_getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode); } // A "clipping ancestor" is an `overflow` element with the characteristic of // clipping (or hiding) child elements. This returns all clipping ancestors // of the given element up the tree. function getClippingElementAncestors(element, cache) { const cachedResult = cache.get(element); if (cachedResult) { return cachedResult; } let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body'); let currentContainingBlockComputedStyle = null; const elementIsFixed = floating_ui_utils_dom_getComputedStyle(element).position === 'fixed'; let currentNode = elementIsFixed ? getParentNode(element) : element; // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { const computedStyle = floating_ui_utils_dom_getComputedStyle(currentNode); const currentNodeIsContaining = isContainingBlock(currentNode); if (!currentNodeIsContaining && computedStyle.position === 'fixed') { currentContainingBlockComputedStyle = null; } const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); if (shouldDropCurrentNode) { // Drop non-containing blocks. result = result.filter(ancestor => ancestor !== currentNode); } else { // Record last containing block for next iteration. currentContainingBlockComputedStyle = computedStyle; } currentNode = getParentNode(currentNode); } cache.set(element, result); return result; } // Gets the maximum area that the element is visible in due to any number of // clipping ancestors. function getClippingRect(_ref) { let { element, boundary, rootBoundary, strategy } = _ref; const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary); const clippingAncestors = [...elementClippingAncestors, rootBoundary]; const firstClippingAncestor = clippingAncestors[0]; const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => { const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy); accRect.top = max(rect.top, accRect.top); accRect.right = min(rect.right, accRect.right); accRect.bottom = min(rect.bottom, accRect.bottom); accRect.left = max(rect.left, accRect.left); return accRect; }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy)); return { width: clippingRect.right - clippingRect.left, height: clippingRect.bottom - clippingRect.top, x: clippingRect.left, y: clippingRect.top }; } function getDimensions(element) { return getCssDimensions(element); } function getRectRelativeToOffsetParent(element, offsetParent, strategy) { const isOffsetParentAnElement = isHTMLElement(offsetParent); const documentElement = getDocumentElement(offsetParent); const isFixed = strategy === 'fixed'; const rect = getBoundingClientRect(element, true, isFixed, offsetParent); let scroll = { scrollLeft: 0, scrollTop: 0 }; const offsets = createCoords(0); if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { scroll = getNodeScroll(offsetParent); } if (isOffsetParentAnElement) { const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); offsets.x = offsetRect.x + offsetParent.clientLeft; offsets.y = offsetRect.y + offsetParent.clientTop; } else if (documentElement) { offsets.x = getWindowScrollBarX(documentElement); } } return { x: rect.left + scroll.scrollLeft - offsets.x, y: rect.top + scroll.scrollTop - offsets.y, width: rect.width, height: rect.height }; } function getTrueOffsetParent(element, polyfill) { if (!isHTMLElement(element) || floating_ui_utils_dom_getComputedStyle(element).position === 'fixed') { return null; } if (polyfill) { return polyfill(element); } return element.offsetParent; } // Gets the closest ancestor positioned element. Handles some edge cases, // such as table ancestors and cross browser bugs. function getOffsetParent(element, polyfill) { const window = getWindow(element); if (!isHTMLElement(element)) { return window; } let offsetParent = getTrueOffsetParent(element, polyfill); while (offsetParent && isTableElement(offsetParent) && floating_ui_utils_dom_getComputedStyle(offsetParent).position === 'static') { offsetParent = getTrueOffsetParent(offsetParent, polyfill); } if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && floating_ui_utils_dom_getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) { return window; } return offsetParent || getContainingBlock(element) || window; } const getElementRects = async function (_ref) { let { reference, floating, strategy } = _ref; const getOffsetParentFn = this.getOffsetParent || getOffsetParent; const getDimensionsFn = this.getDimensions; return { reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy), floating: { x: 0, y: 0, ...(await getDimensionsFn(floating)) } }; }; function isRTL(element) { return floating_ui_utils_dom_getComputedStyle(element).direction === 'rtl'; } const platform = { convertOffsetParentRelativeRectToViewportRelativeRect, getDocumentElement: getDocumentElement, getClippingRect, getOffsetParent, getElementRects, getClientRects, getDimensions, getScale, isElement: isElement, isRTL }; // https://samthor.au/2021/observing-dom/ function observeMove(element, onMove) { let io = null; let timeoutId; const root = getDocumentElement(element); function cleanup() { clearTimeout(timeoutId); io && io.disconnect(); io = null; } function refresh(skip, threshold) { if (skip === void 0) { skip = false; } if (threshold === void 0) { threshold = 1; } cleanup(); const { left, top, width, height } = element.getBoundingClientRect(); if (!skip) { onMove(); } if (!width || !height) { return; } const insetTop = floor(top); const insetRight = floor(root.clientWidth - (left + width)); const insetBottom = floor(root.clientHeight - (top + height)); const insetLeft = floor(left); const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; const options = { rootMargin, threshold: max(0, min(1, threshold)) || 1 }; let isFirstUpdate = true; function handleObserve(entries) { const ratio = entries[0].intersectionRatio; if (ratio !== threshold) { if (!isFirstUpdate) { return refresh(); } if (!ratio) { timeoutId = setTimeout(() => { refresh(false, 1e-7); }, 100); } else { refresh(false, ratio); } } isFirstUpdate = false; } // Older browsers don't support a `document` as the root and will throw an // error. try { io = new IntersectionObserver(handleObserve, { ...options, // Handle