geno/wp-content/plugins/checkout-plugins-stripe-woo/wizard/build/app.js
2024-02-01 11:54:18 +00:00

3322 lines
No EOL
156 KiB
JavaScript

/******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./node_modules/@headlessui/react/dist/_virtual/_rollupPluginBabelHelpers.js":
/*!***********************************************************************************!*\
!*** ./node_modules/@headlessui/react/dist/_virtual/_rollupPluginBabelHelpers.js ***!
\***********************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "arrayLikeToArray": function() { return /* binding */ _arrayLikeToArray; },
/* harmony export */ "createForOfIteratorHelperLoose": function() { return /* binding */ _createForOfIteratorHelperLoose; },
/* harmony export */ "extends": function() { return /* binding */ _extends; },
/* harmony export */ "objectWithoutPropertiesLoose": function() { return /* binding */ _objectWithoutPropertiesLoose; },
/* harmony export */ "unsupportedIterableToArray": function() { return /* binding */ _unsupportedIterableToArray; }
/* harmony export */ });
function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
var it;
if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
if (it) o = it;
var i = 0;
return function () {
if (i >= o.length) return {
done: true
};
return {
done: false,
value: o[i++]
};
};
}
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
it = o[Symbol.iterator]();
return it.next.bind(it);
}
//# sourceMappingURL=_rollupPluginBabelHelpers.js.map
/***/ }),
/***/ "./node_modules/@headlessui/react/dist/components/description/description.esm.js":
/*!***************************************************************************************!*\
!*** ./node_modules/@headlessui/react/dist/components/description/description.esm.js ***!
\***************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "Description": function() { return /* binding */ Description; },
/* harmony export */ "useDescriptions": function() { return /* binding */ useDescriptions; }
/* harmony export */ });
/* harmony import */ var _virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../_virtual/_rollupPluginBabelHelpers.js */ "./node_modules/@headlessui/react/dist/_virtual/_rollupPluginBabelHelpers.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _utils_render_esm_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/render.esm.js */ "./node_modules/@headlessui/react/dist/utils/render.esm.js");
/* harmony import */ var _hooks_use_iso_morphic_effect_esm_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../hooks/use-iso-morphic-effect.esm.js */ "./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.esm.js");
/* harmony import */ var _hooks_use_id_esm_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../hooks/use-id.esm.js */ "./node_modules/@headlessui/react/dist/hooks/use-id.esm.js");
var DescriptionContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);
function useDescriptionContext() {
var context = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(DescriptionContext);
if (context === null) {
var err = new Error('You used a <Description /> component, but it is not inside a relevant parent.');
if (Error.captureStackTrace) Error.captureStackTrace(err, useDescriptionContext);
throw err;
}
return context;
}
function useDescriptions() {
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),
descriptionIds = _useState[0],
setDescriptionIds = _useState[1];
return [// The actual id's as string or undefined
descriptionIds.length > 0 ? descriptionIds.join(' ') : undefined, // The provider component
(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
return function DescriptionProvider(props) {
var register = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (value) {
setDescriptionIds(function (existing) {
return [].concat(existing, [value]);
});
return function () {
return setDescriptionIds(function (existing) {
var clone = existing.slice();
var idx = clone.indexOf(value);
if (idx !== -1) clone.splice(idx, 1);
return clone;
});
};
}, []);
var contextBag = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
return {
register: register,
slot: props.slot,
name: props.name,
props: props.props
};
}, [register, props.slot, props.name, props.props]);
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(DescriptionContext.Provider, {
value: contextBag
}, props.children);
};
}, [setDescriptionIds])];
} // ---
var DEFAULT_DESCRIPTION_TAG = 'p';
function Description(props) {
var context = useDescriptionContext();
var id = "headlessui-description-" + (0,_hooks_use_id_esm_js__WEBPACK_IMPORTED_MODULE_1__.useId)();
(0,_hooks_use_iso_morphic_effect_esm_js__WEBPACK_IMPORTED_MODULE_2__.useIsoMorphicEffect)(function () {
return context.register(id);
}, [id, context.register]);
var passThroughProps = props;
var propsWeControl = (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_3__["extends"])({}, context.props, {
id: id
});
return (0,_utils_render_esm_js__WEBPACK_IMPORTED_MODULE_4__.render)({
props: (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_3__["extends"])({}, passThroughProps, propsWeControl),
slot: context.slot || {},
defaultTag: DEFAULT_DESCRIPTION_TAG,
name: context.name || 'Description'
});
}
//# sourceMappingURL=description.esm.js.map
/***/ }),
/***/ "./node_modules/@headlessui/react/dist/components/keyboard.esm.js":
/*!************************************************************************!*\
!*** ./node_modules/@headlessui/react/dist/components/keyboard.esm.js ***!
\************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "Keys": function() { return /* binding */ Keys; }
/* harmony export */ });
// TODO: This must already exist somewhere, right? 🤔
// Ref: https://www.w3.org/TR/uievents-key/#named-key-attribute-values
var Keys;
(function (Keys) {
Keys["Space"] = " ";
Keys["Enter"] = "Enter";
Keys["Escape"] = "Escape";
Keys["Backspace"] = "Backspace";
Keys["ArrowLeft"] = "ArrowLeft";
Keys["ArrowUp"] = "ArrowUp";
Keys["ArrowRight"] = "ArrowRight";
Keys["ArrowDown"] = "ArrowDown";
Keys["Home"] = "Home";
Keys["End"] = "End";
Keys["PageUp"] = "PageUp";
Keys["PageDown"] = "PageDown";
Keys["Tab"] = "Tab";
})(Keys || (Keys = {}));
//# sourceMappingURL=keyboard.esm.js.map
/***/ }),
/***/ "./node_modules/@headlessui/react/dist/components/label/label.esm.js":
/*!***************************************************************************!*\
!*** ./node_modules/@headlessui/react/dist/components/label/label.esm.js ***!
\***************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "Label": function() { return /* binding */ Label; },
/* harmony export */ "useLabels": function() { return /* binding */ useLabels; }
/* harmony export */ });
/* harmony import */ var _virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../_virtual/_rollupPluginBabelHelpers.js */ "./node_modules/@headlessui/react/dist/_virtual/_rollupPluginBabelHelpers.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _utils_render_esm_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/render.esm.js */ "./node_modules/@headlessui/react/dist/utils/render.esm.js");
/* harmony import */ var _hooks_use_iso_morphic_effect_esm_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../hooks/use-iso-morphic-effect.esm.js */ "./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.esm.js");
/* harmony import */ var _hooks_use_id_esm_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../hooks/use-id.esm.js */ "./node_modules/@headlessui/react/dist/hooks/use-id.esm.js");
var LabelContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);
function useLabelContext() {
var context = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(LabelContext);
if (context === null) {
var err = new Error('You used a <Label /> component, but it is not inside a relevant parent.');
if (Error.captureStackTrace) Error.captureStackTrace(err, useLabelContext);
throw err;
}
return context;
}
function useLabels() {
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),
labelIds = _useState[0],
setLabelIds = _useState[1];
return [// The actual id's as string or undefined.
labelIds.length > 0 ? labelIds.join(' ') : undefined, // The provider component
(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
return function LabelProvider(props) {
var register = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (value) {
setLabelIds(function (existing) {
return [].concat(existing, [value]);
});
return function () {
return setLabelIds(function (existing) {
var clone = existing.slice();
var idx = clone.indexOf(value);
if (idx !== -1) clone.splice(idx, 1);
return clone;
});
};
}, []);
var contextBag = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
return {
register: register,
slot: props.slot,
name: props.name,
props: props.props
};
}, [register, props.slot, props.name, props.props]);
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(LabelContext.Provider, {
value: contextBag
}, props.children);
};
}, [setLabelIds])];
} // ---
var DEFAULT_LABEL_TAG = 'label';
function Label(props) {
var _props$passive = props.passive,
passive = _props$passive === void 0 ? false : _props$passive,
passThroughProps = (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__.objectWithoutPropertiesLoose)(props, ["passive"]);
var context = useLabelContext();
var id = "headlessui-label-" + (0,_hooks_use_id_esm_js__WEBPACK_IMPORTED_MODULE_2__.useId)();
(0,_hooks_use_iso_morphic_effect_esm_js__WEBPACK_IMPORTED_MODULE_3__.useIsoMorphicEffect)(function () {
return context.register(id);
}, [id, context.register]);
var propsWeControl = (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__["extends"])({}, context.props, {
id: id
});
var allProps = (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__["extends"])({}, passThroughProps, propsWeControl); // @ts-expect-error props are dynamic via context, some components will
// provide an onClick then we can delete it.
if (passive) delete allProps['onClick'];
return (0,_utils_render_esm_js__WEBPACK_IMPORTED_MODULE_4__.render)({
props: allProps,
slot: context.slot || {},
defaultTag: DEFAULT_LABEL_TAG,
name: context.name || 'Label'
});
}
//# sourceMappingURL=label.esm.js.map
/***/ }),
/***/ "./node_modules/@headlessui/react/dist/components/switch/switch.esm.js":
/*!*****************************************************************************!*\
!*** ./node_modules/@headlessui/react/dist/components/switch/switch.esm.js ***!
\*****************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "Switch": function() { return /* binding */ Switch; }
/* harmony export */ });
/* harmony import */ var _virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../_virtual/_rollupPluginBabelHelpers.js */ "./node_modules/@headlessui/react/dist/_virtual/_rollupPluginBabelHelpers.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _utils_render_esm_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/render.esm.js */ "./node_modules/@headlessui/react/dist/utils/render.esm.js");
/* harmony import */ var _hooks_use_sync_refs_esm_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../hooks/use-sync-refs.esm.js */ "./node_modules/@headlessui/react/dist/hooks/use-sync-refs.esm.js");
/* harmony import */ var _keyboard_esm_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../keyboard.esm.js */ "./node_modules/@headlessui/react/dist/components/keyboard.esm.js");
/* harmony import */ var _utils_bugs_esm_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils/bugs.esm.js */ "./node_modules/@headlessui/react/dist/utils/bugs.esm.js");
/* harmony import */ var _hooks_use_id_esm_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../hooks/use-id.esm.js */ "./node_modules/@headlessui/react/dist/hooks/use-id.esm.js");
/* harmony import */ var _description_description_esm_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../description/description.esm.js */ "./node_modules/@headlessui/react/dist/components/description/description.esm.js");
/* harmony import */ var _hooks_use_resolve_button_type_esm_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../hooks/use-resolve-button-type.esm.js */ "./node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.esm.js");
/* harmony import */ var _label_label_esm_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../label/label.esm.js */ "./node_modules/@headlessui/react/dist/components/label/label.esm.js");
var GroupContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);
GroupContext.displayName = 'GroupContext'; // ---
var DEFAULT_GROUP_TAG = react__WEBPACK_IMPORTED_MODULE_0__.Fragment;
function Group(props) {
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
switchElement = _useState[0],
setSwitchElement = _useState[1];
var _useLabels = (0,_label_label_esm_js__WEBPACK_IMPORTED_MODULE_1__.useLabels)(),
labelledby = _useLabels[0],
LabelProvider = _useLabels[1];
var _useDescriptions = (0,_description_description_esm_js__WEBPACK_IMPORTED_MODULE_2__.useDescriptions)(),
describedby = _useDescriptions[0],
DescriptionProvider = _useDescriptions[1];
var context = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
return {
"switch": switchElement,
setSwitch: setSwitchElement,
labelledby: labelledby,
describedby: describedby
};
}, [switchElement, setSwitchElement, labelledby, describedby]);
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(DescriptionProvider, {
name: "Switch.Description"
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(LabelProvider, {
name: "Switch.Label",
props: {
onClick: function onClick() {
if (!switchElement) return;
switchElement.click();
switchElement.focus({
preventScroll: true
});
}
}
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(GroupContext.Provider, {
value: context
}, (0,_utils_render_esm_js__WEBPACK_IMPORTED_MODULE_3__.render)({
props: props,
defaultTag: DEFAULT_GROUP_TAG,
name: 'Switch.Group'
}))));
} // ---
var DEFAULT_SWITCH_TAG = 'button';
function Switch(props) {
var checked = props.checked,
onChange = props.onChange,
passThroughProps = (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_4__.objectWithoutPropertiesLoose)(props, ["checked", "onChange"]);
var id = "headlessui-switch-" + (0,_hooks_use_id_esm_js__WEBPACK_IMPORTED_MODULE_5__.useId)();
var groupContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(GroupContext);
var internalSwitchRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
var switchRef = (0,_hooks_use_sync_refs_esm_js__WEBPACK_IMPORTED_MODULE_6__.useSyncRefs)(internalSwitchRef, groupContext === null ? null : groupContext.setSwitch);
var toggle = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
return onChange(!checked);
}, [onChange, checked]);
var handleClick = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (event) {
if ((0,_utils_bugs_esm_js__WEBPACK_IMPORTED_MODULE_7__.isDisabledReactIssue7711)(event.currentTarget)) return event.preventDefault();
event.preventDefault();
toggle();
}, [toggle]);
var handleKeyUp = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (event) {
if (event.key !== _keyboard_esm_js__WEBPACK_IMPORTED_MODULE_8__.Keys.Tab) event.preventDefault();
if (event.key === _keyboard_esm_js__WEBPACK_IMPORTED_MODULE_8__.Keys.Space) toggle();
}, [toggle]); // This is needed so that we can "cancel" the click event when we use the `Enter` key on a button.
var handleKeyPress = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (event) {
return event.preventDefault();
}, []);
var slot = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
return {
checked: checked
};
}, [checked]);
var propsWeControl = {
id: id,
ref: switchRef,
role: 'switch',
type: (0,_hooks_use_resolve_button_type_esm_js__WEBPACK_IMPORTED_MODULE_9__.useResolveButtonType)(props, internalSwitchRef),
tabIndex: 0,
'aria-checked': checked,
'aria-labelledby': groupContext == null ? void 0 : groupContext.labelledby,
'aria-describedby': groupContext == null ? void 0 : groupContext.describedby,
onClick: handleClick,
onKeyUp: handleKeyUp,
onKeyPress: handleKeyPress
};
return (0,_utils_render_esm_js__WEBPACK_IMPORTED_MODULE_3__.render)({
props: (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_4__["extends"])({}, passThroughProps, propsWeControl),
slot: slot,
defaultTag: DEFAULT_SWITCH_TAG,
name: 'Switch'
});
} // ---
Switch.Group = Group;
Switch.Label = _label_label_esm_js__WEBPACK_IMPORTED_MODULE_1__.Label;
Switch.Description = _description_description_esm_js__WEBPACK_IMPORTED_MODULE_2__.Description;
//# sourceMappingURL=switch.esm.js.map
/***/ }),
/***/ "./node_modules/@headlessui/react/dist/hooks/use-id.esm.js":
/*!*****************************************************************!*\
!*** ./node_modules/@headlessui/react/dist/hooks/use-id.esm.js ***!
\*****************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "useId": function() { return /* binding */ useId; }
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _use_iso_morphic_effect_esm_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./use-iso-morphic-effect.esm.js */ "./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.esm.js");
/* harmony import */ var _use_server_handoff_complete_esm_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./use-server-handoff-complete.esm.js */ "./node_modules/@headlessui/react/dist/hooks/use-server-handoff-complete.esm.js");
// didn't take care of the Suspense case. To fix this we used the approach the @reach-ui/auto-id
// uses.
//
// Credits: https://github.com/reach/reach-ui/blob/develop/packages/auto-id/src/index.tsx
var id = 0;
function generateId() {
return ++id;
}
function useId() {
var ready = (0,_use_server_handoff_complete_esm_js__WEBPACK_IMPORTED_MODULE_1__.useServerHandoffComplete)();
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(ready ? generateId : null),
id = _useState[0],
setId = _useState[1];
(0,_use_iso_morphic_effect_esm_js__WEBPACK_IMPORTED_MODULE_2__.useIsoMorphicEffect)(function () {
if (id === null) setId(generateId());
}, [id]);
return id != null ? '' + id : undefined;
}
//# sourceMappingURL=use-id.esm.js.map
/***/ }),
/***/ "./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.esm.js":
/*!*********************************************************************************!*\
!*** ./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.esm.js ***!
\*********************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "useIsoMorphicEffect": function() { return /* binding */ useIsoMorphicEffect; }
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
var useIsoMorphicEffect = typeof window !== 'undefined' ? react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_0__.useEffect;
//# sourceMappingURL=use-iso-morphic-effect.esm.js.map
/***/ }),
/***/ "./node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.esm.js":
/*!**********************************************************************************!*\
!*** ./node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.esm.js ***!
\**********************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "useResolveButtonType": function() { return /* binding */ useResolveButtonType; }
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _use_iso_morphic_effect_esm_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./use-iso-morphic-effect.esm.js */ "./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.esm.js");
function resolveType(props) {
var _props$as;
if (props.type) return props.type;
var tag = (_props$as = props.as) != null ? _props$as : 'button';
if (typeof tag === 'string' && tag.toLowerCase() === 'button') return 'button';
return undefined;
}
function useResolveButtonType(props, ref) {
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(function () {
return resolveType(props);
}),
type = _useState[0],
setType = _useState[1];
(0,_use_iso_morphic_effect_esm_js__WEBPACK_IMPORTED_MODULE_1__.useIsoMorphicEffect)(function () {
setType(resolveType(props));
}, [props.type, props.as]);
(0,_use_iso_morphic_effect_esm_js__WEBPACK_IMPORTED_MODULE_1__.useIsoMorphicEffect)(function () {
if (type) return;
if (!ref.current) return;
if (ref.current instanceof HTMLButtonElement && !ref.current.hasAttribute('type')) {
setType('button');
}
}, [type, ref]);
return type;
}
//# sourceMappingURL=use-resolve-button-type.esm.js.map
/***/ }),
/***/ "./node_modules/@headlessui/react/dist/hooks/use-server-handoff-complete.esm.js":
/*!**************************************************************************************!*\
!*** ./node_modules/@headlessui/react/dist/hooks/use-server-handoff-complete.esm.js ***!
\**************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "useServerHandoffComplete": function() { return /* binding */ useServerHandoffComplete; }
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
var state = {
serverHandoffComplete: false
};
function useServerHandoffComplete() {
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(state.serverHandoffComplete),
serverHandoffComplete = _useState[0],
setServerHandoffComplete = _useState[1];
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
if (serverHandoffComplete === true) return;
setServerHandoffComplete(true);
}, [serverHandoffComplete]);
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
if (state.serverHandoffComplete === false) state.serverHandoffComplete = true;
}, []);
return serverHandoffComplete;
}
//# sourceMappingURL=use-server-handoff-complete.esm.js.map
/***/ }),
/***/ "./node_modules/@headlessui/react/dist/hooks/use-sync-refs.esm.js":
/*!************************************************************************!*\
!*** ./node_modules/@headlessui/react/dist/hooks/use-sync-refs.esm.js ***!
\************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "useSyncRefs": function() { return /* binding */ useSyncRefs; }
/* harmony export */ });
/* harmony import */ var _virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../_virtual/_rollupPluginBabelHelpers.js */ "./node_modules/@headlessui/react/dist/_virtual/_rollupPluginBabelHelpers.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
function useSyncRefs() {
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
refs[_key] = arguments[_key];
}
var cache = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(refs);
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
cache.current = refs;
}, [refs]);
return (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (value) {
for (var _iterator = (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__.createForOfIteratorHelperLoose)(cache.current), _step; !(_step = _iterator()).done;) {
var ref = _step.value;
if (ref == null) continue;
if (typeof ref === 'function') ref(value);else ref.current = value;
}
}, [cache]);
}
//# sourceMappingURL=use-sync-refs.esm.js.map
/***/ }),
/***/ "./node_modules/@headlessui/react/dist/utils/bugs.esm.js":
/*!***************************************************************!*\
!*** ./node_modules/@headlessui/react/dist/utils/bugs.esm.js ***!
\***************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "isDisabledReactIssue7711": function() { return /* binding */ isDisabledReactIssue7711; }
/* harmony export */ });
// See: https://github.com/facebook/react/issues/7711
// See: https://github.com/facebook/react/pull/20612
// See: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-fe-disabled (2.)
function isDisabledReactIssue7711(element) {
var _ref, _parent;
var parent = element.parentElement;
var legend = null;
while (parent && !(parent instanceof HTMLFieldSetElement)) {
if (parent instanceof HTMLLegendElement) legend = parent;
parent = parent.parentElement;
}
var isParentDisabled = (_ref = ((_parent = parent) == null ? void 0 : _parent.getAttribute('disabled')) === '') != null ? _ref : false;
if (isParentDisabled && isFirstLegend(legend)) return false;
return isParentDisabled;
}
function isFirstLegend(element) {
if (!element) return false;
var previous = element.previousElementSibling;
while (previous !== null) {
if (previous instanceof HTMLLegendElement) return false;
previous = previous.previousElementSibling;
}
return true;
}
//# sourceMappingURL=bugs.esm.js.map
/***/ }),
/***/ "./node_modules/@headlessui/react/dist/utils/match.esm.js":
/*!****************************************************************!*\
!*** ./node_modules/@headlessui/react/dist/utils/match.esm.js ***!
\****************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "match": function() { return /* binding */ match; }
/* harmony export */ });
function match(value, lookup) {
if (value in lookup) {
var returnValue = lookup[value];
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
args[_key - 2] = arguments[_key];
}
return typeof returnValue === 'function' ? returnValue.apply(void 0, args) : returnValue;
}
var error = new Error("Tried to handle \"" + value + "\" but there is no handler defined. Only defined handlers are: " + Object.keys(lookup).map(function (key) {
return "\"" + key + "\"";
}).join(', ') + ".");
if (Error.captureStackTrace) Error.captureStackTrace(error, match);
throw error;
}
//# sourceMappingURL=match.esm.js.map
/***/ }),
/***/ "./node_modules/@headlessui/react/dist/utils/render.esm.js":
/*!*****************************************************************!*\
!*** ./node_modules/@headlessui/react/dist/utils/render.esm.js ***!
\*****************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "Features": function() { return /* binding */ Features; },
/* harmony export */ "RenderStrategy": function() { return /* binding */ RenderStrategy; },
/* harmony export */ "forwardRefWithAs": function() { return /* binding */ forwardRefWithAs; },
/* harmony export */ "render": function() { return /* binding */ render; }
/* harmony export */ });
/* harmony import */ var _virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../_virtual/_rollupPluginBabelHelpers.js */ "./node_modules/@headlessui/react/dist/_virtual/_rollupPluginBabelHelpers.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _match_esm_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./match.esm.js */ "./node_modules/@headlessui/react/dist/utils/match.esm.js");
var Features;
(function (Features) {
/** No features at all */
Features[Features["None"] = 0] = "None";
/**
* When used, this will allow us to use one of the render strategies.
*
* **The render strategies are:**
* - **Unmount** _(Will unmount the component.)_
* - **Hidden** _(Will hide the component using the [hidden] attribute.)_
*/
Features[Features["RenderStrategy"] = 1] = "RenderStrategy";
/**
* When used, this will allow the user of our component to be in control. This can be used when
* you want to transition based on some state.
*/
Features[Features["Static"] = 2] = "Static";
})(Features || (Features = {}));
var RenderStrategy;
(function (RenderStrategy) {
RenderStrategy[RenderStrategy["Unmount"] = 0] = "Unmount";
RenderStrategy[RenderStrategy["Hidden"] = 1] = "Hidden";
})(RenderStrategy || (RenderStrategy = {}));
function render(_ref) {
var props = _ref.props,
slot = _ref.slot,
defaultTag = _ref.defaultTag,
features = _ref.features,
_ref$visible = _ref.visible,
visible = _ref$visible === void 0 ? true : _ref$visible,
name = _ref.name;
// Visible always render
if (visible) return _render(props, slot, defaultTag, name);
var featureFlags = features != null ? features : Features.None;
if (featureFlags & Features.Static) {
var _props$static = props["static"],
isStatic = _props$static === void 0 ? false : _props$static,
rest = (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__.objectWithoutPropertiesLoose)(props, ["static"]); // When the `static` prop is passed as `true`, then the user is in control, thus we don't care about anything else
if (isStatic) return _render(rest, slot, defaultTag, name);
}
if (featureFlags & Features.RenderStrategy) {
var _match;
var _props$unmount = props.unmount,
unmount = _props$unmount === void 0 ? true : _props$unmount,
_rest = (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__.objectWithoutPropertiesLoose)(props, ["unmount"]);
var strategy = unmount ? RenderStrategy.Unmount : RenderStrategy.Hidden;
return (0,_match_esm_js__WEBPACK_IMPORTED_MODULE_2__.match)(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function () {
return null;
}, _match[RenderStrategy.Hidden] = function () {
return _render((0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__["extends"])({}, _rest, {
hidden: true,
style: {
display: 'none'
}
}), slot, defaultTag, name);
}, _match));
} // No features enabled, just render
return _render(props, slot, defaultTag, name);
}
function _render(props, slot, tag, name) {
var _ref2;
if (slot === void 0) {
slot = {};
}
var _omit = omit(props, ['unmount', 'static']),
_omit$as = _omit.as,
Component = _omit$as === void 0 ? tag : _omit$as,
children = _omit.children,
_omit$refName = _omit.refName,
refName = _omit$refName === void 0 ? 'ref' : _omit$refName,
passThroughProps = (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__.objectWithoutPropertiesLoose)(_omit, ["as", "children", "refName"]); // This allows us to use `<HeadlessUIComponent as={MyComponent} refName="innerRef" />`
var refRelatedProps = props.ref !== undefined ? (_ref2 = {}, _ref2[refName] = props.ref, _ref2) : {};
var resolvedChildren = typeof children === 'function' ? children(slot) : children; // Allow for className to be a function with the slot as the contents
if (passThroughProps.className && typeof passThroughProps.className === 'function') {
passThroughProps.className = passThroughProps.className(slot);
}
if (Component === react__WEBPACK_IMPORTED_MODULE_0__.Fragment) {
if (Object.keys(passThroughProps).length > 0) {
if (!(0,react__WEBPACK_IMPORTED_MODULE_0__.isValidElement)(resolvedChildren) || Array.isArray(resolvedChildren) && resolvedChildren.length > 1) {
throw new Error(['Passing props on "Fragment"!', '', "The current component <" + name + " /> is rendering a \"Fragment\".", "However we need to passthrough the following props:", Object.keys(passThroughProps).map(function (line) {
return " - " + line;
}).join('\n'), '', 'You can apply a few solutions:', ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".', 'Render a single element as the child so that we can forward the props onto that element.'].map(function (line) {
return " - " + line;
}).join('\n')].join('\n'));
}
return (0,react__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(resolvedChildren, Object.assign({}, // Filter out undefined values so that they don't override the existing values
mergeEventFunctions(compact(omit(passThroughProps, ['ref'])), resolvedChildren.props, ['onClick']), refRelatedProps));
}
}
return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(Component, Object.assign({}, omit(passThroughProps, ['ref']), Component !== react__WEBPACK_IMPORTED_MODULE_0__.Fragment && refRelatedProps), resolvedChildren);
}
/**
* We can use this function for the following useCase:
*
* <Menu.Item> <button onClick={console.log} /> </Menu.Item>
*
* Our `Menu.Item` will have an internal `onClick`, if you passthrough an `onClick` to the actual
* `Menu.Item` component we will call it correctly. However, when we have an `onClick` on the actual
* first child, that one should _also_ be called (but before this implementation, it was just
* overriding the `onClick`). But it is only when we *render* that we have access to the existing
* props of this component.
*
* It's a bit hacky, and not that clean, but it is something internal and we have tests to rely on
* so that we can refactor this later (if needed).
*/
function mergeEventFunctions(passThroughProps, existingProps, functionsToMerge) {
var clone = Object.assign({}, passThroughProps);
var _loop = function _loop() {
var func = _step.value;
if (passThroughProps[func] !== undefined && existingProps[func] !== undefined) {
var _Object$assign;
Object.assign(clone, (_Object$assign = {}, _Object$assign[func] = function (event) {
// Props we control
if (!event.defaultPrevented) passThroughProps[func](event); // Existing props on the component
if (!event.defaultPrevented) existingProps[func](event);
}, _Object$assign));
}
};
for (var _iterator = (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__.createForOfIteratorHelperLoose)(functionsToMerge), _step; !(_step = _iterator()).done;) {
_loop();
}
return clone;
}
/**
* This is a hack, but basically we want to keep the full 'API' of the component, but we do want to
* wrap it in a forwardRef so that we _can_ passthrough the ref
*/
function forwardRefWithAs(component) {
var _component$displayNam;
return Object.assign((0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(component), {
displayName: (_component$displayNam = component.displayName) != null ? _component$displayNam : component.name
});
}
function compact(object) {
var clone = Object.assign({}, object);
for (var key in clone) {
if (clone[key] === undefined) delete clone[key];
}
return clone;
}
function omit(object, keysToOmit) {
if (keysToOmit === void 0) {
keysToOmit = [];
}
var clone = Object.assign({}, object);
for (var _iterator2 = (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__.createForOfIteratorHelperLoose)(keysToOmit), _step2; !(_step2 = _iterator2()).done;) {
var key = _step2.value;
if (key in clone) delete clone[key];
}
return clone;
}
//# sourceMappingURL=render.esm.js.map
/***/ }),
/***/ "./wizard/src/Settings.js":
/*!********************************!*\
!*** ./wizard/src/Settings.js ***!
\********************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router/index.js");
/* harmony import */ var _Admin_pages_HomePage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @Admin/pages/HomePage */ "./wizard/src/pages/HomePage.js");
/* harmony import */ var _Admin_pages_Success__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @Admin/pages/Success */ "./wizard/src/pages/Success.js");
/* harmony import */ var _Admin_pages_ExpressCheckout__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @Admin/pages/ExpressCheckout */ "./wizard/src/pages/ExpressCheckout.js");
/* harmony import */ var _Admin_pages_Failed__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @Admin/pages/Failed */ "./wizard/src/pages/Failed.js");
/* harmony import */ var _Admin_pages_ThankYou__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @Admin/pages/ThankYou */ "./wizard/src/pages/ThankYou.js");
/* harmony import */ var _Admin_pages_WooCommerce__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @Admin/pages/WooCommerce */ "./wizard/src/pages/WooCommerce.js");
/* harmony import */ var _Admin_components_Logo__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @Admin/components/Logo */ "./wizard/src/components/Logo.js");
function Settings() {
const query = new URLSearchParams((0,react_router_dom__WEBPACK_IMPORTED_MODULE_9__.useLocation)().search);
const status = query.get('cpsw_call');
let routePage = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null);
switch (status) {
case 'success':
routePage = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_pages_Success__WEBPACK_IMPORTED_MODULE_3__["default"], null);
break;
case 'failed':
routePage = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_pages_Failed__WEBPACK_IMPORTED_MODULE_5__["default"], null);
break;
case 'express-checkout':
routePage = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_pages_ExpressCheckout__WEBPACK_IMPORTED_MODULE_4__["default"], null);
break;
case 'thank-you':
routePage = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_pages_ThankYou__WEBPACK_IMPORTED_MODULE_6__["default"], null);
break;
case 'setup-woocommerce':
routePage = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_pages_WooCommerce__WEBPACK_IMPORTED_MODULE_7__["default"], null);
break;
default:
routePage = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_pages_HomePage__WEBPACK_IMPORTED_MODULE_2__["default"], null);
break;
}
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "relative bg-white overflow-hidden w-10/12 mx-auto my-0 rounded-xl mt-12"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "max-w-7xl mx-auto overflow-x-hidden"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "relative z-10 bg-white lg:w-full"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_components_Logo__WEBPACK_IMPORTED_MODULE_8__["default"], null), routePage)));
}
/* harmony default export */ __webpack_exports__["default"] = (Settings);
/***/ }),
/***/ "./wizard/src/components/Logo.js":
/*!***************************************!*\
!*** ./wizard/src/components/Logo.js ***!
\***************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
function Logo() {
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "relative pt-6 px-4 sm:px-6 lg:px-8"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("nav", {
className: "relative flex items-center justify-center sm:h-10",
"aria-label": "Logo"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "flex items-center justify-center flex-grow"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "flex items-center w-auto"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
className: "h-16 w-full",
src: onboarding_vars.assets_url + 'images/cpsw-logo.svg',
alt: "Checkout Plugins - Stripe for WooCommerce"
}))))));
}
/* harmony default export */ __webpack_exports__["default"] = (Logo);
/***/ }),
/***/ "./wizard/src/components/Spinner.js":
/*!******************************************!*\
!*** ./wizard/src/components/Spinner.js ***!
\******************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
function Spinner() {
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
className: "animate-spin ml-2 mr-3 h-5 w-5 text-white",
xmlns: "http://www.w3.org/2000/svg",
fill: "none",
viewBox: "0 0 24 24"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("circle", {
className: "opacity-25",
cx: "12",
cy: "12",
r: "10",
stroke: "currentColor",
strokeWidth: "4"
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
className: "opacity-75",
fill: "currentColor",
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
}));
}
/* harmony default export */ __webpack_exports__["default"] = (Spinner);
/***/ }),
/***/ "./wizard/src/pages/ExpressCheckout.js":
/*!*********************************************!*\
!*** ./wizard/src/pages/ExpressCheckout.js ***!
\*********************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _Admin_components_Spinner__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @Admin/components/Spinner */ "./wizard/src/components/Spinner.js");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router/index.js");
function ExpressCheckout() {
const [clicked, setClicked] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
const navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_5__.useNavigate)();
function enableExpressCheckout() {
setClicked(true);
const formData = new window.FormData();
formData.append('action', 'cpsw_onboarding_enable_express_checkout');
formData.append('security', onboarding_vars.cpsw_onboarding_enable_express_checkout);
_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default()({
url: onboarding_vars.ajax_url,
method: 'POST',
body: formData
}).then(res => {
if (res.success) {
navigate(onboarding_vars.navigator_base + `&cpsw_call=thank-you`);
}
});
}
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("main", {
className: "mt-10 mx-auto w-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-16 lg:mt-20 lg:px-8 xl:mt-28"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "text-center"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("h1", {
className: "text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
className: "flex justify-center items-center xl gap-x-2.5"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Cheers', 'checkout-plugins-stripe-woo'), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
className: "text-3xl sm:text-[40px]"
}, "\uD83C\uDF89")), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
className: "block text-cart-500 xl:inline"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Just a few more steps.', 'checkout-plugins-stripe-woo'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
className: "mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
className: "block",
dangerouslySetInnerHTML: {
__html: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.sprintf)( // Translators: This message recommends activating Express Checkout and Stripe Card Processing for better conversions.
(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('For better conversions, we recommend activating %1$sExpress Checkout%2$s along with your new %1$sStripe Card Processing.%2$s', 'checkout-plugins-stripe-woo'), '<span class="block text-gray-700 xl:inline font-bold">', '</span>')
}
})), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "block mx-auto mt-1 mb-1"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
className: "inline mx-4 py-5 h-24",
src: onboarding_vars.assets_url + 'images/apple-pay.svg',
alt: "Express Checkout"
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
className: "inline mx-4 py-5 h-24",
src: onboarding_vars.assets_url + 'images/gpay.svg',
alt: "Express Checkout"
})), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "sm:inline-block lg:inline-block sm:justify-center lg:justify-center"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "rounded-md shadow"
}, clicked ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
className: "disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Activating…', 'checkout-plugins-stripe-woo'), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_components_Spinner__WEBPACK_IMPORTED_MODULE_4__["default"], null)) : (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
onClick: enableExpressCheckout,
className: "w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Activate Express Checkout', 'checkout-plugins-stripe-woo'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "mt-3 sm:mt-0 sm:ml-3"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", {
href: onboarding_vars.base_url + `&cpsw_call=thank-you`,
className: "w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-slate-300 md:py-4 md:text-lg md:px-10"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Skip Express Checkout', 'checkout-plugins-stripe-woo'))))));
}
/* harmony default export */ __webpack_exports__["default"] = (ExpressCheckout);
/***/ }),
/***/ "./wizard/src/pages/Failed.js":
/*!************************************!*\
!*** ./wizard/src/pages/Failed.js ***!
\************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
function Failed() {
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("main", {
className: "mt-10 mx-auto w-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-14 lg:mt-16 lg:px-8 xl:mt-18"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "text-center"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("h1", {
className: "text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
className: "block text-red-600 xl:inline"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Failed!', 'checkout-plugins-stripe-woo'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
className: "mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
className: "block"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Unfortunately, Connection to Stripe Failed.', 'checkout-plugins-stripe-woo'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "mt-5 sm:mt-8 sm:inline-block lg:inline-block sm:justify-center lg:justify-center"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "rounded-md shadow"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", {
href: onboarding_vars.authorization_url,
className: "w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Please Try Again.', 'checkout-plugins-stripe-woo'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "mt-3 sm:mt-0 sm:ml-3"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", {
href: onboarding_vars.manual_connect_url,
className: "w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-slate-300 md:py-4 md:text-lg md:px-10"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Manage API keys manually', 'checkout-plugins-stripe-woo'))))));
}
/* harmony default export */ __webpack_exports__["default"] = (Failed);
/***/ }),
/***/ "./wizard/src/pages/HomePage.js":
/*!**************************************!*\
!*** ./wizard/src/pages/HomePage.js ***!
\**************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _Admin_components_Spinner__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @Admin/components/Spinner */ "./wizard/src/components/Spinner.js");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router/index.js");
function HomePage() {
const [clicked, setClicked] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
const navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_4__.useNavigate)();
function connectWithStripe() {
setClicked(true);
if ('' === onboarding_vars.woocommerce_installed || '' === onboarding_vars.woocommerce_activated) {
navigate(onboarding_vars.navigator_base + '&cpsw_call=setup-woocommerce');
} else {
window.location.replace(onboarding_vars.authorization_url);
}
}
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("main", {
className: "mt-10 mx-auto w-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-16 lg:mt-20 lg:px-8 xl:mt-28"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "text-center"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("h1", {
className: "text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
className: "block xl"
}, " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Let\'s Connect', 'checkout-plugins-stripe-woo')), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
className: "block text-cart-500 xl:inline"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('with Stripe!', 'checkout-plugins-stripe-woo'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
className: "mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0",
dangerouslySetInnerHTML: {
__html: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)( // translators: 1: opening span tag, 2: closing span tag, 3: opening block span tag, 4: opening span tag
(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('%3$s%1$sCheckout Plugins %2$s highly recommends using %1$sStripe Connect%2$s,%2$s%4$sa one-click onboarding solution offered by %1$sStripe.%2$s%2$s', 'checkout-plugins-stripe-woo'), '<span class="block text-gray-700 xl:inline font-bold">', '</span>', '<span class="block">', '<span>')
}
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "mt-5 sm:mt-8 sm:inline-block lg:inline-block sm:justify-center lg:justify-center"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "rounded-md shadow"
}, clicked ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
className: "disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Connecting…', 'checkout-plugins-stripe-woo'), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_components_Spinner__WEBPACK_IMPORTED_MODULE_3__["default"], null)) : (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
onClick: connectWithStripe,
className: "w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Connect with Stripe', 'checkout-plugins-stripe-woo'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "mt-3 sm:mt-0 sm:ml-3"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", {
href: onboarding_vars.settings_url,
className: "w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-slate-300 md:py-4 md:text-lg md:px-10"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Exit the onboarding process.', 'checkout-plugins-stripe-woo'))))));
}
/* harmony default export */ __webpack_exports__["default"] = (HomePage);
/***/ }),
/***/ "./wizard/src/pages/Success.js":
/*!*************************************!*\
!*** ./wizard/src/pages/Success.js ***!
\*************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _headlessui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @headlessui/react */ "./node_modules/@headlessui/react/dist/components/switch/switch.esm.js");
/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _Admin_components_Spinner__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @Admin/components/Spinner */ "./wizard/src/components/Spinner.js");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router/index.js");
function classNames() {
for (var _len = arguments.length, classes = new Array(_len), _key = 0; _key < _len; _key++) {
classes[_key] = arguments[_key];
}
return classes.filter(Boolean).join(' ');
}
function Success() {
const [clicked, setClicked] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
const [gateways, setGateways] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(onboarding_vars.available_gateways);
const navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_5__.useNavigate)();
function enableGateways(e) {
e.preventDefault();
setClicked(true);
const formData = new window.FormData();
const object = {};
gateways.forEach(function (value) {
object[value.id] = document.getElementsByName(value.id)[0].value;
});
const json = JSON.stringify(object);
formData.append('formdata', json);
formData.append('action', 'cpsw_onboarding_enable_gateway');
formData.append('security', onboarding_vars.cpsw_onboarding_enable_gateway);
_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default()({
url: onboarding_vars.ajax_url,
method: 'POST',
body: formData
}).then(res => {
if (res.success) {
if (true === res.data.activated_gateways.cpsw_stripe) {
navigate(onboarding_vars.navigator_base + `&cpsw_call=express-checkout`);
} else {
navigate(onboarding_vars.navigator_base + `&cpsw_call=webhooks`);
}
}
});
}
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("main", {
className: "mt-4 mb-4 mx-auto w-auto max-w-7xl px-4 sm:mt-6 sm:px-6 md:mt-8 lg:mt-10 lg:px-8 xl:mt-16"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "text-center"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
className: "mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
className: "block"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
className: "text-gray-700 inline font-bold"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Congratulations!', 'checkout-plugins-stripe-woo'), " "), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('You have successfully connected to Stripe.', 'checkout-plugins-stripe-woo')), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
className: "block"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Let\'s activate the gateways.', 'checkout-plugins-stripe-woo'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("ul", {
role: "list",
className: "divide-y divide-gray-200 bg-white overflow-hidden sm:rounded-md mt-10 max-w-screen-md mx-auto"
}, gateways.map(gateway => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("li", {
key: gateway.id
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
href: "#",
className: "block hover:bg-gray-50"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "flex items-center px-4 py-4 sm:px-6"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "min-w-0 flex-1 flex items-center"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "flex-shrink-0"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
className: "h-12 w-32 max-w-80",
src: gateway.icon,
alt: gateway.name
})), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "min-w-0 flex-1 px-4 md:gap-4"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
className: "text-sm font-medium text-cart-500 flex truncate"
}, gateway.name, " ", gateway.recommended ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
className: "ml-2 px-2 py-1 text-green-800 text-xs font-medium bg-green-100 rounded-full"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Recommended', 'checkout-plugins-stripe-woo')) : ''), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
className: "text-sm font-medium text-gray-400 flex"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
className: "text-left text-sm"
}, 'all' === gateway.currencies ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Supports all currencies', 'checkout-plugins-stripe-woo') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Supports ', 'checkout-plugins-stripe-woo') + gateway.currencies))))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.Switch, {
checked: gateway.enabled,
value: gateway.enabled,
name: gateway.id,
onChange: () => {
gateway.enabled = !gateway.enabled;
setGateways([...gateways]);
},
className: classNames(gateway.enabled ? 'bg-cart-500 ' : 'bg-gray-200', 'relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-cart-500')
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
className: "sr-only"
}, gateway.id), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
"aria-hidden": "true",
className: classNames(gateway.enabled ? 'translate-x-5' : 'translate-x-0', 'pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200')
})))))))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "mt-5 sm:mt-8 sm:inline-block lg:inline-block sm:justify-center lg:justify-center"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "rounded-md shadow"
}, clicked ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
className: "disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Activating…', 'checkout-plugins-stripe-woo'), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_components_Spinner__WEBPACK_IMPORTED_MODULE_4__["default"], null)) : (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
onClick: enableGateways,
className: "w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Activate Gateways', 'checkout-plugins-stripe-woo'))))));
}
/* harmony default export */ __webpack_exports__["default"] = (Success);
/***/ }),
/***/ "./wizard/src/pages/ThankYou.js":
/*!**************************************!*\
!*** ./wizard/src/pages/ThankYou.js ***!
\**************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _Admin_components_Spinner__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @Admin/components/Spinner */ "./wizard/src/components/Spinner.js");
function ThankYou() {
const [clicked, setClicked] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
function letsCustomize() {
setClicked(true);
window.location.replace(onboarding_vars.gateways_url);
}
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("main", {
className: "mt-10 mx-auto w-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-14 lg:mt-16 lg:px-8 xl:mt-18"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "text-center"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("h1", {
className: "text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
className: "block text-cart-500 xl:inline"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Great!', 'checkout-plugins-stripe-woo'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
className: "mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
className: "block"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Your store is all set to accept payments.', 'checkout-plugins-stripe-woo')), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('We provide lots of customization options to match your needs, don\'t forget to explore them.', 'checkout-plugins-stripe-woo'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "mt-5 sm:mt-8 sm:inline-block lg:inline-block sm:justify-center lg:justify-center"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "rounded-md shadow"
}, clicked ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
className: "disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Customize Now…', 'checkout-plugins-stripe-woo'), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_components_Spinner__WEBPACK_IMPORTED_MODULE_3__["default"], null)) : (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
onClick: letsCustomize,
className: "w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Customize Now', 'checkout-plugins-stripe-woo'))))));
}
/* harmony default export */ __webpack_exports__["default"] = (ThankYou);
/***/ }),
/***/ "./wizard/src/pages/WooCommerce.js":
/*!*****************************************!*\
!*** ./wizard/src/pages/WooCommerce.js ***!
\*****************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _Admin_components_Spinner__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @Admin/components/Spinner */ "./wizard/src/components/Spinner.js");
function WooCommerce() {
if ('' !== onboarding_vars.woocommerce_installed && '' !== onboarding_vars.woocommerce_activated) {
window.location.replace(onboarding_vars.navigator_base);
}
const [state, setState] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('');
const [notification, setNotification] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
const [notificationError, setErrorNotification] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
function installWooCommerce() {
if ('' === onboarding_vars.woocommerce_installed) {
setState('installing');
setTimeout(() => {
setNotification(true);
}, 10000);
wp.updates.queue.push({
action: 'install-plugin',
// Required action.
data: {
slug: 'woocommerce'
}
}); // Required to set queue.
wp.updates.queueChecker();
} else {
setState('activating');
const formData = new window.FormData();
formData.append('action', 'cpsw_onboarding_install_woocommerce');
formData.append('security', onboarding_vars.cpsw_onboarding_install_woocommerce);
_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default()({
url: onboarding_vars.ajax_url,
method: 'POST',
body: formData
}).then(res => {
if (res.success) {
window.location.replace(onboarding_vars.onboarding_base);
} else {
setErrorNotification(true);
}
});
}
}
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("main", {
className: "mt-10 mx-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-16 lg:mt-20 lg:px-8 xl:mt-28"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "text-center"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("h1", {
className: "text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
className: "block xl"
}, '' === onboarding_vars.woocommerce_installed ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Missing', 'checkout-plugins-stripe-woo') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Inactive', 'checkout-plugins-stripe-woo')), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
className: "block text-cart-500 xl:inline"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('WooCommerce', 'checkout-plugins-stripe-woo'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
className: "mt-6 text-base justify-center text-gray-500 sm:mt-5 sm:text-lg sm:w-full sm:mx-auto md:mt-5 md:text-xl lg:mx-0",
dangerouslySetInnerHTML: {
__html: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.sprintf)( // Translators: Styling placeholders for WooCommerce activation notice. %1$s represents the opening span tag for styling, %2$s represents the closing span tag.
(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('%1$sCheckout Plugins - Stripe for WooCommerce %2$sneeds %1$sWooCommerce%2$s to be active on your store.', 'checkout-plugins-stripe-woo'), '<span class="block text-gray-700 xl:inline font-bold">', '</span>')
}
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "mt-5 sm:mt-8 sm:flex justify-center"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "rounded-md shadow"
}, (() => {
if ('installing' === state) {
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
className: "disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Installing…', 'checkout-plugins-stripe-woo'), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_components_Spinner__WEBPACK_IMPORTED_MODULE_4__["default"], null));
} else if ('activating' === state) {
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
className: "disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Activating, just a moment…', 'checkout-plugins-stripe-woo'), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_components_Spinner__WEBPACK_IMPORTED_MODULE_4__["default"], null));
}
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
onClick: installWooCommerce,
className: "install-dependency w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"
}, '' === onboarding_vars.woocommerce_installed ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Install and continue', 'checkout-plugins-stripe-woo') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Activate and Proceed', 'checkout-plugins-stripe-woo'));
})()))), notification ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "bg-cart-50 p-4 fixed left-0 top-0 right-0 transition ease-in-out delay-150"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "block"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "text-center justify-center"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
className: "text-sm mx-auto w-full text-cart-500 text-center"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Installing WooCommerce will take time. Please be patient.', 'checkout-plugins-stripe-woo'))))) : '', notificationError ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "bg-cart-50 p-4 fixed left-0 top-0 right-0 transition ease-in-out delay-150"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "block"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "text-center justify-center"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
className: "text-sm mx-auto w-full text-cart-500 text-center"
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('WooCommerce installing failed. Please try again.', 'checkout-plugins-stripe-woo'))))) : '');
}
/* harmony default export */ __webpack_exports__["default"] = (WooCommerce);
/***/ }),
/***/ "./node_modules/history/index.js":
/*!***************************************!*\
!*** ./node_modules/history/index.js ***!
\***************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "Action": function() { return /* binding */ r; },
/* harmony export */ "createBrowserHistory": function() { return /* binding */ createBrowserHistory; },
/* harmony export */ "createHashHistory": function() { return /* binding */ createHashHistory; },
/* harmony export */ "createMemoryHistory": function() { return /* binding */ createMemoryHistory; },
/* harmony export */ "createPath": function() { return /* binding */ I; },
/* harmony export */ "parsePath": function() { return /* binding */ J; }
/* harmony export */ });
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
var r,B=r||(r={});B.Pop="POP";B.Push="PUSH";B.Replace="REPLACE";var C= true?function(b){return Object.freeze(b)}:0;function D(b,h){if(!b){"undefined"!==typeof console&&console.warn(h);try{throw Error(h);}catch(e){}}}function E(b){b.preventDefault();b.returnValue=""}
function F(){var b=[];return{get length(){return b.length},push:function(h){b.push(h);return function(){b=b.filter(function(e){return e!==h})}},call:function(h){b.forEach(function(e){return e&&e(h)})}}}function H(){return Math.random().toString(36).substr(2,8)}function I(b){var h=b.pathname;h=void 0===h?"/":h;var e=b.search;e=void 0===e?"":e;b=b.hash;b=void 0===b?"":b;e&&"?"!==e&&(h+="?"===e.charAt(0)?e:"?"+e);b&&"#"!==b&&(h+="#"===b.charAt(0)?b:"#"+b);return h}
function J(b){var h={};if(b){var e=b.indexOf("#");0<=e&&(h.hash=b.substr(e),b=b.substr(0,e));e=b.indexOf("?");0<=e&&(h.search=b.substr(e),b=b.substr(0,e));b&&(h.pathname=b)}return h}
function createBrowserHistory(b){function h(){var c=p.location,a=m.state||{};return[a.idx,C({pathname:c.pathname,search:c.search,hash:c.hash,state:a.usr||null,key:a.key||"default"})]}function e(c){return"string"===typeof c?c:I(c)}function x(c,a){void 0===a&&(a=null);return C((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({pathname:q.pathname,hash:"",search:""},"string"===typeof c?J(c):c,{state:a,key:H()}))}function z(c){t=c;c=h();v=c[0];q=c[1];d.call({action:t,location:q})}function A(c,a){function f(){A(c,a)}var l=r.Push,k=x(c,
a);if(!g.length||(g.call({action:l,location:k,retry:f}),!1)){var n=[{usr:k.state,key:k.key,idx:v+1},e(k)];k=n[0];n=n[1];try{m.pushState(k,"",n)}catch(G){p.location.assign(n)}z(l)}}function y(c,a){function f(){y(c,a)}var l=r.Replace,k=x(c,a);g.length&&(g.call({action:l,location:k,retry:f}),1)||(k=[{usr:k.state,key:k.key,idx:v},e(k)],m.replaceState(k[0],"",k[1]),z(l))}function w(c){m.go(c)}void 0===b&&(b={});b=b.window;var p=void 0===b?document.defaultView:b,m=p.history,u=null;p.addEventListener("popstate",
function(){if(u)g.call(u),u=null;else{var c=r.Pop,a=h(),f=a[0];a=a[1];if(g.length)if(null!=f){var l=v-f;l&&(u={action:c,location:a,retry:function(){w(-1*l)}},w(l))}else true?D(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."):
0;else z(c)}});var t=r.Pop;b=h();var v=b[0],q=b[1],d=F(),g=F();null==v&&(v=0,m.replaceState((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({},m.state,{idx:v}),""));return{get action(){return t},get location(){return q},createHref:e,push:A,replace:y,go:w,back:function(){w(-1)},forward:function(){w(1)},listen:function(c){return d.push(c)},block:function(c){var a=g.push(c);1===g.length&&p.addEventListener("beforeunload",E);return function(){a();g.length||p.removeEventListener("beforeunload",E)}}}};
function createHashHistory(b){function h(){var a=J(m.location.hash.substr(1)),f=a.pathname,l=a.search;a=a.hash;var k=u.state||{};return[k.idx,C({pathname:void 0===f?"/":f,search:void 0===l?"":l,hash:void 0===a?"":a,state:k.usr||null,key:k.key||"default"})]}function e(){if(t)c.call(t),t=null;else{var a=r.Pop,f=h(),l=f[0];f=f[1];if(c.length)if(null!=l){var k=q-l;k&&(t={action:a,location:f,retry:function(){p(-1*k)}},p(k))}else true?D(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."):
0;else A(a)}}function x(a){var f=document.querySelector("base"),l="";f&&f.getAttribute("href")&&(f=m.location.href,l=f.indexOf("#"),l=-1===l?f:f.slice(0,l));return l+"#"+("string"===typeof a?a:I(a))}function z(a,f){void 0===f&&(f=null);return C((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({pathname:d.pathname,hash:"",search:""},"string"===typeof a?J(a):a,{state:f,key:H()}))}function A(a){v=a;a=h();q=a[0];d=a[1];g.call({action:v,location:d})}function y(a,f){function l(){y(a,f)}var k=r.Push,n=z(a,f); true?
D("/"===n.pathname.charAt(0),"Relative pathnames are not supported in hash history.push("+JSON.stringify(a)+")"):0;if(!c.length||(c.call({action:k,location:n,retry:l}),!1)){var G=[{usr:n.state,key:n.key,idx:q+1},x(n)];n=G[0];G=G[1];try{u.pushState(n,"",G)}catch(K){m.location.assign(G)}A(k)}}function w(a,f){function l(){w(a,f)}var k=r.Replace,n=z(a,f); true?D("/"===n.pathname.charAt(0),"Relative pathnames are not supported in hash history.replace("+JSON.stringify(a)+
")"):0;c.length&&(c.call({action:k,location:n,retry:l}),1)||(n=[{usr:n.state,key:n.key,idx:q},x(n)],u.replaceState(n[0],"",n[1]),A(k))}function p(a){u.go(a)}void 0===b&&(b={});b=b.window;var m=void 0===b?document.defaultView:b,u=m.history,t=null;m.addEventListener("popstate",e);m.addEventListener("hashchange",function(){var a=h()[1];I(a)!==I(d)&&e()});var v=r.Pop;b=h();var q=b[0],d=b[1],g=F(),c=F();null==q&&(q=0,u.replaceState((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({},u.state,{idx:q}),""));return{get action(){return v},get location(){return d},
createHref:x,push:y,replace:w,go:p,back:function(){p(-1)},forward:function(){p(1)},listen:function(a){return g.push(a)},block:function(a){var f=c.push(a);1===c.length&&m.addEventListener("beforeunload",E);return function(){f();c.length||m.removeEventListener("beforeunload",E)}}}};
function createMemoryHistory(b){function h(d,g){void 0===g&&(g=null);return C((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({pathname:t.pathname,search:"",hash:""},"string"===typeof d?J(d):d,{state:g,key:H()}))}function e(d,g,c){return!q.length||(q.call({action:d,location:g,retry:c}),!1)}function x(d,g){u=d;t=g;v.call({action:u,location:t})}function z(d,g){var c=r.Push,a=h(d,g); true?D("/"===t.pathname.charAt(0),"Relative pathnames are not supported in memory history.push("+JSON.stringify(d)+")"):
0;e(c,a,function(){z(d,g)})&&(m+=1,p.splice(m,p.length,a),x(c,a))}function A(d,g){var c=r.Replace,a=h(d,g); true?D("/"===t.pathname.charAt(0),"Relative pathnames are not supported in memory history.replace("+JSON.stringify(d)+")"):0;e(c,a,function(){A(d,g)})&&(p[m]=a,x(c,a))}function y(d){var g=Math.min(Math.max(m+d,0),p.length-1),c=r.Pop,a=p[g];e(c,a,function(){y(d)})&&(m=g,x(c,a))}void 0===b&&(b={});var w=b;b=w.initialEntries;w=w.initialIndex;var p=(void 0===
b?["/"]:b).map(function(d){var g=C((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({pathname:"/",search:"",hash:"",state:null,key:H()},"string"===typeof d?J(d):d)); true?D("/"===g.pathname.charAt(0),"Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: "+JSON.stringify(d)+")"):0;return g}),m=Math.min(Math.max(null==w?p.length-1:w,0),p.length-1),u=r.Pop,t=p[m],v=F(),q=F();return{get index(){return m},get action(){return u},get location(){return t},createHref:function(d){return"string"===
typeof d?d:I(d)},push:z,replace:A,go:y,back:function(){y(-1)},forward:function(){y(1)},listen:function(d){return v.push(d)},block:function(d){return q.push(d)}}};
//# sourceMappingURL=index.js.map
/***/ }),
/***/ "./wizard/src/App.scss":
/*!*****************************!*\
!*** ./wizard/src/App.scss ***!
\*****************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./node_modules/react-router-dom/index.js":
/*!************************************************!*\
!*** ./node_modules/react-router-dom/index.js ***!
\************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "MemoryRouter": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.MemoryRouter; },
/* harmony export */ "Navigate": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.Navigate; },
/* harmony export */ "Outlet": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.Outlet; },
/* harmony export */ "Route": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.Route; },
/* harmony export */ "Router": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.Router; },
/* harmony export */ "Routes": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.Routes; },
/* harmony export */ "UNSAFE_LocationContext": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_LocationContext; },
/* harmony export */ "UNSAFE_NavigationContext": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_NavigationContext; },
/* harmony export */ "UNSAFE_RouteContext": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_RouteContext; },
/* harmony export */ "createRoutesFromChildren": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.createRoutesFromChildren; },
/* harmony export */ "generatePath": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.generatePath; },
/* harmony export */ "matchPath": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.matchPath; },
/* harmony export */ "matchRoutes": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.matchRoutes; },
/* harmony export */ "renderMatches": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.renderMatches; },
/* harmony export */ "resolvePath": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.resolvePath; },
/* harmony export */ "useHref": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.useHref; },
/* harmony export */ "useInRouterContext": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.useInRouterContext; },
/* harmony export */ "useLocation": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.useLocation; },
/* harmony export */ "useMatch": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.useMatch; },
/* harmony export */ "useNavigate": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.useNavigate; },
/* harmony export */ "useNavigationType": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.useNavigationType; },
/* harmony export */ "useOutlet": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.useOutlet; },
/* harmony export */ "useOutletContext": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.useOutletContext; },
/* harmony export */ "useParams": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.useParams; },
/* harmony export */ "useResolvedPath": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.useResolvedPath; },
/* harmony export */ "useRoutes": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.useRoutes; },
/* harmony export */ "BrowserRouter": function() { return /* binding */ BrowserRouter; },
/* harmony export */ "HashRouter": function() { return /* binding */ HashRouter; },
/* harmony export */ "Link": function() { return /* binding */ Link; },
/* harmony export */ "NavLink": function() { return /* binding */ NavLink; },
/* harmony export */ "createSearchParams": function() { return /* binding */ createSearchParams; },
/* harmony export */ "unstable_HistoryRouter": function() { return /* binding */ HistoryRouter; },
/* harmony export */ "useLinkClickHandler": function() { return /* binding */ useLinkClickHandler; },
/* harmony export */ "useSearchParams": function() { return /* binding */ useSearchParams; }
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var history__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! history */ "./node_modules/history/index.js");
/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-router */ "./node_modules/react-router/index.js");
/**
* React Router DOM v6.2.1
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
const _excluded = ["onClick", "reloadDocument", "replace", "state", "target", "to"],
_excluded2 = ["aria-current", "caseSensitive", "className", "end", "style", "to", "children"];
function warning(cond, message) {
if (!cond) {
// eslint-disable-next-line no-console
if (typeof console !== "undefined") console.warn(message);
try {
// Welcome to debugging React Router!
//
// This error is thrown as a convenience so you can more easily
// find the source for a warning that appears in the console by
// enabling "pause on exceptions" in your JavaScript debugger.
throw new Error(message); // eslint-disable-next-line no-empty
} catch (e) {}
}
} ////////////////////////////////////////////////////////////////////////////////
// COMPONENTS
////////////////////////////////////////////////////////////////////////////////
/**
* A `<Router>` for use in web browsers. Provides the cleanest URLs.
*/
function BrowserRouter(_ref) {
let {
basename,
children,
window
} = _ref;
let historyRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
if (historyRef.current == null) {
historyRef.current = (0,history__WEBPACK_IMPORTED_MODULE_2__.createBrowserHistory)({
window
});
}
let history = historyRef.current;
let [state, setState] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({
action: history.action,
location: history.location
});
(0,react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect)(() => history.listen(setState), [history]);
return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react_router__WEBPACK_IMPORTED_MODULE_1__.Router, {
basename: basename,
children: children,
location: state.location,
navigationType: state.action,
navigator: history
});
}
/**
* A `<Router>` for use in web browsers. Stores the location in the hash
* portion of the URL so it is not sent to the server.
*/
function HashRouter(_ref2) {
let {
basename,
children,
window
} = _ref2;
let historyRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
if (historyRef.current == null) {
historyRef.current = (0,history__WEBPACK_IMPORTED_MODULE_2__.createHashHistory)({
window
});
}
let history = historyRef.current;
let [state, setState] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({
action: history.action,
location: history.location
});
(0,react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect)(() => history.listen(setState), [history]);
return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react_router__WEBPACK_IMPORTED_MODULE_1__.Router, {
basename: basename,
children: children,
location: state.location,
navigationType: state.action,
navigator: history
});
}
/**
* A `<Router>` that accepts a pre-instantiated history object. It's important
* to note that using your own history object is highly discouraged and may add
* two versions of the history library to your bundles unless you use the same
* version of the history library that React Router uses internally.
*/
function HistoryRouter(_ref3) {
let {
basename,
children,
history
} = _ref3;
const [state, setState] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({
action: history.action,
location: history.location
});
(0,react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect)(() => history.listen(setState), [history]);
return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react_router__WEBPACK_IMPORTED_MODULE_1__.Router, {
basename: basename,
children: children,
location: state.location,
navigationType: state.action,
navigator: history
});
}
if (true) {
HistoryRouter.displayName = "unstable_HistoryRouter";
}
function isModifiedEvent(event) {
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
}
/**
* The public API for rendering a history-aware <a>.
*/
const Link = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function LinkWithRef(_ref4, ref) {
let {
onClick,
reloadDocument,
replace = false,
state,
target,
to
} = _ref4,
rest = _objectWithoutPropertiesLoose(_ref4, _excluded);
let href = (0,react_router__WEBPACK_IMPORTED_MODULE_1__.useHref)(to);
let internalOnClick = useLinkClickHandler(to, {
replace,
state,
target
});
function handleClick(event) {
if (onClick) onClick(event);
if (!event.defaultPrevented && !reloadDocument) {
internalOnClick(event);
}
}
return (
/*#__PURE__*/
// eslint-disable-next-line jsx-a11y/anchor-has-content
(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", _extends({}, rest, {
href: href,
onClick: handleClick,
ref: ref,
target: target
}))
);
});
if (true) {
Link.displayName = "Link";
}
/**
* A <Link> wrapper that knows if it's "active" or not.
*/
const NavLink = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function NavLinkWithRef(_ref5, ref) {
let {
"aria-current": ariaCurrentProp = "page",
caseSensitive = false,
className: classNameProp = "",
end = false,
style: styleProp,
to,
children
} = _ref5,
rest = _objectWithoutPropertiesLoose(_ref5, _excluded2);
let location = (0,react_router__WEBPACK_IMPORTED_MODULE_1__.useLocation)();
let path = (0,react_router__WEBPACK_IMPORTED_MODULE_1__.useResolvedPath)(to);
let locationPathname = location.pathname;
let toPathname = path.pathname;
if (!caseSensitive) {
locationPathname = locationPathname.toLowerCase();
toPathname = toPathname.toLowerCase();
}
let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(toPathname.length) === "/";
let ariaCurrent = isActive ? ariaCurrentProp : undefined;
let className;
if (typeof classNameProp === "function") {
className = classNameProp({
isActive
});
} else {
// If the className prop is not a function, we use a default `active`
// class for <NavLink />s that are active. In v5 `active` was the default
// value for `activeClassName`, but we are removing that API and can still
// use the old default behavior for a cleaner upgrade path and keep the
// simple styling rules working as they currently do.
className = [classNameProp, isActive ? "active" : null].filter(Boolean).join(" ");
}
let style = typeof styleProp === "function" ? styleProp({
isActive
}) : styleProp;
return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(Link, _extends({}, rest, {
"aria-current": ariaCurrent,
className: className,
ref: ref,
style: style,
to: to
}), typeof children === "function" ? children({
isActive
}) : children);
});
if (true) {
NavLink.displayName = "NavLink";
} ////////////////////////////////////////////////////////////////////////////////
// HOOKS
////////////////////////////////////////////////////////////////////////////////
/**
* Handles the click behavior for router `<Link>` components. This is useful if
* you need to create custom `<Link>` components with the same click behavior we
* use in our exported `<Link>`.
*/
function useLinkClickHandler(to, _temp) {
let {
target,
replace: replaceProp,
state
} = _temp === void 0 ? {} : _temp;
let navigate = (0,react_router__WEBPACK_IMPORTED_MODULE_1__.useNavigate)();
let location = (0,react_router__WEBPACK_IMPORTED_MODULE_1__.useLocation)();
let path = (0,react_router__WEBPACK_IMPORTED_MODULE_1__.useResolvedPath)(to);
return (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(event => {
if (event.button === 0 && ( // Ignore everything but left clicks
!target || target === "_self") && // Let browser handle "target=_blank" etc.
!isModifiedEvent(event) // Ignore clicks with modifier keys
) {
event.preventDefault(); // If the URL hasn't changed, a regular <a> will do a replace instead of
// a push, so do the same here.
let replace = !!replaceProp || (0,history__WEBPACK_IMPORTED_MODULE_2__.createPath)(location) === (0,history__WEBPACK_IMPORTED_MODULE_2__.createPath)(path);
navigate(to, {
replace,
state
});
}
}, [location, navigate, path, replaceProp, state, target, to]);
}
/**
* A convenient wrapper for reading and writing search parameters via the
* URLSearchParams interface.
*/
function useSearchParams(defaultInit) {
true ? warning(typeof URLSearchParams !== "undefined", "You cannot use the `useSearchParams` hook in a browser that does not " + "support the URLSearchParams API. If you need to support Internet " + "Explorer 11, we recommend you load a polyfill such as " + "https://github.com/ungap/url-search-params\n\n" + "If you're unsure how to load polyfills, we recommend you check out " + "https://polyfill.io/v3/ which provides some recommendations about how " + "to load polyfills only for users that need them, instead of for every " + "user.") : 0;
let defaultSearchParamsRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(createSearchParams(defaultInit));
let location = (0,react_router__WEBPACK_IMPORTED_MODULE_1__.useLocation)();
let searchParams = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
let searchParams = createSearchParams(location.search);
for (let key of defaultSearchParamsRef.current.keys()) {
if (!searchParams.has(key)) {
defaultSearchParamsRef.current.getAll(key).forEach(value => {
searchParams.append(key, value);
});
}
}
return searchParams;
}, [location.search]);
let navigate = (0,react_router__WEBPACK_IMPORTED_MODULE_1__.useNavigate)();
let setSearchParams = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((nextInit, navigateOptions) => {
navigate("?" + createSearchParams(nextInit), navigateOptions);
}, [navigate]);
return [searchParams, setSearchParams];
}
/**
* Creates a URLSearchParams object using the given initializer.
*
* This is identical to `new URLSearchParams(init)` except it also
* supports arrays as values in the object form of the initializer
* instead of just strings. This is convenient when you need multiple
* values for a given key, but don't want to use an array initializer.
*
* For example, instead of:
*
* let searchParams = new URLSearchParams([
* ['sort', 'name'],
* ['sort', 'price']
* ]);
*
* you can do:
*
* let searchParams = createSearchParams({
* sort: ['name', 'price']
* });
*/
function createSearchParams(init) {
if (init === void 0) {
init = "";
}
return new URLSearchParams(typeof init === "string" || Array.isArray(init) || init instanceof URLSearchParams ? init : Object.keys(init).reduce((memo, key) => {
let value = init[key];
return memo.concat(Array.isArray(value) ? value.map(v => [key, v]) : [[key, value]]);
}, []));
}
//# sourceMappingURL=index.js.map
/***/ }),
/***/ "./node_modules/react-router/index.js":
/*!********************************************!*\
!*** ./node_modules/react-router/index.js ***!
\********************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "MemoryRouter": function() { return /* binding */ MemoryRouter; },
/* harmony export */ "Navigate": function() { return /* binding */ Navigate; },
/* harmony export */ "Outlet": function() { return /* binding */ Outlet; },
/* harmony export */ "Route": function() { return /* binding */ Route; },
/* harmony export */ "Router": function() { return /* binding */ Router; },
/* harmony export */ "Routes": function() { return /* binding */ Routes; },
/* harmony export */ "UNSAFE_LocationContext": function() { return /* binding */ LocationContext; },
/* harmony export */ "UNSAFE_NavigationContext": function() { return /* binding */ NavigationContext; },
/* harmony export */ "UNSAFE_RouteContext": function() { return /* binding */ RouteContext; },
/* harmony export */ "createRoutesFromChildren": function() { return /* binding */ createRoutesFromChildren; },
/* harmony export */ "generatePath": function() { return /* binding */ generatePath; },
/* harmony export */ "matchPath": function() { return /* binding */ matchPath; },
/* harmony export */ "matchRoutes": function() { return /* binding */ matchRoutes; },
/* harmony export */ "renderMatches": function() { return /* binding */ renderMatches; },
/* harmony export */ "resolvePath": function() { return /* binding */ resolvePath; },
/* harmony export */ "useHref": function() { return /* binding */ useHref; },
/* harmony export */ "useInRouterContext": function() { return /* binding */ useInRouterContext; },
/* harmony export */ "useLocation": function() { return /* binding */ useLocation; },
/* harmony export */ "useMatch": function() { return /* binding */ useMatch; },
/* harmony export */ "useNavigate": function() { return /* binding */ useNavigate; },
/* harmony export */ "useNavigationType": function() { return /* binding */ useNavigationType; },
/* harmony export */ "useOutlet": function() { return /* binding */ useOutlet; },
/* harmony export */ "useOutletContext": function() { return /* binding */ useOutletContext; },
/* harmony export */ "useParams": function() { return /* binding */ useParams; },
/* harmony export */ "useResolvedPath": function() { return /* binding */ useResolvedPath; },
/* harmony export */ "useRoutes": function() { return /* binding */ useRoutes; }
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var history__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! history */ "./node_modules/history/index.js");
/**
* React Router v6.2.1
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
function invariant(cond, message) {
if (!cond) throw new Error(message);
}
function warning(cond, message) {
if (!cond) {
// eslint-disable-next-line no-console
if (typeof console !== "undefined") console.warn(message);
try {
// Welcome to debugging React Router!
//
// This error is thrown as a convenience so you can more easily
// find the source for a warning that appears in the console by
// enabling "pause on exceptions" in your JavaScript debugger.
throw new Error(message); // eslint-disable-next-line no-empty
} catch (e) {}
}
}
const alreadyWarned = {};
function warningOnce(key, cond, message) {
if (!cond && !alreadyWarned[key]) {
alreadyWarned[key] = true;
true ? warning(false, message) : 0;
}
} ///////////////////////////////////////////////////////////////////////////////
// CONTEXT
///////////////////////////////////////////////////////////////////////////////
/**
* A Navigator is a "location changer"; it's how you get to different locations.
*
* Every history instance conforms to the Navigator interface, but the
* distinction is useful primarily when it comes to the low-level <Router> API
* where both the location and a navigator must be provided separately in order
* to avoid "tearing" that may occur in a suspense-enabled app if the action
* and/or location were to be read directly from the history instance.
*/
const NavigationContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);
if (true) {
NavigationContext.displayName = "Navigation";
}
const LocationContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);
if (true) {
LocationContext.displayName = "Location";
}
const RouteContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({
outlet: null,
matches: []
});
if (true) {
RouteContext.displayName = "Route";
} ///////////////////////////////////////////////////////////////////////////////
// COMPONENTS
///////////////////////////////////////////////////////////////////////////////
/**
* A <Router> that stores all entries in memory.
*
* @see https://reactrouter.com/docs/en/v6/api#memoryrouter
*/
function MemoryRouter(_ref) {
let {
basename,
children,
initialEntries,
initialIndex
} = _ref;
let historyRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
if (historyRef.current == null) {
historyRef.current = (0,history__WEBPACK_IMPORTED_MODULE_1__.createMemoryHistory)({
initialEntries,
initialIndex
});
}
let history = historyRef.current;
let [state, setState] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({
action: history.action,
location: history.location
});
(0,react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect)(() => history.listen(setState), [history]);
return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(Router, {
basename: basename,
children: children,
location: state.location,
navigationType: state.action,
navigator: history
});
}
/**
* Changes the current location.
*
* Note: This API is mostly useful in React.Component subclasses that are not
* able to use hooks. In functional components, we recommend you use the
* `useNavigate` hook instead.
*
* @see https://reactrouter.com/docs/en/v6/api#navigate
*/
function Navigate(_ref2) {
let {
to,
replace,
state
} = _ref2;
!useInRouterContext() ? true ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of
// the router loaded. We can help them understand how to avoid that.
"<Navigate> may be used only in the context of a <Router> component.") : 0 : void 0;
true ? warning(!(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(NavigationContext).static, "<Navigate> must not be used on the initial render in a <StaticRouter>. " + "This is a no-op, but you should modify your code so the <Navigate> is " + "only ever rendered in response to some user interaction or state change.") : 0;
let navigate = useNavigate();
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
navigate(to, {
replace,
state
});
});
return null;
}
/**
* Renders the child route's element, if there is one.
*
* @see https://reactrouter.com/docs/en/v6/api#outlet
*/
function Outlet(props) {
return useOutlet(props.context);
}
/**
* Declares an element that should be rendered at a certain URL path.
*
* @see https://reactrouter.com/docs/en/v6/api#route
*/
function Route(_props) {
true ? invariant(false, "A <Route> is only ever to be used as the child of <Routes> element, " + "never rendered directly. Please wrap your <Route> in a <Routes>.") : 0 ;
}
/**
* Provides location context for the rest of the app.
*
* Note: You usually won't render a <Router> directly. Instead, you'll render a
* router that is more specific to your environment such as a <BrowserRouter>
* in web browsers or a <StaticRouter> for server rendering.
*
* @see https://reactrouter.com/docs/en/v6/api#router
*/
function Router(_ref3) {
let {
basename: basenameProp = "/",
children = null,
location: locationProp,
navigationType = history__WEBPACK_IMPORTED_MODULE_1__.Action.Pop,
navigator,
static: staticProp = false
} = _ref3;
!!useInRouterContext() ? true ? invariant(false, "You cannot render a <Router> inside another <Router>." + " You should never have more than one in your app.") : 0 : void 0;
let basename = normalizePathname(basenameProp);
let navigationContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({
basename,
navigator,
static: staticProp
}), [basename, navigator, staticProp]);
if (typeof locationProp === "string") {
locationProp = (0,history__WEBPACK_IMPORTED_MODULE_1__.parsePath)(locationProp);
}
let {
pathname = "/",
search = "",
hash = "",
state = null,
key = "default"
} = locationProp;
let location = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
let trailingPathname = stripBasename(pathname, basename);
if (trailingPathname == null) {
return null;
}
return {
pathname: trailingPathname,
search,
hash,
state,
key
};
}, [basename, pathname, search, hash, state, key]);
true ? warning(location != null, "<Router basename=\"" + basename + "\"> is not able to match the URL " + ("\"" + pathname + search + hash + "\" because it does not start with the ") + "basename, so the <Router> won't render anything.") : 0;
if (location == null) {
return null;
}
return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(NavigationContext.Provider, {
value: navigationContext
}, /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(LocationContext.Provider, {
children: children,
value: {
location,
navigationType
}
}));
}
/**
* A container for a nested tree of <Route> elements that renders the branch
* that best matches the current location.
*
* @see https://reactrouter.com/docs/en/v6/api#routes
*/
function Routes(_ref4) {
let {
children,
location
} = _ref4;
return useRoutes(createRoutesFromChildren(children), location);
} ///////////////////////////////////////////////////////////////////////////////
// HOOKS
///////////////////////////////////////////////////////////////////////////////
/**
* Returns the full href for the given "to" value. This is useful for building
* custom links that are also accessible and preserve right-click behavior.
*
* @see https://reactrouter.com/docs/en/v6/api#usehref
*/
function useHref(to) {
!useInRouterContext() ? true ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the
// router loaded. We can help them understand how to avoid that.
"useHref() may be used only in the context of a <Router> component.") : 0 : void 0;
let {
basename,
navigator
} = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(NavigationContext);
let {
hash,
pathname,
search
} = useResolvedPath(to);
let joinedPathname = pathname;
if (basename !== "/") {
let toPathname = getToPathname(to);
let endsWithSlash = toPathname != null && toPathname.endsWith("/");
joinedPathname = pathname === "/" ? basename + (endsWithSlash ? "/" : "") : joinPaths([basename, pathname]);
}
return navigator.createHref({
pathname: joinedPathname,
search,
hash
});
}
/**
* Returns true if this component is a descendant of a <Router>.
*
* @see https://reactrouter.com/docs/en/v6/api#useinroutercontext
*/
function useInRouterContext() {
return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(LocationContext) != null;
}
/**
* Returns the current location object, which represents the current URL in web
* browsers.
*
* Note: If you're using this it may mean you're doing some of your own
* "routing" in your app, and we'd like to know what your use case is. We may
* be able to provide something higher-level to better suit your needs.
*
* @see https://reactrouter.com/docs/en/v6/api#uselocation
*/
function useLocation() {
!useInRouterContext() ? true ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the
// router loaded. We can help them understand how to avoid that.
"useLocation() may be used only in the context of a <Router> component.") : 0 : void 0;
return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(LocationContext).location;
}
/**
* Returns the current navigation action which describes how the router came to
* the current location, either by a pop, push, or replace on the history stack.
*
* @see https://reactrouter.com/docs/en/v6/api#usenavigationtype
*/
function useNavigationType() {
return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(LocationContext).navigationType;
}
/**
* Returns true if the URL for the given "to" value matches the current URL.
* This is useful for components that need to know "active" state, e.g.
* <NavLink>.
*
* @see https://reactrouter.com/docs/en/v6/api#usematch
*/
function useMatch(pattern) {
!useInRouterContext() ? true ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the
// router loaded. We can help them understand how to avoid that.
"useMatch() may be used only in the context of a <Router> component.") : 0 : void 0;
let {
pathname
} = useLocation();
return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => matchPath(pattern, pathname), [pathname, pattern]);
}
/**
* The interface for the navigate() function returned from useNavigate().
*/
/**
* Returns an imperative method for changing the location. Used by <Link>s, but
* may also be used by other elements to change the location.
*
* @see https://reactrouter.com/docs/en/v6/api#usenavigate
*/
function useNavigate() {
!useInRouterContext() ? true ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the
// router loaded. We can help them understand how to avoid that.
"useNavigate() may be used only in the context of a <Router> component.") : 0 : void 0;
let {
basename,
navigator
} = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(NavigationContext);
let {
matches
} = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(RouteContext);
let {
pathname: locationPathname
} = useLocation();
let routePathnamesJson = JSON.stringify(matches.map(match => match.pathnameBase));
let activeRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
activeRef.current = true;
});
let navigate = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (to, options) {
if (options === void 0) {
options = {};
}
true ? warning(activeRef.current, "You should call navigate() in a React.useEffect(), not when " + "your component is first rendered.") : 0;
if (!activeRef.current) return;
if (typeof to === "number") {
navigator.go(to);
return;
}
let path = resolveTo(to, JSON.parse(routePathnamesJson), locationPathname);
if (basename !== "/") {
path.pathname = joinPaths([basename, path.pathname]);
}
(!!options.replace ? navigator.replace : navigator.push)(path, options.state);
}, [basename, navigator, routePathnamesJson, locationPathname]);
return navigate;
}
const OutletContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);
/**
* Returns the context (if provided) for the child route at this level of the route
* hierarchy.
* @see https://reactrouter.com/docs/en/v6/api#useoutletcontext
*/
function useOutletContext() {
return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(OutletContext);
}
/**
* Returns the element for the child route at this level of the route
* hierarchy. Used internally by <Outlet> to render child routes.
*
* @see https://reactrouter.com/docs/en/v6/api#useoutlet
*/
function useOutlet(context) {
let outlet = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(RouteContext).outlet;
if (outlet) {
return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(OutletContext.Provider, {
value: context
}, outlet);
}
return outlet;
}
/**
* Returns an object of key/value pairs of the dynamic params from the current
* URL that were matched by the route path.
*
* @see https://reactrouter.com/docs/en/v6/api#useparams
*/
function useParams() {
let {
matches
} = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(RouteContext);
let routeMatch = matches[matches.length - 1];
return routeMatch ? routeMatch.params : {};
}
/**
* Resolves the pathname of the given `to` value against the current location.
*
* @see https://reactrouter.com/docs/en/v6/api#useresolvedpath
*/
function useResolvedPath(to) {
let {
matches
} = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(RouteContext);
let {
pathname: locationPathname
} = useLocation();
let routePathnamesJson = JSON.stringify(matches.map(match => match.pathnameBase));
return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => resolveTo(to, JSON.parse(routePathnamesJson), locationPathname), [to, routePathnamesJson, locationPathname]);
}
/**
* Returns the element of the route that matched the current location, prepared
* with the correct context to render the remainder of the route tree. Route
* elements in the tree must render an <Outlet> to render their child route's
* element.
*
* @see https://reactrouter.com/docs/en/v6/api#useroutes
*/
function useRoutes(routes, locationArg) {
!useInRouterContext() ? true ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the
// router loaded. We can help them understand how to avoid that.
"useRoutes() may be used only in the context of a <Router> component.") : 0 : void 0;
let {
matches: parentMatches
} = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(RouteContext);
let routeMatch = parentMatches[parentMatches.length - 1];
let parentParams = routeMatch ? routeMatch.params : {};
let parentPathname = routeMatch ? routeMatch.pathname : "/";
let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : "/";
let parentRoute = routeMatch && routeMatch.route;
if (true) {
// You won't get a warning about 2 different <Routes> under a <Route>
// without a trailing *, but this is a best-effort warning anyway since we
// cannot even give the warning unless they land at the parent route.
//
// Example:
//
// <Routes>
// {/* This route path MUST end with /* because otherwise
// it will never match /blog/post/123 */}
// <Route path="blog" element={<Blog />} />
// <Route path="blog/feed" element={<BlogFeed />} />
// </Routes>
//
// function Blog() {
// return (
// <Routes>
// <Route path="post/:id" element={<Post />} />
// </Routes>
// );
// }
let parentPath = parentRoute && parentRoute.path || "";
warningOnce(parentPathname, !parentRoute || parentPath.endsWith("*"), "You rendered descendant <Routes> (or called `useRoutes()`) at " + ("\"" + parentPathname + "\" (under <Route path=\"" + parentPath + "\">) but the ") + "parent route path has no trailing \"*\". This means if you navigate " + "deeper, the parent won't match anymore and therefore the child " + "routes will never render.\n\n" + ("Please change the parent <Route path=\"" + parentPath + "\"> to <Route ") + ("path=\"" + (parentPath === "/" ? "*" : parentPath + "/*") + "\">."));
}
let locationFromContext = useLocation();
let location;
if (locationArg) {
var _parsedLocationArg$pa;
let parsedLocationArg = typeof locationArg === "string" ? (0,history__WEBPACK_IMPORTED_MODULE_1__.parsePath)(locationArg) : locationArg;
!(parentPathnameBase === "/" || ((_parsedLocationArg$pa = parsedLocationArg.pathname) == null ? void 0 : _parsedLocationArg$pa.startsWith(parentPathnameBase))) ? true ? invariant(false, "When overriding the location using `<Routes location>` or `useRoutes(routes, location)`, " + "the location pathname must begin with the portion of the URL pathname that was " + ("matched by all parent routes. The current pathname base is \"" + parentPathnameBase + "\" ") + ("but pathname \"" + parsedLocationArg.pathname + "\" was given in the `location` prop.")) : 0 : void 0;
location = parsedLocationArg;
} else {
location = locationFromContext;
}
let pathname = location.pathname || "/";
let remainingPathname = parentPathnameBase === "/" ? pathname : pathname.slice(parentPathnameBase.length) || "/";
let matches = matchRoutes(routes, {
pathname: remainingPathname
});
if (true) {
true ? warning(parentRoute || matches != null, "No routes matched location \"" + location.pathname + location.search + location.hash + "\" ") : 0;
true ? warning(matches == null || matches[matches.length - 1].route.element !== undefined, "Matched leaf route at location \"" + location.pathname + location.search + location.hash + "\" does not have an element. " + "This means it will render an <Outlet /> with a null value by default resulting in an \"empty\" page.") : 0;
}
return _renderMatches(matches && matches.map(match => Object.assign({}, match, {
params: Object.assign({}, parentParams, match.params),
pathname: joinPaths([parentPathnameBase, match.pathname]),
pathnameBase: match.pathnameBase === "/" ? parentPathnameBase : joinPaths([parentPathnameBase, match.pathnameBase])
})), parentMatches);
} ///////////////////////////////////////////////////////////////////////////////
// UTILS
///////////////////////////////////////////////////////////////////////////////
/**
* Creates a route config from a React "children" object, which is usually
* either a `<Route>` element or an array of them. Used internally by
* `<Routes>` to create a route config from its children.
*
* @see https://reactrouter.com/docs/en/v6/api#createroutesfromchildren
*/
function createRoutesFromChildren(children) {
let routes = [];
react__WEBPACK_IMPORTED_MODULE_0__.Children.forEach(children, element => {
if (! /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.isValidElement)(element)) {
// Ignore non-elements. This allows people to more easily inline
// conditionals in their route config.
return;
}
if (element.type === react__WEBPACK_IMPORTED_MODULE_0__.Fragment) {
// Transparently support React.Fragment and its children.
routes.push.apply(routes, createRoutesFromChildren(element.props.children));
return;
}
!(element.type === Route) ? true ? invariant(false, "[" + (typeof element.type === "string" ? element.type : element.type.name) + "] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>") : 0 : void 0;
let route = {
caseSensitive: element.props.caseSensitive,
element: element.props.element,
index: element.props.index,
path: element.props.path
};
if (element.props.children) {
route.children = createRoutesFromChildren(element.props.children);
}
routes.push(route);
});
return routes;
}
/**
* The parameters that were parsed from the URL path.
*/
/**
* Returns a path with params interpolated.
*
* @see https://reactrouter.com/docs/en/v6/api#generatepath
*/
function generatePath(path, params) {
if (params === void 0) {
params = {};
}
return path.replace(/:(\w+)/g, (_, key) => {
!(params[key] != null) ? true ? invariant(false, "Missing \":" + key + "\" param") : 0 : void 0;
return params[key];
}).replace(/\/*\*$/, _ => params["*"] == null ? "" : params["*"].replace(/^\/*/, "/"));
}
/**
* A RouteMatch contains info about how a route matched a URL.
*/
/**
* Matches the given routes to a location and returns the match data.
*
* @see https://reactrouter.com/docs/en/v6/api#matchroutes
*/
function matchRoutes(routes, locationArg, basename) {
if (basename === void 0) {
basename = "/";
}
let location = typeof locationArg === "string" ? (0,history__WEBPACK_IMPORTED_MODULE_1__.parsePath)(locationArg) : locationArg;
let pathname = stripBasename(location.pathname || "/", basename);
if (pathname == null) {
return null;
}
let branches = flattenRoutes(routes);
rankRouteBranches(branches);
let matches = null;
for (let i = 0; matches == null && i < branches.length; ++i) {
matches = matchRouteBranch(branches[i], pathname);
}
return matches;
}
function flattenRoutes(routes, branches, parentsMeta, parentPath) {
if (branches === void 0) {
branches = [];
}
if (parentsMeta === void 0) {
parentsMeta = [];
}
if (parentPath === void 0) {
parentPath = "";
}
routes.forEach((route, index) => {
let meta = {
relativePath: route.path || "",
caseSensitive: route.caseSensitive === true,
childrenIndex: index,
route
};
if (meta.relativePath.startsWith("/")) {
!meta.relativePath.startsWith(parentPath) ? true ? invariant(false, "Absolute route path \"" + meta.relativePath + "\" nested under path " + ("\"" + parentPath + "\" is not valid. An absolute child route path ") + "must start with the combined path of all its parent routes.") : 0 : void 0;
meta.relativePath = meta.relativePath.slice(parentPath.length);
}
let path = joinPaths([parentPath, meta.relativePath]);
let routesMeta = parentsMeta.concat(meta); // Add the children before adding this route to the array so we traverse the
// route tree depth-first and child routes appear before their parents in
// the "flattened" version.
if (route.children && route.children.length > 0) {
!(route.index !== true) ? true ? invariant(false, "Index routes must not have child routes. Please remove " + ("all child routes from route path \"" + path + "\".")) : 0 : void 0;
flattenRoutes(route.children, branches, routesMeta, path);
} // Routes without a path shouldn't ever match by themselves unless they are
// index routes, so don't add them to the list of possible branches.
if (route.path == null && !route.index) {
return;
}
branches.push({
path,
score: computeScore(path, route.index),
routesMeta
});
});
return branches;
}
function rankRouteBranches(branches) {
branches.sort((a, b) => a.score !== b.score ? b.score - a.score // Higher score first
: compareIndexes(a.routesMeta.map(meta => meta.childrenIndex), b.routesMeta.map(meta => meta.childrenIndex)));
}
const paramRe = /^:\w+$/;
const dynamicSegmentValue = 3;
const indexRouteValue = 2;
const emptySegmentValue = 1;
const staticSegmentValue = 10;
const splatPenalty = -2;
const isSplat = s => s === "*";
function computeScore(path, index) {
let segments = path.split("/");
let initialScore = segments.length;
if (segments.some(isSplat)) {
initialScore += splatPenalty;
}
if (index) {
initialScore += indexRouteValue;
}
return segments.filter(s => !isSplat(s)).reduce((score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : segment === "" ? emptySegmentValue : staticSegmentValue), initialScore);
}
function compareIndexes(a, b) {
let siblings = a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]);
return siblings ? // If two routes are siblings, we should try to match the earlier sibling
// first. This allows people to have fine-grained control over the matching
// behavior by simply putting routes with identical paths in the order they
// want them tried.
a[a.length - 1] - b[b.length - 1] : // Otherwise, it doesn't really make sense to rank non-siblings by index,
// so they sort equally.
0;
}
function matchRouteBranch(branch, pathname) {
let {
routesMeta
} = branch;
let matchedParams = {};
let matchedPathname = "/";
let matches = [];
for (let i = 0; i < routesMeta.length; ++i) {
let meta = routesMeta[i];
let end = i === routesMeta.length - 1;
let remainingPathname = matchedPathname === "/" ? pathname : pathname.slice(matchedPathname.length) || "/";
let match = matchPath({
path: meta.relativePath,
caseSensitive: meta.caseSensitive,
end
}, remainingPathname);
if (!match) return null;
Object.assign(matchedParams, match.params);
let route = meta.route;
matches.push({
params: matchedParams,
pathname: joinPaths([matchedPathname, match.pathname]),
pathnameBase: joinPaths([matchedPathname, match.pathnameBase]),
route
});
if (match.pathnameBase !== "/") {
matchedPathname = joinPaths([matchedPathname, match.pathnameBase]);
}
}
return matches;
}
/**
* Renders the result of `matchRoutes()` into a React element.
*/
function renderMatches(matches) {
return _renderMatches(matches);
}
function _renderMatches(matches, parentMatches) {
if (parentMatches === void 0) {
parentMatches = [];
}
if (matches == null) return null;
return matches.reduceRight((outlet, match, index) => {
return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(RouteContext.Provider, {
children: match.route.element !== undefined ? match.route.element : /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(Outlet, null),
value: {
outlet,
matches: parentMatches.concat(matches.slice(0, index + 1))
}
});
}, null);
}
/**
* A PathPattern is used to match on some portion of a URL pathname.
*/
/**
* Performs pattern matching on a URL pathname and returns information about
* the match.
*
* @see https://reactrouter.com/docs/en/v6/api#matchpath
*/
function matchPath(pattern, pathname) {
if (typeof pattern === "string") {
pattern = {
path: pattern,
caseSensitive: false,
end: true
};
}
let [matcher, paramNames] = compilePath(pattern.path, pattern.caseSensitive, pattern.end);
let match = pathname.match(matcher);
if (!match) return null;
let matchedPathname = match[0];
let pathnameBase = matchedPathname.replace(/(.)\/+$/, "$1");
let captureGroups = match.slice(1);
let params = paramNames.reduce((memo, paramName, index) => {
// We need to compute the pathnameBase here using the raw splat value
// instead of using params["*"] later because it will be decoded then
if (paramName === "*") {
let splatValue = captureGroups[index] || "";
pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\/+$/, "$1");
}
memo[paramName] = safelyDecodeURIComponent(captureGroups[index] || "", paramName);
return memo;
}, {});
return {
params,
pathname: matchedPathname,
pathnameBase,
pattern
};
}
function compilePath(path, caseSensitive, end) {
if (caseSensitive === void 0) {
caseSensitive = false;
}
if (end === void 0) {
end = true;
}
true ? warning(path === "*" || !path.endsWith("*") || path.endsWith("/*"), "Route path \"" + path + "\" will be treated as if it were " + ("\"" + path.replace(/\*$/, "/*") + "\" because the `*` character must ") + "always follow a `/` in the pattern. To get rid of this warning, " + ("please change the route path to \"" + path.replace(/\*$/, "/*") + "\".")) : 0;
let paramNames = [];
let regexpSource = "^" + path.replace(/\/*\*?$/, "") // Ignore trailing / and /*, we'll handle it below
.replace(/^\/*/, "/") // Make sure it has a leading /
.replace(/[\\.*+^$?{}|()[\]]/g, "\\$&") // Escape special regex chars
.replace(/:(\w+)/g, (_, paramName) => {
paramNames.push(paramName);
return "([^\\/]+)";
});
if (path.endsWith("*")) {
paramNames.push("*");
regexpSource += path === "*" || path === "/*" ? "(.*)$" // Already matched the initial /, just match the rest
: "(?:\\/(.+)|\\/*)$"; // Don't include the / in params["*"]
} else {
regexpSource += end ? "\\/*$" // When matching to the end, ignore trailing slashes
: // Otherwise, match a word boundary or a proceeding /. The word boundary restricts
// parent routes to matching only their own words and nothing more, e.g. parent
// route "/home" should not match "/home2".
"(?:\\b|\\/|$)";
}
let matcher = new RegExp(regexpSource, caseSensitive ? undefined : "i");
return [matcher, paramNames];
}
function safelyDecodeURIComponent(value, paramName) {
try {
return decodeURIComponent(value);
} catch (error) {
true ? warning(false, "The value for the URL param \"" + paramName + "\" will not be decoded because" + (" the string \"" + value + "\" is a malformed URL segment. This is probably") + (" due to a bad percent encoding (" + error + ").")) : 0;
return value;
}
}
/**
* Returns a resolved path object relative to the given pathname.
*
* @see https://reactrouter.com/docs/en/v6/api#resolvepath
*/
function resolvePath(to, fromPathname) {
if (fromPathname === void 0) {
fromPathname = "/";
}
let {
pathname: toPathname,
search = "",
hash = ""
} = typeof to === "string" ? (0,history__WEBPACK_IMPORTED_MODULE_1__.parsePath)(to) : to;
let pathname = toPathname ? toPathname.startsWith("/") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname;
return {
pathname,
search: normalizeSearch(search),
hash: normalizeHash(hash)
};
}
function resolvePathname(relativePath, fromPathname) {
let segments = fromPathname.replace(/\/+$/, "").split("/");
let relativeSegments = relativePath.split("/");
relativeSegments.forEach(segment => {
if (segment === "..") {
// Keep the root "" segment so the pathname starts at /
if (segments.length > 1) segments.pop();
} else if (segment !== ".") {
segments.push(segment);
}
});
return segments.length > 1 ? segments.join("/") : "/";
}
function resolveTo(toArg, routePathnames, locationPathname) {
let to = typeof toArg === "string" ? (0,history__WEBPACK_IMPORTED_MODULE_1__.parsePath)(toArg) : toArg;
let toPathname = toArg === "" || to.pathname === "" ? "/" : to.pathname; // If a pathname is explicitly provided in `to`, it should be relative to the
// route context. This is explained in `Note on `<Link to>` values` in our
// migration guide from v5 as a means of disambiguation between `to` values
// that begin with `/` and those that do not. However, this is problematic for
// `to` values that do not provide a pathname. `to` can simply be a search or
// hash string, in which case we should assume that the navigation is relative
// to the current location's pathname and *not* the route pathname.
let from;
if (toPathname == null) {
from = locationPathname;
} else {
let routePathnameIndex = routePathnames.length - 1;
if (toPathname.startsWith("..")) {
let toSegments = toPathname.split("/"); // Each leading .. segment means "go up one route" instead of "go up one
// URL segment". This is a key difference from how <a href> works and a
// major reason we call this a "to" value instead of a "href".
while (toSegments[0] === "..") {
toSegments.shift();
routePathnameIndex -= 1;
}
to.pathname = toSegments.join("/");
} // If there are more ".." segments than parent routes, resolve relative to
// the root / URL.
from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/";
}
let path = resolvePath(to, from); // Ensure the pathname has a trailing slash if the original to value had one.
if (toPathname && toPathname !== "/" && toPathname.endsWith("/") && !path.pathname.endsWith("/")) {
path.pathname += "/";
}
return path;
}
function getToPathname(to) {
// Empty strings should be treated the same as / paths
return to === "" || to.pathname === "" ? "/" : typeof to === "string" ? (0,history__WEBPACK_IMPORTED_MODULE_1__.parsePath)(to).pathname : to.pathname;
}
function stripBasename(pathname, basename) {
if (basename === "/") return pathname;
if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {
return null;
}
let nextChar = pathname.charAt(basename.length);
if (nextChar && nextChar !== "/") {
// pathname does not start with basename/
return null;
}
return pathname.slice(basename.length) || "/";
}
const joinPaths = paths => paths.join("/").replace(/\/\/+/g, "/");
const normalizePathname = pathname => pathname.replace(/\/+$/, "").replace(/^\/*/, "/");
const normalizeSearch = search => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search;
const normalizeHash = hash => !hash || hash === "#" ? "" : hash.startsWith("#") ? hash : "#" + hash; ///////////////////////////////////////////////////////////////////////////////
//# sourceMappingURL=index.js.map
/***/ }),
/***/ "react":
/*!************************!*\
!*** external "React" ***!
\************************/
/***/ (function(module) {
module.exports = window["React"];
/***/ }),
/***/ "react-dom":
/*!***************************!*\
!*** external "ReactDOM" ***!
\***************************/
/***/ (function(module) {
module.exports = window["ReactDOM"];
/***/ }),
/***/ "@wordpress/api-fetch":
/*!**********************************!*\
!*** external ["wp","apiFetch"] ***!
\**********************************/
/***/ (function(module) {
module.exports = window["wp"]["apiFetch"];
/***/ }),
/***/ "@wordpress/element":
/*!*********************************!*\
!*** external ["wp","element"] ***!
\*********************************/
/***/ (function(module) {
module.exports = window["wp"]["element"];
/***/ }),
/***/ "@wordpress/i18n":
/*!******************************!*\
!*** external ["wp","i18n"] ***!
\******************************/
/***/ (function(module) {
module.exports = window["wp"]["i18n"];
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/extends.js":
/*!************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/extends.js ***!
\************************************************************/
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": function() { return /* binding */ _extends; }
/* harmony export */ });
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);
}
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ !function() {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function() { return module['default']; } :
/******/ function() { return module; };
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ }();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ !function() {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = function(exports, definition) {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ }();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ !function() {
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ }();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ !function() {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ }();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
!function() {
/*!***************************!*\
!*** ./wizard/src/App.js ***!
\***************************/
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ "react-dom");
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router-dom/index.js");
/* harmony import */ var _Admin_App_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @Admin/App.scss */ "./wizard/src/App.scss");
/* harmony import */ var _Admin_Settings__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @Admin/Settings */ "./wizard/src/Settings.js");
/* Main Compnent */
react_dom__WEBPACK_IMPORTED_MODULE_2___default().render((0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(react_router_dom__WEBPACK_IMPORTED_MODULE_5__.BrowserRouter, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_Settings__WEBPACK_IMPORTED_MODULE_4__["default"], null)), document.getElementById('cpsw-onboarding-content'));
}();
/******/ })()
;
//# sourceMappingURL=app.js.map