Server IP : 162.0.217.223 / Your IP : 216.73.216.168 Web Server : LiteSpeed System : Linux premium269.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : mypckeys ( 1539) PHP Version : 8.1.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/mypckeys/backup/msckey.com/wp-content/plugins/woo-wallet/build/partial-payment/ |
Upload File : |
/******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ({ /***/ "./src/partial-payment/index.js": /*!**************************************!*\ !*** ./src/partial-payment/index.js ***! \**************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* 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 _wordpress_plugins__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/plugins */ "@wordpress/plugins"); /* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_plugins__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _woocommerce_blocks_checkout__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/blocks-checkout */ "@woocommerce/blocks-checkout"); /* harmony import */ var _woocommerce_blocks_checkout__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_blocks_checkout__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/settings */ "@woocommerce/settings"); /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_settings__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities"); /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @woocommerce/blocks-components */ "@woocommerce/blocks-components"); /* harmony import */ var _woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./style.scss */ "./src/partial-payment/style.scss"); /** * External dependencies */ /** * Internal dependencies */ const { extensionCartUpdate } = window.wc.blocksCheckout; const settings = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_3__.getSetting)('partial-payment_data'); const render = () => { const [partialPaymentAmount, setPartialPaymentAmount] = settings.partial_payment_amount ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useState)(settings.partial_payment_amount) : (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useState)(''); const [showSpinner, setShowSpinner] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useState)(false); const textInputId = `wc-block-components-partial-payment_input`; const buttonClickHandler = e => { e.preventDefault(); setShowSpinner(true); extensionCartUpdate({ namespace: 'apply-partial-payment', data: { 'amount': partialPaymentAmount } }).then(() => { setShowSpinner(false); }); }; const formatedBalance = () => { const { balance, currency_symbol, decimal_separator, thousand_separator, decimals } = settings; // Ensure that 'amount' is a valid number let numericAmount = parseFloat(balance); if (isNaN(numericAmount)) { return amount; // Return the original value if it's not a valid number } // Format the amount to the required number of decimal places let fixedAmount = numericAmount.toFixed(decimals); // Split the integer and decimal parts let parts = fixedAmount.split('.'); // Add thousand separator to the integer part only parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, thousand_separator); // Rejoin integer and decimal parts with the correct decimal separator let formattedAmount = parts.join(decimal_separator); return (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5__.decodeEntities)(`${currency_symbol}${formattedAmount}`); }; return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_blocks_checkout__WEBPACK_IMPORTED_MODULE_2__.ExperimentalDiscountsMeta, null, settings.active ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_7__.Panel, { className: "wc-block-components-partial-payment-panel", initialOpen: false, hasBorder: false, title: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { className: "wc-block-components-partial-payment-panel__button-text" }, /* translators: 1: Wallet amount */(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.sprintf)((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('You have %s in your wallet to spend!', 'woo-wallet'), formatedBalance())) }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)("Enter the amount you'd like to redeem", "woo-wallet")), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { class: "wc-block-components-partial-payment" }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("form", { className: "wc-block-components-partial-payment_form", id: "wc-block-components-partial-payment_form" }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_7__.ValidatedTextInput, { id: textInputId, errorId: "coupon", className: "wc-block-components-partial-payment_input", label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Enter amount', 'woo-wallet'), value: partialPaymentAmount, onChange: newPartialPaymentAmount => { setPartialPaymentAmount(newPartialPaymentAmount); }, focusOnMount: false, validateOnMount: false, showError: false }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_7__.Button, { className: "wc-block-components-partial-payment_button", disabled: !partialPaymentAmount, showSpinner: showSpinner, type: "submit", onClick: buttonClickHandler }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Apply', 'woo-wallet'))))) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null)); }; (0,_wordpress_plugins__WEBPACK_IMPORTED_MODULE_1__.registerPlugin)('partial-payment-block', { render, scope: 'woocommerce-checkout' }); /***/ }), /***/ "./src/partial-payment/style.scss": /*!****************************************!*\ !*** ./src/partial-payment/style.scss ***! \****************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin /***/ }), /***/ "react": /*!************************!*\ !*** external "React" ***! \************************/ /***/ ((module) => { module.exports = window["React"]; /***/ }), /***/ "@woocommerce/blocks-checkout": /*!****************************************!*\ !*** external ["wc","blocksCheckout"] ***! \****************************************/ /***/ ((module) => { module.exports = window["wc"]["blocksCheckout"]; /***/ }), /***/ "@woocommerce/blocks-components": /*!******************************************!*\ !*** external ["wc","blocksComponents"] ***! \******************************************/ /***/ ((module) => { module.exports = window["wc"]["blocksComponents"]; /***/ }), /***/ "@woocommerce/settings": /*!************************************!*\ !*** external ["wc","wcSettings"] ***! \************************************/ /***/ ((module) => { module.exports = window["wc"]["wcSettings"]; /***/ }), /***/ "@wordpress/element": /*!*********************************!*\ !*** external ["wp","element"] ***! \*********************************/ /***/ ((module) => { module.exports = window["wp"]["element"]; /***/ }), /***/ "@wordpress/html-entities": /*!**************************************!*\ !*** external ["wp","htmlEntities"] ***! \**************************************/ /***/ ((module) => { module.exports = window["wp"]["htmlEntities"]; /***/ }), /***/ "@wordpress/i18n": /*!******************************!*\ !*** external ["wp","i18n"] ***! \******************************/ /***/ ((module) => { module.exports = window["wp"]["i18n"]; /***/ }), /***/ "@wordpress/plugins": /*!*********************************!*\ !*** external ["wp","plugins"] ***! \*********************************/ /***/ ((module) => { module.exports = window["wp"]["plugins"]; /***/ }) /******/ }); /************************************************************************/ /******/ // 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; /******/ } /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = __webpack_modules__; /******/ /************************************************************************/ /******/ /* webpack/runtime/chunk loaded */ /******/ (() => { /******/ var deferred = []; /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { /******/ if(chunkIds) { /******/ priority = priority || 0; /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; /******/ deferred[i] = [chunkIds, fn, priority]; /******/ return; /******/ } /******/ var notFulfilled = Infinity; /******/ for (var i = 0; i < deferred.length; i++) { /******/ var [chunkIds, fn, priority] = deferred[i]; /******/ var fulfilled = true; /******/ for (var j = 0; j < chunkIds.length; j++) { /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { /******/ chunkIds.splice(j--, 1); /******/ } else { /******/ fulfilled = false; /******/ if(priority < notFulfilled) notFulfilled = priority; /******/ } /******/ } /******/ if(fulfilled) { /******/ deferred.splice(i--, 1) /******/ var r = fn(); /******/ if (r !== undefined) result = r; /******/ } /******/ } /******/ return result; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (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 */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/jsonp chunk loading */ /******/ (() => { /******/ // no baseURI /******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ "partial-payment/index": 0, /******/ "partial-payment/style-index": 0 /******/ }; /******/ /******/ // no chunk on demand loading /******/ /******/ // no prefetching /******/ /******/ // no preloaded /******/ /******/ // no HMR /******/ /******/ // no HMR manifest /******/ /******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); /******/ /******/ // install a JSONP callback for chunk loading /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { /******/ var [chunkIds, moreModules, runtime] = data; /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i = 0; /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { /******/ for(moduleId in moreModules) { /******/ if(__webpack_require__.o(moreModules, moduleId)) { /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; /******/ } /******/ } /******/ if(runtime) var result = runtime(__webpack_require__); /******/ } /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); /******/ for(;i < chunkIds.length; i++) { /******/ chunkId = chunkIds[i]; /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { /******/ installedChunks[chunkId][0](); /******/ } /******/ installedChunks[chunkId] = 0; /******/ } /******/ return __webpack_require__.O(result); /******/ } /******/ /******/ var chunkLoadingGlobal = globalThis["webpackChunkwoo_wallet"] = globalThis["webpackChunkwoo_wallet"] || []; /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); /******/ })(); /******/ /************************************************************************/ /******/ /******/ // startup /******/ // Load entry module and return exports /******/ // This entry module depends on other loaded chunks and execution need to be delayed /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["partial-payment/style-index"], () => (__webpack_require__("./src/partial-payment/index.js"))) /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); /******/ /******/ })() ; //# sourceMappingURL=index.js.map