webpackJsonp([28],{ /***/ "CdOH": /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /***/ "Y3eA": /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault = __webpack_require__("ouCL"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _classCallCheck2 = _interopRequireDefault(__webpack_require__("Q9dM")); var _createClass2 = _interopRequireDefault(__webpack_require__("wm7F")); var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__("F6AD")); var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__("fghW")); var _inherits2 = _interopRequireDefault(__webpack_require__("QwVp")); __webpack_require__("yQBS"); var _tabs = _interopRequireDefault(__webpack_require__("qA/u")); var _react = _interopRequireWildcard(__webpack_require__("GiK3")); var ajax = _interopRequireWildcard(__webpack_require__("H/Zg")); var _router = __webpack_require__("7xWd"); var _dva = __webpack_require__("S6G3"); var _dec, _class; /** * 保险商城 */ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); } function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } var TabPane = _tabs.default.TabPane; var InsuranceDetails = exports.default = (_dec = (0, _dva.connect)(function (state) { return { global: state.global }; }), _dec(_class = /*#__PURE__*/function (_Component) { function InsuranceDetails(props, context) { var _this; (0, _classCallCheck2.default)(this, InsuranceDetails); _this = _callSuper(this, InsuranceDetails, [props, context]); //在线购买保险的链接生成 _this._messageOnline = function () { ajax.getOnlineInsBlbLink({ comId: _this.props.global.companyInfo.comId }).then(function (data) { _this.setState({ url: data.data }); }); }; _this.state = { url: '' }; return _this; } (0, _inherits2.default)(InsuranceDetails, _Component); return (0, _createClass2.default)(InsuranceDetails, [{ key: "componentDidMount", value: function componentDidMount() { // 获取商城链接 var params = new URLSearchParams(this.props.location.search); var url = decodeURIComponent(params.get('url')); if (url != 'null') { this.setState({ url: url }); } else { this._messageOnline(); } } }, { key: "render", value: function render() { // console.log(this.props.location.state.url) return /*#__PURE__*/_react.default.createElement("div", null, this.state.url && /*#__PURE__*/_react.default.createElement("iframe", { title: "\u8D2D\u4E70\u5728\u7EBF\u4FDD\u9669", src: this.state.url, style: { height: 'calc(100vh)' }, width: "100%", frameBorder: "0", allowFullScreen: true, allowtransparency: "true" }, "\u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301iframe\uFF0C\u8BF7\u5347\u7EA7")); } }]); }(_react.Component)) || _class); /***/ }), /***/ "qA/u": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); // EXTERNAL MODULE: ./node_modules/react/index.js var react = __webpack_require__("GiK3"); var react_default = /*#__PURE__*/__webpack_require__.n(react); // EXTERNAL MODULE: ./node_modules/react-dom/index.js var react_dom = __webpack_require__("O27J"); var react_dom_default = /*#__PURE__*/__webpack_require__.n(react_dom); // EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/extends.js var helpers_extends = __webpack_require__("Dd8w"); var extends_default = /*#__PURE__*/__webpack_require__.n(helpers_extends); // EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/defineProperty.js var defineProperty = __webpack_require__("bOdI"); var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty); // EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/objectWithoutProperties.js var objectWithoutProperties = __webpack_require__("+6Bu"); var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties); // EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/classCallCheck.js var classCallCheck = __webpack_require__("Zrlr"); var classCallCheck_default = /*#__PURE__*/__webpack_require__.n(classCallCheck); // EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/createClass.js var createClass = __webpack_require__("wxAW"); var createClass_default = /*#__PURE__*/__webpack_require__.n(createClass); // EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/possibleConstructorReturn.js var possibleConstructorReturn = __webpack_require__("zwoO"); var possibleConstructorReturn_default = /*#__PURE__*/__webpack_require__.n(possibleConstructorReturn); // EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/inherits.js var inherits = __webpack_require__("Pf15"); var inherits_default = /*#__PURE__*/__webpack_require__.n(inherits); // EXTERNAL MODULE: ./node_modules/prop-types/index.js var prop_types = __webpack_require__("KSGD"); var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types); // EXTERNAL MODULE: ./node_modules/classnames/index.js var classnames = __webpack_require__("HW6M"); var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); // EXTERNAL MODULE: ./node_modules/raf/index.js var raf = __webpack_require__("ommR"); var raf_default = /*#__PURE__*/__webpack_require__.n(raf); // EXTERNAL MODULE: ./node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js var react_lifecycles_compat_es = __webpack_require__("R8mX"); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/KeyCode.js /* harmony default export */ var KeyCode = ({ /** * LEFT */ LEFT: 37, // also NUM_WEST /** * UP */ UP: 38, // also NUM_NORTH /** * RIGHT */ RIGHT: 39, // also NUM_EAST /** * DOWN */ DOWN: 40 // also NUM_SOUTH }); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/utils.js function toArray(children) { // allow [c,[a,b]] var c = []; react_default.a.Children.forEach(children, function (child) { if (child) { c.push(child); } }); return c; } function getActiveIndex(children, activeKey) { var c = toArray(children); for (var i = 0; i < c.length; i++) { if (c[i].key === activeKey) { return i; } } return -1; } function getActiveKey(children, index) { var c = toArray(children); return c[index].key; } function setTransform(style, v) { style.transform = v; style.webkitTransform = v; style.mozTransform = v; } function isTransform3dSupported(style) { return ('transform' in style || 'webkitTransform' in style || 'MozTransform' in style) && window.atob; } function setTransition(style, v) { style.transition = v; style.webkitTransition = v; style.MozTransition = v; } function getTransformPropValue(v) { return { transform: v, WebkitTransform: v, MozTransform: v }; } function utils_isVertical(tabBarPosition) { return tabBarPosition === 'left' || tabBarPosition === 'right'; } function getTransformByIndex(index, tabBarPosition) { var direction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'ltr'; var translate = utils_isVertical(tabBarPosition) ? 'translateY' : 'translateX'; if (!utils_isVertical(tabBarPosition) && direction === 'rtl') { return translate + '(' + index * 100 + '%) translateZ(0)'; } return translate + '(' + -index * 100 + '%) translateZ(0)'; } function getMarginStyle(index, tabBarPosition) { var marginDirection = utils_isVertical(tabBarPosition) ? 'marginTop' : 'marginLeft'; return defineProperty_default()({}, marginDirection, -index * 100 + '%'); } function getStyle(el, property) { return +window.getComputedStyle(el).getPropertyValue(property).replace('px', ''); } function setPxStyle(el, value, vertical) { value = vertical ? '0px, ' + value + 'px, 0px' : value + 'px, 0px, 0px'; setTransform(el.style, 'translate3d(' + value + ')'); } function getDataAttr(props) { return Object.keys(props).reduce(function (prev, key) { if (key.substr(0, 5) === 'aria-' || key.substr(0, 5) === 'data-' || key === 'role') { prev[key] = props[key]; } return prev; }, {}); } function toNum(style, property) { return +style.getPropertyValue(property).replace('px', ''); } function getTypeValue(start, current, end, tabNode, wrapperNode) { var total = getStyle(wrapperNode, 'padding-' + start); if (!tabNode || !tabNode.parentNode) { return total; } var childNodes = tabNode.parentNode.childNodes; Array.prototype.some.call(childNodes, function (node) { var style = window.getComputedStyle(node); if (node !== tabNode) { total += toNum(style, 'margin-' + start); total += node[current]; total += toNum(style, 'margin-' + end); if (style.boxSizing === 'content-box') { total += toNum(style, 'border-' + start + '-width') + toNum(style, 'border-' + end + '-width'); } return false; } // We need count current node margin // ref: https://github.com/react-component/tabs/pull/139#issuecomment-431005262 total += toNum(style, 'margin-' + start); return true; }); return total; } function getLeft(tabNode, wrapperNode) { return getTypeValue('left', 'offsetWidth', 'right', tabNode, wrapperNode); } function getTop(tabNode, wrapperNode) { return getTypeValue('top', 'offsetHeight', 'bottom', tabNode, wrapperNode); } // EXTERNAL MODULE: ./node_modules/rc-util/es/KeyCode.js var es_KeyCode = __webpack_require__("opmb"); // EXTERNAL MODULE: ./node_modules/@ant-design/create-react-context/lib/index.js var lib = __webpack_require__("83O8"); var lib_default = /*#__PURE__*/__webpack_require__.n(lib); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/Sentinel.js /* eslint-disable jsx-a11y/no-noninteractive-tabindex */ var SentinelContext = lib_default()({}); var SentinelProvider = SentinelContext.Provider; var SentinelConsumer = SentinelContext.Consumer; var sentinelStyle = { width: 0, height: 0, overflow: 'hidden', position: 'absolute' }; var Sentinel_Sentinel = function (_React$Component) { inherits_default()(Sentinel, _React$Component); function Sentinel() { var _ref; var _temp, _this, _ret; classCallCheck_default()(this, Sentinel); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _ret = (_temp = (_this = possibleConstructorReturn_default()(this, (_ref = Sentinel.__proto__ || Object.getPrototypeOf(Sentinel)).call.apply(_ref, [this].concat(args))), _this), _this.onKeyDown = function (_ref2) { var target = _ref2.target, which = _ref2.which, shiftKey = _ref2.shiftKey; var _this$props = _this.props, nextElement = _this$props.nextElement, prevElement = _this$props.prevElement; if (which !== es_KeyCode["a" /* default */].TAB || document.activeElement !== target) return; // Tab next if (!shiftKey && nextElement) { nextElement.focus(); } // Tab prev if (shiftKey && prevElement) { prevElement.focus(); } }, _temp), possibleConstructorReturn_default()(_this, _ret); } createClass_default()(Sentinel, [{ key: 'render', value: function render() { var setRef = this.props.setRef; return react_default.a.createElement('div', { tabIndex: 0, ref: setRef, style: sentinelStyle, onKeyDown: this.onKeyDown, role: 'presentation' }); } }]); return Sentinel; }(react_default.a.Component); Sentinel_Sentinel.propTypes = { setRef: prop_types_default.a.func, prevElement: prop_types_default.a.object, nextElement: prop_types_default.a.object }; /* harmony default export */ var es_Sentinel = (Sentinel_Sentinel); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/TabPane.js var TabPane_TabPane = function (_React$Component) { inherits_default()(TabPane, _React$Component); function TabPane() { classCallCheck_default()(this, TabPane); return possibleConstructorReturn_default()(this, (TabPane.__proto__ || Object.getPrototypeOf(TabPane)).apply(this, arguments)); } createClass_default()(TabPane, [{ key: 'render', value: function render() { var _classnames; var _props = this.props, id = _props.id, className = _props.className, destroyInactiveTabPane = _props.destroyInactiveTabPane, active = _props.active, forceRender = _props.forceRender, rootPrefixCls = _props.rootPrefixCls, style = _props.style, children = _props.children, placeholder = _props.placeholder, restProps = objectWithoutProperties_default()(_props, ['id', 'className', 'destroyInactiveTabPane', 'active', 'forceRender', 'rootPrefixCls', 'style', 'children', 'placeholder']); this._isActived = this._isActived || active; var prefixCls = rootPrefixCls + '-tabpane'; var cls = classnames_default()((_classnames = {}, defineProperty_default()(_classnames, prefixCls, 1), defineProperty_default()(_classnames, prefixCls + '-inactive', !active), defineProperty_default()(_classnames, prefixCls + '-active', active), defineProperty_default()(_classnames, className, className), _classnames)); var isRender = destroyInactiveTabPane ? active : this._isActived; var shouldRender = isRender || forceRender; return react_default.a.createElement( SentinelConsumer, null, function (_ref) { var sentinelStart = _ref.sentinelStart, sentinelEnd = _ref.sentinelEnd, setPanelSentinelStart = _ref.setPanelSentinelStart, setPanelSentinelEnd = _ref.setPanelSentinelEnd; // Create sentinel var panelSentinelStart = void 0; var panelSentinelEnd = void 0; if (active && shouldRender) { panelSentinelStart = react_default.a.createElement(es_Sentinel, { setRef: setPanelSentinelStart, prevElement: sentinelStart }); panelSentinelEnd = react_default.a.createElement(es_Sentinel, { setRef: setPanelSentinelEnd, nextElement: sentinelEnd }); } return react_default.a.createElement( 'div', extends_default()({ style: style, role: 'tabpanel', 'aria-hidden': active ? 'false' : 'true', className: cls, id: id }, getDataAttr(restProps)), panelSentinelStart, shouldRender ? children : placeholder, panelSentinelEnd ); } ); } }]); return TabPane; }(react_default.a.Component); /* harmony default export */ var es_TabPane = (TabPane_TabPane); TabPane_TabPane.propTypes = { className: prop_types_default.a.string, active: prop_types_default.a.bool, style: prop_types_default.a.any, destroyInactiveTabPane: prop_types_default.a.bool, forceRender: prop_types_default.a.bool, placeholder: prop_types_default.a.node, rootPrefixCls: prop_types_default.a.string, children: prop_types_default.a.node, id: prop_types_default.a.string }; TabPane_TabPane.defaultProps = { placeholder: null }; // CONCATENATED MODULE: ./node_modules/rc-tabs/es/Tabs.js function noop() {} function getDefaultActiveKey(props) { var activeKey = void 0; react_default.a.Children.forEach(props.children, function (child) { if (child && !activeKey && !child.props.disabled) { activeKey = child.key; } }); return activeKey; } function activeKeyIsValid(props, key) { var keys = react_default.a.Children.map(props.children, function (child) { return child && child.key; }); return keys.indexOf(key) >= 0; } var Tabs_Tabs = function (_React$Component) { inherits_default()(Tabs, _React$Component); function Tabs(props) { classCallCheck_default()(this, Tabs); var _this = possibleConstructorReturn_default()(this, (Tabs.__proto__ || Object.getPrototypeOf(Tabs)).call(this, props)); Tabs__initialiseProps.call(_this); var activeKey = void 0; if ('activeKey' in props) { activeKey = props.activeKey; } else if ('defaultActiveKey' in props) { activeKey = props.defaultActiveKey; } else { activeKey = getDefaultActiveKey(props); } _this.state = { activeKey: activeKey }; return _this; } createClass_default()(Tabs, [{ key: 'componentWillUnmount', value: function componentWillUnmount() { this.destroy = true; raf_default.a.cancel(this.sentinelId); } // Sentinel for tab index }, { key: 'updateSentinelContext', value: function updateSentinelContext() { var _this2 = this; if (this.destroy) return; raf_default.a.cancel(this.sentinelId); this.sentinelId = raf_default()(function () { if (_this2.destroy) return; _this2.forceUpdate(); }); } }, { key: 'render', value: function render() { var _classnames; var props = this.props; var prefixCls = props.prefixCls, navWrapper = props.navWrapper, tabBarPosition = props.tabBarPosition, className = props.className, renderTabContent = props.renderTabContent, renderTabBar = props.renderTabBar, destroyInactiveTabPane = props.destroyInactiveTabPane, direction = props.direction, restProps = objectWithoutProperties_default()(props, ['prefixCls', 'navWrapper', 'tabBarPosition', 'className', 'renderTabContent', 'renderTabBar', 'destroyInactiveTabPane', 'direction']); var cls = classnames_default()((_classnames = {}, defineProperty_default()(_classnames, prefixCls, 1), defineProperty_default()(_classnames, prefixCls + '-' + tabBarPosition, 1), defineProperty_default()(_classnames, className, !!className), defineProperty_default()(_classnames, prefixCls + '-rtl', direction === 'rtl'), _classnames)); this.tabBar = renderTabBar(); var tabBar = react_default.a.cloneElement(this.tabBar, { prefixCls: prefixCls, navWrapper: navWrapper, key: 'tabBar', onKeyDown: this.onNavKeyDown, tabBarPosition: tabBarPosition, onTabClick: this.onTabClick, panels: props.children, activeKey: this.state.activeKey, direction: this.props.direction }); var tabContent = react_default.a.cloneElement(renderTabContent(), { prefixCls: prefixCls, tabBarPosition: tabBarPosition, activeKey: this.state.activeKey, destroyInactiveTabPane: destroyInactiveTabPane, children: props.children, onChange: this.setActiveKey, key: 'tabContent', direction: this.props.direction }); var sentinelStart = react_default.a.createElement(es_Sentinel, { key: 'sentinelStart', setRef: this.setSentinelStart, nextElement: this.panelSentinelStart }); var sentinelEnd = react_default.a.createElement(es_Sentinel, { key: 'sentinelEnd', setRef: this.setSentinelEnd, prevElement: this.panelSentinelEnd }); var contents = []; if (tabBarPosition === 'bottom') { contents.push(sentinelStart, tabContent, sentinelEnd, tabBar); } else { contents.push(tabBar, sentinelStart, tabContent, sentinelEnd); } return react_default.a.createElement( SentinelProvider, { value: { sentinelStart: this.sentinelStart, sentinelEnd: this.sentinelEnd, setPanelSentinelStart: this.setPanelSentinelStart, setPanelSentinelEnd: this.setPanelSentinelEnd } }, react_default.a.createElement( 'div', extends_default()({ className: cls, style: props.style }, getDataAttr(restProps), { onScroll: this.onScroll }), contents ) ); } }], [{ key: 'getDerivedStateFromProps', value: function getDerivedStateFromProps(props, state) { var newState = {}; if ('activeKey' in props) { newState.activeKey = props.activeKey; } else if (!activeKeyIsValid(props, state.activeKey)) { newState.activeKey = getDefaultActiveKey(props); } if (Object.keys(newState).length > 0) { return newState; } return null; } }]); return Tabs; }(react_default.a.Component); var Tabs__initialiseProps = function _initialiseProps() { var _this3 = this; this.onTabClick = function (activeKey, e) { if (_this3.tabBar.props.onTabClick) { _this3.tabBar.props.onTabClick(activeKey, e); } _this3.setActiveKey(activeKey); }; this.onNavKeyDown = function (e) { var eventKeyCode = e.keyCode; if (eventKeyCode === KeyCode.RIGHT || eventKeyCode === KeyCode.DOWN) { e.preventDefault(); var nextKey = _this3.getNextActiveKey(true); _this3.onTabClick(nextKey); } else if (eventKeyCode === KeyCode.LEFT || eventKeyCode === KeyCode.UP) { e.preventDefault(); var previousKey = _this3.getNextActiveKey(false); _this3.onTabClick(previousKey); } }; this.onScroll = function (_ref) { var target = _ref.target, currentTarget = _ref.currentTarget; if (target === currentTarget && target.scrollLeft > 0) { target.scrollLeft = 0; } }; this.setSentinelStart = function (node) { _this3.sentinelStart = node; }; this.setSentinelEnd = function (node) { _this3.sentinelEnd = node; }; this.setPanelSentinelStart = function (node) { if (node !== _this3.panelSentinelStart) { _this3.updateSentinelContext(); } _this3.panelSentinelStart = node; }; this.setPanelSentinelEnd = function (node) { if (node !== _this3.panelSentinelEnd) { _this3.updateSentinelContext(); } _this3.panelSentinelEnd = node; }; this.setActiveKey = function (activeKey) { if (_this3.state.activeKey !== activeKey) { if (!('activeKey' in _this3.props)) { _this3.setState({ activeKey: activeKey }); } _this3.props.onChange(activeKey); } }; this.getNextActiveKey = function (next) { var activeKey = _this3.state.activeKey; var children = []; react_default.a.Children.forEach(_this3.props.children, function (c) { if (c && !c.props.disabled) { if (next) { children.push(c); } else { children.unshift(c); } } }); var length = children.length; var ret = length && children[0].key; children.forEach(function (child, i) { if (child.key === activeKey) { if (i === length - 1) { ret = children[0].key; } else { ret = children[i + 1].key; } } }); return ret; }; }; Tabs_Tabs.propTypes = { destroyInactiveTabPane: prop_types_default.a.bool, renderTabBar: prop_types_default.a.func.isRequired, renderTabContent: prop_types_default.a.func.isRequired, navWrapper: prop_types_default.a.func, onChange: prop_types_default.a.func, children: prop_types_default.a.node, prefixCls: prop_types_default.a.string, className: prop_types_default.a.string, tabBarPosition: prop_types_default.a.string, style: prop_types_default.a.object, activeKey: prop_types_default.a.string, defaultActiveKey: prop_types_default.a.string, direction: prop_types_default.a.string }; Tabs_Tabs.defaultProps = { prefixCls: 'rc-tabs', destroyInactiveTabPane: false, onChange: noop, navWrapper: function navWrapper(arg) { return arg; }, tabBarPosition: 'top', children: null, style: {}, direction: 'ltr' }; Tabs_Tabs.TabPane = es_TabPane; Object(react_lifecycles_compat_es["polyfill"])(Tabs_Tabs); /* harmony default export */ var es_Tabs = (Tabs_Tabs); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/TabContent.js var TabContent_TabContent = function (_React$Component) { inherits_default()(TabContent, _React$Component); function TabContent() { classCallCheck_default()(this, TabContent); return possibleConstructorReturn_default()(this, (TabContent.__proto__ || Object.getPrototypeOf(TabContent)).apply(this, arguments)); } createClass_default()(TabContent, [{ key: 'getTabPanes', value: function getTabPanes() { var props = this.props; var activeKey = props.activeKey; var children = props.children; var newChildren = []; react_default.a.Children.forEach(children, function (child) { if (!child) { return; } var key = child.key; var active = activeKey === key; newChildren.push(react_default.a.cloneElement(child, { active: active, destroyInactiveTabPane: props.destroyInactiveTabPane, rootPrefixCls: props.prefixCls })); }); return newChildren; } }, { key: 'render', value: function render() { var _classnames; var props = this.props; var prefixCls = props.prefixCls, children = props.children, activeKey = props.activeKey, className = props.className, tabBarPosition = props.tabBarPosition, animated = props.animated, animatedWithMargin = props.animatedWithMargin, direction = props.direction; var style = props.style; var classes = classnames_default()((_classnames = {}, defineProperty_default()(_classnames, prefixCls + '-content', true), defineProperty_default()(_classnames, animated ? prefixCls + '-content-animated' : prefixCls + '-content-no-animated', true), _classnames), className); if (animated) { var activeIndex = getActiveIndex(children, activeKey); if (activeIndex !== -1) { var animatedStyle = animatedWithMargin ? getMarginStyle(activeIndex, tabBarPosition) : getTransformPropValue(getTransformByIndex(activeIndex, tabBarPosition, direction)); style = extends_default()({}, style, animatedStyle); } else { style = extends_default()({}, style, { display: 'none' }); } } return react_default.a.createElement( 'div', { className: classes, style: style }, this.getTabPanes() ); } }]); return TabContent; }(react_default.a.Component); /* harmony default export */ var es_TabContent = (TabContent_TabContent); TabContent_TabContent.propTypes = { animated: prop_types_default.a.bool, animatedWithMargin: prop_types_default.a.bool, prefixCls: prop_types_default.a.string, children: prop_types_default.a.node, activeKey: prop_types_default.a.string, style: prop_types_default.a.any, tabBarPosition: prop_types_default.a.string, className: prop_types_default.a.string, destroyInactiveTabPane: prop_types_default.a.bool, direction: prop_types_default.a.string }; TabContent_TabContent.defaultProps = { animated: true }; // CONCATENATED MODULE: ./node_modules/rc-tabs/es/index.js /* harmony default export */ var es = (es_Tabs); // EXTERNAL MODULE: ./node_modules/antd/node_modules/classnames/index.js var node_modules_classnames = __webpack_require__("kTQ8"); var node_modules_classnames_default = /*#__PURE__*/__webpack_require__.n(node_modules_classnames); // EXTERNAL MODULE: ./node_modules/omit.js/es/index.js var omit_js_es = __webpack_require__("JkBm"); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/InkTabBarNode.js function _componentDidUpdate(component, init) { var _component$props = component.props, styles = _component$props.styles, panels = _component$props.panels, activeKey = _component$props.activeKey, direction = _component$props.direction; var rootNode = component.props.getRef('root'); var wrapNode = component.props.getRef('nav') || rootNode; var inkBarNode = component.props.getRef('inkBar'); var activeTab = component.props.getRef('activeTab'); var inkBarNodeStyle = inkBarNode.style; var tabBarPosition = component.props.tabBarPosition; var activeIndex = getActiveIndex(panels, activeKey); if (init) { // prevent mount animation inkBarNodeStyle.display = 'none'; } if (activeTab) { var tabNode = activeTab; var transformSupported = isTransform3dSupported(inkBarNodeStyle); // Reset current style setTransform(inkBarNodeStyle, ''); inkBarNodeStyle.width = ''; inkBarNodeStyle.height = ''; inkBarNodeStyle.left = ''; inkBarNodeStyle.top = ''; inkBarNodeStyle.bottom = ''; inkBarNodeStyle.right = ''; if (tabBarPosition === 'top' || tabBarPosition === 'bottom') { var left = getLeft(tabNode, wrapNode); var width = tabNode.offsetWidth; // If tabNode'width width equal to wrapNode'width when tabBarPosition is top or bottom // It means no css working, then ink bar should not have width until css is loaded // Fix https://github.com/ant-design/ant-design/issues/7564 if (width === rootNode.offsetWidth) { width = 0; } else if (styles.inkBar && styles.inkBar.width !== undefined) { width = parseFloat(styles.inkBar.width, 10); if (width) { left += (tabNode.offsetWidth - width) / 2; } } if (direction === 'rtl') { left = getStyle(tabNode, 'margin-left') - left; } // use 3d gpu to optimize render if (transformSupported) { setTransform(inkBarNodeStyle, 'translate3d(' + left + 'px,0,0)'); } else { inkBarNodeStyle.left = left + 'px'; } inkBarNodeStyle.width = width + 'px'; } else { var top = getTop(tabNode, wrapNode, true); var height = tabNode.offsetHeight; if (styles.inkBar && styles.inkBar.height !== undefined) { height = parseFloat(styles.inkBar.height, 10); if (height) { top += (tabNode.offsetHeight - height) / 2; } } if (transformSupported) { setTransform(inkBarNodeStyle, 'translate3d(0,' + top + 'px,0)'); inkBarNodeStyle.top = '0'; } else { inkBarNodeStyle.top = top + 'px'; } inkBarNodeStyle.height = height + 'px'; } } inkBarNodeStyle.display = activeIndex !== -1 ? 'block' : 'none'; } var InkTabBarNode_InkTabBarNode = function (_React$Component) { inherits_default()(InkTabBarNode, _React$Component); function InkTabBarNode() { classCallCheck_default()(this, InkTabBarNode); return possibleConstructorReturn_default()(this, (InkTabBarNode.__proto__ || Object.getPrototypeOf(InkTabBarNode)).apply(this, arguments)); } createClass_default()(InkTabBarNode, [{ key: 'componentDidMount', value: function componentDidMount() { var _this2 = this; // ref https://github.com/ant-design/ant-design/issues/8678 // ref https://github.com/react-component/tabs/issues/135 // InkTabBarNode need parent/root ref for calculating position // since parent componentDidMount triggered after child componentDidMount // we're doing a quick fix here to use setTimeout to calculate position // after parent/root component mounted this.timeout = setTimeout(function () { _componentDidUpdate(_this2, true); }, 0); } }, { key: 'componentDidUpdate', value: function componentDidUpdate() { _componentDidUpdate(this); } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { clearTimeout(this.timeout); } }, { key: 'render', value: function render() { var _classnames; var _props = this.props, prefixCls = _props.prefixCls, styles = _props.styles, inkBarAnimated = _props.inkBarAnimated; var className = prefixCls + '-ink-bar'; var classes = classnames_default()((_classnames = {}, defineProperty_default()(_classnames, className, true), defineProperty_default()(_classnames, inkBarAnimated ? className + '-animated' : className + '-no-animated', true), _classnames)); return react_default.a.createElement('div', { style: styles.inkBar, className: classes, key: 'inkBar', ref: this.props.saveRef('inkBar') }); } }]); return InkTabBarNode; }(react_default.a.Component); /* harmony default export */ var es_InkTabBarNode = (InkTabBarNode_InkTabBarNode); InkTabBarNode_InkTabBarNode.propTypes = { prefixCls: prop_types_default.a.string, styles: prop_types_default.a.object, inkBarAnimated: prop_types_default.a.bool, saveRef: prop_types_default.a.func, direction: prop_types_default.a.string }; InkTabBarNode_InkTabBarNode.defaultProps = { prefixCls: '', inkBarAnimated: true, styles: {}, saveRef: function saveRef() {} }; // EXTERNAL MODULE: ./node_modules/warning/warning.js var warning = __webpack_require__("Trj0"); var warning_default = /*#__PURE__*/__webpack_require__.n(warning); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/TabBarTabsNode.js var TabBarTabsNode_TabBarTabsNode = function (_React$Component) { inherits_default()(TabBarTabsNode, _React$Component); function TabBarTabsNode() { classCallCheck_default()(this, TabBarTabsNode); return possibleConstructorReturn_default()(this, (TabBarTabsNode.__proto__ || Object.getPrototypeOf(TabBarTabsNode)).apply(this, arguments)); } createClass_default()(TabBarTabsNode, [{ key: 'render', value: function render() { var _this2 = this; var _props = this.props, children = _props.panels, activeKey = _props.activeKey, prefixCls = _props.prefixCls, tabBarGutter = _props.tabBarGutter, saveRef = _props.saveRef, tabBarPosition = _props.tabBarPosition, renderTabBarNode = _props.renderTabBarNode, direction = _props.direction; var rst = []; react_default.a.Children.forEach(children, function (child, index) { if (!child) { return; } var key = child.key; var cls = activeKey === key ? prefixCls + '-tab-active' : ''; cls += ' ' + prefixCls + '-tab'; var events = {}; if (child.props.disabled) { cls += ' ' + prefixCls + '-tab-disabled'; } else { events = { onClick: _this2.props.onTabClick.bind(_this2, key) }; } var ref = {}; if (activeKey === key) { ref.ref = saveRef('activeTab'); } var gutter = tabBarGutter && index === children.length - 1 ? 0 : tabBarGutter; var marginProperty = direction === 'rtl' ? 'marginLeft' : 'marginRight'; var style = defineProperty_default()({}, utils_isVertical(tabBarPosition) ? 'marginBottom' : marginProperty, gutter); warning_default()('tab' in child.props, 'There must be `tab` property on children of Tabs.'); var node = react_default.a.createElement( 'div', extends_default()({ role: 'tab', 'aria-disabled': child.props.disabled ? 'true' : 'false', 'aria-selected': activeKey === key ? 'true' : 'false' }, events, { className: cls, key: key, style: style }, ref), child.props.tab ); if (renderTabBarNode) { node = renderTabBarNode(node); } rst.push(node); }); return react_default.a.createElement( 'div', { ref: saveRef('navTabsContainer') }, rst ); } }]); return TabBarTabsNode; }(react_default.a.Component); /* harmony default export */ var es_TabBarTabsNode = (TabBarTabsNode_TabBarTabsNode); TabBarTabsNode_TabBarTabsNode.propTypes = { activeKey: prop_types_default.a.string, panels: prop_types_default.a.node, prefixCls: prop_types_default.a.string, tabBarGutter: prop_types_default.a.number, onTabClick: prop_types_default.a.func, saveRef: prop_types_default.a.func, renderTabBarNode: prop_types_default.a.func, tabBarPosition: prop_types_default.a.string, direction: prop_types_default.a.string }; TabBarTabsNode_TabBarTabsNode.defaultProps = { panels: [], prefixCls: [], tabBarGutter: null, onTabClick: function onTabClick() {}, saveRef: function saveRef() {} }; // CONCATENATED MODULE: ./node_modules/rc-tabs/es/TabBarRootNode.js var TabBarRootNode_TabBarRootNode = function (_React$Component) { inherits_default()(TabBarRootNode, _React$Component); function TabBarRootNode() { classCallCheck_default()(this, TabBarRootNode); return possibleConstructorReturn_default()(this, (TabBarRootNode.__proto__ || Object.getPrototypeOf(TabBarRootNode)).apply(this, arguments)); } createClass_default()(TabBarRootNode, [{ key: 'render', value: function render() { var _props = this.props, prefixCls = _props.prefixCls, onKeyDown = _props.onKeyDown, className = _props.className, extraContent = _props.extraContent, style = _props.style, tabBarPosition = _props.tabBarPosition, children = _props.children, restProps = objectWithoutProperties_default()(_props, ['prefixCls', 'onKeyDown', 'className', 'extraContent', 'style', 'tabBarPosition', 'children']); var cls = classnames_default()(prefixCls + '-bar', defineProperty_default()({}, className, !!className)); var topOrBottom = tabBarPosition === 'top' || tabBarPosition === 'bottom'; var tabBarExtraContentStyle = topOrBottom ? { float: 'right' } : {}; var extraContentStyle = extraContent && extraContent.props ? extraContent.props.style : {}; var newChildren = children; if (extraContent) { newChildren = [Object(react["cloneElement"])(extraContent, { key: 'extra', style: extends_default()({}, tabBarExtraContentStyle, extraContentStyle) }), Object(react["cloneElement"])(children, { key: 'content' })]; newChildren = topOrBottom ? newChildren : newChildren.reverse(); } return react_default.a.createElement( 'div', extends_default()({ role: 'tablist', className: cls, tabIndex: '0', ref: this.props.saveRef('root'), onKeyDown: onKeyDown, style: style }, getDataAttr(restProps)), newChildren ); } }]); return TabBarRootNode; }(react_default.a.Component); /* harmony default export */ var es_TabBarRootNode = (TabBarRootNode_TabBarRootNode); TabBarRootNode_TabBarRootNode.propTypes = { prefixCls: prop_types_default.a.string, className: prop_types_default.a.string, style: prop_types_default.a.object, tabBarPosition: prop_types_default.a.oneOf(['left', 'right', 'top', 'bottom']), children: prop_types_default.a.node, extraContent: prop_types_default.a.node, onKeyDown: prop_types_default.a.func, saveRef: prop_types_default.a.func }; TabBarRootNode_TabBarRootNode.defaultProps = { prefixCls: '', className: '', style: {}, tabBarPosition: 'top', extraContent: null, children: null, onKeyDown: function onKeyDown() {}, saveRef: function saveRef() {} }; // EXTERNAL MODULE: ./node_modules/lodash/debounce.js var debounce = __webpack_require__("O4Lo"); var debounce_default = /*#__PURE__*/__webpack_require__.n(debounce); // EXTERNAL MODULE: ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js var ResizeObserver_es = __webpack_require__("z+gd"); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/ScrollableTabBarNode.js var ScrollableTabBarNode_ScrollableTabBarNode = function (_React$Component) { inherits_default()(ScrollableTabBarNode, _React$Component); function ScrollableTabBarNode(props) { classCallCheck_default()(this, ScrollableTabBarNode); var _this = possibleConstructorReturn_default()(this, (ScrollableTabBarNode.__proto__ || Object.getPrototypeOf(ScrollableTabBarNode)).call(this, props)); _this.prevTransitionEnd = function (e) { if (e.propertyName !== 'opacity') { return; } var container = _this.props.getRef('container'); _this.scrollToActiveTab({ target: container, currentTarget: container }); }; _this.scrollToActiveTab = function (e) { var activeTab = _this.props.getRef('activeTab'); var navWrap = _this.props.getRef('navWrap'); if (e && e.target !== e.currentTarget || !activeTab) { return; } // when not scrollable or enter scrollable first time, don't emit scrolling var needToSroll = _this.isNextPrevShown() && _this.lastNextPrevShown; _this.lastNextPrevShown = _this.isNextPrevShown(); if (!needToSroll) { return; } var activeTabWH = _this.getScrollWH(activeTab); var navWrapNodeWH = _this.getOffsetWH(navWrap); var offset = _this.offset; var wrapOffset = _this.getOffsetLT(navWrap); var activeTabOffset = _this.getOffsetLT(activeTab); if (wrapOffset > activeTabOffset) { offset += wrapOffset - activeTabOffset; _this.setOffset(offset); } else if (wrapOffset + navWrapNodeWH < activeTabOffset + activeTabWH) { offset -= activeTabOffset + activeTabWH - (wrapOffset + navWrapNodeWH); _this.setOffset(offset); } }; _this.prev = function (e) { _this.props.onPrevClick(e); var navWrapNode = _this.props.getRef('navWrap'); var navWrapNodeWH = _this.getOffsetWH(navWrapNode); var offset = _this.offset; _this.setOffset(offset + navWrapNodeWH); }; _this.next = function (e) { _this.props.onNextClick(e); var navWrapNode = _this.props.getRef('navWrap'); var navWrapNodeWH = _this.getOffsetWH(navWrapNode); var offset = _this.offset; _this.setOffset(offset - navWrapNodeWH); }; _this.offset = 0; _this.state = { next: false, prev: false }; return _this; } createClass_default()(ScrollableTabBarNode, [{ key: 'componentDidMount', value: function componentDidMount() { var _this2 = this; this.componentDidUpdate(); this.debouncedResize = debounce_default()(function () { _this2.setNextPrev(); _this2.scrollToActiveTab(); }, 200); this.resizeObserver = new ResizeObserver_es["default"](this.debouncedResize); this.resizeObserver.observe(this.props.getRef('container')); } }, { key: 'componentDidUpdate', value: function componentDidUpdate(prevProps) { var props = this.props; if (prevProps && prevProps.tabBarPosition !== props.tabBarPosition) { this.setOffset(0); return; } var nextPrev = this.setNextPrev(); // wait next, prev show hide /* eslint react/no-did-update-set-state:0 */ if (this.isNextPrevShown(this.state) !== this.isNextPrevShown(nextPrev)) { this.setState({}, this.scrollToActiveTab); } else if (!prevProps || props.activeKey !== prevProps.activeKey) { // can not use props.activeKey this.scrollToActiveTab(); } } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { if (this.resizeObserver) { this.resizeObserver.disconnect(); } if (this.debouncedResize && this.debouncedResize.cancel) { this.debouncedResize.cancel(); } } }, { key: 'setNextPrev', value: function setNextPrev() { var navNode = this.props.getRef('nav'); var navTabsContainer = this.props.getRef('navTabsContainer'); var navNodeWH = this.getScrollWH(navTabsContainer || navNode); // Add 1px to fix `offsetWidth` with decimal in Chrome not correct handle // https://github.com/ant-design/ant-design/issues/13423 var containerWH = this.getOffsetWH(this.props.getRef('container')) + 1; var navWrapNodeWH = this.getOffsetWH(this.props.getRef('navWrap')); var offset = this.offset; var minOffset = containerWH - navNodeWH; var _state = this.state, next = _state.next, prev = _state.prev; if (minOffset >= 0) { next = false; this.setOffset(0, false); offset = 0; } else if (minOffset < offset) { next = true; } else { next = false; // Fix https://github.com/ant-design/ant-design/issues/8861 // Test with container offset which is stable // and set the offset of the nav wrap node var realOffset = navWrapNodeWH - navNodeWH; this.setOffset(realOffset, false); offset = realOffset; } if (offset < 0) { prev = true; } else { prev = false; } this.setNext(next); this.setPrev(prev); return { next: next, prev: prev }; } }, { key: 'getOffsetWH', value: function getOffsetWH(node) { var tabBarPosition = this.props.tabBarPosition; var prop = 'offsetWidth'; if (tabBarPosition === 'left' || tabBarPosition === 'right') { prop = 'offsetHeight'; } return node[prop]; } }, { key: 'getScrollWH', value: function getScrollWH(node) { var tabBarPosition = this.props.tabBarPosition; var prop = 'scrollWidth'; if (tabBarPosition === 'left' || tabBarPosition === 'right') { prop = 'scrollHeight'; } return node[prop]; } }, { key: 'getOffsetLT', value: function getOffsetLT(node) { var tabBarPosition = this.props.tabBarPosition; var prop = 'left'; if (tabBarPosition === 'left' || tabBarPosition === 'right') { prop = 'top'; } return node.getBoundingClientRect()[prop]; } }, { key: 'setOffset', value: function setOffset(offset) { var checkNextPrev = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var target = Math.min(0, offset); if (this.offset !== target) { this.offset = target; var navOffset = {}; var tabBarPosition = this.props.tabBarPosition; var navStyle = this.props.getRef('nav').style; var transformSupported = isTransform3dSupported(navStyle); if (tabBarPosition === 'left' || tabBarPosition === 'right') { if (transformSupported) { navOffset = { value: 'translate3d(0,' + target + 'px,0)' }; } else { navOffset = { name: 'top', value: target + 'px' }; } } else if (transformSupported) { if (this.props.direction === 'rtl') { target = -target; } navOffset = { value: 'translate3d(' + target + 'px,0,0)' }; } else { navOffset = { name: 'left', value: target + 'px' }; } if (transformSupported) { setTransform(navStyle, navOffset.value); } else { navStyle[navOffset.name] = navOffset.value; } if (checkNextPrev) { this.setNextPrev(); } } } }, { key: 'setPrev', value: function setPrev(v) { if (this.state.prev !== v) { this.setState({ prev: v }); } } }, { key: 'setNext', value: function setNext(v) { if (this.state.next !== v) { this.setState({ next: v }); } } }, { key: 'isNextPrevShown', value: function isNextPrevShown(state) { if (state) { return state.next || state.prev; } return this.state.next || this.state.prev; } }, { key: 'render', value: function render() { var _classnames, _classnames2, _classnames3, _classnames4; var _state2 = this.state, next = _state2.next, prev = _state2.prev; var _props = this.props, prefixCls = _props.prefixCls, scrollAnimated = _props.scrollAnimated, navWrapper = _props.navWrapper, prevIcon = _props.prevIcon, nextIcon = _props.nextIcon; var showNextPrev = prev || next; var prevButton = react_default.a.createElement( 'span', { onClick: prev ? this.prev : null, unselectable: 'unselectable', className: classnames_default()((_classnames = {}, defineProperty_default()(_classnames, prefixCls + '-tab-prev', 1), defineProperty_default()(_classnames, prefixCls + '-tab-btn-disabled', !prev), defineProperty_default()(_classnames, prefixCls + '-tab-arrow-show', showNextPrev), _classnames)), onTransitionEnd: this.prevTransitionEnd }, prevIcon || react_default.a.createElement('span', { className: prefixCls + '-tab-prev-icon' }) ); var nextButton = react_default.a.createElement( 'span', { onClick: next ? this.next : null, unselectable: 'unselectable', className: classnames_default()((_classnames2 = {}, defineProperty_default()(_classnames2, prefixCls + '-tab-next', 1), defineProperty_default()(_classnames2, prefixCls + '-tab-btn-disabled', !next), defineProperty_default()(_classnames2, prefixCls + '-tab-arrow-show', showNextPrev), _classnames2)) }, nextIcon || react_default.a.createElement('span', { className: prefixCls + '-tab-next-icon' }) ); var navClassName = prefixCls + '-nav'; var navClasses = classnames_default()((_classnames3 = {}, defineProperty_default()(_classnames3, navClassName, true), defineProperty_default()(_classnames3, scrollAnimated ? navClassName + '-animated' : navClassName + '-no-animated', true), _classnames3)); return react_default.a.createElement( 'div', { className: classnames_default()((_classnames4 = {}, defineProperty_default()(_classnames4, prefixCls + '-nav-container', 1), defineProperty_default()(_classnames4, prefixCls + '-nav-container-scrolling', showNextPrev), _classnames4)), key: 'container', ref: this.props.saveRef('container') }, prevButton, nextButton, react_default.a.createElement( 'div', { className: prefixCls + '-nav-wrap', ref: this.props.saveRef('navWrap') }, react_default.a.createElement( 'div', { className: prefixCls + '-nav-scroll' }, react_default.a.createElement( 'div', { className: navClasses, ref: this.props.saveRef('nav') }, navWrapper(this.props.children) ) ) ) ); } }]); return ScrollableTabBarNode; }(react_default.a.Component); /* harmony default export */ var es_ScrollableTabBarNode = (ScrollableTabBarNode_ScrollableTabBarNode); ScrollableTabBarNode_ScrollableTabBarNode.propTypes = { activeKey: prop_types_default.a.string, getRef: prop_types_default.a.func.isRequired, saveRef: prop_types_default.a.func.isRequired, tabBarPosition: prop_types_default.a.oneOf(['left', 'right', 'top', 'bottom']), prefixCls: prop_types_default.a.string, scrollAnimated: prop_types_default.a.bool, onPrevClick: prop_types_default.a.func, onNextClick: prop_types_default.a.func, navWrapper: prop_types_default.a.func, children: prop_types_default.a.node, prevIcon: prop_types_default.a.node, nextIcon: prop_types_default.a.node, direction: prop_types_default.a.node }; ScrollableTabBarNode_ScrollableTabBarNode.defaultProps = { tabBarPosition: 'left', prefixCls: '', scrollAnimated: true, onPrevClick: function onPrevClick() {}, onNextClick: function onNextClick() {}, navWrapper: function navWrapper(ele) { return ele; } }; // CONCATENATED MODULE: ./node_modules/rc-tabs/es/SaveRef.js var SaveRef_SaveRef = function (_React$Component) { inherits_default()(SaveRef, _React$Component); function SaveRef() { var _ref; var _temp, _this, _ret; classCallCheck_default()(this, SaveRef); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _ret = (_temp = (_this = possibleConstructorReturn_default()(this, (_ref = SaveRef.__proto__ || Object.getPrototypeOf(SaveRef)).call.apply(_ref, [this].concat(args))), _this), _this.getRef = function (name) { return _this[name]; }, _this.saveRef = function (name) { return function (node) { if (node) { _this[name] = node; } }; }, _temp), possibleConstructorReturn_default()(_this, _ret); } createClass_default()(SaveRef, [{ key: 'render', value: function render() { return this.props.children(this.saveRef, this.getRef); } }]); return SaveRef; }(react_default.a.Component); /* harmony default export */ var es_SaveRef = (SaveRef_SaveRef); SaveRef_SaveRef.propTypes = { children: prop_types_default.a.func }; SaveRef_SaveRef.defaultProps = { children: function children() { return null; } }; // CONCATENATED MODULE: ./node_modules/rc-tabs/es/ScrollableInkTabBar.js /* eslint-disable react/prefer-stateless-function */ var ScrollableInkTabBar_ScrollableInkTabBar = function (_React$Component) { inherits_default()(ScrollableInkTabBar, _React$Component); function ScrollableInkTabBar() { classCallCheck_default()(this, ScrollableInkTabBar); return possibleConstructorReturn_default()(this, (ScrollableInkTabBar.__proto__ || Object.getPrototypeOf(ScrollableInkTabBar)).apply(this, arguments)); } createClass_default()(ScrollableInkTabBar, [{ key: 'render', value: function render() { var _props = this.props, renderTabBarNode = _props.children, restProps = objectWithoutProperties_default()(_props, ['children']); return react_default.a.createElement( es_SaveRef, null, function (saveRef, getRef) { return react_default.a.createElement( es_TabBarRootNode, extends_default()({ saveRef: saveRef }, restProps), react_default.a.createElement( es_ScrollableTabBarNode, extends_default()({ saveRef: saveRef, getRef: getRef }, restProps), react_default.a.createElement(es_TabBarTabsNode, extends_default()({ saveRef: saveRef, renderTabBarNode: renderTabBarNode }, restProps)), react_default.a.createElement(es_InkTabBarNode, extends_default()({ saveRef: saveRef, getRef: getRef }, restProps)) ) ); } ); } }]); return ScrollableInkTabBar; }(react_default.a.Component); /* harmony default export */ var es_ScrollableInkTabBar = (ScrollableInkTabBar_ScrollableInkTabBar); ScrollableInkTabBar_ScrollableInkTabBar.propTypes = { children: prop_types_default.a.func }; // EXTERNAL MODULE: ./node_modules/antd/es/icon/index.js + 5 modules var icon = __webpack_require__("FC3+"); // CONCATENATED MODULE: ./node_modules/antd/es/tabs/TabBar.js 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 _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 _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 _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 _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 _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var TabBar_TabBar = /*#__PURE__*/function (_React$Component) { _inherits(TabBar, _React$Component); var _super = _createSuper(TabBar); function TabBar() { _classCallCheck(this, TabBar); return _super.apply(this, arguments); } _createClass(TabBar, [{ key: "render", value: function render() { var _classNames; var _this$props = this.props, tabBarStyle = _this$props.tabBarStyle, animated = _this$props.animated, renderTabBar = _this$props.renderTabBar, tabBarExtraContent = _this$props.tabBarExtraContent, tabPosition = _this$props.tabPosition, prefixCls = _this$props.prefixCls, className = _this$props.className, size = _this$props.size, type = _this$props.type; var inkBarAnimated = _typeof(animated) === 'object' ? animated.inkBar : animated; var isVertical = tabPosition === 'left' || tabPosition === 'right'; var prevIconType = isVertical ? 'up' : 'left'; var nextIconType = isVertical ? 'down' : 'right'; var prevIcon = /*#__PURE__*/react["createElement"]("span", { className: "".concat(prefixCls, "-tab-prev-icon") }, /*#__PURE__*/react["createElement"](icon["default"], { type: prevIconType, className: "".concat(prefixCls, "-tab-prev-icon-target") })); var nextIcon = /*#__PURE__*/react["createElement"]("span", { className: "".concat(prefixCls, "-tab-next-icon") }, /*#__PURE__*/react["createElement"](icon["default"], { type: nextIconType, className: "".concat(prefixCls, "-tab-next-icon-target") })); // Additional className for style usage var cls = node_modules_classnames_default()("".concat(prefixCls, "-").concat(tabPosition, "-bar"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-").concat(size, "-bar"), !!size), _defineProperty(_classNames, "".concat(prefixCls, "-card-bar"), type && type.indexOf('card') >= 0), _classNames), className); var renderProps = _extends(_extends({}, this.props), { children: null, inkBarAnimated: inkBarAnimated, extraContent: tabBarExtraContent, style: tabBarStyle, prevIcon: prevIcon, nextIcon: nextIcon, className: cls }); var RenderTabBar; if (renderTabBar) { RenderTabBar = renderTabBar(renderProps, es_ScrollableInkTabBar); } else { RenderTabBar = /*#__PURE__*/react["createElement"](es_ScrollableInkTabBar, renderProps); } return /*#__PURE__*/react["cloneElement"](RenderTabBar); } }]); return TabBar; }(react["Component"]); TabBar_TabBar.defaultProps = { animated: true, type: 'line' }; // EXTERNAL MODULE: ./node_modules/antd/es/config-provider/index.js + 1 modules var config_provider = __webpack_require__("PmSq"); // EXTERNAL MODULE: ./node_modules/antd/es/_util/warning.js var _util_warning = __webpack_require__("qGip"); // CONCATENATED MODULE: ./node_modules/antd/es/_util/styleChecker.js var isStyleSupport = function isStyleSupport(styleName) { if (typeof window !== 'undefined' && window.document && window.document.documentElement) { var styleNameList = Array.isArray(styleName) ? styleName : [styleName]; var documentElement = window.document.documentElement; return styleNameList.some(function (name) { return name in documentElement.style; }); } return false; }; var isFlexSupported = isStyleSupport(['flex', 'webkitFlex', 'Flex', 'msFlex']); /* harmony default export */ var styleChecker = (isStyleSupport); // CONCATENATED MODULE: ./node_modules/antd/es/tabs/index.js /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return tabs_Tabs; }); function tabs__extends() { tabs__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 tabs__extends.apply(this, arguments); } function tabs__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 tabs__typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { tabs__typeof = function _typeof(obj) { return typeof obj; }; } else { tabs__typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return tabs__typeof(obj); } function tabs__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function tabs__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 tabs__createClass(Constructor, protoProps, staticProps) { if (protoProps) tabs__defineProperties(Constructor.prototype, protoProps); if (staticProps) tabs__defineProperties(Constructor, staticProps); return Constructor; } function tabs__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) tabs__setPrototypeOf(subClass, superClass); } function tabs__setPrototypeOf(o, p) { tabs__setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return tabs__setPrototypeOf(o, p); } function tabs__createSuper(Derived) { var hasNativeReflectConstruct = tabs__isNativeReflectConstruct(); return function _createSuperInternal() { var Super = tabs__getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = tabs__getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return tabs__possibleConstructorReturn(this, result); }; } function tabs__possibleConstructorReturn(self, call) { if (call && (tabs__typeof(call) === "object" || typeof call === "function")) { return call; } return tabs__assertThisInitialized(self); } function tabs__assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function tabs__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; } } function tabs__getPrototypeOf(o) { tabs__getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return tabs__getPrototypeOf(o); } var __rest = this && this.__rest || function (s, e) { var t = {}; for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; } if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; var tabs_Tabs = /*#__PURE__*/function (_React$Component) { tabs__inherits(Tabs, _React$Component); var _super = tabs__createSuper(Tabs); function Tabs() { var _this; tabs__classCallCheck(this, Tabs); _this = _super.apply(this, arguments); _this.removeTab = function (targetKey, e) { e.stopPropagation(); if (!targetKey) { return; } var onEdit = _this.props.onEdit; if (onEdit) { onEdit(targetKey, 'remove'); } }; _this.handleChange = function (activeKey) { var onChange = _this.props.onChange; if (onChange) { onChange(activeKey); } }; _this.createNewTab = function (targetKey) { var onEdit = _this.props.onEdit; if (onEdit) { onEdit(targetKey, 'add'); } }; _this.renderTabs = function (_ref) { var _classNames; var getPrefixCls = _ref.getPrefixCls; var _this$props = _this.props, customizePrefixCls = _this$props.prefixCls, _this$props$className = _this$props.className, className = _this$props$className === void 0 ? '' : _this$props$className, size = _this$props.size, _this$props$type = _this$props.type, type = _this$props$type === void 0 ? 'line' : _this$props$type, tabPosition = _this$props.tabPosition, children = _this$props.children, _this$props$animated = _this$props.animated, animated = _this$props$animated === void 0 ? true : _this$props$animated, hideAdd = _this$props.hideAdd; var tabBarExtraContent = _this.props.tabBarExtraContent; var tabPaneAnimated = tabs__typeof(animated) === 'object' ? animated.tabPane : animated; // card tabs should not have animation if (type !== 'line') { tabPaneAnimated = 'animated' in _this.props ? tabPaneAnimated : false; } Object(_util_warning["a" /* default */])(!(type.indexOf('card') >= 0 && (size === 'small' || size === 'large')), 'Tabs', "`type=card|editable-card` doesn't have small or large size, it's by design."); var prefixCls = getPrefixCls('tabs', customizePrefixCls); var cls = node_modules_classnames_default()(className, (_classNames = {}, tabs__defineProperty(_classNames, "".concat(prefixCls, "-vertical"), tabPosition === 'left' || tabPosition === 'right'), tabs__defineProperty(_classNames, "".concat(prefixCls, "-").concat(size), !!size), tabs__defineProperty(_classNames, "".concat(prefixCls, "-card"), type.indexOf('card') >= 0), tabs__defineProperty(_classNames, "".concat(prefixCls, "-").concat(type), true), tabs__defineProperty(_classNames, "".concat(prefixCls, "-no-animation"), !tabPaneAnimated), _classNames)); // only card type tabs can be added and closed var childrenWithClose = []; if (type === 'editable-card') { childrenWithClose = []; react["Children"].forEach(children, function (child, index) { if (! /*#__PURE__*/react["isValidElement"](child)) return child; var closable = child.props.closable; closable = typeof closable === 'undefined' ? true : closable; var closeIcon = closable ? /*#__PURE__*/react["createElement"](icon["default"], { type: "close", className: "".concat(prefixCls, "-close-x"), onClick: function onClick(e) { return _this.removeTab(child.key, e); } }) : null; childrenWithClose.push( /*#__PURE__*/react["cloneElement"](child, { tab: /*#__PURE__*/react["createElement"]("div", { className: closable ? undefined : "".concat(prefixCls, "-tab-unclosable") }, child.props.tab, closeIcon), key: child.key || index })); }); // Add new tab handler if (!hideAdd) { tabBarExtraContent = /*#__PURE__*/react["createElement"]("span", null, /*#__PURE__*/react["createElement"](icon["default"], { type: "plus", className: "".concat(prefixCls, "-new-tab"), onClick: _this.createNewTab }), tabBarExtraContent); } } tabBarExtraContent = tabBarExtraContent ? /*#__PURE__*/react["createElement"]("div", { className: "".concat(prefixCls, "-extra-content") }, tabBarExtraContent) : null; var tabBarProps = __rest(_this.props, []); var contentCls = node_modules_classnames_default()("".concat(prefixCls, "-").concat(tabPosition, "-content"), type.indexOf('card') >= 0 && "".concat(prefixCls, "-card-content")); return /*#__PURE__*/react["createElement"](es, tabs__extends({}, _this.props, { prefixCls: prefixCls, className: cls, tabBarPosition: tabPosition, renderTabBar: function renderTabBar() { return /*#__PURE__*/react["createElement"](TabBar_TabBar, tabs__extends({}, Object(omit_js_es["a" /* default */])(tabBarProps, ['className']), { tabBarExtraContent: tabBarExtraContent })); }, renderTabContent: function renderTabContent() { return /*#__PURE__*/react["createElement"](es_TabContent, { className: contentCls, animated: tabPaneAnimated, animatedWithMargin: true }); }, onChange: _this.handleChange }), childrenWithClose.length > 0 ? childrenWithClose : children); }; return _this; } tabs__createClass(Tabs, [{ key: "componentDidMount", value: function componentDidMount() { var NO_FLEX = ' no-flex'; var tabNode = react_dom["findDOMNode"](this); if (tabNode && !isFlexSupported && tabNode.className.indexOf(NO_FLEX) === -1) { tabNode.className += NO_FLEX; } } }, { key: "render", value: function render() { return /*#__PURE__*/react["createElement"](config_provider["ConfigConsumer"], null, this.renderTabs); } }]); return Tabs; }(react["Component"]); tabs_Tabs.TabPane = es_TabPane; tabs_Tabs.defaultProps = { hideAdd: false, tabPosition: 'top' }; /***/ }), /***/ "yQBS": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__style_index_less__ = __webpack_require__("vtiu"); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__style_index_less___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__style_index_less__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__index_less__ = __webpack_require__("CdOH"); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__index_less___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__index_less__); /***/ }), /***/ "z+gd": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* WEBPACK VAR INJECTION */(function(global) {/** * A collection of shims that provide minimal functionality of the ES6 collections. * * These implementations are not meant to be used outside of the ResizeObserver * modules as they cover only a limited range of use cases. */ /* eslint-disable require-jsdoc, valid-jsdoc */ var MapShim = (function () { if (typeof Map !== 'undefined') { return Map; } /** * Returns index in provided array that matches the specified key. * * @param {Array} arr * @param {*} key * @returns {number} */ function getIndex(arr, key) { var result = -1; arr.some(function (entry, index) { if (entry[0] === key) { result = index; return true; } return false; }); return result; } return /** @class */ (function () { function class_1() { this.__entries__ = []; } Object.defineProperty(class_1.prototype, "size", { /** * @returns {boolean} */ get: function () { return this.__entries__.length; }, enumerable: true, configurable: true }); /** * @param {*} key * @returns {*} */ class_1.prototype.get = function (key) { var index = getIndex(this.__entries__, key); var entry = this.__entries__[index]; return entry && entry[1]; }; /** * @param {*} key * @param {*} value * @returns {void} */ class_1.prototype.set = function (key, value) { var index = getIndex(this.__entries__, key); if (~index) { this.__entries__[index][1] = value; } else { this.__entries__.push([key, value]); } }; /** * @param {*} key * @returns {void} */ class_1.prototype.delete = function (key) { var entries = this.__entries__; var index = getIndex(entries, key); if (~index) { entries.splice(index, 1); } }; /** * @param {*} key * @returns {void} */ class_1.prototype.has = function (key) { return !!~getIndex(this.__entries__, key); }; /** * @returns {void} */ class_1.prototype.clear = function () { this.__entries__.splice(0); }; /** * @param {Function} callback * @param {*} [ctx=null] * @returns {void} */ class_1.prototype.forEach = function (callback, ctx) { if (ctx === void 0) { ctx = null; } for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) { var entry = _a[_i]; callback.call(ctx, entry[1], entry[0]); } }; return class_1; }()); })(); /** * Detects whether window and document objects are available in current environment. */ var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document; // Returns global object of a current environment. var global$1 = (function () { if (typeof global !== 'undefined' && global.Math === Math) { return global; } if (typeof self !== 'undefined' && self.Math === Math) { return self; } if (typeof window !== 'undefined' && window.Math === Math) { return window; } // eslint-disable-next-line no-new-func return Function('return this')(); })(); /** * A shim for the requestAnimationFrame which falls back to the setTimeout if * first one is not supported. * * @returns {number} Requests' identifier. */ var requestAnimationFrame$1 = (function () { if (typeof requestAnimationFrame === 'function') { // It's required to use a bounded function because IE sometimes throws // an "Invalid calling object" error if rAF is invoked without the global // object on the left hand side. return requestAnimationFrame.bind(global$1); } return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); }; })(); // Defines minimum timeout before adding a trailing call. var trailingTimeout = 2; /** * Creates a wrapper function which ensures that provided callback will be * invoked only once during the specified delay period. * * @param {Function} callback - Function to be invoked after the delay period. * @param {number} delay - Delay after which to invoke callback. * @returns {Function} */ function throttle (callback, delay) { var leadingCall = false, trailingCall = false, lastCallTime = 0; /** * Invokes the original callback function and schedules new invocation if * the "proxy" was called during current request. * * @returns {void} */ function resolvePending() { if (leadingCall) { leadingCall = false; callback(); } if (trailingCall) { proxy(); } } /** * Callback invoked after the specified delay. It will further postpone * invocation of the original function delegating it to the * requestAnimationFrame. * * @returns {void} */ function timeoutCallback() { requestAnimationFrame$1(resolvePending); } /** * Schedules invocation of the original function. * * @returns {void} */ function proxy() { var timeStamp = Date.now(); if (leadingCall) { // Reject immediately following calls. if (timeStamp - lastCallTime < trailingTimeout) { return; } // Schedule new call to be in invoked when the pending one is resolved. // This is important for "transitions" which never actually start // immediately so there is a chance that we might miss one if change // happens amids the pending invocation. trailingCall = true; } else { leadingCall = true; trailingCall = false; setTimeout(timeoutCallback, delay); } lastCallTime = timeStamp; } return proxy; } // Minimum delay before invoking the update of observers. var REFRESH_DELAY = 20; // A list of substrings of CSS properties used to find transition events that // might affect dimensions of observed elements. var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight']; // Check if MutationObserver is available. var mutationObserverSupported = typeof MutationObserver !== 'undefined'; /** * Singleton controller class which handles updates of ResizeObserver instances. */ var ResizeObserverController = /** @class */ (function () { /** * Creates a new instance of ResizeObserverController. * * @private */ function ResizeObserverController() { /** * Indicates whether DOM listeners have been added. * * @private {boolean} */ this.connected_ = false; /** * Tells that controller has subscribed for Mutation Events. * * @private {boolean} */ this.mutationEventsAdded_ = false; /** * Keeps reference to the instance of MutationObserver. * * @private {MutationObserver} */ this.mutationsObserver_ = null; /** * A list of connected observers. * * @private {Array} */ this.observers_ = []; this.onTransitionEnd_ = this.onTransitionEnd_.bind(this); this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY); } /** * Adds observer to observers list. * * @param {ResizeObserverSPI} observer - Observer to be added. * @returns {void} */ ResizeObserverController.prototype.addObserver = function (observer) { if (!~this.observers_.indexOf(observer)) { this.observers_.push(observer); } // Add listeners if they haven't been added yet. if (!this.connected_) { this.connect_(); } }; /** * Removes observer from observers list. * * @param {ResizeObserverSPI} observer - Observer to be removed. * @returns {void} */ ResizeObserverController.prototype.removeObserver = function (observer) { var observers = this.observers_; var index = observers.indexOf(observer); // Remove observer if it's present in registry. if (~index) { observers.splice(index, 1); } // Remove listeners if controller has no connected observers. if (!observers.length && this.connected_) { this.disconnect_(); } }; /** * Invokes the update of observers. It will continue running updates insofar * it detects changes. * * @returns {void} */ ResizeObserverController.prototype.refresh = function () { var changesDetected = this.updateObservers_(); // Continue running updates if changes have been detected as there might // be future ones caused by CSS transitions. if (changesDetected) { this.refresh(); } }; /** * Updates every observer from observers list and notifies them of queued * entries. * * @private * @returns {boolean} Returns "true" if any observer has detected changes in * dimensions of it's elements. */ ResizeObserverController.prototype.updateObservers_ = function () { // Collect observers that have active observations. var activeObservers = this.observers_.filter(function (observer) { return observer.gatherActive(), observer.hasActive(); }); // Deliver notifications in a separate cycle in order to avoid any // collisions between observers, e.g. when multiple instances of // ResizeObserver are tracking the same element and the callback of one // of them changes content dimensions of the observed target. Sometimes // this may result in notifications being blocked for the rest of observers. activeObservers.forEach(function (observer) { return observer.broadcastActive(); }); return activeObservers.length > 0; }; /** * Initializes DOM listeners. * * @private * @returns {void} */ ResizeObserverController.prototype.connect_ = function () { // Do nothing if running in a non-browser environment or if listeners // have been already added. if (!isBrowser || this.connected_) { return; } // Subscription to the "Transitionend" event is used as a workaround for // delayed transitions. This way it's possible to capture at least the // final state of an element. document.addEventListener('transitionend', this.onTransitionEnd_); window.addEventListener('resize', this.refresh); if (mutationObserverSupported) { this.mutationsObserver_ = new MutationObserver(this.refresh); this.mutationsObserver_.observe(document, { attributes: true, childList: true, characterData: true, subtree: true }); } else { document.addEventListener('DOMSubtreeModified', this.refresh); this.mutationEventsAdded_ = true; } this.connected_ = true; }; /** * Removes DOM listeners. * * @private * @returns {void} */ ResizeObserverController.prototype.disconnect_ = function () { // Do nothing if running in a non-browser environment or if listeners // have been already removed. if (!isBrowser || !this.connected_) { return; } document.removeEventListener('transitionend', this.onTransitionEnd_); window.removeEventListener('resize', this.refresh); if (this.mutationsObserver_) { this.mutationsObserver_.disconnect(); } if (this.mutationEventsAdded_) { document.removeEventListener('DOMSubtreeModified', this.refresh); } this.mutationsObserver_ = null; this.mutationEventsAdded_ = false; this.connected_ = false; }; /** * "Transitionend" event handler. * * @private * @param {TransitionEvent} event * @returns {void} */ ResizeObserverController.prototype.onTransitionEnd_ = function (_a) { var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b; // Detect whether transition may affect dimensions of an element. var isReflowProperty = transitionKeys.some(function (key) { return !!~propertyName.indexOf(key); }); if (isReflowProperty) { this.refresh(); } }; /** * Returns instance of the ResizeObserverController. * * @returns {ResizeObserverController} */ ResizeObserverController.getInstance = function () { if (!this.instance_) { this.instance_ = new ResizeObserverController(); } return this.instance_; }; /** * Holds reference to the controller's instance. * * @private {ResizeObserverController} */ ResizeObserverController.instance_ = null; return ResizeObserverController; }()); /** * Defines non-writable/enumerable properties of the provided target object. * * @param {Object} target - Object for which to define properties. * @param {Object} props - Properties to be defined. * @returns {Object} Target object. */ var defineConfigurable = (function (target, props) { for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) { var key = _a[_i]; Object.defineProperty(target, key, { value: props[key], enumerable: false, writable: false, configurable: true }); } return target; }); /** * Returns the global object associated with provided element. * * @param {Object} target * @returns {Object} */ var getWindowOf = (function (target) { // Assume that the element is an instance of Node, which means that it // has the "ownerDocument" property from which we can retrieve a // corresponding global object. var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView; // Return the local global object if it's not possible extract one from // provided element. return ownerGlobal || global$1; }); // Placeholder of an empty content rectangle. var emptyRect = createRectInit(0, 0, 0, 0); /** * Converts provided string to a number. * * @param {number|string} value * @returns {number} */ function toFloat(value) { return parseFloat(value) || 0; } /** * Extracts borders size from provided styles. * * @param {CSSStyleDeclaration} styles * @param {...string} positions - Borders positions (top, right, ...) * @returns {number} */ function getBordersSize(styles) { var positions = []; for (var _i = 1; _i < arguments.length; _i++) { positions[_i - 1] = arguments[_i]; } return positions.reduce(function (size, position) { var value = styles['border-' + position + '-width']; return size + toFloat(value); }, 0); } /** * Extracts paddings sizes from provided styles. * * @param {CSSStyleDeclaration} styles * @returns {Object} Paddings box. */ function getPaddings(styles) { var positions = ['top', 'right', 'bottom', 'left']; var paddings = {}; for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) { var position = positions_1[_i]; var value = styles['padding-' + position]; paddings[position] = toFloat(value); } return paddings; } /** * Calculates content rectangle of provided SVG element. * * @param {SVGGraphicsElement} target - Element content rectangle of which needs * to be calculated. * @returns {DOMRectInit} */ function getSVGContentRect(target) { var bbox = target.getBBox(); return createRectInit(0, 0, bbox.width, bbox.height); } /** * Calculates content rectangle of provided HTMLElement. * * @param {HTMLElement} target - Element for which to calculate the content rectangle. * @returns {DOMRectInit} */ function getHTMLElementContentRect(target) { // Client width & height properties can't be // used exclusively as they provide rounded values. var clientWidth = target.clientWidth, clientHeight = target.clientHeight; // By this condition we can catch all non-replaced inline, hidden and // detached elements. Though elements with width & height properties less // than 0.5 will be discarded as well. // // Without it we would need to implement separate methods for each of // those cases and it's not possible to perform a precise and performance // effective test for hidden elements. E.g. even jQuery's ':visible' filter // gives wrong results for elements with width & height less than 0.5. if (!clientWidth && !clientHeight) { return emptyRect; } var styles = getWindowOf(target).getComputedStyle(target); var paddings = getPaddings(styles); var horizPad = paddings.left + paddings.right; var vertPad = paddings.top + paddings.bottom; // Computed styles of width & height are being used because they are the // only dimensions available to JS that contain non-rounded values. It could // be possible to utilize the getBoundingClientRect if only it's data wasn't // affected by CSS transformations let alone paddings, borders and scroll bars. var width = toFloat(styles.width), height = toFloat(styles.height); // Width & height include paddings and borders when the 'border-box' box // model is applied (except for IE). if (styles.boxSizing === 'border-box') { // Following conditions are required to handle Internet Explorer which // doesn't include paddings and borders to computed CSS dimensions. // // We can say that if CSS dimensions + paddings are equal to the "client" // properties then it's either IE, and thus we don't need to subtract // anything, or an element merely doesn't have paddings/borders styles. if (Math.round(width + horizPad) !== clientWidth) { width -= getBordersSize(styles, 'left', 'right') + horizPad; } if (Math.round(height + vertPad) !== clientHeight) { height -= getBordersSize(styles, 'top', 'bottom') + vertPad; } } // Following steps can't be applied to the document's root element as its // client[Width/Height] properties represent viewport area of the window. // Besides, it's as well not necessary as the itself neither has // rendered scroll bars nor it can be clipped. if (!isDocumentElement(target)) { // In some browsers (only in Firefox, actually) CSS width & height // include scroll bars size which can be removed at this step as scroll // bars are the only difference between rounded dimensions + paddings // and "client" properties, though that is not always true in Chrome. var vertScrollbar = Math.round(width + horizPad) - clientWidth; var horizScrollbar = Math.round(height + vertPad) - clientHeight; // Chrome has a rather weird rounding of "client" properties. // E.g. for an element with content width of 314.2px it sometimes gives // the client width of 315px and for the width of 314.7px it may give // 314px. And it doesn't happen all the time. So just ignore this delta // as a non-relevant. if (Math.abs(vertScrollbar) !== 1) { width -= vertScrollbar; } if (Math.abs(horizScrollbar) !== 1) { height -= horizScrollbar; } } return createRectInit(paddings.left, paddings.top, width, height); } /** * Checks whether provided element is an instance of the SVGGraphicsElement. * * @param {Element} target - Element to be checked. * @returns {boolean} */ var isSVGGraphicsElement = (function () { // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement // interface. if (typeof SVGGraphicsElement !== 'undefined') { return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; }; } // If it's so, then check that element is at least an instance of the // SVGElement and that it has the "getBBox" method. // eslint-disable-next-line no-extra-parens return function (target) { return (target instanceof getWindowOf(target).SVGElement && typeof target.getBBox === 'function'); }; })(); /** * Checks whether provided element is a document element (). * * @param {Element} target - Element to be checked. * @returns {boolean} */ function isDocumentElement(target) { return target === getWindowOf(target).document.documentElement; } /** * Calculates an appropriate content rectangle for provided html or svg element. * * @param {Element} target - Element content rectangle of which needs to be calculated. * @returns {DOMRectInit} */ function getContentRect(target) { if (!isBrowser) { return emptyRect; } if (isSVGGraphicsElement(target)) { return getSVGContentRect(target); } return getHTMLElementContentRect(target); } /** * Creates rectangle with an interface of the DOMRectReadOnly. * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly * * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions. * @returns {DOMRectReadOnly} */ function createReadOnlyRect(_a) { var x = _a.x, y = _a.y, width = _a.width, height = _a.height; // If DOMRectReadOnly is available use it as a prototype for the rectangle. var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object; var rect = Object.create(Constr.prototype); // Rectangle's properties are not writable and non-enumerable. defineConfigurable(rect, { x: x, y: y, width: width, height: height, top: y, right: x + width, bottom: height + y, left: x }); return rect; } /** * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates. * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit * * @param {number} x - X coordinate. * @param {number} y - Y coordinate. * @param {number} width - Rectangle's width. * @param {number} height - Rectangle's height. * @returns {DOMRectInit} */ function createRectInit(x, y, width, height) { return { x: x, y: y, width: width, height: height }; } /** * Class that is responsible for computations of the content rectangle of * provided DOM element and for keeping track of it's changes. */ var ResizeObservation = /** @class */ (function () { /** * Creates an instance of ResizeObservation. * * @param {Element} target - Element to be observed. */ function ResizeObservation(target) { /** * Broadcasted width of content rectangle. * * @type {number} */ this.broadcastWidth = 0; /** * Broadcasted height of content rectangle. * * @type {number} */ this.broadcastHeight = 0; /** * Reference to the last observed content rectangle. * * @private {DOMRectInit} */ this.contentRect_ = createRectInit(0, 0, 0, 0); this.target = target; } /** * Updates content rectangle and tells whether it's width or height properties * have changed since the last broadcast. * * @returns {boolean} */ ResizeObservation.prototype.isActive = function () { var rect = getContentRect(this.target); this.contentRect_ = rect; return (rect.width !== this.broadcastWidth || rect.height !== this.broadcastHeight); }; /** * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data * from the corresponding properties of the last observed content rectangle. * * @returns {DOMRectInit} Last observed content rectangle. */ ResizeObservation.prototype.broadcastRect = function () { var rect = this.contentRect_; this.broadcastWidth = rect.width; this.broadcastHeight = rect.height; return rect; }; return ResizeObservation; }()); var ResizeObserverEntry = /** @class */ (function () { /** * Creates an instance of ResizeObserverEntry. * * @param {Element} target - Element that is being observed. * @param {DOMRectInit} rectInit - Data of the element's content rectangle. */ function ResizeObserverEntry(target, rectInit) { var contentRect = createReadOnlyRect(rectInit); // According to the specification following properties are not writable // and are also not enumerable in the native implementation. // // Property accessors are not being used as they'd require to define a // private WeakMap storage which may cause memory leaks in browsers that // don't support this type of collections. defineConfigurable(this, { target: target, contentRect: contentRect }); } return ResizeObserverEntry; }()); var ResizeObserverSPI = /** @class */ (function () { /** * Creates a new instance of ResizeObserver. * * @param {ResizeObserverCallback} callback - Callback function that is invoked * when one of the observed elements changes it's content dimensions. * @param {ResizeObserverController} controller - Controller instance which * is responsible for the updates of observer. * @param {ResizeObserver} callbackCtx - Reference to the public * ResizeObserver instance which will be passed to callback function. */ function ResizeObserverSPI(callback, controller, callbackCtx) { /** * Collection of resize observations that have detected changes in dimensions * of elements. * * @private {Array} */ this.activeObservations_ = []; /** * Registry of the ResizeObservation instances. * * @private {Map} */ this.observations_ = new MapShim(); if (typeof callback !== 'function') { throw new TypeError('The callback provided as parameter 1 is not a function.'); } this.callback_ = callback; this.controller_ = controller; this.callbackCtx_ = callbackCtx; } /** * Starts observing provided element. * * @param {Element} target - Element to be observed. * @returns {void} */ ResizeObserverSPI.prototype.observe = function (target) { if (!arguments.length) { throw new TypeError('1 argument required, but only 0 present.'); } // Do nothing if current environment doesn't have the Element interface. if (typeof Element === 'undefined' || !(Element instanceof Object)) { return; } if (!(target instanceof getWindowOf(target).Element)) { throw new TypeError('parameter 1 is not of type "Element".'); } var observations = this.observations_; // Do nothing if element is already being observed. if (observations.has(target)) { return; } observations.set(target, new ResizeObservation(target)); this.controller_.addObserver(this); // Force the update of observations. this.controller_.refresh(); }; /** * Stops observing provided element. * * @param {Element} target - Element to stop observing. * @returns {void} */ ResizeObserverSPI.prototype.unobserve = function (target) { if (!arguments.length) { throw new TypeError('1 argument required, but only 0 present.'); } // Do nothing if current environment doesn't have the Element interface. if (typeof Element === 'undefined' || !(Element instanceof Object)) { return; } if (!(target instanceof getWindowOf(target).Element)) { throw new TypeError('parameter 1 is not of type "Element".'); } var observations = this.observations_; // Do nothing if element is not being observed. if (!observations.has(target)) { return; } observations.delete(target); if (!observations.size) { this.controller_.removeObserver(this); } }; /** * Stops observing all elements. * * @returns {void} */ ResizeObserverSPI.prototype.disconnect = function () { this.clearActive(); this.observations_.clear(); this.controller_.removeObserver(this); }; /** * Collects observation instances the associated element of which has changed * it's content rectangle. * * @returns {void} */ ResizeObserverSPI.prototype.gatherActive = function () { var _this = this; this.clearActive(); this.observations_.forEach(function (observation) { if (observation.isActive()) { _this.activeObservations_.push(observation); } }); }; /** * Invokes initial callback function with a list of ResizeObserverEntry * instances collected from active resize observations. * * @returns {void} */ ResizeObserverSPI.prototype.broadcastActive = function () { // Do nothing if observer doesn't have active observations. if (!this.hasActive()) { return; } var ctx = this.callbackCtx_; // Create ResizeObserverEntry instance for every active observation. var entries = this.activeObservations_.map(function (observation) { return new ResizeObserverEntry(observation.target, observation.broadcastRect()); }); this.callback_.call(ctx, entries, ctx); this.clearActive(); }; /** * Clears the collection of active observations. * * @returns {void} */ ResizeObserverSPI.prototype.clearActive = function () { this.activeObservations_.splice(0); }; /** * Tells whether observer has active observations. * * @returns {boolean} */ ResizeObserverSPI.prototype.hasActive = function () { return this.activeObservations_.length > 0; }; return ResizeObserverSPI; }()); // Registry of internal observers. If WeakMap is not available use current shim // for the Map collection as it has all required methods and because WeakMap // can't be fully polyfilled anyway. var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim(); /** * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation * exposing only those methods and properties that are defined in the spec. */ var ResizeObserver = /** @class */ (function () { /** * Creates a new instance of ResizeObserver. * * @param {ResizeObserverCallback} callback - Callback that is invoked when * dimensions of the observed elements change. */ function ResizeObserver(callback) { if (!(this instanceof ResizeObserver)) { throw new TypeError('Cannot call a class as a function.'); } if (!arguments.length) { throw new TypeError('1 argument required, but only 0 present.'); } var controller = ResizeObserverController.getInstance(); var observer = new ResizeObserverSPI(callback, controller, this); observers.set(this, observer); } return ResizeObserver; }()); // Expose public methods of ResizeObserver. [ 'observe', 'unobserve', 'disconnect' ].forEach(function (method) { ResizeObserver.prototype[method] = function () { var _a; return (_a = observers.get(this))[method].apply(_a, arguments); }; }); var index = (function () { // Export existing implementation if available. if (typeof global$1.ResizeObserver !== 'undefined') { return global$1.ResizeObserver; } return ResizeObserver; })(); /* harmony default export */ __webpack_exports__["default"] = (index); /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__("DuR2"))) /***/ }) });