path
stringlengths
5
195
repo_name
stringlengths
5
79
content
stringlengths
25
1.01M
ajax/libs/material-ui/4.9.2/esm/ButtonBase/Ripple.js
cdnjs/cdnjs
import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import useEventCallback from '../utils/useEventCallback'; var useEnhancedEffect = typeof window === 'undefined' ? React.useEffect : React.useLayoutEffect; /** * @ignore - internal component. */ function Ripple(props) { var classes = props.classes, _props$pulsate = props.pulsate, pulsate = _props$pulsate === void 0 ? false : _props$pulsate, rippleX = props.rippleX, rippleY = props.rippleY, rippleSize = props.rippleSize, inProp = props.in, _props$onExited = props.onExited, onExited = _props$onExited === void 0 ? function () {} : _props$onExited, timeout = props.timeout; var _React$useState = React.useState(false), leaving = _React$useState[0], setLeaving = _React$useState[1]; var rippleClassName = clsx(classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate); var rippleStyles = { width: rippleSize, height: rippleSize, top: -(rippleSize / 2) + rippleY, left: -(rippleSize / 2) + rippleX }; var childClassName = clsx(classes.child, leaving && classes.childLeaving, pulsate && classes.childPulsate); var handleExited = useEventCallback(onExited); // Ripple is used for user feedback (e.g. click or press) so we want to apply styles with the highest priority useEnhancedEffect(function () { if (!inProp) { // react-transition-group#onExit setLeaving(true); // react-transition-group#onExited var timeoutId = setTimeout(handleExited, timeout); return function () { clearTimeout(timeoutId); }; } return undefined; }, [handleExited, inProp, timeout]); return React.createElement("span", { className: rippleClassName, style: rippleStyles }, React.createElement("span", { className: childClassName })); } process.env.NODE_ENV !== "production" ? Ripple.propTypes = { /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * @ignore - injected from TransitionGroup */ in: PropTypes.bool, /** * @ignore - injected from TransitionGroup */ onExited: PropTypes.func, /** * If `true`, the ripple pulsates, typically indicating the keyboard focus state of an element. */ pulsate: PropTypes.bool, /** * Diameter of the ripple. */ rippleSize: PropTypes.number, /** * Horizontal position of the ripple center. */ rippleX: PropTypes.number, /** * Vertical position of the ripple center. */ rippleY: PropTypes.number, /** * exit delay */ timeout: PropTypes.number.isRequired } : void 0; export default Ripple;
ajax/libs/react-native-web/0.12.0/exports/AppRegistry/AppContainer.js
cdnjs/cdnjs
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } /** * Copyright (c) Nicolas Gallagher. * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ import StyleSheet from '../StyleSheet'; import View from '../View'; import { any } from 'prop-types'; import React from 'react'; var AppContainer = /*#__PURE__*/ function (_React$Component) { _inheritsLoose(AppContainer, _React$Component); function AppContainer() { var _this; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; _this.state = { mainKey: 1 }; return _this; } var _proto = AppContainer.prototype; _proto.getChildContext = function getChildContext() { return { rootTag: this.props.rootTag }; }; _proto.render = function render() { var _this$props = this.props, children = _this$props.children, WrapperComponent = _this$props.WrapperComponent; var innerView = React.createElement(View, { children: children, key: this.state.mainKey, pointerEvents: "box-none", style: styles.appContainer }); if (WrapperComponent) { innerView = React.createElement(WrapperComponent, null, innerView); } return React.createElement(View, { pointerEvents: "box-none", style: styles.appContainer }, innerView); }; return AppContainer; }(React.Component); AppContainer.childContextTypes = { rootTag: any }; export { AppContainer as default }; var styles = StyleSheet.create({ appContainer: { flex: 1 } });
ajax/libs/primereact/6.6.0/editor/editor.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; import { classNames } from 'primereact/core'; 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); return Constructor; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); } 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); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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 _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; } } var Editor = /*#__PURE__*/function (_Component) { _inherits(Editor, _Component); var _super = _createSuper(Editor); function Editor() { _classCallCheck(this, Editor); return _super.apply(this, arguments); } _createClass(Editor, [{ key: "getQuill", value: function getQuill() { return this.quill; } }, { key: "componentDidMount", value: function componentDidMount() { var _this = this; import('quill').then(function (module) { if (module && module.default) { _this.quill = new module.default(_this.editorElement, { modules: _objectSpread({ toolbar: _this.toolbarElement }, _this.props.modules), placeholder: _this.props.placeholder, readOnly: _this.props.readOnly, theme: _this.props.theme, formats: _this.props.formats }); if (_this.props.value) { _this.quill.setContents(_this.quill.clipboard.convert(_this.props.value)); } _this.quill.on('text-change', function (delta, source) { var html = _this.editorElement.children[0].innerHTML; var text = _this.quill.getText(); if (html === '<p><br></p>') { html = null; } if (_this.props.onTextChange) { _this.props.onTextChange({ htmlValue: html, textValue: text, delta: delta, source: source }); } }); _this.quill.on('selection-change', function (range, oldRange, source) { if (_this.props.onSelectionChange) { _this.props.onSelectionChange({ range: range, oldRange: oldRange, source: source }); } }); } }).then(function () { if (_this.quill && _this.quill.getModule('toolbar')) { _this.props.onLoad && _this.props.onLoad(_this.quill); } }); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (this.props.value !== prevProps.value && this.quill && !this.quill.hasFocus()) { if (this.props.value) this.quill.setContents(this.quill.clipboard.convert(this.props.value));else this.quill.setText(''); } } }, { key: "render", value: function render() { var _this2 = this; var containerClass = classNames('p-component p-editor-container', this.props.className); var toolbarHeader = null; if (this.props.headerTemplate) { toolbarHeader = /*#__PURE__*/React.createElement("div", { ref: function ref(el) { return _this2.toolbarElement = el; }, className: "p-editor-toolbar" }, this.props.headerTemplate); } else { toolbarHeader = /*#__PURE__*/React.createElement("div", { ref: function ref(el) { return _this2.toolbarElement = el; }, className: "p-editor-toolbar" }, /*#__PURE__*/React.createElement("span", { className: "ql-formats" }, /*#__PURE__*/React.createElement("select", { className: "ql-header", defaultValue: "0" }, /*#__PURE__*/React.createElement("option", { value: "1" }, "Heading"), /*#__PURE__*/React.createElement("option", { value: "2" }, "Subheading"), /*#__PURE__*/React.createElement("option", { value: "0" }, "Normal")), /*#__PURE__*/React.createElement("select", { className: "ql-font" }, /*#__PURE__*/React.createElement("option", null), /*#__PURE__*/React.createElement("option", { value: "serif" }), /*#__PURE__*/React.createElement("option", { value: "monospace" }))), /*#__PURE__*/React.createElement("span", { className: "ql-formats" }, /*#__PURE__*/React.createElement("button", { type: "button", className: "ql-bold", "aria-label": "Bold" }), /*#__PURE__*/React.createElement("button", { type: "button", className: "ql-italic", "aria-label": "Italic" }), /*#__PURE__*/React.createElement("button", { type: "button", className: "ql-underline", "aria-label": "Underline" })), /*#__PURE__*/React.createElement("span", { className: "ql-formats" }, /*#__PURE__*/React.createElement("select", { className: "ql-color" }), /*#__PURE__*/React.createElement("select", { className: "ql-background" })), /*#__PURE__*/React.createElement("span", { className: "ql-formats" }, /*#__PURE__*/React.createElement("button", { type: "button", className: "ql-list", value: "ordered", "aria-label": "Ordered List" }), /*#__PURE__*/React.createElement("button", { type: "button", className: "ql-list", value: "bullet", "aria-label": "Unordered List" }), /*#__PURE__*/React.createElement("select", { className: "ql-align" }, /*#__PURE__*/React.createElement("option", { defaultValue: true }), /*#__PURE__*/React.createElement("option", { value: "center" }), /*#__PURE__*/React.createElement("option", { value: "right" }), /*#__PURE__*/React.createElement("option", { value: "justify" }))), /*#__PURE__*/React.createElement("span", { className: "ql-formats" }, /*#__PURE__*/React.createElement("button", { type: "button", className: "ql-link", "aria-label": "Insert Link" }), /*#__PURE__*/React.createElement("button", { type: "button", className: "ql-image", "aria-label": "Insert Image" }), /*#__PURE__*/React.createElement("button", { type: "button", className: "ql-code-block", "aria-label": "Insert Code Block" })), /*#__PURE__*/React.createElement("span", { className: "ql-formats" }, /*#__PURE__*/React.createElement("button", { type: "button", className: "ql-clean", "aria-label": "Remove Styles" }))); } var content = /*#__PURE__*/React.createElement("div", { ref: function ref(el) { return _this2.editorElement = el; }, className: "p-editor-content", style: this.props.style }); return /*#__PURE__*/React.createElement("div", { id: this.props.id, className: containerClass }, toolbarHeader, content); } }]); return Editor; }(Component); _defineProperty(Editor, "defaultProps", { id: null, value: null, style: null, className: null, placeholder: null, readOnly: false, modules: null, formats: null, theme: 'snow', headerTemplate: null, onTextChange: null, onSelectionChange: null, onLoad: null }); export { Editor };
ajax/libs/react-native-web/0.12.2/exports/Image/index.js
cdnjs/cdnjs
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { 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; } function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } /** * Copyright (c) Nicolas Gallagher. * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ import applyNativeMethods from '../../modules/applyNativeMethods'; import createElement from '../createElement'; import css from '../StyleSheet/css'; import { getAssetByID } from '../../modules/AssetRegistry'; import resolveShadowValue from '../StyleSheet/resolveShadowValue'; import ImageLoader from '../../modules/ImageLoader'; import ImageUriCache from './ImageUriCache'; import PixelRatio from '../PixelRatio'; import StyleSheet from '../StyleSheet'; import TextAncestorContext from '../Text/TextAncestorContext'; import View from '../View'; import React from 'react'; var STATUS_ERRORED = 'ERRORED'; var STATUS_LOADED = 'LOADED'; var STATUS_LOADING = 'LOADING'; var STATUS_PENDING = 'PENDING'; var STATUS_IDLE = 'IDLE'; var getImageState = function getImageState(uri, shouldDisplaySource) { return shouldDisplaySource ? STATUS_LOADED : uri ? STATUS_PENDING : STATUS_IDLE; }; var resolveAssetDimensions = function resolveAssetDimensions(source) { if (typeof source === 'number') { var _getAssetByID = getAssetByID(source), height = _getAssetByID.height, width = _getAssetByID.width; return { height: height, width: width }; } else if (typeof source === 'object') { var _height = source.height, _width = source.width; return { height: _height, width: _width }; } }; var svgDataUriPattern = /^(data:image\/svg\+xml;utf8,)(.*)/; var resolveAssetUri = function resolveAssetUri(source) { var uri = ''; if (typeof source === 'number') { // get the URI from the packager var asset = getAssetByID(source); var scale = asset.scales[0]; if (asset.scales.length > 1) { var preferredScale = PixelRatio.get(); // Get the scale which is closest to the preferred scale scale = asset.scales.reduce(function (prev, curr) { return Math.abs(curr - preferredScale) < Math.abs(prev - preferredScale) ? curr : prev; }); } var scaleSuffix = scale !== 1 ? "@" + scale + "x" : ''; uri = asset ? asset.httpServerLocation + "/" + asset.name + scaleSuffix + "." + asset.type : ''; } else if (typeof source === 'string') { uri = source; } else if (source && typeof source.uri === 'string') { uri = source.uri; } if (uri) { var match = uri.match(svgDataUriPattern); // inline SVG markup may contain characters (e.g., #, ") that need to be escaped if (match) { var prefix = match[1], svg = match[2]; var encodedSvg = encodeURIComponent(svg); return "" + prefix + encodedSvg; } } return uri; }; var filterId = 0; var createTintColorSVG = function createTintColorSVG(tintColor, id) { return tintColor && id != null ? React.createElement("svg", { style: { position: 'absolute', height: 0, visibility: 'hidden', width: 0 } }, React.createElement("defs", null, React.createElement("filter", { id: "tint-" + id }, React.createElement("feFlood", { floodColor: "" + tintColor }), React.createElement("feComposite", { in2: "SourceAlpha", operator: "atop" })))) : null; }; var Image = /*#__PURE__*/ function (_React$Component) { _inheritsLoose(Image, _React$Component); Image.getSize = function getSize(uri, success, failure) { ImageLoader.getSize(uri, success, failure); }; Image.prefetch = function prefetch(uri) { return ImageLoader.prefetch(uri).then(function () { // Add the uri to the cache so it can be immediately displayed when used // but also immediately remove it to correctly reflect that it has no active references ImageUriCache.add(uri); ImageUriCache.remove(uri); }); }; Image.queryCache = function queryCache(uris) { var result = {}; uris.forEach(function (u) { if (ImageUriCache.has(u)) { result[u] = 'disk/memory'; } }); return Promise.resolve(result); }; function Image(props, context) { var _this; _this = _React$Component.call(this, props, context) || this; // If an image has been loaded before, render it immediately _this._filterId = 0; _this._imageRef = null; _this._imageRequestId = null; _this._imageState = null; _this._isMounted = false; _this._createLayoutHandler = function (resizeMode) { var onLayout = _this.props.onLayout; if (resizeMode === 'center' || resizeMode === 'repeat' || onLayout) { return function (e) { var layout = e.nativeEvent.layout; onLayout && onLayout(e); _this.setState(function () { return { layout: layout }; }); }; } }; _this._getBackgroundSize = function (resizeMode) { if (_this._imageRef && (resizeMode === 'center' || resizeMode === 'repeat')) { var _this$_imageRef = _this._imageRef, naturalHeight = _this$_imageRef.naturalHeight, naturalWidth = _this$_imageRef.naturalWidth; var _this$state$layout = _this.state.layout, height = _this$state$layout.height, width = _this$state$layout.width; if (naturalHeight && naturalWidth && height && width) { var scaleFactor = Math.min(1, width / naturalWidth, height / naturalHeight); var x = Math.ceil(scaleFactor * naturalWidth); var y = Math.ceil(scaleFactor * naturalHeight); return { backgroundSize: x + "px " + y + "px" }; } } }; _this._onError = function () { var _this$props = _this.props, onError = _this$props.onError, source = _this$props.source; _this._updateImageState(STATUS_ERRORED); if (onError) { onError({ nativeEvent: { error: "Failed to load resource " + resolveAssetUri(source) + " (404)" } }); } _this._onLoadEnd(); }; _this._onLoad = function (e) { var _this$props2 = _this.props, onLoad = _this$props2.onLoad, source = _this$props2.source; var event = { nativeEvent: e }; ImageUriCache.add(resolveAssetUri(source)); _this._updateImageState(STATUS_LOADED); if (onLoad) { onLoad(event); } _this._onLoadEnd(); }; _this._setImageRef = function (ref) { _this._imageRef = ref; }; var uri = resolveAssetUri(props.source); var shouldDisplaySource = ImageUriCache.has(uri); _this.state = { layout: {}, shouldDisplaySource: shouldDisplaySource }; _this._imageState = getImageState(uri, shouldDisplaySource); _this._filterId = filterId; filterId++; return _this; } var _proto = Image.prototype; _proto.componentDidMount = function componentDidMount() { this._isMounted = true; if (this._imageState === STATUS_PENDING) { this._createImageLoader(); } else if (this._imageState === STATUS_LOADED) { this._onLoad({ target: this._imageRef }); } }; _proto.componentDidUpdate = function componentDidUpdate(prevProps) { var prevUri = resolveAssetUri(prevProps.source); var uri = resolveAssetUri(this.props.source); var hasDefaultSource = this.props.defaultSource != null; if (prevUri !== uri) { ImageUriCache.remove(prevUri); var isPreviouslyLoaded = ImageUriCache.has(uri); isPreviouslyLoaded && ImageUriCache.add(uri); this._updateImageState(getImageState(uri, isPreviouslyLoaded), hasDefaultSource); } else if (hasDefaultSource && prevProps.defaultSource !== this.props.defaultSource) { this._updateImageState(this._imageState, hasDefaultSource); } if (this._imageState === STATUS_PENDING) { this._createImageLoader(); } }; _proto.componentWillUnmount = function componentWillUnmount() { var uri = resolveAssetUri(this.props.source); ImageUriCache.remove(uri); this._destroyImageLoader(); this._isMounted = false; }; _proto.renderImage = function renderImage(hasTextAncestor) { var shouldDisplaySource = this.state.shouldDisplaySource; var _this$props3 = this.props, accessibilityLabel = _this$props3.accessibilityLabel, accessibilityRelationship = _this$props3.accessibilityRelationship, accessibilityRole = _this$props3.accessibilityRole, accessibilityState = _this$props3.accessibilityState, accessible = _this$props3.accessible, blurRadius = _this$props3.blurRadius, defaultSource = _this$props3.defaultSource, draggable = _this$props3.draggable, importantForAccessibility = _this$props3.importantForAccessibility, nativeID = _this$props3.nativeID, pointerEvents = _this$props3.pointerEvents, resizeMode = _this$props3.resizeMode, source = _this$props3.source, testID = _this$props3.testID; if (process.env.NODE_ENV !== 'production') { if (this.props.children) { throw new Error('The <Image> component cannot contain children. If you want to render content on top of the image, consider using the <ImageBackground> component or absolute positioning.'); } } var selectedSource = shouldDisplaySource ? source : defaultSource; var displayImageUri = resolveAssetUri(selectedSource); var imageSizeStyle = resolveAssetDimensions(selectedSource); var backgroundImage = displayImageUri ? "url(\"" + displayImageUri + "\")" : null; var flatStyle = _objectSpread({}, StyleSheet.flatten(this.props.style)); var finalResizeMode = resizeMode || flatStyle.resizeMode || 'cover'; // CSS filters var filters = []; var tintColor = flatStyle.tintColor; if (flatStyle.filter) { filters.push(flatStyle.filter); } if (blurRadius) { filters.push("blur(" + blurRadius + "px)"); } if (flatStyle.shadowOffset) { var shadowString = resolveShadowValue(flatStyle); if (shadowString) { filters.push("drop-shadow(" + shadowString + ")"); } } if (flatStyle.tintColor) { filters.push("url(#tint-" + this._filterId + ")"); } // these styles were converted to filters delete flatStyle.shadowColor; delete flatStyle.shadowOpacity; delete flatStyle.shadowOffset; delete flatStyle.shadowRadius; delete flatStyle.tintColor; // these styles are not supported on View delete flatStyle.overlayColor; delete flatStyle.resizeMode; // Accessibility image allows users to trigger the browser's image context menu var hiddenImage = displayImageUri ? createElement('img', { alt: accessibilityLabel || '', classList: [classes.accessibilityImage], draggable: draggable || false, ref: this._setImageRef, src: displayImageUri }) : null; return React.createElement(View, { accessibilityLabel: accessibilityLabel, accessibilityRelationship: accessibilityRelationship, accessibilityRole: accessibilityRole, accessibilityState: accessibilityState, accessible: accessible, importantForAccessibility: importantForAccessibility, nativeID: nativeID, onLayout: this._createLayoutHandler(finalResizeMode), pointerEvents: pointerEvents, style: [styles.root, hasTextAncestor && styles.inline, imageSizeStyle, flatStyle], testID: testID }, React.createElement(View, { style: [styles.image, resizeModeStyles[finalResizeMode], this._getBackgroundSize(finalResizeMode), backgroundImage && { backgroundImage: backgroundImage }, filters.length > 0 && { filter: filters.join(' ') }] }), hiddenImage, createTintColorSVG(tintColor, this._filterId)); }; _proto.render = function render() { var _this2 = this; return React.createElement(TextAncestorContext.Consumer, null, function (hasTextAncestor) { return _this2.renderImage(hasTextAncestor); }); }; _proto._createImageLoader = function _createImageLoader() { var source = this.props.source; this._destroyImageLoader(); var uri = resolveAssetUri(source); this._imageRequestId = ImageLoader.load(uri, this._onLoad, this._onError); this._onLoadStart(); }; _proto._destroyImageLoader = function _destroyImageLoader() { if (this._imageRequestId) { ImageLoader.abort(this._imageRequestId); this._imageRequestId = null; } }; _proto._onLoadEnd = function _onLoadEnd() { var onLoadEnd = this.props.onLoadEnd; if (onLoadEnd) { onLoadEnd(); } }; _proto._onLoadStart = function _onLoadStart() { var _this$props4 = this.props, defaultSource = _this$props4.defaultSource, onLoadStart = _this$props4.onLoadStart; this._updateImageState(STATUS_LOADING, defaultSource != null); if (onLoadStart) { onLoadStart(); } }; _proto._updateImageState = function _updateImageState(status, hasDefaultSource) { if (hasDefaultSource === void 0) { hasDefaultSource = false; } this._imageState = status; var shouldDisplaySource = this._imageState === STATUS_LOADED || this._imageState === STATUS_LOADING && !hasDefaultSource; // only triggers a re-render when the image is loading and has no default image (to support PJPEG), loaded, or failed if (shouldDisplaySource !== this.state.shouldDisplaySource) { if (this._isMounted) { this.setState(function () { return { shouldDisplaySource: shouldDisplaySource }; }); } } }; return Image; }(React.Component); Image.displayName = 'Image'; var classes = css.create({ accessibilityImage: _objectSpread({}, StyleSheet.absoluteFillObject, { height: '100%', opacity: 0, width: '100%', zIndex: -1 }) }); var styles = StyleSheet.create({ root: { flexBasis: 'auto', overflow: 'hidden', zIndex: 0 }, inline: { display: 'inline-flex' }, image: _objectSpread({}, StyleSheet.absoluteFillObject, { backgroundColor: 'transparent', backgroundPosition: 'center', backgroundRepeat: 'no-repeat', backgroundSize: 'cover', height: '100%', width: '100%', zIndex: -1 }) }); var resizeModeStyles = StyleSheet.create({ center: { backgroundSize: 'auto' }, contain: { backgroundSize: 'contain' }, cover: { backgroundSize: 'cover' }, none: { backgroundPosition: '0 0', backgroundSize: 'auto' }, repeat: { backgroundPosition: '0 0', backgroundRepeat: 'repeat', backgroundSize: 'auto' }, stretch: { backgroundSize: '100% 100%' } }); export default applyNativeMethods(Image);
ajax/libs/material-ui/4.9.2/es/Container/Container.js
cdnjs/cdnjs
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import withStyles from '../styles/withStyles'; import capitalize from '../utils/capitalize'; export const styles = theme => ({ /* Styles applied to the root element. */ root: { width: '100%', marginLeft: 'auto', boxSizing: 'border-box', marginRight: 'auto', paddingLeft: theme.spacing(2), paddingRight: theme.spacing(2), [theme.breakpoints.up('sm')]: { paddingLeft: theme.spacing(3), paddingRight: theme.spacing(3) } }, /* Styles applied to the root element if `disableGutters={true}`. */ disableGutters: { paddingLeft: 0, paddingRight: 0 }, /* Styles applied to the root element if `fixed={true}`. */ fixed: Object.keys(theme.breakpoints.values).reduce((acc, breakpoint) => { const value = theme.breakpoints.values[breakpoint]; if (value !== 0) { acc[theme.breakpoints.up(breakpoint)] = { maxWidth: value }; } return acc; }, {}), /* Styles applied to the root element if `maxWidth="xs"`. */ maxWidthXs: { [theme.breakpoints.up('xs')]: { maxWidth: Math.max(theme.breakpoints.values.xs, 444) } }, /* Styles applied to the root element if `maxWidth="sm"`. */ maxWidthSm: { [theme.breakpoints.up('sm')]: { maxWidth: theme.breakpoints.values.sm } }, /* Styles applied to the root element if `maxWidth="md"`. */ maxWidthMd: { [theme.breakpoints.up('md')]: { maxWidth: theme.breakpoints.values.md } }, /* Styles applied to the root element if `maxWidth="lg"`. */ maxWidthLg: { [theme.breakpoints.up('lg')]: { maxWidth: theme.breakpoints.values.lg } }, /* Styles applied to the root element if `maxWidth="xl"`. */ maxWidthXl: { [theme.breakpoints.up('xl')]: { maxWidth: theme.breakpoints.values.xl } } }); const Container = React.forwardRef(function Container(props, ref) { const { classes, className, component: Component = 'div', disableGutters = false, fixed = false, maxWidth = 'lg' } = props, other = _objectWithoutPropertiesLoose(props, ["classes", "className", "component", "disableGutters", "fixed", "maxWidth"]); return React.createElement(Component, _extends({ className: clsx(classes.root, className, fixed && classes.fixed, disableGutters && classes.disableGutters, maxWidth !== false && classes[`maxWidth${capitalize(String(maxWidth))}`]), ref: ref }, other)); }); process.env.NODE_ENV !== "production" ? Container.propTypes = { children: PropTypes.node.isRequired, /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * @ignore */ className: PropTypes.string, /** * The component used for the root node. * Either a string to use a DOM element or a component. */ component: PropTypes.elementType, /** * If `true`, the left and right padding is removed. */ disableGutters: PropTypes.bool, /** * Set the max-width to match the min-width of the current breakpoint. * This is useful if you'd prefer to design for a fixed set of sizes * instead of trying to accommodate a fully fluid viewport. * It's fluid by default. */ fixed: PropTypes.bool, /** * Determine the max-width of the container. * The container width grows with the size of the screen. * Set to `false` to disable `maxWidth`. */ maxWidth: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl', false]) } : void 0; export default withStyles(styles, { name: 'MuiContainer' })(Container);
ajax/libs/react-instantsearch/6.2.0/Dom.js
cdnjs/cdnjs
/*! React InstantSearch 6.2.0 | © Algolia, inc. | https://github.com/algolia/react-instantsearch */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) : typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) : (global = global || self, factory((global.ReactInstantSearch = global.ReactInstantSearch || {}, global.ReactInstantSearch.Dom = {}), global.React)); }(this, function (exports, React) { 'use strict'; var React__default = 'default' in React ? React['default'] : React; function _extends() { _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; }; return _extends.apply(this, arguments); } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = 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; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } 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); return Constructor; } function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); } function _typeof(obj) { if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") { _typeof = function _typeof(obj) { return _typeof2(obj); }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj); }; } return _typeof(obj); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); } var isArray = Array.isArray; var keyList = Object.keys; var hasProp = Object.prototype.hasOwnProperty; var fastDeepEqual = function equal(a, b) { if (a === b) return true; if (a && b && typeof a == 'object' && typeof b == 'object') { var arrA = isArray(a) , arrB = isArray(b) , i , length , key; if (arrA && arrB) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false; return true; } if (arrA != arrB) return false; var dateA = a instanceof Date , dateB = b instanceof Date; if (dateA != dateB) return false; if (dateA && dateB) return a.getTime() == b.getTime(); var regexpA = a instanceof RegExp , regexpB = b instanceof RegExp; if (regexpA != regexpB) return false; if (regexpA && regexpB) return a.toString() == b.toString(); var keys = keyList(a); length = keys.length; if (length !== keyList(b).length) return false; for (i = length; i-- !== 0;) if (!hasProp.call(b, keys[i])) return false; for (i = length; i-- !== 0;) { key = keys[i]; if (!equal(a[key], b[key])) return false; } return true; } return a!==a && b!==b; }; var shallowEqual = function shallowEqual(objA, objB) { if (objA === objB) { return true; } var keysA = Object.keys(objA); var keysB = Object.keys(objB); if (keysA.length !== keysB.length) { return false; } // Test for A's keys different from B. var hasOwn = Object.prototype.hasOwnProperty; for (var i = 0; i < keysA.length; i++) { if (!hasOwn.call(objB, keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) { return false; } } return true; }; var getDisplayName = function getDisplayName(Component) { return Component.displayName || Component.name || 'UnknownComponent'; }; var resolved = Promise.resolve(); var defer = function defer(f) { resolved.then(f); }; var isPlainObject = function isPlainObject(value) { return _typeof(value) === 'object' && value !== null && !Array.isArray(value); }; var removeEmptyKey = function removeEmptyKey(obj) { Object.keys(obj).forEach(function (key) { var value = obj[key]; if (!isPlainObject(value)) { return; } if (!objectHasKeys(value)) { delete obj[key]; } else { removeEmptyKey(value); } }); return obj; }; var removeEmptyArraysFromObject = function removeEmptyArraysFromObject(obj) { Object.keys(obj).forEach(function (key) { var value = obj[key]; if (Array.isArray(value) && value.length === 0) { delete obj[key]; } }); return obj; }; function addAbsolutePositions(hits, hitsPerPage, page) { return hits.map(function (hit, index) { return _objectSpread({}, hit, { __position: hitsPerPage * page + index + 1 }); }); } function addQueryID(hits, queryID) { if (!queryID) { return hits; } return hits.map(function (hit) { return _objectSpread({}, hit, { __queryID: queryID }); }); } function find(array, comparator) { if (!Array.isArray(array)) { return undefined; } for (var i = 0; i < array.length; i++) { if (comparator(array[i])) { return array[i]; } } return undefined; } function objectHasKeys(object) { return object && Object.keys(object).length > 0; } // https://github.com/babel/babel/blob/3aaafae053fa75febb3aa45d45b6f00646e30ba4/packages/babel-helpers/src/helpers.js#L604-L620 function omit(source, excluded) { if (source === null || source === undefined) { return {}; } var target = {}; var sourceKeys = Object.keys(source); for (var i = 0; i < sourceKeys.length; i++) { var _key = sourceKeys[i]; if (excluded.indexOf(_key) >= 0) { // eslint-disable-next-line no-continue continue; } target[_key] = source[_key]; } return target; } /** * Retrieve the value at a path of the object: * * @example * getPropertyByPath( * { test: { this: { function: [{ now: { everyone: true } }] } } }, * 'test.this.function[0].now.everyone' * ); // true * * getPropertyByPath( * { test: { this: { function: [{ now: { everyone: true } }] } } }, * ['test', 'this', 'function', 0, 'now', 'everyone'] * ); // true * * @param object Source object to query * @param path either an array of properties, or a string form of the properties, separated by . */ var getPropertyByPath = function getPropertyByPath(object, path) { return (Array.isArray(path) ? path : path.replace(/\[(\d+)]/g, '.$1').split('.')).reduce(function (current, key) { return current ? current[key] : undefined; }, object); }; var _createContext = React.createContext({ onInternalStateUpdate: function onInternalStateUpdate() { return undefined; }, createHrefForState: function createHrefForState() { return '#'; }, onSearchForFacetValues: function onSearchForFacetValues() { return undefined; }, onSearchStateChange: function onSearchStateChange() { return undefined; }, onSearchParameters: function onSearchParameters() { return undefined; }, store: {}, widgetsManager: {}, mainTargetedIndex: '' }), InstantSearchConsumer = _createContext.Consumer, InstantSearchProvider = _createContext.Provider; var _createContext2 = React.createContext(undefined), IndexConsumer = _createContext2.Consumer, IndexProvider = _createContext2.Provider; /** * Connectors are the HOC used to transform React components * into InstantSearch widgets. * In order to simplify the construction of such connectors * `createConnector` takes a description and transform it into * a connector. * @param {ConnectorDescription} connectorDesc the description of the connector * @return {Connector} a function that wraps a component into * an instantsearch connected one. */ function createConnectorWithoutContext(connectorDesc) { if (!connectorDesc.displayName) { throw new Error('`createConnector` requires you to provide a `displayName` property.'); } var isWidget = typeof connectorDesc.getSearchParameters === 'function' || typeof connectorDesc.getMetadata === 'function' || typeof connectorDesc.transitionState === 'function'; return function (Composed) { var Connector = /*#__PURE__*/ function (_Component) { _inherits(Connector, _Component); function Connector(props) { var _this; _classCallCheck(this, Connector); _this = _possibleConstructorReturn(this, _getPrototypeOf(Connector).call(this, props)); _defineProperty(_assertThisInitialized(_this), "unsubscribe", void 0); _defineProperty(_assertThisInitialized(_this), "unregisterWidget", void 0); _defineProperty(_assertThisInitialized(_this), "isUnmounting", false); _defineProperty(_assertThisInitialized(_this), "state", { providedProps: _this.getProvidedProps(_this.props) }); _defineProperty(_assertThisInitialized(_this), "refine", function () { var _ref; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this.props.contextValue.onInternalStateUpdate( // refine will always be defined here because the prop is only given conditionally (_ref = connectorDesc.refine).call.apply(_ref, [_assertThisInitialized(_this), _this.props, _this.props.contextValue.store.getState().widgets].concat(args))); }); _defineProperty(_assertThisInitialized(_this), "createURL", function () { var _ref2; for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return _this.props.contextValue.createHrefForState( // refine will always be defined here because the prop is only given conditionally (_ref2 = connectorDesc.refine).call.apply(_ref2, [_assertThisInitialized(_this), _this.props, _this.props.contextValue.store.getState().widgets].concat(args))); }); _defineProperty(_assertThisInitialized(_this), "searchForFacetValues", function () { var _ref3; for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { args[_key3] = arguments[_key3]; } _this.props.contextValue.onSearchForFacetValues( // searchForFacetValues will always be defined here because the prop is only given conditionally (_ref3 = connectorDesc.searchForFacetValues).call.apply(_ref3, [_assertThisInitialized(_this), _this.props, _this.props.contextValue.store.getState().widgets].concat(args))); }); if (connectorDesc.getSearchParameters) { _this.props.contextValue.onSearchParameters(connectorDesc.getSearchParameters.bind(_assertThisInitialized(_this)), { ais: _this.props.contextValue, multiIndexContext: _this.props.indexContextValue }, _this.props); } return _this; } _createClass(Connector, [{ key: "componentDidMount", value: function componentDidMount() { var _this2 = this; this.unsubscribe = this.props.contextValue.store.subscribe(function () { if (!_this2.isUnmounting) { _this2.setState({ providedProps: _this2.getProvidedProps(_this2.props) }); } }); if (isWidget) { this.unregisterWidget = this.props.contextValue.widgetsManager.registerWidget(this); } } }, { key: "shouldComponentUpdate", value: function shouldComponentUpdate(nextProps, nextState) { if (typeof connectorDesc.shouldComponentUpdate === 'function') { return connectorDesc.shouldComponentUpdate.call(this, this.props, nextProps, this.state, nextState); } var propsEqual = shallowEqual(this.props, nextProps); if (this.state.providedProps === null || nextState.providedProps === null) { if (this.state.providedProps === nextState.providedProps) { return !propsEqual; } return true; } return !propsEqual || !shallowEqual(this.state.providedProps, nextState.providedProps); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (!fastDeepEqual(prevProps, this.props)) { this.setState({ providedProps: this.getProvidedProps(this.props) }); if (isWidget) { this.props.contextValue.widgetsManager.update(); if (typeof connectorDesc.transitionState === 'function') { this.props.contextValue.onSearchStateChange(connectorDesc.transitionState.call(this, this.props, this.props.contextValue.store.getState().widgets, this.props.contextValue.store.getState().widgets)); } } } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.isUnmounting = true; if (this.unsubscribe) { this.unsubscribe(); } if (this.unregisterWidget) { this.unregisterWidget(); if (typeof connectorDesc.cleanUp === 'function') { var nextState = connectorDesc.cleanUp.call(this, this.props, this.props.contextValue.store.getState().widgets); this.props.contextValue.store.setState(_objectSpread({}, this.props.contextValue.store.getState(), { widgets: nextState })); this.props.contextValue.onSearchStateChange(removeEmptyKey(nextState)); } } } }, { key: "getProvidedProps", value: function getProvidedProps(props) { var _this$props$contextVa = this.props.contextValue.store.getState(), widgets = _this$props$contextVa.widgets, results = _this$props$contextVa.results, resultsFacetValues = _this$props$contextVa.resultsFacetValues, searching = _this$props$contextVa.searching, searchingForFacetValues = _this$props$contextVa.searchingForFacetValues, isSearchStalled = _this$props$contextVa.isSearchStalled, metadata = _this$props$contextVa.metadata, error = _this$props$contextVa.error; var searchResults = { results: results, searching: searching, searchingForFacetValues: searchingForFacetValues, isSearchStalled: isSearchStalled, error: error }; return connectorDesc.getProvidedProps.call(this, props, widgets, searchResults, metadata, // @MAJOR: move this attribute on the `searchResults` it doesn't // makes sense to have it into a separate argument. The search // flags are on the object why not the results? resultsFacetValues); } }, { key: "getSearchParameters", value: function getSearchParameters(searchParameters) { if (typeof connectorDesc.getSearchParameters === 'function') { return connectorDesc.getSearchParameters.call(this, searchParameters, this.props, this.props.contextValue.store.getState().widgets); } return null; } }, { key: "getMetadata", value: function getMetadata(nextWidgetsState) { if (typeof connectorDesc.getMetadata === 'function') { return connectorDesc.getMetadata.call(this, this.props, nextWidgetsState); } return {}; } }, { key: "transitionState", value: function transitionState(prevWidgetsState, nextWidgetsState) { if (typeof connectorDesc.transitionState === 'function') { return connectorDesc.transitionState.call(this, this.props, prevWidgetsState, nextWidgetsState); } return nextWidgetsState; } }, { key: "render", value: function render() { var _this$props = this.props, contextValue = _this$props.contextValue, props = _objectWithoutProperties(_this$props, ["contextValue"]); var providedProps = this.state.providedProps; if (providedProps === null) { return null; } var refineProps = typeof connectorDesc.refine === 'function' ? { refine: this.refine, createURL: this.createURL } : {}; var searchForFacetValuesProps = typeof connectorDesc.searchForFacetValues === 'function' ? { searchForItems: this.searchForFacetValues } : {}; return React__default.createElement(Composed, _extends({}, props, providedProps, refineProps, searchForFacetValuesProps)); } }]); return Connector; }(React.Component); _defineProperty(Connector, "displayName", "".concat(connectorDesc.displayName, "(").concat(getDisplayName(Composed), ")")); _defineProperty(Connector, "propTypes", connectorDesc.propTypes); _defineProperty(Connector, "defaultProps", connectorDesc.defaultProps); return Connector; }; } var createConnectorWithContext = function createConnectorWithContext(connectorDesc) { return function (Composed) { var Connector = createConnectorWithoutContext(connectorDesc)(Composed); var ConnectorWrapper = function ConnectorWrapper(props) { return React__default.createElement(InstantSearchConsumer, null, function (contextValue) { return React__default.createElement(IndexConsumer, null, function (indexContextValue) { return React__default.createElement(Connector, _extends({ contextValue: contextValue, indexContextValue: indexContextValue }, props)); }); }); }; return ConnectorWrapper; }; }; var HIGHLIGHT_TAGS = { highlightPreTag: "<ais-highlight-0000000000>", highlightPostTag: "</ais-highlight-0000000000>" }; /** * Parses an highlighted attribute into an array of objects with the string value, and * a boolean that indicated if this part is highlighted. * * @param {string} preTag - string used to identify the start of an highlighted value * @param {string} postTag - string used to identify the end of an highlighted value * @param {string} highlightedValue - highlighted attribute as returned by Algolia highlight feature * @return {object[]} - An array of {value: string, isHighlighted: boolean}. */ function parseHighlightedAttribute(_ref) { var preTag = _ref.preTag, postTag = _ref.postTag, _ref$highlightedValue = _ref.highlightedValue, highlightedValue = _ref$highlightedValue === void 0 ? '' : _ref$highlightedValue; var splitByPreTag = highlightedValue.split(preTag); var firstValue = splitByPreTag.shift(); var elements = firstValue === '' ? [] : [{ value: firstValue, isHighlighted: false }]; if (postTag === preTag) { var isHighlighted = true; splitByPreTag.forEach(function (split) { elements.push({ value: split, isHighlighted: isHighlighted }); isHighlighted = !isHighlighted; }); } else { splitByPreTag.forEach(function (split) { var splitByPostTag = split.split(postTag); elements.push({ value: splitByPostTag[0], isHighlighted: true }); if (splitByPostTag[1] !== '') { elements.push({ value: splitByPostTag[1], isHighlighted: false }); } }); } return elements; } /** * Find an highlighted attribute given an `attribute` and an `highlightProperty`, parses it, * and provided an array of objects with the string value and a boolean if this * value is highlighted. * * In order to use this feature, highlight must be activated in the configuration of * the index. The `preTag` and `postTag` attributes are respectively highlightPreTag and * highlightPostTag in Algolia configuration. * * @param {string} preTag - string used to identify the start of an highlighted value * @param {string} postTag - string used to identify the end of an highlighted value * @param {string} highlightProperty - the property that contains the highlight structure in the results * @param {string} attribute - the highlighted attribute to look for * @param {object} hit - the actual hit returned by Algolia. * @return {object[]} - An array of {value: string, isHighlighted: boolean}. */ function parseAlgoliaHit(_ref2) { var _ref2$preTag = _ref2.preTag, preTag = _ref2$preTag === void 0 ? '<em>' : _ref2$preTag, _ref2$postTag = _ref2.postTag, postTag = _ref2$postTag === void 0 ? '</em>' : _ref2$postTag, highlightProperty = _ref2.highlightProperty, attribute = _ref2.attribute, hit = _ref2.hit; if (!hit) throw new Error('`hit`, the matching record, must be provided'); var highlightObject = getPropertyByPath(hit[highlightProperty], attribute) || {}; if (Array.isArray(highlightObject)) { return highlightObject.map(function (item) { return parseHighlightedAttribute({ preTag: preTag, postTag: postTag, highlightedValue: item.value }); }); } return parseHighlightedAttribute({ preTag: preTag, postTag: postTag, highlightedValue: highlightObject.value }); } var version = '6.2.0'; function translatable(defaultTranslations) { return function (Composed) { var Translatable = /*#__PURE__*/ function (_Component) { _inherits(Translatable, _Component); function Translatable() { var _getPrototypeOf2; var _this; _classCallCheck(this, Translatable); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Translatable)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_this), "translate", function (key) { var translations = _this.props.translations; var translation = translations && translations.hasOwnProperty(key) ? translations[key] : defaultTranslations[key]; if (typeof translation === 'function') { for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { params[_key2 - 1] = arguments[_key2]; } return translation.apply(void 0, params); } return translation; }); return _this; } _createClass(Translatable, [{ key: "render", value: function render() { return React__default.createElement(Composed, _extends({ translate: this.translate }, this.props)); } }]); return Translatable; }(React.Component); var name = Composed.displayName || Composed.name || 'UnknownComponent'; Translatable.displayName = "Translatable(".concat(name, ")"); return Translatable; }; } function getIndexId(context) { return hasMultipleIndices(context) ? context.multiIndexContext.targetedIndex : context.ais.mainTargetedIndex; } function getResults(searchResults, context) { if (searchResults.results) { if (searchResults.results.hits) { return searchResults.results; } var indexId = getIndexId(context); if (searchResults.results[indexId]) { return searchResults.results[indexId]; } } return null; } function hasMultipleIndices(context) { return context && context.multiIndexContext; } // eslint-disable-next-line max-params function refineValue(searchState, nextRefinement, context, resetPage, namespace) { if (hasMultipleIndices(context)) { var indexId = getIndexId(context); return namespace ? refineMultiIndexWithNamespace(searchState, nextRefinement, indexId, resetPage, namespace) : refineMultiIndex(searchState, nextRefinement, indexId, resetPage); } else { // When we have a multi index page with shared widgets we should also // reset their page to 1 if the resetPage is provided. Otherwise the // indices will always be reset // see: https://github.com/algolia/react-instantsearch/issues/310 // see: https://github.com/algolia/react-instantsearch/issues/637 if (searchState.indices && resetPage) { Object.keys(searchState.indices).forEach(function (targetedIndex) { searchState = refineValue(searchState, { page: 1 }, { multiIndexContext: { targetedIndex: targetedIndex } }, true, namespace); }); } return namespace ? refineSingleIndexWithNamespace(searchState, nextRefinement, resetPage, namespace) : refineSingleIndex(searchState, nextRefinement, resetPage); } } function refineMultiIndex(searchState, nextRefinement, indexId, resetPage) { var page = resetPage ? { page: 1 } : undefined; var state = searchState.indices && searchState.indices[indexId] ? _objectSpread({}, searchState.indices, _defineProperty({}, indexId, _objectSpread({}, searchState.indices[indexId], nextRefinement, page))) : _objectSpread({}, searchState.indices, _defineProperty({}, indexId, _objectSpread({}, nextRefinement, page))); return _objectSpread({}, searchState, { indices: state }); } function refineSingleIndex(searchState, nextRefinement, resetPage) { var page = resetPage ? { page: 1 } : undefined; return _objectSpread({}, searchState, nextRefinement, page); } // eslint-disable-next-line max-params function refineMultiIndexWithNamespace(searchState, nextRefinement, indexId, resetPage, namespace) { var _objectSpread4; var page = resetPage ? { page: 1 } : undefined; var state = searchState.indices && searchState.indices[indexId] ? _objectSpread({}, searchState.indices, _defineProperty({}, indexId, _objectSpread({}, searchState.indices[indexId], (_objectSpread4 = {}, _defineProperty(_objectSpread4, namespace, _objectSpread({}, searchState.indices[indexId][namespace], nextRefinement)), _defineProperty(_objectSpread4, "page", 1), _objectSpread4)))) : _objectSpread({}, searchState.indices, _defineProperty({}, indexId, _objectSpread(_defineProperty({}, namespace, nextRefinement), page))); return _objectSpread({}, searchState, { indices: state }); } function refineSingleIndexWithNamespace(searchState, nextRefinement, resetPage, namespace) { var page = resetPage ? { page: 1 } : undefined; return _objectSpread({}, searchState, _defineProperty({}, namespace, _objectSpread({}, searchState[namespace], nextRefinement)), page); } function getNamespaceAndAttributeName(id) { var parts = id.match(/^([^.]*)\.(.*)/); var namespace = parts && parts[1]; var attributeName = parts && parts[2]; return { namespace: namespace, attributeName: attributeName }; } function hasRefinements(_ref) { var multiIndex = _ref.multiIndex, indexId = _ref.indexId, namespace = _ref.namespace, attributeName = _ref.attributeName, id = _ref.id, searchState = _ref.searchState; if (multiIndex && namespace) { return searchState.indices && searchState.indices[indexId] && searchState.indices[indexId][namespace] && Object.hasOwnProperty.call(searchState.indices[indexId][namespace], attributeName); } if (multiIndex) { return searchState.indices && searchState.indices[indexId] && Object.hasOwnProperty.call(searchState.indices[indexId], id); } if (namespace) { return searchState[namespace] && Object.hasOwnProperty.call(searchState[namespace], attributeName); } return Object.hasOwnProperty.call(searchState, id); } function getRefinements(_ref2) { var multiIndex = _ref2.multiIndex, indexId = _ref2.indexId, namespace = _ref2.namespace, attributeName = _ref2.attributeName, id = _ref2.id, searchState = _ref2.searchState; if (multiIndex && namespace) { return searchState.indices[indexId][namespace][attributeName]; } if (multiIndex) { return searchState.indices[indexId][id]; } if (namespace) { return searchState[namespace][attributeName]; } return searchState[id]; } function getCurrentRefinementValue(props, searchState, context, id, defaultValue) { var indexId = getIndexId(context); var _getNamespaceAndAttri = getNamespaceAndAttributeName(id), namespace = _getNamespaceAndAttri.namespace, attributeName = _getNamespaceAndAttri.attributeName; var multiIndex = hasMultipleIndices(context); var args = { multiIndex: multiIndex, indexId: indexId, namespace: namespace, attributeName: attributeName, id: id, searchState: searchState }; var hasRefinementsValue = hasRefinements(args); if (hasRefinementsValue) { return getRefinements(args); } if (props.defaultRefinement) { return props.defaultRefinement; } return defaultValue; } function cleanUpValue(searchState, context, id) { var indexId = getIndexId(context); var _getNamespaceAndAttri2 = getNamespaceAndAttributeName(id), namespace = _getNamespaceAndAttri2.namespace, attributeName = _getNamespaceAndAttri2.attributeName; if (hasMultipleIndices(context) && Boolean(searchState.indices)) { return cleanUpValueWithMultiIndex({ attribute: attributeName, searchState: searchState, indexId: indexId, id: id, namespace: namespace }); } return cleanUpValueWithSingleIndex({ attribute: attributeName, searchState: searchState, id: id, namespace: namespace }); } function cleanUpValueWithSingleIndex(_ref3) { var searchState = _ref3.searchState, id = _ref3.id, namespace = _ref3.namespace, attribute = _ref3.attribute; if (namespace) { return _objectSpread({}, searchState, _defineProperty({}, namespace, omit(searchState[namespace], [attribute]))); } return omit(searchState, [id]); } function cleanUpValueWithMultiIndex(_ref4) { var searchState = _ref4.searchState, indexId = _ref4.indexId, id = _ref4.id, namespace = _ref4.namespace, attribute = _ref4.attribute; var indexSearchState = searchState.indices[indexId]; if (namespace && indexSearchState) { return _objectSpread({}, searchState, { indices: _objectSpread({}, searchState.indices, _defineProperty({}, indexId, _objectSpread({}, indexSearchState, _defineProperty({}, namespace, omit(indexSearchState[namespace], [attribute]))))) }); } if (indexSearchState) { return _objectSpread({}, searchState, { indices: _objectSpread({}, searchState.indices, _defineProperty({}, indexId, omit(indexSearchState, [id]))) }); } return searchState; } function getId() { return 'configure'; } var connectConfigure = createConnectorWithContext({ displayName: 'AlgoliaConfigure', getProvidedProps: function getProvidedProps() { return {}; }, getSearchParameters: function getSearchParameters(searchParameters, props) { var children = props.children, contextValue = props.contextValue, indexContextValue = props.indexContextValue, items = _objectWithoutProperties(props, ["children", "contextValue", "indexContextValue"]); return searchParameters.setQueryParameters(items); }, transitionState: function transitionState(props, prevSearchState, nextSearchState) { var id = getId(); var children = props.children, contextValue = props.contextValue, indexContextValue = props.indexContextValue, items = _objectWithoutProperties(props, ["children", "contextValue", "indexContextValue"]); var propKeys = Object.keys(props); var nonPresentKeys = this._props ? Object.keys(this._props).filter(function (prop) { return propKeys.indexOf(prop) === -1; }) : []; this._props = props; var nextValue = _defineProperty({}, id, _objectSpread({}, omit(nextSearchState[id], nonPresentKeys), items)); return refineValue(nextSearchState, nextValue, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, cleanUp: function cleanUp(props, searchState) { var id = getId(); var indexId = getIndexId({ ais: props.contextValue, multiIndexContext: props.indexContextValue }); var subState = hasMultipleIndices({ ais: props.contextValue, multiIndexContext: props.indexContextValue }) && searchState.indices ? searchState.indices[indexId] : searchState; var configureKeys = subState && subState[id] ? Object.keys(subState[id]) : []; var configureState = configureKeys.reduce(function (acc, item) { if (!props[item]) { acc[item] = subState[id][item]; } return acc; }, {}); var nextValue = _defineProperty({}, id, configureState); return refineValue(searchState, nextValue, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); } }); /** * Configure is a widget that lets you provide raw search parameters * to the Algolia API. * * Any of the props added to this widget will be forwarded to Algolia. For more information * on the different parameters that can be set, have a look at the * [reference](https://www.algolia.com/doc/api-client/javascript/search#search-parameters). * * This widget can be used either with react-dom and react-native. It will not render anything * on screen, only configure some parameters. * * Read more in the [Search parameters](guide/Search_parameters.html) guide. * @name Configure * @kind widget * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, Configure, Hits } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <Configure hitsPerPage={5} /> * <Hits /> * </InstantSearch> * ); */ var Configure = connectConfigure(function Configure() { return null; }); var global$1 = (typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}); if (typeof global$1.setTimeout === 'function') ; if (typeof global$1.clearTimeout === 'function') ; // from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js var performance = global$1.performance || {}; var performanceNow = performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow || function(){ return (new Date()).getTime() }; function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } function clone(value) { if (typeof value === 'object' && value !== null) { return _merge(Array.isArray(value) ? [] : {}, value); } return value; } function isObjectOrArrayOrFunction(value) { return ( typeof value === 'function' || Array.isArray(value) || Object.prototype.toString.call(value) === '[object Object]' ); } function _merge(target, source) { if (target === source) { return target; } for (var key in source) { if (!Object.prototype.hasOwnProperty.call(source, key)) { continue; } var sourceVal = source[key]; var targetVal = target[key]; if (typeof targetVal !== 'undefined' && typeof sourceVal === 'undefined') { continue; } if (isObjectOrArrayOrFunction(targetVal) && isObjectOrArrayOrFunction(sourceVal)) { target[key] = _merge(targetVal, sourceVal); } else { target[key] = clone(sourceVal); } } return target; } /** * This method is like Object.assign, but recursively merges own and inherited * enumerable keyed properties of source objects into the destination object. * * NOTE: this behaves like lodash/merge, but: * - does mutate functions if they are a source * - treats non-plain objects as plain * - does not work for circular objects * - treats sparse arrays as sparse * - does not convert Array-like objects (Arguments, NodeLists, etc.) to arrays * * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. */ function merge(target) { if (!isObjectOrArrayOrFunction(target)) { target = {}; } for (var i = 1, l = arguments.length; i < l; i++) { var source = arguments[i]; if (isObjectOrArrayOrFunction(source)) { _merge(target, source); } } return target; } var merge_1 = merge; // NOTE: this behaves like lodash/defaults, but doesn't mutate the target var defaultsPure = function defaultsPure() { var sources = Array.prototype.slice.call(arguments); return sources.reduceRight(function(acc, source) { Object.keys(Object(source)).forEach(function(key) { if (source[key] !== undefined) { acc[key] = source[key]; } }); return acc; }, {}); }; function intersection(arr1, arr2) { return arr1.filter(function(value, index) { return ( arr2.indexOf(value) > -1 && arr1.indexOf(value) === index /* skips duplicates */ ); }); } var intersection_1 = intersection; // @MAJOR can be replaced by native Array#find when we change support var find$1 = function find(array, comparator) { if (!Array.isArray(array)) { return undefined; } for (var i = 0; i < array.length; i++) { if (comparator(array[i])) { return array[i]; } } }; function valToNumber(v) { if (typeof v === 'number') { return v; } else if (typeof v === 'string') { return parseFloat(v); } else if (Array.isArray(v)) { return v.map(valToNumber); } throw new Error('The value should be a number, a parsable string or an array of those.'); } var valToNumber_1 = valToNumber; // https://github.com/babel/babel/blob/3aaafae053fa75febb3aa45d45b6f00646e30ba4/packages/babel-helpers/src/helpers.js#L604-L620 function _objectWithoutPropertiesLoose$1(source, excluded) { if (source === null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key; var i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var omit$1 = _objectWithoutPropertiesLoose$1; function objectHasKeys$1(obj) { return obj && Object.keys(obj).length > 0; } var objectHasKeys_1 = objectHasKeys$1; /** * Functions to manipulate refinement lists * * The RefinementList is not formally defined through a prototype but is based * on a specific structure. * * @module SearchParameters.refinementList * * @typedef {string[]} SearchParameters.refinementList.Refinements * @typedef {Object.<string, SearchParameters.refinementList.Refinements>} SearchParameters.refinementList.RefinementList */ var lib = { /** * Adds a refinement to a RefinementList * @param {RefinementList} refinementList the initial list * @param {string} attribute the attribute to refine * @param {string} value the value of the refinement, if the value is not a string it will be converted * @return {RefinementList} a new and updated refinement list */ addRefinement: function addRefinement(refinementList, attribute, value) { if (lib.isRefined(refinementList, attribute, value)) { return refinementList; } var valueAsString = '' + value; var facetRefinement = !refinementList[attribute] ? [valueAsString] : refinementList[attribute].concat(valueAsString); var mod = {}; mod[attribute] = facetRefinement; return defaultsPure({}, mod, refinementList); }, /** * Removes refinement(s) for an attribute: * - if the value is specified removes the refinement for the value on the attribute * - if no value is specified removes all the refinements for this attribute * @param {RefinementList} refinementList the initial list * @param {string} attribute the attribute to refine * @param {string} [value] the value of the refinement * @return {RefinementList} a new and updated refinement lst */ removeRefinement: function removeRefinement(refinementList, attribute, value) { if (value === undefined) { // we use the "filter" form of clearRefinement, since it leaves empty values as-is // the form with a string will remove the attribute completely return lib.clearRefinement(refinementList, function(v, f) { return attribute === f; }); } var valueAsString = '' + value; return lib.clearRefinement(refinementList, function(v, f) { return attribute === f && valueAsString === v; }); }, /** * Toggles the refinement value for an attribute. * @param {RefinementList} refinementList the initial list * @param {string} attribute the attribute to refine * @param {string} value the value of the refinement * @return {RefinementList} a new and updated list */ toggleRefinement: function toggleRefinement(refinementList, attribute, value) { if (value === undefined) throw new Error('toggleRefinement should be used with a value'); if (lib.isRefined(refinementList, attribute, value)) { return lib.removeRefinement(refinementList, attribute, value); } return lib.addRefinement(refinementList, attribute, value); }, /** * Clear all or parts of a RefinementList. Depending on the arguments, three * kinds of behavior can happen: * - if no attribute is provided: clears the whole list * - if an attribute is provided as a string: clears the list for the specific attribute * - if an attribute is provided as a function: discards the elements for which the function returns true * @param {RefinementList} refinementList the initial list * @param {string} [attribute] the attribute or function to discard * @param {string} [refinementType] optional parameter to give more context to the attribute function * @return {RefinementList} a new and updated refinement list */ clearRefinement: function clearRefinement(refinementList, attribute, refinementType) { if (attribute === undefined) { if (!objectHasKeys_1(refinementList)) { return refinementList; } return {}; } else if (typeof attribute === 'string') { return omit$1(refinementList, attribute); } else if (typeof attribute === 'function') { var hasChanged = false; var newRefinementList = Object.keys(refinementList).reduce(function(memo, key) { var values = refinementList[key] || []; var facetList = values.filter(function(value) { return !attribute(value, key, refinementType); }); if (facetList.length !== values.length) { hasChanged = true; } memo[key] = facetList; return memo; }, {}); if (hasChanged) return newRefinementList; return refinementList; } }, /** * Test if the refinement value is used for the attribute. If no refinement value * is provided, test if the refinementList contains any refinement for the * given attribute. * @param {RefinementList} refinementList the list of refinement * @param {string} attribute name of the attribute * @param {string} [refinementValue] value of the filter/refinement * @return {boolean} */ isRefined: function isRefined(refinementList, attribute, refinementValue) { var containsRefinements = !!refinementList[attribute] && refinementList[attribute].length > 0; if (refinementValue === undefined || !containsRefinements) { return containsRefinements; } var refinementValueAsString = '' + refinementValue; return refinementList[attribute].indexOf(refinementValueAsString) !== -1; } }; var RefinementList = lib; /** * isEqual, but only for numeric refinement values, possible values: * - 5 * - [5] * - [[5]] * - [[5,5],[4]] */ function isEqualNumericRefinement(a, b) { if (Array.isArray(a) && Array.isArray(b)) { return ( a.length === b.length && a.every(function(el, i) { return isEqualNumericRefinement(b[i], el); }) ); } return a === b; } /** * like _.find but using deep equality to be able to use it * to find arrays. * @private * @param {any[]} array array to search into (elements are base or array of base) * @param {any} searchedValue the value we're looking for (base or array of base) * @return {any} the searched value or undefined */ function findArray(array, searchedValue) { return find$1(array, function(currentValue) { return isEqualNumericRefinement(currentValue, searchedValue); }); } /** * The facet list is the structure used to store the list of values used to * filter a single attribute. * @typedef {string[]} SearchParameters.FacetList */ /** * Structure to store numeric filters with the operator as the key. The supported operators * are `=`, `>`, `<`, `>=`, `<=` and `!=`. * @typedef {Object.<string, Array.<number|number[]>>} SearchParameters.OperatorList */ /** * SearchParameters is the data structure that contains all the information * usable for making a search to Algolia API. It doesn't do the search itself, * nor does it contains logic about the parameters. * It is an immutable object, therefore it has been created in a way that each * changes does not change the object itself but returns a copy with the * modification. * This object should probably not be instantiated outside of the helper. It will * be provided when needed. This object is documented for reference as you'll * get it from events generated by the {@link AlgoliaSearchHelper}. * If need be, instantiate the Helper from the factory function {@link SearchParameters.make} * @constructor * @classdesc contains all the parameters of a search * @param {object|SearchParameters} newParameters existing parameters or partial object * for the properties of a new SearchParameters * @see SearchParameters.make * @example <caption>SearchParameters of the first query in * <a href="http://demos.algolia.com/instant-search-demo/">the instant search demo</a></caption> { "query": "", "disjunctiveFacets": [ "customerReviewCount", "category", "salePrice_range", "manufacturer" ], "maxValuesPerFacet": 30, "page": 0, "hitsPerPage": 10, "facets": [ "type", "shipping" ] } */ function SearchParameters(newParameters) { var params = newParameters ? SearchParameters._parseNumbers(newParameters) : {}; /** * This attribute contains the list of all the conjunctive facets * used. This list will be added to requested facets in the * [facets attribute](https://www.algolia.com/doc/rest-api/search#param-facets) sent to algolia. * @member {string[]} */ this.facets = params.facets || []; /** * This attribute contains the list of all the disjunctive facets * used. This list will be added to requested facets in the * [facets attribute](https://www.algolia.com/doc/rest-api/search#param-facets) sent to algolia. * @member {string[]} */ this.disjunctiveFacets = params.disjunctiveFacets || []; /** * This attribute contains the list of all the hierarchical facets * used. This list will be added to requested facets in the * [facets attribute](https://www.algolia.com/doc/rest-api/search#param-facets) sent to algolia. * Hierarchical facets are a sub type of disjunctive facets that * let you filter faceted attributes hierarchically. * @member {string[]|object[]} */ this.hierarchicalFacets = params.hierarchicalFacets || []; // Refinements /** * This attribute contains all the filters that need to be * applied on the conjunctive facets. Each facet must be properly * defined in the `facets` attribute. * * The key is the name of the facet, and the `FacetList` contains all * filters selected for the associated facet name. * * When querying algolia, the values stored in this attribute will * be translated into the `facetFilters` attribute. * @member {Object.<string, SearchParameters.FacetList>} */ this.facetsRefinements = params.facetsRefinements || {}; /** * This attribute contains all the filters that need to be * excluded from the conjunctive facets. Each facet must be properly * defined in the `facets` attribute. * * The key is the name of the facet, and the `FacetList` contains all * filters excluded for the associated facet name. * * When querying algolia, the values stored in this attribute will * be translated into the `facetFilters` attribute. * @member {Object.<string, SearchParameters.FacetList>} */ this.facetsExcludes = params.facetsExcludes || {}; /** * This attribute contains all the filters that need to be * applied on the disjunctive facets. Each facet must be properly * defined in the `disjunctiveFacets` attribute. * * The key is the name of the facet, and the `FacetList` contains all * filters selected for the associated facet name. * * When querying algolia, the values stored in this attribute will * be translated into the `facetFilters` attribute. * @member {Object.<string, SearchParameters.FacetList>} */ this.disjunctiveFacetsRefinements = params.disjunctiveFacetsRefinements || {}; /** * This attribute contains all the filters that need to be * applied on the numeric attributes. * * The key is the name of the attribute, and the value is the * filters to apply to this attribute. * * When querying algolia, the values stored in this attribute will * be translated into the `numericFilters` attribute. * @member {Object.<string, SearchParameters.OperatorList>} */ this.numericRefinements = params.numericRefinements || {}; /** * This attribute contains all the tags used to refine the query. * * When querying algolia, the values stored in this attribute will * be translated into the `tagFilters` attribute. * @member {string[]} */ this.tagRefinements = params.tagRefinements || []; /** * This attribute contains all the filters that need to be * applied on the hierarchical facets. Each facet must be properly * defined in the `hierarchicalFacets` attribute. * * The key is the name of the facet, and the `FacetList` contains all * filters selected for the associated facet name. The FacetList values * are structured as a string that contain the values for each level * separated by the configured separator. * * When querying algolia, the values stored in this attribute will * be translated into the `facetFilters` attribute. * @member {Object.<string, SearchParameters.FacetList>} */ this.hierarchicalFacetsRefinements = params.hierarchicalFacetsRefinements || {}; var self = this; Object.keys(params).forEach(function(paramName) { var isKeyKnown = SearchParameters.PARAMETERS.indexOf(paramName) !== -1; var isValueDefined = params[paramName] !== undefined; if (!isKeyKnown && isValueDefined) { self[paramName] = params[paramName]; } }); } /** * List all the properties in SearchParameters and therefore all the known Algolia properties * This doesn't contain any beta/hidden features. * @private */ SearchParameters.PARAMETERS = Object.keys(new SearchParameters()); /** * @private * @param {object} partialState full or part of a state * @return {object} a new object with the number keys as number */ SearchParameters._parseNumbers = function(partialState) { // Do not reparse numbers in SearchParameters, they ought to be parsed already if (partialState instanceof SearchParameters) return partialState; var numbers = {}; var numberKeys = [ 'aroundPrecision', 'aroundRadius', 'getRankingInfo', 'minWordSizefor2Typos', 'minWordSizefor1Typo', 'page', 'maxValuesPerFacet', 'distinct', 'minimumAroundRadius', 'hitsPerPage', 'minProximity' ]; numberKeys.forEach(function(k) { var value = partialState[k]; if (typeof value === 'string') { var parsedValue = parseFloat(value); // global isNaN is ok to use here, value is only number or NaN numbers[k] = isNaN(parsedValue) ? value : parsedValue; } }); // there's two formats of insideBoundingBox, we need to parse // the one which is an array of float geo rectangles if (Array.isArray(partialState.insideBoundingBox)) { numbers.insideBoundingBox = partialState.insideBoundingBox.map(function(geoRect) { return geoRect.map(function(value) { return parseFloat(value); }); }); } if (partialState.numericRefinements) { var numericRefinements = {}; Object.keys(partialState.numericRefinements).forEach(function(attribute) { var operators = partialState.numericRefinements[attribute] || {}; numericRefinements[attribute] = {}; Object.keys(operators).forEach(function(operator) { var values = operators[operator]; var parsedValues = values.map(function(v) { if (Array.isArray(v)) { return v.map(function(vPrime) { if (typeof vPrime === 'string') { return parseFloat(vPrime); } return vPrime; }); } else if (typeof v === 'string') { return parseFloat(v); } return v; }); numericRefinements[attribute][operator] = parsedValues; }); }); numbers.numericRefinements = numericRefinements; } return merge_1({}, partialState, numbers); }; /** * Factory for SearchParameters * @param {object|SearchParameters} newParameters existing parameters or partial * object for the properties of a new SearchParameters * @return {SearchParameters} frozen instance of SearchParameters */ SearchParameters.make = function makeSearchParameters(newParameters) { var instance = new SearchParameters(newParameters); var hierarchicalFacets = newParameters.hierarchicalFacets || []; hierarchicalFacets.forEach(function(facet) { if (facet.rootPath) { var currentRefinement = instance.getHierarchicalRefinement(facet.name); if (currentRefinement.length > 0 && currentRefinement[0].indexOf(facet.rootPath) !== 0) { instance = instance.clearRefinements(facet.name); } // get it again in case it has been cleared currentRefinement = instance.getHierarchicalRefinement(facet.name); if (currentRefinement.length === 0) { instance = instance.toggleHierarchicalFacetRefinement(facet.name, facet.rootPath); } } }); return instance; }; /** * Validates the new parameters based on the previous state * @param {SearchParameters} currentState the current state * @param {object|SearchParameters} parameters the new parameters to set * @return {Error|null} Error if the modification is invalid, null otherwise */ SearchParameters.validate = function(currentState, parameters) { var params = parameters || {}; if (currentState.tagFilters && params.tagRefinements && params.tagRefinements.length > 0) { return new Error( '[Tags] Cannot switch from the managed tag API to the advanced API. It is probably ' + 'an error, if it is really what you want, you should first clear the tags with clearTags method.'); } if (currentState.tagRefinements.length > 0 && params.tagFilters) { return new Error( '[Tags] Cannot switch from the advanced tag API to the managed API. It is probably ' + 'an error, if it is not, you should first clear the tags with clearTags method.'); } if ( currentState.numericFilters && params.numericRefinements && objectHasKeys_1(params.numericRefinements) ) { return new Error( "[Numeric filters] Can't switch from the advanced to the managed API. It" + ' is probably an error, if this is really what you want, you have to first' + ' clear the numeric filters.' ); } if (objectHasKeys_1(currentState.numericRefinements) && params.numericFilters) { return new Error( "[Numeric filters] Can't switch from the managed API to the advanced. It" + ' is probably an error, if this is really what you want, you have to first' + ' clear the numeric filters.'); } return null; }; SearchParameters.prototype = { constructor: SearchParameters, /** * Remove all refinements (disjunctive + conjunctive + excludes + numeric filters) * @method * @param {undefined|string|SearchParameters.clearCallback} [attribute] optional string or function * - If not given, means to clear all the filters. * - If `string`, means to clear all refinements for the `attribute` named filter. * - If `function`, means to clear all the refinements that return truthy values. * @return {SearchParameters} */ clearRefinements: function clearRefinements(attribute) { var patch = { numericRefinements: this._clearNumericRefinements(attribute), facetsRefinements: RefinementList.clearRefinement( this.facetsRefinements, attribute, 'conjunctiveFacet' ), facetsExcludes: RefinementList.clearRefinement( this.facetsExcludes, attribute, 'exclude' ), disjunctiveFacetsRefinements: RefinementList.clearRefinement( this.disjunctiveFacetsRefinements, attribute, 'disjunctiveFacet' ), hierarchicalFacetsRefinements: RefinementList.clearRefinement( this.hierarchicalFacetsRefinements, attribute, 'hierarchicalFacet' ) }; if ( patch.numericRefinements === this.numericRefinements && patch.facetsRefinements === this.facetsRefinements && patch.facetsExcludes === this.facetsExcludes && patch.disjunctiveFacetsRefinements === this.disjunctiveFacetsRefinements && patch.hierarchicalFacetsRefinements === this.hierarchicalFacetsRefinements ) { return this; } return this.setQueryParameters(patch); }, /** * Remove all the refined tags from the SearchParameters * @method * @return {SearchParameters} */ clearTags: function clearTags() { if (this.tagFilters === undefined && this.tagRefinements.length === 0) return this; return this.setQueryParameters({ tagFilters: undefined, tagRefinements: [] }); }, /** * Set the index. * @method * @param {string} index the index name * @return {SearchParameters} */ setIndex: function setIndex(index) { if (index === this.index) return this; return this.setQueryParameters({ index: index }); }, /** * Query setter * @method * @param {string} newQuery value for the new query * @return {SearchParameters} */ setQuery: function setQuery(newQuery) { if (newQuery === this.query) return this; return this.setQueryParameters({ query: newQuery }); }, /** * Page setter * @method * @param {number} newPage new page number * @return {SearchParameters} */ setPage: function setPage(newPage) { if (newPage === this.page) return this; return this.setQueryParameters({ page: newPage }); }, /** * Facets setter * The facets are the simple facets, used for conjunctive (and) faceting. * @method * @param {string[]} facets all the attributes of the algolia records used for conjunctive faceting * @return {SearchParameters} */ setFacets: function setFacets(facets) { return this.setQueryParameters({ facets: facets }); }, /** * Disjunctive facets setter * Change the list of disjunctive (or) facets the helper chan handle. * @method * @param {string[]} facets all the attributes of the algolia records used for disjunctive faceting * @return {SearchParameters} */ setDisjunctiveFacets: function setDisjunctiveFacets(facets) { return this.setQueryParameters({ disjunctiveFacets: facets }); }, /** * HitsPerPage setter * Hits per page represents the number of hits retrieved for this query * @method * @param {number} n number of hits retrieved per page of results * @return {SearchParameters} */ setHitsPerPage: function setHitsPerPage(n) { if (this.hitsPerPage === n) return this; return this.setQueryParameters({ hitsPerPage: n }); }, /** * typoTolerance setter * Set the value of typoTolerance * @method * @param {string} typoTolerance new value of typoTolerance ("true", "false", "min" or "strict") * @return {SearchParameters} */ setTypoTolerance: function setTypoTolerance(typoTolerance) { if (this.typoTolerance === typoTolerance) return this; return this.setQueryParameters({ typoTolerance: typoTolerance }); }, /** * Add a numeric filter for a given attribute * When value is an array, they are combined with OR * When value is a single value, it will combined with AND * @method * @param {string} attribute attribute to set the filter on * @param {string} operator operator of the filter (possible values: =, >, >=, <, <=, !=) * @param {number | number[]} value value of the filter * @return {SearchParameters} * @example * // for price = 50 or 40 * searchparameter.addNumericRefinement('price', '=', [50, 40]); * @example * // for size = 38 and 40 * searchparameter.addNumericRefinement('size', '=', 38); * searchparameter.addNumericRefinement('size', '=', 40); */ addNumericRefinement: function(attribute, operator, v) { var value = valToNumber_1(v); if (this.isNumericRefined(attribute, operator, value)) return this; var mod = merge_1({}, this.numericRefinements); mod[attribute] = merge_1({}, mod[attribute]); if (mod[attribute][operator]) { // Array copy mod[attribute][operator] = mod[attribute][operator].slice(); // Add the element. Concat can't be used here because value can be an array. mod[attribute][operator].push(value); } else { mod[attribute][operator] = [value]; } return this.setQueryParameters({ numericRefinements: mod }); }, /** * Get the list of conjunctive refinements for a single facet * @param {string} facetName name of the attribute used for faceting * @return {string[]} list of refinements */ getConjunctiveRefinements: function(facetName) { if (!this.isConjunctiveFacet(facetName)) { return []; } return this.facetsRefinements[facetName] || []; }, /** * Get the list of disjunctive refinements for a single facet * @param {string} facetName name of the attribute used for faceting * @return {string[]} list of refinements */ getDisjunctiveRefinements: function(facetName) { if (!this.isDisjunctiveFacet(facetName)) { return []; } return this.disjunctiveFacetsRefinements[facetName] || []; }, /** * Get the list of hierarchical refinements for a single facet * @param {string} facetName name of the attribute used for faceting * @return {string[]} list of refinements */ getHierarchicalRefinement: function(facetName) { // we send an array but we currently do not support multiple // hierarchicalRefinements for a hierarchicalFacet return this.hierarchicalFacetsRefinements[facetName] || []; }, /** * Get the list of exclude refinements for a single facet * @param {string} facetName name of the attribute used for faceting * @return {string[]} list of refinements */ getExcludeRefinements: function(facetName) { if (!this.isConjunctiveFacet(facetName)) { return []; } return this.facetsExcludes[facetName] || []; }, /** * Remove all the numeric filter for a given (attribute, operator) * @method * @param {string} attribute attribute to set the filter on * @param {string} [operator] operator of the filter (possible values: =, >, >=, <, <=, !=) * @param {number} [number] the value to be removed * @return {SearchParameters} */ removeNumericRefinement: function(attribute, operator, paramValue) { if (paramValue !== undefined) { if (!this.isNumericRefined(attribute, operator, paramValue)) { return this; } return this.setQueryParameters({ numericRefinements: this._clearNumericRefinements(function(value, key) { return ( key === attribute && value.op === operator && isEqualNumericRefinement(value.val, valToNumber_1(paramValue)) ); }) }); } else if (operator !== undefined) { if (!this.isNumericRefined(attribute, operator)) return this; return this.setQueryParameters({ numericRefinements: this._clearNumericRefinements(function(value, key) { return key === attribute && value.op === operator; }) }); } if (!this.isNumericRefined(attribute)) return this; return this.setQueryParameters({ numericRefinements: this._clearNumericRefinements(function(value, key) { return key === attribute; }) }); }, /** * Get the list of numeric refinements for a single facet * @param {string} facetName name of the attribute used for faceting * @return {SearchParameters.OperatorList[]} list of refinements */ getNumericRefinements: function(facetName) { return this.numericRefinements[facetName] || {}; }, /** * Return the current refinement for the (attribute, operator) * @param {string} attribute attribute in the record * @param {string} operator operator applied on the refined values * @return {Array.<number|number[]>} refined values */ getNumericRefinement: function(attribute, operator) { return this.numericRefinements[attribute] && this.numericRefinements[attribute][operator]; }, /** * Clear numeric filters. * @method * @private * @param {string|SearchParameters.clearCallback} [attribute] optional string or function * - If not given, means to clear all the filters. * - If `string`, means to clear all refinements for the `attribute` named filter. * - If `function`, means to clear all the refinements that return truthy values. * @return {Object.<string, OperatorList>} */ _clearNumericRefinements: function _clearNumericRefinements(attribute) { if (attribute === undefined) { if (!objectHasKeys_1(this.numericRefinements)) { return this.numericRefinements; } return {}; } else if (typeof attribute === 'string') { if (!objectHasKeys_1(this.numericRefinements[attribute])) { return this.numericRefinements; } return omit$1(this.numericRefinements, attribute); } else if (typeof attribute === 'function') { var hasChanged = false; var numericRefinements = this.numericRefinements; var newNumericRefinements = Object.keys(numericRefinements).reduce(function(memo, key) { var operators = numericRefinements[key]; var operatorList = {}; operators = operators || {}; Object.keys(operators).forEach(function(operator) { var values = operators[operator] || []; var outValues = []; values.forEach(function(value) { var predicateResult = attribute({val: value, op: operator}, key, 'numeric'); if (!predicateResult) outValues.push(value); }); if (outValues.length !== values.length) { hasChanged = true; } operatorList[operator] = outValues; }); memo[key] = operatorList; return memo; }, {}); if (hasChanged) return newNumericRefinements; return this.numericRefinements; } }, /** * Add a facet to the facets attribute of the helper configuration, if it * isn't already present. * @method * @param {string} facet facet name to add * @return {SearchParameters} */ addFacet: function addFacet(facet) { if (this.isConjunctiveFacet(facet)) { return this; } return this.setQueryParameters({ facets: this.facets.concat([facet]) }); }, /** * Add a disjunctive facet to the disjunctiveFacets attribute of the helper * configuration, if it isn't already present. * @method * @param {string} facet disjunctive facet name to add * @return {SearchParameters} */ addDisjunctiveFacet: function addDisjunctiveFacet(facet) { if (this.isDisjunctiveFacet(facet)) { return this; } return this.setQueryParameters({ disjunctiveFacets: this.disjunctiveFacets.concat([facet]) }); }, /** * Add a hierarchical facet to the hierarchicalFacets attribute of the helper * configuration. * @method * @param {object} hierarchicalFacet hierarchical facet to add * @return {SearchParameters} * @throws will throw an error if a hierarchical facet with the same name was already declared */ addHierarchicalFacet: function addHierarchicalFacet(hierarchicalFacet) { if (this.isHierarchicalFacet(hierarchicalFacet.name)) { throw new Error( 'Cannot declare two hierarchical facets with the same name: `' + hierarchicalFacet.name + '`'); } return this.setQueryParameters({ hierarchicalFacets: this.hierarchicalFacets.concat([hierarchicalFacet]) }); }, /** * Add a refinement on a "normal" facet * @method * @param {string} facet attribute to apply the faceting on * @param {string} value value of the attribute (will be converted to string) * @return {SearchParameters} */ addFacetRefinement: function addFacetRefinement(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } if (RefinementList.isRefined(this.facetsRefinements, facet, value)) return this; return this.setQueryParameters({ facetsRefinements: RefinementList.addRefinement(this.facetsRefinements, facet, value) }); }, /** * Exclude a value from a "normal" facet * @method * @param {string} facet attribute to apply the exclusion on * @param {string} value value of the attribute (will be converted to string) * @return {SearchParameters} */ addExcludeRefinement: function addExcludeRefinement(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } if (RefinementList.isRefined(this.facetsExcludes, facet, value)) return this; return this.setQueryParameters({ facetsExcludes: RefinementList.addRefinement(this.facetsExcludes, facet, value) }); }, /** * Adds a refinement on a disjunctive facet. * @method * @param {string} facet attribute to apply the faceting on * @param {string} value value of the attribute (will be converted to string) * @return {SearchParameters} */ addDisjunctiveFacetRefinement: function addDisjunctiveFacetRefinement(facet, value) { if (!this.isDisjunctiveFacet(facet)) { throw new Error( facet + ' is not defined in the disjunctiveFacets attribute of the helper configuration'); } if (RefinementList.isRefined(this.disjunctiveFacetsRefinements, facet, value)) return this; return this.setQueryParameters({ disjunctiveFacetsRefinements: RefinementList.addRefinement( this.disjunctiveFacetsRefinements, facet, value) }); }, /** * addTagRefinement adds a tag to the list used to filter the results * @param {string} tag tag to be added * @return {SearchParameters} */ addTagRefinement: function addTagRefinement(tag) { if (this.isTagRefined(tag)) return this; var modification = { tagRefinements: this.tagRefinements.concat(tag) }; return this.setQueryParameters(modification); }, /** * Remove a facet from the facets attribute of the helper configuration, if it * is present. * @method * @param {string} facet facet name to remove * @return {SearchParameters} */ removeFacet: function removeFacet(facet) { if (!this.isConjunctiveFacet(facet)) { return this; } return this.clearRefinements(facet).setQueryParameters({ facets: this.facets.filter(function(f) { return f !== facet; }) }); }, /** * Remove a disjunctive facet from the disjunctiveFacets attribute of the * helper configuration, if it is present. * @method * @param {string} facet disjunctive facet name to remove * @return {SearchParameters} */ removeDisjunctiveFacet: function removeDisjunctiveFacet(facet) { if (!this.isDisjunctiveFacet(facet)) { return this; } return this.clearRefinements(facet).setQueryParameters({ disjunctiveFacets: this.disjunctiveFacets.filter(function(f) { return f !== facet; }) }); }, /** * Remove a hierarchical facet from the hierarchicalFacets attribute of the * helper configuration, if it is present. * @method * @param {string} facet hierarchical facet name to remove * @return {SearchParameters} */ removeHierarchicalFacet: function removeHierarchicalFacet(facet) { if (!this.isHierarchicalFacet(facet)) { return this; } return this.clearRefinements(facet).setQueryParameters({ hierarchicalFacets: this.hierarchicalFacets.filter(function(f) { return f.name !== facet; }) }); }, /** * Remove a refinement set on facet. If a value is provided, it will clear the * refinement for the given value, otherwise it will clear all the refinement * values for the faceted attribute. * @method * @param {string} facet name of the attribute used for faceting * @param {string} [value] value used to filter * @return {SearchParameters} */ removeFacetRefinement: function removeFacetRefinement(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } if (!RefinementList.isRefined(this.facetsRefinements, facet, value)) return this; return this.setQueryParameters({ facetsRefinements: RefinementList.removeRefinement(this.facetsRefinements, facet, value) }); }, /** * Remove a negative refinement on a facet * @method * @param {string} facet name of the attribute used for faceting * @param {string} value value used to filter * @return {SearchParameters} */ removeExcludeRefinement: function removeExcludeRefinement(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } if (!RefinementList.isRefined(this.facetsExcludes, facet, value)) return this; return this.setQueryParameters({ facetsExcludes: RefinementList.removeRefinement(this.facetsExcludes, facet, value) }); }, /** * Remove a refinement on a disjunctive facet * @method * @param {string} facet name of the attribute used for faceting * @param {string} value value used to filter * @return {SearchParameters} */ removeDisjunctiveFacetRefinement: function removeDisjunctiveFacetRefinement(facet, value) { if (!this.isDisjunctiveFacet(facet)) { throw new Error( facet + ' is not defined in the disjunctiveFacets attribute of the helper configuration'); } if (!RefinementList.isRefined(this.disjunctiveFacetsRefinements, facet, value)) return this; return this.setQueryParameters({ disjunctiveFacetsRefinements: RefinementList.removeRefinement( this.disjunctiveFacetsRefinements, facet, value) }); }, /** * Remove a tag from the list of tag refinements * @method * @param {string} tag the tag to remove * @return {SearchParameters} */ removeTagRefinement: function removeTagRefinement(tag) { if (!this.isTagRefined(tag)) return this; var modification = { tagRefinements: this.tagRefinements.filter(function(t) { return t !== tag; }) }; return this.setQueryParameters(modification); }, /** * Generic toggle refinement method to use with facet, disjunctive facets * and hierarchical facets * @param {string} facet the facet to refine * @param {string} value the associated value * @return {SearchParameters} * @throws will throw an error if the facet is not declared in the settings of the helper * @deprecated since version 2.19.0, see {@link SearchParameters#toggleFacetRefinement} */ toggleRefinement: function toggleRefinement(facet, value) { return this.toggleFacetRefinement(facet, value); }, /** * Generic toggle refinement method to use with facet, disjunctive facets * and hierarchical facets * @param {string} facet the facet to refine * @param {string} value the associated value * @return {SearchParameters} * @throws will throw an error if the facet is not declared in the settings of the helper */ toggleFacetRefinement: function toggleFacetRefinement(facet, value) { if (this.isHierarchicalFacet(facet)) { return this.toggleHierarchicalFacetRefinement(facet, value); } else if (this.isConjunctiveFacet(facet)) { return this.toggleConjunctiveFacetRefinement(facet, value); } else if (this.isDisjunctiveFacet(facet)) { return this.toggleDisjunctiveFacetRefinement(facet, value); } throw new Error('Cannot refine the undeclared facet ' + facet + '; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets'); }, /** * Switch the refinement applied over a facet/value * @method * @param {string} facet name of the attribute used for faceting * @param {value} value value used for filtering * @return {SearchParameters} */ toggleConjunctiveFacetRefinement: function toggleConjunctiveFacetRefinement(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } return this.setQueryParameters({ facetsRefinements: RefinementList.toggleRefinement(this.facetsRefinements, facet, value) }); }, /** * Switch the refinement applied over a facet/value * @method * @param {string} facet name of the attribute used for faceting * @param {value} value value used for filtering * @return {SearchParameters} */ toggleExcludeFacetRefinement: function toggleExcludeFacetRefinement(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } return this.setQueryParameters({ facetsExcludes: RefinementList.toggleRefinement(this.facetsExcludes, facet, value) }); }, /** * Switch the refinement applied over a facet/value * @method * @param {string} facet name of the attribute used for faceting * @param {value} value value used for filtering * @return {SearchParameters} */ toggleDisjunctiveFacetRefinement: function toggleDisjunctiveFacetRefinement(facet, value) { if (!this.isDisjunctiveFacet(facet)) { throw new Error( facet + ' is not defined in the disjunctiveFacets attribute of the helper configuration'); } return this.setQueryParameters({ disjunctiveFacetsRefinements: RefinementList.toggleRefinement( this.disjunctiveFacetsRefinements, facet, value) }); }, /** * Switch the refinement applied over a facet/value * @method * @param {string} facet name of the attribute used for faceting * @param {value} value value used for filtering * @return {SearchParameters} */ toggleHierarchicalFacetRefinement: function toggleHierarchicalFacetRefinement(facet, value) { if (!this.isHierarchicalFacet(facet)) { throw new Error( facet + ' is not defined in the hierarchicalFacets attribute of the helper configuration'); } var separator = this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(facet)); var mod = {}; var upOneOrMultipleLevel = this.hierarchicalFacetsRefinements[facet] !== undefined && this.hierarchicalFacetsRefinements[facet].length > 0 && ( // remove current refinement: // refinement was 'beer > IPA', call is toggleRefine('beer > IPA'), refinement should be `beer` this.hierarchicalFacetsRefinements[facet][0] === value || // remove a parent refinement of the current refinement: // - refinement was 'beer > IPA > Flying dog' // - call is toggleRefine('beer > IPA') // - refinement should be `beer` this.hierarchicalFacetsRefinements[facet][0].indexOf(value + separator) === 0 ); if (upOneOrMultipleLevel) { if (value.indexOf(separator) === -1) { // go back to root level mod[facet] = []; } else { mod[facet] = [value.slice(0, value.lastIndexOf(separator))]; } } else { mod[facet] = [value]; } return this.setQueryParameters({ hierarchicalFacetsRefinements: defaultsPure({}, mod, this.hierarchicalFacetsRefinements) }); }, /** * Adds a refinement on a hierarchical facet. * @param {string} facet the facet name * @param {string} path the hierarchical facet path * @return {SearchParameter} the new state * @throws Error if the facet is not defined or if the facet is refined */ addHierarchicalFacetRefinement: function(facet, path) { if (this.isHierarchicalFacetRefined(facet)) { throw new Error(facet + ' is already refined.'); } if (!this.isHierarchicalFacet(facet)) { throw new Error(facet + ' is not defined in the hierarchicalFacets attribute of the helper configuration.'); } var mod = {}; mod[facet] = [path]; return this.setQueryParameters({ hierarchicalFacetsRefinements: defaultsPure({}, mod, this.hierarchicalFacetsRefinements) }); }, /** * Removes the refinement set on a hierarchical facet. * @param {string} facet the facet name * @return {SearchParameter} the new state * @throws Error if the facet is not defined or if the facet is not refined */ removeHierarchicalFacetRefinement: function(facet) { if (!this.isHierarchicalFacetRefined(facet)) { return this; } var mod = {}; mod[facet] = []; return this.setQueryParameters({ hierarchicalFacetsRefinements: defaultsPure({}, mod, this.hierarchicalFacetsRefinements) }); }, /** * Switch the tag refinement * @method * @param {string} tag the tag to remove or add * @return {SearchParameters} */ toggleTagRefinement: function toggleTagRefinement(tag) { if (this.isTagRefined(tag)) { return this.removeTagRefinement(tag); } return this.addTagRefinement(tag); }, /** * Test if the facet name is from one of the disjunctive facets * @method * @param {string} facet facet name to test * @return {boolean} */ isDisjunctiveFacet: function(facet) { return this.disjunctiveFacets.indexOf(facet) > -1; }, /** * Test if the facet name is from one of the hierarchical facets * @method * @param {string} facetName facet name to test * @return {boolean} */ isHierarchicalFacet: function(facetName) { return this.getHierarchicalFacetByName(facetName) !== undefined; }, /** * Test if the facet name is from one of the conjunctive/normal facets * @method * @param {string} facet facet name to test * @return {boolean} */ isConjunctiveFacet: function(facet) { return this.facets.indexOf(facet) > -1; }, /** * Returns true if the facet is refined, either for a specific value or in * general. * @method * @param {string} facet name of the attribute for used for faceting * @param {string} value, optional value. If passed will test that this value * is filtering the given facet. * @return {boolean} returns true if refined */ isFacetRefined: function isFacetRefined(facet, value) { if (!this.isConjunctiveFacet(facet)) { return false; } return RefinementList.isRefined(this.facetsRefinements, facet, value); }, /** * Returns true if the facet contains exclusions or if a specific value is * excluded. * * @method * @param {string} facet name of the attribute for used for faceting * @param {string} [value] optional value. If passed will test that this value * is filtering the given facet. * @return {boolean} returns true if refined */ isExcludeRefined: function isExcludeRefined(facet, value) { if (!this.isConjunctiveFacet(facet)) { return false; } return RefinementList.isRefined(this.facetsExcludes, facet, value); }, /** * Returns true if the facet contains a refinement, or if a value passed is a * refinement for the facet. * @method * @param {string} facet name of the attribute for used for faceting * @param {string} value optional, will test if the value is used for refinement * if there is one, otherwise will test if the facet contains any refinement * @return {boolean} */ isDisjunctiveFacetRefined: function isDisjunctiveFacetRefined(facet, value) { if (!this.isDisjunctiveFacet(facet)) { return false; } return RefinementList.isRefined(this.disjunctiveFacetsRefinements, facet, value); }, /** * Returns true if the facet contains a refinement, or if a value passed is a * refinement for the facet. * @method * @param {string} facet name of the attribute for used for faceting * @param {string} value optional, will test if the value is used for refinement * if there is one, otherwise will test if the facet contains any refinement * @return {boolean} */ isHierarchicalFacetRefined: function isHierarchicalFacetRefined(facet, value) { if (!this.isHierarchicalFacet(facet)) { return false; } var refinements = this.getHierarchicalRefinement(facet); if (!value) { return refinements.length > 0; } return refinements.indexOf(value) !== -1; }, /** * Test if the triple (attribute, operator, value) is already refined. * If only the attribute and the operator are provided, it tests if the * contains any refinement value. * @method * @param {string} attribute attribute for which the refinement is applied * @param {string} [operator] operator of the refinement * @param {string} [value] value of the refinement * @return {boolean} true if it is refined */ isNumericRefined: function isNumericRefined(attribute, operator, value) { if (value === undefined && operator === undefined) { return !!this.numericRefinements[attribute]; } var isOperatorDefined = this.numericRefinements[attribute] && this.numericRefinements[attribute][operator] !== undefined; if (value === undefined || !isOperatorDefined) { return isOperatorDefined; } var parsedValue = valToNumber_1(value); var isAttributeValueDefined = findArray(this.numericRefinements[attribute][operator], parsedValue) !== undefined; return isOperatorDefined && isAttributeValueDefined; }, /** * Returns true if the tag refined, false otherwise * @method * @param {string} tag the tag to check * @return {boolean} */ isTagRefined: function isTagRefined(tag) { return this.tagRefinements.indexOf(tag) !== -1; }, /** * Returns the list of all disjunctive facets refined * @method * @param {string} facet name of the attribute used for faceting * @param {value} value value used for filtering * @return {string[]} */ getRefinedDisjunctiveFacets: function getRefinedDisjunctiveFacets() { var self = this; // attributes used for numeric filter can also be disjunctive var disjunctiveNumericRefinedFacets = intersection_1( Object.keys(this.numericRefinements).filter(function(facet) { return Object.keys(self.numericRefinements[facet]).length > 0; }), this.disjunctiveFacets ); return Object.keys(this.disjunctiveFacetsRefinements).filter(function(facet) { return self.disjunctiveFacetsRefinements[facet].length > 0; }) .concat(disjunctiveNumericRefinedFacets) .concat(this.getRefinedHierarchicalFacets()); }, /** * Returns the list of all disjunctive facets refined * @method * @param {string} facet name of the attribute used for faceting * @param {value} value value used for filtering * @return {string[]} */ getRefinedHierarchicalFacets: function getRefinedHierarchicalFacets() { var self = this; return intersection_1( // enforce the order between the two arrays, // so that refinement name index === hierarchical facet index this.hierarchicalFacets.map(function(facet) { return facet.name; }), Object.keys(this.hierarchicalFacetsRefinements).filter(function(facet) { return self.hierarchicalFacetsRefinements[facet].length > 0; }) ); }, /** * Returned the list of all disjunctive facets not refined * @method * @return {string[]} */ getUnrefinedDisjunctiveFacets: function() { var refinedFacets = this.getRefinedDisjunctiveFacets(); return this.disjunctiveFacets.filter(function(f) { return refinedFacets.indexOf(f) === -1; }); }, managedParameters: [ 'index', 'facets', 'disjunctiveFacets', 'facetsRefinements', 'facetsExcludes', 'disjunctiveFacetsRefinements', 'numericRefinements', 'tagRefinements', 'hierarchicalFacets', 'hierarchicalFacetsRefinements' ], getQueryParams: function getQueryParams() { var managedParameters = this.managedParameters; var queryParams = {}; var self = this; Object.keys(this).forEach(function(paramName) { var paramValue = self[paramName]; if (managedParameters.indexOf(paramName) === -1 && paramValue !== undefined) { queryParams[paramName] = paramValue; } }); return queryParams; }, /** * Let the user set a specific value for a given parameter. Will return the * same instance if the parameter is invalid or if the value is the same as the * previous one. * @method * @param {string} parameter the parameter name * @param {any} value the value to be set, must be compliant with the definition * of the attribute on the object * @return {SearchParameters} the updated state */ setQueryParameter: function setParameter(parameter, value) { if (this[parameter] === value) return this; var modification = {}; modification[parameter] = value; return this.setQueryParameters(modification); }, /** * Let the user set any of the parameters with a plain object. * @method * @param {object} params all the keys and the values to be updated * @return {SearchParameters} a new updated instance */ setQueryParameters: function setQueryParameters(params) { if (!params) return this; var error = SearchParameters.validate(this, params); if (error) { throw error; } var self = this; var nextWithNumbers = SearchParameters._parseNumbers(params); var previousPlainObject = Object.keys(this).reduce(function(acc, key) { acc[key] = self[key]; return acc; }, {}); var nextPlainObject = Object.keys(nextWithNumbers).reduce( function(previous, key) { var isPreviousValueDefined = previous[key] !== undefined; var isNextValueDefined = nextWithNumbers[key] !== undefined; if (isPreviousValueDefined && !isNextValueDefined) { return omit$1(previous, [key]); } if (isNextValueDefined) { previous[key] = nextWithNumbers[key]; } return previous; }, previousPlainObject ); return new this.constructor(nextPlainObject); }, /** * Returns a new instance with the page reset. Two scenarios possible: * the page is omitted -> return the given instance * the page is set -> return a new instance with a page of 0 * @return {SearchParameters} a new updated instance */ resetPage: function() { if (this.page === undefined) { return this; } return this.setPage(0); }, /** * Helper function to get the hierarchicalFacet separator or the default one (`>`) * @param {object} hierarchicalFacet * @return {string} returns the hierarchicalFacet.separator or `>` as default */ _getHierarchicalFacetSortBy: function(hierarchicalFacet) { return hierarchicalFacet.sortBy || ['isRefined:desc', 'name:asc']; }, /** * Helper function to get the hierarchicalFacet separator or the default one (`>`) * @private * @param {object} hierarchicalFacet * @return {string} returns the hierarchicalFacet.separator or `>` as default */ _getHierarchicalFacetSeparator: function(hierarchicalFacet) { return hierarchicalFacet.separator || ' > '; }, /** * Helper function to get the hierarchicalFacet prefix path or null * @private * @param {object} hierarchicalFacet * @return {string} returns the hierarchicalFacet.rootPath or null as default */ _getHierarchicalRootPath: function(hierarchicalFacet) { return hierarchicalFacet.rootPath || null; }, /** * Helper function to check if we show the parent level of the hierarchicalFacet * @private * @param {object} hierarchicalFacet * @return {string} returns the hierarchicalFacet.showParentLevel or true as default */ _getHierarchicalShowParentLevel: function(hierarchicalFacet) { if (typeof hierarchicalFacet.showParentLevel === 'boolean') { return hierarchicalFacet.showParentLevel; } return true; }, /** * Helper function to get the hierarchicalFacet by it's name * @param {string} hierarchicalFacetName * @return {object} a hierarchicalFacet */ getHierarchicalFacetByName: function(hierarchicalFacetName) { return find$1( this.hierarchicalFacets, function(f) { return f.name === hierarchicalFacetName; } ); }, /** * Get the current breadcrumb for a hierarchical facet, as an array * @param {string} facetName Hierarchical facet name * @return {array.<string>} the path as an array of string */ getHierarchicalFacetBreadcrumb: function(facetName) { if (!this.isHierarchicalFacet(facetName)) { return []; } var refinement = this.getHierarchicalRefinement(facetName)[0]; if (!refinement) return []; var separator = this._getHierarchicalFacetSeparator( this.getHierarchicalFacetByName(facetName) ); var path = refinement.split(separator); return path.map(function(part) { return part.trim(); }); }, toString: function() { return JSON.stringify(this, null, 2); } }; /** * Callback used for clearRefinement method * @callback SearchParameters.clearCallback * @param {OperatorList|FacetList} value the value of the filter * @param {string} key the current attribute name * @param {string} type `numeric`, `disjunctiveFacet`, `conjunctiveFacet`, `hierarchicalFacet` or `exclude` * depending on the type of facet * @return {boolean} `true` if the element should be removed. `false` otherwise. */ var SearchParameters_1 = SearchParameters; function compareAscending(value, other) { if (value !== other) { var valIsDefined = value !== undefined; var valIsNull = value === null; var othIsDefined = other !== undefined; var othIsNull = other === null; if ( (!othIsNull && value > other) || (valIsNull && othIsDefined) || !valIsDefined ) { return 1; } if ( (!valIsNull && value < other) || (othIsNull && valIsDefined) || !othIsDefined ) { return -1; } } return 0; } /** * @param {Array<object>} collection object with keys in attributes * @param {Array<string>} iteratees attributes * @param {Array<string>} orders asc | desc */ function orderBy(collection, iteratees, orders) { if (!Array.isArray(collection)) { return []; } if (!Array.isArray(orders)) { orders = []; } var result = collection.map(function(value, index) { return { criteria: iteratees.map(function(iteratee) { return value[iteratee]; }), index: index, value: value }; }); result.sort(function comparer(object, other) { var index = -1; while (++index < object.criteria.length) { var res = compareAscending(object.criteria[index], other.criteria[index]); if (res) { if (index >= orders.length) { return res; } if (orders[index] === 'desc') { return -res; } return res; } } // This 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; }); return result.map(function(res) { return res.value; }); } var orderBy_1 = orderBy; var compact = function compact(array) { if (!Array.isArray(array)) { return []; } return array.filter(Boolean); }; // @MAJOR can be replaced by native Array#findIndex when we change support var findIndex = function find(array, comparator) { if (!Array.isArray(array)) { return -1; } for (var i = 0; i < array.length; i++) { if (comparator(array[i])) { return i; } } return -1; }; /** * Transform sort format from user friendly notation to lodash format * @param {string[]} sortBy array of predicate of the form "attribute:order" * @param {string[]} [defaults] array of predicate of the form "attribute:order" * @return {array.<string[]>} array containing 2 elements : attributes, orders */ var formatSort = function formatSort(sortBy, defaults) { var defaultInstructions = (defaults || []).map(function(sort) { return sort.split(':'); }); return sortBy.reduce( function preparePredicate(out, sort) { var sortInstruction = sort.split(':'); var matchingDefault = find$1(defaultInstructions, function( defaultInstruction ) { return defaultInstruction[0] === sortInstruction[0]; }); if (sortInstruction.length > 1 || !matchingDefault) { out[0].push(sortInstruction[0]); out[1].push(sortInstruction[1]); return out; } out[0].push(matchingDefault[0]); out[1].push(matchingDefault[1]); return out; }, [[], []] ); }; var generateHierarchicalTree_1 = generateTrees; function generateTrees(state) { return function generate(hierarchicalFacetResult, hierarchicalFacetIndex) { var hierarchicalFacet = state.hierarchicalFacets[hierarchicalFacetIndex]; var hierarchicalFacetRefinement = (state.hierarchicalFacetsRefinements[hierarchicalFacet.name] && state.hierarchicalFacetsRefinements[hierarchicalFacet.name][0]) || ''; var hierarchicalSeparator = state._getHierarchicalFacetSeparator( hierarchicalFacet ); var hierarchicalRootPath = state._getHierarchicalRootPath( hierarchicalFacet ); var hierarchicalShowParentLevel = state._getHierarchicalShowParentLevel( hierarchicalFacet ); var sortBy = formatSort( state._getHierarchicalFacetSortBy(hierarchicalFacet) ); var rootExhaustive = hierarchicalFacetResult.every(function(facetResult) { return facetResult.exhaustive; }); var generateTreeFn = generateHierarchicalTree( sortBy, hierarchicalSeparator, hierarchicalRootPath, hierarchicalShowParentLevel, hierarchicalFacetRefinement ); var results = hierarchicalFacetResult; if (hierarchicalRootPath) { results = hierarchicalFacetResult.slice( hierarchicalRootPath.split(hierarchicalSeparator).length ); } return results.reduce(generateTreeFn, { name: state.hierarchicalFacets[hierarchicalFacetIndex].name, count: null, // root level, no count isRefined: true, // root level, always refined path: null, // root level, no path exhaustive: rootExhaustive, data: null }); }; } function generateHierarchicalTree( sortBy, hierarchicalSeparator, hierarchicalRootPath, hierarchicalShowParentLevel, currentRefinement ) { return function generateTree( hierarchicalTree, hierarchicalFacetResult, currentHierarchicalLevel ) { var parent = hierarchicalTree; if (currentHierarchicalLevel > 0) { var level = 0; parent = hierarchicalTree; while (level < currentHierarchicalLevel) { /** * @type {object[]]} hierarchical data */ var data = parent && Array.isArray(parent.data) ? parent.data : []; parent = find$1(data, function(subtree) { return subtree.isRefined; }); level++; } } // we found a refined parent, let's add current level data under it if (parent) { // filter values in case an object has multiple categories: // { // categories: { // level0: ['beers', 'bières'], // level1: ['beers > IPA', 'bières > Belges'] // } // } // // If parent refinement is `beers`, then we do not want to have `bières > Belges` // showing up var picked = Object.keys(hierarchicalFacetResult.data) .map(function(facetValue) { return [facetValue, hierarchicalFacetResult.data[facetValue]]; }) .filter(function(tuple) { var facetValue = tuple[0]; return onlyMatchingTree( facetValue, parent.path || hierarchicalRootPath, currentRefinement, hierarchicalSeparator, hierarchicalRootPath, hierarchicalShowParentLevel ); }); parent.data = orderBy_1( picked.map(function(tuple) { var facetValue = tuple[0]; var facetCount = tuple[1]; return format( facetCount, facetValue, hierarchicalSeparator, currentRefinement, hierarchicalFacetResult.exhaustive ); }), sortBy[0], sortBy[1] ); } return hierarchicalTree; }; } function onlyMatchingTree( facetValue, parentPath, currentRefinement, hierarchicalSeparator, hierarchicalRootPath, hierarchicalShowParentLevel ) { // we want the facetValue is a child of hierarchicalRootPath if ( hierarchicalRootPath && (facetValue.indexOf(hierarchicalRootPath) !== 0 || hierarchicalRootPath === facetValue) ) { return false; } // we always want root levels (only when there is no prefix path) return ( (!hierarchicalRootPath && facetValue.indexOf(hierarchicalSeparator) === -1) || // if there is a rootPath, being root level mean 1 level under rootPath (hierarchicalRootPath && facetValue.split(hierarchicalSeparator).length - hierarchicalRootPath.split(hierarchicalSeparator).length === 1) || // if current refinement is a root level and current facetValue is a root level, // keep the facetValue (facetValue.indexOf(hierarchicalSeparator) === -1 && currentRefinement.indexOf(hierarchicalSeparator) === -1) || // currentRefinement is a child of the facet value currentRefinement.indexOf(facetValue) === 0 || // facetValue is a child of the current parent, add it (facetValue.indexOf(parentPath + hierarchicalSeparator) === 0 && (hierarchicalShowParentLevel || facetValue.indexOf(currentRefinement) === 0)) ); } function format( facetCount, facetValue, hierarchicalSeparator, currentRefinement, exhaustive ) { var parts = facetValue.split(hierarchicalSeparator); return { name: parts[parts.length - 1].trim(), path: facetValue, count: facetCount, isRefined: currentRefinement === facetValue || currentRefinement.indexOf(facetValue + hierarchicalSeparator) === 0, exhaustive: exhaustive, data: null }; } /** * @typedef SearchResults.Facet * @type {object} * @property {string} name name of the attribute in the record * @property {object} data the faceting data: value, number of entries * @property {object} stats undefined unless facet_stats is retrieved from algolia */ /** * @typedef SearchResults.HierarchicalFacet * @type {object} * @property {string} name name of the current value given the hierarchical level, trimmed. * If root node, you get the facet name * @property {number} count number of objects matching this hierarchical value * @property {string} path the current hierarchical value full path * @property {boolean} isRefined `true` if the current value was refined, `false` otherwise * @property {HierarchicalFacet[]} data sub values for the current level */ /** * @typedef SearchResults.FacetValue * @type {object} * @property {string} name the facet value itself * @property {number} count times this facet appears in the results * @property {boolean} isRefined is the facet currently selected * @property {boolean} isExcluded is the facet currently excluded (only for conjunctive facets) */ /** * @typedef Refinement * @type {object} * @property {string} type the type of filter used: * `numeric`, `facet`, `exclude`, `disjunctive`, `hierarchical` * @property {string} attributeName name of the attribute used for filtering * @property {string} name the value of the filter * @property {number} numericValue the value as a number. Only for numeric filters. * @property {string} operator the operator used. Only for numeric filters. * @property {number} count the number of computed hits for this filter. Only on facets. * @property {boolean} exhaustive if the count is exhaustive */ /** * @param {string[]} attributes */ function getIndices(attributes) { var indices = {}; attributes.forEach(function(val, idx) { indices[val] = idx; }); return indices; } function assignFacetStats(dest, facetStats, key) { if (facetStats && facetStats[key]) { dest.stats = facetStats[key]; } } /** * @typedef {Object} HierarchicalFacet * @property {string} name * @property {string[]} attributes */ /** * @param {HierarchicalFacet[]} hierarchicalFacets * @param {string} hierarchicalAttributeName */ function findMatchingHierarchicalFacetFromAttributeName( hierarchicalFacets, hierarchicalAttributeName ) { return find$1(hierarchicalFacets, function facetKeyMatchesAttribute( hierarchicalFacet ) { var facetNames = hierarchicalFacet.attributes || []; return facetNames.indexOf(hierarchicalAttributeName) > -1; }); } /*eslint-disable */ /** * Constructor for SearchResults * @class * @classdesc SearchResults contains the results of a query to Algolia using the * {@link AlgoliaSearchHelper}. * @param {SearchParameters} state state that led to the response * @param {array.<object>} results the results from algolia client * @example <caption>SearchResults of the first query in * <a href="http://demos.algolia.com/instant-search-demo">the instant search demo</a></caption> { "hitsPerPage": 10, "processingTimeMS": 2, "facets": [ { "name": "type", "data": { "HardGood": 6627, "BlackTie": 550, "Music": 665, "Software": 131, "Game": 456, "Movie": 1571 }, "exhaustive": false }, { "exhaustive": false, "data": { "Free shipping": 5507 }, "name": "shipping" } ], "hits": [ { "thumbnailImage": "http://img.bbystatic.com/BestBuy_US/images/products/1688/1688832_54x108_s.gif", "_highlightResult": { "shortDescription": { "matchLevel": "none", "value": "Safeguard your PC, Mac, Android and iOS devices with comprehensive Internet protection", "matchedWords": [] }, "category": { "matchLevel": "none", "value": "Computer Security Software", "matchedWords": [] }, "manufacturer": { "matchedWords": [], "value": "Webroot", "matchLevel": "none" }, "name": { "value": "Webroot SecureAnywhere Internet Security (3-Device) (1-Year Subscription) - Mac/Windows", "matchedWords": [], "matchLevel": "none" } }, "image": "http://img.bbystatic.com/BestBuy_US/images/products/1688/1688832_105x210_sc.jpg", "shipping": "Free shipping", "bestSellingRank": 4, "shortDescription": "Safeguard your PC, Mac, Android and iOS devices with comprehensive Internet protection", "url": "http://www.bestbuy.com/site/webroot-secureanywhere-internet-security-3-devi…d=1219060687969&skuId=1688832&cmp=RMX&ky=2d3GfEmNIzjA0vkzveHdZEBgpPCyMnLTJ", "name": "Webroot SecureAnywhere Internet Security (3-Device) (1-Year Subscription) - Mac/Windows", "category": "Computer Security Software", "salePrice_range": "1 - 50", "objectID": "1688832", "type": "Software", "customerReviewCount": 5980, "salePrice": 49.99, "manufacturer": "Webroot" }, .... ], "nbHits": 10000, "disjunctiveFacets": [ { "exhaustive": false, "data": { "5": 183, "12": 112, "7": 149, ... }, "name": "customerReviewCount", "stats": { "max": 7461, "avg": 157.939, "min": 1 } }, { "data": { "Printer Ink": 142, "Wireless Speakers": 60, "Point & Shoot Cameras": 48, ... }, "name": "category", "exhaustive": false }, { "exhaustive": false, "data": { "> 5000": 2, "1 - 50": 6524, "501 - 2000": 566, "201 - 500": 1501, "101 - 200": 1360, "2001 - 5000": 47 }, "name": "salePrice_range" }, { "data": { "Dynex™": 202, "Insignia™": 230, "PNY": 72, ... }, "name": "manufacturer", "exhaustive": false } ], "query": "", "nbPages": 100, "page": 0, "index": "bestbuy" } **/ /*eslint-enable */ function SearchResults(state, results) { var mainSubResponse = results[0]; this._rawResults = results; /** * query used to generate the results * @member {string} */ this.query = mainSubResponse.query; /** * The query as parsed by the engine given all the rules. * @member {string} */ this.parsedQuery = mainSubResponse.parsedQuery; /** * all the records that match the search parameters. Each record is * augmented with a new attribute `_highlightResult` * which is an object keyed by attribute and with the following properties: * - `value` : the value of the facet highlighted (html) * - `matchLevel`: full, partial or none depending on how the query terms match * @member {object[]} */ this.hits = mainSubResponse.hits; /** * index where the results come from * @member {string} */ this.index = mainSubResponse.index; /** * number of hits per page requested * @member {number} */ this.hitsPerPage = mainSubResponse.hitsPerPage; /** * total number of hits of this query on the index * @member {number} */ this.nbHits = mainSubResponse.nbHits; /** * total number of pages with respect to the number of hits per page and the total number of hits * @member {number} */ this.nbPages = mainSubResponse.nbPages; /** * current page * @member {number} */ this.page = mainSubResponse.page; /** * sum of the processing time of all the queries * @member {number} */ this.processingTimeMS = results.reduce(function(sum, result) { return result.processingTimeMS === undefined ? sum : sum + result.processingTimeMS; }, 0); /** * The position if the position was guessed by IP. * @member {string} * @example "48.8637,2.3615", */ this.aroundLatLng = mainSubResponse.aroundLatLng; /** * The radius computed by Algolia. * @member {string} * @example "126792922", */ this.automaticRadius = mainSubResponse.automaticRadius; /** * String identifying the server used to serve this request. * * getRankingInfo needs to be set to `true` for this to be returned * * @member {string} * @example "c7-use-2.algolia.net", */ this.serverUsed = mainSubResponse.serverUsed; /** * Boolean that indicates if the computation of the counts did time out. * @deprecated * @member {boolean} */ this.timeoutCounts = mainSubResponse.timeoutCounts; /** * Boolean that indicates if the computation of the hits did time out. * @deprecated * @member {boolean} */ this.timeoutHits = mainSubResponse.timeoutHits; /** * True if the counts of the facets is exhaustive * @member {boolean} */ this.exhaustiveFacetsCount = mainSubResponse.exhaustiveFacetsCount; /** * True if the number of hits is exhaustive * @member {boolean} */ this.exhaustiveNbHits = mainSubResponse.exhaustiveNbHits; /** * Contains the userData if they are set by a [query rule](https://www.algolia.com/doc/guides/query-rules/query-rules-overview/). * @member {object[]} */ this.userData = mainSubResponse.userData; /** * queryID is the unique identifier of the query used to generate the current search results. * This value is only available if the `clickAnalytics` search parameter is set to `true`. * @member {string} */ this.queryID = mainSubResponse.queryID; /** * disjunctive facets results * @member {SearchResults.Facet[]} */ this.disjunctiveFacets = []; /** * disjunctive facets results * @member {SearchResults.HierarchicalFacet[]} */ this.hierarchicalFacets = state.hierarchicalFacets.map(function initFutureTree() { return []; }); /** * other facets results * @member {SearchResults.Facet[]} */ this.facets = []; var disjunctiveFacets = state.getRefinedDisjunctiveFacets(); var facetsIndices = getIndices(state.facets); var disjunctiveFacetsIndices = getIndices(state.disjunctiveFacets); var nextDisjunctiveResult = 1; var self = this; // Since we send request only for disjunctive facets that have been refined, // we get the facets information from the first, general, response. var mainFacets = mainSubResponse.facets || {}; Object.keys(mainFacets).forEach(function(facetKey) { var facetValueObject = mainFacets[facetKey]; var hierarchicalFacet = findMatchingHierarchicalFacetFromAttributeName( state.hierarchicalFacets, facetKey ); if (hierarchicalFacet) { // Place the hierarchicalFacet data at the correct index depending on // the attributes order that was defined at the helper initialization var facetIndex = hierarchicalFacet.attributes.indexOf(facetKey); var idxAttributeName = findIndex(state.hierarchicalFacets, function(f) { return f.name === hierarchicalFacet.name; }); self.hierarchicalFacets[idxAttributeName][facetIndex] = { attribute: facetKey, data: facetValueObject, exhaustive: mainSubResponse.exhaustiveFacetsCount }; } else { var isFacetDisjunctive = state.disjunctiveFacets.indexOf(facetKey) !== -1; var isFacetConjunctive = state.facets.indexOf(facetKey) !== -1; var position; if (isFacetDisjunctive) { position = disjunctiveFacetsIndices[facetKey]; self.disjunctiveFacets[position] = { name: facetKey, data: facetValueObject, exhaustive: mainSubResponse.exhaustiveFacetsCount }; assignFacetStats(self.disjunctiveFacets[position], mainSubResponse.facets_stats, facetKey); } if (isFacetConjunctive) { position = facetsIndices[facetKey]; self.facets[position] = { name: facetKey, data: facetValueObject, exhaustive: mainSubResponse.exhaustiveFacetsCount }; assignFacetStats(self.facets[position], mainSubResponse.facets_stats, facetKey); } } }); // Make sure we do not keep holes within the hierarchical facets this.hierarchicalFacets = compact(this.hierarchicalFacets); // aggregate the refined disjunctive facets disjunctiveFacets.forEach(function(disjunctiveFacet) { var result = results[nextDisjunctiveResult]; var facets = result && result.facets ? result.facets : {}; var hierarchicalFacet = state.getHierarchicalFacetByName(disjunctiveFacet); // There should be only item in facets. Object.keys(facets).forEach(function(dfacet) { var facetResults = facets[dfacet]; var position; if (hierarchicalFacet) { position = findIndex(state.hierarchicalFacets, function(f) { return f.name === hierarchicalFacet.name; }); var attributeIndex = findIndex(self.hierarchicalFacets[position], function(f) { return f.attribute === dfacet; }); // previous refinements and no results so not able to find it if (attributeIndex === -1) { return; } self.hierarchicalFacets[position][attributeIndex].data = merge_1( {}, self.hierarchicalFacets[position][attributeIndex].data, facetResults ); } else { position = disjunctiveFacetsIndices[dfacet]; var dataFromMainRequest = mainSubResponse.facets && mainSubResponse.facets[dfacet] || {}; self.disjunctiveFacets[position] = { name: dfacet, data: defaultsPure({}, facetResults, dataFromMainRequest), exhaustive: result.exhaustiveFacetsCount }; assignFacetStats(self.disjunctiveFacets[position], result.facets_stats, dfacet); if (state.disjunctiveFacetsRefinements[dfacet]) { state.disjunctiveFacetsRefinements[dfacet].forEach(function(refinementValue) { // add the disjunctive refinements if it is no more retrieved if (!self.disjunctiveFacets[position].data[refinementValue] && state.disjunctiveFacetsRefinements[dfacet].indexOf(refinementValue) > -1) { self.disjunctiveFacets[position].data[refinementValue] = 0; } }); } } }); nextDisjunctiveResult++; }); // if we have some root level values for hierarchical facets, merge them state.getRefinedHierarchicalFacets().forEach(function(refinedFacet) { var hierarchicalFacet = state.getHierarchicalFacetByName(refinedFacet); var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet); var currentRefinement = state.getHierarchicalRefinement(refinedFacet); // if we are already at a root refinement (or no refinement at all), there is no // root level values request if (currentRefinement.length === 0 || currentRefinement[0].split(separator).length < 2) { return; } var result = results[nextDisjunctiveResult]; var facets = result && result.facets ? result.facets : {}; Object.keys(facets).forEach(function(dfacet) { var facetResults = facets[dfacet]; var position = findIndex(state.hierarchicalFacets, function(f) { return f.name === hierarchicalFacet.name; }); var attributeIndex = findIndex(self.hierarchicalFacets[position], function(f) { return f.attribute === dfacet; }); // previous refinements and no results so not able to find it if (attributeIndex === -1) { return; } // when we always get root levels, if the hits refinement is `beers > IPA` (count: 5), // then the disjunctive values will be `beers` (count: 100), // but we do not want to display // | beers (100) // > IPA (5) // We want // | beers (5) // > IPA (5) var defaultData = {}; if (currentRefinement.length > 0) { var root = currentRefinement[0].split(separator)[0]; defaultData[root] = self.hierarchicalFacets[position][attributeIndex].data[root]; } self.hierarchicalFacets[position][attributeIndex].data = defaultsPure( defaultData, facetResults, self.hierarchicalFacets[position][attributeIndex].data ); }); nextDisjunctiveResult++; }); // add the excludes Object.keys(state.facetsExcludes).forEach(function(facetName) { var excludes = state.facetsExcludes[facetName]; var position = facetsIndices[facetName]; self.facets[position] = { name: facetName, data: mainSubResponse.facets[facetName], exhaustive: mainSubResponse.exhaustiveFacetsCount }; excludes.forEach(function(facetValue) { self.facets[position] = self.facets[position] || {name: facetName}; self.facets[position].data = self.facets[position].data || {}; self.facets[position].data[facetValue] = 0; }); }); /** * @type {Array} */ this.hierarchicalFacets = this.hierarchicalFacets.map(generateHierarchicalTree_1(state)); /** * @type {Array} */ this.facets = compact(this.facets); /** * @type {Array} */ this.disjunctiveFacets = compact(this.disjunctiveFacets); this._state = state; } /** * Get a facet object with its name * @deprecated * @param {string} name name of the faceted attribute * @return {SearchResults.Facet} the facet object */ SearchResults.prototype.getFacetByName = function(name) { function predicate(facet) { return facet.name === name; } return find$1(this.facets, predicate) || find$1(this.disjunctiveFacets, predicate) || find$1(this.hierarchicalFacets, predicate); }; /** * Get the facet values of a specified attribute from a SearchResults object. * @private * @param {SearchResults} results the search results to search in * @param {string} attribute name of the faceted attribute to search for * @return {array|object} facet values. For the hierarchical facets it is an object. */ function extractNormalizedFacetValues(results, attribute) { function predicate(facet) { return facet.name === attribute; } if (results._state.isConjunctiveFacet(attribute)) { var facet = find$1(results.facets, predicate); if (!facet) return []; return Object.keys(facet.data).map(function(name) { return { name: name, count: facet.data[name], isRefined: results._state.isFacetRefined(attribute, name), isExcluded: results._state.isExcludeRefined(attribute, name) }; }); } else if (results._state.isDisjunctiveFacet(attribute)) { var disjunctiveFacet = find$1(results.disjunctiveFacets, predicate); if (!disjunctiveFacet) return []; return Object.keys(disjunctiveFacet.data).map(function(name) { return { name: name, count: disjunctiveFacet.data[name], isRefined: results._state.isDisjunctiveFacetRefined(attribute, name) }; }); } else if (results._state.isHierarchicalFacet(attribute)) { return find$1(results.hierarchicalFacets, predicate); } } /** * Sort nodes of a hierarchical facet results * @private * @param {HierarchicalFacet} node node to upon which we want to apply the sort */ function recSort(sortFn, node) { if (!node.data || node.data.length === 0) { return node; } var children = node.data.map(function(childNode) { return recSort(sortFn, childNode); }); var sortedChildren = sortFn(children); var newNode = merge_1({}, node, {data: sortedChildren}); return newNode; } SearchResults.DEFAULT_SORT = ['isRefined:desc', 'count:desc', 'name:asc']; function vanillaSortFn(order, data) { return data.sort(order); } /** * Get a the list of values for a given facet attribute. Those values are sorted * refinement first, descending count (bigger value on top), and name ascending * (alphabetical order). The sort formula can overridden using either string based * predicates or a function. * * This method will return all the values returned by the Algolia engine plus all * the values already refined. This means that it can happen that the * `maxValuesPerFacet` [configuration](https://www.algolia.com/doc/rest-api/search#param-maxValuesPerFacet) * might not be respected if you have facet values that are already refined. * @param {string} attribute attribute name * @param {object} opts configuration options. * @param {Array.<string> | function} opts.sortBy * When using strings, it consists of * the name of the [FacetValue](#SearchResults.FacetValue) or the * [HierarchicalFacet](#SearchResults.HierarchicalFacet) attributes with the * order (`asc` or `desc`). For example to order the value by count, the * argument would be `['count:asc']`. * * If only the attribute name is specified, the ordering defaults to the one * specified in the default value for this attribute. * * When not specified, the order is * ascending. This parameter can also be a function which takes two facet * values and should return a number, 0 if equal, 1 if the first argument is * bigger or -1 otherwise. * * The default value for this attribute `['isRefined:desc', 'count:desc', 'name:asc']` * @return {FacetValue[]|HierarchicalFacet|undefined} depending on the type of facet of * the attribute requested (hierarchical, disjunctive or conjunctive) * @example * helper.on('result', function(event){ * //get values ordered only by name ascending using the string predicate * event.results.getFacetValues('city', {sortBy: ['name:asc']}); * //get values ordered only by count ascending using a function * event.results.getFacetValues('city', { * // this is equivalent to ['count:asc'] * sortBy: function(a, b) { * if (a.count === b.count) return 0; * if (a.count > b.count) return 1; * if (b.count > a.count) return -1; * } * }); * }); */ SearchResults.prototype.getFacetValues = function(attribute, opts) { var facetValues = extractNormalizedFacetValues(this, attribute); if (!facetValues) { return undefined; } var options = defaultsPure({}, opts, {sortBy: SearchResults.DEFAULT_SORT}); if (Array.isArray(options.sortBy)) { var order = formatSort(options.sortBy, SearchResults.DEFAULT_SORT); if (Array.isArray(facetValues)) { return orderBy_1(facetValues, order[0], order[1]); } // If facetValues is not an array, it's an object thus a hierarchical facet object return recSort(function(hierarchicalFacetValues) { return orderBy_1(hierarchicalFacetValues, order[0], order[1]); }, facetValues); } else if (typeof options.sortBy === 'function') { if (Array.isArray(facetValues)) { return facetValues.sort(options.sortBy); } // If facetValues is not an array, it's an object thus a hierarchical facet object return recSort(function(data) { return vanillaSortFn(options.sortBy, data); }, facetValues); } throw new Error( 'options.sortBy is optional but if defined it must be ' + 'either an array of string (predicates) or a sorting function' ); }; /** * Returns the facet stats if attribute is defined and the facet contains some. * Otherwise returns undefined. * @param {string} attribute name of the faceted attribute * @return {object} The stats of the facet */ SearchResults.prototype.getFacetStats = function(attribute) { if (this._state.isConjunctiveFacet(attribute)) { return getFacetStatsIfAvailable(this.facets, attribute); } else if (this._state.isDisjunctiveFacet(attribute)) { return getFacetStatsIfAvailable(this.disjunctiveFacets, attribute); } return undefined; }; /** * @typedef {Object} FacetListItem * @property {string} name */ /** * @param {FacetListItem[]} facetList (has more items, but enough for here) * @param {string} facetName */ function getFacetStatsIfAvailable(facetList, facetName) { var data = find$1(facetList, function(facet) { return facet.name === facetName; }); return data && data.stats; } /** * Returns all refinements for all filters + tags. It also provides * additional information: count and exhaustiveness for each filter. * * See the [refinement type](#Refinement) for an exhaustive view of the available * data. * * Note that for a numeric refinement, results are grouped per operator, this * means that it will return responses for operators which are empty. * * @return {Array.<Refinement>} all the refinements */ SearchResults.prototype.getRefinements = function() { var state = this._state; var results = this; var res = []; Object.keys(state.facetsRefinements).forEach(function(attributeName) { state.facetsRefinements[attributeName].forEach(function(name) { res.push(getRefinement(state, 'facet', attributeName, name, results.facets)); }); }); Object.keys(state.facetsExcludes).forEach(function(attributeName) { state.facetsExcludes[attributeName].forEach(function(name) { res.push(getRefinement(state, 'exclude', attributeName, name, results.facets)); }); }); Object.keys(state.disjunctiveFacetsRefinements).forEach(function(attributeName) { state.disjunctiveFacetsRefinements[attributeName].forEach(function(name) { res.push(getRefinement(state, 'disjunctive', attributeName, name, results.disjunctiveFacets)); }); }); Object.keys(state.hierarchicalFacetsRefinements).forEach(function(attributeName) { state.hierarchicalFacetsRefinements[attributeName].forEach(function(name) { res.push(getHierarchicalRefinement(state, attributeName, name, results.hierarchicalFacets)); }); }); Object.keys(state.numericRefinements).forEach(function(attributeName) { var operators = state.numericRefinements[attributeName]; Object.keys(operators).forEach(function(operator) { operators[operator].forEach(function(value) { res.push({ type: 'numeric', attributeName: attributeName, name: value, numericValue: value, operator: operator }); }); }); }); state.tagRefinements.forEach(function(name) { res.push({type: 'tag', attributeName: '_tags', name: name}); }); return res; }; /** * @typedef {Object} Facet * @property {string} name * @property {Object} data * @property {boolean} exhaustive */ /** * @param {*} state * @param {*} type * @param {string} attributeName * @param {*} name * @param {Facet[]} resultsFacets */ function getRefinement(state, type, attributeName, name, resultsFacets) { var facet = find$1(resultsFacets, function(f) { return f.name === attributeName; }); var count = facet && facet.data && facet.data[name] ? facet.data[name] : 0; var exhaustive = (facet && facet.exhaustive) || false; return { type: type, attributeName: attributeName, name: name, count: count, exhaustive: exhaustive }; } /** * @param {*} state * @param {string} attributeName * @param {*} name * @param {Facet[]} resultsFacets */ function getHierarchicalRefinement(state, attributeName, name, resultsFacets) { var facetDeclaration = state.getHierarchicalFacetByName(attributeName); var separator = state._getHierarchicalFacetSeparator(facetDeclaration); var split = name.split(separator); var rootFacet = find$1(resultsFacets, function(facet) { return facet.name === attributeName; }); var facet = split.reduce(function(intermediateFacet, part) { var newFacet = intermediateFacet && find$1(intermediateFacet.data, function(f) { return f.name === part; }); return newFacet !== undefined ? newFacet : intermediateFacet; }, rootFacet); var count = (facet && facet.count) || 0; var exhaustive = (facet && facet.exhaustive) || false; var path = (facet && facet.path) || ''; return { type: 'hierarchical', attributeName: attributeName, name: path, count: count, exhaustive: exhaustive }; } var SearchResults_1 = SearchResults; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. function EventEmitter() { this._events = this._events || {}; this._maxListeners = this._maxListeners || undefined; } var events = EventEmitter; // Backwards-compat with node 0.10.x EventEmitter.EventEmitter = EventEmitter; EventEmitter.prototype._events = undefined; EventEmitter.prototype._maxListeners = undefined; // By default EventEmitters will print a warning if more than 10 listeners are // added to it. This is a useful default which helps finding memory leaks. EventEmitter.defaultMaxListeners = 10; // Obviously not all Emitters should be limited to 10. This function allows // that to be increased. Set to zero for unlimited. EventEmitter.prototype.setMaxListeners = function(n) { if (!isNumber(n) || n < 0 || isNaN(n)) throw TypeError('n must be a positive number'); this._maxListeners = n; return this; }; EventEmitter.prototype.emit = function(type) { var er, handler, len, args, i, listeners; if (!this._events) this._events = {}; // If there is no 'error' event listener then throw. if (type === 'error') { if (!this._events.error || (isObject(this._events.error) && !this._events.error.length)) { er = arguments[1]; if (er instanceof Error) { throw er; // Unhandled 'error' event } else { // At least give some kind of context to the user var err = new Error('Uncaught, unspecified "error" event. (' + er + ')'); err.context = er; throw err; } } } handler = this._events[type]; if (isUndefined(handler)) return false; if (isFunction(handler)) { switch (arguments.length) { // fast cases case 1: handler.call(this); break; case 2: handler.call(this, arguments[1]); break; case 3: handler.call(this, arguments[1], arguments[2]); break; // slower default: args = Array.prototype.slice.call(arguments, 1); handler.apply(this, args); } } else if (isObject(handler)) { args = Array.prototype.slice.call(arguments, 1); listeners = handler.slice(); len = listeners.length; for (i = 0; i < len; i++) listeners[i].apply(this, args); } return true; }; EventEmitter.prototype.addListener = function(type, listener) { var m; if (!isFunction(listener)) throw TypeError('listener must be a function'); if (!this._events) this._events = {}; // To avoid recursion in the case that type === "newListener"! Before // adding it to the listeners, first emit "newListener". if (this._events.newListener) this.emit('newListener', type, isFunction(listener.listener) ? listener.listener : listener); if (!this._events[type]) // Optimize the case of one listener. Don't need the extra array object. this._events[type] = listener; else if (isObject(this._events[type])) // If we've already got an array, just append. this._events[type].push(listener); else // Adding the second element, need to change to array. this._events[type] = [this._events[type], listener]; // Check for listener leak if (isObject(this._events[type]) && !this._events[type].warned) { if (!isUndefined(this._maxListeners)) { m = this._maxListeners; } else { m = EventEmitter.defaultMaxListeners; } if (m && m > 0 && this._events[type].length > m) { this._events[type].warned = true; console.error('(node) warning: possible EventEmitter memory ' + 'leak detected. %d listeners added. ' + 'Use emitter.setMaxListeners() to increase limit.', this._events[type].length); if (typeof console.trace === 'function') { // not supported in IE 10 console.trace(); } } } return this; }; EventEmitter.prototype.on = EventEmitter.prototype.addListener; EventEmitter.prototype.once = function(type, listener) { if (!isFunction(listener)) throw TypeError('listener must be a function'); var fired = false; function g() { this.removeListener(type, g); if (!fired) { fired = true; listener.apply(this, arguments); } } g.listener = listener; this.on(type, g); return this; }; // emits a 'removeListener' event iff the listener was removed EventEmitter.prototype.removeListener = function(type, listener) { var list, position, length, i; if (!isFunction(listener)) throw TypeError('listener must be a function'); if (!this._events || !this._events[type]) return this; list = this._events[type]; length = list.length; position = -1; if (list === listener || (isFunction(list.listener) && list.listener === listener)) { delete this._events[type]; if (this._events.removeListener) this.emit('removeListener', type, listener); } else if (isObject(list)) { for (i = length; i-- > 0;) { if (list[i] === listener || (list[i].listener && list[i].listener === listener)) { position = i; break; } } if (position < 0) return this; if (list.length === 1) { list.length = 0; delete this._events[type]; } else { list.splice(position, 1); } if (this._events.removeListener) this.emit('removeListener', type, listener); } return this; }; EventEmitter.prototype.removeAllListeners = function(type) { var key, listeners; if (!this._events) return this; // not listening for removeListener, no need to emit if (!this._events.removeListener) { if (arguments.length === 0) this._events = {}; else if (this._events[type]) delete this._events[type]; return this; } // emit removeListener for all listeners on all events if (arguments.length === 0) { for (key in this._events) { if (key === 'removeListener') continue; this.removeAllListeners(key); } this.removeAllListeners('removeListener'); this._events = {}; return this; } listeners = this._events[type]; if (isFunction(listeners)) { this.removeListener(type, listeners); } else if (listeners) { // LIFO order while (listeners.length) this.removeListener(type, listeners[listeners.length - 1]); } delete this._events[type]; return this; }; EventEmitter.prototype.listeners = function(type) { var ret; if (!this._events || !this._events[type]) ret = []; else if (isFunction(this._events[type])) ret = [this._events[type]]; else ret = this._events[type].slice(); return ret; }; EventEmitter.prototype.listenerCount = function(type) { if (this._events) { var evlistener = this._events[type]; if (isFunction(evlistener)) return 1; else if (evlistener) return evlistener.length; } return 0; }; EventEmitter.listenerCount = function(emitter, type) { return emitter.listenerCount(type); }; function isFunction(arg) { return typeof arg === 'function'; } function isNumber(arg) { return typeof arg === 'number'; } function isObject(arg) { return typeof arg === 'object' && arg !== null; } function isUndefined(arg) { return arg === void 0; } function inherits(ctor, superCtor) { ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }); } var inherits_1 = inherits; /** * A DerivedHelper is a way to create sub requests to * Algolia from a main helper. * @class * @classdesc The DerivedHelper provides an event based interface for search callbacks: * - search: when a search is triggered using the `search()` method. * - result: when the response is retrieved from Algolia and is processed. * This event contains a {@link SearchResults} object and the * {@link SearchParameters} corresponding to this answer. */ function DerivedHelper(mainHelper, fn) { this.main = mainHelper; this.fn = fn; this.lastResults = null; } inherits_1(DerivedHelper, events.EventEmitter); /** * Detach this helper from the main helper * @return {undefined} * @throws Error if the derived helper is already detached */ DerivedHelper.prototype.detach = function() { this.removeAllListeners(); this.main.detachDerivedHelper(this); }; DerivedHelper.prototype.getModifiedState = function(parameters) { return this.fn(parameters); }; var DerivedHelper_1 = DerivedHelper; var requestBuilder = { /** * Get all the queries to send to the client, those queries can used directly * with the Algolia client. * @private * @return {object[]} The queries */ _getQueries: function getQueries(index, state) { var queries = []; // One query for the hits queries.push({ indexName: index, params: requestBuilder._getHitsSearchParams(state) }); // One for each disjunctive facets state.getRefinedDisjunctiveFacets().forEach(function(refinedFacet) { queries.push({ indexName: index, params: requestBuilder._getDisjunctiveFacetSearchParams(state, refinedFacet) }); }); // maybe more to get the root level of hierarchical facets when activated state.getRefinedHierarchicalFacets().forEach(function(refinedFacet) { var hierarchicalFacet = state.getHierarchicalFacetByName(refinedFacet); var currentRefinement = state.getHierarchicalRefinement(refinedFacet); // if we are deeper than level 0 (starting from `beer > IPA`) // we want to get the root values var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet); if (currentRefinement.length > 0 && currentRefinement[0].split(separator).length > 1) { queries.push({ indexName: index, params: requestBuilder._getDisjunctiveFacetSearchParams(state, refinedFacet, true) }); } }); return queries; }, /** * Build search parameters used to fetch hits * @private * @return {object.<string, any>} */ _getHitsSearchParams: function(state) { var facets = state.facets .concat(state.disjunctiveFacets) .concat(requestBuilder._getHitsHierarchicalFacetsAttributes(state)); var facetFilters = requestBuilder._getFacetFilters(state); var numericFilters = requestBuilder._getNumericFilters(state); var tagFilters = requestBuilder._getTagFilters(state); var additionalParams = { facets: facets, tagFilters: tagFilters }; if (facetFilters.length > 0) { additionalParams.facetFilters = facetFilters; } if (numericFilters.length > 0) { additionalParams.numericFilters = numericFilters; } return merge_1({}, state.getQueryParams(), additionalParams); }, /** * Build search parameters used to fetch a disjunctive facet * @private * @param {string} facet the associated facet name * @param {boolean} hierarchicalRootLevel ?? FIXME * @return {object} */ _getDisjunctiveFacetSearchParams: function(state, facet, hierarchicalRootLevel) { var facetFilters = requestBuilder._getFacetFilters(state, facet, hierarchicalRootLevel); var numericFilters = requestBuilder._getNumericFilters(state, facet); var tagFilters = requestBuilder._getTagFilters(state); var additionalParams = { hitsPerPage: 1, page: 0, attributesToRetrieve: [], attributesToHighlight: [], attributesToSnippet: [], tagFilters: tagFilters, analytics: false, clickAnalytics: false }; var hierarchicalFacet = state.getHierarchicalFacetByName(facet); if (hierarchicalFacet) { additionalParams.facets = requestBuilder._getDisjunctiveHierarchicalFacetAttribute( state, hierarchicalFacet, hierarchicalRootLevel ); } else { additionalParams.facets = facet; } if (numericFilters.length > 0) { additionalParams.numericFilters = numericFilters; } if (facetFilters.length > 0) { additionalParams.facetFilters = facetFilters; } return merge_1({}, state.getQueryParams(), additionalParams); }, /** * Return the numeric filters in an algolia request fashion * @private * @param {string} [facetName] the name of the attribute for which the filters should be excluded * @return {string[]} the numeric filters in the algolia format */ _getNumericFilters: function(state, facetName) { if (state.numericFilters) { return state.numericFilters; } var numericFilters = []; Object.keys(state.numericRefinements).forEach(function(attribute) { var operators = state.numericRefinements[attribute] || {}; Object.keys(operators).forEach(function(operator) { var values = operators[operator] || []; if (facetName !== attribute) { values.forEach(function(value) { if (Array.isArray(value)) { var vs = value.map(function(v) { return attribute + operator + v; }); numericFilters.push(vs); } else { numericFilters.push(attribute + operator + value); } }); } }); }); return numericFilters; }, /** * Return the tags filters depending * @private * @return {string} */ _getTagFilters: function(state) { if (state.tagFilters) { return state.tagFilters; } return state.tagRefinements.join(','); }, /** * Build facetFilters parameter based on current refinements. The array returned * contains strings representing the facet filters in the algolia format. * @private * @param {string} [facet] if set, the current disjunctive facet * @return {array.<string>} */ _getFacetFilters: function(state, facet, hierarchicalRootLevel) { var facetFilters = []; var facetsRefinements = state.facetsRefinements || {}; Object.keys(facetsRefinements).forEach(function(facetName) { var facetValues = facetsRefinements[facetName] || []; facetValues.forEach(function(facetValue) { facetFilters.push(facetName + ':' + facetValue); }); }); var facetsExcludes = state.facetsExcludes || {}; Object.keys(facetsExcludes).forEach(function(facetName) { var facetValues = facetsExcludes[facetName] || []; facetValues.forEach(function(facetValue) { facetFilters.push(facetName + ':-' + facetValue); }); }); var disjunctiveFacetsRefinements = state.disjunctiveFacetsRefinements || {}; Object.keys(disjunctiveFacetsRefinements).forEach(function(facetName) { var facetValues = disjunctiveFacetsRefinements[facetName] || []; if (facetName === facet || !facetValues || facetValues.length === 0) { return; } var orFilters = []; facetValues.forEach(function(facetValue) { orFilters.push(facetName + ':' + facetValue); }); facetFilters.push(orFilters); }); var hierarchicalFacetsRefinements = state.hierarchicalFacetsRefinements || {}; Object.keys(hierarchicalFacetsRefinements).forEach(function(facetName) { var facetValues = hierarchicalFacetsRefinements[facetName] || []; var facetValue = facetValues[0]; if (facetValue === undefined) { return; } var hierarchicalFacet = state.getHierarchicalFacetByName(facetName); var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet); var rootPath = state._getHierarchicalRootPath(hierarchicalFacet); var attributeToRefine; var attributesIndex; // we ask for parent facet values only when the `facet` is the current hierarchical facet if (facet === facetName) { // if we are at the root level already, no need to ask for facet values, we get them from // the hits query if (facetValue.indexOf(separator) === -1 || (!rootPath && hierarchicalRootLevel === true) || (rootPath && rootPath.split(separator).length === facetValue.split(separator).length)) { return; } if (!rootPath) { attributesIndex = facetValue.split(separator).length - 2; facetValue = facetValue.slice(0, facetValue.lastIndexOf(separator)); } else { attributesIndex = rootPath.split(separator).length - 1; facetValue = rootPath; } attributeToRefine = hierarchicalFacet.attributes[attributesIndex]; } else { attributesIndex = facetValue.split(separator).length - 1; attributeToRefine = hierarchicalFacet.attributes[attributesIndex]; } if (attributeToRefine) { facetFilters.push([attributeToRefine + ':' + facetValue]); } }); return facetFilters; }, _getHitsHierarchicalFacetsAttributes: function(state) { var out = []; return state.hierarchicalFacets.reduce( // ask for as much levels as there's hierarchical refinements function getHitsAttributesForHierarchicalFacet(allAttributes, hierarchicalFacet) { var hierarchicalRefinement = state.getHierarchicalRefinement(hierarchicalFacet.name)[0]; // if no refinement, ask for root level if (!hierarchicalRefinement) { allAttributes.push(hierarchicalFacet.attributes[0]); return allAttributes; } var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet); var level = hierarchicalRefinement.split(separator).length; var newAttributes = hierarchicalFacet.attributes.slice(0, level + 1); return allAttributes.concat(newAttributes); }, out); }, _getDisjunctiveHierarchicalFacetAttribute: function(state, hierarchicalFacet, rootLevel) { var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet); if (rootLevel === true) { var rootPath = state._getHierarchicalRootPath(hierarchicalFacet); var attributeIndex = 0; if (rootPath) { attributeIndex = rootPath.split(separator).length; } return [hierarchicalFacet.attributes[attributeIndex]]; } var hierarchicalRefinement = state.getHierarchicalRefinement(hierarchicalFacet.name)[0] || ''; // if refinement is 'beers > IPA > Flying dog', // then we want `facets: ['beers > IPA']` as disjunctive facet (parent level values) var parentLevel = hierarchicalRefinement.split(separator).length - 1; return hierarchicalFacet.attributes.slice(0, parentLevel + 1); }, getSearchForFacetQuery: function(facetName, query, maxFacetHits, state) { var stateForSearchForFacetValues = state.isDisjunctiveFacet(facetName) ? state.clearRefinements(facetName) : state; var searchForFacetSearchParameters = { facetQuery: query, facetName: facetName }; if (typeof maxFacetHits === 'number') { searchForFacetSearchParameters.maxFacetHits = maxFacetHits; } return merge_1( {}, requestBuilder._getHitsSearchParams(stateForSearchForFacetValues), searchForFacetSearchParameters ); } }; var requestBuilder_1 = requestBuilder; var version$1 = '3.0.0'; /** * Event triggered when a parameter is set or updated * @event AlgoliaSearchHelper#event:change * @property {object} event * @property {SearchParameters} event.state the current parameters with the latest changes applied * @property {SearchResults} event.results the previous results received from Algolia. `null` before the first request * @example * helper.on('change', function(event) { * console.log('The parameters have changed'); * }); */ /** * Event triggered when a main search is sent to Algolia * @event AlgoliaSearchHelper#event:search * @property {object} event * @property {SearchParameters} event.state the parameters used for this search * @property {SearchResults} event.results the results from the previous search. `null` if it is the first search. * @example * helper.on('search', function(event) { * console.log('Search sent'); * }); */ /** * Event triggered when a search using `searchForFacetValues` is sent to Algolia * @event AlgoliaSearchHelper#event:searchForFacetValues * @property {object} event * @property {SearchParameters} event.state the parameters used for this search it is the first search. * @property {string} event.facet the facet searched into * @property {string} event.query the query used to search in the facets * @example * helper.on('searchForFacetValues', function(event) { * console.log('searchForFacetValues sent'); * }); */ /** * Event triggered when a search using `searchOnce` is sent to Algolia * @event AlgoliaSearchHelper#event:searchOnce * @property {object} event * @property {SearchParameters} event.state the parameters used for this search it is the first search. * @example * helper.on('searchOnce', function(event) { * console.log('searchOnce sent'); * }); */ /** * Event triggered when the results are retrieved from Algolia * @event AlgoliaSearchHelper#event:result * @property {object} event * @property {SearchResults} event.results the results received from Algolia * @property {SearchParameters} event.state the parameters used to query Algolia. Those might be different from the one in the helper instance (for example if the network is unreliable). * @example * helper.on('result', function(event) { * console.log('Search results received'); * }); */ /** * Event triggered when Algolia sends back an error. For example, if an unknown parameter is * used, the error can be caught using this event. * @event AlgoliaSearchHelper#event:error * @property {object} event * @property {Error} event.error the error returned by the Algolia. * @example * helper.on('error', function(event) { * console.log('Houston we got a problem.'); * }); */ /** * Event triggered when the queue of queries have been depleted (with any result or outdated queries) * @event AlgoliaSearchHelper#event:searchQueueEmpty * @example * helper.on('searchQueueEmpty', function() { * console.log('No more search pending'); * // This is received before the result event if we're not expecting new results * }); * * helper.search(); */ /** * Initialize a new AlgoliaSearchHelper * @class * @classdesc The AlgoliaSearchHelper is a class that ease the management of the * search. It provides an event based interface for search callbacks: * - change: when the internal search state is changed. * This event contains a {@link SearchParameters} object and the * {@link SearchResults} of the last result if any. * - search: when a search is triggered using the `search()` method. * - result: when the response is retrieved from Algolia and is processed. * This event contains a {@link SearchResults} object and the * {@link SearchParameters} corresponding to this answer. * - error: when the response is an error. This event contains the error returned by the server. * @param {AlgoliaSearch} client an AlgoliaSearch client * @param {string} index the index name to query * @param {SearchParameters | object} options an object defining the initial * config of the search. It doesn't have to be a {SearchParameters}, * just an object containing the properties you need from it. */ function AlgoliaSearchHelper(client, index, options) { if (typeof client.addAlgoliaAgent === 'function') { client.addAlgoliaAgent('JS Helper (' + version$1 + ')'); } this.setClient(client); var opts = options || {}; opts.index = index; this.state = SearchParameters_1.make(opts); this.lastResults = null; this._queryId = 0; this._lastQueryIdReceived = -1; this.derivedHelpers = []; this._currentNbQueries = 0; } inherits_1(AlgoliaSearchHelper, events.EventEmitter); /** * Start the search with the parameters set in the state. When the * method is called, it triggers a `search` event. The results will * be available through the `result` event. If an error occurs, an * `error` will be fired instead. * @return {AlgoliaSearchHelper} * @fires search * @fires result * @fires error * @chainable */ AlgoliaSearchHelper.prototype.search = function() { this._search({onlyWithDerivedHelpers: false}); return this; }; AlgoliaSearchHelper.prototype.searchOnlyWithDerivedHelpers = function() { this._search({onlyWithDerivedHelpers: true}); return this; }; /** * Gets the search query parameters that would be sent to the Algolia Client * for the hits * @return {object} Query Parameters */ AlgoliaSearchHelper.prototype.getQuery = function() { var state = this.state; return requestBuilder_1._getHitsSearchParams(state); }; /** * Start a search using a modified version of the current state. This method does * not trigger the helper lifecycle and does not modify the state kept internally * by the helper. This second aspect means that the next search call will be the * same as a search call before calling searchOnce. * @param {object} options can contain all the parameters that can be set to SearchParameters * plus the index * @param {function} [callback] optional callback executed when the response from the * server is back. * @return {promise|undefined} if a callback is passed the method returns undefined * otherwise it returns a promise containing an object with two keys : * - content with a SearchResults * - state with the state used for the query as a SearchParameters * @example * // Changing the number of records returned per page to 1 * // This example uses the callback API * var state = helper.searchOnce({hitsPerPage: 1}, * function(error, content, state) { * // if an error occurred it will be passed in error, otherwise its value is null * // content contains the results formatted as a SearchResults * // state is the instance of SearchParameters used for this search * }); * @example * // Changing the number of records returned per page to 1 * // This example uses the promise API * var state1 = helper.searchOnce({hitsPerPage: 1}) * .then(promiseHandler); * * function promiseHandler(res) { * // res contains * // { * // content : SearchResults * // state : SearchParameters (the one used for this specific search) * // } * } */ AlgoliaSearchHelper.prototype.searchOnce = function(options, cb) { var tempState = !options ? this.state : this.state.setQueryParameters(options); var queries = requestBuilder_1._getQueries(tempState.index, tempState); var self = this; this._currentNbQueries++; this.emit('searchOnce', { state: tempState }); if (cb) { this.client .search(queries) .then(function(content) { self._currentNbQueries--; if (self._currentNbQueries === 0) { self.emit('searchQueueEmpty'); } cb(null, new SearchResults_1(tempState, content.results), tempState); }) .catch(function(err) { self._currentNbQueries--; if (self._currentNbQueries === 0) { self.emit('searchQueueEmpty'); } cb(err, null, tempState); }); return undefined; } return this.client.search(queries).then(function(content) { self._currentNbQueries--; if (self._currentNbQueries === 0) self.emit('searchQueueEmpty'); return { content: new SearchResults_1(tempState, content.results), state: tempState, _originalResponse: content }; }, function(e) { self._currentNbQueries--; if (self._currentNbQueries === 0) self.emit('searchQueueEmpty'); throw e; }); }; /** * Structure of each result when using * [`searchForFacetValues()`](reference.html#AlgoliaSearchHelper#searchForFacetValues) * @typedef FacetSearchHit * @type {object} * @property {string} value the facet value * @property {string} highlighted the facet value highlighted with the query string * @property {number} count number of occurrence of this facet value * @property {boolean} isRefined true if the value is already refined */ /** * Structure of the data resolved by the * [`searchForFacetValues()`](reference.html#AlgoliaSearchHelper#searchForFacetValues) * promise. * @typedef FacetSearchResult * @type {object} * @property {FacetSearchHit} facetHits the results for this search for facet values * @property {number} processingTimeMS time taken by the query inside the engine */ /** * Search for facet values based on an query and the name of a faceted attribute. This * triggers a search and will return a promise. On top of using the query, it also sends * the parameters from the state so that the search is narrowed down to only the possible values. * * See the description of [FacetSearchResult](reference.html#FacetSearchResult) * @param {string} facet the name of the faceted attribute * @param {string} query the string query for the search * @param {number} [maxFacetHits] the maximum number values returned. Should be > 0 and <= 100 * @param {object} [userState] the set of custom parameters to use on top of the current state. Setting a property to `undefined` removes * it in the generated query. * @return {promise.<FacetSearchResult>} the results of the search */ AlgoliaSearchHelper.prototype.searchForFacetValues = function(facet, query, maxFacetHits, userState) { var clientHasSFFV = typeof this.client.searchForFacetValues === 'function'; if ( !clientHasSFFV && typeof this.client.initIndex !== 'function' ) { throw new Error( 'search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues or client.initIndex(index).searchForFacetValues' ); } var state = this.state.setQueryParameters(userState || {}); var isDisjunctive = state.isDisjunctiveFacet(facet); var algoliaQuery = requestBuilder_1.getSearchForFacetQuery(facet, query, maxFacetHits, state); this._currentNbQueries++; var self = this; this.emit('searchForFacetValues', { state: state, facet: facet, query: query }); var searchForFacetValuesPromise = clientHasSFFV ? this.client.searchForFacetValues([{indexName: state.index, params: algoliaQuery}]) : this.client.initIndex(state.index).searchForFacetValues(algoliaQuery); return searchForFacetValuesPromise.then(function addIsRefined(content) { self._currentNbQueries--; if (self._currentNbQueries === 0) self.emit('searchQueueEmpty'); content = Array.isArray(content) ? content[0] : content; content.facetHits.forEach(function(f) { f.isRefined = isDisjunctive ? state.isDisjunctiveFacetRefined(facet, f.value) : state.isFacetRefined(facet, f.value); }); return content; }, function(e) { self._currentNbQueries--; if (self._currentNbQueries === 0) self.emit('searchQueueEmpty'); throw e; }); }; /** * Sets the text query used for the search. * * This method resets the current page to 0. * @param {string} q the user query * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.setQuery = function(q) { this._change({ state: this.state.resetPage().setQuery(q), isPageReset: true }); return this; }; /** * Remove all the types of refinements except tags. A string can be provided to remove * only the refinements of a specific attribute. For more advanced use case, you can * provide a function instead. This function should follow the * [clearCallback definition](#SearchParameters.clearCallback). * * This method resets the current page to 0. * @param {string} [name] optional name of the facet / attribute on which we want to remove all refinements * @return {AlgoliaSearchHelper} * @fires change * @chainable * @example * // Removing all the refinements * helper.clearRefinements().search(); * @example * // Removing all the filters on a the category attribute. * helper.clearRefinements('category').search(); * @example * // Removing only the exclude filters on the category facet. * helper.clearRefinements(function(value, attribute, type) { * return type === 'exclude' && attribute === 'category'; * }).search(); */ AlgoliaSearchHelper.prototype.clearRefinements = function(name) { this._change({ state: this.state.resetPage().clearRefinements(name), isPageReset: true }); return this; }; /** * Remove all the tag filters. * * This method resets the current page to 0. * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.clearTags = function() { this._change({ state: this.state.resetPage().clearTags(), isPageReset: true }); return this; }; /** * Adds a disjunctive filter to a faceted attribute with the `value` provided. If the * filter is already set, it doesn't change the filters. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} value the associated value (will be converted to string) * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.addDisjunctiveFacetRefinement = function(facet, value) { this._change({ state: this.state.resetPage().addDisjunctiveFacetRefinement(facet, value), isPageReset: true }); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addDisjunctiveFacetRefinement} */ AlgoliaSearchHelper.prototype.addDisjunctiveRefine = function() { return this.addDisjunctiveFacetRefinement.apply(this, arguments); }; /** * Adds a refinement on a hierarchical facet. It will throw * an exception if the facet is not defined or if the facet * is already refined. * * This method resets the current page to 0. * @param {string} facet the facet name * @param {string} path the hierarchical facet path * @return {AlgoliaSearchHelper} * @throws Error if the facet is not defined or if the facet is refined * @chainable * @fires change */ AlgoliaSearchHelper.prototype.addHierarchicalFacetRefinement = function(facet, value) { this._change({ state: this.state.resetPage().addHierarchicalFacetRefinement(facet, value), isPageReset: true }); return this; }; /** * Adds a an numeric filter to an attribute with the `operator` and `value` provided. If the * filter is already set, it doesn't change the filters. * * This method resets the current page to 0. * @param {string} attribute the attribute on which the numeric filter applies * @param {string} operator the operator of the filter * @param {number} value the value of the filter * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.addNumericRefinement = function(attribute, operator, value) { this._change({ state: this.state.resetPage().addNumericRefinement(attribute, operator, value), isPageReset: true }); return this; }; /** * Adds a filter to a faceted attribute with the `value` provided. If the * filter is already set, it doesn't change the filters. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} value the associated value (will be converted to string) * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.addFacetRefinement = function(facet, value) { this._change({ state: this.state.resetPage().addFacetRefinement(facet, value), isPageReset: true }); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addFacetRefinement} */ AlgoliaSearchHelper.prototype.addRefine = function() { return this.addFacetRefinement.apply(this, arguments); }; /** * Adds a an exclusion filter to a faceted attribute with the `value` provided. If the * filter is already set, it doesn't change the filters. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} value the associated value (will be converted to string) * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.addFacetExclusion = function(facet, value) { this._change({ state: this.state.resetPage().addExcludeRefinement(facet, value), isPageReset: true }); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addFacetExclusion} */ AlgoliaSearchHelper.prototype.addExclude = function() { return this.addFacetExclusion.apply(this, arguments); }; /** * Adds a tag filter with the `tag` provided. If the * filter is already set, it doesn't change the filters. * * This method resets the current page to 0. * @param {string} tag the tag to add to the filter * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.addTag = function(tag) { this._change({ state: this.state.resetPage().addTagRefinement(tag), isPageReset: true }); return this; }; /** * Removes an numeric filter to an attribute with the `operator` and `value` provided. If the * filter is not set, it doesn't change the filters. * * Some parameters are optional, triggering different behavior: * - if the value is not provided, then all the numeric value will be removed for the * specified attribute/operator couple. * - if the operator is not provided either, then all the numeric filter on this attribute * will be removed. * * This method resets the current page to 0. * @param {string} attribute the attribute on which the numeric filter applies * @param {string} [operator] the operator of the filter * @param {number} [value] the value of the filter * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.removeNumericRefinement = function(attribute, operator, value) { this._change({ state: this.state.resetPage().removeNumericRefinement(attribute, operator, value), isPageReset: true }); return this; }; /** * Removes a disjunctive filter to a faceted attribute with the `value` provided. If the * filter is not set, it doesn't change the filters. * * If the value is omitted, then this method will remove all the filters for the * attribute. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} [value] the associated value * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.removeDisjunctiveFacetRefinement = function(facet, value) { this._change({ state: this.state.resetPage().removeDisjunctiveFacetRefinement(facet, value), isPageReset: true }); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeDisjunctiveFacetRefinement} */ AlgoliaSearchHelper.prototype.removeDisjunctiveRefine = function() { return this.removeDisjunctiveFacetRefinement.apply(this, arguments); }; /** * Removes the refinement set on a hierarchical facet. * @param {string} facet the facet name * @return {AlgoliaSearchHelper} * @throws Error if the facet is not defined or if the facet is not refined * @fires change * @chainable */ AlgoliaSearchHelper.prototype.removeHierarchicalFacetRefinement = function(facet) { this._change({ state: this.state.resetPage().removeHierarchicalFacetRefinement(facet), isPageReset: true }); return this; }; /** * Removes a filter to a faceted attribute with the `value` provided. If the * filter is not set, it doesn't change the filters. * * If the value is omitted, then this method will remove all the filters for the * attribute. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} [value] the associated value * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.removeFacetRefinement = function(facet, value) { this._change({ state: this.state.resetPage().removeFacetRefinement(facet, value), isPageReset: true }); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeFacetRefinement} */ AlgoliaSearchHelper.prototype.removeRefine = function() { return this.removeFacetRefinement.apply(this, arguments); }; /** * Removes an exclusion filter to a faceted attribute with the `value` provided. If the * filter is not set, it doesn't change the filters. * * If the value is omitted, then this method will remove all the filters for the * attribute. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} [value] the associated value * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.removeFacetExclusion = function(facet, value) { this._change({ state: this.state.resetPage().removeExcludeRefinement(facet, value), isPageReset: true }); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeFacetExclusion} */ AlgoliaSearchHelper.prototype.removeExclude = function() { return this.removeFacetExclusion.apply(this, arguments); }; /** * Removes a tag filter with the `tag` provided. If the * filter is not set, it doesn't change the filters. * * This method resets the current page to 0. * @param {string} tag tag to remove from the filter * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.removeTag = function(tag) { this._change({ state: this.state.resetPage().removeTagRefinement(tag), isPageReset: true }); return this; }; /** * Adds or removes an exclusion filter to a faceted attribute with the `value` provided. If * the value is set then it removes it, otherwise it adds the filter. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} value the associated value * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.toggleFacetExclusion = function(facet, value) { this._change({ state: this.state.resetPage().toggleExcludeFacetRefinement(facet, value), isPageReset: true }); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#toggleFacetExclusion} */ AlgoliaSearchHelper.prototype.toggleExclude = function() { return this.toggleFacetExclusion.apply(this, arguments); }; /** * Adds or removes a filter to a faceted attribute with the `value` provided. If * the value is set then it removes it, otherwise it adds the filter. * * This method can be used for conjunctive, disjunctive and hierarchical filters. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} value the associated value * @return {AlgoliaSearchHelper} * @throws Error will throw an error if the facet is not declared in the settings of the helper * @fires change * @chainable * @deprecated since version 2.19.0, see {@link AlgoliaSearchHelper#toggleFacetRefinement} */ AlgoliaSearchHelper.prototype.toggleRefinement = function(facet, value) { return this.toggleFacetRefinement(facet, value); }; /** * Adds or removes a filter to a faceted attribute with the `value` provided. If * the value is set then it removes it, otherwise it adds the filter. * * This method can be used for conjunctive, disjunctive and hierarchical filters. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} value the associated value * @return {AlgoliaSearchHelper} * @throws Error will throw an error if the facet is not declared in the settings of the helper * @fires change * @chainable */ AlgoliaSearchHelper.prototype.toggleFacetRefinement = function(facet, value) { this._change({ state: this.state.resetPage().toggleFacetRefinement(facet, value), isPageReset: true }); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#toggleFacetRefinement} */ AlgoliaSearchHelper.prototype.toggleRefine = function() { return this.toggleFacetRefinement.apply(this, arguments); }; /** * Adds or removes a tag filter with the `value` provided. If * the value is set then it removes it, otherwise it adds the filter. * * This method resets the current page to 0. * @param {string} tag tag to remove or add * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.toggleTag = function(tag) { this._change({ state: this.state.resetPage().toggleTagRefinement(tag), isPageReset: true }); return this; }; /** * Increments the page number by one. * @return {AlgoliaSearchHelper} * @fires change * @chainable * @example * helper.setPage(0).nextPage().getPage(); * // returns 1 */ AlgoliaSearchHelper.prototype.nextPage = function() { var page = this.state.page || 0; return this.setPage(page + 1); }; /** * Decrements the page number by one. * @fires change * @return {AlgoliaSearchHelper} * @chainable * @example * helper.setPage(1).previousPage().getPage(); * // returns 0 */ AlgoliaSearchHelper.prototype.previousPage = function() { var page = this.state.page || 0; return this.setPage(page - 1); }; /** * @private */ function setCurrentPage(page) { if (page < 0) throw new Error('Page requested below 0.'); this._change({ state: this.state.setPage(page), isPageReset: false }); return this; } /** * Change the current page * @deprecated * @param {number} page The page number * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.setCurrentPage = setCurrentPage; /** * Updates the current page. * @function * @param {number} page The page number * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.setPage = setCurrentPage; /** * Updates the name of the index that will be targeted by the query. * * This method resets the current page to 0. * @param {string} name the index name * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.setIndex = function(name) { this._change({ state: this.state.resetPage().setIndex(name), isPageReset: true }); return this; }; /** * Update a parameter of the search. This method reset the page * * The complete list of parameters is available on the * [Algolia website](https://www.algolia.com/doc/rest#query-an-index). * The most commonly used parameters have their own [shortcuts](#query-parameters-shortcuts) * or benefit from higher-level APIs (all the kind of filters and facets have their own API) * * This method resets the current page to 0. * @param {string} parameter name of the parameter to update * @param {any} value new value of the parameter * @return {AlgoliaSearchHelper} * @fires change * @chainable * @example * helper.setQueryParameter('hitsPerPage', 20).search(); */ AlgoliaSearchHelper.prototype.setQueryParameter = function(parameter, value) { this._change({ state: this.state.resetPage().setQueryParameter(parameter, value), isPageReset: true }); return this; }; /** * Set the whole state (warning: will erase previous state) * @param {SearchParameters} newState the whole new state * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.setState = function(newState) { this._change({ state: SearchParameters_1.make(newState), isPageReset: false }); return this; }; /** * Override the current state without triggering a change event. * Do not use this method unless you know what you are doing. (see the example * for a legit use case) * @param {SearchParameters} newState the whole new state * @return {AlgoliaSearchHelper} * @example * helper.on('change', function(state){ * // In this function you might want to find a way to store the state in the url/history * updateYourURL(state) * }) * window.onpopstate = function(event){ * // This is naive though as you should check if the state is really defined etc. * helper.overrideStateWithoutTriggeringChangeEvent(event.state).search() * } * @chainable */ AlgoliaSearchHelper.prototype.overrideStateWithoutTriggeringChangeEvent = function(newState) { this.state = new SearchParameters_1(newState); return this; }; /** * Check if an attribute has any numeric, conjunctive, disjunctive or hierarchical filters. * @param {string} attribute the name of the attribute * @return {boolean} true if the attribute is filtered by at least one value * @example * // hasRefinements works with numeric, conjunctive, disjunctive and hierarchical filters * helper.hasRefinements('price'); // false * helper.addNumericRefinement('price', '>', 100); * helper.hasRefinements('price'); // true * * helper.hasRefinements('color'); // false * helper.addFacetRefinement('color', 'blue'); * helper.hasRefinements('color'); // true * * helper.hasRefinements('material'); // false * helper.addDisjunctiveFacetRefinement('material', 'plastic'); * helper.hasRefinements('material'); // true * * helper.hasRefinements('categories'); // false * helper.toggleFacetRefinement('categories', 'kitchen > knife'); * helper.hasRefinements('categories'); // true * */ AlgoliaSearchHelper.prototype.hasRefinements = function(attribute) { if (objectHasKeys_1(this.state.getNumericRefinements(attribute))) { return true; } else if (this.state.isConjunctiveFacet(attribute)) { return this.state.isFacetRefined(attribute); } else if (this.state.isDisjunctiveFacet(attribute)) { return this.state.isDisjunctiveFacetRefined(attribute); } else if (this.state.isHierarchicalFacet(attribute)) { return this.state.isHierarchicalFacetRefined(attribute); } // there's currently no way to know that the user did call `addNumericRefinement` at some point // thus we cannot distinguish if there once was a numeric refinement that was cleared // so we will return false in every other situations to be consistent // while what we should do here is throw because we did not find the attribute in any type // of refinement return false; }; /** * Check if a value is excluded for a specific faceted attribute. If the value * is omitted then the function checks if there is any excluding refinements. * * @param {string} facet name of the attribute for used for faceting * @param {string} [value] optional value. If passed will test that this value * is filtering the given facet. * @return {boolean} true if refined * @example * helper.isExcludeRefined('color'); // false * helper.isExcludeRefined('color', 'blue') // false * helper.isExcludeRefined('color', 'red') // false * * helper.addFacetExclusion('color', 'red'); * * helper.isExcludeRefined('color'); // true * helper.isExcludeRefined('color', 'blue') // false * helper.isExcludeRefined('color', 'red') // true */ AlgoliaSearchHelper.prototype.isExcluded = function(facet, value) { return this.state.isExcludeRefined(facet, value); }; /** * @deprecated since 2.4.0, see {@link AlgoliaSearchHelper#hasRefinements} */ AlgoliaSearchHelper.prototype.isDisjunctiveRefined = function(facet, value) { return this.state.isDisjunctiveFacetRefined(facet, value); }; /** * Check if the string is a currently filtering tag. * @param {string} tag tag to check * @return {boolean} */ AlgoliaSearchHelper.prototype.hasTag = function(tag) { return this.state.isTagRefined(tag); }; /** * @deprecated since 2.4.0, see {@link AlgoliaSearchHelper#hasTag} */ AlgoliaSearchHelper.prototype.isTagRefined = function() { return this.hasTagRefinements.apply(this, arguments); }; /** * Get the name of the currently used index. * @return {string} * @example * helper.setIndex('highestPrice_products').getIndex(); * // returns 'highestPrice_products' */ AlgoliaSearchHelper.prototype.getIndex = function() { return this.state.index; }; function getCurrentPage() { return this.state.page; } /** * Get the currently selected page * @deprecated * @return {number} the current page */ AlgoliaSearchHelper.prototype.getCurrentPage = getCurrentPage; /** * Get the currently selected page * @function * @return {number} the current page */ AlgoliaSearchHelper.prototype.getPage = getCurrentPage; /** * Get all the tags currently set to filters the results. * * @return {string[]} The list of tags currently set. */ AlgoliaSearchHelper.prototype.getTags = function() { return this.state.tagRefinements; }; /** * Get the list of refinements for a given attribute. This method works with * conjunctive, disjunctive, excluding and numerical filters. * * See also SearchResults#getRefinements * * @param {string} facetName attribute name used for faceting * @return {Array.<FacetRefinement|NumericRefinement>} All Refinement are objects that contain a value, and * a type. Numeric also contains an operator. * @example * helper.addNumericRefinement('price', '>', 100); * helper.getRefinements('price'); * // [ * // { * // "value": [ * // 100 * // ], * // "operator": ">", * // "type": "numeric" * // } * // ] * @example * helper.addFacetRefinement('color', 'blue'); * helper.addFacetExclusion('color', 'red'); * helper.getRefinements('color'); * // [ * // { * // "value": "blue", * // "type": "conjunctive" * // }, * // { * // "value": "red", * // "type": "exclude" * // } * // ] * @example * helper.addDisjunctiveFacetRefinement('material', 'plastic'); * // [ * // { * // "value": "plastic", * // "type": "disjunctive" * // } * // ] */ AlgoliaSearchHelper.prototype.getRefinements = function(facetName) { var refinements = []; if (this.state.isConjunctiveFacet(facetName)) { var conjRefinements = this.state.getConjunctiveRefinements(facetName); conjRefinements.forEach(function(r) { refinements.push({ value: r, type: 'conjunctive' }); }); var excludeRefinements = this.state.getExcludeRefinements(facetName); excludeRefinements.forEach(function(r) { refinements.push({ value: r, type: 'exclude' }); }); } else if (this.state.isDisjunctiveFacet(facetName)) { var disjRefinements = this.state.getDisjunctiveRefinements(facetName); disjRefinements.forEach(function(r) { refinements.push({ value: r, type: 'disjunctive' }); }); } var numericRefinements = this.state.getNumericRefinements(facetName); Object.keys(numericRefinements).forEach(function(operator) { var value = numericRefinements[operator]; refinements.push({ value: value, operator: operator, type: 'numeric' }); }); return refinements; }; /** * Return the current refinement for the (attribute, operator) * @param {string} attribute attribute in the record * @param {string} operator operator applied on the refined values * @return {Array.<number|number[]>} refined values */ AlgoliaSearchHelper.prototype.getNumericRefinement = function(attribute, operator) { return this.state.getNumericRefinement(attribute, operator); }; /** * Get the current breadcrumb for a hierarchical facet, as an array * @param {string} facetName Hierarchical facet name * @return {array.<string>} the path as an array of string */ AlgoliaSearchHelper.prototype.getHierarchicalFacetBreadcrumb = function(facetName) { return this.state.getHierarchicalFacetBreadcrumb(facetName); }; // /////////// PRIVATE /** * Perform the underlying queries * @private * @return {undefined} * @fires search * @fires result * @fires error */ AlgoliaSearchHelper.prototype._search = function(options) { var state = this.state; var states = []; var mainQueries = []; if (!options.onlyWithDerivedHelpers) { mainQueries = requestBuilder_1._getQueries(state.index, state); states.push({ state: state, queriesCount: mainQueries.length, helper: this }); this.emit('search', { state: state, results: this.lastResults }); } var derivedQueries = this.derivedHelpers.map(function(derivedHelper) { var derivedState = derivedHelper.getModifiedState(state); var derivedStateQueries = requestBuilder_1._getQueries(derivedState.index, derivedState); states.push({ state: derivedState, queriesCount: derivedStateQueries.length, helper: derivedHelper }); derivedHelper.emit('search', { state: derivedState, results: derivedHelper.lastResults }); return derivedStateQueries; }); var queries = Array.prototype.concat.apply(mainQueries, derivedQueries); var queryId = this._queryId++; this._currentNbQueries++; try { this.client.search(queries) .then(this._dispatchAlgoliaResponse.bind(this, states, queryId)) .catch(this._dispatchAlgoliaError.bind(this, queryId)); } catch (error) { // If we reach this part, we're in an internal error state this.emit('error', { error: error }); } }; /** * Transform the responses as sent by the server and transform them into a user * usable object that merge the results of all the batch requests. It will dispatch * over the different helper + derived helpers (when there are some). * @private * @param {array.<{SearchParameters, AlgoliaQueries, AlgoliaSearchHelper}>} * state state used for to generate the request * @param {number} queryId id of the current request * @param {object} content content of the response * @return {undefined} */ AlgoliaSearchHelper.prototype._dispatchAlgoliaResponse = function(states, queryId, content) { // FIXME remove the number of outdated queries discarded instead of just one if (queryId < this._lastQueryIdReceived) { // Outdated answer return; } this._currentNbQueries -= (queryId - this._lastQueryIdReceived); this._lastQueryIdReceived = queryId; if (this._currentNbQueries === 0) this.emit('searchQueueEmpty'); var results = content.results.slice(); states.forEach(function(s) { var state = s.state; var queriesCount = s.queriesCount; var helper = s.helper; var specificResults = results.splice(0, queriesCount); var formattedResponse = helper.lastResults = new SearchResults_1(state, specificResults); helper.emit('result', { results: formattedResponse, state: state }); }); }; AlgoliaSearchHelper.prototype._dispatchAlgoliaError = function(queryId, error) { if (queryId < this._lastQueryIdReceived) { // Outdated answer return; } this._currentNbQueries -= queryId - this._lastQueryIdReceived; this._lastQueryIdReceived = queryId; this.emit('error', { error: error }); if (this._currentNbQueries === 0) this.emit('searchQueueEmpty'); }; AlgoliaSearchHelper.prototype.containsRefinement = function(query, facetFilters, numericFilters, tagFilters) { return query || facetFilters.length !== 0 || numericFilters.length !== 0 || tagFilters.length !== 0; }; /** * Test if there are some disjunctive refinements on the facet * @private * @param {string} facet the attribute to test * @return {boolean} */ AlgoliaSearchHelper.prototype._hasDisjunctiveRefinements = function(facet) { return this.state.disjunctiveRefinements[facet] && this.state.disjunctiveRefinements[facet].length > 0; }; AlgoliaSearchHelper.prototype._change = function(event) { var state = event.state; var isPageReset = event.isPageReset; if (state !== this.state) { this.state = state; this.emit('change', { state: this.state, results: this.lastResults, isPageReset: isPageReset }); } }; /** * Clears the cache of the underlying Algolia client. * @return {AlgoliaSearchHelper} */ AlgoliaSearchHelper.prototype.clearCache = function() { this.client.clearCache && this.client.clearCache(); return this; }; /** * Updates the internal client instance. If the reference of the clients * are equal then no update is actually done. * @param {AlgoliaSearch} newClient an AlgoliaSearch client * @return {AlgoliaSearchHelper} */ AlgoliaSearchHelper.prototype.setClient = function(newClient) { if (this.client === newClient) return this; if (typeof newClient.addAlgoliaAgent === 'function') { newClient.addAlgoliaAgent('JS Helper (' + version$1 + ')'); } this.client = newClient; return this; }; /** * Gets the instance of the currently used client. * @return {AlgoliaSearch} */ AlgoliaSearchHelper.prototype.getClient = function() { return this.client; }; /** * Creates an derived instance of the Helper. A derived helper * is a way to request other indices synchronised with the lifecycle * of the main Helper. This mechanism uses the multiqueries feature * of Algolia to aggregate all the requests in a single network call. * * This method takes a function that is used to create a new SearchParameter * that will be used to create requests to Algolia. Those new requests * are created just before the `search` event. The signature of the function * is `SearchParameters -> SearchParameters`. * * This method returns a new DerivedHelper which is an EventEmitter * that fires the same `search`, `result` and `error` events. Those * events, however, will receive data specific to this DerivedHelper * and the SearchParameters that is returned by the call of the * parameter function. * @param {function} fn SearchParameters -> SearchParameters * @return {DerivedHelper} */ AlgoliaSearchHelper.prototype.derive = function(fn) { var derivedHelper = new DerivedHelper_1(this, fn); this.derivedHelpers.push(derivedHelper); return derivedHelper; }; /** * This method detaches a derived Helper from the main one. Prefer using the one from the * derived helper itself, to remove the event listeners too. * @private * @return {undefined} * @throws Error */ AlgoliaSearchHelper.prototype.detachDerivedHelper = function(derivedHelper) { var pos = this.derivedHelpers.indexOf(derivedHelper); if (pos === -1) throw new Error('Derived helper already detached'); this.derivedHelpers.splice(pos, 1); }; /** * This method returns true if there is currently at least one on-going search. * @return {boolean} true if there is a search pending */ AlgoliaSearchHelper.prototype.hasPendingRequests = function() { return this._currentNbQueries > 0; }; /** * @typedef AlgoliaSearchHelper.NumericRefinement * @type {object} * @property {number[]} value the numbers that are used for filtering this attribute with * the operator specified. * @property {string} operator the faceting data: value, number of entries * @property {string} type will be 'numeric' */ /** * @typedef AlgoliaSearchHelper.FacetRefinement * @type {object} * @property {string} value the string use to filter the attribute * @property {string} type the type of filter: 'conjunctive', 'disjunctive', 'exclude' */ var algoliasearch_helper = AlgoliaSearchHelper; /** * The algoliasearchHelper module is the function that will let its * contains everything needed to use the Algoliasearch * Helper. It is a also a function that instanciate the helper. * To use the helper, you also need the Algolia JS client v3. * @example * //using the UMD build * var client = algoliasearch('latency', '6be0576ff61c053d5f9a3225e2a90f76'); * var helper = algoliasearchHelper(client, 'bestbuy', { * facets: ['shipping'], * disjunctiveFacets: ['category'] * }); * helper.on('result', function(event) { * console.log(event.results); * }); * helper * .toggleFacetRefinement('category', 'Movies & TV Shows') * .toggleFacetRefinement('shipping', 'Free shipping') * .search(); * @example * // The helper is an event emitter using the node API * helper.on('result', updateTheResults); * helper.once('result', updateTheResults); * helper.removeListener('result', updateTheResults); * helper.removeAllListeners('result'); * @module algoliasearchHelper * @param {AlgoliaSearch} client an AlgoliaSearch client * @param {string} index the name of the index to query * @param {SearchParameters|object} opts an object defining the initial config of the search. It doesn't have to be a {SearchParameters}, just an object containing the properties you need from it. * @return {AlgoliaSearchHelper} */ function algoliasearchHelper(client, index, opts) { return new algoliasearch_helper(client, index, opts); } /** * The version currently used * @member module:algoliasearchHelper.version * @type {number} */ algoliasearchHelper.version = version$1; /** * Constructor for the Helper. * @member module:algoliasearchHelper.AlgoliaSearchHelper * @type {AlgoliaSearchHelper} */ algoliasearchHelper.AlgoliaSearchHelper = algoliasearch_helper; /** * Constructor for the object containing all the parameters of the search. * @member module:algoliasearchHelper.SearchParameters * @type {SearchParameters} */ algoliasearchHelper.SearchParameters = SearchParameters_1; /** * Constructor for the object containing the results of the search. * @member module:algoliasearchHelper.SearchResults * @type {SearchResults} */ algoliasearchHelper.SearchResults = SearchResults_1; var algoliasearchHelper_1 = algoliasearchHelper; function createOptionalFilter(_ref) { var attributeName = _ref.attributeName, attributeValue = _ref.attributeValue, attributeScore = _ref.attributeScore; return "".concat(attributeName, ":").concat(attributeValue, "<score=").concat(attributeScore || 1, ">"); } var defaultProps = { transformSearchParameters: function transformSearchParameters(x) { return _objectSpread({}, x); } }; function getId$1() { // We store the search state of this widget in `configure`. return 'configure'; } function getSearchParametersFromProps(props) { var optionalFilters = Object.keys(props.matchingPatterns).reduce(function (acc, attributeName) { var attributePattern = props.matchingPatterns[attributeName]; var attributeValue = props.hit[attributeName]; var attributeScore = attributePattern.score; if (Array.isArray(attributeValue)) { return [].concat(_toConsumableArray(acc), [attributeValue.map(function (attributeSubValue) { return createOptionalFilter({ attributeName: attributeName, attributeValue: attributeSubValue, attributeScore: attributeScore }); })]); } if (typeof attributeValue === 'string') { return [].concat(_toConsumableArray(acc), [createOptionalFilter({ attributeName: attributeName, attributeValue: attributeValue, attributeScore: attributeScore })]); } return acc; }, []); return props.transformSearchParameters(new algoliasearchHelper_1.SearchParameters({ // @ts-ignore @TODO algoliasearch-helper@3.0.1 will contain the type // `sumOrFiltersScores`. // See https://github.com/algolia/algoliasearch-helper-js/pull/753 sumOrFiltersScores: true, facetFilters: ["objectID:-".concat(props.hit.objectID)], optionalFilters: optionalFilters })); } var connectConfigureRelatedItems = createConnectorWithContext({ displayName: 'AlgoliaConfigureRelatedItems', defaultProps: defaultProps, getProvidedProps: function getProvidedProps() { return {}; }, getSearchParameters: function getSearchParameters(searchParameters, props) { return searchParameters.setQueryParameters(getSearchParametersFromProps(props)); }, transitionState: function transitionState(props, _prevSearchState, nextSearchState) { var id = getId$1(); // We need to transform the exhaustive search parameters back to clean // search parameters without the empty default keys so we don't pollute the // `configure` search state. var searchParameters = removeEmptyArraysFromObject(removeEmptyKey(getSearchParametersFromProps(props))); var searchParametersKeys = Object.keys(searchParameters); var nonPresentKeys = this._searchParameters ? Object.keys(this._searchParameters).filter(function (prop) { return searchParametersKeys.indexOf(prop) === -1; }) : []; this._searchParameters = searchParameters; var nextValue = _defineProperty({}, id, _objectSpread({}, omit(nextSearchState[id], nonPresentKeys), searchParameters)); return refineValue(nextSearchState, nextValue, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, cleanUp: function cleanUp(props, searchState) { var _this = this; var id = getId$1(); var indexId = getIndexId({ ais: props.contextValue, multiIndexContext: props.indexContextValue }); var subState = hasMultipleIndices({ ais: props.contextValue, multiIndexContext: props.indexContextValue }) && searchState.indices ? searchState.indices[indexId] : searchState; var configureKeys = subState && subState[id] ? Object.keys(subState[id]) : []; var configureState = configureKeys.reduce(function (acc, item) { if (!_this._searchParameters[item]) { acc[item] = subState[id][item]; } return acc; }, {}); var nextValue = _defineProperty({}, id, configureState); return refineValue(searchState, nextValue, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); } }); function createCommonjsModule(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; } /* object-assign (c) Sindre Sorhus @license MIT */ /* eslint-disable no-unused-vars */ var getOwnPropertySymbols = Object.getOwnPropertySymbols; var hasOwnProperty = Object.prototype.hasOwnProperty; var propIsEnumerable = Object.prototype.propertyIsEnumerable; function toObject(val) { if (val === null || val === undefined) { throw new TypeError('Object.assign cannot be called with null or undefined'); } return Object(val); } function shouldUseNative() { try { if (!Object.assign) { return false; } // Detect buggy property enumeration order in older V8 versions. // https://bugs.chromium.org/p/v8/issues/detail?id=4118 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers test1[5] = 'de'; if (Object.getOwnPropertyNames(test1)[0] === '5') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test2 = {}; for (var i = 0; i < 10; i++) { test2['_' + String.fromCharCode(i)] = i; } var order2 = Object.getOwnPropertyNames(test2).map(function (n) { return test2[n]; }); if (order2.join('') !== '0123456789') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test3 = {}; 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { test3[letter] = letter; }); if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { return false; } return true; } catch (err) { // We don't expect any of the above to throw, but better to be safe. return false; } } var objectAssign = shouldUseNative() ? Object.assign : function (target, source) { var from; var to = toObject(target); var symbols; for (var s = 1; s < arguments.length; s++) { from = Object(arguments[s]); for (var key in from) { if (hasOwnProperty.call(from, key)) { to[key] = from[key]; } } if (getOwnPropertySymbols) { symbols = getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) { if (propIsEnumerable.call(from, symbols[i])) { to[symbols[i]] = from[symbols[i]]; } } } } return to; }; /** * 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. */ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; var ReactPropTypesSecret_1 = ReactPropTypesSecret; function emptyFunction() {} var factoryWithThrowingShims = function() { function shim(props, propName, componentName, location, propFullName, secret) { if (secret === ReactPropTypesSecret_1) { // It is still safe when called from React. return; } var err = new Error( 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types' ); err.name = 'Invariant Violation'; throw err; } shim.isRequired = shim; function getShim() { return shim; } // Important! // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. var ReactPropTypes = { array: shim, bool: shim, func: shim, number: shim, object: shim, string: shim, symbol: shim, any: shim, arrayOf: getShim, element: shim, instanceOf: getShim, node: shim, objectOf: getShim, oneOf: getShim, oneOfType: getShim, shape: getShim, exact: getShim }; ReactPropTypes.checkPropTypes = emptyFunction; ReactPropTypes.PropTypes = ReactPropTypes; return ReactPropTypes; }; var propTypes = createCommonjsModule(function (module) { /** * 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. */ { // By explicitly using `prop-types` you are opting into new production behavior. // http://fb.me/prop-types-in-prod module.exports = factoryWithThrowingShims(); } }); function ConfigureRelatedItems() { return null; } ConfigureRelatedItems.propTypes = { hit: propTypes.object.isRequired, matchingPatterns: propTypes.object.isRequired, transformSearchParameters: propTypes.func }; var ConfigureRelatedItems$1 = connectConfigureRelatedItems(ConfigureRelatedItems); function getIndexContext(props) { return { targetedIndex: props.indexId }; } /** * The component that allows you to apply widgets to a dedicated index. It's * useful if you want to build an interface that targets multiple indices. * * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, Index, SearchBox, Hits, Configure } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <Configure hitsPerPage={5} /> * <SearchBox /> * <Index indexName="instant_search"> * <Hits /> * </Index> * <Index indexName="bestbuy"> * <Hits /> * </Index> * </InstantSearch> * ); */ var Index = /*#__PURE__*/ function (_Component) { _inherits(Index, _Component); _createClass(Index, null, [{ key: "getDerivedStateFromProps", value: function getDerivedStateFromProps(props) { return { indexContext: getIndexContext(props) }; } }]); function Index(props) { var _this; _classCallCheck(this, Index); _this = _possibleConstructorReturn(this, _getPrototypeOf(Index).call(this, props)); _defineProperty(_assertThisInitialized(_this), "state", { indexContext: getIndexContext(_this.props) }); _defineProperty(_assertThisInitialized(_this), "unregisterWidget", void 0); _this.props.contextValue.onSearchParameters(_this.getSearchParameters.bind(_assertThisInitialized(_this)), { ais: _this.props.contextValue, multiIndexContext: _this.state.indexContext }, _this.props); return _this; } _createClass(Index, [{ key: "componentDidMount", value: function componentDidMount() { this.unregisterWidget = this.props.contextValue.widgetsManager.registerWidget(this); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (this.props.indexName !== prevProps.indexName) { this.props.contextValue.widgetsManager.update(); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { if (typeof this.unregisterWidget === 'function') { this.unregisterWidget(); } } }, { key: "getSearchParameters", value: function getSearchParameters(searchParameters, props) { return searchParameters.setIndex(this.props ? this.props.indexName : props.indexName); } }, { key: "render", value: function render() { var childrenCount = React.Children.count(this.props.children); if (childrenCount === 0) { return null; } return React__default.createElement(IndexProvider, { value: this.state.indexContext }, this.props.children); } }]); return Index; }(React.Component); _defineProperty(Index, "propTypes", { indexName: propTypes.string.isRequired, indexId: propTypes.string.isRequired, children: propTypes.node }); var IndexWrapper = function IndexWrapper(props) { var inferredIndexId = props.indexName; return React__default.createElement(InstantSearchConsumer, null, function (contextValue) { return React__default.createElement(Index, _extends({ contextValue: contextValue, indexId: inferredIndexId }, props)); }); }; function createWidgetsManager(onWidgetsUpdate) { var widgets = []; // Is an update scheduled? var scheduled = false; // The state manager's updates need to be batched since more than one // component can register or unregister widgets during the same tick. function scheduleUpdate() { if (scheduled) { return; } scheduled = true; defer(function () { scheduled = false; onWidgetsUpdate(); }); } return { registerWidget: function registerWidget(widget) { widgets.push(widget); scheduleUpdate(); return function unregisterWidget() { widgets.splice(widgets.indexOf(widget), 1); scheduleUpdate(); }; }, update: scheduleUpdate, getWidgets: function getWidgets() { return widgets; } }; } function createStore(initialState) { var state = initialState; var listeners = []; return { getState: function getState() { return state; }, setState: function setState(nextState) { state = nextState; listeners.forEach(function (listener) { return listener(); }); }, subscribe: function subscribe(listener) { listeners.push(listener); return function unsubscribe() { listeners.splice(listeners.indexOf(listener), 1); }; } }; } function addAlgoliaAgents(searchClient) { if (typeof searchClient.addAlgoliaAgent === 'function') { searchClient.addAlgoliaAgent("react (".concat(React.version, ")")); searchClient.addAlgoliaAgent("react-instantsearch (".concat(version, ")")); } } var isMultiIndexContext = function isMultiIndexContext(widget) { return hasMultipleIndices({ ais: widget.props.contextValue, multiIndexContext: widget.props.indexContextValue }); }; var isTargetedIndexEqualIndex = function isTargetedIndexEqualIndex(widget, indexId) { return widget.props.indexContextValue.targetedIndex === indexId; }; // Relying on the `indexId` is a bit brittle to detect the `Index` widget. // Since it's a class we could rely on `instanceof` or similar. We never // had an issue though. Works for now. var isIndexWidget = function isIndexWidget(widget) { return Boolean(widget.props.indexId); }; var isIndexWidgetEqualIndex = function isIndexWidgetEqualIndex(widget, indexId) { return widget.props.indexId === indexId; }; var sortIndexWidgetsFirst = function sortIndexWidgetsFirst(firstWidget, secondWidget) { if (isIndexWidget(firstWidget)) { return -1; } if (isIndexWidget(secondWidget)) { return 1; } return 0; }; /** * Creates a new instance of the InstantSearchManager which controls the widgets and * trigger the search when the widgets are updated. * @param {string} indexName - the main index name * @param {object} initialState - initial widget state * @param {object} SearchParameters - optional additional parameters to send to the algolia API * @param {number} stalledSearchDelay - time (in ms) after the search is stalled * @return {InstantSearchManager} a new instance of InstantSearchManager */ function createInstantSearchManager(_ref) { var indexName = _ref.indexName, _ref$initialState = _ref.initialState, initialState = _ref$initialState === void 0 ? {} : _ref$initialState, searchClient = _ref.searchClient, resultsState = _ref.resultsState, stalledSearchDelay = _ref.stalledSearchDelay; var helper = algoliasearchHelper_1(searchClient, indexName, _objectSpread({}, HIGHLIGHT_TAGS)); addAlgoliaAgents(searchClient); helper.on('search', handleNewSearch).on('result', handleSearchSuccess({ indexId: indexName })).on('error', handleSearchError); var skip = false; var stalledSearchTimer = null; var initialSearchParameters = helper.state; var widgetsManager = createWidgetsManager(onWidgetsUpdate); hydrateSearchClient(searchClient, resultsState); var store = createStore({ widgets: initialState, metadata: [], results: hydrateResultsState(resultsState), error: null, searching: false, isSearchStalled: true, searchingForFacetValues: false }); function skipSearch() { skip = true; } function updateClient(client) { addAlgoliaAgents(client); helper.setClient(client); search(); } function clearCache() { helper.clearCache(); search(); } function getMetadata(state) { return widgetsManager.getWidgets().filter(function (widget) { return Boolean(widget.getMetadata); }).map(function (widget) { return widget.getMetadata(state); }); } function getSearchParameters() { var sharedParameters = widgetsManager.getWidgets().filter(function (widget) { return Boolean(widget.getSearchParameters); }).filter(function (widget) { return !isMultiIndexContext(widget) && !isIndexWidget(widget); }).reduce(function (res, widget) { return widget.getSearchParameters(res); }, initialSearchParameters); var mainParameters = widgetsManager.getWidgets().filter(function (widget) { return Boolean(widget.getSearchParameters); }).filter(function (widget) { var targetedIndexEqualMainIndex = isMultiIndexContext(widget) && isTargetedIndexEqualIndex(widget, indexName); var subIndexEqualMainIndex = isIndexWidget(widget) && isIndexWidgetEqualIndex(widget, indexName); return targetedIndexEqualMainIndex || subIndexEqualMainIndex; }) // We have to sort the `Index` widgets first so the `index` parameter // is correctly set in the `reduce` function for the following widgets .sort(sortIndexWidgetsFirst).reduce(function (res, widget) { return widget.getSearchParameters(res); }, sharedParameters); var derivedIndices = widgetsManager.getWidgets().filter(function (widget) { return Boolean(widget.getSearchParameters); }).filter(function (widget) { var targetedIndexNotEqualMainIndex = isMultiIndexContext(widget) && !isTargetedIndexEqualIndex(widget, indexName); var subIndexNotEqualMainIndex = isIndexWidget(widget) && !isIndexWidgetEqualIndex(widget, indexName); return targetedIndexNotEqualMainIndex || subIndexNotEqualMainIndex; }) // We have to sort the `Index` widgets first so the `index` parameter // is correctly set in the `reduce` function for the following widgets .sort(sortIndexWidgetsFirst).reduce(function (indices, widget) { var indexId = isMultiIndexContext(widget) ? widget.props.indexContextValue.targetedIndex : widget.props.indexId; var widgets = indices[indexId] || []; return _objectSpread({}, indices, _defineProperty({}, indexId, widgets.concat(widget))); }, {}); var derivedParameters = Object.keys(derivedIndices).map(function (indexId) { return { parameters: derivedIndices[indexId].reduce(function (res, widget) { return widget.getSearchParameters(res); }, sharedParameters), indexId: indexId }; }); return { mainParameters: mainParameters, derivedParameters: derivedParameters }; } function search() { if (!skip) { var _getSearchParameters = getSearchParameters(), mainParameters = _getSearchParameters.mainParameters, derivedParameters = _getSearchParameters.derivedParameters; // We have to call `slice` because the method `detach` on the derived // helpers mutates the value `derivedHelpers`. The `forEach` loop does // not iterate on each value and we're not able to correctly clear the // previous derived helpers (memory leak + useless requests). helper.derivedHelpers.slice().forEach(function (derivedHelper) { // Since we detach the derived helpers on **every** new search they // won't receive intermediate results in case of a stalled search. // Only the last result is dispatched by the derived helper because // they are not detached yet: // // - a -> main helper receives results // - ap -> main helper receives results // - app -> main helper + derived helpers receive results // // The quick fix is to avoid to detatch them on search but only once they // received the results. But it means that in case of a stalled search // all the derived helpers not detached yet register a new search inside // the helper. The number grows fast in case of a bad network and it's // not deterministic. derivedHelper.detach(); }); derivedParameters.forEach(function (_ref2) { var indexId = _ref2.indexId, parameters = _ref2.parameters; var derivedHelper = helper.derive(function () { return parameters; }); derivedHelper.on('result', handleSearchSuccess({ indexId: indexId })).on('error', handleSearchError); }); helper.setState(mainParameters); helper.search(); } } function handleSearchSuccess(_ref3) { var indexId = _ref3.indexId; return function (event) { var state = store.getState(); var isDerivedHelpersEmpty = !helper.derivedHelpers.length; var results = state.results ? state.results : {}; // Switching from mono index to multi index and vice versa must reset the // results to an empty object, otherwise we keep reference of stalled and // unused results. results = !isDerivedHelpersEmpty && results.getFacetByName ? {} : results; if (!isDerivedHelpersEmpty) { results[indexId] = event.results; } else { results = event.results; } var currentState = store.getState(); var nextIsSearchStalled = currentState.isSearchStalled; if (!helper.hasPendingRequests()) { clearTimeout(stalledSearchTimer); stalledSearchTimer = null; nextIsSearchStalled = false; } var resultsFacetValues = currentState.resultsFacetValues, partialState = _objectWithoutProperties(currentState, ["resultsFacetValues"]); store.setState(_objectSpread({}, partialState, { results: results, isSearchStalled: nextIsSearchStalled, searching: false, error: null })); }; } function handleSearchError(_ref4) { var error = _ref4.error; var currentState = store.getState(); var nextIsSearchStalled = currentState.isSearchStalled; if (!helper.hasPendingRequests()) { clearTimeout(stalledSearchTimer); nextIsSearchStalled = false; } var resultsFacetValues = currentState.resultsFacetValues, partialState = _objectWithoutProperties(currentState, ["resultsFacetValues"]); store.setState(_objectSpread({}, partialState, { isSearchStalled: nextIsSearchStalled, error: error, searching: false })); } function handleNewSearch() { if (!stalledSearchTimer) { stalledSearchTimer = setTimeout(function () { var _store$getState = store.getState(), resultsFacetValues = _store$getState.resultsFacetValues, partialState = _objectWithoutProperties(_store$getState, ["resultsFacetValues"]); store.setState(_objectSpread({}, partialState, { isSearchStalled: true })); }, stalledSearchDelay); } } function hydrateSearchClient(client, results) { if (!results) { return; } if (!client._useCache || typeof client.addAlgoliaAgent !== 'function') { // This condition avoids hydrating a `searchClient` different from the // Algolia one. We also avoid to hydrate the client when the cache is // disabled. The implementation is brittle but we don't have a proper way // to detect the Algolia client at the moment. return; } if (Array.isArray(results)) { hydrateSearchClientWithMultiIndexRequest(client, results); return; } hydrateSearchClientWithSingleIndexRequest(client, results); } function hydrateSearchClientWithMultiIndexRequest(client, results) { // At the moment we don't have a proper API to hydrate the client cache from // the outside (it should come with the V4). The following code populates the // cache with a multi-index results. You can find more information about the // computation of the key inside the client (see link below). // https://github.com/algolia/algoliasearch-client-javascript/blob/c27e89ff92b2a854ae6f40dc524bffe0f0cbc169/src/AlgoliaSearchCore.js#L232-L240 var key = "/1/indexes/*/queries_body_".concat(JSON.stringify({ requests: results.reduce(function (acc, result) { return acc.concat(result.rawResults.map(function (request) { return { indexName: request.index, params: request.params }; })); }, []) })); client.cache = _objectSpread({}, client.cache, _defineProperty({}, key, JSON.stringify({ results: results.reduce(function (acc, result) { return acc.concat(result.rawResults); }, []) }))); } function hydrateSearchClientWithSingleIndexRequest(client, results) { // At the moment we don't have a proper API to hydrate the client cache from // the outside (it should come with the V4). The following code populates the // cache with a single-index result. You can find more information about the // computation of the key inside the client (see link below). // https://github.com/algolia/algoliasearch-client-javascript/blob/c27e89ff92b2a854ae6f40dc524bffe0f0cbc169/src/AlgoliaSearchCore.js#L232-L240 var key = "/1/indexes/*/queries_body_".concat(JSON.stringify({ requests: results.rawResults.map(function (request) { return { indexName: request.index, params: request.params }; }) })); client.cache = _objectSpread({}, client.cache, _defineProperty({}, key, JSON.stringify({ results: results.rawResults }))); } function hydrateResultsState(results) { if (!results) { return null; } if (Array.isArray(results)) { return results.reduce(function (acc, result) { return _objectSpread({}, acc, _defineProperty({}, result._internalIndexId, new algoliasearchHelper_1.SearchResults(new algoliasearchHelper_1.SearchParameters(result.state), result.rawResults))); }, {}); } return new algoliasearchHelper_1.SearchResults(new algoliasearchHelper_1.SearchParameters(results.state), results.rawResults); } // Called whenever a widget has been rendered with new props. function onWidgetsUpdate() { var metadata = getMetadata(store.getState().widgets); store.setState(_objectSpread({}, store.getState(), { metadata: metadata, searching: true })); // Since the `getSearchParameters` method of widgets also depends on props, // the result search parameters might have changed. search(); } function transitionState(nextSearchState) { var searchState = store.getState().widgets; return widgetsManager.getWidgets().filter(function (widget) { return Boolean(widget.transitionState); }).reduce(function (res, widget) { return widget.transitionState(searchState, res); }, nextSearchState); } function onExternalStateUpdate(nextSearchState) { var metadata = getMetadata(nextSearchState); store.setState(_objectSpread({}, store.getState(), { widgets: nextSearchState, metadata: metadata, searching: true })); search(); } function onSearchForFacetValues(_ref5) { var facetName = _ref5.facetName, query = _ref5.query, _ref5$maxFacetHits = _ref5.maxFacetHits, maxFacetHits = _ref5$maxFacetHits === void 0 ? 10 : _ref5$maxFacetHits; // The values 1, 100 are the min / max values that the engine accepts. // see: https://www.algolia.com/doc/api-reference/api-parameters/maxFacetHits var maxFacetHitsWithinRange = Math.max(1, Math.min(maxFacetHits, 100)); store.setState(_objectSpread({}, store.getState(), { searchingForFacetValues: true })); helper.searchForFacetValues(facetName, query, maxFacetHitsWithinRange).then(function (content) { var _objectSpread6; store.setState(_objectSpread({}, store.getState(), { error: null, searchingForFacetValues: false, resultsFacetValues: _objectSpread({}, store.getState().resultsFacetValues, (_objectSpread6 = {}, _defineProperty(_objectSpread6, facetName, content.facetHits), _defineProperty(_objectSpread6, "query", query), _objectSpread6)) })); }, function (error) { store.setState(_objectSpread({}, store.getState(), { searchingForFacetValues: false, error: error })); }).catch(function (error) { // Since setState is synchronous, any error that occurs in the render of a // component will be swallowed by this promise. // This is a trick to make the error show up correctly in the console. // See http://stackoverflow.com/a/30741722/969302 setTimeout(function () { throw error; }); }); } function updateIndex(newIndex) { initialSearchParameters = initialSearchParameters.setIndex(newIndex); // No need to trigger a new search here as the widgets will also update and trigger it if needed. } function getWidgetsIds() { return store.getState().metadata.reduce(function (res, meta) { return typeof meta.id !== 'undefined' ? res.concat(meta.id) : res; }, []); } return { store: store, widgetsManager: widgetsManager, getWidgetsIds: getWidgetsIds, getSearchParameters: getSearchParameters, onSearchForFacetValues: onSearchForFacetValues, onExternalStateUpdate: onExternalStateUpdate, transitionState: transitionState, updateClient: updateClient, updateIndex: updateIndex, clearCache: clearCache, skipSearch: skipSearch }; } function isControlled(props) { return Boolean(props.searchState); } /** * @description * `<InstantSearch>` is the root component of all React InstantSearch implementations. * It provides all the connected components (aka widgets) a means to interact * with the searchState. * @kind widget * @name <InstantSearch> * @requirements You will need to have an Algolia account to be able to use this widget. * [Create one now](https://www.algolia.com/users/sign_up). * @propType {string} indexName - Main index in which to search. * @propType {boolean} [refresh=false] - Flag to activate when the cache needs to be cleared so that the front-end is updated when a change occurs in the index. * @propType {object} [searchClient] - Provide a custom search client. * @propType {func} [onSearchStateChange] - Function to be called everytime a new search is done. Useful for [URL Routing](guide/Routing.html). * @propType {object} [searchState] - Object to inject some search state. Switches the InstantSearch component in controlled mode. Useful for [URL Routing](guide/Routing.html). * @propType {func} [createURL] - Function to call when creating links, useful for [URL Routing](guide/Routing.html). * @propType {SearchResults|SearchResults[]} [resultsState] - Use this to inject the results that will be used at first rendering. Those results are found by using the `findResultsState` function. Useful for [Server Side Rendering](guide/Server-side_rendering.html). * @propType {number} [stalledSearchDelay=200] - The amount of time before considering that the search takes too much time. The time is expressed in milliseconds. * @propType {{ Root: string|function, props: object }} [root] - Use this to customize the root element. Default value: `{ Root: 'div' }` * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, SearchBox, Hits } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <SearchBox /> * <Hits /> * </InstantSearch> * ); */ var InstantSearch = /*#__PURE__*/ function (_Component) { _inherits(InstantSearch, _Component); _createClass(InstantSearch, null, [{ key: "getDerivedStateFromProps", value: function getDerivedStateFromProps(nextProps, prevState) { var nextIsControlled = isControlled(nextProps); var previousSearchState = prevState.instantSearchManager.store.getState().widgets; var nextSearchState = nextProps.searchState; if (nextIsControlled && !fastDeepEqual(previousSearchState, nextSearchState)) { prevState.instantSearchManager.onExternalStateUpdate(nextProps.searchState); } return { isControlled: nextIsControlled, contextValue: _objectSpread({}, prevState.contextValue, { mainTargetedIndex: nextProps.indexName }) }; } }]); function InstantSearch(props) { var _this; _classCallCheck(this, InstantSearch); _this = _possibleConstructorReturn(this, _getPrototypeOf(InstantSearch).call(this, props)); _defineProperty(_assertThisInitialized(_this), "isUnmounting", false); var instantSearchManager = createInstantSearchManager({ indexName: _this.props.indexName, searchClient: _this.props.searchClient, initialState: _this.props.searchState || {}, resultsState: _this.props.resultsState, stalledSearchDelay: _this.props.stalledSearchDelay }); var contextValue = { store: instantSearchManager.store, widgetsManager: instantSearchManager.widgetsManager, mainTargetedIndex: _this.props.indexName, onInternalStateUpdate: _this.onWidgetsInternalStateUpdate.bind(_assertThisInitialized(_this)), createHrefForState: _this.createHrefForState.bind(_assertThisInitialized(_this)), onSearchForFacetValues: _this.onSearchForFacetValues.bind(_assertThisInitialized(_this)), onSearchStateChange: _this.onSearchStateChange.bind(_assertThisInitialized(_this)), onSearchParameters: _this.onSearchParameters.bind(_assertThisInitialized(_this)) }; _this.state = { isControlled: isControlled(_this.props), instantSearchManager: instantSearchManager, contextValue: contextValue }; return _this; } _createClass(InstantSearch, [{ key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var prevIsControlled = isControlled(prevProps); if (prevIsControlled && !this.state.isControlled) { throw new Error("You can't switch <InstantSearch> from being controlled to uncontrolled"); } if (!prevIsControlled && this.state.isControlled) { throw new Error("You can't switch <InstantSearch> from being uncontrolled to controlled"); } if (this.props.refresh !== prevProps.refresh && this.props.refresh) { this.state.instantSearchManager.clearCache(); } if (prevProps.indexName !== this.props.indexName) { this.state.instantSearchManager.updateIndex(this.props.indexName); } if (prevProps.searchClient !== this.props.searchClient) { this.state.instantSearchManager.updateClient(this.props.searchClient); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.isUnmounting = true; this.state.instantSearchManager.skipSearch(); } }, { key: "createHrefForState", value: function createHrefForState(searchState) { searchState = this.state.instantSearchManager.transitionState(searchState); return this.state.isControlled && this.props.createURL ? this.props.createURL(searchState, this.getKnownKeys()) : '#'; } }, { key: "onWidgetsInternalStateUpdate", value: function onWidgetsInternalStateUpdate(searchState) { searchState = this.state.instantSearchManager.transitionState(searchState); this.onSearchStateChange(searchState); if (!this.state.isControlled) { this.state.instantSearchManager.onExternalStateUpdate(searchState); } } }, { key: "onSearchStateChange", value: function onSearchStateChange(searchState) { if (this.props.onSearchStateChange && !this.isUnmounting) { this.props.onSearchStateChange(searchState); } } }, { key: "onSearchParameters", value: function onSearchParameters(getSearchParameters, context, props) { if (this.props.onSearchParameters) { var _searchState = this.props.searchState ? this.props.searchState : {}; this.props.onSearchParameters(getSearchParameters, context, props, _searchState); } } }, { key: "onSearchForFacetValues", value: function onSearchForFacetValues(searchState) { this.state.instantSearchManager.onSearchForFacetValues(searchState); } }, { key: "getKnownKeys", value: function getKnownKeys() { return this.state.instantSearchManager.getWidgetsIds(); } }, { key: "render", value: function render() { if (React.Children.count(this.props.children) === 0) { return null; } return React__default.createElement(InstantSearchProvider, { value: this.state.contextValue }, this.props.children); } }]); return InstantSearch; }(React.Component); _defineProperty(InstantSearch, "defaultProps", { stalledSearchDelay: 200, refresh: false }); _defineProperty(InstantSearch, "propTypes", { // @TODO: These props are currently constant. indexName: propTypes.string.isRequired, searchClient: propTypes.shape({ search: propTypes.func.isRequired, searchForFacetValues: propTypes.func, addAlgoliaAgent: propTypes.func, clearCache: propTypes.func }).isRequired, createURL: propTypes.func, refresh: propTypes.bool, searchState: propTypes.object, onSearchStateChange: propTypes.func, onSearchParameters: propTypes.func, resultsState: propTypes.oneOfType([propTypes.object, propTypes.array]), children: propTypes.node, stalledSearchDelay: propTypes.number }); var getId$2 = function getId(props) { return props.attributes[0]; }; var namespace = 'hierarchicalMenu'; function _refine(props, searchState, nextRefinement, context) { var id = getId$2(props); var nextValue = _defineProperty({}, id, nextRefinement || ''); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage, namespace); } function transformValue(values) { return values.reduce(function (acc, item) { if (item.isRefined) { acc.push({ label: item.name, // If dealing with a nested "items", "value" is equal to the previous value concatenated with the current label // If dealing with the first level, "value" is equal to the current label value: item.path }); // Create a variable in order to keep the same acc for the recursion, otherwise "reduce" returns a new one if (item.data) { acc = acc.concat(transformValue(item.data)); } } return acc; }, []); } /** * The breadcrumb component is s a type of secondary navigation scheme that * reveals the user’s location in a website or web application. * * @name connectBreadcrumb * @requirements To use this widget, your attributes must be formatted in a specific way. * If you want for example to have a Breadcrumb of categories, objects in your index * should be formatted this way: * * ```json * { * "categories.lvl0": "products", * "categories.lvl1": "products > fruits", * "categories.lvl2": "products > fruits > citrus" * } * ``` * * It's also possible to provide more than one path for each level: * * ```json * { * "categories.lvl0": ["products", "goods"], * "categories.lvl1": ["products > fruits", "goods > to eat"] * } * ``` * * All attributes passed to the `attributes` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * * @kind connector * @propType {array.<string>} attributes - List of attributes to use to generate the hierarchy of the menu. See the example for the convention to follow. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @providedPropType {function} refine - a function to toggle a refinement * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {array.<{items: object, count: number, isRefined: boolean, label: string, value: string}>} items - the list of items the Breadcrumb can display. */ var connectBreadcrumb = createConnectorWithContext({ displayName: 'AlgoliaBreadcrumb', propTypes: { attributes: function attributes(props, propName, componentName) { var isNotString = function isNotString(val) { return typeof val !== 'string'; }; if (!Array.isArray(props[propName]) || props[propName].some(isNotString) || props[propName].length < 1) { return new Error("Invalid prop ".concat(propName, " supplied to ").concat(componentName, ". Expected an Array of Strings")); } return undefined; }, transformItems: propTypes.func }, getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var id = getId$2(props); var results = getResults(searchResults, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var isFacetPresent = Boolean(results) && Boolean(results.getFacetByName(id)); if (!isFacetPresent) { return { items: [], canRefine: false }; } var values = results.getFacetValues(id); var items = values.data ? transformValue(values.data) : []; var transformedItems = props.transformItems ? props.transformItems(items) : items; return { canRefine: transformedItems.length > 0, items: transformedItems }; }, refine: function refine(props, searchState, nextRefinement) { return _refine(props, searchState, nextRefinement, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); } }); /** * connectCurrentRefinements connector provides the logic to build a widget that will * give the user the ability to remove all or some of the filters that were * set. * @name connectCurrentRefinements * @kind connector * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @propType {function} [clearsQuery=false] - Pass true to also clear the search query * @providedPropType {function} refine - a function to remove a single filter * @providedPropType {array.<{label: string, attribute: string, currentRefinement: string || object, items: array, value: function}>} items - all the filters, the `value` is to pass to the `refine` function for removing all currentrefinements, `label` is for the display. When existing several refinements for the same atribute name, then you get a nested `items` object that contains a `label` and a `value` function to use to remove a single filter. `attribute` and `currentRefinement` are metadata containing row values. * @providedPropType {string} query - the search query */ var connectCurrentRefinements = createConnectorWithContext({ displayName: 'AlgoliaCurrentRefinements', propTypes: { transformItems: propTypes.func }, getProvidedProps: function getProvidedProps(props, searchState, searchResults, metadata) { var items = metadata.reduce(function (res, meta) { if (typeof meta.items !== 'undefined') { if (!props.clearsQuery && meta.id === 'query') { return res; } else { if (props.clearsQuery && meta.id === 'query' && meta.items[0].currentRefinement === '') { return res; } return res.concat(meta.items.map(function (item) { return _objectSpread({}, item, { id: meta.id, index: meta.index }); })); } } return res; }, []); var transformedItems = props.transformItems ? props.transformItems(items) : items; return { items: transformedItems, canRefine: transformedItems.length > 0 }; }, refine: function refine(props, searchState, items) { // `value` corresponds to our internal clear function computed in each connector metadata. var refinementsToClear = items instanceof Array ? items.map(function (item) { return item.value; }) : [items]; return refinementsToClear.reduce(function (res, clear) { return clear(res); }, searchState); } }); var getId$3 = function getId(props) { return props.attributes[0]; }; var namespace$1 = 'hierarchicalMenu'; function getCurrentRefinement(props, searchState, context) { var currentRefinement = getCurrentRefinementValue(props, searchState, context, "".concat(namespace$1, ".").concat(getId$3(props)), null); if (currentRefinement === '') { return null; } return currentRefinement; } function getValue(path, props, searchState, context) { var id = props.id, attributes = props.attributes, separator = props.separator, rootPath = props.rootPath, showParentLevel = props.showParentLevel; var currentRefinement = getCurrentRefinement(props, searchState, context); var nextRefinement; if (currentRefinement === null) { nextRefinement = path; } else { var tmpSearchParameters = new algoliasearchHelper_1.SearchParameters({ hierarchicalFacets: [{ name: id, attributes: attributes, separator: separator, rootPath: rootPath, showParentLevel: showParentLevel }] }); nextRefinement = tmpSearchParameters.toggleHierarchicalFacetRefinement(id, currentRefinement).toggleHierarchicalFacetRefinement(id, path).getHierarchicalRefinement(id)[0]; } return nextRefinement; } function transformValue$1(value, props, searchState, context) { return value.map(function (v) { return { label: v.name, value: getValue(v.path, props, searchState, context), count: v.count, isRefined: v.isRefined, items: v.data && transformValue$1(v.data, props, searchState, context) }; }); } var truncate = function truncate() { var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10; return items.slice(0, limit).map(function () { var item = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return Array.isArray(item.items) ? _objectSpread({}, item, { items: truncate(item.items, limit) }) : item; }); }; function _refine$1(props, searchState, nextRefinement, context) { var id = getId$3(props); var nextValue = _defineProperty({}, id, nextRefinement || ''); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage, namespace$1); } function _cleanUp(props, searchState, context) { return cleanUpValue(searchState, context, "".concat(namespace$1, ".").concat(getId$3(props))); } var sortBy = ['name:asc']; /** * connectHierarchicalMenu connector provides the logic to build a widget that will * give the user the ability to explore a tree-like structure. * This is commonly used for multi-level categorization of products on e-commerce * websites. From a UX point of view, we suggest not displaying more than two levels deep. * @name connectHierarchicalMenu * @requirements To use this widget, your attributes must be formatted in a specific way. * If you want for example to have a hiearchical menu of categories, objects in your index * should be formatted this way: * * ```json * { * "categories.lvl0": "products", * "categories.lvl1": "products > fruits", * "categories.lvl2": "products > fruits > citrus" * } * ``` * * It's also possible to provide more than one path for each level: * * ```json * { * "categories.lvl0": ["products", "goods"], * "categories.lvl1": ["products > fruits", "goods > to eat"] * } * ``` * * All attributes passed to the `attributes` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * * @kind connector * @propType {array.<string>} attributes - List of attributes to use to generate the hierarchy of the menu. See the example for the convention to follow. * @propType {string} [defaultRefinement] - the item value selected by default * @propType {boolean} [showMore=false] - Flag to activate the show more button, for toggling the number of items between limit and showMoreLimit. * @propType {number} [limit=10] - The maximum number of items displayed. * @propType {number} [showMoreLimit=20] - The maximum number of items displayed when the user triggers the show more. Not considered if `showMore` is false. * @propType {string} [separator='>'] - Specifies the level separator used in the data. * @propType {string} [rootPath=null] - The path to use if the first level is not the root level. * @propType {boolean} [showParentLevel=true] - Flag to set if the parent level should be displayed. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @providedPropType {function} refine - a function to toggle a refinement * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string} currentRefinement - the refinement currently applied * @providedPropType {array.<{items: object, count: number, isRefined: boolean, label: string, value: string}>} items - the list of items the HierarchicalMenu can display. items has the same shape as parent items. */ var connectHierarchicalMenu = createConnectorWithContext({ displayName: 'AlgoliaHierarchicalMenu', propTypes: { attributes: function attributes(props, propName, componentName) { var isNotString = function isNotString(val) { return typeof val !== 'string'; }; if (!Array.isArray(props[propName]) || props[propName].some(isNotString) || props[propName].length < 1) { return new Error("Invalid prop ".concat(propName, " supplied to ").concat(componentName, ". Expected an Array of Strings")); } return undefined; }, separator: propTypes.string, rootPath: propTypes.string, showParentLevel: propTypes.bool, defaultRefinement: propTypes.string, showMore: propTypes.bool, limit: propTypes.number, showMoreLimit: propTypes.number, transformItems: propTypes.func }, defaultProps: { showMore: false, limit: 10, showMoreLimit: 20, separator: ' > ', rootPath: null, showParentLevel: true }, getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var showMore = props.showMore, limit = props.limit, showMoreLimit = props.showMoreLimit; var id = getId$3(props); var results = getResults(searchResults, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var isFacetPresent = Boolean(results) && Boolean(results.getFacetByName(id)); if (!isFacetPresent) { return { items: [], currentRefinement: getCurrentRefinement(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), canRefine: false }; } var itemsLimit = showMore ? showMoreLimit : limit; var value = results.getFacetValues(id, { sortBy: sortBy }); var items = value.data ? transformValue$1(value.data, props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }) : []; var transformedItems = props.transformItems ? props.transformItems(items) : items; return { items: truncate(transformedItems, itemsLimit), currentRefinement: getCurrentRefinement(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), canRefine: transformedItems.length > 0 }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$1(props, searchState, nextRefinement, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, cleanUp: function cleanUp(props, searchState) { return _cleanUp(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var attributes = props.attributes, separator = props.separator, rootPath = props.rootPath, showParentLevel = props.showParentLevel, showMore = props.showMore, limit = props.limit, showMoreLimit = props.showMoreLimit, contextValue = props.contextValue; var id = getId$3(props); var itemsLimit = showMore ? showMoreLimit : limit; searchParameters = searchParameters.addHierarchicalFacet({ name: id, attributes: attributes, separator: separator, rootPath: rootPath, showParentLevel: showParentLevel }).setQueryParameters({ maxValuesPerFacet: Math.max(searchParameters.maxValuesPerFacet || 0, itemsLimit) }); var currentRefinement = getCurrentRefinement(props, searchState, { ais: contextValue, multiIndexContext: props.indexContextValue }); if (currentRefinement !== null) { searchParameters = searchParameters.toggleHierarchicalFacetRefinement(id, currentRefinement); } return searchParameters; }, getMetadata: function getMetadata(props, searchState) { var rootAttribute = props.attributes[0]; var id = getId$3(props); var currentRefinement = getCurrentRefinement(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var items = !currentRefinement ? [] : [{ label: "".concat(rootAttribute, ": ").concat(currentRefinement), attribute: rootAttribute, value: function value(nextState) { return _refine$1(props, nextState, '', { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, currentRefinement: currentRefinement }]; return { id: id, index: getIndexId({ ais: props.contextValue, multiIndexContext: props.indexContextValue }), items: items }; } }); var highlight = function highlight(_ref) { var attribute = _ref.attribute, hit = _ref.hit, highlightProperty = _ref.highlightProperty, _ref$preTag = _ref.preTag, preTag = _ref$preTag === void 0 ? HIGHLIGHT_TAGS.highlightPreTag : _ref$preTag, _ref$postTag = _ref.postTag, postTag = _ref$postTag === void 0 ? HIGHLIGHT_TAGS.highlightPostTag : _ref$postTag; return parseAlgoliaHit({ attribute: attribute, highlightProperty: highlightProperty, hit: hit, preTag: preTag, postTag: postTag }); }; /** * connectHighlight connector provides the logic to create an highlighter * component that will retrieve, parse and render an highlighted attribute * from an Algolia hit. * @name connectHighlight * @kind connector * @category connector * @providedPropType {function} highlight - function to retrieve and parse an attribute from a hit. It takes a configuration object with 3 attributes: `highlightProperty` which is the property that contains the highlight structure from the records, `attribute` which is the name of the attribute (it can be either a string or an array of strings) to look for and `hit` which is the hit from Algolia. It returns an array of objects `{value: string, isHighlighted: boolean}`. If the element that corresponds to the attribute is an array of strings, it will return a nested array of objects. * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, SearchBox, Hits, connectHighlight } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const CustomHighlight = connectHighlight( * ({ highlight, attribute, hit, highlightProperty }) => { * const highlights = highlight({ * highlightProperty: '_highlightResult', * attribute, * hit * }); * * return highlights.map(part => part.isHighlighted ? ( * <mark>{part.value}</mark> * ) : ( * <span>{part.value}</span> * )); * } * ); * * const Hit = ({ hit }) => ( * <p> * <CustomHighlight attribute="name" hit={hit} /> * </p> * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <SearchBox defaultRefinement="pho" /> * <Hits hitComponent={Hit} /> * </InstantSearch> * ); */ var connectHighlight = createConnectorWithContext({ displayName: 'AlgoliaHighlighter', propTypes: {}, getProvidedProps: function getProvidedProps() { return { highlight: highlight }; } }); /** * connectHits connector provides the logic to create connected * components that will render the results retrieved from * Algolia. * * To configure the number of hits retrieved, use [HitsPerPage widget](widgets/HitsPerPage.html), * [connectHitsPerPage connector](connectors/connectHitsPerPage.html) or pass the hitsPerPage * prop to a [Configure](guide/Search_parameters.html) widget. * * **Warning:** you will need to use the **objectID** property available on every hit as a key * when iterating over them. This will ensure you have the best possible UI experience * especially on slow networks. * @name connectHits * @kind connector * @providedPropType {array.<object>} hits - the records that matched the search state * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, Highlight, connectHits } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * const CustomHits = connectHits(({ hits }) => ( * <div> * {hits.map(hit => * <p key={hit.objectID}> * <Highlight attribute="name" hit={hit} /> * </p> * )} * </div> * )); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <CustomHits /> * </InstantSearch> * ); */ var connectHits = createConnectorWithContext({ displayName: 'AlgoliaHits', getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var results = getResults(searchResults, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); if (!results) { return { hits: [] }; } var hitsWithPositions = addAbsolutePositions(results.hits, results.hitsPerPage, results.page); var hitsWithPositionsAndQueryID = addQueryID(hitsWithPositions, results.queryID); return { hits: hitsWithPositionsAndQueryID }; }, /** * Hits needs to be considered as a widget to trigger a search, * even if no other widgets are used. * * To be considered as a widget you need either: * - getSearchParameters * - getMetadata * - transitionState * * See: createConnector.tsx */ getSearchParameters: function getSearchParameters(searchParameters) { return searchParameters; } }); function getId$4() { return 'hitsPerPage'; } function getCurrentRefinement$1(props, searchState, context) { var id = getId$4(); var currentRefinement = getCurrentRefinementValue(props, searchState, context, id, null); if (typeof currentRefinement === 'string') { return parseInt(currentRefinement, 10); } return currentRefinement; } /** * connectHitsPerPage connector provides the logic to create connected * components that will allow a user to choose to display more or less results from Algolia. * @name connectHitsPerPage * @kind connector * @propType {number} defaultRefinement - The number of items selected by default * @propType {{value: number, label: string}[]} items - List of hits per page options. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @providedPropType {function} refine - a function to remove a single filter * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string} currentRefinement - the refinement currently applied * @providedPropType {array.<{isRefined: boolean, label?: string, value: number}>} items - the list of items the HitsPerPage can display. If no label provided, the value will be displayed. */ var connectHitsPerPage = createConnectorWithContext({ displayName: 'AlgoliaHitsPerPage', propTypes: { defaultRefinement: propTypes.number.isRequired, items: propTypes.arrayOf(propTypes.shape({ label: propTypes.string, value: propTypes.number.isRequired })).isRequired, transformItems: propTypes.func }, getProvidedProps: function getProvidedProps(props, searchState) { var currentRefinement = getCurrentRefinement$1(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var items = props.items.map(function (item) { return item.value === currentRefinement ? _objectSpread({}, item, { isRefined: true }) : _objectSpread({}, item, { isRefined: false }); }); return { items: props.transformItems ? props.transformItems(items) : items, currentRefinement: currentRefinement }; }, refine: function refine(props, searchState, nextRefinement) { var id = getId$4(); var nextValue = _defineProperty({}, id, nextRefinement); var resetPage = true; return refineValue(searchState, nextValue, { ais: props.contextValue, multiIndexContext: props.indexContextValue }, resetPage); }, cleanUp: function cleanUp(props, searchState) { return cleanUpValue(searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }, getId$4()); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { return searchParameters.setHitsPerPage(getCurrentRefinement$1(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue })); }, getMetadata: function getMetadata() { return { id: getId$4() }; } }); function getId$5() { return 'page'; } function getCurrentRefinement$2(props, searchState, context) { var id = getId$5(); var page = 1; var currentRefinement = getCurrentRefinementValue(props, searchState, context, id, page); if (typeof currentRefinement === 'string') { return parseInt(currentRefinement, 10); } return currentRefinement; } /** * InfiniteHits connector provides the logic to create connected * components that will render an continuous list of results retrieved from * Algolia. This connector provides a function to load more results. * @name connectInfiniteHits * @kind connector * @providedPropType {array.<object>} hits - the records that matched the search state * @providedPropType {boolean} hasMore - indicates if there are more pages to load * @providedPropType {function} refine - call to load more results */ var connectInfiniteHits = createConnectorWithContext({ displayName: 'AlgoliaInfiniteHits', getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var _this = this; var results = getResults(searchResults, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); this._allResults = this._allResults || []; this._prevState = this._prevState || {}; if (!results) { return { hits: [], hasPrevious: false, hasMore: false, refine: function refine() {}, refinePrevious: function refinePrevious() {}, refineNext: function refineNext() {} }; } var page = results.page, hits = results.hits, hitsPerPage = results.hitsPerPage, nbPages = results.nbPages, _results$_state = results._state; _results$_state = _results$_state === void 0 ? {} : _results$_state; var p = _results$_state.page, currentState = _objectWithoutProperties(_results$_state, ["page"]); var hitsWithPositions = addAbsolutePositions(hits, hitsPerPage, page); var hitsWithPositionsAndQueryID = addQueryID(hitsWithPositions, results.queryID); if (this._firstReceivedPage === undefined || !fastDeepEqual(currentState, this._prevState)) { this._allResults = _toConsumableArray(hitsWithPositionsAndQueryID); this._firstReceivedPage = page; this._lastReceivedPage = page; } else if (this._lastReceivedPage < page) { this._allResults = [].concat(_toConsumableArray(this._allResults), _toConsumableArray(hitsWithPositionsAndQueryID)); this._lastReceivedPage = page; } else if (this._firstReceivedPage > page) { this._allResults = [].concat(_toConsumableArray(hitsWithPositionsAndQueryID), _toConsumableArray(this._allResults)); this._firstReceivedPage = page; } this._prevState = currentState; var hasPrevious = this._firstReceivedPage > 0; var lastPageIndex = nbPages - 1; var hasMore = page < lastPageIndex; var refinePrevious = function refinePrevious(event) { return _this.refine(event, _this._firstReceivedPage - 1); }; var refineNext = function refineNext(event) { return _this.refine(event, _this._lastReceivedPage + 1); }; return { hits: this._allResults, hasPrevious: hasPrevious, hasMore: hasMore, refinePrevious: refinePrevious, refineNext: refineNext }; }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { return searchParameters.setQueryParameters({ page: getCurrentRefinement$2(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }) - 1 }); }, refine: function refine(props, searchState, event, index) { if (index === undefined && this._lastReceivedPage !== undefined) { index = this._lastReceivedPage + 1; } else if (index === undefined) { index = getCurrentRefinement$2(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); } var id = getId$5(); var nextValue = _defineProperty({}, id, index + 1); var resetPage = false; return refineValue(searchState, nextValue, { ais: props.contextValue, multiIndexContext: props.indexContextValue }, resetPage); } }); var namespace$2 = 'menu'; function getId$6(props) { return props.attribute; } function getCurrentRefinement$3(props, searchState, context) { var currentRefinement = getCurrentRefinementValue(props, searchState, context, "".concat(namespace$2, ".").concat(getId$6(props)), null); if (currentRefinement === '') { return null; } return currentRefinement; } function getValue$1(name, props, searchState, context) { var currentRefinement = getCurrentRefinement$3(props, searchState, context); return name === currentRefinement ? '' : name; } function getLimit(_ref) { var showMore = _ref.showMore, limit = _ref.limit, showMoreLimit = _ref.showMoreLimit; return showMore ? showMoreLimit : limit; } function _refine$2(props, searchState, nextRefinement, context) { var id = getId$6(props); var nextValue = _defineProperty({}, id, nextRefinement ? nextRefinement : ''); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage, namespace$2); } function _cleanUp$1(props, searchState, context) { return cleanUpValue(searchState, context, "".concat(namespace$2, ".").concat(getId$6(props))); } var defaultSortBy = ['count:desc', 'name:asc']; /** * connectMenu connector provides the logic to build a widget that will * give the user the ability to choose a single value for a specific facet. * @name connectMenu * @requirements The attribute passed to the `attribute` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * @kind connector * @propType {string} attribute - the name of the attribute in the record * @propType {boolean} [showMore=false] - true if the component should display a button that will expand the number of items * @propType {number} [limit=10] - the minimum number of diplayed items * @propType {number} [showMoreLimit=20] - the maximun number of displayed items. Only used when showMore is set to `true` * @propType {string} [defaultRefinement] - the value of the item selected by default * @propType {boolean} [searchable=false] - allow search inside values * @providedPropType {function} refine - a function to toggle a refinement * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string} currentRefinement - the refinement currently applied * @providedPropType {array.<{count: number, isRefined: boolean, label: string, value: string}>} items - the list of items the Menu can display. * @providedPropType {function} searchForItems - a function to toggle a search inside items values * @providedPropType {boolean} isFromSearch - a boolean that says if the `items` props contains facet values from the global search or from the search inside items. */ var connectMenu = createConnectorWithContext({ displayName: 'AlgoliaMenu', propTypes: { attribute: propTypes.string.isRequired, showMore: propTypes.bool, limit: propTypes.number, showMoreLimit: propTypes.number, defaultRefinement: propTypes.string, transformItems: propTypes.func, searchable: propTypes.bool }, defaultProps: { showMore: false, limit: 10, showMoreLimit: 20 }, getProvidedProps: function getProvidedProps(props, searchState, searchResults, meta, searchForFacetValuesResults) { var attribute = props.attribute, searchable = props.searchable, indexContextValue = props.indexContextValue; var results = getResults(searchResults, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var canRefine = Boolean(results) && Boolean(results.getFacetByName(attribute)); var isFromSearch = Boolean(searchForFacetValuesResults && searchForFacetValuesResults[attribute] && searchForFacetValuesResults.query !== ''); // Search For Facet Values is not available with derived helper (used for multi index search) if (searchable && indexContextValue) { throw new Error('react-instantsearch: searching in *List is not available when used inside a' + ' multi index context'); } if (!canRefine) { return { items: [], currentRefinement: getCurrentRefinement$3(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), isFromSearch: isFromSearch, searchable: searchable, canRefine: canRefine }; } var items; if (isFromSearch) { items = searchForFacetValuesResults[attribute].map(function (v) { return { label: v.value, value: getValue$1(v.value, props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), _highlightResult: { label: { value: v.highlighted } }, count: v.count, isRefined: v.isRefined }; }); } else { items = results.getFacetValues(attribute, { sortBy: searchable ? undefined : defaultSortBy }).map(function (v) { return { label: v.name, value: getValue$1(v.name, props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), count: v.count, isRefined: v.isRefined }; }); } var transformedItems = props.transformItems ? props.transformItems(items) : items; return { items: transformedItems.slice(0, getLimit(props)), currentRefinement: getCurrentRefinement$3(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), isFromSearch: isFromSearch, searchable: searchable, canRefine: transformedItems.length > 0 }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$2(props, searchState, nextRefinement, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, searchForFacetValues: function searchForFacetValues(props, searchState, nextRefinement) { return { facetName: props.attribute, query: nextRefinement, maxFacetHits: getLimit(props) }; }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$1(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var attribute = props.attribute; searchParameters = searchParameters.setQueryParameters({ maxValuesPerFacet: Math.max(searchParameters.maxValuesPerFacet || 0, getLimit(props)) }); searchParameters = searchParameters.addDisjunctiveFacet(attribute); var currentRefinement = getCurrentRefinement$3(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); if (currentRefinement !== null) { searchParameters = searchParameters.addDisjunctiveFacetRefinement(attribute, currentRefinement); } return searchParameters; }, getMetadata: function getMetadata(props, searchState) { var id = getId$6(props); var currentRefinement = getCurrentRefinement$3(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); return { id: id, index: getIndexId({ ais: props.contextValue, multiIndexContext: props.indexContextValue }), items: currentRefinement === null ? [] : [{ label: "".concat(props.attribute, ": ").concat(currentRefinement), attribute: props.attribute, value: function value(nextState) { return _refine$2(props, nextState, '', { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, currentRefinement: currentRefinement }] }; } }); function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _iterableToArrayLimit(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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function stringifyItem(item) { if (typeof item.start === 'undefined' && typeof item.end === 'undefined') { return ''; } var start = typeof item.start !== 'undefined' ? item.start : ''; var end = typeof item.end !== 'undefined' ? item.end : ''; return "".concat(start, ":").concat(end); } function parseItem(value) { if (value.length === 0) { return { start: null, end: null }; } var _value$split = value.split(':'), _value$split2 = _slicedToArray(_value$split, 2), startStr = _value$split2[0], endStr = _value$split2[1]; return { start: startStr.length > 0 ? parseInt(startStr, 10) : null, end: endStr.length > 0 ? parseInt(endStr, 10) : null }; } var namespace$3 = 'multiRange'; function getId$7(props) { return props.attribute; } function getCurrentRefinement$4(props, searchState, context) { return getCurrentRefinementValue(props, searchState, context, "".concat(namespace$3, ".").concat(getId$7(props)), ''); } function isRefinementsRangeIncludesInsideItemRange(stats, start, end) { return stats.min > start && stats.min < end || stats.max > start && stats.max < end; } function isItemRangeIncludedInsideRefinementsRange(stats, start, end) { return start > stats.min && start < stats.max || end > stats.min && end < stats.max; } function itemHasRefinement(attribute, results, value) { var stats = results.getFacetByName(attribute) ? results.getFacetStats(attribute) : null; var range = value.split(':'); var start = Number(range[0]) === 0 || value === '' ? Number.NEGATIVE_INFINITY : Number(range[0]); var end = Number(range[1]) === 0 || value === '' ? Number.POSITIVE_INFINITY : Number(range[1]); return !(Boolean(stats) && (isRefinementsRangeIncludesInsideItemRange(stats, start, end) || isItemRangeIncludedInsideRefinementsRange(stats, start, end))); } function _refine$3(props, searchState, nextRefinement, context) { var nextValue = _defineProperty({}, getId$7(props), nextRefinement); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage, namespace$3); } function _cleanUp$2(props, searchState, context) { return cleanUpValue(searchState, context, "".concat(namespace$3, ".").concat(getId$7(props))); } /** * connectNumericMenu connector provides the logic to build a widget that will * give the user the ability to select a range value for a numeric attribute. * Ranges are defined statically. * @name connectNumericMenu * @requirements The attribute passed to the `attribute` prop must be holding numerical values. * @kind connector * @propType {string} attribute - the name of the attribute in the records * @propType {{label: string, start: number, end: number}[]} items - List of options. With a text label, and upper and lower bounds. * @propType {string} [defaultRefinement] - the value of the item selected by default, follow the shape of a `string` with a pattern of `'{start}:{end}'`. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @providedPropType {function} refine - a function to select a range. * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string} currentRefinement - the refinement currently applied. follow the shape of a `string` with a pattern of `'{start}:{end}'` which corresponds to the current selected item. For instance, when the selected item is `{start: 10, end: 20}`, the searchState of the widget is `'10:20'`. When `start` isn't defined, the searchState of the widget is `':{end}'`, and the same way around when `end` isn't defined. However, when neither `start` nor `end` are defined, the searchState is an empty string. * @providedPropType {array.<{isRefined: boolean, label: string, value: string, isRefined: boolean, noRefinement: boolean}>} items - the list of ranges the NumericMenu can display. */ var connectNumericMenu = createConnectorWithContext({ displayName: 'AlgoliaNumericMenu', propTypes: { id: propTypes.string, attribute: propTypes.string.isRequired, items: propTypes.arrayOf(propTypes.shape({ label: propTypes.node, start: propTypes.number, end: propTypes.number })).isRequired, transformItems: propTypes.func }, getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var attribute = props.attribute; var currentRefinement = getCurrentRefinement$4(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var results = getResults(searchResults, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var items = props.items.map(function (item) { var value = stringifyItem(item); return { label: item.label, value: value, isRefined: value === currentRefinement, noRefinement: results ? itemHasRefinement(getId$7(props), results, value) : false }; }); var stats = results && results.getFacetByName(attribute) ? results.getFacetStats(attribute) : null; var refinedItem = find(items, function (item) { return item.isRefined === true; }); if (!items.some(function (item) { return item.value === ''; })) { items.push({ value: '', isRefined: refinedItem === undefined, noRefinement: !stats, label: 'All' }); } var transformedItems = props.transformItems ? props.transformItems(items) : items; return { items: transformedItems, currentRefinement: currentRefinement, canRefine: transformedItems.length > 0 && transformedItems.some(function (item) { return item.noRefinement === false; }) }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$3(props, searchState, nextRefinement, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$2(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var attribute = props.attribute; var _parseItem = parseItem(getCurrentRefinement$4(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue })), start = _parseItem.start, end = _parseItem.end; searchParameters = searchParameters.addDisjunctiveFacet(attribute); if (typeof start === 'number') { searchParameters = searchParameters.addNumericRefinement(attribute, '>=', start); } if (typeof end === 'number') { searchParameters = searchParameters.addNumericRefinement(attribute, '<=', end); } return searchParameters; }, getMetadata: function getMetadata(props, searchState) { var id = getId$7(props); var value = getCurrentRefinement$4(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var items = []; var index = getIndexId({ ais: props.contextValue, multiIndexContext: props.indexContextValue }); if (value !== '') { var _find = find(props.items, function (item) { return stringifyItem(item) === value; }), label = _find.label; items.push({ label: "".concat(props.attribute, ": ").concat(label), attribute: props.attribute, currentRefinement: label, value: function value(nextState) { return _refine$3(props, nextState, '', { ais: props.contextValue, multiIndexContext: props.indexContextValue }); } }); } return { id: id, index: index, items: items }; } }); function getId$8() { return 'page'; } function getCurrentRefinement$5(props, searchState, context) { var id = getId$8(); var page = 1; var currentRefinement = getCurrentRefinementValue(props, searchState, context, id, page); if (typeof currentRefinement === 'string') { return parseInt(currentRefinement, 10); } return currentRefinement; } function _refine$4(props, searchState, nextPage, context) { var id = getId$8(); var nextValue = _defineProperty({}, id, nextPage); var resetPage = false; return refineValue(searchState, nextValue, context, resetPage); } /** * connectPagination connector provides the logic to build a widget that will * let the user displays hits corresponding to a certain page. * @name connectPagination * @kind connector * @propType {boolean} [showFirst=true] - Display the first page link. * @propType {boolean} [showLast=false] - Display the last page link. * @propType {boolean} [showPrevious=true] - Display the previous page link. * @propType {boolean} [showNext=true] - Display the next page link. * @propType {number} [padding=3] - How many page links to display around the current page. * @propType {number} [totalPages=Infinity] - Maximum number of pages to display. * @providedPropType {function} refine - a function to remove a single filter * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {number} nbPages - the total of existing pages * @providedPropType {number} currentRefinement - the page refinement currently applied */ var connectPagination = createConnectorWithContext({ displayName: 'AlgoliaPagination', getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var results = getResults(searchResults, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); if (!results) { return null; } var nbPages = results.nbPages; return { nbPages: nbPages, currentRefinement: getCurrentRefinement$5(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), canRefine: nbPages > 1 }; }, refine: function refine(props, searchState, nextPage) { return _refine$4(props, searchState, nextPage, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, cleanUp: function cleanUp(props, searchState) { return cleanUpValue(searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }, getId$8()); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { return searchParameters.setPage(getCurrentRefinement$5(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }) - 1); }, getMetadata: function getMetadata() { return { id: getId$8() }; } }); /** * connectPoweredBy connector provides the logic to build a widget that * will display a link to algolia. * @name connectPoweredBy * @kind connector * @providedPropType {string} url - the url to redirect to algolia */ var connectPoweredBy = createConnectorWithContext({ displayName: 'AlgoliaPoweredBy', getProvidedProps: function getProvidedProps() { var hostname = typeof window === 'undefined' ? '' : window.location.hostname; var url = 'https://www.algolia.com/?' + 'utm_source=react-instantsearch&' + 'utm_medium=website&' + "utm_content=".concat(hostname, "&") + 'utm_campaign=poweredby'; return { url: url }; } }); /** * connectRange connector provides the logic to create connected * components that will give the ability for a user to refine results using * a numeric range. * @name connectRange * @kind connector * @requirements The attribute passed to the `attribute` prop must be present in “attributes for faceting” * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * The values inside the attribute must be JavaScript numbers (not strings). * @propType {string} attribute - Name of the attribute for faceting * @propType {{min?: number, max?: number}} [defaultRefinement] - Default searchState of the widget containing the start and the end of the range. * @propType {number} [min] - Minimum value. When this isn't set, the minimum value will be automatically computed by Algolia using the data in the index. * @propType {number} [max] - Maximum value. When this isn't set, the maximum value will be automatically computed by Algolia using the data in the index. * @propType {number} [precision=0] - Number of digits after decimal point to use. * @providedPropType {function} refine - a function to select a range. * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string} currentRefinement - the refinement currently applied * @providedPropType {number} min - the minimum value available. * @providedPropType {number} max - the maximum value available. * @providedPropType {number} precision - Number of digits after decimal point to use. */ function getId$9(props) { return props.attribute; } var namespace$4 = 'range'; function getCurrentRange(boundaries, stats, precision) { var pow = Math.pow(10, precision); var min; if (typeof boundaries.min === 'number' && isFinite(boundaries.min)) { min = boundaries.min; } else if (typeof stats.min === 'number' && isFinite(stats.min)) { min = stats.min; } else { min = undefined; } var max; if (typeof boundaries.max === 'number' && isFinite(boundaries.max)) { max = boundaries.max; } else if (typeof stats.max === 'number' && isFinite(stats.max)) { max = stats.max; } else { max = undefined; } return { min: min !== undefined ? Math.floor(min * pow) / pow : min, max: max !== undefined ? Math.ceil(max * pow) / pow : max }; } function getCurrentRefinement$6(props, searchState, currentRange, context) { var _getCurrentRefinement = getCurrentRefinementValue(props, searchState, context, "".concat(namespace$4, ".").concat(getId$9(props)), {}), min = _getCurrentRefinement.min, max = _getCurrentRefinement.max; var isFloatPrecision = Boolean(props.precision); var nextMin = min; if (typeof nextMin === 'string') { nextMin = isFloatPrecision ? parseFloat(nextMin) : parseInt(nextMin, 10); } var nextMax = max; if (typeof nextMax === 'string') { nextMax = isFloatPrecision ? parseFloat(nextMax) : parseInt(nextMax, 10); } var refinement = { min: nextMin, max: nextMax }; var hasMinBound = props.min !== undefined; var hasMaxBound = props.max !== undefined; var hasMinRefinment = refinement.min !== undefined; var hasMaxRefinment = refinement.max !== undefined; if (hasMinBound && hasMinRefinment && refinement.min < currentRange.min) { throw Error("You can't provide min value lower than range."); } if (hasMaxBound && hasMaxRefinment && refinement.max > currentRange.max) { throw Error("You can't provide max value greater than range."); } if (hasMinBound && !hasMinRefinment) { refinement.min = currentRange.min; } if (hasMaxBound && !hasMaxRefinment) { refinement.max = currentRange.max; } return refinement; } function getCurrentRefinementWithRange(refinement, range) { return { min: refinement.min !== undefined ? refinement.min : range.min, max: refinement.max !== undefined ? refinement.max : range.max }; } function nextValueForRefinement(hasBound, isReset, range, value) { var next; if (!hasBound && range === value) { next = undefined; } else if (hasBound && isReset) { next = range; } else { next = value; } return next; } function _refine$5(props, searchState, nextRefinement, currentRange, context) { var nextMin = nextRefinement.min, nextMax = nextRefinement.max; var currentMinRange = currentRange.min, currentMaxRange = currentRange.max; var isMinReset = nextMin === undefined || nextMin === ''; var isMaxReset = nextMax === undefined || nextMax === ''; var nextMinAsNumber = !isMinReset ? parseFloat(nextMin) : undefined; var nextMaxAsNumber = !isMaxReset ? parseFloat(nextMax) : undefined; var isNextMinValid = isMinReset || isFinite(nextMinAsNumber); var isNextMaxValid = isMaxReset || isFinite(nextMaxAsNumber); if (!isNextMinValid || !isNextMaxValid) { throw Error("You can't provide non finite values to the range connector."); } if (nextMinAsNumber < currentMinRange) { throw Error("You can't provide min value lower than range."); } if (nextMaxAsNumber > currentMaxRange) { throw Error("You can't provide max value greater than range."); } var id = getId$9(props); var resetPage = true; var nextValue = _defineProperty({}, id, { min: nextValueForRefinement(props.min !== undefined, isMinReset, currentMinRange, nextMinAsNumber), max: nextValueForRefinement(props.max !== undefined, isMaxReset, currentMaxRange, nextMaxAsNumber) }); return refineValue(searchState, nextValue, context, resetPage, namespace$4); } function _cleanUp$3(props, searchState, context) { return cleanUpValue(searchState, context, "".concat(namespace$4, ".").concat(getId$9(props))); } var connectRange = createConnectorWithContext({ displayName: 'AlgoliaRange', propTypes: { id: propTypes.string, attribute: propTypes.string.isRequired, defaultRefinement: propTypes.shape({ min: propTypes.number, max: propTypes.number }), min: propTypes.number, max: propTypes.number, precision: propTypes.number, header: propTypes.node, footer: propTypes.node }, defaultProps: { precision: 0 }, getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var attribute = props.attribute, precision = props.precision, minBound = props.min, maxBound = props.max; var results = getResults(searchResults, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var hasFacet = results && results.getFacetByName(attribute); var stats = hasFacet ? results.getFacetStats(attribute) || {} : {}; var facetValues = hasFacet ? results.getFacetValues(attribute) : []; var count = facetValues.map(function (v) { return { value: v.name, count: v.count }; }); var _getCurrentRange = getCurrentRange({ min: minBound, max: maxBound }, stats, precision), rangeMin = _getCurrentRange.min, rangeMax = _getCurrentRange.max; // The searchState is not always in sync with the helper state. For example // when we set boundaries on the first render the searchState don't have // the correct refinement. If this behavior change in the upcoming version // we could store the range inside the searchState instead of rely on `this`. this._currentRange = { min: rangeMin, max: rangeMax }; var currentRefinement = getCurrentRefinement$6(props, searchState, this._currentRange, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); return { min: rangeMin, max: rangeMax, canRefine: count.length > 0, currentRefinement: getCurrentRefinementWithRange(currentRefinement, this._currentRange), count: count, precision: precision }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$5(props, searchState, nextRefinement, this._currentRange, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$3(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, getSearchParameters: function getSearchParameters(params, props, searchState) { var attribute = props.attribute; var _getCurrentRefinement2 = getCurrentRefinement$6(props, searchState, this._currentRange, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), min = _getCurrentRefinement2.min, max = _getCurrentRefinement2.max; params = params.addDisjunctiveFacet(attribute); if (min !== undefined) { params = params.addNumericRefinement(attribute, '>=', min); } if (max !== undefined) { params = params.addNumericRefinement(attribute, '<=', max); } return params; }, getMetadata: function getMetadata(props, searchState) { var _this = this; var _this$_currentRange = this._currentRange, minRange = _this$_currentRange.min, maxRange = _this$_currentRange.max; var _getCurrentRefinement3 = getCurrentRefinement$6(props, searchState, this._currentRange, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), minValue = _getCurrentRefinement3.min, maxValue = _getCurrentRefinement3.max; var items = []; var hasMin = minValue !== undefined; var hasMax = maxValue !== undefined; var shouldDisplayMinLabel = hasMin && minValue !== minRange; var shouldDisplayMaxLabel = hasMax && maxValue !== maxRange; if (shouldDisplayMinLabel || shouldDisplayMaxLabel) { var fragments = [hasMin ? "".concat(minValue, " <= ") : '', props.attribute, hasMax ? " <= ".concat(maxValue) : '']; items.push({ label: fragments.join(''), attribute: props.attribute, value: function value(nextState) { return _refine$5(props, nextState, {}, _this._currentRange, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, currentRefinement: getCurrentRefinementWithRange({ min: minValue, max: maxValue }, { min: minRange, max: maxRange }) }); } return { id: getId$9(props), index: getIndexId({ ais: props.contextValue, multiIndexContext: props.indexContextValue }), items: items }; } }); var namespace$5 = 'refinementList'; function getId$a(props) { return props.attribute; } function getCurrentRefinement$7(props, searchState, context) { var currentRefinement = getCurrentRefinementValue(props, searchState, context, "".concat(namespace$5, ".").concat(getId$a(props)), []); if (typeof currentRefinement !== 'string') { return currentRefinement; } if (currentRefinement) { return [currentRefinement]; } return []; } function getValue$2(name, props, searchState, context) { var currentRefinement = getCurrentRefinement$7(props, searchState, context); var isAnewValue = currentRefinement.indexOf(name) === -1; var nextRefinement = isAnewValue ? currentRefinement.concat([name]) // cannot use .push(), it mutates : currentRefinement.filter(function (selectedValue) { return selectedValue !== name; }); // cannot use .splice(), it mutates return nextRefinement; } function getLimit$1(_ref) { var showMore = _ref.showMore, limit = _ref.limit, showMoreLimit = _ref.showMoreLimit; return showMore ? showMoreLimit : limit; } function _refine$6(props, searchState, nextRefinement, context) { var id = getId$a(props); // Setting the value to an empty string ensures that it is persisted in // the URL as an empty value. // This is necessary in the case where `defaultRefinement` contains one // item and we try to deselect it. `nextSelected` would be an empty array, // which would not be persisted to the URL. // {foo: ['bar']} => "foo[0]=bar" // {foo: []} => "" var nextValue = _defineProperty({}, id, nextRefinement.length > 0 ? nextRefinement : ''); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage, namespace$5); } function _cleanUp$4(props, searchState, context) { return cleanUpValue(searchState, context, "".concat(namespace$5, ".").concat(getId$a(props))); } /** * connectRefinementList connector provides the logic to build a widget that will * give the user the ability to choose multiple values for a specific facet. * @name connectRefinementList * @kind connector * @requirements The attribute passed to the `attribute` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * @propType {string} attribute - the name of the attribute in the record * @propType {boolean} [searchable=false] - allow search inside values * @propType {string} [operator=or] - How to apply the refinements. Possible values: 'or' or 'and'. * @propType {boolean} [showMore=false] - true if the component should display a button that will expand the number of items * @propType {number} [limit=10] - the minimum number of displayed items * @propType {number} [showMoreLimit=20] - the maximun number of displayed items. Only used when showMore is set to `true` * @propType {string[]} defaultRefinement - the values of the items selected by default. The searchState of this widget takes the form of a list of `string`s, which correspond to the values of all selected refinements. However, when there are no refinements selected, the value of the searchState is an empty string. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @providedPropType {function} refine - a function to toggle a refinement * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string[]} currentRefinement - the refinement currently applied * @providedPropType {array.<{count: number, isRefined: boolean, label: string, value: string}>} items - the list of items the RefinementList can display. * @providedPropType {function} searchForItems - a function to toggle a search inside items values * @providedPropType {boolean} isFromSearch - a boolean that says if the `items` props contains facet values from the global search or from the search inside items. * @providedPropType {boolean} canRefine - a boolean that says whether you can refine */ var sortBy$1 = ['isRefined', 'count:desc', 'name:asc']; var connectRefinementList = createConnectorWithContext({ displayName: 'AlgoliaRefinementList', propTypes: { id: propTypes.string, attribute: propTypes.string.isRequired, operator: propTypes.oneOf(['and', 'or']), showMore: propTypes.bool, limit: propTypes.number, showMoreLimit: propTypes.number, defaultRefinement: propTypes.arrayOf(propTypes.oneOfType([propTypes.string, propTypes.number])), searchable: propTypes.bool, transformItems: propTypes.func }, defaultProps: { operator: 'or', showMore: false, limit: 10, showMoreLimit: 20 }, getProvidedProps: function getProvidedProps(props, searchState, searchResults, metadata, searchForFacetValuesResults) { var attribute = props.attribute, searchable = props.searchable, indexContextValue = props.indexContextValue; var results = getResults(searchResults, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var canRefine = Boolean(results) && Boolean(results.getFacetByName(attribute)); var isFromSearch = Boolean(searchForFacetValuesResults && searchForFacetValuesResults[attribute] && searchForFacetValuesResults.query !== ''); // Search For Facet Values is not available with derived helper (used for multi index search) if (searchable && indexContextValue) { throw new Error('react-instantsearch: searching in *List is not available when used inside a' + ' multi index context'); } if (!canRefine) { return { items: [], currentRefinement: getCurrentRefinement$7(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), canRefine: canRefine, isFromSearch: isFromSearch, searchable: searchable }; } var items = isFromSearch ? searchForFacetValuesResults[attribute].map(function (v) { return { label: v.value, value: getValue$2(v.value, props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), _highlightResult: { label: { value: v.highlighted } }, count: v.count, isRefined: v.isRefined }; }) : results.getFacetValues(attribute, { sortBy: sortBy$1 }).map(function (v) { return { label: v.name, value: getValue$2(v.name, props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), count: v.count, isRefined: v.isRefined }; }); var transformedItems = props.transformItems ? props.transformItems(items) : items; return { items: transformedItems.slice(0, getLimit$1(props)), currentRefinement: getCurrentRefinement$7(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), isFromSearch: isFromSearch, searchable: searchable, canRefine: transformedItems.length > 0 }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$6(props, searchState, nextRefinement, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, searchForFacetValues: function searchForFacetValues(props, searchState, nextRefinement) { return { facetName: props.attribute, query: nextRefinement, maxFacetHits: getLimit$1(props) }; }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$4(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var attribute = props.attribute, operator = props.operator; var addKey = operator === 'and' ? 'addFacet' : 'addDisjunctiveFacet'; var addRefinementKey = "".concat(addKey, "Refinement"); searchParameters = searchParameters.setQueryParameters({ maxValuesPerFacet: Math.max(searchParameters.maxValuesPerFacet || 0, getLimit$1(props)) }); searchParameters = searchParameters[addKey](attribute); return getCurrentRefinement$7(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }).reduce(function (res, val) { return res[addRefinementKey](attribute, val); }, searchParameters); }, getMetadata: function getMetadata(props, searchState) { var id = getId$a(props); var context = { ais: props.contextValue, multiIndexContext: props.indexContextValue }; return { id: id, index: getIndexId(context), items: getCurrentRefinement$7(props, searchState, context).length > 0 ? [{ attribute: props.attribute, label: "".concat(props.attribute, ": "), currentRefinement: getCurrentRefinement$7(props, searchState, context), value: function value(nextState) { return _refine$6(props, nextState, [], context); }, items: getCurrentRefinement$7(props, searchState, context).map(function (item) { return { label: "".concat(item), value: function value(nextState) { var nextSelectedItems = getCurrentRefinement$7(props, nextState, context).filter(function (other) { return other !== item; }); return _refine$6(props, searchState, nextSelectedItems, context); } }; }) }] : [] }; } }); /** * connectScrollTo connector provides the logic to build a widget that will * let the page scroll to a certain point. * @name connectScrollTo * @kind connector * @propType {string} [scrollOn="page"] - Widget searchState key on which to listen for changes, default to the pagination widget. * @providedPropType {any} value - the current refinement applied to the widget listened by scrollTo * @providedPropType {boolean} hasNotChanged - indicates whether the refinement came from the scrollOn argument (for instance page by default) */ var connectScrollTo = createConnectorWithContext({ displayName: 'AlgoliaScrollTo', propTypes: { scrollOn: propTypes.string }, defaultProps: { scrollOn: 'page' }, getProvidedProps: function getProvidedProps(props, searchState) { var id = props.scrollOn; var value = getCurrentRefinementValue(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }, id, null); if (!this._prevSearchState) { this._prevSearchState = {}; } // Get the subpart of the state that interest us if (hasMultipleIndices({ ais: props.contextValue, multiIndexContext: props.indexContextValue })) { searchState = searchState.indices ? searchState.indices[getIndexId({ ais: props.contextValue, multiIndexContext: props.indexContextValue })] : {}; } // if there is a change in the app that has been triggered by another element // than "props.scrollOn (id) or the Configure widget, we need to keep track of // the search state to know if there's a change in the app that was not triggered // by the props.scrollOn (id) or the Configure widget. This is useful when // using ScrollTo in combination of Pagination. As pagination can be change // by every widget, we want to scroll only if it cames from the pagination // widget itself. We also remove the configure key from the search state to // do this comparison because for now configure values are not present in the // search state before a first refinement has been made and will false the results. // See: https://github.com/algolia/react-instantsearch/issues/164 var cleanedSearchState = omit(searchState, ['configure', id]); var hasNotChanged = shallowEqual(this._prevSearchState, cleanedSearchState); this._prevSearchState = cleanedSearchState; return { value: value, hasNotChanged: hasNotChanged }; } }); function getId$b() { return 'query'; } function getCurrentRefinement$8(props, searchState, context) { var id = getId$b(); var currentRefinement = getCurrentRefinementValue(props, searchState, context, id, ''); if (currentRefinement) { return currentRefinement; } return ''; } function _refine$7(props, searchState, nextRefinement, context) { var id = getId$b(); var nextValue = _defineProperty({}, id, nextRefinement); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage); } function _cleanUp$5(props, searchState, context) { return cleanUpValue(searchState, context, getId$b()); } /** * connectSearchBox connector provides the logic to build a widget that will * let the user search for a query * @name connectSearchBox * @kind connector * @propType {string} [defaultRefinement] - Provide a default value for the query * @providedPropType {function} refine - a function to change the current query * @providedPropType {string} currentRefinement - the current query used * @providedPropType {boolean} isSearchStalled - a flag that indicates if InstantSearch has detected that searches are stalled */ var connectSearchBox = createConnectorWithContext({ displayName: 'AlgoliaSearchBox', propTypes: { defaultRefinement: propTypes.string }, getProvidedProps: function getProvidedProps(props, searchState, searchResults) { return { currentRefinement: getCurrentRefinement$8(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), isSearchStalled: searchResults.isSearchStalled }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$7(props, searchState, nextRefinement, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$5(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { return searchParameters.setQuery(getCurrentRefinement$8(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue })); }, getMetadata: function getMetadata(props, searchState) { var id = getId$b(); var currentRefinement = getCurrentRefinement$8(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); return { id: id, index: getIndexId({ ais: props.contextValue, multiIndexContext: props.indexContextValue }), items: currentRefinement === null ? [] : [{ label: "".concat(id, ": ").concat(currentRefinement), value: function value(nextState) { return _refine$7(props, nextState, '', { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, currentRefinement: currentRefinement }] }; } }); function getId$c() { return 'sortBy'; } function getCurrentRefinement$9(props, searchState, context) { var id = getId$c(); var currentRefinement = getCurrentRefinementValue(props, searchState, context, id, null); if (currentRefinement) { return currentRefinement; } return null; } /** * The connectSortBy connector provides the logic to build a widget that will * display a list of indices. This allows a user to change how the hits are being sorted. * @name connectSortBy * @requirements Algolia handles sorting by creating replica indices. [Read more about sorting](https://www.algolia.com/doc/guides/relevance/sorting/) on * the Algolia website. * @kind connector * @propType {string} defaultRefinement - The default selected index. * @propType {{value: string, label: string}[]} items - The list of indexes to search in. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @providedPropType {function} refine - a function to remove a single filter * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string[]} currentRefinement - the refinement currently applied * @providedPropType {array.<{isRefined: boolean, label?: string, value: string}>} items - the list of items the HitsPerPage can display. If no label provided, the value will be displayed. */ var connectSortBy = createConnectorWithContext({ displayName: 'AlgoliaSortBy', propTypes: { defaultRefinement: propTypes.string, items: propTypes.arrayOf(propTypes.shape({ label: propTypes.string, value: propTypes.string.isRequired })).isRequired, transformItems: propTypes.func }, getProvidedProps: function getProvidedProps(props, searchState) { var currentRefinement = getCurrentRefinement$9(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var items = props.items.map(function (item) { return item.value === currentRefinement ? _objectSpread({}, item, { isRefined: true }) : _objectSpread({}, item, { isRefined: false }); }); return { items: props.transformItems ? props.transformItems(items) : items, currentRefinement: currentRefinement }; }, refine: function refine(props, searchState, nextRefinement) { var id = getId$c(); var nextValue = _defineProperty({}, id, nextRefinement); var resetPage = true; return refineValue(searchState, nextValue, { ais: props.contextValue, multiIndexContext: props.indexContextValue }, resetPage); }, cleanUp: function cleanUp(props, searchState) { return cleanUpValue(searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }, getId$c()); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var selectedIndex = getCurrentRefinement$9(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); return searchParameters.setIndex(selectedIndex); }, getMetadata: function getMetadata() { return { id: getId$c() }; } }); /** * connectStats connector provides the logic to build a widget that will * displays algolia search statistics (hits number and processing time). * @name connectStats * @kind connector * @providedPropType {number} nbHits - number of hits returned by Algolia. * @providedPropType {number} processingTimeMS - the time in ms took by Algolia to search for results. */ var connectStats = createConnectorWithContext({ displayName: 'AlgoliaStats', getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var results = getResults(searchResults, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); if (!results) { return null; } return { nbHits: results.nbHits, processingTimeMS: results.processingTimeMS }; } }); function getId$d(props) { return props.attribute; } var namespace$6 = 'toggle'; var falsyStrings = ['0', 'false', 'null', 'undefined']; function getCurrentRefinement$a(props, searchState, context) { var currentRefinement = getCurrentRefinementValue(props, searchState, context, "".concat(namespace$6, ".").concat(getId$d(props)), false); if (falsyStrings.indexOf(currentRefinement) !== -1) { return false; } return Boolean(currentRefinement); } function _refine$8(props, searchState, nextRefinement, context) { var id = getId$d(props); var nextValue = _defineProperty({}, id, nextRefinement ? nextRefinement : false); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage, namespace$6); } function _cleanUp$6(props, searchState, context) { return cleanUpValue(searchState, context, "".concat(namespace$6, ".").concat(getId$d(props))); } /** * connectToggleRefinement connector provides the logic to build a widget that will * provides an on/off filtering feature based on an attribute value. * @name connectToggleRefinement * @kind connector * @requirements To use this widget, you'll need an attribute to toggle on. * * You can't toggle on null or not-null values. If you want to address this particular use-case you'll need to compute an * extra boolean attribute saying if the value exists or not. See this [thread](https://discourse.algolia.com/t/how-to-create-a-toggle-for-the-absence-of-a-string-attribute/2460) for more details. * * @propType {string} attribute - Name of the attribute on which to apply the `value` refinement. Required when `value` is present. * @propType {string} label - Label for the toggle. * @propType {string} value - Value of the refinement to apply on `attribute`. * @propType {boolean} [defaultRefinement=false] - Default searchState of the widget. Should the toggle be checked by default? * @providedPropType {boolean} currentRefinement - `true` when the refinement is applied, `false` otherwise * @providedPropType {object} count - an object that contains the count for `checked` and `unchecked` state * @providedPropType {function} refine - a function to toggle a refinement * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state */ var connectToggleRefinement = createConnectorWithContext({ displayName: 'AlgoliaToggle', propTypes: { label: propTypes.string.isRequired, attribute: propTypes.string.isRequired, value: propTypes.any.isRequired, filter: propTypes.func, defaultRefinement: propTypes.bool }, getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var attribute = props.attribute, value = props.value; var results = getResults(searchResults, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var currentRefinement = getCurrentRefinement$a(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var allFacetValues = results && results.getFacetByName(attribute) ? results.getFacetValues(attribute) : null; var facetValue = // Use null to always be consistent with type of the value // count: number | null allFacetValues && allFacetValues.length ? find(allFacetValues, function (item) { return item.name === value.toString(); }) : null; var facetValueCount = facetValue && facetValue.count; var allFacetValuesCount = // Use null to always be consistent with type of the value // count: number | null allFacetValues && allFacetValues.length ? allFacetValues.reduce(function (acc, item) { return acc + item.count; }, 0) : null; var canRefine = currentRefinement ? allFacetValuesCount !== null && allFacetValuesCount > 0 : facetValueCount !== null && facetValueCount > 0; var count = { checked: allFacetValuesCount, unchecked: facetValueCount }; return { currentRefinement: currentRefinement, canRefine: canRefine, count: count }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$8(props, searchState, nextRefinement, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$6(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var attribute = props.attribute, value = props.value, filter = props.filter; var checked = getCurrentRefinement$a(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var nextSearchParameters = searchParameters.addDisjunctiveFacet(attribute); if (checked) { nextSearchParameters = nextSearchParameters.addDisjunctiveFacetRefinement(attribute, value); if (filter) { nextSearchParameters = filter(nextSearchParameters); } } return nextSearchParameters; }, getMetadata: function getMetadata(props, searchState) { var id = getId$d(props); var checked = getCurrentRefinement$a(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var items = []; var index = getIndexId({ ais: props.contextValue, multiIndexContext: props.indexContextValue }); if (checked) { items.push({ label: props.label, currentRefinement: checked, attribute: props.attribute, value: function value(nextState) { return _refine$8(props, nextState, false, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); } }); } return { id: id, index: index, items: items }; } }); var classnames = createCommonjsModule(function (module) { /*! Copyright (c) 2016 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ /* global define */ (function () { var hasOwn = {}.hasOwnProperty; function classNames () { var classes = []; for (var i = 0; i < arguments.length; i++) { var arg = arguments[i]; if (!arg) continue; var argType = typeof arg; if (argType === 'string' || argType === 'number') { classes.push(arg); } else if (Array.isArray(arg)) { classes.push(classNames.apply(null, arg)); } else if (argType === 'object') { for (var key in arg) { if (hasOwn.call(arg, key) && arg[key]) { classes.push(key); } } } } return classes.join(' '); } if ( module.exports) { module.exports = classNames; } else { window.classNames = classNames; } }()); }); var createClassNames = function createClassNames(block) { var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'ais'; return function () { for (var _len = arguments.length, elements = new Array(_len), _key = 0; _key < _len; _key++) { elements[_key] = arguments[_key]; } var suitElements = elements.filter(function (element) { return element || element === ''; }).map(function (element) { var baseClassName = "".concat(prefix, "-").concat(block); return element ? "".concat(baseClassName, "-").concat(element) : baseClassName; }); return classnames(suitElements); }; }; var isSpecialClick = function isSpecialClick(event) { var isMiddleClick = event.button === 1; return Boolean(isMiddleClick || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey); }; var capitalize = function capitalize(key) { return key.length === 0 ? '' : "".concat(key[0].toUpperCase()).concat(key.slice(1)); }; // taken from InstantSearch.js/utils function range(_ref) { var _ref$start = _ref.start, start = _ref$start === void 0 ? 0 : _ref$start, end = _ref.end, _ref$step = _ref.step, step = _ref$step === void 0 ? 1 : _ref$step; // We can't divide by 0 so we re-assign the step to 1 if it happens. var limitStep = step === 0 ? 1 : step; // In some cases the array to create has a decimal length. // We therefore need to round the value. // Example: // { start: 1, end: 5000, step: 500 } // => Array length = (5000 - 1) / 500 = 9.998 var arrayLength = Math.round((end - start) / limitStep); return _toConsumableArray(Array(arrayLength)).map(function (_, current) { return (start + current) * limitStep; }); } function find$2(array, comparator) { if (!Array.isArray(array)) { return undefined; } for (var i = 0; i < array.length; i++) { if (comparator(array[i])) { return array[i]; } } return undefined; } var cx = createClassNames('Panel'); var _createContext$1 = React.createContext(function setCanRefine() {}), PanelConsumer = _createContext$1.Consumer, PanelProvider = _createContext$1.Provider; var Panel = /*#__PURE__*/ function (_Component) { _inherits(Panel, _Component); function Panel() { var _getPrototypeOf2; var _this; _classCallCheck(this, Panel); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Panel)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_this), "state", { canRefine: true }); _defineProperty(_assertThisInitialized(_this), "setCanRefine", function (nextCanRefine) { _this.setState({ canRefine: nextCanRefine }); }); return _this; } _createClass(Panel, [{ key: "render", value: function render() { var _this$props = this.props, children = _this$props.children, className = _this$props.className, header = _this$props.header, footer = _this$props.footer; var canRefine = this.state.canRefine; return React__default.createElement("div", { className: classnames(cx('', !canRefine && '-noRefinement'), className) }, header && React__default.createElement("div", { className: cx('header') }, header), React__default.createElement("div", { className: cx('body') }, React__default.createElement(PanelProvider, { value: this.setCanRefine }, children)), footer && React__default.createElement("div", { className: cx('footer') }, footer)); } }]); return Panel; }(React.Component); _defineProperty(Panel, "propTypes", { children: propTypes.node.isRequired, className: propTypes.string, header: propTypes.node, footer: propTypes.node }); _defineProperty(Panel, "defaultProps", { className: '', header: null, footer: null }); var PanelCallbackHandler = /*#__PURE__*/ function (_Component) { _inherits(PanelCallbackHandler, _Component); function PanelCallbackHandler() { _classCallCheck(this, PanelCallbackHandler); return _possibleConstructorReturn(this, _getPrototypeOf(PanelCallbackHandler).apply(this, arguments)); } _createClass(PanelCallbackHandler, [{ key: "componentDidMount", value: function componentDidMount() { this.props.setCanRefine(this.props.canRefine); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (prevProps.canRefine !== this.props.canRefine) { this.props.setCanRefine(this.props.canRefine); } } }, { key: "render", value: function render() { return this.props.children; } }]); return PanelCallbackHandler; }(React.Component); _defineProperty(PanelCallbackHandler, "propTypes", { children: propTypes.node.isRequired, canRefine: propTypes.bool.isRequired, setCanRefine: propTypes.func.isRequired }); var PanelWrapper = function PanelWrapper(_ref) { var canRefine = _ref.canRefine, children = _ref.children; return React__default.createElement(PanelConsumer, null, function (setCanRefine) { return React__default.createElement(PanelCallbackHandler, { setCanRefine: setCanRefine, canRefine: canRefine }, children); }); }; var Link = /*#__PURE__*/ function (_Component) { _inherits(Link, _Component); function Link() { var _getPrototypeOf2; var _this; _classCallCheck(this, Link); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Link)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_this), "onClick", function (e) { if (isSpecialClick(e)) { return; } _this.props.onClick(); e.preventDefault(); }); return _this; } _createClass(Link, [{ key: "render", value: function render() { return React__default.createElement("a", _extends({}, this.props, { onClick: this.onClick })); } }]); return Link; }(React.Component); _defineProperty(Link, "propTypes", { onClick: propTypes.func.isRequired }); var cx$1 = createClassNames('Breadcrumb'); var itemsPropType = propTypes.arrayOf(propTypes.shape({ label: propTypes.string.isRequired, value: propTypes.string.isRequired })); var Breadcrumb = /*#__PURE__*/ function (_Component) { _inherits(Breadcrumb, _Component); function Breadcrumb() { _classCallCheck(this, Breadcrumb); return _possibleConstructorReturn(this, _getPrototypeOf(Breadcrumb).apply(this, arguments)); } _createClass(Breadcrumb, [{ key: "render", value: function render() { var _this$props = this.props, canRefine = _this$props.canRefine, createURL = _this$props.createURL, items = _this$props.items, refine = _this$props.refine, rootURL = _this$props.rootURL, separator = _this$props.separator, translate = _this$props.translate, className = _this$props.className; var rootPath = canRefine ? React__default.createElement("li", { className: cx$1('item') }, React__default.createElement(Link, { className: cx$1('link'), onClick: function onClick() { return !rootURL ? refine() : null; }, href: rootURL ? rootURL : createURL() }, translate('rootLabel'))) : null; var breadcrumb = items.map(function (item, idx) { var isLast = idx === items.length - 1; return React__default.createElement("li", { className: cx$1('item', isLast && 'item--selected'), key: idx }, React__default.createElement("span", { className: cx$1('separator') }, separator), !isLast ? React__default.createElement(Link, { className: cx$1('link'), onClick: function onClick() { return refine(item.value); }, href: createURL(item.value) }, item.label) : item.label); }); return React__default.createElement("div", { className: classnames(cx$1('', !canRefine && '-noRefinement'), className) }, React__default.createElement("ul", { className: cx$1('list') }, rootPath, breadcrumb)); } }]); return Breadcrumb; }(React.Component); _defineProperty(Breadcrumb, "propTypes", { canRefine: propTypes.bool.isRequired, createURL: propTypes.func.isRequired, items: itemsPropType, refine: propTypes.func.isRequired, rootURL: propTypes.string, separator: propTypes.node, translate: propTypes.func.isRequired, className: propTypes.string }); _defineProperty(Breadcrumb, "defaultProps", { rootURL: null, separator: ' > ', className: '' }); var Breadcrumb$1 = translatable({ rootLabel: 'Home' })(Breadcrumb); /** * A breadcrumb is a secondary navigation scheme that allows the user to see where the current page * is in relation to the website or web application’s hierarchy. * In terms of usability, using a breadcrumb reduces the number of actions a visitor needs to take in * order to get to a higher-level page. * * If you want to select a specific refinement for your Breadcrumb component, you will need to * use a [Virtual Hierarchical Menu](https://community.algolia.com/react-instantsearch/guide/Virtual_widgets.html) * and set its defaultRefinement that will be then used by the Breadcrumb. * * @name Breadcrumb * @kind widget * @requirements Breadcrumbs are used for websites with a large amount of content organised in a hierarchical manner. * The typical example is an e-commerce website which has a large variety of products grouped into logical categories * (with categories, subcategories which also have subcategories).To use this widget, your attributes must be formatted in a specific way. * * Keep in mind that breadcrumbs shouldn’t replace effective primary navigation menus: * it is only an alternative way to navigate around the website. * * If, for instance, you would like to have a breadcrumb of categories, objects in your index * should be formatted this way: * * ```json * { * "categories.lvl0": "products", * "categories.lvl1": "products > fruits", * "categories.lvl2": "products > fruits > citrus" * } * ``` * * It's also possible to provide more than one path for each level: * * ```json * { * "categories.lvl0": ["products", "goods"], * "categories.lvl1": ["products > fruits", "goods > to eat"] * } * ``` * * All attributes passed to the `attributes` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * * @propType {array.<string>} attributes - List of attributes to use to generate the hierarchy of the menu. See the example for the convention to follow * @propType {node} [separator='>'] - Symbol used for separating hyperlinks * @propType {string} [rootURL=null] - The originating page (homepage) * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return * @themeKey ais-Breadcrumb - the root div of the widget * @themeKey ais-Breadcrumb--noRefinement - the root div of the widget when there is no refinement * @themeKey ais-Breadcrumb-list - the list of all breadcrumb items * @themeKey ais-Breadcrumb-item - the breadcrumb navigation item * @themeKey ais-Breadcrumb-item--selected - the selected breadcrumb item * @themeKey ais-Breadcrumb-separator - the separator of each breadcrumb item * @themeKey ais-Breadcrumb-link - the clickable breadcrumb element * @translationKey rootLabel - The root's label. Accepts a string * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { Breadcrumb, InstantSearch, HierarchicalMenu } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <Breadcrumb * attributes={[ * 'hierarchicalCategories.lvl0', * 'hierarchicalCategories.lvl1', * 'hierarchicalCategories.lvl2', * ]} * /> * <HierarchicalMenu * defaultRefinement="Cameras & Camcorders" * attributes={[ * 'hierarchicalCategories.lvl0', * 'hierarchicalCategories.lvl1', * 'hierarchicalCategories.lvl2', * ]} * /> * </InstantSearch> * ); */ var BreadcrumbWidget = function BreadcrumbWidget(props) { return React__default.createElement(PanelWrapper, props, React__default.createElement(Breadcrumb$1, props)); }; var Breadcrumb$2 = connectBreadcrumb(BreadcrumbWidget); var cx$2 = createClassNames('ClearRefinements'); var ClearRefinements = /*#__PURE__*/ function (_Component) { _inherits(ClearRefinements, _Component); function ClearRefinements() { _classCallCheck(this, ClearRefinements); return _possibleConstructorReturn(this, _getPrototypeOf(ClearRefinements).apply(this, arguments)); } _createClass(ClearRefinements, [{ key: "render", value: function render() { var _this$props = this.props, items = _this$props.items, canRefine = _this$props.canRefine, refine = _this$props.refine, translate = _this$props.translate, className = _this$props.className; return React__default.createElement("div", { className: classnames(cx$2(''), className) }, React__default.createElement("button", { className: cx$2('button', !canRefine && 'button--disabled'), onClick: function onClick() { return refine(items); }, disabled: !canRefine }, translate('reset'))); } }]); return ClearRefinements; }(React.Component); _defineProperty(ClearRefinements, "propTypes", { items: propTypes.arrayOf(propTypes.object).isRequired, canRefine: propTypes.bool.isRequired, refine: propTypes.func.isRequired, translate: propTypes.func.isRequired, className: propTypes.string }); _defineProperty(ClearRefinements, "defaultProps", { className: '' }); var ClearRefinements$1 = translatable({ reset: 'Clear all filters' })(ClearRefinements); /** * The ClearRefinements widget displays a button that lets the user clean every refinement applied * to the search. * @name ClearRefinements * @kind widget * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @propType {boolean} [clearsQuery=false] - Pass true to also clear the search query * @themeKey ais-ClearRefinements - the root div of the widget * @themeKey ais-ClearRefinements-button - the clickable button * @themeKey ais-ClearRefinements-button--disabled - the disabled clickable button * @translationKey reset - the clear all button value * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, ClearRefinements, RefinementList } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <ClearRefinements /> * <RefinementList * attribute="brand" * defaultRefinement={['Apple']} * /> * </InstantSearch> * ); */ var ClearRefinementsWidget = function ClearRefinementsWidget(props) { return React__default.createElement(PanelWrapper, props, React__default.createElement(ClearRefinements$1, props)); }; var ClearRefinements$2 = connectCurrentRefinements(ClearRefinementsWidget); var cx$3 = createClassNames('CurrentRefinements'); var CurrentRefinements = function CurrentRefinements(_ref) { var items = _ref.items, canRefine = _ref.canRefine, refine = _ref.refine, translate = _ref.translate, className = _ref.className; return React__default.createElement("div", { className: classnames(cx$3('', !canRefine && '-noRefinement'), className) }, React__default.createElement("ul", { className: cx$3('list', !canRefine && 'list--noRefinement') }, items.map(function (item) { return React__default.createElement("li", { key: item.label, className: cx$3('item') }, React__default.createElement("span", { className: cx$3('label') }, item.label), item.items ? item.items.map(function (nest) { return React__default.createElement("span", { key: nest.label, className: cx$3('category') }, React__default.createElement("span", { className: cx$3('categoryLabel') }, nest.label), React__default.createElement("button", { className: cx$3('delete'), onClick: function onClick() { return refine(nest.value); } }, translate('clearFilter', nest))); }) : React__default.createElement("span", { className: cx$3('category') }, React__default.createElement("button", { className: cx$3('delete'), onClick: function onClick() { return refine(item.value); } }, translate('clearFilter', item)))); }))); }; var itemPropTypes = propTypes.arrayOf(propTypes.shape({ label: propTypes.string.isRequired, value: propTypes.func.isRequired, items: function items() { return itemPropTypes.apply(void 0, arguments); } })); CurrentRefinements.defaultProps = { className: '' }; var CurrentRefinements$1 = translatable({ clearFilter: '✕' })(CurrentRefinements); /** * The CurrentRefinements widget displays the list of currently applied filters. * * It allows the user to selectively remove them. * @name CurrentRefinements * @kind widget * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @themeKey ais-CurrentRefinements - the root div of the widget * @themeKey ais-CurrentRefinements--noRefinement - the root div of the widget when there is no refinement * @themeKey ais-CurrentRefinements-list - the list of all refined items * @themeKey ais-CurrentRefinements-list--noRefinement - the list of all refined items when there is no refinement * @themeKey ais-CurrentRefinements-item - the refined list item * @themeKey ais-CurrentRefinements-button - the button of each refined list item * @themeKey ais-CurrentRefinements-label - the refined list label * @themeKey ais-CurrentRefinements-category - the category of each item * @themeKey ais-CurrentRefinements-categoryLabel - the label of each catgory * @themeKey ais-CurrentRefinements-delete - the delete button of each label * @translationKey clearFilter - the remove filter button label * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, CurrentRefinements, RefinementList } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <CurrentRefinements /> * <RefinementList * attribute="brand" * defaultRefinement={['Colors']} * /> * </InstantSearch> * ); */ var CurrentRefinementsWidget = function CurrentRefinementsWidget(props) { return React__default.createElement(PanelWrapper, props, React__default.createElement(CurrentRefinements$1, props)); }; var CurrentRefinements$2 = connectCurrentRefinements(CurrentRefinementsWidget); var cx$4 = createClassNames('SearchBox'); var defaultLoadingIndicator = React__default.createElement("svg", { width: "18", height: "18", viewBox: "0 0 38 38", xmlns: "http://www.w3.org/2000/svg", stroke: "#444", className: cx$4('loadingIcon') }, React__default.createElement("g", { fill: "none", fillRule: "evenodd" }, React__default.createElement("g", { transform: "translate(1 1)", strokeWidth: "2" }, React__default.createElement("circle", { strokeOpacity: ".5", cx: "18", cy: "18", r: "18" }), React__default.createElement("path", { d: "M36 18c0-9.94-8.06-18-18-18" }, React__default.createElement("animateTransform", { attributeName: "transform", type: "rotate", from: "0 18 18", to: "360 18 18", dur: "1s", repeatCount: "indefinite" }))))); var defaultReset = React__default.createElement("svg", { className: cx$4('resetIcon'), xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", width: "10", height: "10" }, React__default.createElement("path", { d: "M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z" })); var defaultSubmit = React__default.createElement("svg", { className: cx$4('submitIcon'), xmlns: "http://www.w3.org/2000/svg", width: "10", height: "10", viewBox: "0 0 40 40" }, React__default.createElement("path", { d: "M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z" })); var SearchBox = /*#__PURE__*/ function (_Component) { _inherits(SearchBox, _Component); function SearchBox(props) { var _this; _classCallCheck(this, SearchBox); _this = _possibleConstructorReturn(this, _getPrototypeOf(SearchBox).call(this)); _defineProperty(_assertThisInitialized(_this), "getQuery", function () { return _this.props.searchAsYouType ? _this.props.currentRefinement : _this.state.query; }); _defineProperty(_assertThisInitialized(_this), "onInputMount", function (input) { _this.input = input; if (_this.props.__inputRef) { _this.props.__inputRef(input); } }); _defineProperty(_assertThisInitialized(_this), "onKeyDown", function (e) { if (!_this.props.focusShortcuts) { return; } var shortcuts = _this.props.focusShortcuts.map(function (key) { return typeof key === 'string' ? key.toUpperCase().charCodeAt(0) : key; }); var elt = e.target || e.srcElement; var tagName = elt.tagName; if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') { // already in an input return; } var which = e.which || e.keyCode; if (shortcuts.indexOf(which) === -1) { // not the right shortcut return; } _this.input.focus(); e.stopPropagation(); e.preventDefault(); }); _defineProperty(_assertThisInitialized(_this), "onSubmit", function (e) { e.preventDefault(); e.stopPropagation(); _this.input.blur(); var _this$props = _this.props, refine = _this$props.refine, searchAsYouType = _this$props.searchAsYouType; if (!searchAsYouType) { refine(_this.getQuery()); } return false; }); _defineProperty(_assertThisInitialized(_this), "onChange", function (event) { var _this$props2 = _this.props, searchAsYouType = _this$props2.searchAsYouType, refine = _this$props2.refine, onChange = _this$props2.onChange; var value = event.target.value; if (searchAsYouType) { refine(value); } else { _this.setState({ query: value }); } if (onChange) { onChange(event); } }); _defineProperty(_assertThisInitialized(_this), "onReset", function (event) { var _this$props3 = _this.props, searchAsYouType = _this$props3.searchAsYouType, refine = _this$props3.refine, onReset = _this$props3.onReset; refine(''); _this.input.focus(); if (!searchAsYouType) { _this.setState({ query: '' }); } if (onReset) { onReset(event); } }); _this.state = { query: props.searchAsYouType ? null : props.currentRefinement }; return _this; } _createClass(SearchBox, [{ key: "componentDidMount", value: function componentDidMount() { document.addEventListener('keydown', this.onKeyDown); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { document.removeEventListener('keydown', this.onKeyDown); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (!this.props.searchAsYouType && prevProps.currentRefinement !== this.props.currentRefinement) { this.setState({ query: this.props.currentRefinement }); } } }, { key: "render", value: function render() { var _this2 = this; var _this$props4 = this.props, className = _this$props4.className, translate = _this$props4.translate, autoFocus = _this$props4.autoFocus, loadingIndicator = _this$props4.loadingIndicator, submit = _this$props4.submit, reset = _this$props4.reset; var query = this.getQuery(); var searchInputEvents = Object.keys(this.props).reduce(function (props, prop) { if (['onsubmit', 'onreset', 'onchange'].indexOf(prop.toLowerCase()) === -1 && prop.indexOf('on') === 0) { return _objectSpread({}, props, _defineProperty({}, prop, _this2.props[prop])); } return props; }, {}); var isSearchStalled = this.props.showLoadingIndicator && this.props.isSearchStalled; /* eslint-disable max-len */ return React__default.createElement("div", { className: classnames(cx$4(''), className) }, React__default.createElement("form", { noValidate: true, onSubmit: this.props.onSubmit ? this.props.onSubmit : this.onSubmit, onReset: this.onReset, className: cx$4('form', isSearchStalled && 'form--stalledSearch'), action: "", role: "search" }, React__default.createElement("input", _extends({ ref: this.onInputMount, type: "search", placeholder: translate('placeholder'), autoFocus: autoFocus, autoComplete: "off", autoCorrect: "off", autoCapitalize: "off", spellCheck: "false", required: true, maxLength: "512", value: query, onChange: this.onChange }, searchInputEvents, { className: cx$4('input') })), React__default.createElement("button", { type: "submit", title: translate('submitTitle'), className: cx$4('submit') }, submit), React__default.createElement("button", { type: "reset", title: translate('resetTitle'), className: cx$4('reset'), hidden: !query || isSearchStalled }, reset), this.props.showLoadingIndicator && React__default.createElement("span", { hidden: !isSearchStalled, className: cx$4('loadingIndicator') }, loadingIndicator))); /* eslint-enable */ } }]); return SearchBox; }(React.Component); _defineProperty(SearchBox, "propTypes", { currentRefinement: propTypes.string, className: propTypes.string, refine: propTypes.func.isRequired, translate: propTypes.func.isRequired, loadingIndicator: propTypes.node, reset: propTypes.node, submit: propTypes.node, focusShortcuts: propTypes.arrayOf(propTypes.oneOfType([propTypes.string, propTypes.number])), autoFocus: propTypes.bool, searchAsYouType: propTypes.bool, onSubmit: propTypes.func, onReset: propTypes.func, onChange: propTypes.func, isSearchStalled: propTypes.bool, showLoadingIndicator: propTypes.bool, // For testing purposes __inputRef: propTypes.func }); _defineProperty(SearchBox, "defaultProps", { currentRefinement: '', className: '', focusShortcuts: ['s', '/'], autoFocus: false, searchAsYouType: true, showLoadingIndicator: false, isSearchStalled: false, loadingIndicator: defaultLoadingIndicator, reset: defaultReset, submit: defaultSubmit }); var SearchBox$1 = translatable({ resetTitle: 'Clear the search query.', submitTitle: 'Submit your search query.', placeholder: 'Search here…' })(SearchBox); var itemsPropType$1 = propTypes.arrayOf(propTypes.shape({ value: propTypes.any, label: propTypes.node.isRequired, items: function items() { return itemsPropType$1.apply(void 0, arguments); } })); var List = /*#__PURE__*/ function (_Component) { _inherits(List, _Component); function List() { var _this; _classCallCheck(this, List); _this = _possibleConstructorReturn(this, _getPrototypeOf(List).call(this)); _defineProperty(_assertThisInitialized(_this), "onShowMoreClick", function () { _this.setState(function (state) { return { extended: !state.extended }; }); }); _defineProperty(_assertThisInitialized(_this), "getLimit", function () { var _this$props = _this.props, limit = _this$props.limit, showMoreLimit = _this$props.showMoreLimit; var extended = _this.state.extended; return extended ? showMoreLimit : limit; }); _defineProperty(_assertThisInitialized(_this), "resetQuery", function () { _this.setState({ query: '' }); }); _defineProperty(_assertThisInitialized(_this), "renderItem", function (item, resetQuery) { var itemHasChildren = item.items && Boolean(item.items.length); return React__default.createElement("li", { key: item.key || item.label, className: _this.props.cx('item', item.isRefined && 'item--selected', item.noRefinement && 'item--noRefinement', itemHasChildren && 'item--parent') }, _this.props.renderItem(item, resetQuery), itemHasChildren && React__default.createElement("ul", { className: _this.props.cx('list', 'list--child') }, item.items.slice(0, _this.getLimit()).map(function (child) { return _this.renderItem(child, item); }))); }); _this.state = { extended: false, query: '' }; return _this; } _createClass(List, [{ key: "renderShowMore", value: function renderShowMore() { var _this$props2 = this.props, showMore = _this$props2.showMore, translate = _this$props2.translate, cx = _this$props2.cx; var extended = this.state.extended; var disabled = this.props.limit >= this.props.items.length; if (!showMore) { return null; } return React__default.createElement("button", { disabled: disabled, className: cx('showMore', disabled && 'showMore--disabled'), onClick: this.onShowMoreClick }, translate('showMore', extended)); } }, { key: "renderSearchBox", value: function renderSearchBox() { var _this2 = this; var _this$props3 = this.props, cx = _this$props3.cx, searchForItems = _this$props3.searchForItems, isFromSearch = _this$props3.isFromSearch, translate = _this$props3.translate, items = _this$props3.items, selectItem = _this$props3.selectItem; var noResults = items.length === 0 && this.state.query !== '' ? React__default.createElement("div", { className: cx('noResults') }, translate('noResults')) : null; return React__default.createElement("div", { className: cx('searchBox') }, React__default.createElement(SearchBox$1, { currentRefinement: this.state.query, refine: function refine(value) { _this2.setState({ query: value }); searchForItems(value); }, focusShortcuts: [], translate: translate, onSubmit: function onSubmit(e) { e.preventDefault(); e.stopPropagation(); if (isFromSearch) { selectItem(items[0], _this2.resetQuery); } } }), noResults); } }, { key: "render", value: function render() { var _this3 = this; var _this$props4 = this.props, cx = _this$props4.cx, items = _this$props4.items, className = _this$props4.className, searchable = _this$props4.searchable, canRefine = _this$props4.canRefine; var searchBox = searchable ? this.renderSearchBox() : null; var rootClassName = classnames(cx('', !canRefine && '-noRefinement'), className); if (items.length === 0) { return React__default.createElement("div", { className: rootClassName }, searchBox); } // Always limit the number of items we show on screen, since the actual // number of retrieved items might vary with the `maxValuesPerFacet` config // option. return React__default.createElement("div", { className: rootClassName }, searchBox, React__default.createElement("ul", { className: cx('list', !canRefine && 'list--noRefinement') }, items.slice(0, this.getLimit()).map(function (item) { return _this3.renderItem(item, _this3.resetQuery); })), this.renderShowMore()); } }]); return List; }(React.Component); _defineProperty(List, "propTypes", { cx: propTypes.func.isRequired, // Only required with showMore. translate: propTypes.func, items: itemsPropType$1, renderItem: propTypes.func.isRequired, selectItem: propTypes.func, className: propTypes.string, showMore: propTypes.bool, limit: propTypes.number, showMoreLimit: propTypes.number, show: propTypes.func, searchForItems: propTypes.func, searchable: propTypes.bool, isFromSearch: propTypes.bool, canRefine: propTypes.bool }); _defineProperty(List, "defaultProps", { className: '', isFromSearch: false }); var cx$5 = createClassNames('HierarchicalMenu'); var itemsPropType$2 = propTypes.arrayOf(propTypes.shape({ label: propTypes.string.isRequired, value: propTypes.string, count: propTypes.number.isRequired, items: function items() { return itemsPropType$2.apply(void 0, arguments); } })); var HierarchicalMenu = /*#__PURE__*/ function (_Component) { _inherits(HierarchicalMenu, _Component); function HierarchicalMenu() { var _getPrototypeOf2; var _this; _classCallCheck(this, HierarchicalMenu); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(HierarchicalMenu)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_this), "renderItem", function (item) { var _this$props = _this.props, createURL = _this$props.createURL, refine = _this$props.refine; return React__default.createElement(Link, { className: cx$5('link'), onClick: function onClick() { return refine(item.value); }, href: createURL(item.value) }, React__default.createElement("span", { className: cx$5('label') }, item.label), ' ', React__default.createElement("span", { className: cx$5('count') }, item.count)); }); return _this; } _createClass(HierarchicalMenu, [{ key: "render", value: function render() { var _this$props2 = this.props, translate = _this$props2.translate, items = _this$props2.items, showMore = _this$props2.showMore, limit = _this$props2.limit, showMoreLimit = _this$props2.showMoreLimit, canRefine = _this$props2.canRefine, className = _this$props2.className; return React__default.createElement(List, { renderItem: this.renderItem, cx: cx$5, translate: translate, items: items, showMore: showMore, limit: limit, showMoreLimit: showMoreLimit, canRefine: canRefine, className: className }); } }]); return HierarchicalMenu; }(React.Component); _defineProperty(HierarchicalMenu, "propTypes", { translate: propTypes.func.isRequired, refine: propTypes.func.isRequired, createURL: propTypes.func.isRequired, canRefine: propTypes.bool.isRequired, items: itemsPropType$2, showMore: propTypes.bool, className: propTypes.string, limit: propTypes.number, showMoreLimit: propTypes.number, transformItems: propTypes.func }); _defineProperty(HierarchicalMenu, "defaultProps", { className: '' }); var HierarchicalMenu$1 = translatable({ showMore: function showMore(extended) { return extended ? 'Show less' : 'Show more'; } })(HierarchicalMenu); /** * The hierarchical menu lets the user browse attributes using a tree-like structure. * * This is commonly used for multi-level categorization of products on e-commerce * websites. From a UX point of view, we suggest not displaying more than two levels deep. * * @name HierarchicalMenu * @kind widget * @requirements To use this widget, your attributes must be formatted in a specific way. * If you want for example to have a hiearchical menu of categories, objects in your index * should be formatted this way: * * ```json * [{ * "objectID": "321432", * "name": "lemon", * "categories.lvl0": "products", * "categories.lvl1": "products > fruits", * }, * { * "objectID": "8976987", * "name": "orange", * "categories.lvl0": "products", * "categories.lvl1": "products > fruits", * }] * ``` * * It's also possible to provide more than one path for each level: * * ```json * { * "objectID": "321432", * "name": "lemon", * "categories.lvl0": ["products", "goods"], * "categories.lvl1": ["products > fruits", "goods > to eat"] * } * ``` * * All attributes passed to the `attributes` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * * @propType {array.<string>} attributes - List of attributes to use to generate the hierarchy of the menu. See the example for the convention to follow. * @propType {boolean} [showMore=false] - Flag to activate the show more button, for toggling the number of items between limit and showMoreLimit. * @propType {number} [limit=10] - The maximum number of items displayed. * @propType {number} [showMoreLimit=20] - The maximum number of items displayed when the user triggers the show more. Not considered if `showMore` is false. * @propType {string} [separator='>'] - Specifies the level separator used in the data. * @propType {string} [rootPath=null] - The path to use if the first level is not the root level. * @propType {boolean} [showParentLevel=true] - Flag to set if the parent level should be displayed. * @propType {string} [defaultRefinement] - the item value selected by default * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @themeKey ais-HierarchicalMenu - the root div of the widget * @themeKey ais-HierarchicalMenu-noRefinement - the root div of the widget when there is no refinement * @themeKey ais-HierarchicalMenu-searchBox - the search box of the widget. See [the SearchBox documentation](widgets/SearchBox.html#classnames) for the classnames and translation keys of the SearchBox. * @themeKey ais-HierarchicalMenu-list - the list of menu items * @themeKey ais-HierarchicalMenu-list--child - the child list of menu items * @themeKey ais-HierarchicalMenu-item - the menu list item * @themeKey ais-HierarchicalMenu-item--selected - the selected menu list item * @themeKey ais-HierarchicalMenu-item--parent - the menu list item containing children * @themeKey ais-HierarchicalMenu-link - the clickable menu element * @themeKey ais-HierarchicalMenu-label - the label of each item * @themeKey ais-HierarchicalMenu-count - the count of values for each item * @themeKey ais-HierarchicalMenu-showMore - the button used to display more categories * @themeKey ais-HierarchicalMenu-showMore--disabled - the disabled button used to display more categories * @translationKey showMore - The label of the show more button. Accepts one parameter, a boolean that is true if the values are expanded * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, HierarchicalMenu } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <HierarchicalMenu * attributes={[ * 'hierarchicalCategories.lvl0', * 'hierarchicalCategories.lvl1', * 'hierarchicalCategories.lvl2', * ]} * /> * </InstantSearch> * ); */ var HierarchicalMenuWidget = function HierarchicalMenuWidget(props) { return React__default.createElement(PanelWrapper, props, React__default.createElement(HierarchicalMenu$1, props)); }; var HierarchicalMenu$2 = connectHierarchicalMenu(HierarchicalMenuWidget); var Highlight = function Highlight(_ref) { var cx = _ref.cx, value = _ref.value, highlightedTagName = _ref.highlightedTagName, isHighlighted = _ref.isHighlighted, nonHighlightedTagName = _ref.nonHighlightedTagName; var TagName = isHighlighted ? highlightedTagName : nonHighlightedTagName; var className = isHighlighted ? 'highlighted' : 'nonHighlighted'; return React__default.createElement(TagName, { className: cx(className) }, value); }; var Highlighter = function Highlighter(_ref2) { var cx = _ref2.cx, hit = _ref2.hit, attribute = _ref2.attribute, highlight = _ref2.highlight, highlightProperty = _ref2.highlightProperty, tagName = _ref2.tagName, nonHighlightedTagName = _ref2.nonHighlightedTagName, separator = _ref2.separator, className = _ref2.className; var parsedHighlightedValue = highlight({ hit: hit, attribute: attribute, highlightProperty: highlightProperty }); return React__default.createElement("span", { className: classnames(cx(''), className) }, parsedHighlightedValue.map(function (item, i) { if (Array.isArray(item)) { var isLast = i === parsedHighlightedValue.length - 1; return React__default.createElement("span", { key: i }, item.map(function (element, index) { return React__default.createElement(Highlight, { cx: cx, key: index, value: element.value, highlightedTagName: tagName, nonHighlightedTagName: nonHighlightedTagName, isHighlighted: element.isHighlighted }); }), !isLast && React__default.createElement("span", { className: cx('separator') }, separator)); } return React__default.createElement(Highlight, { cx: cx, key: i, value: item.value, highlightedTagName: tagName, nonHighlightedTagName: nonHighlightedTagName, isHighlighted: item.isHighlighted }); })); }; Highlighter.defaultProps = { tagName: 'em', nonHighlightedTagName: 'span', className: '', separator: ', ' }; var cx$6 = createClassNames('Highlight'); var Highlight$1 = function Highlight(props) { return React__default.createElement(Highlighter, _extends({}, props, { highlightProperty: "_highlightResult", cx: cx$6 })); }; /** * Renders any attribute from a hit into its highlighted form when relevant. * * Read more about it in the [Highlighting results](guide/Highlighting_results.html) guide. * @name Highlight * @kind widget * @propType {string} attribute - location of the highlighted attribute in the hit (the corresponding element can be either a string or an array of strings) * @propType {object} hit - hit object containing the highlighted attribute * @propType {string} [tagName='em'] - tag to be used for highlighted parts of the hit * @propType {string} [nonHighlightedTagName='span'] - tag to be used for the parts of the hit that are not highlighted * @propType {node} [separator=',<space>'] - symbol used to separate the elements of the array in case the attribute points to an array of strings. * @themeKey ais-Highlight - root of the component * @themeKey ais-Highlight-highlighted - part of the text which is highlighted * @themeKey ais-Highlight-nonHighlighted - part of the text that is not highlighted * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, SearchBox, Hits, Highlight } from 'react-instantsearch-dom'; * * const Hit = ({ hit }) => ( * <div> * <Highlight attribute="name" hit={hit} /> * </div> * ); * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <SearchBox defaultRefinement="Pho" /> * <Hits hitComponent={Hit} /> * </InstantSearch> * ); */ var Highlight$2 = connectHighlight(Highlight$1); var cx$7 = createClassNames('Hits'); var DefaultHitComponent = function DefaultHitComponent(props) { return React__default.createElement("div", { style: { borderBottom: '1px solid #bbb', paddingBottom: '5px', marginBottom: '5px', wordBreak: 'break-all' } }, JSON.stringify(props).slice(0, 100), "..."); }; var Hits = function Hits(_ref) { var hits = _ref.hits, _ref$className = _ref.className, className = _ref$className === void 0 ? '' : _ref$className, _ref$hitComponent = _ref.hitComponent, HitComponent = _ref$hitComponent === void 0 ? DefaultHitComponent : _ref$hitComponent; return React__default.createElement("div", { className: classnames(cx$7(''), className) }, React__default.createElement("ul", { className: cx$7('list') }, hits.map(function (hit) { return React__default.createElement("li", { className: cx$7('item'), key: hit.objectID }, React__default.createElement(HitComponent, { hit: hit })); }))); }; var HitPropTypes = propTypes.shape({ objectID: propTypes.oneOfType([propTypes.string, propTypes.number]).isRequired }); /** * Displays a list of hits. * * To configure the number of hits being shown, use the [HitsPerPage widget](widgets/HitsPerPage.html), * [connectHitsPerPage connector](connectors/connectHitsPerPage.html) or the [Configure widget](widgets/Configure.html). * * @name Hits * @kind widget * @propType {Component} [hitComponent] - Component used for rendering each hit from * the results. If it is not provided the rendering defaults to displaying the * hit in its JSON form. The component will be called with a `hit` prop. * @themeKey ais-Hits - the root div of the widget * @themeKey ais-Hits-list - the list of results * @themeKey ais-Hits-item - the hit list item * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, Hits } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <Hits /> * </InstantSearch> * ); */ var Hits$1 = connectHits(Hits); var Select = /*#__PURE__*/ function (_Component) { _inherits(Select, _Component); function Select() { var _getPrototypeOf2; var _this; _classCallCheck(this, Select); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Select)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_this), "onChange", function (e) { _this.props.onSelect(e.target.value); }); return _this; } _createClass(Select, [{ key: "render", value: function render() { var _this$props = this.props, cx = _this$props.cx, items = _this$props.items, selectedItem = _this$props.selectedItem; return React__default.createElement("select", { className: cx('select'), value: selectedItem, onChange: this.onChange }, items.map(function (item) { return React__default.createElement("option", { className: cx('option'), key: item.key === undefined ? item.value : item.key, disabled: item.disabled, value: item.value }, item.label === undefined ? item.value : item.label); })); } }]); return Select; }(React.Component); _defineProperty(Select, "propTypes", { cx: propTypes.func.isRequired, onSelect: propTypes.func.isRequired, items: propTypes.arrayOf(propTypes.shape({ value: propTypes.oneOfType([propTypes.string, propTypes.number]).isRequired, key: propTypes.oneOfType([propTypes.string, propTypes.number]), label: propTypes.string, disabled: propTypes.bool })).isRequired, selectedItem: propTypes.oneOfType([propTypes.string, propTypes.number]).isRequired }); var cx$8 = createClassNames('HitsPerPage'); var HitsPerPage = /*#__PURE__*/ function (_Component) { _inherits(HitsPerPage, _Component); function HitsPerPage() { _classCallCheck(this, HitsPerPage); return _possibleConstructorReturn(this, _getPrototypeOf(HitsPerPage).apply(this, arguments)); } _createClass(HitsPerPage, [{ key: "render", value: function render() { var _this$props = this.props, items = _this$props.items, currentRefinement = _this$props.currentRefinement, refine = _this$props.refine, className = _this$props.className; return React__default.createElement("div", { className: classnames(cx$8(''), className) }, React__default.createElement(Select, { onSelect: refine, selectedItem: currentRefinement, items: items, cx: cx$8 })); } }]); return HitsPerPage; }(React.Component); _defineProperty(HitsPerPage, "propTypes", { items: propTypes.arrayOf(propTypes.shape({ value: propTypes.number.isRequired, label: propTypes.string })).isRequired, currentRefinement: propTypes.number.isRequired, refine: propTypes.func.isRequired, className: propTypes.string }); _defineProperty(HitsPerPage, "defaultProps", { className: '' }); /** * The HitsPerPage widget displays a dropdown menu to let the user change the number * of displayed hits. * * If you only want to configure the number of hits per page without * displaying a widget, you should use the `<Configure hitsPerPage={20} />` widget. See [`<Configure />` documentation](widgets/Configure.html) * * @name HitsPerPage * @kind widget * @propType {{value: number, label: string}[]} items - List of available options. * @propType {number} defaultRefinement - The number of items selected by default * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @themeKey ais-HitsPerPage - the root div of the widget * @themeKey ais-HitsPerPage-select - the select * @themeKey ais-HitsPerPage-option - the select option * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, HitsPerPage, Hits } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <HitsPerPage * defaultRefinement={5} * items={[ * { value: 5, label: 'Show 5 hits' }, * { value: 10, label: 'Show 10 hits' }, * ]} * /> * <Hits /> * </InstantSearch> * ); */ var HitsPerPage$1 = connectHitsPerPage(HitsPerPage); var cx$9 = createClassNames('InfiniteHits'); var InfiniteHits = /*#__PURE__*/ function (_Component) { _inherits(InfiniteHits, _Component); function InfiniteHits() { _classCallCheck(this, InfiniteHits); return _possibleConstructorReturn(this, _getPrototypeOf(InfiniteHits).apply(this, arguments)); } _createClass(InfiniteHits, [{ key: "render", value: function render() { var _this$props = this.props, HitComponent = _this$props.hitComponent, hits = _this$props.hits, showPrevious = _this$props.showPrevious, hasPrevious = _this$props.hasPrevious, hasMore = _this$props.hasMore, refinePrevious = _this$props.refinePrevious, refineNext = _this$props.refineNext, translate = _this$props.translate, className = _this$props.className; return React__default.createElement("div", { className: classnames(cx$9(''), className) }, showPrevious && React__default.createElement("button", { className: cx$9('loadPrevious', !hasPrevious && 'loadPrevious--disabled'), onClick: function onClick() { return refinePrevious(); }, disabled: !hasPrevious }, translate('loadPrevious')), React__default.createElement("ul", { className: cx$9('list') }, hits.map(function (hit) { return React__default.createElement("li", { key: hit.objectID, className: cx$9('item') }, React__default.createElement(HitComponent, { hit: hit })); })), React__default.createElement("button", { className: cx$9('loadMore', !hasMore && 'loadMore--disabled'), onClick: function onClick() { return refineNext(); }, disabled: !hasMore }, translate('loadMore'))); } }]); return InfiniteHits; }(React.Component); InfiniteHits.defaultProps = { className: '', showPrevious: false, hitComponent: function hitComponent(hit) { return React__default.createElement("div", { style: { borderBottom: '1px solid #bbb', paddingBottom: '5px', marginBottom: '5px', wordBreak: 'break-all' } }, JSON.stringify(hit).slice(0, 100), "..."); } }; var InfiniteHits$1 = translatable({ loadPrevious: 'Load previous', loadMore: 'Load more' })(InfiniteHits); /** * Displays an infinite list of hits along with a **load more** button. * * To configure the number of hits being shown, use the [HitsPerPage widget](widgets/HitsPerPage.html), * [connectHitsPerPage connector](connectors/connectHitsPerPage.html) or the [Configure widget](widgets/Configure.html). * * @name InfiniteHits * @kind widget * @propType {Component} [hitComponent] - Component used for rendering each hit from * the results. If it is not provided the rendering defaults to displaying the * hit in its JSON form. The component will be called with a `hit` prop. * @themeKey ais-InfiniteHits - the root div of the widget * @themeKey ais-InfiniteHits-list - the list of hits * @themeKey ais-InfiniteHits-item - the hit list item * @themeKey ais-InfiniteHits-loadMore - the button used to display more results * @themeKey ais-InfiniteHits-loadMore--disabled - the disabled button used to display more results * @translationKey loadMore - the label of load more button * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, InfiniteHits } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <InfiniteHits /> * </InstantSearch> * ); */ var InfiniteHits$2 = connectInfiniteHits(InfiniteHits$1); var cx$a = createClassNames('Menu'); var Menu = /*#__PURE__*/ function (_Component) { _inherits(Menu, _Component); function Menu() { var _getPrototypeOf2; var _this; _classCallCheck(this, Menu); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Menu)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_this), "renderItem", function (item, resetQuery) { var createURL = _this.props.createURL; var label = _this.props.isFromSearch ? React__default.createElement(Highlight$2, { attribute: "label", hit: item }) : item.label; return React__default.createElement(Link, { className: cx$a('link'), onClick: function onClick() { return _this.selectItem(item, resetQuery); }, href: createURL(item.value) }, React__default.createElement("span", { className: cx$a('label') }, label), ' ', React__default.createElement("span", { className: cx$a('count') }, item.count)); }); _defineProperty(_assertThisInitialized(_this), "selectItem", function (item, resetQuery) { resetQuery(); _this.props.refine(item.value); }); return _this; } _createClass(Menu, [{ key: "render", value: function render() { var _this$props = this.props, translate = _this$props.translate, items = _this$props.items, showMore = _this$props.showMore, limit = _this$props.limit, showMoreLimit = _this$props.showMoreLimit, isFromSearch = _this$props.isFromSearch, searchForItems = _this$props.searchForItems, searchable = _this$props.searchable, canRefine = _this$props.canRefine, className = _this$props.className; return React__default.createElement(List, { renderItem: this.renderItem, selectItem: this.selectItem, cx: cx$a, translate: translate, items: items, showMore: showMore, limit: limit, showMoreLimit: showMoreLimit, isFromSearch: isFromSearch, searchForItems: searchForItems, searchable: searchable, canRefine: canRefine, className: className }); } }]); return Menu; }(React.Component); _defineProperty(Menu, "propTypes", { translate: propTypes.func.isRequired, refine: propTypes.func.isRequired, searchForItems: propTypes.func.isRequired, searchable: propTypes.bool, createURL: propTypes.func.isRequired, items: propTypes.arrayOf(propTypes.shape({ label: propTypes.string.isRequired, value: propTypes.string.isRequired, count: propTypes.number.isRequired, isRefined: propTypes.bool.isRequired })), isFromSearch: propTypes.bool.isRequired, canRefine: propTypes.bool.isRequired, showMore: propTypes.bool, limit: propTypes.number, showMoreLimit: propTypes.number, transformItems: propTypes.func, className: propTypes.string }); _defineProperty(Menu, "defaultProps", { className: '' }); var Menu$1 = translatable({ showMore: function showMore(extended) { return extended ? 'Show less' : 'Show more'; }, noResults: 'No results', submit: null, reset: null, resetTitle: 'Clear the search query.', submitTitle: 'Submit your search query.', placeholder: 'Search here…' })(Menu); /** * The Menu component displays a menu that lets the user choose a single value for a specific attribute. * @name Menu * @kind widget * @requirements The attribute passed to the `attribute` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * * If you are using the `searchable` prop, you'll also need to make the attribute searchable using * the [dashboard](https://www.algolia.com/explorer/display/) or using the [API](https://www.algolia.com/doc/guides/searching/faceting/#search-for-facet-values). * @propType {string} attribute - the name of the attribute in the record * @propType {boolean} [showMore=false] - true if the component should display a button that will expand the number of items * @propType {number} [limit=10] - the minimum number of diplayed items * @propType {number} [showMoreLimit=20] - the maximun number of displayed items. Only used when showMore is set to `true` * @propType {string} [defaultRefinement] - the value of the item selected by default * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @propType {boolean} [searchable=false] - true if the component should display an input to search for facet values. <br> In order to make this feature work, you need to make the attribute searchable [using the API](https://www.algolia.com/doc/guides/searching/faceting/?language=js#declaring-a-searchable-attribute-for-faceting) or [the dashboard](https://www.algolia.com/explorer/display/). * @themeKey ais-Menu - the root div of the widget * @themeKey ais-Menu-searchBox - the search box of the widget. See [the SearchBox documentation](widgets/SearchBox.html#classnames) for the classnames and translation keys of the SearchBox. * @themeKey ais-Menu-list - the list of all menu items * @themeKey ais-Menu-item - the menu list item * @themeKey ais-Menu-item--selected - the selected menu list item * @themeKey ais-Menu-link - the clickable menu element * @themeKey ais-Menu-label - the label of each item * @themeKey ais-Menu-count - the count of values for each item * @themeKey ais-Menu-noResults - the div displayed when there are no results * @themeKey ais-Menu-showMore - the button used to display more categories * @themeKey ais-Menu-showMore--disabled - the disabled button used to display more categories * @translationkey showMore - The label of the show more button. Accepts one parameters, a boolean that is true if the values are expanded * @translationkey noResults - The label of the no results text when no search for facet values results are found. * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, Menu } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <Menu attribute="categories" /> * </InstantSearch> * ); */ var MenuWidget = function MenuWidget(props) { return React__default.createElement(PanelWrapper, props, React__default.createElement(Menu$1, props)); }; var Menu$2 = connectMenu(MenuWidget); var cx$b = createClassNames('MenuSelect'); var MenuSelect = /*#__PURE__*/ function (_Component) { _inherits(MenuSelect, _Component); function MenuSelect() { var _getPrototypeOf2; var _this; _classCallCheck(this, MenuSelect); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(MenuSelect)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_this), "handleSelectChange", function (_ref) { var value = _ref.target.value; _this.props.refine(value === 'ais__see__all__option' ? '' : value); }); return _this; } _createClass(MenuSelect, [{ key: "render", value: function render() { var _this$props = this.props, items = _this$props.items, canRefine = _this$props.canRefine, translate = _this$props.translate, className = _this$props.className; return React__default.createElement("div", { className: classnames(cx$b('', !canRefine && '-noRefinement'), className) }, React__default.createElement("select", { value: this.selectedValue, onChange: this.handleSelectChange, className: cx$b('select') }, React__default.createElement("option", { value: "ais__see__all__option", className: cx$b('option') }, translate('seeAllOption')), items.map(function (item) { return React__default.createElement("option", { key: item.value, value: item.value, className: cx$b('option') }, item.label, " (", item.count, ")"); }))); } }, { key: "selectedValue", get: function get() { var _ref2 = find$2(this.props.items, function (item) { return item.isRefined === true; }) || { value: 'ais__see__all__option' }, value = _ref2.value; return value; } }]); return MenuSelect; }(React.Component); _defineProperty(MenuSelect, "propTypes", { items: propTypes.arrayOf(propTypes.shape({ label: propTypes.string.isRequired, value: propTypes.string.isRequired, count: propTypes.oneOfType([propTypes.number.isRequired, propTypes.string.isRequired]), isRefined: propTypes.bool.isRequired })).isRequired, canRefine: propTypes.bool.isRequired, refine: propTypes.func.isRequired, translate: propTypes.func.isRequired, className: propTypes.string }); _defineProperty(MenuSelect, "defaultProps", { className: '' }); var MenuSelect$1 = translatable({ seeAllOption: 'See all' })(MenuSelect); /** * The MenuSelect component displays a select that lets the user choose a single value for a specific attribute. * @name MenuSelect * @kind widget * @requirements The attribute passed to the `attribute` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * @propType {string} attribute - the name of the attribute in the record * @propType {string} [defaultRefinement] - the value of the item selected by default * @propType {number} [limit=10] - the minimum number of diplayed items * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @themeKey ais-MenuSelect - the root div of the widget * @themeKey ais-MenuSelect-noRefinement - the root div of the widget when there is no refinement * @themeKey ais-MenuSelect-select - the `<select>` * @themeKey ais-MenuSelect-option - the select `<option>` * @translationkey seeAllOption - The label of the option to select to remove the refinement * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, MenuSelect } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <MenuSelect attribute="categories" /> * </InstantSearch> * ); */ var MenuSelectWidget = function MenuSelectWidget(props) { return React__default.createElement(PanelWrapper, props, React__default.createElement(MenuSelect$1, props)); }; var MenuSelect$2 = connectMenu(MenuSelectWidget); var cx$c = createClassNames('NumericMenu'); var NumericMenu = /*#__PURE__*/ function (_Component) { _inherits(NumericMenu, _Component); function NumericMenu() { var _getPrototypeOf2; var _this; _classCallCheck(this, NumericMenu); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(NumericMenu)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_this), "renderItem", function (item) { var _this$props = _this.props, refine = _this$props.refine, translate = _this$props.translate; return React__default.createElement("label", { className: cx$c('label') }, React__default.createElement("input", { className: cx$c('radio'), type: "radio", checked: item.isRefined, disabled: item.noRefinement, onChange: function onChange() { return refine(item.value); } }), React__default.createElement("span", { className: cx$c('labelText') }, item.value === '' ? translate('all') : item.label)); }); return _this; } _createClass(NumericMenu, [{ key: "render", value: function render() { var _this$props2 = this.props, items = _this$props2.items, canRefine = _this$props2.canRefine, className = _this$props2.className; return React__default.createElement(List, { renderItem: this.renderItem, showMore: false, canRefine: canRefine, cx: cx$c, items: items.map(function (item) { return _objectSpread({}, item, { key: item.value }); }), className: className }); } }]); return NumericMenu; }(React.Component); _defineProperty(NumericMenu, "propTypes", { items: propTypes.arrayOf(propTypes.shape({ label: propTypes.node.isRequired, value: propTypes.string.isRequired, isRefined: propTypes.bool.isRequired, noRefinement: propTypes.bool.isRequired })).isRequired, canRefine: propTypes.bool.isRequired, refine: propTypes.func.isRequired, translate: propTypes.func.isRequired, className: propTypes.string }); _defineProperty(NumericMenu, "defaultProps", { className: '' }); var NumericMenu$1 = translatable({ all: 'All' })(NumericMenu); /** * NumericMenu is a widget used for selecting the range value of a numeric attribute. * @name NumericMenu * @kind widget * @requirements The attribute passed to the `attribute` prop must be holding numerical values. * @propType {string} attribute - the name of the attribute in the records * @propType {{label: string, start: number, end: number}[]} items - List of options. With a text label, and upper and lower bounds. * @propType {string} [defaultRefinement] - the value of the item selected by default, follow the format "min:max". * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @themeKey ais-NumericMenu - the root div of the widget * @themeKey ais-NumericMenu--noRefinement - the root div of the widget when there is no refinement * @themeKey ais-NumericMenu-list - the list of all refinement items * @themeKey ais-NumericMenu-item - the refinement list item * @themeKey ais-NumericMenu-item--selected - the selected refinement list item * @themeKey ais-NumericMenu-label - the label of each refinement item * @themeKey ais-NumericMenu-radio - the radio input of each refinement item * @themeKey ais-NumericMenu-labelText - the label text of each refinement item * @translationkey all - The label of the largest range added automatically by react instantsearch * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, NumericMenu } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient * indexName="instant_search" * > * <NumericMenu * attribute="price" * items={[ * { end: 10, label: '< $10' }, * { start: 10, end: 100, label: '$10 - $100' }, * { start: 100, end: 500, label: '$100 - $500' }, * { start: 500, label: '> $500' }, * ]} * /> * </InstantSearch> * ); */ var NumericMenuWidget = function NumericMenuWidget(props) { return React__default.createElement(PanelWrapper, props, React__default.createElement(NumericMenu$1, props)); }; var NumericMenu$2 = connectNumericMenu(NumericMenuWidget); var LinkList = /*#__PURE__*/ function (_Component) { _inherits(LinkList, _Component); function LinkList() { _classCallCheck(this, LinkList); return _possibleConstructorReturn(this, _getPrototypeOf(LinkList).apply(this, arguments)); } _createClass(LinkList, [{ key: "render", value: function render() { var _this$props = this.props, cx = _this$props.cx, createURL = _this$props.createURL, items = _this$props.items, onSelect = _this$props.onSelect, canRefine = _this$props.canRefine; return React__default.createElement("ul", { className: cx('list', !canRefine && 'list--noRefinement') }, items.map(function (item) { return React__default.createElement("li", { key: item.key === undefined ? item.value : item.key, className: cx('item', item.selected && !item.disabled && 'item--selected', item.disabled && 'item--disabled', item.modifier) }, item.disabled ? React__default.createElement("span", { className: cx('link') }, item.label === undefined ? item.value : item.label) : React__default.createElement(Link, { className: cx('link', item.selected && 'link--selected'), "aria-label": item.ariaLabel, href: createURL(item.value), onClick: function onClick() { return onSelect(item.value); } }, item.label === undefined ? item.value : item.label)); })); } }]); return LinkList; }(React.Component); _defineProperty(LinkList, "propTypes", { cx: propTypes.func.isRequired, createURL: propTypes.func.isRequired, items: propTypes.arrayOf(propTypes.shape({ value: propTypes.oneOfType([propTypes.string, propTypes.number, propTypes.object]).isRequired, key: propTypes.oneOfType([propTypes.string, propTypes.number]), label: propTypes.node, modifier: propTypes.string, ariaLabel: propTypes.string, disabled: propTypes.bool })), onSelect: propTypes.func.isRequired, canRefine: propTypes.bool.isRequired }); var cx$d = createClassNames('Pagination'); // Determines the size of the widget (the number of pages displayed - that the user can directly click on) function calculateSize(padding, maxPages) { return Math.min(2 * padding + 1, maxPages); } function calculatePaddingLeft(currentPage, padding, maxPages, size) { if (currentPage <= padding) { return currentPage; } if (currentPage >= maxPages - padding) { return size - (maxPages - currentPage); } return padding + 1; } // Retrieve the correct page range to populate the widget function getPages(currentPage, maxPages, padding) { var size = calculateSize(padding, maxPages); // If the widget size is equal to the max number of pages, return the entire page range if (size === maxPages) return range({ start: 1, end: maxPages + 1 }); var paddingLeft = calculatePaddingLeft(currentPage, padding, maxPages, size); var paddingRight = size - paddingLeft; var first = currentPage - paddingLeft; var last = currentPage + paddingRight; return range({ start: first + 1, end: last + 1 }); } var Pagination = /*#__PURE__*/ function (_Component) { _inherits(Pagination, _Component); function Pagination() { _classCallCheck(this, Pagination); return _possibleConstructorReturn(this, _getPrototypeOf(Pagination).apply(this, arguments)); } _createClass(Pagination, [{ key: "getItem", value: function getItem(modifier, translationKey, value) { var _this$props = this.props, nbPages = _this$props.nbPages, totalPages = _this$props.totalPages, translate = _this$props.translate; return { key: "".concat(modifier, ".").concat(value), modifier: modifier, disabled: value < 1 || value >= Math.min(totalPages, nbPages), label: translate(translationKey, value), value: value, ariaLabel: translate("aria".concat(capitalize(translationKey)), value) }; } }, { key: "render", value: function render() { var _this$props2 = this.props, ListComponent = _this$props2.listComponent, nbPages = _this$props2.nbPages, totalPages = _this$props2.totalPages, currentRefinement = _this$props2.currentRefinement, padding = _this$props2.padding, showFirst = _this$props2.showFirst, showPrevious = _this$props2.showPrevious, showNext = _this$props2.showNext, showLast = _this$props2.showLast, refine = _this$props2.refine, createURL = _this$props2.createURL, canRefine = _this$props2.canRefine, translate = _this$props2.translate, className = _this$props2.className, otherProps = _objectWithoutProperties(_this$props2, ["listComponent", "nbPages", "totalPages", "currentRefinement", "padding", "showFirst", "showPrevious", "showNext", "showLast", "refine", "createURL", "canRefine", "translate", "className"]); var maxPages = Math.min(nbPages, totalPages); var lastPage = maxPages; var items = []; if (showFirst) { items.push({ key: 'first', modifier: 'item--firstPage', disabled: currentRefinement === 1, label: translate('first'), value: 1, ariaLabel: translate('ariaFirst') }); } if (showPrevious) { items.push({ key: 'previous', modifier: 'item--previousPage', disabled: currentRefinement === 1, label: translate('previous'), value: currentRefinement - 1, ariaLabel: translate('ariaPrevious') }); } items = items.concat(getPages(currentRefinement, maxPages, padding).map(function (value) { return { key: value, modifier: 'item--page', label: translate('page', value), value: value, selected: value === currentRefinement, ariaLabel: translate('ariaPage', value) }; })); if (showNext) { items.push({ key: 'next', modifier: 'item--nextPage', disabled: currentRefinement === lastPage || lastPage <= 1, label: translate('next'), value: currentRefinement + 1, ariaLabel: translate('ariaNext') }); } if (showLast) { items.push({ key: 'last', modifier: 'item--lastPage', disabled: currentRefinement === lastPage || lastPage <= 1, label: translate('last'), value: lastPage, ariaLabel: translate('ariaLast') }); } return React__default.createElement("div", { className: classnames(cx$d('', !canRefine && '-noRefinement'), className) }, React__default.createElement(ListComponent, _extends({}, otherProps, { cx: cx$d, items: items, onSelect: refine, createURL: createURL, canRefine: canRefine }))); } }]); return Pagination; }(React.Component); _defineProperty(Pagination, "propTypes", { nbPages: propTypes.number.isRequired, currentRefinement: propTypes.number.isRequired, refine: propTypes.func.isRequired, createURL: propTypes.func.isRequired, canRefine: propTypes.bool.isRequired, translate: propTypes.func.isRequired, listComponent: propTypes.func, showFirst: propTypes.bool, showPrevious: propTypes.bool, showNext: propTypes.bool, showLast: propTypes.bool, padding: propTypes.number, totalPages: propTypes.number, className: propTypes.string }); _defineProperty(Pagination, "defaultProps", { listComponent: LinkList, showFirst: true, showPrevious: true, showNext: true, showLast: false, padding: 3, totalPages: Infinity, className: '' }); var Pagination$1 = translatable({ previous: '‹', next: '›', first: '«', last: '»', page: function page(currentRefinement) { return currentRefinement.toString(); }, ariaPrevious: 'Previous page', ariaNext: 'Next page', ariaFirst: 'First page', ariaLast: 'Last page', ariaPage: function ariaPage(currentRefinement) { return "Page ".concat(currentRefinement.toString()); } })(Pagination); /** * The Pagination widget displays a simple pagination system allowing the user to * change the current page. * @name Pagination * @kind widget * @propType {boolean} [showFirst=true] - Display the first page link. * @propType {boolean} [showLast=false] - Display the last page link. * @propType {boolean} [showPrevious=true] - Display the previous page link. * @propType {boolean} [showNext=true] - Display the next page link. * @propType {number} [padding=3] - How many page links to display around the current page. * @propType {number} [totalPages=Infinity] - Maximum number of pages to display. * @themeKey ais-Pagination - the root div of the widget * @themeKey ais-Pagination--noRefinement - the root div of the widget when there is no refinement * @themeKey ais-Pagination-list - the list of all pagination items * @themeKey ais-Pagination-list--noRefinement - the list of all pagination items when there is no refinement * @themeKey ais-Pagination-item - the pagination list item * @themeKey ais-Pagination-item--firstPage - the "first" pagination list item * @themeKey ais-Pagination-item--lastPage - the "last" pagination list item * @themeKey ais-Pagination-item--previousPage - the "previous" pagination list item * @themeKey ais-Pagination-item--nextPage - the "next" pagination list item * @themeKey ais-Pagination-item--page - the "page" pagination list item * @themeKey ais-Pagination-item--selected - the selected pagination list item * @themeKey ais-Pagination-item--disabled - the disabled pagination list item * @themeKey ais-Pagination-link - the pagination clickable element * @translationKey previous - Label value for the previous page link * @translationKey next - Label value for the next page link * @translationKey first - Label value for the first page link * @translationKey last - Label value for the last page link * @translationkey page - Label value for a page item. You get function(currentRefinement) and you need to return a string * @translationKey ariaPrevious - Accessibility label value for the previous page link * @translationKey ariaNext - Accessibility label value for the next page link * @translationKey ariaFirst - Accessibility label value for the first page link * @translationKey ariaLast - Accessibility label value for the last page link * @translationkey ariaPage - Accessibility label value for a page item. You get function(currentRefinement) and you need to return a string * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, Pagination } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <Pagination /> * </InstantSearch> * ); */ var PaginationWidget = function PaginationWidget(props) { return React__default.createElement(PanelWrapper, props, React__default.createElement(Pagination$1, props)); }; var Pagination$2 = connectPagination(PaginationWidget); var cx$e = createClassNames('PoweredBy'); /* eslint-disable max-len */ var AlgoliaLogo = function AlgoliaLogo() { return React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", baseProfile: "basic", viewBox: "0 0 1366 362", width: "100", height: "27", className: cx$e('logo') }, React__default.createElement("linearGradient", { id: "g", x1: "428.258", x2: "434.145", y1: "404.15", y2: "409.85", gradientUnits: "userSpaceOnUse", gradientTransform: "matrix(94.045 0 0 -94.072 -40381.527 38479.52)" }, React__default.createElement("stop", { offset: "0", stopColor: "#00AEFF" }), React__default.createElement("stop", { offset: "1", stopColor: "#3369E7" })), React__default.createElement("path", { d: "M61.8 15.4h242.8c23.9 0 43.4 19.4 43.4 43.4v242.9c0 23.9-19.4 43.4-43.4 43.4H61.8c-23.9 0-43.4-19.4-43.4-43.4v-243c0-23.9 19.4-43.3 43.4-43.3z", fill: "url(#g)" }), React__default.createElement("path", { d: "M187 98.7c-51.4 0-93.1 41.7-93.1 93.2S135.6 285 187 285s93.1-41.7 93.1-93.2-41.6-93.1-93.1-93.1zm0 158.8c-36.2 0-65.6-29.4-65.6-65.6s29.4-65.6 65.6-65.6 65.6 29.4 65.6 65.6-29.3 65.6-65.6 65.6zm0-117.8v48.9c0 1.4 1.5 2.4 2.8 1.7l43.4-22.5c1-.5 1.3-1.7.8-2.7-9-15.8-25.7-26.6-45-27.3-1 0-2 .8-2 1.9zm-60.8-35.9l-5.7-5.7c-5.6-5.6-14.6-5.6-20.2 0l-6.8 6.8c-5.6 5.6-5.6 14.6 0 20.2l5.6 5.6c.9.9 2.2.7 3-.2 3.3-4.5 6.9-8.8 10.9-12.8 4.1-4.1 8.3-7.7 12.9-11 1-.6 1.1-2 .3-2.9zM217.5 89V77.7c0-7.9-6.4-14.3-14.3-14.3h-33.3c-7.9 0-14.3 6.4-14.3 14.3v11.6c0 1.3 1.2 2.2 2.5 1.9 9.3-2.7 19.1-4.1 29-4.1 9.5 0 18.9 1.3 28 3.8 1.2.3 2.4-.6 2.4-1.9z", fill: "#FFFFFF" }), React__default.createElement("path", { d: "M842.5 267.6c0 26.7-6.8 46.2-20.5 58.6-13.7 12.4-34.6 18.6-62.8 18.6-10.3 0-31.7-2-48.8-5.8l6.3-31c14.3 3 33.2 3.8 43.1 3.8 15.7 0 26.9-3.2 33.6-9.6s10-15.9 10-28.5v-6.4c-3.9 1.9-9 3.8-15.3 5.8-6.3 1.9-13.6 2.9-21.8 2.9-10.8 0-20.6-1.7-29.5-5.1-8.9-3.4-16.6-8.4-22.9-15-6.3-6.6-11.3-14.9-14.8-24.8s-5.3-27.6-5.3-40.6c0-12.2 1.9-27.5 5.6-37.7 3.8-10.2 9.2-19 16.5-26.3 7.2-7.3 16-12.9 26.3-17s22.4-6.7 35.5-6.7c12.7 0 24.4 1.6 35.8 3.5 11.4 1.9 21.1 3.9 29 6.1v155.2zm-108.7-77.2c0 16.4 3.6 34.6 10.8 42.2 7.2 7.6 16.5 11.4 27.9 11.4 6.2 0 12.1-.9 17.6-2.6 5.5-1.7 9.9-3.7 13.4-6.1v-97.1c-2.8-.6-14.5-3-25.8-3.3-14.2-.4-25 5.4-32.6 14.7-7.5 9.3-11.3 25.6-11.3 40.8zm294.3 0c0 13.2-1.9 23.2-5.8 34.1s-9.4 20.2-16.5 27.9c-7.1 7.7-15.6 13.7-25.6 17.9s-25.4 6.6-33.1 6.6c-7.7-.1-23-2.3-32.9-6.6-9.9-4.3-18.4-10.2-25.5-17.9-7.1-7.7-12.6-17-16.6-27.9s-6-20.9-6-34.1c0-13.2 1.8-25.9 5.8-36.7 4-10.8 9.6-20 16.8-27.7s15.8-13.6 25.6-17.8c9.9-4.2 20.8-6.2 32.6-6.2s22.7 2.1 32.7 6.2c10 4.2 18.6 10.1 25.6 17.8 7.1 7.7 12.6 16.9 16.6 27.7 4.2 10.8 6.3 23.5 6.3 36.7zm-40 .1c0-16.9-3.7-31-10.9-40.8-7.2-9.9-17.3-14.8-30.2-14.8-12.9 0-23 4.9-30.2 14.8-7.2 9.9-10.7 23.9-10.7 40.8 0 17.1 3.6 28.6 10.8 38.5 7.2 10 17.3 14.9 30.2 14.9 12.9 0 23-5 30.2-14.9 7.2-10 10.8-21.4 10.8-38.5zm127.1 86.4c-64.1.3-64.1-51.8-64.1-60.1L1051 32l39.1-6.2v183.6c0 4.7 0 34.5 25.1 34.6v32.9zm68.9 0h-39.3V108.1l39.3-6.2v175zm-19.7-193.5c13.1 0 23.8-10.6 23.8-23.7S1177.6 36 1164.4 36s-23.8 10.6-23.8 23.7 10.7 23.7 23.8 23.7zm117.4 18.6c12.9 0 23.8 1.6 32.6 4.8 8.8 3.2 15.9 7.7 21.1 13.4s8.9 13.5 11.1 21.7c2.3 8.2 3.4 17.2 3.4 27.1v100.6c-6 1.3-15.1 2.8-27.3 4.6s-25.9 2.7-41.1 2.7c-10.1 0-19.4-1-27.7-2.9-8.4-1.9-15.5-5-21.5-9.3-5.9-4.3-10.5-9.8-13.9-16.6-3.3-6.8-5-16.4-5-26.4 0-9.6 1.9-15.7 5.6-22.3 3.8-6.6 8.9-12 15.3-16.2 6.5-4.2 13.9-7.2 22.4-9s17.4-2.7 26.6-2.7c4.3 0 8.8.3 13.6.8s9.8 1.4 15.2 2.7v-6.4c0-4.5-.5-8.8-1.6-12.8-1.1-4.1-3-7.6-5.6-10.7-2.7-3.1-6.2-5.5-10.6-7.2s-10-3-16.7-3c-9 0-17.2 1.1-24.7 2.4-7.5 1.3-13.7 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8-64.1-60.1L610.6 32l39.1-6.2v183.6c0 4.7 0 34.5 25.1 34.6v32.9z", fill: "#182359" })); }; /* eslint-enable max-len */ var PoweredBy = /*#__PURE__*/ function (_Component) { _inherits(PoweredBy, _Component); function PoweredBy() { _classCallCheck(this, PoweredBy); return _possibleConstructorReturn(this, _getPrototypeOf(PoweredBy).apply(this, arguments)); } _createClass(PoweredBy, [{ key: "render", value: function render() { var _this$props = this.props, url = _this$props.url, translate = _this$props.translate, className = _this$props.className; return React__default.createElement("div", { className: classnames(cx$e(''), className) }, React__default.createElement("span", { className: cx$e('text') }, translate('searchBy')), ' ', React__default.createElement("a", { href: url, target: "_blank", className: cx$e('link'), "aria-label": "Algolia", rel: "noopener noreferrer" }, React__default.createElement(AlgoliaLogo, null))); } }]); return PoweredBy; }(React.Component); _defineProperty(PoweredBy, "propTypes", { url: propTypes.string.isRequired, translate: propTypes.func.isRequired, className: propTypes.string }); var PoweredBy$1 = translatable({ searchBy: 'Search by' })(PoweredBy); /** * PoweredBy displays an Algolia logo. * * Algolia requires that you use this widget if you are on a [community or free plan](https://www.algolia.com/pricing). * @name PoweredBy * @kind widget * @themeKey ais-PoweredBy - the root div of the widget * @themeKey ais-PoweredBy-text - the text of the widget * @themeKey ais-PoweredBy-link - the link of the logo * @themeKey ais-PoweredBy-logo - the logo of the widget * @translationKey searchBy - Label value for the powered by * @example * import React from 'react'; * import { InstantSearch, PoweredBy } from 'react-instantsearch-dom'; * import algoliasearch from 'algoliasearch/lite'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <PoweredBy /> * </InstantSearch> * ); */ var PoweredBy$2 = connectPoweredBy(PoweredBy$1); var cx$f = createClassNames('RangeInput'); var RawRangeInput = /*#__PURE__*/ function (_Component) { _inherits(RawRangeInput, _Component); function RawRangeInput(props) { var _this; _classCallCheck(this, RawRangeInput); _this = _possibleConstructorReturn(this, _getPrototypeOf(RawRangeInput).call(this, props)); _defineProperty(_assertThisInitialized(_this), "onSubmit", function (e) { e.preventDefault(); _this.props.refine({ min: _this.state.from, max: _this.state.to }); }); _this.state = _this.normalizeStateForRendering(props); return _this; } _createClass(RawRangeInput, [{ key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (this.props.canRefine && (prevProps.currentRefinement.min !== this.props.currentRefinement.min || prevProps.currentRefinement.max !== this.props.currentRefinement.max)) { this.setState(this.normalizeStateForRendering(this.props)); } } }, { key: "normalizeStateForRendering", value: function normalizeStateForRendering(props) { var canRefine = props.canRefine, rangeMin = props.min, rangeMax = props.max; var _props$currentRefinem = props.currentRefinement, valueMin = _props$currentRefinem.min, valueMax = _props$currentRefinem.max; return { from: canRefine && valueMin !== undefined && valueMin !== rangeMin ? valueMin : '', to: canRefine && valueMax !== undefined && valueMax !== rangeMax ? valueMax : '' }; } }, { key: "normalizeRangeForRendering", value: function normalizeRangeForRendering(_ref) { var canRefine = _ref.canRefine, min = _ref.min, max = _ref.max; var hasMin = min !== undefined; var hasMax = max !== undefined; return { min: canRefine && hasMin && hasMax ? min : '', max: canRefine && hasMin && hasMax ? max : '' }; } }, { key: "render", value: function render() { var _this2 = this; var _this$state = this.state, from = _this$state.from, to = _this$state.to; var _this$props = this.props, precision = _this$props.precision, translate = _this$props.translate, canRefine = _this$props.canRefine, className = _this$props.className; var _this$normalizeRangeF = this.normalizeRangeForRendering(this.props), min = _this$normalizeRangeF.min, max = _this$normalizeRangeF.max; var step = 1 / Math.pow(10, precision); return React__default.createElement("div", { className: classnames(cx$f('', !canRefine && '-noRefinement'), className) }, React__default.createElement("form", { className: cx$f('form'), onSubmit: this.onSubmit }, React__default.createElement("input", { className: cx$f('input', 'input--min'), type: "number", min: min, max: max, value: from, step: step, placeholder: min, disabled: !canRefine, onChange: function onChange(e) { return _this2.setState({ from: e.currentTarget.value }); } }), React__default.createElement("span", { className: cx$f('separator') }, translate('separator')), React__default.createElement("input", { className: cx$f('input', 'input--max'), type: "number", min: min, max: max, value: to, step: step, placeholder: max, disabled: !canRefine, onChange: function onChange(e) { return _this2.setState({ to: e.currentTarget.value }); } }), React__default.createElement("button", { className: cx$f('submit'), type: "submit" }, translate('submit')))); } }]); return RawRangeInput; }(React.Component); _defineProperty(RawRangeInput, "propTypes", { canRefine: propTypes.bool.isRequired, precision: propTypes.number.isRequired, translate: propTypes.func.isRequired, refine: propTypes.func.isRequired, min: propTypes.number, max: propTypes.number, currentRefinement: propTypes.shape({ min: propTypes.number, max: propTypes.number }), className: propTypes.string }); _defineProperty(RawRangeInput, "defaultProps", { currentRefinement: {}, className: '' }); var RangeInput = translatable({ submit: 'ok', separator: 'to' })(RawRangeInput); /** * RangeInput allows a user to select a numeric range using a minimum and maximum input. * @name RangeInput * @kind widget * @requirements The attribute passed to the `attribute` prop must be present in “attributes for faceting” * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * The values inside the attribute must be JavaScript numbers (not strings). * @propType {string} attribute - the name of the attribute in the record * @propType {{min: number, max: number}} [defaultRefinement] - Default state of the widget containing the start and the end of the range. * @propType {number} [min] - Minimum value. When this isn't set, the minimum value will be automatically computed by Algolia using the data in the index. * @propType {number} [max] - Maximum value. When this isn't set, the maximum value will be automatically computed by Algolia using the data in the index. * @propType {number} [precision=0] - Number of digits after decimal point to use. * @themeKey ais-RangeInput - the root div of the widget * @themeKey ais-RangeInput-form - the wrapping form * @themeKey ais-RangeInput-label - the label wrapping inputs * @themeKey ais-RangeInput-input - the input (number) * @themeKey ais-RangeInput-input--min - the minimum input * @themeKey ais-RangeInput-input--max - the maximum input * @themeKey ais-RangeInput-separator - the separator word used between the two inputs * @themeKey ais-RangeInput-button - the submit button * @translationKey submit - Label value for the submit button * @translationKey separator - Label value for the input separator * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, RangeInput } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <RangeInput attribute="price" /> * </InstantSearch> * ); */ var RangeInputWidget = function RangeInputWidget(props) { return React__default.createElement(PanelWrapper, props, React__default.createElement(RangeInput, props)); }; var RangeInput$1 = connectRange(RangeInputWidget); /** * Since a lot of sliders already exist, we did not include one by default. * However you can easily connect React InstantSearch to an existing one * using the [connectRange connector](connectors/connectRange.html). * * @name RangeSlider * @requirements To connect any slider to Algolia, the underlying attribute used must be holding numerical values. * @kind widget * @example * * // Here's an example showing how to connect the AirBnb Rheostat Slider to React InstantSearch * // using the range connector. ⚠️ This example only works with the version 2.x of Rheostat. import React, {Component} from 'react'; import PropTypes from 'prop-types'; import Rheostat from 'rheostat'; import { connectRange } from 'react-instantsearch-dom'; class Range extends React.Component { static propTypes = { min: PropTypes.number, max: PropTypes.number, currentRefinement: PropTypes.object, refine: PropTypes.func.isRequired, canRefine: PropTypes.bool.isRequired }; state = { currentValues: { min: this.props.min, max: this.props.max } }; componentDidUpdate(prevProps) { if ( this.props.canRefine && (prevProps.currentRefinement.min !== this.props.currentRefinement.min || prevProps.currentRefinement.max !== this.props.currentRefinement.max) ) { this.setState({ currentValues: { min: this.props.currentRefinement.min, max: this.props.currentRefinement.max, }, }); } } onValuesUpdated = sliderState => { this.setState({ currentValues: { min: sliderState.values[0], max: sliderState.values[1] } }); }; onChange = sliderState => { if ( this.props.currentRefinement.min !== sliderState.values[0] || this.props.currentRefinement.max !== sliderState.values[1] ) { this.props.refine({ min: sliderState.values[0], max: sliderState.values[1] }); } }; render() { const { min, max, currentRefinement } = this.props; const { currentValues } = this.state; return min !== max ? ( <div> <Rheostat className="ais-RangeSlider" min={min} max={max} values={[currentRefinement.min, currentRefinement.max]} onChange={this.onChange} onValuesUpdated={this.onValuesUpdated} /> <div style={{ display: "flex", justifyContent: "space-between" }}> <div>{currentValues.min}</div> <div>{currentValues.max}</div> </div> </div> ) : null; } } const ConnectedRange = connectRange(Range); */ var RangeSlider = (function () { return React__default.createElement("div", null, "We do not provide any Slider, see the documentation to learn how to connect one easily:", React__default.createElement("a", { target: "_blank", rel: "noopener noreferrer", href: "https://www.algolia.com/doc/api-reference/widgets/range-slider/react/" }, "https://www.algolia.com/doc/api-reference/widgets/range-slider/react/")); }); var cx$g = createClassNames('RatingMenu'); var RatingMenu = /*#__PURE__*/ function (_Component) { _inherits(RatingMenu, _Component); function RatingMenu() { _classCallCheck(this, RatingMenu); return _possibleConstructorReturn(this, _getPrototypeOf(RatingMenu).apply(this, arguments)); } _createClass(RatingMenu, [{ key: "onClick", value: function onClick(min, max, e) { e.preventDefault(); e.stopPropagation(); if (min === this.props.currentRefinement.min && max === this.props.currentRefinement.max) { this.props.refine({ min: this.props.min, max: this.props.max }); } else { this.props.refine({ min: min, max: max }); } } }, { key: "buildItem", value: function buildItem(_ref) { var max = _ref.max, lowerBound = _ref.lowerBound, count = _ref.count, translate = _ref.translate, createURL = _ref.createURL, isLastSelectableItem = _ref.isLastSelectableItem; var disabled = !count; var isCurrentMinLower = this.props.currentRefinement.min < lowerBound; var selected = isLastSelectableItem && isCurrentMinLower || !disabled && lowerBound === this.props.currentRefinement.min && max === this.props.currentRefinement.max; var icons = []; var rating = 0; for (var icon = 0; icon < max; icon++) { if (icon < lowerBound) { rating++; } icons.push([React__default.createElement("svg", { key: icon, className: cx$g('starIcon', icon >= lowerBound ? 'starIcon--empty' : 'starIcon--full'), "aria-hidden": "true", width: "24", height: "24" }, React__default.createElement("use", { xlinkHref: "#".concat(cx$g(icon >= lowerBound ? 'starEmptySymbol' : 'starSymbol')) })), ' ']); } // The last item of the list (the default item), should not // be clickable if it is selected. var isLastAndSelect = isLastSelectableItem && selected; var onClickHandler = disabled || isLastAndSelect ? {} : { href: createURL({ min: lowerBound, max: max }), onClick: this.onClick.bind(this, lowerBound, max) }; return React__default.createElement("li", { key: lowerBound, className: cx$g('item', selected && 'item--selected', disabled && 'item--disabled') }, React__default.createElement("a", _extends({ className: cx$g('link'), "aria-label": "".concat(rating).concat(translate('ratingLabel')) }, onClickHandler), icons, React__default.createElement("span", { className: cx$g('label'), "aria-hidden": "true" }, translate('ratingLabel')), ' ', React__default.createElement("span", { className: cx$g('count') }, count))); } }, { key: "render", value: function render() { var _this = this; var _this$props = this.props, min = _this$props.min, max = _this$props.max, translate = _this$props.translate, count = _this$props.count, createURL = _this$props.createURL, canRefine = _this$props.canRefine, className = _this$props.className; // min & max are always set when there is a results, otherwise it means // that we don't want to render anything since we don't have any values. var limitMin = min !== undefined && min >= 0 ? min : 1; var limitMax = max !== undefined && max >= 0 ? max : 0; var inclusiveLength = limitMax - limitMin + 1; var values = count.map(function (item) { return _objectSpread({}, item, { value: parseFloat(item.value) }); }).filter(function (item) { return item.value >= limitMin && item.value <= limitMax; }); var items = range({ start: 0, end: Math.max(inclusiveLength, 0) }).map(function (index) { var element = find$2(values, function (item) { return item.value === limitMax - index; }); var placeholder = { value: limitMax - index, count: 0, total: 0 }; return element || placeholder; }).reduce(function (acc, item, index) { return acc.concat(_objectSpread({}, item, { total: index === 0 ? item.count : acc[index - 1].total + item.count })); }, []).map(function (item, index, arr) { return _this.buildItem({ lowerBound: item.value, count: item.total, isLastSelectableItem: arr.length - 1 === index, max: limitMax, translate: translate, createURL: createURL }); }); return React__default.createElement("div", { className: classnames(cx$g('', !canRefine && '-noRefinement'), className) }, React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", style: { display: 'none' } }, React__default.createElement("symbol", { id: cx$g('starSymbol'), viewBox: "0 0 24 24" }, React__default.createElement("path", { d: "M12 .288l2.833 8.718h9.167l-7.417 5.389 2.833 8.718-7.416-5.388-7.417 5.388 2.833-8.718-7.416-5.389h9.167z" })), React__default.createElement("symbol", { id: cx$g('starEmptySymbol'), viewBox: "0 0 24 24" }, React__default.createElement("path", { d: "M12 6.76l1.379 4.246h4.465l-3.612 2.625 1.379 4.246-3.611-2.625-3.612 2.625 1.379-4.246-3.612-2.625h4.465l1.38-4.246zm0-6.472l-2.833 8.718h-9.167l7.416 5.389-2.833 8.718 7.417-5.388 7.416 5.388-2.833-8.718 7.417-5.389h-9.167l-2.833-8.718z" }))), React__default.createElement("ul", { className: cx$g('list', !canRefine && 'list--noRefinement') }, items)); } }]); return RatingMenu; }(React.Component); _defineProperty(RatingMenu, "propTypes", { translate: propTypes.func.isRequired, refine: propTypes.func.isRequired, createURL: propTypes.func.isRequired, min: propTypes.number, max: propTypes.number, currentRefinement: propTypes.shape({ min: propTypes.number, max: propTypes.number }), count: propTypes.arrayOf(propTypes.shape({ value: propTypes.string, count: propTypes.number })), canRefine: propTypes.bool.isRequired, className: propTypes.string }); _defineProperty(RatingMenu, "defaultProps", { className: '' }); var RatingMenu$1 = translatable({ ratingLabel: ' & Up' })(RatingMenu); /** * RatingMenu lets the user refine search results by clicking on stars. * * The stars are based on the selected `attribute`. * @requirements The attribute passed to the `attribute` prop must be holding numerical values. * @name RatingMenu * @kind widget * @requirements The attribute passed to the `attribute` prop must be present in “attributes for faceting” * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * The values inside the attribute must be JavaScript numbers (not strings). * @propType {string} attribute - the name of the attribute in the record * @propType {number} [min] - Minimum value for the rating. When this isn't set, the minimum value will be automatically computed by Algolia using the data in the index. * @propType {number} [max] - Maximum value for the rating. When this isn't set, the maximum value will be automatically computed by Algolia using the data in the index. * @propType {{min: number, max: number}} [defaultRefinement] - Default state of the widget containing the lower bound (end) and the max for the rating. * @themeKey ais-RatingMenu - the root div of the widget * @themeKey ais-RatingMenu--noRefinement - the root div of the widget when there is no refinement * @themeKey ais-RatingMenu-list - the list of ratings * @themeKey ais-RatingMenu-list--noRefinement - the list of ratings when there is no refinement * @themeKey ais-RatingMenu-item - the rating list item * @themeKey ais-RatingMenu-item--selected - the selected rating list item * @themeKey ais-RatingMenu-item--disabled - the disabled rating list item * @themeKey ais-RatingMenu-link - the rating clickable item * @themeKey ais-RatingMenu-starIcon - the star icon * @themeKey ais-RatingMenu-starIcon--full - the filled star icon * @themeKey ais-RatingMenu-starIcon--empty - the empty star icon * @themeKey ais-RatingMenu-label - the label used after the stars * @themeKey ais-RatingMenu-count - the count of ratings for a specific item * @translationKey ratingLabel - Label value for the rating link * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, RatingMenu } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <RatingMenu attribute="rating" /> * </InstantSearch> * ); */ var RatingMenuWidget = function RatingMenuWidget(props) { return React__default.createElement(PanelWrapper, props, React__default.createElement(RatingMenu$1, props)); }; var RatingMenu$2 = connectRange(RatingMenuWidget); var cx$h = createClassNames('RefinementList'); var RefinementList$1 = /*#__PURE__*/ function (_Component) { _inherits(RefinementList, _Component); function RefinementList() { var _getPrototypeOf2; var _this; _classCallCheck(this, RefinementList); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(RefinementList)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_this), "state", { query: '' }); _defineProperty(_assertThisInitialized(_this), "selectItem", function (item, resetQuery) { resetQuery(); _this.props.refine(item.value); }); _defineProperty(_assertThisInitialized(_this), "renderItem", function (item, resetQuery) { var label = _this.props.isFromSearch ? React__default.createElement(Highlight$2, { attribute: "label", hit: item }) : item.label; return React__default.createElement("label", { className: cx$h('label') }, React__default.createElement("input", { className: cx$h('checkbox'), type: "checkbox", checked: item.isRefined, onChange: function onChange() { return _this.selectItem(item, resetQuery); } }), React__default.createElement("span", { className: cx$h('labelText') }, label), ' ', React__default.createElement("span", { className: cx$h('count') }, item.count.toLocaleString())); }); return _this; } _createClass(RefinementList, [{ key: "render", value: function render() { var _this$props = this.props, translate = _this$props.translate, items = _this$props.items, showMore = _this$props.showMore, limit = _this$props.limit, showMoreLimit = _this$props.showMoreLimit, isFromSearch = _this$props.isFromSearch, searchForItems = _this$props.searchForItems, searchable = _this$props.searchable, canRefine = _this$props.canRefine, className = _this$props.className; return React__default.createElement(List, { renderItem: this.renderItem, selectItem: this.selectItem, cx: cx$h, translate: translate, items: items, showMore: showMore, limit: limit, showMoreLimit: showMoreLimit, isFromSearch: isFromSearch, searchForItems: searchForItems, searchable: searchable, canRefine: canRefine, className: className, query: this.state.query }); } }]); return RefinementList; }(React.Component); _defineProperty(RefinementList$1, "propTypes", { translate: propTypes.func.isRequired, refine: propTypes.func.isRequired, searchForItems: propTypes.func.isRequired, searchable: propTypes.bool, createURL: propTypes.func.isRequired, items: propTypes.arrayOf(propTypes.shape({ label: propTypes.string.isRequired, value: propTypes.arrayOf(propTypes.string).isRequired, count: propTypes.number.isRequired, isRefined: propTypes.bool.isRequired })), isFromSearch: propTypes.bool.isRequired, canRefine: propTypes.bool.isRequired, showMore: propTypes.bool, limit: propTypes.number, showMoreLimit: propTypes.number, transformItems: propTypes.func, className: propTypes.string }); _defineProperty(RefinementList$1, "defaultProps", { className: '' }); var RefinementList$2 = translatable({ showMore: function showMore(extended) { return extended ? 'Show less' : 'Show more'; }, noResults: 'No results', submit: null, reset: null, resetTitle: 'Clear the search query.', submitTitle: 'Submit your search query.', placeholder: 'Search here…' })(RefinementList$1); /** * The RefinementList component displays a list that let the end user choose multiple values for a specific facet. * @name RefinementList * @kind widget * @propType {string} attribute - the name of the attribute in the record * @propType {boolean} [searchable=false] - true if the component should display an input to search for facet values. <br> In order to make this feature work, you need to make the attribute searchable [using the API](https://www.algolia.com/doc/guides/searching/faceting/?language=js#declaring-a-searchable-attribute-for-faceting) or [the dashboard](https://www.algolia.com/explorer/display/). * @propType {string} [operator=or] - How to apply the refinements. Possible values: 'or' or 'and'. * @propType {boolean} [showMore=false] - true if the component should display a button that will expand the number of items * @propType {number} [limit=10] - the minimum number of displayed items * @propType {number} [showMoreLimit=20] - the maximum number of displayed items. Only used when showMore is set to `true` * @propType {string[]} [defaultRefinement] - the values of the items selected by default * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @themeKey ais-RefinementList - the root div of the widget * @themeKey ais-RefinementList--noRefinement - the root div of the widget when there is no refinement * @themeKey ais-RefinementList-searchBox - the search box of the widget. See [the SearchBox documentation](widgets/SearchBox.html#classnames) for the classnames and translation keys of the SearchBox. * @themeKey ais-RefinementList-list - the list of refinement items * @themeKey ais-RefinementList-item - the refinement list item * @themeKey ais-RefinementList-item--selected - the refinement selected list item * @themeKey ais-RefinementList-label - the label of each refinement item * @themeKey ais-RefinementList-checkbox - the checkbox input of each refinement item * @themeKey ais-RefinementList-labelText - the label text of each refinement item * @themeKey ais-RefinementList-count - the count of values for each item * @themeKey ais-RefinementList-noResults - the div displayed when there are no results * @themeKey ais-RefinementList-showMore - the button used to display more categories * @themeKey ais-RefinementList-showMore--disabled - the disabled button used to display more categories * @translationkey showMore - The label of the show more button. Accepts one parameters, a boolean that is true if the values are expanded * @translationkey noResults - The label of the no results text when no search for facet values results are found. * @requirements The attribute passed to the `attribute` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * * If you are using the `searchable` prop, you'll also need to make the attribute searchable using * the [dashboard](https://www.algolia.com/explorer/display/) or using the [API](https://www.algolia.com/doc/guides/searching/faceting/#search-for-facet-values). * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, RefinementList } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <RefinementList attribute="brand" /> * </InstantSearch> * ); */ var RefinementListWidget = function RefinementListWidget(props) { return React__default.createElement(PanelWrapper, props, React__default.createElement(RefinementList$2, props)); }; var RefinementList$3 = connectRefinementList(RefinementListWidget); var cx$i = createClassNames('ScrollTo'); var ScrollTo = /*#__PURE__*/ function (_Component) { _inherits(ScrollTo, _Component); function ScrollTo() { _classCallCheck(this, ScrollTo); return _possibleConstructorReturn(this, _getPrototypeOf(ScrollTo).apply(this, arguments)); } _createClass(ScrollTo, [{ key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var _this$props = this.props, value = _this$props.value, hasNotChanged = _this$props.hasNotChanged; if (value !== prevProps.value && hasNotChanged) { this.el.scrollIntoView(); } } }, { key: "render", value: function render() { var _this = this; return React__default.createElement("div", { ref: function ref(_ref) { return _this.el = _ref; }, className: cx$i('') }, this.props.children); } }]); return ScrollTo; }(React.Component); _defineProperty(ScrollTo, "propTypes", { value: propTypes.any, children: propTypes.node, hasNotChanged: propTypes.bool }); /** * The ScrollTo component will make the page scroll to the component wrapped by it when one of the * [search state](guide/Search_state.html) prop is updated. By default when the page number changes, * the scroll goes to the wrapped component. * * @name ScrollTo * @kind widget * @propType {string} [scrollOn="page"] - Widget state key on which to listen for changes. * @themeKey ais-ScrollTo - the root div of the widget * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, ScrollTo, Hits } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <ScrollTo> * <Hits /> * </ScrollTo> * </InstantSearch> * ); */ var ScrollTo$1 = connectScrollTo(ScrollTo); /** * The SearchBox component displays a search box that lets the user search for a specific query. * @name SearchBox * @kind widget * @propType {string[]} [focusShortcuts=['s','/']] - List of keyboard shortcuts that focus the search box. Accepts key names and key codes. * @propType {boolean} [autoFocus=false] - Should the search box be focused on render? * @propType {boolean} [searchAsYouType=true] - Should we search on every change to the query? If you disable this option, new searches will only be triggered by clicking the search button or by pressing the enter key while the search box is focused. * @propType {function} [onSubmit] - Intercept submit event sent from the SearchBox form container. * @propType {function} [onReset] - Listen to `reset` event sent from the SearchBox form container. * @propType {function} [on*] - Listen to any events sent from the search input itself. * @propType {node} [submit] - Change the apparence of the default submit button (magnifying glass). * @propType {node} [reset] - Change the apparence of the default reset button (cross). * @propType {node} [loadingIndicator] - Change the apparence of the default loading indicator (spinning circle). * @propType {string} [defaultRefinement] - Provide default refinement value when component is mounted. * @propType {boolean} [showLoadingIndicator=false] - Display that the search is loading. This only happens after a certain amount of time to avoid a blinking effect. This timer can be configured with `stalledSearchDelay` props on <InstantSearch>. By default, the value is 200ms. * @themeKey ais-SearchBox - the root div of the widget * @themeKey ais-SearchBox-form - the wrapping form * @themeKey ais-SearchBox-input - the search input * @themeKey ais-SearchBox-submit - the submit button * @themeKey ais-SearchBox-submitIcon - the default magnifier icon used with the search input * @themeKey ais-SearchBox-reset - the reset button used to clear the content of the input * @themeKey ais-SearchBox-resetIcon - the default reset icon used inside the reset button * @themeKey ais-SearchBox-loadingIndicator - the loading indicator container * @themeKey ais-SearchBox-loadingIcon - the default loading icon * @translationkey submitTitle - The submit button title * @translationkey resetTitle - The reset button title * @translationkey placeholder - The label of the input placeholder * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, SearchBox } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <SearchBox /> * </InstantSearch> * ); */ var SearchBox$2 = connectSearchBox(SearchBox$1); var cx$j = createClassNames('Snippet'); var Snippet = function Snippet(props) { return React__default.createElement(Highlighter, _extends({}, props, { highlightProperty: "_snippetResult", cx: cx$j })); }; /** * Renders any attribute from an hit into its highlighted snippet form when relevant. * * Read more about it in the [Highlighting results](guide/Highlighting_results.html) guide. * @name Snippet * @kind widget * @requirements To use this widget, the attribute name passed to the `attribute` prop must be * present in "Attributes to snippet" on the Algolia dashboard or configured as `attributesToSnippet` * via a set settings call to the Algolia API. * @propType {string} attribute - location of the highlighted snippet attribute in the hit (the corresponding element can be either a string or an array of strings) * @propType {object} hit - hit object containing the highlighted snippet attribute * @propType {string} [tagName='em'] - tag to be used for highlighted parts of the attribute * @propType {string} [nonHighlightedTagName='span'] - tag to be used for the parts of the hit that are not highlighted * @propType {node} [separator=',<space>'] - symbol used to separate the elements of the array in case the attribute points to an array of strings. * @themeKey ais-Snippet - the root span of the widget * @themeKey ais-Snippet-highlighted - the highlighted text * @themeKey ais-Snippet-nonHighlighted - the normal text * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, SearchBox, Hits, Snippet } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const Hit = ({ hit }) => ( * <div> * <Snippet attribute="description" hit={hit} /> * </div> * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <SearchBox defaultRefinement="adjustable" /> * <Hits hitComponent={Hit} /> * </InstantSearch> * ); */ var Snippet$1 = connectHighlight(Snippet); var cx$k = createClassNames('SortBy'); var SortBy = /*#__PURE__*/ function (_Component) { _inherits(SortBy, _Component); function SortBy() { _classCallCheck(this, SortBy); return _possibleConstructorReturn(this, _getPrototypeOf(SortBy).apply(this, arguments)); } _createClass(SortBy, [{ key: "render", value: function render() { var _this$props = this.props, items = _this$props.items, currentRefinement = _this$props.currentRefinement, refine = _this$props.refine, className = _this$props.className; return React__default.createElement("div", { className: classnames(cx$k(''), className) }, React__default.createElement(Select, { cx: cx$k, items: items, selectedItem: currentRefinement, onSelect: refine })); } }]); return SortBy; }(React.Component); _defineProperty(SortBy, "propTypes", { items: propTypes.arrayOf(propTypes.shape({ label: propTypes.string, value: propTypes.string.isRequired })).isRequired, currentRefinement: propTypes.string.isRequired, refine: propTypes.func.isRequired, className: propTypes.string }); _defineProperty(SortBy, "defaultProps", { className: '' }); /** * The SortBy component displays a list of indexes allowing a user to change the hits are sorting. * @name SortBy * @requirements Algolia handles sorting by creating replica indices. [Read more about sorting](https://www.algolia.com/doc/guides/relevance/sorting/) on * the Algolia website. * @kind widget * @propType {{value: string, label: string}[]} items - The list of indexes to search in. * @propType {string} defaultRefinement - The default selected index. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @themeKey ais-SortBy - the root div of the widget * @themeKey ais-SortBy-select - the select * @themeKey ais-SortBy-option - the select option * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, SortBy } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <SortBy * defaultRefinement="instant_search" * items={[ * { value: 'instant_search', label: 'Featured' }, * { value: 'instant_search_price_asc', label: 'Price asc.' }, * { value: 'instant_search_price_desc', label: 'Price desc.' }, * ]} * /> * </InstantSearch> * ); */ var SortBy$1 = connectSortBy(SortBy); var cx$l = createClassNames('Stats'); var Stats = /*#__PURE__*/ function (_Component) { _inherits(Stats, _Component); function Stats() { _classCallCheck(this, Stats); return _possibleConstructorReturn(this, _getPrototypeOf(Stats).apply(this, arguments)); } _createClass(Stats, [{ key: "render", value: function render() { var _this$props = this.props, translate = _this$props.translate, nbHits = _this$props.nbHits, processingTimeMS = _this$props.processingTimeMS, className = _this$props.className; return React__default.createElement("div", { className: classnames(cx$l(''), className) }, React__default.createElement("span", { className: cx$l('text') }, translate('stats', nbHits, processingTimeMS))); } }]); return Stats; }(React.Component); _defineProperty(Stats, "propTypes", { translate: propTypes.func.isRequired, nbHits: propTypes.number.isRequired, processingTimeMS: propTypes.number.isRequired, className: propTypes.string }); _defineProperty(Stats, "defaultProps", { className: '' }); var Stats$1 = translatable({ stats: function stats(n, ms) { return "".concat(n.toLocaleString(), " results found in ").concat(ms.toLocaleString(), "ms"); } })(Stats); /** * The Stats component displays the total number of matching hits and the time it took to get them (time spent in the Algolia server). * @name Stats * @kind widget * @themeKey ais-Stats - the root div of the widget * @themeKey ais-Stats-text - the text of the widget - the count of items for each item * @translationkey stats - The string displayed by the stats widget. You get function(n, ms) and you need to return a string. n is a number of hits retrieved, ms is a processed time. * @example * import React from 'react'; * import { InstantSearch, Stats, Hits } from 'react-instantsearch-dom'; * import algoliasearch from 'algoliasearch/lite'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <Stats /> * <Hits /> * </InstantSearch> * ); */ var Stats$2 = connectStats(Stats$1); var cx$m = createClassNames('ToggleRefinement'); var ToggleRefinement = function ToggleRefinement(_ref) { var currentRefinement = _ref.currentRefinement, label = _ref.label, canRefine = _ref.canRefine, refine = _ref.refine, className = _ref.className; return React__default.createElement("div", { className: classnames(cx$m('', !canRefine && '-noRefinement'), className) }, React__default.createElement("label", { className: cx$m('label') }, React__default.createElement("input", { className: cx$m('checkbox'), type: "checkbox", checked: currentRefinement, onChange: function onChange(event) { return refine(event.target.checked); } }), React__default.createElement("span", { className: cx$m('labelText') }, label))); }; ToggleRefinement.defaultProps = { className: '' }; /** * The ToggleRefinement provides an on/off filtering feature based on an attribute value. * @name ToggleRefinement * @kind widget * @requirements To use this widget, you'll need an attribute to toggle on. * * You can't toggle on null or not-null values. If you want to address this particular use-case you'll need to compute an * extra boolean attribute saying if the value exists or not. See this [thread](https://discourse.algolia.com/t/how-to-create-a-toggle-for-the-absence-of-a-string-attribute/2460) for more details. * * @propType {string} attribute - Name of the attribute on which to apply the `value` refinement. Required when `value` is present. * @propType {string} label - Label for the toggle. * @propType {any} value - Value of the refinement to apply on `attribute` when checked. * @propType {boolean} [defaultRefinement=false] - Default state of the widget. Should the toggle be checked by default? * @themeKey ais-ToggleRefinement - the root div of the widget * @themeKey ais-ToggleRefinement-list - the list of toggles * @themeKey ais-ToggleRefinement-item - the toggle list item * @themeKey ais-ToggleRefinement-label - the label of each toggle item * @themeKey ais-ToggleRefinement-checkbox - the checkbox input of each toggle item * @themeKey ais-ToggleRefinement-labelText - the label text of each toggle item * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, ToggleRefinement } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <ToggleRefinement * attribute="free_shipping" * label="Free Shipping" * value={true} * /> * </InstantSearch> * ); */ var ToggleRefinement$1 = connectToggleRefinement(ToggleRefinement); var ANONYMOUS_TOKEN_COOKIE_KEY = '_ALGOLIA'; function getCookie(name) { var prefix = "".concat(name, "="); var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var cookie = cookies[i]; while (cookie.charAt(0) === ' ') { cookie = cookie.substring(1); } if (cookie.indexOf(prefix) === 0) { return cookie.substring(prefix.length, cookie.length); } } return undefined; } function getInsightsAnonymousUserToken() { return getCookie(ANONYMOUS_TOKEN_COOKIE_KEY); } exports.Breadcrumb = Breadcrumb$2; exports.ClearRefinements = ClearRefinements$2; exports.Configure = Configure; exports.CurrentRefinements = CurrentRefinements$2; exports.ExperimentalConfigureRelatedItems = ConfigureRelatedItems$1; exports.HierarchicalMenu = HierarchicalMenu$2; exports.Highlight = Highlight$2; exports.Hits = Hits$1; exports.HitsPerPage = HitsPerPage$1; exports.Index = IndexWrapper; exports.InfiniteHits = InfiniteHits$2; exports.InstantSearch = InstantSearch; exports.Menu = Menu$2; exports.MenuSelect = MenuSelect$2; exports.NumericMenu = NumericMenu$2; exports.Pagination = Pagination$2; exports.Panel = Panel; exports.PoweredBy = PoweredBy$2; exports.RangeInput = RangeInput$1; exports.RangeSlider = RangeSlider; exports.RatingMenu = RatingMenu$2; exports.RefinementList = RefinementList$3; exports.ScrollTo = ScrollTo$1; exports.SearchBox = SearchBox$2; exports.Snippet = Snippet$1; exports.SortBy = SortBy$1; exports.Stats = Stats$2; exports.ToggleRefinement = ToggleRefinement$1; exports.getInsightsAnonymousUserToken = getInsightsAnonymousUserToken; Object.defineProperty(exports, '__esModule', { value: true }); })); //# sourceMappingURL=Dom.js.map
ajax/libs/material-ui/4.9.4/es/BottomNavigationAction/BottomNavigationAction.js
cdnjs/cdnjs
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import withStyles from '../styles/withStyles'; import ButtonBase from '../ButtonBase'; import unsupportedProp from '../utils/unsupportedProp'; export const styles = theme => ({ /* Styles applied to the root element. */ root: { transition: theme.transitions.create(['color', 'padding-top'], { duration: theme.transitions.duration.short }), padding: '6px 12px 8px', minWidth: 80, maxWidth: 168, color: theme.palette.text.secondary, flex: '1', '&$iconOnly': { paddingTop: 16 }, '&$selected': { paddingTop: 6, color: theme.palette.primary.main } }, /* Pseudo-class applied to the root element if selected. */ selected: {}, /* Pseudo-class applied to the root element if `showLabel={false}` and not selected. */ iconOnly: {}, /* Styles applied to the span element that wraps the icon and label. */ wrapper: { display: 'inline-flex', alignItems: 'center', justifyContent: 'center', width: '100%', flexDirection: 'column' }, /* Styles applied to the label's span element. */ label: { fontFamily: theme.typography.fontFamily, fontSize: theme.typography.pxToRem(12), opacity: 1, transition: 'font-size 0.2s, opacity 0.2s', transitionDelay: '0.1s', '&$iconOnly': { opacity: 0, transitionDelay: '0s' }, '&$selected': { fontSize: theme.typography.pxToRem(14) } } }); const BottomNavigationAction = React.forwardRef(function BottomNavigationAction(props, ref) { const { classes, className, icon, label, onChange, onClick, selected, showLabel, value } = props, other = _objectWithoutPropertiesLoose(props, ["classes", "className", "icon", "label", "onChange", "onClick", "selected", "showLabel", "value"]); const handleChange = event => { if (onChange) { onChange(event, value); } if (onClick) { onClick(event); } }; return React.createElement(ButtonBase, _extends({ ref: ref, className: clsx(classes.root, className, selected ? classes.selected : !showLabel && classes.iconOnly), focusRipple: true, onClick: handleChange }, other), React.createElement("span", { className: classes.wrapper }, icon, React.createElement("span", { className: clsx(classes.label, selected ? classes.selected : !showLabel && classes.iconOnly) }, label))); }); process.env.NODE_ENV !== "production" ? BottomNavigationAction.propTypes = { /** * This prop isn't supported. * Use the `component` prop if you need to change the children structure. */ children: unsupportedProp, /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * @ignore */ className: PropTypes.string, /** * The icon element. */ icon: PropTypes.node, /** * The label element. */ label: PropTypes.node, /** * @ignore */ onChange: PropTypes.func, /** * @ignore */ onClick: PropTypes.func, /** * @ignore */ selected: PropTypes.bool, /** * If `true`, the `BottomNavigationAction` will show its label. * By default, only the selected `BottomNavigationAction` * inside `BottomNavigation` will show its label. */ showLabel: PropTypes.bool, /** * You can provide your own value. Otherwise, we fallback to the child position index. */ value: PropTypes.any } : void 0; export default withStyles(styles, { name: 'MuiBottomNavigationAction' })(BottomNavigationAction);
ajax/libs/primereact/6.5.1/menu/menu.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; import { OverlayService, DomHandler, ZIndexUtils, ConnectedOverlayScrollHandler, classNames, ObjectUtils, CSSTransition, Portal } from 'primereact/core'; 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); return Constructor; } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); } 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); } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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; } 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 _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; } } var Menu = /*#__PURE__*/function (_Component) { _inherits(Menu, _Component); var _super = _createSuper(Menu); function Menu(props) { var _this; _classCallCheck(this, Menu); _this = _super.call(this, props); _this.state = { visible: !props.popup }; _this.onEnter = _this.onEnter.bind(_assertThisInitialized(_this)); _this.onEntered = _this.onEntered.bind(_assertThisInitialized(_this)); _this.onExit = _this.onExit.bind(_assertThisInitialized(_this)); _this.onExited = _this.onExited.bind(_assertThisInitialized(_this)); _this.onPanelClick = _this.onPanelClick.bind(_assertThisInitialized(_this)); _this.menuRef = /*#__PURE__*/React.createRef(); return _this; } _createClass(Menu, [{ key: "onPanelClick", value: function onPanelClick(event) { if (this.props.popup) { OverlayService.emit('overlay-click', { originalEvent: event, target: this.target }); } } }, { key: "onItemClick", value: function onItemClick(event, item) { if (item.disabled) { event.preventDefault(); return; } if (!item.url) { event.preventDefault(); } if (item.command) { item.command({ originalEvent: event, item: item }); } if (this.props.popup) { this.hide(event); } } }, { key: "onItemKeyDown", value: function onItemKeyDown(event, item) { var listItem = event.currentTarget.parentElement; switch (event.which) { //down case 40: var nextItem = this.findNextItem(listItem); if (nextItem) { nextItem.children[0].focus(); } event.preventDefault(); break; //up case 38: var prevItem = this.findPrevItem(listItem); if (prevItem) { prevItem.children[0].focus(); } event.preventDefault(); break; } } }, { key: "findNextItem", value: function findNextItem(item) { var nextItem = item.nextElementSibling; if (nextItem) return DomHandler.hasClass(nextItem, 'p-disabled') || !DomHandler.hasClass(nextItem, 'p-menuitem') ? this.findNextItem(nextItem) : nextItem;else return null; } }, { key: "findPrevItem", value: function findPrevItem(item) { var prevItem = item.previousElementSibling; if (prevItem) return DomHandler.hasClass(prevItem, 'p-disabled') || !DomHandler.hasClass(prevItem, 'p-menuitem') ? this.findPrevItem(prevItem) : prevItem;else return null; } }, { key: "toggle", value: function toggle(event) { if (this.props.popup) { if (this.state.visible) this.hide(event);else this.show(event); } } }, { key: "show", value: function show(event) { var _this2 = this; this.target = event.currentTarget; var currentEvent = event; this.setState({ visible: true }, function () { if (_this2.props.onShow) { _this2.props.onShow(currentEvent); } }); } }, { key: "hide", value: function hide(event) { var _this3 = this; var currentEvent = event; this.setState({ visible: false }, function () { if (_this3.props.onHide) { _this3.props.onHide(currentEvent); } }); } }, { key: "onEnter", value: function onEnter() { ZIndexUtils.set('menu', this.menuRef.current, this.props.baseZIndex); DomHandler.absolutePosition(this.menuRef.current, this.target); } }, { key: "onEntered", value: function onEntered() { this.bindDocumentListeners(); this.bindScrollListener(); } }, { key: "onExit", value: function onExit() { this.target = null; this.unbindDocumentListeners(); this.unbindScrollListener(); } }, { key: "onExited", value: function onExited() { ZIndexUtils.clear(this.menuRef.current); } }, { key: "bindDocumentListeners", value: function bindDocumentListeners() { var _this4 = this; if (!this.documentClickListener) { this.documentClickListener = function (event) { if (_this4.state.visible && _this4.isOutsideClicked(event)) { _this4.hide(event); } }; document.addEventListener('click', this.documentClickListener); } if (!this.documentResizeListener) { this.documentResizeListener = function (event) { if (_this4.state.visible && !DomHandler.isAndroid()) { _this4.hide(event); } }; window.addEventListener('resize', this.documentResizeListener); } } }, { key: "unbindDocumentListeners", value: function unbindDocumentListeners() { if (this.documentClickListener) { document.removeEventListener('click', this.documentClickListener); this.documentClickListener = null; } if (this.documentResizeListener) { window.removeEventListener('resize', this.documentResizeListener); this.documentResizeListener = null; } } }, { key: "bindScrollListener", value: function bindScrollListener() { var _this5 = this; if (!this.scrollHandler) { this.scrollHandler = new ConnectedOverlayScrollHandler(this.target, function (event) { if (_this5.state.visible) { _this5.hide(event); } }); } this.scrollHandler.bindScrollListener(); } }, { key: "unbindScrollListener", value: function unbindScrollListener() { if (this.scrollHandler) { this.scrollHandler.unbindScrollListener(); } } }, { key: "isOutsideClicked", value: function isOutsideClicked(event) { return this.menuRef && this.menuRef.current && !(this.menuRef.current.isSameNode(event.target) || this.menuRef.current.contains(event.target)); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.unbindDocumentListeners(); if (this.scrollHandler) { this.scrollHandler.destroy(); this.scrollHandler = null; } ZIndexUtils.clear(this.menuRef.current); } }, { key: "renderSubmenu", value: function renderSubmenu(submenu, index) { var _this6 = this; var className = classNames('p-submenu-header', { 'p-disabled': submenu.disabled }, submenu.className); var items = submenu.items.map(function (item, index) { return _this6.renderMenuitem(item, index); }); return /*#__PURE__*/React.createElement(React.Fragment, { key: submenu.label + '_' + index }, /*#__PURE__*/React.createElement("li", { className: className, style: submenu.style, role: "presentation", "aria-disabled": submenu.disabled }, submenu.label), items); } }, { key: "renderSeparator", value: function renderSeparator(index) { return /*#__PURE__*/React.createElement("li", { key: 'separator_' + index, className: "p-menu-separator", role: "separator" }); } }, { key: "renderMenuitem", value: function renderMenuitem(item, index) { var _this7 = this; var className = classNames('p-menuitem', item.className); var linkClassName = classNames('p-menuitem-link', { 'p-disabled': item.disabled }); var iconClassName = classNames('p-menuitem-icon', item.icon); var icon = item.icon && /*#__PURE__*/React.createElement("span", { className: iconClassName }); var label = item.label && /*#__PURE__*/React.createElement("span", { className: "p-menuitem-text" }, item.label); var tabIndex = item.disabled ? null : 0; var content = /*#__PURE__*/React.createElement("a", { href: item.url || '#', className: linkClassName, role: "menuitem", target: item.target, onClick: function onClick(event) { return _this7.onItemClick(event, item); }, onKeyDown: function onKeyDown(event) { return _this7.onItemKeyDown(event, item); }, tabIndex: tabIndex, "aria-disabled": item.disabled }, icon, label); if (item.template) { var defaultContentOptions = { onClick: function onClick(event) { return _this7.onItemClick(event, item); }, onKeyDown: function onKeyDown(event) { return _this7.onItemKeyDown(event, item); }, className: linkClassName, tabIndex: tabIndex, labelClassName: 'p-menuitem-text', iconClassName: iconClassName, element: content, props: this.props }; content = ObjectUtils.getJSXElement(item.template, item, defaultContentOptions); } return /*#__PURE__*/React.createElement("li", { key: item.label + '_' + index, className: className, style: item.style, role: "none" }, content); } }, { key: "renderItem", value: function renderItem(item, index) { if (item.separator) { return this.renderSeparator(index); } else { if (item.items) return this.renderSubmenu(item, index);else return this.renderMenuitem(item, index); } } }, { key: "renderMenu", value: function renderMenu() { var _this8 = this; return this.props.model.map(function (item, index) { return _this8.renderItem(item, index); }); } }, { key: "renderElement", value: function renderElement() { if (this.props.model) { var className = classNames('p-menu p-component', this.props.className, { 'p-menu-overlay': this.props.popup }); var menuitems = this.renderMenu(); return /*#__PURE__*/React.createElement(CSSTransition, { nodeRef: this.menuRef, classNames: "p-connected-overlay", in: this.state.visible, timeout: { enter: 120, exit: 100 }, options: this.props.transitionOptions, unmountOnExit: true, onEnter: this.onEnter, onEntered: this.onEntered, onExit: this.onExit, onExited: this.onExited }, /*#__PURE__*/React.createElement("div", { ref: this.menuRef, id: this.props.id, className: className, style: this.props.style, onClick: this.onPanelClick }, /*#__PURE__*/React.createElement("ul", { className: "p-menu-list p-reset", role: "menu" }, menuitems))); } return null; } }, { key: "render", value: function render() { var element = this.renderElement(); return this.props.popup ? /*#__PURE__*/React.createElement(Portal, { element: element, appendTo: this.props.appendTo }) : element; } }]); return Menu; }(Component); _defineProperty(Menu, "defaultProps", { id: null, model: null, popup: false, style: null, className: null, autoZIndex: true, baseZIndex: 0, appendTo: null, transitionOptions: null, onShow: null, onHide: null }); export { Menu };
ajax/libs/react-native-web/0.0.0-80dae21e2/exports/Touchable/index.js
cdnjs/cdnjs
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * * @format */ 'use strict'; function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { 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; } import AccessibilityUtil from '../../modules/AccessibilityUtil'; import BoundingDimensions from './BoundingDimensions'; import findNodeHandle from '../findNodeHandle'; import normalizeColor from 'normalize-css-color'; import Position from './Position'; import React from 'react'; import UIManager from '../UIManager'; import View from '../View'; var extractSingleTouch = function extractSingleTouch(nativeEvent) { var touches = nativeEvent.touches; var changedTouches = nativeEvent.changedTouches; var hasTouches = touches && touches.length > 0; var hasChangedTouches = changedTouches && changedTouches.length > 0; return !hasTouches && hasChangedTouches ? changedTouches[0] : hasTouches ? touches[0] : nativeEvent; }; /** * `Touchable`: Taps done right. * * You hook your `ResponderEventPlugin` events into `Touchable`. `Touchable` * will measure time/geometry and tells you when to give feedback to the user. * * ====================== Touchable Tutorial =============================== * The `Touchable` mixin helps you handle the "press" interaction. It analyzes * the geometry of elements, and observes when another responder (scroll view * etc) has stolen the touch lock. It notifies your component when it should * give feedback to the user. (bouncing/highlighting/unhighlighting). * * - When a touch was activated (typically you highlight) * - When a touch was deactivated (typically you unhighlight) * - When a touch was "pressed" - a touch ended while still within the geometry * of the element, and no other element (like scroller) has "stolen" touch * lock ("responder") (Typically you bounce the element). * * A good tap interaction isn't as simple as you might think. There should be a * slight delay before showing a highlight when starting a touch. If a * subsequent touch move exceeds the boundary of the element, it should * unhighlight, but if that same touch is brought back within the boundary, it * should rehighlight again. A touch can move in and out of that boundary * several times, each time toggling highlighting, but a "press" is only * triggered if that touch ends while within the element's boundary and no * scroller (or anything else) has stolen the lock on touches. * * To create a new type of component that handles interaction using the * `Touchable` mixin, do the following: * * - Initialize the `Touchable` state. * * getInitialState: function() { * return merge(this.touchableGetInitialState(), yourComponentState); * } * * - Choose the rendered component who's touches should start the interactive * sequence. On that rendered node, forward all `Touchable` responder * handlers. You can choose any rendered node you like. Choose a node whose * hit target you'd like to instigate the interaction sequence: * * // In render function: * return ( * <View * onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder} * onResponderTerminationRequest={this.touchableHandleResponderTerminationRequest} * onResponderGrant={this.touchableHandleResponderGrant} * onResponderMove={this.touchableHandleResponderMove} * onResponderRelease={this.touchableHandleResponderRelease} * onResponderTerminate={this.touchableHandleResponderTerminate}> * <View> * Even though the hit detection/interactions are triggered by the * wrapping (typically larger) node, we usually end up implementing * custom logic that highlights this inner one. * </View> * </View> * ); * * - You may set up your own handlers for each of these events, so long as you * also invoke the `touchable*` handlers inside of your custom handler. * * - Implement the handlers on your component class in order to provide * feedback to the user. See documentation for each of these class methods * that you should implement. * * touchableHandlePress: function() { * this.performBounceAnimation(); // or whatever you want to do. * }, * touchableHandleActivePressIn: function() { * this.beginHighlighting(...); // Whatever you like to convey activation * }, * touchableHandleActivePressOut: function() { * this.endHighlighting(...); // Whatever you like to convey deactivation * }, * * - There are more advanced methods you can implement (see documentation below): * touchableGetHighlightDelayMS: function() { * return 20; * } * // In practice, *always* use a predeclared constant (conserve memory). * touchableGetPressRectOffset: function() { * return {top: 20, left: 20, right: 20, bottom: 100}; * } */ /** * Touchable states. */ var States = { NOT_RESPONDER: 'NOT_RESPONDER', // Not the responder RESPONDER_INACTIVE_PRESS_IN: 'RESPONDER_INACTIVE_PRESS_IN', // Responder, inactive, in the `PressRect` RESPONDER_INACTIVE_PRESS_OUT: 'RESPONDER_INACTIVE_PRESS_OUT', // Responder, inactive, out of `PressRect` RESPONDER_ACTIVE_PRESS_IN: 'RESPONDER_ACTIVE_PRESS_IN', // Responder, active, in the `PressRect` RESPONDER_ACTIVE_PRESS_OUT: 'RESPONDER_ACTIVE_PRESS_OUT', // Responder, active, out of `PressRect` RESPONDER_ACTIVE_LONG_PRESS_IN: 'RESPONDER_ACTIVE_LONG_PRESS_IN', // Responder, active, in the `PressRect`, after long press threshold RESPONDER_ACTIVE_LONG_PRESS_OUT: 'RESPONDER_ACTIVE_LONG_PRESS_OUT', // Responder, active, out of `PressRect`, after long press threshold ERROR: 'ERROR' }; /* * Quick lookup map for states that are considered to be "active" */ var baseStatesConditions = { NOT_RESPONDER: false, RESPONDER_INACTIVE_PRESS_IN: false, RESPONDER_INACTIVE_PRESS_OUT: false, RESPONDER_ACTIVE_PRESS_IN: false, RESPONDER_ACTIVE_PRESS_OUT: false, RESPONDER_ACTIVE_LONG_PRESS_IN: false, RESPONDER_ACTIVE_LONG_PRESS_OUT: false, ERROR: false }; var IsActive = _objectSpread({}, baseStatesConditions, { RESPONDER_ACTIVE_PRESS_OUT: true, RESPONDER_ACTIVE_PRESS_IN: true }); /** * Quick lookup for states that are considered to be "pressing" and are * therefore eligible to result in a "selection" if the press stops. */ var IsPressingIn = _objectSpread({}, baseStatesConditions, { RESPONDER_INACTIVE_PRESS_IN: true, RESPONDER_ACTIVE_PRESS_IN: true, RESPONDER_ACTIVE_LONG_PRESS_IN: true }); var IsLongPressingIn = _objectSpread({}, baseStatesConditions, { RESPONDER_ACTIVE_LONG_PRESS_IN: true }); /** * Inputs to the state machine. */ var Signals = { DELAY: 'DELAY', RESPONDER_GRANT: 'RESPONDER_GRANT', RESPONDER_RELEASE: 'RESPONDER_RELEASE', RESPONDER_TERMINATED: 'RESPONDER_TERMINATED', ENTER_PRESS_RECT: 'ENTER_PRESS_RECT', LEAVE_PRESS_RECT: 'LEAVE_PRESS_RECT', LONG_PRESS_DETECTED: 'LONG_PRESS_DETECTED' }; /** * Mapping from States x Signals => States */ var Transitions = { NOT_RESPONDER: { DELAY: States.ERROR, RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN, RESPONDER_RELEASE: States.ERROR, RESPONDER_TERMINATED: States.ERROR, ENTER_PRESS_RECT: States.ERROR, LEAVE_PRESS_RECT: States.ERROR, LONG_PRESS_DETECTED: States.ERROR }, RESPONDER_INACTIVE_PRESS_IN: { DELAY: States.RESPONDER_ACTIVE_PRESS_IN, RESPONDER_GRANT: States.ERROR, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN, LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT, LONG_PRESS_DETECTED: States.ERROR }, RESPONDER_INACTIVE_PRESS_OUT: { DELAY: States.RESPONDER_ACTIVE_PRESS_OUT, RESPONDER_GRANT: States.ERROR, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN, LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT, LONG_PRESS_DETECTED: States.ERROR }, RESPONDER_ACTIVE_PRESS_IN: { DELAY: States.ERROR, RESPONDER_GRANT: States.ERROR, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN, LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT, LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN }, RESPONDER_ACTIVE_PRESS_OUT: { DELAY: States.ERROR, RESPONDER_GRANT: States.ERROR, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN, LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT, LONG_PRESS_DETECTED: States.ERROR }, RESPONDER_ACTIVE_LONG_PRESS_IN: { DELAY: States.ERROR, RESPONDER_GRANT: States.ERROR, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN, LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT, LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN }, RESPONDER_ACTIVE_LONG_PRESS_OUT: { DELAY: States.ERROR, RESPONDER_GRANT: States.ERROR, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN, LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT, LONG_PRESS_DETECTED: States.ERROR }, error: { DELAY: States.NOT_RESPONDER, RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.NOT_RESPONDER, LEAVE_PRESS_RECT: States.NOT_RESPONDER, LONG_PRESS_DETECTED: States.NOT_RESPONDER } }; // ==== Typical Constants for integrating into UI components ==== // var HIT_EXPAND_PX = 20; // var HIT_VERT_OFFSET_PX = 10; var HIGHLIGHT_DELAY_MS = 130; var PRESS_EXPAND_PX = 20; var LONG_PRESS_THRESHOLD = 500; var LONG_PRESS_DELAY_MS = LONG_PRESS_THRESHOLD - HIGHLIGHT_DELAY_MS; var LONG_PRESS_ALLOWED_MOVEMENT = 10; // Default amount "active" region protrudes beyond box /** * By convention, methods prefixed with underscores are meant to be @private, * and not @protected. Mixers shouldn't access them - not even to provide them * as callback handlers. * * * ========== Geometry ========= * `Touchable` only assumes that there exists a `HitRect` node. The `PressRect` * is an abstract box that is extended beyond the `HitRect`. * * +--------------------------+ * | | - "Start" events in `HitRect` cause `HitRect` * | +--------------------+ | to become the responder. * | | +--------------+ | | - `HitRect` is typically expanded around * | | | | | | the `VisualRect`, but shifted downward. * | | | VisualRect | | | - After pressing down, after some delay, * | | | | | | and before letting up, the Visual React * | | +--------------+ | | will become "active". This makes it eligible * | | HitRect | | for being highlighted (so long as the * | +--------------------+ | press remains in the `PressRect`). * | PressRect o | * +----------------------|---+ * Out Region | * +-----+ This gap between the `HitRect` and * `PressRect` allows a touch to move far away * from the original hit rect, and remain * highlighted, and eligible for a "Press". * Customize this via * `touchableGetPressRectOffset()`. * * * * ======= State Machine ======= * * +-------------+ <---+ RESPONDER_RELEASE * |NOT_RESPONDER| * +-------------+ <---+ RESPONDER_TERMINATED * + * | RESPONDER_GRANT (HitRect) * v * +---------------------------+ DELAY +-------------------------+ T + DELAY +------------------------------+ * |RESPONDER_INACTIVE_PRESS_IN|+-------->|RESPONDER_ACTIVE_PRESS_IN| +------------> |RESPONDER_ACTIVE_LONG_PRESS_IN| * +---------------------------+ +-------------------------+ +------------------------------+ * + ^ + ^ + ^ * |LEAVE_ |ENTER_ |LEAVE_ |ENTER_ |LEAVE_ |ENTER_ * |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT * | | | | | | * v + v + v + * +----------------------------+ DELAY +--------------------------+ +-------------------------------+ * |RESPONDER_INACTIVE_PRESS_OUT|+------->|RESPONDER_ACTIVE_PRESS_OUT| |RESPONDER_ACTIVE_LONG_PRESS_OUT| * +----------------------------+ +--------------------------+ +-------------------------------+ * * T + DELAY => LONG_PRESS_DELAY_MS + DELAY * * Not drawn are the side effects of each transition. The most important side * effect is the `touchableHandlePress` abstract method invocation that occurs * when a responder is released while in either of the "Press" states. * * The other important side effects are the highlight abstract method * invocations (internal callbacks) to be implemented by the mixer. * * * @lends Touchable.prototype */ var TouchableMixin = { // HACK (part 1): basic support for touchable interactions using a keyboard componentDidMount: function componentDidMount() { var _this = this; this._touchableNode = findNodeHandle(this); if (this._touchableNode && this._touchableNode.addEventListener) { this._touchableBlurListener = function (e) { if (_this._isTouchableKeyboardActive) { if (_this.state.touchable.touchState && _this.state.touchable.touchState !== States.NOT_RESPONDER) { _this.touchableHandleResponderTerminate({ nativeEvent: e }); } _this._isTouchableKeyboardActive = false; } }; this._touchableNode.addEventListener('blur', this._touchableBlurListener); } }, /** * Clear all timeouts on unmount */ componentWillUnmount: function componentWillUnmount() { if (this._touchableNode && this._touchableNode.addEventListener) { this._touchableNode.removeEventListener('blur', this._touchableBlurListener); } this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout); this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout); this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout); }, /** * It's prefer that mixins determine state in this way, having the class * explicitly mix the state in the one and only `getInitialState` method. * * @return {object} State object to be placed inside of * `this.state.touchable`. */ touchableGetInitialState: function touchableGetInitialState() { return { touchable: { touchState: undefined, responderID: null } }; }, // ==== Hooks to Gesture Responder system ==== /** * Must return true if embedded in a native platform scroll view. */ touchableHandleResponderTerminationRequest: function touchableHandleResponderTerminationRequest() { return !this.props.rejectResponderTermination; }, /** * Must return true to start the process of `Touchable`. */ touchableHandleStartShouldSetResponder: function touchableHandleStartShouldSetResponder() { return !this.props.disabled; }, /** * Return true to cancel press on long press. */ touchableLongPressCancelsPress: function touchableLongPressCancelsPress() { return true; }, /** * Place as callback for a DOM element's `onResponderGrant` event. * @param {SyntheticEvent} e Synthetic event from event system. * */ touchableHandleResponderGrant: function touchableHandleResponderGrant(e) { var dispatchID = e.currentTarget; // Since e is used in a callback invoked on another event loop // (as in setTimeout etc), we need to call e.persist() on the // event to make sure it doesn't get reused in the event object pool. e.persist(); this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout); this.pressOutDelayTimeout = null; this.state.touchable.touchState = States.NOT_RESPONDER; this.state.touchable.responderID = dispatchID; this._receiveSignal(Signals.RESPONDER_GRANT, e); var delayMS = this.touchableGetHighlightDelayMS !== undefined ? Math.max(this.touchableGetHighlightDelayMS(), 0) : HIGHLIGHT_DELAY_MS; delayMS = isNaN(delayMS) ? HIGHLIGHT_DELAY_MS : delayMS; if (delayMS !== 0) { this.touchableDelayTimeout = setTimeout(this._handleDelay.bind(this, e), delayMS); } else { this._handleDelay(e); } var longDelayMS = this.touchableGetLongPressDelayMS !== undefined ? Math.max(this.touchableGetLongPressDelayMS(), 10) : LONG_PRESS_DELAY_MS; longDelayMS = isNaN(longDelayMS) ? LONG_PRESS_DELAY_MS : longDelayMS; this.longPressDelayTimeout = setTimeout(this._handleLongDelay.bind(this, e), longDelayMS + delayMS); }, /** * Place as callback for a DOM element's `onResponderRelease` event. */ touchableHandleResponderRelease: function touchableHandleResponderRelease(e) { this.pressInLocation = null; this._receiveSignal(Signals.RESPONDER_RELEASE, e); }, /** * Place as callback for a DOM element's `onResponderTerminate` event. */ touchableHandleResponderTerminate: function touchableHandleResponderTerminate(e) { this.pressInLocation = null; this._receiveSignal(Signals.RESPONDER_TERMINATED, e); }, /** * Place as callback for a DOM element's `onResponderMove` event. */ touchableHandleResponderMove: function touchableHandleResponderMove(e) { // Measurement may not have returned yet. if (!this.state.touchable.positionOnActivate) { return; } var positionOnActivate = this.state.touchable.positionOnActivate; var dimensionsOnActivate = this.state.touchable.dimensionsOnActivate; var pressRectOffset = this.touchableGetPressRectOffset ? this.touchableGetPressRectOffset() : { left: PRESS_EXPAND_PX, right: PRESS_EXPAND_PX, top: PRESS_EXPAND_PX, bottom: PRESS_EXPAND_PX }; var pressExpandLeft = pressRectOffset.left; var pressExpandTop = pressRectOffset.top; var pressExpandRight = pressRectOffset.right; var pressExpandBottom = pressRectOffset.bottom; var hitSlop = this.touchableGetHitSlop ? this.touchableGetHitSlop() : null; if (hitSlop) { pressExpandLeft += hitSlop.left || 0; pressExpandTop += hitSlop.top || 0; pressExpandRight += hitSlop.right || 0; pressExpandBottom += hitSlop.bottom || 0; } var touch = extractSingleTouch(e.nativeEvent); var pageX = touch && touch.pageX; var pageY = touch && touch.pageY; if (this.pressInLocation) { var movedDistance = this._getDistanceBetweenPoints(pageX, pageY, this.pressInLocation.pageX, this.pressInLocation.pageY); if (movedDistance > LONG_PRESS_ALLOWED_MOVEMENT) { this._cancelLongPressDelayTimeout(); } } var isTouchWithinActive = pageX > positionOnActivate.left - pressExpandLeft && pageY > positionOnActivate.top - pressExpandTop && pageX < positionOnActivate.left + dimensionsOnActivate.width + pressExpandRight && pageY < positionOnActivate.top + dimensionsOnActivate.height + pressExpandBottom; if (isTouchWithinActive) { var prevState = this.state.touchable.touchState; this._receiveSignal(Signals.ENTER_PRESS_RECT, e); var curState = this.state.touchable.touchState; if (curState === States.RESPONDER_INACTIVE_PRESS_IN && prevState !== States.RESPONDER_INACTIVE_PRESS_IN) { // fix for t7967420 this._cancelLongPressDelayTimeout(); } } else { this._cancelLongPressDelayTimeout(); this._receiveSignal(Signals.LEAVE_PRESS_RECT, e); } }, /** * Invoked when the item receives focus. Mixers might override this to * visually distinguish the `VisualRect` so that the user knows that it * currently has the focus. Most platforms only support a single element being * focused at a time, in which case there may have been a previously focused * element that was blurred just prior to this. This can be overridden when * using `Touchable.Mixin.withoutDefaultFocusAndBlur`. */ touchableHandleFocus: function touchableHandleFocus(e) { this.props.onFocus && this.props.onFocus(e); }, /** * Invoked when the item loses focus. Mixers might override this to * visually distinguish the `VisualRect` so that the user knows that it * no longer has focus. Most platforms only support a single element being * focused at a time, in which case the focus may have moved to another. * This can be overridden when using * `Touchable.Mixin.withoutDefaultFocusAndBlur`. */ touchableHandleBlur: function touchableHandleBlur(e) { this.props.onBlur && this.props.onBlur(e); }, // ==== Abstract Application Callbacks ==== /** * Invoked when the item should be highlighted. Mixers should implement this * to visually distinguish the `VisualRect` so that the user knows that * releasing a touch will result in a "selection" (analog to click). * * @abstract * touchableHandleActivePressIn: function, */ /** * Invoked when the item is "active" (in that it is still eligible to become * a "select") but the touch has left the `PressRect`. Usually the mixer will * want to unhighlight the `VisualRect`. If the user (while pressing) moves * back into the `PressRect` `touchableHandleActivePressIn` will be invoked * again and the mixer should probably highlight the `VisualRect` again. This * event will not fire on an `touchEnd/mouseUp` event, only move events while * the user is depressing the mouse/touch. * * @abstract * touchableHandleActivePressOut: function */ /** * Invoked when the item is "selected" - meaning the interaction ended by * letting up while the item was either in the state * `RESPONDER_ACTIVE_PRESS_IN` or `RESPONDER_INACTIVE_PRESS_IN`. * * @abstract * touchableHandlePress: function */ /** * Invoked when the item is long pressed - meaning the interaction ended by * letting up while the item was in `RESPONDER_ACTIVE_LONG_PRESS_IN`. If * `touchableHandleLongPress` is *not* provided, `touchableHandlePress` will * be called as it normally is. If `touchableHandleLongPress` is provided, by * default any `touchableHandlePress` callback will not be invoked. To * override this default behavior, override `touchableLongPressCancelsPress` * to return false. As a result, `touchableHandlePress` will be called when * lifting up, even if `touchableHandleLongPress` has also been called. * * @abstract * touchableHandleLongPress: function */ /** * Returns the number of millis to wait before triggering a highlight. * * @abstract * touchableGetHighlightDelayMS: function */ /** * Returns the amount to extend the `HitRect` into the `PressRect`. Positive * numbers mean the size expands outwards. * * @abstract * touchableGetPressRectOffset: function */ // ==== Internal Logic ==== /** * Measures the `HitRect` node on activation. The Bounding rectangle is with * respect to viewport - not page, so adding the `pageXOffset/pageYOffset` * should result in points that are in the same coordinate system as an * event's `globalX/globalY` data values. * * - Consider caching this for the lifetime of the component, or possibly * being able to share this cache between any `ScrollMap` view. * * @sideeffects * @private */ _remeasureMetricsOnActivation: function _remeasureMetricsOnActivation() { var tag = this.state.touchable.responderID; if (tag == null) { return; } UIManager.measure(tag, this._handleQueryLayout); }, _handleQueryLayout: function _handleQueryLayout(l, t, w, h, globalX, globalY) { //don't do anything UIManager failed to measure node if (!l && !t && !w && !h && !globalX && !globalY) { return; } this.state.touchable.positionOnActivate && Position.release(this.state.touchable.positionOnActivate); this.state.touchable.dimensionsOnActivate && // $FlowFixMe BoundingDimensions.release(this.state.touchable.dimensionsOnActivate); this.state.touchable.positionOnActivate = Position.getPooled(globalX, globalY); // $FlowFixMe this.state.touchable.dimensionsOnActivate = BoundingDimensions.getPooled(w, h); }, _handleDelay: function _handleDelay(e) { this.touchableDelayTimeout = null; this._receiveSignal(Signals.DELAY, e); }, _handleLongDelay: function _handleLongDelay(e) { this.longPressDelayTimeout = null; var curState = this.state.touchable.touchState; if (curState !== States.RESPONDER_ACTIVE_PRESS_IN && curState !== States.RESPONDER_ACTIVE_LONG_PRESS_IN) { console.error('Attempted to transition from state `' + curState + '` to `' + States.RESPONDER_ACTIVE_LONG_PRESS_IN + '`, which is not supported. This is ' + 'most likely due to `Touchable.longPressDelayTimeout` not being cancelled.'); } else { this._receiveSignal(Signals.LONG_PRESS_DETECTED, e); } }, /** * Receives a state machine signal, performs side effects of the transition * and stores the new state. Validates the transition as well. * * @param {Signals} signal State machine signal. * @throws Error if invalid state transition or unrecognized signal. * @sideeffects */ _receiveSignal: function _receiveSignal(signal, e) { var responderID = this.state.touchable.responderID; var curState = this.state.touchable.touchState; var nextState = Transitions[curState] && Transitions[curState][signal]; if (!responderID && signal === Signals.RESPONDER_RELEASE) { return; } if (!nextState) { throw new Error('Unrecognized signal `' + signal + '` or state `' + curState + '` for Touchable responder `' + responderID + '`'); } if (nextState === States.ERROR) { throw new Error('Touchable cannot transition from `' + curState + '` to `' + signal + '` for responder `' + responderID + '`'); } if (curState !== nextState) { this._performSideEffectsForTransition(curState, nextState, signal, e); this.state.touchable.touchState = nextState; } }, _cancelLongPressDelayTimeout: function _cancelLongPressDelayTimeout() { this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout); this.longPressDelayTimeout = null; }, _isHighlight: function _isHighlight(state) { return state === States.RESPONDER_ACTIVE_PRESS_IN || state === States.RESPONDER_ACTIVE_LONG_PRESS_IN; }, _savePressInLocation: function _savePressInLocation(e) { var touch = extractSingleTouch(e.nativeEvent); var pageX = touch && touch.pageX; var pageY = touch && touch.pageY; var locationX = touch && touch.locationX; var locationY = touch && touch.locationY; this.pressInLocation = { pageX: pageX, pageY: pageY, locationX: locationX, locationY: locationY }; }, _getDistanceBetweenPoints: function _getDistanceBetweenPoints(aX, aY, bX, bY) { var deltaX = aX - bX; var deltaY = aY - bY; return Math.sqrt(deltaX * deltaX + deltaY * deltaY); }, /** * Will perform a transition between touchable states, and identify any * highlighting or unhighlighting that must be performed for this particular * transition. * * @param {States} curState Current Touchable state. * @param {States} nextState Next Touchable state. * @param {Signal} signal Signal that triggered the transition. * @param {Event} e Native event. * @sideeffects */ _performSideEffectsForTransition: function _performSideEffectsForTransition(curState, nextState, signal, e) { var curIsHighlight = this._isHighlight(curState); var newIsHighlight = this._isHighlight(nextState); var isFinalSignal = signal === Signals.RESPONDER_TERMINATED || signal === Signals.RESPONDER_RELEASE; if (isFinalSignal) { this._cancelLongPressDelayTimeout(); } var isInitialTransition = curState === States.NOT_RESPONDER && nextState === States.RESPONDER_INACTIVE_PRESS_IN; var isActiveTransition = !IsActive[curState] && IsActive[nextState]; if (isInitialTransition || isActiveTransition) { this._remeasureMetricsOnActivation(); } if (IsPressingIn[curState] && signal === Signals.LONG_PRESS_DETECTED) { this.touchableHandleLongPress && this.touchableHandleLongPress(e); } if (newIsHighlight && !curIsHighlight) { this._startHighlight(e); } else if (!newIsHighlight && curIsHighlight) { this._endHighlight(e); } if (IsPressingIn[curState] && signal === Signals.RESPONDER_RELEASE) { var hasLongPressHandler = !!this.props.onLongPress; var pressIsLongButStillCallOnPress = IsLongPressingIn[curState] && ( // We *are* long pressing.. // But either has no long handler !hasLongPressHandler || !this.touchableLongPressCancelsPress()); // or we're told to ignore it. var shouldInvokePress = !IsLongPressingIn[curState] || pressIsLongButStillCallOnPress; if (shouldInvokePress && this.touchableHandlePress) { if (!newIsHighlight && !curIsHighlight) { // we never highlighted because of delay, but we should highlight now this._startHighlight(e); this._endHighlight(e); } this.touchableHandlePress(e); } } this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout); this.touchableDelayTimeout = null; }, _playTouchSound: function _playTouchSound() { UIManager.playTouchSound(); }, _startHighlight: function _startHighlight(e) { this._savePressInLocation(e); this.touchableHandleActivePressIn && this.touchableHandleActivePressIn(e); }, _endHighlight: function _endHighlight(e) { var _this2 = this; if (this.touchableHandleActivePressOut) { if (this.touchableGetPressOutDelayMS && this.touchableGetPressOutDelayMS()) { this.pressOutDelayTimeout = setTimeout(function () { _this2.touchableHandleActivePressOut(e); }, this.touchableGetPressOutDelayMS()); } else { this.touchableHandleActivePressOut(e); } } }, // HACK (part 2): basic support for touchable interactions using a keyboard (including // delays and longPress) touchableHandleKeyEvent: function touchableHandleKeyEvent(e) { var type = e.type, key = e.key; if (key === 'Enter' || key === ' ') { if (type === 'keydown') { if (!this._isTouchableKeyboardActive) { if (!this.state.touchable.touchState || this.state.touchable.touchState === States.NOT_RESPONDER) { this.touchableHandleResponderGrant(e); this._isTouchableKeyboardActive = true; } } } else if (type === 'keyup') { if (this._isTouchableKeyboardActive) { if (this.state.touchable.touchState && this.state.touchable.touchState !== States.NOT_RESPONDER) { this.touchableHandleResponderRelease(e); this._isTouchableKeyboardActive = false; } } } e.stopPropagation(); // prevent the default behaviour unless the Touchable functions as a link // and Enter is pressed if (!(key === 'Enter' && AccessibilityUtil.propsToAriaRole(this.props) === 'link')) { e.preventDefault(); } } }, withoutDefaultFocusAndBlur: {} }; /** * Provide an optional version of the mixin where `touchableHandleFocus` and * `touchableHandleBlur` can be overridden. This allows appropriate defaults to * be set on TV platforms, without breaking existing implementations of * `Touchable`. */ var touchableHandleFocus = TouchableMixin.touchableHandleFocus, touchableHandleBlur = TouchableMixin.touchableHandleBlur, TouchableMixinWithoutDefaultFocusAndBlur = _objectWithoutPropertiesLoose(TouchableMixin, ["touchableHandleFocus", "touchableHandleBlur"]); TouchableMixin.withoutDefaultFocusAndBlur = TouchableMixinWithoutDefaultFocusAndBlur; var Touchable = { Mixin: TouchableMixin, TOUCH_TARGET_DEBUG: false, // Highlights all touchable targets. Toggle with Inspector. /** * Renders a debugging overlay to visualize touch target with hitSlop (might not work on Android). */ renderDebugView: function renderDebugView(_ref) { var color = _ref.color, hitSlop = _ref.hitSlop; if (!Touchable.TOUCH_TARGET_DEBUG) { return null; } if (process.env.NODE_ENV !== 'production') { throw Error('Touchable.TOUCH_TARGET_DEBUG should not be enabled in prod!'); } var debugHitSlopStyle = {}; hitSlop = hitSlop || { top: 0, bottom: 0, left: 0, right: 0 }; for (var key in hitSlop) { debugHitSlopStyle[key] = -hitSlop[key]; } var normalizedColor = normalizeColor(color); if (typeof normalizedColor !== 'number') { return null; } var hexColor = '#' + ('00000000' + normalizedColor.toString(16)).substr(-8); return React.createElement(View, { pointerEvents: "none", style: _objectSpread({ position: 'absolute', borderColor: hexColor.slice(0, -2) + '55', // More opaque borderWidth: 1, borderStyle: 'dashed', backgroundColor: hexColor.slice(0, -2) + '0F' }, debugHitSlopStyle) }); } }; export default Touchable;
ajax/libs/material-ui/4.11.1/esm/RootRef/RootRef.js
cdnjs/cdnjs
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; import _createClass from "@babel/runtime/helpers/esm/createClass"; import _inherits from "@babel/runtime/helpers/esm/inherits"; import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; 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 _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } import * as React from 'react'; import * as ReactDOM from 'react-dom'; import PropTypes from 'prop-types'; import { exactProp, refType } from '@material-ui/utils'; import setRef from '../utils/setRef'; /** * ⚠️⚠️⚠️ * If you want the DOM element of a Material-UI component check out * [FAQ: How can I access the DOM element?](/getting-started/faq/#how-can-i-access-the-dom-element) * first. * * This component uses `findDOMNode` which is deprecated in React.StrictMode. * * Helper component to allow attaching a ref to a * wrapped element to access the underlying DOM element. * * It's highly inspired by https://github.com/facebook/react/issues/11401#issuecomment-340543801. * For example: * ```jsx * import React from 'react'; * import RootRef from '@material-ui/core/RootRef'; * * function MyComponent() { * const domRef = React.useRef(); * * React.useEffect(() => { * console.log(domRef.current); // DOM node * }, []); * * return ( * <RootRef rootRef={domRef}> * <SomeChildComponent /> * </RootRef> * ); * } * ``` */ var RootRef = /*#__PURE__*/function (_React$Component) { _inherits(RootRef, _React$Component); var _super = _createSuper(RootRef); function RootRef() { _classCallCheck(this, RootRef); return _super.apply(this, arguments); } _createClass(RootRef, [{ key: "componentDidMount", value: function componentDidMount() { this.ref = ReactDOM.findDOMNode(this); setRef(this.props.rootRef, this.ref); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var ref = ReactDOM.findDOMNode(this); if (prevProps.rootRef !== this.props.rootRef || this.ref !== ref) { if (prevProps.rootRef !== this.props.rootRef) { setRef(prevProps.rootRef, null); } this.ref = ref; setRef(this.props.rootRef, this.ref); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.ref = null; setRef(this.props.rootRef, null); } }, { key: "render", value: function render() { return this.props.children; } }]); return RootRef; }(React.Component); process.env.NODE_ENV !== "production" ? RootRef.propTypes = { /** * The wrapped element. */ children: PropTypes.element.isRequired, /** * A ref that points to the first DOM node of the wrapped element. */ rootRef: refType.isRequired } : void 0; if (process.env.NODE_ENV !== 'production') { process.env.NODE_ENV !== "production" ? RootRef.propTypes = exactProp(RootRef.propTypes) : void 0; } export default RootRef;
ajax/libs/material-ui/4.12.3/es/RootRef/RootRef.js
cdnjs/cdnjs
import * as React from 'react'; import * as ReactDOM from 'react-dom'; import PropTypes from 'prop-types'; import { exactProp, refType } from '@material-ui/utils'; import setRef from '../utils/setRef'; let warnedOnce = false; /** * ⚠️⚠️⚠️ * If you want the DOM element of a Material-UI component check out * [FAQ: How can I access the DOM element?](/getting-started/faq/#how-can-i-access-the-dom-element) * first. * * This component uses `findDOMNode` which is deprecated in React.StrictMode. * * Helper component to allow attaching a ref to a * wrapped element to access the underlying DOM element. * * It's highly inspired by https://github.com/facebook/react/issues/11401#issuecomment-340543801. * For example: * ```jsx * import React from 'react'; * import RootRef from '@material-ui/core/RootRef'; * * function MyComponent() { * const domRef = React.useRef(); * * React.useEffect(() => { * console.log(domRef.current); // DOM node * }, []); * * return ( * <RootRef rootRef={domRef}> * <SomeChildComponent /> * </RootRef> * ); * } * ``` * * @deprecated */ class RootRef extends React.Component { componentDidMount() { this.ref = ReactDOM.findDOMNode(this); setRef(this.props.rootRef, this.ref); } componentDidUpdate(prevProps) { const ref = ReactDOM.findDOMNode(this); if (prevProps.rootRef !== this.props.rootRef || this.ref !== ref) { if (prevProps.rootRef !== this.props.rootRef) { setRef(prevProps.rootRef, null); } this.ref = ref; setRef(this.props.rootRef, this.ref); } } componentWillUnmount() { this.ref = null; setRef(this.props.rootRef, null); } render() { if (process.env.NODE_ENV !== 'production') { if (!warnedOnce) { warnedOnce = true; console.warn(['Material-UI: The RootRef component is deprecated.', 'The component relies on the ReactDOM.findDOMNode API which is deprecated in React.StrictMode.', 'Instead, you can get a reference to the underlying DOM node of the components via the `ref` prop.'].join('/n')); } } return this.props.children; } } process.env.NODE_ENV !== "production" ? RootRef.propTypes = { /** * The wrapped element. */ children: PropTypes.element.isRequired, /** * A ref that points to the first DOM node of the wrapped element. */ rootRef: refType.isRequired } : void 0; if (process.env.NODE_ENV !== 'production') { process.env.NODE_ENV !== "production" ? RootRef.propTypes = exactProp(RootRef.propTypes) : void 0; } export default RootRef;
ajax/libs/material-ui/5.0.0-alpha.2/esm/RootRef/RootRef.js
cdnjs/cdnjs
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; import _createClass from "@babel/runtime/helpers/esm/createClass"; import _inherits from "@babel/runtime/helpers/esm/inherits"; import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; 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 _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } import * as React from 'react'; import * as ReactDOM from 'react-dom'; import PropTypes from 'prop-types'; import { exactProp, refType } from '@material-ui/utils'; import setRef from '../utils/setRef'; /** * ⚠️⚠️⚠️ * If you want the DOM element of a Material-UI component check out * [FAQ: How can I access the DOM element?](/getting-started/faq/#how-can-i-access-the-dom-element) * first. * * This component uses `findDOMNode` which is deprecated in React.StrictMode. * * Helper component to allow attaching a ref to a * wrapped element to access the underlying DOM element. * * It's highly inspired by https://github.com/facebook/react/issues/11401#issuecomment-340543801. * For example: * ```jsx * import React from 'react'; * import RootRef from '@material-ui/core/RootRef'; * * function MyComponent() { * const domRef = React.useRef(); * * React.useEffect(() => { * console.log(domRef.current); // DOM node * }, []); * * return ( * <RootRef rootRef={domRef}> * <SomeChildComponent /> * </RootRef> * ); * } * ``` */ var RootRef = /*#__PURE__*/function (_React$Component) { _inherits(RootRef, _React$Component); var _super = _createSuper(RootRef); function RootRef() { _classCallCheck(this, RootRef); return _super.apply(this, arguments); } _createClass(RootRef, [{ key: "componentDidMount", value: function componentDidMount() { this.ref = ReactDOM.findDOMNode(this); setRef(this.props.rootRef, this.ref); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var ref = ReactDOM.findDOMNode(this); if (prevProps.rootRef !== this.props.rootRef || this.ref !== ref) { if (prevProps.rootRef !== this.props.rootRef) { setRef(prevProps.rootRef, null); } this.ref = ref; setRef(this.props.rootRef, this.ref); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.ref = null; setRef(this.props.rootRef, null); } }, { key: "render", value: function render() { return this.props.children; } }]); return RootRef; }(React.Component); process.env.NODE_ENV !== "production" ? RootRef.propTypes = { /** * The wrapped element. */ children: PropTypes.element.isRequired, /** * A ref that points to the first DOM node of the wrapped element. */ rootRef: refType.isRequired } : void 0; if (process.env.NODE_ENV !== 'production') { process.env.NODE_ENV !== "production" ? RootRef.propTypes = exactProp(RootRef.propTypes) : void 0; } export default RootRef;
ajax/libs/boardgame-io/0.47.5/esm/react.js
cdnjs/cdnjs
import 'nanoid'; import './Debug-aaa66981.js'; import 'redux'; import './turn-order-8a6f1ac7.js'; import 'immer'; import 'lodash.isplainobject'; import './reducer-dead06cd.js'; import 'rfc6902'; import './initialize-46237421.js'; import './transport-0079de87.js'; import { C as Client$1 } from './client-2d7e4322.js'; import 'flatted'; import { M as MCTSBot } from './ai-0694cbd2.js'; import { L as LobbyClient } from './client-99609c4d.js'; import React from 'react'; import PropTypes from 'prop-types'; import Cookies from 'react-cookies'; import './base-13e38c3e.js'; import { S as SocketIO, L as Local } from './socketio-d97925f5.js'; import './master-9be3c8e8.js'; import 'socket.io-client'; /* * Copyright 2017 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ /** * Client * * boardgame.io React client. * * @param {...object} game - The return value of `Game`. * @param {...object} numPlayers - The number of players. * @param {...object} board - The React component for the game. * @param {...object} loading - (optional) The React component for the loading state. * @param {...object} multiplayer - Set to a falsy value or a transportFactory, e.g., SocketIO() * @param {...object} debug - Enables the Debug UI. * @param {...object} enhancer - Optional enhancer to send to the Redux store * * Returns: * A React component that wraps board and provides an * API through props for it to interact with the framework * and dispatch actions such as MAKE_MOVE, GAME_EVENT, RESET, * UNDO and REDO. */ function Client(opts) { var _a; let { game, numPlayers, loading, board, multiplayer, enhancer, debug } = opts; // Component that is displayed before the client has synced // with the game master. if (loading === undefined) { const Loading = () => React.createElement("div", { className: "bgio-loading" }, "connecting..."); loading = Loading; } /* * WrappedBoard * * The main React component that wraps the passed in * board component and adds the API to its props. */ return _a = class WrappedBoard extends React.Component { constructor(props) { super(props); if (debug === undefined) { debug = props.debug; } this.client = Client$1({ game, debug, numPlayers, multiplayer, matchID: props.matchID, playerID: props.playerID, credentials: props.credentials, enhancer, }); } componentDidMount() { this.unsubscribe = this.client.subscribe(() => this.forceUpdate()); this.client.start(); } componentWillUnmount() { this.client.stop(); this.unsubscribe(); } componentDidUpdate(prevProps) { if (this.props.matchID != prevProps.matchID) { this.client.updateMatchID(this.props.matchID); } if (this.props.playerID != prevProps.playerID) { this.client.updatePlayerID(this.props.playerID); } if (this.props.credentials != prevProps.credentials) { this.client.updateCredentials(this.props.credentials); } } render() { const state = this.client.getState(); if (state === null) { return React.createElement(loading); } let _board = null; if (board) { _board = React.createElement(board, { ...state, ...this.props, isMultiplayer: !!multiplayer, moves: this.client.moves, events: this.client.events, matchID: this.client.matchID, playerID: this.client.playerID, reset: this.client.reset, undo: this.client.undo, redo: this.client.redo, log: this.client.log, matchData: this.client.matchData, sendChatMessage: this.client.sendChatMessage, chatMessages: this.client.chatMessages, }); } return React.createElement("div", { className: "bgio-client" }, _board); } }, _a.propTypes = { // The ID of a game to connect to. // Only relevant in multiplayer. matchID: PropTypes.string, // The ID of the player associated with this client. // Only relevant in multiplayer. playerID: PropTypes.string, // This client's authentication credentials. // Only relevant in multiplayer. credentials: PropTypes.string, // Enable / disable the Debug UI. debug: PropTypes.any, }, _a.defaultProps = { matchID: 'default', playerID: null, credentials: null, debug: true, }, _a; } /* * Copyright 2018 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ class _LobbyConnectionImpl { constructor({ server, gameComponents, playerName, playerCredentials, }) { this.client = new LobbyClient({ server }); this.gameComponents = gameComponents; this.playerName = playerName || 'Visitor'; this.playerCredentials = playerCredentials; this.matches = []; } async refresh() { try { this.matches = []; const games = await this.client.listGames(); for (const game of games) { if (!this._getGameComponents(game)) continue; const { matches } = await this.client.listMatches(game); this.matches.push(...matches); } } catch (error) { throw new Error('failed to retrieve list of matches (' + error + ')'); } } _getMatchInstance(matchID) { for (const inst of this.matches) { if (inst['matchID'] === matchID) return inst; } } _getGameComponents(gameName) { for (const comp of this.gameComponents) { if (comp.game.name === gameName) return comp; } } _findPlayer(playerName) { for (const inst of this.matches) { if (inst.players.some((player) => player.name === playerName)) return inst; } } async join(gameName, matchID, playerID) { try { let inst = this._findPlayer(this.playerName); if (inst) { throw new Error('player has already joined ' + inst.matchID); } inst = this._getMatchInstance(matchID); if (!inst) { throw new Error('game instance ' + matchID + ' not found'); } const json = await this.client.joinMatch(gameName, matchID, { playerID, playerName: this.playerName, }); inst.players[Number.parseInt(playerID)].name = this.playerName; this.playerCredentials = json.playerCredentials; } catch (error) { throw new Error('failed to join match ' + matchID + ' (' + error + ')'); } } async leave(gameName, matchID) { try { const inst = this._getMatchInstance(matchID); if (!inst) throw new Error('match instance not found'); for (const player of inst.players) { if (player.name === this.playerName) { await this.client.leaveMatch(gameName, matchID, { playerID: player.id.toString(), credentials: this.playerCredentials, }); delete player.name; delete this.playerCredentials; return; } } throw new Error('player not found in match'); } catch (error) { throw new Error('failed to leave match ' + matchID + ' (' + error + ')'); } } async disconnect() { const inst = this._findPlayer(this.playerName); if (inst) { await this.leave(inst.gameName, inst.matchID); } this.matches = []; this.playerName = 'Visitor'; } async create(gameName, numPlayers) { try { const comp = this._getGameComponents(gameName); if (!comp) throw new Error('game not found'); if (numPlayers < comp.game.minPlayers || numPlayers > comp.game.maxPlayers) throw new Error('invalid number of players ' + numPlayers); await this.client.createMatch(gameName, { numPlayers }); } catch (error) { throw new Error('failed to create match for ' + gameName + ' (' + error + ')'); } } } /** * LobbyConnection * * Lobby model. * * @param {string} server - '<host>:<port>' of the server. * @param {Array} gameComponents - A map of Board and Game objects for the supported games. * @param {string} playerName - The name of the player. * @param {string} playerCredentials - The credentials currently used by the player, if any. * * Returns: * A JS object that synchronizes the list of running game instances with the server and provides an API to create/join/start instances. */ function LobbyConnection(opts) { return new _LobbyConnectionImpl(opts); } /* * Copyright 2018 The boardgame.io Authors. * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ class LobbyLoginForm extends React.Component { constructor() { super(...arguments); this.state = { playerName: this.props.playerName, nameErrorMsg: '', }; this.onClickEnter = () => { if (this.state.playerName === '') return; this.props.onEnter(this.state.playerName); }; this.onKeyPress = (event) => { if (event.key === 'Enter') { this.onClickEnter(); } }; this.onChangePlayerName = (event) => { const name = event.target.value.trim(); this.setState({ playerName: name, nameErrorMsg: name.length > 0 ? '' : 'empty player name', }); }; } render() { return (React.createElement("div", null, React.createElement("p", { className: "phase-title" }, "Choose a player name:"), React.createElement("input", { type: "text", value: this.state.playerName, onChange: this.onChangePlayerName, onKeyPress: this.onKeyPress }), React.createElement("span", { className: "buttons" }, React.createElement("button", { className: "buttons", onClick: this.onClickEnter }, "Enter")), React.createElement("br", null), React.createElement("span", { className: "error-msg" }, this.state.nameErrorMsg, React.createElement("br", null)))); } } LobbyLoginForm.defaultProps = { playerName: '', }; /* * Copyright 2018 The boardgame.io Authors. * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ class LobbyMatchInstance extends React.Component { constructor() { super(...arguments); this._createSeat = (player) => { return player.name || '[free]'; }; this._createButtonJoin = (inst, seatId) => (React.createElement("button", { key: 'button-join-' + inst.matchID, onClick: () => this.props.onClickJoin(inst.gameName, inst.matchID, '' + seatId) }, "Join")); this._createButtonLeave = (inst) => (React.createElement("button", { key: 'button-leave-' + inst.matchID, onClick: () => this.props.onClickLeave(inst.gameName, inst.matchID) }, "Leave")); this._createButtonPlay = (inst, seatId) => (React.createElement("button", { key: 'button-play-' + inst.matchID, onClick: () => this.props.onClickPlay(inst.gameName, { matchID: inst.matchID, playerID: '' + seatId, numPlayers: inst.players.length, }) }, "Play")); this._createButtonSpectate = (inst) => (React.createElement("button", { key: 'button-spectate-' + inst.matchID, onClick: () => this.props.onClickPlay(inst.gameName, { matchID: inst.matchID, numPlayers: inst.players.length, }) }, "Spectate")); this._createInstanceButtons = (inst) => { const playerSeat = inst.players.find((player) => player.name === this.props.playerName); const freeSeat = inst.players.find((player) => !player.name); if (playerSeat && freeSeat) { // already seated: waiting for match to start return this._createButtonLeave(inst); } if (freeSeat) { // at least 1 seat is available return this._createButtonJoin(inst, freeSeat.id); } // match is full if (playerSeat) { return (React.createElement("div", null, [ this._createButtonPlay(inst, playerSeat.id), this._createButtonLeave(inst), ])); } // allow spectating return this._createButtonSpectate(inst); }; } render() { const match = this.props.match; let status = 'OPEN'; if (!match.players.some((player) => !player.name)) { status = 'RUNNING'; } return (React.createElement("tr", { key: 'line-' + match.matchID }, React.createElement("td", { key: 'cell-name-' + match.matchID }, match.gameName), React.createElement("td", { key: 'cell-status-' + match.matchID }, status), React.createElement("td", { key: 'cell-seats-' + match.matchID }, match.players.map((player) => this._createSeat(player)).join(', ')), React.createElement("td", { key: 'cell-buttons-' + match.matchID }, this._createInstanceButtons(match)))); } } /* * Copyright 2018 The boardgame.io Authors. * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ class LobbyCreateMatchForm extends React.Component { constructor(props) { super(props); this.state = { selectedGame: 0, numPlayers: 2, }; this._createGameNameOption = (game, idx) => { return (React.createElement("option", { key: 'name-option-' + idx, value: idx }, game.game.name)); }; this._createNumPlayersOption = (idx) => { return (React.createElement("option", { key: 'num-option-' + idx, value: idx }, idx)); }; this._createNumPlayersRange = (game) => { return Array.from({ length: game.maxPlayers + 1 }) .map((_, i) => i) .slice(game.minPlayers); }; this.onChangeNumPlayers = (event) => { this.setState({ numPlayers: Number.parseInt(event.target.value), }); }; this.onChangeSelectedGame = (event) => { const idx = Number.parseInt(event.target.value); this.setState({ selectedGame: idx, numPlayers: this.props.games[idx].game.minPlayers, }); }; this.onClickCreate = () => { this.props.createMatch(this.props.games[this.state.selectedGame].game.name, this.state.numPlayers); }; /* fix min and max number of players */ for (const game of props.games) { const matchDetails = game.game; if (!matchDetails.minPlayers) { matchDetails.minPlayers = 1; } if (!matchDetails.maxPlayers) { matchDetails.maxPlayers = 4; } console.assert(matchDetails.maxPlayers >= matchDetails.minPlayers); } this.state = { selectedGame: 0, numPlayers: props.games[0].game.minPlayers, }; } render() { return (React.createElement("div", null, React.createElement("select", { value: this.state.selectedGame, onChange: (evt) => this.onChangeSelectedGame(evt) }, this.props.games.map((game, index) => this._createGameNameOption(game, index))), React.createElement("span", null, "Players:"), React.createElement("select", { value: this.state.numPlayers, onChange: this.onChangeNumPlayers }, this._createNumPlayersRange(this.props.games[this.state.selectedGame].game).map((number) => this._createNumPlayersOption(number))), React.createElement("span", { className: "buttons" }, React.createElement("button", { onClick: this.onClickCreate }, "Create")))); } } /* * Copyright 2018 The boardgame.io Authors. * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ var LobbyPhases; (function (LobbyPhases) { LobbyPhases["ENTER"] = "enter"; LobbyPhases["PLAY"] = "play"; LobbyPhases["LIST"] = "list"; })(LobbyPhases || (LobbyPhases = {})); /** * Lobby * * React lobby component. * * @param {Array} gameComponents - An array of Board and Game objects for the supported games. * @param {string} lobbyServer - Address of the lobby server (for example 'localhost:8000'). * If not set, defaults to the server that served the page. * @param {string} gameServer - Address of the game server (for example 'localhost:8001'). * If not set, defaults to the server that served the page. * @param {function} clientFactory - Function that is used to create the game clients. * @param {number} refreshInterval - Interval between server updates (default: 2000ms). * @param {bool} debug - Enable debug information (default: false). * * Returns: * A React component that provides a UI to create, list, join, leave, play or * spectate matches (game instances). */ class Lobby extends React.Component { constructor(props) { super(props); this.state = { phase: LobbyPhases.ENTER, playerName: 'Visitor', runningMatch: null, errorMsg: '', credentialStore: {}, }; this._createConnection = (props) => { const name = this.state.playerName; this.connection = LobbyConnection({ server: props.lobbyServer, gameComponents: props.gameComponents, playerName: name, playerCredentials: this.state.credentialStore[name], }); }; this._updateCredentials = (playerName, credentials) => { this.setState((prevState) => { // clone store or componentDidUpdate will not be triggered const store = Object.assign({}, prevState.credentialStore); store[playerName] = credentials; return { credentialStore: store }; }); }; this._updateConnection = async () => { await this.connection.refresh(); this.forceUpdate(); }; this._enterLobby = (playerName) => { this.setState({ playerName, phase: LobbyPhases.LIST }); }; this._exitLobby = async () => { await this.connection.disconnect(); this.setState({ phase: LobbyPhases.ENTER, errorMsg: '' }); }; this._createMatch = async (gameName, numPlayers) => { try { await this.connection.create(gameName, numPlayers); await this.connection.refresh(); // rerender this.setState({}); } catch (error) { this.setState({ errorMsg: error.message }); } }; this._joinMatch = async (gameName, matchID, playerID) => { try { await this.connection.join(gameName, matchID, playerID); await this.connection.refresh(); this._updateCredentials(this.connection.playerName, this.connection.playerCredentials); } catch (error) { this.setState({ errorMsg: error.message }); } }; this._leaveMatch = async (gameName, matchID) => { try { await this.connection.leave(gameName, matchID); await this.connection.refresh(); this._updateCredentials(this.connection.playerName, this.connection.playerCredentials); } catch (error) { this.setState({ errorMsg: error.message }); } }; this._startMatch = (gameName, matchOpts) => { const gameCode = this.connection._getGameComponents(gameName); if (!gameCode) { this.setState({ errorMsg: 'game ' + gameName + ' not supported', }); return; } let multiplayer = undefined; if (matchOpts.numPlayers > 1) { multiplayer = this.props.gameServer ? SocketIO({ server: this.props.gameServer }) : SocketIO(); } if (matchOpts.numPlayers == 1) { const maxPlayers = gameCode.game.maxPlayers; const bots = {}; for (let i = 1; i < maxPlayers; i++) { bots[i + ''] = MCTSBot; } multiplayer = Local({ bots }); } const app = this.props.clientFactory({ game: gameCode.game, board: gameCode.board, debug: this.props.debug, multiplayer, }); const match = { app: app, matchID: matchOpts.matchID, playerID: matchOpts.numPlayers > 1 ? matchOpts.playerID : '0', credentials: this.connection.playerCredentials, }; this.setState({ phase: LobbyPhases.PLAY, runningMatch: match }); }; this._exitMatch = () => { this.setState({ phase: LobbyPhases.LIST, runningMatch: null }); }; this._getPhaseVisibility = (phase) => { return this.state.phase !== phase ? 'hidden' : 'phase'; }; this.renderMatches = (matches, playerName) => { return matches.map((match) => { const { matchID, gameName, players } = match; return (React.createElement(LobbyMatchInstance, { key: 'instance-' + matchID, match: { matchID, gameName, players: Object.values(players) }, playerName: playerName, onClickJoin: this._joinMatch, onClickLeave: this._leaveMatch, onClickPlay: this._startMatch })); }); }; this._createConnection(this.props); setInterval(this._updateConnection, this.props.refreshInterval); } componentDidMount() { const cookie = Cookies.load('lobbyState') || {}; if (cookie.phase && cookie.phase === LobbyPhases.PLAY) { cookie.phase = LobbyPhases.LIST; } this.setState({ phase: cookie.phase || LobbyPhases.ENTER, playerName: cookie.playerName || 'Visitor', credentialStore: cookie.credentialStore || {}, }); } componentDidUpdate(prevProps, prevState) { const name = this.state.playerName; const creds = this.state.credentialStore[name]; if (prevState.phase !== this.state.phase || prevState.credentialStore[name] !== creds || prevState.playerName !== name) { this._createConnection(this.props); this._updateConnection(); const cookie = { phase: this.state.phase, playerName: name, credentialStore: this.state.credentialStore, }; Cookies.save('lobbyState', cookie, { path: '/' }); } } render() { const { gameComponents, renderer } = this.props; const { errorMsg, playerName, phase, runningMatch } = this.state; if (renderer) { return renderer({ errorMsg, gameComponents, matches: this.connection.matches, phase, playerName, runningMatch, handleEnterLobby: this._enterLobby, handleExitLobby: this._exitLobby, handleCreateMatch: this._createMatch, handleJoinMatch: this._joinMatch, handleLeaveMatch: this._leaveMatch, handleExitMatch: this._exitMatch, handleRefreshMatches: this._updateConnection, handleStartMatch: this._startMatch, }); } return (React.createElement("div", { id: "lobby-view", style: { padding: 50 } }, React.createElement("div", { className: this._getPhaseVisibility(LobbyPhases.ENTER) }, React.createElement(LobbyLoginForm, { key: playerName, playerName: playerName, onEnter: this._enterLobby })), React.createElement("div", { className: this._getPhaseVisibility(LobbyPhases.LIST) }, React.createElement("p", null, "Welcome, ", playerName), React.createElement("div", { className: "phase-title", id: "match-creation" }, React.createElement("span", null, "Create a match:"), React.createElement(LobbyCreateMatchForm, { games: gameComponents, createMatch: this._createMatch })), React.createElement("p", { className: "phase-title" }, "Join a match:"), React.createElement("div", { id: "instances" }, React.createElement("table", null, React.createElement("tbody", null, this.renderMatches(this.connection.matches, playerName))), React.createElement("span", { className: "error-msg" }, errorMsg, React.createElement("br", null))), React.createElement("p", { className: "phase-title" }, "Matches that become empty are automatically deleted.")), React.createElement("div", { className: this._getPhaseVisibility(LobbyPhases.PLAY) }, runningMatch && (React.createElement(runningMatch.app, { matchID: runningMatch.matchID, playerID: runningMatch.playerID, credentials: runningMatch.credentials })), React.createElement("div", { className: "buttons", id: "match-exit" }, React.createElement("button", { onClick: this._exitMatch }, "Exit match"))), React.createElement("div", { className: "buttons", id: "lobby-exit" }, React.createElement("button", { onClick: this._exitLobby }, "Exit lobby")))); } } Lobby.propTypes = { gameComponents: PropTypes.array.isRequired, lobbyServer: PropTypes.string, gameServer: PropTypes.string, debug: PropTypes.bool, clientFactory: PropTypes.func, refreshInterval: PropTypes.number, }; Lobby.defaultProps = { debug: false, clientFactory: Client, refreshInterval: 2000, }; export { Client, Lobby };
ajax/libs/react-native-web/0.11.7/vendor/react-native/VirtualizedSectionList/index.js
cdnjs/cdnjs
function _extends() { _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; }; return _extends.apply(this, arguments); } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, 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; } function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } /** * Copyright (c) 2015-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. * * * @format */ import React from 'react'; import View from '../../../exports/View'; import VirtualizedList from '../VirtualizedList'; import invariant from 'fbjs/lib/invariant'; /** * Right now this just flattens everything into one list and uses VirtualizedList under the * hood. The only operation that might not scale well is concatting the data arrays of all the * sections when new props are received, which should be plenty fast for up to ~10,000 items. */ var VirtualizedSectionList = /*#__PURE__*/ function (_React$PureComponent) { _inheritsLoose(VirtualizedSectionList, _React$PureComponent); var _proto = VirtualizedSectionList.prototype; _proto.scrollToLocation = function scrollToLocation(params) { var index = params.itemIndex + 1; for (var ii = 0; ii < params.sectionIndex; ii++) { index += this.props.sections[ii].data.length + 2; } var toIndexParams = _objectSpread({}, params, { index: index }); this._listRef.scrollToIndex(toIndexParams); }; _proto.getListRef = function getListRef() { return this._listRef; }; _proto._subExtractor = function _subExtractor(index) { var itemIndex = index; var defaultKeyExtractor = this.props.keyExtractor; for (var ii = 0; ii < this.props.sections.length; ii++) { var section = this.props.sections[ii]; var key = section.key || String(ii); itemIndex -= 1; // The section adds an item for the header if (itemIndex >= section.data.length + 1) { itemIndex -= section.data.length + 1; // The section adds an item for the footer. } else if (itemIndex === -1) { return { section: section, key: key + ':header', index: null, header: true, trailingSection: this.props.sections[ii + 1] }; } else if (itemIndex === section.data.length) { return { section: section, key: key + ':footer', index: null, header: false, trailingSection: this.props.sections[ii + 1] }; } else { var keyExtractor = section.keyExtractor || defaultKeyExtractor; return { section: section, key: key + ':' + keyExtractor(section.data[itemIndex], itemIndex), index: itemIndex, leadingItem: section.data[itemIndex - 1], leadingSection: this.props.sections[ii - 1], trailingItem: section.data[itemIndex + 1], trailingSection: this.props.sections[ii + 1] }; } } }; _proto._getSeparatorComponent = function _getSeparatorComponent(index, info) { info = info || this._subExtractor(index); if (!info) { return null; } var ItemSeparatorComponent = info.section.ItemSeparatorComponent || this.props.ItemSeparatorComponent; var SectionSeparatorComponent = this.props.SectionSeparatorComponent; var isLastItemInList = index === this.state.childProps.getItemCount() - 1; var isLastItemInSection = info.index === info.section.data.length - 1; if (SectionSeparatorComponent && isLastItemInSection) { return SectionSeparatorComponent; } if (ItemSeparatorComponent && !isLastItemInSection && !isLastItemInList) { return ItemSeparatorComponent; } return null; }; _proto._computeState = function _computeState(props) { var offset = props.ListHeaderComponent ? 1 : 0; var stickyHeaderIndices = []; var itemCount = props.sections.reduce(function (v, section) { stickyHeaderIndices.push(v + offset); return v + section.data.length + 2; // Add two for the section header and footer. }, 0); return { childProps: _objectSpread({}, props, { renderItem: this._renderItem, ItemSeparatorComponent: undefined, // Rendered with renderItem data: props.sections, getItemCount: function getItemCount() { return itemCount; }, getItem: getItem, keyExtractor: this._keyExtractor, onViewableItemsChanged: props.onViewableItemsChanged ? this._onViewableItemsChanged : undefined, stickyHeaderIndices: props.stickySectionHeadersEnabled ? stickyHeaderIndices : undefined }) }; }; function VirtualizedSectionList(props, context) { var _this; _this = _React$PureComponent.call(this, props, context) || this; _this._keyExtractor = function (item, index) { var info = _this._subExtractor(index); return info && info.key || String(index); }; _this._convertViewable = function (viewable) { invariant(viewable.index != null, 'Received a broken ViewToken'); var info = _this._subExtractor(viewable.index); if (!info) { return null; } var keyExtractor = info.section.keyExtractor || _this.props.keyExtractor; return _objectSpread({}, viewable, { index: info.index, /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an * error found when Flow v0.63 was deployed. To see the error delete this * comment and run Flow. */ key: keyExtractor(viewable.item, info.index), section: info.section }); }; _this._onViewableItemsChanged = function (_ref) { var viewableItems = _ref.viewableItems, changed = _ref.changed; if (_this.props.onViewableItemsChanged) { _this.props.onViewableItemsChanged({ viewableItems: viewableItems.map(_this._convertViewable, _assertThisInitialized(_assertThisInitialized(_this))).filter(Boolean), changed: changed.map(_this._convertViewable, _assertThisInitialized(_assertThisInitialized(_this))).filter(Boolean) }); } }; _this._renderItem = function (_ref2) { var item = _ref2.item, index = _ref2.index; var info = _this._subExtractor(index); if (!info) { return null; } var infoIndex = info.index; if (infoIndex == null) { var section = info.section; if (info.header === true) { var renderSectionHeader = _this.props.renderSectionHeader; return renderSectionHeader ? renderSectionHeader({ section: section }) : null; } else { var renderSectionFooter = _this.props.renderSectionFooter; return renderSectionFooter ? renderSectionFooter({ section: section }) : null; } } else { var renderItem = info.section.renderItem || _this.props.renderItem; var SeparatorComponent = _this._getSeparatorComponent(index, info); invariant(renderItem, 'no renderItem!'); return React.createElement(ItemWithSeparator, { SeparatorComponent: SeparatorComponent, LeadingSeparatorComponent: infoIndex === 0 ? _this.props.SectionSeparatorComponent : undefined, cellKey: info.key, index: infoIndex, item: item, leadingItem: info.leadingItem, leadingSection: info.leadingSection, onUpdateSeparator: _this._onUpdateSeparator, prevCellKey: (_this._subExtractor(index - 1) || {}).key, ref: function ref(_ref3) { _this._cellRefs[info.key] = _ref3; }, renderItem: renderItem, section: info.section, trailingItem: info.trailingItem, trailingSection: info.trailingSection }); } }; _this._onUpdateSeparator = function (key, newProps) { var ref = _this._cellRefs[key]; ref && ref.updateSeparatorProps(newProps); }; _this._cellRefs = {}; _this._captureRef = function (ref) { /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment * suppresses an error when upgrading Flow's support for React. To see the * error delete this comment and run Flow. */ _this._listRef = ref; }; _this.state = _this._computeState(props); return _this; } _proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(nextProps) { this.setState(this._computeState(nextProps)); }; _proto.render = function render() { return React.createElement(VirtualizedList, _extends({}, this.state.childProps, { ref: this._captureRef })); }; return VirtualizedSectionList; }(React.PureComponent); VirtualizedSectionList.defaultProps = _objectSpread({}, VirtualizedList.defaultProps, { data: [] }); var ItemWithSeparator = /*#__PURE__*/ function (_React$Component) { _inheritsLoose(ItemWithSeparator, _React$Component); function ItemWithSeparator() { var _this2; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this2 = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; _this2.state = { separatorProps: { highlighted: false, leadingItem: _this2.props.item, leadingSection: _this2.props.leadingSection, section: _this2.props.section, trailingItem: _this2.props.trailingItem, trailingSection: _this2.props.trailingSection }, leadingSeparatorProps: { highlighted: false, leadingItem: _this2.props.leadingItem, leadingSection: _this2.props.leadingSection, section: _this2.props.section, trailingItem: _this2.props.item, trailingSection: _this2.props.trailingSection } }; _this2._separators = { highlight: function highlight() { ['leading', 'trailing'].forEach(function (s) { return _this2._separators.updateProps(s, { highlighted: true }); }); }, unhighlight: function unhighlight() { ['leading', 'trailing'].forEach(function (s) { return _this2._separators.updateProps(s, { highlighted: false }); }); }, updateProps: function updateProps(select, newProps) { var _this2$props = _this2.props, LeadingSeparatorComponent = _this2$props.LeadingSeparatorComponent, cellKey = _this2$props.cellKey, prevCellKey = _this2$props.prevCellKey; if (select === 'leading' && LeadingSeparatorComponent) { _this2.setState(function (state) { return { leadingSeparatorProps: _objectSpread({}, state.leadingSeparatorProps, newProps) }; }); } else { _this2.props.onUpdateSeparator(select === 'leading' && prevCellKey || cellKey, newProps); } } }; return _this2; } var _proto2 = ItemWithSeparator.prototype; _proto2.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(props) { var _this3 = this; this.setState(function (state) { return { separatorProps: _objectSpread({}, _this3.state.separatorProps, { leadingItem: props.item, leadingSection: props.leadingSection, section: props.section, trailingItem: props.trailingItem, trailingSection: props.trailingSection }), leadingSeparatorProps: _objectSpread({}, _this3.state.leadingSeparatorProps, { leadingItem: props.leadingItem, leadingSection: props.leadingSection, section: props.section, trailingItem: props.item, trailingSection: props.trailingSection }) }; }); }; _proto2.updateSeparatorProps = function updateSeparatorProps(newProps) { this.setState(function (state) { return { separatorProps: _objectSpread({}, state.separatorProps, newProps) }; }); }; _proto2.render = function render() { var _this$props = this.props, LeadingSeparatorComponent = _this$props.LeadingSeparatorComponent, SeparatorComponent = _this$props.SeparatorComponent, item = _this$props.item, index = _this$props.index, section = _this$props.section; var element = this.props.renderItem({ item: item, index: index, section: section, separators: this._separators }); var leadingSeparator = LeadingSeparatorComponent && React.createElement(LeadingSeparatorComponent, this.state.leadingSeparatorProps); var separator = SeparatorComponent && React.createElement(SeparatorComponent, this.state.separatorProps); return leadingSeparator || separator ? React.createElement(View, null, leadingSeparator, element, separator) : element; }; return ItemWithSeparator; }(React.Component); function getItem(sections, index) { if (!sections) { return null; } var itemIdx = index - 1; for (var ii = 0; ii < sections.length; ii++) { if (itemIdx === -1 || itemIdx === sections[ii].data.length) { // We intend for there to be overflow by one on both ends of the list. // This will be for headers and footers. When returning a header or footer // item the section itself is the item. return sections[ii]; } else if (itemIdx < sections[ii].data.length) { // If we are in the bounds of the list's data then return the item. return sections[ii].data[itemIdx]; } else { itemIdx -= sections[ii].data.length + 2; // Add two for the header and footer } } return null; } export default VirtualizedSectionList;
ajax/libs/material-ui/4.9.3/es/Radio/Radio.js
cdnjs/cdnjs
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import { refType } from '@material-ui/utils'; import SwitchBase from '../internal/SwitchBase'; import RadioButtonIcon from './RadioButtonIcon'; import { fade } from '../styles/colorManipulator'; import capitalize from '../utils/capitalize'; import createChainedFunction from '../utils/createChainedFunction'; import withStyles from '../styles/withStyles'; import useRadioGroup from '../RadioGroup/useRadioGroup'; export const styles = theme => ({ /* Styles applied to the root element. */ root: { color: theme.palette.text.secondary }, /* Pseudo-class applied to the root element if `checked={true}`. */ checked: {}, /* Pseudo-class applied to the root element if `disabled={true}`. */ disabled: {}, /* Styles applied to the root element if `color="primary"`. */ colorPrimary: { '&$checked': { color: theme.palette.primary.main, '&:hover': { backgroundColor: fade(theme.palette.primary.main, theme.palette.action.hoverOpacity), // Reset on touch devices, it doesn't add specificity '@media (hover: none)': { backgroundColor: 'transparent' } } }, '&$disabled': { color: theme.palette.action.disabled } }, /* Styles applied to the root element if `color="secondary"`. */ colorSecondary: { '&$checked': { color: theme.palette.secondary.main, '&:hover': { backgroundColor: fade(theme.palette.secondary.main, theme.palette.action.hoverOpacity), // Reset on touch devices, it doesn't add specificity '@media (hover: none)': { backgroundColor: 'transparent' } } }, '&$disabled': { color: theme.palette.action.disabled } } }); const defaultCheckedIcon = React.createElement(RadioButtonIcon, { checked: true }); const defaultIcon = React.createElement(RadioButtonIcon, null); const Radio = React.forwardRef(function Radio(props, ref) { const { checked: checkedProp, classes, color = 'secondary', name: nameProp, onChange: onChangeProp, size = 'medium' } = props, other = _objectWithoutPropertiesLoose(props, ["checked", "classes", "color", "name", "onChange", "size"]); const radioGroup = useRadioGroup(); let checked = checkedProp; const onChange = createChainedFunction(onChangeProp, radioGroup && radioGroup.onChange); let name = nameProp; if (radioGroup) { if (typeof checked === 'undefined') { checked = radioGroup.value === props.value; } if (typeof name === 'undefined') { name = radioGroup.name; } } return React.createElement(SwitchBase, _extends({ color: color, type: "radio", icon: React.cloneElement(defaultIcon, { fontSize: size === 'small' ? 'small' : 'default' }), checkedIcon: React.cloneElement(defaultCheckedIcon, { fontSize: size === 'small' ? 'small' : 'default' }), classes: { root: clsx(classes.root, classes[`color${capitalize(color)}`]), checked: classes.checked, disabled: classes.disabled }, name: name, checked: checked, onChange: onChange, ref: ref }, other)); }); process.env.NODE_ENV !== "production" ? Radio.propTypes = { /** * If `true`, the component is checked. */ checked: PropTypes.bool, /** * The icon to display when the component is checked. */ checkedIcon: PropTypes.node, /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * The color of the component. It supports those theme colors that make sense for this component. */ color: PropTypes.oneOf(['primary', 'secondary', 'default']), /** * If `true`, the radio will be disabled. */ disabled: PropTypes.bool, /** * If `true`, the ripple effect will be disabled. */ disableRipple: PropTypes.bool, /** * The icon to display when the component is unchecked. */ icon: PropTypes.node, /** * The id of the `input` element. */ id: PropTypes.string, /** * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element. */ inputProps: PropTypes.object, /** * Pass a ref to the `input` element. */ inputRef: refType, /** * Name attribute of the `input` element. */ name: PropTypes.string, /** * Callback fired when the state is changed. * * @param {object} event The event source of the callback. * You can pull out the new value by accessing `event.target.value` (string). * You can pull out the new checked state by accessing `event.target.checked` (boolean). */ onChange: PropTypes.func, /** * If `true`, the `input` element will be required. */ required: PropTypes.bool, /** * The size of the radio. * `small` is equivalent to the dense radio styling. */ size: PropTypes.oneOf(['small', 'medium']), /** * The input component prop `type`. */ type: PropTypes.string, /** * The value of the component. The DOM API casts this to a string. */ value: PropTypes.any } : void 0; export default withStyles(styles, { name: 'MuiRadio' })(Radio);
ajax/libs/primereact/6.6.0/splitbutton/splitbutton.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; import { Button } from 'primereact/button'; import { classNames, ObjectUtils, CSSTransition, Portal, OverlayService, ZIndexUtils, DomHandler, ConnectedOverlayScrollHandler, UniqueComponentId, tip } from 'primereact/core'; import PrimeReact from 'primereact/api'; 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); return Constructor; } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); } 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); } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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; } function _createSuper$2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); 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 _isNativeReflectConstruct$2() { 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; } } var SplitButtonItem = /*#__PURE__*/function (_Component) { _inherits(SplitButtonItem, _Component); var _super = _createSuper$2(SplitButtonItem); function SplitButtonItem(props) { var _this; _classCallCheck(this, SplitButtonItem); _this = _super.call(this, props); _this.onClick = _this.onClick.bind(_assertThisInitialized(_this)); return _this; } _createClass(SplitButtonItem, [{ key: "onClick", value: function onClick(e) { if (this.props.menuitem.command) { this.props.menuitem.command({ originalEvent: e, item: this.props.menuitem }); } if (this.props.onItemClick) { this.props.onItemClick(e); } e.preventDefault(); } }, { key: "renderSeparator", value: function renderSeparator() { return /*#__PURE__*/React.createElement("li", { className: "p-menu-separator", role: "separator" }); } }, { key: "renderMenuitem", value: function renderMenuitem() { var _this2 = this; var _this$props$menuitem = this.props.menuitem, disabled = _this$props$menuitem.disabled, icon = _this$props$menuitem.icon, label = _this$props$menuitem.label, template = _this$props$menuitem.template, url = _this$props$menuitem.url, target = _this$props$menuitem.target; var className = classNames('p-menuitem-link', { 'p-disabled': disabled }); var iconClassName = classNames('p-menuitem-icon', icon); icon = icon && /*#__PURE__*/React.createElement("span", { className: iconClassName }); label = label && /*#__PURE__*/React.createElement("span", { className: "p-menuitem-text" }, label); var content = /*#__PURE__*/React.createElement("a", { href: url || '#', role: "menuitem", className: className, target: target, onClick: this.onClick }, icon, label); if (template) { var defaultContentOptions = { onClick: function onClick(event) { return _this2.onClick(event); }, className: className, labelClassName: 'p-menuitem-text', iconClassName: iconClassName, element: content, props: this.props }; content = ObjectUtils.getJSXElement(template, this.props.menuitem, defaultContentOptions); } return /*#__PURE__*/React.createElement("li", { className: "p-menuitem", role: "none" }, content); } }, { key: "renderItem", value: function renderItem() { if (this.props.menuitem.separator) { return this.renderSeparator(); } return this.renderMenuitem(); } }, { key: "render", value: function render() { var item = this.renderItem(); return item; } }]); return SplitButtonItem; }(Component); _defineProperty(SplitButtonItem, "defaultProps", { menuitem: null, onItemClick: null }); function _extends() { _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; }; return _extends.apply(this, arguments); } function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); 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 _isNativeReflectConstruct$1() { 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; } } var SplitButtonPanelComponent = /*#__PURE__*/function (_Component) { _inherits(SplitButtonPanelComponent, _Component); var _super = _createSuper$1(SplitButtonPanelComponent); function SplitButtonPanelComponent() { _classCallCheck(this, SplitButtonPanelComponent); return _super.apply(this, arguments); } _createClass(SplitButtonPanelComponent, [{ key: "renderElement", value: function renderElement() { var className = classNames('p-menu p-menu-overlay p-component', this.props.menuClassName); return /*#__PURE__*/React.createElement(CSSTransition, { nodeRef: this.props.forwardRef, classNames: "p-connected-overlay", in: this.props.in, timeout: { enter: 120, exit: 100 }, options: this.props.transitionOptions, unmountOnExit: true, onEnter: this.props.onEnter, onEntered: this.props.onEntered, onExit: this.props.onExit, onExited: this.props.onExited }, /*#__PURE__*/React.createElement("div", { ref: this.props.forwardRef, className: className, style: this.props.menuStyle, id: this.props.id, onClick: this.onClick }, /*#__PURE__*/React.createElement("ul", { className: "p-menu-list p-reset", role: "menu" }, this.props.children))); } }, { key: "render", value: function render() { var element = this.renderElement(); return /*#__PURE__*/React.createElement(Portal, { element: element, appendTo: this.props.appendTo }); } }]); return SplitButtonPanelComponent; }(Component); _defineProperty(SplitButtonPanelComponent, "defaultProps", { appendTo: null, menuStyle: null, menuClassName: null, id: null, onClick: null }); var SplitButtonPanel = /*#__PURE__*/React.forwardRef(function (props, ref) { return /*#__PURE__*/React.createElement(SplitButtonPanelComponent, _extends({ forwardRef: ref }, props)); }); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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 _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; } } var SplitButton = /*#__PURE__*/function (_Component) { _inherits(SplitButton, _Component); var _super = _createSuper(SplitButton); function SplitButton(props) { var _this; _classCallCheck(this, SplitButton); _this = _super.call(this, props); _this.state = { id: props.id, overlayVisible: false }; _this.onDropdownButtonClick = _this.onDropdownButtonClick.bind(_assertThisInitialized(_this)); _this.onItemClick = _this.onItemClick.bind(_assertThisInitialized(_this)); _this.onOverlayEnter = _this.onOverlayEnter.bind(_assertThisInitialized(_this)); _this.onOverlayEntered = _this.onOverlayEntered.bind(_assertThisInitialized(_this)); _this.onOverlayExit = _this.onOverlayExit.bind(_assertThisInitialized(_this)); _this.onOverlayExited = _this.onOverlayExited.bind(_assertThisInitialized(_this)); _this.onPanelClick = _this.onPanelClick.bind(_assertThisInitialized(_this)); _this.overlayRef = /*#__PURE__*/React.createRef(); return _this; } _createClass(SplitButton, [{ key: "onPanelClick", value: function onPanelClick(event) { OverlayService.emit('overlay-click', { originalEvent: event, target: this.container }); } }, { key: "onDropdownButtonClick", value: function onDropdownButtonClick() { if (this.state.overlayVisible) this.hide();else this.show(); } }, { key: "onItemClick", value: function onItemClick() { this.hide(); } }, { key: "show", value: function show() { this.setState({ overlayVisible: true }); } }, { key: "hide", value: function hide() { this.setState({ overlayVisible: false }); } }, { key: "onOverlayEnter", value: function onOverlayEnter() { ZIndexUtils.set('overlay', this.overlayRef.current); this.alignOverlay(); } }, { key: "onOverlayEntered", value: function onOverlayEntered() { this.bindDocumentClickListener(); this.bindScrollListener(); this.bindResizeListener(); this.props.onShow && this.props.onShow(); } }, { key: "onOverlayExit", value: function onOverlayExit() { this.unbindDocumentClickListener(); this.unbindScrollListener(); this.unbindResizeListener(); } }, { key: "onOverlayExited", value: function onOverlayExited() { ZIndexUtils.clear(this.overlayRef.current); this.props.onHide && this.props.onHide(); } }, { key: "alignOverlay", value: function alignOverlay() { DomHandler.alignOverlay(this.overlayRef.current, this.defaultButton.parentElement, this.props.appendTo || PrimeReact.appendTo); } }, { key: "bindDocumentClickListener", value: function bindDocumentClickListener() { var _this2 = this; if (!this.documentClickListener) { this.documentClickListener = function (event) { if (_this2.state.overlayVisible && _this2.isOutsideClicked(event)) { _this2.hide(); } }; document.addEventListener('click', this.documentClickListener); } } }, { key: "bindScrollListener", value: function bindScrollListener() { var _this3 = this; if (!this.scrollHandler) { this.scrollHandler = new ConnectedOverlayScrollHandler(this.container, function () { if (_this3.state.overlayVisible) { _this3.hide(); } }); } this.scrollHandler.bindScrollListener(); } }, { key: "unbindScrollListener", value: function unbindScrollListener() { if (this.scrollHandler) { this.scrollHandler.unbindScrollListener(); } } }, { key: "bindResizeListener", value: function bindResizeListener() { var _this4 = this; if (!this.resizeListener) { this.resizeListener = function () { if (_this4.state.overlayVisible && !DomHandler.isAndroid()) { _this4.hide(); } }; window.addEventListener('resize', this.resizeListener); } } }, { key: "unbindResizeListener", value: function unbindResizeListener() { if (this.resizeListener) { window.removeEventListener('resize', this.resizeListener); this.resizeListener = null; } } }, { key: "isOutsideClicked", value: function isOutsideClicked(event) { return this.container && this.overlayRef && this.overlayRef.current && !this.overlayRef.current.contains(event.target); } }, { key: "unbindDocumentClickListener", value: function unbindDocumentClickListener() { if (this.documentClickListener) { document.removeEventListener('click', this.documentClickListener); this.documentClickListener = null; } } }, { key: "componentDidMount", value: function componentDidMount() { if (!this.state.id) { this.setState({ id: UniqueComponentId() }); } if (this.props.tooltip) { this.renderTooltip(); } } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (prevProps.tooltip !== this.props.tooltip || prevProps.tooltipOptions !== this.props.tooltipOptions) { if (this.tooltip) this.tooltip.update(_objectSpread({ content: this.props.tooltip }, this.props.tooltipOptions || {}));else this.renderTooltip(); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.unbindDocumentClickListener(); this.unbindResizeListener(); if (this.scrollHandler) { this.scrollHandler.destroy(); this.scrollHandler = null; } if (this.tooltip) { this.tooltip.destroy(); this.tooltip = null; } ZIndexUtils.clear(this.overlayRef.current); } }, { key: "renderTooltip", value: function renderTooltip() { this.tooltip = tip({ target: this.container, content: this.props.tooltip, options: this.props.tooltipOptions }); } }, { key: "renderItems", value: function renderItems() { var _this5 = this; if (this.props.model) { return this.props.model.map(function (menuitem, index) { return /*#__PURE__*/React.createElement(SplitButtonItem, { menuitem: menuitem, key: index, onItemClick: _this5.onItemClick }); }); } return null; } }, { key: "render", value: function render() { var _this6 = this; var className = classNames('p-splitbutton p-component', this.props.className, { 'p-disabled': this.props.disabled }); var items = this.renderItems(); var buttonContent = this.props.buttonTemplate ? ObjectUtils.getJSXElement(this.props.buttonTemplate, this.props) : null; return /*#__PURE__*/React.createElement("div", { id: this.state.id, className: className, style: this.props.style, ref: function ref(el) { return _this6.container = el; } }, /*#__PURE__*/React.createElement(Button, { ref: function ref(el) { return _this6.defaultButton = el; }, type: "button", className: "p-splitbutton-defaultbutton", icon: this.props.icon, label: this.props.label, onClick: this.props.onClick, disabled: this.props.disabled, tabIndex: this.props.tabIndex }, buttonContent), /*#__PURE__*/React.createElement(Button, { type: "button", className: "p-splitbutton-menubutton", icon: this.props.dropdownIcon, onClick: this.onDropdownButtonClick, disabled: this.props.disabled, "aria-expanded": this.state.overlayVisible, "aria-haspopup": true, "aria-owns": this.state.id + '_overlay' }), /*#__PURE__*/React.createElement(SplitButtonPanel, { ref: this.overlayRef, appendTo: this.props.appendTo, id: this.state.id + '_overlay', menuStyle: this.props.menuStyle, menuClassName: this.props.menuClassName, onClick: this.onPanelClick, in: this.state.overlayVisible, onEnter: this.onOverlayEnter, onEntered: this.onOverlayEntered, onExit: this.onOverlayExit, onExited: this.onOverlayExited, transitionOptions: this.props.transitionOptions }, items)); } }]); return SplitButton; }(Component); _defineProperty(SplitButton, "defaultProps", { id: null, label: null, icon: null, model: null, disabled: null, style: null, className: null, menuStyle: null, menuClassName: null, tabIndex: null, appendTo: null, tooltip: null, tooltipOptions: null, buttonTemplate: null, transitionOptions: null, dropdownIcon: 'pi pi-chevron-down', onClick: null, onShow: null, onHide: null }); export { SplitButton };
ajax/libs/react-native-web/0.17.0/exports/YellowBox/index.js
cdnjs/cdnjs
/** * Copyright (c) Nicolas Gallagher. * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ import React from 'react'; import UnimplementedView from '../../modules/UnimplementedView'; function YellowBox(props) { return /*#__PURE__*/React.createElement(UnimplementedView, props); } YellowBox.ignoreWarnings = function () {}; export default YellowBox;
ajax/libs/primereact/6.5.1/row/row.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; 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); return Constructor; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); } 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); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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; } 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 _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; } } var Row = /*#__PURE__*/function (_Component) { _inherits(Row, _Component); var _super = _createSuper(Row); function Row() { _classCallCheck(this, Row); return _super.apply(this, arguments); } _createClass(Row, [{ key: "render", value: function render() { return /*#__PURE__*/React.createElement("tr", null, this.props.children); } }]); return Row; }(Component); _defineProperty(Row, "defaultProps", { style: null, className: null }); export { Row };
ajax/libs/primereact/7.1.0/megamenu/megamenu.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; import { DomHandler, classNames, ObjectUtils } from 'primereact/utils'; import { Ripple } from 'primereact/ripple'; 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); return Constructor; } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); } 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); } 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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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; } 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 _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; } } var MegaMenu = /*#__PURE__*/function (_Component) { _inherits(MegaMenu, _Component); var _super = _createSuper(MegaMenu); function MegaMenu(props) { var _this; _classCallCheck(this, MegaMenu); _this = _super.call(this, props); _this.state = { activeItem: null }; _this.onLeafClick = _this.onLeafClick.bind(_assertThisInitialized(_this)); return _this; } _createClass(MegaMenu, [{ key: "onLeafClick", value: function onLeafClick(event, item) { if (item.disabled) { event.preventDefault(); return; } if (!item.url) { event.preventDefault(); } if (item.command) { item.command({ originalEvent: event, item: item }); } this.setState({ activeItem: null }); } }, { key: "onCategoryMouseEnter", value: function onCategoryMouseEnter(event, item) { if (item.disabled) { event.preventDefault(); return; } if (this.state.activeItem) { this.setState({ activeItem: item }); } } }, { key: "onCategoryClick", value: function onCategoryClick(event, item) { if (item.disabled) { event.preventDefault(); return; } if (!item.url) { event.preventDefault(); } if (item.command) { item.command({ originalEvent: event, item: this.props.item }); } if (item.items) { if (this.state.activeItem && this.state.activeItem === item) { this.setState({ activeItem: null }); } else { this.setState({ activeItem: item }); } } event.preventDefault(); } }, { key: "onCategoryKeyDown", value: function onCategoryKeyDown(event, item) { var listItem = event.currentTarget.parentElement; switch (event.which) { //down case 40: if (this.isHorizontal()) this.expandMenu(item);else this.navigateToNextItem(listItem); event.preventDefault(); break; //up case 38: if (this.isVertical()) this.navigateToPrevItem(listItem);else if (item.items && item === this.state.activeItem) this.collapseMenu(); event.preventDefault(); break; //right case 39: if (this.isHorizontal()) this.navigateToNextItem(listItem);else this.expandMenu(item); event.preventDefault(); break; //left case 37: if (this.isHorizontal()) this.navigateToPrevItem(listItem);else if (item.items && item === this.state.activeItem) this.collapseMenu(); event.preventDefault(); break; } } }, { key: "expandMenu", value: function expandMenu(item) { if (item.items) { this.setState({ activeItem: item }); } } }, { key: "collapseMenu", value: function collapseMenu(item) { this.setState({ activeItem: null }); } }, { key: "findNextItem", value: function findNextItem(item) { var nextItem = item.nextElementSibling; if (nextItem) return DomHandler.hasClass(nextItem, 'p-disabled') || !DomHandler.hasClass(nextItem, 'p-menuitem') ? this.findNextItem(nextItem) : nextItem;else return null; } }, { key: "findPrevItem", value: function findPrevItem(item) { var prevItem = item.previousElementSibling; if (prevItem) return DomHandler.hasClass(prevItem, 'p-disabled') || !DomHandler.hasClass(prevItem, 'p-menuitem') ? this.findPrevItem(prevItem) : prevItem;else return null; } }, { key: "navigateToNextItem", value: function navigateToNextItem(listItem) { var nextItem = this.findNextItem(listItem); if (nextItem) { nextItem.children[0].focus(); } } }, { key: "navigateToPrevItem", value: function navigateToPrevItem(listItem) { var prevItem = this.findPrevItem(listItem); if (prevItem) { prevItem.children[0].focus(); } } }, { key: "isHorizontal", value: function isHorizontal() { return this.props.orientation === 'horizontal'; } }, { key: "isVertical", value: function isVertical() { return this.props.orientation === 'vertical'; } }, { key: "getColumnClassName", value: function getColumnClassName(category) { var length = category.items ? category.items.length : 0; var columnClass; switch (length) { case 2: columnClass = 'p-megamenu-col-6'; break; case 3: columnClass = 'p-megamenu-col-4'; break; case 4: columnClass = 'p-megamenu-col-3'; break; case 6: columnClass = 'p-megamenu-col-2'; break; default: columnClass = 'p-megamenu-col-12'; break; } return columnClass; } }, { key: "componentDidMount", value: function componentDidMount() { var _this2 = this; if (!this.documentClickListener) { this.documentClickListener = function (event) { if (_this2.container && !_this2.container.contains(event.target)) { _this2.setState({ activeItem: null }); } }; document.addEventListener('click', this.documentClickListener); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { if (this.documentClickListener) { document.removeEventListener('click', this.documentClickListener); this.documentClickListener = null; } } }, { key: "renderSeparator", value: function renderSeparator(index) { return /*#__PURE__*/React.createElement("li", { key: 'separator_' + index, className: "p-menu-separator", role: "separator" }); } }, { key: "renderSubmenuIcon", value: function renderSubmenuIcon(item) { if (item.items) { var className = classNames('p-submenu-icon pi', { 'pi-angle-down': this.isHorizontal(), 'pi-angle-right': this.isVertical() }); return /*#__PURE__*/React.createElement("span", { className: className }); } return null; } }, { key: "renderSubmenuItem", value: function renderSubmenuItem(item, index) { var _this3 = this; if (item.separator) { return this.renderSeparator(index); } else { var className = classNames('p-menuitem', item.className); var linkClassName = classNames('p-menuitem-link', { 'p-disabled': item.disabled }); var iconClassName = classNames(item.icon, 'p-menuitem-icon'); var icon = item.icon && /*#__PURE__*/React.createElement("span", { className: iconClassName }); var label = item.label && /*#__PURE__*/React.createElement("span", { className: "p-menuitem-text" }, item.label); var content = /*#__PURE__*/React.createElement("a", { href: item.url || '#', className: linkClassName, target: item.target, onClick: function onClick(event) { return _this3.onLeafClick(event, item); }, role: "menuitem", "aria-disabled": item.disabled }, icon, label, /*#__PURE__*/React.createElement(Ripple, null)); if (item.template) { var defaultContentOptions = { onClick: function onClick(event) { return _this3.onLeafClick(event, item); }, className: linkClassName, labelClassName: 'p-menuitem-text', iconClassName: iconClassName, element: content, props: this.props }; content = ObjectUtils.getJSXElement(item.template, item, defaultContentOptions); } return /*#__PURE__*/React.createElement("li", { key: item.label + '_' + index, className: className, style: item.style, role: "none" }, content); } } }, { key: "renderSubmenu", value: function renderSubmenu(submenu) { var _this4 = this; var className = classNames('p-megamenu-submenu-header', { 'p-disabled': submenu.disabled }, submenu.className); var items = submenu.items.map(function (item, index) { return _this4.renderSubmenuItem(item, index); }); return /*#__PURE__*/React.createElement(React.Fragment, { key: submenu.label }, /*#__PURE__*/React.createElement("li", { className: className, style: submenu.style, role: "presentation", "aria-disabled": submenu.disabled }, submenu.label), items); } }, { key: "renderSubmenus", value: function renderSubmenus(column) { var _this5 = this; return column.map(function (submenu, index) { return _this5.renderSubmenu(submenu, index); }); } }, { key: "renderColumn", value: function renderColumn(category, column, index, columnClassName) { var submenus = this.renderSubmenus(column); return /*#__PURE__*/React.createElement("div", { key: category.label + '_column_' + index, className: columnClassName }, /*#__PURE__*/React.createElement("ul", { className: "p-megamenu-submenu", role: "menu" }, submenus)); } }, { key: "renderColumns", value: function renderColumns(category) { var _this6 = this; if (category.items) { var columnClassName = this.getColumnClassName(category); return category.items.map(function (column, index) { return _this6.renderColumn(category, column, index, columnClassName); }); } return null; } }, { key: "renderCategoryPanel", value: function renderCategoryPanel(category) { if (category.items) { var columns = this.renderColumns(category); return /*#__PURE__*/React.createElement("div", { className: "p-megamenu-panel" }, /*#__PURE__*/React.createElement("div", { className: "p-megamenu-grid" }, columns)); } return null; } }, { key: "renderCategory", value: function renderCategory(category, index) { var _this7 = this; var className = classNames('p-menuitem', { 'p-menuitem-active': category === this.state.activeItem }, category.className); var linkClassName = classNames('p-menuitem-link', { 'p-disabled': category.disabled }); var iconClassName = classNames('p-menuitem-icon', category.icon); var icon = category.icon && /*#__PURE__*/React.createElement("span", { className: iconClassName }); var label = category.label && /*#__PURE__*/React.createElement("span", { className: "p-menuitem-text" }, category.label); var itemContent = category.template ? ObjectUtils.getJSXElement(category.template, category) : null; var submenuIcon = this.renderSubmenuIcon(category); var panel = this.renderCategoryPanel(category); return /*#__PURE__*/React.createElement("li", { key: category.label + '_' + index, className: className, style: category.style, onMouseEnter: function onMouseEnter(e) { return _this7.onCategoryMouseEnter(e, category); }, role: "none" }, /*#__PURE__*/React.createElement("a", { href: category.url || '#', className: linkClassName, target: category.target, onClick: function onClick(e) { return _this7.onCategoryClick(e, category); }, onKeyDown: function onKeyDown(e) { return _this7.onCategoryKeyDown(e, category); }, role: "menuitem", "aria-haspopup": category.items != null }, icon, label, itemContent, submenuIcon, /*#__PURE__*/React.createElement(Ripple, null)), panel); } }, { key: "renderMenu", value: function renderMenu() { var _this8 = this; if (this.props.model) { return this.props.model.map(function (item, index) { return _this8.renderCategory(item, index, true); }); } return null; } }, { key: "renderCustomContent", value: function renderCustomContent() { if (this.props.children) { return /*#__PURE__*/React.createElement("div", { className: "p-megamenu-custom" }, this.props.children); } return null; } }, { key: "render", value: function render() { var _this9 = this; var className = classNames('p-megamenu p-component', { 'p-megamenu-horizontal': this.props.orientation === 'horizontal', 'p-megamenu-vertical': this.props.orientation === 'vertical' }, this.props.className); var menu = this.renderMenu(); var customContent = this.renderCustomContent(); return /*#__PURE__*/React.createElement("div", { ref: function ref(el) { return _this9.container = el; }, id: this.props.id, className: className, style: this.props.style }, /*#__PURE__*/React.createElement("ul", { className: "p-megamenu-root-list", role: "menubar" }, menu), customContent); } }]); return MegaMenu; }(Component); _defineProperty(MegaMenu, "defaultProps", { id: null, model: null, style: null, className: null, orientation: 'horizontal' }); export { MegaMenu };
ajax/libs/react-native-web/0.11.4/vendor/react-native/SectionList/index.js
cdnjs/cdnjs
function _extends() { _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; }; return _extends.apply(this, arguments); } function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, 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; } /** * Copyright (c) 2015-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. * * * @format */ import UnimplementedView from '../../../modules/UnimplementedView'; import Platform from '../../../exports/Platform'; import React from 'react'; import ScrollView from '../../../exports/ScrollView'; import VirtualizedSectionList from '../VirtualizedSectionList'; var defaultProps = _objectSpread({}, VirtualizedSectionList.defaultProps, { stickySectionHeadersEnabled: Platform.OS === 'ios' }); /** * A performant interface for rendering sectioned lists, supporting the most handy features: * * - Fully cross-platform. * - Configurable viewability callbacks. * - List header support. * - List footer support. * - Item separator support. * - Section header support. * - Section separator support. * - Heterogeneous data and item rendering support. * - Pull to Refresh. * - Scroll loading. * * If you don't need section support and want a simpler interface, use * [`<FlatList>`](/react-native/docs/flatlist.html). * * Simple Examples: * * <SectionList * renderItem={({item}) => <ListItem title={item} />} * renderSectionHeader={({section}) => <Header title={section.title} />} * sections={[ // homogeneous rendering between sections * {data: [...], title: ...}, * {data: [...], title: ...}, * {data: [...], title: ...}, * ]} * /> * * <SectionList * sections={[ // heterogeneous rendering between sections * {data: [...], renderItem: ...}, * {data: [...], renderItem: ...}, * {data: [...], renderItem: ...}, * ]} * /> * * This is a convenience wrapper around [`<VirtualizedList>`](docs/virtualizedlist.html), * and thus inherits its props (as well as those of `ScrollView`) that aren't explicitly listed * here, along with the following caveats: * * - Internal state is not preserved when content scrolls out of the render window. Make sure all * your data is captured in the item data or external stores like Flux, Redux, or Relay. * - This is a `PureComponent` which means that it will not re-render if `props` remain shallow- * equal. Make sure that everything your `renderItem` function depends on is passed as a prop * (e.g. `extraData`) that is not `===` after updates, otherwise your UI may not update on * changes. This includes the `data` prop and parent component state. * - In order to constrain memory and enable smooth scrolling, content is rendered asynchronously * offscreen. This means it's possible to scroll faster than the fill rate and momentarily see * blank content. This is a tradeoff that can be adjusted to suit the needs of each application, * and we are working on improving it behind the scenes. * - By default, the list looks for a `key` prop on each item and uses that for the React key. * Alternatively, you can provide a custom `keyExtractor` prop. * */ var SectionList = /*#__PURE__*/ function (_React$PureComponent) { _inheritsLoose(SectionList, _React$PureComponent); function SectionList() { var _this; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args)) || this; _this._captureRef = function (ref) { /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment * suppresses an error when upgrading Flow's support for React. To see the * error delete this comment and run Flow. */ _this._wrapperListRef = ref; }; return _this; } var _proto = SectionList.prototype; /** * Scrolls to the item at the specified `sectionIndex` and `itemIndex` (within the section) * positioned in the viewable area such that `viewPosition` 0 places it at the top (and may be * covered by a sticky header), 1 at the bottom, and 0.5 centered in the middle. `viewOffset` is a * fixed number of pixels to offset the final target position, e.g. to compensate for sticky * headers. * * Note: cannot scroll to locations outside the render window without specifying the * `getItemLayout` prop. */ _proto.scrollToLocation = function scrollToLocation(params) { this._wrapperListRef.scrollToLocation(params); } /** * Tells the list an interaction has occurred, which should trigger viewability calculations, e.g. * if `waitForInteractions` is true and the user has not scrolled. This is typically called by * taps on items or by navigation actions. */ ; _proto.recordInteraction = function recordInteraction() { var listRef = this._wrapperListRef && this._wrapperListRef.getListRef(); listRef && listRef.recordInteraction(); } /** * Displays the scroll indicators momentarily. * * @platform ios */ ; _proto.flashScrollIndicators = function flashScrollIndicators() { var listRef = this._wrapperListRef && this._wrapperListRef.getListRef(); listRef && listRef.flashScrollIndicators(); } /** * Provides a handle to the underlying scroll responder. */ ; _proto.getScrollResponder = function getScrollResponder() { var listRef = this._wrapperListRef && this._wrapperListRef.getListRef(); if (listRef) { return listRef.getScrollResponder(); } }; _proto.getScrollableNode = function getScrollableNode() { var listRef = this._wrapperListRef && this._wrapperListRef.getListRef(); if (listRef) { return listRef.getScrollableNode(); } }; _proto.setNativeProps = function setNativeProps(props) { var listRef = this._wrapperListRef && this._wrapperListRef.getListRef(); if (listRef) { listRef.setNativeProps(props); } }; _proto.render = function render() { var List = this.props.legacyImplementation ? UnimplementedView : VirtualizedSectionList; /* $FlowFixMe(>=0.66.0 site=react_native_fb) This comment suppresses an * error found when Flow v0.66 was deployed. To see the error delete this * comment and run Flow. */ return React.createElement(List, _extends({}, this.props, { ref: this._captureRef })); }; return SectionList; }(React.PureComponent); SectionList.defaultProps = defaultProps; export default SectionList;
ajax/libs/material-ui/4.9.3/esm/Slider/Slider.js
cdnjs/cdnjs
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; import _extends from "@babel/runtime/helpers/esm/extends"; import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray"; import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import { chainPropTypes } from '@material-ui/utils'; import withStyles from '../styles/withStyles'; import useTheme from '../styles/useTheme'; import { fade, lighten, darken } from '../styles/colorManipulator'; import { useIsFocusVisible } from '../utils/focusVisible'; import ownerDocument from '../utils/ownerDocument'; import useEventCallback from '../utils/useEventCallback'; import useForkRef from '../utils/useForkRef'; import capitalize from '../utils/capitalize'; import useControlled from '../utils/useControlled'; import ValueLabel from './ValueLabel'; function asc(a, b) { return a - b; } function clamp(value, min, max) { return Math.min(Math.max(min, value), max); } function findClosest(values, currentValue) { var _values$reduce = values.reduce(function (acc, value, index) { var distance = Math.abs(currentValue - value); if (acc === null || distance < acc.distance || distance === acc.distance) { return { distance: distance, index: index }; } return acc; }, null), closestIndex = _values$reduce.index; return closestIndex; } function trackFinger(event, touchId) { if (touchId.current !== undefined && event.changedTouches) { for (var i = 0; i < event.changedTouches.length; i += 1) { var touch = event.changedTouches[i]; if (touch.identifier === touchId.current) { return { x: touch.clientX, y: touch.clientY }; } } return false; } return { x: event.clientX, y: event.clientY }; } function valueToPercent(value, min, max) { return (value - min) * 100 / (max - min); } function percentToValue(percent, min, max) { return (max - min) * percent + min; } function getDecimalPrecision(num) { // This handles the case when num is very small (0.00000001), js will turn this into 1e-8. // When num is bigger than 1 or less than -1 it won't get converted to this notation so it's fine. if (Math.abs(num) < 1) { var parts = num.toExponential().split('e-'); var matissaDecimalPart = parts[0].split('.')[1]; return (matissaDecimalPart ? matissaDecimalPart.length : 0) + parseInt(parts[1], 10); } var decimalPart = num.toString().split('.')[1]; return decimalPart ? decimalPart.length : 0; } function roundValueToStep(value, step, min) { var nearest = Math.round((value - min) / step) * step + min; return Number(nearest.toFixed(getDecimalPrecision(step))); } function setValueIndex(_ref) { var values = _ref.values, source = _ref.source, newValue = _ref.newValue, index = _ref.index; // Performance shortcut if (values[index] === newValue) { return source; } var output = _toConsumableArray(values); output[index] = newValue; return output; } function focusThumb(_ref2) { var sliderRef = _ref2.sliderRef, activeIndex = _ref2.activeIndex, setActive = _ref2.setActive; if (!sliderRef.current.contains(document.activeElement) || Number(document.activeElement.getAttribute('data-index')) !== activeIndex) { sliderRef.current.querySelector("[data-index=\"".concat(activeIndex, "\"]")).focus(); } if (setActive) { setActive(activeIndex); } } var axisProps = { horizontal: { offset: function offset(percent) { return { left: "".concat(percent, "%") }; }, leap: function leap(percent) { return { width: "".concat(percent, "%") }; } }, 'horizontal-reverse': { offset: function offset(percent) { return { right: "".concat(percent, "%") }; }, leap: function leap(percent) { return { width: "".concat(percent, "%") }; } }, vertical: { offset: function offset(percent) { return { bottom: "".concat(percent, "%") }; }, leap: function leap(percent) { return { height: "".concat(percent, "%") }; } } }; var Identity = function Identity(x) { return x; }; export var styles = function styles(theme) { return { /* Styles applied to the root element. */ root: { height: 2, width: '100%', boxSizing: 'content-box', padding: '13px 0', display: 'inline-block', position: 'relative', cursor: 'pointer', touchAction: 'none', color: theme.palette.primary.main, WebkitTapHighlightColor: 'transparent', '&$disabled': { pointerEvents: 'none', cursor: 'default', color: theme.palette.grey[400] }, '&$vertical': { width: 2, height: '100%', padding: '0 13px' }, // The primary input mechanism of the device includes a pointing device of limited accuracy. '@media (pointer: coarse)': { // Reach 42px touch target, about ~8mm on screen. padding: '20px 0', '&$vertical': { padding: '0 20px' } } }, /* Styles applied to the root element if `color="primary"`. */ colorPrimary: {// TODO v5: move the style here }, /* Styles applied to the root element if `color="secondary"`. */ colorSecondary: { color: theme.palette.secondary.main }, /* Styles applied to the root element if `marks` is provided with at least one label. */ marked: { marginBottom: 20, '&$vertical': { marginBottom: 'auto', marginRight: 20 } }, /* Pseudo-class applied to the root element if `orientation="vertical"`. */ vertical: {}, /* Pseudo-class applied to the root and thumb element if `disabled={true}`. */ disabled: {}, /* Styles applied to the rail element. */ rail: { display: 'block', position: 'absolute', width: '100%', height: 2, borderRadius: 1, backgroundColor: 'currentColor', opacity: 0.38, '$vertical &': { height: '100%', width: 2 } }, /* Styles applied to the track element. */ track: { display: 'block', position: 'absolute', height: 2, borderRadius: 1, backgroundColor: 'currentColor', '$vertical &': { width: 2 } }, /* Styles applied to the track element if `track={false}`. */ trackFalse: { '& $track': { display: 'none' } }, /* Styles applied to the track element if `track="inverted"`. */ trackInverted: { '& $track': { backgroundColor: // Same logic as the LinearProgress track color theme.palette.type === 'light' ? lighten(theme.palette.primary.main, 0.62) : darken(theme.palette.primary.main, 0.5) }, '& $rail': { opacity: 1 } }, /* Styles applied to the thumb element. */ thumb: { position: 'absolute', width: 12, height: 12, marginLeft: -6, marginTop: -5, boxSizing: 'border-box', borderRadius: '50%', outline: 0, backgroundColor: 'currentColor', display: 'flex', alignItems: 'center', justifyContent: 'center', transition: theme.transitions.create(['box-shadow'], { duration: theme.transitions.duration.shortest }), '&::after': { position: 'absolute', content: '""', borderRadius: '50%', // reach 42px hit target (2 * 15 + thumb diameter) left: -15, top: -15, right: -15, bottom: -15 }, '&$focusVisible,&:hover': { boxShadow: "0px 0px 0px 8px ".concat(fade(theme.palette.primary.main, 0.16)), '@media (hover: none)': { boxShadow: 'none' } }, '&$active': { boxShadow: "0px 0px 0px 14px ".concat(fade(theme.palette.primary.main, 0.16)) }, '&$disabled': { width: 8, height: 8, marginLeft: -4, marginTop: -3, '&:hover': { boxShadow: 'none' } }, '$vertical &': { marginLeft: -5, marginBottom: -6 }, '$vertical &$disabled': { marginLeft: -3, marginBottom: -4 } }, /* Styles applied to the thumb element if `color="primary"`. */ thumbColorPrimary: {// TODO v5: move the style here }, /* Styles applied to the thumb element if `color="secondary"`. */ thumbColorSecondary: { '&$focusVisible,&:hover': { boxShadow: "0px 0px 0px 8px ".concat(fade(theme.palette.secondary.main, 0.16)) }, '&$active': { boxShadow: "0px 0px 0px 14px ".concat(fade(theme.palette.secondary.main, 0.16)) } }, /* Pseudo-class applied to the thumb element if it's active. */ active: {}, /* Pseudo-class applied to the thumb element if keyboard focused. */ focusVisible: {}, /* Styles applied to the thumb label element. */ valueLabel: {}, /* Styles applied to the mark element. */ mark: { position: 'absolute', width: 2, height: 2, borderRadius: 1, backgroundColor: 'currentColor' }, /* Styles applied to the mark element if active (depending on the value). */ markActive: { backgroundColor: theme.palette.background.paper, opacity: 0.8 }, /* Styles applied to the mark label element. */ markLabel: _extends({}, theme.typography.body2, { color: theme.palette.text.secondary, position: 'absolute', top: 26, transform: 'translateX(-50%)', whiteSpace: 'nowrap', '$vertical &': { top: 'auto', left: 26, transform: 'translateY(50%)' }, '@media (pointer: coarse)': { top: 40, '$vertical &': { left: 31 } } }), /* Styles applied to the mark label element if active (depending on the value). */ markLabelActive: { color: theme.palette.text.primary } }; }; var Slider = React.forwardRef(function Slider(props, ref) { var ariaLabel = props['aria-label'], ariaLabelledby = props['aria-labelledby'], ariaValuetext = props['aria-valuetext'], classes = props.classes, className = props.className, _props$color = props.color, color = _props$color === void 0 ? 'primary' : _props$color, _props$component = props.component, Component = _props$component === void 0 ? 'span' : _props$component, defaultValue = props.defaultValue, _props$disabled = props.disabled, disabled = _props$disabled === void 0 ? false : _props$disabled, getAriaLabel = props.getAriaLabel, getAriaValueText = props.getAriaValueText, _props$marks = props.marks, marksProp = _props$marks === void 0 ? false : _props$marks, _props$max = props.max, max = _props$max === void 0 ? 100 : _props$max, _props$min = props.min, min = _props$min === void 0 ? 0 : _props$min, name = props.name, onChange = props.onChange, onChangeCommitted = props.onChangeCommitted, onMouseDown = props.onMouseDown, _props$orientation = props.orientation, orientation = _props$orientation === void 0 ? 'horizontal' : _props$orientation, _props$scale = props.scale, scale = _props$scale === void 0 ? Identity : _props$scale, _props$step = props.step, step = _props$step === void 0 ? 1 : _props$step, _props$ThumbComponent = props.ThumbComponent, ThumbComponent = _props$ThumbComponent === void 0 ? 'span' : _props$ThumbComponent, _props$track = props.track, track = _props$track === void 0 ? 'normal' : _props$track, valueProp = props.value, _props$ValueLabelComp = props.ValueLabelComponent, ValueLabelComponent = _props$ValueLabelComp === void 0 ? ValueLabel : _props$ValueLabelComp, _props$valueLabelDisp = props.valueLabelDisplay, valueLabelDisplay = _props$valueLabelDisp === void 0 ? 'off' : _props$valueLabelDisp, _props$valueLabelForm = props.valueLabelFormat, valueLabelFormat = _props$valueLabelForm === void 0 ? Identity : _props$valueLabelForm, other = _objectWithoutProperties(props, ["aria-label", "aria-labelledby", "aria-valuetext", "classes", "className", "color", "component", "defaultValue", "disabled", "getAriaLabel", "getAriaValueText", "marks", "max", "min", "name", "onChange", "onChangeCommitted", "onMouseDown", "orientation", "scale", "step", "ThumbComponent", "track", "value", "ValueLabelComponent", "valueLabelDisplay", "valueLabelFormat"]); var theme = useTheme(); var touchId = React.useRef(); // We can't use the :active browser pseudo-classes. // - The active state isn't triggered when clicking on the rail. // - The active state isn't transfered when inversing a range slider. var _React$useState = React.useState(-1), active = _React$useState[0], setActive = _React$useState[1]; var _React$useState2 = React.useState(-1), open = _React$useState2[0], setOpen = _React$useState2[1]; var _useControlled = useControlled({ controlled: valueProp, default: defaultValue, name: 'Slider' }), _useControlled2 = _slicedToArray(_useControlled, 2), valueDerived = _useControlled2[0], setValueState = _useControlled2[1]; var range = Array.isArray(valueDerived); var instanceRef = React.useRef(); var values = range ? _toConsumableArray(valueDerived).sort(asc) : [valueDerived]; values = values.map(function (value) { return clamp(value, min, max); }); var marks = marksProp === true && step !== null ? _toConsumableArray(Array(Math.floor((max - min) / step) + 1)).map(function (_, index) { return { value: min + step * index }; }) : marksProp || []; instanceRef.current = { source: valueDerived // Keep track of the input value to leverage immutable state comparison. }; var _useIsFocusVisible = useIsFocusVisible(), isFocusVisible = _useIsFocusVisible.isFocusVisible, onBlurVisible = _useIsFocusVisible.onBlurVisible, focusVisibleRef = _useIsFocusVisible.ref; var _React$useState3 = React.useState(-1), focusVisible = _React$useState3[0], setFocusVisible = _React$useState3[1]; var sliderRef = React.useRef(); var handleFocusRef = useForkRef(focusVisibleRef, sliderRef); var handleRef = useForkRef(ref, handleFocusRef); var handleFocus = useEventCallback(function (event) { var index = Number(event.currentTarget.getAttribute('data-index')); if (isFocusVisible(event)) { setFocusVisible(index); } setOpen(index); }); var handleBlur = useEventCallback(function () { if (focusVisible !== -1) { setFocusVisible(-1); onBlurVisible(); } setOpen(-1); }); var handleMouseOver = useEventCallback(function (event) { var index = Number(event.currentTarget.getAttribute('data-index')); setOpen(index); }); var handleMouseLeave = useEventCallback(function () { setOpen(-1); }); var handleKeyDown = useEventCallback(function (event) { var index = Number(event.currentTarget.getAttribute('data-index')); var value = values[index]; var tenPercents = (max - min) / 10; var marksValues = marks.map(function (mark) { return mark.value; }); var marksIndex = marksValues.indexOf(value); var newValue; switch (event.key) { case 'Home': newValue = min; break; case 'End': newValue = max; break; case 'PageUp': if (step) { newValue = value + tenPercents; } break; case 'PageDown': if (step) { newValue = value - tenPercents; } break; case 'ArrowRight': case 'ArrowUp': if (step) { newValue = value + step; } else { newValue = marksValues[marksIndex + 1] || marksValues[marksValues.length - 1]; } break; case 'ArrowLeft': case 'ArrowDown': if (step) { newValue = value - step; } else { newValue = marksValues[marksIndex - 1] || marksValues[0]; } break; default: return; } // Prevent scroll of the page event.preventDefault(); if (step) { newValue = roundValueToStep(newValue, step, min); } newValue = clamp(newValue, min, max); if (range) { var previousValue = newValue; newValue = setValueIndex({ values: values, source: valueDerived, newValue: newValue, index: index }).sort(asc); focusThumb({ sliderRef: sliderRef, activeIndex: newValue.indexOf(previousValue) }); } setValueState(newValue); setFocusVisible(index); if (onChange) { onChange(event, newValue); } if (onChangeCommitted) { onChangeCommitted(event, newValue); } }); var previousIndex = React.useRef(); var axis = orientation; if (theme.direction === 'rtl' && orientation !== "vertical") { axis += '-reverse'; } var getFingerNewValue = function getFingerNewValue(_ref3) { var finger = _ref3.finger, _ref3$move = _ref3.move, move = _ref3$move === void 0 ? false : _ref3$move, values2 = _ref3.values, source = _ref3.source; var slider = sliderRef.current; var _slider$getBoundingCl = slider.getBoundingClientRect(), width = _slider$getBoundingCl.width, height = _slider$getBoundingCl.height, bottom = _slider$getBoundingCl.bottom, left = _slider$getBoundingCl.left; var percent; if (axis.indexOf('vertical') === 0) { percent = (bottom - finger.y) / height; } else { percent = (finger.x - left) / width; } if (axis.indexOf('-reverse') !== -1) { percent = 1 - percent; } var newValue; newValue = percentToValue(percent, min, max); if (step) { newValue = roundValueToStep(newValue, step, min); } else { var marksValues = marks.map(function (mark) { return mark.value; }); var closestIndex = findClosest(marksValues, newValue); newValue = marksValues[closestIndex]; } newValue = clamp(newValue, min, max); var activeIndex = 0; if (range) { if (!move) { activeIndex = findClosest(values2, newValue); } else { activeIndex = previousIndex.current; } var previousValue = newValue; newValue = setValueIndex({ values: values2, source: source, newValue: newValue, index: activeIndex }).sort(asc); activeIndex = newValue.indexOf(previousValue); previousIndex.current = activeIndex; } return { newValue: newValue, activeIndex: activeIndex }; }; var handleTouchMove = useEventCallback(function (event) { var finger = trackFinger(event, touchId); if (!finger) { return; } var _getFingerNewValue = getFingerNewValue({ finger: finger, move: true, values: values, source: valueDerived }), newValue = _getFingerNewValue.newValue, activeIndex = _getFingerNewValue.activeIndex; focusThumb({ sliderRef: sliderRef, activeIndex: activeIndex, setActive: setActive }); setValueState(newValue); if (onChange) { onChange(event, newValue); } }); var handleTouchEnd = useEventCallback(function (event) { var finger = trackFinger(event, touchId); if (!finger) { return; } var _getFingerNewValue2 = getFingerNewValue({ finger: finger, values: values, source: valueDerived }), newValue = _getFingerNewValue2.newValue; setActive(-1); if (event.type === 'touchend') { setOpen(-1); } if (onChangeCommitted) { onChangeCommitted(event, newValue); } touchId.current = undefined; var doc = ownerDocument(sliderRef.current); doc.removeEventListener('mousemove', handleTouchMove); doc.removeEventListener('mouseup', handleTouchEnd); doc.removeEventListener('touchmove', handleTouchMove); doc.removeEventListener('touchend', handleTouchEnd); }); var handleTouchStart = useEventCallback(function (event) { // Workaround as Safari has partial support for touchAction: 'none'. event.preventDefault(); var touch = event.changedTouches[0]; if (touch != null) { // A number that uniquely identifies the current finger in the touch session. touchId.current = touch.identifier; } var finger = trackFinger(event, touchId); var _getFingerNewValue3 = getFingerNewValue({ finger: finger, values: values, source: valueDerived }), newValue = _getFingerNewValue3.newValue, activeIndex = _getFingerNewValue3.activeIndex; focusThumb({ sliderRef: sliderRef, activeIndex: activeIndex, setActive: setActive }); setValueState(newValue); if (onChange) { onChange(event, newValue); } var doc = ownerDocument(sliderRef.current); doc.addEventListener('touchmove', handleTouchMove); doc.addEventListener('touchend', handleTouchEnd); }); React.useEffect(function () { var slider = sliderRef.current; slider.addEventListener('touchstart', handleTouchStart); var doc = ownerDocument(slider); return function () { slider.removeEventListener('touchstart', handleTouchStart); doc.removeEventListener('mousemove', handleTouchMove); doc.removeEventListener('mouseup', handleTouchEnd); doc.removeEventListener('touchmove', handleTouchMove); doc.removeEventListener('touchend', handleTouchEnd); }; }, [handleTouchEnd, handleTouchMove, handleTouchStart]); var handleMouseDown = useEventCallback(function (event) { if (onMouseDown) { onMouseDown(event); } event.preventDefault(); var finger = trackFinger(event, touchId); var _getFingerNewValue4 = getFingerNewValue({ finger: finger, values: values, source: valueDerived }), newValue = _getFingerNewValue4.newValue, activeIndex = _getFingerNewValue4.activeIndex; focusThumb({ sliderRef: sliderRef, activeIndex: activeIndex, setActive: setActive }); setValueState(newValue); if (onChange) { onChange(event, newValue); } var doc = ownerDocument(sliderRef.current); doc.addEventListener('mousemove', handleTouchMove); doc.addEventListener('mouseup', handleTouchEnd); }); var trackOffset = valueToPercent(range ? values[0] : min, min, max); var trackLeap = valueToPercent(values[values.length - 1], min, max) - trackOffset; var trackStyle = _extends({}, axisProps[axis].offset(trackOffset), {}, axisProps[axis].leap(trackLeap)); return React.createElement(Component, _extends({ ref: handleRef, className: clsx(classes.root, classes["color".concat(capitalize(color))], className, disabled && classes.disabled, marks.length > 0 && marks.some(function (mark) { return mark.label; }) && classes.marked, track === false && classes.trackFalse, orientation === 'vertical' && classes.vertical, track === 'inverted' && classes.trackInverted), onMouseDown: handleMouseDown }, other), React.createElement("span", { className: classes.rail }), React.createElement("span", { className: classes.track, style: trackStyle }), React.createElement("input", { value: values.join(','), name: name, type: "hidden" }), marks.map(function (mark) { var percent = valueToPercent(mark.value, min, max); var style = axisProps[axis].offset(percent); var markActive; if (track === false) { markActive = values.indexOf(mark.value) !== -1; } else { markActive = track === 'normal' && (range ? mark.value >= values[0] && mark.value <= values[values.length - 1] : mark.value <= values[0]) || track === 'inverted' && (range ? mark.value <= values[0] || mark.value >= values[values.length - 1] : mark.value >= values[0]); } return React.createElement(React.Fragment, { key: mark.value }, React.createElement("span", { style: style, className: clsx(classes.mark, markActive && classes.markActive) }), React.createElement("span", { "aria-hidden": true, style: style, className: clsx(classes.markLabel, markActive && classes.markLabelActive) }, mark.label)); }), values.map(function (value, index) { var percent = valueToPercent(value, min, max); var style = axisProps[axis].offset(percent); return React.createElement(ValueLabelComponent, { key: index, valueLabelFormat: valueLabelFormat, valueLabelDisplay: valueLabelDisplay, className: classes.valueLabel, value: typeof valueLabelFormat === 'function' ? valueLabelFormat(scale(value), index) : valueLabelFormat, index: index, open: open === index || active === index || valueLabelDisplay === 'on', disabled: disabled }, React.createElement(ThumbComponent, { className: clsx(classes.thumb, classes["thumbColor".concat(capitalize(color))], active === index && classes.active, disabled && classes.disabled, focusVisible === index && classes.focusVisible), tabIndex: disabled ? null : 0, role: "slider", style: style, "data-index": index, "aria-label": getAriaLabel ? getAriaLabel(index) : ariaLabel, "aria-labelledby": ariaLabelledby, "aria-orientation": orientation, "aria-valuemax": scale(max), "aria-valuemin": scale(min), "aria-valuenow": scale(value), "aria-valuetext": getAriaValueText ? getAriaValueText(scale(value), index) : ariaValuetext, onKeyDown: handleKeyDown, onFocus: handleFocus, onBlur: handleBlur, onMouseOver: handleMouseOver, onMouseLeave: handleMouseLeave })); })); }); process.env.NODE_ENV !== "production" ? Slider.propTypes = { /** * The label of the slider. */ 'aria-label': chainPropTypes(PropTypes.string, function (props) { var range = Array.isArray(props.value || props.defaultValue); if (range && props['aria-label'] != null) { return new Error('Material-UI: you need to use the `getAriaLabel` prop instead of `aria-label` when using a range slider.'); } return null; }), /** * The id of the element containing a label for the slider. */ 'aria-labelledby': PropTypes.string, /** * A string value that provides a user-friendly name for the current value of the slider. */ 'aria-valuetext': chainPropTypes(PropTypes.string, function (props) { var range = Array.isArray(props.value || props.defaultValue); if (range && props['aria-valuetext'] != null) { return new Error('Material-UI: you need to use the `getAriaValueText` prop instead of `aria-valuetext` when using a range slider.'); } return null; }), /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * @ignore */ className: PropTypes.string, /** * The color of the component. It supports those theme colors that make sense for this component. */ color: PropTypes.oneOf(['primary', 'secondary']), /** * The component used for the root node. * Either a string to use a DOM element or a component. */ component: PropTypes.elementType, /** * The default element value. Use when the component is not controlled. */ defaultValue: PropTypes.oneOfType([PropTypes.number, PropTypes.arrayOf(PropTypes.number)]), /** * If `true`, the slider will be disabled. */ disabled: PropTypes.bool, /** * Accepts a function which returns a string value that provides a user-friendly name for the thumb labels of the slider. * * @param {number} index The thumb label's index to format. * @returns {string} */ getAriaLabel: PropTypes.func, /** * Accepts a function which returns a string value that provides a user-friendly name for the current value of the slider. * * @param {number} value The thumb label's value to format. * @param {number} index The thumb label's index to format. * @returns {string} */ getAriaValueText: PropTypes.func, /** * Marks indicate predetermined values to which the user can move the slider. * If `true` the marks will be spaced according the value of the `step` prop. * If an array, it should contain objects with `value` and an optional `label` keys. */ marks: PropTypes.oneOfType([PropTypes.bool, PropTypes.array]), /** * The maximum allowed value of the slider. * Should not be equal to min. */ max: PropTypes.number, /** * The minimum allowed value of the slider. * Should not be equal to max. */ min: PropTypes.number, /** * Name attribute of the hidden `input` element. */ name: PropTypes.string, /** * Callback function that is fired when the slider's value changed. * * @param {object} event The event source of the callback. * @param {any} value The new value. */ onChange: PropTypes.func, /** * Callback function that is fired when the `mouseup` is triggered. * * @param {object} event The event source of the callback. * @param {any} value The new value. */ onChangeCommitted: PropTypes.func, /** * @ignore */ onMouseDown: PropTypes.func, /** * The slider orientation. */ orientation: PropTypes.oneOf(['horizontal', 'vertical']), /** * A transformation function, to change the scale of the slider. */ scale: PropTypes.func, /** * The granularity with which the slider can step through values. (A "discrete" slider.) * The `min` prop serves as the origin for the valid values. * We recommend (max - min) to be evenly divisible by the step. * * When step is `null`, the thumb can only be slid onto marks provided with the `marks` prop. */ step: PropTypes.number, /** * The component used to display the value label. */ ThumbComponent: PropTypes.elementType, /** * The track presentation: * * - `normal` the track will render a bar representing the slider value. * - `inverted` the track will render a bar representing the remaining slider value. * - `false` the track will render without a bar. */ track: PropTypes.oneOf(['normal', false, 'inverted']), /** * The value of the slider. * For ranged sliders, provide an array with two values. */ value: PropTypes.oneOfType([PropTypes.number, PropTypes.arrayOf(PropTypes.number)]), /** * The value label component. */ ValueLabelComponent: PropTypes.elementType, /** * Controls when the value label is displayed: * * - `auto` the value label will display when the thumb is hovered or focused. * - `on` will display persistently. * - `off` will never display. */ valueLabelDisplay: PropTypes.oneOf(['on', 'auto', 'off']), /** * The format function the value label's value. * * When a function is provided, it should have the following signature: * * - {number} value The value label's value to format * - {number} index The value label's index to format */ valueLabelFormat: PropTypes.oneOfType([PropTypes.string, PropTypes.func]) } : void 0; export default withStyles(styles, { name: 'MuiSlider' })(Slider);
ajax/libs/react-native-web/0.11.2/vendor/react-native/SwipeableFlatList/index.js
cdnjs/cdnjs
/** * Copyright (c) 2015-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. * * @providesModule SwipeableFlatList * * @format */ 'use strict'; function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, 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; } function _extends() { _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; }; return _extends.apply(this, arguments); } function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } import PropTypes from 'prop-types'; import React from 'react'; import SwipeableRow from '../SwipeableRow'; import FlatList from '../FlatList'; /** * A container component that renders multiple SwipeableRow's in a FlatList * implementation. This is designed to be a drop-in replacement for the * standard React Native `FlatList`, so use it as if it were a FlatList, but * with extra props, i.e. * * <SwipeableListView renderRow={..} renderQuickActions={..} {..FlatList props} /> * * SwipeableRow can be used independently of this component, but the main * benefit of using this component is * * - It ensures that at most 1 row is swiped open (auto closes others) * - It can bounce the 1st row of the list so users know it's swipeable * - Increase performance on iOS by locking list swiping when row swiping is occurring * - More to come */ var SwipeableFlatList = /*#__PURE__*/ function (_React$Component) { _inheritsLoose(SwipeableFlatList, _React$Component); function SwipeableFlatList(props, context) { var _this; _this = _React$Component.call(this, props, context) || this; _this._flatListRef = null; _this._shouldBounceFirstRowOnMount = false; _this._onScroll = function (e) { // Close any opens rows on ListView scroll if (_this.state.openRowKey) { _this.setState({ openRowKey: null }); } _this.props.onScroll && _this.props.onScroll(e); }; _this._renderItem = function (info) { var slideoutView = _this.props.renderQuickActions(info); var key = _this.props.keyExtractor(info.item, info.index); // If renderQuickActions is unspecified or returns falsey, don't allow swipe if (!slideoutView) { return _this.props.renderItem(info); } var shouldBounceOnMount = false; if (_this._shouldBounceFirstRowOnMount) { _this._shouldBounceFirstRowOnMount = false; shouldBounceOnMount = true; } return React.createElement(SwipeableRow, { slideoutView: slideoutView, isOpen: key === _this.state.openRowKey, maxSwipeDistance: _this._getMaxSwipeDistance(info), onOpen: function onOpen() { return _this._onOpen(key); }, onClose: function onClose() { return _this._onClose(key); }, shouldBounceOnMount: shouldBounceOnMount, onSwipeEnd: _this._setListViewScrollable, onSwipeStart: _this._setListViewNotScrollable }, _this.props.renderItem(info)); }; _this._setListViewScrollable = function () { _this._setListViewScrollableTo(true); }; _this._setListViewNotScrollable = function () { _this._setListViewScrollableTo(false); }; _this.state = { openRowKey: null }; _this._shouldBounceFirstRowOnMount = _this.props.bounceFirstRowOnMount; return _this; } var _proto = SwipeableFlatList.prototype; _proto.render = function render() { var _this2 = this; return React.createElement(FlatList, _extends({}, this.props, { ref: function ref(_ref) { _this2._flatListRef = _ref; }, onScroll: this._onScroll, renderItem: this._renderItem })); }; // This enables rows having variable width slideoutView. _proto._getMaxSwipeDistance = function _getMaxSwipeDistance(info) { if (typeof this.props.maxSwipeDistance === 'function') { return this.props.maxSwipeDistance(info); } return this.props.maxSwipeDistance; }; _proto._setListViewScrollableTo = function _setListViewScrollableTo(value) { if (this._flatListRef) { this._flatListRef.setNativeProps({ scrollEnabled: value }); } }; _proto._onOpen = function _onOpen(key) { this.setState({ openRowKey: key }); }; _proto._onClose = function _onClose(key) { this.setState({ openRowKey: null }); }; return SwipeableFlatList; }(React.Component); SwipeableFlatList.defaultProps = _objectSpread({}, FlatList.defaultProps, { bounceFirstRowOnMount: true, renderQuickActions: function renderQuickActions() { return null; } }); SwipeableFlatList.propTypes = process.env.NODE_ENV !== "production" ? _objectSpread({}, FlatList.propTypes, { /** * To alert the user that swiping is possible, the first row can bounce * on component mount. */ bounceFirstRowOnMount: PropTypes.bool.isRequired, // Maximum distance to open to after a swipe maxSwipeDistance: PropTypes.oneOfType([PropTypes.number, PropTypes.func]).isRequired, // Callback method to render the view that will be unveiled on swipe renderQuickActions: PropTypes.func.isRequired }) : {}; export default SwipeableFlatList;
ajax/libs/react-native-web/0.0.0-834df0271/exports/RefreshControl/index.js
cdnjs/cdnjs
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } /** * Copyright (c) Nicolas Gallagher. * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ import View from '../View'; import React from 'react'; function RefreshControl(props) { var colors = props.colors, enabled = props.enabled, onRefresh = props.onRefresh, progressBackgroundColor = props.progressBackgroundColor, progressViewOffset = props.progressViewOffset, refreshing = props.refreshing, size = props.size, tintColor = props.tintColor, title = props.title, titleColor = props.titleColor, rest = _objectWithoutPropertiesLoose(props, ["colors", "enabled", "onRefresh", "progressBackgroundColor", "progressViewOffset", "refreshing", "size", "tintColor", "title", "titleColor"]); return React.createElement(View, rest); } export default RefreshControl;
ajax/libs/boardgame-io/0.39.6/esm/react.js
cdnjs/cdnjs
import { d as _inherits, _ as _createClass, b as _defineProperty, a as _classCallCheck, f as _possibleConstructorReturn, h as _getPrototypeOf, k as _objectSpread2, t as _assertThisInitialized, n as _toConsumableArray } from './reducer-0ea50db8.js'; import 'redux'; import 'immer'; import './Debug-a41a191f.js'; import 'flatted'; import { M as MCTSBot } from './ai-779bcbbf.js'; import './initialize-20f559ab.js'; import { C as Client$1 } from './client-051af88e.js'; import React from 'react'; import PropTypes from 'prop-types'; import Cookies from 'react-cookies'; import './base-c99f5be2.js'; import { S as SocketIO, L as Local } from './socketio-93075793.js'; import './master-c4c08e76.js'; import 'socket.io-client'; /** * Client * * boardgame.io React client. * * @param {...object} game - The return value of `Game`. * @param {...object} numPlayers - The number of players. * @param {...object} board - The React component for the game. * @param {...object} loading - (optional) The React component for the loading state. * @param {...object} multiplayer - Set to a falsy value or a transportFactory, e.g., SocketIO() * @param {...object} debug - Enables the Debug UI. * @param {...object} enhancer - Optional enhancer to send to the Redux store * * Returns: * A React component that wraps board and provides an * API through props for it to interact with the framework * and dispatch actions such as MAKE_MOVE, GAME_EVENT, RESET, * UNDO and REDO. */ function Client(opts) { var _class, _temp; var game = opts.game, numPlayers = opts.numPlayers, loading = opts.loading, board = opts.board, multiplayer = opts.multiplayer, enhancer = opts.enhancer, debug = opts.debug; // Component that is displayed before the client has synced // with the game master. if (loading === undefined) { var Loading = function Loading() { return React.createElement("div", { className: "bgio-loading" }, "connecting..."); }; loading = Loading; } /* * WrappedBoard * * The main React component that wraps the passed in * board component and adds the API to its props. */ return _temp = _class = /*#__PURE__*/ function (_React$Component) { _inherits(WrappedBoard, _React$Component); function WrappedBoard(props) { var _this; _classCallCheck(this, WrappedBoard); _this = _possibleConstructorReturn(this, _getPrototypeOf(WrappedBoard).call(this, props)); if (debug === undefined) { debug = props.debug; } _this.client = Client$1({ game: game, debug: debug, numPlayers: numPlayers, multiplayer: multiplayer, gameID: props.gameID, playerID: props.playerID, credentials: props.credentials, enhancer: enhancer }); return _this; } _createClass(WrappedBoard, [{ key: "componentDidMount", value: function componentDidMount() { var _this2 = this; this.unsubscribe = this.client.subscribe(function () { return _this2.forceUpdate(); }); this.client.start(); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.client.stop(); this.unsubscribe(); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (this.props.gameID != prevProps.gameID) { this.client.updateGameID(this.props.gameID); } if (this.props.playerID != prevProps.playerID) { this.client.updatePlayerID(this.props.playerID); } if (this.props.credentials != prevProps.credentials) { this.client.updateCredentials(this.props.credentials); } } }, { key: "render", value: function render() { var state = this.client.getState(); if (state === null) { return React.createElement(loading); } var _board = null; if (board) { _board = React.createElement(board, _objectSpread2({}, state, {}, this.props, { isMultiplayer: !!multiplayer, moves: this.client.moves, events: this.client.events, gameID: this.client.gameID, playerID: this.client.playerID, reset: this.client.reset, undo: this.client.undo, redo: this.client.redo, gameMetadata: this.client.gameMetadata })); } return React.createElement("div", { className: "bgio-client" }, _board); } }]); return WrappedBoard; }(React.Component), _defineProperty(_class, "propTypes", { // The ID of a game to connect to. // Only relevant in multiplayer. gameID: PropTypes.string, // The ID of the player associated with this client. // Only relevant in multiplayer. playerID: PropTypes.string, // This client's authentication credentials. // Only relevant in multiplayer. credentials: PropTypes.string, // Enable / disable the Debug UI. debug: PropTypes.any }), _defineProperty(_class, "defaultProps", { gameID: 'default', playerID: null, credentials: null, debug: true }), _temp; } /* * Copyright 2018 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ var _LobbyConnectionImpl = /*#__PURE__*/ function () { function _LobbyConnectionImpl(_ref) { var server = _ref.server, gameComponents = _ref.gameComponents, playerName = _ref.playerName, playerCredentials = _ref.playerCredentials; _classCallCheck(this, _LobbyConnectionImpl); this.gameComponents = gameComponents; this.playerName = playerName || 'Visitor'; this.playerCredentials = playerCredentials; this.server = server; this.rooms = []; } _createClass(_LobbyConnectionImpl, [{ key: "_baseUrl", value: function _baseUrl() { return "".concat(this.server || '', "/games"); } }, { key: "refresh", value: async function refresh() { try { this.rooms.length = 0; var resp = await fetch(this._baseUrl()); if (resp.status !== 200) { throw new Error('HTTP status ' + resp.status); } var json = await resp.json(); var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = json[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var gameName = _step.value; if (!this._getGameComponents(gameName)) continue; var gameResp = await fetch(this._baseUrl() + '/' + gameName); var gameJson = await gameResp.json(); var _iteratorNormalCompletion2 = true; var _didIteratorError2 = false; var _iteratorError2 = undefined; try { for (var _iterator2 = gameJson.rooms[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { var inst = _step2.value; inst.gameName = gameName; } } catch (err) { _didIteratorError2 = true; _iteratorError2 = err; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) { _iterator2["return"](); } } finally { if (_didIteratorError2) { throw _iteratorError2; } } } this.rooms = this.rooms.concat(gameJson.rooms); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator["return"] != null) { _iterator["return"](); } } finally { if (_didIteratorError) { throw _iteratorError; } } } } catch (error) { throw new Error('failed to retrieve list of games (' + error + ')'); } } }, { key: "_getGameInstance", value: function _getGameInstance(gameID) { var _iteratorNormalCompletion3 = true; var _didIteratorError3 = false; var _iteratorError3 = undefined; try { for (var _iterator3 = this.rooms[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { var inst = _step3.value; if (inst['gameID'] === gameID) return inst; } } catch (err) { _didIteratorError3 = true; _iteratorError3 = err; } finally { try { if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) { _iterator3["return"](); } } finally { if (_didIteratorError3) { throw _iteratorError3; } } } } }, { key: "_getGameComponents", value: function _getGameComponents(gameName) { var _iteratorNormalCompletion4 = true; var _didIteratorError4 = false; var _iteratorError4 = undefined; try { for (var _iterator4 = this.gameComponents[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { var comp = _step4.value; if (comp.game.name === gameName) return comp; } } catch (err) { _didIteratorError4 = true; _iteratorError4 = err; } finally { try { if (!_iteratorNormalCompletion4 && _iterator4["return"] != null) { _iterator4["return"](); } } finally { if (_didIteratorError4) { throw _iteratorError4; } } } } }, { key: "_findPlayer", value: function _findPlayer(playerName) { var _iteratorNormalCompletion5 = true; var _didIteratorError5 = false; var _iteratorError5 = undefined; try { for (var _iterator5 = this.rooms[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { var inst = _step5.value; if (inst.players.some(function (player) { return player.name === playerName; })) return inst; } } catch (err) { _didIteratorError5 = true; _iteratorError5 = err; } finally { try { if (!_iteratorNormalCompletion5 && _iterator5["return"] != null) { _iterator5["return"](); } } finally { if (_didIteratorError5) { throw _iteratorError5; } } } } }, { key: "join", value: async function join(gameName, gameID, playerID) { try { var inst = this._findPlayer(this.playerName); if (inst) { throw new Error('player has already joined ' + inst.gameID); } inst = this._getGameInstance(gameID); if (!inst) { throw new Error('game instance ' + gameID + ' not found'); } var resp = await fetch(this._baseUrl() + '/' + gameName + '/' + gameID + '/join', { method: 'POST', body: JSON.stringify({ playerID: playerID, playerName: this.playerName }), headers: { 'Content-Type': 'application/json' } }); if (resp.status !== 200) throw new Error('HTTP status ' + resp.status); var json = await resp.json(); inst.players[Number.parseInt(playerID)].name = this.playerName; this.playerCredentials = json.playerCredentials; } catch (error) { throw new Error('failed to join room ' + gameID + ' (' + error + ')'); } } }, { key: "leave", value: async function leave(gameName, gameID) { try { var inst = this._getGameInstance(gameID); if (!inst) throw new Error('game instance not found'); var _iteratorNormalCompletion6 = true; var _didIteratorError6 = false; var _iteratorError6 = undefined; try { for (var _iterator6 = inst.players[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) { var player = _step6.value; if (player.name === this.playerName) { var resp = await fetch(this._baseUrl() + '/' + gameName + '/' + gameID + '/leave', { method: 'POST', body: JSON.stringify({ playerID: player.id, credentials: this.playerCredentials }), headers: { 'Content-Type': 'application/json' } }); if (resp.status !== 200) { throw new Error('HTTP status ' + resp.status); } delete player.name; delete this.playerCredentials; return; } } } catch (err) { _didIteratorError6 = true; _iteratorError6 = err; } finally { try { if (!_iteratorNormalCompletion6 && _iterator6["return"] != null) { _iterator6["return"](); } } finally { if (_didIteratorError6) { throw _iteratorError6; } } } throw new Error('player not found in room'); } catch (error) { throw new Error('failed to leave room ' + gameID + ' (' + error + ')'); } } }, { key: "disconnect", value: async function disconnect() { var inst = this._findPlayer(this.playerName); if (inst) { await this.leave(inst.gameName, inst.gameID); } this.rooms = []; this.playerName = 'Visitor'; } }, { key: "create", value: async function create(gameName, numPlayers) { try { var comp = this._getGameComponents(gameName); if (!comp) throw new Error('game not found'); if (numPlayers < comp.game.minPlayers || numPlayers > comp.game.maxPlayers) throw new Error('invalid number of players ' + numPlayers); var resp = await fetch(this._baseUrl() + '/' + gameName + '/create', { method: 'POST', body: JSON.stringify({ numPlayers: numPlayers }), headers: { 'Content-Type': 'application/json' } }); if (resp.status !== 200) throw new Error('HTTP status ' + resp.status); } catch (error) { throw new Error('failed to create room for ' + gameName + ' (' + error + ')'); } } }]); return _LobbyConnectionImpl; }(); /** * LobbyConnection * * Lobby model. * * @param {string} server - '<host>:<port>' of the server. * @param {Array} gameComponents - A map of Board and Game objects for the supported games. * @param {string} playerName - The name of the player. * @param {string} playerCredentials - The credentials currently used by the player, if any. * * Returns: * A JS object that synchronizes the list of running game instances with the server and provides an API to create/join/start instances. */ function LobbyConnection(opts) { return new _LobbyConnectionImpl(opts); } var LobbyLoginForm = /*#__PURE__*/ function (_React$Component) { _inherits(LobbyLoginForm, _React$Component); function LobbyLoginForm() { var _getPrototypeOf2; var _this; _classCallCheck(this, LobbyLoginForm); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(LobbyLoginForm)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_this), "state", { playerName: _this.props.playerName, nameErrorMsg: '' }); _defineProperty(_assertThisInitialized(_this), "onClickEnter", function () { if (_this.state.playerName === '') return; _this.props.onEnter(_this.state.playerName); }); _defineProperty(_assertThisInitialized(_this), "onKeyPress", function (event) { if (event.key === 'Enter') { _this.onClickEnter(); } }); _defineProperty(_assertThisInitialized(_this), "onChangePlayerName", function (event) { var name = event.target.value.trim(); _this.setState({ playerName: name, nameErrorMsg: name.length > 0 ? '' : 'empty player name' }); }); return _this; } _createClass(LobbyLoginForm, [{ key: "render", value: function render() { return React.createElement("div", null, React.createElement("p", { className: "phase-title" }, "Choose a player name:"), React.createElement("input", { type: "text", value: this.state.playerName, onChange: this.onChangePlayerName, onKeyPress: this.onKeyPress }), React.createElement("span", { className: "buttons" }, React.createElement("button", { className: "buttons", onClick: this.onClickEnter }, "Enter")), React.createElement("br", null), React.createElement("span", { className: "error-msg" }, this.state.nameErrorMsg, React.createElement("br", null))); } }]); return LobbyLoginForm; }(React.Component); _defineProperty(LobbyLoginForm, "propTypes", { playerName: PropTypes.string, onEnter: PropTypes.func.isRequired }); _defineProperty(LobbyLoginForm, "defaultProps", { playerName: '' }); var LobbyRoomInstance = /*#__PURE__*/ function (_React$Component) { _inherits(LobbyRoomInstance, _React$Component); function LobbyRoomInstance() { var _getPrototypeOf2; var _this; _classCallCheck(this, LobbyRoomInstance); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(LobbyRoomInstance)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_this), "_createSeat", function (player) { return player.name || '[free]'; }); _defineProperty(_assertThisInitialized(_this), "_createButtonJoin", function (inst, seatId) { return React.createElement("button", { key: 'button-join-' + inst.gameID, onClick: function onClick() { return _this.props.onClickJoin(inst.gameName, inst.gameID, '' + seatId); } }, "Join"); }); _defineProperty(_assertThisInitialized(_this), "_createButtonLeave", function (inst) { return React.createElement("button", { key: 'button-leave-' + inst.gameID, onClick: function onClick() { return _this.props.onClickLeave(inst.gameName, inst.gameID); } }, "Leave"); }); _defineProperty(_assertThisInitialized(_this), "_createButtonPlay", function (inst, seatId) { return React.createElement("button", { key: 'button-play-' + inst.gameID, onClick: function onClick() { return _this.props.onClickPlay(inst.gameName, { gameID: inst.gameID, playerID: '' + seatId, numPlayers: inst.players.length }); } }, "Play"); }); _defineProperty(_assertThisInitialized(_this), "_createButtonSpectate", function (inst) { return React.createElement("button", { key: 'button-spectate-' + inst.gameID, onClick: function onClick() { return _this.props.onClickPlay(inst.gameName, { gameID: inst.gameID, numPlayers: inst.players.length }); } }, "Spectate"); }); _defineProperty(_assertThisInitialized(_this), "_createInstanceButtons", function (inst) { var playerSeat = inst.players.find(function (player) { return player.name === _this.props.playerName; }); var freeSeat = inst.players.find(function (player) { return !player.name; }); if (playerSeat && freeSeat) { // already seated: waiting for game to start return _this._createButtonLeave(inst); } if (freeSeat) { // at least 1 seat is available return _this._createButtonJoin(inst, freeSeat.id); } // room is full if (playerSeat) { return React.createElement("div", null, [_this._createButtonPlay(inst, playerSeat.id), _this._createButtonLeave(inst)]); } // allow spectating return _this._createButtonSpectate(inst); }); return _this; } _createClass(LobbyRoomInstance, [{ key: "render", value: function render() { var room = this.props.room; var status = 'OPEN'; if (!room.players.find(function (player) { return !player.name; })) { status = 'RUNNING'; } return React.createElement("tr", { key: 'line-' + room.gameID }, React.createElement("td", { key: 'cell-name-' + room.gameID }, room.gameName), React.createElement("td", { key: 'cell-status-' + room.gameID }, status), React.createElement("td", { key: 'cell-seats-' + room.gameID }, room.players.map(this._createSeat).join(', ')), React.createElement("td", { key: 'cell-buttons-' + room.gameID }, this._createInstanceButtons(room))); } }]); return LobbyRoomInstance; }(React.Component); _defineProperty(LobbyRoomInstance, "propTypes", { room: PropTypes.shape({ gameName: PropTypes.string.isRequired, gameID: PropTypes.string.isRequired, players: PropTypes.array.isRequired }), playerName: PropTypes.string.isRequired, onClickJoin: PropTypes.func.isRequired, onClickLeave: PropTypes.func.isRequired, onClickPlay: PropTypes.func.isRequired }); var LobbyCreateRoomForm = /*#__PURE__*/ function (_React$Component) { _inherits(LobbyCreateRoomForm, _React$Component); function LobbyCreateRoomForm(props) { var _this; _classCallCheck(this, LobbyCreateRoomForm); _this = _possibleConstructorReturn(this, _getPrototypeOf(LobbyCreateRoomForm).call(this, props)); /* fix min and max number of players */ _defineProperty(_assertThisInitialized(_this), "state", { selectedGame: 0, numPlayers: 2 }); _defineProperty(_assertThisInitialized(_this), "_createGameNameOption", function (game, idx) { return React.createElement("option", { key: 'name-option-' + idx, value: idx }, game.game.name); }); _defineProperty(_assertThisInitialized(_this), "_createNumPlayersOption", function (idx) { return React.createElement("option", { key: 'num-option-' + idx, value: idx }, idx); }); _defineProperty(_assertThisInitialized(_this), "_createNumPlayersRange", function (game) { return _toConsumableArray(new Array(game.maxPlayers + 1).keys()).slice(game.minPlayers); }); _defineProperty(_assertThisInitialized(_this), "onChangeNumPlayers", function (event) { _this.setState({ numPlayers: Number.parseInt(event.target.value) }); }); _defineProperty(_assertThisInitialized(_this), "onChangeSelectedGame", function (event) { var idx = Number.parseInt(event.target.value); _this.setState({ selectedGame: idx, numPlayers: _this.props.games[idx].game.minPlayers }); }); _defineProperty(_assertThisInitialized(_this), "onClickCreate", function () { _this.props.createGame(_this.props.games[_this.state.selectedGame].game.name, _this.state.numPlayers); }); var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = props.games[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var game = _step.value; var game_details = game.game; if (!game_details.minPlayers) { game_details.minPlayers = 1; } if (!game_details.maxPlayers) { game_details.maxPlayers = 4; } console.assert(game_details.maxPlayers >= game_details.minPlayers); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator["return"] != null) { _iterator["return"](); } } finally { if (_didIteratorError) { throw _iteratorError; } } } _this.state = { selectedGame: 0, numPlayers: props.games[0].game.minPlayers }; return _this; } _createClass(LobbyCreateRoomForm, [{ key: "render", value: function render() { var _this2 = this; return React.createElement("div", null, React.createElement("select", { value: this.state.selectedGame, onChange: function onChange(evt) { return _this2.onChangeSelectedGame(evt); } }, this.props.games.map(this._createGameNameOption)), React.createElement("span", null, "Players:"), React.createElement("select", { value: this.state.numPlayers, onChange: this.onChangeNumPlayers }, this._createNumPlayersRange(this.props.games[this.state.selectedGame].game).map(this._createNumPlayersOption)), React.createElement("span", { className: "buttons" }, React.createElement("button", { onClick: this.onClickCreate }, "Create"))); } }]); return LobbyCreateRoomForm; }(React.Component); _defineProperty(LobbyCreateRoomForm, "propTypes", { games: PropTypes.array.isRequired, createGame: PropTypes.func.isRequired }); var LobbyPhases = { ENTER: 'enter', PLAY: 'play', LIST: 'list' }; /** * Lobby * * React lobby component. * * @param {Array} gameComponents - An array of Board and Game objects for the supported games. * @param {string} lobbyServer - Address of the lobby server (for example 'localhost:8000'). * If not set, defaults to the server that served the page. * @param {string} gameServer - Address of the game server (for example 'localhost:8001'). * If not set, defaults to the server that served the page. * @param {function} clientFactory - Function that is used to create the game clients. * @param {number} refreshInterval - Interval between server updates (default: 2000ms). * @param {bool} debug - Enable debug information (default: false). * * Returns: * A React component that provides a UI to create, list, join, leave, play or spectate game instances. */ var Lobby = /*#__PURE__*/ function (_React$Component) { _inherits(Lobby, _React$Component); function Lobby(_props) { var _this; _classCallCheck(this, Lobby); _this = _possibleConstructorReturn(this, _getPrototypeOf(Lobby).call(this, _props)); _defineProperty(_assertThisInitialized(_this), "state", { phase: LobbyPhases.ENTER, playerName: 'Visitor', runningGame: null, errorMsg: '', credentialStore: {} }); _defineProperty(_assertThisInitialized(_this), "_createConnection", function (props) { var name = _this.state.playerName; _this.connection = LobbyConnection({ server: props.lobbyServer, gameComponents: props.gameComponents, playerName: name, playerCredentials: _this.state.credentialStore[name] }); }); _defineProperty(_assertThisInitialized(_this), "_updateCredentials", function (playerName, credentials) { _this.setState(function (prevState) { // clone store or componentDidUpdate will not be triggered var store = Object.assign({}, prevState.credentialStore); store[[playerName]] = credentials; return { credentialStore: store }; }); }); _defineProperty(_assertThisInitialized(_this), "_updateConnection", async function () { await _this.connection.refresh(); _this.forceUpdate(); }); _defineProperty(_assertThisInitialized(_this), "_enterLobby", function (playerName) { _this.setState({ playerName: playerName, phase: LobbyPhases.LIST }); }); _defineProperty(_assertThisInitialized(_this), "_exitLobby", async function () { await _this.connection.disconnect(); _this.setState({ phase: LobbyPhases.ENTER, errorMsg: '' }); }); _defineProperty(_assertThisInitialized(_this), "_createRoom", async function (gameName, numPlayers) { try { await _this.connection.create(gameName, numPlayers); await _this.connection.refresh(); // rerender _this.setState({}); } catch (error) { _this.setState({ errorMsg: error.message }); } }); _defineProperty(_assertThisInitialized(_this), "_joinRoom", async function (gameName, gameID, playerID) { try { await _this.connection.join(gameName, gameID, playerID); await _this.connection.refresh(); _this._updateCredentials(_this.connection.playerName, _this.connection.playerCredentials); } catch (error) { _this.setState({ errorMsg: error.message }); } }); _defineProperty(_assertThisInitialized(_this), "_leaveRoom", async function (gameName, gameID) { try { await _this.connection.leave(gameName, gameID); await _this.connection.refresh(); _this._updateCredentials(_this.connection.playerName, _this.connection.playerCredentials); } catch (error) { _this.setState({ errorMsg: error.message }); } }); _defineProperty(_assertThisInitialized(_this), "_startGame", function (gameName, gameOpts) { var gameCode = _this.connection._getGameComponents(gameName); if (!gameCode) { _this.setState({ errorMsg: 'game ' + gameName + ' not supported' }); return; } var multiplayer = undefined; if (gameOpts.numPlayers > 1) { if (_this.props.gameServer) { multiplayer = SocketIO({ server: _this.props.gameServer }); } else { multiplayer = SocketIO(); } } if (gameOpts.numPlayers == 1) { var maxPlayers = gameCode.game.maxPlayers; var bots = {}; for (var i = 1; i < maxPlayers; i++) { bots[i + ''] = MCTSBot; } multiplayer = Local({ bots: bots }); } var app = _this.props.clientFactory({ game: gameCode.game, board: gameCode.board, debug: _this.props.debug, multiplayer: multiplayer }); var game = { app: app, gameID: gameOpts.gameID, playerID: gameOpts.numPlayers > 1 ? gameOpts.playerID : '0', credentials: _this.connection.playerCredentials }; _this.setState({ phase: LobbyPhases.PLAY, runningGame: game }); }); _defineProperty(_assertThisInitialized(_this), "_exitRoom", function () { _this.setState({ phase: LobbyPhases.LIST, runningGame: null }); }); _defineProperty(_assertThisInitialized(_this), "_getPhaseVisibility", function (phase) { return _this.state.phase !== phase ? 'hidden' : 'phase'; }); _defineProperty(_assertThisInitialized(_this), "renderRooms", function (rooms, playerName) { return rooms.map(function (room) { var gameID = room.gameID, gameName = room.gameName, players = room.players; return React.createElement(LobbyRoomInstance, { key: 'instance-' + gameID, room: { gameID: gameID, gameName: gameName, players: Object.values(players) }, playerName: playerName, onClickJoin: _this._joinRoom, onClickLeave: _this._leaveRoom, onClickPlay: _this._startGame }); }); }); _this._createConnection(_this.props); setInterval(_this._updateConnection, _this.props.refreshInterval); return _this; } _createClass(Lobby, [{ key: "componentDidMount", value: function componentDidMount() { var cookie = Cookies.load('lobbyState') || {}; if (cookie.phase && cookie.phase === LobbyPhases.PLAY) { cookie.phase = LobbyPhases.LIST; } this.setState({ phase: cookie.phase || LobbyPhases.ENTER, playerName: cookie.playerName || 'Visitor', credentialStore: cookie.credentialStore || {} }); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps, prevState) { var name = this.state.playerName; var creds = this.state.credentialStore[name]; if (prevState.phase !== this.state.phase || prevState.credentialStore[name] !== creds || prevState.playerName !== name) { this._createConnection(this.props); this._updateConnection(); var cookie = { phase: this.state.phase, playerName: name, credentialStore: this.state.credentialStore }; Cookies.save('lobbyState', cookie, { path: '/' }); } } }, { key: "render", value: function render() { var _this$props = this.props, gameComponents = _this$props.gameComponents, renderer = _this$props.renderer; var _this$state = this.state, errorMsg = _this$state.errorMsg, playerName = _this$state.playerName, phase = _this$state.phase, runningGame = _this$state.runningGame; if (renderer) { return renderer({ errorMsg: errorMsg, gameComponents: gameComponents, rooms: this.connection.rooms, phase: phase, playerName: playerName, runningGame: runningGame, handleEnterLobby: this._enterLobby, handleExitLobby: this._exitLobby, handleCreateRoom: this._createRoom, handleJoinRoom: this._joinRoom, handleLeaveRoom: this._leaveRoom, handleExitRoom: this._exitRoom, handleRefreshRooms: this._updateConnection, handleStartGame: this._startGame }); } return React.createElement("div", { id: "lobby-view", style: { padding: 50 } }, React.createElement("div", { className: this._getPhaseVisibility(LobbyPhases.ENTER) }, React.createElement(LobbyLoginForm, { key: playerName, playerName: playerName, onEnter: this._enterLobby })), React.createElement("div", { className: this._getPhaseVisibility(LobbyPhases.LIST) }, React.createElement("p", null, "Welcome, ", playerName), React.createElement("div", { className: "phase-title", id: "game-creation" }, React.createElement("span", null, "Create a room:"), React.createElement(LobbyCreateRoomForm, { games: gameComponents, createGame: this._createRoom })), React.createElement("p", { className: "phase-title" }, "Join a room:"), React.createElement("div", { id: "instances" }, React.createElement("table", null, React.createElement("tbody", null, this.renderRooms(this.connection.rooms, playerName))), React.createElement("span", { className: "error-msg" }, errorMsg, React.createElement("br", null))), React.createElement("p", { className: "phase-title" }, "Rooms that become empty are automatically deleted.")), React.createElement("div", { className: this._getPhaseVisibility(LobbyPhases.PLAY) }, runningGame && React.createElement(runningGame.app, { gameID: runningGame.gameID, playerID: runningGame.playerID, credentials: runningGame.credentials }), React.createElement("div", { className: "buttons", id: "game-exit" }, React.createElement("button", { onClick: this._exitRoom }, "Exit game"))), React.createElement("div", { className: "buttons", id: "lobby-exit" }, React.createElement("button", { onClick: this._exitLobby }, "Exit lobby"))); } }]); return Lobby; }(React.Component); _defineProperty(Lobby, "propTypes", { gameComponents: PropTypes.array.isRequired, lobbyServer: PropTypes.string, gameServer: PropTypes.string, debug: PropTypes.bool, clientFactory: PropTypes.func, refreshInterval: PropTypes.number }); _defineProperty(Lobby, "defaultProps", { debug: false, clientFactory: Client, refreshInterval: 2000 }); export { Client, Lobby };
ajax/libs/primereact/7.0.1/splitbutton/splitbutton.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; import { Button } from 'primereact/button'; import { classNames, ObjectUtils, ZIndexUtils, DomHandler, ConnectedOverlayScrollHandler, UniqueComponentId } from 'primereact/utils'; import { CSSTransition } from 'primereact/csstransition'; import { Portal } from 'primereact/portal'; import { tip } from 'primereact/tooltip'; import { OverlayService } from 'primereact/overlayservice'; import PrimeReact from 'primereact/api'; 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); return Constructor; } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); } 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); } 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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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; } function _createSuper$2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); 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 _isNativeReflectConstruct$2() { 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; } } var SplitButtonItem = /*#__PURE__*/function (_Component) { _inherits(SplitButtonItem, _Component); var _super = _createSuper$2(SplitButtonItem); function SplitButtonItem(props) { var _this; _classCallCheck(this, SplitButtonItem); _this = _super.call(this, props); _this.onClick = _this.onClick.bind(_assertThisInitialized(_this)); return _this; } _createClass(SplitButtonItem, [{ key: "onClick", value: function onClick(e) { if (this.props.menuitem.command) { this.props.menuitem.command({ originalEvent: e, item: this.props.menuitem }); } if (this.props.onItemClick) { this.props.onItemClick(e); } e.preventDefault(); } }, { key: "renderSeparator", value: function renderSeparator() { return /*#__PURE__*/React.createElement("li", { className: "p-menu-separator", role: "separator" }); } }, { key: "renderMenuitem", value: function renderMenuitem() { var _this2 = this; var _this$props$menuitem = this.props.menuitem, disabled = _this$props$menuitem.disabled, icon = _this$props$menuitem.icon, label = _this$props$menuitem.label, template = _this$props$menuitem.template, url = _this$props$menuitem.url, target = _this$props$menuitem.target; var className = classNames('p-menuitem-link', { 'p-disabled': disabled }); var iconClassName = classNames('p-menuitem-icon', icon); icon = icon && /*#__PURE__*/React.createElement("span", { className: iconClassName }); label = label && /*#__PURE__*/React.createElement("span", { className: "p-menuitem-text" }, label); var content = /*#__PURE__*/React.createElement("a", { href: url || '#', role: "menuitem", className: className, target: target, onClick: this.onClick }, icon, label); if (template) { var defaultContentOptions = { onClick: function onClick(event) { return _this2.onClick(event); }, className: className, labelClassName: 'p-menuitem-text', iconClassName: iconClassName, element: content, props: this.props }; content = ObjectUtils.getJSXElement(template, this.props.menuitem, defaultContentOptions); } return /*#__PURE__*/React.createElement("li", { className: "p-menuitem", role: "none" }, content); } }, { key: "renderItem", value: function renderItem() { if (this.props.menuitem.separator) { return this.renderSeparator(); } return this.renderMenuitem(); } }, { key: "render", value: function render() { var item = this.renderItem(); return item; } }]); return SplitButtonItem; }(Component); _defineProperty(SplitButtonItem, "defaultProps", { menuitem: null, onItemClick: null }); function _extends() { _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; }; return _extends.apply(this, arguments); } function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); 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 _isNativeReflectConstruct$1() { 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; } } var SplitButtonPanelComponent = /*#__PURE__*/function (_Component) { _inherits(SplitButtonPanelComponent, _Component); var _super = _createSuper$1(SplitButtonPanelComponent); function SplitButtonPanelComponent() { _classCallCheck(this, SplitButtonPanelComponent); return _super.apply(this, arguments); } _createClass(SplitButtonPanelComponent, [{ key: "renderElement", value: function renderElement() { var className = classNames('p-menu p-menu-overlay p-component', this.props.menuClassName); return /*#__PURE__*/React.createElement(CSSTransition, { nodeRef: this.props.forwardRef, classNames: "p-connected-overlay", in: this.props.in, timeout: { enter: 120, exit: 100 }, options: this.props.transitionOptions, unmountOnExit: true, onEnter: this.props.onEnter, onEntered: this.props.onEntered, onExit: this.props.onExit, onExited: this.props.onExited }, /*#__PURE__*/React.createElement("div", { ref: this.props.forwardRef, className: className, style: this.props.menuStyle, id: this.props.id, onClick: this.onClick }, /*#__PURE__*/React.createElement("ul", { className: "p-menu-list p-reset", role: "menu" }, this.props.children))); } }, { key: "render", value: function render() { var element = this.renderElement(); return /*#__PURE__*/React.createElement(Portal, { element: element, appendTo: this.props.appendTo }); } }]); return SplitButtonPanelComponent; }(Component); _defineProperty(SplitButtonPanelComponent, "defaultProps", { appendTo: null, menuStyle: null, menuClassName: null, id: null, onClick: null }); var SplitButtonPanel = /*#__PURE__*/React.forwardRef(function (props, ref) { return /*#__PURE__*/React.createElement(SplitButtonPanelComponent, _extends({ forwardRef: ref }, props)); }); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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 _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; } } var SplitButton = /*#__PURE__*/function (_Component) { _inherits(SplitButton, _Component); var _super = _createSuper(SplitButton); function SplitButton(props) { var _this; _classCallCheck(this, SplitButton); _this = _super.call(this, props); _this.state = { id: props.id, overlayVisible: false }; _this.onDropdownButtonClick = _this.onDropdownButtonClick.bind(_assertThisInitialized(_this)); _this.onItemClick = _this.onItemClick.bind(_assertThisInitialized(_this)); _this.onOverlayEnter = _this.onOverlayEnter.bind(_assertThisInitialized(_this)); _this.onOverlayEntered = _this.onOverlayEntered.bind(_assertThisInitialized(_this)); _this.onOverlayExit = _this.onOverlayExit.bind(_assertThisInitialized(_this)); _this.onOverlayExited = _this.onOverlayExited.bind(_assertThisInitialized(_this)); _this.onPanelClick = _this.onPanelClick.bind(_assertThisInitialized(_this)); _this.overlayRef = /*#__PURE__*/React.createRef(); return _this; } _createClass(SplitButton, [{ key: "onPanelClick", value: function onPanelClick(event) { OverlayService.emit('overlay-click', { originalEvent: event, target: this.container }); } }, { key: "onDropdownButtonClick", value: function onDropdownButtonClick() { if (this.state.overlayVisible) this.hide();else this.show(); } }, { key: "onItemClick", value: function onItemClick() { this.hide(); } }, { key: "show", value: function show() { this.setState({ overlayVisible: true }); } }, { key: "hide", value: function hide() { this.setState({ overlayVisible: false }); } }, { key: "onOverlayEnter", value: function onOverlayEnter() { ZIndexUtils.set('overlay', this.overlayRef.current, PrimeReact.autoZIndex, PrimeReact.zIndex['overlay']); this.alignOverlay(); } }, { key: "onOverlayEntered", value: function onOverlayEntered() { this.bindDocumentClickListener(); this.bindScrollListener(); this.bindResizeListener(); this.props.onShow && this.props.onShow(); } }, { key: "onOverlayExit", value: function onOverlayExit() { this.unbindDocumentClickListener(); this.unbindScrollListener(); this.unbindResizeListener(); } }, { key: "onOverlayExited", value: function onOverlayExited() { ZIndexUtils.clear(this.overlayRef.current); this.props.onHide && this.props.onHide(); } }, { key: "alignOverlay", value: function alignOverlay() { DomHandler.alignOverlay(this.overlayRef.current, this.defaultButton.parentElement, this.props.appendTo || PrimeReact.appendTo); } }, { key: "bindDocumentClickListener", value: function bindDocumentClickListener() { var _this2 = this; if (!this.documentClickListener) { this.documentClickListener = function (event) { if (_this2.state.overlayVisible && _this2.isOutsideClicked(event)) { _this2.hide(); } }; document.addEventListener('click', this.documentClickListener); } } }, { key: "bindScrollListener", value: function bindScrollListener() { var _this3 = this; if (!this.scrollHandler) { this.scrollHandler = new ConnectedOverlayScrollHandler(this.container, function () { if (_this3.state.overlayVisible) { _this3.hide(); } }); } this.scrollHandler.bindScrollListener(); } }, { key: "unbindScrollListener", value: function unbindScrollListener() { if (this.scrollHandler) { this.scrollHandler.unbindScrollListener(); } } }, { key: "bindResizeListener", value: function bindResizeListener() { var _this4 = this; if (!this.resizeListener) { this.resizeListener = function () { if (_this4.state.overlayVisible && !DomHandler.isAndroid()) { _this4.hide(); } }; window.addEventListener('resize', this.resizeListener); } } }, { key: "unbindResizeListener", value: function unbindResizeListener() { if (this.resizeListener) { window.removeEventListener('resize', this.resizeListener); this.resizeListener = null; } } }, { key: "isOutsideClicked", value: function isOutsideClicked(event) { return this.container && this.overlayRef && this.overlayRef.current && !this.overlayRef.current.contains(event.target); } }, { key: "unbindDocumentClickListener", value: function unbindDocumentClickListener() { if (this.documentClickListener) { document.removeEventListener('click', this.documentClickListener); this.documentClickListener = null; } } }, { key: "componentDidMount", value: function componentDidMount() { if (!this.state.id) { this.setState({ id: UniqueComponentId() }); } if (this.props.tooltip) { this.renderTooltip(); } } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (prevProps.tooltip !== this.props.tooltip || prevProps.tooltipOptions !== this.props.tooltipOptions) { if (this.tooltip) this.tooltip.update(_objectSpread({ content: this.props.tooltip }, this.props.tooltipOptions || {}));else this.renderTooltip(); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.unbindDocumentClickListener(); this.unbindResizeListener(); if (this.scrollHandler) { this.scrollHandler.destroy(); this.scrollHandler = null; } if (this.tooltip) { this.tooltip.destroy(); this.tooltip = null; } ZIndexUtils.clear(this.overlayRef.current); } }, { key: "renderTooltip", value: function renderTooltip() { this.tooltip = tip({ target: this.container, content: this.props.tooltip, options: this.props.tooltipOptions }); } }, { key: "renderItems", value: function renderItems() { var _this5 = this; if (this.props.model) { return this.props.model.map(function (menuitem, index) { return /*#__PURE__*/React.createElement(SplitButtonItem, { menuitem: menuitem, key: index, onItemClick: _this5.onItemClick }); }); } return null; } }, { key: "render", value: function render() { var _this6 = this; var className = classNames('p-splitbutton p-component', this.props.className, { 'p-disabled': this.props.disabled }); var items = this.renderItems(); var buttonContent = this.props.buttonTemplate ? ObjectUtils.getJSXElement(this.props.buttonTemplate, this.props) : null; return /*#__PURE__*/React.createElement("div", { id: this.state.id, className: className, style: this.props.style, ref: function ref(el) { return _this6.container = el; } }, /*#__PURE__*/React.createElement(Button, { ref: function ref(el) { return _this6.defaultButton = el; }, type: "button", className: "p-splitbutton-defaultbutton", icon: this.props.icon, label: this.props.label, onClick: this.props.onClick, disabled: this.props.disabled, tabIndex: this.props.tabIndex }, buttonContent), /*#__PURE__*/React.createElement(Button, { type: "button", className: "p-splitbutton-menubutton", icon: this.props.dropdownIcon, onClick: this.onDropdownButtonClick, disabled: this.props.disabled, "aria-expanded": this.state.overlayVisible, "aria-haspopup": true, "aria-owns": this.state.id + '_overlay' }), /*#__PURE__*/React.createElement(SplitButtonPanel, { ref: this.overlayRef, appendTo: this.props.appendTo, id: this.state.id + '_overlay', menuStyle: this.props.menuStyle, menuClassName: this.props.menuClassName, onClick: this.onPanelClick, in: this.state.overlayVisible, onEnter: this.onOverlayEnter, onEntered: this.onOverlayEntered, onExit: this.onOverlayExit, onExited: this.onOverlayExited, transitionOptions: this.props.transitionOptions }, items)); } }]); return SplitButton; }(Component); _defineProperty(SplitButton, "defaultProps", { id: null, label: null, icon: null, model: null, disabled: null, style: null, className: null, menuStyle: null, menuClassName: null, tabIndex: null, appendTo: null, tooltip: null, tooltipOptions: null, buttonTemplate: null, transitionOptions: null, dropdownIcon: 'pi pi-chevron-down', onClick: null, onShow: null, onHide: null }); export { SplitButton };
ajax/libs/react-native-web/0.0.0-51f9ab73e/exports/YellowBox/index.js
cdnjs/cdnjs
/** * Copyright (c) Nicolas Gallagher. * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ import React from 'react'; import UnimplementedView from '../../modules/UnimplementedView'; function YellowBox(props) { return ( /*#__PURE__*/ React.createElement(UnimplementedView, props) ); } YellowBox.ignoreWarnings = function () {}; export default YellowBox;
ajax/libs/react-native-web/0.13.2/exports/KeyboardAvoidingView/index.js
cdnjs/cdnjs
function _extends() { _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; }; return _extends.apply(this, arguments); } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } /** * Copyright (c) Nicolas Gallagher. * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ import View from '../View'; import React from 'react'; var KeyboardAvoidingView = /*#__PURE__*/ function (_React$Component) { _inheritsLoose(KeyboardAvoidingView, _React$Component); function KeyboardAvoidingView() { var _this; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; _this.frame = null; _this.onLayout = function (event) { _this.frame = event.nativeEvent.layout; }; return _this; } var _proto = KeyboardAvoidingView.prototype; _proto.relativeKeyboardHeight = function relativeKeyboardHeight(keyboardFrame) { var frame = this.frame; if (!frame || !keyboardFrame) { return 0; } var keyboardY = keyboardFrame.screenY - (this.props.keyboardVerticalOffset || 0); return Math.max(frame.y + frame.height - keyboardY, 0); }; _proto.onKeyboardChange = function onKeyboardChange(event) {}; _proto.render = function render() { var _this$props = this.props, behavior = _this$props.behavior, contentContainerStyle = _this$props.contentContainerStyle, keyboardVerticalOffset = _this$props.keyboardVerticalOffset, rest = _objectWithoutPropertiesLoose(_this$props, ["behavior", "contentContainerStyle", "keyboardVerticalOffset"]); return React.createElement(View, _extends({ onLayout: this.onLayout }, rest)); }; return KeyboardAvoidingView; }(React.Component); export default KeyboardAvoidingView;
ajax/libs/react-native-web/0.15.6/exports/ScrollView/index.js
cdnjs/cdnjs
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { 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; } function _extends() { _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; }; return _extends.apply(this, arguments); } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } /** * Copyright (c) Nicolas Gallagher. * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ import createReactClass from 'create-react-class'; import dismissKeyboard from '../../modules/dismissKeyboard'; import invariant from 'fbjs/lib/invariant'; import mergeRefs from '../../modules/mergeRefs'; import ScrollResponder from '../../modules/ScrollResponder'; import ScrollViewBase from './ScrollViewBase'; import StyleSheet from '../StyleSheet'; import View from '../View'; import React from 'react'; var emptyObject = {}; /* eslint-disable react/prefer-es6-class */ var ScrollView = createReactClass({ displayName: "ScrollView", mixins: [ScrollResponder.Mixin], getInitialState: function getInitialState() { return this.scrollResponderMixinGetInitialState(); }, flashScrollIndicators: function flashScrollIndicators() { this.scrollResponderFlashScrollIndicators(); }, /** * Returns a reference to the underlying scroll responder, which supports * operations like `scrollTo`. All ScrollView-like components should * implement this method so that they can be composed while providing access * to the underlying scroll responder's methods. */ getScrollResponder: function getScrollResponder() { return this; }, getScrollableNode: function getScrollableNode() { return this._scrollNodeRef; }, getInnerViewRef: function getInnerViewRef() { return this._innerViewRef; }, getInnerViewNode: function getInnerViewNode() { return this._innerViewRef; }, getNativeScrollRef: function getNativeScrollRef() { return this._scrollNodeRef; }, /** * Scrolls to a given x, y offset, either immediately or with a smooth animation. * Syntax: * * scrollTo(options: {x: number = 0; y: number = 0; animated: boolean = true}) * * Note: The weird argument signature is due to the fact that, for historical reasons, * the function also accepts separate arguments as as alternative to the options object. * This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED. */ scrollTo: function scrollTo(y, x, animated) { if (typeof y === 'number') { console.warn('`scrollTo(y, x, animated)` is deprecated. Use `scrollTo({x: 5, y: 5, animated: true})` instead.'); } else { var _ref = y || emptyObject; x = _ref.x; y = _ref.y; animated = _ref.animated; } this.getScrollResponder().scrollResponderScrollTo({ x: x || 0, y: y || 0, animated: animated !== false }); }, /** * If this is a vertical ScrollView scrolls to the bottom. * If this is a horizontal ScrollView scrolls to the right. * * Use `scrollToEnd({ animated: true })` for smooth animated scrolling, * `scrollToEnd({ animated: false })` for immediate scrolling. * If no options are passed, `animated` defaults to true. */ scrollToEnd: function scrollToEnd(options) { // Default to true var animated = (options && options.animated) !== false; var horizontal = this.props.horizontal; var scrollResponder = this.getScrollResponder(); var scrollResponderNode = scrollResponder.scrollResponderGetScrollableNode(); var x = horizontal ? scrollResponderNode.scrollWidth : 0; var y = horizontal ? 0 : scrollResponderNode.scrollHeight; scrollResponder.scrollResponderScrollTo({ x: x, y: y, animated: animated }); }, render: function render() { var _this$props = this.props, contentContainerStyle = _this$props.contentContainerStyle, horizontal = _this$props.horizontal, onContentSizeChange = _this$props.onContentSizeChange, refreshControl = _this$props.refreshControl, stickyHeaderIndices = _this$props.stickyHeaderIndices, pagingEnabled = _this$props.pagingEnabled, forwardedRef = _this$props.forwardedRef, keyboardDismissMode = _this$props.keyboardDismissMode, onScroll = _this$props.onScroll, other = _objectWithoutPropertiesLoose(_this$props, ["contentContainerStyle", "horizontal", "onContentSizeChange", "refreshControl", "stickyHeaderIndices", "pagingEnabled", "forwardedRef", "keyboardDismissMode", "onScroll"]); if (process.env.NODE_ENV !== 'production' && this.props.style) { var style = StyleSheet.flatten(this.props.style); var childLayoutProps = ['alignItems', 'justifyContent'].filter(function (prop) { return style && style[prop] !== undefined; }); invariant(childLayoutProps.length === 0, "ScrollView child layout (" + JSON.stringify(childLayoutProps) + ") " + 'must be applied through the contentContainerStyle prop.'); } var contentSizeChangeProps = {}; if (onContentSizeChange) { contentSizeChangeProps = { onLayout: this._handleContentOnLayout }; } var hasStickyHeaderIndices = !horizontal && Array.isArray(stickyHeaderIndices); var children = hasStickyHeaderIndices || pagingEnabled ? React.Children.map(this.props.children, function (child, i) { var isSticky = hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1; if (child != null && (isSticky || pagingEnabled)) { return ( /*#__PURE__*/ React.createElement(View, { style: StyleSheet.compose(isSticky && styles.stickyHeader, pagingEnabled && styles.pagingEnabledChild) }, child) ); } else { return child; } }) : this.props.children; var contentContainer = /*#__PURE__*/ React.createElement(View, _extends({}, contentSizeChangeProps, { children: children, collapsable: false, ref: this._setInnerViewRef, style: StyleSheet.compose(horizontal && styles.contentContainerHorizontal, contentContainerStyle) })); var baseStyle = horizontal ? styles.baseHorizontal : styles.baseVertical; var pagingEnabledStyle = horizontal ? styles.pagingEnabledHorizontal : styles.pagingEnabledVertical; var props = _objectSpread(_objectSpread({}, other), {}, { style: [baseStyle, pagingEnabled && pagingEnabledStyle, this.props.style], onTouchStart: this.scrollResponderHandleTouchStart, onTouchMove: this.scrollResponderHandleTouchMove, onTouchEnd: this.scrollResponderHandleTouchEnd, onScrollBeginDrag: this.scrollResponderHandleScrollBeginDrag, onScrollEndDrag: this.scrollResponderHandleScrollEndDrag, onMomentumScrollBegin: this.scrollResponderHandleMomentumScrollBegin, onMomentumScrollEnd: this.scrollResponderHandleMomentumScrollEnd, onStartShouldSetResponder: this.scrollResponderHandleStartShouldSetResponder, onStartShouldSetResponderCapture: this.scrollResponderHandleStartShouldSetResponderCapture, onScrollShouldSetResponder: this.scrollResponderHandleScrollShouldSetResponder, onScroll: this._handleScroll, onResponderGrant: this.scrollResponderHandleResponderGrant, onResponderTerminationRequest: this.scrollResponderHandleTerminationRequest, onResponderTerminate: this.scrollResponderHandleTerminate, onResponderRelease: this.scrollResponderHandleResponderRelease, onResponderReject: this.scrollResponderHandleResponderReject }); var ScrollViewClass = ScrollViewBase; invariant(ScrollViewClass !== undefined, 'ScrollViewClass must not be undefined'); if (refreshControl) { return ( /*#__PURE__*/ React.cloneElement(refreshControl, { style: props.style }, /*#__PURE__*/ React.createElement(ScrollViewClass, _extends({}, props, { ref: this._setScrollNodeRef, style: baseStyle }), contentContainer)) ); } return ( /*#__PURE__*/ React.createElement(ScrollViewClass, _extends({}, props, { ref: this._setScrollNodeRef }), contentContainer) ); }, _handleContentOnLayout: function _handleContentOnLayout(e) { var _e$nativeEvent$layout = e.nativeEvent.layout, width = _e$nativeEvent$layout.width, height = _e$nativeEvent$layout.height; this.props.onContentSizeChange(width, height); }, _handleScroll: function _handleScroll(e) { if (process.env.NODE_ENV !== 'production') { if (this.props.onScroll && this.props.scrollEventThrottle == null) { console.log('You specified `onScroll` on a <ScrollView> but not ' + '`scrollEventThrottle`. You will only receive one event. ' + 'Using `16` you get all the events but be aware that it may ' + "cause frame drops, use a bigger number if you don't need as " + 'much precision.'); } } if (this.props.keyboardDismissMode === 'on-drag') { dismissKeyboard(); } this.scrollResponderHandleScroll(e); }, _setInnerViewRef: function _setInnerViewRef(node) { this._innerViewRef = node; }, _setScrollNodeRef: function _setScrollNodeRef(node) { this._scrollNodeRef = node; // ScrollView needs to add more methods to the hostNode in addition to those // added by `usePlatformMethods`. This is temporarily until an API like // `ScrollView.scrollTo(hostNode, { x, y })` is added to React Native. if (node != null) { node.getScrollResponder = this.getScrollResponder; node.getInnerViewNode = this.getInnerViewNode; node.getInnerViewRef = this.getInnerViewRef; node.getNativeScrollRef = this.getNativeScrollRef; node.getScrollableNode = this.getScrollableNode; node.scrollTo = this.scrollTo; node.scrollToEnd = this.scrollToEnd; node.flashScrollIndicators = this.flashScrollIndicators; node.scrollResponderZoomTo = this.scrollResponderZoomTo; node.scrollResponderScrollNativeHandleToKeyboard = this.scrollResponderScrollNativeHandleToKeyboard; } var ref = mergeRefs(this.props.forwardedRef); ref(node); } }); var commonStyle = { flexGrow: 1, flexShrink: 1, // Enable hardware compositing in modern browsers. // Creates a new layer with its own backing surface that can significantly // improve scroll performance. transform: [{ translateZ: 0 }], // iOS native scrolling WebkitOverflowScrolling: 'touch' }; var styles = StyleSheet.create({ baseVertical: _objectSpread(_objectSpread({}, commonStyle), {}, { flexDirection: 'column', overflowX: 'hidden', overflowY: 'auto' }), baseHorizontal: _objectSpread(_objectSpread({}, commonStyle), {}, { flexDirection: 'row', overflowX: 'auto', overflowY: 'hidden' }), contentContainerHorizontal: { flexDirection: 'row' }, stickyHeader: { position: 'sticky', top: 0, zIndex: 10 }, pagingEnabledHorizontal: { scrollSnapType: 'x mandatory' }, pagingEnabledVertical: { scrollSnapType: 'y mandatory' }, pagingEnabledChild: { scrollSnapAlign: 'start' } }); var ForwardedScrollView = /*#__PURE__*/ React.forwardRef(function (props, forwardedRef) { return ( /*#__PURE__*/ React.createElement(ScrollView, _extends({}, props, { forwardedRef: forwardedRef })) ); }); ForwardedScrollView.displayName = 'ScrollView'; export default ForwardedScrollView;
ajax/libs/react-native-web/0.13.9/vendor/react-native/Animated/createAnimatedComponent.js
cdnjs/cdnjs
/** * Copyright (c) 2015-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. * * * @format */ 'use strict'; function _extends() { _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; }; return _extends.apply(this, arguments); } function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } import { AnimatedEvent } from './AnimatedEvent'; import AnimatedProps from './nodes/AnimatedProps'; import React from 'react'; import invariant from 'fbjs/lib/invariant'; import setAndForwardRef from '../../../modules/setAndForwardRef'; function createAnimatedComponent(Component, defaultProps) { invariant(typeof Component !== 'function' || Component.prototype && Component.prototype.isReactComponent, '`createAnimatedComponent` does not support stateless functional components; ' + 'use a class component instead.'); var AnimatedComponent = /*#__PURE__*/ function (_React$Component) { _inheritsLoose(AnimatedComponent, _React$Component); function AnimatedComponent(props) { var _this; _this = _React$Component.call(this, props) || this; _this._invokeAnimatedPropsCallbackOnMount = false; _this._eventDetachers = []; _this._animatedPropsCallback = function () { if (_this._component == null) { // AnimatedProps is created in will-mount because it's used in render. // But this callback may be invoked before mount in async mode, // In which case we should defer the setNativeProps() call. // React may throw away uncommitted work in async mode, // So a deferred call won't always be invoked. _this._invokeAnimatedPropsCallbackOnMount = true; } else if (AnimatedComponent.__skipSetNativeProps_FOR_TESTS_ONLY || typeof _this._component.setNativeProps !== 'function') { _this.forceUpdate(); } else if (!_this._propsAnimated.__isNative) { _this._component.setNativeProps(_this._propsAnimated.__getAnimatedValue()); } else { throw new Error('Attempting to run JS driven animation on animated ' + 'node that has been moved to "native" earlier by starting an ' + 'animation with `useNativeDriver: true`'); } }; _this._setComponentRef = setAndForwardRef({ getForwardedRef: function getForwardedRef() { return _this.props.forwardedRef; }, setLocalRef: function setLocalRef(ref) { _this._prevComponent = _this._component; _this._component = ref; // TODO: Delete this in a future release. if (ref != null && ref.getNode == null) { ref.getNode = function () { var _ref$constructor$name; console.warn('%s: Calling `getNode()` on the ref of an Animated component ' + 'is no longer necessary. You can now directly use the ref ' + 'instead. This method will be removed in a future release.', (_ref$constructor$name = ref.constructor.name) !== null && _ref$constructor$name !== void 0 ? _ref$constructor$name : '<<anonymous>>'); return ref; }; } } }); return _this; } var _proto = AnimatedComponent.prototype; _proto.componentWillUnmount = function componentWillUnmount() { this._propsAnimated && this._propsAnimated.__detach(); this._detachNativeEvents(); }; _proto.UNSAFE_componentWillMount = function UNSAFE_componentWillMount() { this._attachProps(this.props); }; _proto.componentDidMount = function componentDidMount() { if (this._invokeAnimatedPropsCallbackOnMount) { this._invokeAnimatedPropsCallbackOnMount = false; this._animatedPropsCallback(); } this._propsAnimated.setNativeView(this._component); this._attachNativeEvents(); }; _proto._attachNativeEvents = function _attachNativeEvents() { var _this2 = this; // Make sure to get the scrollable node for components that implement // `ScrollResponder.Mixin`. var scrollableNode = this._component && this._component.getScrollableNode ? this._component.getScrollableNode() : this._component; var _loop = function _loop(key) { var prop = _this2.props[key]; if (prop instanceof AnimatedEvent && prop.__isNative) { prop.__attach(scrollableNode, key); _this2._eventDetachers.push(function () { return prop.__detach(scrollableNode, key); }); } }; for (var key in this.props) { _loop(key); } }; _proto._detachNativeEvents = function _detachNativeEvents() { this._eventDetachers.forEach(function (remove) { return remove(); }); this._eventDetachers = []; } // The system is best designed when setNativeProps is implemented. It is // able to avoid re-rendering and directly set the attributes that changed. // However, setNativeProps can only be implemented on leaf native // components. If you want to animate a composite component, you need to // re-render it. In this case, we have a fallback that uses forceUpdate. ; _proto._attachProps = function _attachProps(nextProps) { var oldPropsAnimated = this._propsAnimated; this._propsAnimated = new AnimatedProps(nextProps, this._animatedPropsCallback); // When you call detach, it removes the element from the parent list // of children. If it goes to 0, then the parent also detaches itself // and so on. // An optimization is to attach the new elements and THEN detach the old // ones instead of detaching and THEN attaching. // This way the intermediate state isn't to go to 0 and trigger // this expensive recursive detaching to then re-attach everything on // the very next operation. oldPropsAnimated && oldPropsAnimated.__detach(); }; _proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(newProps) { this._attachProps(newProps); }; _proto.componentDidUpdate = function componentDidUpdate(prevProps) { if (this._component !== this._prevComponent) { this._propsAnimated.setNativeView(this._component); } if (this._component !== this._prevComponent || prevProps !== this.props) { this._detachNativeEvents(); this._attachNativeEvents(); } }; _proto.render = function render() { var props = this._propsAnimated.__getValue(); return React.createElement(Component, _extends({}, defaultProps, props, { ref: this._setComponentRef // The native driver updates views directly through the UI thread so we // have to make sure the view doesn't get optimized away because it cannot // go through the NativeViewHierarchyManager since it operates on the shadow // thread. , collapsable: false })); }; return AnimatedComponent; }(React.Component); AnimatedComponent.__skipSetNativeProps_FOR_TESTS_ONLY = false; var propTypes = Component.propTypes; return React.forwardRef(function AnimatedComponentWrapper(props, ref) { return React.createElement(AnimatedComponent, _extends({}, props, ref == null ? null : { forwardedRef: ref })); }); } export default createAnimatedComponent;
ajax/libs/material-ui/4.9.3/esm/Grid/Grid.js
cdnjs/cdnjs
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; import _extends from "@babel/runtime/helpers/esm/extends"; // A grid component using the following libs as inspiration. // // For the implementation: // - https://getbootstrap.com/docs/4.3/layout/grid/ // - https://github.com/kristoferjoseph/flexboxgrid/blob/master/src/css/flexboxgrid.css // - https://github.com/roylee0704/react-flexbox-grid // - https://material.angularjs.org/latest/layout/introduction // // Follow this flexbox Guide to better understand the underlying model: // - https://css-tricks.com/snippets/css/a-guide-to-flexbox/ import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import withStyles from '../styles/withStyles'; import requirePropFactory from '../utils/requirePropFactory'; var SPACINGS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; var GRID_SIZES = ['auto', true, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; function generateGrid(globalStyles, theme, breakpoint) { var styles = {}; GRID_SIZES.forEach(function (size) { var key = "grid-".concat(breakpoint, "-").concat(size); if (size === true) { // For the auto layouting styles[key] = { flexBasis: 0, flexGrow: 1, maxWidth: '100%' }; return; } if (size === 'auto') { styles[key] = { flexBasis: 'auto', flexGrow: 0, maxWidth: 'none' }; return; } // Keep 7 significant numbers. var width = "".concat(Math.round(size / 12 * 10e7) / 10e5, "%"); // Close to the bootstrap implementation: // https://github.com/twbs/bootstrap/blob/8fccaa2439e97ec72a4b7dc42ccc1f649790adb0/scss/mixins/_grid.scss#L41 styles[key] = { flexBasis: width, flexGrow: 0, maxWidth: width }; }); // No need for a media query for the first size. if (breakpoint === 'xs') { _extends(globalStyles, styles); } else { globalStyles[theme.breakpoints.up(breakpoint)] = styles; } } function getOffset(val) { var div = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; var parse = parseFloat(val); return "".concat(parse / div).concat(String(val).replace(String(parse), '') || 'px'); } function generateGutter(theme, breakpoint) { var styles = {}; SPACINGS.forEach(function (spacing) { var themeSpacing = theme.spacing(spacing); if (themeSpacing === 0) { return; } styles["spacing-".concat(breakpoint, "-").concat(spacing)] = { margin: "-".concat(getOffset(themeSpacing, 2)), width: "calc(100% + ".concat(getOffset(themeSpacing), ")"), '& > $item': { padding: getOffset(themeSpacing, 2) } }; }); return styles; } // Default CSS values // flex: '0 1 auto', // flexDirection: 'row', // alignItems: 'flex-start', // flexWrap: 'nowrap', // justifyContent: 'flex-start', export var styles = function styles(theme) { return _extends({ /* Styles applied to the root element */ root: {}, /* Styles applied to the root element if `container={true}`. */ container: { boxSizing: 'border-box', display: 'flex', flexWrap: 'wrap', width: '100%' }, /* Styles applied to the root element if `item={true}`. */ item: { boxSizing: 'border-box', margin: '0' // For instance, it's useful when used with a `figure` element. }, /* Styles applied to the root element if `zeroMinWidth={true}`. */ zeroMinWidth: { minWidth: 0 }, /* Styles applied to the root element if `direction="column"`. */ 'direction-xs-column': { flexDirection: 'column' }, /* Styles applied to the root element if `direction="column-reverse"`. */ 'direction-xs-column-reverse': { flexDirection: 'column-reverse' }, /* Styles applied to the root element if `direction="rwo-reverse"`. */ 'direction-xs-row-reverse': { flexDirection: 'row-reverse' }, /* Styles applied to the root element if `wrap="nowrap"`. */ 'wrap-xs-nowrap': { flexWrap: 'nowrap' }, /* Styles applied to the root element if `wrap="reverse"`. */ 'wrap-xs-wrap-reverse': { flexWrap: 'wrap-reverse' }, /* Styles applied to the root element if `alignItems="center"`. */ 'align-items-xs-center': { alignItems: 'center' }, /* Styles applied to the root element if `alignItems="flex-start"`. */ 'align-items-xs-flex-start': { alignItems: 'flex-start' }, /* Styles applied to the root element if `alignItems="flex-end"`. */ 'align-items-xs-flex-end': { alignItems: 'flex-end' }, /* Styles applied to the root element if `alignItems="baseline"`. */ 'align-items-xs-baseline': { alignItems: 'baseline' }, /* Styles applied to the root element if `alignContent="center"`. */ 'align-content-xs-center': { alignContent: 'center' }, /* Styles applied to the root element if `alignContent="flex-start"`. */ 'align-content-xs-flex-start': { alignContent: 'flex-start' }, /* Styles applied to the root element if `alignContent="flex-end"`. */ 'align-content-xs-flex-end': { alignContent: 'flex-end' }, /* Styles applied to the root element if `alignContent="space-between"`. */ 'align-content-xs-space-between': { alignContent: 'space-between' }, /* Styles applied to the root element if `alignContent="space-around"`. */ 'align-content-xs-space-around': { alignContent: 'space-around' }, /* Styles applied to the root element if `justify="center"`. */ 'justify-xs-center': { justifyContent: 'center' }, /* Styles applied to the root element if `justify="flex-end"`. */ 'justify-xs-flex-end': { justifyContent: 'flex-end' }, /* Styles applied to the root element if `justify="space-between"`. */ 'justify-xs-space-between': { justifyContent: 'space-between' }, /* Styles applied to the root element if `justify="space-around"`. */ 'justify-xs-space-around': { justifyContent: 'space-around' }, /* Styles applied to the root element if `justify="space-evenly"`. */ 'justify-xs-space-evenly': { justifyContent: 'space-evenly' } }, generateGutter(theme, 'xs'), {}, theme.breakpoints.keys.reduce(function (accumulator, key) { // Use side effect over immutability for better performance. generateGrid(accumulator, theme, key); return accumulator; }, {})); }; var Grid = React.forwardRef(function Grid(props, ref) { var _props$alignContent = props.alignContent, alignContent = _props$alignContent === void 0 ? 'stretch' : _props$alignContent, _props$alignItems = props.alignItems, alignItems = _props$alignItems === void 0 ? 'stretch' : _props$alignItems, classes = props.classes, classNameProp = props.className, _props$component = props.component, Component = _props$component === void 0 ? 'div' : _props$component, _props$container = props.container, container = _props$container === void 0 ? false : _props$container, _props$direction = props.direction, direction = _props$direction === void 0 ? 'row' : _props$direction, _props$item = props.item, item = _props$item === void 0 ? false : _props$item, _props$justify = props.justify, justify = _props$justify === void 0 ? 'flex-start' : _props$justify, _props$lg = props.lg, lg = _props$lg === void 0 ? false : _props$lg, _props$md = props.md, md = _props$md === void 0 ? false : _props$md, _props$sm = props.sm, sm = _props$sm === void 0 ? false : _props$sm, _props$spacing = props.spacing, spacing = _props$spacing === void 0 ? 0 : _props$spacing, _props$wrap = props.wrap, wrap = _props$wrap === void 0 ? 'wrap' : _props$wrap, _props$xl = props.xl, xl = _props$xl === void 0 ? false : _props$xl, _props$xs = props.xs, xs = _props$xs === void 0 ? false : _props$xs, _props$zeroMinWidth = props.zeroMinWidth, zeroMinWidth = _props$zeroMinWidth === void 0 ? false : _props$zeroMinWidth, other = _objectWithoutProperties(props, ["alignContent", "alignItems", "classes", "className", "component", "container", "direction", "item", "justify", "lg", "md", "sm", "spacing", "wrap", "xl", "xs", "zeroMinWidth"]); var className = clsx(classes.root, classNameProp, container && [classes.container, spacing !== 0 && classes["spacing-xs-".concat(String(spacing))]], item && classes.item, zeroMinWidth && classes.zeroMinWidth, direction !== 'row' && classes["direction-xs-".concat(String(direction))], wrap !== 'wrap' && classes["wrap-xs-".concat(String(wrap))], alignItems !== 'stretch' && classes["align-items-xs-".concat(String(alignItems))], alignContent !== 'stretch' && classes["align-content-xs-".concat(String(alignContent))], justify !== 'flex-start' && classes["justify-xs-".concat(String(justify))], xs !== false && classes["grid-xs-".concat(String(xs))], sm !== false && classes["grid-sm-".concat(String(sm))], md !== false && classes["grid-md-".concat(String(md))], lg !== false && classes["grid-lg-".concat(String(lg))], xl !== false && classes["grid-xl-".concat(String(xl))]); return React.createElement(Component, _extends({ className: className, ref: ref }, other)); }); process.env.NODE_ENV !== "production" ? Grid.propTypes = { /** * Defines the `align-content` style property. * It's applied for all screen sizes. */ alignContent: PropTypes.oneOf(['stretch', 'center', 'flex-start', 'flex-end', 'space-between', 'space-around']), /** * Defines the `align-items` style property. * It's applied for all screen sizes. */ alignItems: PropTypes.oneOf(['flex-start', 'center', 'flex-end', 'stretch', 'baseline']), /** * The content of the component. */ children: PropTypes.node, /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * @ignore */ className: PropTypes.string, /** * The component used for the root node. * Either a string to use a DOM element or a component. */ component: PropTypes.elementType, /** * If `true`, the component will have the flex *container* behavior. * You should be wrapping *items* with a *container*. */ container: PropTypes.bool, /** * Defines the `flex-direction` style property. * It is applied for all screen sizes. */ direction: PropTypes.oneOf(['row', 'row-reverse', 'column', 'column-reverse']), /** * If `true`, the component will have the flex *item* behavior. * You should be wrapping *items* with a *container*. */ item: PropTypes.bool, /** * Defines the `justify-content` style property. * It is applied for all screen sizes. */ justify: PropTypes.oneOf(['flex-start', 'center', 'flex-end', 'space-between', 'space-around', 'space-evenly']), /** * Defines the number of grids the component is going to use. * It's applied for the `lg` breakpoint and wider screens if not overridden. */ lg: PropTypes.oneOf([false, 'auto', true, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]), /** * Defines the number of grids the component is going to use. * It's applied for the `md` breakpoint and wider screens if not overridden. */ md: PropTypes.oneOf([false, 'auto', true, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]), /** * Defines the number of grids the component is going to use. * It's applied for the `sm` breakpoint and wider screens if not overridden. */ sm: PropTypes.oneOf([false, 'auto', true, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]), /** * Defines the space between the type `item` component. * It can only be used on a type `container` component. */ spacing: PropTypes.oneOf(SPACINGS), /** * Defines the `flex-wrap` style property. * It's applied for all screen sizes. */ wrap: PropTypes.oneOf(['nowrap', 'wrap', 'wrap-reverse']), /** * Defines the number of grids the component is going to use. * It's applied for the `xl` breakpoint and wider screens. */ xl: PropTypes.oneOf([false, 'auto', true, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]), /** * Defines the number of grids the component is going to use. * It's applied for all the screen sizes with the lowest priority. */ xs: PropTypes.oneOf([false, 'auto', true, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]), /** * If `true`, it sets `min-width: 0` on the item. * Refer to the limitations section of the documentation to better understand the use case. */ zeroMinWidth: PropTypes.bool } : void 0; var StyledGrid = withStyles(styles, { name: 'MuiGrid' })(Grid); if (process.env.NODE_ENV !== 'production') { var requireProp = requirePropFactory('Grid'); StyledGrid.propTypes = _extends({}, StyledGrid.propTypes, { alignContent: requireProp('container'), alignItems: requireProp('container'), direction: requireProp('container'), justify: requireProp('container'), lg: requireProp('item'), md: requireProp('item'), sm: requireProp('item'), spacing: requireProp('container'), wrap: requireProp('container'), xs: requireProp('item'), zeroMinWidth: requireProp('item') }); } export default StyledGrid;
ajax/libs/material-ui/4.9.3/es/RadioGroup/RadioGroup.js
cdnjs/cdnjs
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; import React from 'react'; import PropTypes from 'prop-types'; import FormGroup from '../FormGroup'; import useForkRef from '../utils/useForkRef'; import useControlled from '../utils/useControlled'; import RadioGroupContext from './RadioGroupContext'; const RadioGroup = React.forwardRef(function RadioGroup(props, ref) { const { actions, children, name, value: valueProp, onChange } = props, other = _objectWithoutPropertiesLoose(props, ["actions", "children", "name", "value", "onChange"]); const rootRef = React.useRef(null); const [value, setValue] = useControlled({ controlled: valueProp, default: props.defaultValue, name: 'RadioGroup' }); React.useImperativeHandle(actions, () => ({ focus: () => { let input = rootRef.current.querySelector('input:not(:disabled):checked'); if (!input) { input = rootRef.current.querySelector('input:not(:disabled)'); } if (input) { input.focus(); } } }), []); const handleRef = useForkRef(ref, rootRef); const handleChange = event => { setValue(event.target.value); if (onChange) { onChange(event, event.target.value); } }; return React.createElement(RadioGroupContext.Provider, { value: { name, onChange: handleChange, value } }, React.createElement(FormGroup, _extends({ role: "radiogroup", ref: handleRef }, other), children)); }); process.env.NODE_ENV !== "production" ? RadioGroup.propTypes = { /** * @ignore */ actions: PropTypes.shape({ current: PropTypes.object }), /** * The content of the component. */ children: PropTypes.node, /** * The default `input` element value. Use when the component is not controlled. */ defaultValue: PropTypes.any, /** * The name used to reference the value of the control. */ name: PropTypes.string, /** * @ignore */ onBlur: PropTypes.func, /** * Callback fired when a radio button is selected. * * @param {object} event The event source of the callback. * You can pull out the new value by accessing `event.target.value` (string). */ onChange: PropTypes.func, /** * @ignore */ onKeyDown: PropTypes.func, /** * Value of the selected radio button. The DOM API casts this to a string. */ value: PropTypes.any } : void 0; export default RadioGroup;
ajax/libs/material-ui/4.9.3/es/Table/Table.js
cdnjs/cdnjs
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; import _extends from "@babel/runtime/helpers/esm/extends"; import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import withStyles from '../styles/withStyles'; import TableContext from './TableContext'; export const styles = theme => ({ /* Styles applied to the root element. */ root: { display: 'table', width: '100%', borderCollapse: 'collapse', borderSpacing: 0, '& caption': _extends({}, theme.typography.body2, { padding: theme.spacing(2), color: theme.palette.text.secondary, textAlign: 'left', captionSide: 'bottom' }) }, /* Styles applied to the root element if `stickyHeader={true}`. */ stickyHeader: { borderCollapse: 'separate' } }); const Table = React.forwardRef(function Table(props, ref) { const { classes, className, component: Component = 'table', padding = 'default', size = 'medium', stickyHeader = false } = props, other = _objectWithoutPropertiesLoose(props, ["classes", "className", "component", "padding", "size", "stickyHeader"]); const table = React.useMemo(() => ({ padding, size, stickyHeader }), [padding, size, stickyHeader]); return React.createElement(TableContext.Provider, { value: table }, React.createElement(Component, _extends({ ref: ref, className: clsx(classes.root, className, stickyHeader && classes.stickyHeader) }, other))); }); process.env.NODE_ENV !== "production" ? Table.propTypes = { /** * The content of the table, normally `TableHead` and `TableBody`. */ children: PropTypes.node.isRequired, /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * @ignore */ className: PropTypes.string, /** * The component used for the root node. * Either a string to use a DOM element or a component. */ component: PropTypes.elementType, /** * Allows TableCells to inherit padding of the Table. */ padding: PropTypes.oneOf(['default', 'checkbox', 'none']), /** * Allows TableCells to inherit size of the Table. */ size: PropTypes.oneOf(['small', 'medium']), /** * Set the header sticky. * * ⚠️ It doesn't work with IE 11. */ stickyHeader: PropTypes.bool } : void 0; export default withStyles(styles, { name: 'MuiTable' })(Table);
ajax/libs/primereact/6.5.0/galleria/galleria.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; import { classNames, Ripple, UniqueComponentId, DomHandler, ZIndexUtils, CSSTransition, Portal } from 'primereact/core'; 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); return Constructor; } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); } 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); } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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; } function _extends() { _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; }; return _extends.apply(this, arguments); } function _createSuper$2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); 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 _isNativeReflectConstruct$2() { 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; } } var GalleriaItemComponent = /*#__PURE__*/function (_Component) { _inherits(GalleriaItemComponent, _Component); var _super = _createSuper$2(GalleriaItemComponent); function GalleriaItemComponent(props) { var _this; _classCallCheck(this, GalleriaItemComponent); _this = _super.call(this, props); _this.navForward = _this.navForward.bind(_assertThisInitialized(_this)); _this.navBackward = _this.navBackward.bind(_assertThisInitialized(_this)); _this.next = _this.next.bind(_assertThisInitialized(_this)); _this.prev = _this.prev.bind(_assertThisInitialized(_this)); return _this; } _createClass(GalleriaItemComponent, [{ key: "step", value: function step(index) { if (this.itemsContainer) { this.itemsContainer.style.transform = this.isVertical() ? "translate3d(0, ".concat(index * 100, "%, 0)") : "translate3d(".concat(index * 100, "%, 0, 0)"); this.itemsContainer.style.transition = 'transform 500ms ease 0s'; } } }, { key: "next", value: function next() { var nextItemIndex = this.props.activeItemIndex + 1; this.props.onActiveItemChange({ index: this.props.circular && this.props.value.length - 1 === this.props.activeItemIndex ? 0 : nextItemIndex }); } }, { key: "prev", value: function prev() { var prevItemIndex = this.props.activeItemIndex !== 0 ? this.props.activeItemIndex - 1 : 0; this.props.onActiveItemChange({ index: this.props.circular && this.props.activeItemIndex === 0 ? this.props.value.length - 1 : prevItemIndex }); } }, { key: "stopSlideShow", value: function stopSlideShow() { if (this.props.slideShowActive && this.props.stopSlideShow) { this.props.stopSlideShow(); } } }, { key: "navBackward", value: function navBackward(e) { this.stopSlideShow(); this.prev(); if (e && e.cancelable) { e.preventDefault(); } } }, { key: "navForward", value: function navForward(e) { this.stopSlideShow(); this.next(); if (e && e.cancelable) { e.preventDefault(); } } }, { key: "onIndicatorClick", value: function onIndicatorClick(index) { this.stopSlideShow(); this.props.onActiveItemChange({ index: index }); } }, { key: "onIndicatorMouseEnter", value: function onIndicatorMouseEnter(index) { if (this.props.changeItemOnIndicatorHover) { this.stopSlideShow(); this.props.onActiveItemChange({ index: index }); } } }, { key: "onIndicatorKeyDown", value: function onIndicatorKeyDown(event, index) { if (event.which === 13) { this.stopSlideShow(); this.props.onActiveItemChange({ index: index }); } } }, { key: "componentDidMount", value: function componentDidMount() { if (this.props.autoPlay) { this.props.startSlideShow(); } } }, { key: "renderBackwardNavigator", value: function renderBackwardNavigator() { if (this.props.showItemNavigators) { var isDisabled = !this.props.circular && this.props.activeItemIndex === 0; var buttonClassName = classNames('p-galleria-item-prev p-galleria-item-nav p-link', { 'p-disabled': isDisabled }); return /*#__PURE__*/React.createElement("button", { type: "button", className: buttonClassName, onClick: this.navBackward, disabled: isDisabled }, /*#__PURE__*/React.createElement("span", { className: "p-galleria-item-prev-icon pi pi-chevron-left" }), /*#__PURE__*/React.createElement(Ripple, null)); } return null; } }, { key: "renderForwardNavigator", value: function renderForwardNavigator() { if (this.props.showItemNavigators) { var isDisabled = !this.props.circular && this.props.activeItemIndex === this.props.value.length - 1; var buttonClassName = classNames('p-galleria-item-next p-galleria-item-nav p-link', { 'p-disabled': isDisabled }); return /*#__PURE__*/React.createElement("button", { type: "button", className: buttonClassName, onClick: this.navForward, disabled: isDisabled }, /*#__PURE__*/React.createElement("span", { className: "p-galleria-item-next-icon pi pi-chevron-right" }), /*#__PURE__*/React.createElement(Ripple, null)); } return null; } }, { key: "renderCaption", value: function renderCaption() { if (this.props.caption) { var content = this.props.caption(this.props.value[this.props.activeItemIndex]); return /*#__PURE__*/React.createElement("div", { className: "p-galleria-caption" }, content); } return null; } }, { key: "renderIndicator", value: function renderIndicator(index) { var _this2 = this; var indicator = this.props.indicator && this.props.indicator(index); var isActive = this.props.activeItemIndex === index; var indicatorItemClassName = classNames('p-galleria-indicator', { 'p-highlight': isActive }); if (!indicator) { indicator = /*#__PURE__*/React.createElement("button", { type: "button", tabIndex: -1, className: "p-link" }, /*#__PURE__*/React.createElement(Ripple, null)); } return /*#__PURE__*/React.createElement("li", { className: indicatorItemClassName, key: 'p-galleria-indicator-' + index, tabIndex: 0, onClick: function onClick() { return _this2.onIndicatorClick(index); }, onMouseEnter: function onMouseEnter() { return _this2.onIndicatorMouseEnter(index); }, onKeyDown: function onKeyDown(e) { return _this2.onIndicatorKeyDown(e, index); } }, indicator); } }, { key: "renderIndicators", value: function renderIndicators() { if (this.props.showIndicators) { var indicatorsContentClassName = classNames('p-galleria-indicators p-reset', this.props.indicatorsContentClassName); var indicators = []; for (var i = 0; i < this.props.value.length; i++) { indicators.push(this.renderIndicator(i)); } return /*#__PURE__*/React.createElement("ul", { className: indicatorsContentClassName }, indicators); } return null; } }, { key: "render", value: function render() { var _this3 = this; var content = this.props.itemTemplate && this.props.itemTemplate(this.props.value[this.props.activeItemIndex]); var backwardNavigator = this.renderBackwardNavigator(); var forwardNavigator = this.renderForwardNavigator(); var caption = this.renderCaption(); var indicators = this.renderIndicators(); return /*#__PURE__*/React.createElement("div", { ref: function ref(el) { return _this3.props.forwardRef(el); }, className: "p-galleria-item-wrapper" }, /*#__PURE__*/React.createElement("div", { className: "p-galleria-item-container" }, backwardNavigator, /*#__PURE__*/React.createElement("div", { className: "p-galleria-item" }, content), forwardNavigator, caption), indicators); } }]); return GalleriaItemComponent; }(Component); var GalleriaItem = /*#__PURE__*/React.forwardRef(function (props, ref) { return /*#__PURE__*/React.createElement(GalleriaItemComponent, _extends({ forwardRef: ref }, props)); }); 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 _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } 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 _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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); 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 _isNativeReflectConstruct$1() { 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; } } var GalleriaThumbnailItem = /*#__PURE__*/function (_Component) { _inherits(GalleriaThumbnailItem, _Component); var _super = _createSuper$1(GalleriaThumbnailItem); function GalleriaThumbnailItem(props) { var _this; _classCallCheck(this, GalleriaThumbnailItem); _this = _super.call(this, props); _this.onItemClick = _this.onItemClick.bind(_assertThisInitialized(_this)); _this.onItemKeyDown = _this.onItemKeyDown.bind(_assertThisInitialized(_this)); return _this; } _createClass(GalleriaThumbnailItem, [{ key: "onItemClick", value: function onItemClick(event) { this.props.onItemClick({ originalEvent: event, index: this.props.index }); } }, { key: "onItemKeyDown", value: function onItemKeyDown(event) { if (event.which === 13) { this.props.onItemClick({ originalEvent: event, index: this.props.index }); } } }, { key: "render", value: function render() { var content = this.props.template && this.props.template(this.props.item); var itemClassName = classNames(this.props.className, 'p-galleria-thumbnail-item', { 'p-galleria-thumbnail-item-current': this.props.current, 'p-galleria-thumbnail-item-active': this.props.active, 'p-galleria-thumbnail-item-start': this.props.start, 'p-galleria-thumbnail-item-end': this.props.end }); return /*#__PURE__*/React.createElement("div", { className: itemClassName }, /*#__PURE__*/React.createElement("div", { className: "p-galleria-thumbnail-item-content", tabIndex: this.props.active ? 0 : null, onClick: this.onItemClick, onKeyDown: this.onItemKeyDown }, content)); } }]); return GalleriaThumbnailItem; }(Component); _defineProperty(GalleriaThumbnailItem, "defaultProps", { index: null, template: null, item: null, current: false, active: false, start: false, end: false, className: null, onItemClick: null }); var GalleriaThumbnails = /*#__PURE__*/function (_Component2) { _inherits(GalleriaThumbnails, _Component2); var _super2 = _createSuper$1(GalleriaThumbnails); function GalleriaThumbnails(props) { var _this2; _classCallCheck(this, GalleriaThumbnails); _this2 = _super2.call(this, props); _this2.state = { numVisible: props.numVisible, totalShiftedItems: 0, page: 0 }; _this2.navForward = _this2.navForward.bind(_assertThisInitialized(_this2)); _this2.navBackward = _this2.navBackward.bind(_assertThisInitialized(_this2)); _this2.onTransitionEnd = _this2.onTransitionEnd.bind(_assertThisInitialized(_this2)); _this2.onTouchStart = _this2.onTouchStart.bind(_assertThisInitialized(_this2)); _this2.onTouchMove = _this2.onTouchMove.bind(_assertThisInitialized(_this2)); _this2.onTouchEnd = _this2.onTouchEnd.bind(_assertThisInitialized(_this2)); _this2.onItemClick = _this2.onItemClick.bind(_assertThisInitialized(_this2)); _this2.attributeSelector = UniqueComponentId(); return _this2; } _createClass(GalleriaThumbnails, [{ key: "step", value: function step(dir) { var totalShiftedItems = this.state.totalShiftedItems + dir; if (dir < 0 && -1 * totalShiftedItems + this.state.numVisible > this.props.value.length - 1) { totalShiftedItems = this.state.numVisible - this.props.value.length; } else if (dir > 0 && totalShiftedItems > 0) { totalShiftedItems = 0; } if (this.props.circular) { if (dir < 0 && this.props.value.length - 1 === this.props.activeItemIndex) { totalShiftedItems = 0; } else if (dir > 0 && this.props.activeItemIndex === 0) { totalShiftedItems = this.state.numVisible - this.props.value.length; } } if (this.itemsContainer) { DomHandler.removeClass(this.itemsContainer, 'p-items-hidden'); this.itemsContainer.style.transform = this.props.isVertical ? "translate3d(0, ".concat(totalShiftedItems * (100 / this.state.numVisible), "%, 0)") : "translate3d(".concat(totalShiftedItems * (100 / this.state.numVisible), "%, 0, 0)"); this.itemsContainer.style.transition = 'transform 500ms ease 0s'; } this.setState({ totalShiftedItems: totalShiftedItems }); } }, { key: "stopSlideShow", value: function stopSlideShow() { if (this.props.slideShowActive && this.props.stopSlideShow) { this.props.stopSlideShow(); } } }, { key: "getMedianItemIndex", value: function getMedianItemIndex() { var index = Math.floor(this.state.numVisible / 2); return this.state.numVisible % 2 ? index : index - 1; } }, { key: "navBackward", value: function navBackward(e) { this.stopSlideShow(); var prevItemIndex = this.props.activeItemIndex !== 0 ? this.props.activeItemIndex - 1 : 0; var diff = prevItemIndex + this.state.totalShiftedItems; if (this.state.numVisible - diff - 1 > this.getMedianItemIndex() && (-1 * this.state.totalShiftedItems !== 0 || this.props.circular)) { this.step(1); } this.props.onActiveItemChange({ index: this.props.circular && this.props.activeItemIndex === 0 ? this.props.value.length - 1 : prevItemIndex }); if (e.cancelable) { e.preventDefault(); } } }, { key: "navForward", value: function navForward(e) { this.stopSlideShow(); var nextItemIndex = this.props.activeItemIndex + 1; if (nextItemIndex + this.state.totalShiftedItems > this.getMedianItemIndex() && (-1 * this.state.totalShiftedItems < this.getTotalPageNumber() - 1 || this.props.circular)) { this.step(-1); } this.props.onActiveItemChange({ index: this.props.circular && this.props.value.length - 1 === this.props.activeItemIndex ? 0 : nextItemIndex }); if (e.cancelable) { e.preventDefault(); } } }, { key: "onItemClick", value: function onItemClick(event) { this.stopSlideShow(); var selectedItemIndex = event.index; if (selectedItemIndex !== this.props.activeItemIndex) { var diff = selectedItemIndex + this.state.totalShiftedItems; var dir = 0; if (selectedItemIndex < this.props.activeItemIndex) { dir = this.state.numVisible - diff - 1 - this.getMedianItemIndex(); if (dir > 0 && -1 * this.state.totalShiftedItems !== 0) { this.step(dir); } } else { dir = this.getMedianItemIndex() - diff; if (dir < 0 && -1 * this.state.totalShiftedItems < this.getTotalPageNumber() - 1) { this.step(dir); } } this.props.onActiveItemChange({ index: selectedItemIndex }); } } }, { key: "onTransitionEnd", value: function onTransitionEnd() { if (this.itemsContainer) { DomHandler.addClass(this.itemsContainer, 'p-items-hidden'); this.itemsContainer.style.transition = ''; } } }, { key: "onTouchStart", value: function onTouchStart(e) { var touchobj = e.changedTouches[0]; this.startPos = { x: touchobj.pageX, y: touchobj.pageY }; } }, { key: "onTouchMove", value: function onTouchMove(e) { if (e.cancelable) { e.preventDefault(); } } }, { key: "onTouchEnd", value: function onTouchEnd(e) { var touchobj = e.changedTouches[0]; if (this.props.isVertical) { this.changePageOnTouch(e, touchobj.pageY - this.startPos.y); } else { this.changePageOnTouch(e, touchobj.pageX - this.startPos.x); } } }, { key: "changePageOnTouch", value: function changePageOnTouch(e, diff) { if (diff < 0) { // left this.navForward(e); } else { // right this.navBackward(e); } } }, { key: "getTotalPageNumber", value: function getTotalPageNumber() { return this.props.value.length > this.state.numVisible ? this.props.value.length - this.state.numVisible + 1 : 0; } }, { key: "createStyle", value: function createStyle() { if (!this.thumbnailsStyle) { this.thumbnailsStyle = document.createElement('style'); document.body.appendChild(this.thumbnailsStyle); } var innerHTML = "\n .p-galleria-thumbnail-items[".concat(this.attributeSelector, "] .p-galleria-thumbnail-item {\n flex: 1 0 ").concat(100 / this.state.numVisible, "%\n }\n "); if (this.props.responsiveOptions) { this.responsiveOptions = _toConsumableArray(this.props.responsiveOptions); this.responsiveOptions.sort(function (data1, data2) { var value1 = data1.breakpoint; var value2 = data2.breakpoint; var result = null; if (value1 == null && value2 != null) result = -1;else if (value1 != null && value2 == null) result = 1;else if (value1 == null && value2 == null) result = 0;else if (typeof value1 === 'string' && typeof value2 === 'string') result = value1.localeCompare(value2, undefined, { numeric: true });else result = value1 < value2 ? -1 : value1 > value2 ? 1 : 0; return -1 * result; }); for (var i = 0; i < this.responsiveOptions.length; i++) { var res = this.responsiveOptions[i]; innerHTML += "\n @media screen and (max-width: ".concat(res.breakpoint, ") {\n .p-galleria-thumbnail-items[").concat(this.attributeSelector, "] .p-galleria-thumbnail-item {\n flex: 1 0 ").concat(100 / res.numVisible, "%\n }\n }\n "); } } this.thumbnailsStyle.innerHTML = innerHTML; } }, { key: "calculatePosition", value: function calculatePosition() { if (this.itemsContainer && this.responsiveOptions) { var windowWidth = window.innerWidth; var matchedResponsiveData = { numVisible: this.props.numVisible }; for (var i = 0; i < this.responsiveOptions.length; i++) { var res = this.responsiveOptions[i]; if (parseInt(res.breakpoint, 10) >= windowWidth) { matchedResponsiveData = res; } } if (this.state.numVisible !== matchedResponsiveData.numVisible) { this.setState({ numVisible: matchedResponsiveData.numVisible }); } } } }, { key: "bindDocumentListeners", value: function bindDocumentListeners() { var _this3 = this; if (!this.documentResizeListener) { this.documentResizeListener = function () { _this3.calculatePosition(); }; window.addEventListener('resize', this.documentResizeListener); } } }, { key: "unbindDocumentListeners", value: function unbindDocumentListeners() { if (this.documentResizeListener) { window.removeEventListener('resize', this.documentResizeListener); this.documentResizeListener = null; } } }, { key: "componentDidMount", value: function componentDidMount() { if (this.itemsContainer) { this.itemsContainer.setAttribute(this.attributeSelector, ''); } this.createStyle(); this.calculatePosition(); if (this.props.responsiveOptions) { this.bindDocumentListeners(); } } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps, prevState) { var totalShiftedItems = this.state.totalShiftedItems; if (prevState.numVisible !== this.state.numVisible || prevProps.activeItemIndex !== this.props.activeItemIndex) { if (this.props.activeItemIndex <= this.getMedianItemIndex()) { totalShiftedItems = 0; } else if (this.props.value.length - this.state.numVisible + this.getMedianItemIndex() < this.props.activeItemIndex) { totalShiftedItems = this.state.numVisible - this.props.value.length; } else if (this.props.value.length - this.state.numVisible < this.props.activeItemIndex && this.state.numVisible % 2 === 0) { totalShiftedItems = this.props.activeItemIndex * -1 + this.getMedianItemIndex() + 1; } else { totalShiftedItems = this.props.activeItemIndex * -1 + this.getMedianItemIndex(); } if (totalShiftedItems !== this.state.totalShiftedItems) { this.setState({ totalShiftedItems: totalShiftedItems }); } this.itemsContainer.style.transform = this.props.isVertical ? "translate3d(0, ".concat(totalShiftedItems * (100 / this.state.numVisible), "%, 0)") : "translate3d(".concat(totalShiftedItems * (100 / this.state.numVisible), "%, 0, 0)"); if (prevProps.activeItemIndex !== this.props.activeItemIndex) { DomHandler.removeClass(this.itemsContainer, 'p-items-hidden'); this.itemsContainer.style.transition = 'transform 500ms ease 0s'; } } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { if (this.props.responsiveOptions) { this.unbindDocumentListeners(); } } }, { key: "renderItems", value: function renderItems() { var _this4 = this; return this.props.value.map(function (item, index) { var firstIndex = _this4.state.totalShiftedItems * -1, lastIndex = firstIndex + _this4.state.numVisible - 1, isActive = firstIndex <= index && lastIndex >= index, start = firstIndex === index, end = lastIndex === index, current = _this4.props.activeItemIndex === index; return /*#__PURE__*/React.createElement(GalleriaThumbnailItem, { key: index, index: index, template: _this4.props.itemTemplate, item: item, active: isActive, start: start, end: end, onItemClick: _this4.onItemClick, current: current }); }); } }, { key: "renderBackwardNavigator", value: function renderBackwardNavigator() { if (this.props.showThumbnailNavigators) { var isDisabled = !this.props.circular && this.props.activeItemIndex === 0 || this.props.value.length <= this.state.numVisible; var buttonClassName = classNames('p-galleria-thumbnail-prev p-link', { 'p-disabled': isDisabled }), iconClassName = classNames('p-galleria-thumbnail-prev-icon pi', { 'pi-chevron-left': !this.props.isVertical, 'pi-chevron-up': this.props.isVertical }); return /*#__PURE__*/React.createElement("button", { className: buttonClassName, onClick: this.navBackward, disabled: isDisabled }, /*#__PURE__*/React.createElement("span", { className: iconClassName }), /*#__PURE__*/React.createElement(Ripple, null)); } return null; } }, { key: "renderForwardNavigator", value: function renderForwardNavigator() { if (this.props.showThumbnailNavigators) { var isDisabled = !this.props.circular && this.props.activeItemIndex === this.props.value.length - 1 || this.props.value.length <= this.state.numVisible; var buttonClassName = classNames('p-galleria-thumbnail-next p-link', { 'p-disabled': isDisabled }), iconClassName = classNames('p-galleria-thumbnail-next-icon pi', { 'pi-chevron-right': !this.props.isVertical, 'pi-chevron-down': this.props.isVertical }); return /*#__PURE__*/React.createElement("button", { className: buttonClassName, onClick: this.navForward, disabled: isDisabled }, /*#__PURE__*/React.createElement("span", { className: iconClassName }), /*#__PURE__*/React.createElement(Ripple, null)); } return null; } }, { key: "renderContent", value: function renderContent() { var _this5 = this; var items = this.renderItems(); var height = this.props.isVertical ? this.props.contentHeight : ''; var backwardNavigator = this.renderBackwardNavigator(); var forwardNavigator = this.renderForwardNavigator(); return /*#__PURE__*/React.createElement("div", { className: "p-galleria-thumbnail-container" }, backwardNavigator, /*#__PURE__*/React.createElement("div", { className: "p-galleria-thumbnail-items-container", style: { 'height': height } }, /*#__PURE__*/React.createElement("div", { ref: function ref(el) { return _this5.itemsContainer = el; }, className: "p-galleria-thumbnail-items", onTransitionEnd: this.onTransitionEnd, onTouchStart: this.onTouchStart, onTouchMove: this.onTouchMove, onTouchEnd: this.onTouchEnd }, items)), forwardNavigator); } }, { key: "render", value: function render() { var content = this.renderContent(); return /*#__PURE__*/React.createElement("div", { className: "p-galleria-thumbnail-wrapper" }, content); } }]); return GalleriaThumbnails; }(Component); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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 _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; } } var Galleria = /*#__PURE__*/function (_Component) { _inherits(Galleria, _Component); var _super = _createSuper(Galleria); function Galleria(props) { var _this; _classCallCheck(this, Galleria); _this = _super.call(this, props); _this.state = { visible: false, slideShowActive: false }; if (!_this.props.onItemChange) { _this.state = _objectSpread(_objectSpread({}, _this.state), {}, { activeIndex: props.activeIndex }); } _this.onActiveItemChange = _this.onActiveItemChange.bind(_assertThisInitialized(_this)); _this.show = _this.show.bind(_assertThisInitialized(_this)); _this.hide = _this.hide.bind(_assertThisInitialized(_this)); _this.startSlideShow = _this.startSlideShow.bind(_assertThisInitialized(_this)); _this.stopSlideShow = _this.stopSlideShow.bind(_assertThisInitialized(_this)); _this.onEnter = _this.onEnter.bind(_assertThisInitialized(_this)); _this.onEntering = _this.onEntering.bind(_assertThisInitialized(_this)); _this.onEntered = _this.onEntered.bind(_assertThisInitialized(_this)); _this.onExit = _this.onExit.bind(_assertThisInitialized(_this)); _this.onExited = _this.onExited.bind(_assertThisInitialized(_this)); _this.galleriaRef = /*#__PURE__*/React.createRef(); return _this; } _createClass(Galleria, [{ key: "activeItemIndex", get: function get() { return this.props.onItemChange ? this.props.activeIndex : this.state.activeIndex; } }, { key: "onActiveItemChange", value: function onActiveItemChange(event) { if (this.props.onItemChange) { this.props.onItemChange(event); } else { this.setState({ activeIndex: event.index }); } } }, { key: "show", value: function show() { this.setState({ visible: true }); } }, { key: "hide", value: function hide() { this.setState({ visible: false }); } }, { key: "onEnter", value: function onEnter() { DomHandler.addClass(document.body, 'p-overflow-hidden'); } }, { key: "onEntering", value: function onEntering() { ZIndexUtils.set('modal', this.mask, this.props.baseZIndex); DomHandler.addClass(this.mask, 'p-component-overlay'); } }, { key: "onEntered", value: function onEntered() { this.props.onShow && this.props.onShow(); } }, { key: "onExit", value: function onExit() { DomHandler.removeClass(document.body, 'p-overflow-hidden'); DomHandler.addClass(this.mask, 'p-galleria-mask-leave'); } }, { key: "onExited", value: function onExited() { ZIndexUtils.clear(this.mask); this.props.onHide && this.props.onHide(); } }, { key: "isAutoPlayActive", value: function isAutoPlayActive() { return this.state.slideShowActive; } }, { key: "startSlideShow", value: function startSlideShow() { var _this2 = this; this.interval = setInterval(function () { var activeIndex = _this2.props.circular && _this2.props.value.length - 1 === _this2.activeItemIndex ? 0 : _this2.activeItemIndex + 1; _this2.onActiveItemChange({ index: activeIndex }); }, this.props.transitionInterval); this.setState({ slideShowActive: true }); } }, { key: "stopSlideShow", value: function stopSlideShow() { if (this.interval) { clearInterval(this.interval); } this.setState({ slideShowActive: false }); } }, { key: "getPositionClassName", value: function getPositionClassName(preClassName, position) { var positions = ['top', 'left', 'bottom', 'right']; var pos = positions.find(function (item) { return item === position; }); return pos ? "".concat(preClassName, "-").concat(pos) : ''; } }, { key: "isVertical", value: function isVertical() { return this.props.thumbnailsPosition === 'left' || this.props.thumbnailsPosition === 'right'; } }, { key: "componentWillUnmount", value: function componentWillUnmount() { if (this.state.slideShowActive) { this.stopSlideShow(); } ZIndexUtils.clear(this.mask); } }, { key: "renderHeader", value: function renderHeader() { if (this.props.header) { return /*#__PURE__*/React.createElement("div", { className: "p-galleria-header" }, this.props.header); } return null; } }, { key: "renderFooter", value: function renderFooter() { if (this.props.footer) { return /*#__PURE__*/React.createElement("div", { className: "p-galleria-footer" }, this.props.footer); } return null; } }, { key: "renderElement", value: function renderElement() { var _this3 = this; var isVertical = this.isVertical(); var thumbnailsPosClassName = this.props.showThumbnails && this.getPositionClassName('p-galleria-thumbnails', this.props.thumbnailsPosition); var indicatorPosClassName = this.props.showIndicators && this.getPositionClassName('p-galleria-indicators', this.props.indicatorsPosition); var galleriaClassName = classNames('p-galleria p-component', this.props.className, { 'p-galleria-fullscreen': this.props.fullScreen, 'p-galleria-indicator-onitem': this.props.showIndicatorsOnItem, 'p-galleria-item-nav-onhover': this.props.showItemNavigatorsOnHover && !this.props.fullScreen }, thumbnailsPosClassName, indicatorPosClassName); var closeIcon = this.props.fullScreen && /*#__PURE__*/React.createElement("button", { type: "button", className: "p-galleria-close p-link", onClick: this.hide }, /*#__PURE__*/React.createElement("span", { className: "p-galleria-close-icon pi pi-times" }), /*#__PURE__*/React.createElement(Ripple, null)); var header = this.renderHeader(); var footer = this.renderFooter(); var element = /*#__PURE__*/React.createElement("div", { ref: this.galleriaRef, id: this.props.id, className: galleriaClassName, style: this.props.style }, closeIcon, header, /*#__PURE__*/React.createElement("div", { className: "p-galleria-content" }, /*#__PURE__*/React.createElement(GalleriaItem, { ref: function ref(el) { return _this3.previewContent = el; }, value: this.props.value, activeItemIndex: this.activeItemIndex, onActiveItemChange: this.onActiveItemChange, itemTemplate: this.props.item, circular: this.props.circular, caption: this.props.caption, showIndicators: this.props.showIndicators, changeItemOnIndicatorHover: this.props.changeItemOnIndicatorHover, indicator: this.props.indicator, showItemNavigators: this.props.showItemNavigators, autoPlay: this.props.autoPlay, slideShowActive: this.state.slideShowActive, startSlideShow: this.startSlideShow, stopSlideShow: this.stopSlideShow }), this.props.showThumbnails && /*#__PURE__*/React.createElement(GalleriaThumbnails, { value: this.props.value, activeItemIndex: this.activeItemIndex, onActiveItemChange: this.onActiveItemChange, itemTemplate: this.props.thumbnail, numVisible: this.props.numVisible, responsiveOptions: this.props.responsiveOptions, circular: this.props.circular, isVertical: isVertical, contentHeight: this.props.verticalThumbnailViewPortHeight, showThumbnailNavigators: this.props.showThumbnailNavigators, autoPlay: this.props.autoPlay, slideShowActive: this.state.slideShowActive, stopSlideShow: this.stopSlideShow })), footer); return element; } }, { key: "renderGalleria", value: function renderGalleria() { var _this4 = this; var element = this.renderElement(); if (this.props.fullScreen) { var maskClassName = classNames('p-galleria-mask', { 'p-galleria-visible': this.state.visible }); var galleriaWrapper = /*#__PURE__*/React.createElement("div", { ref: function ref(el) { return _this4.mask = el; }, className: maskClassName }, /*#__PURE__*/React.createElement(CSSTransition, { nodeRef: this.galleriaRef, classNames: "p-galleria", in: this.state.visible, timeout: { enter: 150, exit: 150 }, options: this.props.transitionOptions, unmountOnExit: true, onEnter: this.onEnter, onEntering: this.onEntering, onEntered: this.onEntered, onExit: this.onExit, onExited: this.onExited }, element)); return /*#__PURE__*/React.createElement(Portal, { element: galleriaWrapper }); } else { return element; } } }, { key: "render", value: function render() { return this.props.value && this.props.value.length > 0 && this.renderGalleria(); } }]); return Galleria; }(Component); _defineProperty(Galleria, "defaultProps", { id: null, value: null, activeIndex: 0, fullScreen: false, item: null, thumbnail: null, indicator: null, caption: null, className: null, style: null, header: null, footer: null, numVisible: 3, responsiveOptions: null, showItemNavigators: false, showThumbnailNavigators: true, showItemNavigatorsOnHover: false, changeItemOnIndicatorHover: false, circular: false, autoPlay: false, transitionInterval: 4000, showThumbnails: true, thumbnailsPosition: "bottom", verticalThumbnailViewPortHeight: "300px", showIndicators: false, showIndicatorsOnItem: false, indicatorsPosition: "bottom", baseZIndex: 0, transitionOptions: null, onItemChange: null }); export { Galleria };
ajax/libs/primereact/7.0.0-rc.2/messages/messages.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; import { Ripple, classNames, CSSTransition } from 'primereact/core'; import { TransitionGroup } from 'react-transition-group'; 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 _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } 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 _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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } 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); return Constructor; } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); } 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); } 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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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; } function _extends() { _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; }; return _extends.apply(this, arguments); } function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); 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 _isNativeReflectConstruct$1() { 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; } } var UIMessageComponent = /*#__PURE__*/function (_Component) { _inherits(UIMessageComponent, _Component); var _super = _createSuper$1(UIMessageComponent); function UIMessageComponent(props) { var _this; _classCallCheck(this, UIMessageComponent); _this = _super.call(this, props); _this.onClick = _this.onClick.bind(_assertThisInitialized(_this)); _this.onClose = _this.onClose.bind(_assertThisInitialized(_this)); return _this; } _createClass(UIMessageComponent, [{ key: "componentDidMount", value: function componentDidMount() { var _this2 = this; if (!this.props.message.sticky) { this.timeout = setTimeout(function () { _this2.onClose(null); }, this.props.message.life || 3000); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { if (this.timeout) { clearTimeout(this.timeout); } } }, { key: "onClose", value: function onClose(event) { if (this.timeout) { clearTimeout(this.timeout); } if (this.props.onClose) { this.props.onClose(this.props.message); } if (event) { event.preventDefault(); event.stopPropagation(); } } }, { key: "onClick", value: function onClick() { if (this.props.onClick) { this.props.onClick(this.props.message); } } }, { key: "renderCloseIcon", value: function renderCloseIcon() { if (this.props.message.closable !== false) { return /*#__PURE__*/React.createElement("button", { type: "button", className: "p-message-close p-link", onClick: this.onClose }, /*#__PURE__*/React.createElement("i", { className: "p-message-close-icon pi pi-times" }), /*#__PURE__*/React.createElement(Ripple, null)); } return null; } }, { key: "renderMessage", value: function renderMessage() { if (this.props.message) { var _this$props$message = this.props.message, severity = _this$props$message.severity, content = _this$props$message.content, summary = _this$props$message.summary, detail = _this$props$message.detail; var icon = classNames('p-message-icon pi ', { 'pi-info-circle': severity === 'info', 'pi-check': severity === 'success', 'pi-exclamation-triangle': severity === 'warn', 'pi-times-circle': severity === 'error' }); return content || /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", { className: icon }), /*#__PURE__*/React.createElement("span", { className: "p-message-summary" }, summary), /*#__PURE__*/React.createElement("span", { className: "p-message-detail" }, detail)); } return null; } }, { key: "render", value: function render() { var severity = this.props.message.severity; var className = 'p-message p-component p-message-' + severity; var closeIcon = this.renderCloseIcon(); var message = this.renderMessage(); return /*#__PURE__*/React.createElement("div", { ref: this.props.forwardRef, className: className, onClick: this.onClick }, /*#__PURE__*/React.createElement("div", { className: "p-message-wrapper" }, message, closeIcon)); } }]); return UIMessageComponent; }(Component); _defineProperty(UIMessageComponent, "defaultProps", { message: null, onClose: null, onClick: null }); var UIMessage = /*#__PURE__*/React.forwardRef(function (props, ref) { return /*#__PURE__*/React.createElement(UIMessageComponent, _extends({ forwardRef: ref }, props)); }); 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 _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; } } var messageIdx = 0; var Messages = /*#__PURE__*/function (_Component) { _inherits(Messages, _Component); var _super = _createSuper(Messages); function Messages(props) { var _this; _classCallCheck(this, Messages); _this = _super.call(this, props); _this.state = { messages: [] }; _this.onClose = _this.onClose.bind(_assertThisInitialized(_this)); return _this; } _createClass(Messages, [{ key: "show", value: function show(value) { if (value) { var newMessages = []; if (Array.isArray(value)) { for (var i = 0; i < value.length; i++) { value[i].id = messageIdx++; newMessages = [].concat(_toConsumableArray(this.state.messages), _toConsumableArray(value)); } } else { value.id = messageIdx++; newMessages = this.state.messages ? [].concat(_toConsumableArray(this.state.messages), [value]) : [value]; } this.setState({ messages: newMessages }); } } }, { key: "clear", value: function clear() { this.setState({ messages: [] }); } }, { key: "replace", value: function replace(value) { var _this2 = this; this.setState({ messages: [] }, function () { return _this2.show(value); }); } }, { key: "onClose", value: function onClose(message) { var newMessages = this.state.messages.filter(function (msg) { return msg.id !== message.id; }); this.setState({ messages: newMessages }); if (this.props.onRemove) { this.props.onRemove(message); } } }, { key: "render", value: function render() { var _this3 = this; return /*#__PURE__*/React.createElement("div", { id: this.props.id, className: this.props.className, style: this.props.style }, /*#__PURE__*/React.createElement(TransitionGroup, null, this.state.messages.map(function (message) { var messageRef = /*#__PURE__*/React.createRef(); return /*#__PURE__*/React.createElement(CSSTransition, { nodeRef: messageRef, key: message.id, classNames: "p-message", unmountOnExit: true, timeout: { enter: 300, exit: 300 }, options: _this3.props.transitionOptions }, /*#__PURE__*/React.createElement(UIMessage, { ref: messageRef, message: message, onClick: _this3.props.onClick, onClose: _this3.onClose })); }))); } }]); return Messages; }(Component); _defineProperty(Messages, "defaultProps", { id: null, className: null, style: null, transitionOptions: null, onRemove: null, onClick: null }); export { Messages };
ajax/libs/material-ui/4.9.4/es/ListItemAvatar/ListItemAvatar.js
cdnjs/cdnjs
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import withStyles from '../styles/withStyles'; import ListContext from '../List/ListContext'; export const styles = { /* Styles applied to the root element. */ root: { minWidth: 56, flexShrink: 0 }, /* Styles applied to the root element when the parent `ListItem` uses `alignItems="flex-start"`. */ alignItemsFlexStart: { marginTop: 8 } }; /** * A simple wrapper to apply `List` styles to an `Avatar`. */ const ListItemAvatar = React.forwardRef(function ListItemAvatar(props, ref) { const { classes, className } = props, other = _objectWithoutPropertiesLoose(props, ["classes", "className"]); const context = React.useContext(ListContext); return React.createElement("div", _extends({ className: clsx(classes.root, className, context.alignItems === 'flex-start' && classes.alignItemsFlexStart), ref: ref }, other)); }); process.env.NODE_ENV !== "production" ? ListItemAvatar.propTypes = { /** * The content of the component – normally `Avatar`. */ children: PropTypes.element.isRequired, /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * @ignore */ className: PropTypes.string } : void 0; export default withStyles(styles, { name: 'MuiListItemAvatar' })(ListItemAvatar);
ajax/libs/react-native-web/0.0.0-4fd133e73/exports/RefreshControl/index.js
cdnjs/cdnjs
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } /** * Copyright (c) Nicolas Gallagher. * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ import View from '../View'; import React from 'react'; function RefreshControl(props) { var colors = props.colors, enabled = props.enabled, onRefresh = props.onRefresh, progressBackgroundColor = props.progressBackgroundColor, progressViewOffset = props.progressViewOffset, refreshing = props.refreshing, size = props.size, tintColor = props.tintColor, title = props.title, titleColor = props.titleColor, rest = _objectWithoutPropertiesLoose(props, ["colors", "enabled", "onRefresh", "progressBackgroundColor", "progressViewOffset", "refreshing", "size", "tintColor", "title", "titleColor"]); return React.createElement(View, rest); } export default RefreshControl;
ajax/libs/primereact/6.6.0/chart/chart.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; import { classNames } from 'primereact/core'; 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); return Constructor; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); } 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); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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; } 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 _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; } } var Chart = /*#__PURE__*/function (_Component) { _inherits(Chart, _Component); var _super = _createSuper(Chart); function Chart() { _classCallCheck(this, Chart); return _super.apply(this, arguments); } _createClass(Chart, [{ key: "initChart", value: function initChart() { var _this = this; import('chart.js/auto').then(function (module) { if (_this.chart) { _this.chart.destroy(); _this.chart = null; } if (module && module.default) { _this.chart = new module.default(_this.canvas, { type: _this.props.type, data: _this.props.data, options: _this.props.options, plugins: _this.props.plugins }); } }); } }, { key: "getCanvas", value: function getCanvas() { return this.canvas; } }, { key: "getChart", value: function getChart() { return this.chart; } }, { key: "getBase64Image", value: function getBase64Image() { return this.chart.toBase64Image(); } }, { key: "generateLegend", value: function generateLegend() { if (this.chart) { this.chart.generateLegend(); } } }, { key: "refresh", value: function refresh() { if (this.chart) { this.chart.update(); } } }, { key: "reinit", value: function reinit() { this.initChart(); } }, { key: "shouldComponentUpdate", value: function shouldComponentUpdate(nextProps) { if (nextProps.data === this.props.data && nextProps.options === this.props.options && nextProps.type === this.props.type) { return false; } return true; } }, { key: "componentDidMount", value: function componentDidMount() { this.initChart(); } }, { key: "componentDidUpdate", value: function componentDidUpdate() { this.reinit(); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { if (this.chart) { this.chart.destroy(); this.chart = null; } } }, { key: "render", value: function render() { var _this2 = this; var className = classNames('p-chart', this.props.className), style = Object.assign({ width: this.props.width, height: this.props.height }, this.props.style); return /*#__PURE__*/React.createElement("div", { id: this.props.id, style: style, className: className }, /*#__PURE__*/React.createElement("canvas", { ref: function ref(el) { _this2.canvas = el; }, width: this.props.width, height: this.props.height })); } }]); return Chart; }(Component); _defineProperty(Chart, "defaultProps", { id: null, type: null, data: null, options: null, plugins: null, width: null, height: null, style: null, className: null }); export { Chart };
ajax/libs/react-native-web/0.0.0-466063b7e/exports/ScrollView/index.js
cdnjs/cdnjs
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { 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; } function _extends() { _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; }; return _extends.apply(this, arguments); } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } /** * Copyright (c) Nicolas Gallagher. * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ import createReactClass from 'create-react-class'; import dismissKeyboard from '../../modules/dismissKeyboard'; import invariant from 'fbjs/lib/invariant'; import ScrollResponder from '../../modules/ScrollResponder'; import ScrollViewBase from './ScrollViewBase'; import StyleSheet from '../StyleSheet'; import View from '../View'; import React from 'react'; var emptyObject = {}; /* eslint-disable react/prefer-es6-class */ var ScrollView = createReactClass({ displayName: "ScrollView", mixins: [ScrollResponder.Mixin], getInitialState: function getInitialState() { return this.scrollResponderMixinGetInitialState(); }, flashScrollIndicators: function flashScrollIndicators() { this.scrollResponderFlashScrollIndicators(); }, setNativeProps: function setNativeProps(props) { if (this._scrollNodeRef) { this._scrollNodeRef.setNativeProps(props); } }, /** * Returns a reference to the underlying scroll responder, which supports * operations like `scrollTo`. All ScrollView-like components should * implement this method so that they can be composed while providing access * to the underlying scroll responder's methods. */ getScrollResponder: function getScrollResponder() { return this; }, getScrollableNode: function getScrollableNode() { return this._scrollNodeRef; }, getInnerViewNode: function getInnerViewNode() { return this._innerViewRef; }, /** * Scrolls to a given x, y offset, either immediately or with a smooth animation. * Syntax: * * scrollTo(options: {x: number = 0; y: number = 0; animated: boolean = true}) * * Note: The weird argument signature is due to the fact that, for historical reasons, * the function also accepts separate arguments as as alternative to the options object. * This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED. */ scrollTo: function scrollTo(y, x, animated) { if (typeof y === 'number') { console.warn('`scrollTo(y, x, animated)` is deprecated. Use `scrollTo({x: 5, y: 5, animated: true})` instead.'); } else { var _ref = y || emptyObject; x = _ref.x; y = _ref.y; animated = _ref.animated; } this.getScrollResponder().scrollResponderScrollTo({ x: x || 0, y: y || 0, animated: animated !== false }); }, /** * If this is a vertical ScrollView scrolls to the bottom. * If this is a horizontal ScrollView scrolls to the right. * * Use `scrollToEnd({ animated: true })` for smooth animated scrolling, * `scrollToEnd({ animated: false })` for immediate scrolling. * If no options are passed, `animated` defaults to true. */ scrollToEnd: function scrollToEnd(options) { // Default to true var animated = (options && options.animated) !== false; var horizontal = this.props.horizontal; var scrollResponder = this.getScrollResponder(); var scrollResponderNode = scrollResponder.scrollResponderGetScrollableNode(); var x = horizontal ? scrollResponderNode.scrollWidth : 0; var y = horizontal ? 0 : scrollResponderNode.scrollHeight; scrollResponder.scrollResponderScrollTo({ x: x, y: y, animated: animated }); }, render: function render() { var _this$props = this.props, contentContainerStyle = _this$props.contentContainerStyle, horizontal = _this$props.horizontal, onContentSizeChange = _this$props.onContentSizeChange, refreshControl = _this$props.refreshControl, stickyHeaderIndices = _this$props.stickyHeaderIndices, pagingEnabled = _this$props.pagingEnabled, keyboardDismissMode = _this$props.keyboardDismissMode, onScroll = _this$props.onScroll, other = _objectWithoutPropertiesLoose(_this$props, ["contentContainerStyle", "horizontal", "onContentSizeChange", "refreshControl", "stickyHeaderIndices", "pagingEnabled", "keyboardDismissMode", "onScroll"]); if (process.env.NODE_ENV !== 'production' && this.props.style) { var style = StyleSheet.flatten(this.props.style); var childLayoutProps = ['alignItems', 'justifyContent'].filter(function (prop) { return style && style[prop] !== undefined; }); invariant(childLayoutProps.length === 0, "ScrollView child layout (" + JSON.stringify(childLayoutProps) + ") " + 'must be applied through the contentContainerStyle prop.'); } var contentSizeChangeProps = {}; if (onContentSizeChange) { contentSizeChangeProps = { onLayout: this._handleContentOnLayout }; } var hasStickyHeaderIndices = !horizontal && Array.isArray(stickyHeaderIndices); var children = hasStickyHeaderIndices || pagingEnabled ? React.Children.map(this.props.children, function (child, i) { var isSticky = hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1; if (child != null && (isSticky || pagingEnabled)) { return React.createElement(View, { style: StyleSheet.compose(isSticky && styles.stickyHeader, pagingEnabled && styles.pagingEnabledChild) }, child); } else { return child; } }) : this.props.children; var contentContainer = React.createElement(View, _extends({}, contentSizeChangeProps, { children: children, collapsable: false, ref: this._setInnerViewRef, style: StyleSheet.compose(horizontal && styles.contentContainerHorizontal, contentContainerStyle) })); var baseStyle = horizontal ? styles.baseHorizontal : styles.baseVertical; var pagingEnabledStyle = horizontal ? styles.pagingEnabledHorizontal : styles.pagingEnabledVertical; var props = _objectSpread({}, other, { style: [baseStyle, pagingEnabled && pagingEnabledStyle, this.props.style], onTouchStart: this.scrollResponderHandleTouchStart, onTouchMove: this.scrollResponderHandleTouchMove, onTouchEnd: this.scrollResponderHandleTouchEnd, onScrollBeginDrag: this.scrollResponderHandleScrollBeginDrag, onScrollEndDrag: this.scrollResponderHandleScrollEndDrag, onMomentumScrollBegin: this.scrollResponderHandleMomentumScrollBegin, onMomentumScrollEnd: this.scrollResponderHandleMomentumScrollEnd, onStartShouldSetResponder: this.scrollResponderHandleStartShouldSetResponder, onStartShouldSetResponderCapture: this.scrollResponderHandleStartShouldSetResponderCapture, onScrollShouldSetResponder: this.scrollResponderHandleScrollShouldSetResponder, onScroll: this._handleScroll, onResponderGrant: this.scrollResponderHandleResponderGrant, onResponderTerminationRequest: this.scrollResponderHandleTerminationRequest, onResponderTerminate: this.scrollResponderHandleTerminate, onResponderRelease: this.scrollResponderHandleResponderRelease, onResponderReject: this.scrollResponderHandleResponderReject }); var ScrollViewClass = ScrollViewBase; invariant(ScrollViewClass !== undefined, 'ScrollViewClass must not be undefined'); if (refreshControl) { return React.cloneElement(refreshControl, { style: props.style }, React.createElement(ScrollViewClass, _extends({}, props, { ref: this._setScrollNodeRef, style: baseStyle }), contentContainer)); } return React.createElement(ScrollViewClass, _extends({}, props, { ref: this._setScrollNodeRef }), contentContainer); }, _handleContentOnLayout: function _handleContentOnLayout(e) { var _e$nativeEvent$layout = e.nativeEvent.layout, width = _e$nativeEvent$layout.width, height = _e$nativeEvent$layout.height; this.props.onContentSizeChange(width, height); }, _handleScroll: function _handleScroll(e) { if (process.env.NODE_ENV !== 'production') { if (this.props.onScroll && this.props.scrollEventThrottle == null) { console.log('You specified `onScroll` on a <ScrollView> but not ' + '`scrollEventThrottle`. You will only receive one event. ' + 'Using `16` you get all the events but be aware that it may ' + "cause frame drops, use a bigger number if you don't need as " + 'much precision.'); } } if (this.props.keyboardDismissMode === 'on-drag') { dismissKeyboard(); } this.scrollResponderHandleScroll(e); }, _setInnerViewRef: function _setInnerViewRef(component) { this._innerViewRef = component; }, _setScrollNodeRef: function _setScrollNodeRef(component) { this._scrollNodeRef = component; } }); var commonStyle = { flexGrow: 1, flexShrink: 1, // Enable hardware compositing in modern browsers. // Creates a new layer with its own backing surface that can significantly // improve scroll performance. transform: [{ translateZ: 0 }], // iOS native scrolling WebkitOverflowScrolling: 'touch' }; var styles = StyleSheet.create({ baseVertical: _objectSpread({}, commonStyle, { flexDirection: 'column', overflowX: 'hidden', overflowY: 'auto' }), baseHorizontal: _objectSpread({}, commonStyle, { flexDirection: 'row', overflowX: 'auto', overflowY: 'hidden' }), contentContainerHorizontal: { flexDirection: 'row' }, stickyHeader: { position: 'sticky', top: 0, zIndex: 10 }, pagingEnabledHorizontal: { scrollSnapType: 'x mandatory' }, pagingEnabledVertical: { scrollSnapType: 'y mandatory' }, pagingEnabledChild: { scrollSnapAlign: 'start' } }); export default ScrollView;
ajax/libs/boardgame-io/0.42.0/esm/react.js
cdnjs/cdnjs
import './Debug-ba7187a3.js'; import 'redux'; import './turn-order-7578f7f3.js'; import 'immer'; import './reducer-ef40323d.js'; import './initialize-ff341f37.js'; import 'flatted'; import { M as MCTSBot } from './ai-4091d3f9.js'; import { C as Client$1 } from './client-b699de9a.js'; import { L as LobbyClient } from './client-61b8ced8.js'; import React from 'react'; import PropTypes from 'prop-types'; import Cookies from 'react-cookies'; import './base-fbb991d8.js'; import { S as SocketIO, L as Local } from './socketio-18b3b314.js'; import './master-7515c743.js'; import 'socket.io-client'; /* * Copyright 2017 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ /** * Client * * boardgame.io React client. * * @param {...object} game - The return value of `Game`. * @param {...object} numPlayers - The number of players. * @param {...object} board - The React component for the game. * @param {...object} loading - (optional) The React component for the loading state. * @param {...object} multiplayer - Set to a falsy value or a transportFactory, e.g., SocketIO() * @param {...object} debug - Enables the Debug UI. * @param {...object} enhancer - Optional enhancer to send to the Redux store * * Returns: * A React component that wraps board and provides an * API through props for it to interact with the framework * and dispatch actions such as MAKE_MOVE, GAME_EVENT, RESET, * UNDO and REDO. */ function Client(opts) { var _a; let { game, numPlayers, loading, board, multiplayer, enhancer, debug } = opts; // Component that is displayed before the client has synced // with the game master. if (loading === undefined) { const Loading = () => React.createElement("div", { className: "bgio-loading" }, "connecting..."); loading = Loading; } /* * WrappedBoard * * The main React component that wraps the passed in * board component and adds the API to its props. */ return _a = class WrappedBoard extends React.Component { constructor(props) { super(props); if (debug === undefined) { debug = props.debug; } this.client = Client$1({ game, debug, numPlayers, multiplayer, matchID: props.matchID, playerID: props.playerID, credentials: props.credentials, enhancer, }); } componentDidMount() { this.unsubscribe = this.client.subscribe(() => this.forceUpdate()); this.client.start(); } componentWillUnmount() { this.client.stop(); this.unsubscribe(); } componentDidUpdate(prevProps) { if (this.props.matchID != prevProps.matchID) { this.client.updateMatchID(this.props.matchID); } if (this.props.playerID != prevProps.playerID) { this.client.updatePlayerID(this.props.playerID); } if (this.props.credentials != prevProps.credentials) { this.client.updateCredentials(this.props.credentials); } } render() { const state = this.client.getState(); if (state === null) { return React.createElement(loading); } let _board = null; if (board) { _board = React.createElement(board, { ...state, ...this.props, isMultiplayer: !!multiplayer, moves: this.client.moves, events: this.client.events, matchID: this.client.matchID, playerID: this.client.playerID, reset: this.client.reset, undo: this.client.undo, redo: this.client.redo, log: this.client.log, matchData: this.client.matchData, }); } return React.createElement("div", { className: "bgio-client" }, _board); } }, _a.propTypes = { // The ID of a game to connect to. // Only relevant in multiplayer. matchID: PropTypes.string, // The ID of the player associated with this client. // Only relevant in multiplayer. playerID: PropTypes.string, // This client's authentication credentials. // Only relevant in multiplayer. credentials: PropTypes.string, // Enable / disable the Debug UI. debug: PropTypes.any, }, _a.defaultProps = { matchID: 'default', playerID: null, credentials: null, debug: true, }, _a; } /* * Copyright 2018 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ class _LobbyConnectionImpl { constructor({ server, gameComponents, playerName, playerCredentials, }) { this.client = new LobbyClient({ server }); this.gameComponents = gameComponents; this.playerName = playerName || 'Visitor'; this.playerCredentials = playerCredentials; this.matches = []; } async refresh() { try { this.matches = []; const games = await this.client.listGames(); for (const game of games) { if (!this._getGameComponents(game)) continue; const { matches } = await this.client.listMatches(game); this.matches = this.matches.concat(matches); } } catch (error) { throw new Error('failed to retrieve list of matches (' + error + ')'); } } _getMatchInstance(matchID) { for (let inst of this.matches) { if (inst['matchID'] === matchID) return inst; } } _getGameComponents(gameName) { for (let comp of this.gameComponents) { if (comp.game.name === gameName) return comp; } } _findPlayer(playerName) { for (let inst of this.matches) { if (inst.players.some(player => player.name === playerName)) return inst; } } async join(gameName, matchID, playerID) { try { let inst = this._findPlayer(this.playerName); if (inst) { throw new Error('player has already joined ' + inst.matchID); } inst = this._getMatchInstance(matchID); if (!inst) { throw new Error('game instance ' + matchID + ' not found'); } const json = await this.client.joinMatch(gameName, matchID, { playerID, playerName: this.playerName, }); inst.players[Number.parseInt(playerID)].name = this.playerName; this.playerCredentials = json.playerCredentials; } catch (error) { throw new Error('failed to join match ' + matchID + ' (' + error + ')'); } } async leave(gameName, matchID) { try { let inst = this._getMatchInstance(matchID); if (!inst) throw new Error('match instance not found'); for (const player of inst.players) { if (player.name === this.playerName) { await this.client.leaveMatch(gameName, matchID, { playerID: player.id.toString(), credentials: this.playerCredentials, }); delete player.name; delete this.playerCredentials; return; } } throw new Error('player not found in match'); } catch (error) { throw new Error('failed to leave match ' + matchID + ' (' + error + ')'); } } async disconnect() { let inst = this._findPlayer(this.playerName); if (inst) { await this.leave(inst.gameName, inst.matchID); } this.matches = []; this.playerName = 'Visitor'; } async create(gameName, numPlayers) { try { const comp = this._getGameComponents(gameName); if (!comp) throw new Error('game not found'); if (numPlayers < comp.game.minPlayers || numPlayers > comp.game.maxPlayers) throw new Error('invalid number of players ' + numPlayers); await this.client.createMatch(gameName, { numPlayers }); } catch (error) { throw new Error('failed to create match for ' + gameName + ' (' + error + ')'); } } } /** * LobbyConnection * * Lobby model. * * @param {string} server - '<host>:<port>' of the server. * @param {Array} gameComponents - A map of Board and Game objects for the supported games. * @param {string} playerName - The name of the player. * @param {string} playerCredentials - The credentials currently used by the player, if any. * * Returns: * A JS object that synchronizes the list of running game instances with the server and provides an API to create/join/start instances. */ function LobbyConnection(opts) { return new _LobbyConnectionImpl(opts); } /* * Copyright 2018 The boardgame.io Authors. * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ class LobbyLoginForm extends React.Component { constructor() { super(...arguments); this.state = { playerName: this.props.playerName, nameErrorMsg: '', }; this.onClickEnter = () => { if (this.state.playerName === '') return; this.props.onEnter(this.state.playerName); }; this.onKeyPress = (event) => { if (event.key === 'Enter') { this.onClickEnter(); } }; this.onChangePlayerName = (event) => { const name = event.target.value.trim(); this.setState({ playerName: name, nameErrorMsg: name.length > 0 ? '' : 'empty player name', }); }; } render() { return (React.createElement("div", null, React.createElement("p", { className: "phase-title" }, "Choose a player name:"), React.createElement("input", { type: "text", value: this.state.playerName, onChange: this.onChangePlayerName, onKeyPress: this.onKeyPress }), React.createElement("span", { className: "buttons" }, React.createElement("button", { className: "buttons", onClick: this.onClickEnter }, "Enter")), React.createElement("br", null), React.createElement("span", { className: "error-msg" }, this.state.nameErrorMsg, React.createElement("br", null)))); } } LobbyLoginForm.defaultProps = { playerName: '', }; /* * Copyright 2018 The boardgame.io Authors. * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ class LobbyMatchInstance extends React.Component { constructor() { super(...arguments); this._createSeat = (player) => { return player.name || '[free]'; }; this._createButtonJoin = (inst, seatId) => (React.createElement("button", { key: 'button-join-' + inst.matchID, onClick: () => this.props.onClickJoin(inst.gameName, inst.matchID, '' + seatId) }, "Join")); this._createButtonLeave = (inst) => (React.createElement("button", { key: 'button-leave-' + inst.matchID, onClick: () => this.props.onClickLeave(inst.gameName, inst.matchID) }, "Leave")); this._createButtonPlay = (inst, seatId) => (React.createElement("button", { key: 'button-play-' + inst.matchID, onClick: () => this.props.onClickPlay(inst.gameName, { matchID: inst.matchID, playerID: '' + seatId, numPlayers: inst.players.length, }) }, "Play")); this._createButtonSpectate = (inst) => (React.createElement("button", { key: 'button-spectate-' + inst.matchID, onClick: () => this.props.onClickPlay(inst.gameName, { matchID: inst.matchID, numPlayers: inst.players.length, }) }, "Spectate")); this._createInstanceButtons = (inst) => { const playerSeat = inst.players.find(player => player.name === this.props.playerName); const freeSeat = inst.players.find(player => !player.name); if (playerSeat && freeSeat) { // already seated: waiting for match to start return this._createButtonLeave(inst); } if (freeSeat) { // at least 1 seat is available return this._createButtonJoin(inst, freeSeat.id); } // match is full if (playerSeat) { return (React.createElement("div", null, [ this._createButtonPlay(inst, playerSeat.id), this._createButtonLeave(inst), ])); } // allow spectating return this._createButtonSpectate(inst); }; } render() { const match = this.props.match; let status = 'OPEN'; if (!match.players.find(player => !player.name)) { status = 'RUNNING'; } return (React.createElement("tr", { key: 'line-' + match.matchID }, React.createElement("td", { key: 'cell-name-' + match.matchID }, match.gameName), React.createElement("td", { key: 'cell-status-' + match.matchID }, status), React.createElement("td", { key: 'cell-seats-' + match.matchID }, match.players.map(this._createSeat).join(', ')), React.createElement("td", { key: 'cell-buttons-' + match.matchID }, this._createInstanceButtons(match)))); } } /* * Copyright 2018 The boardgame.io Authors. * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ class LobbyCreateMatchForm extends React.Component { constructor(props) { super(props); this.state = { selectedGame: 0, numPlayers: 2, }; this._createGameNameOption = (game, idx) => { return (React.createElement("option", { key: 'name-option-' + idx, value: idx }, game.game.name)); }; this._createNumPlayersOption = (idx) => { return (React.createElement("option", { key: 'num-option-' + idx, value: idx }, idx)); }; this._createNumPlayersRange = (game) => { return [...new Array(game.maxPlayers + 1).keys()].slice(game.minPlayers); }; this.onChangeNumPlayers = (event) => { this.setState({ numPlayers: Number.parseInt(event.target.value), }); }; this.onChangeSelectedGame = (event) => { let idx = Number.parseInt(event.target.value); this.setState({ selectedGame: idx, numPlayers: this.props.games[idx].game.minPlayers, }); }; this.onClickCreate = () => { this.props.createMatch(this.props.games[this.state.selectedGame].game.name, this.state.numPlayers); }; /* fix min and max number of players */ for (let game of props.games) { let matchDetails = game.game; if (!matchDetails.minPlayers) { matchDetails.minPlayers = 1; } if (!matchDetails.maxPlayers) { matchDetails.maxPlayers = 4; } console.assert(matchDetails.maxPlayers >= matchDetails.minPlayers); } this.state = { selectedGame: 0, numPlayers: props.games[0].game.minPlayers, }; } render() { return (React.createElement("div", null, React.createElement("select", { value: this.state.selectedGame, onChange: evt => this.onChangeSelectedGame(evt) }, this.props.games.map(this._createGameNameOption)), React.createElement("span", null, "Players:"), React.createElement("select", { value: this.state.numPlayers, onChange: this.onChangeNumPlayers }, this._createNumPlayersRange(this.props.games[this.state.selectedGame].game).map(this._createNumPlayersOption)), React.createElement("span", { className: "buttons" }, React.createElement("button", { onClick: this.onClickCreate }, "Create")))); } } /* * Copyright 2018 The boardgame.io Authors. * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ var LobbyPhases; (function (LobbyPhases) { LobbyPhases["ENTER"] = "enter"; LobbyPhases["PLAY"] = "play"; LobbyPhases["LIST"] = "list"; })(LobbyPhases || (LobbyPhases = {})); /** * Lobby * * React lobby component. * * @param {Array} gameComponents - An array of Board and Game objects for the supported games. * @param {string} lobbyServer - Address of the lobby server (for example 'localhost:8000'). * If not set, defaults to the server that served the page. * @param {string} gameServer - Address of the game server (for example 'localhost:8001'). * If not set, defaults to the server that served the page. * @param {function} clientFactory - Function that is used to create the game clients. * @param {number} refreshInterval - Interval between server updates (default: 2000ms). * @param {bool} debug - Enable debug information (default: false). * * Returns: * A React component that provides a UI to create, list, join, leave, play or * spectate matches (game instances). */ class Lobby extends React.Component { constructor(props) { super(props); this.state = { phase: LobbyPhases.ENTER, playerName: 'Visitor', runningMatch: null, errorMsg: '', credentialStore: {}, }; this._createConnection = (props) => { const name = this.state.playerName; this.connection = LobbyConnection({ server: props.lobbyServer, gameComponents: props.gameComponents, playerName: name, playerCredentials: this.state.credentialStore[name], }); }; this._updateCredentials = (playerName, credentials) => { this.setState(prevState => { // clone store or componentDidUpdate will not be triggered const store = Object.assign({}, prevState.credentialStore); store[playerName] = credentials; return { credentialStore: store }; }); }; this._updateConnection = async () => { await this.connection.refresh(); this.forceUpdate(); }; this._enterLobby = (playerName) => { this.setState({ playerName, phase: LobbyPhases.LIST }); }; this._exitLobby = async () => { await this.connection.disconnect(); this.setState({ phase: LobbyPhases.ENTER, errorMsg: '' }); }; this._createMatch = async (gameName, numPlayers) => { try { await this.connection.create(gameName, numPlayers); await this.connection.refresh(); // rerender this.setState({}); } catch (error) { this.setState({ errorMsg: error.message }); } }; this._joinMatch = async (gameName, matchID, playerID) => { try { await this.connection.join(gameName, matchID, playerID); await this.connection.refresh(); this._updateCredentials(this.connection.playerName, this.connection.playerCredentials); } catch (error) { this.setState({ errorMsg: error.message }); } }; this._leaveMatch = async (gameName, matchID) => { try { await this.connection.leave(gameName, matchID); await this.connection.refresh(); this._updateCredentials(this.connection.playerName, this.connection.playerCredentials); } catch (error) { this.setState({ errorMsg: error.message }); } }; this._startMatch = (gameName, matchOpts) => { const gameCode = this.connection._getGameComponents(gameName); if (!gameCode) { this.setState({ errorMsg: 'game ' + gameName + ' not supported', }); return; } let multiplayer = undefined; if (matchOpts.numPlayers > 1) { if (this.props.gameServer) { multiplayer = SocketIO({ server: this.props.gameServer }); } else { multiplayer = SocketIO(); } } if (matchOpts.numPlayers == 1) { const maxPlayers = gameCode.game.maxPlayers; let bots = {}; for (let i = 1; i < maxPlayers; i++) { bots[i + ''] = MCTSBot; } multiplayer = Local({ bots }); } const app = this.props.clientFactory({ game: gameCode.game, board: gameCode.board, debug: this.props.debug, multiplayer, }); const match = { app: app, matchID: matchOpts.matchID, playerID: matchOpts.numPlayers > 1 ? matchOpts.playerID : '0', credentials: this.connection.playerCredentials, }; this.setState({ phase: LobbyPhases.PLAY, runningMatch: match }); }; this._exitMatch = () => { this.setState({ phase: LobbyPhases.LIST, runningMatch: null }); }; this._getPhaseVisibility = (phase) => { return this.state.phase !== phase ? 'hidden' : 'phase'; }; this.renderMatches = (matches, playerName) => { return matches.map(match => { const { matchID, gameName, players } = match; return (React.createElement(LobbyMatchInstance, { key: 'instance-' + matchID, match: { matchID, gameName, players: Object.values(players) }, playerName: playerName, onClickJoin: this._joinMatch, onClickLeave: this._leaveMatch, onClickPlay: this._startMatch })); }); }; this._createConnection(this.props); setInterval(this._updateConnection, this.props.refreshInterval); } componentDidMount() { let cookie = Cookies.load('lobbyState') || {}; if (cookie.phase && cookie.phase === LobbyPhases.PLAY) { cookie.phase = LobbyPhases.LIST; } this.setState({ phase: cookie.phase || LobbyPhases.ENTER, playerName: cookie.playerName || 'Visitor', credentialStore: cookie.credentialStore || {}, }); } componentDidUpdate(prevProps, prevState) { let name = this.state.playerName; let creds = this.state.credentialStore[name]; if (prevState.phase !== this.state.phase || prevState.credentialStore[name] !== creds || prevState.playerName !== name) { this._createConnection(this.props); this._updateConnection(); let cookie = { phase: this.state.phase, playerName: name, credentialStore: this.state.credentialStore, }; Cookies.save('lobbyState', cookie, { path: '/' }); } } render() { const { gameComponents, renderer } = this.props; const { errorMsg, playerName, phase, runningMatch } = this.state; if (renderer) { return renderer({ errorMsg, gameComponents, matches: this.connection.matches, phase, playerName, runningMatch, handleEnterLobby: this._enterLobby, handleExitLobby: this._exitLobby, handleCreateMatch: this._createMatch, handleJoinMatch: this._joinMatch, handleLeaveMatch: this._leaveMatch, handleExitMatch: this._exitMatch, handleRefreshMatches: this._updateConnection, handleStartMatch: this._startMatch, }); } return (React.createElement("div", { id: "lobby-view", style: { padding: 50 } }, React.createElement("div", { className: this._getPhaseVisibility(LobbyPhases.ENTER) }, React.createElement(LobbyLoginForm, { key: playerName, playerName: playerName, onEnter: this._enterLobby })), React.createElement("div", { className: this._getPhaseVisibility(LobbyPhases.LIST) }, React.createElement("p", null, "Welcome, ", playerName), React.createElement("div", { className: "phase-title", id: "match-creation" }, React.createElement("span", null, "Create a match:"), React.createElement(LobbyCreateMatchForm, { games: gameComponents, createMatch: this._createMatch })), React.createElement("p", { className: "phase-title" }, "Join a match:"), React.createElement("div", { id: "instances" }, React.createElement("table", null, React.createElement("tbody", null, this.renderMatches(this.connection.matches, playerName))), React.createElement("span", { className: "error-msg" }, errorMsg, React.createElement("br", null))), React.createElement("p", { className: "phase-title" }, "Matches that become empty are automatically deleted.")), React.createElement("div", { className: this._getPhaseVisibility(LobbyPhases.PLAY) }, runningMatch && (React.createElement(runningMatch.app, { matchID: runningMatch.matchID, playerID: runningMatch.playerID, credentials: runningMatch.credentials })), React.createElement("div", { className: "buttons", id: "match-exit" }, React.createElement("button", { onClick: this._exitMatch }, "Exit match"))), React.createElement("div", { className: "buttons", id: "lobby-exit" }, React.createElement("button", { onClick: this._exitLobby }, "Exit lobby")))); } } Lobby.propTypes = { gameComponents: PropTypes.array.isRequired, lobbyServer: PropTypes.string, gameServer: PropTypes.string, debug: PropTypes.bool, clientFactory: PropTypes.func, refreshInterval: PropTypes.number, }; Lobby.defaultProps = { debug: false, clientFactory: Client, refreshInterval: 2000, }; export { Client, Lobby };
ajax/libs/material-ui/4.12.3/esm/utils/createSvgIcon.js
cdnjs/cdnjs
import _extends from "@babel/runtime/helpers/esm/extends"; import React from 'react'; import SvgIcon from '../SvgIcon'; /** * Private module reserved for @material-ui/x packages. */ export default function createSvgIcon(path, displayName) { var Component = function Component(props, ref) { return /*#__PURE__*/React.createElement(SvgIcon, _extends({ ref: ref }, props), path); }; if (process.env.NODE_ENV !== 'production') { // Need to set `displayName` on the inner component for React.memo. // React prior to 16.14 ignores `displayName` on the wrapper. Component.displayName = "".concat(displayName, "Icon"); } Component.muiName = SvgIcon.muiName; return /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(Component)); }
ajax/libs/material-ui/4.9.2/esm/Input/Input.js
cdnjs/cdnjs
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import { refType } from '@material-ui/utils'; import InputBase from '../InputBase'; import withStyles from '../styles/withStyles'; export var styles = function styles(theme) { var light = theme.palette.type === 'light'; var bottomLineColor = light ? 'rgba(0, 0, 0, 0.42)' : 'rgba(255, 255, 255, 0.7)'; return { /* Styles applied to the root element. */ root: { position: 'relative' }, /* Styles applied to the root element if the component is a descendant of `FormControl`. */ formControl: { 'label + &': { marginTop: 16 } }, /* Styles applied to the root element if the component is focused. */ focused: {}, /* Styles applied to the root element if `disabled={true}`. */ disabled: {}, /* Styles applied to the root element if color secondary. */ colorSecondary: { '&$underline:after': { borderBottomColor: theme.palette.secondary.main } }, /* Styles applied to the root element if `disableUnderline={false}`. */ underline: { '&:after': { borderBottom: "2px solid ".concat(theme.palette.primary.main), left: 0, bottom: 0, // Doing the other way around crash on IE 11 "''" https://github.com/cssinjs/jss/issues/242 content: '""', position: 'absolute', right: 0, transform: 'scaleX(0)', transition: theme.transitions.create('transform', { duration: theme.transitions.duration.shorter, easing: theme.transitions.easing.easeOut }), pointerEvents: 'none' // Transparent to the hover style. }, '&$focused:after': { transform: 'scaleX(1)' }, '&$error:after': { borderBottomColor: theme.palette.error.main, transform: 'scaleX(1)' // error is always underlined in red }, '&:before': { borderBottom: "1px solid ".concat(bottomLineColor), left: 0, bottom: 0, // Doing the other way around crash on IE 11 "''" https://github.com/cssinjs/jss/issues/242 content: '"\\00a0"', position: 'absolute', right: 0, transition: theme.transitions.create('border-bottom-color', { duration: theme.transitions.duration.shorter }), pointerEvents: 'none' // Transparent to the hover style. }, '&:hover:not($disabled):before': { borderBottom: "2px solid ".concat(theme.palette.text.primary), // Reset on touch devices, it doesn't add specificity '@media (hover: none)': { borderBottom: "1px solid ".concat(bottomLineColor) } }, '&$disabled:before': { borderBottomStyle: 'dotted' } }, /* Pseudo-class applied to the root element if `error={true}`. */ error: {}, /* Styles applied to the `input` element if `margin="dense"`. */ marginDense: {}, /* Styles applied to the root element if `multiline={true}`. */ multiline: {}, /* Styles applied to the root element if `fullWidth={true}`. */ fullWidth: {}, /* Styles applied to the `input` element. */ input: {}, /* Styles applied to the `input` element if `margin="dense"`. */ inputMarginDense: {}, /* Styles applied to the `input` element if `multiline={true}`. */ inputMultiline: {}, /* Styles applied to the `input` element if `type="search"`. */ inputTypeSearch: {} }; }; var Input = React.forwardRef(function Input(props, ref) { var disableUnderline = props.disableUnderline, classes = props.classes, _props$fullWidth = props.fullWidth, fullWidth = _props$fullWidth === void 0 ? false : _props$fullWidth, _props$inputComponent = props.inputComponent, inputComponent = _props$inputComponent === void 0 ? 'input' : _props$inputComponent, _props$multiline = props.multiline, multiline = _props$multiline === void 0 ? false : _props$multiline, _props$type = props.type, type = _props$type === void 0 ? 'text' : _props$type, other = _objectWithoutProperties(props, ["disableUnderline", "classes", "fullWidth", "inputComponent", "multiline", "type"]); return React.createElement(InputBase, _extends({ classes: _extends({}, classes, { root: clsx(classes.root, !disableUnderline && classes.underline), underline: null }), fullWidth: fullWidth, inputComponent: inputComponent, multiline: multiline, ref: ref, type: type }, other)); }); process.env.NODE_ENV !== "production" ? Input.propTypes = { /** * This prop helps users to fill forms faster, especially on mobile devices. * The name can be confusing, as it's more like an autofill. * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill). */ autoComplete: PropTypes.string, /** * If `true`, the `input` element will be focused during the first mount. */ autoFocus: PropTypes.bool, /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * The CSS class name of the wrapper element. */ className: PropTypes.string, /** * The color of the component. It supports those theme colors that make sense for this component. */ color: PropTypes.oneOf(['primary', 'secondary']), /** * The default `input` element value. Use when the component is not controlled. */ defaultValue: PropTypes.any, /** * If `true`, the `input` element will be disabled. */ disabled: PropTypes.bool, /** * If `true`, the input will not have an underline. */ disableUnderline: PropTypes.bool, /** * End `InputAdornment` for this component. */ endAdornment: PropTypes.node, /** * If `true`, the input will indicate an error. This is normally obtained via context from * FormControl. */ error: PropTypes.bool, /** * If `true`, the input will take up the full width of its container. */ fullWidth: PropTypes.bool, /** * The id of the `input` element. */ id: PropTypes.string, /** * The component used for the native input. * Either a string to use a DOM element or a component. */ inputComponent: PropTypes.elementType, /** * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element. */ inputProps: PropTypes.object, /** * Pass a ref to the `input` element. */ inputRef: refType, /** * If `dense`, will adjust vertical spacing. This is normally obtained via context from * FormControl. */ margin: PropTypes.oneOf(['dense', 'none']), /** * If `true`, a textarea element will be rendered. */ multiline: PropTypes.bool, /** * Name attribute of the `input` element. */ name: PropTypes.string, /** * Callback fired when the value is changed. * * @param {object} event The event source of the callback. * You can pull out the new value by accessing `event.target.value` (string). */ onChange: PropTypes.func, /** * The short hint displayed in the input before the user enters a value. */ placeholder: PropTypes.string, /** * It prevents the user from changing the value of the field * (not from interacting with the field). */ readOnly: PropTypes.bool, /** * If `true`, the `input` element will be required. */ required: PropTypes.bool, /** * Number of rows to display when multiline option is set to true. */ rows: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), /** * Maximum number of rows to display when multiline option is set to true. */ rowsMax: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), /** * Start `InputAdornment` for this component. */ startAdornment: PropTypes.node, /** * Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types). */ type: PropTypes.string, /** * The value of the `input` element, required for a controlled component. */ value: PropTypes.any } : void 0; Input.muiName = 'Input'; export default withStyles(styles, { name: 'MuiInput' })(Input);
ajax/libs/primereact/7.0.0-rc.1/avatar/avatar.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; import { classNames, ObjectUtils } from 'primereact/core'; 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); return Constructor; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); } 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); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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; } 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 _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; } } var Avatar = /*#__PURE__*/function (_Component) { _inherits(Avatar, _Component); var _super = _createSuper(Avatar); function Avatar() { _classCallCheck(this, Avatar); return _super.apply(this, arguments); } _createClass(Avatar, [{ key: "renderContent", value: function renderContent() { var _this = this; if (this.props.label) { return /*#__PURE__*/React.createElement("span", { className: "p-avatar-text" }, this.props.label); } else if (this.props.icon) { var iconClassName = classNames('p-avatar-icon', this.props.icon); return /*#__PURE__*/React.createElement("span", { className: iconClassName }); } else if (this.props.image) { var onError = function onError(e) { if (_this.props.onImageError) { _this.props.onImageError(e); } }; return /*#__PURE__*/React.createElement("img", { src: this.props.image, alt: this.props.imageAlt, onError: onError }); } return null; } }, { key: "render", value: function render() { var containerClassName = classNames('p-avatar p-component', { 'p-avatar-image': this.props.image != null, 'p-avatar-circle': this.props.shape === 'circle', 'p-avatar-lg': this.props.size === 'large', 'p-avatar-xl': this.props.size === 'xlarge', 'p-avatar-clickable': !!this.props.onClick }, this.props.className); var content = this.props.template ? ObjectUtils.getJSXElement(this.props.template, this.props) : this.renderContent(); return /*#__PURE__*/React.createElement("div", { className: containerClassName, style: this.props.style, onClick: this.props.onClick }, content, this.props.children); } }]); return Avatar; }(Component); _defineProperty(Avatar, "defaultProps", { label: null, icon: null, image: null, size: 'normal', shape: 'square', style: null, className: null, template: null, imageAlt: 'avatar', onImageError: null, onClick: null }); export { Avatar };
ajax/libs/react-native-web/0.13.9/exports/RefreshControl/index.js
cdnjs/cdnjs
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } /** * Copyright (c) Nicolas Gallagher. * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ import View from '../View'; import React from 'react'; function RefreshControl(props) { var colors = props.colors, enabled = props.enabled, onRefresh = props.onRefresh, progressBackgroundColor = props.progressBackgroundColor, progressViewOffset = props.progressViewOffset, refreshing = props.refreshing, size = props.size, tintColor = props.tintColor, title = props.title, titleColor = props.titleColor, rest = _objectWithoutPropertiesLoose(props, ["colors", "enabled", "onRefresh", "progressBackgroundColor", "progressViewOffset", "refreshing", "size", "tintColor", "title", "titleColor"]); return React.createElement(View, rest); } export default RefreshControl;
ajax/libs/primereact/6.5.0/scrolltop/scrolltop.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; import { DomHandler, ZIndexUtils, classNames, CSSTransition, Ripple } from 'primereact/core'; 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); return Constructor; } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); } 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); } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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; } 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 _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; } } var ScrollTop = /*#__PURE__*/function (_Component) { _inherits(ScrollTop, _Component); var _super = _createSuper(ScrollTop); function ScrollTop(props) { var _this; _classCallCheck(this, ScrollTop); _this = _super.call(this, props); _this.state = { visible: false }; _this.onClick = _this.onClick.bind(_assertThisInitialized(_this)); _this.onEnter = _this.onEnter.bind(_assertThisInitialized(_this)); _this.onEntered = _this.onEntered.bind(_assertThisInitialized(_this)); _this.onExited = _this.onExited.bind(_assertThisInitialized(_this)); _this.scrollElementRef = /*#__PURE__*/React.createRef(); return _this; } _createClass(ScrollTop, [{ key: "onClick", value: function onClick() { var scrollElement = this.props.target === 'window' ? window : this.helper.parentElement; scrollElement.scroll({ top: 0, behavior: this.props.behavior }); } }, { key: "checkVisibility", value: function checkVisibility(scrollY) { this.setState({ visible: scrollY > this.props.threshold }); } }, { key: "bindParentScrollListener", value: function bindParentScrollListener() { var _this2 = this; this.scrollListener = function () { _this2.checkVisibility(_this2.helper.parentElement.scrollTop); }; this.helper.parentElement.addEventListener('scroll', this.scrollListener); } }, { key: "bindDocumentScrollListener", value: function bindDocumentScrollListener() { var _this3 = this; this.scrollListener = function () { _this3.checkVisibility(DomHandler.getWindowScrollTop()); }; window.addEventListener('scroll', this.scrollListener); } }, { key: "unbindParentScrollListener", value: function unbindParentScrollListener() { if (this.scrollListener) { this.helper.parentElement.removeEventListener('scroll', this.scrollListener); this.scrollListener = null; } } }, { key: "unbindDocumentScrollListener", value: function unbindDocumentScrollListener() { if (this.scrollListener) { window.removeEventListener('scroll', this.scrollListener); this.scrollListener = null; } } }, { key: "onEnter", value: function onEnter() { ZIndexUtils.set('overlay', this.scrollElementRef.current); } }, { key: "onEntered", value: function onEntered() { this.props.onShow && this.props.onShow(); } }, { key: "onExited", value: function onExited() { ZIndexUtils.clear(this.scrollElementRef.current); this.props.onHide && this.props.onHide(); } }, { key: "componentDidMount", value: function componentDidMount() { if (this.props.target === 'window') this.bindDocumentScrollListener();else if (this.props.target === 'parent') this.bindParentScrollListener(); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { if (this.props.target === 'window') this.unbindDocumentScrollListener();else if (this.props.target === 'parent') this.unbindParentScrollListener(); ZIndexUtils.clear(this.scrollElementRef.current); } }, { key: "render", value: function render() { var _this4 = this; var className = classNames('p-scrolltop p-link p-component', { 'p-scrolltop-sticky': this.props.target !== 'window' }, this.props.className); var iconClassName = classNames('p-scrolltop-icon', this.props.icon); var isTargetParent = this.props.target === 'parent'; return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CSSTransition, { nodeRef: this.scrollElementRef, classNames: "p-scrolltop", in: this.state.visible, timeout: { enter: 150, exit: 150 }, options: this.props.transitionOptions, unmountOnExit: true, onEnter: this.onEnter, onEntered: this.onEntered, onExited: this.onExited }, /*#__PURE__*/React.createElement("button", { ref: this.scrollElementRef, type: "button", className: className, style: this.props.style, onClick: this.onClick }, /*#__PURE__*/React.createElement("span", { className: iconClassName }), /*#__PURE__*/React.createElement(Ripple, null))), isTargetParent && /*#__PURE__*/React.createElement("span", { ref: function ref(el) { return _this4.helper = el; }, className: "p-scrolltop-helper" })); } }]); return ScrollTop; }(Component); _defineProperty(ScrollTop, "defaultProps", { target: 'window', threshold: 400, icon: 'pi pi-chevron-up', behavior: 'smooth', className: null, style: null, transitionOptions: null, onShow: null, onHide: null }); export { ScrollTop };
ajax/libs/material-ui/4.9.2/esm/RadioGroup/useRadioGroup.js
cdnjs/cdnjs
import React from 'react'; import RadioGroupContext from './RadioGroupContext'; export default function useRadioGroup() { return React.useContext(RadioGroupContext); }
ajax/libs/primereact/6.5.1/splitter/splitter.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; import { DomHandler, classNames } from 'primereact/core'; 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 _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } 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 _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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } 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); return Constructor; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); } 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); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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; } 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 _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; } } var SplitterPanel = /*#__PURE__*/function (_Component) { _inherits(SplitterPanel, _Component); var _super = _createSuper(SplitterPanel); function SplitterPanel() { _classCallCheck(this, SplitterPanel); return _super.apply(this, arguments); } return SplitterPanel; }(Component); _defineProperty(SplitterPanel, "defaultProps", { size: null, minSize: null, style: null, className: null }); var Splitter = /*#__PURE__*/function (_Component2) { _inherits(Splitter, _Component2); var _super2 = _createSuper(Splitter); function Splitter() { _classCallCheck(this, Splitter); return _super2.apply(this, arguments); } _createClass(Splitter, [{ key: "bindMouseListeners", value: function bindMouseListeners() { var _this = this; if (!this.mouseMoveListener) { this.mouseMoveListener = function (event) { return _this.onResize(event); }; document.addEventListener('mousemove', this.mouseMoveListener); } if (!this.mouseUpListener) { this.mouseUpListener = function (event) { _this.onResizeEnd(event); _this.unbindMouseListeners(); }; document.addEventListener('mouseup', this.mouseUpListener); } } }, { key: "validateResize", value: function validateResize(newPrevPanelSize, newNextPanelSize) { if (this.props.children[this.prevPanelIndex].props && this.props.children[this.prevPanelIndex].props.minSize && this.props.children[this.prevPanelIndex].props.minSize > newPrevPanelSize) { return false; } if (this.props.children[this.prevPanelIndex + 1].props && this.props.children[this.prevPanelIndex + 1].props.minSize && this.props.children[this.prevPanelIndex + 1].props.minSize > newNextPanelSize) { return false; } return true; } }, { key: "unbindMouseListeners", value: function unbindMouseListeners() { if (this.mouseMoveListener) { document.removeEventListener('mousemove', this.mouseMoveListener); this.mouseMoveListener = null; } if (this.mouseUpListener) { document.removeEventListener('mouseup', this.mouseUpListener); this.mouseUpListener = null; } } }, { key: "clear", value: function clear() { this.dragging = false; this.size = null; this.startPos = null; this.prevPanelElement = null; this.nextPanelElement = null; this.prevPanelSize = null; this.nextPanelSize = null; this.gutterElement = null; this.prevPanelIndex = null; } }, { key: "isStateful", value: function isStateful() { return this.props.stateKey != null; } }, { key: "getStorage", value: function getStorage() { switch (this.props.stateStorage) { case 'local': return window.localStorage; case 'session': return window.sessionStorage; default: throw new Error(this.props.stateStorage + ' is not a valid value for the state storage, supported values are "local" and "session".'); } } }, { key: "saveState", value: function saveState() { this.getStorage().setItem(this.props.stateKey, JSON.stringify(this.panelSizes)); } }, { key: "restoreState", value: function restoreState() { var _this2 = this; var storage = this.getStorage(); var stateString = storage.getItem(this.props.stateKey); if (stateString) { this.panelSizes = JSON.parse(stateString); var children = _toConsumableArray(this.container.children).filter(function (child) { return DomHandler.hasClass(child, 'p-splitter-panel'); }); children.forEach(function (child, i) { child.style.flexBasis = 'calc(' + _this2.panelSizes[i] + '% - ' + (_this2.props.children.length - 1) * _this2.props.gutterSize + 'px)'; }); return true; } return false; } }, { key: "onResizeStart", value: function onResizeStart(event, index) { var pageX = event.type === 'touchstart' ? event.touches[0].pageX : event.pageX; var pageY = event.type === 'touchstart' ? event.touches[0].pageY : event.pageY; this.gutterElement = event.currentTarget; this.size = this.props.layout === 'horizontal' ? DomHandler.getWidth(this.container) : DomHandler.getHeight(this.container); this.dragging = true; this.startPos = this.props.layout === 'horizontal' ? pageX : pageY; this.prevPanelElement = this.gutterElement.previousElementSibling; this.nextPanelElement = this.gutterElement.nextElementSibling; this.prevPanelSize = 100 * (this.props.layout === 'horizontal' ? DomHandler.getOuterWidth(this.prevPanelElement, true) : DomHandler.getOuterHeight(this.prevPanelElement, true)) / this.size; this.nextPanelSize = 100 * (this.props.layout === 'horizontal' ? DomHandler.getOuterWidth(this.nextPanelElement, true) : DomHandler.getOuterHeight(this.nextPanelElement, true)) / this.size; this.prevPanelIndex = index; DomHandler.addClass(this.gutterElement, 'p-splitter-gutter-resizing'); DomHandler.addClass(this.container, 'p-splitter-resizing'); } }, { key: "onResize", value: function onResize(event) { var newPos; var pageX = event.type === 'touchmove' ? event.touches[0].pageX : event.pageX; var pageY = event.type === 'touchmove' ? event.touches[0].pageY : event.pageY; if (this.props.layout === 'horizontal') newPos = pageX * 100 / this.size - this.startPos * 100 / this.size;else newPos = pageY * 100 / this.size - this.startPos * 100 / this.size; var newPrevPanelSize = this.prevPanelSize + newPos; var newNextPanelSize = this.nextPanelSize - newPos; if (this.validateResize(newPrevPanelSize, newNextPanelSize)) { this.prevPanelElement.style.flexBasis = 'calc(' + newPrevPanelSize + '% - ' + (this.props.children.length - 1) * this.props.gutterSize + 'px)'; this.nextPanelElement.style.flexBasis = 'calc(' + newNextPanelSize + '% - ' + (this.props.children.length - 1) * this.props.gutterSize + 'px)'; this.panelSizes[this.prevPanelIndex] = newPrevPanelSize; this.panelSizes[this.prevPanelIndex + 1] = newNextPanelSize; } } }, { key: "onResizeEnd", value: function onResizeEnd(event) { if (this.isStateful()) { this.saveState(); } if (this.props.onResizeEnd) { this.props.onResizeEnd({ originalEvent: event, sizes: this.panelSizes }); } DomHandler.removeClass(this.gutterElement, 'p-splitter-gutter-resizing'); DomHandler.removeClass(this.container, 'p-splitter-resizing'); this.clear(); } }, { key: "onGutterMouseDown", value: function onGutterMouseDown(event, index) { this.onResizeStart(event, index); this.bindMouseListeners(); } }, { key: "onGutterTouchStart", value: function onGutterTouchStart(event, index) { this.onResizeStart(event, index); this.windowTouchMoveListener = this.onGutterTouchMove.bind(this); this.windowTouchEndListener = this.onGutterTouchEnd.bind(this); window.addEventListener('touchmove', this.windowTouchMoveListener, { passive: false, cancelable: false }); window.addEventListener('touchend', this.windowTouchEndListener); } }, { key: "onGutterTouchMove", value: function onGutterTouchMove(event) { this.onResize(event); } }, { key: "onGutterTouchEnd", value: function onGutterTouchEnd(event) { this.onResizeEnd(event); window.removeEventListener('touchmove', this.windowTouchMoveListener); window.removeEventListener('touchend', this.windowTouchEndListener); this.windowTouchMoveListener = null; this.windowTouchEndListener = null; } }, { key: "componentDidMount", value: function componentDidMount() { var _this3 = this; if (this.panelElement) { if (this.panelElement.childNodes && DomHandler.find(this.panelElement, '.p-splitter')) { DomHandler.addClass(this.panelElement, 'p-splitter-panel-nested'); } } if (this.props.children && this.props.children.length) { var initialized = false; if (this.isStateful()) { initialized = this.restoreState(); } if (!initialized) { var children = _toConsumableArray(this.container.children).filter(function (child) { return DomHandler.hasClass(child, 'p-splitter-panel'); }); var _panelSizes = []; this.props.children.map(function (panel, i) { var panelInitialSize = panel.props && panel.props.size ? panel.props.size : null; var panelSize = panelInitialSize || 100 / _this3.props.children.length; _panelSizes[i] = panelSize; children[i].style.flexBasis = 'calc(' + panelSize + '% - ' + (_this3.props.children.length - 1) * _this3.props.gutterSize + 'px)'; return _panelSizes; }); this.panelSizes = _panelSizes; } } } }, { key: "renderPanel", value: function renderPanel(panel, index) { var _this4 = this; var panelClassName = classNames('p-splitter-panel', panel.props.className); var gutterStyle = this.props.layout === 'horizontal' ? { width: this.props.gutterSize + 'px' } : { height: this.props.gutterSize + 'px' }; var gutter = index !== this.props.children.length - 1 && /*#__PURE__*/React.createElement("div", { ref: function ref(el) { return _this4.gutterElement = el; }, className: 'p-splitter-gutter', style: gutterStyle, onMouseDown: function onMouseDown(event) { return _this4.onGutterMouseDown(event, index); }, onTouchStart: function onTouchStart(event) { return _this4.onGutterTouchStart(event, index); }, onTouchMove: function onTouchMove(event) { return _this4.onGutterTouchMove(event); }, onTouchEnd: function onTouchEnd(event) { return _this4.onGutterTouchEnd(event); } }, /*#__PURE__*/React.createElement("div", { className: "p-splitter-gutter-handle" })); return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", { ref: function ref(el) { return _this4.panelElement = el; }, key: index, className: panelClassName, style: panel.props.style }, panel.props.children), gutter); } }, { key: "renderPanels", value: function renderPanels() { var _this5 = this; return React.Children.map(this.props.children, function (panel, index) { return _this5.renderPanel(panel, index); }); } }, { key: "render", value: function render() { var _this6 = this; var className = classNames("p-splitter p-component p-splitter-".concat(this.props.layout), this.props.className); var panels = this.renderPanels(); return /*#__PURE__*/React.createElement("div", { ref: function ref(el) { return _this6.container = el; }, id: this.props.id, className: className, style: this.props.style }, panels); } }]); return Splitter; }(Component); _defineProperty(Splitter, "defaultProps", { id: null, className: null, style: null, layout: 'horizontal', gutterSize: 4, stateKey: null, stateStorage: 'session', onResizeEnd: null }); export { Splitter, SplitterPanel };
ajax/libs/primereact/7.2.1/inplace/inplace.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; import { classNames } from 'primereact/utils'; import { Button } from 'primereact/button'; function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 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; } 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 _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 _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); } 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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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 _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; } } var InplaceDisplay = /*#__PURE__*/function (_Component) { _inherits(InplaceDisplay, _Component); var _super = _createSuper(InplaceDisplay); function InplaceDisplay() { _classCallCheck(this, InplaceDisplay); return _super.apply(this, arguments); } _createClass(InplaceDisplay, [{ key: "render", value: function render() { return this.props.children; } }]); return InplaceDisplay; }(Component); var InplaceContent = /*#__PURE__*/function (_Component2) { _inherits(InplaceContent, _Component2); var _super2 = _createSuper(InplaceContent); function InplaceContent() { _classCallCheck(this, InplaceContent); return _super2.apply(this, arguments); } _createClass(InplaceContent, [{ key: "render", value: function render() { return this.props.children; } }]); return InplaceContent; }(Component); var Inplace = /*#__PURE__*/function (_Component3) { _inherits(Inplace, _Component3); var _super3 = _createSuper(Inplace); function Inplace(props) { var _this; _classCallCheck(this, Inplace); _this = _super3.call(this, props); if (!_this.props.onToggle) { _this.state = { active: false }; } _this.open = _this.open.bind(_assertThisInitialized(_this)); _this.close = _this.close.bind(_assertThisInitialized(_this)); _this.onDisplayKeyDown = _this.onDisplayKeyDown.bind(_assertThisInitialized(_this)); return _this; } _createClass(Inplace, [{ key: "open", value: function open(event) { if (this.props.disabled) { return; } if (this.props.onOpen) { this.props.onOpen(event); } if (this.props.onToggle) { this.props.onToggle({ originalEvent: event, value: true }); } else { this.setState({ active: true }); } } }, { key: "close", value: function close(event) { if (this.props.onClose) { this.props.onClose(event); } if (this.props.onToggle) { this.props.onToggle({ originalEvent: event, value: false }); } else { this.setState({ active: false }); } } }, { key: "onDisplayKeyDown", value: function onDisplayKeyDown(event) { if (event.key === 'Enter') { this.open(event); event.preventDefault(); } } }, { key: "isActive", value: function isActive() { return this.props.onToggle ? this.props.active : this.state.active; } }, { key: "renderDisplay", value: function renderDisplay(content) { var className = classNames('p-inplace-display', { 'p-disabled': this.props.disabled }); return /*#__PURE__*/React.createElement("div", { className: className, onClick: this.open, onKeyDown: this.onDisplayKeyDown, tabIndex: this.props.tabIndex, "aria-label": this.props.ariaLabel }, content); } }, { key: "renderCloseButton", value: function renderCloseButton() { if (this.props.closable) { return /*#__PURE__*/React.createElement(Button, { type: "button", className: "p-inplace-content-close", icon: "pi pi-times", onClick: this.close }); } return null; } }, { key: "renderContent", value: function renderContent(content) { var closeButton = this.renderCloseButton(); return /*#__PURE__*/React.createElement("div", { className: "p-inplace-content" }, content, closeButton); } }, { key: "renderChildren", value: function renderChildren() { var _this2 = this; var active = this.isActive(); return React.Children.map(this.props.children, function (child, i) { if (active && child.type === InplaceContent) { return _this2.renderContent(child); } else if (!active && child.type === InplaceDisplay) { return _this2.renderDisplay(child); } }); } }, { key: "render", value: function render() { var className = classNames('p-inplace p-component', { 'p-inplace-closable': this.props.closable }, this.props.className); return /*#__PURE__*/React.createElement("div", { className: className }, this.renderChildren()); } }]); return Inplace; }(Component); _defineProperty(Inplace, "defaultProps", { style: null, className: null, active: false, closable: false, disabled: false, tabIndex: 0, ariaLabel: null, onOpen: null, onClose: null, onToggle: null }); export { Inplace, InplaceContent, InplaceDisplay };
ajax/libs/react-native-web/0.13.15/exports/createElement/index.js
cdnjs/cdnjs
/** * Copyright (c) Nicolas Gallagher. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ import AccessibilityUtil from '../../modules/AccessibilityUtil'; import createDOMProps from '../../modules/createDOMProps'; import React from 'react'; var createElement = function createElement(component, props) { // Use equivalent platform elements where possible. var accessibilityComponent; if (component && component.constructor === String) { accessibilityComponent = AccessibilityUtil.propsToAccessibilityComponent(props); } var Component = accessibilityComponent || component; var domProps = createDOMProps(Component, props); for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { children[_key - 2] = arguments[_key]; } return React.createElement.apply(React, [Component, domProps].concat(children)); }; export default createElement;
ajax/libs/material-ui/4.9.4/esm/Popover/Popover.js
cdnjs/cdnjs
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; import React from 'react'; import PropTypes from 'prop-types'; import ReactDOM from 'react-dom'; import debounce from '../utils/debounce'; import clsx from 'clsx'; import { chainPropTypes, elementTypeAcceptingRef, refType } from '@material-ui/utils'; import ownerDocument from '../utils/ownerDocument'; import ownerWindow from '../utils/ownerWindow'; import createChainedFunction from '../utils/createChainedFunction'; import withStyles from '../styles/withStyles'; import Modal from '../Modal'; import Grow from '../Grow'; import Paper from '../Paper'; export function getOffsetTop(rect, vertical) { var offset = 0; if (typeof vertical === 'number') { offset = vertical; } else if (vertical === 'center') { offset = rect.height / 2; } else if (vertical === 'bottom') { offset = rect.height; } return offset; } export function getOffsetLeft(rect, horizontal) { var offset = 0; if (typeof horizontal === 'number') { offset = horizontal; } else if (horizontal === 'center') { offset = rect.width / 2; } else if (horizontal === 'right') { offset = rect.width; } return offset; } function getTransformOriginValue(transformOrigin) { return [transformOrigin.horizontal, transformOrigin.vertical].map(function (n) { return typeof n === 'number' ? "".concat(n, "px") : n; }).join(' '); } // Sum the scrollTop between two elements. function getScrollParent(parent, child) { var element = child; var scrollTop = 0; while (element && element !== parent) { element = element.parentElement; scrollTop += element.scrollTop; } return scrollTop; } function getAnchorEl(anchorEl) { return typeof anchorEl === 'function' ? anchorEl() : anchorEl; } export var styles = { /* Styles applied to the root element */ root: {}, /* Styles applied to the `Paper` component. */ paper: { position: 'absolute', overflowY: 'auto', overflowX: 'hidden', // So we see the popover when it's empty. // It's most likely on issue on userland. minWidth: 16, minHeight: 16, maxWidth: 'calc(100% - 32px)', maxHeight: 'calc(100% - 32px)', // We disable the focus ring for mouse, touch and keyboard users. outline: 0 } }; var Popover = React.forwardRef(function Popover(props, ref) { var action = props.action, anchorEl = props.anchorEl, _props$anchorOrigin = props.anchorOrigin, anchorOrigin = _props$anchorOrigin === void 0 ? { vertical: 'top', horizontal: 'left' } : _props$anchorOrigin, anchorPosition = props.anchorPosition, _props$anchorReferenc = props.anchorReference, anchorReference = _props$anchorReferenc === void 0 ? 'anchorEl' : _props$anchorReferenc, children = props.children, classes = props.classes, className = props.className, containerProp = props.container, _props$elevation = props.elevation, elevation = _props$elevation === void 0 ? 8 : _props$elevation, getContentAnchorEl = props.getContentAnchorEl, _props$marginThreshol = props.marginThreshold, marginThreshold = _props$marginThreshol === void 0 ? 16 : _props$marginThreshol, onEnter = props.onEnter, onEntered = props.onEntered, onEntering = props.onEntering, onExit = props.onExit, onExited = props.onExited, onExiting = props.onExiting, open = props.open, _props$PaperProps = props.PaperProps, PaperProps = _props$PaperProps === void 0 ? {} : _props$PaperProps, _props$transformOrigi = props.transformOrigin, transformOrigin = _props$transformOrigi === void 0 ? { vertical: 'top', horizontal: 'left' } : _props$transformOrigi, _props$TransitionComp = props.TransitionComponent, TransitionComponent = _props$TransitionComp === void 0 ? Grow : _props$TransitionComp, _props$transitionDura = props.transitionDuration, transitionDurationProp = _props$transitionDura === void 0 ? 'auto' : _props$transitionDura, _props$TransitionProp = props.TransitionProps, TransitionProps = _props$TransitionProp === void 0 ? {} : _props$TransitionProp, other = _objectWithoutProperties(props, ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "classes", "className", "container", "elevation", "getContentAnchorEl", "marginThreshold", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "open", "PaperProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps"]); var paperRef = React.useRef(); // Returns the top/left offset of the position // to attach to on the anchor element (or body if none is provided) var getAnchorOffset = React.useCallback(function (contentAnchorOffset) { if (anchorReference === 'anchorPosition') { if (process.env.NODE_ENV !== 'production') { if (!anchorPosition) { console.error('Material-UI: you need to provide a `anchorPosition` prop when using ' + '<Popover anchorReference="anchorPosition" />.'); } } return anchorPosition; } var resolvedAnchorEl = getAnchorEl(anchorEl); var containerWindow = ownerWindow(resolvedAnchorEl); // If an anchor element wasn't provided, just use the parent body element of this Popover var anchorElement = resolvedAnchorEl instanceof containerWindow.Element ? resolvedAnchorEl : ownerDocument(paperRef.current).body; var anchorRect = anchorElement.getBoundingClientRect(); if (process.env.NODE_ENV !== 'production') { var box = anchorElement.getBoundingClientRect(); if (process.env.NODE_ENV !== 'test' && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) { console.warn(['Material-UI: the `anchorEl` prop provided to the component is invalid.', 'The anchor element should be part of the document layout.', "Make sure the element is present in the document or that it's not display none."].join('\n')); } } var anchorVertical = contentAnchorOffset === 0 ? anchorOrigin.vertical : 'center'; return { top: anchorRect.top + getOffsetTop(anchorRect, anchorVertical), left: anchorRect.left + getOffsetLeft(anchorRect, anchorOrigin.horizontal) }; }, [anchorEl, anchorOrigin.horizontal, anchorOrigin.vertical, anchorPosition, anchorReference]); // Returns the vertical offset of inner content to anchor the transform on if provided var getContentAnchorOffset = React.useCallback(function (element) { var contentAnchorOffset = 0; if (getContentAnchorEl && anchorReference === 'anchorEl') { var contentAnchorEl = getContentAnchorEl(element); if (contentAnchorEl && element.contains(contentAnchorEl)) { var scrollTop = getScrollParent(element, contentAnchorEl); contentAnchorOffset = contentAnchorEl.offsetTop + contentAnchorEl.clientHeight / 2 - scrollTop || 0; } // != the default value if (process.env.NODE_ENV !== 'production') { if (anchorOrigin.vertical !== 'top') { console.error(['Material-UI: you can not change the default `anchorOrigin.vertical` value ', 'when also providing the `getContentAnchorEl` prop to the popover component.', 'Only use one of the two props.', 'Set `getContentAnchorEl` to `null | undefined`' + ' or leave `anchorOrigin.vertical` unchanged.'].join('\n')); } } } return contentAnchorOffset; }, [anchorOrigin.vertical, anchorReference, getContentAnchorEl]); // Return the base transform origin using the element // and taking the content anchor offset into account if in use var getTransformOrigin = React.useCallback(function (elemRect) { var contentAnchorOffset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; return { vertical: getOffsetTop(elemRect, transformOrigin.vertical) + contentAnchorOffset, horizontal: getOffsetLeft(elemRect, transformOrigin.horizontal) }; }, [transformOrigin.horizontal, transformOrigin.vertical]); var getPositioningStyle = React.useCallback(function (element) { // Check if the parent has requested anchoring on an inner content node var contentAnchorOffset = getContentAnchorOffset(element); var elemRect = { width: element.offsetWidth, height: element.offsetHeight }; // Get the transform origin point on the element itself var elemTransformOrigin = getTransformOrigin(elemRect, contentAnchorOffset); if (anchorReference === 'none') { return { top: null, left: null, transformOrigin: getTransformOriginValue(elemTransformOrigin) }; } // Get the offset of of the anchoring element var anchorOffset = getAnchorOffset(contentAnchorOffset); // Calculate element positioning var top = anchorOffset.top - elemTransformOrigin.vertical; var left = anchorOffset.left - elemTransformOrigin.horizontal; var bottom = top + elemRect.height; var right = left + elemRect.width; // Use the parent window of the anchorEl if provided var containerWindow = ownerWindow(getAnchorEl(anchorEl)); // Window thresholds taking required margin into account var heightThreshold = containerWindow.innerHeight - marginThreshold; var widthThreshold = containerWindow.innerWidth - marginThreshold; // Check if the vertical axis needs shifting if (top < marginThreshold) { var diff = top - marginThreshold; top -= diff; elemTransformOrigin.vertical += diff; } else if (bottom > heightThreshold) { var _diff = bottom - heightThreshold; top -= _diff; elemTransformOrigin.vertical += _diff; } if (process.env.NODE_ENV !== 'production') { if (elemRect.height > heightThreshold && elemRect.height && heightThreshold) { console.error(['Material-UI: the popover component is too tall.', "Some part of it can not be seen on the screen (".concat(elemRect.height - heightThreshold, "px)."), 'Please consider adding a `max-height` to improve the user-experience.'].join('\n')); } } // Check if the horizontal axis needs shifting if (left < marginThreshold) { var _diff2 = left - marginThreshold; left -= _diff2; elemTransformOrigin.horizontal += _diff2; } else if (right > widthThreshold) { var _diff3 = right - widthThreshold; left -= _diff3; elemTransformOrigin.horizontal += _diff3; } return { top: "".concat(Math.round(top), "px"), left: "".concat(Math.round(left), "px"), transformOrigin: getTransformOriginValue(elemTransformOrigin) }; }, [anchorEl, anchorReference, getAnchorOffset, getContentAnchorOffset, getTransformOrigin, marginThreshold]); var setPositioningStyles = React.useCallback(function () { var element = paperRef.current; if (!element) { return; } var positioning = getPositioningStyle(element); if (positioning.top !== null) { element.style.top = positioning.top; } if (positioning.left !== null) { element.style.left = positioning.left; } element.style.transformOrigin = positioning.transformOrigin; }, [getPositioningStyle]); var handleEntering = function handleEntering(element, isAppearing) { if (onEntering) { onEntering(element, isAppearing); } setPositioningStyles(); }; var handlePaperRef = React.useCallback(function (instance) { // #StrictMode ready paperRef.current = ReactDOM.findDOMNode(instance); }, []); React.useEffect(function () { if (open) { setPositioningStyles(); } }); React.useImperativeHandle(action, function () { return open ? { updatePosition: function updatePosition() { setPositioningStyles(); } } : null; }, [open, setPositioningStyles]); React.useEffect(function () { if (!open) { return undefined; } var handleResize = debounce(function () { setPositioningStyles(); }); window.addEventListener('resize', handleResize); return function () { handleResize.clear(); window.removeEventListener('rezise', handleResize); }; }, [open, setPositioningStyles]); var transitionDuration = transitionDurationProp; if (transitionDurationProp === 'auto' && !TransitionComponent.muiSupportAuto) { transitionDuration = undefined; } // If the container prop is provided, use that // If the anchorEl prop is provided, use its parent body element as the container // If neither are provided let the Modal take care of choosing the container var container = containerProp || (anchorEl ? ownerDocument(getAnchorEl(anchorEl)).body : undefined); return React.createElement(Modal, _extends({ container: container, open: open, ref: ref, BackdropProps: { invisible: true }, className: clsx(classes.root, className) }, other), React.createElement(TransitionComponent, _extends({ appear: true, in: open, onEnter: onEnter, onEntered: onEntered, onExit: onExit, onExited: onExited, onExiting: onExiting, timeout: transitionDuration }, TransitionProps, { onEntering: createChainedFunction(handleEntering, TransitionProps.onEntering) }), React.createElement(Paper, _extends({ elevation: elevation, ref: handlePaperRef }, PaperProps, { className: clsx(classes.paper, PaperProps.className) }), children))); }); process.env.NODE_ENV !== "production" ? Popover.propTypes = { /** * A ref for imperative actions. * It currently only supports updatePosition() action. */ action: refType, /** * This is the DOM element, or a function that returns the DOM element, * that may be used to set the position of the popover. */ anchorEl: chainPropTypes(PropTypes.oneOfType([PropTypes.object, PropTypes.func]), function (props) { if (props.open && (!props.anchorReference || props.anchorReference === 'anchorEl')) { var resolvedAnchorEl = getAnchorEl(props.anchorEl); var containerWindow = ownerWindow(resolvedAnchorEl); if (resolvedAnchorEl instanceof containerWindow.Element) { var box = resolvedAnchorEl.getBoundingClientRect(); if (process.env.NODE_ENV !== 'test' && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) { return new Error(['Material-UI: the `anchorEl` prop provided to the component is invalid.', 'The anchor element should be part of the document layout.', "Make sure the element is present in the document or that it's not display none."].join('\n')); } } else { return new Error(['Material-UI: the `anchorEl` prop provided to the component is invalid.', "It should be an Element instance but it's `".concat(resolvedAnchorEl, "` instead.")].join('\n')); } } return null; }), /** * This is the point on the anchor where the popover's * `anchorEl` will attach to. This is not used when the * anchorReference is 'anchorPosition'. * * Options: * vertical: [top, center, bottom]; * horizontal: [left, center, right]. */ anchorOrigin: PropTypes.shape({ horizontal: PropTypes.oneOfType([PropTypes.number, PropTypes.oneOf(['left', 'center', 'right'])]).isRequired, vertical: PropTypes.oneOfType([PropTypes.number, PropTypes.oneOf(['top', 'center', 'bottom'])]).isRequired }), /** * This is the position that may be used * to set the position of the popover. * The coordinates are relative to * the application's client area. */ anchorPosition: PropTypes.shape({ left: PropTypes.number.isRequired, top: PropTypes.number.isRequired }), /* * This determines which anchor prop to refer to to set * the position of the popover. */ anchorReference: PropTypes.oneOf(['anchorEl', 'anchorPosition', 'none']), /** * The content of the component. */ children: PropTypes.node, /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * @ignore */ className: PropTypes.string, /** * A node, component instance, or function that returns either. * The `container` will passed to the Modal component. * By default, it uses the body of the anchorEl's top-level document object, * so it's simply `document.body` most of the time. */ container: PropTypes.oneOfType([PropTypes.object, PropTypes.func]), /** * The elevation of the popover. */ elevation: PropTypes.number, /** * This function is called in order to retrieve the content anchor element. * It's the opposite of the `anchorEl` prop. * The content anchor element should be an element inside the popover. * It's used to correctly scroll and set the position of the popover. * The positioning strategy tries to make the content anchor element just above the * anchor element. */ getContentAnchorEl: PropTypes.func, /** * Specifies how close to the edge of the window the popover can appear. */ marginThreshold: PropTypes.number, /** * Callback fired when the component requests to be closed. * * @param {object} event The event source of the callback. * @param {string} reason Can be: `"escapeKeyDown"`, `"backdropClick"`. */ onClose: PropTypes.func, /** * Callback fired before the component is entering. */ onEnter: PropTypes.func, /** * Callback fired when the component has entered. */ onEntered: PropTypes.func, /** * Callback fired when the component is entering. */ onEntering: PropTypes.func, /** * Callback fired before the component is exiting. */ onExit: PropTypes.func, /** * Callback fired when the component has exited. */ onExited: PropTypes.func, /** * Callback fired when the component is exiting. */ onExiting: PropTypes.func, /** * If `true`, the popover is visible. */ open: PropTypes.bool.isRequired, /** * Props applied to the [`Paper`](/api/paper/) element. */ PaperProps: PropTypes.shape({ component: elementTypeAcceptingRef }), /** * This is the point on the popover which * will attach to the anchor's origin. * * Options: * vertical: [top, center, bottom, x(px)]; * horizontal: [left, center, right, x(px)]. */ transformOrigin: PropTypes.shape({ horizontal: PropTypes.oneOfType([PropTypes.number, PropTypes.oneOf(['left', 'center', 'right'])]).isRequired, vertical: PropTypes.oneOfType([PropTypes.number, PropTypes.oneOf(['top', 'center', 'bottom'])]).isRequired }), /** * The component used for the transition. * [Follow this guide](/components/transitions/#transitioncomponent-prop) to learn more about the requirements for this component. */ TransitionComponent: PropTypes.elementType, /** * Set to 'auto' to automatically calculate transition time based on height. */ transitionDuration: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({ enter: PropTypes.number, exit: PropTypes.number }), PropTypes.oneOf(['auto'])]), /** * Props applied to the [`Transition`](http://reactcommunity.org/react-transition-group/transition#Transition-props) element. */ TransitionProps: PropTypes.object } : void 0; export default withStyles(styles, { name: 'MuiPopover' })(Popover);
ajax/libs/material-ui/4.9.3/esm/DialogContent/DialogContent.js
cdnjs/cdnjs
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import withStyles from '../styles/withStyles'; export var styles = function styles(theme) { return { /* Styles applied to the root element. */ root: { flex: '1 1 auto', WebkitOverflowScrolling: 'touch', // Add iOS momentum scrolling. overflowY: 'auto', padding: '8px 24px', '&:first-child': { // dialog without title paddingTop: 20 } }, /* Styles applied to the root element if `dividers={true}`. */ dividers: { padding: '16px 24px', borderTop: "1px solid ".concat(theme.palette.divider), borderBottom: "1px solid ".concat(theme.palette.divider) } }; }; var DialogContent = React.forwardRef(function DialogContent(props, ref) { var classes = props.classes, className = props.className, _props$dividers = props.dividers, dividers = _props$dividers === void 0 ? false : _props$dividers, other = _objectWithoutProperties(props, ["classes", "className", "dividers"]); return React.createElement("div", _extends({ className: clsx(classes.root, className, dividers && classes.dividers), ref: ref }, other)); }); process.env.NODE_ENV !== "production" ? DialogContent.propTypes = { /** * The content of the component. */ children: PropTypes.node, /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * @ignore */ className: PropTypes.string, /** * Display the top and bottom dividers. */ dividers: PropTypes.bool } : void 0; export default withStyles(styles, { name: 'MuiDialogContent' })(DialogContent);
ajax/libs/primereact/6.6.0-rc.1/tree/tree.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; import { DomHandler, ObjectUtils, classNames, Ripple } from 'primereact/core'; function _arrayLikeToArray$2(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 _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray$2(arr); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _unsupportedIterableToArray$2(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$2(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$2(o, minLen); } 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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$2(arr) || _nonIterableSpread(); } 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); return Constructor; } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); } 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); } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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; } function _createForOfIteratorHelper$1(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } function _unsupportedIterableToArray$1(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$1(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$1(o, minLen); } function _arrayLikeToArray$1(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 ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); 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 _isNativeReflectConstruct$1() { 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; } } var UITreeNode = /*#__PURE__*/function (_Component) { _inherits(UITreeNode, _Component); var _super = _createSuper$1(UITreeNode); function UITreeNode(props) { var _this; _classCallCheck(this, UITreeNode); _this = _super.call(this, props); _this.onClick = _this.onClick.bind(_assertThisInitialized(_this)); _this.onDoubleClick = _this.onDoubleClick.bind(_assertThisInitialized(_this)); _this.onRightClick = _this.onRightClick.bind(_assertThisInitialized(_this)); _this.onTouchEnd = _this.onTouchEnd.bind(_assertThisInitialized(_this)); _this.onTogglerClick = _this.onTogglerClick.bind(_assertThisInitialized(_this)); _this.onNodeKeyDown = _this.onNodeKeyDown.bind(_assertThisInitialized(_this)); _this.propagateUp = _this.propagateUp.bind(_assertThisInitialized(_this)); _this.onDrop = _this.onDrop.bind(_assertThisInitialized(_this)); _this.onDragOver = _this.onDragOver.bind(_assertThisInitialized(_this)); _this.onDragEnter = _this.onDragEnter.bind(_assertThisInitialized(_this)); _this.onDragLeave = _this.onDragLeave.bind(_assertThisInitialized(_this)); _this.onDragStart = _this.onDragStart.bind(_assertThisInitialized(_this)); _this.onDragEnd = _this.onDragEnd.bind(_assertThisInitialized(_this)); _this.onDropPointDragOver = _this.onDropPointDragOver.bind(_assertThisInitialized(_this)); _this.onDropPointDragEnter = _this.onDropPointDragEnter.bind(_assertThisInitialized(_this)); _this.onDropPointDragLeave = _this.onDropPointDragLeave.bind(_assertThisInitialized(_this)); return _this; } _createClass(UITreeNode, [{ key: "isLeaf", value: function isLeaf() { return this.props.isNodeLeaf(this.props.node); } }, { key: "expand", value: function expand(event) { var expandedKeys = this.props.expandedKeys ? _objectSpread$1({}, this.props.expandedKeys) : {}; expandedKeys[this.props.node.key] = true; this.props.onToggle({ originalEvent: event, value: expandedKeys }); this.invokeToggleEvents(event, true); } }, { key: "collapse", value: function collapse(event) { var expandedKeys = _objectSpread$1({}, this.props.expandedKeys); delete expandedKeys[this.props.node.key]; this.props.onToggle({ originalEvent: event, value: expandedKeys }); this.invokeToggleEvents(event, false); } }, { key: "onTogglerClick", value: function onTogglerClick(event) { if (this.props.disabled) { return; } if (this.isExpanded()) this.collapse(event);else this.expand(event); } }, { key: "invokeToggleEvents", value: function invokeToggleEvents(event, expanded) { if (expanded) { if (this.props.onExpand) { this.props.onExpand({ originalEvent: event, node: this.props.node }); } } else { if (this.props.onCollapse) { this.props.onCollapse({ originalEvent: event, node: this.props.node }); } } } }, { key: "isExpanded", value: function isExpanded() { return (this.props.expandedKeys ? this.props.expandedKeys[this.props.node.key] !== undefined : false) || this.props.node.expanded; } }, { key: "onNodeKeyDown", value: function onNodeKeyDown(event) { if (this.props.disabled) { return; } var nodeElement = event.target.parentElement; if (!DomHandler.hasClass(nodeElement, 'p-treenode')) { return; } switch (event.which) { //down arrow case 40: var listElement = nodeElement.children[1]; if (listElement) { this.focusNode(listElement.children[0]); } else { var nextNodeElement = nodeElement.nextElementSibling; if (nextNodeElement) { this.focusNode(nextNodeElement); } else { var nextSiblingAncestor = this.findNextSiblingOfAncestor(nodeElement); if (nextSiblingAncestor) { this.focusNode(nextSiblingAncestor); } } } event.preventDefault(); break; //up arrow case 38: if (nodeElement.previousElementSibling) { this.focusNode(this.findLastVisibleDescendant(nodeElement.previousElementSibling)); } else { var parentNodeElement = this.getParentNodeElement(nodeElement); if (parentNodeElement) { this.focusNode(parentNodeElement); } } event.preventDefault(); break; //right arrow case 39: if (!this.isExpanded()) { this.expand(event); } event.preventDefault(); break; //left arrow case 37: if (this.isExpanded()) { this.collapse(event); } event.preventDefault(); break; //enter case 13: this.onClick(event); event.preventDefault(); break; } } }, { key: "findNextSiblingOfAncestor", value: function findNextSiblingOfAncestor(nodeElement) { var parentNodeElement = this.getParentNodeElement(nodeElement); if (parentNodeElement) { if (parentNodeElement.nextElementSibling) return parentNodeElement.nextElementSibling;else return this.findNextSiblingOfAncestor(parentNodeElement); } else { return null; } } }, { key: "findLastVisibleDescendant", value: function findLastVisibleDescendant(nodeElement) { var childrenListElement = nodeElement.children[1]; if (childrenListElement) { var lastChildElement = childrenListElement.children[childrenListElement.children.length - 1]; return this.findLastVisibleDescendant(lastChildElement); } else { return nodeElement; } } }, { key: "getParentNodeElement", value: function getParentNodeElement(nodeElement) { var parentNodeElement = nodeElement.parentElement.parentElement; return DomHandler.hasClass(parentNodeElement, 'p-treenode') ? parentNodeElement : null; } }, { key: "focusNode", value: function focusNode(element) { element.children[0].focus(); } }, { key: "onClick", value: function onClick(event) { if (this.props.onClick) { this.props.onClick({ originalEvent: event, node: this.props.node }); } if (event.target.className && event.target.className.constructor === String && event.target.className.indexOf('p-tree-toggler') === 0 || this.props.disabled) { return; } if (this.props.selectionMode && this.props.node.selectable !== false) { var selectionKeys; if (this.isCheckboxSelectionMode()) { var checked = this.isChecked(); selectionKeys = this.props.selectionKeys ? _objectSpread$1({}, this.props.selectionKeys) : {}; if (checked) { if (this.props.propagateSelectionDown) this.propagateDown(this.props.node, false, selectionKeys);else delete selectionKeys[this.props.node.key]; if (this.props.propagateSelectionUp && this.props.onPropagateUp) { this.props.onPropagateUp({ originalEvent: event, check: false, selectionKeys: selectionKeys }); } if (this.props.onUnselect) { this.props.onUnselect({ originalEvent: event, node: this.props.node }); } } else { if (this.props.propagateSelectionDown) this.propagateDown(this.props.node, true, selectionKeys);else selectionKeys[this.props.node.key] = { checked: true }; if (this.props.propagateSelectionUp && this.props.onPropagateUp) { this.props.onPropagateUp({ originalEvent: event, check: true, selectionKeys: selectionKeys }); } if (this.props.onSelect) { this.props.onSelect({ originalEvent: event, node: this.props.node }); } } } else { var selected = this.isSelected(); var metaSelection = this.nodeTouched ? false : this.props.metaKeySelection; if (metaSelection) { var metaKey = event.metaKey || event.ctrlKey; if (selected && metaKey) { if (this.isSingleSelectionMode()) { selectionKeys = null; } else { selectionKeys = _objectSpread$1({}, this.props.selectionKeys); delete selectionKeys[this.props.node.key]; } if (this.props.onUnselect) { this.props.onUnselect({ originalEvent: event, node: this.props.node }); } } else { if (this.isSingleSelectionMode()) { selectionKeys = this.props.node.key; } else if (this.isMultipleSelectionMode()) { selectionKeys = !metaKey ? {} : this.props.selectionKeys ? _objectSpread$1({}, this.props.selectionKeys) : {}; selectionKeys[this.props.node.key] = true; } if (this.props.onSelect) { this.props.onSelect({ originalEvent: event, node: this.props.node }); } } } else { if (this.isSingleSelectionMode()) { if (selected) { selectionKeys = null; if (this.props.onUnselect) { this.props.onUnselect({ originalEvent: event, node: this.props.node }); } } else { selectionKeys = this.props.node.key; if (this.props.onSelect) { this.props.onSelect({ originalEvent: event, node: this.props.node }); } } } else { if (selected) { selectionKeys = _objectSpread$1({}, this.props.selectionKeys); delete selectionKeys[this.props.node.key]; if (this.props.onUnselect) { this.props.onUnselect({ originalEvent: event, node: this.props.node }); } } else { selectionKeys = this.props.selectionKeys ? _objectSpread$1({}, this.props.selectionKeys) : {}; selectionKeys[this.props.node.key] = true; if (this.props.onSelect) { this.props.onSelect({ originalEvent: event, node: this.props.node }); } } } } } if (this.props.onSelectionChange) { this.props.onSelectionChange({ originalEvent: event, value: selectionKeys }); } } this.nodeTouched = false; } }, { key: "onDoubleClick", value: function onDoubleClick(event) { if (this.props.onDoubleClick) { this.props.onDoubleClick({ originalEvent: event, node: this.props.node }); } } }, { key: "onRightClick", value: function onRightClick(event) { if (this.props.disabled) { return; } DomHandler.clearSelection(); if (this.props.onContextMenuSelectionChange) { this.props.onContextMenuSelectionChange({ originalEvent: event, value: this.props.node.key }); } if (this.props.onContextMenu) { this.props.onContextMenu({ originalEvent: event, node: this.props.node }); } } }, { key: "propagateUp", value: function propagateUp(event) { var check = event.check; var selectionKeys = event.selectionKeys; var checkedChildCount = 0; var childPartialSelected = false; var _iterator = _createForOfIteratorHelper$1(this.props.node.children), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var child = _step.value; if (selectionKeys[child.key] && selectionKeys[child.key].checked) checkedChildCount++;else if (selectionKeys[child.key] && selectionKeys[child.key].partialChecked) childPartialSelected = true; } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } if (check && checkedChildCount === this.props.node.children.length) { selectionKeys[this.props.node.key] = { checked: true, partialChecked: false }; } else { if (!check) { delete selectionKeys[this.props.node.key]; } if (childPartialSelected || checkedChildCount > 0 && checkedChildCount !== this.props.node.children.length) selectionKeys[this.props.node.key] = { checked: false, partialChecked: true };else delete selectionKeys[this.props.node.key]; } if (this.props.propagateSelectionUp && this.props.onPropagateUp) { this.props.onPropagateUp(event); } } }, { key: "propagateDown", value: function propagateDown(node, check, selectionKeys) { if (check) selectionKeys[node.key] = { checked: true, partialChecked: false };else delete selectionKeys[node.key]; if (node.children && node.children.length) { for (var i = 0; i < node.children.length; i++) { this.propagateDown(node.children[i], check, selectionKeys); } } } }, { key: "isSelected", value: function isSelected() { if (this.props.selectionMode && this.props.selectionKeys) return this.isSingleSelectionMode() ? this.props.selectionKeys === this.props.node.key : this.props.selectionKeys[this.props.node.key] !== undefined;else return false; } }, { key: "isChecked", value: function isChecked() { return this.props.selectionKeys ? this.props.selectionKeys[this.props.node.key] && this.props.selectionKeys[this.props.node.key].checked : false; } }, { key: "isPartialChecked", value: function isPartialChecked() { return this.props.selectionKeys ? this.props.selectionKeys[this.props.node.key] && this.props.selectionKeys[this.props.node.key].partialChecked : false; } }, { key: "isSingleSelectionMode", value: function isSingleSelectionMode() { return this.props.selectionMode && this.props.selectionMode === 'single'; } }, { key: "isMultipleSelectionMode", value: function isMultipleSelectionMode() { return this.props.selectionMode && this.props.selectionMode === 'multiple'; } }, { key: "isCheckboxSelectionMode", value: function isCheckboxSelectionMode() { return this.props.selectionMode && this.props.selectionMode === 'checkbox'; } }, { key: "onTouchEnd", value: function onTouchEnd() { this.nodeTouched = true; } }, { key: "onDropPoint", value: function onDropPoint(event, position) { event.preventDefault(); if (this.props.node.droppable !== false) { DomHandler.removeClass(event.target, 'p-treenode-droppoint-active'); if (this.props.onDropPoint) { this.props.onDropPoint({ originalEvent: event, path: this.props.path, index: this.props.index, position: position }); } } } }, { key: "onDropPointDragOver", value: function onDropPointDragOver(event) { if (event.dataTransfer.types[1] === this.props.dragdropScope.toLocaleLowerCase()) { event.dataTransfer.dropEffect = 'move'; event.preventDefault(); } } }, { key: "onDropPointDragEnter", value: function onDropPointDragEnter(event) { if (event.dataTransfer.types[1] === this.props.dragdropScope.toLocaleLowerCase()) { DomHandler.addClass(event.target, 'p-treenode-droppoint-active'); } } }, { key: "onDropPointDragLeave", value: function onDropPointDragLeave(event) { if (event.dataTransfer.types[1] === this.props.dragdropScope.toLocaleLowerCase()) { DomHandler.removeClass(event.target, 'p-treenode-droppoint-active'); } } }, { key: "onDrop", value: function onDrop(event) { if (this.props.dragdropScope && this.props.node.droppable !== false) { DomHandler.removeClass(this.contentElement, 'p-treenode-dragover'); event.preventDefault(); event.stopPropagation(); if (this.props.onDrop) { this.props.onDrop({ originalEvent: event, path: this.props.path, index: this.props.index }); } } } }, { key: "onDragOver", value: function onDragOver(event) { if (event.dataTransfer.types[1] === this.props.dragdropScope.toLocaleLowerCase() && this.props.node.droppable !== false) { event.dataTransfer.dropEffect = 'move'; event.preventDefault(); event.stopPropagation(); } } }, { key: "onDragEnter", value: function onDragEnter(event) { if (event.dataTransfer.types[1] === this.props.dragdropScope.toLocaleLowerCase() && this.props.node.droppable !== false) { DomHandler.addClass(this.contentElement, 'p-treenode-dragover'); } } }, { key: "onDragLeave", value: function onDragLeave(event) { if (event.dataTransfer.types[1] === this.props.dragdropScope.toLocaleLowerCase() && this.props.node.droppable !== false) { var rect = event.currentTarget.getBoundingClientRect(); if (event.nativeEvent.x > rect.left + rect.width || event.nativeEvent.x < rect.left || event.nativeEvent.y >= Math.floor(rect.top + rect.height) || event.nativeEvent.y < rect.top) { DomHandler.removeClass(this.contentElement, 'p-treenode-dragover'); } } } }, { key: "onDragStart", value: function onDragStart(event) { event.dataTransfer.setData("text", this.props.dragdropScope); event.dataTransfer.setData(this.props.dragdropScope, this.props.dragdropScope); if (this.props.onDragStart) { this.props.onDragStart({ originalEvent: event, path: this.props.path, index: this.props.index }); } } }, { key: "onDragEnd", value: function onDragEnd(event) { if (this.props.onDragEnd) { this.props.onDragEnd({ originalEvent: event }); } } }, { key: "renderLabel", value: function renderLabel() { var content = /*#__PURE__*/React.createElement("span", { className: "p-treenode-label" }, this.props.node.label); if (this.props.nodeTemplate) { var defaultContentOptions = { onTogglerClick: this.onTogglerClick, className: 'p-treenode-label', element: content, props: this.props, expanded: this.isExpanded() }; content = ObjectUtils.getJSXElement(this.props.nodeTemplate, this.props.node, defaultContentOptions); } return content; } }, { key: "renderCheckbox", value: function renderCheckbox() { if (this.isCheckboxSelectionMode() && this.props.node.selectable !== false) { var checked = this.isChecked(); var partialChecked = this.isPartialChecked(); var className = classNames('p-checkbox-box', { 'p-highlight': checked, 'p-indeterminate': partialChecked, 'p-disabled': this.props.disabled }); var icon = classNames('p-checkbox-icon p-c', { 'pi pi-check': checked, 'pi pi-minus': partialChecked }); return /*#__PURE__*/React.createElement("div", { className: "p-checkbox p-component" }, /*#__PURE__*/React.createElement("div", { className: className, role: "checkbox", "aria-checked": checked }, /*#__PURE__*/React.createElement("span", { className: icon }))); } return null; } }, { key: "renderIcon", value: function renderIcon(expanded) { var icon = this.props.node.icon || (expanded ? this.props.node.expandedIcon : this.props.node.collapsedIcon); if (icon) { var className = classNames('p-treenode-icon', icon); return /*#__PURE__*/React.createElement("span", { className: className }); } return null; } }, { key: "renderToggler", value: function renderToggler(expanded) { var iconClassName = classNames('p-tree-toggler-icon pi pi-fw', { 'pi-chevron-right': !expanded, 'pi-chevron-down': expanded }); var content = /*#__PURE__*/React.createElement("button", { type: "button", className: "p-tree-toggler p-link", tabIndex: -1, onClick: this.onTogglerClick }, /*#__PURE__*/React.createElement("span", { className: iconClassName }), /*#__PURE__*/React.createElement(Ripple, null)); if (this.props.togglerTemplate) { var defaultContentOptions = { onClick: this.onTogglerClick, containerClassName: 'p-tree-toggler p-link', iconClassName: 'p-tree-toggler-icon', element: content, props: this.props, expanded: expanded }; content = ObjectUtils.getJSXElement(this.props.togglerTemplate, this.props.node, defaultContentOptions); } return content; } }, { key: "renderDropPoint", value: function renderDropPoint(position) { var _this2 = this; if (this.props.dragdropScope) { return /*#__PURE__*/React.createElement("li", { className: "p-treenode-droppoint", onDrop: function onDrop(event) { return _this2.onDropPoint(event, position); }, onDragOver: this.onDropPointDragOver, onDragEnter: this.onDropPointDragEnter, onDragLeave: this.onDropPointDragLeave }); } return null; } }, { key: "renderContent", value: function renderContent() { var _this3 = this; var selected = this.isSelected(); var checked = this.isChecked(); var className = classNames('p-treenode-content', this.props.node.className, { 'p-treenode-selectable': this.props.selectionMode && this.props.node.selectable !== false, 'p-highlight': this.isCheckboxSelectionMode() ? checked : selected, 'p-highlight-contextmenu': this.props.contextMenuSelectionKey && this.props.contextMenuSelectionKey === this.props.node.key, 'p-disabled': this.props.disabled }); var expanded = this.isExpanded(); var toggler = this.renderToggler(expanded); var checkbox = this.renderCheckbox(); var icon = this.renderIcon(expanded); var label = this.renderLabel(); var tabIndex = this.props.disabled ? undefined : 0; return /*#__PURE__*/React.createElement("div", { ref: function ref(el) { return _this3.contentElement = el; }, className: className, style: this.props.node.style, onClick: this.onClick, onDoubleClick: this.onDoubleClick, onContextMenu: this.onRightClick, onTouchEnd: this.onTouchEnd, draggable: this.props.dragdropScope && this.props.node.draggable !== false && !this.props.disabled, onDrop: this.onDrop, onDragOver: this.onDragOver, onDragEnter: this.onDragEnter, onDragLeave: this.onDragLeave, onDragStart: this.onDragStart, onDragEnd: this.onDragEnd, tabIndex: tabIndex, onKeyDown: this.onNodeKeyDown, role: "treeitem", "aria-posinset": this.props.index + 1, "aria-expanded": this.isExpanded(), "aria-selected": checked || selected }, toggler, checkbox, icon, label); } }, { key: "renderChildren", value: function renderChildren() { var _this4 = this; if (this.props.node.children && this.props.node.children.length && this.isExpanded()) { return /*#__PURE__*/React.createElement("ul", { className: "p-treenode-children", role: "group" }, this.props.node.children.map(function (childNode, index) { return /*#__PURE__*/React.createElement(UITreeNode, { key: childNode.key || childNode.label, node: childNode, parent: _this4.props.node, index: index, last: index === _this4.props.node.children.length - 1, path: _this4.props.path + '-' + index, disabled: _this4.props.disabled, selectionMode: _this4.props.selectionMode, selectionKeys: _this4.props.selectionKeys, onSelectionChange: _this4.props.onSelectionChange, metaKeySelection: _this4.props.metaKeySelection, propagateSelectionDown: _this4.props.propagateSelectionDown, propagateSelectionUp: _this4.props.propagateSelectionUp, contextMenuSelectionKey: _this4.props.contextMenuSelectionKey, onContextMenuSelectionChange: _this4.props.onContextMenuSelectionChange, onContextMenu: _this4.props.onContextMenu, onExpand: _this4.props.onExpand, onCollapse: _this4.props.onCollapse, onSelect: _this4.props.onSelect, onUnselect: _this4.props.onUnselect, expandedKeys: _this4.props.expandedKeys, onToggle: _this4.props.onToggle, onPropagateUp: _this4.propagateUp, nodeTemplate: _this4.props.nodeTemplate, togglerTemplate: _this4.props.togglerTemplate, isNodeLeaf: _this4.props.isNodeLeaf, dragdropScope: _this4.props.dragdropScope, onDragStart: _this4.props.onDragStart, onDragEnd: _this4.props.onDragEnd, onDrop: _this4.props.onDrop, onDropPoint: _this4.props.onDropPoint }); })); } return null; } }, { key: "renderNode", value: function renderNode() { var className = classNames('p-treenode', { 'p-treenode-leaf': this.isLeaf() }, this.props.node.className); var content = this.renderContent(); var children = this.renderChildren(); return /*#__PURE__*/React.createElement("li", { className: className, style: this.props.node.style }, content, children); } }, { key: "render", value: function render() { var node = this.renderNode(); if (this.props.dragdropScope && !this.props.disabled) { var beforeDropPoint = this.renderDropPoint(-1); var afterDropPoint = this.props.last ? this.renderDropPoint(1) : null; return /*#__PURE__*/React.createElement(React.Fragment, null, beforeDropPoint, node, afterDropPoint); } else { return node; } } }]); return UITreeNode; }(Component); _defineProperty(UITreeNode, "defaultProps", { node: null, index: null, last: null, parent: null, path: null, disabled: false, selectionMode: null, selectionKeys: null, contextMenuSelectionKey: null, metaKeySelection: true, expandedKeys: null, propagateSelectionUp: true, propagateSelectionDown: true, dragdropScope: null, ariaLabel: null, ariaLabelledBy: null, nodeTemplate: null, togglerTemplate: null, isNodeLeaf: null, onSelect: null, onUnselect: null, onExpand: null, onCollapse: null, onToggle: null, onSelectionChange: null, onContextMenuSelectionChange: null, onPropagateUp: null, onDragStart: null, onDragEnd: null, onDrop: null, onDropPoint: null, onContextMenu: null, onNodeClick: null, onNodeDoubleClick: null }); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } 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 _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 _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; } } var Tree = /*#__PURE__*/function (_Component) { _inherits(Tree, _Component); var _super = _createSuper(Tree); function Tree(props) { var _this; _classCallCheck(this, Tree); _this = _super.call(this, props); _this.state = {}; if (!_this.props.onFilterValueChange) { _this.state['filterValue'] = ''; } if (!_this.props.onToggle) { _this.state['expandedKeys'] = _this.props.expandedKeys; } _this.isNodeLeaf = _this.isNodeLeaf.bind(_assertThisInitialized(_this)); _this.onToggle = _this.onToggle.bind(_assertThisInitialized(_this)); _this.onDragStart = _this.onDragStart.bind(_assertThisInitialized(_this)); _this.onDragEnd = _this.onDragEnd.bind(_assertThisInitialized(_this)); _this.onDrop = _this.onDrop.bind(_assertThisInitialized(_this)); _this.onDropPoint = _this.onDropPoint.bind(_assertThisInitialized(_this)); _this.onFilterInputChange = _this.onFilterInputChange.bind(_assertThisInitialized(_this)); _this.onFilterInputKeyDown = _this.onFilterInputKeyDown.bind(_assertThisInitialized(_this)); return _this; } _createClass(Tree, [{ key: "getFilterValue", value: function getFilterValue() { return this.props.onFilterValueChange ? this.props.filterValue : this.state.filterValue; } }, { key: "getExpandedKeys", value: function getExpandedKeys() { return this.props.onToggle ? this.props.expandedKeys : this.state.expandedKeys; } }, { key: "getRootNode", value: function getRootNode() { return this.props.filter && this.filteredNodes ? this.filteredNodes : this.props.value; } }, { key: "onToggle", value: function onToggle(event) { if (this.props.onToggle) { this.props.onToggle(event); } else { this.setState({ expandedKeys: event.value }); } } }, { key: "onDragStart", value: function onDragStart(event) { this.dragState = { path: event.path, index: event.index }; } }, { key: "onDragEnd", value: function onDragEnd() { this.dragState = null; } }, { key: "onDrop", value: function onDrop(event) { if (this.validateDropNode(this.dragState.path, event.path)) { var value = JSON.parse(JSON.stringify(this.props.value)); var dragPaths = this.dragState.path.split('-'); dragPaths.pop(); var dragNodeParent = this.findNode(value, dragPaths); var dragNode = dragNodeParent ? dragNodeParent.children[this.dragState.index] : value[this.dragState.index]; var dropNode = this.findNode(value, event.path.split('-')); if (dropNode.children) dropNode.children.push(dragNode);else dropNode.children = [dragNode]; if (dragNodeParent) dragNodeParent.children.splice(this.dragState.index, 1);else value.splice(this.dragState.index, 1); if (this.props.onDragDrop) { this.props.onDragDrop({ originalEvent: event.originalEvent, value: value, dragNode: dragNode, dropNode: dropNode, dropIndex: event.index }); } } } }, { key: "onDropPoint", value: function onDropPoint(event) { if (this.validateDropPoint(event)) { var value = JSON.parse(JSON.stringify(this.props.value)); var dragPaths = this.dragState.path.split('-'); dragPaths.pop(); var dropPaths = event.path.split('-'); dropPaths.pop(); var dragNodeParent = this.findNode(value, dragPaths); var dropNodeParent = this.findNode(value, dropPaths); var dragNode = dragNodeParent ? dragNodeParent.children[this.dragState.index] : value[this.dragState.index]; var siblings = this.areSiblings(this.dragState.path, event.path); if (dragNodeParent) dragNodeParent.children.splice(this.dragState.index, 1);else value.splice(this.dragState.index, 1); if (event.position < 0) { var dropIndex = siblings ? this.dragState.index > event.index ? event.index : event.index - 1 : event.index; if (dropNodeParent) dropNodeParent.children.splice(dropIndex, 0, dragNode);else value.splice(dropIndex, 0, dragNode); } else { if (dropNodeParent) dropNodeParent.children.push(dragNode);else value.push(dragNode); } if (this.props.onDragDrop) { this.props.onDragDrop({ originalEvent: event.originalEvent, value: value, dragNode: dragNode, dropNode: dropNodeParent, dropIndex: event.index }); } } } }, { key: "validateDrop", value: function validateDrop(dragPath, dropPath) { if (!dragPath) { return false; } else { //same node if (dragPath === dropPath) { return false; } //parent dropped on an descendant if (dropPath.indexOf(dragPath) === 0) { return false; } return true; } } }, { key: "validateDropNode", value: function validateDropNode(dragPath, dropPath) { var validateDrop = this.validateDrop(dragPath, dropPath); if (validateDrop) { //child dropped on parent if (dragPath.indexOf('-') > 0 && dragPath.substring(0, dragPath.lastIndexOf('-')) === dropPath) { return false; } return true; } else { return false; } } }, { key: "validateDropPoint", value: function validateDropPoint(event) { var validateDrop = this.validateDrop(this.dragState.path, event.path); if (validateDrop) { //child dropped to next sibling's drop point if (event.position === -1 && this.areSiblings(this.dragState.path, event.path) && this.dragState.index + 1 === event.index) { return false; } return true; } else { return false; } } }, { key: "areSiblings", value: function areSiblings(path1, path2) { if (path1.length === 1 && path2.length === 1) return true;else return path1.substring(0, path1.lastIndexOf('-')) === path2.substring(0, path2.lastIndexOf('-')); } }, { key: "findNode", value: function findNode(value, path) { if (path.length === 0) { return null; } else { var index = parseInt(path[0], 10); var nextSearchRoot = value.children ? value.children[index] : value[index]; if (path.length === 1) { return nextSearchRoot; } else { path.shift(); return this.findNode(nextSearchRoot, path); } } } }, { key: "isNodeLeaf", value: function isNodeLeaf(node) { return node.leaf === false ? false : !(node.children && node.children.length); } }, { key: "onFilterInputKeyDown", value: function onFilterInputKeyDown(event) { //enter if (event.which === 13) { event.preventDefault(); } } }, { key: "onFilterInputChange", value: function onFilterInputChange(event) { this.filterChanged = true; var filterValue = event.target.value; if (this.props.onFilterValueChange) { this.props.onFilterValueChange({ originalEvent: event, value: filterValue }); } else { this.setState({ filterValue: filterValue }); } } }, { key: "filter", value: function filter(value) { this.setState({ filterValue: ObjectUtils.isNotEmpty(value) ? value : '' }, this._filter); } }, { key: "_filter", value: function _filter() { if (!this.filterChanged) { return; } var filterValue = this.getFilterValue(); if (ObjectUtils.isEmpty(filterValue)) { this.filteredNodes = this.props.value; } else { this.filteredNodes = []; var searchFields = this.props.filterBy.split(','); var filterText = filterValue.toLocaleLowerCase(this.props.filterLocale); var isStrictMode = this.props.filterMode === 'strict'; var _iterator = _createForOfIteratorHelper(this.props.value), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var node = _step.value; var copyNode = _objectSpread({}, node); var paramsWithoutNode = { searchFields: searchFields, filterText: filterText, isStrictMode: isStrictMode }; if (isStrictMode && (this.findFilteredNodes(copyNode, paramsWithoutNode) || this.isFilterMatched(copyNode, paramsWithoutNode)) || !isStrictMode && (this.isFilterMatched(copyNode, paramsWithoutNode) || this.findFilteredNodes(copyNode, paramsWithoutNode))) { this.filteredNodes.push(copyNode); } } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } } this.filterChanged = false; } }, { key: "findFilteredNodes", value: function findFilteredNodes(node, paramsWithoutNode) { if (node) { var matched = false; if (node.children) { var childNodes = _toConsumableArray(node.children); node.children = []; var _iterator2 = _createForOfIteratorHelper(childNodes), _step2; try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { var childNode = _step2.value; var copyChildNode = _objectSpread({}, childNode); if (this.isFilterMatched(copyChildNode, paramsWithoutNode)) { matched = true; node.children.push(copyChildNode); } } } catch (err) { _iterator2.e(err); } finally { _iterator2.f(); } } if (matched) { node.expanded = true; return true; } } } }, { key: "isFilterMatched", value: function isFilterMatched(node, _ref) { var searchFields = _ref.searchFields, filterText = _ref.filterText, isStrictMode = _ref.isStrictMode; var matched = false; var _iterator3 = _createForOfIteratorHelper(searchFields), _step3; try { for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { var field = _step3.value; var fieldValue = String(ObjectUtils.resolveFieldData(node, field)).toLocaleLowerCase(this.props.filterLocale); if (fieldValue.indexOf(filterText) > -1) { matched = true; } } } catch (err) { _iterator3.e(err); } finally { _iterator3.f(); } if (!matched || isStrictMode && !this.isNodeLeaf(node)) { matched = this.findFilteredNodes(node, { searchFields: searchFields, filterText: filterText, isStrictMode: isStrictMode }) || matched; } return matched; } }, { key: "renderRootChild", value: function renderRootChild(node, index, last) { return /*#__PURE__*/React.createElement(UITreeNode, { key: node.key || node.label, node: node, index: index, last: last, path: String(index), disabled: this.props.disabled, selectionMode: this.props.selectionMode, selectionKeys: this.props.selectionKeys, onSelectionChange: this.props.onSelectionChange, metaKeySelection: this.props.metaKeySelection, contextMenuSelectionKey: this.props.contextMenuSelectionKey, onContextMenuSelectionChange: this.props.onContextMenuSelectionChange, onContextMenu: this.props.onContextMenu, propagateSelectionDown: this.props.propagateSelectionDown, propagateSelectionUp: this.props.propagateSelectionUp, onExpand: this.props.onExpand, onCollapse: this.props.onCollapse, onSelect: this.props.onSelect, onUnselect: this.props.onUnselect, expandedKeys: this.getExpandedKeys(), onToggle: this.onToggle, nodeTemplate: this.props.nodeTemplate, togglerTemplate: this.props.togglerTemplate, isNodeLeaf: this.isNodeLeaf, dragdropScope: this.props.dragdropScope, onDragStart: this.onDragStart, onDragEnd: this.onDragEnd, onDrop: this.onDrop, onDropPoint: this.onDropPoint, onNodeClick: this.props.onNodeClick, onNodeDoubleClick: this.props.onNodeDoubleClick }); } }, { key: "renderRootChildren", value: function renderRootChildren() { var _this2 = this; if (this.props.filter) { this.filterChanged = true; this._filter(); } var value = this.getRootNode(); return value.map(function (node, index) { return _this2.renderRootChild(node, index, index === value.length - 1); }); } }, { key: "renderModel", value: function renderModel() { if (this.props.value) { var rootNodes = this.renderRootChildren(); var contentClass = classNames('p-tree-container', this.props.contentClassName); return /*#__PURE__*/React.createElement("ul", { className: contentClass, role: "tree", "aria-label": this.props.ariaLabel, "aria-labelledby": this.props.ariaLabelledBy, style: this.props.contentStyle }, rootNodes); } return null; } }, { key: "renderLoader", value: function renderLoader() { if (this.props.loading) { var icon = classNames('p-tree-loading-icon pi-spin', this.props.loadingIcon); return /*#__PURE__*/React.createElement("div", { className: "p-tree-loading-overlay p-component-overlay" }, /*#__PURE__*/React.createElement("i", { className: icon })); } return null; } }, { key: "renderFilter", value: function renderFilter() { if (this.props.filter) { var filterValue = this.getFilterValue(); filterValue = ObjectUtils.isNotEmpty(filterValue) ? filterValue : ''; return /*#__PURE__*/React.createElement("div", { className: "p-tree-filter-container" }, /*#__PURE__*/React.createElement("input", { type: "text", value: filterValue, autoComplete: "off", className: "p-tree-filter p-inputtext p-component", placeholder: this.props.filterPlaceholder, onKeyDown: this.onFilterInputKeyDown, onChange: this.onFilterInputChange, disabled: this.props.disabled }), /*#__PURE__*/React.createElement("span", { className: "p-tree-filter-icon pi pi-search" })); } return null; } }, { key: "renderHeader", value: function renderHeader() { if (this.props.showHeader) { var filterElement = this.renderFilter(); var content = filterElement; if (this.props.header) { var defaultContentOptions = { filterContainerClassName: 'p-tree-filter-container', filterIconClasssName: 'p-tree-filter-icon pi pi-search', filterInput: { className: 'p-tree-filter p-inputtext p-component', onKeyDown: this.onFilterInputKeyDown, onChange: this.onFilterInputChange }, filterElement: filterElement, element: content, props: this.props }; content = ObjectUtils.getJSXElement(this.props.header, defaultContentOptions); } return /*#__PURE__*/React.createElement("div", { className: "p-tree-header" }, content); } return null; } }, { key: "renderFooter", value: function renderFooter() { var content = ObjectUtils.getJSXElement(this.props.footer, this.props); return /*#__PURE__*/React.createElement("div", { className: "p-tree-footer" }, content); } }, { key: "render", value: function render() { var className = classNames('p-tree p-component', this.props.className, { 'p-tree-selectable': this.props.selectionMode, 'p-tree-loading': this.props.loading, 'p-disabled': this.props.disabled }); var loader = this.renderLoader(); var content = this.renderModel(); var header = this.renderHeader(); var footer = this.renderFooter(); return /*#__PURE__*/React.createElement("div", { id: this.props.id, className: className, style: this.props.style }, loader, header, content, footer); } }]); return Tree; }(Component); _defineProperty(Tree, "defaultProps", { id: null, value: null, disabled: false, selectionMode: null, selectionKeys: null, onSelectionChange: null, contextMenuSelectionKey: null, onContextMenuSelectionChange: null, expandedKeys: null, style: null, className: null, contentStyle: null, contentClassName: null, metaKeySelection: true, propagateSelectionUp: true, propagateSelectionDown: true, loading: false, loadingIcon: 'pi pi-spinner', dragdropScope: null, header: null, footer: null, showHeader: true, filter: false, filterValue: null, filterBy: 'label', filterMode: 'lenient', filterPlaceholder: null, filterLocale: undefined, nodeTemplate: null, togglerTemplate: null, onSelect: null, onUnselect: null, onExpand: null, onCollapse: null, onToggle: null, onDragDrop: null, onContextMenu: null, onFilterValueChange: null, onNodeClick: null, onNodeDoubleClick: null }); export { Tree };
ajax/libs/material-ui/4.9.2/esm/Paper/Paper.js
cdnjs/cdnjs
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; import _extends from "@babel/runtime/helpers/esm/extends"; import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import withStyles from '../styles/withStyles'; export var styles = function styles(theme) { var elevations = {}; theme.shadows.forEach(function (shadow, index) { elevations["elevation".concat(index)] = { boxShadow: shadow }; }); return _extends({ /* Styles applied to the root element. */ root: { backgroundColor: theme.palette.background.paper, color: theme.palette.text.primary, transition: theme.transitions.create('box-shadow') }, /* Styles applied to the root element if `square={false}`. */ rounded: { borderRadius: theme.shape.borderRadius }, /* Styles applied to the root element if `variant="outlined"` */ outlined: { border: "1px solid ".concat(theme.palette.divider) } }, elevations); }; var Paper = React.forwardRef(function Paper(props, ref) { var classes = props.classes, className = props.className, _props$component = props.component, Component = _props$component === void 0 ? 'div' : _props$component, _props$square = props.square, square = _props$square === void 0 ? false : _props$square, _props$elevation = props.elevation, elevation = _props$elevation === void 0 ? 1 : _props$elevation, _props$variant = props.variant, variant = _props$variant === void 0 ? 'elevation' : _props$variant, other = _objectWithoutProperties(props, ["classes", "className", "component", "square", "elevation", "variant"]); if (process.env.NODE_ENV !== 'production') { if (classes["elevation".concat(elevation)] === undefined) { console.error("Material-UI: this elevation `".concat(elevation, "` is not implemented.")); } } return React.createElement(Component, _extends({ className: clsx(classes.root, className, variant === 'outlined' ? classes.outlined : classes["elevation".concat(elevation)], !square && classes.rounded), ref: ref }, other)); }); process.env.NODE_ENV !== "production" ? Paper.propTypes = { /** * The content of the component. */ children: PropTypes.node, /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * @ignore */ className: PropTypes.string, /** * The component used for the root node. * Either a string to use a DOM element or a component. */ component: PropTypes.elementType, /** * Shadow depth, corresponds to `dp` in the spec. * It accepts values between 0 and 24 inclusive. */ elevation: PropTypes.number, /** * If `true`, rounded corners are disabled. */ square: PropTypes.bool, /** * The variant to use. */ variant: PropTypes.oneOf(['elevation', 'outlined']) } : void 0; export default withStyles(styles, { name: 'MuiPaper' })(Paper);
ajax/libs/primereact/7.0.1/image/image.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; import { CSSTransition } from 'primereact/csstransition'; import { ZIndexUtils, DomHandler, classNames, ObjectUtils } from 'primereact/utils'; import { Portal } from 'primereact/portal'; import PrimeReact from 'primereact/api'; 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); return Constructor; } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); } 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); } 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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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; } 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 _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; } } var Image = /*#__PURE__*/function (_Component) { _inherits(Image, _Component); var _super = _createSuper(Image); function Image(props) { var _this; _classCallCheck(this, Image); _this = _super.call(this, props); _this.state = { maskVisible: false, previewVisible: false, rotate: 0, scale: 1 }; _this.onImageClick = _this.onImageClick.bind(_assertThisInitialized(_this)); _this.onMaskClick = _this.onMaskClick.bind(_assertThisInitialized(_this)); _this.rotateRight = _this.rotateRight.bind(_assertThisInitialized(_this)); _this.rotateLeft = _this.rotateLeft.bind(_assertThisInitialized(_this)); _this.zoomIn = _this.zoomIn.bind(_assertThisInitialized(_this)); _this.zoomOut = _this.zoomOut.bind(_assertThisInitialized(_this)); _this.onEntering = _this.onEntering.bind(_assertThisInitialized(_this)); _this.onEntered = _this.onEntered.bind(_assertThisInitialized(_this)); _this.onPreviewImageClick = _this.onPreviewImageClick.bind(_assertThisInitialized(_this)); _this.onExit = _this.onExit.bind(_assertThisInitialized(_this)); _this.onExiting = _this.onExiting.bind(_assertThisInitialized(_this)); _this.onExited = _this.onExited.bind(_assertThisInitialized(_this)); _this.previewRef = /*#__PURE__*/React.createRef(); return _this; } _createClass(Image, [{ key: "onImageClick", value: function onImageClick() { var _this2 = this; if (this.props.preview) { this.setState({ maskVisible: true }); setTimeout(function () { _this2.setState({ previewVisible: true }); }, 25); } } }, { key: "onPreviewImageClick", value: function onPreviewImageClick() { this.previewClick = true; } }, { key: "onMaskClick", value: function onMaskClick() { if (!this.previewClick) { this.setState({ previewVisible: false }); this.setState({ rotate: 0 }); this.setState({ scale: 1 }); } this.previewClick = false; } }, { key: "rotateRight", value: function rotateRight() { this.setState(function (prevState) { return { rotate: prevState.rotate + 90 }; }); this.previewClick = true; } }, { key: "rotateLeft", value: function rotateLeft() { this.setState(function (prevState) { return { rotate: prevState.rotate - 90 }; }); this.previewClick = true; } }, { key: "zoomIn", value: function zoomIn() { this.setState(function (prevState) { return { scale: prevState.scale + 0.1 }; }); this.previewClick = true; } }, { key: "zoomOut", value: function zoomOut() { this.setState(function (prevState) { return { scale: prevState.scale - 0.1 }; }); this.previewClick = true; } }, { key: "onEntering", value: function onEntering() { ZIndexUtils.set('modal', this.mask, PrimeReact.autoZIndex, PrimeReact.zIndex['modal']); } }, { key: "onEntered", value: function onEntered() { if (this.props.onShow) { this.props.onShow(); } } }, { key: "onExit", value: function onExit() { DomHandler.addClass(this.mask, 'p-component-overlay-leave'); } }, { key: "onExiting", value: function onExiting() { if (this.props.onHide) { this.props.onHide(); } } }, { key: "onExited", value: function onExited(el) { ZIndexUtils.clear(el); this.setState({ maskVisible: false }); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { if (this.mask) { ZIndexUtils.clear(this.container); } } }, { key: "renderElement", value: function renderElement() { var _this3 = this; var imagePreviewStyle = { transform: 'rotate(' + this.state.rotate + 'deg) scale(' + this.state.scale + ')' }; var zoomDisabled = this.state.scale <= 0.5 || this.state.scale >= 1.5; // const rotateClassName = 'p-image-preview-rotate-' + this.state.rotate; return /*#__PURE__*/React.createElement("div", { ref: function ref(el) { return _this3.mask = el; }, className: "p-image-mask p-component-overlay p-component-overlay-enter", onClick: this.onMaskClick }, /*#__PURE__*/React.createElement("div", { className: "p-image-toolbar" }, /*#__PURE__*/React.createElement("button", { className: "p-image-action p-link", onClick: this.rotateRight, type: "button" }, /*#__PURE__*/React.createElement("i", { className: "pi pi-refresh" })), /*#__PURE__*/React.createElement("button", { className: "p-image-action p-link", onClick: this.rotateLeft, type: "button" }, /*#__PURE__*/React.createElement("i", { className: "pi pi-undo" })), /*#__PURE__*/React.createElement("button", { className: "p-image-action p-link", onClick: this.zoomOut, type: "button", disabled: zoomDisabled }, /*#__PURE__*/React.createElement("i", { className: "pi pi-search-minus" })), /*#__PURE__*/React.createElement("button", { className: "p-image-action p-link", onClick: this.zoomIn, type: "button", disabled: zoomDisabled }, /*#__PURE__*/React.createElement("i", { className: "pi pi-search-plus" })), /*#__PURE__*/React.createElement("button", { className: "p-image-action p-link", type: "button", onClick: this.hidePreview }, /*#__PURE__*/React.createElement("i", { className: "pi pi-times" }))), /*#__PURE__*/React.createElement(CSSTransition, { nodeRef: this.previewRef, classNames: "p-image-preview", in: this.state.previewVisible, timeout: { enter: 150, exit: 150 }, unmountOnExit: true, onEntering: this.onEntering, onEntered: this.onEntered, onExit: this.onExit, onExiting: this.onExiting, onExited: this.onExited }, /*#__PURE__*/React.createElement("div", { ref: this.previewRef }, /*#__PURE__*/React.createElement("img", { src: this.props.src, className: "p-image-preview", style: imagePreviewStyle, onClick: this.onPreviewImageClick, alt: this.props.alt })))); } }, { key: "render", value: function render() { var _this4 = this; var containerClassName = classNames('p-image p-component', this.props.className, { 'p-image-preview-container': this.props.preview }); var element = this.renderElement(); var content = this.props.template ? ObjectUtils.getJSXElement(this.props.template, this.props) : /*#__PURE__*/React.createElement("i", { className: "p-image-preview-icon pi pi-eye" }); var _this$props = this.props, src = _this$props.src, alt = _this$props.alt, width = _this$props.width, height = _this$props.height; return /*#__PURE__*/React.createElement("span", { ref: function ref(el) { return _this4.container = el; }, className: containerClassName, style: this.props.style }, /*#__PURE__*/React.createElement("img", { src: src, className: this.props.imageClassName, width: width, height: height, style: this.props.imageStyle, alt: alt }), this.props.preview && /*#__PURE__*/React.createElement("div", { className: "p-image-preview-indicator", onClick: this.onImageClick }, content), this.state.maskVisible && /*#__PURE__*/React.createElement(Portal, { element: element, appendTo: document.body })); } }]); return Image; }(Component); _defineProperty(Image, "defaultProps", { preview: false, className: null, style: null, imageStyle: null, imageClassName: null, template: null, src: null, alt: null, width: null, height: null }); export { Image };
ajax/libs/material-ui/4.11.2/es/styles/useTheme.js
cdnjs/cdnjs
import { useTheme as useThemeWithoutDefault } from '@material-ui/styles'; import React from 'react'; import defaultTheme from './defaultTheme'; export default function useTheme() { const theme = useThemeWithoutDefault() || defaultTheme; if (process.env.NODE_ENV !== 'production') { // eslint-disable-next-line react-hooks/rules-of-hooks React.useDebugValue(theme); } return theme; }
ajax/libs/react-instantsearch/5.2.0-beta.1/Connectors.js
cdnjs/cdnjs
/*! React InstantSearch 5.2.0-beta.1 | © Algolia, inc. | https://community.algolia.com/react-instantsearch */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) : typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) : (factory((global.ReactInstantSearch = global.ReactInstantSearch || {}, global.ReactInstantSearch.Connectors = {}),global.React)); }(this, (function (exports,React) { 'use strict'; var React__default = 'default' in React ? React['default'] : React; var global$1 = (typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}); // shim for using process in browser // based off https://github.com/defunctzombie/node-process/blob/master/browser.js function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout () { throw new Error('clearTimeout has not been defined'); } var cachedSetTimeout = defaultSetTimout; var cachedClearTimeout = defaultClearTimeout; if (typeof global$1.setTimeout === 'function') { cachedSetTimeout = setTimeout; } if (typeof global$1.clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch(e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch(e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while(len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } function nextTick(fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } } // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; var title = 'browser'; var platform = 'browser'; var browser = true; var env = {}; var argv = []; var version = ''; // empty string to avoid regexp issues var versions = {}; var release = {}; var config = {}; function noop() {} var on = noop; var addListener = noop; var once = noop; var off = noop; var removeListener = noop; var removeAllListeners = noop; var emit = noop; function binding(name) { throw new Error('process.binding is not supported'); } function cwd () { return '/' } function chdir (dir) { throw new Error('process.chdir is not supported'); }function umask() { return 0; } // from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js var performance = global$1.performance || {}; var performanceNow = performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow || function(){ return (new Date()).getTime() }; // generate timestamp or delta // see http://nodejs.org/api/process.html#process_process_hrtime function hrtime(previousTimestamp){ var clocktime = performanceNow.call(performance)*1e-3; var seconds = Math.floor(clocktime); var nanoseconds = Math.floor((clocktime%1)*1e9); if (previousTimestamp) { seconds = seconds - previousTimestamp[0]; nanoseconds = nanoseconds - previousTimestamp[1]; if (nanoseconds<0) { seconds--; nanoseconds += 1e9; } } return [seconds,nanoseconds] } var startTime = new Date(); function uptime() { var currentTime = new Date(); var dif = currentTime - startTime; return dif / 1000; } var process = { nextTick: nextTick, title: title, browser: browser, env: env, argv: argv, version: version, versions: versions, on: on, addListener: addListener, once: once, off: off, removeListener: removeListener, removeAllListeners: removeAllListeners, emit: emit, binding: binding, cwd: cwd, chdir: chdir, umask: umask, hrtime: hrtime, platform: platform, release: release, config: config, uptime: uptime }; var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; function createCommonjsModule(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; } /** * 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 makeEmptyFunction(arg) { return function () { return arg; }; } /** * This function accepts and discards inputs; it has no side effects. This is * primarily useful idiomatically for overridable function endpoints which * always need to be callable, since JS lacks a null-call idiom ala Cocoa. */ var emptyFunction = function emptyFunction() {}; emptyFunction.thatReturns = makeEmptyFunction; emptyFunction.thatReturnsFalse = makeEmptyFunction(false); emptyFunction.thatReturnsTrue = makeEmptyFunction(true); emptyFunction.thatReturnsNull = makeEmptyFunction(null); emptyFunction.thatReturnsThis = function () { return this; }; emptyFunction.thatReturnsArgument = function (arg) { return arg; }; var emptyFunction_1 = emptyFunction; /** * Use invariant() to assert state which your program assumes to be true. * * Provide sprintf-style format (only %s is supported) and arguments * to provide information about what broke and what you were * expecting. * * The invariant message will be stripped in production, but the invariant * will remain to ensure logic does not differ in production. */ var validateFormat = function validateFormat(format) {}; function invariant(condition, format, a, b, c, d, e, f) { validateFormat(format); if (!condition) { var error; if (format === undefined) { error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); } else { var args = [a, b, c, d, e, f]; var argIndex = 0; error = new Error(format.replace(/%s/g, function () { return args[argIndex++]; })); error.name = 'Invariant Violation'; } error.framesToPop = 1; // we don't care about invariant's own frame throw error; } } var invariant_1 = invariant; /* object-assign (c) Sindre Sorhus @license MIT */ /* eslint-disable no-unused-vars */ var getOwnPropertySymbols = Object.getOwnPropertySymbols; var hasOwnProperty = Object.prototype.hasOwnProperty; var propIsEnumerable = Object.prototype.propertyIsEnumerable; function toObject(val) { if (val === null || val === undefined) { throw new TypeError('Object.assign cannot be called with null or undefined'); } return Object(val); } function shouldUseNative() { try { if (!Object.assign) { return false; } // Detect buggy property enumeration order in older V8 versions. // https://bugs.chromium.org/p/v8/issues/detail?id=4118 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers test1[5] = 'de'; if (Object.getOwnPropertyNames(test1)[0] === '5') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test2 = {}; for (var i = 0; i < 10; i++) { test2['_' + String.fromCharCode(i)] = i; } var order2 = Object.getOwnPropertyNames(test2).map(function (n) { return test2[n]; }); if (order2.join('') !== '0123456789') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test3 = {}; 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { test3[letter] = letter; }); if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { return false; } return true; } catch (err) { // We don't expect any of the above to throw, but better to be safe. return false; } } var objectAssign = shouldUseNative() ? Object.assign : function (target, source) { var from; var to = toObject(target); var symbols; for (var s = 1; s < arguments.length; s++) { from = Object(arguments[s]); for (var key in from) { if (hasOwnProperty.call(from, key)) { to[key] = from[key]; } } if (getOwnPropertySymbols) { symbols = getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) { if (propIsEnumerable.call(from, symbols[i])) { to[symbols[i]] = from[symbols[i]]; } } } } return to; }; /** * 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. */ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; var ReactPropTypesSecret_1 = ReactPropTypesSecret; var factoryWithThrowingShims = function() { function shim(props, propName, componentName, location, propFullName, secret) { if (secret === ReactPropTypesSecret_1) { // It is still safe when called from React. return; } invariant_1( false, 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types' ); } shim.isRequired = shim; function getShim() { return shim; } // Important! // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. var ReactPropTypes = { array: shim, bool: shim, func: shim, number: shim, object: shim, string: shim, symbol: shim, any: shim, arrayOf: getShim, element: shim, instanceOf: getShim, node: shim, objectOf: getShim, oneOf: getShim, oneOfType: getShim, shape: getShim, exact: getShim }; ReactPropTypes.checkPropTypes = emptyFunction_1; ReactPropTypes.PropTypes = ReactPropTypes; return ReactPropTypes; }; var propTypes = createCommonjsModule(function (module) { /** * 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. */ { // By explicitly using `prop-types` you are opting into new production behavior. // http://fb.me/prop-types-in-prod module.exports = factoryWithThrowingShims(); } }); /** * Removes all key-value entries from the list cache. * * @private * @name clear * @memberOf ListCache */ function listCacheClear() { this.__data__ = []; this.size = 0; } var _listCacheClear = listCacheClear; /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */ function eq(value, other) { return value === other || (value !== value && other !== other); } var eq_1 = eq; /** * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ function assocIndexOf(array, key) { var length = array.length; while (length--) { if (eq_1(array[length][0], key)) { return length; } } return -1; } var _assocIndexOf = assocIndexOf; /** Used for built-in method references. */ var arrayProto = Array.prototype; /** Built-in value references. */ var splice = arrayProto.splice; /** * Removes `key` and its value from the list cache. * * @private * @name delete * @memberOf ListCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function listCacheDelete(key) { var data = this.__data__, index = _assocIndexOf(data, key); if (index < 0) { return false; } var lastIndex = data.length - 1; if (index == lastIndex) { data.pop(); } else { splice.call(data, index, 1); } --this.size; return true; } var _listCacheDelete = listCacheDelete; /** * Gets the list cache value for `key`. * * @private * @name get * @memberOf ListCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function listCacheGet(key) { var data = this.__data__, index = _assocIndexOf(data, key); return index < 0 ? undefined : data[index][1]; } var _listCacheGet = listCacheGet; /** * Checks if a list cache value for `key` exists. * * @private * @name has * @memberOf ListCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function listCacheHas(key) { return _assocIndexOf(this.__data__, key) > -1; } var _listCacheHas = listCacheHas; /** * Sets the list cache `key` to `value`. * * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. */ function listCacheSet(key, value) { var data = this.__data__, index = _assocIndexOf(data, key); if (index < 0) { ++this.size; data.push([key, value]); } else { data[index][1] = value; } return this; } var _listCacheSet = listCacheSet; /** * Creates an list cache object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function ListCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } // Add methods to `ListCache`. ListCache.prototype.clear = _listCacheClear; ListCache.prototype['delete'] = _listCacheDelete; ListCache.prototype.get = _listCacheGet; ListCache.prototype.has = _listCacheHas; ListCache.prototype.set = _listCacheSet; var _ListCache = ListCache; /** * Removes all key-value entries from the stack. * * @private * @name clear * @memberOf Stack */ function stackClear() { this.__data__ = new _ListCache; this.size = 0; } var _stackClear = stackClear; /** * Removes `key` and its value from the stack. * * @private * @name delete * @memberOf Stack * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function stackDelete(key) { var data = this.__data__, result = data['delete'](key); this.size = data.size; return result; } var _stackDelete = stackDelete; /** * Gets the stack value for `key`. * * @private * @name get * @memberOf Stack * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function stackGet(key) { return this.__data__.get(key); } var _stackGet = stackGet; /** * Checks if a stack value for `key` exists. * * @private * @name has * @memberOf Stack * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function stackHas(key) { return this.__data__.has(key); } var _stackHas = stackHas; /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; var _freeGlobal = freeGlobal; /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = _freeGlobal || freeSelf || Function('return this')(); var _root = root; /** Built-in value references. */ var Symbol$1 = _root.Symbol; var _Symbol = Symbol$1; /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$1 = objectProto.hasOwnProperty; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** Built-in value references. */ var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined; /** * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private * @param {*} value The value to query. * @returns {string} Returns the raw `toStringTag`. */ function getRawTag(value) { var isOwn = hasOwnProperty$1.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = undefined; } catch (e) {} var result = nativeObjectToString.call(value); { if (isOwn) { value[symToStringTag] = tag; } else { delete value[symToStringTag]; } } return result; } var _getRawTag = getRawTag; /** Used for built-in method references. */ var objectProto$1 = Object.prototype; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString$1 = objectProto$1.toString; /** * Converts `value` to a string using `Object.prototype.toString`. * * @private * @param {*} value The value to convert. * @returns {string} Returns the converted string. */ function objectToString(value) { return nativeObjectToString$1.call(value); } var _objectToString = objectToString; /** `Object#toString` result references. */ var nullTag = '[object Null]', undefinedTag = '[object Undefined]'; /** Built-in value references. */ var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined; /** * The base implementation of `getTag` without fallbacks for buggy environments. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ function baseGetTag(value) { if (value == null) { return value === undefined ? undefinedTag : nullTag; } return (symToStringTag$1 && symToStringTag$1 in Object(value)) ? _getRawTag(value) : _objectToString(value); } var _baseGetTag = baseGetTag; /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return value != null && (type == 'object' || type == 'function'); } var isObject_1 = isObject; /** `Object#toString` result references. */ var asyncTag = '[object AsyncFunction]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]', proxyTag = '[object Proxy]'; /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { if (!isObject_1(value)) { return false; } // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 9 which returns 'object' for typed arrays and other constructors. var tag = _baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } var isFunction_1 = isFunction; /** Used to detect overreaching core-js shims. */ var coreJsData = _root['__core-js_shared__']; var _coreJsData = coreJsData; /** Used to detect methods masquerading as native. */ var maskSrcKey = (function() { var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || ''); return uid ? ('Symbol(src)_1.' + uid) : ''; }()); /** * Checks if `func` has its source masked. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ function isMasked(func) { return !!maskSrcKey && (maskSrcKey in func); } var _isMasked = isMasked; /** Used for built-in method references. */ var funcProto = Function.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** * Converts `func` to its source code. * * @private * @param {Function} func The function to convert. * @returns {string} Returns the source code. */ function toSource(func) { if (func != null) { try { return funcToString.call(func); } catch (e) {} try { return (func + ''); } catch (e) {} } return ''; } var _toSource = toSource; /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** Used for built-in method references. */ var funcProto$1 = Function.prototype, objectProto$2 = Object.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString$1 = funcProto$1.toString; /** Used to check objects for own properties. */ var hasOwnProperty$2 = objectProto$2.hasOwnProperty; /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + funcToString$1.call(hasOwnProperty$2).replace(reRegExpChar, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); /** * The base implementation of `_.isNative` without bad shim checks. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. */ function baseIsNative(value) { if (!isObject_1(value) || _isMasked(value)) { return false; } var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor; return pattern.test(_toSource(value)); } var _baseIsNative = baseIsNative; /** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function getValue(object, key) { return object == null ? undefined : object[key]; } var _getValue = getValue; /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { var value = _getValue(object, key); return _baseIsNative(value) ? value : undefined; } var _getNative = getNative; /* Built-in method references that are verified to be native. */ var Map = _getNative(_root, 'Map'); var _Map = Map; /* Built-in method references that are verified to be native. */ var nativeCreate = _getNative(Object, 'create'); var _nativeCreate = nativeCreate; /** * Removes all key-value entries from the hash. * * @private * @name clear * @memberOf Hash */ function hashClear() { this.__data__ = _nativeCreate ? _nativeCreate(null) : {}; this.size = 0; } var _hashClear = hashClear; /** * Removes `key` and its value from the hash. * * @private * @name delete * @memberOf Hash * @param {Object} hash The hash to modify. * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function hashDelete(key) { var result = this.has(key) && delete this.__data__[key]; this.size -= result ? 1 : 0; return result; } var _hashDelete = hashDelete; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** Used for built-in method references. */ var objectProto$3 = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$3 = objectProto$3.hasOwnProperty; /** * Gets the hash value for `key`. * * @private * @name get * @memberOf Hash * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function hashGet(key) { var data = this.__data__; if (_nativeCreate) { var result = data[key]; return result === HASH_UNDEFINED ? undefined : result; } return hasOwnProperty$3.call(data, key) ? data[key] : undefined; } var _hashGet = hashGet; /** Used for built-in method references. */ var objectProto$4 = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$4 = objectProto$4.hasOwnProperty; /** * Checks if a hash value for `key` exists. * * @private * @name has * @memberOf Hash * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function hashHas(key) { var data = this.__data__; return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$4.call(data, key); } var _hashHas = hashHas; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED$1 = '__lodash_hash_undefined__'; /** * Sets the hash `key` to `value`. * * @private * @name set * @memberOf Hash * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the hash instance. */ function hashSet(key, value) { var data = this.__data__; this.size += this.has(key) ? 0 : 1; data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED$1 : value; return this; } var _hashSet = hashSet; /** * Creates a hash object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Hash(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } // Add methods to `Hash`. Hash.prototype.clear = _hashClear; Hash.prototype['delete'] = _hashDelete; Hash.prototype.get = _hashGet; Hash.prototype.has = _hashHas; Hash.prototype.set = _hashSet; var _Hash = Hash; /** * Removes all key-value entries from the map. * * @private * @name clear * @memberOf MapCache */ function mapCacheClear() { this.size = 0; this.__data__ = { 'hash': new _Hash, 'map': new (_Map || _ListCache), 'string': new _Hash }; } var _mapCacheClear = mapCacheClear; /** * Checks if `value` is suitable for use as unique object key. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ function isKeyable(value) { var type = typeof value; return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') ? (value !== '__proto__') : (value === null); } var _isKeyable = isKeyable; /** * Gets the data for `map`. * * @private * @param {Object} map The map to query. * @param {string} key The reference key. * @returns {*} Returns the map data. */ function getMapData(map, key) { var data = map.__data__; return _isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map; } var _getMapData = getMapData; /** * Removes `key` and its value from the map. * * @private * @name delete * @memberOf MapCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function mapCacheDelete(key) { var result = _getMapData(this, key)['delete'](key); this.size -= result ? 1 : 0; return result; } var _mapCacheDelete = mapCacheDelete; /** * Gets the map value for `key`. * * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function mapCacheGet(key) { return _getMapData(this, key).get(key); } var _mapCacheGet = mapCacheGet; /** * Checks if a map value for `key` exists. * * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function mapCacheHas(key) { return _getMapData(this, key).has(key); } var _mapCacheHas = mapCacheHas; /** * Sets the map `key` to `value`. * * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */ function mapCacheSet(key, value) { var data = _getMapData(this, key), size = data.size; data.set(key, value); this.size += data.size == size ? 0 : 1; return this; } var _mapCacheSet = mapCacheSet; /** * Creates a map cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function MapCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } // Add methods to `MapCache`. MapCache.prototype.clear = _mapCacheClear; MapCache.prototype['delete'] = _mapCacheDelete; MapCache.prototype.get = _mapCacheGet; MapCache.prototype.has = _mapCacheHas; MapCache.prototype.set = _mapCacheSet; var _MapCache = MapCache; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; /** * Sets the stack `key` to `value`. * * @private * @name set * @memberOf Stack * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the stack cache instance. */ function stackSet(key, value) { var data = this.__data__; if (data instanceof _ListCache) { var pairs = data.__data__; if (!_Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { pairs.push([key, value]); this.size = ++data.size; return this; } data = this.__data__ = new _MapCache(pairs); } data.set(key, value); this.size = data.size; return this; } var _stackSet = stackSet; /** * Creates a stack cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Stack(entries) { var data = this.__data__ = new _ListCache(entries); this.size = data.size; } // Add methods to `Stack`. Stack.prototype.clear = _stackClear; Stack.prototype['delete'] = _stackDelete; Stack.prototype.get = _stackGet; Stack.prototype.has = _stackHas; Stack.prototype.set = _stackSet; var _Stack = Stack; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED$2 = '__lodash_hash_undefined__'; /** * Adds `value` to the array cache. * * @private * @name add * @memberOf SetCache * @alias push * @param {*} value The value to cache. * @returns {Object} Returns the cache instance. */ function setCacheAdd(value) { this.__data__.set(value, HASH_UNDEFINED$2); return this; } var _setCacheAdd = setCacheAdd; /** * Checks if `value` is in the array cache. * * @private * @name has * @memberOf SetCache * @param {*} value The value to search for. * @returns {number} Returns `true` if `value` is found, else `false`. */ function setCacheHas(value) { return this.__data__.has(value); } var _setCacheHas = setCacheHas; /** * * Creates an array cache object to store unique values. * * @private * @constructor * @param {Array} [values] The values to cache. */ function SetCache(values) { var index = -1, length = values == null ? 0 : values.length; this.__data__ = new _MapCache; while (++index < length) { this.add(values[index]); } } // Add methods to `SetCache`. SetCache.prototype.add = SetCache.prototype.push = _setCacheAdd; SetCache.prototype.has = _setCacheHas; var _SetCache = SetCache; /** * A specialized version of `_.some` 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 any element passes the predicate check, * else `false`. */ function arraySome(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (predicate(array[index], index, array)) { return true; } } return false; } var _arraySome = arraySome; /** * Checks if a `cache` value for `key` exists. * * @private * @param {Object} cache The cache to query. * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function cacheHas(cache, key) { return cache.has(key); } var _cacheHas = cacheHas; /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; /** * A specialized version of `baseIsEqualDeep` for arrays with support for * partial deep comparisons. * * @private * @param {Array} array The array to compare. * @param {Array} other The other array to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `array` and `other` objects. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. */ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length; if (arrLength != othLength && !(isPartial && othLength > arrLength)) { return false; } // Assume cyclic values are equal. var stacked = stack.get(array); if (stacked && stack.get(other)) { return stacked == other; } var index = -1, result = true, seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new _SetCache : undefined; stack.set(array, other); stack.set(other, array); // Ignore non-index properties. while (++index < arrLength) { var arrValue = array[index], othValue = other[index]; if (customizer) { var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); } if (compared !== undefined) { if (compared) { continue; } result = false; break; } // Recursively compare arrays (susceptible to call stack limits). if (seen) { if (!_arraySome(other, function(othValue, othIndex) { if (!_cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { return seen.push(othIndex); } })) { result = false; break; } } else if (!( arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack) )) { result = false; break; } } stack['delete'](array); stack['delete'](other); return result; } var _equalArrays = equalArrays; /** Built-in value references. */ var Uint8Array = _root.Uint8Array; var _Uint8Array = Uint8Array; /** * Converts `map` to its key-value pairs. * * @private * @param {Object} map The map to convert. * @returns {Array} Returns the key-value pairs. */ function mapToArray(map) { var index = -1, result = Array(map.size); map.forEach(function(value, key) { result[++index] = [key, value]; }); return result; } var _mapToArray = mapToArray; /** * Converts `set` to an array of its values. * * @private * @param {Object} set The set to convert. * @returns {Array} Returns the values. */ function setToArray(set) { var index = -1, result = Array(set.size); set.forEach(function(value) { result[++index] = value; }); return result; } var _setToArray = setToArray; /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG$1 = 1, COMPARE_UNORDERED_FLAG$1 = 2; /** `Object#toString` result references. */ var boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', mapTag = '[object Map]', numberTag = '[object Number]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', symbolTag = '[object Symbol]'; var arrayBufferTag = '[object ArrayBuffer]', dataViewTag = '[object DataView]'; /** Used to convert symbols to primitives and strings. */ var symbolProto = _Symbol ? _Symbol.prototype : undefined, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; /** * A specialized version of `baseIsEqualDeep` for comparing objects of * the same `toStringTag`. * * **Note:** This function only supports comparing values with tags of * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {string} tag The `toStringTag` of the objects to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { switch (tag) { case dataViewTag: if ((object.byteLength != other.byteLength) || (object.byteOffset != other.byteOffset)) { return false; } object = object.buffer; other = other.buffer; case arrayBufferTag: if ((object.byteLength != other.byteLength) || !equalFunc(new _Uint8Array(object), new _Uint8Array(other))) { return false; } return true; case boolTag: case dateTag: case numberTag: // Coerce booleans to `1` or `0` and dates to milliseconds. // Invalid dates are coerced to `NaN`. return eq_1(+object, +other); case errorTag: return object.name == other.name && object.message == other.message; case regexpTag: case stringTag: // Coerce regexes to strings and treat strings, primitives and objects, // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring // for more details. return object == (other + ''); case mapTag: var convert = _mapToArray; case setTag: var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1; convert || (convert = _setToArray); if (object.size != other.size && !isPartial) { return false; } // Assume cyclic values are equal. var stacked = stack.get(object); if (stacked) { return stacked == other; } bitmask |= COMPARE_UNORDERED_FLAG$1; // Recursively compare objects (susceptible to call stack limits). stack.set(object, other); var result = _equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); stack['delete'](object); return result; case symbolTag: if (symbolValueOf) { return symbolValueOf.call(object) == symbolValueOf.call(other); } } return false; } var _equalByTag = equalByTag; /** * Appends the elements of `values` to `array`. * * @private * @param {Array} array The array to modify. * @param {Array} values The values to append. * @returns {Array} Returns `array`. */ function arrayPush(array, values) { var index = -1, length = values.length, offset = array.length; while (++index < length) { array[offset + index] = values[index]; } return array; } var _arrayPush = arrayPush; /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; var isArray_1 = isArray; /** * The base implementation of `getAllKeys` and `getAllKeysIn` which uses * `keysFunc` and `symbolsFunc` to get the enumerable property names and * symbols of `object`. * * @private * @param {Object} object The object to query. * @param {Function} keysFunc The function to get the keys of `object`. * @param {Function} symbolsFunc The function to get the symbols of `object`. * @returns {Array} Returns the array of property names and symbols. */ function baseGetAllKeys(object, keysFunc, symbolsFunc) { var result = keysFunc(object); return isArray_1(object) ? result : _arrayPush(result, symbolsFunc(object)); } var _baseGetAllKeys = baseGetAllKeys; /** * A specialized version of `_.filter` 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 {Array} Returns the new filtered array. */ function arrayFilter(array, predicate) { var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result[resIndex++] = value; } } return result; } var _arrayFilter = arrayFilter; /** * This method returns a new empty array. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {Array} Returns the new empty array. * @example * * var arrays = _.times(2, _.stubArray); * * console.log(arrays); * // => [[], []] * * console.log(arrays[0] === arrays[1]); * // => false */ function stubArray() { return []; } var stubArray_1 = stubArray; /** Used for built-in method references. */ var objectProto$5 = Object.prototype; /** Built-in value references. */ var propertyIsEnumerable = objectProto$5.propertyIsEnumerable; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeGetSymbols = Object.getOwnPropertySymbols; /** * Creates an array of the own enumerable symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ var getSymbols = !nativeGetSymbols ? stubArray_1 : function(object) { if (object == null) { return []; } object = Object(object); return _arrayFilter(nativeGetSymbols(object), function(symbol) { return propertyIsEnumerable.call(object, symbol); }); }; var _getSymbols = getSymbols; /** * The base implementation of `_.times` without support for iteratee shorthands * or max array length checks. * * @private * @param {number} n The number of times to invoke `iteratee`. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the array of results. */ function baseTimes(n, iteratee) { var index = -1, result = Array(n); while (++index < n) { result[index] = iteratee(index); } return result; } var _baseTimes = baseTimes; /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return value != null && typeof value == 'object'; } var isObjectLike_1 = isObjectLike; /** `Object#toString` result references. */ var argsTag = '[object Arguments]'; /** * The base implementation of `_.isArguments`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ function baseIsArguments(value) { return isObjectLike_1(value) && _baseGetTag(value) == argsTag; } var _baseIsArguments = baseIsArguments; /** Used for built-in method references. */ var objectProto$6 = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$5 = objectProto$6.hasOwnProperty; /** Built-in value references. */ var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable; /** * Checks if `value` is likely an `arguments` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * * _.isArguments(function() { return arguments; }()); * // => true * * _.isArguments([1, 2, 3]); * // => false */ var isArguments = _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) { return isObjectLike_1(value) && hasOwnProperty$5.call(value, 'callee') && !propertyIsEnumerable$1.call(value, 'callee'); }; var isArguments_1 = isArguments; /** * This method returns `false`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `false`. * @example * * _.times(2, _.stubFalse); * // => [false, false] */ function stubFalse() { return false; } var stubFalse_1 = stubFalse; var isBuffer_1 = createCommonjsModule(function (module, exports) { /** Detect free variable `exports`. */ var freeExports = exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** Built-in value references. */ var Buffer = moduleExports ? _root.Buffer : undefined; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; /** * Checks if `value` is a buffer. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. * @example * * _.isBuffer(new Buffer(2)); * // => true * * _.isBuffer(new Uint8Array(2)); * // => false */ var isBuffer = nativeIsBuffer || stubFalse_1; module.exports = isBuffer; }); /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/; /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { var type = typeof value; length = length == null ? MAX_SAFE_INTEGER : length; return !!length && (type == 'number' || (type != 'symbol' && reIsUint.test(value))) && (value > -1 && value % 1 == 0 && value < length); } var _isIndex = isIndex; /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER$1 = 9007199254740991; /** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1; } var isLength_1 = isLength; /** `Object#toString` result references. */ var argsTag$1 = '[object Arguments]', arrayTag = '[object Array]', boolTag$1 = '[object Boolean]', dateTag$1 = '[object Date]', errorTag$1 = '[object Error]', funcTag$1 = '[object Function]', mapTag$1 = '[object Map]', numberTag$1 = '[object Number]', objectTag = '[object Object]', regexpTag$1 = '[object RegExp]', setTag$1 = '[object Set]', stringTag$1 = '[object String]', weakMapTag = '[object WeakMap]'; var arrayBufferTag$1 = '[object ArrayBuffer]', dataViewTag$1 = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; /** Used to identify `toStringTag` values of typed arrays. */ var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag$1] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag$1] = typedArrayTags[boolTag$1] = typedArrayTags[dataViewTag$1] = typedArrayTags[dateTag$1] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$1] = typedArrayTags[numberTag$1] = typedArrayTags[objectTag] = typedArrayTags[regexpTag$1] = typedArrayTags[setTag$1] = typedArrayTags[stringTag$1] = typedArrayTags[weakMapTag] = false; /** * The base implementation of `_.isTypedArray` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. */ function baseIsTypedArray(value) { return isObjectLike_1(value) && isLength_1(value.length) && !!typedArrayTags[_baseGetTag(value)]; } var _baseIsTypedArray = baseIsTypedArray; /** * The base implementation of `_.unary` without support for storing metadata. * * @private * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. */ function baseUnary(func) { return function(value) { return func(value); }; } var _baseUnary = baseUnary; var _nodeUtil = createCommonjsModule(function (module, exports) { /** Detect free variable `exports`. */ var freeExports = exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** Detect free variable `process` from Node.js. */ var freeProcess = moduleExports && _freeGlobal.process; /** Used to access faster Node.js helpers. */ var nodeUtil = (function() { try { return freeProcess && freeProcess.binding && freeProcess.binding('util'); } catch (e) {} }()); module.exports = nodeUtil; }); /* Node.js helper references. */ var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray; /** * Checks if `value` is classified as a typed array. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. * @example * * _.isTypedArray(new Uint8Array); * // => true * * _.isTypedArray([]); * // => false */ var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray; var isTypedArray_1 = isTypedArray; /** Used for built-in method references. */ var objectProto$7 = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$6 = objectProto$7.hasOwnProperty; /** * Creates an array of the enumerable property names of the array-like `value`. * * @private * @param {*} value The value to query. * @param {boolean} inherited Specify returning inherited property names. * @returns {Array} Returns the array of property names. */ function arrayLikeKeys(value, inherited) { var isArr = isArray_1(value), isArg = !isArr && isArguments_1(value), isBuff = !isArr && !isArg && isBuffer_1(value), isType = !isArr && !isArg && !isBuff && isTypedArray_1(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? _baseTimes(value.length, String) : [], length = result.length; for (var key in value) { if ((inherited || hasOwnProperty$6.call(value, key)) && !(skipIndexes && ( // Safari 9 has enumerable `arguments.length` in strict mode. key == 'length' || // Node.js 0.10 has enumerable non-index properties on buffers. (isBuff && (key == 'offset' || key == 'parent')) || // PhantomJS 2 has enumerable non-index properties on typed arrays. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || // Skip index properties. _isIndex(key, length) ))) { result.push(key); } } return result; } var _arrayLikeKeys = arrayLikeKeys; /** Used for built-in method references. */ var objectProto$8 = Object.prototype; /** * Checks if `value` is likely a prototype object. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ function isPrototype(value) { var Ctor = value && value.constructor, proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$8; return value === proto; } var _isPrototype = isPrototype; /** * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } var _overArg = overArg; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeKeys = _overArg(Object.keys, Object); var _nativeKeys = nativeKeys; /** Used for built-in method references. */ var objectProto$9 = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$7 = objectProto$9.hasOwnProperty; /** * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeys(object) { if (!_isPrototype(object)) { return _nativeKeys(object); } var result = []; for (var key in Object(object)) { if (hasOwnProperty$7.call(object, key) && key != 'constructor') { result.push(key); } } return result; } var _baseKeys = baseKeys; /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * _.isArrayLike([1, 2, 3]); * // => true * * _.isArrayLike(document.body.children); * // => true * * _.isArrayLike('abc'); * // => true * * _.isArrayLike(_.noop); * // => false */ function isArrayLike(value) { return value != null && isLength_1(value.length) && !isFunction_1(value); } var isArrayLike_1 = isArrayLike; /** * Creates an array of the own enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. See the * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * for more details. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keys(new Foo); * // => ['a', 'b'] (iteration order is not guaranteed) * * _.keys('hi'); * // => ['0', '1'] */ function keys(object) { return isArrayLike_1(object) ? _arrayLikeKeys(object) : _baseKeys(object); } var keys_1 = keys; /** * Creates an array of own enumerable property names and symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names and symbols. */ function getAllKeys(object) { return _baseGetAllKeys(object, keys_1, _getSymbols); } var _getAllKeys = getAllKeys; /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG$2 = 1; /** Used for built-in method references. */ var objectProto$a = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$8 = objectProto$a.hasOwnProperty; /** * A specialized version of `baseIsEqualDeep` for objects with support for * partial deep comparisons. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2, objProps = _getAllKeys(object), objLength = objProps.length, othProps = _getAllKeys(other), othLength = othProps.length; if (objLength != othLength && !isPartial) { return false; } var index = objLength; while (index--) { var key = objProps[index]; if (!(isPartial ? key in other : hasOwnProperty$8.call(other, key))) { return false; } } // Assume cyclic values are equal. var stacked = stack.get(object); if (stacked && stack.get(other)) { return stacked == other; } var result = true; stack.set(object, other); stack.set(other, object); var skipCtor = isPartial; while (++index < objLength) { key = objProps[index]; var objValue = object[key], othValue = other[key]; if (customizer) { var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); } // Recursively compare objects (susceptible to call stack limits). if (!(compared === undefined ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) : compared )) { result = false; break; } skipCtor || (skipCtor = key == 'constructor'); } if (result && !skipCtor) { var objCtor = object.constructor, othCtor = other.constructor; // Non `Object` object instances with different constructors are not equal. if (objCtor != othCtor && ('constructor' in object && 'constructor' in other) && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) { result = false; } } stack['delete'](object); stack['delete'](other); return result; } var _equalObjects = equalObjects; /* Built-in method references that are verified to be native. */ var DataView = _getNative(_root, 'DataView'); var _DataView = DataView; /* Built-in method references that are verified to be native. */ var Promise$1 = _getNative(_root, 'Promise'); var _Promise = Promise$1; /* Built-in method references that are verified to be native. */ var Set = _getNative(_root, 'Set'); var _Set = Set; /* Built-in method references that are verified to be native. */ var WeakMap = _getNative(_root, 'WeakMap'); var _WeakMap = WeakMap; /** `Object#toString` result references. */ var mapTag$2 = '[object Map]', objectTag$1 = '[object Object]', promiseTag = '[object Promise]', setTag$2 = '[object Set]', weakMapTag$1 = '[object WeakMap]'; var dataViewTag$2 = '[object DataView]'; /** Used to detect maps, sets, and weakmaps. */ var dataViewCtorString = _toSource(_DataView), mapCtorString = _toSource(_Map), promiseCtorString = _toSource(_Promise), setCtorString = _toSource(_Set), weakMapCtorString = _toSource(_WeakMap); /** * Gets the `toStringTag` of `value`. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ var getTag = _baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. if ((_DataView && getTag(new _DataView(new ArrayBuffer(1))) != dataViewTag$2) || (_Map && getTag(new _Map) != mapTag$2) || (_Promise && getTag(_Promise.resolve()) != promiseTag) || (_Set && getTag(new _Set) != setTag$2) || (_WeakMap && getTag(new _WeakMap) != weakMapTag$1)) { getTag = function(value) { var result = _baseGetTag(value), Ctor = result == objectTag$1 ? value.constructor : undefined, ctorString = Ctor ? _toSource(Ctor) : ''; if (ctorString) { switch (ctorString) { case dataViewCtorString: return dataViewTag$2; case mapCtorString: return mapTag$2; case promiseCtorString: return promiseTag; case setCtorString: return setTag$2; case weakMapCtorString: return weakMapTag$1; } } return result; }; } var _getTag = getTag; /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG$3 = 1; /** `Object#toString` result references. */ var argsTag$2 = '[object Arguments]', arrayTag$1 = '[object Array]', objectTag$2 = '[object Object]'; /** Used for built-in method references. */ var objectProto$b = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$9 = objectProto$b.hasOwnProperty; /** * A specialized version of `baseIsEqual` for arrays and objects which performs * deep comparisons and tracks traversed objects enabling objects with circular * references to be compared. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} [stack] Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { var objIsArr = isArray_1(object), othIsArr = isArray_1(other), objTag = objIsArr ? arrayTag$1 : _getTag(object), othTag = othIsArr ? arrayTag$1 : _getTag(other); objTag = objTag == argsTag$2 ? objectTag$2 : objTag; othTag = othTag == argsTag$2 ? objectTag$2 : othTag; var objIsObj = objTag == objectTag$2, othIsObj = othTag == objectTag$2, isSameTag = objTag == othTag; if (isSameTag && isBuffer_1(object)) { if (!isBuffer_1(other)) { return false; } objIsArr = true; objIsObj = false; } if (isSameTag && !objIsObj) { stack || (stack = new _Stack); return (objIsArr || isTypedArray_1(object)) ? _equalArrays(object, other, bitmask, customizer, equalFunc, stack) : _equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); } if (!(bitmask & COMPARE_PARTIAL_FLAG$3)) { var objIsWrapped = objIsObj && hasOwnProperty$9.call(object, '__wrapped__'), othIsWrapped = othIsObj && hasOwnProperty$9.call(other, '__wrapped__'); if (objIsWrapped || othIsWrapped) { var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; stack || (stack = new _Stack); return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); } } if (!isSameTag) { return false; } stack || (stack = new _Stack); return _equalObjects(object, other, bitmask, customizer, equalFunc, stack); } var _baseIsEqualDeep = baseIsEqualDeep; /** * The base implementation of `_.isEqual` which supports partial comparisons * and tracks traversed objects. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {boolean} bitmask The bitmask flags. * 1 - Unordered comparison * 2 - Partial comparison * @param {Function} [customizer] The function to customize comparisons. * @param {Object} [stack] Tracks traversed `value` and `other` objects. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. */ function baseIsEqual(value, other, bitmask, customizer, stack) { if (value === other) { return true; } if (value == null || other == null || (!isObjectLike_1(value) && !isObjectLike_1(other))) { return value !== value && other !== other; } return _baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); } var _baseIsEqual = baseIsEqual; /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG$4 = 1, COMPARE_UNORDERED_FLAG$2 = 2; /** * The base implementation of `_.isMatch` without support for iteratee shorthands. * * @private * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @param {Array} matchData The property names, values, and compare flags to match. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if `object` is a match, else `false`. */ function baseIsMatch(object, source, matchData, customizer) { var index = matchData.length, length = index, noCustomizer = !customizer; if (object == null) { return !length; } object = Object(object); while (index--) { var data = matchData[index]; if ((noCustomizer && data[2]) ? data[1] !== object[data[0]] : !(data[0] in object) ) { return false; } } while (++index < length) { data = matchData[index]; var key = data[0], objValue = object[key], srcValue = data[1]; if (noCustomizer && data[2]) { if (objValue === undefined && !(key in object)) { return false; } } else { var stack = new _Stack; if (customizer) { var result = customizer(objValue, srcValue, key, object, source, stack); } if (!(result === undefined ? _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$4 | COMPARE_UNORDERED_FLAG$2, customizer, stack) : result )) { return false; } } } return true; } var _baseIsMatch = baseIsMatch; /** * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` if suitable for strict * equality comparisons, else `false`. */ function isStrictComparable(value) { return value === value && !isObject_1(value); } var _isStrictComparable = isStrictComparable; /** * Gets the property names, values, and compare flags of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the match data of `object`. */ function getMatchData(object) { var result = keys_1(object), length = result.length; while (length--) { var key = result[length], value = object[key]; result[length] = [key, value, _isStrictComparable(value)]; } return result; } var _getMatchData = getMatchData; /** * A specialized version of `matchesProperty` for source values suitable * for strict equality comparisons, i.e. `===`. * * @private * @param {string} key The key of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */ function matchesStrictComparable(key, srcValue) { return function(object) { if (object == null) { return false; } return object[key] === srcValue && (srcValue !== undefined || (key in Object(object))); }; } var _matchesStrictComparable = matchesStrictComparable; /** * The base implementation of `_.matches` which doesn't clone `source`. * * @private * @param {Object} source The object of property values to match. * @returns {Function} Returns the new spec function. */ function baseMatches(source) { var matchData = _getMatchData(source); if (matchData.length == 1 && matchData[0][2]) { return _matchesStrictComparable(matchData[0][0], matchData[0][1]); } return function(object) { return object === source || _baseIsMatch(object, source, matchData); }; } var _baseMatches = baseMatches; /** `Object#toString` result references. */ var symbolTag$1 = '[object Symbol]'; /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function isSymbol(value) { return typeof value == 'symbol' || (isObjectLike_1(value) && _baseGetTag(value) == symbolTag$1); } var isSymbol_1 = isSymbol; /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/; /** * Checks if `value` is a property name and not a property path. * * @private * @param {*} value The value to check. * @param {Object} [object] The object to query keys on. * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ function isKey(value, object) { if (isArray_1(value)) { return false; } var type = typeof value; if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol_1(value)) { return true; } return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || (object != null && value in Object(object)); } var _isKey = isKey; /** Error message constants. */ var FUNC_ERROR_TEXT = 'Expected a function'; /** * Creates a function that memoizes the result of `func`. If `resolver` is * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument * provided to the memoized function is used as the map cache key. The `func` * is invoked with the `this` binding of the memoized function. * * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` * constructor with one whose instances implement the * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) * method interface of `clear`, `delete`, `get`, `has`, and `set`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to have its output memoized. * @param {Function} [resolver] The function to resolve the cache key. * @returns {Function} Returns the new memoized function. * @example * * var object = { 'a': 1, 'b': 2 }; * var other = { 'c': 3, 'd': 4 }; * * var values = _.memoize(_.values); * values(object); * // => [1, 2] * * values(other); * // => [3, 4] * * object.a = 2; * values(object); * // => [1, 2] * * // Modify the result cache. * values.cache.set(object, ['a', 'b']); * values(object); * // => ['a', 'b'] * * // Replace `_.memoize.Cache`. * _.memoize.Cache = WeakMap; */ function memoize(func, resolver) { if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { throw new TypeError(FUNC_ERROR_TEXT); } var memoized = function() { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; if (cache.has(key)) { return cache.get(key); } var result = func.apply(this, args); memoized.cache = cache.set(key, result) || cache; return result; }; memoized.cache = new (memoize.Cache || _MapCache); return memoized; } // Expose `MapCache`. memoize.Cache = _MapCache; var memoize_1 = memoize; /** Used as the maximum memoize cache size. */ var MAX_MEMOIZE_SIZE = 500; /** * A specialized version of `_.memoize` which clears the memoized function's * cache when it exceeds `MAX_MEMOIZE_SIZE`. * * @private * @param {Function} func The function to have its output memoized. * @returns {Function} Returns the new memoized function. */ function memoizeCapped(func) { var result = memoize_1(func, function(key) { if (cache.size === MAX_MEMOIZE_SIZE) { cache.clear(); } return key; }); var cache = result.cache; return result; } var _memoizeCapped = memoizeCapped; /** Used to match property names within property paths. */ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g; /** * Converts `string` to a property path array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ var stringToPath = _memoizeCapped(function(string) { var result = []; if (string.charCodeAt(0) === 46 /* . */) { result.push(''); } string.replace(rePropName, function(match, number, quote, subString) { result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); }); return result; }); var _stringToPath = stringToPath; /** * A specialized version of `_.map` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function arrayMap(array, iteratee) { var index = -1, length = array == null ? 0 : array.length, result = Array(length); while (++index < length) { result[index] = iteratee(array[index], index, array); } return result; } var _arrayMap = arrayMap; /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; /** Used to convert symbols to primitives and strings. */ var symbolProto$1 = _Symbol ? _Symbol.prototype : undefined, symbolToString = symbolProto$1 ? symbolProto$1.toString : undefined; /** * The base implementation of `_.toString` which doesn't convert nullish * values to empty strings. * * @private * @param {*} value The value to process. * @returns {string} Returns the string. */ function baseToString(value) { // Exit early for strings to avoid a performance hit in some environments. if (typeof value == 'string') { return value; } if (isArray_1(value)) { // Recursively convert values (susceptible to call stack limits). return _arrayMap(value, baseToString) + ''; } if (isSymbol_1(value)) { return symbolToString ? symbolToString.call(value) : ''; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } var _baseToString = baseToString; /** * Converts `value` to a string. An empty string is returned for `null` * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {string} Returns the converted string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */ function toString(value) { return value == null ? '' : _baseToString(value); } var toString_1 = toString; /** * Casts `value` to a path array if it's not one. * * @private * @param {*} value The value to inspect. * @param {Object} [object] The object to query keys on. * @returns {Array} Returns the cast property path array. */ function castPath(value, object) { if (isArray_1(value)) { return value; } return _isKey(value, object) ? [value] : _stringToPath(toString_1(value)); } var _castPath = castPath; /** Used as references for various `Number` constants. */ var INFINITY$1 = 1 / 0; /** * Converts `value` to a string key if it's not a string or symbol. * * @private * @param {*} value The value to inspect. * @returns {string|symbol} Returns the key. */ function toKey(value) { if (typeof value == 'string' || isSymbol_1(value)) { return value; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result; } var _toKey = toKey; /** * The base implementation of `_.get` without support for default values. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @returns {*} Returns the resolved value. */ function baseGet(object, path) { path = _castPath(path, object); var index = 0, length = path.length; while (object != null && index < length) { object = object[_toKey(path[index++])]; } return (index && index == length) ? object : undefined; } var _baseGet = baseGet; /** * Gets the value at `path` of `object`. If the resolved value is * `undefined`, the `defaultValue` is returned in its place. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.get(object, 'a[0].b.c'); * // => 3 * * _.get(object, ['a', '0', 'b', 'c']); * // => 3 * * _.get(object, 'a.b.c', 'default'); * // => 'default' */ function get(object, path, defaultValue) { var result = object == null ? undefined : _baseGet(object, path); return result === undefined ? defaultValue : result; } var get_1 = get; /** * The base implementation of `_.hasIn` 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 baseHasIn(object, key) { return object != null && key in Object(object); } var _baseHasIn = baseHasIn; /** * Checks if `path` exists on `object`. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @param {Function} hasFunc The function to check properties. * @returns {boolean} Returns `true` if `path` exists, else `false`. */ function hasPath(object, path, hasFunc) { path = _castPath(path, object); var index = -1, length = path.length, result = false; while (++index < length) { var key = _toKey(path[index]); if (!(result = object != null && hasFunc(object, key))) { break; } object = object[key]; } if (result || ++index != length) { return result; } length = object == null ? 0 : object.length; return !!length && isLength_1(length) && _isIndex(key, length) && (isArray_1(object) || isArguments_1(object)); } var _hasPath = hasPath; /** * Checks if `path` is a direct or inherited property of `object`. * * @static * @memberOf _ * @since 4.0.0 * @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 = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.hasIn(object, 'a'); * // => true * * _.hasIn(object, 'a.b'); * // => true * * _.hasIn(object, ['a', 'b']); * // => true * * _.hasIn(object, 'b'); * // => false */ function hasIn(object, path) { return object != null && _hasPath(object, path, _baseHasIn); } var hasIn_1 = hasIn; /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG$5 = 1, COMPARE_UNORDERED_FLAG$3 = 2; /** * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. * * @private * @param {string} path The path of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */ function baseMatchesProperty(path, srcValue) { if (_isKey(path) && _isStrictComparable(srcValue)) { return _matchesStrictComparable(_toKey(path), srcValue); } return function(object) { var objValue = get_1(object, path); return (objValue === undefined && objValue === srcValue) ? hasIn_1(object, path) : _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$5 | COMPARE_UNORDERED_FLAG$3); }; } var _baseMatchesProperty = baseMatchesProperty; /** * This method returns the first argument it receives. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {*} value Any value. * @returns {*} Returns `value`. * @example * * var object = { 'a': 1 }; * * console.log(_.identity(object) === object); * // => true */ function identity(value) { return value; } var identity_1 = identity; /** * The base implementation of `_.property` without support for deep paths. * * @private * @param {string} key The key of the property to get. * @returns {Function} Returns the new accessor function. */ function baseProperty(key) { return function(object) { return object == null ? undefined : object[key]; }; } var _baseProperty = baseProperty; /** * A specialized version of `baseProperty` which supports deep paths. * * @private * @param {Array|string} path The path of the property to get. * @returns {Function} Returns the new accessor function. */ function basePropertyDeep(path) { return function(object) { return _baseGet(object, path); }; } var _basePropertyDeep = basePropertyDeep; /** * Creates a function that returns the value at `path` of a given object. * * @static * @memberOf _ * @since 2.4.0 * @category Util * @param {Array|string} path The path of the property to get. * @returns {Function} Returns the new accessor function. * @example * * var objects = [ * { 'a': { 'b': 2 } }, * { 'a': { 'b': 1 } } * ]; * * _.map(objects, _.property('a.b')); * // => [2, 1] * * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); * // => [1, 2] */ function property(path) { return _isKey(path) ? _baseProperty(_toKey(path)) : _basePropertyDeep(path); } var property_1 = property; /** * The base implementation of `_.iteratee`. * * @private * @param {*} [value=_.identity] The value to convert to an iteratee. * @returns {Function} Returns the iteratee. */ function baseIteratee(value) { // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. if (typeof value == 'function') { return value; } if (value == null) { return identity_1; } if (typeof value == 'object') { return isArray_1(value) ? _baseMatchesProperty(value[0], value[1]) : _baseMatches(value); } return property_1(value); } var _baseIteratee = baseIteratee; /** * Creates a `_.find` or `_.findLast` function. * * @private * @param {Function} findIndexFunc The function to find the collection index. * @returns {Function} Returns the new find function. */ function createFind(findIndexFunc) { return function(collection, predicate, fromIndex) { var iterable = Object(collection); if (!isArrayLike_1(collection)) { var iteratee = _baseIteratee(predicate, 3); collection = keys_1(collection); predicate = function(key) { return iteratee(iterable[key], key, iterable); }; } var index = findIndexFunc(collection, predicate, fromIndex); return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; }; } var _createFind = createFind; /** * The base implementation of `_.findIndex` and `_.findLastIndex` without * support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} predicate The function invoked per iteration. * @param {number} fromIndex The index to search from. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseFindIndex(array, predicate, fromIndex, fromRight) { var length = array.length, index = fromIndex + (fromRight ? 1 : -1); while ((fromRight ? index-- : ++index < length)) { if (predicate(array[index], index, array)) { return index; } } return -1; } var _baseFindIndex = baseFindIndex; /** Used as references for various `Number` constants. */ var NAN = 0 / 0; /** Used to match leading and trailing whitespace. */ var reTrim = /^\s+|\s+$/g; /** Used to detect bad signed hexadecimal string values. */ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; /** Used to detect binary string values. */ var reIsBinary = /^0b[01]+$/i; /** Used to detect octal string values. */ var reIsOctal = /^0o[0-7]+$/i; /** Built-in method references without a dependency on `root`. */ var freeParseInt = parseInt; /** * Converts `value` to a number. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {number} Returns the number. * @example * * _.toNumber(3.2); * // => 3.2 * * _.toNumber(Number.MIN_VALUE); * // => 5e-324 * * _.toNumber(Infinity); * // => Infinity * * _.toNumber('3.2'); * // => 3.2 */ function toNumber(value) { if (typeof value == 'number') { return value; } if (isSymbol_1(value)) { return NAN; } if (isObject_1(value)) { var other = typeof value.valueOf == 'function' ? value.valueOf() : value; value = isObject_1(other) ? (other + '') : other; } if (typeof value != 'string') { return value === 0 ? value : +value; } value = value.replace(reTrim, ''); var isBinary = reIsBinary.test(value); return (isBinary || reIsOctal.test(value)) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : (reIsBadHex.test(value) ? NAN : +value); } var toNumber_1 = toNumber; /** Used as references for various `Number` constants. */ var INFINITY$2 = 1 / 0, MAX_INTEGER = 1.7976931348623157e+308; /** * Converts `value` to a finite number. * * @static * @memberOf _ * @since 4.12.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted number. * @example * * _.toFinite(3.2); * // => 3.2 * * _.toFinite(Number.MIN_VALUE); * // => 5e-324 * * _.toFinite(Infinity); * // => 1.7976931348623157e+308 * * _.toFinite('3.2'); * // => 3.2 */ function toFinite(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber_1(value); if (value === INFINITY$2 || value === -INFINITY$2) { var sign = (value < 0 ? -1 : 1); return sign * MAX_INTEGER; } return value === value ? value : 0; } var toFinite_1 = toFinite; /** * Converts `value` to an integer. * * **Note:** This method is loosely based on * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toInteger(3.2); * // => 3 * * _.toInteger(Number.MIN_VALUE); * // => 0 * * _.toInteger(Infinity); * // => 1.7976931348623157e+308 * * _.toInteger('3.2'); * // => 3 */ function toInteger(value) { var result = toFinite_1(value), remainder = result % 1; return result === result ? (remainder ? result - remainder : result) : 0; } var toInteger_1 = toInteger; /* 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_1(fromIndex); if (index < 0) { index = nativeMax(length + index, 0); } return _baseFindIndex(array, _baseIteratee(predicate, 3), index); } var findIndex_1 = findIndex; /** * 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_1); var find_1 = find; /** `Object#toString` result references. */ var mapTag$3 = '[object Map]', setTag$3 = '[object Set]'; /** Used for built-in method references. */ var objectProto$c = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$a = objectProto$c.hasOwnProperty; /** * Checks if `value` is an empty object, collection, map, or set. * * Objects are considered empty if they have no own enumerable string keyed * properties. * * Array-like values such as `arguments` objects, arrays, buffers, strings, or * jQuery-like collections are considered empty if they have a `length` of `0`. * Similarly, maps and sets are considered empty if they have a `size` of `0`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is empty, else `false`. * @example * * _.isEmpty(null); * // => true * * _.isEmpty(true); * // => true * * _.isEmpty(1); * // => true * * _.isEmpty([1, 2, 3]); * // => false * * _.isEmpty({ 'a': 1 }); * // => false */ function isEmpty(value) { if (value == null) { return true; } if (isArrayLike_1(value) && (isArray_1(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer_1(value) || isTypedArray_1(value) || isArguments_1(value))) { return !value.length; } var tag = _getTag(value); if (tag == mapTag$3 || tag == setTag$3) { return !value.size; } if (_isPrototype(value)) { return !_baseKeys(value).length; } for (var key in value) { if (hasOwnProperty$a.call(value, key)) { return false; } } return true; } var isEmpty_1 = isEmpty; /** * A specialized version of `_.forEach` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEach(array, iteratee) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (iteratee(array[index], index, array) === false) { break; } } return array; } var _arrayEach = arrayEach; var defineProperty = (function() { try { var func = _getNative(Object, 'defineProperty'); func({}, '', {}); return func; } catch (e) {} }()); var _defineProperty = defineProperty; /** * The base implementation of `assignValue` and `assignMergeValue` without * value checks. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function baseAssignValue(object, key, value) { if (key == '__proto__' && _defineProperty) { _defineProperty(object, key, { 'configurable': true, 'enumerable': true, 'value': value, 'writable': true }); } else { object[key] = value; } } var _baseAssignValue = baseAssignValue; /** Used for built-in method references. */ var objectProto$d = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$b = objectProto$d.hasOwnProperty; /** * Assigns `value` to `key` of `object` if the existing value is not equivalent * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty$b.call(object, key) && eq_1(objValue, value)) || (value === undefined && !(key in object))) { _baseAssignValue(object, key, value); } } var _assignValue = assignValue; /** * Copies properties of `source` to `object`. * * @private * @param {Object} source The object to copy properties from. * @param {Array} props The property identifiers to copy. * @param {Object} [object={}] The object to copy properties to. * @param {Function} [customizer] The function to customize copied values. * @returns {Object} Returns `object`. */ function copyObject(source, props, object, customizer) { var isNew = !object; object || (object = {}); var index = -1, length = props.length; while (++index < length) { var key = props[index]; var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined; if (newValue === undefined) { newValue = source[key]; } if (isNew) { _baseAssignValue(object, key, newValue); } else { _assignValue(object, key, newValue); } } return object; } var _copyObject = copyObject; /** * The base implementation of `_.assign` without support for multiple sources * or `customizer` functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @returns {Object} Returns `object`. */ function baseAssign(object, source) { return object && _copyObject(source, keys_1(source), object); } var _baseAssign = baseAssign; /** * This function is like * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * except that it includes inherited enumerable properties. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function nativeKeysIn(object) { var result = []; if (object != null) { for (var key in Object(object)) { result.push(key); } } return result; } var _nativeKeysIn = nativeKeysIn; /** Used for built-in method references. */ var objectProto$e = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$c = objectProto$e.hasOwnProperty; /** * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeysIn(object) { if (!isObject_1(object)) { return _nativeKeysIn(object); } var isProto = _isPrototype(object), result = []; for (var key in object) { if (!(key == 'constructor' && (isProto || !hasOwnProperty$c.call(object, key)))) { result.push(key); } } return result; } var _baseKeysIn = baseKeysIn; /** * Creates an array of the own and inherited enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keysIn(new Foo); * // => ['a', 'b', 'c'] (iteration order is not guaranteed) */ function keysIn$1(object) { return isArrayLike_1(object) ? _arrayLikeKeys(object, true) : _baseKeysIn(object); } var keysIn_1 = keysIn$1; /** * The base implementation of `_.assignIn` without support for multiple sources * or `customizer` functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @returns {Object} Returns `object`. */ function baseAssignIn(object, source) { return object && _copyObject(source, keysIn_1(source), object); } var _baseAssignIn = baseAssignIn; var _cloneBuffer = createCommonjsModule(function (module, exports) { /** Detect free variable `exports`. */ var freeExports = exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** Built-in value references. */ var Buffer = moduleExports ? _root.Buffer : undefined, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; /** * Creates a clone of `buffer`. * * @private * @param {Buffer} buffer The buffer to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Buffer} Returns the cloned buffer. */ function cloneBuffer(buffer, isDeep) { if (isDeep) { return buffer.slice(); } var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); buffer.copy(result); return result; } module.exports = cloneBuffer; }); /** * Copies the values of `source` to `array`. * * @private * @param {Array} source The array to copy values from. * @param {Array} [array=[]] The array to copy values to. * @returns {Array} Returns `array`. */ function copyArray(source, array) { var index = -1, length = source.length; array || (array = Array(length)); while (++index < length) { array[index] = source[index]; } return array; } var _copyArray = copyArray; /** * Copies own symbols of `source` to `object`. * * @private * @param {Object} source The object to copy symbols from. * @param {Object} [object={}] The object to copy symbols to. * @returns {Object} Returns `object`. */ function copySymbols(source, object) { return _copyObject(source, _getSymbols(source), object); } var _copySymbols = copySymbols; /** Built-in value references. */ var getPrototype = _overArg(Object.getPrototypeOf, Object); var _getPrototype = getPrototype; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeGetSymbols$1 = Object.getOwnPropertySymbols; /** * Creates an array of the own and inherited enumerable symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ var getSymbolsIn = !nativeGetSymbols$1 ? stubArray_1 : function(object) { var result = []; while (object) { _arrayPush(result, _getSymbols(object)); object = _getPrototype(object); } return result; }; var _getSymbolsIn = getSymbolsIn; /** * Copies own and inherited symbols of `source` to `object`. * * @private * @param {Object} source The object to copy symbols from. * @param {Object} [object={}] The object to copy symbols to. * @returns {Object} Returns `object`. */ function copySymbolsIn(source, object) { return _copyObject(source, _getSymbolsIn(source), object); } var _copySymbolsIn = copySymbolsIn; /** * Creates an array of own and inherited enumerable property names and * symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names and symbols. */ function getAllKeysIn(object) { return _baseGetAllKeys(object, keysIn_1, _getSymbolsIn); } var _getAllKeysIn = getAllKeysIn; /** Used for built-in method references. */ var objectProto$f = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$d = objectProto$f.hasOwnProperty; /** * Initializes an array clone. * * @private * @param {Array} array The array to clone. * @returns {Array} Returns the initialized clone. */ function initCloneArray(array) { var length = array.length, result = new array.constructor(length); // Add properties assigned by `RegExp#exec`. if (length && typeof array[0] == 'string' && hasOwnProperty$d.call(array, 'index')) { result.index = array.index; result.input = array.input; } return result; } var _initCloneArray = initCloneArray; /** * Creates a clone of `arrayBuffer`. * * @private * @param {ArrayBuffer} arrayBuffer The array buffer to clone. * @returns {ArrayBuffer} Returns the cloned array buffer. */ function cloneArrayBuffer(arrayBuffer) { var result = new arrayBuffer.constructor(arrayBuffer.byteLength); new _Uint8Array(result).set(new _Uint8Array(arrayBuffer)); return result; } var _cloneArrayBuffer = cloneArrayBuffer; /** * Creates a clone of `dataView`. * * @private * @param {Object} dataView The data view to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned data view. */ function cloneDataView(dataView, isDeep) { var buffer = isDeep ? _cloneArrayBuffer(dataView.buffer) : dataView.buffer; return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); } var _cloneDataView = cloneDataView; /** Used to match `RegExp` flags from their coerced string values. */ var reFlags = /\w*$/; /** * Creates a clone of `regexp`. * * @private * @param {Object} regexp The regexp to clone. * @returns {Object} Returns the cloned regexp. */ function cloneRegExp(regexp) { var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); result.lastIndex = regexp.lastIndex; return result; } var _cloneRegExp = cloneRegExp; /** Used to convert symbols to primitives and strings. */ var symbolProto$2 = _Symbol ? _Symbol.prototype : undefined, symbolValueOf$1 = symbolProto$2 ? symbolProto$2.valueOf : undefined; /** * Creates a clone of the `symbol` object. * * @private * @param {Object} symbol The symbol object to clone. * @returns {Object} Returns the cloned symbol object. */ function cloneSymbol(symbol) { return symbolValueOf$1 ? Object(symbolValueOf$1.call(symbol)) : {}; } var _cloneSymbol = cloneSymbol; /** * Creates a clone of `typedArray`. * * @private * @param {Object} typedArray The typed array to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned typed array. */ function cloneTypedArray(typedArray, isDeep) { var buffer = isDeep ? _cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } var _cloneTypedArray = cloneTypedArray; /** `Object#toString` result references. */ var boolTag$2 = '[object Boolean]', dateTag$2 = '[object Date]', mapTag$4 = '[object Map]', numberTag$2 = '[object Number]', regexpTag$2 = '[object RegExp]', setTag$4 = '[object Set]', stringTag$2 = '[object String]', symbolTag$2 = '[object Symbol]'; var arrayBufferTag$2 = '[object ArrayBuffer]', dataViewTag$3 = '[object DataView]', float32Tag$1 = '[object Float32Array]', float64Tag$1 = '[object Float64Array]', int8Tag$1 = '[object Int8Array]', int16Tag$1 = '[object Int16Array]', int32Tag$1 = '[object Int32Array]', uint8Tag$1 = '[object Uint8Array]', uint8ClampedTag$1 = '[object Uint8ClampedArray]', uint16Tag$1 = '[object Uint16Array]', uint32Tag$1 = '[object Uint32Array]'; /** * Initializes an object clone based on its `toStringTag`. * * **Note:** This function only supports cloning values with tags of * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. * * @private * @param {Object} object The object to clone. * @param {string} tag The `toStringTag` of the object to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the initialized clone. */ function initCloneByTag(object, tag, isDeep) { var Ctor = object.constructor; switch (tag) { case arrayBufferTag$2: return _cloneArrayBuffer(object); case boolTag$2: case dateTag$2: return new Ctor(+object); case dataViewTag$3: return _cloneDataView(object, isDeep); case float32Tag$1: case float64Tag$1: case int8Tag$1: case int16Tag$1: case int32Tag$1: case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1: return _cloneTypedArray(object, isDeep); case mapTag$4: return new Ctor; case numberTag$2: case stringTag$2: return new Ctor(object); case regexpTag$2: return _cloneRegExp(object); case setTag$4: return new Ctor; case symbolTag$2: return _cloneSymbol(object); } } var _initCloneByTag = initCloneByTag; /** Built-in value references. */ var objectCreate = Object.create; /** * The base implementation of `_.create` without support for assigning * properties to the created object. * * @private * @param {Object} proto The object to inherit from. * @returns {Object} Returns the new object. */ var baseCreate = (function() { function object() {} return function(proto) { if (!isObject_1(proto)) { return {}; } if (objectCreate) { return objectCreate(proto); } object.prototype = proto; var result = new object; object.prototype = undefined; return result; }; }()); var _baseCreate = baseCreate; /** * Initializes an object clone. * * @private * @param {Object} object The object to clone. * @returns {Object} Returns the initialized clone. */ function initCloneObject(object) { return (typeof object.constructor == 'function' && !_isPrototype(object)) ? _baseCreate(_getPrototype(object)) : {}; } var _initCloneObject = initCloneObject; /** `Object#toString` result references. */ var mapTag$5 = '[object Map]'; /** * The base implementation of `_.isMap` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a map, else `false`. */ function baseIsMap(value) { return isObjectLike_1(value) && _getTag(value) == mapTag$5; } var _baseIsMap = baseIsMap; /* Node.js helper references. */ var nodeIsMap = _nodeUtil && _nodeUtil.isMap; /** * Checks if `value` is classified as a `Map` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a map, else `false`. * @example * * _.isMap(new Map); * // => true * * _.isMap(new WeakMap); * // => false */ var isMap = nodeIsMap ? _baseUnary(nodeIsMap) : _baseIsMap; var isMap_1 = isMap; /** `Object#toString` result references. */ var setTag$5 = '[object Set]'; /** * The base implementation of `_.isSet` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a set, else `false`. */ function baseIsSet(value) { return isObjectLike_1(value) && _getTag(value) == setTag$5; } var _baseIsSet = baseIsSet; /* Node.js helper references. */ var nodeIsSet = _nodeUtil && _nodeUtil.isSet; /** * Checks if `value` is classified as a `Set` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a set, else `false`. * @example * * _.isSet(new Set); * // => true * * _.isSet(new WeakSet); * // => false */ var isSet = nodeIsSet ? _baseUnary(nodeIsSet) : _baseIsSet; var isSet_1 = isSet; /** Used to compose bitmasks for cloning. */ var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4; /** `Object#toString` result references. */ var argsTag$3 = '[object Arguments]', arrayTag$2 = '[object Array]', boolTag$3 = '[object Boolean]', dateTag$3 = '[object Date]', errorTag$2 = '[object Error]', funcTag$2 = '[object Function]', genTag$1 = '[object GeneratorFunction]', mapTag$6 = '[object Map]', numberTag$3 = '[object Number]', objectTag$3 = '[object Object]', regexpTag$3 = '[object RegExp]', setTag$6 = '[object Set]', stringTag$3 = '[object String]', symbolTag$3 = '[object Symbol]', weakMapTag$2 = '[object WeakMap]'; var arrayBufferTag$3 = '[object ArrayBuffer]', dataViewTag$4 = '[object DataView]', float32Tag$2 = '[object Float32Array]', float64Tag$2 = '[object Float64Array]', int8Tag$2 = '[object Int8Array]', int16Tag$2 = '[object Int16Array]', int32Tag$2 = '[object Int32Array]', uint8Tag$2 = '[object Uint8Array]', uint8ClampedTag$2 = '[object Uint8ClampedArray]', uint16Tag$2 = '[object Uint16Array]', uint32Tag$2 = '[object Uint32Array]'; /** Used to identify `toStringTag` values supported by `_.clone`. */ var cloneableTags = {}; cloneableTags[argsTag$3] = cloneableTags[arrayTag$2] = cloneableTags[arrayBufferTag$3] = cloneableTags[dataViewTag$4] = cloneableTags[boolTag$3] = cloneableTags[dateTag$3] = cloneableTags[float32Tag$2] = cloneableTags[float64Tag$2] = cloneableTags[int8Tag$2] = cloneableTags[int16Tag$2] = cloneableTags[int32Tag$2] = cloneableTags[mapTag$6] = cloneableTags[numberTag$3] = cloneableTags[objectTag$3] = cloneableTags[regexpTag$3] = cloneableTags[setTag$6] = cloneableTags[stringTag$3] = cloneableTags[symbolTag$3] = cloneableTags[uint8Tag$2] = cloneableTags[uint8ClampedTag$2] = cloneableTags[uint16Tag$2] = cloneableTags[uint32Tag$2] = true; cloneableTags[errorTag$2] = cloneableTags[funcTag$2] = cloneableTags[weakMapTag$2] = false; /** * The base implementation of `_.clone` and `_.cloneDeep` which tracks * traversed objects. * * @private * @param {*} value The value to clone. * @param {boolean} bitmask The bitmask flags. * 1 - Deep clone * 2 - Flatten inherited properties * 4 - Clone symbols * @param {Function} [customizer] The function to customize cloning. * @param {string} [key] The key of `value`. * @param {Object} [object] The parent object of `value`. * @param {Object} [stack] Tracks traversed objects and their clone counterparts. * @returns {*} Returns the cloned value. */ function baseClone(value, bitmask, customizer, key, object, stack) { var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG; if (customizer) { result = object ? customizer(value, key, object, stack) : customizer(value); } if (result !== undefined) { return result; } if (!isObject_1(value)) { return value; } var isArr = isArray_1(value); if (isArr) { result = _initCloneArray(value); if (!isDeep) { return _copyArray(value, result); } } else { var tag = _getTag(value), isFunc = tag == funcTag$2 || tag == genTag$1; if (isBuffer_1(value)) { return _cloneBuffer(value, isDeep); } if (tag == objectTag$3 || tag == argsTag$3 || (isFunc && !object)) { result = (isFlat || isFunc) ? {} : _initCloneObject(value); if (!isDeep) { return isFlat ? _copySymbolsIn(value, _baseAssignIn(result, value)) : _copySymbols(value, _baseAssign(result, value)); } } else { if (!cloneableTags[tag]) { return object ? value : {}; } result = _initCloneByTag(value, tag, isDeep); } } // Check for circular references and return its corresponding clone. stack || (stack = new _Stack); var stacked = stack.get(value); if (stacked) { return stacked; } stack.set(value, result); if (isSet_1(value)) { value.forEach(function(subValue) { result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); }); return result; } if (isMap_1(value)) { value.forEach(function(subValue, key) { result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); }); return result; } var keysFunc = isFull ? (isFlat ? _getAllKeysIn : _getAllKeys) : (isFlat ? keysIn : keys_1); var props = isArr ? undefined : keysFunc(value); _arrayEach(props || value, function(subValue, key) { if (props) { key = subValue; subValue = value[key]; } // Recursively populate clone (susceptible to call stack limits). _assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); }); return result; } var _baseClone = baseClone; /** * Gets the last element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @returns {*} Returns the last element of `array`. * @example * * _.last([1, 2, 3]); * // => 3 */ function last(array) { var length = array == null ? 0 : array.length; return length ? array[length - 1] : undefined; } var last_1 = last; /** * The base implementation of `_.slice` without an iteratee call guard. * * @private * @param {Array} array The array to slice. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. */ function baseSlice(array, start, end) { var index = -1, length = array.length; if (start < 0) { start = -start > length ? 0 : (length + start); } end = end > length ? length : end; if (end < 0) { end += length; } length = start > end ? 0 : ((end - start) >>> 0); start >>>= 0; var result = Array(length); while (++index < length) { result[index] = array[index + start]; } return result; } var _baseSlice = baseSlice; /** * Gets the parent value at `path` of `object`. * * @private * @param {Object} object The object to query. * @param {Array} path The path to get the parent value of. * @returns {*} Returns the parent value. */ function parent(object, path) { return path.length < 2 ? object : _baseGet(object, _baseSlice(path, 0, -1)); } var _parent = parent; /** * The base implementation of `_.unset`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The property path to unset. * @returns {boolean} Returns `true` if the property is deleted, else `false`. */ function baseUnset(object, path) { path = _castPath(path, object); object = _parent(object, path); return object == null || delete object[_toKey(last_1(path))]; } var _baseUnset = baseUnset; /** `Object#toString` result references. */ var objectTag$4 = '[object Object]'; /** Used for built-in method references. */ var funcProto$2 = Function.prototype, objectProto$g = Object.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString$2 = funcProto$2.toString; /** Used to check objects for own properties. */ var hasOwnProperty$e = objectProto$g.hasOwnProperty; /** Used to infer the `Object` constructor. */ var objectCtorString = funcToString$2.call(Object); /** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @static * @memberOf _ * @since 0.8.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * * function Foo() { * this.a = 1; * } * * _.isPlainObject(new Foo); * // => false * * _.isPlainObject([1, 2, 3]); * // => false * * _.isPlainObject({ 'x': 0, 'y': 0 }); * // => true * * _.isPlainObject(Object.create(null)); * // => true */ function isPlainObject(value) { if (!isObjectLike_1(value) || _baseGetTag(value) != objectTag$4) { return false; } var proto = _getPrototype(value); if (proto === null) { return true; } var Ctor = hasOwnProperty$e.call(proto, 'constructor') && proto.constructor; return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString$2.call(Ctor) == objectCtorString; } var isPlainObject_1 = isPlainObject; /** * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain * objects. * * @private * @param {*} value The value to inspect. * @param {string} key The key of the property to inspect. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. */ function customOmitClone(value) { return isPlainObject_1(value) ? undefined : value; } var _customOmitClone = customOmitClone; /** Built-in value references. */ var spreadableSymbol = _Symbol ? _Symbol.isConcatSpreadable : undefined; /** * Checks if `value` is a flattenable `arguments` object or array. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ function isFlattenable(value) { return isArray_1(value) || isArguments_1(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); } var _isFlattenable = isFlattenable; /** * The base implementation of `_.flatten` with support for restricting flattening. * * @private * @param {Array} array The array to flatten. * @param {number} depth The maximum recursion depth. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. * @param {Array} [result=[]] The initial result value. * @returns {Array} Returns the new flattened array. */ function baseFlatten(array, depth, predicate, isStrict, result) { var index = -1, length = array.length; predicate || (predicate = _isFlattenable); result || (result = []); while (++index < length) { var value = array[index]; if (depth > 0 && predicate(value)) { if (depth > 1) { // Recursively flatten arrays (susceptible to call stack limits). baseFlatten(value, depth - 1, predicate, isStrict, result); } else { _arrayPush(result, value); } } else if (!isStrict) { result[result.length] = value; } } return result; } var _baseFlatten = baseFlatten; /** * Flattens `array` a single level deep. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * * _.flatten([1, [2, [3, [4]], 5]]); * // => [1, 2, [3, [4]], 5] */ function flatten(array) { var length = array == null ? 0 : array.length; return length ? _baseFlatten(array, 1) : []; } var flatten_1 = flatten; /** * A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. * * @private * @param {Function} func The function to invoke. * @param {*} thisArg The `this` binding of `func`. * @param {Array} args The arguments to invoke `func` with. * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } var _apply = apply; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax$1 = Math.max; /** * A specialized version of `baseRest` which transforms the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @param {Function} transform The rest array transform. * @returns {Function} Returns the new function. */ function overRest(func, start, transform) { start = nativeMax$1(start === undefined ? (func.length - 1) : start, 0); return function() { var args = arguments, index = -1, length = nativeMax$1(args.length - start, 0), array = Array(length); while (++index < length) { array[index] = args[start + index]; } index = -1; var otherArgs = Array(start + 1); while (++index < start) { otherArgs[index] = args[index]; } otherArgs[start] = transform(array); return _apply(func, this, otherArgs); }; } var _overRest = overRest; /** * Creates a function that returns `value`. * * @static * @memberOf _ * @since 2.4.0 * @category Util * @param {*} value The value to return from the new function. * @returns {Function} Returns the new constant function. * @example * * var objects = _.times(2, _.constant({ 'a': 1 })); * * console.log(objects); * // => [{ 'a': 1 }, { 'a': 1 }] * * console.log(objects[0] === objects[1]); * // => true */ function constant(value) { return function() { return value; }; } var constant_1 = constant; /** * The base implementation of `setToString` without support for hot loop shorting. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var baseSetToString = !_defineProperty ? identity_1 : function(func, string) { return _defineProperty(func, 'toString', { 'configurable': true, 'enumerable': false, 'value': constant_1(string), 'writable': true }); }; var _baseSetToString = baseSetToString; /** Used to detect hot functions by number of calls within a span of milliseconds. */ var HOT_COUNT = 800, HOT_SPAN = 16; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeNow = Date.now; /** * Creates a function that'll short out and invoke `identity` instead * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` * milliseconds. * * @private * @param {Function} func The function to restrict. * @returns {Function} Returns the new shortable function. */ function shortOut(func) { var count = 0, lastCalled = 0; return function() { var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { if (++count >= HOT_COUNT) { return arguments[0]; } } else { count = 0; } return func.apply(undefined, arguments); }; } var _shortOut = shortOut; /** * Sets the `toString` method of `func` to return `string`. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var setToString = _shortOut(_baseSetToString); var _setToString = setToString; /** * A specialized version of `baseRest` which flattens the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @returns {Function} Returns the new function. */ function flatRest(func) { return _setToString(_overRest(func, undefined, flatten_1), func + ''); } var _flatRest = flatRest; /** Used to compose bitmasks for cloning. */ var CLONE_DEEP_FLAG$1 = 1, CLONE_FLAT_FLAG$1 = 2, CLONE_SYMBOLS_FLAG$1 = 4; /** * The opposite of `_.pick`; this method creates an object composed of the * own and inherited enumerable property paths of `object` that are not omitted. * * **Note:** This method is considerably slower than `_.pick`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. * @param {...(string|string[])} [paths] The property paths to omit. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.omit(object, ['a', 'c']); * // => { 'b': '2' } */ var omit = _flatRest(function(object, paths) { var result = {}; if (object == null) { return result; } var isDeep = false; paths = _arrayMap(paths, function(path) { path = _castPath(path, object); isDeep || (isDeep = path.length > 1); return path; }); _copyObject(object, _getAllKeysIn(object), result); if (isDeep) { result = _baseClone(result, CLONE_DEEP_FLAG$1 | CLONE_FLAT_FLAG$1 | CLONE_SYMBOLS_FLAG$1, _customOmitClone); } var length = paths.length; while (length--) { _baseUnset(result, paths[length]); } return result; }); var omit_1 = omit; /** * The base implementation of `_.isNaN` without support for number objects. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. */ function baseIsNaN(value) { return value !== value; } var _baseIsNaN = baseIsNaN; /** * A specialized version of `_.indexOf` which performs strict equality * comparisons of values, i.e. `===`. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function strictIndexOf(array, value, fromIndex) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (array[index] === value) { return index; } } return -1; } var _strictIndexOf = strictIndexOf; /** * The base implementation of `_.indexOf` without `fromIndex` bounds checks. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOf(array, value, fromIndex) { return value === value ? _strictIndexOf(array, value, fromIndex) : _baseFindIndex(array, _baseIsNaN, fromIndex); } var _baseIndexOf = baseIndexOf; /** * A specialized version of `_.includes` for arrays without support for * specifying an index to search from. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludes(array, value) { var length = array == null ? 0 : array.length; return !!length && _baseIndexOf(array, value, 0) > -1; } var _arrayIncludes = arrayIncludes; /** * This function is like `arrayIncludes` except that it accepts a comparator. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @param {Function} comparator The comparator invoked per element. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludesWith(array, value, comparator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (comparator(value, array[index])) { return true; } } return false; } var _arrayIncludesWith = arrayIncludesWith; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMin = Math.min; /** * The base implementation of methods like `_.intersection`, without support * for iteratee shorthands, that accepts an array of arrays to inspect. * * @private * @param {Array} arrays The arrays to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of shared values. */ function baseIntersection(arrays, iteratee, comparator) { var includes = comparator ? _arrayIncludesWith : _arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array(othLength), maxLength = Infinity, result = []; while (othIndex--) { var array = arrays[othIndex]; if (othIndex && iteratee) { array = _arrayMap(array, _baseUnary(iteratee)); } maxLength = nativeMin(array.length, maxLength); caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) ? new _SetCache(othIndex && array) : undefined; } array = arrays[0]; var index = -1, seen = caches[0]; outer: while (++index < length && result.length < maxLength) { var value = array[index], computed = iteratee ? iteratee(value) : value; value = (comparator || value !== 0) ? value : 0; if (!(seen ? _cacheHas(seen, computed) : includes(result, computed, comparator) )) { othIndex = othLength; while (--othIndex) { var cache = caches[othIndex]; if (!(cache ? _cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator)) ) { continue outer; } } if (seen) { seen.push(computed); } result.push(value); } } return result; } var _baseIntersection = baseIntersection; /** * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. */ function baseRest(func, start) { return _setToString(_overRest(func, start, identity_1), func + ''); } var _baseRest = baseRest; /** * This method is like `_.isArrayLike` except that it also checks if `value` * is an object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array-like object, * else `false`. * @example * * _.isArrayLikeObject([1, 2, 3]); * // => true * * _.isArrayLikeObject(document.body.children); * // => true * * _.isArrayLikeObject('abc'); * // => false * * _.isArrayLikeObject(_.noop); * // => false */ function isArrayLikeObject(value) { return isObjectLike_1(value) && isArrayLike_1(value); } var isArrayLikeObject_1 = isArrayLikeObject; /** * Casts `value` to an empty array if it's not an array like object. * * @private * @param {*} value The value to inspect. * @returns {Array|Object} Returns the cast array-like object. */ function castArrayLikeObject(value) { return isArrayLikeObject_1(value) ? value : []; } var _castArrayLikeObject = castArrayLikeObject; /** * Creates an array of unique values that are included in all given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order and references of result values are * determined by the first array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of intersecting values. * @example * * _.intersection([2, 1], [2, 3]); * // => [2] */ var intersection = _baseRest(function(arrays) { var mapped = _arrayMap(arrays, _castArrayLikeObject); return (mapped.length && mapped[0] === arrays[0]) ? _baseIntersection(mapped) : []; }); var intersection_1 = intersection; /** * Creates a base function for methods like `_.forIn` and `_.forOwn`. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseFor(fromRight) { return function(object, iteratee, keysFunc) { var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length; while (length--) { var key = props[fromRight ? length : ++index]; if (iteratee(iterable[key], key, iterable) === false) { break; } } return object; }; } var _createBaseFor = createBaseFor; /** * The base implementation of `baseForOwn` which iterates over `object` * properties returned by `keysFunc` and invokes `iteratee` for each property. * Iteratee functions may exit iteration early by explicitly returning `false`. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ var baseFor = _createBaseFor(); var _baseFor = baseFor; /** * The base implementation of `_.forOwn` without support for iteratee shorthands. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwn(object, iteratee) { return object && _baseFor(object, iteratee, keys_1); } var _baseForOwn = baseForOwn; /** * Casts `value` to `identity` if it's not a function. * * @private * @param {*} value The value to inspect. * @returns {Function} Returns cast function. */ function castFunction(value) { return typeof value == 'function' ? value : identity_1; } var _castFunction = castFunction; /** * Iterates over own enumerable string keyed properties of an object and * invokes `iteratee` for each property. The iteratee is invoked with three * arguments: (value, key, object). Iteratee functions may exit iteration * early by explicitly returning `false`. * * @static * @memberOf _ * @since 0.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forOwnRight * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forOwn(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forOwn(object, iteratee) { return object && _baseForOwn(object, _castFunction(iteratee)); } var forOwn_1 = forOwn; /** * Creates a `baseEach` or `baseEachRight` function. * * @private * @param {Function} eachFunc The function to iterate over a collection. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseEach(eachFunc, fromRight) { return function(collection, iteratee) { if (collection == null) { return collection; } if (!isArrayLike_1(collection)) { return eachFunc(collection, iteratee); } var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection); while ((fromRight ? index-- : ++index < length)) { if (iteratee(iterable[index], index, iterable) === false) { break; } } return collection; }; } var _createBaseEach = createBaseEach; /** * The base implementation of `_.forEach` 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|Object} Returns `collection`. */ var baseEach = _createBaseEach(_baseForOwn); var _baseEach = baseEach; /** * Iterates over elements of `collection` and invokes `iteratee` for each element. * The iteratee is invoked with three arguments: (value, index|key, collection). * Iteratee functions may exit iteration early by explicitly returning `false`. * * **Note:** As with other "Collections" methods, objects with a "length" * property are iterated like arrays. To avoid this behavior use `_.forIn` * or `_.forOwn` for object iteration. * * @static * @memberOf _ * @since 0.1.0 * @alias each * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array|Object} Returns `collection`. * @see _.forEachRight * @example * * _.forEach([1, 2], function(value) { * console.log(value); * }); * // => Logs `1` then `2`. * * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { * console.log(key); * }); * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forEach(collection, iteratee) { var func = isArray_1(collection) ? _arrayEach : _baseEach; return func(collection, _castFunction(iteratee)); } var forEach_1 = forEach; /** * 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; } var _baseFilter = baseFilter; /** * 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'] */ function filter(collection, predicate) { var func = isArray_1(collection) ? _arrayFilter : _baseFilter; return func(collection, _baseIteratee(predicate, 3)); } var filter_1 = filter; /** * 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_1(collection) ? Array(collection.length) : []; _baseEach(collection, function(value, key, collection) { result[++index] = iteratee(value, key, collection); }); return result; } var _baseMap = baseMap; /** * 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_1(collection) ? _arrayMap : _baseMap; return func(collection, _baseIteratee(iteratee, 3)); } var map_1 = map; /** * A specialized version of `_.reduce` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initAccum] Specify using the first element of `array` as * the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduce(array, iteratee, accumulator, initAccum) { var index = -1, length = array == null ? 0 : array.length; if (initAccum && length) { accumulator = array[++index]; } while (++index < length) { accumulator = iteratee(accumulator, array[index], index, array); } return accumulator; } var _arrayReduce = arrayReduce; /** * 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; } var _baseReduce = baseReduce; /** * 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_1(collection) ? _arrayReduce : _baseReduce, initAccum = arguments.length < 3; return func(collection, _baseIteratee(iteratee, 4), accumulator, initAccum, _baseEach); } var reduce_1 = reduce; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax$2 = Math.max; /** * Gets the index at which the first occurrence of `value` is found in `array` * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. If `fromIndex` is negative, it's used as the * offset from the end of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.indexOf([1, 2, 1, 2], 2); * // => 1 * * // Search from the `fromIndex`. * _.indexOf([1, 2, 1, 2], 2, 2); * // => 3 */ function indexOf(array, value, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = fromIndex == null ? 0 : toInteger_1(fromIndex); if (index < 0) { index = nativeMax$2(length + index, 0); } return _baseIndexOf(array, value, index); } var indexOf_1 = indexOf; /** `Object#toString` result references. */ var numberTag$4 = '[object Number]'; /** * Checks if `value` is classified as a `Number` primitive or object. * * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are * classified as numbers, use the `_.isFinite` method. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a number, else `false`. * @example * * _.isNumber(3); * // => true * * _.isNumber(Number.MIN_VALUE); * // => true * * _.isNumber(Infinity); * // => true * * _.isNumber('3'); * // => false */ function isNumber(value) { return typeof value == 'number' || (isObjectLike_1(value) && _baseGetTag(value) == numberTag$4); } var isNumber_1 = isNumber; /** * Checks if `value` is `NaN`. * * **Note:** This method is based on * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for * `undefined` and other non-number values. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. * @example * * _.isNaN(NaN); * // => true * * _.isNaN(new Number(NaN)); * // => true * * isNaN(undefined); * // => true * * _.isNaN(undefined); * // => false */ function isNaN$1(value) { // An `NaN` primitive is the only value that is not equal to itself. // Perform the `toStringTag` check first to avoid errors with some // ActiveX objects in IE. return isNumber_1(value) && value != +value; } var _isNaN = isNaN$1; /** * Performs a deep comparison between two values to determine if they are * equivalent. * * **Note:** This method supports comparing arrays, array buffers, booleans, * date objects, error objects, maps, numbers, `Object` objects, regexes, * sets, strings, symbols, and typed arrays. `Object` objects are compared * by their own, not inherited, enumerable properties. Functions and DOM * nodes are compared by strict equality, i.e. `===`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.isEqual(object, other); * // => true * * object === other; * // => false */ function isEqual(value, other) { return _baseIsEqual(value, other); } var isEqual_1 = isEqual; /** * Checks if `value` is `undefined`. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. * @example * * _.isUndefined(void 0); * // => true * * _.isUndefined(null); * // => false */ function isUndefined(value) { return value === undefined; } var isUndefined_1 = isUndefined; /** `Object#toString` result references. */ var stringTag$4 = '[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_1(value) && isObjectLike_1(value) && _baseGetTag(value) == stringTag$4); } var isString_1 = isString; /** * Casts `array` to a slice if it's needed. * * @private * @param {Array} array The array to inspect. * @param {number} start The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the cast slice. */ function castSlice(array, start, end) { var length = array.length; end = end === undefined ? length : end; return (!start && end >= length) ? array : _baseSlice(array, start, end); } var _castSlice = castSlice; /** * 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; } var _charsEndIndex = charsEndIndex; /** * 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; } var _charsStartIndex = charsStartIndex; /** * Converts an ASCII `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function asciiToArray(string) { return string.split(''); } var _asciiToArray = asciiToArray; /** Used to compose unicode character classes. */ var rsAstralRange = '\\ud800-\\udfff', rsComboMarksRange = '\\u0300-\\u036f', reComboHalfMarksRange = '\\ufe20-\\ufe2f', rsComboSymbolsRange = '\\u20d0-\\u20ff', rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsVarRange = '\\ufe0e\\ufe0f'; /** Used to compose unicode capture groups. */ var rsZWJ = '\\u200d'; /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); /** * Checks if `string` contains Unicode symbols. * * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a symbol is found, else `false`. */ function hasUnicode(string) { return reHasUnicode.test(string); } var _hasUnicode = hasUnicode; /** Used to compose unicode character classes. */ var rsAstralRange$1 = '\\ud800-\\udfff', rsComboMarksRange$1 = '\\u0300-\\u036f', reComboHalfMarksRange$1 = '\\ufe20-\\ufe2f', rsComboSymbolsRange$1 = '\\u20d0-\\u20ff', rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1, rsVarRange$1 = '\\ufe0e\\ufe0f'; /** Used to compose unicode capture groups. */ var rsAstral = '[' + rsAstralRange$1 + ']', rsCombo = '[' + rsComboRange$1 + ']', rsFitz = '\\ud83c[\\udffb-\\udfff]', rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', rsNonAstral = '[^' + rsAstralRange$1 + ']', rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', rsZWJ$1 = '\\u200d'; /** Used to compose unicode regexes. */ var reOptMod = rsModifier + '?', rsOptVar = '[' + rsVarRange$1 + ']?', rsOptJoin = '(?:' + rsZWJ$1 + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', rsSeq = rsOptVar + reOptMod + rsOptJoin, rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); /** * Converts a Unicode `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function unicodeToArray(string) { return string.match(reUnicode) || []; } var _unicodeToArray = unicodeToArray; /** * Converts `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function stringToArray(string) { return _hasUnicode(string) ? _unicodeToArray(string) : _asciiToArray(string); } var _stringToArray = stringToArray; /** Used to match leading and trailing whitespace. */ var reTrim$1 = /^\s+|\s+$/g; /** * 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_1(string); if (string && (guard || chars === undefined)) { return string.replace(reTrim$1, ''); } 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(''); } var trim_1 = trim; /** * Checks if the given arguments are from an iteratee call. * * @private * @param {*} value The potential iteratee value argument. * @param {*} index The potential iteratee index or key argument. * @param {*} object The potential iteratee object argument. * @returns {boolean} Returns `true` if the arguments are from an iteratee call, * else `false`. */ function isIterateeCall(value, index, object) { if (!isObject_1(object)) { return false; } var type = typeof index; if (type == 'number' ? (isArrayLike_1(object) && _isIndex(index, object.length)) : (type == 'string' && index in object) ) { return eq_1(object[index], value); } return false; } var _isIterateeCall = isIterateeCall; /** Used for built-in method references. */ var objectProto$h = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$f = objectProto$h.hasOwnProperty; /** * Assigns own and inherited enumerable string keyed properties of source * objects to the destination object for all destination properties that * resolve to `undefined`. Source objects are applied from left to right. * Once a property is set, additional values of the same property are ignored. * * **Note:** This method mutates `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.defaultsDeep * @example * * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var defaults = _baseRest(function(object, sources) { object = Object(object); var index = -1; var length = sources.length; var guard = length > 2 ? sources[2] : undefined; if (guard && _isIterateeCall(sources[0], sources[1], guard)) { length = 1; } while (++index < length) { var source = sources[index]; var props = keysIn_1(source); var propsIndex = -1; var propsLength = props.length; while (++propsIndex < propsLength) { var key = props[propsIndex]; var value = object[key]; if (value === undefined || (eq_1(value, objectProto$h[key]) && !hasOwnProperty$f.call(object, key))) { object[key] = source[key]; } } } return object; }); var defaults_1 = defaults; /** * This function is like `assignValue` except that it doesn't assign * `undefined` values. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignMergeValue(object, key, value) { if ((value !== undefined && !eq_1(object[key], value)) || (value === undefined && !(key in object))) { _baseAssignValue(object, key, value); } } var _assignMergeValue = assignMergeValue; /** * Gets the value at `key`, unless `key` is "__proto__". * * @private * @param {Object} object The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function safeGet(object, key) { return key == '__proto__' ? undefined : object[key]; } var _safeGet = safeGet; /** * Converts `value` to a plain object flattening inherited enumerable string * keyed properties of `value` to own properties of the plain object. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to convert. * @returns {Object} Returns the converted plain object. * @example * * function Foo() { * this.b = 2; * } * * Foo.prototype.c = 3; * * _.assign({ 'a': 1 }, new Foo); * // => { 'a': 1, 'b': 2 } * * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); * // => { 'a': 1, 'b': 2, 'c': 3 } */ function toPlainObject(value) { return _copyObject(value, keysIn_1(value)); } var toPlainObject_1 = toPlainObject; /** * A specialized version of `baseMerge` for arrays and objects which performs * deep merges and tracks traversed objects enabling objects with circular * references to be merged. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {string} key The key of the value to merge. * @param {number} srcIndex The index of `source`. * @param {Function} mergeFunc The function to merge values. * @param {Function} [customizer] The function to customize assigned values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { var objValue = _safeGet(object, key), srcValue = _safeGet(source, key), stacked = stack.get(srcValue); if (stacked) { _assignMergeValue(object, key, stacked); return; } var newValue = customizer ? customizer(objValue, srcValue, (key + ''), object, source, stack) : undefined; var isCommon = newValue === undefined; if (isCommon) { var isArr = isArray_1(srcValue), isBuff = !isArr && isBuffer_1(srcValue), isTyped = !isArr && !isBuff && isTypedArray_1(srcValue); newValue = srcValue; if (isArr || isBuff || isTyped) { if (isArray_1(objValue)) { newValue = objValue; } else if (isArrayLikeObject_1(objValue)) { newValue = _copyArray(objValue); } else if (isBuff) { isCommon = false; newValue = _cloneBuffer(srcValue, true); } else if (isTyped) { isCommon = false; newValue = _cloneTypedArray(srcValue, true); } else { newValue = []; } } else if (isPlainObject_1(srcValue) || isArguments_1(srcValue)) { newValue = objValue; if (isArguments_1(objValue)) { newValue = toPlainObject_1(objValue); } else if (!isObject_1(objValue) || (srcIndex && isFunction_1(objValue))) { newValue = _initCloneObject(srcValue); } } else { isCommon = false; } } if (isCommon) { // Recursively merge objects and arrays (susceptible to call stack limits). stack.set(srcValue, newValue); mergeFunc(newValue, srcValue, srcIndex, customizer, stack); stack['delete'](srcValue); } _assignMergeValue(object, key, newValue); } var _baseMergeDeep = baseMergeDeep; /** * The base implementation of `_.merge` without support for multiple sources. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {number} srcIndex The index of `source`. * @param {Function} [customizer] The function to customize merged values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } _baseFor(source, function(srcValue, key) { if (isObject_1(srcValue)) { stack || (stack = new _Stack); _baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { var newValue = customizer ? customizer(_safeGet(object, key), srcValue, (key + ''), object, source, stack) : undefined; if (newValue === undefined) { newValue = srcValue; } _assignMergeValue(object, key, newValue); } }, keysIn_1); } var _baseMerge = baseMerge; /** * Creates a function like `_.assign`. * * @private * @param {Function} assigner The function to assign values. * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { return _baseRest(function(object, sources) { var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined; customizer = (assigner.length > 3 && typeof customizer == 'function') ? (length--, customizer) : undefined; if (guard && _isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined : customizer; length = 1; } object = Object(object); while (++index < length) { var source = sources[index]; if (source) { assigner(object, source, index, customizer); } } return object; }); } var _createAssigner = createAssigner; /** * This method is like `_.assign` except that it recursively merges own and * inherited enumerable string keyed properties of source objects into the * destination object. Source properties that resolve to `undefined` are * skipped if a destination value exists. Array and plain object properties * are merged recursively. Other objects and value types are overridden by * assignment. Source objects are applied from left to right. Subsequent * sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 0.5.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @example * * var object = { * 'a': [{ 'b': 2 }, { 'd': 4 }] * }; * * var other = { * 'a': [{ 'c': 3 }, { 'e': 5 }] * }; * * _.merge(object, other); * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } */ var merge = _createAssigner(function(object, source, srcIndex) { _baseMerge(object, source, srcIndex); }); var merge_1 = merge; function valToNumber(v) { if (isNumber_1(v)) { return v; } else if (isString_1(v)) { return parseFloat(v); } else if (Array.isArray(v)) { return map_1(v, valToNumber); } throw new Error('The value should be a number, a parseable string or an array of those.'); } var valToNumber_1 = valToNumber; function filterState(state, filters) { var partialState = {}; var attributeFilters = filter_1(filters, function(f) { return f.indexOf('attribute:') !== -1; }); var attributes = map_1(attributeFilters, function(aF) { return aF.split(':')[1]; }); if (indexOf_1(attributes, '*') === -1) { forEach_1(attributes, function(attr) { if (state.isConjunctiveFacet(attr) && state.isFacetRefined(attr)) { if (!partialState.facetsRefinements) partialState.facetsRefinements = {}; partialState.facetsRefinements[attr] = state.facetsRefinements[attr]; } if (state.isDisjunctiveFacet(attr) && state.isDisjunctiveFacetRefined(attr)) { if (!partialState.disjunctiveFacetsRefinements) partialState.disjunctiveFacetsRefinements = {}; partialState.disjunctiveFacetsRefinements[attr] = state.disjunctiveFacetsRefinements[attr]; } if (state.isHierarchicalFacet(attr) && state.isHierarchicalFacetRefined(attr)) { if (!partialState.hierarchicalFacetsRefinements) partialState.hierarchicalFacetsRefinements = {}; partialState.hierarchicalFacetsRefinements[attr] = state.hierarchicalFacetsRefinements[attr]; } var numericRefinements = state.getNumericRefinements(attr); if (!isEmpty_1(numericRefinements)) { if (!partialState.numericRefinements) partialState.numericRefinements = {}; partialState.numericRefinements[attr] = state.numericRefinements[attr]; } }); } else { if (!isEmpty_1(state.numericRefinements)) { partialState.numericRefinements = state.numericRefinements; } if (!isEmpty_1(state.facetsRefinements)) partialState.facetsRefinements = state.facetsRefinements; if (!isEmpty_1(state.disjunctiveFacetsRefinements)) { partialState.disjunctiveFacetsRefinements = state.disjunctiveFacetsRefinements; } if (!isEmpty_1(state.hierarchicalFacetsRefinements)) { partialState.hierarchicalFacetsRefinements = state.hierarchicalFacetsRefinements; } } var searchParameters = filter_1( filters, function(f) { return f.indexOf('attribute:') === -1; } ); forEach_1( searchParameters, function(parameterKey) { partialState[parameterKey] = state[parameterKey]; } ); return partialState; } var filterState_1 = filterState; /** * Functions to manipulate refinement lists * * The RefinementList is not formally defined through a prototype but is based * on a specific structure. * * @module SearchParameters.refinementList * * @typedef {string[]} SearchParameters.refinementList.Refinements * @typedef {Object.<string, SearchParameters.refinementList.Refinements>} SearchParameters.refinementList.RefinementList */ var lib = { /** * Adds a refinement to a RefinementList * @param {RefinementList} refinementList the initial list * @param {string} attribute the attribute to refine * @param {string} value the value of the refinement, if the value is not a string it will be converted * @return {RefinementList} a new and updated refinement list */ addRefinement: function addRefinement(refinementList, attribute, value) { if (lib.isRefined(refinementList, attribute, value)) { return refinementList; } var valueAsString = '' + value; var facetRefinement = !refinementList[attribute] ? [valueAsString] : refinementList[attribute].concat(valueAsString); var mod = {}; mod[attribute] = facetRefinement; return defaults_1({}, mod, refinementList); }, /** * Removes refinement(s) for an attribute: * - if the value is specified removes the refinement for the value on the attribute * - if no value is specified removes all the refinements for this attribute * @param {RefinementList} refinementList the initial list * @param {string} attribute the attribute to refine * @param {string} [value] the value of the refinement * @return {RefinementList} a new and updated refinement lst */ removeRefinement: function removeRefinement(refinementList, attribute, value) { if (isUndefined_1(value)) { return lib.clearRefinement(refinementList, attribute); } var valueAsString = '' + value; return lib.clearRefinement(refinementList, function(v, f) { return attribute === f && valueAsString === v; }); }, /** * Toggles the refinement value for an attribute. * @param {RefinementList} refinementList the initial list * @param {string} attribute the attribute to refine * @param {string} value the value of the refinement * @return {RefinementList} a new and updated list */ toggleRefinement: function toggleRefinement(refinementList, attribute, value) { if (isUndefined_1(value)) throw new Error('toggleRefinement should be used with a value'); if (lib.isRefined(refinementList, attribute, value)) { return lib.removeRefinement(refinementList, attribute, value); } return lib.addRefinement(refinementList, attribute, value); }, /** * Clear all or parts of a RefinementList. Depending on the arguments, three * kinds of behavior can happen: * - if no attribute is provided: clears the whole list * - if an attribute is provided as a string: clears the list for the specific attribute * - if an attribute is provided as a function: discards the elements for which the function returns true * @param {RefinementList} refinementList the initial list * @param {string} [attribute] the attribute or function to discard * @param {string} [refinementType] optional parameter to give more context to the attribute function * @return {RefinementList} a new and updated refinement list */ clearRefinement: function clearRefinement(refinementList, attribute, refinementType) { if (isUndefined_1(attribute)) { if (isEmpty_1(refinementList)) return refinementList; return {}; } else if (isString_1(attribute)) { if (isEmpty_1(refinementList[attribute])) return refinementList; return omit_1(refinementList, attribute); } else if (isFunction_1(attribute)) { var hasChanged = false; var newRefinementList = reduce_1(refinementList, function(memo, values, key) { var facetList = filter_1(values, function(value) { return !attribute(value, key, refinementType); }); if (!isEmpty_1(facetList)) { if (facetList.length !== values.length) hasChanged = true; memo[key] = facetList; } else hasChanged = true; return memo; }, {}); if (hasChanged) return newRefinementList; return refinementList; } }, /** * Test if the refinement value is used for the attribute. If no refinement value * is provided, test if the refinementList contains any refinement for the * given attribute. * @param {RefinementList} refinementList the list of refinement * @param {string} attribute name of the attribute * @param {string} [refinementValue] value of the filter/refinement * @return {boolean} */ isRefined: function isRefined(refinementList, attribute, refinementValue) { var indexOf = indexOf_1; var containsRefinements = !!refinementList[attribute] && refinementList[attribute].length > 0; if (isUndefined_1(refinementValue) || !containsRefinements) { return containsRefinements; } var refinementValueAsString = '' + refinementValue; return indexOf(refinementList[attribute], refinementValueAsString) !== -1; } }; var RefinementList = lib; /** * like _.find but using _.isEqual to be able to use it * to find arrays. * @private * @param {any[]} array array to search into * @param {any} searchedValue the value we're looking for * @return {any} the searched value or undefined */ function findArray(array, searchedValue) { return find_1(array, function(currentValue) { return isEqual_1(currentValue, searchedValue); }); } /** * The facet list is the structure used to store the list of values used to * filter a single attribute. * @typedef {string[]} SearchParameters.FacetList */ /** * Structure to store numeric filters with the operator as the key. The supported operators * are `=`, `>`, `<`, `>=`, `<=` and `!=`. * @typedef {Object.<string, Array.<number|number[]>>} SearchParameters.OperatorList */ /** * SearchParameters is the data structure that contains all the information * usable for making a search to Algolia API. It doesn't do the search itself, * nor does it contains logic about the parameters. * It is an immutable object, therefore it has been created in a way that each * changes does not change the object itself but returns a copy with the * modification. * This object should probably not be instantiated outside of the helper. It will * be provided when needed. This object is documented for reference as you'll * get it from events generated by the {@link AlgoliaSearchHelper}. * If need be, instantiate the Helper from the factory function {@link SearchParameters.make} * @constructor * @classdesc contains all the parameters of a search * @param {object|SearchParameters} newParameters existing parameters or partial object * for the properties of a new SearchParameters * @see SearchParameters.make * @example <caption>SearchParameters of the first query in * <a href="http://demos.algolia.com/instant-search-demo/">the instant search demo</a></caption> { "query": "", "disjunctiveFacets": [ "customerReviewCount", "category", "salePrice_range", "manufacturer" ], "maxValuesPerFacet": 30, "page": 0, "hitsPerPage": 10, "facets": [ "type", "shipping" ] } */ function SearchParameters(newParameters) { var params = newParameters ? SearchParameters._parseNumbers(newParameters) : {}; /** * Targeted index. This parameter is mandatory. * @member {string} */ this.index = params.index || ''; // Query /** * Query string of the instant search. The empty string is a valid query. * @member {string} * @see https://www.algolia.com/doc/rest#param-query */ this.query = params.query || ''; // Facets /** * This attribute contains the list of all the conjunctive facets * used. This list will be added to requested facets in the * [facets attribute](https://www.algolia.com/doc/rest-api/search#param-facets) sent to algolia. * @member {string[]} */ this.facets = params.facets || []; /** * This attribute contains the list of all the disjunctive facets * used. This list will be added to requested facets in the * [facets attribute](https://www.algolia.com/doc/rest-api/search#param-facets) sent to algolia. * @member {string[]} */ this.disjunctiveFacets = params.disjunctiveFacets || []; /** * This attribute contains the list of all the hierarchical facets * used. This list will be added to requested facets in the * [facets attribute](https://www.algolia.com/doc/rest-api/search#param-facets) sent to algolia. * Hierarchical facets are a sub type of disjunctive facets that * let you filter faceted attributes hierarchically. * @member {string[]|object[]} */ this.hierarchicalFacets = params.hierarchicalFacets || []; // Refinements /** * This attribute contains all the filters that need to be * applied on the conjunctive facets. Each facet must be properly * defined in the `facets` attribute. * * The key is the name of the facet, and the `FacetList` contains all * filters selected for the associated facet name. * * When querying algolia, the values stored in this attribute will * be translated into the `facetFilters` attribute. * @member {Object.<string, SearchParameters.FacetList>} */ this.facetsRefinements = params.facetsRefinements || {}; /** * This attribute contains all the filters that need to be * excluded from the conjunctive facets. Each facet must be properly * defined in the `facets` attribute. * * The key is the name of the facet, and the `FacetList` contains all * filters excluded for the associated facet name. * * When querying algolia, the values stored in this attribute will * be translated into the `facetFilters` attribute. * @member {Object.<string, SearchParameters.FacetList>} */ this.facetsExcludes = params.facetsExcludes || {}; /** * This attribute contains all the filters that need to be * applied on the disjunctive facets. Each facet must be properly * defined in the `disjunctiveFacets` attribute. * * The key is the name of the facet, and the `FacetList` contains all * filters selected for the associated facet name. * * When querying algolia, the values stored in this attribute will * be translated into the `facetFilters` attribute. * @member {Object.<string, SearchParameters.FacetList>} */ this.disjunctiveFacetsRefinements = params.disjunctiveFacetsRefinements || {}; /** * This attribute contains all the filters that need to be * applied on the numeric attributes. * * The key is the name of the attribute, and the value is the * filters to apply to this attribute. * * When querying algolia, the values stored in this attribute will * be translated into the `numericFilters` attribute. * @member {Object.<string, SearchParameters.OperatorList>} */ this.numericRefinements = params.numericRefinements || {}; /** * This attribute contains all the tags used to refine the query. * * When querying algolia, the values stored in this attribute will * be translated into the `tagFilters` attribute. * @member {string[]} */ this.tagRefinements = params.tagRefinements || []; /** * This attribute contains all the filters that need to be * applied on the hierarchical facets. Each facet must be properly * defined in the `hierarchicalFacets` attribute. * * The key is the name of the facet, and the `FacetList` contains all * filters selected for the associated facet name. The FacetList values * are structured as a string that contain the values for each level * separated by the configured separator. * * When querying algolia, the values stored in this attribute will * be translated into the `facetFilters` attribute. * @member {Object.<string, SearchParameters.FacetList>} */ this.hierarchicalFacetsRefinements = params.hierarchicalFacetsRefinements || {}; /** * Contains the numeric filters in the raw format of the Algolia API. Setting * this parameter is not compatible with the usage of numeric filters methods. * @see https://www.algolia.com/doc/javascript#numericFilters * @member {string} */ this.numericFilters = params.numericFilters; /** * Contains the tag filters in the raw format of the Algolia API. Setting this * parameter is not compatible with the of the add/remove/toggle methods of the * tag api. * @see https://www.algolia.com/doc/rest#param-tagFilters * @member {string} */ this.tagFilters = params.tagFilters; /** * Contains the optional tag filters in the raw format of the Algolia API. * @see https://www.algolia.com/doc/rest#param-tagFilters * @member {string} */ this.optionalTagFilters = params.optionalTagFilters; /** * Contains the optional facet filters in the raw format of the Algolia API. * @see https://www.algolia.com/doc/rest#param-tagFilters * @member {string} */ this.optionalFacetFilters = params.optionalFacetFilters; // Misc. parameters /** * Number of hits to be returned by the search API * @member {number} * @see https://www.algolia.com/doc/rest#param-hitsPerPage */ this.hitsPerPage = params.hitsPerPage; /** * Number of values for each faceted attribute * @member {number} * @see https://www.algolia.com/doc/rest#param-maxValuesPerFacet */ this.maxValuesPerFacet = params.maxValuesPerFacet; /** * The current page number * @member {number} * @see https://www.algolia.com/doc/rest#param-page */ this.page = params.page || 0; /** * How the query should be treated by the search engine. * Possible values: prefixAll, prefixLast, prefixNone * @see https://www.algolia.com/doc/rest#param-queryType * @member {string} */ this.queryType = params.queryType; /** * How the typo tolerance behave in the search engine. * Possible values: true, false, min, strict * @see https://www.algolia.com/doc/rest#param-typoTolerance * @member {string} */ this.typoTolerance = params.typoTolerance; /** * Number of characters to wait before doing one character replacement. * @see https://www.algolia.com/doc/rest#param-minWordSizefor1Typo * @member {number} */ this.minWordSizefor1Typo = params.minWordSizefor1Typo; /** * Number of characters to wait before doing a second character replacement. * @see https://www.algolia.com/doc/rest#param-minWordSizefor2Typos * @member {number} */ this.minWordSizefor2Typos = params.minWordSizefor2Typos; /** * Configure the precision of the proximity ranking criterion * @see https://www.algolia.com/doc/rest#param-minProximity */ this.minProximity = params.minProximity; /** * Should the engine allow typos on numerics. * @see https://www.algolia.com/doc/rest#param-allowTyposOnNumericTokens * @member {boolean} */ this.allowTyposOnNumericTokens = params.allowTyposOnNumericTokens; /** * Should the plurals be ignored * @see https://www.algolia.com/doc/rest#param-ignorePlurals * @member {boolean} */ this.ignorePlurals = params.ignorePlurals; /** * Restrict which attribute is searched. * @see https://www.algolia.com/doc/rest#param-restrictSearchableAttributes * @member {string} */ this.restrictSearchableAttributes = params.restrictSearchableAttributes; /** * Enable the advanced syntax. * @see https://www.algolia.com/doc/rest#param-advancedSyntax * @member {boolean} */ this.advancedSyntax = params.advancedSyntax; /** * Enable the analytics * @see https://www.algolia.com/doc/rest#param-analytics * @member {boolean} */ this.analytics = params.analytics; /** * Tag of the query in the analytics. * @see https://www.algolia.com/doc/rest#param-analyticsTags * @member {string} */ this.analyticsTags = params.analyticsTags; /** * Enable the synonyms * @see https://www.algolia.com/doc/rest#param-synonyms * @member {boolean} */ this.synonyms = params.synonyms; /** * Should the engine replace the synonyms in the highlighted results. * @see https://www.algolia.com/doc/rest#param-replaceSynonymsInHighlight * @member {boolean} */ this.replaceSynonymsInHighlight = params.replaceSynonymsInHighlight; /** * Add some optional words to those defined in the dashboard * @see https://www.algolia.com/doc/rest#param-optionalWords * @member {string} */ this.optionalWords = params.optionalWords; /** * Possible values are "lastWords" "firstWords" "allOptional" "none" (default) * @see https://www.algolia.com/doc/rest#param-removeWordsIfNoResults * @member {string} */ this.removeWordsIfNoResults = params.removeWordsIfNoResults; /** * List of attributes to retrieve * @see https://www.algolia.com/doc/rest#param-attributesToRetrieve * @member {string} */ this.attributesToRetrieve = params.attributesToRetrieve; /** * List of attributes to highlight * @see https://www.algolia.com/doc/rest#param-attributesToHighlight * @member {string} */ this.attributesToHighlight = params.attributesToHighlight; /** * Code to be embedded on the left part of the highlighted results * @see https://www.algolia.com/doc/rest#param-highlightPreTag * @member {string} */ this.highlightPreTag = params.highlightPreTag; /** * Code to be embedded on the right part of the highlighted results * @see https://www.algolia.com/doc/rest#param-highlightPostTag * @member {string} */ this.highlightPostTag = params.highlightPostTag; /** * List of attributes to snippet * @see https://www.algolia.com/doc/rest#param-attributesToSnippet * @member {string} */ this.attributesToSnippet = params.attributesToSnippet; /** * Enable the ranking informations in the response, set to 1 to activate * @see https://www.algolia.com/doc/rest#param-getRankingInfo * @member {number} */ this.getRankingInfo = params.getRankingInfo; /** * Remove duplicates based on the index setting attributeForDistinct * @see https://www.algolia.com/doc/rest#param-distinct * @member {boolean|number} */ this.distinct = params.distinct; /** * Center of the geo search. * @see https://www.algolia.com/doc/rest#param-aroundLatLng * @member {string} */ this.aroundLatLng = params.aroundLatLng; /** * Center of the search, retrieve from the user IP. * @see https://www.algolia.com/doc/rest#param-aroundLatLngViaIP * @member {boolean} */ this.aroundLatLngViaIP = params.aroundLatLngViaIP; /** * Radius of the geo search. * @see https://www.algolia.com/doc/rest#param-aroundRadius * @member {number} */ this.aroundRadius = params.aroundRadius; /** * Precision of the geo search. * @see https://www.algolia.com/doc/rest#param-aroundPrecision * @member {number} */ this.minimumAroundRadius = params.minimumAroundRadius; /** * Precision of the geo search. * @see https://www.algolia.com/doc/rest#param-minimumAroundRadius * @member {number} */ this.aroundPrecision = params.aroundPrecision; /** * Geo search inside a box. * @see https://www.algolia.com/doc/rest#param-insideBoundingBox * @member {string} */ this.insideBoundingBox = params.insideBoundingBox; /** * Geo search inside a polygon. * @see https://www.algolia.com/doc/rest#param-insidePolygon * @member {string} */ this.insidePolygon = params.insidePolygon; /** * Allows to specify an ellipsis character for the snippet when we truncate the text * (added before and after if truncated). * The default value is an empty string and we recommend to set it to "…" * @see https://www.algolia.com/doc/rest#param-insidePolygon * @member {string} */ this.snippetEllipsisText = params.snippetEllipsisText; /** * Allows to specify some attributes name on which exact won't be applied. * Attributes are separated with a comma (for example "name,address" ), you can also use a * JSON string array encoding (for example encodeURIComponent('["name","address"]') ). * By default the list is empty. * @see https://www.algolia.com/doc/rest#param-disableExactOnAttributes * @member {string|string[]} */ this.disableExactOnAttributes = params.disableExactOnAttributes; /** * Applies 'exact' on single word queries if the word contains at least 3 characters * and is not a stop word. * Can take two values: true or false. * By default, its set to false. * @see https://www.algolia.com/doc/rest#param-enableExactOnSingleWordQuery * @member {boolean} */ this.enableExactOnSingleWordQuery = params.enableExactOnSingleWordQuery; // Undocumented parameters, still needed otherwise we fail this.offset = params.offset; this.length = params.length; var self = this; forOwn_1(params, function checkForUnknownParameter(paramValue, paramName) { if (SearchParameters.PARAMETERS.indexOf(paramName) === -1) { self[paramName] = paramValue; } }); } /** * List all the properties in SearchParameters and therefore all the known Algolia properties * This doesn't contain any beta/hidden features. * @private */ SearchParameters.PARAMETERS = keys_1(new SearchParameters()); /** * @private * @param {object} partialState full or part of a state * @return {object} a new object with the number keys as number */ SearchParameters._parseNumbers = function(partialState) { // Do not reparse numbers in SearchParameters, they ought to be parsed already if (partialState instanceof SearchParameters) return partialState; var numbers = {}; var numberKeys = [ 'aroundPrecision', 'aroundRadius', 'getRankingInfo', 'minWordSizefor2Typos', 'minWordSizefor1Typo', 'page', 'maxValuesPerFacet', 'distinct', 'minimumAroundRadius', 'hitsPerPage', 'minProximity' ]; forEach_1(numberKeys, function(k) { var value = partialState[k]; if (isString_1(value)) { var parsedValue = parseFloat(value); numbers[k] = _isNaN(parsedValue) ? value : parsedValue; } }); // there's two formats of insideBoundingBox, we need to parse // the one which is an array of float geo rectangles if (Array.isArray(partialState.insideBoundingBox)) { numbers.insideBoundingBox = partialState.insideBoundingBox.map(function(geoRect) { return geoRect.map(function(value) { return parseFloat(value); }); }); } if (partialState.numericRefinements) { var numericRefinements = {}; forEach_1(partialState.numericRefinements, function(operators, attribute) { numericRefinements[attribute] = {}; forEach_1(operators, function(values, operator) { var parsedValues = map_1(values, function(v) { if (Array.isArray(v)) { return map_1(v, function(vPrime) { if (isString_1(vPrime)) { return parseFloat(vPrime); } return vPrime; }); } else if (isString_1(v)) { return parseFloat(v); } return v; }); numericRefinements[attribute][operator] = parsedValues; }); }); numbers.numericRefinements = numericRefinements; } return merge_1({}, partialState, numbers); }; /** * Factory for SearchParameters * @param {object|SearchParameters} newParameters existing parameters or partial * object for the properties of a new SearchParameters * @return {SearchParameters} frozen instance of SearchParameters */ SearchParameters.make = function makeSearchParameters(newParameters) { var instance = new SearchParameters(newParameters); forEach_1(newParameters.hierarchicalFacets, function(facet) { if (facet.rootPath) { var currentRefinement = instance.getHierarchicalRefinement(facet.name); if (currentRefinement.length > 0 && currentRefinement[0].indexOf(facet.rootPath) !== 0) { instance = instance.clearRefinements(facet.name); } // get it again in case it has been cleared currentRefinement = instance.getHierarchicalRefinement(facet.name); if (currentRefinement.length === 0) { instance = instance.toggleHierarchicalFacetRefinement(facet.name, facet.rootPath); } } }); return instance; }; /** * Validates the new parameters based on the previous state * @param {SearchParameters} currentState the current state * @param {object|SearchParameters} parameters the new parameters to set * @return {Error|null} Error if the modification is invalid, null otherwise */ SearchParameters.validate = function(currentState, parameters) { var params = parameters || {}; if (currentState.tagFilters && params.tagRefinements && params.tagRefinements.length > 0) { return new Error( '[Tags] Cannot switch from the managed tag API to the advanced API. It is probably ' + 'an error, if it is really what you want, you should first clear the tags with clearTags method.'); } if (currentState.tagRefinements.length > 0 && params.tagFilters) { return new Error( '[Tags] Cannot switch from the advanced tag API to the managed API. It is probably ' + 'an error, if it is not, you should first clear the tags with clearTags method.'); } if (currentState.numericFilters && params.numericRefinements && !isEmpty_1(params.numericRefinements)) { return new Error( "[Numeric filters] Can't switch from the advanced to the managed API. It" + ' is probably an error, if this is really what you want, you have to first' + ' clear the numeric filters.'); } if (!isEmpty_1(currentState.numericRefinements) && params.numericFilters) { return new Error( "[Numeric filters] Can't switch from the managed API to the advanced. It" + ' is probably an error, if this is really what you want, you have to first' + ' clear the numeric filters.'); } return null; }; SearchParameters.prototype = { constructor: SearchParameters, /** * Remove all refinements (disjunctive + conjunctive + excludes + numeric filters) * @method * @param {undefined|string|SearchParameters.clearCallback} [attribute] optional string or function * - If not given, means to clear all the filters. * - If `string`, means to clear all refinements for the `attribute` named filter. * - If `function`, means to clear all the refinements that return truthy values. * @return {SearchParameters} */ clearRefinements: function clearRefinements(attribute) { var clear = RefinementList.clearRefinement; var patch = { numericRefinements: this._clearNumericRefinements(attribute), facetsRefinements: clear(this.facetsRefinements, attribute, 'conjunctiveFacet'), facetsExcludes: clear(this.facetsExcludes, attribute, 'exclude'), disjunctiveFacetsRefinements: clear(this.disjunctiveFacetsRefinements, attribute, 'disjunctiveFacet'), hierarchicalFacetsRefinements: clear(this.hierarchicalFacetsRefinements, attribute, 'hierarchicalFacet') }; if (patch.numericRefinements === this.numericRefinements && patch.facetsRefinements === this.facetsRefinements && patch.facetsExcludes === this.facetsExcludes && patch.disjunctiveFacetsRefinements === this.disjunctiveFacetsRefinements && patch.hierarchicalFacetsRefinements === this.hierarchicalFacetsRefinements) { return this; } return this.setQueryParameters(patch); }, /** * Remove all the refined tags from the SearchParameters * @method * @return {SearchParameters} */ clearTags: function clearTags() { if (this.tagFilters === undefined && this.tagRefinements.length === 0) return this; return this.setQueryParameters({ tagFilters: undefined, tagRefinements: [] }); }, /** * Set the index. * @method * @param {string} index the index name * @return {SearchParameters} */ setIndex: function setIndex(index) { if (index === this.index) return this; return this.setQueryParameters({ index: index }); }, /** * Query setter * @method * @param {string} newQuery value for the new query * @return {SearchParameters} */ setQuery: function setQuery(newQuery) { if (newQuery === this.query) return this; return this.setQueryParameters({ query: newQuery }); }, /** * Page setter * @method * @param {number} newPage new page number * @return {SearchParameters} */ setPage: function setPage(newPage) { if (newPage === this.page) return this; return this.setQueryParameters({ page: newPage }); }, /** * Facets setter * The facets are the simple facets, used for conjunctive (and) faceting. * @method * @param {string[]} facets all the attributes of the algolia records used for conjunctive faceting * @return {SearchParameters} */ setFacets: function setFacets(facets) { return this.setQueryParameters({ facets: facets }); }, /** * Disjunctive facets setter * Change the list of disjunctive (or) facets the helper chan handle. * @method * @param {string[]} facets all the attributes of the algolia records used for disjunctive faceting * @return {SearchParameters} */ setDisjunctiveFacets: function setDisjunctiveFacets(facets) { return this.setQueryParameters({ disjunctiveFacets: facets }); }, /** * HitsPerPage setter * Hits per page represents the number of hits retrieved for this query * @method * @param {number} n number of hits retrieved per page of results * @return {SearchParameters} */ setHitsPerPage: function setHitsPerPage(n) { if (this.hitsPerPage === n) return this; return this.setQueryParameters({ hitsPerPage: n }); }, /** * typoTolerance setter * Set the value of typoTolerance * @method * @param {string} typoTolerance new value of typoTolerance ("true", "false", "min" or "strict") * @return {SearchParameters} */ setTypoTolerance: function setTypoTolerance(typoTolerance) { if (this.typoTolerance === typoTolerance) return this; return this.setQueryParameters({ typoTolerance: typoTolerance }); }, /** * Add a numeric filter for a given attribute * When value is an array, they are combined with OR * When value is a single value, it will combined with AND * @method * @param {string} attribute attribute to set the filter on * @param {string} operator operator of the filter (possible values: =, >, >=, <, <=, !=) * @param {number | number[]} value value of the filter * @return {SearchParameters} * @example * // for price = 50 or 40 * searchparameter.addNumericRefinement('price', '=', [50, 40]); * @example * // for size = 38 and 40 * searchparameter.addNumericRefinement('size', '=', 38); * searchparameter.addNumericRefinement('size', '=', 40); */ addNumericRefinement: function(attribute, operator, v) { var value = valToNumber_1(v); if (this.isNumericRefined(attribute, operator, value)) return this; var mod = merge_1({}, this.numericRefinements); mod[attribute] = merge_1({}, mod[attribute]); if (mod[attribute][operator]) { // Array copy mod[attribute][operator] = mod[attribute][operator].slice(); // Add the element. Concat can't be used here because value can be an array. mod[attribute][operator].push(value); } else { mod[attribute][operator] = [value]; } return this.setQueryParameters({ numericRefinements: mod }); }, /** * Get the list of conjunctive refinements for a single facet * @param {string} facetName name of the attribute used for faceting * @return {string[]} list of refinements */ getConjunctiveRefinements: function(facetName) { if (!this.isConjunctiveFacet(facetName)) { throw new Error(facetName + ' is not defined in the facets attribute of the helper configuration'); } return this.facetsRefinements[facetName] || []; }, /** * Get the list of disjunctive refinements for a single facet * @param {string} facetName name of the attribute used for faceting * @return {string[]} list of refinements */ getDisjunctiveRefinements: function(facetName) { if (!this.isDisjunctiveFacet(facetName)) { throw new Error( facetName + ' is not defined in the disjunctiveFacets attribute of the helper configuration' ); } return this.disjunctiveFacetsRefinements[facetName] || []; }, /** * Get the list of hierarchical refinements for a single facet * @param {string} facetName name of the attribute used for faceting * @return {string[]} list of refinements */ getHierarchicalRefinement: function(facetName) { // we send an array but we currently do not support multiple // hierarchicalRefinements for a hierarchicalFacet return this.hierarchicalFacetsRefinements[facetName] || []; }, /** * Get the list of exclude refinements for a single facet * @param {string} facetName name of the attribute used for faceting * @return {string[]} list of refinements */ getExcludeRefinements: function(facetName) { if (!this.isConjunctiveFacet(facetName)) { throw new Error(facetName + ' is not defined in the facets attribute of the helper configuration'); } return this.facetsExcludes[facetName] || []; }, /** * Remove all the numeric filter for a given (attribute, operator) * @method * @param {string} attribute attribute to set the filter on * @param {string} [operator] operator of the filter (possible values: =, >, >=, <, <=, !=) * @param {number} [number] the value to be removed * @return {SearchParameters} */ removeNumericRefinement: function(attribute, operator, paramValue) { if (paramValue !== undefined) { var paramValueAsNumber = valToNumber_1(paramValue); if (!this.isNumericRefined(attribute, operator, paramValueAsNumber)) return this; return this.setQueryParameters({ numericRefinements: this._clearNumericRefinements(function(value, key) { return key === attribute && value.op === operator && isEqual_1(value.val, paramValueAsNumber); }) }); } else if (operator !== undefined) { if (!this.isNumericRefined(attribute, operator)) return this; return this.setQueryParameters({ numericRefinements: this._clearNumericRefinements(function(value, key) { return key === attribute && value.op === operator; }) }); } if (!this.isNumericRefined(attribute)) return this; return this.setQueryParameters({ numericRefinements: this._clearNumericRefinements(function(value, key) { return key === attribute; }) }); }, /** * Get the list of numeric refinements for a single facet * @param {string} facetName name of the attribute used for faceting * @return {SearchParameters.OperatorList[]} list of refinements */ getNumericRefinements: function(facetName) { return this.numericRefinements[facetName] || {}; }, /** * Return the current refinement for the (attribute, operator) * @param {string} attribute attribute in the record * @param {string} operator operator applied on the refined values * @return {Array.<number|number[]>} refined values */ getNumericRefinement: function(attribute, operator) { return this.numericRefinements[attribute] && this.numericRefinements[attribute][operator]; }, /** * Clear numeric filters. * @method * @private * @param {string|SearchParameters.clearCallback} [attribute] optional string or function * - If not given, means to clear all the filters. * - If `string`, means to clear all refinements for the `attribute` named filter. * - If `function`, means to clear all the refinements that return truthy values. * @return {Object.<string, OperatorList>} */ _clearNumericRefinements: function _clearNumericRefinements(attribute) { if (isUndefined_1(attribute)) { if (isEmpty_1(this.numericRefinements)) return this.numericRefinements; return {}; } else if (isString_1(attribute)) { if (isEmpty_1(this.numericRefinements[attribute])) return this.numericRefinements; return omit_1(this.numericRefinements, attribute); } else if (isFunction_1(attribute)) { var hasChanged = false; var newNumericRefinements = reduce_1(this.numericRefinements, function(memo, operators, key) { var operatorList = {}; forEach_1(operators, function(values, operator) { var outValues = []; forEach_1(values, function(value) { var predicateResult = attribute({val: value, op: operator}, key, 'numeric'); if (!predicateResult) outValues.push(value); }); if (!isEmpty_1(outValues)) { if (outValues.length !== values.length) hasChanged = true; operatorList[operator] = outValues; } else hasChanged = true; }); if (!isEmpty_1(operatorList)) memo[key] = operatorList; return memo; }, {}); if (hasChanged) return newNumericRefinements; return this.numericRefinements; } }, /** * Add a facet to the facets attribute of the helper configuration, if it * isn't already present. * @method * @param {string} facet facet name to add * @return {SearchParameters} */ addFacet: function addFacet(facet) { if (this.isConjunctiveFacet(facet)) { return this; } return this.setQueryParameters({ facets: this.facets.concat([facet]) }); }, /** * Add a disjunctive facet to the disjunctiveFacets attribute of the helper * configuration, if it isn't already present. * @method * @param {string} facet disjunctive facet name to add * @return {SearchParameters} */ addDisjunctiveFacet: function addDisjunctiveFacet(facet) { if (this.isDisjunctiveFacet(facet)) { return this; } return this.setQueryParameters({ disjunctiveFacets: this.disjunctiveFacets.concat([facet]) }); }, /** * Add a hierarchical facet to the hierarchicalFacets attribute of the helper * configuration. * @method * @param {object} hierarchicalFacet hierarchical facet to add * @return {SearchParameters} * @throws will throw an error if a hierarchical facet with the same name was already declared */ addHierarchicalFacet: function addHierarchicalFacet(hierarchicalFacet) { if (this.isHierarchicalFacet(hierarchicalFacet.name)) { throw new Error( 'Cannot declare two hierarchical facets with the same name: `' + hierarchicalFacet.name + '`'); } return this.setQueryParameters({ hierarchicalFacets: this.hierarchicalFacets.concat([hierarchicalFacet]) }); }, /** * Add a refinement on a "normal" facet * @method * @param {string} facet attribute to apply the faceting on * @param {string} value value of the attribute (will be converted to string) * @return {SearchParameters} */ addFacetRefinement: function addFacetRefinement(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } if (RefinementList.isRefined(this.facetsRefinements, facet, value)) return this; return this.setQueryParameters({ facetsRefinements: RefinementList.addRefinement(this.facetsRefinements, facet, value) }); }, /** * Exclude a value from a "normal" facet * @method * @param {string} facet attribute to apply the exclusion on * @param {string} value value of the attribute (will be converted to string) * @return {SearchParameters} */ addExcludeRefinement: function addExcludeRefinement(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } if (RefinementList.isRefined(this.facetsExcludes, facet, value)) return this; return this.setQueryParameters({ facetsExcludes: RefinementList.addRefinement(this.facetsExcludes, facet, value) }); }, /** * Adds a refinement on a disjunctive facet. * @method * @param {string} facet attribute to apply the faceting on * @param {string} value value of the attribute (will be converted to string) * @return {SearchParameters} */ addDisjunctiveFacetRefinement: function addDisjunctiveFacetRefinement(facet, value) { if (!this.isDisjunctiveFacet(facet)) { throw new Error( facet + ' is not defined in the disjunctiveFacets attribute of the helper configuration'); } if (RefinementList.isRefined(this.disjunctiveFacetsRefinements, facet, value)) return this; return this.setQueryParameters({ disjunctiveFacetsRefinements: RefinementList.addRefinement( this.disjunctiveFacetsRefinements, facet, value) }); }, /** * addTagRefinement adds a tag to the list used to filter the results * @param {string} tag tag to be added * @return {SearchParameters} */ addTagRefinement: function addTagRefinement(tag) { if (this.isTagRefined(tag)) return this; var modification = { tagRefinements: this.tagRefinements.concat(tag) }; return this.setQueryParameters(modification); }, /** * Remove a facet from the facets attribute of the helper configuration, if it * is present. * @method * @param {string} facet facet name to remove * @return {SearchParameters} */ removeFacet: function removeFacet(facet) { if (!this.isConjunctiveFacet(facet)) { return this; } return this.clearRefinements(facet).setQueryParameters({ facets: filter_1(this.facets, function(f) { return f !== facet; }) }); }, /** * Remove a disjunctive facet from the disjunctiveFacets attribute of the * helper configuration, if it is present. * @method * @param {string} facet disjunctive facet name to remove * @return {SearchParameters} */ removeDisjunctiveFacet: function removeDisjunctiveFacet(facet) { if (!this.isDisjunctiveFacet(facet)) { return this; } return this.clearRefinements(facet).setQueryParameters({ disjunctiveFacets: filter_1(this.disjunctiveFacets, function(f) { return f !== facet; }) }); }, /** * Remove a hierarchical facet from the hierarchicalFacets attribute of the * helper configuration, if it is present. * @method * @param {string} facet hierarchical facet name to remove * @return {SearchParameters} */ removeHierarchicalFacet: function removeHierarchicalFacet(facet) { if (!this.isHierarchicalFacet(facet)) { return this; } return this.clearRefinements(facet).setQueryParameters({ hierarchicalFacets: filter_1(this.hierarchicalFacets, function(f) { return f.name !== facet; }) }); }, /** * Remove a refinement set on facet. If a value is provided, it will clear the * refinement for the given value, otherwise it will clear all the refinement * values for the faceted attribute. * @method * @param {string} facet name of the attribute used for faceting * @param {string} [value] value used to filter * @return {SearchParameters} */ removeFacetRefinement: function removeFacetRefinement(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } if (!RefinementList.isRefined(this.facetsRefinements, facet, value)) return this; return this.setQueryParameters({ facetsRefinements: RefinementList.removeRefinement(this.facetsRefinements, facet, value) }); }, /** * Remove a negative refinement on a facet * @method * @param {string} facet name of the attribute used for faceting * @param {string} value value used to filter * @return {SearchParameters} */ removeExcludeRefinement: function removeExcludeRefinement(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } if (!RefinementList.isRefined(this.facetsExcludes, facet, value)) return this; return this.setQueryParameters({ facetsExcludes: RefinementList.removeRefinement(this.facetsExcludes, facet, value) }); }, /** * Remove a refinement on a disjunctive facet * @method * @param {string} facet name of the attribute used for faceting * @param {string} value value used to filter * @return {SearchParameters} */ removeDisjunctiveFacetRefinement: function removeDisjunctiveFacetRefinement(facet, value) { if (!this.isDisjunctiveFacet(facet)) { throw new Error( facet + ' is not defined in the disjunctiveFacets attribute of the helper configuration'); } if (!RefinementList.isRefined(this.disjunctiveFacetsRefinements, facet, value)) return this; return this.setQueryParameters({ disjunctiveFacetsRefinements: RefinementList.removeRefinement( this.disjunctiveFacetsRefinements, facet, value) }); }, /** * Remove a tag from the list of tag refinements * @method * @param {string} tag the tag to remove * @return {SearchParameters} */ removeTagRefinement: function removeTagRefinement(tag) { if (!this.isTagRefined(tag)) return this; var modification = { tagRefinements: filter_1(this.tagRefinements, function(t) { return t !== tag; }) }; return this.setQueryParameters(modification); }, /** * Generic toggle refinement method to use with facet, disjunctive facets * and hierarchical facets * @param {string} facet the facet to refine * @param {string} value the associated value * @return {SearchParameters} * @throws will throw an error if the facet is not declared in the settings of the helper * @deprecated since version 2.19.0, see {@link SearchParameters#toggleFacetRefinement} */ toggleRefinement: function toggleRefinement(facet, value) { return this.toggleFacetRefinement(facet, value); }, /** * Generic toggle refinement method to use with facet, disjunctive facets * and hierarchical facets * @param {string} facet the facet to refine * @param {string} value the associated value * @return {SearchParameters} * @throws will throw an error if the facet is not declared in the settings of the helper */ toggleFacetRefinement: function toggleFacetRefinement(facet, value) { if (this.isHierarchicalFacet(facet)) { return this.toggleHierarchicalFacetRefinement(facet, value); } else if (this.isConjunctiveFacet(facet)) { return this.toggleConjunctiveFacetRefinement(facet, value); } else if (this.isDisjunctiveFacet(facet)) { return this.toggleDisjunctiveFacetRefinement(facet, value); } throw new Error('Cannot refine the undeclared facet ' + facet + '; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets'); }, /** * Switch the refinement applied over a facet/value * @method * @param {string} facet name of the attribute used for faceting * @param {value} value value used for filtering * @return {SearchParameters} */ toggleConjunctiveFacetRefinement: function toggleConjunctiveFacetRefinement(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } return this.setQueryParameters({ facetsRefinements: RefinementList.toggleRefinement(this.facetsRefinements, facet, value) }); }, /** * Switch the refinement applied over a facet/value * @method * @param {string} facet name of the attribute used for faceting * @param {value} value value used for filtering * @return {SearchParameters} */ toggleExcludeFacetRefinement: function toggleExcludeFacetRefinement(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } return this.setQueryParameters({ facetsExcludes: RefinementList.toggleRefinement(this.facetsExcludes, facet, value) }); }, /** * Switch the refinement applied over a facet/value * @method * @param {string} facet name of the attribute used for faceting * @param {value} value value used for filtering * @return {SearchParameters} */ toggleDisjunctiveFacetRefinement: function toggleDisjunctiveFacetRefinement(facet, value) { if (!this.isDisjunctiveFacet(facet)) { throw new Error( facet + ' is not defined in the disjunctiveFacets attribute of the helper configuration'); } return this.setQueryParameters({ disjunctiveFacetsRefinements: RefinementList.toggleRefinement( this.disjunctiveFacetsRefinements, facet, value) }); }, /** * Switch the refinement applied over a facet/value * @method * @param {string} facet name of the attribute used for faceting * @param {value} value value used for filtering * @return {SearchParameters} */ toggleHierarchicalFacetRefinement: function toggleHierarchicalFacetRefinement(facet, value) { if (!this.isHierarchicalFacet(facet)) { throw new Error( facet + ' is not defined in the hierarchicalFacets attribute of the helper configuration'); } var separator = this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(facet)); var mod = {}; var upOneOrMultipleLevel = this.hierarchicalFacetsRefinements[facet] !== undefined && this.hierarchicalFacetsRefinements[facet].length > 0 && ( // remove current refinement: // refinement was 'beer > IPA', call is toggleRefine('beer > IPA'), refinement should be `beer` this.hierarchicalFacetsRefinements[facet][0] === value || // remove a parent refinement of the current refinement: // - refinement was 'beer > IPA > Flying dog' // - call is toggleRefine('beer > IPA') // - refinement should be `beer` this.hierarchicalFacetsRefinements[facet][0].indexOf(value + separator) === 0 ); if (upOneOrMultipleLevel) { if (value.indexOf(separator) === -1) { // go back to root level mod[facet] = []; } else { mod[facet] = [value.slice(0, value.lastIndexOf(separator))]; } } else { mod[facet] = [value]; } return this.setQueryParameters({ hierarchicalFacetsRefinements: defaults_1({}, mod, this.hierarchicalFacetsRefinements) }); }, /** * Adds a refinement on a hierarchical facet. * @param {string} facet the facet name * @param {string} path the hierarchical facet path * @return {SearchParameter} the new state * @throws Error if the facet is not defined or if the facet is refined */ addHierarchicalFacetRefinement: function(facet, path) { if (this.isHierarchicalFacetRefined(facet)) { throw new Error(facet + ' is already refined.'); } var mod = {}; mod[facet] = [path]; return this.setQueryParameters({ hierarchicalFacetsRefinements: defaults_1({}, mod, this.hierarchicalFacetsRefinements) }); }, /** * Removes the refinement set on a hierarchical facet. * @param {string} facet the facet name * @return {SearchParameter} the new state * @throws Error if the facet is not defined or if the facet is not refined */ removeHierarchicalFacetRefinement: function(facet) { if (!this.isHierarchicalFacetRefined(facet)) { throw new Error(facet + ' is not refined.'); } var mod = {}; mod[facet] = []; return this.setQueryParameters({ hierarchicalFacetsRefinements: defaults_1({}, mod, this.hierarchicalFacetsRefinements) }); }, /** * Switch the tag refinement * @method * @param {string} tag the tag to remove or add * @return {SearchParameters} */ toggleTagRefinement: function toggleTagRefinement(tag) { if (this.isTagRefined(tag)) { return this.removeTagRefinement(tag); } return this.addTagRefinement(tag); }, /** * Test if the facet name is from one of the disjunctive facets * @method * @param {string} facet facet name to test * @return {boolean} */ isDisjunctiveFacet: function(facet) { return indexOf_1(this.disjunctiveFacets, facet) > -1; }, /** * Test if the facet name is from one of the hierarchical facets * @method * @param {string} facetName facet name to test * @return {boolean} */ isHierarchicalFacet: function(facetName) { return this.getHierarchicalFacetByName(facetName) !== undefined; }, /** * Test if the facet name is from one of the conjunctive/normal facets * @method * @param {string} facet facet name to test * @return {boolean} */ isConjunctiveFacet: function(facet) { return indexOf_1(this.facets, facet) > -1; }, /** * Returns true if the facet is refined, either for a specific value or in * general. * @method * @param {string} facet name of the attribute for used for faceting * @param {string} value, optional value. If passed will test that this value * is filtering the given facet. * @return {boolean} returns true if refined */ isFacetRefined: function isFacetRefined(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } return RefinementList.isRefined(this.facetsRefinements, facet, value); }, /** * Returns true if the facet contains exclusions or if a specific value is * excluded. * * @method * @param {string} facet name of the attribute for used for faceting * @param {string} [value] optional value. If passed will test that this value * is filtering the given facet. * @return {boolean} returns true if refined */ isExcludeRefined: function isExcludeRefined(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } return RefinementList.isRefined(this.facetsExcludes, facet, value); }, /** * Returns true if the facet contains a refinement, or if a value passed is a * refinement for the facet. * @method * @param {string} facet name of the attribute for used for faceting * @param {string} value optional, will test if the value is used for refinement * if there is one, otherwise will test if the facet contains any refinement * @return {boolean} */ isDisjunctiveFacetRefined: function isDisjunctiveFacetRefined(facet, value) { if (!this.isDisjunctiveFacet(facet)) { throw new Error( facet + ' is not defined in the disjunctiveFacets attribute of the helper configuration'); } return RefinementList.isRefined(this.disjunctiveFacetsRefinements, facet, value); }, /** * Returns true if the facet contains a refinement, or if a value passed is a * refinement for the facet. * @method * @param {string} facet name of the attribute for used for faceting * @param {string} value optional, will test if the value is used for refinement * if there is one, otherwise will test if the facet contains any refinement * @return {boolean} */ isHierarchicalFacetRefined: function isHierarchicalFacetRefined(facet, value) { if (!this.isHierarchicalFacet(facet)) { throw new Error( facet + ' is not defined in the hierarchicalFacets attribute of the helper configuration'); } var refinements = this.getHierarchicalRefinement(facet); if (!value) { return refinements.length > 0; } return indexOf_1(refinements, value) !== -1; }, /** * Test if the triple (attribute, operator, value) is already refined. * If only the attribute and the operator are provided, it tests if the * contains any refinement value. * @method * @param {string} attribute attribute for which the refinement is applied * @param {string} [operator] operator of the refinement * @param {string} [value] value of the refinement * @return {boolean} true if it is refined */ isNumericRefined: function isNumericRefined(attribute, operator, value) { if (isUndefined_1(value) && isUndefined_1(operator)) { return !!this.numericRefinements[attribute]; } var isOperatorDefined = this.numericRefinements[attribute] && !isUndefined_1(this.numericRefinements[attribute][operator]); if (isUndefined_1(value) || !isOperatorDefined) { return isOperatorDefined; } var parsedValue = valToNumber_1(value); var isAttributeValueDefined = !isUndefined_1( findArray(this.numericRefinements[attribute][operator], parsedValue) ); return isOperatorDefined && isAttributeValueDefined; }, /** * Returns true if the tag refined, false otherwise * @method * @param {string} tag the tag to check * @return {boolean} */ isTagRefined: function isTagRefined(tag) { return indexOf_1(this.tagRefinements, tag) !== -1; }, /** * Returns the list of all disjunctive facets refined * @method * @param {string} facet name of the attribute used for faceting * @param {value} value value used for filtering * @return {string[]} */ getRefinedDisjunctiveFacets: function getRefinedDisjunctiveFacets() { // attributes used for numeric filter can also be disjunctive var disjunctiveNumericRefinedFacets = intersection_1( keys_1(this.numericRefinements), this.disjunctiveFacets ); return keys_1(this.disjunctiveFacetsRefinements) .concat(disjunctiveNumericRefinedFacets) .concat(this.getRefinedHierarchicalFacets()); }, /** * Returns the list of all disjunctive facets refined * @method * @param {string} facet name of the attribute used for faceting * @param {value} value value used for filtering * @return {string[]} */ getRefinedHierarchicalFacets: function getRefinedHierarchicalFacets() { return intersection_1( // enforce the order between the two arrays, // so that refinement name index === hierarchical facet index map_1(this.hierarchicalFacets, 'name'), keys_1(this.hierarchicalFacetsRefinements) ); }, /** * Returned the list of all disjunctive facets not refined * @method * @return {string[]} */ getUnrefinedDisjunctiveFacets: function() { var refinedFacets = this.getRefinedDisjunctiveFacets(); return filter_1(this.disjunctiveFacets, function(f) { return indexOf_1(refinedFacets, f) === -1; }); }, managedParameters: [ 'index', 'facets', 'disjunctiveFacets', 'facetsRefinements', 'facetsExcludes', 'disjunctiveFacetsRefinements', 'numericRefinements', 'tagRefinements', 'hierarchicalFacets', 'hierarchicalFacetsRefinements' ], getQueryParams: function getQueryParams() { var managedParameters = this.managedParameters; var queryParams = {}; forOwn_1(this, function(paramValue, paramName) { if (indexOf_1(managedParameters, paramName) === -1 && paramValue !== undefined) { queryParams[paramName] = paramValue; } }); return queryParams; }, /** * Let the user retrieve any parameter value from the SearchParameters * @param {string} paramName name of the parameter * @return {any} the value of the parameter */ getQueryParameter: function getQueryParameter(paramName) { if (!this.hasOwnProperty(paramName)) { throw new Error( "Parameter '" + paramName + "' is not an attribute of SearchParameters " + '(http://algolia.github.io/algoliasearch-helper-js/docs/SearchParameters.html)'); } return this[paramName]; }, /** * Let the user set a specific value for a given parameter. Will return the * same instance if the parameter is invalid or if the value is the same as the * previous one. * @method * @param {string} parameter the parameter name * @param {any} value the value to be set, must be compliant with the definition * of the attribute on the object * @return {SearchParameters} the updated state */ setQueryParameter: function setParameter(parameter, value) { if (this[parameter] === value) return this; var modification = {}; modification[parameter] = value; return this.setQueryParameters(modification); }, /** * Let the user set any of the parameters with a plain object. * @method * @param {object} params all the keys and the values to be updated * @return {SearchParameters} a new updated instance */ setQueryParameters: function setQueryParameters(params) { if (!params) return this; var error = SearchParameters.validate(this, params); if (error) { throw error; } var parsedParams = SearchParameters._parseNumbers(params); return this.mutateMe(function mergeWith(newInstance) { var ks = keys_1(params); forEach_1(ks, function(k) { newInstance[k] = parsedParams[k]; }); return newInstance; }); }, /** * Returns an object with only the selected attributes. * @param {string[]} filters filters to retrieve only a subset of the state. It * accepts strings that can be either attributes of the SearchParameters (e.g. hitsPerPage) * or attributes of the index with the notation 'attribute:nameOfMyAttribute' * @return {object} */ filter: function(filters) { return filterState_1(this, filters); }, /** * Helper function to make it easier to build new instances from a mutating * function * @private * @param {function} fn newMutableState -> previousState -> () function that will * change the value of the newMutable to the desired state * @return {SearchParameters} a new instance with the specified modifications applied */ mutateMe: function mutateMe(fn) { var newState = new this.constructor(this); fn(newState, this); return newState; }, /** * Helper function to get the hierarchicalFacet separator or the default one (`>`) * @param {object} hierarchicalFacet * @return {string} returns the hierarchicalFacet.separator or `>` as default */ _getHierarchicalFacetSortBy: function(hierarchicalFacet) { return hierarchicalFacet.sortBy || ['isRefined:desc', 'name:asc']; }, /** * Helper function to get the hierarchicalFacet separator or the default one (`>`) * @private * @param {object} hierarchicalFacet * @return {string} returns the hierarchicalFacet.separator or `>` as default */ _getHierarchicalFacetSeparator: function(hierarchicalFacet) { return hierarchicalFacet.separator || ' > '; }, /** * Helper function to get the hierarchicalFacet prefix path or null * @private * @param {object} hierarchicalFacet * @return {string} returns the hierarchicalFacet.rootPath or null as default */ _getHierarchicalRootPath: function(hierarchicalFacet) { return hierarchicalFacet.rootPath || null; }, /** * Helper function to check if we show the parent level of the hierarchicalFacet * @private * @param {object} hierarchicalFacet * @return {string} returns the hierarchicalFacet.showParentLevel or true as default */ _getHierarchicalShowParentLevel: function(hierarchicalFacet) { if (typeof hierarchicalFacet.showParentLevel === 'boolean') { return hierarchicalFacet.showParentLevel; } return true; }, /** * Helper function to get the hierarchicalFacet by it's name * @param {string} hierarchicalFacetName * @return {object} a hierarchicalFacet */ getHierarchicalFacetByName: function(hierarchicalFacetName) { return find_1( this.hierarchicalFacets, {name: hierarchicalFacetName} ); }, /** * Get the current breadcrumb for a hierarchical facet, as an array * @param {string} facetName Hierarchical facet name * @return {array.<string>} the path as an array of string */ getHierarchicalFacetBreadcrumb: function(facetName) { if (!this.isHierarchicalFacet(facetName)) { throw new Error( 'Cannot get the breadcrumb of an unknown hierarchical facet: `' + facetName + '`'); } var refinement = this.getHierarchicalRefinement(facetName)[0]; if (!refinement) return []; var separator = this._getHierarchicalFacetSeparator( this.getHierarchicalFacetByName(facetName) ); var path = refinement.split(separator); return map_1(path, trim_1); }, toString: function() { return JSON.stringify(this, null, 2); } }; /** * Callback used for clearRefinement method * @callback SearchParameters.clearCallback * @param {OperatorList|FacetList} value the value of the filter * @param {string} key the current attribute name * @param {string} type `numeric`, `disjunctiveFacet`, `conjunctiveFacet`, `hierarchicalFacet` or `exclude` * depending on the type of facet * @return {boolean} `true` if the element should be removed. `false` otherwise. */ var SearchParameters_1 = SearchParameters; /** * 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; } var compact_1 = compact; /** * The base implementation of `_.sum` and `_.sumBy` without support for * iteratee shorthands. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {number} Returns the sum. */ function baseSum(array, iteratee) { var result, index = -1, length = array.length; while (++index < length) { var current = iteratee(array[index]); if (current !== undefined) { result = result === undefined ? current : (result + current); } } return result; } var _baseSum = baseSum; /** * This method is like `_.sum` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the value to be summed. * The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the sum. * @example * * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; * * _.sumBy(objects, function(o) { return o.n; }); * // => 20 * * // The `_.property` iteratee shorthand. * _.sumBy(objects, 'n'); * // => 20 */ function sumBy(array, iteratee) { return (array && array.length) ? _baseSum(array, _baseIteratee(iteratee, 2)) : 0; } var sumBy_1 = sumBy; /** * 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]; }); } var _baseValues = baseValues; /** * 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_1(object)); } var values_1 = values; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax$3 = 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_1(collection) ? collection : values_1(collection); fromIndex = (fromIndex && !guard) ? toInteger_1(fromIndex) : 0; var length = collection.length; if (fromIndex < 0) { fromIndex = nativeMax$3(length + fromIndex, 0); } return isString_1(collection) ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) : (!!length && _baseIndexOf(collection, value, fromIndex) > -1); } var includes_1 = includes; /** * 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; } var _baseSortBy = baseSortBy; /** * 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_1(value); var othIsDefined = other !== undefined, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol_1(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; } var _compareAscending = compareAscending; /** * 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; } var _compareMultiple = compareMultiple; /** * 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) { var index = -1; iteratees = _arrayMap(iteratees.length ? iteratees : [identity_1], _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); }); } var _baseOrderBy = baseOrderBy; /** * 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_1(iteratees)) { iteratees = iteratees == null ? [] : [iteratees]; } orders = guard ? undefined : orders; if (!isArray_1(orders)) { orders = orders == null ? [] : [orders]; } return _baseOrderBy(collection, iteratees, orders); } var orderBy_1 = orderBy; /** Used to store function metadata. */ var metaMap = _WeakMap && new _WeakMap; var _metaMap = metaMap; /** * The base implementation of `setData` without support for hot loop shorting. * * @private * @param {Function} func The function to associate metadata with. * @param {*} data The metadata. * @returns {Function} Returns `func`. */ var baseSetData = !_metaMap ? identity_1 : function(func, data) { _metaMap.set(func, data); return func; }; var _baseSetData = baseSetData; /** * Creates a function that produces an instance of `Ctor` regardless of * whether it was invoked as part of a `new` expression or by `call` or `apply`. * * @private * @param {Function} Ctor The constructor to wrap. * @returns {Function} Returns the new wrapped function. */ function createCtor(Ctor) { return function() { // Use a `switch` statement to work with class constructors. See // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist // for more details. var args = arguments; switch (args.length) { case 0: return new Ctor; case 1: return new Ctor(args[0]); case 2: return new Ctor(args[0], args[1]); case 3: return new Ctor(args[0], args[1], args[2]); case 4: return new Ctor(args[0], args[1], args[2], args[3]); case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); } var thisBinding = _baseCreate(Ctor.prototype), result = Ctor.apply(thisBinding, args); // Mimic the constructor's `return` behavior. // See https://es5.github.io/#x13.2.2 for more details. return isObject_1(result) ? result : thisBinding; }; } var _createCtor = createCtor; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG = 1; /** * Creates a function that wraps `func` to invoke it with the optional `this` * binding of `thisArg`. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @returns {Function} Returns the new wrapped function. */ function createBind(func, bitmask, thisArg) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = _createCtor(func); function wrapper() { var fn = (this && this !== _root && this instanceof wrapper) ? Ctor : func; return fn.apply(isBind ? thisArg : this, arguments); } return wrapper; } var _createBind = createBind; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax$4 = Math.max; /** * Creates an array that is the composition of partially applied arguments, * placeholders, and provided arguments into a single array of arguments. * * @private * @param {Array} args The provided arguments. * @param {Array} partials The arguments to prepend to those provided. * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. */ function composeArgs(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax$4(argsLength - holdersLength, 0), result = Array(leftLength + rangeLength), isUncurried = !isCurried; while (++leftIndex < leftLength) { result[leftIndex] = partials[leftIndex]; } while (++argsIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result[holders[argsIndex]] = args[argsIndex]; } } while (rangeLength--) { result[leftIndex++] = args[argsIndex++]; } return result; } var _composeArgs = composeArgs; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax$5 = Math.max; /** * This function is like `composeArgs` except that the arguments composition * is tailored for `_.partialRight`. * * @private * @param {Array} args The provided arguments. * @param {Array} partials The arguments to append to those provided. * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. */ function composeArgsRight(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax$5(argsLength - holdersLength, 0), result = Array(rangeLength + rightLength), isUncurried = !isCurried; while (++argsIndex < rangeLength) { result[argsIndex] = args[argsIndex]; } var offset = argsIndex; while (++rightIndex < rightLength) { result[offset + rightIndex] = partials[rightIndex]; } while (++holdersIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result[offset + holders[holdersIndex]] = args[argsIndex++]; } } return result; } var _composeArgsRight = composeArgsRight; /** * Gets the number of `placeholder` occurrences in `array`. * * @private * @param {Array} array The array to inspect. * @param {*} placeholder The placeholder to search for. * @returns {number} Returns the placeholder count. */ function countHolders(array, placeholder) { var length = array.length, result = 0; while (length--) { if (array[length] === placeholder) { ++result; } } return result; } var _countHolders = countHolders; /** * The function whose prototype chain sequence wrappers inherit from. * * @private */ function baseLodash() { // No operation performed. } var _baseLodash = baseLodash; /** Used as references for the maximum length and index of an array. */ var MAX_ARRAY_LENGTH = 4294967295; /** * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. * * @private * @constructor * @param {*} value The value to wrap. */ function LazyWrapper(value) { this.__wrapped__ = value; this.__actions__ = []; this.__dir__ = 1; this.__filtered__ = false; this.__iteratees__ = []; this.__takeCount__ = MAX_ARRAY_LENGTH; this.__views__ = []; } // Ensure `LazyWrapper` is an instance of `baseLodash`. LazyWrapper.prototype = _baseCreate(_baseLodash.prototype); LazyWrapper.prototype.constructor = LazyWrapper; var _LazyWrapper = LazyWrapper; /** * This method returns `undefined`. * * @static * @memberOf _ * @since 2.3.0 * @category Util * @example * * _.times(2, _.noop); * // => [undefined, undefined] */ function noop$1() { // No operation performed. } var noop_1 = noop$1; /** * Gets metadata for `func`. * * @private * @param {Function} func The function to query. * @returns {*} Returns the metadata for `func`. */ var getData = !_metaMap ? noop_1 : function(func) { return _metaMap.get(func); }; var _getData = getData; /** Used to lookup unminified function names. */ var realNames = {}; var _realNames = realNames; /** Used for built-in method references. */ var objectProto$i = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$g = objectProto$i.hasOwnProperty; /** * Gets the name of `func`. * * @private * @param {Function} func The function to query. * @returns {string} Returns the function name. */ function getFuncName(func) { var result = (func.name + ''), array = _realNames[result], length = hasOwnProperty$g.call(_realNames, result) ? array.length : 0; while (length--) { var data = array[length], otherFunc = data.func; if (otherFunc == null || otherFunc == func) { return data.name; } } return result; } var _getFuncName = getFuncName; /** * The base constructor for creating `lodash` wrapper objects. * * @private * @param {*} value The value to wrap. * @param {boolean} [chainAll] Enable explicit method chain sequences. */ function LodashWrapper(value, chainAll) { this.__wrapped__ = value; this.__actions__ = []; this.__chain__ = !!chainAll; this.__index__ = 0; this.__values__ = undefined; } LodashWrapper.prototype = _baseCreate(_baseLodash.prototype); LodashWrapper.prototype.constructor = LodashWrapper; var _LodashWrapper = LodashWrapper; /** * Creates a clone of `wrapper`. * * @private * @param {Object} wrapper The wrapper to clone. * @returns {Object} Returns the cloned wrapper. */ function wrapperClone(wrapper) { if (wrapper instanceof _LazyWrapper) { return wrapper.clone(); } var result = new _LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); result.__actions__ = _copyArray(wrapper.__actions__); result.__index__ = wrapper.__index__; result.__values__ = wrapper.__values__; return result; } var _wrapperClone = wrapperClone; /** Used for built-in method references. */ var objectProto$j = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$h = objectProto$j.hasOwnProperty; /** * Creates a `lodash` object which wraps `value` to enable implicit method * chain sequences. Methods that operate on and return arrays, collections, * and functions can be chained together. Methods that retrieve a single value * or may return a primitive value will automatically end the chain sequence * and return the unwrapped value. Otherwise, the value must be unwrapped * with `_#value`. * * Explicit chain sequences, which must be unwrapped with `_#value`, may be * enabled using `_.chain`. * * The execution of chained methods is lazy, that is, it's deferred until * `_#value` is implicitly or explicitly called. * * Lazy evaluation allows several methods to support shortcut fusion. * Shortcut fusion is an optimization to merge iteratee calls; this avoids * the creation of intermediate arrays and can greatly reduce the number of * iteratee executions. Sections of a chain sequence qualify for shortcut * fusion if the section is applied to an array and iteratees accept only * one argument. The heuristic for whether a section qualifies for shortcut * fusion is subject to change. * * Chaining is supported in custom builds as long as the `_#value` method is * directly or indirectly included in the build. * * In addition to lodash methods, wrappers have `Array` and `String` methods. * * The wrapper `Array` methods are: * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` * * The wrapper `String` methods are: * `replace` and `split` * * The wrapper methods that support shortcut fusion are: * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` * * The chainable wrapper methods are: * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, * `zipObject`, `zipObjectDeep`, and `zipWith` * * The wrapper methods that are **not** chainable by default are: * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, * `upperFirst`, `value`, and `words` * * @name _ * @constructor * @category Seq * @param {*} value The value to wrap in a `lodash` instance. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * function square(n) { * return n * n; * } * * var wrapped = _([1, 2, 3]); * * // Returns an unwrapped value. * wrapped.reduce(_.add); * // => 6 * * // Returns a wrapped value. * var squares = wrapped.map(square); * * _.isArray(squares); * // => false * * _.isArray(squares.value()); * // => true */ function lodash(value) { if (isObjectLike_1(value) && !isArray_1(value) && !(value instanceof _LazyWrapper)) { if (value instanceof _LodashWrapper) { return value; } if (hasOwnProperty$h.call(value, '__wrapped__')) { return _wrapperClone(value); } } return new _LodashWrapper(value); } // Ensure wrappers are instances of `baseLodash`. lodash.prototype = _baseLodash.prototype; lodash.prototype.constructor = lodash; var wrapperLodash = lodash; /** * Checks if `func` has a lazy counterpart. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` has a lazy counterpart, * else `false`. */ function isLaziable(func) { var funcName = _getFuncName(func), other = wrapperLodash[funcName]; if (typeof other != 'function' || !(funcName in _LazyWrapper.prototype)) { return false; } if (func === other) { return true; } var data = _getData(other); return !!data && func === data[0]; } var _isLaziable = isLaziable; /** * Sets metadata for `func`. * * **Note:** If this function becomes hot, i.e. is invoked a lot in a short * period of time, it will trip its breaker and transition to an identity * function to avoid garbage collection pauses in V8. See * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) * for more details. * * @private * @param {Function} func The function to associate metadata with. * @param {*} data The metadata. * @returns {Function} Returns `func`. */ var setData = _shortOut(_baseSetData); var _setData = setData; /** Used to match wrap detail comments. */ var reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /; /** * Extracts wrapper details from the `source` body comment. * * @private * @param {string} source The source to inspect. * @returns {Array} Returns the wrapper details. */ function getWrapDetails(source) { var match = source.match(reWrapDetails); return match ? match[1].split(reSplitDetails) : []; } var _getWrapDetails = getWrapDetails; /** Used to match wrap detail comments. */ var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/; /** * Inserts wrapper `details` in a comment at the top of the `source` body. * * @private * @param {string} source The source to modify. * @returns {Array} details The details to insert. * @returns {string} Returns the modified source. */ function insertWrapDetails(source, details) { var length = details.length; if (!length) { return source; } var lastIndex = length - 1; details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; details = details.join(length > 2 ? ', ' : ' '); return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); } var _insertWrapDetails = insertWrapDetails; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG$1 = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512; /** Used to associate wrap methods with their bit flags. */ var wrapFlags = [ ['ary', WRAP_ARY_FLAG], ['bind', WRAP_BIND_FLAG$1], ['bindKey', WRAP_BIND_KEY_FLAG], ['curry', WRAP_CURRY_FLAG], ['curryRight', WRAP_CURRY_RIGHT_FLAG], ['flip', WRAP_FLIP_FLAG], ['partial', WRAP_PARTIAL_FLAG], ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], ['rearg', WRAP_REARG_FLAG] ]; /** * Updates wrapper `details` based on `bitmask` flags. * * @private * @returns {Array} details The details to modify. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @returns {Array} Returns `details`. */ function updateWrapDetails(details, bitmask) { _arrayEach(wrapFlags, function(pair) { var value = '_.' + pair[0]; if ((bitmask & pair[1]) && !_arrayIncludes(details, value)) { details.push(value); } }); return details.sort(); } var _updateWrapDetails = updateWrapDetails; /** * Sets the `toString` method of `wrapper` to mimic the source of `reference` * with wrapper details in a comment at the top of the source body. * * @private * @param {Function} wrapper The function to modify. * @param {Function} reference The reference function. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @returns {Function} Returns `wrapper`. */ function setWrapToString(wrapper, reference, bitmask) { var source = (reference + ''); return _setToString(wrapper, _insertWrapDetails(source, _updateWrapDetails(_getWrapDetails(source), bitmask))); } var _setWrapToString = setWrapToString; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG$2 = 1, WRAP_BIND_KEY_FLAG$1 = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG$1 = 8, WRAP_PARTIAL_FLAG$1 = 32, WRAP_PARTIAL_RIGHT_FLAG$1 = 64; /** * Creates a function that wraps `func` to continue currying. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {Function} wrapFunc The function to create the `func` wrapper. * @param {*} placeholder The placeholder value. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to * the new function. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { var isCurry = bitmask & WRAP_CURRY_FLAG$1, newHolders = isCurry ? holders : undefined, newHoldersRight = isCurry ? undefined : holders, newPartials = isCurry ? partials : undefined, newPartialsRight = isCurry ? undefined : partials; bitmask |= (isCurry ? WRAP_PARTIAL_FLAG$1 : WRAP_PARTIAL_RIGHT_FLAG$1); bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG$1 : WRAP_PARTIAL_FLAG$1); if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { bitmask &= ~(WRAP_BIND_FLAG$2 | WRAP_BIND_KEY_FLAG$1); } var newData = [ func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, newHoldersRight, argPos, ary, arity ]; var result = wrapFunc.apply(undefined, newData); if (_isLaziable(func)) { _setData(result, newData); } result.placeholder = placeholder; return _setWrapToString(result, func, bitmask); } var _createRecurry = createRecurry; /** * Gets the argument placeholder value for `func`. * * @private * @param {Function} func The function to inspect. * @returns {*} Returns the placeholder value. */ function getHolder(func) { var object = func; return object.placeholder; } var _getHolder = getHolder; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMin$1 = Math.min; /** * Reorder `array` according to the specified indexes where the element at * the first index is assigned as the first element, the element at * the second index is assigned as the second element, and so on. * * @private * @param {Array} array The array to reorder. * @param {Array} indexes The arranged array indexes. * @returns {Array} Returns `array`. */ function reorder(array, indexes) { var arrLength = array.length, length = nativeMin$1(indexes.length, arrLength), oldArray = _copyArray(array); while (length--) { var index = indexes[length]; array[length] = _isIndex(index, arrLength) ? oldArray[index] : undefined; } return array; } var _reorder = reorder; /** Used as the internal argument placeholder. */ var PLACEHOLDER = '__lodash_placeholder__'; /** * Replaces all `placeholder` elements in `array` with an internal placeholder * and returns an array of their indexes. * * @private * @param {Array} array The array to modify. * @param {*} placeholder The placeholder to replace. * @returns {Array} Returns the new array of placeholder indexes. */ function replaceHolders(array, placeholder) { var index = -1, length = array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (value === placeholder || value === PLACEHOLDER) { array[index] = PLACEHOLDER; result[resIndex++] = index; } } return result; } var _replaceHolders = replaceHolders; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG$3 = 1, WRAP_BIND_KEY_FLAG$2 = 2, WRAP_CURRY_FLAG$2 = 8, WRAP_CURRY_RIGHT_FLAG$1 = 16, WRAP_ARY_FLAG$1 = 128, WRAP_FLIP_FLAG$1 = 512; /** * Creates a function that wraps `func` to invoke it with optional `this` * binding of `thisArg`, partial application, and currying. * * @private * @param {Function|string} func The function or method name to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to * the new function. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [partialsRight] The arguments to append to those provided * to the new function. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { var isAry = bitmask & WRAP_ARY_FLAG$1, isBind = bitmask & WRAP_BIND_FLAG$3, isBindKey = bitmask & WRAP_BIND_KEY_FLAG$2, isCurried = bitmask & (WRAP_CURRY_FLAG$2 | WRAP_CURRY_RIGHT_FLAG$1), isFlip = bitmask & WRAP_FLIP_FLAG$1, Ctor = isBindKey ? undefined : _createCtor(func); function wrapper() { var length = arguments.length, args = Array(length), index = length; while (index--) { args[index] = arguments[index]; } if (isCurried) { var placeholder = _getHolder(wrapper), holdersCount = _countHolders(args, placeholder); } if (partials) { args = _composeArgs(args, partials, holders, isCurried); } if (partialsRight) { args = _composeArgsRight(args, partialsRight, holdersRight, isCurried); } length -= holdersCount; if (isCurried && length < arity) { var newHolders = _replaceHolders(args, placeholder); return _createRecurry( func, bitmask, createHybrid, wrapper.placeholder, thisArg, args, newHolders, argPos, ary, arity - length ); } var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func; length = args.length; if (argPos) { args = _reorder(args, argPos); } else if (isFlip && length > 1) { args.reverse(); } if (isAry && ary < length) { args.length = ary; } if (this && this !== _root && this instanceof wrapper) { fn = Ctor || _createCtor(fn); } return fn.apply(thisBinding, args); } return wrapper; } var _createHybrid = createHybrid; /** * Creates a function that wraps `func` to enable currying. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {number} arity The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createCurry(func, bitmask, arity) { var Ctor = _createCtor(func); function wrapper() { var length = arguments.length, args = Array(length), index = length, placeholder = _getHolder(wrapper); while (index--) { args[index] = arguments[index]; } var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) ? [] : _replaceHolders(args, placeholder); length -= holders.length; if (length < arity) { return _createRecurry( func, bitmask, _createHybrid, wrapper.placeholder, undefined, args, holders, undefined, undefined, arity - length); } var fn = (this && this !== _root && this instanceof wrapper) ? Ctor : func; return _apply(fn, this, args); } return wrapper; } var _createCurry = createCurry; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG$4 = 1; /** * Creates a function that wraps `func` to invoke it with the `this` binding * of `thisArg` and `partials` prepended to the arguments it receives. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} thisArg The `this` binding of `func`. * @param {Array} partials The arguments to prepend to those provided to * the new function. * @returns {Function} Returns the new wrapped function. */ function createPartial(func, bitmask, thisArg, partials) { var isBind = bitmask & WRAP_BIND_FLAG$4, Ctor = _createCtor(func); function wrapper() { var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array(leftLength + argsLength), fn = (this && this !== _root && this instanceof wrapper) ? Ctor : func; while (++leftIndex < leftLength) { args[leftIndex] = partials[leftIndex]; } while (argsLength--) { args[leftIndex++] = arguments[++argsIndex]; } return _apply(fn, isBind ? thisArg : this, args); } return wrapper; } var _createPartial = createPartial; /** Used as the internal argument placeholder. */ var PLACEHOLDER$1 = '__lodash_placeholder__'; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG$5 = 1, WRAP_BIND_KEY_FLAG$3 = 2, WRAP_CURRY_BOUND_FLAG$1 = 4, WRAP_CURRY_FLAG$3 = 8, WRAP_ARY_FLAG$2 = 128, WRAP_REARG_FLAG$1 = 256; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMin$2 = Math.min; /** * Merges the function metadata of `source` into `data`. * * Merging metadata reduces the number of wrappers used to invoke a function. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` * may be applied regardless of execution order. Methods like `_.ary` and * `_.rearg` modify function arguments, making the order in which they are * executed important, preventing the merging of metadata. However, we make * an exception for a safe combined case where curried functions have `_.ary` * and or `_.rearg` applied. * * @private * @param {Array} data The destination metadata. * @param {Array} source The source metadata. * @returns {Array} Returns `data`. */ function mergeData(data, source) { var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG$5 | WRAP_BIND_KEY_FLAG$3 | WRAP_ARY_FLAG$2); var isCombo = ((srcBitmask == WRAP_ARY_FLAG$2) && (bitmask == WRAP_CURRY_FLAG$3)) || ((srcBitmask == WRAP_ARY_FLAG$2) && (bitmask == WRAP_REARG_FLAG$1) && (data[7].length <= source[8])) || ((srcBitmask == (WRAP_ARY_FLAG$2 | WRAP_REARG_FLAG$1)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG$3)); // Exit early if metadata can't be merged. if (!(isCommon || isCombo)) { return data; } // Use source `thisArg` if available. if (srcBitmask & WRAP_BIND_FLAG$5) { data[2] = source[2]; // Set when currying a bound function. newBitmask |= bitmask & WRAP_BIND_FLAG$5 ? 0 : WRAP_CURRY_BOUND_FLAG$1; } // Compose partial arguments. var value = source[3]; if (value) { var partials = data[3]; data[3] = partials ? _composeArgs(partials, value, source[4]) : value; data[4] = partials ? _replaceHolders(data[3], PLACEHOLDER$1) : source[4]; } // Compose partial right arguments. value = source[5]; if (value) { partials = data[5]; data[5] = partials ? _composeArgsRight(partials, value, source[6]) : value; data[6] = partials ? _replaceHolders(data[5], PLACEHOLDER$1) : source[6]; } // Use source `argPos` if available. value = source[7]; if (value) { data[7] = value; } // Use source `ary` if it's smaller. if (srcBitmask & WRAP_ARY_FLAG$2) { data[8] = data[8] == null ? source[8] : nativeMin$2(data[8], source[8]); } // Use source `arity` if one is not provided. if (data[9] == null) { data[9] = source[9]; } // Use source `func` and merge bitmasks. data[0] = source[0]; data[1] = newBitmask; return data; } var _mergeData = mergeData; /** Error message constants. */ var FUNC_ERROR_TEXT$1 = 'Expected a function'; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG$6 = 1, WRAP_BIND_KEY_FLAG$4 = 2, WRAP_CURRY_FLAG$4 = 8, WRAP_CURRY_RIGHT_FLAG$2 = 16, WRAP_PARTIAL_FLAG$2 = 32, WRAP_PARTIAL_RIGHT_FLAG$2 = 64; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax$6 = Math.max; /** * Creates a function that either curries or invokes `func` with optional * `this` binding and partially applied arguments. * * @private * @param {Function|string} func The function or method name to wrap. * @param {number} bitmask The bitmask flags. * 1 - `_.bind` * 2 - `_.bindKey` * 4 - `_.curry` or `_.curryRight` of a bound function * 8 - `_.curry` * 16 - `_.curryRight` * 32 - `_.partial` * 64 - `_.partialRight` * 128 - `_.rearg` * 256 - `_.ary` * 512 - `_.flip` * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to be partially applied. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { var isBindKey = bitmask & WRAP_BIND_KEY_FLAG$4; if (!isBindKey && typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT$1); } var length = partials ? partials.length : 0; if (!length) { bitmask &= ~(WRAP_PARTIAL_FLAG$2 | WRAP_PARTIAL_RIGHT_FLAG$2); partials = holders = undefined; } ary = ary === undefined ? ary : nativeMax$6(toInteger_1(ary), 0); arity = arity === undefined ? arity : toInteger_1(arity); length -= holders ? holders.length : 0; if (bitmask & WRAP_PARTIAL_RIGHT_FLAG$2) { var partialsRight = partials, holdersRight = holders; partials = holders = undefined; } var data = isBindKey ? undefined : _getData(func); var newData = [ func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity ]; if (data) { _mergeData(newData, data); } func = newData[0]; bitmask = newData[1]; thisArg = newData[2]; partials = newData[3]; holders = newData[4]; arity = newData[9] = newData[9] === undefined ? (isBindKey ? 0 : func.length) : nativeMax$6(newData[9] - length, 0); if (!arity && bitmask & (WRAP_CURRY_FLAG$4 | WRAP_CURRY_RIGHT_FLAG$2)) { bitmask &= ~(WRAP_CURRY_FLAG$4 | WRAP_CURRY_RIGHT_FLAG$2); } if (!bitmask || bitmask == WRAP_BIND_FLAG$6) { var result = _createBind(func, bitmask, thisArg); } else if (bitmask == WRAP_CURRY_FLAG$4 || bitmask == WRAP_CURRY_RIGHT_FLAG$2) { result = _createCurry(func, bitmask, arity); } else if ((bitmask == WRAP_PARTIAL_FLAG$2 || bitmask == (WRAP_BIND_FLAG$6 | WRAP_PARTIAL_FLAG$2)) && !holders.length) { result = _createPartial(func, bitmask, thisArg, partials); } else { result = _createHybrid.apply(undefined, newData); } var setter = data ? _baseSetData : _setData; return _setWrapToString(setter(result, newData), func, bitmask); } var _createWrap = createWrap; /** Used to compose bitmasks for function metadata. */ var WRAP_PARTIAL_FLAG$3 = 32; /** * Creates a function that invokes `func` with `partials` prepended to the * arguments it receives. This method is like `_.bind` except it does **not** * alter the `this` binding. * * The `_.partial.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * **Note:** This method doesn't set the "length" property of partially * applied functions. * * @static * @memberOf _ * @since 0.2.0 * @category Function * @param {Function} func The function to partially apply arguments to. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new partially applied function. * @example * * function greet(greeting, name) { * return greeting + ' ' + name; * } * * var sayHelloTo = _.partial(greet, 'hello'); * sayHelloTo('fred'); * // => 'hello fred' * * // Partially applied with placeholders. * var greetFred = _.partial(greet, _, 'fred'); * greetFred('hi'); * // => 'hi fred' */ var partial = _baseRest(function(func, partials) { var holders = _replaceHolders(partials, _getHolder(partial)); return _createWrap(func, WRAP_PARTIAL_FLAG$3, undefined, partials, holders); }); // Assign default placeholders. partial.placeholder = {}; var partial_1 = partial; /** Used to compose bitmasks for function metadata. */ var WRAP_PARTIAL_RIGHT_FLAG$3 = 64; /** * This method is like `_.partial` except that partially applied arguments * are appended to the arguments it receives. * * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * **Note:** This method doesn't set the "length" property of partially * applied functions. * * @static * @memberOf _ * @since 1.0.0 * @category Function * @param {Function} func The function to partially apply arguments to. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new partially applied function. * @example * * function greet(greeting, name) { * return greeting + ' ' + name; * } * * var greetFred = _.partialRight(greet, 'fred'); * greetFred('hi'); * // => 'hi fred' * * // Partially applied with placeholders. * var sayHelloTo = _.partialRight(greet, 'hello', _); * sayHelloTo('fred'); * // => 'hello fred' */ var partialRight = _baseRest(function(func, partials) { var holders = _replaceHolders(partials, _getHolder(partialRight)); return _createWrap(func, WRAP_PARTIAL_RIGHT_FLAG$3, undefined, partials, holders); }); // Assign default placeholders. partialRight.placeholder = {}; var partialRight_1 = partialRight; /** * 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; } var _baseClamp = baseClamp; /** * Checks if `string` starts with the given target string. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {string} [target] The string to search for. * @param {number} [position=0] The position to search from. * @returns {boolean} Returns `true` if `string` starts with `target`, * else `false`. * @example * * _.startsWith('abc', 'a'); * // => true * * _.startsWith('abc', 'b'); * // => false * * _.startsWith('abc', 'b', 1); * // => true */ function startsWith(string, target, position) { string = toString_1(string); position = position == null ? 0 : _baseClamp(toInteger_1(position), 0, string.length); target = _baseToString(target); return string.slice(position, position + target.length) == target; } var startsWith_1 = startsWith; /** * Transform sort format from user friendly notation to lodash format * @param {string[]} sortBy array of predicate of the form "attribute:order" * @return {array.<string[]>} array containing 2 elements : attributes, orders */ var formatSort = function formatSort(sortBy, defaults) { return reduce_1(sortBy, function preparePredicate(out, sortInstruction) { var sortInstructions = sortInstruction.split(':'); if (defaults && sortInstructions.length === 1) { var similarDefault = find_1(defaults, function(predicate) { return startsWith_1(predicate, sortInstruction[0]); }); if (similarDefault) { sortInstructions = similarDefault.split(':'); } } out[0].push(sortInstructions[0]); out[1].push(sortInstructions[1]); return out; }, [[], []]); }; /** * The base implementation of `_.set`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @param {Function} [customizer] The function to customize path creation. * @returns {Object} Returns `object`. */ function baseSet(object, path, value, customizer) { if (!isObject_1(object)) { return object; } path = _castPath(path, object); var index = -1, length = path.length, lastIndex = length - 1, nested = object; while (nested != null && ++index < length) { var key = _toKey(path[index]), newValue = value; if (index != lastIndex) { var objValue = nested[key]; newValue = customizer ? customizer(objValue, key, nested) : undefined; if (newValue === undefined) { newValue = isObject_1(objValue) ? objValue : (_isIndex(path[index + 1]) ? [] : {}); } } _assignValue(nested, key, newValue); nested = nested[key]; } return object; } var _baseSet = baseSet; /** * The base implementation of `_.pickBy` without support for iteratee shorthands. * * @private * @param {Object} object The source object. * @param {string[]} paths The property paths to pick. * @param {Function} predicate The function invoked per property. * @returns {Object} Returns the new object. */ function basePickBy(object, paths, predicate) { var index = -1, length = paths.length, result = {}; while (++index < length) { var path = paths[index], value = _baseGet(object, path); if (predicate(value, path)) { _baseSet(result, _castPath(path, object), value); } } return result; } var _basePickBy = basePickBy; /** * Creates an object composed of the `object` properties `predicate` returns * truthy for. The predicate is invoked with two arguments: (value, key). * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The source object. * @param {Function} [predicate=_.identity] The function invoked per property. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.pickBy(object, _.isNumber); * // => { 'a': 1, 'c': 3 } */ function pickBy(object, predicate) { if (object == null) { return {}; } var props = _arrayMap(_getAllKeysIn(object), function(prop) { return [prop]; }); predicate = _baseIteratee(predicate); return _basePickBy(object, props, function(value, path) { return predicate(value, path[0]); }); } var pickBy_1 = pickBy; var generateHierarchicalTree_1 = generateTrees; function generateTrees(state) { return function generate(hierarchicalFacetResult, hierarchicalFacetIndex) { var hierarchicalFacet = state.hierarchicalFacets[hierarchicalFacetIndex]; var hierarchicalFacetRefinement = state.hierarchicalFacetsRefinements[hierarchicalFacet.name] && state.hierarchicalFacetsRefinements[hierarchicalFacet.name][0] || ''; var hierarchicalSeparator = state._getHierarchicalFacetSeparator(hierarchicalFacet); var hierarchicalRootPath = state._getHierarchicalRootPath(hierarchicalFacet); var hierarchicalShowParentLevel = state._getHierarchicalShowParentLevel(hierarchicalFacet); var sortBy = formatSort(state._getHierarchicalFacetSortBy(hierarchicalFacet)); var generateTreeFn = generateHierarchicalTree(sortBy, hierarchicalSeparator, hierarchicalRootPath, hierarchicalShowParentLevel, hierarchicalFacetRefinement); var results = hierarchicalFacetResult; if (hierarchicalRootPath) { results = hierarchicalFacetResult.slice(hierarchicalRootPath.split(hierarchicalSeparator).length); } return reduce_1(results, generateTreeFn, { name: state.hierarchicalFacets[hierarchicalFacetIndex].name, count: null, // root level, no count isRefined: true, // root level, always refined path: null, // root level, no path data: null }); }; } function generateHierarchicalTree(sortBy, hierarchicalSeparator, hierarchicalRootPath, hierarchicalShowParentLevel, currentRefinement) { return function generateTree(hierarchicalTree, hierarchicalFacetResult, currentHierarchicalLevel) { var parent = hierarchicalTree; if (currentHierarchicalLevel > 0) { var level = 0; parent = hierarchicalTree; while (level < currentHierarchicalLevel) { parent = parent && find_1(parent.data, {isRefined: true}); level++; } } // we found a refined parent, let's add current level data under it if (parent) { // filter values in case an object has multiple categories: // { // categories: { // level0: ['beers', 'bières'], // level1: ['beers > IPA', 'bières > Belges'] // } // } // // If parent refinement is `beers`, then we do not want to have `bières > Belges` // showing up var onlyMatchingValuesFn = filterFacetValues(parent.path || hierarchicalRootPath, currentRefinement, hierarchicalSeparator, hierarchicalRootPath, hierarchicalShowParentLevel); parent.data = orderBy_1( map_1( pickBy_1(hierarchicalFacetResult.data, onlyMatchingValuesFn), formatHierarchicalFacetValue(hierarchicalSeparator, currentRefinement) ), sortBy[0], sortBy[1] ); } return hierarchicalTree; }; } function filterFacetValues(parentPath, currentRefinement, hierarchicalSeparator, hierarchicalRootPath, hierarchicalShowParentLevel) { return function(facetCount, facetValue) { // we want the facetValue is a child of hierarchicalRootPath if (hierarchicalRootPath && (facetValue.indexOf(hierarchicalRootPath) !== 0 || hierarchicalRootPath === facetValue)) { return false; } // we always want root levels (only when there is no prefix path) return !hierarchicalRootPath && facetValue.indexOf(hierarchicalSeparator) === -1 || // if there is a rootPath, being root level mean 1 level under rootPath hierarchicalRootPath && facetValue.split(hierarchicalSeparator).length - hierarchicalRootPath.split(hierarchicalSeparator).length === 1 || // if current refinement is a root level and current facetValue is a root level, // keep the facetValue facetValue.indexOf(hierarchicalSeparator) === -1 && currentRefinement.indexOf(hierarchicalSeparator) === -1 || // currentRefinement is a child of the facet value currentRefinement.indexOf(facetValue) === 0 || // facetValue is a child of the current parent, add it facetValue.indexOf(parentPath + hierarchicalSeparator) === 0 && (hierarchicalShowParentLevel || facetValue.indexOf(currentRefinement) === 0); }; } function formatHierarchicalFacetValue(hierarchicalSeparator, currentRefinement) { return function format(facetCount, facetValue) { return { name: trim_1(last_1(facetValue.split(hierarchicalSeparator))), path: facetValue, count: facetCount, isRefined: currentRefinement === facetValue || currentRefinement.indexOf(facetValue + hierarchicalSeparator) === 0, data: null }; }; } /** * @typedef SearchResults.Facet * @type {object} * @property {string} name name of the attribute in the record * @property {object} data the faceting data: value, number of entries * @property {object} stats undefined unless facet_stats is retrieved from algolia */ /** * @typedef SearchResults.HierarchicalFacet * @type {object} * @property {string} name name of the current value given the hierarchical level, trimmed. * If root node, you get the facet name * @property {number} count number of objects matching this hierarchical value * @property {string} path the current hierarchical value full path * @property {boolean} isRefined `true` if the current value was refined, `false` otherwise * @property {HierarchicalFacet[]} data sub values for the current level */ /** * @typedef SearchResults.FacetValue * @type {object} * @property {string} name the facet value itself * @property {number} count times this facet appears in the results * @property {boolean} isRefined is the facet currently selected * @property {boolean} isExcluded is the facet currently excluded (only for conjunctive facets) */ /** * @typedef Refinement * @type {object} * @property {string} type the type of filter used: * `numeric`, `facet`, `exclude`, `disjunctive`, `hierarchical` * @property {string} attributeName name of the attribute used for filtering * @property {string} name the value of the filter * @property {number} numericValue the value as a number. Only for numeric filters. * @property {string} operator the operator used. Only for numeric filters. * @property {number} count the number of computed hits for this filter. Only on facets. * @property {boolean} exhaustive if the count is exhaustive */ function getIndices(obj) { var indices = {}; forEach_1(obj, function(val, idx) { indices[val] = idx; }); return indices; } function assignFacetStats(dest, facetStats, key) { if (facetStats && facetStats[key]) { dest.stats = facetStats[key]; } } function findMatchingHierarchicalFacetFromAttributeName(hierarchicalFacets, hierarchicalAttributeName) { return find_1( hierarchicalFacets, function facetKeyMatchesAttribute(hierarchicalFacet) { return includes_1(hierarchicalFacet.attributes, hierarchicalAttributeName); } ); } /*eslint-disable */ /** * Constructor for SearchResults * @class * @classdesc SearchResults contains the results of a query to Algolia using the * {@link AlgoliaSearchHelper}. * @param {SearchParameters} state state that led to the response * @param {array.<object>} results the results from algolia client * @example <caption>SearchResults of the first query in * <a href="http://demos.algolia.com/instant-search-demo">the instant search demo</a></caption> { "hitsPerPage": 10, "processingTimeMS": 2, "facets": [ { "name": "type", "data": { "HardGood": 6627, "BlackTie": 550, "Music": 665, "Software": 131, "Game": 456, "Movie": 1571 }, "exhaustive": false }, { "exhaustive": false, "data": { "Free shipping": 5507 }, "name": "shipping" } ], "hits": [ { "thumbnailImage": "http://img.bbystatic.com/BestBuy_US/images/products/1688/1688832_54x108_s.gif", "_highlightResult": { "shortDescription": { "matchLevel": "none", "value": "Safeguard your PC, Mac, Android and iOS devices with comprehensive Internet protection", "matchedWords": [] }, "category": { "matchLevel": "none", "value": "Computer Security Software", "matchedWords": [] }, "manufacturer": { "matchedWords": [], "value": "Webroot", "matchLevel": "none" }, "name": { "value": "Webroot SecureAnywhere Internet Security (3-Device) (1-Year Subscription) - Mac/Windows", "matchedWords": [], "matchLevel": "none" } }, "image": "http://img.bbystatic.com/BestBuy_US/images/products/1688/1688832_105x210_sc.jpg", "shipping": "Free shipping", "bestSellingRank": 4, "shortDescription": "Safeguard your PC, Mac, Android and iOS devices with comprehensive Internet protection", "url": "http://www.bestbuy.com/site/webroot-secureanywhere-internet-security-3-devi…d=1219060687969&skuId=1688832&cmp=RMX&ky=2d3GfEmNIzjA0vkzveHdZEBgpPCyMnLTJ", "name": "Webroot SecureAnywhere Internet Security (3-Device) (1-Year Subscription) - Mac/Windows", "category": "Computer Security Software", "salePrice_range": "1 - 50", "objectID": "1688832", "type": "Software", "customerReviewCount": 5980, "salePrice": 49.99, "manufacturer": "Webroot" }, .... ], "nbHits": 10000, "disjunctiveFacets": [ { "exhaustive": false, "data": { "5": 183, "12": 112, "7": 149, ... }, "name": "customerReviewCount", "stats": { "max": 7461, "avg": 157.939, "min": 1 } }, { "data": { "Printer Ink": 142, "Wireless Speakers": 60, "Point & Shoot Cameras": 48, ... }, "name": "category", "exhaustive": false }, { "exhaustive": false, "data": { "> 5000": 2, "1 - 50": 6524, "501 - 2000": 566, "201 - 500": 1501, "101 - 200": 1360, "2001 - 5000": 47 }, "name": "salePrice_range" }, { "data": { "Dynex™": 202, "Insignia™": 230, "PNY": 72, ... }, "name": "manufacturer", "exhaustive": false } ], "query": "", "nbPages": 100, "page": 0, "index": "bestbuy" } **/ /*eslint-enable */ function SearchResults(state, results) { var mainSubResponse = results[0]; this._rawResults = results; /** * query used to generate the results * @member {string} */ this.query = mainSubResponse.query; /** * The query as parsed by the engine given all the rules. * @member {string} */ this.parsedQuery = mainSubResponse.parsedQuery; /** * all the records that match the search parameters. Each record is * augmented with a new attribute `_highlightResult` * which is an object keyed by attribute and with the following properties: * - `value` : the value of the facet highlighted (html) * - `matchLevel`: full, partial or none depending on how the query terms match * @member {object[]} */ this.hits = mainSubResponse.hits; /** * index where the results come from * @member {string} */ this.index = mainSubResponse.index; /** * number of hits per page requested * @member {number} */ this.hitsPerPage = mainSubResponse.hitsPerPage; /** * total number of hits of this query on the index * @member {number} */ this.nbHits = mainSubResponse.nbHits; /** * total number of pages with respect to the number of hits per page and the total number of hits * @member {number} */ this.nbPages = mainSubResponse.nbPages; /** * current page * @member {number} */ this.page = mainSubResponse.page; /** * sum of the processing time of all the queries * @member {number} */ this.processingTimeMS = sumBy_1(results, 'processingTimeMS'); /** * The position if the position was guessed by IP. * @member {string} * @example "48.8637,2.3615", */ this.aroundLatLng = mainSubResponse.aroundLatLng; /** * The radius computed by Algolia. * @member {string} * @example "126792922", */ this.automaticRadius = mainSubResponse.automaticRadius; /** * String identifying the server used to serve this request. * @member {string} * @example "c7-use-2.algolia.net", */ this.serverUsed = mainSubResponse.serverUsed; /** * Boolean that indicates if the computation of the counts did time out. * @deprecated * @member {boolean} */ this.timeoutCounts = mainSubResponse.timeoutCounts; /** * Boolean that indicates if the computation of the hits did time out. * @deprecated * @member {boolean} */ this.timeoutHits = mainSubResponse.timeoutHits; /** * True if the counts of the facets is exhaustive * @member {boolean} */ this.exhaustiveFacetsCount = mainSubResponse.exhaustiveFacetsCount; /** * True if the number of hits is exhaustive * @member {boolean} */ this.exhaustiveNbHits = mainSubResponse.exhaustiveNbHits; /** * Contains the userData if they are set by a [query rule](https://www.algolia.com/doc/guides/query-rules/query-rules-overview/). * @member {object[]} */ this.userData = mainSubResponse.userData; /** * queryID is the unique identifier of the query used to generate the current search results. * This value is only available if the `clickAnalytics` search parameter is set to `true`. * @member {string} */ this.queryID = mainSubResponse.queryID; /** * disjunctive facets results * @member {SearchResults.Facet[]} */ this.disjunctiveFacets = []; /** * disjunctive facets results * @member {SearchResults.HierarchicalFacet[]} */ this.hierarchicalFacets = map_1(state.hierarchicalFacets, function initFutureTree() { return []; }); /** * other facets results * @member {SearchResults.Facet[]} */ this.facets = []; var disjunctiveFacets = state.getRefinedDisjunctiveFacets(); var facetsIndices = getIndices(state.facets); var disjunctiveFacetsIndices = getIndices(state.disjunctiveFacets); var nextDisjunctiveResult = 1; var self = this; // Since we send request only for disjunctive facets that have been refined, // we get the facets informations from the first, general, response. forEach_1(mainSubResponse.facets, function(facetValueObject, facetKey) { var hierarchicalFacet = findMatchingHierarchicalFacetFromAttributeName( state.hierarchicalFacets, facetKey ); if (hierarchicalFacet) { // Place the hierarchicalFacet data at the correct index depending on // the attributes order that was defined at the helper initialization var facetIndex = hierarchicalFacet.attributes.indexOf(facetKey); var idxAttributeName = findIndex_1(state.hierarchicalFacets, {name: hierarchicalFacet.name}); self.hierarchicalFacets[idxAttributeName][facetIndex] = { attribute: facetKey, data: facetValueObject, exhaustive: mainSubResponse.exhaustiveFacetsCount }; } else { var isFacetDisjunctive = indexOf_1(state.disjunctiveFacets, facetKey) !== -1; var isFacetConjunctive = indexOf_1(state.facets, facetKey) !== -1; var position; if (isFacetDisjunctive) { position = disjunctiveFacetsIndices[facetKey]; self.disjunctiveFacets[position] = { name: facetKey, data: facetValueObject, exhaustive: mainSubResponse.exhaustiveFacetsCount }; assignFacetStats(self.disjunctiveFacets[position], mainSubResponse.facets_stats, facetKey); } if (isFacetConjunctive) { position = facetsIndices[facetKey]; self.facets[position] = { name: facetKey, data: facetValueObject, exhaustive: mainSubResponse.exhaustiveFacetsCount }; assignFacetStats(self.facets[position], mainSubResponse.facets_stats, facetKey); } } }); // Make sure we do not keep holes within the hierarchical facets this.hierarchicalFacets = compact_1(this.hierarchicalFacets); // aggregate the refined disjunctive facets forEach_1(disjunctiveFacets, function(disjunctiveFacet) { var result = results[nextDisjunctiveResult]; var hierarchicalFacet = state.getHierarchicalFacetByName(disjunctiveFacet); // There should be only item in facets. forEach_1(result.facets, function(facetResults, dfacet) { var position; if (hierarchicalFacet) { position = findIndex_1(state.hierarchicalFacets, {name: hierarchicalFacet.name}); var attributeIndex = findIndex_1(self.hierarchicalFacets[position], {attribute: dfacet}); // previous refinements and no results so not able to find it if (attributeIndex === -1) { return; } self.hierarchicalFacets[position][attributeIndex].data = merge_1( {}, self.hierarchicalFacets[position][attributeIndex].data, facetResults ); } else { position = disjunctiveFacetsIndices[dfacet]; var dataFromMainRequest = mainSubResponse.facets && mainSubResponse.facets[dfacet] || {}; self.disjunctiveFacets[position] = { name: dfacet, data: defaults_1({}, facetResults, dataFromMainRequest), exhaustive: result.exhaustiveFacetsCount }; assignFacetStats(self.disjunctiveFacets[position], result.facets_stats, dfacet); if (state.disjunctiveFacetsRefinements[dfacet]) { forEach_1(state.disjunctiveFacetsRefinements[dfacet], function(refinementValue) { // add the disjunctive refinements if it is no more retrieved if (!self.disjunctiveFacets[position].data[refinementValue] && indexOf_1(state.disjunctiveFacetsRefinements[dfacet], refinementValue) > -1) { self.disjunctiveFacets[position].data[refinementValue] = 0; } }); } } }); nextDisjunctiveResult++; }); // if we have some root level values for hierarchical facets, merge them forEach_1(state.getRefinedHierarchicalFacets(), function(refinedFacet) { var hierarchicalFacet = state.getHierarchicalFacetByName(refinedFacet); var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet); var currentRefinement = state.getHierarchicalRefinement(refinedFacet); // if we are already at a root refinement (or no refinement at all), there is no // root level values request if (currentRefinement.length === 0 || currentRefinement[0].split(separator).length < 2) { return; } var result = results[nextDisjunctiveResult]; forEach_1(result.facets, function(facetResults, dfacet) { var position = findIndex_1(state.hierarchicalFacets, {name: hierarchicalFacet.name}); var attributeIndex = findIndex_1(self.hierarchicalFacets[position], {attribute: dfacet}); // previous refinements and no results so not able to find it if (attributeIndex === -1) { return; } // when we always get root levels, if the hits refinement is `beers > IPA` (count: 5), // then the disjunctive values will be `beers` (count: 100), // but we do not want to display // | beers (100) // > IPA (5) // We want // | beers (5) // > IPA (5) var defaultData = {}; if (currentRefinement.length > 0) { var root = currentRefinement[0].split(separator)[0]; defaultData[root] = self.hierarchicalFacets[position][attributeIndex].data[root]; } self.hierarchicalFacets[position][attributeIndex].data = defaults_1( defaultData, facetResults, self.hierarchicalFacets[position][attributeIndex].data ); }); nextDisjunctiveResult++; }); // add the excludes forEach_1(state.facetsExcludes, function(excludes, facetName) { var position = facetsIndices[facetName]; self.facets[position] = { name: facetName, data: mainSubResponse.facets[facetName], exhaustive: mainSubResponse.exhaustiveFacetsCount }; forEach_1(excludes, function(facetValue) { self.facets[position] = self.facets[position] || {name: facetName}; self.facets[position].data = self.facets[position].data || {}; self.facets[position].data[facetValue] = 0; }); }); this.hierarchicalFacets = map_1(this.hierarchicalFacets, generateHierarchicalTree_1(state)); this.facets = compact_1(this.facets); this.disjunctiveFacets = compact_1(this.disjunctiveFacets); this._state = state; } /** * Get a facet object with its name * @deprecated * @param {string} name name of the faceted attribute * @return {SearchResults.Facet} the facet object */ SearchResults.prototype.getFacetByName = function(name) { var predicate = {name: name}; return find_1(this.facets, predicate) || find_1(this.disjunctiveFacets, predicate) || find_1(this.hierarchicalFacets, predicate); }; /** * Get the facet values of a specified attribute from a SearchResults object. * @private * @param {SearchResults} results the search results to search in * @param {string} attribute name of the faceted attribute to search for * @return {array|object} facet values. For the hierarchical facets it is an object. */ function extractNormalizedFacetValues(results, attribute) { var predicate = {name: attribute}; if (results._state.isConjunctiveFacet(attribute)) { var facet = find_1(results.facets, predicate); if (!facet) return []; return map_1(facet.data, function(v, k) { return { name: k, count: v, isRefined: results._state.isFacetRefined(attribute, k), isExcluded: results._state.isExcludeRefined(attribute, k) }; }); } else if (results._state.isDisjunctiveFacet(attribute)) { var disjunctiveFacet = find_1(results.disjunctiveFacets, predicate); if (!disjunctiveFacet) return []; return map_1(disjunctiveFacet.data, function(v, k) { return { name: k, count: v, isRefined: results._state.isDisjunctiveFacetRefined(attribute, k) }; }); } else if (results._state.isHierarchicalFacet(attribute)) { return find_1(results.hierarchicalFacets, predicate); } } /** * Sort nodes of a hierarchical facet results * @private * @param {HierarchicalFacet} node node to upon which we want to apply the sort */ function recSort(sortFn, node) { if (!node.data || node.data.length === 0) { return node; } var children = map_1(node.data, partial_1(recSort, sortFn)); var sortedChildren = sortFn(children); var newNode = merge_1({}, node, {data: sortedChildren}); return newNode; } SearchResults.DEFAULT_SORT = ['isRefined:desc', 'count:desc', 'name:asc']; function vanillaSortFn(order, data) { return data.sort(order); } /** * Get a the list of values for a given facet attribute. Those values are sorted * refinement first, descending count (bigger value on top), and name ascending * (alphabetical order). The sort formula can overridden using either string based * predicates or a function. * * This method will return all the values returned by the Algolia engine plus all * the values already refined. This means that it can happen that the * `maxValuesPerFacet` [configuration](https://www.algolia.com/doc/rest-api/search#param-maxValuesPerFacet) * might not be respected if you have facet values that are already refined. * @param {string} attribute attribute name * @param {object} opts configuration options. * @param {Array.<string> | function} opts.sortBy * When using strings, it consists of * the name of the [FacetValue](#SearchResults.FacetValue) or the * [HierarchicalFacet](#SearchResults.HierarchicalFacet) attributes with the * order (`asc` or `desc`). For example to order the value by count, the * argument would be `['count:asc']`. * * If only the attribute name is specified, the ordering defaults to the one * specified in the default value for this attribute. * * When not specified, the order is * ascending. This parameter can also be a function which takes two facet * values and should return a number, 0 if equal, 1 if the first argument is * bigger or -1 otherwise. * * The default value for this attribute `['isRefined:desc', 'count:desc', 'name:asc']` * @return {FacetValue[]|HierarchicalFacet} depending on the type of facet of * the attribute requested (hierarchical, disjunctive or conjunctive) * @example * helper.on('results', function(content){ * //get values ordered only by name ascending using the string predicate * content.getFacetValues('city', {sortBy: ['name:asc']}); * //get values ordered only by count ascending using a function * content.getFacetValues('city', { * // this is equivalent to ['count:asc'] * sortBy: function(a, b) { * if (a.count === b.count) return 0; * if (a.count > b.count) return 1; * if (b.count > a.count) return -1; * } * }); * }); */ SearchResults.prototype.getFacetValues = function(attribute, opts) { var facetValues = extractNormalizedFacetValues(this, attribute); if (!facetValues) throw new Error(attribute + ' is not a retrieved facet.'); var options = defaults_1({}, opts, {sortBy: SearchResults.DEFAULT_SORT}); if (Array.isArray(options.sortBy)) { var order = formatSort(options.sortBy, SearchResults.DEFAULT_SORT); if (Array.isArray(facetValues)) { return orderBy_1(facetValues, order[0], order[1]); } // If facetValues is not an array, it's an object thus a hierarchical facet object return recSort(partialRight_1(orderBy_1, order[0], order[1]), facetValues); } else if (isFunction_1(options.sortBy)) { if (Array.isArray(facetValues)) { return facetValues.sort(options.sortBy); } // If facetValues is not an array, it's an object thus a hierarchical facet object return recSort(partial_1(vanillaSortFn, options.sortBy), facetValues); } throw new Error( 'options.sortBy is optional but if defined it must be ' + 'either an array of string (predicates) or a sorting function' ); }; /** * Returns the facet stats if attribute is defined and the facet contains some. * Otherwise returns undefined. * @param {string} attribute name of the faceted attribute * @return {object} The stats of the facet */ SearchResults.prototype.getFacetStats = function(attribute) { if (this._state.isConjunctiveFacet(attribute)) { return getFacetStatsIfAvailable(this.facets, attribute); } else if (this._state.isDisjunctiveFacet(attribute)) { return getFacetStatsIfAvailable(this.disjunctiveFacets, attribute); } throw new Error(attribute + ' is not present in `facets` or `disjunctiveFacets`'); }; function getFacetStatsIfAvailable(facetList, facetName) { var data = find_1(facetList, {name: facetName}); return data && data.stats; } /** * Returns all refinements for all filters + tags. It also provides * additional information: count and exhausistivity for each filter. * * See the [refinement type](#Refinement) for an exhaustive view of the available * data. * * @return {Array.<Refinement>} all the refinements */ SearchResults.prototype.getRefinements = function() { var state = this._state; var results = this; var res = []; forEach_1(state.facetsRefinements, function(refinements, attributeName) { forEach_1(refinements, function(name) { res.push(getRefinement(state, 'facet', attributeName, name, results.facets)); }); }); forEach_1(state.facetsExcludes, function(refinements, attributeName) { forEach_1(refinements, function(name) { res.push(getRefinement(state, 'exclude', attributeName, name, results.facets)); }); }); forEach_1(state.disjunctiveFacetsRefinements, function(refinements, attributeName) { forEach_1(refinements, function(name) { res.push(getRefinement(state, 'disjunctive', attributeName, name, results.disjunctiveFacets)); }); }); forEach_1(state.hierarchicalFacetsRefinements, function(refinements, attributeName) { forEach_1(refinements, function(name) { res.push(getHierarchicalRefinement(state, attributeName, name, results.hierarchicalFacets)); }); }); forEach_1(state.numericRefinements, function(operators, attributeName) { forEach_1(operators, function(values, operator) { forEach_1(values, function(value) { res.push({ type: 'numeric', attributeName: attributeName, name: value, numericValue: value, operator: operator }); }); }); }); forEach_1(state.tagRefinements, function(name) { res.push({type: 'tag', attributeName: '_tags', name: name}); }); return res; }; function getRefinement(state, type, attributeName, name, resultsFacets) { var facet = find_1(resultsFacets, {name: attributeName}); var count = get_1(facet, 'data[' + name + ']'); var exhaustive = get_1(facet, 'exhaustive'); return { type: type, attributeName: attributeName, name: name, count: count || 0, exhaustive: exhaustive || false }; } function getHierarchicalRefinement(state, attributeName, name, resultsFacets) { var facet = find_1(resultsFacets, {name: attributeName}); var facetDeclaration = state.getHierarchicalFacetByName(attributeName); var splitted = name.split(facetDeclaration.separator); var configuredName = splitted[splitted.length - 1]; for (var i = 0; facet !== undefined && i < splitted.length; ++i) { facet = find_1(facet.data, {name: splitted[i]}); } var count = get_1(facet, 'count'); var exhaustive = get_1(facet, 'exhaustive'); return { type: 'hierarchical', attributeName: attributeName, name: configuredName, count: count || 0, exhaustive: exhaustive || false }; } var SearchResults_1 = SearchResults; var isBufferBrowser = function isBuffer(arg) { return arg && typeof arg === 'object' && typeof arg.copy === 'function' && typeof arg.fill === 'function' && typeof arg.readUInt8 === 'function'; }; var inherits_browser = createCommonjsModule(function (module) { if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor; ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }); }; } else { // old school shim for old browsers module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor; var TempCtor = function () {}; TempCtor.prototype = superCtor.prototype; ctor.prototype = new TempCtor(); ctor.prototype.constructor = ctor; }; } }); var util = createCommonjsModule(function (module, exports) { // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var formatRegExp = /%[sdj%]/g; exports.format = function(f) { if (!isString(f)) { var objects = []; for (var i = 0; i < arguments.length; i++) { objects.push(inspect(arguments[i])); } return objects.join(' '); } var i = 1; var args = arguments; var len = args.length; var str = String(f).replace(formatRegExp, function(x) { if (x === '%%') return '%'; if (i >= len) return x; switch (x) { case '%s': return String(args[i++]); case '%d': return Number(args[i++]); case '%j': try { return JSON.stringify(args[i++]); } catch (_) { return '[Circular]'; } default: return x; } }); for (var x = args[i]; i < len; x = args[++i]) { if (isNull(x) || !isObject(x)) { str += ' ' + x; } else { str += ' ' + inspect(x); } } return str; }; // Mark that a method should not be used. // Returns a modified function which warns once by default. // If --no-deprecation is set, then it is a no-op. exports.deprecate = function(fn, msg) { // Allow for deprecating things in the process of starting up. if (isUndefined(commonjsGlobal.process)) { return function() { return exports.deprecate(fn, msg).apply(this, arguments); }; } if (process.noDeprecation === true) { return fn; } var warned = false; function deprecated() { if (!warned) { if (process.throwDeprecation) { throw new Error(msg); } else if (process.traceDeprecation) { console.trace(msg); } else { console.error(msg); } warned = true; } return fn.apply(this, arguments); } return deprecated; }; var debugs = {}; var debugEnviron; exports.debuglog = function(set) { if (isUndefined(debugEnviron)) debugEnviron = process.env.NODE_DEBUG || ''; set = set.toUpperCase(); if (!debugs[set]) { if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { var pid = process.pid; debugs[set] = function() { var msg = exports.format.apply(exports, arguments); console.error('%s %d: %s', set, pid, msg); }; } else { debugs[set] = function() {}; } } return debugs[set]; }; /** * Echos the value of a value. Trys to print the value out * in the best way possible given the different types. * * @param {Object} obj The object to print out. * @param {Object} opts Optional options object that alters the output. */ /* legacy: obj, showHidden, depth, colors*/ function inspect(obj, opts) { // default options var ctx = { seen: [], stylize: stylizeNoColor }; // legacy... if (arguments.length >= 3) ctx.depth = arguments[2]; if (arguments.length >= 4) ctx.colors = arguments[3]; if (isBoolean(opts)) { // legacy... ctx.showHidden = opts; } else if (opts) { // got an "options" object exports._extend(ctx, opts); } // set default options if (isUndefined(ctx.showHidden)) ctx.showHidden = false; if (isUndefined(ctx.depth)) ctx.depth = 2; if (isUndefined(ctx.colors)) ctx.colors = false; if (isUndefined(ctx.customInspect)) ctx.customInspect = true; if (ctx.colors) ctx.stylize = stylizeWithColor; return formatValue(ctx, obj, ctx.depth); } exports.inspect = inspect; // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics inspect.colors = { 'bold' : [1, 22], 'italic' : [3, 23], 'underline' : [4, 24], 'inverse' : [7, 27], 'white' : [37, 39], 'grey' : [90, 39], 'black' : [30, 39], 'blue' : [34, 39], 'cyan' : [36, 39], 'green' : [32, 39], 'magenta' : [35, 39], 'red' : [31, 39], 'yellow' : [33, 39] }; // Don't use 'blue' not visible on cmd.exe inspect.styles = { 'special': 'cyan', 'number': 'yellow', 'boolean': 'yellow', 'undefined': 'grey', 'null': 'bold', 'string': 'green', 'date': 'magenta', // "name": intentionally not styling 'regexp': 'red' }; function stylizeWithColor(str, styleType) { var style = inspect.styles[styleType]; if (style) { return '\u001b[' + inspect.colors[style][0] + 'm' + str + '\u001b[' + inspect.colors[style][1] + 'm'; } else { return str; } } function stylizeNoColor(str, styleType) { return str; } function arrayToHash(array) { var hash = {}; array.forEach(function(val, idx) { hash[val] = true; }); return hash; } function formatValue(ctx, value, recurseTimes) { // Provide a hook for user-specified inspect functions. // Check that value is an object with an inspect function on it if (ctx.customInspect && value && isFunction(value.inspect) && // Filter out the util module, it's inspect function is special value.inspect !== exports.inspect && // Also filter out any prototype objects using the circular check. !(value.constructor && value.constructor.prototype === value)) { var ret = value.inspect(recurseTimes, ctx); if (!isString(ret)) { ret = formatValue(ctx, ret, recurseTimes); } return ret; } // Primitive types cannot have properties var primitive = formatPrimitive(ctx, value); if (primitive) { return primitive; } // Look up the keys of the object. var keys = Object.keys(value); var visibleKeys = arrayToHash(keys); if (ctx.showHidden) { keys = Object.getOwnPropertyNames(value); } // IE doesn't make error fields non-enumerable // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx if (isError(value) && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { return formatError(value); } // Some type of object without properties can be shortcutted. if (keys.length === 0) { if (isFunction(value)) { var name = value.name ? ': ' + value.name : ''; return ctx.stylize('[Function' + name + ']', 'special'); } if (isRegExp(value)) { return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); } if (isDate(value)) { return ctx.stylize(Date.prototype.toString.call(value), 'date'); } if (isError(value)) { return formatError(value); } } var base = '', array = false, braces = ['{', '}']; // Make Array say that they are Array if (isArray(value)) { array = true; braces = ['[', ']']; } // Make functions say that they are functions if (isFunction(value)) { var n = value.name ? ': ' + value.name : ''; base = ' [Function' + n + ']'; } // Make RegExps say that they are RegExps if (isRegExp(value)) { base = ' ' + RegExp.prototype.toString.call(value); } // Make dates with properties first say the date if (isDate(value)) { base = ' ' + Date.prototype.toUTCString.call(value); } // Make error with message first say the error if (isError(value)) { base = ' ' + formatError(value); } if (keys.length === 0 && (!array || value.length == 0)) { return braces[0] + base + braces[1]; } if (recurseTimes < 0) { if (isRegExp(value)) { return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); } else { return ctx.stylize('[Object]', 'special'); } } ctx.seen.push(value); var output; if (array) { output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); } else { output = keys.map(function(key) { return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); }); } ctx.seen.pop(); return reduceToSingleString(output, base, braces); } function formatPrimitive(ctx, value) { if (isUndefined(value)) return ctx.stylize('undefined', 'undefined'); if (isString(value)) { var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') .replace(/'/g, "\\'") .replace(/\\"/g, '"') + '\''; return ctx.stylize(simple, 'string'); } if (isNumber(value)) return ctx.stylize('' + value, 'number'); if (isBoolean(value)) return ctx.stylize('' + value, 'boolean'); // For some reason typeof null is "object", so special case here. if (isNull(value)) return ctx.stylize('null', 'null'); } function formatError(value) { return '[' + Error.prototype.toString.call(value) + ']'; } function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { var output = []; for (var i = 0, l = value.length; i < l; ++i) { if (hasOwnProperty(value, String(i))) { output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true)); } else { output.push(''); } } keys.forEach(function(key) { if (!key.match(/^\d+$/)) { output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true)); } }); return output; } function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { var name, str, desc; desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; if (desc.get) { if (desc.set) { str = ctx.stylize('[Getter/Setter]', 'special'); } else { str = ctx.stylize('[Getter]', 'special'); } } else { if (desc.set) { str = ctx.stylize('[Setter]', 'special'); } } if (!hasOwnProperty(visibleKeys, key)) { name = '[' + key + ']'; } if (!str) { if (ctx.seen.indexOf(desc.value) < 0) { if (isNull(recurseTimes)) { str = formatValue(ctx, desc.value, null); } else { str = formatValue(ctx, desc.value, recurseTimes - 1); } if (str.indexOf('\n') > -1) { if (array) { str = str.split('\n').map(function(line) { return ' ' + line; }).join('\n').substr(2); } else { str = '\n' + str.split('\n').map(function(line) { return ' ' + line; }).join('\n'); } } } else { str = ctx.stylize('[Circular]', 'special'); } } if (isUndefined(name)) { if (array && key.match(/^\d+$/)) { return str; } name = JSON.stringify('' + key); if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { name = name.substr(1, name.length - 2); name = ctx.stylize(name, 'name'); } else { name = name.replace(/'/g, "\\'") .replace(/\\"/g, '"') .replace(/(^"|"$)/g, "'"); name = ctx.stylize(name, 'string'); } } return name + ': ' + str; } function reduceToSingleString(output, base, braces) { var length = output.reduce(function(prev, cur) { if (cur.indexOf('\n') >= 0) ; return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; }, 0); if (length > 60) { return braces[0] + (base === '' ? '' : base + '\n ') + ' ' + output.join(',\n ') + ' ' + braces[1]; } return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; } // NOTE: These type checking functions intentionally don't use `instanceof` // because it is fragile and can be easily faked with `Object.create()`. function isArray(ar) { return Array.isArray(ar); } exports.isArray = isArray; function isBoolean(arg) { return typeof arg === 'boolean'; } exports.isBoolean = isBoolean; function isNull(arg) { return arg === null; } exports.isNull = isNull; function isNullOrUndefined(arg) { return arg == null; } exports.isNullOrUndefined = isNullOrUndefined; function isNumber(arg) { return typeof arg === 'number'; } exports.isNumber = isNumber; function isString(arg) { return typeof arg === 'string'; } exports.isString = isString; function isSymbol(arg) { return typeof arg === 'symbol'; } exports.isSymbol = isSymbol; function isUndefined(arg) { return arg === void 0; } exports.isUndefined = isUndefined; function isRegExp(re) { return isObject(re) && objectToString(re) === '[object RegExp]'; } exports.isRegExp = isRegExp; function isObject(arg) { return typeof arg === 'object' && arg !== null; } exports.isObject = isObject; function isDate(d) { return isObject(d) && objectToString(d) === '[object Date]'; } exports.isDate = isDate; function isError(e) { return isObject(e) && (objectToString(e) === '[object Error]' || e instanceof Error); } exports.isError = isError; function isFunction(arg) { return typeof arg === 'function'; } exports.isFunction = isFunction; function isPrimitive(arg) { return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || typeof arg === 'symbol' || // ES6 symbol typeof arg === 'undefined'; } exports.isPrimitive = isPrimitive; exports.isBuffer = isBufferBrowser; function objectToString(o) { return Object.prototype.toString.call(o); } function pad(n) { return n < 10 ? '0' + n.toString(10) : n.toString(10); } var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; // 26 Feb 16:19:34 function timestamp() { var d = new Date(); var time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(':'); return [d.getDate(), months[d.getMonth()], time].join(' '); } // log is just a thin wrapper to console.log that prepends a timestamp exports.log = function() { console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); }; /** * Inherit the prototype methods from one constructor into another. * * The Function.prototype.inherits from lang.js rewritten as a standalone * function (not on Function.prototype). NOTE: If this file is to be loaded * during bootstrapping this function needs to be rewritten using some native * functions as prototype setup using normal JavaScript does not work as * expected during bootstrapping (see mirror.js in r114903). * * @param {function} ctor Constructor function which needs to inherit the * prototype. * @param {function} superCtor Constructor function to inherit prototype from. */ exports.inherits = inherits_browser; exports._extend = function(origin, add) { // Don't do anything if add isn't an object if (!add || !isObject(add)) return origin; var keys = Object.keys(add); var i = keys.length; while (i--) { origin[keys[i]] = add[keys[i]]; } return origin; }; function hasOwnProperty(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } }); var util_1 = util.format; var util_2 = util.deprecate; var util_3 = util.debuglog; var util_4 = util.inspect; var util_5 = util.isArray; var util_6 = util.isBoolean; var util_7 = util.isNull; var util_8 = util.isNullOrUndefined; var util_9 = util.isNumber; var util_10 = util.isString; var util_11 = util.isSymbol; var util_12 = util.isUndefined; var util_13 = util.isRegExp; var util_14 = util.isObject; var util_15 = util.isDate; var util_16 = util.isError; var util_17 = util.isFunction; var util_18 = util.isPrimitive; var util_19 = util.isBuffer; var util_20 = util.log; var util_21 = util.inherits; var util_22 = util._extend; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. function EventEmitter() { this._events = this._events || {}; this._maxListeners = this._maxListeners || undefined; } var events = EventEmitter; // Backwards-compat with node 0.10.x EventEmitter.EventEmitter = EventEmitter; EventEmitter.prototype._events = undefined; EventEmitter.prototype._maxListeners = undefined; // By default EventEmitters will print a warning if more than 10 listeners are // added to it. This is a useful default which helps finding memory leaks. EventEmitter.defaultMaxListeners = 10; // Obviously not all Emitters should be limited to 10. This function allows // that to be increased. Set to zero for unlimited. EventEmitter.prototype.setMaxListeners = function(n) { if (!isNumber$1(n) || n < 0 || isNaN(n)) throw TypeError('n must be a positive number'); this._maxListeners = n; return this; }; EventEmitter.prototype.emit = function(type) { var er, handler, len, args, i, listeners; if (!this._events) this._events = {}; // If there is no 'error' event listener then throw. if (type === 'error') { if (!this._events.error || (isObject$1(this._events.error) && !this._events.error.length)) { er = arguments[1]; if (er instanceof Error) { throw er; // Unhandled 'error' event } else { // At least give some kind of context to the user var err = new Error('Uncaught, unspecified "error" event. (' + er + ')'); err.context = er; throw err; } } } handler = this._events[type]; if (isUndefined$1(handler)) return false; if (isFunction$1(handler)) { switch (arguments.length) { // fast cases case 1: handler.call(this); break; case 2: handler.call(this, arguments[1]); break; case 3: handler.call(this, arguments[1], arguments[2]); break; // slower default: args = Array.prototype.slice.call(arguments, 1); handler.apply(this, args); } } else if (isObject$1(handler)) { args = Array.prototype.slice.call(arguments, 1); listeners = handler.slice(); len = listeners.length; for (i = 0; i < len; i++) listeners[i].apply(this, args); } return true; }; EventEmitter.prototype.addListener = function(type, listener) { var m; if (!isFunction$1(listener)) throw TypeError('listener must be a function'); if (!this._events) this._events = {}; // To avoid recursion in the case that type === "newListener"! Before // adding it to the listeners, first emit "newListener". if (this._events.newListener) this.emit('newListener', type, isFunction$1(listener.listener) ? listener.listener : listener); if (!this._events[type]) // Optimize the case of one listener. Don't need the extra array object. this._events[type] = listener; else if (isObject$1(this._events[type])) // If we've already got an array, just append. this._events[type].push(listener); else // Adding the second element, need to change to array. this._events[type] = [this._events[type], listener]; // Check for listener leak if (isObject$1(this._events[type]) && !this._events[type].warned) { if (!isUndefined$1(this._maxListeners)) { m = this._maxListeners; } else { m = EventEmitter.defaultMaxListeners; } if (m && m > 0 && this._events[type].length > m) { this._events[type].warned = true; console.error('(node) warning: possible EventEmitter memory ' + 'leak detected. %d listeners added. ' + 'Use emitter.setMaxListeners() to increase limit.', this._events[type].length); if (typeof console.trace === 'function') { // not supported in IE 10 console.trace(); } } } return this; }; EventEmitter.prototype.on = EventEmitter.prototype.addListener; EventEmitter.prototype.once = function(type, listener) { if (!isFunction$1(listener)) throw TypeError('listener must be a function'); var fired = false; function g() { this.removeListener(type, g); if (!fired) { fired = true; listener.apply(this, arguments); } } g.listener = listener; this.on(type, g); return this; }; // emits a 'removeListener' event iff the listener was removed EventEmitter.prototype.removeListener = function(type, listener) { var list, position, length, i; if (!isFunction$1(listener)) throw TypeError('listener must be a function'); if (!this._events || !this._events[type]) return this; list = this._events[type]; length = list.length; position = -1; if (list === listener || (isFunction$1(list.listener) && list.listener === listener)) { delete this._events[type]; if (this._events.removeListener) this.emit('removeListener', type, listener); } else if (isObject$1(list)) { for (i = length; i-- > 0;) { if (list[i] === listener || (list[i].listener && list[i].listener === listener)) { position = i; break; } } if (position < 0) return this; if (list.length === 1) { list.length = 0; delete this._events[type]; } else { list.splice(position, 1); } if (this._events.removeListener) this.emit('removeListener', type, listener); } return this; }; EventEmitter.prototype.removeAllListeners = function(type) { var key, listeners; if (!this._events) return this; // not listening for removeListener, no need to emit if (!this._events.removeListener) { if (arguments.length === 0) this._events = {}; else if (this._events[type]) delete this._events[type]; return this; } // emit removeListener for all listeners on all events if (arguments.length === 0) { for (key in this._events) { if (key === 'removeListener') continue; this.removeAllListeners(key); } this.removeAllListeners('removeListener'); this._events = {}; return this; } listeners = this._events[type]; if (isFunction$1(listeners)) { this.removeListener(type, listeners); } else if (listeners) { // LIFO order while (listeners.length) this.removeListener(type, listeners[listeners.length - 1]); } delete this._events[type]; return this; }; EventEmitter.prototype.listeners = function(type) { var ret; if (!this._events || !this._events[type]) ret = []; else if (isFunction$1(this._events[type])) ret = [this._events[type]]; else ret = this._events[type].slice(); return ret; }; EventEmitter.prototype.listenerCount = function(type) { if (this._events) { var evlistener = this._events[type]; if (isFunction$1(evlistener)) return 1; else if (evlistener) return evlistener.length; } return 0; }; EventEmitter.listenerCount = function(emitter, type) { return emitter.listenerCount(type); }; function isFunction$1(arg) { return typeof arg === 'function'; } function isNumber$1(arg) { return typeof arg === 'number'; } function isObject$1(arg) { return typeof arg === 'object' && arg !== null; } function isUndefined$1(arg) { return arg === void 0; } /** * A DerivedHelper is a way to create sub requests to * Algolia from a main helper. * @class * @classdesc The DerivedHelper provides an event based interface for search callbacks: * - search: when a search is triggered using the `search()` method. * - result: when the response is retrieved from Algolia and is processed. * This event contains a {@link SearchResults} object and the * {@link SearchParameters} corresponding to this answer. */ function DerivedHelper(mainHelper, fn) { this.main = mainHelper; this.fn = fn; this.lastResults = null; } util.inherits(DerivedHelper, events.EventEmitter); /** * Detach this helper from the main helper * @return {undefined} * @throws Error if the derived helper is already detached */ DerivedHelper.prototype.detach = function() { this.removeAllListeners(); this.main.detachDerivedHelper(this); }; DerivedHelper.prototype.getModifiedState = function(parameters) { return this.fn(parameters); }; var DerivedHelper_1 = DerivedHelper; var requestBuilder = { /** * Get all the queries to send to the client, those queries can used directly * with the Algolia client. * @private * @return {object[]} The queries */ _getQueries: function getQueries(index, state) { var queries = []; // One query for the hits queries.push({ indexName: index, params: requestBuilder._getHitsSearchParams(state) }); // One for each disjunctive facets forEach_1(state.getRefinedDisjunctiveFacets(), function(refinedFacet) { queries.push({ indexName: index, params: requestBuilder._getDisjunctiveFacetSearchParams(state, refinedFacet) }); }); // maybe more to get the root level of hierarchical facets when activated forEach_1(state.getRefinedHierarchicalFacets(), function(refinedFacet) { var hierarchicalFacet = state.getHierarchicalFacetByName(refinedFacet); var currentRefinement = state.getHierarchicalRefinement(refinedFacet); // if we are deeper than level 0 (starting from `beer > IPA`) // we want to get the root values var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet); if (currentRefinement.length > 0 && currentRefinement[0].split(separator).length > 1) { queries.push({ indexName: index, params: requestBuilder._getDisjunctiveFacetSearchParams(state, refinedFacet, true) }); } }); return queries; }, /** * Build search parameters used to fetch hits * @private * @return {object.<string, any>} */ _getHitsSearchParams: function(state) { var facets = state.facets .concat(state.disjunctiveFacets) .concat(requestBuilder._getHitsHierarchicalFacetsAttributes(state)); var facetFilters = requestBuilder._getFacetFilters(state); var numericFilters = requestBuilder._getNumericFilters(state); var tagFilters = requestBuilder._getTagFilters(state); var additionalParams = { facets: facets, tagFilters: tagFilters }; if (facetFilters.length > 0) { additionalParams.facetFilters = facetFilters; } if (numericFilters.length > 0) { additionalParams.numericFilters = numericFilters; } return merge_1(state.getQueryParams(), additionalParams); }, /** * Build search parameters used to fetch a disjunctive facet * @private * @param {string} facet the associated facet name * @param {boolean} hierarchicalRootLevel ?? FIXME * @return {object} */ _getDisjunctiveFacetSearchParams: function(state, facet, hierarchicalRootLevel) { var facetFilters = requestBuilder._getFacetFilters(state, facet, hierarchicalRootLevel); var numericFilters = requestBuilder._getNumericFilters(state, facet); var tagFilters = requestBuilder._getTagFilters(state); var additionalParams = { hitsPerPage: 1, page: 0, attributesToRetrieve: [], attributesToHighlight: [], attributesToSnippet: [], tagFilters: tagFilters, analytics: false, clickAnalytics: false }; var hierarchicalFacet = state.getHierarchicalFacetByName(facet); if (hierarchicalFacet) { additionalParams.facets = requestBuilder._getDisjunctiveHierarchicalFacetAttribute( state, hierarchicalFacet, hierarchicalRootLevel ); } else { additionalParams.facets = facet; } if (numericFilters.length > 0) { additionalParams.numericFilters = numericFilters; } if (facetFilters.length > 0) { additionalParams.facetFilters = facetFilters; } return merge_1(state.getQueryParams(), additionalParams); }, /** * Return the numeric filters in an algolia request fashion * @private * @param {string} [facetName] the name of the attribute for which the filters should be excluded * @return {string[]} the numeric filters in the algolia format */ _getNumericFilters: function(state, facetName) { if (state.numericFilters) { return state.numericFilters; } var numericFilters = []; forEach_1(state.numericRefinements, function(operators, attribute) { forEach_1(operators, function(values, operator) { if (facetName !== attribute) { forEach_1(values, function(value) { if (Array.isArray(value)) { var vs = map_1(value, function(v) { return attribute + operator + v; }); numericFilters.push(vs); } else { numericFilters.push(attribute + operator + value); } }); } }); }); return numericFilters; }, /** * Return the tags filters depending * @private * @return {string} */ _getTagFilters: function(state) { if (state.tagFilters) { return state.tagFilters; } return state.tagRefinements.join(','); }, /** * Build facetFilters parameter based on current refinements. The array returned * contains strings representing the facet filters in the algolia format. * @private * @param {string} [facet] if set, the current disjunctive facet * @return {array.<string>} */ _getFacetFilters: function(state, facet, hierarchicalRootLevel) { var facetFilters = []; forEach_1(state.facetsRefinements, function(facetValues, facetName) { forEach_1(facetValues, function(facetValue) { facetFilters.push(facetName + ':' + facetValue); }); }); forEach_1(state.facetsExcludes, function(facetValues, facetName) { forEach_1(facetValues, function(facetValue) { facetFilters.push(facetName + ':-' + facetValue); }); }); forEach_1(state.disjunctiveFacetsRefinements, function(facetValues, facetName) { if (facetName === facet || !facetValues || facetValues.length === 0) return; var orFilters = []; forEach_1(facetValues, function(facetValue) { orFilters.push(facetName + ':' + facetValue); }); facetFilters.push(orFilters); }); forEach_1(state.hierarchicalFacetsRefinements, function(facetValues, facetName) { var facetValue = facetValues[0]; if (facetValue === undefined) { return; } var hierarchicalFacet = state.getHierarchicalFacetByName(facetName); var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet); var rootPath = state._getHierarchicalRootPath(hierarchicalFacet); var attributeToRefine; var attributesIndex; // we ask for parent facet values only when the `facet` is the current hierarchical facet if (facet === facetName) { // if we are at the root level already, no need to ask for facet values, we get them from // the hits query if (facetValue.indexOf(separator) === -1 || (!rootPath && hierarchicalRootLevel === true) || (rootPath && rootPath.split(separator).length === facetValue.split(separator).length)) { return; } if (!rootPath) { attributesIndex = facetValue.split(separator).length - 2; facetValue = facetValue.slice(0, facetValue.lastIndexOf(separator)); } else { attributesIndex = rootPath.split(separator).length - 1; facetValue = rootPath; } attributeToRefine = hierarchicalFacet.attributes[attributesIndex]; } else { attributesIndex = facetValue.split(separator).length - 1; attributeToRefine = hierarchicalFacet.attributes[attributesIndex]; } if (attributeToRefine) { facetFilters.push([attributeToRefine + ':' + facetValue]); } }); return facetFilters; }, _getHitsHierarchicalFacetsAttributes: function(state) { var out = []; return reduce_1( state.hierarchicalFacets, // ask for as much levels as there's hierarchical refinements function getHitsAttributesForHierarchicalFacet(allAttributes, hierarchicalFacet) { var hierarchicalRefinement = state.getHierarchicalRefinement(hierarchicalFacet.name)[0]; // if no refinement, ask for root level if (!hierarchicalRefinement) { allAttributes.push(hierarchicalFacet.attributes[0]); return allAttributes; } var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet); var level = hierarchicalRefinement.split(separator).length; var newAttributes = hierarchicalFacet.attributes.slice(0, level + 1); return allAttributes.concat(newAttributes); }, out); }, _getDisjunctiveHierarchicalFacetAttribute: function(state, hierarchicalFacet, rootLevel) { var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet); if (rootLevel === true) { var rootPath = state._getHierarchicalRootPath(hierarchicalFacet); var attributeIndex = 0; if (rootPath) { attributeIndex = rootPath.split(separator).length; } return [hierarchicalFacet.attributes[attributeIndex]]; } var hierarchicalRefinement = state.getHierarchicalRefinement(hierarchicalFacet.name)[0] || ''; // if refinement is 'beers > IPA > Flying dog', // then we want `facets: ['beers > IPA']` as disjunctive facet (parent level values) var parentLevel = hierarchicalRefinement.split(separator).length - 1; return hierarchicalFacet.attributes.slice(0, parentLevel + 1); }, getSearchForFacetQuery: function(facetName, query, maxFacetHits, state) { var stateForSearchForFacetValues = state.isDisjunctiveFacet(facetName) ? state.clearRefinements(facetName) : state; var searchForFacetSearchParameters = { facetQuery: query, facetName: facetName }; if (typeof maxFacetHits === 'number') { searchForFacetSearchParameters.maxFacetHits = maxFacetHits; } var queries = merge_1(requestBuilder._getHitsSearchParams(stateForSearchForFacetValues), searchForFacetSearchParameters); return queries; } }; var requestBuilder_1 = requestBuilder; /** * The base implementation of `_.invert` and `_.invertBy` which inverts * `object` with values transformed by `iteratee` and set by `setter`. * * @private * @param {Object} object The object to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform values. * @param {Object} accumulator The initial inverted object. * @returns {Function} Returns `accumulator`. */ function baseInverter(object, setter, iteratee, accumulator) { _baseForOwn(object, function(value, key, object) { setter(accumulator, iteratee(value), key, object); }); return accumulator; } var _baseInverter = baseInverter; /** * Creates a function like `_.invertBy`. * * @private * @param {Function} setter The function to set accumulator values. * @param {Function} toIteratee The function to resolve iteratees. * @returns {Function} Returns the new inverter function. */ function createInverter(setter, toIteratee) { return function(object, iteratee) { return _baseInverter(object, setter, toIteratee(iteratee), {}); }; } var _createInverter = createInverter; /** Used for built-in method references. */ var objectProto$k = Object.prototype; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString$2 = objectProto$k.toString; /** * Creates an object composed of the inverted keys and values of `object`. * If `object` contains duplicate values, subsequent values overwrite * property assignments of previous values. * * @static * @memberOf _ * @since 0.7.0 * @category Object * @param {Object} object The object to invert. * @returns {Object} Returns the new inverted object. * @example * * var object = { 'a': 1, 'b': 2, 'c': 1 }; * * _.invert(object); * // => { '1': 'c', '2': 'b' } */ var invert = _createInverter(function(result, value, key) { if (value != null && typeof value.toString != 'function') { value = nativeObjectToString$2.call(value); } result[value] = key; }, constant_1(identity_1)); var invert_1 = invert; var keys2Short = { advancedSyntax: 'aS', allowTyposOnNumericTokens: 'aTONT', analyticsTags: 'aT', analytics: 'a', aroundLatLngViaIP: 'aLLVIP', aroundLatLng: 'aLL', aroundPrecision: 'aP', aroundRadius: 'aR', attributesToHighlight: 'aTH', attributesToRetrieve: 'aTR', attributesToSnippet: 'aTS', disjunctiveFacetsRefinements: 'dFR', disjunctiveFacets: 'dF', distinct: 'd', facetsExcludes: 'fE', facetsRefinements: 'fR', facets: 'f', getRankingInfo: 'gRI', hierarchicalFacetsRefinements: 'hFR', hierarchicalFacets: 'hF', highlightPostTag: 'hPoT', highlightPreTag: 'hPrT', hitsPerPage: 'hPP', ignorePlurals: 'iP', index: 'idx', insideBoundingBox: 'iBB', insidePolygon: 'iPg', length: 'l', maxValuesPerFacet: 'mVPF', minimumAroundRadius: 'mAR', minProximity: 'mP', minWordSizefor1Typo: 'mWS1T', minWordSizefor2Typos: 'mWS2T', numericFilters: 'nF', numericRefinements: 'nR', offset: 'o', optionalWords: 'oW', page: 'p', queryType: 'qT', query: 'q', removeWordsIfNoResults: 'rWINR', replaceSynonymsInHighlight: 'rSIH', restrictSearchableAttributes: 'rSA', synonyms: 's', tagFilters: 'tF', tagRefinements: 'tR', typoTolerance: 'tT', optionalTagFilters: 'oTF', optionalFacetFilters: 'oFF', snippetEllipsisText: 'sET', disableExactOnAttributes: 'dEOA', enableExactOnSingleWordQuery: 'eEOSWQ' }; var short2Keys = invert_1(keys2Short); var shortener = { /** * All the keys of the state, encoded. * @const */ ENCODED_PARAMETERS: keys_1(short2Keys), /** * Decode a shorten attribute * @param {string} shortKey the shorten attribute * @return {string} the decoded attribute, undefined otherwise */ decode: function(shortKey) { return short2Keys[shortKey]; }, /** * Encode an attribute into a short version * @param {string} key the attribute * @return {string} the shorten attribute */ encode: function(key) { return keys2Short[key]; } }; var utils = createCommonjsModule(function (module, exports) { var has = Object.prototype.hasOwnProperty; var hexTable = (function () { var array = []; for (var i = 0; i < 256; ++i) { array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); } return array; }()); var compactQueue = function compactQueue(queue) { var obj; while (queue.length) { var item = queue.pop(); obj = item.obj[item.prop]; if (Array.isArray(obj)) { var compacted = []; for (var j = 0; j < obj.length; ++j) { if (typeof obj[j] !== 'undefined') { compacted.push(obj[j]); } } item.obj[item.prop] = compacted; } } return obj; }; exports.arrayToObject = function arrayToObject(source, options) { var obj = options && options.plainObjects ? Object.create(null) : {}; for (var i = 0; i < source.length; ++i) { if (typeof source[i] !== 'undefined') { obj[i] = source[i]; } } return obj; }; exports.merge = function merge(target, source, options) { if (!source) { return target; } if (typeof source !== 'object') { if (Array.isArray(target)) { target.push(source); } else if (typeof target === 'object') { if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) { target[source] = true; } } else { return [target, source]; } return target; } if (typeof target !== 'object') { return [target].concat(source); } var mergeTarget = target; if (Array.isArray(target) && !Array.isArray(source)) { mergeTarget = exports.arrayToObject(target, options); } if (Array.isArray(target) && Array.isArray(source)) { source.forEach(function (item, i) { if (has.call(target, i)) { if (target[i] && typeof target[i] === 'object') { target[i] = exports.merge(target[i], item, options); } else { target.push(item); } } else { target[i] = item; } }); return target; } return Object.keys(source).reduce(function (acc, key) { var value = source[key]; if (has.call(acc, key)) { acc[key] = exports.merge(acc[key], value, options); } else { acc[key] = value; } return acc; }, mergeTarget); }; exports.assign = function assignSingleSource(target, source) { return Object.keys(source).reduce(function (acc, key) { acc[key] = source[key]; return acc; }, target); }; exports.decode = function (str) { try { return decodeURIComponent(str.replace(/\+/g, ' ')); } catch (e) { return str; } }; exports.encode = function encode(str) { // This code was originally written by Brian White (mscdex) for the io.js core querystring library. // It has been adapted here for stricter adherence to RFC 3986 if (str.length === 0) { return str; } var string = typeof str === 'string' ? str : String(str); var out = ''; for (var i = 0; i < string.length; ++i) { var c = string.charCodeAt(i); if ( c === 0x2D // - || c === 0x2E // . || c === 0x5F // _ || c === 0x7E // ~ || (c >= 0x30 && c <= 0x39) // 0-9 || (c >= 0x41 && c <= 0x5A) // a-z || (c >= 0x61 && c <= 0x7A) // A-Z ) { out += string.charAt(i); continue; } if (c < 0x80) { out = out + hexTable[c]; continue; } if (c < 0x800) { out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); continue; } if (c < 0xD800 || c >= 0xE000) { out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); continue; } i += 1; c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); out += hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]; } return out; }; exports.compact = function compact(value) { var queue = [{ obj: { o: value }, prop: 'o' }]; var refs = []; for (var i = 0; i < queue.length; ++i) { var item = queue[i]; var obj = item.obj[item.prop]; var keys = Object.keys(obj); for (var j = 0; j < keys.length; ++j) { var key = keys[j]; var val = obj[key]; if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { queue.push({ obj: obj, prop: key }); refs.push(val); } } } return compactQueue(queue); }; exports.isRegExp = function isRegExp(obj) { return Object.prototype.toString.call(obj) === '[object RegExp]'; }; exports.isBuffer = function isBuffer(obj) { if (obj === null || typeof obj === 'undefined') { return false; } return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); }; }); var utils_1 = utils.arrayToObject; var utils_2 = utils.merge; var utils_3 = utils.assign; var utils_4 = utils.decode; var utils_5 = utils.encode; var utils_6 = utils.compact; var utils_7 = utils.isRegExp; var utils_8 = utils.isBuffer; var replace = String.prototype.replace; var percentTwenties = /%20/g; var formats = { 'default': 'RFC3986', formatters: { RFC1738: function (value) { return replace.call(value, percentTwenties, '+'); }, RFC3986: function (value) { return value; } }, RFC1738: 'RFC1738', RFC3986: 'RFC3986' }; var arrayPrefixGenerators = { brackets: function brackets(prefix) { // eslint-disable-line func-name-matching return prefix + '[]'; }, indices: function indices(prefix, key) { // eslint-disable-line func-name-matching return prefix + '[' + key + ']'; }, repeat: function repeat(prefix) { // eslint-disable-line func-name-matching return prefix; } }; var toISO = Date.prototype.toISOString; var defaults$1 = { delimiter: '&', encode: true, encoder: utils.encode, encodeValuesOnly: false, serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching return toISO.call(date); }, skipNulls: false, strictNullHandling: false }; var stringify = function stringify( // eslint-disable-line func-name-matching object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly ) { var obj = object; if (typeof filter === 'function') { obj = filter(prefix, obj); } else if (obj instanceof Date) { obj = serializeDate(obj); } else if (obj === null) { if (strictNullHandling) { return encoder && !encodeValuesOnly ? encoder(prefix, defaults$1.encoder) : prefix; } obj = ''; } if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) { if (encoder) { var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder); return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults$1.encoder))]; } return [formatter(prefix) + '=' + formatter(String(obj))]; } var values = []; if (typeof obj === 'undefined') { return values; } var objKeys; if (Array.isArray(filter)) { objKeys = filter; } else { var keys = Object.keys(obj); objKeys = sort ? keys.sort(sort) : keys; } for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; if (skipNulls && obj[key] === null) { continue; } if (Array.isArray(obj)) { values = values.concat(stringify( obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly )); } else { values = values.concat(stringify( obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly )); } } return values; }; var stringify_1 = function (object, opts) { var obj = object; var options = opts ? utils.assign({}, opts) : {}; if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') { throw new TypeError('Encoder has to be a function.'); } var delimiter = typeof options.delimiter === 'undefined' ? defaults$1.delimiter : options.delimiter; var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults$1.strictNullHandling; var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults$1.skipNulls; var encode = typeof options.encode === 'boolean' ? options.encode : defaults$1.encode; var encoder = typeof options.encoder === 'function' ? options.encoder : defaults$1.encoder; var sort = typeof options.sort === 'function' ? options.sort : null; var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots; var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults$1.serializeDate; var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults$1.encodeValuesOnly; if (typeof options.format === 'undefined') { options.format = formats['default']; } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) { throw new TypeError('Unknown format option provided.'); } var formatter = formats.formatters[options.format]; var objKeys; var filter; if (typeof options.filter === 'function') { filter = options.filter; obj = filter('', obj); } else if (Array.isArray(options.filter)) { filter = options.filter; objKeys = filter; } var keys = []; if (typeof obj !== 'object' || obj === null) { return ''; } var arrayFormat; if (options.arrayFormat in arrayPrefixGenerators) { arrayFormat = options.arrayFormat; } else if ('indices' in options) { arrayFormat = options.indices ? 'indices' : 'repeat'; } else { arrayFormat = 'indices'; } var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; if (!objKeys) { objKeys = Object.keys(obj); } if (sort) { objKeys.sort(sort); } for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; if (skipNulls && obj[key] === null) { continue; } keys = keys.concat(stringify( obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode ? encoder : null, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly )); } var joined = keys.join(delimiter); var prefix = options.addQueryPrefix === true ? '?' : ''; return joined.length > 0 ? prefix + joined : ''; }; var has = Object.prototype.hasOwnProperty; var defaults$2 = { allowDots: false, allowPrototypes: false, arrayLimit: 20, decoder: utils.decode, delimiter: '&', depth: 5, parameterLimit: 1000, plainObjects: false, strictNullHandling: false }; var parseValues = function parseQueryStringValues(str, options) { var obj = {}; var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; var parts = cleanStr.split(options.delimiter, limit); for (var i = 0; i < parts.length; ++i) { var part = parts[i]; var bracketEqualsPos = part.indexOf(']='); var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; var key, val; if (pos === -1) { key = options.decoder(part, defaults$2.decoder); val = options.strictNullHandling ? null : ''; } else { key = options.decoder(part.slice(0, pos), defaults$2.decoder); val = options.decoder(part.slice(pos + 1), defaults$2.decoder); } if (has.call(obj, key)) { obj[key] = [].concat(obj[key]).concat(val); } else { obj[key] = val; } } return obj; }; var parseObject = function (chain, val, options) { var leaf = val; for (var i = chain.length - 1; i >= 0; --i) { var obj; var root = chain[i]; if (root === '[]') { obj = []; obj = obj.concat(leaf); } else { obj = options.plainObjects ? Object.create(null) : {}; var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; var index = parseInt(cleanRoot, 10); if ( !isNaN(index) && root !== cleanRoot && String(index) === cleanRoot && index >= 0 && (options.parseArrays && index <= options.arrayLimit) ) { obj = []; obj[index] = leaf; } else { obj[cleanRoot] = leaf; } } leaf = obj; } return leaf; }; var parseKeys = function parseQueryStringKeys(givenKey, val, options) { if (!givenKey) { return; } // Transform dot notation to bracket notation var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; // The regex chunks var brackets = /(\[[^[\]]*])/; var child = /(\[[^[\]]*])/g; // Get the parent var segment = brackets.exec(key); var parent = segment ? key.slice(0, segment.index) : key; // Stash the parent if it exists var keys = []; if (parent) { // If we aren't using plain objects, optionally prefix keys // that would overwrite object prototype properties if (!options.plainObjects && has.call(Object.prototype, parent)) { if (!options.allowPrototypes) { return; } } keys.push(parent); } // Loop through children appending to the array until we hit depth var i = 0; while ((segment = child.exec(key)) !== null && i < options.depth) { i += 1; if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { if (!options.allowPrototypes) { return; } } keys.push(segment[1]); } // If there's a remainder, just add whatever is left if (segment) { keys.push('[' + key.slice(segment.index) + ']'); } return parseObject(keys, val, options); }; var parse = function (str, opts) { var options = opts ? utils.assign({}, opts) : {}; if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') { throw new TypeError('Decoder has to be a function.'); } options.ignoreQueryPrefix = options.ignoreQueryPrefix === true; options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults$2.delimiter; options.depth = typeof options.depth === 'number' ? options.depth : defaults$2.depth; options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults$2.arrayLimit; options.parseArrays = options.parseArrays !== false; options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults$2.decoder; options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults$2.allowDots; options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults$2.plainObjects; options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults$2.allowPrototypes; options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults$2.parameterLimit; options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults$2.strictNullHandling; if (str === '' || str === null || typeof str === 'undefined') { return options.plainObjects ? Object.create(null) : {}; } var tempObj = typeof str === 'string' ? parseValues(str, options) : str; var obj = options.plainObjects ? Object.create(null) : {}; // Iterate over the keys and setup the new object var keys = Object.keys(tempObj); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; var newObj = parseKeys(key, tempObj[key], options); obj = utils.merge(obj, newObj, options); } return utils.compact(obj); }; var lib$1 = { formats: formats, parse: parse, stringify: stringify_1 }; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG$7 = 1, WRAP_PARTIAL_FLAG$4 = 32; /** * Creates a function that invokes `func` with the `this` binding of `thisArg` * and `partials` prepended to the arguments it receives. * * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for partially applied arguments. * * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" * property of bound functions. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to bind. * @param {*} thisArg The `this` binding of `func`. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * * function greet(greeting, punctuation) { * return greeting + ' ' + this.user + punctuation; * } * * var object = { 'user': 'fred' }; * * var bound = _.bind(greet, object, 'hi'); * bound('!'); * // => 'hi fred!' * * // Bound with placeholders. * var bound = _.bind(greet, object, _, '!'); * bound('hi'); * // => 'hi fred!' */ var bind = _baseRest(function(func, thisArg, partials) { var bitmask = WRAP_BIND_FLAG$7; if (partials.length) { var holders = _replaceHolders(partials, _getHolder(bind)); bitmask |= WRAP_PARTIAL_FLAG$4; } return _createWrap(func, bitmask, thisArg, partials, holders); }); // Assign default placeholders. bind.placeholder = {}; var bind_1 = bind; /** * The base implementation of `_.pick` without support for individual * property identifiers. * * @private * @param {Object} object The source object. * @param {string[]} paths The property paths to pick. * @returns {Object} Returns the new object. */ function basePick(object, paths) { return _basePickBy(object, paths, function(value, path) { return hasIn_1(object, path); }); } var _basePick = basePick; /** * Creates an object composed of the picked `object` properties. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.pick(object, ['a', 'c']); * // => { 'a': 1, 'c': 3 } */ var pick = _flatRest(function(object, paths) { return object == null ? {} : _basePick(object, paths); }); var pick_1 = pick; /** * The opposite of `_.mapValues`; this method creates an object with the * same values as `object` and keys generated by running each own enumerable * string keyed property of `object` thru `iteratee`. The iteratee is invoked * with three arguments: (value, key, object). * * @static * @memberOf _ * @since 3.8.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @see _.mapValues * @example * * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { * return key + value; * }); * // => { 'a1': 1, 'b2': 2 } */ function mapKeys(object, iteratee) { var result = {}; iteratee = _baseIteratee(iteratee, 3); _baseForOwn(object, function(value, key, object) { _baseAssignValue(result, iteratee(value, key, object), value); }); return result; } var mapKeys_1 = mapKeys; /** * Creates an object with the same keys as `object` and values generated * by running each own enumerable string keyed property of `object` thru * `iteratee`. The iteratee is invoked with three arguments: * (value, key, object). * * @static * @memberOf _ * @since 2.4.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @see _.mapKeys * @example * * var users = { * 'fred': { 'user': 'fred', 'age': 40 }, * 'pebbles': { 'user': 'pebbles', 'age': 1 } * }; * * _.mapValues(users, function(o) { return o.age; }); * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) * * // The `_.property` iteratee shorthand. * _.mapValues(users, 'age'); * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) */ function mapValues(object, iteratee) { var result = {}; iteratee = _baseIteratee(iteratee, 3); _baseForOwn(object, function(value, key, object) { _baseAssignValue(result, key, iteratee(value, key, object)); }); return result; } var mapValues_1 = mapValues; /** * Module containing the functions to serialize and deserialize * {SearchParameters} in the query string format * @module algoliasearchHelper.url */ var encode = utils.encode; function recursiveEncode(input) { if (isPlainObject_1(input)) { return mapValues_1(input, recursiveEncode); } if (Array.isArray(input)) { return map_1(input, recursiveEncode); } if (isString_1(input)) { return encode(input); } return input; } var refinementsParameters = ['dFR', 'fR', 'nR', 'hFR', 'tR']; var stateKeys = shortener.ENCODED_PARAMETERS; function sortQueryStringValues(prefixRegexp, invertedMapping, a, b) { if (prefixRegexp !== null) { a = a.replace(prefixRegexp, ''); b = b.replace(prefixRegexp, ''); } a = invertedMapping[a] || a; b = invertedMapping[b] || b; if (stateKeys.indexOf(a) !== -1 || stateKeys.indexOf(b) !== -1) { if (a === 'q') return -1; if (b === 'q') return 1; var isARefinements = refinementsParameters.indexOf(a) !== -1; var isBRefinements = refinementsParameters.indexOf(b) !== -1; if (isARefinements && !isBRefinements) { return 1; } else if (isBRefinements && !isARefinements) { return -1; } } return a.localeCompare(b); } /** * Read a query string and return an object containing the state * @param {string} queryString the query string that will be decoded * @param {object} [options] accepted options : * - prefix : the prefix used for the saved attributes, you have to provide the * same that was used for serialization * - mapping : map short attributes to another value e.g. {q: 'query'} * @return {object} partial search parameters object (same properties than in the * SearchParameters but not exhaustive) */ var getStateFromQueryString = function(queryString, options) { var prefixForParameters = options && options.prefix || ''; var mapping = options && options.mapping || {}; var invertedMapping = invert_1(mapping); var partialStateWithPrefix = lib$1.parse(queryString); var prefixRegexp = new RegExp('^' + prefixForParameters); var partialState = mapKeys_1( partialStateWithPrefix, function(v, k) { var hasPrefix = prefixForParameters && prefixRegexp.test(k); var unprefixedKey = hasPrefix ? k.replace(prefixRegexp, '') : k; var decodedKey = shortener.decode(invertedMapping[unprefixedKey] || unprefixedKey); return decodedKey || unprefixedKey; } ); var partialStateWithParsedNumbers = SearchParameters_1._parseNumbers(partialState); return pick_1(partialStateWithParsedNumbers, SearchParameters_1.PARAMETERS); }; /** * Retrieve an object of all the properties that are not understandable as helper * parameters. * @param {string} queryString the query string to read * @param {object} [options] the options * - prefixForParameters : prefix used for the helper configuration keys * - mapping : map short attributes to another value e.g. {q: 'query'} * @return {object} the object containing the parsed configuration that doesn't * to the helper */ var getUnrecognizedParametersInQueryString = function(queryString, options) { var prefixForParameters = options && options.prefix; var mapping = options && options.mapping || {}; var invertedMapping = invert_1(mapping); var foreignConfig = {}; var config = lib$1.parse(queryString); if (prefixForParameters) { var prefixRegexp = new RegExp('^' + prefixForParameters); forEach_1(config, function(v, key) { if (!prefixRegexp.test(key)) foreignConfig[key] = v; }); } else { forEach_1(config, function(v, key) { if (!shortener.decode(invertedMapping[key] || key)) foreignConfig[key] = v; }); } return foreignConfig; }; /** * Generate a query string for the state passed according to the options * @param {SearchParameters} state state to serialize * @param {object} [options] May contain the following parameters : * - prefix : prefix in front of the keys * - mapping : map short attributes to another value e.g. {q: 'query'} * - moreAttributes : more values to be added in the query string. Those values * won't be prefixed. * - safe : get safe urls for use in emails, chat apps or any application auto linking urls. * All parameters and values will be encoded in a way that it's safe to share them. * Default to false for legacy reasons () * @return {string} the query string */ var getQueryStringFromState = function(state, options) { var moreAttributes = options && options.moreAttributes; var prefixForParameters = options && options.prefix || ''; var mapping = options && options.mapping || {}; var safe = options && options.safe || false; var invertedMapping = invert_1(mapping); var stateForUrl = safe ? state : recursiveEncode(state); var encodedState = mapKeys_1( stateForUrl, function(v, k) { var shortK = shortener.encode(k); return prefixForParameters + (mapping[shortK] || shortK); } ); var prefixRegexp = prefixForParameters === '' ? null : new RegExp('^' + prefixForParameters); var sort = bind_1(sortQueryStringValues, null, prefixRegexp, invertedMapping); if (!isEmpty_1(moreAttributes)) { var stateQs = lib$1.stringify(encodedState, {encode: safe, sort: sort}); var moreQs = lib$1.stringify(moreAttributes, {encode: safe}); if (!stateQs) return moreQs; return stateQs + '&' + moreQs; } return lib$1.stringify(encodedState, {encode: safe, sort: sort}); }; var url = { getStateFromQueryString: getStateFromQueryString, getUnrecognizedParametersInQueryString: getUnrecognizedParametersInQueryString, getQueryStringFromState: getQueryStringFromState }; var version$1 = '2.26.0'; /** * Event triggered when a parameter is set or updated * @event AlgoliaSearchHelper#event:change * @property {SearchParameters} state the current parameters with the latest changes applied * @property {SearchResults} lastResults the previous results received from Algolia. `null` before * the first request * @example * helper.on('change', function(state, lastResults) { * console.log('The parameters have changed'); * }); */ /** * Event triggered when a main search is sent to Algolia * @event AlgoliaSearchHelper#event:search * @property {SearchParameters} state the parameters used for this search * @property {SearchResults} lastResults the results from the previous search. `null` if * it is the first search. * @example * helper.on('search', function(state, lastResults) { * console.log('Search sent'); * }); */ /** * Event triggered when a search using `searchForFacetValues` is sent to Algolia * @event AlgoliaSearchHelper#event:searchForFacetValues * @property {SearchParameters} state the parameters used for this search * it is the first search. * @property {string} facet the facet searched into * @property {string} query the query used to search in the facets * @example * helper.on('searchForFacetValues', function(state, facet, query) { * console.log('searchForFacetValues sent'); * }); */ /** * Event triggered when a search using `searchOnce` is sent to Algolia * @event AlgoliaSearchHelper#event:searchOnce * @property {SearchParameters} state the parameters used for this search * it is the first search. * @example * helper.on('searchOnce', function(state) { * console.log('searchOnce sent'); * }); */ /** * Event triggered when the results are retrieved from Algolia * @event AlgoliaSearchHelper#event:result * @property {SearchResults} results the results received from Algolia * @property {SearchParameters} state the parameters used to query Algolia. Those might * be different from the one in the helper instance (for example if the network is unreliable). * @example * helper.on('result', function(results, state) { * console.log('Search results received'); * }); */ /** * Event triggered when Algolia sends back an error. For example, if an unknown parameter is * used, the error can be caught using this event. * @event AlgoliaSearchHelper#event:error * @property {Error} error the error returned by the Algolia. * @example * helper.on('error', function(error) { * console.log('Houston we got a problem.'); * }); */ /** * Event triggered when the queue of queries have been depleted (with any result or outdated queries) * @event AlgoliaSearchHelper#event:searchQueueEmpty * @example * helper.on('searchQueueEmpty', function() { * console.log('No more search pending'); * // This is received before the result event if we're not expecting new results * }); * * helper.search(); */ /** * Initialize a new AlgoliaSearchHelper * @class * @classdesc The AlgoliaSearchHelper is a class that ease the management of the * search. It provides an event based interface for search callbacks: * - change: when the internal search state is changed. * This event contains a {@link SearchParameters} object and the * {@link SearchResults} of the last result if any. * - search: when a search is triggered using the `search()` method. * - result: when the response is retrieved from Algolia and is processed. * This event contains a {@link SearchResults} object and the * {@link SearchParameters} corresponding to this answer. * - error: when the response is an error. This event contains the error returned by the server. * @param {AlgoliaSearch} client an AlgoliaSearch client * @param {string} index the index name to query * @param {SearchParameters | object} options an object defining the initial * config of the search. It doesn't have to be a {SearchParameters}, * just an object containing the properties you need from it. */ function AlgoliaSearchHelper(client, index, options) { if (client.addAlgoliaAgent && !doesClientAgentContainsHelper(client)) { client.addAlgoliaAgent('JS Helper ' + version$1); } this.setClient(client); var opts = options || {}; opts.index = index; this.state = SearchParameters_1.make(opts); this.lastResults = null; this._queryId = 0; this._lastQueryIdReceived = -1; this.derivedHelpers = []; this._currentNbQueries = 0; } util.inherits(AlgoliaSearchHelper, events.EventEmitter); /** * Start the search with the parameters set in the state. When the * method is called, it triggers a `search` event. The results will * be available through the `result` event. If an error occurs, an * `error` will be fired instead. * @return {AlgoliaSearchHelper} * @fires search * @fires result * @fires error * @chainable */ AlgoliaSearchHelper.prototype.search = function() { this._search(); return this; }; /** * Gets the search query parameters that would be sent to the Algolia Client * for the hits * @return {object} Query Parameters */ AlgoliaSearchHelper.prototype.getQuery = function() { var state = this.state; return requestBuilder_1._getHitsSearchParams(state); }; /** * Start a search using a modified version of the current state. This method does * not trigger the helper lifecycle and does not modify the state kept internally * by the helper. This second aspect means that the next search call will be the * same as a search call before calling searchOnce. * @param {object} options can contain all the parameters that can be set to SearchParameters * plus the index * @param {function} [callback] optional callback executed when the response from the * server is back. * @return {promise|undefined} if a callback is passed the method returns undefined * otherwise it returns a promise containing an object with two keys : * - content with a SearchResults * - state with the state used for the query as a SearchParameters * @example * // Changing the number of records returned per page to 1 * // This example uses the callback API * var state = helper.searchOnce({hitsPerPage: 1}, * function(error, content, state) { * // if an error occurred it will be passed in error, otherwise its value is null * // content contains the results formatted as a SearchResults * // state is the instance of SearchParameters used for this search * }); * @example * // Changing the number of records returned per page to 1 * // This example uses the promise API * var state1 = helper.searchOnce({hitsPerPage: 1}) * .then(promiseHandler); * * function promiseHandler(res) { * // res contains * // { * // content : SearchResults * // state : SearchParameters (the one used for this specific search) * // } * } */ AlgoliaSearchHelper.prototype.searchOnce = function(options, cb) { var tempState = !options ? this.state : this.state.setQueryParameters(options); var queries = requestBuilder_1._getQueries(tempState.index, tempState); var self = this; this._currentNbQueries++; this.emit('searchOnce', tempState); if (cb) { this.client .search(queries) .then(function(content) { self._currentNbQueries--; if (self._currentNbQueries === 0) { self.emit('searchQueueEmpty'); } cb(null, new SearchResults_1(tempState, content.results), tempState); }) .catch(function(err) { self._currentNbQueries--; if (self._currentNbQueries === 0) { self.emit('searchQueueEmpty'); } cb(err, null, tempState); }); return undefined; } return this.client.search(queries).then(function(content) { self._currentNbQueries--; if (self._currentNbQueries === 0) self.emit('searchQueueEmpty'); return { content: new SearchResults_1(tempState, content.results), state: tempState, _originalResponse: content }; }, function(e) { self._currentNbQueries--; if (self._currentNbQueries === 0) self.emit('searchQueueEmpty'); throw e; }); }; /** * Structure of each result when using * [`searchForFacetValues()`](reference.html#AlgoliaSearchHelper#searchForFacetValues) * @typedef FacetSearchHit * @type {object} * @property {string} value the facet value * @property {string} highlighted the facet value highlighted with the query string * @property {number} count number of occurrence of this facet value * @property {boolean} isRefined true if the value is already refined */ /** * Structure of the data resolved by the * [`searchForFacetValues()`](reference.html#AlgoliaSearchHelper#searchForFacetValues) * promise. * @typedef FacetSearchResult * @type {object} * @property {FacetSearchHit} facetHits the results for this search for facet values * @property {number} processingTimeMS time taken by the query inside the engine */ /** * Search for facet values based on an query and the name of a faceted attribute. This * triggers a search and will return a promise. On top of using the query, it also sends * the parameters from the state so that the search is narrowed down to only the possible values. * * See the description of [FacetSearchResult](reference.html#FacetSearchResult) * @param {string} facet the name of the faceted attribute * @param {string} query the string query for the search * @param {number} [maxFacetHits] the maximum number values returned. Should be > 0 and <= 100 * @param {object} [userState] the set of custom parameters to use on top of the current state. Setting a property to `undefined` removes * it in the generated query. * @return {promise.<FacetSearchResult>} the results of the search */ AlgoliaSearchHelper.prototype.searchForFacetValues = function(facet, query, maxFacetHits, userState) { var state = this.state.setQueryParameters(userState || {}); var isDisjunctive = state.isDisjunctiveFacet(facet); var algoliaQuery = requestBuilder_1.getSearchForFacetQuery(facet, query, maxFacetHits, state); this._currentNbQueries++; var self = this; this.emit('searchForFacetValues', state, facet, query); var searchForFacetValuesPromise = typeof this.client.searchForFacetValues === 'function' ? this.client.searchForFacetValues([{indexName: state.index, params: algoliaQuery}]) : this.client.initIndex(state.index).searchForFacetValues(algoliaQuery); return searchForFacetValuesPromise.then(function addIsRefined(content) { self._currentNbQueries--; if (self._currentNbQueries === 0) self.emit('searchQueueEmpty'); content = Array.isArray(content) ? content[0] : content; content.facetHits = forEach_1(content.facetHits, function(f) { f.isRefined = isDisjunctive ? state.isDisjunctiveFacetRefined(facet, f.value) : state.isFacetRefined(facet, f.value); }); return content; }, function(e) { self._currentNbQueries--; if (self._currentNbQueries === 0) self.emit('searchQueueEmpty'); throw e; }); }; /** * Sets the text query used for the search. * * This method resets the current page to 0. * @param {string} q the user query * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.setQuery = function(q) { this._change(this.state.setPage(0).setQuery(q)); return this; }; /** * Remove all the types of refinements except tags. A string can be provided to remove * only the refinements of a specific attribute. For more advanced use case, you can * provide a function instead. This function should follow the * [clearCallback definition](#SearchParameters.clearCallback). * * This method resets the current page to 0. * @param {string} [name] optional name of the facet / attribute on which we want to remove all refinements * @return {AlgoliaSearchHelper} * @fires change * @chainable * @example * // Removing all the refinements * helper.clearRefinements().search(); * @example * // Removing all the filters on a the category attribute. * helper.clearRefinements('category').search(); * @example * // Removing only the exclude filters on the category facet. * helper.clearRefinements(function(value, attribute, type) { * return type === 'exclude' && attribute === 'category'; * }).search(); */ AlgoliaSearchHelper.prototype.clearRefinements = function(name) { this._change(this.state.setPage(0).clearRefinements(name)); return this; }; /** * Remove all the tag filters. * * This method resets the current page to 0. * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.clearTags = function() { this._change(this.state.setPage(0).clearTags()); return this; }; /** * Adds a disjunctive filter to a faceted attribute with the `value` provided. If the * filter is already set, it doesn't change the filters. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} value the associated value (will be converted to string) * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.addDisjunctiveFacetRefinement = function(facet, value) { this._change(this.state.setPage(0).addDisjunctiveFacetRefinement(facet, value)); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addDisjunctiveFacetRefinement} */ AlgoliaSearchHelper.prototype.addDisjunctiveRefine = function() { return this.addDisjunctiveFacetRefinement.apply(this, arguments); }; /** * Adds a refinement on a hierarchical facet. It will throw * an exception if the facet is not defined or if the facet * is already refined. * * This method resets the current page to 0. * @param {string} facet the facet name * @param {string} path the hierarchical facet path * @return {AlgoliaSearchHelper} * @throws Error if the facet is not defined or if the facet is refined * @chainable * @fires change */ AlgoliaSearchHelper.prototype.addHierarchicalFacetRefinement = function(facet, value) { this._change(this.state.setPage(0).addHierarchicalFacetRefinement(facet, value)); return this; }; /** * Adds a an numeric filter to an attribute with the `operator` and `value` provided. If the * filter is already set, it doesn't change the filters. * * This method resets the current page to 0. * @param {string} attribute the attribute on which the numeric filter applies * @param {string} operator the operator of the filter * @param {number} value the value of the filter * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.addNumericRefinement = function(attribute, operator, value) { this._change(this.state.setPage(0).addNumericRefinement(attribute, operator, value)); return this; }; /** * Adds a filter to a faceted attribute with the `value` provided. If the * filter is already set, it doesn't change the filters. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} value the associated value (will be converted to string) * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.addFacetRefinement = function(facet, value) { this._change(this.state.setPage(0).addFacetRefinement(facet, value)); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addFacetRefinement} */ AlgoliaSearchHelper.prototype.addRefine = function() { return this.addFacetRefinement.apply(this, arguments); }; /** * Adds a an exclusion filter to a faceted attribute with the `value` provided. If the * filter is already set, it doesn't change the filters. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} value the associated value (will be converted to string) * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.addFacetExclusion = function(facet, value) { this._change(this.state.setPage(0).addExcludeRefinement(facet, value)); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addFacetExclusion} */ AlgoliaSearchHelper.prototype.addExclude = function() { return this.addFacetExclusion.apply(this, arguments); }; /** * Adds a tag filter with the `tag` provided. If the * filter is already set, it doesn't change the filters. * * This method resets the current page to 0. * @param {string} tag the tag to add to the filter * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.addTag = function(tag) { this._change(this.state.setPage(0).addTagRefinement(tag)); return this; }; /** * Removes an numeric filter to an attribute with the `operator` and `value` provided. If the * filter is not set, it doesn't change the filters. * * Some parameters are optional, triggering different behavior: * - if the value is not provided, then all the numeric value will be removed for the * specified attribute/operator couple. * - if the operator is not provided either, then all the numeric filter on this attribute * will be removed. * * This method resets the current page to 0. * @param {string} attribute the attribute on which the numeric filter applies * @param {string} [operator] the operator of the filter * @param {number} [value] the value of the filter * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.removeNumericRefinement = function(attribute, operator, value) { this._change(this.state.setPage(0).removeNumericRefinement(attribute, operator, value)); return this; }; /** * Removes a disjunctive filter to a faceted attribute with the `value` provided. If the * filter is not set, it doesn't change the filters. * * If the value is omitted, then this method will remove all the filters for the * attribute. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} [value] the associated value * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.removeDisjunctiveFacetRefinement = function(facet, value) { this._change(this.state.setPage(0).removeDisjunctiveFacetRefinement(facet, value)); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeDisjunctiveFacetRefinement} */ AlgoliaSearchHelper.prototype.removeDisjunctiveRefine = function() { return this.removeDisjunctiveFacetRefinement.apply(this, arguments); }; /** * Removes the refinement set on a hierarchical facet. * @param {string} facet the facet name * @return {AlgoliaSearchHelper} * @throws Error if the facet is not defined or if the facet is not refined * @fires change * @chainable */ AlgoliaSearchHelper.prototype.removeHierarchicalFacetRefinement = function(facet) { this._change(this.state.setPage(0).removeHierarchicalFacetRefinement(facet)); return this; }; /** * Removes a filter to a faceted attribute with the `value` provided. If the * filter is not set, it doesn't change the filters. * * If the value is omitted, then this method will remove all the filters for the * attribute. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} [value] the associated value * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.removeFacetRefinement = function(facet, value) { this._change(this.state.setPage(0).removeFacetRefinement(facet, value)); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeFacetRefinement} */ AlgoliaSearchHelper.prototype.removeRefine = function() { return this.removeFacetRefinement.apply(this, arguments); }; /** * Removes an exclusion filter to a faceted attribute with the `value` provided. If the * filter is not set, it doesn't change the filters. * * If the value is omitted, then this method will remove all the filters for the * attribute. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} [value] the associated value * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.removeFacetExclusion = function(facet, value) { this._change(this.state.setPage(0).removeExcludeRefinement(facet, value)); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeFacetExclusion} */ AlgoliaSearchHelper.prototype.removeExclude = function() { return this.removeFacetExclusion.apply(this, arguments); }; /** * Removes a tag filter with the `tag` provided. If the * filter is not set, it doesn't change the filters. * * This method resets the current page to 0. * @param {string} tag tag to remove from the filter * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.removeTag = function(tag) { this._change(this.state.setPage(0).removeTagRefinement(tag)); return this; }; /** * Adds or removes an exclusion filter to a faceted attribute with the `value` provided. If * the value is set then it removes it, otherwise it adds the filter. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} value the associated value * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.toggleFacetExclusion = function(facet, value) { this._change(this.state.setPage(0).toggleExcludeFacetRefinement(facet, value)); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#toggleFacetExclusion} */ AlgoliaSearchHelper.prototype.toggleExclude = function() { return this.toggleFacetExclusion.apply(this, arguments); }; /** * Adds or removes a filter to a faceted attribute with the `value` provided. If * the value is set then it removes it, otherwise it adds the filter. * * This method can be used for conjunctive, disjunctive and hierarchical filters. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} value the associated value * @return {AlgoliaSearchHelper} * @throws Error will throw an error if the facet is not declared in the settings of the helper * @fires change * @chainable * @deprecated since version 2.19.0, see {@link AlgoliaSearchHelper#toggleFacetRefinement} */ AlgoliaSearchHelper.prototype.toggleRefinement = function(facet, value) { return this.toggleFacetRefinement(facet, value); }; /** * Adds or removes a filter to a faceted attribute with the `value` provided. If * the value is set then it removes it, otherwise it adds the filter. * * This method can be used for conjunctive, disjunctive and hierarchical filters. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} value the associated value * @return {AlgoliaSearchHelper} * @throws Error will throw an error if the facet is not declared in the settings of the helper * @fires change * @chainable */ AlgoliaSearchHelper.prototype.toggleFacetRefinement = function(facet, value) { this._change(this.state.setPage(0).toggleFacetRefinement(facet, value)); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#toggleFacetRefinement} */ AlgoliaSearchHelper.prototype.toggleRefine = function() { return this.toggleFacetRefinement.apply(this, arguments); }; /** * Adds or removes a tag filter with the `value` provided. If * the value is set then it removes it, otherwise it adds the filter. * * This method resets the current page to 0. * @param {string} tag tag to remove or add * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.toggleTag = function(tag) { this._change(this.state.setPage(0).toggleTagRefinement(tag)); return this; }; /** * Increments the page number by one. * @return {AlgoliaSearchHelper} * @fires change * @chainable * @example * helper.setPage(0).nextPage().getPage(); * // returns 1 */ AlgoliaSearchHelper.prototype.nextPage = function() { return this.setPage(this.state.page + 1); }; /** * Decrements the page number by one. * @fires change * @return {AlgoliaSearchHelper} * @chainable * @example * helper.setPage(1).previousPage().getPage(); * // returns 0 */ AlgoliaSearchHelper.prototype.previousPage = function() { return this.setPage(this.state.page - 1); }; /** * @private */ function setCurrentPage(page) { if (page < 0) throw new Error('Page requested below 0.'); this._change(this.state.setPage(page)); return this; } /** * Change the current page * @deprecated * @param {number} page The page number * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.setCurrentPage = setCurrentPage; /** * Updates the current page. * @function * @param {number} page The page number * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.setPage = setCurrentPage; /** * Updates the name of the index that will be targeted by the query. * * This method resets the current page to 0. * @param {string} name the index name * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.setIndex = function(name) { this._change(this.state.setPage(0).setIndex(name)); return this; }; /** * Update a parameter of the search. This method reset the page * * The complete list of parameters is available on the * [Algolia website](https://www.algolia.com/doc/rest#query-an-index). * The most commonly used parameters have their own [shortcuts](#query-parameters-shortcuts) * or benefit from higher-level APIs (all the kind of filters and facets have their own API) * * This method resets the current page to 0. * @param {string} parameter name of the parameter to update * @param {any} value new value of the parameter * @return {AlgoliaSearchHelper} * @fires change * @chainable * @example * helper.setQueryParameter('hitsPerPage', 20).search(); */ AlgoliaSearchHelper.prototype.setQueryParameter = function(parameter, value) { this._change(this.state.setPage(0).setQueryParameter(parameter, value)); return this; }; /** * Set the whole state (warning: will erase previous state) * @param {SearchParameters} newState the whole new state * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.setState = function(newState) { this._change(SearchParameters_1.make(newState)); return this; }; /** * Get the current search state stored in the helper. This object is immutable. * @param {string[]} [filters] optional filters to retrieve only a subset of the state * @return {SearchParameters|object} if filters is specified a plain object is * returned containing only the requested fields, otherwise return the unfiltered * state * @example * // Get the complete state as stored in the helper * helper.getState(); * @example * // Get a part of the state with all the refinements on attributes and the query * helper.getState(['query', 'attribute:category']); */ AlgoliaSearchHelper.prototype.getState = function(filters) { if (filters === undefined) return this.state; return this.state.filter(filters); }; /** * DEPRECATED Get part of the state as a query string. By default, the output keys will not * be prefixed and will only take the applied refinements and the query. * @deprecated * @param {object} [options] May contain the following parameters : * * **filters** : possible values are all the keys of the [SearchParameters](#searchparameters), `index` for * the index, all the refinements with `attribute:*` or for some specific attributes with * `attribute:theAttribute` * * **prefix** : prefix in front of the keys * * **moreAttributes** : more values to be added in the query string. Those values * won't be prefixed. * @return {string} the query string */ AlgoliaSearchHelper.prototype.getStateAsQueryString = function getStateAsQueryString(options) { var filters = options && options.filters || ['query', 'attribute:*']; var partialState = this.getState(filters); return url.getQueryStringFromState(partialState, options); }; /** * DEPRECATED Read a query string and return an object containing the state. Use * url module. * @deprecated * @static * @param {string} queryString the query string that will be decoded * @param {object} options accepted options : * - prefix : the prefix used for the saved attributes, you have to provide the * same that was used for serialization * @return {object} partial search parameters object (same properties than in the * SearchParameters but not exhaustive) * @see {@link url#getStateFromQueryString} */ AlgoliaSearchHelper.getConfigurationFromQueryString = url.getStateFromQueryString; /** * DEPRECATED Retrieve an object of all the properties that are not understandable as helper * parameters. Use url module. * @deprecated * @static * @param {string} queryString the query string to read * @param {object} options the options * - prefixForParameters : prefix used for the helper configuration keys * @return {object} the object containing the parsed configuration that doesn't * to the helper */ AlgoliaSearchHelper.getForeignConfigurationInQueryString = url.getUnrecognizedParametersInQueryString; /** * DEPRECATED Overrides part of the state with the properties stored in the provided query * string. * @deprecated * @param {string} queryString the query string containing the informations to url the state * @param {object} options optional parameters : * - prefix : prefix used for the algolia parameters * - triggerChange : if set to true the state update will trigger a change event */ AlgoliaSearchHelper.prototype.setStateFromQueryString = function(queryString, options) { var triggerChange = options && options.triggerChange || false; var configuration = url.getStateFromQueryString(queryString, options); var updatedState = this.state.setQueryParameters(configuration); if (triggerChange) this.setState(updatedState); else this.overrideStateWithoutTriggeringChangeEvent(updatedState); }; /** * Override the current state without triggering a change event. * Do not use this method unless you know what you are doing. (see the example * for a legit use case) * @param {SearchParameters} newState the whole new state * @return {AlgoliaSearchHelper} * @example * helper.on('change', function(state){ * // In this function you might want to find a way to store the state in the url/history * updateYourURL(state) * }) * window.onpopstate = function(event){ * // This is naive though as you should check if the state is really defined etc. * helper.overrideStateWithoutTriggeringChangeEvent(event.state).search() * } * @chainable */ AlgoliaSearchHelper.prototype.overrideStateWithoutTriggeringChangeEvent = function(newState) { this.state = new SearchParameters_1(newState); return this; }; /** * @deprecated since 2.4.0, see {@link AlgoliaSearchHelper#hasRefinements} */ AlgoliaSearchHelper.prototype.isRefined = function(facet, value) { if (this.state.isConjunctiveFacet(facet)) { return this.state.isFacetRefined(facet, value); } else if (this.state.isDisjunctiveFacet(facet)) { return this.state.isDisjunctiveFacetRefined(facet, value); } throw new Error(facet + ' is not properly defined in this helper configuration' + '(use the facets or disjunctiveFacets keys to configure it)'); }; /** * Check if an attribute has any numeric, conjunctive, disjunctive or hierarchical filters. * @param {string} attribute the name of the attribute * @return {boolean} true if the attribute is filtered by at least one value * @example * // hasRefinements works with numeric, conjunctive, disjunctive and hierarchical filters * helper.hasRefinements('price'); // false * helper.addNumericRefinement('price', '>', 100); * helper.hasRefinements('price'); // true * * helper.hasRefinements('color'); // false * helper.addFacetRefinement('color', 'blue'); * helper.hasRefinements('color'); // true * * helper.hasRefinements('material'); // false * helper.addDisjunctiveFacetRefinement('material', 'plastic'); * helper.hasRefinements('material'); // true * * helper.hasRefinements('categories'); // false * helper.toggleFacetRefinement('categories', 'kitchen > knife'); * helper.hasRefinements('categories'); // true * */ AlgoliaSearchHelper.prototype.hasRefinements = function(attribute) { if (!isEmpty_1(this.state.getNumericRefinements(attribute))) { return true; } else if (this.state.isConjunctiveFacet(attribute)) { return this.state.isFacetRefined(attribute); } else if (this.state.isDisjunctiveFacet(attribute)) { return this.state.isDisjunctiveFacetRefined(attribute); } else if (this.state.isHierarchicalFacet(attribute)) { return this.state.isHierarchicalFacetRefined(attribute); } // there's currently no way to know that the user did call `addNumericRefinement` at some point // thus we cannot distinguish if there once was a numeric refinement that was cleared // so we will return false in every other situations to be consistent // while what we should do here is throw because we did not find the attribute in any type // of refinement return false; }; /** * Check if a value is excluded for a specific faceted attribute. If the value * is omitted then the function checks if there is any excluding refinements. * * @param {string} facet name of the attribute for used for faceting * @param {string} [value] optional value. If passed will test that this value * is filtering the given facet. * @return {boolean} true if refined * @example * helper.isExcludeRefined('color'); // false * helper.isExcludeRefined('color', 'blue') // false * helper.isExcludeRefined('color', 'red') // false * * helper.addFacetExclusion('color', 'red'); * * helper.isExcludeRefined('color'); // true * helper.isExcludeRefined('color', 'blue') // false * helper.isExcludeRefined('color', 'red') // true */ AlgoliaSearchHelper.prototype.isExcluded = function(facet, value) { return this.state.isExcludeRefined(facet, value); }; /** * @deprecated since 2.4.0, see {@link AlgoliaSearchHelper#hasRefinements} */ AlgoliaSearchHelper.prototype.isDisjunctiveRefined = function(facet, value) { return this.state.isDisjunctiveFacetRefined(facet, value); }; /** * Check if the string is a currently filtering tag. * @param {string} tag tag to check * @return {boolean} */ AlgoliaSearchHelper.prototype.hasTag = function(tag) { return this.state.isTagRefined(tag); }; /** * @deprecated since 2.4.0, see {@link AlgoliaSearchHelper#hasTag} */ AlgoliaSearchHelper.prototype.isTagRefined = function() { return this.hasTagRefinements.apply(this, arguments); }; /** * Get the name of the currently used index. * @return {string} * @example * helper.setIndex('highestPrice_products').getIndex(); * // returns 'highestPrice_products' */ AlgoliaSearchHelper.prototype.getIndex = function() { return this.state.index; }; function getCurrentPage() { return this.state.page; } /** * Get the currently selected page * @deprecated * @return {number} the current page */ AlgoliaSearchHelper.prototype.getCurrentPage = getCurrentPage; /** * Get the currently selected page * @function * @return {number} the current page */ AlgoliaSearchHelper.prototype.getPage = getCurrentPage; /** * Get all the tags currently set to filters the results. * * @return {string[]} The list of tags currently set. */ AlgoliaSearchHelper.prototype.getTags = function() { return this.state.tagRefinements; }; /** * Get a parameter of the search by its name. It is possible that a parameter is directly * defined in the index dashboard, but it will be undefined using this method. * * The complete list of parameters is * available on the * [Algolia website](https://www.algolia.com/doc/rest#query-an-index). * The most commonly used parameters have their own [shortcuts](#query-parameters-shortcuts) * or benefit from higher-level APIs (all the kind of filters have their own API) * @param {string} parameterName the parameter name * @return {any} the parameter value * @example * var hitsPerPage = helper.getQueryParameter('hitsPerPage'); */ AlgoliaSearchHelper.prototype.getQueryParameter = function(parameterName) { return this.state.getQueryParameter(parameterName); }; /** * Get the list of refinements for a given attribute. This method works with * conjunctive, disjunctive, excluding and numerical filters. * * See also SearchResults#getRefinements * * @param {string} facetName attribute name used for faceting * @return {Array.<FacetRefinement|NumericRefinement>} All Refinement are objects that contain a value, and * a type. Numeric also contains an operator. * @example * helper.addNumericRefinement('price', '>', 100); * helper.getRefinements('price'); * // [ * // { * // "value": [ * // 100 * // ], * // "operator": ">", * // "type": "numeric" * // } * // ] * @example * helper.addFacetRefinement('color', 'blue'); * helper.addFacetExclusion('color', 'red'); * helper.getRefinements('color'); * // [ * // { * // "value": "blue", * // "type": "conjunctive" * // }, * // { * // "value": "red", * // "type": "exclude" * // } * // ] * @example * helper.addDisjunctiveFacetRefinement('material', 'plastic'); * // [ * // { * // "value": "plastic", * // "type": "disjunctive" * // } * // ] */ AlgoliaSearchHelper.prototype.getRefinements = function(facetName) { var refinements = []; if (this.state.isConjunctiveFacet(facetName)) { var conjRefinements = this.state.getConjunctiveRefinements(facetName); forEach_1(conjRefinements, function(r) { refinements.push({ value: r, type: 'conjunctive' }); }); var excludeRefinements = this.state.getExcludeRefinements(facetName); forEach_1(excludeRefinements, function(r) { refinements.push({ value: r, type: 'exclude' }); }); } else if (this.state.isDisjunctiveFacet(facetName)) { var disjRefinements = this.state.getDisjunctiveRefinements(facetName); forEach_1(disjRefinements, function(r) { refinements.push({ value: r, type: 'disjunctive' }); }); } var numericRefinements = this.state.getNumericRefinements(facetName); forEach_1(numericRefinements, function(value, operator) { refinements.push({ value: value, operator: operator, type: 'numeric' }); }); return refinements; }; /** * Return the current refinement for the (attribute, operator) * @param {string} attribute attribute in the record * @param {string} operator operator applied on the refined values * @return {Array.<number|number[]>} refined values */ AlgoliaSearchHelper.prototype.getNumericRefinement = function(attribute, operator) { return this.state.getNumericRefinement(attribute, operator); }; /** * Get the current breadcrumb for a hierarchical facet, as an array * @param {string} facetName Hierarchical facet name * @return {array.<string>} the path as an array of string */ AlgoliaSearchHelper.prototype.getHierarchicalFacetBreadcrumb = function(facetName) { return this.state.getHierarchicalFacetBreadcrumb(facetName); }; // /////////// PRIVATE /** * Perform the underlying queries * @private * @return {undefined} * @fires search * @fires result * @fires error */ AlgoliaSearchHelper.prototype._search = function() { var state = this.state; var mainQueries = requestBuilder_1._getQueries(state.index, state); var states = [{ state: state, queriesCount: mainQueries.length, helper: this }]; this.emit('search', state, this.lastResults); var derivedQueries = map_1(this.derivedHelpers, function(derivedHelper) { var derivedState = derivedHelper.getModifiedState(state); var queries = requestBuilder_1._getQueries(derivedState.index, derivedState); states.push({ state: derivedState, queriesCount: queries.length, helper: derivedHelper }); derivedHelper.emit('search', derivedState, derivedHelper.lastResults); return queries; }); var queries = mainQueries.concat(flatten_1(derivedQueries)); var queryId = this._queryId++; this._currentNbQueries++; try { this.client.search(queries) .then(this._dispatchAlgoliaResponse.bind(this, states, queryId)) .catch(this._dispatchAlgoliaError.bind(this, queryId)); } catch (err) { // If we reach this part, we're in an internal error state this.emit('error', err); } }; /** * Transform the responses as sent by the server and transform them into a user * usable object that merge the results of all the batch requests. It will dispatch * over the different helper + derived helpers (when there are some). * @private * @param {array.<{SearchParameters, AlgoliaQueries, AlgoliaSearchHelper}>} * state state used for to generate the request * @param {number} queryId id of the current request * @param {object} content content of the response * @return {undefined} */ AlgoliaSearchHelper.prototype._dispatchAlgoliaResponse = function(states, queryId, content) { // FIXME remove the number of outdated queries discarded instead of just one if (queryId < this._lastQueryIdReceived) { // Outdated answer return; } this._currentNbQueries -= (queryId - this._lastQueryIdReceived); this._lastQueryIdReceived = queryId; if (this._currentNbQueries === 0) this.emit('searchQueueEmpty'); var results = content.results; forEach_1(states, function(s) { var state = s.state; var queriesCount = s.queriesCount; var helper = s.helper; var specificResults = results.splice(0, queriesCount); var formattedResponse = helper.lastResults = new SearchResults_1(state, specificResults); helper.emit('result', formattedResponse, state); }); }; AlgoliaSearchHelper.prototype._dispatchAlgoliaError = function(queryId, err) { if (queryId < this._lastQueryIdReceived) { // Outdated answer return; } this._currentNbQueries -= queryId - this._lastQueryIdReceived; this._lastQueryIdReceived = queryId; this.emit('error', err); if (this._currentNbQueries === 0) this.emit('searchQueueEmpty'); }; AlgoliaSearchHelper.prototype.containsRefinement = function(query, facetFilters, numericFilters, tagFilters) { return query || facetFilters.length !== 0 || numericFilters.length !== 0 || tagFilters.length !== 0; }; /** * Test if there are some disjunctive refinements on the facet * @private * @param {string} facet the attribute to test * @return {boolean} */ AlgoliaSearchHelper.prototype._hasDisjunctiveRefinements = function(facet) { return this.state.disjunctiveRefinements[facet] && this.state.disjunctiveRefinements[facet].length > 0; }; AlgoliaSearchHelper.prototype._change = function(newState) { if (newState !== this.state) { this.state = newState; this.emit('change', this.state, this.lastResults); } }; /** * Clears the cache of the underlying Algolia client. * @return {AlgoliaSearchHelper} */ AlgoliaSearchHelper.prototype.clearCache = function() { this.client.clearCache && this.client.clearCache(); return this; }; /** * Updates the internal client instance. If the reference of the clients * are equal then no update is actually done. * @param {AlgoliaSearch} newClient an AlgoliaSearch client * @return {AlgoliaSearchHelper} */ AlgoliaSearchHelper.prototype.setClient = function(newClient) { if (this.client === newClient) return this; if (newClient.addAlgoliaAgent && !doesClientAgentContainsHelper(newClient)) newClient.addAlgoliaAgent('JS Helper ' + version$1); this.client = newClient; return this; }; /** * Gets the instance of the currently used client. * @return {AlgoliaSearch} */ AlgoliaSearchHelper.prototype.getClient = function() { return this.client; }; /** * Creates an derived instance of the Helper. A derived helper * is a way to request other indices synchronised with the lifecycle * of the main Helper. This mechanism uses the multiqueries feature * of Algolia to aggregate all the requests in a single network call. * * This method takes a function that is used to create a new SearchParameter * that will be used to create requests to Algolia. Those new requests * are created just before the `search` event. The signature of the function * is `SearchParameters -> SearchParameters`. * * This method returns a new DerivedHelper which is an EventEmitter * that fires the same `search`, `result` and `error` events. Those * events, however, will receive data specific to this DerivedHelper * and the SearchParameters that is returned by the call of the * parameter function. * @param {function} fn SearchParameters -> SearchParameters * @return {DerivedHelper} */ AlgoliaSearchHelper.prototype.derive = function(fn) { var derivedHelper = new DerivedHelper_1(this, fn); this.derivedHelpers.push(derivedHelper); return derivedHelper; }; /** * This method detaches a derived Helper from the main one. Prefer using the one from the * derived helper itself, to remove the event listeners too. * @private * @return {undefined} * @throws Error */ AlgoliaSearchHelper.prototype.detachDerivedHelper = function(derivedHelper) { var pos = this.derivedHelpers.indexOf(derivedHelper); if (pos === -1) throw new Error('Derived helper already detached'); this.derivedHelpers.splice(pos, 1); }; /** * This method returns true if there is currently at least one on-going search. * @return {boolean} true if there is a search pending */ AlgoliaSearchHelper.prototype.hasPendingRequests = function() { return this._currentNbQueries > 0; }; /** * @typedef AlgoliaSearchHelper.NumericRefinement * @type {object} * @property {number[]} value the numbers that are used for filtering this attribute with * the operator specified. * @property {string} operator the faceting data: value, number of entries * @property {string} type will be 'numeric' */ /** * @typedef AlgoliaSearchHelper.FacetRefinement * @type {object} * @property {string} value the string use to filter the attribute * @property {string} type the type of filter: 'conjunctive', 'disjunctive', 'exclude' */ /* * This function tests if the _ua parameter of the client * already contains the JS Helper UA */ function doesClientAgentContainsHelper(client) { // this relies on JS Client internal variable, this might break if implementation changes var currentAgent = client._ua; return !currentAgent ? false : currentAgent.indexOf('JS Helper') !== -1; } var algoliasearch_helper = AlgoliaSearchHelper; /** * The algoliasearchHelper module is the function that will let its * contains everything needed to use the Algoliasearch * Helper. It is a also a function that instanciate the helper. * To use the helper, you also need the Algolia JS client v3. * @example * //using the UMD build * var client = algoliasearch('latency', '6be0576ff61c053d5f9a3225e2a90f76'); * var helper = algoliasearchHelper(client, 'bestbuy', { * facets: ['shipping'], * disjunctiveFacets: ['category'] * }); * helper.on('result', function(result) { * console.log(result); * }); * helper.toggleRefine('Movies & TV Shows') * .toggleRefine('Free shipping') * .search(); * @example * // The helper is an event emitter using the node API * helper.on('result', updateTheResults); * helper.once('result', updateTheResults); * helper.removeListener('result', updateTheResults); * helper.removeAllListeners('result'); * @module algoliasearchHelper * @param {AlgoliaSearch} client an AlgoliaSearch client * @param {string} index the name of the index to query * @param {SearchParameters|object} opts an object defining the initial config of the search. It doesn't have to be a {SearchParameters}, just an object containing the properties you need from it. * @return {AlgoliaSearchHelper} */ function algoliasearchHelper(client, index, opts) { return new algoliasearch_helper(client, index, opts); } /** * The version currently used * @member module:algoliasearchHelper.version * @type {number} */ algoliasearchHelper.version = version$1; /** * Constructor for the Helper. * @member module:algoliasearchHelper.AlgoliaSearchHelper * @type {AlgoliaSearchHelper} */ algoliasearchHelper.AlgoliaSearchHelper = algoliasearch_helper; /** * Constructor for the object containing all the parameters of the search. * @member module:algoliasearchHelper.SearchParameters * @type {SearchParameters} */ algoliasearchHelper.SearchParameters = SearchParameters_1; /** * Constructor for the object containing the results of the search. * @member module:algoliasearchHelper.SearchResults * @type {SearchResults} */ algoliasearchHelper.SearchResults = SearchResults_1; /** * URL tools to generate query string and parse them from/into * SearchParameters * @member module:algoliasearchHelper.url * @type {object} {@link url} * */ algoliasearchHelper.url = url; var algoliasearchHelper_1 = algoliasearchHelper; var algoliasearchHelper_4 = algoliasearchHelper_1.SearchParameters; // From https://github.com/reactjs/react-redux/blob/master/src/utils/shallowEqual.js var shallowEqual = function shallowEqual(objA, objB) { if (objA === objB) { return true; } var keysA = Object.keys(objA); var keysB = Object.keys(objB); if (keysA.length !== keysB.length) { return false; } // Test for A's keys different from B. var hasOwn = Object.prototype.hasOwnProperty; for (var i = 0; i < keysA.length; i++) { if (!hasOwn.call(objB, keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) { return false; } } return true; }; var getDisplayName = function getDisplayName(Component) { return Component.displayName || Component.name || 'UnknownComponent'; }; var resolved = Promise.resolve(); var defer = function defer(f) { resolved.then(f); }; var removeEmptyKey = function removeEmptyKey(obj) { Object.keys(obj).forEach(function (key) { var value = obj[key]; if (isEmpty_1(value) && isPlainObject_1(value)) { delete obj[key]; } else if (isPlainObject_1(value)) { removeEmptyKey(value); } }); return obj; }; function createWidgetsManager(onWidgetsUpdate) { var widgets = []; // Is an update scheduled? var scheduled = false; // The state manager's updates need to be batched since more than one // component can register or unregister widgets during the same tick. function scheduleUpdate() { if (scheduled) { return; } scheduled = true; defer(function () { scheduled = false; onWidgetsUpdate(); }); } return { registerWidget: function registerWidget(widget) { widgets.push(widget); scheduleUpdate(); return function unregisterWidget() { widgets.splice(widgets.indexOf(widget), 1); scheduleUpdate(); }; }, update: scheduleUpdate, getWidgets: function getWidgets() { return widgets; } }; } function createStore(initialState) { var state = initialState; var listeners = []; function dispatch() { listeners.forEach(function (listener) { return listener(); }); } return { getState: function getState() { return state; }, setState: function setState(nextState) { state = nextState; dispatch(); }, subscribe: function subscribe(listener) { listeners.push(listener); return function unsubcribe() { listeners.splice(listeners.indexOf(listener), 1); }; } }; } var HIGHLIGHT_TAGS = { highlightPreTag: '<ais-highlight-0000000000>', highlightPostTag: '</ais-highlight-0000000000>' }; /** * Parses an highlighted attribute into an array of objects with the string value, and * a boolean that indicated if this part is highlighted. * * @param {string} preTag - string used to identify the start of an highlighted value * @param {string} postTag - string used to identify the end of an highlighted value * @param {string} highlightedValue - highlighted attribute as returned by Algolia highlight feature * @return {object[]} - An array of {value: string, isDefined: boolean}. */ function parseHighlightedAttribute(_ref) { var preTag = _ref.preTag, postTag = _ref.postTag, _ref$highlightedValue = _ref.highlightedValue, highlightedValue = _ref$highlightedValue === undefined ? '' : _ref$highlightedValue; var splitByPreTag = highlightedValue.split(preTag); var firstValue = splitByPreTag.shift(); var elements = firstValue === '' ? [] : [{ value: firstValue, isHighlighted: false }]; if (postTag === preTag) { var isHighlighted = true; splitByPreTag.forEach(function (split) { elements.push({ value: split, isHighlighted: isHighlighted }); isHighlighted = !isHighlighted; }); } else { splitByPreTag.forEach(function (split) { var splitByPostTag = split.split(postTag); elements.push({ value: splitByPostTag[0], isHighlighted: true }); if (splitByPostTag[1] !== '') { elements.push({ value: splitByPostTag[1], isHighlighted: false }); } }); } return elements; } /** * Find an highlighted attribute given an `attribute` and an `highlightProperty`, parses it, * and provided an array of objects with the string value and a boolean if this * value is highlighted. * * In order to use this feature, highlight must be activated in the configuration of * the index. The `preTag` and `postTag` attributes are respectively highlightPreTag and * highligtPostTag in Algolia configuration. * * @param {string} preTag - string used to identify the start of an highlighted value * @param {string} postTag - string used to identify the end of an highlighted value * @param {string} highlightProperty - the property that contains the highlight structure in the results * @param {string} attribute - the highlighted attribute to look for * @param {object} hit - the actual hit returned by Algolia. * @return {object[]} - An array of {value: string, isHighlighted: boolean}. */ function parseAlgoliaHit(_ref2) { var _ref2$preTag = _ref2.preTag, preTag = _ref2$preTag === undefined ? '<em>' : _ref2$preTag, _ref2$postTag = _ref2.postTag, postTag = _ref2$postTag === undefined ? '</em>' : _ref2$postTag, highlightProperty = _ref2.highlightProperty, attribute = _ref2.attribute, hit = _ref2.hit; if (!hit) throw new Error('`hit`, the matching record, must be provided'); var highlightObject = get_1(hit[highlightProperty], attribute, {}); if (Array.isArray(highlightObject)) { return highlightObject.map(function (item) { return parseHighlightedAttribute({ preTag: preTag, postTag: postTag, highlightedValue: item.value }); }); } return parseHighlightedAttribute({ preTag: preTag, postTag: postTag, highlightedValue: highlightObject.value }); } 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; }; function _defineProperty$1(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; } /** * Creates a new instance of the InstantSearchManager which controls the widgets and * trigger the search when the widgets are updated. * @param {string} indexName - the main index name * @param {object} initialState - initial widget state * @param {object} SearchParameters - optional additional parameters to send to the algolia API * @param {number} stalledSearchDelay - time (in ms) after the search is stalled * @return {InstantSearchManager} a new instance of InstantSearchManager */ function createInstantSearchManager(_ref) { var indexName = _ref.indexName, _ref$initialState = _ref.initialState, initialState = _ref$initialState === undefined ? {} : _ref$initialState, searchClient = _ref.searchClient, resultsState = _ref.resultsState, stalledSearchDelay = _ref.stalledSearchDelay; var baseSP = new algoliasearchHelper_4(_extends({ index: indexName }, HIGHLIGHT_TAGS)); var stalledSearchTimer = null; var helper = algoliasearchHelper_1(searchClient, indexName, baseSP); helper.on('result', handleSearchSuccess); helper.on('error', handleSearchError); helper.on('search', handleNewSearch); var derivedHelpers = {}; var indexMapping = {}; // keep track of the original index where the parameters applied when sortBy is used. var initialSearchParameters = helper.state; var widgetsManager = createWidgetsManager(onWidgetsUpdate); var store = createStore({ widgets: initialState, metadata: [], results: resultsState || null, error: null, searching: false, isSearchStalled: true, searchingForFacetValues: false }); var skip = false; function skipSearch() { skip = true; } function updateClient(client) { helper.setClient(client); search(); } function clearCache() { helper.clearCache(); search(); } function getMetadata(state) { return widgetsManager.getWidgets().filter(function (widget) { return Boolean(widget.getMetadata); }).map(function (widget) { return widget.getMetadata(state); }); } function getSearchParameters() { indexMapping = {}; var sharedParameters = widgetsManager.getWidgets().filter(function (widget) { return Boolean(widget.getSearchParameters); }).filter(function (widget) { return !widget.context.multiIndexContext && (widget.props.indexName === indexName || !widget.props.indexName); }).reduce(function (res, widget) { return widget.getSearchParameters(res); }, initialSearchParameters); indexMapping[sharedParameters.index] = indexName; var derivatedWidgets = widgetsManager.getWidgets().filter(function (widget) { return Boolean(widget.getSearchParameters); }).filter(function (widget) { return widget.context.multiIndexContext && widget.context.multiIndexContext.targetedIndex !== indexName || widget.props.indexName && widget.props.indexName !== indexName; }).reduce(function (indices, widget) { var targetedIndex = widget.context.multiIndexContext ? widget.context.multiIndexContext.targetedIndex : widget.props.indexName; var index = find_1(indices, function (i) { return i.targetedIndex === targetedIndex; }); if (index) { index.widgets.push(widget); } else { indices.push({ targetedIndex: targetedIndex, widgets: [widget] }); } return indices; }, []); var mainIndexParameters = widgetsManager.getWidgets().filter(function (widget) { return Boolean(widget.getSearchParameters); }).filter(function (widget) { return widget.context.multiIndexContext && widget.context.multiIndexContext.targetedIndex === indexName || widget.props.indexName && widget.props.indexName === indexName; }).reduce(function (res, widget) { return widget.getSearchParameters(res); }, sharedParameters); indexMapping[mainIndexParameters.index] = indexName; return { sharedParameters: sharedParameters, mainIndexParameters: mainIndexParameters, derivatedWidgets: derivatedWidgets }; } function search() { if (!skip) { var _getSearchParameters = getSearchParameters(helper.state), sharedParameters = _getSearchParameters.sharedParameters, mainIndexParameters = _getSearchParameters.mainIndexParameters, derivatedWidgets = _getSearchParameters.derivatedWidgets; Object.keys(derivedHelpers).forEach(function (key) { return derivedHelpers[key].detach(); }); derivedHelpers = {}; helper.setState(sharedParameters); derivatedWidgets.forEach(function (derivatedSearchParameters) { var index = derivatedSearchParameters.targetedIndex; var derivedHelper = helper.derive(function () { var parameters = derivatedSearchParameters.widgets.reduce(function (res, widget) { return widget.getSearchParameters(res); }, sharedParameters); indexMapping[parameters.index] = index; return parameters; }); derivedHelper.on('result', handleSearchSuccess); derivedHelper.on('error', handleSearchError); derivedHelpers[index] = derivedHelper; }); helper.setState(mainIndexParameters); helper.search(); } } function handleSearchSuccess(content) { var state = store.getState(); var results = state.results ? state.results : {}; /* if switching from mono index to multi index and vice versa, results needs to reset to {}*/ results = !isEmpty_1(derivedHelpers) && results.getFacetByName ? {} : results; if (!isEmpty_1(derivedHelpers)) { results[indexMapping[content.index]] = content; } else { results = content; } var currentState = store.getState(); var nextIsSearchStalled = currentState.isSearchStalled; if (!helper.hasPendingRequests()) { clearTimeout(stalledSearchTimer); stalledSearchTimer = null; nextIsSearchStalled = false; } var nextState = omit_1(_extends({}, currentState, { results: results, isSearchStalled: nextIsSearchStalled, searching: false, error: null }), 'resultsFacetValues'); store.setState(nextState); } function handleSearchError(error) { var currentState = store.getState(); var nextIsSearchStalled = currentState.isSearchStalled; if (!helper.hasPendingRequests()) { clearTimeout(stalledSearchTimer); nextIsSearchStalled = false; } var nextState = omit_1(_extends({}, currentState, { isSearchStalled: nextIsSearchStalled, error: error, searching: false }), 'resultsFacetValues'); store.setState(nextState); } function handleNewSearch() { if (!stalledSearchTimer) { stalledSearchTimer = setTimeout(function () { var nextState = omit_1(_extends({}, store.getState(), { isSearchStalled: true }), 'resultsFacetValues'); store.setState(nextState); }, stalledSearchDelay); } } // Called whenever a widget has been rendered with new props. function onWidgetsUpdate() { var metadata = getMetadata(store.getState().widgets); store.setState(_extends({}, store.getState(), { metadata: metadata, searching: true })); // Since the `getSearchParameters` method of widgets also depends on props, // the result search parameters might have changed. search(); } function transitionState(nextSearchState) { var searchState = store.getState().widgets; return widgetsManager.getWidgets().filter(function (widget) { return Boolean(widget.transitionState); }).reduce(function (res, widget) { return widget.transitionState(searchState, res); }, nextSearchState); } function onExternalStateUpdate(nextSearchState) { var metadata = getMetadata(nextSearchState); store.setState(_extends({}, store.getState(), { widgets: nextSearchState, metadata: metadata, searching: true })); search(); } function onSearchForFacetValues(_ref2) { var facetName = _ref2.facetName, query = _ref2.query, maxFacetHits = _ref2.maxFacetHits; store.setState(_extends({}, store.getState(), { searchingForFacetValues: true })); helper.searchForFacetValues(facetName, query, maxFacetHits).then(function (content) { var _extends2; store.setState(_extends({}, store.getState(), { resultsFacetValues: _extends({}, store.getState().resultsFacetValues, (_extends2 = {}, _defineProperty$1(_extends2, facetName, content.facetHits), _defineProperty$1(_extends2, 'query', query), _extends2)), searchingForFacetValues: false })); }, function (error) { store.setState(_extends({}, store.getState(), { error: error, searchingForFacetValues: false })); }).catch(function (error) { // Since setState is synchronous, any error that occurs in the render of a // component will be swallowed by this promise. // This is a trick to make the error show up correctly in the console. // See http://stackoverflow.com/a/30741722/969302 setTimeout(function () { throw error; }); }); } function updateIndex(newIndex) { initialSearchParameters = initialSearchParameters.setIndex(newIndex); search(); } function getWidgetsIds() { return store.getState().metadata.reduce(function (res, meta) { return typeof meta.id !== 'undefined' ? res.concat(meta.id) : res; }, []); } return { store: store, widgetsManager: widgetsManager, getWidgetsIds: getWidgetsIds, onExternalStateUpdate: onExternalStateUpdate, transitionState: transitionState, onSearchForFacetValues: onSearchForFacetValues, updateClient: updateClient, updateIndex: updateIndex, clearCache: clearCache, skipSearch: skipSearch }; } 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 _extends$2 = 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; }; }(); 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 === "undefined" ? "undefined" : _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 === "undefined" ? "undefined" : _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 validateNextProps(props, nextProps) { if (!props.searchState && nextProps.searchState) { throw new Error("You can't switch <InstantSearch> from being uncontrolled to controlled"); } else if (props.searchState && !nextProps.searchState) { throw new Error("You can't switch <InstantSearch> from being controlled to uncontrolled"); } } /* eslint valid-jsdoc: 0 */ /** * @description * `<InstantSearch>` is the root component of all React InstantSearch implementations. * It provides all the connected components (aka widgets) a means to interact * with the searchState. * @kind widget * @name <InstantSearch> * @requirements You will need to have an Algolia account to be able to use this widget. * [Create one now](https://www.algolia.com/users/sign_up). * @propType {string} appId - Your Algolia application id. * @propType {string} apiKey - Your Algolia search-only API key. * @propType {string} indexName - Main index in which to search. * @propType {boolean} [refresh=false] - Flag to activate when the cache needs to be cleared so that the front-end is updated when a change occurs in the index. * @propType {object} [algoliaClient] - Provide a custom Algolia client instead of the internal one (deprecated in favor of `searchClient`). * @propType {object} [searchClient] - Provide a custom search client. * @propType {func} [onSearchStateChange] - Function to be called everytime a new search is done. Useful for [URL Routing](guide/Routing.html). * @propType {object} [searchState] - Object to inject some search state. Switches the InstantSearch component in controlled mode. Useful for [URL Routing](guide/Routing.html). * @propType {func} [createURL] - Function to call when creating links, useful for [URL Routing](guide/Routing.html). * @propType {SearchResults|SearchResults[]} [resultsState] - Use this to inject the results that will be used at first rendering. Those results are found by using the `findResultsState` function. Useful for [Server Side Rendering](guide/Server-side_rendering.html). * @propType {number} [stalledSearchDelay=200] - The amount of time before considering that the search takes too much time. The time is expressed in milliseconds. * @propType {{ Root: string|function, props: object }} [root] - Use this to customize the root element. Default value: `{ Root: 'div' }` * @example * import React from 'react'; * import { InstantSearch, SearchBox, Hits } from 'react-instantsearch-dom'; * * const App = () => ( * <InstantSearch * appId="latency" * apiKey="6be0576ff61c053d5f9a3225e2a90f76" * indexName="ikea" * > * <SearchBox /> * <Hits /> * </InstantSearch> * ); */ var InstantSearch = function (_Component) { _inherits(InstantSearch, _Component); function InstantSearch(props) { _classCallCheck(this, InstantSearch); var _this = _possibleConstructorReturn(this, (InstantSearch.__proto__ || Object.getPrototypeOf(InstantSearch)).call(this, props)); _this.isControlled = Boolean(props.searchState); var initialState = _this.isControlled ? props.searchState : {}; _this.isUnmounting = false; _this.aisManager = createInstantSearchManager({ indexName: props.indexName, searchClient: props.searchClient, initialState: initialState, resultsState: props.resultsState, stalledSearchDelay: props.stalledSearchDelay }); return _this; } _createClass(InstantSearch, [{ key: 'componentWillReceiveProps', value: function componentWillReceiveProps(nextProps) { validateNextProps(this.props, nextProps); if (this.props.indexName !== nextProps.indexName) { this.aisManager.updateIndex(nextProps.indexName); } if (this.props.refresh !== nextProps.refresh) { if (nextProps.refresh) { this.aisManager.clearCache(); } } if (this.props.searchClient !== nextProps.searchClient) { this.aisManager.updateClient(nextProps.searchClient); } if (this.isControlled) { this.aisManager.onExternalStateUpdate(nextProps.searchState); } } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { this.isUnmounting = true; this.aisManager.skipSearch(); } }, { key: 'getChildContext', value: function getChildContext() { // If not already cached, cache the bound methods so that we can forward them as part // of the context. if (!this._aisContextCache) { this._aisContextCache = { ais: { onInternalStateUpdate: this.onWidgetsInternalStateUpdate.bind(this), createHrefForState: this.createHrefForState.bind(this), onSearchForFacetValues: this.onSearchForFacetValues.bind(this), onSearchStateChange: this.onSearchStateChange.bind(this), onSearchParameters: this.onSearchParameters.bind(this) } }; } return { ais: _extends$2({}, this._aisContextCache.ais, { store: this.aisManager.store, widgetsManager: this.aisManager.widgetsManager, mainTargetedIndex: this.props.indexName }) }; } }, { key: 'createHrefForState', value: function createHrefForState(searchState) { searchState = this.aisManager.transitionState(searchState); return this.isControlled && this.props.createURL ? this.props.createURL(searchState, this.getKnownKeys()) : '#'; } }, { key: 'onWidgetsInternalStateUpdate', value: function onWidgetsInternalStateUpdate(searchState) { searchState = this.aisManager.transitionState(searchState); this.onSearchStateChange(searchState); if (!this.isControlled) { this.aisManager.onExternalStateUpdate(searchState); } } }, { key: 'onSearchStateChange', value: function onSearchStateChange(searchState) { if (this.props.onSearchStateChange && !this.isUnmounting) { this.props.onSearchStateChange(searchState); } } }, { key: 'onSearchParameters', value: function onSearchParameters(getSearchParameters, context, props) { if (this.props.onSearchParameters) { var searchState = this.props.searchState ? this.props.searchState : {}; this.props.onSearchParameters(getSearchParameters, context, props, searchState); } } }, { key: 'onSearchForFacetValues', value: function onSearchForFacetValues(searchState) { this.aisManager.onSearchForFacetValues(searchState); } }, { key: 'getKnownKeys', value: function getKnownKeys() { return this.aisManager.getWidgetsIds(); } }, { key: 'render', value: function render() { var childrenCount = React.Children.count(this.props.children); var _props$root = this.props.root, Root = _props$root.Root, props = _props$root.props; if (childrenCount === 0) return null;else return React__default.createElement(Root, props, this.props.children); } }]); return InstantSearch; }(React.Component); InstantSearch.defaultProps = { stalledSearchDelay: 200 }; InstantSearch.propTypes = { // @TODO: These props are currently constant. indexName: propTypes.string.isRequired, searchClient: propTypes.object.isRequired, createURL: propTypes.func, refresh: propTypes.bool.isRequired, searchState: propTypes.object, onSearchStateChange: propTypes.func, onSearchParameters: propTypes.func, resultsState: propTypes.oneOfType([propTypes.object, propTypes.array]), children: propTypes.node, root: propTypes.shape({ Root: propTypes.oneOfType([propTypes.string, propTypes.func]), props: propTypes.object }).isRequired, stalledSearchDelay: propTypes.number }; InstantSearch.childContextTypes = { // @TODO: more precise widgets manager propType ais: propTypes.object.isRequired }; var _createClass$2 = 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; }; }(); function _classCallCheck$2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn$2(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === "undefined" ? "undefined" : _typeof(call)) === "object" || typeof call === "function") ? call : self; } function _inherits$2(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : _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; } /* eslint valid-jsdoc: 0 */ /** * @description * `<Index>` is the component that allows you to apply widgets to a dedicated index. It's * useful if you want to build an interface that targets multiple indices. * @kind widget * @name <Index> * @propType {string} indexName - index in which to search. * @propType {{ Root: string|function, props: object }} [root] - Use this to customize the root element. Default value: `{ Root: 'div' }` * @example * import React from 'react'; * import { InstantSearch, Index, SearchBox, Hits, Configure } from 'react-instantsearch-dom'; * * const App = () => ( * <InstantSearch * appId="latency" * apiKey="6be0576ff61c053d5f9a3225e2a90f76" * indexName="ikea" * > * <Configure hitsPerPage={5} /> * <SearchBox /> * <Index indexName="ikea"> * <Hits /> * </Index> * <Index indexName="bestbuy"> * <Hits /> * </Index> * </InstantSearch> * ); */ var Index = function (_Component) { _inherits$2(Index, _Component); function Index(props, context) { _classCallCheck$2(this, Index); var _this = _possibleConstructorReturn$2(this, (Index.__proto__ || Object.getPrototypeOf(Index)).call(this, props)); var widgetsManager = context.ais.widgetsManager; /* we want <Index> to be seen as a regular widget. It means that with only <Index> present a new query will be sent to Algolia. That way you don't need a virtual hits widget to use the connectAutoComplete. */ _this.unregisterWidget = widgetsManager.registerWidget(_this); return _this; } _createClass$2(Index, [{ key: 'componentWillMount', value: function componentWillMount() { this.context.ais.onSearchParameters(this.getSearchParameters, this.getChildContext(), this.props); } }, { key: 'componentWillReceiveProps', value: function componentWillReceiveProps(nextProps) { if (this.props.indexName !== nextProps.indexName) { this.context.ais.widgetsManager.update(); } } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { this.unregisterWidget(); } }, { key: 'getChildContext', value: function getChildContext() { return { multiIndexContext: { targetedIndex: this.props.indexName } }; } }, { key: 'getSearchParameters', value: function getSearchParameters(searchParameters, props) { return searchParameters.setIndex(this.props ? this.props.indexName : props.indexName); } }, { key: 'render', value: function render() { var childrenCount = React.Children.count(this.props.children); var _props$root = this.props.root, Root = _props$root.Root, props = _props$root.props; if (childrenCount === 0) return null;else return React__default.createElement(Root, props, this.props.children); } }]); return Index; }(React.Component); Index.propTypes = { // @TODO: These props are currently constant. indexName: propTypes.string.isRequired, children: propTypes.node, root: propTypes.shape({ Root: propTypes.oneOfType([propTypes.string, propTypes.func]), props: propTypes.object }).isRequired }; Index.childContextTypes = { multiIndexContext: propTypes.object.isRequired }; Index.contextTypes = { // @TODO: more precise widgets manager propType ais: propTypes.object.isRequired }; /** Used for built-in method references. */ var objectProto$l = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$i = objectProto$l.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$i.call(object, key); } var _baseHas = baseHas; /** * 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$1(object, path) { return object != null && _hasPath(object, path, _baseHas); } var has_1 = has$1; var _extends$3 = 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$3 = 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; }; }(); function _classCallCheck$3(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn$3(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self; } function _inherits$3(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _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; } /** * @typedef {object} ConnectorDescription * @property {string} displayName - the displayName used by the wrapper * @property {function} refine - a function to filter the local state * @property {function} getSearchParameters - function transforming the local state to a SearchParameters * @property {function} getMetadata - metadata of the widget * @property {function} transitionState - hook after the state has changed * @property {function} getProvidedProps - transform the state into props passed to the wrapped component. * Receives (props, widgetStates, searchState, metadata) and returns the local state. * @property {function} getId - Receives props and return the id that will be used to identify the widget * @property {function} cleanUp - hook when the widget will unmount. Receives (props, searchState) and return a cleaned state. * @property {object} propTypes - PropTypes forwarded to the wrapped component. * @property {object} defaultProps - default values for the props */ /** * Connectors are the HOC used to transform React components * into InstantSearch widgets. * In order to simplify the construction of such connectors * `createConnector` takes a description and transform it into * a connector. * @param {ConnectorDescription} connectorDesc the description of the connector * @return {Connector} a function that wraps a component into * an instantsearch connected one. */ function createConnector(connectorDesc) { if (!connectorDesc.displayName) { throw new Error('`createConnector` requires you to provide a `displayName` property.'); } var hasRefine = has_1(connectorDesc, 'refine'); var hasSearchForFacetValues = has_1(connectorDesc, 'searchForFacetValues'); var hasSearchParameters = has_1(connectorDesc, 'getSearchParameters'); var hasMetadata = has_1(connectorDesc, 'getMetadata'); var hasTransitionState = has_1(connectorDesc, 'transitionState'); var hasCleanUp = has_1(connectorDesc, 'cleanUp'); var isWidget = hasSearchParameters || hasMetadata || hasTransitionState; return function (Composed) { var _class, _temp, _initialiseProps; return _temp = _class = function (_Component) { _inherits$3(Connector, _Component); function Connector(props, context) { _classCallCheck$3(this, Connector); var _this = _possibleConstructorReturn$3(this, (Connector.__proto__ || Object.getPrototypeOf(Connector)).call(this, props, context)); _initialiseProps.call(_this); var _context$ais = context.ais, store = _context$ais.store, widgetsManager = _context$ais.widgetsManager; var canRender = false; _this.state = { props: _this.getProvidedProps(_extends$3({}, props, { canRender: canRender })), canRender: canRender // use to know if a component is rendered (browser), or not (server). }; _this.unsubscribe = store.subscribe(function () { if (_this.state.canRender) { _this.setState({ props: _this.getProvidedProps(_extends$3({}, _this.props, { canRender: _this.state.canRender })) }); } }); if (isWidget) { _this.unregisterWidget = widgetsManager.registerWidget(_this); } return _this; } _createClass$3(Connector, [{ key: 'getMetadata', value: function getMetadata(nextWidgetsState) { if (hasMetadata) { return connectorDesc.getMetadata.call(this, this.props, nextWidgetsState); } return {}; } }, { key: 'getSearchParameters', value: function getSearchParameters(searchParameters) { if (hasSearchParameters) { return connectorDesc.getSearchParameters.call(this, searchParameters, this.props, this.context.ais.store.getState().widgets); } return null; } }, { key: 'transitionState', value: function transitionState(prevWidgetsState, nextWidgetsState) { if (hasTransitionState) { return connectorDesc.transitionState.call(this, this.props, prevWidgetsState, nextWidgetsState); } return nextWidgetsState; } }, { key: 'componentDidMount', value: function componentDidMount() { this.setState({ canRender: true }); } }, { key: 'componentWillMount', value: function componentWillMount() { if (connectorDesc.getSearchParameters) { this.context.ais.onSearchParameters(connectorDesc.getSearchParameters, this.context, this.props); } } }, { key: 'componentWillReceiveProps', value: function componentWillReceiveProps(nextProps) { if (!isEqual_1(this.props, nextProps)) { this.setState({ props: this.getProvidedProps(nextProps) }); if (isWidget) { // Since props might have changed, we need to re-run getSearchParameters // and getMetadata with the new props. this.context.ais.widgetsManager.update(); if (connectorDesc.transitionState) { this.context.ais.onSearchStateChange(connectorDesc.transitionState.call(this, nextProps, this.context.ais.store.getState().widgets, this.context.ais.store.getState().widgets)); } } } } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { this.unsubscribe(); if (isWidget) { this.unregisterWidget(); // will schedule an update if (hasCleanUp) { var newState = connectorDesc.cleanUp.call(this, this.props, this.context.ais.store.getState().widgets); this.context.ais.store.setState(_extends$3({}, this.context.ais.store.getState(), { widgets: newState })); this.context.ais.onSearchStateChange(removeEmptyKey(newState)); } } } }, { key: 'shouldComponentUpdate', value: function shouldComponentUpdate(nextProps, nextState) { var propsEqual = shallowEqual(this.props, nextProps); if (this.state.props === null || nextState.props === null) { if (this.state.props === nextState.props) { return !propsEqual; } return true; } return !propsEqual || !shallowEqual(this.state.props, nextState.props); } }, { key: 'render', value: function render() { if (this.state.props === null) { return null; } var refineProps = hasRefine ? { refine: this.refine, createURL: this.createURL } : {}; var searchForFacetValuesProps = hasSearchForFacetValues ? { searchForItems: this.searchForFacetValues } : {}; return React__default.createElement(Composed, _extends$3({}, this.props, this.state.props, refineProps, searchForFacetValuesProps)); } }]); return Connector; }(React.Component), _class.displayName = connectorDesc.displayName + '(' + getDisplayName(Composed) + ')', _class.defaultClassNames = Composed.defaultClassNames, _class.propTypes = connectorDesc.propTypes, _class.defaultProps = connectorDesc.defaultProps, _class.contextTypes = { // @TODO: more precise state manager propType ais: propTypes.object.isRequired, multiIndexContext: propTypes.object }, _initialiseProps = function _initialiseProps() { var _this2 = this; this.getProvidedProps = function (props) { var store = _this2.context.ais.store; var _store$getState = store.getState(), results = _store$getState.results, searching = _store$getState.searching, error = _store$getState.error, widgets = _store$getState.widgets, metadata = _store$getState.metadata, resultsFacetValues = _store$getState.resultsFacetValues, searchingForFacetValues = _store$getState.searchingForFacetValues, isSearchStalled = _store$getState.isSearchStalled; var searchResults = { results: results, searching: searching, error: error, searchingForFacetValues: searchingForFacetValues, isSearchStalled: isSearchStalled }; return connectorDesc.getProvidedProps.call(_this2, props, widgets, searchResults, metadata, resultsFacetValues); }; this.refine = function () { var _connectorDesc$refine; for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this2.context.ais.onInternalStateUpdate((_connectorDesc$refine = connectorDesc.refine).call.apply(_connectorDesc$refine, [_this2, _this2.props, _this2.context.ais.store.getState().widgets].concat(args))); }; this.searchForFacetValues = function () { for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } _this2.context.ais.onSearchForFacetValues(connectorDesc.searchForFacetValues.apply(connectorDesc, [_this2.props, _this2.context.ais.store.getState().widgets].concat(args))); }; this.createURL = function () { var _connectorDesc$refine2; for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { args[_key3] = arguments[_key3]; } return _this2.context.ais.createHrefForState((_connectorDesc$refine2 = connectorDesc.refine).call.apply(_connectorDesc$refine2, [_this2, _this2.props, _this2.context.ais.store.getState().widgets].concat(args))); }; this.cleanUp = function () { var _connectorDesc$cleanU; for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { args[_key4] = arguments[_key4]; } return (_connectorDesc$cleanU = connectorDesc.cleanUp).call.apply(_connectorDesc$cleanU, [_this2].concat(args)); }; }, _temp; }; } /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE$1 = 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$1) { 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; } var _baseDifference = baseDifference; /** * Creates an array of `array` values not included in the other given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order and references of result values are * determined by the first array. * * **Note:** Unlike `_.pullAll`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @returns {Array} Returns the new array of filtered values. * @see _.without, _.xor * @example * * _.difference([2, 1], [2, 3]); * // => [1] */ var difference = _baseRest(function(array, values) { return isArrayLikeObject_1(array) ? _baseDifference(array, _baseFlatten(values, 1, isArrayLikeObject_1, true)) : []; }); var difference_1 = difference; var _extends$4 = 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; }; function _defineProperty$2(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; } function getIndex(context) { return context && context.multiIndexContext ? context.multiIndexContext.targetedIndex : context.ais.mainTargetedIndex; } function getResults(searchResults, context) { if (searchResults.results && !searchResults.results.hits) { return searchResults.results[getIndex(context)] ? searchResults.results[getIndex(context)] : null; } else { return searchResults.results ? searchResults.results : null; } } function hasMultipleIndex(context) { return context && context.multiIndexContext; } // eslint-disable-next-line max-params function refineValue(searchState, nextRefinement, context, resetPage, namespace) { if (hasMultipleIndex(context)) { return namespace ? refineMultiIndexWithNamespace(searchState, nextRefinement, context, resetPage, namespace) : refineMultiIndex(searchState, nextRefinement, context, resetPage); } else { // When we have a multi index page with shared widgets we should also // reset their page to 1 if the resetPage is provided. Otherwise the // indices will always be reset // see: https://github.com/algolia/react-instantsearch/issues/310 // see: https://github.com/algolia/react-instantsearch/issues/637 if (searchState.indices && resetPage) { Object.keys(searchState.indices).forEach(function (targetedIndex) { searchState = refineValue(searchState, { page: 1 }, { multiIndexContext: { targetedIndex: targetedIndex } }, true, namespace); }); } return namespace ? refineSingleIndexWithNamespace(searchState, nextRefinement, resetPage, namespace) : refineSingleIndex(searchState, nextRefinement, resetPage); } } function refineMultiIndex(searchState, nextRefinement, context, resetPage) { var page = resetPage ? { page: 1 } : undefined; var index = getIndex(context); var state = has_1(searchState, 'indices.' + index) ? _extends$4({}, searchState.indices, _defineProperty$2({}, index, _extends$4({}, searchState.indices[index], nextRefinement, page))) : _extends$4({}, searchState.indices, _defineProperty$2({}, index, _extends$4({}, nextRefinement, page))); return _extends$4({}, searchState, { indices: state }); } function refineSingleIndex(searchState, nextRefinement, resetPage) { var page = resetPage ? { page: 1 } : undefined; return _extends$4({}, searchState, nextRefinement, page); } // eslint-disable-next-line max-params function refineMultiIndexWithNamespace(searchState, nextRefinement, context, resetPage, namespace) { var _extends4; var index = getIndex(context); var page = resetPage ? { page: 1 } : undefined; var state = has_1(searchState, 'indices.' + index) ? _extends$4({}, searchState.indices, _defineProperty$2({}, index, _extends$4({}, searchState.indices[index], (_extends4 = {}, _defineProperty$2(_extends4, namespace, _extends$4({}, searchState.indices[index][namespace], nextRefinement)), _defineProperty$2(_extends4, 'page', 1), _extends4)))) : _extends$4({}, searchState.indices, _defineProperty$2({}, index, _extends$4(_defineProperty$2({}, namespace, nextRefinement), page))); return _extends$4({}, searchState, { indices: state }); } function refineSingleIndexWithNamespace(searchState, nextRefinement, resetPage, namespace) { var page = resetPage ? { page: 1 } : undefined; return _extends$4({}, searchState, _defineProperty$2({}, namespace, _extends$4({}, searchState[namespace], nextRefinement)), page); } function getNamespaceAndAttributeName(id) { var parts = id.match(/^([^.]*)\.(.*)/); var namespace = parts && parts[1]; var attributeName = parts && parts[2]; return { namespace: namespace, attributeName: attributeName }; } // eslint-disable-next-line max-params function getCurrentRefinementValue(props, searchState, context, id, defaultValue, refinementsCallback) { var index = getIndex(context); var _getNamespaceAndAttri = getNamespaceAndAttributeName(id), namespace = _getNamespaceAndAttri.namespace, attributeName = _getNamespaceAndAttri.attributeName; var refinements = hasMultipleIndex(context) && searchState.indices && namespace && searchState.indices['' + index] && has_1(searchState.indices['' + index][namespace], '' + attributeName) || hasMultipleIndex(context) && searchState.indices && has_1(searchState, 'indices.' + index + '.' + id) || !hasMultipleIndex(context) && namespace && has_1(searchState[namespace], attributeName) || !hasMultipleIndex(context) && has_1(searchState, id); if (refinements) { var currentRefinement = void 0; if (hasMultipleIndex(context)) { currentRefinement = namespace ? get_1(searchState.indices['' + index][namespace], attributeName) : get_1(searchState.indices[index], id); } else { currentRefinement = namespace ? get_1(searchState[namespace], attributeName) : get_1(searchState, id); } return refinementsCallback(currentRefinement); } if (props.defaultRefinement) { return props.defaultRefinement; } return defaultValue; } function cleanUpValue(searchState, context, id) { var indexName = getIndex(context); var _getNamespaceAndAttri2 = getNamespaceAndAttributeName(id), namespace = _getNamespaceAndAttri2.namespace, attributeName = _getNamespaceAndAttri2.attributeName; if (hasMultipleIndex(context) && Boolean(searchState.indices)) { return cleanUpValueWithMutliIndex({ attribute: attributeName, searchState: searchState, indexName: indexName, id: id, namespace: namespace }); } return cleanUpValueWithSingleIndex({ attribute: attributeName, searchState: searchState, id: id, namespace: namespace }); } function cleanUpValueWithSingleIndex(_ref) { var searchState = _ref.searchState, id = _ref.id, namespace = _ref.namespace, attribute = _ref.attribute; if (namespace) { return _extends$4({}, searchState, _defineProperty$2({}, namespace, omit_1(searchState[namespace], attribute))); } return omit_1(searchState, id); } function cleanUpValueWithMutliIndex(_ref2) { var searchState = _ref2.searchState, indexName = _ref2.indexName, id = _ref2.id, namespace = _ref2.namespace, attribute = _ref2.attribute; var index = searchState.indices[indexName]; if (namespace && index) { return _extends$4({}, searchState, { indices: _extends$4({}, searchState.indices, _defineProperty$2({}, indexName, _extends$4({}, index, _defineProperty$2({}, namespace, omit_1(index[namespace], attribute))))) }); } return omit_1(searchState, 'indices.' + indexName + '.' + id); } var _extends$5 = 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; }; function _defineProperty$3(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; } function getId() { return 'configure'; } var connectConfigure = createConnector({ displayName: 'AlgoliaConfigure', getProvidedProps: function getProvidedProps() { return {}; }, getSearchParameters: function getSearchParameters(searchParameters, props) { var items = omit_1(props, 'children'); return searchParameters.setQueryParameters(items); }, transitionState: function transitionState(props, prevSearchState, nextSearchState) { var id = getId(); var items = omit_1(props, 'children'); var nonPresentKeys = this._props ? difference_1(keys_1(this._props), keys_1(props)) : []; this._props = props; var nextValue = _defineProperty$3({}, id, _extends$5({}, omit_1(nextSearchState[id], nonPresentKeys), items)); return refineValue(nextSearchState, nextValue, this.context); }, cleanUp: function cleanUp(props, searchState) { var id = getId(); var index = getIndex(this.context); var subState = hasMultipleIndex(this.context) && searchState.indices ? searchState.indices[index] : searchState; var configureKeys = subState && subState[id] ? Object.keys(subState[id]) : []; var configureState = configureKeys.reduce(function (acc, item) { if (!props[item]) { acc[item] = subState[id][item]; } return acc; }, {}); var nextValue = _defineProperty$3({}, id, configureState); return refineValue(searchState, nextValue, this.context); } }); /** * Configure is a widget that lets you provide raw search parameters * to the Algolia API. * * Any of the props added to this widget will be forwarded to Algolia. For more information * on the different parameters that can be set, have a look at the * [reference](https://www.algolia.com/doc/api-client/javascript/search#search-parameters). * * This widget can be used either with react-dom and react-native. It will not render anything * on screen, only configure some parameters. * * Read more in the [Search parameters](guide/Search_parameters.html) guide. * @name Configure * @kind widget * @example * import React from 'react'; * import { InstantSearch, Configure, Hits } from 'react-instantsearch-dom'; * * const App = () => ( * <InstantSearch * appId="latency" * apiKey="6be0576ff61c053d5f9a3225e2a90f76" * indexName="ikea" * > * <Configure hitsPerPage={5} /> * <Hits /> * </InstantSearch> * ); */ connectConfigure(function () { return null; }); function _defineProperty$4(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; } 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); } } var getId$1 = function getId() { return 'query'; }; function getCurrentRefinement(props, searchState, context) { var id = getId$1(); return getCurrentRefinementValue(props, searchState, context, id, '', function (currentRefinement) { if (currentRefinement) { return currentRefinement; } return ''; }); } function getHits(searchResults) { if (searchResults.results) { if (searchResults.results.hits && Array.isArray(searchResults.results.hits)) { return searchResults.results.hits; } else { return Object.keys(searchResults.results).reduce(function (hits, index) { return [].concat(_toConsumableArray(hits), [{ index: index, hits: searchResults.results[index].hits }]); }, []); } } else { return []; } } function _refine(props, searchState, nextRefinement, context) { var id = getId$1(); var nextValue = _defineProperty$4({}, id, nextRefinement); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage); } function _cleanUp(props, searchState, context) { return cleanUpValue(searchState, context, getId$1()); } /** * connectAutoComplete connector provides the logic to create connected * components that will render the results retrieved from * Algolia. * * To configure the number of hits retrieved, use [HitsPerPage widget](widgets/HitsPerPage.html), * [connectHitsPerPage connector](connectors/connectHitsPerPage.html) or pass the hitsPerPage * prop to a [Configure](guide/Search_parameters.html) widget. * @name connectAutoComplete * @kind connector * @providedPropType {array.<object>} hits - the records that matched the search state. * @providedPropType {function} refine - a function to change the query. * @providedPropType {string} currentRefinement - the query to search for. */ var connectAutoComplete = createConnector({ displayName: 'AlgoliaAutoComplete', getProvidedProps: function getProvidedProps(props, searchState, searchResults) { return { hits: getHits(searchResults), currentRefinement: getCurrentRefinement(props, searchState, this.context) }; }, refine: function refine(props, searchState, nextRefinement) { return _refine(props, searchState, nextRefinement, this.context); }, cleanUp: function cleanUp(props, searchState) { return _cleanUp(props, searchState, this.context); }, /* connectAutoComplete needs to be considered as a widget to trigger a search if no others widgets are used. * To be considered as a widget you need either getSearchParameters, getMetadata or getTransitionState * See createConnector.js * */ getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { return searchParameters.setQuery(getCurrentRefinement(props, searchState, this.context)); } }); function _defineProperty$5(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 getId$2 = function getId(props) { return props.attributes[0]; }; var namespace = 'hierarchicalMenu'; function _refine$1(props, searchState, nextRefinement, context) { var id = getId$2(props); var nextValue = _defineProperty$5({}, id, nextRefinement || ''); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage, namespace); } function transformValue(values) { return values.reduce(function (acc, item) { if (item.isRefined) { acc.push({ label: item.name, // If dealing with a nested "items", "value" is equal to the previous value concatenated with the current label // If dealing with the first level, "value" is equal to the current label value: item.path }); // Create a variable in order to keep the same acc for the recursion, otherwise "reduce" returns a new one if (item.data) { acc = acc.concat(transformValue(item.data, acc)); } } return acc; }, []); } /** * The breadcrumb component is s a type of secondary navigation scheme that * reveals the user’s location in a website or web application. * * @name connectBreadcrumb * @requirements To use this widget, your attributes must be formatted in a specific way. * If you want for example to have a Breadcrumb of categories, objects in your index * should be formatted this way: * * ```json * { * "categories.lvl0": "products", * "categories.lvl1": "products > fruits", * "categories.lvl2": "products > fruits > citrus" * } * ``` * * It's also possible to provide more than one path for each level: * * ```json * { * "categories.lvl0": ["products", "goods"], * "categories.lvl1": ["products > fruits", "goods > to eat"] * } * ``` * * All attributes passed to the `attributes` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * * @kind connector * @propType {array.<string>} attributes - List of attributes to use to generate the hierarchy of the menu. See the example for the convention to follow. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @providedPropType {function} refine - a function to toggle a refinement * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {array.<{items: object, count: number, isRefined: boolean, label: string, value: string}>} items - the list of items the Breadcrumb can display. */ var connectBreadcrumb = createConnector({ displayName: 'AlgoliaBreadcrumb', propTypes: { attributes: function attributes(props, propName, componentName) { var isNotString = function isNotString(val) { return typeof val !== 'string'; }; if (!Array.isArray(props[propName]) || props[propName].some(isNotString) || props[propName].length < 1) { return new Error('Invalid prop ' + propName + ' supplied to ' + componentName + '. Expected an Array of Strings'); } return undefined; }, transformItems: propTypes.func }, getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var id = getId$2(props); var results = getResults(searchResults, this.context); var isFacetPresent = Boolean(results) && Boolean(results.getFacetByName(id)); if (!isFacetPresent) { return { items: [], canRefine: false }; } var values = results.getFacetValues(id); var items = values.data ? transformValue(values.data) : []; var transformedItems = props.transformItems ? props.transformItems(items) : items; return { canRefine: transformedItems.length > 0, items: transformedItems }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$1(props, searchState, nextRefinement, this.context); } }); var _extends$6 = 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; }; /** * connectCurrentRefinements connector provides the logic to build a widget that will * give the user the ability to remove all or some of the filters that were * set. * @name connectCurrentRefinements * @kind connector * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @propType {function} [clearsQuery=false] - Pass true to also clear the search query * @providedPropType {function} refine - a function to remove a single filter * @providedPropType {array.<{label: string, attribute: string, currentRefinement: string || object, items: array, value: function}>} items - all the filters, the `value` is to pass to the `refine` function for removing all currentrefinements, `label` is for the display. When existing several refinements for the same atribute name, then you get a nested `items` object that contains a `label` and a `value` function to use to remove a single filter. `attribute` and `currentRefinement` are metadata containing row values. * @providedPropType {string} query - the search query */ var connectCurrentRefinements = createConnector({ displayName: 'AlgoliaCurrentRefinements', propTypes: { transformItems: propTypes.func }, getProvidedProps: function getProvidedProps(props, searchState, searchResults, metadata) { var items = metadata.reduce(function (res, meta) { if (typeof meta.items !== 'undefined') { if (!props.clearsQuery && meta.id === 'query') { return res; } else { if (props.clearsQuery && meta.id === 'query' && meta.items[0].currentRefinement === '') { return res; } return res.concat(meta.items.map(function (item) { return _extends$6({}, item, { id: meta.id, index: meta.index }); })); } } return res; }, []); return { items: props.transformItems ? props.transformItems(items) : items, canRefine: items.length > 0 }; }, refine: function refine(props, searchState, items) { // `value` corresponds to our internal clear function computed in each connector metadata. var refinementsToClear = items instanceof Array ? items.map(function (item) { return item.value; }) : [items]; return refinementsToClear.reduce(function (res, clear) { return clear(res); }, searchState); } }); var _extends$7 = 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; }; function _defineProperty$6(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 getId$3 = function getId(props) { return props.attributes[0]; }; var namespace$1 = 'hierarchicalMenu'; function getCurrentRefinement$1(props, searchState, context) { return getCurrentRefinementValue(props, searchState, context, namespace$1 + '.' + getId$3(props), null, function (currentRefinement) { if (currentRefinement === '') { return null; } return currentRefinement; }); } function getValue$1(path, props, searchState, context) { var id = props.id, attributes = props.attributes, separator = props.separator, rootPath = props.rootPath, showParentLevel = props.showParentLevel; var currentRefinement = getCurrentRefinement$1(props, searchState, context); var nextRefinement = void 0; if (currentRefinement === null) { nextRefinement = path; } else { var tmpSearchParameters = new algoliasearchHelper_4({ hierarchicalFacets: [{ name: id, attributes: attributes, separator: separator, rootPath: rootPath, showParentLevel: showParentLevel }] }); nextRefinement = tmpSearchParameters.toggleHierarchicalFacetRefinement(id, currentRefinement).toggleHierarchicalFacetRefinement(id, path).getHierarchicalRefinement(id)[0]; } return nextRefinement; } function transformValue$1(value, props, searchState, context) { return value.map(function (v) { return { label: v.name, value: getValue$1(v.path, props, searchState, context), count: v.count, isRefined: v.isRefined, items: v.data && transformValue$1(v.data, props, searchState, context) }; }); } var truncate = function truncate() { var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10; return items.slice(0, limit).map(function () { var item = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return Array.isArray(item.items) ? _extends$7({}, item, { items: truncate(item.items, limit) }) : item; }); }; function _refine$2(props, searchState, nextRefinement, context) { var id = getId$3(props); var nextValue = _defineProperty$6({}, id, nextRefinement || ''); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage, namespace$1); } function _cleanUp$1(props, searchState, context) { return cleanUpValue(searchState, context, namespace$1 + '.' + getId$3(props)); } var sortBy = ['name:asc']; /** * connectHierarchicalMenu connector provides the logic to build a widget that will * give the user the ability to explore a tree-like structure. * This is commonly used for multi-level categorization of products on e-commerce * websites. From a UX point of view, we suggest not displaying more than two levels deep. * @name connectHierarchicalMenu * @requirements To use this widget, your attributes must be formatted in a specific way. * If you want for example to have a hiearchical menu of categories, objects in your index * should be formatted this way: * * ```json * { * "categories.lvl0": "products", * "categories.lvl1": "products > fruits", * "categories.lvl2": "products > fruits > citrus" * } * ``` * * It's also possible to provide more than one path for each level: * * ```json * { * "categories.lvl0": ["products", "goods"], * "categories.lvl1": ["products > fruits", "goods > to eat"] * } * ``` * * All attributes passed to the `attributes` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * * @kind connector * @propType {array.<string>} attributes - List of attributes to use to generate the hierarchy of the menu. See the example for the convention to follow. * @propType {string} [defaultRefinement] - the item value selected by default * @propType {boolean} [showMore=false] - Flag to activate the show more button, for toggling the number of items between limit and showMoreLimit. * @propType {number} [limit=10] - The maximum number of items displayed. * @propType {number} [showMoreLimit=20] - The maximum number of items displayed when the user triggers the show more. Not considered if `showMore` is false. * @propType {string} [separator='>'] - Specifies the level separator used in the data. * @propType {string[]} [rootPath=null] - The already selected and hidden path. * @propType {boolean} [showParentLevel=true] - Flag to set if the parent level should be displayed. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @providedPropType {function} refine - a function to toggle a refinement * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string} currentRefinement - the refinement currently applied * @providedPropType {array.<{items: object, count: number, isRefined: boolean, label: string, value: string}>} items - the list of items the HierarchicalMenu can display. items has the same shape as parent items. */ var connectHierarchicalMenu = createConnector({ displayName: 'AlgoliaHierarchicalMenu', propTypes: { attributes: function attributes(props, propName, componentName) { var isNotString = function isNotString(val) { return typeof val !== 'string'; }; if (!Array.isArray(props[propName]) || props[propName].some(isNotString) || props[propName].length < 1) { return new Error('Invalid prop ' + propName + ' supplied to ' + componentName + '. Expected an Array of Strings'); } return undefined; }, separator: propTypes.string, rootPath: propTypes.string, showParentLevel: propTypes.bool, defaultRefinement: propTypes.string, showMore: propTypes.bool, limit: propTypes.number, showMoreLimit: propTypes.number, transformItems: propTypes.func }, defaultProps: { showMore: false, limit: 10, showMoreLimit: 20, separator: ' > ', rootPath: null, showParentLevel: true }, getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var showMore = props.showMore, limit = props.limit, showMoreLimit = props.showMoreLimit; var id = getId$3(props); var results = getResults(searchResults, this.context); var isFacetPresent = Boolean(results) && Boolean(results.getFacetByName(id)); if (!isFacetPresent) { return { items: [], currentRefinement: getCurrentRefinement$1(props, searchState, this.context), canRefine: false }; } var itemsLimit = showMore ? showMoreLimit : limit; var value = results.getFacetValues(id, { sortBy: sortBy }); var items = value.data ? transformValue$1(value.data, props, searchState, this.context) : []; var transformedItems = props.transformItems ? props.transformItems(items) : items; return { items: truncate(transformedItems, itemsLimit), currentRefinement: getCurrentRefinement$1(props, searchState, this.context), canRefine: items.length > 0 }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$2(props, searchState, nextRefinement, this.context); }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$1(props, searchState, this.context); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var attributes = props.attributes, separator = props.separator, rootPath = props.rootPath, showParentLevel = props.showParentLevel, showMore = props.showMore, limit = props.limit, showMoreLimit = props.showMoreLimit; var id = getId$3(props); var itemsLimit = showMore ? showMoreLimit : limit; searchParameters = searchParameters.addHierarchicalFacet({ name: id, attributes: attributes, separator: separator, rootPath: rootPath, showParentLevel: showParentLevel }).setQueryParameters({ maxValuesPerFacet: Math.max(searchParameters.maxValuesPerFacet || 0, itemsLimit) }); var currentRefinement = getCurrentRefinement$1(props, searchState, this.context); if (currentRefinement !== null) { searchParameters = searchParameters.toggleHierarchicalFacetRefinement(id, currentRefinement); } return searchParameters; }, getMetadata: function getMetadata(props, searchState) { var _this = this; var rootAttribute = props.attributes[0]; var id = getId$3(props); var currentRefinement = getCurrentRefinement$1(props, searchState, this.context); return { id: id, index: getIndex(this.context), items: !currentRefinement ? [] : [{ label: rootAttribute + ': ' + currentRefinement, attribute: rootAttribute, value: function value(nextState) { return _refine$2(props, nextState, '', _this.context); }, currentRefinement: currentRefinement }] }; } }); var highlight = function highlight(_ref) { var attribute = _ref.attribute, hit = _ref.hit, highlightProperty = _ref.highlightProperty, _ref$preTag = _ref.preTag, preTag = _ref$preTag === undefined ? HIGHLIGHT_TAGS.highlightPreTag : _ref$preTag, _ref$postTag = _ref.postTag, postTag = _ref$postTag === undefined ? HIGHLIGHT_TAGS.highlightPostTag : _ref$postTag; return parseAlgoliaHit({ attribute: attribute, highlightProperty: highlightProperty, hit: hit, preTag: preTag, postTag: postTag }); }; /** * connectHighlight connector provides the logic to create an highlighter * component that will retrieve, parse and render an highlighted attribute * from an Algolia hit. * @name connectHighlight * @kind connector * @category connector * @providedPropType {function} highlight - function to retrieve and parse an attribute from a hit. It takes a configuration object with 3 attributes: `highlightProperty` which is the property that contains the highlight structure from the records, `attribute` which is the name of the attribute (it can be either a string or an array of strings) to look for and `hit` which is the hit from Algolia. It returns an array of objects `{value: string, isHighlighted: boolean}`. If the element that corresponds to the attribute is an array of strings, it will return a nested array of objects. * @example * import React from 'react'; * import { InstantSearch, SearchBox, Hits, connectHighlight } from 'react-instantsearch-dom'; * * const CustomHighlight = connectHighlight( * ({ highlight, attribute, hit, highlightProperty }) => { * const highlights = highlight({ * highlightProperty: '_highlightResult', * attribute, * hit * }); * * return highlights.map(part => part.isHighlighted ? ( * <mark>{part.value}</mark> * ) : ( * <span>{part.value}</span> * )); * } * ); * * const Hit = ({ hit }) => ( * <p> * <CustomHighlight attribute="name" hit={hit} /> * </p> * ); * * const App = () => ( * <InstantSearch * appId="latency" * apiKey="6be0576ff61c053d5f9a3225e2a90f76" * indexName="ikea" * > * <SearchBox defaultRefinement="legi" /> * <Hits hitComponent={Hit} /> * </InstantSearch> * ); */ var connectHighlight = createConnector({ displayName: 'AlgoliaHighlighter', propTypes: {}, getProvidedProps: function getProvidedProps() { return { highlight: highlight }; } }); /** * connectHits connector provides the logic to create connected * components that will render the results retrieved from * Algolia. * * To configure the number of hits retrieved, use [HitsPerPage widget](widgets/HitsPerPage.html), * [connectHitsPerPage connector](connectors/connectHitsPerPage.html) or pass the hitsPerPage * prop to a [Configure](guide/Search_parameters.html) widget. * * **Warning:** you will need to use the **objectID** property available on every hit as a key * when iterating over them. This will ensure you have the best possible UI experience * especially on slow networks. * @name connectHits * @kind connector * @providedPropType {array.<object>} hits - the records that matched the search state * @example * import React from 'react'; * import { InstantSearch, Highlight, connectHits } from 'react-instantsearch-dom'; * * const CustomHits = connectHits(({ hits }) => ( * <div> * {hits.map(hit => * <p key={hit.objectID}> * <Highlight attribute="name" hit={hit} /> * </p> * )} * </div> * ); * * const App = () => ( * <InstantSearch * appId="latency" * apiKey="6be0576ff61c053d5f9a3225e2a90f76" * indexName="ikea" * > * <CustomHits /> * </InstantSearch> * ); */ var connectHits = createConnector({ displayName: 'AlgoliaHits', getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var results = getResults(searchResults, this.context); var hits = results ? results.hits : []; return { hits: hits }; }, /* Hits needs to be considered as a widget to trigger a search if no others widgets are used. * To be considered as a widget you need either getSearchParameters, getMetadata or getTransitionState * See createConnector.js * */ getSearchParameters: function getSearchParameters(searchParameters) { return searchParameters; } }); var _extends$8 = 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; }; function _defineProperty$7(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; } function getId$4() { return 'hitsPerPage'; } function getCurrentRefinement$2(props, searchState, context) { var id = getId$4(); return getCurrentRefinementValue(props, searchState, context, id, null, function (currentRefinement) { if (typeof currentRefinement === 'string') { return parseInt(currentRefinement, 10); } return currentRefinement; }); } /** * connectHitsPerPage connector provides the logic to create connected * components that will allow a user to choose to display more or less results from Algolia. * @name connectHitsPerPage * @kind connector * @propType {number} defaultRefinement - The number of items selected by default * @propType {{value: number, label: string}[]} items - List of hits per page options. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @providedPropType {function} refine - a function to remove a single filter * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string} currentRefinement - the refinement currently applied * @providedPropType {array.<{isRefined: boolean, label?: string, value: number}>} items - the list of items the HitsPerPage can display. If no label provided, the value will be displayed. */ var connectHitsPerPage = createConnector({ displayName: 'AlgoliaHitsPerPage', propTypes: { defaultRefinement: propTypes.number.isRequired, items: propTypes.arrayOf(propTypes.shape({ label: propTypes.string, value: propTypes.number.isRequired })).isRequired, transformItems: propTypes.func }, getProvidedProps: function getProvidedProps(props, searchState) { var currentRefinement = getCurrentRefinement$2(props, searchState, this.context); var items = props.items.map(function (item) { return item.value === currentRefinement ? _extends$8({}, item, { isRefined: true }) : _extends$8({}, item, { isRefined: false }); }); return { items: props.transformItems ? props.transformItems(items) : items, currentRefinement: currentRefinement }; }, refine: function refine(props, searchState, nextRefinement) { var id = getId$4(); var nextValue = _defineProperty$7({}, id, nextRefinement); var resetPage = true; return refineValue(searchState, nextValue, this.context, resetPage); }, cleanUp: function cleanUp(props, searchState) { return cleanUpValue(searchState, this.context, getId$4()); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { return searchParameters.setHitsPerPage(getCurrentRefinement$2(props, searchState, this.context)); }, getMetadata: function getMetadata() { return { id: getId$4() }; } }); function _defineProperty$8(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; } function _toConsumableArray$1(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); } } function getId$5() { return 'page'; } function getCurrentRefinement$3(props, searchState, context) { var id = getId$5(); var page = 1; return getCurrentRefinementValue(props, searchState, context, id, page, function (currentRefinement) { if (typeof currentRefinement === 'string') { currentRefinement = parseInt(currentRefinement, 10); } return currentRefinement; }); } /** * InfiniteHits connector provides the logic to create connected * components that will render an continuous list of results retrieved from * Algolia. This connector provides a function to load more results. * @name connectInfiniteHits * @kind connector * @providedPropType {array.<object>} hits - the records that matched the search state * @providedPropType {boolean} hasMore - indicates if there are more pages to load * @providedPropType {function} refine - call to load more results */ var connectInfiniteHits = createConnector({ displayName: 'AlgoliaInfiniteHits', getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var results = getResults(searchResults, this.context); this._allResults = this._allResults || []; this._previousPage = this._previousPage || 0; if (!results) { return { hits: [], hasMore: false }; } var hits = results.hits, page = results.page, nbPages = results.nbPages; if (page === 0) { this._allResults = hits; } else if (page > this._previousPage) { this._allResults = [].concat(_toConsumableArray$1(this._allResults), _toConsumableArray$1(hits)); } else if (page < this._previousPage) { this._allResults = hits; } var lastPageIndex = nbPages - 1; var hasMore = page < lastPageIndex; this._previousPage = page; return { hits: this._allResults, hasMore: hasMore }; }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { return searchParameters.setQueryParameters({ page: getCurrentRefinement$3(props, searchState, this.context) - 1 }); }, refine: function refine(props, searchState) { var id = getId$5(); var nextPage = getCurrentRefinement$3(props, searchState, this.context) + 1; var nextValue = _defineProperty$8({}, id, nextPage); var resetPage = false; return refineValue(searchState, nextValue, this.context, resetPage); } }); function _defineProperty$9(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 namespace$2 = 'menu'; function getId$6(props) { return props.attribute; } function getCurrentRefinement$4(props, searchState, context) { return getCurrentRefinementValue(props, searchState, context, namespace$2 + '.' + getId$6(props), null, function (currentRefinement) { if (currentRefinement === '') { return null; } return currentRefinement; }); } function getValue$2(name, props, searchState, context) { var currentRefinement = getCurrentRefinement$4(props, searchState, context); return name === currentRefinement ? '' : name; } function getLimit(_ref) { var showMore = _ref.showMore, limit = _ref.limit, showMoreLimit = _ref.showMoreLimit; return showMore ? showMoreLimit : limit; } function _refine$3(props, searchState, nextRefinement, context) { var id = getId$6(props); var nextValue = _defineProperty$9({}, id, nextRefinement ? nextRefinement : ''); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage, namespace$2); } function _cleanUp$2(props, searchState, context) { return cleanUpValue(searchState, context, namespace$2 + '.' + getId$6(props)); } var sortBy$1 = ['count:desc', 'name:asc']; /** * connectMenu connector provides the logic to build a widget that will * give the user the ability to choose a single value for a specific facet. * @name connectMenu * @requirements The attribute passed to the `attribute` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * @kind connector * @propType {string} attribute - the name of the attribute in the record * @propType {boolean} [showMore=false] - true if the component should display a button that will expand the number of items * @propType {number} [limit=10] - the minimum number of diplayed items * @propType {number} [showMoreLimit=20] - the maximun number of displayed items. Only used when showMore is set to `true` * @propType {string} [defaultRefinement] - the value of the item selected by default * @propType {boolean} [searchable=false] - allow search inside values * @providedPropType {function} refine - a function to toggle a refinement * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string} currentRefinement - the refinement currently applied * @providedPropType {array.<{count: number, isRefined: boolean, label: string, value: string}>} items - the list of items the Menu can display. * @providedPropType {function} searchForItems - a function to toggle a search inside items values * @providedPropType {boolean} isFromSearch - a boolean that says if the `items` props contains facet values from the global search or from the search inside items. */ var connectMenu = createConnector({ displayName: 'AlgoliaMenu', propTypes: { attribute: propTypes.string.isRequired, showMore: propTypes.bool, limit: propTypes.number, showMoreLimit: propTypes.number, defaultRefinement: propTypes.string, transformItems: propTypes.func, searchable: propTypes.bool }, defaultProps: { showMore: false, limit: 10, showMoreLimit: 20 }, getProvidedProps: function getProvidedProps(props, searchState, searchResults, meta, searchForFacetValuesResults) { var _this = this; var attribute = props.attribute, searchable = props.searchable; var results = getResults(searchResults, this.context); var canRefine = Boolean(results) && Boolean(results.getFacetByName(attribute)); var isFromSearch = Boolean(searchForFacetValuesResults && searchForFacetValuesResults[attribute] && searchForFacetValuesResults.query !== ''); // Search For Facet Values is not available with derived helper (used for multi index search) if (searchable && this.context.multiIndexContext) { throw new Error('react-instantsearch: searching in *List is not available when used inside a' + ' multi index context'); } if (!canRefine) { return { items: [], currentRefinement: getCurrentRefinement$4(props, searchState, this.context), isFromSearch: isFromSearch, searchable: searchable, canRefine: canRefine }; } var items = isFromSearch ? searchForFacetValuesResults[attribute].map(function (v) { return { label: v.value, value: getValue$2(v.value, props, searchState, _this.context), _highlightResult: { label: { value: v.highlighted } }, count: v.count, isRefined: v.isRefined }; }) : results.getFacetValues(attribute, { sortBy: sortBy$1 }).map(function (v) { return { label: v.name, value: getValue$2(v.name, props, searchState, _this.context), count: v.count, isRefined: v.isRefined }; }); var sortedItems = searchable && !isFromSearch ? orderBy_1(items, ['isRefined', 'count', 'label'], ['desc', 'desc', 'asc']) : items; var transformedItems = props.transformItems ? props.transformItems(sortedItems) : sortedItems; return { items: transformedItems.slice(0, getLimit(props)), currentRefinement: getCurrentRefinement$4(props, searchState, this.context), isFromSearch: isFromSearch, searchable: searchable, canRefine: items.length > 0 }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$3(props, searchState, nextRefinement, this.context); }, searchForFacetValues: function searchForFacetValues(props, searchState, nextRefinement) { return { facetName: props.attribute, query: nextRefinement, maxFacetHits: getLimit(props) }; }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$2(props, searchState, this.context); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var attribute = props.attribute; searchParameters = searchParameters.setQueryParameters({ maxValuesPerFacet: Math.max(searchParameters.maxValuesPerFacet || 0, getLimit(props)) }); searchParameters = searchParameters.addDisjunctiveFacet(attribute); var currentRefinement = getCurrentRefinement$4(props, searchState, this.context); if (currentRefinement !== null) { searchParameters = searchParameters.addDisjunctiveFacetRefinement(attribute, currentRefinement); } return searchParameters; }, getMetadata: function getMetadata(props, searchState) { var _this2 = this; var id = getId$6(props); var currentRefinement = getCurrentRefinement$4(props, searchState, this.context); return { id: id, index: getIndex(this.context), items: currentRefinement === null ? [] : [{ label: props.attribute + ': ' + currentRefinement, attribute: props.attribute, value: function value(nextState) { return _refine$3(props, nextState, '', _this2.context); }, currentRefinement: currentRefinement }] }; } }); 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"); } }; }(); function _defineProperty$a(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; } function stringifyItem(item) { if (typeof item.start === 'undefined' && typeof item.end === 'undefined') { return ''; } return (item.start ? item.start : '') + ':' + (item.end ? item.end : ''); } function parseItem(value) { if (value.length === 0) { return { start: null, end: null }; } var _value$split = value.split(':'), _value$split2 = _slicedToArray(_value$split, 2), startStr = _value$split2[0], endStr = _value$split2[1]; return { start: startStr.length > 0 ? parseInt(startStr, 10) : null, end: endStr.length > 0 ? parseInt(endStr, 10) : null }; } var namespace$3 = 'multiRange'; function getId$7(props) { return props.attribute; } function getCurrentRefinement$5(props, searchState, context) { return getCurrentRefinementValue(props, searchState, context, namespace$3 + '.' + getId$7(props), '', function (currentRefinement) { if (currentRefinement === '') { return ''; } return currentRefinement; }); } function isRefinementsRangeIncludesInsideItemRange(stats, start, end) { return stats.min > start && stats.min < end || stats.max > start && stats.max < end; } function isItemRangeIncludedInsideRefinementsRange(stats, start, end) { return start > stats.min && start < stats.max || end > stats.min && end < stats.max; } function itemHasRefinement(attribute, results, value) { var stats = results.getFacetByName(attribute) ? results.getFacetStats(attribute) : null; var range = value.split(':'); var start = Number(range[0]) === 0 || value === '' ? Number.NEGATIVE_INFINITY : Number(range[0]); var end = Number(range[1]) === 0 || value === '' ? Number.POSITIVE_INFINITY : Number(range[1]); return !(Boolean(stats) && (isRefinementsRangeIncludesInsideItemRange(stats, start, end) || isItemRangeIncludedInsideRefinementsRange(stats, start, end))); } function _refine$4(props, searchState, nextRefinement, context) { var nextValue = _defineProperty$a({}, getId$7(props, searchState), nextRefinement); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage, namespace$3); } function _cleanUp$3(props, searchState, context) { return cleanUpValue(searchState, context, namespace$3 + '.' + getId$7(props)); } /** * connectNumericMenu connector provides the logic to build a widget that will * give the user the ability to select a range value for a numeric attribute. * Ranges are defined statically. * @name connectNumericMenu * @requirements The attribute passed to the `attribute` prop must be holding numerical values. * @kind connector * @propType {string} attribute - the name of the attribute in the records * @propType {{label: string, start: number, end: number}[]} items - List of options. With a text label, and upper and lower bounds. * @propType {string} [defaultRefinement] - the value of the item selected by default, follow the shape of a `string` with a pattern of `'{start}:{end}'`. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @providedPropType {function} refine - a function to select a range. * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string} currentRefinement - the refinement currently applied. follow the shape of a `string` with a pattern of `'{start}:{end}'` which corresponds to the current selected item. For instance, when the selected item is `{start: 10, end: 20}`, the searchState of the widget is `'10:20'`. When `start` isn't defined, the searchState of the widget is `':{end}'`, and the same way around when `end` isn't defined. However, when neither `start` nor `end` are defined, the searchState is an empty string. * @providedPropType {array.<{isRefined: boolean, label: string, value: string, isRefined: boolean, noRefinement: boolean}>} items - the list of ranges the NumericMenu can display. */ var connectNumericMenu = createConnector({ displayName: 'AlgoliaNumericMenu', propTypes: { id: propTypes.string, attribute: propTypes.string.isRequired, items: propTypes.arrayOf(propTypes.shape({ label: propTypes.node, start: propTypes.number, end: propTypes.number })).isRequired, transformItems: propTypes.func }, getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var attribute = props.attribute; var currentRefinement = getCurrentRefinement$5(props, searchState, this.context); var results = getResults(searchResults, this.context); var items = props.items.map(function (item) { var value = stringifyItem(item); return { label: item.label, value: value, isRefined: value === currentRefinement, noRefinement: results ? itemHasRefinement(getId$7(props), results, value) : false }; }); var stats = results && results.getFacetByName(attribute) ? results.getFacetStats(attribute) : null; var refinedItem = find_1(items, function (item) { return item.isRefined === true; }); if (!items.some(function (item) { return item.value === ''; })) { items.push({ value: '', isRefined: isEmpty_1(refinedItem), noRefinement: !stats, label: 'All' }); } return { items: props.transformItems ? props.transformItems(items) : items, currentRefinement: currentRefinement, canRefine: items.length > 0 && items.some(function (item) { return item.noRefinement === false; }) }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$4(props, searchState, nextRefinement, this.context); }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$3(props, searchState, this.context); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var attribute = props.attribute; var _parseItem = parseItem(getCurrentRefinement$5(props, searchState, this.context)), start = _parseItem.start, end = _parseItem.end; searchParameters = searchParameters.addDisjunctiveFacet(attribute); if (start) { searchParameters = searchParameters.addNumericRefinement(attribute, '>=', start); } if (end) { searchParameters = searchParameters.addNumericRefinement(attribute, '<=', end); } return searchParameters; }, getMetadata: function getMetadata(props, searchState) { var _this = this; var id = getId$7(props); var value = getCurrentRefinement$5(props, searchState, this.context); var items = []; var index = getIndex(this.context); if (value !== '') { var _find2 = find_1(props.items, function (item) { return stringifyItem(item) === value; }), label = _find2.label; items.push({ label: props.attribute + ': ' + label, attribute: props.attribute, currentRefinement: label, value: function value(nextState) { return _refine$4(props, nextState, '', _this.context); } }); } return { id: id, index: index, items: items }; } }); function _defineProperty$b(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; } function getId$8() { return 'page'; } function getCurrentRefinement$6(props, searchState, context) { var id = getId$8(); var page = 1; return getCurrentRefinementValue(props, searchState, context, id, page, function (currentRefinement) { if (typeof currentRefinement === 'string') { return parseInt(currentRefinement, 10); } return currentRefinement; }); } function _refine$5(props, searchState, nextPage, context) { var id = getId$8(); var nextValue = _defineProperty$b({}, id, nextPage); var resetPage = false; return refineValue(searchState, nextValue, context, resetPage); } /** * connectPagination connector provides the logic to build a widget that will * let the user displays hits corresponding to a certain page. * @name connectPagination * @kind connector * @propType {boolean} [showFirst=true] - Display the first page link. * @propType {boolean} [showLast=false] - Display the last page link. * @propType {boolean} [showPrevious=true] - Display the previous page link. * @propType {boolean} [showNext=true] - Display the next page link. * @propType {number} [padding=3] - How many page links to display around the current page. * @propType {number} [totalPages=Infinity] - Maximum number of pages to display. * @providedPropType {function} refine - a function to remove a single filter * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {number} nbPages - the total of existing pages * @providedPropType {number} currentRefinement - the page refinement currently applied */ var connectPagination = createConnector({ displayName: 'AlgoliaPagination', getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var results = getResults(searchResults, this.context); if (!results) { return null; } var nbPages = results.nbPages; return { nbPages: nbPages, currentRefinement: getCurrentRefinement$6(props, searchState, this.context), canRefine: nbPages > 1 }; }, refine: function refine(props, searchState, nextPage) { return _refine$5(props, searchState, nextPage, this.context); }, cleanUp: function cleanUp(props, searchState) { return cleanUpValue(searchState, this.context, getId$8()); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { return searchParameters.setPage(getCurrentRefinement$6(props, searchState, this.context) - 1); }, getMetadata: function getMetadata() { return { id: getId$8() }; } }); /** * connectPoweredBy connector provides the logic to build a widget that * will display a link to algolia. * @name connectPoweredBy * @kind connector * @providedPropType {string} url - the url to redirect to algolia */ var connectPoweredBy = createConnector({ displayName: 'AlgoliaPoweredBy', propTypes: {}, getProvidedProps: function getProvidedProps(props) { var url = 'https://www.algolia.com/?' + 'utm_source=react-instantsearch&' + 'utm_medium=website&' + ('utm_content=' + (props.canRender ? location.hostname : '') + '&') + 'utm_campaign=poweredby'; return { url: url }; } }); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeIsFinite = _root.isFinite; /** * Checks if `value` is a finite primitive number. * * **Note:** This method is based on * [`Number.isFinite`](https://mdn.io/Number/isFinite). * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. * @example * * _.isFinite(3); * // => true * * _.isFinite(Number.MIN_VALUE); * // => true * * _.isFinite(Infinity); * // => false * * _.isFinite('3'); * // => false */ function isFinite(value) { return typeof value == 'number' && nativeIsFinite(value); } var _isFinite = isFinite; function _defineProperty$c(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; } /** * connectRange connector provides the logic to create connected * components that will give the ability for a user to refine results using * a numeric range. * @name connectRange * @kind connector * @requirements The attribute passed to the `attribute` prop must be present in “attributes for faceting” * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * The values inside the attribute must be JavaScript numbers (not strings). * @propType {string} attribute - Name of the attribute for faceting * @propType {{min?: number, max?: number}} [defaultRefinement] - Default searchState of the widget containing the start and the end of the range. * @propType {number} [min] - Minimum value. When this isn't set, the minimum value will be automatically computed by Algolia using the data in the index. * @propType {number} [max] - Maximum value. When this isn't set, the maximum value will be automatically computed by Algolia using the data in the index. * @propType {number} [precision=0] - Number of digits after decimal point to use. * @providedPropType {function} refine - a function to select a range. * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string} currentRefinement - the refinement currently applied * @providedPropType {number} min - the minimum value available. * @providedPropType {number} max - the maximum value available. * @providedPropType {number} precision - Number of digits after decimal point to use. */ function getId$9(props) { return props.attribute; } var namespace$4 = 'range'; function getCurrentRange(boundaries, stats, precision) { var pow = Math.pow(10, precision); var min = void 0; if (_isFinite(boundaries.min)) { min = boundaries.min; } else if (_isFinite(stats.min)) { min = stats.min; } else { min = undefined; } var max = void 0; if (_isFinite(boundaries.max)) { max = boundaries.max; } else if (_isFinite(stats.max)) { max = stats.max; } else { max = undefined; } return { min: min !== undefined ? Math.floor(min * pow) / pow : min, max: max !== undefined ? Math.ceil(max * pow) / pow : max }; } function getCurrentRefinement$7(props, searchState, currentRange, context) { var refinement = getCurrentRefinementValue(props, searchState, context, namespace$4 + '.' + getId$9(props), {}, function (currentRefinement) { var min = currentRefinement.min, max = currentRefinement.max; var isFloatPrecision = Boolean(props.precision); var nextMin = min; if (typeof nextMin === 'string') { nextMin = isFloatPrecision ? parseFloat(nextMin) : parseInt(nextMin, 10); } var nextMax = max; if (typeof nextMax === 'string') { nextMax = isFloatPrecision ? parseFloat(nextMax) : parseInt(nextMax, 10); } return { min: nextMin, max: nextMax }; }); var hasMinBound = props.min !== undefined; var hasMaxBound = props.max !== undefined; var hasMinRefinment = refinement.min !== undefined; var hasMaxRefinment = refinement.max !== undefined; if (hasMinBound && hasMinRefinment && refinement.min < currentRange.min) { throw Error("You can't provide min value lower than range."); } if (hasMaxBound && hasMaxRefinment && refinement.max > currentRange.max) { throw Error("You can't provide max value greater than range."); } if (hasMinBound && !hasMinRefinment) { refinement.min = currentRange.min; } if (hasMaxBound && !hasMaxRefinment) { refinement.max = currentRange.max; } return refinement; } function getCurrentRefinementWithRange(refinement, range) { return { min: refinement.min !== undefined ? refinement.min : range.min, max: refinement.max !== undefined ? refinement.max : range.max }; } function nextValueForRefinement(hasBound, isReset, range, value) { var next = void 0; if (!hasBound && range === value) { next = undefined; } else if (hasBound && isReset) { next = range; } else { next = value; } return next; } function _refine$6(props, searchState, nextRefinement, currentRange, context) { var nextMin = nextRefinement.min, nextMax = nextRefinement.max; var currentMinRange = currentRange.min, currentMaxRange = currentRange.max; var isMinReset = nextMin === undefined || nextMin === ''; var isMaxReset = nextMax === undefined || nextMax === ''; var nextMinAsNumber = !isMinReset ? parseFloat(nextMin) : undefined; var nextMaxAsNumber = !isMaxReset ? parseFloat(nextMax) : undefined; var isNextMinValid = isMinReset || _isFinite(nextMinAsNumber); var isNextMaxValid = isMaxReset || _isFinite(nextMaxAsNumber); if (!isNextMinValid || !isNextMaxValid) { throw Error("You can't provide non finite values to the range connector."); } if (nextMinAsNumber < currentMinRange) { throw Error("You can't provide min value lower than range."); } if (nextMaxAsNumber > currentMaxRange) { throw Error("You can't provide max value greater than range."); } var id = getId$9(props); var resetPage = true; var nextValue = _defineProperty$c({}, id, { min: nextValueForRefinement(props.min !== undefined, isMinReset, currentMinRange, nextMinAsNumber), max: nextValueForRefinement(props.max !== undefined, isMaxReset, currentMaxRange, nextMaxAsNumber) }); return refineValue(searchState, nextValue, context, resetPage, namespace$4); } function _cleanUp$4(props, searchState, context) { return cleanUpValue(searchState, context, namespace$4 + '.' + getId$9(props)); } var connectRange = createConnector({ displayName: 'AlgoliaRange', propTypes: { id: propTypes.string, attribute: propTypes.string.isRequired, defaultRefinement: propTypes.shape({ min: propTypes.number, max: propTypes.number }), min: propTypes.number, max: propTypes.number, precision: propTypes.number, header: propTypes.node, footer: propTypes.node }, defaultProps: { precision: 0 }, getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var attribute = props.attribute, precision = props.precision, minBound = props.min, maxBound = props.max; var results = getResults(searchResults, this.context); var hasFacet = results && results.getFacetByName(attribute); var stats = hasFacet ? results.getFacetStats(attribute) || {} : {}; var facetValues = hasFacet ? results.getFacetValues(attribute) : []; var count = facetValues.map(function (v) { return { value: v.name, count: v.count }; }); var _getCurrentRange = getCurrentRange({ min: minBound, max: maxBound }, stats, precision), rangeMin = _getCurrentRange.min, rangeMax = _getCurrentRange.max; // The searchState is not always in sync with the helper state. For example // when we set boundaries on the first render the searchState don't have // the correct refinement. If this behaviour change in the upcoming version // we could store the range inside the searchState instead of rely on `this`. this._currentRange = { min: rangeMin, max: rangeMax }; var currentRefinement = getCurrentRefinement$7(props, searchState, this._currentRange, this.context); return { min: rangeMin, max: rangeMax, canRefine: count.length > 0, currentRefinement: getCurrentRefinementWithRange(currentRefinement, this._currentRange), count: count, precision: precision }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$6(props, searchState, nextRefinement, this._currentRange, this.context); }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$4(props, searchState, this.context); }, getSearchParameters: function getSearchParameters(params, props, searchState) { var attribute = props.attribute; var _getCurrentRefinement = getCurrentRefinement$7(props, searchState, this._currentRange, this.context), min = _getCurrentRefinement.min, max = _getCurrentRefinement.max; params = params.addDisjunctiveFacet(attribute); if (min !== undefined) { params = params.addNumericRefinement(attribute, '>=', min); } if (max !== undefined) { params = params.addNumericRefinement(attribute, '<=', max); } return params; }, getMetadata: function getMetadata(props, searchState) { var _this = this; var _currentRange = this._currentRange, minRange = _currentRange.min, maxRange = _currentRange.max; var _getCurrentRefinement2 = getCurrentRefinement$7(props, searchState, this._currentRange, this.context), minValue = _getCurrentRefinement2.min, maxValue = _getCurrentRefinement2.max; var items = []; var hasMin = minValue !== undefined; var hasMax = maxValue !== undefined; var shouldDisplayMinLabel = hasMin && minValue !== minRange; var shouldDisplayMaxLabel = hasMax && maxValue !== maxRange; if (shouldDisplayMinLabel || shouldDisplayMaxLabel) { var fragments = [hasMin ? minValue + ' <= ' : '', props.attribute, hasMax ? ' <= ' + maxValue : '']; items.push({ label: fragments.join(''), attribute: props.attribute, value: function value(nextState) { return _refine$6(props, nextState, {}, _this._currentRange, _this.context); }, currentRefinement: getCurrentRefinementWithRange({ min: minValue, max: maxValue }, { min: minRange, max: maxRange }) }); } return { id: getId$9(props), index: getIndex(this.context), items: items }; } }); function _defineProperty$d(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 namespace$5 = 'refinementList'; function getId$a(props) { return props.attribute; } function getCurrentRefinement$8(props, searchState, context) { return getCurrentRefinementValue(props, searchState, context, namespace$5 + '.' + getId$a(props), [], function (currentRefinement) { if (typeof currentRefinement === 'string') { // All items were unselected if (currentRefinement === '') { return []; } // Only one item was in the searchState but we know it should be an array return [currentRefinement]; } return currentRefinement; }); } function getValue$3(name, props, searchState, context) { var currentRefinement = getCurrentRefinement$8(props, searchState, context); var isAnewValue = currentRefinement.indexOf(name) === -1; var nextRefinement = isAnewValue ? currentRefinement.concat([name]) // cannot use .push(), it mutates : currentRefinement.filter(function (selectedValue) { return selectedValue !== name; }); // cannot use .splice(), it mutates return nextRefinement; } function getLimit$1(_ref) { var showMore = _ref.showMore, limit = _ref.limit, showMoreLimit = _ref.showMoreLimit; return showMore ? showMoreLimit : limit; } function _refine$7(props, searchState, nextRefinement, context) { var id = getId$a(props); // Setting the value to an empty string ensures that it is persisted in // the URL as an empty value. // This is necessary in the case where `defaultRefinement` contains one // item and we try to deselect it. `nextSelected` would be an empty array, // which would not be persisted to the URL. // {foo: ['bar']} => "foo[0]=bar" // {foo: []} => "" var nextValue = _defineProperty$d({}, id, nextRefinement.length > 0 ? nextRefinement : ''); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage, namespace$5); } function _cleanUp$5(props, searchState, context) { return cleanUpValue(searchState, context, namespace$5 + '.' + getId$a(props)); } /** * connectRefinementList connector provides the logic to build a widget that will * give the user the ability to choose multiple values for a specific facet. * @name connectRefinementList * @kind connector * @requirements The attribute passed to the `attribute` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * @propType {string} attribute - the name of the attribute in the record * @propType {boolean} [searchable=false] - allow search inside values * @propType {string} [operator=or] - How to apply the refinements. Possible values: 'or' or 'and'. * @propType {boolean} [showMore=false] - true if the component should display a button that will expand the number of items * @propType {number} [limit=10] - the minimum number of displayed items * @propType {number} [showMoreLimit=20] - the maximun number of displayed items. Only used when showMore is set to `true` * @propType {string[]} defaultRefinement - the values of the items selected by default. The searchState of this widget takes the form of a list of `string`s, which correspond to the values of all selected refinements. However, when there are no refinements selected, the value of the searchState is an empty string. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @providedPropType {function} refine - a function to toggle a refinement * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string[]} currentRefinement - the refinement currently applied * @providedPropType {array.<{count: number, isRefined: boolean, label: string, value: string}>} items - the list of items the RefinementList can display. * @providedPropType {function} searchForItems - a function to toggle a search inside items values * @providedPropType {boolean} isFromSearch - a boolean that says if the `items` props contains facet values from the global search or from the search inside items. */ var sortBy$2 = ['isRefined', 'count:desc', 'name:asc']; var connectRefinementList = createConnector({ displayName: 'AlgoliaRefinementList', propTypes: { id: propTypes.string, attribute: propTypes.string.isRequired, operator: propTypes.oneOf(['and', 'or']), showMore: propTypes.bool, limit: propTypes.number, showMoreLimit: propTypes.number, defaultRefinement: propTypes.arrayOf(propTypes.oneOfType([propTypes.string, propTypes.number])), searchable: propTypes.bool, transformItems: propTypes.func }, defaultProps: { operator: 'or', showMore: false, limit: 10, showMoreLimit: 20 }, getProvidedProps: function getProvidedProps(props, searchState, searchResults, metadata, searchForFacetValuesResults) { var _this = this; var attribute = props.attribute, searchable = props.searchable; var results = getResults(searchResults, this.context); var canRefine = Boolean(results) && Boolean(results.getFacetByName(attribute)); var isFromSearch = Boolean(searchForFacetValuesResults && searchForFacetValuesResults[attribute] && searchForFacetValuesResults.query !== ''); // Search For Facet Values is not available with derived helper (used for multi index search) if (searchable && this.context.multiIndexContext) { throw new Error('react-instantsearch: searching in *List is not available when used inside a' + ' multi index context'); } if (!canRefine) { return { items: [], currentRefinement: getCurrentRefinement$8(props, searchState, this.context), canRefine: canRefine, isFromSearch: isFromSearch, searchable: searchable }; } var items = isFromSearch ? searchForFacetValuesResults[attribute].map(function (v) { return { label: v.value, value: getValue$3(v.value, props, searchState, _this.context), _highlightResult: { label: { value: v.highlighted } }, count: v.count, isRefined: v.isRefined }; }) : results.getFacetValues(attribute, { sortBy: sortBy$2 }).map(function (v) { return { label: v.name, value: getValue$3(v.name, props, searchState, _this.context), count: v.count, isRefined: v.isRefined }; }); var transformedItems = props.transformItems ? props.transformItems(items) : items; return { items: transformedItems.slice(0, getLimit$1(props)), currentRefinement: getCurrentRefinement$8(props, searchState, this.context), isFromSearch: isFromSearch, searchable: searchable, canRefine: items.length > 0 }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$7(props, searchState, nextRefinement, this.context); }, searchForFacetValues: function searchForFacetValues(props, searchState, nextRefinement) { return { facetName: props.attribute, query: nextRefinement, maxFacetHits: getLimit$1(props) }; }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$5(props, searchState, this.context); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var attribute = props.attribute, operator = props.operator; var addKey = operator === 'and' ? 'addFacet' : 'addDisjunctiveFacet'; var addRefinementKey = addKey + 'Refinement'; searchParameters = searchParameters.setQueryParameters({ maxValuesPerFacet: Math.max(searchParameters.maxValuesPerFacet || 0, getLimit$1(props)) }); searchParameters = searchParameters[addKey](attribute); return getCurrentRefinement$8(props, searchState, this.context).reduce(function (res, val) { return res[addRefinementKey](attribute, val); }, searchParameters); }, getMetadata: function getMetadata(props, searchState) { var id = getId$a(props); var context = this.context; return { id: id, index: getIndex(this.context), items: getCurrentRefinement$8(props, searchState, context).length > 0 ? [{ attribute: props.attribute, label: props.attribute + ': ', currentRefinement: getCurrentRefinement$8(props, searchState, context), value: function value(nextState) { return _refine$7(props, nextState, [], context); }, items: getCurrentRefinement$8(props, searchState, context).map(function (item) { return { label: '' + item, value: function value(nextState) { var nextSelectedItems = getCurrentRefinement$8(props, nextState, context).filter(function (other) { return other !== item; }); return _refine$7(props, searchState, nextSelectedItems, context); } }; }) }] : [] }; } }); /** * connectScrollTo connector provides the logic to build a widget that will * let the page scroll to a certain point. * @name connectScrollTo * @kind connector * @propType {string} [scrollOn="page"] - Widget searchState key on which to listen for changes, default to the pagination widget. * @providedPropType {any} value - the current refinement applied to the widget listened by scrollTo * @providedPropType {boolean} hasNotChanged - indicates whether the refinement came from the scrollOn argument (for instance page by default) */ var connectScrollTo = createConnector({ displayName: 'AlgoliaScrollTo', propTypes: { scrollOn: propTypes.string }, defaultProps: { scrollOn: 'page' }, getProvidedProps: function getProvidedProps(props, searchState) { var id = props.scrollOn; var value = getCurrentRefinementValue(props, searchState, this.context, id, null, function (currentRefinement) { return currentRefinement; }); if (!this._prevSearchState) { this._prevSearchState = {}; } /* Get the subpart of the state that interest us*/ if (hasMultipleIndex(this.context)) { var index = getIndex(this.context); searchState = searchState.indices ? searchState.indices[index] : {}; } /* if there is a change in the app that has been triggered by another element than "props.scrollOn (id) or the Configure widget, we need to keep track of the search state to know if there's a change in the app that was not triggered by the props.scrollOn (id) or the Configure widget. This is useful when using ScrollTo in combination of Pagination. As pagination can be change by every widget, we want to scroll only if it cames from the pagination widget itself. We also remove the configure key from the search state to do this comparaison because for now configure values are not present in the search state before a first refinement has been made and will false the results. See: https://github.com/algolia/react-instantsearch/issues/164 */ var cleanedSearchState = omit_1(omit_1(searchState, 'configure'), id); var hasNotChanged = shallowEqual(this._prevSearchState, cleanedSearchState); this._prevSearchState = cleanedSearchState; return { value: value, hasNotChanged: hasNotChanged }; } }); function _defineProperty$e(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; } function getId$b() { return 'query'; } function getCurrentRefinement$9(props, searchState, context) { var id = getId$b(props); return getCurrentRefinementValue(props, searchState, context, id, '', function (currentRefinement) { if (currentRefinement) { return currentRefinement; } return ''; }); } function _refine$8(props, searchState, nextRefinement, context) { var id = getId$b(); var nextValue = _defineProperty$e({}, id, nextRefinement); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage); } function _cleanUp$6(props, searchState, context) { return cleanUpValue(searchState, context, getId$b()); } /** * connectSearchBox connector provides the logic to build a widget that will * let the user search for a query. * @name connectSearchBox * @kind connector * @providedPropType {function} refine - a function to remove a single filter * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string} currentRefinement - the query to search for. * @providedPropType {boolean} isSearchStalled - a flag that indicates if react-is has detected that searches are stalled. */ var connectSearchBox = createConnector({ displayName: 'AlgoliaSearchBox', propTypes: { defaultRefinement: propTypes.string }, getProvidedProps: function getProvidedProps(props, searchState, searchResults) { return { currentRefinement: getCurrentRefinement$9(props, searchState, this.context), isSearchStalled: searchResults.isSearchStalled }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$8(props, searchState, nextRefinement, this.context); }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$6(props, searchState, this.context); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { return searchParameters.setQuery(getCurrentRefinement$9(props, searchState, this.context)); }, getMetadata: function getMetadata(props, searchState) { var _this = this; var id = getId$b(props); var currentRefinement = getCurrentRefinement$9(props, searchState, this.context); return { id: id, index: getIndex(this.context), items: currentRefinement === null ? [] : [{ label: id + ': ' + currentRefinement, value: function value(nextState) { return _refine$8(props, nextState, '', _this.context); }, currentRefinement: currentRefinement }] }; } }); var _extends$9 = 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; }; function _defineProperty$f(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; } function getId$c() { return 'sortBy'; } function getCurrentRefinement$a(props, searchState, context) { var id = getId$c(props); return getCurrentRefinementValue(props, searchState, context, id, null, function (currentRefinement) { if (currentRefinement) { return currentRefinement; } return null; }); } /** * The connectSortBy connector provides the logic to build a widget that will * display a list of indices. This allows a user to change how the hits are being sorted. * @name connectSortBy * @requirements Algolia handles sorting by creating replica indices. [Read more about sorting](https://www.algolia.com/doc/guides/relevance/sorting/) on * the Algolia website. * @kind connector * @propType {string} defaultRefinement - The default selected index. * @propType {{value: string, label: string}[]} items - The list of indexes to search in. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @providedPropType {function} refine - a function to remove a single filter * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string[]} currentRefinement - the refinement currently applied * @providedPropType {array.<{isRefined: boolean, label?: string, value: string}>} items - the list of items the HitsPerPage can display. If no label provided, the value will be displayed. */ var connectSortBy = createConnector({ displayName: 'AlgoliaSortBy', propTypes: { defaultRefinement: propTypes.string, items: propTypes.arrayOf(propTypes.shape({ label: propTypes.string, value: propTypes.string.isRequired })).isRequired, transformItems: propTypes.func }, getProvidedProps: function getProvidedProps(props, searchState) { var currentRefinement = getCurrentRefinement$a(props, searchState, this.context); var items = props.items.map(function (item) { return item.value === currentRefinement ? _extends$9({}, item, { isRefined: true }) : _extends$9({}, item, { isRefined: false }); }); return { items: props.transformItems ? props.transformItems(items) : items, currentRefinement: currentRefinement }; }, refine: function refine(props, searchState, nextRefinement) { var id = getId$c(); var nextValue = _defineProperty$f({}, id, nextRefinement); var resetPage = true; return refineValue(searchState, nextValue, this.context, resetPage); }, cleanUp: function cleanUp(props, searchState) { return cleanUpValue(searchState, this.context, getId$c()); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var selectedIndex = getCurrentRefinement$a(props, searchState, this.context); return searchParameters.setIndex(selectedIndex); }, getMetadata: function getMetadata() { return { id: getId$c() }; } }); /** * The `connectStateResults` connector provides a way to access the `searchState` and the `searchResults` * of InstantSearch. * For instance this connector allows you to create results/noResults or query/noQuery pages. * @name connectStateResults * @kind connector * @providedPropType {object} searchState - The search state of the instant search component. <br/><br/> See: [Search state structure](https://community.algolia.com/react-instantsearch/guide/Search_state.html) * @providedPropType {object} searchResults - The search results. <br/><br/> In case of multiple indices: if used under `<Index>`, results will be those of the corresponding index otherwise it'll be those of the root index See: [Search results structure](https://community.algolia.com/algoliasearch-helper-js/reference.html#searchresults) * @providedPropType {object} allSearchResults - In case of multiple indices you can retrieve all the results * @providedPropType {string} error - If the search failed, the error will be logged here. * @providedPropType {boolean} searching - If there is a search in progress. * @providedPropType {boolean} isSearchStalled - Flag that indicates if React InstantSearch has detected that searches are stalled. * @providedPropType {boolean} searchingForFacetValues - If there is a search in a list in progress. * @providedPropType {object} props - component props. * @example * import React from 'react'; * import { InstantSearch, SearchBox, Hits, connectStateResults } from 'react-instantsearch-dom'; * * const Content = connectStateResults(({ searchState, searchResults }) => { * const hasResults = searchResults && searchResults.nbHits !== 0; * * return ( * <div> * <div hidden={!hasResults}> * <Hits /> * </div> * <div hidden={hasResults}> * <div>No results has been found for {searchState.query}</div> * </div> * </div> * ); * }); * * const App = () => ( * <InstantSearch * appId="latency" * apiKey="6be0576ff61c053d5f9a3225e2a90f76" * indexName="ikea" * > * <SearchBox /> * <Content /> * </InstantSearch> * ); */ var connectStateResults = createConnector({ displayName: 'AlgoliaStateResults', getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var results = getResults(searchResults, this.context); return { searchState: searchState, searchResults: results, allSearchResults: searchResults.results, searching: searchResults.searching, isSearchStalled: searchResults.isSearchStalled, error: searchResults.error, searchingForFacetValues: searchResults.searchingForFacetValues, props: props }; } }); /** * connectStats connector provides the logic to build a widget that will * displays algolia search statistics (hits number and processing time). * @name connectStats * @kind connector * @providedPropType {number} nbHits - number of hits returned by Algolia. * @providedPropType {number} processingTimeMS - the time in ms took by Algolia to search for results. */ var connectStats = createConnector({ displayName: 'AlgoliaStats', getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var results = getResults(searchResults, this.context); if (!results) { return null; } return { nbHits: results.nbHits, processingTimeMS: results.processingTimeMS }; } }); function _defineProperty$g(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; } function getId$d(props) { return props.attribute; } var namespace$6 = 'toggle'; function getCurrentRefinement$b(props, searchState, context) { return getCurrentRefinementValue(props, searchState, context, namespace$6 + '.' + getId$d(props), false, function (currentRefinement) { if (currentRefinement) { return currentRefinement; } return false; }); } function _refine$9(props, searchState, nextRefinement, context) { var id = getId$d(props); var nextValue = _defineProperty$g({}, id, nextRefinement ? nextRefinement : false); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage, namespace$6); } function _cleanUp$7(props, searchState, context) { return cleanUpValue(searchState, context, namespace$6 + '.' + getId$d(props)); } /** * connectToggleRefinement connector provides the logic to build a widget that will * provides an on/off filtering feature based on an attribute value. * @name connectToggleRefinement * @kind connector * @requirements To use this widget, you'll need an attribute to toggle on. * * You can't toggle on null or not-null values. If you want to address this particular use-case you'll need to compute an * extra boolean attribute saying if the value exists or not. See this [thread](https://discourse.algolia.com/t/how-to-create-a-toggle-for-the-absence-of-a-string-attribute/2460) for more details. * * @propType {string} attribute - Name of the attribute on which to apply the `value` refinement. Required when `value` is present. * @propType {string} label - Label for the toggle. * @propType {string} value - Value of the refinement to apply on `attribute`. * @propType {boolean} [defaultRefinement=false] - Default searchState of the widget. Should the toggle be checked by default? * @providedPropType {function} refine - a function to toggle a refinement * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {boolean} currentRefinement - `true` when the refinement is applied, `false` otherwise */ var connectToggleRefinement = createConnector({ displayName: 'AlgoliaToggle', propTypes: { label: propTypes.string, filter: propTypes.func, attribute: propTypes.string, value: propTypes.any, defaultRefinement: propTypes.bool }, getProvidedProps: function getProvidedProps(props, searchState) { var currentRefinement = getCurrentRefinement$b(props, searchState, this.context); return { currentRefinement: currentRefinement }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$9(props, searchState, nextRefinement, this.context); }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$7(props, searchState, this.context); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var attribute = props.attribute, value = props.value, filter = props.filter; var checked = getCurrentRefinement$b(props, searchState, this.context); if (checked) { if (attribute) { searchParameters = searchParameters.addFacet(attribute).addFacetRefinement(attribute, value); } if (filter) { searchParameters = filter(searchParameters); } } return searchParameters; }, getMetadata: function getMetadata(props, searchState) { var _this = this; var id = getId$d(props); var checked = getCurrentRefinement$b(props, searchState, this.context); var items = []; var index = getIndex(this.context); if (checked) { items.push({ label: props.label, currentRefinement: checked, attribute: props.attribute, value: function value(nextState) { return _refine$9(props, nextState, false, _this.context); } }); } return { id: id, index: index, items: items }; } }); // Core exports.connectAutoComplete = connectAutoComplete; exports.connectBreadcrumb = connectBreadcrumb; exports.connectConfigure = connectConfigure; exports.connectCurrentRefinements = connectCurrentRefinements; exports.connectHierarchicalMenu = connectHierarchicalMenu; exports.connectHighlight = connectHighlight; exports.connectHits = connectHits; exports.connectHitsPerPage = connectHitsPerPage; exports.connectInfiniteHits = connectInfiniteHits; exports.connectMenu = connectMenu; exports.connectNumericMenu = connectNumericMenu; exports.connectPagination = connectPagination; exports.connectPoweredBy = connectPoweredBy; exports.connectRange = connectRange; exports.connectRefinementList = connectRefinementList; exports.connectScrollTo = connectScrollTo; exports.connectSearchBox = connectSearchBox; exports.connectSortBy = connectSortBy; exports.connectStateResults = connectStateResults; exports.connectStats = connectStats; exports.connectToggleRefinement = connectToggleRefinement; Object.defineProperty(exports, '__esModule', { value: true }); }))); //# sourceMappingURL=Connectors.js.map
ajax/libs/primereact/6.5.0-rc.1/captcha/captcha.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; 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); return Constructor; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); } 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); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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 propTypes = {exports: {}}; /** * 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. */ var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; var ReactPropTypesSecret_1 = ReactPropTypesSecret$1; /** * 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. */ var ReactPropTypesSecret = ReactPropTypesSecret_1; function emptyFunction() {} function emptyFunctionWithReset() {} emptyFunctionWithReset.resetWarningCache = emptyFunction; var factoryWithThrowingShims = function() { function shim(props, propName, componentName, location, propFullName, secret) { if (secret === ReactPropTypesSecret) { // It is still safe when called from React. return; } var err = new Error( 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types' ); err.name = 'Invariant Violation'; throw err; } shim.isRequired = shim; function getShim() { return shim; } // Important! // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. var ReactPropTypes = { array: shim, bool: shim, func: shim, number: shim, object: shim, string: shim, symbol: shim, any: shim, arrayOf: getShim, element: shim, elementType: shim, instanceOf: getShim, node: shim, objectOf: getShim, oneOf: getShim, oneOfType: getShim, shape: getShim, exact: getShim, checkPropTypes: emptyFunctionWithReset, resetWarningCache: emptyFunction }; ReactPropTypes.PropTypes = ReactPropTypes; return ReactPropTypes; }; /** * 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. */ { // By explicitly using `prop-types` you are opting into new production behavior. // http://fb.me/prop-types-in-prod propTypes.exports = factoryWithThrowingShims(); } var PropTypes = propTypes.exports; 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 _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; } } var Captcha = /*#__PURE__*/function (_Component) { _inherits(Captcha, _Component); var _super = _createSuper(Captcha); function Captcha() { _classCallCheck(this, Captcha); return _super.apply(this, arguments); } _createClass(Captcha, [{ key: "init", value: function init() { var _this = this; this._instance = window.grecaptcha.render(this.targetEL, { 'sitekey': this.props.siteKey, 'theme': this.props.theme, 'type': this.props.type, 'size': this.props.size, 'tabindex': this.props.tabIndex, 'hl': this.props.language, 'callback': function callback(response) { _this.recaptchaCallback(response); }, 'expired-callback': function expiredCallback() { _this.recaptchaExpiredCallback(); } }); } }, { key: "reset", value: function reset() { if (this._instance === null) return; window.grecaptcha.reset(this._instance); } }, { key: "getResponse", value: function getResponse() { if (this._instance === null) return null; return window.grecaptcha.getResponse(this._instance); } }, { key: "recaptchaCallback", value: function recaptchaCallback(response) { if (this.props.onResponse) { this.props.onResponse({ response: response }); } } }, { key: "recaptchaExpiredCallback", value: function recaptchaExpiredCallback() { if (this.props.onExpire) { this.props.onExpire(); } } }, { key: "addRecaptchaScript", value: function addRecaptchaScript() { var _this2 = this; this.recaptchaScript = null; if (!window.grecaptcha) { var head = document.head || document.getElementsByTagName('head')[0]; this.recaptchaScript = document.createElement('script'); this.recaptchaScript.src = "https://www.google.com/recaptcha/api.js?render=explicit"; this.recaptchaScript.async = true; this.recaptchaScript.defer = true; this.recaptchaScript.onload = function () { if (!window.grecaptcha) { console.warn("Recaptcha is not loaded"); return; } window.grecaptcha.ready(function () { _this2.init(); }); }; head.appendChild(this.recaptchaScript); } } }, { key: "componentDidMount", value: function componentDidMount() { this.addRecaptchaScript(); if (window.grecaptcha) { this.init(); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { if (this.recaptchaScript) { this.recaptchaScript.parentNode.removeChild(this.recaptchaScript); } } }, { key: "render", value: function render() { var _this3 = this; return /*#__PURE__*/React.createElement("div", { id: this.props.id, ref: function ref(el) { return _this3.targetEL = el; } }); } }]); return Captcha; }(Component); _defineProperty(Captcha, "defaultProps", { id: null, siteKey: null, theme: "light", type: "image", size: "normal", tabIndex: 0, language: "en", onResponse: null, onExpire: null }); _defineProperty(Captcha, "propTypes", { id: PropTypes.string, sitekey: PropTypes.string, theme: PropTypes.string, type: PropTypes.string, size: PropTypes.string, tabIndex: PropTypes.number, language: PropTypes.string, onResponse: PropTypes.func, onExpire: PropTypes.func }); export { Captcha };
ajax/libs/react-instantsearch/6.8.3/Dom.js
cdnjs/cdnjs
/*! React InstantSearch 6.8.3 | © Algolia, inc. | https://github.com/algolia/react-instantsearch */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) : typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) : (global = global || self, factory((global.ReactInstantSearch = global.ReactInstantSearch || {}, global.ReactInstantSearch.Dom = {}), global.React)); }(this, function (exports, React) { 'use strict'; var React__default = 'default' in React ? React['default'] : React; function _extends() { _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; }; return _extends.apply(this, arguments); } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = 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; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } 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); return Constructor; } function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); } function _typeof(obj) { if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") { _typeof = function _typeof(obj) { return _typeof2(obj); }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj); }; } return _typeof(obj); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); } /* global Map:readonly, Set:readonly, ArrayBuffer:readonly */ var hasElementType = typeof Element !== 'undefined'; var hasMap = typeof Map === 'function'; var hasSet = typeof Set === 'function'; var hasArrayBuffer = typeof ArrayBuffer === 'function'; // Note: We **don't** need `envHasBigInt64Array` in fde es6/index.js function equal(a, b) { // START: fast-deep-equal es6/index.js 3.1.1 if (a === b) return true; if (a && b && typeof a == 'object' && typeof b == 'object') { if (a.constructor !== b.constructor) return false; var length, i, keys; if (Array.isArray(a)) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false; return true; } // START: Modifications: // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code // to co-exist with es5. // 2. Replace `for of` with es5 compliant iteration using `for`. // Basically, take: // // ```js // for (i of a.entries()) // if (!b.has(i[0])) return false; // ``` // // ... and convert to: // // ```js // it = a.entries(); // while (!(i = it.next()).done) // if (!b.has(i.value[0])) return false; // ``` // // **Note**: `i` access switches to `i.value`. var it; if (hasMap && (a instanceof Map) && (b instanceof Map)) { if (a.size !== b.size) return false; it = a.entries(); while (!(i = it.next()).done) if (!b.has(i.value[0])) return false; it = a.entries(); while (!(i = it.next()).done) if (!equal(i.value[1], b.get(i.value[0]))) return false; return true; } if (hasSet && (a instanceof Set) && (b instanceof Set)) { if (a.size !== b.size) return false; it = a.entries(); while (!(i = it.next()).done) if (!b.has(i.value[0])) return false; return true; } // END: Modifications if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0;) if (a[i] !== b[i]) return false; return true; } if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); keys = Object.keys(a); length = keys.length; if (length !== Object.keys(b).length) return false; for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; // END: fast-deep-equal // START: react-fast-compare // custom handling for DOM elements if (hasElementType && a instanceof Element) return false; // custom handling for React for (i = length; i-- !== 0;) { if (keys[i] === '_owner' && a.$$typeof) { // React-specific: avoid traversing React elements' _owner. // _owner contains circular references // and is not needed when comparing the actual elements (and not their owners) // .$$typeof and ._store on just reasonable markers of a react element continue; } // all other properties should be traversed as usual if (!equal(a[keys[i]], b[keys[i]])) return false; } // END: react-fast-compare // START: fast-deep-equal return true; } return a !== a && b !== b; } // end fast-deep-equal var reactFastCompare = function isEqual(a, b) { try { return equal(a, b); } catch (error) { if (((error.message || '').match(/stack|recursion/i))) { // warn on circular references, don't crash // browsers give this different errors name and messages: // chrome/safari: "RangeError", "Maximum call stack size exceeded" // firefox: "InternalError", too much recursion" // edge: "Error", "Out of stack space" console.warn('react-fast-compare cannot handle circular refs'); return false; } // some other error. we should definitely know about these throw error; } }; var shallowEqual = function shallowEqual(objA, objB) { if (objA === objB) { return true; } var keysA = Object.keys(objA); var keysB = Object.keys(objB); if (keysA.length !== keysB.length) { return false; } // Test for A's keys different from B. var hasOwn = Object.prototype.hasOwnProperty; for (var i = 0; i < keysA.length; i++) { if (!hasOwn.call(objB, keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) { return false; } } return true; }; var getDisplayName = function getDisplayName(Component) { return Component.displayName || Component.name || 'UnknownComponent'; }; var resolved = Promise.resolve(); var defer = function defer(f) { resolved.then(f); }; var isPlainObject = function isPlainObject(value) { return _typeof(value) === 'object' && value !== null && !Array.isArray(value); }; var removeEmptyKey = function removeEmptyKey(obj) { Object.keys(obj).forEach(function (key) { var value = obj[key]; if (!isPlainObject(value)) { return; } if (!objectHasKeys(value)) { delete obj[key]; } else { removeEmptyKey(value); } }); return obj; }; var removeEmptyArraysFromObject = function removeEmptyArraysFromObject(obj) { Object.keys(obj).forEach(function (key) { var value = obj[key]; if (Array.isArray(value) && value.length === 0) { delete obj[key]; } }); return obj; }; function addAbsolutePositions(hits, hitsPerPage, page) { return hits.map(function (hit, index) { return _objectSpread({}, hit, { __position: hitsPerPage * page + index + 1 }); }); } function addQueryID(hits, queryID) { if (!queryID) { return hits; } return hits.map(function (hit) { return _objectSpread({}, hit, { __queryID: queryID }); }); } function find(array, comparator) { if (!Array.isArray(array)) { return undefined; } for (var i = 0; i < array.length; i++) { if (comparator(array[i])) { return array[i]; } } return undefined; } function objectHasKeys(object) { return object && Object.keys(object).length > 0; } // https://github.com/babel/babel/blob/3aaafae053fa75febb3aa45d45b6f00646e30ba4/packages/babel-helpers/src/helpers.js#L604-L620 function omit(source, excluded) { if (source === null || source === undefined) { return {}; } var target = {}; var sourceKeys = Object.keys(source); for (var i = 0; i < sourceKeys.length; i++) { var _key = sourceKeys[i]; if (excluded.indexOf(_key) >= 0) { // eslint-disable-next-line no-continue continue; } target[_key] = source[_key]; } return target; } /** * Retrieve the value at a path of the object: * * @example * getPropertyByPath( * { test: { this: { function: [{ now: { everyone: true } }] } } }, * 'test.this.function[0].now.everyone' * ); // true * * getPropertyByPath( * { test: { this: { function: [{ now: { everyone: true } }] } } }, * ['test', 'this', 'function', 0, 'now', 'everyone'] * ); // true * * @param object Source object to query * @param path either an array of properties, or a string form of the properties, separated by . */ var getPropertyByPath = function getPropertyByPath(object, path) { return (Array.isArray(path) ? path : path.replace(/\[(\d+)]/g, '.$1').split('.')).reduce(function (current, key) { return current ? current[key] : undefined; }, object); }; var _createContext = React.createContext({ onInternalStateUpdate: function onInternalStateUpdate() { return undefined; }, createHrefForState: function createHrefForState() { return '#'; }, onSearchForFacetValues: function onSearchForFacetValues() { return undefined; }, onSearchStateChange: function onSearchStateChange() { return undefined; }, onSearchParameters: function onSearchParameters() { return undefined; }, store: {}, widgetsManager: {}, mainTargetedIndex: '' }), InstantSearchConsumer = _createContext.Consumer, InstantSearchProvider = _createContext.Provider; var _createContext2 = React.createContext(undefined), IndexConsumer = _createContext2.Consumer, IndexProvider = _createContext2.Provider; /** * Connectors are the HOC used to transform React components * into InstantSearch widgets. * In order to simplify the construction of such connectors * `createConnector` takes a description and transform it into * a connector. * @param {ConnectorDescription} connectorDesc the description of the connector * @return {Connector} a function that wraps a component into * an instantsearch connected one. */ function createConnectorWithoutContext(connectorDesc) { if (!connectorDesc.displayName) { throw new Error('`createConnector` requires you to provide a `displayName` property.'); } var isWidget = typeof connectorDesc.getSearchParameters === 'function' || typeof connectorDesc.getMetadata === 'function' || typeof connectorDesc.transitionState === 'function'; return function (Composed) { var Connector = /*#__PURE__*/ function (_Component) { _inherits(Connector, _Component); function Connector(props) { var _this; _classCallCheck(this, Connector); _this = _possibleConstructorReturn(this, _getPrototypeOf(Connector).call(this, props)); _defineProperty(_assertThisInitialized(_this), "unsubscribe", void 0); _defineProperty(_assertThisInitialized(_this), "unregisterWidget", void 0); _defineProperty(_assertThisInitialized(_this), "isUnmounting", false); _defineProperty(_assertThisInitialized(_this), "state", { providedProps: _this.getProvidedProps(_this.props) }); _defineProperty(_assertThisInitialized(_this), "refine", function () { var _ref; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this.props.contextValue.onInternalStateUpdate( // refine will always be defined here because the prop is only given conditionally (_ref = connectorDesc.refine).call.apply(_ref, [_assertThisInitialized(_this), _this.props, _this.props.contextValue.store.getState().widgets].concat(args))); }); _defineProperty(_assertThisInitialized(_this), "createURL", function () { var _ref2; for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return _this.props.contextValue.createHrefForState( // refine will always be defined here because the prop is only given conditionally (_ref2 = connectorDesc.refine).call.apply(_ref2, [_assertThisInitialized(_this), _this.props, _this.props.contextValue.store.getState().widgets].concat(args))); }); _defineProperty(_assertThisInitialized(_this), "searchForFacetValues", function () { var _ref3; for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { args[_key3] = arguments[_key3]; } _this.props.contextValue.onSearchForFacetValues( // searchForFacetValues will always be defined here because the prop is only given conditionally (_ref3 = connectorDesc.searchForFacetValues).call.apply(_ref3, [_assertThisInitialized(_this), _this.props, _this.props.contextValue.store.getState().widgets].concat(args))); }); if (connectorDesc.getSearchParameters) { _this.props.contextValue.onSearchParameters(connectorDesc.getSearchParameters.bind(_assertThisInitialized(_this)), { ais: _this.props.contextValue, multiIndexContext: _this.props.indexContextValue }, _this.props, connectorDesc.getMetadata && connectorDesc.getMetadata.bind(_assertThisInitialized(_this))); } return _this; } _createClass(Connector, [{ key: "componentDidMount", value: function componentDidMount() { var _this2 = this; this.unsubscribe = this.props.contextValue.store.subscribe(function () { if (!_this2.isUnmounting) { _this2.setState({ providedProps: _this2.getProvidedProps(_this2.props) }); } }); if (isWidget) { this.unregisterWidget = this.props.contextValue.widgetsManager.registerWidget(this); } } }, { key: "shouldComponentUpdate", value: function shouldComponentUpdate(nextProps, nextState) { if (typeof connectorDesc.shouldComponentUpdate === 'function') { return connectorDesc.shouldComponentUpdate.call(this, this.props, nextProps, this.state, nextState); } var propsEqual = shallowEqual(this.props, nextProps); if (this.state.providedProps === null || nextState.providedProps === null) { if (this.state.providedProps === nextState.providedProps) { return !propsEqual; } return true; } return !propsEqual || !shallowEqual(this.state.providedProps, nextState.providedProps); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (!reactFastCompare(prevProps, this.props)) { this.setState({ providedProps: this.getProvidedProps(this.props) }); if (isWidget) { this.props.contextValue.widgetsManager.update(); if (typeof connectorDesc.transitionState === 'function') { this.props.contextValue.onSearchStateChange(connectorDesc.transitionState.call(this, this.props, this.props.contextValue.store.getState().widgets, this.props.contextValue.store.getState().widgets)); } } } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.isUnmounting = true; if (this.unsubscribe) { this.unsubscribe(); } if (this.unregisterWidget) { this.unregisterWidget(); if (typeof connectorDesc.cleanUp === 'function') { var nextState = connectorDesc.cleanUp.call(this, this.props, this.props.contextValue.store.getState().widgets); this.props.contextValue.store.setState(_objectSpread({}, this.props.contextValue.store.getState(), { widgets: nextState })); this.props.contextValue.onSearchStateChange(removeEmptyKey(nextState)); } } } }, { key: "getProvidedProps", value: function getProvidedProps(props) { var _this$props$contextVa = this.props.contextValue.store.getState(), widgets = _this$props$contextVa.widgets, results = _this$props$contextVa.results, resultsFacetValues = _this$props$contextVa.resultsFacetValues, searching = _this$props$contextVa.searching, searchingForFacetValues = _this$props$contextVa.searchingForFacetValues, isSearchStalled = _this$props$contextVa.isSearchStalled, metadata = _this$props$contextVa.metadata, error = _this$props$contextVa.error; var searchResults = { results: results, searching: searching, searchingForFacetValues: searchingForFacetValues, isSearchStalled: isSearchStalled, error: error }; return connectorDesc.getProvidedProps.call(this, props, widgets, searchResults, metadata, // @MAJOR: move this attribute on the `searchResults` it doesn't // makes sense to have it into a separate argument. The search // flags are on the object why not the results? resultsFacetValues); } }, { key: "getSearchParameters", value: function getSearchParameters(searchParameters) { if (typeof connectorDesc.getSearchParameters === 'function') { return connectorDesc.getSearchParameters.call(this, searchParameters, this.props, this.props.contextValue.store.getState().widgets); } return null; } }, { key: "getMetadata", value: function getMetadata(nextWidgetsState) { if (typeof connectorDesc.getMetadata === 'function') { return connectorDesc.getMetadata.call(this, this.props, nextWidgetsState); } return {}; } }, { key: "transitionState", value: function transitionState(prevWidgetsState, nextWidgetsState) { if (typeof connectorDesc.transitionState === 'function') { return connectorDesc.transitionState.call(this, this.props, prevWidgetsState, nextWidgetsState); } return nextWidgetsState; } }, { key: "render", value: function render() { var _this$props = this.props, contextValue = _this$props.contextValue, props = _objectWithoutProperties(_this$props, ["contextValue"]); var providedProps = this.state.providedProps; if (providedProps === null) { return null; } var refineProps = typeof connectorDesc.refine === 'function' ? { refine: this.refine, createURL: this.createURL } : {}; var searchForFacetValuesProps = typeof connectorDesc.searchForFacetValues === 'function' ? { searchForItems: this.searchForFacetValues } : {}; return React__default.createElement(Composed, _extends({}, props, providedProps, refineProps, searchForFacetValuesProps)); } }]); return Connector; }(React.Component); _defineProperty(Connector, "displayName", "".concat(connectorDesc.displayName, "(").concat(getDisplayName(Composed), ")")); _defineProperty(Connector, "propTypes", connectorDesc.propTypes); _defineProperty(Connector, "defaultProps", connectorDesc.defaultProps); return Connector; }; } var createConnectorWithContext = function createConnectorWithContext(connectorDesc) { return function (Composed) { var Connector = createConnectorWithoutContext(connectorDesc)(Composed); var ConnectorWrapper = function ConnectorWrapper(props) { return React__default.createElement(InstantSearchConsumer, null, function (contextValue) { return React__default.createElement(IndexConsumer, null, function (indexContextValue) { return React__default.createElement(Connector, _extends({ contextValue: contextValue, indexContextValue: indexContextValue }, props)); }); }); }; return ConnectorWrapper; }; }; var HIGHLIGHT_TAGS = { highlightPreTag: "<ais-highlight-0000000000>", highlightPostTag: "</ais-highlight-0000000000>" }; /** * Parses an highlighted attribute into an array of objects with the string value, and * a boolean that indicated if this part is highlighted. * * @param {string} preTag - string used to identify the start of an highlighted value * @param {string} postTag - string used to identify the end of an highlighted value * @param {string} highlightedValue - highlighted attribute as returned by Algolia highlight feature * @return {object[]} - An array of {value: string, isHighlighted: boolean}. */ function parseHighlightedAttribute(_ref) { var preTag = _ref.preTag, postTag = _ref.postTag, _ref$highlightedValue = _ref.highlightedValue, highlightedValue = _ref$highlightedValue === void 0 ? '' : _ref$highlightedValue; var splitByPreTag = highlightedValue.split(preTag); var firstValue = splitByPreTag.shift(); var elements = firstValue === '' ? [] : [{ value: firstValue, isHighlighted: false }]; if (postTag === preTag) { var isHighlighted = true; splitByPreTag.forEach(function (split) { elements.push({ value: split, isHighlighted: isHighlighted }); isHighlighted = !isHighlighted; }); } else { splitByPreTag.forEach(function (split) { var splitByPostTag = split.split(postTag); elements.push({ value: splitByPostTag[0], isHighlighted: true }); if (splitByPostTag[1] !== '') { elements.push({ value: splitByPostTag[1], isHighlighted: false }); } }); } return elements; } /** * Find an highlighted attribute given an `attribute` and an `highlightProperty`, parses it, * and provided an array of objects with the string value and a boolean if this * value is highlighted. * * In order to use this feature, highlight must be activated in the configuration of * the index. The `preTag` and `postTag` attributes are respectively highlightPreTag and * highlightPostTag in Algolia configuration. * * @param {string} preTag - string used to identify the start of an highlighted value * @param {string} postTag - string used to identify the end of an highlighted value * @param {string} highlightProperty - the property that contains the highlight structure in the results * @param {string} attribute - the highlighted attribute to look for * @param {object} hit - the actual hit returned by Algolia. * @return {object[]} - An array of {value: string, isHighlighted: boolean}. */ function parseAlgoliaHit(_ref2) { var _ref2$preTag = _ref2.preTag, preTag = _ref2$preTag === void 0 ? '<em>' : _ref2$preTag, _ref2$postTag = _ref2.postTag, postTag = _ref2$postTag === void 0 ? '</em>' : _ref2$postTag, highlightProperty = _ref2.highlightProperty, attribute = _ref2.attribute, hit = _ref2.hit; if (!hit) throw new Error('`hit`, the matching record, must be provided'); var highlightObject = getPropertyByPath(hit[highlightProperty], attribute) || {}; if (Array.isArray(highlightObject)) { return highlightObject.map(function (item) { return parseHighlightedAttribute({ preTag: preTag, postTag: postTag, highlightedValue: item.value }); }); } return parseHighlightedAttribute({ preTag: preTag, postTag: postTag, highlightedValue: highlightObject.value }); } var version = '6.8.3'; function translatable(defaultTranslations) { return function (Composed) { var Translatable = /*#__PURE__*/ function (_Component) { _inherits(Translatable, _Component); function Translatable() { var _getPrototypeOf2; var _this; _classCallCheck(this, Translatable); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Translatable)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_this), "translate", function (key) { var translations = _this.props.translations; var translation = translations && translations.hasOwnProperty(key) ? translations[key] : defaultTranslations[key]; if (typeof translation === 'function') { for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { params[_key2 - 1] = arguments[_key2]; } return translation.apply(void 0, params); } return translation; }); return _this; } _createClass(Translatable, [{ key: "render", value: function render() { return React__default.createElement(Composed, _extends({ translate: this.translate }, this.props)); } }]); return Translatable; }(React.Component); var name = Composed.displayName || Composed.name || 'UnknownComponent'; Translatable.displayName = "Translatable(".concat(name, ")"); return Translatable; }; } function getIndexId(context) { return hasMultipleIndices(context) ? context.multiIndexContext.targetedIndex : context.ais.mainTargetedIndex; } function getResults(searchResults, context) { if (searchResults.results) { if (searchResults.results.hits) { return searchResults.results; } var indexId = getIndexId(context); if (searchResults.results[indexId]) { return searchResults.results[indexId]; } } return null; } function hasMultipleIndices(context) { return context && context.multiIndexContext; } // eslint-disable-next-line max-params function refineValue(searchState, nextRefinement, context, resetPage, namespace) { if (hasMultipleIndices(context)) { var indexId = getIndexId(context); return namespace ? refineMultiIndexWithNamespace(searchState, nextRefinement, indexId, resetPage, namespace) : refineMultiIndex(searchState, nextRefinement, indexId, resetPage); } else { // When we have a multi index page with shared widgets we should also // reset their page to 1 if the resetPage is provided. Otherwise the // indices will always be reset // see: https://github.com/algolia/react-instantsearch/issues/310 // see: https://github.com/algolia/react-instantsearch/issues/637 if (searchState.indices && resetPage) { Object.keys(searchState.indices).forEach(function (targetedIndex) { searchState = refineValue(searchState, { page: 1 }, { multiIndexContext: { targetedIndex: targetedIndex } }, true, namespace); }); } return namespace ? refineSingleIndexWithNamespace(searchState, nextRefinement, resetPage, namespace) : refineSingleIndex(searchState, nextRefinement, resetPage); } } function refineMultiIndex(searchState, nextRefinement, indexId, resetPage) { var page = resetPage ? { page: 1 } : undefined; var state = searchState.indices && searchState.indices[indexId] ? _objectSpread({}, searchState.indices, _defineProperty({}, indexId, _objectSpread({}, searchState.indices[indexId], nextRefinement, page))) : _objectSpread({}, searchState.indices, _defineProperty({}, indexId, _objectSpread({}, nextRefinement, page))); return _objectSpread({}, searchState, { indices: state }); } function refineSingleIndex(searchState, nextRefinement, resetPage) { var page = resetPage ? { page: 1 } : undefined; return _objectSpread({}, searchState, nextRefinement, page); } // eslint-disable-next-line max-params function refineMultiIndexWithNamespace(searchState, nextRefinement, indexId, resetPage, namespace) { var _objectSpread4; var page = resetPage ? { page: 1 } : undefined; var state = searchState.indices && searchState.indices[indexId] ? _objectSpread({}, searchState.indices, _defineProperty({}, indexId, _objectSpread({}, searchState.indices[indexId], (_objectSpread4 = {}, _defineProperty(_objectSpread4, namespace, _objectSpread({}, searchState.indices[indexId][namespace], nextRefinement)), _defineProperty(_objectSpread4, "page", 1), _objectSpread4)))) : _objectSpread({}, searchState.indices, _defineProperty({}, indexId, _objectSpread(_defineProperty({}, namespace, nextRefinement), page))); return _objectSpread({}, searchState, { indices: state }); } function refineSingleIndexWithNamespace(searchState, nextRefinement, resetPage, namespace) { var page = resetPage ? { page: 1 } : undefined; return _objectSpread({}, searchState, _defineProperty({}, namespace, _objectSpread({}, searchState[namespace], nextRefinement)), page); } function getNamespaceAndAttributeName(id) { var parts = id.match(/^([^.]*)\.(.*)/); var namespace = parts && parts[1]; var attributeName = parts && parts[2]; return { namespace: namespace, attributeName: attributeName }; } function hasRefinements(_ref) { var multiIndex = _ref.multiIndex, indexId = _ref.indexId, namespace = _ref.namespace, attributeName = _ref.attributeName, id = _ref.id, searchState = _ref.searchState; if (multiIndex && namespace) { return searchState.indices && searchState.indices[indexId] && searchState.indices[indexId][namespace] && Object.hasOwnProperty.call(searchState.indices[indexId][namespace], attributeName); } if (multiIndex) { return searchState.indices && searchState.indices[indexId] && Object.hasOwnProperty.call(searchState.indices[indexId], id); } if (namespace) { return searchState[namespace] && Object.hasOwnProperty.call(searchState[namespace], attributeName); } return Object.hasOwnProperty.call(searchState, id); } function getRefinements(_ref2) { var multiIndex = _ref2.multiIndex, indexId = _ref2.indexId, namespace = _ref2.namespace, attributeName = _ref2.attributeName, id = _ref2.id, searchState = _ref2.searchState; if (multiIndex && namespace) { return searchState.indices[indexId][namespace][attributeName]; } if (multiIndex) { return searchState.indices[indexId][id]; } if (namespace) { return searchState[namespace][attributeName]; } return searchState[id]; } function getCurrentRefinementValue(props, searchState, context, id, defaultValue) { var indexId = getIndexId(context); var _getNamespaceAndAttri = getNamespaceAndAttributeName(id), namespace = _getNamespaceAndAttri.namespace, attributeName = _getNamespaceAndAttri.attributeName; var multiIndex = hasMultipleIndices(context); var args = { multiIndex: multiIndex, indexId: indexId, namespace: namespace, attributeName: attributeName, id: id, searchState: searchState }; var hasRefinementsValue = hasRefinements(args); if (hasRefinementsValue) { return getRefinements(args); } if (props.defaultRefinement) { return props.defaultRefinement; } return defaultValue; } function cleanUpValue(searchState, context, id) { var indexId = getIndexId(context); var _getNamespaceAndAttri2 = getNamespaceAndAttributeName(id), namespace = _getNamespaceAndAttri2.namespace, attributeName = _getNamespaceAndAttri2.attributeName; if (hasMultipleIndices(context) && Boolean(searchState.indices)) { return cleanUpValueWithMultiIndex({ attribute: attributeName, searchState: searchState, indexId: indexId, id: id, namespace: namespace }); } return cleanUpValueWithSingleIndex({ attribute: attributeName, searchState: searchState, id: id, namespace: namespace }); } function cleanUpValueWithSingleIndex(_ref3) { var searchState = _ref3.searchState, id = _ref3.id, namespace = _ref3.namespace, attribute = _ref3.attribute; if (namespace) { return _objectSpread({}, searchState, _defineProperty({}, namespace, omit(searchState[namespace], [attribute]))); } return omit(searchState, [id]); } function cleanUpValueWithMultiIndex(_ref4) { var searchState = _ref4.searchState, indexId = _ref4.indexId, id = _ref4.id, namespace = _ref4.namespace, attribute = _ref4.attribute; var indexSearchState = searchState.indices[indexId]; if (namespace && indexSearchState) { return _objectSpread({}, searchState, { indices: _objectSpread({}, searchState.indices, _defineProperty({}, indexId, _objectSpread({}, indexSearchState, _defineProperty({}, namespace, omit(indexSearchState[namespace], [attribute]))))) }); } if (indexSearchState) { return _objectSpread({}, searchState, { indices: _objectSpread({}, searchState.indices, _defineProperty({}, indexId, omit(indexSearchState, [id]))) }); } return searchState; } function getId() { return 'configure'; } var connectConfigure = createConnectorWithContext({ displayName: 'AlgoliaConfigure', getProvidedProps: function getProvidedProps() { return {}; }, getSearchParameters: function getSearchParameters(searchParameters, props) { var children = props.children, contextValue = props.contextValue, indexContextValue = props.indexContextValue, items = _objectWithoutProperties(props, ["children", "contextValue", "indexContextValue"]); return searchParameters.setQueryParameters(items); }, transitionState: function transitionState(props, prevSearchState, nextSearchState) { var id = getId(); var children = props.children, contextValue = props.contextValue, indexContextValue = props.indexContextValue, items = _objectWithoutProperties(props, ["children", "contextValue", "indexContextValue"]); var propKeys = Object.keys(props); var nonPresentKeys = this._props ? Object.keys(this._props).filter(function (prop) { return propKeys.indexOf(prop) === -1; }) : []; this._props = props; var nextValue = _defineProperty({}, id, _objectSpread({}, omit(nextSearchState[id], nonPresentKeys), items)); return refineValue(nextSearchState, nextValue, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, cleanUp: function cleanUp(props, searchState) { var id = getId(); var indexId = getIndexId({ ais: props.contextValue, multiIndexContext: props.indexContextValue }); var subState = hasMultipleIndices({ ais: props.contextValue, multiIndexContext: props.indexContextValue }) && searchState.indices ? searchState.indices[indexId] : searchState; var configureKeys = subState && subState[id] ? Object.keys(subState[id]) : []; var configureState = configureKeys.reduce(function (acc, item) { if (!props[item]) { acc[item] = subState[id][item]; } return acc; }, {}); var nextValue = _defineProperty({}, id, configureState); return refineValue(searchState, nextValue, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); } }); /** * Configure is a widget that lets you provide raw search parameters * to the Algolia API. * * Any of the props added to this widget will be forwarded to Algolia. For more information * on the different parameters that can be set, have a look at the * [reference](https://www.algolia.com/doc/api-client/javascript/search#search-parameters). * * This widget can be used either with react-dom and react-native. It will not render anything * on screen, only configure some parameters. * * Read more in the [Search parameters](guide/Search_parameters.html) guide. * @name Configure * @kind widget * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, Configure, Hits } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <Configure hitsPerPage={5} /> * <Hits /> * </InstantSearch> * ); */ var Configure = connectConfigure(function Configure() { return null; }); var global$1 = (typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}); if (typeof global$1.setTimeout === 'function') ; if (typeof global$1.clearTimeout === 'function') ; // from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js var performance = global$1.performance || {}; var performanceNow = performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow || function(){ return (new Date()).getTime() }; function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } function clone(value) { if (typeof value === 'object' && value !== null) { return _merge(Array.isArray(value) ? [] : {}, value); } return value; } function isObjectOrArrayOrFunction(value) { return ( typeof value === 'function' || Array.isArray(value) || Object.prototype.toString.call(value) === '[object Object]' ); } function _merge(target, source) { if (target === source) { return target; } for (var key in source) { if (!Object.prototype.hasOwnProperty.call(source, key)) { continue; } var sourceVal = source[key]; var targetVal = target[key]; if (typeof targetVal !== 'undefined' && typeof sourceVal === 'undefined') { continue; } if (isObjectOrArrayOrFunction(targetVal) && isObjectOrArrayOrFunction(sourceVal)) { target[key] = _merge(targetVal, sourceVal); } else { target[key] = clone(sourceVal); } } return target; } /** * This method is like Object.assign, but recursively merges own and inherited * enumerable keyed properties of source objects into the destination object. * * NOTE: this behaves like lodash/merge, but: * - does mutate functions if they are a source * - treats non-plain objects as plain * - does not work for circular objects * - treats sparse arrays as sparse * - does not convert Array-like objects (Arguments, NodeLists, etc.) to arrays * * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. */ function merge(target) { if (!isObjectOrArrayOrFunction(target)) { target = {}; } for (var i = 1, l = arguments.length; i < l; i++) { var source = arguments[i]; if (isObjectOrArrayOrFunction(source)) { _merge(target, source); } } return target; } var merge_1 = merge; // NOTE: this behaves like lodash/defaults, but doesn't mutate the target var defaultsPure = function defaultsPure() { var sources = Array.prototype.slice.call(arguments); return sources.reduceRight(function(acc, source) { Object.keys(Object(source)).forEach(function(key) { if (source[key] !== undefined) { acc[key] = source[key]; } }); return acc; }, {}); }; function intersection(arr1, arr2) { return arr1.filter(function(value, index) { return ( arr2.indexOf(value) > -1 && arr1.indexOf(value) === index /* skips duplicates */ ); }); } var intersection_1 = intersection; // @MAJOR can be replaced by native Array#find when we change support var find$1 = function find(array, comparator) { if (!Array.isArray(array)) { return undefined; } for (var i = 0; i < array.length; i++) { if (comparator(array[i])) { return array[i]; } } }; function valToNumber(v) { if (typeof v === 'number') { return v; } else if (typeof v === 'string') { return parseFloat(v); } else if (Array.isArray(v)) { return v.map(valToNumber); } throw new Error('The value should be a number, a parsable string or an array of those.'); } var valToNumber_1 = valToNumber; // https://github.com/babel/babel/blob/3aaafae053fa75febb3aa45d45b6f00646e30ba4/packages/babel-helpers/src/helpers.js#L604-L620 function _objectWithoutPropertiesLoose$1(source, excluded) { if (source === null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key; var i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var omit$1 = _objectWithoutPropertiesLoose$1; function objectHasKeys$1(obj) { return obj && Object.keys(obj).length > 0; } var objectHasKeys_1 = objectHasKeys$1; /** * Functions to manipulate refinement lists * * The RefinementList is not formally defined through a prototype but is based * on a specific structure. * * @module SearchParameters.refinementList * * @typedef {string[]} SearchParameters.refinementList.Refinements * @typedef {Object.<string, SearchParameters.refinementList.Refinements>} SearchParameters.refinementList.RefinementList */ var lib = { /** * Adds a refinement to a RefinementList * @param {RefinementList} refinementList the initial list * @param {string} attribute the attribute to refine * @param {string} value the value of the refinement, if the value is not a string it will be converted * @return {RefinementList} a new and updated refinement list */ addRefinement: function addRefinement(refinementList, attribute, value) { if (lib.isRefined(refinementList, attribute, value)) { return refinementList; } var valueAsString = '' + value; var facetRefinement = !refinementList[attribute] ? [valueAsString] : refinementList[attribute].concat(valueAsString); var mod = {}; mod[attribute] = facetRefinement; return defaultsPure({}, mod, refinementList); }, /** * Removes refinement(s) for an attribute: * - if the value is specified removes the refinement for the value on the attribute * - if no value is specified removes all the refinements for this attribute * @param {RefinementList} refinementList the initial list * @param {string} attribute the attribute to refine * @param {string} [value] the value of the refinement * @return {RefinementList} a new and updated refinement lst */ removeRefinement: function removeRefinement(refinementList, attribute, value) { if (value === undefined) { // we use the "filter" form of clearRefinement, since it leaves empty values as-is // the form with a string will remove the attribute completely return lib.clearRefinement(refinementList, function(v, f) { return attribute === f; }); } var valueAsString = '' + value; return lib.clearRefinement(refinementList, function(v, f) { return attribute === f && valueAsString === v; }); }, /** * Toggles the refinement value for an attribute. * @param {RefinementList} refinementList the initial list * @param {string} attribute the attribute to refine * @param {string} value the value of the refinement * @return {RefinementList} a new and updated list */ toggleRefinement: function toggleRefinement(refinementList, attribute, value) { if (value === undefined) throw new Error('toggleRefinement should be used with a value'); if (lib.isRefined(refinementList, attribute, value)) { return lib.removeRefinement(refinementList, attribute, value); } return lib.addRefinement(refinementList, attribute, value); }, /** * Clear all or parts of a RefinementList. Depending on the arguments, three * kinds of behavior can happen: * - if no attribute is provided: clears the whole list * - if an attribute is provided as a string: clears the list for the specific attribute * - if an attribute is provided as a function: discards the elements for which the function returns true * @param {RefinementList} refinementList the initial list * @param {string} [attribute] the attribute or function to discard * @param {string} [refinementType] optional parameter to give more context to the attribute function * @return {RefinementList} a new and updated refinement list */ clearRefinement: function clearRefinement(refinementList, attribute, refinementType) { if (attribute === undefined) { if (!objectHasKeys_1(refinementList)) { return refinementList; } return {}; } else if (typeof attribute === 'string') { return omit$1(refinementList, attribute); } else if (typeof attribute === 'function') { var hasChanged = false; var newRefinementList = Object.keys(refinementList).reduce(function(memo, key) { var values = refinementList[key] || []; var facetList = values.filter(function(value) { return !attribute(value, key, refinementType); }); if (facetList.length !== values.length) { hasChanged = true; } memo[key] = facetList; return memo; }, {}); if (hasChanged) return newRefinementList; return refinementList; } }, /** * Test if the refinement value is used for the attribute. If no refinement value * is provided, test if the refinementList contains any refinement for the * given attribute. * @param {RefinementList} refinementList the list of refinement * @param {string} attribute name of the attribute * @param {string} [refinementValue] value of the filter/refinement * @return {boolean} */ isRefined: function isRefined(refinementList, attribute, refinementValue) { var containsRefinements = !!refinementList[attribute] && refinementList[attribute].length > 0; if (refinementValue === undefined || !containsRefinements) { return containsRefinements; } var refinementValueAsString = '' + refinementValue; return refinementList[attribute].indexOf(refinementValueAsString) !== -1; } }; var RefinementList = lib; /** * isEqual, but only for numeric refinement values, possible values: * - 5 * - [5] * - [[5]] * - [[5,5],[4]] */ function isEqualNumericRefinement(a, b) { if (Array.isArray(a) && Array.isArray(b)) { return ( a.length === b.length && a.every(function(el, i) { return isEqualNumericRefinement(b[i], el); }) ); } return a === b; } /** * like _.find but using deep equality to be able to use it * to find arrays. * @private * @param {any[]} array array to search into (elements are base or array of base) * @param {any} searchedValue the value we're looking for (base or array of base) * @return {any} the searched value or undefined */ function findArray(array, searchedValue) { return find$1(array, function(currentValue) { return isEqualNumericRefinement(currentValue, searchedValue); }); } /** * The facet list is the structure used to store the list of values used to * filter a single attribute. * @typedef {string[]} SearchParameters.FacetList */ /** * Structure to store numeric filters with the operator as the key. The supported operators * are `=`, `>`, `<`, `>=`, `<=` and `!=`. * @typedef {Object.<string, Array.<number|number[]>>} SearchParameters.OperatorList */ /** * SearchParameters is the data structure that contains all the information * usable for making a search to Algolia API. It doesn't do the search itself, * nor does it contains logic about the parameters. * It is an immutable object, therefore it has been created in a way that each * changes does not change the object itself but returns a copy with the * modification. * This object should probably not be instantiated outside of the helper. It will * be provided when needed. This object is documented for reference as you'll * get it from events generated by the {@link AlgoliaSearchHelper}. * If need be, instantiate the Helper from the factory function {@link SearchParameters.make} * @constructor * @classdesc contains all the parameters of a search * @param {object|SearchParameters} newParameters existing parameters or partial object * for the properties of a new SearchParameters * @see SearchParameters.make * @example <caption>SearchParameters of the first query in * <a href="http://demos.algolia.com/instant-search-demo/">the instant search demo</a></caption> { "query": "", "disjunctiveFacets": [ "customerReviewCount", "category", "salePrice_range", "manufacturer" ], "maxValuesPerFacet": 30, "page": 0, "hitsPerPage": 10, "facets": [ "type", "shipping" ] } */ function SearchParameters(newParameters) { var params = newParameters ? SearchParameters._parseNumbers(newParameters) : {}; /** * This attribute contains the list of all the conjunctive facets * used. This list will be added to requested facets in the * [facets attribute](https://www.algolia.com/doc/rest-api/search#param-facets) sent to algolia. * @member {string[]} */ this.facets = params.facets || []; /** * This attribute contains the list of all the disjunctive facets * used. This list will be added to requested facets in the * [facets attribute](https://www.algolia.com/doc/rest-api/search#param-facets) sent to algolia. * @member {string[]} */ this.disjunctiveFacets = params.disjunctiveFacets || []; /** * This attribute contains the list of all the hierarchical facets * used. This list will be added to requested facets in the * [facets attribute](https://www.algolia.com/doc/rest-api/search#param-facets) sent to algolia. * Hierarchical facets are a sub type of disjunctive facets that * let you filter faceted attributes hierarchically. * @member {string[]|object[]} */ this.hierarchicalFacets = params.hierarchicalFacets || []; // Refinements /** * This attribute contains all the filters that need to be * applied on the conjunctive facets. Each facet must be properly * defined in the `facets` attribute. * * The key is the name of the facet, and the `FacetList` contains all * filters selected for the associated facet name. * * When querying algolia, the values stored in this attribute will * be translated into the `facetFilters` attribute. * @member {Object.<string, SearchParameters.FacetList>} */ this.facetsRefinements = params.facetsRefinements || {}; /** * This attribute contains all the filters that need to be * excluded from the conjunctive facets. Each facet must be properly * defined in the `facets` attribute. * * The key is the name of the facet, and the `FacetList` contains all * filters excluded for the associated facet name. * * When querying algolia, the values stored in this attribute will * be translated into the `facetFilters` attribute. * @member {Object.<string, SearchParameters.FacetList>} */ this.facetsExcludes = params.facetsExcludes || {}; /** * This attribute contains all the filters that need to be * applied on the disjunctive facets. Each facet must be properly * defined in the `disjunctiveFacets` attribute. * * The key is the name of the facet, and the `FacetList` contains all * filters selected for the associated facet name. * * When querying algolia, the values stored in this attribute will * be translated into the `facetFilters` attribute. * @member {Object.<string, SearchParameters.FacetList>} */ this.disjunctiveFacetsRefinements = params.disjunctiveFacetsRefinements || {}; /** * This attribute contains all the filters that need to be * applied on the numeric attributes. * * The key is the name of the attribute, and the value is the * filters to apply to this attribute. * * When querying algolia, the values stored in this attribute will * be translated into the `numericFilters` attribute. * @member {Object.<string, SearchParameters.OperatorList>} */ this.numericRefinements = params.numericRefinements || {}; /** * This attribute contains all the tags used to refine the query. * * When querying algolia, the values stored in this attribute will * be translated into the `tagFilters` attribute. * @member {string[]} */ this.tagRefinements = params.tagRefinements || []; /** * This attribute contains all the filters that need to be * applied on the hierarchical facets. Each facet must be properly * defined in the `hierarchicalFacets` attribute. * * The key is the name of the facet, and the `FacetList` contains all * filters selected for the associated facet name. The FacetList values * are structured as a string that contain the values for each level * separated by the configured separator. * * When querying algolia, the values stored in this attribute will * be translated into the `facetFilters` attribute. * @member {Object.<string, SearchParameters.FacetList>} */ this.hierarchicalFacetsRefinements = params.hierarchicalFacetsRefinements || {}; var self = this; Object.keys(params).forEach(function(paramName) { var isKeyKnown = SearchParameters.PARAMETERS.indexOf(paramName) !== -1; var isValueDefined = params[paramName] !== undefined; if (!isKeyKnown && isValueDefined) { self[paramName] = params[paramName]; } }); } /** * List all the properties in SearchParameters and therefore all the known Algolia properties * This doesn't contain any beta/hidden features. * @private */ SearchParameters.PARAMETERS = Object.keys(new SearchParameters()); /** * @private * @param {object} partialState full or part of a state * @return {object} a new object with the number keys as number */ SearchParameters._parseNumbers = function(partialState) { // Do not reparse numbers in SearchParameters, they ought to be parsed already if (partialState instanceof SearchParameters) return partialState; var numbers = {}; var numberKeys = [ 'aroundPrecision', 'aroundRadius', 'getRankingInfo', 'minWordSizefor2Typos', 'minWordSizefor1Typo', 'page', 'maxValuesPerFacet', 'distinct', 'minimumAroundRadius', 'hitsPerPage', 'minProximity' ]; numberKeys.forEach(function(k) { var value = partialState[k]; if (typeof value === 'string') { var parsedValue = parseFloat(value); // global isNaN is ok to use here, value is only number or NaN numbers[k] = isNaN(parsedValue) ? value : parsedValue; } }); // there's two formats of insideBoundingBox, we need to parse // the one which is an array of float geo rectangles if (Array.isArray(partialState.insideBoundingBox)) { numbers.insideBoundingBox = partialState.insideBoundingBox.map(function(geoRect) { return geoRect.map(function(value) { return parseFloat(value); }); }); } if (partialState.numericRefinements) { var numericRefinements = {}; Object.keys(partialState.numericRefinements).forEach(function(attribute) { var operators = partialState.numericRefinements[attribute] || {}; numericRefinements[attribute] = {}; Object.keys(operators).forEach(function(operator) { var values = operators[operator]; var parsedValues = values.map(function(v) { if (Array.isArray(v)) { return v.map(function(vPrime) { if (typeof vPrime === 'string') { return parseFloat(vPrime); } return vPrime; }); } else if (typeof v === 'string') { return parseFloat(v); } return v; }); numericRefinements[attribute][operator] = parsedValues; }); }); numbers.numericRefinements = numericRefinements; } return merge_1({}, partialState, numbers); }; /** * Factory for SearchParameters * @param {object|SearchParameters} newParameters existing parameters or partial * object for the properties of a new SearchParameters * @return {SearchParameters} frozen instance of SearchParameters */ SearchParameters.make = function makeSearchParameters(newParameters) { var instance = new SearchParameters(newParameters); var hierarchicalFacets = newParameters.hierarchicalFacets || []; hierarchicalFacets.forEach(function(facet) { if (facet.rootPath) { var currentRefinement = instance.getHierarchicalRefinement(facet.name); if (currentRefinement.length > 0 && currentRefinement[0].indexOf(facet.rootPath) !== 0) { instance = instance.clearRefinements(facet.name); } // get it again in case it has been cleared currentRefinement = instance.getHierarchicalRefinement(facet.name); if (currentRefinement.length === 0) { instance = instance.toggleHierarchicalFacetRefinement(facet.name, facet.rootPath); } } }); return instance; }; /** * Validates the new parameters based on the previous state * @param {SearchParameters} currentState the current state * @param {object|SearchParameters} parameters the new parameters to set * @return {Error|null} Error if the modification is invalid, null otherwise */ SearchParameters.validate = function(currentState, parameters) { var params = parameters || {}; if (currentState.tagFilters && params.tagRefinements && params.tagRefinements.length > 0) { return new Error( '[Tags] Cannot switch from the managed tag API to the advanced API. It is probably ' + 'an error, if it is really what you want, you should first clear the tags with clearTags method.'); } if (currentState.tagRefinements.length > 0 && params.tagFilters) { return new Error( '[Tags] Cannot switch from the advanced tag API to the managed API. It is probably ' + 'an error, if it is not, you should first clear the tags with clearTags method.'); } if ( currentState.numericFilters && params.numericRefinements && objectHasKeys_1(params.numericRefinements) ) { return new Error( "[Numeric filters] Can't switch from the advanced to the managed API. It" + ' is probably an error, if this is really what you want, you have to first' + ' clear the numeric filters.' ); } if (objectHasKeys_1(currentState.numericRefinements) && params.numericFilters) { return new Error( "[Numeric filters] Can't switch from the managed API to the advanced. It" + ' is probably an error, if this is really what you want, you have to first' + ' clear the numeric filters.'); } return null; }; SearchParameters.prototype = { constructor: SearchParameters, /** * Remove all refinements (disjunctive + conjunctive + excludes + numeric filters) * @method * @param {undefined|string|SearchParameters.clearCallback} [attribute] optional string or function * - If not given, means to clear all the filters. * - If `string`, means to clear all refinements for the `attribute` named filter. * - If `function`, means to clear all the refinements that return truthy values. * @return {SearchParameters} */ clearRefinements: function clearRefinements(attribute) { var patch = { numericRefinements: this._clearNumericRefinements(attribute), facetsRefinements: RefinementList.clearRefinement( this.facetsRefinements, attribute, 'conjunctiveFacet' ), facetsExcludes: RefinementList.clearRefinement( this.facetsExcludes, attribute, 'exclude' ), disjunctiveFacetsRefinements: RefinementList.clearRefinement( this.disjunctiveFacetsRefinements, attribute, 'disjunctiveFacet' ), hierarchicalFacetsRefinements: RefinementList.clearRefinement( this.hierarchicalFacetsRefinements, attribute, 'hierarchicalFacet' ) }; if ( patch.numericRefinements === this.numericRefinements && patch.facetsRefinements === this.facetsRefinements && patch.facetsExcludes === this.facetsExcludes && patch.disjunctiveFacetsRefinements === this.disjunctiveFacetsRefinements && patch.hierarchicalFacetsRefinements === this.hierarchicalFacetsRefinements ) { return this; } return this.setQueryParameters(patch); }, /** * Remove all the refined tags from the SearchParameters * @method * @return {SearchParameters} */ clearTags: function clearTags() { if (this.tagFilters === undefined && this.tagRefinements.length === 0) return this; return this.setQueryParameters({ tagFilters: undefined, tagRefinements: [] }); }, /** * Set the index. * @method * @param {string} index the index name * @return {SearchParameters} */ setIndex: function setIndex(index) { if (index === this.index) return this; return this.setQueryParameters({ index: index }); }, /** * Query setter * @method * @param {string} newQuery value for the new query * @return {SearchParameters} */ setQuery: function setQuery(newQuery) { if (newQuery === this.query) return this; return this.setQueryParameters({ query: newQuery }); }, /** * Page setter * @method * @param {number} newPage new page number * @return {SearchParameters} */ setPage: function setPage(newPage) { if (newPage === this.page) return this; return this.setQueryParameters({ page: newPage }); }, /** * Facets setter * The facets are the simple facets, used for conjunctive (and) faceting. * @method * @param {string[]} facets all the attributes of the algolia records used for conjunctive faceting * @return {SearchParameters} */ setFacets: function setFacets(facets) { return this.setQueryParameters({ facets: facets }); }, /** * Disjunctive facets setter * Change the list of disjunctive (or) facets the helper chan handle. * @method * @param {string[]} facets all the attributes of the algolia records used for disjunctive faceting * @return {SearchParameters} */ setDisjunctiveFacets: function setDisjunctiveFacets(facets) { return this.setQueryParameters({ disjunctiveFacets: facets }); }, /** * HitsPerPage setter * Hits per page represents the number of hits retrieved for this query * @method * @param {number} n number of hits retrieved per page of results * @return {SearchParameters} */ setHitsPerPage: function setHitsPerPage(n) { if (this.hitsPerPage === n) return this; return this.setQueryParameters({ hitsPerPage: n }); }, /** * typoTolerance setter * Set the value of typoTolerance * @method * @param {string} typoTolerance new value of typoTolerance ("true", "false", "min" or "strict") * @return {SearchParameters} */ setTypoTolerance: function setTypoTolerance(typoTolerance) { if (this.typoTolerance === typoTolerance) return this; return this.setQueryParameters({ typoTolerance: typoTolerance }); }, /** * Add a numeric filter for a given attribute * When value is an array, they are combined with OR * When value is a single value, it will combined with AND * @method * @param {string} attribute attribute to set the filter on * @param {string} operator operator of the filter (possible values: =, >, >=, <, <=, !=) * @param {number | number[]} value value of the filter * @return {SearchParameters} * @example * // for price = 50 or 40 * searchparameter.addNumericRefinement('price', '=', [50, 40]); * @example * // for size = 38 and 40 * searchparameter.addNumericRefinement('size', '=', 38); * searchparameter.addNumericRefinement('size', '=', 40); */ addNumericRefinement: function(attribute, operator, v) { var value = valToNumber_1(v); if (this.isNumericRefined(attribute, operator, value)) return this; var mod = merge_1({}, this.numericRefinements); mod[attribute] = merge_1({}, mod[attribute]); if (mod[attribute][operator]) { // Array copy mod[attribute][operator] = mod[attribute][operator].slice(); // Add the element. Concat can't be used here because value can be an array. mod[attribute][operator].push(value); } else { mod[attribute][operator] = [value]; } return this.setQueryParameters({ numericRefinements: mod }); }, /** * Get the list of conjunctive refinements for a single facet * @param {string} facetName name of the attribute used for faceting * @return {string[]} list of refinements */ getConjunctiveRefinements: function(facetName) { if (!this.isConjunctiveFacet(facetName)) { return []; } return this.facetsRefinements[facetName] || []; }, /** * Get the list of disjunctive refinements for a single facet * @param {string} facetName name of the attribute used for faceting * @return {string[]} list of refinements */ getDisjunctiveRefinements: function(facetName) { if (!this.isDisjunctiveFacet(facetName)) { return []; } return this.disjunctiveFacetsRefinements[facetName] || []; }, /** * Get the list of hierarchical refinements for a single facet * @param {string} facetName name of the attribute used for faceting * @return {string[]} list of refinements */ getHierarchicalRefinement: function(facetName) { // we send an array but we currently do not support multiple // hierarchicalRefinements for a hierarchicalFacet return this.hierarchicalFacetsRefinements[facetName] || []; }, /** * Get the list of exclude refinements for a single facet * @param {string} facetName name of the attribute used for faceting * @return {string[]} list of refinements */ getExcludeRefinements: function(facetName) { if (!this.isConjunctiveFacet(facetName)) { return []; } return this.facetsExcludes[facetName] || []; }, /** * Remove all the numeric filter for a given (attribute, operator) * @method * @param {string} attribute attribute to set the filter on * @param {string} [operator] operator of the filter (possible values: =, >, >=, <, <=, !=) * @param {number} [number] the value to be removed * @return {SearchParameters} */ removeNumericRefinement: function(attribute, operator, paramValue) { if (paramValue !== undefined) { if (!this.isNumericRefined(attribute, operator, paramValue)) { return this; } return this.setQueryParameters({ numericRefinements: this._clearNumericRefinements(function(value, key) { return ( key === attribute && value.op === operator && isEqualNumericRefinement(value.val, valToNumber_1(paramValue)) ); }) }); } else if (operator !== undefined) { if (!this.isNumericRefined(attribute, operator)) return this; return this.setQueryParameters({ numericRefinements: this._clearNumericRefinements(function(value, key) { return key === attribute && value.op === operator; }) }); } if (!this.isNumericRefined(attribute)) return this; return this.setQueryParameters({ numericRefinements: this._clearNumericRefinements(function(value, key) { return key === attribute; }) }); }, /** * Get the list of numeric refinements for a single facet * @param {string} facetName name of the attribute used for faceting * @return {SearchParameters.OperatorList[]} list of refinements */ getNumericRefinements: function(facetName) { return this.numericRefinements[facetName] || {}; }, /** * Return the current refinement for the (attribute, operator) * @param {string} attribute attribute in the record * @param {string} operator operator applied on the refined values * @return {Array.<number|number[]>} refined values */ getNumericRefinement: function(attribute, operator) { return this.numericRefinements[attribute] && this.numericRefinements[attribute][operator]; }, /** * Clear numeric filters. * @method * @private * @param {string|SearchParameters.clearCallback} [attribute] optional string or function * - If not given, means to clear all the filters. * - If `string`, means to clear all refinements for the `attribute` named filter. * - If `function`, means to clear all the refinements that return truthy values. * @return {Object.<string, OperatorList>} */ _clearNumericRefinements: function _clearNumericRefinements(attribute) { if (attribute === undefined) { if (!objectHasKeys_1(this.numericRefinements)) { return this.numericRefinements; } return {}; } else if (typeof attribute === 'string') { if (!objectHasKeys_1(this.numericRefinements[attribute])) { return this.numericRefinements; } return omit$1(this.numericRefinements, attribute); } else if (typeof attribute === 'function') { var hasChanged = false; var numericRefinements = this.numericRefinements; var newNumericRefinements = Object.keys(numericRefinements).reduce(function(memo, key) { var operators = numericRefinements[key]; var operatorList = {}; operators = operators || {}; Object.keys(operators).forEach(function(operator) { var values = operators[operator] || []; var outValues = []; values.forEach(function(value) { var predicateResult = attribute({val: value, op: operator}, key, 'numeric'); if (!predicateResult) outValues.push(value); }); if (outValues.length !== values.length) { hasChanged = true; } operatorList[operator] = outValues; }); memo[key] = operatorList; return memo; }, {}); if (hasChanged) return newNumericRefinements; return this.numericRefinements; } }, /** * Add a facet to the facets attribute of the helper configuration, if it * isn't already present. * @method * @param {string} facet facet name to add * @return {SearchParameters} */ addFacet: function addFacet(facet) { if (this.isConjunctiveFacet(facet)) { return this; } return this.setQueryParameters({ facets: this.facets.concat([facet]) }); }, /** * Add a disjunctive facet to the disjunctiveFacets attribute of the helper * configuration, if it isn't already present. * @method * @param {string} facet disjunctive facet name to add * @return {SearchParameters} */ addDisjunctiveFacet: function addDisjunctiveFacet(facet) { if (this.isDisjunctiveFacet(facet)) { return this; } return this.setQueryParameters({ disjunctiveFacets: this.disjunctiveFacets.concat([facet]) }); }, /** * Add a hierarchical facet to the hierarchicalFacets attribute of the helper * configuration. * @method * @param {object} hierarchicalFacet hierarchical facet to add * @return {SearchParameters} * @throws will throw an error if a hierarchical facet with the same name was already declared */ addHierarchicalFacet: function addHierarchicalFacet(hierarchicalFacet) { if (this.isHierarchicalFacet(hierarchicalFacet.name)) { throw new Error( 'Cannot declare two hierarchical facets with the same name: `' + hierarchicalFacet.name + '`'); } return this.setQueryParameters({ hierarchicalFacets: this.hierarchicalFacets.concat([hierarchicalFacet]) }); }, /** * Add a refinement on a "normal" facet * @method * @param {string} facet attribute to apply the faceting on * @param {string} value value of the attribute (will be converted to string) * @return {SearchParameters} */ addFacetRefinement: function addFacetRefinement(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } if (RefinementList.isRefined(this.facetsRefinements, facet, value)) return this; return this.setQueryParameters({ facetsRefinements: RefinementList.addRefinement(this.facetsRefinements, facet, value) }); }, /** * Exclude a value from a "normal" facet * @method * @param {string} facet attribute to apply the exclusion on * @param {string} value value of the attribute (will be converted to string) * @return {SearchParameters} */ addExcludeRefinement: function addExcludeRefinement(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } if (RefinementList.isRefined(this.facetsExcludes, facet, value)) return this; return this.setQueryParameters({ facetsExcludes: RefinementList.addRefinement(this.facetsExcludes, facet, value) }); }, /** * Adds a refinement on a disjunctive facet. * @method * @param {string} facet attribute to apply the faceting on * @param {string} value value of the attribute (will be converted to string) * @return {SearchParameters} */ addDisjunctiveFacetRefinement: function addDisjunctiveFacetRefinement(facet, value) { if (!this.isDisjunctiveFacet(facet)) { throw new Error( facet + ' is not defined in the disjunctiveFacets attribute of the helper configuration'); } if (RefinementList.isRefined(this.disjunctiveFacetsRefinements, facet, value)) return this; return this.setQueryParameters({ disjunctiveFacetsRefinements: RefinementList.addRefinement( this.disjunctiveFacetsRefinements, facet, value) }); }, /** * addTagRefinement adds a tag to the list used to filter the results * @param {string} tag tag to be added * @return {SearchParameters} */ addTagRefinement: function addTagRefinement(tag) { if (this.isTagRefined(tag)) return this; var modification = { tagRefinements: this.tagRefinements.concat(tag) }; return this.setQueryParameters(modification); }, /** * Remove a facet from the facets attribute of the helper configuration, if it * is present. * @method * @param {string} facet facet name to remove * @return {SearchParameters} */ removeFacet: function removeFacet(facet) { if (!this.isConjunctiveFacet(facet)) { return this; } return this.clearRefinements(facet).setQueryParameters({ facets: this.facets.filter(function(f) { return f !== facet; }) }); }, /** * Remove a disjunctive facet from the disjunctiveFacets attribute of the * helper configuration, if it is present. * @method * @param {string} facet disjunctive facet name to remove * @return {SearchParameters} */ removeDisjunctiveFacet: function removeDisjunctiveFacet(facet) { if (!this.isDisjunctiveFacet(facet)) { return this; } return this.clearRefinements(facet).setQueryParameters({ disjunctiveFacets: this.disjunctiveFacets.filter(function(f) { return f !== facet; }) }); }, /** * Remove a hierarchical facet from the hierarchicalFacets attribute of the * helper configuration, if it is present. * @method * @param {string} facet hierarchical facet name to remove * @return {SearchParameters} */ removeHierarchicalFacet: function removeHierarchicalFacet(facet) { if (!this.isHierarchicalFacet(facet)) { return this; } return this.clearRefinements(facet).setQueryParameters({ hierarchicalFacets: this.hierarchicalFacets.filter(function(f) { return f.name !== facet; }) }); }, /** * Remove a refinement set on facet. If a value is provided, it will clear the * refinement for the given value, otherwise it will clear all the refinement * values for the faceted attribute. * @method * @param {string} facet name of the attribute used for faceting * @param {string} [value] value used to filter * @return {SearchParameters} */ removeFacetRefinement: function removeFacetRefinement(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } if (!RefinementList.isRefined(this.facetsRefinements, facet, value)) return this; return this.setQueryParameters({ facetsRefinements: RefinementList.removeRefinement(this.facetsRefinements, facet, value) }); }, /** * Remove a negative refinement on a facet * @method * @param {string} facet name of the attribute used for faceting * @param {string} value value used to filter * @return {SearchParameters} */ removeExcludeRefinement: function removeExcludeRefinement(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } if (!RefinementList.isRefined(this.facetsExcludes, facet, value)) return this; return this.setQueryParameters({ facetsExcludes: RefinementList.removeRefinement(this.facetsExcludes, facet, value) }); }, /** * Remove a refinement on a disjunctive facet * @method * @param {string} facet name of the attribute used for faceting * @param {string} value value used to filter * @return {SearchParameters} */ removeDisjunctiveFacetRefinement: function removeDisjunctiveFacetRefinement(facet, value) { if (!this.isDisjunctiveFacet(facet)) { throw new Error( facet + ' is not defined in the disjunctiveFacets attribute of the helper configuration'); } if (!RefinementList.isRefined(this.disjunctiveFacetsRefinements, facet, value)) return this; return this.setQueryParameters({ disjunctiveFacetsRefinements: RefinementList.removeRefinement( this.disjunctiveFacetsRefinements, facet, value) }); }, /** * Remove a tag from the list of tag refinements * @method * @param {string} tag the tag to remove * @return {SearchParameters} */ removeTagRefinement: function removeTagRefinement(tag) { if (!this.isTagRefined(tag)) return this; var modification = { tagRefinements: this.tagRefinements.filter(function(t) { return t !== tag; }) }; return this.setQueryParameters(modification); }, /** * Generic toggle refinement method to use with facet, disjunctive facets * and hierarchical facets * @param {string} facet the facet to refine * @param {string} value the associated value * @return {SearchParameters} * @throws will throw an error if the facet is not declared in the settings of the helper * @deprecated since version 2.19.0, see {@link SearchParameters#toggleFacetRefinement} */ toggleRefinement: function toggleRefinement(facet, value) { return this.toggleFacetRefinement(facet, value); }, /** * Generic toggle refinement method to use with facet, disjunctive facets * and hierarchical facets * @param {string} facet the facet to refine * @param {string} value the associated value * @return {SearchParameters} * @throws will throw an error if the facet is not declared in the settings of the helper */ toggleFacetRefinement: function toggleFacetRefinement(facet, value) { if (this.isHierarchicalFacet(facet)) { return this.toggleHierarchicalFacetRefinement(facet, value); } else if (this.isConjunctiveFacet(facet)) { return this.toggleConjunctiveFacetRefinement(facet, value); } else if (this.isDisjunctiveFacet(facet)) { return this.toggleDisjunctiveFacetRefinement(facet, value); } throw new Error('Cannot refine the undeclared facet ' + facet + '; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets'); }, /** * Switch the refinement applied over a facet/value * @method * @param {string} facet name of the attribute used for faceting * @param {value} value value used for filtering * @return {SearchParameters} */ toggleConjunctiveFacetRefinement: function toggleConjunctiveFacetRefinement(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } return this.setQueryParameters({ facetsRefinements: RefinementList.toggleRefinement(this.facetsRefinements, facet, value) }); }, /** * Switch the refinement applied over a facet/value * @method * @param {string} facet name of the attribute used for faceting * @param {value} value value used for filtering * @return {SearchParameters} */ toggleExcludeFacetRefinement: function toggleExcludeFacetRefinement(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } return this.setQueryParameters({ facetsExcludes: RefinementList.toggleRefinement(this.facetsExcludes, facet, value) }); }, /** * Switch the refinement applied over a facet/value * @method * @param {string} facet name of the attribute used for faceting * @param {value} value value used for filtering * @return {SearchParameters} */ toggleDisjunctiveFacetRefinement: function toggleDisjunctiveFacetRefinement(facet, value) { if (!this.isDisjunctiveFacet(facet)) { throw new Error( facet + ' is not defined in the disjunctiveFacets attribute of the helper configuration'); } return this.setQueryParameters({ disjunctiveFacetsRefinements: RefinementList.toggleRefinement( this.disjunctiveFacetsRefinements, facet, value) }); }, /** * Switch the refinement applied over a facet/value * @method * @param {string} facet name of the attribute used for faceting * @param {value} value value used for filtering * @return {SearchParameters} */ toggleHierarchicalFacetRefinement: function toggleHierarchicalFacetRefinement(facet, value) { if (!this.isHierarchicalFacet(facet)) { throw new Error( facet + ' is not defined in the hierarchicalFacets attribute of the helper configuration'); } var separator = this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(facet)); var mod = {}; var upOneOrMultipleLevel = this.hierarchicalFacetsRefinements[facet] !== undefined && this.hierarchicalFacetsRefinements[facet].length > 0 && ( // remove current refinement: // refinement was 'beer > IPA', call is toggleRefine('beer > IPA'), refinement should be `beer` this.hierarchicalFacetsRefinements[facet][0] === value || // remove a parent refinement of the current refinement: // - refinement was 'beer > IPA > Flying dog' // - call is toggleRefine('beer > IPA') // - refinement should be `beer` this.hierarchicalFacetsRefinements[facet][0].indexOf(value + separator) === 0 ); if (upOneOrMultipleLevel) { if (value.indexOf(separator) === -1) { // go back to root level mod[facet] = []; } else { mod[facet] = [value.slice(0, value.lastIndexOf(separator))]; } } else { mod[facet] = [value]; } return this.setQueryParameters({ hierarchicalFacetsRefinements: defaultsPure({}, mod, this.hierarchicalFacetsRefinements) }); }, /** * Adds a refinement on a hierarchical facet. * @param {string} facet the facet name * @param {string} path the hierarchical facet path * @return {SearchParameter} the new state * @throws Error if the facet is not defined or if the facet is refined */ addHierarchicalFacetRefinement: function(facet, path) { if (this.isHierarchicalFacetRefined(facet)) { throw new Error(facet + ' is already refined.'); } if (!this.isHierarchicalFacet(facet)) { throw new Error(facet + ' is not defined in the hierarchicalFacets attribute of the helper configuration.'); } var mod = {}; mod[facet] = [path]; return this.setQueryParameters({ hierarchicalFacetsRefinements: defaultsPure({}, mod, this.hierarchicalFacetsRefinements) }); }, /** * Removes the refinement set on a hierarchical facet. * @param {string} facet the facet name * @return {SearchParameter} the new state * @throws Error if the facet is not defined or if the facet is not refined */ removeHierarchicalFacetRefinement: function(facet) { if (!this.isHierarchicalFacetRefined(facet)) { return this; } var mod = {}; mod[facet] = []; return this.setQueryParameters({ hierarchicalFacetsRefinements: defaultsPure({}, mod, this.hierarchicalFacetsRefinements) }); }, /** * Switch the tag refinement * @method * @param {string} tag the tag to remove or add * @return {SearchParameters} */ toggleTagRefinement: function toggleTagRefinement(tag) { if (this.isTagRefined(tag)) { return this.removeTagRefinement(tag); } return this.addTagRefinement(tag); }, /** * Test if the facet name is from one of the disjunctive facets * @method * @param {string} facet facet name to test * @return {boolean} */ isDisjunctiveFacet: function(facet) { return this.disjunctiveFacets.indexOf(facet) > -1; }, /** * Test if the facet name is from one of the hierarchical facets * @method * @param {string} facetName facet name to test * @return {boolean} */ isHierarchicalFacet: function(facetName) { return this.getHierarchicalFacetByName(facetName) !== undefined; }, /** * Test if the facet name is from one of the conjunctive/normal facets * @method * @param {string} facet facet name to test * @return {boolean} */ isConjunctiveFacet: function(facet) { return this.facets.indexOf(facet) > -1; }, /** * Returns true if the facet is refined, either for a specific value or in * general. * @method * @param {string} facet name of the attribute for used for faceting * @param {string} value, optional value. If passed will test that this value * is filtering the given facet. * @return {boolean} returns true if refined */ isFacetRefined: function isFacetRefined(facet, value) { if (!this.isConjunctiveFacet(facet)) { return false; } return RefinementList.isRefined(this.facetsRefinements, facet, value); }, /** * Returns true if the facet contains exclusions or if a specific value is * excluded. * * @method * @param {string} facet name of the attribute for used for faceting * @param {string} [value] optional value. If passed will test that this value * is filtering the given facet. * @return {boolean} returns true if refined */ isExcludeRefined: function isExcludeRefined(facet, value) { if (!this.isConjunctiveFacet(facet)) { return false; } return RefinementList.isRefined(this.facetsExcludes, facet, value); }, /** * Returns true if the facet contains a refinement, or if a value passed is a * refinement for the facet. * @method * @param {string} facet name of the attribute for used for faceting * @param {string} value optional, will test if the value is used for refinement * if there is one, otherwise will test if the facet contains any refinement * @return {boolean} */ isDisjunctiveFacetRefined: function isDisjunctiveFacetRefined(facet, value) { if (!this.isDisjunctiveFacet(facet)) { return false; } return RefinementList.isRefined(this.disjunctiveFacetsRefinements, facet, value); }, /** * Returns true if the facet contains a refinement, or if a value passed is a * refinement for the facet. * @method * @param {string} facet name of the attribute for used for faceting * @param {string} value optional, will test if the value is used for refinement * if there is one, otherwise will test if the facet contains any refinement * @return {boolean} */ isHierarchicalFacetRefined: function isHierarchicalFacetRefined(facet, value) { if (!this.isHierarchicalFacet(facet)) { return false; } var refinements = this.getHierarchicalRefinement(facet); if (!value) { return refinements.length > 0; } return refinements.indexOf(value) !== -1; }, /** * Test if the triple (attribute, operator, value) is already refined. * If only the attribute and the operator are provided, it tests if the * contains any refinement value. * @method * @param {string} attribute attribute for which the refinement is applied * @param {string} [operator] operator of the refinement * @param {string} [value] value of the refinement * @return {boolean} true if it is refined */ isNumericRefined: function isNumericRefined(attribute, operator, value) { if (value === undefined && operator === undefined) { return !!this.numericRefinements[attribute]; } var isOperatorDefined = this.numericRefinements[attribute] && this.numericRefinements[attribute][operator] !== undefined; if (value === undefined || !isOperatorDefined) { return isOperatorDefined; } var parsedValue = valToNumber_1(value); var isAttributeValueDefined = findArray(this.numericRefinements[attribute][operator], parsedValue) !== undefined; return isOperatorDefined && isAttributeValueDefined; }, /** * Returns true if the tag refined, false otherwise * @method * @param {string} tag the tag to check * @return {boolean} */ isTagRefined: function isTagRefined(tag) { return this.tagRefinements.indexOf(tag) !== -1; }, /** * Returns the list of all disjunctive facets refined * @method * @param {string} facet name of the attribute used for faceting * @param {value} value value used for filtering * @return {string[]} */ getRefinedDisjunctiveFacets: function getRefinedDisjunctiveFacets() { var self = this; // attributes used for numeric filter can also be disjunctive var disjunctiveNumericRefinedFacets = intersection_1( Object.keys(this.numericRefinements).filter(function(facet) { return Object.keys(self.numericRefinements[facet]).length > 0; }), this.disjunctiveFacets ); return Object.keys(this.disjunctiveFacetsRefinements).filter(function(facet) { return self.disjunctiveFacetsRefinements[facet].length > 0; }) .concat(disjunctiveNumericRefinedFacets) .concat(this.getRefinedHierarchicalFacets()); }, /** * Returns the list of all disjunctive facets refined * @method * @param {string} facet name of the attribute used for faceting * @param {value} value value used for filtering * @return {string[]} */ getRefinedHierarchicalFacets: function getRefinedHierarchicalFacets() { var self = this; return intersection_1( // enforce the order between the two arrays, // so that refinement name index === hierarchical facet index this.hierarchicalFacets.map(function(facet) { return facet.name; }), Object.keys(this.hierarchicalFacetsRefinements).filter(function(facet) { return self.hierarchicalFacetsRefinements[facet].length > 0; }) ); }, /** * Returned the list of all disjunctive facets not refined * @method * @return {string[]} */ getUnrefinedDisjunctiveFacets: function() { var refinedFacets = this.getRefinedDisjunctiveFacets(); return this.disjunctiveFacets.filter(function(f) { return refinedFacets.indexOf(f) === -1; }); }, managedParameters: [ 'index', 'facets', 'disjunctiveFacets', 'facetsRefinements', 'facetsExcludes', 'disjunctiveFacetsRefinements', 'numericRefinements', 'tagRefinements', 'hierarchicalFacets', 'hierarchicalFacetsRefinements' ], getQueryParams: function getQueryParams() { var managedParameters = this.managedParameters; var queryParams = {}; var self = this; Object.keys(this).forEach(function(paramName) { var paramValue = self[paramName]; if (managedParameters.indexOf(paramName) === -1 && paramValue !== undefined) { queryParams[paramName] = paramValue; } }); return queryParams; }, /** * Let the user set a specific value for a given parameter. Will return the * same instance if the parameter is invalid or if the value is the same as the * previous one. * @method * @param {string} parameter the parameter name * @param {any} value the value to be set, must be compliant with the definition * of the attribute on the object * @return {SearchParameters} the updated state */ setQueryParameter: function setParameter(parameter, value) { if (this[parameter] === value) return this; var modification = {}; modification[parameter] = value; return this.setQueryParameters(modification); }, /** * Let the user set any of the parameters with a plain object. * @method * @param {object} params all the keys and the values to be updated * @return {SearchParameters} a new updated instance */ setQueryParameters: function setQueryParameters(params) { if (!params) return this; var error = SearchParameters.validate(this, params); if (error) { throw error; } var self = this; var nextWithNumbers = SearchParameters._parseNumbers(params); var previousPlainObject = Object.keys(this).reduce(function(acc, key) { acc[key] = self[key]; return acc; }, {}); var nextPlainObject = Object.keys(nextWithNumbers).reduce( function(previous, key) { var isPreviousValueDefined = previous[key] !== undefined; var isNextValueDefined = nextWithNumbers[key] !== undefined; if (isPreviousValueDefined && !isNextValueDefined) { return omit$1(previous, [key]); } if (isNextValueDefined) { previous[key] = nextWithNumbers[key]; } return previous; }, previousPlainObject ); return new this.constructor(nextPlainObject); }, /** * Returns a new instance with the page reset. Two scenarios possible: * the page is omitted -> return the given instance * the page is set -> return a new instance with a page of 0 * @return {SearchParameters} a new updated instance */ resetPage: function() { if (this.page === undefined) { return this; } return this.setPage(0); }, /** * Helper function to get the hierarchicalFacet separator or the default one (`>`) * @param {object} hierarchicalFacet * @return {string} returns the hierarchicalFacet.separator or `>` as default */ _getHierarchicalFacetSortBy: function(hierarchicalFacet) { return hierarchicalFacet.sortBy || ['isRefined:desc', 'name:asc']; }, /** * Helper function to get the hierarchicalFacet separator or the default one (`>`) * @private * @param {object} hierarchicalFacet * @return {string} returns the hierarchicalFacet.separator or `>` as default */ _getHierarchicalFacetSeparator: function(hierarchicalFacet) { return hierarchicalFacet.separator || ' > '; }, /** * Helper function to get the hierarchicalFacet prefix path or null * @private * @param {object} hierarchicalFacet * @return {string} returns the hierarchicalFacet.rootPath or null as default */ _getHierarchicalRootPath: function(hierarchicalFacet) { return hierarchicalFacet.rootPath || null; }, /** * Helper function to check if we show the parent level of the hierarchicalFacet * @private * @param {object} hierarchicalFacet * @return {string} returns the hierarchicalFacet.showParentLevel or true as default */ _getHierarchicalShowParentLevel: function(hierarchicalFacet) { if (typeof hierarchicalFacet.showParentLevel === 'boolean') { return hierarchicalFacet.showParentLevel; } return true; }, /** * Helper function to get the hierarchicalFacet by it's name * @param {string} hierarchicalFacetName * @return {object} a hierarchicalFacet */ getHierarchicalFacetByName: function(hierarchicalFacetName) { return find$1( this.hierarchicalFacets, function(f) { return f.name === hierarchicalFacetName; } ); }, /** * Get the current breadcrumb for a hierarchical facet, as an array * @param {string} facetName Hierarchical facet name * @return {array.<string>} the path as an array of string */ getHierarchicalFacetBreadcrumb: function(facetName) { if (!this.isHierarchicalFacet(facetName)) { return []; } var refinement = this.getHierarchicalRefinement(facetName)[0]; if (!refinement) return []; var separator = this._getHierarchicalFacetSeparator( this.getHierarchicalFacetByName(facetName) ); var path = refinement.split(separator); return path.map(function(part) { return part.trim(); }); }, toString: function() { return JSON.stringify(this, null, 2); } }; /** * Callback used for clearRefinement method * @callback SearchParameters.clearCallback * @param {OperatorList|FacetList} value the value of the filter * @param {string} key the current attribute name * @param {string} type `numeric`, `disjunctiveFacet`, `conjunctiveFacet`, `hierarchicalFacet` or `exclude` * depending on the type of facet * @return {boolean} `true` if the element should be removed. `false` otherwise. */ var SearchParameters_1 = SearchParameters; function compareAscending(value, other) { if (value !== other) { var valIsDefined = value !== undefined; var valIsNull = value === null; var othIsDefined = other !== undefined; var othIsNull = other === null; if ( (!othIsNull && value > other) || (valIsNull && othIsDefined) || !valIsDefined ) { return 1; } if ( (!valIsNull && value < other) || (othIsNull && valIsDefined) || !othIsDefined ) { return -1; } } return 0; } /** * @param {Array<object>} collection object with keys in attributes * @param {Array<string>} iteratees attributes * @param {Array<string>} orders asc | desc */ function orderBy(collection, iteratees, orders) { if (!Array.isArray(collection)) { return []; } if (!Array.isArray(orders)) { orders = []; } var result = collection.map(function(value, index) { return { criteria: iteratees.map(function(iteratee) { return value[iteratee]; }), index: index, value: value }; }); result.sort(function comparer(object, other) { var index = -1; while (++index < object.criteria.length) { var res = compareAscending(object.criteria[index], other.criteria[index]); if (res) { if (index >= orders.length) { return res; } if (orders[index] === 'desc') { return -res; } return res; } } // This 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; }); return result.map(function(res) { return res.value; }); } var orderBy_1 = orderBy; var compact = function compact(array) { if (!Array.isArray(array)) { return []; } return array.filter(Boolean); }; // @MAJOR can be replaced by native Array#findIndex when we change support var findIndex = function find(array, comparator) { if (!Array.isArray(array)) { return -1; } for (var i = 0; i < array.length; i++) { if (comparator(array[i])) { return i; } } return -1; }; /** * Transform sort format from user friendly notation to lodash format * @param {string[]} sortBy array of predicate of the form "attribute:order" * @param {string[]} [defaults] array of predicate of the form "attribute:order" * @return {array.<string[]>} array containing 2 elements : attributes, orders */ var formatSort = function formatSort(sortBy, defaults) { var defaultInstructions = (defaults || []).map(function(sort) { return sort.split(':'); }); return sortBy.reduce( function preparePredicate(out, sort) { var sortInstruction = sort.split(':'); var matchingDefault = find$1(defaultInstructions, function( defaultInstruction ) { return defaultInstruction[0] === sortInstruction[0]; }); if (sortInstruction.length > 1 || !matchingDefault) { out[0].push(sortInstruction[0]); out[1].push(sortInstruction[1]); return out; } out[0].push(matchingDefault[0]); out[1].push(matchingDefault[1]); return out; }, [[], []] ); }; var generateHierarchicalTree_1 = generateTrees; function generateTrees(state) { return function generate(hierarchicalFacetResult, hierarchicalFacetIndex) { var hierarchicalFacet = state.hierarchicalFacets[hierarchicalFacetIndex]; var hierarchicalFacetRefinement = (state.hierarchicalFacetsRefinements[hierarchicalFacet.name] && state.hierarchicalFacetsRefinements[hierarchicalFacet.name][0]) || ''; var hierarchicalSeparator = state._getHierarchicalFacetSeparator( hierarchicalFacet ); var hierarchicalRootPath = state._getHierarchicalRootPath( hierarchicalFacet ); var hierarchicalShowParentLevel = state._getHierarchicalShowParentLevel( hierarchicalFacet ); var sortBy = formatSort( state._getHierarchicalFacetSortBy(hierarchicalFacet) ); var rootExhaustive = hierarchicalFacetResult.every(function(facetResult) { return facetResult.exhaustive; }); var generateTreeFn = generateHierarchicalTree( sortBy, hierarchicalSeparator, hierarchicalRootPath, hierarchicalShowParentLevel, hierarchicalFacetRefinement ); var results = hierarchicalFacetResult; if (hierarchicalRootPath) { results = hierarchicalFacetResult.slice( hierarchicalRootPath.split(hierarchicalSeparator).length ); } return results.reduce(generateTreeFn, { name: state.hierarchicalFacets[hierarchicalFacetIndex].name, count: null, // root level, no count isRefined: true, // root level, always refined path: null, // root level, no path exhaustive: rootExhaustive, data: null }); }; } function generateHierarchicalTree( sortBy, hierarchicalSeparator, hierarchicalRootPath, hierarchicalShowParentLevel, currentRefinement ) { return function generateTree( hierarchicalTree, hierarchicalFacetResult, currentHierarchicalLevel ) { var parent = hierarchicalTree; if (currentHierarchicalLevel > 0) { var level = 0; parent = hierarchicalTree; while (level < currentHierarchicalLevel) { /** * @type {object[]]} hierarchical data */ var data = parent && Array.isArray(parent.data) ? parent.data : []; parent = find$1(data, function(subtree) { return subtree.isRefined; }); level++; } } // we found a refined parent, let's add current level data under it if (parent) { // filter values in case an object has multiple categories: // { // categories: { // level0: ['beers', 'bières'], // level1: ['beers > IPA', 'bières > Belges'] // } // } // // If parent refinement is `beers`, then we do not want to have `bières > Belges` // showing up var picked = Object.keys(hierarchicalFacetResult.data) .map(function(facetValue) { return [facetValue, hierarchicalFacetResult.data[facetValue]]; }) .filter(function(tuple) { var facetValue = tuple[0]; return onlyMatchingTree( facetValue, parent.path || hierarchicalRootPath, currentRefinement, hierarchicalSeparator, hierarchicalRootPath, hierarchicalShowParentLevel ); }); parent.data = orderBy_1( picked.map(function(tuple) { var facetValue = tuple[0]; var facetCount = tuple[1]; return format( facetCount, facetValue, hierarchicalSeparator, currentRefinement, hierarchicalFacetResult.exhaustive ); }), sortBy[0], sortBy[1] ); } return hierarchicalTree; }; } function onlyMatchingTree( facetValue, parentPath, currentRefinement, hierarchicalSeparator, hierarchicalRootPath, hierarchicalShowParentLevel ) { // we want the facetValue is a child of hierarchicalRootPath if ( hierarchicalRootPath && (facetValue.indexOf(hierarchicalRootPath) !== 0 || hierarchicalRootPath === facetValue) ) { return false; } // we always want root levels (only when there is no prefix path) return ( (!hierarchicalRootPath && facetValue.indexOf(hierarchicalSeparator) === -1) || // if there is a rootPath, being root level mean 1 level under rootPath (hierarchicalRootPath && facetValue.split(hierarchicalSeparator).length - hierarchicalRootPath.split(hierarchicalSeparator).length === 1) || // if current refinement is a root level and current facetValue is a root level, // keep the facetValue (facetValue.indexOf(hierarchicalSeparator) === -1 && currentRefinement.indexOf(hierarchicalSeparator) === -1) || // currentRefinement is a child of the facet value currentRefinement.indexOf(facetValue) === 0 || // facetValue is a child of the current parent, add it (facetValue.indexOf(parentPath + hierarchicalSeparator) === 0 && (hierarchicalShowParentLevel || facetValue.indexOf(currentRefinement) === 0)) ); } function format( facetCount, facetValue, hierarchicalSeparator, currentRefinement, exhaustive ) { var parts = facetValue.split(hierarchicalSeparator); return { name: parts[parts.length - 1].trim(), path: facetValue, count: facetCount, isRefined: currentRefinement === facetValue || currentRefinement.indexOf(facetValue + hierarchicalSeparator) === 0, exhaustive: exhaustive, data: null }; } /** * @typedef SearchResults.Facet * @type {object} * @property {string} name name of the attribute in the record * @property {object} data the faceting data: value, number of entries * @property {object} stats undefined unless facet_stats is retrieved from algolia */ /** * @typedef SearchResults.HierarchicalFacet * @type {object} * @property {string} name name of the current value given the hierarchical level, trimmed. * If root node, you get the facet name * @property {number} count number of objects matching this hierarchical value * @property {string} path the current hierarchical value full path * @property {boolean} isRefined `true` if the current value was refined, `false` otherwise * @property {HierarchicalFacet[]} data sub values for the current level */ /** * @typedef SearchResults.FacetValue * @type {object} * @property {string} name the facet value itself * @property {number} count times this facet appears in the results * @property {boolean} isRefined is the facet currently selected * @property {boolean} isExcluded is the facet currently excluded (only for conjunctive facets) */ /** * @typedef Refinement * @type {object} * @property {string} type the type of filter used: * `numeric`, `facet`, `exclude`, `disjunctive`, `hierarchical` * @property {string} attributeName name of the attribute used for filtering * @property {string} name the value of the filter * @property {number} numericValue the value as a number. Only for numeric filters. * @property {string} operator the operator used. Only for numeric filters. * @property {number} count the number of computed hits for this filter. Only on facets. * @property {boolean} exhaustive if the count is exhaustive */ /** * @param {string[]} attributes */ function getIndices(attributes) { var indices = {}; attributes.forEach(function(val, idx) { indices[val] = idx; }); return indices; } function assignFacetStats(dest, facetStats, key) { if (facetStats && facetStats[key]) { dest.stats = facetStats[key]; } } /** * @typedef {Object} HierarchicalFacet * @property {string} name * @property {string[]} attributes */ /** * @param {HierarchicalFacet[]} hierarchicalFacets * @param {string} hierarchicalAttributeName */ function findMatchingHierarchicalFacetFromAttributeName( hierarchicalFacets, hierarchicalAttributeName ) { return find$1(hierarchicalFacets, function facetKeyMatchesAttribute( hierarchicalFacet ) { var facetNames = hierarchicalFacet.attributes || []; return facetNames.indexOf(hierarchicalAttributeName) > -1; }); } /*eslint-disable */ /** * Constructor for SearchResults * @class * @classdesc SearchResults contains the results of a query to Algolia using the * {@link AlgoliaSearchHelper}. * @param {SearchParameters} state state that led to the response * @param {array.<object>} results the results from algolia client * @example <caption>SearchResults of the first query in * <a href="http://demos.algolia.com/instant-search-demo">the instant search demo</a></caption> { "hitsPerPage": 10, "processingTimeMS": 2, "facets": [ { "name": "type", "data": { "HardGood": 6627, "BlackTie": 550, "Music": 665, "Software": 131, "Game": 456, "Movie": 1571 }, "exhaustive": false }, { "exhaustive": false, "data": { "Free shipping": 5507 }, "name": "shipping" } ], "hits": [ { "thumbnailImage": "http://img.bbystatic.com/BestBuy_US/images/products/1688/1688832_54x108_s.gif", "_highlightResult": { "shortDescription": { "matchLevel": "none", "value": "Safeguard your PC, Mac, Android and iOS devices with comprehensive Internet protection", "matchedWords": [] }, "category": { "matchLevel": "none", "value": "Computer Security Software", "matchedWords": [] }, "manufacturer": { "matchedWords": [], "value": "Webroot", "matchLevel": "none" }, "name": { "value": "Webroot SecureAnywhere Internet Security (3-Device) (1-Year Subscription) - Mac/Windows", "matchedWords": [], "matchLevel": "none" } }, "image": "http://img.bbystatic.com/BestBuy_US/images/products/1688/1688832_105x210_sc.jpg", "shipping": "Free shipping", "bestSellingRank": 4, "shortDescription": "Safeguard your PC, Mac, Android and iOS devices with comprehensive Internet protection", "url": "http://www.bestbuy.com/site/webroot-secureanywhere-internet-security-3-devi…d=1219060687969&skuId=1688832&cmp=RMX&ky=2d3GfEmNIzjA0vkzveHdZEBgpPCyMnLTJ", "name": "Webroot SecureAnywhere Internet Security (3-Device) (1-Year Subscription) - Mac/Windows", "category": "Computer Security Software", "salePrice_range": "1 - 50", "objectID": "1688832", "type": "Software", "customerReviewCount": 5980, "salePrice": 49.99, "manufacturer": "Webroot" }, .... ], "nbHits": 10000, "disjunctiveFacets": [ { "exhaustive": false, "data": { "5": 183, "12": 112, "7": 149, ... }, "name": "customerReviewCount", "stats": { "max": 7461, "avg": 157.939, "min": 1 } }, { "data": { "Printer Ink": 142, "Wireless Speakers": 60, "Point & Shoot Cameras": 48, ... }, "name": "category", "exhaustive": false }, { "exhaustive": false, "data": { "> 5000": 2, "1 - 50": 6524, "501 - 2000": 566, "201 - 500": 1501, "101 - 200": 1360, "2001 - 5000": 47 }, "name": "salePrice_range" }, { "data": { "Dynex™": 202, "Insignia™": 230, "PNY": 72, ... }, "name": "manufacturer", "exhaustive": false } ], "query": "", "nbPages": 100, "page": 0, "index": "bestbuy" } **/ /*eslint-enable */ function SearchResults(state, results) { var mainSubResponse = results[0]; this._rawResults = results; /** * query used to generate the results * @member {string} */ this.query = mainSubResponse.query; /** * The query as parsed by the engine given all the rules. * @member {string} */ this.parsedQuery = mainSubResponse.parsedQuery; /** * all the records that match the search parameters. Each record is * augmented with a new attribute `_highlightResult` * which is an object keyed by attribute and with the following properties: * - `value` : the value of the facet highlighted (html) * - `matchLevel`: full, partial or none depending on how the query terms match * @member {object[]} */ this.hits = mainSubResponse.hits; /** * index where the results come from * @member {string} */ this.index = mainSubResponse.index; /** * number of hits per page requested * @member {number} */ this.hitsPerPage = mainSubResponse.hitsPerPage; /** * total number of hits of this query on the index * @member {number} */ this.nbHits = mainSubResponse.nbHits; /** * total number of pages with respect to the number of hits per page and the total number of hits * @member {number} */ this.nbPages = mainSubResponse.nbPages; /** * current page * @member {number} */ this.page = mainSubResponse.page; /** * sum of the processing time of all the queries * @member {number} */ this.processingTimeMS = results.reduce(function(sum, result) { return result.processingTimeMS === undefined ? sum : sum + result.processingTimeMS; }, 0); /** * The position if the position was guessed by IP. * @member {string} * @example "48.8637,2.3615", */ this.aroundLatLng = mainSubResponse.aroundLatLng; /** * The radius computed by Algolia. * @member {string} * @example "126792922", */ this.automaticRadius = mainSubResponse.automaticRadius; /** * String identifying the server used to serve this request. * * getRankingInfo needs to be set to `true` for this to be returned * * @member {string} * @example "c7-use-2.algolia.net", */ this.serverUsed = mainSubResponse.serverUsed; /** * Boolean that indicates if the computation of the counts did time out. * @deprecated * @member {boolean} */ this.timeoutCounts = mainSubResponse.timeoutCounts; /** * Boolean that indicates if the computation of the hits did time out. * @deprecated * @member {boolean} */ this.timeoutHits = mainSubResponse.timeoutHits; /** * True if the counts of the facets is exhaustive * @member {boolean} */ this.exhaustiveFacetsCount = mainSubResponse.exhaustiveFacetsCount; /** * True if the number of hits is exhaustive * @member {boolean} */ this.exhaustiveNbHits = mainSubResponse.exhaustiveNbHits; /** * Contains the userData if they are set by a [query rule](https://www.algolia.com/doc/guides/query-rules/query-rules-overview/). * @member {object[]} */ this.userData = mainSubResponse.userData; /** * queryID is the unique identifier of the query used to generate the current search results. * This value is only available if the `clickAnalytics` search parameter is set to `true`. * @member {string} */ this.queryID = mainSubResponse.queryID; /** * disjunctive facets results * @member {SearchResults.Facet[]} */ this.disjunctiveFacets = []; /** * disjunctive facets results * @member {SearchResults.HierarchicalFacet[]} */ this.hierarchicalFacets = state.hierarchicalFacets.map(function initFutureTree() { return []; }); /** * other facets results * @member {SearchResults.Facet[]} */ this.facets = []; var disjunctiveFacets = state.getRefinedDisjunctiveFacets(); var facetsIndices = getIndices(state.facets); var disjunctiveFacetsIndices = getIndices(state.disjunctiveFacets); var nextDisjunctiveResult = 1; var self = this; // Since we send request only for disjunctive facets that have been refined, // we get the facets information from the first, general, response. var mainFacets = mainSubResponse.facets || {}; Object.keys(mainFacets).forEach(function(facetKey) { var facetValueObject = mainFacets[facetKey]; var hierarchicalFacet = findMatchingHierarchicalFacetFromAttributeName( state.hierarchicalFacets, facetKey ); if (hierarchicalFacet) { // Place the hierarchicalFacet data at the correct index depending on // the attributes order that was defined at the helper initialization var facetIndex = hierarchicalFacet.attributes.indexOf(facetKey); var idxAttributeName = findIndex(state.hierarchicalFacets, function(f) { return f.name === hierarchicalFacet.name; }); self.hierarchicalFacets[idxAttributeName][facetIndex] = { attribute: facetKey, data: facetValueObject, exhaustive: mainSubResponse.exhaustiveFacetsCount }; } else { var isFacetDisjunctive = state.disjunctiveFacets.indexOf(facetKey) !== -1; var isFacetConjunctive = state.facets.indexOf(facetKey) !== -1; var position; if (isFacetDisjunctive) { position = disjunctiveFacetsIndices[facetKey]; self.disjunctiveFacets[position] = { name: facetKey, data: facetValueObject, exhaustive: mainSubResponse.exhaustiveFacetsCount }; assignFacetStats(self.disjunctiveFacets[position], mainSubResponse.facets_stats, facetKey); } if (isFacetConjunctive) { position = facetsIndices[facetKey]; self.facets[position] = { name: facetKey, data: facetValueObject, exhaustive: mainSubResponse.exhaustiveFacetsCount }; assignFacetStats(self.facets[position], mainSubResponse.facets_stats, facetKey); } } }); // Make sure we do not keep holes within the hierarchical facets this.hierarchicalFacets = compact(this.hierarchicalFacets); // aggregate the refined disjunctive facets disjunctiveFacets.forEach(function(disjunctiveFacet) { var result = results[nextDisjunctiveResult]; var facets = result && result.facets ? result.facets : {}; var hierarchicalFacet = state.getHierarchicalFacetByName(disjunctiveFacet); // There should be only item in facets. Object.keys(facets).forEach(function(dfacet) { var facetResults = facets[dfacet]; var position; if (hierarchicalFacet) { position = findIndex(state.hierarchicalFacets, function(f) { return f.name === hierarchicalFacet.name; }); var attributeIndex = findIndex(self.hierarchicalFacets[position], function(f) { return f.attribute === dfacet; }); // previous refinements and no results so not able to find it if (attributeIndex === -1) { return; } self.hierarchicalFacets[position][attributeIndex].data = merge_1( {}, self.hierarchicalFacets[position][attributeIndex].data, facetResults ); } else { position = disjunctiveFacetsIndices[dfacet]; var dataFromMainRequest = mainSubResponse.facets && mainSubResponse.facets[dfacet] || {}; self.disjunctiveFacets[position] = { name: dfacet, data: defaultsPure({}, facetResults, dataFromMainRequest), exhaustive: result.exhaustiveFacetsCount }; assignFacetStats(self.disjunctiveFacets[position], result.facets_stats, dfacet); if (state.disjunctiveFacetsRefinements[dfacet]) { state.disjunctiveFacetsRefinements[dfacet].forEach(function(refinementValue) { // add the disjunctive refinements if it is no more retrieved if (!self.disjunctiveFacets[position].data[refinementValue] && state.disjunctiveFacetsRefinements[dfacet].indexOf(refinementValue) > -1) { self.disjunctiveFacets[position].data[refinementValue] = 0; } }); } } }); nextDisjunctiveResult++; }); // if we have some root level values for hierarchical facets, merge them state.getRefinedHierarchicalFacets().forEach(function(refinedFacet) { var hierarchicalFacet = state.getHierarchicalFacetByName(refinedFacet); var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet); var currentRefinement = state.getHierarchicalRefinement(refinedFacet); // if we are already at a root refinement (or no refinement at all), there is no // root level values request if (currentRefinement.length === 0 || currentRefinement[0].split(separator).length < 2) { return; } var result = results[nextDisjunctiveResult]; var facets = result && result.facets ? result.facets : {}; Object.keys(facets).forEach(function(dfacet) { var facetResults = facets[dfacet]; var position = findIndex(state.hierarchicalFacets, function(f) { return f.name === hierarchicalFacet.name; }); var attributeIndex = findIndex(self.hierarchicalFacets[position], function(f) { return f.attribute === dfacet; }); // previous refinements and no results so not able to find it if (attributeIndex === -1) { return; } // when we always get root levels, if the hits refinement is `beers > IPA` (count: 5), // then the disjunctive values will be `beers` (count: 100), // but we do not want to display // | beers (100) // > IPA (5) // We want // | beers (5) // > IPA (5) var defaultData = {}; if (currentRefinement.length > 0) { var root = currentRefinement[0].split(separator)[0]; defaultData[root] = self.hierarchicalFacets[position][attributeIndex].data[root]; } self.hierarchicalFacets[position][attributeIndex].data = defaultsPure( defaultData, facetResults, self.hierarchicalFacets[position][attributeIndex].data ); }); nextDisjunctiveResult++; }); // add the excludes Object.keys(state.facetsExcludes).forEach(function(facetName) { var excludes = state.facetsExcludes[facetName]; var position = facetsIndices[facetName]; self.facets[position] = { name: facetName, data: mainSubResponse.facets[facetName], exhaustive: mainSubResponse.exhaustiveFacetsCount }; excludes.forEach(function(facetValue) { self.facets[position] = self.facets[position] || {name: facetName}; self.facets[position].data = self.facets[position].data || {}; self.facets[position].data[facetValue] = 0; }); }); /** * @type {Array} */ this.hierarchicalFacets = this.hierarchicalFacets.map(generateHierarchicalTree_1(state)); /** * @type {Array} */ this.facets = compact(this.facets); /** * @type {Array} */ this.disjunctiveFacets = compact(this.disjunctiveFacets); this._state = state; } /** * Get a facet object with its name * @deprecated * @param {string} name name of the faceted attribute * @return {SearchResults.Facet} the facet object */ SearchResults.prototype.getFacetByName = function(name) { function predicate(facet) { return facet.name === name; } return find$1(this.facets, predicate) || find$1(this.disjunctiveFacets, predicate) || find$1(this.hierarchicalFacets, predicate); }; /** * Get the facet values of a specified attribute from a SearchResults object. * @private * @param {SearchResults} results the search results to search in * @param {string} attribute name of the faceted attribute to search for * @return {array|object} facet values. For the hierarchical facets it is an object. */ function extractNormalizedFacetValues(results, attribute) { function predicate(facet) { return facet.name === attribute; } if (results._state.isConjunctiveFacet(attribute)) { var facet = find$1(results.facets, predicate); if (!facet) return []; return Object.keys(facet.data).map(function(name) { return { name: name, count: facet.data[name], isRefined: results._state.isFacetRefined(attribute, name), isExcluded: results._state.isExcludeRefined(attribute, name) }; }); } else if (results._state.isDisjunctiveFacet(attribute)) { var disjunctiveFacet = find$1(results.disjunctiveFacets, predicate); if (!disjunctiveFacet) return []; return Object.keys(disjunctiveFacet.data).map(function(name) { return { name: name, count: disjunctiveFacet.data[name], isRefined: results._state.isDisjunctiveFacetRefined(attribute, name) }; }); } else if (results._state.isHierarchicalFacet(attribute)) { return find$1(results.hierarchicalFacets, predicate); } } /** * Sort nodes of a hierarchical facet results * @private * @param {HierarchicalFacet} node node to upon which we want to apply the sort */ function recSort(sortFn, node) { if (!node.data || node.data.length === 0) { return node; } var children = node.data.map(function(childNode) { return recSort(sortFn, childNode); }); var sortedChildren = sortFn(children); var newNode = merge_1({}, node, {data: sortedChildren}); return newNode; } SearchResults.DEFAULT_SORT = ['isRefined:desc', 'count:desc', 'name:asc']; function vanillaSortFn(order, data) { return data.sort(order); } /** * Get a the list of values for a given facet attribute. Those values are sorted * refinement first, descending count (bigger value on top), and name ascending * (alphabetical order). The sort formula can overridden using either string based * predicates or a function. * * This method will return all the values returned by the Algolia engine plus all * the values already refined. This means that it can happen that the * `maxValuesPerFacet` [configuration](https://www.algolia.com/doc/rest-api/search#param-maxValuesPerFacet) * might not be respected if you have facet values that are already refined. * @param {string} attribute attribute name * @param {object} opts configuration options. * @param {Array.<string> | function} opts.sortBy * When using strings, it consists of * the name of the [FacetValue](#SearchResults.FacetValue) or the * [HierarchicalFacet](#SearchResults.HierarchicalFacet) attributes with the * order (`asc` or `desc`). For example to order the value by count, the * argument would be `['count:asc']`. * * If only the attribute name is specified, the ordering defaults to the one * specified in the default value for this attribute. * * When not specified, the order is * ascending. This parameter can also be a function which takes two facet * values and should return a number, 0 if equal, 1 if the first argument is * bigger or -1 otherwise. * * The default value for this attribute `['isRefined:desc', 'count:desc', 'name:asc']` * @return {FacetValue[]|HierarchicalFacet|undefined} depending on the type of facet of * the attribute requested (hierarchical, disjunctive or conjunctive) * @example * helper.on('result', function(event){ * //get values ordered only by name ascending using the string predicate * event.results.getFacetValues('city', {sortBy: ['name:asc']}); * //get values ordered only by count ascending using a function * event.results.getFacetValues('city', { * // this is equivalent to ['count:asc'] * sortBy: function(a, b) { * if (a.count === b.count) return 0; * if (a.count > b.count) return 1; * if (b.count > a.count) return -1; * } * }); * }); */ SearchResults.prototype.getFacetValues = function(attribute, opts) { var facetValues = extractNormalizedFacetValues(this, attribute); if (!facetValues) { return undefined; } var options = defaultsPure({}, opts, {sortBy: SearchResults.DEFAULT_SORT}); if (Array.isArray(options.sortBy)) { var order = formatSort(options.sortBy, SearchResults.DEFAULT_SORT); if (Array.isArray(facetValues)) { return orderBy_1(facetValues, order[0], order[1]); } // If facetValues is not an array, it's an object thus a hierarchical facet object return recSort(function(hierarchicalFacetValues) { return orderBy_1(hierarchicalFacetValues, order[0], order[1]); }, facetValues); } else if (typeof options.sortBy === 'function') { if (Array.isArray(facetValues)) { return facetValues.sort(options.sortBy); } // If facetValues is not an array, it's an object thus a hierarchical facet object return recSort(function(data) { return vanillaSortFn(options.sortBy, data); }, facetValues); } throw new Error( 'options.sortBy is optional but if defined it must be ' + 'either an array of string (predicates) or a sorting function' ); }; /** * Returns the facet stats if attribute is defined and the facet contains some. * Otherwise returns undefined. * @param {string} attribute name of the faceted attribute * @return {object} The stats of the facet */ SearchResults.prototype.getFacetStats = function(attribute) { if (this._state.isConjunctiveFacet(attribute)) { return getFacetStatsIfAvailable(this.facets, attribute); } else if (this._state.isDisjunctiveFacet(attribute)) { return getFacetStatsIfAvailable(this.disjunctiveFacets, attribute); } return undefined; }; /** * @typedef {Object} FacetListItem * @property {string} name */ /** * @param {FacetListItem[]} facetList (has more items, but enough for here) * @param {string} facetName */ function getFacetStatsIfAvailable(facetList, facetName) { var data = find$1(facetList, function(facet) { return facet.name === facetName; }); return data && data.stats; } /** * Returns all refinements for all filters + tags. It also provides * additional information: count and exhaustiveness for each filter. * * See the [refinement type](#Refinement) for an exhaustive view of the available * data. * * Note that for a numeric refinement, results are grouped per operator, this * means that it will return responses for operators which are empty. * * @return {Array.<Refinement>} all the refinements */ SearchResults.prototype.getRefinements = function() { var state = this._state; var results = this; var res = []; Object.keys(state.facetsRefinements).forEach(function(attributeName) { state.facetsRefinements[attributeName].forEach(function(name) { res.push(getRefinement(state, 'facet', attributeName, name, results.facets)); }); }); Object.keys(state.facetsExcludes).forEach(function(attributeName) { state.facetsExcludes[attributeName].forEach(function(name) { res.push(getRefinement(state, 'exclude', attributeName, name, results.facets)); }); }); Object.keys(state.disjunctiveFacetsRefinements).forEach(function(attributeName) { state.disjunctiveFacetsRefinements[attributeName].forEach(function(name) { res.push(getRefinement(state, 'disjunctive', attributeName, name, results.disjunctiveFacets)); }); }); Object.keys(state.hierarchicalFacetsRefinements).forEach(function(attributeName) { state.hierarchicalFacetsRefinements[attributeName].forEach(function(name) { res.push(getHierarchicalRefinement(state, attributeName, name, results.hierarchicalFacets)); }); }); Object.keys(state.numericRefinements).forEach(function(attributeName) { var operators = state.numericRefinements[attributeName]; Object.keys(operators).forEach(function(operator) { operators[operator].forEach(function(value) { res.push({ type: 'numeric', attributeName: attributeName, name: value, numericValue: value, operator: operator }); }); }); }); state.tagRefinements.forEach(function(name) { res.push({type: 'tag', attributeName: '_tags', name: name}); }); return res; }; /** * @typedef {Object} Facet * @property {string} name * @property {Object} data * @property {boolean} exhaustive */ /** * @param {*} state * @param {*} type * @param {string} attributeName * @param {*} name * @param {Facet[]} resultsFacets */ function getRefinement(state, type, attributeName, name, resultsFacets) { var facet = find$1(resultsFacets, function(f) { return f.name === attributeName; }); var count = facet && facet.data && facet.data[name] ? facet.data[name] : 0; var exhaustive = (facet && facet.exhaustive) || false; return { type: type, attributeName: attributeName, name: name, count: count, exhaustive: exhaustive }; } /** * @param {*} state * @param {string} attributeName * @param {*} name * @param {Facet[]} resultsFacets */ function getHierarchicalRefinement(state, attributeName, name, resultsFacets) { var facetDeclaration = state.getHierarchicalFacetByName(attributeName); var separator = state._getHierarchicalFacetSeparator(facetDeclaration); var split = name.split(separator); var rootFacet = find$1(resultsFacets, function(facet) { return facet.name === attributeName; }); var facet = split.reduce(function(intermediateFacet, part) { var newFacet = intermediateFacet && find$1(intermediateFacet.data, function(f) { return f.name === part; }); return newFacet !== undefined ? newFacet : intermediateFacet; }, rootFacet); var count = (facet && facet.count) || 0; var exhaustive = (facet && facet.exhaustive) || false; var path = (facet && facet.path) || ''; return { type: 'hierarchical', attributeName: attributeName, name: path, count: count, exhaustive: exhaustive }; } var SearchResults_1 = SearchResults; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. function EventEmitter() { this._events = this._events || {}; this._maxListeners = this._maxListeners || undefined; } var events = EventEmitter; // Backwards-compat with node 0.10.x EventEmitter.EventEmitter = EventEmitter; EventEmitter.prototype._events = undefined; EventEmitter.prototype._maxListeners = undefined; // By default EventEmitters will print a warning if more than 10 listeners are // added to it. This is a useful default which helps finding memory leaks. EventEmitter.defaultMaxListeners = 10; // Obviously not all Emitters should be limited to 10. This function allows // that to be increased. Set to zero for unlimited. EventEmitter.prototype.setMaxListeners = function(n) { if (!isNumber(n) || n < 0 || isNaN(n)) throw TypeError('n must be a positive number'); this._maxListeners = n; return this; }; EventEmitter.prototype.emit = function(type) { var er, handler, len, args, i, listeners; if (!this._events) this._events = {}; // If there is no 'error' event listener then throw. if (type === 'error') { if (!this._events.error || (isObject(this._events.error) && !this._events.error.length)) { er = arguments[1]; if (er instanceof Error) { throw er; // Unhandled 'error' event } else { // At least give some kind of context to the user var err = new Error('Uncaught, unspecified "error" event. (' + er + ')'); err.context = er; throw err; } } } handler = this._events[type]; if (isUndefined(handler)) return false; if (isFunction(handler)) { switch (arguments.length) { // fast cases case 1: handler.call(this); break; case 2: handler.call(this, arguments[1]); break; case 3: handler.call(this, arguments[1], arguments[2]); break; // slower default: args = Array.prototype.slice.call(arguments, 1); handler.apply(this, args); } } else if (isObject(handler)) { args = Array.prototype.slice.call(arguments, 1); listeners = handler.slice(); len = listeners.length; for (i = 0; i < len; i++) listeners[i].apply(this, args); } return true; }; EventEmitter.prototype.addListener = function(type, listener) { var m; if (!isFunction(listener)) throw TypeError('listener must be a function'); if (!this._events) this._events = {}; // To avoid recursion in the case that type === "newListener"! Before // adding it to the listeners, first emit "newListener". if (this._events.newListener) this.emit('newListener', type, isFunction(listener.listener) ? listener.listener : listener); if (!this._events[type]) // Optimize the case of one listener. Don't need the extra array object. this._events[type] = listener; else if (isObject(this._events[type])) // If we've already got an array, just append. this._events[type].push(listener); else // Adding the second element, need to change to array. this._events[type] = [this._events[type], listener]; // Check for listener leak if (isObject(this._events[type]) && !this._events[type].warned) { if (!isUndefined(this._maxListeners)) { m = this._maxListeners; } else { m = EventEmitter.defaultMaxListeners; } if (m && m > 0 && this._events[type].length > m) { this._events[type].warned = true; console.error('(node) warning: possible EventEmitter memory ' + 'leak detected. %d listeners added. ' + 'Use emitter.setMaxListeners() to increase limit.', this._events[type].length); if (typeof console.trace === 'function') { // not supported in IE 10 console.trace(); } } } return this; }; EventEmitter.prototype.on = EventEmitter.prototype.addListener; EventEmitter.prototype.once = function(type, listener) { if (!isFunction(listener)) throw TypeError('listener must be a function'); var fired = false; function g() { this.removeListener(type, g); if (!fired) { fired = true; listener.apply(this, arguments); } } g.listener = listener; this.on(type, g); return this; }; // emits a 'removeListener' event iff the listener was removed EventEmitter.prototype.removeListener = function(type, listener) { var list, position, length, i; if (!isFunction(listener)) throw TypeError('listener must be a function'); if (!this._events || !this._events[type]) return this; list = this._events[type]; length = list.length; position = -1; if (list === listener || (isFunction(list.listener) && list.listener === listener)) { delete this._events[type]; if (this._events.removeListener) this.emit('removeListener', type, listener); } else if (isObject(list)) { for (i = length; i-- > 0;) { if (list[i] === listener || (list[i].listener && list[i].listener === listener)) { position = i; break; } } if (position < 0) return this; if (list.length === 1) { list.length = 0; delete this._events[type]; } else { list.splice(position, 1); } if (this._events.removeListener) this.emit('removeListener', type, listener); } return this; }; EventEmitter.prototype.removeAllListeners = function(type) { var key, listeners; if (!this._events) return this; // not listening for removeListener, no need to emit if (!this._events.removeListener) { if (arguments.length === 0) this._events = {}; else if (this._events[type]) delete this._events[type]; return this; } // emit removeListener for all listeners on all events if (arguments.length === 0) { for (key in this._events) { if (key === 'removeListener') continue; this.removeAllListeners(key); } this.removeAllListeners('removeListener'); this._events = {}; return this; } listeners = this._events[type]; if (isFunction(listeners)) { this.removeListener(type, listeners); } else if (listeners) { // LIFO order while (listeners.length) this.removeListener(type, listeners[listeners.length - 1]); } delete this._events[type]; return this; }; EventEmitter.prototype.listeners = function(type) { var ret; if (!this._events || !this._events[type]) ret = []; else if (isFunction(this._events[type])) ret = [this._events[type]]; else ret = this._events[type].slice(); return ret; }; EventEmitter.prototype.listenerCount = function(type) { if (this._events) { var evlistener = this._events[type]; if (isFunction(evlistener)) return 1; else if (evlistener) return evlistener.length; } return 0; }; EventEmitter.listenerCount = function(emitter, type) { return emitter.listenerCount(type); }; function isFunction(arg) { return typeof arg === 'function'; } function isNumber(arg) { return typeof arg === 'number'; } function isObject(arg) { return typeof arg === 'object' && arg !== null; } function isUndefined(arg) { return arg === void 0; } function inherits(ctor, superCtor) { ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }); } var inherits_1 = inherits; /** * A DerivedHelper is a way to create sub requests to * Algolia from a main helper. * @class * @classdesc The DerivedHelper provides an event based interface for search callbacks: * - search: when a search is triggered using the `search()` method. * - result: when the response is retrieved from Algolia and is processed. * This event contains a {@link SearchResults} object and the * {@link SearchParameters} corresponding to this answer. */ function DerivedHelper(mainHelper, fn) { this.main = mainHelper; this.fn = fn; this.lastResults = null; } inherits_1(DerivedHelper, events.EventEmitter); /** * Detach this helper from the main helper * @return {undefined} * @throws Error if the derived helper is already detached */ DerivedHelper.prototype.detach = function() { this.removeAllListeners(); this.main.detachDerivedHelper(this); }; DerivedHelper.prototype.getModifiedState = function(parameters) { return this.fn(parameters); }; var DerivedHelper_1 = DerivedHelper; var requestBuilder = { /** * Get all the queries to send to the client, those queries can used directly * with the Algolia client. * @private * @return {object[]} The queries */ _getQueries: function getQueries(index, state) { var queries = []; // One query for the hits queries.push({ indexName: index, params: requestBuilder._getHitsSearchParams(state) }); // One for each disjunctive facets state.getRefinedDisjunctiveFacets().forEach(function(refinedFacet) { queries.push({ indexName: index, params: requestBuilder._getDisjunctiveFacetSearchParams(state, refinedFacet) }); }); // maybe more to get the root level of hierarchical facets when activated state.getRefinedHierarchicalFacets().forEach(function(refinedFacet) { var hierarchicalFacet = state.getHierarchicalFacetByName(refinedFacet); var currentRefinement = state.getHierarchicalRefinement(refinedFacet); // if we are deeper than level 0 (starting from `beer > IPA`) // we want to get the root values var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet); if (currentRefinement.length > 0 && currentRefinement[0].split(separator).length > 1) { queries.push({ indexName: index, params: requestBuilder._getDisjunctiveFacetSearchParams(state, refinedFacet, true) }); } }); return queries; }, /** * Build search parameters used to fetch hits * @private * @return {object.<string, any>} */ _getHitsSearchParams: function(state) { var facets = state.facets .concat(state.disjunctiveFacets) .concat(requestBuilder._getHitsHierarchicalFacetsAttributes(state)); var facetFilters = requestBuilder._getFacetFilters(state); var numericFilters = requestBuilder._getNumericFilters(state); var tagFilters = requestBuilder._getTagFilters(state); var additionalParams = { facets: facets, tagFilters: tagFilters }; if (facetFilters.length > 0) { additionalParams.facetFilters = facetFilters; } if (numericFilters.length > 0) { additionalParams.numericFilters = numericFilters; } return merge_1({}, state.getQueryParams(), additionalParams); }, /** * Build search parameters used to fetch a disjunctive facet * @private * @param {string} facet the associated facet name * @param {boolean} hierarchicalRootLevel ?? FIXME * @return {object} */ _getDisjunctiveFacetSearchParams: function(state, facet, hierarchicalRootLevel) { var facetFilters = requestBuilder._getFacetFilters(state, facet, hierarchicalRootLevel); var numericFilters = requestBuilder._getNumericFilters(state, facet); var tagFilters = requestBuilder._getTagFilters(state); var additionalParams = { hitsPerPage: 1, page: 0, attributesToRetrieve: [], attributesToHighlight: [], attributesToSnippet: [], tagFilters: tagFilters, analytics: false, clickAnalytics: false }; var hierarchicalFacet = state.getHierarchicalFacetByName(facet); if (hierarchicalFacet) { additionalParams.facets = requestBuilder._getDisjunctiveHierarchicalFacetAttribute( state, hierarchicalFacet, hierarchicalRootLevel ); } else { additionalParams.facets = facet; } if (numericFilters.length > 0) { additionalParams.numericFilters = numericFilters; } if (facetFilters.length > 0) { additionalParams.facetFilters = facetFilters; } return merge_1({}, state.getQueryParams(), additionalParams); }, /** * Return the numeric filters in an algolia request fashion * @private * @param {string} [facetName] the name of the attribute for which the filters should be excluded * @return {string[]} the numeric filters in the algolia format */ _getNumericFilters: function(state, facetName) { if (state.numericFilters) { return state.numericFilters; } var numericFilters = []; Object.keys(state.numericRefinements).forEach(function(attribute) { var operators = state.numericRefinements[attribute] || {}; Object.keys(operators).forEach(function(operator) { var values = operators[operator] || []; if (facetName !== attribute) { values.forEach(function(value) { if (Array.isArray(value)) { var vs = value.map(function(v) { return attribute + operator + v; }); numericFilters.push(vs); } else { numericFilters.push(attribute + operator + value); } }); } }); }); return numericFilters; }, /** * Return the tags filters depending * @private * @return {string} */ _getTagFilters: function(state) { if (state.tagFilters) { return state.tagFilters; } return state.tagRefinements.join(','); }, /** * Build facetFilters parameter based on current refinements. The array returned * contains strings representing the facet filters in the algolia format. * @private * @param {string} [facet] if set, the current disjunctive facet * @return {array.<string>} */ _getFacetFilters: function(state, facet, hierarchicalRootLevel) { var facetFilters = []; var facetsRefinements = state.facetsRefinements || {}; Object.keys(facetsRefinements).forEach(function(facetName) { var facetValues = facetsRefinements[facetName] || []; facetValues.forEach(function(facetValue) { facetFilters.push(facetName + ':' + facetValue); }); }); var facetsExcludes = state.facetsExcludes || {}; Object.keys(facetsExcludes).forEach(function(facetName) { var facetValues = facetsExcludes[facetName] || []; facetValues.forEach(function(facetValue) { facetFilters.push(facetName + ':-' + facetValue); }); }); var disjunctiveFacetsRefinements = state.disjunctiveFacetsRefinements || {}; Object.keys(disjunctiveFacetsRefinements).forEach(function(facetName) { var facetValues = disjunctiveFacetsRefinements[facetName] || []; if (facetName === facet || !facetValues || facetValues.length === 0) { return; } var orFilters = []; facetValues.forEach(function(facetValue) { orFilters.push(facetName + ':' + facetValue); }); facetFilters.push(orFilters); }); var hierarchicalFacetsRefinements = state.hierarchicalFacetsRefinements || {}; Object.keys(hierarchicalFacetsRefinements).forEach(function(facetName) { var facetValues = hierarchicalFacetsRefinements[facetName] || []; var facetValue = facetValues[0]; if (facetValue === undefined) { return; } var hierarchicalFacet = state.getHierarchicalFacetByName(facetName); var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet); var rootPath = state._getHierarchicalRootPath(hierarchicalFacet); var attributeToRefine; var attributesIndex; // we ask for parent facet values only when the `facet` is the current hierarchical facet if (facet === facetName) { // if we are at the root level already, no need to ask for facet values, we get them from // the hits query if (facetValue.indexOf(separator) === -1 || (!rootPath && hierarchicalRootLevel === true) || (rootPath && rootPath.split(separator).length === facetValue.split(separator).length)) { return; } if (!rootPath) { attributesIndex = facetValue.split(separator).length - 2; facetValue = facetValue.slice(0, facetValue.lastIndexOf(separator)); } else { attributesIndex = rootPath.split(separator).length - 1; facetValue = rootPath; } attributeToRefine = hierarchicalFacet.attributes[attributesIndex]; } else { attributesIndex = facetValue.split(separator).length - 1; attributeToRefine = hierarchicalFacet.attributes[attributesIndex]; } if (attributeToRefine) { facetFilters.push([attributeToRefine + ':' + facetValue]); } }); return facetFilters; }, _getHitsHierarchicalFacetsAttributes: function(state) { var out = []; return state.hierarchicalFacets.reduce( // ask for as much levels as there's hierarchical refinements function getHitsAttributesForHierarchicalFacet(allAttributes, hierarchicalFacet) { var hierarchicalRefinement = state.getHierarchicalRefinement(hierarchicalFacet.name)[0]; // if no refinement, ask for root level if (!hierarchicalRefinement) { allAttributes.push(hierarchicalFacet.attributes[0]); return allAttributes; } var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet); var level = hierarchicalRefinement.split(separator).length; var newAttributes = hierarchicalFacet.attributes.slice(0, level + 1); return allAttributes.concat(newAttributes); }, out); }, _getDisjunctiveHierarchicalFacetAttribute: function(state, hierarchicalFacet, rootLevel) { var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet); if (rootLevel === true) { var rootPath = state._getHierarchicalRootPath(hierarchicalFacet); var attributeIndex = 0; if (rootPath) { attributeIndex = rootPath.split(separator).length; } return [hierarchicalFacet.attributes[attributeIndex]]; } var hierarchicalRefinement = state.getHierarchicalRefinement(hierarchicalFacet.name)[0] || ''; // if refinement is 'beers > IPA > Flying dog', // then we want `facets: ['beers > IPA']` as disjunctive facet (parent level values) var parentLevel = hierarchicalRefinement.split(separator).length - 1; return hierarchicalFacet.attributes.slice(0, parentLevel + 1); }, getSearchForFacetQuery: function(facetName, query, maxFacetHits, state) { var stateForSearchForFacetValues = state.isDisjunctiveFacet(facetName) ? state.clearRefinements(facetName) : state; var searchForFacetSearchParameters = { facetQuery: query, facetName: facetName }; if (typeof maxFacetHits === 'number') { searchForFacetSearchParameters.maxFacetHits = maxFacetHits; } return merge_1( {}, requestBuilder._getHitsSearchParams(stateForSearchForFacetValues), searchForFacetSearchParameters ); } }; var requestBuilder_1 = requestBuilder; var version$1 = '3.1.0'; /** * Event triggered when a parameter is set or updated * @event AlgoliaSearchHelper#event:change * @property {object} event * @property {SearchParameters} event.state the current parameters with the latest changes applied * @property {SearchResults} event.results the previous results received from Algolia. `null` before the first request * @example * helper.on('change', function(event) { * console.log('The parameters have changed'); * }); */ /** * Event triggered when a main search is sent to Algolia * @event AlgoliaSearchHelper#event:search * @property {object} event * @property {SearchParameters} event.state the parameters used for this search * @property {SearchResults} event.results the results from the previous search. `null` if it is the first search. * @example * helper.on('search', function(event) { * console.log('Search sent'); * }); */ /** * Event triggered when a search using `searchForFacetValues` is sent to Algolia * @event AlgoliaSearchHelper#event:searchForFacetValues * @property {object} event * @property {SearchParameters} event.state the parameters used for this search it is the first search. * @property {string} event.facet the facet searched into * @property {string} event.query the query used to search in the facets * @example * helper.on('searchForFacetValues', function(event) { * console.log('searchForFacetValues sent'); * }); */ /** * Event triggered when a search using `searchOnce` is sent to Algolia * @event AlgoliaSearchHelper#event:searchOnce * @property {object} event * @property {SearchParameters} event.state the parameters used for this search it is the first search. * @example * helper.on('searchOnce', function(event) { * console.log('searchOnce sent'); * }); */ /** * Event triggered when the results are retrieved from Algolia * @event AlgoliaSearchHelper#event:result * @property {object} event * @property {SearchResults} event.results the results received from Algolia * @property {SearchParameters} event.state the parameters used to query Algolia. Those might be different from the one in the helper instance (for example if the network is unreliable). * @example * helper.on('result', function(event) { * console.log('Search results received'); * }); */ /** * Event triggered when Algolia sends back an error. For example, if an unknown parameter is * used, the error can be caught using this event. * @event AlgoliaSearchHelper#event:error * @property {object} event * @property {Error} event.error the error returned by the Algolia. * @example * helper.on('error', function(event) { * console.log('Houston we got a problem.'); * }); */ /** * Event triggered when the queue of queries have been depleted (with any result or outdated queries) * @event AlgoliaSearchHelper#event:searchQueueEmpty * @example * helper.on('searchQueueEmpty', function() { * console.log('No more search pending'); * // This is received before the result event if we're not expecting new results * }); * * helper.search(); */ /** * Initialize a new AlgoliaSearchHelper * @class * @classdesc The AlgoliaSearchHelper is a class that ease the management of the * search. It provides an event based interface for search callbacks: * - change: when the internal search state is changed. * This event contains a {@link SearchParameters} object and the * {@link SearchResults} of the last result if any. * - search: when a search is triggered using the `search()` method. * - result: when the response is retrieved from Algolia and is processed. * This event contains a {@link SearchResults} object and the * {@link SearchParameters} corresponding to this answer. * - error: when the response is an error. This event contains the error returned by the server. * @param {AlgoliaSearch} client an AlgoliaSearch client * @param {string} index the index name to query * @param {SearchParameters | object} options an object defining the initial * config of the search. It doesn't have to be a {SearchParameters}, * just an object containing the properties you need from it. */ function AlgoliaSearchHelper(client, index, options) { if (typeof client.addAlgoliaAgent === 'function') { client.addAlgoliaAgent('JS Helper (' + version$1 + ')'); } this.setClient(client); var opts = options || {}; opts.index = index; this.state = SearchParameters_1.make(opts); this.lastResults = null; this._queryId = 0; this._lastQueryIdReceived = -1; this.derivedHelpers = []; this._currentNbQueries = 0; } inherits_1(AlgoliaSearchHelper, events.EventEmitter); /** * Start the search with the parameters set in the state. When the * method is called, it triggers a `search` event. The results will * be available through the `result` event. If an error occurs, an * `error` will be fired instead. * @return {AlgoliaSearchHelper} * @fires search * @fires result * @fires error * @chainable */ AlgoliaSearchHelper.prototype.search = function() { this._search({onlyWithDerivedHelpers: false}); return this; }; AlgoliaSearchHelper.prototype.searchOnlyWithDerivedHelpers = function() { this._search({onlyWithDerivedHelpers: true}); return this; }; /** * Gets the search query parameters that would be sent to the Algolia Client * for the hits * @return {object} Query Parameters */ AlgoliaSearchHelper.prototype.getQuery = function() { var state = this.state; return requestBuilder_1._getHitsSearchParams(state); }; /** * Start a search using a modified version of the current state. This method does * not trigger the helper lifecycle and does not modify the state kept internally * by the helper. This second aspect means that the next search call will be the * same as a search call before calling searchOnce. * @param {object} options can contain all the parameters that can be set to SearchParameters * plus the index * @param {function} [callback] optional callback executed when the response from the * server is back. * @return {promise|undefined} if a callback is passed the method returns undefined * otherwise it returns a promise containing an object with two keys : * - content with a SearchResults * - state with the state used for the query as a SearchParameters * @example * // Changing the number of records returned per page to 1 * // This example uses the callback API * var state = helper.searchOnce({hitsPerPage: 1}, * function(error, content, state) { * // if an error occurred it will be passed in error, otherwise its value is null * // content contains the results formatted as a SearchResults * // state is the instance of SearchParameters used for this search * }); * @example * // Changing the number of records returned per page to 1 * // This example uses the promise API * var state1 = helper.searchOnce({hitsPerPage: 1}) * .then(promiseHandler); * * function promiseHandler(res) { * // res contains * // { * // content : SearchResults * // state : SearchParameters (the one used for this specific search) * // } * } */ AlgoliaSearchHelper.prototype.searchOnce = function(options, cb) { var tempState = !options ? this.state : this.state.setQueryParameters(options); var queries = requestBuilder_1._getQueries(tempState.index, tempState); var self = this; this._currentNbQueries++; this.emit('searchOnce', { state: tempState }); if (cb) { this.client .search(queries) .then(function(content) { self._currentNbQueries--; if (self._currentNbQueries === 0) { self.emit('searchQueueEmpty'); } cb(null, new SearchResults_1(tempState, content.results), tempState); }) .catch(function(err) { self._currentNbQueries--; if (self._currentNbQueries === 0) { self.emit('searchQueueEmpty'); } cb(err, null, tempState); }); return undefined; } return this.client.search(queries).then(function(content) { self._currentNbQueries--; if (self._currentNbQueries === 0) self.emit('searchQueueEmpty'); return { content: new SearchResults_1(tempState, content.results), state: tempState, _originalResponse: content }; }, function(e) { self._currentNbQueries--; if (self._currentNbQueries === 0) self.emit('searchQueueEmpty'); throw e; }); }; /** * Structure of each result when using * [`searchForFacetValues()`](reference.html#AlgoliaSearchHelper#searchForFacetValues) * @typedef FacetSearchHit * @type {object} * @property {string} value the facet value * @property {string} highlighted the facet value highlighted with the query string * @property {number} count number of occurrence of this facet value * @property {boolean} isRefined true if the value is already refined */ /** * Structure of the data resolved by the * [`searchForFacetValues()`](reference.html#AlgoliaSearchHelper#searchForFacetValues) * promise. * @typedef FacetSearchResult * @type {object} * @property {FacetSearchHit} facetHits the results for this search for facet values * @property {number} processingTimeMS time taken by the query inside the engine */ /** * Search for facet values based on an query and the name of a faceted attribute. This * triggers a search and will return a promise. On top of using the query, it also sends * the parameters from the state so that the search is narrowed down to only the possible values. * * See the description of [FacetSearchResult](reference.html#FacetSearchResult) * @param {string} facet the name of the faceted attribute * @param {string} query the string query for the search * @param {number} [maxFacetHits] the maximum number values returned. Should be > 0 and <= 100 * @param {object} [userState] the set of custom parameters to use on top of the current state. Setting a property to `undefined` removes * it in the generated query. * @return {promise.<FacetSearchResult>} the results of the search */ AlgoliaSearchHelper.prototype.searchForFacetValues = function(facet, query, maxFacetHits, userState) { var clientHasSFFV = typeof this.client.searchForFacetValues === 'function'; if ( !clientHasSFFV && typeof this.client.initIndex !== 'function' ) { throw new Error( 'search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues or client.initIndex(index).searchForFacetValues' ); } var state = this.state.setQueryParameters(userState || {}); var isDisjunctive = state.isDisjunctiveFacet(facet); var algoliaQuery = requestBuilder_1.getSearchForFacetQuery(facet, query, maxFacetHits, state); this._currentNbQueries++; var self = this; this.emit('searchForFacetValues', { state: state, facet: facet, query: query }); var searchForFacetValuesPromise = clientHasSFFV ? this.client.searchForFacetValues([{indexName: state.index, params: algoliaQuery}]) : this.client.initIndex(state.index).searchForFacetValues(algoliaQuery); return searchForFacetValuesPromise.then(function addIsRefined(content) { self._currentNbQueries--; if (self._currentNbQueries === 0) self.emit('searchQueueEmpty'); content = Array.isArray(content) ? content[0] : content; content.facetHits.forEach(function(f) { f.isRefined = isDisjunctive ? state.isDisjunctiveFacetRefined(facet, f.value) : state.isFacetRefined(facet, f.value); }); return content; }, function(e) { self._currentNbQueries--; if (self._currentNbQueries === 0) self.emit('searchQueueEmpty'); throw e; }); }; /** * Sets the text query used for the search. * * This method resets the current page to 0. * @param {string} q the user query * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.setQuery = function(q) { this._change({ state: this.state.resetPage().setQuery(q), isPageReset: true }); return this; }; /** * Remove all the types of refinements except tags. A string can be provided to remove * only the refinements of a specific attribute. For more advanced use case, you can * provide a function instead. This function should follow the * [clearCallback definition](#SearchParameters.clearCallback). * * This method resets the current page to 0. * @param {string} [name] optional name of the facet / attribute on which we want to remove all refinements * @return {AlgoliaSearchHelper} * @fires change * @chainable * @example * // Removing all the refinements * helper.clearRefinements().search(); * @example * // Removing all the filters on a the category attribute. * helper.clearRefinements('category').search(); * @example * // Removing only the exclude filters on the category facet. * helper.clearRefinements(function(value, attribute, type) { * return type === 'exclude' && attribute === 'category'; * }).search(); */ AlgoliaSearchHelper.prototype.clearRefinements = function(name) { this._change({ state: this.state.resetPage().clearRefinements(name), isPageReset: true }); return this; }; /** * Remove all the tag filters. * * This method resets the current page to 0. * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.clearTags = function() { this._change({ state: this.state.resetPage().clearTags(), isPageReset: true }); return this; }; /** * Adds a disjunctive filter to a faceted attribute with the `value` provided. If the * filter is already set, it doesn't change the filters. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} value the associated value (will be converted to string) * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.addDisjunctiveFacetRefinement = function(facet, value) { this._change({ state: this.state.resetPage().addDisjunctiveFacetRefinement(facet, value), isPageReset: true }); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addDisjunctiveFacetRefinement} */ AlgoliaSearchHelper.prototype.addDisjunctiveRefine = function() { return this.addDisjunctiveFacetRefinement.apply(this, arguments); }; /** * Adds a refinement on a hierarchical facet. It will throw * an exception if the facet is not defined or if the facet * is already refined. * * This method resets the current page to 0. * @param {string} facet the facet name * @param {string} path the hierarchical facet path * @return {AlgoliaSearchHelper} * @throws Error if the facet is not defined or if the facet is refined * @chainable * @fires change */ AlgoliaSearchHelper.prototype.addHierarchicalFacetRefinement = function(facet, value) { this._change({ state: this.state.resetPage().addHierarchicalFacetRefinement(facet, value), isPageReset: true }); return this; }; /** * Adds a an numeric filter to an attribute with the `operator` and `value` provided. If the * filter is already set, it doesn't change the filters. * * This method resets the current page to 0. * @param {string} attribute the attribute on which the numeric filter applies * @param {string} operator the operator of the filter * @param {number} value the value of the filter * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.addNumericRefinement = function(attribute, operator, value) { this._change({ state: this.state.resetPage().addNumericRefinement(attribute, operator, value), isPageReset: true }); return this; }; /** * Adds a filter to a faceted attribute with the `value` provided. If the * filter is already set, it doesn't change the filters. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} value the associated value (will be converted to string) * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.addFacetRefinement = function(facet, value) { this._change({ state: this.state.resetPage().addFacetRefinement(facet, value), isPageReset: true }); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addFacetRefinement} */ AlgoliaSearchHelper.prototype.addRefine = function() { return this.addFacetRefinement.apply(this, arguments); }; /** * Adds a an exclusion filter to a faceted attribute with the `value` provided. If the * filter is already set, it doesn't change the filters. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} value the associated value (will be converted to string) * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.addFacetExclusion = function(facet, value) { this._change({ state: this.state.resetPage().addExcludeRefinement(facet, value), isPageReset: true }); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addFacetExclusion} */ AlgoliaSearchHelper.prototype.addExclude = function() { return this.addFacetExclusion.apply(this, arguments); }; /** * Adds a tag filter with the `tag` provided. If the * filter is already set, it doesn't change the filters. * * This method resets the current page to 0. * @param {string} tag the tag to add to the filter * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.addTag = function(tag) { this._change({ state: this.state.resetPage().addTagRefinement(tag), isPageReset: true }); return this; }; /** * Removes an numeric filter to an attribute with the `operator` and `value` provided. If the * filter is not set, it doesn't change the filters. * * Some parameters are optional, triggering different behavior: * - if the value is not provided, then all the numeric value will be removed for the * specified attribute/operator couple. * - if the operator is not provided either, then all the numeric filter on this attribute * will be removed. * * This method resets the current page to 0. * @param {string} attribute the attribute on which the numeric filter applies * @param {string} [operator] the operator of the filter * @param {number} [value] the value of the filter * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.removeNumericRefinement = function(attribute, operator, value) { this._change({ state: this.state.resetPage().removeNumericRefinement(attribute, operator, value), isPageReset: true }); return this; }; /** * Removes a disjunctive filter to a faceted attribute with the `value` provided. If the * filter is not set, it doesn't change the filters. * * If the value is omitted, then this method will remove all the filters for the * attribute. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} [value] the associated value * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.removeDisjunctiveFacetRefinement = function(facet, value) { this._change({ state: this.state.resetPage().removeDisjunctiveFacetRefinement(facet, value), isPageReset: true }); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeDisjunctiveFacetRefinement} */ AlgoliaSearchHelper.prototype.removeDisjunctiveRefine = function() { return this.removeDisjunctiveFacetRefinement.apply(this, arguments); }; /** * Removes the refinement set on a hierarchical facet. * @param {string} facet the facet name * @return {AlgoliaSearchHelper} * @throws Error if the facet is not defined or if the facet is not refined * @fires change * @chainable */ AlgoliaSearchHelper.prototype.removeHierarchicalFacetRefinement = function(facet) { this._change({ state: this.state.resetPage().removeHierarchicalFacetRefinement(facet), isPageReset: true }); return this; }; /** * Removes a filter to a faceted attribute with the `value` provided. If the * filter is not set, it doesn't change the filters. * * If the value is omitted, then this method will remove all the filters for the * attribute. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} [value] the associated value * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.removeFacetRefinement = function(facet, value) { this._change({ state: this.state.resetPage().removeFacetRefinement(facet, value), isPageReset: true }); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeFacetRefinement} */ AlgoliaSearchHelper.prototype.removeRefine = function() { return this.removeFacetRefinement.apply(this, arguments); }; /** * Removes an exclusion filter to a faceted attribute with the `value` provided. If the * filter is not set, it doesn't change the filters. * * If the value is omitted, then this method will remove all the filters for the * attribute. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} [value] the associated value * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.removeFacetExclusion = function(facet, value) { this._change({ state: this.state.resetPage().removeExcludeRefinement(facet, value), isPageReset: true }); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeFacetExclusion} */ AlgoliaSearchHelper.prototype.removeExclude = function() { return this.removeFacetExclusion.apply(this, arguments); }; /** * Removes a tag filter with the `tag` provided. If the * filter is not set, it doesn't change the filters. * * This method resets the current page to 0. * @param {string} tag tag to remove from the filter * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.removeTag = function(tag) { this._change({ state: this.state.resetPage().removeTagRefinement(tag), isPageReset: true }); return this; }; /** * Adds or removes an exclusion filter to a faceted attribute with the `value` provided. If * the value is set then it removes it, otherwise it adds the filter. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} value the associated value * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.toggleFacetExclusion = function(facet, value) { this._change({ state: this.state.resetPage().toggleExcludeFacetRefinement(facet, value), isPageReset: true }); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#toggleFacetExclusion} */ AlgoliaSearchHelper.prototype.toggleExclude = function() { return this.toggleFacetExclusion.apply(this, arguments); }; /** * Adds or removes a filter to a faceted attribute with the `value` provided. If * the value is set then it removes it, otherwise it adds the filter. * * This method can be used for conjunctive, disjunctive and hierarchical filters. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} value the associated value * @return {AlgoliaSearchHelper} * @throws Error will throw an error if the facet is not declared in the settings of the helper * @fires change * @chainable * @deprecated since version 2.19.0, see {@link AlgoliaSearchHelper#toggleFacetRefinement} */ AlgoliaSearchHelper.prototype.toggleRefinement = function(facet, value) { return this.toggleFacetRefinement(facet, value); }; /** * Adds or removes a filter to a faceted attribute with the `value` provided. If * the value is set then it removes it, otherwise it adds the filter. * * This method can be used for conjunctive, disjunctive and hierarchical filters. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} value the associated value * @return {AlgoliaSearchHelper} * @throws Error will throw an error if the facet is not declared in the settings of the helper * @fires change * @chainable */ AlgoliaSearchHelper.prototype.toggleFacetRefinement = function(facet, value) { this._change({ state: this.state.resetPage().toggleFacetRefinement(facet, value), isPageReset: true }); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#toggleFacetRefinement} */ AlgoliaSearchHelper.prototype.toggleRefine = function() { return this.toggleFacetRefinement.apply(this, arguments); }; /** * Adds or removes a tag filter with the `value` provided. If * the value is set then it removes it, otherwise it adds the filter. * * This method resets the current page to 0. * @param {string} tag tag to remove or add * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.toggleTag = function(tag) { this._change({ state: this.state.resetPage().toggleTagRefinement(tag), isPageReset: true }); return this; }; /** * Increments the page number by one. * @return {AlgoliaSearchHelper} * @fires change * @chainable * @example * helper.setPage(0).nextPage().getPage(); * // returns 1 */ AlgoliaSearchHelper.prototype.nextPage = function() { var page = this.state.page || 0; return this.setPage(page + 1); }; /** * Decrements the page number by one. * @fires change * @return {AlgoliaSearchHelper} * @chainable * @example * helper.setPage(1).previousPage().getPage(); * // returns 0 */ AlgoliaSearchHelper.prototype.previousPage = function() { var page = this.state.page || 0; return this.setPage(page - 1); }; /** * @private */ function setCurrentPage(page) { if (page < 0) throw new Error('Page requested below 0.'); this._change({ state: this.state.setPage(page), isPageReset: false }); return this; } /** * Change the current page * @deprecated * @param {number} page The page number * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.setCurrentPage = setCurrentPage; /** * Updates the current page. * @function * @param {number} page The page number * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.setPage = setCurrentPage; /** * Updates the name of the index that will be targeted by the query. * * This method resets the current page to 0. * @param {string} name the index name * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.setIndex = function(name) { this._change({ state: this.state.resetPage().setIndex(name), isPageReset: true }); return this; }; /** * Update a parameter of the search. This method reset the page * * The complete list of parameters is available on the * [Algolia website](https://www.algolia.com/doc/rest#query-an-index). * The most commonly used parameters have their own [shortcuts](#query-parameters-shortcuts) * or benefit from higher-level APIs (all the kind of filters and facets have their own API) * * This method resets the current page to 0. * @param {string} parameter name of the parameter to update * @param {any} value new value of the parameter * @return {AlgoliaSearchHelper} * @fires change * @chainable * @example * helper.setQueryParameter('hitsPerPage', 20).search(); */ AlgoliaSearchHelper.prototype.setQueryParameter = function(parameter, value) { this._change({ state: this.state.resetPage().setQueryParameter(parameter, value), isPageReset: true }); return this; }; /** * Set the whole state (warning: will erase previous state) * @param {SearchParameters} newState the whole new state * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.setState = function(newState) { this._change({ state: SearchParameters_1.make(newState), isPageReset: false }); return this; }; /** * Override the current state without triggering a change event. * Do not use this method unless you know what you are doing. (see the example * for a legit use case) * @param {SearchParameters} newState the whole new state * @return {AlgoliaSearchHelper} * @example * helper.on('change', function(state){ * // In this function you might want to find a way to store the state in the url/history * updateYourURL(state) * }) * window.onpopstate = function(event){ * // This is naive though as you should check if the state is really defined etc. * helper.overrideStateWithoutTriggeringChangeEvent(event.state).search() * } * @chainable */ AlgoliaSearchHelper.prototype.overrideStateWithoutTriggeringChangeEvent = function(newState) { this.state = new SearchParameters_1(newState); return this; }; /** * Check if an attribute has any numeric, conjunctive, disjunctive or hierarchical filters. * @param {string} attribute the name of the attribute * @return {boolean} true if the attribute is filtered by at least one value * @example * // hasRefinements works with numeric, conjunctive, disjunctive and hierarchical filters * helper.hasRefinements('price'); // false * helper.addNumericRefinement('price', '>', 100); * helper.hasRefinements('price'); // true * * helper.hasRefinements('color'); // false * helper.addFacetRefinement('color', 'blue'); * helper.hasRefinements('color'); // true * * helper.hasRefinements('material'); // false * helper.addDisjunctiveFacetRefinement('material', 'plastic'); * helper.hasRefinements('material'); // true * * helper.hasRefinements('categories'); // false * helper.toggleFacetRefinement('categories', 'kitchen > knife'); * helper.hasRefinements('categories'); // true * */ AlgoliaSearchHelper.prototype.hasRefinements = function(attribute) { if (objectHasKeys_1(this.state.getNumericRefinements(attribute))) { return true; } else if (this.state.isConjunctiveFacet(attribute)) { return this.state.isFacetRefined(attribute); } else if (this.state.isDisjunctiveFacet(attribute)) { return this.state.isDisjunctiveFacetRefined(attribute); } else if (this.state.isHierarchicalFacet(attribute)) { return this.state.isHierarchicalFacetRefined(attribute); } // there's currently no way to know that the user did call `addNumericRefinement` at some point // thus we cannot distinguish if there once was a numeric refinement that was cleared // so we will return false in every other situations to be consistent // while what we should do here is throw because we did not find the attribute in any type // of refinement return false; }; /** * Check if a value is excluded for a specific faceted attribute. If the value * is omitted then the function checks if there is any excluding refinements. * * @param {string} facet name of the attribute for used for faceting * @param {string} [value] optional value. If passed will test that this value * is filtering the given facet. * @return {boolean} true if refined * @example * helper.isExcludeRefined('color'); // false * helper.isExcludeRefined('color', 'blue') // false * helper.isExcludeRefined('color', 'red') // false * * helper.addFacetExclusion('color', 'red'); * * helper.isExcludeRefined('color'); // true * helper.isExcludeRefined('color', 'blue') // false * helper.isExcludeRefined('color', 'red') // true */ AlgoliaSearchHelper.prototype.isExcluded = function(facet, value) { return this.state.isExcludeRefined(facet, value); }; /** * @deprecated since 2.4.0, see {@link AlgoliaSearchHelper#hasRefinements} */ AlgoliaSearchHelper.prototype.isDisjunctiveRefined = function(facet, value) { return this.state.isDisjunctiveFacetRefined(facet, value); }; /** * Check if the string is a currently filtering tag. * @param {string} tag tag to check * @return {boolean} */ AlgoliaSearchHelper.prototype.hasTag = function(tag) { return this.state.isTagRefined(tag); }; /** * @deprecated since 2.4.0, see {@link AlgoliaSearchHelper#hasTag} */ AlgoliaSearchHelper.prototype.isTagRefined = function() { return this.hasTagRefinements.apply(this, arguments); }; /** * Get the name of the currently used index. * @return {string} * @example * helper.setIndex('highestPrice_products').getIndex(); * // returns 'highestPrice_products' */ AlgoliaSearchHelper.prototype.getIndex = function() { return this.state.index; }; function getCurrentPage() { return this.state.page; } /** * Get the currently selected page * @deprecated * @return {number} the current page */ AlgoliaSearchHelper.prototype.getCurrentPage = getCurrentPage; /** * Get the currently selected page * @function * @return {number} the current page */ AlgoliaSearchHelper.prototype.getPage = getCurrentPage; /** * Get all the tags currently set to filters the results. * * @return {string[]} The list of tags currently set. */ AlgoliaSearchHelper.prototype.getTags = function() { return this.state.tagRefinements; }; /** * Get the list of refinements for a given attribute. This method works with * conjunctive, disjunctive, excluding and numerical filters. * * See also SearchResults#getRefinements * * @param {string} facetName attribute name used for faceting * @return {Array.<FacetRefinement|NumericRefinement>} All Refinement are objects that contain a value, and * a type. Numeric also contains an operator. * @example * helper.addNumericRefinement('price', '>', 100); * helper.getRefinements('price'); * // [ * // { * // "value": [ * // 100 * // ], * // "operator": ">", * // "type": "numeric" * // } * // ] * @example * helper.addFacetRefinement('color', 'blue'); * helper.addFacetExclusion('color', 'red'); * helper.getRefinements('color'); * // [ * // { * // "value": "blue", * // "type": "conjunctive" * // }, * // { * // "value": "red", * // "type": "exclude" * // } * // ] * @example * helper.addDisjunctiveFacetRefinement('material', 'plastic'); * // [ * // { * // "value": "plastic", * // "type": "disjunctive" * // } * // ] */ AlgoliaSearchHelper.prototype.getRefinements = function(facetName) { var refinements = []; if (this.state.isConjunctiveFacet(facetName)) { var conjRefinements = this.state.getConjunctiveRefinements(facetName); conjRefinements.forEach(function(r) { refinements.push({ value: r, type: 'conjunctive' }); }); var excludeRefinements = this.state.getExcludeRefinements(facetName); excludeRefinements.forEach(function(r) { refinements.push({ value: r, type: 'exclude' }); }); } else if (this.state.isDisjunctiveFacet(facetName)) { var disjRefinements = this.state.getDisjunctiveRefinements(facetName); disjRefinements.forEach(function(r) { refinements.push({ value: r, type: 'disjunctive' }); }); } var numericRefinements = this.state.getNumericRefinements(facetName); Object.keys(numericRefinements).forEach(function(operator) { var value = numericRefinements[operator]; refinements.push({ value: value, operator: operator, type: 'numeric' }); }); return refinements; }; /** * Return the current refinement for the (attribute, operator) * @param {string} attribute attribute in the record * @param {string} operator operator applied on the refined values * @return {Array.<number|number[]>} refined values */ AlgoliaSearchHelper.prototype.getNumericRefinement = function(attribute, operator) { return this.state.getNumericRefinement(attribute, operator); }; /** * Get the current breadcrumb for a hierarchical facet, as an array * @param {string} facetName Hierarchical facet name * @return {array.<string>} the path as an array of string */ AlgoliaSearchHelper.prototype.getHierarchicalFacetBreadcrumb = function(facetName) { return this.state.getHierarchicalFacetBreadcrumb(facetName); }; // /////////// PRIVATE /** * Perform the underlying queries * @private * @return {undefined} * @fires search * @fires result * @fires error */ AlgoliaSearchHelper.prototype._search = function(options) { var state = this.state; var states = []; var mainQueries = []; if (!options.onlyWithDerivedHelpers) { mainQueries = requestBuilder_1._getQueries(state.index, state); states.push({ state: state, queriesCount: mainQueries.length, helper: this }); this.emit('search', { state: state, results: this.lastResults }); } var derivedQueries = this.derivedHelpers.map(function(derivedHelper) { var derivedState = derivedHelper.getModifiedState(state); var derivedStateQueries = requestBuilder_1._getQueries(derivedState.index, derivedState); states.push({ state: derivedState, queriesCount: derivedStateQueries.length, helper: derivedHelper }); derivedHelper.emit('search', { state: derivedState, results: derivedHelper.lastResults }); return derivedStateQueries; }); var queries = Array.prototype.concat.apply(mainQueries, derivedQueries); var queryId = this._queryId++; this._currentNbQueries++; try { this.client.search(queries) .then(this._dispatchAlgoliaResponse.bind(this, states, queryId)) .catch(this._dispatchAlgoliaError.bind(this, queryId)); } catch (error) { // If we reach this part, we're in an internal error state this.emit('error', { error: error }); } }; /** * Transform the responses as sent by the server and transform them into a user * usable object that merge the results of all the batch requests. It will dispatch * over the different helper + derived helpers (when there are some). * @private * @param {array.<{SearchParameters, AlgoliaQueries, AlgoliaSearchHelper}>} * state state used for to generate the request * @param {number} queryId id of the current request * @param {object} content content of the response * @return {undefined} */ AlgoliaSearchHelper.prototype._dispatchAlgoliaResponse = function(states, queryId, content) { // FIXME remove the number of outdated queries discarded instead of just one if (queryId < this._lastQueryIdReceived) { // Outdated answer return; } this._currentNbQueries -= (queryId - this._lastQueryIdReceived); this._lastQueryIdReceived = queryId; if (this._currentNbQueries === 0) this.emit('searchQueueEmpty'); var results = content.results.slice(); states.forEach(function(s) { var state = s.state; var queriesCount = s.queriesCount; var helper = s.helper; var specificResults = results.splice(0, queriesCount); var formattedResponse = helper.lastResults = new SearchResults_1(state, specificResults); helper.emit('result', { results: formattedResponse, state: state }); }); }; AlgoliaSearchHelper.prototype._dispatchAlgoliaError = function(queryId, error) { if (queryId < this._lastQueryIdReceived) { // Outdated answer return; } this._currentNbQueries -= queryId - this._lastQueryIdReceived; this._lastQueryIdReceived = queryId; this.emit('error', { error: error }); if (this._currentNbQueries === 0) this.emit('searchQueueEmpty'); }; AlgoliaSearchHelper.prototype.containsRefinement = function(query, facetFilters, numericFilters, tagFilters) { return query || facetFilters.length !== 0 || numericFilters.length !== 0 || tagFilters.length !== 0; }; /** * Test if there are some disjunctive refinements on the facet * @private * @param {string} facet the attribute to test * @return {boolean} */ AlgoliaSearchHelper.prototype._hasDisjunctiveRefinements = function(facet) { return this.state.disjunctiveRefinements[facet] && this.state.disjunctiveRefinements[facet].length > 0; }; AlgoliaSearchHelper.prototype._change = function(event) { var state = event.state; var isPageReset = event.isPageReset; if (state !== this.state) { this.state = state; this.emit('change', { state: this.state, results: this.lastResults, isPageReset: isPageReset }); } }; /** * Clears the cache of the underlying Algolia client. * @return {AlgoliaSearchHelper} */ AlgoliaSearchHelper.prototype.clearCache = function() { this.client.clearCache && this.client.clearCache(); return this; }; /** * Updates the internal client instance. If the reference of the clients * are equal then no update is actually done. * @param {AlgoliaSearch} newClient an AlgoliaSearch client * @return {AlgoliaSearchHelper} */ AlgoliaSearchHelper.prototype.setClient = function(newClient) { if (this.client === newClient) return this; if (typeof newClient.addAlgoliaAgent === 'function') { newClient.addAlgoliaAgent('JS Helper (' + version$1 + ')'); } this.client = newClient; return this; }; /** * Gets the instance of the currently used client. * @return {AlgoliaSearch} */ AlgoliaSearchHelper.prototype.getClient = function() { return this.client; }; /** * Creates an derived instance of the Helper. A derived helper * is a way to request other indices synchronised with the lifecycle * of the main Helper. This mechanism uses the multiqueries feature * of Algolia to aggregate all the requests in a single network call. * * This method takes a function that is used to create a new SearchParameter * that will be used to create requests to Algolia. Those new requests * are created just before the `search` event. The signature of the function * is `SearchParameters -> SearchParameters`. * * This method returns a new DerivedHelper which is an EventEmitter * that fires the same `search`, `result` and `error` events. Those * events, however, will receive data specific to this DerivedHelper * and the SearchParameters that is returned by the call of the * parameter function. * @param {function} fn SearchParameters -> SearchParameters * @return {DerivedHelper} */ AlgoliaSearchHelper.prototype.derive = function(fn) { var derivedHelper = new DerivedHelper_1(this, fn); this.derivedHelpers.push(derivedHelper); return derivedHelper; }; /** * This method detaches a derived Helper from the main one. Prefer using the one from the * derived helper itself, to remove the event listeners too. * @private * @return {undefined} * @throws Error */ AlgoliaSearchHelper.prototype.detachDerivedHelper = function(derivedHelper) { var pos = this.derivedHelpers.indexOf(derivedHelper); if (pos === -1) throw new Error('Derived helper already detached'); this.derivedHelpers.splice(pos, 1); }; /** * This method returns true if there is currently at least one on-going search. * @return {boolean} true if there is a search pending */ AlgoliaSearchHelper.prototype.hasPendingRequests = function() { return this._currentNbQueries > 0; }; /** * @typedef AlgoliaSearchHelper.NumericRefinement * @type {object} * @property {number[]} value the numbers that are used for filtering this attribute with * the operator specified. * @property {string} operator the faceting data: value, number of entries * @property {string} type will be 'numeric' */ /** * @typedef AlgoliaSearchHelper.FacetRefinement * @type {object} * @property {string} value the string use to filter the attribute * @property {string} type the type of filter: 'conjunctive', 'disjunctive', 'exclude' */ var algoliasearch_helper = AlgoliaSearchHelper; /** * The algoliasearchHelper module is the function that will let its * contains everything needed to use the Algoliasearch * Helper. It is a also a function that instanciate the helper. * To use the helper, you also need the Algolia JS client v3. * @example * //using the UMD build * var client = algoliasearch('latency', '6be0576ff61c053d5f9a3225e2a90f76'); * var helper = algoliasearchHelper(client, 'bestbuy', { * facets: ['shipping'], * disjunctiveFacets: ['category'] * }); * helper.on('result', function(event) { * console.log(event.results); * }); * helper * .toggleFacetRefinement('category', 'Movies & TV Shows') * .toggleFacetRefinement('shipping', 'Free shipping') * .search(); * @example * // The helper is an event emitter using the node API * helper.on('result', updateTheResults); * helper.once('result', updateTheResults); * helper.removeListener('result', updateTheResults); * helper.removeAllListeners('result'); * @module algoliasearchHelper * @param {AlgoliaSearch} client an AlgoliaSearch client * @param {string} index the name of the index to query * @param {SearchParameters|object} opts an object defining the initial config of the search. It doesn't have to be a {SearchParameters}, just an object containing the properties you need from it. * @return {AlgoliaSearchHelper} */ function algoliasearchHelper(client, index, opts) { return new algoliasearch_helper(client, index, opts); } /** * The version currently used * @member module:algoliasearchHelper.version * @type {number} */ algoliasearchHelper.version = version$1; /** * Constructor for the Helper. * @member module:algoliasearchHelper.AlgoliaSearchHelper * @type {AlgoliaSearchHelper} */ algoliasearchHelper.AlgoliaSearchHelper = algoliasearch_helper; /** * Constructor for the object containing all the parameters of the search. * @member module:algoliasearchHelper.SearchParameters * @type {SearchParameters} */ algoliasearchHelper.SearchParameters = SearchParameters_1; /** * Constructor for the object containing the results of the search. * @member module:algoliasearchHelper.SearchResults * @type {SearchResults} */ algoliasearchHelper.SearchResults = SearchResults_1; var algoliasearchHelper_1 = algoliasearchHelper; function createOptionalFilter(_ref) { var attributeName = _ref.attributeName, attributeValue = _ref.attributeValue, attributeScore = _ref.attributeScore; return "".concat(attributeName, ":").concat(attributeValue, "<score=").concat(attributeScore || 1, ">"); } var defaultProps = { transformSearchParameters: function transformSearchParameters(x) { return _objectSpread({}, x); } }; function getId$1() { // We store the search state of this widget in `configure`. return 'configure'; } function getSearchParametersFromProps(props) { var optionalFilters = Object.keys(props.matchingPatterns).reduce(function (acc, attributeName) { var attributePattern = props.matchingPatterns[attributeName]; var attributeValue = getPropertyByPath(props.hit, attributeName); var attributeScore = attributePattern.score; if (Array.isArray(attributeValue)) { return [].concat(_toConsumableArray(acc), [attributeValue.map(function (attributeSubValue) { return createOptionalFilter({ attributeName: attributeName, attributeValue: attributeSubValue, attributeScore: attributeScore }); })]); } if (typeof attributeValue === 'string') { return [].concat(_toConsumableArray(acc), [createOptionalFilter({ attributeName: attributeName, attributeValue: attributeValue, attributeScore: attributeScore })]); } return acc; }, []); return props.transformSearchParameters(new algoliasearchHelper_1.SearchParameters({ // @ts-ignore @TODO algoliasearch-helper@3.0.1 will contain the type // `sumOrFiltersScores`. // See https://github.com/algolia/algoliasearch-helper-js/pull/753 sumOrFiltersScores: true, facetFilters: ["objectID:-".concat(props.hit.objectID)], optionalFilters: optionalFilters })); } var connectConfigureRelatedItems = createConnectorWithContext({ displayName: 'AlgoliaConfigureRelatedItems', defaultProps: defaultProps, getProvidedProps: function getProvidedProps() { return {}; }, getSearchParameters: function getSearchParameters(searchParameters, props) { return searchParameters.setQueryParameters(getSearchParametersFromProps(props)); }, transitionState: function transitionState(props, _prevSearchState, nextSearchState) { var id = getId$1(); // We need to transform the exhaustive search parameters back to clean // search parameters without the empty default keys so we don't pollute the // `configure` search state. var searchParameters = removeEmptyArraysFromObject(removeEmptyKey(getSearchParametersFromProps(props))); var searchParametersKeys = Object.keys(searchParameters); var nonPresentKeys = this._searchParameters ? Object.keys(this._searchParameters).filter(function (prop) { return searchParametersKeys.indexOf(prop) === -1; }) : []; this._searchParameters = searchParameters; var nextValue = _defineProperty({}, id, _objectSpread({}, omit(nextSearchState[id], nonPresentKeys), searchParameters)); return refineValue(nextSearchState, nextValue, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, cleanUp: function cleanUp(props, searchState) { var _this = this; var id = getId$1(); var indexId = getIndexId({ ais: props.contextValue, multiIndexContext: props.indexContextValue }); var subState = hasMultipleIndices({ ais: props.contextValue, multiIndexContext: props.indexContextValue }) && searchState.indices ? searchState.indices[indexId] : searchState; var configureKeys = subState && subState[id] ? Object.keys(subState[id]) : []; var configureState = configureKeys.reduce(function (acc, item) { if (!_this._searchParameters[item]) { acc[item] = subState[id][item]; } return acc; }, {}); var nextValue = _defineProperty({}, id, configureState); return refineValue(searchState, nextValue, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); } }); function createCommonjsModule(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; } /* object-assign (c) Sindre Sorhus @license MIT */ /* eslint-disable no-unused-vars */ var getOwnPropertySymbols = Object.getOwnPropertySymbols; var hasOwnProperty = Object.prototype.hasOwnProperty; var propIsEnumerable = Object.prototype.propertyIsEnumerable; function toObject(val) { if (val === null || val === undefined) { throw new TypeError('Object.assign cannot be called with null or undefined'); } return Object(val); } function shouldUseNative() { try { if (!Object.assign) { return false; } // Detect buggy property enumeration order in older V8 versions. // https://bugs.chromium.org/p/v8/issues/detail?id=4118 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers test1[5] = 'de'; if (Object.getOwnPropertyNames(test1)[0] === '5') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test2 = {}; for (var i = 0; i < 10; i++) { test2['_' + String.fromCharCode(i)] = i; } var order2 = Object.getOwnPropertyNames(test2).map(function (n) { return test2[n]; }); if (order2.join('') !== '0123456789') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test3 = {}; 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { test3[letter] = letter; }); if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { return false; } return true; } catch (err) { // We don't expect any of the above to throw, but better to be safe. return false; } } var objectAssign = shouldUseNative() ? Object.assign : function (target, source) { var from; var to = toObject(target); var symbols; for (var s = 1; s < arguments.length; s++) { from = Object(arguments[s]); for (var key in from) { if (hasOwnProperty.call(from, key)) { to[key] = from[key]; } } if (getOwnPropertySymbols) { symbols = getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) { if (propIsEnumerable.call(from, symbols[i])) { to[symbols[i]] = from[symbols[i]]; } } } } return to; }; /** * 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. */ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; var ReactPropTypesSecret_1 = ReactPropTypesSecret; function emptyFunction() {} var factoryWithThrowingShims = function() { function shim(props, propName, componentName, location, propFullName, secret) { if (secret === ReactPropTypesSecret_1) { // It is still safe when called from React. return; } var err = new Error( 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types' ); err.name = 'Invariant Violation'; throw err; } shim.isRequired = shim; function getShim() { return shim; } // Important! // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. var ReactPropTypes = { array: shim, bool: shim, func: shim, number: shim, object: shim, string: shim, symbol: shim, any: shim, arrayOf: getShim, element: shim, instanceOf: getShim, node: shim, objectOf: getShim, oneOf: getShim, oneOfType: getShim, shape: getShim, exact: getShim }; ReactPropTypes.checkPropTypes = emptyFunction; ReactPropTypes.PropTypes = ReactPropTypes; return ReactPropTypes; }; var propTypes = createCommonjsModule(function (module) { /** * 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. */ { // By explicitly using `prop-types` you are opting into new production behavior. // http://fb.me/prop-types-in-prod module.exports = factoryWithThrowingShims(); } }); function ConfigureRelatedItems() { return null; } ConfigureRelatedItems.propTypes = { hit: propTypes.object.isRequired, matchingPatterns: propTypes.object.isRequired, transformSearchParameters: propTypes.func }; var ConfigureRelatedItems$1 = connectConfigureRelatedItems(ConfigureRelatedItems); function getIndexContext(props) { return { targetedIndex: props.indexId }; } /** * The component that allows you to apply widgets to a dedicated index. It's * useful if you want to build an interface that targets multiple indices. * * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, Index, SearchBox, Hits, Configure } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <Configure hitsPerPage={5} /> * <SearchBox /> * <Index indexName="instant_search"> * <Hits /> * </Index> * <Index indexName="bestbuy"> * <Hits /> * </Index> * </InstantSearch> * ); */ var Index = /*#__PURE__*/ function (_Component) { _inherits(Index, _Component); _createClass(Index, null, [{ key: "getDerivedStateFromProps", value: function getDerivedStateFromProps(props) { return { indexContext: getIndexContext(props) }; } }]); function Index(props) { var _this; _classCallCheck(this, Index); _this = _possibleConstructorReturn(this, _getPrototypeOf(Index).call(this, props)); _defineProperty(_assertThisInitialized(_this), "state", { indexContext: getIndexContext(_this.props) }); _defineProperty(_assertThisInitialized(_this), "unregisterWidget", void 0); _this.props.contextValue.onSearchParameters(_this.getSearchParameters.bind(_assertThisInitialized(_this)), { ais: _this.props.contextValue, multiIndexContext: _this.state.indexContext }, _this.props, undefined); return _this; } _createClass(Index, [{ key: "componentDidMount", value: function componentDidMount() { this.unregisterWidget = this.props.contextValue.widgetsManager.registerWidget(this); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (this.props.indexName !== prevProps.indexName) { this.props.contextValue.widgetsManager.update(); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { if (typeof this.unregisterWidget === 'function') { this.unregisterWidget(); } } }, { key: "getSearchParameters", value: function getSearchParameters(searchParameters, props) { return searchParameters.setIndex(this.props ? this.props.indexName : props.indexName); } }, { key: "render", value: function render() { var childrenCount = React.Children.count(this.props.children); if (childrenCount === 0) { return null; } return React__default.createElement(IndexProvider, { value: this.state.indexContext }, this.props.children); } }]); return Index; }(React.Component); _defineProperty(Index, "propTypes", { indexName: propTypes.string.isRequired, indexId: propTypes.string.isRequired, children: propTypes.node }); var IndexWrapper = function IndexWrapper(props) { var inferredIndexId = props.indexName; return React__default.createElement(InstantSearchConsumer, null, function (contextValue) { return React__default.createElement(Index, _extends({ contextValue: contextValue, indexId: inferredIndexId }, props)); }); }; function createWidgetsManager(onWidgetsUpdate) { var widgets = []; // Is an update scheduled? var scheduled = false; // The state manager's updates need to be batched since more than one // component can register or unregister widgets during the same tick. function scheduleUpdate() { if (scheduled) { return; } scheduled = true; defer(function () { scheduled = false; onWidgetsUpdate(); }); } return { registerWidget: function registerWidget(widget) { widgets.push(widget); scheduleUpdate(); return function unregisterWidget() { widgets.splice(widgets.indexOf(widget), 1); scheduleUpdate(); }; }, update: scheduleUpdate, getWidgets: function getWidgets() { return widgets; } }; } function createStore(initialState) { var state = initialState; var listeners = []; return { getState: function getState() { return state; }, setState: function setState(nextState) { state = nextState; listeners.forEach(function (listener) { return listener(); }); }, subscribe: function subscribe(listener) { listeners.push(listener); return function unsubscribe() { listeners.splice(listeners.indexOf(listener), 1); }; } }; } function addAlgoliaAgents(searchClient) { if (typeof searchClient.addAlgoliaAgent === 'function') { searchClient.addAlgoliaAgent("react (".concat(React.version, ")")); searchClient.addAlgoliaAgent("react-instantsearch (".concat(version, ")")); } } var isMultiIndexContext = function isMultiIndexContext(widget) { return hasMultipleIndices({ ais: widget.props.contextValue, multiIndexContext: widget.props.indexContextValue }); }; var isTargetedIndexEqualIndex = function isTargetedIndexEqualIndex(widget, indexId) { return widget.props.indexContextValue.targetedIndex === indexId; }; // Relying on the `indexId` is a bit brittle to detect the `Index` widget. // Since it's a class we could rely on `instanceof` or similar. We never // had an issue though. Works for now. var isIndexWidget = function isIndexWidget(widget) { return Boolean(widget.props.indexId); }; var isIndexWidgetEqualIndex = function isIndexWidgetEqualIndex(widget, indexId) { return widget.props.indexId === indexId; }; var sortIndexWidgetsFirst = function sortIndexWidgetsFirst(firstWidget, secondWidget) { var isFirstWidgetIndex = isIndexWidget(firstWidget); var isSecondWidgetIndex = isIndexWidget(secondWidget); if (isFirstWidgetIndex && !isSecondWidgetIndex) { return -1; } if (!isFirstWidgetIndex && isSecondWidgetIndex) { return 1; } return 0; }; // This function is copied from the algoliasearch v4 API Client. If modified, // consider updating it also in `serializeQueryParameters` from `@algolia/transporter`. function serializeQueryParameters(parameters) { var isObjectOrArray = function isObjectOrArray(value) { return Object.prototype.toString.call(value) === '[object Object]' || Object.prototype.toString.call(value) === '[object Array]'; }; var encode = function encode(format) { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } var i = 0; return format.replace(/%s/g, function () { return encodeURIComponent(args[i++]); }); }; return Object.keys(parameters).map(function (key) { return encode('%s=%s', key, isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key]); }).join('&'); } /** * Creates a new instance of the InstantSearchManager which controls the widgets and * trigger the search when the widgets are updated. * @param {string} indexName - the main index name * @param {object} initialState - initial widget state * @param {object} SearchParameters - optional additional parameters to send to the algolia API * @param {number} stalledSearchDelay - time (in ms) after the search is stalled * @return {InstantSearchManager} a new instance of InstantSearchManager */ function createInstantSearchManager(_ref) { var indexName = _ref.indexName, _ref$initialState = _ref.initialState, initialState = _ref$initialState === void 0 ? {} : _ref$initialState, searchClient = _ref.searchClient, resultsState = _ref.resultsState, stalledSearchDelay = _ref.stalledSearchDelay; var helper = algoliasearchHelper_1(searchClient, indexName, _objectSpread({}, HIGHLIGHT_TAGS)); addAlgoliaAgents(searchClient); helper.on('search', handleNewSearch).on('result', handleSearchSuccess({ indexId: indexName })).on('error', handleSearchError); var skip = false; var stalledSearchTimer = null; var initialSearchParameters = helper.state; var widgetsManager = createWidgetsManager(onWidgetsUpdate); hydrateSearchClient(searchClient, resultsState); var store = createStore({ widgets: initialState, metadata: hydrateMetadata(resultsState), results: hydrateResultsState(resultsState), error: null, searching: false, isSearchStalled: true, searchingForFacetValues: false }); function skipSearch() { skip = true; } function updateClient(client) { addAlgoliaAgents(client); helper.setClient(client); search(); } function clearCache() { helper.clearCache(); search(); } function getMetadata(state) { return widgetsManager.getWidgets().filter(function (widget) { return Boolean(widget.getMetadata); }).map(function (widget) { return widget.getMetadata(state); }); } function getSearchParameters() { var sharedParameters = widgetsManager.getWidgets().filter(function (widget) { return Boolean(widget.getSearchParameters); }).filter(function (widget) { return !isMultiIndexContext(widget) && !isIndexWidget(widget); }).reduce(function (res, widget) { return widget.getSearchParameters(res); }, initialSearchParameters); var mainParameters = widgetsManager.getWidgets().filter(function (widget) { return Boolean(widget.getSearchParameters); }).filter(function (widget) { var targetedIndexEqualMainIndex = isMultiIndexContext(widget) && isTargetedIndexEqualIndex(widget, indexName); var subIndexEqualMainIndex = isIndexWidget(widget) && isIndexWidgetEqualIndex(widget, indexName); return targetedIndexEqualMainIndex || subIndexEqualMainIndex; }) // We have to sort the `Index` widgets first so the `index` parameter // is correctly set in the `reduce` function for the following widgets .sort(sortIndexWidgetsFirst).reduce(function (res, widget) { return widget.getSearchParameters(res); }, sharedParameters); var derivedIndices = widgetsManager.getWidgets().filter(function (widget) { return Boolean(widget.getSearchParameters); }).filter(function (widget) { var targetedIndexNotEqualMainIndex = isMultiIndexContext(widget) && !isTargetedIndexEqualIndex(widget, indexName); var subIndexNotEqualMainIndex = isIndexWidget(widget) && !isIndexWidgetEqualIndex(widget, indexName); return targetedIndexNotEqualMainIndex || subIndexNotEqualMainIndex; }) // We have to sort the `Index` widgets first so the `index` parameter // is correctly set in the `reduce` function for the following widgets .sort(sortIndexWidgetsFirst).reduce(function (indices, widget) { var indexId = isMultiIndexContext(widget) ? widget.props.indexContextValue.targetedIndex : widget.props.indexId; var widgets = indices[indexId] || []; return _objectSpread({}, indices, _defineProperty({}, indexId, widgets.concat(widget))); }, {}); var derivedParameters = Object.keys(derivedIndices).map(function (indexId) { return { parameters: derivedIndices[indexId].reduce(function (res, widget) { return widget.getSearchParameters(res); }, sharedParameters), indexId: indexId }; }); return { mainParameters: mainParameters, derivedParameters: derivedParameters }; } function search() { if (!skip) { var _getSearchParameters = getSearchParameters(), mainParameters = _getSearchParameters.mainParameters, derivedParameters = _getSearchParameters.derivedParameters; // We have to call `slice` because the method `detach` on the derived // helpers mutates the value `derivedHelpers`. The `forEach` loop does // not iterate on each value and we're not able to correctly clear the // previous derived helpers (memory leak + useless requests). helper.derivedHelpers.slice().forEach(function (derivedHelper) { // Since we detach the derived helpers on **every** new search they // won't receive intermediate results in case of a stalled search. // Only the last result is dispatched by the derived helper because // they are not detached yet: // // - a -> main helper receives results // - ap -> main helper receives results // - app -> main helper + derived helpers receive results // // The quick fix is to avoid to detach them on search but only once they // received the results. But it means that in case of a stalled search // all the derived helpers not detached yet register a new search inside // the helper. The number grows fast in case of a bad network and it's // not deterministic. derivedHelper.detach(); }); derivedParameters.forEach(function (_ref2) { var indexId = _ref2.indexId, parameters = _ref2.parameters; var derivedHelper = helper.derive(function () { return parameters; }); derivedHelper.on('result', handleSearchSuccess({ indexId: indexId })).on('error', handleSearchError); }); helper.setState(mainParameters); helper.search(); } } function handleSearchSuccess(_ref3) { var indexId = _ref3.indexId; return function (event) { var state = store.getState(); var isDerivedHelpersEmpty = !helper.derivedHelpers.length; var results = state.results ? state.results : {}; // Switching from mono index to multi index and vice versa must reset the // results to an empty object, otherwise we keep reference of stalled and // unused results. results = !isDerivedHelpersEmpty && results.getFacetByName ? {} : results; if (!isDerivedHelpersEmpty) { results = _objectSpread({}, results, _defineProperty({}, indexId, event.results)); } else { results = event.results; } var currentState = store.getState(); var nextIsSearchStalled = currentState.isSearchStalled; if (!helper.hasPendingRequests()) { clearTimeout(stalledSearchTimer); stalledSearchTimer = null; nextIsSearchStalled = false; } var resultsFacetValues = currentState.resultsFacetValues, partialState = _objectWithoutProperties(currentState, ["resultsFacetValues"]); store.setState(_objectSpread({}, partialState, { results: results, isSearchStalled: nextIsSearchStalled, searching: false, error: null })); }; } function handleSearchError(_ref4) { var error = _ref4.error; var currentState = store.getState(); var nextIsSearchStalled = currentState.isSearchStalled; if (!helper.hasPendingRequests()) { clearTimeout(stalledSearchTimer); nextIsSearchStalled = false; } var resultsFacetValues = currentState.resultsFacetValues, partialState = _objectWithoutProperties(currentState, ["resultsFacetValues"]); store.setState(_objectSpread({}, partialState, { isSearchStalled: nextIsSearchStalled, error: error, searching: false })); } function handleNewSearch() { if (!stalledSearchTimer) { stalledSearchTimer = setTimeout(function () { var _store$getState = store.getState(), resultsFacetValues = _store$getState.resultsFacetValues, partialState = _objectWithoutProperties(_store$getState, ["resultsFacetValues"]); store.setState(_objectSpread({}, partialState, { isSearchStalled: true })); }, stalledSearchDelay); } } function hydrateSearchClient(client, results) { if (!results) { return; } // Disable cache hydration on: // - Algoliasearch API Client < v4 with cache disabled // - Third party clients (detected by the `addAlgoliaAgent` function missing) if ((!client.transporter || client._cacheHydrated) && (!client._useCache || typeof client.addAlgoliaAgent !== 'function')) { return; } // Algoliasearch API Client >= v4 // To hydrate the client we need to populate the cache with the data from // the server (done in `hydrateSearchClientWithMultiIndexRequest` or // `hydrateSearchClientWithSingleIndexRequest`). But since there is no way // for us to compute the key the same way as `algoliasearch-client` we need // to populate it on a custom key and override the `search` method to // search on it first. if (client.transporter && !client._cacheHydrated) { client._cacheHydrated = true; var baseMethod = client.search; client.search = function (requests) { for (var _len2 = arguments.length, methodArgs = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { methodArgs[_key2 - 1] = arguments[_key2]; } var requestsWithSerializedParams = requests.map(function (request) { return _objectSpread({}, request, { params: serializeQueryParameters(request.params) }); }); return client.transporter.responsesCache.get({ method: 'search', args: [requestsWithSerializedParams].concat(methodArgs) }, function () { return baseMethod.apply(void 0, [requests].concat(methodArgs)); }); }; } if (Array.isArray(results.results)) { hydrateSearchClientWithMultiIndexRequest(client, results.results); return; } hydrateSearchClientWithSingleIndexRequest(client, results); } function hydrateSearchClientWithMultiIndexRequest(client, results) { // Algoliasearch API Client >= v4 // Populate the cache with the data from the server if (client.transporter) { client.transporter.responsesCache.set({ method: 'search', args: [results.reduce(function (acc, result) { return acc.concat(result.rawResults.map(function (request) { return { indexName: request.index, params: request.params }; })); }, [])] }, { results: results.reduce(function (acc, result) { return acc.concat(result.rawResults); }, []) }); return; } // Algoliasearch API Client < v4 // Prior to client v4 we didn't have a proper API to hydrate the client // cache from the outside. The following code populates the cache with // a single-index result. You can find more information about the // computation of the key inside the client (see link below). // https://github.com/algolia/algoliasearch-client-javascript/blob/c27e89ff92b2a854ae6f40dc524bffe0f0cbc169/src/AlgoliaSearchCore.js#L232-L240 var key = "/1/indexes/*/queries_body_".concat(JSON.stringify({ requests: results.reduce(function (acc, result) { return acc.concat(result.rawResults.map(function (request) { return { indexName: request.index, params: request.params }; })); }, []) })); client.cache = _objectSpread({}, client.cache, _defineProperty({}, key, JSON.stringify({ results: results.reduce(function (acc, result) { return acc.concat(result.rawResults); }, []) }))); } function hydrateSearchClientWithSingleIndexRequest(client, results) { // Algoliasearch API Client >= v4 // Populate the cache with the data from the server if (client.transporter) { client.transporter.responsesCache.set({ method: 'search', args: [results.rawResults.map(function (request) { return { indexName: request.index, params: request.params }; })] }, { results: results.rawResults }); return; } // Algoliasearch API Client < v4 // Prior to client v4 we didn't have a proper API to hydrate the client // cache from the outside. The following code populates the cache with // a single-index result. You can find more information about the // computation of the key inside the client (see link below). // https://github.com/algolia/algoliasearch-client-javascript/blob/c27e89ff92b2a854ae6f40dc524bffe0f0cbc169/src/AlgoliaSearchCore.js#L232-L240 var key = "/1/indexes/*/queries_body_".concat(JSON.stringify({ requests: results.rawResults.map(function (request) { return { indexName: request.index, params: request.params }; }) })); client.cache = _objectSpread({}, client.cache, _defineProperty({}, key, JSON.stringify({ results: results.rawResults }))); } function hydrateResultsState(results) { if (!results) { return null; } if (Array.isArray(results.results)) { return results.results.reduce(function (acc, result) { return _objectSpread({}, acc, _defineProperty({}, result._internalIndexId, new algoliasearchHelper_1.SearchResults(new algoliasearchHelper_1.SearchParameters(result.state), result.rawResults))); }, {}); } return new algoliasearchHelper_1.SearchResults(new algoliasearchHelper_1.SearchParameters(results.state), results.rawResults); } // Called whenever a widget has been rendered with new props. function onWidgetsUpdate() { var metadata = getMetadata(store.getState().widgets); store.setState(_objectSpread({}, store.getState(), { metadata: metadata, searching: true })); // Since the `getSearchParameters` method of widgets also depends on props, // the result search parameters might have changed. search(); } function transitionState(nextSearchState) { var searchState = store.getState().widgets; return widgetsManager.getWidgets().filter(function (widget) { return Boolean(widget.transitionState); }).reduce(function (res, widget) { return widget.transitionState(searchState, res); }, nextSearchState); } function onExternalStateUpdate(nextSearchState) { var metadata = getMetadata(nextSearchState); store.setState(_objectSpread({}, store.getState(), { widgets: nextSearchState, metadata: metadata, searching: true })); search(); } function onSearchForFacetValues(_ref5) { var facetName = _ref5.facetName, query = _ref5.query, _ref5$maxFacetHits = _ref5.maxFacetHits, maxFacetHits = _ref5$maxFacetHits === void 0 ? 10 : _ref5$maxFacetHits; // The values 1, 100 are the min / max values that the engine accepts. // see: https://www.algolia.com/doc/api-reference/api-parameters/maxFacetHits var maxFacetHitsWithinRange = Math.max(1, Math.min(maxFacetHits, 100)); store.setState(_objectSpread({}, store.getState(), { searchingForFacetValues: true })); helper.searchForFacetValues(facetName, query, maxFacetHitsWithinRange).then(function (content) { var _objectSpread7; store.setState(_objectSpread({}, store.getState(), { error: null, searchingForFacetValues: false, resultsFacetValues: _objectSpread({}, store.getState().resultsFacetValues, (_objectSpread7 = {}, _defineProperty(_objectSpread7, facetName, content.facetHits), _defineProperty(_objectSpread7, "query", query), _objectSpread7)) })); }, function (error) { store.setState(_objectSpread({}, store.getState(), { searchingForFacetValues: false, error: error })); }).catch(function (error) { // Since setState is synchronous, any error that occurs in the render of a // component will be swallowed by this promise. // This is a trick to make the error show up correctly in the console. // See http://stackoverflow.com/a/30741722/969302 setTimeout(function () { throw error; }); }); } function updateIndex(newIndex) { initialSearchParameters = initialSearchParameters.setIndex(newIndex); // No need to trigger a new search here as the widgets will also update and trigger it if needed. } function getWidgetsIds() { return store.getState().metadata.reduce(function (res, meta) { return typeof meta.id !== 'undefined' ? res.concat(meta.id) : res; }, []); } return { store: store, widgetsManager: widgetsManager, getWidgetsIds: getWidgetsIds, getSearchParameters: getSearchParameters, onSearchForFacetValues: onSearchForFacetValues, onExternalStateUpdate: onExternalStateUpdate, transitionState: transitionState, updateClient: updateClient, updateIndex: updateIndex, clearCache: clearCache, skipSearch: skipSearch }; } function hydrateMetadata(resultsState) { if (!resultsState) { return []; } // add a value noop, which gets replaced once the widgets are mounted return resultsState.metadata.map(function (datum) { return _objectSpread({ value: function value() {} }, datum, { items: datum.items && datum.items.map(function (item) { return _objectSpread({ value: function value() {} }, item, { items: item.items && item.items.map(function (nestedItem) { return _objectSpread({ value: function value() {} }, nestedItem); }) }); }) }); }); } function isControlled(props) { return Boolean(props.searchState); } /** * @description * `<InstantSearch>` is the root component of all React InstantSearch implementations. * It provides all the connected components (aka widgets) a means to interact * with the searchState. * @kind widget * @name <InstantSearch> * @requirements You will need to have an Algolia account to be able to use this widget. * [Create one now](https://www.algolia.com/users/sign_up). * @propType {string} indexName - Main index in which to search. * @propType {boolean} [refresh=false] - Flag to activate when the cache needs to be cleared so that the front-end is updated when a change occurs in the index. * @propType {object} [searchClient] - Provide a custom search client. * @propType {func} [onSearchStateChange] - Function to be called everytime a new search is done. Useful for [URL Routing](guide/Routing.html). * @propType {object} [searchState] - Object to inject some search state. Switches the InstantSearch component in controlled mode. Useful for [URL Routing](guide/Routing.html). * @propType {func} [createURL] - Function to call when creating links, useful for [URL Routing](guide/Routing.html). * @propType {SearchResults|SearchResults[]} [resultsState] - Use this to inject the results that will be used at first rendering. Those results are found by using the `findResultsState` function. Useful for [Server Side Rendering](guide/Server-side_rendering.html). * @propType {number} [stalledSearchDelay=200] - The amount of time before considering that the search takes too much time. The time is expressed in milliseconds. * @propType {{ Root: string|function, props: object }} [root] - Use this to customize the root element. Default value: `{ Root: 'div' }` * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, SearchBox, Hits } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <SearchBox /> * <Hits /> * </InstantSearch> * ); */ var InstantSearch = /*#__PURE__*/ function (_Component) { _inherits(InstantSearch, _Component); _createClass(InstantSearch, null, [{ key: "getDerivedStateFromProps", value: function getDerivedStateFromProps(nextProps, prevState) { var nextIsControlled = isControlled(nextProps); var previousSearchState = prevState.instantSearchManager.store.getState().widgets; var nextSearchState = nextProps.searchState; if (nextIsControlled && !reactFastCompare(previousSearchState, nextSearchState)) { prevState.instantSearchManager.onExternalStateUpdate(nextProps.searchState); } return { isControlled: nextIsControlled, contextValue: _objectSpread({}, prevState.contextValue, { mainTargetedIndex: nextProps.indexName }) }; } }]); function InstantSearch(props) { var _this; _classCallCheck(this, InstantSearch); _this = _possibleConstructorReturn(this, _getPrototypeOf(InstantSearch).call(this, props)); _defineProperty(_assertThisInitialized(_this), "isUnmounting", false); var instantSearchManager = createInstantSearchManager({ indexName: _this.props.indexName, searchClient: _this.props.searchClient, initialState: _this.props.searchState || {}, resultsState: _this.props.resultsState, stalledSearchDelay: _this.props.stalledSearchDelay }); var contextValue = { store: instantSearchManager.store, widgetsManager: instantSearchManager.widgetsManager, mainTargetedIndex: _this.props.indexName, onInternalStateUpdate: _this.onWidgetsInternalStateUpdate.bind(_assertThisInitialized(_this)), createHrefForState: _this.createHrefForState.bind(_assertThisInitialized(_this)), onSearchForFacetValues: _this.onSearchForFacetValues.bind(_assertThisInitialized(_this)), onSearchStateChange: _this.onSearchStateChange.bind(_assertThisInitialized(_this)), onSearchParameters: _this.onSearchParameters.bind(_assertThisInitialized(_this)) }; _this.state = { isControlled: isControlled(_this.props), instantSearchManager: instantSearchManager, contextValue: contextValue }; return _this; } _createClass(InstantSearch, [{ key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var prevIsControlled = isControlled(prevProps); if (prevIsControlled && !this.state.isControlled) { throw new Error("You can't switch <InstantSearch> from being controlled to uncontrolled"); } if (!prevIsControlled && this.state.isControlled) { throw new Error("You can't switch <InstantSearch> from being uncontrolled to controlled"); } if (this.props.refresh !== prevProps.refresh && this.props.refresh) { this.state.instantSearchManager.clearCache(); } if (prevProps.indexName !== this.props.indexName) { this.state.instantSearchManager.updateIndex(this.props.indexName); } if (prevProps.searchClient !== this.props.searchClient) { this.state.instantSearchManager.updateClient(this.props.searchClient); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.isUnmounting = true; this.state.instantSearchManager.skipSearch(); } }, { key: "createHrefForState", value: function createHrefForState(searchState) { searchState = this.state.instantSearchManager.transitionState(searchState); return this.state.isControlled && this.props.createURL ? this.props.createURL(searchState, this.getKnownKeys()) : '#'; } }, { key: "onWidgetsInternalStateUpdate", value: function onWidgetsInternalStateUpdate(searchState) { searchState = this.state.instantSearchManager.transitionState(searchState); this.onSearchStateChange(searchState); if (!this.state.isControlled) { this.state.instantSearchManager.onExternalStateUpdate(searchState); } } }, { key: "onSearchStateChange", value: function onSearchStateChange(searchState) { if (this.props.onSearchStateChange && !this.isUnmounting) { this.props.onSearchStateChange(searchState); } } }, { key: "onSearchParameters", value: function onSearchParameters(getSearchParameters, context, props, getMetadata) { if (this.props.onSearchParameters) { var _searchState = this.props.searchState ? this.props.searchState : {}; this.props.onSearchParameters(getSearchParameters, context, props, _searchState); } if (this.props.widgetsCollector) { var _searchState2 = this.props.searchState ? this.props.searchState : {}; this.props.widgetsCollector({ getSearchParameters: getSearchParameters, getMetadata: getMetadata, context: context, props: props, searchState: _searchState2 }); } } }, { key: "onSearchForFacetValues", value: function onSearchForFacetValues(searchState) { this.state.instantSearchManager.onSearchForFacetValues(searchState); } }, { key: "getKnownKeys", value: function getKnownKeys() { return this.state.instantSearchManager.getWidgetsIds(); } }, { key: "render", value: function render() { if (React.Children.count(this.props.children) === 0) { return null; } return React__default.createElement(InstantSearchProvider, { value: this.state.contextValue }, this.props.children); } }]); return InstantSearch; }(React.Component); _defineProperty(InstantSearch, "defaultProps", { stalledSearchDelay: 200, refresh: false }); _defineProperty(InstantSearch, "propTypes", { // @TODO: These props are currently constant. indexName: propTypes.string.isRequired, searchClient: propTypes.shape({ search: propTypes.func.isRequired, searchForFacetValues: propTypes.func, addAlgoliaAgent: propTypes.func, clearCache: propTypes.func }).isRequired, createURL: propTypes.func, refresh: propTypes.bool, searchState: propTypes.object, onSearchStateChange: propTypes.func, onSearchParameters: propTypes.func, widgetsCollector: propTypes.func, resultsState: propTypes.oneOfType([propTypes.object, propTypes.array]), children: propTypes.node, stalledSearchDelay: propTypes.number }); var getId$2 = function getId(props) { return props.attributes[0]; }; var namespace = 'hierarchicalMenu'; function _refine(props, searchState, nextRefinement, context) { var id = getId$2(props); var nextValue = _defineProperty({}, id, nextRefinement || ''); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage, namespace); } function transformValue(values) { return values.reduce(function (acc, item) { if (item.isRefined) { acc.push({ label: item.name, // If dealing with a nested "items", "value" is equal to the previous value concatenated with the current label // If dealing with the first level, "value" is equal to the current label value: item.path }); // Create a variable in order to keep the same acc for the recursion, otherwise "reduce" returns a new one if (item.data) { acc = acc.concat(transformValue(item.data)); } } return acc; }, []); } /** * The breadcrumb component is s a type of secondary navigation scheme that * reveals the user’s location in a website or web application. * * @name connectBreadcrumb * @requirements To use this widget, your attributes must be formatted in a specific way. * If you want for example to have a Breadcrumb of categories, objects in your index * should be formatted this way: * * ```json * { * "categories.lvl0": "products", * "categories.lvl1": "products > fruits", * "categories.lvl2": "products > fruits > citrus" * } * ``` * * It's also possible to provide more than one path for each level: * * ```json * { * "categories.lvl0": ["products", "goods"], * "categories.lvl1": ["products > fruits", "goods > to eat"] * } * ``` * * All attributes passed to the `attributes` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * * @kind connector * @propType {array.<string>} attributes - List of attributes to use to generate the hierarchy of the menu. See the example for the convention to follow. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @providedPropType {function} refine - a function to toggle a refinement * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {array.<{items: object, count: number, isRefined: boolean, label: string, value: string}>} items - the list of items the Breadcrumb can display. */ var connectBreadcrumb = createConnectorWithContext({ displayName: 'AlgoliaBreadcrumb', propTypes: { attributes: function attributes(props, propName, componentName) { var isNotString = function isNotString(val) { return typeof val !== 'string'; }; if (!Array.isArray(props[propName]) || props[propName].some(isNotString) || props[propName].length < 1) { return new Error("Invalid prop ".concat(propName, " supplied to ").concat(componentName, ". Expected an Array of Strings")); } return undefined; }, transformItems: propTypes.func }, getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var id = getId$2(props); var results = getResults(searchResults, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var isFacetPresent = Boolean(results) && Boolean(results.getFacetByName(id)); if (!isFacetPresent) { return { items: [], canRefine: false }; } var values = results.getFacetValues(id); var items = values.data ? transformValue(values.data) : []; var transformedItems = props.transformItems ? props.transformItems(items) : items; return { canRefine: transformedItems.length > 0, items: transformedItems }; }, refine: function refine(props, searchState, nextRefinement) { return _refine(props, searchState, nextRefinement, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); } }); /** * connectCurrentRefinements connector provides the logic to build a widget that will * give the user the ability to remove all or some of the filters that were * set. * @name connectCurrentRefinements * @kind connector * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @propType {function} [clearsQuery=false] - Pass true to also clear the search query * @providedPropType {function} refine - a function to remove a single filter * @providedPropType {array.<{label: string, attribute: string, currentRefinement: string || object, items: array, value: function}>} items - all the filters, the `value` is to pass to the `refine` function for removing all currentrefinements, `label` is for the display. When existing several refinements for the same atribute name, then you get a nested `items` object that contains a `label` and a `value` function to use to remove a single filter. `attribute` and `currentRefinement` are metadata containing row values. * @providedPropType {string} query - the search query */ var connectCurrentRefinements = createConnectorWithContext({ displayName: 'AlgoliaCurrentRefinements', propTypes: { transformItems: propTypes.func }, getProvidedProps: function getProvidedProps(props, searchState, searchResults, metadata) { var items = metadata.reduce(function (res, meta) { if (typeof meta.items !== 'undefined') { if (!props.clearsQuery && meta.id === 'query') { return res; } else { if (props.clearsQuery && meta.id === 'query' && meta.items[0].currentRefinement === '') { return res; } return res.concat(meta.items.map(function (item) { return _objectSpread({}, item, { id: meta.id, index: meta.index }); })); } } return res; }, []); var transformedItems = props.transformItems ? props.transformItems(items) : items; return { items: transformedItems, canRefine: transformedItems.length > 0 }; }, refine: function refine(props, searchState, items) { // `value` corresponds to our internal clear function computed in each connector metadata. var refinementsToClear = items instanceof Array ? items.map(function (item) { return item.value; }) : [items]; return refinementsToClear.reduce(function (res, clear) { return clear(res); }, searchState); } }); var getId$3 = function getId(props) { return props.attributes[0]; }; var namespace$1 = 'hierarchicalMenu'; function getCurrentRefinement(props, searchState, context) { var currentRefinement = getCurrentRefinementValue(props, searchState, context, "".concat(namespace$1, ".").concat(getId$3(props)), null); if (currentRefinement === '') { return null; } return currentRefinement; } function getValue(path, props, searchState, context) { var id = props.id, attributes = props.attributes, separator = props.separator, rootPath = props.rootPath, showParentLevel = props.showParentLevel; var currentRefinement = getCurrentRefinement(props, searchState, context); var nextRefinement; if (currentRefinement === null) { nextRefinement = path; } else { var tmpSearchParameters = new algoliasearchHelper_1.SearchParameters({ hierarchicalFacets: [{ name: id, attributes: attributes, separator: separator, rootPath: rootPath, showParentLevel: showParentLevel }] }); nextRefinement = tmpSearchParameters.toggleHierarchicalFacetRefinement(id, currentRefinement).toggleHierarchicalFacetRefinement(id, path).getHierarchicalRefinement(id)[0]; } return nextRefinement; } function transformValue$1(value, props, searchState, context) { return value.map(function (v) { return { label: v.name, value: getValue(v.path, props, searchState, context), count: v.count, isRefined: v.isRefined, items: v.data && transformValue$1(v.data, props, searchState, context) }; }); } var truncate = function truncate() { var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10; return items.slice(0, limit).map(function () { var item = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return Array.isArray(item.items) ? _objectSpread({}, item, { items: truncate(item.items, limit) }) : item; }); }; function _refine$1(props, searchState, nextRefinement, context) { var id = getId$3(props); var nextValue = _defineProperty({}, id, nextRefinement || ''); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage, namespace$1); } function _cleanUp(props, searchState, context) { return cleanUpValue(searchState, context, "".concat(namespace$1, ".").concat(getId$3(props))); } var sortBy = ['name:asc']; /** * connectHierarchicalMenu connector provides the logic to build a widget that will * give the user the ability to explore a tree-like structure. * This is commonly used for multi-level categorization of products on e-commerce * websites. From a UX point of view, we suggest not displaying more than two levels deep. * @name connectHierarchicalMenu * @requirements To use this widget, your attributes must be formatted in a specific way. * If you want for example to have a hiearchical menu of categories, objects in your index * should be formatted this way: * * ```json * { * "categories.lvl0": "products", * "categories.lvl1": "products > fruits", * "categories.lvl2": "products > fruits > citrus" * } * ``` * * It's also possible to provide more than one path for each level: * * ```json * { * "categories.lvl0": ["products", "goods"], * "categories.lvl1": ["products > fruits", "goods > to eat"] * } * ``` * * All attributes passed to the `attributes` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * * @kind connector * @propType {array.<string>} attributes - List of attributes to use to generate the hierarchy of the menu. See the example for the convention to follow. * @propType {string} [defaultRefinement] - the item value selected by default * @propType {boolean} [showMore=false] - Flag to activate the show more button, for toggling the number of items between limit and showMoreLimit. * @propType {number} [limit=10] - The maximum number of items displayed. * @propType {number} [showMoreLimit=20] - The maximum number of items displayed when the user triggers the show more. Not considered if `showMore` is false. * @propType {string} [separator='>'] - Specifies the level separator used in the data. * @propType {string} [rootPath=null] - The path to use if the first level is not the root level. * @propType {boolean} [showParentLevel=true] - Flag to set if the parent level should be displayed. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @providedPropType {function} refine - a function to toggle a refinement * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string} currentRefinement - the refinement currently applied * @providedPropType {array.<{items: object, count: number, isRefined: boolean, label: string, value: string}>} items - the list of items the HierarchicalMenu can display. items has the same shape as parent items. */ var connectHierarchicalMenu = createConnectorWithContext({ displayName: 'AlgoliaHierarchicalMenu', propTypes: { attributes: function attributes(props, propName, componentName) { var isNotString = function isNotString(val) { return typeof val !== 'string'; }; if (!Array.isArray(props[propName]) || props[propName].some(isNotString) || props[propName].length < 1) { return new Error("Invalid prop ".concat(propName, " supplied to ").concat(componentName, ". Expected an Array of Strings")); } return undefined; }, separator: propTypes.string, rootPath: propTypes.string, showParentLevel: propTypes.bool, defaultRefinement: propTypes.string, showMore: propTypes.bool, limit: propTypes.number, showMoreLimit: propTypes.number, transformItems: propTypes.func }, defaultProps: { showMore: false, limit: 10, showMoreLimit: 20, separator: ' > ', rootPath: null, showParentLevel: true }, getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var showMore = props.showMore, limit = props.limit, showMoreLimit = props.showMoreLimit; var id = getId$3(props); var results = getResults(searchResults, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var isFacetPresent = Boolean(results) && Boolean(results.getFacetByName(id)); if (!isFacetPresent) { return { items: [], currentRefinement: getCurrentRefinement(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), canRefine: false }; } var itemsLimit = showMore ? showMoreLimit : limit; var value = results.getFacetValues(id, { sortBy: sortBy }); var items = value.data ? transformValue$1(value.data, props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }) : []; var transformedItems = props.transformItems ? props.transformItems(items) : items; return { items: truncate(transformedItems, itemsLimit), currentRefinement: getCurrentRefinement(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), canRefine: transformedItems.length > 0 }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$1(props, searchState, nextRefinement, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, cleanUp: function cleanUp(props, searchState) { return _cleanUp(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var attributes = props.attributes, separator = props.separator, rootPath = props.rootPath, showParentLevel = props.showParentLevel, showMore = props.showMore, limit = props.limit, showMoreLimit = props.showMoreLimit, contextValue = props.contextValue; var id = getId$3(props); var itemsLimit = showMore ? showMoreLimit : limit; searchParameters = searchParameters.addHierarchicalFacet({ name: id, attributes: attributes, separator: separator, rootPath: rootPath, showParentLevel: showParentLevel }).setQueryParameters({ maxValuesPerFacet: Math.max(searchParameters.maxValuesPerFacet || 0, itemsLimit) }); var currentRefinement = getCurrentRefinement(props, searchState, { ais: contextValue, multiIndexContext: props.indexContextValue }); if (currentRefinement !== null) { searchParameters = searchParameters.toggleHierarchicalFacetRefinement(id, currentRefinement); } return searchParameters; }, getMetadata: function getMetadata(props, searchState) { var rootAttribute = props.attributes[0]; var id = getId$3(props); var currentRefinement = getCurrentRefinement(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var items = !currentRefinement ? [] : [{ label: "".concat(rootAttribute, ": ").concat(currentRefinement), attribute: rootAttribute, value: function value(nextState) { return _refine$1(props, nextState, '', { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, currentRefinement: currentRefinement }]; return { id: id, index: getIndexId({ ais: props.contextValue, multiIndexContext: props.indexContextValue }), items: items }; } }); var highlight = function highlight(_ref) { var attribute = _ref.attribute, hit = _ref.hit, highlightProperty = _ref.highlightProperty, _ref$preTag = _ref.preTag, preTag = _ref$preTag === void 0 ? HIGHLIGHT_TAGS.highlightPreTag : _ref$preTag, _ref$postTag = _ref.postTag, postTag = _ref$postTag === void 0 ? HIGHLIGHT_TAGS.highlightPostTag : _ref$postTag; return parseAlgoliaHit({ attribute: attribute, highlightProperty: highlightProperty, hit: hit, preTag: preTag, postTag: postTag }); }; /** * connectHighlight connector provides the logic to create an highlighter * component that will retrieve, parse and render an highlighted attribute * from an Algolia hit. * @name connectHighlight * @kind connector * @category connector * @providedPropType {function} highlight - function to retrieve and parse an attribute from a hit. It takes a configuration object with 3 attributes: `highlightProperty` which is the property that contains the highlight structure from the records, `attribute` which is the name of the attribute (it can be either a string or an array of strings) to look for and `hit` which is the hit from Algolia. It returns an array of objects `{value: string, isHighlighted: boolean}`. If the element that corresponds to the attribute is an array of strings, it will return a nested array of objects. * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, SearchBox, Hits, connectHighlight } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const CustomHighlight = connectHighlight( * ({ highlight, attribute, hit, highlightProperty }) => { * const highlights = highlight({ * highlightProperty: '_highlightResult', * attribute, * hit * }); * * return highlights.map(part => part.isHighlighted ? ( * <mark>{part.value}</mark> * ) : ( * <span>{part.value}</span> * )); * } * ); * * const Hit = ({ hit }) => ( * <p> * <CustomHighlight attribute="name" hit={hit} /> * </p> * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <SearchBox defaultRefinement="pho" /> * <Hits hitComponent={Hit} /> * </InstantSearch> * ); */ var connectHighlight = createConnectorWithContext({ displayName: 'AlgoliaHighlighter', propTypes: {}, getProvidedProps: function getProvidedProps() { return { highlight: highlight }; } }); /** * connectHits connector provides the logic to create connected * components that will render the results retrieved from * Algolia. * * To configure the number of hits retrieved, use [HitsPerPage widget](widgets/HitsPerPage.html), * [connectHitsPerPage connector](connectors/connectHitsPerPage.html) or pass the hitsPerPage * prop to a [Configure](guide/Search_parameters.html) widget. * * **Warning:** you will need to use the **objectID** property available on every hit as a key * when iterating over them. This will ensure you have the best possible UI experience * especially on slow networks. * @name connectHits * @kind connector * @providedPropType {array.<object>} hits - the records that matched the search state * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, Highlight, connectHits } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * const CustomHits = connectHits(({ hits }) => ( * <div> * {hits.map(hit => * <p key={hit.objectID}> * <Highlight attribute="name" hit={hit} /> * </p> * )} * </div> * )); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <CustomHits /> * </InstantSearch> * ); */ var connectHits = createConnectorWithContext({ displayName: 'AlgoliaHits', getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var results = getResults(searchResults, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); if (!results) { return { hits: [] }; } var hitsWithPositions = addAbsolutePositions(results.hits, results.hitsPerPage, results.page); var hitsWithPositionsAndQueryID = addQueryID(hitsWithPositions, results.queryID); return { hits: hitsWithPositionsAndQueryID }; }, /** * Hits needs to be considered as a widget to trigger a search, * even if no other widgets are used. * * To be considered as a widget you need either: * - getSearchParameters * - getMetadata * - transitionState * * See: createConnector.tsx */ getSearchParameters: function getSearchParameters(searchParameters) { return searchParameters; } }); function getId$4() { return 'hitsPerPage'; } function getCurrentRefinement$1(props, searchState, context) { var id = getId$4(); var currentRefinement = getCurrentRefinementValue(props, searchState, context, id, null); if (typeof currentRefinement === 'string') { return parseInt(currentRefinement, 10); } return currentRefinement; } /** * connectHitsPerPage connector provides the logic to create connected * components that will allow a user to choose to display more or less results from Algolia. * @name connectHitsPerPage * @kind connector * @propType {number} defaultRefinement - The number of items selected by default * @propType {{value: number, label: string}[]} items - List of hits per page options. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @providedPropType {function} refine - a function to remove a single filter * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string} currentRefinement - the refinement currently applied * @providedPropType {array.<{isRefined: boolean, label?: string, value: number}>} items - the list of items the HitsPerPage can display. If no label provided, the value will be displayed. */ var connectHitsPerPage = createConnectorWithContext({ displayName: 'AlgoliaHitsPerPage', propTypes: { defaultRefinement: propTypes.number.isRequired, items: propTypes.arrayOf(propTypes.shape({ label: propTypes.string, value: propTypes.number.isRequired })).isRequired, transformItems: propTypes.func }, getProvidedProps: function getProvidedProps(props, searchState) { var currentRefinement = getCurrentRefinement$1(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var items = props.items.map(function (item) { return item.value === currentRefinement ? _objectSpread({}, item, { isRefined: true }) : _objectSpread({}, item, { isRefined: false }); }); return { items: props.transformItems ? props.transformItems(items) : items, currentRefinement: currentRefinement }; }, refine: function refine(props, searchState, nextRefinement) { var id = getId$4(); var nextValue = _defineProperty({}, id, nextRefinement); var resetPage = true; return refineValue(searchState, nextValue, { ais: props.contextValue, multiIndexContext: props.indexContextValue }, resetPage); }, cleanUp: function cleanUp(props, searchState) { return cleanUpValue(searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }, getId$4()); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { return searchParameters.setHitsPerPage(getCurrentRefinement$1(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue })); }, getMetadata: function getMetadata() { return { id: getId$4() }; } }); function getId$5() { return 'page'; } function getCurrentRefinement$2(props, searchState, context) { var id = getId$5(); var page = 1; var currentRefinement = getCurrentRefinementValue(props, searchState, context, id, page); if (typeof currentRefinement === 'string') { return parseInt(currentRefinement, 10); } return currentRefinement; } function getStateWithoutPage(state) { var _ref = state || {}, page = _ref.page, rest = _objectWithoutProperties(_ref, ["page"]); return rest; } function getInMemoryCache() { var cachedHits = undefined; var cachedState = undefined; return { read: function read(_ref2) { var state = _ref2.state; return reactFastCompare(cachedState, getStateWithoutPage(state)) ? cachedHits : null; }, write: function write(_ref3) { var state = _ref3.state, hits = _ref3.hits; cachedState = getStateWithoutPage(state); cachedHits = hits; } }; } function extractHitsFromCachedHits(cachedHits) { return Object.keys(cachedHits).map(Number).sort(function (a, b) { return a - b; }).reduce(function (acc, page) { return acc.concat(cachedHits[page]); }, []); } /** * InfiniteHits connector provides the logic to create connected * components that will render an continuous list of results retrieved from * Algolia. This connector provides a function to load more results. * @name connectInfiniteHits * @kind connector * @providedPropType {array.<object>} hits - the records that matched the search state * @providedPropType {boolean} hasMore - indicates if there are more pages to load * @providedPropType {function} refine - call to load more results */ var connectInfiniteHits = createConnectorWithContext({ displayName: 'AlgoliaInfiniteHits', getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var _this = this; var results = getResults(searchResults, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); this._prevState = this._prevState || {}; var cache = props.cache || getInMemoryCache(); if (this._cachedHits === undefined) { this._cachedHits = cache.read({ state: searchState }) || {}; } if (!results) { return { hits: extractHitsFromCachedHits(this._cachedHits), hasPrevious: false, hasMore: false, refine: function refine() {}, refinePrevious: function refinePrevious() {}, refineNext: function refineNext() {} }; } var page = results.page, hits = results.hits, hitsPerPage = results.hitsPerPage, nbPages = results.nbPages, _results$_state = results._state; _results$_state = _results$_state === void 0 ? {} : _results$_state; var p = _results$_state.page, currentState = _objectWithoutProperties(_results$_state, ["page"]); var hitsWithPositions = addAbsolutePositions(hits, hitsPerPage, page); var hitsWithPositionsAndQueryID = addQueryID(hitsWithPositions, results.queryID); if (!reactFastCompare(currentState, this._prevState)) { this._cachedHits = cache.read({ state: searchState }) || {}; } if (this._cachedHits[page] === undefined) { this._cachedHits[page] = hitsWithPositionsAndQueryID; cache.write({ state: searchState, hits: this._cachedHits }); } this._prevState = currentState; /* Math.min() and Math.max() returns Infinity or -Infinity when no argument is given. But there is always something in this point because of `this._cachedHits[page]`. */ var firstReceivedPage = Math.min.apply(Math, _toConsumableArray(Object.keys(this._cachedHits).map(Number))); var lastReceivedPage = Math.max.apply(Math, _toConsumableArray(Object.keys(this._cachedHits).map(Number))); var hasPrevious = firstReceivedPage > 0; var lastPageIndex = nbPages - 1; var hasMore = lastReceivedPage < lastPageIndex; var refinePrevious = function refinePrevious(event) { return _this.refine(event, firstReceivedPage - 1); }; var refineNext = function refineNext(event) { return _this.refine(event, lastReceivedPage + 1); }; return { hits: extractHitsFromCachedHits(this._cachedHits), hasPrevious: hasPrevious, hasMore: hasMore, refinePrevious: refinePrevious, refineNext: refineNext }; }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { return searchParameters.setQueryParameters({ page: getCurrentRefinement$2(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }) - 1 }); }, refine: function refine(props, searchState, event, index) { var pages = Object.keys(this._cachedHits || {}).map(Number); var lastReceivedPage = pages.length === 0 ? undefined : Math.max.apply(Math, _toConsumableArray(pages)); // If there is no key in `this._cachedHits`, // then `lastReceivedPage` should be `undefined`. if (index === undefined && lastReceivedPage !== undefined) { index = lastReceivedPage + 1; } else if (index === undefined) { index = getCurrentRefinement$2(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); } var id = getId$5(); var nextValue = _defineProperty({}, id, index + 1); var resetPage = false; return refineValue(searchState, nextValue, { ais: props.contextValue, multiIndexContext: props.indexContextValue }, resetPage); } }); var namespace$2 = 'menu'; function getId$6(props) { return props.attribute; } function getCurrentRefinement$3(props, searchState, context) { var currentRefinement = getCurrentRefinementValue(props, searchState, context, "".concat(namespace$2, ".").concat(getId$6(props)), null); if (currentRefinement === '') { return null; } return currentRefinement; } function getValue$1(name, props, searchState, context) { var currentRefinement = getCurrentRefinement$3(props, searchState, context); return name === currentRefinement ? '' : name; } function getLimit(_ref) { var showMore = _ref.showMore, limit = _ref.limit, showMoreLimit = _ref.showMoreLimit; return showMore ? showMoreLimit : limit; } function _refine$2(props, searchState, nextRefinement, context) { var id = getId$6(props); var nextValue = _defineProperty({}, id, nextRefinement ? nextRefinement : ''); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage, namespace$2); } function _cleanUp$1(props, searchState, context) { return cleanUpValue(searchState, context, "".concat(namespace$2, ".").concat(getId$6(props))); } var defaultSortBy = ['count:desc', 'name:asc']; /** * connectMenu connector provides the logic to build a widget that will * give the user the ability to choose a single value for a specific facet. * @name connectMenu * @requirements The attribute passed to the `attribute` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * @kind connector * @propType {string} attribute - the name of the attribute in the record * @propType {boolean} [showMore=false] - true if the component should display a button that will expand the number of items * @propType {number} [limit=10] - the minimum number of diplayed items * @propType {number} [showMoreLimit=20] - the maximun number of displayed items. Only used when showMore is set to `true` * @propType {string} [defaultRefinement] - the value of the item selected by default * @propType {boolean} [searchable=false] - allow search inside values * @providedPropType {function} refine - a function to toggle a refinement * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string} currentRefinement - the refinement currently applied * @providedPropType {array.<{count: number, isRefined: boolean, label: string, value: string}>} items - the list of items the Menu can display. * @providedPropType {function} searchForItems - a function to toggle a search inside items values * @providedPropType {boolean} isFromSearch - a boolean that says if the `items` props contains facet values from the global search or from the search inside items. */ var connectMenu = createConnectorWithContext({ displayName: 'AlgoliaMenu', propTypes: { attribute: propTypes.string.isRequired, showMore: propTypes.bool, limit: propTypes.number, showMoreLimit: propTypes.number, defaultRefinement: propTypes.string, transformItems: propTypes.func, searchable: propTypes.bool }, defaultProps: { showMore: false, limit: 10, showMoreLimit: 20 }, getProvidedProps: function getProvidedProps(props, searchState, searchResults, meta, searchForFacetValuesResults) { var attribute = props.attribute, searchable = props.searchable, indexContextValue = props.indexContextValue; var results = getResults(searchResults, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var canRefine = Boolean(results) && Boolean(results.getFacetByName(attribute)); var isFromSearch = Boolean(searchForFacetValuesResults && searchForFacetValuesResults[attribute] && searchForFacetValuesResults.query !== ''); // Search For Facet Values is not available with derived helper (used for multi index search) if (searchable && indexContextValue) { throw new Error('react-instantsearch: searching in *List is not available when used inside a' + ' multi index context'); } if (!canRefine) { return { items: [], currentRefinement: getCurrentRefinement$3(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), isFromSearch: isFromSearch, searchable: searchable, canRefine: canRefine }; } var items; if (isFromSearch) { items = searchForFacetValuesResults[attribute].map(function (v) { return { label: v.value, value: getValue$1(v.value, props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), _highlightResult: { label: { value: v.highlighted } }, count: v.count, isRefined: v.isRefined }; }); } else { items = results.getFacetValues(attribute, { sortBy: searchable ? undefined : defaultSortBy }).map(function (v) { return { label: v.name, value: getValue$1(v.name, props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), count: v.count, isRefined: v.isRefined }; }); } var transformedItems = props.transformItems ? props.transformItems(items) : items; return { items: transformedItems.slice(0, getLimit(props)), currentRefinement: getCurrentRefinement$3(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), isFromSearch: isFromSearch, searchable: searchable, canRefine: transformedItems.length > 0 }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$2(props, searchState, nextRefinement, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, searchForFacetValues: function searchForFacetValues(props, searchState, nextRefinement) { return { facetName: props.attribute, query: nextRefinement, maxFacetHits: getLimit(props) }; }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$1(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var attribute = props.attribute; searchParameters = searchParameters.setQueryParameters({ maxValuesPerFacet: Math.max(searchParameters.maxValuesPerFacet || 0, getLimit(props)) }); searchParameters = searchParameters.addDisjunctiveFacet(attribute); var currentRefinement = getCurrentRefinement$3(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); if (currentRefinement !== null) { searchParameters = searchParameters.addDisjunctiveFacetRefinement(attribute, currentRefinement); } return searchParameters; }, getMetadata: function getMetadata(props, searchState) { var id = getId$6(props); var currentRefinement = getCurrentRefinement$3(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); return { id: id, index: getIndexId({ ais: props.contextValue, multiIndexContext: props.indexContextValue }), items: currentRefinement === null ? [] : [{ label: "".concat(props.attribute, ": ").concat(currentRefinement), attribute: props.attribute, value: function value(nextState) { return _refine$2(props, nextState, '', { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, currentRefinement: currentRefinement }] }; } }); function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _iterableToArrayLimit(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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function stringifyItem(item) { if (typeof item.start === 'undefined' && typeof item.end === 'undefined') { return ''; } var start = typeof item.start !== 'undefined' ? item.start : ''; var end = typeof item.end !== 'undefined' ? item.end : ''; return "".concat(start, ":").concat(end); } function parseItem(value) { if (value.length === 0) { return { start: null, end: null }; } var _value$split = value.split(':'), _value$split2 = _slicedToArray(_value$split, 2), startStr = _value$split2[0], endStr = _value$split2[1]; return { start: startStr.length > 0 ? parseInt(startStr, 10) : null, end: endStr.length > 0 ? parseInt(endStr, 10) : null }; } var namespace$3 = 'multiRange'; function getId$7(props) { return props.attribute; } function getCurrentRefinement$4(props, searchState, context) { return getCurrentRefinementValue(props, searchState, context, "".concat(namespace$3, ".").concat(getId$7(props)), ''); } function isRefinementsRangeIncludesInsideItemRange(stats, start, end) { return stats.min > start && stats.min < end || stats.max > start && stats.max < end; } function isItemRangeIncludedInsideRefinementsRange(stats, start, end) { return start > stats.min && start < stats.max || end > stats.min && end < stats.max; } function itemHasRefinement(attribute, results, value) { var stats = results.getFacetByName(attribute) ? results.getFacetStats(attribute) : null; var range = value.split(':'); var start = Number(range[0]) === 0 || value === '' ? Number.NEGATIVE_INFINITY : Number(range[0]); var end = Number(range[1]) === 0 || value === '' ? Number.POSITIVE_INFINITY : Number(range[1]); return !(Boolean(stats) && (isRefinementsRangeIncludesInsideItemRange(stats, start, end) || isItemRangeIncludedInsideRefinementsRange(stats, start, end))); } function _refine$3(props, searchState, nextRefinement, context) { var nextValue = _defineProperty({}, getId$7(props), nextRefinement); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage, namespace$3); } function _cleanUp$2(props, searchState, context) { return cleanUpValue(searchState, context, "".concat(namespace$3, ".").concat(getId$7(props))); } /** * connectNumericMenu connector provides the logic to build a widget that will * give the user the ability to select a range value for a numeric attribute. * Ranges are defined statically. * @name connectNumericMenu * @requirements The attribute passed to the `attribute` prop must be holding numerical values. * @kind connector * @propType {string} attribute - the name of the attribute in the records * @propType {{label: string, start: number, end: number}[]} items - List of options. With a text label, and upper and lower bounds. * @propType {string} [defaultRefinement] - the value of the item selected by default, follow the shape of a `string` with a pattern of `'{start}:{end}'`. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @providedPropType {function} refine - a function to select a range. * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string} currentRefinement - the refinement currently applied. follow the shape of a `string` with a pattern of `'{start}:{end}'` which corresponds to the current selected item. For instance, when the selected item is `{start: 10, end: 20}`, the searchState of the widget is `'10:20'`. When `start` isn't defined, the searchState of the widget is `':{end}'`, and the same way around when `end` isn't defined. However, when neither `start` nor `end` are defined, the searchState is an empty string. * @providedPropType {array.<{isRefined: boolean, label: string, value: string, isRefined: boolean, noRefinement: boolean}>} items - the list of ranges the NumericMenu can display. */ var connectNumericMenu = createConnectorWithContext({ displayName: 'AlgoliaNumericMenu', propTypes: { id: propTypes.string, attribute: propTypes.string.isRequired, items: propTypes.arrayOf(propTypes.shape({ label: propTypes.node, start: propTypes.number, end: propTypes.number })).isRequired, transformItems: propTypes.func }, getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var attribute = props.attribute; var currentRefinement = getCurrentRefinement$4(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var results = getResults(searchResults, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var items = props.items.map(function (item) { var value = stringifyItem(item); return { label: item.label, value: value, isRefined: value === currentRefinement, noRefinement: results ? itemHasRefinement(getId$7(props), results, value) : false }; }); var stats = results && results.getFacetByName(attribute) ? results.getFacetStats(attribute) : null; var refinedItem = find(items, function (item) { return item.isRefined === true; }); if (!items.some(function (item) { return item.value === ''; })) { items.push({ value: '', isRefined: refinedItem === undefined, noRefinement: !stats, label: 'All' }); } var transformedItems = props.transformItems ? props.transformItems(items) : items; return { items: transformedItems, currentRefinement: currentRefinement, canRefine: transformedItems.length > 0 && transformedItems.some(function (item) { return item.noRefinement === false; }) }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$3(props, searchState, nextRefinement, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$2(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var attribute = props.attribute; var _parseItem = parseItem(getCurrentRefinement$4(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue })), start = _parseItem.start, end = _parseItem.end; searchParameters = searchParameters.addDisjunctiveFacet(attribute); if (typeof start === 'number') { searchParameters = searchParameters.addNumericRefinement(attribute, '>=', start); } if (typeof end === 'number') { searchParameters = searchParameters.addNumericRefinement(attribute, '<=', end); } return searchParameters; }, getMetadata: function getMetadata(props, searchState) { var id = getId$7(props); var value = getCurrentRefinement$4(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var items = []; var index = getIndexId({ ais: props.contextValue, multiIndexContext: props.indexContextValue }); if (value !== '') { var _find = find(props.items, function (item) { return stringifyItem(item) === value; }), label = _find.label; items.push({ label: "".concat(props.attribute, ": ").concat(label), attribute: props.attribute, currentRefinement: label, value: function value(nextState) { return _refine$3(props, nextState, '', { ais: props.contextValue, multiIndexContext: props.indexContextValue }); } }); } return { id: id, index: index, items: items }; } }); function getId$8() { return 'page'; } function getCurrentRefinement$5(props, searchState, context) { var id = getId$8(); var page = 1; var currentRefinement = getCurrentRefinementValue(props, searchState, context, id, page); if (typeof currentRefinement === 'string') { return parseInt(currentRefinement, 10); } return currentRefinement; } function _refine$4(props, searchState, nextPage, context) { var id = getId$8(); var nextValue = _defineProperty({}, id, nextPage); var resetPage = false; return refineValue(searchState, nextValue, context, resetPage); } /** * connectPagination connector provides the logic to build a widget that will * let the user displays hits corresponding to a certain page. * @name connectPagination * @kind connector * @propType {boolean} [showFirst=true] - Display the first page link. * @propType {boolean} [showLast=false] - Display the last page link. * @propType {boolean} [showPrevious=true] - Display the previous page link. * @propType {boolean} [showNext=true] - Display the next page link. * @propType {number} [padding=3] - How many page links to display around the current page. * @propType {number} [totalPages=Infinity] - Maximum number of pages to display. * @providedPropType {function} refine - a function to remove a single filter * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {number} nbPages - the total of existing pages * @providedPropType {number} currentRefinement - the page refinement currently applied */ var connectPagination = createConnectorWithContext({ displayName: 'AlgoliaPagination', getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var results = getResults(searchResults, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); if (!results) { return null; } var nbPages = results.nbPages; return { nbPages: nbPages, currentRefinement: getCurrentRefinement$5(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), canRefine: nbPages > 1 }; }, refine: function refine(props, searchState, nextPage) { return _refine$4(props, searchState, nextPage, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, cleanUp: function cleanUp(props, searchState) { return cleanUpValue(searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }, getId$8()); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { return searchParameters.setPage(getCurrentRefinement$5(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }) - 1); }, getMetadata: function getMetadata() { return { id: getId$8() }; } }); /** * connectPoweredBy connector provides the logic to build a widget that * will display a link to algolia. * @name connectPoweredBy * @kind connector * @providedPropType {string} url - the url to redirect to algolia */ var connectPoweredBy = createConnectorWithContext({ displayName: 'AlgoliaPoweredBy', getProvidedProps: function getProvidedProps() { var hostname = typeof window === 'undefined' ? '' : window.location.hostname; var url = 'https://www.algolia.com/?' + 'utm_source=react-instantsearch&' + 'utm_medium=website&' + "utm_content=".concat(hostname, "&") + 'utm_campaign=poweredby'; return { url: url }; } }); /** * connectRange connector provides the logic to create connected * components that will give the ability for a user to refine results using * a numeric range. * @name connectRange * @kind connector * @requirements The attribute passed to the `attribute` prop must be present in “attributes for faceting” * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * The values inside the attribute must be JavaScript numbers (not strings). * @propType {string} attribute - Name of the attribute for faceting * @propType {{min?: number, max?: number}} [defaultRefinement] - Default searchState of the widget containing the start and the end of the range. * @propType {number} [min] - Minimum value. When this isn't set, the minimum value will be automatically computed by Algolia using the data in the index. * @propType {number} [max] - Maximum value. When this isn't set, the maximum value will be automatically computed by Algolia using the data in the index. * @propType {number} [precision=0] - Number of digits after decimal point to use. * @providedPropType {function} refine - a function to select a range. * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string} currentRefinement - the refinement currently applied * @providedPropType {number} min - the minimum value available. * @providedPropType {number} max - the maximum value available. * @providedPropType {number} precision - Number of digits after decimal point to use. */ function getId$9(props) { return props.attribute; } var namespace$4 = 'range'; function getCurrentRange(boundaries, stats, precision) { var pow = Math.pow(10, precision); var min; if (typeof boundaries.min === 'number' && isFinite(boundaries.min)) { min = boundaries.min; } else if (typeof stats.min === 'number' && isFinite(stats.min)) { min = stats.min; } else { min = undefined; } var max; if (typeof boundaries.max === 'number' && isFinite(boundaries.max)) { max = boundaries.max; } else if (typeof stats.max === 'number' && isFinite(stats.max)) { max = stats.max; } else { max = undefined; } return { min: min !== undefined ? Math.floor(min * pow) / pow : min, max: max !== undefined ? Math.ceil(max * pow) / pow : max }; } function getCurrentRefinement$6(props, searchState, currentRange, context) { var _getCurrentRefinement = getCurrentRefinementValue(props, searchState, context, "".concat(namespace$4, ".").concat(getId$9(props)), {}), min = _getCurrentRefinement.min, max = _getCurrentRefinement.max; var isFloatPrecision = Boolean(props.precision); var nextMin = min; if (typeof nextMin === 'string') { nextMin = isFloatPrecision ? parseFloat(nextMin) : parseInt(nextMin, 10); } var nextMax = max; if (typeof nextMax === 'string') { nextMax = isFloatPrecision ? parseFloat(nextMax) : parseInt(nextMax, 10); } var refinement = { min: nextMin, max: nextMax }; var hasMinBound = props.min !== undefined; var hasMaxBound = props.max !== undefined; var hasMinRefinment = refinement.min !== undefined; var hasMaxRefinment = refinement.max !== undefined; if (hasMinBound && hasMinRefinment && refinement.min < currentRange.min) { throw Error("You can't provide min value lower than range."); } if (hasMaxBound && hasMaxRefinment && refinement.max > currentRange.max) { throw Error("You can't provide max value greater than range."); } if (hasMinBound && !hasMinRefinment) { refinement.min = currentRange.min; } if (hasMaxBound && !hasMaxRefinment) { refinement.max = currentRange.max; } return refinement; } function getCurrentRefinementWithRange(refinement, range) { return { min: refinement.min !== undefined ? refinement.min : range.min, max: refinement.max !== undefined ? refinement.max : range.max }; } function nextValueForRefinement(hasBound, isReset, range, value) { var next; if (!hasBound && range === value) { next = undefined; } else if (hasBound && isReset) { next = range; } else { next = value; } return next; } function _refine$5(props, searchState, nextRefinement, currentRange, context) { var nextMin = nextRefinement.min, nextMax = nextRefinement.max; var currentMinRange = currentRange.min, currentMaxRange = currentRange.max; var isMinReset = nextMin === undefined || nextMin === ''; var isMaxReset = nextMax === undefined || nextMax === ''; var nextMinAsNumber = !isMinReset ? parseFloat(nextMin) : undefined; var nextMaxAsNumber = !isMaxReset ? parseFloat(nextMax) : undefined; var isNextMinValid = isMinReset || isFinite(nextMinAsNumber); var isNextMaxValid = isMaxReset || isFinite(nextMaxAsNumber); if (!isNextMinValid || !isNextMaxValid) { throw Error("You can't provide non finite values to the range connector."); } if (nextMinAsNumber < currentMinRange) { throw Error("You can't provide min value lower than range."); } if (nextMaxAsNumber > currentMaxRange) { throw Error("You can't provide max value greater than range."); } var id = getId$9(props); var resetPage = true; var nextValue = _defineProperty({}, id, { min: nextValueForRefinement(props.min !== undefined, isMinReset, currentMinRange, nextMinAsNumber), max: nextValueForRefinement(props.max !== undefined, isMaxReset, currentMaxRange, nextMaxAsNumber) }); return refineValue(searchState, nextValue, context, resetPage, namespace$4); } function _cleanUp$3(props, searchState, context) { return cleanUpValue(searchState, context, "".concat(namespace$4, ".").concat(getId$9(props))); } var connectRange = createConnectorWithContext({ displayName: 'AlgoliaRange', propTypes: { id: propTypes.string, attribute: propTypes.string.isRequired, defaultRefinement: propTypes.shape({ min: propTypes.number, max: propTypes.number }), min: propTypes.number, max: propTypes.number, precision: propTypes.number, header: propTypes.node, footer: propTypes.node }, defaultProps: { precision: 0 }, getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var attribute = props.attribute, precision = props.precision, minBound = props.min, maxBound = props.max; var results = getResults(searchResults, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var hasFacet = results && results.getFacetByName(attribute); var stats = hasFacet ? results.getFacetStats(attribute) || {} : {}; var facetValues = hasFacet ? results.getFacetValues(attribute) : []; var count = facetValues.map(function (v) { return { value: v.name, count: v.count }; }); var _getCurrentRange = getCurrentRange({ min: minBound, max: maxBound }, stats, precision), rangeMin = _getCurrentRange.min, rangeMax = _getCurrentRange.max; // The searchState is not always in sync with the helper state. For example // when we set boundaries on the first render the searchState don't have // the correct refinement. If this behavior change in the upcoming version // we could store the range inside the searchState instead of rely on `this`. this._currentRange = { min: rangeMin, max: rangeMax }; var currentRefinement = getCurrentRefinement$6(props, searchState, this._currentRange, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); return { min: rangeMin, max: rangeMax, canRefine: count.length > 0, currentRefinement: getCurrentRefinementWithRange(currentRefinement, this._currentRange), count: count, precision: precision }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$5(props, searchState, nextRefinement, this._currentRange, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$3(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, getSearchParameters: function getSearchParameters(params, props, searchState) { var attribute = props.attribute; var _getCurrentRefinement2 = getCurrentRefinement$6(props, searchState, this._currentRange, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), min = _getCurrentRefinement2.min, max = _getCurrentRefinement2.max; params = params.addDisjunctiveFacet(attribute); if (min !== undefined) { params = params.addNumericRefinement(attribute, '>=', min); } if (max !== undefined) { params = params.addNumericRefinement(attribute, '<=', max); } return params; }, getMetadata: function getMetadata(props, searchState) { var _this = this; var _this$_currentRange = this._currentRange, minRange = _this$_currentRange.min, maxRange = _this$_currentRange.max; var _getCurrentRefinement3 = getCurrentRefinement$6(props, searchState, this._currentRange, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), minValue = _getCurrentRefinement3.min, maxValue = _getCurrentRefinement3.max; var items = []; var hasMin = minValue !== undefined; var hasMax = maxValue !== undefined; var shouldDisplayMinLabel = hasMin && minValue !== minRange; var shouldDisplayMaxLabel = hasMax && maxValue !== maxRange; if (shouldDisplayMinLabel || shouldDisplayMaxLabel) { var fragments = [hasMin ? "".concat(minValue, " <= ") : '', props.attribute, hasMax ? " <= ".concat(maxValue) : '']; items.push({ label: fragments.join(''), attribute: props.attribute, value: function value(nextState) { return _refine$5(props, nextState, {}, _this._currentRange, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, currentRefinement: getCurrentRefinementWithRange({ min: minValue, max: maxValue }, { min: minRange, max: maxRange }) }); } return { id: getId$9(props), index: getIndexId({ ais: props.contextValue, multiIndexContext: props.indexContextValue }), items: items }; } }); var namespace$5 = 'refinementList'; function getId$a(props) { return props.attribute; } function getCurrentRefinement$7(props, searchState, context) { var currentRefinement = getCurrentRefinementValue(props, searchState, context, "".concat(namespace$5, ".").concat(getId$a(props)), []); if (typeof currentRefinement !== 'string') { return currentRefinement; } if (currentRefinement) { return [currentRefinement]; } return []; } function getValue$2(name, props, searchState, context) { var currentRefinement = getCurrentRefinement$7(props, searchState, context); var isAnewValue = currentRefinement.indexOf(name) === -1; var nextRefinement = isAnewValue ? currentRefinement.concat([name]) // cannot use .push(), it mutates : currentRefinement.filter(function (selectedValue) { return selectedValue !== name; }); // cannot use .splice(), it mutates return nextRefinement; } function getLimit$1(_ref) { var showMore = _ref.showMore, limit = _ref.limit, showMoreLimit = _ref.showMoreLimit; return showMore ? showMoreLimit : limit; } function _refine$6(props, searchState, nextRefinement, context) { var id = getId$a(props); // Setting the value to an empty string ensures that it is persisted in // the URL as an empty value. // This is necessary in the case where `defaultRefinement` contains one // item and we try to deselect it. `nextSelected` would be an empty array, // which would not be persisted to the URL. // {foo: ['bar']} => "foo[0]=bar" // {foo: []} => "" var nextValue = _defineProperty({}, id, nextRefinement.length > 0 ? nextRefinement : ''); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage, namespace$5); } function _cleanUp$4(props, searchState, context) { return cleanUpValue(searchState, context, "".concat(namespace$5, ".").concat(getId$a(props))); } /** * connectRefinementList connector provides the logic to build a widget that will * give the user the ability to choose multiple values for a specific facet. * @name connectRefinementList * @kind connector * @requirements The attribute passed to the `attribute` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * @propType {string} attribute - the name of the attribute in the record * @propType {boolean} [searchable=false] - allow search inside values * @propType {string} [operator=or] - How to apply the refinements. Possible values: 'or' or 'and'. * @propType {boolean} [showMore=false] - true if the component should display a button that will expand the number of items * @propType {number} [limit=10] - the minimum number of displayed items * @propType {number} [showMoreLimit=20] - the maximun number of displayed items. Only used when showMore is set to `true` * @propType {string[]} defaultRefinement - the values of the items selected by default. The searchState of this widget takes the form of a list of `string`s, which correspond to the values of all selected refinements. However, when there are no refinements selected, the value of the searchState is an empty string. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @providedPropType {function} refine - a function to toggle a refinement * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string[]} currentRefinement - the refinement currently applied * @providedPropType {array.<{count: number, isRefined: boolean, label: string, value: string}>} items - the list of items the RefinementList can display. * @providedPropType {function} searchForItems - a function to toggle a search inside items values * @providedPropType {boolean} isFromSearch - a boolean that says if the `items` props contains facet values from the global search or from the search inside items. * @providedPropType {boolean} canRefine - a boolean that says whether you can refine */ var sortBy$1 = ['isRefined', 'count:desc', 'name:asc']; var connectRefinementList = createConnectorWithContext({ displayName: 'AlgoliaRefinementList', propTypes: { id: propTypes.string, attribute: propTypes.string.isRequired, operator: propTypes.oneOf(['and', 'or']), showMore: propTypes.bool, limit: propTypes.number, showMoreLimit: propTypes.number, defaultRefinement: propTypes.arrayOf(propTypes.oneOfType([propTypes.string, propTypes.number])), searchable: propTypes.bool, transformItems: propTypes.func }, defaultProps: { operator: 'or', showMore: false, limit: 10, showMoreLimit: 20 }, getProvidedProps: function getProvidedProps(props, searchState, searchResults, metadata, searchForFacetValuesResults) { var attribute = props.attribute, searchable = props.searchable, indexContextValue = props.indexContextValue; var results = getResults(searchResults, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var canRefine = Boolean(results) && Boolean(results.getFacetByName(attribute)); var isFromSearch = Boolean(searchForFacetValuesResults && searchForFacetValuesResults[attribute] && searchForFacetValuesResults.query !== ''); // Search For Facet Values is not available with derived helper (used for multi index search) if (searchable && indexContextValue) { throw new Error('react-instantsearch: searching in *List is not available when used inside a' + ' multi index context'); } if (!canRefine) { return { items: [], currentRefinement: getCurrentRefinement$7(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), canRefine: canRefine, isFromSearch: isFromSearch, searchable: searchable }; } var items = isFromSearch ? searchForFacetValuesResults[attribute].map(function (v) { return { label: v.value, value: getValue$2(v.value, props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), _highlightResult: { label: { value: v.highlighted } }, count: v.count, isRefined: v.isRefined }; }) : results.getFacetValues(attribute, { sortBy: sortBy$1 }).map(function (v) { return { label: v.name, value: getValue$2(v.name, props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), count: v.count, isRefined: v.isRefined }; }); var transformedItems = props.transformItems ? props.transformItems(items) : items; return { items: transformedItems.slice(0, getLimit$1(props)), currentRefinement: getCurrentRefinement$7(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), isFromSearch: isFromSearch, searchable: searchable, canRefine: transformedItems.length > 0 }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$6(props, searchState, nextRefinement, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, searchForFacetValues: function searchForFacetValues(props, searchState, nextRefinement) { return { facetName: props.attribute, query: nextRefinement, maxFacetHits: getLimit$1(props) }; }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$4(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var attribute = props.attribute, operator = props.operator; var addKey = operator === 'and' ? 'addFacet' : 'addDisjunctiveFacet'; var addRefinementKey = "".concat(addKey, "Refinement"); searchParameters = searchParameters.setQueryParameters({ maxValuesPerFacet: Math.max(searchParameters.maxValuesPerFacet || 0, getLimit$1(props)) }); searchParameters = searchParameters[addKey](attribute); return getCurrentRefinement$7(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }).reduce(function (res, val) { return res[addRefinementKey](attribute, val); }, searchParameters); }, getMetadata: function getMetadata(props, searchState) { var id = getId$a(props); var context = { ais: props.contextValue, multiIndexContext: props.indexContextValue }; return { id: id, index: getIndexId(context), items: getCurrentRefinement$7(props, searchState, context).length > 0 ? [{ attribute: props.attribute, label: "".concat(props.attribute, ": "), currentRefinement: getCurrentRefinement$7(props, searchState, context), value: function value(nextState) { return _refine$6(props, nextState, [], context); }, items: getCurrentRefinement$7(props, searchState, context).map(function (item) { return { label: "".concat(item), value: function value(nextState) { var nextSelectedItems = getCurrentRefinement$7(props, nextState, context).filter(function (other) { return other !== item; }); return _refine$6(props, searchState, nextSelectedItems, context); } }; }) }] : [] }; } }); /** * connectScrollTo connector provides the logic to build a widget that will * let the page scroll to a certain point. * @name connectScrollTo * @kind connector * @propType {string} [scrollOn="page"] - Widget searchState key on which to listen for changes, default to the pagination widget. * @providedPropType {any} value - the current refinement applied to the widget listened by scrollTo * @providedPropType {boolean} hasNotChanged - indicates whether the refinement came from the scrollOn argument (for instance page by default) */ var connectScrollTo = createConnectorWithContext({ displayName: 'AlgoliaScrollTo', propTypes: { scrollOn: propTypes.string }, defaultProps: { scrollOn: 'page' }, getProvidedProps: function getProvidedProps(props, searchState) { var id = props.scrollOn; var value = getCurrentRefinementValue(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }, id, null); if (!this._prevSearchState) { this._prevSearchState = {}; } // Get the subpart of the state that interest us if (hasMultipleIndices({ ais: props.contextValue, multiIndexContext: props.indexContextValue })) { searchState = searchState.indices ? searchState.indices[getIndexId({ ais: props.contextValue, multiIndexContext: props.indexContextValue })] : {}; } // if there is a change in the app that has been triggered by another element // than "props.scrollOn (id) or the Configure widget, we need to keep track of // the search state to know if there's a change in the app that was not triggered // by the props.scrollOn (id) or the Configure widget. This is useful when // using ScrollTo in combination of Pagination. As pagination can be change // by every widget, we want to scroll only if it cames from the pagination // widget itself. We also remove the configure key from the search state to // do this comparison because for now configure values are not present in the // search state before a first refinement has been made and will false the results. // See: https://github.com/algolia/react-instantsearch/issues/164 var cleanedSearchState = omit(searchState, ['configure', id]); var hasNotChanged = shallowEqual(this._prevSearchState, cleanedSearchState); this._prevSearchState = cleanedSearchState; return { value: value, hasNotChanged: hasNotChanged }; } }); function getId$b() { return 'query'; } function getCurrentRefinement$8(props, searchState, context) { var id = getId$b(); var currentRefinement = getCurrentRefinementValue(props, searchState, context, id, ''); if (currentRefinement) { return currentRefinement; } return ''; } function _refine$7(props, searchState, nextRefinement, context) { var id = getId$b(); var nextValue = _defineProperty({}, id, nextRefinement); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage); } function _cleanUp$5(props, searchState, context) { return cleanUpValue(searchState, context, getId$b()); } /** * connectSearchBox connector provides the logic to build a widget that will * let the user search for a query * @name connectSearchBox * @kind connector * @propType {string} [defaultRefinement] - Provide a default value for the query * @providedPropType {function} refine - a function to change the current query * @providedPropType {string} currentRefinement - the current query used * @providedPropType {boolean} isSearchStalled - a flag that indicates if InstantSearch has detected that searches are stalled */ var connectSearchBox = createConnectorWithContext({ displayName: 'AlgoliaSearchBox', propTypes: { defaultRefinement: propTypes.string }, getProvidedProps: function getProvidedProps(props, searchState, searchResults) { return { currentRefinement: getCurrentRefinement$8(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }), isSearchStalled: searchResults.isSearchStalled }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$7(props, searchState, nextRefinement, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$5(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { return searchParameters.setQuery(getCurrentRefinement$8(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue })); }, getMetadata: function getMetadata(props, searchState) { var id = getId$b(); var currentRefinement = getCurrentRefinement$8(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); return { id: id, index: getIndexId({ ais: props.contextValue, multiIndexContext: props.indexContextValue }), items: currentRefinement === null ? [] : [{ label: "".concat(id, ": ").concat(currentRefinement), value: function value(nextState) { return _refine$7(props, nextState, '', { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, currentRefinement: currentRefinement }] }; } }); function getId$c() { return 'sortBy'; } function getCurrentRefinement$9(props, searchState, context) { var id = getId$c(); var currentRefinement = getCurrentRefinementValue(props, searchState, context, id, null); if (currentRefinement) { return currentRefinement; } return null; } /** * The connectSortBy connector provides the logic to build a widget that will * display a list of indices. This allows a user to change how the hits are being sorted. * @name connectSortBy * @requirements Algolia handles sorting by creating replica indices. [Read more about sorting](https://www.algolia.com/doc/guides/relevance/sorting/) on * the Algolia website. * @kind connector * @propType {string} defaultRefinement - The default selected index. * @propType {{value: string, label: string}[]} items - The list of indexes to search in. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @providedPropType {function} refine - a function to remove a single filter * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string[]} currentRefinement - the refinement currently applied * @providedPropType {array.<{isRefined: boolean, label?: string, value: string}>} items - the list of items the HitsPerPage can display. If no label provided, the value will be displayed. */ var connectSortBy = createConnectorWithContext({ displayName: 'AlgoliaSortBy', propTypes: { defaultRefinement: propTypes.string, items: propTypes.arrayOf(propTypes.shape({ label: propTypes.string, value: propTypes.string.isRequired })).isRequired, transformItems: propTypes.func }, getProvidedProps: function getProvidedProps(props, searchState) { var currentRefinement = getCurrentRefinement$9(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var items = props.items.map(function (item) { return item.value === currentRefinement ? _objectSpread({}, item, { isRefined: true }) : _objectSpread({}, item, { isRefined: false }); }); return { items: props.transformItems ? props.transformItems(items) : items, currentRefinement: currentRefinement }; }, refine: function refine(props, searchState, nextRefinement) { var id = getId$c(); var nextValue = _defineProperty({}, id, nextRefinement); var resetPage = true; return refineValue(searchState, nextValue, { ais: props.contextValue, multiIndexContext: props.indexContextValue }, resetPage); }, cleanUp: function cleanUp(props, searchState) { return cleanUpValue(searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }, getId$c()); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var selectedIndex = getCurrentRefinement$9(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); return searchParameters.setIndex(selectedIndex); }, getMetadata: function getMetadata() { return { id: getId$c() }; } }); /** * connectStats connector provides the logic to build a widget that will * displays algolia search statistics (hits number and processing time). * @name connectStats * @kind connector * @providedPropType {number} nbHits - number of hits returned by Algolia. * @providedPropType {number} processingTimeMS - the time in ms took by Algolia to search for results. */ var connectStats = createConnectorWithContext({ displayName: 'AlgoliaStats', getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var results = getResults(searchResults, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); if (!results) { return null; } return { nbHits: results.nbHits, processingTimeMS: results.processingTimeMS }; } }); function getId$d(props) { return props.attribute; } var namespace$6 = 'toggle'; var falsyStrings = ['0', 'false', 'null', 'undefined']; function getCurrentRefinement$a(props, searchState, context) { var currentRefinement = getCurrentRefinementValue(props, searchState, context, "".concat(namespace$6, ".").concat(getId$d(props)), false); if (falsyStrings.indexOf(currentRefinement) !== -1) { return false; } return Boolean(currentRefinement); } function _refine$8(props, searchState, nextRefinement, context) { var id = getId$d(props); var nextValue = _defineProperty({}, id, nextRefinement ? nextRefinement : false); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage, namespace$6); } function _cleanUp$6(props, searchState, context) { return cleanUpValue(searchState, context, "".concat(namespace$6, ".").concat(getId$d(props))); } /** * connectToggleRefinement connector provides the logic to build a widget that will * provides an on/off filtering feature based on an attribute value. * @name connectToggleRefinement * @kind connector * @requirements To use this widget, you'll need an attribute to toggle on. * * You can't toggle on null or not-null values. If you want to address this particular use-case you'll need to compute an * extra boolean attribute saying if the value exists or not. See this [thread](https://discourse.algolia.com/t/how-to-create-a-toggle-for-the-absence-of-a-string-attribute/2460) for more details. * * @propType {string} attribute - Name of the attribute on which to apply the `value` refinement. Required when `value` is present. * @propType {string} label - Label for the toggle. * @propType {string} value - Value of the refinement to apply on `attribute`. * @propType {boolean} [defaultRefinement=false] - Default searchState of the widget. Should the toggle be checked by default? * @providedPropType {boolean} currentRefinement - `true` when the refinement is applied, `false` otherwise * @providedPropType {object} count - an object that contains the count for `checked` and `unchecked` state * @providedPropType {function} refine - a function to toggle a refinement * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state */ var connectToggleRefinement = createConnectorWithContext({ displayName: 'AlgoliaToggle', propTypes: { label: propTypes.string.isRequired, attribute: propTypes.string.isRequired, value: propTypes.any.isRequired, filter: propTypes.func, defaultRefinement: propTypes.bool }, getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var attribute = props.attribute, value = props.value; var results = getResults(searchResults, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var currentRefinement = getCurrentRefinement$a(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var allFacetValues = results && results.getFacetByName(attribute) ? results.getFacetValues(attribute) : null; var facetValue = // Use null to always be consistent with type of the value // count: number | null allFacetValues && allFacetValues.length ? find(allFacetValues, function (item) { return item.name === value.toString(); }) : null; var facetValueCount = facetValue && facetValue.count; var allFacetValuesCount = // Use null to always be consistent with type of the value // count: number | null allFacetValues && allFacetValues.length ? allFacetValues.reduce(function (acc, item) { return acc + item.count; }, 0) : null; var canRefine = currentRefinement ? allFacetValuesCount !== null && allFacetValuesCount > 0 : facetValueCount !== null && facetValueCount > 0; var count = { checked: allFacetValuesCount, unchecked: facetValueCount }; return { currentRefinement: currentRefinement, canRefine: canRefine, count: count }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$8(props, searchState, nextRefinement, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$6(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var attribute = props.attribute, value = props.value, filter = props.filter; var checked = getCurrentRefinement$a(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var nextSearchParameters = searchParameters.addDisjunctiveFacet(attribute); if (checked) { nextSearchParameters = nextSearchParameters.addDisjunctiveFacetRefinement(attribute, value); if (filter) { nextSearchParameters = filter(nextSearchParameters); } } return nextSearchParameters; }, getMetadata: function getMetadata(props, searchState) { var id = getId$d(props); var checked = getCurrentRefinement$a(props, searchState, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); var items = []; var index = getIndexId({ ais: props.contextValue, multiIndexContext: props.indexContextValue }); if (checked) { items.push({ label: props.label, currentRefinement: checked, attribute: props.attribute, value: function value(nextState) { return _refine$8(props, nextState, false, { ais: props.contextValue, multiIndexContext: props.indexContextValue }); } }); } return { id: id, index: index, items: items }; } }); var classnames = createCommonjsModule(function (module) { /*! Copyright (c) 2016 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ /* global define */ (function () { var hasOwn = {}.hasOwnProperty; function classNames () { var classes = []; for (var i = 0; i < arguments.length; i++) { var arg = arguments[i]; if (!arg) continue; var argType = typeof arg; if (argType === 'string' || argType === 'number') { classes.push(arg); } else if (Array.isArray(arg)) { classes.push(classNames.apply(null, arg)); } else if (argType === 'object') { for (var key in arg) { if (hasOwn.call(arg, key) && arg[key]) { classes.push(key); } } } } return classes.join(' '); } if ( module.exports) { module.exports = classNames; } else { window.classNames = classNames; } }()); }); var createClassNames = function createClassNames(block) { var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'ais'; return function () { for (var _len = arguments.length, elements = new Array(_len), _key = 0; _key < _len; _key++) { elements[_key] = arguments[_key]; } var suitElements = elements.filter(function (element) { return element || element === ''; }).map(function (element) { var baseClassName = "".concat(prefix, "-").concat(block); return element ? "".concat(baseClassName, "-").concat(element) : baseClassName; }); return classnames(suitElements); }; }; var isSpecialClick = function isSpecialClick(event) { var isMiddleClick = event.button === 1; return Boolean(isMiddleClick || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey); }; var capitalize = function capitalize(key) { return key.length === 0 ? '' : "".concat(key[0].toUpperCase()).concat(key.slice(1)); }; // taken from InstantSearch.js/utils function range(_ref) { var _ref$start = _ref.start, start = _ref$start === void 0 ? 0 : _ref$start, end = _ref.end, _ref$step = _ref.step, step = _ref$step === void 0 ? 1 : _ref$step; // We can't divide by 0 so we re-assign the step to 1 if it happens. var limitStep = step === 0 ? 1 : step; // In some cases the array to create has a decimal length. // We therefore need to round the value. // Example: // { start: 1, end: 5000, step: 500 } // => Array length = (5000 - 1) / 500 = 9.998 var arrayLength = Math.round((end - start) / limitStep); return _toConsumableArray(Array(arrayLength)).map(function (_, current) { return (start + current) * limitStep; }); } function find$2(array, comparator) { if (!Array.isArray(array)) { return undefined; } for (var i = 0; i < array.length; i++) { if (comparator(array[i])) { return array[i]; } } return undefined; } var cx = createClassNames('Panel'); var _createContext$1 = React.createContext(function setCanRefine() {}), PanelConsumer = _createContext$1.Consumer, PanelProvider = _createContext$1.Provider; var Panel = /*#__PURE__*/ function (_Component) { _inherits(Panel, _Component); function Panel() { var _getPrototypeOf2; var _this; _classCallCheck(this, Panel); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Panel)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_this), "state", { canRefine: true }); _defineProperty(_assertThisInitialized(_this), "setCanRefine", function (nextCanRefine) { _this.setState({ canRefine: nextCanRefine }); }); return _this; } _createClass(Panel, [{ key: "render", value: function render() { var _this$props = this.props, children = _this$props.children, className = _this$props.className, header = _this$props.header, footer = _this$props.footer; var canRefine = this.state.canRefine; return React__default.createElement("div", { className: classnames(cx('', !canRefine && '-noRefinement'), className) }, header && React__default.createElement("div", { className: cx('header') }, header), React__default.createElement("div", { className: cx('body') }, React__default.createElement(PanelProvider, { value: this.setCanRefine }, children)), footer && React__default.createElement("div", { className: cx('footer') }, footer)); } }]); return Panel; }(React.Component); _defineProperty(Panel, "propTypes", { children: propTypes.node.isRequired, className: propTypes.string, header: propTypes.node, footer: propTypes.node }); _defineProperty(Panel, "defaultProps", { className: '', header: null, footer: null }); var PanelCallbackHandler = /*#__PURE__*/ function (_Component) { _inherits(PanelCallbackHandler, _Component); function PanelCallbackHandler() { _classCallCheck(this, PanelCallbackHandler); return _possibleConstructorReturn(this, _getPrototypeOf(PanelCallbackHandler).apply(this, arguments)); } _createClass(PanelCallbackHandler, [{ key: "componentDidMount", value: function componentDidMount() { this.props.setCanRefine(this.props.canRefine); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (prevProps.canRefine !== this.props.canRefine) { this.props.setCanRefine(this.props.canRefine); } } }, { key: "render", value: function render() { return this.props.children; } }]); return PanelCallbackHandler; }(React.Component); _defineProperty(PanelCallbackHandler, "propTypes", { children: propTypes.node.isRequired, canRefine: propTypes.bool.isRequired, setCanRefine: propTypes.func.isRequired }); var PanelWrapper = function PanelWrapper(_ref) { var canRefine = _ref.canRefine, children = _ref.children; return React__default.createElement(PanelConsumer, null, function (setCanRefine) { return React__default.createElement(PanelCallbackHandler, { setCanRefine: setCanRefine, canRefine: canRefine }, children); }); }; var Link = /*#__PURE__*/ function (_Component) { _inherits(Link, _Component); function Link() { var _getPrototypeOf2; var _this; _classCallCheck(this, Link); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Link)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_this), "onClick", function (e) { if (isSpecialClick(e)) { return; } _this.props.onClick(); e.preventDefault(); }); return _this; } _createClass(Link, [{ key: "render", value: function render() { return React__default.createElement("a", _extends({}, this.props, { onClick: this.onClick })); } }]); return Link; }(React.Component); _defineProperty(Link, "propTypes", { onClick: propTypes.func.isRequired }); var cx$1 = createClassNames('Breadcrumb'); var itemsPropType = propTypes.arrayOf(propTypes.shape({ label: propTypes.string.isRequired, value: propTypes.string.isRequired })); var Breadcrumb = /*#__PURE__*/ function (_Component) { _inherits(Breadcrumb, _Component); function Breadcrumb() { _classCallCheck(this, Breadcrumb); return _possibleConstructorReturn(this, _getPrototypeOf(Breadcrumb).apply(this, arguments)); } _createClass(Breadcrumb, [{ key: "render", value: function render() { var _this$props = this.props, canRefine = _this$props.canRefine, createURL = _this$props.createURL, items = _this$props.items, refine = _this$props.refine, rootURL = _this$props.rootURL, separator = _this$props.separator, translate = _this$props.translate, className = _this$props.className; var rootPath = canRefine ? React__default.createElement("li", { className: cx$1('item') }, React__default.createElement(Link, { className: cx$1('link'), onClick: function onClick() { return !rootURL ? refine() : null; }, href: rootURL ? rootURL : createURL() }, translate('rootLabel'))) : null; var breadcrumb = items.map(function (item, idx) { var isLast = idx === items.length - 1; return React__default.createElement("li", { className: cx$1('item', isLast && 'item--selected'), key: idx }, React__default.createElement("span", { className: cx$1('separator') }, separator), !isLast ? React__default.createElement(Link, { className: cx$1('link'), onClick: function onClick() { return refine(item.value); }, href: createURL(item.value) }, item.label) : item.label); }); return React__default.createElement("div", { className: classnames(cx$1('', !canRefine && '-noRefinement'), className) }, React__default.createElement("ul", { className: cx$1('list') }, rootPath, breadcrumb)); } }]); return Breadcrumb; }(React.Component); _defineProperty(Breadcrumb, "propTypes", { canRefine: propTypes.bool.isRequired, createURL: propTypes.func.isRequired, items: itemsPropType, refine: propTypes.func.isRequired, rootURL: propTypes.string, separator: propTypes.node, translate: propTypes.func.isRequired, className: propTypes.string }); _defineProperty(Breadcrumb, "defaultProps", { rootURL: null, separator: ' > ', className: '' }); var Breadcrumb$1 = translatable({ rootLabel: 'Home' })(Breadcrumb); /** * A breadcrumb is a secondary navigation scheme that allows the user to see where the current page * is in relation to the website or web application’s hierarchy. * In terms of usability, using a breadcrumb reduces the number of actions a visitor needs to take in * order to get to a higher-level page. * * If you want to select a specific refinement for your Breadcrumb component, you will need to * use a [Virtual Hierarchical Menu](https://community.algolia.com/react-instantsearch/guide/Virtual_widgets.html) * and set its defaultRefinement that will be then used by the Breadcrumb. * * @name Breadcrumb * @kind widget * @requirements Breadcrumbs are used for websites with a large amount of content organised in a hierarchical manner. * The typical example is an e-commerce website which has a large variety of products grouped into logical categories * (with categories, subcategories which also have subcategories).To use this widget, your attributes must be formatted in a specific way. * * Keep in mind that breadcrumbs shouldn’t replace effective primary navigation menus: * it is only an alternative way to navigate around the website. * * If, for instance, you would like to have a breadcrumb of categories, objects in your index * should be formatted this way: * * ```json * { * "categories.lvl0": "products", * "categories.lvl1": "products > fruits", * "categories.lvl2": "products > fruits > citrus" * } * ``` * * It's also possible to provide more than one path for each level: * * ```json * { * "categories.lvl0": ["products", "goods"], * "categories.lvl1": ["products > fruits", "goods > to eat"] * } * ``` * * All attributes passed to the `attributes` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * * @propType {array.<string>} attributes - List of attributes to use to generate the hierarchy of the menu. See the example for the convention to follow * @propType {node} [separator='>'] - Symbol used for separating hyperlinks * @propType {string} [rootURL=null] - The originating page (homepage) * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return * @themeKey ais-Breadcrumb - the root div of the widget * @themeKey ais-Breadcrumb--noRefinement - the root div of the widget when there is no refinement * @themeKey ais-Breadcrumb-list - the list of all breadcrumb items * @themeKey ais-Breadcrumb-item - the breadcrumb navigation item * @themeKey ais-Breadcrumb-item--selected - the selected breadcrumb item * @themeKey ais-Breadcrumb-separator - the separator of each breadcrumb item * @themeKey ais-Breadcrumb-link - the clickable breadcrumb element * @translationKey rootLabel - The root's label. Accepts a string * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { Breadcrumb, InstantSearch, HierarchicalMenu } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <Breadcrumb * attributes={[ * 'hierarchicalCategories.lvl0', * 'hierarchicalCategories.lvl1', * 'hierarchicalCategories.lvl2', * ]} * /> * <HierarchicalMenu * defaultRefinement="Cameras & Camcorders" * attributes={[ * 'hierarchicalCategories.lvl0', * 'hierarchicalCategories.lvl1', * 'hierarchicalCategories.lvl2', * ]} * /> * </InstantSearch> * ); */ var BreadcrumbWidget = function BreadcrumbWidget(props) { return React__default.createElement(PanelWrapper, props, React__default.createElement(Breadcrumb$1, props)); }; var Breadcrumb$2 = connectBreadcrumb(BreadcrumbWidget); var cx$2 = createClassNames('ClearRefinements'); var ClearRefinements = /*#__PURE__*/ function (_Component) { _inherits(ClearRefinements, _Component); function ClearRefinements() { _classCallCheck(this, ClearRefinements); return _possibleConstructorReturn(this, _getPrototypeOf(ClearRefinements).apply(this, arguments)); } _createClass(ClearRefinements, [{ key: "render", value: function render() { var _this$props = this.props, items = _this$props.items, canRefine = _this$props.canRefine, refine = _this$props.refine, translate = _this$props.translate, className = _this$props.className; return React__default.createElement("div", { className: classnames(cx$2(''), className) }, React__default.createElement("button", { className: cx$2('button', !canRefine && 'button--disabled'), onClick: function onClick() { return refine(items); }, disabled: !canRefine }, translate('reset'))); } }]); return ClearRefinements; }(React.Component); _defineProperty(ClearRefinements, "propTypes", { items: propTypes.arrayOf(propTypes.object).isRequired, canRefine: propTypes.bool.isRequired, refine: propTypes.func.isRequired, translate: propTypes.func.isRequired, className: propTypes.string }); _defineProperty(ClearRefinements, "defaultProps", { className: '' }); var ClearRefinements$1 = translatable({ reset: 'Clear all filters' })(ClearRefinements); /** * The ClearRefinements widget displays a button that lets the user clean every refinement applied * to the search. * @name ClearRefinements * @kind widget * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @propType {boolean} [clearsQuery=false] - Pass true to also clear the search query * @themeKey ais-ClearRefinements - the root div of the widget * @themeKey ais-ClearRefinements-button - the clickable button * @themeKey ais-ClearRefinements-button--disabled - the disabled clickable button * @translationKey reset - the clear all button value * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, ClearRefinements, RefinementList } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <ClearRefinements /> * <RefinementList * attribute="brand" * defaultRefinement={['Apple']} * /> * </InstantSearch> * ); */ var ClearRefinementsWidget = function ClearRefinementsWidget(props) { return React__default.createElement(PanelWrapper, props, React__default.createElement(ClearRefinements$1, props)); }; var ClearRefinements$2 = connectCurrentRefinements(ClearRefinementsWidget); var cx$3 = createClassNames('CurrentRefinements'); var CurrentRefinements = function CurrentRefinements(_ref) { var items = _ref.items, canRefine = _ref.canRefine, refine = _ref.refine, translate = _ref.translate, className = _ref.className; return React__default.createElement("div", { className: classnames(cx$3('', !canRefine && '-noRefinement'), className) }, React__default.createElement("ul", { className: cx$3('list', !canRefine && 'list--noRefinement') }, items.map(function (item) { return React__default.createElement("li", { key: item.label, className: cx$3('item') }, React__default.createElement("span", { className: cx$3('label') }, item.label), item.items ? item.items.map(function (nest) { return React__default.createElement("span", { key: nest.label, className: cx$3('category') }, React__default.createElement("span", { className: cx$3('categoryLabel') }, nest.label), React__default.createElement("button", { className: cx$3('delete'), onClick: function onClick() { return refine(nest.value); } }, translate('clearFilter', nest))); }) : React__default.createElement("span", { className: cx$3('category') }, React__default.createElement("button", { className: cx$3('delete'), onClick: function onClick() { return refine(item.value); } }, translate('clearFilter', item)))); }))); }; var itemPropTypes = propTypes.arrayOf(propTypes.shape({ label: propTypes.string.isRequired, value: propTypes.func.isRequired, items: function items() { return itemPropTypes.apply(void 0, arguments); } })); CurrentRefinements.defaultProps = { className: '' }; var CurrentRefinements$1 = translatable({ clearFilter: '✕' })(CurrentRefinements); /** * The CurrentRefinements widget displays the list of currently applied filters. * * It allows the user to selectively remove them. * @name CurrentRefinements * @kind widget * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @themeKey ais-CurrentRefinements - the root div of the widget * @themeKey ais-CurrentRefinements--noRefinement - the root div of the widget when there is no refinement * @themeKey ais-CurrentRefinements-list - the list of all refined items * @themeKey ais-CurrentRefinements-list--noRefinement - the list of all refined items when there is no refinement * @themeKey ais-CurrentRefinements-item - the refined list item * @themeKey ais-CurrentRefinements-button - the button of each refined list item * @themeKey ais-CurrentRefinements-label - the refined list label * @themeKey ais-CurrentRefinements-category - the category of each item * @themeKey ais-CurrentRefinements-categoryLabel - the label of each catgory * @themeKey ais-CurrentRefinements-delete - the delete button of each label * @translationKey clearFilter - the remove filter button label * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, CurrentRefinements, RefinementList } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <CurrentRefinements /> * <RefinementList * attribute="brand" * defaultRefinement={['Colors']} * /> * </InstantSearch> * ); */ var CurrentRefinementsWidget = function CurrentRefinementsWidget(props) { return React__default.createElement(PanelWrapper, props, React__default.createElement(CurrentRefinements$1, props)); }; var CurrentRefinements$2 = connectCurrentRefinements(CurrentRefinementsWidget); var cx$4 = createClassNames('SearchBox'); var defaultLoadingIndicator = React__default.createElement("svg", { width: "18", height: "18", viewBox: "0 0 38 38", xmlns: "http://www.w3.org/2000/svg", stroke: "#444", className: cx$4('loadingIcon') }, React__default.createElement("g", { fill: "none", fillRule: "evenodd" }, React__default.createElement("g", { transform: "translate(1 1)", strokeWidth: "2" }, React__default.createElement("circle", { strokeOpacity: ".5", cx: "18", cy: "18", r: "18" }), React__default.createElement("path", { d: "M36 18c0-9.94-8.06-18-18-18" }, React__default.createElement("animateTransform", { attributeName: "transform", type: "rotate", from: "0 18 18", to: "360 18 18", dur: "1s", repeatCount: "indefinite" }))))); var defaultReset = React__default.createElement("svg", { className: cx$4('resetIcon'), xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", width: "10", height: "10" }, React__default.createElement("path", { d: "M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z" })); var defaultSubmit = React__default.createElement("svg", { className: cx$4('submitIcon'), xmlns: "http://www.w3.org/2000/svg", width: "10", height: "10", viewBox: "0 0 40 40" }, React__default.createElement("path", { d: "M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z" })); var SearchBox = /*#__PURE__*/ function (_Component) { _inherits(SearchBox, _Component); function SearchBox(props) { var _this; _classCallCheck(this, SearchBox); _this = _possibleConstructorReturn(this, _getPrototypeOf(SearchBox).call(this)); _defineProperty(_assertThisInitialized(_this), "getQuery", function () { return _this.props.searchAsYouType ? _this.props.currentRefinement : _this.state.query; }); _defineProperty(_assertThisInitialized(_this), "onInputMount", function (input) { _this.input = input; if (!_this.props.inputRef) return; if (typeof _this.props.inputRef === 'function') { _this.props.inputRef(input); } else { _this.props.inputRef.current = input; } }); _defineProperty(_assertThisInitialized(_this), "onKeyDown", function (e) { if (!_this.props.focusShortcuts) { return; } var shortcuts = _this.props.focusShortcuts.map(function (key) { return typeof key === 'string' ? key.toUpperCase().charCodeAt(0) : key; }); var elt = e.target || e.srcElement; var tagName = elt.tagName; if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') { // already in an input return; } var which = e.which || e.keyCode; if (shortcuts.indexOf(which) === -1) { // not the right shortcut return; } _this.input.focus(); e.stopPropagation(); e.preventDefault(); }); _defineProperty(_assertThisInitialized(_this), "onSubmit", function (e) { e.preventDefault(); e.stopPropagation(); _this.input.blur(); var _this$props = _this.props, refine = _this$props.refine, searchAsYouType = _this$props.searchAsYouType; if (!searchAsYouType) { refine(_this.getQuery()); } return false; }); _defineProperty(_assertThisInitialized(_this), "onChange", function (event) { var _this$props2 = _this.props, searchAsYouType = _this$props2.searchAsYouType, refine = _this$props2.refine, onChange = _this$props2.onChange; var value = event.target.value; if (searchAsYouType) { refine(value); } else { _this.setState({ query: value }); } if (onChange) { onChange(event); } }); _defineProperty(_assertThisInitialized(_this), "onReset", function (event) { var _this$props3 = _this.props, searchAsYouType = _this$props3.searchAsYouType, refine = _this$props3.refine, onReset = _this$props3.onReset; refine(''); _this.input.focus(); if (!searchAsYouType) { _this.setState({ query: '' }); } if (onReset) { onReset(event); } }); _this.state = { query: props.searchAsYouType ? null : props.currentRefinement }; return _this; } _createClass(SearchBox, [{ key: "componentDidMount", value: function componentDidMount() { document.addEventListener('keydown', this.onKeyDown); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { document.removeEventListener('keydown', this.onKeyDown); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (!this.props.searchAsYouType && prevProps.currentRefinement !== this.props.currentRefinement) { this.setState({ query: this.props.currentRefinement }); } } }, { key: "render", value: function render() { var _this2 = this; var _this$props4 = this.props, className = _this$props4.className, translate = _this$props4.translate, autoFocus = _this$props4.autoFocus, loadingIndicator = _this$props4.loadingIndicator, submit = _this$props4.submit, reset = _this$props4.reset; var query = this.getQuery(); var searchInputEvents = Object.keys(this.props).reduce(function (props, prop) { if (['onsubmit', 'onreset', 'onchange'].indexOf(prop.toLowerCase()) === -1 && prop.indexOf('on') === 0) { return _objectSpread({}, props, _defineProperty({}, prop, _this2.props[prop])); } return props; }, {}); var isSearchStalled = this.props.showLoadingIndicator && this.props.isSearchStalled; /* eslint-disable max-len */ return React__default.createElement("div", { className: classnames(cx$4(''), className) }, React__default.createElement("form", { noValidate: true, onSubmit: this.props.onSubmit ? this.props.onSubmit : this.onSubmit, onReset: this.onReset, className: cx$4('form', isSearchStalled && 'form--stalledSearch'), action: "", role: "search" }, React__default.createElement("input", _extends({ ref: this.onInputMount, type: "search", placeholder: translate('placeholder'), autoFocus: autoFocus, autoComplete: "off", autoCorrect: "off", autoCapitalize: "off", spellCheck: "false", required: true, maxLength: "512", value: query, onChange: this.onChange }, searchInputEvents, { className: cx$4('input') })), React__default.createElement("button", { type: "submit", title: translate('submitTitle'), className: cx$4('submit') }, submit), React__default.createElement("button", { type: "reset", title: translate('resetTitle'), className: cx$4('reset'), hidden: !query || isSearchStalled }, reset), this.props.showLoadingIndicator && React__default.createElement("span", { hidden: !isSearchStalled, className: cx$4('loadingIndicator') }, loadingIndicator))); /* eslint-enable */ } }]); return SearchBox; }(React.Component); _defineProperty(SearchBox, "propTypes", { currentRefinement: propTypes.string, className: propTypes.string, refine: propTypes.func.isRequired, translate: propTypes.func.isRequired, loadingIndicator: propTypes.node, reset: propTypes.node, submit: propTypes.node, focusShortcuts: propTypes.arrayOf(propTypes.oneOfType([propTypes.string, propTypes.number])), autoFocus: propTypes.bool, searchAsYouType: propTypes.bool, onSubmit: propTypes.func, onReset: propTypes.func, onChange: propTypes.func, isSearchStalled: propTypes.bool, showLoadingIndicator: propTypes.bool, inputRef: propTypes.oneOfType([propTypes.func, propTypes.exact({ current: propTypes.object })]) }); _defineProperty(SearchBox, "defaultProps", { currentRefinement: '', className: '', focusShortcuts: ['s', '/'], autoFocus: false, searchAsYouType: true, showLoadingIndicator: false, isSearchStalled: false, loadingIndicator: defaultLoadingIndicator, reset: defaultReset, submit: defaultSubmit }); var SearchBox$1 = translatable({ resetTitle: 'Clear the search query.', submitTitle: 'Submit your search query.', placeholder: 'Search here…' })(SearchBox); var itemsPropType$1 = propTypes.arrayOf(propTypes.shape({ value: propTypes.any, label: propTypes.node.isRequired, items: function items() { return itemsPropType$1.apply(void 0, arguments); } })); var List = /*#__PURE__*/ function (_Component) { _inherits(List, _Component); function List() { var _this; _classCallCheck(this, List); _this = _possibleConstructorReturn(this, _getPrototypeOf(List).call(this)); _defineProperty(_assertThisInitialized(_this), "onShowMoreClick", function () { _this.setState(function (state) { return { extended: !state.extended }; }); }); _defineProperty(_assertThisInitialized(_this), "getLimit", function () { var _this$props = _this.props, limit = _this$props.limit, showMoreLimit = _this$props.showMoreLimit; var extended = _this.state.extended; return extended ? showMoreLimit : limit; }); _defineProperty(_assertThisInitialized(_this), "resetQuery", function () { _this.setState({ query: '' }); }); _defineProperty(_assertThisInitialized(_this), "renderItem", function (item, resetQuery) { var itemHasChildren = item.items && Boolean(item.items.length); return React__default.createElement("li", { key: item.key || item.label, className: _this.props.cx('item', item.isRefined && 'item--selected', item.noRefinement && 'item--noRefinement', itemHasChildren && 'item--parent') }, _this.props.renderItem(item, resetQuery), itemHasChildren && React__default.createElement("ul", { className: _this.props.cx('list', 'list--child') }, item.items.slice(0, _this.getLimit()).map(function (child) { return _this.renderItem(child, item); }))); }); _this.state = { extended: false, query: '' }; return _this; } _createClass(List, [{ key: "renderShowMore", value: function renderShowMore() { var _this$props2 = this.props, showMore = _this$props2.showMore, translate = _this$props2.translate, cx = _this$props2.cx; var extended = this.state.extended; var disabled = this.props.limit >= this.props.items.length; if (!showMore) { return null; } return React__default.createElement("button", { disabled: disabled, className: cx('showMore', disabled && 'showMore--disabled'), onClick: this.onShowMoreClick }, translate('showMore', extended)); } }, { key: "renderSearchBox", value: function renderSearchBox() { var _this2 = this; var _this$props3 = this.props, cx = _this$props3.cx, searchForItems = _this$props3.searchForItems, isFromSearch = _this$props3.isFromSearch, translate = _this$props3.translate, items = _this$props3.items, selectItem = _this$props3.selectItem; var noResults = items.length === 0 && this.state.query !== '' ? React__default.createElement("div", { className: cx('noResults') }, translate('noResults')) : null; return React__default.createElement("div", { className: cx('searchBox') }, React__default.createElement(SearchBox$1, { currentRefinement: this.state.query, refine: function refine(value) { _this2.setState({ query: value }); searchForItems(value); }, focusShortcuts: [], translate: translate, onSubmit: function onSubmit(e) { e.preventDefault(); e.stopPropagation(); if (isFromSearch) { selectItem(items[0], _this2.resetQuery); } } }), noResults); } }, { key: "render", value: function render() { var _this3 = this; var _this$props4 = this.props, cx = _this$props4.cx, items = _this$props4.items, className = _this$props4.className, searchable = _this$props4.searchable, canRefine = _this$props4.canRefine; var searchBox = searchable ? this.renderSearchBox() : null; var rootClassName = classnames(cx('', !canRefine && '-noRefinement'), className); if (items.length === 0) { return React__default.createElement("div", { className: rootClassName }, searchBox); } // Always limit the number of items we show on screen, since the actual // number of retrieved items might vary with the `maxValuesPerFacet` config // option. return React__default.createElement("div", { className: rootClassName }, searchBox, React__default.createElement("ul", { className: cx('list', !canRefine && 'list--noRefinement') }, items.slice(0, this.getLimit()).map(function (item) { return _this3.renderItem(item, _this3.resetQuery); })), this.renderShowMore()); } }]); return List; }(React.Component); _defineProperty(List, "propTypes", { cx: propTypes.func.isRequired, // Only required with showMore. translate: propTypes.func, items: itemsPropType$1, renderItem: propTypes.func.isRequired, selectItem: propTypes.func, className: propTypes.string, showMore: propTypes.bool, limit: propTypes.number, showMoreLimit: propTypes.number, show: propTypes.func, searchForItems: propTypes.func, searchable: propTypes.bool, isFromSearch: propTypes.bool, canRefine: propTypes.bool }); _defineProperty(List, "defaultProps", { className: '', isFromSearch: false }); var cx$5 = createClassNames('HierarchicalMenu'); var itemsPropType$2 = propTypes.arrayOf(propTypes.shape({ label: propTypes.string.isRequired, value: propTypes.string, count: propTypes.number.isRequired, items: function items() { return itemsPropType$2.apply(void 0, arguments); } })); var HierarchicalMenu = /*#__PURE__*/ function (_Component) { _inherits(HierarchicalMenu, _Component); function HierarchicalMenu() { var _getPrototypeOf2; var _this; _classCallCheck(this, HierarchicalMenu); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(HierarchicalMenu)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_this), "renderItem", function (item) { var _this$props = _this.props, createURL = _this$props.createURL, refine = _this$props.refine; return React__default.createElement(Link, { className: cx$5('link'), onClick: function onClick() { return refine(item.value); }, href: createURL(item.value) }, React__default.createElement("span", { className: cx$5('label') }, item.label), ' ', React__default.createElement("span", { className: cx$5('count') }, item.count)); }); return _this; } _createClass(HierarchicalMenu, [{ key: "render", value: function render() { var _this$props2 = this.props, translate = _this$props2.translate, items = _this$props2.items, showMore = _this$props2.showMore, limit = _this$props2.limit, showMoreLimit = _this$props2.showMoreLimit, canRefine = _this$props2.canRefine, className = _this$props2.className; return React__default.createElement(List, { renderItem: this.renderItem, cx: cx$5, translate: translate, items: items, showMore: showMore, limit: limit, showMoreLimit: showMoreLimit, canRefine: canRefine, className: className }); } }]); return HierarchicalMenu; }(React.Component); _defineProperty(HierarchicalMenu, "propTypes", { translate: propTypes.func.isRequired, refine: propTypes.func.isRequired, createURL: propTypes.func.isRequired, canRefine: propTypes.bool.isRequired, items: itemsPropType$2, showMore: propTypes.bool, className: propTypes.string, limit: propTypes.number, showMoreLimit: propTypes.number, transformItems: propTypes.func }); _defineProperty(HierarchicalMenu, "defaultProps", { className: '' }); var HierarchicalMenu$1 = translatable({ showMore: function showMore(extended) { return extended ? 'Show less' : 'Show more'; } })(HierarchicalMenu); /** * The hierarchical menu lets the user browse attributes using a tree-like structure. * * This is commonly used for multi-level categorization of products on e-commerce * websites. From a UX point of view, we suggest not displaying more than two levels deep. * * @name HierarchicalMenu * @kind widget * @requirements To use this widget, your attributes must be formatted in a specific way. * If you want for example to have a hiearchical menu of categories, objects in your index * should be formatted this way: * * ```json * [{ * "objectID": "321432", * "name": "lemon", * "categories.lvl0": "products", * "categories.lvl1": "products > fruits", * }, * { * "objectID": "8976987", * "name": "orange", * "categories.lvl0": "products", * "categories.lvl1": "products > fruits", * }] * ``` * * It's also possible to provide more than one path for each level: * * ```json * { * "objectID": "321432", * "name": "lemon", * "categories.lvl0": ["products", "goods"], * "categories.lvl1": ["products > fruits", "goods > to eat"] * } * ``` * * All attributes passed to the `attributes` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * * @propType {array.<string>} attributes - List of attributes to use to generate the hierarchy of the menu. See the example for the convention to follow. * @propType {boolean} [showMore=false] - Flag to activate the show more button, for toggling the number of items between limit and showMoreLimit. * @propType {number} [limit=10] - The maximum number of items displayed. * @propType {number} [showMoreLimit=20] - The maximum number of items displayed when the user triggers the show more. Not considered if `showMore` is false. * @propType {string} [separator='>'] - Specifies the level separator used in the data. * @propType {string} [rootPath=null] - The path to use if the first level is not the root level. * @propType {boolean} [showParentLevel=true] - Flag to set if the parent level should be displayed. * @propType {string} [defaultRefinement] - the item value selected by default * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @themeKey ais-HierarchicalMenu - the root div of the widget * @themeKey ais-HierarchicalMenu-noRefinement - the root div of the widget when there is no refinement * @themeKey ais-HierarchicalMenu-searchBox - the search box of the widget. See [the SearchBox documentation](widgets/SearchBox.html#classnames) for the classnames and translation keys of the SearchBox. * @themeKey ais-HierarchicalMenu-list - the list of menu items * @themeKey ais-HierarchicalMenu-list--child - the child list of menu items * @themeKey ais-HierarchicalMenu-item - the menu list item * @themeKey ais-HierarchicalMenu-item--selected - the selected menu list item * @themeKey ais-HierarchicalMenu-item--parent - the menu list item containing children * @themeKey ais-HierarchicalMenu-link - the clickable menu element * @themeKey ais-HierarchicalMenu-label - the label of each item * @themeKey ais-HierarchicalMenu-count - the count of values for each item * @themeKey ais-HierarchicalMenu-showMore - the button used to display more categories * @themeKey ais-HierarchicalMenu-showMore--disabled - the disabled button used to display more categories * @translationKey showMore - The label of the show more button. Accepts one parameter, a boolean that is true if the values are expanded * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, HierarchicalMenu } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <HierarchicalMenu * attributes={[ * 'hierarchicalCategories.lvl0', * 'hierarchicalCategories.lvl1', * 'hierarchicalCategories.lvl2', * ]} * /> * </InstantSearch> * ); */ var HierarchicalMenuWidget = function HierarchicalMenuWidget(props) { return React__default.createElement(PanelWrapper, props, React__default.createElement(HierarchicalMenu$1, props)); }; var HierarchicalMenu$2 = connectHierarchicalMenu(HierarchicalMenuWidget); var Highlight = function Highlight(_ref) { var cx = _ref.cx, value = _ref.value, highlightedTagName = _ref.highlightedTagName, isHighlighted = _ref.isHighlighted, nonHighlightedTagName = _ref.nonHighlightedTagName; var TagName = isHighlighted ? highlightedTagName : nonHighlightedTagName; var className = isHighlighted ? 'highlighted' : 'nonHighlighted'; return React__default.createElement(TagName, { className: cx(className) }, value); }; var Highlighter = function Highlighter(_ref2) { var cx = _ref2.cx, hit = _ref2.hit, attribute = _ref2.attribute, highlight = _ref2.highlight, highlightProperty = _ref2.highlightProperty, tagName = _ref2.tagName, nonHighlightedTagName = _ref2.nonHighlightedTagName, separator = _ref2.separator, className = _ref2.className; var parsedHighlightedValue = highlight({ hit: hit, attribute: attribute, highlightProperty: highlightProperty }); return React__default.createElement("span", { className: classnames(cx(''), className) }, parsedHighlightedValue.map(function (item, i) { if (Array.isArray(item)) { var isLast = i === parsedHighlightedValue.length - 1; return React__default.createElement("span", { key: i }, item.map(function (element, index) { return React__default.createElement(Highlight, { cx: cx, key: index, value: element.value, highlightedTagName: tagName, nonHighlightedTagName: nonHighlightedTagName, isHighlighted: element.isHighlighted }); }), !isLast && React__default.createElement("span", { className: cx('separator') }, separator)); } return React__default.createElement(Highlight, { cx: cx, key: i, value: item.value, highlightedTagName: tagName, nonHighlightedTagName: nonHighlightedTagName, isHighlighted: item.isHighlighted }); })); }; Highlighter.defaultProps = { tagName: 'em', nonHighlightedTagName: 'span', className: '', separator: ', ' }; var cx$6 = createClassNames('Highlight'); var Highlight$1 = function Highlight(props) { return React__default.createElement(Highlighter, _extends({}, props, { highlightProperty: "_highlightResult", cx: cx$6 })); }; /** * Renders any attribute from a hit into its highlighted form when relevant. * * Read more about it in the [Highlighting results](guide/Highlighting_results.html) guide. * @name Highlight * @kind widget * @propType {string} attribute - location of the highlighted attribute in the hit (the corresponding element can be either a string or an array of strings) * @propType {object} hit - hit object containing the highlighted attribute * @propType {string} [tagName='em'] - tag to be used for highlighted parts of the hit * @propType {string} [nonHighlightedTagName='span'] - tag to be used for the parts of the hit that are not highlighted * @propType {node} [separator=',<space>'] - symbol used to separate the elements of the array in case the attribute points to an array of strings. * @themeKey ais-Highlight - root of the component * @themeKey ais-Highlight-highlighted - part of the text which is highlighted * @themeKey ais-Highlight-nonHighlighted - part of the text that is not highlighted * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, SearchBox, Hits, Highlight } from 'react-instantsearch-dom'; * * const Hit = ({ hit }) => ( * <div> * <Highlight attribute="name" hit={hit} /> * </div> * ); * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <SearchBox defaultRefinement="Pho" /> * <Hits hitComponent={Hit} /> * </InstantSearch> * ); */ var Highlight$2 = connectHighlight(Highlight$1); var cx$7 = createClassNames('Hits'); var DefaultHitComponent = function DefaultHitComponent(props) { return React__default.createElement("div", { style: { borderBottom: '1px solid #bbb', paddingBottom: '5px', marginBottom: '5px', wordBreak: 'break-all' } }, JSON.stringify(props).slice(0, 100), "..."); }; var Hits = function Hits(_ref) { var hits = _ref.hits, _ref$className = _ref.className, className = _ref$className === void 0 ? '' : _ref$className, _ref$hitComponent = _ref.hitComponent, HitComponent = _ref$hitComponent === void 0 ? DefaultHitComponent : _ref$hitComponent; return React__default.createElement("div", { className: classnames(cx$7(''), className) }, React__default.createElement("ul", { className: cx$7('list') }, hits.map(function (hit) { return React__default.createElement("li", { className: cx$7('item'), key: hit.objectID }, React__default.createElement(HitComponent, { hit: hit })); }))); }; var HitPropTypes = propTypes.shape({ objectID: propTypes.oneOfType([propTypes.string, propTypes.number]).isRequired }); /** * Displays a list of hits. * * To configure the number of hits being shown, use the [HitsPerPage widget](widgets/HitsPerPage.html), * [connectHitsPerPage connector](connectors/connectHitsPerPage.html) or the [Configure widget](widgets/Configure.html). * * @name Hits * @kind widget * @propType {Component} [hitComponent] - Component used for rendering each hit from * the results. If it is not provided the rendering defaults to displaying the * hit in its JSON form. The component will be called with a `hit` prop. * @themeKey ais-Hits - the root div of the widget * @themeKey ais-Hits-list - the list of results * @themeKey ais-Hits-item - the hit list item * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, Hits } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <Hits /> * </InstantSearch> * ); */ var Hits$1 = connectHits(Hits); var Select = /*#__PURE__*/ function (_Component) { _inherits(Select, _Component); function Select() { var _getPrototypeOf2; var _this; _classCallCheck(this, Select); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Select)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_this), "onChange", function (e) { _this.props.onSelect(e.target.value); }); return _this; } _createClass(Select, [{ key: "render", value: function render() { var _this$props = this.props, cx = _this$props.cx, items = _this$props.items, selectedItem = _this$props.selectedItem; return React__default.createElement("select", { className: cx('select'), value: selectedItem, onChange: this.onChange }, items.map(function (item) { return React__default.createElement("option", { className: cx('option'), key: item.key === undefined ? item.value : item.key, disabled: item.disabled, value: item.value }, item.label === undefined ? item.value : item.label); })); } }]); return Select; }(React.Component); _defineProperty(Select, "propTypes", { cx: propTypes.func.isRequired, onSelect: propTypes.func.isRequired, items: propTypes.arrayOf(propTypes.shape({ value: propTypes.oneOfType([propTypes.string, propTypes.number]).isRequired, key: propTypes.oneOfType([propTypes.string, propTypes.number]), label: propTypes.string, disabled: propTypes.bool })).isRequired, selectedItem: propTypes.oneOfType([propTypes.string, propTypes.number]).isRequired }); var cx$8 = createClassNames('HitsPerPage'); var HitsPerPage = /*#__PURE__*/ function (_Component) { _inherits(HitsPerPage, _Component); function HitsPerPage() { _classCallCheck(this, HitsPerPage); return _possibleConstructorReturn(this, _getPrototypeOf(HitsPerPage).apply(this, arguments)); } _createClass(HitsPerPage, [{ key: "render", value: function render() { var _this$props = this.props, items = _this$props.items, currentRefinement = _this$props.currentRefinement, refine = _this$props.refine, className = _this$props.className; return React__default.createElement("div", { className: classnames(cx$8(''), className) }, React__default.createElement(Select, { onSelect: refine, selectedItem: currentRefinement, items: items, cx: cx$8 })); } }]); return HitsPerPage; }(React.Component); _defineProperty(HitsPerPage, "propTypes", { items: propTypes.arrayOf(propTypes.shape({ value: propTypes.number.isRequired, label: propTypes.string })).isRequired, currentRefinement: propTypes.number.isRequired, refine: propTypes.func.isRequired, className: propTypes.string }); _defineProperty(HitsPerPage, "defaultProps", { className: '' }); /** * The HitsPerPage widget displays a dropdown menu to let the user change the number * of displayed hits. * * If you only want to configure the number of hits per page without * displaying a widget, you should use the `<Configure hitsPerPage={20} />` widget. See [`<Configure />` documentation](widgets/Configure.html) * * @name HitsPerPage * @kind widget * @propType {{value: number, label: string}[]} items - List of available options. * @propType {number} defaultRefinement - The number of items selected by default * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @themeKey ais-HitsPerPage - the root div of the widget * @themeKey ais-HitsPerPage-select - the select * @themeKey ais-HitsPerPage-option - the select option * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, HitsPerPage, Hits } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <HitsPerPage * defaultRefinement={5} * items={[ * { value: 5, label: 'Show 5 hits' }, * { value: 10, label: 'Show 10 hits' }, * ]} * /> * <Hits /> * </InstantSearch> * ); */ var HitsPerPage$1 = connectHitsPerPage(HitsPerPage); var cx$9 = createClassNames('InfiniteHits'); var InfiniteHits = /*#__PURE__*/ function (_Component) { _inherits(InfiniteHits, _Component); function InfiniteHits() { _classCallCheck(this, InfiniteHits); return _possibleConstructorReturn(this, _getPrototypeOf(InfiniteHits).apply(this, arguments)); } _createClass(InfiniteHits, [{ key: "render", value: function render() { var _this$props = this.props, HitComponent = _this$props.hitComponent, hits = _this$props.hits, showPrevious = _this$props.showPrevious, hasPrevious = _this$props.hasPrevious, hasMore = _this$props.hasMore, refinePrevious = _this$props.refinePrevious, refineNext = _this$props.refineNext, translate = _this$props.translate, className = _this$props.className; return React__default.createElement("div", { className: classnames(cx$9(''), className) }, showPrevious && React__default.createElement("button", { className: cx$9('loadPrevious', !hasPrevious && 'loadPrevious--disabled'), onClick: function onClick() { return refinePrevious(); }, disabled: !hasPrevious }, translate('loadPrevious')), React__default.createElement("ul", { className: cx$9('list') }, hits.map(function (hit) { return React__default.createElement("li", { key: hit.objectID, className: cx$9('item') }, React__default.createElement(HitComponent, { hit: hit })); })), React__default.createElement("button", { className: cx$9('loadMore', !hasMore && 'loadMore--disabled'), onClick: function onClick() { return refineNext(); }, disabled: !hasMore }, translate('loadMore'))); } }]); return InfiniteHits; }(React.Component); InfiniteHits.defaultProps = { className: '', showPrevious: false, hitComponent: function hitComponent(hit) { return React__default.createElement("div", { style: { borderBottom: '1px solid #bbb', paddingBottom: '5px', marginBottom: '5px', wordBreak: 'break-all' } }, JSON.stringify(hit).slice(0, 100), "..."); } }; var InfiniteHits$1 = translatable({ loadPrevious: 'Load previous', loadMore: 'Load more' })(InfiniteHits); /** * Displays an infinite list of hits along with a **load more** button. * * To configure the number of hits being shown, use the [HitsPerPage widget](widgets/HitsPerPage.html), * [connectHitsPerPage connector](connectors/connectHitsPerPage.html) or the [Configure widget](widgets/Configure.html). * * @name InfiniteHits * @kind widget * @propType {Component} [hitComponent] - Component used for rendering each hit from * the results. If it is not provided the rendering defaults to displaying the * hit in its JSON form. The component will be called with a `hit` prop. * @themeKey ais-InfiniteHits - the root div of the widget * @themeKey ais-InfiniteHits-list - the list of hits * @themeKey ais-InfiniteHits-item - the hit list item * @themeKey ais-InfiniteHits-loadMore - the button used to display more results * @themeKey ais-InfiniteHits-loadMore--disabled - the disabled button used to display more results * @translationKey loadMore - the label of load more button * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, InfiniteHits } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <InfiniteHits /> * </InstantSearch> * ); */ var InfiniteHits$2 = connectInfiniteHits(InfiniteHits$1); var cx$a = createClassNames('Menu'); var Menu = /*#__PURE__*/ function (_Component) { _inherits(Menu, _Component); function Menu() { var _getPrototypeOf2; var _this; _classCallCheck(this, Menu); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Menu)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_this), "renderItem", function (item, resetQuery) { var createURL = _this.props.createURL; var label = _this.props.isFromSearch ? React__default.createElement(Highlight$2, { attribute: "label", hit: item }) : item.label; return React__default.createElement(Link, { className: cx$a('link'), onClick: function onClick() { return _this.selectItem(item, resetQuery); }, href: createURL(item.value) }, React__default.createElement("span", { className: cx$a('label') }, label), ' ', React__default.createElement("span", { className: cx$a('count') }, item.count)); }); _defineProperty(_assertThisInitialized(_this), "selectItem", function (item, resetQuery) { resetQuery(); _this.props.refine(item.value); }); return _this; } _createClass(Menu, [{ key: "render", value: function render() { var _this$props = this.props, translate = _this$props.translate, items = _this$props.items, showMore = _this$props.showMore, limit = _this$props.limit, showMoreLimit = _this$props.showMoreLimit, isFromSearch = _this$props.isFromSearch, searchForItems = _this$props.searchForItems, searchable = _this$props.searchable, canRefine = _this$props.canRefine, className = _this$props.className; return React__default.createElement(List, { renderItem: this.renderItem, selectItem: this.selectItem, cx: cx$a, translate: translate, items: items, showMore: showMore, limit: limit, showMoreLimit: showMoreLimit, isFromSearch: isFromSearch, searchForItems: searchForItems, searchable: searchable, canRefine: canRefine, className: className }); } }]); return Menu; }(React.Component); _defineProperty(Menu, "propTypes", { translate: propTypes.func.isRequired, refine: propTypes.func.isRequired, searchForItems: propTypes.func.isRequired, searchable: propTypes.bool, createURL: propTypes.func.isRequired, items: propTypes.arrayOf(propTypes.shape({ label: propTypes.string.isRequired, value: propTypes.string.isRequired, count: propTypes.number.isRequired, isRefined: propTypes.bool.isRequired })), isFromSearch: propTypes.bool.isRequired, canRefine: propTypes.bool.isRequired, showMore: propTypes.bool, limit: propTypes.number, showMoreLimit: propTypes.number, transformItems: propTypes.func, className: propTypes.string }); _defineProperty(Menu, "defaultProps", { className: '' }); var Menu$1 = translatable({ showMore: function showMore(extended) { return extended ? 'Show less' : 'Show more'; }, noResults: 'No results', submit: null, reset: null, resetTitle: 'Clear the search query.', submitTitle: 'Submit your search query.', placeholder: 'Search here…' })(Menu); /** * The Menu component displays a menu that lets the user choose a single value for a specific attribute. * @name Menu * @kind widget * @requirements The attribute passed to the `attribute` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * * If you are using the `searchable` prop, you'll also need to make the attribute searchable using * the [dashboard](https://www.algolia.com/explorer/display/) or using the [API](https://www.algolia.com/doc/guides/searching/faceting/#search-for-facet-values). * @propType {string} attribute - the name of the attribute in the record * @propType {boolean} [showMore=false] - true if the component should display a button that will expand the number of items * @propType {number} [limit=10] - the minimum number of diplayed items * @propType {number} [showMoreLimit=20] - the maximun number of displayed items. Only used when showMore is set to `true` * @propType {string} [defaultRefinement] - the value of the item selected by default * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @propType {boolean} [searchable=false] - true if the component should display an input to search for facet values. <br> In order to make this feature work, you need to make the attribute searchable [using the API](https://www.algolia.com/doc/guides/searching/faceting/?language=js#declaring-a-searchable-attribute-for-faceting) or [the dashboard](https://www.algolia.com/explorer/display/). * @themeKey ais-Menu - the root div of the widget * @themeKey ais-Menu-searchBox - the search box of the widget. See [the SearchBox documentation](widgets/SearchBox.html#classnames) for the classnames and translation keys of the SearchBox. * @themeKey ais-Menu-list - the list of all menu items * @themeKey ais-Menu-item - the menu list item * @themeKey ais-Menu-item--selected - the selected menu list item * @themeKey ais-Menu-link - the clickable menu element * @themeKey ais-Menu-label - the label of each item * @themeKey ais-Menu-count - the count of values for each item * @themeKey ais-Menu-noResults - the div displayed when there are no results * @themeKey ais-Menu-showMore - the button used to display more categories * @themeKey ais-Menu-showMore--disabled - the disabled button used to display more categories * @translationkey showMore - The label of the show more button. Accepts one parameters, a boolean that is true if the values are expanded * @translationkey noResults - The label of the no results text when no search for facet values results are found. * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, Menu } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <Menu attribute="categories" /> * </InstantSearch> * ); */ var MenuWidget = function MenuWidget(props) { return React__default.createElement(PanelWrapper, props, React__default.createElement(Menu$1, props)); }; var Menu$2 = connectMenu(MenuWidget); var cx$b = createClassNames('MenuSelect'); var MenuSelect = /*#__PURE__*/ function (_Component) { _inherits(MenuSelect, _Component); function MenuSelect() { var _getPrototypeOf2; var _this; _classCallCheck(this, MenuSelect); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(MenuSelect)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_this), "handleSelectChange", function (_ref) { var value = _ref.target.value; _this.props.refine(value === 'ais__see__all__option' ? '' : value); }); return _this; } _createClass(MenuSelect, [{ key: "render", value: function render() { var _this$props = this.props, items = _this$props.items, canRefine = _this$props.canRefine, translate = _this$props.translate, className = _this$props.className; return React__default.createElement("div", { className: classnames(cx$b('', !canRefine && '-noRefinement'), className) }, React__default.createElement("select", { value: this.selectedValue, onChange: this.handleSelectChange, className: cx$b('select') }, React__default.createElement("option", { value: "ais__see__all__option", className: cx$b('option') }, translate('seeAllOption')), items.map(function (item) { return React__default.createElement("option", { key: item.value, value: item.value, className: cx$b('option') }, item.label, " (", item.count, ")"); }))); } }, { key: "selectedValue", get: function get() { var _ref2 = find$2(this.props.items, function (item) { return item.isRefined === true; }) || { value: 'ais__see__all__option' }, value = _ref2.value; return value; } }]); return MenuSelect; }(React.Component); _defineProperty(MenuSelect, "propTypes", { items: propTypes.arrayOf(propTypes.shape({ label: propTypes.string.isRequired, value: propTypes.string.isRequired, count: propTypes.oneOfType([propTypes.number.isRequired, propTypes.string.isRequired]), isRefined: propTypes.bool.isRequired })).isRequired, canRefine: propTypes.bool.isRequired, refine: propTypes.func.isRequired, translate: propTypes.func.isRequired, className: propTypes.string }); _defineProperty(MenuSelect, "defaultProps", { className: '' }); var MenuSelect$1 = translatable({ seeAllOption: 'See all' })(MenuSelect); /** * The MenuSelect component displays a select that lets the user choose a single value for a specific attribute. * @name MenuSelect * @kind widget * @requirements The attribute passed to the `attribute` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * @propType {string} attribute - the name of the attribute in the record * @propType {string} [defaultRefinement] - the value of the item selected by default * @propType {number} [limit=10] - the minimum number of diplayed items * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @themeKey ais-MenuSelect - the root div of the widget * @themeKey ais-MenuSelect-noRefinement - the root div of the widget when there is no refinement * @themeKey ais-MenuSelect-select - the `<select>` * @themeKey ais-MenuSelect-option - the select `<option>` * @translationkey seeAllOption - The label of the option to select to remove the refinement * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, MenuSelect } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <MenuSelect attribute="categories" /> * </InstantSearch> * ); */ var MenuSelectWidget = function MenuSelectWidget(props) { return React__default.createElement(PanelWrapper, props, React__default.createElement(MenuSelect$1, props)); }; var MenuSelect$2 = connectMenu(MenuSelectWidget); var cx$c = createClassNames('NumericMenu'); var NumericMenu = /*#__PURE__*/ function (_Component) { _inherits(NumericMenu, _Component); function NumericMenu() { var _getPrototypeOf2; var _this; _classCallCheck(this, NumericMenu); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(NumericMenu)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_this), "renderItem", function (item) { var _this$props = _this.props, refine = _this$props.refine, translate = _this$props.translate; return React__default.createElement("label", { className: cx$c('label') }, React__default.createElement("input", { className: cx$c('radio'), type: "radio", checked: item.isRefined, disabled: item.noRefinement, onChange: function onChange() { return refine(item.value); } }), React__default.createElement("span", { className: cx$c('labelText') }, item.value === '' ? translate('all') : item.label)); }); return _this; } _createClass(NumericMenu, [{ key: "render", value: function render() { var _this$props2 = this.props, items = _this$props2.items, canRefine = _this$props2.canRefine, className = _this$props2.className; return React__default.createElement(List, { renderItem: this.renderItem, showMore: false, canRefine: canRefine, cx: cx$c, items: items.map(function (item) { return _objectSpread({}, item, { key: item.value }); }), className: className }); } }]); return NumericMenu; }(React.Component); _defineProperty(NumericMenu, "propTypes", { items: propTypes.arrayOf(propTypes.shape({ label: propTypes.node.isRequired, value: propTypes.string.isRequired, isRefined: propTypes.bool.isRequired, noRefinement: propTypes.bool.isRequired })).isRequired, canRefine: propTypes.bool.isRequired, refine: propTypes.func.isRequired, translate: propTypes.func.isRequired, className: propTypes.string }); _defineProperty(NumericMenu, "defaultProps", { className: '' }); var NumericMenu$1 = translatable({ all: 'All' })(NumericMenu); /** * NumericMenu is a widget used for selecting the range value of a numeric attribute. * @name NumericMenu * @kind widget * @requirements The attribute passed to the `attribute` prop must be holding numerical values. * @propType {string} attribute - the name of the attribute in the records * @propType {{label: string, start: number, end: number}[]} items - List of options. With a text label, and upper and lower bounds. * @propType {string} [defaultRefinement] - the value of the item selected by default, follow the format "min:max". * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @themeKey ais-NumericMenu - the root div of the widget * @themeKey ais-NumericMenu--noRefinement - the root div of the widget when there is no refinement * @themeKey ais-NumericMenu-list - the list of all refinement items * @themeKey ais-NumericMenu-item - the refinement list item * @themeKey ais-NumericMenu-item--selected - the selected refinement list item * @themeKey ais-NumericMenu-label - the label of each refinement item * @themeKey ais-NumericMenu-radio - the radio input of each refinement item * @themeKey ais-NumericMenu-labelText - the label text of each refinement item * @translationkey all - The label of the largest range added automatically by react instantsearch * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, NumericMenu } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient * indexName="instant_search" * > * <NumericMenu * attribute="price" * items={[ * { end: 10, label: '< $10' }, * { start: 10, end: 100, label: '$10 - $100' }, * { start: 100, end: 500, label: '$100 - $500' }, * { start: 500, label: '> $500' }, * ]} * /> * </InstantSearch> * ); */ var NumericMenuWidget = function NumericMenuWidget(props) { return React__default.createElement(PanelWrapper, props, React__default.createElement(NumericMenu$1, props)); }; var NumericMenu$2 = connectNumericMenu(NumericMenuWidget); var LinkList = /*#__PURE__*/ function (_Component) { _inherits(LinkList, _Component); function LinkList() { _classCallCheck(this, LinkList); return _possibleConstructorReturn(this, _getPrototypeOf(LinkList).apply(this, arguments)); } _createClass(LinkList, [{ key: "render", value: function render() { var _this$props = this.props, cx = _this$props.cx, createURL = _this$props.createURL, items = _this$props.items, onSelect = _this$props.onSelect, canRefine = _this$props.canRefine; return React__default.createElement("ul", { className: cx('list', !canRefine && 'list--noRefinement') }, items.map(function (item) { return React__default.createElement("li", { key: item.key === undefined ? item.value : item.key, className: cx('item', item.selected && !item.disabled && 'item--selected', item.disabled && 'item--disabled', item.modifier) }, item.disabled ? React__default.createElement("span", { className: cx('link') }, item.label === undefined ? item.value : item.label) : React__default.createElement(Link, { className: cx('link', item.selected && 'link--selected'), "aria-label": item.ariaLabel, href: createURL(item.value), onClick: function onClick() { return onSelect(item.value); } }, item.label === undefined ? item.value : item.label)); })); } }]); return LinkList; }(React.Component); _defineProperty(LinkList, "propTypes", { cx: propTypes.func.isRequired, createURL: propTypes.func.isRequired, items: propTypes.arrayOf(propTypes.shape({ value: propTypes.oneOfType([propTypes.string, propTypes.number, propTypes.object]).isRequired, key: propTypes.oneOfType([propTypes.string, propTypes.number]), label: propTypes.node, modifier: propTypes.string, ariaLabel: propTypes.string, disabled: propTypes.bool })), onSelect: propTypes.func.isRequired, canRefine: propTypes.bool.isRequired }); var cx$d = createClassNames('Pagination'); // Determines the size of the widget (the number of pages displayed - that the user can directly click on) function calculateSize(padding, maxPages) { return Math.min(2 * padding + 1, maxPages); } function calculatePaddingLeft(currentPage, padding, maxPages, size) { if (currentPage <= padding) { return currentPage; } if (currentPage >= maxPages - padding) { return size - (maxPages - currentPage); } return padding + 1; } // Retrieve the correct page range to populate the widget function getPages(currentPage, maxPages, padding) { var size = calculateSize(padding, maxPages); // If the widget size is equal to the max number of pages, return the entire page range if (size === maxPages) return range({ start: 1, end: maxPages + 1 }); var paddingLeft = calculatePaddingLeft(currentPage, padding, maxPages, size); var paddingRight = size - paddingLeft; var first = currentPage - paddingLeft; var last = currentPage + paddingRight; return range({ start: first + 1, end: last + 1 }); } var Pagination = /*#__PURE__*/ function (_Component) { _inherits(Pagination, _Component); function Pagination() { _classCallCheck(this, Pagination); return _possibleConstructorReturn(this, _getPrototypeOf(Pagination).apply(this, arguments)); } _createClass(Pagination, [{ key: "getItem", value: function getItem(modifier, translationKey, value) { var _this$props = this.props, nbPages = _this$props.nbPages, totalPages = _this$props.totalPages, translate = _this$props.translate; return { key: "".concat(modifier, ".").concat(value), modifier: modifier, disabled: value < 1 || value >= Math.min(totalPages, nbPages), label: translate(translationKey, value), value: value, ariaLabel: translate("aria".concat(capitalize(translationKey)), value) }; } }, { key: "render", value: function render() { var _this$props2 = this.props, ListComponent = _this$props2.listComponent, nbPages = _this$props2.nbPages, totalPages = _this$props2.totalPages, currentRefinement = _this$props2.currentRefinement, padding = _this$props2.padding, showFirst = _this$props2.showFirst, showPrevious = _this$props2.showPrevious, showNext = _this$props2.showNext, showLast = _this$props2.showLast, refine = _this$props2.refine, createURL = _this$props2.createURL, canRefine = _this$props2.canRefine, translate = _this$props2.translate, className = _this$props2.className, otherProps = _objectWithoutProperties(_this$props2, ["listComponent", "nbPages", "totalPages", "currentRefinement", "padding", "showFirst", "showPrevious", "showNext", "showLast", "refine", "createURL", "canRefine", "translate", "className"]); var maxPages = Math.min(nbPages, totalPages); var lastPage = maxPages; var items = []; if (showFirst) { items.push({ key: 'first', modifier: 'item--firstPage', disabled: currentRefinement === 1, label: translate('first'), value: 1, ariaLabel: translate('ariaFirst') }); } if (showPrevious) { items.push({ key: 'previous', modifier: 'item--previousPage', disabled: currentRefinement === 1, label: translate('previous'), value: currentRefinement - 1, ariaLabel: translate('ariaPrevious') }); } items = items.concat(getPages(currentRefinement, maxPages, padding).map(function (value) { return { key: value, modifier: 'item--page', label: translate('page', value), value: value, selected: value === currentRefinement, ariaLabel: translate('ariaPage', value) }; })); if (showNext) { items.push({ key: 'next', modifier: 'item--nextPage', disabled: currentRefinement === lastPage || lastPage <= 1, label: translate('next'), value: currentRefinement + 1, ariaLabel: translate('ariaNext') }); } if (showLast) { items.push({ key: 'last', modifier: 'item--lastPage', disabled: currentRefinement === lastPage || lastPage <= 1, label: translate('last'), value: lastPage, ariaLabel: translate('ariaLast') }); } return React__default.createElement("div", { className: classnames(cx$d('', !canRefine && '-noRefinement'), className) }, React__default.createElement(ListComponent, _extends({}, otherProps, { cx: cx$d, items: items, onSelect: refine, createURL: createURL, canRefine: canRefine }))); } }]); return Pagination; }(React.Component); _defineProperty(Pagination, "propTypes", { nbPages: propTypes.number.isRequired, currentRefinement: propTypes.number.isRequired, refine: propTypes.func.isRequired, createURL: propTypes.func.isRequired, canRefine: propTypes.bool.isRequired, translate: propTypes.func.isRequired, listComponent: propTypes.func, showFirst: propTypes.bool, showPrevious: propTypes.bool, showNext: propTypes.bool, showLast: propTypes.bool, padding: propTypes.number, totalPages: propTypes.number, className: propTypes.string }); _defineProperty(Pagination, "defaultProps", { listComponent: LinkList, showFirst: true, showPrevious: true, showNext: true, showLast: false, padding: 3, totalPages: Infinity, className: '' }); var Pagination$1 = translatable({ previous: '‹', next: '›', first: '«', last: '»', page: function page(currentRefinement) { return currentRefinement.toString(); }, ariaPrevious: 'Previous page', ariaNext: 'Next page', ariaFirst: 'First page', ariaLast: 'Last page', ariaPage: function ariaPage(currentRefinement) { return "Page ".concat(currentRefinement.toString()); } })(Pagination); /** * The Pagination widget displays a simple pagination system allowing the user to * change the current page. * @name Pagination * @kind widget * @propType {boolean} [showFirst=true] - Display the first page link. * @propType {boolean} [showLast=false] - Display the last page link. * @propType {boolean} [showPrevious=true] - Display the previous page link. * @propType {boolean} [showNext=true] - Display the next page link. * @propType {number} [padding=3] - How many page links to display around the current page. * @propType {number} [totalPages=Infinity] - Maximum number of pages to display. * @themeKey ais-Pagination - the root div of the widget * @themeKey ais-Pagination--noRefinement - the root div of the widget when there is no refinement * @themeKey ais-Pagination-list - the list of all pagination items * @themeKey ais-Pagination-list--noRefinement - the list of all pagination items when there is no refinement * @themeKey ais-Pagination-item - the pagination list item * @themeKey ais-Pagination-item--firstPage - the "first" pagination list item * @themeKey ais-Pagination-item--lastPage - the "last" pagination list item * @themeKey ais-Pagination-item--previousPage - the "previous" pagination list item * @themeKey ais-Pagination-item--nextPage - the "next" pagination list item * @themeKey ais-Pagination-item--page - the "page" pagination list item * @themeKey ais-Pagination-item--selected - the selected pagination list item * @themeKey ais-Pagination-item--disabled - the disabled pagination list item * @themeKey ais-Pagination-link - the pagination clickable element * @translationKey previous - Label value for the previous page link * @translationKey next - Label value for the next page link * @translationKey first - Label value for the first page link * @translationKey last - Label value for the last page link * @translationkey page - Label value for a page item. You get function(currentRefinement) and you need to return a string * @translationKey ariaPrevious - Accessibility label value for the previous page link * @translationKey ariaNext - Accessibility label value for the next page link * @translationKey ariaFirst - Accessibility label value for the first page link * @translationKey ariaLast - Accessibility label value for the last page link * @translationkey ariaPage - Accessibility label value for a page item. You get function(currentRefinement) and you need to return a string * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, Pagination } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <Pagination /> * </InstantSearch> * ); */ var PaginationWidget = function PaginationWidget(props) { return React__default.createElement(PanelWrapper, props, React__default.createElement(Pagination$1, props)); }; var Pagination$2 = connectPagination(PaginationWidget); var cx$e = createClassNames('PoweredBy'); /* eslint-disable max-len */ var AlgoliaLogo = function AlgoliaLogo() { return React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", baseProfile: "basic", viewBox: "0 0 1366 362", width: "100", height: "27", className: cx$e('logo') }, React__default.createElement("linearGradient", { id: "g", x1: "428.258", x2: "434.145", y1: "404.15", y2: "409.85", gradientUnits: "userSpaceOnUse", gradientTransform: "matrix(94.045 0 0 -94.072 -40381.527 38479.52)" }, React__default.createElement("stop", { offset: "0", stopColor: "#00AEFF" }), React__default.createElement("stop", { offset: "1", stopColor: "#3369E7" })), React__default.createElement("path", { d: "M61.8 15.4h242.8c23.9 0 43.4 19.4 43.4 43.4v242.9c0 23.9-19.4 43.4-43.4 43.4H61.8c-23.9 0-43.4-19.4-43.4-43.4v-243c0-23.9 19.4-43.3 43.4-43.3z", fill: "url(#g)" }), React__default.createElement("path", { d: "M187 98.7c-51.4 0-93.1 41.7-93.1 93.2S135.6 285 187 285s93.1-41.7 93.1-93.2-41.6-93.1-93.1-93.1zm0 158.8c-36.2 0-65.6-29.4-65.6-65.6s29.4-65.6 65.6-65.6 65.6 29.4 65.6 65.6-29.3 65.6-65.6 65.6zm0-117.8v48.9c0 1.4 1.5 2.4 2.8 1.7l43.4-22.5c1-.5 1.3-1.7.8-2.7-9-15.8-25.7-26.6-45-27.3-1 0-2 .8-2 1.9zm-60.8-35.9l-5.7-5.7c-5.6-5.6-14.6-5.6-20.2 0l-6.8 6.8c-5.6 5.6-5.6 14.6 0 20.2l5.6 5.6c.9.9 2.2.7 3-.2 3.3-4.5 6.9-8.8 10.9-12.8 4.1-4.1 8.3-7.7 12.9-11 1-.6 1.1-2 .3-2.9zM217.5 89V77.7c0-7.9-6.4-14.3-14.3-14.3h-33.3c-7.9 0-14.3 6.4-14.3 14.3v11.6c0 1.3 1.2 2.2 2.5 1.9 9.3-2.7 19.1-4.1 29-4.1 9.5 0 18.9 1.3 28 3.8 1.2.3 2.4-.6 2.4-1.9z", fill: "#FFFFFF" }), React__default.createElement("path", { d: "M842.5 267.6c0 26.7-6.8 46.2-20.5 58.6-13.7 12.4-34.6 18.6-62.8 18.6-10.3 0-31.7-2-48.8-5.8l6.3-31c14.3 3 33.2 3.8 43.1 3.8 15.7 0 26.9-3.2 33.6-9.6s10-15.9 10-28.5v-6.4c-3.9 1.9-9 3.8-15.3 5.8-6.3 1.9-13.6 2.9-21.8 2.9-10.8 0-20.6-1.7-29.5-5.1-8.9-3.4-16.6-8.4-22.9-15-6.3-6.6-11.3-14.9-14.8-24.8s-5.3-27.6-5.3-40.6c0-12.2 1.9-27.5 5.6-37.7 3.8-10.2 9.2-19 16.5-26.3 7.2-7.3 16-12.9 26.3-17s22.4-6.7 35.5-6.7c12.7 0 24.4 1.6 35.8 3.5 11.4 1.9 21.1 3.9 29 6.1v155.2zm-108.7-77.2c0 16.4 3.6 34.6 10.8 42.2 7.2 7.6 16.5 11.4 27.9 11.4 6.2 0 12.1-.9 17.6-2.6 5.5-1.7 9.9-3.7 13.4-6.1v-97.1c-2.8-.6-14.5-3-25.8-3.3-14.2-.4-25 5.4-32.6 14.7-7.5 9.3-11.3 25.6-11.3 40.8zm294.3 0c0 13.2-1.9 23.2-5.8 34.1s-9.4 20.2-16.5 27.9c-7.1 7.7-15.6 13.7-25.6 17.9s-25.4 6.6-33.1 6.6c-7.7-.1-23-2.3-32.9-6.6-9.9-4.3-18.4-10.2-25.5-17.9-7.1-7.7-12.6-17-16.6-27.9s-6-20.9-6-34.1c0-13.2 1.8-25.9 5.8-36.7 4-10.8 9.6-20 16.8-27.7s15.8-13.6 25.6-17.8c9.9-4.2 20.8-6.2 32.6-6.2s22.7 2.1 32.7 6.2c10 4.2 18.6 10.1 25.6 17.8 7.1 7.7 12.6 16.9 16.6 27.7 4.2 10.8 6.3 23.5 6.3 36.7zm-40 .1c0-16.9-3.7-31-10.9-40.8-7.2-9.9-17.3-14.8-30.2-14.8-12.9 0-23 4.9-30.2 14.8-7.2 9.9-10.7 23.9-10.7 40.8 0 17.1 3.6 28.6 10.8 38.5 7.2 10 17.3 14.9 30.2 14.9 12.9 0 23-5 30.2-14.9 7.2-10 10.8-21.4 10.8-38.5zm127.1 86.4c-64.1.3-64.1-51.8-64.1-60.1L1051 32l39.1-6.2v183.6c0 4.7 0 34.5 25.1 34.6v32.9zm68.9 0h-39.3V108.1l39.3-6.2v175zm-19.7-193.5c13.1 0 23.8-10.6 23.8-23.7S1177.6 36 1164.4 36s-23.8 10.6-23.8 23.7 10.7 23.7 23.8 23.7zm117.4 18.6c12.9 0 23.8 1.6 32.6 4.8 8.8 3.2 15.9 7.7 21.1 13.4s8.9 13.5 11.1 21.7c2.3 8.2 3.4 17.2 3.4 27.1v100.6c-6 1.3-15.1 2.8-27.3 4.6s-25.9 2.7-41.1 2.7c-10.1 0-19.4-1-27.7-2.9-8.4-1.9-15.5-5-21.5-9.3-5.9-4.3-10.5-9.8-13.9-16.6-3.3-6.8-5-16.4-5-26.4 0-9.6 1.9-15.7 5.6-22.3 3.8-6.6 8.9-12 15.3-16.2 6.5-4.2 13.9-7.2 22.4-9s17.4-2.7 26.6-2.7c4.3 0 8.8.3 13.6.8s9.8 1.4 15.2 2.7v-6.4c0-4.5-.5-8.8-1.6-12.8-1.1-4.1-3-7.6-5.6-10.7-2.7-3.1-6.2-5.5-10.6-7.2s-10-3-16.7-3c-9 0-17.2 1.1-24.7 2.4-7.5 1.3-13.7 2.8-18.4 4.5l-4.7-32.1c4.9-1.7 12.2-3.4 21.6-5.1s19.5-2.6 30.3-2.6zm3.3 141.9c12 0 20.9-.7 27.1-1.9v-39.8c-2.2-.6-5.3-1.3-9.4-1.9-4.1-.6-8.6-1-13.6-1-4.3 0-8.7.3-13.1 1-4.4.6-8.4 1.8-11.9 3.5s-6.4 4.1-8.5 7.2c-2.2 3.1-3.2 4.9-3.2 9.6 0 9.2 3.2 14.5 9 18 5.9 3.6 13.7 5.3 23.6 5.3zM512.9 103c12.9 0 23.8 1.6 32.6 4.8 8.8 3.2 15.9 7.7 21.1 13.4 5.3 5.8 8.9 13.5 11.1 21.7 2.3 8.2 3.4 17.2 3.4 27.1v100.6c-6 1.3-15.1 2.8-27.3 4.6-12.2 1.8-25.9 2.7-41.1 2.7-10.1 0-19.4-1-27.7-2.9-8.4-1.9-15.5-5-21.5-9.3-5.9-4.3-10.5-9.8-13.9-16.6-3.3-6.8-5-16.4-5-26.4 0-9.6 1.9-15.7 5.6-22.3 3.8-6.6 8.9-12 15.3-16.2 6.5-4.2 13.9-7.2 22.4-9s17.4-2.7 26.6-2.7c4.3 0 8.8.3 13.6.8 4.7.5 9.8 1.4 15.2 2.7v-6.4c0-4.5-.5-8.8-1.6-12.8-1.1-4.1-3-7.6-5.6-10.7-2.7-3.1-6.2-5.5-10.6-7.2-4.4-1.7-10-3-16.7-3-9 0-17.2 1.1-24.7 2.4-7.5 1.3-13.7 2.8-18.4 4.5l-4.7-32.1c4.9-1.7 12.2-3.4 21.6-5.1 9.4-1.8 19.5-2.6 30.3-2.6zm3.4 142c12 0 20.9-.7 27.1-1.9v-39.8c-2.2-.6-5.3-1.3-9.4-1.9-4.1-.6-8.6-1-13.6-1-4.3 0-8.7.3-13.1 1-4.4.6-8.4 1.8-11.9 3.5s-6.4 4.1-8.5 7.2c-2.2 3.1-3.2 4.9-3.2 9.6 0 9.2 3.2 14.5 9 18s13.7 5.3 23.6 5.3zm158.5 31.9c-64.1.3-64.1-51.8-64.1-60.1L610.6 32l39.1-6.2v183.6c0 4.7 0 34.5 25.1 34.6v32.9z", fill: "#182359" })); }; /* eslint-enable max-len */ var PoweredBy = /*#__PURE__*/ function (_Component) { _inherits(PoweredBy, _Component); function PoweredBy() { _classCallCheck(this, PoweredBy); return _possibleConstructorReturn(this, _getPrototypeOf(PoweredBy).apply(this, arguments)); } _createClass(PoweredBy, [{ key: "render", value: function render() { var _this$props = this.props, url = _this$props.url, translate = _this$props.translate, className = _this$props.className; return React__default.createElement("div", { className: classnames(cx$e(''), className) }, React__default.createElement("span", { className: cx$e('text') }, translate('searchBy')), ' ', React__default.createElement("a", { href: url, target: "_blank", className: cx$e('link'), "aria-label": "Algolia", rel: "noopener noreferrer" }, React__default.createElement(AlgoliaLogo, null))); } }]); return PoweredBy; }(React.Component); _defineProperty(PoweredBy, "propTypes", { url: propTypes.string.isRequired, translate: propTypes.func.isRequired, className: propTypes.string }); var PoweredBy$1 = translatable({ searchBy: 'Search by' })(PoweredBy); /** * PoweredBy displays an Algolia logo. * * Algolia requires that you use this widget if you are on a [community or free plan](https://www.algolia.com/pricing). * @name PoweredBy * @kind widget * @themeKey ais-PoweredBy - the root div of the widget * @themeKey ais-PoweredBy-text - the text of the widget * @themeKey ais-PoweredBy-link - the link of the logo * @themeKey ais-PoweredBy-logo - the logo of the widget * @translationKey searchBy - Label value for the powered by * @example * import React from 'react'; * import { InstantSearch, PoweredBy } from 'react-instantsearch-dom'; * import algoliasearch from 'algoliasearch/lite'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <PoweredBy /> * </InstantSearch> * ); */ var PoweredBy$2 = connectPoweredBy(PoweredBy$1); var cx$f = createClassNames('RangeInput'); var RawRangeInput = /*#__PURE__*/ function (_Component) { _inherits(RawRangeInput, _Component); function RawRangeInput(props) { var _this; _classCallCheck(this, RawRangeInput); _this = _possibleConstructorReturn(this, _getPrototypeOf(RawRangeInput).call(this, props)); _defineProperty(_assertThisInitialized(_this), "onSubmit", function (e) { e.preventDefault(); _this.props.refine({ min: _this.state.from, max: _this.state.to }); }); _this.state = _this.normalizeStateForRendering(props); return _this; } _createClass(RawRangeInput, [{ key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (this.props.canRefine && (prevProps.currentRefinement.min !== this.props.currentRefinement.min || prevProps.currentRefinement.max !== this.props.currentRefinement.max)) { this.setState(this.normalizeStateForRendering(this.props)); } } }, { key: "normalizeStateForRendering", value: function normalizeStateForRendering(props) { var canRefine = props.canRefine, rangeMin = props.min, rangeMax = props.max; var _props$currentRefinem = props.currentRefinement, valueMin = _props$currentRefinem.min, valueMax = _props$currentRefinem.max; return { from: canRefine && valueMin !== undefined && valueMin !== rangeMin ? valueMin : '', to: canRefine && valueMax !== undefined && valueMax !== rangeMax ? valueMax : '' }; } }, { key: "normalizeRangeForRendering", value: function normalizeRangeForRendering(_ref) { var canRefine = _ref.canRefine, min = _ref.min, max = _ref.max; var hasMin = min !== undefined; var hasMax = max !== undefined; return { min: canRefine && hasMin && hasMax ? min : '', max: canRefine && hasMin && hasMax ? max : '' }; } }, { key: "render", value: function render() { var _this2 = this; var _this$state = this.state, from = _this$state.from, to = _this$state.to; var _this$props = this.props, precision = _this$props.precision, translate = _this$props.translate, canRefine = _this$props.canRefine, className = _this$props.className; var _this$normalizeRangeF = this.normalizeRangeForRendering(this.props), min = _this$normalizeRangeF.min, max = _this$normalizeRangeF.max; var step = 1 / Math.pow(10, precision); return React__default.createElement("div", { className: classnames(cx$f('', !canRefine && '-noRefinement'), className) }, React__default.createElement("form", { className: cx$f('form'), onSubmit: this.onSubmit }, React__default.createElement("input", { className: cx$f('input', 'input--min'), type: "number", min: min, max: max, value: from, step: step, placeholder: min, disabled: !canRefine, onChange: function onChange(e) { return _this2.setState({ from: e.currentTarget.value }); } }), React__default.createElement("span", { className: cx$f('separator') }, translate('separator')), React__default.createElement("input", { className: cx$f('input', 'input--max'), type: "number", min: min, max: max, value: to, step: step, placeholder: max, disabled: !canRefine, onChange: function onChange(e) { return _this2.setState({ to: e.currentTarget.value }); } }), React__default.createElement("button", { className: cx$f('submit'), type: "submit" }, translate('submit')))); } }]); return RawRangeInput; }(React.Component); _defineProperty(RawRangeInput, "propTypes", { canRefine: propTypes.bool.isRequired, precision: propTypes.number.isRequired, translate: propTypes.func.isRequired, refine: propTypes.func.isRequired, min: propTypes.number, max: propTypes.number, currentRefinement: propTypes.shape({ min: propTypes.number, max: propTypes.number }), className: propTypes.string }); _defineProperty(RawRangeInput, "defaultProps", { currentRefinement: {}, className: '' }); var RangeInput = translatable({ submit: 'ok', separator: 'to' })(RawRangeInput); /** * RangeInput allows a user to select a numeric range using a minimum and maximum input. * @name RangeInput * @kind widget * @requirements The attribute passed to the `attribute` prop must be present in “attributes for faceting” * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * The values inside the attribute must be JavaScript numbers (not strings). * @propType {string} attribute - the name of the attribute in the record * @propType {{min: number, max: number}} [defaultRefinement] - Default state of the widget containing the start and the end of the range. * @propType {number} [min] - Minimum value. When this isn't set, the minimum value will be automatically computed by Algolia using the data in the index. * @propType {number} [max] - Maximum value. When this isn't set, the maximum value will be automatically computed by Algolia using the data in the index. * @propType {number} [precision=0] - Number of digits after decimal point to use. * @themeKey ais-RangeInput - the root div of the widget * @themeKey ais-RangeInput-form - the wrapping form * @themeKey ais-RangeInput-label - the label wrapping inputs * @themeKey ais-RangeInput-input - the input (number) * @themeKey ais-RangeInput-input--min - the minimum input * @themeKey ais-RangeInput-input--max - the maximum input * @themeKey ais-RangeInput-separator - the separator word used between the two inputs * @themeKey ais-RangeInput-button - the submit button * @translationKey submit - Label value for the submit button * @translationKey separator - Label value for the input separator * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, RangeInput } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <RangeInput attribute="price" /> * </InstantSearch> * ); */ var RangeInputWidget = function RangeInputWidget(props) { return React__default.createElement(PanelWrapper, props, React__default.createElement(RangeInput, props)); }; var RangeInput$1 = connectRange(RangeInputWidget); /** * Since a lot of sliders already exist, we did not include one by default. * However you can easily connect React InstantSearch to an existing one * using the [connectRange connector](connectors/connectRange.html). * * @name RangeSlider * @requirements To connect any slider to Algolia, the underlying attribute used must be holding numerical values. * @kind widget * @example * * // Here's an example showing how to connect the AirBnb Rheostat Slider to React InstantSearch * // using the range connector. ⚠️ This example only works with the version 2.x of Rheostat. import React, {Component} from 'react'; import PropTypes from 'prop-types'; import Rheostat from 'rheostat'; import { connectRange } from 'react-instantsearch-dom'; class Range extends React.Component { static propTypes = { min: PropTypes.number, max: PropTypes.number, currentRefinement: PropTypes.object, refine: PropTypes.func.isRequired, canRefine: PropTypes.bool.isRequired }; state = { currentValues: { min: this.props.min, max: this.props.max } }; componentDidUpdate(prevProps) { if ( this.props.canRefine && (prevProps.currentRefinement.min !== this.props.currentRefinement.min || prevProps.currentRefinement.max !== this.props.currentRefinement.max) ) { this.setState({ currentValues: { min: this.props.currentRefinement.min, max: this.props.currentRefinement.max, }, }); } } onValuesUpdated = sliderState => { this.setState({ currentValues: { min: sliderState.values[0], max: sliderState.values[1] } }); }; onChange = sliderState => { if ( this.props.currentRefinement.min !== sliderState.values[0] || this.props.currentRefinement.max !== sliderState.values[1] ) { this.props.refine({ min: sliderState.values[0], max: sliderState.values[1] }); } }; render() { const { min, max, currentRefinement } = this.props; const { currentValues } = this.state; return min !== max ? ( <div> <Rheostat className="ais-RangeSlider" min={min} max={max} values={[currentRefinement.min, currentRefinement.max]} onChange={this.onChange} onValuesUpdated={this.onValuesUpdated} /> <div style={{ display: "flex", justifyContent: "space-between" }}> <div>{currentValues.min}</div> <div>{currentValues.max}</div> </div> </div> ) : null; } } const ConnectedRange = connectRange(Range); */ var RangeSlider = (function () { return React__default.createElement("div", null, "We do not provide any Slider, see the documentation to learn how to connect one easily:", React__default.createElement("a", { target: "_blank", rel: "noopener noreferrer", href: "https://www.algolia.com/doc/api-reference/widgets/range-slider/react/" }, "https://www.algolia.com/doc/api-reference/widgets/range-slider/react/")); }); var cx$g = createClassNames('RatingMenu'); var RatingMenu = /*#__PURE__*/ function (_Component) { _inherits(RatingMenu, _Component); function RatingMenu() { _classCallCheck(this, RatingMenu); return _possibleConstructorReturn(this, _getPrototypeOf(RatingMenu).apply(this, arguments)); } _createClass(RatingMenu, [{ key: "onClick", value: function onClick(min, max, e) { e.preventDefault(); e.stopPropagation(); if (min === this.props.currentRefinement.min && max === this.props.currentRefinement.max) { this.props.refine({ min: this.props.min, max: this.props.max }); } else { this.props.refine({ min: min, max: max }); } } }, { key: "buildItem", value: function buildItem(_ref) { var max = _ref.max, lowerBound = _ref.lowerBound, count = _ref.count, translate = _ref.translate, createURL = _ref.createURL, isLastSelectableItem = _ref.isLastSelectableItem; var disabled = !count; var isCurrentMinLower = this.props.currentRefinement.min < lowerBound; var selected = isLastSelectableItem && isCurrentMinLower || !disabled && lowerBound === this.props.currentRefinement.min && max === this.props.currentRefinement.max; var icons = []; var rating = 0; for (var icon = 0; icon < max; icon++) { if (icon < lowerBound) { rating++; } icons.push([React__default.createElement("svg", { key: icon, className: cx$g('starIcon', icon >= lowerBound ? 'starIcon--empty' : 'starIcon--full'), "aria-hidden": "true", width: "24", height: "24" }, React__default.createElement("use", { xlinkHref: "#".concat(cx$g(icon >= lowerBound ? 'starEmptySymbol' : 'starSymbol')) })), ' ']); } // The last item of the list (the default item), should not // be clickable if it is selected. var isLastAndSelect = isLastSelectableItem && selected; var onClickHandler = disabled || isLastAndSelect ? {} : { href: createURL({ min: lowerBound, max: max }), onClick: this.onClick.bind(this, lowerBound, max) }; return React__default.createElement("li", { key: lowerBound, className: cx$g('item', selected && 'item--selected', disabled && 'item--disabled') }, React__default.createElement("a", _extends({ className: cx$g('link'), "aria-label": "".concat(rating).concat(translate('ratingLabel')) }, onClickHandler), icons, React__default.createElement("span", { className: cx$g('label'), "aria-hidden": "true" }, translate('ratingLabel')), ' ', React__default.createElement("span", { className: cx$g('count') }, count))); } }, { key: "render", value: function render() { var _this = this; var _this$props = this.props, min = _this$props.min, max = _this$props.max, translate = _this$props.translate, count = _this$props.count, createURL = _this$props.createURL, canRefine = _this$props.canRefine, className = _this$props.className; // min & max are always set when there is a results, otherwise it means // that we don't want to render anything since we don't have any values. var limitMin = min !== undefined && min >= 0 ? min : 1; var limitMax = max !== undefined && max >= 0 ? max : 0; var inclusiveLength = limitMax - limitMin + 1; var values = count.map(function (item) { return _objectSpread({}, item, { value: parseFloat(item.value) }); }).filter(function (item) { return item.value >= limitMin && item.value <= limitMax; }); var items = range({ start: 0, end: Math.max(inclusiveLength, 0) }).map(function (index) { var element = find$2(values, function (item) { return item.value === limitMax - index; }); var placeholder = { value: limitMax - index, count: 0, total: 0 }; return element || placeholder; }).reduce(function (acc, item, index) { return acc.concat(_objectSpread({}, item, { total: index === 0 ? item.count : acc[index - 1].total + item.count })); }, []).map(function (item, index, arr) { return _this.buildItem({ lowerBound: item.value, count: item.total, isLastSelectableItem: arr.length - 1 === index, max: limitMax, translate: translate, createURL: createURL }); }); return React__default.createElement("div", { className: classnames(cx$g('', !canRefine && '-noRefinement'), className) }, React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", style: { display: 'none' } }, React__default.createElement("symbol", { id: cx$g('starSymbol'), viewBox: "0 0 24 24" }, React__default.createElement("path", { d: "M12 .288l2.833 8.718h9.167l-7.417 5.389 2.833 8.718-7.416-5.388-7.417 5.388 2.833-8.718-7.416-5.389h9.167z" })), React__default.createElement("symbol", { id: cx$g('starEmptySymbol'), viewBox: "0 0 24 24" }, React__default.createElement("path", { d: "M12 6.76l1.379 4.246h4.465l-3.612 2.625 1.379 4.246-3.611-2.625-3.612 2.625 1.379-4.246-3.612-2.625h4.465l1.38-4.246zm0-6.472l-2.833 8.718h-9.167l7.416 5.389-2.833 8.718 7.417-5.388 7.416 5.388-2.833-8.718 7.417-5.389h-9.167l-2.833-8.718z" }))), React__default.createElement("ul", { className: cx$g('list', !canRefine && 'list--noRefinement') }, items)); } }]); return RatingMenu; }(React.Component); _defineProperty(RatingMenu, "propTypes", { translate: propTypes.func.isRequired, refine: propTypes.func.isRequired, createURL: propTypes.func.isRequired, min: propTypes.number, max: propTypes.number, currentRefinement: propTypes.shape({ min: propTypes.number, max: propTypes.number }), count: propTypes.arrayOf(propTypes.shape({ value: propTypes.string, count: propTypes.number })), canRefine: propTypes.bool.isRequired, className: propTypes.string }); _defineProperty(RatingMenu, "defaultProps", { className: '' }); var RatingMenu$1 = translatable({ ratingLabel: ' & Up' })(RatingMenu); /** * RatingMenu lets the user refine search results by clicking on stars. * * The stars are based on the selected `attribute`. * @requirements The attribute passed to the `attribute` prop must be holding numerical values. * @name RatingMenu * @kind widget * @requirements The attribute passed to the `attribute` prop must be present in “attributes for faceting” * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * The values inside the attribute must be JavaScript numbers (not strings). * @propType {string} attribute - the name of the attribute in the record * @propType {number} [min] - Minimum value for the rating. When this isn't set, the minimum value will be automatically computed by Algolia using the data in the index. * @propType {number} [max] - Maximum value for the rating. When this isn't set, the maximum value will be automatically computed by Algolia using the data in the index. * @propType {{min: number, max: number}} [defaultRefinement] - Default state of the widget containing the lower bound (end) and the max for the rating. * @themeKey ais-RatingMenu - the root div of the widget * @themeKey ais-RatingMenu--noRefinement - the root div of the widget when there is no refinement * @themeKey ais-RatingMenu-list - the list of ratings * @themeKey ais-RatingMenu-list--noRefinement - the list of ratings when there is no refinement * @themeKey ais-RatingMenu-item - the rating list item * @themeKey ais-RatingMenu-item--selected - the selected rating list item * @themeKey ais-RatingMenu-item--disabled - the disabled rating list item * @themeKey ais-RatingMenu-link - the rating clickable item * @themeKey ais-RatingMenu-starIcon - the star icon * @themeKey ais-RatingMenu-starIcon--full - the filled star icon * @themeKey ais-RatingMenu-starIcon--empty - the empty star icon * @themeKey ais-RatingMenu-label - the label used after the stars * @themeKey ais-RatingMenu-count - the count of ratings for a specific item * @translationKey ratingLabel - Label value for the rating link * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, RatingMenu } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <RatingMenu attribute="rating" /> * </InstantSearch> * ); */ var RatingMenuWidget = function RatingMenuWidget(props) { return React__default.createElement(PanelWrapper, props, React__default.createElement(RatingMenu$1, props)); }; var RatingMenu$2 = connectRange(RatingMenuWidget); var cx$h = createClassNames('RefinementList'); var RefinementList$1 = /*#__PURE__*/ function (_Component) { _inherits(RefinementList, _Component); function RefinementList() { var _getPrototypeOf2; var _this; _classCallCheck(this, RefinementList); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(RefinementList)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_this), "state", { query: '' }); _defineProperty(_assertThisInitialized(_this), "selectItem", function (item, resetQuery) { resetQuery(); _this.props.refine(item.value); }); _defineProperty(_assertThisInitialized(_this), "renderItem", function (item, resetQuery) { var label = _this.props.isFromSearch ? React__default.createElement(Highlight$2, { attribute: "label", hit: item }) : item.label; return React__default.createElement("label", { className: cx$h('label') }, React__default.createElement("input", { className: cx$h('checkbox'), type: "checkbox", checked: item.isRefined, onChange: function onChange() { return _this.selectItem(item, resetQuery); } }), React__default.createElement("span", { className: cx$h('labelText') }, label), ' ', React__default.createElement("span", { className: cx$h('count') }, item.count.toLocaleString())); }); return _this; } _createClass(RefinementList, [{ key: "render", value: function render() { var _this$props = this.props, translate = _this$props.translate, items = _this$props.items, showMore = _this$props.showMore, limit = _this$props.limit, showMoreLimit = _this$props.showMoreLimit, isFromSearch = _this$props.isFromSearch, searchForItems = _this$props.searchForItems, searchable = _this$props.searchable, canRefine = _this$props.canRefine, className = _this$props.className; return React__default.createElement(List, { renderItem: this.renderItem, selectItem: this.selectItem, cx: cx$h, translate: translate, items: items, showMore: showMore, limit: limit, showMoreLimit: showMoreLimit, isFromSearch: isFromSearch, searchForItems: searchForItems, searchable: searchable, canRefine: canRefine, className: className, query: this.state.query }); } }]); return RefinementList; }(React.Component); _defineProperty(RefinementList$1, "propTypes", { translate: propTypes.func.isRequired, refine: propTypes.func.isRequired, searchForItems: propTypes.func.isRequired, searchable: propTypes.bool, createURL: propTypes.func.isRequired, items: propTypes.arrayOf(propTypes.shape({ label: propTypes.string.isRequired, value: propTypes.arrayOf(propTypes.string).isRequired, count: propTypes.number.isRequired, isRefined: propTypes.bool.isRequired })), isFromSearch: propTypes.bool.isRequired, canRefine: propTypes.bool.isRequired, showMore: propTypes.bool, limit: propTypes.number, showMoreLimit: propTypes.number, transformItems: propTypes.func, className: propTypes.string }); _defineProperty(RefinementList$1, "defaultProps", { className: '' }); var RefinementList$2 = translatable({ showMore: function showMore(extended) { return extended ? 'Show less' : 'Show more'; }, noResults: 'No results', submit: null, reset: null, resetTitle: 'Clear the search query.', submitTitle: 'Submit your search query.', placeholder: 'Search here…' })(RefinementList$1); /** * The RefinementList component displays a list that let the end user choose multiple values for a specific facet. * @name RefinementList * @kind widget * @propType {string} attribute - the name of the attribute in the record * @propType {boolean} [searchable=false] - true if the component should display an input to search for facet values. <br> In order to make this feature work, you need to make the attribute searchable [using the API](https://www.algolia.com/doc/guides/searching/faceting/?language=js#declaring-a-searchable-attribute-for-faceting) or [the dashboard](https://www.algolia.com/explorer/display/). * @propType {string} [operator=or] - How to apply the refinements. Possible values: 'or' or 'and'. * @propType {boolean} [showMore=false] - true if the component should display a button that will expand the number of items * @propType {number} [limit=10] - the minimum number of displayed items * @propType {number} [showMoreLimit=20] - the maximum number of displayed items. Only used when showMore is set to `true` * @propType {string[]} [defaultRefinement] - the values of the items selected by default * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @themeKey ais-RefinementList - the root div of the widget * @themeKey ais-RefinementList--noRefinement - the root div of the widget when there is no refinement * @themeKey ais-RefinementList-searchBox - the search box of the widget. See [the SearchBox documentation](widgets/SearchBox.html#classnames) for the classnames and translation keys of the SearchBox. * @themeKey ais-RefinementList-list - the list of refinement items * @themeKey ais-RefinementList-item - the refinement list item * @themeKey ais-RefinementList-item--selected - the refinement selected list item * @themeKey ais-RefinementList-label - the label of each refinement item * @themeKey ais-RefinementList-checkbox - the checkbox input of each refinement item * @themeKey ais-RefinementList-labelText - the label text of each refinement item * @themeKey ais-RefinementList-count - the count of values for each item * @themeKey ais-RefinementList-noResults - the div displayed when there are no results * @themeKey ais-RefinementList-showMore - the button used to display more categories * @themeKey ais-RefinementList-showMore--disabled - the disabled button used to display more categories * @translationkey showMore - The label of the show more button. Accepts one parameters, a boolean that is true if the values are expanded * @translationkey noResults - The label of the no results text when no search for facet values results are found. * @requirements The attribute passed to the `attribute` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * * If you are using the `searchable` prop, you'll also need to make the attribute searchable using * the [dashboard](https://www.algolia.com/explorer/display/) or using the [API](https://www.algolia.com/doc/guides/searching/faceting/#search-for-facet-values). * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, RefinementList } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <RefinementList attribute="brand" /> * </InstantSearch> * ); */ var RefinementListWidget = function RefinementListWidget(props) { return React__default.createElement(PanelWrapper, props, React__default.createElement(RefinementList$2, props)); }; var RefinementList$3 = connectRefinementList(RefinementListWidget); var cx$i = createClassNames('ScrollTo'); var ScrollTo = /*#__PURE__*/ function (_Component) { _inherits(ScrollTo, _Component); function ScrollTo() { _classCallCheck(this, ScrollTo); return _possibleConstructorReturn(this, _getPrototypeOf(ScrollTo).apply(this, arguments)); } _createClass(ScrollTo, [{ key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var _this$props = this.props, value = _this$props.value, hasNotChanged = _this$props.hasNotChanged; if (value !== prevProps.value && hasNotChanged) { this.el.scrollIntoView(); } } }, { key: "render", value: function render() { var _this = this; return React__default.createElement("div", { ref: function ref(_ref) { return _this.el = _ref; }, className: cx$i('') }, this.props.children); } }]); return ScrollTo; }(React.Component); _defineProperty(ScrollTo, "propTypes", { value: propTypes.any, children: propTypes.node, hasNotChanged: propTypes.bool }); /** * The ScrollTo component will make the page scroll to the component wrapped by it when one of the * [search state](guide/Search_state.html) prop is updated. By default when the page number changes, * the scroll goes to the wrapped component. * * @name ScrollTo * @kind widget * @propType {string} [scrollOn="page"] - Widget state key on which to listen for changes. * @themeKey ais-ScrollTo - the root div of the widget * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, ScrollTo, Hits } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <ScrollTo> * <Hits /> * </ScrollTo> * </InstantSearch> * ); */ var ScrollTo$1 = connectScrollTo(ScrollTo); /** * The SearchBox component displays a search box that lets the user search for a specific query. * @name SearchBox * @kind widget * @propType {string[]} [focusShortcuts=['s','/']] - List of keyboard shortcuts that focus the search box. Accepts key names and key codes. * @propType {boolean} [autoFocus=false] - Should the search box be focused on render? * @propType {boolean} [searchAsYouType=true] - Should we search on every change to the query? If you disable this option, new searches will only be triggered by clicking the search button or by pressing the enter key while the search box is focused. * @propType {function} [onSubmit] - Intercept submit event sent from the SearchBox form container. * @propType {function} [onReset] - Listen to `reset` event sent from the SearchBox form container. * @propType {function} [on*] - Listen to any events sent from the search input itself. * @propType {node} [submit] - Change the apparence of the default submit button (magnifying glass). * @propType {node} [reset] - Change the apparence of the default reset button (cross). * @propType {node} [loadingIndicator] - Change the apparence of the default loading indicator (spinning circle). * @propType {string} [defaultRefinement] - Provide default refinement value when component is mounted. * @propType {boolean} [showLoadingIndicator=false] - Display that the search is loading. This only happens after a certain amount of time to avoid a blinking effect. This timer can be configured with `stalledSearchDelay` props on <InstantSearch>. By default, the value is 200ms. * @themeKey ais-SearchBox - the root div of the widget * @themeKey ais-SearchBox-form - the wrapping form * @themeKey ais-SearchBox-input - the search input * @themeKey ais-SearchBox-submit - the submit button * @themeKey ais-SearchBox-submitIcon - the default magnifier icon used with the search input * @themeKey ais-SearchBox-reset - the reset button used to clear the content of the input * @themeKey ais-SearchBox-resetIcon - the default reset icon used inside the reset button * @themeKey ais-SearchBox-loadingIndicator - the loading indicator container * @themeKey ais-SearchBox-loadingIcon - the default loading icon * @translationkey submitTitle - The submit button title * @translationkey resetTitle - The reset button title * @translationkey placeholder - The label of the input placeholder * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, SearchBox } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <SearchBox /> * </InstantSearch> * ); */ var SearchBox$2 = connectSearchBox(SearchBox$1); var cx$j = createClassNames('Snippet'); var Snippet = function Snippet(props) { return React__default.createElement(Highlighter, _extends({}, props, { highlightProperty: "_snippetResult", cx: cx$j })); }; /** * Renders any attribute from an hit into its highlighted snippet form when relevant. * * Read more about it in the [Highlighting results](guide/Highlighting_results.html) guide. * @name Snippet * @kind widget * @requirements To use this widget, the attribute name passed to the `attribute` prop must be * present in "Attributes to snippet" on the Algolia dashboard or configured as `attributesToSnippet` * via a set settings call to the Algolia API. * @propType {string} attribute - location of the highlighted snippet attribute in the hit (the corresponding element can be either a string or an array of strings) * @propType {object} hit - hit object containing the highlighted snippet attribute * @propType {string} [tagName='em'] - tag to be used for highlighted parts of the attribute * @propType {string} [nonHighlightedTagName='span'] - tag to be used for the parts of the hit that are not highlighted * @propType {node} [separator=',<space>'] - symbol used to separate the elements of the array in case the attribute points to an array of strings. * @themeKey ais-Snippet - the root span of the widget * @themeKey ais-Snippet-highlighted - the highlighted text * @themeKey ais-Snippet-nonHighlighted - the normal text * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, SearchBox, Hits, Snippet } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const Hit = ({ hit }) => ( * <div> * <Snippet attribute="description" hit={hit} /> * </div> * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <SearchBox defaultRefinement="adjustable" /> * <Hits hitComponent={Hit} /> * </InstantSearch> * ); */ var Snippet$1 = connectHighlight(Snippet); var cx$k = createClassNames('SortBy'); var SortBy = /*#__PURE__*/ function (_Component) { _inherits(SortBy, _Component); function SortBy() { _classCallCheck(this, SortBy); return _possibleConstructorReturn(this, _getPrototypeOf(SortBy).apply(this, arguments)); } _createClass(SortBy, [{ key: "render", value: function render() { var _this$props = this.props, items = _this$props.items, currentRefinement = _this$props.currentRefinement, refine = _this$props.refine, className = _this$props.className; return React__default.createElement("div", { className: classnames(cx$k(''), className) }, React__default.createElement(Select, { cx: cx$k, items: items, selectedItem: currentRefinement, onSelect: refine })); } }]); return SortBy; }(React.Component); _defineProperty(SortBy, "propTypes", { items: propTypes.arrayOf(propTypes.shape({ label: propTypes.string, value: propTypes.string.isRequired })).isRequired, currentRefinement: propTypes.string.isRequired, refine: propTypes.func.isRequired, className: propTypes.string }); _defineProperty(SortBy, "defaultProps", { className: '' }); /** * The SortBy component displays a list of indexes allowing a user to change the hits are sorting. * @name SortBy * @requirements Algolia handles sorting by creating replica indices. [Read more about sorting](https://www.algolia.com/doc/guides/relevance/sorting/) on * the Algolia website. * @kind widget * @propType {{value: string, label: string}[]} items - The list of indexes to search in. * @propType {string} defaultRefinement - The default selected index. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @themeKey ais-SortBy - the root div of the widget * @themeKey ais-SortBy-select - the select * @themeKey ais-SortBy-option - the select option * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, SortBy } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <SortBy * defaultRefinement="instant_search" * items={[ * { value: 'instant_search', label: 'Featured' }, * { value: 'instant_search_price_asc', label: 'Price asc.' }, * { value: 'instant_search_price_desc', label: 'Price desc.' }, * ]} * /> * </InstantSearch> * ); */ var SortBy$1 = connectSortBy(SortBy); var cx$l = createClassNames('Stats'); var Stats = /*#__PURE__*/ function (_Component) { _inherits(Stats, _Component); function Stats() { _classCallCheck(this, Stats); return _possibleConstructorReturn(this, _getPrototypeOf(Stats).apply(this, arguments)); } _createClass(Stats, [{ key: "render", value: function render() { var _this$props = this.props, translate = _this$props.translate, nbHits = _this$props.nbHits, processingTimeMS = _this$props.processingTimeMS, className = _this$props.className; return React__default.createElement("div", { className: classnames(cx$l(''), className) }, React__default.createElement("span", { className: cx$l('text') }, translate('stats', nbHits, processingTimeMS))); } }]); return Stats; }(React.Component); _defineProperty(Stats, "propTypes", { translate: propTypes.func.isRequired, nbHits: propTypes.number.isRequired, processingTimeMS: propTypes.number.isRequired, className: propTypes.string }); _defineProperty(Stats, "defaultProps", { className: '' }); var Stats$1 = translatable({ stats: function stats(n, ms) { return "".concat(n.toLocaleString(), " results found in ").concat(ms.toLocaleString(), "ms"); } })(Stats); /** * The Stats component displays the total number of matching hits and the time it took to get them (time spent in the Algolia server). * @name Stats * @kind widget * @themeKey ais-Stats - the root div of the widget * @themeKey ais-Stats-text - the text of the widget - the count of items for each item * @translationkey stats - The string displayed by the stats widget. You get function(n, ms) and you need to return a string. n is a number of hits retrieved, ms is a processed time. * @example * import React from 'react'; * import { InstantSearch, Stats, Hits } from 'react-instantsearch-dom'; * import algoliasearch from 'algoliasearch/lite'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <Stats /> * <Hits /> * </InstantSearch> * ); */ var Stats$2 = connectStats(Stats$1); var cx$m = createClassNames('ToggleRefinement'); var ToggleRefinement = function ToggleRefinement(_ref) { var currentRefinement = _ref.currentRefinement, label = _ref.label, canRefine = _ref.canRefine, refine = _ref.refine, className = _ref.className; return React__default.createElement("div", { className: classnames(cx$m('', !canRefine && '-noRefinement'), className) }, React__default.createElement("label", { className: cx$m('label') }, React__default.createElement("input", { className: cx$m('checkbox'), type: "checkbox", checked: currentRefinement, onChange: function onChange(event) { return refine(event.target.checked); } }), React__default.createElement("span", { className: cx$m('labelText') }, label))); }; ToggleRefinement.defaultProps = { className: '' }; /** * The ToggleRefinement provides an on/off filtering feature based on an attribute value. * @name ToggleRefinement * @kind widget * @requirements To use this widget, you'll need an attribute to toggle on. * * You can't toggle on null or not-null values. If you want to address this particular use-case you'll need to compute an * extra boolean attribute saying if the value exists or not. See this [thread](https://discourse.algolia.com/t/how-to-create-a-toggle-for-the-absence-of-a-string-attribute/2460) for more details. * * @propType {string} attribute - Name of the attribute on which to apply the `value` refinement. Required when `value` is present. * @propType {string} label - Label for the toggle. * @propType {any} value - Value of the refinement to apply on `attribute` when checked. * @propType {boolean} [defaultRefinement=false] - Default state of the widget. Should the toggle be checked by default? * @themeKey ais-ToggleRefinement - the root div of the widget * @themeKey ais-ToggleRefinement-list - the list of toggles * @themeKey ais-ToggleRefinement-item - the toggle list item * @themeKey ais-ToggleRefinement-label - the label of each toggle item * @themeKey ais-ToggleRefinement-checkbox - the checkbox input of each toggle item * @themeKey ais-ToggleRefinement-labelText - the label text of each toggle item * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, ToggleRefinement } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <ToggleRefinement * attribute="free_shipping" * label="Free Shipping" * value={true} * /> * </InstantSearch> * ); */ var ToggleRefinement$1 = connectToggleRefinement(ToggleRefinement); var ANONYMOUS_TOKEN_COOKIE_KEY = '_ALGOLIA'; function getCookie(name) { var prefix = "".concat(name, "="); var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var cookie = cookies[i]; while (cookie.charAt(0) === ' ') { cookie = cookie.substring(1); } if (cookie.indexOf(prefix) === 0) { return cookie.substring(prefix.length, cookie.length); } } return undefined; } function getInsightsAnonymousUserToken() { return getCookie(ANONYMOUS_TOKEN_COOKIE_KEY); } exports.Breadcrumb = Breadcrumb$2; exports.ClearRefinements = ClearRefinements$2; exports.Configure = Configure; exports.CurrentRefinements = CurrentRefinements$2; exports.ExperimentalConfigureRelatedItems = ConfigureRelatedItems$1; exports.HierarchicalMenu = HierarchicalMenu$2; exports.Highlight = Highlight$2; exports.Hits = Hits$1; exports.HitsPerPage = HitsPerPage$1; exports.Index = IndexWrapper; exports.InfiniteHits = InfiniteHits$2; exports.InstantSearch = InstantSearch; exports.Menu = Menu$2; exports.MenuSelect = MenuSelect$2; exports.NumericMenu = NumericMenu$2; exports.Pagination = Pagination$2; exports.Panel = Panel; exports.PoweredBy = PoweredBy$2; exports.RangeInput = RangeInput$1; exports.RangeSlider = RangeSlider; exports.RatingMenu = RatingMenu$2; exports.RefinementList = RefinementList$3; exports.ScrollTo = ScrollTo$1; exports.SearchBox = SearchBox$2; exports.Snippet = Snippet$1; exports.SortBy = SortBy$1; exports.Stats = Stats$2; exports.ToggleRefinement = ToggleRefinement$1; exports.getInsightsAnonymousUserToken = getInsightsAnonymousUserToken; Object.defineProperty(exports, '__esModule', { value: true }); })); //# sourceMappingURL=Dom.js.map
ajax/libs/primereact/7.1.0/ripple/ripple.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; import { DomHandler } from 'primereact/utils'; import PrimeReact from 'primereact/api'; 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); return Constructor; } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); } 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); } 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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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 _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; } } var Ripple = /*#__PURE__*/function (_Component) { _inherits(Ripple, _Component); var _super = _createSuper(Ripple); function Ripple(props) { var _this; _classCallCheck(this, Ripple); _this = _super.call(this, props); _this.onMouseDown = _this.onMouseDown.bind(_assertThisInitialized(_this)); return _this; } _createClass(Ripple, [{ key: "getTarget", value: function getTarget() { return this.ink && this.ink.parentElement; } }, { key: "bindEvents", value: function bindEvents() { if (this.target) { this.target.addEventListener('mousedown', this.onMouseDown); } } }, { key: "unbindEvents", value: function unbindEvents() { if (this.target) { this.target.removeEventListener('mousedown', this.onMouseDown); } } }, { key: "onMouseDown", value: function onMouseDown(event) { if (!this.ink || getComputedStyle(this.ink, null).display === 'none') { return; } DomHandler.removeClass(this.ink, 'p-ink-active'); if (!DomHandler.getHeight(this.ink) && !DomHandler.getWidth(this.ink)) { var d = Math.max(DomHandler.getOuterWidth(this.target), DomHandler.getOuterHeight(this.target)); this.ink.style.height = d + 'px'; this.ink.style.width = d + 'px'; } var offset = DomHandler.getOffset(this.target); var x = event.pageX - offset.left + document.body.scrollTop - DomHandler.getWidth(this.ink) / 2; var y = event.pageY - offset.top + document.body.scrollLeft - DomHandler.getHeight(this.ink) / 2; this.ink.style.top = y + 'px'; this.ink.style.left = x + 'px'; DomHandler.addClass(this.ink, 'p-ink-active'); } }, { key: "onAnimationEnd", value: function onAnimationEnd(event) { DomHandler.removeClass(event.currentTarget, 'p-ink-active'); } }, { key: "componentDidMount", value: function componentDidMount() { if (this.ink) { this.target = this.getTarget(); this.bindEvents(); } } }, { key: "componentDidUpdate", value: function componentDidUpdate() { if (this.ink && !this.target) { this.target = this.getTarget(); this.bindEvents(); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { if (this.ink) { this.target = null; this.unbindEvents(); } } }, { key: "render", value: function render() { var _this2 = this; return PrimeReact.ripple ? /*#__PURE__*/React.createElement("span", { ref: function ref(el) { return _this2.ink = el; }, className: "p-ink", onAnimationEnd: this.onAnimationEnd }) : null; } }]); return Ripple; }(Component); export { Ripple };
ajax/libs/react-native-web/0.13.0/exports/AppRegistry/renderApplication.js
cdnjs/cdnjs
function _extends() { _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; }; return _extends.apply(this, arguments); } /** * Copyright (c) Nicolas Gallagher. * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ import AppContainer from './AppContainer'; import invariant from 'fbjs/lib/invariant'; import render, { hydrate } from '../render'; import styleResolver from '../StyleSheet/styleResolver'; import React from 'react'; export default function renderApplication(RootComponent, WrapperComponent, callback, options) { var shouldHydrate = options.hydrate, initialProps = options.initialProps, rootTag = options.rootTag; var renderFn = shouldHydrate ? hydrate : render; invariant(rootTag, 'Expect to have a valid rootTag, instead got ', rootTag); renderFn(React.createElement(AppContainer, { rootTag: rootTag, WrapperComponent: WrapperComponent }, React.createElement(RootComponent, initialProps)), rootTag, callback); } export function getApplication(RootComponent, initialProps, WrapperComponent) { var element = React.createElement(AppContainer, { rootTag: {}, WrapperComponent: WrapperComponent }, React.createElement(RootComponent, initialProps)); // Don't escape CSS text var getStyleElement = function getStyleElement(props) { var sheet = styleResolver.getStyleSheet(); return React.createElement("style", _extends({}, props, { dangerouslySetInnerHTML: { __html: sheet.textContent }, id: sheet.id })); }; return { element: element, getStyleElement: getStyleElement }; }
ajax/libs/material-ui/4.9.4/es/InputLabel/InputLabel.js
cdnjs/cdnjs
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import formControlState from '../FormControl/formControlState'; import useFormControl from '../FormControl/useFormControl'; import withStyles from '../styles/withStyles'; import FormLabel from '../FormLabel'; export const styles = theme => ({ /* Styles applied to the root element. */ root: { display: 'block', transformOrigin: 'top left' }, /* Pseudo-class applied to the root element if `focused={true}`. */ focused: {}, /* Pseudo-class applied to the root element if `disabled={true}`. */ disabled: {}, /* Pseudo-class applied to the root element if `error={true}`. */ error: {}, /* Pseudo-class applied to the root element if `required={true}`. */ required: {}, /* Pseudo-class applied to the asterisk element. */ asterisk: {}, /* Styles applied to the root element if the component is a descendant of `FormControl`. */ formControl: { position: 'absolute', left: 0, top: 0, // slight alteration to spec spacing to match visual spec result transform: 'translate(0, 24px) scale(1)' }, /* Styles applied to the root element if `margin="dense"`. */ marginDense: { // Compensation for the `Input.inputDense` style. transform: 'translate(0, 21px) scale(1)' }, /* Styles applied to the `input` element if `shrink={true}`. */ shrink: { transform: 'translate(0, 1.5px) scale(0.75)', transformOrigin: 'top left' }, /* Styles applied to the `input` element if `disableAnimation={false}`. */ animated: { transition: theme.transitions.create(['color', 'transform'], { duration: theme.transitions.duration.shorter, easing: theme.transitions.easing.easeOut }) }, /* Styles applied to the root element if `variant="filled"`. */ filled: { // Chrome's autofill feature gives the input field a yellow background. // Since the input field is behind the label in the HTML tree, // the input field is drawn last and hides the label with an opaque background color. // zIndex: 1 will raise the label above opaque background-colors of input. zIndex: 1, pointerEvents: 'none', transform: 'translate(12px, 20px) scale(1)', '&$marginDense': { transform: 'translate(12px, 17px) scale(1)' }, '&$shrink': { transform: 'translate(12px, 10px) scale(0.75)', '&$marginDense': { transform: 'translate(12px, 7px) scale(0.75)' } } }, /* Styles applied to the root element if `variant="outlined"`. */ outlined: { // see comment above on filled.zIndex zIndex: 1, pointerEvents: 'none', transform: 'translate(14px, 20px) scale(1)', '&$marginDense': { transform: 'translate(14px, 12px) scale(1)' }, '&$shrink': { transform: 'translate(14px, -6px) scale(0.75)' } } }); const InputLabel = React.forwardRef(function InputLabel(props, ref) { const { classes, className, disableAnimation = false, shrink: shrinkProp } = props, other = _objectWithoutPropertiesLoose(props, ["classes", "className", "disableAnimation", "margin", "shrink", "variant"]); const muiFormControl = useFormControl(); let shrink = shrinkProp; if (typeof shrink === 'undefined' && muiFormControl) { shrink = muiFormControl.filled || muiFormControl.focused || muiFormControl.adornedStart; } const fcs = formControlState({ props, muiFormControl, states: ['margin', 'variant'] }); return React.createElement(FormLabel, _extends({ "data-shrink": shrink, className: clsx(classes.root, className, muiFormControl && classes.formControl, !disableAnimation && classes.animated, shrink && classes.shrink, fcs.margin === 'dense' && classes.marginDense, { 'filled': classes.filled, 'outlined': classes.outlined }[fcs.variant]), classes: { focused: classes.focused, disabled: classes.disabled, error: classes.error, required: classes.required, asterisk: classes.asterisk }, ref: ref }, other)); }); process.env.NODE_ENV !== "production" ? InputLabel.propTypes = { /** * The contents of the `InputLabel`. */ children: PropTypes.node, /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * @ignore */ className: PropTypes.string, /** * The color of the component. It supports those theme colors that make sense for this component. */ color: PropTypes.oneOf(['primary', 'secondary']), /** * If `true`, the transition animation is disabled. */ disableAnimation: PropTypes.bool, /** * If `true`, apply disabled class. */ disabled: PropTypes.bool, /** * If `true`, the label will be displayed in an error state. */ error: PropTypes.bool, /** * If `true`, the input of this label is focused. */ focused: PropTypes.bool, /** * If `dense`, will adjust vertical spacing. This is normally obtained via context from * FormControl. */ margin: PropTypes.oneOf(['dense']), /** * if `true`, the label will indicate that the input is required. */ required: PropTypes.bool, /** * If `true`, the label is shrunk. */ shrink: PropTypes.bool, /** * The variant to use. */ variant: PropTypes.oneOf(['standard', 'outlined', 'filled']) } : void 0; export default withStyles(styles, { name: 'MuiInputLabel' })(InputLabel);
ajax/libs/material-ui/4.9.3/esm/test-utils/getClasses.js
cdnjs/cdnjs
import React from 'react'; import createShallow from './createShallow'; var shallow = createShallow(); // Helper function to extract the classes from a styleSheet. export default function getClasses(element) { var useStyles = element.type.useStyles; var classes; function Listener() { classes = useStyles(element.props); return null; } shallow(React.createElement(Listener, null)); return classes; }
ajax/libs/react-native-web/0.11.7/vendor/react-native/VirtualizedList/index.js
cdnjs/cdnjs
function _extends() { _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; }; return _extends.apply(this, arguments); } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, 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; } function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } /** * Copyright (c) 2015-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. * * * @format */ import Batchinator from '../Batchinator'; import FillRateHelper from '../FillRateHelper'; import PropTypes from 'prop-types'; import React from 'react'; import RefreshControl from '../../../exports/RefreshControl'; import ScrollView from '../../../exports/ScrollView'; import StyleSheet from '../../../exports/StyleSheet'; import UIManager from '../../../exports/UIManager'; import View from '../../../exports/View'; import ViewabilityHelper from '../ViewabilityHelper'; import { computeWindowedRenderLimits } from '../VirtualizeUtils'; import findNodeHandle from '../../../exports/findNodeHandle'; import infoLog from '../infoLog'; import invariant from 'fbjs/lib/invariant'; import warning from 'fbjs/lib/warning'; var flattenStyle = StyleSheet.flatten; var __DEV__ = process.env.NODE_ENV !== 'production'; var _usedIndexForKey = false; /** * Base implementation for the more convenient [`<FlatList>`](/react-native/docs/flatlist.html) * and [`<SectionList>`](/react-native/docs/sectionlist.html) components, which are also better * documented. In general, this should only really be used if you need more flexibility than * `FlatList` provides, e.g. for use with immutable data instead of plain arrays. * * Virtualization massively improves memory consumption and performance of large lists by * maintaining a finite render window of active items and replacing all items outside of the render * window with appropriately sized blank space. The window adapts to scrolling behavior, and items * are rendered incrementally with low-pri (after any running interactions) if they are far from the * visible area, or with hi-pri otherwise to minimize the potential of seeing blank space. * * Some caveats: * * - Internal state is not preserved when content scrolls out of the render window. Make sure all * your data is captured in the item data or external stores like Flux, Redux, or Relay. * - This is a `PureComponent` which means that it will not re-render if `props` remain shallow- * equal. Make sure that everything your `renderItem` function depends on is passed as a prop * (e.g. `extraData`) that is not `===` after updates, otherwise your UI may not update on * changes. This includes the `data` prop and parent component state. * - In order to constrain memory and enable smooth scrolling, content is rendered asynchronously * offscreen. This means it's possible to scroll faster than the fill rate ands momentarily see * blank content. This is a tradeoff that can be adjusted to suit the needs of each application, * and we are working on improving it behind the scenes. * - By default, the list looks for a `key` prop on each item and uses that for the React key. * Alternatively, you can provide a custom `keyExtractor` prop. * */ var VirtualizedList = /*#__PURE__*/ function (_React$PureComponent) { _inheritsLoose(VirtualizedList, _React$PureComponent); var _proto = VirtualizedList.prototype; // scrollToEnd may be janky without getItemLayout prop _proto.scrollToEnd = function scrollToEnd(params) { var animated = params ? params.animated : true; var veryLast = this.props.getItemCount(this.props.data) - 1; var frame = this._getFrameMetricsApprox(veryLast); var offset = Math.max(0, frame.offset + frame.length + this._footerLength - this._scrollMetrics.visibleLength); /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment * suppresses an error when upgrading Flow's support for React. To see the * error delete this comment and run Flow. */ this._scrollRef.scrollTo( /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This * comment suppresses an error when upgrading Flow's support for React. * To see the error delete this comment and run Flow. */ this.props.horizontal ? { x: offset, animated: animated } : { y: offset, animated: animated }); } // scrollToIndex may be janky without getItemLayout prop ; _proto.scrollToIndex = function scrollToIndex(params) { var _this$props = this.props, data = _this$props.data, horizontal = _this$props.horizontal, getItemCount = _this$props.getItemCount, getItemLayout = _this$props.getItemLayout, onScrollToIndexFailed = _this$props.onScrollToIndexFailed; var animated = params.animated, index = params.index, viewOffset = params.viewOffset, viewPosition = params.viewPosition; invariant(index >= 0 && index < getItemCount(data), "scrollToIndex out of range: " + index + " vs " + (getItemCount(data) - 1)); if (!getItemLayout && index > this._highestMeasuredFrameIndex) { invariant(!!onScrollToIndexFailed, 'scrollToIndex should be used in conjunction with getItemLayout or onScrollToIndexFailed, ' + 'otherwise there is no way to know the location of offscreen indices or handle failures.'); onScrollToIndexFailed({ averageItemLength: this._averageCellLength, highestMeasuredFrameIndex: this._highestMeasuredFrameIndex, index: index }); return; } var frame = this._getFrameMetricsApprox(index); var offset = Math.max(0, frame.offset - (viewPosition || 0) * (this._scrollMetrics.visibleLength - frame.length)) - (viewOffset || 0); /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment * suppresses an error when upgrading Flow's support for React. To see the * error delete this comment and run Flow. */ this._scrollRef.scrollTo( /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This * comment suppresses an error when upgrading Flow's support for React. * To see the error delete this comment and run Flow. */ horizontal ? { x: offset, animated: animated } : { y: offset, animated: animated }); } // scrollToItem may be janky without getItemLayout prop. Required linear scan through items - // use scrollToIndex instead if possible. ; _proto.scrollToItem = function scrollToItem(params) { var item = params.item; var _this$props2 = this.props, data = _this$props2.data, getItem = _this$props2.getItem, getItemCount = _this$props2.getItemCount; var itemCount = getItemCount(data); for (var _index = 0; _index < itemCount; _index++) { if (getItem(data, _index) === item) { this.scrollToIndex(_objectSpread({}, params, { index: _index })); break; } } } /** * Scroll to a specific content pixel offset in the list. * * Param `offset` expects the offset to scroll to. * In case of `horizontal` is true, the offset is the x-value, * in any other case the offset is the y-value. * * Param `animated` (`true` by default) defines whether the list * should do an animation while scrolling. */ ; _proto.scrollToOffset = function scrollToOffset(params) { var animated = params.animated, offset = params.offset; /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment * suppresses an error when upgrading Flow's support for React. To see the * error delete this comment and run Flow. */ this._scrollRef.scrollTo( /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This * comment suppresses an error when upgrading Flow's support for React. * To see the error delete this comment and run Flow. */ this.props.horizontal ? { x: offset, animated: animated } : { y: offset, animated: animated }); }; _proto.recordInteraction = function recordInteraction() { this._nestedChildLists.forEach(function (childList) { childList.ref && childList.ref.recordInteraction(); }); this._viewabilityTuples.forEach(function (t) { t.viewabilityHelper.recordInteraction(); }); this._updateViewableItems(this.props.data); }; _proto.flashScrollIndicators = function flashScrollIndicators() { /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment * suppresses an error when upgrading Flow's support for React. To see the * error delete this comment and run Flow. */ this._scrollRef.flashScrollIndicators(); } /** * Provides a handle to the underlying scroll responder. * Note that `this._scrollRef` might not be a `ScrollView`, so we * need to check that it responds to `getScrollResponder` before calling it. */ ; _proto.getScrollResponder = function getScrollResponder() { if (this._scrollRef && this._scrollRef.getScrollResponder) { return this._scrollRef.getScrollResponder(); } }; _proto.getScrollableNode = function getScrollableNode() { if (this._scrollRef && this._scrollRef.getScrollableNode) { return this._scrollRef.getScrollableNode(); } else { return findNodeHandle(this._scrollRef); } }; _proto.setNativeProps = function setNativeProps(props) { if (this._scrollRef) { this._scrollRef.setNativeProps(props); } }; _proto.getChildContext = function getChildContext() { return { virtualizedList: { getScrollMetrics: this._getScrollMetrics, horizontal: this.props.horizontal, getOutermostParentListRef: this._getOutermostParentListRef, getNestedChildState: this._getNestedChildState, registerAsNestedChild: this._registerAsNestedChild, unregisterAsNestedChild: this._unregisterAsNestedChild } }; }; _proto._getCellKey = function _getCellKey() { return this.context.virtualizedCell && this.context.virtualizedCell.cellKey || 'rootList'; }; _proto.hasMore = function hasMore() { return this._hasMore; }; function VirtualizedList(_props, context) { var _this; _this = _React$PureComponent.call(this, _props, context) || this; _this._getScrollMetrics = function () { return _this._scrollMetrics; }; _this._getOutermostParentListRef = function () { if (_this._isNestedWithSameOrientation()) { return _this.context.virtualizedList.getOutermostParentListRef(); } else { return _assertThisInitialized(_assertThisInitialized(_this)); } }; _this._getNestedChildState = function (key) { var existingChildData = _this._nestedChildLists.get(key); return existingChildData && existingChildData.state; }; _this._registerAsNestedChild = function (childList) { // Register the mapping between this child key and the cellKey for its cell var childListsInCell = _this._cellKeysToChildListKeys.get(childList.cellKey) || new Set(); childListsInCell.add(childList.key); _this._cellKeysToChildListKeys.set(childList.cellKey, childListsInCell); var existingChildData = _this._nestedChildLists.get(childList.key); invariant(!(existingChildData && existingChildData.ref !== null), 'A VirtualizedList contains a cell which itself contains ' + 'more than one VirtualizedList of the same orientation as the parent ' + 'list. You must pass a unique listKey prop to each sibling list.'); _this._nestedChildLists.set(childList.key, { ref: childList.ref, state: null }); if (_this._hasInteracted) { childList.ref.recordInteraction(); } }; _this._unregisterAsNestedChild = function (childList) { _this._nestedChildLists.set(childList.key, { ref: null, state: childList.state }); }; _this._onUpdateSeparators = function (keys, newProps) { keys.forEach(function (key) { var ref = key != null && _this._cellRefs[key]; ref && ref.updateSeparatorProps(newProps); }); }; _this._averageCellLength = 0; _this._cellKeysToChildListKeys = new Map(); _this._cellRefs = {}; _this._frames = {}; _this._footerLength = 0; _this._hasDataChangedSinceEndReached = true; _this._hasInteracted = false; _this._hasMore = false; _this._hasWarned = {}; _this._highestMeasuredFrameIndex = 0; _this._headerLength = 0; _this._indicesToKeys = new Map(); _this._hasDoneInitialScroll = false; _this._nestedChildLists = new Map(); _this._offsetFromParentVirtualizedList = 0; _this._prevParentOffset = 0; _this._scrollMetrics = { contentLength: 0, dOffset: 0, dt: 10, offset: 0, timestamp: 0, velocity: 0, visibleLength: 0 }; _this._scrollRef = null; _this._sentEndForContentLength = 0; _this._totalCellLength = 0; _this._totalCellsMeasured = 0; _this._viewabilityTuples = []; _this._captureScrollRef = function (ref) { _this._scrollRef = ref; }; _this._defaultRenderScrollComponent = function (props) { if (_this._isNestedWithSameOrientation()) { return React.createElement(View, props); } else if (props.onRefresh) { invariant(typeof props.refreshing === 'boolean', '`refreshing` prop must be set as a boolean in order to use `onRefresh`, but got `' + JSON.stringify(props.refreshing) + '`'); return React.createElement(ScrollView, _extends({}, props, { refreshControl: /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This * comment suppresses an error when upgrading Flow's support for * React. To see the error delete this comment and run Flow. */ React.createElement(RefreshControl, { refreshing: props.refreshing, onRefresh: props.onRefresh, progressViewOffset: props.progressViewOffset }) })); } else { return React.createElement(ScrollView, props); } }; _this._onCellUnmount = function (cellKey) { var curr = _this._frames[cellKey]; if (curr) { _this._frames[cellKey] = _objectSpread({}, curr, { inLayout: false }); } }; _this._onLayout = function (e) { if (_this._isNestedWithSameOrientation()) { // Need to adjust our scroll metrics to be relative to our containing // VirtualizedList before we can make claims about list item viewability _this._measureLayoutRelativeToContainingList(); } else { _this._scrollMetrics.visibleLength = _this._selectLength(e.nativeEvent.layout); } _this.props.onLayout && _this.props.onLayout(e); _this._scheduleCellsToRenderUpdate(); _this._maybeCallOnEndReached(); }; _this._onLayoutEmpty = function (e) { _this.props.onLayout && _this.props.onLayout(e); }; _this._onLayoutFooter = function (e) { _this._footerLength = _this._selectLength(e.nativeEvent.layout); }; _this._onLayoutHeader = function (e) { _this._headerLength = _this._selectLength(e.nativeEvent.layout); }; _this._onContentSizeChange = function (width, height) { if (width > 0 && height > 0 && _this.props.initialScrollIndex != null && _this.props.initialScrollIndex > 0 && !_this._hasDoneInitialScroll) { _this.scrollToIndex({ animated: false, index: _this.props.initialScrollIndex }); _this._hasDoneInitialScroll = true; } if (_this.props.onContentSizeChange) { _this.props.onContentSizeChange(width, height); } _this._scrollMetrics.contentLength = _this._selectLength({ height: height, width: width }); _this._scheduleCellsToRenderUpdate(); _this._maybeCallOnEndReached(); }; _this._convertParentScrollMetrics = function (metrics) { // Offset of the top of the nested list relative to the top of its parent's viewport var offset = metrics.offset - _this._offsetFromParentVirtualizedList; // Child's visible length is the same as its parent's var visibleLength = metrics.visibleLength; var dOffset = offset - _this._scrollMetrics.offset; var contentLength = _this._scrollMetrics.contentLength; return { visibleLength: visibleLength, contentLength: contentLength, offset: offset, dOffset: dOffset }; }; _this._onScroll = function (e) { _this._nestedChildLists.forEach(function (childList) { childList.ref && childList.ref._onScroll(e); }); if (_this.props.onScroll) { _this.props.onScroll(e); } var timestamp = e.timeStamp; var visibleLength = _this._selectLength(e.nativeEvent.layoutMeasurement); var contentLength = _this._selectLength(e.nativeEvent.contentSize); var offset = _this._selectOffset(e.nativeEvent.contentOffset); var dOffset = offset - _this._scrollMetrics.offset; if (_this._isNestedWithSameOrientation()) { if (_this._scrollMetrics.contentLength === 0) { // Ignore scroll events until onLayout has been called and we // know our offset from our offset from our parent return; } var _this$_convertParentS = _this._convertParentScrollMetrics({ visibleLength: visibleLength, offset: offset }); visibleLength = _this$_convertParentS.visibleLength; contentLength = _this$_convertParentS.contentLength; offset = _this$_convertParentS.offset; dOffset = _this$_convertParentS.dOffset; } var dt = _this._scrollMetrics.timestamp ? Math.max(1, timestamp - _this._scrollMetrics.timestamp) : 1; var velocity = dOffset / dt; if (dt > 500 && _this._scrollMetrics.dt > 500 && contentLength > 5 * visibleLength && !_this._hasWarned.perf) { infoLog('VirtualizedList: You have a large list that is slow to update - make sure your ' + 'renderItem function renders components that follow React performance best practices ' + 'like PureComponent, shouldComponentUpdate, etc.', { dt: dt, prevDt: _this._scrollMetrics.dt, contentLength: contentLength }); _this._hasWarned.perf = true; } _this._scrollMetrics = { contentLength: contentLength, dt: dt, dOffset: dOffset, offset: offset, timestamp: timestamp, velocity: velocity, visibleLength: visibleLength }; _this._updateViewableItems(_this.props.data); if (!_this.props) { return; } _this._maybeCallOnEndReached(); if (velocity !== 0) { _this._fillRateHelper.activate(); } _this._computeBlankness(); _this._scheduleCellsToRenderUpdate(); }; _this._onScrollBeginDrag = function (e) { _this._nestedChildLists.forEach(function (childList) { childList.ref && childList.ref._onScrollBeginDrag(e); }); _this._viewabilityTuples.forEach(function (tuple) { tuple.viewabilityHelper.recordInteraction(); }); _this._hasInteracted = true; _this.props.onScrollBeginDrag && _this.props.onScrollBeginDrag(e); }; _this._onScrollEndDrag = function (e) { var velocity = e.nativeEvent.velocity; if (velocity) { _this._scrollMetrics.velocity = _this._selectOffset(velocity); } _this._computeBlankness(); _this.props.onScrollEndDrag && _this.props.onScrollEndDrag(e); }; _this._onMomentumScrollEnd = function (e) { _this._scrollMetrics.velocity = 0; _this._computeBlankness(); _this.props.onMomentumScrollEnd && _this.props.onMomentumScrollEnd(e); }; _this._updateCellsToRender = function () { var _this$props3 = _this.props, data = _this$props3.data, getItemCount = _this$props3.getItemCount, onEndReachedThreshold = _this$props3.onEndReachedThreshold; var isVirtualizationDisabled = _this._isVirtualizationDisabled(); _this._updateViewableItems(data); if (!data) { return; } _this.setState(function (state) { var newState; if (!isVirtualizationDisabled) { // If we run this with bogus data, we'll force-render window {first: 0, last: 0}, // and wipe out the initialNumToRender rendered elements. // So let's wait until the scroll view metrics have been set up. And until then, // we will trust the initialNumToRender suggestion if (_this._scrollMetrics.visibleLength) { // If we have a non-zero initialScrollIndex and run this before we've scrolled, // we'll wipe out the initialNumToRender rendered elements starting at initialScrollIndex. // So let's wait until we've scrolled the view to the right place. And until then, // we will trust the initialScrollIndex suggestion. if (!_this.props.initialScrollIndex || _this._scrollMetrics.offset) { newState = computeWindowedRenderLimits(_this.props, state, _this._getFrameMetricsApprox, _this._scrollMetrics); } } } else { var _this$_scrollMetrics = _this._scrollMetrics, contentLength = _this$_scrollMetrics.contentLength, offset = _this$_scrollMetrics.offset, visibleLength = _this$_scrollMetrics.visibleLength; var distanceFromEnd = contentLength - visibleLength - offset; var renderAhead = /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses * an error found when Flow v0.63 was deployed. To see the error * delete this comment and run Flow. */ distanceFromEnd < onEndReachedThreshold * visibleLength ? _this.props.maxToRenderPerBatch : 0; newState = { first: 0, last: Math.min(state.last + renderAhead, getItemCount(data) - 1) }; } if (newState && _this._nestedChildLists.size > 0) { var newFirst = newState.first; var newLast = newState.last; // If some cell in the new state has a child list in it, we should only render // up through that item, so that we give that list a chance to render. // Otherwise there's churn from multiple child lists mounting and un-mounting // their items. for (var ii = newFirst; ii <= newLast; ii++) { var cellKeyForIndex = _this._indicesToKeys.get(ii); var childListKeys = cellKeyForIndex && _this._cellKeysToChildListKeys.get(cellKeyForIndex); if (!childListKeys) { continue; } var someChildHasMore = false; // For each cell, need to check whether any child list in it has more elements to render for (var _iterator = childListKeys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var childKey = _ref; var childList = _this._nestedChildLists.get(childKey); if (childList && childList.ref && childList.ref.hasMore()) { someChildHasMore = true; break; } } if (someChildHasMore) { newState.last = ii; break; } } } return newState; }); }; _this._createViewToken = function (index, isViewable) { var _this$props4 = _this.props, data = _this$props4.data, getItem = _this$props4.getItem, keyExtractor = _this$props4.keyExtractor; var item = getItem(data, index); return { index: index, item: item, key: keyExtractor(item, index), isViewable: isViewable }; }; _this._getFrameMetricsApprox = function (index) { var frame = _this._getFrameMetrics(index); if (frame && frame.index === index) { // check for invalid frames due to row re-ordering return frame; } else { var getItemLayout = _this.props.getItemLayout; invariant(!getItemLayout, 'Should not have to estimate frames when a measurement metrics function is provided'); return { length: _this._averageCellLength, offset: _this._averageCellLength * index }; } }; _this._getFrameMetrics = function (index) { var _this$props5 = _this.props, data = _this$props5.data, getItem = _this$props5.getItem, getItemCount = _this$props5.getItemCount, getItemLayout = _this$props5.getItemLayout, keyExtractor = _this$props5.keyExtractor; invariant(getItemCount(data) > index, 'Tried to get frame for out of range index ' + index); var item = getItem(data, index); var frame = item && _this._frames[keyExtractor(item, index)]; if (!frame || frame.index !== index) { if (getItemLayout) { frame = getItemLayout(data, index); if (__DEV__) { var frameType = PropTypes.shape({ length: PropTypes.number.isRequired, offset: PropTypes.number.isRequired, index: PropTypes.number.isRequired }).isRequired; PropTypes.checkPropTypes({ frame: frameType }, { frame: frame }, 'frame', 'VirtualizedList.getItemLayout'); } } } /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an * error found when Flow v0.63 was deployed. To see the error delete this * comment and run Flow. */ return frame; }; invariant(!_props.onScroll || !_props.onScroll.__isNative, 'Components based on VirtualizedList must be wrapped with Animated.createAnimatedComponent ' + 'to support native onScroll events with useNativeDriver'); invariant(_props.windowSize > 0, 'VirtualizedList: The windowSize prop must be present and set to a value greater than 0.'); _this._fillRateHelper = new FillRateHelper(_this._getFrameMetrics); _this._updateCellsToRenderBatcher = new Batchinator(_this._updateCellsToRender, _this.props.updateCellsBatchingPeriod); if (_this.props.viewabilityConfigCallbackPairs) { _this._viewabilityTuples = _this.props.viewabilityConfigCallbackPairs.map(function (pair) { return { viewabilityHelper: new ViewabilityHelper(pair.viewabilityConfig), onViewableItemsChanged: pair.onViewableItemsChanged }; }); } else if (_this.props.onViewableItemsChanged) { _this._viewabilityTuples.push({ viewabilityHelper: new ViewabilityHelper(_this.props.viewabilityConfig), onViewableItemsChanged: _this.props.onViewableItemsChanged }); } var initialState = { first: _this.props.initialScrollIndex || 0, last: Math.min(_this.props.getItemCount(_this.props.data), (_this.props.initialScrollIndex || 0) + _this.props.initialNumToRender) - 1 }; if (_this._isNestedWithSameOrientation()) { var storedState = _this.context.virtualizedList.getNestedChildState(_this.props.listKey || _this._getCellKey()); if (storedState) { initialState = storedState; _this.state = storedState; _this._frames = storedState.frames; } } _this.state = initialState; return _this; } _proto.componentDidMount = function componentDidMount() { if (this._isNestedWithSameOrientation()) { this.context.virtualizedList.registerAsNestedChild({ cellKey: this._getCellKey(), key: this.props.listKey || this._getCellKey(), ref: this }); } }; _proto.componentWillUnmount = function componentWillUnmount() { if (this._isNestedWithSameOrientation()) { this.context.virtualizedList.unregisterAsNestedChild({ key: this.props.listKey || this._getCellKey(), state: { first: this.state.first, last: this.state.last, frames: this._frames } }); } this._updateViewableItems(null); this._updateCellsToRenderBatcher.dispose({ abort: true }); this._viewabilityTuples.forEach(function (tuple) { tuple.viewabilityHelper.dispose(); }); this._fillRateHelper.deactivateAndFlush(); }; VirtualizedList.getDerivedStateFromProps = function getDerivedStateFromProps(newProps, prevState) { var data = newProps.data, extraData = newProps.extraData, getItemCount = newProps.getItemCount, maxToRenderPerBatch = newProps.maxToRenderPerBatch; // first and last could be stale (e.g. if a new, shorter items props is passed in), so we make // sure we're rendering a reasonable range here. return { first: Math.max(0, Math.min(prevState.first, getItemCount(data) - 1 - maxToRenderPerBatch)), last: Math.max(0, Math.min(prevState.last, getItemCount(data) - 1)) }; }; _proto._pushCells = function _pushCells(cells, stickyHeaderIndices, stickyIndicesFromProps, first, last, inversionStyle) { var _this2 = this; var _this$props6 = this.props, CellRendererComponent = _this$props6.CellRendererComponent, ItemSeparatorComponent = _this$props6.ItemSeparatorComponent, data = _this$props6.data, getItem = _this$props6.getItem, getItemCount = _this$props6.getItemCount, horizontal = _this$props6.horizontal, keyExtractor = _this$props6.keyExtractor; var stickyOffset = this.props.ListHeaderComponent ? 1 : 0; var end = getItemCount(data) - 1; var prevCellKey; last = Math.min(end, last); var _loop = function _loop(ii) { var item = getItem(data, ii); var key = keyExtractor(item, ii); _this2._indicesToKeys.set(ii, key); if (stickyIndicesFromProps.has(ii + stickyOffset)) { stickyHeaderIndices.push(cells.length); } cells.push(React.createElement(CellRenderer, { CellRendererComponent: CellRendererComponent, ItemSeparatorComponent: ii < end ? ItemSeparatorComponent : undefined, cellKey: key, fillRateHelper: _this2._fillRateHelper, horizontal: horizontal, index: ii, inversionStyle: inversionStyle, item: item, key: key, prevCellKey: prevCellKey, onUpdateSeparators: _this2._onUpdateSeparators, onLayout: function onLayout(e) { return _this2._onCellLayout(e, key, ii); }, onUnmount: _this2._onCellUnmount, parentProps: _this2.props, ref: function ref(_ref2) { _this2._cellRefs[key] = _ref2; } })); prevCellKey = key; }; for (var ii = first; ii <= last; ii++) { _loop(ii); } }; _proto._isVirtualizationDisabled = function _isVirtualizationDisabled() { return this.props.disableVirtualization; }; _proto._isNestedWithSameOrientation = function _isNestedWithSameOrientation() { var nestedContext = this.context.virtualizedList; return !!(nestedContext && !!nestedContext.horizontal === !!this.props.horizontal); }; _proto.render = function render() { if (__DEV__) { var flatStyles = flattenStyle(this.props.contentContainerStyle); warning(flatStyles == null || flatStyles.flexWrap !== 'wrap', '`flexWrap: `wrap`` is not supported with the `VirtualizedList` components.' + 'Consider using `numColumns` with `FlatList` instead.'); } var _this$props7 = this.props, ListEmptyComponent = _this$props7.ListEmptyComponent, ListFooterComponent = _this$props7.ListFooterComponent, ListHeaderComponent = _this$props7.ListHeaderComponent; var _this$props8 = this.props, data = _this$props8.data, horizontal = _this$props8.horizontal; var isVirtualizationDisabled = this._isVirtualizationDisabled(); var inversionStyle = this.props.inverted ? this.props.horizontal ? styles.horizontallyInverted : styles.verticallyInverted : null; var cells = []; var stickyIndicesFromProps = new Set(this.props.stickyHeaderIndices); var stickyHeaderIndices = []; if (ListHeaderComponent) { if (stickyIndicesFromProps.has(0)) { stickyHeaderIndices.push(0); } var element = React.isValidElement(ListHeaderComponent) ? ListHeaderComponent : // $FlowFixMe React.createElement(ListHeaderComponent, null); cells.push(React.createElement(VirtualizedCellWrapper, { cellKey: this._getCellKey() + '-header', key: "$header" }, React.createElement(View, { onLayout: this._onLayoutHeader, style: inversionStyle }, element))); } var itemCount = this.props.getItemCount(data); if (itemCount > 0) { _usedIndexForKey = false; var spacerKey = !horizontal ? 'height' : 'width'; var lastInitialIndex = this.props.initialScrollIndex ? -1 : this.props.initialNumToRender - 1; var _this$state = this.state, first = _this$state.first, last = _this$state.last; this._pushCells(cells, stickyHeaderIndices, stickyIndicesFromProps, 0, lastInitialIndex, inversionStyle); var firstAfterInitial = Math.max(lastInitialIndex + 1, first); if (!isVirtualizationDisabled && first > lastInitialIndex + 1) { var insertedStickySpacer = false; if (stickyIndicesFromProps.size > 0) { var stickyOffset = ListHeaderComponent ? 1 : 0; // See if there are any sticky headers in the virtualized space that we need to render. for (var ii = firstAfterInitial - 1; ii > lastInitialIndex; ii--) { if (stickyIndicesFromProps.has(ii + stickyOffset)) { var _ref3, _ref4; var initBlock = this._getFrameMetricsApprox(lastInitialIndex); var stickyBlock = this._getFrameMetricsApprox(ii); var leadSpace = stickyBlock.offset - (initBlock.offset + initBlock.length); cells.push(React.createElement(View, { key: "$sticky_lead", style: (_ref3 = {}, _ref3[spacerKey] = leadSpace, _ref3) })); this._pushCells(cells, stickyHeaderIndices, stickyIndicesFromProps, ii, ii, inversionStyle); var trailSpace = this._getFrameMetricsApprox(first).offset - (stickyBlock.offset + stickyBlock.length); cells.push(React.createElement(View, { key: "$sticky_trail", style: (_ref4 = {}, _ref4[spacerKey] = trailSpace, _ref4) })); insertedStickySpacer = true; break; } } } if (!insertedStickySpacer) { var _ref5; var _initBlock = this._getFrameMetricsApprox(lastInitialIndex); var firstSpace = this._getFrameMetricsApprox(first).offset - (_initBlock.offset + _initBlock.length); cells.push(React.createElement(View, { key: "$lead_spacer", style: (_ref5 = {}, _ref5[spacerKey] = firstSpace, _ref5) })); } } this._pushCells(cells, stickyHeaderIndices, stickyIndicesFromProps, firstAfterInitial, last, inversionStyle); if (!this._hasWarned.keys && _usedIndexForKey) { console.warn('VirtualizedList: missing keys for items, make sure to specify a key property on each ' + 'item or provide a custom keyExtractor.'); this._hasWarned.keys = true; } if (!isVirtualizationDisabled && last < itemCount - 1) { var _ref6; var lastFrame = this._getFrameMetricsApprox(last); // Without getItemLayout, we limit our tail spacer to the _highestMeasuredFrameIndex to // prevent the user for hyperscrolling into un-measured area because otherwise content will // likely jump around as it renders in above the viewport. var end = this.props.getItemLayout ? itemCount - 1 : Math.min(itemCount - 1, this._highestMeasuredFrameIndex); var endFrame = this._getFrameMetricsApprox(end); var tailSpacerLength = endFrame.offset + endFrame.length - (lastFrame.offset + lastFrame.length); cells.push(React.createElement(View, { key: "$tail_spacer", style: (_ref6 = {}, _ref6[spacerKey] = tailSpacerLength, _ref6) })); } } else if (ListEmptyComponent) { var _element = React.isValidElement(ListEmptyComponent) ? ListEmptyComponent : // $FlowFixMe React.createElement(ListEmptyComponent, null); cells.push(React.createElement(View, { key: "$empty", onLayout: this._onLayoutEmpty, style: inversionStyle }, _element)); } if (ListFooterComponent) { var _element2 = React.isValidElement(ListFooterComponent) ? ListFooterComponent : // $FlowFixMe React.createElement(ListFooterComponent, null); cells.push(React.createElement(VirtualizedCellWrapper, { cellKey: this._getCellKey() + '-footer', key: "$footer" }, React.createElement(View, { onLayout: this._onLayoutFooter, style: inversionStyle }, _element2))); } var scrollProps = _objectSpread({}, this.props, { onContentSizeChange: this._onContentSizeChange, onLayout: this._onLayout, onScroll: this._onScroll, onScrollBeginDrag: this._onScrollBeginDrag, onScrollEndDrag: this._onScrollEndDrag, onMomentumScrollEnd: this._onMomentumScrollEnd, scrollEventThrottle: this.props.scrollEventThrottle, // TODO: Android support invertStickyHeaders: this.props.invertStickyHeaders !== undefined ? this.props.invertStickyHeaders : this.props.inverted, stickyHeaderIndices: stickyHeaderIndices }); if (inversionStyle) { scrollProps.style = [inversionStyle, this.props.style]; } this._hasMore = this.state.last < this.props.getItemCount(this.props.data) - 1; var ret = React.cloneElement((this.props.renderScrollComponent || this._defaultRenderScrollComponent)(scrollProps), { ref: this._captureScrollRef }, cells); if (this.props.debug) { return React.createElement(View, { style: { flex: 1 } }, ret, this._renderDebugOverlay()); } else { return ret; } }; _proto.componentDidUpdate = function componentDidUpdate(prevProps) { var _this$props9 = this.props, data = _this$props9.data, extraData = _this$props9.extraData; if (data !== prevProps.data || extraData !== prevProps.extraData) { this._hasDataChangedSinceEndReached = true; // clear the viewableIndices cache to also trigger // the onViewableItemsChanged callback with the new data this._viewabilityTuples.forEach(function (tuple) { tuple.viewabilityHelper.resetViewableIndices(); }); } this._scheduleCellsToRenderUpdate(); }; _proto._computeBlankness = function _computeBlankness() { this._fillRateHelper.computeBlankness(this.props, this.state, this._scrollMetrics); }; _proto._onCellLayout = function _onCellLayout(e, cellKey, index) { var layout = e.nativeEvent.layout; var next = { offset: this._selectOffset(layout), length: this._selectLength(layout), index: index, inLayout: true }; var curr = this._frames[cellKey]; if (!curr || next.offset !== curr.offset || next.length !== curr.length || index !== curr.index) { this._totalCellLength += next.length - (curr ? curr.length : 0); this._totalCellsMeasured += curr ? 0 : 1; this._averageCellLength = this._totalCellLength / this._totalCellsMeasured; this._frames[cellKey] = next; this._highestMeasuredFrameIndex = Math.max(this._highestMeasuredFrameIndex, index); this._scheduleCellsToRenderUpdate(); } else { this._frames[cellKey].inLayout = true; } this._computeBlankness(); }; _proto._measureLayoutRelativeToContainingList = function _measureLayoutRelativeToContainingList() { var _this3 = this; UIManager.measureLayout(findNodeHandle(this), findNodeHandle(this.context.virtualizedList.getOutermostParentListRef()), function (error) { console.warn("VirtualizedList: Encountered an error while measuring a list's" + ' offset from its containing VirtualizedList.'); }, function (x, y, width, height) { _this3._offsetFromParentVirtualizedList = _this3._selectOffset({ x: x, y: y }); _this3._scrollMetrics.contentLength = _this3._selectLength({ width: width, height: height }); var scrollMetrics = _this3._convertParentScrollMetrics(_this3.context.virtualizedList.getScrollMetrics()); _this3._scrollMetrics.visibleLength = scrollMetrics.visibleLength; _this3._scrollMetrics.offset = scrollMetrics.offset; }); }; _proto._renderDebugOverlay = function _renderDebugOverlay() { var normalize = this._scrollMetrics.visibleLength / this._scrollMetrics.contentLength; var framesInLayout = []; var itemCount = this.props.getItemCount(this.props.data); for (var ii = 0; ii < itemCount; ii++) { var frame = this._getFrameMetricsApprox(ii); if (frame.inLayout) { framesInLayout.push(frame); } } var windowTop = this._getFrameMetricsApprox(this.state.first).offset; var frameLast = this._getFrameMetricsApprox(this.state.last); var windowLen = frameLast.offset + frameLast.length - windowTop; var visTop = this._scrollMetrics.offset; var visLen = this._scrollMetrics.visibleLength; var baseStyle = { position: 'absolute', top: 0, right: 0 }; return React.createElement(View, { style: _objectSpread({}, baseStyle, { bottom: 0, width: 20, borderColor: 'blue', borderWidth: 1 }) }, framesInLayout.map(function (f, ii) { return React.createElement(View, { key: 'f' + ii, style: _objectSpread({}, baseStyle, { left: 0, top: f.offset * normalize, height: f.length * normalize, backgroundColor: 'orange' }) }); }), React.createElement(View, { style: _objectSpread({}, baseStyle, { left: 0, top: windowTop * normalize, height: windowLen * normalize, borderColor: 'green', borderWidth: 2 }) }), React.createElement(View, { style: _objectSpread({}, baseStyle, { left: 0, top: visTop * normalize, height: visLen * normalize, borderColor: 'red', borderWidth: 2 }) })); }; _proto._selectLength = function _selectLength(metrics) { return !this.props.horizontal ? metrics.height : metrics.width; }; _proto._selectOffset = function _selectOffset(metrics) { return !this.props.horizontal ? metrics.y : metrics.x; }; _proto._maybeCallOnEndReached = function _maybeCallOnEndReached() { var _this$props10 = this.props, data = _this$props10.data, getItemCount = _this$props10.getItemCount, onEndReached = _this$props10.onEndReached, onEndReachedThreshold = _this$props10.onEndReachedThreshold; var _this$_scrollMetrics2 = this._scrollMetrics, contentLength = _this$_scrollMetrics2.contentLength, visibleLength = _this$_scrollMetrics2.visibleLength, offset = _this$_scrollMetrics2.offset; var distanceFromEnd = contentLength - visibleLength - offset; if (onEndReached && this.state.last === getItemCount(data) - 1 && /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an * error found when Flow v0.63 was deployed. To see the error delete this * comment and run Flow. */ distanceFromEnd < onEndReachedThreshold * visibleLength && (this._hasDataChangedSinceEndReached || this._scrollMetrics.contentLength !== this._sentEndForContentLength)) { // Only call onEndReached once for a given dataset + content length. this._hasDataChangedSinceEndReached = false; this._sentEndForContentLength = this._scrollMetrics.contentLength; onEndReached({ distanceFromEnd: distanceFromEnd }); } }; _proto._scheduleCellsToRenderUpdate = function _scheduleCellsToRenderUpdate() { var _this$state2 = this.state, first = _this$state2.first, last = _this$state2.last; var _this$_scrollMetrics3 = this._scrollMetrics, offset = _this$_scrollMetrics3.offset, visibleLength = _this$_scrollMetrics3.visibleLength, velocity = _this$_scrollMetrics3.velocity; var itemCount = this.props.getItemCount(this.props.data); var hiPri = false; if (first > 0 || last < itemCount - 1) { var distTop = offset - this._getFrameMetricsApprox(first).offset; var distBottom = this._getFrameMetricsApprox(last).offset - (offset + visibleLength); var scrollingThreshold = /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an * error found when Flow v0.63 was deployed. To see the error delete * this comment and run Flow. */ this.props.onEndReachedThreshold * visibleLength / 2; hiPri = Math.min(distTop, distBottom) < 0 || velocity < -2 && distTop < scrollingThreshold || velocity > 2 && distBottom < scrollingThreshold; } // Only trigger high-priority updates if we've actually rendered cells, // and with that size estimate, accurately compute how many cells we should render. // Otherwise, it would just render as many cells as it can (of zero dimension), // each time through attempting to render more (limited by maxToRenderPerBatch), // starving the renderer from actually laying out the objects and computing _averageCellLength. if (hiPri && this._averageCellLength) { // Don't worry about interactions when scrolling quickly; focus on filling content as fast // as possible. this._updateCellsToRenderBatcher.dispose({ abort: true }); this._updateCellsToRender(); return; } else { this._updateCellsToRenderBatcher.schedule(); } }; _proto._updateViewableItems = function _updateViewableItems(data) { var _this4 = this; var getItemCount = this.props.getItemCount; this._viewabilityTuples.forEach(function (tuple) { tuple.viewabilityHelper.onUpdate(getItemCount(data), _this4._scrollMetrics.offset, _this4._scrollMetrics.visibleLength, _this4._getFrameMetrics, _this4._createViewToken, tuple.onViewableItemsChanged, _this4.state); }); }; return VirtualizedList; }(React.PureComponent); VirtualizedList.defaultProps = { disableVirtualization: process.env.NODE_ENV === 'test', horizontal: false, initialNumToRender: 10, keyExtractor: function keyExtractor(item, index) { if (item.key != null) { return item.key; } _usedIndexForKey = true; return String(index); }, maxToRenderPerBatch: 10, onEndReachedThreshold: 2, // multiples of length scrollEventThrottle: 50, updateCellsBatchingPeriod: 50, windowSize: 21 // multiples of length }; VirtualizedList.contextTypes = { virtualizedCell: PropTypes.shape({ cellKey: PropTypes.string }), virtualizedList: PropTypes.shape({ getScrollMetrics: PropTypes.func, horizontal: PropTypes.bool, getOutermostParentListRef: PropTypes.func, getNestedChildState: PropTypes.func, registerAsNestedChild: PropTypes.func, unregisterAsNestedChild: PropTypes.func }) }; VirtualizedList.childContextTypes = { virtualizedList: PropTypes.shape({ getScrollMetrics: PropTypes.func, horizontal: PropTypes.bool, getOutermostParentListRef: PropTypes.func, getNestedChildState: PropTypes.func, registerAsNestedChild: PropTypes.func, unregisterAsNestedChild: PropTypes.func }) }; var CellRenderer = /*#__PURE__*/ function (_React$Component) { _inheritsLoose(CellRenderer, _React$Component); function CellRenderer() { var _this5; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this5 = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; _this5.state = { separatorProps: { highlighted: false, leadingItem: _this5.props.item } }; _this5._separators = { highlight: function highlight() { var _this5$props = _this5.props, cellKey = _this5$props.cellKey, prevCellKey = _this5$props.prevCellKey; _this5.props.onUpdateSeparators([cellKey, prevCellKey], { highlighted: true }); }, unhighlight: function unhighlight() { var _this5$props2 = _this5.props, cellKey = _this5$props2.cellKey, prevCellKey = _this5$props2.prevCellKey; _this5.props.onUpdateSeparators([cellKey, prevCellKey], { highlighted: false }); }, updateProps: function updateProps(select, newProps) { var _this5$props3 = _this5.props, cellKey = _this5$props3.cellKey, prevCellKey = _this5$props3.prevCellKey; _this5.props.onUpdateSeparators([select === 'leading' ? prevCellKey : cellKey], newProps); } }; return _this5; } var _proto2 = CellRenderer.prototype; _proto2.getChildContext = function getChildContext() { return { virtualizedCell: { cellKey: this.props.cellKey } }; } // TODO: consider factoring separator stuff out of VirtualizedList into FlatList since it's not // reused by SectionList and we can keep VirtualizedList simpler. ; _proto2.updateSeparatorProps = function updateSeparatorProps(newProps) { this.setState(function (state) { return { separatorProps: _objectSpread({}, state.separatorProps, newProps) }; }); }; _proto2.componentWillUnmount = function componentWillUnmount() { this.props.onUnmount(this.props.cellKey); }; _proto2.render = function render() { var _this$props11 = this.props, CellRendererComponent = _this$props11.CellRendererComponent, ItemSeparatorComponent = _this$props11.ItemSeparatorComponent, fillRateHelper = _this$props11.fillRateHelper, horizontal = _this$props11.horizontal, item = _this$props11.item, index = _this$props11.index, inversionStyle = _this$props11.inversionStyle, parentProps = _this$props11.parentProps; var renderItem = parentProps.renderItem, getItemLayout = parentProps.getItemLayout; invariant(renderItem, 'no renderItem!'); var element = renderItem({ item: item, index: index, separators: this._separators }); var onLayout = getItemLayout && !parentProps.debug && !fillRateHelper.enabled() ? undefined : this.props.onLayout; // NOTE: that when this is a sticky header, `onLayout` will get automatically extracted and // called explicitly by `ScrollViewStickyHeader`. var itemSeparator = ItemSeparatorComponent && React.createElement(ItemSeparatorComponent, this.state.separatorProps); var cellStyle = inversionStyle ? horizontal ? [styles.rowReverse, inversionStyle] : [styles.columnReverse, inversionStyle] : horizontal ? [styles.row, inversionStyle] : inversionStyle; if (!CellRendererComponent) { return React.createElement(View, { style: cellStyle, onLayout: onLayout }, element, itemSeparator); } return React.createElement(CellRendererComponent, _extends({}, this.props, { style: cellStyle, onLayout: onLayout }), element, itemSeparator); }; return CellRenderer; }(React.Component); CellRenderer.childContextTypes = { virtualizedCell: PropTypes.shape({ cellKey: PropTypes.string }) }; var VirtualizedCellWrapper = /*#__PURE__*/ function (_React$Component2) { _inheritsLoose(VirtualizedCellWrapper, _React$Component2); function VirtualizedCellWrapper() { return _React$Component2.apply(this, arguments) || this; } var _proto3 = VirtualizedCellWrapper.prototype; _proto3.getChildContext = function getChildContext() { return { virtualizedCell: { cellKey: this.props.cellKey } }; }; _proto3.render = function render() { return this.props.children; }; return VirtualizedCellWrapper; }(React.Component); VirtualizedCellWrapper.childContextTypes = { virtualizedCell: PropTypes.shape({ cellKey: PropTypes.string }) }; var styles = StyleSheet.create({ verticallyInverted: { transform: [{ scaleY: -1 }] }, horizontallyInverted: { transform: [{ scaleX: -1 }] }, row: { flexDirection: 'row' }, rowReverse: { flexDirection: 'row-reverse' }, columnReverse: { flexDirection: 'column-reverse' } }); export default VirtualizedList;
ajax/libs/material-ui/4.9.2/esm/ButtonBase/ButtonBase.js
cdnjs/cdnjs
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; import React from 'react'; import PropTypes from 'prop-types'; import ReactDOM from 'react-dom'; import clsx from 'clsx'; import { elementTypeAcceptingRef, refType } from '@material-ui/utils'; import useForkRef from '../utils/useForkRef'; import useEventCallback from '../utils/useEventCallback'; import withStyles from '../styles/withStyles'; import NoSsr from '../NoSsr'; import { useIsFocusVisible } from '../utils/focusVisible'; import TouchRipple from './TouchRipple'; export var styles = { /* Styles applied to the root element. */ root: { display: 'inline-flex', alignItems: 'center', justifyContent: 'center', position: 'relative', WebkitTapHighlightColor: 'transparent', backgroundColor: 'transparent', // Reset default value // We disable the focus ring for mouse, touch and keyboard users. outline: 0, border: 0, margin: 0, // Remove the margin in Safari borderRadius: 0, padding: 0, // Remove the padding in Firefox cursor: 'pointer', userSelect: 'none', verticalAlign: 'middle', '-moz-appearance': 'none', // Reset '-webkit-appearance': 'none', // Reset textDecoration: 'none', // So we take precedent over the style of a native <a /> element. color: 'inherit', '&::-moz-focus-inner': { borderStyle: 'none' // Remove Firefox dotted outline. }, '&$disabled': { pointerEvents: 'none', // Disable link interactions cursor: 'default' } }, /* Pseudo-class applied to the root element if `disabled={true}`. */ disabled: {}, /* Pseudo-class applied to the root element if keyboard focused. */ focusVisible: {} }; /** * `ButtonBase` contains as few styles as possible. * It aims to be a simple building block for creating a button. * It contains a load of style reset and some focus/ripple logic. */ var ButtonBase = React.forwardRef(function ButtonBase(props, ref) { var action = props.action, buttonRefProp = props.buttonRef, _props$centerRipple = props.centerRipple, centerRipple = _props$centerRipple === void 0 ? false : _props$centerRipple, children = props.children, classes = props.classes, className = props.className, _props$component = props.component, component = _props$component === void 0 ? 'button' : _props$component, _props$disabled = props.disabled, disabled = _props$disabled === void 0 ? false : _props$disabled, _props$disableRipple = props.disableRipple, disableRipple = _props$disableRipple === void 0 ? false : _props$disableRipple, _props$disableTouchRi = props.disableTouchRipple, disableTouchRipple = _props$disableTouchRi === void 0 ? false : _props$disableTouchRi, _props$focusRipple = props.focusRipple, focusRipple = _props$focusRipple === void 0 ? false : _props$focusRipple, focusVisibleClassName = props.focusVisibleClassName, onBlur = props.onBlur, onClick = props.onClick, onFocus = props.onFocus, onFocusVisible = props.onFocusVisible, onKeyDown = props.onKeyDown, onKeyUp = props.onKeyUp, onMouseDown = props.onMouseDown, onMouseLeave = props.onMouseLeave, onMouseUp = props.onMouseUp, onTouchEnd = props.onTouchEnd, onTouchMove = props.onTouchMove, onTouchStart = props.onTouchStart, onDragLeave = props.onDragLeave, _props$tabIndex = props.tabIndex, tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex, TouchRippleProps = props.TouchRippleProps, _props$type = props.type, type = _props$type === void 0 ? 'button' : _props$type, other = _objectWithoutProperties(props, ["action", "buttonRef", "centerRipple", "children", "classes", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "onBlur", "onClick", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "onDragLeave", "tabIndex", "TouchRippleProps", "type"]); var buttonRef = React.useRef(null); function getButtonNode() { // #StrictMode ready return ReactDOM.findDOMNode(buttonRef.current); } var rippleRef = React.useRef(null); var _React$useState = React.useState(false), focusVisible = _React$useState[0], setFocusVisible = _React$useState[1]; if (disabled && focusVisible) { setFocusVisible(false); } var _useIsFocusVisible = useIsFocusVisible(), isFocusVisible = _useIsFocusVisible.isFocusVisible, onBlurVisible = _useIsFocusVisible.onBlurVisible, focusVisibleRef = _useIsFocusVisible.ref; React.useImperativeHandle(action, function () { return { focusVisible: function focusVisible() { setFocusVisible(true); buttonRef.current.focus(); } }; }, []); React.useEffect(function () { if (focusVisible && focusRipple && !disableRipple) { rippleRef.current.pulsate(); } }, [disableRipple, focusRipple, focusVisible]); function useRippleHandler(rippleAction, eventCallback) { var skipRippleAction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : disableTouchRipple; return useEventCallback(function (event) { if (eventCallback) { eventCallback(event); } var ignore = skipRippleAction; if (!ignore && rippleRef.current) { rippleRef.current[rippleAction](event); } return true; }); } var handleMouseDown = useRippleHandler('start', onMouseDown); var handleDragLeave = useRippleHandler('stop', onDragLeave); var handleMouseUp = useRippleHandler('stop', onMouseUp); var handleMouseLeave = useRippleHandler('stop', function (event) { if (focusVisible) { event.preventDefault(); } if (onMouseLeave) { onMouseLeave(event); } }); var handleTouchStart = useRippleHandler('start', onTouchStart); var handleTouchEnd = useRippleHandler('stop', onTouchEnd); var handleTouchMove = useRippleHandler('stop', onTouchMove); var handleBlur = useRippleHandler('stop', function (event) { if (focusVisible) { onBlurVisible(event); setFocusVisible(false); } if (onBlur) { onBlur(event); } }, false); var handleFocus = useEventCallback(function (event) { if (disabled) { return; } // Fix for https://github.com/facebook/react/issues/7769 if (!buttonRef.current) { buttonRef.current = event.currentTarget; } if (isFocusVisible(event)) { setFocusVisible(true); if (onFocusVisible) { onFocusVisible(event); } } if (onFocus) { onFocus(event); } }); var isNonNativeButton = function isNonNativeButton() { var button = getButtonNode(); return component && component !== 'button' && !(button.tagName === 'A' && button.href); }; /** * IE 11 shim for https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat */ var keydownRef = React.useRef(false); var handleKeyDown = useEventCallback(function (event) { // Check if key is already down to avoid repeats being counted as multiple activations if (focusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === ' ') { keydownRef.current = true; event.persist(); rippleRef.current.stop(event, function () { rippleRef.current.start(event); }); } if (onKeyDown) { onKeyDown(event); } // Keyboard accessibility for non interactive elements if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter') { event.preventDefault(); if (onClick) { onClick(event); } } }); var handleKeyUp = useEventCallback(function (event) { // calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed // https://codesandbox.io/s/button-keyup-preventdefault-dn7f0 if (focusRipple && event.key === ' ' && rippleRef.current && focusVisible && !event.defaultPrevented) { keydownRef.current = false; event.persist(); rippleRef.current.stop(event, function () { rippleRef.current.pulsate(event); }); } if (onKeyUp) { onKeyUp(event); } // Keyboard accessibility for non interactive elements if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ' && !event.defaultPrevented) { event.preventDefault(); if (onClick) { onClick(event); } } }); var ComponentProp = component; if (ComponentProp === 'button' && other.href) { ComponentProp = 'a'; } var buttonProps = {}; if (ComponentProp === 'button') { buttonProps.type = type; buttonProps.disabled = disabled; } else { if (ComponentProp !== 'a' || !other.href) { buttonProps.role = 'button'; } buttonProps['aria-disabled'] = disabled; } var handleUserRef = useForkRef(buttonRefProp, ref); var handleOwnRef = useForkRef(focusVisibleRef, buttonRef); var handleRef = useForkRef(handleUserRef, handleOwnRef); return React.createElement(ComponentProp, _extends({ className: clsx(classes.root, className, focusVisible && [classes.focusVisible, focusVisibleClassName], disabled && classes.disabled), onBlur: handleBlur, onClick: onClick, onFocus: handleFocus, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onMouseDown: handleMouseDown, onMouseLeave: handleMouseLeave, onMouseUp: handleMouseUp, onDragLeave: handleDragLeave, onTouchEnd: handleTouchEnd, onTouchMove: handleTouchMove, onTouchStart: handleTouchStart, ref: handleRef, tabIndex: disabled ? -1 : tabIndex }, buttonProps, other), children, !disableRipple && !disabled ? React.createElement(NoSsr, null, React.createElement(TouchRipple, _extends({ ref: rippleRef, center: centerRipple }, TouchRippleProps))) : null); }); process.env.NODE_ENV !== "production" ? ButtonBase.propTypes = { /** * A ref for imperative actions. * It currently only supports `focusVisible()` action. */ action: refType, /** * @ignore * * Use that prop to pass a ref to the native button component. * @deprecated Use `ref` instead. */ buttonRef: refType, /** * If `true`, the ripples will be centered. * They won't start at the cursor interaction position. */ centerRipple: PropTypes.bool, /** * The content of the component. */ children: PropTypes.node, /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * @ignore */ className: PropTypes.string, /** * The component used for the root node. * Either a string to use a DOM element or a component. */ component: elementTypeAcceptingRef, /** * If `true`, the base button will be disabled. */ disabled: PropTypes.bool, /** * If `true`, the ripple effect will be disabled. * * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure * to highlight the element by applying separate styles with the `focusVisibleClassName`. */ disableRipple: PropTypes.bool, /** * If `true`, the touch ripple effect will be disabled. */ disableTouchRipple: PropTypes.bool, /** * If `true`, the base button will have a keyboard focus ripple. * `disableRipple` must also be `false`. */ focusRipple: PropTypes.bool, /** * This prop can help a person know which element has the keyboard focus. * The class name will be applied when the element gain the focus through a keyboard interaction. * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo). * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/master/explainer.md). * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components * if needed. */ focusVisibleClassName: PropTypes.string, /** * @ignore */ onBlur: PropTypes.func, /** * @ignore */ onClick: PropTypes.func, /** * @ignore */ onDragLeave: PropTypes.func, /** * @ignore */ onFocus: PropTypes.func, /** * Callback fired when the component is focused with a keyboard. * We trigger a `onFocus` callback too. */ onFocusVisible: PropTypes.func, /** * @ignore */ onKeyDown: PropTypes.func, /** * @ignore */ onKeyUp: PropTypes.func, /** * @ignore */ onMouseDown: PropTypes.func, /** * @ignore */ onMouseLeave: PropTypes.func, /** * @ignore */ onMouseUp: PropTypes.func, /** * @ignore */ onTouchEnd: PropTypes.func, /** * @ignore */ onTouchMove: PropTypes.func, /** * @ignore */ onTouchStart: PropTypes.func, /** * @ignore */ role: PropTypes.string, /** * @ignore */ tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), /** * Props applied to the `TouchRipple` element. */ TouchRippleProps: PropTypes.object, /** * Used to control the button's purpose. * This prop passes the value to the `type` attribute of the native button component. */ type: PropTypes.oneOf(['submit', 'reset', 'button']) } : void 0; export default withStyles(styles, { name: 'MuiButtonBase' })(ButtonBase);
ajax/libs/material-ui/4.11.4/RootRef/RootRef.js
cdnjs/cdnjs
"use strict"; var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); var React = _interopRequireWildcard(require("react")); var ReactDOM = _interopRequireWildcard(require("react-dom")); var _propTypes = _interopRequireDefault(require("prop-types")); var _utils = require("@material-ui/utils"); var _setRef = _interopRequireDefault(require("../utils/setRef")); function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * ⚠️⚠️⚠️ * If you want the DOM element of a Material-UI component check out * [FAQ: How can I access the DOM element?](/getting-started/faq/#how-can-i-access-the-dom-element) * first. * * This component uses `findDOMNode` which is deprecated in React.StrictMode. * * Helper component to allow attaching a ref to a * wrapped element to access the underlying DOM element. * * It's highly inspired by https://github.com/facebook/react/issues/11401#issuecomment-340543801. * For example: * ```jsx * import React from 'react'; * import RootRef from '@material-ui/core/RootRef'; * * function MyComponent() { * const domRef = React.useRef(); * * React.useEffect(() => { * console.log(domRef.current); // DOM node * }, []); * * return ( * <RootRef rootRef={domRef}> * <SomeChildComponent /> * </RootRef> * ); * } * ``` */ var RootRef = /*#__PURE__*/function (_React$Component) { (0, _inherits2.default)(RootRef, _React$Component); var _super = _createSuper(RootRef); function RootRef() { (0, _classCallCheck2.default)(this, RootRef); return _super.apply(this, arguments); } (0, _createClass2.default)(RootRef, [{ key: "componentDidMount", value: function componentDidMount() { this.ref = ReactDOM.findDOMNode(this); (0, _setRef.default)(this.props.rootRef, this.ref); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var ref = ReactDOM.findDOMNode(this); if (prevProps.rootRef !== this.props.rootRef || this.ref !== ref) { if (prevProps.rootRef !== this.props.rootRef) { (0, _setRef.default)(prevProps.rootRef, null); } this.ref = ref; (0, _setRef.default)(this.props.rootRef, this.ref); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.ref = null; (0, _setRef.default)(this.props.rootRef, null); } }, { key: "render", value: function render() { return this.props.children; } }]); return RootRef; }(React.Component); process.env.NODE_ENV !== "production" ? RootRef.propTypes = { /** * The wrapped element. */ children: _propTypes.default.element.isRequired, /** * A ref that points to the first DOM node of the wrapped element. */ rootRef: _utils.refType.isRequired } : void 0; if (process.env.NODE_ENV !== 'production') { process.env.NODE_ENV !== "production" ? RootRef.propTypes = (0, _utils.exactProp)(RootRef.propTypes) : void 0; } var _default = RootRef; exports.default = _default;
ajax/libs/react-native-web/0.13.7/exports/KeyboardAvoidingView/index.js
cdnjs/cdnjs
function _extends() { _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; }; return _extends.apply(this, arguments); } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } /** * Copyright (c) Nicolas Gallagher. * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ import View from '../View'; import React from 'react'; var KeyboardAvoidingView = /*#__PURE__*/ function (_React$Component) { _inheritsLoose(KeyboardAvoidingView, _React$Component); function KeyboardAvoidingView() { var _this; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; _this.frame = null; _this.onLayout = function (event) { _this.frame = event.nativeEvent.layout; }; return _this; } var _proto = KeyboardAvoidingView.prototype; _proto.relativeKeyboardHeight = function relativeKeyboardHeight(keyboardFrame) { var frame = this.frame; if (!frame || !keyboardFrame) { return 0; } var keyboardY = keyboardFrame.screenY - (this.props.keyboardVerticalOffset || 0); return Math.max(frame.y + frame.height - keyboardY, 0); }; _proto.onKeyboardChange = function onKeyboardChange(event) {}; _proto.render = function render() { var _this$props = this.props, behavior = _this$props.behavior, contentContainerStyle = _this$props.contentContainerStyle, keyboardVerticalOffset = _this$props.keyboardVerticalOffset, rest = _objectWithoutPropertiesLoose(_this$props, ["behavior", "contentContainerStyle", "keyboardVerticalOffset"]); return React.createElement(View, _extends({ onLayout: this.onLayout }, rest)); }; return KeyboardAvoidingView; }(React.Component); export default KeyboardAvoidingView;
ajax/libs/boardgame-io/0.50.0-alpha.0/esm/react.js
cdnjs/cdnjs
import 'nanoid/non-secure'; import './Debug-cc60d8e3.js'; import 'redux'; import './turn-order-8cc4909b.js'; import 'immer'; import './plugin-random-087f861e.js'; import 'lodash.isplainobject'; import './reducer-9b2fe64d.js'; import 'rfc6902'; import './initialize-cd2104ba.js'; import './transport-ce07b771.js'; import { C as Client$1 } from './client-44b09176.js'; import 'flatted'; import 'setimmediate'; import { M as MCTSBot } from './ai-f5285565.js'; import { L as LobbyClient } from './client-5f57c3f2.js'; import React from 'react'; import PropTypes from 'prop-types'; import Cookies from 'react-cookies'; import './util-89055384.js'; import { S as SocketIO, L as Local } from './socketio-80abb602.js'; import './master-04a42192.js'; import './filter-player-view-43ed49b0.js'; import 'socket.io-client'; /* * Copyright 2017 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ /** * Client * * boardgame.io React client. * * @param {...object} game - The return value of `Game`. * @param {...object} numPlayers - The number of players. * @param {...object} board - The React component for the game. * @param {...object} loading - (optional) The React component for the loading state. * @param {...object} multiplayer - Set to a falsy value or a transportFactory, e.g., SocketIO() * @param {...object} debug - Enables the Debug UI. * @param {...object} enhancer - Optional enhancer to send to the Redux store * * Returns: * A React component that wraps board and provides an * API through props for it to interact with the framework * and dispatch actions such as MAKE_MOVE, GAME_EVENT, RESET, * UNDO and REDO. */ function Client(opts) { var _a; const { game, numPlayers, board, multiplayer, enhancer } = opts; let { loading, debug } = opts; // Component that is displayed before the client has synced // with the game master. if (loading === undefined) { const Loading = () => React.createElement("div", { className: "bgio-loading" }, "connecting..."); loading = Loading; } /* * WrappedBoard * * The main React component that wraps the passed in * board component and adds the API to its props. */ return _a = class WrappedBoard extends React.Component { constructor(props) { super(props); if (debug === undefined) { debug = props.debug; } this.client = Client$1({ game, debug, numPlayers, multiplayer, matchID: props.matchID, playerID: props.playerID, credentials: props.credentials, enhancer, }); } componentDidMount() { this.unsubscribe = this.client.subscribe(() => this.forceUpdate()); this.client.start(); } componentWillUnmount() { this.client.stop(); this.unsubscribe(); } componentDidUpdate(prevProps) { if (this.props.matchID != prevProps.matchID) { this.client.updateMatchID(this.props.matchID); } if (this.props.playerID != prevProps.playerID) { this.client.updatePlayerID(this.props.playerID); } if (this.props.credentials != prevProps.credentials) { this.client.updateCredentials(this.props.credentials); } } render() { const state = this.client.getState(); if (state === null) { return React.createElement(loading); } let _board = null; if (board) { _board = React.createElement(board, { ...state, ...this.props, isMultiplayer: !!multiplayer, moves: this.client.moves, events: this.client.events, matchID: this.client.matchID, playerID: this.client.playerID, reset: this.client.reset, undo: this.client.undo, redo: this.client.redo, log: this.client.log, matchData: this.client.matchData, sendChatMessage: this.client.sendChatMessage, chatMessages: this.client.chatMessages, }); } return React.createElement("div", { className: "bgio-client" }, _board); } }, _a.propTypes = { // The ID of a game to connect to. // Only relevant in multiplayer. matchID: PropTypes.string, // The ID of the player associated with this client. // Only relevant in multiplayer. playerID: PropTypes.string, // This client's authentication credentials. // Only relevant in multiplayer. credentials: PropTypes.string, // Enable / disable the Debug UI. debug: PropTypes.any, }, _a.defaultProps = { matchID: 'default', playerID: null, credentials: null, debug: true, }, _a; } /* * Copyright 2018 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ class _LobbyConnectionImpl { constructor({ server, gameComponents, playerName, playerCredentials, }) { this.client = new LobbyClient({ server }); this.gameComponents = gameComponents; this.playerName = playerName || 'Visitor'; this.playerCredentials = playerCredentials; this.matches = []; } async refresh() { try { this.matches = []; const games = await this.client.listGames(); for (const game of games) { if (!this._getGameComponents(game)) continue; const { matches } = await this.client.listMatches(game); this.matches.push(...matches); } } catch (error) { throw new Error('failed to retrieve list of matches (' + error + ')'); } } _getMatchInstance(matchID) { for (const inst of this.matches) { if (inst['matchID'] === matchID) return inst; } } _getGameComponents(gameName) { for (const comp of this.gameComponents) { if (comp.game.name === gameName) return comp; } } _findPlayer(playerName) { for (const inst of this.matches) { if (inst.players.some((player) => player.name === playerName)) return inst; } } async join(gameName, matchID, playerID) { try { let inst = this._findPlayer(this.playerName); if (inst) { throw new Error('player has already joined ' + inst.matchID); } inst = this._getMatchInstance(matchID); if (!inst) { throw new Error('game instance ' + matchID + ' not found'); } const json = await this.client.joinMatch(gameName, matchID, { playerID, playerName: this.playerName, }); inst.players[Number.parseInt(playerID)].name = this.playerName; this.playerCredentials = json.playerCredentials; } catch (error) { throw new Error('failed to join match ' + matchID + ' (' + error + ')'); } } async leave(gameName, matchID) { try { const inst = this._getMatchInstance(matchID); if (!inst) throw new Error('match instance not found'); for (const player of inst.players) { if (player.name === this.playerName) { await this.client.leaveMatch(gameName, matchID, { playerID: player.id.toString(), credentials: this.playerCredentials, }); delete player.name; delete this.playerCredentials; return; } } throw new Error('player not found in match'); } catch (error) { throw new Error('failed to leave match ' + matchID + ' (' + error + ')'); } } async disconnect() { const inst = this._findPlayer(this.playerName); if (inst) { await this.leave(inst.gameName, inst.matchID); } this.matches = []; this.playerName = 'Visitor'; } async create(gameName, numPlayers) { try { const comp = this._getGameComponents(gameName); if (!comp) throw new Error('game not found'); if (numPlayers < comp.game.minPlayers || numPlayers > comp.game.maxPlayers) throw new Error('invalid number of players ' + numPlayers); await this.client.createMatch(gameName, { numPlayers }); } catch (error) { throw new Error('failed to create match for ' + gameName + ' (' + error + ')'); } } } /** * LobbyConnection * * Lobby model. * * @param {string} server - '<host>:<port>' of the server. * @param {Array} gameComponents - A map of Board and Game objects for the supported games. * @param {string} playerName - The name of the player. * @param {string} playerCredentials - The credentials currently used by the player, if any. * * Returns: * A JS object that synchronizes the list of running game instances with the server and provides an API to create/join/start instances. */ function LobbyConnection(opts) { return new _LobbyConnectionImpl(opts); } /* * Copyright 2018 The boardgame.io Authors. * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ class LobbyLoginForm extends React.Component { constructor() { super(...arguments); this.state = { playerName: this.props.playerName, nameErrorMsg: '', }; this.onClickEnter = () => { if (this.state.playerName === '') return; this.props.onEnter(this.state.playerName); }; this.onKeyPress = (event) => { if (event.key === 'Enter') { this.onClickEnter(); } }; this.onChangePlayerName = (event) => { const name = event.target.value.trim(); this.setState({ playerName: name, nameErrorMsg: name.length > 0 ? '' : 'empty player name', }); }; } render() { return (React.createElement("div", null, React.createElement("p", { className: "phase-title" }, "Choose a player name:"), React.createElement("input", { type: "text", value: this.state.playerName, onChange: this.onChangePlayerName, onKeyPress: this.onKeyPress }), React.createElement("span", { className: "buttons" }, React.createElement("button", { className: "buttons", onClick: this.onClickEnter }, "Enter")), React.createElement("br", null), React.createElement("span", { className: "error-msg" }, this.state.nameErrorMsg, React.createElement("br", null)))); } } LobbyLoginForm.defaultProps = { playerName: '', }; /* * Copyright 2018 The boardgame.io Authors. * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ class LobbyMatchInstance extends React.Component { constructor() { super(...arguments); this._createSeat = (player) => { return player.name || '[free]'; }; this._createButtonJoin = (inst, seatId) => (React.createElement("button", { key: 'button-join-' + inst.matchID, onClick: () => this.props.onClickJoin(inst.gameName, inst.matchID, '' + seatId) }, "Join")); this._createButtonLeave = (inst) => (React.createElement("button", { key: 'button-leave-' + inst.matchID, onClick: () => this.props.onClickLeave(inst.gameName, inst.matchID) }, "Leave")); this._createButtonPlay = (inst, seatId) => (React.createElement("button", { key: 'button-play-' + inst.matchID, onClick: () => this.props.onClickPlay(inst.gameName, { matchID: inst.matchID, playerID: '' + seatId, numPlayers: inst.players.length, }) }, "Play")); this._createButtonSpectate = (inst) => (React.createElement("button", { key: 'button-spectate-' + inst.matchID, onClick: () => this.props.onClickPlay(inst.gameName, { matchID: inst.matchID, numPlayers: inst.players.length, }) }, "Spectate")); this._createInstanceButtons = (inst) => { const playerSeat = inst.players.find((player) => player.name === this.props.playerName); const freeSeat = inst.players.find((player) => !player.name); if (playerSeat && freeSeat) { // already seated: waiting for match to start return this._createButtonLeave(inst); } if (freeSeat) { // at least 1 seat is available return this._createButtonJoin(inst, freeSeat.id); } // match is full if (playerSeat) { return (React.createElement("div", null, [ this._createButtonPlay(inst, playerSeat.id), this._createButtonLeave(inst), ])); } // allow spectating return this._createButtonSpectate(inst); }; } render() { const match = this.props.match; let status = 'OPEN'; if (!match.players.some((player) => !player.name)) { status = 'RUNNING'; } return (React.createElement("tr", { key: 'line-' + match.matchID }, React.createElement("td", { key: 'cell-name-' + match.matchID }, match.gameName), React.createElement("td", { key: 'cell-status-' + match.matchID }, status), React.createElement("td", { key: 'cell-seats-' + match.matchID }, match.players.map((player) => this._createSeat(player)).join(', ')), React.createElement("td", { key: 'cell-buttons-' + match.matchID }, this._createInstanceButtons(match)))); } } /* * Copyright 2018 The boardgame.io Authors. * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ class LobbyCreateMatchForm extends React.Component { constructor(props) { super(props); this.state = { selectedGame: 0, numPlayers: 2, }; this._createGameNameOption = (game, idx) => { return (React.createElement("option", { key: 'name-option-' + idx, value: idx }, game.game.name)); }; this._createNumPlayersOption = (idx) => { return (React.createElement("option", { key: 'num-option-' + idx, value: idx }, idx)); }; this._createNumPlayersRange = (game) => { return Array.from({ length: game.maxPlayers + 1 }) .map((_, i) => i) .slice(game.minPlayers); }; this.onChangeNumPlayers = (event) => { this.setState({ numPlayers: Number.parseInt(event.target.value), }); }; this.onChangeSelectedGame = (event) => { const idx = Number.parseInt(event.target.value); this.setState({ selectedGame: idx, numPlayers: this.props.games[idx].game.minPlayers, }); }; this.onClickCreate = () => { this.props.createMatch(this.props.games[this.state.selectedGame].game.name, this.state.numPlayers); }; /* fix min and max number of players */ for (const game of props.games) { const matchDetails = game.game; if (!matchDetails.minPlayers) { matchDetails.minPlayers = 1; } if (!matchDetails.maxPlayers) { matchDetails.maxPlayers = 4; } console.assert(matchDetails.maxPlayers >= matchDetails.minPlayers); } this.state = { selectedGame: 0, numPlayers: props.games[0].game.minPlayers, }; } render() { return (React.createElement("div", null, React.createElement("select", { value: this.state.selectedGame, onChange: (evt) => this.onChangeSelectedGame(evt) }, this.props.games.map((game, index) => this._createGameNameOption(game, index))), React.createElement("span", null, "Players:"), React.createElement("select", { value: this.state.numPlayers, onChange: this.onChangeNumPlayers }, this._createNumPlayersRange(this.props.games[this.state.selectedGame].game).map((number) => this._createNumPlayersOption(number))), React.createElement("span", { className: "buttons" }, React.createElement("button", { onClick: this.onClickCreate }, "Create")))); } } /* * Copyright 2018 The boardgame.io Authors. * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ var LobbyPhases; (function (LobbyPhases) { LobbyPhases["ENTER"] = "enter"; LobbyPhases["PLAY"] = "play"; LobbyPhases["LIST"] = "list"; })(LobbyPhases || (LobbyPhases = {})); /** * Lobby * * React lobby component. * * @param {Array} gameComponents - An array of Board and Game objects for the supported games. * @param {string} lobbyServer - Address of the lobby server (for example 'localhost:8000'). * If not set, defaults to the server that served the page. * @param {string} gameServer - Address of the game server (for example 'localhost:8001'). * If not set, defaults to the server that served the page. * @param {function} clientFactory - Function that is used to create the game clients. * @param {number} refreshInterval - Interval between server updates (default: 2000ms). * @param {bool} debug - Enable debug information (default: false). * * Returns: * A React component that provides a UI to create, list, join, leave, play or * spectate matches (game instances). */ class Lobby extends React.Component { constructor(props) { super(props); this.state = { phase: LobbyPhases.ENTER, playerName: 'Visitor', runningMatch: null, errorMsg: '', credentialStore: {}, }; this._createConnection = (props) => { const name = this.state.playerName; this.connection = LobbyConnection({ server: props.lobbyServer, gameComponents: props.gameComponents, playerName: name, playerCredentials: this.state.credentialStore[name], }); }; this._updateCredentials = (playerName, credentials) => { this.setState((prevState) => { // clone store or componentDidUpdate will not be triggered const store = Object.assign({}, prevState.credentialStore); store[playerName] = credentials; return { credentialStore: store }; }); }; this._updateConnection = async () => { await this.connection.refresh(); this.forceUpdate(); }; this._enterLobby = (playerName) => { this._startRefreshInterval(); this.setState({ playerName, phase: LobbyPhases.LIST }); }; this._exitLobby = async () => { this._clearRefreshInterval(); await this.connection.disconnect(); this.setState({ phase: LobbyPhases.ENTER, errorMsg: '' }); }; this._createMatch = async (gameName, numPlayers) => { try { await this.connection.create(gameName, numPlayers); await this.connection.refresh(); // rerender this.setState({}); } catch (error) { this.setState({ errorMsg: error.message }); } }; this._joinMatch = async (gameName, matchID, playerID) => { try { await this.connection.join(gameName, matchID, playerID); await this.connection.refresh(); this._updateCredentials(this.connection.playerName, this.connection.playerCredentials); } catch (error) { this.setState({ errorMsg: error.message }); } }; this._leaveMatch = async (gameName, matchID) => { try { await this.connection.leave(gameName, matchID); await this.connection.refresh(); this._updateCredentials(this.connection.playerName, this.connection.playerCredentials); } catch (error) { this.setState({ errorMsg: error.message }); } }; this._startMatch = (gameName, matchOpts) => { const gameCode = this.connection._getGameComponents(gameName); if (!gameCode) { this.setState({ errorMsg: 'game ' + gameName + ' not supported', }); return; } let multiplayer = undefined; if (matchOpts.numPlayers > 1) { multiplayer = this.props.gameServer ? SocketIO({ server: this.props.gameServer }) : SocketIO(); } if (matchOpts.numPlayers == 1) { const maxPlayers = gameCode.game.maxPlayers; const bots = {}; for (let i = 1; i < maxPlayers; i++) { bots[i + ''] = MCTSBot; } multiplayer = Local({ bots }); } const app = this.props.clientFactory({ game: gameCode.game, board: gameCode.board, debug: this.props.debug, multiplayer, }); const match = { app: app, matchID: matchOpts.matchID, playerID: matchOpts.numPlayers > 1 ? matchOpts.playerID : '0', credentials: this.connection.playerCredentials, }; this._clearRefreshInterval(); this.setState({ phase: LobbyPhases.PLAY, runningMatch: match }); }; this._exitMatch = () => { this._startRefreshInterval(); this.setState({ phase: LobbyPhases.LIST, runningMatch: null }); }; this._getPhaseVisibility = (phase) => { return this.state.phase !== phase ? 'hidden' : 'phase'; }; this.renderMatches = (matches, playerName) => { return matches.map((match) => { const { matchID, gameName, players } = match; return (React.createElement(LobbyMatchInstance, { key: 'instance-' + matchID, match: { matchID, gameName, players: Object.values(players) }, playerName: playerName, onClickJoin: this._joinMatch, onClickLeave: this._leaveMatch, onClickPlay: this._startMatch })); }); }; this._createConnection(this.props); } componentDidMount() { const cookie = Cookies.load('lobbyState') || {}; if (cookie.phase && cookie.phase === LobbyPhases.PLAY) { cookie.phase = LobbyPhases.LIST; } if (cookie.phase && cookie.phase !== LobbyPhases.ENTER) { this._startRefreshInterval(); } this.setState({ phase: cookie.phase || LobbyPhases.ENTER, playerName: cookie.playerName || 'Visitor', credentialStore: cookie.credentialStore || {}, }); } componentDidUpdate(prevProps, prevState) { const name = this.state.playerName; const creds = this.state.credentialStore[name]; if (prevState.phase !== this.state.phase || prevState.credentialStore[name] !== creds || prevState.playerName !== name) { this._createConnection(this.props); this._updateConnection(); const cookie = { phase: this.state.phase, playerName: name, credentialStore: this.state.credentialStore, }; Cookies.save('lobbyState', cookie, { path: '/' }); } if (prevProps.refreshInterval !== this.props.refreshInterval) { this._startRefreshInterval(); } } componentWillUnmount() { this._clearRefreshInterval(); } _startRefreshInterval() { this._clearRefreshInterval(); this._currentInterval = setInterval(this._updateConnection, this.props.refreshInterval); } _clearRefreshInterval() { clearInterval(this._currentInterval); } render() { const { gameComponents, renderer } = this.props; const { errorMsg, playerName, phase, runningMatch } = this.state; if (renderer) { return renderer({ errorMsg, gameComponents, matches: this.connection.matches, phase, playerName, runningMatch, handleEnterLobby: this._enterLobby, handleExitLobby: this._exitLobby, handleCreateMatch: this._createMatch, handleJoinMatch: this._joinMatch, handleLeaveMatch: this._leaveMatch, handleExitMatch: this._exitMatch, handleRefreshMatches: this._updateConnection, handleStartMatch: this._startMatch, }); } return (React.createElement("div", { id: "lobby-view", style: { padding: 50 } }, React.createElement("div", { className: this._getPhaseVisibility(LobbyPhases.ENTER) }, React.createElement(LobbyLoginForm, { key: playerName, playerName: playerName, onEnter: this._enterLobby })), React.createElement("div", { className: this._getPhaseVisibility(LobbyPhases.LIST) }, React.createElement("p", null, "Welcome, ", playerName), React.createElement("div", { className: "phase-title", id: "match-creation" }, React.createElement("span", null, "Create a match:"), React.createElement(LobbyCreateMatchForm, { games: gameComponents, createMatch: this._createMatch })), React.createElement("p", { className: "phase-title" }, "Join a match:"), React.createElement("div", { id: "instances" }, React.createElement("table", null, React.createElement("tbody", null, this.renderMatches(this.connection.matches, playerName))), React.createElement("span", { className: "error-msg" }, errorMsg, React.createElement("br", null))), React.createElement("p", { className: "phase-title" }, "Matches that become empty are automatically deleted.")), React.createElement("div", { className: this._getPhaseVisibility(LobbyPhases.PLAY) }, runningMatch && (React.createElement(runningMatch.app, { matchID: runningMatch.matchID, playerID: runningMatch.playerID, credentials: runningMatch.credentials })), React.createElement("div", { className: "buttons", id: "match-exit" }, React.createElement("button", { onClick: this._exitMatch }, "Exit match"))), React.createElement("div", { className: "buttons", id: "lobby-exit" }, React.createElement("button", { onClick: this._exitLobby }, "Exit lobby")))); } } Lobby.propTypes = { gameComponents: PropTypes.array.isRequired, lobbyServer: PropTypes.string, gameServer: PropTypes.string, debug: PropTypes.bool, clientFactory: PropTypes.func, refreshInterval: PropTypes.number, }; Lobby.defaultProps = { debug: false, clientFactory: Client, refreshInterval: 2000, }; export { Client, Lobby };
ajax/libs/material-ui/4.9.4/es/RadioGroup/RadioGroupContext.js
cdnjs/cdnjs
import React from 'react'; /** * @ignore - internal component. */ const RadioGroupContext = React.createContext(); if (process.env.NODE_ENV !== 'production') { RadioGroupContext.displayName = 'RadioGroupContext'; } export default RadioGroupContext;
ajax/libs/primereact/7.2.0/row/row.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; 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 _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 _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); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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; } 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 _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; } } var Row = /*#__PURE__*/function (_Component) { _inherits(Row, _Component); var _super = _createSuper(Row); function Row() { _classCallCheck(this, Row); return _super.apply(this, arguments); } _createClass(Row, [{ key: "render", value: function render() { return /*#__PURE__*/React.createElement("tr", null, this.props.children); } }]); return Row; }(Component); _defineProperty(Row, "defaultProps", { style: null, className: null }); export { Row };
ajax/libs/material-ui/4.9.4/esm/ListItemIcon/ListItemIcon.js
cdnjs/cdnjs
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import withStyles from '../styles/withStyles'; import ListContext from '../List/ListContext'; export var styles = function styles(theme) { return { /* Styles applied to the root element. */ root: { minWidth: 56, color: theme.palette.action.active, flexShrink: 0, display: 'inline-flex' }, /* Styles applied to the root element when the parent `ListItem` uses `alignItems="flex-start"`. */ alignItemsFlexStart: { marginTop: 8 } }; }; /** * A simple wrapper to apply `List` styles to an `Icon` or `SvgIcon`. */ var ListItemIcon = React.forwardRef(function ListItemIcon(props, ref) { var classes = props.classes, className = props.className, other = _objectWithoutProperties(props, ["classes", "className"]); var context = React.useContext(ListContext); return React.createElement("div", _extends({ className: clsx(classes.root, className, context.alignItems === 'flex-start' && classes.alignItemsFlexStart), ref: ref }, other)); }); process.env.NODE_ENV !== "production" ? ListItemIcon.propTypes = { /** * The content of the component, normally `Icon`, `SvgIcon`, * or a `@material-ui/icons` SVG icon element. */ children: PropTypes.element.isRequired, /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * @ignore */ className: PropTypes.string } : void 0; export default withStyles(styles, { name: 'MuiListItemIcon' })(ListItemIcon);
ajax/libs/boardgame-io/0.49.0/esm/react-native.js
cdnjs/cdnjs
import 'nanoid/non-secure'; import { _ as _inherits, a as _createSuper, b as _createClass, c as _defineProperty, d as _classCallCheck, e as _objectWithoutProperties, f as _objectSpread2 } from './Debug-f39f426b.js'; import 'redux'; import './turn-order-406c4349.js'; import 'immer'; import 'lodash.isplainobject'; import './reducer-efc3ec3e.js'; import 'rfc6902'; import './initialize-8da88d04.js'; import './transport-ce07b771.js'; import { C as Client$1 } from './client-48f68c72.js'; import 'flatted'; import 'setimmediate'; import './ai-7a5eea10.js'; import React from 'react'; import PropTypes from 'prop-types'; var _excluded = ["matchID", "playerID"]; /** * Client * * boardgame.io React Native client. * * @param {...object} game - The return value of `Game`. * @param {...object} numPlayers - The number of players. * @param {...object} board - The React component for the game. * @param {...object} loading - (optional) The React component for the loading state. * @param {...object} multiplayer - Set to a falsy value or a transportFactory, e.g., SocketIO() * @param {...object} enhancer - Optional enhancer to send to the Redux store * * Returns: * A React Native component that wraps board and provides an * API through props for it to interact with the framework * and dispatch actions such as MAKE_MOVE. */ function Client(opts) { var _class, _temp; var game = opts.game, numPlayers = opts.numPlayers, board = opts.board, multiplayer = opts.multiplayer, enhancer = opts.enhancer; /* * WrappedBoard * * The main React component that wraps the passed in * board component and adds the API to its props. */ return _temp = _class = /*#__PURE__*/function (_React$Component) { _inherits(WrappedBoard, _React$Component); var _super = _createSuper(WrappedBoard); function WrappedBoard(props) { var _this; _classCallCheck(this, WrappedBoard); _this = _super.call(this, props); _this.client = Client$1({ game: game, numPlayers: numPlayers, multiplayer: multiplayer, matchID: props.matchID, playerID: props.playerID, credentials: props.credentials, debug: false, enhancer: enhancer }); return _this; } _createClass(WrappedBoard, [{ key: "componentDidMount", value: function componentDidMount() { var _this2 = this; this.unsubscribe = this.client.subscribe(function () { return _this2.forceUpdate(); }); this.client.start(); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.client.stop(); this.unsubscribe(); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (prevProps.matchID != this.props.matchID) { this.client.updateMatchID(this.props.matchID); } if (prevProps.playerID != this.props.playerID) { this.client.updatePlayerID(this.props.playerID); } if (prevProps.credentials != this.props.credentials) { this.client.updateCredentials(this.props.credentials); } } }, { key: "render", value: function render() { var _board = null; var state = this.client.getState(); var _this$props = this.props, matchID = _this$props.matchID, playerID = _this$props.playerID, rest = _objectWithoutProperties(_this$props, _excluded); if (board) { _board = /*#__PURE__*/React.createElement(board, _objectSpread2(_objectSpread2(_objectSpread2({}, state), rest), {}, { matchID: matchID, playerID: playerID, isMultiplayer: !!multiplayer, moves: this.client.moves, events: this.client.events, step: this.client.step, reset: this.client.reset, undo: this.client.undo, redo: this.client.redo, matchData: this.client.matchData, sendChatMessage: this.client.sendChatMessage, chatMessages: this.client.chatMessages })); } return _board; } }]); return WrappedBoard; }(React.Component), _defineProperty(_class, "propTypes", { // The ID of a game to connect to. // Only relevant in multiplayer. matchID: PropTypes.string, // The ID of the player associated with this client. // Only relevant in multiplayer. playerID: PropTypes.string, // This client's authentication credentials. // Only relevant in multiplayer. credentials: PropTypes.string }), _defineProperty(_class, "defaultProps", { matchID: 'default', playerID: null, credentials: null }), _temp; } export { Client };
ajax/libs/material-ui/4.9.2/es/test-utils/createMount.js
cdnjs/cdnjs
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; import React from 'react'; import ReactDOM from 'react-dom'; import * as PropTypes from 'prop-types'; import { mount as enzymeMount } from 'enzyme'; /** * Can't just mount <React.Fragment>{node}</React.Fragment> * because that swallows wrapper.setProps * * why class component: * https://github.com/airbnb/enzyme/issues/2043 */ // eslint-disable-next-line react/prefer-stateless-function class Mode extends React.Component { render() { // Excess props will come from e.g. enzyme setProps const _this$props = this.props, { __element, __strict } = _this$props, other = _objectWithoutPropertiesLoose(_this$props, ["__element", "__strict"]); const Component = __strict ? React.StrictMode : React.Fragment; return React.createElement(Component, null, React.cloneElement(__element, other)); } } // Generate an enhanced mount function. process.env.NODE_ENV !== "production" ? Mode.propTypes = { /** * this is essentially children. However we can't use children because then * using `wrapper.setProps({ children })` would work differently if this component * would be the root. */ __element: PropTypes.element.isRequired, __strict: PropTypes.bool.isRequired } : void 0; export default function createMount(options = {}) { const { mount = enzymeMount, strict: globalStrict } = options, globalEnzymeOptions = _objectWithoutPropertiesLoose(options, ["mount", "strict"]); const attachTo = document.createElement('div'); attachTo.className = 'app'; attachTo.setAttribute('id', 'app'); document.body.insertBefore(attachTo, document.body.firstChild); const mountWithContext = function mountWithContext(node, localOptions = {}) { const { disableUnnmount = false, strict = globalStrict } = localOptions, localEnzymeOptions = _objectWithoutPropertiesLoose(localOptions, ["disableUnnmount", "strict"]); if (!disableUnnmount) { ReactDOM.unmountComponentAtNode(attachTo); } // some tests require that no other components are in the tree // e.g. when doing .instance(), .state() etc. return mount(strict == null ? node : React.createElement(Mode, { __element: node, __strict: Boolean(strict) }), _extends({ attachTo }, globalEnzymeOptions, {}, localEnzymeOptions)); }; mountWithContext.attachTo = attachTo; mountWithContext.cleanUp = () => { ReactDOM.unmountComponentAtNode(attachTo); attachTo.parentElement.removeChild(attachTo); }; return mountWithContext; }
ajax/libs/material-ui/4.9.3/esm/Select/Select.js
cdnjs/cdnjs
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; import React from 'react'; import PropTypes from 'prop-types'; import { mergeClasses } from '@material-ui/styles'; import SelectInput from './SelectInput'; import formControlState from '../FormControl/formControlState'; import useFormControl from '../FormControl/useFormControl'; import withStyles from '../styles/withStyles'; import ArrowDropDownIcon from '../internal/svg-icons/ArrowDropDown'; import Input from '../Input'; import { styles as nativeSelectStyles } from '../NativeSelect/NativeSelect'; import NativeSelectInput from '../NativeSelect/NativeSelectInput'; import FilledInput from '../FilledInput'; import OutlinedInput from '../OutlinedInput'; export var styles = nativeSelectStyles; var _ref = React.createElement(Input, null); var _ref2 = React.createElement(FilledInput, null); var Select = React.forwardRef(function Select(props, ref) { var _props$autoWidth = props.autoWidth, autoWidth = _props$autoWidth === void 0 ? false : _props$autoWidth, children = props.children, classes = props.classes, _props$displayEmpty = props.displayEmpty, displayEmpty = _props$displayEmpty === void 0 ? false : _props$displayEmpty, _props$IconComponent = props.IconComponent, IconComponent = _props$IconComponent === void 0 ? ArrowDropDownIcon : _props$IconComponent, id = props.id, input = props.input, inputProps = props.inputProps, label = props.label, labelId = props.labelId, _props$labelWidth = props.labelWidth, labelWidth = _props$labelWidth === void 0 ? 0 : _props$labelWidth, MenuProps = props.MenuProps, _props$multiple = props.multiple, multiple = _props$multiple === void 0 ? false : _props$multiple, _props$native = props.native, native = _props$native === void 0 ? false : _props$native, onClose = props.onClose, onOpen = props.onOpen, open = props.open, renderValue = props.renderValue, SelectDisplayProps = props.SelectDisplayProps, _props$variant = props.variant, variantProps = _props$variant === void 0 ? 'standard' : _props$variant, other = _objectWithoutProperties(props, ["autoWidth", "children", "classes", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "labelWidth", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"]); var inputComponent = native ? NativeSelectInput : SelectInput; var muiFormControl = useFormControl(); var fcs = formControlState({ props: props, muiFormControl: muiFormControl, states: ['variant'] }); var variant = fcs.variant || variantProps; var InputComponent = input || { standard: _ref, outlined: React.createElement(OutlinedInput, { label: label, labelWidth: labelWidth }), filled: _ref2 }[variant]; return React.cloneElement(InputComponent, _extends({ // Most of the logic is implemented in `SelectInput`. // The `Select` component is a simple API wrapper to expose something better to play with. inputComponent: inputComponent, inputProps: _extends({ children: children, IconComponent: IconComponent, variant: variant, type: undefined, // We render a select. We can ignore the type provided by the `Input`. multiple: multiple }, native ? { id: id } : { autoWidth: autoWidth, displayEmpty: displayEmpty, labelId: labelId, MenuProps: MenuProps, onClose: onClose, onOpen: onOpen, open: open, renderValue: renderValue, SelectDisplayProps: _extends({ id: id }, SelectDisplayProps) }, {}, inputProps, { classes: inputProps ? mergeClasses({ baseClasses: classes, newClasses: inputProps.classes, Component: Select }) : classes }, input ? input.props.inputProps : {}), ref: ref }, other)); }); process.env.NODE_ENV !== "production" ? Select.propTypes = { /** * If `true`, the width of the popover will automatically be set according to the items inside the * menu, otherwise it will be at least the width of the select input. */ autoWidth: PropTypes.bool, /** * The option elements to populate the select with. * Can be some `MenuItem` when `native` is false and `option` when `native` is true. * * ⚠️The `MenuItem` elements **must** be direct descendants when `native` is false. */ children: PropTypes.node, /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * The default element value. Use when the component is not controlled. */ defaultValue: PropTypes.any, /** * If `true`, a value is displayed even if no items are selected. * * In order to display a meaningful value, a function should be passed to the `renderValue` prop which returns the value to be displayed when no items are selected. * You can only use it when the `native` prop is `false` (default). */ displayEmpty: PropTypes.bool, /** * The icon that displays the arrow. */ IconComponent: PropTypes.elementType, /** * @ignore */ id: PropTypes.string, /** * An `Input` element; does not have to be a material-ui specific `Input`. */ input: PropTypes.element, /** * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element. * When `native` is `true`, the attributes are applied on the `select` element. */ inputProps: PropTypes.object, /** * See [OutlinedLabel#label](/api/outlined-input/#props) */ label: PropTypes.node, /** * The ID of an element that acts as an additional label. The Select will * be labelled by the additional label and the selected value. */ labelId: PropTypes.string, /** * See OutlinedLabel#label */ labelWidth: PropTypes.number, /** * Props applied to the [`Menu`](/api/menu/) element. */ MenuProps: PropTypes.object, /** * If `true`, `value` must be an array and the menu will support multiple selections. */ multiple: PropTypes.bool, /** * If `true`, the component will be using a native `select` element. */ native: PropTypes.bool, /** * Callback function fired when a menu item is selected. * * @param {object} event The event source of the callback. * You can pull out the new value by accessing `event.target.value` (any). * @param {object} [child] The react element that was selected when `native` is `false` (default). */ onChange: PropTypes.func, /** * Callback fired when the component requests to be closed. * Use in controlled mode (see open). * * @param {object} event The event source of the callback. */ onClose: PropTypes.func, /** * Callback fired when the component requests to be opened. * Use in controlled mode (see open). * * @param {object} event The event source of the callback. */ onOpen: PropTypes.func, /** * Control `select` open state. * You can only use it when the `native` prop is `false` (default). */ open: PropTypes.bool, /** * Render the selected value. * You can only use it when the `native` prop is `false` (default). * * @param {any} value The `value` provided to the component. * @returns {ReactNode} */ renderValue: PropTypes.func, /** * Props applied to the clickable div element. */ SelectDisplayProps: PropTypes.object, /** * The input value. Providing an empty string will select no options. * This prop is required when the `native` prop is `false` (default). * Set to an empty string `''` if you don't want any of the available options to be selected. * * If the value is an object it must have reference equality with the option in order to be selected. * If the value is not an object, the string representation must match with the string representation of the option in order to be selected. */ value: PropTypes.any, /** * The variant to use. */ variant: PropTypes.oneOf(['standard', 'outlined', 'filled']) } : void 0; Select.muiName = 'Select'; export default withStyles(styles, { name: 'MuiSelect' })(Select);
ajax/libs/material-ui/5.0.0-alpha.3/RootRef/RootRef.js
cdnjs/cdnjs
"use strict"; var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); var React = _interopRequireWildcard(require("react")); var ReactDOM = _interopRequireWildcard(require("react-dom")); var _propTypes = _interopRequireDefault(require("prop-types")); var _utils = require("@material-ui/utils"); var _setRef = _interopRequireDefault(require("../utils/setRef")); function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * ⚠️⚠️⚠️ * If you want the DOM element of a Material-UI component check out * [FAQ: How can I access the DOM element?](/getting-started/faq/#how-can-i-access-the-dom-element) * first. * * This component uses `findDOMNode` which is deprecated in React.StrictMode. * * Helper component to allow attaching a ref to a * wrapped element to access the underlying DOM element. * * It's highly inspired by https://github.com/facebook/react/issues/11401#issuecomment-340543801. * For example: * ```jsx * import React from 'react'; * import RootRef from '@material-ui/core/RootRef'; * * function MyComponent() { * const domRef = React.useRef(); * * React.useEffect(() => { * console.log(domRef.current); // DOM node * }, []); * * return ( * <RootRef rootRef={domRef}> * <SomeChildComponent /> * </RootRef> * ); * } * ``` */ var RootRef = /*#__PURE__*/function (_React$Component) { (0, _inherits2.default)(RootRef, _React$Component); var _super = _createSuper(RootRef); function RootRef() { (0, _classCallCheck2.default)(this, RootRef); return _super.apply(this, arguments); } (0, _createClass2.default)(RootRef, [{ key: "componentDidMount", value: function componentDidMount() { this.ref = ReactDOM.findDOMNode(this); (0, _setRef.default)(this.props.rootRef, this.ref); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var ref = ReactDOM.findDOMNode(this); if (prevProps.rootRef !== this.props.rootRef || this.ref !== ref) { if (prevProps.rootRef !== this.props.rootRef) { (0, _setRef.default)(prevProps.rootRef, null); } this.ref = ref; (0, _setRef.default)(this.props.rootRef, this.ref); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.ref = null; (0, _setRef.default)(this.props.rootRef, null); } }, { key: "render", value: function render() { return this.props.children; } }]); return RootRef; }(React.Component); process.env.NODE_ENV !== "production" ? RootRef.propTypes = { // ----------------------------- Warning -------------------------------- // | These PropTypes are generated from the TypeScript type definitions | // | To update them edit the d.ts file and run "yarn proptypes" | // ---------------------------------------------------------------------- /** * The wrapped element. */ children: _propTypes.default.element.isRequired, /** * A ref that points to the first DOM node of the wrapped element. */ rootRef: _utils.refType.isRequired } : void 0; if (process.env.NODE_ENV !== 'production') { process.env.NODE_ENV !== "production" ? RootRef.propTypes = (0, _utils.exactProp)(RootRef.propTypes) : void 0; } var _default = RootRef; exports.default = _default;
ajax/libs/react-native-web/0.13.6/exports/RefreshControl/index.js
cdnjs/cdnjs
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } /** * Copyright (c) Nicolas Gallagher. * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ import View from '../View'; import React from 'react'; function RefreshControl(props) { var colors = props.colors, enabled = props.enabled, onRefresh = props.onRefresh, progressBackgroundColor = props.progressBackgroundColor, progressViewOffset = props.progressViewOffset, refreshing = props.refreshing, size = props.size, tintColor = props.tintColor, title = props.title, titleColor = props.titleColor, rest = _objectWithoutPropertiesLoose(props, ["colors", "enabled", "onRefresh", "progressBackgroundColor", "progressViewOffset", "refreshing", "size", "tintColor", "title", "titleColor"]); return React.createElement(View, rest); } export default RefreshControl;
ajax/libs/material-ui/4.9.4/es/SvgIcon/SvgIcon.js
cdnjs/cdnjs
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import withStyles from '../styles/withStyles'; import capitalize from '../utils/capitalize'; export const styles = theme => ({ /* Styles applied to the root element. */ root: { userSelect: 'none', width: '1em', height: '1em', display: 'inline-block', fill: 'currentColor', flexShrink: 0, fontSize: theme.typography.pxToRem(24), transition: theme.transitions.create('fill', { duration: theme.transitions.duration.shorter }) }, /* Styles applied to the root element if `color="primary"`. */ colorPrimary: { color: theme.palette.primary.main }, /* Styles applied to the root element if `color="secondary"`. */ colorSecondary: { color: theme.palette.secondary.main }, /* Styles applied to the root element if `color="action"`. */ colorAction: { color: theme.palette.action.active }, /* Styles applied to the root element if `color="error"`. */ colorError: { color: theme.palette.error.main }, /* Styles applied to the root element if `color="disabled"`. */ colorDisabled: { color: theme.palette.action.disabled }, /* Styles applied to the root element if `fontSize="inherit"`. */ fontSizeInherit: { fontSize: 'inherit' }, /* Styles applied to the root element if `fontSize="small"`. */ fontSizeSmall: { fontSize: theme.typography.pxToRem(20) }, /* Styles applied to the root element if `fontSize="large"`. */ fontSizeLarge: { fontSize: theme.typography.pxToRem(35) } }); const SvgIcon = React.forwardRef(function SvgIcon(props, ref) { const { children, classes, className, color = 'inherit', component: Component = 'svg', fontSize = 'default', htmlColor, titleAccess, viewBox = '0 0 24 24' } = props, other = _objectWithoutPropertiesLoose(props, ["children", "classes", "className", "color", "component", "fontSize", "htmlColor", "titleAccess", "viewBox"]); return React.createElement(Component, _extends({ className: clsx(classes.root, className, color !== 'inherit' && classes[`color${capitalize(color)}`], fontSize !== 'default' && classes[`fontSize${capitalize(fontSize)}`]), focusable: "false", viewBox: viewBox, color: htmlColor, "aria-hidden": titleAccess ? undefined : 'true', role: titleAccess ? 'img' : 'presentation', ref: ref }, other), children, titleAccess ? React.createElement("title", null, titleAccess) : null); }); process.env.NODE_ENV !== "production" ? SvgIcon.propTypes = { // ----------------------------- Warning -------------------------------- // | These PropTypes are generated from the TypeScript type definitions | // | To update them edit the d.ts file and run "yarn proptypes" | // ---------------------------------------------------------------------- /** * Node passed into the SVG element. */ children: PropTypes.node, /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object, /** * @ignore */ className: PropTypes.string, /** * The color of the component. It supports those theme colors that make sense for this component. * You can use the `htmlColor` prop to apply a color attribute to the SVG element. */ color: PropTypes.oneOf(['action', 'disabled', 'error', 'inherit', 'primary', 'secondary']), /** * The component used for the root node. * Either a string to use a DOM element or a component. */ component: PropTypes.elementType, /** * The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size. */ fontSize: PropTypes.oneOf(['default', 'inherit', 'large', 'small']), /** * Applies a color attribute to the SVG element. */ htmlColor: PropTypes.string, /** * The shape-rendering attribute. The behavior of the different options is described on the * [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering). * If you are having issues with blurry icons you should investigate this property. */ shapeRendering: PropTypes.string, /** * Provides a human-readable title for the element that contains it. * https://www.w3.org/TR/SVG-access/#Equivalent */ titleAccess: PropTypes.string, /** * Allows you to redefine what the coordinates without units mean inside an SVG element. * For example, if the SVG element is 500 (width) by 200 (height), * and you pass viewBox="0 0 50 20", * this means that the coordinates inside the SVG will go from the top left corner (0,0) * to bottom right (50,20) and each unit will be worth 10px. */ viewBox: PropTypes.string } : void 0; SvgIcon.muiName = 'SvgIcon'; export default withStyles(styles, { name: 'MuiSvgIcon' })(SvgIcon);
ajax/libs/react-native-web/0.11.6/exports/createElement/index.js
cdnjs/cdnjs
/** * Copyright (c) Nicolas Gallagher. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ import AccessibilityUtil from '../../modules/AccessibilityUtil'; import createDOMProps from '../../modules/createDOMProps'; import { injectEventPluginsByName } from 'react-dom/unstable-native-dependencies'; import normalizeNativeEvent from '../../modules/normalizeNativeEvent'; import React from 'react'; import ResponderEventPlugin from '../../modules/ResponderEventPlugin'; injectEventPluginsByName({ ResponderEventPlugin: ResponderEventPlugin }); var isModifiedEvent = function isModifiedEvent(event) { return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); }; /** * Ensure event handlers receive an event of the expected shape. The 'button' * role – for accessibility reasons and functional equivalence to the native * button element – must also support synthetic keyboard activation of onclick, * and remove event handlers when disabled. */ var eventHandlerNames = { onBlur: true, onClick: true, onClickCapture: true, onContextMenu: true, onFocus: true, onResponderRelease: true, onTouchCancel: true, onTouchCancelCapture: true, onTouchEnd: true, onTouchEndCapture: true, onTouchMove: true, onTouchMoveCapture: true, onTouchStart: true, onTouchStartCapture: true }; var adjustProps = function adjustProps(domProps) { var onClick = domProps.onClick, onResponderRelease = domProps.onResponderRelease, role = domProps.role; var isButtonLikeRole = AccessibilityUtil.buttonLikeRoles[role]; var isDisabled = AccessibilityUtil.isDisabled(domProps); var isLinkRole = role === 'link'; Object.keys(domProps).forEach(function (propName) { var prop = domProps[propName]; var isEventHandler = typeof prop === 'function' && eventHandlerNames[propName]; if (isEventHandler) { if (isButtonLikeRole && isDisabled) { domProps[propName] = undefined; } else { // TODO: move this out of the render path domProps[propName] = function (e) { e.nativeEvent = normalizeNativeEvent(e.nativeEvent); return prop(e); }; } } }); // Cancel click events if the responder system is being used on a link // element. Click events are not an expected part of the React Native API, // and browsers dispatch click events that cannot otherwise be cancelled from // preceding mouse events in the responder system. if (isLinkRole && onResponderRelease) { domProps.onClick = function (e) { if (!e.isDefaultPrevented() && !isModifiedEvent(e.nativeEvent) && !domProps.target) { e.preventDefault(); } }; } // Button-like roles should trigger 'onClick' if SPACE or ENTER keys are pressed. if (isButtonLikeRole && !isDisabled) { domProps.onKeyPress = function (e) { if (!e.isDefaultPrevented() && (e.which === 13 || e.which === 32)) { e.preventDefault(); if (onClick) { onClick(e); } } }; } }; var createElement = function createElement(component, props) { // use equivalent platform elements where possible var accessibilityComponent; if (component && component.constructor === String) { accessibilityComponent = AccessibilityUtil.propsToAccessibilityComponent(props); } var Component = accessibilityComponent || component; var domProps = createDOMProps(Component, props); adjustProps(domProps); for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { children[_key - 2] = arguments[_key]; } return React.createElement.apply(React, [Component, domProps].concat(children)); }; export default createElement;
ajax/libs/react-native-web/0.12.1/exports/ImageBackground/index.js
cdnjs/cdnjs
function _extends() { _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; }; return _extends.apply(this, arguments); } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } /** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ import ensureComponentIsNative from '../../modules/ensureComponentIsNative'; import Image from '../Image'; import StyleSheet from '../StyleSheet'; import View from '../View'; import React from 'react'; var emptyObject = {}; /** * Very simple drop-in replacement for <Image> which supports nesting views. */ var ImageBackground = /*#__PURE__*/ function (_React$Component) { _inheritsLoose(ImageBackground, _React$Component); function ImageBackground() { var _this; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; _this._viewRef = null; _this._captureRef = function (ref) { _this._viewRef = ref; }; return _this; } var _proto = ImageBackground.prototype; _proto.setNativeProps = function setNativeProps(props) { // Work-around flow var viewRef = this._viewRef; if (viewRef) { ensureComponentIsNative(viewRef); viewRef.setNativeProps(props); } }; _proto.render = function render() { var _this$props = this.props, children = _this$props.children, _this$props$style = _this$props.style, style = _this$props$style === void 0 ? emptyObject : _this$props$style, imageStyle = _this$props.imageStyle, imageRef = _this$props.imageRef, props = _objectWithoutPropertiesLoose(_this$props, ["children", "style", "imageStyle", "imageRef"]); var _StyleSheet$flatten = StyleSheet.flatten(style), height = _StyleSheet$flatten.height, width = _StyleSheet$flatten.width; return React.createElement(View, { ref: this._captureRef, style: style }, React.createElement(Image, _extends({}, props, { ref: imageRef, style: [StyleSheet.absoluteFill, { // Temporary Workaround: // Current (imperfect yet) implementation of <Image> overwrites width and height styles // (which is not quite correct), and these styles conflict with explicitly set styles // of <ImageBackground> and with our internal layout model here. // So, we have to proxy/reapply these styles explicitly for actual <Image> component. // This workaround should be removed after implementing proper support of // intrinsic content size of the <Image>. width: width, height: height, zIndex: -1 }, imageStyle] })), children); }; return ImageBackground; }(React.Component); export default ImageBackground;
ajax/libs/react-instantsearch/5.2.0/Connectors.js
cdnjs/cdnjs
/*! React InstantSearch 5.2.0 | © Algolia, inc. | https://community.algolia.com/react-instantsearch */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) : typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) : (factory((global.ReactInstantSearch = global.ReactInstantSearch || {}, global.ReactInstantSearch.Connectors = {}),global.React)); }(this, (function (exports,React) { 'use strict'; var React__default = 'default' in React ? React['default'] : React; var global$1 = (typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}); // shim for using process in browser // based off https://github.com/defunctzombie/node-process/blob/master/browser.js function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout () { throw new Error('clearTimeout has not been defined'); } var cachedSetTimeout = defaultSetTimout; var cachedClearTimeout = defaultClearTimeout; if (typeof global$1.setTimeout === 'function') { cachedSetTimeout = setTimeout; } if (typeof global$1.clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch(e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch(e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while(len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } function nextTick(fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } } // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; var title = 'browser'; var platform = 'browser'; var browser = true; var env = {}; var argv = []; var version = ''; // empty string to avoid regexp issues var versions = {}; var release = {}; var config = {}; function noop() {} var on = noop; var addListener = noop; var once = noop; var off = noop; var removeListener = noop; var removeAllListeners = noop; var emit = noop; function binding(name) { throw new Error('process.binding is not supported'); } function cwd () { return '/' } function chdir (dir) { throw new Error('process.chdir is not supported'); }function umask() { return 0; } // from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js var performance = global$1.performance || {}; var performanceNow = performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow || function(){ return (new Date()).getTime() }; // generate timestamp or delta // see http://nodejs.org/api/process.html#process_process_hrtime function hrtime(previousTimestamp){ var clocktime = performanceNow.call(performance)*1e-3; var seconds = Math.floor(clocktime); var nanoseconds = Math.floor((clocktime%1)*1e9); if (previousTimestamp) { seconds = seconds - previousTimestamp[0]; nanoseconds = nanoseconds - previousTimestamp[1]; if (nanoseconds<0) { seconds--; nanoseconds += 1e9; } } return [seconds,nanoseconds] } var startTime = new Date(); function uptime() { var currentTime = new Date(); var dif = currentTime - startTime; return dif / 1000; } var process = { nextTick: nextTick, title: title, browser: browser, env: env, argv: argv, version: version, versions: versions, on: on, addListener: addListener, once: once, off: off, removeListener: removeListener, removeAllListeners: removeAllListeners, emit: emit, binding: binding, cwd: cwd, chdir: chdir, umask: umask, hrtime: hrtime, platform: platform, release: release, config: config, uptime: uptime }; var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; function createCommonjsModule(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; } /** * 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 makeEmptyFunction(arg) { return function () { return arg; }; } /** * This function accepts and discards inputs; it has no side effects. This is * primarily useful idiomatically for overridable function endpoints which * always need to be callable, since JS lacks a null-call idiom ala Cocoa. */ var emptyFunction = function emptyFunction() {}; emptyFunction.thatReturns = makeEmptyFunction; emptyFunction.thatReturnsFalse = makeEmptyFunction(false); emptyFunction.thatReturnsTrue = makeEmptyFunction(true); emptyFunction.thatReturnsNull = makeEmptyFunction(null); emptyFunction.thatReturnsThis = function () { return this; }; emptyFunction.thatReturnsArgument = function (arg) { return arg; }; var emptyFunction_1 = emptyFunction; /** * Use invariant() to assert state which your program assumes to be true. * * Provide sprintf-style format (only %s is supported) and arguments * to provide information about what broke and what you were * expecting. * * The invariant message will be stripped in production, but the invariant * will remain to ensure logic does not differ in production. */ var validateFormat = function validateFormat(format) {}; function invariant(condition, format, a, b, c, d, e, f) { validateFormat(format); if (!condition) { var error; if (format === undefined) { error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); } else { var args = [a, b, c, d, e, f]; var argIndex = 0; error = new Error(format.replace(/%s/g, function () { return args[argIndex++]; })); error.name = 'Invariant Violation'; } error.framesToPop = 1; // we don't care about invariant's own frame throw error; } } var invariant_1 = invariant; /* object-assign (c) Sindre Sorhus @license MIT */ /* eslint-disable no-unused-vars */ var getOwnPropertySymbols = Object.getOwnPropertySymbols; var hasOwnProperty = Object.prototype.hasOwnProperty; var propIsEnumerable = Object.prototype.propertyIsEnumerable; function toObject(val) { if (val === null || val === undefined) { throw new TypeError('Object.assign cannot be called with null or undefined'); } return Object(val); } function shouldUseNative() { try { if (!Object.assign) { return false; } // Detect buggy property enumeration order in older V8 versions. // https://bugs.chromium.org/p/v8/issues/detail?id=4118 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers test1[5] = 'de'; if (Object.getOwnPropertyNames(test1)[0] === '5') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test2 = {}; for (var i = 0; i < 10; i++) { test2['_' + String.fromCharCode(i)] = i; } var order2 = Object.getOwnPropertyNames(test2).map(function (n) { return test2[n]; }); if (order2.join('') !== '0123456789') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test3 = {}; 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { test3[letter] = letter; }); if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { return false; } return true; } catch (err) { // We don't expect any of the above to throw, but better to be safe. return false; } } var objectAssign = shouldUseNative() ? Object.assign : function (target, source) { var from; var to = toObject(target); var symbols; for (var s = 1; s < arguments.length; s++) { from = Object(arguments[s]); for (var key in from) { if (hasOwnProperty.call(from, key)) { to[key] = from[key]; } } if (getOwnPropertySymbols) { symbols = getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) { if (propIsEnumerable.call(from, symbols[i])) { to[symbols[i]] = from[symbols[i]]; } } } } return to; }; /** * 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. */ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; var ReactPropTypesSecret_1 = ReactPropTypesSecret; var factoryWithThrowingShims = function() { function shim(props, propName, componentName, location, propFullName, secret) { if (secret === ReactPropTypesSecret_1) { // It is still safe when called from React. return; } invariant_1( false, 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types' ); } shim.isRequired = shim; function getShim() { return shim; } // Important! // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. var ReactPropTypes = { array: shim, bool: shim, func: shim, number: shim, object: shim, string: shim, symbol: shim, any: shim, arrayOf: getShim, element: shim, instanceOf: getShim, node: shim, objectOf: getShim, oneOf: getShim, oneOfType: getShim, shape: getShim, exact: getShim }; ReactPropTypes.checkPropTypes = emptyFunction_1; ReactPropTypes.PropTypes = ReactPropTypes; return ReactPropTypes; }; var propTypes = createCommonjsModule(function (module) { /** * 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. */ { // By explicitly using `prop-types` you are opting into new production behavior. // http://fb.me/prop-types-in-prod module.exports = factoryWithThrowingShims(); } }); /** * Removes all key-value entries from the list cache. * * @private * @name clear * @memberOf ListCache */ function listCacheClear() { this.__data__ = []; this.size = 0; } var _listCacheClear = listCacheClear; /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */ function eq(value, other) { return value === other || (value !== value && other !== other); } var eq_1 = eq; /** * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ function assocIndexOf(array, key) { var length = array.length; while (length--) { if (eq_1(array[length][0], key)) { return length; } } return -1; } var _assocIndexOf = assocIndexOf; /** Used for built-in method references. */ var arrayProto = Array.prototype; /** Built-in value references. */ var splice = arrayProto.splice; /** * Removes `key` and its value from the list cache. * * @private * @name delete * @memberOf ListCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function listCacheDelete(key) { var data = this.__data__, index = _assocIndexOf(data, key); if (index < 0) { return false; } var lastIndex = data.length - 1; if (index == lastIndex) { data.pop(); } else { splice.call(data, index, 1); } --this.size; return true; } var _listCacheDelete = listCacheDelete; /** * Gets the list cache value for `key`. * * @private * @name get * @memberOf ListCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function listCacheGet(key) { var data = this.__data__, index = _assocIndexOf(data, key); return index < 0 ? undefined : data[index][1]; } var _listCacheGet = listCacheGet; /** * Checks if a list cache value for `key` exists. * * @private * @name has * @memberOf ListCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function listCacheHas(key) { return _assocIndexOf(this.__data__, key) > -1; } var _listCacheHas = listCacheHas; /** * Sets the list cache `key` to `value`. * * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. */ function listCacheSet(key, value) { var data = this.__data__, index = _assocIndexOf(data, key); if (index < 0) { ++this.size; data.push([key, value]); } else { data[index][1] = value; } return this; } var _listCacheSet = listCacheSet; /** * Creates an list cache object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function ListCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } // Add methods to `ListCache`. ListCache.prototype.clear = _listCacheClear; ListCache.prototype['delete'] = _listCacheDelete; ListCache.prototype.get = _listCacheGet; ListCache.prototype.has = _listCacheHas; ListCache.prototype.set = _listCacheSet; var _ListCache = ListCache; /** * Removes all key-value entries from the stack. * * @private * @name clear * @memberOf Stack */ function stackClear() { this.__data__ = new _ListCache; this.size = 0; } var _stackClear = stackClear; /** * Removes `key` and its value from the stack. * * @private * @name delete * @memberOf Stack * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function stackDelete(key) { var data = this.__data__, result = data['delete'](key); this.size = data.size; return result; } var _stackDelete = stackDelete; /** * Gets the stack value for `key`. * * @private * @name get * @memberOf Stack * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function stackGet(key) { return this.__data__.get(key); } var _stackGet = stackGet; /** * Checks if a stack value for `key` exists. * * @private * @name has * @memberOf Stack * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function stackHas(key) { return this.__data__.has(key); } var _stackHas = stackHas; /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; var _freeGlobal = freeGlobal; /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = _freeGlobal || freeSelf || Function('return this')(); var _root = root; /** Built-in value references. */ var Symbol$1 = _root.Symbol; var _Symbol = Symbol$1; /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$1 = objectProto.hasOwnProperty; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** Built-in value references. */ var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined; /** * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private * @param {*} value The value to query. * @returns {string} Returns the raw `toStringTag`. */ function getRawTag(value) { var isOwn = hasOwnProperty$1.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = undefined; } catch (e) {} var result = nativeObjectToString.call(value); { if (isOwn) { value[symToStringTag] = tag; } else { delete value[symToStringTag]; } } return result; } var _getRawTag = getRawTag; /** Used for built-in method references. */ var objectProto$1 = Object.prototype; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString$1 = objectProto$1.toString; /** * Converts `value` to a string using `Object.prototype.toString`. * * @private * @param {*} value The value to convert. * @returns {string} Returns the converted string. */ function objectToString(value) { return nativeObjectToString$1.call(value); } var _objectToString = objectToString; /** `Object#toString` result references. */ var nullTag = '[object Null]', undefinedTag = '[object Undefined]'; /** Built-in value references. */ var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined; /** * The base implementation of `getTag` without fallbacks for buggy environments. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ function baseGetTag(value) { if (value == null) { return value === undefined ? undefinedTag : nullTag; } return (symToStringTag$1 && symToStringTag$1 in Object(value)) ? _getRawTag(value) : _objectToString(value); } var _baseGetTag = baseGetTag; /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return value != null && (type == 'object' || type == 'function'); } var isObject_1 = isObject; /** `Object#toString` result references. */ var asyncTag = '[object AsyncFunction]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]', proxyTag = '[object Proxy]'; /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { if (!isObject_1(value)) { return false; } // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 9 which returns 'object' for typed arrays and other constructors. var tag = _baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } var isFunction_1 = isFunction; /** Used to detect overreaching core-js shims. */ var coreJsData = _root['__core-js_shared__']; var _coreJsData = coreJsData; /** Used to detect methods masquerading as native. */ var maskSrcKey = (function() { var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || ''); return uid ? ('Symbol(src)_1.' + uid) : ''; }()); /** * Checks if `func` has its source masked. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ function isMasked(func) { return !!maskSrcKey && (maskSrcKey in func); } var _isMasked = isMasked; /** Used for built-in method references. */ var funcProto = Function.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** * Converts `func` to its source code. * * @private * @param {Function} func The function to convert. * @returns {string} Returns the source code. */ function toSource(func) { if (func != null) { try { return funcToString.call(func); } catch (e) {} try { return (func + ''); } catch (e) {} } return ''; } var _toSource = toSource; /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** Used for built-in method references. */ var funcProto$1 = Function.prototype, objectProto$2 = Object.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString$1 = funcProto$1.toString; /** Used to check objects for own properties. */ var hasOwnProperty$2 = objectProto$2.hasOwnProperty; /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + funcToString$1.call(hasOwnProperty$2).replace(reRegExpChar, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); /** * The base implementation of `_.isNative` without bad shim checks. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. */ function baseIsNative(value) { if (!isObject_1(value) || _isMasked(value)) { return false; } var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor; return pattern.test(_toSource(value)); } var _baseIsNative = baseIsNative; /** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function getValue(object, key) { return object == null ? undefined : object[key]; } var _getValue = getValue; /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { var value = _getValue(object, key); return _baseIsNative(value) ? value : undefined; } var _getNative = getNative; /* Built-in method references that are verified to be native. */ var Map = _getNative(_root, 'Map'); var _Map = Map; /* Built-in method references that are verified to be native. */ var nativeCreate = _getNative(Object, 'create'); var _nativeCreate = nativeCreate; /** * Removes all key-value entries from the hash. * * @private * @name clear * @memberOf Hash */ function hashClear() { this.__data__ = _nativeCreate ? _nativeCreate(null) : {}; this.size = 0; } var _hashClear = hashClear; /** * Removes `key` and its value from the hash. * * @private * @name delete * @memberOf Hash * @param {Object} hash The hash to modify. * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function hashDelete(key) { var result = this.has(key) && delete this.__data__[key]; this.size -= result ? 1 : 0; return result; } var _hashDelete = hashDelete; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** Used for built-in method references. */ var objectProto$3 = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$3 = objectProto$3.hasOwnProperty; /** * Gets the hash value for `key`. * * @private * @name get * @memberOf Hash * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function hashGet(key) { var data = this.__data__; if (_nativeCreate) { var result = data[key]; return result === HASH_UNDEFINED ? undefined : result; } return hasOwnProperty$3.call(data, key) ? data[key] : undefined; } var _hashGet = hashGet; /** Used for built-in method references. */ var objectProto$4 = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$4 = objectProto$4.hasOwnProperty; /** * Checks if a hash value for `key` exists. * * @private * @name has * @memberOf Hash * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function hashHas(key) { var data = this.__data__; return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$4.call(data, key); } var _hashHas = hashHas; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED$1 = '__lodash_hash_undefined__'; /** * Sets the hash `key` to `value`. * * @private * @name set * @memberOf Hash * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the hash instance. */ function hashSet(key, value) { var data = this.__data__; this.size += this.has(key) ? 0 : 1; data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED$1 : value; return this; } var _hashSet = hashSet; /** * Creates a hash object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Hash(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } // Add methods to `Hash`. Hash.prototype.clear = _hashClear; Hash.prototype['delete'] = _hashDelete; Hash.prototype.get = _hashGet; Hash.prototype.has = _hashHas; Hash.prototype.set = _hashSet; var _Hash = Hash; /** * Removes all key-value entries from the map. * * @private * @name clear * @memberOf MapCache */ function mapCacheClear() { this.size = 0; this.__data__ = { 'hash': new _Hash, 'map': new (_Map || _ListCache), 'string': new _Hash }; } var _mapCacheClear = mapCacheClear; /** * Checks if `value` is suitable for use as unique object key. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ function isKeyable(value) { var type = typeof value; return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') ? (value !== '__proto__') : (value === null); } var _isKeyable = isKeyable; /** * Gets the data for `map`. * * @private * @param {Object} map The map to query. * @param {string} key The reference key. * @returns {*} Returns the map data. */ function getMapData(map, key) { var data = map.__data__; return _isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map; } var _getMapData = getMapData; /** * Removes `key` and its value from the map. * * @private * @name delete * @memberOf MapCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function mapCacheDelete(key) { var result = _getMapData(this, key)['delete'](key); this.size -= result ? 1 : 0; return result; } var _mapCacheDelete = mapCacheDelete; /** * Gets the map value for `key`. * * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function mapCacheGet(key) { return _getMapData(this, key).get(key); } var _mapCacheGet = mapCacheGet; /** * Checks if a map value for `key` exists. * * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function mapCacheHas(key) { return _getMapData(this, key).has(key); } var _mapCacheHas = mapCacheHas; /** * Sets the map `key` to `value`. * * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */ function mapCacheSet(key, value) { var data = _getMapData(this, key), size = data.size; data.set(key, value); this.size += data.size == size ? 0 : 1; return this; } var _mapCacheSet = mapCacheSet; /** * Creates a map cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function MapCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } // Add methods to `MapCache`. MapCache.prototype.clear = _mapCacheClear; MapCache.prototype['delete'] = _mapCacheDelete; MapCache.prototype.get = _mapCacheGet; MapCache.prototype.has = _mapCacheHas; MapCache.prototype.set = _mapCacheSet; var _MapCache = MapCache; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; /** * Sets the stack `key` to `value`. * * @private * @name set * @memberOf Stack * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the stack cache instance. */ function stackSet(key, value) { var data = this.__data__; if (data instanceof _ListCache) { var pairs = data.__data__; if (!_Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { pairs.push([key, value]); this.size = ++data.size; return this; } data = this.__data__ = new _MapCache(pairs); } data.set(key, value); this.size = data.size; return this; } var _stackSet = stackSet; /** * Creates a stack cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Stack(entries) { var data = this.__data__ = new _ListCache(entries); this.size = data.size; } // Add methods to `Stack`. Stack.prototype.clear = _stackClear; Stack.prototype['delete'] = _stackDelete; Stack.prototype.get = _stackGet; Stack.prototype.has = _stackHas; Stack.prototype.set = _stackSet; var _Stack = Stack; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED$2 = '__lodash_hash_undefined__'; /** * Adds `value` to the array cache. * * @private * @name add * @memberOf SetCache * @alias push * @param {*} value The value to cache. * @returns {Object} Returns the cache instance. */ function setCacheAdd(value) { this.__data__.set(value, HASH_UNDEFINED$2); return this; } var _setCacheAdd = setCacheAdd; /** * Checks if `value` is in the array cache. * * @private * @name has * @memberOf SetCache * @param {*} value The value to search for. * @returns {number} Returns `true` if `value` is found, else `false`. */ function setCacheHas(value) { return this.__data__.has(value); } var _setCacheHas = setCacheHas; /** * * Creates an array cache object to store unique values. * * @private * @constructor * @param {Array} [values] The values to cache. */ function SetCache(values) { var index = -1, length = values == null ? 0 : values.length; this.__data__ = new _MapCache; while (++index < length) { this.add(values[index]); } } // Add methods to `SetCache`. SetCache.prototype.add = SetCache.prototype.push = _setCacheAdd; SetCache.prototype.has = _setCacheHas; var _SetCache = SetCache; /** * A specialized version of `_.some` 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 any element passes the predicate check, * else `false`. */ function arraySome(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (predicate(array[index], index, array)) { return true; } } return false; } var _arraySome = arraySome; /** * Checks if a `cache` value for `key` exists. * * @private * @param {Object} cache The cache to query. * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function cacheHas(cache, key) { return cache.has(key); } var _cacheHas = cacheHas; /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; /** * A specialized version of `baseIsEqualDeep` for arrays with support for * partial deep comparisons. * * @private * @param {Array} array The array to compare. * @param {Array} other The other array to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `array` and `other` objects. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. */ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length; if (arrLength != othLength && !(isPartial && othLength > arrLength)) { return false; } // Assume cyclic values are equal. var stacked = stack.get(array); if (stacked && stack.get(other)) { return stacked == other; } var index = -1, result = true, seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new _SetCache : undefined; stack.set(array, other); stack.set(other, array); // Ignore non-index properties. while (++index < arrLength) { var arrValue = array[index], othValue = other[index]; if (customizer) { var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); } if (compared !== undefined) { if (compared) { continue; } result = false; break; } // Recursively compare arrays (susceptible to call stack limits). if (seen) { if (!_arraySome(other, function(othValue, othIndex) { if (!_cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { return seen.push(othIndex); } })) { result = false; break; } } else if (!( arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack) )) { result = false; break; } } stack['delete'](array); stack['delete'](other); return result; } var _equalArrays = equalArrays; /** Built-in value references. */ var Uint8Array = _root.Uint8Array; var _Uint8Array = Uint8Array; /** * Converts `map` to its key-value pairs. * * @private * @param {Object} map The map to convert. * @returns {Array} Returns the key-value pairs. */ function mapToArray(map) { var index = -1, result = Array(map.size); map.forEach(function(value, key) { result[++index] = [key, value]; }); return result; } var _mapToArray = mapToArray; /** * Converts `set` to an array of its values. * * @private * @param {Object} set The set to convert. * @returns {Array} Returns the values. */ function setToArray(set) { var index = -1, result = Array(set.size); set.forEach(function(value) { result[++index] = value; }); return result; } var _setToArray = setToArray; /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG$1 = 1, COMPARE_UNORDERED_FLAG$1 = 2; /** `Object#toString` result references. */ var boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', mapTag = '[object Map]', numberTag = '[object Number]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', symbolTag = '[object Symbol]'; var arrayBufferTag = '[object ArrayBuffer]', dataViewTag = '[object DataView]'; /** Used to convert symbols to primitives and strings. */ var symbolProto = _Symbol ? _Symbol.prototype : undefined, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; /** * A specialized version of `baseIsEqualDeep` for comparing objects of * the same `toStringTag`. * * **Note:** This function only supports comparing values with tags of * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {string} tag The `toStringTag` of the objects to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { switch (tag) { case dataViewTag: if ((object.byteLength != other.byteLength) || (object.byteOffset != other.byteOffset)) { return false; } object = object.buffer; other = other.buffer; case arrayBufferTag: if ((object.byteLength != other.byteLength) || !equalFunc(new _Uint8Array(object), new _Uint8Array(other))) { return false; } return true; case boolTag: case dateTag: case numberTag: // Coerce booleans to `1` or `0` and dates to milliseconds. // Invalid dates are coerced to `NaN`. return eq_1(+object, +other); case errorTag: return object.name == other.name && object.message == other.message; case regexpTag: case stringTag: // Coerce regexes to strings and treat strings, primitives and objects, // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring // for more details. return object == (other + ''); case mapTag: var convert = _mapToArray; case setTag: var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1; convert || (convert = _setToArray); if (object.size != other.size && !isPartial) { return false; } // Assume cyclic values are equal. var stacked = stack.get(object); if (stacked) { return stacked == other; } bitmask |= COMPARE_UNORDERED_FLAG$1; // Recursively compare objects (susceptible to call stack limits). stack.set(object, other); var result = _equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); stack['delete'](object); return result; case symbolTag: if (symbolValueOf) { return symbolValueOf.call(object) == symbolValueOf.call(other); } } return false; } var _equalByTag = equalByTag; /** * Appends the elements of `values` to `array`. * * @private * @param {Array} array The array to modify. * @param {Array} values The values to append. * @returns {Array} Returns `array`. */ function arrayPush(array, values) { var index = -1, length = values.length, offset = array.length; while (++index < length) { array[offset + index] = values[index]; } return array; } var _arrayPush = arrayPush; /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; var isArray_1 = isArray; /** * The base implementation of `getAllKeys` and `getAllKeysIn` which uses * `keysFunc` and `symbolsFunc` to get the enumerable property names and * symbols of `object`. * * @private * @param {Object} object The object to query. * @param {Function} keysFunc The function to get the keys of `object`. * @param {Function} symbolsFunc The function to get the symbols of `object`. * @returns {Array} Returns the array of property names and symbols. */ function baseGetAllKeys(object, keysFunc, symbolsFunc) { var result = keysFunc(object); return isArray_1(object) ? result : _arrayPush(result, symbolsFunc(object)); } var _baseGetAllKeys = baseGetAllKeys; /** * A specialized version of `_.filter` 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 {Array} Returns the new filtered array. */ function arrayFilter(array, predicate) { var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result[resIndex++] = value; } } return result; } var _arrayFilter = arrayFilter; /** * This method returns a new empty array. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {Array} Returns the new empty array. * @example * * var arrays = _.times(2, _.stubArray); * * console.log(arrays); * // => [[], []] * * console.log(arrays[0] === arrays[1]); * // => false */ function stubArray() { return []; } var stubArray_1 = stubArray; /** Used for built-in method references. */ var objectProto$5 = Object.prototype; /** Built-in value references. */ var propertyIsEnumerable = objectProto$5.propertyIsEnumerable; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeGetSymbols = Object.getOwnPropertySymbols; /** * Creates an array of the own enumerable symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ var getSymbols = !nativeGetSymbols ? stubArray_1 : function(object) { if (object == null) { return []; } object = Object(object); return _arrayFilter(nativeGetSymbols(object), function(symbol) { return propertyIsEnumerable.call(object, symbol); }); }; var _getSymbols = getSymbols; /** * The base implementation of `_.times` without support for iteratee shorthands * or max array length checks. * * @private * @param {number} n The number of times to invoke `iteratee`. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the array of results. */ function baseTimes(n, iteratee) { var index = -1, result = Array(n); while (++index < n) { result[index] = iteratee(index); } return result; } var _baseTimes = baseTimes; /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return value != null && typeof value == 'object'; } var isObjectLike_1 = isObjectLike; /** `Object#toString` result references. */ var argsTag = '[object Arguments]'; /** * The base implementation of `_.isArguments`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ function baseIsArguments(value) { return isObjectLike_1(value) && _baseGetTag(value) == argsTag; } var _baseIsArguments = baseIsArguments; /** Used for built-in method references. */ var objectProto$6 = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$5 = objectProto$6.hasOwnProperty; /** Built-in value references. */ var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable; /** * Checks if `value` is likely an `arguments` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * * _.isArguments(function() { return arguments; }()); * // => true * * _.isArguments([1, 2, 3]); * // => false */ var isArguments = _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) { return isObjectLike_1(value) && hasOwnProperty$5.call(value, 'callee') && !propertyIsEnumerable$1.call(value, 'callee'); }; var isArguments_1 = isArguments; /** * This method returns `false`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `false`. * @example * * _.times(2, _.stubFalse); * // => [false, false] */ function stubFalse() { return false; } var stubFalse_1 = stubFalse; var isBuffer_1 = createCommonjsModule(function (module, exports) { /** Detect free variable `exports`. */ var freeExports = exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** Built-in value references. */ var Buffer = moduleExports ? _root.Buffer : undefined; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; /** * Checks if `value` is a buffer. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. * @example * * _.isBuffer(new Buffer(2)); * // => true * * _.isBuffer(new Uint8Array(2)); * // => false */ var isBuffer = nativeIsBuffer || stubFalse_1; module.exports = isBuffer; }); /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/; /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { var type = typeof value; length = length == null ? MAX_SAFE_INTEGER : length; return !!length && (type == 'number' || (type != 'symbol' && reIsUint.test(value))) && (value > -1 && value % 1 == 0 && value < length); } var _isIndex = isIndex; /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER$1 = 9007199254740991; /** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1; } var isLength_1 = isLength; /** `Object#toString` result references. */ var argsTag$1 = '[object Arguments]', arrayTag = '[object Array]', boolTag$1 = '[object Boolean]', dateTag$1 = '[object Date]', errorTag$1 = '[object Error]', funcTag$1 = '[object Function]', mapTag$1 = '[object Map]', numberTag$1 = '[object Number]', objectTag = '[object Object]', regexpTag$1 = '[object RegExp]', setTag$1 = '[object Set]', stringTag$1 = '[object String]', weakMapTag = '[object WeakMap]'; var arrayBufferTag$1 = '[object ArrayBuffer]', dataViewTag$1 = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; /** Used to identify `toStringTag` values of typed arrays. */ var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag$1] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag$1] = typedArrayTags[boolTag$1] = typedArrayTags[dataViewTag$1] = typedArrayTags[dateTag$1] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$1] = typedArrayTags[numberTag$1] = typedArrayTags[objectTag] = typedArrayTags[regexpTag$1] = typedArrayTags[setTag$1] = typedArrayTags[stringTag$1] = typedArrayTags[weakMapTag] = false; /** * The base implementation of `_.isTypedArray` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. */ function baseIsTypedArray(value) { return isObjectLike_1(value) && isLength_1(value.length) && !!typedArrayTags[_baseGetTag(value)]; } var _baseIsTypedArray = baseIsTypedArray; /** * The base implementation of `_.unary` without support for storing metadata. * * @private * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. */ function baseUnary(func) { return function(value) { return func(value); }; } var _baseUnary = baseUnary; var _nodeUtil = createCommonjsModule(function (module, exports) { /** Detect free variable `exports`. */ var freeExports = exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** Detect free variable `process` from Node.js. */ var freeProcess = moduleExports && _freeGlobal.process; /** Used to access faster Node.js helpers. */ var nodeUtil = (function() { try { return freeProcess && freeProcess.binding && freeProcess.binding('util'); } catch (e) {} }()); module.exports = nodeUtil; }); /* Node.js helper references. */ var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray; /** * Checks if `value` is classified as a typed array. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. * @example * * _.isTypedArray(new Uint8Array); * // => true * * _.isTypedArray([]); * // => false */ var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray; var isTypedArray_1 = isTypedArray; /** Used for built-in method references. */ var objectProto$7 = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$6 = objectProto$7.hasOwnProperty; /** * Creates an array of the enumerable property names of the array-like `value`. * * @private * @param {*} value The value to query. * @param {boolean} inherited Specify returning inherited property names. * @returns {Array} Returns the array of property names. */ function arrayLikeKeys(value, inherited) { var isArr = isArray_1(value), isArg = !isArr && isArguments_1(value), isBuff = !isArr && !isArg && isBuffer_1(value), isType = !isArr && !isArg && !isBuff && isTypedArray_1(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? _baseTimes(value.length, String) : [], length = result.length; for (var key in value) { if ((inherited || hasOwnProperty$6.call(value, key)) && !(skipIndexes && ( // Safari 9 has enumerable `arguments.length` in strict mode. key == 'length' || // Node.js 0.10 has enumerable non-index properties on buffers. (isBuff && (key == 'offset' || key == 'parent')) || // PhantomJS 2 has enumerable non-index properties on typed arrays. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || // Skip index properties. _isIndex(key, length) ))) { result.push(key); } } return result; } var _arrayLikeKeys = arrayLikeKeys; /** Used for built-in method references. */ var objectProto$8 = Object.prototype; /** * Checks if `value` is likely a prototype object. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ function isPrototype(value) { var Ctor = value && value.constructor, proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$8; return value === proto; } var _isPrototype = isPrototype; /** * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } var _overArg = overArg; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeKeys = _overArg(Object.keys, Object); var _nativeKeys = nativeKeys; /** Used for built-in method references. */ var objectProto$9 = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$7 = objectProto$9.hasOwnProperty; /** * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeys(object) { if (!_isPrototype(object)) { return _nativeKeys(object); } var result = []; for (var key in Object(object)) { if (hasOwnProperty$7.call(object, key) && key != 'constructor') { result.push(key); } } return result; } var _baseKeys = baseKeys; /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * _.isArrayLike([1, 2, 3]); * // => true * * _.isArrayLike(document.body.children); * // => true * * _.isArrayLike('abc'); * // => true * * _.isArrayLike(_.noop); * // => false */ function isArrayLike(value) { return value != null && isLength_1(value.length) && !isFunction_1(value); } var isArrayLike_1 = isArrayLike; /** * Creates an array of the own enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. See the * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * for more details. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keys(new Foo); * // => ['a', 'b'] (iteration order is not guaranteed) * * _.keys('hi'); * // => ['0', '1'] */ function keys(object) { return isArrayLike_1(object) ? _arrayLikeKeys(object) : _baseKeys(object); } var keys_1 = keys; /** * Creates an array of own enumerable property names and symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names and symbols. */ function getAllKeys(object) { return _baseGetAllKeys(object, keys_1, _getSymbols); } var _getAllKeys = getAllKeys; /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG$2 = 1; /** Used for built-in method references. */ var objectProto$a = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$8 = objectProto$a.hasOwnProperty; /** * A specialized version of `baseIsEqualDeep` for objects with support for * partial deep comparisons. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2, objProps = _getAllKeys(object), objLength = objProps.length, othProps = _getAllKeys(other), othLength = othProps.length; if (objLength != othLength && !isPartial) { return false; } var index = objLength; while (index--) { var key = objProps[index]; if (!(isPartial ? key in other : hasOwnProperty$8.call(other, key))) { return false; } } // Assume cyclic values are equal. var stacked = stack.get(object); if (stacked && stack.get(other)) { return stacked == other; } var result = true; stack.set(object, other); stack.set(other, object); var skipCtor = isPartial; while (++index < objLength) { key = objProps[index]; var objValue = object[key], othValue = other[key]; if (customizer) { var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); } // Recursively compare objects (susceptible to call stack limits). if (!(compared === undefined ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) : compared )) { result = false; break; } skipCtor || (skipCtor = key == 'constructor'); } if (result && !skipCtor) { var objCtor = object.constructor, othCtor = other.constructor; // Non `Object` object instances with different constructors are not equal. if (objCtor != othCtor && ('constructor' in object && 'constructor' in other) && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) { result = false; } } stack['delete'](object); stack['delete'](other); return result; } var _equalObjects = equalObjects; /* Built-in method references that are verified to be native. */ var DataView = _getNative(_root, 'DataView'); var _DataView = DataView; /* Built-in method references that are verified to be native. */ var Promise$1 = _getNative(_root, 'Promise'); var _Promise = Promise$1; /* Built-in method references that are verified to be native. */ var Set = _getNative(_root, 'Set'); var _Set = Set; /* Built-in method references that are verified to be native. */ var WeakMap = _getNative(_root, 'WeakMap'); var _WeakMap = WeakMap; /** `Object#toString` result references. */ var mapTag$2 = '[object Map]', objectTag$1 = '[object Object]', promiseTag = '[object Promise]', setTag$2 = '[object Set]', weakMapTag$1 = '[object WeakMap]'; var dataViewTag$2 = '[object DataView]'; /** Used to detect maps, sets, and weakmaps. */ var dataViewCtorString = _toSource(_DataView), mapCtorString = _toSource(_Map), promiseCtorString = _toSource(_Promise), setCtorString = _toSource(_Set), weakMapCtorString = _toSource(_WeakMap); /** * Gets the `toStringTag` of `value`. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ var getTag = _baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. if ((_DataView && getTag(new _DataView(new ArrayBuffer(1))) != dataViewTag$2) || (_Map && getTag(new _Map) != mapTag$2) || (_Promise && getTag(_Promise.resolve()) != promiseTag) || (_Set && getTag(new _Set) != setTag$2) || (_WeakMap && getTag(new _WeakMap) != weakMapTag$1)) { getTag = function(value) { var result = _baseGetTag(value), Ctor = result == objectTag$1 ? value.constructor : undefined, ctorString = Ctor ? _toSource(Ctor) : ''; if (ctorString) { switch (ctorString) { case dataViewCtorString: return dataViewTag$2; case mapCtorString: return mapTag$2; case promiseCtorString: return promiseTag; case setCtorString: return setTag$2; case weakMapCtorString: return weakMapTag$1; } } return result; }; } var _getTag = getTag; /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG$3 = 1; /** `Object#toString` result references. */ var argsTag$2 = '[object Arguments]', arrayTag$1 = '[object Array]', objectTag$2 = '[object Object]'; /** Used for built-in method references. */ var objectProto$b = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$9 = objectProto$b.hasOwnProperty; /** * A specialized version of `baseIsEqual` for arrays and objects which performs * deep comparisons and tracks traversed objects enabling objects with circular * references to be compared. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} [stack] Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { var objIsArr = isArray_1(object), othIsArr = isArray_1(other), objTag = objIsArr ? arrayTag$1 : _getTag(object), othTag = othIsArr ? arrayTag$1 : _getTag(other); objTag = objTag == argsTag$2 ? objectTag$2 : objTag; othTag = othTag == argsTag$2 ? objectTag$2 : othTag; var objIsObj = objTag == objectTag$2, othIsObj = othTag == objectTag$2, isSameTag = objTag == othTag; if (isSameTag && isBuffer_1(object)) { if (!isBuffer_1(other)) { return false; } objIsArr = true; objIsObj = false; } if (isSameTag && !objIsObj) { stack || (stack = new _Stack); return (objIsArr || isTypedArray_1(object)) ? _equalArrays(object, other, bitmask, customizer, equalFunc, stack) : _equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); } if (!(bitmask & COMPARE_PARTIAL_FLAG$3)) { var objIsWrapped = objIsObj && hasOwnProperty$9.call(object, '__wrapped__'), othIsWrapped = othIsObj && hasOwnProperty$9.call(other, '__wrapped__'); if (objIsWrapped || othIsWrapped) { var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; stack || (stack = new _Stack); return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); } } if (!isSameTag) { return false; } stack || (stack = new _Stack); return _equalObjects(object, other, bitmask, customizer, equalFunc, stack); } var _baseIsEqualDeep = baseIsEqualDeep; /** * The base implementation of `_.isEqual` which supports partial comparisons * and tracks traversed objects. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {boolean} bitmask The bitmask flags. * 1 - Unordered comparison * 2 - Partial comparison * @param {Function} [customizer] The function to customize comparisons. * @param {Object} [stack] Tracks traversed `value` and `other` objects. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. */ function baseIsEqual(value, other, bitmask, customizer, stack) { if (value === other) { return true; } if (value == null || other == null || (!isObjectLike_1(value) && !isObjectLike_1(other))) { return value !== value && other !== other; } return _baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); } var _baseIsEqual = baseIsEqual; /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG$4 = 1, COMPARE_UNORDERED_FLAG$2 = 2; /** * The base implementation of `_.isMatch` without support for iteratee shorthands. * * @private * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @param {Array} matchData The property names, values, and compare flags to match. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if `object` is a match, else `false`. */ function baseIsMatch(object, source, matchData, customizer) { var index = matchData.length, length = index, noCustomizer = !customizer; if (object == null) { return !length; } object = Object(object); while (index--) { var data = matchData[index]; if ((noCustomizer && data[2]) ? data[1] !== object[data[0]] : !(data[0] in object) ) { return false; } } while (++index < length) { data = matchData[index]; var key = data[0], objValue = object[key], srcValue = data[1]; if (noCustomizer && data[2]) { if (objValue === undefined && !(key in object)) { return false; } } else { var stack = new _Stack; if (customizer) { var result = customizer(objValue, srcValue, key, object, source, stack); } if (!(result === undefined ? _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$4 | COMPARE_UNORDERED_FLAG$2, customizer, stack) : result )) { return false; } } } return true; } var _baseIsMatch = baseIsMatch; /** * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` if suitable for strict * equality comparisons, else `false`. */ function isStrictComparable(value) { return value === value && !isObject_1(value); } var _isStrictComparable = isStrictComparable; /** * Gets the property names, values, and compare flags of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the match data of `object`. */ function getMatchData(object) { var result = keys_1(object), length = result.length; while (length--) { var key = result[length], value = object[key]; result[length] = [key, value, _isStrictComparable(value)]; } return result; } var _getMatchData = getMatchData; /** * A specialized version of `matchesProperty` for source values suitable * for strict equality comparisons, i.e. `===`. * * @private * @param {string} key The key of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */ function matchesStrictComparable(key, srcValue) { return function(object) { if (object == null) { return false; } return object[key] === srcValue && (srcValue !== undefined || (key in Object(object))); }; } var _matchesStrictComparable = matchesStrictComparable; /** * The base implementation of `_.matches` which doesn't clone `source`. * * @private * @param {Object} source The object of property values to match. * @returns {Function} Returns the new spec function. */ function baseMatches(source) { var matchData = _getMatchData(source); if (matchData.length == 1 && matchData[0][2]) { return _matchesStrictComparable(matchData[0][0], matchData[0][1]); } return function(object) { return object === source || _baseIsMatch(object, source, matchData); }; } var _baseMatches = baseMatches; /** `Object#toString` result references. */ var symbolTag$1 = '[object Symbol]'; /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function isSymbol(value) { return typeof value == 'symbol' || (isObjectLike_1(value) && _baseGetTag(value) == symbolTag$1); } var isSymbol_1 = isSymbol; /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/; /** * Checks if `value` is a property name and not a property path. * * @private * @param {*} value The value to check. * @param {Object} [object] The object to query keys on. * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ function isKey(value, object) { if (isArray_1(value)) { return false; } var type = typeof value; if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol_1(value)) { return true; } return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || (object != null && value in Object(object)); } var _isKey = isKey; /** Error message constants. */ var FUNC_ERROR_TEXT = 'Expected a function'; /** * Creates a function that memoizes the result of `func`. If `resolver` is * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument * provided to the memoized function is used as the map cache key. The `func` * is invoked with the `this` binding of the memoized function. * * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` * constructor with one whose instances implement the * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) * method interface of `clear`, `delete`, `get`, `has`, and `set`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to have its output memoized. * @param {Function} [resolver] The function to resolve the cache key. * @returns {Function} Returns the new memoized function. * @example * * var object = { 'a': 1, 'b': 2 }; * var other = { 'c': 3, 'd': 4 }; * * var values = _.memoize(_.values); * values(object); * // => [1, 2] * * values(other); * // => [3, 4] * * object.a = 2; * values(object); * // => [1, 2] * * // Modify the result cache. * values.cache.set(object, ['a', 'b']); * values(object); * // => ['a', 'b'] * * // Replace `_.memoize.Cache`. * _.memoize.Cache = WeakMap; */ function memoize(func, resolver) { if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { throw new TypeError(FUNC_ERROR_TEXT); } var memoized = function() { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; if (cache.has(key)) { return cache.get(key); } var result = func.apply(this, args); memoized.cache = cache.set(key, result) || cache; return result; }; memoized.cache = new (memoize.Cache || _MapCache); return memoized; } // Expose `MapCache`. memoize.Cache = _MapCache; var memoize_1 = memoize; /** Used as the maximum memoize cache size. */ var MAX_MEMOIZE_SIZE = 500; /** * A specialized version of `_.memoize` which clears the memoized function's * cache when it exceeds `MAX_MEMOIZE_SIZE`. * * @private * @param {Function} func The function to have its output memoized. * @returns {Function} Returns the new memoized function. */ function memoizeCapped(func) { var result = memoize_1(func, function(key) { if (cache.size === MAX_MEMOIZE_SIZE) { cache.clear(); } return key; }); var cache = result.cache; return result; } var _memoizeCapped = memoizeCapped; /** Used to match property names within property paths. */ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g; /** * Converts `string` to a property path array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ var stringToPath = _memoizeCapped(function(string) { var result = []; if (string.charCodeAt(0) === 46 /* . */) { result.push(''); } string.replace(rePropName, function(match, number, quote, subString) { result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); }); return result; }); var _stringToPath = stringToPath; /** * A specialized version of `_.map` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function arrayMap(array, iteratee) { var index = -1, length = array == null ? 0 : array.length, result = Array(length); while (++index < length) { result[index] = iteratee(array[index], index, array); } return result; } var _arrayMap = arrayMap; /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; /** Used to convert symbols to primitives and strings. */ var symbolProto$1 = _Symbol ? _Symbol.prototype : undefined, symbolToString = symbolProto$1 ? symbolProto$1.toString : undefined; /** * The base implementation of `_.toString` which doesn't convert nullish * values to empty strings. * * @private * @param {*} value The value to process. * @returns {string} Returns the string. */ function baseToString(value) { // Exit early for strings to avoid a performance hit in some environments. if (typeof value == 'string') { return value; } if (isArray_1(value)) { // Recursively convert values (susceptible to call stack limits). return _arrayMap(value, baseToString) + ''; } if (isSymbol_1(value)) { return symbolToString ? symbolToString.call(value) : ''; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } var _baseToString = baseToString; /** * Converts `value` to a string. An empty string is returned for `null` * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {string} Returns the converted string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */ function toString(value) { return value == null ? '' : _baseToString(value); } var toString_1 = toString; /** * Casts `value` to a path array if it's not one. * * @private * @param {*} value The value to inspect. * @param {Object} [object] The object to query keys on. * @returns {Array} Returns the cast property path array. */ function castPath(value, object) { if (isArray_1(value)) { return value; } return _isKey(value, object) ? [value] : _stringToPath(toString_1(value)); } var _castPath = castPath; /** Used as references for various `Number` constants. */ var INFINITY$1 = 1 / 0; /** * Converts `value` to a string key if it's not a string or symbol. * * @private * @param {*} value The value to inspect. * @returns {string|symbol} Returns the key. */ function toKey(value) { if (typeof value == 'string' || isSymbol_1(value)) { return value; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result; } var _toKey = toKey; /** * The base implementation of `_.get` without support for default values. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @returns {*} Returns the resolved value. */ function baseGet(object, path) { path = _castPath(path, object); var index = 0, length = path.length; while (object != null && index < length) { object = object[_toKey(path[index++])]; } return (index && index == length) ? object : undefined; } var _baseGet = baseGet; /** * Gets the value at `path` of `object`. If the resolved value is * `undefined`, the `defaultValue` is returned in its place. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.get(object, 'a[0].b.c'); * // => 3 * * _.get(object, ['a', '0', 'b', 'c']); * // => 3 * * _.get(object, 'a.b.c', 'default'); * // => 'default' */ function get(object, path, defaultValue) { var result = object == null ? undefined : _baseGet(object, path); return result === undefined ? defaultValue : result; } var get_1 = get; /** * The base implementation of `_.hasIn` 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 baseHasIn(object, key) { return object != null && key in Object(object); } var _baseHasIn = baseHasIn; /** * Checks if `path` exists on `object`. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @param {Function} hasFunc The function to check properties. * @returns {boolean} Returns `true` if `path` exists, else `false`. */ function hasPath(object, path, hasFunc) { path = _castPath(path, object); var index = -1, length = path.length, result = false; while (++index < length) { var key = _toKey(path[index]); if (!(result = object != null && hasFunc(object, key))) { break; } object = object[key]; } if (result || ++index != length) { return result; } length = object == null ? 0 : object.length; return !!length && isLength_1(length) && _isIndex(key, length) && (isArray_1(object) || isArguments_1(object)); } var _hasPath = hasPath; /** * Checks if `path` is a direct or inherited property of `object`. * * @static * @memberOf _ * @since 4.0.0 * @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 = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.hasIn(object, 'a'); * // => true * * _.hasIn(object, 'a.b'); * // => true * * _.hasIn(object, ['a', 'b']); * // => true * * _.hasIn(object, 'b'); * // => false */ function hasIn(object, path) { return object != null && _hasPath(object, path, _baseHasIn); } var hasIn_1 = hasIn; /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG$5 = 1, COMPARE_UNORDERED_FLAG$3 = 2; /** * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. * * @private * @param {string} path The path of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */ function baseMatchesProperty(path, srcValue) { if (_isKey(path) && _isStrictComparable(srcValue)) { return _matchesStrictComparable(_toKey(path), srcValue); } return function(object) { var objValue = get_1(object, path); return (objValue === undefined && objValue === srcValue) ? hasIn_1(object, path) : _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$5 | COMPARE_UNORDERED_FLAG$3); }; } var _baseMatchesProperty = baseMatchesProperty; /** * This method returns the first argument it receives. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {*} value Any value. * @returns {*} Returns `value`. * @example * * var object = { 'a': 1 }; * * console.log(_.identity(object) === object); * // => true */ function identity(value) { return value; } var identity_1 = identity; /** * The base implementation of `_.property` without support for deep paths. * * @private * @param {string} key The key of the property to get. * @returns {Function} Returns the new accessor function. */ function baseProperty(key) { return function(object) { return object == null ? undefined : object[key]; }; } var _baseProperty = baseProperty; /** * A specialized version of `baseProperty` which supports deep paths. * * @private * @param {Array|string} path The path of the property to get. * @returns {Function} Returns the new accessor function. */ function basePropertyDeep(path) { return function(object) { return _baseGet(object, path); }; } var _basePropertyDeep = basePropertyDeep; /** * Creates a function that returns the value at `path` of a given object. * * @static * @memberOf _ * @since 2.4.0 * @category Util * @param {Array|string} path The path of the property to get. * @returns {Function} Returns the new accessor function. * @example * * var objects = [ * { 'a': { 'b': 2 } }, * { 'a': { 'b': 1 } } * ]; * * _.map(objects, _.property('a.b')); * // => [2, 1] * * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); * // => [1, 2] */ function property(path) { return _isKey(path) ? _baseProperty(_toKey(path)) : _basePropertyDeep(path); } var property_1 = property; /** * The base implementation of `_.iteratee`. * * @private * @param {*} [value=_.identity] The value to convert to an iteratee. * @returns {Function} Returns the iteratee. */ function baseIteratee(value) { // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. if (typeof value == 'function') { return value; } if (value == null) { return identity_1; } if (typeof value == 'object') { return isArray_1(value) ? _baseMatchesProperty(value[0], value[1]) : _baseMatches(value); } return property_1(value); } var _baseIteratee = baseIteratee; /** * Creates a `_.find` or `_.findLast` function. * * @private * @param {Function} findIndexFunc The function to find the collection index. * @returns {Function} Returns the new find function. */ function createFind(findIndexFunc) { return function(collection, predicate, fromIndex) { var iterable = Object(collection); if (!isArrayLike_1(collection)) { var iteratee = _baseIteratee(predicate, 3); collection = keys_1(collection); predicate = function(key) { return iteratee(iterable[key], key, iterable); }; } var index = findIndexFunc(collection, predicate, fromIndex); return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; }; } var _createFind = createFind; /** * The base implementation of `_.findIndex` and `_.findLastIndex` without * support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} predicate The function invoked per iteration. * @param {number} fromIndex The index to search from. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseFindIndex(array, predicate, fromIndex, fromRight) { var length = array.length, index = fromIndex + (fromRight ? 1 : -1); while ((fromRight ? index-- : ++index < length)) { if (predicate(array[index], index, array)) { return index; } } return -1; } var _baseFindIndex = baseFindIndex; /** Used as references for various `Number` constants. */ var NAN = 0 / 0; /** Used to match leading and trailing whitespace. */ var reTrim = /^\s+|\s+$/g; /** Used to detect bad signed hexadecimal string values. */ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; /** Used to detect binary string values. */ var reIsBinary = /^0b[01]+$/i; /** Used to detect octal string values. */ var reIsOctal = /^0o[0-7]+$/i; /** Built-in method references without a dependency on `root`. */ var freeParseInt = parseInt; /** * Converts `value` to a number. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {number} Returns the number. * @example * * _.toNumber(3.2); * // => 3.2 * * _.toNumber(Number.MIN_VALUE); * // => 5e-324 * * _.toNumber(Infinity); * // => Infinity * * _.toNumber('3.2'); * // => 3.2 */ function toNumber(value) { if (typeof value == 'number') { return value; } if (isSymbol_1(value)) { return NAN; } if (isObject_1(value)) { var other = typeof value.valueOf == 'function' ? value.valueOf() : value; value = isObject_1(other) ? (other + '') : other; } if (typeof value != 'string') { return value === 0 ? value : +value; } value = value.replace(reTrim, ''); var isBinary = reIsBinary.test(value); return (isBinary || reIsOctal.test(value)) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : (reIsBadHex.test(value) ? NAN : +value); } var toNumber_1 = toNumber; /** Used as references for various `Number` constants. */ var INFINITY$2 = 1 / 0, MAX_INTEGER = 1.7976931348623157e+308; /** * Converts `value` to a finite number. * * @static * @memberOf _ * @since 4.12.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted number. * @example * * _.toFinite(3.2); * // => 3.2 * * _.toFinite(Number.MIN_VALUE); * // => 5e-324 * * _.toFinite(Infinity); * // => 1.7976931348623157e+308 * * _.toFinite('3.2'); * // => 3.2 */ function toFinite(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber_1(value); if (value === INFINITY$2 || value === -INFINITY$2) { var sign = (value < 0 ? -1 : 1); return sign * MAX_INTEGER; } return value === value ? value : 0; } var toFinite_1 = toFinite; /** * Converts `value` to an integer. * * **Note:** This method is loosely based on * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toInteger(3.2); * // => 3 * * _.toInteger(Number.MIN_VALUE); * // => 0 * * _.toInteger(Infinity); * // => 1.7976931348623157e+308 * * _.toInteger('3.2'); * // => 3 */ function toInteger(value) { var result = toFinite_1(value), remainder = result % 1; return result === result ? (remainder ? result - remainder : result) : 0; } var toInteger_1 = toInteger; /* 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_1(fromIndex); if (index < 0) { index = nativeMax(length + index, 0); } return _baseFindIndex(array, _baseIteratee(predicate, 3), index); } var findIndex_1 = findIndex; /** * 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_1); var find_1 = find; /** `Object#toString` result references. */ var mapTag$3 = '[object Map]', setTag$3 = '[object Set]'; /** Used for built-in method references. */ var objectProto$c = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$a = objectProto$c.hasOwnProperty; /** * Checks if `value` is an empty object, collection, map, or set. * * Objects are considered empty if they have no own enumerable string keyed * properties. * * Array-like values such as `arguments` objects, arrays, buffers, strings, or * jQuery-like collections are considered empty if they have a `length` of `0`. * Similarly, maps and sets are considered empty if they have a `size` of `0`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is empty, else `false`. * @example * * _.isEmpty(null); * // => true * * _.isEmpty(true); * // => true * * _.isEmpty(1); * // => true * * _.isEmpty([1, 2, 3]); * // => false * * _.isEmpty({ 'a': 1 }); * // => false */ function isEmpty(value) { if (value == null) { return true; } if (isArrayLike_1(value) && (isArray_1(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer_1(value) || isTypedArray_1(value) || isArguments_1(value))) { return !value.length; } var tag = _getTag(value); if (tag == mapTag$3 || tag == setTag$3) { return !value.size; } if (_isPrototype(value)) { return !_baseKeys(value).length; } for (var key in value) { if (hasOwnProperty$a.call(value, key)) { return false; } } return true; } var isEmpty_1 = isEmpty; /** * A specialized version of `_.forEach` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEach(array, iteratee) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (iteratee(array[index], index, array) === false) { break; } } return array; } var _arrayEach = arrayEach; var defineProperty = (function() { try { var func = _getNative(Object, 'defineProperty'); func({}, '', {}); return func; } catch (e) {} }()); var _defineProperty = defineProperty; /** * The base implementation of `assignValue` and `assignMergeValue` without * value checks. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function baseAssignValue(object, key, value) { if (key == '__proto__' && _defineProperty) { _defineProperty(object, key, { 'configurable': true, 'enumerable': true, 'value': value, 'writable': true }); } else { object[key] = value; } } var _baseAssignValue = baseAssignValue; /** Used for built-in method references. */ var objectProto$d = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$b = objectProto$d.hasOwnProperty; /** * Assigns `value` to `key` of `object` if the existing value is not equivalent * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty$b.call(object, key) && eq_1(objValue, value)) || (value === undefined && !(key in object))) { _baseAssignValue(object, key, value); } } var _assignValue = assignValue; /** * Copies properties of `source` to `object`. * * @private * @param {Object} source The object to copy properties from. * @param {Array} props The property identifiers to copy. * @param {Object} [object={}] The object to copy properties to. * @param {Function} [customizer] The function to customize copied values. * @returns {Object} Returns `object`. */ function copyObject(source, props, object, customizer) { var isNew = !object; object || (object = {}); var index = -1, length = props.length; while (++index < length) { var key = props[index]; var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined; if (newValue === undefined) { newValue = source[key]; } if (isNew) { _baseAssignValue(object, key, newValue); } else { _assignValue(object, key, newValue); } } return object; } var _copyObject = copyObject; /** * The base implementation of `_.assign` without support for multiple sources * or `customizer` functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @returns {Object} Returns `object`. */ function baseAssign(object, source) { return object && _copyObject(source, keys_1(source), object); } var _baseAssign = baseAssign; /** * This function is like * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * except that it includes inherited enumerable properties. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function nativeKeysIn(object) { var result = []; if (object != null) { for (var key in Object(object)) { result.push(key); } } return result; } var _nativeKeysIn = nativeKeysIn; /** Used for built-in method references. */ var objectProto$e = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$c = objectProto$e.hasOwnProperty; /** * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeysIn(object) { if (!isObject_1(object)) { return _nativeKeysIn(object); } var isProto = _isPrototype(object), result = []; for (var key in object) { if (!(key == 'constructor' && (isProto || !hasOwnProperty$c.call(object, key)))) { result.push(key); } } return result; } var _baseKeysIn = baseKeysIn; /** * Creates an array of the own and inherited enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keysIn(new Foo); * // => ['a', 'b', 'c'] (iteration order is not guaranteed) */ function keysIn$1(object) { return isArrayLike_1(object) ? _arrayLikeKeys(object, true) : _baseKeysIn(object); } var keysIn_1 = keysIn$1; /** * The base implementation of `_.assignIn` without support for multiple sources * or `customizer` functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @returns {Object} Returns `object`. */ function baseAssignIn(object, source) { return object && _copyObject(source, keysIn_1(source), object); } var _baseAssignIn = baseAssignIn; var _cloneBuffer = createCommonjsModule(function (module, exports) { /** Detect free variable `exports`. */ var freeExports = exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** Built-in value references. */ var Buffer = moduleExports ? _root.Buffer : undefined, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; /** * Creates a clone of `buffer`. * * @private * @param {Buffer} buffer The buffer to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Buffer} Returns the cloned buffer. */ function cloneBuffer(buffer, isDeep) { if (isDeep) { return buffer.slice(); } var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); buffer.copy(result); return result; } module.exports = cloneBuffer; }); /** * Copies the values of `source` to `array`. * * @private * @param {Array} source The array to copy values from. * @param {Array} [array=[]] The array to copy values to. * @returns {Array} Returns `array`. */ function copyArray(source, array) { var index = -1, length = source.length; array || (array = Array(length)); while (++index < length) { array[index] = source[index]; } return array; } var _copyArray = copyArray; /** * Copies own symbols of `source` to `object`. * * @private * @param {Object} source The object to copy symbols from. * @param {Object} [object={}] The object to copy symbols to. * @returns {Object} Returns `object`. */ function copySymbols(source, object) { return _copyObject(source, _getSymbols(source), object); } var _copySymbols = copySymbols; /** Built-in value references. */ var getPrototype = _overArg(Object.getPrototypeOf, Object); var _getPrototype = getPrototype; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeGetSymbols$1 = Object.getOwnPropertySymbols; /** * Creates an array of the own and inherited enumerable symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ var getSymbolsIn = !nativeGetSymbols$1 ? stubArray_1 : function(object) { var result = []; while (object) { _arrayPush(result, _getSymbols(object)); object = _getPrototype(object); } return result; }; var _getSymbolsIn = getSymbolsIn; /** * Copies own and inherited symbols of `source` to `object`. * * @private * @param {Object} source The object to copy symbols from. * @param {Object} [object={}] The object to copy symbols to. * @returns {Object} Returns `object`. */ function copySymbolsIn(source, object) { return _copyObject(source, _getSymbolsIn(source), object); } var _copySymbolsIn = copySymbolsIn; /** * Creates an array of own and inherited enumerable property names and * symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names and symbols. */ function getAllKeysIn(object) { return _baseGetAllKeys(object, keysIn_1, _getSymbolsIn); } var _getAllKeysIn = getAllKeysIn; /** Used for built-in method references. */ var objectProto$f = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$d = objectProto$f.hasOwnProperty; /** * Initializes an array clone. * * @private * @param {Array} array The array to clone. * @returns {Array} Returns the initialized clone. */ function initCloneArray(array) { var length = array.length, result = new array.constructor(length); // Add properties assigned by `RegExp#exec`. if (length && typeof array[0] == 'string' && hasOwnProperty$d.call(array, 'index')) { result.index = array.index; result.input = array.input; } return result; } var _initCloneArray = initCloneArray; /** * Creates a clone of `arrayBuffer`. * * @private * @param {ArrayBuffer} arrayBuffer The array buffer to clone. * @returns {ArrayBuffer} Returns the cloned array buffer. */ function cloneArrayBuffer(arrayBuffer) { var result = new arrayBuffer.constructor(arrayBuffer.byteLength); new _Uint8Array(result).set(new _Uint8Array(arrayBuffer)); return result; } var _cloneArrayBuffer = cloneArrayBuffer; /** * Creates a clone of `dataView`. * * @private * @param {Object} dataView The data view to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned data view. */ function cloneDataView(dataView, isDeep) { var buffer = isDeep ? _cloneArrayBuffer(dataView.buffer) : dataView.buffer; return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); } var _cloneDataView = cloneDataView; /** Used to match `RegExp` flags from their coerced string values. */ var reFlags = /\w*$/; /** * Creates a clone of `regexp`. * * @private * @param {Object} regexp The regexp to clone. * @returns {Object} Returns the cloned regexp. */ function cloneRegExp(regexp) { var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); result.lastIndex = regexp.lastIndex; return result; } var _cloneRegExp = cloneRegExp; /** Used to convert symbols to primitives and strings. */ var symbolProto$2 = _Symbol ? _Symbol.prototype : undefined, symbolValueOf$1 = symbolProto$2 ? symbolProto$2.valueOf : undefined; /** * Creates a clone of the `symbol` object. * * @private * @param {Object} symbol The symbol object to clone. * @returns {Object} Returns the cloned symbol object. */ function cloneSymbol(symbol) { return symbolValueOf$1 ? Object(symbolValueOf$1.call(symbol)) : {}; } var _cloneSymbol = cloneSymbol; /** * Creates a clone of `typedArray`. * * @private * @param {Object} typedArray The typed array to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned typed array. */ function cloneTypedArray(typedArray, isDeep) { var buffer = isDeep ? _cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } var _cloneTypedArray = cloneTypedArray; /** `Object#toString` result references. */ var boolTag$2 = '[object Boolean]', dateTag$2 = '[object Date]', mapTag$4 = '[object Map]', numberTag$2 = '[object Number]', regexpTag$2 = '[object RegExp]', setTag$4 = '[object Set]', stringTag$2 = '[object String]', symbolTag$2 = '[object Symbol]'; var arrayBufferTag$2 = '[object ArrayBuffer]', dataViewTag$3 = '[object DataView]', float32Tag$1 = '[object Float32Array]', float64Tag$1 = '[object Float64Array]', int8Tag$1 = '[object Int8Array]', int16Tag$1 = '[object Int16Array]', int32Tag$1 = '[object Int32Array]', uint8Tag$1 = '[object Uint8Array]', uint8ClampedTag$1 = '[object Uint8ClampedArray]', uint16Tag$1 = '[object Uint16Array]', uint32Tag$1 = '[object Uint32Array]'; /** * Initializes an object clone based on its `toStringTag`. * * **Note:** This function only supports cloning values with tags of * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. * * @private * @param {Object} object The object to clone. * @param {string} tag The `toStringTag` of the object to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the initialized clone. */ function initCloneByTag(object, tag, isDeep) { var Ctor = object.constructor; switch (tag) { case arrayBufferTag$2: return _cloneArrayBuffer(object); case boolTag$2: case dateTag$2: return new Ctor(+object); case dataViewTag$3: return _cloneDataView(object, isDeep); case float32Tag$1: case float64Tag$1: case int8Tag$1: case int16Tag$1: case int32Tag$1: case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1: return _cloneTypedArray(object, isDeep); case mapTag$4: return new Ctor; case numberTag$2: case stringTag$2: return new Ctor(object); case regexpTag$2: return _cloneRegExp(object); case setTag$4: return new Ctor; case symbolTag$2: return _cloneSymbol(object); } } var _initCloneByTag = initCloneByTag; /** Built-in value references. */ var objectCreate = Object.create; /** * The base implementation of `_.create` without support for assigning * properties to the created object. * * @private * @param {Object} proto The object to inherit from. * @returns {Object} Returns the new object. */ var baseCreate = (function() { function object() {} return function(proto) { if (!isObject_1(proto)) { return {}; } if (objectCreate) { return objectCreate(proto); } object.prototype = proto; var result = new object; object.prototype = undefined; return result; }; }()); var _baseCreate = baseCreate; /** * Initializes an object clone. * * @private * @param {Object} object The object to clone. * @returns {Object} Returns the initialized clone. */ function initCloneObject(object) { return (typeof object.constructor == 'function' && !_isPrototype(object)) ? _baseCreate(_getPrototype(object)) : {}; } var _initCloneObject = initCloneObject; /** `Object#toString` result references. */ var mapTag$5 = '[object Map]'; /** * The base implementation of `_.isMap` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a map, else `false`. */ function baseIsMap(value) { return isObjectLike_1(value) && _getTag(value) == mapTag$5; } var _baseIsMap = baseIsMap; /* Node.js helper references. */ var nodeIsMap = _nodeUtil && _nodeUtil.isMap; /** * Checks if `value` is classified as a `Map` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a map, else `false`. * @example * * _.isMap(new Map); * // => true * * _.isMap(new WeakMap); * // => false */ var isMap = nodeIsMap ? _baseUnary(nodeIsMap) : _baseIsMap; var isMap_1 = isMap; /** `Object#toString` result references. */ var setTag$5 = '[object Set]'; /** * The base implementation of `_.isSet` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a set, else `false`. */ function baseIsSet(value) { return isObjectLike_1(value) && _getTag(value) == setTag$5; } var _baseIsSet = baseIsSet; /* Node.js helper references. */ var nodeIsSet = _nodeUtil && _nodeUtil.isSet; /** * Checks if `value` is classified as a `Set` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a set, else `false`. * @example * * _.isSet(new Set); * // => true * * _.isSet(new WeakSet); * // => false */ var isSet = nodeIsSet ? _baseUnary(nodeIsSet) : _baseIsSet; var isSet_1 = isSet; /** Used to compose bitmasks for cloning. */ var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4; /** `Object#toString` result references. */ var argsTag$3 = '[object Arguments]', funcTag$2 = '[object Function]', genTag$1 = '[object GeneratorFunction]', objectTag$3 = '[object Object]'; /** * The base implementation of `_.clone` and `_.cloneDeep` which tracks * traversed objects. * * @private * @param {*} value The value to clone. * @param {boolean} bitmask The bitmask flags. * 1 - Deep clone * 2 - Flatten inherited properties * 4 - Clone symbols * @param {Function} [customizer] The function to customize cloning. * @param {string} [key] The key of `value`. * @param {Object} [object] The parent object of `value`. * @param {Object} [stack] Tracks traversed objects and their clone counterparts. * @returns {*} Returns the cloned value. */ function baseClone(value, bitmask, customizer, key, object, stack) { var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG; if (customizer) { result = object ? customizer(value, key, object, stack) : customizer(value); } if (result !== undefined) { return result; } if (!isObject_1(value)) { return value; } var isArr = isArray_1(value); if (isArr) { result = _initCloneArray(value); if (!isDeep) { return _copyArray(value, result); } } else { var tag = _getTag(value), isFunc = tag == funcTag$2 || tag == genTag$1; if (isBuffer_1(value)) { return _cloneBuffer(value, isDeep); } if (tag == objectTag$3 || tag == argsTag$3 || (isFunc && !object)) { result = (isFlat || isFunc) ? {} : _initCloneObject(value); if (!isDeep) { return isFlat ? _copySymbolsIn(value, _baseAssignIn(result, value)) : _copySymbols(value, _baseAssign(result, value)); } } else { { return object ? value : {}; } result = _initCloneByTag(value, tag, isDeep); } } // Check for circular references and return its corresponding clone. stack || (stack = new _Stack); var stacked = stack.get(value); if (stacked) { return stacked; } stack.set(value, result); if (isSet_1(value)) { value.forEach(function(subValue) { result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); }); return result; } if (isMap_1(value)) { value.forEach(function(subValue, key) { result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); }); return result; } var keysFunc = isFull ? (isFlat ? _getAllKeysIn : _getAllKeys) : (isFlat ? keysIn : keys_1); var props = isArr ? undefined : keysFunc(value); _arrayEach(props || value, function(subValue, key) { if (props) { key = subValue; subValue = value[key]; } // Recursively populate clone (susceptible to call stack limits). _assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); }); return result; } var _baseClone = baseClone; /** * Gets the last element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @returns {*} Returns the last element of `array`. * @example * * _.last([1, 2, 3]); * // => 3 */ function last(array) { var length = array == null ? 0 : array.length; return length ? array[length - 1] : undefined; } var last_1 = last; /** * The base implementation of `_.slice` without an iteratee call guard. * * @private * @param {Array} array The array to slice. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. */ function baseSlice(array, start, end) { var index = -1, length = array.length; if (start < 0) { start = -start > length ? 0 : (length + start); } end = end > length ? length : end; if (end < 0) { end += length; } length = start > end ? 0 : ((end - start) >>> 0); start >>>= 0; var result = Array(length); while (++index < length) { result[index] = array[index + start]; } return result; } var _baseSlice = baseSlice; /** * Gets the parent value at `path` of `object`. * * @private * @param {Object} object The object to query. * @param {Array} path The path to get the parent value of. * @returns {*} Returns the parent value. */ function parent(object, path) { return path.length < 2 ? object : _baseGet(object, _baseSlice(path, 0, -1)); } var _parent = parent; /** * The base implementation of `_.unset`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The property path to unset. * @returns {boolean} Returns `true` if the property is deleted, else `false`. */ function baseUnset(object, path) { path = _castPath(path, object); object = _parent(object, path); return object == null || delete object[_toKey(last_1(path))]; } var _baseUnset = baseUnset; /** `Object#toString` result references. */ var objectTag$4 = '[object Object]'; /** Used for built-in method references. */ var funcProto$2 = Function.prototype, objectProto$g = Object.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString$2 = funcProto$2.toString; /** Used to check objects for own properties. */ var hasOwnProperty$e = objectProto$g.hasOwnProperty; /** Used to infer the `Object` constructor. */ var objectCtorString = funcToString$2.call(Object); /** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @static * @memberOf _ * @since 0.8.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * * function Foo() { * this.a = 1; * } * * _.isPlainObject(new Foo); * // => false * * _.isPlainObject([1, 2, 3]); * // => false * * _.isPlainObject({ 'x': 0, 'y': 0 }); * // => true * * _.isPlainObject(Object.create(null)); * // => true */ function isPlainObject(value) { if (!isObjectLike_1(value) || _baseGetTag(value) != objectTag$4) { return false; } var proto = _getPrototype(value); if (proto === null) { return true; } var Ctor = hasOwnProperty$e.call(proto, 'constructor') && proto.constructor; return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString$2.call(Ctor) == objectCtorString; } var isPlainObject_1 = isPlainObject; /** * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain * objects. * * @private * @param {*} value The value to inspect. * @param {string} key The key of the property to inspect. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. */ function customOmitClone(value) { return isPlainObject_1(value) ? undefined : value; } var _customOmitClone = customOmitClone; /** Built-in value references. */ var spreadableSymbol = _Symbol ? _Symbol.isConcatSpreadable : undefined; /** * Checks if `value` is a flattenable `arguments` object or array. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ function isFlattenable(value) { return isArray_1(value) || isArguments_1(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); } var _isFlattenable = isFlattenable; /** * The base implementation of `_.flatten` with support for restricting flattening. * * @private * @param {Array} array The array to flatten. * @param {number} depth The maximum recursion depth. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. * @param {Array} [result=[]] The initial result value. * @returns {Array} Returns the new flattened array. */ function baseFlatten(array, depth, predicate, isStrict, result) { var index = -1, length = array.length; predicate || (predicate = _isFlattenable); result || (result = []); while (++index < length) { var value = array[index]; if (depth > 0 && predicate(value)) { if (depth > 1) { // Recursively flatten arrays (susceptible to call stack limits). baseFlatten(value, depth - 1, predicate, isStrict, result); } else { _arrayPush(result, value); } } else if (!isStrict) { result[result.length] = value; } } return result; } var _baseFlatten = baseFlatten; /** * Flattens `array` a single level deep. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * * _.flatten([1, [2, [3, [4]], 5]]); * // => [1, 2, [3, [4]], 5] */ function flatten(array) { var length = array == null ? 0 : array.length; return length ? _baseFlatten(array, 1) : []; } var flatten_1 = flatten; /** * A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. * * @private * @param {Function} func The function to invoke. * @param {*} thisArg The `this` binding of `func`. * @param {Array} args The arguments to invoke `func` with. * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } var _apply = apply; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax$1 = Math.max; /** * A specialized version of `baseRest` which transforms the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @param {Function} transform The rest array transform. * @returns {Function} Returns the new function. */ function overRest(func, start, transform) { start = nativeMax$1(start === undefined ? (func.length - 1) : start, 0); return function() { var args = arguments, index = -1, length = nativeMax$1(args.length - start, 0), array = Array(length); while (++index < length) { array[index] = args[start + index]; } index = -1; var otherArgs = Array(start + 1); while (++index < start) { otherArgs[index] = args[index]; } otherArgs[start] = transform(array); return _apply(func, this, otherArgs); }; } var _overRest = overRest; /** * Creates a function that returns `value`. * * @static * @memberOf _ * @since 2.4.0 * @category Util * @param {*} value The value to return from the new function. * @returns {Function} Returns the new constant function. * @example * * var objects = _.times(2, _.constant({ 'a': 1 })); * * console.log(objects); * // => [{ 'a': 1 }, { 'a': 1 }] * * console.log(objects[0] === objects[1]); * // => true */ function constant(value) { return function() { return value; }; } var constant_1 = constant; /** * The base implementation of `setToString` without support for hot loop shorting. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var baseSetToString = !_defineProperty ? identity_1 : function(func, string) { return _defineProperty(func, 'toString', { 'configurable': true, 'enumerable': false, 'value': constant_1(string), 'writable': true }); }; var _baseSetToString = baseSetToString; /** Used to detect hot functions by number of calls within a span of milliseconds. */ var HOT_COUNT = 800, HOT_SPAN = 16; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeNow = Date.now; /** * Creates a function that'll short out and invoke `identity` instead * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` * milliseconds. * * @private * @param {Function} func The function to restrict. * @returns {Function} Returns the new shortable function. */ function shortOut(func) { var count = 0, lastCalled = 0; return function() { var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { if (++count >= HOT_COUNT) { return arguments[0]; } } else { count = 0; } return func.apply(undefined, arguments); }; } var _shortOut = shortOut; /** * Sets the `toString` method of `func` to return `string`. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var setToString = _shortOut(_baseSetToString); var _setToString = setToString; /** * A specialized version of `baseRest` which flattens the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @returns {Function} Returns the new function. */ function flatRest(func) { return _setToString(_overRest(func, undefined, flatten_1), func + ''); } var _flatRest = flatRest; /** Used to compose bitmasks for cloning. */ var CLONE_DEEP_FLAG$1 = 1, CLONE_FLAT_FLAG$1 = 2, CLONE_SYMBOLS_FLAG$1 = 4; /** * The opposite of `_.pick`; this method creates an object composed of the * own and inherited enumerable property paths of `object` that are not omitted. * * **Note:** This method is considerably slower than `_.pick`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. * @param {...(string|string[])} [paths] The property paths to omit. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.omit(object, ['a', 'c']); * // => { 'b': '2' } */ var omit = _flatRest(function(object, paths) { var result = {}; if (object == null) { return result; } var isDeep = false; paths = _arrayMap(paths, function(path) { path = _castPath(path, object); isDeep || (isDeep = path.length > 1); return path; }); _copyObject(object, _getAllKeysIn(object), result); if (isDeep) { result = _baseClone(result, CLONE_DEEP_FLAG$1 | CLONE_FLAT_FLAG$1 | CLONE_SYMBOLS_FLAG$1, _customOmitClone); } var length = paths.length; while (length--) { _baseUnset(result, paths[length]); } return result; }); var omit_1 = omit; /** * The base implementation of `_.isNaN` without support for number objects. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. */ function baseIsNaN(value) { return value !== value; } var _baseIsNaN = baseIsNaN; /** * A specialized version of `_.indexOf` which performs strict equality * comparisons of values, i.e. `===`. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function strictIndexOf(array, value, fromIndex) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (array[index] === value) { return index; } } return -1; } var _strictIndexOf = strictIndexOf; /** * The base implementation of `_.indexOf` without `fromIndex` bounds checks. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOf(array, value, fromIndex) { return value === value ? _strictIndexOf(array, value, fromIndex) : _baseFindIndex(array, _baseIsNaN, fromIndex); } var _baseIndexOf = baseIndexOf; /** * A specialized version of `_.includes` for arrays without support for * specifying an index to search from. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludes(array, value) { var length = array == null ? 0 : array.length; return !!length && _baseIndexOf(array, value, 0) > -1; } var _arrayIncludes = arrayIncludes; /** * This function is like `arrayIncludes` except that it accepts a comparator. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @param {Function} comparator The comparator invoked per element. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludesWith(array, value, comparator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (comparator(value, array[index])) { return true; } } return false; } var _arrayIncludesWith = arrayIncludesWith; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMin = Math.min; /** * The base implementation of methods like `_.intersection`, without support * for iteratee shorthands, that accepts an array of arrays to inspect. * * @private * @param {Array} arrays The arrays to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of shared values. */ function baseIntersection(arrays, iteratee, comparator) { var includes = comparator ? _arrayIncludesWith : _arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array(othLength), maxLength = Infinity, result = []; while (othIndex--) { var array = arrays[othIndex]; if (othIndex && iteratee) { array = _arrayMap(array, _baseUnary(iteratee)); } maxLength = nativeMin(array.length, maxLength); caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) ? new _SetCache(othIndex && array) : undefined; } array = arrays[0]; var index = -1, seen = caches[0]; outer: while (++index < length && result.length < maxLength) { var value = array[index], computed = iteratee ? iteratee(value) : value; value = (comparator || value !== 0) ? value : 0; if (!(seen ? _cacheHas(seen, computed) : includes(result, computed, comparator) )) { othIndex = othLength; while (--othIndex) { var cache = caches[othIndex]; if (!(cache ? _cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator)) ) { continue outer; } } if (seen) { seen.push(computed); } result.push(value); } } return result; } var _baseIntersection = baseIntersection; /** * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. */ function baseRest(func, start) { return _setToString(_overRest(func, start, identity_1), func + ''); } var _baseRest = baseRest; /** * This method is like `_.isArrayLike` except that it also checks if `value` * is an object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array-like object, * else `false`. * @example * * _.isArrayLikeObject([1, 2, 3]); * // => true * * _.isArrayLikeObject(document.body.children); * // => true * * _.isArrayLikeObject('abc'); * // => false * * _.isArrayLikeObject(_.noop); * // => false */ function isArrayLikeObject(value) { return isObjectLike_1(value) && isArrayLike_1(value); } var isArrayLikeObject_1 = isArrayLikeObject; /** * Casts `value` to an empty array if it's not an array like object. * * @private * @param {*} value The value to inspect. * @returns {Array|Object} Returns the cast array-like object. */ function castArrayLikeObject(value) { return isArrayLikeObject_1(value) ? value : []; } var _castArrayLikeObject = castArrayLikeObject; /** * Creates an array of unique values that are included in all given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order and references of result values are * determined by the first array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of intersecting values. * @example * * _.intersection([2, 1], [2, 3]); * // => [2] */ var intersection = _baseRest(function(arrays) { var mapped = _arrayMap(arrays, _castArrayLikeObject); return (mapped.length && mapped[0] === arrays[0]) ? _baseIntersection(mapped) : []; }); var intersection_1 = intersection; /** * Creates a base function for methods like `_.forIn` and `_.forOwn`. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseFor(fromRight) { return function(object, iteratee, keysFunc) { var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length; while (length--) { var key = props[fromRight ? length : ++index]; if (iteratee(iterable[key], key, iterable) === false) { break; } } return object; }; } var _createBaseFor = createBaseFor; /** * The base implementation of `baseForOwn` which iterates over `object` * properties returned by `keysFunc` and invokes `iteratee` for each property. * Iteratee functions may exit iteration early by explicitly returning `false`. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ var baseFor = _createBaseFor(); var _baseFor = baseFor; /** * The base implementation of `_.forOwn` without support for iteratee shorthands. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwn(object, iteratee) { return object && _baseFor(object, iteratee, keys_1); } var _baseForOwn = baseForOwn; /** * Casts `value` to `identity` if it's not a function. * * @private * @param {*} value The value to inspect. * @returns {Function} Returns cast function. */ function castFunction(value) { return typeof value == 'function' ? value : identity_1; } var _castFunction = castFunction; /** * Iterates over own enumerable string keyed properties of an object and * invokes `iteratee` for each property. The iteratee is invoked with three * arguments: (value, key, object). Iteratee functions may exit iteration * early by explicitly returning `false`. * * @static * @memberOf _ * @since 0.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forOwnRight * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forOwn(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forOwn(object, iteratee) { return object && _baseForOwn(object, _castFunction(iteratee)); } var forOwn_1 = forOwn; /** * Creates a `baseEach` or `baseEachRight` function. * * @private * @param {Function} eachFunc The function to iterate over a collection. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseEach(eachFunc, fromRight) { return function(collection, iteratee) { if (collection == null) { return collection; } if (!isArrayLike_1(collection)) { return eachFunc(collection, iteratee); } var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection); while ((fromRight ? index-- : ++index < length)) { if (iteratee(iterable[index], index, iterable) === false) { break; } } return collection; }; } var _createBaseEach = createBaseEach; /** * The base implementation of `_.forEach` 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|Object} Returns `collection`. */ var baseEach = _createBaseEach(_baseForOwn); var _baseEach = baseEach; /** * Iterates over elements of `collection` and invokes `iteratee` for each element. * The iteratee is invoked with three arguments: (value, index|key, collection). * Iteratee functions may exit iteration early by explicitly returning `false`. * * **Note:** As with other "Collections" methods, objects with a "length" * property are iterated like arrays. To avoid this behavior use `_.forIn` * or `_.forOwn` for object iteration. * * @static * @memberOf _ * @since 0.1.0 * @alias each * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array|Object} Returns `collection`. * @see _.forEachRight * @example * * _.forEach([1, 2], function(value) { * console.log(value); * }); * // => Logs `1` then `2`. * * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { * console.log(key); * }); * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forEach(collection, iteratee) { var func = isArray_1(collection) ? _arrayEach : _baseEach; return func(collection, _castFunction(iteratee)); } var forEach_1 = forEach; /** * 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; } var _baseFilter = baseFilter; /** * 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'] */ function filter(collection, predicate) { var func = isArray_1(collection) ? _arrayFilter : _baseFilter; return func(collection, _baseIteratee(predicate, 3)); } var filter_1 = filter; /** * 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_1(collection) ? Array(collection.length) : []; _baseEach(collection, function(value, key, collection) { result[++index] = iteratee(value, key, collection); }); return result; } var _baseMap = baseMap; /** * 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_1(collection) ? _arrayMap : _baseMap; return func(collection, _baseIteratee(iteratee, 3)); } var map_1 = map; /** * A specialized version of `_.reduce` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initAccum] Specify using the first element of `array` as * the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduce(array, iteratee, accumulator, initAccum) { var index = -1, length = array == null ? 0 : array.length; if (initAccum && length) { accumulator = array[++index]; } while (++index < length) { accumulator = iteratee(accumulator, array[index], index, array); } return accumulator; } var _arrayReduce = arrayReduce; /** * 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; } var _baseReduce = baseReduce; /** * 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_1(collection) ? _arrayReduce : _baseReduce, initAccum = arguments.length < 3; return func(collection, _baseIteratee(iteratee, 4), accumulator, initAccum, _baseEach); } var reduce_1 = reduce; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax$2 = Math.max; /** * Gets the index at which the first occurrence of `value` is found in `array` * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. If `fromIndex` is negative, it's used as the * offset from the end of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.indexOf([1, 2, 1, 2], 2); * // => 1 * * // Search from the `fromIndex`. * _.indexOf([1, 2, 1, 2], 2, 2); * // => 3 */ function indexOf(array, value, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = fromIndex == null ? 0 : toInteger_1(fromIndex); if (index < 0) { index = nativeMax$2(length + index, 0); } return _baseIndexOf(array, value, index); } var indexOf_1 = indexOf; /** `Object#toString` result references. */ var numberTag$4 = '[object Number]'; /** * Checks if `value` is classified as a `Number` primitive or object. * * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are * classified as numbers, use the `_.isFinite` method. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a number, else `false`. * @example * * _.isNumber(3); * // => true * * _.isNumber(Number.MIN_VALUE); * // => true * * _.isNumber(Infinity); * // => true * * _.isNumber('3'); * // => false */ function isNumber(value) { return typeof value == 'number' || (isObjectLike_1(value) && _baseGetTag(value) == numberTag$4); } var isNumber_1 = isNumber; /** * Checks if `value` is `NaN`. * * **Note:** This method is based on * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for * `undefined` and other non-number values. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. * @example * * _.isNaN(NaN); * // => true * * _.isNaN(new Number(NaN)); * // => true * * isNaN(undefined); * // => true * * _.isNaN(undefined); * // => false */ function isNaN$1(value) { // An `NaN` primitive is the only value that is not equal to itself. // Perform the `toStringTag` check first to avoid errors with some // ActiveX objects in IE. return isNumber_1(value) && value != +value; } var _isNaN = isNaN$1; /** * Performs a deep comparison between two values to determine if they are * equivalent. * * **Note:** This method supports comparing arrays, array buffers, booleans, * date objects, error objects, maps, numbers, `Object` objects, regexes, * sets, strings, symbols, and typed arrays. `Object` objects are compared * by their own, not inherited, enumerable properties. Functions and DOM * nodes are compared by strict equality, i.e. `===`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.isEqual(object, other); * // => true * * object === other; * // => false */ function isEqual(value, other) { return _baseIsEqual(value, other); } var isEqual_1 = isEqual; /** * Checks if `value` is `undefined`. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. * @example * * _.isUndefined(void 0); * // => true * * _.isUndefined(null); * // => false */ function isUndefined(value) { return value === undefined; } var isUndefined_1 = isUndefined; /** `Object#toString` result references. */ var stringTag$4 = '[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_1(value) && isObjectLike_1(value) && _baseGetTag(value) == stringTag$4); } var isString_1 = isString; /** * Casts `array` to a slice if it's needed. * * @private * @param {Array} array The array to inspect. * @param {number} start The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the cast slice. */ function castSlice(array, start, end) { var length = array.length; end = end === undefined ? length : end; return (!start && end >= length) ? array : _baseSlice(array, start, end); } var _castSlice = castSlice; /** * 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; } var _charsEndIndex = charsEndIndex; /** * 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; } var _charsStartIndex = charsStartIndex; /** * Converts an ASCII `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function asciiToArray(string) { return string.split(''); } var _asciiToArray = asciiToArray; /** Used to compose unicode character classes. */ var rsAstralRange = '\\ud800-\\udfff', rsComboMarksRange = '\\u0300-\\u036f', reComboHalfMarksRange = '\\ufe20-\\ufe2f', rsComboSymbolsRange = '\\u20d0-\\u20ff', rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsVarRange = '\\ufe0e\\ufe0f'; /** Used to compose unicode capture groups. */ var rsZWJ = '\\u200d'; /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); /** * Checks if `string` contains Unicode symbols. * * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a symbol is found, else `false`. */ function hasUnicode(string) { return reHasUnicode.test(string); } var _hasUnicode = hasUnicode; /** Used to compose unicode character classes. */ var rsAstralRange$1 = '\\ud800-\\udfff', rsComboMarksRange$1 = '\\u0300-\\u036f', reComboHalfMarksRange$1 = '\\ufe20-\\ufe2f', rsComboSymbolsRange$1 = '\\u20d0-\\u20ff', rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1, rsVarRange$1 = '\\ufe0e\\ufe0f'; /** Used to compose unicode capture groups. */ var rsAstral = '[' + rsAstralRange$1 + ']', rsCombo = '[' + rsComboRange$1 + ']', rsFitz = '\\ud83c[\\udffb-\\udfff]', rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', rsNonAstral = '[^' + rsAstralRange$1 + ']', rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', rsZWJ$1 = '\\u200d'; /** Used to compose unicode regexes. */ var reOptMod = rsModifier + '?', rsOptVar = '[' + rsVarRange$1 + ']?', rsOptJoin = '(?:' + rsZWJ$1 + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', rsSeq = rsOptVar + reOptMod + rsOptJoin, rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); /** * Converts a Unicode `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function unicodeToArray(string) { return string.match(reUnicode) || []; } var _unicodeToArray = unicodeToArray; /** * Converts `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function stringToArray(string) { return _hasUnicode(string) ? _unicodeToArray(string) : _asciiToArray(string); } var _stringToArray = stringToArray; /** Used to match leading and trailing whitespace. */ var reTrim$1 = /^\s+|\s+$/g; /** * 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_1(string); if (string && (guard || chars === undefined)) { return string.replace(reTrim$1, ''); } 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(''); } var trim_1 = trim; /** * Checks if the given arguments are from an iteratee call. * * @private * @param {*} value The potential iteratee value argument. * @param {*} index The potential iteratee index or key argument. * @param {*} object The potential iteratee object argument. * @returns {boolean} Returns `true` if the arguments are from an iteratee call, * else `false`. */ function isIterateeCall(value, index, object) { if (!isObject_1(object)) { return false; } var type = typeof index; if (type == 'number' ? (isArrayLike_1(object) && _isIndex(index, object.length)) : (type == 'string' && index in object) ) { return eq_1(object[index], value); } return false; } var _isIterateeCall = isIterateeCall; /** Used for built-in method references. */ var objectProto$h = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$f = objectProto$h.hasOwnProperty; /** * Assigns own and inherited enumerable string keyed properties of source * objects to the destination object for all destination properties that * resolve to `undefined`. Source objects are applied from left to right. * Once a property is set, additional values of the same property are ignored. * * **Note:** This method mutates `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.defaultsDeep * @example * * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var defaults = _baseRest(function(object, sources) { object = Object(object); var index = -1; var length = sources.length; var guard = length > 2 ? sources[2] : undefined; if (guard && _isIterateeCall(sources[0], sources[1], guard)) { length = 1; } while (++index < length) { var source = sources[index]; var props = keysIn_1(source); var propsIndex = -1; var propsLength = props.length; while (++propsIndex < propsLength) { var key = props[propsIndex]; var value = object[key]; if (value === undefined || (eq_1(value, objectProto$h[key]) && !hasOwnProperty$f.call(object, key))) { object[key] = source[key]; } } } return object; }); var defaults_1 = defaults; /** * This function is like `assignValue` except that it doesn't assign * `undefined` values. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignMergeValue(object, key, value) { if ((value !== undefined && !eq_1(object[key], value)) || (value === undefined && !(key in object))) { _baseAssignValue(object, key, value); } } var _assignMergeValue = assignMergeValue; /** * Gets the value at `key`, unless `key` is "__proto__". * * @private * @param {Object} object The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function safeGet(object, key) { return key == '__proto__' ? undefined : object[key]; } var _safeGet = safeGet; /** * Converts `value` to a plain object flattening inherited enumerable string * keyed properties of `value` to own properties of the plain object. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to convert. * @returns {Object} Returns the converted plain object. * @example * * function Foo() { * this.b = 2; * } * * Foo.prototype.c = 3; * * _.assign({ 'a': 1 }, new Foo); * // => { 'a': 1, 'b': 2 } * * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); * // => { 'a': 1, 'b': 2, 'c': 3 } */ function toPlainObject(value) { return _copyObject(value, keysIn_1(value)); } var toPlainObject_1 = toPlainObject; /** * A specialized version of `baseMerge` for arrays and objects which performs * deep merges and tracks traversed objects enabling objects with circular * references to be merged. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {string} key The key of the value to merge. * @param {number} srcIndex The index of `source`. * @param {Function} mergeFunc The function to merge values. * @param {Function} [customizer] The function to customize assigned values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { var objValue = _safeGet(object, key), srcValue = _safeGet(source, key), stacked = stack.get(srcValue); if (stacked) { _assignMergeValue(object, key, stacked); return; } var newValue = customizer ? customizer(objValue, srcValue, (key + ''), object, source, stack) : undefined; var isCommon = newValue === undefined; if (isCommon) { var isArr = isArray_1(srcValue), isBuff = !isArr && isBuffer_1(srcValue), isTyped = !isArr && !isBuff && isTypedArray_1(srcValue); newValue = srcValue; if (isArr || isBuff || isTyped) { if (isArray_1(objValue)) { newValue = objValue; } else if (isArrayLikeObject_1(objValue)) { newValue = _copyArray(objValue); } else if (isBuff) { isCommon = false; newValue = _cloneBuffer(srcValue, true); } else if (isTyped) { isCommon = false; newValue = _cloneTypedArray(srcValue, true); } else { newValue = []; } } else if (isPlainObject_1(srcValue) || isArguments_1(srcValue)) { newValue = objValue; if (isArguments_1(objValue)) { newValue = toPlainObject_1(objValue); } else if (!isObject_1(objValue) || (srcIndex && isFunction_1(objValue))) { newValue = _initCloneObject(srcValue); } } else { isCommon = false; } } if (isCommon) { // Recursively merge objects and arrays (susceptible to call stack limits). stack.set(srcValue, newValue); mergeFunc(newValue, srcValue, srcIndex, customizer, stack); stack['delete'](srcValue); } _assignMergeValue(object, key, newValue); } var _baseMergeDeep = baseMergeDeep; /** * The base implementation of `_.merge` without support for multiple sources. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {number} srcIndex The index of `source`. * @param {Function} [customizer] The function to customize merged values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } _baseFor(source, function(srcValue, key) { if (isObject_1(srcValue)) { stack || (stack = new _Stack); _baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { var newValue = customizer ? customizer(_safeGet(object, key), srcValue, (key + ''), object, source, stack) : undefined; if (newValue === undefined) { newValue = srcValue; } _assignMergeValue(object, key, newValue); } }, keysIn_1); } var _baseMerge = baseMerge; /** * Creates a function like `_.assign`. * * @private * @param {Function} assigner The function to assign values. * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { return _baseRest(function(object, sources) { var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined; customizer = (assigner.length > 3 && typeof customizer == 'function') ? (length--, customizer) : undefined; if (guard && _isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined : customizer; length = 1; } object = Object(object); while (++index < length) { var source = sources[index]; if (source) { assigner(object, source, index, customizer); } } return object; }); } var _createAssigner = createAssigner; /** * This method is like `_.assign` except that it recursively merges own and * inherited enumerable string keyed properties of source objects into the * destination object. Source properties that resolve to `undefined` are * skipped if a destination value exists. Array and plain object properties * are merged recursively. Other objects and value types are overridden by * assignment. Source objects are applied from left to right. Subsequent * sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 0.5.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @example * * var object = { * 'a': [{ 'b': 2 }, { 'd': 4 }] * }; * * var other = { * 'a': [{ 'c': 3 }, { 'e': 5 }] * }; * * _.merge(object, other); * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } */ var merge = _createAssigner(function(object, source, srcIndex) { _baseMerge(object, source, srcIndex); }); var merge_1 = merge; function valToNumber(v) { if (isNumber_1(v)) { return v; } else if (isString_1(v)) { return parseFloat(v); } else if (Array.isArray(v)) { return map_1(v, valToNumber); } throw new Error('The value should be a number, a parseable string or an array of those.'); } var valToNumber_1 = valToNumber; function filterState(state, filters) { var partialState = {}; var attributeFilters = filter_1(filters, function(f) { return f.indexOf('attribute:') !== -1; }); var attributes = map_1(attributeFilters, function(aF) { return aF.split(':')[1]; }); if (indexOf_1(attributes, '*') === -1) { forEach_1(attributes, function(attr) { if (state.isConjunctiveFacet(attr) && state.isFacetRefined(attr)) { if (!partialState.facetsRefinements) partialState.facetsRefinements = {}; partialState.facetsRefinements[attr] = state.facetsRefinements[attr]; } if (state.isDisjunctiveFacet(attr) && state.isDisjunctiveFacetRefined(attr)) { if (!partialState.disjunctiveFacetsRefinements) partialState.disjunctiveFacetsRefinements = {}; partialState.disjunctiveFacetsRefinements[attr] = state.disjunctiveFacetsRefinements[attr]; } if (state.isHierarchicalFacet(attr) && state.isHierarchicalFacetRefined(attr)) { if (!partialState.hierarchicalFacetsRefinements) partialState.hierarchicalFacetsRefinements = {}; partialState.hierarchicalFacetsRefinements[attr] = state.hierarchicalFacetsRefinements[attr]; } var numericRefinements = state.getNumericRefinements(attr); if (!isEmpty_1(numericRefinements)) { if (!partialState.numericRefinements) partialState.numericRefinements = {}; partialState.numericRefinements[attr] = state.numericRefinements[attr]; } }); } else { if (!isEmpty_1(state.numericRefinements)) { partialState.numericRefinements = state.numericRefinements; } if (!isEmpty_1(state.facetsRefinements)) partialState.facetsRefinements = state.facetsRefinements; if (!isEmpty_1(state.disjunctiveFacetsRefinements)) { partialState.disjunctiveFacetsRefinements = state.disjunctiveFacetsRefinements; } if (!isEmpty_1(state.hierarchicalFacetsRefinements)) { partialState.hierarchicalFacetsRefinements = state.hierarchicalFacetsRefinements; } } var searchParameters = filter_1( filters, function(f) { return f.indexOf('attribute:') === -1; } ); forEach_1( searchParameters, function(parameterKey) { partialState[parameterKey] = state[parameterKey]; } ); return partialState; } var filterState_1 = filterState; /** * Functions to manipulate refinement lists * * The RefinementList is not formally defined through a prototype but is based * on a specific structure. * * @module SearchParameters.refinementList * * @typedef {string[]} SearchParameters.refinementList.Refinements * @typedef {Object.<string, SearchParameters.refinementList.Refinements>} SearchParameters.refinementList.RefinementList */ var lib = { /** * Adds a refinement to a RefinementList * @param {RefinementList} refinementList the initial list * @param {string} attribute the attribute to refine * @param {string} value the value of the refinement, if the value is not a string it will be converted * @return {RefinementList} a new and updated refinement list */ addRefinement: function addRefinement(refinementList, attribute, value) { if (lib.isRefined(refinementList, attribute, value)) { return refinementList; } var valueAsString = '' + value; var facetRefinement = !refinementList[attribute] ? [valueAsString] : refinementList[attribute].concat(valueAsString); var mod = {}; mod[attribute] = facetRefinement; return defaults_1({}, mod, refinementList); }, /** * Removes refinement(s) for an attribute: * - if the value is specified removes the refinement for the value on the attribute * - if no value is specified removes all the refinements for this attribute * @param {RefinementList} refinementList the initial list * @param {string} attribute the attribute to refine * @param {string} [value] the value of the refinement * @return {RefinementList} a new and updated refinement lst */ removeRefinement: function removeRefinement(refinementList, attribute, value) { if (isUndefined_1(value)) { return lib.clearRefinement(refinementList, attribute); } var valueAsString = '' + value; return lib.clearRefinement(refinementList, function(v, f) { return attribute === f && valueAsString === v; }); }, /** * Toggles the refinement value for an attribute. * @param {RefinementList} refinementList the initial list * @param {string} attribute the attribute to refine * @param {string} value the value of the refinement * @return {RefinementList} a new and updated list */ toggleRefinement: function toggleRefinement(refinementList, attribute, value) { if (isUndefined_1(value)) throw new Error('toggleRefinement should be used with a value'); if (lib.isRefined(refinementList, attribute, value)) { return lib.removeRefinement(refinementList, attribute, value); } return lib.addRefinement(refinementList, attribute, value); }, /** * Clear all or parts of a RefinementList. Depending on the arguments, three * kinds of behavior can happen: * - if no attribute is provided: clears the whole list * - if an attribute is provided as a string: clears the list for the specific attribute * - if an attribute is provided as a function: discards the elements for which the function returns true * @param {RefinementList} refinementList the initial list * @param {string} [attribute] the attribute or function to discard * @param {string} [refinementType] optional parameter to give more context to the attribute function * @return {RefinementList} a new and updated refinement list */ clearRefinement: function clearRefinement(refinementList, attribute, refinementType) { if (isUndefined_1(attribute)) { if (isEmpty_1(refinementList)) return refinementList; return {}; } else if (isString_1(attribute)) { if (isEmpty_1(refinementList[attribute])) return refinementList; return omit_1(refinementList, attribute); } else if (isFunction_1(attribute)) { var hasChanged = false; var newRefinementList = reduce_1(refinementList, function(memo, values, key) { var facetList = filter_1(values, function(value) { return !attribute(value, key, refinementType); }); if (!isEmpty_1(facetList)) { if (facetList.length !== values.length) hasChanged = true; memo[key] = facetList; } else hasChanged = true; return memo; }, {}); if (hasChanged) return newRefinementList; return refinementList; } }, /** * Test if the refinement value is used for the attribute. If no refinement value * is provided, test if the refinementList contains any refinement for the * given attribute. * @param {RefinementList} refinementList the list of refinement * @param {string} attribute name of the attribute * @param {string} [refinementValue] value of the filter/refinement * @return {boolean} */ isRefined: function isRefined(refinementList, attribute, refinementValue) { var indexOf = indexOf_1; var containsRefinements = !!refinementList[attribute] && refinementList[attribute].length > 0; if (isUndefined_1(refinementValue) || !containsRefinements) { return containsRefinements; } var refinementValueAsString = '' + refinementValue; return indexOf(refinementList[attribute], refinementValueAsString) !== -1; } }; var RefinementList = lib; /** * like _.find but using _.isEqual to be able to use it * to find arrays. * @private * @param {any[]} array array to search into * @param {any} searchedValue the value we're looking for * @return {any} the searched value or undefined */ function findArray(array, searchedValue) { return find_1(array, function(currentValue) { return isEqual_1(currentValue, searchedValue); }); } /** * The facet list is the structure used to store the list of values used to * filter a single attribute. * @typedef {string[]} SearchParameters.FacetList */ /** * Structure to store numeric filters with the operator as the key. The supported operators * are `=`, `>`, `<`, `>=`, `<=` and `!=`. * @typedef {Object.<string, Array.<number|number[]>>} SearchParameters.OperatorList */ /** * SearchParameters is the data structure that contains all the information * usable for making a search to Algolia API. It doesn't do the search itself, * nor does it contains logic about the parameters. * It is an immutable object, therefore it has been created in a way that each * changes does not change the object itself but returns a copy with the * modification. * This object should probably not be instantiated outside of the helper. It will * be provided when needed. This object is documented for reference as you'll * get it from events generated by the {@link AlgoliaSearchHelper}. * If need be, instantiate the Helper from the factory function {@link SearchParameters.make} * @constructor * @classdesc contains all the parameters of a search * @param {object|SearchParameters} newParameters existing parameters or partial object * for the properties of a new SearchParameters * @see SearchParameters.make * @example <caption>SearchParameters of the first query in * <a href="http://demos.algolia.com/instant-search-demo/">the instant search demo</a></caption> { "query": "", "disjunctiveFacets": [ "customerReviewCount", "category", "salePrice_range", "manufacturer" ], "maxValuesPerFacet": 30, "page": 0, "hitsPerPage": 10, "facets": [ "type", "shipping" ] } */ function SearchParameters(newParameters) { var params = newParameters ? SearchParameters._parseNumbers(newParameters) : {}; /** * Targeted index. This parameter is mandatory. * @member {string} */ this.index = params.index || ''; // Query /** * Query string of the instant search. The empty string is a valid query. * @member {string} * @see https://www.algolia.com/doc/rest#param-query */ this.query = params.query || ''; // Facets /** * This attribute contains the list of all the conjunctive facets * used. This list will be added to requested facets in the * [facets attribute](https://www.algolia.com/doc/rest-api/search#param-facets) sent to algolia. * @member {string[]} */ this.facets = params.facets || []; /** * This attribute contains the list of all the disjunctive facets * used. This list will be added to requested facets in the * [facets attribute](https://www.algolia.com/doc/rest-api/search#param-facets) sent to algolia. * @member {string[]} */ this.disjunctiveFacets = params.disjunctiveFacets || []; /** * This attribute contains the list of all the hierarchical facets * used. This list will be added to requested facets in the * [facets attribute](https://www.algolia.com/doc/rest-api/search#param-facets) sent to algolia. * Hierarchical facets are a sub type of disjunctive facets that * let you filter faceted attributes hierarchically. * @member {string[]|object[]} */ this.hierarchicalFacets = params.hierarchicalFacets || []; // Refinements /** * This attribute contains all the filters that need to be * applied on the conjunctive facets. Each facet must be properly * defined in the `facets` attribute. * * The key is the name of the facet, and the `FacetList` contains all * filters selected for the associated facet name. * * When querying algolia, the values stored in this attribute will * be translated into the `facetFilters` attribute. * @member {Object.<string, SearchParameters.FacetList>} */ this.facetsRefinements = params.facetsRefinements || {}; /** * This attribute contains all the filters that need to be * excluded from the conjunctive facets. Each facet must be properly * defined in the `facets` attribute. * * The key is the name of the facet, and the `FacetList` contains all * filters excluded for the associated facet name. * * When querying algolia, the values stored in this attribute will * be translated into the `facetFilters` attribute. * @member {Object.<string, SearchParameters.FacetList>} */ this.facetsExcludes = params.facetsExcludes || {}; /** * This attribute contains all the filters that need to be * applied on the disjunctive facets. Each facet must be properly * defined in the `disjunctiveFacets` attribute. * * The key is the name of the facet, and the `FacetList` contains all * filters selected for the associated facet name. * * When querying algolia, the values stored in this attribute will * be translated into the `facetFilters` attribute. * @member {Object.<string, SearchParameters.FacetList>} */ this.disjunctiveFacetsRefinements = params.disjunctiveFacetsRefinements || {}; /** * This attribute contains all the filters that need to be * applied on the numeric attributes. * * The key is the name of the attribute, and the value is the * filters to apply to this attribute. * * When querying algolia, the values stored in this attribute will * be translated into the `numericFilters` attribute. * @member {Object.<string, SearchParameters.OperatorList>} */ this.numericRefinements = params.numericRefinements || {}; /** * This attribute contains all the tags used to refine the query. * * When querying algolia, the values stored in this attribute will * be translated into the `tagFilters` attribute. * @member {string[]} */ this.tagRefinements = params.tagRefinements || []; /** * This attribute contains all the filters that need to be * applied on the hierarchical facets. Each facet must be properly * defined in the `hierarchicalFacets` attribute. * * The key is the name of the facet, and the `FacetList` contains all * filters selected for the associated facet name. The FacetList values * are structured as a string that contain the values for each level * separated by the configured separator. * * When querying algolia, the values stored in this attribute will * be translated into the `facetFilters` attribute. * @member {Object.<string, SearchParameters.FacetList>} */ this.hierarchicalFacetsRefinements = params.hierarchicalFacetsRefinements || {}; /** * Contains the numeric filters in the raw format of the Algolia API. Setting * this parameter is not compatible with the usage of numeric filters methods. * @see https://www.algolia.com/doc/javascript#numericFilters * @member {string} */ this.numericFilters = params.numericFilters; /** * Contains the tag filters in the raw format of the Algolia API. Setting this * parameter is not compatible with the of the add/remove/toggle methods of the * tag api. * @see https://www.algolia.com/doc/rest#param-tagFilters * @member {string} */ this.tagFilters = params.tagFilters; /** * Contains the optional tag filters in the raw format of the Algolia API. * @see https://www.algolia.com/doc/rest#param-tagFilters * @member {string} */ this.optionalTagFilters = params.optionalTagFilters; /** * Contains the optional facet filters in the raw format of the Algolia API. * @see https://www.algolia.com/doc/rest#param-tagFilters * @member {string} */ this.optionalFacetFilters = params.optionalFacetFilters; // Misc. parameters /** * Number of hits to be returned by the search API * @member {number} * @see https://www.algolia.com/doc/rest#param-hitsPerPage */ this.hitsPerPage = params.hitsPerPage; /** * Number of values for each faceted attribute * @member {number} * @see https://www.algolia.com/doc/rest#param-maxValuesPerFacet */ this.maxValuesPerFacet = params.maxValuesPerFacet; /** * The current page number * @member {number} * @see https://www.algolia.com/doc/rest#param-page */ this.page = params.page || 0; /** * How the query should be treated by the search engine. * Possible values: prefixAll, prefixLast, prefixNone * @see https://www.algolia.com/doc/rest#param-queryType * @member {string} */ this.queryType = params.queryType; /** * How the typo tolerance behave in the search engine. * Possible values: true, false, min, strict * @see https://www.algolia.com/doc/rest#param-typoTolerance * @member {string} */ this.typoTolerance = params.typoTolerance; /** * Number of characters to wait before doing one character replacement. * @see https://www.algolia.com/doc/rest#param-minWordSizefor1Typo * @member {number} */ this.minWordSizefor1Typo = params.minWordSizefor1Typo; /** * Number of characters to wait before doing a second character replacement. * @see https://www.algolia.com/doc/rest#param-minWordSizefor2Typos * @member {number} */ this.minWordSizefor2Typos = params.minWordSizefor2Typos; /** * Configure the precision of the proximity ranking criterion * @see https://www.algolia.com/doc/rest#param-minProximity */ this.minProximity = params.minProximity; /** * Should the engine allow typos on numerics. * @see https://www.algolia.com/doc/rest#param-allowTyposOnNumericTokens * @member {boolean} */ this.allowTyposOnNumericTokens = params.allowTyposOnNumericTokens; /** * Should the plurals be ignored * @see https://www.algolia.com/doc/rest#param-ignorePlurals * @member {boolean} */ this.ignorePlurals = params.ignorePlurals; /** * Restrict which attribute is searched. * @see https://www.algolia.com/doc/rest#param-restrictSearchableAttributes * @member {string} */ this.restrictSearchableAttributes = params.restrictSearchableAttributes; /** * Enable the advanced syntax. * @see https://www.algolia.com/doc/rest#param-advancedSyntax * @member {boolean} */ this.advancedSyntax = params.advancedSyntax; /** * Enable the analytics * @see https://www.algolia.com/doc/rest#param-analytics * @member {boolean} */ this.analytics = params.analytics; /** * Tag of the query in the analytics. * @see https://www.algolia.com/doc/rest#param-analyticsTags * @member {string} */ this.analyticsTags = params.analyticsTags; /** * Enable the synonyms * @see https://www.algolia.com/doc/rest#param-synonyms * @member {boolean} */ this.synonyms = params.synonyms; /** * Should the engine replace the synonyms in the highlighted results. * @see https://www.algolia.com/doc/rest#param-replaceSynonymsInHighlight * @member {boolean} */ this.replaceSynonymsInHighlight = params.replaceSynonymsInHighlight; /** * Add some optional words to those defined in the dashboard * @see https://www.algolia.com/doc/rest#param-optionalWords * @member {string} */ this.optionalWords = params.optionalWords; /** * Possible values are "lastWords" "firstWords" "allOptional" "none" (default) * @see https://www.algolia.com/doc/rest#param-removeWordsIfNoResults * @member {string} */ this.removeWordsIfNoResults = params.removeWordsIfNoResults; /** * List of attributes to retrieve * @see https://www.algolia.com/doc/rest#param-attributesToRetrieve * @member {string} */ this.attributesToRetrieve = params.attributesToRetrieve; /** * List of attributes to highlight * @see https://www.algolia.com/doc/rest#param-attributesToHighlight * @member {string} */ this.attributesToHighlight = params.attributesToHighlight; /** * Code to be embedded on the left part of the highlighted results * @see https://www.algolia.com/doc/rest#param-highlightPreTag * @member {string} */ this.highlightPreTag = params.highlightPreTag; /** * Code to be embedded on the right part of the highlighted results * @see https://www.algolia.com/doc/rest#param-highlightPostTag * @member {string} */ this.highlightPostTag = params.highlightPostTag; /** * List of attributes to snippet * @see https://www.algolia.com/doc/rest#param-attributesToSnippet * @member {string} */ this.attributesToSnippet = params.attributesToSnippet; /** * Enable the ranking informations in the response, set to 1 to activate * @see https://www.algolia.com/doc/rest#param-getRankingInfo * @member {number} */ this.getRankingInfo = params.getRankingInfo; /** * Remove duplicates based on the index setting attributeForDistinct * @see https://www.algolia.com/doc/rest#param-distinct * @member {boolean|number} */ this.distinct = params.distinct; /** * Center of the geo search. * @see https://www.algolia.com/doc/rest#param-aroundLatLng * @member {string} */ this.aroundLatLng = params.aroundLatLng; /** * Center of the search, retrieve from the user IP. * @see https://www.algolia.com/doc/rest#param-aroundLatLngViaIP * @member {boolean} */ this.aroundLatLngViaIP = params.aroundLatLngViaIP; /** * Radius of the geo search. * @see https://www.algolia.com/doc/rest#param-aroundRadius * @member {number} */ this.aroundRadius = params.aroundRadius; /** * Precision of the geo search. * @see https://www.algolia.com/doc/rest#param-aroundPrecision * @member {number} */ this.minimumAroundRadius = params.minimumAroundRadius; /** * Precision of the geo search. * @see https://www.algolia.com/doc/rest#param-minimumAroundRadius * @member {number} */ this.aroundPrecision = params.aroundPrecision; /** * Geo search inside a box. * @see https://www.algolia.com/doc/rest#param-insideBoundingBox * @member {string} */ this.insideBoundingBox = params.insideBoundingBox; /** * Geo search inside a polygon. * @see https://www.algolia.com/doc/rest#param-insidePolygon * @member {string} */ this.insidePolygon = params.insidePolygon; /** * Allows to specify an ellipsis character for the snippet when we truncate the text * (added before and after if truncated). * The default value is an empty string and we recommend to set it to "…" * @see https://www.algolia.com/doc/rest#param-insidePolygon * @member {string} */ this.snippetEllipsisText = params.snippetEllipsisText; /** * Allows to specify some attributes name on which exact won't be applied. * Attributes are separated with a comma (for example "name,address" ), you can also use a * JSON string array encoding (for example encodeURIComponent('["name","address"]') ). * By default the list is empty. * @see https://www.algolia.com/doc/rest#param-disableExactOnAttributes * @member {string|string[]} */ this.disableExactOnAttributes = params.disableExactOnAttributes; /** * Applies 'exact' on single word queries if the word contains at least 3 characters * and is not a stop word. * Can take two values: true or false. * By default, its set to false. * @see https://www.algolia.com/doc/rest#param-enableExactOnSingleWordQuery * @member {boolean} */ this.enableExactOnSingleWordQuery = params.enableExactOnSingleWordQuery; // Undocumented parameters, still needed otherwise we fail this.offset = params.offset; this.length = params.length; var self = this; forOwn_1(params, function checkForUnknownParameter(paramValue, paramName) { if (SearchParameters.PARAMETERS.indexOf(paramName) === -1) { self[paramName] = paramValue; } }); } /** * List all the properties in SearchParameters and therefore all the known Algolia properties * This doesn't contain any beta/hidden features. * @private */ SearchParameters.PARAMETERS = keys_1(new SearchParameters()); /** * @private * @param {object} partialState full or part of a state * @return {object} a new object with the number keys as number */ SearchParameters._parseNumbers = function(partialState) { // Do not reparse numbers in SearchParameters, they ought to be parsed already if (partialState instanceof SearchParameters) return partialState; var numbers = {}; var numberKeys = [ 'aroundPrecision', 'aroundRadius', 'getRankingInfo', 'minWordSizefor2Typos', 'minWordSizefor1Typo', 'page', 'maxValuesPerFacet', 'distinct', 'minimumAroundRadius', 'hitsPerPage', 'minProximity' ]; forEach_1(numberKeys, function(k) { var value = partialState[k]; if (isString_1(value)) { var parsedValue = parseFloat(value); numbers[k] = _isNaN(parsedValue) ? value : parsedValue; } }); // there's two formats of insideBoundingBox, we need to parse // the one which is an array of float geo rectangles if (Array.isArray(partialState.insideBoundingBox)) { numbers.insideBoundingBox = partialState.insideBoundingBox.map(function(geoRect) { return geoRect.map(function(value) { return parseFloat(value); }); }); } if (partialState.numericRefinements) { var numericRefinements = {}; forEach_1(partialState.numericRefinements, function(operators, attribute) { numericRefinements[attribute] = {}; forEach_1(operators, function(values, operator) { var parsedValues = map_1(values, function(v) { if (Array.isArray(v)) { return map_1(v, function(vPrime) { if (isString_1(vPrime)) { return parseFloat(vPrime); } return vPrime; }); } else if (isString_1(v)) { return parseFloat(v); } return v; }); numericRefinements[attribute][operator] = parsedValues; }); }); numbers.numericRefinements = numericRefinements; } return merge_1({}, partialState, numbers); }; /** * Factory for SearchParameters * @param {object|SearchParameters} newParameters existing parameters or partial * object for the properties of a new SearchParameters * @return {SearchParameters} frozen instance of SearchParameters */ SearchParameters.make = function makeSearchParameters(newParameters) { var instance = new SearchParameters(newParameters); forEach_1(newParameters.hierarchicalFacets, function(facet) { if (facet.rootPath) { var currentRefinement = instance.getHierarchicalRefinement(facet.name); if (currentRefinement.length > 0 && currentRefinement[0].indexOf(facet.rootPath) !== 0) { instance = instance.clearRefinements(facet.name); } // get it again in case it has been cleared currentRefinement = instance.getHierarchicalRefinement(facet.name); if (currentRefinement.length === 0) { instance = instance.toggleHierarchicalFacetRefinement(facet.name, facet.rootPath); } } }); return instance; }; /** * Validates the new parameters based on the previous state * @param {SearchParameters} currentState the current state * @param {object|SearchParameters} parameters the new parameters to set * @return {Error|null} Error if the modification is invalid, null otherwise */ SearchParameters.validate = function(currentState, parameters) { var params = parameters || {}; if (currentState.tagFilters && params.tagRefinements && params.tagRefinements.length > 0) { return new Error( '[Tags] Cannot switch from the managed tag API to the advanced API. It is probably ' + 'an error, if it is really what you want, you should first clear the tags with clearTags method.'); } if (currentState.tagRefinements.length > 0 && params.tagFilters) { return new Error( '[Tags] Cannot switch from the advanced tag API to the managed API. It is probably ' + 'an error, if it is not, you should first clear the tags with clearTags method.'); } if (currentState.numericFilters && params.numericRefinements && !isEmpty_1(params.numericRefinements)) { return new Error( "[Numeric filters] Can't switch from the advanced to the managed API. It" + ' is probably an error, if this is really what you want, you have to first' + ' clear the numeric filters.'); } if (!isEmpty_1(currentState.numericRefinements) && params.numericFilters) { return new Error( "[Numeric filters] Can't switch from the managed API to the advanced. It" + ' is probably an error, if this is really what you want, you have to first' + ' clear the numeric filters.'); } return null; }; SearchParameters.prototype = { constructor: SearchParameters, /** * Remove all refinements (disjunctive + conjunctive + excludes + numeric filters) * @method * @param {undefined|string|SearchParameters.clearCallback} [attribute] optional string or function * - If not given, means to clear all the filters. * - If `string`, means to clear all refinements for the `attribute` named filter. * - If `function`, means to clear all the refinements that return truthy values. * @return {SearchParameters} */ clearRefinements: function clearRefinements(attribute) { var clear = RefinementList.clearRefinement; var patch = { numericRefinements: this._clearNumericRefinements(attribute), facetsRefinements: clear(this.facetsRefinements, attribute, 'conjunctiveFacet'), facetsExcludes: clear(this.facetsExcludes, attribute, 'exclude'), disjunctiveFacetsRefinements: clear(this.disjunctiveFacetsRefinements, attribute, 'disjunctiveFacet'), hierarchicalFacetsRefinements: clear(this.hierarchicalFacetsRefinements, attribute, 'hierarchicalFacet') }; if (patch.numericRefinements === this.numericRefinements && patch.facetsRefinements === this.facetsRefinements && patch.facetsExcludes === this.facetsExcludes && patch.disjunctiveFacetsRefinements === this.disjunctiveFacetsRefinements && patch.hierarchicalFacetsRefinements === this.hierarchicalFacetsRefinements) { return this; } return this.setQueryParameters(patch); }, /** * Remove all the refined tags from the SearchParameters * @method * @return {SearchParameters} */ clearTags: function clearTags() { if (this.tagFilters === undefined && this.tagRefinements.length === 0) return this; return this.setQueryParameters({ tagFilters: undefined, tagRefinements: [] }); }, /** * Set the index. * @method * @param {string} index the index name * @return {SearchParameters} */ setIndex: function setIndex(index) { if (index === this.index) return this; return this.setQueryParameters({ index: index }); }, /** * Query setter * @method * @param {string} newQuery value for the new query * @return {SearchParameters} */ setQuery: function setQuery(newQuery) { if (newQuery === this.query) return this; return this.setQueryParameters({ query: newQuery }); }, /** * Page setter * @method * @param {number} newPage new page number * @return {SearchParameters} */ setPage: function setPage(newPage) { if (newPage === this.page) return this; return this.setQueryParameters({ page: newPage }); }, /** * Facets setter * The facets are the simple facets, used for conjunctive (and) faceting. * @method * @param {string[]} facets all the attributes of the algolia records used for conjunctive faceting * @return {SearchParameters} */ setFacets: function setFacets(facets) { return this.setQueryParameters({ facets: facets }); }, /** * Disjunctive facets setter * Change the list of disjunctive (or) facets the helper chan handle. * @method * @param {string[]} facets all the attributes of the algolia records used for disjunctive faceting * @return {SearchParameters} */ setDisjunctiveFacets: function setDisjunctiveFacets(facets) { return this.setQueryParameters({ disjunctiveFacets: facets }); }, /** * HitsPerPage setter * Hits per page represents the number of hits retrieved for this query * @method * @param {number} n number of hits retrieved per page of results * @return {SearchParameters} */ setHitsPerPage: function setHitsPerPage(n) { if (this.hitsPerPage === n) return this; return this.setQueryParameters({ hitsPerPage: n }); }, /** * typoTolerance setter * Set the value of typoTolerance * @method * @param {string} typoTolerance new value of typoTolerance ("true", "false", "min" or "strict") * @return {SearchParameters} */ setTypoTolerance: function setTypoTolerance(typoTolerance) { if (this.typoTolerance === typoTolerance) return this; return this.setQueryParameters({ typoTolerance: typoTolerance }); }, /** * Add a numeric filter for a given attribute * When value is an array, they are combined with OR * When value is a single value, it will combined with AND * @method * @param {string} attribute attribute to set the filter on * @param {string} operator operator of the filter (possible values: =, >, >=, <, <=, !=) * @param {number | number[]} value value of the filter * @return {SearchParameters} * @example * // for price = 50 or 40 * searchparameter.addNumericRefinement('price', '=', [50, 40]); * @example * // for size = 38 and 40 * searchparameter.addNumericRefinement('size', '=', 38); * searchparameter.addNumericRefinement('size', '=', 40); */ addNumericRefinement: function(attribute, operator, v) { var value = valToNumber_1(v); if (this.isNumericRefined(attribute, operator, value)) return this; var mod = merge_1({}, this.numericRefinements); mod[attribute] = merge_1({}, mod[attribute]); if (mod[attribute][operator]) { // Array copy mod[attribute][operator] = mod[attribute][operator].slice(); // Add the element. Concat can't be used here because value can be an array. mod[attribute][operator].push(value); } else { mod[attribute][operator] = [value]; } return this.setQueryParameters({ numericRefinements: mod }); }, /** * Get the list of conjunctive refinements for a single facet * @param {string} facetName name of the attribute used for faceting * @return {string[]} list of refinements */ getConjunctiveRefinements: function(facetName) { if (!this.isConjunctiveFacet(facetName)) { throw new Error(facetName + ' is not defined in the facets attribute of the helper configuration'); } return this.facetsRefinements[facetName] || []; }, /** * Get the list of disjunctive refinements for a single facet * @param {string} facetName name of the attribute used for faceting * @return {string[]} list of refinements */ getDisjunctiveRefinements: function(facetName) { if (!this.isDisjunctiveFacet(facetName)) { throw new Error( facetName + ' is not defined in the disjunctiveFacets attribute of the helper configuration' ); } return this.disjunctiveFacetsRefinements[facetName] || []; }, /** * Get the list of hierarchical refinements for a single facet * @param {string} facetName name of the attribute used for faceting * @return {string[]} list of refinements */ getHierarchicalRefinement: function(facetName) { // we send an array but we currently do not support multiple // hierarchicalRefinements for a hierarchicalFacet return this.hierarchicalFacetsRefinements[facetName] || []; }, /** * Get the list of exclude refinements for a single facet * @param {string} facetName name of the attribute used for faceting * @return {string[]} list of refinements */ getExcludeRefinements: function(facetName) { if (!this.isConjunctiveFacet(facetName)) { throw new Error(facetName + ' is not defined in the facets attribute of the helper configuration'); } return this.facetsExcludes[facetName] || []; }, /** * Remove all the numeric filter for a given (attribute, operator) * @method * @param {string} attribute attribute to set the filter on * @param {string} [operator] operator of the filter (possible values: =, >, >=, <, <=, !=) * @param {number} [number] the value to be removed * @return {SearchParameters} */ removeNumericRefinement: function(attribute, operator, paramValue) { if (paramValue !== undefined) { var paramValueAsNumber = valToNumber_1(paramValue); if (!this.isNumericRefined(attribute, operator, paramValueAsNumber)) return this; return this.setQueryParameters({ numericRefinements: this._clearNumericRefinements(function(value, key) { return key === attribute && value.op === operator && isEqual_1(value.val, paramValueAsNumber); }) }); } else if (operator !== undefined) { if (!this.isNumericRefined(attribute, operator)) return this; return this.setQueryParameters({ numericRefinements: this._clearNumericRefinements(function(value, key) { return key === attribute && value.op === operator; }) }); } if (!this.isNumericRefined(attribute)) return this; return this.setQueryParameters({ numericRefinements: this._clearNumericRefinements(function(value, key) { return key === attribute; }) }); }, /** * Get the list of numeric refinements for a single facet * @param {string} facetName name of the attribute used for faceting * @return {SearchParameters.OperatorList[]} list of refinements */ getNumericRefinements: function(facetName) { return this.numericRefinements[facetName] || {}; }, /** * Return the current refinement for the (attribute, operator) * @param {string} attribute attribute in the record * @param {string} operator operator applied on the refined values * @return {Array.<number|number[]>} refined values */ getNumericRefinement: function(attribute, operator) { return this.numericRefinements[attribute] && this.numericRefinements[attribute][operator]; }, /** * Clear numeric filters. * @method * @private * @param {string|SearchParameters.clearCallback} [attribute] optional string or function * - If not given, means to clear all the filters. * - If `string`, means to clear all refinements for the `attribute` named filter. * - If `function`, means to clear all the refinements that return truthy values. * @return {Object.<string, OperatorList>} */ _clearNumericRefinements: function _clearNumericRefinements(attribute) { if (isUndefined_1(attribute)) { if (isEmpty_1(this.numericRefinements)) return this.numericRefinements; return {}; } else if (isString_1(attribute)) { if (isEmpty_1(this.numericRefinements[attribute])) return this.numericRefinements; return omit_1(this.numericRefinements, attribute); } else if (isFunction_1(attribute)) { var hasChanged = false; var newNumericRefinements = reduce_1(this.numericRefinements, function(memo, operators, key) { var operatorList = {}; forEach_1(operators, function(values, operator) { var outValues = []; forEach_1(values, function(value) { var predicateResult = attribute({val: value, op: operator}, key, 'numeric'); if (!predicateResult) outValues.push(value); }); if (!isEmpty_1(outValues)) { if (outValues.length !== values.length) hasChanged = true; operatorList[operator] = outValues; } else hasChanged = true; }); if (!isEmpty_1(operatorList)) memo[key] = operatorList; return memo; }, {}); if (hasChanged) return newNumericRefinements; return this.numericRefinements; } }, /** * Add a facet to the facets attribute of the helper configuration, if it * isn't already present. * @method * @param {string} facet facet name to add * @return {SearchParameters} */ addFacet: function addFacet(facet) { if (this.isConjunctiveFacet(facet)) { return this; } return this.setQueryParameters({ facets: this.facets.concat([facet]) }); }, /** * Add a disjunctive facet to the disjunctiveFacets attribute of the helper * configuration, if it isn't already present. * @method * @param {string} facet disjunctive facet name to add * @return {SearchParameters} */ addDisjunctiveFacet: function addDisjunctiveFacet(facet) { if (this.isDisjunctiveFacet(facet)) { return this; } return this.setQueryParameters({ disjunctiveFacets: this.disjunctiveFacets.concat([facet]) }); }, /** * Add a hierarchical facet to the hierarchicalFacets attribute of the helper * configuration. * @method * @param {object} hierarchicalFacet hierarchical facet to add * @return {SearchParameters} * @throws will throw an error if a hierarchical facet with the same name was already declared */ addHierarchicalFacet: function addHierarchicalFacet(hierarchicalFacet) { if (this.isHierarchicalFacet(hierarchicalFacet.name)) { throw new Error( 'Cannot declare two hierarchical facets with the same name: `' + hierarchicalFacet.name + '`'); } return this.setQueryParameters({ hierarchicalFacets: this.hierarchicalFacets.concat([hierarchicalFacet]) }); }, /** * Add a refinement on a "normal" facet * @method * @param {string} facet attribute to apply the faceting on * @param {string} value value of the attribute (will be converted to string) * @return {SearchParameters} */ addFacetRefinement: function addFacetRefinement(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } if (RefinementList.isRefined(this.facetsRefinements, facet, value)) return this; return this.setQueryParameters({ facetsRefinements: RefinementList.addRefinement(this.facetsRefinements, facet, value) }); }, /** * Exclude a value from a "normal" facet * @method * @param {string} facet attribute to apply the exclusion on * @param {string} value value of the attribute (will be converted to string) * @return {SearchParameters} */ addExcludeRefinement: function addExcludeRefinement(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } if (RefinementList.isRefined(this.facetsExcludes, facet, value)) return this; return this.setQueryParameters({ facetsExcludes: RefinementList.addRefinement(this.facetsExcludes, facet, value) }); }, /** * Adds a refinement on a disjunctive facet. * @method * @param {string} facet attribute to apply the faceting on * @param {string} value value of the attribute (will be converted to string) * @return {SearchParameters} */ addDisjunctiveFacetRefinement: function addDisjunctiveFacetRefinement(facet, value) { if (!this.isDisjunctiveFacet(facet)) { throw new Error( facet + ' is not defined in the disjunctiveFacets attribute of the helper configuration'); } if (RefinementList.isRefined(this.disjunctiveFacetsRefinements, facet, value)) return this; return this.setQueryParameters({ disjunctiveFacetsRefinements: RefinementList.addRefinement( this.disjunctiveFacetsRefinements, facet, value) }); }, /** * addTagRefinement adds a tag to the list used to filter the results * @param {string} tag tag to be added * @return {SearchParameters} */ addTagRefinement: function addTagRefinement(tag) { if (this.isTagRefined(tag)) return this; var modification = { tagRefinements: this.tagRefinements.concat(tag) }; return this.setQueryParameters(modification); }, /** * Remove a facet from the facets attribute of the helper configuration, if it * is present. * @method * @param {string} facet facet name to remove * @return {SearchParameters} */ removeFacet: function removeFacet(facet) { if (!this.isConjunctiveFacet(facet)) { return this; } return this.clearRefinements(facet).setQueryParameters({ facets: filter_1(this.facets, function(f) { return f !== facet; }) }); }, /** * Remove a disjunctive facet from the disjunctiveFacets attribute of the * helper configuration, if it is present. * @method * @param {string} facet disjunctive facet name to remove * @return {SearchParameters} */ removeDisjunctiveFacet: function removeDisjunctiveFacet(facet) { if (!this.isDisjunctiveFacet(facet)) { return this; } return this.clearRefinements(facet).setQueryParameters({ disjunctiveFacets: filter_1(this.disjunctiveFacets, function(f) { return f !== facet; }) }); }, /** * Remove a hierarchical facet from the hierarchicalFacets attribute of the * helper configuration, if it is present. * @method * @param {string} facet hierarchical facet name to remove * @return {SearchParameters} */ removeHierarchicalFacet: function removeHierarchicalFacet(facet) { if (!this.isHierarchicalFacet(facet)) { return this; } return this.clearRefinements(facet).setQueryParameters({ hierarchicalFacets: filter_1(this.hierarchicalFacets, function(f) { return f.name !== facet; }) }); }, /** * Remove a refinement set on facet. If a value is provided, it will clear the * refinement for the given value, otherwise it will clear all the refinement * values for the faceted attribute. * @method * @param {string} facet name of the attribute used for faceting * @param {string} [value] value used to filter * @return {SearchParameters} */ removeFacetRefinement: function removeFacetRefinement(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } if (!RefinementList.isRefined(this.facetsRefinements, facet, value)) return this; return this.setQueryParameters({ facetsRefinements: RefinementList.removeRefinement(this.facetsRefinements, facet, value) }); }, /** * Remove a negative refinement on a facet * @method * @param {string} facet name of the attribute used for faceting * @param {string} value value used to filter * @return {SearchParameters} */ removeExcludeRefinement: function removeExcludeRefinement(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } if (!RefinementList.isRefined(this.facetsExcludes, facet, value)) return this; return this.setQueryParameters({ facetsExcludes: RefinementList.removeRefinement(this.facetsExcludes, facet, value) }); }, /** * Remove a refinement on a disjunctive facet * @method * @param {string} facet name of the attribute used for faceting * @param {string} value value used to filter * @return {SearchParameters} */ removeDisjunctiveFacetRefinement: function removeDisjunctiveFacetRefinement(facet, value) { if (!this.isDisjunctiveFacet(facet)) { throw new Error( facet + ' is not defined in the disjunctiveFacets attribute of the helper configuration'); } if (!RefinementList.isRefined(this.disjunctiveFacetsRefinements, facet, value)) return this; return this.setQueryParameters({ disjunctiveFacetsRefinements: RefinementList.removeRefinement( this.disjunctiveFacetsRefinements, facet, value) }); }, /** * Remove a tag from the list of tag refinements * @method * @param {string} tag the tag to remove * @return {SearchParameters} */ removeTagRefinement: function removeTagRefinement(tag) { if (!this.isTagRefined(tag)) return this; var modification = { tagRefinements: filter_1(this.tagRefinements, function(t) { return t !== tag; }) }; return this.setQueryParameters(modification); }, /** * Generic toggle refinement method to use with facet, disjunctive facets * and hierarchical facets * @param {string} facet the facet to refine * @param {string} value the associated value * @return {SearchParameters} * @throws will throw an error if the facet is not declared in the settings of the helper * @deprecated since version 2.19.0, see {@link SearchParameters#toggleFacetRefinement} */ toggleRefinement: function toggleRefinement(facet, value) { return this.toggleFacetRefinement(facet, value); }, /** * Generic toggle refinement method to use with facet, disjunctive facets * and hierarchical facets * @param {string} facet the facet to refine * @param {string} value the associated value * @return {SearchParameters} * @throws will throw an error if the facet is not declared in the settings of the helper */ toggleFacetRefinement: function toggleFacetRefinement(facet, value) { if (this.isHierarchicalFacet(facet)) { return this.toggleHierarchicalFacetRefinement(facet, value); } else if (this.isConjunctiveFacet(facet)) { return this.toggleConjunctiveFacetRefinement(facet, value); } else if (this.isDisjunctiveFacet(facet)) { return this.toggleDisjunctiveFacetRefinement(facet, value); } throw new Error('Cannot refine the undeclared facet ' + facet + '; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets'); }, /** * Switch the refinement applied over a facet/value * @method * @param {string} facet name of the attribute used for faceting * @param {value} value value used for filtering * @return {SearchParameters} */ toggleConjunctiveFacetRefinement: function toggleConjunctiveFacetRefinement(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } return this.setQueryParameters({ facetsRefinements: RefinementList.toggleRefinement(this.facetsRefinements, facet, value) }); }, /** * Switch the refinement applied over a facet/value * @method * @param {string} facet name of the attribute used for faceting * @param {value} value value used for filtering * @return {SearchParameters} */ toggleExcludeFacetRefinement: function toggleExcludeFacetRefinement(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } return this.setQueryParameters({ facetsExcludes: RefinementList.toggleRefinement(this.facetsExcludes, facet, value) }); }, /** * Switch the refinement applied over a facet/value * @method * @param {string} facet name of the attribute used for faceting * @param {value} value value used for filtering * @return {SearchParameters} */ toggleDisjunctiveFacetRefinement: function toggleDisjunctiveFacetRefinement(facet, value) { if (!this.isDisjunctiveFacet(facet)) { throw new Error( facet + ' is not defined in the disjunctiveFacets attribute of the helper configuration'); } return this.setQueryParameters({ disjunctiveFacetsRefinements: RefinementList.toggleRefinement( this.disjunctiveFacetsRefinements, facet, value) }); }, /** * Switch the refinement applied over a facet/value * @method * @param {string} facet name of the attribute used for faceting * @param {value} value value used for filtering * @return {SearchParameters} */ toggleHierarchicalFacetRefinement: function toggleHierarchicalFacetRefinement(facet, value) { if (!this.isHierarchicalFacet(facet)) { throw new Error( facet + ' is not defined in the hierarchicalFacets attribute of the helper configuration'); } var separator = this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(facet)); var mod = {}; var upOneOrMultipleLevel = this.hierarchicalFacetsRefinements[facet] !== undefined && this.hierarchicalFacetsRefinements[facet].length > 0 && ( // remove current refinement: // refinement was 'beer > IPA', call is toggleRefine('beer > IPA'), refinement should be `beer` this.hierarchicalFacetsRefinements[facet][0] === value || // remove a parent refinement of the current refinement: // - refinement was 'beer > IPA > Flying dog' // - call is toggleRefine('beer > IPA') // - refinement should be `beer` this.hierarchicalFacetsRefinements[facet][0].indexOf(value + separator) === 0 ); if (upOneOrMultipleLevel) { if (value.indexOf(separator) === -1) { // go back to root level mod[facet] = []; } else { mod[facet] = [value.slice(0, value.lastIndexOf(separator))]; } } else { mod[facet] = [value]; } return this.setQueryParameters({ hierarchicalFacetsRefinements: defaults_1({}, mod, this.hierarchicalFacetsRefinements) }); }, /** * Adds a refinement on a hierarchical facet. * @param {string} facet the facet name * @param {string} path the hierarchical facet path * @return {SearchParameter} the new state * @throws Error if the facet is not defined or if the facet is refined */ addHierarchicalFacetRefinement: function(facet, path) { if (this.isHierarchicalFacetRefined(facet)) { throw new Error(facet + ' is already refined.'); } var mod = {}; mod[facet] = [path]; return this.setQueryParameters({ hierarchicalFacetsRefinements: defaults_1({}, mod, this.hierarchicalFacetsRefinements) }); }, /** * Removes the refinement set on a hierarchical facet. * @param {string} facet the facet name * @return {SearchParameter} the new state * @throws Error if the facet is not defined or if the facet is not refined */ removeHierarchicalFacetRefinement: function(facet) { if (!this.isHierarchicalFacetRefined(facet)) { throw new Error(facet + ' is not refined.'); } var mod = {}; mod[facet] = []; return this.setQueryParameters({ hierarchicalFacetsRefinements: defaults_1({}, mod, this.hierarchicalFacetsRefinements) }); }, /** * Switch the tag refinement * @method * @param {string} tag the tag to remove or add * @return {SearchParameters} */ toggleTagRefinement: function toggleTagRefinement(tag) { if (this.isTagRefined(tag)) { return this.removeTagRefinement(tag); } return this.addTagRefinement(tag); }, /** * Test if the facet name is from one of the disjunctive facets * @method * @param {string} facet facet name to test * @return {boolean} */ isDisjunctiveFacet: function(facet) { return indexOf_1(this.disjunctiveFacets, facet) > -1; }, /** * Test if the facet name is from one of the hierarchical facets * @method * @param {string} facetName facet name to test * @return {boolean} */ isHierarchicalFacet: function(facetName) { return this.getHierarchicalFacetByName(facetName) !== undefined; }, /** * Test if the facet name is from one of the conjunctive/normal facets * @method * @param {string} facet facet name to test * @return {boolean} */ isConjunctiveFacet: function(facet) { return indexOf_1(this.facets, facet) > -1; }, /** * Returns true if the facet is refined, either for a specific value or in * general. * @method * @param {string} facet name of the attribute for used for faceting * @param {string} value, optional value. If passed will test that this value * is filtering the given facet. * @return {boolean} returns true if refined */ isFacetRefined: function isFacetRefined(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } return RefinementList.isRefined(this.facetsRefinements, facet, value); }, /** * Returns true if the facet contains exclusions or if a specific value is * excluded. * * @method * @param {string} facet name of the attribute for used for faceting * @param {string} [value] optional value. If passed will test that this value * is filtering the given facet. * @return {boolean} returns true if refined */ isExcludeRefined: function isExcludeRefined(facet, value) { if (!this.isConjunctiveFacet(facet)) { throw new Error(facet + ' is not defined in the facets attribute of the helper configuration'); } return RefinementList.isRefined(this.facetsExcludes, facet, value); }, /** * Returns true if the facet contains a refinement, or if a value passed is a * refinement for the facet. * @method * @param {string} facet name of the attribute for used for faceting * @param {string} value optional, will test if the value is used for refinement * if there is one, otherwise will test if the facet contains any refinement * @return {boolean} */ isDisjunctiveFacetRefined: function isDisjunctiveFacetRefined(facet, value) { if (!this.isDisjunctiveFacet(facet)) { throw new Error( facet + ' is not defined in the disjunctiveFacets attribute of the helper configuration'); } return RefinementList.isRefined(this.disjunctiveFacetsRefinements, facet, value); }, /** * Returns true if the facet contains a refinement, or if a value passed is a * refinement for the facet. * @method * @param {string} facet name of the attribute for used for faceting * @param {string} value optional, will test if the value is used for refinement * if there is one, otherwise will test if the facet contains any refinement * @return {boolean} */ isHierarchicalFacetRefined: function isHierarchicalFacetRefined(facet, value) { if (!this.isHierarchicalFacet(facet)) { throw new Error( facet + ' is not defined in the hierarchicalFacets attribute of the helper configuration'); } var refinements = this.getHierarchicalRefinement(facet); if (!value) { return refinements.length > 0; } return indexOf_1(refinements, value) !== -1; }, /** * Test if the triple (attribute, operator, value) is already refined. * If only the attribute and the operator are provided, it tests if the * contains any refinement value. * @method * @param {string} attribute attribute for which the refinement is applied * @param {string} [operator] operator of the refinement * @param {string} [value] value of the refinement * @return {boolean} true if it is refined */ isNumericRefined: function isNumericRefined(attribute, operator, value) { if (isUndefined_1(value) && isUndefined_1(operator)) { return !!this.numericRefinements[attribute]; } var isOperatorDefined = this.numericRefinements[attribute] && !isUndefined_1(this.numericRefinements[attribute][operator]); if (isUndefined_1(value) || !isOperatorDefined) { return isOperatorDefined; } var parsedValue = valToNumber_1(value); var isAttributeValueDefined = !isUndefined_1( findArray(this.numericRefinements[attribute][operator], parsedValue) ); return isOperatorDefined && isAttributeValueDefined; }, /** * Returns true if the tag refined, false otherwise * @method * @param {string} tag the tag to check * @return {boolean} */ isTagRefined: function isTagRefined(tag) { return indexOf_1(this.tagRefinements, tag) !== -1; }, /** * Returns the list of all disjunctive facets refined * @method * @param {string} facet name of the attribute used for faceting * @param {value} value value used for filtering * @return {string[]} */ getRefinedDisjunctiveFacets: function getRefinedDisjunctiveFacets() { // attributes used for numeric filter can also be disjunctive var disjunctiveNumericRefinedFacets = intersection_1( keys_1(this.numericRefinements), this.disjunctiveFacets ); return keys_1(this.disjunctiveFacetsRefinements) .concat(disjunctiveNumericRefinedFacets) .concat(this.getRefinedHierarchicalFacets()); }, /** * Returns the list of all disjunctive facets refined * @method * @param {string} facet name of the attribute used for faceting * @param {value} value value used for filtering * @return {string[]} */ getRefinedHierarchicalFacets: function getRefinedHierarchicalFacets() { return intersection_1( // enforce the order between the two arrays, // so that refinement name index === hierarchical facet index map_1(this.hierarchicalFacets, 'name'), keys_1(this.hierarchicalFacetsRefinements) ); }, /** * Returned the list of all disjunctive facets not refined * @method * @return {string[]} */ getUnrefinedDisjunctiveFacets: function() { var refinedFacets = this.getRefinedDisjunctiveFacets(); return filter_1(this.disjunctiveFacets, function(f) { return indexOf_1(refinedFacets, f) === -1; }); }, managedParameters: [ 'index', 'facets', 'disjunctiveFacets', 'facetsRefinements', 'facetsExcludes', 'disjunctiveFacetsRefinements', 'numericRefinements', 'tagRefinements', 'hierarchicalFacets', 'hierarchicalFacetsRefinements' ], getQueryParams: function getQueryParams() { var managedParameters = this.managedParameters; var queryParams = {}; forOwn_1(this, function(paramValue, paramName) { if (indexOf_1(managedParameters, paramName) === -1 && paramValue !== undefined) { queryParams[paramName] = paramValue; } }); return queryParams; }, /** * Let the user retrieve any parameter value from the SearchParameters * @param {string} paramName name of the parameter * @return {any} the value of the parameter */ getQueryParameter: function getQueryParameter(paramName) { if (!this.hasOwnProperty(paramName)) { throw new Error( "Parameter '" + paramName + "' is not an attribute of SearchParameters " + '(http://algolia.github.io/algoliasearch-helper-js/docs/SearchParameters.html)'); } return this[paramName]; }, /** * Let the user set a specific value for a given parameter. Will return the * same instance if the parameter is invalid or if the value is the same as the * previous one. * @method * @param {string} parameter the parameter name * @param {any} value the value to be set, must be compliant with the definition * of the attribute on the object * @return {SearchParameters} the updated state */ setQueryParameter: function setParameter(parameter, value) { if (this[parameter] === value) return this; var modification = {}; modification[parameter] = value; return this.setQueryParameters(modification); }, /** * Let the user set any of the parameters with a plain object. * @method * @param {object} params all the keys and the values to be updated * @return {SearchParameters} a new updated instance */ setQueryParameters: function setQueryParameters(params) { if (!params) return this; var error = SearchParameters.validate(this, params); if (error) { throw error; } var parsedParams = SearchParameters._parseNumbers(params); return this.mutateMe(function mergeWith(newInstance) { var ks = keys_1(params); forEach_1(ks, function(k) { newInstance[k] = parsedParams[k]; }); return newInstance; }); }, /** * Returns an object with only the selected attributes. * @param {string[]} filters filters to retrieve only a subset of the state. It * accepts strings that can be either attributes of the SearchParameters (e.g. hitsPerPage) * or attributes of the index with the notation 'attribute:nameOfMyAttribute' * @return {object} */ filter: function(filters) { return filterState_1(this, filters); }, /** * Helper function to make it easier to build new instances from a mutating * function * @private * @param {function} fn newMutableState -> previousState -> () function that will * change the value of the newMutable to the desired state * @return {SearchParameters} a new instance with the specified modifications applied */ mutateMe: function mutateMe(fn) { var newState = new this.constructor(this); fn(newState, this); return newState; }, /** * Helper function to get the hierarchicalFacet separator or the default one (`>`) * @param {object} hierarchicalFacet * @return {string} returns the hierarchicalFacet.separator or `>` as default */ _getHierarchicalFacetSortBy: function(hierarchicalFacet) { return hierarchicalFacet.sortBy || ['isRefined:desc', 'name:asc']; }, /** * Helper function to get the hierarchicalFacet separator or the default one (`>`) * @private * @param {object} hierarchicalFacet * @return {string} returns the hierarchicalFacet.separator or `>` as default */ _getHierarchicalFacetSeparator: function(hierarchicalFacet) { return hierarchicalFacet.separator || ' > '; }, /** * Helper function to get the hierarchicalFacet prefix path or null * @private * @param {object} hierarchicalFacet * @return {string} returns the hierarchicalFacet.rootPath or null as default */ _getHierarchicalRootPath: function(hierarchicalFacet) { return hierarchicalFacet.rootPath || null; }, /** * Helper function to check if we show the parent level of the hierarchicalFacet * @private * @param {object} hierarchicalFacet * @return {string} returns the hierarchicalFacet.showParentLevel or true as default */ _getHierarchicalShowParentLevel: function(hierarchicalFacet) { if (typeof hierarchicalFacet.showParentLevel === 'boolean') { return hierarchicalFacet.showParentLevel; } return true; }, /** * Helper function to get the hierarchicalFacet by it's name * @param {string} hierarchicalFacetName * @return {object} a hierarchicalFacet */ getHierarchicalFacetByName: function(hierarchicalFacetName) { return find_1( this.hierarchicalFacets, {name: hierarchicalFacetName} ); }, /** * Get the current breadcrumb for a hierarchical facet, as an array * @param {string} facetName Hierarchical facet name * @return {array.<string>} the path as an array of string */ getHierarchicalFacetBreadcrumb: function(facetName) { if (!this.isHierarchicalFacet(facetName)) { throw new Error( 'Cannot get the breadcrumb of an unknown hierarchical facet: `' + facetName + '`'); } var refinement = this.getHierarchicalRefinement(facetName)[0]; if (!refinement) return []; var separator = this._getHierarchicalFacetSeparator( this.getHierarchicalFacetByName(facetName) ); var path = refinement.split(separator); return map_1(path, trim_1); }, toString: function() { return JSON.stringify(this, null, 2); } }; /** * Callback used for clearRefinement method * @callback SearchParameters.clearCallback * @param {OperatorList|FacetList} value the value of the filter * @param {string} key the current attribute name * @param {string} type `numeric`, `disjunctiveFacet`, `conjunctiveFacet`, `hierarchicalFacet` or `exclude` * depending on the type of facet * @return {boolean} `true` if the element should be removed. `false` otherwise. */ var SearchParameters_1 = SearchParameters; /** * 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; } var compact_1 = compact; /** * The base implementation of `_.sum` and `_.sumBy` without support for * iteratee shorthands. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {number} Returns the sum. */ function baseSum(array, iteratee) { var result, index = -1, length = array.length; while (++index < length) { var current = iteratee(array[index]); if (current !== undefined) { result = result === undefined ? current : (result + current); } } return result; } var _baseSum = baseSum; /** * This method is like `_.sum` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the value to be summed. * The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the sum. * @example * * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; * * _.sumBy(objects, function(o) { return o.n; }); * // => 20 * * // The `_.property` iteratee shorthand. * _.sumBy(objects, 'n'); * // => 20 */ function sumBy(array, iteratee) { return (array && array.length) ? _baseSum(array, _baseIteratee(iteratee, 2)) : 0; } var sumBy_1 = sumBy; /** * 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]; }); } var _baseValues = baseValues; /** * 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_1(object)); } var values_1 = values; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax$3 = 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_1(collection) ? collection : values_1(collection); fromIndex = (fromIndex && !guard) ? toInteger_1(fromIndex) : 0; var length = collection.length; if (fromIndex < 0) { fromIndex = nativeMax$3(length + fromIndex, 0); } return isString_1(collection) ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) : (!!length && _baseIndexOf(collection, value, fromIndex) > -1); } var includes_1 = includes; /** * 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; } var _baseSortBy = baseSortBy; /** * 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_1(value); var othIsDefined = other !== undefined, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol_1(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; } var _compareAscending = compareAscending; /** * 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; } var _compareMultiple = compareMultiple; /** * 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) { var index = -1; iteratees = _arrayMap(iteratees.length ? iteratees : [identity_1], _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); }); } var _baseOrderBy = baseOrderBy; /** * 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_1(iteratees)) { iteratees = iteratees == null ? [] : [iteratees]; } orders = guard ? undefined : orders; if (!isArray_1(orders)) { orders = orders == null ? [] : [orders]; } return _baseOrderBy(collection, iteratees, orders); } var orderBy_1 = orderBy; /** Used to store function metadata. */ var metaMap = _WeakMap && new _WeakMap; var _metaMap = metaMap; /** * The base implementation of `setData` without support for hot loop shorting. * * @private * @param {Function} func The function to associate metadata with. * @param {*} data The metadata. * @returns {Function} Returns `func`. */ var baseSetData = !_metaMap ? identity_1 : function(func, data) { _metaMap.set(func, data); return func; }; var _baseSetData = baseSetData; /** * Creates a function that produces an instance of `Ctor` regardless of * whether it was invoked as part of a `new` expression or by `call` or `apply`. * * @private * @param {Function} Ctor The constructor to wrap. * @returns {Function} Returns the new wrapped function. */ function createCtor(Ctor) { return function() { // Use a `switch` statement to work with class constructors. See // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist // for more details. var args = arguments; switch (args.length) { case 0: return new Ctor; case 1: return new Ctor(args[0]); case 2: return new Ctor(args[0], args[1]); case 3: return new Ctor(args[0], args[1], args[2]); case 4: return new Ctor(args[0], args[1], args[2], args[3]); case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); } var thisBinding = _baseCreate(Ctor.prototype), result = Ctor.apply(thisBinding, args); // Mimic the constructor's `return` behavior. // See https://es5.github.io/#x13.2.2 for more details. return isObject_1(result) ? result : thisBinding; }; } var _createCtor = createCtor; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG = 1; /** * Creates a function that wraps `func` to invoke it with the optional `this` * binding of `thisArg`. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @returns {Function} Returns the new wrapped function. */ function createBind(func, bitmask, thisArg) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = _createCtor(func); function wrapper() { var fn = (this && this !== _root && this instanceof wrapper) ? Ctor : func; return fn.apply(isBind ? thisArg : this, arguments); } return wrapper; } var _createBind = createBind; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax$4 = Math.max; /** * Creates an array that is the composition of partially applied arguments, * placeholders, and provided arguments into a single array of arguments. * * @private * @param {Array} args The provided arguments. * @param {Array} partials The arguments to prepend to those provided. * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. */ function composeArgs(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax$4(argsLength - holdersLength, 0), result = Array(leftLength + rangeLength), isUncurried = !isCurried; while (++leftIndex < leftLength) { result[leftIndex] = partials[leftIndex]; } while (++argsIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result[holders[argsIndex]] = args[argsIndex]; } } while (rangeLength--) { result[leftIndex++] = args[argsIndex++]; } return result; } var _composeArgs = composeArgs; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax$5 = Math.max; /** * This function is like `composeArgs` except that the arguments composition * is tailored for `_.partialRight`. * * @private * @param {Array} args The provided arguments. * @param {Array} partials The arguments to append to those provided. * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. */ function composeArgsRight(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax$5(argsLength - holdersLength, 0), result = Array(rangeLength + rightLength), isUncurried = !isCurried; while (++argsIndex < rangeLength) { result[argsIndex] = args[argsIndex]; } var offset = argsIndex; while (++rightIndex < rightLength) { result[offset + rightIndex] = partials[rightIndex]; } while (++holdersIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result[offset + holders[holdersIndex]] = args[argsIndex++]; } } return result; } var _composeArgsRight = composeArgsRight; /** * Gets the number of `placeholder` occurrences in `array`. * * @private * @param {Array} array The array to inspect. * @param {*} placeholder The placeholder to search for. * @returns {number} Returns the placeholder count. */ function countHolders(array, placeholder) { var length = array.length, result = 0; while (length--) { if (array[length] === placeholder) { ++result; } } return result; } var _countHolders = countHolders; /** * The function whose prototype chain sequence wrappers inherit from. * * @private */ function baseLodash() { // No operation performed. } var _baseLodash = baseLodash; /** Used as references for the maximum length and index of an array. */ var MAX_ARRAY_LENGTH = 4294967295; /** * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. * * @private * @constructor * @param {*} value The value to wrap. */ function LazyWrapper(value) { this.__wrapped__ = value; this.__actions__ = []; this.__dir__ = 1; this.__filtered__ = false; this.__iteratees__ = []; this.__takeCount__ = MAX_ARRAY_LENGTH; this.__views__ = []; } // Ensure `LazyWrapper` is an instance of `baseLodash`. LazyWrapper.prototype = _baseCreate(_baseLodash.prototype); LazyWrapper.prototype.constructor = LazyWrapper; var _LazyWrapper = LazyWrapper; /** * This method returns `undefined`. * * @static * @memberOf _ * @since 2.3.0 * @category Util * @example * * _.times(2, _.noop); * // => [undefined, undefined] */ function noop$1() { // No operation performed. } var noop_1 = noop$1; /** * Gets metadata for `func`. * * @private * @param {Function} func The function to query. * @returns {*} Returns the metadata for `func`. */ var getData = !_metaMap ? noop_1 : function(func) { return _metaMap.get(func); }; var _getData = getData; /** Used to lookup unminified function names. */ var realNames = {}; var _realNames = realNames; /** Used for built-in method references. */ var objectProto$i = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$g = objectProto$i.hasOwnProperty; /** * Gets the name of `func`. * * @private * @param {Function} func The function to query. * @returns {string} Returns the function name. */ function getFuncName(func) { var result = (func.name + ''), array = _realNames[result], length = hasOwnProperty$g.call(_realNames, result) ? array.length : 0; while (length--) { var data = array[length], otherFunc = data.func; if (otherFunc == null || otherFunc == func) { return data.name; } } return result; } var _getFuncName = getFuncName; /** * The base constructor for creating `lodash` wrapper objects. * * @private * @param {*} value The value to wrap. * @param {boolean} [chainAll] Enable explicit method chain sequences. */ function LodashWrapper(value, chainAll) { this.__wrapped__ = value; this.__actions__ = []; this.__chain__ = !!chainAll; this.__index__ = 0; this.__values__ = undefined; } LodashWrapper.prototype = _baseCreate(_baseLodash.prototype); LodashWrapper.prototype.constructor = LodashWrapper; var _LodashWrapper = LodashWrapper; /** * Creates a clone of `wrapper`. * * @private * @param {Object} wrapper The wrapper to clone. * @returns {Object} Returns the cloned wrapper. */ function wrapperClone(wrapper) { if (wrapper instanceof _LazyWrapper) { return wrapper.clone(); } var result = new _LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); result.__actions__ = _copyArray(wrapper.__actions__); result.__index__ = wrapper.__index__; result.__values__ = wrapper.__values__; return result; } var _wrapperClone = wrapperClone; /** Used for built-in method references. */ var objectProto$j = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$h = objectProto$j.hasOwnProperty; /** * Creates a `lodash` object which wraps `value` to enable implicit method * chain sequences. Methods that operate on and return arrays, collections, * and functions can be chained together. Methods that retrieve a single value * or may return a primitive value will automatically end the chain sequence * and return the unwrapped value. Otherwise, the value must be unwrapped * with `_#value`. * * Explicit chain sequences, which must be unwrapped with `_#value`, may be * enabled using `_.chain`. * * The execution of chained methods is lazy, that is, it's deferred until * `_#value` is implicitly or explicitly called. * * Lazy evaluation allows several methods to support shortcut fusion. * Shortcut fusion is an optimization to merge iteratee calls; this avoids * the creation of intermediate arrays and can greatly reduce the number of * iteratee executions. Sections of a chain sequence qualify for shortcut * fusion if the section is applied to an array and iteratees accept only * one argument. The heuristic for whether a section qualifies for shortcut * fusion is subject to change. * * Chaining is supported in custom builds as long as the `_#value` method is * directly or indirectly included in the build. * * In addition to lodash methods, wrappers have `Array` and `String` methods. * * The wrapper `Array` methods are: * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` * * The wrapper `String` methods are: * `replace` and `split` * * The wrapper methods that support shortcut fusion are: * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` * * The chainable wrapper methods are: * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, * `zipObject`, `zipObjectDeep`, and `zipWith` * * The wrapper methods that are **not** chainable by default are: * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, * `upperFirst`, `value`, and `words` * * @name _ * @constructor * @category Seq * @param {*} value The value to wrap in a `lodash` instance. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * function square(n) { * return n * n; * } * * var wrapped = _([1, 2, 3]); * * // Returns an unwrapped value. * wrapped.reduce(_.add); * // => 6 * * // Returns a wrapped value. * var squares = wrapped.map(square); * * _.isArray(squares); * // => false * * _.isArray(squares.value()); * // => true */ function lodash(value) { if (isObjectLike_1(value) && !isArray_1(value) && !(value instanceof _LazyWrapper)) { if (value instanceof _LodashWrapper) { return value; } if (hasOwnProperty$h.call(value, '__wrapped__')) { return _wrapperClone(value); } } return new _LodashWrapper(value); } // Ensure wrappers are instances of `baseLodash`. lodash.prototype = _baseLodash.prototype; lodash.prototype.constructor = lodash; var wrapperLodash = lodash; /** * Checks if `func` has a lazy counterpart. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` has a lazy counterpart, * else `false`. */ function isLaziable(func) { var funcName = _getFuncName(func), other = wrapperLodash[funcName]; if (typeof other != 'function' || !(funcName in _LazyWrapper.prototype)) { return false; } if (func === other) { return true; } var data = _getData(other); return !!data && func === data[0]; } var _isLaziable = isLaziable; /** * Sets metadata for `func`. * * **Note:** If this function becomes hot, i.e. is invoked a lot in a short * period of time, it will trip its breaker and transition to an identity * function to avoid garbage collection pauses in V8. See * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) * for more details. * * @private * @param {Function} func The function to associate metadata with. * @param {*} data The metadata. * @returns {Function} Returns `func`. */ var setData = _shortOut(_baseSetData); var _setData = setData; /** Used to match wrap detail comments. */ var reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /; /** * Extracts wrapper details from the `source` body comment. * * @private * @param {string} source The source to inspect. * @returns {Array} Returns the wrapper details. */ function getWrapDetails(source) { var match = source.match(reWrapDetails); return match ? match[1].split(reSplitDetails) : []; } var _getWrapDetails = getWrapDetails; /** Used to match wrap detail comments. */ var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/; /** * Inserts wrapper `details` in a comment at the top of the `source` body. * * @private * @param {string} source The source to modify. * @returns {Array} details The details to insert. * @returns {string} Returns the modified source. */ function insertWrapDetails(source, details) { var length = details.length; if (!length) { return source; } var lastIndex = length - 1; details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; details = details.join(length > 2 ? ', ' : ' '); return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); } var _insertWrapDetails = insertWrapDetails; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG$1 = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512; /** Used to associate wrap methods with their bit flags. */ var wrapFlags = [ ['ary', WRAP_ARY_FLAG], ['bind', WRAP_BIND_FLAG$1], ['bindKey', WRAP_BIND_KEY_FLAG], ['curry', WRAP_CURRY_FLAG], ['curryRight', WRAP_CURRY_RIGHT_FLAG], ['flip', WRAP_FLIP_FLAG], ['partial', WRAP_PARTIAL_FLAG], ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], ['rearg', WRAP_REARG_FLAG] ]; /** * Updates wrapper `details` based on `bitmask` flags. * * @private * @returns {Array} details The details to modify. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @returns {Array} Returns `details`. */ function updateWrapDetails(details, bitmask) { _arrayEach(wrapFlags, function(pair) { var value = '_.' + pair[0]; if ((bitmask & pair[1]) && !_arrayIncludes(details, value)) { details.push(value); } }); return details.sort(); } var _updateWrapDetails = updateWrapDetails; /** * Sets the `toString` method of `wrapper` to mimic the source of `reference` * with wrapper details in a comment at the top of the source body. * * @private * @param {Function} wrapper The function to modify. * @param {Function} reference The reference function. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @returns {Function} Returns `wrapper`. */ function setWrapToString(wrapper, reference, bitmask) { var source = (reference + ''); return _setToString(wrapper, _insertWrapDetails(source, _updateWrapDetails(_getWrapDetails(source), bitmask))); } var _setWrapToString = setWrapToString; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG$2 = 1, WRAP_BIND_KEY_FLAG$1 = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG$1 = 8, WRAP_PARTIAL_FLAG$1 = 32, WRAP_PARTIAL_RIGHT_FLAG$1 = 64; /** * Creates a function that wraps `func` to continue currying. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {Function} wrapFunc The function to create the `func` wrapper. * @param {*} placeholder The placeholder value. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to * the new function. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { var isCurry = bitmask & WRAP_CURRY_FLAG$1, newHolders = isCurry ? holders : undefined, newHoldersRight = isCurry ? undefined : holders, newPartials = isCurry ? partials : undefined, newPartialsRight = isCurry ? undefined : partials; bitmask |= (isCurry ? WRAP_PARTIAL_FLAG$1 : WRAP_PARTIAL_RIGHT_FLAG$1); bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG$1 : WRAP_PARTIAL_FLAG$1); if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { bitmask &= ~(WRAP_BIND_FLAG$2 | WRAP_BIND_KEY_FLAG$1); } var newData = [ func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, newHoldersRight, argPos, ary, arity ]; var result = wrapFunc.apply(undefined, newData); if (_isLaziable(func)) { _setData(result, newData); } result.placeholder = placeholder; return _setWrapToString(result, func, bitmask); } var _createRecurry = createRecurry; /** * Gets the argument placeholder value for `func`. * * @private * @param {Function} func The function to inspect. * @returns {*} Returns the placeholder value. */ function getHolder(func) { var object = func; return object.placeholder; } var _getHolder = getHolder; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMin$1 = Math.min; /** * Reorder `array` according to the specified indexes where the element at * the first index is assigned as the first element, the element at * the second index is assigned as the second element, and so on. * * @private * @param {Array} array The array to reorder. * @param {Array} indexes The arranged array indexes. * @returns {Array} Returns `array`. */ function reorder(array, indexes) { var arrLength = array.length, length = nativeMin$1(indexes.length, arrLength), oldArray = _copyArray(array); while (length--) { var index = indexes[length]; array[length] = _isIndex(index, arrLength) ? oldArray[index] : undefined; } return array; } var _reorder = reorder; /** Used as the internal argument placeholder. */ var PLACEHOLDER = '__lodash_placeholder__'; /** * Replaces all `placeholder` elements in `array` with an internal placeholder * and returns an array of their indexes. * * @private * @param {Array} array The array to modify. * @param {*} placeholder The placeholder to replace. * @returns {Array} Returns the new array of placeholder indexes. */ function replaceHolders(array, placeholder) { var index = -1, length = array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (value === placeholder || value === PLACEHOLDER) { array[index] = PLACEHOLDER; result[resIndex++] = index; } } return result; } var _replaceHolders = replaceHolders; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG$3 = 1, WRAP_BIND_KEY_FLAG$2 = 2, WRAP_CURRY_FLAG$2 = 8, WRAP_CURRY_RIGHT_FLAG$1 = 16, WRAP_ARY_FLAG$1 = 128, WRAP_FLIP_FLAG$1 = 512; /** * Creates a function that wraps `func` to invoke it with optional `this` * binding of `thisArg`, partial application, and currying. * * @private * @param {Function|string} func The function or method name to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to * the new function. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [partialsRight] The arguments to append to those provided * to the new function. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { var isAry = bitmask & WRAP_ARY_FLAG$1, isBind = bitmask & WRAP_BIND_FLAG$3, isBindKey = bitmask & WRAP_BIND_KEY_FLAG$2, isCurried = bitmask & (WRAP_CURRY_FLAG$2 | WRAP_CURRY_RIGHT_FLAG$1), isFlip = bitmask & WRAP_FLIP_FLAG$1, Ctor = isBindKey ? undefined : _createCtor(func); function wrapper() { var length = arguments.length, args = Array(length), index = length; while (index--) { args[index] = arguments[index]; } if (isCurried) { var placeholder = _getHolder(wrapper), holdersCount = _countHolders(args, placeholder); } if (partials) { args = _composeArgs(args, partials, holders, isCurried); } if (partialsRight) { args = _composeArgsRight(args, partialsRight, holdersRight, isCurried); } length -= holdersCount; if (isCurried && length < arity) { var newHolders = _replaceHolders(args, placeholder); return _createRecurry( func, bitmask, createHybrid, wrapper.placeholder, thisArg, args, newHolders, argPos, ary, arity - length ); } var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func; length = args.length; if (argPos) { args = _reorder(args, argPos); } else if (isFlip && length > 1) { args.reverse(); } if (isAry && ary < length) { args.length = ary; } if (this && this !== _root && this instanceof wrapper) { fn = Ctor || _createCtor(fn); } return fn.apply(thisBinding, args); } return wrapper; } var _createHybrid = createHybrid; /** * Creates a function that wraps `func` to enable currying. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {number} arity The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createCurry(func, bitmask, arity) { var Ctor = _createCtor(func); function wrapper() { var length = arguments.length, args = Array(length), index = length, placeholder = _getHolder(wrapper); while (index--) { args[index] = arguments[index]; } var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) ? [] : _replaceHolders(args, placeholder); length -= holders.length; if (length < arity) { return _createRecurry( func, bitmask, _createHybrid, wrapper.placeholder, undefined, args, holders, undefined, undefined, arity - length); } var fn = (this && this !== _root && this instanceof wrapper) ? Ctor : func; return _apply(fn, this, args); } return wrapper; } var _createCurry = createCurry; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG$4 = 1; /** * Creates a function that wraps `func` to invoke it with the `this` binding * of `thisArg` and `partials` prepended to the arguments it receives. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} thisArg The `this` binding of `func`. * @param {Array} partials The arguments to prepend to those provided to * the new function. * @returns {Function} Returns the new wrapped function. */ function createPartial(func, bitmask, thisArg, partials) { var isBind = bitmask & WRAP_BIND_FLAG$4, Ctor = _createCtor(func); function wrapper() { var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array(leftLength + argsLength), fn = (this && this !== _root && this instanceof wrapper) ? Ctor : func; while (++leftIndex < leftLength) { args[leftIndex] = partials[leftIndex]; } while (argsLength--) { args[leftIndex++] = arguments[++argsIndex]; } return _apply(fn, isBind ? thisArg : this, args); } return wrapper; } var _createPartial = createPartial; /** Used as the internal argument placeholder. */ var PLACEHOLDER$1 = '__lodash_placeholder__'; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG$5 = 1, WRAP_BIND_KEY_FLAG$3 = 2, WRAP_CURRY_BOUND_FLAG$1 = 4, WRAP_CURRY_FLAG$3 = 8, WRAP_ARY_FLAG$2 = 128, WRAP_REARG_FLAG$1 = 256; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMin$2 = Math.min; /** * Merges the function metadata of `source` into `data`. * * Merging metadata reduces the number of wrappers used to invoke a function. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` * may be applied regardless of execution order. Methods like `_.ary` and * `_.rearg` modify function arguments, making the order in which they are * executed important, preventing the merging of metadata. However, we make * an exception for a safe combined case where curried functions have `_.ary` * and or `_.rearg` applied. * * @private * @param {Array} data The destination metadata. * @param {Array} source The source metadata. * @returns {Array} Returns `data`. */ function mergeData(data, source) { var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG$5 | WRAP_BIND_KEY_FLAG$3 | WRAP_ARY_FLAG$2); var isCombo = ((srcBitmask == WRAP_ARY_FLAG$2) && (bitmask == WRAP_CURRY_FLAG$3)) || ((srcBitmask == WRAP_ARY_FLAG$2) && (bitmask == WRAP_REARG_FLAG$1) && (data[7].length <= source[8])) || ((srcBitmask == (WRAP_ARY_FLAG$2 | WRAP_REARG_FLAG$1)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG$3)); // Exit early if metadata can't be merged. if (!(isCommon || isCombo)) { return data; } // Use source `thisArg` if available. if (srcBitmask & WRAP_BIND_FLAG$5) { data[2] = source[2]; // Set when currying a bound function. newBitmask |= bitmask & WRAP_BIND_FLAG$5 ? 0 : WRAP_CURRY_BOUND_FLAG$1; } // Compose partial arguments. var value = source[3]; if (value) { var partials = data[3]; data[3] = partials ? _composeArgs(partials, value, source[4]) : value; data[4] = partials ? _replaceHolders(data[3], PLACEHOLDER$1) : source[4]; } // Compose partial right arguments. value = source[5]; if (value) { partials = data[5]; data[5] = partials ? _composeArgsRight(partials, value, source[6]) : value; data[6] = partials ? _replaceHolders(data[5], PLACEHOLDER$1) : source[6]; } // Use source `argPos` if available. value = source[7]; if (value) { data[7] = value; } // Use source `ary` if it's smaller. if (srcBitmask & WRAP_ARY_FLAG$2) { data[8] = data[8] == null ? source[8] : nativeMin$2(data[8], source[8]); } // Use source `arity` if one is not provided. if (data[9] == null) { data[9] = source[9]; } // Use source `func` and merge bitmasks. data[0] = source[0]; data[1] = newBitmask; return data; } var _mergeData = mergeData; /** Error message constants. */ var FUNC_ERROR_TEXT$1 = 'Expected a function'; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG$6 = 1, WRAP_BIND_KEY_FLAG$4 = 2, WRAP_CURRY_FLAG$4 = 8, WRAP_CURRY_RIGHT_FLAG$2 = 16, WRAP_PARTIAL_FLAG$2 = 32, WRAP_PARTIAL_RIGHT_FLAG$2 = 64; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax$6 = Math.max; /** * Creates a function that either curries or invokes `func` with optional * `this` binding and partially applied arguments. * * @private * @param {Function|string} func The function or method name to wrap. * @param {number} bitmask The bitmask flags. * 1 - `_.bind` * 2 - `_.bindKey` * 4 - `_.curry` or `_.curryRight` of a bound function * 8 - `_.curry` * 16 - `_.curryRight` * 32 - `_.partial` * 64 - `_.partialRight` * 128 - `_.rearg` * 256 - `_.ary` * 512 - `_.flip` * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to be partially applied. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { var isBindKey = bitmask & WRAP_BIND_KEY_FLAG$4; if (!isBindKey && typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT$1); } var length = partials ? partials.length : 0; if (!length) { bitmask &= ~(WRAP_PARTIAL_FLAG$2 | WRAP_PARTIAL_RIGHT_FLAG$2); partials = holders = undefined; } ary = ary === undefined ? ary : nativeMax$6(toInteger_1(ary), 0); arity = arity === undefined ? arity : toInteger_1(arity); length -= holders ? holders.length : 0; if (bitmask & WRAP_PARTIAL_RIGHT_FLAG$2) { var partialsRight = partials, holdersRight = holders; partials = holders = undefined; } var data = isBindKey ? undefined : _getData(func); var newData = [ func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity ]; if (data) { _mergeData(newData, data); } func = newData[0]; bitmask = newData[1]; thisArg = newData[2]; partials = newData[3]; holders = newData[4]; arity = newData[9] = newData[9] === undefined ? (isBindKey ? 0 : func.length) : nativeMax$6(newData[9] - length, 0); if (!arity && bitmask & (WRAP_CURRY_FLAG$4 | WRAP_CURRY_RIGHT_FLAG$2)) { bitmask &= ~(WRAP_CURRY_FLAG$4 | WRAP_CURRY_RIGHT_FLAG$2); } if (!bitmask || bitmask == WRAP_BIND_FLAG$6) { var result = _createBind(func, bitmask, thisArg); } else if (bitmask == WRAP_CURRY_FLAG$4 || bitmask == WRAP_CURRY_RIGHT_FLAG$2) { result = _createCurry(func, bitmask, arity); } else if ((bitmask == WRAP_PARTIAL_FLAG$2 || bitmask == (WRAP_BIND_FLAG$6 | WRAP_PARTIAL_FLAG$2)) && !holders.length) { result = _createPartial(func, bitmask, thisArg, partials); } else { result = _createHybrid.apply(undefined, newData); } var setter = data ? _baseSetData : _setData; return _setWrapToString(setter(result, newData), func, bitmask); } var _createWrap = createWrap; /** Used to compose bitmasks for function metadata. */ var WRAP_PARTIAL_FLAG$3 = 32; /** * Creates a function that invokes `func` with `partials` prepended to the * arguments it receives. This method is like `_.bind` except it does **not** * alter the `this` binding. * * The `_.partial.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * **Note:** This method doesn't set the "length" property of partially * applied functions. * * @static * @memberOf _ * @since 0.2.0 * @category Function * @param {Function} func The function to partially apply arguments to. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new partially applied function. * @example * * function greet(greeting, name) { * return greeting + ' ' + name; * } * * var sayHelloTo = _.partial(greet, 'hello'); * sayHelloTo('fred'); * // => 'hello fred' * * // Partially applied with placeholders. * var greetFred = _.partial(greet, _, 'fred'); * greetFred('hi'); * // => 'hi fred' */ var partial = _baseRest(function(func, partials) { var holders = _replaceHolders(partials, _getHolder(partial)); return _createWrap(func, WRAP_PARTIAL_FLAG$3, undefined, partials, holders); }); // Assign default placeholders. partial.placeholder = {}; var partial_1 = partial; /** Used to compose bitmasks for function metadata. */ var WRAP_PARTIAL_RIGHT_FLAG$3 = 64; /** * This method is like `_.partial` except that partially applied arguments * are appended to the arguments it receives. * * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * **Note:** This method doesn't set the "length" property of partially * applied functions. * * @static * @memberOf _ * @since 1.0.0 * @category Function * @param {Function} func The function to partially apply arguments to. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new partially applied function. * @example * * function greet(greeting, name) { * return greeting + ' ' + name; * } * * var greetFred = _.partialRight(greet, 'fred'); * greetFred('hi'); * // => 'hi fred' * * // Partially applied with placeholders. * var sayHelloTo = _.partialRight(greet, 'hello', _); * sayHelloTo('fred'); * // => 'hello fred' */ var partialRight = _baseRest(function(func, partials) { var holders = _replaceHolders(partials, _getHolder(partialRight)); return _createWrap(func, WRAP_PARTIAL_RIGHT_FLAG$3, undefined, partials, holders); }); // Assign default placeholders. partialRight.placeholder = {}; var partialRight_1 = partialRight; /** * 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; } var _baseClamp = baseClamp; /** * Checks if `string` starts with the given target string. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {string} [target] The string to search for. * @param {number} [position=0] The position to search from. * @returns {boolean} Returns `true` if `string` starts with `target`, * else `false`. * @example * * _.startsWith('abc', 'a'); * // => true * * _.startsWith('abc', 'b'); * // => false * * _.startsWith('abc', 'b', 1); * // => true */ function startsWith(string, target, position) { string = toString_1(string); position = position == null ? 0 : _baseClamp(toInteger_1(position), 0, string.length); target = _baseToString(target); return string.slice(position, position + target.length) == target; } var startsWith_1 = startsWith; /** * Transform sort format from user friendly notation to lodash format * @param {string[]} sortBy array of predicate of the form "attribute:order" * @return {array.<string[]>} array containing 2 elements : attributes, orders */ var formatSort = function formatSort(sortBy, defaults) { return reduce_1(sortBy, function preparePredicate(out, sortInstruction) { var sortInstructions = sortInstruction.split(':'); if (defaults && sortInstructions.length === 1) { var similarDefault = find_1(defaults, function(predicate) { return startsWith_1(predicate, sortInstruction[0]); }); if (similarDefault) { sortInstructions = similarDefault.split(':'); } } out[0].push(sortInstructions[0]); out[1].push(sortInstructions[1]); return out; }, [[], []]); }; /** * The base implementation of `_.set`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @param {Function} [customizer] The function to customize path creation. * @returns {Object} Returns `object`. */ function baseSet(object, path, value, customizer) { if (!isObject_1(object)) { return object; } path = _castPath(path, object); var index = -1, length = path.length, lastIndex = length - 1, nested = object; while (nested != null && ++index < length) { var key = _toKey(path[index]), newValue = value; if (index != lastIndex) { var objValue = nested[key]; newValue = customizer ? customizer(objValue, key, nested) : undefined; if (newValue === undefined) { newValue = isObject_1(objValue) ? objValue : (_isIndex(path[index + 1]) ? [] : {}); } } _assignValue(nested, key, newValue); nested = nested[key]; } return object; } var _baseSet = baseSet; /** * The base implementation of `_.pickBy` without support for iteratee shorthands. * * @private * @param {Object} object The source object. * @param {string[]} paths The property paths to pick. * @param {Function} predicate The function invoked per property. * @returns {Object} Returns the new object. */ function basePickBy(object, paths, predicate) { var index = -1, length = paths.length, result = {}; while (++index < length) { var path = paths[index], value = _baseGet(object, path); if (predicate(value, path)) { _baseSet(result, _castPath(path, object), value); } } return result; } var _basePickBy = basePickBy; /** * Creates an object composed of the `object` properties `predicate` returns * truthy for. The predicate is invoked with two arguments: (value, key). * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The source object. * @param {Function} [predicate=_.identity] The function invoked per property. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.pickBy(object, _.isNumber); * // => { 'a': 1, 'c': 3 } */ function pickBy(object, predicate) { if (object == null) { return {}; } var props = _arrayMap(_getAllKeysIn(object), function(prop) { return [prop]; }); predicate = _baseIteratee(predicate); return _basePickBy(object, props, function(value, path) { return predicate(value, path[0]); }); } var pickBy_1 = pickBy; var generateHierarchicalTree_1 = generateTrees; function generateTrees(state) { return function generate(hierarchicalFacetResult, hierarchicalFacetIndex) { var hierarchicalFacet = state.hierarchicalFacets[hierarchicalFacetIndex]; var hierarchicalFacetRefinement = state.hierarchicalFacetsRefinements[hierarchicalFacet.name] && state.hierarchicalFacetsRefinements[hierarchicalFacet.name][0] || ''; var hierarchicalSeparator = state._getHierarchicalFacetSeparator(hierarchicalFacet); var hierarchicalRootPath = state._getHierarchicalRootPath(hierarchicalFacet); var hierarchicalShowParentLevel = state._getHierarchicalShowParentLevel(hierarchicalFacet); var sortBy = formatSort(state._getHierarchicalFacetSortBy(hierarchicalFacet)); var generateTreeFn = generateHierarchicalTree(sortBy, hierarchicalSeparator, hierarchicalRootPath, hierarchicalShowParentLevel, hierarchicalFacetRefinement); var results = hierarchicalFacetResult; if (hierarchicalRootPath) { results = hierarchicalFacetResult.slice(hierarchicalRootPath.split(hierarchicalSeparator).length); } return reduce_1(results, generateTreeFn, { name: state.hierarchicalFacets[hierarchicalFacetIndex].name, count: null, // root level, no count isRefined: true, // root level, always refined path: null, // root level, no path data: null }); }; } function generateHierarchicalTree(sortBy, hierarchicalSeparator, hierarchicalRootPath, hierarchicalShowParentLevel, currentRefinement) { return function generateTree(hierarchicalTree, hierarchicalFacetResult, currentHierarchicalLevel) { var parent = hierarchicalTree; if (currentHierarchicalLevel > 0) { var level = 0; parent = hierarchicalTree; while (level < currentHierarchicalLevel) { parent = parent && find_1(parent.data, {isRefined: true}); level++; } } // we found a refined parent, let's add current level data under it if (parent) { // filter values in case an object has multiple categories: // { // categories: { // level0: ['beers', 'bières'], // level1: ['beers > IPA', 'bières > Belges'] // } // } // // If parent refinement is `beers`, then we do not want to have `bières > Belges` // showing up var onlyMatchingValuesFn = filterFacetValues(parent.path || hierarchicalRootPath, currentRefinement, hierarchicalSeparator, hierarchicalRootPath, hierarchicalShowParentLevel); parent.data = orderBy_1( map_1( pickBy_1(hierarchicalFacetResult.data, onlyMatchingValuesFn), formatHierarchicalFacetValue(hierarchicalSeparator, currentRefinement) ), sortBy[0], sortBy[1] ); } return hierarchicalTree; }; } function filterFacetValues(parentPath, currentRefinement, hierarchicalSeparator, hierarchicalRootPath, hierarchicalShowParentLevel) { return function(facetCount, facetValue) { // we want the facetValue is a child of hierarchicalRootPath if (hierarchicalRootPath && (facetValue.indexOf(hierarchicalRootPath) !== 0 || hierarchicalRootPath === facetValue)) { return false; } // we always want root levels (only when there is no prefix path) return !hierarchicalRootPath && facetValue.indexOf(hierarchicalSeparator) === -1 || // if there is a rootPath, being root level mean 1 level under rootPath hierarchicalRootPath && facetValue.split(hierarchicalSeparator).length - hierarchicalRootPath.split(hierarchicalSeparator).length === 1 || // if current refinement is a root level and current facetValue is a root level, // keep the facetValue facetValue.indexOf(hierarchicalSeparator) === -1 && currentRefinement.indexOf(hierarchicalSeparator) === -1 || // currentRefinement is a child of the facet value currentRefinement.indexOf(facetValue) === 0 || // facetValue is a child of the current parent, add it facetValue.indexOf(parentPath + hierarchicalSeparator) === 0 && (hierarchicalShowParentLevel || facetValue.indexOf(currentRefinement) === 0); }; } function formatHierarchicalFacetValue(hierarchicalSeparator, currentRefinement) { return function format(facetCount, facetValue) { return { name: trim_1(last_1(facetValue.split(hierarchicalSeparator))), path: facetValue, count: facetCount, isRefined: currentRefinement === facetValue || currentRefinement.indexOf(facetValue + hierarchicalSeparator) === 0, data: null }; }; } /** * @typedef SearchResults.Facet * @type {object} * @property {string} name name of the attribute in the record * @property {object} data the faceting data: value, number of entries * @property {object} stats undefined unless facet_stats is retrieved from algolia */ /** * @typedef SearchResults.HierarchicalFacet * @type {object} * @property {string} name name of the current value given the hierarchical level, trimmed. * If root node, you get the facet name * @property {number} count number of objects matching this hierarchical value * @property {string} path the current hierarchical value full path * @property {boolean} isRefined `true` if the current value was refined, `false` otherwise * @property {HierarchicalFacet[]} data sub values for the current level */ /** * @typedef SearchResults.FacetValue * @type {object} * @property {string} name the facet value itself * @property {number} count times this facet appears in the results * @property {boolean} isRefined is the facet currently selected * @property {boolean} isExcluded is the facet currently excluded (only for conjunctive facets) */ /** * @typedef Refinement * @type {object} * @property {string} type the type of filter used: * `numeric`, `facet`, `exclude`, `disjunctive`, `hierarchical` * @property {string} attributeName name of the attribute used for filtering * @property {string} name the value of the filter * @property {number} numericValue the value as a number. Only for numeric filters. * @property {string} operator the operator used. Only for numeric filters. * @property {number} count the number of computed hits for this filter. Only on facets. * @property {boolean} exhaustive if the count is exhaustive */ function getIndices(obj) { var indices = {}; forEach_1(obj, function(val, idx) { indices[val] = idx; }); return indices; } function assignFacetStats(dest, facetStats, key) { if (facetStats && facetStats[key]) { dest.stats = facetStats[key]; } } function findMatchingHierarchicalFacetFromAttributeName(hierarchicalFacets, hierarchicalAttributeName) { return find_1( hierarchicalFacets, function facetKeyMatchesAttribute(hierarchicalFacet) { return includes_1(hierarchicalFacet.attributes, hierarchicalAttributeName); } ); } /*eslint-disable */ /** * Constructor for SearchResults * @class * @classdesc SearchResults contains the results of a query to Algolia using the * {@link AlgoliaSearchHelper}. * @param {SearchParameters} state state that led to the response * @param {array.<object>} results the results from algolia client * @example <caption>SearchResults of the first query in * <a href="http://demos.algolia.com/instant-search-demo">the instant search demo</a></caption> { "hitsPerPage": 10, "processingTimeMS": 2, "facets": [ { "name": "type", "data": { "HardGood": 6627, "BlackTie": 550, "Music": 665, "Software": 131, "Game": 456, "Movie": 1571 }, "exhaustive": false }, { "exhaustive": false, "data": { "Free shipping": 5507 }, "name": "shipping" } ], "hits": [ { "thumbnailImage": "http://img.bbystatic.com/BestBuy_US/images/products/1688/1688832_54x108_s.gif", "_highlightResult": { "shortDescription": { "matchLevel": "none", "value": "Safeguard your PC, Mac, Android and iOS devices with comprehensive Internet protection", "matchedWords": [] }, "category": { "matchLevel": "none", "value": "Computer Security Software", "matchedWords": [] }, "manufacturer": { "matchedWords": [], "value": "Webroot", "matchLevel": "none" }, "name": { "value": "Webroot SecureAnywhere Internet Security (3-Device) (1-Year Subscription) - Mac/Windows", "matchedWords": [], "matchLevel": "none" } }, "image": "http://img.bbystatic.com/BestBuy_US/images/products/1688/1688832_105x210_sc.jpg", "shipping": "Free shipping", "bestSellingRank": 4, "shortDescription": "Safeguard your PC, Mac, Android and iOS devices with comprehensive Internet protection", "url": "http://www.bestbuy.com/site/webroot-secureanywhere-internet-security-3-devi…d=1219060687969&skuId=1688832&cmp=RMX&ky=2d3GfEmNIzjA0vkzveHdZEBgpPCyMnLTJ", "name": "Webroot SecureAnywhere Internet Security (3-Device) (1-Year Subscription) - Mac/Windows", "category": "Computer Security Software", "salePrice_range": "1 - 50", "objectID": "1688832", "type": "Software", "customerReviewCount": 5980, "salePrice": 49.99, "manufacturer": "Webroot" }, .... ], "nbHits": 10000, "disjunctiveFacets": [ { "exhaustive": false, "data": { "5": 183, "12": 112, "7": 149, ... }, "name": "customerReviewCount", "stats": { "max": 7461, "avg": 157.939, "min": 1 } }, { "data": { "Printer Ink": 142, "Wireless Speakers": 60, "Point & Shoot Cameras": 48, ... }, "name": "category", "exhaustive": false }, { "exhaustive": false, "data": { "> 5000": 2, "1 - 50": 6524, "501 - 2000": 566, "201 - 500": 1501, "101 - 200": 1360, "2001 - 5000": 47 }, "name": "salePrice_range" }, { "data": { "Dynex™": 202, "Insignia™": 230, "PNY": 72, ... }, "name": "manufacturer", "exhaustive": false } ], "query": "", "nbPages": 100, "page": 0, "index": "bestbuy" } **/ /*eslint-enable */ function SearchResults(state, results) { var mainSubResponse = results[0]; this._rawResults = results; /** * query used to generate the results * @member {string} */ this.query = mainSubResponse.query; /** * The query as parsed by the engine given all the rules. * @member {string} */ this.parsedQuery = mainSubResponse.parsedQuery; /** * all the records that match the search parameters. Each record is * augmented with a new attribute `_highlightResult` * which is an object keyed by attribute and with the following properties: * - `value` : the value of the facet highlighted (html) * - `matchLevel`: full, partial or none depending on how the query terms match * @member {object[]} */ this.hits = mainSubResponse.hits; /** * index where the results come from * @member {string} */ this.index = mainSubResponse.index; /** * number of hits per page requested * @member {number} */ this.hitsPerPage = mainSubResponse.hitsPerPage; /** * total number of hits of this query on the index * @member {number} */ this.nbHits = mainSubResponse.nbHits; /** * total number of pages with respect to the number of hits per page and the total number of hits * @member {number} */ this.nbPages = mainSubResponse.nbPages; /** * current page * @member {number} */ this.page = mainSubResponse.page; /** * sum of the processing time of all the queries * @member {number} */ this.processingTimeMS = sumBy_1(results, 'processingTimeMS'); /** * The position if the position was guessed by IP. * @member {string} * @example "48.8637,2.3615", */ this.aroundLatLng = mainSubResponse.aroundLatLng; /** * The radius computed by Algolia. * @member {string} * @example "126792922", */ this.automaticRadius = mainSubResponse.automaticRadius; /** * String identifying the server used to serve this request. * @member {string} * @example "c7-use-2.algolia.net", */ this.serverUsed = mainSubResponse.serverUsed; /** * Boolean that indicates if the computation of the counts did time out. * @deprecated * @member {boolean} */ this.timeoutCounts = mainSubResponse.timeoutCounts; /** * Boolean that indicates if the computation of the hits did time out. * @deprecated * @member {boolean} */ this.timeoutHits = mainSubResponse.timeoutHits; /** * True if the counts of the facets is exhaustive * @member {boolean} */ this.exhaustiveFacetsCount = mainSubResponse.exhaustiveFacetsCount; /** * True if the number of hits is exhaustive * @member {boolean} */ this.exhaustiveNbHits = mainSubResponse.exhaustiveNbHits; /** * Contains the userData if they are set by a [query rule](https://www.algolia.com/doc/guides/query-rules/query-rules-overview/). * @member {object[]} */ this.userData = mainSubResponse.userData; /** * queryID is the unique identifier of the query used to generate the current search results. * This value is only available if the `clickAnalytics` search parameter is set to `true`. * @member {string} */ this.queryID = mainSubResponse.queryID; /** * disjunctive facets results * @member {SearchResults.Facet[]} */ this.disjunctiveFacets = []; /** * disjunctive facets results * @member {SearchResults.HierarchicalFacet[]} */ this.hierarchicalFacets = map_1(state.hierarchicalFacets, function initFutureTree() { return []; }); /** * other facets results * @member {SearchResults.Facet[]} */ this.facets = []; var disjunctiveFacets = state.getRefinedDisjunctiveFacets(); var facetsIndices = getIndices(state.facets); var disjunctiveFacetsIndices = getIndices(state.disjunctiveFacets); var nextDisjunctiveResult = 1; var self = this; // Since we send request only for disjunctive facets that have been refined, // we get the facets informations from the first, general, response. forEach_1(mainSubResponse.facets, function(facetValueObject, facetKey) { var hierarchicalFacet = findMatchingHierarchicalFacetFromAttributeName( state.hierarchicalFacets, facetKey ); if (hierarchicalFacet) { // Place the hierarchicalFacet data at the correct index depending on // the attributes order that was defined at the helper initialization var facetIndex = hierarchicalFacet.attributes.indexOf(facetKey); var idxAttributeName = findIndex_1(state.hierarchicalFacets, {name: hierarchicalFacet.name}); self.hierarchicalFacets[idxAttributeName][facetIndex] = { attribute: facetKey, data: facetValueObject, exhaustive: mainSubResponse.exhaustiveFacetsCount }; } else { var isFacetDisjunctive = indexOf_1(state.disjunctiveFacets, facetKey) !== -1; var isFacetConjunctive = indexOf_1(state.facets, facetKey) !== -1; var position; if (isFacetDisjunctive) { position = disjunctiveFacetsIndices[facetKey]; self.disjunctiveFacets[position] = { name: facetKey, data: facetValueObject, exhaustive: mainSubResponse.exhaustiveFacetsCount }; assignFacetStats(self.disjunctiveFacets[position], mainSubResponse.facets_stats, facetKey); } if (isFacetConjunctive) { position = facetsIndices[facetKey]; self.facets[position] = { name: facetKey, data: facetValueObject, exhaustive: mainSubResponse.exhaustiveFacetsCount }; assignFacetStats(self.facets[position], mainSubResponse.facets_stats, facetKey); } } }); // Make sure we do not keep holes within the hierarchical facets this.hierarchicalFacets = compact_1(this.hierarchicalFacets); // aggregate the refined disjunctive facets forEach_1(disjunctiveFacets, function(disjunctiveFacet) { var result = results[nextDisjunctiveResult]; var hierarchicalFacet = state.getHierarchicalFacetByName(disjunctiveFacet); // There should be only item in facets. forEach_1(result.facets, function(facetResults, dfacet) { var position; if (hierarchicalFacet) { position = findIndex_1(state.hierarchicalFacets, {name: hierarchicalFacet.name}); var attributeIndex = findIndex_1(self.hierarchicalFacets[position], {attribute: dfacet}); // previous refinements and no results so not able to find it if (attributeIndex === -1) { return; } self.hierarchicalFacets[position][attributeIndex].data = merge_1( {}, self.hierarchicalFacets[position][attributeIndex].data, facetResults ); } else { position = disjunctiveFacetsIndices[dfacet]; var dataFromMainRequest = mainSubResponse.facets && mainSubResponse.facets[dfacet] || {}; self.disjunctiveFacets[position] = { name: dfacet, data: defaults_1({}, facetResults, dataFromMainRequest), exhaustive: result.exhaustiveFacetsCount }; assignFacetStats(self.disjunctiveFacets[position], result.facets_stats, dfacet); if (state.disjunctiveFacetsRefinements[dfacet]) { forEach_1(state.disjunctiveFacetsRefinements[dfacet], function(refinementValue) { // add the disjunctive refinements if it is no more retrieved if (!self.disjunctiveFacets[position].data[refinementValue] && indexOf_1(state.disjunctiveFacetsRefinements[dfacet], refinementValue) > -1) { self.disjunctiveFacets[position].data[refinementValue] = 0; } }); } } }); nextDisjunctiveResult++; }); // if we have some root level values for hierarchical facets, merge them forEach_1(state.getRefinedHierarchicalFacets(), function(refinedFacet) { var hierarchicalFacet = state.getHierarchicalFacetByName(refinedFacet); var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet); var currentRefinement = state.getHierarchicalRefinement(refinedFacet); // if we are already at a root refinement (or no refinement at all), there is no // root level values request if (currentRefinement.length === 0 || currentRefinement[0].split(separator).length < 2) { return; } var result = results[nextDisjunctiveResult]; forEach_1(result.facets, function(facetResults, dfacet) { var position = findIndex_1(state.hierarchicalFacets, {name: hierarchicalFacet.name}); var attributeIndex = findIndex_1(self.hierarchicalFacets[position], {attribute: dfacet}); // previous refinements and no results so not able to find it if (attributeIndex === -1) { return; } // when we always get root levels, if the hits refinement is `beers > IPA` (count: 5), // then the disjunctive values will be `beers` (count: 100), // but we do not want to display // | beers (100) // > IPA (5) // We want // | beers (5) // > IPA (5) var defaultData = {}; if (currentRefinement.length > 0) { var root = currentRefinement[0].split(separator)[0]; defaultData[root] = self.hierarchicalFacets[position][attributeIndex].data[root]; } self.hierarchicalFacets[position][attributeIndex].data = defaults_1( defaultData, facetResults, self.hierarchicalFacets[position][attributeIndex].data ); }); nextDisjunctiveResult++; }); // add the excludes forEach_1(state.facetsExcludes, function(excludes, facetName) { var position = facetsIndices[facetName]; self.facets[position] = { name: facetName, data: mainSubResponse.facets[facetName], exhaustive: mainSubResponse.exhaustiveFacetsCount }; forEach_1(excludes, function(facetValue) { self.facets[position] = self.facets[position] || {name: facetName}; self.facets[position].data = self.facets[position].data || {}; self.facets[position].data[facetValue] = 0; }); }); this.hierarchicalFacets = map_1(this.hierarchicalFacets, generateHierarchicalTree_1(state)); this.facets = compact_1(this.facets); this.disjunctiveFacets = compact_1(this.disjunctiveFacets); this._state = state; } /** * Get a facet object with its name * @deprecated * @param {string} name name of the faceted attribute * @return {SearchResults.Facet} the facet object */ SearchResults.prototype.getFacetByName = function(name) { var predicate = {name: name}; return find_1(this.facets, predicate) || find_1(this.disjunctiveFacets, predicate) || find_1(this.hierarchicalFacets, predicate); }; /** * Get the facet values of a specified attribute from a SearchResults object. * @private * @param {SearchResults} results the search results to search in * @param {string} attribute name of the faceted attribute to search for * @return {array|object} facet values. For the hierarchical facets it is an object. */ function extractNormalizedFacetValues(results, attribute) { var predicate = {name: attribute}; if (results._state.isConjunctiveFacet(attribute)) { var facet = find_1(results.facets, predicate); if (!facet) return []; return map_1(facet.data, function(v, k) { return { name: k, count: v, isRefined: results._state.isFacetRefined(attribute, k), isExcluded: results._state.isExcludeRefined(attribute, k) }; }); } else if (results._state.isDisjunctiveFacet(attribute)) { var disjunctiveFacet = find_1(results.disjunctiveFacets, predicate); if (!disjunctiveFacet) return []; return map_1(disjunctiveFacet.data, function(v, k) { return { name: k, count: v, isRefined: results._state.isDisjunctiveFacetRefined(attribute, k) }; }); } else if (results._state.isHierarchicalFacet(attribute)) { return find_1(results.hierarchicalFacets, predicate); } } /** * Sort nodes of a hierarchical facet results * @private * @param {HierarchicalFacet} node node to upon which we want to apply the sort */ function recSort(sortFn, node) { if (!node.data || node.data.length === 0) { return node; } var children = map_1(node.data, partial_1(recSort, sortFn)); var sortedChildren = sortFn(children); var newNode = merge_1({}, node, {data: sortedChildren}); return newNode; } SearchResults.DEFAULT_SORT = ['isRefined:desc', 'count:desc', 'name:asc']; function vanillaSortFn(order, data) { return data.sort(order); } /** * Get a the list of values for a given facet attribute. Those values are sorted * refinement first, descending count (bigger value on top), and name ascending * (alphabetical order). The sort formula can overridden using either string based * predicates or a function. * * This method will return all the values returned by the Algolia engine plus all * the values already refined. This means that it can happen that the * `maxValuesPerFacet` [configuration](https://www.algolia.com/doc/rest-api/search#param-maxValuesPerFacet) * might not be respected if you have facet values that are already refined. * @param {string} attribute attribute name * @param {object} opts configuration options. * @param {Array.<string> | function} opts.sortBy * When using strings, it consists of * the name of the [FacetValue](#SearchResults.FacetValue) or the * [HierarchicalFacet](#SearchResults.HierarchicalFacet) attributes with the * order (`asc` or `desc`). For example to order the value by count, the * argument would be `['count:asc']`. * * If only the attribute name is specified, the ordering defaults to the one * specified in the default value for this attribute. * * When not specified, the order is * ascending. This parameter can also be a function which takes two facet * values and should return a number, 0 if equal, 1 if the first argument is * bigger or -1 otherwise. * * The default value for this attribute `['isRefined:desc', 'count:desc', 'name:asc']` * @return {FacetValue[]|HierarchicalFacet} depending on the type of facet of * the attribute requested (hierarchical, disjunctive or conjunctive) * @example * helper.on('results', function(content){ * //get values ordered only by name ascending using the string predicate * content.getFacetValues('city', {sortBy: ['name:asc']}); * //get values ordered only by count ascending using a function * content.getFacetValues('city', { * // this is equivalent to ['count:asc'] * sortBy: function(a, b) { * if (a.count === b.count) return 0; * if (a.count > b.count) return 1; * if (b.count > a.count) return -1; * } * }); * }); */ SearchResults.prototype.getFacetValues = function(attribute, opts) { var facetValues = extractNormalizedFacetValues(this, attribute); if (!facetValues) throw new Error(attribute + ' is not a retrieved facet.'); var options = defaults_1({}, opts, {sortBy: SearchResults.DEFAULT_SORT}); if (Array.isArray(options.sortBy)) { var order = formatSort(options.sortBy, SearchResults.DEFAULT_SORT); if (Array.isArray(facetValues)) { return orderBy_1(facetValues, order[0], order[1]); } // If facetValues is not an array, it's an object thus a hierarchical facet object return recSort(partialRight_1(orderBy_1, order[0], order[1]), facetValues); } else if (isFunction_1(options.sortBy)) { if (Array.isArray(facetValues)) { return facetValues.sort(options.sortBy); } // If facetValues is not an array, it's an object thus a hierarchical facet object return recSort(partial_1(vanillaSortFn, options.sortBy), facetValues); } throw new Error( 'options.sortBy is optional but if defined it must be ' + 'either an array of string (predicates) or a sorting function' ); }; /** * Returns the facet stats if attribute is defined and the facet contains some. * Otherwise returns undefined. * @param {string} attribute name of the faceted attribute * @return {object} The stats of the facet */ SearchResults.prototype.getFacetStats = function(attribute) { if (this._state.isConjunctiveFacet(attribute)) { return getFacetStatsIfAvailable(this.facets, attribute); } else if (this._state.isDisjunctiveFacet(attribute)) { return getFacetStatsIfAvailable(this.disjunctiveFacets, attribute); } throw new Error(attribute + ' is not present in `facets` or `disjunctiveFacets`'); }; function getFacetStatsIfAvailable(facetList, facetName) { var data = find_1(facetList, {name: facetName}); return data && data.stats; } /** * Returns all refinements for all filters + tags. It also provides * additional information: count and exhausistivity for each filter. * * See the [refinement type](#Refinement) for an exhaustive view of the available * data. * * @return {Array.<Refinement>} all the refinements */ SearchResults.prototype.getRefinements = function() { var state = this._state; var results = this; var res = []; forEach_1(state.facetsRefinements, function(refinements, attributeName) { forEach_1(refinements, function(name) { res.push(getRefinement(state, 'facet', attributeName, name, results.facets)); }); }); forEach_1(state.facetsExcludes, function(refinements, attributeName) { forEach_1(refinements, function(name) { res.push(getRefinement(state, 'exclude', attributeName, name, results.facets)); }); }); forEach_1(state.disjunctiveFacetsRefinements, function(refinements, attributeName) { forEach_1(refinements, function(name) { res.push(getRefinement(state, 'disjunctive', attributeName, name, results.disjunctiveFacets)); }); }); forEach_1(state.hierarchicalFacetsRefinements, function(refinements, attributeName) { forEach_1(refinements, function(name) { res.push(getHierarchicalRefinement(state, attributeName, name, results.hierarchicalFacets)); }); }); forEach_1(state.numericRefinements, function(operators, attributeName) { forEach_1(operators, function(values, operator) { forEach_1(values, function(value) { res.push({ type: 'numeric', attributeName: attributeName, name: value, numericValue: value, operator: operator }); }); }); }); forEach_1(state.tagRefinements, function(name) { res.push({type: 'tag', attributeName: '_tags', name: name}); }); return res; }; function getRefinement(state, type, attributeName, name, resultsFacets) { var facet = find_1(resultsFacets, {name: attributeName}); var count = get_1(facet, 'data[' + name + ']'); var exhaustive = get_1(facet, 'exhaustive'); return { type: type, attributeName: attributeName, name: name, count: count || 0, exhaustive: exhaustive || false }; } function getHierarchicalRefinement(state, attributeName, name, resultsFacets) { var facet = find_1(resultsFacets, {name: attributeName}); var facetDeclaration = state.getHierarchicalFacetByName(attributeName); var splitted = name.split(facetDeclaration.separator); var configuredName = splitted[splitted.length - 1]; for (var i = 0; facet !== undefined && i < splitted.length; ++i) { facet = find_1(facet.data, {name: splitted[i]}); } var count = get_1(facet, 'count'); var exhaustive = get_1(facet, 'exhaustive'); return { type: 'hierarchical', attributeName: attributeName, name: configuredName, count: count || 0, exhaustive: exhaustive || false }; } var SearchResults_1 = SearchResults; var isBufferBrowser = function isBuffer(arg) { return arg && typeof arg === 'object' && typeof arg.copy === 'function' && typeof arg.fill === 'function' && typeof arg.readUInt8 === 'function'; }; var inherits_browser = createCommonjsModule(function (module) { if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor; ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }); }; } else { // old school shim for old browsers module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor; var TempCtor = function () {}; TempCtor.prototype = superCtor.prototype; ctor.prototype = new TempCtor(); ctor.prototype.constructor = ctor; }; } }); var util = createCommonjsModule(function (module, exports) { // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var formatRegExp = /%[sdj%]/g; exports.format = function(f) { if (!isString(f)) { var objects = []; for (var i = 0; i < arguments.length; i++) { objects.push(inspect(arguments[i])); } return objects.join(' '); } var i = 1; var args = arguments; var len = args.length; var str = String(f).replace(formatRegExp, function(x) { if (x === '%%') return '%'; if (i >= len) return x; switch (x) { case '%s': return String(args[i++]); case '%d': return Number(args[i++]); case '%j': try { return JSON.stringify(args[i++]); } catch (_) { return '[Circular]'; } default: return x; } }); for (var x = args[i]; i < len; x = args[++i]) { if (isNull(x) || !isObject(x)) { str += ' ' + x; } else { str += ' ' + inspect(x); } } return str; }; // Mark that a method should not be used. // Returns a modified function which warns once by default. // If --no-deprecation is set, then it is a no-op. exports.deprecate = function(fn, msg) { // Allow for deprecating things in the process of starting up. if (isUndefined(commonjsGlobal.process)) { return function() { return exports.deprecate(fn, msg).apply(this, arguments); }; } var warned = false; function deprecated() { if (!warned) { { console.error(msg); } warned = true; } return fn.apply(this, arguments); } return deprecated; }; var debugs = {}; var debugEnviron; exports.debuglog = function(set) { if (isUndefined(debugEnviron)) debugEnviron = ''; set = set.toUpperCase(); if (!debugs[set]) { if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { var pid = process.pid; debugs[set] = function() { var msg = exports.format.apply(exports, arguments); console.error('%s %d: %s', set, pid, msg); }; } else { debugs[set] = function() {}; } } return debugs[set]; }; /** * Echos the value of a value. Trys to print the value out * in the best way possible given the different types. * * @param {Object} obj The object to print out. * @param {Object} opts Optional options object that alters the output. */ /* legacy: obj, showHidden, depth, colors*/ function inspect(obj, opts) { // default options var ctx = { seen: [], stylize: stylizeNoColor }; // legacy... if (arguments.length >= 3) ctx.depth = arguments[2]; if (arguments.length >= 4) ctx.colors = arguments[3]; if (isBoolean(opts)) { // legacy... ctx.showHidden = opts; } else if (opts) { // got an "options" object exports._extend(ctx, opts); } // set default options if (isUndefined(ctx.showHidden)) ctx.showHidden = false; if (isUndefined(ctx.depth)) ctx.depth = 2; if (isUndefined(ctx.colors)) ctx.colors = false; if (isUndefined(ctx.customInspect)) ctx.customInspect = true; if (ctx.colors) ctx.stylize = stylizeWithColor; return formatValue(ctx, obj, ctx.depth); } exports.inspect = inspect; // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics inspect.colors = { 'bold' : [1, 22], 'italic' : [3, 23], 'underline' : [4, 24], 'inverse' : [7, 27], 'white' : [37, 39], 'grey' : [90, 39], 'black' : [30, 39], 'blue' : [34, 39], 'cyan' : [36, 39], 'green' : [32, 39], 'magenta' : [35, 39], 'red' : [31, 39], 'yellow' : [33, 39] }; // Don't use 'blue' not visible on cmd.exe inspect.styles = { 'special': 'cyan', 'number': 'yellow', 'boolean': 'yellow', 'undefined': 'grey', 'null': 'bold', 'string': 'green', 'date': 'magenta', // "name": intentionally not styling 'regexp': 'red' }; function stylizeWithColor(str, styleType) { var style = inspect.styles[styleType]; if (style) { return '\u001b[' + inspect.colors[style][0] + 'm' + str + '\u001b[' + inspect.colors[style][1] + 'm'; } else { return str; } } function stylizeNoColor(str, styleType) { return str; } function arrayToHash(array) { var hash = {}; array.forEach(function(val, idx) { hash[val] = true; }); return hash; } function formatValue(ctx, value, recurseTimes) { // Provide a hook for user-specified inspect functions. // Check that value is an object with an inspect function on it if (ctx.customInspect && value && isFunction(value.inspect) && // Filter out the util module, it's inspect function is special value.inspect !== exports.inspect && // Also filter out any prototype objects using the circular check. !(value.constructor && value.constructor.prototype === value)) { var ret = value.inspect(recurseTimes, ctx); if (!isString(ret)) { ret = formatValue(ctx, ret, recurseTimes); } return ret; } // Primitive types cannot have properties var primitive = formatPrimitive(ctx, value); if (primitive) { return primitive; } // Look up the keys of the object. var keys = Object.keys(value); var visibleKeys = arrayToHash(keys); if (ctx.showHidden) { keys = Object.getOwnPropertyNames(value); } // IE doesn't make error fields non-enumerable // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx if (isError(value) && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { return formatError(value); } // Some type of object without properties can be shortcutted. if (keys.length === 0) { if (isFunction(value)) { var name = value.name ? ': ' + value.name : ''; return ctx.stylize('[Function' + name + ']', 'special'); } if (isRegExp(value)) { return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); } if (isDate(value)) { return ctx.stylize(Date.prototype.toString.call(value), 'date'); } if (isError(value)) { return formatError(value); } } var base = '', array = false, braces = ['{', '}']; // Make Array say that they are Array if (isArray(value)) { array = true; braces = ['[', ']']; } // Make functions say that they are functions if (isFunction(value)) { var n = value.name ? ': ' + value.name : ''; base = ' [Function' + n + ']'; } // Make RegExps say that they are RegExps if (isRegExp(value)) { base = ' ' + RegExp.prototype.toString.call(value); } // Make dates with properties first say the date if (isDate(value)) { base = ' ' + Date.prototype.toUTCString.call(value); } // Make error with message first say the error if (isError(value)) { base = ' ' + formatError(value); } if (keys.length === 0 && (!array || value.length == 0)) { return braces[0] + base + braces[1]; } if (recurseTimes < 0) { if (isRegExp(value)) { return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); } else { return ctx.stylize('[Object]', 'special'); } } ctx.seen.push(value); var output; if (array) { output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); } else { output = keys.map(function(key) { return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); }); } ctx.seen.pop(); return reduceToSingleString(output, base, braces); } function formatPrimitive(ctx, value) { if (isUndefined(value)) return ctx.stylize('undefined', 'undefined'); if (isString(value)) { var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') .replace(/'/g, "\\'") .replace(/\\"/g, '"') + '\''; return ctx.stylize(simple, 'string'); } if (isNumber(value)) return ctx.stylize('' + value, 'number'); if (isBoolean(value)) return ctx.stylize('' + value, 'boolean'); // For some reason typeof null is "object", so special case here. if (isNull(value)) return ctx.stylize('null', 'null'); } function formatError(value) { return '[' + Error.prototype.toString.call(value) + ']'; } function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { var output = []; for (var i = 0, l = value.length; i < l; ++i) { if (hasOwnProperty(value, String(i))) { output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true)); } else { output.push(''); } } keys.forEach(function(key) { if (!key.match(/^\d+$/)) { output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true)); } }); return output; } function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { var name, str, desc; desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; if (desc.get) { if (desc.set) { str = ctx.stylize('[Getter/Setter]', 'special'); } else { str = ctx.stylize('[Getter]', 'special'); } } else { if (desc.set) { str = ctx.stylize('[Setter]', 'special'); } } if (!hasOwnProperty(visibleKeys, key)) { name = '[' + key + ']'; } if (!str) { if (ctx.seen.indexOf(desc.value) < 0) { if (isNull(recurseTimes)) { str = formatValue(ctx, desc.value, null); } else { str = formatValue(ctx, desc.value, recurseTimes - 1); } if (str.indexOf('\n') > -1) { if (array) { str = str.split('\n').map(function(line) { return ' ' + line; }).join('\n').substr(2); } else { str = '\n' + str.split('\n').map(function(line) { return ' ' + line; }).join('\n'); } } } else { str = ctx.stylize('[Circular]', 'special'); } } if (isUndefined(name)) { if (array && key.match(/^\d+$/)) { return str; } name = JSON.stringify('' + key); if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { name = name.substr(1, name.length - 2); name = ctx.stylize(name, 'name'); } else { name = name.replace(/'/g, "\\'") .replace(/\\"/g, '"') .replace(/(^"|"$)/g, "'"); name = ctx.stylize(name, 'string'); } } return name + ': ' + str; } function reduceToSingleString(output, base, braces) { var length = output.reduce(function(prev, cur) { if (cur.indexOf('\n') >= 0) ; return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; }, 0); if (length > 60) { return braces[0] + (base === '' ? '' : base + '\n ') + ' ' + output.join(',\n ') + ' ' + braces[1]; } return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; } // NOTE: These type checking functions intentionally don't use `instanceof` // because it is fragile and can be easily faked with `Object.create()`. function isArray(ar) { return Array.isArray(ar); } exports.isArray = isArray; function isBoolean(arg) { return typeof arg === 'boolean'; } exports.isBoolean = isBoolean; function isNull(arg) { return arg === null; } exports.isNull = isNull; function isNullOrUndefined(arg) { return arg == null; } exports.isNullOrUndefined = isNullOrUndefined; function isNumber(arg) { return typeof arg === 'number'; } exports.isNumber = isNumber; function isString(arg) { return typeof arg === 'string'; } exports.isString = isString; function isSymbol(arg) { return typeof arg === 'symbol'; } exports.isSymbol = isSymbol; function isUndefined(arg) { return arg === void 0; } exports.isUndefined = isUndefined; function isRegExp(re) { return isObject(re) && objectToString(re) === '[object RegExp]'; } exports.isRegExp = isRegExp; function isObject(arg) { return typeof arg === 'object' && arg !== null; } exports.isObject = isObject; function isDate(d) { return isObject(d) && objectToString(d) === '[object Date]'; } exports.isDate = isDate; function isError(e) { return isObject(e) && (objectToString(e) === '[object Error]' || e instanceof Error); } exports.isError = isError; function isFunction(arg) { return typeof arg === 'function'; } exports.isFunction = isFunction; function isPrimitive(arg) { return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || typeof arg === 'symbol' || // ES6 symbol typeof arg === 'undefined'; } exports.isPrimitive = isPrimitive; exports.isBuffer = isBufferBrowser; function objectToString(o) { return Object.prototype.toString.call(o); } function pad(n) { return n < 10 ? '0' + n.toString(10) : n.toString(10); } var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; // 26 Feb 16:19:34 function timestamp() { var d = new Date(); var time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(':'); return [d.getDate(), months[d.getMonth()], time].join(' '); } // log is just a thin wrapper to console.log that prepends a timestamp exports.log = function() { console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); }; /** * Inherit the prototype methods from one constructor into another. * * The Function.prototype.inherits from lang.js rewritten as a standalone * function (not on Function.prototype). NOTE: If this file is to be loaded * during bootstrapping this function needs to be rewritten using some native * functions as prototype setup using normal JavaScript does not work as * expected during bootstrapping (see mirror.js in r114903). * * @param {function} ctor Constructor function which needs to inherit the * prototype. * @param {function} superCtor Constructor function to inherit prototype from. */ exports.inherits = inherits_browser; exports._extend = function(origin, add) { // Don't do anything if add isn't an object if (!add || !isObject(add)) return origin; var keys = Object.keys(add); var i = keys.length; while (i--) { origin[keys[i]] = add[keys[i]]; } return origin; }; function hasOwnProperty(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } }); var util_1 = util.format; var util_2 = util.deprecate; var util_3 = util.debuglog; var util_4 = util.inspect; var util_5 = util.isArray; var util_6 = util.isBoolean; var util_7 = util.isNull; var util_8 = util.isNullOrUndefined; var util_9 = util.isNumber; var util_10 = util.isString; var util_11 = util.isSymbol; var util_12 = util.isUndefined; var util_13 = util.isRegExp; var util_14 = util.isObject; var util_15 = util.isDate; var util_16 = util.isError; var util_17 = util.isFunction; var util_18 = util.isPrimitive; var util_19 = util.isBuffer; var util_20 = util.log; var util_21 = util.inherits; var util_22 = util._extend; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. function EventEmitter() { this._events = this._events || {}; this._maxListeners = this._maxListeners || undefined; } var events = EventEmitter; // Backwards-compat with node 0.10.x EventEmitter.EventEmitter = EventEmitter; EventEmitter.prototype._events = undefined; EventEmitter.prototype._maxListeners = undefined; // By default EventEmitters will print a warning if more than 10 listeners are // added to it. This is a useful default which helps finding memory leaks. EventEmitter.defaultMaxListeners = 10; // Obviously not all Emitters should be limited to 10. This function allows // that to be increased. Set to zero for unlimited. EventEmitter.prototype.setMaxListeners = function(n) { if (!isNumber$1(n) || n < 0 || isNaN(n)) throw TypeError('n must be a positive number'); this._maxListeners = n; return this; }; EventEmitter.prototype.emit = function(type) { var er, handler, len, args, i, listeners; if (!this._events) this._events = {}; // If there is no 'error' event listener then throw. if (type === 'error') { if (!this._events.error || (isObject$1(this._events.error) && !this._events.error.length)) { er = arguments[1]; if (er instanceof Error) { throw er; // Unhandled 'error' event } else { // At least give some kind of context to the user var err = new Error('Uncaught, unspecified "error" event. (' + er + ')'); err.context = er; throw err; } } } handler = this._events[type]; if (isUndefined$1(handler)) return false; if (isFunction$1(handler)) { switch (arguments.length) { // fast cases case 1: handler.call(this); break; case 2: handler.call(this, arguments[1]); break; case 3: handler.call(this, arguments[1], arguments[2]); break; // slower default: args = Array.prototype.slice.call(arguments, 1); handler.apply(this, args); } } else if (isObject$1(handler)) { args = Array.prototype.slice.call(arguments, 1); listeners = handler.slice(); len = listeners.length; for (i = 0; i < len; i++) listeners[i].apply(this, args); } return true; }; EventEmitter.prototype.addListener = function(type, listener) { var m; if (!isFunction$1(listener)) throw TypeError('listener must be a function'); if (!this._events) this._events = {}; // To avoid recursion in the case that type === "newListener"! Before // adding it to the listeners, first emit "newListener". if (this._events.newListener) this.emit('newListener', type, isFunction$1(listener.listener) ? listener.listener : listener); if (!this._events[type]) // Optimize the case of one listener. Don't need the extra array object. this._events[type] = listener; else if (isObject$1(this._events[type])) // If we've already got an array, just append. this._events[type].push(listener); else // Adding the second element, need to change to array. this._events[type] = [this._events[type], listener]; // Check for listener leak if (isObject$1(this._events[type]) && !this._events[type].warned) { if (!isUndefined$1(this._maxListeners)) { m = this._maxListeners; } else { m = EventEmitter.defaultMaxListeners; } if (m && m > 0 && this._events[type].length > m) { this._events[type].warned = true; console.error('(node) warning: possible EventEmitter memory ' + 'leak detected. %d listeners added. ' + 'Use emitter.setMaxListeners() to increase limit.', this._events[type].length); if (typeof console.trace === 'function') { // not supported in IE 10 console.trace(); } } } return this; }; EventEmitter.prototype.on = EventEmitter.prototype.addListener; EventEmitter.prototype.once = function(type, listener) { if (!isFunction$1(listener)) throw TypeError('listener must be a function'); var fired = false; function g() { this.removeListener(type, g); if (!fired) { fired = true; listener.apply(this, arguments); } } g.listener = listener; this.on(type, g); return this; }; // emits a 'removeListener' event iff the listener was removed EventEmitter.prototype.removeListener = function(type, listener) { var list, position, length, i; if (!isFunction$1(listener)) throw TypeError('listener must be a function'); if (!this._events || !this._events[type]) return this; list = this._events[type]; length = list.length; position = -1; if (list === listener || (isFunction$1(list.listener) && list.listener === listener)) { delete this._events[type]; if (this._events.removeListener) this.emit('removeListener', type, listener); } else if (isObject$1(list)) { for (i = length; i-- > 0;) { if (list[i] === listener || (list[i].listener && list[i].listener === listener)) { position = i; break; } } if (position < 0) return this; if (list.length === 1) { list.length = 0; delete this._events[type]; } else { list.splice(position, 1); } if (this._events.removeListener) this.emit('removeListener', type, listener); } return this; }; EventEmitter.prototype.removeAllListeners = function(type) { var key, listeners; if (!this._events) return this; // not listening for removeListener, no need to emit if (!this._events.removeListener) { if (arguments.length === 0) this._events = {}; else if (this._events[type]) delete this._events[type]; return this; } // emit removeListener for all listeners on all events if (arguments.length === 0) { for (key in this._events) { if (key === 'removeListener') continue; this.removeAllListeners(key); } this.removeAllListeners('removeListener'); this._events = {}; return this; } listeners = this._events[type]; if (isFunction$1(listeners)) { this.removeListener(type, listeners); } else if (listeners) { // LIFO order while (listeners.length) this.removeListener(type, listeners[listeners.length - 1]); } delete this._events[type]; return this; }; EventEmitter.prototype.listeners = function(type) { var ret; if (!this._events || !this._events[type]) ret = []; else if (isFunction$1(this._events[type])) ret = [this._events[type]]; else ret = this._events[type].slice(); return ret; }; EventEmitter.prototype.listenerCount = function(type) { if (this._events) { var evlistener = this._events[type]; if (isFunction$1(evlistener)) return 1; else if (evlistener) return evlistener.length; } return 0; }; EventEmitter.listenerCount = function(emitter, type) { return emitter.listenerCount(type); }; function isFunction$1(arg) { return typeof arg === 'function'; } function isNumber$1(arg) { return typeof arg === 'number'; } function isObject$1(arg) { return typeof arg === 'object' && arg !== null; } function isUndefined$1(arg) { return arg === void 0; } /** * A DerivedHelper is a way to create sub requests to * Algolia from a main helper. * @class * @classdesc The DerivedHelper provides an event based interface for search callbacks: * - search: when a search is triggered using the `search()` method. * - result: when the response is retrieved from Algolia and is processed. * This event contains a {@link SearchResults} object and the * {@link SearchParameters} corresponding to this answer. */ function DerivedHelper(mainHelper, fn) { this.main = mainHelper; this.fn = fn; this.lastResults = null; } util.inherits(DerivedHelper, events.EventEmitter); /** * Detach this helper from the main helper * @return {undefined} * @throws Error if the derived helper is already detached */ DerivedHelper.prototype.detach = function() { this.removeAllListeners(); this.main.detachDerivedHelper(this); }; DerivedHelper.prototype.getModifiedState = function(parameters) { return this.fn(parameters); }; var DerivedHelper_1 = DerivedHelper; var requestBuilder = { /** * Get all the queries to send to the client, those queries can used directly * with the Algolia client. * @private * @return {object[]} The queries */ _getQueries: function getQueries(index, state) { var queries = []; // One query for the hits queries.push({ indexName: index, params: requestBuilder._getHitsSearchParams(state) }); // One for each disjunctive facets forEach_1(state.getRefinedDisjunctiveFacets(), function(refinedFacet) { queries.push({ indexName: index, params: requestBuilder._getDisjunctiveFacetSearchParams(state, refinedFacet) }); }); // maybe more to get the root level of hierarchical facets when activated forEach_1(state.getRefinedHierarchicalFacets(), function(refinedFacet) { var hierarchicalFacet = state.getHierarchicalFacetByName(refinedFacet); var currentRefinement = state.getHierarchicalRefinement(refinedFacet); // if we are deeper than level 0 (starting from `beer > IPA`) // we want to get the root values var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet); if (currentRefinement.length > 0 && currentRefinement[0].split(separator).length > 1) { queries.push({ indexName: index, params: requestBuilder._getDisjunctiveFacetSearchParams(state, refinedFacet, true) }); } }); return queries; }, /** * Build search parameters used to fetch hits * @private * @return {object.<string, any>} */ _getHitsSearchParams: function(state) { var facets = state.facets .concat(state.disjunctiveFacets) .concat(requestBuilder._getHitsHierarchicalFacetsAttributes(state)); var facetFilters = requestBuilder._getFacetFilters(state); var numericFilters = requestBuilder._getNumericFilters(state); var tagFilters = requestBuilder._getTagFilters(state); var additionalParams = { facets: facets, tagFilters: tagFilters }; if (facetFilters.length > 0) { additionalParams.facetFilters = facetFilters; } if (numericFilters.length > 0) { additionalParams.numericFilters = numericFilters; } return merge_1(state.getQueryParams(), additionalParams); }, /** * Build search parameters used to fetch a disjunctive facet * @private * @param {string} facet the associated facet name * @param {boolean} hierarchicalRootLevel ?? FIXME * @return {object} */ _getDisjunctiveFacetSearchParams: function(state, facet, hierarchicalRootLevel) { var facetFilters = requestBuilder._getFacetFilters(state, facet, hierarchicalRootLevel); var numericFilters = requestBuilder._getNumericFilters(state, facet); var tagFilters = requestBuilder._getTagFilters(state); var additionalParams = { hitsPerPage: 1, page: 0, attributesToRetrieve: [], attributesToHighlight: [], attributesToSnippet: [], tagFilters: tagFilters, analytics: false, clickAnalytics: false }; var hierarchicalFacet = state.getHierarchicalFacetByName(facet); if (hierarchicalFacet) { additionalParams.facets = requestBuilder._getDisjunctiveHierarchicalFacetAttribute( state, hierarchicalFacet, hierarchicalRootLevel ); } else { additionalParams.facets = facet; } if (numericFilters.length > 0) { additionalParams.numericFilters = numericFilters; } if (facetFilters.length > 0) { additionalParams.facetFilters = facetFilters; } return merge_1(state.getQueryParams(), additionalParams); }, /** * Return the numeric filters in an algolia request fashion * @private * @param {string} [facetName] the name of the attribute for which the filters should be excluded * @return {string[]} the numeric filters in the algolia format */ _getNumericFilters: function(state, facetName) { if (state.numericFilters) { return state.numericFilters; } var numericFilters = []; forEach_1(state.numericRefinements, function(operators, attribute) { forEach_1(operators, function(values, operator) { if (facetName !== attribute) { forEach_1(values, function(value) { if (Array.isArray(value)) { var vs = map_1(value, function(v) { return attribute + operator + v; }); numericFilters.push(vs); } else { numericFilters.push(attribute + operator + value); } }); } }); }); return numericFilters; }, /** * Return the tags filters depending * @private * @return {string} */ _getTagFilters: function(state) { if (state.tagFilters) { return state.tagFilters; } return state.tagRefinements.join(','); }, /** * Build facetFilters parameter based on current refinements. The array returned * contains strings representing the facet filters in the algolia format. * @private * @param {string} [facet] if set, the current disjunctive facet * @return {array.<string>} */ _getFacetFilters: function(state, facet, hierarchicalRootLevel) { var facetFilters = []; forEach_1(state.facetsRefinements, function(facetValues, facetName) { forEach_1(facetValues, function(facetValue) { facetFilters.push(facetName + ':' + facetValue); }); }); forEach_1(state.facetsExcludes, function(facetValues, facetName) { forEach_1(facetValues, function(facetValue) { facetFilters.push(facetName + ':-' + facetValue); }); }); forEach_1(state.disjunctiveFacetsRefinements, function(facetValues, facetName) { if (facetName === facet || !facetValues || facetValues.length === 0) return; var orFilters = []; forEach_1(facetValues, function(facetValue) { orFilters.push(facetName + ':' + facetValue); }); facetFilters.push(orFilters); }); forEach_1(state.hierarchicalFacetsRefinements, function(facetValues, facetName) { var facetValue = facetValues[0]; if (facetValue === undefined) { return; } var hierarchicalFacet = state.getHierarchicalFacetByName(facetName); var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet); var rootPath = state._getHierarchicalRootPath(hierarchicalFacet); var attributeToRefine; var attributesIndex; // we ask for parent facet values only when the `facet` is the current hierarchical facet if (facet === facetName) { // if we are at the root level already, no need to ask for facet values, we get them from // the hits query if (facetValue.indexOf(separator) === -1 || (!rootPath && hierarchicalRootLevel === true) || (rootPath && rootPath.split(separator).length === facetValue.split(separator).length)) { return; } if (!rootPath) { attributesIndex = facetValue.split(separator).length - 2; facetValue = facetValue.slice(0, facetValue.lastIndexOf(separator)); } else { attributesIndex = rootPath.split(separator).length - 1; facetValue = rootPath; } attributeToRefine = hierarchicalFacet.attributes[attributesIndex]; } else { attributesIndex = facetValue.split(separator).length - 1; attributeToRefine = hierarchicalFacet.attributes[attributesIndex]; } if (attributeToRefine) { facetFilters.push([attributeToRefine + ':' + facetValue]); } }); return facetFilters; }, _getHitsHierarchicalFacetsAttributes: function(state) { var out = []; return reduce_1( state.hierarchicalFacets, // ask for as much levels as there's hierarchical refinements function getHitsAttributesForHierarchicalFacet(allAttributes, hierarchicalFacet) { var hierarchicalRefinement = state.getHierarchicalRefinement(hierarchicalFacet.name)[0]; // if no refinement, ask for root level if (!hierarchicalRefinement) { allAttributes.push(hierarchicalFacet.attributes[0]); return allAttributes; } var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet); var level = hierarchicalRefinement.split(separator).length; var newAttributes = hierarchicalFacet.attributes.slice(0, level + 1); return allAttributes.concat(newAttributes); }, out); }, _getDisjunctiveHierarchicalFacetAttribute: function(state, hierarchicalFacet, rootLevel) { var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet); if (rootLevel === true) { var rootPath = state._getHierarchicalRootPath(hierarchicalFacet); var attributeIndex = 0; if (rootPath) { attributeIndex = rootPath.split(separator).length; } return [hierarchicalFacet.attributes[attributeIndex]]; } var hierarchicalRefinement = state.getHierarchicalRefinement(hierarchicalFacet.name)[0] || ''; // if refinement is 'beers > IPA > Flying dog', // then we want `facets: ['beers > IPA']` as disjunctive facet (parent level values) var parentLevel = hierarchicalRefinement.split(separator).length - 1; return hierarchicalFacet.attributes.slice(0, parentLevel + 1); }, getSearchForFacetQuery: function(facetName, query, maxFacetHits, state) { var stateForSearchForFacetValues = state.isDisjunctiveFacet(facetName) ? state.clearRefinements(facetName) : state; var searchForFacetSearchParameters = { facetQuery: query, facetName: facetName }; if (typeof maxFacetHits === 'number') { searchForFacetSearchParameters.maxFacetHits = maxFacetHits; } var queries = merge_1(requestBuilder._getHitsSearchParams(stateForSearchForFacetValues), searchForFacetSearchParameters); return queries; } }; var requestBuilder_1 = requestBuilder; /** * The base implementation of `_.invert` and `_.invertBy` which inverts * `object` with values transformed by `iteratee` and set by `setter`. * * @private * @param {Object} object The object to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform values. * @param {Object} accumulator The initial inverted object. * @returns {Function} Returns `accumulator`. */ function baseInverter(object, setter, iteratee, accumulator) { _baseForOwn(object, function(value, key, object) { setter(accumulator, iteratee(value), key, object); }); return accumulator; } var _baseInverter = baseInverter; /** * Creates a function like `_.invertBy`. * * @private * @param {Function} setter The function to set accumulator values. * @param {Function} toIteratee The function to resolve iteratees. * @returns {Function} Returns the new inverter function. */ function createInverter(setter, toIteratee) { return function(object, iteratee) { return _baseInverter(object, setter, toIteratee(iteratee), {}); }; } var _createInverter = createInverter; /** Used for built-in method references. */ var objectProto$k = Object.prototype; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString$2 = objectProto$k.toString; /** * Creates an object composed of the inverted keys and values of `object`. * If `object` contains duplicate values, subsequent values overwrite * property assignments of previous values. * * @static * @memberOf _ * @since 0.7.0 * @category Object * @param {Object} object The object to invert. * @returns {Object} Returns the new inverted object. * @example * * var object = { 'a': 1, 'b': 2, 'c': 1 }; * * _.invert(object); * // => { '1': 'c', '2': 'b' } */ var invert = _createInverter(function(result, value, key) { if (value != null && typeof value.toString != 'function') { value = nativeObjectToString$2.call(value); } result[value] = key; }, constant_1(identity_1)); var invert_1 = invert; var keys2Short = { advancedSyntax: 'aS', allowTyposOnNumericTokens: 'aTONT', analyticsTags: 'aT', analytics: 'a', aroundLatLngViaIP: 'aLLVIP', aroundLatLng: 'aLL', aroundPrecision: 'aP', aroundRadius: 'aR', attributesToHighlight: 'aTH', attributesToRetrieve: 'aTR', attributesToSnippet: 'aTS', disjunctiveFacetsRefinements: 'dFR', disjunctiveFacets: 'dF', distinct: 'd', facetsExcludes: 'fE', facetsRefinements: 'fR', facets: 'f', getRankingInfo: 'gRI', hierarchicalFacetsRefinements: 'hFR', hierarchicalFacets: 'hF', highlightPostTag: 'hPoT', highlightPreTag: 'hPrT', hitsPerPage: 'hPP', ignorePlurals: 'iP', index: 'idx', insideBoundingBox: 'iBB', insidePolygon: 'iPg', length: 'l', maxValuesPerFacet: 'mVPF', minimumAroundRadius: 'mAR', minProximity: 'mP', minWordSizefor1Typo: 'mWS1T', minWordSizefor2Typos: 'mWS2T', numericFilters: 'nF', numericRefinements: 'nR', offset: 'o', optionalWords: 'oW', page: 'p', queryType: 'qT', query: 'q', removeWordsIfNoResults: 'rWINR', replaceSynonymsInHighlight: 'rSIH', restrictSearchableAttributes: 'rSA', synonyms: 's', tagFilters: 'tF', tagRefinements: 'tR', typoTolerance: 'tT', optionalTagFilters: 'oTF', optionalFacetFilters: 'oFF', snippetEllipsisText: 'sET', disableExactOnAttributes: 'dEOA', enableExactOnSingleWordQuery: 'eEOSWQ' }; var short2Keys = invert_1(keys2Short); var shortener = { /** * All the keys of the state, encoded. * @const */ ENCODED_PARAMETERS: keys_1(short2Keys), /** * Decode a shorten attribute * @param {string} shortKey the shorten attribute * @return {string} the decoded attribute, undefined otherwise */ decode: function(shortKey) { return short2Keys[shortKey]; }, /** * Encode an attribute into a short version * @param {string} key the attribute * @return {string} the shorten attribute */ encode: function(key) { return keys2Short[key]; } }; var utils = createCommonjsModule(function (module, exports) { var has = Object.prototype.hasOwnProperty; var hexTable = (function () { var array = []; for (var i = 0; i < 256; ++i) { array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); } return array; }()); var compactQueue = function compactQueue(queue) { var obj; while (queue.length) { var item = queue.pop(); obj = item.obj[item.prop]; if (Array.isArray(obj)) { var compacted = []; for (var j = 0; j < obj.length; ++j) { if (typeof obj[j] !== 'undefined') { compacted.push(obj[j]); } } item.obj[item.prop] = compacted; } } return obj; }; exports.arrayToObject = function arrayToObject(source, options) { var obj = options && options.plainObjects ? Object.create(null) : {}; for (var i = 0; i < source.length; ++i) { if (typeof source[i] !== 'undefined') { obj[i] = source[i]; } } return obj; }; exports.merge = function merge(target, source, options) { if (!source) { return target; } if (typeof source !== 'object') { if (Array.isArray(target)) { target.push(source); } else if (typeof target === 'object') { if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) { target[source] = true; } } else { return [target, source]; } return target; } if (typeof target !== 'object') { return [target].concat(source); } var mergeTarget = target; if (Array.isArray(target) && !Array.isArray(source)) { mergeTarget = exports.arrayToObject(target, options); } if (Array.isArray(target) && Array.isArray(source)) { source.forEach(function (item, i) { if (has.call(target, i)) { if (target[i] && typeof target[i] === 'object') { target[i] = exports.merge(target[i], item, options); } else { target.push(item); } } else { target[i] = item; } }); return target; } return Object.keys(source).reduce(function (acc, key) { var value = source[key]; if (has.call(acc, key)) { acc[key] = exports.merge(acc[key], value, options); } else { acc[key] = value; } return acc; }, mergeTarget); }; exports.assign = function assignSingleSource(target, source) { return Object.keys(source).reduce(function (acc, key) { acc[key] = source[key]; return acc; }, target); }; exports.decode = function (str) { try { return decodeURIComponent(str.replace(/\+/g, ' ')); } catch (e) { return str; } }; exports.encode = function encode(str) { // This code was originally written by Brian White (mscdex) for the io.js core querystring library. // It has been adapted here for stricter adherence to RFC 3986 if (str.length === 0) { return str; } var string = typeof str === 'string' ? str : String(str); var out = ''; for (var i = 0; i < string.length; ++i) { var c = string.charCodeAt(i); if ( c === 0x2D // - || c === 0x2E // . || c === 0x5F // _ || c === 0x7E // ~ || (c >= 0x30 && c <= 0x39) // 0-9 || (c >= 0x41 && c <= 0x5A) // a-z || (c >= 0x61 && c <= 0x7A) // A-Z ) { out += string.charAt(i); continue; } if (c < 0x80) { out = out + hexTable[c]; continue; } if (c < 0x800) { out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); continue; } if (c < 0xD800 || c >= 0xE000) { out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); continue; } i += 1; c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); out += hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]; } return out; }; exports.compact = function compact(value) { var queue = [{ obj: { o: value }, prop: 'o' }]; var refs = []; for (var i = 0; i < queue.length; ++i) { var item = queue[i]; var obj = item.obj[item.prop]; var keys = Object.keys(obj); for (var j = 0; j < keys.length; ++j) { var key = keys[j]; var val = obj[key]; if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { queue.push({ obj: obj, prop: key }); refs.push(val); } } } return compactQueue(queue); }; exports.isRegExp = function isRegExp(obj) { return Object.prototype.toString.call(obj) === '[object RegExp]'; }; exports.isBuffer = function isBuffer(obj) { if (obj === null || typeof obj === 'undefined') { return false; } return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); }; }); var utils_1 = utils.arrayToObject; var utils_2 = utils.merge; var utils_3 = utils.assign; var utils_4 = utils.decode; var utils_5 = utils.encode; var utils_6 = utils.compact; var utils_7 = utils.isRegExp; var utils_8 = utils.isBuffer; var replace = String.prototype.replace; var percentTwenties = /%20/g; var formats = { 'default': 'RFC3986', formatters: { RFC1738: function (value) { return replace.call(value, percentTwenties, '+'); }, RFC3986: function (value) { return value; } }, RFC1738: 'RFC1738', RFC3986: 'RFC3986' }; var arrayPrefixGenerators = { brackets: function brackets(prefix) { // eslint-disable-line func-name-matching return prefix + '[]'; }, indices: function indices(prefix, key) { // eslint-disable-line func-name-matching return prefix + '[' + key + ']'; }, repeat: function repeat(prefix) { // eslint-disable-line func-name-matching return prefix; } }; var toISO = Date.prototype.toISOString; var defaults$1 = { delimiter: '&', encode: true, encoder: utils.encode, encodeValuesOnly: false, serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching return toISO.call(date); }, skipNulls: false, strictNullHandling: false }; var stringify = function stringify( // eslint-disable-line func-name-matching object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly ) { var obj = object; if (typeof filter === 'function') { obj = filter(prefix, obj); } else if (obj instanceof Date) { obj = serializeDate(obj); } else if (obj === null) { if (strictNullHandling) { return encoder && !encodeValuesOnly ? encoder(prefix, defaults$1.encoder) : prefix; } obj = ''; } if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) { if (encoder) { var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder); return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults$1.encoder))]; } return [formatter(prefix) + '=' + formatter(String(obj))]; } var values = []; if (typeof obj === 'undefined') { return values; } var objKeys; if (Array.isArray(filter)) { objKeys = filter; } else { var keys = Object.keys(obj); objKeys = sort ? keys.sort(sort) : keys; } for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; if (skipNulls && obj[key] === null) { continue; } if (Array.isArray(obj)) { values = values.concat(stringify( obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly )); } else { values = values.concat(stringify( obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly )); } } return values; }; var stringify_1 = function (object, opts) { var obj = object; var options = opts ? utils.assign({}, opts) : {}; if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') { throw new TypeError('Encoder has to be a function.'); } var delimiter = typeof options.delimiter === 'undefined' ? defaults$1.delimiter : options.delimiter; var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults$1.strictNullHandling; var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults$1.skipNulls; var encode = typeof options.encode === 'boolean' ? options.encode : defaults$1.encode; var encoder = typeof options.encoder === 'function' ? options.encoder : defaults$1.encoder; var sort = typeof options.sort === 'function' ? options.sort : null; var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots; var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults$1.serializeDate; var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults$1.encodeValuesOnly; if (typeof options.format === 'undefined') { options.format = formats['default']; } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) { throw new TypeError('Unknown format option provided.'); } var formatter = formats.formatters[options.format]; var objKeys; var filter; if (typeof options.filter === 'function') { filter = options.filter; obj = filter('', obj); } else if (Array.isArray(options.filter)) { filter = options.filter; objKeys = filter; } var keys = []; if (typeof obj !== 'object' || obj === null) { return ''; } var arrayFormat; if (options.arrayFormat in arrayPrefixGenerators) { arrayFormat = options.arrayFormat; } else if ('indices' in options) { arrayFormat = options.indices ? 'indices' : 'repeat'; } else { arrayFormat = 'indices'; } var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; if (!objKeys) { objKeys = Object.keys(obj); } if (sort) { objKeys.sort(sort); } for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; if (skipNulls && obj[key] === null) { continue; } keys = keys.concat(stringify( obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode ? encoder : null, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly )); } var joined = keys.join(delimiter); var prefix = options.addQueryPrefix === true ? '?' : ''; return joined.length > 0 ? prefix + joined : ''; }; var has = Object.prototype.hasOwnProperty; var defaults$2 = { allowDots: false, allowPrototypes: false, arrayLimit: 20, decoder: utils.decode, delimiter: '&', depth: 5, parameterLimit: 1000, plainObjects: false, strictNullHandling: false }; var parseValues = function parseQueryStringValues(str, options) { var obj = {}; var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; var parts = cleanStr.split(options.delimiter, limit); for (var i = 0; i < parts.length; ++i) { var part = parts[i]; var bracketEqualsPos = part.indexOf(']='); var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; var key, val; if (pos === -1) { key = options.decoder(part, defaults$2.decoder); val = options.strictNullHandling ? null : ''; } else { key = options.decoder(part.slice(0, pos), defaults$2.decoder); val = options.decoder(part.slice(pos + 1), defaults$2.decoder); } if (has.call(obj, key)) { obj[key] = [].concat(obj[key]).concat(val); } else { obj[key] = val; } } return obj; }; var parseObject = function (chain, val, options) { var leaf = val; for (var i = chain.length - 1; i >= 0; --i) { var obj; var root = chain[i]; if (root === '[]') { obj = []; obj = obj.concat(leaf); } else { obj = options.plainObjects ? Object.create(null) : {}; var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; var index = parseInt(cleanRoot, 10); if ( !isNaN(index) && root !== cleanRoot && String(index) === cleanRoot && index >= 0 && (options.parseArrays && index <= options.arrayLimit) ) { obj = []; obj[index] = leaf; } else { obj[cleanRoot] = leaf; } } leaf = obj; } return leaf; }; var parseKeys = function parseQueryStringKeys(givenKey, val, options) { if (!givenKey) { return; } // Transform dot notation to bracket notation var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; // The regex chunks var brackets = /(\[[^[\]]*])/; var child = /(\[[^[\]]*])/g; // Get the parent var segment = brackets.exec(key); var parent = segment ? key.slice(0, segment.index) : key; // Stash the parent if it exists var keys = []; if (parent) { // If we aren't using plain objects, optionally prefix keys // that would overwrite object prototype properties if (!options.plainObjects && has.call(Object.prototype, parent)) { if (!options.allowPrototypes) { return; } } keys.push(parent); } // Loop through children appending to the array until we hit depth var i = 0; while ((segment = child.exec(key)) !== null && i < options.depth) { i += 1; if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { if (!options.allowPrototypes) { return; } } keys.push(segment[1]); } // If there's a remainder, just add whatever is left if (segment) { keys.push('[' + key.slice(segment.index) + ']'); } return parseObject(keys, val, options); }; var parse = function (str, opts) { var options = opts ? utils.assign({}, opts) : {}; if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') { throw new TypeError('Decoder has to be a function.'); } options.ignoreQueryPrefix = options.ignoreQueryPrefix === true; options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults$2.delimiter; options.depth = typeof options.depth === 'number' ? options.depth : defaults$2.depth; options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults$2.arrayLimit; options.parseArrays = options.parseArrays !== false; options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults$2.decoder; options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults$2.allowDots; options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults$2.plainObjects; options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults$2.allowPrototypes; options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults$2.parameterLimit; options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults$2.strictNullHandling; if (str === '' || str === null || typeof str === 'undefined') { return options.plainObjects ? Object.create(null) : {}; } var tempObj = typeof str === 'string' ? parseValues(str, options) : str; var obj = options.plainObjects ? Object.create(null) : {}; // Iterate over the keys and setup the new object var keys = Object.keys(tempObj); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; var newObj = parseKeys(key, tempObj[key], options); obj = utils.merge(obj, newObj, options); } return utils.compact(obj); }; var lib$1 = { formats: formats, parse: parse, stringify: stringify_1 }; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG$7 = 1, WRAP_PARTIAL_FLAG$4 = 32; /** * Creates a function that invokes `func` with the `this` binding of `thisArg` * and `partials` prepended to the arguments it receives. * * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for partially applied arguments. * * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" * property of bound functions. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to bind. * @param {*} thisArg The `this` binding of `func`. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * * function greet(greeting, punctuation) { * return greeting + ' ' + this.user + punctuation; * } * * var object = { 'user': 'fred' }; * * var bound = _.bind(greet, object, 'hi'); * bound('!'); * // => 'hi fred!' * * // Bound with placeholders. * var bound = _.bind(greet, object, _, '!'); * bound('hi'); * // => 'hi fred!' */ var bind = _baseRest(function(func, thisArg, partials) { var bitmask = WRAP_BIND_FLAG$7; if (partials.length) { var holders = _replaceHolders(partials, _getHolder(bind)); bitmask |= WRAP_PARTIAL_FLAG$4; } return _createWrap(func, bitmask, thisArg, partials, holders); }); // Assign default placeholders. bind.placeholder = {}; var bind_1 = bind; /** * The base implementation of `_.pick` without support for individual * property identifiers. * * @private * @param {Object} object The source object. * @param {string[]} paths The property paths to pick. * @returns {Object} Returns the new object. */ function basePick(object, paths) { return _basePickBy(object, paths, function(value, path) { return hasIn_1(object, path); }); } var _basePick = basePick; /** * Creates an object composed of the picked `object` properties. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.pick(object, ['a', 'c']); * // => { 'a': 1, 'c': 3 } */ var pick = _flatRest(function(object, paths) { return object == null ? {} : _basePick(object, paths); }); var pick_1 = pick; /** * The opposite of `_.mapValues`; this method creates an object with the * same values as `object` and keys generated by running each own enumerable * string keyed property of `object` thru `iteratee`. The iteratee is invoked * with three arguments: (value, key, object). * * @static * @memberOf _ * @since 3.8.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @see _.mapValues * @example * * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { * return key + value; * }); * // => { 'a1': 1, 'b2': 2 } */ function mapKeys(object, iteratee) { var result = {}; iteratee = _baseIteratee(iteratee, 3); _baseForOwn(object, function(value, key, object) { _baseAssignValue(result, iteratee(value, key, object), value); }); return result; } var mapKeys_1 = mapKeys; /** * Creates an object with the same keys as `object` and values generated * by running each own enumerable string keyed property of `object` thru * `iteratee`. The iteratee is invoked with three arguments: * (value, key, object). * * @static * @memberOf _ * @since 2.4.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @see _.mapKeys * @example * * var users = { * 'fred': { 'user': 'fred', 'age': 40 }, * 'pebbles': { 'user': 'pebbles', 'age': 1 } * }; * * _.mapValues(users, function(o) { return o.age; }); * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) * * // The `_.property` iteratee shorthand. * _.mapValues(users, 'age'); * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) */ function mapValues(object, iteratee) { var result = {}; iteratee = _baseIteratee(iteratee, 3); _baseForOwn(object, function(value, key, object) { _baseAssignValue(result, key, iteratee(value, key, object)); }); return result; } var mapValues_1 = mapValues; /** * Module containing the functions to serialize and deserialize * {SearchParameters} in the query string format * @module algoliasearchHelper.url */ var encode = utils.encode; function recursiveEncode(input) { if (isPlainObject_1(input)) { return mapValues_1(input, recursiveEncode); } if (Array.isArray(input)) { return map_1(input, recursiveEncode); } if (isString_1(input)) { return encode(input); } return input; } var refinementsParameters = ['dFR', 'fR', 'nR', 'hFR', 'tR']; var stateKeys = shortener.ENCODED_PARAMETERS; function sortQueryStringValues(prefixRegexp, invertedMapping, a, b) { if (prefixRegexp !== null) { a = a.replace(prefixRegexp, ''); b = b.replace(prefixRegexp, ''); } a = invertedMapping[a] || a; b = invertedMapping[b] || b; if (stateKeys.indexOf(a) !== -1 || stateKeys.indexOf(b) !== -1) { if (a === 'q') return -1; if (b === 'q') return 1; var isARefinements = refinementsParameters.indexOf(a) !== -1; var isBRefinements = refinementsParameters.indexOf(b) !== -1; if (isARefinements && !isBRefinements) { return 1; } else if (isBRefinements && !isARefinements) { return -1; } } return a.localeCompare(b); } /** * Read a query string and return an object containing the state * @param {string} queryString the query string that will be decoded * @param {object} [options] accepted options : * - prefix : the prefix used for the saved attributes, you have to provide the * same that was used for serialization * - mapping : map short attributes to another value e.g. {q: 'query'} * @return {object} partial search parameters object (same properties than in the * SearchParameters but not exhaustive) */ var getStateFromQueryString = function(queryString, options) { var prefixForParameters = options && options.prefix || ''; var mapping = options && options.mapping || {}; var invertedMapping = invert_1(mapping); var partialStateWithPrefix = lib$1.parse(queryString); var prefixRegexp = new RegExp('^' + prefixForParameters); var partialState = mapKeys_1( partialStateWithPrefix, function(v, k) { var hasPrefix = prefixForParameters && prefixRegexp.test(k); var unprefixedKey = hasPrefix ? k.replace(prefixRegexp, '') : k; var decodedKey = shortener.decode(invertedMapping[unprefixedKey] || unprefixedKey); return decodedKey || unprefixedKey; } ); var partialStateWithParsedNumbers = SearchParameters_1._parseNumbers(partialState); return pick_1(partialStateWithParsedNumbers, SearchParameters_1.PARAMETERS); }; /** * Retrieve an object of all the properties that are not understandable as helper * parameters. * @param {string} queryString the query string to read * @param {object} [options] the options * - prefixForParameters : prefix used for the helper configuration keys * - mapping : map short attributes to another value e.g. {q: 'query'} * @return {object} the object containing the parsed configuration that doesn't * to the helper */ var getUnrecognizedParametersInQueryString = function(queryString, options) { var prefixForParameters = options && options.prefix; var mapping = options && options.mapping || {}; var invertedMapping = invert_1(mapping); var foreignConfig = {}; var config = lib$1.parse(queryString); if (prefixForParameters) { var prefixRegexp = new RegExp('^' + prefixForParameters); forEach_1(config, function(v, key) { if (!prefixRegexp.test(key)) foreignConfig[key] = v; }); } else { forEach_1(config, function(v, key) { if (!shortener.decode(invertedMapping[key] || key)) foreignConfig[key] = v; }); } return foreignConfig; }; /** * Generate a query string for the state passed according to the options * @param {SearchParameters} state state to serialize * @param {object} [options] May contain the following parameters : * - prefix : prefix in front of the keys * - mapping : map short attributes to another value e.g. {q: 'query'} * - moreAttributes : more values to be added in the query string. Those values * won't be prefixed. * - safe : get safe urls for use in emails, chat apps or any application auto linking urls. * All parameters and values will be encoded in a way that it's safe to share them. * Default to false for legacy reasons () * @return {string} the query string */ var getQueryStringFromState = function(state, options) { var moreAttributes = options && options.moreAttributes; var prefixForParameters = options && options.prefix || ''; var mapping = options && options.mapping || {}; var safe = options && options.safe || false; var invertedMapping = invert_1(mapping); var stateForUrl = safe ? state : recursiveEncode(state); var encodedState = mapKeys_1( stateForUrl, function(v, k) { var shortK = shortener.encode(k); return prefixForParameters + (mapping[shortK] || shortK); } ); var prefixRegexp = prefixForParameters === '' ? null : new RegExp('^' + prefixForParameters); var sort = bind_1(sortQueryStringValues, null, prefixRegexp, invertedMapping); if (!isEmpty_1(moreAttributes)) { var stateQs = lib$1.stringify(encodedState, {encode: safe, sort: sort}); var moreQs = lib$1.stringify(moreAttributes, {encode: safe}); if (!stateQs) return moreQs; return stateQs + '&' + moreQs; } return lib$1.stringify(encodedState, {encode: safe, sort: sort}); }; var url = { getStateFromQueryString: getStateFromQueryString, getUnrecognizedParametersInQueryString: getUnrecognizedParametersInQueryString, getQueryStringFromState: getQueryStringFromState }; var version$1 = '2.26.0'; /** * Event triggered when a parameter is set or updated * @event AlgoliaSearchHelper#event:change * @property {SearchParameters} state the current parameters with the latest changes applied * @property {SearchResults} lastResults the previous results received from Algolia. `null` before * the first request * @example * helper.on('change', function(state, lastResults) { * console.log('The parameters have changed'); * }); */ /** * Event triggered when a main search is sent to Algolia * @event AlgoliaSearchHelper#event:search * @property {SearchParameters} state the parameters used for this search * @property {SearchResults} lastResults the results from the previous search. `null` if * it is the first search. * @example * helper.on('search', function(state, lastResults) { * console.log('Search sent'); * }); */ /** * Event triggered when a search using `searchForFacetValues` is sent to Algolia * @event AlgoliaSearchHelper#event:searchForFacetValues * @property {SearchParameters} state the parameters used for this search * it is the first search. * @property {string} facet the facet searched into * @property {string} query the query used to search in the facets * @example * helper.on('searchForFacetValues', function(state, facet, query) { * console.log('searchForFacetValues sent'); * }); */ /** * Event triggered when a search using `searchOnce` is sent to Algolia * @event AlgoliaSearchHelper#event:searchOnce * @property {SearchParameters} state the parameters used for this search * it is the first search. * @example * helper.on('searchOnce', function(state) { * console.log('searchOnce sent'); * }); */ /** * Event triggered when the results are retrieved from Algolia * @event AlgoliaSearchHelper#event:result * @property {SearchResults} results the results received from Algolia * @property {SearchParameters} state the parameters used to query Algolia. Those might * be different from the one in the helper instance (for example if the network is unreliable). * @example * helper.on('result', function(results, state) { * console.log('Search results received'); * }); */ /** * Event triggered when Algolia sends back an error. For example, if an unknown parameter is * used, the error can be caught using this event. * @event AlgoliaSearchHelper#event:error * @property {Error} error the error returned by the Algolia. * @example * helper.on('error', function(error) { * console.log('Houston we got a problem.'); * }); */ /** * Event triggered when the queue of queries have been depleted (with any result or outdated queries) * @event AlgoliaSearchHelper#event:searchQueueEmpty * @example * helper.on('searchQueueEmpty', function() { * console.log('No more search pending'); * // This is received before the result event if we're not expecting new results * }); * * helper.search(); */ /** * Initialize a new AlgoliaSearchHelper * @class * @classdesc The AlgoliaSearchHelper is a class that ease the management of the * search. It provides an event based interface for search callbacks: * - change: when the internal search state is changed. * This event contains a {@link SearchParameters} object and the * {@link SearchResults} of the last result if any. * - search: when a search is triggered using the `search()` method. * - result: when the response is retrieved from Algolia and is processed. * This event contains a {@link SearchResults} object and the * {@link SearchParameters} corresponding to this answer. * - error: when the response is an error. This event contains the error returned by the server. * @param {AlgoliaSearch} client an AlgoliaSearch client * @param {string} index the index name to query * @param {SearchParameters | object} options an object defining the initial * config of the search. It doesn't have to be a {SearchParameters}, * just an object containing the properties you need from it. */ function AlgoliaSearchHelper(client, index, options) { if (client.addAlgoliaAgent && !doesClientAgentContainsHelper(client)) { client.addAlgoliaAgent('JS Helper ' + version$1); } this.setClient(client); var opts = options || {}; opts.index = index; this.state = SearchParameters_1.make(opts); this.lastResults = null; this._queryId = 0; this._lastQueryIdReceived = -1; this.derivedHelpers = []; this._currentNbQueries = 0; } util.inherits(AlgoliaSearchHelper, events.EventEmitter); /** * Start the search with the parameters set in the state. When the * method is called, it triggers a `search` event. The results will * be available through the `result` event. If an error occurs, an * `error` will be fired instead. * @return {AlgoliaSearchHelper} * @fires search * @fires result * @fires error * @chainable */ AlgoliaSearchHelper.prototype.search = function() { this._search(); return this; }; /** * Gets the search query parameters that would be sent to the Algolia Client * for the hits * @return {object} Query Parameters */ AlgoliaSearchHelper.prototype.getQuery = function() { var state = this.state; return requestBuilder_1._getHitsSearchParams(state); }; /** * Start a search using a modified version of the current state. This method does * not trigger the helper lifecycle and does not modify the state kept internally * by the helper. This second aspect means that the next search call will be the * same as a search call before calling searchOnce. * @param {object} options can contain all the parameters that can be set to SearchParameters * plus the index * @param {function} [callback] optional callback executed when the response from the * server is back. * @return {promise|undefined} if a callback is passed the method returns undefined * otherwise it returns a promise containing an object with two keys : * - content with a SearchResults * - state with the state used for the query as a SearchParameters * @example * // Changing the number of records returned per page to 1 * // This example uses the callback API * var state = helper.searchOnce({hitsPerPage: 1}, * function(error, content, state) { * // if an error occurred it will be passed in error, otherwise its value is null * // content contains the results formatted as a SearchResults * // state is the instance of SearchParameters used for this search * }); * @example * // Changing the number of records returned per page to 1 * // This example uses the promise API * var state1 = helper.searchOnce({hitsPerPage: 1}) * .then(promiseHandler); * * function promiseHandler(res) { * // res contains * // { * // content : SearchResults * // state : SearchParameters (the one used for this specific search) * // } * } */ AlgoliaSearchHelper.prototype.searchOnce = function(options, cb) { var tempState = !options ? this.state : this.state.setQueryParameters(options); var queries = requestBuilder_1._getQueries(tempState.index, tempState); var self = this; this._currentNbQueries++; this.emit('searchOnce', tempState); if (cb) { this.client .search(queries) .then(function(content) { self._currentNbQueries--; if (self._currentNbQueries === 0) { self.emit('searchQueueEmpty'); } cb(null, new SearchResults_1(tempState, content.results), tempState); }) .catch(function(err) { self._currentNbQueries--; if (self._currentNbQueries === 0) { self.emit('searchQueueEmpty'); } cb(err, null, tempState); }); return undefined; } return this.client.search(queries).then(function(content) { self._currentNbQueries--; if (self._currentNbQueries === 0) self.emit('searchQueueEmpty'); return { content: new SearchResults_1(tempState, content.results), state: tempState, _originalResponse: content }; }, function(e) { self._currentNbQueries--; if (self._currentNbQueries === 0) self.emit('searchQueueEmpty'); throw e; }); }; /** * Structure of each result when using * [`searchForFacetValues()`](reference.html#AlgoliaSearchHelper#searchForFacetValues) * @typedef FacetSearchHit * @type {object} * @property {string} value the facet value * @property {string} highlighted the facet value highlighted with the query string * @property {number} count number of occurrence of this facet value * @property {boolean} isRefined true if the value is already refined */ /** * Structure of the data resolved by the * [`searchForFacetValues()`](reference.html#AlgoliaSearchHelper#searchForFacetValues) * promise. * @typedef FacetSearchResult * @type {object} * @property {FacetSearchHit} facetHits the results for this search for facet values * @property {number} processingTimeMS time taken by the query inside the engine */ /** * Search for facet values based on an query and the name of a faceted attribute. This * triggers a search and will return a promise. On top of using the query, it also sends * the parameters from the state so that the search is narrowed down to only the possible values. * * See the description of [FacetSearchResult](reference.html#FacetSearchResult) * @param {string} facet the name of the faceted attribute * @param {string} query the string query for the search * @param {number} [maxFacetHits] the maximum number values returned. Should be > 0 and <= 100 * @param {object} [userState] the set of custom parameters to use on top of the current state. Setting a property to `undefined` removes * it in the generated query. * @return {promise.<FacetSearchResult>} the results of the search */ AlgoliaSearchHelper.prototype.searchForFacetValues = function(facet, query, maxFacetHits, userState) { var state = this.state.setQueryParameters(userState || {}); var isDisjunctive = state.isDisjunctiveFacet(facet); var algoliaQuery = requestBuilder_1.getSearchForFacetQuery(facet, query, maxFacetHits, state); this._currentNbQueries++; var self = this; this.emit('searchForFacetValues', state, facet, query); var searchForFacetValuesPromise = typeof this.client.searchForFacetValues === 'function' ? this.client.searchForFacetValues([{indexName: state.index, params: algoliaQuery}]) : this.client.initIndex(state.index).searchForFacetValues(algoliaQuery); return searchForFacetValuesPromise.then(function addIsRefined(content) { self._currentNbQueries--; if (self._currentNbQueries === 0) self.emit('searchQueueEmpty'); content = Array.isArray(content) ? content[0] : content; content.facetHits = forEach_1(content.facetHits, function(f) { f.isRefined = isDisjunctive ? state.isDisjunctiveFacetRefined(facet, f.value) : state.isFacetRefined(facet, f.value); }); return content; }, function(e) { self._currentNbQueries--; if (self._currentNbQueries === 0) self.emit('searchQueueEmpty'); throw e; }); }; /** * Sets the text query used for the search. * * This method resets the current page to 0. * @param {string} q the user query * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.setQuery = function(q) { this._change(this.state.setPage(0).setQuery(q)); return this; }; /** * Remove all the types of refinements except tags. A string can be provided to remove * only the refinements of a specific attribute. For more advanced use case, you can * provide a function instead. This function should follow the * [clearCallback definition](#SearchParameters.clearCallback). * * This method resets the current page to 0. * @param {string} [name] optional name of the facet / attribute on which we want to remove all refinements * @return {AlgoliaSearchHelper} * @fires change * @chainable * @example * // Removing all the refinements * helper.clearRefinements().search(); * @example * // Removing all the filters on a the category attribute. * helper.clearRefinements('category').search(); * @example * // Removing only the exclude filters on the category facet. * helper.clearRefinements(function(value, attribute, type) { * return type === 'exclude' && attribute === 'category'; * }).search(); */ AlgoliaSearchHelper.prototype.clearRefinements = function(name) { this._change(this.state.setPage(0).clearRefinements(name)); return this; }; /** * Remove all the tag filters. * * This method resets the current page to 0. * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.clearTags = function() { this._change(this.state.setPage(0).clearTags()); return this; }; /** * Adds a disjunctive filter to a faceted attribute with the `value` provided. If the * filter is already set, it doesn't change the filters. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} value the associated value (will be converted to string) * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.addDisjunctiveFacetRefinement = function(facet, value) { this._change(this.state.setPage(0).addDisjunctiveFacetRefinement(facet, value)); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addDisjunctiveFacetRefinement} */ AlgoliaSearchHelper.prototype.addDisjunctiveRefine = function() { return this.addDisjunctiveFacetRefinement.apply(this, arguments); }; /** * Adds a refinement on a hierarchical facet. It will throw * an exception if the facet is not defined or if the facet * is already refined. * * This method resets the current page to 0. * @param {string} facet the facet name * @param {string} path the hierarchical facet path * @return {AlgoliaSearchHelper} * @throws Error if the facet is not defined or if the facet is refined * @chainable * @fires change */ AlgoliaSearchHelper.prototype.addHierarchicalFacetRefinement = function(facet, value) { this._change(this.state.setPage(0).addHierarchicalFacetRefinement(facet, value)); return this; }; /** * Adds a an numeric filter to an attribute with the `operator` and `value` provided. If the * filter is already set, it doesn't change the filters. * * This method resets the current page to 0. * @param {string} attribute the attribute on which the numeric filter applies * @param {string} operator the operator of the filter * @param {number} value the value of the filter * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.addNumericRefinement = function(attribute, operator, value) { this._change(this.state.setPage(0).addNumericRefinement(attribute, operator, value)); return this; }; /** * Adds a filter to a faceted attribute with the `value` provided. If the * filter is already set, it doesn't change the filters. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} value the associated value (will be converted to string) * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.addFacetRefinement = function(facet, value) { this._change(this.state.setPage(0).addFacetRefinement(facet, value)); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addFacetRefinement} */ AlgoliaSearchHelper.prototype.addRefine = function() { return this.addFacetRefinement.apply(this, arguments); }; /** * Adds a an exclusion filter to a faceted attribute with the `value` provided. If the * filter is already set, it doesn't change the filters. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} value the associated value (will be converted to string) * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.addFacetExclusion = function(facet, value) { this._change(this.state.setPage(0).addExcludeRefinement(facet, value)); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addFacetExclusion} */ AlgoliaSearchHelper.prototype.addExclude = function() { return this.addFacetExclusion.apply(this, arguments); }; /** * Adds a tag filter with the `tag` provided. If the * filter is already set, it doesn't change the filters. * * This method resets the current page to 0. * @param {string} tag the tag to add to the filter * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.addTag = function(tag) { this._change(this.state.setPage(0).addTagRefinement(tag)); return this; }; /** * Removes an numeric filter to an attribute with the `operator` and `value` provided. If the * filter is not set, it doesn't change the filters. * * Some parameters are optional, triggering different behavior: * - if the value is not provided, then all the numeric value will be removed for the * specified attribute/operator couple. * - if the operator is not provided either, then all the numeric filter on this attribute * will be removed. * * This method resets the current page to 0. * @param {string} attribute the attribute on which the numeric filter applies * @param {string} [operator] the operator of the filter * @param {number} [value] the value of the filter * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.removeNumericRefinement = function(attribute, operator, value) { this._change(this.state.setPage(0).removeNumericRefinement(attribute, operator, value)); return this; }; /** * Removes a disjunctive filter to a faceted attribute with the `value` provided. If the * filter is not set, it doesn't change the filters. * * If the value is omitted, then this method will remove all the filters for the * attribute. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} [value] the associated value * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.removeDisjunctiveFacetRefinement = function(facet, value) { this._change(this.state.setPage(0).removeDisjunctiveFacetRefinement(facet, value)); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeDisjunctiveFacetRefinement} */ AlgoliaSearchHelper.prototype.removeDisjunctiveRefine = function() { return this.removeDisjunctiveFacetRefinement.apply(this, arguments); }; /** * Removes the refinement set on a hierarchical facet. * @param {string} facet the facet name * @return {AlgoliaSearchHelper} * @throws Error if the facet is not defined or if the facet is not refined * @fires change * @chainable */ AlgoliaSearchHelper.prototype.removeHierarchicalFacetRefinement = function(facet) { this._change(this.state.setPage(0).removeHierarchicalFacetRefinement(facet)); return this; }; /** * Removes a filter to a faceted attribute with the `value` provided. If the * filter is not set, it doesn't change the filters. * * If the value is omitted, then this method will remove all the filters for the * attribute. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} [value] the associated value * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.removeFacetRefinement = function(facet, value) { this._change(this.state.setPage(0).removeFacetRefinement(facet, value)); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeFacetRefinement} */ AlgoliaSearchHelper.prototype.removeRefine = function() { return this.removeFacetRefinement.apply(this, arguments); }; /** * Removes an exclusion filter to a faceted attribute with the `value` provided. If the * filter is not set, it doesn't change the filters. * * If the value is omitted, then this method will remove all the filters for the * attribute. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} [value] the associated value * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.removeFacetExclusion = function(facet, value) { this._change(this.state.setPage(0).removeExcludeRefinement(facet, value)); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeFacetExclusion} */ AlgoliaSearchHelper.prototype.removeExclude = function() { return this.removeFacetExclusion.apply(this, arguments); }; /** * Removes a tag filter with the `tag` provided. If the * filter is not set, it doesn't change the filters. * * This method resets the current page to 0. * @param {string} tag tag to remove from the filter * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.removeTag = function(tag) { this._change(this.state.setPage(0).removeTagRefinement(tag)); return this; }; /** * Adds or removes an exclusion filter to a faceted attribute with the `value` provided. If * the value is set then it removes it, otherwise it adds the filter. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} value the associated value * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.toggleFacetExclusion = function(facet, value) { this._change(this.state.setPage(0).toggleExcludeFacetRefinement(facet, value)); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#toggleFacetExclusion} */ AlgoliaSearchHelper.prototype.toggleExclude = function() { return this.toggleFacetExclusion.apply(this, arguments); }; /** * Adds or removes a filter to a faceted attribute with the `value` provided. If * the value is set then it removes it, otherwise it adds the filter. * * This method can be used for conjunctive, disjunctive and hierarchical filters. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} value the associated value * @return {AlgoliaSearchHelper} * @throws Error will throw an error if the facet is not declared in the settings of the helper * @fires change * @chainable * @deprecated since version 2.19.0, see {@link AlgoliaSearchHelper#toggleFacetRefinement} */ AlgoliaSearchHelper.prototype.toggleRefinement = function(facet, value) { return this.toggleFacetRefinement(facet, value); }; /** * Adds or removes a filter to a faceted attribute with the `value` provided. If * the value is set then it removes it, otherwise it adds the filter. * * This method can be used for conjunctive, disjunctive and hierarchical filters. * * This method resets the current page to 0. * @param {string} facet the facet to refine * @param {string} value the associated value * @return {AlgoliaSearchHelper} * @throws Error will throw an error if the facet is not declared in the settings of the helper * @fires change * @chainable */ AlgoliaSearchHelper.prototype.toggleFacetRefinement = function(facet, value) { this._change(this.state.setPage(0).toggleFacetRefinement(facet, value)); return this; }; /** * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#toggleFacetRefinement} */ AlgoliaSearchHelper.prototype.toggleRefine = function() { return this.toggleFacetRefinement.apply(this, arguments); }; /** * Adds or removes a tag filter with the `value` provided. If * the value is set then it removes it, otherwise it adds the filter. * * This method resets the current page to 0. * @param {string} tag tag to remove or add * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.toggleTag = function(tag) { this._change(this.state.setPage(0).toggleTagRefinement(tag)); return this; }; /** * Increments the page number by one. * @return {AlgoliaSearchHelper} * @fires change * @chainable * @example * helper.setPage(0).nextPage().getPage(); * // returns 1 */ AlgoliaSearchHelper.prototype.nextPage = function() { return this.setPage(this.state.page + 1); }; /** * Decrements the page number by one. * @fires change * @return {AlgoliaSearchHelper} * @chainable * @example * helper.setPage(1).previousPage().getPage(); * // returns 0 */ AlgoliaSearchHelper.prototype.previousPage = function() { return this.setPage(this.state.page - 1); }; /** * @private */ function setCurrentPage(page) { if (page < 0) throw new Error('Page requested below 0.'); this._change(this.state.setPage(page)); return this; } /** * Change the current page * @deprecated * @param {number} page The page number * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.setCurrentPage = setCurrentPage; /** * Updates the current page. * @function * @param {number} page The page number * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.setPage = setCurrentPage; /** * Updates the name of the index that will be targeted by the query. * * This method resets the current page to 0. * @param {string} name the index name * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.setIndex = function(name) { this._change(this.state.setPage(0).setIndex(name)); return this; }; /** * Update a parameter of the search. This method reset the page * * The complete list of parameters is available on the * [Algolia website](https://www.algolia.com/doc/rest#query-an-index). * The most commonly used parameters have their own [shortcuts](#query-parameters-shortcuts) * or benefit from higher-level APIs (all the kind of filters and facets have their own API) * * This method resets the current page to 0. * @param {string} parameter name of the parameter to update * @param {any} value new value of the parameter * @return {AlgoliaSearchHelper} * @fires change * @chainable * @example * helper.setQueryParameter('hitsPerPage', 20).search(); */ AlgoliaSearchHelper.prototype.setQueryParameter = function(parameter, value) { this._change(this.state.setPage(0).setQueryParameter(parameter, value)); return this; }; /** * Set the whole state (warning: will erase previous state) * @param {SearchParameters} newState the whole new state * @return {AlgoliaSearchHelper} * @fires change * @chainable */ AlgoliaSearchHelper.prototype.setState = function(newState) { this._change(SearchParameters_1.make(newState)); return this; }; /** * Get the current search state stored in the helper. This object is immutable. * @param {string[]} [filters] optional filters to retrieve only a subset of the state * @return {SearchParameters|object} if filters is specified a plain object is * returned containing only the requested fields, otherwise return the unfiltered * state * @example * // Get the complete state as stored in the helper * helper.getState(); * @example * // Get a part of the state with all the refinements on attributes and the query * helper.getState(['query', 'attribute:category']); */ AlgoliaSearchHelper.prototype.getState = function(filters) { if (filters === undefined) return this.state; return this.state.filter(filters); }; /** * DEPRECATED Get part of the state as a query string. By default, the output keys will not * be prefixed and will only take the applied refinements and the query. * @deprecated * @param {object} [options] May contain the following parameters : * * **filters** : possible values are all the keys of the [SearchParameters](#searchparameters), `index` for * the index, all the refinements with `attribute:*` or for some specific attributes with * `attribute:theAttribute` * * **prefix** : prefix in front of the keys * * **moreAttributes** : more values to be added in the query string. Those values * won't be prefixed. * @return {string} the query string */ AlgoliaSearchHelper.prototype.getStateAsQueryString = function getStateAsQueryString(options) { var filters = options && options.filters || ['query', 'attribute:*']; var partialState = this.getState(filters); return url.getQueryStringFromState(partialState, options); }; /** * DEPRECATED Read a query string and return an object containing the state. Use * url module. * @deprecated * @static * @param {string} queryString the query string that will be decoded * @param {object} options accepted options : * - prefix : the prefix used for the saved attributes, you have to provide the * same that was used for serialization * @return {object} partial search parameters object (same properties than in the * SearchParameters but not exhaustive) * @see {@link url#getStateFromQueryString} */ AlgoliaSearchHelper.getConfigurationFromQueryString = url.getStateFromQueryString; /** * DEPRECATED Retrieve an object of all the properties that are not understandable as helper * parameters. Use url module. * @deprecated * @static * @param {string} queryString the query string to read * @param {object} options the options * - prefixForParameters : prefix used for the helper configuration keys * @return {object} the object containing the parsed configuration that doesn't * to the helper */ AlgoliaSearchHelper.getForeignConfigurationInQueryString = url.getUnrecognizedParametersInQueryString; /** * DEPRECATED Overrides part of the state with the properties stored in the provided query * string. * @deprecated * @param {string} queryString the query string containing the informations to url the state * @param {object} options optional parameters : * - prefix : prefix used for the algolia parameters * - triggerChange : if set to true the state update will trigger a change event */ AlgoliaSearchHelper.prototype.setStateFromQueryString = function(queryString, options) { var triggerChange = options && options.triggerChange || false; var configuration = url.getStateFromQueryString(queryString, options); var updatedState = this.state.setQueryParameters(configuration); if (triggerChange) this.setState(updatedState); else this.overrideStateWithoutTriggeringChangeEvent(updatedState); }; /** * Override the current state without triggering a change event. * Do not use this method unless you know what you are doing. (see the example * for a legit use case) * @param {SearchParameters} newState the whole new state * @return {AlgoliaSearchHelper} * @example * helper.on('change', function(state){ * // In this function you might want to find a way to store the state in the url/history * updateYourURL(state) * }) * window.onpopstate = function(event){ * // This is naive though as you should check if the state is really defined etc. * helper.overrideStateWithoutTriggeringChangeEvent(event.state).search() * } * @chainable */ AlgoliaSearchHelper.prototype.overrideStateWithoutTriggeringChangeEvent = function(newState) { this.state = new SearchParameters_1(newState); return this; }; /** * @deprecated since 2.4.0, see {@link AlgoliaSearchHelper#hasRefinements} */ AlgoliaSearchHelper.prototype.isRefined = function(facet, value) { if (this.state.isConjunctiveFacet(facet)) { return this.state.isFacetRefined(facet, value); } else if (this.state.isDisjunctiveFacet(facet)) { return this.state.isDisjunctiveFacetRefined(facet, value); } throw new Error(facet + ' is not properly defined in this helper configuration' + '(use the facets or disjunctiveFacets keys to configure it)'); }; /** * Check if an attribute has any numeric, conjunctive, disjunctive or hierarchical filters. * @param {string} attribute the name of the attribute * @return {boolean} true if the attribute is filtered by at least one value * @example * // hasRefinements works with numeric, conjunctive, disjunctive and hierarchical filters * helper.hasRefinements('price'); // false * helper.addNumericRefinement('price', '>', 100); * helper.hasRefinements('price'); // true * * helper.hasRefinements('color'); // false * helper.addFacetRefinement('color', 'blue'); * helper.hasRefinements('color'); // true * * helper.hasRefinements('material'); // false * helper.addDisjunctiveFacetRefinement('material', 'plastic'); * helper.hasRefinements('material'); // true * * helper.hasRefinements('categories'); // false * helper.toggleFacetRefinement('categories', 'kitchen > knife'); * helper.hasRefinements('categories'); // true * */ AlgoliaSearchHelper.prototype.hasRefinements = function(attribute) { if (!isEmpty_1(this.state.getNumericRefinements(attribute))) { return true; } else if (this.state.isConjunctiveFacet(attribute)) { return this.state.isFacetRefined(attribute); } else if (this.state.isDisjunctiveFacet(attribute)) { return this.state.isDisjunctiveFacetRefined(attribute); } else if (this.state.isHierarchicalFacet(attribute)) { return this.state.isHierarchicalFacetRefined(attribute); } // there's currently no way to know that the user did call `addNumericRefinement` at some point // thus we cannot distinguish if there once was a numeric refinement that was cleared // so we will return false in every other situations to be consistent // while what we should do here is throw because we did not find the attribute in any type // of refinement return false; }; /** * Check if a value is excluded for a specific faceted attribute. If the value * is omitted then the function checks if there is any excluding refinements. * * @param {string} facet name of the attribute for used for faceting * @param {string} [value] optional value. If passed will test that this value * is filtering the given facet. * @return {boolean} true if refined * @example * helper.isExcludeRefined('color'); // false * helper.isExcludeRefined('color', 'blue') // false * helper.isExcludeRefined('color', 'red') // false * * helper.addFacetExclusion('color', 'red'); * * helper.isExcludeRefined('color'); // true * helper.isExcludeRefined('color', 'blue') // false * helper.isExcludeRefined('color', 'red') // true */ AlgoliaSearchHelper.prototype.isExcluded = function(facet, value) { return this.state.isExcludeRefined(facet, value); }; /** * @deprecated since 2.4.0, see {@link AlgoliaSearchHelper#hasRefinements} */ AlgoliaSearchHelper.prototype.isDisjunctiveRefined = function(facet, value) { return this.state.isDisjunctiveFacetRefined(facet, value); }; /** * Check if the string is a currently filtering tag. * @param {string} tag tag to check * @return {boolean} */ AlgoliaSearchHelper.prototype.hasTag = function(tag) { return this.state.isTagRefined(tag); }; /** * @deprecated since 2.4.0, see {@link AlgoliaSearchHelper#hasTag} */ AlgoliaSearchHelper.prototype.isTagRefined = function() { return this.hasTagRefinements.apply(this, arguments); }; /** * Get the name of the currently used index. * @return {string} * @example * helper.setIndex('highestPrice_products').getIndex(); * // returns 'highestPrice_products' */ AlgoliaSearchHelper.prototype.getIndex = function() { return this.state.index; }; function getCurrentPage() { return this.state.page; } /** * Get the currently selected page * @deprecated * @return {number} the current page */ AlgoliaSearchHelper.prototype.getCurrentPage = getCurrentPage; /** * Get the currently selected page * @function * @return {number} the current page */ AlgoliaSearchHelper.prototype.getPage = getCurrentPage; /** * Get all the tags currently set to filters the results. * * @return {string[]} The list of tags currently set. */ AlgoliaSearchHelper.prototype.getTags = function() { return this.state.tagRefinements; }; /** * Get a parameter of the search by its name. It is possible that a parameter is directly * defined in the index dashboard, but it will be undefined using this method. * * The complete list of parameters is * available on the * [Algolia website](https://www.algolia.com/doc/rest#query-an-index). * The most commonly used parameters have their own [shortcuts](#query-parameters-shortcuts) * or benefit from higher-level APIs (all the kind of filters have their own API) * @param {string} parameterName the parameter name * @return {any} the parameter value * @example * var hitsPerPage = helper.getQueryParameter('hitsPerPage'); */ AlgoliaSearchHelper.prototype.getQueryParameter = function(parameterName) { return this.state.getQueryParameter(parameterName); }; /** * Get the list of refinements for a given attribute. This method works with * conjunctive, disjunctive, excluding and numerical filters. * * See also SearchResults#getRefinements * * @param {string} facetName attribute name used for faceting * @return {Array.<FacetRefinement|NumericRefinement>} All Refinement are objects that contain a value, and * a type. Numeric also contains an operator. * @example * helper.addNumericRefinement('price', '>', 100); * helper.getRefinements('price'); * // [ * // { * // "value": [ * // 100 * // ], * // "operator": ">", * // "type": "numeric" * // } * // ] * @example * helper.addFacetRefinement('color', 'blue'); * helper.addFacetExclusion('color', 'red'); * helper.getRefinements('color'); * // [ * // { * // "value": "blue", * // "type": "conjunctive" * // }, * // { * // "value": "red", * // "type": "exclude" * // } * // ] * @example * helper.addDisjunctiveFacetRefinement('material', 'plastic'); * // [ * // { * // "value": "plastic", * // "type": "disjunctive" * // } * // ] */ AlgoliaSearchHelper.prototype.getRefinements = function(facetName) { var refinements = []; if (this.state.isConjunctiveFacet(facetName)) { var conjRefinements = this.state.getConjunctiveRefinements(facetName); forEach_1(conjRefinements, function(r) { refinements.push({ value: r, type: 'conjunctive' }); }); var excludeRefinements = this.state.getExcludeRefinements(facetName); forEach_1(excludeRefinements, function(r) { refinements.push({ value: r, type: 'exclude' }); }); } else if (this.state.isDisjunctiveFacet(facetName)) { var disjRefinements = this.state.getDisjunctiveRefinements(facetName); forEach_1(disjRefinements, function(r) { refinements.push({ value: r, type: 'disjunctive' }); }); } var numericRefinements = this.state.getNumericRefinements(facetName); forEach_1(numericRefinements, function(value, operator) { refinements.push({ value: value, operator: operator, type: 'numeric' }); }); return refinements; }; /** * Return the current refinement for the (attribute, operator) * @param {string} attribute attribute in the record * @param {string} operator operator applied on the refined values * @return {Array.<number|number[]>} refined values */ AlgoliaSearchHelper.prototype.getNumericRefinement = function(attribute, operator) { return this.state.getNumericRefinement(attribute, operator); }; /** * Get the current breadcrumb for a hierarchical facet, as an array * @param {string} facetName Hierarchical facet name * @return {array.<string>} the path as an array of string */ AlgoliaSearchHelper.prototype.getHierarchicalFacetBreadcrumb = function(facetName) { return this.state.getHierarchicalFacetBreadcrumb(facetName); }; // /////////// PRIVATE /** * Perform the underlying queries * @private * @return {undefined} * @fires search * @fires result * @fires error */ AlgoliaSearchHelper.prototype._search = function() { var state = this.state; var mainQueries = requestBuilder_1._getQueries(state.index, state); var states = [{ state: state, queriesCount: mainQueries.length, helper: this }]; this.emit('search', state, this.lastResults); var derivedQueries = map_1(this.derivedHelpers, function(derivedHelper) { var derivedState = derivedHelper.getModifiedState(state); var queries = requestBuilder_1._getQueries(derivedState.index, derivedState); states.push({ state: derivedState, queriesCount: queries.length, helper: derivedHelper }); derivedHelper.emit('search', derivedState, derivedHelper.lastResults); return queries; }); var queries = mainQueries.concat(flatten_1(derivedQueries)); var queryId = this._queryId++; this._currentNbQueries++; try { this.client.search(queries) .then(this._dispatchAlgoliaResponse.bind(this, states, queryId)) .catch(this._dispatchAlgoliaError.bind(this, queryId)); } catch (err) { // If we reach this part, we're in an internal error state this.emit('error', err); } }; /** * Transform the responses as sent by the server and transform them into a user * usable object that merge the results of all the batch requests. It will dispatch * over the different helper + derived helpers (when there are some). * @private * @param {array.<{SearchParameters, AlgoliaQueries, AlgoliaSearchHelper}>} * state state used for to generate the request * @param {number} queryId id of the current request * @param {object} content content of the response * @return {undefined} */ AlgoliaSearchHelper.prototype._dispatchAlgoliaResponse = function(states, queryId, content) { // FIXME remove the number of outdated queries discarded instead of just one if (queryId < this._lastQueryIdReceived) { // Outdated answer return; } this._currentNbQueries -= (queryId - this._lastQueryIdReceived); this._lastQueryIdReceived = queryId; if (this._currentNbQueries === 0) this.emit('searchQueueEmpty'); var results = content.results; forEach_1(states, function(s) { var state = s.state; var queriesCount = s.queriesCount; var helper = s.helper; var specificResults = results.splice(0, queriesCount); var formattedResponse = helper.lastResults = new SearchResults_1(state, specificResults); helper.emit('result', formattedResponse, state); }); }; AlgoliaSearchHelper.prototype._dispatchAlgoliaError = function(queryId, err) { if (queryId < this._lastQueryIdReceived) { // Outdated answer return; } this._currentNbQueries -= queryId - this._lastQueryIdReceived; this._lastQueryIdReceived = queryId; this.emit('error', err); if (this._currentNbQueries === 0) this.emit('searchQueueEmpty'); }; AlgoliaSearchHelper.prototype.containsRefinement = function(query, facetFilters, numericFilters, tagFilters) { return query || facetFilters.length !== 0 || numericFilters.length !== 0 || tagFilters.length !== 0; }; /** * Test if there are some disjunctive refinements on the facet * @private * @param {string} facet the attribute to test * @return {boolean} */ AlgoliaSearchHelper.prototype._hasDisjunctiveRefinements = function(facet) { return this.state.disjunctiveRefinements[facet] && this.state.disjunctiveRefinements[facet].length > 0; }; AlgoliaSearchHelper.prototype._change = function(newState) { if (newState !== this.state) { this.state = newState; this.emit('change', this.state, this.lastResults); } }; /** * Clears the cache of the underlying Algolia client. * @return {AlgoliaSearchHelper} */ AlgoliaSearchHelper.prototype.clearCache = function() { this.client.clearCache && this.client.clearCache(); return this; }; /** * Updates the internal client instance. If the reference of the clients * are equal then no update is actually done. * @param {AlgoliaSearch} newClient an AlgoliaSearch client * @return {AlgoliaSearchHelper} */ AlgoliaSearchHelper.prototype.setClient = function(newClient) { if (this.client === newClient) return this; if (newClient.addAlgoliaAgent && !doesClientAgentContainsHelper(newClient)) newClient.addAlgoliaAgent('JS Helper ' + version$1); this.client = newClient; return this; }; /** * Gets the instance of the currently used client. * @return {AlgoliaSearch} */ AlgoliaSearchHelper.prototype.getClient = function() { return this.client; }; /** * Creates an derived instance of the Helper. A derived helper * is a way to request other indices synchronised with the lifecycle * of the main Helper. This mechanism uses the multiqueries feature * of Algolia to aggregate all the requests in a single network call. * * This method takes a function that is used to create a new SearchParameter * that will be used to create requests to Algolia. Those new requests * are created just before the `search` event. The signature of the function * is `SearchParameters -> SearchParameters`. * * This method returns a new DerivedHelper which is an EventEmitter * that fires the same `search`, `result` and `error` events. Those * events, however, will receive data specific to this DerivedHelper * and the SearchParameters that is returned by the call of the * parameter function. * @param {function} fn SearchParameters -> SearchParameters * @return {DerivedHelper} */ AlgoliaSearchHelper.prototype.derive = function(fn) { var derivedHelper = new DerivedHelper_1(this, fn); this.derivedHelpers.push(derivedHelper); return derivedHelper; }; /** * This method detaches a derived Helper from the main one. Prefer using the one from the * derived helper itself, to remove the event listeners too. * @private * @return {undefined} * @throws Error */ AlgoliaSearchHelper.prototype.detachDerivedHelper = function(derivedHelper) { var pos = this.derivedHelpers.indexOf(derivedHelper); if (pos === -1) throw new Error('Derived helper already detached'); this.derivedHelpers.splice(pos, 1); }; /** * This method returns true if there is currently at least one on-going search. * @return {boolean} true if there is a search pending */ AlgoliaSearchHelper.prototype.hasPendingRequests = function() { return this._currentNbQueries > 0; }; /** * @typedef AlgoliaSearchHelper.NumericRefinement * @type {object} * @property {number[]} value the numbers that are used for filtering this attribute with * the operator specified. * @property {string} operator the faceting data: value, number of entries * @property {string} type will be 'numeric' */ /** * @typedef AlgoliaSearchHelper.FacetRefinement * @type {object} * @property {string} value the string use to filter the attribute * @property {string} type the type of filter: 'conjunctive', 'disjunctive', 'exclude' */ /* * This function tests if the _ua parameter of the client * already contains the JS Helper UA */ function doesClientAgentContainsHelper(client) { // this relies on JS Client internal variable, this might break if implementation changes var currentAgent = client._ua; return !currentAgent ? false : currentAgent.indexOf('JS Helper') !== -1; } var algoliasearch_helper = AlgoliaSearchHelper; /** * The algoliasearchHelper module is the function that will let its * contains everything needed to use the Algoliasearch * Helper. It is a also a function that instanciate the helper. * To use the helper, you also need the Algolia JS client v3. * @example * //using the UMD build * var client = algoliasearch('latency', '6be0576ff61c053d5f9a3225e2a90f76'); * var helper = algoliasearchHelper(client, 'bestbuy', { * facets: ['shipping'], * disjunctiveFacets: ['category'] * }); * helper.on('result', function(result) { * console.log(result); * }); * helper.toggleRefine('Movies & TV Shows') * .toggleRefine('Free shipping') * .search(); * @example * // The helper is an event emitter using the node API * helper.on('result', updateTheResults); * helper.once('result', updateTheResults); * helper.removeListener('result', updateTheResults); * helper.removeAllListeners('result'); * @module algoliasearchHelper * @param {AlgoliaSearch} client an AlgoliaSearch client * @param {string} index the name of the index to query * @param {SearchParameters|object} opts an object defining the initial config of the search. It doesn't have to be a {SearchParameters}, just an object containing the properties you need from it. * @return {AlgoliaSearchHelper} */ function algoliasearchHelper(client, index, opts) { return new algoliasearch_helper(client, index, opts); } /** * The version currently used * @member module:algoliasearchHelper.version * @type {number} */ algoliasearchHelper.version = version$1; /** * Constructor for the Helper. * @member module:algoliasearchHelper.AlgoliaSearchHelper * @type {AlgoliaSearchHelper} */ algoliasearchHelper.AlgoliaSearchHelper = algoliasearch_helper; /** * Constructor for the object containing all the parameters of the search. * @member module:algoliasearchHelper.SearchParameters * @type {SearchParameters} */ algoliasearchHelper.SearchParameters = SearchParameters_1; /** * Constructor for the object containing the results of the search. * @member module:algoliasearchHelper.SearchResults * @type {SearchResults} */ algoliasearchHelper.SearchResults = SearchResults_1; /** * URL tools to generate query string and parse them from/into * SearchParameters * @member module:algoliasearchHelper.url * @type {object} {@link url} * */ algoliasearchHelper.url = url; var algoliasearchHelper_1 = algoliasearchHelper; var algoliasearchHelper_4 = algoliasearchHelper_1.SearchParameters; // From https://github.com/reactjs/react-redux/blob/master/src/utils/shallowEqual.js var shallowEqual = function shallowEqual(objA, objB) { if (objA === objB) { return true; } var keysA = Object.keys(objA); var keysB = Object.keys(objB); if (keysA.length !== keysB.length) { return false; } // Test for A's keys different from B. var hasOwn = Object.prototype.hasOwnProperty; for (var i = 0; i < keysA.length; i++) { if (!hasOwn.call(objB, keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) { return false; } } return true; }; var getDisplayName = function getDisplayName(Component) { return Component.displayName || Component.name || 'UnknownComponent'; }; var resolved = Promise.resolve(); var defer = function defer(f) { resolved.then(f); }; var removeEmptyKey = function removeEmptyKey(obj) { Object.keys(obj).forEach(function (key) { var value = obj[key]; if (isEmpty_1(value) && isPlainObject_1(value)) { delete obj[key]; } else if (isPlainObject_1(value)) { removeEmptyKey(value); } }); return obj; }; function createWidgetsManager(onWidgetsUpdate) { var widgets = []; // Is an update scheduled? var scheduled = false; // The state manager's updates need to be batched since more than one // component can register or unregister widgets during the same tick. function scheduleUpdate() { if (scheduled) { return; } scheduled = true; defer(function () { scheduled = false; onWidgetsUpdate(); }); } return { registerWidget: function registerWidget(widget) { widgets.push(widget); scheduleUpdate(); return function unregisterWidget() { widgets.splice(widgets.indexOf(widget), 1); scheduleUpdate(); }; }, update: scheduleUpdate, getWidgets: function getWidgets() { return widgets; } }; } function createStore(initialState) { var state = initialState; var listeners = []; function dispatch() { listeners.forEach(function (listener) { return listener(); }); } return { getState: function getState() { return state; }, setState: function setState(nextState) { state = nextState; dispatch(); }, subscribe: function subscribe(listener) { listeners.push(listener); return function unsubcribe() { listeners.splice(listeners.indexOf(listener), 1); }; } }; } var HIGHLIGHT_TAGS = { highlightPreTag: '<ais-highlight-0000000000>', highlightPostTag: '</ais-highlight-0000000000>' }; /** * Parses an highlighted attribute into an array of objects with the string value, and * a boolean that indicated if this part is highlighted. * * @param {string} preTag - string used to identify the start of an highlighted value * @param {string} postTag - string used to identify the end of an highlighted value * @param {string} highlightedValue - highlighted attribute as returned by Algolia highlight feature * @return {object[]} - An array of {value: string, isDefined: boolean}. */ function parseHighlightedAttribute(_ref) { var preTag = _ref.preTag, postTag = _ref.postTag, _ref$highlightedValue = _ref.highlightedValue, highlightedValue = _ref$highlightedValue === undefined ? '' : _ref$highlightedValue; var splitByPreTag = highlightedValue.split(preTag); var firstValue = splitByPreTag.shift(); var elements = firstValue === '' ? [] : [{ value: firstValue, isHighlighted: false }]; if (postTag === preTag) { var isHighlighted = true; splitByPreTag.forEach(function (split) { elements.push({ value: split, isHighlighted: isHighlighted }); isHighlighted = !isHighlighted; }); } else { splitByPreTag.forEach(function (split) { var splitByPostTag = split.split(postTag); elements.push({ value: splitByPostTag[0], isHighlighted: true }); if (splitByPostTag[1] !== '') { elements.push({ value: splitByPostTag[1], isHighlighted: false }); } }); } return elements; } /** * Find an highlighted attribute given an `attribute` and an `highlightProperty`, parses it, * and provided an array of objects with the string value and a boolean if this * value is highlighted. * * In order to use this feature, highlight must be activated in the configuration of * the index. The `preTag` and `postTag` attributes are respectively highlightPreTag and * highligtPostTag in Algolia configuration. * * @param {string} preTag - string used to identify the start of an highlighted value * @param {string} postTag - string used to identify the end of an highlighted value * @param {string} highlightProperty - the property that contains the highlight structure in the results * @param {string} attribute - the highlighted attribute to look for * @param {object} hit - the actual hit returned by Algolia. * @return {object[]} - An array of {value: string, isHighlighted: boolean}. */ function parseAlgoliaHit(_ref2) { var _ref2$preTag = _ref2.preTag, preTag = _ref2$preTag === undefined ? '<em>' : _ref2$preTag, _ref2$postTag = _ref2.postTag, postTag = _ref2$postTag === undefined ? '</em>' : _ref2$postTag, highlightProperty = _ref2.highlightProperty, attribute = _ref2.attribute, hit = _ref2.hit; if (!hit) throw new Error('`hit`, the matching record, must be provided'); var highlightObject = get_1(hit[highlightProperty], attribute, {}); if (Array.isArray(highlightObject)) { return highlightObject.map(function (item) { return parseHighlightedAttribute({ preTag: preTag, postTag: postTag, highlightedValue: item.value }); }); } return parseHighlightedAttribute({ preTag: preTag, postTag: postTag, highlightedValue: highlightObject.value }); } 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; }; function _defineProperty$1(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; } /** * Creates a new instance of the InstantSearchManager which controls the widgets and * trigger the search when the widgets are updated. * @param {string} indexName - the main index name * @param {object} initialState - initial widget state * @param {object} SearchParameters - optional additional parameters to send to the algolia API * @param {number} stalledSearchDelay - time (in ms) after the search is stalled * @return {InstantSearchManager} a new instance of InstantSearchManager */ function createInstantSearchManager(_ref) { var indexName = _ref.indexName, _ref$initialState = _ref.initialState, initialState = _ref$initialState === undefined ? {} : _ref$initialState, searchClient = _ref.searchClient, resultsState = _ref.resultsState, stalledSearchDelay = _ref.stalledSearchDelay; var baseSP = new algoliasearchHelper_4(_extends({ index: indexName }, HIGHLIGHT_TAGS)); var stalledSearchTimer = null; var helper = algoliasearchHelper_1(searchClient, indexName, baseSP); helper.on('result', handleSearchSuccess); helper.on('error', handleSearchError); helper.on('search', handleNewSearch); var derivedHelpers = {}; var indexMapping = {}; // keep track of the original index where the parameters applied when sortBy is used. var initialSearchParameters = helper.state; var widgetsManager = createWidgetsManager(onWidgetsUpdate); var store = createStore({ widgets: initialState, metadata: [], results: resultsState || null, error: null, searching: false, isSearchStalled: true, searchingForFacetValues: false }); var skip = false; function skipSearch() { skip = true; } function updateClient(client) { helper.setClient(client); search(); } function clearCache() { helper.clearCache(); search(); } function getMetadata(state) { return widgetsManager.getWidgets().filter(function (widget) { return Boolean(widget.getMetadata); }).map(function (widget) { return widget.getMetadata(state); }); } function getSearchParameters() { indexMapping = {}; var sharedParameters = widgetsManager.getWidgets().filter(function (widget) { return Boolean(widget.getSearchParameters); }).filter(function (widget) { return !widget.context.multiIndexContext && (widget.props.indexName === indexName || !widget.props.indexName); }).reduce(function (res, widget) { return widget.getSearchParameters(res); }, initialSearchParameters); indexMapping[sharedParameters.index] = indexName; var derivatedWidgets = widgetsManager.getWidgets().filter(function (widget) { return Boolean(widget.getSearchParameters); }).filter(function (widget) { return widget.context.multiIndexContext && widget.context.multiIndexContext.targetedIndex !== indexName || widget.props.indexName && widget.props.indexName !== indexName; }).reduce(function (indices, widget) { var targetedIndex = widget.context.multiIndexContext ? widget.context.multiIndexContext.targetedIndex : widget.props.indexName; var index = find_1(indices, function (i) { return i.targetedIndex === targetedIndex; }); if (index) { index.widgets.push(widget); } else { indices.push({ targetedIndex: targetedIndex, widgets: [widget] }); } return indices; }, []); var mainIndexParameters = widgetsManager.getWidgets().filter(function (widget) { return Boolean(widget.getSearchParameters); }).filter(function (widget) { return widget.context.multiIndexContext && widget.context.multiIndexContext.targetedIndex === indexName || widget.props.indexName && widget.props.indexName === indexName; }).reduce(function (res, widget) { return widget.getSearchParameters(res); }, sharedParameters); indexMapping[mainIndexParameters.index] = indexName; return { sharedParameters: sharedParameters, mainIndexParameters: mainIndexParameters, derivatedWidgets: derivatedWidgets }; } function search() { if (!skip) { var _getSearchParameters = getSearchParameters(helper.state), sharedParameters = _getSearchParameters.sharedParameters, mainIndexParameters = _getSearchParameters.mainIndexParameters, derivatedWidgets = _getSearchParameters.derivatedWidgets; Object.keys(derivedHelpers).forEach(function (key) { return derivedHelpers[key].detach(); }); derivedHelpers = {}; helper.setState(sharedParameters); derivatedWidgets.forEach(function (derivatedSearchParameters) { var index = derivatedSearchParameters.targetedIndex; var derivedHelper = helper.derive(function () { var parameters = derivatedSearchParameters.widgets.reduce(function (res, widget) { return widget.getSearchParameters(res); }, sharedParameters); indexMapping[parameters.index] = index; return parameters; }); derivedHelper.on('result', handleSearchSuccess); derivedHelper.on('error', handleSearchError); derivedHelpers[index] = derivedHelper; }); helper.setState(mainIndexParameters); helper.search(); } } function handleSearchSuccess(content) { var state = store.getState(); var results = state.results ? state.results : {}; /* if switching from mono index to multi index and vice versa, results needs to reset to {}*/ results = !isEmpty_1(derivedHelpers) && results.getFacetByName ? {} : results; if (!isEmpty_1(derivedHelpers)) { results[indexMapping[content.index]] = content; } else { results = content; } var currentState = store.getState(); var nextIsSearchStalled = currentState.isSearchStalled; if (!helper.hasPendingRequests()) { clearTimeout(stalledSearchTimer); stalledSearchTimer = null; nextIsSearchStalled = false; } var nextState = omit_1(_extends({}, currentState, { results: results, isSearchStalled: nextIsSearchStalled, searching: false, error: null }), 'resultsFacetValues'); store.setState(nextState); } function handleSearchError(error) { var currentState = store.getState(); var nextIsSearchStalled = currentState.isSearchStalled; if (!helper.hasPendingRequests()) { clearTimeout(stalledSearchTimer); nextIsSearchStalled = false; } var nextState = omit_1(_extends({}, currentState, { isSearchStalled: nextIsSearchStalled, error: error, searching: false }), 'resultsFacetValues'); store.setState(nextState); } function handleNewSearch() { if (!stalledSearchTimer) { stalledSearchTimer = setTimeout(function () { var nextState = omit_1(_extends({}, store.getState(), { isSearchStalled: true }), 'resultsFacetValues'); store.setState(nextState); }, stalledSearchDelay); } } // Called whenever a widget has been rendered with new props. function onWidgetsUpdate() { var metadata = getMetadata(store.getState().widgets); store.setState(_extends({}, store.getState(), { metadata: metadata, searching: true })); // Since the `getSearchParameters` method of widgets also depends on props, // the result search parameters might have changed. search(); } function transitionState(nextSearchState) { var searchState = store.getState().widgets; return widgetsManager.getWidgets().filter(function (widget) { return Boolean(widget.transitionState); }).reduce(function (res, widget) { return widget.transitionState(searchState, res); }, nextSearchState); } function onExternalStateUpdate(nextSearchState) { var metadata = getMetadata(nextSearchState); store.setState(_extends({}, store.getState(), { widgets: nextSearchState, metadata: metadata, searching: true })); search(); } function onSearchForFacetValues(_ref2) { var facetName = _ref2.facetName, query = _ref2.query, maxFacetHits = _ref2.maxFacetHits; store.setState(_extends({}, store.getState(), { searchingForFacetValues: true })); helper.searchForFacetValues(facetName, query, maxFacetHits).then(function (content) { var _extends2; store.setState(_extends({}, store.getState(), { resultsFacetValues: _extends({}, store.getState().resultsFacetValues, (_extends2 = {}, _defineProperty$1(_extends2, facetName, content.facetHits), _defineProperty$1(_extends2, 'query', query), _extends2)), searchingForFacetValues: false })); }, function (error) { store.setState(_extends({}, store.getState(), { error: error, searchingForFacetValues: false })); }).catch(function (error) { // Since setState is synchronous, any error that occurs in the render of a // component will be swallowed by this promise. // This is a trick to make the error show up correctly in the console. // See http://stackoverflow.com/a/30741722/969302 setTimeout(function () { throw error; }); }); } function updateIndex(newIndex) { initialSearchParameters = initialSearchParameters.setIndex(newIndex); search(); } function getWidgetsIds() { return store.getState().metadata.reduce(function (res, meta) { return typeof meta.id !== 'undefined' ? res.concat(meta.id) : res; }, []); } return { store: store, widgetsManager: widgetsManager, getWidgetsIds: getWidgetsIds, onExternalStateUpdate: onExternalStateUpdate, transitionState: transitionState, onSearchForFacetValues: onSearchForFacetValues, updateClient: updateClient, updateIndex: updateIndex, clearCache: clearCache, skipSearch: skipSearch }; } 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 _extends$2 = 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; }; }(); 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 === "undefined" ? "undefined" : _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 === "undefined" ? "undefined" : _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 validateNextProps(props, nextProps) { if (!props.searchState && nextProps.searchState) { throw new Error("You can't switch <InstantSearch> from being uncontrolled to controlled"); } else if (props.searchState && !nextProps.searchState) { throw new Error("You can't switch <InstantSearch> from being controlled to uncontrolled"); } } /* eslint valid-jsdoc: 0 */ /** * @description * `<InstantSearch>` is the root component of all React InstantSearch implementations. * It provides all the connected components (aka widgets) a means to interact * with the searchState. * @kind widget * @name <InstantSearch> * @requirements You will need to have an Algolia account to be able to use this widget. * [Create one now](https://www.algolia.com/users/sign_up). * @propType {string} appId - Your Algolia application id. * @propType {string} apiKey - Your Algolia search-only API key. * @propType {string} indexName - Main index in which to search. * @propType {boolean} [refresh=false] - Flag to activate when the cache needs to be cleared so that the front-end is updated when a change occurs in the index. * @propType {object} [algoliaClient] - Provide a custom Algolia client instead of the internal one (deprecated in favor of `searchClient`). * @propType {object} [searchClient] - Provide a custom search client. * @propType {func} [onSearchStateChange] - Function to be called everytime a new search is done. Useful for [URL Routing](guide/Routing.html). * @propType {object} [searchState] - Object to inject some search state. Switches the InstantSearch component in controlled mode. Useful for [URL Routing](guide/Routing.html). * @propType {func} [createURL] - Function to call when creating links, useful for [URL Routing](guide/Routing.html). * @propType {SearchResults|SearchResults[]} [resultsState] - Use this to inject the results that will be used at first rendering. Those results are found by using the `findResultsState` function. Useful for [Server Side Rendering](guide/Server-side_rendering.html). * @propType {number} [stalledSearchDelay=200] - The amount of time before considering that the search takes too much time. The time is expressed in milliseconds. * @propType {{ Root: string|function, props: object }} [root] - Use this to customize the root element. Default value: `{ Root: 'div' }` * @example * import React from 'react'; * import { InstantSearch, SearchBox, Hits } from 'react-instantsearch-dom'; * * const App = () => ( * <InstantSearch * appId="latency" * apiKey="6be0576ff61c053d5f9a3225e2a90f76" * indexName="ikea" * > * <SearchBox /> * <Hits /> * </InstantSearch> * ); */ var InstantSearch = function (_Component) { _inherits(InstantSearch, _Component); function InstantSearch(props) { _classCallCheck(this, InstantSearch); var _this = _possibleConstructorReturn(this, (InstantSearch.__proto__ || Object.getPrototypeOf(InstantSearch)).call(this, props)); _this.isControlled = Boolean(props.searchState); var initialState = _this.isControlled ? props.searchState : {}; _this.isUnmounting = false; _this.aisManager = createInstantSearchManager({ indexName: props.indexName, searchClient: props.searchClient, initialState: initialState, resultsState: props.resultsState, stalledSearchDelay: props.stalledSearchDelay }); return _this; } _createClass(InstantSearch, [{ key: 'componentWillReceiveProps', value: function componentWillReceiveProps(nextProps) { validateNextProps(this.props, nextProps); if (this.props.indexName !== nextProps.indexName) { this.aisManager.updateIndex(nextProps.indexName); } if (this.props.refresh !== nextProps.refresh) { if (nextProps.refresh) { this.aisManager.clearCache(); } } if (this.props.searchClient !== nextProps.searchClient) { this.aisManager.updateClient(nextProps.searchClient); } if (this.isControlled) { this.aisManager.onExternalStateUpdate(nextProps.searchState); } } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { this.isUnmounting = true; this.aisManager.skipSearch(); } }, { key: 'getChildContext', value: function getChildContext() { // If not already cached, cache the bound methods so that we can forward them as part // of the context. if (!this._aisContextCache) { this._aisContextCache = { ais: { onInternalStateUpdate: this.onWidgetsInternalStateUpdate.bind(this), createHrefForState: this.createHrefForState.bind(this), onSearchForFacetValues: this.onSearchForFacetValues.bind(this), onSearchStateChange: this.onSearchStateChange.bind(this), onSearchParameters: this.onSearchParameters.bind(this) } }; } return { ais: _extends$2({}, this._aisContextCache.ais, { store: this.aisManager.store, widgetsManager: this.aisManager.widgetsManager, mainTargetedIndex: this.props.indexName }) }; } }, { key: 'createHrefForState', value: function createHrefForState(searchState) { searchState = this.aisManager.transitionState(searchState); return this.isControlled && this.props.createURL ? this.props.createURL(searchState, this.getKnownKeys()) : '#'; } }, { key: 'onWidgetsInternalStateUpdate', value: function onWidgetsInternalStateUpdate(searchState) { searchState = this.aisManager.transitionState(searchState); this.onSearchStateChange(searchState); if (!this.isControlled) { this.aisManager.onExternalStateUpdate(searchState); } } }, { key: 'onSearchStateChange', value: function onSearchStateChange(searchState) { if (this.props.onSearchStateChange && !this.isUnmounting) { this.props.onSearchStateChange(searchState); } } }, { key: 'onSearchParameters', value: function onSearchParameters(getSearchParameters, context, props) { if (this.props.onSearchParameters) { var searchState = this.props.searchState ? this.props.searchState : {}; this.props.onSearchParameters(getSearchParameters, context, props, searchState); } } }, { key: 'onSearchForFacetValues', value: function onSearchForFacetValues(searchState) { this.aisManager.onSearchForFacetValues(searchState); } }, { key: 'getKnownKeys', value: function getKnownKeys() { return this.aisManager.getWidgetsIds(); } }, { key: 'render', value: function render() { var childrenCount = React.Children.count(this.props.children); var _props$root = this.props.root, Root = _props$root.Root, props = _props$root.props; if (childrenCount === 0) return null;else return React__default.createElement(Root, props, this.props.children); } }]); return InstantSearch; }(React.Component); InstantSearch.defaultProps = { stalledSearchDelay: 200 }; InstantSearch.propTypes = { // @TODO: These props are currently constant. indexName: propTypes.string.isRequired, searchClient: propTypes.object.isRequired, createURL: propTypes.func, refresh: propTypes.bool.isRequired, searchState: propTypes.object, onSearchStateChange: propTypes.func, onSearchParameters: propTypes.func, resultsState: propTypes.oneOfType([propTypes.object, propTypes.array]), children: propTypes.node, root: propTypes.shape({ Root: propTypes.oneOfType([propTypes.string, propTypes.func]), props: propTypes.object }).isRequired, stalledSearchDelay: propTypes.number }; InstantSearch.childContextTypes = { // @TODO: more precise widgets manager propType ais: propTypes.object.isRequired }; var _createClass$2 = 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; }; }(); function _classCallCheck$2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn$2(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === "undefined" ? "undefined" : _typeof(call)) === "object" || typeof call === "function") ? call : self; } function _inherits$2(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : _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; } /* eslint valid-jsdoc: 0 */ /** * @description * `<Index>` is the component that allows you to apply widgets to a dedicated index. It's * useful if you want to build an interface that targets multiple indices. * @kind widget * @name <Index> * @propType {string} indexName - index in which to search. * @propType {{ Root: string|function, props: object }} [root] - Use this to customize the root element. Default value: `{ Root: 'div' }` * @example * import React from 'react'; * import { InstantSearch, Index, SearchBox, Hits, Configure } from 'react-instantsearch-dom'; * * const App = () => ( * <InstantSearch * appId="latency" * apiKey="6be0576ff61c053d5f9a3225e2a90f76" * indexName="ikea" * > * <Configure hitsPerPage={5} /> * <SearchBox /> * <Index indexName="ikea"> * <Hits /> * </Index> * <Index indexName="bestbuy"> * <Hits /> * </Index> * </InstantSearch> * ); */ var Index = function (_Component) { _inherits$2(Index, _Component); function Index(props, context) { _classCallCheck$2(this, Index); var _this = _possibleConstructorReturn$2(this, (Index.__proto__ || Object.getPrototypeOf(Index)).call(this, props)); var widgetsManager = context.ais.widgetsManager; /* we want <Index> to be seen as a regular widget. It means that with only <Index> present a new query will be sent to Algolia. That way you don't need a virtual hits widget to use the connectAutoComplete. */ _this.unregisterWidget = widgetsManager.registerWidget(_this); return _this; } _createClass$2(Index, [{ key: 'componentWillMount', value: function componentWillMount() { this.context.ais.onSearchParameters(this.getSearchParameters, this.getChildContext(), this.props); } }, { key: 'componentWillReceiveProps', value: function componentWillReceiveProps(nextProps) { if (this.props.indexName !== nextProps.indexName) { this.context.ais.widgetsManager.update(); } } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { this.unregisterWidget(); } }, { key: 'getChildContext', value: function getChildContext() { return { multiIndexContext: { targetedIndex: this.props.indexName } }; } }, { key: 'getSearchParameters', value: function getSearchParameters(searchParameters, props) { return searchParameters.setIndex(this.props ? this.props.indexName : props.indexName); } }, { key: 'render', value: function render() { var childrenCount = React.Children.count(this.props.children); var _props$root = this.props.root, Root = _props$root.Root, props = _props$root.props; if (childrenCount === 0) return null;else return React__default.createElement(Root, props, this.props.children); } }]); return Index; }(React.Component); Index.propTypes = { // @TODO: These props are currently constant. indexName: propTypes.string.isRequired, children: propTypes.node, root: propTypes.shape({ Root: propTypes.oneOfType([propTypes.string, propTypes.func]), props: propTypes.object }).isRequired }; Index.childContextTypes = { multiIndexContext: propTypes.object.isRequired }; Index.contextTypes = { // @TODO: more precise widgets manager propType ais: propTypes.object.isRequired }; /** Used for built-in method references. */ var objectProto$l = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty$i = objectProto$l.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$i.call(object, key); } var _baseHas = baseHas; /** * 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$1(object, path) { return object != null && _hasPath(object, path, _baseHas); } var has_1 = has$1; var _extends$3 = 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$3 = 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; }; }(); function _classCallCheck$3(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn$3(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self; } function _inherits$3(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _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; } /** * @typedef {object} ConnectorDescription * @property {string} displayName - the displayName used by the wrapper * @property {function} refine - a function to filter the local state * @property {function} getSearchParameters - function transforming the local state to a SearchParameters * @property {function} getMetadata - metadata of the widget * @property {function} transitionState - hook after the state has changed * @property {function} getProvidedProps - transform the state into props passed to the wrapped component. * Receives (props, widgetStates, searchState, metadata) and returns the local state. * @property {function} getId - Receives props and return the id that will be used to identify the widget * @property {function} cleanUp - hook when the widget will unmount. Receives (props, searchState) and return a cleaned state. * @property {object} propTypes - PropTypes forwarded to the wrapped component. * @property {object} defaultProps - default values for the props */ /** * Connectors are the HOC used to transform React components * into InstantSearch widgets. * In order to simplify the construction of such connectors * `createConnector` takes a description and transform it into * a connector. * @param {ConnectorDescription} connectorDesc the description of the connector * @return {Connector} a function that wraps a component into * an instantsearch connected one. */ function createConnector(connectorDesc) { if (!connectorDesc.displayName) { throw new Error('`createConnector` requires you to provide a `displayName` property.'); } var hasRefine = has_1(connectorDesc, 'refine'); var hasSearchForFacetValues = has_1(connectorDesc, 'searchForFacetValues'); var hasSearchParameters = has_1(connectorDesc, 'getSearchParameters'); var hasMetadata = has_1(connectorDesc, 'getMetadata'); var hasTransitionState = has_1(connectorDesc, 'transitionState'); var hasCleanUp = has_1(connectorDesc, 'cleanUp'); var hasShouldComponentUpdate = has_1(connectorDesc, 'shouldComponentUpdate'); var isWidget = hasSearchParameters || hasMetadata || hasTransitionState; return function (Composed) { var _class, _temp, _initialiseProps; return _temp = _class = function (_Component) { _inherits$3(Connector, _Component); function Connector(props, context) { _classCallCheck$3(this, Connector); var _this = _possibleConstructorReturn$3(this, (Connector.__proto__ || Object.getPrototypeOf(Connector)).call(this, props, context)); _initialiseProps.call(_this); var _context$ais = context.ais, store = _context$ais.store, widgetsManager = _context$ais.widgetsManager; var canRender = false; _this.state = { props: _this.getProvidedProps(_extends$3({}, props, { canRender: canRender })), canRender: canRender // use to know if a component is rendered (browser), or not (server). }; _this.unsubscribe = store.subscribe(function () { if (_this.state.canRender) { _this.setState({ props: _this.getProvidedProps(_extends$3({}, _this.props, { canRender: _this.state.canRender })) }); } }); if (isWidget) { _this.unregisterWidget = widgetsManager.registerWidget(_this); } return _this; } _createClass$3(Connector, [{ key: 'getMetadata', value: function getMetadata(nextWidgetsState) { if (hasMetadata) { return connectorDesc.getMetadata.call(this, this.props, nextWidgetsState); } return {}; } }, { key: 'getSearchParameters', value: function getSearchParameters(searchParameters) { if (hasSearchParameters) { return connectorDesc.getSearchParameters.call(this, searchParameters, this.props, this.context.ais.store.getState().widgets); } return null; } }, { key: 'transitionState', value: function transitionState(prevWidgetsState, nextWidgetsState) { if (hasTransitionState) { return connectorDesc.transitionState.call(this, this.props, prevWidgetsState, nextWidgetsState); } return nextWidgetsState; } }, { key: 'componentDidMount', value: function componentDidMount() { this.setState({ canRender: true }); } }, { key: 'componentWillMount', value: function componentWillMount() { if (connectorDesc.getSearchParameters) { this.context.ais.onSearchParameters(connectorDesc.getSearchParameters, this.context, this.props); } } }, { key: 'componentWillReceiveProps', value: function componentWillReceiveProps(nextProps) { if (!isEqual_1(this.props, nextProps)) { this.setState({ props: this.getProvidedProps(nextProps) }); if (isWidget) { // Since props might have changed, we need to re-run getSearchParameters // and getMetadata with the new props. this.context.ais.widgetsManager.update(); if (connectorDesc.transitionState) { this.context.ais.onSearchStateChange(connectorDesc.transitionState.call(this, nextProps, this.context.ais.store.getState().widgets, this.context.ais.store.getState().widgets)); } } } } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { this.unsubscribe(); if (isWidget) { this.unregisterWidget(); // will schedule an update if (hasCleanUp) { var newState = connectorDesc.cleanUp.call(this, this.props, this.context.ais.store.getState().widgets); this.context.ais.store.setState(_extends$3({}, this.context.ais.store.getState(), { widgets: newState })); this.context.ais.onSearchStateChange(removeEmptyKey(newState)); } } } }, { key: 'shouldComponentUpdate', value: function shouldComponentUpdate(nextProps, nextState) { if (hasShouldComponentUpdate) { return connectorDesc.shouldComponentUpdate.call(this, this.props, nextProps, this.state, nextState); } var propsEqual = shallowEqual(this.props, nextProps); if (this.state.props === null || nextState.props === null) { if (this.state.props === nextState.props) { return !propsEqual; } return true; } return !propsEqual || !shallowEqual(this.state.props, nextState.props); } }, { key: 'render', value: function render() { if (this.state.props === null) { return null; } var refineProps = hasRefine ? { refine: this.refine, createURL: this.createURL } : {}; var searchForFacetValuesProps = hasSearchForFacetValues ? { searchForItems: this.searchForFacetValues } : {}; return React__default.createElement(Composed, _extends$3({}, this.props, this.state.props, refineProps, searchForFacetValuesProps)); } }]); return Connector; }(React.Component), _class.displayName = connectorDesc.displayName + '(' + getDisplayName(Composed) + ')', _class.defaultClassNames = Composed.defaultClassNames, _class.propTypes = connectorDesc.propTypes, _class.defaultProps = connectorDesc.defaultProps, _class.contextTypes = { // @TODO: more precise state manager propType ais: propTypes.object.isRequired, multiIndexContext: propTypes.object }, _initialiseProps = function _initialiseProps() { var _this2 = this; this.getProvidedProps = function (props) { var store = _this2.context.ais.store; var _store$getState = store.getState(), results = _store$getState.results, searching = _store$getState.searching, error = _store$getState.error, widgets = _store$getState.widgets, metadata = _store$getState.metadata, resultsFacetValues = _store$getState.resultsFacetValues, searchingForFacetValues = _store$getState.searchingForFacetValues, isSearchStalled = _store$getState.isSearchStalled; var searchResults = { results: results, searching: searching, error: error, searchingForFacetValues: searchingForFacetValues, isSearchStalled: isSearchStalled }; return connectorDesc.getProvidedProps.call(_this2, props, widgets, searchResults, metadata, resultsFacetValues); }; this.refine = function () { var _connectorDesc$refine; for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this2.context.ais.onInternalStateUpdate((_connectorDesc$refine = connectorDesc.refine).call.apply(_connectorDesc$refine, [_this2, _this2.props, _this2.context.ais.store.getState().widgets].concat(args))); }; this.searchForFacetValues = function () { for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } _this2.context.ais.onSearchForFacetValues(connectorDesc.searchForFacetValues.apply(connectorDesc, [_this2.props, _this2.context.ais.store.getState().widgets].concat(args))); }; this.createURL = function () { var _connectorDesc$refine2; for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { args[_key3] = arguments[_key3]; } return _this2.context.ais.createHrefForState((_connectorDesc$refine2 = connectorDesc.refine).call.apply(_connectorDesc$refine2, [_this2, _this2.props, _this2.context.ais.store.getState().widgets].concat(args))); }; this.cleanUp = function () { var _connectorDesc$cleanU; for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { args[_key4] = arguments[_key4]; } return (_connectorDesc$cleanU = connectorDesc.cleanUp).call.apply(_connectorDesc$cleanU, [_this2].concat(args)); }; }, _temp; }; } /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE$1 = 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$1) { 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; } var _baseDifference = baseDifference; /** * Creates an array of `array` values not included in the other given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order and references of result values are * determined by the first array. * * **Note:** Unlike `_.pullAll`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @returns {Array} Returns the new array of filtered values. * @see _.without, _.xor * @example * * _.difference([2, 1], [2, 3]); * // => [1] */ var difference = _baseRest(function(array, values) { return isArrayLikeObject_1(array) ? _baseDifference(array, _baseFlatten(values, 1, isArrayLikeObject_1, true)) : []; }); var difference_1 = difference; var _extends$5 = 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; }; function _defineProperty$2(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; } function getIndex(context) { return context && context.multiIndexContext ? context.multiIndexContext.targetedIndex : context.ais.mainTargetedIndex; } function getResults(searchResults, context) { if (searchResults.results && !searchResults.results.hits) { return searchResults.results[getIndex(context)] ? searchResults.results[getIndex(context)] : null; } else { return searchResults.results ? searchResults.results : null; } } function hasMultipleIndex(context) { return context && context.multiIndexContext; } // eslint-disable-next-line max-params function refineValue(searchState, nextRefinement, context, resetPage, namespace) { if (hasMultipleIndex(context)) { return namespace ? refineMultiIndexWithNamespace(searchState, nextRefinement, context, resetPage, namespace) : refineMultiIndex(searchState, nextRefinement, context, resetPage); } else { // When we have a multi index page with shared widgets we should also // reset their page to 1 if the resetPage is provided. Otherwise the // indices will always be reset // see: https://github.com/algolia/react-instantsearch/issues/310 // see: https://github.com/algolia/react-instantsearch/issues/637 if (searchState.indices && resetPage) { Object.keys(searchState.indices).forEach(function (targetedIndex) { searchState = refineValue(searchState, { page: 1 }, { multiIndexContext: { targetedIndex: targetedIndex } }, true, namespace); }); } return namespace ? refineSingleIndexWithNamespace(searchState, nextRefinement, resetPage, namespace) : refineSingleIndex(searchState, nextRefinement, resetPage); } } function refineMultiIndex(searchState, nextRefinement, context, resetPage) { var page = resetPage ? { page: 1 } : undefined; var index = getIndex(context); var state = has_1(searchState, 'indices.' + index) ? _extends$5({}, searchState.indices, _defineProperty$2({}, index, _extends$5({}, searchState.indices[index], nextRefinement, page))) : _extends$5({}, searchState.indices, _defineProperty$2({}, index, _extends$5({}, nextRefinement, page))); return _extends$5({}, searchState, { indices: state }); } function refineSingleIndex(searchState, nextRefinement, resetPage) { var page = resetPage ? { page: 1 } : undefined; return _extends$5({}, searchState, nextRefinement, page); } // eslint-disable-next-line max-params function refineMultiIndexWithNamespace(searchState, nextRefinement, context, resetPage, namespace) { var _extends4; var index = getIndex(context); var page = resetPage ? { page: 1 } : undefined; var state = has_1(searchState, 'indices.' + index) ? _extends$5({}, searchState.indices, _defineProperty$2({}, index, _extends$5({}, searchState.indices[index], (_extends4 = {}, _defineProperty$2(_extends4, namespace, _extends$5({}, searchState.indices[index][namespace], nextRefinement)), _defineProperty$2(_extends4, 'page', 1), _extends4)))) : _extends$5({}, searchState.indices, _defineProperty$2({}, index, _extends$5(_defineProperty$2({}, namespace, nextRefinement), page))); return _extends$5({}, searchState, { indices: state }); } function refineSingleIndexWithNamespace(searchState, nextRefinement, resetPage, namespace) { var page = resetPage ? { page: 1 } : undefined; return _extends$5({}, searchState, _defineProperty$2({}, namespace, _extends$5({}, searchState[namespace], nextRefinement)), page); } function getNamespaceAndAttributeName(id) { var parts = id.match(/^([^.]*)\.(.*)/); var namespace = parts && parts[1]; var attributeName = parts && parts[2]; return { namespace: namespace, attributeName: attributeName }; } // eslint-disable-next-line max-params function getCurrentRefinementValue(props, searchState, context, id, defaultValue) { var refinementsCallback = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : function (x) { return x; }; var index = getIndex(context); var _getNamespaceAndAttri = getNamespaceAndAttributeName(id), namespace = _getNamespaceAndAttri.namespace, attributeName = _getNamespaceAndAttri.attributeName; var refinements = hasMultipleIndex(context) && searchState.indices && namespace && searchState.indices['' + index] && has_1(searchState.indices['' + index][namespace], '' + attributeName) || hasMultipleIndex(context) && searchState.indices && has_1(searchState, 'indices.' + index + '.' + id) || !hasMultipleIndex(context) && namespace && has_1(searchState[namespace], attributeName) || !hasMultipleIndex(context) && has_1(searchState, id); if (refinements) { var currentRefinement = void 0; if (hasMultipleIndex(context)) { currentRefinement = namespace ? get_1(searchState.indices['' + index][namespace], attributeName) : get_1(searchState.indices[index], id); } else { currentRefinement = namespace ? get_1(searchState[namespace], attributeName) : get_1(searchState, id); } return refinementsCallback(currentRefinement); } if (props.defaultRefinement) { return props.defaultRefinement; } return defaultValue; } function cleanUpValue(searchState, context, id) { var indexName = getIndex(context); var _getNamespaceAndAttri2 = getNamespaceAndAttributeName(id), namespace = _getNamespaceAndAttri2.namespace, attributeName = _getNamespaceAndAttri2.attributeName; if (hasMultipleIndex(context) && Boolean(searchState.indices)) { return cleanUpValueWithMutliIndex({ attribute: attributeName, searchState: searchState, indexName: indexName, id: id, namespace: namespace }); } return cleanUpValueWithSingleIndex({ attribute: attributeName, searchState: searchState, id: id, namespace: namespace }); } function cleanUpValueWithSingleIndex(_ref) { var searchState = _ref.searchState, id = _ref.id, namespace = _ref.namespace, attribute = _ref.attribute; if (namespace) { return _extends$5({}, searchState, _defineProperty$2({}, namespace, omit_1(searchState[namespace], attribute))); } return omit_1(searchState, id); } function cleanUpValueWithMutliIndex(_ref2) { var searchState = _ref2.searchState, indexName = _ref2.indexName, id = _ref2.id, namespace = _ref2.namespace, attribute = _ref2.attribute; var index = searchState.indices[indexName]; if (namespace && index) { return _extends$5({}, searchState, { indices: _extends$5({}, searchState.indices, _defineProperty$2({}, indexName, _extends$5({}, index, _defineProperty$2({}, namespace, omit_1(index[namespace], attribute))))) }); } return omit_1(searchState, 'indices.' + indexName + '.' + id); } var _extends$6 = 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; }; function _defineProperty$3(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; } function getId() { return 'configure'; } var connectConfigure = createConnector({ displayName: 'AlgoliaConfigure', getProvidedProps: function getProvidedProps() { return {}; }, getSearchParameters: function getSearchParameters(searchParameters, props) { var items = omit_1(props, 'children'); return searchParameters.setQueryParameters(items); }, transitionState: function transitionState(props, prevSearchState, nextSearchState) { var id = getId(); var items = omit_1(props, 'children'); var nonPresentKeys = this._props ? difference_1(keys_1(this._props), keys_1(props)) : []; this._props = props; var nextValue = _defineProperty$3({}, id, _extends$6({}, omit_1(nextSearchState[id], nonPresentKeys), items)); return refineValue(nextSearchState, nextValue, this.context); }, cleanUp: function cleanUp(props, searchState) { var id = getId(); var index = getIndex(this.context); var subState = hasMultipleIndex(this.context) && searchState.indices ? searchState.indices[index] : searchState; var configureKeys = subState && subState[id] ? Object.keys(subState[id]) : []; var configureState = configureKeys.reduce(function (acc, item) { if (!props[item]) { acc[item] = subState[id][item]; } return acc; }, {}); var nextValue = _defineProperty$3({}, id, configureState); return refineValue(searchState, nextValue, this.context); } }); /** * Configure is a widget that lets you provide raw search parameters * to the Algolia API. * * Any of the props added to this widget will be forwarded to Algolia. For more information * on the different parameters that can be set, have a look at the * [reference](https://www.algolia.com/doc/api-client/javascript/search#search-parameters). * * This widget can be used either with react-dom and react-native. It will not render anything * on screen, only configure some parameters. * * Read more in the [Search parameters](guide/Search_parameters.html) guide. * @name Configure * @kind widget * @example * import React from 'react'; * import { InstantSearch, Configure, Hits } from 'react-instantsearch-dom'; * * const App = () => ( * <InstantSearch * appId="latency" * apiKey="6be0576ff61c053d5f9a3225e2a90f76" * indexName="ikea" * > * <Configure hitsPerPage={5} /> * <Hits /> * </InstantSearch> * ); */ connectConfigure(function () { return null; }); function _defineProperty$4(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; } 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); } } var getId$1 = function getId() { return 'query'; }; function getCurrentRefinement(props, searchState, context) { var id = getId$1(); return getCurrentRefinementValue(props, searchState, context, id, '', function (currentRefinement) { if (currentRefinement) { return currentRefinement; } return ''; }); } function getHits(searchResults) { if (searchResults.results) { if (searchResults.results.hits && Array.isArray(searchResults.results.hits)) { return searchResults.results.hits; } else { return Object.keys(searchResults.results).reduce(function (hits, index) { return [].concat(_toConsumableArray(hits), [{ index: index, hits: searchResults.results[index].hits }]); }, []); } } else { return []; } } function _refine(props, searchState, nextRefinement, context) { var id = getId$1(); var nextValue = _defineProperty$4({}, id, nextRefinement); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage); } function _cleanUp(props, searchState, context) { return cleanUpValue(searchState, context, getId$1()); } /** * connectAutoComplete connector provides the logic to create connected * components that will render the results retrieved from * Algolia. * * To configure the number of hits retrieved, use [HitsPerPage widget](widgets/HitsPerPage.html), * [connectHitsPerPage connector](connectors/connectHitsPerPage.html) or pass the hitsPerPage * prop to a [Configure](guide/Search_parameters.html) widget. * @name connectAutoComplete * @kind connector * @propType {string} [defaultRefinement] - Provide a default value for the query * @providedPropType {array.<object>} hits - the records that matched the search state * @providedPropType {function} refine - a function to change the query * @providedPropType {string} currentRefinement - the query to search for */ var connectAutoComplete = createConnector({ displayName: 'AlgoliaAutoComplete', getProvidedProps: function getProvidedProps(props, searchState, searchResults) { return { hits: getHits(searchResults), currentRefinement: getCurrentRefinement(props, searchState, this.context) }; }, refine: function refine(props, searchState, nextRefinement) { return _refine(props, searchState, nextRefinement, this.context); }, cleanUp: function cleanUp(props, searchState) { return _cleanUp(props, searchState, this.context); }, /* connectAutoComplete needs to be considered as a widget to trigger a search if no others widgets are used. * To be considered as a widget you need either getSearchParameters, getMetadata or getTransitionState * See createConnector.js * */ getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { return searchParameters.setQuery(getCurrentRefinement(props, searchState, this.context)); } }); function _defineProperty$5(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 getId$2 = function getId(props) { return props.attributes[0]; }; var namespace = 'hierarchicalMenu'; function _refine$1(props, searchState, nextRefinement, context) { var id = getId$2(props); var nextValue = _defineProperty$5({}, id, nextRefinement || ''); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage, namespace); } function transformValue(values) { return values.reduce(function (acc, item) { if (item.isRefined) { acc.push({ label: item.name, // If dealing with a nested "items", "value" is equal to the previous value concatenated with the current label // If dealing with the first level, "value" is equal to the current label value: item.path }); // Create a variable in order to keep the same acc for the recursion, otherwise "reduce" returns a new one if (item.data) { acc = acc.concat(transformValue(item.data, acc)); } } return acc; }, []); } /** * The breadcrumb component is s a type of secondary navigation scheme that * reveals the user’s location in a website or web application. * * @name connectBreadcrumb * @requirements To use this widget, your attributes must be formatted in a specific way. * If you want for example to have a Breadcrumb of categories, objects in your index * should be formatted this way: * * ```json * { * "categories.lvl0": "products", * "categories.lvl1": "products > fruits", * "categories.lvl2": "products > fruits > citrus" * } * ``` * * It's also possible to provide more than one path for each level: * * ```json * { * "categories.lvl0": ["products", "goods"], * "categories.lvl1": ["products > fruits", "goods > to eat"] * } * ``` * * All attributes passed to the `attributes` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * * @kind connector * @propType {array.<string>} attributes - List of attributes to use to generate the hierarchy of the menu. See the example for the convention to follow. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @providedPropType {function} refine - a function to toggle a refinement * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {array.<{items: object, count: number, isRefined: boolean, label: string, value: string}>} items - the list of items the Breadcrumb can display. */ var connectBreadcrumb = createConnector({ displayName: 'AlgoliaBreadcrumb', propTypes: { attributes: function attributes(props, propName, componentName) { var isNotString = function isNotString(val) { return typeof val !== 'string'; }; if (!Array.isArray(props[propName]) || props[propName].some(isNotString) || props[propName].length < 1) { return new Error('Invalid prop ' + propName + ' supplied to ' + componentName + '. Expected an Array of Strings'); } return undefined; }, transformItems: propTypes.func }, getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var id = getId$2(props); var results = getResults(searchResults, this.context); var isFacetPresent = Boolean(results) && Boolean(results.getFacetByName(id)); if (!isFacetPresent) { return { items: [], canRefine: false }; } var values = results.getFacetValues(id); var items = values.data ? transformValue(values.data) : []; var transformedItems = props.transformItems ? props.transformItems(items) : items; return { canRefine: transformedItems.length > 0, items: transformedItems }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$1(props, searchState, nextRefinement, this.context); } }); var _extends$7 = 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; }; /** * connectCurrentRefinements connector provides the logic to build a widget that will * give the user the ability to remove all or some of the filters that were * set. * @name connectCurrentRefinements * @kind connector * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @propType {function} [clearsQuery=false] - Pass true to also clear the search query * @providedPropType {function} refine - a function to remove a single filter * @providedPropType {array.<{label: string, attribute: string, currentRefinement: string || object, items: array, value: function}>} items - all the filters, the `value` is to pass to the `refine` function for removing all currentrefinements, `label` is for the display. When existing several refinements for the same atribute name, then you get a nested `items` object that contains a `label` and a `value` function to use to remove a single filter. `attribute` and `currentRefinement` are metadata containing row values. * @providedPropType {string} query - the search query */ var connectCurrentRefinements = createConnector({ displayName: 'AlgoliaCurrentRefinements', propTypes: { transformItems: propTypes.func }, getProvidedProps: function getProvidedProps(props, searchState, searchResults, metadata) { var items = metadata.reduce(function (res, meta) { if (typeof meta.items !== 'undefined') { if (!props.clearsQuery && meta.id === 'query') { return res; } else { if (props.clearsQuery && meta.id === 'query' && meta.items[0].currentRefinement === '') { return res; } return res.concat(meta.items.map(function (item) { return _extends$7({}, item, { id: meta.id, index: meta.index }); })); } } return res; }, []); return { items: props.transformItems ? props.transformItems(items) : items, canRefine: items.length > 0 }; }, refine: function refine(props, searchState, items) { // `value` corresponds to our internal clear function computed in each connector metadata. var refinementsToClear = items instanceof Array ? items.map(function (item) { return item.value; }) : [items]; return refinementsToClear.reduce(function (res, clear) { return clear(res); }, searchState); } }); function _defineProperty$6(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; } 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; } /** * The GeoSearch connector provides the logic to build a widget that will display the results on a map. * It also provides a way to search for results based on their position. The connector provides function to manage the search experience (search on map interaction). * @name connectGeoSearch * @kind connector * @requirements Note that the GeoSearch connector uses the [geosearch](https://www.algolia.com/doc/guides/searching/geo-search) capabilities of Algolia. * Your hits **must** have a `_geoloc` attribute in order to be passed to the rendering function. Currently, the feature is not compatible with multiple values in the `_geoloc` attribute * (e.g. a restaurant with multiple locations). In that case you can duplicate your records and use the [distinct](https://www.algolia.com/doc/guides/ranking/distinct) feature of Algolia to only retrieve unique results. * @propType {{ northEast: { lat: number, lng: number }, southWest: { lat: number, lng: number } }} [defaultRefinement] - Default search state of the widget containing the bounds for the map * @providedPropType {function({ northEast: { lat: number, lng: number }, southWest: { lat: number, lng: number } })} refine - a function to toggle the refinement * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {array.<object>} hits - the records that matched the search * @providedPropType {boolean} isRefinedWithMap - true if the current refinement is set with the map bounds * @providedPropType {{ northEast: { lat: number, lng: number }, southWest: { lat: number, lng: number } }} [currentRefinement] - the refinement currently applied * @providedPropType {{ lat: number, lng: number }} [position] - the position of the search */ // To control the map with an external widget the other widget // **must** write the value in the attribute `aroundLatLng` var getBoundingBoxId = function getBoundingBoxId() { return 'boundingBox'; }; var getAroundLatLngId = function getAroundLatLngId() { return 'aroundLatLng'; }; var getConfigureAroundLatLngId = function getConfigureAroundLatLngId() { return 'configure.aroundLatLng'; }; var currentRefinementToString = function currentRefinementToString(currentRefinement) { return [currentRefinement.northEast.lat, currentRefinement.northEast.lng, currentRefinement.southWest.lat, currentRefinement.southWest.lng].join(); }; var stringToCurrentRefinement = function stringToCurrentRefinement(value) { var values = value.split(','); return { northEast: { lat: parseFloat(values[0]), lng: parseFloat(values[1]) }, southWest: { lat: parseFloat(values[2]), lng: parseFloat(values[3]) } }; }; var latLngRegExp = /^(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)$/; var stringToPosition = function stringToPosition(value) { var pattern = value.match(latLngRegExp); return { lat: parseFloat(pattern[1]), lng: parseFloat(pattern[2]) }; }; var getCurrentRefinement$1 = function getCurrentRefinement(props, searchState, context) { var refinement = getCurrentRefinementValue(props, searchState, context, getBoundingBoxId(), {}); if (isEmpty_1(refinement)) { return; } // eslint-disable-next-line consistent-return return { northEast: { lat: parseFloat(refinement.northEast.lat), lng: parseFloat(refinement.northEast.lng) }, southWest: { lat: parseFloat(refinement.southWest.lat), lng: parseFloat(refinement.southWest.lng) } }; }; var getCurrentPosition = function getCurrentPosition(props, searchState, context) { var defaultRefinement = props.defaultRefinement, propsWithoutDefaultRefinement = _objectWithoutProperties(props, ['defaultRefinement']); var aroundLatLng = getCurrentRefinementValue(propsWithoutDefaultRefinement, searchState, context, getAroundLatLngId()); if (!aroundLatLng) { // Fallback on `configure.aroundLatLng` var configureAroundLatLng = getCurrentRefinementValue(propsWithoutDefaultRefinement, searchState, context, getConfigureAroundLatLngId()); return configureAroundLatLng && stringToPosition(configureAroundLatLng); } return aroundLatLng; }; var _refine$2 = function _refine(searchState, nextValue, context) { var resetPage = true; var nextRefinement = _defineProperty$6({}, getBoundingBoxId(), nextValue); return refineValue(searchState, nextRefinement, context, resetPage); }; var connectGeoSearch = createConnector({ displayName: 'AlgoliaGeoSearch', getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var results = getResults(searchResults, this.context); // We read it from both because the SearchParameters & the searchState are not always // in sync. When we set the refinement the searchState is used but when we clear the refinement // the SearchParameters is used. In the first case when we render, the results are not there // so we can't find the value from the results. The most up to date value is the searchState. // But when we clear the refinement the searchState is immediatly cleared even when the items // retrieved are still the one from the previous query with the bounding box. It leads to some // issue with the position of the map. We should rely on 1 source of truth or at least always // be sync. var currentRefinementFromSearchState = getCurrentRefinement$1(props, searchState, this.context); var currentRefinementFromSearchParameters = results && results._state.insideBoundingBox && stringToCurrentRefinement(results._state.insideBoundingBox) || undefined; var currentPositionFromSearchState = getCurrentPosition(props, searchState, this.context); var currentPositionFromSearchParameters = results && results._state.aroundLatLng && stringToPosition(results._state.aroundLatLng) || undefined; var currentRefinement = currentRefinementFromSearchState || currentRefinementFromSearchParameters; var position = currentPositionFromSearchState || currentPositionFromSearchParameters; return { hits: !results ? [] : results.hits.filter(function (_) { return Boolean(_._geoloc); }), isRefinedWithMap: Boolean(currentRefinement), currentRefinement: currentRefinement, position: position }; }, refine: function refine(props, searchState, nextValue) { return _refine$2(searchState, nextValue, this.context); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var currentRefinement = getCurrentRefinement$1(props, searchState, this.context); if (!currentRefinement) { return searchParameters; } return searchParameters.setQueryParameter('insideBoundingBox', currentRefinementToString(currentRefinement)); }, cleanUp: function cleanUp(props, searchState) { return cleanUpValue(searchState, this.context, getBoundingBoxId()); }, getMetadata: function getMetadata(props, searchState) { var _this = this; var items = []; var id = getBoundingBoxId(); var index = getIndex(this.context); var nextRefinement = {}; var currentRefinement = getCurrentRefinement$1(props, searchState, this.context); if (currentRefinement) { items.push({ label: id + ': ' + currentRefinementToString(currentRefinement), value: function value(nextState) { return _refine$2(nextState, nextRefinement, _this.context); }, currentRefinement: currentRefinement }); } return { id: id, index: index, items: items }; }, shouldComponentUpdate: function shouldComponentUpdate() { return true; } }); var _extends$8 = 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; }; function _defineProperty$7(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 getId$3 = function getId(props) { return props.attributes[0]; }; var namespace$1 = 'hierarchicalMenu'; function getCurrentRefinement$2(props, searchState, context) { return getCurrentRefinementValue(props, searchState, context, namespace$1 + '.' + getId$3(props), null, function (currentRefinement) { if (currentRefinement === '') { return null; } return currentRefinement; }); } function getValue$1(path, props, searchState, context) { var id = props.id, attributes = props.attributes, separator = props.separator, rootPath = props.rootPath, showParentLevel = props.showParentLevel; var currentRefinement = getCurrentRefinement$2(props, searchState, context); var nextRefinement = void 0; if (currentRefinement === null) { nextRefinement = path; } else { var tmpSearchParameters = new algoliasearchHelper_4({ hierarchicalFacets: [{ name: id, attributes: attributes, separator: separator, rootPath: rootPath, showParentLevel: showParentLevel }] }); nextRefinement = tmpSearchParameters.toggleHierarchicalFacetRefinement(id, currentRefinement).toggleHierarchicalFacetRefinement(id, path).getHierarchicalRefinement(id)[0]; } return nextRefinement; } function transformValue$1(value, props, searchState, context) { return value.map(function (v) { return { label: v.name, value: getValue$1(v.path, props, searchState, context), count: v.count, isRefined: v.isRefined, items: v.data && transformValue$1(v.data, props, searchState, context) }; }); } var truncate = function truncate() { var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10; return items.slice(0, limit).map(function () { var item = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return Array.isArray(item.items) ? _extends$8({}, item, { items: truncate(item.items, limit) }) : item; }); }; function _refine$3(props, searchState, nextRefinement, context) { var id = getId$3(props); var nextValue = _defineProperty$7({}, id, nextRefinement || ''); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage, namespace$1); } function _cleanUp$1(props, searchState, context) { return cleanUpValue(searchState, context, namespace$1 + '.' + getId$3(props)); } var sortBy = ['name:asc']; /** * connectHierarchicalMenu connector provides the logic to build a widget that will * give the user the ability to explore a tree-like structure. * This is commonly used for multi-level categorization of products on e-commerce * websites. From a UX point of view, we suggest not displaying more than two levels deep. * @name connectHierarchicalMenu * @requirements To use this widget, your attributes must be formatted in a specific way. * If you want for example to have a hiearchical menu of categories, objects in your index * should be formatted this way: * * ```json * { * "categories.lvl0": "products", * "categories.lvl1": "products > fruits", * "categories.lvl2": "products > fruits > citrus" * } * ``` * * It's also possible to provide more than one path for each level: * * ```json * { * "categories.lvl0": ["products", "goods"], * "categories.lvl1": ["products > fruits", "goods > to eat"] * } * ``` * * All attributes passed to the `attributes` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * * @kind connector * @propType {array.<string>} attributes - List of attributes to use to generate the hierarchy of the menu. See the example for the convention to follow. * @propType {string} [defaultRefinement] - the item value selected by default * @propType {boolean} [showMore=false] - Flag to activate the show more button, for toggling the number of items between limit and showMoreLimit. * @propType {number} [limit=10] - The maximum number of items displayed. * @propType {number} [showMoreLimit=20] - The maximum number of items displayed when the user triggers the show more. Not considered if `showMore` is false. * @propType {string} [separator='>'] - Specifies the level separator used in the data. * @propType {string[]} [rootPath=null] - The already selected and hidden path. * @propType {boolean} [showParentLevel=true] - Flag to set if the parent level should be displayed. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @providedPropType {function} refine - a function to toggle a refinement * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string} currentRefinement - the refinement currently applied * @providedPropType {array.<{items: object, count: number, isRefined: boolean, label: string, value: string}>} items - the list of items the HierarchicalMenu can display. items has the same shape as parent items. */ var connectHierarchicalMenu = createConnector({ displayName: 'AlgoliaHierarchicalMenu', propTypes: { attributes: function attributes(props, propName, componentName) { var isNotString = function isNotString(val) { return typeof val !== 'string'; }; if (!Array.isArray(props[propName]) || props[propName].some(isNotString) || props[propName].length < 1) { return new Error('Invalid prop ' + propName + ' supplied to ' + componentName + '. Expected an Array of Strings'); } return undefined; }, separator: propTypes.string, rootPath: propTypes.string, showParentLevel: propTypes.bool, defaultRefinement: propTypes.string, showMore: propTypes.bool, limit: propTypes.number, showMoreLimit: propTypes.number, transformItems: propTypes.func }, defaultProps: { showMore: false, limit: 10, showMoreLimit: 20, separator: ' > ', rootPath: null, showParentLevel: true }, getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var showMore = props.showMore, limit = props.limit, showMoreLimit = props.showMoreLimit; var id = getId$3(props); var results = getResults(searchResults, this.context); var isFacetPresent = Boolean(results) && Boolean(results.getFacetByName(id)); if (!isFacetPresent) { return { items: [], currentRefinement: getCurrentRefinement$2(props, searchState, this.context), canRefine: false }; } var itemsLimit = showMore ? showMoreLimit : limit; var value = results.getFacetValues(id, { sortBy: sortBy }); var items = value.data ? transformValue$1(value.data, props, searchState, this.context) : []; var transformedItems = props.transformItems ? props.transformItems(items) : items; return { items: truncate(transformedItems, itemsLimit), currentRefinement: getCurrentRefinement$2(props, searchState, this.context), canRefine: items.length > 0 }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$3(props, searchState, nextRefinement, this.context); }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$1(props, searchState, this.context); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var attributes = props.attributes, separator = props.separator, rootPath = props.rootPath, showParentLevel = props.showParentLevel, showMore = props.showMore, limit = props.limit, showMoreLimit = props.showMoreLimit; var id = getId$3(props); var itemsLimit = showMore ? showMoreLimit : limit; searchParameters = searchParameters.addHierarchicalFacet({ name: id, attributes: attributes, separator: separator, rootPath: rootPath, showParentLevel: showParentLevel }).setQueryParameters({ maxValuesPerFacet: Math.max(searchParameters.maxValuesPerFacet || 0, itemsLimit) }); var currentRefinement = getCurrentRefinement$2(props, searchState, this.context); if (currentRefinement !== null) { searchParameters = searchParameters.toggleHierarchicalFacetRefinement(id, currentRefinement); } return searchParameters; }, getMetadata: function getMetadata(props, searchState) { var _this = this; var rootAttribute = props.attributes[0]; var id = getId$3(props); var currentRefinement = getCurrentRefinement$2(props, searchState, this.context); return { id: id, index: getIndex(this.context), items: !currentRefinement ? [] : [{ label: rootAttribute + ': ' + currentRefinement, attribute: rootAttribute, value: function value(nextState) { return _refine$3(props, nextState, '', _this.context); }, currentRefinement: currentRefinement }] }; } }); var highlight = function highlight(_ref) { var attribute = _ref.attribute, hit = _ref.hit, highlightProperty = _ref.highlightProperty, _ref$preTag = _ref.preTag, preTag = _ref$preTag === undefined ? HIGHLIGHT_TAGS.highlightPreTag : _ref$preTag, _ref$postTag = _ref.postTag, postTag = _ref$postTag === undefined ? HIGHLIGHT_TAGS.highlightPostTag : _ref$postTag; return parseAlgoliaHit({ attribute: attribute, highlightProperty: highlightProperty, hit: hit, preTag: preTag, postTag: postTag }); }; /** * connectHighlight connector provides the logic to create an highlighter * component that will retrieve, parse and render an highlighted attribute * from an Algolia hit. * @name connectHighlight * @kind connector * @category connector * @providedPropType {function} highlight - function to retrieve and parse an attribute from a hit. It takes a configuration object with 3 attributes: `highlightProperty` which is the property that contains the highlight structure from the records, `attribute` which is the name of the attribute (it can be either a string or an array of strings) to look for and `hit` which is the hit from Algolia. It returns an array of objects `{value: string, isHighlighted: boolean}`. If the element that corresponds to the attribute is an array of strings, it will return a nested array of objects. * @example * import React from 'react'; * import { InstantSearch, SearchBox, Hits, connectHighlight } from 'react-instantsearch-dom'; * * const CustomHighlight = connectHighlight( * ({ highlight, attribute, hit, highlightProperty }) => { * const highlights = highlight({ * highlightProperty: '_highlightResult', * attribute, * hit * }); * * return highlights.map(part => part.isHighlighted ? ( * <mark>{part.value}</mark> * ) : ( * <span>{part.value}</span> * )); * } * ); * * const Hit = ({ hit }) => ( * <p> * <CustomHighlight attribute="name" hit={hit} /> * </p> * ); * * const App = () => ( * <InstantSearch * appId="latency" * apiKey="6be0576ff61c053d5f9a3225e2a90f76" * indexName="ikea" * > * <SearchBox defaultRefinement="legi" /> * <Hits hitComponent={Hit} /> * </InstantSearch> * ); */ var connectHighlight = createConnector({ displayName: 'AlgoliaHighlighter', propTypes: {}, getProvidedProps: function getProvidedProps() { return { highlight: highlight }; } }); /** * connectHits connector provides the logic to create connected * components that will render the results retrieved from * Algolia. * * To configure the number of hits retrieved, use [HitsPerPage widget](widgets/HitsPerPage.html), * [connectHitsPerPage connector](connectors/connectHitsPerPage.html) or pass the hitsPerPage * prop to a [Configure](guide/Search_parameters.html) widget. * * **Warning:** you will need to use the **objectID** property available on every hit as a key * when iterating over them. This will ensure you have the best possible UI experience * especially on slow networks. * @name connectHits * @kind connector * @providedPropType {array.<object>} hits - the records that matched the search state * @example * import React from 'react'; * import { InstantSearch, Highlight, connectHits } from 'react-instantsearch-dom'; * * const CustomHits = connectHits(({ hits }) => ( * <div> * {hits.map(hit => * <p key={hit.objectID}> * <Highlight attribute="name" hit={hit} /> * </p> * )} * </div> * ); * * const App = () => ( * <InstantSearch * appId="latency" * apiKey="6be0576ff61c053d5f9a3225e2a90f76" * indexName="ikea" * > * <CustomHits /> * </InstantSearch> * ); */ var connectHits = createConnector({ displayName: 'AlgoliaHits', getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var results = getResults(searchResults, this.context); var hits = results ? results.hits : []; return { hits: hits }; }, /* Hits needs to be considered as a widget to trigger a search if no others widgets are used. * To be considered as a widget you need either getSearchParameters, getMetadata or getTransitionState * See createConnector.js * */ getSearchParameters: function getSearchParameters(searchParameters) { return searchParameters; } }); var _extends$9 = 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; }; function _defineProperty$8(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; } function getId$4() { return 'hitsPerPage'; } function getCurrentRefinement$3(props, searchState, context) { var id = getId$4(); return getCurrentRefinementValue(props, searchState, context, id, null, function (currentRefinement) { if (typeof currentRefinement === 'string') { return parseInt(currentRefinement, 10); } return currentRefinement; }); } /** * connectHitsPerPage connector provides the logic to create connected * components that will allow a user to choose to display more or less results from Algolia. * @name connectHitsPerPage * @kind connector * @propType {number} defaultRefinement - The number of items selected by default * @propType {{value: number, label: string}[]} items - List of hits per page options. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @providedPropType {function} refine - a function to remove a single filter * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string} currentRefinement - the refinement currently applied * @providedPropType {array.<{isRefined: boolean, label?: string, value: number}>} items - the list of items the HitsPerPage can display. If no label provided, the value will be displayed. */ var connectHitsPerPage = createConnector({ displayName: 'AlgoliaHitsPerPage', propTypes: { defaultRefinement: propTypes.number.isRequired, items: propTypes.arrayOf(propTypes.shape({ label: propTypes.string, value: propTypes.number.isRequired })).isRequired, transformItems: propTypes.func }, getProvidedProps: function getProvidedProps(props, searchState) { var currentRefinement = getCurrentRefinement$3(props, searchState, this.context); var items = props.items.map(function (item) { return item.value === currentRefinement ? _extends$9({}, item, { isRefined: true }) : _extends$9({}, item, { isRefined: false }); }); return { items: props.transformItems ? props.transformItems(items) : items, currentRefinement: currentRefinement }; }, refine: function refine(props, searchState, nextRefinement) { var id = getId$4(); var nextValue = _defineProperty$8({}, id, nextRefinement); var resetPage = true; return refineValue(searchState, nextValue, this.context, resetPage); }, cleanUp: function cleanUp(props, searchState) { return cleanUpValue(searchState, this.context, getId$4()); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { return searchParameters.setHitsPerPage(getCurrentRefinement$3(props, searchState, this.context)); }, getMetadata: function getMetadata() { return { id: getId$4() }; } }); function _defineProperty$9(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; } function _toConsumableArray$1(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); } } function getId$5() { return 'page'; } function getCurrentRefinement$4(props, searchState, context) { var id = getId$5(); var page = 1; return getCurrentRefinementValue(props, searchState, context, id, page, function (currentRefinement) { if (typeof currentRefinement === 'string') { currentRefinement = parseInt(currentRefinement, 10); } return currentRefinement; }); } /** * InfiniteHits connector provides the logic to create connected * components that will render an continuous list of results retrieved from * Algolia. This connector provides a function to load more results. * @name connectInfiniteHits * @kind connector * @providedPropType {array.<object>} hits - the records that matched the search state * @providedPropType {boolean} hasMore - indicates if there are more pages to load * @providedPropType {function} refine - call to load more results */ var connectInfiniteHits = createConnector({ displayName: 'AlgoliaInfiniteHits', getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var results = getResults(searchResults, this.context); this._allResults = this._allResults || []; this._previousPage = this._previousPage || 0; if (!results) { return { hits: [], hasMore: false }; } var hits = results.hits, page = results.page, nbPages = results.nbPages; if (page === 0) { this._allResults = hits; } else if (page > this._previousPage) { this._allResults = [].concat(_toConsumableArray$1(this._allResults), _toConsumableArray$1(hits)); } else if (page < this._previousPage) { this._allResults = hits; } var lastPageIndex = nbPages - 1; var hasMore = page < lastPageIndex; this._previousPage = page; return { hits: this._allResults, hasMore: hasMore }; }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { return searchParameters.setQueryParameters({ page: getCurrentRefinement$4(props, searchState, this.context) - 1 }); }, refine: function refine(props, searchState) { var id = getId$5(); var nextPage = getCurrentRefinement$4(props, searchState, this.context) + 1; var nextValue = _defineProperty$9({}, id, nextPage); var resetPage = false; return refineValue(searchState, nextValue, this.context, resetPage); } }); function _defineProperty$a(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 namespace$2 = 'menu'; function getId$6(props) { return props.attribute; } function getCurrentRefinement$5(props, searchState, context) { return getCurrentRefinementValue(props, searchState, context, namespace$2 + '.' + getId$6(props), null, function (currentRefinement) { if (currentRefinement === '') { return null; } return currentRefinement; }); } function getValue$2(name, props, searchState, context) { var currentRefinement = getCurrentRefinement$5(props, searchState, context); return name === currentRefinement ? '' : name; } function getLimit(_ref) { var showMore = _ref.showMore, limit = _ref.limit, showMoreLimit = _ref.showMoreLimit; return showMore ? showMoreLimit : limit; } function _refine$4(props, searchState, nextRefinement, context) { var id = getId$6(props); var nextValue = _defineProperty$a({}, id, nextRefinement ? nextRefinement : ''); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage, namespace$2); } function _cleanUp$2(props, searchState, context) { return cleanUpValue(searchState, context, namespace$2 + '.' + getId$6(props)); } var sortBy$1 = ['count:desc', 'name:asc']; /** * connectMenu connector provides the logic to build a widget that will * give the user the ability to choose a single value for a specific facet. * @name connectMenu * @requirements The attribute passed to the `attribute` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * @kind connector * @propType {string} attribute - the name of the attribute in the record * @propType {boolean} [showMore=false] - true if the component should display a button that will expand the number of items * @propType {number} [limit=10] - the minimum number of diplayed items * @propType {number} [showMoreLimit=20] - the maximun number of displayed items. Only used when showMore is set to `true` * @propType {string} [defaultRefinement] - the value of the item selected by default * @propType {boolean} [searchable=false] - allow search inside values * @providedPropType {function} refine - a function to toggle a refinement * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string} currentRefinement - the refinement currently applied * @providedPropType {array.<{count: number, isRefined: boolean, label: string, value: string}>} items - the list of items the Menu can display. * @providedPropType {function} searchForItems - a function to toggle a search inside items values * @providedPropType {boolean} isFromSearch - a boolean that says if the `items` props contains facet values from the global search or from the search inside items. */ var connectMenu = createConnector({ displayName: 'AlgoliaMenu', propTypes: { attribute: propTypes.string.isRequired, showMore: propTypes.bool, limit: propTypes.number, showMoreLimit: propTypes.number, defaultRefinement: propTypes.string, transformItems: propTypes.func, searchable: propTypes.bool }, defaultProps: { showMore: false, limit: 10, showMoreLimit: 20 }, getProvidedProps: function getProvidedProps(props, searchState, searchResults, meta, searchForFacetValuesResults) { var _this = this; var attribute = props.attribute, searchable = props.searchable; var results = getResults(searchResults, this.context); var canRefine = Boolean(results) && Boolean(results.getFacetByName(attribute)); var isFromSearch = Boolean(searchForFacetValuesResults && searchForFacetValuesResults[attribute] && searchForFacetValuesResults.query !== ''); // Search For Facet Values is not available with derived helper (used for multi index search) if (searchable && this.context.multiIndexContext) { throw new Error('react-instantsearch: searching in *List is not available when used inside a' + ' multi index context'); } if (!canRefine) { return { items: [], currentRefinement: getCurrentRefinement$5(props, searchState, this.context), isFromSearch: isFromSearch, searchable: searchable, canRefine: canRefine }; } var items = isFromSearch ? searchForFacetValuesResults[attribute].map(function (v) { return { label: v.value, value: getValue$2(v.value, props, searchState, _this.context), _highlightResult: { label: { value: v.highlighted } }, count: v.count, isRefined: v.isRefined }; }) : results.getFacetValues(attribute, { sortBy: sortBy$1 }).map(function (v) { return { label: v.name, value: getValue$2(v.name, props, searchState, _this.context), count: v.count, isRefined: v.isRefined }; }); var sortedItems = searchable && !isFromSearch ? orderBy_1(items, ['isRefined', 'count', 'label'], ['desc', 'desc', 'asc']) : items; var transformedItems = props.transformItems ? props.transformItems(sortedItems) : sortedItems; return { items: transformedItems.slice(0, getLimit(props)), currentRefinement: getCurrentRefinement$5(props, searchState, this.context), isFromSearch: isFromSearch, searchable: searchable, canRefine: items.length > 0 }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$4(props, searchState, nextRefinement, this.context); }, searchForFacetValues: function searchForFacetValues(props, searchState, nextRefinement) { return { facetName: props.attribute, query: nextRefinement, maxFacetHits: getLimit(props) }; }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$2(props, searchState, this.context); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var attribute = props.attribute; searchParameters = searchParameters.setQueryParameters({ maxValuesPerFacet: Math.max(searchParameters.maxValuesPerFacet || 0, getLimit(props)) }); searchParameters = searchParameters.addDisjunctiveFacet(attribute); var currentRefinement = getCurrentRefinement$5(props, searchState, this.context); if (currentRefinement !== null) { searchParameters = searchParameters.addDisjunctiveFacetRefinement(attribute, currentRefinement); } return searchParameters; }, getMetadata: function getMetadata(props, searchState) { var _this2 = this; var id = getId$6(props); var currentRefinement = getCurrentRefinement$5(props, searchState, this.context); return { id: id, index: getIndex(this.context), items: currentRefinement === null ? [] : [{ label: props.attribute + ': ' + currentRefinement, attribute: props.attribute, value: function value(nextState) { return _refine$4(props, nextState, '', _this2.context); }, currentRefinement: currentRefinement }] }; } }); 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"); } }; }(); function _defineProperty$b(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; } function stringifyItem(item) { if (typeof item.start === 'undefined' && typeof item.end === 'undefined') { return ''; } return (item.start ? item.start : '') + ':' + (item.end ? item.end : ''); } function parseItem(value) { if (value.length === 0) { return { start: null, end: null }; } var _value$split = value.split(':'), _value$split2 = _slicedToArray(_value$split, 2), startStr = _value$split2[0], endStr = _value$split2[1]; return { start: startStr.length > 0 ? parseInt(startStr, 10) : null, end: endStr.length > 0 ? parseInt(endStr, 10) : null }; } var namespace$3 = 'multiRange'; function getId$7(props) { return props.attribute; } function getCurrentRefinement$6(props, searchState, context) { return getCurrentRefinementValue(props, searchState, context, namespace$3 + '.' + getId$7(props), '', function (currentRefinement) { if (currentRefinement === '') { return ''; } return currentRefinement; }); } function isRefinementsRangeIncludesInsideItemRange(stats, start, end) { return stats.min > start && stats.min < end || stats.max > start && stats.max < end; } function isItemRangeIncludedInsideRefinementsRange(stats, start, end) { return start > stats.min && start < stats.max || end > stats.min && end < stats.max; } function itemHasRefinement(attribute, results, value) { var stats = results.getFacetByName(attribute) ? results.getFacetStats(attribute) : null; var range = value.split(':'); var start = Number(range[0]) === 0 || value === '' ? Number.NEGATIVE_INFINITY : Number(range[0]); var end = Number(range[1]) === 0 || value === '' ? Number.POSITIVE_INFINITY : Number(range[1]); return !(Boolean(stats) && (isRefinementsRangeIncludesInsideItemRange(stats, start, end) || isItemRangeIncludedInsideRefinementsRange(stats, start, end))); } function _refine$5(props, searchState, nextRefinement, context) { var nextValue = _defineProperty$b({}, getId$7(props, searchState), nextRefinement); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage, namespace$3); } function _cleanUp$3(props, searchState, context) { return cleanUpValue(searchState, context, namespace$3 + '.' + getId$7(props)); } /** * connectNumericMenu connector provides the logic to build a widget that will * give the user the ability to select a range value for a numeric attribute. * Ranges are defined statically. * @name connectNumericMenu * @requirements The attribute passed to the `attribute` prop must be holding numerical values. * @kind connector * @propType {string} attribute - the name of the attribute in the records * @propType {{label: string, start: number, end: number}[]} items - List of options. With a text label, and upper and lower bounds. * @propType {string} [defaultRefinement] - the value of the item selected by default, follow the shape of a `string` with a pattern of `'{start}:{end}'`. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @providedPropType {function} refine - a function to select a range. * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string} currentRefinement - the refinement currently applied. follow the shape of a `string` with a pattern of `'{start}:{end}'` which corresponds to the current selected item. For instance, when the selected item is `{start: 10, end: 20}`, the searchState of the widget is `'10:20'`. When `start` isn't defined, the searchState of the widget is `':{end}'`, and the same way around when `end` isn't defined. However, when neither `start` nor `end` are defined, the searchState is an empty string. * @providedPropType {array.<{isRefined: boolean, label: string, value: string, isRefined: boolean, noRefinement: boolean}>} items - the list of ranges the NumericMenu can display. */ var connectNumericMenu = createConnector({ displayName: 'AlgoliaNumericMenu', propTypes: { id: propTypes.string, attribute: propTypes.string.isRequired, items: propTypes.arrayOf(propTypes.shape({ label: propTypes.node, start: propTypes.number, end: propTypes.number })).isRequired, transformItems: propTypes.func }, getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var attribute = props.attribute; var currentRefinement = getCurrentRefinement$6(props, searchState, this.context); var results = getResults(searchResults, this.context); var items = props.items.map(function (item) { var value = stringifyItem(item); return { label: item.label, value: value, isRefined: value === currentRefinement, noRefinement: results ? itemHasRefinement(getId$7(props), results, value) : false }; }); var stats = results && results.getFacetByName(attribute) ? results.getFacetStats(attribute) : null; var refinedItem = find_1(items, function (item) { return item.isRefined === true; }); if (!items.some(function (item) { return item.value === ''; })) { items.push({ value: '', isRefined: isEmpty_1(refinedItem), noRefinement: !stats, label: 'All' }); } return { items: props.transformItems ? props.transformItems(items) : items, currentRefinement: currentRefinement, canRefine: items.length > 0 && items.some(function (item) { return item.noRefinement === false; }) }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$5(props, searchState, nextRefinement, this.context); }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$3(props, searchState, this.context); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var attribute = props.attribute; var _parseItem = parseItem(getCurrentRefinement$6(props, searchState, this.context)), start = _parseItem.start, end = _parseItem.end; searchParameters = searchParameters.addDisjunctiveFacet(attribute); if (start) { searchParameters = searchParameters.addNumericRefinement(attribute, '>=', start); } if (end) { searchParameters = searchParameters.addNumericRefinement(attribute, '<=', end); } return searchParameters; }, getMetadata: function getMetadata(props, searchState) { var _this = this; var id = getId$7(props); var value = getCurrentRefinement$6(props, searchState, this.context); var items = []; var index = getIndex(this.context); if (value !== '') { var _find2 = find_1(props.items, function (item) { return stringifyItem(item) === value; }), label = _find2.label; items.push({ label: props.attribute + ': ' + label, attribute: props.attribute, currentRefinement: label, value: function value(nextState) { return _refine$5(props, nextState, '', _this.context); } }); } return { id: id, index: index, items: items }; } }); function _defineProperty$c(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; } function getId$8() { return 'page'; } function getCurrentRefinement$7(props, searchState, context) { var id = getId$8(); var page = 1; return getCurrentRefinementValue(props, searchState, context, id, page, function (currentRefinement) { if (typeof currentRefinement === 'string') { return parseInt(currentRefinement, 10); } return currentRefinement; }); } function _refine$6(props, searchState, nextPage, context) { var id = getId$8(); var nextValue = _defineProperty$c({}, id, nextPage); var resetPage = false; return refineValue(searchState, nextValue, context, resetPage); } /** * connectPagination connector provides the logic to build a widget that will * let the user displays hits corresponding to a certain page. * @name connectPagination * @kind connector * @propType {boolean} [showFirst=true] - Display the first page link. * @propType {boolean} [showLast=false] - Display the last page link. * @propType {boolean} [showPrevious=true] - Display the previous page link. * @propType {boolean} [showNext=true] - Display the next page link. * @propType {number} [padding=3] - How many page links to display around the current page. * @propType {number} [totalPages=Infinity] - Maximum number of pages to display. * @providedPropType {function} refine - a function to remove a single filter * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {number} nbPages - the total of existing pages * @providedPropType {number} currentRefinement - the page refinement currently applied */ var connectPagination = createConnector({ displayName: 'AlgoliaPagination', getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var results = getResults(searchResults, this.context); if (!results) { return null; } var nbPages = results.nbPages; return { nbPages: nbPages, currentRefinement: getCurrentRefinement$7(props, searchState, this.context), canRefine: nbPages > 1 }; }, refine: function refine(props, searchState, nextPage) { return _refine$6(props, searchState, nextPage, this.context); }, cleanUp: function cleanUp(props, searchState) { return cleanUpValue(searchState, this.context, getId$8()); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { return searchParameters.setPage(getCurrentRefinement$7(props, searchState, this.context) - 1); }, getMetadata: function getMetadata() { return { id: getId$8() }; } }); /** * connectPoweredBy connector provides the logic to build a widget that * will display a link to algolia. * @name connectPoweredBy * @kind connector * @providedPropType {string} url - the url to redirect to algolia */ var connectPoweredBy = createConnector({ displayName: 'AlgoliaPoweredBy', propTypes: {}, getProvidedProps: function getProvidedProps(props) { var url = 'https://www.algolia.com/?' + 'utm_source=react-instantsearch&' + 'utm_medium=website&' + ('utm_content=' + (props.canRender ? location.hostname : '') + '&') + 'utm_campaign=poweredby'; return { url: url }; } }); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeIsFinite = _root.isFinite; /** * Checks if `value` is a finite primitive number. * * **Note:** This method is based on * [`Number.isFinite`](https://mdn.io/Number/isFinite). * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. * @example * * _.isFinite(3); * // => true * * _.isFinite(Number.MIN_VALUE); * // => true * * _.isFinite(Infinity); * // => false * * _.isFinite('3'); * // => false */ function isFinite(value) { return typeof value == 'number' && nativeIsFinite(value); } var _isFinite = isFinite; function _defineProperty$d(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; } /** * connectRange connector provides the logic to create connected * components that will give the ability for a user to refine results using * a numeric range. * @name connectRange * @kind connector * @requirements The attribute passed to the `attribute` prop must be present in “attributes for faceting” * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * The values inside the attribute must be JavaScript numbers (not strings). * @propType {string} attribute - Name of the attribute for faceting * @propType {{min?: number, max?: number}} [defaultRefinement] - Default searchState of the widget containing the start and the end of the range. * @propType {number} [min] - Minimum value. When this isn't set, the minimum value will be automatically computed by Algolia using the data in the index. * @propType {number} [max] - Maximum value. When this isn't set, the maximum value will be automatically computed by Algolia using the data in the index. * @propType {number} [precision=0] - Number of digits after decimal point to use. * @providedPropType {function} refine - a function to select a range. * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string} currentRefinement - the refinement currently applied * @providedPropType {number} min - the minimum value available. * @providedPropType {number} max - the maximum value available. * @providedPropType {number} precision - Number of digits after decimal point to use. */ function getId$9(props) { return props.attribute; } var namespace$4 = 'range'; function getCurrentRange(boundaries, stats, precision) { var pow = Math.pow(10, precision); var min = void 0; if (_isFinite(boundaries.min)) { min = boundaries.min; } else if (_isFinite(stats.min)) { min = stats.min; } else { min = undefined; } var max = void 0; if (_isFinite(boundaries.max)) { max = boundaries.max; } else if (_isFinite(stats.max)) { max = stats.max; } else { max = undefined; } return { min: min !== undefined ? Math.floor(min * pow) / pow : min, max: max !== undefined ? Math.ceil(max * pow) / pow : max }; } function getCurrentRefinement$8(props, searchState, currentRange, context) { var refinement = getCurrentRefinementValue(props, searchState, context, namespace$4 + '.' + getId$9(props), {}, function (currentRefinement) { var min = currentRefinement.min, max = currentRefinement.max; var isFloatPrecision = Boolean(props.precision); var nextMin = min; if (typeof nextMin === 'string') { nextMin = isFloatPrecision ? parseFloat(nextMin) : parseInt(nextMin, 10); } var nextMax = max; if (typeof nextMax === 'string') { nextMax = isFloatPrecision ? parseFloat(nextMax) : parseInt(nextMax, 10); } return { min: nextMin, max: nextMax }; }); var hasMinBound = props.min !== undefined; var hasMaxBound = props.max !== undefined; var hasMinRefinment = refinement.min !== undefined; var hasMaxRefinment = refinement.max !== undefined; if (hasMinBound && hasMinRefinment && refinement.min < currentRange.min) { throw Error("You can't provide min value lower than range."); } if (hasMaxBound && hasMaxRefinment && refinement.max > currentRange.max) { throw Error("You can't provide max value greater than range."); } if (hasMinBound && !hasMinRefinment) { refinement.min = currentRange.min; } if (hasMaxBound && !hasMaxRefinment) { refinement.max = currentRange.max; } return refinement; } function getCurrentRefinementWithRange(refinement, range) { return { min: refinement.min !== undefined ? refinement.min : range.min, max: refinement.max !== undefined ? refinement.max : range.max }; } function nextValueForRefinement(hasBound, isReset, range, value) { var next = void 0; if (!hasBound && range === value) { next = undefined; } else if (hasBound && isReset) { next = range; } else { next = value; } return next; } function _refine$7(props, searchState, nextRefinement, currentRange, context) { var nextMin = nextRefinement.min, nextMax = nextRefinement.max; var currentMinRange = currentRange.min, currentMaxRange = currentRange.max; var isMinReset = nextMin === undefined || nextMin === ''; var isMaxReset = nextMax === undefined || nextMax === ''; var nextMinAsNumber = !isMinReset ? parseFloat(nextMin) : undefined; var nextMaxAsNumber = !isMaxReset ? parseFloat(nextMax) : undefined; var isNextMinValid = isMinReset || _isFinite(nextMinAsNumber); var isNextMaxValid = isMaxReset || _isFinite(nextMaxAsNumber); if (!isNextMinValid || !isNextMaxValid) { throw Error("You can't provide non finite values to the range connector."); } if (nextMinAsNumber < currentMinRange) { throw Error("You can't provide min value lower than range."); } if (nextMaxAsNumber > currentMaxRange) { throw Error("You can't provide max value greater than range."); } var id = getId$9(props); var resetPage = true; var nextValue = _defineProperty$d({}, id, { min: nextValueForRefinement(props.min !== undefined, isMinReset, currentMinRange, nextMinAsNumber), max: nextValueForRefinement(props.max !== undefined, isMaxReset, currentMaxRange, nextMaxAsNumber) }); return refineValue(searchState, nextValue, context, resetPage, namespace$4); } function _cleanUp$4(props, searchState, context) { return cleanUpValue(searchState, context, namespace$4 + '.' + getId$9(props)); } var connectRange = createConnector({ displayName: 'AlgoliaRange', propTypes: { id: propTypes.string, attribute: propTypes.string.isRequired, defaultRefinement: propTypes.shape({ min: propTypes.number, max: propTypes.number }), min: propTypes.number, max: propTypes.number, precision: propTypes.number, header: propTypes.node, footer: propTypes.node }, defaultProps: { precision: 0 }, getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var attribute = props.attribute, precision = props.precision, minBound = props.min, maxBound = props.max; var results = getResults(searchResults, this.context); var hasFacet = results && results.getFacetByName(attribute); var stats = hasFacet ? results.getFacetStats(attribute) || {} : {}; var facetValues = hasFacet ? results.getFacetValues(attribute) : []; var count = facetValues.map(function (v) { return { value: v.name, count: v.count }; }); var _getCurrentRange = getCurrentRange({ min: minBound, max: maxBound }, stats, precision), rangeMin = _getCurrentRange.min, rangeMax = _getCurrentRange.max; // The searchState is not always in sync with the helper state. For example // when we set boundaries on the first render the searchState don't have // the correct refinement. If this behaviour change in the upcoming version // we could store the range inside the searchState instead of rely on `this`. this._currentRange = { min: rangeMin, max: rangeMax }; var currentRefinement = getCurrentRefinement$8(props, searchState, this._currentRange, this.context); return { min: rangeMin, max: rangeMax, canRefine: count.length > 0, currentRefinement: getCurrentRefinementWithRange(currentRefinement, this._currentRange), count: count, precision: precision }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$7(props, searchState, nextRefinement, this._currentRange, this.context); }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$4(props, searchState, this.context); }, getSearchParameters: function getSearchParameters(params, props, searchState) { var attribute = props.attribute; var _getCurrentRefinement = getCurrentRefinement$8(props, searchState, this._currentRange, this.context), min = _getCurrentRefinement.min, max = _getCurrentRefinement.max; params = params.addDisjunctiveFacet(attribute); if (min !== undefined) { params = params.addNumericRefinement(attribute, '>=', min); } if (max !== undefined) { params = params.addNumericRefinement(attribute, '<=', max); } return params; }, getMetadata: function getMetadata(props, searchState) { var _this = this; var _currentRange = this._currentRange, minRange = _currentRange.min, maxRange = _currentRange.max; var _getCurrentRefinement2 = getCurrentRefinement$8(props, searchState, this._currentRange, this.context), minValue = _getCurrentRefinement2.min, maxValue = _getCurrentRefinement2.max; var items = []; var hasMin = minValue !== undefined; var hasMax = maxValue !== undefined; var shouldDisplayMinLabel = hasMin && minValue !== minRange; var shouldDisplayMaxLabel = hasMax && maxValue !== maxRange; if (shouldDisplayMinLabel || shouldDisplayMaxLabel) { var fragments = [hasMin ? minValue + ' <= ' : '', props.attribute, hasMax ? ' <= ' + maxValue : '']; items.push({ label: fragments.join(''), attribute: props.attribute, value: function value(nextState) { return _refine$7(props, nextState, {}, _this._currentRange, _this.context); }, currentRefinement: getCurrentRefinementWithRange({ min: minValue, max: maxValue }, { min: minRange, max: maxRange }) }); } return { id: getId$9(props), index: getIndex(this.context), items: items }; } }); function _defineProperty$e(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 namespace$5 = 'refinementList'; function getId$a(props) { return props.attribute; } function getCurrentRefinement$9(props, searchState, context) { return getCurrentRefinementValue(props, searchState, context, namespace$5 + '.' + getId$a(props), [], function (currentRefinement) { if (typeof currentRefinement === 'string') { // All items were unselected if (currentRefinement === '') { return []; } // Only one item was in the searchState but we know it should be an array return [currentRefinement]; } return currentRefinement; }); } function getValue$3(name, props, searchState, context) { var currentRefinement = getCurrentRefinement$9(props, searchState, context); var isAnewValue = currentRefinement.indexOf(name) === -1; var nextRefinement = isAnewValue ? currentRefinement.concat([name]) // cannot use .push(), it mutates : currentRefinement.filter(function (selectedValue) { return selectedValue !== name; }); // cannot use .splice(), it mutates return nextRefinement; } function getLimit$1(_ref) { var showMore = _ref.showMore, limit = _ref.limit, showMoreLimit = _ref.showMoreLimit; return showMore ? showMoreLimit : limit; } function _refine$8(props, searchState, nextRefinement, context) { var id = getId$a(props); // Setting the value to an empty string ensures that it is persisted in // the URL as an empty value. // This is necessary in the case where `defaultRefinement` contains one // item and we try to deselect it. `nextSelected` would be an empty array, // which would not be persisted to the URL. // {foo: ['bar']} => "foo[0]=bar" // {foo: []} => "" var nextValue = _defineProperty$e({}, id, nextRefinement.length > 0 ? nextRefinement : ''); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage, namespace$5); } function _cleanUp$5(props, searchState, context) { return cleanUpValue(searchState, context, namespace$5 + '.' + getId$a(props)); } /** * connectRefinementList connector provides the logic to build a widget that will * give the user the ability to choose multiple values for a specific facet. * @name connectRefinementList * @kind connector * @requirements The attribute passed to the `attribute` prop must be present in "attributes for faceting" * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API. * @propType {string} attribute - the name of the attribute in the record * @propType {boolean} [searchable=false] - allow search inside values * @propType {string} [operator=or] - How to apply the refinements. Possible values: 'or' or 'and'. * @propType {boolean} [showMore=false] - true if the component should display a button that will expand the number of items * @propType {number} [limit=10] - the minimum number of displayed items * @propType {number} [showMoreLimit=20] - the maximun number of displayed items. Only used when showMore is set to `true` * @propType {string[]} defaultRefinement - the values of the items selected by default. The searchState of this widget takes the form of a list of `string`s, which correspond to the values of all selected refinements. However, when there are no refinements selected, the value of the searchState is an empty string. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @providedPropType {function} refine - a function to toggle a refinement * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string[]} currentRefinement - the refinement currently applied * @providedPropType {array.<{count: number, isRefined: boolean, label: string, value: string}>} items - the list of items the RefinementList can display. * @providedPropType {function} searchForItems - a function to toggle a search inside items values * @providedPropType {boolean} isFromSearch - a boolean that says if the `items` props contains facet values from the global search or from the search inside items. */ var sortBy$2 = ['isRefined', 'count:desc', 'name:asc']; var connectRefinementList = createConnector({ displayName: 'AlgoliaRefinementList', propTypes: { id: propTypes.string, attribute: propTypes.string.isRequired, operator: propTypes.oneOf(['and', 'or']), showMore: propTypes.bool, limit: propTypes.number, showMoreLimit: propTypes.number, defaultRefinement: propTypes.arrayOf(propTypes.oneOfType([propTypes.string, propTypes.number])), searchable: propTypes.bool, transformItems: propTypes.func }, defaultProps: { operator: 'or', showMore: false, limit: 10, showMoreLimit: 20 }, getProvidedProps: function getProvidedProps(props, searchState, searchResults, metadata, searchForFacetValuesResults) { var _this = this; var attribute = props.attribute, searchable = props.searchable; var results = getResults(searchResults, this.context); var canRefine = Boolean(results) && Boolean(results.getFacetByName(attribute)); var isFromSearch = Boolean(searchForFacetValuesResults && searchForFacetValuesResults[attribute] && searchForFacetValuesResults.query !== ''); // Search For Facet Values is not available with derived helper (used for multi index search) if (searchable && this.context.multiIndexContext) { throw new Error('react-instantsearch: searching in *List is not available when used inside a' + ' multi index context'); } if (!canRefine) { return { items: [], currentRefinement: getCurrentRefinement$9(props, searchState, this.context), canRefine: canRefine, isFromSearch: isFromSearch, searchable: searchable }; } var items = isFromSearch ? searchForFacetValuesResults[attribute].map(function (v) { return { label: v.value, value: getValue$3(v.value, props, searchState, _this.context), _highlightResult: { label: { value: v.highlighted } }, count: v.count, isRefined: v.isRefined }; }) : results.getFacetValues(attribute, { sortBy: sortBy$2 }).map(function (v) { return { label: v.name, value: getValue$3(v.name, props, searchState, _this.context), count: v.count, isRefined: v.isRefined }; }); var transformedItems = props.transformItems ? props.transformItems(items) : items; return { items: transformedItems.slice(0, getLimit$1(props)), currentRefinement: getCurrentRefinement$9(props, searchState, this.context), isFromSearch: isFromSearch, searchable: searchable, canRefine: items.length > 0 }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$8(props, searchState, nextRefinement, this.context); }, searchForFacetValues: function searchForFacetValues(props, searchState, nextRefinement) { return { facetName: props.attribute, query: nextRefinement, maxFacetHits: getLimit$1(props) }; }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$5(props, searchState, this.context); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var attribute = props.attribute, operator = props.operator; var addKey = operator === 'and' ? 'addFacet' : 'addDisjunctiveFacet'; var addRefinementKey = addKey + 'Refinement'; searchParameters = searchParameters.setQueryParameters({ maxValuesPerFacet: Math.max(searchParameters.maxValuesPerFacet || 0, getLimit$1(props)) }); searchParameters = searchParameters[addKey](attribute); return getCurrentRefinement$9(props, searchState, this.context).reduce(function (res, val) { return res[addRefinementKey](attribute, val); }, searchParameters); }, getMetadata: function getMetadata(props, searchState) { var id = getId$a(props); var context = this.context; return { id: id, index: getIndex(this.context), items: getCurrentRefinement$9(props, searchState, context).length > 0 ? [{ attribute: props.attribute, label: props.attribute + ': ', currentRefinement: getCurrentRefinement$9(props, searchState, context), value: function value(nextState) { return _refine$8(props, nextState, [], context); }, items: getCurrentRefinement$9(props, searchState, context).map(function (item) { return { label: '' + item, value: function value(nextState) { var nextSelectedItems = getCurrentRefinement$9(props, nextState, context).filter(function (other) { return other !== item; }); return _refine$8(props, searchState, nextSelectedItems, context); } }; }) }] : [] }; } }); /** * connectScrollTo connector provides the logic to build a widget that will * let the page scroll to a certain point. * @name connectScrollTo * @kind connector * @propType {string} [scrollOn="page"] - Widget searchState key on which to listen for changes, default to the pagination widget. * @providedPropType {any} value - the current refinement applied to the widget listened by scrollTo * @providedPropType {boolean} hasNotChanged - indicates whether the refinement came from the scrollOn argument (for instance page by default) */ var connectScrollTo = createConnector({ displayName: 'AlgoliaScrollTo', propTypes: { scrollOn: propTypes.string }, defaultProps: { scrollOn: 'page' }, getProvidedProps: function getProvidedProps(props, searchState) { var id = props.scrollOn; var value = getCurrentRefinementValue(props, searchState, this.context, id, null, function (currentRefinement) { return currentRefinement; }); if (!this._prevSearchState) { this._prevSearchState = {}; } /* Get the subpart of the state that interest us*/ if (hasMultipleIndex(this.context)) { var index = getIndex(this.context); searchState = searchState.indices ? searchState.indices[index] : {}; } /* if there is a change in the app that has been triggered by another element than "props.scrollOn (id) or the Configure widget, we need to keep track of the search state to know if there's a change in the app that was not triggered by the props.scrollOn (id) or the Configure widget. This is useful when using ScrollTo in combination of Pagination. As pagination can be change by every widget, we want to scroll only if it cames from the pagination widget itself. We also remove the configure key from the search state to do this comparaison because for now configure values are not present in the search state before a first refinement has been made and will false the results. See: https://github.com/algolia/react-instantsearch/issues/164 */ var cleanedSearchState = omit_1(omit_1(searchState, 'configure'), id); var hasNotChanged = shallowEqual(this._prevSearchState, cleanedSearchState); this._prevSearchState = cleanedSearchState; return { value: value, hasNotChanged: hasNotChanged }; } }); function _defineProperty$f(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; } function getId$b() { return 'query'; } function getCurrentRefinement$a(props, searchState, context) { var id = getId$b(props); return getCurrentRefinementValue(props, searchState, context, id, '', function (currentRefinement) { if (currentRefinement) { return currentRefinement; } return ''; }); } function _refine$9(props, searchState, nextRefinement, context) { var id = getId$b(); var nextValue = _defineProperty$f({}, id, nextRefinement); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage); } function _cleanUp$6(props, searchState, context) { return cleanUpValue(searchState, context, getId$b()); } /** * connectSearchBox connector provides the logic to build a widget that will * let the user search for a query * @name connectSearchBox * @kind connector * @propType {string} [defaultRefinement] - Provide a default value for the query * @providedPropType {function} refine - a function to change the current query * @providedPropType {string} currentRefinement - the current query used * @providedPropType {boolean} isSearchStalled - a flag that indicates if InstantSearch has detected that searches are stalled */ var connectSearchBox = createConnector({ displayName: 'AlgoliaSearchBox', propTypes: { defaultRefinement: propTypes.string }, getProvidedProps: function getProvidedProps(props, searchState, searchResults) { return { currentRefinement: getCurrentRefinement$a(props, searchState, this.context), isSearchStalled: searchResults.isSearchStalled }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$9(props, searchState, nextRefinement, this.context); }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$6(props, searchState, this.context); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { return searchParameters.setQuery(getCurrentRefinement$a(props, searchState, this.context)); }, getMetadata: function getMetadata(props, searchState) { var _this = this; var id = getId$b(props); var currentRefinement = getCurrentRefinement$a(props, searchState, this.context); return { id: id, index: getIndex(this.context), items: currentRefinement === null ? [] : [{ label: id + ': ' + currentRefinement, value: function value(nextState) { return _refine$9(props, nextState, '', _this.context); }, currentRefinement: currentRefinement }] }; } }); var _extends$a = 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; }; function _defineProperty$g(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; } function getId$c() { return 'sortBy'; } function getCurrentRefinement$b(props, searchState, context) { var id = getId$c(props); return getCurrentRefinementValue(props, searchState, context, id, null, function (currentRefinement) { if (currentRefinement) { return currentRefinement; } return null; }); } /** * The connectSortBy connector provides the logic to build a widget that will * display a list of indices. This allows a user to change how the hits are being sorted. * @name connectSortBy * @requirements Algolia handles sorting by creating replica indices. [Read more about sorting](https://www.algolia.com/doc/guides/relevance/sorting/) on * the Algolia website. * @kind connector * @propType {string} defaultRefinement - The default selected index. * @propType {{value: string, label: string}[]} items - The list of indexes to search in. * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. * @providedPropType {function} refine - a function to remove a single filter * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {string[]} currentRefinement - the refinement currently applied * @providedPropType {array.<{isRefined: boolean, label?: string, value: string}>} items - the list of items the HitsPerPage can display. If no label provided, the value will be displayed. */ var connectSortBy = createConnector({ displayName: 'AlgoliaSortBy', propTypes: { defaultRefinement: propTypes.string, items: propTypes.arrayOf(propTypes.shape({ label: propTypes.string, value: propTypes.string.isRequired })).isRequired, transformItems: propTypes.func }, getProvidedProps: function getProvidedProps(props, searchState) { var currentRefinement = getCurrentRefinement$b(props, searchState, this.context); var items = props.items.map(function (item) { return item.value === currentRefinement ? _extends$a({}, item, { isRefined: true }) : _extends$a({}, item, { isRefined: false }); }); return { items: props.transformItems ? props.transformItems(items) : items, currentRefinement: currentRefinement }; }, refine: function refine(props, searchState, nextRefinement) { var id = getId$c(); var nextValue = _defineProperty$g({}, id, nextRefinement); var resetPage = true; return refineValue(searchState, nextValue, this.context, resetPage); }, cleanUp: function cleanUp(props, searchState) { return cleanUpValue(searchState, this.context, getId$c()); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var selectedIndex = getCurrentRefinement$b(props, searchState, this.context); return searchParameters.setIndex(selectedIndex); }, getMetadata: function getMetadata() { return { id: getId$c() }; } }); /** * The `connectStateResults` connector provides a way to access the `searchState` and the `searchResults` * of InstantSearch. * For instance this connector allows you to create results/noResults or query/noQuery pages. * @name connectStateResults * @kind connector * @providedPropType {object} searchState - The search state of the instant search component. <br/><br/> See: [Search state structure](https://community.algolia.com/react-instantsearch/guide/Search_state.html) * @providedPropType {object} searchResults - The search results. <br/><br/> In case of multiple indices: if used under `<Index>`, results will be those of the corresponding index otherwise it'll be those of the root index See: [Search results structure](https://community.algolia.com/algoliasearch-helper-js/reference.html#searchresults) * @providedPropType {object} allSearchResults - In case of multiple indices you can retrieve all the results * @providedPropType {string} error - If the search failed, the error will be logged here. * @providedPropType {boolean} searching - If there is a search in progress. * @providedPropType {boolean} isSearchStalled - Flag that indicates if React InstantSearch has detected that searches are stalled. * @providedPropType {boolean} searchingForFacetValues - If there is a search in a list in progress. * @providedPropType {object} props - component props. * @example * import React from 'react'; * import { InstantSearch, SearchBox, Hits, connectStateResults } from 'react-instantsearch-dom'; * * const Content = connectStateResults(({ searchState, searchResults }) => { * const hasResults = searchResults && searchResults.nbHits !== 0; * * return ( * <div> * <div hidden={!hasResults}> * <Hits /> * </div> * <div hidden={hasResults}> * <div>No results has been found for {searchState.query}</div> * </div> * </div> * ); * }); * * const App = () => ( * <InstantSearch * appId="latency" * apiKey="6be0576ff61c053d5f9a3225e2a90f76" * indexName="ikea" * > * <SearchBox /> * <Content /> * </InstantSearch> * ); */ var connectStateResults = createConnector({ displayName: 'AlgoliaStateResults', getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var results = getResults(searchResults, this.context); return { searchState: searchState, searchResults: results, allSearchResults: searchResults.results, searching: searchResults.searching, isSearchStalled: searchResults.isSearchStalled, error: searchResults.error, searchingForFacetValues: searchResults.searchingForFacetValues, props: props }; } }); /** * connectStats connector provides the logic to build a widget that will * displays algolia search statistics (hits number and processing time). * @name connectStats * @kind connector * @providedPropType {number} nbHits - number of hits returned by Algolia. * @providedPropType {number} processingTimeMS - the time in ms took by Algolia to search for results. */ var connectStats = createConnector({ displayName: 'AlgoliaStats', getProvidedProps: function getProvidedProps(props, searchState, searchResults) { var results = getResults(searchResults, this.context); if (!results) { return null; } return { nbHits: results.nbHits, processingTimeMS: results.processingTimeMS }; } }); function _defineProperty$h(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; } function getId$d(props) { return props.attribute; } var namespace$6 = 'toggle'; function getCurrentRefinement$c(props, searchState, context) { return getCurrentRefinementValue(props, searchState, context, namespace$6 + '.' + getId$d(props), false, function (currentRefinement) { if (currentRefinement) { return currentRefinement; } return false; }); } function _refine$a(props, searchState, nextRefinement, context) { var id = getId$d(props); var nextValue = _defineProperty$h({}, id, nextRefinement ? nextRefinement : false); var resetPage = true; return refineValue(searchState, nextValue, context, resetPage, namespace$6); } function _cleanUp$7(props, searchState, context) { return cleanUpValue(searchState, context, namespace$6 + '.' + getId$d(props)); } /** * connectToggleRefinement connector provides the logic to build a widget that will * provides an on/off filtering feature based on an attribute value. * @name connectToggleRefinement * @kind connector * @requirements To use this widget, you'll need an attribute to toggle on. * * You can't toggle on null or not-null values. If you want to address this particular use-case you'll need to compute an * extra boolean attribute saying if the value exists or not. See this [thread](https://discourse.algolia.com/t/how-to-create-a-toggle-for-the-absence-of-a-string-attribute/2460) for more details. * * @propType {string} attribute - Name of the attribute on which to apply the `value` refinement. Required when `value` is present. * @propType {string} label - Label for the toggle. * @propType {string} value - Value of the refinement to apply on `attribute`. * @propType {boolean} [defaultRefinement=false] - Default searchState of the widget. Should the toggle be checked by default? * @providedPropType {function} refine - a function to toggle a refinement * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state * @providedPropType {boolean} currentRefinement - `true` when the refinement is applied, `false` otherwise */ var connectToggleRefinement = createConnector({ displayName: 'AlgoliaToggle', propTypes: { label: propTypes.string, filter: propTypes.func, attribute: propTypes.string, value: propTypes.any, defaultRefinement: propTypes.bool }, getProvidedProps: function getProvidedProps(props, searchState) { var currentRefinement = getCurrentRefinement$c(props, searchState, this.context); return { currentRefinement: currentRefinement }; }, refine: function refine(props, searchState, nextRefinement) { return _refine$a(props, searchState, nextRefinement, this.context); }, cleanUp: function cleanUp(props, searchState) { return _cleanUp$7(props, searchState, this.context); }, getSearchParameters: function getSearchParameters(searchParameters, props, searchState) { var attribute = props.attribute, value = props.value, filter = props.filter; var checked = getCurrentRefinement$c(props, searchState, this.context); if (checked) { if (attribute) { searchParameters = searchParameters.addFacet(attribute).addFacetRefinement(attribute, value); } if (filter) { searchParameters = filter(searchParameters); } } return searchParameters; }, getMetadata: function getMetadata(props, searchState) { var _this = this; var id = getId$d(props); var checked = getCurrentRefinement$c(props, searchState, this.context); var items = []; var index = getIndex(this.context); if (checked) { items.push({ label: props.label, currentRefinement: checked, attribute: props.attribute, value: function value(nextState) { return _refine$a(props, nextState, false, _this.context); } }); } return { id: id, index: index, items: items }; } }); // Core exports.connectAutoComplete = connectAutoComplete; exports.connectBreadcrumb = connectBreadcrumb; exports.connectConfigure = connectConfigure; exports.connectCurrentRefinements = connectCurrentRefinements; exports.connectGeoSearch = connectGeoSearch; exports.connectHierarchicalMenu = connectHierarchicalMenu; exports.connectHighlight = connectHighlight; exports.connectHits = connectHits; exports.connectHitsPerPage = connectHitsPerPage; exports.connectInfiniteHits = connectInfiniteHits; exports.connectMenu = connectMenu; exports.connectNumericMenu = connectNumericMenu; exports.connectPagination = connectPagination; exports.connectPoweredBy = connectPoweredBy; exports.connectRange = connectRange; exports.connectRefinementList = connectRefinementList; exports.connectScrollTo = connectScrollTo; exports.connectSearchBox = connectSearchBox; exports.connectSortBy = connectSortBy; exports.connectStateResults = connectStateResults; exports.connectStats = connectStats; exports.connectToggleRefinement = connectToggleRefinement; Object.defineProperty(exports, '__esModule', { value: true }); }))); //# sourceMappingURL=Connectors.js.map
ajax/libs/react-native-web/0.14.1/exports/createElement/index.js
cdnjs/cdnjs
/** * Copyright (c) Nicolas Gallagher. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ import AccessibilityUtil from '../../modules/AccessibilityUtil'; import createDOMProps from '../../modules/createDOMProps'; import React from 'react'; var createElement = function createElement(component, props) { // Use equivalent platform elements where possible. var accessibilityComponent; if (component && component.constructor === String) { accessibilityComponent = AccessibilityUtil.propsToAccessibilityComponent(props); } var Component = accessibilityComponent || component; var domProps = createDOMProps(Component, props); for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { children[_key - 2] = arguments[_key]; } return React.createElement.apply(React, [Component, domProps].concat(children)); }; export default createElement;
ajax/libs/react-native-web/0.13.14/exports/Button/index.js
cdnjs/cdnjs
/** * Copyright (c) Nicolas Gallagher. * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ import StyleSheet from '../StyleSheet'; import TouchableOpacity from '../TouchableOpacity'; import Text from '../Text'; import React from 'react'; export default function Button(props) { var accessibilityLabel = props.accessibilityLabel, color = props.color, disabled = props.disabled, onPress = props.onPress, testID = props.testID, title = props.title; return React.createElement(TouchableOpacity, { accessibilityLabel: accessibilityLabel, accessibilityRole: "button", disabled: disabled, onPress: onPress, style: [styles.button, color && { backgroundColor: color }, disabled && styles.buttonDisabled], testID: testID }, React.createElement(Text, { style: [styles.text, disabled && styles.textDisabled] }, title)); } var styles = StyleSheet.create({ button: { backgroundColor: '#2196F3', borderRadius: 2 }, text: { color: '#fff', fontWeight: '500', padding: 8, textAlign: 'center', textTransform: 'uppercase' }, buttonDisabled: { backgroundColor: '#dfdfdf' }, textDisabled: { color: '#a1a1a1' } });
ajax/libs/material-ui/4.9.4/esm/ButtonBase/Ripple.js
cdnjs/cdnjs
import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import useEventCallback from '../utils/useEventCallback'; var useEnhancedEffect = typeof window === 'undefined' ? React.useEffect : React.useLayoutEffect; /** * @ignore - internal component. */ function Ripple(props) { var classes = props.classes, _props$pulsate = props.pulsate, pulsate = _props$pulsate === void 0 ? false : _props$pulsate, rippleX = props.rippleX, rippleY = props.rippleY, rippleSize = props.rippleSize, inProp = props.in, _props$onExited = props.onExited, onExited = _props$onExited === void 0 ? function () {} : _props$onExited, timeout = props.timeout; var _React$useState = React.useState(false), leaving = _React$useState[0], setLeaving = _React$useState[1]; var rippleClassName = clsx(classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate); var rippleStyles = { width: rippleSize, height: rippleSize, top: -(rippleSize / 2) + rippleY, left: -(rippleSize / 2) + rippleX }; var childClassName = clsx(classes.child, leaving && classes.childLeaving, pulsate && classes.childPulsate); var handleExited = useEventCallback(onExited); // Ripple is used for user feedback (e.g. click or press) so we want to apply styles with the highest priority useEnhancedEffect(function () { if (!inProp) { // react-transition-group#onExit setLeaving(true); // react-transition-group#onExited var timeoutId = setTimeout(handleExited, timeout); return function () { clearTimeout(timeoutId); }; } return undefined; }, [handleExited, inProp, timeout]); return React.createElement("span", { className: rippleClassName, style: rippleStyles }, React.createElement("span", { className: childClassName })); } process.env.NODE_ENV !== "production" ? Ripple.propTypes = { /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * @ignore - injected from TransitionGroup */ in: PropTypes.bool, /** * @ignore - injected from TransitionGroup */ onExited: PropTypes.func, /** * If `true`, the ripple pulsates, typically indicating the keyboard focus state of an element. */ pulsate: PropTypes.bool, /** * Diameter of the ripple. */ rippleSize: PropTypes.number, /** * Horizontal position of the ripple center. */ rippleX: PropTypes.number, /** * Vertical position of the ripple center. */ rippleY: PropTypes.number, /** * exit delay */ timeout: PropTypes.number.isRequired } : void 0; export default Ripple;
ajax/libs/primereact/6.6.0-rc.1/splitbutton/splitbutton.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; import { Button } from 'primereact/button'; import { classNames, ObjectUtils, CSSTransition, Portal, OverlayService, ZIndexUtils, DomHandler, ConnectedOverlayScrollHandler, UniqueComponentId, tip } from 'primereact/core'; import PrimeReact from 'primereact/api'; 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); return Constructor; } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); } 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); } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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; } function _createSuper$2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); 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 _isNativeReflectConstruct$2() { 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; } } var SplitButtonItem = /*#__PURE__*/function (_Component) { _inherits(SplitButtonItem, _Component); var _super = _createSuper$2(SplitButtonItem); function SplitButtonItem(props) { var _this; _classCallCheck(this, SplitButtonItem); _this = _super.call(this, props); _this.onClick = _this.onClick.bind(_assertThisInitialized(_this)); return _this; } _createClass(SplitButtonItem, [{ key: "onClick", value: function onClick(e) { if (this.props.menuitem.command) { this.props.menuitem.command({ originalEvent: e, item: this.props.menuitem }); } if (this.props.onItemClick) { this.props.onItemClick(e); } e.preventDefault(); } }, { key: "renderSeparator", value: function renderSeparator() { return /*#__PURE__*/React.createElement("li", { className: "p-menu-separator", role: "separator" }); } }, { key: "renderMenuitem", value: function renderMenuitem() { var _this2 = this; var _this$props$menuitem = this.props.menuitem, disabled = _this$props$menuitem.disabled, icon = _this$props$menuitem.icon, label = _this$props$menuitem.label, template = _this$props$menuitem.template, url = _this$props$menuitem.url, target = _this$props$menuitem.target; var className = classNames('p-menuitem-link', { 'p-disabled': disabled }); var iconClassName = classNames('p-menuitem-icon', icon); icon = icon && /*#__PURE__*/React.createElement("span", { className: iconClassName }); label = label && /*#__PURE__*/React.createElement("span", { className: "p-menuitem-text" }, label); var content = /*#__PURE__*/React.createElement("a", { href: url || '#', role: "menuitem", className: className, target: target, onClick: this.onClick }, icon, label); if (template) { var defaultContentOptions = { onClick: function onClick(event) { return _this2.onClick(event); }, className: className, labelClassName: 'p-menuitem-text', iconClassName: iconClassName, element: content, props: this.props }; content = ObjectUtils.getJSXElement(template, this.props.menuitem, defaultContentOptions); } return /*#__PURE__*/React.createElement("li", { className: "p-menuitem", role: "none" }, content); } }, { key: "renderItem", value: function renderItem() { if (this.props.menuitem.separator) { return this.renderSeparator(); } return this.renderMenuitem(); } }, { key: "render", value: function render() { var item = this.renderItem(); return item; } }]); return SplitButtonItem; }(Component); _defineProperty(SplitButtonItem, "defaultProps", { menuitem: null, onItemClick: null }); function _extends() { _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; }; return _extends.apply(this, arguments); } function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); 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 _isNativeReflectConstruct$1() { 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; } } var SplitButtonPanelComponent = /*#__PURE__*/function (_Component) { _inherits(SplitButtonPanelComponent, _Component); var _super = _createSuper$1(SplitButtonPanelComponent); function SplitButtonPanelComponent() { _classCallCheck(this, SplitButtonPanelComponent); return _super.apply(this, arguments); } _createClass(SplitButtonPanelComponent, [{ key: "renderElement", value: function renderElement() { var className = classNames('p-menu p-menu-overlay p-component', this.props.menuClassName); return /*#__PURE__*/React.createElement(CSSTransition, { nodeRef: this.props.forwardRef, classNames: "p-connected-overlay", in: this.props.in, timeout: { enter: 120, exit: 100 }, options: this.props.transitionOptions, unmountOnExit: true, onEnter: this.props.onEnter, onEntered: this.props.onEntered, onExit: this.props.onExit, onExited: this.props.onExited }, /*#__PURE__*/React.createElement("div", { ref: this.props.forwardRef, className: className, style: this.props.menuStyle, id: this.props.id, onClick: this.onClick }, /*#__PURE__*/React.createElement("ul", { className: "p-menu-list p-reset", role: "menu" }, this.props.children))); } }, { key: "render", value: function render() { var element = this.renderElement(); return /*#__PURE__*/React.createElement(Portal, { element: element, appendTo: this.props.appendTo }); } }]); return SplitButtonPanelComponent; }(Component); _defineProperty(SplitButtonPanelComponent, "defaultProps", { appendTo: null, menuStyle: null, menuClassName: null, id: null, onClick: null }); var SplitButtonPanel = /*#__PURE__*/React.forwardRef(function (props, ref) { return /*#__PURE__*/React.createElement(SplitButtonPanelComponent, _extends({ forwardRef: ref }, props)); }); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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 _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; } } var SplitButton = /*#__PURE__*/function (_Component) { _inherits(SplitButton, _Component); var _super = _createSuper(SplitButton); function SplitButton(props) { var _this; _classCallCheck(this, SplitButton); _this = _super.call(this, props); _this.state = { id: props.id, overlayVisible: false }; _this.onDropdownButtonClick = _this.onDropdownButtonClick.bind(_assertThisInitialized(_this)); _this.onItemClick = _this.onItemClick.bind(_assertThisInitialized(_this)); _this.onOverlayEnter = _this.onOverlayEnter.bind(_assertThisInitialized(_this)); _this.onOverlayEntered = _this.onOverlayEntered.bind(_assertThisInitialized(_this)); _this.onOverlayExit = _this.onOverlayExit.bind(_assertThisInitialized(_this)); _this.onOverlayExited = _this.onOverlayExited.bind(_assertThisInitialized(_this)); _this.onPanelClick = _this.onPanelClick.bind(_assertThisInitialized(_this)); _this.overlayRef = /*#__PURE__*/React.createRef(); return _this; } _createClass(SplitButton, [{ key: "onPanelClick", value: function onPanelClick(event) { OverlayService.emit('overlay-click', { originalEvent: event, target: this.container }); } }, { key: "onDropdownButtonClick", value: function onDropdownButtonClick() { if (this.state.overlayVisible) this.hide();else this.show(); } }, { key: "onItemClick", value: function onItemClick() { this.hide(); } }, { key: "show", value: function show() { this.setState({ overlayVisible: true }); } }, { key: "hide", value: function hide() { this.setState({ overlayVisible: false }); } }, { key: "onOverlayEnter", value: function onOverlayEnter() { ZIndexUtils.set('overlay', this.overlayRef.current); this.alignOverlay(); } }, { key: "onOverlayEntered", value: function onOverlayEntered() { this.bindDocumentClickListener(); this.bindScrollListener(); this.bindResizeListener(); this.props.onShow && this.props.onShow(); } }, { key: "onOverlayExit", value: function onOverlayExit() { this.unbindDocumentClickListener(); this.unbindScrollListener(); this.unbindResizeListener(); } }, { key: "onOverlayExited", value: function onOverlayExited() { ZIndexUtils.clear(this.overlayRef.current); this.props.onHide && this.props.onHide(); } }, { key: "alignOverlay", value: function alignOverlay() { DomHandler.alignOverlay(this.overlayRef.current, this.defaultButton.parentElement, this.props.appendTo || PrimeReact.appendTo); } }, { key: "bindDocumentClickListener", value: function bindDocumentClickListener() { var _this2 = this; if (!this.documentClickListener) { this.documentClickListener = function (event) { if (_this2.state.overlayVisible && _this2.isOutsideClicked(event)) { _this2.hide(); } }; document.addEventListener('click', this.documentClickListener); } } }, { key: "bindScrollListener", value: function bindScrollListener() { var _this3 = this; if (!this.scrollHandler) { this.scrollHandler = new ConnectedOverlayScrollHandler(this.container, function () { if (_this3.state.overlayVisible) { _this3.hide(); } }); } this.scrollHandler.bindScrollListener(); } }, { key: "unbindScrollListener", value: function unbindScrollListener() { if (this.scrollHandler) { this.scrollHandler.unbindScrollListener(); } } }, { key: "bindResizeListener", value: function bindResizeListener() { var _this4 = this; if (!this.resizeListener) { this.resizeListener = function () { if (_this4.state.overlayVisible && !DomHandler.isAndroid()) { _this4.hide(); } }; window.addEventListener('resize', this.resizeListener); } } }, { key: "unbindResizeListener", value: function unbindResizeListener() { if (this.resizeListener) { window.removeEventListener('resize', this.resizeListener); this.resizeListener = null; } } }, { key: "isOutsideClicked", value: function isOutsideClicked(event) { return this.container && this.overlayRef && this.overlayRef.current && !this.overlayRef.current.contains(event.target); } }, { key: "unbindDocumentClickListener", value: function unbindDocumentClickListener() { if (this.documentClickListener) { document.removeEventListener('click', this.documentClickListener); this.documentClickListener = null; } } }, { key: "componentDidMount", value: function componentDidMount() { if (!this.state.id) { this.setState({ id: UniqueComponentId() }); } if (this.props.tooltip) { this.renderTooltip(); } } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (prevProps.tooltip !== this.props.tooltip || prevProps.tooltipOptions !== this.props.tooltipOptions) { if (this.tooltip) this.tooltip.update(_objectSpread({ content: this.props.tooltip }, this.props.tooltipOptions || {}));else this.renderTooltip(); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.unbindDocumentClickListener(); this.unbindResizeListener(); if (this.scrollHandler) { this.scrollHandler.destroy(); this.scrollHandler = null; } if (this.tooltip) { this.tooltip.destroy(); this.tooltip = null; } ZIndexUtils.clear(this.overlayRef.current); } }, { key: "renderTooltip", value: function renderTooltip() { this.tooltip = tip({ target: this.container, content: this.props.tooltip, options: this.props.tooltipOptions }); } }, { key: "renderItems", value: function renderItems() { var _this5 = this; if (this.props.model) { return this.props.model.map(function (menuitem, index) { return /*#__PURE__*/React.createElement(SplitButtonItem, { menuitem: menuitem, key: index, onItemClick: _this5.onItemClick }); }); } return null; } }, { key: "render", value: function render() { var _this6 = this; var className = classNames('p-splitbutton p-component', this.props.className, { 'p-disabled': this.props.disabled }); var items = this.renderItems(); var buttonContent = this.props.buttonTemplate ? ObjectUtils.getJSXElement(this.props.buttonTemplate, this.props) : null; return /*#__PURE__*/React.createElement("div", { id: this.state.id, className: className, style: this.props.style, ref: function ref(el) { return _this6.container = el; } }, /*#__PURE__*/React.createElement(Button, { ref: function ref(el) { return _this6.defaultButton = el; }, type: "button", className: "p-splitbutton-defaultbutton", icon: this.props.icon, label: this.props.label, onClick: this.props.onClick, disabled: this.props.disabled, tabIndex: this.props.tabIndex }, buttonContent), /*#__PURE__*/React.createElement(Button, { type: "button", className: "p-splitbutton-menubutton", icon: this.props.dropdownIcon, onClick: this.onDropdownButtonClick, disabled: this.props.disabled, "aria-expanded": this.state.overlayVisible, "aria-haspopup": true, "aria-owns": this.state.id + '_overlay' }), /*#__PURE__*/React.createElement(SplitButtonPanel, { ref: this.overlayRef, appendTo: this.props.appendTo, id: this.state.id + '_overlay', menuStyle: this.props.menuStyle, menuClassName: this.props.menuClassName, onClick: this.onPanelClick, in: this.state.overlayVisible, onEnter: this.onOverlayEnter, onEntered: this.onOverlayEntered, onExit: this.onOverlayExit, onExited: this.onOverlayExited, transitionOptions: this.props.transitionOptions }, items)); } }]); return SplitButton; }(Component); _defineProperty(SplitButton, "defaultProps", { id: null, label: null, icon: null, model: null, disabled: null, style: null, className: null, menuStyle: null, menuClassName: null, tabIndex: null, appendTo: null, tooltip: null, tooltipOptions: null, buttonTemplate: null, transitionOptions: null, dropdownIcon: 'pi pi-chevron-down', onClick: null, onShow: null, onHide: null }); export { SplitButton };
ajax/libs/boardgame-io/0.47.5/esm/react-native.js
cdnjs/cdnjs
import 'nanoid'; import { _ as _inherits, a as _createSuper, b as _createClass, c as _defineProperty, d as _classCallCheck, e as _objectWithoutProperties, f as _objectSpread2 } from './Debug-aaa66981.js'; import 'redux'; import './turn-order-8a6f1ac7.js'; import 'immer'; import 'lodash.isplainobject'; import './reducer-dead06cd.js'; import 'rfc6902'; import './initialize-46237421.js'; import './transport-0079de87.js'; import { C as Client$1 } from './client-2d7e4322.js'; import 'flatted'; import './ai-0694cbd2.js'; import React from 'react'; import PropTypes from 'prop-types'; var _excluded = ["matchID", "playerID"]; /** * Client * * boardgame.io React Native client. * * @param {...object} game - The return value of `Game`. * @param {...object} numPlayers - The number of players. * @param {...object} board - The React component for the game. * @param {...object} loading - (optional) The React component for the loading state. * @param {...object} multiplayer - Set to a falsy value or a transportFactory, e.g., SocketIO() * @param {...object} enhancer - Optional enhancer to send to the Redux store * * Returns: * A React Native component that wraps board and provides an * API through props for it to interact with the framework * and dispatch actions such as MAKE_MOVE. */ function Client(opts) { var _class, _temp; var game = opts.game, numPlayers = opts.numPlayers, board = opts.board, multiplayer = opts.multiplayer, enhancer = opts.enhancer; /* * WrappedBoard * * The main React component that wraps the passed in * board component and adds the API to its props. */ return _temp = _class = /*#__PURE__*/function (_React$Component) { _inherits(WrappedBoard, _React$Component); var _super = _createSuper(WrappedBoard); function WrappedBoard(props) { var _this; _classCallCheck(this, WrappedBoard); _this = _super.call(this, props); _this.client = Client$1({ game: game, numPlayers: numPlayers, multiplayer: multiplayer, matchID: props.matchID, playerID: props.playerID, credentials: props.credentials, debug: false, enhancer: enhancer }); return _this; } _createClass(WrappedBoard, [{ key: "componentDidMount", value: function componentDidMount() { var _this2 = this; this.unsubscribe = this.client.subscribe(function () { return _this2.forceUpdate(); }); this.client.start(); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.client.stop(); this.unsubscribe(); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (prevProps.matchID != this.props.matchID) { this.client.updateMatchID(this.props.matchID); } if (prevProps.playerID != this.props.playerID) { this.client.updatePlayerID(this.props.playerID); } if (prevProps.credentials != this.props.credentials) { this.client.updateCredentials(this.props.credentials); } } }, { key: "render", value: function render() { var _board = null; var state = this.client.getState(); var _this$props = this.props, matchID = _this$props.matchID, playerID = _this$props.playerID, rest = _objectWithoutProperties(_this$props, _excluded); if (board) { _board = /*#__PURE__*/React.createElement(board, _objectSpread2(_objectSpread2(_objectSpread2({}, state), rest), {}, { matchID: matchID, playerID: playerID, isMultiplayer: !!multiplayer, moves: this.client.moves, events: this.client.events, step: this.client.step, reset: this.client.reset, undo: this.client.undo, redo: this.client.redo, matchData: this.client.matchData, sendChatMessage: this.client.sendChatMessage, chatMessages: this.client.chatMessages })); } return _board; } }]); return WrappedBoard; }(React.Component), _defineProperty(_class, "propTypes", { // The ID of a game to connect to. // Only relevant in multiplayer. matchID: PropTypes.string, // The ID of the player associated with this client. // Only relevant in multiplayer. playerID: PropTypes.string, // This client's authentication credentials. // Only relevant in multiplayer. credentials: PropTypes.string }), _defineProperty(_class, "defaultProps", { matchID: 'default', playerID: null, credentials: null }), _temp; } export { Client };
ajax/libs/primereact/7.0.0/confirmdialog/confirmdialog.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; import ReactDOM from 'react-dom'; import { DomHandler, classNames, ObjectUtils, IconUtils } from 'primereact/utils'; import { Dialog } from 'primereact/dialog'; import { Button } from 'primereact/button'; import { localeOption } from 'primereact/api'; import { Portal } from 'primereact/portal'; function _extends() { _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; }; return _extends.apply(this, arguments); } 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); return Constructor; } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); } 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); } 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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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; } 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 _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 ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function confirmDialog(props) { var appendTo = props.appendTo || document.body; var confirmDialogWrapper = document.createDocumentFragment(); DomHandler.appendChild(confirmDialogWrapper, appendTo); props = _objectSpread(_objectSpread({}, props), { visible: props.visible === undefined ? true : props.visible }); var confirmDialogEl = /*#__PURE__*/React.createElement(ConfirmDialog, props); ReactDOM.render(confirmDialogEl, confirmDialogWrapper); var updateConfirmDialog = function updateConfirmDialog(newProps) { props = _objectSpread(_objectSpread({}, props), newProps); ReactDOM.render( /*#__PURE__*/React.cloneElement(confirmDialogEl, props), confirmDialogWrapper); }; return { _destroy: function _destroy() { ReactDOM.unmountComponentAtNode(confirmDialogWrapper); }, show: function show() { updateConfirmDialog({ visible: true, onHide: function onHide() { updateConfirmDialog({ visible: false }); // reset } }); }, hide: function hide() { updateConfirmDialog({ visible: false }); }, update: function update(newProps) { updateConfirmDialog(newProps); } }; } var ConfirmDialog = /*#__PURE__*/function (_Component) { _inherits(ConfirmDialog, _Component); var _super = _createSuper(ConfirmDialog); function ConfirmDialog(props) { var _this; _classCallCheck(this, ConfirmDialog); _this = _super.call(this, props); _this.state = { visible: props.visible }; _this.reject = _this.reject.bind(_assertThisInitialized(_this)); _this.accept = _this.accept.bind(_assertThisInitialized(_this)); _this.hide = _this.hide.bind(_assertThisInitialized(_this)); return _this; } _createClass(ConfirmDialog, [{ key: "acceptLabel", value: function acceptLabel() { return this.props.acceptLabel || localeOption('accept'); } }, { key: "rejectLabel", value: function rejectLabel() { return this.props.rejectLabel || localeOption('reject'); } }, { key: "accept", value: function accept() { if (this.props.accept) { this.props.accept(); } this.hide('accept'); } }, { key: "reject", value: function reject() { if (this.props.reject) { this.props.reject(); } this.hide('reject'); } }, { key: "show", value: function show() { this.setState({ visible: true }); } }, { key: "hide", value: function hide(result) { var _this2 = this; this.setState({ visible: false }, function () { if (_this2.props.onHide) { _this2.props.onHide(result); } }); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (prevProps.visible !== this.props.visible) { this.setState({ visible: this.props.visible }); } } }, { key: "renderFooter", value: function renderFooter() { var acceptClassName = classNames('p-confirm-dialog-accept', this.props.acceptClassName); var rejectClassName = classNames('p-confirm-dialog-reject', { 'p-button-text': !this.props.rejectClassName }, this.props.rejectClassName); var content = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, { label: this.rejectLabel(), icon: this.props.rejectIcon, className: rejectClassName, onClick: this.reject }), /*#__PURE__*/React.createElement(Button, { label: this.acceptLabel(), icon: this.props.acceptIcon, className: acceptClassName, onClick: this.accept, autoFocus: true })); if (this.props.footer) { var defaultContentOptions = { accept: this.accept, reject: this.reject, acceptClassName: acceptClassName, rejectClassName: rejectClassName, acceptLabel: this.acceptLabel(), rejectLabel: this.rejectLabel(), element: content, props: this.props }; return ObjectUtils.getJSXElement(this.props.footer, defaultContentOptions); } return content; } }, { key: "renderElement", value: function renderElement() { var className = classNames('p-confirm-dialog', this.props.className); var dialogProps = ObjectUtils.findDiffKeys(this.props, ConfirmDialog.defaultProps); var message = ObjectUtils.getJSXElement(this.props.message, this.props); var footer = this.renderFooter(); return /*#__PURE__*/React.createElement(Dialog, _extends({ visible: this.state.visible }, dialogProps, { className: className, footer: footer, onHide: this.hide, breakpoints: this.props.breakpoints }), IconUtils.getJSXIcon(this.props.icon, { className: 'p-confirm-dialog-icon' }, { props: this.props }), /*#__PURE__*/React.createElement("span", { className: "p-confirm-dialog-message" }, message)); } }, { key: "render", value: function render() { var element = this.renderElement(); return /*#__PURE__*/React.createElement(Portal, { element: element, appendTo: this.props.appendTo }); } }]); return ConfirmDialog; }(Component); _defineProperty(ConfirmDialog, "defaultProps", { visible: false, message: null, rejectLabel: null, acceptLabel: null, icon: null, rejectIcon: null, acceptIcon: null, rejectClassName: null, acceptClassName: null, className: null, appendTo: null, footer: null, breakpoints: null, onHide: null, accept: null, reject: null }); export { ConfirmDialog, confirmDialog };
ajax/libs/react-native-web/0.0.0-88ea3411/exports/RefreshControl/index.js
cdnjs/cdnjs
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } /** * Copyright (c) Nicolas Gallagher. * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ import View from '../View'; import React from 'react'; function RefreshControl(props) { var colors = props.colors, enabled = props.enabled, onRefresh = props.onRefresh, progressBackgroundColor = props.progressBackgroundColor, progressViewOffset = props.progressViewOffset, refreshing = props.refreshing, size = props.size, tintColor = props.tintColor, title = props.title, titleColor = props.titleColor, rest = _objectWithoutPropertiesLoose(props, ["colors", "enabled", "onRefresh", "progressBackgroundColor", "progressViewOffset", "refreshing", "size", "tintColor", "title", "titleColor"]); return /*#__PURE__*/React.createElement(View, rest); } export default RefreshControl;
ajax/libs/react-native-web/0.14.2/exports/Touchable/index.js
cdnjs/cdnjs
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * * @format */ 'use strict'; function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { 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; } import AccessibilityUtil from '../../modules/AccessibilityUtil'; import BoundingDimensions from './BoundingDimensions'; import findNodeHandle from '../findNodeHandle'; import normalizeColor from 'normalize-css-color'; import Position from './Position'; import React from 'react'; import UIManager from '../UIManager'; import View from '../View'; var extractSingleTouch = function extractSingleTouch(nativeEvent) { var touches = nativeEvent.touches; var changedTouches = nativeEvent.changedTouches; var hasTouches = touches && touches.length > 0; var hasChangedTouches = changedTouches && changedTouches.length > 0; return !hasTouches && hasChangedTouches ? changedTouches[0] : hasTouches ? touches[0] : nativeEvent; }; /** * `Touchable`: Taps done right. * * You hook your `ResponderEventPlugin` events into `Touchable`. `Touchable` * will measure time/geometry and tells you when to give feedback to the user. * * ====================== Touchable Tutorial =============================== * The `Touchable` mixin helps you handle the "press" interaction. It analyzes * the geometry of elements, and observes when another responder (scroll view * etc) has stolen the touch lock. It notifies your component when it should * give feedback to the user. (bouncing/highlighting/unhighlighting). * * - When a touch was activated (typically you highlight) * - When a touch was deactivated (typically you unhighlight) * - When a touch was "pressed" - a touch ended while still within the geometry * of the element, and no other element (like scroller) has "stolen" touch * lock ("responder") (Typically you bounce the element). * * A good tap interaction isn't as simple as you might think. There should be a * slight delay before showing a highlight when starting a touch. If a * subsequent touch move exceeds the boundary of the element, it should * unhighlight, but if that same touch is brought back within the boundary, it * should rehighlight again. A touch can move in and out of that boundary * several times, each time toggling highlighting, but a "press" is only * triggered if that touch ends while within the element's boundary and no * scroller (or anything else) has stolen the lock on touches. * * To create a new type of component that handles interaction using the * `Touchable` mixin, do the following: * * - Initialize the `Touchable` state. * * getInitialState: function() { * return merge(this.touchableGetInitialState(), yourComponentState); * } * * - Choose the rendered component who's touches should start the interactive * sequence. On that rendered node, forward all `Touchable` responder * handlers. You can choose any rendered node you like. Choose a node whose * hit target you'd like to instigate the interaction sequence: * * // In render function: * return ( * <View * onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder} * onResponderTerminationRequest={this.touchableHandleResponderTerminationRequest} * onResponderGrant={this.touchableHandleResponderGrant} * onResponderMove={this.touchableHandleResponderMove} * onResponderRelease={this.touchableHandleResponderRelease} * onResponderTerminate={this.touchableHandleResponderTerminate}> * <View> * Even though the hit detection/interactions are triggered by the * wrapping (typically larger) node, we usually end up implementing * custom logic that highlights this inner one. * </View> * </View> * ); * * - You may set up your own handlers for each of these events, so long as you * also invoke the `touchable*` handlers inside of your custom handler. * * - Implement the handlers on your component class in order to provide * feedback to the user. See documentation for each of these class methods * that you should implement. * * touchableHandlePress: function() { * this.performBounceAnimation(); // or whatever you want to do. * }, * touchableHandleActivePressIn: function() { * this.beginHighlighting(...); // Whatever you like to convey activation * }, * touchableHandleActivePressOut: function() { * this.endHighlighting(...); // Whatever you like to convey deactivation * }, * * - There are more advanced methods you can implement (see documentation below): * touchableGetHighlightDelayMS: function() { * return 20; * } * // In practice, *always* use a predeclared constant (conserve memory). * touchableGetPressRectOffset: function() { * return {top: 20, left: 20, right: 20, bottom: 100}; * } */ /** * Touchable states. */ var States = { NOT_RESPONDER: 'NOT_RESPONDER', // Not the responder RESPONDER_INACTIVE_PRESS_IN: 'RESPONDER_INACTIVE_PRESS_IN', // Responder, inactive, in the `PressRect` RESPONDER_INACTIVE_PRESS_OUT: 'RESPONDER_INACTIVE_PRESS_OUT', // Responder, inactive, out of `PressRect` RESPONDER_ACTIVE_PRESS_IN: 'RESPONDER_ACTIVE_PRESS_IN', // Responder, active, in the `PressRect` RESPONDER_ACTIVE_PRESS_OUT: 'RESPONDER_ACTIVE_PRESS_OUT', // Responder, active, out of `PressRect` RESPONDER_ACTIVE_LONG_PRESS_IN: 'RESPONDER_ACTIVE_LONG_PRESS_IN', // Responder, active, in the `PressRect`, after long press threshold RESPONDER_ACTIVE_LONG_PRESS_OUT: 'RESPONDER_ACTIVE_LONG_PRESS_OUT', // Responder, active, out of `PressRect`, after long press threshold ERROR: 'ERROR' }; /* * Quick lookup map for states that are considered to be "active" */ var baseStatesConditions = { NOT_RESPONDER: false, RESPONDER_INACTIVE_PRESS_IN: false, RESPONDER_INACTIVE_PRESS_OUT: false, RESPONDER_ACTIVE_PRESS_IN: false, RESPONDER_ACTIVE_PRESS_OUT: false, RESPONDER_ACTIVE_LONG_PRESS_IN: false, RESPONDER_ACTIVE_LONG_PRESS_OUT: false, ERROR: false }; var IsActive = _objectSpread({}, baseStatesConditions, { RESPONDER_ACTIVE_PRESS_OUT: true, RESPONDER_ACTIVE_PRESS_IN: true }); /** * Quick lookup for states that are considered to be "pressing" and are * therefore eligible to result in a "selection" if the press stops. */ var IsPressingIn = _objectSpread({}, baseStatesConditions, { RESPONDER_INACTIVE_PRESS_IN: true, RESPONDER_ACTIVE_PRESS_IN: true, RESPONDER_ACTIVE_LONG_PRESS_IN: true }); var IsLongPressingIn = _objectSpread({}, baseStatesConditions, { RESPONDER_ACTIVE_LONG_PRESS_IN: true }); /** * Inputs to the state machine. */ var Signals = { DELAY: 'DELAY', RESPONDER_GRANT: 'RESPONDER_GRANT', RESPONDER_RELEASE: 'RESPONDER_RELEASE', RESPONDER_TERMINATED: 'RESPONDER_TERMINATED', ENTER_PRESS_RECT: 'ENTER_PRESS_RECT', LEAVE_PRESS_RECT: 'LEAVE_PRESS_RECT', LONG_PRESS_DETECTED: 'LONG_PRESS_DETECTED' }; /** * Mapping from States x Signals => States */ var Transitions = { NOT_RESPONDER: { DELAY: States.ERROR, RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN, RESPONDER_RELEASE: States.ERROR, RESPONDER_TERMINATED: States.ERROR, ENTER_PRESS_RECT: States.ERROR, LEAVE_PRESS_RECT: States.ERROR, LONG_PRESS_DETECTED: States.ERROR }, RESPONDER_INACTIVE_PRESS_IN: { DELAY: States.RESPONDER_ACTIVE_PRESS_IN, RESPONDER_GRANT: States.ERROR, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN, LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT, LONG_PRESS_DETECTED: States.ERROR }, RESPONDER_INACTIVE_PRESS_OUT: { DELAY: States.RESPONDER_ACTIVE_PRESS_OUT, RESPONDER_GRANT: States.ERROR, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN, LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT, LONG_PRESS_DETECTED: States.ERROR }, RESPONDER_ACTIVE_PRESS_IN: { DELAY: States.ERROR, RESPONDER_GRANT: States.ERROR, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN, LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT, LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN }, RESPONDER_ACTIVE_PRESS_OUT: { DELAY: States.ERROR, RESPONDER_GRANT: States.ERROR, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN, LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT, LONG_PRESS_DETECTED: States.ERROR }, RESPONDER_ACTIVE_LONG_PRESS_IN: { DELAY: States.ERROR, RESPONDER_GRANT: States.ERROR, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN, LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT, LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN }, RESPONDER_ACTIVE_LONG_PRESS_OUT: { DELAY: States.ERROR, RESPONDER_GRANT: States.ERROR, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN, LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT, LONG_PRESS_DETECTED: States.ERROR }, error: { DELAY: States.NOT_RESPONDER, RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.NOT_RESPONDER, LEAVE_PRESS_RECT: States.NOT_RESPONDER, LONG_PRESS_DETECTED: States.NOT_RESPONDER } }; // ==== Typical Constants for integrating into UI components ==== // var HIT_EXPAND_PX = 20; // var HIT_VERT_OFFSET_PX = 10; var HIGHLIGHT_DELAY_MS = 130; var PRESS_EXPAND_PX = 20; var LONG_PRESS_THRESHOLD = 500; var LONG_PRESS_DELAY_MS = LONG_PRESS_THRESHOLD - HIGHLIGHT_DELAY_MS; var LONG_PRESS_ALLOWED_MOVEMENT = 10; // Default amount "active" region protrudes beyond box /** * By convention, methods prefixed with underscores are meant to be @private, * and not @protected. Mixers shouldn't access them - not even to provide them * as callback handlers. * * * ========== Geometry ========= * `Touchable` only assumes that there exists a `HitRect` node. The `PressRect` * is an abstract box that is extended beyond the `HitRect`. * * +--------------------------+ * | | - "Start" events in `HitRect` cause `HitRect` * | +--------------------+ | to become the responder. * | | +--------------+ | | - `HitRect` is typically expanded around * | | | | | | the `VisualRect`, but shifted downward. * | | | VisualRect | | | - After pressing down, after some delay, * | | | | | | and before letting up, the Visual React * | | +--------------+ | | will become "active". This makes it eligible * | | HitRect | | for being highlighted (so long as the * | +--------------------+ | press remains in the `PressRect`). * | PressRect o | * +----------------------|---+ * Out Region | * +-----+ This gap between the `HitRect` and * `PressRect` allows a touch to move far away * from the original hit rect, and remain * highlighted, and eligible for a "Press". * Customize this via * `touchableGetPressRectOffset()`. * * * * ======= State Machine ======= * * +-------------+ <---+ RESPONDER_RELEASE * |NOT_RESPONDER| * +-------------+ <---+ RESPONDER_TERMINATED * + * | RESPONDER_GRANT (HitRect) * v * +---------------------------+ DELAY +-------------------------+ T + DELAY +------------------------------+ * |RESPONDER_INACTIVE_PRESS_IN|+-------->|RESPONDER_ACTIVE_PRESS_IN| +------------> |RESPONDER_ACTIVE_LONG_PRESS_IN| * +---------------------------+ +-------------------------+ +------------------------------+ * + ^ + ^ + ^ * |LEAVE_ |ENTER_ |LEAVE_ |ENTER_ |LEAVE_ |ENTER_ * |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT * | | | | | | * v + v + v + * +----------------------------+ DELAY +--------------------------+ +-------------------------------+ * |RESPONDER_INACTIVE_PRESS_OUT|+------->|RESPONDER_ACTIVE_PRESS_OUT| |RESPONDER_ACTIVE_LONG_PRESS_OUT| * +----------------------------+ +--------------------------+ +-------------------------------+ * * T + DELAY => LONG_PRESS_DELAY_MS + DELAY * * Not drawn are the side effects of each transition. The most important side * effect is the `touchableHandlePress` abstract method invocation that occurs * when a responder is released while in either of the "Press" states. * * The other important side effects are the highlight abstract method * invocations (internal callbacks) to be implemented by the mixer. * * * @lends Touchable.prototype */ var TouchableMixin = { // HACK (part 1): basic support for touchable interactions using a keyboard componentDidMount: function componentDidMount() { var _this = this; this._touchableNode = findNodeHandle(this); if (this._touchableNode && this._touchableNode.addEventListener) { this._touchableBlurListener = function (e) { if (_this._isTouchableKeyboardActive) { if (_this.state.touchable.touchState && _this.state.touchable.touchState !== States.NOT_RESPONDER) { _this.touchableHandleResponderTerminate({ nativeEvent: e }); } _this._isTouchableKeyboardActive = false; } }; this._touchableNode.addEventListener('blur', this._touchableBlurListener); } }, /** * Clear all timeouts on unmount */ componentWillUnmount: function componentWillUnmount() { if (this._touchableNode && this._touchableNode.addEventListener) { this._touchableNode.removeEventListener('blur', this._touchableBlurListener); } this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout); this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout); this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout); }, /** * It's prefer that mixins determine state in this way, having the class * explicitly mix the state in the one and only `getInitialState` method. * * @return {object} State object to be placed inside of * `this.state.touchable`. */ touchableGetInitialState: function touchableGetInitialState() { return { touchable: { touchState: undefined, responderID: null } }; }, // ==== Hooks to Gesture Responder system ==== /** * Must return true if embedded in a native platform scroll view. */ touchableHandleResponderTerminationRequest: function touchableHandleResponderTerminationRequest() { return !this.props.rejectResponderTermination; }, /** * Must return true to start the process of `Touchable`. */ touchableHandleStartShouldSetResponder: function touchableHandleStartShouldSetResponder() { return !this.props.disabled; }, /** * Return true to cancel press on long press. */ touchableLongPressCancelsPress: function touchableLongPressCancelsPress() { return true; }, /** * Place as callback for a DOM element's `onResponderGrant` event. * @param {SyntheticEvent} e Synthetic event from event system. * */ touchableHandleResponderGrant: function touchableHandleResponderGrant(e) { var dispatchID = e.currentTarget; // Since e is used in a callback invoked on another event loop // (as in setTimeout etc), we need to call e.persist() on the // event to make sure it doesn't get reused in the event object pool. e.persist(); this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout); this.pressOutDelayTimeout = null; this.state.touchable.touchState = States.NOT_RESPONDER; this.state.touchable.responderID = dispatchID; this._receiveSignal(Signals.RESPONDER_GRANT, e); var delayMS = this.touchableGetHighlightDelayMS !== undefined ? Math.max(this.touchableGetHighlightDelayMS(), 0) : HIGHLIGHT_DELAY_MS; delayMS = isNaN(delayMS) ? HIGHLIGHT_DELAY_MS : delayMS; if (delayMS !== 0) { this.touchableDelayTimeout = setTimeout(this._handleDelay.bind(this, e), delayMS); } else { this._handleDelay(e); } var longDelayMS = this.touchableGetLongPressDelayMS !== undefined ? Math.max(this.touchableGetLongPressDelayMS(), 10) : LONG_PRESS_DELAY_MS; longDelayMS = isNaN(longDelayMS) ? LONG_PRESS_DELAY_MS : longDelayMS; this.longPressDelayTimeout = setTimeout(this._handleLongDelay.bind(this, e), longDelayMS + delayMS); }, /** * Place as callback for a DOM element's `onResponderRelease` event. */ touchableHandleResponderRelease: function touchableHandleResponderRelease(e) { this.pressInLocation = null; this._receiveSignal(Signals.RESPONDER_RELEASE, e); }, /** * Place as callback for a DOM element's `onResponderTerminate` event. */ touchableHandleResponderTerminate: function touchableHandleResponderTerminate(e) { this.pressInLocation = null; this._receiveSignal(Signals.RESPONDER_TERMINATED, e); }, /** * Place as callback for a DOM element's `onResponderMove` event. */ touchableHandleResponderMove: function touchableHandleResponderMove(e) { // Measurement may not have returned yet. if (!this.state.touchable.positionOnActivate) { return; } var positionOnActivate = this.state.touchable.positionOnActivate; var dimensionsOnActivate = this.state.touchable.dimensionsOnActivate; var pressRectOffset = this.touchableGetPressRectOffset ? this.touchableGetPressRectOffset() : { left: PRESS_EXPAND_PX, right: PRESS_EXPAND_PX, top: PRESS_EXPAND_PX, bottom: PRESS_EXPAND_PX }; var pressExpandLeft = pressRectOffset.left; var pressExpandTop = pressRectOffset.top; var pressExpandRight = pressRectOffset.right; var pressExpandBottom = pressRectOffset.bottom; var hitSlop = this.touchableGetHitSlop ? this.touchableGetHitSlop() : null; if (hitSlop) { pressExpandLeft += hitSlop.left || 0; pressExpandTop += hitSlop.top || 0; pressExpandRight += hitSlop.right || 0; pressExpandBottom += hitSlop.bottom || 0; } var touch = extractSingleTouch(e.nativeEvent); var pageX = touch && touch.pageX; var pageY = touch && touch.pageY; if (this.pressInLocation) { var movedDistance = this._getDistanceBetweenPoints(pageX, pageY, this.pressInLocation.pageX, this.pressInLocation.pageY); if (movedDistance > LONG_PRESS_ALLOWED_MOVEMENT) { this._cancelLongPressDelayTimeout(); } } var isTouchWithinActive = pageX > positionOnActivate.left - pressExpandLeft && pageY > positionOnActivate.top - pressExpandTop && pageX < positionOnActivate.left + dimensionsOnActivate.width + pressExpandRight && pageY < positionOnActivate.top + dimensionsOnActivate.height + pressExpandBottom; if (isTouchWithinActive) { var prevState = this.state.touchable.touchState; this._receiveSignal(Signals.ENTER_PRESS_RECT, e); var curState = this.state.touchable.touchState; if (curState === States.RESPONDER_INACTIVE_PRESS_IN && prevState !== States.RESPONDER_INACTIVE_PRESS_IN) { // fix for t7967420 this._cancelLongPressDelayTimeout(); } } else { this._cancelLongPressDelayTimeout(); this._receiveSignal(Signals.LEAVE_PRESS_RECT, e); } }, /** * Invoked when the item receives focus. Mixers might override this to * visually distinguish the `VisualRect` so that the user knows that it * currently has the focus. Most platforms only support a single element being * focused at a time, in which case there may have been a previously focused * element that was blurred just prior to this. This can be overridden when * using `Touchable.Mixin.withoutDefaultFocusAndBlur`. */ touchableHandleFocus: function touchableHandleFocus(e) { this.props.onFocus && this.props.onFocus(e); }, /** * Invoked when the item loses focus. Mixers might override this to * visually distinguish the `VisualRect` so that the user knows that it * no longer has focus. Most platforms only support a single element being * focused at a time, in which case the focus may have moved to another. * This can be overridden when using * `Touchable.Mixin.withoutDefaultFocusAndBlur`. */ touchableHandleBlur: function touchableHandleBlur(e) { this.props.onBlur && this.props.onBlur(e); }, // ==== Abstract Application Callbacks ==== /** * Invoked when the item should be highlighted. Mixers should implement this * to visually distinguish the `VisualRect` so that the user knows that * releasing a touch will result in a "selection" (analog to click). * * @abstract * touchableHandleActivePressIn: function, */ /** * Invoked when the item is "active" (in that it is still eligible to become * a "select") but the touch has left the `PressRect`. Usually the mixer will * want to unhighlight the `VisualRect`. If the user (while pressing) moves * back into the `PressRect` `touchableHandleActivePressIn` will be invoked * again and the mixer should probably highlight the `VisualRect` again. This * event will not fire on an `touchEnd/mouseUp` event, only move events while * the user is depressing the mouse/touch. * * @abstract * touchableHandleActivePressOut: function */ /** * Invoked when the item is "selected" - meaning the interaction ended by * letting up while the item was either in the state * `RESPONDER_ACTIVE_PRESS_IN` or `RESPONDER_INACTIVE_PRESS_IN`. * * @abstract * touchableHandlePress: function */ /** * Invoked when the item is long pressed - meaning the interaction ended by * letting up while the item was in `RESPONDER_ACTIVE_LONG_PRESS_IN`. If * `touchableHandleLongPress` is *not* provided, `touchableHandlePress` will * be called as it normally is. If `touchableHandleLongPress` is provided, by * default any `touchableHandlePress` callback will not be invoked. To * override this default behavior, override `touchableLongPressCancelsPress` * to return false. As a result, `touchableHandlePress` will be called when * lifting up, even if `touchableHandleLongPress` has also been called. * * @abstract * touchableHandleLongPress: function */ /** * Returns the number of millis to wait before triggering a highlight. * * @abstract * touchableGetHighlightDelayMS: function */ /** * Returns the amount to extend the `HitRect` into the `PressRect`. Positive * numbers mean the size expands outwards. * * @abstract * touchableGetPressRectOffset: function */ // ==== Internal Logic ==== /** * Measures the `HitRect` node on activation. The Bounding rectangle is with * respect to viewport - not page, so adding the `pageXOffset/pageYOffset` * should result in points that are in the same coordinate system as an * event's `globalX/globalY` data values. * * - Consider caching this for the lifetime of the component, or possibly * being able to share this cache between any `ScrollMap` view. * * @sideeffects * @private */ _remeasureMetricsOnActivation: function _remeasureMetricsOnActivation() { var tag = this.state.touchable.responderID; if (tag == null) { return; } UIManager.measure(tag, this._handleQueryLayout); }, _handleQueryLayout: function _handleQueryLayout(l, t, w, h, globalX, globalY) { //don't do anything UIManager failed to measure node if (!l && !t && !w && !h && !globalX && !globalY) { return; } this.state.touchable.positionOnActivate && Position.release(this.state.touchable.positionOnActivate); this.state.touchable.dimensionsOnActivate && // $FlowFixMe BoundingDimensions.release(this.state.touchable.dimensionsOnActivate); this.state.touchable.positionOnActivate = Position.getPooled(globalX, globalY); // $FlowFixMe this.state.touchable.dimensionsOnActivate = BoundingDimensions.getPooled(w, h); }, _handleDelay: function _handleDelay(e) { this.touchableDelayTimeout = null; this._receiveSignal(Signals.DELAY, e); }, _handleLongDelay: function _handleLongDelay(e) { this.longPressDelayTimeout = null; var curState = this.state.touchable.touchState; if (curState !== States.RESPONDER_ACTIVE_PRESS_IN && curState !== States.RESPONDER_ACTIVE_LONG_PRESS_IN) { console.error('Attempted to transition from state `' + curState + '` to `' + States.RESPONDER_ACTIVE_LONG_PRESS_IN + '`, which is not supported. This is ' + 'most likely due to `Touchable.longPressDelayTimeout` not being cancelled.'); } else { this._receiveSignal(Signals.LONG_PRESS_DETECTED, e); } }, /** * Receives a state machine signal, performs side effects of the transition * and stores the new state. Validates the transition as well. * * @param {Signals} signal State machine signal. * @throws Error if invalid state transition or unrecognized signal. * @sideeffects */ _receiveSignal: function _receiveSignal(signal, e) { var responderID = this.state.touchable.responderID; var curState = this.state.touchable.touchState; var nextState = Transitions[curState] && Transitions[curState][signal]; if (!responderID && signal === Signals.RESPONDER_RELEASE) { return; } if (!nextState) { throw new Error('Unrecognized signal `' + signal + '` or state `' + curState + '` for Touchable responder `' + responderID + '`'); } if (nextState === States.ERROR) { throw new Error('Touchable cannot transition from `' + curState + '` to `' + signal + '` for responder `' + responderID + '`'); } if (curState !== nextState) { this._performSideEffectsForTransition(curState, nextState, signal, e); this.state.touchable.touchState = nextState; } }, _cancelLongPressDelayTimeout: function _cancelLongPressDelayTimeout() { this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout); this.longPressDelayTimeout = null; }, _isHighlight: function _isHighlight(state) { return state === States.RESPONDER_ACTIVE_PRESS_IN || state === States.RESPONDER_ACTIVE_LONG_PRESS_IN; }, _savePressInLocation: function _savePressInLocation(e) { var touch = extractSingleTouch(e.nativeEvent); var pageX = touch && touch.pageX; var pageY = touch && touch.pageY; var locationX = touch && touch.locationX; var locationY = touch && touch.locationY; this.pressInLocation = { pageX: pageX, pageY: pageY, locationX: locationX, locationY: locationY }; }, _getDistanceBetweenPoints: function _getDistanceBetweenPoints(aX, aY, bX, bY) { var deltaX = aX - bX; var deltaY = aY - bY; return Math.sqrt(deltaX * deltaX + deltaY * deltaY); }, /** * Will perform a transition between touchable states, and identify any * highlighting or unhighlighting that must be performed for this particular * transition. * * @param {States} curState Current Touchable state. * @param {States} nextState Next Touchable state. * @param {Signal} signal Signal that triggered the transition. * @param {Event} e Native event. * @sideeffects */ _performSideEffectsForTransition: function _performSideEffectsForTransition(curState, nextState, signal, e) { var curIsHighlight = this._isHighlight(curState); var newIsHighlight = this._isHighlight(nextState); var isFinalSignal = signal === Signals.RESPONDER_TERMINATED || signal === Signals.RESPONDER_RELEASE; if (isFinalSignal) { this._cancelLongPressDelayTimeout(); } var isInitialTransition = curState === States.NOT_RESPONDER && nextState === States.RESPONDER_INACTIVE_PRESS_IN; var isActiveTransition = !IsActive[curState] && IsActive[nextState]; if (isInitialTransition || isActiveTransition) { this._remeasureMetricsOnActivation(); } if (IsPressingIn[curState] && signal === Signals.LONG_PRESS_DETECTED) { this.touchableHandleLongPress && this.touchableHandleLongPress(e); } if (newIsHighlight && !curIsHighlight) { this._startHighlight(e); } else if (!newIsHighlight && curIsHighlight) { this._endHighlight(e); } if (IsPressingIn[curState] && signal === Signals.RESPONDER_RELEASE) { var hasLongPressHandler = !!this.props.onLongPress; var pressIsLongButStillCallOnPress = IsLongPressingIn[curState] && ( // We *are* long pressing.. // But either has no long handler !hasLongPressHandler || !this.touchableLongPressCancelsPress()); // or we're told to ignore it. var shouldInvokePress = !IsLongPressingIn[curState] || pressIsLongButStillCallOnPress; if (shouldInvokePress && this.touchableHandlePress) { if (!newIsHighlight && !curIsHighlight) { // we never highlighted because of delay, but we should highlight now this._startHighlight(e); this._endHighlight(e); } this.touchableHandlePress(e); } } this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout); this.touchableDelayTimeout = null; }, _playTouchSound: function _playTouchSound() { UIManager.playTouchSound(); }, _startHighlight: function _startHighlight(e) { this._savePressInLocation(e); this.touchableHandleActivePressIn && this.touchableHandleActivePressIn(e); }, _endHighlight: function _endHighlight(e) { var _this2 = this; if (this.touchableHandleActivePressOut) { if (this.touchableGetPressOutDelayMS && this.touchableGetPressOutDelayMS()) { this.pressOutDelayTimeout = setTimeout(function () { _this2.touchableHandleActivePressOut(e); }, this.touchableGetPressOutDelayMS()); } else { this.touchableHandleActivePressOut(e); } } }, // HACK (part 2): basic support for touchable interactions using a keyboard (including // delays and longPress) touchableHandleKeyEvent: function touchableHandleKeyEvent(e) { var type = e.type, key = e.key; if (key === 'Enter' || key === ' ') { if (type === 'keydown') { if (!this._isTouchableKeyboardActive) { if (!this.state.touchable.touchState || this.state.touchable.touchState === States.NOT_RESPONDER) { this.touchableHandleResponderGrant(e); this._isTouchableKeyboardActive = true; } } } else if (type === 'keyup') { if (this._isTouchableKeyboardActive) { if (this.state.touchable.touchState && this.state.touchable.touchState !== States.NOT_RESPONDER) { this.touchableHandleResponderRelease(e); this._isTouchableKeyboardActive = false; } } } e.stopPropagation(); // prevent the default behaviour unless the Touchable functions as a link // and Enter is pressed if (!(key === 'Enter' && AccessibilityUtil.propsToAriaRole(this.props) === 'link')) { e.preventDefault(); } } }, withoutDefaultFocusAndBlur: {} }; /** * Provide an optional version of the mixin where `touchableHandleFocus` and * `touchableHandleBlur` can be overridden. This allows appropriate defaults to * be set on TV platforms, without breaking existing implementations of * `Touchable`. */ var touchableHandleFocus = TouchableMixin.touchableHandleFocus, touchableHandleBlur = TouchableMixin.touchableHandleBlur, TouchableMixinWithoutDefaultFocusAndBlur = _objectWithoutPropertiesLoose(TouchableMixin, ["touchableHandleFocus", "touchableHandleBlur"]); TouchableMixin.withoutDefaultFocusAndBlur = TouchableMixinWithoutDefaultFocusAndBlur; var Touchable = { Mixin: TouchableMixin, TOUCH_TARGET_DEBUG: false, // Highlights all touchable targets. Toggle with Inspector. /** * Renders a debugging overlay to visualize touch target with hitSlop (might not work on Android). */ renderDebugView: function renderDebugView(_ref) { var color = _ref.color, hitSlop = _ref.hitSlop; if (!Touchable.TOUCH_TARGET_DEBUG) { return null; } if (process.env.NODE_ENV !== 'production') { throw Error('Touchable.TOUCH_TARGET_DEBUG should not be enabled in prod!'); } var debugHitSlopStyle = {}; hitSlop = hitSlop || { top: 0, bottom: 0, left: 0, right: 0 }; for (var key in hitSlop) { debugHitSlopStyle[key] = -hitSlop[key]; } var normalizedColor = normalizeColor(color); if (typeof normalizedColor !== 'number') { return null; } var hexColor = '#' + ('00000000' + normalizedColor.toString(16)).substr(-8); return React.createElement(View, { pointerEvents: "none", style: _objectSpread({ position: 'absolute', borderColor: hexColor.slice(0, -2) + '55', // More opaque borderWidth: 1, borderStyle: 'dashed', backgroundColor: hexColor.slice(0, -2) + '0F' }, debugHitSlopStyle) }); } }; export default Touchable;
ajax/libs/primereact/7.0.0/tieredmenu/tieredmenu.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; import { DomHandler, classNames, ObjectUtils, ZIndexUtils, ConnectedOverlayScrollHandler } from 'primereact/utils'; import { Ripple } from 'primereact/ripple'; import { CSSTransition } from 'primereact/csstransition'; import { OverlayService } from 'primereact/overlayservice'; import { Portal } from 'primereact/portal'; import PrimeReact from 'primereact/api'; 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); return Constructor; } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); } 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); } 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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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; } function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); 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 _isNativeReflectConstruct$1() { 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; } } var TieredMenuSub = /*#__PURE__*/function (_Component) { _inherits(TieredMenuSub, _Component); var _super = _createSuper$1(TieredMenuSub); function TieredMenuSub(props) { var _this; _classCallCheck(this, TieredMenuSub); _this = _super.call(this, props); _this.state = { activeItem: null }; _this.onLeafClick = _this.onLeafClick.bind(_assertThisInitialized(_this)); _this.onChildItemKeyDown = _this.onChildItemKeyDown.bind(_assertThisInitialized(_this)); return _this; } _createClass(TieredMenuSub, [{ key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (prevProps.parentActive && !this.props.parentActive) { this.setState({ activeItem: null }); } if (this.props.parentActive && !this.props.root) { this.position(); } } }, { key: "componentDidMount", value: function componentDidMount() { var _this2 = this; if (!this.documentClickListener) { this.documentClickListener = function (event) { if (_this2.element && !_this2.element.contains(event.target)) { _this2.setState({ activeItem: null }); } }; document.addEventListener('click', this.documentClickListener); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { if (this.documentClickListener) { document.removeEventListener('click', this.documentClickListener); this.documentClickListener = null; } } }, { key: "position", value: function position() { if (this.element) { var parentItem = this.element.parentElement; var containerOffset = DomHandler.getOffset(parentItem); var viewport = DomHandler.getViewport(); var sublistWidth = this.element.offsetParent ? this.element.offsetWidth : DomHandler.getHiddenElementOuterWidth(this.element); var itemOuterWidth = DomHandler.getOuterWidth(parentItem.children[0]); if (parseInt(containerOffset.left, 10) + itemOuterWidth + sublistWidth > viewport.width - DomHandler.calculateScrollbarWidth()) { DomHandler.addClass(this.element, 'p-submenu-list-flipped'); } } } }, { key: "onItemMouseEnter", value: function onItemMouseEnter(event, item) { if (item.disabled) { event.preventDefault(); return; } if (this.props.root) { if (this.state.activeItem || this.props.popup) { this.setState({ activeItem: item }); } } else { this.setState({ activeItem: item }); } } }, { key: "onItemClick", value: function onItemClick(event, item) { if (item.disabled) { event.preventDefault(); return; } if (!item.url) { event.preventDefault(); } if (item.command) { item.command({ originalEvent: event, item: item }); } if (this.props.root) { if (item.items) { if (this.state.activeItem && item === this.state.activeItem) { this.setState({ activeItem: null }); } else { this.setState({ activeItem: item }); } } } if (!item.items) { this.onLeafClick(); } } }, { key: "onItemKeyDown", value: function onItemKeyDown(event, item) { var listItem = event.currentTarget.parentElement; switch (event.which) { //down case 40: var nextItem = this.findNextItem(listItem); if (nextItem) { nextItem.children[0].focus(); } event.preventDefault(); break; //up case 38: var prevItem = this.findPrevItem(listItem); if (prevItem) { prevItem.children[0].focus(); } event.preventDefault(); break; //right case 39: if (item.items) { this.setState({ activeItem: item }); setTimeout(function () { listItem.children[1].children[0].children[0].focus(); }, 50); } event.preventDefault(); break; } if (this.props.onKeyDown) { this.props.onKeyDown(event, listItem); } } }, { key: "onChildItemKeyDown", value: function onChildItemKeyDown(event, childListItem) { //left if (event.which === 37) { this.setState({ activeItem: null }); childListItem.parentElement.previousElementSibling.focus(); } } }, { key: "findNextItem", value: function findNextItem(item) { var nextItem = item.nextElementSibling; if (nextItem) return DomHandler.hasClass(nextItem, 'p-disabled') || !DomHandler.hasClass(nextItem, 'p-menuitem') ? this.findNextItem(nextItem) : nextItem;else return null; } }, { key: "findPrevItem", value: function findPrevItem(item) { var prevItem = item.previousElementSibling; if (prevItem) return DomHandler.hasClass(prevItem, 'p-disabled') || !DomHandler.hasClass(prevItem, 'p-menuitem') ? this.findPrevItem(prevItem) : prevItem;else return null; } }, { key: "onLeafClick", value: function onLeafClick() { this.setState({ activeItem: null }); if (this.props.onLeafClick) { this.props.onLeafClick(); } } }, { key: "renderSeparator", value: function renderSeparator(index) { return /*#__PURE__*/React.createElement("li", { key: 'separator_' + index, className: "p-menu-separator", role: "separator" }); } }, { key: "renderSubmenu", value: function renderSubmenu(item) { if (item.items) { return /*#__PURE__*/React.createElement(TieredMenuSub, { model: item.items, onLeafClick: this.onLeafClick, popup: this.props.popup, onKeyDown: this.onChildItemKeyDown, parentActive: item === this.state.activeItem }); } return null; } }, { key: "renderMenuitem", value: function renderMenuitem(item, index) { var _this3 = this; var active = this.state.activeItem === item; var className = classNames('p-menuitem', { 'p-menuitem-active': active }, item.className); var linkClassName = classNames('p-menuitem-link', { 'p-disabled': item.disabled }); var iconClassName = classNames('p-menuitem-icon', item.icon); var submenuIconClassName = 'p-submenu-icon pi pi-angle-right'; var icon = item.icon && /*#__PURE__*/React.createElement("span", { className: iconClassName }); var label = item.label && /*#__PURE__*/React.createElement("span", { className: "p-menuitem-text" }, item.label); var submenuIcon = item.items && /*#__PURE__*/React.createElement("span", { className: submenuIconClassName }); var submenu = this.renderSubmenu(item); var content = /*#__PURE__*/React.createElement("a", { href: item.url || '#', className: linkClassName, target: item.target, role: "menuitem", "aria-haspopup": item.items != null, onClick: function onClick(event) { return _this3.onItemClick(event, item); }, onKeyDown: function onKeyDown(event) { return _this3.onItemKeyDown(event, item); }, "aria-disabled": item.disabled }, icon, label, submenuIcon, /*#__PURE__*/React.createElement(Ripple, null)); if (item.template) { var defaultContentOptions = { onClick: function onClick(event) { return _this3.onItemClick(event, item); }, onKeyDown: function onKeyDown(event) { return _this3.onItemKeyDown(event, item); }, className: linkClassName, labelClassName: 'p-menuitem-text', iconClassName: iconClassName, submenuIconClassName: submenuIconClassName, element: content, props: this.props, active: active }; content = ObjectUtils.getJSXElement(item.template, item, defaultContentOptions); } return /*#__PURE__*/React.createElement("li", { key: item.label + '_' + index, className: className, style: item.style, onMouseEnter: function onMouseEnter(event) { return _this3.onItemMouseEnter(event, item); }, role: "none" }, content, submenu); } }, { key: "renderItem", value: function renderItem(item, index) { if (item.separator) return this.renderSeparator(index);else return this.renderMenuitem(item, index); } }, { key: "renderMenu", value: function renderMenu() { var _this4 = this; if (this.props.model) { return this.props.model.map(function (item, index) { return _this4.renderItem(item, index); }); } return null; } }, { key: "render", value: function render() { var _this5 = this; var className = classNames({ 'p-submenu-list': !this.props.root }); var submenu = this.renderMenu(); return /*#__PURE__*/React.createElement("ul", { ref: function ref(el) { return _this5.element = el; }, className: className, role: this.props.root ? 'menubar' : 'menu', "aria-orientation": "horizontal" }, submenu); } }]); return TieredMenuSub; }(Component); _defineProperty(TieredMenuSub, "defaultProps", { model: null, root: false, className: null, popup: false, onLeafClick: null, onKeyDown: null, parentActive: false }); 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 _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; } } var TieredMenu = /*#__PURE__*/function (_Component) { _inherits(TieredMenu, _Component); var _super = _createSuper(TieredMenu); function TieredMenu(props) { var _this; _classCallCheck(this, TieredMenu); _this = _super.call(this, props); _this.state = { visible: !props.popup }; _this.onEnter = _this.onEnter.bind(_assertThisInitialized(_this)); _this.onEntered = _this.onEntered.bind(_assertThisInitialized(_this)); _this.onExit = _this.onExit.bind(_assertThisInitialized(_this)); _this.onExited = _this.onExited.bind(_assertThisInitialized(_this)); _this.onPanelClick = _this.onPanelClick.bind(_assertThisInitialized(_this)); _this.menuRef = /*#__PURE__*/React.createRef(); return _this; } _createClass(TieredMenu, [{ key: "onPanelClick", value: function onPanelClick(event) { if (this.props.popup) { OverlayService.emit('overlay-click', { originalEvent: event, target: this.target }); } } }, { key: "toggle", value: function toggle(event) { if (this.props.popup) { if (this.state.visible) this.hide(event);else this.show(event); } } }, { key: "show", value: function show(event) { var _this2 = this; this.target = event.currentTarget; var currentEvent = event; this.setState({ visible: true }, function () { if (_this2.props.onShow) { _this2.props.onShow(currentEvent); } }); } }, { key: "hide", value: function hide(event) { var _this3 = this; var currentEvent = event; this.setState({ visible: false }, function () { if (_this3.props.onHide) { _this3.props.onHide(currentEvent); } }); } }, { key: "onEnter", value: function onEnter() { if (this.props.autoZIndex) { ZIndexUtils.set('menu', this.menuRef.current, PrimeReact.autoZIndex, this.props.baseZIndex || PrimeReact.zIndex['menu']); } DomHandler.absolutePosition(this.menuRef.current, this.target); } }, { key: "onEntered", value: function onEntered() { this.bindDocumentListeners(); this.bindScrollListener(); } }, { key: "onExit", value: function onExit() { this.target = null; this.unbindDocumentListeners(); this.unbindScrollListener(); } }, { key: "onExited", value: function onExited() { ZIndexUtils.clear(this.menuRef.current); } }, { key: "bindDocumentListeners", value: function bindDocumentListeners() { this.bindDocumentClickListener(); this.bindDocumentResizeListener(); } }, { key: "unbindDocumentListeners", value: function unbindDocumentListeners() { this.unbindDocumentClickListener(); this.unbindDocumentResizeListener(); } }, { key: "bindDocumentClickListener", value: function bindDocumentClickListener() { var _this4 = this; if (!this.documentClickListener) { this.documentClickListener = function (event) { if (_this4.props.popup && _this4.state.visible && _this4.menuRef.current && !_this4.menuRef.current.contains(event.target)) { _this4.hide(event); } }; document.addEventListener('click', this.documentClickListener); } } }, { key: "unbindDocumentClickListener", value: function unbindDocumentClickListener() { if (this.documentClickListener) { document.removeEventListener('click', this.documentClickListener); this.documentClickListener = null; } } }, { key: "bindDocumentResizeListener", value: function bindDocumentResizeListener() { var _this5 = this; if (!this.documentResizeListener) { this.documentResizeListener = function (event) { if (_this5.state.visible && !DomHandler.isAndroid()) { _this5.hide(event); } }; window.addEventListener('resize', this.documentResizeListener); } } }, { key: "unbindDocumentResizeListener", value: function unbindDocumentResizeListener() { if (this.documentResizeListener) { window.removeEventListener('resize', this.documentResizeListener); this.documentResizeListener = null; } } }, { key: "bindScrollListener", value: function bindScrollListener() { var _this6 = this; if (!this.scrollHandler) { this.scrollHandler = new ConnectedOverlayScrollHandler(this.target, function (event) { if (_this6.state.visible) { _this6.hide(event); } }); } this.scrollHandler.bindScrollListener(); } }, { key: "unbindScrollListener", value: function unbindScrollListener() { if (this.scrollHandler) { this.scrollHandler.unbindScrollListener(); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.unbindDocumentListeners(); if (this.scrollHandler) { this.scrollHandler.destroy(); this.scrollHandler = null; } ZIndexUtils.clear(this.menuRef.current); } }, { key: "renderElement", value: function renderElement() { var className = classNames('p-tieredmenu p-component', { 'p-tieredmenu-overlay': this.props.popup }, this.props.className); return /*#__PURE__*/React.createElement(CSSTransition, { nodeRef: this.menuRef, classNames: "p-connected-overlay", in: this.state.visible, timeout: { enter: 120, exit: 100 }, options: this.props.transitionOptions, unmountOnExit: true, onEnter: this.onEnter, onEntered: this.onEntered, onExit: this.onExit, onExited: this.onExited }, /*#__PURE__*/React.createElement("div", { ref: this.menuRef, id: this.props.id, className: className, style: this.props.style, onClick: this.onPanelClick }, /*#__PURE__*/React.createElement(TieredMenuSub, { model: this.props.model, root: true, popup: this.props.popup }))); } }, { key: "render", value: function render() { var element = this.renderElement(); return this.props.popup ? /*#__PURE__*/React.createElement(Portal, { element: element, appendTo: this.props.appendTo }) : element; } }]); return TieredMenu; }(Component); _defineProperty(TieredMenu, "defaultProps", { id: null, model: null, popup: false, style: null, className: null, autoZIndex: true, baseZIndex: 0, appendTo: null, transitionOptions: null, onShow: null, onHide: null }); export { TieredMenu };
ajax/libs/react-native-web/0.17.5/exports/Touchable/index.js
cdnjs/cdnjs
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * * @format */ 'use strict'; function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { 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; } import AccessibilityUtil from '../../modules/AccessibilityUtil'; import BoundingDimensions from './BoundingDimensions'; import findNodeHandle from '../findNodeHandle'; import normalizeColor from 'normalize-css-color'; import Position from './Position'; import React from 'react'; import UIManager from '../UIManager'; import View from '../View'; var extractSingleTouch = function extractSingleTouch(nativeEvent) { var touches = nativeEvent.touches; var changedTouches = nativeEvent.changedTouches; var hasTouches = touches && touches.length > 0; var hasChangedTouches = changedTouches && changedTouches.length > 0; return !hasTouches && hasChangedTouches ? changedTouches[0] : hasTouches ? touches[0] : nativeEvent; }; /** * `Touchable`: Taps done right. * * You hook your `ResponderEventPlugin` events into `Touchable`. `Touchable` * will measure time/geometry and tells you when to give feedback to the user. * * ====================== Touchable Tutorial =============================== * The `Touchable` mixin helps you handle the "press" interaction. It analyzes * the geometry of elements, and observes when another responder (scroll view * etc) has stolen the touch lock. It notifies your component when it should * give feedback to the user. (bouncing/highlighting/unhighlighting). * * - When a touch was activated (typically you highlight) * - When a touch was deactivated (typically you unhighlight) * - When a touch was "pressed" - a touch ended while still within the geometry * of the element, and no other element (like scroller) has "stolen" touch * lock ("responder") (Typically you bounce the element). * * A good tap interaction isn't as simple as you might think. There should be a * slight delay before showing a highlight when starting a touch. If a * subsequent touch move exceeds the boundary of the element, it should * unhighlight, but if that same touch is brought back within the boundary, it * should rehighlight again. A touch can move in and out of that boundary * several times, each time toggling highlighting, but a "press" is only * triggered if that touch ends while within the element's boundary and no * scroller (or anything else) has stolen the lock on touches. * * To create a new type of component that handles interaction using the * `Touchable` mixin, do the following: * * - Initialize the `Touchable` state. * * getInitialState: function() { * return merge(this.touchableGetInitialState(), yourComponentState); * } * * - Choose the rendered component who's touches should start the interactive * sequence. On that rendered node, forward all `Touchable` responder * handlers. You can choose any rendered node you like. Choose a node whose * hit target you'd like to instigate the interaction sequence: * * // In render function: * return ( * <View * onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder} * onResponderTerminationRequest={this.touchableHandleResponderTerminationRequest} * onResponderGrant={this.touchableHandleResponderGrant} * onResponderMove={this.touchableHandleResponderMove} * onResponderRelease={this.touchableHandleResponderRelease} * onResponderTerminate={this.touchableHandleResponderTerminate}> * <View> * Even though the hit detection/interactions are triggered by the * wrapping (typically larger) node, we usually end up implementing * custom logic that highlights this inner one. * </View> * </View> * ); * * - You may set up your own handlers for each of these events, so long as you * also invoke the `touchable*` handlers inside of your custom handler. * * - Implement the handlers on your component class in order to provide * feedback to the user. See documentation for each of these class methods * that you should implement. * * touchableHandlePress: function() { * this.performBounceAnimation(); // or whatever you want to do. * }, * touchableHandleActivePressIn: function() { * this.beginHighlighting(...); // Whatever you like to convey activation * }, * touchableHandleActivePressOut: function() { * this.endHighlighting(...); // Whatever you like to convey deactivation * }, * * - There are more advanced methods you can implement (see documentation below): * touchableGetHighlightDelayMS: function() { * return 20; * } * // In practice, *always* use a predeclared constant (conserve memory). * touchableGetPressRectOffset: function() { * return {top: 20, left: 20, right: 20, bottom: 100}; * } */ /** * Touchable states. */ var States = { NOT_RESPONDER: 'NOT_RESPONDER', // Not the responder RESPONDER_INACTIVE_PRESS_IN: 'RESPONDER_INACTIVE_PRESS_IN', // Responder, inactive, in the `PressRect` RESPONDER_INACTIVE_PRESS_OUT: 'RESPONDER_INACTIVE_PRESS_OUT', // Responder, inactive, out of `PressRect` RESPONDER_ACTIVE_PRESS_IN: 'RESPONDER_ACTIVE_PRESS_IN', // Responder, active, in the `PressRect` RESPONDER_ACTIVE_PRESS_OUT: 'RESPONDER_ACTIVE_PRESS_OUT', // Responder, active, out of `PressRect` RESPONDER_ACTIVE_LONG_PRESS_IN: 'RESPONDER_ACTIVE_LONG_PRESS_IN', // Responder, active, in the `PressRect`, after long press threshold RESPONDER_ACTIVE_LONG_PRESS_OUT: 'RESPONDER_ACTIVE_LONG_PRESS_OUT', // Responder, active, out of `PressRect`, after long press threshold ERROR: 'ERROR' }; /* * Quick lookup map for states that are considered to be "active" */ var baseStatesConditions = { NOT_RESPONDER: false, RESPONDER_INACTIVE_PRESS_IN: false, RESPONDER_INACTIVE_PRESS_OUT: false, RESPONDER_ACTIVE_PRESS_IN: false, RESPONDER_ACTIVE_PRESS_OUT: false, RESPONDER_ACTIVE_LONG_PRESS_IN: false, RESPONDER_ACTIVE_LONG_PRESS_OUT: false, ERROR: false }; var IsActive = _objectSpread(_objectSpread({}, baseStatesConditions), {}, { RESPONDER_ACTIVE_PRESS_OUT: true, RESPONDER_ACTIVE_PRESS_IN: true }); /** * Quick lookup for states that are considered to be "pressing" and are * therefore eligible to result in a "selection" if the press stops. */ var IsPressingIn = _objectSpread(_objectSpread({}, baseStatesConditions), {}, { RESPONDER_INACTIVE_PRESS_IN: true, RESPONDER_ACTIVE_PRESS_IN: true, RESPONDER_ACTIVE_LONG_PRESS_IN: true }); var IsLongPressingIn = _objectSpread(_objectSpread({}, baseStatesConditions), {}, { RESPONDER_ACTIVE_LONG_PRESS_IN: true }); /** * Inputs to the state machine. */ var Signals = { DELAY: 'DELAY', RESPONDER_GRANT: 'RESPONDER_GRANT', RESPONDER_RELEASE: 'RESPONDER_RELEASE', RESPONDER_TERMINATED: 'RESPONDER_TERMINATED', ENTER_PRESS_RECT: 'ENTER_PRESS_RECT', LEAVE_PRESS_RECT: 'LEAVE_PRESS_RECT', LONG_PRESS_DETECTED: 'LONG_PRESS_DETECTED' }; /** * Mapping from States x Signals => States */ var Transitions = { NOT_RESPONDER: { DELAY: States.ERROR, RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN, RESPONDER_RELEASE: States.ERROR, RESPONDER_TERMINATED: States.ERROR, ENTER_PRESS_RECT: States.ERROR, LEAVE_PRESS_RECT: States.ERROR, LONG_PRESS_DETECTED: States.ERROR }, RESPONDER_INACTIVE_PRESS_IN: { DELAY: States.RESPONDER_ACTIVE_PRESS_IN, RESPONDER_GRANT: States.ERROR, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN, LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT, LONG_PRESS_DETECTED: States.ERROR }, RESPONDER_INACTIVE_PRESS_OUT: { DELAY: States.RESPONDER_ACTIVE_PRESS_OUT, RESPONDER_GRANT: States.ERROR, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN, LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT, LONG_PRESS_DETECTED: States.ERROR }, RESPONDER_ACTIVE_PRESS_IN: { DELAY: States.ERROR, RESPONDER_GRANT: States.ERROR, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN, LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT, LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN }, RESPONDER_ACTIVE_PRESS_OUT: { DELAY: States.ERROR, RESPONDER_GRANT: States.ERROR, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN, LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT, LONG_PRESS_DETECTED: States.ERROR }, RESPONDER_ACTIVE_LONG_PRESS_IN: { DELAY: States.ERROR, RESPONDER_GRANT: States.ERROR, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN, LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT, LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN }, RESPONDER_ACTIVE_LONG_PRESS_OUT: { DELAY: States.ERROR, RESPONDER_GRANT: States.ERROR, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN, LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT, LONG_PRESS_DETECTED: States.ERROR }, error: { DELAY: States.NOT_RESPONDER, RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.NOT_RESPONDER, LEAVE_PRESS_RECT: States.NOT_RESPONDER, LONG_PRESS_DETECTED: States.NOT_RESPONDER } }; // ==== Typical Constants for integrating into UI components ==== // var HIT_EXPAND_PX = 20; // var HIT_VERT_OFFSET_PX = 10; var HIGHLIGHT_DELAY_MS = 130; var PRESS_EXPAND_PX = 20; var LONG_PRESS_THRESHOLD = 500; var LONG_PRESS_DELAY_MS = LONG_PRESS_THRESHOLD - HIGHLIGHT_DELAY_MS; var LONG_PRESS_ALLOWED_MOVEMENT = 10; // Default amount "active" region protrudes beyond box /** * By convention, methods prefixed with underscores are meant to be @private, * and not @protected. Mixers shouldn't access them - not even to provide them * as callback handlers. * * * ========== Geometry ========= * `Touchable` only assumes that there exists a `HitRect` node. The `PressRect` * is an abstract box that is extended beyond the `HitRect`. * * +--------------------------+ * | | - "Start" events in `HitRect` cause `HitRect` * | +--------------------+ | to become the responder. * | | +--------------+ | | - `HitRect` is typically expanded around * | | | | | | the `VisualRect`, but shifted downward. * | | | VisualRect | | | - After pressing down, after some delay, * | | | | | | and before letting up, the Visual React * | | +--------------+ | | will become "active". This makes it eligible * | | HitRect | | for being highlighted (so long as the * | +--------------------+ | press remains in the `PressRect`). * | PressRect o | * +----------------------|---+ * Out Region | * +-----+ This gap between the `HitRect` and * `PressRect` allows a touch to move far away * from the original hit rect, and remain * highlighted, and eligible for a "Press". * Customize this via * `touchableGetPressRectOffset()`. * * * * ======= State Machine ======= * * +-------------+ <---+ RESPONDER_RELEASE * |NOT_RESPONDER| * +-------------+ <---+ RESPONDER_TERMINATED * + * | RESPONDER_GRANT (HitRect) * v * +---------------------------+ DELAY +-------------------------+ T + DELAY +------------------------------+ * |RESPONDER_INACTIVE_PRESS_IN|+-------->|RESPONDER_ACTIVE_PRESS_IN| +------------> |RESPONDER_ACTIVE_LONG_PRESS_IN| * +---------------------------+ +-------------------------+ +------------------------------+ * + ^ + ^ + ^ * |LEAVE_ |ENTER_ |LEAVE_ |ENTER_ |LEAVE_ |ENTER_ * |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT * | | | | | | * v + v + v + * +----------------------------+ DELAY +--------------------------+ +-------------------------------+ * |RESPONDER_INACTIVE_PRESS_OUT|+------->|RESPONDER_ACTIVE_PRESS_OUT| |RESPONDER_ACTIVE_LONG_PRESS_OUT| * +----------------------------+ +--------------------------+ +-------------------------------+ * * T + DELAY => LONG_PRESS_DELAY_MS + DELAY * * Not drawn are the side effects of each transition. The most important side * effect is the `touchableHandlePress` abstract method invocation that occurs * when a responder is released while in either of the "Press" states. * * The other important side effects are the highlight abstract method * invocations (internal callbacks) to be implemented by the mixer. * * * @lends Touchable.prototype */ var TouchableMixin = { // HACK (part 1): basic support for touchable interactions using a keyboard componentDidMount: function componentDidMount() { var _this = this; this._touchableNode = findNodeHandle(this); if (this._touchableNode && this._touchableNode.addEventListener) { this._touchableBlurListener = function (e) { if (_this._isTouchableKeyboardActive) { if (_this.state.touchable.touchState && _this.state.touchable.touchState !== States.NOT_RESPONDER) { _this.touchableHandleResponderTerminate({ nativeEvent: e }); } _this._isTouchableKeyboardActive = false; } }; this._touchableNode.addEventListener('blur', this._touchableBlurListener); } }, /** * Clear all timeouts on unmount */ componentWillUnmount: function componentWillUnmount() { if (this._touchableNode && this._touchableNode.addEventListener) { this._touchableNode.removeEventListener('blur', this._touchableBlurListener); } this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout); this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout); this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout); // Clear DOM nodes this.pressInLocation = null; this.state.touchable.responderID = null; this._touchableNode = null; }, /** * It's prefer that mixins determine state in this way, having the class * explicitly mix the state in the one and only `getInitialState` method. * * @return {object} State object to be placed inside of * `this.state.touchable`. */ touchableGetInitialState: function touchableGetInitialState() { return { touchable: { touchState: undefined, responderID: null } }; }, // ==== Hooks to Gesture Responder system ==== /** * Must return true if embedded in a native platform scroll view. */ touchableHandleResponderTerminationRequest: function touchableHandleResponderTerminationRequest() { return !this.props.rejectResponderTermination; }, /** * Must return true to start the process of `Touchable`. */ touchableHandleStartShouldSetResponder: function touchableHandleStartShouldSetResponder() { return !this.props.disabled; }, /** * Return true to cancel press on long press. */ touchableLongPressCancelsPress: function touchableLongPressCancelsPress() { return true; }, /** * Place as callback for a DOM element's `onResponderGrant` event. * @param {SyntheticEvent} e Synthetic event from event system. * */ touchableHandleResponderGrant: function touchableHandleResponderGrant(e) { var dispatchID = e.currentTarget; // Since e is used in a callback invoked on another event loop // (as in setTimeout etc), we need to call e.persist() on the // event to make sure it doesn't get reused in the event object pool. e.persist(); this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout); this.pressOutDelayTimeout = null; this.state.touchable.touchState = States.NOT_RESPONDER; this.state.touchable.responderID = dispatchID; this._receiveSignal(Signals.RESPONDER_GRANT, e); var delayMS = this.touchableGetHighlightDelayMS !== undefined ? Math.max(this.touchableGetHighlightDelayMS(), 0) : HIGHLIGHT_DELAY_MS; delayMS = isNaN(delayMS) ? HIGHLIGHT_DELAY_MS : delayMS; if (delayMS !== 0) { this.touchableDelayTimeout = setTimeout(this._handleDelay.bind(this, e), delayMS); } else { this._handleDelay(e); } var longDelayMS = this.touchableGetLongPressDelayMS !== undefined ? Math.max(this.touchableGetLongPressDelayMS(), 10) : LONG_PRESS_DELAY_MS; longDelayMS = isNaN(longDelayMS) ? LONG_PRESS_DELAY_MS : longDelayMS; this.longPressDelayTimeout = setTimeout(this._handleLongDelay.bind(this, e), longDelayMS + delayMS); }, /** * Place as callback for a DOM element's `onResponderRelease` event. */ touchableHandleResponderRelease: function touchableHandleResponderRelease(e) { this.pressInLocation = null; this._receiveSignal(Signals.RESPONDER_RELEASE, e); }, /** * Place as callback for a DOM element's `onResponderTerminate` event. */ touchableHandleResponderTerminate: function touchableHandleResponderTerminate(e) { this.pressInLocation = null; this._receiveSignal(Signals.RESPONDER_TERMINATED, e); }, /** * Place as callback for a DOM element's `onResponderMove` event. */ touchableHandleResponderMove: function touchableHandleResponderMove(e) { // Measurement may not have returned yet. if (!this.state.touchable.positionOnActivate) { return; } var positionOnActivate = this.state.touchable.positionOnActivate; var dimensionsOnActivate = this.state.touchable.dimensionsOnActivate; var pressRectOffset = this.touchableGetPressRectOffset ? this.touchableGetPressRectOffset() : { left: PRESS_EXPAND_PX, right: PRESS_EXPAND_PX, top: PRESS_EXPAND_PX, bottom: PRESS_EXPAND_PX }; var pressExpandLeft = pressRectOffset.left; var pressExpandTop = pressRectOffset.top; var pressExpandRight = pressRectOffset.right; var pressExpandBottom = pressRectOffset.bottom; var hitSlop = this.touchableGetHitSlop ? this.touchableGetHitSlop() : null; if (hitSlop) { pressExpandLeft += hitSlop.left || 0; pressExpandTop += hitSlop.top || 0; pressExpandRight += hitSlop.right || 0; pressExpandBottom += hitSlop.bottom || 0; } var touch = extractSingleTouch(e.nativeEvent); var pageX = touch && touch.pageX; var pageY = touch && touch.pageY; if (this.pressInLocation) { var movedDistance = this._getDistanceBetweenPoints(pageX, pageY, this.pressInLocation.pageX, this.pressInLocation.pageY); if (movedDistance > LONG_PRESS_ALLOWED_MOVEMENT) { this._cancelLongPressDelayTimeout(); } } var isTouchWithinActive = pageX > positionOnActivate.left - pressExpandLeft && pageY > positionOnActivate.top - pressExpandTop && pageX < positionOnActivate.left + dimensionsOnActivate.width + pressExpandRight && pageY < positionOnActivate.top + dimensionsOnActivate.height + pressExpandBottom; if (isTouchWithinActive) { var prevState = this.state.touchable.touchState; this._receiveSignal(Signals.ENTER_PRESS_RECT, e); var curState = this.state.touchable.touchState; if (curState === States.RESPONDER_INACTIVE_PRESS_IN && prevState !== States.RESPONDER_INACTIVE_PRESS_IN) { // fix for t7967420 this._cancelLongPressDelayTimeout(); } } else { this._cancelLongPressDelayTimeout(); this._receiveSignal(Signals.LEAVE_PRESS_RECT, e); } }, /** * Invoked when the item receives focus. Mixers might override this to * visually distinguish the `VisualRect` so that the user knows that it * currently has the focus. Most platforms only support a single element being * focused at a time, in which case there may have been a previously focused * element that was blurred just prior to this. This can be overridden when * using `Touchable.Mixin.withoutDefaultFocusAndBlur`. */ touchableHandleFocus: function touchableHandleFocus(e) { this.props.onFocus && this.props.onFocus(e); }, /** * Invoked when the item loses focus. Mixers might override this to * visually distinguish the `VisualRect` so that the user knows that it * no longer has focus. Most platforms only support a single element being * focused at a time, in which case the focus may have moved to another. * This can be overridden when using * `Touchable.Mixin.withoutDefaultFocusAndBlur`. */ touchableHandleBlur: function touchableHandleBlur(e) { this.props.onBlur && this.props.onBlur(e); }, // ==== Abstract Application Callbacks ==== /** * Invoked when the item should be highlighted. Mixers should implement this * to visually distinguish the `VisualRect` so that the user knows that * releasing a touch will result in a "selection" (analog to click). * * @abstract * touchableHandleActivePressIn: function, */ /** * Invoked when the item is "active" (in that it is still eligible to become * a "select") but the touch has left the `PressRect`. Usually the mixer will * want to unhighlight the `VisualRect`. If the user (while pressing) moves * back into the `PressRect` `touchableHandleActivePressIn` will be invoked * again and the mixer should probably highlight the `VisualRect` again. This * event will not fire on an `touchEnd/mouseUp` event, only move events while * the user is depressing the mouse/touch. * * @abstract * touchableHandleActivePressOut: function */ /** * Invoked when the item is "selected" - meaning the interaction ended by * letting up while the item was either in the state * `RESPONDER_ACTIVE_PRESS_IN` or `RESPONDER_INACTIVE_PRESS_IN`. * * @abstract * touchableHandlePress: function */ /** * Invoked when the item is long pressed - meaning the interaction ended by * letting up while the item was in `RESPONDER_ACTIVE_LONG_PRESS_IN`. If * `touchableHandleLongPress` is *not* provided, `touchableHandlePress` will * be called as it normally is. If `touchableHandleLongPress` is provided, by * default any `touchableHandlePress` callback will not be invoked. To * override this default behavior, override `touchableLongPressCancelsPress` * to return false. As a result, `touchableHandlePress` will be called when * lifting up, even if `touchableHandleLongPress` has also been called. * * @abstract * touchableHandleLongPress: function */ /** * Returns the number of millis to wait before triggering a highlight. * * @abstract * touchableGetHighlightDelayMS: function */ /** * Returns the amount to extend the `HitRect` into the `PressRect`. Positive * numbers mean the size expands outwards. * * @abstract * touchableGetPressRectOffset: function */ // ==== Internal Logic ==== /** * Measures the `HitRect` node on activation. The Bounding rectangle is with * respect to viewport - not page, so adding the `pageXOffset/pageYOffset` * should result in points that are in the same coordinate system as an * event's `globalX/globalY` data values. * * - Consider caching this for the lifetime of the component, or possibly * being able to share this cache between any `ScrollMap` view. * * @sideeffects * @private */ _remeasureMetricsOnActivation: function _remeasureMetricsOnActivation() { var tag = this.state.touchable.responderID; if (tag == null) { return; } UIManager.measure(tag, this._handleQueryLayout); }, _handleQueryLayout: function _handleQueryLayout(l, t, w, h, globalX, globalY) { //don't do anything UIManager failed to measure node if (!l && !t && !w && !h && !globalX && !globalY) { return; } this.state.touchable.positionOnActivate && Position.release(this.state.touchable.positionOnActivate); this.state.touchable.dimensionsOnActivate && // $FlowFixMe BoundingDimensions.release(this.state.touchable.dimensionsOnActivate); this.state.touchable.positionOnActivate = Position.getPooled(globalX, globalY); // $FlowFixMe this.state.touchable.dimensionsOnActivate = BoundingDimensions.getPooled(w, h); }, _handleDelay: function _handleDelay(e) { this.touchableDelayTimeout = null; this._receiveSignal(Signals.DELAY, e); }, _handleLongDelay: function _handleLongDelay(e) { this.longPressDelayTimeout = null; var curState = this.state.touchable.touchState; if (curState !== States.RESPONDER_ACTIVE_PRESS_IN && curState !== States.RESPONDER_ACTIVE_LONG_PRESS_IN) { console.error('Attempted to transition from state `' + curState + '` to `' + States.RESPONDER_ACTIVE_LONG_PRESS_IN + '`, which is not supported. This is ' + 'most likely due to `Touchable.longPressDelayTimeout` not being cancelled.'); } else { this._receiveSignal(Signals.LONG_PRESS_DETECTED, e); } }, /** * Receives a state machine signal, performs side effects of the transition * and stores the new state. Validates the transition as well. * * @param {Signals} signal State machine signal. * @throws Error if invalid state transition or unrecognized signal. * @sideeffects */ _receiveSignal: function _receiveSignal(signal, e) { var responderID = this.state.touchable.responderID; var curState = this.state.touchable.touchState; var nextState = Transitions[curState] && Transitions[curState][signal]; if (!responderID && signal === Signals.RESPONDER_RELEASE) { return; } if (!nextState) { throw new Error('Unrecognized signal `' + signal + '` or state `' + curState + '` for Touchable responder `' + responderID + '`'); } if (nextState === States.ERROR) { throw new Error('Touchable cannot transition from `' + curState + '` to `' + signal + '` for responder `' + responderID + '`'); } if (curState !== nextState) { this._performSideEffectsForTransition(curState, nextState, signal, e); this.state.touchable.touchState = nextState; } }, _cancelLongPressDelayTimeout: function _cancelLongPressDelayTimeout() { this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout); this.longPressDelayTimeout = null; }, _isHighlight: function _isHighlight(state) { return state === States.RESPONDER_ACTIVE_PRESS_IN || state === States.RESPONDER_ACTIVE_LONG_PRESS_IN; }, _savePressInLocation: function _savePressInLocation(e) { var touch = extractSingleTouch(e.nativeEvent); var pageX = touch && touch.pageX; var pageY = touch && touch.pageY; var locationX = touch && touch.locationX; var locationY = touch && touch.locationY; this.pressInLocation = { pageX: pageX, pageY: pageY, locationX: locationX, locationY: locationY }; }, _getDistanceBetweenPoints: function _getDistanceBetweenPoints(aX, aY, bX, bY) { var deltaX = aX - bX; var deltaY = aY - bY; return Math.sqrt(deltaX * deltaX + deltaY * deltaY); }, /** * Will perform a transition between touchable states, and identify any * highlighting or unhighlighting that must be performed for this particular * transition. * * @param {States} curState Current Touchable state. * @param {States} nextState Next Touchable state. * @param {Signal} signal Signal that triggered the transition. * @param {Event} e Native event. * @sideeffects */ _performSideEffectsForTransition: function _performSideEffectsForTransition(curState, nextState, signal, e) { var curIsHighlight = this._isHighlight(curState); var newIsHighlight = this._isHighlight(nextState); var isFinalSignal = signal === Signals.RESPONDER_TERMINATED || signal === Signals.RESPONDER_RELEASE; if (isFinalSignal) { this._cancelLongPressDelayTimeout(); } var isInitialTransition = curState === States.NOT_RESPONDER && nextState === States.RESPONDER_INACTIVE_PRESS_IN; var isActiveTransition = !IsActive[curState] && IsActive[nextState]; if (isInitialTransition || isActiveTransition) { this._remeasureMetricsOnActivation(); } if (IsPressingIn[curState] && signal === Signals.LONG_PRESS_DETECTED) { this.touchableHandleLongPress && this.touchableHandleLongPress(e); } if (newIsHighlight && !curIsHighlight) { this._startHighlight(e); } else if (!newIsHighlight && curIsHighlight) { this._endHighlight(e); } if (IsPressingIn[curState] && signal === Signals.RESPONDER_RELEASE) { var hasLongPressHandler = !!this.props.onLongPress; var pressIsLongButStillCallOnPress = IsLongPressingIn[curState] && ( // We *are* long pressing.. // But either has no long handler !hasLongPressHandler || !this.touchableLongPressCancelsPress()); // or we're told to ignore it. var shouldInvokePress = !IsLongPressingIn[curState] || pressIsLongButStillCallOnPress; if (shouldInvokePress && this.touchableHandlePress) { if (!newIsHighlight && !curIsHighlight) { // we never highlighted because of delay, but we should highlight now this._startHighlight(e); this._endHighlight(e); } this.touchableHandlePress(e); } } this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout); this.touchableDelayTimeout = null; }, _playTouchSound: function _playTouchSound() { UIManager.playTouchSound(); }, _startHighlight: function _startHighlight(e) { this._savePressInLocation(e); this.touchableHandleActivePressIn && this.touchableHandleActivePressIn(e); }, _endHighlight: function _endHighlight(e) { var _this2 = this; if (this.touchableHandleActivePressOut) { if (this.touchableGetPressOutDelayMS && this.touchableGetPressOutDelayMS()) { this.pressOutDelayTimeout = setTimeout(function () { _this2.touchableHandleActivePressOut(e); }, this.touchableGetPressOutDelayMS()); } else { this.touchableHandleActivePressOut(e); } } }, // HACK (part 2): basic support for touchable interactions using a keyboard (including // delays and longPress) touchableHandleKeyEvent: function touchableHandleKeyEvent(e) { var type = e.type, key = e.key; if (key === 'Enter' || key === ' ') { if (type === 'keydown') { if (!this._isTouchableKeyboardActive) { if (!this.state.touchable.touchState || this.state.touchable.touchState === States.NOT_RESPONDER) { this.touchableHandleResponderGrant(e); this._isTouchableKeyboardActive = true; } } } else if (type === 'keyup') { if (this._isTouchableKeyboardActive) { if (this.state.touchable.touchState && this.state.touchable.touchState !== States.NOT_RESPONDER) { this.touchableHandleResponderRelease(e); this._isTouchableKeyboardActive = false; } } } e.stopPropagation(); // prevent the default behaviour unless the Touchable functions as a link // and Enter is pressed if (!(key === 'Enter' && AccessibilityUtil.propsToAriaRole(this.props) === 'link')) { e.preventDefault(); } } }, withoutDefaultFocusAndBlur: {} }; /** * Provide an optional version of the mixin where `touchableHandleFocus` and * `touchableHandleBlur` can be overridden. This allows appropriate defaults to * be set on TV platforms, without breaking existing implementations of * `Touchable`. */ var touchableHandleFocus = TouchableMixin.touchableHandleFocus, touchableHandleBlur = TouchableMixin.touchableHandleBlur, TouchableMixinWithoutDefaultFocusAndBlur = _objectWithoutPropertiesLoose(TouchableMixin, ["touchableHandleFocus", "touchableHandleBlur"]); TouchableMixin.withoutDefaultFocusAndBlur = TouchableMixinWithoutDefaultFocusAndBlur; var Touchable = { Mixin: TouchableMixin, TOUCH_TARGET_DEBUG: false, // Highlights all touchable targets. Toggle with Inspector. /** * Renders a debugging overlay to visualize touch target with hitSlop (might not work on Android). */ renderDebugView: function renderDebugView(_ref) { var color = _ref.color, hitSlop = _ref.hitSlop; if (!Touchable.TOUCH_TARGET_DEBUG) { return null; } if (process.env.NODE_ENV !== 'production') { throw Error('Touchable.TOUCH_TARGET_DEBUG should not be enabled in prod!'); } var debugHitSlopStyle = {}; hitSlop = hitSlop || { top: 0, bottom: 0, left: 0, right: 0 }; for (var key in hitSlop) { debugHitSlopStyle[key] = -hitSlop[key]; } var normalizedColor = normalizeColor(color); if (typeof normalizedColor !== 'number') { return null; } var hexColor = '#' + ('00000000' + normalizedColor.toString(16)).substr(-8); return /*#__PURE__*/React.createElement(View, { pointerEvents: "none", style: _objectSpread({ position: 'absolute', borderColor: hexColor.slice(0, -2) + '55', // More opaque borderWidth: 1, borderStyle: 'dashed', backgroundColor: hexColor.slice(0, -2) + '0F' }, debugHitSlopStyle) }); } }; export default Touchable;
ajax/libs/zingchart-react/2.1.0/zingchart-react.es.js
cdnjs/cdnjs
import React, { Component } from 'react'; /* All of the code within the ZingChart software is developed and copyrighted by ZingChart, Inc., and may not be copied, replicated, or used in any other software or application without prior permission from ZingChart. All usage must coincide with the ZingChart End User License Agreement which can be requested by email at support@zingchart.com. Build 2.8.8_ES6 */ if(typeof(ZC)==="undefined"){eval(function(p,a,c,k,e,d){e=function(c){return (c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c);}k=[function(e){return d[e]}];e=function(){return '\\w+'};c=1;}while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);}}return p}('2u.ZC={AT:1n(e,t){if(e.1L)1l e.1L(t);1j(1a i=0,a=e.1f;i<a;i++)if(e[i]===t)1l i;1l-1},fi:"2.8.8",mA:"",12j:!1,uz:["1c","qa","1w","92","bR","1N","88","bQ","2V","ek","5x","6U","6b","7z","6v","8p","5g","6A","3P","7a","9f","oD","8Z","9z","aZ","h7","7j","fO","8m","8h","q0","au","af","5N","vF","7Y","5A","oX","8z","b6"],jM:{Ik:["Ia","I3"],Jm:["J4","Nc"],Mt:["Kq","Lz"],Ls:["L2-aH","vq-aH"],y4:["5g-3P","y4"],2V:["94","5x"],7j:["q4","7j"],kN:["Oi"]},yF:{9f:"3P"},Mg:1n(e,t){1a i=[].7u.4v(98).6u(2);1l ZC.kD(e,t).9l(t,i)},kD:1n(e,t){1j(1a i=e.2o("."),a=i.vq(),n=0;n<i.1f;n++)t=t[i[n]];1l t[a]},4f:{1U:{},2e:0,2P:1n(e,t){ZC.4f.1U[e]=t,ZC.4f.2e++,ZC.4f.2e>ok&&(ZC.4f.1U={},ZC.4f.2e=0)}},Ig:0,TS:{},3u:4T.iH,fg:[],kn:"1U:4e/Fw;kG,Ic///Jg==",jZ:!1,ga:{},qx:[],ay:[],c6:0,w9:"1U:4e/9V;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 1l hx; } } 4K (e) { 1l e8; }\')()),ZC.b3=n?1:0},97:!(2g.xQ&&"11d"===2g.xQ),6R:!!/xw (\\d+\\.\\d+);/.5Y(8U.cv)&&5T(5v.$1)<8,ca:!!/xw (\\d+\\.\\d+);/.5Y(8U.cv)&&5T(5v.$1)<9,2K:/11m|11n|Fc 11o|11p|11r CE|12e/.5Y(8U.cv),xt:/12f/.5Y(8U.cv),y7:/12g/.5Y(8U.cv),hR:"pq"in 2u,p2:"12h"in 2u,RY:[],XA:[],DS:[0,0],12d:1c,2E:1n(e,t,i,a,n,l){1c===ZC.1d(i)&&(i=!0),1c===ZC.1d(a)&&(a=!0),1c===ZC.1d(n)&&(n=!1);1a r=(l=l||[]).1f;1j(1a o in e)if(0===r||r>0&&-1===ZC.AT(l,o))if(e[o]3E 3M){if(a){(1c===ZC.1d(t[o])||"7f"!==o&&!n)&&(t[o]=[]);1j(1a s=0,C=e[o].1f;s<C;s++)t[o].1h(e[o][s])}}1u e[o]3E 9e&&!(e[o]3E bz)?a&&(1c===ZC.1d(t[o])&&(t[o]={}),t[o]3E 9e&&!(t[o]3E bz)&&ZC.2E(e[o],t[o],i)):(1c===ZC.1d(t[o])||i)&&(t[o]=e[o])},t9:1n(e,t){t||(t=[]);1j(1a i=0,a=e.1f;i<a;i++)t.1h(e[i])},12m:1n(e,t){1a i={};ZC.2E(e,i),ZC.2E(t,e),ZC.2E(i,e)},6x:1n(e,t,i){if("fJ"!==1o.qU){1y t===ZC.1b[31]&&(t=!0);1a a,n,l=(i=i||[]).1f;1j(1a r in e)if(e.8d(r)&&(0===l||l>0&&-1===ZC.AT(i,r))){1a o=r.2x(0,1);if("."!==o&&"#"!==o)if(e[r]3E 3M)if(ZC.V8(r)!==r){1j(e[ZC.V8(r)]=[],a=0,n=e[r].1f;a<n;a++)ZC.6x(e[r][a]),e[ZC.V8(r)].1h(e[r][a]);4t e[r]}1u 1j(a=0,n=e[r].1f;a<n;a++)ZC.6x(e[r][a]);1u e[r]3E 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>3^o<<4)^(A^s)+(a[3&Z^r]^o),o=i[Z]+=l;l=(o>>>5^(s=i[0])<<2)+(s>>>3^o<<4)^(A^s)+(a[3&Z^r]^o),o=i[n-1]+=l}1l ZC.wY(ZC.oz(i))},XI:1n(e){1j(1a t=1m 3M(1A.4h(e.1f/4)),i=0;i<t.1f;i++)t[i]=e[4*i]+(e[4*i+1]<<8)+(e[4*i+2]<<16)+(e[4*i+3]<<24);1l t},oz:1n(e){1j(1a t=[],i=0;i<e.1f;i++)t.1h(3U&e[i],e[i]>>>8&3U,e[i]>>>16&3U,e[i]>>>24&3U);1l t},wY:1n(e){1j(1a t="",i=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],a=0;a<e.1f;a++)t+=i[e[a]>>4]+i[15&e[a]];1l t},x0:1n(e){1j(1a t=[],i="Ep"===e.5w(0,2)?2:0;i<e.1f;i+=2)t.1h(5z(e.5w(i,2),16));1l t},x9:1n(e){1j(1a t="",i=0;i<e.1f;i++)0!==e[i]&&(t+=5Q.dg(e[i]));1l t},mj:1n(e){1j(1a t=[],i=0;i<e.1f;i++)t.1h(e.fk(i));1l t},1k:1n(e){1l-1!==5Q(e).1L("e-")?0:""===(e=5Q(e).1F(/[^0-9\\.\\-]/gi,""))?0:1A.46(e)},1Y:1n(e){1l e=5T(e),7X(e)?0:e},4w:1n(e,t){1l 1y t===ZC.1b[31]&&(t=2),5T(4T(e).4x(t))},2l:1n(e){1l 1A.3m(e)},2t:1n(e){1l"e8"!==e&&"0"!==e&&("hx"===e||"1"===e||!!e&&!0)},8M:1n(e){1a t=(e=5Q(e).1F(/[^0-9\\.\\%\\-]/gi,"")).1L("%");1l-1!==t&&(e=e.2x(0,t),e=ZC.1Y(e)/100),e},ji:1n(e){1l 2u.xs?2u.xs(e):e},1d:1n(e){1l 1c===e||1y e===ZC.1b[31]?1c:e},7Q:1n(e,t){1l 1c===e||1y e===ZC.1b[31]?t:e},hF:1n(e){1l(e%=2m)<0&&(e+=2m),e},IL:1n(e,t){1l ZC.1Y(e)+""==e+""?t?ZC.1Y(e):ZC.2l(e):-1!==(e+="").1L("%")?ZC.1Y(e.1F("%",""))/100:-1!==e.1L("px")?ZC.1Y(e.1F("px","")):ZC.1Y(e)},QY:1n(e){1l 5z(e,16)},P6:1n(e){1l ZC.1k(e).ac(16)},hw:1n(e,t){1l 5z(e+(t-e)*1A.cX(),10)},5l:1n(e,t,i){1l e=(e=e<t?t:e)>i?i:e},DT:1n(e,t,i,a){1l a?t<e&&e<i||i<e&&e<t:t<=e&&e<=i||i<=e&&e<=t},BN:1n(e,t){1l 1A.1X(e,t)},CT:1n(e,t){1l 1A.2k(e,t)},dr:1n(e){1j(1a t=0,i=e.1f,a=-4T.iH;t<i;t++)a=1A.1X(a,e[t]);1l a},ds:1n(e){1j(1a t=0,i=e.1f,a=4T.iH;t<i;t++)a=1A.2k(a,e[t]);1l a},Fr:1n(){1j(1a e=(12l*1A.cX()+1<<0).ac(16);e.1f<6;)e="0"+e;1l"#"+e},rO:1n(e,t){1j(1a i,a=ZC.1Y(t),n=4T.iH,l=0,r=0,o=e.1f;r<o;r++)(i=1A.3m(ZC.1Y(e[r])-a))<n&&(l=r,n=i);1l l},12a:1n(e){1a t=e.2o(".");1l t[t.1f-1]||""},GR:1n(e){1l e.1F(/^\\s\\s*/,"").1F(/\\s\\s*$/,"")},HO:1n(e,t){1l t=t||1A.E,fP(1A.3a(e)/1A.3a(t))?1A.3a(e)/1A.3a(t):0},U6:1n(e){1l 2m*e/(2*1A.PI)},TB:1n(e){1l 2*e*1A.PI/2m},EE:1n(e){1l 1A.dR(ZC.TB(e))},EK:1n(e){1l 1A.dQ(ZC.TB(e))},PG:1n(e){1l!7X(5T(e))&&fP(e)},EB:1n(e){1l-1!==e.1L("-")?e.1F(/(\\-[a-z0-9])/g,1n(e){1l e.5J().1F("-","")}):e},V8:1n(e){1l e.5J()!==e&&-1===e.1L("-")&&e.2x(0,1).aO()===e.2x(0,1)?e.1F(/([A-Z])/g,1n(e){1l"-"+e.aO()}).1F(/([0-9]+)/g,1n(e){1l"-"+e.aO()}).1F("-3d","3d"):e},11R:1n(e){1l ZC.YA.dK(e)},AK:1n(e){1l 2g.cO(e)},k6:1n(e,t){1l e[0].1f<t[0].1f?1:e[0].1f>t[0].1f?-1:0},cP:1n(e){2u.5E(e,1o.sV)},bW:1n(e,t){1l t>=0&&t<=20?e.4x(t):""+e},jJ:1n(e,t,i,a){1a n=t.S[i].BY,l=t.S[a].BY;if(e==n)1l i;if(e==l)1l a;1a r=ZC.1k((i+a)/2);if(!t.S[r]){1j(;!t.S[r]&&r<a;)r++;if(r===a){1j(r=ZC.1k((i+a)/2);!t.S[r]&&r>i;)r--;if(r===i)1l 1c}}1a o=t.S[r].BY;1l r!==i&&r!==a?e==o?r:e>o?ZC.jJ(e,t,r,a):ZC.jJ(e,t,i,r):e==o?r:1c},a5:1n(e){1a t,i,a,n,l=[1,1,0,0];if(1o.3J.wN&&!ZC.3L&&ZC.AK(e)){1a r=ZC.AK(e);1j(t="";r&&(""===t||"2b"===t);)t=ZC.A4(r).2O("5G")||"",r=r.6r;-1!==(i=t.1L("9D("))&&(a=t.1L(")",i),n=t.2x(i+7,a-i).2o(","),l=[ZC.1Y(n[0]),ZC.1Y(n[3]),ZC.1Y(n[4]),ZC.1Y(n[5])])}1l l}},ZC.sm=!1,ZC.aw=5I,ZC.ax=60*ZC.aw,ZC.HR=60*ZC.ax,ZC.9s=24*ZC.HR,ZC.db=30*ZC.9s,ZC.YR=wm*ZC.9s,ZC.3B=0,2u.3g=2u.3g||{},3g.5b=3g.5b||1n(e){1a t=1y e;if("4j"!==t||1c===e)1l"3b"===t&&(e=\'"\'+e.1F("\\\\","\\\\\\\\").1F(\'"\',\'"\')+\'"\'),5Q(e);1a i,a,n=[],l=e&&e.2G===3M;1j(i in e)"1n"!=1y e[i]&&("3b"===(t=1y(a=e[i]))?a=\'"\'+a.1F("\\\\","\\\\\\\\").1F(\'"\',\'\\\\"\')+\'"\':"4j"===t&&1c!==a&&(a=3g.5b(a)),n.1h((l?"":\'"\'+i+\'":\')+5Q(a)));1l(l?"[":"{")+5Q(n)+(l?"]":"}")},3g.1q=3g.1q||1n(L0){1l""===L0&&(L0=\'""\'),7t("("+L0+")")},ZC.1b=["1T-1r","2f-4c","2f-6i","4y","1w-1s","6p","-2r-1N zc-2r-1N","6f","7u","1V","cA","eA","6k","n6-8F","6k-8F","-6F-c","aS","1V-3F","78","1s","1M","2e","-2N-c","4S-2i","zc-3m zc-6q","az-6k","3d-77","x-2f","y-2f","z-2f",\'" 9o="\',"jY","~9S(3U,3U,3U,0)","~9L(3U,3U,3U)","-2r-1N ","-cj-1B-","7h://8C.w3.eu/Cu/2F","7h://8C.w3.eu/ol/kF","11T","11V","11X","11Y","11Z","121","123","If-124-129","cU, 1 cT dN 6P:6P:6P dM","6C","83","6l","1z-x","1z-y","1z-v","11N","a2-8f","4S-8y","4S-2A","2y-1v","2y-2z","2y-2c","2y-1K","1G-1r","1G-1s","10x 4L","hU dh 6G","6G.5i.6o-2B","-2B-1P-gN","5G-5B-5D","5G-5B","bg-4e-1s","bg-4e-1M","2N-3X","1T-3X","dq-3X"];1O aA{}if(ZC.xj=1n(e){1g.H=e,1g.nW=1n(e,t){1a i,a=1g,n=a.B9.6W;if(1c!==ZC.1d(t)&&1c!==ZC.1d(n[t])&&(n=n[t]),1c!==ZC.1d(n[e])){1a l=n[e];1l 1c===ZC.1d(l[2])&&(l[2]=ZC.AO.QT(l[1],10)),1c===ZC.1d(l[3])&&(l[3]=ZC.AO.QT(l[1],10)),l}1a r=["#11a","#10h","#10j","#10l","#10p","#10q","#10r"];i=1c!==ZC.1d(r[e-a.B9.6W.1f])?r[e-a.B9.6W.1f]:"#"+ZC.YA.dK(e).5w(e%20,6);1a o=ZC.AO.QT(i,10),s=ZC.AO.QT(i,20),C="#pQ";1l a.B9.6W&&a.B9.6W[0]&&a.B9.6W[0][0]&&(C=a.B9.6W[0][0]),[C,i,o,s]},1g.mW=1n(e){e&&ZC.2E(e,1g.B9,!0)},1g.oZ=1n(e){1a t=1g;1c!==ZC.1d(t.O4[e])&&(ZC.6x(t.O4[e]),ZC.2E(t.O4[e],t.B9))},1g.O4={},ZC.2E(1o.ww,1g.O4),1g.O4.d0={6W:[["#2T","#10s","#10t","#10u"],["#2T","#10d","#104","#ZV"],["#2T","#ZW","#102","#103"],["#2T","#106","#107","#109"],["#2T","#10a","#10S","#10T"],["#2T","#10W","#10Y","#112"]],2Y:{cR:{dT:{2n:.5,"1T-1r":"#4J",1r:"#4u","2s-2e":15,6z:1,1E:"tL..."}},"1T-1r":"#pj #113",5M:{"2s-2e":14,6z:1,1r:"#2T","1T-1r":"#117 #118",3w:6},81:{"2s-2e":11,6z:1,1r:"#8I","2y-1v":30,3w:6},7b:{"2s-2e":10,1r:"#8I",1s:"100%",6z:1,"1E-3x":"2z",1M:20,2y:"3i 0 0 3i",3w:5},hg:{"2s-2e":12,1r:"#8I","1E-3x":"3H","9A-3x":"6s",1E:""},4B:{"2s-2e":11,"1w-1s":2,"1w-1r":"#gr",1P:{7N:!0},"3Q-1w":{"1w-1s":1,"1w-1r":"#gr"},2i:{2h:1,"1w-1s":1,"1w-1I":"2U","1w-1r":"#xJ",2n:.2},"4Q-2i":{2h:1,"1w-1s":1,"1w-1I":"2U","1w-1r":"#uX",2n:.1},43:{2h:1,2e:6,6f:ZC.1b[18],"1w-1s":2,"1w-1r":"#gr"},"4Q-43":{2h:1,2e:4,6f:ZC.1b[18],"1w-1s":1,"1w-1r":"#gr"},1H:{1r:"#xJ",7N:!0}},"1Z-x":{2V:{1M:16},3q:{1M:16}},"1Z-y":{2V:{1s:16},3q:{1s:16}},1W:{"1T-1r":"#2T","1G-1s":1,2n:.75,"1G-2n":.75,"1G-1r":"#cS","3K-6V":3,5R:{3w:"4 6",1r:"#2T","1G-1s":1,"1G-1r":"#gr","1T-1r":"#gr"},9Q:{3w:"2 6","1T-1r":"#89","1G-1s":1,"1G-1r":"#cS"},1R:{"1G-1r":"#8I","1G-1s":1}},1B:{"1V-3F":{7N:!0},1R:{3K:1,"1w-1s":1,"1G-1s":1},"2N-1R":{"1w-1s":1,"1G-1s":1}},2i:{"1w-1s":1,"1w-1r":"#4J",2n:1,"1z-1H":{1E:"%l",3w:"3 6"},"1B-1H":{3w:"3 6"}}},1w:{1B:{"3K-2n":.5,1R:{2e:4},"2N-1R":{2e:5}}},1N:{1B:{"3K-2n":.5,1R:{2e:4},"2N-1R":{2e:5}}},5x:{1B:{"3k-2f":90,3K:0}},6b:{1B:{"3k-2f":180,3K:0}},5N:{2v:{"4P-9Y":[0,0]},1B:{3K:0}},7Y:{1B:{3K:0}},8m:{1B:{3K:0}},8h:{1B:{"3k-2f":0,3K:0}},6v:{1B:{1R:{2e:4},"2N-1R":{2e:5}}},8p:{1B:{1R:{2e:4},"2N-1R":{2e:5}}},5g:{1B:{1R:{"1G-1s":0},"2N-1R":{"1G-1s":0}}},6A:{1B:{1R:{"1G-1s":0},"2N-1R":{"1G-1s":0}}},3P:{1B:{"1G-1s":1}},8Z:{1B:{"1G-1s":1}},7j:{1B:{1R:{2e:3},"2N-1R":{2e:4}},"1z-k":{2i:{2n:.5,"1T-1r":"#93 #7g"}}},8z:{"1z-r":{"1T-1r":"-1",2i:{2n:.5,"1T-1r":"#93 #7g"},1P:{"2a-r":0},9f:{2e:1,2C:[{"1T-1r":"#4J",2n:.8},{"1T-1r":"#cS",2n:.8}]}}},au:{2v:{2y:"50 100"},4B:{"1w-1s":0,43:{"1w-1s":0},"4Q-43":{"1w-1s":0},2i:{"1w-1s":0},"4Q-2i":{"1w-1s":0}},"1z-y":{2i:{2n:.25,"1T-1r":"-1 #8Y"}},"1z-y-n":{2i:{2n:.25,"1T-1r":"-1 #8Y"}},1B:{"1G-1s":1}},af:{2v:{2y:"50 100"},"1z-x":{1H:{"2s-2f":3V}},"1z-x-n":{1H:{"2s-2f":90}},4B:{"1w-1s":0,43:{"1w-1s":0},"4Q-43":{"1w-1s":0},2i:{"1w-1s":0},"4Q-2i":{"1w-1s":0}},"1z-y":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"},2i:{2n:.25,"1T-1r":"#8Y -1"}},"1z-y-n":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"},2i:{2n:.25,"1T-1r":"#8Y -1"}},1B:{"1G-1s":1}},5A:{1B:{1R:{1J:"3A",2e:4},"2N-1R":{2e:5}}},92:{4B:{"1w-1r":"#7g",43:{2h:!1}},1B:{"1G-1s":0,"1w-1s":1}},88:{4B:{"1w-1r":"#7g",43:{2h:!1}},1B:{"1G-1s":0,"1w-1s":1}},aZ:{4B:{"1w-1r":"#7g",43:{2h:!1}},1B:{"1G-1s":1}},6U:{4B:{"1w-1r":"#7g",43:{2h:!1}},1B:{"1G-1s":1}},7z:{4B:{"1w-1r":"#7g",43:{2h:!1}},1B:{"1G-1s":1}},7a:{1B:{"1G-1s":1}},"-":""},1g.O4.9c={6W:[["#2T","#xK","#xK","#uD"],["#2T","#xL","#xL","#119"],["#2T","#pS","#pS","#10P"],["#2T","#xZ","#xZ","#10z"],["#2T","#xO","#xO","#10B"],["#2T","#xT","#xT","#10E"],["#2T","#xR","#xR","#10y"],["#2T","#wj","#wj","#10H"],["#2T","#uJ","#uJ","#pS"]],2Y:{cR:{dT:{2n:.5,"1T-1r":"#4J",1r:"#4u","2s-2e":15,6z:1,1E:"tL..."}},"1T-1r":"#j6",5M:{"2s-2e":21,6z:1,1r:"#e2","1T-1r":"2b",3w:6},81:{"2s-2e":11,6z:1,1r:"#e2","2y-1v":30,3w:6},7b:{"2s-2e":10,1r:"#e2",1s:"100%",6z:1,"1E-3x":"2z",1M:20,2y:"3i 0 0 3i",3w:5},hg:{"2s-2e":12,1r:"#8I","1E-3x":"3H","9A-3x":"6s",1E:"No dh","1T-1r":"#10I",2n:.8},4B:{"2s-2e":11,"1w-1s":1,"1w-1r":"#e5",1P:{"2s-2e":12,7N:!0,1r:"#10J"},"3Q-1w":{"1w-1s":1,"1w-1r":"#7P"},2i:{2h:1,"1w-1s":1,"1w-1I":"2U","1w-1r":"#10K",2n:1},"4Q-2i":{2h:1,"1w-1s":1,"1w-1I":"2U","1w-1r":"#uX",2n:.1},43:{2h:1,2e:5,6f:ZC.1b[18],"1w-1s":1,"1w-1r":"#e5"},"4Q-43":{2h:1,2e:3,6f:ZC.1b[18],"1w-1s":1,"1w-1r":"#d4"},1H:{1r:"#e2",7N:!0}},"1z-x":{iL:!0,2i:{2h:!1}},1Z:{2V:{"1T-1r":"#pA",2y:1},3q:{"1T-1r":"#d4","1G-9y":6}},"1Z-x":{2V:{1M:16,"1G-1v":"2b","1G-2z":"2b","1G-2c":"2b","1G-1K":"2b"},3q:{1M:10,"1G-1v":"2b","1G-2z":"2b","1G-2c":"2b","1G-1K":"2b"}},"1Z-y":{2V:{1s:16,"1G-1v":"2b","1G-2z":"2b","1G-2c":"2b","1G-1K":"2b"},3q:{1s:10,"1G-1v":"2b","1G-2z":"2b","1G-2c":"2b","1G-1K":"2b"}},"1Z-xi":{2V:{1s:16,"1G-1v":"2b","1G-2z":"2b","1G-2c":"2b","1G-1K":"2b"},3q:{1s:10,"1G-1v":"2b","1G-2z":"2b","1G-2c":"2b","1G-1K":"2b"}},"1Z-yi":{2V:{1M:16,"1G-1v":"2b","1G-2z":"2b","1G-2c":"2b","1G-1K":"2b"},3q:{1M:10,"1G-1v":"2b","1G-2z":"2b","1G-2c":"2b","1G-1K":"2b"}},2A:{"1T-1r":"#2T","1G-1s":1,"1G-1r":"#d4",4g:!0,4P:{"1T-1r":"#4J"},6K:{2n:0},3q:{1s:11,"1G-1s":2,"1G-9y":3,"1w-1r":"#qi","1G-1r":"#d4","1T-1r":"#pA"},"3q-1v":{1M:11},"3q-2c":{1M:11}},2H:{3K:1,"3K-2f":45,"3K-6V":1,"3K-2n":.25,"1G-1s":1,"1G-1r":"#2T","1G-2n":1},3G:{"dS-3G":1,"1T-1r":"#jO"},1W:{"1T-1r":"#2T","1G-1s":1,3K:0,"3K-2n":.2,2n:1,"1G-2n":1,"1G-1r":"#da",5R:{3w:"5 0 5 10",1r:"#10L","1T-1r":"2b","1G-1s":0,"1G-1v":"hn 2U 2b","1G-2c":"7Z 2U #da"},9Q:{3w:"5 0 5 10","1G-1v":"7Z 2U #da"},pF:{"1T-1r":"#pA","1w-1r":"#qi",2y:2,1M:8,"1w-1s":2,"1w-1I":"eT"},b7:{"1w-1r":"#qi","1w-1s":2,1I:"10N"},1R:{"1G-1r":"#2T","1G-1s":1},"3h-on":{"1T-1r":"#jO"},"3h-6X":{"1T-1r":"#pJ"},1Z:{2V:{"1T-1r":"2b","2y-1v":3,"2y-2c":3},3q:{"1T-1r":"#pJ","1G-1v":"2b","1G-2z":"2b","1G-2c":"2b","1G-1K":"2b","1G-9y":6,1s:12,1M:12}}},1B:{"1V-3F":{7N:!0},1R:{3K:0,"1w-1s":1,"1G-1s":1,"1G-1r":"#2T"},"2N-1R":{"1w-1s":1,"1G-1s":1},zh:!0},2i:{"1w-1s":1,"1w-1r":"#e5",2n:1,"1z-1H":{1E:"%l",3w:"3 6"},"1B-1H":{3w:"3 6"}}},1w:{1B:{"1w-1s":2,3K:0,1R:{2e:4},"2N-3X":{},"2N-1R":{2e:5,"1G-1s":1,"1G-1r":"#2T"}}},1N:{1B:{"1w-1s":2,3K:0,"2n-1N":.25,"1T-1r-1I":"2U",1R:{2e:4},"2N-3X":{},"2N-1R":{2e:5,"1G-1s":1,"1G-1r":"#2T"}}},5x:{1B:{"3k-2f":90,3K:0}},6b:{1B:{"3k-2f":180,3K:0}},5N:{2v:{"4P-9Y":[0,0]},1B:{3K:0},"1z-x":{2i:{2h:!0}}},7Y:{1B:{3K:0}},8m:{1B:{3K:0,7n:{"1G-1s":1,"1G-1r":"#2T",1M:8}}},8h:{1B:{"3k-2f":0,3K:0,7n:{"1G-1s":1,"1G-1r":"#2T",1s:8}}},6v:{1B:{"1w-1r":"%kk-0","1G-1r":"%kk-0",1R:{2e:5},"2N-1R":{2e:6}},"1z-x":{2i:{2h:!0}}},8p:{1B:{"1w-1r":"%kk-0","1G-1r":"%kk-0",1R:{2e:4},"2N-1R":{2e:5}},"1z-x":{2i:{2h:!0}}},5g:{1B:{1R:{"1G-1s":1,"1G-1r":"#2T"},"2N-1R":{"1G-1s":1,"1G-1r":"#2T"}},"1z-x":{2i:{2h:!0}}},6A:{1B:{1R:{"1G-1s":1,"1G-1r":"#2T"},"2N-1R":{"1G-1s":1,"1G-1r":"#2T"}},"1z-x":{2i:{2h:!0}}},3P:{1B:{3K:0,"1G-1s":1,"1V-3F":{6f:"in","2s-2e":16,1E:"%2r-8i-1V%"}}},8Z:{1B:{"1G-1s":1}},7j:{1B:{3K:0,"1w-1s":2,"1T-1r":"%6W-1","6K-1N":!0,1R:{2e:4},"2N-1R":{2e:5,"1G-1r":"#2T"}},"1z-k":{2i:{"1w-1s":1,"1w-1I":"2U","1w-1r":"#e5","1w-gm-2e":6,"1w-hY-2e":6,2n:1,"1T-1r":"#2T #12t"},43:{"1w-1r":"#e5","1w-1s":1,2e:10}},"1z-r":{},"1z-v":{"3Q-1w":{"1w-1r":"#e5","1w-1s":1},43:{"1w-1r":"#e5","1w-1s":1},2i:{"1w-1r":"#iz","1w-1s":1}}},8z:{1B:{3K:0},1z:{"2e-7e":1},"1z-r":{iA:3V,43:{2e:11,"1w-1s":2},"1T-1r":-1,2i:{"1T-1r":"#2T"},9f:{2e:8,"1T-1r":"#iz"},3H:{2e:20,"1T-1r":"#2T","1G-1s":6,"1G-1r":"#uD"}}},au:{2v:{2y:"50 100"},4B:{"1w-1s":0,43:{"1w-1s":0},"4Q-43":{"1w-1s":0},2i:{"1w-1s":1,"1w-1I":"2U","1w-1r":"#iz","1w-gm-2e":6,"1w-hY-2e":6,2n:1},"4Q-2i":{"1w-1s":0}},"1z-x":{2h:!1,2i:{2h:0}},"1z-y":{2i:{"1T-1r":"-1",2n:1}},"1z-y-n":{2i:{"1T-1r":"-1"}},1B:{"1G-1s":1,"1G-1r":"#2T",3K:0,"2N-3X":{"1w-1r":"-1","1G-1r":"-1"}}},af:{2v:{2y:"50 100"},"1z-x":{2h:!1,2i:{2h:0},1H:{"2s-2f":3V}},"1z-x-n":{1H:{"2s-2f":90}},4B:{"1w-1s":0,43:{"1w-1s":0},"4Q-43":{"1w-1s":0},2i:{"1w-1s":1,"1w-1I":"2U","1w-1r":"#iz","1w-gm-2e":6,"1w-hY-2e":6,2n:1},"4Q-2i":{"1w-1s":0}},"1z-y":{2i:{"1T-1r":"-1",2n:1},1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-y-n":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"},2i:{"1T-1r":"-1"}},1B:{"1G-1s":1,"1G-1r":"#2T",3K:0,"2N-3X":{"1w-1r":"-1","1G-1r":"-1"}}},5A:{1B:{"1T-1r":"%6W-1",1R:{1J:"3A",2e:4},"2N-1R":{2e:5}}},92:{4B:{"1w-1r":"#7g",43:{2h:!1}},1B:{"1G-1s":0,"1w-1s":1}},88:{4B:{"1w-1r":"#7g",43:{2h:!1}},1B:{"1G-1s":0,"1w-1s":1}},aZ:{4B:{"1w-1r":"#7g",43:{2h:!1}},1B:{"1G-1s":1}},6U:{4B:{"1w-1r":"#7g",43:{2h:!1}},1B:{"1G-1s":1}},7z:{4B:{"1w-1r":"#7g",43:{2h:!1}},1B:{"1G-1s":1}},7a:{1B:{"1G-1s":1}},b6:{1B:{"1G-1s":0,3K:0,2n:.75,"1T-1r":"%6W-1"}},ap:{5i:{"6o-2B":{2h:!0,1s:"11c",3w:"5 0","1T-1r":"#jV","1G-1s":0,"1G-1r":"#jV",2L:"1K",7M:{2h:ZC.2K,2n:0},aL:{"1T-1r":"#4u",1J:"tf",2n:1},1P:{"1T-1r":"#jV","1E-3x":"1K",3w:"4 20 4 15","1G-1s":0,"1G-1r":"#jV","2s-2e":"uS",1r:"#2T","2N-3X":{"1T-1r":"#12u"}},8F:{"1w-1s":1,"1w-1r":"#vU"}},"6o-2B[2K]":{1P:{3w:"6 10 6 6"}}}},"-":""},1g.O4.9c.2Y["9t-x"]=1g.O4.9c.2Y["9t-y"]=1g.O4.9c.2Y.2i,1g.O4.b8={},ZC.2E(1g.O4.9c,1g.O4.b8,!0,!0),ZC.2E({2Y:{"1T-1r":"#7c",5M:{1r:"#2T"},81:{1r:"#2T"},7b:{1r:"#2T"},4B:{"1w-1r":"#7P",1P:{1r:"#7P"},"3Q-1w":{"1w-1r":"#7P"},2i:{"1w-1r":"#8Y"},"4Q-2i":{"1w-1r":"#8Y"},43:{"1w-1r":"#7P"},"4Q-43":{"1w-1r":"#7P"},1H:{1r:"#7P"}},1Z:{2V:{"1T-1r":"#13L"},3q:{"1T-1r":"#d4"}},"1Z-x":{2V:{"1G-1v":"hn 2U 2b","1G-2z":"5r 2U #7P","1G-2c":"5r 2U #7P","1G-1K":"5r 2U #7P"},3q:{"1G-1v":"2b","1G-2z":"2b","1G-2c":"2b","1G-1K":"2b"}},"1Z-y":{2V:{"1G-1v":"5r 2U #7P","1G-2z":"hn 2U 2b","1G-2c":"5r 2U #7P","1G-1K":"5r 2U #7P"}},2A:{"1T-1r":"#7c"},2H:{"1G-1r":"#4u"},1W:{"1T-1r":"#7c",5R:{1r:"#2T",pF:{"1T-1r":"#e2","1w-1r":"#pG"}},9Q:{1r:"#7P","1T-1r":"#e2","1G-1v":"hn 2U 2b","1G-2z":"5r 2U #d4","1G-2c":"5r 2U #d4","1G-1K":"5r 2U #d4"},pF:{"1T-1r":"#e2","1w-1r":"#pG"},b7:{"1w-1r":"#pG"},"3h-6T":{1r:"#7P"},"3h-on":{"1T-1r":"#pJ"},"3h-6X":{"1T-1r":"#jO"},1R:{"1G-1r":"#4u"},1P:{1r:"#7P"}},1B:{1R:{"1G-1r":"#7c"}},2i:{"1w-1r":"#7P","1z-1H":{"1T-1r":"#jO"},"1B-1H":{"1T-1r":"#7c",1r:"#pQ","1G-1r":"#148"}}},1w:{1B:{"2N-1R":{"1G-1r":"#7c"}}},1N:{1B:{"2N-1R":{"1G-1r":"#7c"}}},8m:{1B:{7n:{"1G-1r":"#7c"}}},8h:{1B:{7n:{"1G-1r":"#7c"}}},5g:{1B:{1R:{"1G-1r":"#7c"},"2N-1R":{"1G-1r":"#7c"}}},6A:{1B:{1R:{"1G-1r":"#7c"},"2N-1R":{"1G-1r":"#7c"}}},3P:{1B:{"1G-1r":"#7c"}},7j:{1B:{"2N-1R":{"1G-1r":"#7c"}},"1z-k":{2i:{"1w-1r":"#8Y","1T-1r":"#7c #14a"},43:{"1w-1r":"#7P"}},"1z-v":{"3Q-1w":{"1w-1r":"#8Y"},43:{"1w-1r":"#8Y"},2i:{"1w-1r":"#8Y"}}},8z:{"1z-r":{2i:{"1T-1r":"#7c"},9f:{"1T-1r":"#14c"}}},au:{4B:{2i:{"1w-1r":"#8Y"}},1B:{"1G-1r":"#7c","2N-3X":{"1w-1r":"#8Y","1G-1r":"#7c"}}},af:{4B:{2i:{"1w-1r":"#8Y"}},"1z-y":{2i:{2n:.25,"1T-1r":"#vc -1"}},"1z-y-n":{2i:{2n:.25,"1T-1r":"#vc -1"}},1B:{"1G-1r":"#7c","2N-3X":{"1w-1r":"#8Y","1G-1r":"#7c"}}},ap:{5i:{"6o-2B":{aL:{"1T-1r":"#pQ"}}}},"-":""},1g.O4.b8,!0,!0),1g.O4.b8.2Y["9t-x"]=1g.O4.b8.2Y["9t-y"]=1g.O4.b8.2Y.2i,1g.O4.lQ={2Y:{5M:{1s:"100%",3w:"1 2 2","2s-2e":10},81:{1s:"100%",3w:"1 2 2","2y-1v":14,"2s-2e":9},2v:{1s:"100%",1M:"100%",2y:"18 4 4 4"},4B:{2h:0},2H:{3K:0,"1G-9y":7},1W:{2h:0},2A:{2h:0},2i:{"1w-1s":1,"1w-1r":"#89",2n:1,"1z-1H":{1E:"%l",3w:"3 6"},"1B-1H":{"1G-1r":"#89","1G-9y":5,3w:"3 6"}},1B:{3K:0,"1V-3F":{2h:0},"2N-3X":{2h:0},"2N-1R":{2h:0},"1X-np":pp,"1X-cZ":pp}},1w:{1B:{"1w-1s":1,1R:{1J:"2b"}}},92:{"3d-77":{5u:20,2f:45,"x-2f":-20,"y-2f":0,"z-2f":0,3G:.9}},1N:{1B:{"1w-1s":1,1R:{1J:"2b"}}},88:{"3d-77":{5u:20,2f:45,"x-2f":-20,"y-2f":0,"z-2f":0,3G:.9}},6v:{4B:{2a:5},1B:{1R:{2e:3,3K:!1,2n:.8}}},8p:{4B:{2a:5},1B:{1R:{2e:3,3K:!1,2n:.8}}},5g:{4B:{2a:15},1B:{1R:{"3k-1J":"2b",3K:!1,2n:.8},"2k-2e":3,"1X-2e":9}},6A:{4B:{2a:15},1B:{1R:{"3k-1J":"2b",3K:!1,2n:.8},"2k-2e":3,"1X-2e":9}},3P:{2v:{2y:"18 4 4 4"},1B:{"1V-3F":{2h:0}},1z:{"2e-7e":.95}},7a:{2v:{2y:"32 4 4 4"},1B:{"1V-3F":{2h:0}},1z:{"2e-7e":1}},8Z:{2v:{2y:"18 4 4 4"},1B:{"1V-3F":{2h:0}},1z:{"2e-7e":.95}},7j:{2v:{2y:"18 4 4 4"},1B:{"1w-1s":1,1R:{3K:0,2e:2}},1z:{"2e-7e":.95}},6U:{"3d-77":{5u:20,2f:45,"x-2f":-20,"y-2f":0,"z-2f":0,3G:.9}},7z:{"3d-77":{5u:20,2f:45,"x-2f":0,"y-2f":-20,"z-2f":0,3G:.9}},b6:{2v:{2y:"18 4 4 4"},1B:{"1G-1s":0}},8z:{2v:{2y:"18 4 4 4"},1B:{Bq:[5]},4B:{2h:1},1z:{"2e-7e":.9},"1z-r":{"1T-1r":"-1",iA:3V,43:{2h:0},1P:{2h:0},2i:{2h:0},9f:{2e:6,"1T-1r":"#iz",2C:[]},3H:{"1G-1s":0,2e:2,"1T-1r":"#2T"}}},au:{2v:{2y:"18 4 4 4"}},af:{2v:{2y:"18 4 4 4"}},8m:{1B:{"2V-8w":.5,7n:{"1G-1s":0,1M:4}}},8h:{1B:{"2V-8w":.5,7n:{"1G-1s":0,1s:4}}},5A:{1B:{"1w-1s":1,1R:{2h:0},"2N-3X":{2h:0}}},"-":""},1g.O4.14i={6W:[["#4u","#14k","#vU","#14f"],["#4u","#144","#13U","#13N"],["#4u","#13P","#13R","#13S"],["#4u","#13T","#13V","#da"],["#4u","#13X","#13Y","#13Z"],["#4u","#142","#uL","#14n"],["#4u","#v9","#vS","#14o"]],2Y:{"1T-1r":"#111",5M:{1r:"#2T"},81:{1r:"#8I"},4B:{"2s-2e":11,"1w-1s":2,"1w-1r":"#89",2i:{2h:1,"1w-1s":1,"1w-1I":"2U","1w-1r":"#89",2n:.2},"4Q-2i":{2h:1,"1w-1s":1,"1w-1I":"2U","1w-1r":"#89",2n:.2},43:{2h:1,2e:6,6f:ZC.1b[18],"1w-1s":2,"1w-1r":"#89"},"4Q-43":{2h:1,2e:4,6f:ZC.1b[18],"1w-1s":1,"1w-1r":"#89"},1H:{1r:"#2T"},1P:{1r:"#2T"}}},7j:{"1z-k":{2i:{2n:.5,"1T-1r":"#14I #8I"}}},"-":""},1g.O4.14K=1g.O4.lQ,1g.B9={ap:{5i:{al:[{id:"uM",4a:"4s"},{id:"vA",4a:"4s"},{id:"vm",4a:"2b"},{id:"uK",4a:"2b"},{id:"uH",4a:"2b"},{id:"vj",4a:"2b"},{id:"3D",4a:"2b"},{id:"wV",4a:"2b"},{id:"x7",4a:"2b"},{id:"wX",4a:ZC.ca?"2b":"4s"},{id:"tD",4a:ZC.ca?"2b":"4s"}],eb:{1J:1,2L:"rb"},4Y:{2y:"10 3i 3i 10",1s:30,1M:22,3w:4,1P:{"1T-1r":"#lJ","1G-1s":1,"1G-1r":"#14L"},"1P-6X":{"1T-1r":"#93","1G-1r":"#7g"}},7O:{"1T-1r":"#2T",1r:"#4u"},"6o-2B":{3w:0,"1G-1s":1,"1G-1r":"#4u",7M:{2h:ZC.2K,2y:"5 3i 3i 5",2n:.8,"1T-1r":"#8I #4J","1G-9y":8,1s:40,1M:40},aL:{"1T-1r":"#2T #vS",1J:"yD",2n:.8},1P:{"1T-1r":"#14M","1E-3x":"1K",3w:"4 20 4 8","1G-1s":1,"1G-1r":"#4u",1r:"#2T","2N-3X":{"1T-1r":"#14O"}},8F:{"1w-1s":1,"1w-1r":"#cY"}},"6o-2B[2K]":{1P:{3w:"6 10 6 6"}}}},6W:[],2Y:{5M:{1s:"100%",6z:1,"2s-2e":13},81:{1s:"100%",6z:1,"2s-2e":11},1Z:{2V:{"1T-1r":"#pj","1G-1r":"#7g"},3q:{"1T-1r":"#7g","1G-1r":"#89","1G-1s":2,"1G-1v":"5r 2U #93","1G-1K":"5r 2U #93","1G-2z":"5r 2U #4J","1G-2c":"5r 2U #4J"}},"1Z-x":{2V:{1M:16},3q:{1M:16}},"1Z-y":{2V:{1s:16},3q:{1s:16}},"1Z-xi":{2V:{1s:16},3q:{1s:16}},"1Z-yi":{2V:{1M:16},3q:{1M:16}},2A:{1s:"100%",1M:50,2y:"3i 50 20 50","1G-1s":1,3K:0,"1T-1r":"#v9","1G-1r":"#4J",4P:{2n:.5,"1T-1r":"#8I"},6K:{2n:.1,"1T-1r":"#4J"},3q:{1s:9,1M:16,"1G-1s":1,"1w-1s":1,"1w-1r":"#111","1G-1r":"#14P","1G-9y":2,"1T-1r":"#uL"},"3q-1v":{1s:16,1M:9},"3q-2c":{1s:16,1M:9}},2v:{1s:"100%",1M:"100%",2y:"60 50 65 50"},"2v[2A]":{2y:"60 50 105 50"},4B:{"1w-1s":1,2i:{"1w-1s":1,"1w-1r":"#7g"},43:{2e:6,"1w-1s":2},"4Q-2i":{"1w-1s":1,"1w-1r":"#7g"},"4Q-43":{2e:4,"1w-1s":1},1H:{6z:1,3w:6,7N:!0},1P:{3w:2,"3i-3x":!0,7N:!0},1R:{"1w-1s":1,"1w-1r":"#4u","1T-1r":"#89"},"5G[5B]":{1P:{"2s-2e":10,3w:2,1r:"#4u","1T-1r":"#2T"}}},"4B[3d]":{"1T-1r":"#89"},"1z-y[2q]":{1H:{"2s-2f":3V},1P:{"1E-3x":"2z"}},"1z-y[5C]":{1H:{"2s-2f":90},1P:{"1E-3x":"1K"}},1B:{4L:{"1w-1s":1,"1w-1r":"#8I",2e:.5},"1V-3F":{7N:!0,1E:"%v",6z:1,6f:"3i",3K:1},"2H-1E":"%v",3K:1,"1w-1s":1,1R:{1J:"9n",3K:1},"5U-3X":{3K:!0,"3K-vW":2,"3K-6V":1,"3K-2n":.91}},2H:{3K:1,3w:"4 8","3K-6V":3,"2a-y":ZC.2K?-40:-20},"2H[4O]":{3w:"4 8","2a-y":0},2i:{1R:{1J:"3A"},"1B-1H[bs]":{1E:\'<b 1I="1r:%1r">%1B-1E:</b> %2r-1V\',3w:10,"1T-1r":"#2T #93","1G-1s":1,"1G-1r":"#4J",1r:"#4u","1E-3x":"1K"},"1B-1H[aC]":{1E:\'<b 1I="1r:%1r">%1B-1E:</b> %2r-1V\',3w:5,"1T-1r":"#2T #93","1G-1s":1,"1G-1r":"#4J",1r:"#4u","1E-3x":"1K"}},3G:{"dS-3G":1,"1G-1s":0,"1T-1r":"#lJ",2n:.25,1H:{2h:!1,"1T-1r":"#2T","2s-2e":10,3w:2,"1G-1s":1,"1G-1r":"#4J"}},7C:{"1G-1s":1,"1G-1r":"#4u","1T-1r":"#cS",2e:4},"1W[2L]":{2y:10},1W:{"1T-1r":"#93",2n:1,3K:1,2y:"10 10 3i 3i",3w:"4 2 4 2",1P:{"1E-3x":"1K",2y:"2 6 2 4",3w:"2 4"},"1P-6X":{2n:.25},1R:{3K:0,2e:6,"1G-1r":"#4J","1G-1s":1},5R:{"2s-2e":12,"1E-3x":"1K",6z:1},9Q:{"1E-3x":"1K"},b7:{"1w-1r":"#4u","1w-1s":1},"3h-6T":{1r:"#4u"},"3h-on":{"1T-1r":"#wQ"},"3h-6X":{"1T-1r":"#4J"},1Z:{2V:{1s:12,1M:12,"1T-1r":"#pj","1G-1r":"#7g"},3q:{1s:12,1M:12,"1T-1r":"#7g","1G-1r":"#89","1G-1s":2,"1G-1v":"5r 2U #93","1G-1K":"5r 2U #93","1G-2z":"5r 2U #4J","1G-2c":"5r 2U #4J"}}}},5x:{1B:{"1V-3F":{6f:"1v-4R"}}},6U:{1B:{"1V-3F":{6f:"1v-4R"}},"3d-77":{5u:40,2f:45,"x-2f":-20,"y-2f":0,"z-2f":0}},aZ:{"3d-77":{5u:40,2f:45,"x-2f":-20,"y-2f":0,"z-2f":0}},6b:{"1z-y":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-y-n":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-x[2q]":{1H:{"2s-2f":3V}},"1z-x[5C]":{1H:{"2s-2f":90}},1B:{"1V-3F":{6f:"1v-4R"}}},bR:{"1z-y":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-y-n":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-x[2q]":{1H:{"2s-2f":3V}},"1z-x[5C]":{1H:{"2s-2f":90}}},bQ:{1B:{"3k-2f":0},"1z-y":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-y-n":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-x[2q]":{1H:{"2s-2f":3V}},"1z-x[5C]":{1H:{"2s-2f":90}}},7z:{"1z-y":{1H:{"2s-2f":0}},"1z-x":{1H:{"2s-2f":3V}},"1z-y-n":{1H:{"2s-2f":0}},"1z-x-n":{1H:{"2s-2f":90}},"3d-77":{5u:40,2f:45,"x-2f":0,"y-2f":-20,"z-2f":0},1B:{"1V-3F":{6f:"1v-4R"}}},8h:{"1z-y":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-x":{1H:{"2s-2f":3V}},"1z-y-n":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-x-n":{1H:{"2s-2f":90}}},1w:{1B:{"1w-1s":4,1R:{1J:"3A",2e:4}}},1N:{1B:{"1w-1s":4,1R:{1J:"3A",2e:4},"1V-3F":{6f:"1v"}}},92:{"3d-77":{5u:40,2f:45,"x-2f":-20,"y-2f":0,"z-2f":0},1B:{"1G-1s":1,"1w-1s":1,1R:{1J:"3A",2e:4,2n:1,2h:0}}},88:{"3d-77":{5u:40,2f:45,"x-2f":-20,"y-2f":0,"z-2f":0},1B:{"1G-1s":1,"1w-1s":1,1R:{1J:"3A",2e:4,2n:1,2h:0},"1V-3F":{6f:"1v"}}},6v:{4B:{2a:10},1B:{1R:{1J:"3A",2e:4},"1V-3F":{6f:"1v"}}},4z:{4B:{2a:10},1B:{"2n-1N":.4,1R:{1J:"2b"},"1V-3F":{6f:"1v"}}},8p:{4B:{2a:10},"1z-y":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-x":{1H:{"2s-2f":3V}},"1z-y-n":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-x-n":{1H:{"2s-2f":90}},1B:{1R:{1J:"3A",2e:4},"1V-3F":{6f:"1v"}}},5g:{4B:{2a:40},1B:{1R:{1J:"3A","3k-1J":"8H","3k-2a-x":-.2,"3k-2a-y":-.2},"2N-1R":{"3k-1J":"8H","3k-2a-x":-.2,"3k-2a-y":-.2},"1V-3F":{6f:"6s",1E:"%2r-2e-1V"},"2H-1E":"%2r-2e-1V"}},6A:{4B:{2a:40},"1z-y":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-x":{1H:{"2s-2f":3V}},"1z-y-n":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-x-n":{1H:{"2s-2f":90}},1B:{1R:{1J:"3A","3k-1J":"8H","3k-2a-x":-.2,"3k-2a-y":-.2},"2N-1R":{"3k-1J":"8H","3k-2a-x":-.2,"3k-2a-y":-.2},"1V-3F":{6f:"6s",1E:"%2r-2e-1V"},"2H-1E":"%2r-2e-1V"}},h7:{"1z-y":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-x":{1H:{"2s-2f":3V}},"1z-y-n":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-x-n":{1H:{"2s-2f":90}}},3P:{2v:{2y:"35 5 5 5"},1z:{"2e-7e":"3i","1w-1s":0,2i:{"1w-1s":0},"4Q-2i":{"1w-1s":0}},1B:{"3k-1J":"8H","1V-3F":{8W:{"1w-1s":1},6f:"4R",1E:"%t",2h:1}}},7a:{"3d-77":{"x-2f":38,"y-2f":0,"z-2f":0},2v:{2y:"25 5 5 5"},1z:{"2e-7e":"3i","1w-1s":0,2i:{"1w-1s":0},"4Q-2i":{"1w-1s":0}},1B:{"3k-1J":"9w","1V-3F":{8W:{"1w-1s":1},6f:"4R",1E:"%t",2h:1}}},8Z:{2v:{2y:"40 5 15 5"},1z:{"2e-7e":.8,"1w-1s":0,2i:{"1w-1s":0},"4Q-2i":{"1w-1s":0}},1B:{"3k-1J":"8H","1V-3F":{8W:{"1w-1s":1},1E:"%t",2h:1}}},b6:{2v:{2y:"30 10 10 10"},1B:{2n:.5,"1G-1s":4},1z:{"2e-7e":.65,"1w-1s":0,2i:{"1w-1s":0},"4Q-2i":{"1w-1s":0}}},7j:{4B:{2i:{"1w-1s":1,"1w-1r":"#4J","1T-1r":"-1"},43:{"1w-1s":1},1P:{"3i-3x":!1}},1z:{2h:0,"2e-7e":.7},"1z-k":{"3Q-2f":3V},2v:{2y:"40 5 5 5"},1B:{"1w-1s":4,77:"1w",1R:{1J:"3A"}}},8z:{4B:{2i:{"1G-1s":1,"1G-1r":"#4J","1T-1r":"-1"}},1z:{"1w-1s":0,2i:{"1w-1s":0},"4Q-2i":{"1w-1s":0},"2e-7e":.7},"1z-r":{"3Q-2f":3V,"1T-1r":"#2T",2i:{"1w-1s":0},43:{6f:"5P"},1P:{"2a-r":"-45%"}},1B:{2e:"85%"},2v:{2y:"40 5 5 5"}},7Y:{1B:{"1w-1s":1,"1G-1s":1,"2H-1E":"14S:&8x;$%bp<br>14T:&8x;$%sR<br>14U:&8x;$%sO<br>ha:&8x;$%7w"}},5A:{1B:{"1w-1s":2,"1V-3F":{1E:"%2r-2k-1V - %2r-1X-1V"},"2H-1E":"%2r-2k-1V - %2r-1X-1V"}},"-":""},1g.PS=1n(e,t){1a i,a=1g,n=!1;1l 1c!==ZC.1d(i=a.B9.2Y[e])&&1c!==ZC.1d(i.4a)&&(n=n||ZC.2t(i.4a)),1c!==ZC.1d(a.B9[t])&&1c!==ZC.1d(i=a.B9[t][e])&&1c!==ZC.1d(i.4a)&&(n=n||ZC.2t(i.4a)),n},1g.2w=1n(e,t,i,a){1a n,l,r,o=1g;i=1c===ZC.1d(i)||ZC.2t(i),a=1c!==ZC.1d(a)&&ZC.2t(a),t 3E 3M||(t=1m 3M(t));1a s=[],C="";1j(l=0,r=t.1f;l<r;l++)if(/(\\(\\w+\\))(.*)/.5Y(t[l])){1a A=5v.$1;C=t[l].1F(A,"2Y"),-1===ZC.AT(s,C)&&s.1h(C),C=t[l].1F(A,A.2x(1,A.1f-1)),-1===ZC.AT(s,C)&&s.1h(C)}1u-1===ZC.AT(s,t[l])&&s.1h(t[l]),/ap(.*)/.5Y(t[l])&&-1===ZC.AT(s,t[l].1F("ap","6G"))&&s.1h(t[l].1F("ap","6G")),/6G(.*)/.5Y(t[l])&&-1===ZC.AT(s,t[l].1F("6G","ap"))&&s.1h(t[l].1F("6G","ap"));1a Z={};1j(l=0,r=s.1f;l<r;l++){1j(1a c=s[l].2o("."),p=o.B9,u=0,h=c.1f;u<h;u++)if(1c!==ZC.1d(n=p[c[u]]))p=n;1u if(1c!==ZC.1d(n=p[ZC.V8(c[u])]))p=n;1u{if(1c===ZC.1d(n=p[ZC.EB(c[u])])){p=1c;1p}p=n}if(p)1j(1a 1b in p)1c!==ZC.1d(p[1b])&&(a||"4j"!=1y p[1b]||p[1b].1f)&&(i||1c===ZC.1d(e[1b])?o.H.R0&&1c!==ZC.1d(o.H.R0[1b])||(Z[1b]=p[1b]):i&&"4j"==1y p[1b]&&(o.H.R0&&1c!==ZC.1d(o.H.R0[1b])||(Z[1b]=p[1b])))}ZC.2E(Z,e)}},ZC.AO={14V:1n(e,t){1j(1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ZC.2l(4T(r)))/1A.bD;1Q(ZC.2l(4T(r))){1i 5I:1b=3;1p;1i gR:1b=6;1p;1i qM:1b=9}if(1c!==ZC.1d(t["1X-d1"])&&(1b=3*t["1X-d1"]),"KB"===s.5J())r=""+4T(r)/gz,n="KB";1u if("MB"===s.5J())r=""+4T(r)/14B,n="MB";1u if("GB"===s.5J())r=""+4T(r)/14C,n="GB";1u if("TB"===s.5J())r=""+4T(r)/14E,n="TB";1u if("PB"===s.5J())r=""+4T(r)/14p,n="PB";1u if(1b>=0&&1b<3)1Q(s){2q:r=r,n="";1p;1i"K":r=""+4T(r)/5I,n="K";1p;1i"M":r=""+4T(r)/gR,n="M";1p;1i"B":r=""+4T(r)/qM,n="B"}1u 1b>=3&&1b<6&&""===s||"K"===s.5J()?(r=""+4T(r)/5I,n="K"):1b>=6&&1b<9&&""===s||"M"===s.5J()?(r=""+4T(r)/gR,n="M"):(1b>=9&&""===s||"B"===s.5J())&&(r=""+4T(r)/qM,n="B")}if(ZC.PG(r))if(1c!==ZC.1d(t[ZC.1b[12]])&&-1!==t[ZC.1b[12]])r=ZC.bW(4T(r),ZC.BN(0,ZC.1k(t[ZC.1b[12]])));1u{1a d=r.2o(".")[1]||"";-1!==t["1X-6k"]&&t["1X-6k"]<d.1f&&(r=ZC.bW(4T(r),ZC.BN(0,ZC.1k(t["1X-6k"]))))}1c!==ZC.1d(t[ZC.1b[14]])&&(r=r.1F(/\\./g,t[ZC.1b[14]]))}if(!7X(r)&&"3b"!=1y l){if(1c!==ZC.1d(t[ZC.1b[12]])&&-1!==t[ZC.1b[12]]&&ZC.PG(r)&&(1c!==ZC.1d(t.5L)&&t.5L||(r=ZC.bW(4T(r),ZC.BN(0,ZC.1k(t[ZC.1b[12]]))))),1c!==ZC.1d(t[ZC.1b[13]])||1c!==ZC.1d(t[ZC.1b[14]])){1j(1a f=r.2o("."),g="",B=0,v=f[0].1f;B<v;B++){1a E=f[0].2x(B,B+1);g+=E,-1===ZC.AT(["-","+"],E)&&(f[0].1f-B-1)%3==0&&f[0].1f-B-1!=0&&(g+=t[ZC.1b[13]])}r=g+(1c!==ZC.1d(f[1])?t[ZC.1b[14]]+f[1]:"")}1c!==ZC.1d(t.5L)&&t.5L&&(r+=n)}}1l r},ru:1n(e){1a t=e.1L("("),i="",a="";-1!==t?(i=ZC.GR(e.2x(0,t)),a=ZC.GR(e.2x(t+1,e.1f-1))):i=ZC.GR(e);1a n=[],l="";if(""!==a){1a r=!1,o=!1,s=!1;l="";1j(1a C=0,A=a.1f;C<A;C++){1a Z=a.2x(C,C+1);1Q(Z){1i"\\\\":s?(l+="\\\\",s=!1):s=!0;1p;1i\'"\':s?(l+=\'"\',s=!1):o?(n.1h(l),l="",o=!1):r?l+=Z:o=!0;1p;1i"\'":s?(l+="\'",s=!1):r?(n.1h(l),l="",r=!1):o?l+=Z:r=!0;1p;1i" ":(r||o)&&(l+=Z);1p;1i",":r||o?l+=Z:(""!==l&&n.1h(l),l="");1p;2q:l+=Z}}}1l""!==l&&n.1h(l),[i,n]},er:1n(e){1l e.ac().1F(/^([0-9])$/,"0$1")},YM:1n(e,t,i,a){t=t||ZC.HD["5B-rL"].iy,1y i===ZC.1b[31]&&(i=!1),1y a===ZC.1b[31]&&(a=0),i&&(e+=j3*a);1a n,l,r,o,s,C,A,Z,c=1m a1;c.139(e),i?(n=c.13J(),l=c.12P(),r=c.12Q(),o=c.12S(),s=c.12T(),C=c.12O(),A=c.12V(),Z=c.12X()):(n=c.132(),l=c.133(),r=c.136(),o=c.12x(),s=c.12y(),C=c.12z(),A=c.12C(),Z=c.vd());1j(1a p=[["mm",ZC.AO.er(A+1)],["dd",ZC.AO.er(C)],["Y",Z],["y",Z.ac().5w(2,2)],["F",ZC.HD["kE-eU"][A]],["m",A+1],["M",ZC.HD["kE-5L"][A]],["n",A],["d",C],["D",ZC.HD["lI-5L"][s]],["j",C],["l",ZC.HD["lI-eU"][s]],["N",s+1],["w",s],["S",1n(){1l C%10==1?"st":C%10==2?"nd":C%10==3?"rd":"th"}],["a",n<12?"am":"pm"],["A",n<12?"AM":"PM"],["g",n%12||12],["G",n],["h",ZC.AO.er(n%12||12)],["H",ZC.AO.er(n)],["i",ZC.AO.er(l)],["s",ZC.AO.er(r)],["q",o]],u=0;u<p.1f;u++)t=t.1F("%"+p[u][0],p[u][1]);1l t},jo:{},YY:1n(e,t){1a i=1c;if(t&&t.BO?i=t.BO:t&&t.A&&t.A.BO&&(i=t.A.BO),"3b"==1y e&&-1!==e.1L("%1r-")&&ZC.ay.1f>0)1j(1a a=0;a<ZC.ay.1f;a++)-1===e.1L("(+")&&-1===e.1L("(-")||(e=e.1F(/%1r-(\\d+?)\\((\\+|\\-)(\\d+?)\\)/gi,1n(){1a e=ZC.AO.G9(ZC.ay[ZC.1k(98[1])]);1l"+"===98[2]?e=ZC.AO.QT(e,ZC.1k(98[3])):"-"===98[2]&&(e=ZC.AO.JM(e,ZC.1k(98[3]))),e})),e=e.1F("%1r-"+a,ZC.ay[a]);1u"3b"==1y e&&i&&-1!==e.1L("%6W-")&&(e=i[ZC.1k(e.1F("%6W-",""))]);1l e},G9:1n(e,t){1a i,a,n,l;if(1c!==ZC.1d(ZC.AO.jo[e]))1l ZC.AO.jo[e];1a r=ZC.GR(5Q(e)),o=1,s=!1;1l 0===r.1f?"":("9S("===(r=r.1F("Ep","#")).2x(0,5)?(i=1m 5v("9S\\\\((\\\\d{1,3}),\\\\s*(\\\\d{1,3}),\\\\s*(\\\\d{1,3}),\\\\s*([0-9.]+)\\\\)","gi").3n(r))&&(1===(a=ZC.P6(i[1])).1f&&(a="0"+a),1===(n=ZC.P6(i[2])).1f&&(n="0"+n),1===(l=ZC.P6(i[3])).1f&&(l="0"+l),r="#"+a+n+l,o=ZC.BN(0,ZC.CT(1,5T(i[4]))),s=!0):"9L("===r.2x(0,4)?(i=1m 5v("9L\\\\((\\\\d{1,3}),\\\\s*(\\\\d{1,3}),\\\\s*(\\\\d{1,3})\\\\)","gi").3n(r))&&(1===(a=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10);1a i=ZC.QY(e.2x(1,3)),a=ZC.QY(e.2x(3,5)),n=ZC.QY(e.2x(5,7)),l=ZC.AO.Eu(i,a,n);l[2]=t>0?1A.1X(0,l[2]-l[2]*t/100):1A.2k(1,l[2]-l[2]*t/100);1a r=ZC.AO.Ek(l[0],l[1],l[2]);1l r[0]=ZC.1k(r[0])<16?"0"+ZC.P6(r[0]):ZC.P6(r[0]),r[1]=ZC.1k(r[1])<16?"0"+ZC.P6(r[1]):ZC.P6(r[1]),r[2]=ZC.1k(r[2])<16?"0"+ZC.P6(r[2]):ZC.P6(r[2]),e="#"+r[0]+r[1]+r[2]},QT:1n(e,t){if(-1===e)1l-1;if(t>=100)1l"#j6";e=ZC.AO.G9(e),1y t===ZC.1b[31]&&(t=10);1a i=5z(e.5w(1,2),16),a=5z(e.5w(3,2),16),n=5z(e.5w(5,2),16);1l"#"+(0|bK+i+(bK-i)*t/100).ac(16).5w(1)+(0|bK+a+(bK-a)*t/100).ac(16).5w(1)+(0|bK+n+(bK-n)*t/100).ac(16).5w(1)},jk:1n(e,t){1a i=5z(e.5w(1,2),16),a=5z(e.5w(3,2),16),n=5z(e.5w(5,2),16);1l ZC.1d(t)?"9L("+i+","+a+","+n+")":{r:i,g:a,b:n}},Dl:1n(e,t,i){1l"#"+((1<<24)+(e<<16)+(t<<8)+i).ac(16).7u(1)},oI:1n(e,t,i){1a a=ZC.AO.jk(e);1l(12D*a.r+12G*a.g+114*a.b)/5I>=128?i:t},12I:1n(e,t,i){e=ZC.AO.G9(e),t=ZC.AO.G9(t);1a a=ZC.AO.jk(e),n=ZC.AO.jk(t),l={};1j(1a r in a)l[r]=1A.4n(i*a[r]+(1-i)*n[r]);1l ZC.AO.Dl(l.r,l.g,l.b)},kP:1n(){},u1:1n(){},gc:1n(e,t){1a i;1j(i=0;i<t.1f;i++)e[t[i]]=1c;1j(i in e)0===i.1L("137")&&"1n"==1y e[i]&&(e[i]=1c)}},ZC.P={qh:{12N:"cY",13y:"13z",13t:"13B",13r:"13q",13e:"Bt",13g:"13a",13o:"13p",12v:"Zv",Zu:"Sh",Sj:"Sc",Sn:"Bt",So:"Sp",Sl:"Sa",Rt:"S3",Rm:"Rn",Rr:"Rl",Rw:"Tq",Ts:"Ty",Tz:"U2",Tm:"Sy",SO:"Bm",Td:"Tf"},GE:1n(e,t,i){1l"<1N"+(i&&!t&&"iw"!==i?\' 1I="4U:\'+i+\'"\':"")+(t&&"7C"!==i||"iw"===i?\' 7L="7s:;"\':"")+\' 2S="\'+e+\'" \'},qL:1n(e){1a t;if(ZC.A4.6J.a6)4M{t=2g.4V("<kI />")}4K(o){t=2g.4V("kI")}1u t=2g.4V("kI");t.id=e.id+"-kI",t.1I.dp="8X",e.3c(t);1a i=1c,a=t.Tj||t.Ov;if(!(i=a.2g?a.2g:a).3s){1a n=i.4V("Oq");i.3c(n);1a l=i.4V("Qr");n.3c(l);1a r=i.4V("mC");n.3c(r)}1l i},BX:1n(e){1a t;if(1y ZC.bn===ZC.1b[31]){if(ZC.ca)t=!1;1u{t=!0;4M{2g.Qt("Qv")}4K(i){t=!1}}t&&!ZC.2K&&(t=!1),t&&(t="Qx"in 2g.gb),ZC.bn=t}1u t=ZC.bn;if(t)1Q(e){1i"6Z":1i"6C":e="4G";1p;1i"83":e="6h";1p;1i"7D":1i"6l":e="5V";1p;1i"3I":e="4G"}1l e},o3:1n(e,t){1a i,a,n,l=[],r=t.JY,o=t.OQ,s=t.PF,C=r-s/2;if(e.1f>0){1a A=0,Z=0;1j(0!==r&&(A=ZC.1k(C*ZC.EE(o)+s),Z=ZC.1k(C*ZC.EK(o)+s)),i=0,a=e.1f;i<a;i++)if(1c!==ZC.1d(e[i])){1a c=[];1j(n=0;n<e[i].1f;n++)c[n]=e[i][n];1a p=c.1f;if(2===p||4===p)1j(n=0;n<p;n++)c[n]=e[i][n]+(n%2?Z+t.BC:A+t.BJ);l.1h(c)}1u l.1h(1c)}1l l},k8:1n(e,t,i,a,n){1y n===ZC.1b[31]&&(n=!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=5T(4T(e[l][0]).4x(2)),e[l][1]=5T(4T(e[l][1]).4x(2)));if(i.OD&&(Z=i.K+":"+i.AA+":"+e.2M("#"),ZC.4f.1U["2R-2W-"+Z]))1l ZC.4f.1U["2R-2W-"+Z].2o("#")}1a c=[ZC.3u,ZC.3u,-ZC.3u,-ZC.3u],p=[],u=!1;1j(l=0,r=e.1f;l<r;l++)if(1c!==ZC.1d(e[l])){if(i.E["8u-dc-2R"]){if(o=e[l],"3L"===t){1a h=i.AA%2m==0?10:1;o[0]=ZC.1k(h*o[0]),o[1]=ZC.1k(h*o[1]),4===o.1f&&(o[2]=ZC.1k(h*o[2]),o[3]=ZC.1k(h*o[3]))}}1u o=ZC.P.k8(e[l],t,i,a,n);if(1c!==ZC.1d(o)&&!7X(o[0])&&!7X(o[1])&&fP(o[0])&&fP(o[1]))if(r<=20&&a&&(c[0]=ZC.CT(c[0],o[0]/("3L"===t?10:1)),c[1]=ZC.CT(c[1],o[1]/("3L"===t?10:1)),c[2]=ZC.BN(c[2],o[0]/("3L"===t?10:1)),c[3]=ZC.BN(c[3],o[1]/("3L"===t?10:1))),0===l)p.1h(("2F"===t?"M ":"m ")+o[0]+" "+o[1]);1u if(u&&(p.1h(("2F"===t?"M ":"m ")+o[0]+" "+o[1]),u=!1),2===o.1f)p.1h(("2F"===t?"L ":"l ")+o[0]+" "+o[1]);1u if(4===o.1f)p.1h(("2F"===t?"Q ":"qb ")+o[0]+" "+o[1]+" "+o[2]+" "+o[3]),"3L"===t&&p.1h("l "+o[2]+" "+o[3]);1u if(6===o.1f)if("2F"===t){1a 1b=0;o[3]%2m==o[4]%2m&&(1b=o[4]>=o[3]?.Bv:-.Bv),s=ZC.AN.BM(o[0],o[1],o[2],o[3]+1b),C=ZC.AN.BM(o[0],o[1],o[2],o[4]-1b),A="0 0",0===o[5]?o[4]-o[3]>2m?(A="0 1",C[0]=s[0],C[1]=s[1]):A=o[4]-o[3]<=180?"0 1":"1 1":o[3]-o[4]>2m?(A="0 0",C[0]=s[0],C[1]=s[1]):A=o[3]-o[4]<=180?"0 0":"1 0",p.1h("a "+o[2]+","+o[2]+" 0 "+A+" "+(C[0]-s[0])+","+(C[1]-s[1]))}1u"3L"===t&&(o[2]*=10,s=ZC.AN.BM(o[0],o[1],o[2],o[3]),C=ZC.AN.BM(o[0],o[1],o[2],o[4]),A=1===o[5]?"at":"wa",p.1h(A+" "+ZC.1k(o[0]-o[2])+","+ZC.1k(o[1]-o[2])+","+ZC.1k(o[0]+o[2])+","+ZC.1k(o[1]+o[2])+" "+ZC.1k(s[0])+","+ZC.1k(s[1])+" "+ZC.1k(C[0])+","+ZC.1k(C[1])));1u 7===o.1f&&p.1h(("2F"===t?"C ":"c ")+o[0]+" "+o[1]+" "+o[2]+" "+o[3]+" "+o[4]+" "+o[5])}1u u=!0;1l i.E["8u-dc-2R"]||i.OD&&ZC.4f.2P("2R-2W-"+Z,p.2M("#")),i.H&&r<=20&&a&&(i.H.E[i.K+"-ch"]=c),p},MK:1n(e,t){1a i,a,n=e.Rh||e.Eh;1l t=ZC.1k(t||"0"),n&&n.7p?n.7p.1f>0?(i=n.7p[t].aR,a=n.7p[t].bG):n.rU.1f>0&&(i=n.rU[t].aR,a=n.rU[t].bG):(i=e.aR,a=e.bG),[ZC.1k(i||"0"),ZC.1k(a||"0")]},F3:1n(e,t,i){1a a;1l i=i||2g,1c!==ZC.1d(t)?i.zq?a=i.zq(t,e):(a=i.4V(e)).4l("eq",t):a=i.4V(e),"7A:"===e.2x(0,4)&&(a.7U="sN"),a},ER:1n(e){1a t;e 3E 3M||(e=[e]);1j(1a i=0,a=e.1f;i<a;i++)"4j"!=1y(t=e[i])&&(t=ZC.AK(e[i])),t&&(1y t.gn!==ZC.1b[31]?t.gn.aP(t):1y t.6r!==ZC.1b[31]&&t.6r.aP(t))},G4:1n(e,t){1j(1a i in t)if("3b"==1y i&&"4j"!=1y t[i]&&"1n"!=1y t[i])4M{e.4l(i,t[i])}4K(a){}},PR:1n(e,t){1j(1a i in t)"3b"==1y i&&"4j"!=1y t[i]&&"1n"!=1y t[i]&&(e.1I[i]=t[i])},r7:1n(e){1a t;if(e===2g)1l!0;if(!e)1l!1;if(!e.6r)1l!1;if(e.1I){if("2b"===e.1I.3N)1l!1;if("8X"===e.1I.dp)1l!1}if(2u.g5){if("2b"===(t=2u.g5(e,"")).3N)1l!1;if("8X"===t.dp)1l!1}if(t=e.kj){if("2b"===t.3N)1l!1;if("8X"===t.dp)1l!1}1l ZC.P.r7(e.6r)},TA:1n(e){1a t=e.7U||ZC.A4(e).3S("1O");1l 1c!==ZC.1d(t)&&"4j"==1y t&&(t=1y t.dH!==ZC.1b[31]?t.dH:""),t||""},II:1n(e,t,i,a,n,l,r,o){if(e)1Q(r=r||"",t){1i"3f":o?e.9q("2d").q2(i,a,n,l):e.1s=e.1s;1p;1i"3L":1i"2F":1a s=e.7k.1f;if(s>gz&&1y e.4o!==ZC.1b[31])1l 8o(e.4o="");if(s>0)1j(1a C=s-1;C>=0;C--)""===r?e.aP(e.7k[C]):0===e.7k[C].id.1L(r+"-")&&e.aP(e.7k[C])}},E5:1n(e,t){1Q("3b"==1y e&&(e=ZC.AK(e)),t){1i"3f":1l e.9q("2d");1i"2F":1i"3L":1l e}},K2:1n(e,t){1Q(t){1i"2F":1l ZC.P.s2(e);1i"3L":1i"3f":1l ZC.P.I0(e)}},HF:1n(e,t){1Q(t){1i"2F":1l ZC.P.s2(e);1i"3L":1l ZC.P.I0(e);1i"3f":1l ZC.P.zl(e)}},s2:1n(e){1a t;if(ZC.AK(e.id))1l ZC.AK(e.id);1a i=ZC.P.F3("g",ZC.1b[36]);1l 1c!==ZC.1d(t=e.id)&&i.4l("id",t),1c!==ZC.1d(t=e.2p)&&i.4l("1O",t),1c!==ZC.1d(t=e.8q)&&i.4l("z-2Z",t),1c!==ZC.1d(t=e["3v-2R"])&&i.4l("3v-2R",t),e.8T?e.p.hh(i,e.8T.nA):e.p.3c(i),i},XM:1n(e){1a t;ZC.P.ER(e.id);1a i=ZC.P.F3("vp",ZC.1b[36]);1l i.id=e.id,1c!==ZC.1d(e.cx)?((t=ZC.P.F3("3A",ZC.1b[36])).id=e.id+"-2S",ZC.P.G4(t,{cx:e.cx,cy:e.cy,r:e.r})):((t=ZC.P.F3("Py",ZC.1b[36])).id=e.id+"-2S",ZC.P.G4(t,{2W:e.2R})),i.3c(t),i},zl:1n(e){1a t;if(ZC.AK(e.id))1l ZC.AK(e.id);1a i=2g.4V("3f"),a=i.1I;if(1c!==ZC.1d(t=e.id)&&(i.id=t),1c!==ZC.1d(t=e.2p)&&(i.7U=t),1c!==ZC.1d(t=e.wh)){1a n=(""+t).2o("/");e[ZC.1b[19]]=n[0],e[ZC.1b[20]]=n[1]}if(1c!==ZC.1d(t=e.tl)){1a l=(""+t).2o("/");e.1v=l[0],e.1K=l[1]}1l i.1s=e[ZC.1b[19]],i.1M=e[ZC.1b[20]],1c!==ZC.1d(t=e.1K)&&(a.1K=t+"px"),1c!==ZC.1d(t=e.1v)&&(a.1v=t+"px"),1c!==ZC.1d(t=e.3N)&&(a.3N=t),1c!==ZC.1d(t=e.2L)&&(a.2L=t),1c!==ZC.1d(t=e.8q)&&(a.9K=t),e.p.3c(i),i},I0:1n(e){1a t,i,a,n,l,r;if(ZC.AK(e.id))1l a=ZC.AK(e.id),1c!==ZC.1d(t=e.wh)&&(l=(""+t).2o("/"),a.1I.1s=l[0]+"px",a.1I.1M=l[1]+"px"),1c!==ZC.1d(t=e.tl)&&(r=(""+t).2o("/"),a.1I.1v=r[0]+"px",a.1I.1K=r[1]+"px"),a;(n=(a=2g.4V("3C")).1I).vH="ll",1c!==ZC.1d(t=e.wh)&&(l=(""+t).2o("/"),e[ZC.1b[19]]=l[0],e[ZC.1b[20]]=l[1]),1c!==ZC.1d(t=e.tl)&&(r=(""+t).2o("/"),e.1v=r[0],e.1K=r[1]),1c!==ZC.1d(t=e.id)&&(a.id=t),1c!==ZC.1d(t=e.2p)&&""!==t&&(a.7U=t);1j(1a o=[["1v","","px"],["1K","","px"],[ZC.1b[19],"","px"],[ZC.1b[20],"","px"],"2L","9M",["9d","rA|rD"],["8q","9K"],"3v","3N",["6M","","px"],"6Q","6N","cD","e4","cW","o7","1r","1G","wJ","lS","u0","lW","1T","4U",["2y","m0|nK|nn|lZ","px"],["m0","","px"],["nK","","px"],["nn","","px"],["lZ","","px"],["3w","cE|dU|dV|dW","px"],["cE","","px"],["dU","","px"],["dV","","px"],["dW","","px"],"bu","kw"],s=1c,C=1c,A=1c,Z=0,c=o.1f;Z<c;Z++)if("3b"==1y o[Z]&&(o[Z]=[o[Z]]),t=1c,1c!==ZC.1d(i=e[o[Z][0]])&&(t=i),1c!==ZC.1d(t)){1c!==ZC.1d(o[Z][1])&&""!==o[Z][1]||(o[Z][1]=o[Z][0]);1j(1a p=o[Z][1].2o("|"),u=0,h=p.1f;u<h;u++){1a 1b=t+(1c===ZC.1d(o[Z][2])?"":o[Z][2]);n[p[u]]=1b,"6Q"===p[u]&&(s=1b),"6M"===p[u]&&(C=ZC.1k(1b)),"6N"===p[u]&&(A=1b)}}1l 1c!==ZC.1d(t=e.3p)&&(n.3p=t,1!==ZC.1Y(t)&&(n.kw="2n(3p = "+ZC.1k(100*ZC.1Y(t))+")",n.3p=t)),1c!==ZC.1d(t=e.p)&&(e.8T?t.hh(a,e.8T.nA):t.3c(a)),1c!==ZC.1d(t=e.4d)&&(a.4o=ZC.ji(t),-1!==t.1L("<")&&-1!==t.1L(">")&&ZC.A4(a).9x().5f(1n(){1c!==ZC.1d(s)&&(1c!==ZC.1d(1g.1I.6Q)&&""!==1g.1I.6Q||(1g.1I.6Q=s)),1c!==ZC.1d(C)&&(1c!==ZC.1d(1g.1I.6M)&&""!==1g.1I.6M||(1g.1I.6M=C+"px")),1c!==ZC.1d(A)&&(1c!==ZC.1d(1g.1I.6N)&&""!==1g.1I.6N||(1g.1I.6N=A))})),e.aG&&(a.1I.Qk="ew-7f",a.1I.bf="aG"),e.4U&&"iw"===e.4U&&(a.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.2P("1E-1s-"+c,s),s)}},!2g.gj&&2g.yN&&(2g.gj=1n(e){1l 2g.yN("."+e)}),ZC.A4=1n(e,t,i){1a a,n,l,r,o=1g;if(1y i===ZC.1b[31]&&(i=!0),i)1l 1m ZC.A4(e,t,!1);if(o.P9=[],o.QJ=e,o.MN=t,o.1f=0,o.MN=o.MN||2g.dB("3s")[0],"4j"==1y o.QJ)o.P9=[o.QJ];1u if("3b"==1y o.QJ)1j(1a s=o.QJ.2o(","),C=0;C<s.1f;C++){1a A=ZC.GR(s[C]),Z=!1;if(2===(a=A.2o(">")).1f&&(Z=!0,ZC.A4(a[0]).5f(1n(){1a e=1g;ZC.A4(a[1],1g).5f(1n(){1g.6r===e&&o.P9.1h(1g)})})),2===(a=A.2o(" ")).1f&&(Z=!0,ZC.A4(a[0]).5f(1n(){ZC.A4(a[1],1g).5f(1n(){o.P9.1h(1g)})})),!Z)if("#"===A.2x(0,1))ZC.AK(A.2x(1))&&(o.P9=[ZC.AK(A.2x(1))]);1u if("."===A.2x(0,1))if(2g.gj){if(o.MN.gj)n=o.MN.gj(A.2x(1));1u if(n=2g.gj(A.2x(1)),o.MN!==2g){1a c=[];1j(l=0,r=n.1f;l<r;l++)ZC.A4.uC(n[l],o.MN)&&c.1h(n[l]);n=c}1j(l=0,r=n.1f;l<r;l++)o.P9.1h(n[l])}1u{1a p=1m 5v("(^|\\\\s)"+A.2x(1)+"(\\\\s|$)","i"),u=o.MN.dB("*"),h="";1j(l=0,r=u.1f;l<r;l++)"4j"==1y(h=u[l].7U)&&(h=1y h.dH!==ZC.1b[31]?h.dH:""),""!==h&&p.5Y(h)&&o.P9.1h(u[l])}1u 1j(l=0,r=(n=o.MN.dB(A)).1f;l<r;l++)o.P9.1h(n[l])}1l o.1f=o.P9.1f,1g},ZC.A4.5n={7v:1n(){1j(1a e,t=[],i=0,a=1g.P9.1f;i<a;i++){1a n=[1g.P9[i]];if((e=98.1f)>1)1j(1a l=1;l<e;l++)n.1h(98[l]);t.1h(98[0].9l(1g,n))}1l t},5f:1n(){1j(1a e,t=0,i=1g.P9.1f;t<i;t++){1a a=[1g.P9[t]];if((e=98.1f)>1)1j(1a n=1;n<e;n++)a.1h(98[n]);98[0].9l(1g.P9[t],a)}1l 1g},9x:1n(){1a e=[];1l 1g.5f(1n(){1j(1a t=0,i=1g.7k.1f;t<i;t++)1===1g.7k[t].fC&&e.1h(1g.7k[t])}),1g.P9=e,1g},3r:1n(){1g.7v.4v(1g,1n(e){e&&e.6r&&e.6r.aP(e)})},mv:1n(){1g.7v.4v(1g,1n(e){if(e)1j(;e.7k.1f;)e.aP(e.7k[e.7k.1f-1])})},jm:1n(e){1a t,i;1y e===ZC.1b[31]&&(e=!0);1a a=1g.7v.4v(1g,1n(a){if(!a)1l 1c;if(a===2u){1a n=2g.3s;1l a.yO?(t=a.yO,i=a.Ud):n&&n.gn&&n.gn.l6?(t=n.gn.l6,i=n.gn.yP):n&&n.l6&&(t=n.l6,i=n.yP),{1s:t,1M:i}}1a l,r,o=e?"8K":ZC.A4(a).fU("3N");if(2u.g5){1a s=2u.g5(a,1c);l=s.rG(ZC.1b[19]).7u(0,-2),r=s.rG(ZC.1b[20]).7u(0,-2)}1u if(a.iF){1a C=a.iF();l=C.1s?C.1s:a.ri,r=C.1M?C.1M:a.rp}1u l=a.ri,r=a.rp;if("2b"===o||""===o||1y o===ZC.1b[31]){1a A=a.1I,Z=A.dp,c=A.2L,p=A.3N;A.dp="8X",A.2L="4E",A.3N="8K",t=l,i=r,A.3N=p,A.2L=c,A.dp=Z}1u t=l||0,i=r||0;1l{1s:t,1M:i}});1l 1===a.1f?a[0]:a},fU:1n(e){1a t=1g.7v.4v(1g,1n(e,t){if("3N"===t)1l e.1I.3N;1a i,a=2g;if(t=ZC.EB(t),!e||e===a)1l jY;if("3p"===t&&1y e.Xs!==ZC.1b[31]){1a n=(ZC.A4(e).fU("kw")||"").mP(/2n\\(3p=(.*)\\)/);1l n&&n[1]?5T(n[1])/100:1}if(-1!==ZC.AT(["9d","rA","rD"],t))1l(i=e.1I.9d)?i:(i=e.1I.rA)?i:(i=e.1I.rD)?i:"2b";1a l=e.1I?e.1I[t]:1c;if(!l)if(a.jx&&a.jx.g5){1a r=a.jx.g5(e,1c);t=t.1F(/([A-Z])/g,"-$1").aO(),l=r?r.rG(t):1c}1u if(e.kj&&(l=e.kj[t],/^\\d/.5Y(l)&&!/px$/.5Y(l)&&"6N"!==t)){1a o=e.1I.1K,s=e.sW.1K;e.sW.1K=e.kj.1K,e.1I.1K=l||0,l=e.1I.Ya+"px",e.1I.1K=o,e.sW.1K=s}1l"3p"===t&&(l=5T(l)),/Fc/.5Y(8U.cv)&&-1!==ZC.AT(["1K","1v","2z","2c"],t)&&"8A"===ZC.A4(e).fU("2L")&&(l="3i"),"3i"===l?1c:l},e);1l 1===t.1f?t[0]:t},wh:1n(){1a e;1l 1g.P9[0]?1c!==ZC.1d(e=ZC.A4(1g.P9[0]).jm())?[ZC.1k(e[ZC.1b[19]]),ZC.1k(e[ZC.1b[20]])]:[0,0]:1c},1s:1n(e){1a t;if(1y e===ZC.1b[31]){1a i=1g.7v.4v(1g,1n(e){1l 1c!==ZC.1d(t=ZC.A4(e).jm())?ZC.1k(t[ZC.1b[19]]):0});1l 1===i.1f?i[0]:i}1l 1g.7v.4v(1g,1n(e,t){e.1I.1s=t+"px"},e),1g},1M:1n(e){1a t;if(1y e===ZC.1b[31]){1a i=1g.7v.4v(1g,1n(e){1l 1c!==ZC.1d(t=ZC.A4(e).jm())?ZC.1k(t[ZC.1b[20]]):0});1l 1===i.1f?i[0]:i}1l 1g.7v.4v(1g,1n(e,t){e.1I.1M=t+"px"},e),1g},aV:1n(){1l ZC.A4.1Z().1K},aW:1n(){1l ZC.A4.1Z().1v},2O:1n(e,t){if(1y t===ZC.1b[31]){1a i=1g.7v.4v(1g,1n(t){1a i=ZC.A4(t).fU(e);1l-1!==(""+i).1L("px")?ZC.1k(i):i});1l 1===i.1f?i[0]:i}1l 1g.7v.4v(1g,1n(e,t,i){e.1I[t]=i},e,t),1g},3S:1n(e,t){if(1y t===ZC.1b[31]){1a i=1g.7v.4v(1g,1n(t){1l t.bT(e)});1l 1===i.1f?i[0]:i}1l 1g.7v.4v(1g,1n(e,t,i){e.4l(t,i)},e,t),1g},8L:1n(e){if(1y e===ZC.1b[31]){1a t=1g.7v.4v(1g,1n(e){1l e.1V});1l 1===t.1f?t[0]:t}1l 1g.7v.4v(1g,1n(e,t){e.1V=t},e),1g},4m:1n(){1l 1g.7v.4v(1g,1n(e){e.1I.3N="8K"}),1g},5d:1n(){1l 1g.7v.4v(1g,1n(e){e.1I.3N="2b"}),1g},2a:1n(){1a e=1g.7v.4v(1g,1n(e){if(!(e&&(e.x&&e.y||1c!==!e.6r&&"2b"!==ZC.A4(e).fU("3N"))))1l jY;1a t,i,a,n,l,r,o,s={1v:0,1K:0},C={1v:0,1K:0},A=e&&e.Gi;1l A&&((i=A.3s)===e&&(s={1v:i.Yd,1K:i.Xz}),t=A.gb,1y e.iF!==ZC.1b[31]&&(C=e.iF()),a=A.jx||A.Xo,n=t.jC||i.jC||0,l=t.jB||i.jB||0,r=a.yg||t.aW,o=a.yf||t.aV,s={1v:C.1v+r-n,1K:C.1K+o-l}),s});1l 1===e.1f?e[0]:e},3t:1n(e,t,i){if(""!==(e=ZC.A4.iC(e))){if(i||(i=!ZC.sm||{sq:!0}),-1!==e.1L(" ")){1j(1a a=e.2o(/\\s+/),n=0;n<a.1f;n++)1g.3t(a[n],t,i);1l 1g}1l 1g.7v.4v(1g,1n(e,t,a){1n n(e){1a t=(e=e||2u.Es).2X||e.sH,i=ZC.A4.BX(e);1c!==i&&a.4v(t,i)}ZC.A4.IY||(ZC.A4.IY=[]),ZC.A4.IY.1h([e,t,a,n]),e.j2?e.j2(t,n,i):e.m6("on"+t,n)},e,t),1g}},3l:1n(e,t){if(""!==(e=ZC.A4.iC(e))){if(-1!==e.1L(" ")){1j(1a i=e.2o(/\\s+/),a=0;a<i.1f;a++)1g.3l(i[a],t);1l 1g}1l 1g.7v.4v(1g,1n(e,t,i){if(1y ZC.A4.IY!==ZC.1b[31])1j(1a a=0,n=ZC.A4.IY.1f;a<n;a++)if((ZC.A4.IY[a][0]===e||e.86&&"WL"===e.86.5J()&&e.id===ZC.A4.IY[a][0].id)&&ZC.A4.IY[a][1]===t&&ZC.A4.IY[a][2]===i){e.Fn?e.Fn(t,ZC.A4.IY[a][3],!0):e.Xa("on"+t,ZC.A4.IY[a][3]),ZC.A4.IY.6u(a,1);1p}},e,t),1g}},4g:1n(e,t,i){if(""!==(e=ZC.A4.iC(e))){if(i||(i=!ZC.sm||{sq:!0}),0===e.1L("dE")&&(i={sq:!1}),-1!==e.1L(" ")){1j(1a a=e.2o(/\\s+/),n=0;n<a.1f;n++)1g.4g(a[n],t,i);1l 1g}1a l=1g.QJ;1l ZC.A4.9F||(ZC.A4.9F={}),ZC.A4.9F[e]||(ZC.A4.9F[e]=[],2g.j2?2g.j2(e,r,i):2g.m6("on"+e,r)),ZC.A4.9F[e].1h([l,t]),1g}1n r(t){1a i=(t=t||2u.Es).2X||t.sH,a=i.7U||"";"4j"==1y a&&(a=1y a.dH!==ZC.1b[31]&&1c!==ZC.1d(a.dH)?a.dH:"");1a l,r,o=ZC.A4.9F[e],s=1c,C=1c,A=[];1j(l=0,r=o.1f;l<r;l++)("4j"==1y o[l][0]&&i===o[n][0]||"3b"==1y o[l][0]&&("."===o[l][0].2x(0,1)&&-1!==ZC.AT(a.2o(" "),o[l][0].1F(".",""))||"#"===o[l][0].2x(0,1)&&i.id===o[l][0].2x(1)))&&(s=o[l][1],C=ZC.A4.BX(t),1c!==ZC.1d(s)&&1c!==ZC.1d(C)&&A.1h([s,i,C]));1j(l=0,r=A.1f;l<r;l++)A[l][0].4v(A[l][1],A[l][2])}},4i:1n(e,t){if(""!==(e=ZC.A4.iC(e))){1a i,a,n;if(-1!==e.1L(" ")){1j(a=0,n=(i=e.2o(/\\s+/)).1f;a<n;a++)1g.4i(i[a],t);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1n(e,t){if(e===t)1l!0;1j(;e!==t&&e.6r;)if((e=e.6r)===t)1l!0;1l!1},ZC.A4.ao=1n(e){1a t=e.3R||"",i=e.1J||"bY",a=e.1U||"",n=!0;1y e.aE!==ZC.1b[31]&&(n=ZC.2t(e.aE)),""===a.1F(/\\&/g,"")&&(a="");1a l=e.eg||1c,r=e.4L||1c,o=e.aB||1c,s=1c;4M{2u.jW?s=1m jW("Zd.Zh"):2u.gy&&(s=1m gy)}4K(A){}1a C="q9:"===2u.82.hV;if(s){n&&(s.f7=1n(){4===s.f8&&((C||s.6T>=oN&&s.6T<fN)&&o&&o(s.uu,s.6T,s,t),s.6T>=sK&&r&&r(s,s.6T,s.sZ,t),s.f7=1m 2u.bz,s=1c)}),2u.jW||(s.jl=1n(){r&&r(s,0,"",t)}),"vZ"===i.5J()?(s.bp("vZ",t,n),s.cV("X-Zj-Zb","gy"),s.cV("Zk-1J","f5/x-8C-4I-Zo")):(""!==a&&(-1===t.1L("?")&&(t+="?"),t+="&"+a),s.bp("bY",t,n)),l&&l(s);4M{s.8t(a),n||((C||s.6T>=oN&&s.6T<fN)&&o&&o(s.uu,s.6T,s,t),s.6T>=sK&&r&&r(s,s.6T,s.sZ,t),s=1c)}4K(Z){C&&r&&(r(s,s.6T,s.sZ,t),s.f7=1m 2u.bz,s=1c)}}},ZC.AN={zV:1n(e,t){1a i,a,n=1o.3J.wF,l=[],r=0;1n o(e,t){-1===ZC.AT(e,t)&&e.1h(t)}1j(i=0;i<e.1f;i++)e[i]+=t;1a s=-1;1j(i=1;i<e.1f;i++)ZC.2l(e[i]-e[i-1])<n?(l[r]=l[r]||{2k:-1,1X:-1,2C:[]},-1===l[r].2k&&(l[r].2k=i>1?e[i-2]:t,-1===s&&(s=l[r].2k),l[r].2k),o(l[r].2C,i-1),o(l[r].2C,i)):l[r]&&(l[r].1X=e[i],l[r].1X,r++);l[r]&&-1===l[r].1X&&(l[r].1X=2m+t);1a C=l.1f;if(C>1&&l[C-1].1X-l[0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M:1n(e,t,i,a){1l[e+i*1A.dR(2*a*1A.PI/2m),t+i*1A.dQ(2*a*1A.PI/2m)]},gY:1n(e,t,i,a,n){1a l=ZC.U6(1A.a7((a-t)/(i-e)));1l[e+ZC.1k(ZC.EE(l)*n),t+ZC.1k(ZC.EK(l)*n)]},JT:1n(e,t,i,a,n,l){if(n=1c===ZC.1d(n)?0:n,l=1c===ZC.1d(l)||l,i-e!=0){1a r=0,o=0,s=1A.a7((a-t)/(i-e));1l(n<1||l)&&(r=n/2.5*1A.dR(s),o=n/2.5*1A.dQ(s)),[(e+i)/2+(e<i?r:-r),(t+a)/2+o]}1l[e,(t+a)/2]},sd:1n(e,t){1a i=(e[1]-t[1])/(e[0]-t[0]);1l[i,e[1]-i*e[0]]},gC:1n(e,t,i,a){if(t[0]===a[0]&&t[1]===a[1])1l t;if(e[0]===i[0]&&e[1]===i[1])1l e;1a n=ZC.AN.sd(e,t),l=n[0],r=n[1],o=ZC.AN.sd(i,a),s=o[0],C=(o[1]-r)/(l-s);1l[C,l*C+r]},Q7:1n(e,t,i){1c===ZC.1d(t)&&(t=5);1a a=0,n=0;1c!==ZC.1d(i)&&(a=i[0],n=i[1]);1j(1a l,r,o,s="",C=ZC.6R?ZC.3B:0,A=0,Z=e.1f;A<Z;A++)e[A]&&(0===A?(r=e[A][0]+C+a,o=e[A][1]+C+n,l=A,s+=1A.46(r,10)+","+1A.46(o,10)+","):1A.5y((e[A][0]+C-r)*(e[A][0]+C-r)+(e[A][1]+C-o)*(e[A][1]+C-o))>t&&e[A-1]&&(1A.5y((e[A][0]-e[A-1][0])*(e[A][0]-e[A-1][0])+(e[A][1]-e[A-1][1])*(e[A][1]-e[A-1][1]))>t&&A-l>1&&(s+=1A.46(e[A-1][0]+C+a,10)+","+1A.46(e[A-1][1]+C+n,10)+","),r=e[A][0]+C+a,o=e[A][1]+C+n,l=A,s+=1A.46(r,10)+","+1A.46(o,10)+","));1l s=s.2x(0,s.1f-1)},Z8:1n(e,t){if(1c===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=0,a=0,n=[];1Q(e+=""){1i"cs":1i"h":i=1,a=t;1p;1i"9A":1i"v":i=t,a=1;1p;2q:n=e.2o("x"),1c!==ZC.1d(n[0])&&ZC.1k(n[0])+""===n[0]&&(i=ZC.1k(n[0])),1c!==ZC.1d(n[1])&&ZC.1k(n[1])+""===n[1]&&(a=ZC.1k(n[1])),0===a&&0===i?(i=1A.4h(1A.5y(t)),a=1A.4h(t/i)):(0===a&&(a=1A.4h(t/i)),0===i&&(i=1A.4h(t/a)))}1l[i,a]},uN:1n(e,t){1l.5*(2*t[1]+(-t[0]+t[2])*e+(2*t[0]-5*t[1]+4*t[2]-t[3])*e*e+(-t[0]+3*t[1]-3*t[2]+t[3])*e*e*e)},uP:1n(e,t){1a i,a,n,l,r,o=e.1f,s=[],C=[],A=[];1j(i=0;i<o-1;i++)a=e[i+1]-e[i],n=t[i+1]-t[i],C.1h(a),s.1h(n),A.1h(n/a);1a Z=[A[0]];1j(i=0;i<C.1f-1;i++){l=A[i];1a c=A[i+1];if(l*c<=0)Z.1h(0);1u{a=C[i];1a p=C[i+1];r=a+p,Z.1h(3*r/((r+p)/l+(r+a)/c))}}Z.1h(A[A.1f-1]);1a u=[],h=[];1j(i=0;i<Z.1f-1;i++){l=A[i];1a 1b=Z[i],d=1/C[i];r=1b+Z[i+1]-l-l,u.1h((l-1b-r)*d),h.1h(r*d*d)}1l 1n(i){1a a=e.1f-1;if(i===e[a])1l t[a];1j(1a n,l=0,r=h.1f-1;l<=r;){n=1A.4n(.5*(l+r));1a o=e[n];if(o<i)l=n+1;1u{if(!(o>i))1l t[n];r=n-1}}a=1A.1X(0,r);1a s=i-e[a],C=s*s;1l t[a]+Z[a]*s+u[a]*C+h[a]*s*C}},YQ:1n(e,t,i,a){1c===ZC.1d(a)&&(a=1/(i/t.1f*4));1a n,l,r=[];if(e)if((n=[].4A(t))[1]&&n[2]){n[0]=n[0]||n[1]||n[2]||n[3],n[1]=n[1]||n[2]||n[0]||n[3],n[2]=n[2]||n[3]||n[1]||n[0],n[3]=n[3]||n[2]||n[1]||n[0];1a o=ZC.AN.uP([0,1,2,3],n);1j(l=1;l<=2;l+=a)r.1h([l-1,o(l)])}1u r.1h([]);1u 1j(1a s=1;s<t.1f-2;s++)if(1!==a)if((n=[t[s-1],t[s],t[s+1],t[s+2]])[1]&&n[2])1j(n[0]=n[0]||n[1]||n[2]||n[3],n[1]=n[1]||n[2]||n[0]||n[3],n[2]=n[2]||n[3]||n[1]||n[0],n[3]=n[3]||n[2]||n[1]||n[0],l=0;l<=1;l+=a){1a C=s+l,A=ZC.AN.uN(l,n);r.1h([C-1,A])}1u r.1h([]);1u r.1h([s-1,t[s]]);1l r},iK:1n(e){1j(1a t=1A.46(ZC.HO(ZC.2l(e))/1A.bD),i=[1,2,4,5,6,8,10],a=ZC.3u,n=1,l=0;l<i.1f;l++){1a r=i[l]*1A.5k(10,t)-e;ZC.2l(r)<a&&(n=i[l],a=ZC.2l(r))}1l n*1A.5k(10,t)},rI:1n(e,t){1a i,a;1l i=1A.4n(1A.3a(e)/1A.3a(10)),a=e/1A.5k(10,i),(t?a<1.5?1:a<3?2:a<7?5:10:a<=1?1:a<=2?2:a<=5?5:10)*1A.5k(10,i)},WE:1n(e,t,i,a,n,l){1a r,o,s,C,A,Z;1c===ZC.1d(n)&&(n=!0),l=1c===ZC.1d(l)?10:1A.2k(1A.1X(2,l),100),1c!==ZC.1d(a)&&0!==a||(a=1);1a c=1A.4n(ZC.HO(ZC.2l(t))/1A.bD);e===t&&(t+=1A.5k(10,c)),r=e,o=t,C=ZC.AN.rI(o-r,!1),1c===ZC.1d(i)?(s=C/(l-1),s=ZC.AN.rI(s,!0),s*=a):s=i,n?(A=1A.4n(r/s)*s,Z=1A.4h(o/s)*s):(A=r,Z=o,s=1c===ZC.1d(i)?C/(l-1):i);1a p=1A.4n(ZC.HO(ZC.2l(s))/1A.bD),u=p<0?ZC.2l(p):0;if(0===u){1a h=(""+s).2o(".");2===h.1f&&(u=h[1].1f)}1l[A,Z,s,u,s]}},ZC.YA={dK:1n(e){1l ZC.YA.xY(ZC.YA.xS(ZC.YA.y3(e)))},xS:1n(e){1l ZC.YA.xo(ZC.YA.xr(ZC.YA.wH(e),8*e.1f))},xY:1n(e){1j(1a t,i="",a=0,n=e.1f;a<n;a++)t=e.fk(a),i+="y0".eV(t>>>4&15)+"y0".eV(15&t);1l i},y3:1n(e){1j(1a t,i,a="",n=-1,l=e.1f;++n<l;)t=e.fk(n),i=n+1<l?e.fk(n+1):0,Ym<=t&&t<=Yp&&Yj<=i&&i<=Yq&&(t=Yt+((yq&t)<<10)+(yq&i),n++),t<=127?a+=5Q.dg(t):t<=Yv?a+=5Q.dg(192|t>>>6&31,128|63&t):t<=my?a+=5Q.dg(Yx|t>>>12&15,128|t>>>6&63,128|63&t):t<=UI&&(a+=5Q.dg(UV|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t));1l a},wH:1n(e){1a t,i=3M(e.1f>>2);1j(t=0;t<i.1f;t++)i[t]=0;1j(t=0;t<8*e.1f;t+=8)i[t>>5]|=(3U&e.fk(t/8))<<t%32;1l i},xo:1n(e){1j(1a t="",i=0;i<32*e.1f;i+=8)t+=5Q.dg(e[i>>5]>>>i%32&3U);1l t},xr:1n(e,t){1n i(e,t,i,a,n,l){1l o((r=o(o(t,e),o(a,l)))<<(s=n)|r>>>32-s,i);1a r,s}1n a(e,t,a,n,l,r,o){1l i(t&a|~t&n,e,t,l,r,o)}1n n(e,t,a,n,l,r,o){1l i(t&n|a&~n,e,t,l,r,o)}1n l(e,t,a,n,l,r,o){1l i(t^a^n,e,t,l,r,o)}1n r(e,t,a,n,l,r,o){1l i(a^(t|~n),e,t,l,r,o)}1n o(e,t){1a i=(my&e)+(my&t);1l(e>>16)+(t>>16)+(i>>16)<<16|my&i}e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;1j(1a s=Vj,C=-Uk,A=-Ul,Z=Uo,c=0,p=e.1f;c<p;c+=16){1a u=s,h=C,1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",6v:"xy",5g:"xy",8p:"yx",6A:"yx",3P:"r",7a:"3d,3P",8Z:"r",8z:"r",8m:"5x",8h:"6b",au:"xy",af:"yx",5N:"xy",7j:"r",5A:"xy",oX:"yx",7Y:"xy,5x",b6:"r"},1o.4F={9R:!1,b5:!1,ez:!1,8j:!1,m8:!1},1o.yz=1n(e){1j(1a t=0;t<e.1f;t++){if(e[t].4X)if(e[t].4X.1L("1o.2k.js")>-1)1l e[t].4X.2o("1o.2k.js")[0]+"gZ/"}1l"./gZ/"}(2g.dB("fv")[0].7k),1o.3J={jA:1,Bw:1,lw:1,qX:1,pO:1,rg:0,wF:10,uy:0,zI:0,oE:-1,rK:0,GC:1,eH:0,oG:0,ld:0,q3:1,bh:0,lf:0,En:kb,sX:kb,h0:1,wK:0,Gn:0,qr:1,oq:0,wN:0,mR:0,wO:gz},1o.hp=0,1o.pY=1,1o.sS=6H,1o.Eq=Wx,1o.ei=1c,1o.iq=0,1o.xk=0,1o.qs=0,1o.sV=0,1o.so={},1o.dJ="5j",1o.qU="9z",1o.kJ=1c,1o.tO=("q9:"===2g.82.hV?"7h:":2g.82.hV)+"//8v.1o.c1/",1o.gD=!1,1o.jT="5j",1o.gt={1M:Vp,1s:Wy},1o.w0=0,1o.gT=11,1o.9J="mM rq Yi,mM Yy,mM rq,yB,yH,nN-nh",ZC.2K&&(1o.9J="mM rq,yB,yH,nN-nh"),1o.pw=1n(e,t){1j(1a i=(""+e).2o(","),a=0,n=i.1f;a<n;a++){1a l=ZC.GR(i[a]);l=ZC.yF[l]||l,-1!==ZC.AT(["2V","ek","q0","fO"],l)&&(l="v"+l);1a r=1o.ys[l];1c!==ZC.1d(r)&&1o.pw(r),-1===ZC.AT(ZC.RY,l)&&ZC.RY.1h(l)}t&&1o.gV(1c,ZC.RY,t)},1o.gV=1n(e,t,i){1a a=0;if(0===t.1f)i();1u{if(!2g.dB("fv")[0])1l 8o i();!1n n(){1a l,r=!0;1n o(){++a===t.1f?i():n()}1o.yu(t[a])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3t("3I",1o.SN),ZC.A4(2g).3t("9h",1o.SN))),1y 1o.sQ===ZC.1b[31]&&(1o.sQ=1n(e){e.7p.1f>0&&(ZC.bn=!0)},ZC.A4(2g).3t("4G",1o.sQ)),1y 1o.ZF===ZC.1b[31]&&(1o.ZF=1n(e,t,i){if(!e||"v8"===e.2X.86.5J()||"xN"===e.2X.86.5J()||-1!==ZC.P.TA(e.2X).1L("zc-1Z")||-1!==e.2X.id.1L("-1W-")||-1!==e.2X.id.1L("-2A-")||1o.3J.bh){1a a,n,l,r,o,s;i=i||{};1a C=1c===ZC.1d(t)?1o.XH(e):1o.7d(t);if(C){if(-1!==ZC.AT(C.KX,ZC.1b[38]))1l!1;if(1c===ZC.1d(t)?(n=ZC.P.MK(e),a=C.ng(n[0],n[1])):a=1c!==ZC.1d(i[ZC.1b[3]])?C.OF(i[ZC.1b[3]]):C.AI[0],!a)1l!1;1a A=ZC.A4("#"+C.K+"-1v");1c===ZC.1d(t)?(l=n[0]-A.2a().1K,r=n[1]-A.2a().1v):(l=C.I/2,r=C.F/2);1a Z={};e&&(Z=1o.gP(e,C));1a c=ZC.AO.C2("gd",C,Z,!0);if(!c&&1y c!==ZC.1b[31]&&(!e&&!i["6j-7r"]||e&&e.2X.id!==C.K+"-2B-1N"))1l e.6S(),!1;1a p=ZC.a5(C.K);C.rH(a?a.L:-1,e);1a u=-1;if(0!==1o.sS)u=1o.sS;1u 1j(1a h=ZC.AK(C.K);-1===u&&1c!==h.6r;)"3i"!==(u=ZC.1k(ZC.A4(h).2O("9K")))&&""!==u&&1c!==ZC.1d(u)||(u=-1),h=h.6r;u&&-1!==u&&1c!==ZC.1d(u)||(u=1);1a 1b=ZC.A4("#"+C.K+"-2B");if(1b.2O("9K",1o.pY+u+1),1c===ZC.1d(t)){if(e.2X.id===C.K+"-6F-9V"||e.2X.id===C.K+"-6F-eh")1l!0;e.6S()}if(!ZC.AK(C.K+"-2B"))1l!1;l=A.2a().1K,r=A.2a().1v;1a d=A.1s(),f=A.1M();1c===ZC.1d(t)?(o=(n=ZC.P.MK(e))[0]||ZC.DS[0],s=n[1]||ZC.DS[1]):(o=l+C.I/2,s=r+5);1a g=!1;if(C.U9("cH",!1),C.O2>0&&(C.U9("cH",!0),g=!0),C.U9("cG",!1),C.O2<C.QS.1f-1&&(C.U9("cG",!0),g=!0),C.U9("4Y",g,!0),o>=l&&o<=l+d*p[0]&&s>=r&&s<=r+f*p[1]){ZC.A4(".zc-2B").5f(1n(){1g.id!==C.K+"-2B"&&C.9j()}),C.T3=[o,s,1c===ZC.1d(t)?e.2X.id:t],1b.2O("3p",0).4m();1a B,v,E=ZC.1k(1b.2O(ZC.1b[19]))+ZC.1k(1b.2O("dW"))+ZC.1k(1b.2O("dU")),b=ZC.1k(1b.2O(ZC.1b[20]))+ZC.1k(1b.2O("cE"))+ZC.1k(1b.2O("dV")),m=1,K=!1;if(C.o.5i&&C.o.5i["6o-2B"]&&C.o.5i["6o-2B"]&&(m=C.o.5i["6o-2B"].2n?C.o.5i["6o-2B"].2n:1,K=C.o.5i["6o-2B"].Zl),1b.2O("3p",m).5d(),"d0"!==C.LU&&K){if(K){1a D=C.B9.O4[C.LU].ap.5i["6o-2B"];ZC.2E(C.o.5i["6o-2B"],D),B="1K"!==C.o.5i["6o-2B"].2L&&ZC.1d(C.o.5i["6o-2B"].2L)?A.2a().1K+A.1s()-E:A.2a().1K}v=A.2a().1v,1b.2O("1K",ZC.BN(1,B)+"px").2O("1v",ZC.BN(1,v)+"px").2O(ZC.1b[20],A.1M()+"px").2O("3F-Br","1G-3F").4m(),1b=ZC.A4("#"+C.K+"-2B"),K&&1b.P9[0].Zs>A.1M()&&1b.2O("9M-y","1Z")}1u{if(1c===ZC.1d(t)&&e.2X.id===C.K+"-2B-1N"){ZC.AK(C.K+"-2B").1I.cE=0;1a F=ZC.A4("#"+C.K+"-2B-1N").3S("9o").2o(","),I=ZC.1k(F[3])-ZC.1k(F[1]);ZC.AK(C.K+"-2B").1I.qC=ZC.1k(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1!==(""+t).1L("%")?a[0]*5z(t,10)/100:5z(t,10),-1!==(""+i).1L("%")?a[1]*5z(i,10)/100:5z(i,10)]},1o.IY={},1o.3t=1n(e,t,i){e=e||"1o-jQ",1o.IY[e]||(1o.IY[e]={}),1o.IY[e][t]?1o.IY[e][t].1h({fn:i}):1o.IY[e][t]=[{fn:i}]},1o.3l=1n(e,t,i){if(e=e||"1o-jQ",1o.IY[e]&&1o.IY[e][t])if(i){1j(1a a=0,n=1o.IY[e][t].1f;a<n;a++)if(1o.IY[e][t][a].fn===i){1o.IY[e][t].6u(a,1);1p}}1u 1o.IY[e][t]=1c},1o.i7=1n(e,t,i,a){if(e=e||"1o-jQ",1o.IY[e]&&1o.IY[e][t]){1j(1a n=0,l=1o.IY[e][t].1f;n<l;n++)1c!==ZC.1d(a)?i[i.1f-1]=1o.IY[e][t][n].fn.9l(1o,i):1o.IY[e][t][n].fn.9l(1o,i);if(1c!==ZC.1d(a))1l i[i.1f-1]}},1o.i8=1n(e,t){1l e=e||"1o-jQ",1o.IY[e]&&1o.IY[e][t]},1o.t6=1n(e,t){ZC.6x(e,!1);1a i,a,n,l,r,o,s,C,A=[];if(1c!==ZC.1d(i=e.gL)&&(A=i.2o(",")),1c!==ZC.1d(i=e.4D))1Q(i){1i"8A":A=[ZC.1b[38],ZC.1b[39],ZC.1b[40],ZC.1b[41],ZC.1b[44]]}1a Z="";if(1c!==ZC.1d(i=e.Zp)&&(Z=i),1c!==ZC.1d(i=e.id)&&(Z=i),ZC.AK(Z)){1a c=1c;1j(n=0;n<1o.HY.1f;n++)1o.HY[n].K===Z&&(c=1o.HY[n].MJ);if(1c!==ZC.1d(c)){if(""!==c)1l;1o.3n(Z,"9P")}1o.aQ[Z]={},ZC.2E(e,1o.aQ[Z]);1a p=!1,u=1c;1j(n=0;n<1o.HY.1f;n++)1o.HY[n].K===Z&&(1o.HY[n]=1m RZ,u=1o.HY[n],p=!0);if(p||((u=1m RZ).MJ="7l",1o.HY.1h(u)),u.K=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-1H-6t":"1G-il:il",".zc-2i-1H-6t td":"3w:dC aa 5r 5r",".zc-1U-6t":"1G-il:il",".zc-1U-6t oC":"2s-9i:"+1o.9J+";1E-3x:1K;2s-2e:rm;2s-79:r9;3w:Gh si Gh dC;1T-1r:#89;1G-2c:5r 2U #cS",".zc-1U-6t th":"2s-9i:"+1o.9J+";1E-3x:1K;2s-2e:Xg;2s-79:r9;3w:5r si 5r dC;1T-1r:#7g;1G-2c:7Z 2U #cS",".zc-1U-6t td":"2s-9i:"+1o.9J+";1E-3x:1K;2s-2e:Bb;3w:7Z si 7Z dC;1T-1r:#j6;1G-2c:7Z 2U #93;Et-8w:ll",".zc-aU":"1v:0;1K:0;2L:lz",".zc-3m":"1v:0;1K:0;2L:4E"};ZC.ca||(h[".zc-1U-6t th:cI(:7S-Eo)"]="1G-2z:7Z eT #cS",h[".zc-1U-6t td:cI(:7S-Eo)"]="1G-2z:7Z 2U #93");1a 1b=2g.dB("fv")[0],d=2g.4V("1I");if(d.1J="1E/2O",d.4l("1U-Fg","1o"),1b.3c(d),!1o.2O)1j(n=0,l=2g.eY.1f;n<l;n++)2g.eY[n].Ey&&"1o"===2g.eY[n].Ey.bT("1U-Fg")&&(1o.2O=2g.eY[n]);1j(1a f in 1o.2O||(1o.2O=2g.eY[2g.eY.1f-1]),h)1c!==ZC.1d(1o.so[f])?1o.sn(f,1o.so[f]):1o.sn(f,h[f])}if("3L"===t&&!1o.tc)2g.Xd.2P("7A","u8:sE-rc-c1:3L"),2g.Xc().Xb=".sN { Ej:3R(#2q#Fv); }",1o.tc=!0;1a g="";1o.kJ&&(g=1o.kJ),e.1U&&1c!==ZC.1d(i=e.1U.bJ)&&(g=i),1c!==ZC.1d(i=e.bJ)&&(g=i);1a B={1U:!1,d5:!1,2O:!1,6O:!1};if(1c!==ZC.1d(i=e.4f))1j(1a v in B)1c!==ZC.1d(a=i[v])&&(B[v]=ZC.2t(a));1a E=!1;1c!==ZC.1d(i=e.5O)&&(E=ZC.2t(i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(i=e.1r)&&(y.1r=i),u.E.7O=y,1c!==ZC.1d(i=e["3i-2w-gZ"])&&(u.wu=ZC.2t(i)),1c!==ZC.1d(i=e.hb)&&(u.e0=i),1c!==ZC.1d(i=e.gZ)&&(u.ki=i),1c!==ZC.1d(i=e.5D)&&(u.CF=i),1c!==ZC.1d(i=e.Xp)&&(u.NZ=i),1c!==ZC.1d(i=e.i0)&&1c!==ZC.1d(1o.ft[i])&&(u.dO=i,ZC.HD=1o.ft[i]),1c!==ZC.1d(i=e["4f-Yf"])&&(u.N6=i),1o.aQ)if(!1o.YF[Y])1j(1a L in 4t 1o.aQ[Y],4t ZC.TS[Y],1o.6g.1U)0===L.1L(Y+"-")&&(4t 1o.6g.1U[L],1o.6g.2e--);if(u.bb(),m.2O("9M","8X"),u.M2&&m.2O("2L","4E").2O("1v",0).2O("1K",0),(-1!==u.FV.1L("%")||-1!==u.MY.1L("%")||u.M2||u.QQ)&&b){1a w=u.QQ||u.M2?ZC.A4(2u):m,M=w.1s(),H=w.1M(),P=0;u.jp=!1,u.Z3=2u.eP(1n(){1a e;if(ZC.AK(Z)&&!u.mw){1a t=ZC.A4("#"+Z+"-1v"),i=!1;if(-1!==(""+u.FV).1L("%")&&t.1f&&w.1f&&t.1s()!==w.1s()&&(i=!0),0!==P||w.1s()===M&&w.1M()===H&&!i){if(w.1s()+w.1M()>0&&(w.1s()!==M||w.1M()!==H)&&(e=u.M2||u.QQ?1o.wh(w,""+w.1s(),""+w.1M()):1o.wh(w,u.FV,u.MY))[0]>10&&e[1]>10){1j(u.I=e[0],u.F=e[1],M=w.1s(),H=w.1M(),n=0,l=u.AI.1f;n<l;n++)u.AI[n].MH[0]=0;O()}}1u if(M=w.1s(),H=w.1M(),M>10&&H>10){1j(-1!==(""+u.FV).1L("%")?u.I=M*ZC.IL(u.FV):u.I=M,-1!==(""+u.MY).1L("%")?u.F=H*ZC.IL(u.MY):u.F=H,n=0,l=u.AI.1f;n<l;n++)u.AI[n].MH[0]=0;O()}P++}1u 2u.9W(u.Z3)},1o.3J.En)}1l u}1n N(){if(!u.E.wh||u.E.wh!==u.I+"/"+u.F){1j(1a e=!1,t=0;t<1o.HY.1f;t++)1o.HY[t].K===u.K&&(e=!0);e&&u.bF()}u.jp=!1}1n O(){u.jp?u.VV.1s!==u.I&&(iO(u.t3),u.VV.1s=u.I,u.VV.1M=u.F,u.t3=5E(N,1o.3J.sX)):(u.jp=!0,u.VV={1s:u.I,1M:u.F},u.t3=5E(N,1o.3J.sX))}},2u.1o=1o,ZC.A4.6J.a6&&5T(ZC.A4.6J.aF)<9){1a sU=2u.Dq;2u.Dq=1n(){1j(;1o.HY.1f;)1o.3n(1o.HY[0].K,"9P");ZC.A4(2g).3l(ZC.P.BX("6Z"),1o.MQ).3l(ZC.P.BX("7D"),1o.MQ).3l(ZC.P.BX(ZC.1b[48]),1o.MQ).3l(ZC.P.BX(ZC.1b[47]),1o.MQ).3l(ZC.P.BX(ZC.1b[49]),1o.MQ).3l("3I",1o.SN).3l("gd",1o.ZF),1o.HY=[],sU&&sU()}}1o.ft.nM={aG:!1,"6k-8F":".","n6-8F":"","2B-tU":"Yc nX DO","2B-tN":"Yb nX DO","2B-eG":"xU","2B-6F":"xV Y8","2B-tR":"i3 As Y6","2B-tq":"i3 As Xy","2B-ya":"lm Xr","2B-y9":"lm Xx","2B-wS":"lm 8j","2B-wI":"lm Xw","2B-nR":"i3 dh zF","2B-od":"yY dh zF","2B-lH":"Xv dh","2B-eQ":"zr In","2B-f2":"zr Xu","2B-fE":"i3 Xt","2B-4N":"i3 Wz","2B-4r":"nJ Aj","2B-tY":"z1 To 2D","2B-tW":"z1 To 3D","2B-gQ":"rk u3","2B-mZ":"yY u3","2B-tM":"rk Uf yQ","2B-tP":"rk Rk yQ","2B-5O":"yT z3","2B-gN":"Qn yT z3","2B-cH":"Go sY","2B-cG":"Go Qm","5B-rL":{sf:"%d %M %Y<br>%g:%i:%s %A<br>%q ms",mQ:"%d %M %Y<br>%g:%i:%s %A",iy:"%d %M %Y<br>%g:%i %A",lL:"%d %M %Y<br>%g %A",dn:"%d %M %Y",eL:"%M %Y",jS:"%Y"},"lI-5L":["Ql","Qj","Qi","Qg","cU","Qf","Qd"],"lI-eU":["Qc","Qb","Qa","Pz","Qp","Qh","Qq"],"kE-5L":["cT","QA","Rg","Rf","Da","Rd","Rc","Rb","Ra","Qz","Qs","Qy"],"kE-eU":["Qw","Qu","Pw","Pd","Da","Pv","Pa","P0","Oz","Oy","Ox","Ow"],"q8-b9":"tS...","8v-b9":"Ou...","7O-b9-eU":"tS. tL...","7O-b9-5L":"tS...","7O-b9-lQ":"...","4L-5R":"An Af On Ot","4L-aJ":"Af Os:","4L-7w":"ha","4r-5R":"nJ Aj Or","4r-zG":"Ai 3g dh","4r-Fx":"Ai Op Oo","4r-Ft":"nL Pb:","4r-Gl":"3g dh:","4r-Fd":"nL Bc Pc","4r-Fb":"if Bl Pn to Pu Pt ql 12s Ps to Pr Pq","4r-Fk":"Bc Pp is Po...","4r-f3":"nJ","4r-ju":"Pm","4r-Dz":"nL Pf Pl Pk Pj.\\n\\Pi Bl!","6B-7w":"ha","4N-fc":"Ef 3g","4N-fd":"Gp 3g","4N-7w":"ha","4N-9l":"Ph","d7-7w":"ha","1W-wB":"nX %3h% of %a4%"},ZC.HD=1o.ft.nM,1o.7d=1n(e){1j(1a t=0;t<1o.HY.1f;t++)if(1o.HY[t].K===e)1l 1o.HY[t];1l 1c},1o.tC=1n(e,t){1l e.OF(t)},1o.Pg=1n(e){e.A8&&e.A8.g3();1j(1a t=0;t<e.AI.1f;t++)e.AI[t].L7()},1o.Ri=1n(e,t,i){1l e.rB(t,i)},1o.Px=1n(e){e&&e.pg(!0)},1o.Az=1n(e){ZC.XA.1h(e)},1o.Ay=1n(e){1l e.ki.2o(",")},1o.Rj=1n(e,t,i){1Q(1o.Az(e),t){1i"aI":1o.3t(1c,"f6",1n(t,a){1j(1a n=a[ZC.1b[16]].1f,l=0;l<n;l++)if(a[ZC.1b[16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c!==ZC.1d(i["2k-1s"])&&ZC.1k(i["2k-1s"])>n.H.I&&(a=!1),1c!==ZC.1d(i["1X-1s"])&&ZC.1k(i["1X-1s"])<n.H.I&&(a=!1),1c!==ZC.1d(i["2k-1M"])&&ZC.1k(i["2k-1M"])>n.H.F&&(a=!1),1c!==ZC.1d(i["1X-1M"])&&ZC.1k(i["1X-1M"])<n.H.F&&(a=!1),a&&ZC.2E(i,n.o);1j(n.o.an&&(n.E3=n.o.an),t=0;t<n.E3.1f;t++)if("*"===n.E3[t].c8&&n.E3[t].js){n.o["js-c8"]=n.E3[t].js,n.E3.6u(t,1);1p}if((e=n.o["js-c8"])&&("7s:"===e.2x(0,11)||e.1L("(")<e.1L(")")))4M{n.OP="";1a r=e.1F("7s:",""),o=e.1L("("),s=e.1L(")");-1!==o&&-1!==s&&(n.OP=r.5w(o+1,s-o-1),r=r.5w(0,o)),n.IH=ZC.kD(r,2u)}4K(A){}if(1y n.H!==ZC.1b[31]&&1c!==n.H.R0)1j(1a C in n.H.R0)n.H.R0.8d(C)&&1c===ZC.1d(n.o[C])&&(n.o[C]=n.H.R0[C])}8a(){1l{}}dw(e,t,i){1j(1a a=t.2o(","),n=i.2o(","),l=0,r=n.1f;l<r;l++)e[a[l]]=n[l]}12R(){1l 1g.o}13K(e){1g.o=e}tF(){1l 1g.E}bT(e){1l 1g.E[e]}4l(e,t){1g.E[e]=t}oH(e){1a t=1g.8a();1l t[e]?1g[t[e]]:1c}m9(e,t){1a i=1g.8a();i[e]&&(1g[i[e]]=t)}1C(e,t,i){1c===t&&(t=!0);1a a=1g;e&&(a.I4||(a.I4={},ZC.2E(a.o,a.I4,!0,i)),a.JW||(a.JW={}),ZC.2E(e,a.JW,!0,i),ZC.2E(e,a.o,!0,i)),1y a.k4!==ZC.1b[31]&&a.k4()&&e&&ZC.2E(e,a.o)}k4(){}4C(e){1j(1a t=0,i=e.1f;t<i;t++)1g.o.8d(e[t][0])&&1g.YS(e[t][0],e[t][1],e[t][2],e[t][3],e[t][4])}YS(e,t,i,a,n){1a l,r=1g;if(1c!==(l=r.o[e])&&1y l!==ZC.1b[31]){if(i)1Q(-1!==i.1L("p")&&(l=ZC.8M(l),i=i.1F("p","")),-1!==i.1L("a")&&(l=ZC.2l(l),i=i.1F("a","")),i){1i"i":l=ZC.1k(l);1p;1i"f":l=ZC.1Y(l);1p;1i"b":l=ZC.2t(l);1p;1i"c":l=ZC.AO.YY(l,r),(l=ZC.AO.G9(l,r))3E 3M&&("1r"===e||"2s-1r"===e?(r.o["1E-2n"]=l[1],r.X4=l[1],r.E["1E-2n"]=l[1]):e===ZC.1b[61]?(r.o["1G-2n"]=l[1],r.O8=l[1],r.E["b-2n"]=l[1]):("1w-1r"===e&&(r.E["l-2n"]=l[1]),1c===ZC.1d(r.o.2n)&&(r.C5=l[1])),l=l[0])}1c!==ZC.1d(a)&&1c!==ZC.1d(n)&&(l=ZC.5l(l,a,n)),r[t]=l}}DB(){1j(1a e=1g,t=!1,i=0,a=e.E3.1f;i<a;i++){1a n=!1;4M{n=1m bz("1l ("+e.IX(e.E3[i].c8)+")")()}4K(l){n=!1}n&&(t=!0,e.1C(e.E3[i]))}1l t}Bf(e){1j(1a t="",i=0,a=e.1f;i<a;i++){1a n=!1;4M{n=1m bz("1l ("+1g.IX(e[i].c8)+")")()}4K(l){n=!1}n&&(t+="<"+e[i].c8+">")}1l""!==t?[t,ZC.YA.dK(t)]:1c}IX(){1l!0}1S(e){1a t=1g;ZC.2E(e.o,t.o),e.I4&&(t.I4=t.I4||{},ZC.2E(e.I4,t.I4)),e.JW&&(t.JW=t.JW||{},ZC.2E(e.JW,t.JW)),ZC.2E(e.E,t.E),ZC.2E(e.E3,t.E3)}}1O CX 2j Fl{2G(e){1D(e),1g.7l(e)}7l(e){1D.7l(e);1a t=1g;e&&e.H&&(t.H=e.H),t.K="",t.DH=1c,t.AM=!0,t.A0="-1",t.AC="-1",t.GO="",t.HM="",t.W7=!0,t.D7="",t.MD="6D",t.TL="50% 50%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V=4*e,i.G8=2*e;1p;2q:i.EV=0,i.G8=0}1c!==(t=ZC.1d(i.o["1w-gm-2e"]))&&(i.EV=5z(t,10)),1c!==(t=ZC.1d(i.o["1w-hY-2e"]))&&(i.G8=5z(t,10))}1q(){1a e,t,i,a,n,l,r,o,s;1D.1q();1a C=1g;if(1c!==(e=ZC.1d(C.o.7f))&&!C.rf){1a A,Z,c,p=-1,u=-1;1j(1y C.E.76!==ZC.1b[31]&&(p=ZC.1k(C.E.76)),1y C.E.7y!==ZC.1b[31]&&(u=ZC.1k(C.E.7y)),r=0,o=e.1f;r<o;r++){if(A=-1,Z=-1,e[r].7m){if(1c!==(t=ZC.1d(e[r].7m["2r-2Z"]))){if(Z=0,c=[],"4j"==1y t)c=t;1u if("3b"==1y t){if(-1!==t.1L(","))c=t.2o(",");1u if(-1!==t.1L("-"))1j(i=t.2o("-"),a=ZC.1k(i[0]);a<=ZC.1k(i[1]);a++)c.1h(a)}1u c=[t];-1!==ZC.AT(c,u)&&(Z=1)}if(1c!==(t=e[r].7m["1B-2Z"])&&1y t!==ZC.1b[31]){if(A=0,c=[],"4j"==1y t)c=t;1u if("3b"==1y t){if(-1!==t.1L(","))c=t.2o(",");1u if(-1!==t.1L("-"))1j(i=t.2o("-"),a=ZC.1k(i[0]);a<ZC.1k(i[1]);a++)c.1h(a)}1u c=[t];-1!==ZC.AT(c,p)&&(A=1)}}0!==A&&0!==Z&&C.1C(e[r])}}if(1c!==(e=C.OU)&&C.1C(e),e=C.o[ZC.1b[0]]){if(e=ZC.AO.YY(e,1g),"9L("===5Q(e).2x(0,4))1j(n=1m 5v("9L\\\\((\\\\d{1,3}),\\\\s*(\\\\d{1,3}),\\\\s*(\\\\d{1,3})\\\\)");l=n.3n(e);)e=e.1F(l[0],ZC.AO.G9(l[0]));if("9S("===5Q(e).2x(0,5))1j(n=1m 5v("9S\\\\((\\\\d{1,3}),\\\\s*(\\\\d{1,3}),\\\\s*(\\\\d{1,3})\\\\,\\\\s*([0-9.]+)\\\\)");l=n.3n(e);){1a h=ZC.AO.G9(l[0],C);e=e.1F(l[0],h[0]),C.o.2n=h[1],C.C5=h[1],C.E["bg-2n"]=h[1],1c===ZC.1d(C.E["b-2n"])&&(C.E["b-2n"]=1),1c===ZC.1d(C.E["l-2n"])&&(C.E["l-2n"]=1)}1a 1b=ZC.GR(5Q(e)).2o(/\\s+|;|,/);C.A0=ZC.AO.G9(1b[0]),C.AC=1===1b.1f?C.A0:ZC.AO.G9(1b[1])}if(!(1c===ZC.1d(C.o[ZC.1b[62]])&&1c===ZC.1d(C.o[ZC.1b[61]])&&1c===ZC.1d(C.o["1w-1I"])||1c===ZC.1d(C.o["1G-1v"])&&1c===ZC.1d(C.o["1G-2z"])&&1c===ZC.1d(C.o["1G-2c"])&&1c===ZC.1d(C.o["1G-1K"])&&1c===ZC.1d(C.o.1G))){1a d=["1v","2z","2c","1K"],f={1v:[0,"2U","#4u"],2z:[0,"2U","#4u"],2c:[0,"2U","#4u"],1K:[0,"2U","#4u"]};if(C.I4=C.I4||{},e=C.I4.1G)1j(s=e.2o(/\\s/),r=0;r<4;r++)f[d[r]]=[ZC.1k(s[0]||"0"),ZC.GR(s[1]||"2U"),ZC.AO.G9(s[2]||"#cY")];if(1c!==ZC.1d(C.I4[ZC.1b[62]]))1j(r=0;r<4;r++)f[d[r]][0]=C.I4[ZC.1b[62]];if(1c!==ZC.1d(C.I4["1w-1I"]))1j(r=0;r<4;r++)f[d[r]][1]=C.I4["1w-1I"];if(1c!==ZC.1d(C.I4[ZC.1b[61]]))1j(r=0;r<4;r++)f[d[r]][2]=C.I4[ZC.1b[61]];1j(r=0;r<4;r++)(e=C.I4["1G-"+d[r]])&&(s=e.2o(/\\s/),f[d[r]]=[ZC.1k(s[0]||"0"),ZC.GR(s[1]||"2U"),ZC.AO.G9(s[2]||"#cY")]);if(C.JW=C.JW||{},e=C.JW.1G)1j(s=e.2o(/\\s/),r=0;r<4;r++)f[d[r]]=[ZC.1k(s[0]||"0"),ZC.GR(s[1]||"2U"),ZC.AO.G9(s[2]||"#cY")];if(1c!==ZC.1d(C.JW[ZC.1b[62]]))1j(r=0;r<4;r++)f[d[r]][0]=C.JW[ZC.1b[62]];if(1c!==ZC.1d(C.JW["1w-1I"]))1j(r=0;r<4;r++)f[d[r]][1]=C.JW["1w-1I"];if(1c!==ZC.1d(C.JW[ZC.1b[61]]))1j(r=0;r<4;r++)f[d[r]][2]=C.JW[ZC.1b[61]];1j(r=0;r<4;r++)(e=C.JW["1G-"+d[r]])&&(s=e.2o(/\\s/),f[d[r]]=[ZC.1k(s[0]||"0"),ZC.GR(s[1]||"2U"),ZC.AO.G9(s[2]||"#cY")]);1j(r=0;r<4;r++)1c===ZC.1d(C.o["1G-"+d[r]])&&(C.o["1G-"+d[r]]=f[d[r]].2M(" "))}C.4C([["2h","AM","b"],["1T-1r-1","A0","c"],["1T-1r-2","AC","c"],["5c-hJ","GO"],["5c-oO","HM"],["1T-3v","W7","b"],["1T-4e","D7"],["1T-6D","MD"],["1T-2L","TL"],["1T-iu","X3"],["1T-1z","KR","f"],["3k-1J","NN"],["3k-2f","NE","i"],["3k-2a-x","WT","f"],["3k-2a-y","WG","f"],[ZC.1b[4],"AZ","i"],["1w-1r","B7","c"],["1w-1I","GA",""],["1O","DH"],["2p","DH"],["1G","BG"]]),"2b"===C.NN&&(C.AC=C.A0,C.NN="9w"),""!==C.BG&&(s=C.BG.2o(/\\s/),C.AQ=ZC.1k(s[0]||"0"),C.GA=ZC.GR(s[1]||"2U"),C.BU=ZC.AO.G9(s[2]||"#cY")),C.GO=ZC.AO.YY(C.GO,1g),C.KM(),C.4C([["1w-gm-2e","EV","i"],["1w-hY-2e","G8","i"],[ZC.1b[62],"AQ","i"],[ZC.1b[61],"BU","c"],["2n","C5","f",0,1],["3K","ME","b"],["3K-2f","OQ","i",0,2m],["3K-6V","JY","i"],["3K-2n","TF","f",0,1],["3K-1r","S8","c"],["3K-vW","PF","i"]]),C.O8=C.C5,C.4C([["1G-2n","O8","f",0,1]])}}ZC.CM={kz:1n(e,t,i){1a a,n,l;if(e&&i&&0!==i.1f){if(!t.E["8u-dc-2R"])1j(a=0,n=i.1f;a<n;a++)i[a]&&(i[a][0]=5T(4T(i[a][0]).4x(2)),i[a][1]=5T(4T(i[a][1]).4x(2)));1a r=!1,o=i.1f;1j(a=0;a<o;a++)1c!==ZC.1d(i[a])&&(l=[i[a][0],i[a][1]],1c!==ZC.1d(i[a][2])&&l.1h(i[a][2],i[a][3]),1c!==ZC.1d(i[a][4])&&l.1h(i[a][4],i[a][5]),t.OV&&(l[0]=1A.46(l[0]),l[1]=1A.46(l[1]),4===l.1f&&(l[2]=1A.46(l[2]),l[3]=1A.46(l[3]))),t.CW&&t.AZ%2==1&&(l[0]-=.5,l[1]-=.5,4===l.1f&&(l[2]-=.5,l[3]-=.5))),0===a?e.dX(l[0],l[1]):i[a]?(r&&(e.dX(l[0],l[1]),r=!1),2===l.1f?e.hQ(l[0],l[1]):4===l.1f?e.wf(l[0],l[1],l[2],l[3]):6===l.1f&&e.6y(l[0],l[1],l[2],ZC.TB(l[3]),ZC.TB(l[4]),l[5])):r=!0}},2I:1n(e,t){1a i=t.H.AB;if(1!==t.C5&&t.LC&&(1c===ZC.1d(t.o[ZC.1b[61]])&&(t.BU=t.A0),1c===ZC.1d(t.o[ZC.1b[62]])))1Q(i){1i"3f":t.AQ=.2;1p;1i"2F":t.AQ=.1;1p;1i"3L":t.AQ=.2,t.E.pU=t.C5/10}},1t:1n(e,t,i,a,n,l){if(1c===ZC.1d(n)&&(n=2),1c===ZC.1d(a)&&(a=!1),1c===ZC.1d(l)&&(l=!1),e&&i&&0!==i.1f&&t){1a r,o,s,C,A,Z;!l&&i.1f>2&&1c!==i[0]&&1c!==i[i.1f-1]&&i[0].2M(",")===i[i.1f-1].2M(",")&&(t.TJ="46");1a c=t.H.AB;if("3f"!==c||0!==t.AZ&&"-1"!==t.B7){if(t.ME&&1c!==ZC.1d(t.C6)&&!a){t.C6=t.C6||t.Z;1a p,u=ZC.P.o3(i,t);1y t.oY!==ZC.1b[31]?p=t.oY:((p=1m DR(t)).1S(t),p.K=t.K+"-sh",p.ME=!1,p.AZ+=p.PF,p.B7=p.S8),p.C5=t.C5*p.TF,1y t.145===ZC.1b[31]&&(t.oY=p),p.CW=!1,r=ZC.P.E5(t.C6,c),ZC.CM.2I(r,p),ZC.CM.1t(r,p,u,!1,1,l)}1a h=ZC.1k(t.EV||"0"),1b=ZC.1k(t.G8||"0");"2U"===t.GA&&(h=1b=0);1a d=i.1f;1y t.AA===ZC.1b[31]&&(t.AA=0),"3f"===c&&(e.141=t.eR,e.vB=t.TJ,e.n5=ZC.AO.ed(ZC.AO.G9(t.B7),a?t.O8:t.C5),e.cr=t.AZ,e.nf());1a f=!1;if(-1!==ZC.AT(["2F","3L"],c))o=l?[]:ZC.P.m5(i,c,t,a);1u{1a g=!1;"fm"!==t.GA&&(g=e.lN)&&e.lN(0===h||0===1b?[]:[h,1b]);1a B=0,v=[ZC.3u,ZC.3u,-ZC.3u,-ZC.3u];1j(Z=0;Z<d;Z++)if(1c!==i[Z]){if(1c!==(s=ZC.bE?i[Z]:ZC.P.k8(i[Z],c,t,a))&&!7X(s[0])&&!7X(s[1])&&fP(s[0])&&fP(s[1]))if(d<=6&&a&&(v[0]=ZC.CT(v[0],s[0]),v[1]=ZC.CT(v[1],s[1]),v[2]=ZC.BN(v[2],s[0]),v[3]=ZC.BN(v[3],s[1])),0===Z)2===s.1f?e.dX(s[0],s[1]):6===s.1f&&e.6y(s[0],s[1],s[2],ZC.TB(s[3]),ZC.TB(s[4]),s[5]);1u if(f&&(e.dX(s[0],s[1]),f=!1),g||0===h||0===1b||4===s.1f||6===s.1f||7===s.1f)2===s.1f?e.hQ(s[0],s[1]):4===s.1f?e.wf(s[0],s[1],s[2],s[3]):6===s.1f?e.6y(s[0],s[1],s[2],ZC.TB(s[3]),ZC.TB(s[4]),s[5]):7===s.1f&&e.13W(s[0],s[1],s[2],s[3],s[4],s[5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,t.H.O6[n].1I,t.H.O6[n].2R.2M(" "),t.H.O6[n].a9),t.H.O6[n]={ci:A,bC:e,2R:o,1I:t,a9:a};1p}"2F"===c?ZC.CM.U0(e,t,o.2M(" "),a,l):ZC.CM.U1(e,t,o.2M(" "),a)}if(1c!==ZC.1d(t.o["1v-3X"])&&!t.YP&&!t.E["b1-1v"]&&!t.WD){1a N=1m I2(t.A);N.1S(t),N.WD=!0,N.ME=!1,N.Z=t.Z,N.1C(t.o["1v-3X"]),N.K=t.K+"-1v",N.1q(),"2F"===c?ZC.CM.U0(e,N,o.2M(" "),a,l):"3L"===c?ZC.CM.U1(e,N,o.2M(" "),a):ZC.CM.1t(e,N,i,a,n,l)}}}},mN:1n(e,t,i){1a a,n,l,r;ZC.1d(t)&&(t=!1),i=i||"h";1a o=[],s=[];1j(a=0,n=e.1f;a<n;a++)e[a]&&("h"===i?(s.1h(e[a][0]),o.1h(e[a][1])):(s.1h(e[a][1]),o.1h(e[a][0])),0===a&&(s.1h(s[0]),o.1h(o[0])));1j(s.1h(s[s.1f-1]),o.1h(o[o.1f-1]),e=[],l=1,r=o.1f;l<r-1;l++){1a C=[o[l-1],o[l],o[l+1],o[l+2]],A=ZC.2l(s[l+1]-s[l]),Z=1/(A/C.1f),c=ZC.AN.YQ(t,C,A,Z);1j(a=0,n=c.1f;a<n;a++)1c!==ZC.1d(c[a][0])&&1c!==ZC.1d(c[a][1])?"h"===i?e.1h([s[l]+c[a][0]*A,c[a][1]]):e.1h([c[a][1],s[l]+c[a][0]*A]):e.1h(1c)}1l e},jj:1n(e,t,i){t.H&&t.H.G0?(1c===ZC.1d(t.H.G0[e.id])&&(t.H.G0[e.id]=2g.oB()),t.H.G0[e.id].3c(i)):e.3c(i)},U0:1n(e,t,i,a,n){if(""!==i||n){1a l,r,o,s,C,A,Z;ZC.4f.1U["2F-5q"]||(ZC.4f.1U["2F-5q"]=ZC.P.F3("5q",ZC.1b[36])),l=n?ZC.4f.1U["2F-5q"].jy(!0):ZC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t])}hl(e,t){1a i=1g;-1!==(""+e).1L("fR")&&(t="y"),-1!==(""+e).1L("fQ")&&(t="x"),e=ZC.1Y((""+e).1F("fR","").1F("fQ",""));1a a=1o.4W.4W[i.g0];1l a&&(e=1o.4W.149(a.bS.x,a.bS.y,a.bS.1s,a.bS.1M,"x"===t?[e,0]:[0,e],a.bS.v7,{3e:i.g0,1P:i.pH,3G:a.bS.3G,jN:a.bS.jN,jX:a.bS.jX},!0)),e=ZC.1k("x"===t?e[0]:e[1])}pV(e,t){1a i;-1!==(""+e).1L("8L")&&(t="y"),-1!==(""+e).1L("8b")&&(t="x"),e=ZC.1Y((""+e).1F("8b","").1F("8L",""));1a a=1g.H||1o.HY[0];if(a){1a n=1g.A||a.AI[0];n&&("x"===t?1c!==(i=n.BT("k")[0])&&(e=ZC.1k(i.AX(e))):1c!==(i=n.BT("v")[0])&&(e=ZC.1k(i.AX(e))))}1l ZC.1k(e)}cn(e,t,i){1a a=1g;t=t||"x";1a n=""+e;if(-1!==n.1L("fR")||-1!==n.1L("fQ"))1l a.hl(e,t);if(-1!==n.1L("8L")||-1!==n.1L("8b"))1l a.pV(e,t);if(""+ZC.1Y(e)!==n)1l-1!==(e+="").1L("%")?a.cn(5T(e.1F("%",""))/100,t,!0):-1!==e.1L("px")?a.cn(5T(e.1F("px","")),t):a.cn(5T(e),t);1a l=1y a.E["p-x"]!==ZC.1b[31]?a.E["p-x"]:a.A.iX,r=1y a.E["p-y"]!==ZC.1b[31]?a.E["p-y"]:a.A.iY,o=1y a.E["p-1s"]!==ZC.1b[31]?a.E["p-1s"]:a.A.I,s=1y a.E["p-1M"]!==ZC.1b[31]?a.E["p-1M"]:a.A.F;1l(e>=1||e<0||1o.3J.uy)&&!i?"x"===t?l+5T(e):r+5T(e):e>=0&&e<1||i?"x"===t?(o=o||1,1A.46(l+o*e)):(s=s||1,1A.46(r+s*e)):8o 0}9v(e){1a t,i=1g;if(i.TY)1l-1!==(""+i.o.x).1L("fQ")?i.iX=i.h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C.D[e].1f)1j(1a u=C.D[e][3];u<C.D[e][4];u+=1)i.1h(ZC.AN.BM(C.D[e][0],C.D[e][1],C.D[e][2],u));1u if(4===C.D[e].1f&&i[e-1]){1a h={x:i[i.1f-1][0],y:i[i.1f-1][1]},1b={x:C.D[e][2],y:C.D[e][3]},d={x:C.D[e][0],y:C.D[e][1]};1j(c=0;c<=1;c+=.1)i.1h([(1-c)*(1-c)*h.x+2*c*(1-c)*d.x+c*c*1b.x,(1-c)*(1-c)*h.y+2*c*(1-c)*d.y+c*c*1b.y])}1u if(7===C.D[e].1f&&i[e-1]){1a f={x:i[i.1f-1][0],y:i[i.1f-1][1]},g={x:C.D[e][0],y:C.D[e][1]},B={x:C.D[e][2],y:C.D[e][3]},v={x:C.D[e][4],y:C.D[e][5]};1j(c=0;c<=1;c+=.1){1a E=(1-c)*(1-c)*(1-c),b=3*c*(1-c)*(1-c),m=3*c*c*(1-c),K=c*c*c;i.1h([E*f.x+b*g.x+m*B.x+K*v.x,E*f.y+b*g.y+m*B.y+K*v.y])}}1u i.1h(C.D[e]);1u i.1f>-1&&p.1h(ZC.AN.Q7(i,1A.2k(5,C.AH/5),[C.BJ,C.BC])),i=[];if(0!==C.AA)1j(a=ZC.1k((C.CY[0]+C.CY[2])/2),n=ZC.1k((C.CY[1]+C.CY[3])/2),e=0,t=i.1f;e<t;e++)1c!==i[e]&&(l=i[e][0]-a,r=i[e][1]-n,o=l*ZC.EE(C.AA)-r*ZC.EK(C.AA),s=l*ZC.EK(C.AA)+r*ZC.EE(C.AA),i[e]=[o+a,s+n]);1l i.1f>-1&&p.1h(ZC.AN.Q7(i,1A.2k(5,C.AH/5),[C.BJ,C.BC])),p}}1q(e){1a t,i,a,n,l,r,o;1c===ZC.1d(e)&&(e=!1),1g.o.cM||e||1D.1q();1a s=1g;if(!s.o.cM&&!e){s.4C([["3e","g0"]]),"3b"==1y s.o.1P&&s.4C([["1P","pH"]]),0!==s.g0&&(1c===ZC.1d(s.o["3e-1P"])||s.o["3e-1P"])&&(s.o["3e-1P"]=!0,s.o["3e-b1-z-3Z"]=!0);1a C=["2a-x","2a-y"];1j(i=0;i<2;i++){1a A=C[i],Z="2a-x"===A?"fQ":"fR";if(1c!==(t=s.o[A])&&1y t!==ZC.1b[31]&&-1!==(t=""+t).1L(Z)){t=ZC.1Y(t.1F(Z,""));1a c=1o.4W.4W[s.g0];c&&(t=1o.4W.6Y(A.1F("2a-"),t,s.A.I,s.A.F,c.bS.v7),s.o[A]=t)}}1j(s.4C([["3R","E4"],["2X","FE"],["4U","IV"],["id","H3"],["2f","AA","i"],["8A","KC","b"],["7N","KC","b"],[ZC.1b[1],"B2","f"],[ZC.1b[2],"BH","f"],[ZC.1b[8],"CJ","i"],[ZC.1b[21],"AH","f"],["2e-2","L1","f"],["8u-dc-2R","QP","b"],["1J","DN"],["2W","D"],["2a-x","BJ"],["2a-y","BC"],["2a-z","t0","i"],["2a-r","DQ","i"],["z-3Z","n3","i"],["z-2Z","JR","f"],["10M","hy"]]),s.BJ=ZC.IL(s.BJ,!0),s.BC=ZC.IL(s.BC,!0),s.BJ>-1&&s.BJ<1&&1y s.E["p-1s"]!==ZC.1b[31]&&(s.BJ*=s.E["p-1s"]),s.BC>-1&&s.BC<1&&1y s.E["p-1M"]!==ZC.1b[31]&&(s.BC*=s.E["p-1M"]),s.AH=ZC.BN(1,s.AH),s.L1=ZC.BN(1,s.L1),1c!==s.o["z-3Z"]&&1y s.o["z-3Z"]!==ZC.1b[31]||(s.n3=s.JR),"fW"!==s.DN&&"5q"!==s.DN||s.4C([[ZC.1b[19],"AH","f"],[ZC.1b[20],"L1","f"]]),s.na?(s.D=3g.1q(3g.5b(s.FA)),s.na=!1):s.FA=3g.1q(3g.5b(s.D)),i=0,a=s.D.1f;i<a;i++)if(1c!==s.D[i])1j(1a p=0;p<s.D[i].1f;p++)-1===(""+s.D[i][p]).1L("fR")&&-1===(""+s.D[i][p]).1L("fQ")||(s.na=!0,s.D[i][p]=s.hl(s.D[i][p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+"-2c",n.1q(),i=!1,a)1c===ZC.1d(n.o[t])||-1===(""+n.o[t]).1L("+")&&-1===(""+n.o[t]).1L("-")||(n.o[t]=n[a[t]]=e[a[t]]+ZC.1k(n.o[t])),i&&n.1q();n.1t()}1a l=e.H.AB;1Q(e.ME&&e.C6&&e.nb(),l){1i"3f":e.WS();1p;1i"2F":e.U0();1p;1i"3L":e.U1()}if(e.o["1v-3X"]&&!e.YP&&!e.WD&&!e.eW){1a r=1m DR(e.A);1j(t in r.1S(e),r.WD=!0,r.ME=!1,r.Z=e.Z,r.1C(e.o["1v-3X"]),r.K=e.K+"-1v",r.1q(),i=!1,a)1c===ZC.1d(r.o[t])||-1===(""+r.o[t]).1L("+")&&-1===(""+r.o[t]).1L("-")||(r.o[t]=r[a[t]]=e[a[t]]+ZC.1k(r.o[t]),i=!0);i&&r.1q(),r.1t()}}}nb(){1a e,t=1g,i=1m DR(t.A);i.K=t.K+"-sh",i.1S(t),i.OD=t.OD,i.Z=t.C6,i.ME=!1,i.YP=!0,i.A0=i.AC=i.S8,i.GO=i.HM="",i.D7="",i.GA="2U",i.BU=i.S8,i.AZ=0,i.C5=i.TF*t.C5,i.K=t.K+"-sh";1a a=(t.JY-t.PF)*ZC.EE(t.OQ)+t.PF,n=(t.JY-t.PF)*ZC.EK(t.OQ)+t.PF;if(i.iX=t.iX+5z(a,10),i.iY=t.iY+5z(n,10),i.AH=t.AH+t.PF,t.D.1f>0){e=[];1j(1a l=0,r=t.D.1f;l<r;l++)if(1c!==t.D[l]){1j(1a o=[],s=0;s<t.D[l].1f;s++)o[s]=t.D[l][s];o[0]=t.D[l][0]+5z(a,10),o[1]=t.D[l][1]+5z(n,10),e.1h(o)}1u e.1h(1c)}i.CY=[t.CY[0]+a,t.CY[1]+n,t.CY[2]+a,t.CY[3]+n],i.D=e,i.1t()}WW(){1a e=1g;1l{lc:"-1"===e.B7?"9S(3U,3U,3U,0)":1===e.C5?e.B7:ZC.AO.ed(ZC.AO.G9(e.B7),e.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,11u,11L,2L,wJ,lS,u0,lW,11q","I,F,F2,FT,F0,FC,KU,EP,DI,H6,G5,ET,MC,oo,QC,ON,NX,PL,FB"),e}6a(){}mb(e,t,i){1a a=1g;if(t=t||"w",ZC.1Y(e)+""!=e+"")1l-1!==(e+="").1L("%")?a.mb(ZC.1Y(e.1F("%",""))/100,t,!0):-1!==e.1L("px")?a.mb(ZC.1Y(e.1F("px","")),t):a.mb(ZC.1Y(e),t);1a n=1y a.E["p-1s"]!==ZC.1b[31]?a.E["p-1s"]:a.A.I,l=1y a.E["p-1M"]!==ZC.1b[31]?a.E["p-1M"]:a.A.F;1l(e=ZC.2l(e))>1&&!i?ZC.1k(e):e<=1||i?"w"===t?ZC.1k(n*e):ZC.1k(l*e):8o 0}6e(e,t,i,a,n){1a l,r,o=1g;if(i=i||0,a=a||0,t=t||"4s",n=n||"n","4s"===t){1a s=5Q(e).2o(/\\s+|;|,/);1l 1===s.1f?[o.6e(s[0],"tb",i,a,n),o.6e(s[0],"lr",i,a,n),o.6e(s[0],"tb",i,a,n),o.6e(s[0],"lr",i,a,n)]:2===s.1f?[o.6e(s[0],"tb",i,a,n),o.6e(s[1],"lr",i,a,n),o.6e(s[0],"tb",i,a,n),o.6e(s[1],"lr",i,a,n)]:3===s.1f?[o.6e(s[0],"tb",i,a,n),o.6e(s[1],"lr",i,a,n),o.6e(s[2],"tb",i,a,n),o.6e(s[1],"lr",i,a,n)]:[o.6e(s[0],"tb",i,a,n),o.6e(s[1],"lr",i,a,n),o.6e(s[2],"tb",i,a,n),o.6e(s[3],"lr",i,a,n)]}1l e+""=="3i"?-2:e+""=="4O"&&"y"===n?"4O":ZC.1Y(e)+""!=e+""?-1!==(e+="").1L("%")?o.6e(ZC.1Y(e.1F("%",""))/100,t):-1!==e.1L("px")?o.6e(ZC.1Y(e.1F("px","")),t):o.6e(ZC.1Y(e),t):((o.A||1y o.E["p-1s"]!==ZC.1b[31])&&(l=1y o.E["p-1s"]!==ZC.1b[31]?o.E["p-1s"]:o.A.I),(o.A||1y o.E["p-1M"]!==ZC.1b[31])&&(r=1y o.E["p-1M"]!==ZC.1b[31]?o.E["p-1M"]:o.A.F),(e=ZC.2l(e))>=1?ZC.1k(e):e<1?"lr"===t?ZC.1k((o.A?l:i)*e):ZC.1k((o.A?r:a)*e):8o 0)}1S(e){1D.1S(e);1j(1a t="I,F,E1,DM,DY,E2,F2,FT,F0,FC,KU,EP,DI,YC,H6,G5,ET,MC,oo,QC,ON,NX,PL,FB".2o(","),i=0,a=t.1f;i<a;i++)1y e[t[i]]!==ZC.1b[31]&&(1g[t[i]]=e[t[i]])}9v(e){1a t,i,a,n,l,r=1g;if(2!==(e=e||1))if(r.TY)r.4C([["x","iX"],["y","iY"],[ZC.1b[19],"I"],[ZC.1b[20],"F"]]);1u{1a o=1y r.E["p-x"]!==ZC.1b[31]?r.E["p-x"]:r.A.iX,s=1y r.E["p-y"]!==ZC.1b[31]?r.E["p-y"]:r.A.iY,C=1y r.E["p-1s"]!==ZC.1b[31]?r.E["p-1s"]:r.A.I,A=1y r.E["p-1M"]!==ZC.1b[31]?r.E["p-1M"]:r.A.F;if(!r.Q8){1a Z=0,c=0,p=0,u=0;if(1c!==ZC.1d(r.o.2y)){1a h=""+r.o.2y;if(-1!==h.1L("4O")){1a 1b=r.6e(h,"4s",0,0,"y");"4O"===1b[0]&&(r.E["d-2y-1v"]=r.E["d-2y"]=!0),"4O"===1b[1]&&(r.E["d-2y-2z"]=r.E["d-2y"]=!0),"4O"===1b[2]&&(r.E["d-2y-2c"]=r.E["d-2y"]=!0),"4O"===1b[3]&&(r.E["d-2y-1K"]=r.E["d-2y"]=!0),r.o.2y=h.1F(/4O/g,"20")}}"4O"===r.o.2y&&(r.E["d-2y"]=r.E["d-2y-1v"]=r.E["d-2y-2z"]=r.E["d-2y-2c"]=r.E["d-2y-1K"]=!0,r.o.2y=1c),1y r.E["d9-eZ"]===ZC.1b[31]||1c!==ZC.1d(r.o["9b-3y"])&&ZC.2t(r.o["9b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r.DM=r 3E DP?p:0,r.iY=s+r.E1,r.F=A-r.E1-r.DM):(r.E1=Z,r.DM=p,r.iY=s+r.E1,r.F=A-r.E1-r.DM);if(1c!==(t=ZC.1d(r.o.2L))){if(r.A&&1y r.A.iX!==ZC.1b[31]&&1y r.A.iY!==ZC.1b[31]&&1y r.A.I!==ZC.1b[31]&&1y r.A.F!==ZC.1b[31]){1Q(a=0,n=0,(l=5Q(t).2o(/\\s+/))[0]){1i"1K":a=0;1p;1i"2z":a=1;1p;1i"3H":a=.5;1p;2q:(a=ZC.IL(l[0]))>1&&(a/=r.A.I)}1Q(l[1]){1i"1v":n=0;1p;1i"2c":n=1;1p;1i"6s":n=.5;1p;2q:(n=ZC.IL(l[1]))>1&&(n/=r.A.F)}}r.E["2L-6w"]=[a,n],r.iX=r.A.iX+ZC.1k(a*(r.A.I-r.I-v[1]-v[3]))+v[3],r.iY=r.A.iY+ZC.1k(n*(r.A.F-r.F-v[0]-v[2]))+v[0]}r.CY=[r.iX,r.iY,r.iX+r.I,r.iY+r.F]}}}1q(){1D.1q();1a e,t=1g;if(!t.o.cM){if(t.4C([["bi","X5"],["5q-Cm","FB","b"],["3H-3Q","om","b"],["6I","KU","b"],["6I-1J","11k"],["6I-2L","EP"],["6I-7m","DI"],["6I-fV","YC"],["6I-1s","H6","i"],["6I-1M","G5","i"],["6I-2a","ET","i"],["6I-sw","MC","i"],["1G-1v","QC"],["1G-2z","ON"],["1G-2c","NX"],["1G-1K","PL"]]),1c!==(e=ZC.1d(t.o["1G-9y"]))){1a i=5Q(e).2o(/\\s+|;|,/);2===i.1f?(t.F2=t.FT=ZC.1k(i[0]),t.F0=t.FC=ZC.1k(i[1])):4===i.1f?(t.F2=ZC.1k(i[0]),t.FT=ZC.1k(i[1]),t.F0=ZC.1k(i[2]),t.FC=ZC.1k(i[3])):t.F2=t.FT=t.F0=t.FC=ZC.1k(i[0])}1c!==ZC.1d(t.o["6I-mi"])&&(t.OS=1m DR(t.A)),t.4C([["1G-9y-1v-1K","F2","i"],["1G-9y-1v-2z","FT","i"],["1G-9y-2c-2z","F0","i"],["1G-9y-2c-1K","FC","i"]])}}UX(e){1a t=e.2o(/\\s/);1l t[0]=ZC.1k(t[0]),t[2]=ZC.AO.G9(t[2]),t}1t(){1a e=1g;if(1c!==e.DI&&!(e.DI 3E 3M)&&"wz"===e.A.OE){1a t=e.A.OJ(e.DI);e.DI=[t[0],t[1]],e.DI[0]-=e.BJ,e.DI[1]-=e.BC}if(e.om&&(e.iX-=e.I/2,e.iY-=e.F/2),"-1"!==e.BU&&0!==e.AQ||e.QC+e.ON+e.NX+e.PL!==""||"-1"!==e.A0||"-1"!==e.AC||""!==e.D7||""!==e.GO||""!==e.HM){1a i=e.H.AB;e.ME&&e.C6&&e.nb();1a a,n={x:"iX",y:"iY",1s:"I",1M:"F"};if(e.o["2c-3X"]&&!e.YP&&!e.eW&&!e.WD){1a l=1m I2(-1===e.A.iX&&-1===e.A.iY?e:e.A);1j(a in l.1S(e),l.eW=!0,l.ME=!1,l.Z=e.Z,l.X5=e.X5,l.1C(e.o["2c-3X"]),l.K=e.K+"-2c",l.1q(),l.hq(),n)1c===ZC.1d(l.o[a])||-1===(""+l.o[a]).1L("+")&&-1===(""+l.o[a]).1L("-")||(l[n[a]]=e[n[a]]+ZC.1k(l.o[a]));l.1t()}if(e.QC+e.ON+e.NX+e.PL===""){1Q(i){1i"3f":e.WS();1p;1i"2F":e.U0();1p;1i"3L":e.U1()}if(e.KU&&e.OS){1a r,o;if(e.DI&&2===e.DI.1f?(r=e.DI[0],o=e.DI[1]):e.E.cp&&(r=e.E.cp[0],o=e.E.cp[1]),e.OS.Z=e.OS.C6=e.Z,e.OS.1S(e),e.OS.1C(e.o["6I-mi"]),e.OS.K=e.K+"-6I-mi",e.OS.o.x=r,e.OS.o.y=o,e.E.cm){1a s=e.E.cm[0],C=e.E.cm[1],A=1A.nw(ZC.1k(C)-ZC.1k(o),ZC.1k(s)-ZC.1k(r));7X(A)&&(A=0),1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)1l e.1F(/(<([^>]+)>)/gi,"").1f*t.DG/(t.q5*(t.k2(t.7K)?.87:1)*(t.N9?.95:1));1a i="";1l 1y t.o["4d-4D"]!==ZC.1b[31]&&ZC.2t(t.o["4d-4D"])&&(i="[pR]"),ZC.P.kL(1g.H.K,i+e,1g.GF,1g.DG,1g.7K,1g.FH)}1q(){1g.I=1g.F=1g.NU=1g.KQ=0,1D.1q();1a e,t,i,a,n,l=1g;if(!l.o.cM){if(l.YS("1E","AP"),1c!==ZC.1d(l.AP)&&(l.AP=""+l.AP,l.AP=l.EX(l.AP),l.AP=l.AP.1F(/\\n/g,"<br>").1F(/\\\\n/g,"<br>"),"2F"===l.H.AB&&(l.AP=l.AP.1F(/&8x;/g," "))),l.4C([["iQ","qT","b"],["8u-1s","XF","b"],["1X-1s","OW","i"],["1w-1M","FH","i"],["1s-fV","q5","f"],["11J-1E","iP","b"],["3v-1E","qg","b"],["6z","hu","b"],["bm","N9","b"],["hk","R4","b"],["1E-bL","KD"],["aG","hN","b"],["1E-3x","OH"],["3x","OH"],["9A-3x","JZ"],["2s-2e","DG","f"],["1X-sI","YL","i"],["2s-9i","GF"],["2s-2f","AA","i"],["1r","C0","c"],["2s-1r","C0","c"],["1E-2n","X4","f",0,1],["11I-pP","VP","b"]]),l.DG=ZC.BN(1,l.DG),1c===ZC.1d(l.o["1E-2n"])&&(l.X4=l.C5),l.hu&&(l.7K="6z"),1c!==(e=ZC.1d(l.o["2s-79"]))&&(l.7K=e),1c===ZC.1d(l.o["1E-bL"])&&(l.KD=l.R4?"hk":"2b"),1c!==(e=ZC.1d(l.o["2s-1I"]))&&(l.N9="bm"===e||"bk"===e),1c!==(e=ZC.1d(l.o.3w))){1a r=5Q(e).2o(/\\s+|;|,/);t=1===r.1f?[ZC.1k(r[0]),ZC.1k(r[0]),ZC.1k(r[0]),ZC.1k(r[0])]:2===r.1f?[ZC.1k(r[0]),ZC.1k(r[1]),ZC.1k(r[0]),ZC.1k(r[1])]:3===r.1f?[ZC.1k(r[0]),ZC.1k(r[1]),ZC.1k(r[2]),ZC.1k(r[0])]:[ZC.1k(r[0]),ZC.1k(r[1]),ZC.1k(r[2]),ZC.1k(r[3])],l.FP=t[0],l.FR=t[1],l.FZ=t[2],l.EN=t[3]}if(l.4C([["3w-1v","FP","i"],["3w-2z","FR","i"],["3w-2c","FZ","i"],["3w-1K","EN","i"]]),l.AP){l.YL>0&&l.AP.1f>l.YL&&(l.AP=l.AP.2x(0,l.YL)+"...");1a o=l.AP.2o(/<br>|<br\\/>|<br \\/>|\\n/),s="";1y l.o["4d-4D"]!==ZC.1b[31]&&ZC.2t(l.o["4d-4D"])&&(o=[l.AP],s="[pR]");o.1f;1j(l.KQ=ZC.P.kL(1g.H.K,s+l.AP,1g.GF,1g.DG,1g.7K,1g.FH,!0)+l.FP+l.FZ,i=0,a=o.1f;i<a;i++)l.NU=ZC.BN(l.NU,l.eM(o[i])+l.EN+l.FR)}1u l.AP="",l.NU=ZC.1k(1.25*l.DG),l.KQ=-1===l.FH?ZC.1k(1.25*l.DG):l.FH;if((1c===ZC.1d(l.o[ZC.1b[19]])||7X(l.I)||0===l.I)&&(l.I=l.NU),(1c===ZC.1d(l.o[ZC.1b[20]])||7X(l.F)||0===l.F)&&(l.F=l.KQ),l.I=ZC.CT(l.I,l.OW),l.iP&&l.NU>l.I&&!l.E.pf&&l.I>2*l.DG){1a C,A="",Z=0,c=l.AP.1F(/<br>/gi," [##] ").2o(/\\s|<br>/),p=[];1j(i=0,a=c.1f;i<a;i++)if((C=l.eM(c[i]))>.9*l.I){1a u=1A.4h(C/l.I*.9),h=1A.4h(c[i].1f/u);1j(n=0;n<u;n++)p.1h(c[i].5w(n*h,h))}1u p.1h(c[i]);1j(i=0,a=p.1f;i<a;i++)""!==p[i]&&("[##]"===p[i]?(A+="<br>",Z=0):(Z+=C=1+l.eM(p[i]+" "))>.9*l.I?(i>0&&(A+="<br>"),A+=p[i]+" ",Z=C):A+=p[i]+" ");A=(A=A.1F(/<br><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(ZC.md(cB[i])));ZC.i9 3E 3M&&-1!==ZC.AT(ZC.i9,pZ)&&(s.UB=!0,XK(pZ))}ZC.cC 3E 3M&&2===ZC.cC.1f&&(F4=ZC.xv(s.wg),F4=F4.1F("O","0"),s.SL=ZC.uY(ZC.cC[0],F4),s.SL===ZC.cC[1]&&(s.UB=!0,s.k5=!0,XK(ZC.cC[0])))}}mW(){1a e=1g;if(1c!==e.MT)ZC.6x(e.MT),e.2w();1u if(1c===ZC.1d(ZC.4f.1U["d5-"+e.R2])){1a t=["gs-3b"===e.N6?"go="+1A.cX():"",1o.iq?"k1="+e.AB:""].2M("&");ZC.A4.ao({1J:"bY",3R:e.R2,pn:"1E",eg:1n(t){e.S7.d5||"7h-g9"!==e.N6||t.cV(ZC.1b[45],"cU, 8B cT dN 6P:6P:6P dM")},1U:t,4L:1n(t,i,a,n){1l e.NG({8D:ZC.1b[63],aJ:"bV cI fb ("+n+")"},ZC.1b[64]),!1},aB:1n(t){1a i;4M{i=3g.1q(t),ZC.4f.1U["d5-"+e.R2]=t}4K(a){1l e.NG(a,"3g jE"),!1}e.MT=i,ZC.6x(e.MT),e.2w()}})}1u{1a i;4M{i=3g.1q(ZC.4f.1U["d5-"+e.R2])}4K(a){1l e.NG(a,"3g jE"),!1}e.MT=i,ZC.6x(e.MT),e.2w()}}2w(e,t){1a i=1g;if(i.MJ="2w",""!==(t=t||i.QZ)&&0!==t.1L("7s:"))if(1c===ZC.1d(ZC.4f.1U["1U-"+t])){1a a=["gs-3b"===i.N6?"go="+1A.cX():"",1o.iq?"k1="+i.AB:""].2M("&");ZC.A4.ao({1J:"bY",3R:t,pn:"1E",eg:1n(e){i.S7.1U||"7h-g9"!==i.N6||e.cV(ZC.1b[45],"cU, 8B cT dN 6P:6P:6P dM")},1U:a,4L:1n(e,t,a,n){1l i.NG({8D:ZC.1b[63],aJ:"bV cI fb ("+n+")"},ZC.1b[64]),!1},aB:1n(t){i.i6(e,t)}})}1u i.i6(e,ZC.4f.1U["1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G[e.L]:G[0];t.id||(t.id=e.o.id||""),s.o[ZC.1b[16]][e.L]=t,s.OR(1n(){s.1q(JJ),s.AI[e.L].1t()})}}})})}VS(DF){1a s=1g,G,i,A5,j,JA;1j(1c===ZC.1d(DF[ZC.1b[16]])&&(DF={aS:[DF]}),1===DF[ZC.1b[16]].1f&&1c===ZC.1d(DF[ZC.1b[16]][0])&&(DF[ZC.1b[16]]=[{1J:"1c"}]),i=0,A5=DF[ZC.1b[16]].1f;i<A5;i++)if(1c!==ZC.1d(DF[ZC.1b[16]][i])){if(1c!==ZC.1d(G=DF[ZC.1b[16]][i].5X)){1a FG=[];1j(DF[ZC.1b[16]][i][ZC.1b[10]]=DF[ZC.1b[16]][i][ZC.1b[10]]||[],j=0,JA=G.1f;j<JA;j++)if(G[j].eE&&G[j]["3e-1P"]||FG.1h(G[j]),1c!==ZC.1d(G[j].1J)&&0===G[j].1J.1L("1o."))4M{1a M5=G[j].Ch||{},EG=G[j].1J+"."+(M5.8D||"");M5[ZC.1b[3]]=i;1a fF=7t(EG).4v(s,M5,DF,G[j]);1j(1a i4 in fF)fF.8d(i4)&&("1H"===fF[i4].jI?DF[ZC.1b[16]][i][ZC.1b[10]].1h(fF[i4]):FG.1h(fF[i4]))}4K(e){}DF[ZC.1b[16]][i].5X=FG}1a jK;if(1c!==ZC.1d(jK=DF[ZC.1b[16]][i].fB))1j(1a w2=s.rB(DF,i),k=0;k<jK.1f;k++){1a fz=jK[k];if(1c!==ZC.1d(fz.1J)&&1c!==ZC.1d(1o.fB[fz.1J])&&"1n"==1y 1o.fB[fz.1J].1q)4M{1a BP={};ZC.2E(fz,BP),BP.2Y=w2.2Y,BP.6G={id:s.K,1s:s.I,1M:s.F};1a o=1o.fB[fz.1J].1q.4v(s,BP);if(1c!==ZC.1d(G=o.Ht))1j(j=0;j<G.1f;j++)DF[ZC.1b[16]].1h({}),ZC.2E(G[j],DF[ZC.1b[16]][DF[ZC.1b[16]].1f-1]);if(1c!==ZC.1d(G=o[ZC.1b[10]]))1j(1c===ZC.1d(DF[ZC.1b[16]][i][ZC.1b[10]])&&(DF[ZC.1b[16]][i][ZC.1b[10]]=[]),j=0;j<G.1f;j++)DF[ZC.1b[16]][i][ZC.1b[10]].1h(G[j]);if(1c!==ZC.1d(G=o.5X))1j(1c===ZC.1d(DF[ZC.1b[16]][i].5X)&&(DF[ZC.1b[16]][i].5X=[]),j=0;j<G.1f;j++)DF[ZC.1b[16]][i].5X.1h(G[j])}4K(e){}}}}Gj(e,t){1a i=1g;1Q(e){1i"1w":1l 1m qp(i);1i"1N":1l 1m qq(i);1i"bR":1l 1m Dm(i);1i"bQ":1l 1m Do(i);1i"2V":1i"5x":1i"94":1l 1m ln(i);1i"6b":1l 1m l2(i);1i"9z":1i"h7":1i"aZ":1j(1a a=!1,n=i.o[ZC.1b[16]][t][ZC.1b[11]],l=0,r=n.1f;l<r;l++)n[l]&&n[l].1J&&-1!==n[l].1J.1L("3d")&&(a=!0);1l a?1m qc(i):i.o[ZC.1b[16]][t].1B&&i.o[ZC.1b[16]][t].1J&&i.o[ZC.1b[16]][t].1B&&i.o[ZC.1b[16]][t].1B.1J&&-1!==i.o[ZC.1b[16]][t].1B.1J.1L("3d")?1m qc(i):"9z"===e?1m qd(i):1m Dp(i);1i"6v":1l 1m Ds(i);1i"8p":1l 1m Dj(i);1i"5g":1l 1m Du(i);1i"6A":1l 1m Dw(i);1i"9f":1i"3P":1l 1m qn(i);1i"8Z":1l 1m Ea(i);1i"7j":1i"q4":1l 1m Eb(i);1i"b6":1l 1m zB(i);1i"fO":1i"8m":1l 1m Gm(i);1i"8h":1l 1m Gr(i);1i"q0":1i"au":1l 1m Gg(i);1i"af":1l 1m Fo(i);1i"vF":1i"5N":1l 1m Gt(i);1i"7Y":1l 1m Fq(i);1i"5A":1l 1m Fu(i);1i"oX":1l 1m Fm(i);1i"8z":1l 1m Fs(i);1i"92":1l 1m Ad(i);1i"88":1l 1m Dg(i);1i"oD":1i"7a":1l 1m FK(i);1i"ek":1i"6U":1l 1m Gf(i);1i"7z":1l 1m Ga(i);1i"qa":1l 1m Ex(i);2q:1l 1m Fh(i)}}OF(e){1j(1a t=1g,i=0,a=t.AI.1f;i<a;i++)if(t.AI[i].K===t.K+"-2Y-"+e||t.AI[i].K===t.K+"-2Y-id"+e||t.AI[i].K===e||i===e)1l t.AI[i];1l 1c}ng(e,t){1a i=1g,a=ZC.A4("#"+i.K+("2F"===i.AB?"-1v":"-3Y")),n=ZC.a5(i.K);e-=a.2a().1K,t-=a.2a().1v;1j(1a l=1c,r=0,o=i.AI.1f;r<o;r++)ZC.DT(e,i.AI[r].iX,i.AI[r].iX+i.AI[r].I*n[0])&&ZC.DT(t,i.AI[r].iY,i.AI[r].iY+i.AI[r].F*n[1])&&(l=i.AI[r]);1l l}pg(e){1a t,i=1g;if(1y i.E.vy===ZC.1b[31]){1y e===ZC.1b[31]&&(e=!1),i.4C([["bJ","LU"]]),i.o[ZC.1b[16]]&&1===i.o[ZC.1b[16]].1f&&1c!==ZC.1d(t=i.o[ZC.1b[16]][0].bJ)&&(i.LU=t),""===i.LU&&(i.LU="9c"),i.LU=5Q(i.LU).1F("1o","d0");1j(1a a=i.LU.2o(/\\s+|;|,/),n=0,l=a.1f;n<l;n++)i.B9.oZ(a[n]);i.B9.mW(i.MT),ZC.2K&&i.B9.oZ("2K"),e||(i.E.vy=!0)}}1q(e){1a t,i,a,n,l,r,o=1g;o.NM="x",o.E.4H=ZC.GR(3g.5b(o.o)),ZC.2E(o.o.vu,o.O7),1===o.o[ZC.1b[16]].1f&&ZC.2E(o.o[ZC.1b[16]][0].vu,o.O7);1a s=o.FD();if(1c!==ZC.1d(e)&&(s[ZC.1b[3]]=e),ZC.AO.C2("Il",o,s),o.MJ="1q",o.QR[1]=o.QR[0],o.QR[0]="",o.QR[0]+=o.I+":"+o.F+":",1c!==ZC.1d(t=o.o[ZC.1b[16]]))1j(o.QR[0]+=t.1f+":",n=0;n<t.1f;n++)o.QR[0]+=(t[n].1J||"")+":",o.QR[0]+=(t[n].x||"")+":"+(t[n].y||"")+":"+(t[n][ZC.1b[19]]||"")+":"+(t[n][ZC.1b[20]]||"")+":",1c!==ZC.1d(t[n][ZC.1b[11]])&&(o.QR[0]+=t[n][ZC.1b[11]].1f+":");if(ZC.AK(o.K+"-3Y-c")&&o.3j(e,!1),1y jF!==ZC.1b[31]&&(o.HA=1m jF(o)),1c===ZC.1d(e)){o.pg(),o.B9.B9["2s-9i"]&&(1o.9J=o.B9.B9["2s-9i"]);1a C=!!o.o.5i;if(o.B9.2w(o.o,"6G",!1,!0),o.4C([["5i","DD"],["yI","R0"]]),o.o[ZC.1b[16]]&&1===o.o[ZC.1b[16]].1f&&(i=o.o[ZC.1b[16]][0],1c!==ZC.1d(t=i.5i)&&(o.DD=t),1c!==ZC.1d(t=i.yI)&&(o.R0=t)),ZC.6x(o.R0),ZC.2E(o.B9.B9.ap.5i,o.DD,!1,!0,!0),o.DD.al)1j(n=o.DD.al.1f-1;n>=0;n--)1j(r=0;r<n;r++)if(o.DD.al[n].id===o.DD.al[r].id){o.DD.al.6u(n,1);1p}if(C||4t o.o.5i,ZC.6x(o.DD),o.N={},1c!==ZC.1d(t=o.o.1I))1j(a in t)"3R"!==a&&(o.N[a]=t[a]);if(o.o[ZC.1b[16]]&&1===o.o[ZC.1b[16]].1f&&(i=o.o[ZC.1b[16]][0],1c!==ZC.1d(t=i.1I)))1j(a in t)"3R"!==a&&(o.N[a]=t[a]);ZC.6x(o.N),o.O7[ZC.1b[16]]&&1D.1q(),o.4C([["i0","dO"],["m9-i0","dO"],["3y","NM"],["h-8w","ja","i"],["v-8w","j8","i"],["7N","KC","b"],["4m-7O","mn","b"]]),o.o[ZC.1b[16]]&&1===o.o[ZC.1b[16]].1f&&(i=o.o[ZC.1b[16]][0],1c!==ZC.1d(t=i.i0)&&(o.dO=t),1c!==ZC.1d(t=i["m9-i0"])&&(o.dO=t),1c!==ZC.1d(t=i.7N)&&(o.KC=ZC.2t(t)),1c!==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"4e"])),".6O"===o.5w(o.1f-4,4)&&"3b"==1y e[a]&&i.1h([e[a],"6O"]),"3R"===a&&(-1!==o.1L(".1I.")&&i.1h([e[a],"2O"]),-1!==o.1L(".6O.")&&i.1h([e[a],"6O"]),-1!==o.1L(".1R.")&&i.1h([e[a],"4e"])),"3b"==1y e[a]&&"3R"!==a&&(0===e[a].1L("3R:")&&a===ZC.1b[5]||0===e[a].1L("7s:"))&&-1===ZC.AT(["5D","1E","Hk"],ZC.EB(a))&&i.1h([e[a],"1U"])}1l i}OR(JC){1a s=1g;if(1o.3J.qX){1a J5=s.jz(s.o).4A(s.jz(s.MT));if(0!==J5.1f){1a UY=0,LP={},r8=0;s.E["bZ-8J"]=s.E["bZ-8J"]||[];1a C4=2u.eP(1n(){if(UY>=J5.1f){1j(1a e in 2u.9W(C4),s.nT(s.o),LP)if(0!==e.1L("1U:")&&-1===ZC.AT(s.E["bZ-8J"],e))4M{1a t=2g.4V("3f");t.1s=LP[e].1s,t.1M=LP[e].1M,t.9q("2d").cg(LP[e],0,0);1a i=t.kB("4e/9V");LP[e].gx=1c,LP[e].jl=1c,LP[e].4X=i,ZC.4f.1U[e]=LP[e]}4K(a){}2u.5E(1n(){1o.YF[s.K]&&JC()},1)}1u qB(++r8)},20);qB(r8)}1u 1o.YF[s.K]&&JC()}1u 1o.YF[s.K]&&JC();1n qB(i){if(!(i>=J5.1f)){1a F8,ML,KH=J5[i][0],l5=J5[i][1];if("3R:"===KH.2x(0,4)){1a QZ=KH.2x(4);s.QU["3R:"+QZ]="[]";4M{F8=["gs-3b"===s.N6?"go="+1A.cX():""].2M("&"),ZC.A4.ao({1J:"bY",3R:QZ,eg:1n(e){s.S7.1U||"7h-g9"!==s.N6||e.cV(ZC.1b[45],"cU, 8B cT dN 6P:6P:6P dM")},1U:F8,4L:1n(e,t,i,a){1l s.NG({8D:ZC.1b[63],aJ:"bV cI fb ("+a+")"},ZC.1b[64]),!1},aB:1n(e,t,i,a){s.QU["3R:"+a]=e,UY++}})}4K(JB){1l s.NG(JB,ZC.1b[64]),!1}}1u if("7s:"===KH.2x(0,11))if("zc.Nu.2w"===s.QU[KH]){s.QU[KH]="[]";1a DW=ZC.AO.ru(KH.2x(11)),O={id:s.K,t8:KH,5H:1n(e){s.QU[KH]=e,UY++}},Em=DW[0];O.98=DW[1];4M{1a jq=7t(Em).4v(s,O);1c!==ZC.1d(jq)&&jq&&(s.QU[KH]=jq,UY++)}4K(JB){1l s.NG(JB,"sc 1U 6G"),!1}}1u UY++;1u"4e"===l5?(LP[KH]=1m cL,LP[KH].Dd="Df",LP[KH].gx=1n(){UY++},LP[KH].jl=1n(){1a e=ZC.2t(s.o.Ky);if(ZC.fg.1h(KH),e)1l s.NG({8D:ZC.1b[63],aJ:"bV cI fb ("+1g.4X+")"},"bV 6G (4e)"),!1;1g.4X=ZC.kn,UY++},LP[KH].4X=KH,ZC.4f.1U[KH]=LP[KH]):"2O"===l5?(F8=["gs-3b"===s.N6?"go="+1A.cX():""].2M("&"),ZC.A4.ao({1J:"bY",3R:KH,eg:1n(e){s.S7.2O||"7h-g9"!==s.N6||e.cV(ZC.1b[45],"cU, 8B cT dN 6P:6P:6P dM")},1U:F8,4L:1n(e,t,i){1l s.NG(i,"bV 6G"),!1},aB:1n(e){1j(1a t={},i=e.mP(/[a-zA-Z0-9\\.\\#\\-](.+?)\\{((.|\\s)+?)\\}/gi),a=0,n=i.1f;a<n;a++){ML=i[a].2o("{");1a l=ZC.GR(ML[0]),r=l.2o(/\\s+/);if(1===r.1f||2===r.1f&&ZC.GR(r[0])==="#"+s.K){t[l=ZC.GR(1===r.1f?r[0]:r[1])]||(t[l]={});1j(1a o=0,C=(ML=ML[1].1F("}","").2o(";")).1f;o<C;o++){1a A=ML[o].2o(":");2===A.1f&&(t[l][ZC.GR(A[0])]=""+ZC.GR(A[1]))}}}1c!==ZC.1d(s.o.1I)?ZC.2E(t,s.o.1I):1c!==ZC.1d(s.o[ZC.1b[16]])&&1===s.o[ZC.1b[16]].1f&&s.o[ZC.1b[16]][0].1I&&ZC.2E(t,s.o[ZC.1b[16]][0].1I),UY++}})):"6O"===l5&&(F8=["gs-3b"===s.N6?"go="+1A.cX():""].2M("&"),ZC.A4.ao({1J:"bY",3R:KH,eg:1n(e){s.S7.6O||"7h-g9"!==s.N6||e.cV(ZC.1b[45],"cU, 8B cT dN 6P:6P:6P dM")},1U:F8,4L:1n(e,t,i){1l s.NG(i,"bV 6G"),!1},aB:1n(e,t,i,a){s.m4[a]=e,UY++}}))}}}nT(BZ){1a s=1g;1j(1a p in BZ)if("4j"==1y BZ[p])s.nT(BZ[p]);1u 1j(1a F8 in s.QU)F8===BZ[p]&&(BZ[p]=7t(s.QU[F8]))}bF(e){1a t,i,a,n,l=1g;if(l.E.bF=!0,l.E.wh=l.I+"/"+l.F,l.o[ZC.1b[16]])if(l.lp)1o.3n(l.K,"9P"),1o.bb(1o.aQ[l.K]);1u if(1y e===ZC.1b[31]&&(e=!1),ZC.AO.C2("bF",l,l.FD()),e=!1);1u{1j(i=0;i<l.AI.1f;i++)1j(n=0;n<l.AI[i].AY.A7.1f;n++)l.E["g-"+i+"-p-"+n+".2h"]=l.AI[i].E["1B"+n+".2h"];1j(i=0;i<l.AI.1f;i++)l.E["g-"+l.AI[i].L+"-aX"]=3g.5b(l.AI[i].CV);1j(1a r=l.o[ZC.1b[16]],o=[ZC.1b[10],"5X"],s=0,C=r.1f;s<C;s++)1j(1a A=0;A<o.1f;A++){1a Z=o[A],c=[];if(1c!==ZC.1d(r[s][Z])){1j(i=0,a=r[s][Z].1f;i<a;i++)r[s][Z][i].eE||c.1h(r[s][Z][i]);r[s][Z]=c}}if(l.VS(l.o),l.o=ZC.AO.C2("f6",l,l.FD(),l.o),ZC.A4("#"+l.K+"-1v").1s(l.I).1M(l.F),l.E["6j-7r"]&&(ZC.A4("#"+l.K+"-fD").1s(l.I).1M(l.F),4t l.E["6j-7r"]),1===(t=ZC.A4("#"+l.K+"-5S")).1f&&t.1s(l.I).1M(l.F).2O("3v","5q(7Z,"+(l.I-1)+"px,"+(l.F-1)+"px,7Z)"),"2F"===l.AB&&(l.KG.4l(ZC.1b[19],l.I),l.KG.4l(ZC.1b[20],l.F)),"3f"===l.AB||"3L"===l.AB){1j(ZC.A4("#"+l.K+"-3Y").1s(l.I).1M(l.F),i=0,a=l.AI.1f;i<a;i++)ZC.A4("#"+l.AI[i].K+"-2N").3r();ZC.A4("#"+l.K+"-3Y>3C").1s(l.I).1M(l.F)}1j("3f"===l.AB&&((t=ZC.AK(l.K+"-3Y-c"))&&(t.1s=l.I,t.1M=l.F),(t=ZC.AK(l.K+"-3Y-c-1v"))&&(t.1s=l.I,t.1M=l.F),ZC.A4("#"+l.K+"-2J-2c 3f, #"+l.K+"-2J-1v 3f, #"+l.K+"-b2 3f").5f(1n(){1g.1s=l.I,1g.1M=l.F})),"3L"===l.AB&&ZC.A4("#"+l.K+"-2J-2c 3C, #"+l.K+"-2J-1v 3C, #"+l.K+"-b2 3C").5f(1n(){1g.1I.1s=l.I+"px",1g.1I.1M=l.F+"px"}),l.1q(),i=0,a=l.AI.1f;i<a;i++)l.AI[i].UK&&l.AI[i].UK(),l.AI[i].HH=!0,l.AI[i].oy=l.AI[i].GB,l.AI[i].GB=!1;1j(l.1t(),i=0;i<l.AI.1f;i++)1j(n=0;n<l.AI[i].AY.A7.1f;n++)4t l.E["g-"+i+"-p-"+n+".2h"];1j(i=0;i<l.AI.1f;i++)l.AI[i].HH=!1,l.AI[i].GB=l.AI[i].oy,4t l.AI[i].oy,4t l.E["g-"+l.AI[i].L+"-aX"]}}rz(){1a e=1g.o[ZC.1b[16]],t=[ZC.1b[10],"5X"];if(e)1j(1a i=0,a=e.1f;i<a;i++)1j(1a n=0;n<t.1f;n++){1a l=t[n],r=[];if(1c!==ZC.1d(e[i][l])){1j(1a o=0,s=e[i][l].1f;o<s;o++)e[i][l][o].eE||r.1h(e[i][l][o]);e[i][l]=r}}}3j(e,t,i){1a a=1g;1j(1a n in a.E)-1!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(t)},ZC.A4("#"+e.K+"-5S").3t("4G",e.h6).3t("6h",e.P2).3t("5V",e.s4),ZC.A4("#"+e.K+"-2B-1N").4g("4G",e.h6)),e.h5=1n(t){1a i=e.FD();i.ev=t,ZC.AO.C2("ad",e,i)},ZC.A4("#"+e.K+"-5S").3t("ad",e.h5),ZC.A4("#"+e.K+"-3e").3t("ad",e.h5),e.rE=1n(t){27===t.IS&&e.QQ&&(e.kC||e.h2())},ZC.A4(2g).3t("zZ",e.rE),e.h2=1n(){ZC.A4("#"+e.K+ZC.1b[66]).4i("3I",e.h2),ZC.lA=1c,ZC.P.ER(e.K+"-1U-6t"),e.9P(),1o.ei&&ZC.AK(1o.ei)&&(ZC.AK(1o.ei).1I.3N="2b")},ZC.A4("#"+e.K+ZC.1b[66]).4g("3I",e.h2)):ZC.2K&&(e.rh=1n(e){1l e.6S(),1o.SN(e),!1},ZC.A4("#"+e.K+"-5S").3t("4G",e.rh)),1c!==e.HP){1a u=ZC.1k(e.HP.dL);u=u>=50?u:5I*u,2u.5E(1n(){e.MP(),e.2w()},u)}e.MJ="",ZC.TS[e.K]=(1m a1).bv()-ZC.TS[e.K],e.E["d6-ar"]&&(ZC.AO.C2("ar",e,e.FD()),e.E["d6-ar"]=1c),e.E["d6-2w"]&&(ZC.AO.C2("2w",e,e.FD()),e.E["d6-2w"]=1c)}bU(e){1j(1a t=1g,i=0;i<t.AI.1f;i++)t.AI[i].BI&&t.AI[i].BI.oT(e)}tp(){1a e=1g,t=2g.4V("3f");t.1s=e.I,t.1M=e.F,t.4l("1O","");1j(1a i=0;i<e.AI.1f;i++)e.AI[i].BI&&e.AI[i].BI.oT(!0,t);1l t}Jb(){1c===ZC.1d(ZC.ou)&&(ZC.ou=1n(e){1o.3n(e.id,"Ap")}),1o.3n(1g.K,"Ak",{1E:"ud hc","1n":"ZC.ou()",6E:100})}nk(){1a e,t=1g,i={},a=t.DD.eb;t.B9.2w(i,"6G.5i.eb"),a&&ZC.2E(a,i),1===t.o[ZC.1b[16]].1f&&t.o[ZC.1b[16]][0].5i&&(e=t.o[ZC.1b[16]][0].5i.eb)&&ZC.2E(e,i);1a n=ZC.5l(ZC.1k(i.1J||1),1,2),l=i.2L||"br";-1===ZC.AT(["tl","tr","br","bl"],l)&&(l="br"),t.Jn=l;1a r,o=32,s=146,C=0,A=1;ZC.6R&&(o=30,s=168,C=8,A=1),s=126,o=22;1a Z={9c:["#Iz","#Ib"],b8:["#Bm","#Ih"]},c=Z.9c;if(1o.kJ&&(c="9c"===t.LU||"d0"===t.LU?Z.9c:Z.b8),1===t.o[ZC.1b[16]].1f)if(t.o[ZC.1b[16]][0][ZC.1b[0]]){1a p=ZC.AO.G9(t.o[ZC.1b[16]][0][ZC.1b[0]]);7===p.1f&&(c=ZC.AO.oI(p,Z.b8,Z.9c))}1u if(t.o[ZC.1b[16]][0].bJ){1a u=t.o[ZC.1b[16]][0].bJ;c="9c"===u||"d0"===u?Z.9c:Z.b8}1a h,1b,d=1y 2u!==ZC.1b[31]&&2u.82?2u.82.Av:"",f=1y 2u!==ZC.1b[31]&&2u.82?2u.82.Cw:"";1Q(r=\'<a 5M="sc It by hc" 1I="1r:\'+c[0]+\' !7q;2s-2e:Bb !7q;3N:8K !7q;3p:1 !7q; 1E-bL:2b;" 7L="7h://8C.1o.c1/?Av=\'+d+"&Cw="+f+\'">GW by <7B 1I="1r:\'+c[1]+\'; 2s-79:6z;">hc</7B></a>\',l){1i"br":h=t.F-o,1b=t.I-s;1p;1i"bl":h=t.F-o,1b=6;1p;1i"tr":h=2,1b=t.I-s;1p;1i"tl":h=2,1b=6}1c!==ZC.1d(e=ZC.AK(t.K+"-1v"))&&ZC.P.I0({2p:ZC.6R?"-6R":"",p:e,id:t.K+"-f1-1E",tl:h+"/"+1b,wh:s+"/"+(o-C),1r:ZC.6R?1===n?"#lJ":"#2T":"",3w:C,3p:A,2L:"4E",4U:"8n",6Q:1o.9J,4d:r},t.AB)}rM(){1a e=1g;ZC.A4("#"+e.K+"-2B").4i(ZC.1b[47],e.TW),ZC.A4("."+e.K+"-2B-1P").4i(ZC.1b[47],e.TW),ZC.A4("."+e.K+"-2B-1P").4i("3I 5V",e.sg).4i("6Z",e.tj).4i("7D",e.rN),e.E["2B-1P-hb"]=!1,1c!==e.HA&&e.HA.3l(),1c!==e.D4&&e.D4.3l(),ZC.2K&&(ZC.A4("#"+e.K+"-5S").3l("4G",e.h6).3l("6h",e.P2).3l("5V",e.s4),ZC.A4("#"+e.K+"-2B-1N").4i("4G",e.h6),ZC.A4("#"+e.K+"-5S").3l("4G",e.rh)),ZC.A4("#"+e.K+"-5S").3l("ad",e.h5),ZC.A4("#"+e.K+"-3e").3l("ad",e.h5),ZC.A4(2g).3l("zZ",e.rE),ZC.A4("#"+e.K+ZC.1b[66]).4i("3I",e.h2)}U9(e,t,i){1y i===ZC.1b[31]&&(i=!1);1a a=ZC.AK("zc-2B-"+(i?"ex":"1P")+"-"+e);a&&(a.1I.3N=t?"8K":"2b")}rH(LN,ev){if(!1o.3J.Gn){1a s=1g,G,i,A5,j,JA;1y LN===ZC.1b[31]&&(LN=-1);1a DD={};ZC.2E(s.DD,DD),-1!==LN&&s.o[ZC.1b[16]][LN]&&ZC.2E(s.o[ZC.1b[16]][LN].5i,DD,1c,1c,!0),ZC.A4("#"+s.K+"-2B").3r();1a S1=[];1j(1y ZC.AL===ZC.1b[31]&&S1.1h({id:"3D",4a:"2b"},{id:"vh",4a:"2b"},{id:"vg",4a:"2b"}),i=DD.al.1f-1;i>0;i--)1j(1a Gc=DD.al[i].id,ii=i-1;ii>=0;ii--)DD.al[ii].id===Gc&&DD.al.6u(ii,1);if(1c!==ZC.1d(G=DD.al))1j(i=0,A5=G.1f;i<A5;i++){1a ND=!1;1j(j=0,JA=S1.1f;j<JA;j++)S1[j].id===G[i].id&&(ND=!0);ND||S1.1h(G[i])}1a JI=DD["6o-2B"],OO=DD["6o-2B[2K]"];1j(i=0,A5=S1.1f;i<A5;i++)1c!==ZC.1d(S1[i]["1n"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1d(JI.8F)&&(UR=JI.8F);1a JU=[],EH=1c;if(rS=1c!==ZC.1d(s.N4.o.mv)&&ZC.2t(s.N4.o.mv),ZC.2K&&(EH=G3("uM"),"2b"!==EH.4a&&(1c===s.DD||1c===ZC.1d(s.DD["3h-1Z"])||s.DD["3h-1Z"]?JU.1h(GS("tN",EH.1E)):JU.1h(GS("tU",EH.1E)),JU.1h(J9("Lb")))),EH=G3("xU"),"2b"!==EH.4a&&(JU.1h(GS("eG",EH.1E)),JU.1h(J9("eG"))),1y ZC.Cb!==ZC.1b[31]){EH=G3("Oj"),"2b"!==EH.4a&&(EH=G3("Mm"),"2b"!==EH.4a&&JU.1h(GS("tR",EH.1E?EH.1E:1c)),EH=G3("x7"),"2b"!==EH.4a&&JU.1h(GS("tq",EH.1E?EH.1E:1c)),JU.1h(J9("8v")));1a TR=["Mx","Mz","wX","tD","xl","wV","xV"],tJ=0,tv=0;1j(i=0;i<TR.1f;i++)"xl"===TR[i]&&ZC.AK(s.K+"-1U-6t")&&(TR[i]="Jf"),EH=G3(TR[i]),"2b"!==EH.4a&&(tJ++,tv=i,JU.1h(GS(TR[i].aO(),EH.1E)));tJ>0&&JU.1h(J9(TR[tv].aO()))}if(-1!==LN){1a H7=!1;1j(j=0,JA=s.AI[LN].BL.1f;j<JA;j++)s.AI[LN].BL[j].H7&&(H7=!0);if(H7&&1y jF!==ZC.1b[31]){1a gO=!1;EH=G3("Jp"),"2b"!==EH.4a&&(JU.1h(GS("eQ",EH.1E)),gO=!0),EH=G3("Jr"),"2b"!==EH.4a&&(JU.1h(GS("f2",EH.1E)),gO=!0),EH=G3("Jt"),"2b"!==EH.4a&&(JU.1h(GS("fE",EH.1E)),gO=!0),gO&&JU.1h(J9("3G"))}}1a gM=!1,tA=!1;if(-1!==LN&&(-1!==ZC.AT(["1w","1N","2V","5x","6b","3P","9z"],s.AI[LN].AF)&&(gM=!0,s.XS="2d"),-1!==ZC.AT(["92","88","ek","6U","7z","7a","aZ"],s.AI[LN].AF)&&(tA=!0,s.XS="3d")),(gM||tA)&&(EH=G3("3D"),"2b"!==EH.4a&&(EH=G3(gM?"vh":"vg"),"2b"!==EH.4a&&(JU.1h(GS(gM?"tW":"tY",EH.1E)),JU.1h(J9("14Z"))))),-1!==LN){1a C=s.AI[LN],nF=!1,kH=!1;1j(j=0;j<C.BL.1f;j++){1a B=C.BL[j];0===B.BD.1L(ZC.1b[51])&&(nF=!0),"3a"===B.C8&&(kH=!0)}nF&&(EH=G3("151"),"2b"!==EH.4a&&(EH=G3(kH?"uH":"uK"),"2b"!==EH.4a&&(JU.1h(GS(kH?"tM":"tP",EH.1E)),JU.1h(J9("f9"))))),(C.CZ||C.KE)&&(EH=G3("u3"),"2b"!==EH.4a&&(EH=G3(C.eX?"15K":"17N"),"2b"!==EH.4a&&(JU.1h(GS(C.eX?"mZ":"gQ",EH.1E)),JU.1h(J9("2i")))))}1a j7=0,B5;if(1y ZC.Aa!==ZC.1b[31]&&(EH=G3("vA"),"2b"!==EH.4a&&(JU.1h(GS("4N",EH.1E)),j7++),EH=G3("vm"),"2b"!==EH.4a&&(JU.1h(GS("4r",EH.1E)),j7++)),j7>0&&JU.1h(J9("b2")),EH=G3("vj"),"2b"===EH.4a||s.M2||(s.QQ?(EH=G3("17O"),JU.1h(GS("gN",EH.1E)),JU.1h(J9("gN"))):(JU.1h(GS("5O",EH.1E)),JU.1h(J9("5O")))),s.IC&&(EH=G3("17P"),"2b"!==EH.4a&&JU.1h(GS("cH",EH.1E)),EH=G3("17Q"),"2b"!==EH.4a&&JU.1h(GS("cG",EH.1E)),JU.1h(J9("4Y"))),JU.1f>0&&-1!==JU[JU.1f-1].1L("zc-2B-ex")&&JU.6u(JU.1f-1,1),s.tH={},-1!==LN)if(JI&&1c!==ZC.1d(B5=JI["5F-2C"]))1j(JU.1f>0&&JU.1h(J9("5F")),i=0,A5=B5.1f;i<A5;i++){1a mV=!0;if(1c!==ZC.1d(B5[i].4a)&&("2b"===B5[i].4a?mV=!1:"4s"!==B5[i].4a&&(mV=!ev||7t(B5[i].4a).4v(s,1o.gP(ev,s),B5[i].id,ev))),mV){1a AP,K=B5[i].id||"5F-"+i;"ex"===B5[i].id||"ex"===B5[i].1J?JU.1h(J9(K,!0)):"5R"===B5[i].1J?(AP=B5[i].1E||"sD vO "+i,JU.1h(x6(K,AP,!0))):(AP=B5[i].1E||"sD vO "+i,s.tH[K]={fn:B5[i]["1n"]||"",3R:B5[i].3R||"",2X:B5[i].2X||""},JU.1h(GS(K,AP,!0)))}}s.UB||(JU.1h(J9("1o")),JU.1h(GS("wt","ud hc"))),ZC.P.I0({id:s.K+"-2B",p:2g.3s,2p:"zc-2B zc-1I",1v:1c===ZC.1d(GP)?0:GP.iY+GP.F/2,1K:1c===ZC.1d(GP)?0:GP.iX+GP.I/2,u0:s.N4.AQ+"px 2U "+s.N4.BU,1T:(-1===s.N4.A0?"b0":s.N4.A0)+" "+mK(s.N4.D7),cE:s.N4.FP,dU:s.N4.FR,dV:s.N4.FZ,dW:s.N4.EN,4d:JU.2M("")}),s.E["2B-1P-hb"]||(s.sg=1n(e){1a t,i=1!==e.2X.fC?e.2X.6r.id:e.2X.id,a=i.2x(0,i.1L("-2B-1P-")),n=1o.7d(a);ZC.2K&&n.P2();1a l=n.ng(n.T3[0],n.T3[1]);n.9j(),ZC.2K&&1o.SN(e);1a r=i.1F(n.K+"-2B-1P-","");n.yW({4y:l?l.K:1c,tK:r,ev:ZC.A4.BX(e)});1a o=n.o["8v-lE"]||n.o[ZC.1b[16]][0]["8v-lE"]||"";1Q(r){1i"tY":1i"tW":l&&n.rF(l.K);1p;1i"tU":s.DD=s.DD||{},s.DD["3h-1Z"]=!0;1p;1i"tN":s.DD=s.DD||{},s.DD["3h-1Z"]=!1;1p;1i"gQ":n.W0(l.K,!0);1p;1i"mZ":n.W0(l.K,!1);1p;1i"tM":n.W4(l.K,"lb");1p;1i"tP":n.W4(l.K,"3a");1p;1i"eG":n.rC();1p;1i"tR":n.NH("9V");1p;1i"tq":n.NH("eh");1p;1i"ya":n.NH("fG",""===o?1c:{fn:o});1p;1i"y9":n.NH("2F",""===o?1c:{fn:o});1p;1i"lH":1o.3n(n.K,"lH");1p;1i"wS":1o.3n(n.K,"zb",""===o?1c:{fn:o});1p;1i"wI":(t=G3("tD"))["5F-1n"]?n.ZP({4y:l?l.K:1c,tK:r,lE:o,"1n":t["5F-1n"]}):1o.3n(n.K,"zf",""===o?1c:{fn:o});1p;1i"nR":1i"od":1o.3n(n.K,"yM",{oU:r});1p;1i"6F":n.l1();1p;1i"4N":n.lg();1p;1i"4r":n.lk();1p;1i"5O":n.ta();1p;1i"cH":1o.3n(n.K,"cH");1p;1i"cG":1o.3n(n.K,"cG");1p;1i"eQ":l&&(n.HA.C=l,n.lD({4y:l.K}));1p;1i"f2":l&&(n.HA.C=l,n.lB({4y:l.K}));1p;1i"fE":l&&(n.HA.C=l,n.lq({4y:l.K}));1p;1i"wt":n.ss();1p;2q:1c!==ZC.1d(G=s.tH[r])&&(""!==G.fn?n.ZP({4y:l?l.K:1c,tK:r,"1n":G.fn}):""!==G.3R&&l&&l.TZ(e,G.3R,G.2X))}},s.tj=1n(){1g.1I.u5=LL.A0,1g.1I.1r=LL.C0,1g.1I.lW=1g.1I.lS=LL.AQ+"px 2U "+LL.BU},s.rN=1n(){1g.1I.u5=DX.A0,1g.1I.1r=DX.C0,1g.1I.lW=1g.1I.lS=DX.AQ+"px 2U "+DX.BU},s.TW=1n(e){1l e.6S(),!1},ZC.A4("#"+s.K+"-2B").4g(ZC.1b[47],s.TW),ZC.A4("."+s.K+"-2B-1P").4g(ZC.1b[47],s.TW),ZC.A4("."+s.K+"-2B-1P").4g("3I 5V",s.sg).4g("6Z",s.tj).4g("7D",s.rN),s.E["2B-1P-hb"]=!0)}}1n mK(e){1l""!==e&&e?"3R("+(0===e.1L("zc.")?ZC.bt[e]:e)+")":"2b"}1n J9(e){1l\'<3C id="\'+s.K+"-2B-ex-"+e+\'" 1O="zc-2B-ex" 1I="1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?t.T3[1]-a:0,e=t.LU?t.LU:"9c",{id:t.K,1s:t.I,1M:t.F,bA:t.AB,x:i,y:a,9N:t.T3[2],bJ:e}}vT(e){e=e||{},1c!==ZC.1d(e.t8)&&(1g.QU[e.t8]=e.1U||"[]",1g.UY++)}lD(){}lB(){}lq(){}PD(){}tg(e,t){1a i=1g;if(e=e||{},1c!==ZC.1d(e[ZC.1b[3]])){1a a=i.OF(e[ZC.1b[3]]);1c!==a&&a.3j()}1u i.3j(1c,1c,t);K9&&K9.5Z&&(K9.5Z[i.K]=1c)}tG(e){e=e||ZC.HD["q8-b9"];1a t=1g;if(1c===ZC.AK(t.K+"-9a")){ZC.P.I0({2p:"zc-3m zc-1I zc-9a",id:t.K+"-9a",p:ZC.AK(t.K+"-1v"),wh:t.I+"/"+t.F,3p:.75}),ZC.P.I0({2p:"zc-9a-wd",id:t.K+"-9a-t",p:ZC.AK(t.K+"-9a"),4d:e});1a i=ZC.A4("#"+t.K+"-9a-t");i.2O("1v",t.F/2-i.1M()/2+"px").2O("1K",t.I/2-i.1s()/2+"px")}}kQ(){ZC.P.ER(1g.K+"-9a")}ss(){1a e=1g;ZC.AO.C2("18d",e,e.FD()),ZC.P.I0({2p:"zc-3m",id:e.K+"-6B-4P",p:ZC.AK(e.K+"-1v"),wh:e.I+"/"+e.F,1T:"#89",3p:.75});1a t=ZC.CT(18e,e.I),i=ZC.CT(ui,e.F),a=ZC.BN(0,(e.I-t)/2),n=ZC.BN(0,(e.F-i)/2),l=ZC.P.I0({2p:"zc-6B zc-1I",id:e.K+"-6B",p:ZC.AK(e.K+"-1v"),tl:n+"/"+a,wh:t-(ZC.97?0:10)+"/"+(i-(ZC.97?0:10))}),r="";""!==e.SL&&(r="sD 18f 1j<br />"+e.SL),l.4o=\'<3C 1O="zc-6B-1"><a 7L="7h://8C.1o.c1" 2X="qN">1o.c1</a></3C><3C 1O="zc-6B-2">&1S;18h-\'+(1m a1).vd()+\'</3C><3C 1O="zc-6B-3"><3C id="\'+e.K+\'-6B-7w">\'+ZC.HD["6B-7w"]+\'</3C></3C><3C 1O="zc-6B-4" 1I="3w:\'+(i-ui)+\'px 8e 8e 8e;"><3C>&8x;<br />183 \'+ZC.fi+" ["+e.AB+"]</3C>"+r+"</3C>",ZC.A4("#"+e.K+"-6B-7w").3t("3I",1n(){ZC.AO.C2("17K",e,e.FD()),ZC.P.ER([e.K+"-6B",e.K+"-6B-4P"])})}NG(e,t){1a i=1g;if(ZC.AO.su("4L",i))ZC.AO.C2("4L",i,{id:i.K,4L:e,17u:t,4H:i.E.4H||i.E.Ed});1u{1a a="";a+="4j"==1y e?e.8D+":"+e.aJ+"\\n\\n":e+"\\n\\n",1c!==ZC.1d(t)&&(a+="17h:"+t+"\\n\\n"),a+="3g 1U:\\n\\n"+i.E.4H+"\\n\\n",i.Y1(),1c===ZC.AK(i.K+"-1v")&&i.t2(),ZC.P.I0({2p:"zc-3m zc-4L zc-1I",id:i.K+"-4L",p:ZC.AK(i.K+"-1v"),wh:i.I-(ZC.97?0:10)+"/"+(i.F-(ZC.97?0:10))}).4o=\'<3C 1O="zc-4I-5o-1H zc-4I-s0">\'+ZC.HD["4L-5R"]+\'</3C><3C 1O="zc-4I-5o-1H zc-4I-s1">\'+ZC.HD["4L-aJ"]+\'</3C><3C 1O="zc-4I-5o-ai"><bX id="\'+i.K+\'-4L-aJ" 1I="1s:\'+(i.I-35)+"px;1M:"+(i.F-135)+\'px;"></bX></3C><3C 1O="zc-4I-5o-ai zc-4I-5o-7S"><ak 1J="7M" 1V="\'+ZC.HD["4L-7w"]+\'" id="\'+i.K+\'-4L-7w" /></3C>\',ZC.A4("#"+i.K+"-4L-aJ").8L(ZC.GR(a)),ZC.A4("#"+i.K+"-4L-7w").3t("3I",1n(){ZC.P.ER(i.K+"-4L")})}}lg(){}lk(){}ta(){1a e=1g,t=2g.4V("3C");t.id="zc-5O",t.1I.9K=1o.Eq,t.1I.9M="8X";1a i,a,n=2g.3s,l=!1;1j(1o.ei&&ZC.A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i.AI.1f;a<n;a++)e===i.AI[a].K&&(i.AI[a].eX=t,i.AI[a].E["2i-on"]=t);if(t){1a l=ZC.A4("#"+i.K+"-1v"),r={ea:ZC.DS[0]-l.2a().1K,hD:ZC.DS[1]-l.2a().1v,1J:ZC.1b[48],2X:{id:i.K+"-5S"}};i.D4.QK(r)}1u K9.hE(i.K)}}rF(e){1j(1a t=1g,i=["1w","1N","2V","5x","6b","3P","9z"],a=0,n=t.AI.1f;a<n;a++)if(e===t.AI[a].K){1a l=t.o[ZC.1b[16]][a];if("9z"===l.1J)1j(1a r=0,o=l[ZC.1b[11]].1f;r<o;r++){1a s=l[ZC.1b[11]][r];s.1J=s.1J||"1w","3d"===t.XS?s.1J=s.1J.1F("3d",""):-1!==ZC.AT(i,s.1J)&&(s.1J=s.1J+"3d")}1u"3d"===t.XS?l.1J=l.1J.1F("3d",""):-1!==ZC.AT(i,l.1J)&&(l.1J=l.1J+"3d")}t.XS="3d"===t.XS?"2d":"3d",t.E.4H=ZC.GR(3g.5b(t.o)),t.JS()}rC(e){1j(1a t,i=1g,a=0;a<i.AI.1f;a++)4t i.E["g"+a+"-1W-e6"];if(e=e||{},ZC.AO.C2("eG",i,{id:i.K,4y:e[ZC.1b[3]]}),1c!==ZC.1d(t=e[ZC.1b[3]])){1a n=i.C7(t);1c!==n&&(i.MP(n),i.2w(n.K))}1u i.QS=[],i.O2=-1,i.MP(),i.rz(),i.2w()}zu(e){1a t,i=1g;if(e=e||{},1c!==ZC.1d(t=e[ZC.1b[3]])){1a a=i.C7(t);1c!==a&&1c!==ZC.1d(e.h4)&&(i.MP(a),i.2w(t,e.h4))}1u 1c!==ZC.1d(t=e.h4)&&(i.QZ=t,i.MP(),i.2w())}l1(){}NH(){}TM(){}yW(e){ZC.2E(1g.FD(),e),ZC.AO.C2("17m",1g,e)}ZP(O){1a s=1g;4M{1a DW=ZC.AO.ru(O["1n"]);O["1n"]=DW[0],O.98=DW[1],ZC.2E(s.FD(),O),7t(O["1n"]).4v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}1l r;1i"rV":c.Ac(i);1p;1i"eQ":c.lD(i);1p;1i"f2":c.lB(i);1p;1i"qW":if(l=c.C7(i[ZC.1b[3]]),1c!==ZC.1d(i.lx)&&i.lx)1j(a=0,n=l.BT("k").1f;a<n;a++)i["4q"+(C=1===(o=l.BT("k")[a]).L?"":"-"+o.L)]=i.4q||1c,i["4p"+C]=i.4p||1c,i["8V"+C]=i.8V||1c,i["96"+C]=i.96||1c;1j(a=0,n=l.BT("k").1f;a<n;a++)1c===i["4q"+(C=1===(o=l.BT("k")[a]).L?"":"-"+o.L)]&&1c===ZC.1d(i["4p"+C])&&1c===ZC.1d(i["8V"+C])&&1c===ZC.1d(i["96"+C])||(i["7E"+C]=!0),"3a"===o.C8&&(1c!==ZC.1d(i["4q"+C])&&(i["4q"+C]=ZC.HO(i["4q"+C],o.EU)),1c!==ZC.1d(i["4p"+C])&&(i["4p"+C]=ZC.HO(i["4p"+C],o.EU)));if(1c!==ZC.1d(i.lv)&&i.lv)1j(a=0,n=l.BT("v").1f;a<n;a++)i["5t"+(C=1===(s=l.BT("v")[a]).L?"":"-"+s.L)]=i.5t||1c,i["5s"+C]=i.5s||1c;1j(a=0,n=l.BT("v").1f;a<n;a++)C=1===(s=l.BT("v")[a]).L?"":"-"+s.L,1c===ZC.1d(i["5t"+C])&&1c===ZC.1d(i["5s"+C])||(i["7R"+C]=!0),"3a"===s.C8&&(1c!==ZC.1d(i["5t"+C])&&(i["5t"+C]=ZC.HO(i["5t"+C],s.EU)),1c!==ZC.1d(i["5s"+C])&&(i["5s"+C]=ZC.HO(i["5s"+C],s.EU)));c.PD(i);1p;1i"17q":if(l=c.C7(i[ZC.1b[3]]),1c!==ZC.1d(i.lx)&&i.lx)1j(a=0,n=l.BT("k").1f;a<n;a++)i["4q"+(C=1===(o=l.BT("k")[a]).L?"":"-"+o.L)]=i.4q||1c,i["4p"+C]=i.4p||1c;1j(a=0,n=l.BT("k").1f;a<n;a++)C=1===(o=l.BT("k")[a]).L?"":"-"+o.L,1c===ZC.1d(i["4q"+C])&&1c===ZC.1d(i["4p"+C])||(l.BI&&l.BI.LT?(i.ib=!0,i["8V"+C+"-aE"]=i["4q"+C],i["4q"+C]=ZC.rO(l.BI.NV[o.BD][ZC.1b[5]],i["4q"+C])):-1!==(A=ZC.AT(o.W,i["4q"+C]))&&(i["4q"+C]=A),l.BI&&l.BI.LT?(i.ib=!0,i["96"+C+"-aE"]=i["4p"+C],i["4p"+C]=ZC.rO(l.BI.NV[o.BD][ZC.1b[5]],i["4p"+C])):-1!==(Z=ZC.AT(o.W,i["4p"+C]))&&(i["4p"+C]=Z),i["7E"+C]=!0);if(1c!==ZC.1d(i.lv)&&i.lv)1j(a=0,n=l.BT("v").1f;a<n;a++)i["5t"+(C=1===(s=l.BT("v")[a]).L?"":"-"+s.L)]=i.5t||1c,i["5s"+C]=i.5s||1c;1j(a=0,n=l.BT("v").1f;a<n;a++)C=1===(s=l.BT("v")[a]).L?"":"-"+s.L,1c===ZC.1d(i["5t"+C])&&1c===ZC.1d(i["5s"+C])||(i["7R"+C]=!0);c.PD(i);1p;1i"fE":c.lq(i)}1l 1c},ZC.Cb={},ZC.AO.kP=1n(e,t,i,a){"o1"===(a=a||"9V")&&(a="eh");1a n=2g.4V("3f");n.1s=t,n.1M=i,n.1I.1s=t+"px",n.1I.1M=i+"px";1a l,r=n.9q("2d");e 3E 3M||(e=[e]);1j(1a o=0,s=e.1f;o<s;o++)if(-1===e[o].7U.1L("zc-no-6F")){1a C=!1;4M{e[o].kB("4e/"+a)}4K(Z){C=!0}if(!C)if(l=e[o].bT("1U-3v")){1a A=l.2o(",");r.cg(e[o],ZC.BN(0,A[0]),ZC.BN(0,A[1]),ZC.CT(A[2],e[o].1s),ZC.CT(A[3],e[o].1M),ZC.BN(0,A[0]),ZC.BN(0,A[1]),ZC.CT(A[2],e[o].1s),ZC.CT(A[3],e[o].1M))}1u r.cg(e[o],0,0,e[o].1s,e[o].1M,0,0,t,i)}1l n.kB("4e/"+a)},ZC.AO.u1=1n(e,t,i,a,n){1c===ZC.1d(n)&&(n=!1);1a l=ZC.AO.kP(e,t,i,a);if(n){1a r=2g.4V("5S");1l r.4X=l,r}l=l.1F("4e/"+a,"4e/tz-kN"),2g.82.7L=l},RZ.5n.l1=1n(){1a e=1g,t=[];if(!e.kC){e.kC=!0;1a i=2g.3s.7k,a=ZC.A4(2g.3s).2O(ZC.1b[0]),n=ZC.A4(2g.3s).2O("1T-4e");ZC.A4(2g.3s).2O(ZC.1b[0],"#2T").2O("1T-4e","2b");1j(1a l=0,r=i.1f;l<r;l++)1===i[l].fC&&(t[l]=i[l].1I.3N,i[l].1I.3N="2b");2g.3s.3c(ZC.AK(e.K+"-fD")),2u.5E(1n(){2u.6F(),2u.5E(1n(){ZC.A4(2g.3s).2O(ZC.1b[0],a).2O("1T-4e",n),ZC.AK(e.K+"-fD")&&ZC.AK(e.K).3c(ZC.AK(e.K+"-fD"));1j(1a l=0,r=i.1f;l<r;l++)1===i[l].fC&&(i[l].1I.3N=t[l]);e.kC=!1},5I)},50)}},RZ.5n.NH=1n(e,t,i,a){1a n=1g;if(t=t||{},1y i===ZC.1b[31]&&(i=!1),!ZC.AK(n.K+"-d7")){e=e||"9V";1a l=t.f4,r=t.fn||"";ZC.P.II(ZC.AK(n.K+"-2i-c"),n.AB,0,0,n.I,n.F),ZC.A4(".zc-2i-1H").3r();1a o,s,C=("3f"===n.AB||1o.gD||1o.3J.h0)&&"fG"!==e&&"2F"!==e;if(ZC.2K||!C||i||l||(o=ZC.P.I0({2p:"zc-3m zc-d7 zc-1I",id:n.K+"-d7",8q:5,p:ZC.AK(n.K+"-1v"),wh:n.I+"/"+n.F}),s=ZC.P.I0({id:n.K+"-d7-7w",p:o,8q:10,tl:"5/"+(n.I-15),4d:ZC.HD["d7-7w"]}),ZC.A4(s).2O("4U","8n").2O("1K",n.I-15-ZC.A4(s).1s()+"px"),ZC.A4(s).3t("3I",1n(){ZC.A4(o).3r()})),ZC.2K&&(l=!0),!1o.3J.h0||l||"2F"!==n.AB||"9V"!==e&&"eh"!==e){1a A;if("3f"===n.AB&&"fG"!==e&&"2F"!==e){1a Z,c,p=2g.4V("3f");1j(p.1s=n.I,p.1M=n.F,Z=0,c=n.AI.1f;Z<c;Z++)n.AI[Z].BB&&n.AI[Z].BB.E9(p);1a u=[];ZC.A4("#"+n.K+" 3f").5f(1n(){-1===ZC.AT([n.K+"-2i-c",n.K+"-7W-c"],1g.id)&&u.1h(1g)}),u.1h(p),u.1h(n.tp());1a h=ZC.AO.u1(u,n.I,n.F,e,!0);h.id=n.K+"-6F-"+e,o.3c(h)}1u if(i||n.tG(ZC.HD["8v-b9"]),"3L"===n.AB||"3f"===n.AB&&("fG"===e||"2F"===e)){1a 1b=2g.4V("3C"),d="zc-8v-2F-"+n.K;1b.id=d,1b.1I.3N="2b",2g.3s.3c(1b),1o.bb({id:d,bA:"!2F",Db:!0,1s:n.I,1M:n.F,1U:n.E.4H,d5:n.MT,bJ:n.LU,eC:!0,hb:{2w:1n(){2u.5E(1n(){1a e=1o.7d(d);if(e.E["4O-2J"])1a t=2u.eP(1n(){"9p"===e.E["4O-2J"]&&(2u.9W(t),e.bU(!0),A=ZC.AK(d+"-1v").4o,e.bU(!1),1o.3n(d,"9P",{tV:!0}),f())},100);1u e.bU(!0),A=ZC.AK(d+"-1v").4o,e.bU(!1),1o.3n(d,"9P",{tV:!0}),f()},100)}}})}1u"2F"===n.AB&&(n.bU(!0),A=ZC.AK(n.K+"-1v").4o,f(),n.bU(!1));C&&!i&&(ZC.A4(s).2O("4U","8n").2O("1K",n.I-15-ZC.A4(s).1s()+"px"),ZC.A4(s).3t("3I",1n(){ZC.A4(o).3r()}))}1u 1o.3n(n.K,"Co",{5H:1n(l){if(-1!==l){1a r=2g.4V("5S");r.id=n.K+"-6F-"+e,r.4X=l,o.3c(r)}1u ZC.P.ER(n.K+"-d7"),1o.3J.h0=0,n.NH(e,t,i,a)}})}1n f(){1a s,C,Z={2F:A=A.1F(/<kp(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m ky([e],{1J:i})),a.4l("f4",t),2g.3s.3c(a),a.3I(),2g.3s.aP(a)):82.7L="1U:f5/tz-kN,"+gh(e)}},ZC.AO.hf=1n(e,t){1a i,a,n,l,r,o,s,C,A,Z,c,p,u,h=[],1b="",d=[];1j("7V"===(t=t||"6O")&&h.1h(\'<4d eq:o="u8:sE-rc-c1:p4:p4" eq:x="u8:sE-rc-c1:p4:zn" eq="7h://8C.w3.eu/TR/17t-17v">\',"<fv>","\\17w!--[if 17x nv 9]><kA><x:Bk><x:Bi><x:B3><x:Bg>hc</x:Bg><x:Bh><x:17y/></x:Bh></x:B3></x:Bi></x:Bk></kA><![17z]--\\17A",\'<1I>td{1G:2b;2s-9i:17B,nN-nh} .8R{nv-8R-5D:"0.6P";} .1E{nv-8R-5D:"@";}</1I>\',"<Am 8D=17F 17G=17H.17I>","<Am o8=Dc-8>","</fv>","<3s>"),i=0,a=e.AI.1f;i<a;i++){1a f=e.AI[i],g=f.AY.A7,B={},v=[],E=f.BT("k")[0];"4d"!==t&&"7V"!==t&&"dZ"!==t||(h.1h("<6t>"),f.J1&&""!==f.J1.AP&&(d.1h([f.J1.AP]),h.1h("<oC>"+f.J1.AP+"</oC>")),h.1h("<Au>"),h.1h("<tr>")),c=[],u=[];1a b="18i",m=!1;1j(E&&(E.FF&&"5B"===E.FF.o.1J&&(b="a1",m=!0),E.M&&E.M.AP&&(b=E.M.AP.1F(/\\"|\\\'/g,""))),"6O"===t?c.1h(\'"\'+b+\'"\'):"dZ"===t?u.1h(b):"4d"!==t&&"7V"!==t||c.1h("<th>"+b+"</th>"),n=0,l=g.1f;n<l;n++)(1c===ZC.1d(g[n].o["8v"])||ZC.2t(g[n].o["8v"]))&&(p=(p=1c!==ZC.1d(g[n].AP)?g[n].AP+"":"kO "+n).1F(/\\"|\\\'/g,""),"6O"===t?c.1h(\'"\'+p+\'"\'):"dZ"===t?u.1h(p):"4d"!==t&&"7V"!==t||c.1h("<th"+("7V"===t?\' AS="mX" 1O="1E"\':"")+">"+p+"</th>"),v.1h(""));if("6O"===t?h.1h(c.2M(",")):"dZ"===t?d.1h(u):"4d"!==t&&"7V"!==t||h.1h(c.2M("")),"4d"!==t&&"7V"!==t||(h.1h("</tr>"),h.1h("</Au>"),h.1h("<Bs>")),E){1j(s=0,C=E.W.1f;s<C;s++)B[s+""]={kZ:!1,cZ:[].4A(v)};1j(n=0,l=g.1f;n<l;n++)if(1c===ZC.1d(g[n].o["8v"])||ZC.2t(g[n].o["8v"]))1j(r=0,o=g[n].S.1f;r<o;r++){1a K=g[n].S[r];K&&(B[s=K.BY?""+K.BY:""+r]=B[s]||{kZ:!0,cZ:[].4A(v)},B[s].cZ[n]=K.AE,B[s].kZ=!0)}1a D=[];1j(s in B)B[s].kZ&&D.1h([s,B[s].cZ]);D.3Z(1n(e,t){1l e[0]-t[0]});1a F=1c;1j(A=0,Z=D.1f;A<Z;A++){if("4d"!==t&&"7V"!==t||h.1h("<tr>"),"3P"!==f.AF&&"7a"!==f.AF&&"8Z"!==f.AF||E.W[D[A][0]]&&(D[A][0]=E.W[D[A][0]]),E.BW[D[A][0]]&&(D[A][0]=E.BW[D[A][0]]),E.W[D[A][0]]&&(D[A][0]=E.W[D[A][0]]),(F=f.A.FD()).5o=A,F.mX=0,F[ZC.1b[9]]=D[A][0],D[A][0]=ZC.AO.C2("Ax",f.A,F,D[A][0],1c),ZC.1d(D[A][1]))1j(1a I=0;I<D[A][1].1f;I++)(F=f.A.FD()).5o=A,F.mX=I+1,F[ZC.1b[9]]=D[A][1][I],D[A][1][I]=ZC.AO.C2("Ax",f.A,F,D[A][1][I],1c);m&&(D[A][0]=ZC.AO.YM(D[A][0],"%Y-%mm-%dd %H:%i:%s",f.UU,f.NA),"6O"===t&&(D[A][0]=\'"\'+D[A][0]+\'"\')),"6O"===t?h.1h([].4A(D[A][0]).4A(D[A][1]).2M(",")):"dZ"===t?d.1h([].4A(D[A][0]).4A(D[A][1])):"4d"!==t&&"7V"!==t||h.1h("<td"+("7V"===t?\' AS="5o"\':"")+">"+[].4A(D[A][0]).4A(D[A][1]).2M("</td><td>")+"</td>"),"4d"!==t&&"7V"!==t||h.1h("</tr>")}}"4d"!==t&&"7V"!==t||(h.1h("</Bs>"),h.1h("</6t>")),a>1&&i<a-1&&("6O"===t?h.1h("","",""):"4d"!==t&&"7V"!==t||h.1h("<p>&8x;</p>"))}1l"7V"===t&&h.1h("</3s>","</4d>"),"dZ"===t?d:("6O"===t?1b=h.2M("\\n"):"4d"!==t&&"7V"!==t||(1b=h.2M("")),1b)},1o.oi=1n(e,t,i){1a a,n,l,r,o,s="",C="";1n A(e){ZC.A4.ao({1J:"hW",3R:n,1U:e,aB:1n(e,t,i){l&&l(e,t,i)}})}2g.cO("zc-5O")&&(e="zc-5O"),"3b"==1y(i=i||{})&&(i=3g.1q(i));1a Z=1o.7d(e);if(Z)1Q(t){1i"Co":if(r="9V",1c!==ZC.1d(a=i.5D)&&(r=a),1c!==ZC.1d(a=i.Cj)&&(r=a),"o1"===r&&(r="eh"),1o.3J.h0&&"2F"===Z.AB&&("9V"===r||"eh"===r)){Z.bU(!0);1a c=ZC.AK(Z.K+"-2F").6r.4o,p=c.1L(">"),u=c.1L("</2F>");c=(c=\'<2F eq:kF="7h://8C.w3.eu/ol/kF" eq="7h://8C.w3.eu/Cu/2F" aF="1.1" 1s="\'+Z.I+\'" 1M="\'+Z.F+\'">[gF]\'+c.2x(p+1,u+6)).1F(/<kp(.+?)<\\/kp>/g,"");1a h=1n(){1a e,t=2u.hU||2u.18Z||2u;e=t.og&&2u.ky?t.og(1m 2u.ky([c],{1J:"4e/2F+kA;o8-nU-16"})):"1U:4e/2F+kA;o8=Dc-8,"+gh(c),Z.bU(!1);1a a=1m 2u.cL;a.Dd="Df",a.4X=e,a.gx=1n(){1a t=2g.4V("3f"),n=t.9q("2d");if(t.1s=a.1s,t.1M=a.1M,n.cg(a,0,0,t.1s,t.1M),i.5H&&"1n"==1y i.5H)4M{i.5H(t.kB("4e/"+r))}4K(l){i.5H(e)}}},1b=0,d=1n(){1a e=1m gy;e.bp("oH",Z.gA[1b]),e.Ck="1E",e.oL=1n(e){1a t=e.2X.Bx,i=t.mP(/18W?:\\/\\/[^ \\)]+/g),a=0;i.18U(1n(e){1a n=1m gy;n.bp("oH",e),n.Ck="18T",n.oL=1n(n){1a l=1m 18Y;l.oL=1n(n){t=t.1F(1m 5v(e),n.2X.18S),++a===i.1f&&(c=c.1F("[gF]","[gF]<1I><![18V["+t+"]]></1I>"),++1b===Z.gA.1f?(c=c.1F("[gF]",""),h()):d())},l.18Q(n.2X.Bx)},n.8t()})},e.8t()};Z.gA.1f?d():(c=c.1F("[gF]",""),h())}if("3f"!==Z.AB&&!1o.gD)1l-1;if("3f"===Z.AB){if(!i.5H||"1n"!=1y i.5H)1l Z.TM(r);4M{i.5H(Z.TM(r))}4K(B){i.5H(-1)}}1u Z.NH(r,{},!0,i.5H);1p;1i"18P":1i"18z":if(!i.f4&&"3f"!==Z.AB&&!1o.gD)1l-1;if(r="9V",o={},1c!==ZC.1d(a=i.Ch)&&(o=a),1c!==ZC.1d(a=i.ci)&&(o.ci=a),1c!==ZC.1d(a=i.3h)&&(o.3h=a),1c!==ZC.1d(a=i.5D)&&(r=a),1c!==ZC.1d(a=i.Cj)&&(r=a),1c!==ZC.1d(a=i.lE)&&(s=a),n=Z.E.ow||"",1c!==ZC.1d(a=i.3R)&&(n=a),l=1c,1c!==ZC.1d(a=i.5H)&&(l=a),"o1"===r&&(r="eh"),i.f4&&("3f"!==Z.AB||"fG"===r))1l o.f4=!0,""!==s&&(o.fn=s),8o Z.NH(r,o);if(""!==n){if("3f"===Z.AB)1l A(Z.TM(r));Z.NH(r,o,!0,1n(e){1l A(e)})}1p;1i"lH":if(n=Z.E.nx||"",1c!==ZC.1d(a=i.3R)&&(n=a),C=ZC.AO.18n(Z),""===n)1l C;l=1c,1c!==ZC.1d(a=i.5H)&&(l=a),ZC.A4.ao({1J:"hW",3R:n,1U:C,aB:1n(e,t,i){l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":i+=e.5w(o,1),a||n||(i+="\\n"+1m 3M(l).2M(" ")),r=t;1p;2q:i+=e.5w(o,1),r=t}1l i},RZ.5n.lg=1n(){1a e=1g;ZC.AO.C2("18t",e,e.FD());1a t=ZC.P.I0({2p:"zc-3m zc-4N zc-1I",id:e.K+"-4N",p:ZC.AK(e.K+"-1v"),wh:e.I-(ZC.97?0:10)+"/"+(e.F-(ZC.97?0:10))});t.1I.9K=99,t.4o=ZC.ji(\'<3C 1O="zc-4I-5o-1H zc-4I-s1">&8x;<a 7L="7s:8o(0)" id="\'+e.K+\'-4N-fd" 1O="zc-cF-6K">\'+ZC.HD["4N-fd"]+\'</a>&8x;<a 7L="7s:8o(0)" id="\'+e.K+\'-4N-fc" 1O="zc-cF-fM">\'+ZC.HD["4N-fc"]+\'</a></3C><3C 1O="zc-4I-5o-ai"><bX id="\'+e.K+\'-4N-4H" 1I="1s:\'+(e.I-35)+"px;1M:"+(e.F-95)+\'px;"></bX></3C><3C 1O="zc-4I-5o-ai zc-4I-5o-7S" id="\'+e.K+\'-4N-zw"><ak 1J="7M" 1V="\'+ZC.HD["4N-7w"]+\'" id="\'+e.K+\'-4N-7w" /></3C>\'),1o.qu&&(ZC.AK(e.K+"-4N-zw").4o+=\'<ak 1J="7M" 1V="\'+ZC.HD["4N-9l"]+\'" id="\'+e.K+\'-4N-9l" />\'),ZC.A4("#"+e.K+"-4N-4H").8L(ZC.AO.XE(e.E.7b)),ZC.A4("#"+e.K+"-4N-fc").3t("3I",1n(){ZC.AK(e.K+"-4N-fc").7U="zc-cF-6K",ZC.AK(e.K+"-4N-fd").7U="zc-cF-fM",ZC.A4("#"+e.K+"-4N-4H").8L(ZC.AO.XE(e.E.4H))}),ZC.A4("#"+e.K+"-4N-fd").3t("3I",1n(){ZC.AK(e.K+"-4N-fc").7U="zc-cF-fM",ZC.AK(e.K+"-4N-fd").7U="zc-cF-6K",ZC.A4("#"+e.K+"-4N-4H").8L(ZC.AO.XE(e.E.7b))}),ZC.A4("#"+e.K+"-4N-7w").3t("3I",1n(){ZC.AO.C2("zD",e,e.FD()),ZC.P.ER(e.K+"-4N")}),1o.qu&&ZC.A4("#"+e.K+"-4N-9l").3t("3I",1n(){ZC.AO.C2("zD",e,e.FD());1a t=ZC.A4("#"+e.K+"-4N-4H").8L();ZC.P.ER(e.K+"-4N"),1o.3n(e.K,"aK",{1U:t})})},RZ.5n.lk=1n(){1a e=1g;if(e.I<fN||e.F<fN)2u.bp("7h://8C.1o.c1/ES/","","");1u{1a t=ZC.P.I0({2p:"zc-3m zc-4r zc-1I",id:e.K+"-4r",p:ZC.AK(e.K+"-1v"),wh:e.I-(ZC.97?0:10)+"/"+(e.F-(ZC.97?0:10))}),i="";i+=\'<3C 1O="zc-4I-5o-1H zc-4I-s0">\'+ZC.HD["4r-5R"]+\'</3C><3C 1O="zc-4I-5o-1H"><ak 1J="Fz" id="\'+e.K+\'-r3" fh="fh" /><1H 1j="\'+e.K+\'-r3">\'+ZC.HD["4r-zG"]+"</1H>",ZC.3f&&(i+=\'&8x;&8x;&8x;&8x;&8x;<ak 1J="Fz" id="\'+e.K+\'-qS" fh="fh" /><1H 1j="\'+e.K+\'-qS">\'+ZC.HD["4r-Fx"]+"</1H>"),i+=\'</3C><3C 1O="zc-4I-5o-1H zc-4I-s1">\'+ZC.HD["4r-Ft"]+\'</3C><3C 1O="zc-4I-5o-ai"><bX id="\'+e.K+\'-4r-Gd" 1I="1s:\'+(e.I-35)+"px;1M:"+((e.F-fN)/2-10)+\'px;"></bX></3C><3C 1O="zc-4I-5o-1H zc-4I-s1">\'+ZC.HD["4r-Gl"]+\'</3C><3C 1O="zc-4I-5o-ai"><bX id="\'+e.K+\'-4r-4H" 1I="1s:\'+(e.I-35)+"px;1M:"+(e.F-18u)/2+\'px;"></bX></3C><3C 1O="zc-4I-5o-1H zc-4I-s1">\'+ZC.HD["4r-Fd"]+(e.I>=18w?" <7B>("+ZC.HD["4r-Fb"]+")</7B>":"")+\'</3C><3C 1O="zc-4I-5o-ai"><ak 1J="1E" id="\'+e.K+\'-4r-ql" 1I="1s:\'+(e.I-35)+\'px;" /></3C><3C 1O="zc-4I-5o-ai zc-4I-5o-7S"><ak 1J="7M" 1V="\'+ZC.HD["4r-f3"]+\'" id="\'+e.K+\'-4r-f3" /><ak 1J="7M" 1V="\'+ZC.HD["4r-ju"]+\'" id="\'+e.K+\'-4r-ju" /></3C>\',t.4o=ZC.ji(i),ZC.A4("#"+e.K+"-4r-4H").8L("18x\\n----------\\n"+ZC.AO.XE(e.E.4H)+"\\n\\18l\\n----------\\n"+ZC.AO.XE(e.E.7b)),ZC.A4("#"+e.K+"-4r-ju").3t("3I",1n(){ZC.P.ER(e.K+"-4r")}),ZC.A4("#"+e.K+"-4r-f3").3t("3I",1n(){1a t=ZC.A4("#"+e.K+"-4r-ql");if(/^((\\w+\\+*\\-*)+\\.?)+@((\\w+\\+*\\-*)+\\.?)*[\\w-]+\\.[a-z]{2,6}$/.5Y(t.8L())){1a i="";ZC.3f&&(i=e.TM("9V"));1a a=("Ef:"+e.E.4H+" Gp:"+e.E.7b).1F(/\\r|\\n|\\t|(\\s{2,})/g,""),n="",l=[];ZC.A4("#"+e.K+"-qS").3S("fh")&&l.1h("****18D:",i),ZC.A4("#"+e.K+"-r3").3S("fh")&&l.1h("****3g:",a),l.1h("****18E:",ZC.A4("#"+e.K+"-4r-Gd").8L(),"****18F:",t.8L(),"****fi:",ZC.fi,"****18G:",e.I,"****18H:",e.F,"****hU:",2u.82.7L,"****UA:",8U.cv,"****18I:",e.AB.5J(),"****18J:",Fa.1s+"x"+Fa.1M);1j(1a r=0;r<l.1f-1;r+=2)n+=l[r]+gh(l[r+1]);n+="****18K";1a o=ZC.P.qL(ZC.AK(e.K+"-4r")),s=o.4V("Eg");s.8f=2g.82.hV+"//8C.1o.c1/ES/18L.18M",s.9T="hW",o.3s.3c(s);1a C=o.4V("Dk");C.1J="1E",C.8D="1U",C.1V=n,s.3c(C),s.f3(),2u.5E(1n(){Dt(Z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.A8.X5){1i"tl":1p;1i"tr":o-=i.A8.I;1p;1i"bl":s-=i.A8.F;1p;1i"br":o-=i.A8.I,s-=i.A8.F;1p;1i"c":o-=i.A8.I/2,s-=i.A8.F/2;1p;1i"t":o-=i.A8.I/2;1p;1i"r":o-=i.A8.I,s-=i.A8.F/2;1p;1i"b":o-=i.A8.I/2,s-=i.A8.F;1p;1i"l":s-=i.A8.F/2}ZC.P.PR(ZC.AK(a+"-2H-c"),{1K:o/n[0]-u+"px",1v:s/n[1]-u+"px"}),1c!==(t=ZC.AK(a+"-2H-1E"))&&(t.1I.3N="2b",ZC.P.PR(t,{1s:i.A8.I+"px",1M:i.A8.F+"px",1K:o/n[0]+"px",1v:s/n[1]+"px"}),t.1I.3N="8K")}}}hd(e){1g.4m(e)}g4(e,t){1a i,a,n,l,r,o,s,C=1g,A=C.H.K,Z=e.9N||e.2X.id,c=Z.1F(/--([a-zA-Z0-9]+)/,"").1F("-bN-1N","-1N").1F("-1N-2R","").1F("-2R","").1F("-1R-3A","").1F("-1R","").2o("-").9r(),p=Z.2o("--"),u=!1,h=!1,1b=!1;if("2r"===c[1]&&"1B"===c[3]&&"cj"===c[4]&&(u=!0),ZC.P.ER([A+"-2H-1E",A+"-2H",A+"-2H-1E-9d"]),u){if(!(l=C.H.OF(c[5])))1l;if(r=l.AY.A7[c[2]],o=r.FQ(c[0]),"xy"===l.AJ.3y&&o.RX(),!o)1l;ZC.A4("#"+A+"-2Y-"+c[5]+"-1B-"+c[2]+"-bg-2N-c").4m()}1u"1W"===c[2]&&0===c[1].1L("1P")&&(h=!0),0!==c[2].1L("1z")||0!==c[1].1L("1P")&&0!==c[1].1L("1R")||(1b=!0),l=C.H.OF(c[3]);if(ZC.AK(A+"-2H")||(ZC.P.K2({id:A+"-2H",p:ZC.AK(A+"-3Y"),2p:"zc-3m zc-2H",wh:C.H.I+"/"+C.H.F,9M:"8X"},C.H.AB),ZC.P.HF({id:A+"-2H-c",p:ZC.AK(A+"-2H"),2p:"zc-3m",tl:"-4J/-4J",1s:140,1M:60},C.H.AB)),C.A8=1o.6g.a8("DP",C,A+"-2H-1E"),C.A8.OL="2H",C.A8.A=C.H,l&&l.A8&&C.A8.1S(l.A8),u)C.A8.1C(r.A8.o),l.CV["p"+r.L]&&l.CV["p"+r.L]["n"+o.L]&&C.A8.1C(r.A8.o[ZC.1b[73]]),2===p.1f&&C.A8.1C(r.o0(p[1]));1u{1a d=!1;if(h&&l.BB&&1c!==ZC.1d(l.BB.o.2H)&&(C.A8.o.1E="",C.A8.1C(l.BB.o.2H),d=!0),1b){C.A8.1C({"1T-1r":"#2T","1G-1s":1,"1G-1r":"#4J"});1a f=l.BK(c[2].1F(/\\1b/g,"-"));if(f&&1c!==ZC.1d(f.o.2H)&&(C.A8.o.1E="",C.A8.1C(f.o.2H),d=!0),0===c[1].1L("7J"))f&&(-1!==c[1].1L("vC")&&f.o.1H&&f.o.1H.2H?(C.A8.o.1E="",C.A8.1C(f.o.1H.2H),d=!0):f.o.1P&&f.o.1P.2H&&(C.A8.o.1E="",C.A8.1C(f.o.1P.2H),d=!0));1u if(0===c[1].1L("b4")){1a g=ZC.1k(c[1].1F("b4",""));f.QE[g]&&f.QE[g].o.1H&&f.QE[g].o.1H.2H&&(C.A8.o.1E="",C.A8.1C(f.QE[g].o.1H.2H),d=!0)}}if("2S"===c[2])if(C.A8.1C({"1T-1r":"#2T","1G-1s":1,"1G-1r":"#4J"}),e.2X.bT("1U-jR"))C.A8.1C({1E:e.2X.bT("1U-2H-1E")}),d=!0;1u 1j(a=0,n=l.FG.1f;a<n;a++)if(1c!==ZC.1d(l.FG[a])){1a B=l.FG[a]3E QW?l.FG[a].BE:l.FG[a];l.K+"-2S-"+c[1]===l.FG[a].K&&1c!==ZC.1d(i=B.o.2H)&&(C.A8.1C(i),C.A8.o.7o&&(C.A8.o.x=B.iX,C.A8.o.y=B.iY),d=!0)}if("1H"===c[2])1j(C.A8.1C({"1T-1r":"#2T","1G-1s":1,"1G-1r":"#4J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.3J.bh?ZC.A4(2g.3s).3t("6C 4G",e.R7):ZC.A4("#"+t+"-5S").3t("6C 4G",e.R7),ZC.A4(".zc-2r-1N").4g("6C 4G",e.R7))}}1O oR 2j CX{2G(e){1D(e);1a t=1g;t.IO=!0,t.p1=!1,t.C=e,t.H=e.A,t.JE=!1,t.ic=!1,t.H4=1c,t.B4=1c,t.Z=1c,t.JV=0,t.I7=0,t.PI=0,t.n0=0,t.LT=!1,t.NV=1c,t.lT=!1,t.BW=1c,t.n8=!1}1q(){1a e,t=1g;t.K=t.C.K+"-2A",t.4C([["4g","p1","b"],["aE","LT","b"],["2k-6V","PI","i"],["2k-6V-x","PI","i"],["2k-6V-y","PI","i"],["2h","AM","b"]]);1a i="("+t.C.AF+").2A",a=t.H.B9;1n n(e){1l[i+".3O",i+".3O-"+e,i+".3q",i+".3q-"+e]}t.B4=1m I2(t.C),t.B4.K=t.C.K+"-2A-15T",a.2w(t.B4.o,[i]),t.B4.1C(t.o),t.B4.1q(),t.o.1H&&(t.BW=[]),t.o.3q&&t.o.3q.1H&&(t.J7=1m DP(t.C),t.J7.1C(t.o.3q.1H),t.J7.1C({1E:" "}),t.J7.1q(),t.J7.AM&&(t.n8=!0)),t.P7=1m CX(t.C),a.2w(t.P7.o,[i+".4P"]),1c!==ZC.1d(e=t.o.4P)&&t.P7.1C(e),t.P7.1q(),t.V7=1m CX(t.C),a.2w(t.V7.o,[i+".6K"]),1c!==ZC.1d(e=t.o.6K)&&t.V7.1C(e),t.V7.1q(),t.IR=1m I2(t.B4),t.HE=1m I2(t.B4),t.JD=1m I2(t.B4),t.H2=1m I2(t.B4),a.2w(t.IR.o,n("1K")),a.2w(t.HE.o,n("2z")),a.2w(t.JD.o,n("1v")),a.2w(t.H2.o,n("2c"));1j(1a l=["3q","3O"],r=0;r<l.1f;r++)1c!==ZC.1d(e=t.o[l[r]])&&(t.IR.1C(e),t.HE.1C(e),t.JD.1C(e),t.H2.1C(e)),1c!==ZC.1d(e=t.o[l[r]+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K&&e.3T(s-i,s-i+ZC.A4(e.KK).1s(),C-a,C-a+ZC.A4(e.KK).1M())}1l!1},e.WI=1n(){1l 1o.3n(e.H.K,"qI",{4D:""}),e.JE&&(ZC.A4(2g.3s).3l("83 6h",e.VL),ZC.A4(2g.3s).3l("6l 5V",e.WI),e.JE=!1,e.C.OI=!1,e.ic&&e.3G(!1),e.ic=!1),!1},ZC.A4("."+e.C.K+"-2A-3O").3t("6C 4G",e.Z7),ZC.A4("."+e.C.K+"-2A-4P").3t("3I",e.qK),e.lT=!0}}gc(){ZC.AO.gc(1g,["Z","C6","o","I4","JW","C","H","B4","V7","KL","K0","L8","JH","KK","JD","HE","H2","IR","9O","P7","mg","Y0","mB","WP"])}}1O iM 2j CX{2G(e,t){1D(e);1a i=1g;i.C=e,i.H=e.A,i.JE=!1,i.Z=1c,i.BJ=0,i.BC=0,i.ik="",i.cz="yx"===i.C.AJ.3y,i.AF=i.ij=i.y8="1Z-"+(t||"x"),i.cz&&(i.AF+="i",i.ij="1Z-xi"===i.AF?"1Z-y":"1Z-x")}1q(){1a e,t=1g;t.K=t.C.K+"-"+t.ij,t.4C([["2a-x","BJ"],["2a-y","BC"]]);1a i="("+t.C.AF+").",a=t.H.B9;t.B0=1m I2(t.C),a.2w(t.B0.o,[i+"1Z.2V",i+t.AF+".2V"]),1c!==ZC.1d(e=t.o.2V)&&t.B0.1C(e),t.B0.1q(),t.AW=1m I2(t.C),a.2w(t.AW.o,[i+"1Z.3q",i+t.AF+".3q"]),1c!==ZC.1d(e=t.o.3q)&&t.AW.1C(e),t.AW.1q()}1t(){1a e=1g,t=e.C.BT("k")[0],i=e.C.BT("v")[0],a=e.C.Q;if(("1Z-x"===e.AF||"1Z-xi"===e.AF)&&t.E6===t.X&&t.EF===t.A1||("1Z-y"===e.AF||"1Z-yi"===e.AF)&&i.H1===i.B8&&i.HL===i.BS)1l e.3l(),ZC.A4("#"+e.C.K+"-"+e.AF+"-3q").3r(),ZC.A4("#"+e.C.K+"-"+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.B5.1f%r&&(l+=r-s.B5.1f%r),s.D0.2k=1A.2k(a*r,l),s.D0.1X=s.D0.2k+s.ED,s.VB(),s.3j(!1),s.1q(),s.1t(),o.6L(),o.3t()}3l(){1a e=1g;ZC.A4("."+e.BB.K+"-"+e.AF+"-1W-3q").3l("6C 4G",e.RJ),ZC.A4("."+e.BB.K+"-"+e.AF+"-1W-2V").3l("3I",e.RH)}3t(){1a e=1g,t=e.H.K,i=0,a=0;e.RJ=1n(n){if(n.6S(),!(n.7M>1)){1j(1a l=n.2X;l&&"mC"!==l.86.5J();){if(-1!==ZC.P.TA(l).1L("zc-"+e.AF+"-3q"))1p;l=l.6r}if((ZC.2K||!(n.9g>1))&&l){1a r=ZC.P.MK(n),o=ZC.A4("#"+t+"-1v").2a();if("1Z-y"===e.AF){1a s=r[1]-o.1v;a=s-e.AW.iY}1u if("1Z-x"===e.AF){1a C=r[0]-o.1K;i=C-e.AW.iX}1l ZC.A4(2g.3s).3t("83 6h",e.RI),ZC.A4(2g.3s).3t("6l 5V",e.NT),e.JE=!0,!1}}},e.RI=1n(n){if(n.6S(),e.JE){1a l=ZC.P.MK(n),r=ZC.A4("#"+t+"-1v").2a();if("1Z-y"===e.AF){1a o=l[1]-r.1v;o-a<e.B0.iY&&(o=e.B0.iY+a),o-a+e.AW.F>e.B0.iY+e.B0.F&&(o=e.B0.iY+e.B0.F+a-e.AW.F),e.3T(o-a)}1u if("1Z-x"===e.AF){1a s=l[0]-r.1K;s-i<e.B0.iX&&(s=e.B0.iX+i),s-i+e.AW.I>e.B0.iX+e.B0.I&&(s=e.B0.iX+e.B0.I+i-e.AW.I),e.3T(s-i)}}1l!1},e.NT=1n(){1l e.H.KX=e.ik.2o(","),e.JE&&(ZC.A4(2g.3s).3l("83 6h",e.RI),ZC.A4(2g.3s).3l("6l 5V",e.NT),e.JE=!1),!1},e.Fy=1n(t){(t.wE?-120*t.wE:t.15l)/120>0?e.3T(ZC.BN(e.B0.iY,e.AW.iY-e.AW.F)):e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)),a.VB(),a.3j(!0,i),a.ZE=!0,a.1q(),a.mH(!0),a.1t(),ZC.3o=l)}qz(e){1a t,i,a=1g,n=!1;1l e>=0&&(e<a.D0.2k||e>=a.D0.1X)&&(n=!0,"1Z"===a.U8?(e%(i="1Z-y"===a.DC.AF?a.DC.GY:a.DC.KT)&&(e-=e%i),a.D0.2k=e,a.D0.1X=e+a.ED,a.D0.1X>a.B5.1f&&(a.D0.2k=a.B5.1f-a.ED,a.B5.1f%i&&(a.D0.2k=a.D0.2k+(i-a.B5.1f%i)),a.D0.1X=a.B5.1f)):"3h"===a.U8&&(t=1A.4n(e/a.ED),a.D0.2k=t*a.ED,a.D0.1X=a.D0.2k+a.ED,a.D0.3h=t+1)),n}1q(){1a e,t,i,a,n=1g;if(n.E["d9-eZ"]=!0,n.QH=0,n.L9=0,1c!==ZC.1d(e=n.A.A.E["2Y-"+n.A.K+"-1W-6w"])&&(n.o.x=e.x-n.A.iX,n.o.y=e.y-n.A.iY),ZC.3o)n.FM&&n.FM.1q(),n.KO&&n.KO.1q();1u{a=n.A.H.B9;1a l="("+n.A.AF+")";1D.1q(),n.4C([["il","MA","b"],["jg","VA","b"],["15p","VI","b"],["6c","SF","b"],["9M","U8"],["1X-2C","ED","i"],["6d","fY","i"],["15q-3O","UT"],["5U-1B","X1","b"],["5U-1W","LG","b"],["3x","oS"],["9A-3x","JZ"]]),n.MA&&!n.VA&&(n.MA=!1),1o.3J.q3&&(n.E["xg-3x-2L"]||(n.mh({3x:n.oS,"9A-3x":n.JZ,3y:n.NM}),n.E["xg-3x-2L"]=!0)),n.X1&&1c===ZC.1d(n.o["5U-1W"])&&(n.LG=n.X1),n.BQ=1m DP(n),a.2w(n.BQ.o,l+".1W.1P"),n.o.1P&&1c===ZC.1d(n.o.1P.2h)&&(n.o.1P.2h=!0),n.BQ.1C(n.o.1P),n.BQ.1q(),n.ZY=1m DP(n),a.2w(n.ZY.o,l+".1W.1P-6X"),n.o["1P-6X"]&&1c===ZC.1d(n.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[31]&&1c!==ZC.1d(d.E.lX)||ZC.3o||("3f"!==d.A.A.AB?H.E9():d.Y7.1h(H)));1a P=d.A2.E.1J;1c!==ZC.1d(t=g[I].o["1W-1R"])&&1c!==ZC.1d(t.1J)&&(P=t.1J);1a N,O=!1;1Q("mP"!==P&&"5p"!==P||(O=!0,P=1c!==ZC.1d(t=g[I].A2.o.1J)?t:"2q"),-1!==ZC.AT(["2q","9n"],P)?N=1m I2(d):(N=1m DR(d)).DN=P,N.OL="15y",N.1C(d.A2.o),d.A.E["1B"+I+".2h"]&&"6X"!==g[I].o["1W-6T"]||N.1C(d.NR.o),N.NE=g[I].NE,g[I].AF){1i"3P":1i"7a":1i"8Z":1i"5x":1i"6U":1i"6b":1i"7z":1i"8m":1i"8h":1i"1N":1i"88":1i"8z":1i"au":1i"af":1i"b6":N.A0=g[I].A0,N.AC=g[I].AC,N.GO=g[I].GO,N.HM=g[I].HM;1p;1i"6v":1i"8p":1i"5g":1i"6A":N.A0="-1"!==g[I].A2.A0?g[I].A2.A0:g[I].A0,N.AC="-1"!==g[I].A2.AC?g[I].A2.AC:g[I].AC,N.GO=""!==g[I].A2.GO?g[I].A2.GO:g[I].GO,N.HM=""!==g[I].A2.HM?g[I].A2.HM:g[I].HM;1p;2q:N.A0=g[I].B7,N.AC=g[I].B7}"1w"!==N.DN&&"1N"!==N.DN||(N.B7=N.A0,N.AZ=2),O&&N.1C(g[I].A2.o),N.o["1w-1I"]="2U",N.o.1J=N.DN,N.1C(g[I].o["1W-1R"]),O&&(N.o.1J=N.DN),N.E["4m-1R"]=!0,N.E["4m-1w"]=!1,1c!==ZC.1d(t=N.o["4m-1w"])&&(N.E["4m-1w"]=ZC.2t(t)),1c!==ZC.1d(t=H.o["4m-1w"])&&(N.E["4m-1w"]=ZC.2t(t)),1c!==ZC.1d(t=H.o["4m-1R"])&&(N.o.2h=ZC.2t(t)),-1!==ZC.AT(["2q","9n"],P)&&1c!==ZC.1d(t=N.o[ZC.1b[21]])&&(1c===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"].6E&&i[s].o["1W-1P"].6E>r&&i[s].o["1W-1P"].6E--:i[s].o["1W-1P"].6E>i[e].o["1W-1P"].6E&&i[s].o["1W-1P"].6E<r&&i[s].o["1W-1P"].6E++;1j(i[e].o["1W-1P"].6E=o>t?1A.4n(i[e].o["1W-1P"].6E):1A.4h(i[e].o["1W-1P"].6E),s=0,C=d.QE.1f;s<C;s++)d.A.o[ZC.1b[11]][s]["z-2Z"]=i[s].o["1W-1P"].6E}d.A.AY.E["1B-3Z"]=!0,ZC.3o=!1,d.3j(!1),d.A.JS()},ZC.A4("#"+d.K+"-a3").4g(ZC.P.BX("6Z"),d.p5).4g(ZC.P.BX("7D"),d.pC),ZC.A4("#"+d.K+"-3o-1N").4g(ZC.P.BX(ZC.1b[47]),d.ZN),ZC.A4("#"+d.K+"-jg-1N").4g(ZC.P.BX("3I"),d.YK),ZC.A4("."+d.K+"-3h-1N").4g(ZC.P.BX("3I"),d.Z9),d.BQ.o.r6&&ZC.A4("."+d.A.K+"-1W-1P-1N").4g(ZC.1b[47],d.WJ)}d.E.lX=1c,1===d.A.A.E["1W-qV"]||ZC.3o||(d.MA&&1c===ZC.1d(d.A.A.E["g"+d.A.L+"-1W-e6"])||d.A.A.E["g"+d.A.L+"-1W-e6"]&&!d.NI)&&(2u.5E(1n(){d.YK(!0)},0),d.A.A.E["g"+d.A.L+"-1W-e6"]=!0)}}gc(){ZC.AO.gc(1g,["B5","D","QE","Z","C6","o","JW","I4","KO","FM","BQ","ZY","H","A","A2","NR","D0"])}}1O xD 2j DR{2G(e){1D(e);1a t=1g;t.N3=1c,t.BA=1c,t.M=1c,t.JR=0,t.BE=1c,t.GC="2c",t.L6=40,t.eO=[2,4]}1q(){1a e,t,i,a=1g;(a.4C([["z-2Z","JR","i"],["1f","L6","i"],["77","eO"],["bf","GC"]]),1c===ZC.1d(a.o.6j)&&1c===ZC.1d(a.o.to))&&(1c!==ZC.1d(a.o.x)&&1c!==ZC.1d(a.o.y)&&1c!==ZC.1d(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H-6t \'+t.H.K+\'-2i-1H-6t">\')),!Be&&le.1f>0&&("w1"!==le[0].o["3Z-by-1V"]&&"16p"!==le[0].o["3Z-by-1V"]||le.3Z(1n(e,t){1l(e.E["2r-1V"]-t.E["2r-1V"])*("w1"===le[0].o["3Z-by-1V"]?1:-1)}));1a We=0;1j(P=0,N=le.1f;P<N&&(!(-1===le[P].E.8G||le[P].E.8G<=E)||(Je?(We%Qe==0&&(Ee+="<tr>"),Ee+="<td>"+ve[P]+"</td>",We%Qe==Qe-1&&(Ee+="</tr>"),We++):Ee+=ve[le[P].E.vX],Je||!Re));P++);if(Je&&(We%Qe!=Qe-1&&(Ee+="</tr>"),Ee+="</6t>"),""!==se&&(Ee+=se),!Be&&le.1f>0&&(1b=F=K,d=I=D,""!==Ee&&(le[0].o.1E=Je||Re?Ee:Ee.2x(0,Ee.1f-4),le[0].1q()),M=1c!==ZC.1d(v.o.6V)?ZC.1k(v.o.6V):6,1c===ZC.1d(v.o.x)?fe.D8?1b<O[ee].iX+O[ee].I/2?le[0].iX=1b+M+14:le[0].iX=1b-le[0].I-M-14:ae&&ae.iX>=f.iX+f.I/2?le[0].iX=F-le[0].I-M:le[0].iX=F+M:le[0].iX-=f.iX,1c===ZC.1d(v.o.y)?fe.D8?ae&&ae.iY>=f.iY+f.F/2?le[0].iY=I-le[0].F-M:le[0].iY=I+M:d<O[ee].iY+O[ee].F/2?le[0].iY=d+M+14:le[0].iY=d-le[0].F-M-14:le[0].iY-=f.iY),ie){1a Ue=-1,Ve=-1;if($||(1c===ZC.1d(p.ea)&&c(),$=!0),Ce.1f>0){1a je=[];1j(E=ZC.3u,X=0,x=Ce.1f;X<x;X++)Ce[X][0]>=0&&(E=ZC.CT(Ce[X][0],E));1j(-1!==de&&(E=ZC.BN(E,de)),X=0,x=Ce.1f;X<x;X++)1c!==ZC.1d(Ce[X])&&(-1===Ce[X][0]||Ce[X][0]<=E)&&(O[ee].CZ&&O[ee].CZ.o["bs-1w"]&&ZC.2t(O[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+1].iY)){1a et=le[u];le[u]=le[u+1],le[u+1]=et,$e=!0}if(le.1f>0){1a tt=[],it=[];1j(u=0;u<le.1f;u++)1c!==ZC.1d(le[u].o.x)&&1c!==ZC.1d(le[u].o.y)&&it.1h(le[u]);1j(1a at,nt,lt,rt=!0,ot=0,st=le.1f*le.1f;rt&&ot<st;)1j(ot++,rt=!1,u=0;u<le.1f-1;u++)if(le[u].AM&&-1===ZC.AT(it,le[u]))if(fe.D8){if(le[u+1].iX<le[u].iX+le[u].I){if(le[u+1].iX-le[u].I-4<f.iX&&-1===ZC.AT(tt,le[u])&&(tt.1h(le[u]),le[u].iX=f.iX),le[u+1].iX=le[u].iX+le[u].I+4,le[u+1].iX+le[u+1].I>f.iX+f.I)1j(lt=le[u+1].iX-(f.iX+f.I-le[u+1].I),at=0,nt=le.1f;at<nt;at++)le[at].iX-lt>=f.iX?le[at].iX-=lt:(le[at].iX=f.iX,at>0&&(le[u+1].E["1R-y"]<f.iY+f.F/2?le[at].iY=le[at-1].iY+le[at-1].F+4:le[at].iY=le[at-1].iY-le[at].F-4));rt=!0}}1u if(le[u+1].iY<le[u].iY+le[u].F){if(le[u+1].iY-le[u].F-4<f.iY&&-1===ZC.AT(tt,le[u])&&(tt.1h(le[u]),le[u].iY=f.iY),le[u+1].iY=le[u].iY+le[u].F+4,le[u+1].iY+le[u+1].F>f.iY+f.F)1j(lt=le[u+1].iY-(f.iY+f.F-le[u+1].F),at=0,nt=le.1f;at<nt;at++)le[at].iY-lt>=f.iY?le[at].iY-=lt:(le[at].iY=f.iY,at>0&&(le[u+1].E["1R-x"]<f.iX+f.I/2?le[at].iX=le[at-1].iX+le[at-1].I+4:le[at].iX=le[at-1].iX-le[at].I-4));rt=!0}}}1a Ct=!1;1j(u=0,h=Ze.1f;u<h;u++)if(-1===Ze[u].E.8G||Ze[u].E.8G<=E){1a At=Ze[u];O[ee].AJ["3d"]&&(O[ee].NB(),y=1m CA(O[ee],At.iX+At.I/2-ZC.AL.DZ,At.iY+At.F/2-ZC.AL.E0,0),At.iX=y.E8[0]-At.I/2,At.iY=y.E8[1]-At.F/2,y=1m CA(O[ee],At.DI[0]-ZC.AL.DZ,At.DI[1]-ZC.AL.E0,0),At.DI[0]=y.E8[0],At.DI[1]=y.E8[1]),O[ee].CZ&&O[ee].CZ.o["bs-1w"]&&ZC.2t(O[ee].CZ.o["bs-1w"])?("xy"===O[ee].AJ.3y&&Ue===ZC.4w(At.iX+At.I/2)||"yx"===O[ee].AJ.3y&&Ve===ZC.4w(At.iY+At.F/2))&&!Ct&&(At.1t(),Ct=!0):At.1t()}1j(E=ZC.3u,P=0,N=le.1f;P<N;P++)le[P].E.8G>=0&&(E=ZC.CT(le[P].E.8G,E));1j(-1!==de&&(E=ZC.BN(E,de)),L=0,P=0,N=le.1f;P<N;P++)if(-1===le[P].E.8G||le[P].E.8G<=E){1a Zt=ZC.DT(le[P].DI[0],f.iX-5,f.iX+f.I+5)&&ZC.DT(le[P].DI[1],f.iY-5,f.iY+f.F+5);if(!Be||Zt){if(le[P].AM){1Q(le[P].E[ZC.1b[7]]){1i"1v":fe.D8?le[P].DI[0]=le[P].iX-le[P].G5:le[P].DI[1]=le[P].iY+le[P].F+le[P].G5;1p;1i"2c":fe.D8?le[P].DI[0]=le[P].iX+le[P].I+le[P].G5:le[P].DI[1]=le[P].iY-le[P].G5}if(-1!==ZC.AT(["1v","2c"],le[P].E[ZC.1b[7]])){1a ct=le[P].iX+le[P].I/2;le[P].iX=ZC.BN(le[P].iX,0),le[P].iX=ZC.CT(le[P].iX,t.H.I-le[P].I),le[P].iY=ZC.BN(le[P].iY,0),le[P].iY=ZC.CT(le[P].iY,t.H.F-le[P].F),1c===ZC.1d(le[P].o["6I-2a"])&&(le[P].ET=5z(100*(ct-le[P].iX-le[P].I/2)/(le[P].I-le[P].H6),10))}if(O[ee].AJ["3d"]&&(O[ee].NB(),y=1m CA(O[ee],le[P].iX+le[P].I/2-ZC.AL.DZ,le[P].iY+le[P].F/2-ZC.AL.E0,0),le[P].iX=y.E8[0]-le[P].I/2,le[P].iY=y.E8[1]-le[P].F/2,y=1m CA(O[ee],le[P].DI[0]-ZC.AL.DZ,le[P].DI[1]-ZC.AL.E0,0),le[P].DI[0]=y.E8[0],le[P].DI[1]=y.E8[1],"1K"===le[P].EP?le[P].iX=le[P].DI[0]+M:le[P].iX=le[P].DI[0]-le[P].I-M),O[ee].AJ["3d"]||Be||0!==L||(le[P].iX=ZC.BN(f.iX-5,le[P].iX),le[P].iY=ZC.BN(f.iY-5,le[P].iY),le[P].iX=ZC.CT(f.iX+f.I-le[P].I+5,le[P].iX),le[P].iY=ZC.CT(f.iY+f.F-le[P].F+5,le[P].iY)),Be||!Be&&0===L){1a pt=Be?P:0;(!Be||"3f"===t.H.AB&&le[pt].o["1T-4e"]&&""!==le[pt].o["1T-4e"])&&le[pt].1q(),le[pt].1t(),L++}}if(Zt){1a ut=1m DR(t);if(t.H.B9.2w(ut.o,"("+O[ee].AF+").2i.1R"),ut.K=le[P].K+"-1R",ut.Z=ut.C6=a,ut.iX=le[P].E["1R-x"],ut.iY=le[P].E["1R-y"],O[ee].AJ["3d"]&&(O[ee].NB(),y=1m CA(O[ee],ut.iX-ZC.AL.DZ,ut.iY-ZC.AL.E0,0),ut.iX=y.E8[0],ut.iY=y.E8[1]),Y=le[P].E["2i-1I"],ut.A0=ut.AC=ZC.AO.JM(Y[ZC.1b[0]]),ut.BU=Y.1r,ut.1C(O[ee].CZ.o.1R),ut.1C(O[ee].AY.A7[le[P].E.76].o["2i-1R"]),"5p"===ut.o.1J){1a ht=O[ee].AY.A7[le[P].E.76];ht.A2&&ht.A2.o.1J&&(ut.o.1J=ht.A2.o.1J)}ut.1q(),ut.AM&&"2b"!==ut.DN&&ut.AH>1&&ut.1t()}}}(H=O[ee].HU()).2C=ne,H.2i={x:F,y:I},H.ev=p,H["1z-1H"]=ue,ZC.AO.C2("xB",t.H,H),O[ee].PW(!0)}1u(H={}).2i={x:F,y:I},H.ev=p,ZC.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c===ZC.1d(t.o.5M.1E)&&(t.o.5M.1E=x[0][0]),h=!0):h=!1),h&&y++,u){1j(i=[],h&&i.1h(x[0]),o=y,s=x.1f;o<s;o++)1j(C=0,A=x[o].1f;C<A;C++)1c===ZC.1d(i[C+y])&&(i[C+y]=[]),i[C+y].1h(x[o][C]);x=i}if("1n"==1y 1o.wk)1j(o=0,s=x.1f;o<s;o++)1j(C=0,A=x[o].1f;C<A;C++)x[o][C]=1o.wk.4v(1g,x[o][C],o,C,t.C.A.K);1a L=0;1j(l=0,r=x.1f;l<r;l++)L=ZC.BN(L,x[l].1f);1a w=[];if(1c===ZC.1d(1b)){1a M=x[y].2M("").1f;1b=x[y].2M("").1F(/[0-9]/g,"").1f/M>.75}1b&&(w=x[y],y++);1a H=[];if(1c===ZC.1d(d))if(1b&&-1!==w[0].1L("\\\\"))d=!0;1u{1a P="";1j(o=y,s=x.1f;o<s;o++)P+=x[o][0];1a N=P.1f;d=P.1F(/[0-9]/g,"").1f/N>.75}if(d){1j(o=y,s=x.1f;o<s;o++)B?H.1h(ZC.1k(x[o][Y])):H.1h(x[o][Y]);Y++}1a O=[],S=[];1j(C=Y;C<L;C++){S[C-Y]=[];1a T=1c,k=1c,z=0,G=1c;1j(o=y,s=x.1f;o<s;o++)if(1c!==ZC.1d(x[o][C])&&""!==x[o][C]&&1y x[o][C]!==ZC.1b[31]){n=x[o][C],1c!==ZC.1d(G)||v||(G=n.1F(/[0-9\\-\\,\\.\\+\\e]+/g,"%v")),v||(n=n.1F(/[^0-9\\-\\,\\.\\+\\e]+/g,""));1a J=n.1L("."),Q=n.1L(",");-1!==J&&-1!==Q?J<Q?(T=".",k=",",z=ZC.BN(0,n.1f-Q)):(T=",",k=".",z=ZC.BN(0,n.1f-J)):-1===J&&-1!==Q?n.1f-Q-1==3?(T=",",k="."):(T=".",k=",",z=ZC.BN(0,n.1f-Q)):-1!==J&&-1===Q&&(n.1f-J-1==3?(T=".",k=","):(T=",",k=".",z=ZC.BN(0,n.1f-J))),"."===T&&(n=n.1F(/\\./g,"").1F(/,/g,".")),","===T&&(n=n.1F(/,/g,"")),S[C-Y].1h(v?n:ZC.1Y(n))}1u S[C-Y].1h(1c);O[C-Y]={},1c!==ZC.1d(G)&&(O[C-Y].5D=G),1c!==ZC.1d(T)&&(O[C-Y][ZC.1b[13]]=T),1c!==ZC.1d(T)&&(O[C-Y][ZC.1b[14]]=k),0!==z&&(O[C-Y][ZC.1b[12]]=z)}if(B)1j(l=0,r=S.1f;l<r;l++)1j(1a R=0;R<S[l].1f;R++)S[l][R]=[H[R],S[l][R]];1a W=[];1Q(t.C.AF){1i"1w":1i"1N":1i"5x":1i"6b":1i"92":1i"88":1i"6U":1i"7z":1i"9z":1c===ZC.1d(t.o[ZC.1b[50]])&&(t.o[ZC.1b[50]]={});1a U=[];d&&1c!==ZC.1d(w[0])&&(U=w[0].2o(/\\\\/)),1c!==ZC.1d(U[0])&&(1c===ZC.1d(t.o[ZC.1b[50]].1H)&&(t.o[ZC.1b[50]].1H={}),1c===ZC.1d(t.o[ZC.1b[50]].1H.1E)&&(t.o[ZC.1b[50]].1H.1E=U[0])),d&&(1c===ZC.1d(t.o[ZC.1b[50]][ZC.1b[5]])?t.o[ZC.1b[50]][ZC.1b[5]]=H:1c===ZC.1d(t.o[ZC.1b[50]][ZC.1b[10]])&&(t.o[ZC.1b[50]][ZC.1b[10]]=H));1a V=[];if(1c!==ZC.1d(g)&&g)1j(l=0,r=S.1f;l<r;l++)V[l]=ZC.1b[51]+(0===l?"":"-"+(l+1));1u if(1c!==ZC.1d(f)&&f){1a j={},q=0,$=[];1j(l=0,r=S.1f;l<r;l++){1j(1a ee=0,te=0,ie=S[l].1f;te<ie;te++)ee+=S[l][te];ee/=S[l].1f;1a ae=1A.46(ZC.HO(ee)/1A.bD/2);1c===ZC.1d(j[ae])&&(j[ae]=ZC.1b[51]+(0===q?"":"-"+(q+1))),-1===ZC.AT($,O[l].5D)?(V[l]=ZC.1b[51]+(0===q?"":"-"+(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e=t.o.1W[ZC.1b[54]])&&(i=e),t.o.1W&&t.o.1W.1P&&(e=t.o.1W.1P[ZC.1b[54]])&&(i=e)),(t.A.KC||t.E["a2-8f-3r"])&&(i="3r"),i}BT(e,t){1y t===ZC.1b[31]&&(t=!1);1j(1a i=[],a=1g,n=0,l=a.BL.1f;n<l;n++)a.BL[n].AF===e&&(!t||t&&a.BL[n].W.1f>0)&&i.1h(a.BL[n]);1l i}BK(e){1j(1a t=1g,i=0,a=t.BL.1f;i<a;i++)if(t.BL[i].BD===e)1l t.BL[i];1l 1c}NL(e){1l e}xf(e){1l 1m ZC.wx(1g,e)}NY(){1j(1a e=1g,t=0,i=e.BL.1f;t<i;t++){1a a=e.BL[t],n=a.BD;e.A.B9.2w(a.o,["("+e.AF+").4B","("+e.AF+")."+n.1F(/\\-[0-9]+/,""),"("+e.AF+")."+n.1F(/\\-[0-9]+/,"-n"),"("+e.AF+")."+n],!1,!0);1a l=n.1F(/\\-[0-9]+/,"")+"-n";e.o[l]&&a.1C(e.o[l]),e.o[n]&&a.1C(e.o[n]),e.AJ["3d"]&&e.A.B9.2w(a.o,["("+e.AF+").4B[3d]","("+e.AF+")."+n.1F(/\\-[0-9]+/,"")+"[3d]","("+e.AF+")."+n.1F(/\\-[0-9]+/,"-n")+"[3d]","("+e.AF+")."+n+"[3d]"],!1,!0),e.AJ["3d"]&&a.1C(e.o[n+"[3d]"]),a.1q()}}UQ(){1l 1c}ov(e){1a t,i,a,n=1g,l=0,r=n.AY.A7.1f;1j(t=0;t<r;t++)l=ZC.BN(l,n.AY.A7[t].S.1f);1n o(e){1l e=(e=(e=e.1F(/(%N|%2r-gp)/g,l)).1F(/(%P|%1B-gp)/g,r)).1F(/(%S|%1z-6p-gp)/g,a.W.1f)}1j(t=0,i=n.BL.1f;t<i;t++)(a=n.BL[t]).H8(e),2===e&&(a.IX=o,a.DB()&&a.1q()),1c===ZC.1d(a.o["1X-2C"])&&1c===ZC.1d(a.o["1X-cA"])&&a.T6(),1c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(e.Q.o.2y="4O"),e.Q.1q(),e.AJ["3d"]&&!e.F9.7I){1a C=ZC.2l(ZC.1k(e.F9.5u*ZC.EK(e.F9.2f)));e.Q.iY+=C,e.Q.F-=C,e.Q.I-=ZC.1k(e.F9.5u*ZC.EE(e.F9.2f))}if(1y e.E["2v-p-x"]!==ZC.1b[31])1j(1a A=0,Z=e.BL.1f;A<Z;A++)e.BL[A].WH(),e.BL[A].GV()}nr(){1a e,t,i,a=1g,n=["1v","2z","2c","1K"],l={};1j(t=0;t<n.1f;t++)l[n[t]]=!1,a.E["2v.d-2y-"+n[t]]&&(a.o.2v["2y-"+n[t]]=1c),a.o.2v&&"4O"===a.o.2v["2y-"+n[t]]&&(l[n[t]]=!0,a.o.2v["2y-"+n[t]]="20");1a r=!1,o={};if("xy"===a.AJ.3y&&(r=!0),("xy"===a.AJ.3y||"yx"===a.AJ.3y)&&(a.Q.E["d-2y"]||a.E["2v.d-2y"])){1j(1a s=0,C=a.BL.1f;s<C;s++){1a A=0,Z=0,c="",p=a.BL[s];if(p.AM&&p.TN){"k"===p.AF?c=p.D8?"2q"===p.B6?"1K":"2z":"2q"===p.B6?"2c":"1v":"v"===p.AF&&(c=p.D8?"2q"===p.B6?"2c":"1v":"2q"===p.B6?"1K":"2z");1a u=0;if(a.Q.E["d-2y-"+c]||a.E["2v.d-2y-"+c]){1a h=1m DP(p);h.1S(p.BQ);1a 1b=ZC.BN(1,ZC.1k((p.A1-p.X)/p.ED));1j(t=p.X;t<=p.A1;t+=1b)if(h.AP=p.FO(t),h.iP&&("k"===p.AF&&!p.D8||"v"===p.AF&&p.D8)&&(h.o[ZC.1b[19]]=ZC.1k(.9*p.A9)),h.1q(),h.AM)if(Z=ZC.BN(Z,h.AA%180==0?h.F:h.I),A=ZC.BN(A,h.AA%180==0?h.I:h.F),u=ZC.BN(u,1.5*h.DG*(h.AP||"").2o(/<br>|<br\\/>|<br \\/>|\\n/).1f),"1v"===c||"2c"===c){if(u=ZC.BN(u,.o4*h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+C.L])&&(C.E=3g.1q(e),1c===ZC.1d(C.E["2i-on"])||ZC.2t(C.E["2i-on"])||(C.eX=!1)),C.E.r0||(C.A.E["2Y-"+C.K+"-1W-6w"]=1c),C.E.r0=1c,C.MJ="1q.7l",1D.1q(),C.qP(),-1!==3g.5b(C.o).1L("1o.4W")&&(C.o.2v=C.o.2v||{},C.o.2v.2y=0);1a c=1c;if(!1o.4F.8j&&((e=C.o["hI-6O"])&&(C.RS=e["hI-3R"]),(e=C.o.6O)&&("4j"==1y e?e.3R?C.RS=e.3R:e["1U-3b"]&&(c=e["1U-3b"]):C.RS=e),""!==C.RS&&1c!==ZC.1d(C.A.m4[C.RS])&&(c=C.A.m4[C.RS]),C.H.NZ&&(c=C.H.NZ),c)){1a p=C.xf(c);C.o=p.1q()}if(C.LT=1o.xk,C.4C([["cf","UU","b"],["cJ","NA","f"],["aE","LT","b"],["nz","CB","b"],["7H-1J","KW"],["zd-1J","lY"],["3R-1U","ps"],["3h","LA","i"],["6W","BO"],["3Z-2J","pW","b"]]),C.BO.1f>0)1j(A.B9.6W=[],a=0;a<C.BO.1f;a++){1a u=C.BO[a],h=ZC.AO.JM(C.BO[a],10),1b=ZC.AO.QT(C.BO[a],10);A.B9.6W.1h(["#2T",u,h,1b])}"7a"===C.AF&&(C.F9.7I=!0),(C.AJ["3d"]||C.A.es)&&(C.LT=!1),C.qG(),-1===ZC.AT(C.H.KX,ZC.1b[41])&&((1c!==ZC.1d(e=C.o.2A)||A.PS("2A",C.AF))&&C.AJ[ZC.1b[56]]&&(C.BI&&!C.E["d9-2A-1q"]||1y oR===ZC.1b[31]||(C.E["d9-2A-1q"]=!1,C.BI=1m oR(C),C.BI.OL="2A",A.2w(C.BI.o,Z+".2A"),(t=C.o.2v)&&C.BI.1C({"1T-1r":t[ZC.1b[0]],"1T-1r-1":t["1T-1r-1"],"1T-1r-2":t["1T-1r-2"],"5c-oO":t["5c-oO"],"5c-hJ":t["5c-hJ"]}),C.BI.1C(e),C.BI.1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&&t.I9.3l(),t.MJ="3j.ar"}3j(e,t){1c===ZC.1d(e)&&(e=!1),1c===ZC.1d(t)&&(t=!1);1a i,a,n,l,r=1g;r.TU={},1c===ZC.1d(i=r.A.SM[r.K])||e||"c4"===r.HP.1J&&(i.8t("1o.jb"),i.7w(),r.A.SM[r.K]=1c),r.GB&&r.M4.8P(!0),r.MJ="3j.7l",r.3l(e),r.Y3(!1,!0),r.L7(),r.L7("3I"),r.L7("2i",!0),r.L7("6F",!0),r.L7("mx",!0),e||(!r.BI||r.BI&&!r.BI.LT)&&r.L7("8A",!0),r.AY.YX=[],r.A.T1=[],1o.4F.ez||r.BB&&r.BB.3j(),r.E.c3=[];1a o,s,C,A=ZC.6R?ZC.AK(r.A.K):1c;if(ZC.2K||ZC.6R)ZC.A4("."+r.K+"-2r-1N",A).3r();1u if(ZC.AK(r.A.K+"-5S")&&ZC.AK(r.A.K+"-3e")){ZC.AK(r.A.K+"-5S").4l("qy","");1a Z=ZC.AK(r.A.K+"-3e").jy(!0);1j(a=(n=Z.7k.1f)-1;a>=0;a--)-1!==Z.7k[a].7U.1L(r.K+"-2r-1N")&&Z.aP(Z.7k[a]);ZC.P.ER(r.A.K+"-3e"),ZC.AK(r.A.K+"-1v").3c(Z),ZC.AK(r.A.K+"-5S").4l("qy","#"+r.A.K+"-3e")}1Q(r.AY.HQ=[],ZC.A4("."+r.K+"-1V-3F",A).3r(),ZC.A4("."+r.K+"-1z-1R-1H",A).3r(),ZC.A4("."+r.K+"-1z-1P",A).3r(),ZC.A4("."+r.K+"-1z-1H",A).3r(),ZC.A4("."+r.K+"-2i-1H",A).3r(),ZC.A4("."+r.K+"-2S-1H",A).3r(),ZC.A4("."+r.K+"-qt-1H",A).3r(),e||ZC.A4("."+r.K+"-2A-1P",A).3r(),r.A.AB){1i"2F":1j(a=0,n=r.AY.A7.1f;a<n;a++)r.AY.A7[a].HI=1c;ZC.A4("#"+r.A.K+"-mq").9x().5f(1n(){"15k"!==1g.86.5J()&&(0!==1g.id.1L(r.K+"-")&&1!==r.A.AI.1f||(e?1g.id!==r.K+"-5c"&&-1===1g.id.1L("-2A-5c")&&-1===1g.id.1L("-2B-7W-5c")&&-1!==1g.id.1L(r.K+ZC.1b[35])&&(t&&r.GB||-1!==1g.id.1L(r.K+"-1W-")&&1o.4F.ez||ZC.A4(1g).3r()):-1===1g.id.1L("zc-2B-")&&-1===1g.id.1L("-2B-7W-")&&(-1!==1g.id.1L(r.K+"-1W-")?1o.4F.ez||ZC.A4(1g).3r():r.BI&&r.BI.LT?-1===1g.id.1L("-2A-5c")&&ZC.A4(1g).3r():ZC.A4(1g).3r())))}),e||ZC.P.ER([r.K+"-3v",r.K+"-3v-2N",r.K+"-3v-2A"]),ZC.A4("#"+r.A.K+"-2F").9x().5f(1n(){1a e=r.K+"-";"xW"===1g.86.aO()&&1g.id.2x(0,e.1f)===e&&1g.id!==r.K+"-3v"&&1g.id!==r.K+"-3v-2N"&&1g.id!==r.K+"-3v-2A"&&ZC.P.ER(1g.id)})}(ZC.P.ER(r.K+"-hg"),ZC.P.ER(r.A.K+"-2H-1E-9d"),e||(ZC.P.ER([r.K+"-5M",r.K+"-81",r.K+"-7b",r.K+"-2N"]),1o.4F.ez||r.BB&&(ZC.P.ER(r.K+"-1W-c"),ZC.P.ER(r.K+"-1W-1Z-c"),ZC.A4("."+r.K+"-1W-1P-1N",A).3r(),ZC.A4("."+r.K+"-1W-1R-1N",A).3r(),ZC.A4("."+r.K+"-1W-1P",A).3r(),ZC.A4("."+r.K+"-1W-5R",A).3r(),ZC.A4("."+r.K+"-1W-9Q",A).3r(),ZC.A4("."+r.K+"-1W-a3",A).3r(),r.BB.gc(),r.BB=1c),r.BI&&(r.BI.LT&&!r.A.E.bF||(r.BI.3l(),ZC.A4("."+r.K+"-2A-3O").3r(),ZC.A4("."+r.K+"-2A-4P").3r(),ZC.A4("#"+r.K+"-2A").3r(),r.BI.gc(),r.BI=1c)),r.IA&&(r.IA.3l(),r.IA=1c),ZC.P.II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o.A.E["2Y."+o.K+".lV"])1j(l=0,r=o.AY.A7.1f;l<r;l++)o.AY.A7[l].GB=!1;o.AY.1t(),o.H.q7()}TH(){}gf(){1a e=1g;e.BI&&(ZC.P.II(ZC.AK(e.K+"-2A-c"),e.A.AB,e.iX,e.iY,e.I,e.F,e.K),e.A.HA&&!e.A.HA.mE&&e.BI.k9(),e.BI.IO=!0)}bj(){}fI(){1a e,t,i,a,n=1g;1j(n.E["a2-8f-3r"]=1c,n.GB||n.A.XX(),n.A.OD=!1,(n.LT||!n.GB||n.H.E["2Y."+n.K+".lV"]||!n.AJ[ZC.1b[55]]||-1!==ZC.AT(n.H.KX,ZC.1b[41])||1o.4F.b5)&&(n.MJ="9p"),"y5"===n.lY&&(n.xu=!1,n.H.E["2Y."+n.K+".lV"]=!0),t=0,i=n.BL.1f;t<i;t++)n.BL[t].6L();if(!n.A.E["d6-2w"]){1a l=ZC.AO.C2("15Q",n.A,n.HU(),!0);if(l)1j(1a r=[ZC.1b[10],"5X","15L","e9"],o=0;o<r.1f;o++)l[r[o]]&&(n.o[r[o]]=(n.o[r[o]]||[]).4A(l[r[o]]))}1n s(e){1a t,i,a=(e.9N||e.2X.id).1F("-1N-2R","").1F("-2R","").1F(/--([a-zA-Z0-9]+)/,"").1F("-1R","").1F("-3A","").2o("-").9r();1l"2r"===a[1]&&(t=a[2],i=a[0]),[t,i]}if(n.AJ["3d"]||(n.bj(),n.PE(),n.JQ(),-1===ZC.AT(n.H.KX,ZC.1b[41])&&n.Q6()),-1===ZC.AT(n.H.KX,ZC.1b[41])){1a C=ZC.A4("."+n.K+"-2r-1N");n.XL=1n(e){if(!(1o.aY&&"6Z"===1o.mI&&"6Z"===e.1J||(1o.hH=n.A.K,1o.aY=e,1o.mI=e.1J,ZC.3o||n.BB&&n.BB.ZG||-1===ZC.P.TA(e.2X).1L("zc-2r-1N")||"9p"!==n.MJ))){ZC.2K&&(n.E["2r-2X-id"]=e.2X.id,ZC.3o=!1,n.H.9j(),1c===n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&n.BB.en(-1):n.BB.en(-1),ZC.3o=!1)}!ZC.2K||n.H.dI||ZC.3o||(1o.SN(e),n.TS(e))}}}},C.4g("6l 7D 5V",n.qA),n.r5=1n(e){if(1o.aY=e,1o.hH=n.A.K,1o.mI=e.1J,-1!==ZC.P.TA(e.2X).1L("zc-2r-1N")&&"9p"===n.MJ){ZC.2K&&n.A.P2(e);1a t=s(e);n.E["1B"+t[0]+".2h"]&&n.A.A8&&n.A8&&n.A8.AM&&n.A.A8.hd(e)}},C.4g("83 6h",n.r5),n.TS=1n(e){if((e.9N||-1!==ZC.P.TA(e.2X).1L("zc-2r-1N"))&&"9p"===n.MJ){1a t=s(e),i=n.AY.A7[t[0]].FQ(t[1]);if(i&&("2b"===i.A.J2||!ZC.2K&&0!==e.7M||(n.A.E[ZC.1b[53]]=!0,n.gf(),n.qv(i.A.L,i.L)),i.OY(e,"3I"),i.A.UL(e,"3I"),1c!==ZC.1d(i.A.E4)&&"gS"!==i.A.E4))if(i.A.E4 3E 3M)1j(1a a=0;a<i.A.E4.1f;a++){1a l=i.A.FE;i.A.FE 3E 3M&&(l=i.A.FE[a]||"2Y="+(n.o.id||"")),a===i.L&&n.TZ(e,i.EX(i.A.E4[a],1c,1c,!0),l)}1u n.TZ(e,i.EX(i.A.E4,1c,1c,!0),i.A.FE||"2Y="+(n.o.id||""))}},n.qZ=1n(e){if(-1!==ZC.P.TA(e.2X).1L("zc-2r-1N")&&"9p"===n.MJ){1a t=s(e),i=n.AY.A7[t[0]].FQ(t[1]);i&&(i.OY(e,"ym"),i.A.UL(e,"ym"))}},ZC.2K||C.4g("3I",n.TS).4g("gd",n.TS).4g("9h",n.qZ)}if(n.pM(),n.A.E["tr-ev-"+n.L]?(n.A.E["tr-ev-"+n.L]=1c,n.qD()):n.qD(),n.iI){n.iI=!1;1a A={4y:n.K};1j(t=0,i=n.BT("k").1f;t<i;t++){1a Z=n.BT("k")[t];1c!==ZC.1d(e=Z.M0)&&(A["7E"+(a=1===Z.L?"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===ZC.1d(t)&&(t=!1),i.A.MP(i),i.E["2Y-JS"]=!0,i.3j(e,t),i.1q(),i.UK&&i.UK(),i.1t(e),i.BI&&i.BI.qQ(),i.HH=!1,1o.4F.8j=!1}TZ(ev,E4,FE){if(2!==ev.7M){1a s=1g,C,PM=[""];1Q(1c!==ZC.1d(FE)&&(PM=FE.2o("=")),PM[0]){1i"qN":2u.bp(E4,"qN");1p;1i"yw":2u.1v.82.7L=E4;1p;1i"yv":2u.xC.82.7L=E4;1p;1i"2u":1c!==ZC.1d(PM[1])&&""!==PM[1]&&(2u.1v[PM[1]].82.7L=E4);1p;1i"2Y":1a YH=1c;if("()"===E4.2x(E4.1f-2)||"7s:"===E4.2x(0,11))4M{1a EG=E4.1F("7s:","").1F("()","");7t(EG)&&(YH=7t(EG).4v(s))}4K(e){}1c!==ZC.1d(PM[1])&&""!==PM[1]?"yw"===PM[1]||"yv"===PM[1]?(s.A.MP(),YH?1o.3n(s.A.K,"aK",{1U:YH}):s.A.2w(1c,E4)):(C=s.A.OF(PM[1]),C&&(s.A.MP(C),s.A.E["tr-ev-"+C.L]=!0,s.A.O2++,YH?1o.3n(s.A.K,"aK",{4y:PM[1],1U:YH}):s.A.2w(PM[1],E4))):(C=s.A.AI[0],s.A.MP(C),YH?1o.3n(s.A.K,"aK",{4y:C.K,1U:YH}):(s.A.E["tr-ev-"+C.L]=!0,s.A.O2++,s.A.2w(C.K,E4)));1p;2q:2u.82.7L=E4}}}I1(e,t,i){1a a=1g;if(1c===ZC.1d(i)&&(i=a.AY.A7.1f-1),1c!==ZC.1d(e)&&1y e!==ZC.1b[31])1l a.AY.A7[e];if(1c===ZC.1d(t)||1y t===ZC.1b[31])1l a.AY.A7[i];1j(1a n=0,l=a.AY.A7.1f;n<l;n++)if(t===a.AY.A7[n].H3)1l a.AY.A7[n];1l 1c}Z0(e,t){1a i,a,n=1g;(e=e||{})[ZC.1b[54]]=e[ZC.1b[54]]||n.7T();1a l=1c;if(1y e.3W!==ZC.1b[31]&&(l=ZC.1k(e.3W)),-1===l)1j(l=[],i=0,a=n.AY.A7.1f;i<a;i++)l.1h(i);l 3E 3M||(l=[l]);1a r=e.4Z||"";r 3E 3M||(r=[r]);1a o=[];1j(i=0,a=ZC.BN(l.1f,r.1f);i<a;i++){1a s=n.I1(l[i],r[i]);if(s){1a C={};ZC.2E(e,C);1a A=s.L;C.3W=A,C.4Z=s.H3,("4m"===t&&!n.E["1B"+A+".2h"]||"5d"===t&&n.E["1B"+A+".2h"])&&o.1h(C)}}1j(i=0,a=o.1f;i<a;i++)n.A.o[ZC.1b[16]][n.L][ZC.1b[11]][o[i].3W].2h="4m"===t,i===a-1&&(o[i].JS=1),n.PC(o[i])}PC(e){1a t,i,a,n=1g;n.A.E["2Y."+n.K+".lV"]=!1,e=e||{};1a l=!1;1c!==ZC.1d(e.b1)&&e.b1&&(l=!0);1a r=!1;e[ZC.1b[54]]=e[ZC.1b[54]]||n.7T(),1c!==ZC.1d(t=e["bx-1W"])&&(r=ZC.2t(t));1a o=n.I1(e.3W,e.4Z);if(o){1a s=o.L;1Q(e[ZC.1b[54]]){1i"5d":if(n.BB&&(n.BB.E.lX=!0),n.E["1B"+s+".2h"]=!n.E["1B"+s+".2h"],1c!==ZC.1d(n.A.o[ZC.1b[16]][n.L][ZC.1b[11]])&&(n.A.o[ZC.1b[16]][n.L][ZC.1b[11]][s].2h=n.E["1B"+s+".2h"]),n.AJ["3d"])r=!0,l||n.JS();1u{1a C=n.E["1B"+s+".2h"]?"8K":"2b";if(1o.3J.bh||ZC.A4("."+n.K+ZC.1b[35]+s+"-2r-1N").5f(1n(){if("xN"===1g.86.5J()){1a e=ZC.A4(1g),t=e.3S("9o"),a=e.3S("2S");"2b"===C?(t="-"+t.1F(/,/g,",-"),"5q"===a?4===(i=t.2o(",")).1f&&(t=[i[2],i[3],i[0],i[1]].2M(",")):"3A"===a&&3===(i=t.2o(",")).1f&&(t=[i[0],i[1],-i[2]].2M(","))):(t=t.1F(/\\-/g,""),"5q"===a&&4===(i=t.2o(",")).1f&&(t=[i[2],i[3],i[0],i[1]].2M(","))),e.3S("9o",t)}}),n.A.KC)ZC.AK(n.K+"-4k-bl-c").1I.3N=C,ZC.AK(n.K+"-4k-fl-c").1I.3N=C,ZC.AK(n.K+"-4k-vb-c").1I.3N=C;1u{1j(a=0;a<o.T2;a++)(t=ZC.AK(n.K+"-1B-"+s+"-bl-"+a+"-c"))&&(t.1I.3N=C);1j(a=0;a<o.l4;a++)(t=ZC.AK(n.K+"-1B-"+s+"-fl-"+a+"-c"))&&(t.1I.3N=C);(t=ZC.AK(n.K+"-1B-"+s+"-vb-c"))&&(t.1I.3N=C)}1a A=ZC.A4("."+n.K+"-1B-"+s+"-1V-3F");n.E["1B"+s+".2h"]?(A.4m(),ZC.A4("."+n.K+ZC.1b[35]+s+"-2A").4m()):(A.5d(),ZC.A4("."+n.K+ZC.1b[35]+s+"-2A").5d())}1p;1i"3r":n.gf(),r=!0,n.E["a2-8f-3r"]=!0,n.E["1B"+s+".2h"]=!n.E["1B"+s+".2h"],e.JS&&(l||(n.LF("on-1W-a2"),n.JS(!0,!0)))}n.BB&&!r&&(n.BB.3j(),n.BB.1t())}}LF(e){1a t=1g,i=!0,a=t.o.1B||{};1c!==ZC.1d(a.8y)&&1c!==ZC.1d(a.8y[e])&&(i=ZC.2t(a.8y[e])),t.HH="y5"===t.lY||!i}HU(){1l{id:1g.A.K,Cl:1g.L,4y:1g.K.1F(1g.A.K+"-2Y-",""),x:1g.iX,y:1g.iY,1s:1g.I,1M:1g.F,6G:1g.A.FD()}}SC(){}S5(){}gc(){1j(1a e=0;e<1g.BL.1f;e++)1g.BL[e].gc();1j(1a t=0;t<1g.AY.A7.1f;t++)1g.AY.A7[t].gc();ZC.AO.gc(1g.AY,["A","C","H","F5","o","I4","JW"]),ZC.AO.gc(1g,["Z","C6","AJ","J1","KP","MZ","F9"])}}K1.5n.PE=1n(){1a e,t,i,a,n,l,r,o,s=1g;s.qE(),s.BW=[],s.FG=[],s.YN=[],s.LP=[],s.FL=[],s.XP={};1a C,A,Z,c=s.A.B9,p="("+s.AF+")";if(1c!==ZC.1d(C=s.o[ZC.1b[10]]))1j(t=0,i=C.1f;t<i;t++){C[t].id||(C[t].id="18A"+t+"1b"+ZC.hw(5I,6H)),a=C[t].id||t,n=!1,l=!1,s.E["2J.dY"]&&-1===ZC.AT(s.E["2J.dY"],a)&&(n=!0,l=!0),C[t].cM&&(n=!0);1a u=1o.6g.a8("DP",s,s.K+"-1H-"+a,n);if(!l||!u.pc){if(c.2w(u.o,p+".1H"),u.1C(C[t]),1c!==ZC.1d(e=u.o.xC))1j(1a h=0;h<s.BW.1f;h++)if(""+s.BW[h].H3==""+e){u.E["p-x"]=s.BW[h].iX,u.E["p-y"]=s.BW[h].iY,u.E["p-1s"]=s.BW[h].I,u.E["p-1M"]=s.BW[h].F;1p}if(u.H3=a,u.K=s.K+"-1H-"+a,u.GJ=s.K+"-1H zc-1H",1c!==ZC.1d(e=C[t].7m)&&(u.E.7m=e),u.EX=1n(t){if(!t||-1===(""+t).1L("%"))1l t;t=""+t;1a i,a=[];a.1h(["%id",s.A.K]),a.1h(["%4y",s.K.1F(s.A.K+"-2Y-","")]);1a n=s.E.3T;1j(1a l in n)a.1h(["%"+l,n[l]]);a.3Z(ZC.k6);1j(1a r=0,o=a.1f;r<o;r++)i=1m 5v(a[r][0],"g"),t=t.1F(i,a[r][1]);1a C,A,Z,c,p=u.o["2q-1V"]||" ";1j(i=1m 5v("(%1B-([0-9]+?)-1V(-*)([0-9]*?))|(%1B-1V-([0-9]+?))|(%1B-1V)|(%8l)|(%2r-8i-1V)","g"),t=t.1F(i,p),i=1m 5v("\\\\((.+?)\\\\)\\\\(([0-9]*)\\\\)\\\\(([0-9]*)\\\\)");C=i.3n(t);)if("%2r-1V"===C[1]){A="";1a h=0,1b=0;""!==(e=C[2])&&(h=ZC.1k(e)),""!==(e=C[3])&&(1b=ZC.1k(e)),(c=s.AY.A7[h])&&(Z=c.FQ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.3Z(1n(e,t){1l e.ah-t.ah==0?e.2Z-t.2Z:e.ah-t.ah})},K1.5n.Y3=1n(e,t){1y e===ZC.1b[31]&&(e=!1),1y t===ZC.1b[31]&&(t=!1);1a i,a=1g,n=[a.K+"-2J-2c-sh-c",a.K+"-2J-2c-c",a.K+"-2J-1v-sh-c",a.K+"-2J-1v-c",a.K+"-2J-5m-c",a.K+"-2J-6F-c"];ZC.g6||n.1h(a.K+"-2J-4W-sh-c",a.K+"-2J-4W-c");1j(1a l=0;l<n.1f;l++)(i=ZC.AK(n[l]))&&ZC.P.II(i,a.H.AB,a.iX,a.iY,a.I,a.F,a.K);"3f"===a.A.AB&&!1o.hp&&ZC.bE||(ZC.A4("."+a.K+"-1H").3r(),ZC.A4("."+a.K+"-2S-1H").3r(),ZC.A4("."+a.K+"-7C-1H").3r()),e||(ZC.A4("."+a.K+"-1H-1N").5f(1n(){if(-1===ZC.AT([a.K+"-5M-1N",a.K+"-81-1N",a.K+"-7b-1N"],1g.id)){1a e=1m 5v("18s(x|y|k|v)-(7J|b4)([0-9]+)").3n(1g.id);!t&&e&&e.1f||ZC.P.ER(1g.id)}}),ZC.A4("."+a.K+"-2S-1N").5f(1n(){(!ZC.g6||ZC.g6&&"1"!==1g.bT("1U-3e"))&&ZC.P.ER(1g.id)}),ZC.A4("."+a.K+"-7C-1N").3r()),"2F"===a.A.AB&&ZC.A4("#"+a.A.K+"-2F").9x().5f(1n(){1a e=a.K+"-1H-";"xW"===1g.86.aO()&&1g.id.2x(0,e.1f)===e&&ZC.P.ER(1g.id)})},K1.5n.oW=1n(){1a e=1g;(e.H.O7["2J-1v"]||e.H.O7["2J-2c"])&&(ZC.A4("."+e.K+"-1H-1N").4i(ZC.2K?"4G":"6C 6Z",e.pD).4i(ZC.2K?"5V":"6l 7D",e.pE).4i(ZC.2K?"6h":ZC.1b[48],e.ra),ZC.2K||ZC.A4("."+e.K+"-1H-1N").4i("3I",e.US).4i("9h",e.US),ZC.A4("."+e.K+"-2S-1N").4i(ZC.2K?"4G":"6C 6Z",e.pK).4i(ZC.2K?"5V":"6l 7D",e.pI).4i(ZC.2K?"6h":ZC.1b[48],e.pB),ZC.2K||ZC.A4("."+e.K+"-2S-1N").4i("3I",e.V0).4i("9h",e.V0))},K1.5n.O1=1n(){1a e,t,i,a,n=1g;if(n.ZH=!1,1c!==ZC.1d(i=n.o[ZC.1b[10]]))1j(e=0,t=i.1f;e<t;e++){1a l=""+(i[e].1E||"");if(-1!==l.1L("%2r-")||-1!==l.1L("%1B-")||-1!==l.1L("%8l")||-1!==l.1L("%2r-8i-1V")||ZC.2t(i[e].4O)){n.ZH=!0;1p}}if(1c!==ZC.1d(a=n.o.5X))1j(e=0,t=a.1f;e<t;e++)if(ZC.2t(a[e].4O)){n.ZH=!0;1p}},K1.5n.PW=1n(e){1a t=1g;ZC.g6=!0,t.Y3(e),t.PE(),t.JQ(e),ZC.g6=!1},K1.5n.JQ=1n(e){1y e===ZC.1b[31]&&(e=!1);1a t,i,a,n=1g,l=[],r=[];1n o(e){1a t=n.YN[e];if(t.AM&&(t.Z=t.C6=n.H.2Q()?n.H.mc("1v"):ZC.AK(n.K+"-2J-"+(t.JR<0?"2c":"1v")+"-c"),t.1t(),t.AM&&ZC.AK(n.A.K+"-3e"))){1a i=t.BE.mY(),a=ZC.P.GE(i[0],t.BE.E4,t.BE.IV)+\'1O="\'+n.K+\'-7C-1N zc-7C-1N" id="\'+t.BE.K+\'-1N" 9o="\'+i[1]+\'" />\';"1v"===t.o[ZC.1b[7]]?r.1h(a):l.1h(a)}}1n s(e){if(n.FG[e]){1a i=n.FG[e],a=i 3E QW?i.BE:i;if((!ZC.g6||!a.o["3e-1P"])&&a.AM){if(1c!==ZC.1d(t=i.E.7m)){1a o=n.OJ(t);-1!==o[0]&&(a.iX=ZC.1k(o[0])),-1!==o[1]&&(a.iY=ZC.1k(o[1]))}if(!i.E["3d"]||i.E["xX"]){i.Z=n.H.2Q()?n.H.mc("1v"):ZC.AK(n.K+"-2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5n.R9=1n(e,t,i,a){1a n,l,r,o,s=1g;1Q(i=i||"2N",e){1i"2S":1a C=s.FG[t],A=C 3E QW?C.BE:C;if(1c!==ZC.1d(A.o[i+"-3X"])){if(!a&&A.o.6d)1j(r=0,o=s.FG.1f;r<o;r++)r!==t&&(s.FG[r].o.6d===A.o.6d||s.FG[r].BE&&s.FG[r].BE.o.6d===A.o.6d)&&s.R9(e,r,i,!0);if((n=1m DR(s)).1C(A.o),n.1C(A.o[i+"-3X"]),l=A.o.id||t,n.H3=l+"-"+i,n.K=s.K+"-2S-"+l+"-"+i,n.1q(),C.E["3d"]&&(n.D=A.D,n.iX=C.iX,n.iY=C.iY),n.AM)if(n.Z=n.C6=ZC.AK(s.K+"-2J-"+i+"-c"),n.o["3e-1P"]&&(n.Z=n.C6=ZC.AK(s.K+"-2J-4W-"+i+"-c")),n.o["3e-1P"]&&1o.4W.uO&&"3f"!==s.A.AB){if("2F"===s.A.AB){1a Z=ZC.A4("#"+s.K+"-2S-"+n.H3+"-bN-2R");s.E["3e-2S-6w"]={3k:Z.3S("3k"),4b:Z.3S("4b"),"4b-1s":Z.3S("4b-1s")},"4z"===n.DN?(Z.3S("3k",n.A0),Z.3S("4b-1s",n.AQ),Z.3S("4b",n.BU)):"1w"===n.DN&&(Z.3S("4b-1s",n.AZ),Z.3S("4b",n.B7))}1u if("3L"===s.A.AB){1a c=ZC.AK(s.K+"-2S-"+n.H3+"-bN-2R"),p=ZC.A4(c.7k[1]),u=ZC.A4(c.7k[2]);s.E["3e-2S-6w"]={3k:""+u.3S("1r"),4b:""+p.3S("1r"),"4b-1s":""+p.3S("79")},"4z"===n.DN?(u.3S("1r",n.A0),p.3S("79",n.AQ),p.3S("1r",n.BU)):"1w"===n.DN&&(p.3S("79",n.AZ),p.3S("1r",n.B7))}}1u n.1t(),"3f"===s.A.AB&&1o.hp&&C.M&&(C.M.Z=C.M.C6=ZC.AK(s.K+"-2J-"+i+"-c"),C.M.1t())}1p;1i"1H":1a h=s.B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3e-2S-6w"]["4b-1s"])}1u if("3L"===a.A.AB){1a r=ZC.AK(a.K+"-2S-"+i.2S.id+"-bN-2R"),o=r.7k[1],s=r.7k[2],C=a.E["3e-2S-6w"];"4z"===i.2S.1J&&ZC.P.G4(s,{1r:C.3k}),ZC.P.G4(o,{79:C["4b-1s"],1r:C.4b})}a.S5(t,i)},a.pB=1n(e){1a t=n(e);t.2H&&a.A8&&a.A.A8&&a.A8.AM&&a.A.A8.hd(e),a.S5(ZC.1b[48],t)},a.V0=1n(e){1a t=n(e);if("9h"!==e.1J){e.hz||a.L7("3I"),a.TU=a.TU||{},a.TU["pN"+t.ip]?(a.TU["pN"+t.ip]=1c,a.L7("3I")):(e.hz||(a.TU={}),a.TU["pN"+t.ip]=1,a.R9("2S",t.io,"3I")),a.S5("3I",t);1a i=a.FG[t.io].BE||a.FG[t.io];if(i&&i.E4&&"gS"!==i.E4)if(i.E4 3E 3M)1j(1a l=0;l<i.E4.1f;l++)1c!==ZC.1d(i.FE[l])&&a.TZ(e,i.E4[l],i.FE[l]);1u a.TZ(e,i.E4,i.FE)}1u a.S5("9h",t)},ZC.A4("."+a.K+"-2S-1N").4g(ZC.2K?"4G":"6C 6Z",a.pK).4g(ZC.2K?"5V":"6l 7D",a.pI).4g(ZC.2K?"6h":ZC.1b[48],a.pB),ZC.2K||ZC.A4("."+a.K+"-2S-1N").4g("3I",a.V0).4g("9h",a.V0),a.pD=1n(e){ZC.2K&&(a.L7(),ZC.3o=!1,a.H.9j(),1c===a.H.DD||1c===ZC.1d(a.H.DD["3h-1Z"])||a.H.DD["3h-1Z"]||e.6S(),a.A.W1(e));1a t=l(e);if(t.2H&&a.A8&&a.A.A8&&a.A8.AM&&a.A.A8.g4(e),1c!==t&&"1H"===t.1J){1a i=ZC.2K?"6C":e.fS||e.1J;t["1U-6K"]||a.R9("1H",t.g2),a.SC(i,t)}},a.pE=1n(e){ZC.2K&&(a.H.dI||ZC.3o||(1o.SN(e),a.US(e)),a.A.P2(e)),a.A8&&a.A.A8&&a.A8.AM&&a.A.A8.g3(e),ZC.2K||a.L7();1a t=l(e);if(1c!==t){1a i=ZC.2K?"6l":e.fS||e.1J;ZC.AK(a.K+"-1H-"+t.1H.id)&&(ZC.AK(a.K+"-1H-"+t.1H.id).1I.3N="8K"),a.SC(i,t)}},a.ra=1n(e){1a t=l(e);t.2H&&a.A8&&a.A.A8&&a.A8.AM&&a.A.A8.hd(e),a.SC(ZC.1b[48],t)},a.US=1n(e){1a t=l(e);if("9h"!==e.1J){e.hz||a.L7("3I"),a.TU=a.TU||{},a.TU["pz"+t.e1]?(a.TU["pz"+t.e1]=1c,a.L7("3I")):(e.hz||(a.TU={}),a.TU["pz"+t.e1]=1,a.R9("1H",t.g2,"3I")),a.SC("3I",t);1a i=a.BW[t.g2];if(!i)1Q(t.1J){1i"2Y-5M":i={E4:a.J1.E4,FE:a.J1.FE};1p;1i"2Y-81":i={E4:a.KP.E4,FE:a.KP.FE};1p;1i"2Y-7b":i={E4:a.MZ.E4,FE:a.MZ.FE}}if(i&&i.E4&&"gS"!==i.E4)if(i.E4 3E 3M)1j(1a n=0;n<i.E4.1f;n++)1c!==ZC.1d(i.FE[n])&&(i.E4[n]=i.E4[n].1F("%id",a.A.K),i.E4[n]=i.E4[n].1F("%4y",a.K.1F(a.A.K+"-2Y-","")),a.TZ(e,i.E4[n],i.FE[n]));1u i.E4=i.E4.1F("%id",a.A.K),i.E4=i.E4.1F("%4y",a.K.1F(a.A.K+"-2Y-","")),a.TZ(e,i.E4,i.FE)}1u a.SC("9h",t)},ZC.A4("."+a.K+"-1H-1N").4g(ZC.2K?"4G":"6C 6Z",a.pD).4g(ZC.2K?"5V":"6l 7D",a.pE).4g(ZC.2K?"6h":ZC.1b[48],a.ra),ZC.2K||ZC.A4("."+a.K+"-1H-1N").4g("3I",a.US).4g("9h",a.US));1n n(e){1j(1a t=(e.9N||e.2X.id).1F(/\\-\\-\\d+/g,"").1F(a.K+"-2S-","").1F("-bN-1N","").1F("-1N",""),i=-1,n=1c,l=0,r=a.FG.1f;l<r;l++)if(a.FG[l]&&""+a.FG[l].H3==""+t){i=l,n=a.FG[l]3E QW?a.FG[l].BE:a.FG[l];1p}if(!n&&e.2X.bT("1U-jR"))1l{ip:e.2X.id,jR:!0,ev:e};if(-1===i)1l 1c;1a o={ip:t,io:i,2H:n.o.2H?1:0,2S:{id:t,2Z:i,2p:n.DH,x:n.iX,y:n.iY,1J:n.DN,uw:n.o["3e-1P"],2W:n.D,1s:n.I,1M:n.F,2e:n.AH,ux:n.L1,2f:n.AA,9K:n.JR},ev:e};1j(1a s in n.o)n.o.8d(s)&&"1U-"===s.2x(0,5)&&(o[s]=n.o[s]);1l o}1n l(n){1a l,r=n.9N||n.2X.id;if(r===a.K+"-5M-1N"||r===a.K+"-81-1N"||r===a.K+"-7b-1N"){1a o=1c,s=-1;1Q(l=r.1F(a.K+"-","").1F("-1N","")){1i"5M":o=a.J1,s=-1;1p;1i"81":o=a.KP,s=-2;1p;1i"7b":o=a.MZ,s=-3}1l{1J:"2Y-"+l,e1:o.K,g2:s,1E:o.AP,1H:{id:o.K,2Z:s,1E:o.AP},ev:n}}if(-1===r.1L("-1z")||-1===r.1L("-1P")&&-1===r.1L("-1R")){if(-1!==r.1L("-1V-3F-")){e=r.1F(a.K+ZC.1b[35],"").1F("-1V-3F-1N",""),t=e.2o("-2r-");1a C=a.AY.A7[ZC.1k(t[0])].FQ(ZC.1k(t[1]));1l C?{1J:ZC.1b[17],e1:"uv"+t.2M("1b"),3W:ZC.1k(t[0]),5W:ZC.1k(t[1]),1E:C.AE,1H:{id:"uv"+t.2M("1b"),1E:C.AE},ev:n}:1c}e=r.1F(a.K+"-1H-","").1F("-1N","");1j(1a A=-1,Z=1c,c=0,p=a.BW.1f;c<p;c++)if(""+a.BW[c].H3==""+e){A=c,Z=a.BW[c];1p}if(i=-1===A?"":a.BW[A].AP,-1===A)1l 1c;1a u={1J:"1H",e1:e,g2:A,1E:i,2H:Z.o.2H?1:0,1H:{id:e,2Z:A,2p:Z.DH,x:Z.iX+Z.BJ,y:Z.iY+Z.BC,1s:Z.I,1M:Z.F,1E:i},ev:n};1j(1a h in Z.o)Z.o.8d(h)&&"1U-"===h.2x(0,5)&&(u[h]=Z.o[h]);1l u}e=r.1F(a.K+"-","").1F("-1N","");1a 1b=(t=e.2o("-"))[1].2o("1b"),d=0;2===1b.1f?d=ZC.1k(1b[1]):3===1b.1f&&(d=ZC.1k(1b[2]));1a f,g=t[0].1F(/1b/g,"-"),B=a.BK(g);1l-1!==r.1L("-1P")?(l="1z-1P",f="18g"+t[1].1F("7J",""),i=B.BW[d]||B.W[d],"18c"===f&&(i=B.M.AP)):(l="1z-1R",f="18b"+t[1].1F("b4",""),i=B.E["wv"+d]||""),{1J:l,e1:f,g2:d,1z:g,1E:i,2H:B.o.2H||B.o.1P&&B.o.1P.2H?1:0,1H:{id:f,2Z:d,1E:i},ev:n}}},K1.5n.SC=1n(e,t){ZC.2E(1g.HU(),t),t.ev=ZC.A4.BX(t.ev),ZC.AO.C2("189"+e,1g.A,t)},K1.5n.S5=1n(e,t){ZC.2E(1g.HU(),t),t.ev=ZC.A4.BX(t.ev),ZC.AO.C2("186"+e,1g.A,t)},K1.5n.OJ=1n(e){1a t,i,a=1g;if("3b"==1y e){1a n={},l=e.2o(":");if(2===l.1f){n.1J=l[0];1j(1a r=0,o=(l=l[1].2o(/\\s|,|;/)).1f;r<o;r++){1a s=l[r].2o("=");n[s[0]]=s[1]}}e=n}1a C=[-1,-1];1Q(a.E.El=!0,e.1J){1i"1z":1a A,Z,c,p="",u=-1,h=1c;if(1c!==ZC.1d(t=e.8D)&&(p=t),1c!==ZC.1d(t=e.2Z)&&(u=ZC.1k(t)),1c!==ZC.1d(t=e[ZC.1b[9]])&&(h=ZC.1k(t)),i=1c,""===p&&(p=ZC.1b[50]),i=a.BK(p))1Q(i.H0&&-1!==u?c=i.H0(u):i.AX&&(1c!==ZC.1d(h)?c=i.AX(h):-1!==u&&(c=i.AX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[o]["1O"])||1c===ZC.1d(C[o].id)||l.1h(C[o].id)}1l l;1i"wb":1i"wc":1a K={x:"iX",y:"iY",1s:"I",1M:"F",1r:"C0",iS:"B7",cr:"AZ",eJ:"BU",eK:"AQ",eI:"A0",eF:"AC",2e:"AH",1J:"DN",1E:"AP",6M:"DG",6I:"KU",w6:"EP",jN:"BJ",jX:"BC"};if(a=g.C7(i[ZC.1b[3]]),n=i.1J||"1H","wb"===t&&"1H"!==n||"wc"===t&&"2S"!==n)1l 1c;if(e=i.id||"",a&&""!==e){1b=[],"1H"===n?1b=a.BW:"2S"===n&&(1b=a.FG);1a D=1c;1j(o=0,s=1b.1f;o<s;o++)1b[o].H3===e&&(D=1b[o]);if(D){1a F={};if("2S"===n){if(D.M)1j(h in F.1H={},K)F.1H[h]=D.M[K[h]];D.BE&&(D=D.BE)}1j(h in K)F[h]=D[K[h]];1l F}}1l 1c;1i"17U":1o.dJ="5j",i.4D&&"7N"===i.4D&&(1o.dJ="7N");1p;1i"17T":ZC.bE=!1,i.4D&&"2L"===i.4D&&(ZC.bE=!0)}1l 1c},K1.5n.p7=1n(){1a e,t,i=1g,a=0;1j(e=0,t=i.BL.1f;e<t;e++)"k"===i.BL[e].AF&&i.o[i.BL[e].BD]&&i.o[i.BL[e].BD][ZC.1b[5]]&&(a=ZC.BN(a,i.o[i.BL[e].BD][ZC.1b[5]].1f));1j(e=0,t=i.AY.A7.1f;e<t;e++)1c!==ZC.1d(i.o[ZC.1b[11]][e])&&i.o[ZC.1b[11]][e][ZC.1b[5]]&&(a=ZC.BN(a,i.o[ZC.1b[11]][e][ZC.1b[5]].1f));1l a},K1.5n.UK=1n(){1a e,t=1g;if(t.HP)1j(1a i=t.p7(),a=0,n=t.BL.1f;a<n;a++)"k"===t.BL[a].AF&&(t.BL[a].D8?(e=(t.BL[a].F-t.BL[a].A6-t.BL[a].BV)/ZC.1k(t.HP["1X-9X"]),t.BL[a].OT=ZC.BN(0,t.BL[a].F-i*e)):(e=(t.BL[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"js"===hT){1a E4=s.HP.3R;ZC.ga[s.K]=2u.5E(1n(){if(1===s.MH[0]||1===s.MH[1])if(s.A.MP(s),"7h"===hT){1a F8=["gs-3b"===s.A.N6?"go="+1A.cX():"",1o.iq?"k1="+s.H.AB:""].2M("&");ZC.A4.ao({1J:"bY",3R:E4,eg:1n(e){s.A.S7.1U||"7h-g9"!==s.A.N6||e.cV(ZC.1b[45],"cU, 8B cT dN 6P:6P:6P dM")},1U:F8,pn:"1E",4L:1n(){},aB:1n(e){jc(e)}})}1u if("()"===E4.2x(E4.1f-2)||"7s:"===E4.2x(0,11))4M{1a EG=E4.1F("7s:","").1F("()","");7t(EG)&&7t(EG).4v(s,1n(e){jc(e)},s.HU())}4K(e){}},P1)}1u"hR"===hT&&ZC.hR&&(s.H.SM[s.K]?"jd"===s.HP.9T&&(ZC.ga[s.K]=2u.5E(1n(){s.H.SM[s.K].8t("1o.hP")},P1)):(ws=1m pq(s.HP.3R,"1o"),ws.Gu=1n(){ws.8t("1o."+s.HP.1J),ws.8t("1o."+s.HP.9T),ws.8t("1o.qF"),"jd"===s.HP.9T&&ws.8t("1o.hP")},ws.Gs=1n(e){1!==s.MH[0]&&1!==s.MH[1]||jc(e.1U)},s.H.SM[s.K]=ws))}}},1o.pu=1n(e,t,i){1a a;2g.cO("zc-5O")&&(e="zc-5O"),"3b"==1y(i=i||{})&&(i=3g.1q(i));1a n=1o.7d(e);if(n){1a l=n.C7(i[ZC.1b[3]]);1Q(t){1i"181":l.MH[1]=1,0===l.MH[0]&&ZC.cP(1n(){l.1q(),l.3j(!0),l.UK(),l.1t(!0,!0)});1p;1i"17M":1l l.HP.dL;1i"188":ZC.AO.C2("18a",n,l.HU()),l.o.cR=l.o.cR||{},l.o.cR.dL=i.dL||1;1p;1i"jb":1===l.MH[0]&&(ZC.AO.C2("17J",n,l.HU()),l.MH[0]=0,1c!==ZC.1d(a=n.SM[l.K])&&a.8t("1o.jb"));1p;1i"qF":0===l.MH[0]&&(ZC.AO.C2("17g",n,l.HU()),l.MH[0]=1,1c!==ZC.1d(a=n.SM[l.K])&&a.8t("1o.qF"),ZC.cP(1n(){l.1q(),l.3j(!0),l.UK(),l.1t(!0,!0)}))}}1l 1c},ZC.AO.qJ=1n(e){1j(1a t={},i=[],a=0,n=(i="4j"==1y e?e:3g.1q(e)).1f;a<n;a++)if(1c!==ZC.1d(e=i[a])){t["p"+a]={};1a l=[];if("4j"==1y e)l=e;1u if("3b"==1y e&&/\\d+\\-\\d+/.5Y(e)){1a r=e.2o("-");if(2===r.1f){l=[];1j(1a o=ZC.1k(r[0]);o<=ZC.1k(r[1]);o++)l.1h(o)}}1u l=[e];1j(1a s=0,C=l.1f;s<C;s++)t["p"+a]["n"+l[s]]=!0}1l t},K1.5n.qG=1n(){1a e,t=1g;1c!==ZC.1d(e=t.o.aX)&&(t.CV=ZC.AO.qJ(e),t.o.aX=1c)},1o.qH=1n(e,t,i){1a a,n,l,r,o,s,C,A,Z;2g.cO("zc-5O")&&(e="zc-5O"),"3b"==1y(i=i||{})&&(i=3g.1q(i));1a c=1o.7d(e);if(c)1Q(t){1i"17i":if(n=c.C7(i[ZC.1b[3]])){1j(n.CV={},l=0,r=n.AY.A7.1f;l<r;l++)n.K5[l]=!1;n.HH=!0,n.gf(),n.JS(!0,!0)}1p;1i"17j":if(n=c.C7(i[ZC.1b[3]])){1j(s=[],l=0,r=n.AY.A7.1f;l<r;l++)if(s[l]=1c,1c!==ZC.1d(n.CV["p"+l])){1a p=[];1j(C in n.CV["p"+l])n.CV["p"+l].8d(C)&&n.CV["p"+l][C]&&p.1h(ZC.1k(C.1F("n","")));s[l]=p}1l s}1l{};1i"17k":1a u={};s=[],1c!==ZC.1d(a=i.aX)&&(u=ZC.AO.qJ(a)),(n=c.C7(i[ZC.1b[3]]))&&(n.CV=u,n.HH=!0,n.gf(),n.JS(!0,!0));1p;1i"9Z":1i"qO":1a h=[],1b=1n(e){1a i=!1;1c!==ZC.1d(a=e.a2)&&(i=ZC.2t(a));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1m DR(n);1j(i=n.H.2Q()?n.H.mc():ZC.AK(n.K+"-4k-bl-c"),a=ZC.P.E5(i,n.H.AB),e=0;e<l;e++){1a o=[],s=n.CG.X2[e][1],C=(t=n.CG.g7[s]).D.1f;if(C>0){1j(1a A=0;A<C;A++)o.1h(t.D[A].E8);o.1h(t.D[0].E8),r.7l(n),r.K=n.K+"-17f-"+(""!==t.K?t.K:ZC.c6++),r.1S(t.N),r.CW=!1,r.Z=i,r.9v(1),r.D=o,r.DN="4z",r.9v(2),r.1t()}}1a Z=[];1j(1a c in n.CG.SS)Z.1h([c,n.CG.SS[c].9K]);Z.3Z(1n(e,t){1l t[1]-e[1]});1j(1a p=0;p<Z.1f;p++){1a u=n.CG.SS[Z[p][0]];ZC.CM.2I(a,u.1I),ZC.CM.1t(a,u.1I,u.2W)}},K1.5n.TH=1n(){if(!1o.4F.ez){1a e,t=1g;if(t.BB){if(t.BB.SF&&t.L!==t.A.AI.1f-1&&!t.BB.o.d9)1l;t.BB.Z=t.BB.C6=t.H.2Q()?t.H.mc("1v"):ZC.AK(t.K+"-1W-c"),t.BB.1t(),-1===ZC.AT(t.H.KX,ZC.1b[41])&&(t.R3=1n(e){1a i,a;if(!ZC.3o){t.A8&&t.A.A8&&t.A8.AM&&t.A.A8.g4(e);1a n=e.9N||e.2X.id,l=ZC.1k(n.1F(t.K,"").1F("-1W-7J","").1F("-1W-b4","").1F("-1N","").1F("-1R","")),r=t.AY.A7[l];if(r.FX&&(t.BB.X1||r.I8)&&r.S.1f)1j(i=0,a=r.S.1f;i<a;i++)1c!==r.S[i]&&r.S[i].JF&&r.FQ(i).HT("5U");ZC.3o=!0;1a o=ZC.AT(t.AY.LW,l);t.BB.en(o),ZC.3o=!1;1a s=t.AY.A7[l].TC(e);t.E["1W-8f-2Z"]=l,ZC.AO.C2("190",t.A,s)}},t.PX=1n(e){ZC.3o||t.A8&&t.A.A8&&t.A8.AM&&t.A.A8.hd(e)},t.RG=1n(e){if(!ZC.3o){t.A8&&t.A.A8&&t.A8.AM&&t.A.A8.g3(e),t.L7(),ZC.3o=!0,t.BB.en(-1),ZC.3o=!1;1a i=ZC.7Q(t.E["1W-8f-2Z"],0),a=t.AY.A7[i].TC(e);ZC.AO.C2("18N",t.A,a)}},t.9m=1n(e){t.BB.DC&&"1Z-y"===t.BB.DC.AF&&(e.6S(),t.BB.DC.Fy(e))},t.SZ=1n(i){if(t.E.r0=!0,!(ZC.3o||(1o.SN(i),i.9g>1))){1a a,n,l,r=i.9N||i.2X.id,o=ZC.2t(t.BB.BQ.o.r6);ZC.2K&&t.H.A8&&t.H.A8.5d();1a s="1P";-1!==r.1L("-1W-b4")&&(s="1R"),t.L7(),i.6S();1a C=t.BB.IK;"1P"===s?C=t.BB.RA:"1R"===s&&(C=t.BB.Q2),t.A.KC&&(C="3r"),t.E["1W-7S-7W"]=s;1a A=ZC.1k(r.1F(t.K+"-1W-7J","").1F(t.K+"-1W-b4","").1F("-1N",""));if(t.o[ZC.1b[11]]&&t.o[ZC.1b[11]][A]){if(1c!==ZC.1d(e=t.o[ZC.1b[11]][A]["1W-1P"])){1a Z=e.3R||"",c=e.2X||"";""!==Z&&t.TZ(i,Z,c)}t.o[ZC.1b[11]][A].2h=!0}1a p,u,h,1b=t.AY.A7[A].TC(i);1Q(1b.2h=ZC.2t(t.E["1B"+A+".2h"]),ZC.AO.C2("18B"+s+"18C",t.A,1b),C){2q:1p;1i"5d":1i"3r":if(i.Er){1a d=0;1j(a=0,n=t.AY.A7.1f;a<n;a++)if(a!==A&&(l=++d===n-1,t.PC({"bx-1W":o,JS:l,3W:a,"a2-8f":C}),t.BB.SF))1j(p=0,u=t.H.AI.1f;p<u;p++)(h=t.H.AI[p]).BB&&h.BB.SF&&h.BB.fY===t.BB.fY&&h.K!==t.K&&h.PC({"bx-1W":!0,JS:l,3W:a,"a2-8f":C})}1u if(t.PC({"bx-1W":o,JS:1,3W:A,"a2-8f":C}),t.BB.SF)1j(p=0,u=t.H.AI.1f;p<u;p++)(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=e.K+"-1z-v",a.BD="1z-r",a.K=e.K+"-1z-r",e.BL.1h(t,i,a),1D.NY()}qj(){-1!==ZC.AT(["2F","3L"],1g.H.AB)&&ZC.A4("#"+1g.K+" .zc-6q").5f(1n(){/\\-1B-\\d+\\-bl\\-\\d+\\-/.5Y(1g.id)&&ZC.A4(1g).9x().5f(1n(){/\\-8W\\-2R/.5Y(1g.id)&&ZC.P.ER(1g)})})}}1O Ea 2j K1{2G(e){1D(e);1a t=1g;t.AF="8Z",t.AY=1m zL(t)}NL(){1l""}F7(e){1Q(e){1i"m":1l 1m YJ(1g)}}NY(){1a e=1g,t=e.F7("m","1z");t.BD="1z",t.K=e.K+"-1z",e.BL.1h(t),1D.NY()}}1O Eb 2j K1{2G(e){1D(e);1a t=1g;if(t.AF="7j",t.AJ.3y="7j",t.AY=1m zR(t),-1!==ZC.AT(t.A.K,"q4")){1j(1a i=1,a=0;a<t.A.MF.eA.1f;a++)i=ZC.BN(i,t.A.MF.eA[a][ZC.1b[5]].1f);i=1A.46(2m/i).ac(),1c===ZC.1d(t.A.MF.1B)?t.A.MF.1B={77:"1N"}:ZC.2E({77:"1N"},t.A.MF.1B),1c===ZC.1d(t.A.MF["1z-k"])?t.A.MF["1z-k"]={77:"3A",5D:"%v\\Fj",6p:"0:Gk:"+i}:ZC.2E({77:"3A",5D:"%v\\Fj",6p:"0:Gk:"+i},t.A.MF["1z-k"],!0)}}NL(){1l""}F7(e){1a t=1g;1Q(e){1i"m":1l 1m YJ(t);1i"k":1l 1m vx(t);1i"v":1l 1m w4(t)}}NY(){1a e=1g,t=e.F7("k","1z-k");t.BD="1z-k",t.K=e.K+"-1z-k",e.BL.1h(t);1a i=e.F7("v",ZC.1b[52]);i.BD=ZC.1b[52],i.K=e.K+"-1z-v",e.BL.1h(i);1a a=e.F7("m","1z");a.BD="1z",a.K=e.K+"-1z",e.BL.1h(a),1D.NY()}}1O Gm 2j ln{2G(e){1D(e);1a t=1g;t.AF="8m",t.AY=1m zQ(t),t.AJ[ZC.1b[55]]=!1}}1O Gr 2j l2{2G(e){1D(e);1a t=1g;t.AF="8h",t.AJ.3y="yx",t.AY=1m zP(t),t.AJ[ZC.1b[55]]=!1}}1O Gt 2j NO{2G(e){1D(e);1a t=1g;t.AF="5N",t.AY=1m zO(t),t.AJ[ZC.1b[55]]=!1,t.AJ["4S-1Z"]=!0}UQ(e){1a t=1g;if("v"===e){1a i=[];if(t.o[ZC.1b[11]]&&t.o[ZC.1b[11]].1f)1j(1a a=0;a<t.o[ZC.1b[11]].1f;a++)i.1h(t.o[ZC.1b[11]][a].1E||"15H "+(a+1));1l i}}F7(e){1Q(e){1i"x":1a t=1m TI(1g);1l t.DJ=!0,t;1i"y":1a i=1m T9(1g);1l i.DJ=!0,i.1C({7i:1,"7o-7i":!0}),i}}}1O Gg 2j NO{2G(e){1D(e);1a t=1g;t.AF="au",t.AY=1m Dh(t),t.AJ[ZC.1b[55]]=!1,t.AJ["4S-cl"]=!1,t.AJ["4S-1Z"]=!1}F7(e,t){1Q(e){1i"x":1a i=1D.F7(e,t);1l i.DJ=!0,i;1i"y":1a a=1D.F7(e,t);1l a.DJ=!0,a}}UQ(e){if("v"===e){1j(1a t=[],i=0;i<1g.o[ZC.1b[11]].1f;i++)t.1h("Fp "+(i+1));1l t}}1t(){1j(1a e=1g,t=0,i=e.BL.1f;t<i;t++)"v"===e.BL[t].AF&&(e.BL[t].AR=!e.BL[t].AR);1D.1t()}}1O Fo 2j NO{2G(e){1D(e);1a t=1g;t.AF="af",t.AY=1m zN(t),t.AJ[ZC.1b[55]]=!1,t.AJ["4S-cl"]=!1,t.AJ["4S-1Z"]=!1}UQ(e){if("v"===e){1j(1a t=[],i=0;i<1g.o[ZC.1b[11]].1f;i++)t.1h("Fp "+(i+1));1l t}}F7(e){1Q(e){1i"x":1a t=1m VD(1g);1l t.DJ=!0,t;1i"y":1a i=1m VG(1g);1l i.DJ=!0,i}}}1O Fq 2j NO{2G(e){1D(e);1a t=1g;t.AF="7Y",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a r=!1;!r;)1j(r=!0,t=0,i=n.1f;t<i-1;t++){if(n[t]["z-2Z"]>n[t+1]["z-2Z"]){a.E["1B-3Z"]=!0;1a o=n[t];n[t]=n[t+1],n[t+1]=o;1a s=l[t];l[t]=l[t+1],l[t+1]=s,r=!1}}a.LW=l}1u a.LW=[0];1j(a.A7=[],t=0,i=a.o.1f;t<i;t++){1a C="";a.A.o.1B&&1c!==ZC.1d(e=a.A.o.1B.1J)&&(C=e),1c!==ZC.1d(e=a.o[t].1J)&&(C=e);1a A=a.HJ(C,t);A.OL=A.AF+"1B",A.L=t,A.JR=t,a.C.A.B9.2w(A.o,["("+A.AF+").1B"]),A.ey&&a.C.A.B9.2w(A.o,["("+A.ey+").1B"]),a.C.A.B9.2w(A.o,["("+A.AF+").1B.8y"]),1c!==ZC.1d(e=a.A.o.1B)&&A.1C(e),A.1C(a.o[t]),A.CB=a.A.CB,A.1q(),a.A7.1h(A)}1a Z={},c=[],p=[],u={},h={},1b=0,d=0;1j(t=0,i=a.A7.1f;t<i;t++)if(1c!==ZC.1d(a.A.A.E["g-"+a.A.L+"-p-"+t+".2h"])&&(a.C.E["1B"+t+".2h"]=a.A.A.E["g-"+a.A.L+"-p-"+t+".2h"]),!a.A7[t].J3&&(a.C.E["1B"+t+".2h"]||"5d"===a.C.7T())){a.A7[t].CB?(-1===(d=ZC.AT(p,a.A7[t].DV))&&(p.1h(a.A7[t].DV),d=p.1f-1),1c===ZC.1d(c[d])?c[d]=[t]:c[d].1h(t)):(p.1h(-1),d=p.1f-1,1c===ZC.1d(c[d])?c[d]=[t]:c[d].1h(t));1a f=a.A7[t].AF;if(a.A7[t].o.1J&&f!==a.A7[t].o.1J){1a g=f.1L("3d"),B=a.A7[t].o.1J.1L("3d");(-1===g&&-1!==B||-1===g&&-1===B)&&(f=a.A7[t].o.1J)}-1!==ZC.AT(["2V","ek","fO"],f)&&(f="v"+f),-1===ZC.AT(["5x","6b","8m","8h","7Y","6U","7z"],f)||a.A7[t].J3||(1c===ZC.1d(u[f])&&(u[f]=[]),1c===ZC.1d(h[f])&&(h[f]=[]),a.A7[t].CB?(1c===ZC.1d(Z[a.A7[t].DV])?Z[a.A7[t].DV]=1:Z[a.A7[t].DV]++,-1===(1b=ZC.AT(h[f],a.A7[t].DV))&&(h[f].1h(a.A7[t].DV),1b=h[f].1f-1),1c===ZC.1d(u[f][1b])?u[f][1b]=[t]:u[f][1b].1h(t)):(h[f].1h(-1),1b=h[f].1f-1,1c===ZC.1d(u[f][1b])?u[f][1b]=[t]:u[f][1b].1h(t)))}if(a.KF=c,a.K6=u,a.XB)1j(1a v in a.XB)a.XB[v].3Z();1j(a.kU=[],t=0;t<a.KF.1f;t++)a.kU.1h(a.KF[t][a.KF[t].1f-1])}1t(){1a e=1g;1n t(i){1a a=e.LW[i];(e.A7[a].IH||e.A7[a].E3.1f&&e.A.BI||"2b"!==e.A7[a].J2)&&(e.H.OD=!1),e.lu=!0;1a n=e.C.7T();e.C.AJ["3d"]?e.C.E["1B"+a+".2h"]&&(e.A7[a].1t(),e.H.XX()):(e.C.E["1B"+a+".2h"]||"5d"===n)&&(1y e.C.E["1B-"+a+"-gB-nV"]!==ZC.1b[31]&&(e.A7[a].U4=0),e.A7[a].1t(),e.A7[a].U4=0,e.H.XX(),e.C.E["1B"+a+".2h"]||"5d"!==n||(e.C.E["1B"+a+".2h"]=!0,e.A.PC({3W:a,"bx-1W":!0}))),e.C.E["1B-"+a+"-gB-nV"]=!1,i<e.A7.1f-1?e.C.LT?ZC.qx[e.C.K]=2u.5E(1n(){t(i+1)},10):e.A7.1f<=100&&t(i+1):(!e.C.LT||e.C.LT&&e.lu)&&e.fI()}if(e.HQ=[],e.A7.1f>0)if(e.A7.1f>100&&!e.C.LT)1j(1a i=0;i<e.A7.1f;i++)t(i);1u t(0);1u e.fI()}fI(){1a e,t=1g;t.S9=1c,t.W2=1c;1j(1a i=0;i<t.C.BL.1f;i++)t.C.BL[i].EQ=1c,t.C.BL[i].X0=1c;1n a(e){1a i=0,a=e.1L(ZC.1b[35]),n=e.1L("-2r-",a);1l-1!==a&&-1!==n&&(i=e.5w(a+14,n-a-14)),1y t.A7[i].E["z-9I"]!==ZC.1b[31]?t.A7[i].E["z-9I"]:i}(e=ZC.AK(t.C.A.K+"-3e"))&&!t.H.es&&(-1===ZC.AT(["5g","6A","8m","8h","7j","6U","7z","9z","aZ","7a","h7","15t"],t.C.AF)&&1!==1o.qs||t.HQ.3Z(1n(e,i){1l"7a"===t.C.AF?ZC.AO.N5(e)>ZC.AO.N5(i)?1:ZC.AO.N5(e)<ZC.AO.N5(i)?-1:0:a(e)>a(i)&&t.A.AJ["3d"]?1:a(e)<a(i)&&t.A.AJ["3d"]?-1:ZC.AO.N5(e)>ZC.AO.N5(i)?1:ZC.AO.N5(e)<ZC.AO.N5(i)?-1:0}),1o.3J.zI?2u.5E(1n(){e.4o+=t.HQ.2M("")},mt):e.4o+=t.HQ.2M("")),t.EZ=1c,t.D3=1c,t.C.zz=[],t.A.fI()}}1O nH 2j LR{HJ(){1l 1m R5(1g)}}1O nI 2j LR{HJ(){1l 1m QV(1g)}}1O zJ 2j LR{HJ(){1a e=1m R5(1g);1l e.OZ=!0,e}}1O zU 2j LR{HJ(){1a e=1m QV(1g);1l e.OZ=!0,e}}1O la 2j LR{HJ(){1l 1m R1(1g)}}1O l9 2j LR{HJ(){1l 1m R6(1g)}}1O ZT 2j LR{HJ(e){1a t=1g;1Q(e){2q:1l 1m R5(t);1i"bR":1a i=1m R5(t);1l i.OZ=!0,i;1i"4z":1a a=1m PJ(t);1l a.kR=!0,a.ey="4z",a;1i"1N":1l 1m QV(t);1i"bQ":1a n=1m QV(t);1l n.OZ=!0,n;1i"2V":1i"5x":1l 1m R1(t);1i"6b":1l 1m R6(t);1i"6v":1l 1m PJ(t);1i"8p":1l 1m PJ(t,"8p");1i"5g":1l 1m S4(t);1i"6A":1l 1m S4(t,"6A");1i"7Y":1l 1m VU(t);1i"5A":1l 1m UH(t);1i"92":1l 1m V2(t);1i"88":1l 1m UW(t);1i"ek":1i"6U":1l 1m UZ(t);1i"fO":1i"8m":1l 1m TQ(t);1i"8h":1l 1m TT(t)}}}1O A3 2j LR{HJ(){1l 1m PJ(1g)}}1O 15v 2j LR{HJ(){1a e=1m PJ(1g);1l e.kR=!0,e.ey="4z",e}}1O zY 2j LR{HJ(){1l 1m PJ(1g,"8p")}}1O zX 2j LR{HJ(){1l 1m S4(1g)}}1O zW 2j LR{HJ(){1l 1m S4(1g,"6A")}}1O nD 2j LR{2G(e){1D(e);1a t=1g;t.KN=[],t.PH=[],t.U7=[]}HJ(){1l 1m WQ(1g)}l3(e){1a t,i,a,n,l=1g;e&&(l.U7=[],l.PH=[]);1a r,o=l.A.BK("1z-r"),s=l.A.BK("1z"),C=.9,A=1;l.A7.1f>=10&&(A=1),l.A7.1f>=20&&(A=1.25),l.A7.1f>=30&&(A=1.5);1a Z=o.DK;1j(t=0,i=l.A7.1f;t<i;t++)1c!==ZC.1d(l.A7[t].o["3Q-2f"])&&(Z=l.A7[t].DK);1j(t=0,i=l.A7.1f;t<i;t++)if(l.C.E["1B"+t+".2h"]||"5d"===l.C.7T())1j(1a c=0,p=l.A7[t].S.1f;c<p;c++)if(l.A7[t].S[c]){l.YO["n"+c]=l.YO["n"+c]||[];1a u,h,1b=l.A7[t].S[c];1c===ZC.1d(l.PH[c])&&(l.PH[c]=Z),u=1c!==ZC.1d(n=l.A7[t].o[ZC.1b[1]])?ZC.1Y(n):l.PH[c],h=l.KN[c],1c!==ZC.1d(l.A7[t].o.gE)&&1c!==ZC.1d(l.A7[t].o.gE[c])&&(h=l.KN[c]=ZC.1Y(l.A7[t].o.gE[c])),a=0===h?u+o.EL*(1/i):0===1b.AE&&l.A7[t].UC?u+o.EL*(.sL*l.KN[c])/h:u+o.EL*1b.AE/h,l.PH[c]=a,1b.B2=u,1b.BH=a;1a d=1b.FJ(!0);if("4R"===d.o[ZC.1b[7]]&&d.AM){1a f=ZC.1k((u+a)/2);l.YO["n"+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r=(B[0][i]*B[0][i]-B[1][i]*B[1][i]+B[2][i]*B[2][i])/(2*B[0][i]),v[e][i]=v[0][i]+r,o=1A.5y(B[2][i]*B[2][i]-r*r),E[e][i]=E[0][i]-o,3===u&&(g=(v[0][i]-d-(Z.GI-(v[1][i]+f)))/2,A.A7[0].S[i].iX-=g,A.A7[1].S[i].iX-=g,A.DW[0][i].x-=g,A.DW[1][i].x-=g,A.O0[i][0][0]-=g,v[2][i]-=g)),C[i].iX=v[e][i]+Z.iX,C[i].iY=E[e][i],C[i].I=h*1A.5y(C[i].AE/1A.PI),C[i].F=h*1A.5y(C[i].AE/1A.PI),C[i].AH=h*1A.5y(C[i].AE/1A.PI),1c===ZC.1d(m)&&(m=C[i].AE/(1A.PI*C[i].AH*C[i].AH));1a K=h*1A.5y(C[i].AE/1A.PI),D=h*1A.5y(C[i].X7/1A.PI),F=K+D-B[e][i],I=(2*F*D-F*F)/(2*(K+D-F)),X=F-I;if(A.DW[e][i]={x:v[e][i],y:E[e][i],sz:C[i].AH,r1:K,r2:D,eo:X,ep:I},0===e?(o=1A.5y(K*K-(K-I)*(K-I)),A.O0[i].1h([v[0][i]+K-I,E[0][i]-o])):2===e&&(K=A.DW[1][i].r1,D=A.DW[1][i].r2,X=A.DW[1][i].eo,I=A.DW[1][i].ep,l=ZC.U6(1A.nP((E[1][i]-E[2][i])/B[1][i]))-ZC.U6(1A.l7((K-I)/K)),A.O0[i].1h([v[1][i]-K*ZC.EE(l)-g,E[1][i]-K*ZC.EK(l)]),K=A.DW[2][i].r1,D=A.DW[2][i].r2,X=A.DW[2][i].eo,I=A.DW[2][i].ep,l=ZC.U6(1A.nP((E[0][i]-E[2][i])/B[2][i]))-ZC.U6(1A.l7((D-X)/D)),A.O0[i].1h([v[0][i]+D*ZC.EE(l)-g,E[0][i]-D*ZC.EK(l)])),e===u-1)if(3===u){if(1c!==ZC.1d(A.A7[0].j4[i]))A.XV[i].1N=A.A7[0].j4[i];1u{1a x=[-1],y=[-1];x[1]=1b(A.O0[i][0],A.O0[i][2]),x[2]=1b(A.O0[i][0],A.O0[i][1]),x[3]=1b(A.O0[i][2],A.O0[i][1]),y[1]=A.DW[0][i].sz,y[2]=A.DW[1][i].sz,y[3]=A.DW[2][i].sz;1a Y=.25*1A.5y((x[1]+x[2]+x[3])*(x[1]+x[2]-x[3])*(x[1]+x[3]-x[2])*(x[2]+x[3]-x[1]));1j(s=1;s<=3;s++)Y+=y[s]*y[s]*1A.nP(x[s]/(2*y[s]))-x[s]/4*1A.5y(4*y[s]*y[s]-x[s]*x[s]);A.XV[i].1N=m*Y}A.DW[0][i].fK=ZC.AN.gY(A.DW[0][i].x,A.DW[0][i].y,A.DW[1][i].x,A.DW[1][i].y,A.DW[0][i].r1-(A.DW[0][i].eo+A.DW[0][i].ep)/2),A.DW[1][i].fK=ZC.AN.gY(A.DW[1][i].x,A.DW[1][i].y,A.DW[2][i].x,A.DW[2][i].y,-(A.DW[1][i].r1-(A.DW[1][i].eo+A.DW[1][i].ep)/2)),A.DW[2][i].fK=ZC.AN.gY(A.DW[2][i].x,A.DW[2][i].y,A.DW[0][i].x,A.DW[0][i].y,-(A.DW[2][i].r1-(A.DW[2][i].eo+A.DW[2][i].ep)/2)),A.XV[i].xy=[(A.O0[i][0][0]+A.O0[i][1][0]+A.O0[i][2][0])/3,(A.O0[i][0][1]+A.O0[i][1][1]+A.O0[i][2][1])/3]}1u A.DW[0][i].fK=ZC.AN.gY(A.DW[0][i].x,A.DW[0][i].y,A.DW[1][i].x,A.DW[1][i].y,A.DW[0][i].r1-(A.DW[0][i].eo+A.DW[0][i].ep)/2),A.DW[1][i].fK=[-6H,-6H]}if(3===u)1j(e=0,t=u;e<t;e++)1j(n=ZC.AO.P5(A.A7[e].o[ZC.1b[17]],A.A7[e].o),1c!==ZC.1d(n[ZC.1b[12]])&&-1!==n[ZC.1b[12]]||(n[ZC.1b[12]]=0),i=0,a=A.A7[e].S.1f;i<a;i++)A.XV[i].1N=ZC.AO.GN(A.XV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.GM[t].o={1V:i.W[e]},"3b"==1y i.W[e]&&(i.GM[t].gK=!0),i.GM[t].L=e,"1w"!==i.AF&&"1N"!==i.AF&&"bR"!==i.AF&&"bQ"!==i.AF||i.U?i.GM[t].1q():1c===i.S[e].BY&&1y i.C.E["1B-"+i.L+"-gB-nV"]===ZC.1b[31]||i.GM[t].1q(),"1w"===i.AF||"1N"===i.AF||"bR"===i.AF||"bQ"===i.AF?"xy"===i.C.AJ.3y?(1c!==i.S[e].BY?i.GM[t].iX=i.S[e].iX=i.B1.AX(i.S[e].BY):i.GM[t].iX=i.S[e].iX=i.B1.H0(e),i.CB&&"100%"===i.KW?i.GM[t].iY=i.S[e].iY=i.CH.AX(100*i.S[e].CL/i.A.F5[e]["%6n-"+i.DV]):i.GM[t].iY=i.S[e].iY=i.CH.AX(i.S[e].CL)):(1c!==i.S[e].BY?i.GM[t].iY=i.S[e].iY=i.B1.AX(i.S[e].BY):i.GM[t].iY=i.S[e].iY=i.B1.H0(e),i.CB&&"100%"===i.KW?i.GM[t].iX=i.S[e].iX=i.CH.AX(100*i.S[e].CL/i.A.F5[e]["%6n-"+i.DV]):i.GM[t].iX=i.S[e].iX=i.CH.AX(i.S[e].CL)):i.GM[t].RX(),i.GM[t].JF=i.S[e].JF,i.GM[t]):1c}TD(e,t){1a i=1g;i.K7[e]||(i.K7[e]=[]),(!i.IT||i.IT&&-1===ZC.AT(i.K7[e],t))&&i.K7[e].1h(t)}FY(){1l 1m MG(1g)}o0(){1l{}}NF(){1l 1g.YS("6W","lo","i"),1g.C.A.B9.nW(-1!==1g.lo?1g.lo:1g.L,1g.C.AF)}N7(){1a e=1g;if(e.BO[4]){1a t,i={};1j(1a a in e.BO[4])-1===(t=a.1L("."))?1c===ZC.1d(e.o[a])&&(i[a]=!0,e.o[a]=e.BO[4][a]):a.2x(0,t)===e.AF&&(1c===ZC.1d(e.o[a.2x(t+1)])||i[a.2x(t+1)])&&(e.o[a.2x(t+1)]=e.BO[4][a])}}HV(e,t){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;i<n.BL.1f;i++)n.BL[i]=ZC.V8(ZC.GR(n.BL[i]));if(n.C.o.1W&&n.C.o.1W["5U-1B"]&&(n.I8=!0),1c!==ZC.1d(n.o.iG)&&1c===ZC.1d(n.o.5L)&&(n.o.5L=n.o.iG),1c!==ZC.1d(n.o["3I-1R"])&&1c===ZC.1d(n.o["aX-4D"])&&1c===ZC.1d(n.o["dq-1R"])&&(n.o["aX-4D"]="aC",n.o["dq-1R"]={},ZC.2E(n.o["3I-1R"],n.o["dq-1R"])),n.KW=n.C.KW,n.4C([["bx","J3","b"],["az","fu","b"],[ZC.1b[25],"SR","ia"],[ZC.1b[12],"DU","ia"],["1X-6k","HZ","i"],["2A","RU","b"],["nz","CB","b"],["7H-1J","KW"],["ni","RM","b"],["1E","AP"],["2H-1E","K3"],["1W-1E","nm"],["u7","ZA"],["7H","DV","i"],["z-2Z","JR","i"],["77","CS"],["4D","aT"],["16V","YE","f"],["1X-cZ","N0"],["1X-np","S6"],["gm-np","YD","b"],["dG-7i","Y9","i"],["1Z-7i-iG","YV","i"],["3R","E4"],["2X","FE"],[ZC.1b[14],"SB"],[ZC.1b[13],"RL"],["5L","fr","b"],["8c","fj"],["5L-dv","U5"],["8u-an","tw","b"],["Ci","SD"],["av","T8"],["zh","QM","b"],["5U","I8","b"],["5U-1W","LG","b"],["2N-4D","li"],["9I-fZ","VF","b"],["17b","LY","b"],["z5-2Z","RB","i"],["z5-2a","RW","i"],["zd","GB","b"],["z8","LI","i"],["nY","JG","f"],["aX-4D","J2"],["6d-16E","RR","b"],["1T-4D","OC"],["16b-6p","Z4","ia"]]),n.oK=n.RM,!n.E["za-1q"]){1a l;if(ZC.6x(n.T8),n.I8&&(1c===ZC.1d(n.C.o.1W)||1c===ZC.1d(n.C.o.1W["5U-1W"]))&&ZC.1d(1c===n.o["5U-1W"])&&(n.LG=n.I8),1c!==ZC.1d(e=n.o.8y))n.GB=!0,1c!==ZC.1d(t=e.z8)&&(0===(t+"").1L("lG")&&1c!==ZC.1d(l=ZC.b5[(t+"").2x(10)])&&(t=l),n.LI=ZC.1k(t),0===n.LI&&(n.GB=!1)),1c!==ZC.1d(t=e.nY)&&(0===(t+"").1L("lG")&&1c!==ZC.1d(l=ZC.b5[(t+"").2x(10)])&&(t=l),n.JG=ZC.1Y(t)),1c!==ZC.1d(t=e.z6)&&(n.LB=ZC.1Y(t)),1c!==ZC.1d(t=e.9T)&&(0===(t+"").1L("lG")&&1c!==ZC.1d(l=ZC.b5[(t+"").2x(10)])&&(t=l),n.LE=ZC.1k(t)),1c!==ZC.1d(t=e.16j)&&(0===(t+"").1L("lG")&&1c!==ZC.1d(l=ZC.b5[(t+"").2x(10)])&&(t=l),n.U4=ZC.1k(t)),1c!==ZC.1d(t=e.16k)&&(n.FU=t);1j(1a r in n.JG<10&&(n.JG*=5I),n.LB<10&&(n.LB*=5I),1y PN!==ZC.1b[31]&&(n.JG=ZC.BN(PN.UG,n.JG)),("8u"===n.aT||1y PN===ZC.1b[31]||1o.4F.b5)&&(n.GB=!1),n.H.es&&(n.GB=!1),-1!==ZC.AT(["1w","1N","5x","6b","7Y","6v","5g","7j","5N"],n.AF)&&("8u"===n.aT?n.IT=!0:"5j"===n.aT||n.GB||-1!==3g.5b(n.o).1L(\'"an"\')||-1!==3g.5b(n.o).1L(\'"js-c8"\')||0!==n.T8.1f||-1!==n.H.E.4H.1L(\'"7f"\')||-1!==n.H.E.4H.1L(\'"Ci"\')||"2b"!==n.J2?n.IT=!1:n.IT=!0),n.o)if("1U-"===r.2x(0,5)){1a o=r.2x(5);n.LJ[o]=n.o[r]}1a s=n.H.B9;if(n.ID=1m CX(n),n.ID.1C(n.o),s.2w(n.ID.o,v(ZC.1b[71])),n.ID.1C(n.o[ZC.1b[71]]),1c!==ZC.1d(n.o[ZC.1b[71]])||"1w"!==n.AF&&"1N"!==n.AF||(n.ID.AM=!1),n.I8&&(n.SE=1m CX(n),s.2w(n.SE.o,v("5U-3X")),n.SE.1C(n.o),1c!==ZC.1d(e=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&(n.C.V1=1)))}if(n.B1=n.C.BK(n.BT("k")[0]),n.CH=n.C.BK(n.BT("v")[0]),1c!==ZC.1d(n.o[ZC.1b[5]])&&""!==n.AF){n.W=n.o[ZC.1b[5]];1a u=1c;n.QB=[ZC.3u,-ZC.3u];1a h=[],1b=[],d=0;1j(i=0,a=n.W.1f;i<a;i++){1a f=!1;if(n.o["C9-ts"]||(1c!==ZC.1d(n.W[i])&&"4j"==1y n.W[i]&&n.W[i].1f>1?(1c===ZC.1d(n.W[i][1])||"3b"==1y n.W[i][1]&&"gS"===n.W[i][1].5J())&&(f=!0):(1c===ZC.1d(n.W[i])||"3b"==1y n.W[i]&&"gS"===n.W[i].5J())&&(f=!0),"5N"===n.C.AF&&(f=!1)),f)n.S.1h(1c);1u{!n.IT||"xy"!==n.C.AJ.3y&&"yx"!==n.C.AJ.3y?c=n.FY():n.GM[1]||("5g"===n.AF||"6v"===n.AF?n.GM[1]=c=n.FY():(n.GM[0]=n.FY(),n.GM[1]=c=n.FY(),n.GM[2]=n.FY(),n.GM[3]=n.FY())),c.K=n.K+"-2r-"+i,"3b"==1y n.W[i]&&1o.Bu&&(n.W[i]=ZC.1Y(n.W[i])),c.o={1V:n.W[i]},"3b"==1y n.W[i]&&(c.gK=!0),c.L=i,n.o["C9-ts"]?(c.E.76=n.L,c.E.7y=c.L,c.K=n.K+"-2r-"+c.L,c.BY=n.W[i][0],c.AE=n.W[i][1]):c.1q(),(a<bK||1o.3J.oG)&&1c!==ZC.1d(c.AE)&&2===(Z=c.AE.ac().2o(".")).1f&&(d=ZC.BN(d,Z[1].1f)),c.BY&&(1c!==u&&ZC.2l(c.BY-u)>0&&h.1h(ZC.2l(c.BY-u)),u=c.BY),n.A.XB=n.A.XB||{};1a g=n.A.XB["s"+n.DV];if(g&&(1c!==u?-1===ZC.AT(g,c.BY)&&g.1h(c.BY):-1===ZC.AT(g,i)&&g.1h(i)),!n.IT||"xy"!==n.C.AJ.3y&&"yx"!==n.C.AJ.3y)n.S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t.o["1z-z"].2C&&t.o["1z-z"].2C.1f){(r=1m CX(e)).A0=r.AC="#16t",r.C5=.25;1a u=e.E["z-84"]%t.o["1z-z"].2C.1f;r.1C(t.o["1z-z"].2C[u]),r.1q(),(l=ZC.DE.D9(r,t,i.iX-ZC.AL.DZ,i.iX+i.I-ZC.AL.DZ,i.iY+i.F-ZC.AL.E0,i.iY+i.F-ZC.AL.E0,e.E["z-84"]*e.E["z-5u"],e.E["z-84"]*e.E["z-5u"]+e.E["z-5u"],"z")).K=e.K+"-1P-",t.CG.2P(l)}}}gc(){if(1g.S)1j(1a e=0;e<1g.S.1f;e++)1g.S[e]&&1g.S[e].A&&ZC.AO.gc(1g.S[e],["Z","C6","o","JW","I4","A","C","H","N","NK"]);ZC.AO.gc(1g,["W","S","GM","K7","VJ","A8","Z","C6","V5","A2","UD","HB","G6","ID","KI","QL","B1","CH","S","GM","K7","JX","o","JW","I4","A","C","H"])}}1O WV 2j IE{2G(e){1D(e);1a t=1g;t.zT=!0,t.AF="xy",t.BL=[ZC.1b[50],ZC.1b[51]]}1t(){1D.1t()}}1O R5 2j WV{2G(e){1D(e);1a t=1g;t.AF="1w",t.CS="ab",t.Y=1,t.SU="6s",t.VJ=[],t.QF=!1,t.OZ=!1}FY(){1l 1m tI(1g)}1q(){1a e=1g;e.BO=e.NF(),e.C0=e.BO[0],e.B7=e.BO[1],e.N7(),1D.1q(),e.4C([["7i-4c","SU"],["gk-dG","QF","b"]]),e.B1=e.C.BK(e.BT("k")[0]),e.CH=e.C.BK(e.BT("v")[0])}1t(){1a e,t,i,a,n,l,r,o=1g;1D.1t(),o.VJ=[];1a s=o.OZ;if(o.KI=o.CK("bl",0),o.QL=ZC.P.E5(o.CK("bl",1),o.H.AB),!o.IT||o.C.AJ["3d"])o.OB(),o.D=1c;1u{o.VQ(),o.C6=o.CK("bl",0);1a C=!0;(1c!==ZC.1d(o.A2.o.2h)&&!ZC.2t(o.A2.o.2h)||1c!==ZC.1d(o.A.o.1J)&&"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z.ag(m),pe=ZC.P.E5(se.Z,Z.H.AB),ue=1m CX(Z);ue.1S(Z),ue.CW=!0,ue.LC=!0,ue.K=Z.K+"-1w-2A",ue.DH=Z.K+"-2A",ue.AZ=1,Ze&&(ue.1C(Ze),ue.1q()),ZC.CM.1t(pe,ue,ce,1c,3)}Z.CB&&(Z.A.D3=D)}}}1O h9 2j WV{2G(e){1D(e);1a t=1g;t.AF="2V",t.u9="2V",t.F1=.1,t.D1=0,t.op=!1,t.ZL=-1,t.CC=.1,t.CN=.1,t.EW=0,t.UC=!1,t.M6=[],t.PV="bg",t.mz=!0,t.QF=!1}1q(){1a e=1g;if(e.BO=e.NF(),e.C0=e.BO[0],e.B7=e.BO[1],e.BU=e.BO[1],e.A0=e.BO[1],e.AC=e.BO[2],e.N7(),1D.1q(),"18j"===e.CS&&(e.F1=e.CC=e.CN=0),e.4C([["6d-ko","mz","b"],["4m-cN","UC","b"],["2a-6p","M6"],["2V-8w","F1","fp"],["2V-1s","D1","fp"],["8b-1s","op","b"],["2V-1X-1s","ZL","fp"],["ko-8w-1K","CC","fp"],["ko-8w-2z","CN","fp"],["ko-iQ","EW","fp"],["gk-dG","QF","b"]]),e.mz||(e.EW=1),0===e.F1&&0===e.CC&&0===e.CN&&(e.FB=!1),e.B1=e.C.BK(e.BT("k")[0]),e.CH=e.C.BK(e.BT("v")[0]),1c!==ZC.1d(e.o.94)){1a t=e.o.94.2o("/");if(2===t.1f){1a i=ZC.1k(t[0]),a=ZC.1k(t[1]),n=e.CC;e.CC>=1&&(n=e.CC/e.B1.A9);1a l=e.CN;e.CN>=1&&(l=e.CN/e.B1.A9);1a r=1-n-l,o=ZC.4w(r/(3*a+1));e.CC=n+o+3*(i-1)*o,e.CN=1-e.CC-2*o}}}PO(){1a e,t=1g;if(t.RT)1l t.RT;if(t.o["8u-15R"]&&t.A.A7[0].RT)1l t.A.A7[0].RT;t.op&&(t.4C([["2V-1s","D1","fp"]]),t.D1=1A.46((t.B1.D8?t.B1.F:t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(t[i].S[n].SW)),e.RP=ZC.CT(e.RP,ZC.2l(t[i].S[n].SW))}e.OB(!0)}}1O WQ 2j IE{2G(e){1D(e);1a t=1g;t.AF="3P",t.BL=["1z",ZC.1b[52],"1z-r"],t.Q4=0,t.DK=0,t.UC=!1,t.mo=!0,t.C1=1c,t.PV="bg"}FY(){1l 1m Fi(1g)}1q(){1a e,t,i=1g;1c===ZC.1d(i.o[ZC.1b[17]])&&(i.o[ZC.1b[17]]={}),"9f"!==i.A.A.o.1J&&"oD"!==i.A.A.o.1J||(i.Q4=.35),i.BO=i.NF(),i.C0=i.BO[0],i.A0=i.BO[1],i.AC=i.BO[2],i.BU=i.BO[0],i.B7=i.BO[0],i.N7(),1D.1q(),i.C1=1m CX(i),i.C.A.B9.2w(i.C1.o,["2Y.1B.1V-3F.8W",i.AF+".1B.1V-3F.8W"]),1c!==ZC.1d(e=i.C.o.1B)&&1c!==ZC.1d(e[ZC.1b[17]])&&1c!==ZC.1d(t=e[ZC.1b[17]].8W)&&i.C1.1C(t),i.C1.1C(i.o[ZC.1b[17]].8W),i.4C([["2a","DQ","fp"],[ZC.1b[8],"Q4","fp"],["4m-cN","UC","b"],["sA","mo","b"],["3Q-2f","DK","i"]]),i.DK%=2m;1j(1a a=0,n=i.S.1f;a<n;a++)i.S[a]&&(i.S[a].CJ=i.Q4,i.S[a]&&(i.C.E["1B"+i.L+".2h"]||"5d"===i.C.7T())&&(1c===ZC.1d(i.A.KN[a])&&(i.A.KN[a]=0),i.A.KN[a]+=ZC.1Y(i.S[a].AE)))}1t(){1a e=1g;1D.1t(),e.KI=e.CK("bl",0),e.OB(!0)}}1O U3 2j IE{2G(e){1D(e);1a t=1g;t.AF="8Z",t.BL=["1z"],t.UJ=0,t.SV=0,t.DK=0,t.C1=1c,t.PV="bg",t.eN=1c}FY(){1l 1m yK(1g)}1q(){1a e,t,i=1g;i.BO=i.NF(),i.C0=i.BO[0],i.A0=i.BO[1],i.AC=i.BO[2],i.BU=i.BO[0],i.B7=i.BO[0],i.N7(),1D.1q(),i.U&&(i.C1=1m CX(i),i.C.A.B9.2w(i.C1.o,["2Y.1B.1V-3F.8W",i.AF+".1B.1V-3F.8W"]),1c!==ZC.1d(e=i.C.o.1B)&&1c!==ZC.1d(e[ZC.1b[17]])&&1c!==ZC.1d(t=e[ZC.1b[17]].8W)&&i.C1.1C(t),i.C1.1C(i.o[ZC.1b[17]].8W)),i.4C([["7u-4c","UJ","fp"],["2a","UJ","fp"],[ZC.1b[8],"UJ","fp"],["Aq-8w","SV","fp"],["3Q-2f","DK","i"],["Aq-16v","eN"]]),i.DK%=2m;1j(1a a=0,n=i.S.1f;a<n;a++)i.S[a]&&(i.C.E["1B"+i.L+".2h"]||"5d"===i.C.7T())&&(1c===ZC.1d(i.A.KN[a])&&(i.A.KN[a]=0),i.A.KN[a]+=ZC.1Y(i.S[a].AE))}1t(){1a e=1g;1D.1t(),e.KI=e.CK("bl",0),e.OB(!0)}}1O XW 2j IE{2G(e){1D(e);1a t=1g;t.AF="7j",t.T2=3,t.BL=["1z-k",ZC.1b[52],"1z"],t.HX=.5,t.CS="1w",t.sF=1c,t.XU=!1,t.D=[],t.AG=[]}FY(){1l 1m uQ(1g)}1q(){1a e=1g;e.BO=e.NF(),e.C0=e.BO[0],e.B7=e.BO[1],e.A0=e.BO[3],e.AC=e.BO[3],e.N7(),1D.1q(),e.kM(),e.4C([["6K-1N","XU","b"],["2n-1N","HX","f",0,1],["2f-8w","sF","f"]]),e.B1=e.C.BK("1z-k"),e.CH=e.C.BK(ZC.1b[52]),"5A"===e.CS&&(e.aT="5j",e.IT=!1)}1t(){1a e=1g;1D.1t(),e.B1.W.1f===e.W.1f&&-1===ZC.AT(e.W,1c)||(e.aT="5j",e.IT=!1),e.KI=ZC.AK(e.C.K+"-1B-"+e.L+"-bl-0-c"),e.lM=ZC.P.E5(e.CK("bl",0),e.H.AB),e.QL=ZC.P.E5(e.CK("bl",2),e.H.AB),e.OB(!0)}}1O nZ 2j h9{2G(e){1D(e);1a t=1g;t.F1=.2,t.CC=.28,t.CN=.28,t.EW=0,t.FI=1c,t.du=[],t.Q9=[],t.Bo=!0,t.PV="bg"}o0(e){1a t;if("7n"===e){if(1c!==ZC.1d(t=1g.FI.o.2H))1l t;if(1c!==ZC.1d(t=1g.FI.o["2H-1E"]))1l{1E:t}}1l{}}1q(){1a e,t=1g;if(t.BO=t.NF(),1D.1q(),1c!==ZC.1d(t.du=t.o.hj))1j(1a i=0,a=t.du.1f;i<a;i++)1c!==ZC.1d(t.du[i])?"3b"==1y t.du[i]?t.Q9[i]=ZC.AT(t.CH.JK,t.du[i]):t.Q9[i]=ZC.1Y(t.du[i]):t.Q9[i]=1c;t.FI=1m I2(t),t.FI.1S(t),t.FI.1C({"1T-1r":t.BO[3]}),t.FI.o["2H-1E"]="%2r-7n-1V",t.H.B9.2w(t.FI.o,["("+t.AF+").1B.7n"],!0,!0),1c!==ZC.1d(e=t.o.7n)&&t.FI.1C(e),t.FI.1q()}}1O TQ 2j nZ{2G(e){1D(e),1g.AF="8m"}FY(){1l 1m vG(1g)}}1O TT 2j nZ{2G(e){1D(e),1g.AF="8h"}FY(){1l 1m vN(1g)}}1O XY 2j WV{2G(e){1D(e);1a t=1g;t.AF="5N",t.CS="2n",t.sp="1B-1X",t.QG=.2,t.VC=1,t.PV="bg"}FY(){1l 1m vf(1g)}1q(){1a e=1g;e.BO=e.NF(),e.C0=e.BO[0],e.B7=e.BO[1],e.BU=e.BO[1],e.A0=e.BO[2],e.AC=e.BO[1],e.N7(),1D.1q(),e.4C([["2k-fV","QG","f",0,1],["1X-fV","VC","f",0,1],["d3","sp",""]]),e.QG>=e.VC&&(e.QG=.2,e.VC=1),e.B1=e.C.BK(e.BT("k")[0]),e.CH=e.C.BK(e.BT("v")[0])}1t(){1a e=1g;1D.1t(),e.KI=e.CK("bl",0),e.kf=e.kh=-ZC.3u,e.YT=e.WY=ZC.3u,e.sM=e.ti=0;1j(1a t=0,i=e.A.A7.1f;t<i;t++)1j(1a a=e.A.A7[t],n=0,l=a.S.1f;n<l;n++)if(a.S[n]){1a r=ZC.1Y(a.S[n].AE);a.L===e.L&&(e.kf=ZC.BN(e.kf,r),e.YT=ZC.CT(e.YT,r),e.sM+=r),e.kh=ZC.BN(e.kh,r),e.WY=ZC.CT(e.WY,r),e.ti+=r}e.OB()}}1O WX 2j WV{2G(e){1D(e);1a t=1g;t.L5=.1,t.NS=.1,t.M3=0,t.jP="4O",t.P3=[],t.W5=[],t.PV="bg"}1q(){1a e,t,i,a,n=1g;if(n.BO=n.NF(),n.C0=n.BO[0],n.B7=n.BO[1],n.BU=n.BO[1],n.A0=n.BO[2],n.AC=n.BO[1],n.N7(),1D.1q(),n.4C([["4c-1s","jP"],["2k-8g","M3","fp"],["8w-8s","L5","fp"],["8w-8g","NS","fp"],["2a","L5","fp"],["2a","NS","fp"]]),1c!==ZC.1d(i=n.o.8s))1j(i 3E 3M||(i=[i]),e=0,t=i.1f;e<t;e++){1a l=1m DR(n);l.o=i[e],l.1q(),n.P3.1h(l)}if(1c!==ZC.1d(a=n.o.8g))1j(a 3E 3M||(a=[a]),e=0,t=a.1f;e<t;e++){1a r=1m DR(n);r.o=a[e],r.1q(),n.W5.1h(r)}n.B1=n.C.BK(n.BT("k")[0]),n.CH=n.C.BK(n.BT("v")[0])}1t(){1a e=1g;1D.1t(),e.KI=e.CK("bl",0),e.OB()}}1O VR 2j WX{2G(e){1D(e),1g.AF="au"}FY(){1l 1m va(1g)}}1O VO 2j WX{2G(e){1D(e),1g.AF="af"}FY(){1l 1m uh(1g)}}1O VU 2j h9{2G(e){1D(e);1a t=1g;t.AF="7Y",t.CS="wi",t.N2={2e:0},t.PV="bg"}FY(){1l 1m uf(1g)}1q(){1D.1q()}1t(){1D.1t(),1g.9u()}9u(){1a e=1g,t=e.C.BK(e.BT("v")[0]),i=t.AX(t.H5);if(e.C.BI&&e.C.BI.IO&&e.RU){1j(1a a=e.C.Q,n=e.C.BI,l=[],r=[],o=!0,s=0,C=e.S.1f;s<C;s++)if(1c!==ZC.1d(e.S[s])&&1c!==ZC.1d(e.S[s].DL[2])){1a A=t.AX(e.S[s].DL[2]);o&&(r.1h([e.S[s].iX,i]),o=!1),l.1h([e.S[s].iX,A]),r.1h([e.S[s].iX,A])}r.1f&&r.1h([r[r.1f-1][0],i]);1a Z=e.ag(r),c=e.o.2A||{};if("1N"===(c.1J||"1N")){1a p=1m DR(e.A);p.1S(e),p.1C({"1T-1r":e.BU,"2n-1N":.2}),p.1C(c),p.1q(),p.CW=!0,p.LC=!0,p.AZ=0,p.AQ=0,p.EV=0,p.G8=0,p.C5=ZC.1Y(p.o["2n-1N"]),p.CY=[a.iX,a.iY,a.iX+a.I,a.iY+a.F],p.K=e.K+"-1N-2A",p.Z=n.Z,p.D=Z,p.1t()}1a u=e.ag(l),h=ZC.P.E5(n.Z,e.H.AB),1b=1m CX(e);1b.1S(e),1b.1C({"1w-1r":e.BU,"1w-1s":1}),1b.1C(c),1b.1q(),ZC.CM.1t(h,1b,u,1c,3)}}}1O XR 2j IE{2G(e){1D(e);1a t=1g;t.AF="8z",t.T2=3,t.BL=["1z-r",ZC.1b[52],"1z"],t.HX=.5,t.HW=[10,0,0,0,0],t.PV="bg"}FY(){1l 1m xM(1g)}1q(){1a e,t=1g;t.BO=t.NF(),t.C0=t.BO[0],t.B7=t.BO[1],t.A0=t.BO[3],t.AC=t.BO[3],t.N7(),1D.1q(),t.4C([["2n-1N","HX","f",0,1],["Bq","HW"]]),1c!==ZC.1d(e=t.o.167)&&(t.HW[0]=ZC.1k(e)),t.HW=[ZC.1Y(t.HW[0]||"10"),ZC.1Y(t.HW[1]||"0"),ZC.1Y(t.HW[2]||"0"),ZC.1Y(t.HW[3]||"0"),ZC.1Y(t.HW[4]||"0")]}1t(){1a e=1g;1D.1t(),e.KI=e.CK("bl",0),e.OB(!0)}}1O UH 2j WV{2G(e){1D(e);1a t=1g;t.AF="5A",t.Y=1,t.CS="ab",t.T2=3,t.HX=.5}FY(){1l 1m xI(1g)}1q(){1a e=1g;e.BO=e.NF(),e.C0=e.BO[0],e.B7=e.BO[1],e.A0=e.BO[0],e.AC=e.BO[1],e.N7(),1D.1q(),e.kM(),e.YS("2n-1N","HX","f",0,1),e.B1=e.C.BK(e.BT("k")[0]),e.CH=e.C.BK(e.BT("v")[0])}OB(){1a e,t,i=1g,a=i.OZ;i.VQ(!1);1a n=i.C.Q;i.Y=1;1a l=a?n.F:n.I;i.B1.EC||!i.RM&&5*(i.B1.A1-i.B1.X)>l&&(i.Y=ZC.1k(5*(i.B1.A1-i.B1.X)/l));1a r=i.B1.EC;if(r&&i.QB[0]===ZC.3u&&i.QB[1]===-ZC.3u&&(r=!1),r)1j(e=0,t=i.S.1f;e<t;e++)i.S[e]&&ZC.DT(i.S[e].BY,i.B1.W[i.B1.X],i.B1.W[i.B1.A1])&&(i.S[e].Z=i.KI,i.S[e].MS="2k",i.S[e].1t(),i.S[e].MS="1X",i.S[e].1t(),4t i.S[e].E["cc.2Z"]);1u 1j(e=i.B1.X;e<=i.B1.A1;e+=i.Y)i.S[e]&&(i.S[e].MS="2k",i.S[e].1t(),i.S[e].MS="1X",i.S[e].1t(),4t i.S[e].E["cc.2Z"])}1t(){1a e=1g;1D.1t(),e.KI=e.CK("bl",0),e.lM=ZC.P.E5(e.CK("bl",1),e.H.AB),e.QL=ZC.P.E5(e.CK("bl",2),e.H.AB),e.OB(),e.D=1c,e.D3=1c,e.gu=1c,e.SJ=1c}}1O XT 2j WQ{2G(e){1D(e);1g.AF="7a",1g.NQ=-1}1q(){1D.1q(),1g.4C([["s5","NQ","ia"]])}FY(){1l 1m yk(1g)}}1O UZ 2j R1{2G(e){1D(e),1g.AF="6U"}FY(){1l 1m xq(1g)}1q(){1a e=1g;1D.1q(),1c===ZC.1d(e.o[ZC.1b[61]])&&(e.BU=e.BO[0]),1c===ZC.1d(e.o["1w-1r"])&&(e.B7=e.BO[0])}1t(){1D.1t(),1g.kK()}}1O WO 2j R6{2G(e){1D(e),1g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["%kl"+i,kX[i]]);1j(i=0;i<kY.1f;i++)CQ.1h(["%1z-8b-1E-"+i,kY[i]],["%kt"+i,kY[i]]);1j(i=0;i<gI.1f;i++)CQ.1h(["%1z-8b-1V-"+i,gI[i]],["%kv"+i,gI[i]],["%k"+i,gI[i]]);CQ.1h(["%1z-8b-1H",S2],["%1z-8b-1E",RV],["%1z-8b-1V",PU],["%1z-8b-1V-ts",tQ],["%16U",tQ],["%kt",RV],["%kl",S2],["%kv",PU],["%k",PU],["%2r-1V",CI],["%v",CI],["%2r-Cq-1V",s.AE],["%V",s.AE],["%2r-2Z",s.L],["%2r-x",s.iX],["%2r-y",s.iY],["%aI-1s",s.H.I],["%aI-1M",s.H.F],["%i",s.L],["%n",s.L],["%2r-gp",s.A.S.1f],["%N",s.A.S.1f]);1a Cr=8S["%1B-80"],gv=Cr+"",Cs=8S["%1B-dD"],gw=Cs+"",tu=ZC.1Y(8E.F5["%ba-"+s.L+"-"+s.A.DV+"-80"]||"0"),kr=tu+"",Cv=ZC.1Y(tu/8E.F5["%ba-"+s.L+"-"+s.A.DV+"-7H-1f"]),ks=5Q(Cv),Cn=5Q(8E.F5["%ba-"+s.L+"-"+s.A.DV+"-7H-1f"]),u2=0;1c!==ZC.1d(8E.F5)&&1c!==ZC.1d(8E.F5[s.L])&&(u2=ZC.1Y(8E.F5[s.L]["%6n-"+s.A.DV]||"0"));1a km=u2+"";gv=ZC.AO.GN(gv,BF),gw=ZC.AO.GN(gw,BF),km=ZC.AO.GN(km,BF),kr=ZC.AO.GN(kr,BF),ks=ZC.AO.GN(ks,BF),CQ.1h(["%2r-4L-8k",s.E["2r-4L-8k"]],["%2r-4L-rT",s.E["2r-4L-rT"]],["%7H-6n",kr],["%7H-dD",ks],["%7H-1f",Cn],["%6n",km],["%1B-2k-2Z",8S["%1B-2k-2Z"]],["%16R",8S["%1B-2k-2Z"]],["%1B-1X-2Z",8S["%1B-1X-2Z"]],["%16Q",8S["%1B-1X-2Z"]],["%1B-2k-1V",8S["%1B-2k-1V"]],["%16P",8S["%1B-2k-1V"]],["%1B-1X-1V",8S["%1B-1X-1V"]],["%16O",8S["%1B-1X-1V"]],["%1B-80",gv],["%16N",gv],["%1B-dD",gw],["%16M",gw],["%1B-6p",8S["%1B-6p"]],["%pv",8S["%1B-6p"]]);1a Cx=100*s.AE/8S["%1B-80"],Z1=Cx+"";1c!==ZC.1d(BF[ZC.1b[12]])&&(Z1=ZC.AO.GN(Z1,BF)),CQ.1h(["%1B-8i",Z1],["%16K",Z1]);1a ua=!1,WR,AV,J,BZ;1j(i=0,A5=CQ.1f;i<A5;i++)if("%8l"===CQ[i][0]){ua=!0;1p}if(!ua&&1c!==ZC.1d(s.A.A.F5)&&1c!==ZC.1d(s.A.A.F5[s.L])){1a JO=100*s.AE/s.A.A.F5[s.L]["%6n-"+s.A.DV],HN=JO+"";1c!==ZC.1d(BF[ZC.1b[12]])&&(HN=ZC.AO.GN(HN,BF)),CQ.1h(["%2r-8i-1V",HN],["%8l",HN])}1j(i=0;i<UE.1f;i++)CQ.1h(["%1B-1E-"+i,UE[i]],["%t"+i,UE[i]]);1j(CQ.1h(["%1B-1E",WN],["%t",WN],["%1B-u7",s.A.ZA],["%1B-2Z",s.A.L],["%p",s.A.L],["%1B-gp",8E.A7.1f],["%P",8E.A7.1f],["%id",s.H.K],["%4y",s.C.K.1F(s.H.K+"-2Y-","")]),-1!==AP.1L("%8c")&&(OX&&"cK"===BF.8c?(CQ.1h(["%8c","-"]),OX=!1):CQ.1h(["%8c",""])),CQ.1h(["%2r-x",s.iX],["%2r-y",s.iY],["%2r-1s",s.I],["%2r-1M",s.F],["%2r-2e",s.E["1R.2e"]||1]),1o.3J.Bw&&CQ.3Z(ZC.k6),7F=1m 5v("\\\\(([^(]+?)\\\\)\\\\(([0-9]*)\\\\)(\\\\(*)([0-9]*)(\\\\)*)");D2=7F.3n(AP);){WR="";1a CO=s.A.L,D6=s.L;""!==(G=D2[2])&&(CO=ZC.1k(G)),""!==(G=D2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&(r.A0=r.AC=i),r.E.76=l.A.L,r.E.7y=l.L,l.A.U.IH&&(l.A.U.GU(l.A.U,r,1c,l.M8(1c,!1)),r.1q()),r.1q(),r.IX=1n(e){1l l.IX(e)},r.DB()&&r.1q(),!l.A.Z6){1a C=1m DP(l.A);C.1S(r),l.A.Z6=C}if(a="4s",1c!==ZC.1d(i=o.o.1J)&&(a=i),r.AM){r.AM=!1;1a A=l.A.o[ZC.1b[17]].1E||"";if("6p("===a.2x(0,7)){1a Z=a.2x(7,a.1f).1F(")","").2o(",");-1!==ZC.AT(Z,l.AE)&&(r.AM=!0)}1u{1a c=a.2o(","),p={2k:"%1B-2k-1V",1X:"%1B-1X-1V",gB:"%1B-2k-2Z",7S:"%1B-1X-2Z"};1j(1a u in p)-1!==ZC.AT(c,u)&&(("gB"!==u&&"7S"!==u||l.L!==l.A.JX[p[u]])&&("2k"!==u&&"1X"!==u||l.AE!==l.A.JX[p[u]])||("4j"==1y A&&1c!==ZC.1d(A[u])&&(r.o.1E=A[u],r.1q()),r.AM=!0));-1!==ZC.AT(c,"4s")&&(r.AM=!0)}}}if(l.C.E["1B"+l.A.L+".2h"]||(r.E["2O-3N"]="2b"),e)1l r;if(r.AM&&1c!==ZC.1d(r.AP)&&""!==r.AP){1a h=l.HC(r);r.E.rZ=h,r.iX=h[0],r.iY=h[1];1a 1b={};if(-1!==r.iX&&-1!==r.iY){1a d=!1;if(1c!==ZC.1d(r.o.iQ)&&!ZC.2t(r.o.iQ)){1b={x:r.iX,y:r.iY,1s:r.I,1M:r.F};1j(1a f=0,g=l.A.A.YX.1f;f<g;f++)if(ZC.AN.Y4(1b,l.A.A.YX[f])){d=!0;1p}}d||(l.C.E["1B"+l.A.L+".2h"]||(r.E["2O-3N"]="2b"),r.E.s6="vb"+l.C.L,r.1t(),r.E9(),l.A.A.YX.1h(1b),!r.KC&&ZC.AK(l.H.K+"-3e")&&l.A.A.HQ.1h(ZC.AO.OA(l.C.K,r)))}}1l r}}}Gq(e){if(1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t.IB=1c,t.G1=1c,t.H5=0,t.PB=1c,t.L=1,t.A6=0,t.tk=0,t.BV=0,t.AR=!1,t.D8=!1,t.A9=0,t.DU=-1,t.RL=ZC.HD[ZC.1b[13]]||"",t.SB=ZC.HD[ZC.1b[14]]||".",t.fu=!1,t.SR=2,t.fr=!1,t.U5="",t.fj="wn",t.CF=1c,t.AF="",t.ED=ZC.3u,t.M9=ZC.3u,t.H7=!1,t.YU=!1,t.M0=1c,t.NW=1c,t.QE=[],t.EA=1,t.B8=-1,t.BS=-1,t.SP=-1,t.H1=-1,t.HL=-1,t.C8="lb",t.EU=10,t.FF=1c,t.PA=1,t.Q8=!0,t.l0=!1,t.7G=[!1,!1],t.M1=1c,t.XC=1c,t.TN=!1,t.HZ=-1,t.ZI=!1,t.B6="2q",t.QX=!1,t.VW=!1,t.R8=1,t.dz="",t.iJ=!0}1q(){1D.1q();1a e,t=1g;if(1c!==ZC.1d(e=t.o.7i))if(ZC.PG(e))t.EA=ZC.1Y(e);1u{1a i=e.1F(/[0-9]/gi,""),a=5z(e.1F(/[^0-9]/gi,""),10);1Q(a=a||1,i){1i"mQ":t.EA=5I*a;1p;1i"iy":t.EA=5I*a*60;1p;1i"lL":t.EA=5I*a*60*60;1p;1i"dn":t.EA=5I*a*60*60*24;1p;1i"Aw":t.EA=5I*a*60*60*24*7;1p;1i"eL":t.EA=172*a;1p;1i"jS":t.EA=174*a}}if(1c!==ZC.1d(t.o.iG)&&1c===ZC.1d(t.o.5L)&&(t.o.5L=t.o.iG),t.4C([[ZC.1b[10],"BW"],["2H-1E","rj"],["5D","CF"],["2a-4c","A6","i"],["2a-4c","tk","i"],["2a-6i","BV","i"],["4Q-9X","GT","i"],["2Z","L","i"],["yE","AR","b"],["cl","H7","b"],["3G-176","YU","b"],["7o-7i","QX","b"],["3G-to","M0"],["d9-16W","ZI","b"],["3G-to-6p","NW"],["2C-iQ","l0","b"],["16D","TN","b"],["1X-cA","ED","i"],["1X-2C","ED","i"],["3Q-1V","H5","f"],[ZC.1b[12],"DU","ia"],[ZC.1b[14],"SB"],[ZC.1b[13],"RL"],["5L","fr","b"],["5L-dv","U5"],["8c","fj"],["az","fu","b"],[ZC.1b[25],"SR","ia"],["f9","C8"],["3a-16a","EU","fa"],["1z-7e","PA","fa"],["4m-cA","M1"],["1X-6k","HZ","i"],[ZC.1b[7],"B6"],["7e","R8","f"],["16c","dz"],["16e","VW","b"],["vn","DJ","b"],["iL","iJ","b"]]),1c!==ZC.1d(e=t.o["3i-iu"])&&(e.1f?(t.7G[0]=ZC.2t(e[0]),t.7G[1]=ZC.2t(e[e.1f-1])):t.7G[0]=t.7G[1]=ZC.2t(e)),"3b"==1y t.BW){1a n=t.BW.2o(":"),l=1;3===n.1f&&(l=ZC.1Y(n[2])),t.BW=[];1j(1a r=ZC.1Y(n[0]);r<ZC.1Y(n[1]);r+=l)t.BW.1h(""+r);t.BW.1h(""+n[1])}1c!==ZC.1d(t.o["7o-2C"])&&(t.ED=ZC.3u),t.ED=ZC.BN(t.ED,2),1c!==ZC.1d(e=t.o.2a)&&(t.A6=t.BV=ZC.1k(e),0!==ZC.1k(e)||"9z"!==t.A.AF&&"aZ"!==t.A.AF||(t.DJ=!1)),1c!==ZC.1d(e=t.o["1X-9X"])?t.M9=ZC.1k(e):t.M9=t.ED,t.M9=ZC.BN(2,t.M9),1c!==ZC.1d(e=t.o.5G)&&(t.FF=1m CX,t.FF.1C(e));1a o=t.A.A.B9,s="("+t.A.AF+")",C=t.BD.1F(/\\-[0-9]/,""),A=t.BD.1F(/\\-[0-9]/,"-n");1n Z(e){1a i=[s+".4B."+e,s+"."+t.BD+"."+e,s+"."+C+"."+e,s+"."+C+"["+t.B6+"]."+e,s+"."+A+"."+e];1l t.A.AJ["3d"]&&(i=i.4A([s+".4B[3d]."+e,s+"."+t.BD+"[3d]."+e,s+"."+C+"[3d]."+e,s+"."+A+"[3d]."+e])),i}if(1c===ZC.1d(t.o[ZC.1b[7]])&&t.L>1&&(t.B6="5C"),1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1Y(ZC.8M(e))),1c!==ZC.1d(e=t.o["2a-6i"])&&(t.BV=ZC.1Y(ZC.8M(e)));1a l="k"===t.AF&&!t.D8||"v"===t.AF&&t.D8?t.I:t.F;t.A6<1&&(t.A6*=l),t.BV<1&&(t.BV*=l)}W8(e){1a t=1g;1c!==ZC.1d(t.o.an)&&(t.XC||(t.XC=1m H9(t.A)),t.XC.1C(t.o),t.XC.1q(),t.XC.IX=e,t.XC.DB()&&(t.XC.1q(),t.DU=t.XC.DU,t.CF=t.XC.CF))}GV(){}T6(){}jw(){}H8(){}3j(){}6a(){}LS(){1a e,t=1g,i={8c:t.fj,"n6-8F":t.RL,"6k-8F":t.SB,6k:t.DU,"1X-6k":t.HZ,5L:t.fr,"5L-dv":t.U5,az:t.fu,"az-6k":t.SR};if(t.FF)1Q(t.FF.o.1J){1i"5B":i[ZC.1b[68]]=!0,1c!==ZC.1d(e=t.FF.o.1E)&&(t.FF.o.4s=e);1a a=t.W[t.A1]-t.W[t.X],n="",l="",r={},o=["sf","mQ","iy","lL","dn","eL","jS"];1j(1a s in o)r[o[s]]=ZC.HD["5B-rL"][o[s]];l=0<=a&&a<=5I?"sf":5I<a&&a<=j3?"mQ":j3<a&&a<=uW?"iy":uW<a&&a<=ug?"lL":ug<a&&a<=ul?"dn":ul<a&&a<=16l?"eL":"jS",n=1c!==ZC.1d(t.FF.o[l])?t.FF.o[l]:1c!==ZC.1d(t.FF.o.4s)?t.FF.o.4s:r[l],t.E.us=n,i[ZC.1b[67]]=t.E.us}1l i}Y5(){1j(1a e=1g,t=e.A.AY.A7,i=-1,a=0,n=t.1f;a<n;a++){1a l=t[a].BT(e.AF);if(-1!==ZC.AT(l,e.BD)){1Q(t[a].AF){1i"3P":1i"7a":1i"8Z":1i"5x":1i"6U":1i"6b":1i"7z":1i"8m":1i"8h":1i"1N":1i"88":1i"8z":1i"au":1i"af":1i"b6":i=t[a].A0;1p;1i"6v":1i"5g":i=-1!==t[a].A2.A0?t[a].A2.A0:t[a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E(e,t,o.EA,o.PA,Z):[e,t,o.EA,1,o.EA]}-1===o.SP&&(o.SP=a[4]);1a c=a[0],p=a[1];r=a[2],i&&"3a"===o.C8&&(c=1A.4n(ZC.HO(c,o.EU)),p=1A.4h(ZC.HO(p,o.EU))),1c===ZC.1d(o.o.7i)&&(p-c)/r>8r&&(r=(p-c)/8r,l=1A.4h(ZC.HO(r)/1A.bD),r=1A.5k(10,l)),1c===ZC.1d(o.o["2k-1V"])&&c!==p&&(s&&C||(c-=c%r)),1c===ZC.1d(o.o["1X-1V"])&&c!==p&&(s&&C||(p=p-p%r+(p%r==0?0:r))),l=1A.4n(ZC.HO(r)/1A.bD);1a u,h=a[3];if(l<h&&l<0&&(h=l),"3a"===o.C8&&(h=ZC.BN(1,h)),o.W=[],s&&C){1a 1b=ZC.AO.YM(c,"%Y-%n-%d-%H-%i-%s",!1,0).2o("-"),d=!0,f=ZC.1k((""+o.o.7i).1F("eL"));0===f&&(f=1);1a g=ZC.1k(1b[1]),B=ZC.1k(1b[0]);1j(o.W.1h(c);d&&c!==p;){d=!1;1a v=ZC.1k(1b[2]);g+f>=12&&B++,g=(g+f)%12,(31===v&&(3===g||5===g||8===g||10===g)||v>28&&1===g)&&(v=1===g?B%4==0&&B%100!=0||B%sK==0?29:28:30);1a E=1m a1(B,g,v,1b[3],1b[4],1b[5]).bv();o.W.1h(E),E<p&&E<=t&&(d=!0)}}1u if(i){o.H1=e,o.HL=t,o.VK=ZC.1k((p-c)/r);1a b=(""+r).2o("."),m=1m 5Q(b[1]||"0").1f;1j(n=c;n<=p;n+=r){1a K,D;u=n;1a F=o.DU;if("3a"===o.C8)1j(1a I=!0;I;)I=!1,D=K=1A.5k(o.EU,u),K=ZC.1Y(ZC.bW(K,F)),D<1&&D!==K&&ZC.BN(D,K)/ZC.CT(D,K)>1.sL&&(I=!0,++F>ZC.CT(20,-1===o.HZ?99:o.HZ)&&(I=!1));1u K=1c!==F?ZC.1Y(ZC.bW(u,1A.1X(F,m))):ZC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i].S[x].AE,D[i].S[x].AE>=0||!I?D[i].S[x].CL=m[D[i].DV][Y][0]:D[i].S[x].CL=m[D[i].DV][Y][1],1c===ZC.1d(s.o[ZC.1b[5]])&&K.1h(m[D[i].DV][Y][0]+L,m[D[i].DV][Y][1]+L);1u if(1c===ZC.1d(s.o[ZC.1b[5]])){K.1h(D[i].S[x].AE+L),0!==L&&K.1h(L);1j(1a w=0,M=D[i].S[x].DL.1f;w<M;w++)K.1h(D[i].S[x].DL[w]+L)}}}K.1f>0&&(l=ZC.ds(K),r=ZC.dr(K)),0!==s.W.1f||l!==4T.iH&&r!==4T.16m||(s.W=[0,1],l=0,r=1),1c===ZC.1d(s.o[ZC.1b[5]])&&(1c!==ZC.1d(s.o["2k-1V"])&&"3i"!==s.o["2k-1V"]?l=ZC.1Y(s.o["2k-1V"]):l>0&&"3i"!==s.o["2k-1V"]&&"3a"!==s.C8&&(l=0),1c!==ZC.1d(s.o["1X-1V"])&&(r=ZC.1Y(s.o["1X-1V"])),l===ZC.3u&&r===-ZC.3u?(s.X=0,s.A1=0,s.B8=0,s.BS=0):"3a"===s.C8?s.Q3(ZC.HO(l,s.EU),ZC.HO(r,s.EU),!1):s.Q3(l,r,!0))}2===e&&(-1===s.H1&&-1===s.HL&&(s.H1=s.B8,s.HL=s.BS),-1===s.SP&&(s.SP=s.EA)),"3i"===s.o["2k-1V"]&&1c===ZC.1d(s.o["3Q-1V"])&&(s.H5=s.B8),0===s.VK&&(s.VK=ZC.1k((s.BS-s.B8)/s.EA));1a H=s.H.E["2Y"+s.A.L+".3G"];if(1c===ZC.1d(s.H.E[ZC.1b[53]])||s.H.E[ZC.1b[53]]){1a P=1===s.L?"":"-"+s.L;2===e&&1y H!==ZC.1b[31]&&1c!==ZC.1d(H["5t"+P])&&1c!==ZC.1d(H["5s"+P])&&(ZC.DT(H["5t"+P],s.B8,s.BS)||(H["5t"+P]=s.B8),ZC.DT(H["5s"+P],s.B8,s.BS)||(H["5s"+P]=s.BS),s.M0=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.1J){1a Ze=d.Bn(d.W[d.A1]-d.W[d.X]),ce=Ze[0];le=Ze[1];1a pe=Ze[2],ue=Ze[3];se=Ze[4];1a he=pe*1A.4h(d.W[d.X]/pe),6m=pe*1A.4n(d.W[d.A1]/pe),de="";d.GQ=0;1a fe=!0;1j(t=he;t<=6m;t+=pe){fe=!0;1a ge=ZC.AO.YM(t,ce,d.A.UU,d.A.NA);if(ge!==de){1Q(ue){1i"yr":se>15&&(fe=ZC.1k(ge)%2==0);1p;1i"Ag":se>15&&(fe=ZC.1k(ge)%3==0);1p;1i"dn":se>45?fe=1===ZC.1k(ge)||15===ZC.1k(ge):se>30?fe=1===ZC.1k(ge)||10===ZC.1k(ge)||20===ZC.1k(ge):se>15&&(fe=1===ZC.1k(ge)||10===ZC.1k(ge)||15===ZC.1k(ge)||20===ZC.1k(ge)||25===ZC.1k(ge));1p;1i"hr":se>45?fe=ZC.1k(ge)%12==0:se>30?fe=ZC.1k(ge)%6==0:se>15&&(fe=ZC.1k(ge)%3==0);1p;1i"2k":1i"Bj":se>45?fe=ZC.1k(ge)%30==0:se>30?fe=ZC.1k(ge)%10==0:se>15&&(fe=ZC.1k(ge)%5==0)}fe&&(be(t,!0),de=ge)}}ne.AM&&(ne.K=d.K+"-9X",ZC.CM.1t(o,ne,ae))}1u 1j(d.GQ=0,be(d.X),d.GQ=d.A1-d.X,be(d.A1),d.GQ=1,t=d.X+1;t<d.A1;t++)(t-d.X)%M==0&&be(t);if(d.M.AM&&d.M.AP&&""!==d.M.AP){($=1m DP(d)).1S(d.M),$.K=d.A.K+"-"+d.BD.1F(/\\-/g,"1b")+"-jf",$.GJ=d.K+"-1H "+d.A.K+"-1z-1H zc-1z-1H",$.AP=d.M.AP,$.Z=d.H.2Q()?d.H.mc():ZC.AK(d.A.K+"-3z-ml-0-c"),$.IM=d.H.2Q()?ZC.AK(d.H.K+"-3Y"):ZC.AK(d.H.K+"-1E"),$.1q(),"5p"!==d.M.o["2s-1r"]&&"5p"!==d.M.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C.AO.OA(o.A.K,s))))}}}}1O uR 2j DR{2G(e){1D(e);1a t=1g;t.C5=.95,t.L=0,t.AF=1c,t.M=1c,t.F6=1c,t.pr=!1,t.B6="2c",t.A6=0,t.BV=0,t.MR="5j",t.O9="5j",t.PT=[5,5],t.lP=[0,0],t.Z5=""}1q(){1D.1q();1a e,t=1g;t.4C([["1J","AF"],["1V-5A","pr","b"],["2a-4c","A6","i"],["2a-6i","BV","i"],[ZC.1b[7],"B6"],["16u-1z","Z5"],["1H-6f","MR"],["1H-ix","O9"],["5A","F6"]]),1c===ZC.1d(t.o.2n)&&(t.o.2n="1N"===t.AF?.25:.95),1c!==ZC.1d(e=t.o["1H-9Y"])&&("4j"==1y e&&e.1f?(t.PT[0]=ZC.1k(e[0]||"5"),t.PT[1]=ZC.1k(e[1]||"5")):t.PT[0]=t.PT[1]=ZC.1k(e||"5")),t.4C([["2n","C5","f",0,1]]),1c===ZC.1d(e=t.o.1H)&&1c===ZC.1d(t.o.1E)||(t.M=1m DP(t),t.A.A.A.B9.2w(t.M.o,["("+t.A.AF+").4B.1R.1H"]),1c!==ZC.1d(t.o.1E)&&t.M.1C({1E:t.o.1E}),t.M.1C(e),t.M.1q(),t.lP=[t.M.BJ,t.M.BC])}1t(){1a e,t,i,a,n,l,r,o=1g;if(o.F6)if(-1===o.A.BD.1L("1z-r")){if(o.AM){1a s,C,A,Z,c=o.A,p=o.A.A.Q.AQ,u=c.A.K+"-3z-"+("1v"===o.B6?"f":"b")+"l-0-c";o.Z=o.C6=ZC.AK(c.H.2Q()?c.H.K+"-3Y-c":u),e=ZC.P.E5(o.Z,c.H.AB),n=[];1a h,1b,d=0,f=0;o.BJ>-1&&o.BJ<1&&(o.BJ=1A.4h(o.BJ*c.A9)),o.BC>-1&&o.BC<1&&(o.BC=1A.4h(o.BC*c.A9)),o.M&&(o.M.Z=c.H.2Q()?c.H.mc():ZC.AK(c.A.K+"-3z-ml-0-c"),o.M.K=o.A.A.K+"-"+o.A.BD.1F(/\\-/g,"1b")+"-b4"+o.L,o.M.GJ=o.A.K+"-1R-1H "+o.A.A.K+"-1z-1R-1H zc-1z-1R-1H");1a g=1n(e,t){1a i;1l-1!==(t+"").1L("%")?(i=ZC.1Y(t.1F("%","")),i="k"===e.AF?ZC.1k(i*(e.EF-e.E6)/100):i*(e.HL-e.H1)/100):i=t,o.pr||"v"===e.AF?e.AX(i):e.H0(i)};if("4z"===o.AF){1a B,v,E,b;1j(1b=o.A.A,"k"===c.AF?(B=c,v=""===o.Z5?1b.BT("v")[0]:1b.BK(o.Z5)||1b.BT("v")[0]):"v"===c.AF&&(v=c,B=""===o.Z5?1b.BT("k")[0]:1b.BK(o.Z5)||1b.BT("k")[0]),l=0,r=o.F6.1f;l<r;l++)E=g(B,o.F6[l][0]),b=v.AX(o.F6[l][1]),n.1h([E,b]),d+=E,f+=b;if(d/=n.1f,f/=n.1f,n.1f>=3){if(n[0].2M("/")!==n[n.1f-1].2M("/")&&n.1h([n[0][0],n[0][1]]),c.A.AJ["3d"])1j(c.A.NB(),t=0,i=n.1f;t<i;t++)a=1m CA(c.A,n[t][0]-ZC.AL.DZ,n[t][1]-ZC.AL.E0,ZC.AL.FS),n[t][0]=a.E8[0],n[t][1]=a.E8[1];(h=1m DR(o.A)).K=c.K+"-1R-"+o.L,h.Z=h.C6=c.H.2Q()?c.H.mc():ZC.AK(u),h.1S(o),h.AZ=0,h.AQ=0,h.EV=0,h.G8=0,h.D=n,h.1q(),h.1t()}}1u if("1w"===o.AF){if(-1!==c.BD.1L(ZC.1b[50])?1===o.F6.1f?s=C=g(c,o.F6[0]):2===o.F6.1f&&(s=g(c,o.F6[0]),C=g(c,o.F6[1])):-1!==c.BD.1L(ZC.1b[51])&&(1===o.F6.1f?s=C=g(c,o.F6[0]):2===o.F6.1f&&(s=g(c,o.F6[0]),C=g(c,o.F6[1]))),-1!==c.BD.1L(ZC.1b[50])&&c.D8||-1!==c.BD.1L(ZC.1b[51])&&!c.D8?(n.1h([c.iX+o.A6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t},E7.yd=1n(e,t,i,a){1a n=(e/=a)*e;1l t+i*(n*e+-3*n+3*e)},E7.wL=1n(e,t,i,a){1a n=(e/=a)*e,l=n*e;1l t+i*(l*n+-5*n*n+10*l+-10*n+5*e)},E7.RQ=[E7.9w,E7.wr,E7.wC,E7.wD,E7.wL,E7.yd],ZC.b5={15f:15e,15d:5I,15c:0,15b:1,15a:2,159:3,158:4,157:5,156:0,155:1,154:2,153:3,15w:1,15h:2,15x:3,15P:4,163:5,162:6,161:7,15Z:8,15Y:9,15X:10,15W:11,15V:12,17d:13,15O:2,15z:3,15N:4,15M:5};1O PN 2j aA{2G(e){1D();1a t=1g;t.C=e,t.S0=!1,t.C4=1c,t.P8=[],t.PP={},t.lC=1c}pk(e,t){1a i=1g;1c===ZC.1d(i.PP[e.BD])&&(i.PP[e.BD]=e,e.M4=i,i.S0||(1c!==ZC.1d(t)&&t>0?2u.5E(1n(){i.4c()},t+1):i.4c()))}2P(e){1a t=1g;e.M4=t,e.XN>0?(t.P8.1h(e),2u.5E(1n(){e.BZ.TY=!0,t.S0||t.4c()},e.XN+1)):(e.BZ.TY=!0,t.P8.1h(e),t.S0||t.4c())}4c(){1a e=1g;e.S0=!0,ZC.AO.C2("15J",e.C.A,{id:e.C.A.K,4y:e.C.K});1a t=!0;!1n i(){t||e.7i(),t=!1,e.S0&&(e.C4=2u.iN(i))}()}7i(){1a e,t=1g,i=0;if(t.S0){1j(1a a=0,n=t.P8.1f;a<n;a++)i+=t.P8[a].6T();if("3f"===t.C.H.AB)if(t.C.H.KC)1c!==ZC.1d(e=ZC.AK(t.C.K+"-4k-bl-c"))&&e.9q("2d").q2(t.C.iX,t.C.iY,t.C.I,t.C.F);1u 1j(a=0,n=t.C.AY.A7.1f;a<n;a++)1j(1a l=0;l<t.C.AY.A7[a].T2;l++)1c!==ZC.1d(e=ZC.AK(t.C.K+"-1B-"+a+"-bl-"+l+"-c"))&&e.9q("2d").q2(t.C.iX,t.C.iY,t.C.I,t.C.F);1j(a=0,n=t.P8.1f;a<n;a++)0===t.P8[a].7i()&&(t.P8[a].BZ.TY=!1);1j(1a r in t.PP)1j(t.PP[r].iW||(i+=1),a=0,n=t.PP[r].P8.1f;a<n;a++)t.PP[r].P8[a].XJ===t.PP[r].jr?0===t.PP[r].P8[a].7i()&&(t.PP[r].P8[a].BZ.TY=!1):"3f"===t.C.H.AB&&t.PP[r].P8[a].1t();0===i&&(t.PP={},t.P8=[],t.8P())}}8P(e){1c===ZC.1d(e)&&(e=!1);1a t,i=1g;if(e&&(i.15B=!0),2u.o5(i.C4),i.C.Y3(),i.C.QD=!1,ZC.AK(i.C.H.K)){i.C.JQ(),2u.5E(1n(){(t=ZC.AK(i.C.A.K+"-3e"))&&i.C.AY.HQ&&(-1===ZC.AT(["5g","9z","8m","8h","7j"],i.C.AF)&&1!==1o.qs||i.C.AY.HQ.3Z(1n(e,t){1l ZC.AO.N5(e)>ZC.AO.N5(t)?1:-1}),t.4o+=i.C.AY.HQ.2M(""))},33),i.C.qv(),i.S0=!1;1j(1a a=0,n=i.P8.1f;a<n;a++)i.P8[a].TG=1c;if(i.P8=[],i.PP={},e||ZC.AO.C2("18m",i.C.A,{id:i.C.A.K,4y:i.C.K}),1c!==ZC.1d(i.lC))4M{i.lC()}4K(l){}}}}PN.UG=33,1n(){1j(1a e=["ms","z9","7x","o"],t=0,i=e.1f;t<i&&!2u.iN;++t)2u.iN=2u.191||2u[e[t]+"18R"],2u.18X=2u.18k||2u[e[t]+"17L"]||2u[e[t]+"17E"];2u.iN||(2u.iN=1n(e){1l 2u.5E(e,PN.UG)}),2u.o5||(2u.o5=1n(e){2u.iO(e)})}(),1o.3t(1c,"f6",1n(e,t){1j(1a i,a,n=0,l=t[ZC.1b[16]].1f;n<l;n++)if(t[ZC.1b[16]][n].1J&&-1!==ZC.AT(["3P","1w","bR","1N","bQ","2V","5x","6b","92","88","ek","6U","7z"],t[ZC.1b[16]][n].1J)&&t[ZC.1b[16]][n].Cp){1a r=t[ZC.1b[16]][n];ZC.6x(r);1a o=r.Cp||{};ZC.6x(o);1a s,C,A,Z=ZC.IL(o.kW||"10%"),c=o.17n||{1E:"17l"},p=o.d8||{},u=o[ZC.1b[8]]||"0.3",h=r[ZC.1b[11]]||[],1b=[];if("3P"===t[ZC.1b[16]][n].1J){1a d=0;1j(i=0;i<h.1f;i++)h[i][ZC.1b[5]]&&1c!==ZC.1d(h[i][ZC.1b[5]][0])&&(d+=h[i][ZC.1b[5]][0]);Z>0&&Z<1&&(Z*=d),s=[].4A(h);1a f=0,g="";1j(C=1,i=h.1f-1;i>=0;i--)h[i][ZC.1b[5]]&&1c!==ZC.1d(h[i][ZC.1b[5]][0])&&h[i][ZC.1b[5]][0]<Z&&(f+=h[i][ZC.1b[5]][0],g+=(h[i].1E||"z2 no."+C)+":"+h[i][ZC.1b[5]][0]+"<br>",h[i][ZC.1b[8]]=u,1b.1h(h[i]),h.6u(i,1),C++);f>0&&(C>2?(A={6p:[f],sA:!1,"1U-6d":[1],"2H-1E":g=g.2x(0,g.1f-4)},ZC.2E(c,A),h.1h(A),1o.3t(e.id,"v6",1n(t){if(t.iR.6d){1a i=1o.7d(t.id);if(!i)1l;1a a=1o.tC(i,t.4y);1j(1a n in a.tF())"3P-fA-"===n.2x(0,8)&&a.4l(n,1c);1o.3n(e.id,"eB",{1U:1b}),2u.5E(1n(){1a t=1o.3n(e.id,"sy",{4j:"2r",3W:0,5W:0}),i={id:"tm",x:t.x,y:t.y,1E:"< sY",bi:"c",4U:"iw"};ZC.2E(p,i),1o.3n(e.id,"rs",{1J:"1H",1U:i})},1)}}),1o.3t(e.id,"yo",1n(t){if("tm"===t.1H.id){1a i=1o.7d(t.id);if(!i)1l;1a a=1o.tC(i,t.4y);1j(1a n in a.tF())"3P-fA-"===n.2x(0,8)&&a.4l(n,1c);1o.3n(e.id,"rR",{1J:"1H",id:"tm"}),1o.3n(e.id,"eB",{1U:h})}})):r[ZC.1b[11]]=[].4A(s))}1u{1a B=0,v=[];1j(i=0;i<h.1f;i++){if(v[i]=0,h[i][ZC.1b[5]]&&h[i][ZC.1b[5]].1f)1j(a=0;a<h[i][ZC.1b[5]].1f;a++)v[i]+=ZC.2l(h[i][ZC.1b[5]][a]);B=ZC.BN(B,v[i])}Z>0&&Z<1&&(Z*=B),s=[].4A(h);1a E=[],b=[];1j(C=1,i=h.1f-1;i>=0;i--)if(v[i]<Z){if(h[i][ZC.1b[5]]&&h[i][ZC.1b[5]].1f)1j(a=0;a<h[i][ZC.1b[5]].1f;a++)E[a]=ZC.1Y(E[a]||"0"),E[a]+=h[i][ZC.1b[5]][a],b[a]=b[a]||"",b[a]+=(h[i].1E||"z2 no."+C)+":"+h[i][ZC.1b[5]][a]+"<br>";1b.1h(h[i]),h.6u(i,1),C++}if(E.1f)if(C>2){1j(a=0;a<b.1f;a++)b[a]=b[a].2x(0,b[a].1f-4);A={6p:E,sA:!1,"1U-6d":[1],"1U-tt-1E":b,"2H-1E":"%1U-tt-1E"},ZC.2E(c,A),h.1h(A),1o.3t(e.id,"v6",1n(t){if(t.iR.6d){if(!1o.7d(t.id))1l;1o.3n(e.id,"eB",{1U:1b}),2u.5E(1n(){1a t=1o.3n(e.id,"sy",{4j:"2v"}),i={id:"rQ",x:t.x+t.1s/2,y:t.y,1E:"< sY",bi:"c",4U:"iw"};ZC.2E(p,i),1o.3n(e.id,"rs",{1J:"1H",1U:i})},1)}}),1o.3t(e.id,"yo",1n(t){if("rQ"===t.1H.id){if(!1o.7d(t.id))1l;1o.3n(e.id,"rR",{1J:"1H",id:"rQ"}),1o.3n(e.id,"eB",{1U:h})}})}1u r[ZC.1b[11]]=[].4A(s)}}1l t});',62,4406,'||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||var|_|null|_n_||length|this|push|case|for|_i_|return|new|function|zingchart|break|parse|color|width|paint|else|top|line||typeof|scale|Math|plot|append|super|text|replace|border|label|style|type|left|indexOf|height|area|class|item|switch|marker|copy|background|data|value|legend|max|_f_|scroll|||||||||||offset|none|bottom||size|angle|document|visible|guide|extends|min|_a_|360|alpha|split|cls|default|node|font|_b_|window|plotarea|load|substring|margin|right|preview|menu|items||_cp_|svg|constructor|tooltip|setup|objects|mobile|position|join|hover|css|add|usc|path|shape|fff|solid|bar|points|target|graph|index|||||||||||log|string|appendChild||map|canvas|JSON|page|auto|clear|fill|unbind|abs|exec|move|opacity|handle|remove|body|bind|MAX|clip|padding|align|layout|scales|circle|MAPTX|div||instanceof|box|zoom|center|click|DEV|shadow|vml|Array|display|handler|pie|ref|url|attr|update|255|270|plotindex|state|main|sort||||tick|||round||||enabled|stroke|start|html|image|cache|live|ceil|die|object|plots|setAttribute|show|floor|innerHTML|xmax|xmin|bugreport|all|delete|000|call|_x_|toFixed|graphid|poly|concat|SCALE|assign_a|mode|absolute|SKIP|touchstart|json|form|999|catch|error|try|viewsource|dynamic|mask|minor|out|enable|Number|cursor|createElement|maps|src|history|plotid|||||||||||spline|stringify|gradient|hide|imgfill|each|bubble|GESTURE|gui|normal|pow|_l_|front|prototype|row|inherit|rect|2px|ymax|ymin|depth|RegExp|substr|vbar|sqrt|parseInt|range|date|opposite|format|setTimeout|custom|transform|callback|1e3|toUpperCase|getNodeData|short|title|piano|fullscreen|inner|String|header|img|parseFloat|highlight|touchend|nodeindex|shapes|test|GUIDES|||||||||||build|hbar|shared|group|m_|placement|pool|touchmove|end|from|decimals|mouseup|_e|total|context|values|layer|parentNode|middle|table|splice|scatter|info|_todash_|arc|bold|hbubble|about|mousedown|repeat|order|print|loader|9999|callout|browser|active|paint_|fontSize|fontWeight|csv|00|fontFamily|ie67|preventDefault|status|vbar3d|distance|palette|off|translate|mouseover|||||trend||plotidx|aspect|outer|weight|pie3d|source|221F1F|getLoader|factor|override|ddd|http|step|radar|childNodes|init|hook|goal|fixed|touches|important|api|javascript|eval|slice|eachfn|close|webkit|nodeidx|hbar3d|zcv|span|arrow|mouseout|zoomx|oRE|aAutoFit|stack|true3d|item_|sFontWeight|href|button|flat|progress|D1D3D4|_c_|zoomy|last|getToggleAction|className|xls|trigger|isNaN|stock|1px|sum|subtitle|location|mousemove|cnt||tagName||area3d|ccc|getPMap|key|negation|hasOwnProperty|5px|action|exit|hbullet|percent|CSV|plus|npv|vbullet|pointer|void|hscatter|zidx|1e4|entry|send|fast|export|space|nbsp|animation|gauge|static|01|www|name|oPS|separator|diff|radial|333|images|block|val|_p_|pattern|zoomTo|stop|initcb|number|oPPI|after|navigator|kmin|connector|hidden|58595B|nestedpie|||line3d|eee|column||kmax|quirks|arguments||blocker|adjust|light|float|Object|ring|which|dblclick|family|hideCM|cross|apply|zc_legend_mousescroll|square|coords|ready|getContext|reverse|DAY|crosshair|paintPreview|locate|linear|children|radius|mixed|vertical|rose|dragged|matrix|getTooltipPosition|EVENTS|side|pointsarea|mid|FONTFAMILY|zIndex|rgb|overflow|targetid|oMask|destroy|footer|EVENT|rgba|method|change|png|clearInterval|ticks|tolerance|select|angleEnd|Date|toggle|frame|pages|_tx_|msie|atan|getInstance|filled|10px|segmented|toString|mousewheel||hfunnel|mapPointsToPreview|zindex|element|equal|input|behaviors||rules|ajax|root|down|complete|||vfunnel|styles|SEC|MIN|COLORS|exponent|ZCClass|success|multiple|setAttributeNS|async|version|rtl|pyramid|chart|message|setdata|gear|tdim|mdim|toLowerCase|removeChild|params|pageX|graphset|A1F|rel|scrollLeft|scrollTop|selection|NODE_EV|mixed3d|transparent|skip|tools|flash|marker_|ANIMATION|venn|icon|dark|wait|pstack|render||user||direction||SKIPTRACKERS|anchor|flatten|oblique||italic|TOUCHEVENTS|ic_line|open|angleStart||single|IMAGES|lineHeight|getTime||ignore||Function|output|_boxoverlap2_|ctx|LN10|objmove|resize|pageY|A0B|iYVal|theme|256|decoration|idx|gshape|facet1|facet2|varea|vline|_INFO_|getAttribute|togglePreviewMasks|Resource|_fixed_|textarea|GET|safe|facet3|com|iXVal|datalength|feed|setNodeData|SEQ|V3D|rule|axis|ie678|clientX|intersect|A5L||utc|drawImage|bounds|uid|plotset||zooming||xy_|||dashstyle|lineWidth|horizontal||CanvasCache|userAgent|fillStyle|||bYX|labels|A1P|BUILDCODE|fontStyle|paddingTop|tab|goforward|goback|not|timezone|currency|Image|tween|zero|getElementById|A04|keys|refresh|666|Jan|Thu|setRequestHeader|textAlign|random|000000|nodes|classic|power|setupcb|reference|A7A9AC|defaults|fire|viewimage|back|force|cccccc|MON|vector||||fromCharCode|Data|bandwidth|clientY|continue|bBS|3dxy|day||visibility|selected|A2D|A2B|stepped|A3L|unit|addPMap|||sMaster|querySelector|getElementsByTagName|4px|average|touch|A8F|sampling|baseVal|AAP|OBJECTMODE|md5|interval|GMT|1970|A1K|forw|sin|cos|preserve|curtain|paddingRight|paddingBottom|paddingLeft|moveTo|updates|raw|A1L|labelid|414042|globalAlpha|textDecoration|8C8C8C|collapsed|AB1|false|arrows|_pageX_|watermark|opacity2|A3M||_int_|beforeSend|jpeg|FSID|swipe|bar3d|||highlightItem|dx1|dx2|xmlns|A4Z|A1N||org||bidi|sep|sTypeX|LEGEND|series|setseriesdata|hideprogresslogo|cone|generated|backgroundColor2|reload|CACHECANVASTEXT|backgroundColor1|borderColor|borderWidth|month|cwidth|aBandWidths|A3D|setInterval|zoomin|A0H|A4Y|dotted|long|charAt|bIsBottom|A1Z|styleSheets|margins|A0L|license|zoomout|submit|download|application|dataparse|onreadystatechange|readyState|progression||found|jsonsource|originalsource|||IMG404|checked|VERSION|A0F|charCodeAt||dashdot||overscroll||dist|A5N||i18n|A09|head||||A3R|sel|widgets|nodeType|wrapper|viewall|A3T|pdf|A69|_end_|dashed|intxy|before|inactive|300|bullet|isFinite|lon|lat|xtype|1800|getstyle|ratio|rectangle|DOMMouseScroll|A59|point|A61|rotate|labelindex|onmouseout|onmouseover|getComputedStyle|SKIPMAPS|A63|z3d|headers|REFRESH_TICK|documentElement||contextmenu||clearPreview|A5F|encodeURIComponent||getElementsByClassName|smart|A2T|segment|parentElement|zcrandom|count|modal|3e6c7b|query|DEFAULT|A08|A45|A48|onload|XMLHttpRequest|1024|A2H|first|A56|AJAXEXPORT|totals|CSS|A2M|A07|A2Q|A6B|A2R|flags|b2D|exitfullscreen|A1C|A11|showguide|1e6|NULL|FONTSIZE|3dfacet|A1R|A4C|A1G|A5V|modules|LOCALSVGEXPORT|facet5|A9O|facet4|dataurl|zc_loader_mousewheel|AEZ|hmixed|nodekeyvalue|A2P|Close|events|ZingChart|onmousemove||A0S|nodata|insertBefore|addColorStop|goals|underline|ll_|A2N|0px|stroked|CANVASTEXT|setAnchor||A05||A9M|A9N|_r_|true|A1E|ctrlKey|A2V|GUIDE_EV|xydistance|_pageY_|clearGuide|_ang_|infotype|NODE_EV_CHART|html5|colors|Top|Bottom|Left|bRTL|legendminimize|getdata|lineTo|websockets|05|A1I|URL|protocol|post|titles|gap|storage|locale|A47|timeout|View|A4I|save|data_|callEvent|hasEvent|LICENSE||previewscale|A68||||keyvalue|setScrollingFlag||sTypeE|A7I|collapse|restore||shapeindex|shapeid|ZCOUTPUT|Right|||fit|lcoords|hand|alignment|minute|CDCDCD|aperture|A4B|cleanTouchEvents|dim|lstep|getBoundingClientRect|multiplier|MAX_VALUE|A1J|bNormalize|A0V|normalize|A4J|requestAnimFrame|clearTimeout|A2U|overlap|xdata|lineColor|applyJsRuleSvg|A3X|A5A|A3Y||||PATTERNS|A50|addEventListener|36e5|A9V|A1O|ffffff|ABF|A8G|getSize|A88|stopfeed|A54|pull||item_title|minimize|A8Q|_h_|_append_|_hex2rgb_|onerror|A3P|A22|A0U|A0T|A3E|A5O||A9Y|cancel|A2Z|A01|defaultView|cloneNode|A0P|DOMFRAGMENTS|clientLeft|clientTop|opera|parser|AA7|tap|pinch|objtype|_nfind_|A72|A75|EQUIV|offsetX|929497|A35|global|lowlevel|year|TOUCHZOOM|trapeze|595959|ActiveXObject|offsetY|undefined|TTLOCK|parsecb|zcoutput|isBold|vboxid|A7P|A4E|A2A|A13|_txp_|reset|transport|250|full|getFormatValue||A5U|A4D|A40|A1Y|currentStyle|palatte||A42|BLANK|bars|foreignObject|nulls|A66|A5I||connect||filter|ruler|Blob|contour|xml|toDataURL|A8C|evalFn|months|xlink|base64|ABU|iframe|THEME|sharedZScale|A4U|applyRGBA|stream|Series|A44|A0X|bPoly|exec_flash|oNode_|A27|A1W|threshold|A5T|A70|hasData|A12|A57|A36|parseLayout|A2E|A10|clientWidth|acos|A6U|A0O|A0N|lin||CACHESELECTION||PLOTSHLAYER|A1B||A46|plotdata|A21|nowrap|Download|A31|A78|A2C|A3O||markerbg||A5D|yall|PLOTSTATS|xall|oMap|relative|FSSTATUS|A37|onStop|A4Q|filename|A30|ANIMATION_|exportdata|days|369|A62|hour|A5G|setLineDash|A34|A0R|mini|A5Z|borderRight|bBind|5625|disableanimation|borderLeft|showhide|A1V|marginLeft|marginTop|A51|disabled|coord|AAB|A3N|attachEvent|blocked|PARSE3D|set|A2Y|wh_||AA0||extendAPI|A41|alignPosition|tip|A2S|_image|||A0W|A8B||defs|025||500|A00|empty|A32|textprint|65535|A4F|LICENSEKEY|A52|BODY|bound|A0Q|A02|setupPlotArea|fixPlacement|NODE_EV_TYPE|color2|A1Q|A0Y|Lucida|smooth|zc_guide_touchend|match|second|MAPSONBOTTOM|A03|aMDXY|ABD|A4A|A4T|col|A25|hideguide|A0Z|A8E|A1T|AA2|calculate|strokeStyle|thousands|butt|A20|closePath|A5W|A1S|A9R|||beginPath|A1X|serif|exact|downloadFile|A4S|mimeTypes|A6T|marginBottom||trackers|dot|setupDynamicPlotArea|iDragPos||focusposition|mso|atan2|exportdataurl|A19|stacked|nextSibling|AC8|A2K|A5P|autoFit|AB5|miter|A4O|A4M|Submit|marginRight|Your|en_us|sans|dash|asin|A3F|viewdatatable|dasharray|AA5|utf|run|AAA|Page|speed|A67|A2W|jpg|paintCANVASText|_sh_|465|clearAnimFrame|_oCtxNode|verticalAlign|charset|columns|bgc1|globalCompositeOperation|A4K|hidedatatable|||createObjectURL|A0E|ABR|oldcursor|2048|1999|A81||A8Y|bKeyWidth|GUIDETIMEOUT|AA1|bgc2||showZCAbout|A55|exportimageurl|fillText|A6M|A6I|AC5|createDocumentFragment|caption|ring3d|STACKINGLOGIC|A2F|CHECKDECIMALS|get|AAG|next|AB0|onloadend|xObj|200|stops|textContent|2e3|A93|sAlign|toggleMasks|menuid|A5X|A8P|vrange|A5E|ABA|A94|ACC|webstorage|AAO|office|zc_legend_mouseover|A4P|A3S|A90|AAC|A91|AC6|_POOL_|A6Y||wrapped|A5K|AA4|minvalue|e1eaec|A5J|A17||dataType|maxvalue|99999|WebSocket|A6P|AAM||AC0||loadModules||A7W|l_|F0F1F1|A0I|zc_legend_mouseout|A0K|A18|shader|676667|AB2|A16|D1D2D3|A0D|load_|A7X|s_|KEEPSOURCE|rotation|FFF|HTMLMODE|7CA82B|ABI|A96|kv_|A5S|clearLabelBoxes|ZINDEX|A5M|funnel|score|clearRect|MEDIARULES|polar|A6S|_width_|paintHistory|sync|file|null3d||A3G|A5R||GRAPHID|A97|AAN|C6C6C6|clear_|setseriesvalues|email|hideLayer_|A3Z|A2L|A6K|A6O|COPYDATA|SORTTRACKERS|mapshape|EDITSOURCE|A26|modify|ASYNC_TICK|useMap|scrollTo|A23|A3K|backgroundPosition|A3A|initObjectsLayers|startfeed|A7H|AB6|setmode|A4W|AEJ|ABS|1e9|_blank|deselect|ABZ|setScalesInfo|media|chkcapture|A28|SYNTAX|toggling|zoomto|RESOURCES|NOABOUT|A2G|legend_toggle_action|||chkdata|ABO|A1A|reorder|AB7|A1U|600|A0A||microsoft|||A2I|SPREADTYPE|zc_loader_touchstart_static|offsetWidth|A4X|Show||17px|customprogresslogo|logo|offsetHeight|Sans|customprogresstext|addobject||AAZ||dummy|||clearGenerated|cssFloat|A0C|A4R|styleFloat|A2J|A0G|getPropertyValue|A15|_nice_number_|02|SMARTDATELABELS|formats|_unbind_|AG5|A9W|unicode|navxy_btnback|removeobject|ABN|minus|changedTouches|pan|pointserror|mathpoints|A7S|positioninfo|||AC2|AC4|AEO|thickness|lbltype|yzoomed|xzoomed|ydist|_oMarker|xdist|JavaScript|ABC||msecond|AGC||14px|A53|||hasPassive|AAY|USERCSS|A7O|passive|over|A65||A8S||extension|8px|getobjectinfo||detach|dots|A5Y|Custom|schemas|A6V|appendToValueBox|srcElement|chars|bandspace|400|005|A6L|zcvml|low|A39|A3H|high|CMZINDEX|A4L|_window_onunload_|TIMEOUT|runtimeStyle|DEBOUNCESPEED|Back|statusText|AA6|fullscreenmode|A7Z|A6Q|areanode|_iX|A9K|A9T|resource|_cpa_|A14||A9Q|||hamburger|A5H||A60|AG0|A4N||navpie_btnback|polypoints||createPreviewMasks|viewasjpg||||A92|A2X|A84|||octet|b3D|oP0|getGraph|DownloadXLS|cylinder|getAttributes|A3C|A29|A3U|A6W|menuitemid|Loading|switchtolin|disablepagescroll|EXPORTURL|switchtolog|A6X|viewaspng|Wait|A6R|enablepagescroll|skipfs|switchto3d|A38|switchto2d|oPlot_|borderBottom|ABV|A7M|Guide|joined|backgroundColor|A6N|description|urn|sMetaType|bNpv|adj|ABB|About||A7T|26784e5|A6H|215|dataload|addRule|316224e5|createPattern|fillAngle|plot0||dominantBaseline|shockwave|dateformat||responseText|vb_|mapItem|size2|IGNORESUBUNIT|CHARTS|AAF|tile|childof|1089B3|legendmaximize|A8M|ACQ|LinScale|AC1|96C245|LogScale|e6e6e6|PageScroll|ABH|LITE|ABT|A7Q|A9A|12px|plot1|createRadialGradient|createLinearGradient|864e5|aaa|ACK|ABP|||||plot2|ShockwaveFlash|plot_click|bbox|IMG|f0f0f0|A6G||b6c8cf|getFullYear||A83|SwitchTo2D|SwitchTo3D|A89|FullScreen|paired||BugReport|ranged|star|clipPath|pop|flexible|guide_mouseout||layers||face|A8T|themesloaded|strong|ViewSource|lineCap|_title|svg0html|bKeep|heatmap|A6C|whiteSpace|rLen|1AB6E3|900|contextMenu|tspan|A6J|Menu|facet|coordsize|coordorigin|f6f6f6|A7N|969696|ABL|blur|pos|uniform|POST|FASTWIDTH|asc|ABG||A86|ABQ|calloutPosition|getPlacementInfo|A64|LOGO_ABOUT||getlabelinfo|getshapeinfo|msg||quadraticCurveTo|AB8||candlestick|6B7075|csvParser|prev|365|standard|preserveAspectRatio|SKIPOBJCOUNT|paintMarker|backEaseOut||xmiabt|A79|marker_text_|THEMES|AAS|detached|zcgraph|persistent|pagination|elasticEaseOut|bounceEaseOut|detail|SPREADFACTOR|connected|ACI|downloadxls|borderTop|SKIPPROGRESS|strongEaseOut|fromAPI|LOOKUPCSSTRANSFORM|MAXPOOLSIZE|_height_|f90|A5B|downloadcsv|A7A|alphabetic|ExportData|2654435769|DownloadCSV|ACA|skv|AC9|||endangle|startangle|oval|A3J|SaveAsImageJPG|sigma|ACD|gradientradial|hPos|A6E|vPos||A9B|forced|A5C||AB9|ASYNC|ViewDataTable|textBaseline|userSpaceOnUse|ACJ|facets|A6Z|ACW|toStaticHTML|ipad|AC3|AD3|MSIE|blank||AD8|compat|guide_mousemove|parent|ACH|oP3|A7E|maxindex|minindex|A7L|2c4a59|29A2CC|D31E1E|A7R|AREA|A14BC9|limit|compatMode|265E96|AD0|A05F18|Reload|Print|clippath|3dtx|ACZ|EF8535|0123456789abcdef|||ACO|bubblepie|initial|xdiff|iphone|sTypeN|downloadsvg|downloadpdf|AAV|AAX|regularEaseOut||pageXOffset|pageYOffset|skip_objects_tracking||elementFromPoint|A7K|fold|doubleclick|A7B|label_click|oP1|1023||MODULESDEP|oP2|ACS|_parent|_top||ACG|MODULESDIR|localhost|Helvetica|getxyinfo|gear6|mirrored|ALIAS|ABW|Arial|globals|stopPropagation|A4V|scalevalue|viewDataTable|querySelectorAll|innerWidth|clientHeight|Scale|scalename|A9E|Full|A7U|A7V|A33|A7Y|Hide|A7J||Switch|Item|Screen|ZCVRangePlotSet|cluster|delay|vmin|effect|moz|quick|downloadCSV||animate||downloadXLS|encoding|monotone|minValue|maxValue|minValue_|ADB|maxValue_|excel|A87|A85|createElementNS|Zoom|addplot|999999|AAQ|removeplot|actions|modifyplot|setnodevalue|AAE||AAT|addnode|source_hide|removenode|Table|senddata|scaletext|DELAYEDTRACKERS|A8V|A8L|A5Q|A8I|A7F|A8A|A7D|A7C|A8N|nodevalue|bXY|A8W|ACM|A74|A82|A6D|keyup||||A73|||||||A9C|vmax|AD4|A99||Error|mon|ABE|Send|Bug|addmenuitem|paintTransformDate|meta||msSaveBlob|toggleabout|band|AD1|||thead|origin|week|dataexport|getModules|setModule|||||||||||||||||||scope|||||||||||ExcelWorksheet|||||||overlaps|11px|Email|mozilla||A9F|Name|WorksheetOptions|ExcelWorksheets|sec|ExcelWorkbook|you|FFFFFF|getOptimalDateInterval|AA3|bUrl|indicator|sizing|tbody|FF00FF|QUOTEDVALUES|001|SORTTOKENS|response|AAU|prop||||||||||||||||||||||||||||||||||||hint|linecolor|A8H|backgroundcolor|star5||triangle|diamond|options|errors|filetype|responseType|graphidx|shortcut|A9S|getimagedata|nav|numeric|ABY|ABX||2000|ABK|pathname|AAI|clicknode|showtooltip|||||||||||||||||||||||||||||||||||||May|imggen|UTF|crossOrigin||anonymous|A9G|A7G|trident|A80|INPUT|_rgb2hex_|AAJ|dyn|AAK|A98|onunload|PATTERN_|A8X|alert|A9I|ABJ|A8D|sortFaces|defaultsurl|confirm|||||||||||||||Scroll||||||||||||||||||||||A71|AAL|jumped|rawsource||Parsed|FORM|originalEventZC|tilt|behavior|AD7|hooks|A0M|RESIZESPEED|child|0x|FSZINDEX|shiftKey|event|white|AD9|A6F|A76|A9L|ownerNode|backgroundImage|||||||||||||||||||support||||||||||||||||||screen|infoemail|Opera|youremail||6e4|author|AAR|A9D|xb0|emailmandatory|ACU|ZCVRangeGraph|removeEventListener|A8R|Step|A9X|_rcolor_|AA9|yourcomment|AAH|VML|gif|sendcapture|A4H|checkbox|||||||||||A58||||||||||||||||||||||||||A9H|State|sBId|comment||A9J|A8O|6px|ownerDocument|AAW|330|jsondata|A8K|SKIPCONTEXTMENU||Original|setupValueBoxWH|A8J|onmessage|AAD|onopen|xWR15D1fqTyEALRVtLBrU|4XAMkpk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lpEDfssghz7uT7xrbnXCp2CyJSQLhe|graphs|La0dM88io1YD|P1EAsGUPZcSM03|dqKYwJd||sJeiZdgFxezwleaBUzwvA5n6UkuvPugJaqoIWSfS|ny5sogAHv4|||||||||||QQYK91VtUbjbmq8u4NNX2Q6zvNCuind1hPtMMot31k4MwB5iv0CylvaRXz6O3tO5VMGBLjozKUrDyVmw8szzFZwnEo5X1VA||||||||wTEATmQruIHqrjYrMQX05bnZ7kWZUYd2Fikjw2p6RJOCmTFgUow|||||||||||hfloatbar|||||||vfloatbar|00384A|R0lGODlhAQABAIAAAP|mUs6KHNRO7LazssfcSfmU|||DEBUG|09A9DA|iVBORw0KGgoAAAANSUhEUgAAAI0AAAA8CAYAAABbyDl1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAACGZJREFUeNrsXF9oFEccno2XRE1SI9ZQLcY0oIW21miQKoi5UPtiK7m|DGfGvEVBorFq3Wnhtx6Yqy9VxUZqqe0tfBMPEIF3FD|floatbar|dataready|writing||1GKhuWDrg7Z4|lILihGF6oueUH2w2pwFxT71gtonWy9SUJDEmKK0CvGikGtjg4mJ5p9xOt8mt5ndm93bTfaS3DkfLGxu525nZ779|YqcJkkaSwzGoqS3sUE9Lyj3yhmS6Uki4yNN7PFftH|svg0|8qbrzh3uZb2RgAeNY85a8dobWVLe40u8TgsEXDhEZJrHYnq46rTuS4XhK0nrW7uQmYw1lTTL5R4jFE|Charts|5yasb|b7vN6MKpZRISDhBlhwCCafwTLcO|c5UOj7E1Ts8BhC5zljv|textpath|RW9rdQ3KGBUxLYmGuHKG4nWk8aleqiz6XSFA5N|6D6E71||||||LpR||||||||m6yyJ||8txLDPrukmci|||keyCode||||||||||||vboxplot||FHY4MQWwxllcdiZClai09I7uPapDMHQ1dwFx3FORIcy11FYlHWRWKol0Tiavz8A||||SAvgCcGK8xwwI50SqLlQK6OSmTLrrKU|ACV|xhhvK|a0kBGIVqW7w5p||HideDataTable|wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw|HuIgKZX6X7wuUGhlOxoME4FvoO1RGZ88uT6XPKAOuCgxm0aK6|iVBORw0KGgoAAAANSUhEUgAAAJEAAAA1CAYAAABBVQnbAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABu1JREFUeNrsXLFy4zYQBW9UR7wfSHh1iqMn6S3NxLXlLp3lL5D1ARlLkw|qVNQN7LC0R1f2qsTFecq|Ap13G5Pl60VY2tP23ebFtYgiNlhaxARkSaLYL51a4ixsAdxXPjBJ7RsSalmz60Khpy7UVCuj9tWhHxUY41VVkEK0U92kvZ2oddI5kTsGqJTF2nsDOx0A9KlKEXhWeC4cDh5LqMtRpUVxDFLH4WRJ7pV8R2LUrPCjXUn00gXG0zZ|stcWCMb|boxplot|ACY|sFaLLx3XKTmuZ31RzkdyTnL0khU17vrf7Tm4iT5TJ0kTXHlc2iUEmBe3vSco1APRIVgiH9rX9XbSJxgQiIob4WUh3y0BNCEIEIhUFmlqACbOoTo0|ZoomIn|cSJtJZJwX8O959NvAUQkZDUkf8FGADBt38P1SQKxwAAAABJRU5ErkJggg|ZoomOut|JoRMu03lkd|ViewAll|innerText|link|b9MOl61q6el5VUkbl5r2vXKt|resources|XchRDsvhtTzeR|09Vczmfsf|||||||||||||||||||||||||||||||||||||AppIdentity|jsNorthNine|xST_SWRLyFKogwOclSB|SdgZUHWKDVQ||jRkihLOSfysvRQTBtQOUUO|XKoJJLnmLPUYiWUuQKAOGnuAIWrSN_ZIj_LYvS|fhx|zflags|Core|siKWwCkzRAy|Vm9CqRWkzcP7bffRMbChpuznstfMvyCHBN2fqno2RjVY2Phsbl|Jd3QAp9Q|7dLKj0u4UboHamBpK54HEm2lgisTwgbH78ucBtDG|1D7HmGKf99x|mp7POvaHfv04TPly95g0ROHNJ1Ohr7lzTc|vwaterfall|coWIi|NP0t0TXQLRA8CQR3QPta0|fo5HjhzDhip7IB2j91evC|XS3nq9ZiQkdaTF|hostname|LnFKxSTOo9DkvU2rLvBFpH2hcKgFpCI9d2JELujMQNsd5CRFdVWKRU2G|HOSTNAME|strict|5005onWQnHXM18l0kq|LZxDvXM||||||||||||||||||Q5G8dRWLio|||||||hFUVqR7S1l8G8QQJznxCUvX|||population||||||||20p2HvtBeK16w|pagescroll|2F8JpusDi3zMEzINF9Q|6FLlyk7dG3KlpaSYGCr2sa7bTe1e02977rVJPCpz7R||dA4L48Qhg5heiRpTG6|4YZrNHz1GonGOsYcTkEe8W9YT3wVaxSr|3iet|epSuudpRmrP2rclZFf1zG7cIMfzS6zh9SuAyLfJE|G49I2399oJuNwtCxx4OksJshWZCNDEQnYqIMymkgYZJFxgJs5gFkEBxDikrmKF91jVE1ZTFR6L9rQOkZKZCrdKVtNxOQl6aiF5GGMoTpnpBNgm9PUvYd19RNtMz2WpU6h6VPIG7|Mr3cMfUhWN83PYpfQ6W|vjr5wKFyz9|iFDTf4|wHBB4N651NqL6UGinMV9l0tQsFtOXVkcGK4H0uBwucLPhigzT0vSLT|O3FaQ|i5CcR1RvRAp3VpUL4qt9AJMyMDznvcPkoxEZZ5uZ5iw9AWPm41ihhTB1TWPJIvdeJP3KZbrBr9wVnn20IMTBrkDka|hdDFeefOUPthvBZqH6TR0X6hDUge7hiiIZZWu5jebXg8rAr0aB9|wWjRZKI7TbgLtHD|populationpyramid|03rqqtR|IvQ40ajd|3WsoVJfz1EIiG6|EJLl0khmPDSKBJa8fkP70KLNtrxt5pE2yjx|2fH|tA1g0W0k7AKV1g1ouow1nG|hwaterfall||||hpxK6BeHRUtuasojuRTPFQYdzNGN57nxLviTf1hV4lwaFjtbv||||||||||||||||||7PVG0KjUnLRqnRSPOeqf6gu||QrFO8i|||||||||||||DzfVs2U6u|UmnVcu533TixhgnyNRM0dgQgplGsPAkzYXwPzOzZnC7X81FBps0ln7DE4j7FFz7lhGSYWZ0CxLkF6pdEiin27WykHHILXKaLTuPRmQGAoidX8LoScOsD145xJQUVRD|WELTcgScyGV0BiDqCG6wCyBa0rRQdEZC7sxaxri1ckNggRYKcr6A|91MI7WR9j||7m5HGtU7wZOAJBD0jiSLTk0SmRZqSolWkkmyzlZ4kpKaZMsttpXFkapKWe1waR0JqGolMT09yGUHCMWkkJGR6kpCkkZCkkZCkkZCkkZCQpJGQpJGQpJF4yUnj|execFn|PNDI1Tbf0BMJcuX1C2LA5Wq|Z5lqa6GmMaJ3ovBAinRfPjKajajJvo5|gEVkGqUcFnmWmB876F18Vzb5KmaijbjDAAiZ8k|jIo2dCfd9c1BIrIoVy0ho7y7t|ZRanRwIAeIoYKRkpGDIoV2G3ita8dB5x7Z9xlp1NMsJ4S5de|SaveAsImagePNG|2OGzTacUP7|ZDnzAMIzyhNVVTYKAAorAHTVgHL5pHOS|hQWw6ePX6Nd|ZlVA4tExPxYQAQubERqJBDtSu6hfYb2k0isoX2ztWoke06s6woRayLWJCQ5kkhIyBKR7FQIRCQEIpJjCPFn|sHpv2CQbwcaz686qLg7mNWoOJJY|9b5FpaWogBlGlnahdp7f|waterfall|uiGel5TWZcS4vAaRk1P7VGWotrU85wFi0nOwhLtmtQ4UtMkaJjEa20agaTGkZpGIlPS0|Gly8ldqZxWOBc41UBB9q8UPEmcr54GRIXwBXn|Tj7zU0|DownloadPDF|2UJYM4scG7|DownloadSVG||||||||||||||||||||||||||||WBJjiPWRH11|||||||||o2iVTBMSKhQr9|OFFSET|hboxplot|ADJ||jxVuWAXwZANAz5HirKR|SwpRBHeB1YixfuVRG1TmnSxwWyN0IJS7c9S8PojwWgDREblQFpIiZPi|gLMilDUMgAYigZUm7MzAliiDBxcPu2|iz8B4ZeKmmw8MwBobcSg7iaSoz3|aCdvBK|MbWyNGzvXcSgKYaAL21h6hpRb5JFSiEliszxIjHVE6l798cAShQAChBIt7N8klnbQ|textpathok|HfEu|syv7||3bCP3jl|isOXJyUK|Edgdh2omT9RRXE1hZAfaQYvmbx|AB3|ZZAmsQUXYwbyUHTR67kghQvnYMIk4k3OwKQS|ext|modulesready|hole|QWiu3TW1Sqk65M5ukh9vPzAUV|Oh5wrVCj0J88z3EvzDH9HlrWwe08awtzc2YcdEiTaSphVZu|tOmLlc9nc9||||||||||||||||C0usUJLOMetQOYTOFYVPe0KRHcl7nAGK98k8k0dUIKCXNemIq0SK1RF4LK8iEXIbCMzAUCi37flOJ8UUWGCoLNRctAQiBLrHioLkbvAIswP0CoHtcFcF0Sg6FEFgNIGAeSSg8RbWhZ5ctuW|||||||||||||||||||||mfBxXECbZeDYIpPe0riMsGKim8qBXMDEFy4hQv6tighD|qO24SRzRMfZFbXj5bHUSrAAdVHa9l97qfWF6|QCaCakp9pTZyfMoNovPssYMjT3DNPI4|nStrlng4Cu||aOD4pDDnRmYlAXLhs4BOdIy0ki8zEjZ2hPSkVmEqZiXSyJri|5vv5VEjcQJ|AD5|vstream|SaveAsImage|MaEpYHUNl1tWbF|373897302|sFPIO77cUufurMOB4iEfoGsPNDGag0qacrn1t345|Has|Capture|Graph|HTML|Report|Message|Occured|Exporting|contentDocument|December|November|October|September|||||||||||||||||||||||||||August||||||||||July|Comment|Address|April||bug|clearLayer|Apply|nThank|sent|was|report|Cancel|want|mandatory|address|problem|your|reply|via|receive|June|March|initThemes|polygon|Wednesday|||||||||||||||||||||||||||||||||||||Tuesday|Monday|Sunday|Sat||Fri|Wed|Friday|Tue|Mon|unicodeBidi|Sun|Forward|Exit|STRONG|Thursday|Saturday|HEAD|Nov|createEvent|February|TouchEvent|January|ontouchstart|Dec|Oct|Feb||||||||||||||||||||||||||||||||||||Sep|Aug|Jul|Jun||Apr|Mar|originalEvent|getGraphInfo|defineModule|Log|800080|PINK|FFC0CB|unbinddocument|setpage|getpage|PURPLE|set3dview|ORANGE|get3dview|getversion|RED|showversion|getcharttype|toggleplot||||||||||||||||||||||||||||||FFA500|||||||000080|togglesource|00FF00|logBase||offsetEnd|offsetStart|4B0082|stepSize|LIME|step_|NAVY|datetime|MAGENTA|MAROON|800000|getscaleinfo|getbubblesize|clearscroll|togglebugreport|showplot|plugin|fireEvent|hidemenu|EE82EE|showmenu|||||||||||||||WHITE||||||||||||||||history_forward||||||history_back|formatNumber|beforedestroy|YELLOW||FFFF00|formatDate|textbox|getObject|contentWindow|getPalette|zcdestroy|VIOLET|plotshow||hideplot|FF0000|showhoverstate|SILVER|unlocktooltip|locktooltip|hidetooltip|plothide|getrender|C0C0C0|TURQUOISE||||||||||||||||||||||mapdata|||||||40E0D0||||||||openmodal|closemodal|disable|innerHeight||Linear|refAngle|530742520|1416354905|1126891415|271733879|1732584194|198630844|995338651|271733878|1700485571|680876936|389564586|606105819|1044525330|176418897|421815835|57434055|1894986606|640364487|718787259|||||||||2097151|||||||||||||240|||||||||plugins||||||clipart|ADH|343485551|1120210379||1051523|145523070|1309151649|1560198380|1732584193|30611744|1873313359|2054922799|1200080426|1473231341|480|1444681467|1926607734|1236535329|165796510|1735328473|1069501632|51403784|1163531501|378558|187363961|||||1019803690|||||||||||||||||||643717713||||||||||||568446438|405537848|660478335|38016083|1502002290||2022574463|76029189|1958414417|45705983|722521979|358537222|1770035416|681279174|1094730640|42063|1839030562|1990404162|155497632|1804603682|1272893353|40341101|1530992060|35309556|9998|640|Source|||||||||||compatible|MAP|||||||||||||||||||||||||detachEvent|cssText|createStyleSheet|namespaces||_list_|13px|bgcolor|30px|inline|returnValue|3px|spacing|cancelBubble|parentWindow|csvdata|27px|PDF|filters|All|Out|Export|XLS|SVG|JPG|offsetLeft|||||||||||||||||||||||||||||||||PNG||Chart||pixelLeft|Disable|Enable|offsetTop||control|letter|outset|Unicode|56320|AD6|ADG|55296|setLabel|setlabel|56319|57343|ACX|render_flash|65536|userdef|2047|Ext|224|Grande|ADE||panning|||||||||||||||||||||||||||||||||||20px|With|60px|Microsoft||80px||XMLHTTP|003C4F|Requested|Content|docked|pixmap|khtml|urlencoded|container|AG6|insertRule|scrollHeight||INDIGO|008000|ZXwTNiuycKjVg6UAnU1DK2x3Wc9SQUwZijotArVk4Kk4qU5mRF3NHLUJ5HzPoAy417o6|gear4|gear8|gear7||||||||||||||||||||||0392bb|a62b02|||||gear5|ef4810|cc3300|00b0e1||b79007|f9c332|gear3|da9b04|563d02|rpoly|gear9|007fa3|rpoly8|droplet|getImageData|E80C60|both|E2D51A|tan|9B26AF|bite|ellipse|flow|FB301E|00AE4D|20398B|6a921f|a7da47|89b92e|rpoly9|rpoly7|Network|0D457D|D66C1C|ic_bars|8832B0|ic_area|parallelogram|874600|trapezoid|star4|52575C|BBBBBB|808285|DCDCDC|222222|composite|small|star3|638F12|rpoly6|star9|84680a|6e4503|rpoly5|rpoly4|0b32a0|rpoly3|4d62b1|star6|star8||1540a0|edf3f5||star7||00bbf1|05a0cd|BA0505|00BAF2|putImageData|125px|CSS1Compat|feature|BasicStructure|vml_flag1|enabledPlugin|appVersion|Mac|ACT|hasFeature|Mobile|BlackBerry|Mini|PPC|rectShortcut|Windows|SVG11|bolder|calloutOffset|vml0|fillcolor|IBG7ZbjiyQo9iuVCa1v99GggSadJXi70rlyWQBc5wRfXX4xbsoje3ZGThb9LcDL8Sj2UF4xYKOxvCXXdPaalnYh0J2x5Cl4qgc|RaJXhS6LycpIqpftZkRJhMO572|1Ej7LVT54f1LOOmMYlxWO50RTCw1Zk7YE7L6XckMizSxLVN7alzJNmWTuwyDO3ZlZIVekmadI4858O0S5CuoGEkWSRpJKSmkUgX|AAC1LYqunMJ6bAAAAAElFTkSuQmCC|hosted|canvas0|700|0html|u2014|adapter|implementation|lock|wrap|800|calloutExtension|calloutHeight|preservezoom|patternUnits|gradientUnits|linearGradient|AEL|radialGradient|skip_context_menu|objectBoundingBox|skip_segment_tracking|viewBox|skip_marker_tracking|skip_interactivity|use_fast_mode||use_fast_markers||use_single_canvas|Modified|||||Since|AEK|use|calloutWidth|ACR|Android|iPad|iPhone|sessionStorage|calloutHook|AC7|borderRadiusBottomLeft|16777215|_inj_|decodeURIComponent|borderRadiusBottomRight|AED|borderRadiusTopRight|borderRadiusTopLeft|our|F7F8F8|414141|GREEN|legend_show|getMilliseconds|getDay|getDate|toggledimension|legendscroll|getMonth|299|getgraphlength|legend_maximize|587|legend_hide|_colorAlpha_|legend_minimize|togglelegend|getoriginaljson|getplotlength|BLACK|getUTCDate|getUTCMinutes|getUTCSeconds|getData|getUTCMilliseconds|getUTCDay|borderRadius|getUTCMonth|getscales|getUTCFullYear|getplotvalues|getnodevalue||getnodelength|getHours|getMinutes|||getSeconds|zc_|ignoreduplicates|setTime|FFD700|setcharttype|scalenumvalue|scalepos|FUCHSIA|scaleidx|GOLD|onviewport|addgraph|stackType|maxIndex_|minIndex_|maxIndex|minIndex|GRAY|808080|00FFFF|CYAN|appendseriesvalues|BROWN|getseriesvalues|appendseriesdata|getseriesdata|node_remove|BLUE|0000FF|node_add|A52A2A|removescalevalue|addscalevalue|setscalevalues|node_set|plot_modify|plot_remove|plot_add|getUTCHours|setData|6C6D70|linecap|acacac|701558691|b0b0b0|linejoin|b6b6b6|bcbcbc|c0c0c0|a6a6a6|c6c6c6|bezierCurveTo|d0d0d0|d6d6d6|dcdcdc||lineJoin|e0e0e0|VMLv|a0a0a0|ADF||pieAngleEnd|5a5a5a|lonlat2xy|312F30|offsetR|57585B|pieSlice|pieAngleStart|9c9c9c|objectId|ADC|negative|joinstyle|909090|endcap|miterlimit|ececec|fcfcfc|0x4000000000000|fillType|lineGapSize|lineSegmentSize|lineStyle|fillOffsetY|fillOffsetX|toExponential|backgroundScale|shadowAngle|backgroundFit|backgroundRepeat|1048576|1073741824|gradientStops|1099511627776|gradientColors|borderAlpha|firstChild|222|shadowColor|spark|69c|36393D|shadowBlur|0084AA|444|shadowAlpha|Module|Open|High|Low|AGL|script|loaded|shadowDistance|dimension|calloutType|Progression|984375|BY_PLOT_AND_NODE|BY_NODE|BY_PLOT|NO_SEQUENCE|REGULAR_EASE_OUT|STRONG_EASE_OUT|BOUNCE_EASE_OUT|ELASTIC_EASE_OUT|BACK_EASE_OUT|LINEAR|FAST|4e3|SLOW|625|EXPAND_VERTICAL|9375|7475|LINK|wheelDelta|08|2825|045|draggable|drag|legendheader|legendfooter|hmixed3d|gparse|ACN|FADE_IN|EXPAND_TOP|legendmarker|GROW|hover_image|bDead|node_|sticky|gcomplete|gload|scaleval|Metric|graphindex|animation_start|HideGuide|imges|UNFOLD|FLY_IN|EXPAND|EXPAND_BOTTOM|objectsinit|dimensions|facet99|viewport|stepsize|UNFOLD_HORIZONTAL|SLIDE_BOTTOM|SLIDE_TOP|SLIDE_RIGHT|SLIDE_LEFT|366|EXPAND_HORIZONTAL|EXPAND_RIGHT|EXPAND_LEFT|legenditem|crosshairy|getZCPoint3D|csize||shift|base|extra|master|refx|blended|refy|ACP|ADI|markers|sequence|attributes|632448e6|MIN_VALUE|plot_|share|desc|zoomToV|guideh|guidev|ff9900|pair|widths|2e4|3e4|6e5|12e5|scaling|18e5|RefNode|used|selections|crosshairx|while|noData|ACB|ACE|pper|feed_clear|pavg|psum|pxv|pmv|pxi|pmi|scrolly|scrollx|kvts|density|view|always|keyval|separate|359|setguide|2629743e3|animation_step|31556926e3||snap|stage|plotinfo|nodeinfo|resetguide|clustered|ADD|UNFOLD_VERTICAL|modifier|3dshape|feed_start|Section|clearselection|getselection|setselection|Others|menu_item_click|others|postzoom|getzoom|zoomtovalues|enctype|multipart|REC|section|html40|x3c|gte|DisplayGridlines|endif|x3e|Calibri|objectsready|cols|CancelRequestAnimationFrame|ProgId|content|Excel|Sheet|feed_stop|about_hide|CancelAnimationFrame|getinterval|ShowGuide|ExitFullScreen|GoBack|GoForward|feed_step|softclear|settweenmode|setobjectsmode|getobjectsbyclass|whisker|brightness|ohlc|repaintobjects||clearfeed|edge|Build|updateobject|4096|shape_|1500|setinterval|label_|feed_interval_modify|sm_|si_title|about_show|320|Built|si_|2009|Category|histogram|cancelAnimationFrame|nORIGINAL|animation_end|dataToCSV|vnd|downloadRAW|535|400px|scale_|source_show|210|barWidth|510|PARSED|shp_|saveasimage|lbl_|legend_|_click|IMAGE|COMMENT|EMAIL|WIDTH|HEIGHT|RENDER|RESOLUTION|END|submitreportH5|php|legend_mouseout|RECT|exportimage|readAsDataURL|RequestAnimationFrame|result|blob|forEach|CDATA|https|cancelAnimFrame|FileReader|webkitURL|legend_mouseover|requestAnimationFrame||rows'.split('|'),0,{}));} let ZC$1 = window.ZC; var EVENT_NAMES = [ 'about_hide', 'about_show', 'animation_end', 'animation_start', 'animation_step', 'beforedestroy', 'bugreport_hide', 'bugreport_show', 'click', 'complete', 'data_export', 'dataexport', 'dataload', 'dataparse', 'dataready', 'destroy', 'dimension_change', 'error', 'feed_clear', 'feed_interval_modify', 'feed_start', 'feed_stop', 'gcomplete', 'gload', 'gparse', 'guide_mousemove', 'guide_mouseout', 'guide_mouseout', 'heatmap.mousemove', 'history_back', 'history_forward', 'image_save', 'label_click', 'label_mousedown', 'label_mouseout', 'label_mouseover', 'label_mouseup', 'legend_hide', 'legend_item_click', 'legend_item_mousemove', 'legend_item_mouseout', 'legend_item_mouseout', 'legend_item_mouseover', 'legend_marker_click', 'legend_marker_click', 'legend_maximize', 'legend_minimize', 'legend_minimize_click', 'legend_pagination_click', 'legend_show', 'legend-drag_mousedown', 'lens_hide', 'lens_show', 'load', 'maps.zoom', 'menu_item_click', 'modify', 'modulesready', 'mousewheel', 'node_add', 'node_click', 'node_deselect', 'node_doubleclick', 'node_mousedown', 'node_mouseout', 'node_mouseover', 'node_mouseup', 'node_remove', 'node_select', 'node_set', 'objectsinit', 'objectsready', 'overscroll', 'plot_add', 'plot_click', 'plot_deselect', 'plot_doubleclick', 'plot_hide', 'plot_modify', 'plot_mouseout', 'plot_mouseover', 'plot_remove', 'plot_select', 'plot_show', 'postzoom', 'print', 'reload', 'render', 'resize', 'setdata', 'shape_click', 'shape_mousedown', 'shape_mouseout', 'shape_mouseover', 'shape_mouseup', 'source_hide', 'source_show', 'swipe', 'touchemove', 'touchend', 'touchstart', 'zingchart.plugins.selection-tool.mouseup', 'zingchart.plugins.selection-tool.selection', 'zoom' ]; var METHOD_NAMES = [ 'addgraph', 'addmenuitem', 'addnode', 'addnote', 'addobject', 'addplot', 'addrule', 'addscalevalue', 'appendseriesdata', 'appendseriesvalues', 'clearfeed', 'clearscroll', 'clearselection', 'clicknode', 'clicknode', 'closemodal', 'closemodal', 'destroy/zcdestroy', 'disable', 'downloadCSV', 'downloadRAW', 'downloadXLS', 'exitfullscreen', 'exportdata', 'exportimage', 'fullscreen', 'get3dview', 'getbubblesize', 'getcharttype', 'getdata', 'getgraphlength', 'getimagedata', 'getinterval', 'getnodelength', 'getnodevalue', 'getobjectinfo', 'getoriginaljson', 'getpage', 'getplotlength', 'getplotvalues', 'getrender', 'getrules', 'getscaleinfo', 'getscales', 'getseriesdata', 'getseriesdata', 'getseriesvalues', 'getversion', 'getxyinfo', 'goback', 'goforward', 'hideguide', 'hidemenu', 'hideplot/plothide', 'hidetooltip', 'legendmaximize', 'legendminimize', 'legendscroll', 'load', 'loadstorage', 'mapdata', 'mapdata', 'modify', 'modifyplot', 'openmodal', 'print', 'reload', 'removegraph', 'removenode', 'removenote', 'removeobject', 'removeplot', 'removerule', 'removescalevalue', 'repaintobjects', 'resize', 'saveasimage', 'set3dview', 'setcharttype', 'setdata', 'setguide', 'setinterval', 'setmode', 'setnodevalue', 'setpage', 'setscalevalues', 'setseriesdata', 'setseriesvalues', 'showhoverstate', 'showmenu', 'showplot/plotshow', 'showtooltip', 'startfeed', 'stopfeed', 'togglebugreport', 'toggledimension', 'togglelegend', 'toggleplot', 'unbinddocument', 'update', 'updatenote', 'updateobject', 'updaterule', 'viewDataTable', 'zoomin', 'zoomout', 'zoomto', 'zoomtovalues' ]; var MARKER_NAMES = [ 'square', 'parallelogram', 'trapezoid', 'circle', 'diamond', 'triangle', 'ellipse', 'star5', 'star6', 'star7', 'star8', 'rpoly5', 'rpoly6', 'rpoly7', 'rpoly8', 'gear5', 'gear6', 'gear7', 'gear8', 'pie', ]; var MISC = { DEFAULT_WIDTH: '100%', DEFAULT_HEIGHT: 480, }; const {DEFAULT_WIDTH, DEFAULT_HEIGHT} = MISC; var constants = { EVENT_NAMES, METHOD_NAMES, MARKER_NAMES, DEFAULT_WIDTH, DEFAULT_HEIGHT }; var classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; 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 inherits = function (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 possibleConstructorReturn = function (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; }; var DEFAULT_WIDTH$1 = constants.DEFAULT_WIDTH, DEFAULT_HEIGHT$1 = constants.DEFAULT_HEIGHT, EVENT_NAMES$1 = constants.EVENT_NAMES, METHOD_NAMES$1 = constants.METHOD_NAMES; // One time setup globally to handle all zingchart-react objects in the app space. if (!window.ZCReact) { window.ZCReact = { instances: {}, count: 0 }; } var ZingChart = function (_Component) { inherits(ZingChart, _Component); function ZingChart(props) { classCallCheck(this, ZingChart); var _this = possibleConstructorReturn(this, (ZingChart.__proto__ || Object.getPrototypeOf(ZingChart)).call(this, props)); _this.id = _this.props.id || 'zingchart-react-' + window.ZCReact.count++; // Bind all methods available to zingchart to be accessed via Refs. METHOD_NAMES$1.forEach(function (name) { _this[name] = function (args) { return window.zingchart.exec(_this.id, name, args); }; }); _this.state = { style: { height: _this.props.height || DEFAULT_HEIGHT$1, width: _this.props.width || DEFAULT_WIDTH$1 } }; return _this; } createClass(ZingChart, [{ key: 'render', value: function render() { return React.createElement('div', { id: this.id, style: this.state.style }); } }, { key: 'componentDidMount', value: function componentDidMount() { var _this2 = this; // Bind all events registered. Object.keys(this.props).forEach(function (eventName) { if (EVENT_NAMES$1.includes(eventName)) { // Filter through the provided events list, then register it to zingchart. window.zingchart.bind(_this2.id, eventName, function (result) { _this2.props[eventName](result); }); } }); this.renderChart(); } // Used to check the values being passed in to avoid unnecessary changes. }, { key: 'shouldComponentUpdate', value: function shouldComponentUpdate(nextProps) { // Data change if (JSON.stringify(nextProps.data) !== JSON.stringify(this.props.data)) { zingchart.exec(this.id, 'setdata', { data: nextProps.data }); // Series change } else if (JSON.stringify(nextProps.series) !== JSON.stringify(this.props.series)) { zingchart.exec(this.id, 'setseriesdata', { graphid: 0, plotindex: 0, data: nextProps.series }); // Resize } else if (nextProps.width !== this.props.width || nextProps.height !== this.props.height) { this.setState({ style: { width: nextProps.width || DEFAULT_WIDTH$1, height: nextProps.height || DEFAULT_HEIGHT$1 } }); zingchart.exec(this.id, 'resize', { width: nextProps.width || DEFAULT_WIDTH$1, height: nextProps.height || DEFAULT_HEIGHT$1 }); } // React should never re-render since ZingChart controls this component. return false; } }, { key: 'renderChart', value: function renderChart() { var renderObject = { id: this.id, width: this.props.width || DEFAULT_WIDTH$1, height: this.props.height || DEFAULT_HEIGHT$1, data: this.props.data }; if (this.props.series) { renderObject.data.series = this.props.series; } if (this.props.theme) { renderObject.defaults = this.props.theme; } zingchart.render(renderObject); } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { zingchart.exec(this.id, 'destroy'); } }]); return ZingChart; }(Component); var ZC$2 = window.ZC; export default ZingChart; export { ZC$2 as ZC }; //# sourceMappingURL=zingchart-react.es.js.map
ajax/libs/material-ui/4.9.4/es/OutlinedInput/OutlinedInput.js
cdnjs/cdnjs
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import { refType } from '@material-ui/utils'; import InputBase from '../InputBase'; import NotchedOutline from './NotchedOutline'; import withStyles from '../styles/withStyles'; export const styles = theme => { const borderColor = theme.palette.type === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'; return { /* Styles applied to the root element. */ root: { position: 'relative', borderRadius: theme.shape.borderRadius, '&:hover $notchedOutline': { borderColor: theme.palette.text.primary }, // Reset on touch devices, it doesn't add specificity '@media (hover: none)': { '&:hover $notchedOutline': { borderColor } }, '&$focused $notchedOutline': { borderColor: theme.palette.primary.main, borderWidth: 2 }, '&$error $notchedOutline': { borderColor: theme.palette.error.main }, '&$disabled $notchedOutline': { borderColor: theme.palette.action.disabled } }, /* Styles applied to the root element if the color is secondary. */ colorSecondary: { '&$focused $notchedOutline': { borderColor: theme.palette.secondary.main } }, /* Styles applied to the root element if the component is focused. */ focused: {}, /* Styles applied to the root element if `disabled={true}`. */ disabled: {}, /* Styles applied to the root element if `startAdornment` is provided. */ adornedStart: { paddingLeft: 14 }, /* Styles applied to the root element if `endAdornment` is provided. */ adornedEnd: { paddingRight: 14 }, /* Pseudo-class applied to the root element if `error={true}`. */ error: {}, /* Styles applied to the `input` element if `margin="dense"`. */ marginDense: {}, /* Styles applied to the root element if `multiline={true}`. */ multiline: { padding: '18.5px 14px', '&$marginDense': { paddingTop: 10.5, paddingBottom: 10.5 } }, /* Styles applied to the `NotchedOutline` element. */ notchedOutline: { borderColor }, /* Styles applied to the `input` element. */ input: { padding: '18.5px 14px', '&:-webkit-autofill': { WebkitBoxShadow: theme.palette.type === 'dark' ? '0 0 0 100px #266798 inset' : null, WebkitTextFillColor: theme.palette.type === 'dark' ? '#fff' : null, borderRadius: 'inherit' } }, /* Styles applied to the `input` element if `margin="dense"`. */ inputMarginDense: { paddingTop: 10.5, paddingBottom: 10.5 }, /* Styles applied to the `input` element if `multiline={true}`. */ inputMultiline: { padding: 0 }, /* Styles applied to the `input` element if `startAdornment` is provided. */ inputAdornedStart: { paddingLeft: 0 }, /* Styles applied to the `input` element if `endAdornment` is provided. */ inputAdornedEnd: { paddingRight: 0 } }; }; const OutlinedInput = React.forwardRef(function OutlinedInput(props, ref) { const { classes, fullWidth = false, inputComponent = 'input', label, labelWidth = 0, multiline = false, notched, type = 'text' } = props, other = _objectWithoutPropertiesLoose(props, ["classes", "fullWidth", "inputComponent", "label", "labelWidth", "multiline", "notched", "type"]); return React.createElement(InputBase, _extends({ renderSuffix: state => React.createElement(NotchedOutline, { className: classes.notchedOutline, label: label, labelWidth: labelWidth, notched: typeof notched !== 'undefined' ? notched : Boolean(state.startAdornment || state.filled || state.focused) }), classes: _extends({}, classes, { root: clsx(classes.root, classes.underline), notchedOutline: null }), fullWidth: fullWidth, inputComponent: inputComponent, multiline: multiline, ref: ref, type: type }, other)); }); process.env.NODE_ENV !== "production" ? OutlinedInput.propTypes = { /** * This prop helps users to fill forms faster, especially on mobile devices. * The name can be confusing, as it's more like an autofill. * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill). */ autoComplete: PropTypes.string, /** * If `true`, the `input` element will be focused during the first mount. */ autoFocus: PropTypes.bool, /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * The CSS class name of the wrapper element. */ className: PropTypes.string, /** * The color of the component. It supports those theme colors that make sense for this component. */ color: PropTypes.oneOf(['primary', 'secondary']), /** * The default `input` element value. Use when the component is not controlled. */ defaultValue: PropTypes.any, /** * If `true`, the `input` element will be disabled. */ disabled: PropTypes.bool, /** * End `InputAdornment` for this component. */ endAdornment: PropTypes.node, /** * If `true`, the input will indicate an error. This is normally obtained via context from * FormControl. */ error: PropTypes.bool, /** * If `true`, the input will take up the full width of its container. */ fullWidth: PropTypes.bool, /** * The id of the `input` element. */ id: PropTypes.string, /** * The component used for the native input. * Either a string to use a DOM element or a component. */ inputComponent: PropTypes.elementType, /** * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element. */ inputProps: PropTypes.object, /** * Pass a ref to the `input` element. */ inputRef: refType, /** * The label of the input. It is only used for layout. The actual labelling * is handled by `InputLabel`. If specified `labelWidth` is ignored. */ label: PropTypes.node, /** * The width of the label. Is ignored if `label` is provided. Prefer `label` * if the input label appears with a strike through. */ labelWidth: PropTypes.number, /** * If `dense`, will adjust vertical spacing. This is normally obtained via context from * FormControl. */ margin: PropTypes.oneOf(['dense', 'none']), /** * If `true`, a textarea element will be rendered. */ multiline: PropTypes.bool, /** * Name attribute of the `input` element. */ name: PropTypes.string, /** * If `true`, the outline is notched to accommodate the label. */ notched: PropTypes.bool, /** * Callback fired when the value is changed. * * @param {object} event The event source of the callback. * You can pull out the new value by accessing `event.target.value` (string). */ onChange: PropTypes.func, /** * The short hint displayed in the input before the user enters a value. */ placeholder: PropTypes.string, /** * It prevents the user from changing the value of the field * (not from interacting with the field). */ readOnly: PropTypes.bool, /** * If `true`, the `input` element will be required. */ required: PropTypes.bool, /** * Number of rows to display when multiline option is set to true. */ rows: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), /** * Maximum number of rows to display when multiline option is set to true. */ rowsMax: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), /** * Start `InputAdornment` for this component. */ startAdornment: PropTypes.node, /** * Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types). */ type: PropTypes.string, /** * The value of the `input` element, required for a controlled component. */ value: PropTypes.any } : void 0; OutlinedInput.muiName = 'Input'; export default withStyles(styles, { name: 'MuiOutlinedInput' })(OutlinedInput);
ajax/libs/primereact/6.5.0-rc.1/dataview/dataview.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; import { Paginator } from 'primereact/paginator'; import { classNames, ObjectUtils } from 'primereact/utils'; import { Ripple } from 'primereact/ripple'; 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 _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } 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 _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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } 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); return Constructor; } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); } 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); } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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 propTypes = {exports: {}}; /** * 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. */ var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; var ReactPropTypesSecret_1 = ReactPropTypesSecret$1; /** * 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. */ var ReactPropTypesSecret = ReactPropTypesSecret_1; function emptyFunction() {} function emptyFunctionWithReset() {} emptyFunctionWithReset.resetWarningCache = emptyFunction; var factoryWithThrowingShims = function() { function shim(props, propName, componentName, location, propFullName, secret) { if (secret === ReactPropTypesSecret) { // It is still safe when called from React. return; } var err = new Error( 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types' ); err.name = 'Invariant Violation'; throw err; } shim.isRequired = shim; function getShim() { return shim; } // Important! // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. var ReactPropTypes = { array: shim, bool: shim, func: shim, number: shim, object: shim, string: shim, symbol: shim, any: shim, arrayOf: getShim, element: shim, elementType: shim, instanceOf: getShim, node: shim, objectOf: getShim, oneOf: getShim, oneOfType: getShim, shape: getShim, exact: getShim, checkPropTypes: emptyFunctionWithReset, resetWarningCache: emptyFunction }; ReactPropTypes.PropTypes = ReactPropTypes; return ReactPropTypes; }; /** * 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. */ { // By explicitly using `prop-types` you are opting into new production behavior. // http://fb.me/prop-types-in-prod propTypes.exports = factoryWithThrowingShims(); } var PropTypes = propTypes.exports; 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 _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; } } var DataViewLayoutOptions = /*#__PURE__*/function (_Component) { _inherits(DataViewLayoutOptions, _Component); var _super = _createSuper(DataViewLayoutOptions); function DataViewLayoutOptions(props) { var _this; _classCallCheck(this, DataViewLayoutOptions); _this = _super.call(this, props); _this.changeLayout = _this.changeLayout.bind(_assertThisInitialized(_this)); return _this; } _createClass(DataViewLayoutOptions, [{ key: "changeLayout", value: function changeLayout(event, layoutMode) { this.props.onChange({ originalEvent: event, value: layoutMode }); event.preventDefault(); } }, { key: "render", value: function render() { var _this2 = this; var className = classNames('p-dataview-layout-options p-selectbutton p-buttonset', this.props.className); var buttonListClass = classNames('p-button p-button-icon-only', { 'p-highlight': this.props.layout === 'list' }); var buttonGridClass = classNames('p-button p-button-icon-only', { 'p-highlight': this.props.layout === 'grid' }); return /*#__PURE__*/React.createElement("div", { id: this.props.id, style: this.props.style, className: className }, /*#__PURE__*/React.createElement("button", { type: "button", className: buttonListClass, onClick: function onClick(event) { return _this2.changeLayout(event, 'list'); } }, /*#__PURE__*/React.createElement("i", { className: "pi pi-bars" }), /*#__PURE__*/React.createElement(Ripple, null)), /*#__PURE__*/React.createElement("button", { type: "button", className: buttonGridClass, onClick: function onClick(event) { return _this2.changeLayout(event, 'grid'); } }, /*#__PURE__*/React.createElement("i", { className: "pi pi-th-large" }), /*#__PURE__*/React.createElement(Ripple, null))); } }]); return DataViewLayoutOptions; }(Component); _defineProperty(DataViewLayoutOptions, "defaultProps", { id: null, style: null, className: null, layout: null, onChange: null }); _defineProperty(DataViewLayoutOptions, "propTypes", { id: PropTypes.string, style: PropTypes.object, className: PropTypes.string, layout: PropTypes.string, onChange: PropTypes.func.isRequired }); var DataViewItem = /*#__PURE__*/function (_Component2) { _inherits(DataViewItem, _Component2); var _super2 = _createSuper(DataViewItem); function DataViewItem() { _classCallCheck(this, DataViewItem); return _super2.apply(this, arguments); } _createClass(DataViewItem, [{ key: "render", value: function render() { return this.props.template(this.props.item, this.props.layout); } }]); return DataViewItem; }(Component); _defineProperty(DataViewItem, "defaultProps", { template: null, item: null, layout: null }); _defineProperty(DataViewItem, "propTypes", { template: PropTypes.func, item: PropTypes.any, layout: PropTypes.string }); var DataView = /*#__PURE__*/function (_Component3) { _inherits(DataView, _Component3); var _super3 = _createSuper(DataView); function DataView(props) { var _this3; _classCallCheck(this, DataView); _this3 = _super3.call(this, props); if (!_this3.props.onPage) { _this3.state = { first: _this3.props.first, rows: _this3.props.rows }; } _this3.sortChange = false; _this3.onPageChange = _this3.onPageChange.bind(_assertThisInitialized(_this3)); return _this3; } _createClass(DataView, [{ key: "getTotalRecords", value: function getTotalRecords() { if (this.props.totalRecords) return this.props.totalRecords;else return this.props.value ? this.props.value.length : 0; } }, { key: "createPaginator", value: function createPaginator(position) { var className = classNames('p-paginator-' + position, this.props.paginatorClassName); var first = this.props.onPage ? this.props.first : this.state.first; var rows = this.props.onPage ? this.props.rows : this.state.rows; var totalRecords = this.getTotalRecords(); return /*#__PURE__*/React.createElement(Paginator, { first: first, rows: rows, pageLinkSize: this.props.pageLinkSize, className: className, onPageChange: this.onPageChange, template: this.props.paginatorTemplate, totalRecords: totalRecords, rowsPerPageOptions: this.props.rowsPerPageOptions, currentPageReportTemplate: this.props.currentPageReportTemplate, leftContent: this.props.paginatorLeft, rightContent: this.props.paginatorRight, alwaysShow: this.props.alwaysShowPaginator, dropdownAppendTo: this.props.paginatorDropdownAppendTo }); } }, { key: "onPageChange", value: function onPageChange(event) { if (this.props.onPage) { this.props.onPage(event); } else { this.setState({ first: event.first, rows: event.rows }); } } }, { key: "isEmpty", value: function isEmpty() { return !this.props.value || this.props.value.length === 0; } }, { key: "sort", value: function sort() { var _this4 = this; if (this.props.value) { var value = _toConsumableArray(this.props.value); value.sort(function (data1, data2) { var value1 = ObjectUtils.resolveFieldData(data1, _this4.props.sortField); var value2 = ObjectUtils.resolveFieldData(data2, _this4.props.sortField); var result = null; if (value1 == null && value2 != null) result = -1;else if (value1 != null && value2 == null) result = 1;else if (value1 == null && value2 == null) result = 0;else if (typeof value1 === 'string' && typeof value2 === 'string') result = value1.localeCompare(value2, undefined, { numeric: true });else result = value1 < value2 ? -1 : value1 > value2 ? 1 : 0; return _this4.props.sortOrder * result; }); return value; } else { return null; } } }, { key: "renderLoader", value: function renderLoader() { if (this.props.loading) { var iconClassName = classNames('p-dataview-loading-icon pi-spin', this.props.loadingIcon); return /*#__PURE__*/React.createElement("div", { className: "p-dataview-loading-overlay p-component-overlay" }, /*#__PURE__*/React.createElement("i", { className: iconClassName })); } return null; } }, { key: "renderTopPaginator", value: function renderTopPaginator() { if (this.props.paginator && (this.props.paginatorPosition !== 'bottom' || this.props.paginatorPosition === 'both')) { return this.createPaginator('top'); } return null; } }, { key: "renderBottomPaginator", value: function renderBottomPaginator() { if (this.props.paginator && (this.props.paginatorPosition !== 'top' || this.props.paginatorPosition === 'both')) { return this.createPaginator('bottom'); } return null; } }, { key: "renderEmptyMessage", value: function renderEmptyMessage() { if (!this.props.loading) { return /*#__PURE__*/React.createElement("div", { className: "p-col-12 p-dataview-emptymessage" }, this.props.emptyMessage); } return null; } }, { key: "renderHeader", value: function renderHeader() { if (this.props.header) { return /*#__PURE__*/React.createElement("div", { className: "p-dataview-header" }, this.props.header); } return null; } }, { key: "renderFooter", value: function renderFooter() { if (this.props.footer) { return /*#__PURE__*/React.createElement("div", { className: "p-dataview-footer" }, " ", this.props.footer); } return null; } }, { key: "renderItems", value: function renderItems(value) { var _this5 = this; if (value && value.length) { if (this.props.paginator) { var rows = this.props.onPage ? this.props.rows : this.state.rows; var first = this.props.lazy ? 0 : this.props.onPage ? this.props.first : this.state.first; var totalRecords = this.getTotalRecords(); var last = Math.min(rows + first, totalRecords); var items = []; for (var i = first; i < last; i++) { var val = value[i]; val && items.push( /*#__PURE__*/React.createElement(DataViewItem, { key: i, template: this.props.itemTemplate, layout: this.props.layout, item: val })); } return items; } else { return value.map(function (item, index) { return /*#__PURE__*/React.createElement(DataViewItem, { key: index, template: _this5.props.itemTemplate, layout: _this5.props.layout, item: item }); }); } } else { return this.renderEmptyMessage(); } } }, { key: "renderContent", value: function renderContent(value) { var items = this.renderItems(value); return /*#__PURE__*/React.createElement("div", { className: "p-dataview-content" }, /*#__PURE__*/React.createElement("div", { className: "p-grid p-nogutter" }, items)); } }, { key: "processData", value: function processData() { var data = this.props.value; if (data && data.length) { if (this.props.sortField) { data = this.sort(); } } return data; } }, { key: "render", value: function render() { var value = this.processData(); var className = classNames('p-dataview p-component', { 'p-dataview-list': this.props.layout === 'list', 'p-dataview-grid': this.props.layout === 'grid', 'p-dataview-loading': this.props.loading }, this.props.className); var loader = this.renderLoader(); var topPaginator = this.renderTopPaginator(); var bottomPaginator = this.renderBottomPaginator(); var header = this.renderHeader(); var footer = this.renderFooter(); var content = this.renderContent(value); return /*#__PURE__*/React.createElement("div", { id: this.props.id, style: this.props.style, className: className }, loader, header, topPaginator, content, bottomPaginator, footer); } }]); return DataView; }(Component); _defineProperty(DataView, "defaultProps", { id: null, header: null, footer: null, value: null, layout: 'list', rows: null, first: 0, totalRecords: null, paginator: false, paginatorPosition: 'bottom', alwaysShowPaginator: true, paginatorClassName: null, paginatorTemplate: 'FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown', paginatorLeft: null, paginatorRight: null, paginatorDropdownAppendTo: null, pageLinkSize: 5, rowsPerPageOptions: null, currentPageReportTemplate: '({currentPage} of {totalPages})', emptyMessage: 'No records found', sortField: null, sortOrder: null, style: null, className: null, lazy: false, loading: false, loadingIcon: 'pi pi-spinner', itemTemplate: null, onPage: null }); _defineProperty(DataView, "propTypes", { id: PropTypes.string, header: PropTypes.any, footer: PropTypes.any, value: PropTypes.array, layout: PropTypes.string, rows: PropTypes.number, first: PropTypes.number, totalRecords: PropTypes.number, paginator: PropTypes.bool, paginatorPosition: PropTypes.string, alwaysShowPaginator: PropTypes.bool, paginatorClassName: PropTypes.string, paginatorTemplate: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), paginatorLeft: PropTypes.any, paginatorRight: PropTypes.any, paginatorDropdownAppendTo: PropTypes.oneOfType([PropTypes.object, PropTypes.string]), pageLinkSize: PropTypes.number, rowsPerPageOptions: PropTypes.array, currentPageReportTemplate: PropTypes.string, emptyMessage: PropTypes.string, sortField: PropTypes.string, sortOrder: PropTypes.number, style: PropTypes.object, className: PropTypes.string, lazy: PropTypes.bool, loading: PropTypes.bool, loadingIcon: PropTypes.string, itemTemplate: PropTypes.func.isRequired, onPage: PropTypes.func }); export { DataView, DataViewLayoutOptions };
ajax/libs/primereact/7.0.0-rc.1/carousel/carousel.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; import { classNames, UniqueComponentId, DomHandler, Ripple } from 'primereact/core'; 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 _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } 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 _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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 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); return Constructor; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); } 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); } 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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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 _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; } } var CarouselItem = /*#__PURE__*/function (_Component) { _inherits(CarouselItem, _Component); var _super = _createSuper(CarouselItem); function CarouselItem() { _classCallCheck(this, CarouselItem); return _super.apply(this, arguments); } _createClass(CarouselItem, [{ key: "render", value: function render() { var content = this.props.template(this.props.item); var itemClassName = classNames(this.props.className, 'p-carousel-item', { 'p-carousel-item-active': this.props.active, 'p-carousel-item-start': this.props.start, 'p-carousel-item-end': this.props.end }); return /*#__PURE__*/React.createElement("div", { className: itemClassName }, content); } }]); return CarouselItem; }(Component); _defineProperty(CarouselItem, "defaultProps", { template: null, item: null, active: false, start: false, end: false, className: null }); var Carousel = /*#__PURE__*/function (_Component2) { _inherits(Carousel, _Component2); var _super2 = _createSuper(Carousel); function Carousel(props) { var _this; _classCallCheck(this, Carousel); _this = _super2.call(this, props); _this.state = { numVisible: props.numVisible, numScroll: props.numScroll, totalShiftedItems: props.page * props.numScroll * -1 }; if (!_this.props.onPageChange) { _this.state = _objectSpread(_objectSpread({}, _this.state), {}, { page: props.page }); } _this.navBackward = _this.navBackward.bind(_assertThisInitialized(_this)); _this.navForward = _this.navForward.bind(_assertThisInitialized(_this)); _this.onTransitionEnd = _this.onTransitionEnd.bind(_assertThisInitialized(_this)); _this.onTouchStart = _this.onTouchStart.bind(_assertThisInitialized(_this)); _this.onTouchMove = _this.onTouchMove.bind(_assertThisInitialized(_this)); _this.onTouchEnd = _this.onTouchEnd.bind(_assertThisInitialized(_this)); _this.totalIndicators = 0; _this.remainingItems = 0; _this.allowAutoplay = !!_this.props.autoplayInterval; _this.circular = _this.props.circular || _this.allowAutoplay; _this.attributeSelector = UniqueComponentId(); _this.swipeThreshold = 20; return _this; } _createClass(Carousel, [{ key: "step", value: function step(dir, page) { var totalShiftedItems = this.state.totalShiftedItems; var isCircular = this.isCircular(); if (page != null) { totalShiftedItems = this.state.numScroll * page * -1; if (isCircular) { totalShiftedItems -= this.state.numVisible; } this.isRemainingItemsAdded = false; } else { totalShiftedItems += this.state.numScroll * dir; if (this.isRemainingItemsAdded) { totalShiftedItems += this.remainingItems - this.state.numScroll * dir; this.isRemainingItemsAdded = false; } var originalShiftedItems = isCircular ? totalShiftedItems + this.state.numVisible : totalShiftedItems; page = Math.abs(Math.floor(originalShiftedItems / this.state.numScroll)); } if (isCircular && this.state.page === this.totalIndicators - 1 && dir === -1) { totalShiftedItems = -1 * (this.props.value.length + this.state.numVisible); page = 0; } else if (isCircular && this.state.page === 0 && dir === 1) { totalShiftedItems = 0; page = this.totalIndicators - 1; } else if (page === this.totalIndicators - 1 && this.remainingItems > 0) { totalShiftedItems += this.remainingItems * -1 - this.state.numScroll * dir; this.isRemainingItemsAdded = true; } if (this.itemsContainer) { DomHandler.removeClass(this.itemsContainer, 'p-items-hidden'); this.changePosition(totalShiftedItems); this.itemsContainer.style.transition = 'transform 500ms ease 0s'; } if (this.props.onPageChange) { this.setState({ totalShiftedItems: totalShiftedItems }); this.props.onPageChange({ page: page }); } else { this.setState({ page: page, totalShiftedItems: totalShiftedItems }); } } }, { key: "calculatePosition", value: function calculatePosition() { if (this.itemsContainer && this.responsiveOptions) { var windowWidth = window.innerWidth; var matchedResponsiveData = { numVisible: this.props.numVisible, numScroll: this.props.numScroll }; for (var i = 0; i < this.responsiveOptions.length; i++) { var res = this.responsiveOptions[i]; if (parseInt(res.breakpoint, 10) >= windowWidth) { matchedResponsiveData = res; } } var state = {}; if (this.state.numScroll !== matchedResponsiveData.numScroll) { var page = this.getPage(); page = Math.floor(page * this.state.numScroll / matchedResponsiveData.numScroll); var totalShiftedItems = matchedResponsiveData.numScroll * page * -1; if (this.isCircular()) { totalShiftedItems -= matchedResponsiveData.numVisible; } state = { totalShiftedItems: totalShiftedItems, numScroll: matchedResponsiveData.numScroll }; if (this.props.onPageChange) { this.props.onPageChange({ page: page }); } else { state = _objectSpread(_objectSpread({}, state), {}, { page: page }); } } if (this.state.numVisible !== matchedResponsiveData.numVisible) { state = _objectSpread(_objectSpread({}, state), {}, { numVisible: matchedResponsiveData.numVisible }); } if (Object.keys(state).length) { this.setState(state); } } } }, { key: "navBackward", value: function navBackward(e, page) { if (this.circular || this.getPage() !== 0) { this.step(1, page); } this.allowAutoplay = false; if (e.cancelable) { e.preventDefault(); } } }, { key: "navForward", value: function navForward(e, page) { if (this.circular || this.getPage() < this.totalIndicators - 1) { this.step(-1, page); } this.allowAutoplay = false; if (e.cancelable) { e.preventDefault(); } } }, { key: "onDotClick", value: function onDotClick(e, page) { var currentPage = this.getPage(); if (page > currentPage) { this.navForward(e, page); } else if (page < currentPage) { this.navBackward(e, page); } } }, { key: "onTransitionEnd", value: function onTransitionEnd() { if (this.itemsContainer) { DomHandler.addClass(this.itemsContainer, 'p-items-hidden'); this.itemsContainer.style.transition = ''; if ((this.state.page === 0 || this.state.page === this.totalIndicators - 1) && this.isCircular()) { this.changePosition(this.state.totalShiftedItems); } } } }, { key: "onTouchStart", value: function onTouchStart(e) { var touchobj = e.changedTouches[0]; this.startPos = { x: touchobj.pageX, y: touchobj.pageY }; } }, { key: "onTouchMove", value: function onTouchMove(e) { if (e.cancelable) { e.preventDefault(); } } }, { key: "onTouchEnd", value: function onTouchEnd(e) { var touchobj = e.changedTouches[0]; if (this.isVertical()) { this.changePageOnTouch(e, touchobj.pageY - this.startPos.y); } else { this.changePageOnTouch(e, touchobj.pageX - this.startPos.x); } } }, { key: "changePageOnTouch", value: function changePageOnTouch(e, diff) { if (Math.abs(diff) > this.swipeThreshold) { if (diff < 0) { // left this.navForward(e); } else { // right this.navBackward(e); } } } }, { key: "bindDocumentListeners", value: function bindDocumentListeners() { var _this2 = this; if (!this.documentResizeListener) { this.documentResizeListener = function () { _this2.calculatePosition(); }; window.addEventListener('resize', this.documentResizeListener); } } }, { key: "unbindDocumentListeners", value: function unbindDocumentListeners() { if (this.documentResizeListener) { window.removeEventListener('resize', this.documentResizeListener); this.documentResizeListener = null; } } }, { key: "isVertical", value: function isVertical() { return this.props.orientation === 'vertical'; } }, { key: "isCircular", value: function isCircular() { return this.circular && this.props.value.length >= this.state.numVisible; } }, { key: "getPage", value: function getPage() { return this.props.onPageChange ? this.props.page : this.state.page; } }, { key: "getTotalIndicators", value: function getTotalIndicators() { return this.props.value ? Math.ceil((this.props.value.length - this.state.numVisible) / this.state.numScroll) + 1 : 0; } }, { key: "isAutoplay", value: function isAutoplay() { return this.props.autoplayInterval && this.allowAutoplay; } }, { key: "startAutoplay", value: function startAutoplay() { var _this3 = this; this.interval = setInterval(function () { if (_this3.state.page === _this3.totalIndicators - 1) { _this3.step(-1, 0); } else { _this3.step(-1, _this3.state.page + 1); } }, this.props.autoplayInterval); } }, { key: "stopAutoplay", value: function stopAutoplay() { if (this.interval) { clearInterval(this.interval); } } }, { key: "createStyle", value: function createStyle() { if (!this.carouselStyle) { this.carouselStyle = document.createElement('style'); document.body.appendChild(this.carouselStyle); } var innerHTML = "\n .p-carousel[".concat(this.attributeSelector, "] .p-carousel-item {\n flex: 1 0 ").concat(100 / this.state.numVisible, "%\n }\n "); if (this.props.responsiveOptions) { this.responsiveOptions = _toConsumableArray(this.props.responsiveOptions); this.responsiveOptions.sort(function (data1, data2) { var value1 = data1.breakpoint; var value2 = data2.breakpoint; var result = null; if (value1 == null && value2 != null) result = -1;else if (value1 != null && value2 == null) result = 1;else if (value1 == null && value2 == null) result = 0;else if (typeof value1 === 'string' && typeof value2 === 'string') result = value1.localeCompare(value2, undefined, { numeric: true });else result = value1 < value2 ? -1 : value1 > value2 ? 1 : 0; return -1 * result; }); for (var i = 0; i < this.responsiveOptions.length; i++) { var res = this.responsiveOptions[i]; innerHTML += "\n @media screen and (max-width: ".concat(res.breakpoint, ") {\n .p-carousel[").concat(this.attributeSelector, "] .p-carousel-item {\n flex: 1 0 ").concat(100 / res.numVisible, "%\n }\n }\n "); } } this.carouselStyle.innerHTML = innerHTML; } }, { key: "changePosition", value: function changePosition(totalShiftedItems) { if (this.itemsContainer) { this.itemsContainer.style.transform = this.isVertical() ? "translate3d(0, ".concat(totalShiftedItems * (100 / this.state.numVisible), "%, 0)") : "translate3d(".concat(totalShiftedItems * (100 / this.state.numVisible), "%, 0, 0)"); } } }, { key: "componentDidMount", value: function componentDidMount() { if (this.container) { this.container.setAttribute(this.attributeSelector, ''); } this.createStyle(); this.calculatePosition(); this.changePosition(this.state.totalShiftedItems); if (this.props.responsiveOptions) { this.bindDocumentListeners(); } } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps, prevState) { var isCircular = this.isCircular(); var stateChanged = false; var totalShiftedItems = this.state.totalShiftedItems; if (this.props.autoplayInterval) { this.stopAutoplay(); } if (prevState.numScroll !== this.state.numScroll || prevState.numVisible !== this.state.numVisible || this.props.value && prevProps.value && prevProps.value.length !== this.props.value.length) { this.remainingItems = (this.props.value.length - this.state.numVisible) % this.state.numScroll; var page = this.getPage(); if (this.totalIndicators !== 0 && page >= this.totalIndicators) { page = this.totalIndicators - 1; if (this.props.onPageChange) { this.props.onPageChange({ page: page }); } else { this.setState({ page: page }); } stateChanged = true; } totalShiftedItems = page * this.state.numScroll * -1; if (isCircular) { totalShiftedItems -= this.state.numVisible; } if (page === this.totalIndicators - 1 && this.remainingItems > 0) { totalShiftedItems += -1 * this.remainingItems + this.state.numScroll; this.isRemainingItemsAdded = true; } else { this.isRemainingItemsAdded = false; } if (totalShiftedItems !== this.state.totalShiftedItems) { this.setState({ totalShiftedItems: totalShiftedItems }); stateChanged = true; } this.changePosition(totalShiftedItems); } if (isCircular) { if (this.state.page === 0) { totalShiftedItems = -1 * this.state.numVisible; } else if (totalShiftedItems === 0) { totalShiftedItems = -1 * this.props.value.length; if (this.remainingItems > 0) { this.isRemainingItemsAdded = true; } } if (totalShiftedItems !== this.state.totalShiftedItems) { this.setState({ totalShiftedItems: totalShiftedItems }); stateChanged = true; } } if (prevProps.page !== this.props.page) { if (this.props.page > prevProps.page && this.props.page <= this.totalIndicators - 1) { this.step(-1, this.props.page); } else if (this.props.page < prevProps.page) { this.step(1, this.props.page); } } if (!stateChanged && this.isAutoplay()) { this.startAutoplay(); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { if (this.props.responsiveOptions) { this.unbindDocumentListeners(); } if (this.props.autoplayInterval) { this.stopAutoplay(); } } }, { key: "renderItems", value: function renderItems() { var _this4 = this; if (this.props.value && this.props.value.length) { var isCircular = this.isCircular(); var clonedItemsForStarting = null; var clonedItemsForFinishing = null; if (isCircular) { var clonedElements = null; clonedElements = this.props.value.slice(-1 * this.state.numVisible); clonedItemsForStarting = clonedElements.map(function (item, index) { var isActive = _this4.state.totalShiftedItems * -1 === _this4.props.value.length + _this4.state.numVisible, start = index === 0, end = index === clonedElements.length - 1; return /*#__PURE__*/React.createElement(CarouselItem, { key: index + '_scloned', className: "p-carousel-item-cloned", template: _this4.props.itemTemplate, item: item, active: isActive, start: start, end: end }); }); clonedElements = this.props.value.slice(0, this.state.numVisible); clonedItemsForFinishing = clonedElements.map(function (item, index) { var isActive = _this4.state.totalShiftedItems === 0, start = index === 0, end = index === clonedElements.length - 1; return /*#__PURE__*/React.createElement(CarouselItem, { key: index + '_fcloned', className: "p-carousel-item-cloned", template: _this4.props.itemTemplate, item: item, active: isActive, start: start, end: end }); }); } var items = this.props.value.map(function (item, index) { var firstIndex = isCircular ? -1 * (_this4.state.totalShiftedItems + _this4.state.numVisible) : _this4.state.totalShiftedItems * -1, lastIndex = firstIndex + _this4.state.numVisible - 1, isActive = firstIndex <= index && lastIndex >= index, start = firstIndex === index, end = lastIndex === index; return /*#__PURE__*/React.createElement(CarouselItem, { key: index, template: _this4.props.itemTemplate, item: item, active: isActive, start: start, end: end }); }); return /*#__PURE__*/React.createElement(React.Fragment, null, clonedItemsForStarting, items, clonedItemsForFinishing); } } }, { key: "renderHeader", value: function renderHeader() { if (this.props.header) { return /*#__PURE__*/React.createElement("div", { className: "p-carousel-header" }, this.props.header); } return null; } }, { key: "renderFooter", value: function renderFooter() { if (this.props.footer) { return /*#__PURE__*/React.createElement("div", { className: "p-carousel-footer" }, this.props.footer); } return null; } }, { key: "renderContent", value: function renderContent() { var _this5 = this; var items = this.renderItems(); var height = this.isVertical() ? this.props.verticalViewPortHeight : 'auto'; var backwardNavigator = this.renderBackwardNavigator(); var forwardNavigator = this.renderForwardNavigator(); var containerClassName = classNames('p-carousel-container', this.props.containerClassName); return /*#__PURE__*/React.createElement("div", { className: containerClassName }, backwardNavigator, /*#__PURE__*/React.createElement("div", { className: "p-carousel-items-content", style: { 'height': height } }, /*#__PURE__*/React.createElement("div", { ref: function ref(el) { return _this5.itemsContainer = el; }, className: "p-carousel-items-container", onTransitionEnd: this.onTransitionEnd, onTouchStart: this.onTouchStart, onTouchMove: this.onTouchMove, onTouchEnd: this.onTouchEnd }, items)), forwardNavigator); } }, { key: "renderBackwardNavigator", value: function renderBackwardNavigator() { var isDisabled = (!this.circular || this.props.value && this.props.value.length < this.state.numVisible) && this.getPage() === 0; var buttonClassName = classNames('p-carousel-prev p-link', { 'p-disabled': isDisabled }), iconClassName = classNames('p-carousel-prev-icon pi', { 'pi-chevron-left': !this.isVertical(), 'pi-chevron-up': this.isVertical() }); return /*#__PURE__*/React.createElement("button", { type: "button", className: buttonClassName, onClick: this.navBackward, disabled: isDisabled }, /*#__PURE__*/React.createElement("span", { className: iconClassName }), /*#__PURE__*/React.createElement(Ripple, null)); } }, { key: "renderForwardNavigator", value: function renderForwardNavigator() { var isDisabled = (!this.circular || this.props.value && this.props.value.length < this.state.numVisible) && (this.getPage() === this.totalIndicators - 1 || this.totalIndicators === 0); var buttonClassName = classNames('p-carousel-next p-link', { 'p-disabled': isDisabled }), iconClassName = classNames('p-carousel-next-icon pi', { 'pi-chevron-right': !this.isVertical(), 'pi-chevron-down': this.isVertical() }); return /*#__PURE__*/React.createElement("button", { type: "button", className: buttonClassName, onClick: this.navForward, disabled: isDisabled }, /*#__PURE__*/React.createElement("span", { className: iconClassName }), /*#__PURE__*/React.createElement(Ripple, null)); } }, { key: "renderIndicator", value: function renderIndicator(index) { var _this6 = this; var isActive = this.getPage() === index, indicatorItemClassName = classNames('p-carousel-indicator', { 'p-highlight': isActive }); return /*#__PURE__*/React.createElement("li", { className: indicatorItemClassName, key: 'p-carousel-indicator-' + index }, /*#__PURE__*/React.createElement("button", { type: "button", className: "p-link", onClick: function onClick(e) { return _this6.onDotClick(e, index); } }, /*#__PURE__*/React.createElement(Ripple, null))); } }, { key: "renderIndicators", value: function renderIndicators() { var indicatorsContentClassName = classNames('p-carousel-indicators p-reset', this.props.indicatorsContentClassName); var indicators = []; for (var i = 0; i < this.totalIndicators; i++) { indicators.push(this.renderIndicator(i)); } return /*#__PURE__*/React.createElement("ul", { className: indicatorsContentClassName }, indicators); } }, { key: "render", value: function render() { var _this7 = this; var className = classNames('p-carousel p-component', { 'p-carousel-vertical': this.isVertical(), 'p-carousel-horizontal': !this.isVertical() }, this.props.className); var contentClassName = classNames('p-carousel-content', this.props.contentClassName); this.totalIndicators = this.getTotalIndicators(); var content = this.renderContent(); var indicators = this.renderIndicators(); var header = this.renderHeader(); var footer = this.renderFooter(); return /*#__PURE__*/React.createElement("div", { ref: function ref(el) { return _this7.container = el; }, id: this.props.id, className: className, style: this.props.style }, header, /*#__PURE__*/React.createElement("div", { className: contentClassName }, content, indicators), footer); } }]); return Carousel; }(Component); _defineProperty(Carousel, "defaultProps", { id: null, value: null, page: 0, header: null, footer: null, style: null, className: null, itemTemplate: null, circular: false, autoplayInterval: 0, numVisible: 1, numScroll: 1, responsiveOptions: null, orientation: "horizontal", verticalViewPortHeight: "300px", contentClassName: null, containerClassName: null, indicatorsContentClassName: null, onPageChange: null }); export { Carousel };
ajax/libs/material-ui/4.9.3/esm/ListItemSecondaryAction/ListItemSecondaryAction.js
cdnjs/cdnjs
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import withStyles from '../styles/withStyles'; export var styles = { /* Styles applied to the root element. */ root: { position: 'absolute', right: 16, top: '50%', transform: 'translateY(-50%)' } }; /** * Must be used as the last child of ListItem to function properly. */ var ListItemSecondaryAction = React.forwardRef(function ListItemSecondaryAction(props, ref) { var classes = props.classes, className = props.className, other = _objectWithoutProperties(props, ["classes", "className"]); return React.createElement("div", _extends({ className: clsx(classes.root, className), ref: ref }, other)); }); process.env.NODE_ENV !== "production" ? ListItemSecondaryAction.propTypes = { /** * The content of the component, normally an `IconButton` or selection control. */ children: PropTypes.node, /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * @ignore */ className: PropTypes.string } : void 0; ListItemSecondaryAction.muiName = 'ListItemSecondaryAction'; export default withStyles(styles, { name: 'MuiListItemSecondaryAction' })(ListItemSecondaryAction);
ajax/libs/material-ui/4.9.4/esm/Breadcrumbs/BreadcrumbCollapsed.js
cdnjs/cdnjs
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; import React from 'react'; import PropTypes from 'prop-types'; import withStyles from '../styles/withStyles'; import { emphasize } from '../styles/colorManipulator'; import MoreHorizIcon from '../internal/svg-icons/MoreHoriz'; import ButtonBase from '../ButtonBase'; var styles = function styles(theme) { return { root: { display: 'flex', marginLeft: theme.spacing(0.5), marginRight: theme.spacing(0.5), backgroundColor: theme.palette.grey[100], color: theme.palette.grey[700], borderRadius: 2, cursor: 'pointer', '&:hover, &:focus': { backgroundColor: theme.palette.grey[200] }, '&:active': { boxShadow: theme.shadows[0], backgroundColor: emphasize(theme.palette.grey[200], 0.12) } }, icon: { width: 24, height: 16 } }; }; /** * @ignore - internal component. */ function BreadcrumbCollapsed(props) { var classes = props.classes, other = _objectWithoutProperties(props, ["classes"]); return React.createElement(ButtonBase, _extends({ component: "li", className: classes.root, focusRipple: true }, other), React.createElement(MoreHorizIcon, { className: classes.icon })); } process.env.NODE_ENV !== "production" ? BreadcrumbCollapsed.propTypes = { /** * @ignore */ classes: PropTypes.object.isRequired } : void 0; export default withStyles(styles, { name: 'PrivateBreadcrumbCollapsed' })(BreadcrumbCollapsed);
ajax/libs/react-native-web/0.0.0-b096cd2d/exports/YellowBox/index.js
cdnjs/cdnjs
/** * Copyright (c) Nicolas Gallagher. * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ import React from 'react'; import UnimplementedView from '../../modules/UnimplementedView'; function YellowBox(props) { return /*#__PURE__*/React.createElement(UnimplementedView, props); } YellowBox.ignoreWarnings = function () {}; export default YellowBox;
ajax/libs/primereact/7.1.0/scrolltop/scrolltop.esm.js
cdnjs/cdnjs
import React, { Component } from 'react'; import { DomHandler, ZIndexUtils, classNames, IconUtils } from 'primereact/utils'; import { CSSTransition } from 'primereact/csstransition'; import { Ripple } from 'primereact/ripple'; import PrimeReact from 'primereact/api'; 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); return Constructor; } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); } 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); } 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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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; } 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 _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; } } var ScrollTop = /*#__PURE__*/function (_Component) { _inherits(ScrollTop, _Component); var _super = _createSuper(ScrollTop); function ScrollTop(props) { var _this; _classCallCheck(this, ScrollTop); _this = _super.call(this, props); _this.state = { visible: false }; _this.onClick = _this.onClick.bind(_assertThisInitialized(_this)); _this.onEnter = _this.onEnter.bind(_assertThisInitialized(_this)); _this.onEntered = _this.onEntered.bind(_assertThisInitialized(_this)); _this.onExited = _this.onExited.bind(_assertThisInitialized(_this)); _this.scrollElementRef = /*#__PURE__*/React.createRef(); return _this; } _createClass(ScrollTop, [{ key: "onClick", value: function onClick() { var scrollElement = this.props.target === 'window' ? window : this.helper.parentElement; scrollElement.scroll({ top: 0, behavior: this.props.behavior }); } }, { key: "checkVisibility", value: function checkVisibility(scrollY) { this.setState({ visible: scrollY > this.props.threshold }); } }, { key: "bindParentScrollListener", value: function bindParentScrollListener() { var _this2 = this; this.scrollListener = function () { _this2.checkVisibility(_this2.helper.parentElement.scrollTop); }; this.helper.parentElement.addEventListener('scroll', this.scrollListener); } }, { key: "bindDocumentScrollListener", value: function bindDocumentScrollListener() { var _this3 = this; this.scrollListener = function () { _this3.checkVisibility(DomHandler.getWindowScrollTop()); }; window.addEventListener('scroll', this.scrollListener); } }, { key: "unbindParentScrollListener", value: function unbindParentScrollListener() { if (this.scrollListener) { this.helper.parentElement.removeEventListener('scroll', this.scrollListener); this.scrollListener = null; } } }, { key: "unbindDocumentScrollListener", value: function unbindDocumentScrollListener() { if (this.scrollListener) { window.removeEventListener('scroll', this.scrollListener); this.scrollListener = null; } } }, { key: "onEnter", value: function onEnter() { ZIndexUtils.set('overlay', this.scrollElementRef.current, PrimeReact.autoZIndex, PrimeReact.zIndex['overlay']); } }, { key: "onEntered", value: function onEntered() { this.props.onShow && this.props.onShow(); } }, { key: "onExited", value: function onExited() { ZIndexUtils.clear(this.scrollElementRef.current); this.props.onHide && this.props.onHide(); } }, { key: "componentDidMount", value: function componentDidMount() { if (this.props.target === 'window') this.bindDocumentScrollListener();else if (this.props.target === 'parent') this.bindParentScrollListener(); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { if (this.props.target === 'window') this.unbindDocumentScrollListener();else if (this.props.target === 'parent') this.unbindParentScrollListener(); ZIndexUtils.clear(this.scrollElementRef.current); } }, { key: "render", value: function render() { var _this4 = this; var className = classNames('p-scrolltop p-link p-component', { 'p-scrolltop-sticky': this.props.target !== 'window' }, this.props.className); var isTargetParent = this.props.target === 'parent'; return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CSSTransition, { nodeRef: this.scrollElementRef, classNames: "p-scrolltop", in: this.state.visible, timeout: { enter: 150, exit: 150 }, options: this.props.transitionOptions, unmountOnExit: true, onEnter: this.onEnter, onEntered: this.onEntered, onExited: this.onExited }, /*#__PURE__*/React.createElement("button", { ref: this.scrollElementRef, type: "button", className: className, style: this.props.style, onClick: this.onClick }, IconUtils.getJSXIcon(this.props.icon, { className: 'p-scrolltop-icon' }, { props: this.props }), /*#__PURE__*/React.createElement(Ripple, null))), isTargetParent && /*#__PURE__*/React.createElement("span", { ref: function ref(el) { return _this4.helper = el; }, className: "p-scrolltop-helper" })); } }]); return ScrollTop; }(Component); _defineProperty(ScrollTop, "defaultProps", { target: 'window', threshold: 400, icon: 'pi pi-chevron-up', behavior: 'smooth', className: null, style: null, transitionOptions: null, onShow: null, onHide: null }); export { ScrollTop };
ajax/libs/material-ui/4.9.2/es/TableContainer/TableContainer.js
cdnjs/cdnjs
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import withStyles from '../styles/withStyles'; export const styles = { /* Styles applied to the root element. */ root: { width: '100%', overflowX: 'auto' } }; const TableContainer = React.forwardRef(function TableContainer(props, ref) { const { classes, className, component: Component = 'div' } = props, other = _objectWithoutPropertiesLoose(props, ["classes", "className", "component"]); return React.createElement(Component, _extends({ ref: ref, className: clsx(classes.root, className) }, other)); }); process.env.NODE_ENV !== "production" ? TableContainer.propTypes = { /** * The table itself, normally `<Table />` */ children: PropTypes.node, /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * @ignore */ className: PropTypes.string, /** * The component used for the root node. * Either a string to use a DOM element or a component. */ component: PropTypes.elementType } : void 0; export default withStyles(styles, { name: 'MuiTableContainer' })(TableContainer);
ajax/libs/material-ui/4.9.3/es/Fab/Fab.js
cdnjs/cdnjs
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; import _extends from "@babel/runtime/helpers/esm/extends"; import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import withStyles from '../styles/withStyles'; import ButtonBase from '../ButtonBase'; import capitalize from '../utils/capitalize'; export const styles = theme => ({ /* Styles applied to the root element. */ root: _extends({}, theme.typography.button, { boxSizing: 'border-box', minHeight: 36, transition: theme.transitions.create(['background-color', 'box-shadow', 'border'], { duration: theme.transitions.duration.short }), borderRadius: '50%', padding: 0, minWidth: 0, width: 56, height: 56, boxShadow: theme.shadows[6], '&:active': { boxShadow: theme.shadows[12] }, color: theme.palette.getContrastText(theme.palette.grey[300]), backgroundColor: theme.palette.grey[300], '&:hover': { backgroundColor: theme.palette.grey.A100, // Reset on touch devices, it doesn't add specificity '@media (hover: none)': { backgroundColor: theme.palette.grey[300] }, '&$disabled': { backgroundColor: theme.palette.action.disabledBackground }, textDecoration: 'none' }, '&$focusVisible': { boxShadow: theme.shadows[6] }, '&$disabled': { color: theme.palette.action.disabled, boxShadow: theme.shadows[0], backgroundColor: theme.palette.action.disabledBackground } }), /* Styles applied to the span element that wraps the children. */ label: { width: '100%', // assure the correct width for iOS Safari display: 'inherit', alignItems: 'inherit', justifyContent: 'inherit' }, /* Styles applied to the root element if `color="primary"`. */ primary: { color: theme.palette.primary.contrastText, backgroundColor: theme.palette.primary.main, '&:hover': { backgroundColor: theme.palette.primary.dark, // Reset on touch devices, it doesn't add specificity '@media (hover: none)': { backgroundColor: theme.palette.primary.main } } }, /* Styles applied to the root element if `color="secondary"`. */ secondary: { color: theme.palette.secondary.contrastText, backgroundColor: theme.palette.secondary.main, '&:hover': { backgroundColor: theme.palette.secondary.dark, // Reset on touch devices, it doesn't add specificity '@media (hover: none)': { backgroundColor: theme.palette.secondary.main } } }, /* Styles applied to the root element if `variant="extended"`. */ extended: { borderRadius: 48 / 2, padding: '0 16px', width: 'auto', minHeight: 'auto', minWidth: 48, height: 48, '&$sizeSmall': { width: 'auto', padding: '0 8px', borderRadius: 34 / 2, minWidth: 34, height: 34 }, '&$sizeMedium': { width: 'auto', padding: '0 16px', borderRadius: 40 / 2, minWidth: 40, height: 40 } }, /* Pseudo-class applied to the ButtonBase root element if the button is keyboard focused. */ focusVisible: {}, /* Pseudo-class applied to the root element if `disabled={true}`. */ disabled: {}, /* Styles applied to the root element if `color="inherit"`. */ colorInherit: { color: 'inherit' }, /* Styles applied to the root element if `size="small"``. */ sizeSmall: { width: 40, height: 40 }, /* Styles applied to the root element if `size="medium"``. */ sizeMedium: { width: 48, height: 48 } }); const Fab = React.forwardRef(function Fab(props, ref) { const { children, classes, className, color = 'default', component = 'button', disabled = false, disableFocusRipple = false, focusVisibleClassName, size = 'large', variant = 'round' } = props, other = _objectWithoutPropertiesLoose(props, ["children", "classes", "className", "color", "component", "disabled", "disableFocusRipple", "focusVisibleClassName", "size", "variant"]); return React.createElement(ButtonBase, _extends({ className: clsx(classes.root, className, variant !== "round" && classes.extended, size !== 'large' && classes[`size${capitalize(size)}`], disabled && classes.disabled, { 'primary': classes.primary, 'secondary': classes.secondary, 'inherit': classes.colorInherit }[color]), component: component, disabled: disabled, focusRipple: !disableFocusRipple, focusVisibleClassName: clsx(classes.focusVisible, focusVisibleClassName), ref: ref }, other), React.createElement("span", { className: classes.label }, children)); }); process.env.NODE_ENV !== "production" ? Fab.propTypes = { /** * The content of the button. */ children: PropTypes.node.isRequired, /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * @ignore */ className: PropTypes.string, /** * The color of the component. It supports those theme colors that make sense for this component. */ color: PropTypes.oneOf(['default', 'inherit', 'primary', 'secondary']), /** * The component used for the root node. * Either a string to use a DOM element or a component. */ component: PropTypes.elementType, /** * If `true`, the button will be disabled. */ disabled: PropTypes.bool, /** * If `true`, the keyboard focus ripple will be disabled. * `disableRipple` must also be true. */ disableFocusRipple: PropTypes.bool, /** * If `true`, the ripple effect will be disabled. */ disableRipple: PropTypes.bool, /** * @ignore */ focusVisibleClassName: PropTypes.string, /** * The URL to link to when the button is clicked. * If defined, an `a` element will be used as the root node. */ href: PropTypes.string, /** * The size of the button. * `small` is equivalent to the dense button styling. */ size: PropTypes.oneOf(['small', 'medium', 'large']), /** * @ignore */ type: PropTypes.string, /** * The variant to use. */ variant: PropTypes.oneOf(['round', 'extended']) } : void 0; export default withStyles(styles, { name: 'MuiFab' })(Fab);
ajax/libs/material-ui/4.9.4/es/Radio/RadioButtonIcon.js
cdnjs/cdnjs
import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import RadioButtonUncheckedIcon from '../internal/svg-icons/RadioButtonUnchecked'; import RadioButtonCheckedIcon from '../internal/svg-icons/RadioButtonChecked'; import withStyles from '../styles/withStyles'; export const styles = theme => ({ root: { position: 'relative', display: 'flex', '&$checked $layer': { transform: 'scale(1)', transition: theme.transitions.create('transform', { easing: theme.transitions.easing.easeOut, duration: theme.transitions.duration.shortest }) } }, layer: { left: 0, position: 'absolute', transform: 'scale(0)', transition: theme.transitions.create('transform', { easing: theme.transitions.easing.easeIn, duration: theme.transitions.duration.shortest }) }, checked: {} }); /** * @ignore - internal component. */ function RadioButtonIcon(props) { const { checked, classes, fontSize } = props; return React.createElement("div", { className: clsx(classes.root, checked && classes.checked) }, React.createElement(RadioButtonUncheckedIcon, { fontSize: fontSize }), React.createElement(RadioButtonCheckedIcon, { fontSize: fontSize, className: classes.layer })); } process.env.NODE_ENV !== "production" ? RadioButtonIcon.propTypes = { /** * If `true`, the component is checked. */ checked: PropTypes.bool, /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * The size of the radio. * `small` is equivalent to the dense radio styling. */ fontSize: PropTypes.oneOf(['small', 'default']) } : void 0; export default withStyles(styles, { name: 'PrivateRadioButtonIcon' })(RadioButtonIcon);
ajax/libs/react-native-web/0.0.0-dfb716c98/exports/Touchable/index.js
cdnjs/cdnjs
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * * @format */ 'use strict'; function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { 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; } import AccessibilityUtil from '../../modules/AccessibilityUtil'; import BoundingDimensions from './BoundingDimensions'; import findNodeHandle from '../findNodeHandle'; import normalizeColor from 'normalize-css-color'; import Position from './Position'; import React from 'react'; import UIManager from '../UIManager'; import View from '../View'; var extractSingleTouch = function extractSingleTouch(nativeEvent) { var touches = nativeEvent.touches; var changedTouches = nativeEvent.changedTouches; var hasTouches = touches && touches.length > 0; var hasChangedTouches = changedTouches && changedTouches.length > 0; return !hasTouches && hasChangedTouches ? changedTouches[0] : hasTouches ? touches[0] : nativeEvent; }; /** * `Touchable`: Taps done right. * * You hook your `ResponderEventPlugin` events into `Touchable`. `Touchable` * will measure time/geometry and tells you when to give feedback to the user. * * ====================== Touchable Tutorial =============================== * The `Touchable` mixin helps you handle the "press" interaction. It analyzes * the geometry of elements, and observes when another responder (scroll view * etc) has stolen the touch lock. It notifies your component when it should * give feedback to the user. (bouncing/highlighting/unhighlighting). * * - When a touch was activated (typically you highlight) * - When a touch was deactivated (typically you unhighlight) * - When a touch was "pressed" - a touch ended while still within the geometry * of the element, and no other element (like scroller) has "stolen" touch * lock ("responder") (Typically you bounce the element). * * A good tap interaction isn't as simple as you might think. There should be a * slight delay before showing a highlight when starting a touch. If a * subsequent touch move exceeds the boundary of the element, it should * unhighlight, but if that same touch is brought back within the boundary, it * should rehighlight again. A touch can move in and out of that boundary * several times, each time toggling highlighting, but a "press" is only * triggered if that touch ends while within the element's boundary and no * scroller (or anything else) has stolen the lock on touches. * * To create a new type of component that handles interaction using the * `Touchable` mixin, do the following: * * - Initialize the `Touchable` state. * * getInitialState: function() { * return merge(this.touchableGetInitialState(), yourComponentState); * } * * - Choose the rendered component who's touches should start the interactive * sequence. On that rendered node, forward all `Touchable` responder * handlers. You can choose any rendered node you like. Choose a node whose * hit target you'd like to instigate the interaction sequence: * * // In render function: * return ( * <View * onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder} * onResponderTerminationRequest={this.touchableHandleResponderTerminationRequest} * onResponderGrant={this.touchableHandleResponderGrant} * onResponderMove={this.touchableHandleResponderMove} * onResponderRelease={this.touchableHandleResponderRelease} * onResponderTerminate={this.touchableHandleResponderTerminate}> * <View> * Even though the hit detection/interactions are triggered by the * wrapping (typically larger) node, we usually end up implementing * custom logic that highlights this inner one. * </View> * </View> * ); * * - You may set up your own handlers for each of these events, so long as you * also invoke the `touchable*` handlers inside of your custom handler. * * - Implement the handlers on your component class in order to provide * feedback to the user. See documentation for each of these class methods * that you should implement. * * touchableHandlePress: function() { * this.performBounceAnimation(); // or whatever you want to do. * }, * touchableHandleActivePressIn: function() { * this.beginHighlighting(...); // Whatever you like to convey activation * }, * touchableHandleActivePressOut: function() { * this.endHighlighting(...); // Whatever you like to convey deactivation * }, * * - There are more advanced methods you can implement (see documentation below): * touchableGetHighlightDelayMS: function() { * return 20; * } * // In practice, *always* use a predeclared constant (conserve memory). * touchableGetPressRectOffset: function() { * return {top: 20, left: 20, right: 20, bottom: 100}; * } */ /** * Touchable states. */ var States = { NOT_RESPONDER: 'NOT_RESPONDER', // Not the responder RESPONDER_INACTIVE_PRESS_IN: 'RESPONDER_INACTIVE_PRESS_IN', // Responder, inactive, in the `PressRect` RESPONDER_INACTIVE_PRESS_OUT: 'RESPONDER_INACTIVE_PRESS_OUT', // Responder, inactive, out of `PressRect` RESPONDER_ACTIVE_PRESS_IN: 'RESPONDER_ACTIVE_PRESS_IN', // Responder, active, in the `PressRect` RESPONDER_ACTIVE_PRESS_OUT: 'RESPONDER_ACTIVE_PRESS_OUT', // Responder, active, out of `PressRect` RESPONDER_ACTIVE_LONG_PRESS_IN: 'RESPONDER_ACTIVE_LONG_PRESS_IN', // Responder, active, in the `PressRect`, after long press threshold RESPONDER_ACTIVE_LONG_PRESS_OUT: 'RESPONDER_ACTIVE_LONG_PRESS_OUT', // Responder, active, out of `PressRect`, after long press threshold ERROR: 'ERROR' }; /* * Quick lookup map for states that are considered to be "active" */ var baseStatesConditions = { NOT_RESPONDER: false, RESPONDER_INACTIVE_PRESS_IN: false, RESPONDER_INACTIVE_PRESS_OUT: false, RESPONDER_ACTIVE_PRESS_IN: false, RESPONDER_ACTIVE_PRESS_OUT: false, RESPONDER_ACTIVE_LONG_PRESS_IN: false, RESPONDER_ACTIVE_LONG_PRESS_OUT: false, ERROR: false }; var IsActive = _objectSpread({}, baseStatesConditions, { RESPONDER_ACTIVE_PRESS_OUT: true, RESPONDER_ACTIVE_PRESS_IN: true }); /** * Quick lookup for states that are considered to be "pressing" and are * therefore eligible to result in a "selection" if the press stops. */ var IsPressingIn = _objectSpread({}, baseStatesConditions, { RESPONDER_INACTIVE_PRESS_IN: true, RESPONDER_ACTIVE_PRESS_IN: true, RESPONDER_ACTIVE_LONG_PRESS_IN: true }); var IsLongPressingIn = _objectSpread({}, baseStatesConditions, { RESPONDER_ACTIVE_LONG_PRESS_IN: true }); /** * Inputs to the state machine. */ var Signals = { DELAY: 'DELAY', RESPONDER_GRANT: 'RESPONDER_GRANT', RESPONDER_RELEASE: 'RESPONDER_RELEASE', RESPONDER_TERMINATED: 'RESPONDER_TERMINATED', ENTER_PRESS_RECT: 'ENTER_PRESS_RECT', LEAVE_PRESS_RECT: 'LEAVE_PRESS_RECT', LONG_PRESS_DETECTED: 'LONG_PRESS_DETECTED' }; /** * Mapping from States x Signals => States */ var Transitions = { NOT_RESPONDER: { DELAY: States.ERROR, RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN, RESPONDER_RELEASE: States.ERROR, RESPONDER_TERMINATED: States.ERROR, ENTER_PRESS_RECT: States.ERROR, LEAVE_PRESS_RECT: States.ERROR, LONG_PRESS_DETECTED: States.ERROR }, RESPONDER_INACTIVE_PRESS_IN: { DELAY: States.RESPONDER_ACTIVE_PRESS_IN, RESPONDER_GRANT: States.ERROR, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN, LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT, LONG_PRESS_DETECTED: States.ERROR }, RESPONDER_INACTIVE_PRESS_OUT: { DELAY: States.RESPONDER_ACTIVE_PRESS_OUT, RESPONDER_GRANT: States.ERROR, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN, LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT, LONG_PRESS_DETECTED: States.ERROR }, RESPONDER_ACTIVE_PRESS_IN: { DELAY: States.ERROR, RESPONDER_GRANT: States.ERROR, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN, LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT, LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN }, RESPONDER_ACTIVE_PRESS_OUT: { DELAY: States.ERROR, RESPONDER_GRANT: States.ERROR, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN, LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT, LONG_PRESS_DETECTED: States.ERROR }, RESPONDER_ACTIVE_LONG_PRESS_IN: { DELAY: States.ERROR, RESPONDER_GRANT: States.ERROR, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN, LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT, LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN }, RESPONDER_ACTIVE_LONG_PRESS_OUT: { DELAY: States.ERROR, RESPONDER_GRANT: States.ERROR, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN, LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT, LONG_PRESS_DETECTED: States.ERROR }, error: { DELAY: States.NOT_RESPONDER, RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN, RESPONDER_RELEASE: States.NOT_RESPONDER, RESPONDER_TERMINATED: States.NOT_RESPONDER, ENTER_PRESS_RECT: States.NOT_RESPONDER, LEAVE_PRESS_RECT: States.NOT_RESPONDER, LONG_PRESS_DETECTED: States.NOT_RESPONDER } }; // ==== Typical Constants for integrating into UI components ==== // var HIT_EXPAND_PX = 20; // var HIT_VERT_OFFSET_PX = 10; var HIGHLIGHT_DELAY_MS = 130; var PRESS_EXPAND_PX = 20; var LONG_PRESS_THRESHOLD = 500; var LONG_PRESS_DELAY_MS = LONG_PRESS_THRESHOLD - HIGHLIGHT_DELAY_MS; var LONG_PRESS_ALLOWED_MOVEMENT = 10; // Default amount "active" region protrudes beyond box /** * By convention, methods prefixed with underscores are meant to be @private, * and not @protected. Mixers shouldn't access them - not even to provide them * as callback handlers. * * * ========== Geometry ========= * `Touchable` only assumes that there exists a `HitRect` node. The `PressRect` * is an abstract box that is extended beyond the `HitRect`. * * +--------------------------+ * | | - "Start" events in `HitRect` cause `HitRect` * | +--------------------+ | to become the responder. * | | +--------------+ | | - `HitRect` is typically expanded around * | | | | | | the `VisualRect`, but shifted downward. * | | | VisualRect | | | - After pressing down, after some delay, * | | | | | | and before letting up, the Visual React * | | +--------------+ | | will become "active". This makes it eligible * | | HitRect | | for being highlighted (so long as the * | +--------------------+ | press remains in the `PressRect`). * | PressRect o | * +----------------------|---+ * Out Region | * +-----+ This gap between the `HitRect` and * `PressRect` allows a touch to move far away * from the original hit rect, and remain * highlighted, and eligible for a "Press". * Customize this via * `touchableGetPressRectOffset()`. * * * * ======= State Machine ======= * * +-------------+ <---+ RESPONDER_RELEASE * |NOT_RESPONDER| * +-------------+ <---+ RESPONDER_TERMINATED * + * | RESPONDER_GRANT (HitRect) * v * +---------------------------+ DELAY +-------------------------+ T + DELAY +------------------------------+ * |RESPONDER_INACTIVE_PRESS_IN|+-------->|RESPONDER_ACTIVE_PRESS_IN| +------------> |RESPONDER_ACTIVE_LONG_PRESS_IN| * +---------------------------+ +-------------------------+ +------------------------------+ * + ^ + ^ + ^ * |LEAVE_ |ENTER_ |LEAVE_ |ENTER_ |LEAVE_ |ENTER_ * |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT * | | | | | | * v + v + v + * +----------------------------+ DELAY +--------------------------+ +-------------------------------+ * |RESPONDER_INACTIVE_PRESS_OUT|+------->|RESPONDER_ACTIVE_PRESS_OUT| |RESPONDER_ACTIVE_LONG_PRESS_OUT| * +----------------------------+ +--------------------------+ +-------------------------------+ * * T + DELAY => LONG_PRESS_DELAY_MS + DELAY * * Not drawn are the side effects of each transition. The most important side * effect is the `touchableHandlePress` abstract method invocation that occurs * when a responder is released while in either of the "Press" states. * * The other important side effects are the highlight abstract method * invocations (internal callbacks) to be implemented by the mixer. * * * @lends Touchable.prototype */ var TouchableMixin = { // HACK (part 1): basic support for touchable interactions using a keyboard componentDidMount: function componentDidMount() { var _this = this; this._touchableNode = findNodeHandle(this); if (this._touchableNode && this._touchableNode.addEventListener) { this._touchableBlurListener = function (e) { if (_this._isTouchableKeyboardActive) { if (_this.state.touchable.touchState && _this.state.touchable.touchState !== States.NOT_RESPONDER) { _this.touchableHandleResponderTerminate({ nativeEvent: e }); } _this._isTouchableKeyboardActive = false; } }; this._touchableNode.addEventListener('blur', this._touchableBlurListener); } }, /** * Clear all timeouts on unmount */ componentWillUnmount: function componentWillUnmount() { if (this._touchableNode && this._touchableNode.addEventListener) { this._touchableNode.removeEventListener('blur', this._touchableBlurListener); } this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout); this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout); this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout); }, /** * It's prefer that mixins determine state in this way, having the class * explicitly mix the state in the one and only `getInitialState` method. * * @return {object} State object to be placed inside of * `this.state.touchable`. */ touchableGetInitialState: function touchableGetInitialState() { return { touchable: { touchState: undefined, responderID: null } }; }, // ==== Hooks to Gesture Responder system ==== /** * Must return true if embedded in a native platform scroll view. */ touchableHandleResponderTerminationRequest: function touchableHandleResponderTerminationRequest() { return !this.props.rejectResponderTermination; }, /** * Must return true to start the process of `Touchable`. */ touchableHandleStartShouldSetResponder: function touchableHandleStartShouldSetResponder() { return !this.props.disabled; }, /** * Return true to cancel press on long press. */ touchableLongPressCancelsPress: function touchableLongPressCancelsPress() { return true; }, /** * Place as callback for a DOM element's `onResponderGrant` event. * @param {SyntheticEvent} e Synthetic event from event system. * */ touchableHandleResponderGrant: function touchableHandleResponderGrant(e) { var dispatchID = e.currentTarget; // Since e is used in a callback invoked on another event loop // (as in setTimeout etc), we need to call e.persist() on the // event to make sure it doesn't get reused in the event object pool. e.persist(); this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout); this.pressOutDelayTimeout = null; this.state.touchable.touchState = States.NOT_RESPONDER; this.state.touchable.responderID = dispatchID; this._receiveSignal(Signals.RESPONDER_GRANT, e); var delayMS = this.touchableGetHighlightDelayMS !== undefined ? Math.max(this.touchableGetHighlightDelayMS(), 0) : HIGHLIGHT_DELAY_MS; delayMS = isNaN(delayMS) ? HIGHLIGHT_DELAY_MS : delayMS; if (delayMS !== 0) { this.touchableDelayTimeout = setTimeout(this._handleDelay.bind(this, e), delayMS); } else { this._handleDelay(e); } var longDelayMS = this.touchableGetLongPressDelayMS !== undefined ? Math.max(this.touchableGetLongPressDelayMS(), 10) : LONG_PRESS_DELAY_MS; longDelayMS = isNaN(longDelayMS) ? LONG_PRESS_DELAY_MS : longDelayMS; this.longPressDelayTimeout = setTimeout(this._handleLongDelay.bind(this, e), longDelayMS + delayMS); }, /** * Place as callback for a DOM element's `onResponderRelease` event. */ touchableHandleResponderRelease: function touchableHandleResponderRelease(e) { this.pressInLocation = null; this._receiveSignal(Signals.RESPONDER_RELEASE, e); }, /** * Place as callback for a DOM element's `onResponderTerminate` event. */ touchableHandleResponderTerminate: function touchableHandleResponderTerminate(e) { this.pressInLocation = null; this._receiveSignal(Signals.RESPONDER_TERMINATED, e); }, /** * Place as callback for a DOM element's `onResponderMove` event. */ touchableHandleResponderMove: function touchableHandleResponderMove(e) { // Measurement may not have returned yet. if (!this.state.touchable.positionOnActivate) { return; } var positionOnActivate = this.state.touchable.positionOnActivate; var dimensionsOnActivate = this.state.touchable.dimensionsOnActivate; var pressRectOffset = this.touchableGetPressRectOffset ? this.touchableGetPressRectOffset() : { left: PRESS_EXPAND_PX, right: PRESS_EXPAND_PX, top: PRESS_EXPAND_PX, bottom: PRESS_EXPAND_PX }; var pressExpandLeft = pressRectOffset.left; var pressExpandTop = pressRectOffset.top; var pressExpandRight = pressRectOffset.right; var pressExpandBottom = pressRectOffset.bottom; var hitSlop = this.touchableGetHitSlop ? this.touchableGetHitSlop() : null; if (hitSlop) { pressExpandLeft += hitSlop.left || 0; pressExpandTop += hitSlop.top || 0; pressExpandRight += hitSlop.right || 0; pressExpandBottom += hitSlop.bottom || 0; } var touch = extractSingleTouch(e.nativeEvent); var pageX = touch && touch.pageX; var pageY = touch && touch.pageY; if (this.pressInLocation) { var movedDistance = this._getDistanceBetweenPoints(pageX, pageY, this.pressInLocation.pageX, this.pressInLocation.pageY); if (movedDistance > LONG_PRESS_ALLOWED_MOVEMENT) { this._cancelLongPressDelayTimeout(); } } var isTouchWithinActive = pageX > positionOnActivate.left - pressExpandLeft && pageY > positionOnActivate.top - pressExpandTop && pageX < positionOnActivate.left + dimensionsOnActivate.width + pressExpandRight && pageY < positionOnActivate.top + dimensionsOnActivate.height + pressExpandBottom; if (isTouchWithinActive) { var prevState = this.state.touchable.touchState; this._receiveSignal(Signals.ENTER_PRESS_RECT, e); var curState = this.state.touchable.touchState; if (curState === States.RESPONDER_INACTIVE_PRESS_IN && prevState !== States.RESPONDER_INACTIVE_PRESS_IN) { // fix for t7967420 this._cancelLongPressDelayTimeout(); } } else { this._cancelLongPressDelayTimeout(); this._receiveSignal(Signals.LEAVE_PRESS_RECT, e); } }, /** * Invoked when the item receives focus. Mixers might override this to * visually distinguish the `VisualRect` so that the user knows that it * currently has the focus. Most platforms only support a single element being * focused at a time, in which case there may have been a previously focused * element that was blurred just prior to this. This can be overridden when * using `Touchable.Mixin.withoutDefaultFocusAndBlur`. */ touchableHandleFocus: function touchableHandleFocus(e) { this.props.onFocus && this.props.onFocus(e); }, /** * Invoked when the item loses focus. Mixers might override this to * visually distinguish the `VisualRect` so that the user knows that it * no longer has focus. Most platforms only support a single element being * focused at a time, in which case the focus may have moved to another. * This can be overridden when using * `Touchable.Mixin.withoutDefaultFocusAndBlur`. */ touchableHandleBlur: function touchableHandleBlur(e) { this.props.onBlur && this.props.onBlur(e); }, // ==== Abstract Application Callbacks ==== /** * Invoked when the item should be highlighted. Mixers should implement this * to visually distinguish the `VisualRect` so that the user knows that * releasing a touch will result in a "selection" (analog to click). * * @abstract * touchableHandleActivePressIn: function, */ /** * Invoked when the item is "active" (in that it is still eligible to become * a "select") but the touch has left the `PressRect`. Usually the mixer will * want to unhighlight the `VisualRect`. If the user (while pressing) moves * back into the `PressRect` `touchableHandleActivePressIn` will be invoked * again and the mixer should probably highlight the `VisualRect` again. This * event will not fire on an `touchEnd/mouseUp` event, only move events while * the user is depressing the mouse/touch. * * @abstract * touchableHandleActivePressOut: function */ /** * Invoked when the item is "selected" - meaning the interaction ended by * letting up while the item was either in the state * `RESPONDER_ACTIVE_PRESS_IN` or `RESPONDER_INACTIVE_PRESS_IN`. * * @abstract * touchableHandlePress: function */ /** * Invoked when the item is long pressed - meaning the interaction ended by * letting up while the item was in `RESPONDER_ACTIVE_LONG_PRESS_IN`. If * `touchableHandleLongPress` is *not* provided, `touchableHandlePress` will * be called as it normally is. If `touchableHandleLongPress` is provided, by * default any `touchableHandlePress` callback will not be invoked. To * override this default behavior, override `touchableLongPressCancelsPress` * to return false. As a result, `touchableHandlePress` will be called when * lifting up, even if `touchableHandleLongPress` has also been called. * * @abstract * touchableHandleLongPress: function */ /** * Returns the number of millis to wait before triggering a highlight. * * @abstract * touchableGetHighlightDelayMS: function */ /** * Returns the amount to extend the `HitRect` into the `PressRect`. Positive * numbers mean the size expands outwards. * * @abstract * touchableGetPressRectOffset: function */ // ==== Internal Logic ==== /** * Measures the `HitRect` node on activation. The Bounding rectangle is with * respect to viewport - not page, so adding the `pageXOffset/pageYOffset` * should result in points that are in the same coordinate system as an * event's `globalX/globalY` data values. * * - Consider caching this for the lifetime of the component, or possibly * being able to share this cache between any `ScrollMap` view. * * @sideeffects * @private */ _remeasureMetricsOnActivation: function _remeasureMetricsOnActivation() { var tag = this.state.touchable.responderID; if (tag == null) { return; } UIManager.measure(tag, this._handleQueryLayout); }, _handleQueryLayout: function _handleQueryLayout(l, t, w, h, globalX, globalY) { //don't do anything UIManager failed to measure node if (!l && !t && !w && !h && !globalX && !globalY) { return; } this.state.touchable.positionOnActivate && Position.release(this.state.touchable.positionOnActivate); this.state.touchable.dimensionsOnActivate && // $FlowFixMe BoundingDimensions.release(this.state.touchable.dimensionsOnActivate); this.state.touchable.positionOnActivate = Position.getPooled(globalX, globalY); // $FlowFixMe this.state.touchable.dimensionsOnActivate = BoundingDimensions.getPooled(w, h); }, _handleDelay: function _handleDelay(e) { this.touchableDelayTimeout = null; this._receiveSignal(Signals.DELAY, e); }, _handleLongDelay: function _handleLongDelay(e) { this.longPressDelayTimeout = null; var curState = this.state.touchable.touchState; if (curState !== States.RESPONDER_ACTIVE_PRESS_IN && curState !== States.RESPONDER_ACTIVE_LONG_PRESS_IN) { console.error('Attempted to transition from state `' + curState + '` to `' + States.RESPONDER_ACTIVE_LONG_PRESS_IN + '`, which is not supported. This is ' + 'most likely due to `Touchable.longPressDelayTimeout` not being cancelled.'); } else { this._receiveSignal(Signals.LONG_PRESS_DETECTED, e); } }, /** * Receives a state machine signal, performs side effects of the transition * and stores the new state. Validates the transition as well. * * @param {Signals} signal State machine signal. * @throws Error if invalid state transition or unrecognized signal. * @sideeffects */ _receiveSignal: function _receiveSignal(signal, e) { var responderID = this.state.touchable.responderID; var curState = this.state.touchable.touchState; var nextState = Transitions[curState] && Transitions[curState][signal]; if (!responderID && signal === Signals.RESPONDER_RELEASE) { return; } if (!nextState) { throw new Error('Unrecognized signal `' + signal + '` or state `' + curState + '` for Touchable responder `' + responderID + '`'); } if (nextState === States.ERROR) { throw new Error('Touchable cannot transition from `' + curState + '` to `' + signal + '` for responder `' + responderID + '`'); } if (curState !== nextState) { this._performSideEffectsForTransition(curState, nextState, signal, e); this.state.touchable.touchState = nextState; } }, _cancelLongPressDelayTimeout: function _cancelLongPressDelayTimeout() { this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout); this.longPressDelayTimeout = null; }, _isHighlight: function _isHighlight(state) { return state === States.RESPONDER_ACTIVE_PRESS_IN || state === States.RESPONDER_ACTIVE_LONG_PRESS_IN; }, _savePressInLocation: function _savePressInLocation(e) { var touch = extractSingleTouch(e.nativeEvent); var pageX = touch && touch.pageX; var pageY = touch && touch.pageY; var locationX = touch && touch.locationX; var locationY = touch && touch.locationY; this.pressInLocation = { pageX: pageX, pageY: pageY, locationX: locationX, locationY: locationY }; }, _getDistanceBetweenPoints: function _getDistanceBetweenPoints(aX, aY, bX, bY) { var deltaX = aX - bX; var deltaY = aY - bY; return Math.sqrt(deltaX * deltaX + deltaY * deltaY); }, /** * Will perform a transition between touchable states, and identify any * highlighting or unhighlighting that must be performed for this particular * transition. * * @param {States} curState Current Touchable state. * @param {States} nextState Next Touchable state. * @param {Signal} signal Signal that triggered the transition. * @param {Event} e Native event. * @sideeffects */ _performSideEffectsForTransition: function _performSideEffectsForTransition(curState, nextState, signal, e) { var curIsHighlight = this._isHighlight(curState); var newIsHighlight = this._isHighlight(nextState); var isFinalSignal = signal === Signals.RESPONDER_TERMINATED || signal === Signals.RESPONDER_RELEASE; if (isFinalSignal) { this._cancelLongPressDelayTimeout(); } var isInitialTransition = curState === States.NOT_RESPONDER && nextState === States.RESPONDER_INACTIVE_PRESS_IN; var isActiveTransition = !IsActive[curState] && IsActive[nextState]; if (isInitialTransition || isActiveTransition) { this._remeasureMetricsOnActivation(); } if (IsPressingIn[curState] && signal === Signals.LONG_PRESS_DETECTED) { this.touchableHandleLongPress && this.touchableHandleLongPress(e); } if (newIsHighlight && !curIsHighlight) { this._startHighlight(e); } else if (!newIsHighlight && curIsHighlight) { this._endHighlight(e); } if (IsPressingIn[curState] && signal === Signals.RESPONDER_RELEASE) { var hasLongPressHandler = !!this.props.onLongPress; var pressIsLongButStillCallOnPress = IsLongPressingIn[curState] && ( // We *are* long pressing.. // But either has no long handler !hasLongPressHandler || !this.touchableLongPressCancelsPress()); // or we're told to ignore it. var shouldInvokePress = !IsLongPressingIn[curState] || pressIsLongButStillCallOnPress; if (shouldInvokePress && this.touchableHandlePress) { if (!newIsHighlight && !curIsHighlight) { // we never highlighted because of delay, but we should highlight now this._startHighlight(e); this._endHighlight(e); } this.touchableHandlePress(e); } } this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout); this.touchableDelayTimeout = null; }, _playTouchSound: function _playTouchSound() { UIManager.playTouchSound(); }, _startHighlight: function _startHighlight(e) { this._savePressInLocation(e); this.touchableHandleActivePressIn && this.touchableHandleActivePressIn(e); }, _endHighlight: function _endHighlight(e) { var _this2 = this; if (this.touchableHandleActivePressOut) { if (this.touchableGetPressOutDelayMS && this.touchableGetPressOutDelayMS()) { this.pressOutDelayTimeout = setTimeout(function () { _this2.touchableHandleActivePressOut(e); }, this.touchableGetPressOutDelayMS()); } else { this.touchableHandleActivePressOut(e); } } }, // HACK (part 2): basic support for touchable interactions using a keyboard (including // delays and longPress) touchableHandleKeyEvent: function touchableHandleKeyEvent(e) { var type = e.type, key = e.key; if (key === 'Enter' || key === ' ') { if (type === 'keydown') { if (!this._isTouchableKeyboardActive) { if (!this.state.touchable.touchState || this.state.touchable.touchState === States.NOT_RESPONDER) { this.touchableHandleResponderGrant(e); this._isTouchableKeyboardActive = true; } } } else if (type === 'keyup') { if (this._isTouchableKeyboardActive) { if (this.state.touchable.touchState && this.state.touchable.touchState !== States.NOT_RESPONDER) { this.touchableHandleResponderRelease(e); this._isTouchableKeyboardActive = false; } } } e.stopPropagation(); // prevent the default behaviour unless the Touchable functions as a link // and Enter is pressed if (!(key === 'Enter' && AccessibilityUtil.propsToAriaRole(this.props) === 'link')) { e.preventDefault(); } } }, withoutDefaultFocusAndBlur: {} }; /** * Provide an optional version of the mixin where `touchableHandleFocus` and * `touchableHandleBlur` can be overridden. This allows appropriate defaults to * be set on TV platforms, without breaking existing implementations of * `Touchable`. */ var touchableHandleFocus = TouchableMixin.touchableHandleFocus, touchableHandleBlur = TouchableMixin.touchableHandleBlur, TouchableMixinWithoutDefaultFocusAndBlur = _objectWithoutPropertiesLoose(TouchableMixin, ["touchableHandleFocus", "touchableHandleBlur"]); TouchableMixin.withoutDefaultFocusAndBlur = TouchableMixinWithoutDefaultFocusAndBlur; var Touchable = { Mixin: TouchableMixin, TOUCH_TARGET_DEBUG: false, // Highlights all touchable targets. Toggle with Inspector. /** * Renders a debugging overlay to visualize touch target with hitSlop (might not work on Android). */ renderDebugView: function renderDebugView(_ref) { var color = _ref.color, hitSlop = _ref.hitSlop; if (!Touchable.TOUCH_TARGET_DEBUG) { return null; } if (process.env.NODE_ENV !== 'production') { throw Error('Touchable.TOUCH_TARGET_DEBUG should not be enabled in prod!'); } var debugHitSlopStyle = {}; hitSlop = hitSlop || { top: 0, bottom: 0, left: 0, right: 0 }; for (var key in hitSlop) { debugHitSlopStyle[key] = -hitSlop[key]; } var normalizedColor = normalizeColor(color); if (typeof normalizedColor !== 'number') { return null; } var hexColor = '#' + ('00000000' + normalizedColor.toString(16)).substr(-8); return React.createElement(View, { pointerEvents: "none", style: _objectSpread({ position: 'absolute', borderColor: hexColor.slice(0, -2) + '55', // More opaque borderWidth: 1, borderStyle: 'dashed', backgroundColor: hexColor.slice(0, -2) + '0F' }, debugHitSlopStyle) }); } }; export default Touchable;