Changeset 3273743
- Timestamp:
- 04/15/2025 04:06:46 PM (12 months ago)
- Location:
- dhlpwc
- Files:
-
- 22 edited
- 1 copied
-
tags/2.1.12 (copied) (copied from dhlpwc/trunk)
-
tags/2.1.12/README.md (modified) (1 diff)
-
tags/2.1.12/build/index.asset.php (modified) (1 diff)
-
tags/2.1.12/build/index.js (modified) (5 diffs)
-
tags/2.1.12/build/index.js.map (modified) (1 diff)
-
tags/2.1.12/build/view.asset.php (modified) (1 diff)
-
tags/2.1.12/build/view.js (modified) (20 diffs)
-
tags/2.1.12/build/view.js.map (modified) (1 diff)
-
tags/2.1.12/dhlpwoocommerce.php (modified) (2 diffs)
-
tags/2.1.12/includes/model/service/class-dhlpwc-model-service-debug.php (modified) (1 diff)
-
tags/2.1.12/includes/model/service/class-dhlpwc-model-service-shipment.php (modified) (1 diff)
-
tags/2.1.12/readme.txt (modified) (2 diffs)
-
trunk/README.md (modified) (1 diff)
-
trunk/build/index.asset.php (modified) (1 diff)
-
trunk/build/index.js (modified) (5 diffs)
-
trunk/build/index.js.map (modified) (1 diff)
-
trunk/build/view.asset.php (modified) (1 diff)
-
trunk/build/view.js (modified) (20 diffs)
-
trunk/build/view.js.map (modified) (1 diff)
-
trunk/dhlpwoocommerce.php (modified) (2 diffs)
-
trunk/includes/model/service/class-dhlpwc-model-service-debug.php (modified) (1 diff)
-
trunk/includes/model/service/class-dhlpwc-model-service-shipment.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dhlpwc/tags/2.1.12/README.md
r3255370 r3273743 1 1 # DHL eCommerce (Benelux) for WooCommerce 2 3 v2.1.12 4 ## Changes 5 - Added a last name check for label creation 6 - Fixed an incompatibility issue provisionally for WooCommerce 9.8.0 and higher 7 - Known issue: ServicePoint Locator and delivery timeframes are not loaded properly for WooCommerce 9.8.0 and higher 2 8 3 9 v2.1.11 -
dhlpwc/tags/2.1.12/build/index.asset.php
r3073094 r3273743 1 <?php return array('dependencies' => array('react ', 'wp-blocks'), 'version' => '7653790f168fdf85c9a4');1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-blocks'), 'version' => '86436dc6f37fa7cc3f24'); -
dhlpwc/tags/2.1.12/build/index.js
r3073094 r3273743 2 2 /******/ "use strict"; 3 3 /******/ var __webpack_modules__ = ({ 4 5 /***/ "./src/block.json": 6 /*!************************!*\ 7 !*** ./src/block.json ***! 8 \************************/ 9 /***/ ((module) => { 10 11 module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"dhlpwc/dhlpwc-block","version":"0.1.0","title":"DHL Shipping Methods block","category":"widgets","description":"Displays extra options for the DHL Shipping Methods like parcelshops and timeframes.","example":{},"textdomain":"dhlpwc-block","editorScript":"file:./index.js","render":"file:./render.php","viewScript":"file:./view.js","parent":["woocommerce/checkout-shipping-methods-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}}}'); 12 13 /***/ }), 4 14 5 15 /***/ "./src/edit.js": … … 13 23 /* harmony export */ "default": () => (/* binding */ Edit) 14 24 /* harmony export */ }); 15 /* harmony import */ var react_ _WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");16 /* harmony import */ var react_ _WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);25 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); 26 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); 17 27 18 28 /** … … 20 30 */ 21 31 function Edit() { 22 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, "[DHL eCommerce ServicePoints]"); 32 return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { 33 children: "[DHL eCommerce ServicePoints]" 34 }); 23 35 } 24 25 /***/ }),26 27 /***/ "react":28 /*!************************!*\29 !*** external "React" ***!30 \************************/31 /***/ ((module) => {32 33 module.exports = window["React"];34 36 35 37 /***/ }), … … 45 47 /***/ }), 46 48 47 /***/ " ./src/block.json":48 /*!************************ !*\49 !*** ./src/block.json***!50 \************************ /49 /***/ "react/jsx-runtime": 50 /*!**********************************!*\ 51 !*** external "ReactJSXRuntime" ***! 52 \**********************************/ 51 53 /***/ ((module) => { 52 54 53 module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"dhlpwc/dhlpwc-block","version":"0.1.0","title":"DHL Shipping Methods block","category":"widgets","description":"Displays extra options for the DHL Shipping Methods like parcelshops and timeframes.","example":{},"textdomain":"dhlpwc-block","editorScript":"file:./index.js","render":"file:./render.php","viewScript":"file:./view.js","parent":["woocommerce/checkout-shipping-methods-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}}}');55 module.exports = window["ReactJSXRuntime"]; 54 56 55 57 /***/ }) … … 124 126 /************************************************************************/ 125 127 var __webpack_exports__ = {}; 126 // This entry need to be wrapped in an IIFE because it needto be isolated against other modules in the chunk.128 // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk. 127 129 (() => { 128 130 /*!**********************!*\ -
dhlpwc/tags/2.1.12/build/index.js.map
r3073094 r3273743 1 {"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;; AAAA;AACA;AACA;AACe,SAASA,IAAIA,CAAA,EAAG;EAC3B,OACIC,oDAAA,cAAK,+BAAkC,CAAC;AAEhD;;;;;;;;;;ACPA;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;ACLsD;AAClB;AACV;AAE1BC,oEAAiB,CAAEC,6CAAa,EAAE;EAC9BE,IAAI,EAAEL,6CAAIA;AACd,CAAE,CAAC,C","sources":["webpack://copyright-date-block/./src/edit.js","webpack://copyright-date-block/external window \"React\"","webpack://copyright-date-block/external window [\"wp\",\"blocks\"]","webpack://copyright-date-block/webpack/bootstrap","webpack://copyright-date-block/webpack/runtime/compat get default export","webpack://copyright-date-block/webpack/runtime/define property getters","webpack://copyright-date-block/webpack/runtime/hasOwnProperty shorthand","webpack://copyright-date-block/webpack/runtime/make namespace object","webpack://copyright-date-block/./src/index.js"],"sourcesContent":["/**\n * Used for the Wordpress Pagebuilder\n */\nexport default function Edit() {\n return (\n <div>[DHL eCommerce ServicePoints]</div>\n );\n}\n","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"blocks\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\nimport { registerBlockType } from '@wordpress/blocks';\nimport metadata from './block.json';\nimport Edit from './edit';\n\nregisterBlockType( metadata.name, {\n edit: Edit,\n} );\n"],"names":["Edit","createElement","registerBlockType","metadata","name","edit"],"sourceRoot":""}1 {"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACe,SAASA,IAAIA,CAAA,EAAG;EAC3B,oBACIC,sDAAA;IAAAC,QAAA,EAAK;EAA6B,CAAK,CAAC;AAEhD;;;;;;;;;;ACPA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;ACLsD;AAClB;AACV;AAE1BC,oEAAiB,CAAEC,6CAAa,EAAE;EAC9BE,IAAI,EAAEN,6CAAIA;AACd,CAAE,CAAC,C","sources":["webpack://copyright-date-block/./src/edit.js","webpack://copyright-date-block/external window [\"wp\",\"blocks\"]","webpack://copyright-date-block/external window \"ReactJSXRuntime\"","webpack://copyright-date-block/webpack/bootstrap","webpack://copyright-date-block/webpack/runtime/compat get default export","webpack://copyright-date-block/webpack/runtime/define property getters","webpack://copyright-date-block/webpack/runtime/hasOwnProperty shorthand","webpack://copyright-date-block/webpack/runtime/make namespace object","webpack://copyright-date-block/./src/index.js"],"sourcesContent":["/**\r\n * Used for the Wordpress Pagebuilder\r\n */\r\nexport default function Edit() {\r\n return (\r\n <div>[DHL eCommerce ServicePoints]</div>\r\n );\r\n}\r\n","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"ReactJSXRuntime\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\r\nimport { registerBlockType } from '@wordpress/blocks';\r\nimport metadata from './block.json';\r\nimport Edit from './edit';\r\n\r\nregisterBlockType( metadata.name, {\r\n edit: Edit,\r\n} );\r\n"],"names":["Edit","_jsx","children","registerBlockType","metadata","name","edit"],"sourceRoot":""} -
dhlpwc/tags/2.1.12/build/view.asset.php
r3160499 r3273743 1 <?php return array('dependencies' => array('react ', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => 'eeeebb5fff6cc243195d');1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => 'e537f87caf8f4a2f31bd'); -
dhlpwc/tags/2.1.12/build/view.js
r3160499 r3273743 13 13 /* harmony export */ DeliveryTimes: () => (/* binding */ DeliveryTimes) 14 14 /* harmony export */ }); 15 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");16 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);17 /* harmony import */ var _wordpress_ element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");18 /* harmony import */ var _wordpress_ element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);19 /* harmony import */ var _wordpress_ i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");20 /* harmony import */ var _wordpress_ i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);21 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");22 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__);15 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 16 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 17 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 18 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 19 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 20 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); 21 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); 22 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__); 23 23 24 24 … … 30 30 } 31 31 const deliveryTimeShippingMethods = ['dhlpwc-home', 'dhlpwc-home-evening', 'dhlpwc-home-next-day', 'dhlpwc-home-no-neighbour', 'dhlpwc-home-no-neighbour-evening', 'dhlpwc-home-no-neighbour-next-day']; 32 const [deliveryTimes, setDeliveryTimes] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 1__.useState)({});33 const [selectedTime, setSelectedTime] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 1__.useState)([]);34 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 1__.useEffect)(() => {32 const [deliveryTimes, setDeliveryTimes] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)({}); 33 const [selectedTime, setSelectedTime] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)([]); 34 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 35 35 const deliveryTimeDetails = document.getElementById('dhlpwc-shipping-method-delivery-times-option'); 36 if (deliveryTimeDetails === null) { 37 return; 38 } 36 39 if (deliveryTimeShippingMethods.indexOf(props.selectedShippingMethod) !== -1) { 37 40 deliveryTimeDetails.style.display = "block"; … … 57 60 setDeliveryTimes(parsedDeliveryTimes); 58 61 // initially set the first selection 59 setSelectedTime(parsedDeliveryTimes[0].value.split('___'));62 if (typeof parsedDeliveryTimes[0] !== "undefined") setSelectedTime(parsedDeliveryTimes[0].value.split('___')); 60 63 }); 61 64 } else { … … 64 67 } 65 68 }, [props.postalCode, props.countryCode, props.selectedShippingMethod]); 66 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 1__.useEffect)(() => {69 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 67 70 var _selectedTime$, _selectedTime$2, _selectedTime$3; 68 71 // Wordpress doesn't like it when we post raw data, so we post it as a form instead … … 78 81 }); 79 82 }, [selectedTime]); 80 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {83 return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", { 81 84 id: "dhlpwc-shipping-method-delivery-times-option", 82 className: "dhlpwc-shipping-method-delivery-times-option" 83 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { 84 className: "dhlpwc-delivery-times-selection-header" 85 }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('DHL Delivery Times options')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { 86 className: "dhlpwc-delivery-times-selection-text" 87 }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Desired delivery moment:')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.SelectControl, { 88 hideLabelFromVision: "true", 89 className: "dhlpwc-delivery-times-selection-input", 90 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Select desired delivery moment'), 91 value: selectedTime.join('___'), 92 options: deliveryTimes, 93 onChange: deliveryTime => setSelectedTime(deliveryTime.split('___')) 94 })); 85 className: "dhlpwc-shipping-method-delivery-times-option", 86 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", { 87 className: "dhlpwc-delivery-times-selection-header", 88 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('DHL Delivery Times options') 89 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", { 90 className: "dhlpwc-delivery-times-selection-text", 91 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Desired delivery moment:') 92 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.SelectControl, { 93 hideLabelFromVision: "true", 94 className: "dhlpwc-delivery-times-selection-input", 95 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Select desired delivery moment'), 96 value: selectedTime.join('___'), 97 options: deliveryTimes, 98 onChange: deliveryTime => setSelectedTime(deliveryTime.split('___')) 99 })] 100 }); 95 101 }; 96 102 … … 164 170 /* harmony export */ Servicepoints: () => (/* binding */ Servicepoints) 165 171 /* harmony export */ }); 166 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");167 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);168 /* harmony import */ var _wordpress_ element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");169 /* harmony import */ var _wordpress_ element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);170 /* harmony import */ var _wordpress_ i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");171 /* harmony import */ var _wordpress_ i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);172 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");173 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);172 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 173 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 174 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 175 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 176 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 177 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); 178 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); 179 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__); 174 180 175 181 … … 179 185 var _parcelshop$name; 180 186 const VALIDATION_ERROR_PARCELSHOP_EMPTY = 'validation-error-parcelshop-empty'; 181 const getValidationError = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_ 3__.useSelect)(select => {187 const getValidationError = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => { 182 188 const store = select('wc/store/validation'); 183 189 return store.getValidationError(VALIDATION_ERROR_PARCELSHOP_EMPTY); 184 190 }); 185 const [parcelshop, setParcelshop] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 1__.useState)({});191 const [parcelshop, setParcelshop] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)({}); 186 192 187 193 // Only run this once, intentionally no dependencies given 188 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 1__.useEffect)(() => {194 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 189 195 const script = document.createElement('script'); 190 196 script.src = 'https://static.dhlecommerce.nl/components/servicepoint-locator-component@latest/servicepoint-locator-component.js'; … … 209 215 } 210 216 }; 211 window.dhlparcel_shipping_servicepoint_locator = new dhl.servicepoint.Locator(document.getElementById('dhl-servicepoint-locator-component'), options); 217 const servicePointElement = document.getElementById('dhl-servicepoint-locator-component'); 218 if (servicePointElement === null) { 219 return; 220 } 221 window.dhlparcel_shipping_servicepoint_locator = new dhl.servicepoint.Locator(servicePointElement, options); 212 222 213 223 // Hide the parcelshop element when parcelshop is not selected 214 224 const parcelshopDetails = document.getElementById('dhlpwc-shipping-method-parcelshop-option'); 215 if (props.selectedShippingMethod === 'dhlpwc-parcelshop') { 216 parcelshopDetails.style.display = 'block'; 217 } else { 218 parcelshopDetails.style.display = 'none'; 225 if (parcelshopDetails !== null) { 226 if (props.selectedShippingMethod === 'dhlpwc-parcelshop') { 227 parcelshopDetails.style.display = 'block'; 228 } else { 229 parcelshopDetails.style.display = 'none'; 230 } 219 231 } 220 232 221 233 // Hide the modal when clicking the X button 222 document.getElementById('dhlpwc-modal-close').onclick = () => { 223 document.getElementById('dhlpwc-servicepoint-modal').style.display = 'none'; 224 }; 234 const modalCloseElement = document.getElementById('dhlpwc-modal-close'); 235 if (modalCloseElement !== null) { 236 modalCloseElement.onclick = () => { 237 const ServicePointModalElement = document.getElementById('dhlpwc-servicepoint-modal'); 238 if (ServicePointModalElement) ServicePointModalElement.style.display = 'none'; 239 }; 240 } 225 241 226 242 // Set background image dynamically 227 document.getElementById('dhlpwc-modal-content').style['background-image'] = 'url(' + window.dhlpwc_block_data['modal_background'] + ')'; 243 const modalContentElement = document.getElementById('dhlpwc-modal-content'); 244 if (modalContentElement !== null) modalContentElement.style['background-image'] = 'url(' + window.dhlpwc_block_data['modal_background'] + ')'; 228 245 }; 229 246 … … 231 248 * Set the initial parcelshop based on postalCode or countryCode 232 249 */ 233 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 1__.useEffect)(() => {250 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 234 251 const parcelshopDetails = document.getElementById('dhlpwc-shipping-method-parcelshop-option'); 252 if (parcelshopDetails === null) { 253 return; 254 } 235 255 if (props.selectedShippingMethod === 'dhlpwc-parcelshop') { 236 256 parcelshopDetails.style.display = 'block'; … … 260 280 setValidationErrors, 261 281 clearValidationError 262 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_ 3__.useDispatch)('wc/store/validation');282 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)('wc/store/validation'); 263 283 264 284 /** … … 267 287 * @param parcelshop 268 288 */ 269 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { 270 document.getElementById('dhlpwc-servicepoint-modal').style.display = 'none'; 289 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 290 const ServicePointModalElement = document.getElementById('dhlpwc-servicepoint-modal'); 291 if (ServicePointModalElement === null) { 292 return; 293 } 294 ServicePointModalElement.style.display = 'none'; 271 295 272 296 // Wordpress doesn't like it when we post raw data, so we post it as a form instead … … 285 309 setValidationErrors({ 286 310 [VALIDATION_ERROR_PARCELSHOP_EMPTY]: { 287 message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_ 2__.__)('Please add some text', 'shipping-workshop'),311 message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Please add some text', 'shipping-workshop'), 288 312 hidden: true 289 313 } … … 304 328 } 305 329 const modal = document.getElementById('dhlpwc-servicepoint-modal'); 306 modal.style.display = 'block'; 330 if (modal !== null) { 331 modal.style.display = 'block'; 332 } 307 333 if (typeof window.dhlparcel_shipping_servicepoint_locator !== 'undefined') { 308 334 window.dhlparcel_shipping_servicepoint_locator.setCountry(props.countryCode); … … 310 336 } 311 337 }; 312 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {338 return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", { 313 339 id: "dhlpwc-shipping-method-parcelshop-option", 314 className: "dhlpwc-shipping-method-parcelshop-option" 315 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { 316 className: "dhlpwc-parcelshop-selection-text" 317 }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('The following ServicePoint is selected:')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { 318 className: `dhlpwc-parcelshop-option-message ${props.validationClass}` 319 }, (_parcelshop$name = parcelshop.name) !== null && _parcelshop$name !== void 0 ? _parcelshop$name : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('⚠ No location selected.')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { 320 className: `dhlpwc-parcelshop-option-message ${props.validationClass}` 321 }, parcelshop?.address?.postal_code, " ", parcelshop?.address?.city), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { 322 className: `dhlpwc-parcelshop-option-message ${props.validationClass}` 323 }, parcelshop?.address?.street, " ", parcelshop?.address?.number, " ", parcelshop?.address?.addition), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("input", { 324 type: "button", 325 className: "dhlpwc-parcelshop-option-change", 326 value: "Change", 327 onClick: () => showModal() 328 })); 340 className: "dhlpwc-shipping-method-parcelshop-option", 341 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", { 342 className: "dhlpwc-parcelshop-selection-text", 343 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('The following ServicePoint is selected:') 344 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", { 345 className: `dhlpwc-parcelshop-option-message ${props.validationClass}`, 346 children: (_parcelshop$name = parcelshop.name) !== null && _parcelshop$name !== void 0 ? _parcelshop$name : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('⚠ No location selected.') 347 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("span", { 348 className: `dhlpwc-parcelshop-option-message ${props.validationClass}`, 349 children: [parcelshop?.address?.postal_code, " ", parcelshop?.address?.city] 350 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("span", { 351 className: `dhlpwc-parcelshop-option-message ${props.validationClass}`, 352 children: [parcelshop?.address?.street, " ", parcelshop?.address?.number, " ", parcelshop?.address?.addition] 353 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("input", { 354 type: "button", 355 className: "dhlpwc-parcelshop-option-change", 356 value: "Change", 357 onClick: () => showModal() 358 })] 359 }); 329 360 }; 330 331 /***/ }),332 333 /***/ "react":334 /*!************************!*\335 !*** external "React" ***!336 \************************/337 /***/ ((module) => {338 339 module.exports = window["React"];340 361 341 362 /***/ }), … … 388 409 389 410 module.exports = window["wp"]["i18n"]; 411 412 /***/ }), 413 414 /***/ "react/jsx-runtime": 415 /*!**********************************!*\ 416 !*** external "ReactJSXRuntime" ***! 417 \**********************************/ 418 /***/ ((module) => { 419 420 module.exports = window["ReactJSXRuntime"]; 390 421 391 422 /***/ }) … … 460 491 /************************************************************************/ 461 492 var __webpack_exports__ = {}; 462 // This entry need to be wrapped in an IIFE because it needto be isolated against other modules in the chunk.493 // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk. 463 494 (() => { 464 495 /*!*********************!*\ … … 469 500 /* harmony export */ App: () => (/* binding */ App) 470 501 /* harmony export */ }); 471 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");472 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);473 /* harmony import */ var _wordpress_ dom_ready__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/dom-ready */ "@wordpress/dom-ready");474 /* harmony import */ var _wordpress_ dom_ready__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_1__);475 /* harmony import */ var _ wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");476 /* harmony import */ var _ wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);477 /* harmony import */ var _s ervicepoints__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./servicepoints */ "./src/servicepoints.js");478 /* harmony import */ var _ delivery_times__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./delivery-times */ "./src/delivery-times.js");479 /* harmony import */ var _ same_day__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./same-day */ "./src/same-day.js");480 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");481 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__);482 483 484 485 486 487 488 489 490 _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_ 1___default()(async function () {502 /* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/dom-ready */ "@wordpress/dom-ready"); 503 /* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0__); 504 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 505 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 506 /* harmony import */ var _servicepoints__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./servicepoints */ "./src/servicepoints.js"); 507 /* harmony import */ var _delivery_times__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./delivery-times */ "./src/delivery-times.js"); 508 /* harmony import */ var _same_day__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./same-day */ "./src/same-day.js"); 509 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 510 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__); 511 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); 512 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__); 513 514 515 516 517 518 519 520 521 _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0___default()(async function () { 491 522 const getElementByIdAsync = id => new Promise(resolve => { 492 523 const getElement = () => { … … 501 532 }); 502 533 const container = await getElementByIdAsync('dhlpwc-app'); 503 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 2__.render)((0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(App, null), container);534 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.render)(/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(App, {}), container); 504 535 }); 505 536 const App = () => { 506 const [postalCode, setPostalCode] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 2__.useState)(window.dhlpwc_block_data['postal_code']);507 const [countryCode, setCountryCode] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 2__.useState)(window.dhlpwc_block_data['country_code']);508 const [selectedShippingMethod, setSelectedShippingMethod] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 2__.useState)(window.dhlpwc_block_data['initial_shipping_method']);509 const [validationClass, setValidationClass] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 2__.useState)('dhlpwc_warning');537 const [postalCode, setPostalCode] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(window.dhlpwc_block_data['postal_code']); 538 const [countryCode, setCountryCode] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(window.dhlpwc_block_data['country_code']); 539 const [selectedShippingMethod, setSelectedShippingMethod] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(window.dhlpwc_block_data['initial_shipping_method']); 540 const [validationClass, setValidationClass] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)('dhlpwc_warning'); 510 541 511 542 // Only run this once, intentionally no dependencies given 512 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 2__.useEffect)(() => {543 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { 513 544 // Track selected shipping method 514 545 document.addEventListener("change", trackSelectedShippingMethod); … … 527 558 for (const mutation of mutationList) { 528 559 if (mutation.type === "childList") { 529 setSelectedShippingMethod(document.getElementsByName('radio-control-0')[0].value); 560 let radioControlElement = document.getElementsByName('radio-control-0'); 561 if (typeof radioControlElement !== "undefined" && typeof radioControlElement[0] !== "undefined" && typeof radioControlElement[0].value !== "undefined") { 562 setSelectedShippingMethod(radioControlElement[0].value); 563 } 530 564 } 531 565 } 532 566 }); 533 observer.observe(document.getElementsByName('radio-control-0')[0].parentElement.parentElement, { 534 childList: true 535 }); 567 const radioControlElement = document.getElementsByName('radio-control-0'); 568 // TODO clean up check 569 if (typeof radioControlElement !== "undefined" && typeof radioControlElement[0] !== "undefined" && typeof radioControlElement[0].parentElement !== "undefined" && typeof radioControlElement[0].parentElement.parentElement !== "undefined") { 570 observer.observe(radioControlElement[0].parentElement.parentElement, { 571 childList: true 572 }); 573 } 536 574 537 575 // TODO find a better method to retrieve address data instead of observing requests … … 565 603 }, []); 566 604 const deliveryTimeShippingMethods = ['dhlpwc-parcelshop', 'dhlpwc-home', 'dhlpwc-home-evening', 'dhlpwc-home-next-day', 'dhlpwc-home-no-neighbour', 'dhlpwc-home-no-neighbour-evening', 'dhlpwc-home-no-neighbour-next-day']; 567 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => { 605 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { 606 const deliveryOptionsElement = document.getElementById('dhlpwc-shipping-method-delivery-options'); 607 if (!deliveryOptionsElement) { 608 return; 609 } 568 610 if (deliveryTimeShippingMethods.indexOf(selectedShippingMethod) !== -1) { 569 d ocument.getElementById('dhlpwc-shipping-method-delivery-options').style.display = "block";611 deliveryOptionsElement.style.display = "block"; 570 612 } else { 571 d ocument.getElementById('dhlpwc-shipping-method-delivery-options').style.display = "none";613 deliveryOptionsElement.style.display = "none"; 572 614 } 573 615 }, [selectedShippingMethod]); 574 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {616 return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", { 575 617 id: "dhlpwc-shipping-method-delivery-options", 576 className: "dhlpwc-shipping-method-delivery-options" 577 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { 578 className: "dhlpwc-delivery-options-header" 579 }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('DHL Delivery options')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_delivery_times__WEBPACK_IMPORTED_MODULE_4__.DeliveryTimes, { 580 postalCode: postalCode, 581 countryCode: countryCode, 582 selectedShippingMethod: selectedShippingMethod 583 }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_servicepoints__WEBPACK_IMPORTED_MODULE_3__.Servicepoints, { 584 postalCode: postalCode, 585 countryCode: countryCode, 586 selectedShippingMethod: selectedShippingMethod, 587 validationClass: validationClass, 588 setValidationClass: setValidationClass 589 }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_same_day__WEBPACK_IMPORTED_MODULE_5__.SameDay, { 590 postalCode: postalCode, 591 countryCode: countryCode, 592 selectedShippingMethod: selectedShippingMethod 593 })); 618 className: "dhlpwc-shipping-method-delivery-options", 619 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", { 620 className: "dhlpwc-delivery-options-header", 621 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('DHL Delivery options') 622 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_delivery_times__WEBPACK_IMPORTED_MODULE_3__.DeliveryTimes, { 623 postalCode: postalCode, 624 countryCode: countryCode, 625 selectedShippingMethod: selectedShippingMethod 626 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_servicepoints__WEBPACK_IMPORTED_MODULE_2__.Servicepoints, { 627 postalCode: postalCode, 628 countryCode: countryCode, 629 selectedShippingMethod: selectedShippingMethod, 630 validationClass: validationClass, 631 setValidationClass: setValidationClass 632 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_same_day__WEBPACK_IMPORTED_MODULE_4__.SameDay, { 633 postalCode: postalCode, 634 countryCode: countryCode, 635 selectedShippingMethod: selectedShippingMethod 636 })] 637 }); 594 638 }; 595 639 })(); -
dhlpwc/tags/2.1.12/build/view.js.map
r3160499 r3273743 1 {"version":3,"file":"view.js","mappings":";;;;;;;;;;;;;;;;;;;;;; ;AAAwD;AACnB;AACiB;AAE/C,MAAMI,aAAa,GAAIC,KAAK,IAAK;EACpC,IAAI,CAACC,MAAM,CAACC,iBAAiB,CAACC,qBAAqB,EAAE;IACjD,OAAO,EAAE;EACb;EAEA,MAAMC,2BAA2B,GAAG,CAChC,aAAa,EACb,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,kCAAkC,EAClC,mCAAmC,CACtC;EACD,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAGX,4DAAQ,CAAC,CAAC,CAAC,CAAC;EACtD,MAAM,CAACY,YAAY,EAAEC,eAAe,CAAC,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AK,CAAC,CAAC,EAAE;MACpEH,QAAQ,CAACC,cAAc,CAAC,yCAAyC,CAAC,CAACG,KAAK,CAACC,OAAO,GAAG,OAAO;IAC9F,CAAC,MAAM;MACHL,QAAQ,CAACC,cAAc,CAAC,yCAAyC,CAAC,CAACG,KAAK,CAACC,OAAO,GAAG,MAAM;IAC7F;EACJ,CAAC,EAAE,CAACF,sBAAsB,CAAC,CAAC;EAE5B,OAAO+B,oDAAA;IAAKC,EAAE,EAAC,yCAAyC;IAACC,SAAS,EAAC;EAAyC,GACxGF,oDAAA;IAAKE,SAAS,EAAC;EAAgC,GAAEjD,mDAAE,CAAC,sBAAsB,CAAO,CAAC,EAClF+C,oDAAA,CAAC7C,0DAAa;IACVoB,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBP,sBAAsB,EAAEA;EAAuB,CAClD,CAAC,EACF+B,oDAAA,CAACoB,yDAAa;IACV7C,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBP,sBAAsB,EAAEA,sBAAuB;IAC/C6F,eAAe,EAAEA,eAAgB;IACjCP,kBAAkB,EAAEA;EAAmB,CAC1C,CAAC,EACFvD,oDAAA,CAACQ,8CAAO;IACJjC,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBP,sBAAsB,EAAEA;EAAuB,CAClD,CACA,CAAC;AACV,CAAC,C","sources":["webpack://copyright-date-block/./src/delivery-times.js","webpack://copyright-date-block/./src/same-day.js","webpack://copyright-date-block/./src/servicepoints.js","webpack://copyright-date-block/external window \"React\"","webpack://copyright-date-block/external window [\"wp\",\"components\"]","webpack://copyright-date-block/external window [\"wp\",\"data\"]","webpack://copyright-date-block/external window [\"wp\",\"domReady\"]","webpack://copyright-date-block/external window [\"wp\",\"element\"]","webpack://copyright-date-block/external window [\"wp\",\"i18n\"]","webpack://copyright-date-block/webpack/bootstrap","webpack://copyright-date-block/webpack/runtime/compat get default export","webpack://copyright-date-block/webpack/runtime/define property getters","webpack://copyright-date-block/webpack/runtime/hasOwnProperty shorthand","webpack://copyright-date-block/webpack/runtime/make namespace object","webpack://copyright-date-block/./src/view.js"],"sourcesContent":["import { useState, useEffect } from '@wordpress/element'\nimport { __ } from '@wordpress/i18n';\nimport { SelectControl } from '@wordpress/components';\n\nexport const DeliveryTimes = (props) => {\n if (!window.dhlpwc_block_data.deliverytimes_enabled) {\n return ''\n }\n\n const deliveryTimeShippingMethods = [\n 'dhlpwc-home',\n 'dhlpwc-home-evening',\n 'dhlpwc-home-next-day',\n 'dhlpwc-home-no-neighbour',\n 'dhlpwc-home-no-neighbour-evening',\n 'dhlpwc-home-no-neighbour-next-day',\n ]\n const [deliveryTimes, setDeliveryTimes] = useState({});\n const [selectedTime, setSelectedTime] = useState([]);\n\n useEffect(() => {\n const deliveryTimeDetails = document.getElementById('dhlpwc-shipping-method-delivery-times-option')\n if (deliveryTimeShippingMethods.indexOf(props.selectedShippingMethod) !== -1) {\n deliveryTimeDetails.style.display = \"block\";\n // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n const formData = new FormData();\n formData.append('action', 'dhlpwc_get_delivery_times')\n formData.append('shipping_method', props.selectedShippingMethod)\n formData.append('postal_code', props.postalCode)\n formData.append('country_code', props.countryCode)\n fetch(\n window.dhlpwc_block_data['ajax_url'],\n {\n method: 'POST',\n body: formData\n }\n ).then(async response => {\n response = await response.json()\n let parsedDeliveryTimes = [];\n\n Object.values(response.data).forEach((value) => {\n const parsedDeliveryTime = {\n label: `${value.date} (${value.start_time} - ${value.end_time})`,\n value: value.identifier\n }\n parsedDeliveryTimes.push(parsedDeliveryTime)\n })\n setDeliveryTimes(parsedDeliveryTimes)\n // initially set the first selection\n setSelectedTime(parsedDeliveryTimes[0].value.split('___'))\n })\n } else {\n deliveryTimeDetails.style.display = \"none\"\n setSelectedTime([])\n }\n }, [props.postalCode, props.countryCode, props.selectedShippingMethod])\n\n useEffect(() => {\n // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n const formData = new FormData();\n formData.append('action', 'dhlpwc_delivery_time_selection_sync')\n\n formData.append('selected', true)\n formData.append('date', selectedTime[0] ?? '')\n formData.append('start_time', selectedTime[1] ?? '')\n formData.append('end_time', selectedTime[2] ?? '')\n\n fetch(\n window.dhlpwc_block_data['ajax_url'],\n {\n method: 'POST',\n body: formData\n }\n )\n }, [selectedTime])\n\n return <div id='dhlpwc-shipping-method-delivery-times-option'\n className='dhlpwc-shipping-method-delivery-times-option'>\n <div className=\"dhlpwc-delivery-times-selection-header\">{__('DHL Delivery Times options')}</div>\n <span className=\"dhlpwc-delivery-times-selection-text\">{__('Desired delivery moment:')}</span>\n <SelectControl\n hideLabelFromVision='true'\n className='dhlpwc-delivery-times-selection-input'\n label={__('Select desired delivery moment')}\n value={selectedTime.join('___')}\n options={deliveryTimes}\n onChange={(deliveryTime) => setSelectedTime(deliveryTime.split('___'))}\n />\n </div>\n};\n","import { useEffect } from '@wordpress/element'\n\nexport const SameDay = (props) => {\n if (window.dhlpwc_block_data.sdd_as_time_window) {\n const sameDayElement = document.getElementById('radio-control-0-dhlpwc-home-same-day');\n if (sameDayElement) {\n sameDayElement.parentElement.style.display = \"none\";\n }\n\n const sameDayNoNeighborElement = document.getElementById('radio-control-0-dhlpwc-home-no-neighbour-same-day');\n if (sameDayNoNeighborElement) {\n sameDayNoNeighborElement.parentElement.style.display = \"none\";\n }\n }\n\n const sameDayDeliveryMethods = [\n 'dhlpwc-home-same-day',\n 'dhlpwc-home-no-neighbour-same-day'\n ]\n\n useEffect(() => {\n if (sameDayDeliveryMethods.indexOf(props.selectedShippingMethod) !== -1) {\n // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n const formData = new FormData();\n formData.append('action', 'dhlpwc_get_delivery_times')\n formData.append('shipping_method', props.selectedShippingMethod)\n formData.append('postal_code', props.postalCode)\n formData.append('country_code', props.countryCode)\n fetch(\n window.dhlpwc_block_data['ajax_url'],\n {\n method: 'POST',\n body: formData\n }\n ).then(async response => {\n response = await response.json()\n const sameDayDeliveryTime = response.data[0]['identifier'].split('___')\n const formData = new FormData();\n formData.append('action', 'dhlpwc_delivery_time_selection_sync')\n\n formData.append('selected', true)\n formData.append('date', sameDayDeliveryTime[0] ?? '')\n formData.append('start_time', sameDayDeliveryTime[1] ?? '')\n formData.append('end_time', sameDayDeliveryTime[2] ?? '')\n\n fetch(\n window.dhlpwc_block_data['ajax_url'],\n {\n method: 'POST',\n body: formData\n }\n )\n })\n }\n }, [props.postalCode, props.countryCode, props.selectedShippingMethod]);\n};\n","import { useState, useEffect } from '@wordpress/element'\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\nexport const Servicepoints = (props) => {\n const VALIDATION_ERROR_PARCELSHOP_EMPTY = 'validation-error-parcelshop-empty'\n const getValidationError = useSelect((select) => {\n const store = select('wc/store/validation');\n\n return store.getValidationError( VALIDATION_ERROR_PARCELSHOP_EMPTY );\n });\n const [parcelshop, setParcelshop] = useState({})\n\n // Only run this once, intentionally no dependencies given\n useEffect(() => {\n const script = document.createElement('script')\n script.src = 'https://static.dhlecommerce.nl/components/servicepoint-locator-component@latest/servicepoint-locator-component.js'\n script.async = true\n script.onload = () => loadModal()\n\n document.body.appendChild(script)\n }, [])\n\n const loadModal = () => {\n var options = {\n language: window.dhlpwc_block_data['language'],\n country: window.dhlpwc_block_data['country_code'] ?? '',\n limit: window.dhlpwc_block_data['limit'],\n googleMapsApiKey: window.dhlpwc_block_data['google_maps_key'],\n header: false,\n resizable: true,\n onSelect: (parcelshop) => {\n setParcelshop(parcelshop)\n },\n filter: {\n serviceType: 'pick-up'\n }\n }\n\n window.dhlparcel_shipping_servicepoint_locator = new dhl.servicepoint.Locator(document.getElementById('dhl-servicepoint-locator-component'), options)\n\n // Hide the parcelshop element when parcelshop is not selected\n const parcelshopDetails = document.getElementById('dhlpwc-shipping-method-parcelshop-option')\n if (props.selectedShippingMethod === 'dhlpwc-parcelshop') {\n parcelshopDetails.style.display = 'block'\n } else {\n parcelshopDetails.style.display = 'none'\n }\n\n // Hide the modal when clicking the X button\n document.getElementById('dhlpwc-modal-close').onclick = () => {\n document.getElementById('dhlpwc-servicepoint-modal').style.display = 'none'\n }\n\n // Set background image dynamically\n document.getElementById('dhlpwc-modal-content').style['background-image'] = 'url(' + window.dhlpwc_block_data['modal_background'] + ')'\n }\n\n /**\n * Set the initial parcelshop based on postalCode or countryCode\n */\n useEffect(() => {\n const parcelshopDetails = document.getElementById('dhlpwc-shipping-method-parcelshop-option')\n if (props.selectedShippingMethod === 'dhlpwc-parcelshop') {\n parcelshopDetails.style.display = 'block'\n\n // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n const formData = new FormData();\n formData.append('action', 'dhlpwc_get_initial_parcelshop')\n formData.append('postal_code', props.postalCode)\n formData.append('country_code', props.countryCode)\n fetch(\n window.dhlpwc_block_data['ajax_url'],\n {\n method: 'POST',\n body: formData\n }\n ).then(async response => {\n response = await response.json()\n\n if (response.data?.parcelshop) {\n setParcelshop(response.data.parcelshop)\n } else {\n setParcelshop({})\n }\n })\n } else {\n parcelshopDetails.style.display = 'none'\n setParcelshop({})\n }\n }, [props.postalCode, props.selectedShippingMethod])\n\n const { setValidationErrors, clearValidationError } = useDispatch(\n 'wc/store/validation'\n );\n\n /**\n * Sync the parcelshop (or lack of) with frontend elements and the backend\n *\n * @param parcelshop\n */\n useEffect( () => {\n document.getElementById('dhlpwc-servicepoint-modal').style.display = 'none'\n\n // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n const formData = new FormData();\n formData.append('action', 'dhlpwc_parcelshop_selection_sync')\n if (Object.keys(parcelshop).length !== 0 || props.selectedShippingMethod !== 'dhlpwc-parcelshop') {\n props.setValidationClass('dhlpwc_notice')\n formData.append('parcelshop_id', parcelshop['id'] ?? '')\n formData.append('country_code', props.countryCode)\n if ( getValidationError ) {\n clearValidationError( VALIDATION_ERROR_PARCELSHOP_EMPTY );\n }\n } else {\n props.setValidationClass('dhlpwc-servicepoint-error')\n setValidationErrors( {\n [ VALIDATION_ERROR_PARCELSHOP_EMPTY ]: {\n message: __( 'Please add some text', 'shipping-workshop' ),\n hidden: true,\n },\n } );\n }\n\n fetch(\n window.dhlpwc_block_data['ajax_url'],\n {\n method: 'POST',\n body: formData\n }\n )\n }, [parcelshop]);\n\n /**\n * Show the parcelshop selector\n */\n const showModal = () => {\n if (props.postalCode === '') {\n document.getElementById('shipping-postcode').value\n }\n\n const modal = document.getElementById('dhlpwc-servicepoint-modal')\n modal.style.display = 'block'\n\n if (typeof window.dhlparcel_shipping_servicepoint_locator !== 'undefined') {\n window.dhlparcel_shipping_servicepoint_locator.setCountry(props.countryCode)\n window.dhlparcel_shipping_servicepoint_locator.setQuery(props.postalCode)\n }\n }\n\n return <div id='dhlpwc-shipping-method-parcelshop-option' className='dhlpwc-shipping-method-parcelshop-option'>\n <span className=\"dhlpwc-parcelshop-selection-text\">{__('The following ServicePoint is selected:')}</span>\n <span className={`dhlpwc-parcelshop-option-message ${props.validationClass}`}>{parcelshop.name ?? __('⚠ No location selected.')}</span>\n <span className={`dhlpwc-parcelshop-option-message ${props.validationClass}`}>{parcelshop?.address?.postal_code} {parcelshop?.address?.city}</span>\n <span className={`dhlpwc-parcelshop-option-message ${props.validationClass}`}>{parcelshop?.address?.street} {parcelshop?.address?.number} {parcelshop?.address?.addition}</span>\n\n <input type='button' className='dhlpwc-parcelshop-option-change' value='Change' onClick={() => showModal()}/>\n </div>\n};\n","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"domReady\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import domReady from '@wordpress/dom-ready'\nimport { render, useEffect } from '@wordpress/element'\nimport { Servicepoints } from \"./servicepoints\";\nimport { DeliveryTimes } from \"./delivery-times\";\nimport { SameDay } from \"./same-day\";\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element'\n\ndomReady(async function () {\n const getElementByIdAsync = id => new Promise(resolve => {\n const getElement = () => {\n const element = document.getElementById(id)\n if(element) {\n resolve(element)\n } else {\n requestAnimationFrame(getElement)\n }\n };\n getElement()\n });\n\n const container = await getElementByIdAsync('dhlpwc-app')\n render(<App/>, container)\n})\n\nexport const App = () => {\n const [postalCode, setPostalCode] = useState(window.dhlpwc_block_data['postal_code'])\n const [countryCode, setCountryCode] = useState(window.dhlpwc_block_data['country_code'])\n const [selectedShippingMethod, setSelectedShippingMethod] = useState(window.dhlpwc_block_data['initial_shipping_method'])\n const [validationClass, setValidationClass] = useState('dhlpwc_warning')\n\n // Only run this once, intentionally no dependencies given\n useEffect(()=>{\n\n // Track selected shipping method\n document.addEventListener( \"change\", trackSelectedShippingMethod );\n function trackSelectedShippingMethod(event){\n let element = event.target;\n if (element.name === 'radio-control-0') {\n setSelectedShippingMethod(event.target.value)\n }\n }\n\n /**\n * Create observer for when shipping methods fundamentally change (WooCommerce does not call the Change method)\n * We observe the parent of the radio buttons. When a shipping methods gets added or removed, we update the selectedShippingMethod\n */\n const observer = new MutationObserver((mutationList) => {\n for (const mutation of mutationList) {\n if (mutation.type === \"childList\") {\n setSelectedShippingMethod(document.getElementsByName('radio-control-0')[0].value)\n }\n }\n });\n observer.observe(document.getElementsByName('radio-control-0')[0].parentElement.parentElement, {childList: true});\n\n\n // TODO find a better method to retrieve address data instead of observing requests\n const nativeFetch = window.fetch\n window.fetch = function(...args) {\n let isWantedCall = false\n const urlParams = new URLSearchParams(args[0])\n urlParams.forEach(function (param) {\n if (isWantedCall) {\n return\n }\n\n if (param.includes('batch')) {\n isWantedCall = true\n }\n });\n\n if (!isWantedCall) {\n return nativeFetch.apply(window, args);\n }\n\n JSON.parse(args[1].body).requests.forEach((request) => {\n if (request.path.includes('update-customer')) {\n if (typeof request.body.shipping_address.country !== 'undefined') {\n setCountryCode(request.body.shipping_address.country)\n }\n\n if (typeof request.body.shipping_address.postcode !== 'undefined') {\n setPostalCode(request.body.shipping_address.postcode);\n }\n }\n })\n\n return nativeFetch.apply(window, args);\n }\n }, [])\n\n const deliveryTimeShippingMethods = [\n 'dhlpwc-parcelshop',\n 'dhlpwc-home',\n 'dhlpwc-home-evening',\n 'dhlpwc-home-next-day',\n 'dhlpwc-home-no-neighbour',\n 'dhlpwc-home-no-neighbour-evening',\n 'dhlpwc-home-no-neighbour-next-day',\n ]\n\n useEffect(() => {\n if (deliveryTimeShippingMethods.indexOf(selectedShippingMethod) !== -1) {\n document.getElementById('dhlpwc-shipping-method-delivery-options').style.display = \"block\"\n } else {\n document.getElementById('dhlpwc-shipping-method-delivery-options').style.display = \"none\"\n }\n }, [selectedShippingMethod])\n\n return <div id='dhlpwc-shipping-method-delivery-options' className='dhlpwc-shipping-method-delivery-options'>\n <div className=\"dhlpwc-delivery-options-header\">{__('DHL Delivery options')}</div>\n <DeliveryTimes\n postalCode={postalCode}\n countryCode={countryCode}\n selectedShippingMethod={selectedShippingMethod}\n />\n <Servicepoints\n postalCode={postalCode}\n countryCode={countryCode}\n selectedShippingMethod={selectedShippingMethod}\n validationClass={validationClass}\n setValidationClass={setValidationClass}\n />\n <SameDay\n postalCode={postalCode}\n countryCode={countryCode}\n selectedShippingMethod={selectedShippingMethod}\n />\n </div>\n}\n"],"names":["useState","useEffect","__","SelectControl","DeliveryTimes","props","window","dhlpwc_block_data","deliverytimes_enabled","deliveryTimeShippingMethods","deliveryTimes","setDeliveryTimes","selectedTime","setSelectedTime","deliveryTimeDetails","document","getElementById","indexOf","selectedShippingMethod","style","display","formData","FormData","append","postalCode","countryCode","fetch","method","body","then","response","json","parsedDeliveryTimes","Object","values","data","forEach","value","parsedDeliveryTime","label","date","start_time","end_time","identifier","push","split","_selectedTime$","_selectedTime$2","_selectedTime$3","createElement","id","className","hideLabelFromVision","join","options","onChange","deliveryTime","SameDay","sdd_as_time_window","sameDayElement","parentElement","sameDayNoNeighborElement","sameDayDeliveryMethods","_sameDayDeliveryTime$","_sameDayDeliveryTime$2","_sameDayDeliveryTime$3","sameDayDeliveryTime","useDispatch","useSelect","Servicepoints","_parcelshop$name","VALIDATION_ERROR_PARCELSHOP_EMPTY","getValidationError","select","store","parcelshop","setParcelshop","script","src","async","onload","loadModal","appendChild","_window$dhlpwc_block_","language","country","limit","googleMapsApiKey","header","resizable","onSelect","filter","serviceType","dhlparcel_shipping_servicepoint_locator","dhl","servicepoint","Locator","parcelshopDetails","onclick","setValidationErrors","clearValidationError","keys","length","_parcelshop$id","setValidationClass","message","hidden","showModal","modal","setCountry","setQuery","validationClass","name","address","postal_code","city","street","number","addition","type","onClick","domReady","render","getElementByIdAsync","Promise","resolve","getElement","element","requestAnimationFrame","container","App","setPostalCode","setCountryCode","setSelectedShippingMethod","addEventListener","trackSelectedShippingMethod","event","target","observer","MutationObserver","mutationList","mutation","getElementsByName","observe","childList","nativeFetch","args","isWantedCall","urlParams","URLSearchParams","param","includes","apply","JSON","parse","requests","request","path","shipping_address","postcode"],"sourceRoot":""}1 {"version":3,"file":"view.js","mappings":";;;;;;;;;;;;;;;;;;;;;;AAAwD;AACnB;AACiB;AAAA;AAE/C,MAAMQ,aAAa,GAAIC,KAAK,IAAK;EACpC,IAAI,CAACC,MAAM,CAACC,iBAAiB,CAACC,qBAAqB,EAAE;IACjD,OAAO,EAAE;EACb;EAEA,MAAMC,2BAA2B,GAAG,CAChC,aAAa,EACb,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,kCAAkC,EAClC,mCAAmC,CACtC;EACD,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAGf,4DAAQ,CAAC,CAAC,CAAC,CAAC;EACtD,MAAM,CAACgB,YAAY,EAAEC,eAAe,CAAC,GAAGjB,4DAAQ,CAAC,EAAE,CAAC;EAEpDC,6DAAS,CAAC,MAAM;IACZ,MAAMiB,mBAAmB,GAAGC,QAAQ,CAACC,cAAc,CAAC,8CAA8C,CAAC;IACnG,IAAIF,mBAAmB,KAAK,IAAI,EAAE;MAC9B;IACJ;IACA,IAAIL,2BAA2B,CAACQ,OAAO,CAACZ,KAAK,CAACa,sBAAsB,CAAC,KAAK,CAAC,CAAC,EAAE;MAC1EJ,mBAAmB,CAACK,KAAK,CAACC,OAAO,GAAG,OAAO;MAC3C;MACA,MAAMC,QAAQ,GAAG,IAAIC,QAAQ,CAAC,CAAC;MAC/BD,QAAQ,CAACE,MAAM,CAAC,QAAQ,EAAE,2BAA2B,CAAC;MACtDF,QAAQ,CAACE,MAAM,CAAC,iBAAiB,EAAElB,KAAK,CAACa,sBAAsB,CAAC;MAChEG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EAAC,yCAAyC;IAAAC,QAAA,gBACxGlD,sDAAA;MAAKiD,SAAS,EAAC,gCAAgC;MAAAC,QAAA,EAAErD,mDAAE,CAAC,sBAAsB;IAAC,CAAM,CAAC,eAClFG,sDAAA,CAACG,0DAAa;MACVoB,UAAU,EAAEA,UAAW;MACvBC,WAAW,EAAEA,WAAY;MACzBP,sBAAsB,EAAEA;IAAuB,CAClD,CAAC,eACFjB,sDAAA,CAACoE,yDAAa;MACV7C,UAAU,EAAEA,UAAW;MACvBC,WAAW,EAAEA,WAAY;MACzBP,sBAAsB,EAAEA,sBAAuB;MAC/CkG,eAAe,EAAEA,eAAgB;MACjCP,kBAAkB,EAAEA;IAAmB,CAC1C,CAAC,eACF5G,sDAAA,CAACwD,8CAAO;MACJjC,UAAU,EAAEA,UAAW;MACvBC,WAAW,EAAEA,WAAY;MACzBP,sBAAsB,EAAEA;IAAuB,CAClD,CAAC;EAAA,CACD,CAAC;AACV,CAAC,C","sources":["webpack://copyright-date-block/./src/delivery-times.js","webpack://copyright-date-block/./src/same-day.js","webpack://copyright-date-block/./src/servicepoints.js","webpack://copyright-date-block/external window [\"wp\",\"components\"]","webpack://copyright-date-block/external window [\"wp\",\"data\"]","webpack://copyright-date-block/external window [\"wp\",\"domReady\"]","webpack://copyright-date-block/external window [\"wp\",\"element\"]","webpack://copyright-date-block/external window [\"wp\",\"i18n\"]","webpack://copyright-date-block/external window \"ReactJSXRuntime\"","webpack://copyright-date-block/webpack/bootstrap","webpack://copyright-date-block/webpack/runtime/compat get default export","webpack://copyright-date-block/webpack/runtime/define property getters","webpack://copyright-date-block/webpack/runtime/hasOwnProperty shorthand","webpack://copyright-date-block/webpack/runtime/make namespace object","webpack://copyright-date-block/./src/view.js"],"sourcesContent":["import { useState, useEffect } from '@wordpress/element'\r\nimport { __ } from '@wordpress/i18n';\r\nimport { SelectControl } from '@wordpress/components';\r\n\r\nexport const DeliveryTimes = (props) => {\r\n if (!window.dhlpwc_block_data.deliverytimes_enabled) {\r\n return ''\r\n }\r\n\r\n const deliveryTimeShippingMethods = [\r\n 'dhlpwc-home',\r\n 'dhlpwc-home-evening',\r\n 'dhlpwc-home-next-day',\r\n 'dhlpwc-home-no-neighbour',\r\n 'dhlpwc-home-no-neighbour-evening',\r\n 'dhlpwc-home-no-neighbour-next-day',\r\n ]\r\n const [deliveryTimes, setDeliveryTimes] = useState({});\r\n const [selectedTime, setSelectedTime] = useState([]);\r\n\r\n useEffect(() => {\r\n const deliveryTimeDetails = document.getElementById('dhlpwc-shipping-method-delivery-times-option')\r\n if (deliveryTimeDetails === null) {\r\n return\r\n }\r\n if (deliveryTimeShippingMethods.indexOf(props.selectedShippingMethod) !== -1) {\r\n deliveryTimeDetails.style.display = \"block\";\r\n // Wordpress doesn't like it when we post raw data, so we post it as a form instead\r\n const formData = new FormData();\r\n formData.append('action', 'dhlpwc_get_delivery_times')\r\n formData.append('shipping_method', props.selectedShippingMethod)\r\n formData.append('postal_code', props.postalCode)\r\n formData.append('country_code', props.countryCode)\r\n fetch(\r\n window.dhlpwc_block_data['ajax_url'],\r\n {\r\n method: 'POST',\r\n body: formData\r\n }\r\n ).then(async response => {\r\n response = await response.json()\r\n let parsedDeliveryTimes = [];\r\n\r\n Object.values(response.data).forEach((value) => {\r\n const parsedDeliveryTime = {\r\n label: `${value.date} (${value.start_time} - ${value.end_time})`,\r\n value: value.identifier\r\n }\r\n parsedDeliveryTimes.push(parsedDeliveryTime)\r\n })\r\n setDeliveryTimes(parsedDeliveryTimes)\r\n // initially set the first selection\r\n if (typeof parsedDeliveryTimes[0] !== \"undefined\")\r\n setSelectedTime(parsedDeliveryTimes[0].value.split('___'))\r\n })\r\n } else {\r\n deliveryTimeDetails.style.display = \"none\"\r\n setSelectedTime([])\r\n }\r\n }, [props.postalCode, props.countryCode, props.selectedShippingMethod])\r\n\r\n useEffect(() => {\r\n // Wordpress doesn't like it when we post raw data, so we post it as a form instead\r\n const formData = new FormData();\r\n formData.append('action', 'dhlpwc_delivery_time_selection_sync')\r\n\r\n formData.append('selected', true)\r\n formData.append('date', selectedTime[0] ?? '')\r\n formData.append('start_time', selectedTime[1] ?? '')\r\n formData.append('end_time', selectedTime[2] ?? '')\r\n\r\n fetch(\r\n window.dhlpwc_block_data['ajax_url'],\r\n {\r\n method: 'POST',\r\n body: formData\r\n }\r\n )\r\n }, [selectedTime])\r\n\r\n return <div id='dhlpwc-shipping-method-delivery-times-option'\r\n className='dhlpwc-shipping-method-delivery-times-option'>\r\n <div className=\"dhlpwc-delivery-times-selection-header\">{__('DHL Delivery Times options')}</div>\r\n <span className=\"dhlpwc-delivery-times-selection-text\">{__('Desired delivery moment:')}</span>\r\n <SelectControl\r\n hideLabelFromVision='true'\r\n className='dhlpwc-delivery-times-selection-input'\r\n label={__('Select desired delivery moment')}\r\n value={selectedTime.join('___')}\r\n options={deliveryTimes}\r\n onChange={(deliveryTime) => setSelectedTime(deliveryTime.split('___'))}\r\n />\r\n </div>\r\n};\r\n","import { useEffect } from '@wordpress/element'\r\n\r\nexport const SameDay = (props) => {\r\n if (window.dhlpwc_block_data.sdd_as_time_window) {\r\n const sameDayElement = document.getElementById('radio-control-0-dhlpwc-home-same-day');\r\n if (sameDayElement) {\r\n sameDayElement.parentElement.style.display = \"none\";\r\n }\r\n\r\n const sameDayNoNeighborElement = document.getElementById('radio-control-0-dhlpwc-home-no-neighbour-same-day');\r\n if (sameDayNoNeighborElement) {\r\n sameDayNoNeighborElement.parentElement.style.display = \"none\";\r\n }\r\n }\r\n\r\n const sameDayDeliveryMethods = [\r\n 'dhlpwc-home-same-day',\r\n 'dhlpwc-home-no-neighbour-same-day'\r\n ]\r\n\r\n useEffect(() => {\r\n if (sameDayDeliveryMethods.indexOf(props.selectedShippingMethod) !== -1) {\r\n // Wordpress doesn't like it when we post raw data, so we post it as a form instead\r\n const formData = new FormData();\r\n formData.append('action', 'dhlpwc_get_delivery_times')\r\n formData.append('shipping_method', props.selectedShippingMethod)\r\n formData.append('postal_code', props.postalCode)\r\n formData.append('country_code', props.countryCode)\r\n fetch(\r\n window.dhlpwc_block_data['ajax_url'],\r\n {\r\n method: 'POST',\r\n body: formData\r\n }\r\n ).then(async response => {\r\n response = await response.json()\r\n const sameDayDeliveryTime = response.data[0]['identifier'].split('___')\r\n const formData = new FormData();\r\n formData.append('action', 'dhlpwc_delivery_time_selection_sync')\r\n\r\n formData.append('selected', true)\r\n formData.append('date', sameDayDeliveryTime[0] ?? '')\r\n formData.append('start_time', sameDayDeliveryTime[1] ?? '')\r\n formData.append('end_time', sameDayDeliveryTime[2] ?? '')\r\n\r\n fetch(\r\n window.dhlpwc_block_data['ajax_url'],\r\n {\r\n method: 'POST',\r\n body: formData\r\n }\r\n )\r\n })\r\n }\r\n }, [props.postalCode, props.countryCode, props.selectedShippingMethod]);\r\n};\r\n","import { useState, useEffect } from '@wordpress/element'\r\nimport { __ } from '@wordpress/i18n';\r\nimport { useDispatch, useSelect } from '@wordpress/data';\r\n\r\nexport const Servicepoints = (props) => {\r\n const VALIDATION_ERROR_PARCELSHOP_EMPTY = 'validation-error-parcelshop-empty'\r\n const getValidationError = useSelect((select) => {\r\n const store = select('wc/store/validation');\r\n\r\n return store.getValidationError( VALIDATION_ERROR_PARCELSHOP_EMPTY );\r\n });\r\n const [parcelshop, setParcelshop] = useState({})\r\n\r\n // Only run this once, intentionally no dependencies given\r\n useEffect(() => {\r\n const script = document.createElement('script')\r\n script.src = 'https://static.dhlecommerce.nl/components/servicepoint-locator-component@latest/servicepoint-locator-component.js'\r\n script.async = true\r\n script.onload = () => loadModal()\r\n\r\n document.body.appendChild(script)\r\n }, [])\r\n\r\n const loadModal = () => {\r\n var options = {\r\n language: window.dhlpwc_block_data['language'],\r\n country: window.dhlpwc_block_data['country_code'] ?? '',\r\n limit: window.dhlpwc_block_data['limit'],\r\n googleMapsApiKey: window.dhlpwc_block_data['google_maps_key'],\r\n header: false,\r\n resizable: true,\r\n onSelect: (parcelshop) => {\r\n setParcelshop(parcelshop)\r\n },\r\n filter: {\r\n serviceType: 'pick-up'\r\n }\r\n }\r\n\r\n const servicePointElement = document.getElementById('dhl-servicepoint-locator-component')\r\n if (servicePointElement === null) {\r\n return\r\n }\r\n window.dhlparcel_shipping_servicepoint_locator = new dhl.servicepoint.Locator(servicePointElement, options)\r\n\r\n // Hide the parcelshop element when parcelshop is not selected\r\n const parcelshopDetails = document.getElementById('dhlpwc-shipping-method-parcelshop-option')\r\n if (parcelshopDetails !== null) {\r\n if (props.selectedShippingMethod === 'dhlpwc-parcelshop') {\r\n parcelshopDetails.style.display = 'block'\r\n } else {\r\n parcelshopDetails.style.display = 'none'\r\n }\r\n }\r\n\r\n // Hide the modal when clicking the X button\r\n const modalCloseElement = document.getElementById('dhlpwc-modal-close')\r\n if (modalCloseElement !== null) {\r\n modalCloseElement.onclick = () => {\r\n const ServicePointModalElement = document.getElementById('dhlpwc-servicepoint-modal')\r\n if (ServicePointModalElement)\r\n ServicePointModalElement.style.display = 'none'\r\n }\r\n }\r\n\r\n // Set background image dynamically\r\n const modalContentElement = document.getElementById('dhlpwc-modal-content')\r\n if (modalContentElement !== null)\r\n modalContentElement.style['background-image'] = 'url(' + window.dhlpwc_block_data['modal_background'] + ')'\r\n }\r\n\r\n /**\r\n * Set the initial parcelshop based on postalCode or countryCode\r\n */\r\n useEffect(() => {\r\n const parcelshopDetails = document.getElementById('dhlpwc-shipping-method-parcelshop-option')\r\n if (parcelshopDetails === null) {\r\n return\r\n }\r\n\r\n if (props.selectedShippingMethod === 'dhlpwc-parcelshop') {\r\n parcelshopDetails.style.display = 'block'\r\n\r\n // Wordpress doesn't like it when we post raw data, so we post it as a form instead\r\n const formData = new FormData();\r\n formData.append('action', 'dhlpwc_get_initial_parcelshop')\r\n formData.append('postal_code', props.postalCode)\r\n formData.append('country_code', props.countryCode)\r\n fetch(\r\n window.dhlpwc_block_data['ajax_url'],\r\n {\r\n method: 'POST',\r\n body: formData\r\n }\r\n ).then(async response => {\r\n response = await response.json()\r\n\r\n if (response.data?.parcelshop) {\r\n setParcelshop(response.data.parcelshop)\r\n } else {\r\n setParcelshop({})\r\n }\r\n })\r\n } else {\r\n parcelshopDetails.style.display = 'none'\r\n setParcelshop({})\r\n }\r\n }, [props.postalCode, props.selectedShippingMethod])\r\n\r\n const { setValidationErrors, clearValidationError } = useDispatch(\r\n 'wc/store/validation'\r\n );\r\n\r\n /**\r\n * Sync the parcelshop (or lack of) with frontend elements and the backend\r\n *\r\n * @param parcelshop\r\n */\r\n useEffect( () => {\r\n const ServicePointModalElement = document.getElementById('dhlpwc-servicepoint-modal')\r\n if (ServicePointModalElement === null) {\r\n return\r\n }\r\n ServicePointModalElement.style.display = 'none'\r\n\r\n // Wordpress doesn't like it when we post raw data, so we post it as a form instead\r\n const formData = new FormData();\r\n formData.append('action', 'dhlpwc_parcelshop_selection_sync')\r\n if (Object.keys(parcelshop).length !== 0 || props.selectedShippingMethod !== 'dhlpwc-parcelshop') {\r\n props.setValidationClass('dhlpwc_notice')\r\n formData.append('parcelshop_id', parcelshop['id'] ?? '')\r\n formData.append('country_code', props.countryCode)\r\n if ( getValidationError ) {\r\n clearValidationError( VALIDATION_ERROR_PARCELSHOP_EMPTY );\r\n }\r\n } else {\r\n props.setValidationClass('dhlpwc-servicepoint-error')\r\n setValidationErrors( {\r\n [ VALIDATION_ERROR_PARCELSHOP_EMPTY ]: {\r\n message: __( 'Please add some text', 'shipping-workshop' ),\r\n hidden: true,\r\n },\r\n } );\r\n }\r\n\r\n fetch(\r\n window.dhlpwc_block_data['ajax_url'],\r\n {\r\n method: 'POST',\r\n body: formData\r\n }\r\n )\r\n }, [parcelshop]);\r\n\r\n /**\r\n * Show the parcelshop selector\r\n */\r\n const showModal = () => {\r\n if (props.postalCode === '') {\r\n document.getElementById('shipping-postcode').value\r\n }\r\n\r\n const modal = document.getElementById('dhlpwc-servicepoint-modal')\r\n if (modal !== null) {\r\n modal.style.display = 'block'\r\n }\r\n\r\n if (typeof window.dhlparcel_shipping_servicepoint_locator !== 'undefined') {\r\n window.dhlparcel_shipping_servicepoint_locator.setCountry(props.countryCode)\r\n window.dhlparcel_shipping_servicepoint_locator.setQuery(props.postalCode)\r\n }\r\n }\r\n\r\n return <div id='dhlpwc-shipping-method-parcelshop-option' className='dhlpwc-shipping-method-parcelshop-option'>\r\n <span className=\"dhlpwc-parcelshop-selection-text\">{__('The following ServicePoint is selected:')}</span>\r\n <span className={`dhlpwc-parcelshop-option-message ${props.validationClass}`}>{parcelshop.name ?? __('⚠ No location selected.')}</span>\r\n <span className={`dhlpwc-parcelshop-option-message ${props.validationClass}`}>{parcelshop?.address?.postal_code} {parcelshop?.address?.city}</span>\r\n <span className={`dhlpwc-parcelshop-option-message ${props.validationClass}`}>{parcelshop?.address?.street} {parcelshop?.address?.number} {parcelshop?.address?.addition}</span>\r\n\r\n <input type='button' className='dhlpwc-parcelshop-option-change' value='Change' onClick={() => showModal()}/>\r\n </div>\r\n};\r\n","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"domReady\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"ReactJSXRuntime\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import domReady from '@wordpress/dom-ready'\r\nimport { render, useEffect } from '@wordpress/element'\r\nimport { Servicepoints } from \"./servicepoints\";\r\nimport { DeliveryTimes } from \"./delivery-times\";\r\nimport { SameDay } from \"./same-day\";\r\nimport { __ } from '@wordpress/i18n';\r\nimport { useState } from '@wordpress/element'\r\n\r\ndomReady(async function () {\r\n const getElementByIdAsync = id => new Promise(resolve => {\r\n const getElement = () => {\r\n const element = document.getElementById(id)\r\n if(element) {\r\n resolve(element)\r\n } else {\r\n requestAnimationFrame(getElement)\r\n }\r\n };\r\n getElement()\r\n });\r\n\r\n const container = await getElementByIdAsync('dhlpwc-app')\r\n render(<App/>, container)\r\n})\r\n\r\nexport const App = () => {\r\n const [postalCode, setPostalCode] = useState(window.dhlpwc_block_data['postal_code'])\r\n const [countryCode, setCountryCode] = useState(window.dhlpwc_block_data['country_code'])\r\n const [selectedShippingMethod, setSelectedShippingMethod] = useState(window.dhlpwc_block_data['initial_shipping_method'])\r\n const [validationClass, setValidationClass] = useState('dhlpwc_warning')\r\n\r\n // Only run this once, intentionally no dependencies given\r\n useEffect(()=>{\r\n\r\n // Track selected shipping method\r\n document.addEventListener( \"change\", trackSelectedShippingMethod );\r\n function trackSelectedShippingMethod(event){\r\n let element = event.target;\r\n if (element.name === 'radio-control-0') {\r\n setSelectedShippingMethod(event.target.value)\r\n }\r\n }\r\n\r\n /**\r\n * Create observer for when shipping methods fundamentally change (WooCommerce does not call the Change method)\r\n * We observe the parent of the radio buttons. When a shipping methods gets added or removed, we update the selectedShippingMethod\r\n */\r\n const observer = new MutationObserver((mutationList) => {\r\n for (const mutation of mutationList) {\r\n if (mutation.type === \"childList\") {\r\n let radioControlElement = document.getElementsByName('radio-control-0')\r\n if (typeof radioControlElement !== \"undefined\" && typeof radioControlElement[0] !== \"undefined\" && typeof radioControlElement[0].value !== \"undefined\") {\r\n setSelectedShippingMethod(radioControlElement[0].value)\r\n }\r\n }\r\n }\r\n });\r\n const radioControlElement = document.getElementsByName('radio-control-0')\r\n // TODO clean up check\r\n if (typeof radioControlElement !== \"undefined\" && typeof radioControlElement[0] !== \"undefined\" && typeof radioControlElement[0].parentElement !== \"undefined\" && typeof radioControlElement[0].parentElement.parentElement !== \"undefined\") {\r\n observer.observe(radioControlElement[0].parentElement.parentElement, {childList: true});\r\n }\r\n\r\n // TODO find a better method to retrieve address data instead of observing requests\r\n const nativeFetch = window.fetch\r\n window.fetch = function(...args) {\r\n let isWantedCall = false\r\n const urlParams = new URLSearchParams(args[0])\r\n urlParams.forEach(function (param) {\r\n if (isWantedCall) {\r\n return\r\n }\r\n\r\n if (param.includes('batch')) {\r\n isWantedCall = true\r\n }\r\n });\r\n\r\n if (!isWantedCall) {\r\n return nativeFetch.apply(window, args);\r\n }\r\n\r\n JSON.parse(args[1].body).requests.forEach((request) => {\r\n if (request.path.includes('update-customer')) {\r\n if (typeof request.body.shipping_address.country !== 'undefined') {\r\n setCountryCode(request.body.shipping_address.country)\r\n }\r\n\r\n if (typeof request.body.shipping_address.postcode !== 'undefined') {\r\n setPostalCode(request.body.shipping_address.postcode);\r\n }\r\n }\r\n })\r\n\r\n return nativeFetch.apply(window, args);\r\n }\r\n }, [])\r\n\r\n const deliveryTimeShippingMethods = [\r\n 'dhlpwc-parcelshop',\r\n 'dhlpwc-home',\r\n 'dhlpwc-home-evening',\r\n 'dhlpwc-home-next-day',\r\n 'dhlpwc-home-no-neighbour',\r\n 'dhlpwc-home-no-neighbour-evening',\r\n 'dhlpwc-home-no-neighbour-next-day',\r\n ]\r\n\r\n useEffect(() => {\r\n const deliveryOptionsElement = document.getElementById('dhlpwc-shipping-method-delivery-options')\r\n if (!deliveryOptionsElement) {\r\n return\r\n }\r\n if (deliveryTimeShippingMethods.indexOf(selectedShippingMethod) !== -1) {\r\n deliveryOptionsElement.style.display = \"block\"\r\n } else {\r\n deliveryOptionsElement.style.display = \"none\"\r\n }\r\n }, [selectedShippingMethod])\r\n\r\n return <div id='dhlpwc-shipping-method-delivery-options' className='dhlpwc-shipping-method-delivery-options'>\r\n <div className=\"dhlpwc-delivery-options-header\">{__('DHL Delivery options')}</div>\r\n <DeliveryTimes\r\n postalCode={postalCode}\r\n countryCode={countryCode}\r\n selectedShippingMethod={selectedShippingMethod}\r\n />\r\n <Servicepoints\r\n postalCode={postalCode}\r\n countryCode={countryCode}\r\n selectedShippingMethod={selectedShippingMethod}\r\n validationClass={validationClass}\r\n setValidationClass={setValidationClass}\r\n />\r\n <SameDay\r\n postalCode={postalCode}\r\n countryCode={countryCode}\r\n selectedShippingMethod={selectedShippingMethod}\r\n />\r\n </div>\r\n}\r\n"],"names":["useState","useEffect","__","SelectControl","jsx","_jsx","jsxs","_jsxs","DeliveryTimes","props","window","dhlpwc_block_data","deliverytimes_enabled","deliveryTimeShippingMethods","deliveryTimes","setDeliveryTimes","selectedTime","setSelectedTime","deliveryTimeDetails","document","getElementById","indexOf","selectedShippingMethod","style","display","formData","FormData","append","postalCode","countryCode","fetch","method","body","then","response","json","parsedDeliveryTimes","Object","values","data","forEach","value","parsedDeliveryTime","label","date","start_time","end_time","identifier","push","split","_selectedTime$","_selectedTime$2","_selectedTime$3","id","className","children","hideLabelFromVision","join","options","onChange","deliveryTime","SameDay","sdd_as_time_window","sameDayElement","parentElement","sameDayNoNeighborElement","sameDayDeliveryMethods","_sameDayDeliveryTime$","_sameDayDeliveryTime$2","_sameDayDeliveryTime$3","sameDayDeliveryTime","useDispatch","useSelect","Servicepoints","_parcelshop$name","VALIDATION_ERROR_PARCELSHOP_EMPTY","getValidationError","select","store","parcelshop","setParcelshop","script","createElement","src","async","onload","loadModal","appendChild","_window$dhlpwc_block_","language","country","limit","googleMapsApiKey","header","resizable","onSelect","filter","serviceType","servicePointElement","dhlparcel_shipping_servicepoint_locator","dhl","servicepoint","Locator","parcelshopDetails","modalCloseElement","onclick","ServicePointModalElement","modalContentElement","setValidationErrors","clearValidationError","keys","length","_parcelshop$id","setValidationClass","message","hidden","showModal","modal","setCountry","setQuery","validationClass","name","address","postal_code","city","street","number","addition","type","onClick","domReady","render","getElementByIdAsync","Promise","resolve","getElement","element","requestAnimationFrame","container","App","setPostalCode","setCountryCode","setSelectedShippingMethod","addEventListener","trackSelectedShippingMethod","event","target","observer","MutationObserver","mutationList","mutation","radioControlElement","getElementsByName","observe","childList","nativeFetch","args","isWantedCall","urlParams","URLSearchParams","param","includes","apply","JSON","parse","requests","request","path","shipping_address","postcode","deliveryOptionsElement"],"sourceRoot":""} -
dhlpwc/tags/2.1.12/dhlpwoocommerce.php
r3255370 r3273743 5 5 * Description: This is the official DHL eCommerce (Benelux) for WooCommerce plugin. 6 6 * Author: DHL eCommerce 7 * Version: 2.1.1 17 * Version: 2.1.12 8 8 * Requires at least: 4.7 9 9 * Tested up to: 6.6 … … 52 52 53 53 // Set constants 54 $this->define('DHLPWC_PLUGIN_VERSION', '2.1.1 1');54 $this->define('DHLPWC_PLUGIN_VERSION', '2.1.12'); 55 55 $this->define('DHLPWC_PLUGIN_FILE', __FILE__); 56 56 $this->define('DHLPWC_PLUGIN_BASENAME', plugin_basename(__FILE__)); -
dhlpwc/tags/2.1.12/includes/model/service/class-dhlpwc-model-service-debug.php
r2688414 r3273743 67 67 // Unfortunately, we can only get the plugin version if it's in the admin section 68 68 if (is_admin()) { 69 $plugin_data = get_plugin_data(DHLPWC_PLUGIN_FILE );69 $plugin_data = get_plugin_data(DHLPWC_PLUGIN_FILE, true, false); 70 70 $plugin_version = $plugin_data['Version']; 71 71 } else { -
dhlpwc/tags/2.1.12/includes/model/service/class-dhlpwc-model-service-shipment.php
r3229375 r3273743 66 66 if (empty($shipment_data->receiver->address->number) && $validate_address_number) { 67 67 $this->set_error(self::CREATE_ERROR, ucfirst(sprintf(__('Receiver %s field is required.', 'dhlpwc'), __('house number', 'dhlpwc')))); 68 return false; 69 } 70 71 if (!$to_business && empty($shipment_data->receiver->name->last_name)) { 72 $this->set_error(self::CREATE_ERROR, ucfirst(sprintf(__('Receiver %s field is required on shipments to consumers.', 'dhlpwc'), __('last name', 'dhlpwc')))); 68 73 return false; 69 74 } -
dhlpwc/tags/2.1.12/readme.txt
r3255370 r3273743 5 5 Requires PHP: 5.6 6 6 Tested up to: 6.6 7 Stable tag: 2.1.1 17 Stable tag: 2.1.12 8 8 WC requires at least: 3.0.0 9 9 WC tested up to: 9.0.2 … … 56 56 57 57 == Changelog == 58 59 = 2.1.12 = 60 - Added a last name check for label creation 61 - Fixed an incompatibility issue provisionally for WooCommerce 9.8.0 and higher 62 - Known issue: ServicePoint Locator and delivery timeframes are not loaded properly for WooCommerce 9.8.0 and higher 58 63 59 64 = 2.1.11 = -
dhlpwc/trunk/README.md
r3255370 r3273743 1 1 # DHL eCommerce (Benelux) for WooCommerce 2 3 v2.1.12 4 ## Changes 5 - Added a last name check for label creation 6 - Fixed an incompatibility issue provisionally for WooCommerce 9.8.0 and higher 7 - Known issue: ServicePoint Locator and delivery timeframes are not loaded properly for WooCommerce 9.8.0 and higher 2 8 3 9 v2.1.11 -
dhlpwc/trunk/build/index.asset.php
r3073094 r3273743 1 <?php return array('dependencies' => array('react ', 'wp-blocks'), 'version' => '7653790f168fdf85c9a4');1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-blocks'), 'version' => '86436dc6f37fa7cc3f24'); -
dhlpwc/trunk/build/index.js
r3073094 r3273743 2 2 /******/ "use strict"; 3 3 /******/ var __webpack_modules__ = ({ 4 5 /***/ "./src/block.json": 6 /*!************************!*\ 7 !*** ./src/block.json ***! 8 \************************/ 9 /***/ ((module) => { 10 11 module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"dhlpwc/dhlpwc-block","version":"0.1.0","title":"DHL Shipping Methods block","category":"widgets","description":"Displays extra options for the DHL Shipping Methods like parcelshops and timeframes.","example":{},"textdomain":"dhlpwc-block","editorScript":"file:./index.js","render":"file:./render.php","viewScript":"file:./view.js","parent":["woocommerce/checkout-shipping-methods-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}}}'); 12 13 /***/ }), 4 14 5 15 /***/ "./src/edit.js": … … 13 23 /* harmony export */ "default": () => (/* binding */ Edit) 14 24 /* harmony export */ }); 15 /* harmony import */ var react_ _WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");16 /* harmony import */ var react_ _WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);25 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); 26 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); 17 27 18 28 /** … … 20 30 */ 21 31 function Edit() { 22 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, "[DHL eCommerce ServicePoints]"); 32 return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { 33 children: "[DHL eCommerce ServicePoints]" 34 }); 23 35 } 24 25 /***/ }),26 27 /***/ "react":28 /*!************************!*\29 !*** external "React" ***!30 \************************/31 /***/ ((module) => {32 33 module.exports = window["React"];34 36 35 37 /***/ }), … … 45 47 /***/ }), 46 48 47 /***/ " ./src/block.json":48 /*!************************ !*\49 !*** ./src/block.json***!50 \************************ /49 /***/ "react/jsx-runtime": 50 /*!**********************************!*\ 51 !*** external "ReactJSXRuntime" ***! 52 \**********************************/ 51 53 /***/ ((module) => { 52 54 53 module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"dhlpwc/dhlpwc-block","version":"0.1.0","title":"DHL Shipping Methods block","category":"widgets","description":"Displays extra options for the DHL Shipping Methods like parcelshops and timeframes.","example":{},"textdomain":"dhlpwc-block","editorScript":"file:./index.js","render":"file:./render.php","viewScript":"file:./view.js","parent":["woocommerce/checkout-shipping-methods-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}}}');55 module.exports = window["ReactJSXRuntime"]; 54 56 55 57 /***/ }) … … 124 126 /************************************************************************/ 125 127 var __webpack_exports__ = {}; 126 // This entry need to be wrapped in an IIFE because it needto be isolated against other modules in the chunk.128 // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk. 127 129 (() => { 128 130 /*!**********************!*\ -
dhlpwc/trunk/build/index.js.map
r3073094 r3273743 1 {"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;; AAAA;AACA;AACA;AACe,SAASA,IAAIA,CAAA,EAAG;EAC3B,OACIC,oDAAA,cAAK,+BAAkC,CAAC;AAEhD;;;;;;;;;;ACPA;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;ACLsD;AAClB;AACV;AAE1BC,oEAAiB,CAAEC,6CAAa,EAAE;EAC9BE,IAAI,EAAEL,6CAAIA;AACd,CAAE,CAAC,C","sources":["webpack://copyright-date-block/./src/edit.js","webpack://copyright-date-block/external window \"React\"","webpack://copyright-date-block/external window [\"wp\",\"blocks\"]","webpack://copyright-date-block/webpack/bootstrap","webpack://copyright-date-block/webpack/runtime/compat get default export","webpack://copyright-date-block/webpack/runtime/define property getters","webpack://copyright-date-block/webpack/runtime/hasOwnProperty shorthand","webpack://copyright-date-block/webpack/runtime/make namespace object","webpack://copyright-date-block/./src/index.js"],"sourcesContent":["/**\n * Used for the Wordpress Pagebuilder\n */\nexport default function Edit() {\n return (\n <div>[DHL eCommerce ServicePoints]</div>\n );\n}\n","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"blocks\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\nimport { registerBlockType } from '@wordpress/blocks';\nimport metadata from './block.json';\nimport Edit from './edit';\n\nregisterBlockType( metadata.name, {\n edit: Edit,\n} );\n"],"names":["Edit","createElement","registerBlockType","metadata","name","edit"],"sourceRoot":""}1 {"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACe,SAASA,IAAIA,CAAA,EAAG;EAC3B,oBACIC,sDAAA;IAAAC,QAAA,EAAK;EAA6B,CAAK,CAAC;AAEhD;;;;;;;;;;ACPA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;ACLsD;AAClB;AACV;AAE1BC,oEAAiB,CAAEC,6CAAa,EAAE;EAC9BE,IAAI,EAAEN,6CAAIA;AACd,CAAE,CAAC,C","sources":["webpack://copyright-date-block/./src/edit.js","webpack://copyright-date-block/external window [\"wp\",\"blocks\"]","webpack://copyright-date-block/external window \"ReactJSXRuntime\"","webpack://copyright-date-block/webpack/bootstrap","webpack://copyright-date-block/webpack/runtime/compat get default export","webpack://copyright-date-block/webpack/runtime/define property getters","webpack://copyright-date-block/webpack/runtime/hasOwnProperty shorthand","webpack://copyright-date-block/webpack/runtime/make namespace object","webpack://copyright-date-block/./src/index.js"],"sourcesContent":["/**\r\n * Used for the Wordpress Pagebuilder\r\n */\r\nexport default function Edit() {\r\n return (\r\n <div>[DHL eCommerce ServicePoints]</div>\r\n );\r\n}\r\n","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"ReactJSXRuntime\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\r\nimport { registerBlockType } from '@wordpress/blocks';\r\nimport metadata from './block.json';\r\nimport Edit from './edit';\r\n\r\nregisterBlockType( metadata.name, {\r\n edit: Edit,\r\n} );\r\n"],"names":["Edit","_jsx","children","registerBlockType","metadata","name","edit"],"sourceRoot":""} -
dhlpwc/trunk/build/view.asset.php
r3160499 r3273743 1 <?php return array('dependencies' => array('react ', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => 'eeeebb5fff6cc243195d');1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => 'e537f87caf8f4a2f31bd'); -
dhlpwc/trunk/build/view.js
r3160499 r3273743 13 13 /* harmony export */ DeliveryTimes: () => (/* binding */ DeliveryTimes) 14 14 /* harmony export */ }); 15 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");16 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);17 /* harmony import */ var _wordpress_ element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");18 /* harmony import */ var _wordpress_ element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);19 /* harmony import */ var _wordpress_ i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");20 /* harmony import */ var _wordpress_ i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);21 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");22 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__);15 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 16 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 17 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 18 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 19 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 20 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); 21 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); 22 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__); 23 23 24 24 … … 30 30 } 31 31 const deliveryTimeShippingMethods = ['dhlpwc-home', 'dhlpwc-home-evening', 'dhlpwc-home-next-day', 'dhlpwc-home-no-neighbour', 'dhlpwc-home-no-neighbour-evening', 'dhlpwc-home-no-neighbour-next-day']; 32 const [deliveryTimes, setDeliveryTimes] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 1__.useState)({});33 const [selectedTime, setSelectedTime] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 1__.useState)([]);34 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 1__.useEffect)(() => {32 const [deliveryTimes, setDeliveryTimes] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)({}); 33 const [selectedTime, setSelectedTime] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)([]); 34 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 35 35 const deliveryTimeDetails = document.getElementById('dhlpwc-shipping-method-delivery-times-option'); 36 if (deliveryTimeDetails === null) { 37 return; 38 } 36 39 if (deliveryTimeShippingMethods.indexOf(props.selectedShippingMethod) !== -1) { 37 40 deliveryTimeDetails.style.display = "block"; … … 57 60 setDeliveryTimes(parsedDeliveryTimes); 58 61 // initially set the first selection 59 setSelectedTime(parsedDeliveryTimes[0].value.split('___'));62 if (typeof parsedDeliveryTimes[0] !== "undefined") setSelectedTime(parsedDeliveryTimes[0].value.split('___')); 60 63 }); 61 64 } else { … … 64 67 } 65 68 }, [props.postalCode, props.countryCode, props.selectedShippingMethod]); 66 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 1__.useEffect)(() => {69 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 67 70 var _selectedTime$, _selectedTime$2, _selectedTime$3; 68 71 // Wordpress doesn't like it when we post raw data, so we post it as a form instead … … 78 81 }); 79 82 }, [selectedTime]); 80 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {83 return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", { 81 84 id: "dhlpwc-shipping-method-delivery-times-option", 82 className: "dhlpwc-shipping-method-delivery-times-option" 83 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { 84 className: "dhlpwc-delivery-times-selection-header" 85 }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('DHL Delivery Times options')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { 86 className: "dhlpwc-delivery-times-selection-text" 87 }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Desired delivery moment:')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.SelectControl, { 88 hideLabelFromVision: "true", 89 className: "dhlpwc-delivery-times-selection-input", 90 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Select desired delivery moment'), 91 value: selectedTime.join('___'), 92 options: deliveryTimes, 93 onChange: deliveryTime => setSelectedTime(deliveryTime.split('___')) 94 })); 85 className: "dhlpwc-shipping-method-delivery-times-option", 86 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", { 87 className: "dhlpwc-delivery-times-selection-header", 88 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('DHL Delivery Times options') 89 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", { 90 className: "dhlpwc-delivery-times-selection-text", 91 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Desired delivery moment:') 92 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.SelectControl, { 93 hideLabelFromVision: "true", 94 className: "dhlpwc-delivery-times-selection-input", 95 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Select desired delivery moment'), 96 value: selectedTime.join('___'), 97 options: deliveryTimes, 98 onChange: deliveryTime => setSelectedTime(deliveryTime.split('___')) 99 })] 100 }); 95 101 }; 96 102 … … 164 170 /* harmony export */ Servicepoints: () => (/* binding */ Servicepoints) 165 171 /* harmony export */ }); 166 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");167 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);168 /* harmony import */ var _wordpress_ element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");169 /* harmony import */ var _wordpress_ element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);170 /* harmony import */ var _wordpress_ i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");171 /* harmony import */ var _wordpress_ i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);172 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");173 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);172 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 173 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 174 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 175 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 176 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 177 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); 178 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); 179 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__); 174 180 175 181 … … 179 185 var _parcelshop$name; 180 186 const VALIDATION_ERROR_PARCELSHOP_EMPTY = 'validation-error-parcelshop-empty'; 181 const getValidationError = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_ 3__.useSelect)(select => {187 const getValidationError = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => { 182 188 const store = select('wc/store/validation'); 183 189 return store.getValidationError(VALIDATION_ERROR_PARCELSHOP_EMPTY); 184 190 }); 185 const [parcelshop, setParcelshop] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 1__.useState)({});191 const [parcelshop, setParcelshop] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)({}); 186 192 187 193 // Only run this once, intentionally no dependencies given 188 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 1__.useEffect)(() => {194 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 189 195 const script = document.createElement('script'); 190 196 script.src = 'https://static.dhlecommerce.nl/components/servicepoint-locator-component@latest/servicepoint-locator-component.js'; … … 209 215 } 210 216 }; 211 window.dhlparcel_shipping_servicepoint_locator = new dhl.servicepoint.Locator(document.getElementById('dhl-servicepoint-locator-component'), options); 217 const servicePointElement = document.getElementById('dhl-servicepoint-locator-component'); 218 if (servicePointElement === null) { 219 return; 220 } 221 window.dhlparcel_shipping_servicepoint_locator = new dhl.servicepoint.Locator(servicePointElement, options); 212 222 213 223 // Hide the parcelshop element when parcelshop is not selected 214 224 const parcelshopDetails = document.getElementById('dhlpwc-shipping-method-parcelshop-option'); 215 if (props.selectedShippingMethod === 'dhlpwc-parcelshop') { 216 parcelshopDetails.style.display = 'block'; 217 } else { 218 parcelshopDetails.style.display = 'none'; 225 if (parcelshopDetails !== null) { 226 if (props.selectedShippingMethod === 'dhlpwc-parcelshop') { 227 parcelshopDetails.style.display = 'block'; 228 } else { 229 parcelshopDetails.style.display = 'none'; 230 } 219 231 } 220 232 221 233 // Hide the modal when clicking the X button 222 document.getElementById('dhlpwc-modal-close').onclick = () => { 223 document.getElementById('dhlpwc-servicepoint-modal').style.display = 'none'; 224 }; 234 const modalCloseElement = document.getElementById('dhlpwc-modal-close'); 235 if (modalCloseElement !== null) { 236 modalCloseElement.onclick = () => { 237 const ServicePointModalElement = document.getElementById('dhlpwc-servicepoint-modal'); 238 if (ServicePointModalElement) ServicePointModalElement.style.display = 'none'; 239 }; 240 } 225 241 226 242 // Set background image dynamically 227 document.getElementById('dhlpwc-modal-content').style['background-image'] = 'url(' + window.dhlpwc_block_data['modal_background'] + ')'; 243 const modalContentElement = document.getElementById('dhlpwc-modal-content'); 244 if (modalContentElement !== null) modalContentElement.style['background-image'] = 'url(' + window.dhlpwc_block_data['modal_background'] + ')'; 228 245 }; 229 246 … … 231 248 * Set the initial parcelshop based on postalCode or countryCode 232 249 */ 233 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 1__.useEffect)(() => {250 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 234 251 const parcelshopDetails = document.getElementById('dhlpwc-shipping-method-parcelshop-option'); 252 if (parcelshopDetails === null) { 253 return; 254 } 235 255 if (props.selectedShippingMethod === 'dhlpwc-parcelshop') { 236 256 parcelshopDetails.style.display = 'block'; … … 260 280 setValidationErrors, 261 281 clearValidationError 262 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_ 3__.useDispatch)('wc/store/validation');282 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)('wc/store/validation'); 263 283 264 284 /** … … 267 287 * @param parcelshop 268 288 */ 269 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { 270 document.getElementById('dhlpwc-servicepoint-modal').style.display = 'none'; 289 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 290 const ServicePointModalElement = document.getElementById('dhlpwc-servicepoint-modal'); 291 if (ServicePointModalElement === null) { 292 return; 293 } 294 ServicePointModalElement.style.display = 'none'; 271 295 272 296 // Wordpress doesn't like it when we post raw data, so we post it as a form instead … … 285 309 setValidationErrors({ 286 310 [VALIDATION_ERROR_PARCELSHOP_EMPTY]: { 287 message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_ 2__.__)('Please add some text', 'shipping-workshop'),311 message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Please add some text', 'shipping-workshop'), 288 312 hidden: true 289 313 } … … 304 328 } 305 329 const modal = document.getElementById('dhlpwc-servicepoint-modal'); 306 modal.style.display = 'block'; 330 if (modal !== null) { 331 modal.style.display = 'block'; 332 } 307 333 if (typeof window.dhlparcel_shipping_servicepoint_locator !== 'undefined') { 308 334 window.dhlparcel_shipping_servicepoint_locator.setCountry(props.countryCode); … … 310 336 } 311 337 }; 312 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {338 return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", { 313 339 id: "dhlpwc-shipping-method-parcelshop-option", 314 className: "dhlpwc-shipping-method-parcelshop-option" 315 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { 316 className: "dhlpwc-parcelshop-selection-text" 317 }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('The following ServicePoint is selected:')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { 318 className: `dhlpwc-parcelshop-option-message ${props.validationClass}` 319 }, (_parcelshop$name = parcelshop.name) !== null && _parcelshop$name !== void 0 ? _parcelshop$name : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('⚠ No location selected.')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { 320 className: `dhlpwc-parcelshop-option-message ${props.validationClass}` 321 }, parcelshop?.address?.postal_code, " ", parcelshop?.address?.city), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { 322 className: `dhlpwc-parcelshop-option-message ${props.validationClass}` 323 }, parcelshop?.address?.street, " ", parcelshop?.address?.number, " ", parcelshop?.address?.addition), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("input", { 324 type: "button", 325 className: "dhlpwc-parcelshop-option-change", 326 value: "Change", 327 onClick: () => showModal() 328 })); 340 className: "dhlpwc-shipping-method-parcelshop-option", 341 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", { 342 className: "dhlpwc-parcelshop-selection-text", 343 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('The following ServicePoint is selected:') 344 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", { 345 className: `dhlpwc-parcelshop-option-message ${props.validationClass}`, 346 children: (_parcelshop$name = parcelshop.name) !== null && _parcelshop$name !== void 0 ? _parcelshop$name : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('⚠ No location selected.') 347 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("span", { 348 className: `dhlpwc-parcelshop-option-message ${props.validationClass}`, 349 children: [parcelshop?.address?.postal_code, " ", parcelshop?.address?.city] 350 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("span", { 351 className: `dhlpwc-parcelshop-option-message ${props.validationClass}`, 352 children: [parcelshop?.address?.street, " ", parcelshop?.address?.number, " ", parcelshop?.address?.addition] 353 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("input", { 354 type: "button", 355 className: "dhlpwc-parcelshop-option-change", 356 value: "Change", 357 onClick: () => showModal() 358 })] 359 }); 329 360 }; 330 331 /***/ }),332 333 /***/ "react":334 /*!************************!*\335 !*** external "React" ***!336 \************************/337 /***/ ((module) => {338 339 module.exports = window["React"];340 361 341 362 /***/ }), … … 388 409 389 410 module.exports = window["wp"]["i18n"]; 411 412 /***/ }), 413 414 /***/ "react/jsx-runtime": 415 /*!**********************************!*\ 416 !*** external "ReactJSXRuntime" ***! 417 \**********************************/ 418 /***/ ((module) => { 419 420 module.exports = window["ReactJSXRuntime"]; 390 421 391 422 /***/ }) … … 460 491 /************************************************************************/ 461 492 var __webpack_exports__ = {}; 462 // This entry need to be wrapped in an IIFE because it needto be isolated against other modules in the chunk.493 // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk. 463 494 (() => { 464 495 /*!*********************!*\ … … 469 500 /* harmony export */ App: () => (/* binding */ App) 470 501 /* harmony export */ }); 471 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");472 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);473 /* harmony import */ var _wordpress_ dom_ready__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/dom-ready */ "@wordpress/dom-ready");474 /* harmony import */ var _wordpress_ dom_ready__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_1__);475 /* harmony import */ var _ wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");476 /* harmony import */ var _ wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);477 /* harmony import */ var _s ervicepoints__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./servicepoints */ "./src/servicepoints.js");478 /* harmony import */ var _ delivery_times__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./delivery-times */ "./src/delivery-times.js");479 /* harmony import */ var _ same_day__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./same-day */ "./src/same-day.js");480 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");481 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__);482 483 484 485 486 487 488 489 490 _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_ 1___default()(async function () {502 /* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/dom-ready */ "@wordpress/dom-ready"); 503 /* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0__); 504 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 505 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 506 /* harmony import */ var _servicepoints__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./servicepoints */ "./src/servicepoints.js"); 507 /* harmony import */ var _delivery_times__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./delivery-times */ "./src/delivery-times.js"); 508 /* harmony import */ var _same_day__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./same-day */ "./src/same-day.js"); 509 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 510 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__); 511 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); 512 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__); 513 514 515 516 517 518 519 520 521 _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0___default()(async function () { 491 522 const getElementByIdAsync = id => new Promise(resolve => { 492 523 const getElement = () => { … … 501 532 }); 502 533 const container = await getElementByIdAsync('dhlpwc-app'); 503 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 2__.render)((0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(App, null), container);534 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.render)(/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(App, {}), container); 504 535 }); 505 536 const App = () => { 506 const [postalCode, setPostalCode] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 2__.useState)(window.dhlpwc_block_data['postal_code']);507 const [countryCode, setCountryCode] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 2__.useState)(window.dhlpwc_block_data['country_code']);508 const [selectedShippingMethod, setSelectedShippingMethod] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 2__.useState)(window.dhlpwc_block_data['initial_shipping_method']);509 const [validationClass, setValidationClass] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 2__.useState)('dhlpwc_warning');537 const [postalCode, setPostalCode] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(window.dhlpwc_block_data['postal_code']); 538 const [countryCode, setCountryCode] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(window.dhlpwc_block_data['country_code']); 539 const [selectedShippingMethod, setSelectedShippingMethod] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(window.dhlpwc_block_data['initial_shipping_method']); 540 const [validationClass, setValidationClass] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)('dhlpwc_warning'); 510 541 511 542 // Only run this once, intentionally no dependencies given 512 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_ 2__.useEffect)(() => {543 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { 513 544 // Track selected shipping method 514 545 document.addEventListener("change", trackSelectedShippingMethod); … … 527 558 for (const mutation of mutationList) { 528 559 if (mutation.type === "childList") { 529 setSelectedShippingMethod(document.getElementsByName('radio-control-0')[0].value); 560 let radioControlElement = document.getElementsByName('radio-control-0'); 561 if (typeof radioControlElement !== "undefined" && typeof radioControlElement[0] !== "undefined" && typeof radioControlElement[0].value !== "undefined") { 562 setSelectedShippingMethod(radioControlElement[0].value); 563 } 530 564 } 531 565 } 532 566 }); 533 observer.observe(document.getElementsByName('radio-control-0')[0].parentElement.parentElement, { 534 childList: true 535 }); 567 const radioControlElement = document.getElementsByName('radio-control-0'); 568 // TODO clean up check 569 if (typeof radioControlElement !== "undefined" && typeof radioControlElement[0] !== "undefined" && typeof radioControlElement[0].parentElement !== "undefined" && typeof radioControlElement[0].parentElement.parentElement !== "undefined") { 570 observer.observe(radioControlElement[0].parentElement.parentElement, { 571 childList: true 572 }); 573 } 536 574 537 575 // TODO find a better method to retrieve address data instead of observing requests … … 565 603 }, []); 566 604 const deliveryTimeShippingMethods = ['dhlpwc-parcelshop', 'dhlpwc-home', 'dhlpwc-home-evening', 'dhlpwc-home-next-day', 'dhlpwc-home-no-neighbour', 'dhlpwc-home-no-neighbour-evening', 'dhlpwc-home-no-neighbour-next-day']; 567 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => { 605 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { 606 const deliveryOptionsElement = document.getElementById('dhlpwc-shipping-method-delivery-options'); 607 if (!deliveryOptionsElement) { 608 return; 609 } 568 610 if (deliveryTimeShippingMethods.indexOf(selectedShippingMethod) !== -1) { 569 d ocument.getElementById('dhlpwc-shipping-method-delivery-options').style.display = "block";611 deliveryOptionsElement.style.display = "block"; 570 612 } else { 571 d ocument.getElementById('dhlpwc-shipping-method-delivery-options').style.display = "none";613 deliveryOptionsElement.style.display = "none"; 572 614 } 573 615 }, [selectedShippingMethod]); 574 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {616 return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", { 575 617 id: "dhlpwc-shipping-method-delivery-options", 576 className: "dhlpwc-shipping-method-delivery-options" 577 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { 578 className: "dhlpwc-delivery-options-header" 579 }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('DHL Delivery options')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_delivery_times__WEBPACK_IMPORTED_MODULE_4__.DeliveryTimes, { 580 postalCode: postalCode, 581 countryCode: countryCode, 582 selectedShippingMethod: selectedShippingMethod 583 }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_servicepoints__WEBPACK_IMPORTED_MODULE_3__.Servicepoints, { 584 postalCode: postalCode, 585 countryCode: countryCode, 586 selectedShippingMethod: selectedShippingMethod, 587 validationClass: validationClass, 588 setValidationClass: setValidationClass 589 }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_same_day__WEBPACK_IMPORTED_MODULE_5__.SameDay, { 590 postalCode: postalCode, 591 countryCode: countryCode, 592 selectedShippingMethod: selectedShippingMethod 593 })); 618 className: "dhlpwc-shipping-method-delivery-options", 619 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", { 620 className: "dhlpwc-delivery-options-header", 621 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('DHL Delivery options') 622 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_delivery_times__WEBPACK_IMPORTED_MODULE_3__.DeliveryTimes, { 623 postalCode: postalCode, 624 countryCode: countryCode, 625 selectedShippingMethod: selectedShippingMethod 626 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_servicepoints__WEBPACK_IMPORTED_MODULE_2__.Servicepoints, { 627 postalCode: postalCode, 628 countryCode: countryCode, 629 selectedShippingMethod: selectedShippingMethod, 630 validationClass: validationClass, 631 setValidationClass: setValidationClass 632 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_same_day__WEBPACK_IMPORTED_MODULE_4__.SameDay, { 633 postalCode: postalCode, 634 countryCode: countryCode, 635 selectedShippingMethod: selectedShippingMethod 636 })] 637 }); 594 638 }; 595 639 })(); -
dhlpwc/trunk/build/view.js.map
r3160499 r3273743 1 {"version":3,"file":"view.js","mappings":";;;;;;;;;;;;;;;;;;;;;; ;AAAwD;AACnB;AACiB;AAE/C,MAAMI,aAAa,GAAIC,KAAK,IAAK;EACpC,IAAI,CAACC,MAAM,CAACC,iBAAiB,CAACC,qBAAqB,EAAE;IACjD,OAAO,EAAE;EACb;EAEA,MAAMC,2BAA2B,GAAG,CAChC,aAAa,EACb,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,kCAAkC,EAClC,mCAAmC,CACtC;EACD,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAGX,4DAAQ,CAAC,CAAC,CAAC,CAAC;EACtD,MAAM,CAACY,YAAY,EAAEC,eAAe,CAAC,GAAGb,4DAAQ,CAAC,EAAE,CAAC;EAEpDC,6DAAS,CAAC,MAAM;IACZ,MAAMa,mBAAmB,GAAGC,QAAQ,CAACC,cAAc,CAAC,8CAA8C,CAAC;IACnG,IAAIP,2BAA2B,CAACQ,OAAO,CAACZ,KAAK,CAACa,sBAAsB,CAAC,KAAK,CAAC,CAAC,EAAE;MAC1EJ,mBAA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sBAAsB,CAAC,CAAC;EAE5B,OAAO+B,oDAAA;IAAKC,EAAE,EAAC,yCAAyC;IAACC,SAAS,EAAC;EAAyC,GACxGF,oDAAA;IAAKE,SAAS,EAAC;EAAgC,GAAEjD,mDAAE,CAAC,sBAAsB,CAAO,CAAC,EAClF+C,oDAAA,CAAC7C,0DAAa;IACVoB,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBP,sBAAsB,EAAEA;EAAuB,CAClD,CAAC,EACF+B,oDAAA,CAACoB,yDAAa;IACV7C,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBP,sBAAsB,EAAEA,sBAAuB;IAC/C6F,eAAe,EAAEA,eAAgB;IACjCP,kBAAkB,EAAEA;EAAmB,CAC1C,CAAC,EACFvD,oDAAA,CAACQ,8CAAO;IACJjC,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBP,sBAAsB,EAAEA;EAAuB,CAClD,CACA,CAAC;AACV,CAAC,C","sources":["webpack://copyright-date-block/./src/delivery-times.js","webpack://copyright-date-block/./src/same-day.js","webpack://copyright-date-block/./src/servicepoints.js","webpack://copyright-date-block/external window \"React\"","webpack://copyright-date-block/external window [\"wp\",\"components\"]","webpack://copyright-date-block/external window [\"wp\",\"data\"]","webpack://copyright-date-block/external window [\"wp\",\"domReady\"]","webpack://copyright-date-block/external window [\"wp\",\"element\"]","webpack://copyright-date-block/external window [\"wp\",\"i18n\"]","webpack://copyright-date-block/webpack/bootstrap","webpack://copyright-date-block/webpack/runtime/compat get default export","webpack://copyright-date-block/webpack/runtime/define property getters","webpack://copyright-date-block/webpack/runtime/hasOwnProperty shorthand","webpack://copyright-date-block/webpack/runtime/make namespace object","webpack://copyright-date-block/./src/view.js"],"sourcesContent":["import { useState, useEffect } from '@wordpress/element'\nimport { __ } from '@wordpress/i18n';\nimport { SelectControl } from '@wordpress/components';\n\nexport const DeliveryTimes = (props) => {\n if (!window.dhlpwc_block_data.deliverytimes_enabled) {\n return ''\n }\n\n const deliveryTimeShippingMethods = [\n 'dhlpwc-home',\n 'dhlpwc-home-evening',\n 'dhlpwc-home-next-day',\n 'dhlpwc-home-no-neighbour',\n 'dhlpwc-home-no-neighbour-evening',\n 'dhlpwc-home-no-neighbour-next-day',\n ]\n const [deliveryTimes, setDeliveryTimes] = useState({});\n const [selectedTime, setSelectedTime] = useState([]);\n\n useEffect(() => {\n const deliveryTimeDetails = document.getElementById('dhlpwc-shipping-method-delivery-times-option')\n if (deliveryTimeShippingMethods.indexOf(props.selectedShippingMethod) !== -1) {\n deliveryTimeDetails.style.display = \"block\";\n // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n const formData = new FormData();\n formData.append('action', 'dhlpwc_get_delivery_times')\n formData.append('shipping_method', props.selectedShippingMethod)\n formData.append('postal_code', props.postalCode)\n formData.append('country_code', props.countryCode)\n fetch(\n window.dhlpwc_block_data['ajax_url'],\n {\n method: 'POST',\n body: formData\n }\n ).then(async response => {\n response = await response.json()\n let parsedDeliveryTimes = [];\n\n Object.values(response.data).forEach((value) => {\n const parsedDeliveryTime = {\n label: `${value.date} (${value.start_time} - ${value.end_time})`,\n value: value.identifier\n }\n parsedDeliveryTimes.push(parsedDeliveryTime)\n })\n setDeliveryTimes(parsedDeliveryTimes)\n // initially set the first selection\n setSelectedTime(parsedDeliveryTimes[0].value.split('___'))\n })\n } else {\n deliveryTimeDetails.style.display = \"none\"\n setSelectedTime([])\n }\n }, [props.postalCode, props.countryCode, props.selectedShippingMethod])\n\n useEffect(() => {\n // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n const formData = new FormData();\n formData.append('action', 'dhlpwc_delivery_time_selection_sync')\n\n formData.append('selected', true)\n formData.append('date', selectedTime[0] ?? '')\n formData.append('start_time', selectedTime[1] ?? '')\n formData.append('end_time', selectedTime[2] ?? '')\n\n fetch(\n window.dhlpwc_block_data['ajax_url'],\n {\n method: 'POST',\n body: formData\n }\n )\n }, [selectedTime])\n\n return <div id='dhlpwc-shipping-method-delivery-times-option'\n className='dhlpwc-shipping-method-delivery-times-option'>\n <div className=\"dhlpwc-delivery-times-selection-header\">{__('DHL Delivery Times options')}</div>\n <span className=\"dhlpwc-delivery-times-selection-text\">{__('Desired delivery moment:')}</span>\n <SelectControl\n hideLabelFromVision='true'\n className='dhlpwc-delivery-times-selection-input'\n label={__('Select desired delivery moment')}\n value={selectedTime.join('___')}\n options={deliveryTimes}\n onChange={(deliveryTime) => setSelectedTime(deliveryTime.split('___'))}\n />\n </div>\n};\n","import { useEffect } from '@wordpress/element'\n\nexport const SameDay = (props) => {\n if (window.dhlpwc_block_data.sdd_as_time_window) {\n const sameDayElement = document.getElementById('radio-control-0-dhlpwc-home-same-day');\n if (sameDayElement) {\n sameDayElement.parentElement.style.display = \"none\";\n }\n\n const sameDayNoNeighborElement = document.getElementById('radio-control-0-dhlpwc-home-no-neighbour-same-day');\n if (sameDayNoNeighborElement) {\n sameDayNoNeighborElement.parentElement.style.display = \"none\";\n }\n }\n\n const sameDayDeliveryMethods = [\n 'dhlpwc-home-same-day',\n 'dhlpwc-home-no-neighbour-same-day'\n ]\n\n useEffect(() => {\n if (sameDayDeliveryMethods.indexOf(props.selectedShippingMethod) !== -1) {\n // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n const formData = new FormData();\n formData.append('action', 'dhlpwc_get_delivery_times')\n formData.append('shipping_method', props.selectedShippingMethod)\n formData.append('postal_code', props.postalCode)\n formData.append('country_code', props.countryCode)\n fetch(\n window.dhlpwc_block_data['ajax_url'],\n {\n method: 'POST',\n body: formData\n }\n ).then(async response => {\n response = await response.json()\n const sameDayDeliveryTime = response.data[0]['identifier'].split('___')\n const formData = new FormData();\n formData.append('action', 'dhlpwc_delivery_time_selection_sync')\n\n formData.append('selected', true)\n formData.append('date', sameDayDeliveryTime[0] ?? '')\n formData.append('start_time', sameDayDeliveryTime[1] ?? '')\n formData.append('end_time', sameDayDeliveryTime[2] ?? '')\n\n fetch(\n window.dhlpwc_block_data['ajax_url'],\n {\n method: 'POST',\n body: formData\n }\n )\n })\n }\n }, [props.postalCode, props.countryCode, props.selectedShippingMethod]);\n};\n","import { useState, useEffect } from '@wordpress/element'\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\nexport const Servicepoints = (props) => {\n const VALIDATION_ERROR_PARCELSHOP_EMPTY = 'validation-error-parcelshop-empty'\n const getValidationError = useSelect((select) => {\n const store = select('wc/store/validation');\n\n return store.getValidationError( VALIDATION_ERROR_PARCELSHOP_EMPTY );\n });\n const [parcelshop, setParcelshop] = useState({})\n\n // Only run this once, intentionally no dependencies given\n useEffect(() => {\n const script = document.createElement('script')\n script.src = 'https://static.dhlecommerce.nl/components/servicepoint-locator-component@latest/servicepoint-locator-component.js'\n script.async = true\n script.onload = () => loadModal()\n\n document.body.appendChild(script)\n }, [])\n\n const loadModal = () => {\n var options = {\n language: window.dhlpwc_block_data['language'],\n country: window.dhlpwc_block_data['country_code'] ?? '',\n limit: window.dhlpwc_block_data['limit'],\n googleMapsApiKey: window.dhlpwc_block_data['google_maps_key'],\n header: false,\n resizable: true,\n onSelect: (parcelshop) => {\n setParcelshop(parcelshop)\n },\n filter: {\n serviceType: 'pick-up'\n }\n }\n\n window.dhlparcel_shipping_servicepoint_locator = new dhl.servicepoint.Locator(document.getElementById('dhl-servicepoint-locator-component'), options)\n\n // Hide the parcelshop element when parcelshop is not selected\n const parcelshopDetails = document.getElementById('dhlpwc-shipping-method-parcelshop-option')\n if (props.selectedShippingMethod === 'dhlpwc-parcelshop') {\n parcelshopDetails.style.display = 'block'\n } else {\n parcelshopDetails.style.display = 'none'\n }\n\n // Hide the modal when clicking the X button\n document.getElementById('dhlpwc-modal-close').onclick = () => {\n document.getElementById('dhlpwc-servicepoint-modal').style.display = 'none'\n }\n\n // Set background image dynamically\n document.getElementById('dhlpwc-modal-content').style['background-image'] = 'url(' + window.dhlpwc_block_data['modal_background'] + ')'\n }\n\n /**\n * Set the initial parcelshop based on postalCode or countryCode\n */\n useEffect(() => {\n const parcelshopDetails = document.getElementById('dhlpwc-shipping-method-parcelshop-option')\n if (props.selectedShippingMethod === 'dhlpwc-parcelshop') {\n parcelshopDetails.style.display = 'block'\n\n // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n const formData = new FormData();\n formData.append('action', 'dhlpwc_get_initial_parcelshop')\n formData.append('postal_code', props.postalCode)\n formData.append('country_code', props.countryCode)\n fetch(\n window.dhlpwc_block_data['ajax_url'],\n {\n method: 'POST',\n body: formData\n }\n ).then(async response => {\n response = await response.json()\n\n if (response.data?.parcelshop) {\n setParcelshop(response.data.parcelshop)\n } else {\n setParcelshop({})\n }\n })\n } else {\n parcelshopDetails.style.display = 'none'\n setParcelshop({})\n }\n }, [props.postalCode, props.selectedShippingMethod])\n\n const { setValidationErrors, clearValidationError } = useDispatch(\n 'wc/store/validation'\n );\n\n /**\n * Sync the parcelshop (or lack of) with frontend elements and the backend\n *\n * @param parcelshop\n */\n useEffect( () => {\n document.getElementById('dhlpwc-servicepoint-modal').style.display = 'none'\n\n // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n const formData = new FormData();\n formData.append('action', 'dhlpwc_parcelshop_selection_sync')\n if (Object.keys(parcelshop).length !== 0 || props.selectedShippingMethod !== 'dhlpwc-parcelshop') {\n props.setValidationClass('dhlpwc_notice')\n formData.append('parcelshop_id', parcelshop['id'] ?? '')\n formData.append('country_code', props.countryCode)\n if ( getValidationError ) {\n clearValidationError( VALIDATION_ERROR_PARCELSHOP_EMPTY );\n }\n } else {\n props.setValidationClass('dhlpwc-servicepoint-error')\n setValidationErrors( {\n [ VALIDATION_ERROR_PARCELSHOP_EMPTY ]: {\n message: __( 'Please add some text', 'shipping-workshop' ),\n hidden: true,\n },\n } );\n }\n\n fetch(\n window.dhlpwc_block_data['ajax_url'],\n {\n method: 'POST',\n body: formData\n }\n )\n }, [parcelshop]);\n\n /**\n * Show the parcelshop selector\n */\n const showModal = () => {\n if (props.postalCode === '') {\n document.getElementById('shipping-postcode').value\n }\n\n const modal = document.getElementById('dhlpwc-servicepoint-modal')\n modal.style.display = 'block'\n\n if (typeof window.dhlparcel_shipping_servicepoint_locator !== 'undefined') {\n window.dhlparcel_shipping_servicepoint_locator.setCountry(props.countryCode)\n window.dhlparcel_shipping_servicepoint_locator.setQuery(props.postalCode)\n }\n }\n\n return <div id='dhlpwc-shipping-method-parcelshop-option' className='dhlpwc-shipping-method-parcelshop-option'>\n <span className=\"dhlpwc-parcelshop-selection-text\">{__('The following ServicePoint is selected:')}</span>\n <span className={`dhlpwc-parcelshop-option-message ${props.validationClass}`}>{parcelshop.name ?? __('⚠ No location selected.')}</span>\n <span className={`dhlpwc-parcelshop-option-message ${props.validationClass}`}>{parcelshop?.address?.postal_code} {parcelshop?.address?.city}</span>\n <span className={`dhlpwc-parcelshop-option-message ${props.validationClass}`}>{parcelshop?.address?.street} {parcelshop?.address?.number} {parcelshop?.address?.addition}</span>\n\n <input type='button' className='dhlpwc-parcelshop-option-change' value='Change' onClick={() => showModal()}/>\n </div>\n};\n","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"domReady\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import domReady from '@wordpress/dom-ready'\nimport { render, useEffect } from '@wordpress/element'\nimport { Servicepoints } from \"./servicepoints\";\nimport { DeliveryTimes } from \"./delivery-times\";\nimport { SameDay } from \"./same-day\";\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element'\n\ndomReady(async function () {\n const getElementByIdAsync = id => new Promise(resolve => {\n const getElement = () => {\n const element = document.getElementById(id)\n if(element) {\n resolve(element)\n } else {\n requestAnimationFrame(getElement)\n }\n };\n getElement()\n });\n\n const container = await getElementByIdAsync('dhlpwc-app')\n render(<App/>, container)\n})\n\nexport const App = () => {\n const [postalCode, setPostalCode] = useState(window.dhlpwc_block_data['postal_code'])\n const [countryCode, setCountryCode] = useState(window.dhlpwc_block_data['country_code'])\n const [selectedShippingMethod, setSelectedShippingMethod] = useState(window.dhlpwc_block_data['initial_shipping_method'])\n const [validationClass, setValidationClass] = useState('dhlpwc_warning')\n\n // Only run this once, intentionally no dependencies given\n useEffect(()=>{\n\n // Track selected shipping method\n document.addEventListener( \"change\", trackSelectedShippingMethod );\n function trackSelectedShippingMethod(event){\n let element = event.target;\n if (element.name === 'radio-control-0') {\n setSelectedShippingMethod(event.target.value)\n }\n }\n\n /**\n * Create observer for when shipping methods fundamentally change (WooCommerce does not call the Change method)\n * We observe the parent of the radio buttons. When a shipping methods gets added or removed, we update the selectedShippingMethod\n */\n const observer = new MutationObserver((mutationList) => {\n for (const mutation of mutationList) {\n if (mutation.type === \"childList\") {\n setSelectedShippingMethod(document.getElementsByName('radio-control-0')[0].value)\n }\n }\n });\n observer.observe(document.getElementsByName('radio-control-0')[0].parentElement.parentElement, {childList: true});\n\n\n // TODO find a better method to retrieve address data instead of observing requests\n const nativeFetch = window.fetch\n window.fetch = function(...args) {\n let isWantedCall = false\n const urlParams = new URLSearchParams(args[0])\n urlParams.forEach(function (param) {\n if (isWantedCall) {\n return\n }\n\n if (param.includes('batch')) {\n isWantedCall = true\n }\n });\n\n if (!isWantedCall) {\n return nativeFetch.apply(window, args);\n }\n\n JSON.parse(args[1].body).requests.forEach((request) => {\n if (request.path.includes('update-customer')) {\n if (typeof request.body.shipping_address.country !== 'undefined') {\n setCountryCode(request.body.shipping_address.country)\n }\n\n if (typeof request.body.shipping_address.postcode !== 'undefined') {\n setPostalCode(request.body.shipping_address.postcode);\n }\n }\n })\n\n return nativeFetch.apply(window, args);\n }\n }, [])\n\n const deliveryTimeShippingMethods = [\n 'dhlpwc-parcelshop',\n 'dhlpwc-home',\n 'dhlpwc-home-evening',\n 'dhlpwc-home-next-day',\n 'dhlpwc-home-no-neighbour',\n 'dhlpwc-home-no-neighbour-evening',\n 'dhlpwc-home-no-neighbour-next-day',\n ]\n\n useEffect(() => {\n if (deliveryTimeShippingMethods.indexOf(selectedShippingMethod) !== -1) {\n document.getElementById('dhlpwc-shipping-method-delivery-options').style.display = \"block\"\n } else {\n document.getElementById('dhlpwc-shipping-method-delivery-options').style.display = \"none\"\n }\n }, [selectedShippingMethod])\n\n return <div id='dhlpwc-shipping-method-delivery-options' className='dhlpwc-shipping-method-delivery-options'>\n <div className=\"dhlpwc-delivery-options-header\">{__('DHL Delivery options')}</div>\n <DeliveryTimes\n postalCode={postalCode}\n countryCode={countryCode}\n selectedShippingMethod={selectedShippingMethod}\n />\n <Servicepoints\n postalCode={postalCode}\n countryCode={countryCode}\n selectedShippingMethod={selectedShippingMethod}\n validationClass={validationClass}\n setValidationClass={setValidationClass}\n />\n <SameDay\n postalCode={postalCode}\n countryCode={countryCode}\n selectedShippingMethod={selectedShippingMethod}\n />\n </div>\n}\n"],"names":["useState","useEffect","__","SelectControl","DeliveryTimes","props","window","dhlpwc_block_data","deliverytimes_enabled","deliveryTimeShippingMethods","deliveryTimes","setDeliveryTimes","selectedTime","setSelectedTime","deliveryTimeDetails","document","getElementById","indexOf","selectedShippingMethod","style","display","formData","FormData","append","postalCode","countryCode","fetch","method","body","then","response","json","parsedDeliveryTimes","Object","values","data","forEach","value","parsedDeliveryTime","label","date","start_time","end_time","identifier","push","split","_selectedTime$","_selectedTime$2","_selectedTime$3","createElement","id","className","hideLabelFromVision","join","options","onChange","deliveryTime","SameDay","sdd_as_time_window","sameDayElement","parentElement","sameDayNoNeighborElement","sameDayDeliveryMethods","_sameDayDeliveryTime$","_sameDayDeliveryTime$2","_sameDayDeliveryTime$3","sameDayDeliveryTime","useDispatch","useSelect","Servicepoints","_parcelshop$name","VALIDATION_ERROR_PARCELSHOP_EMPTY","getValidationError","select","store","parcelshop","setParcelshop","script","src","async","onload","loadModal","appendChild","_window$dhlpwc_block_","language","country","limit","googleMapsApiKey","header","resizable","onSelect","filter","serviceType","dhlparcel_shipping_servicepoint_locator","dhl","servicepoint","Locator","parcelshopDetails","onclick","setValidationErrors","clearValidationError","keys","length","_parcelshop$id","setValidationClass","message","hidden","showModal","modal","setCountry","setQuery","validationClass","name","address","postal_code","city","street","number","addition","type","onClick","domReady","render","getElementByIdAsync","Promise","resolve","getElement","element","requestAnimationFrame","container","App","setPostalCode","setCountryCode","setSelectedShippingMethod","addEventListener","trackSelectedShippingMethod","event","target","observer","MutationObserver","mutationList","mutation","getElementsByName","observe","childList","nativeFetch","args","isWantedCall","urlParams","URLSearchParams","param","includes","apply","JSON","parse","requests","request","path","shipping_address","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IAAuB,CAClD,CAAC,eACFjB,sDAAA,CAACoE,yDAAa;MACV7C,UAAU,EAAEA,UAAW;MACvBC,WAAW,EAAEA,WAAY;MACzBP,sBAAsB,EAAEA,sBAAuB;MAC/CkG,eAAe,EAAEA,eAAgB;MACjCP,kBAAkB,EAAEA;IAAmB,CAC1C,CAAC,eACF5G,sDAAA,CAACwD,8CAAO;MACJjC,UAAU,EAAEA,UAAW;MACvBC,WAAW,EAAEA,WAAY;MACzBP,sBAAsB,EAAEA;IAAuB,CAClD,CAAC;EAAA,CACD,CAAC;AACV,CAAC,C","sources":["webpack://copyright-date-block/./src/delivery-times.js","webpack://copyright-date-block/./src/same-day.js","webpack://copyright-date-block/./src/servicepoints.js","webpack://copyright-date-block/external window [\"wp\",\"components\"]","webpack://copyright-date-block/external window [\"wp\",\"data\"]","webpack://copyright-date-block/external window [\"wp\",\"domReady\"]","webpack://copyright-date-block/external window [\"wp\",\"element\"]","webpack://copyright-date-block/external window [\"wp\",\"i18n\"]","webpack://copyright-date-block/external window \"ReactJSXRuntime\"","webpack://copyright-date-block/webpack/bootstrap","webpack://copyright-date-block/webpack/runtime/compat get default export","webpack://copyright-date-block/webpack/runtime/define property getters","webpack://copyright-date-block/webpack/runtime/hasOwnProperty shorthand","webpack://copyright-date-block/webpack/runtime/make namespace object","webpack://copyright-date-block/./src/view.js"],"sourcesContent":["import { useState, useEffect } from '@wordpress/element'\r\nimport { __ } from '@wordpress/i18n';\r\nimport { SelectControl } from '@wordpress/components';\r\n\r\nexport const DeliveryTimes = (props) => {\r\n if (!window.dhlpwc_block_data.deliverytimes_enabled) {\r\n return ''\r\n }\r\n\r\n const deliveryTimeShippingMethods = [\r\n 'dhlpwc-home',\r\n 'dhlpwc-home-evening',\r\n 'dhlpwc-home-next-day',\r\n 'dhlpwc-home-no-neighbour',\r\n 'dhlpwc-home-no-neighbour-evening',\r\n 'dhlpwc-home-no-neighbour-next-day',\r\n ]\r\n const [deliveryTimes, setDeliveryTimes] = useState({});\r\n const [selectedTime, setSelectedTime] = useState([]);\r\n\r\n useEffect(() => {\r\n const deliveryTimeDetails = document.getElementById('dhlpwc-shipping-method-delivery-times-option')\r\n if (deliveryTimeDetails === null) {\r\n return\r\n }\r\n if (deliveryTimeShippingMethods.indexOf(props.selectedShippingMethod) !== -1) {\r\n deliveryTimeDetails.style.display = \"block\";\r\n // Wordpress doesn't like it when we post raw data, so we post it as a form instead\r\n const formData = new FormData();\r\n formData.append('action', 'dhlpwc_get_delivery_times')\r\n formData.append('shipping_method', props.selectedShippingMethod)\r\n formData.append('postal_code', props.postalCode)\r\n formData.append('country_code', props.countryCode)\r\n fetch(\r\n window.dhlpwc_block_data['ajax_url'],\r\n {\r\n method: 'POST',\r\n body: formData\r\n }\r\n ).then(async response => {\r\n response = await response.json()\r\n let parsedDeliveryTimes = [];\r\n\r\n Object.values(response.data).forEach((value) => {\r\n const parsedDeliveryTime = {\r\n label: `${value.date} (${value.start_time} - ${value.end_time})`,\r\n value: value.identifier\r\n }\r\n parsedDeliveryTimes.push(parsedDeliveryTime)\r\n })\r\n setDeliveryTimes(parsedDeliveryTimes)\r\n // initially set the first selection\r\n if (typeof parsedDeliveryTimes[0] !== \"undefined\")\r\n setSelectedTime(parsedDeliveryTimes[0].value.split('___'))\r\n })\r\n } else {\r\n deliveryTimeDetails.style.display = \"none\"\r\n setSelectedTime([])\r\n }\r\n }, [props.postalCode, props.countryCode, props.selectedShippingMethod])\r\n\r\n useEffect(() => {\r\n // Wordpress doesn't like it when we post raw data, so we post it as a form instead\r\n const formData = new FormData();\r\n formData.append('action', 'dhlpwc_delivery_time_selection_sync')\r\n\r\n formData.append('selected', true)\r\n formData.append('date', selectedTime[0] ?? '')\r\n formData.append('start_time', selectedTime[1] ?? '')\r\n formData.append('end_time', selectedTime[2] ?? '')\r\n\r\n fetch(\r\n window.dhlpwc_block_data['ajax_url'],\r\n {\r\n method: 'POST',\r\n body: formData\r\n }\r\n )\r\n }, [selectedTime])\r\n\r\n return <div id='dhlpwc-shipping-method-delivery-times-option'\r\n className='dhlpwc-shipping-method-delivery-times-option'>\r\n <div className=\"dhlpwc-delivery-times-selection-header\">{__('DHL Delivery Times options')}</div>\r\n <span className=\"dhlpwc-delivery-times-selection-text\">{__('Desired delivery moment:')}</span>\r\n <SelectControl\r\n hideLabelFromVision='true'\r\n className='dhlpwc-delivery-times-selection-input'\r\n label={__('Select desired delivery moment')}\r\n value={selectedTime.join('___')}\r\n options={deliveryTimes}\r\n onChange={(deliveryTime) => setSelectedTime(deliveryTime.split('___'))}\r\n />\r\n </div>\r\n};\r\n","import { useEffect } from '@wordpress/element'\r\n\r\nexport const SameDay = (props) => {\r\n if (window.dhlpwc_block_data.sdd_as_time_window) {\r\n const sameDayElement = document.getElementById('radio-control-0-dhlpwc-home-same-day');\r\n if (sameDayElement) {\r\n sameDayElement.parentElement.style.display = \"none\";\r\n }\r\n\r\n const sameDayNoNeighborElement = document.getElementById('radio-control-0-dhlpwc-home-no-neighbour-same-day');\r\n if (sameDayNoNeighborElement) {\r\n sameDayNoNeighborElement.parentElement.style.display = \"none\";\r\n }\r\n }\r\n\r\n const sameDayDeliveryMethods = [\r\n 'dhlpwc-home-same-day',\r\n 'dhlpwc-home-no-neighbour-same-day'\r\n ]\r\n\r\n useEffect(() => {\r\n if (sameDayDeliveryMethods.indexOf(props.selectedShippingMethod) !== -1) {\r\n // Wordpress doesn't like it when we post raw data, so we post it as a form instead\r\n const formData = new FormData();\r\n formData.append('action', 'dhlpwc_get_delivery_times')\r\n formData.append('shipping_method', props.selectedShippingMethod)\r\n formData.append('postal_code', props.postalCode)\r\n formData.append('country_code', props.countryCode)\r\n fetch(\r\n window.dhlpwc_block_data['ajax_url'],\r\n {\r\n method: 'POST',\r\n body: formData\r\n }\r\n ).then(async response => {\r\n response = await response.json()\r\n const sameDayDeliveryTime = response.data[0]['identifier'].split('___')\r\n const formData = new FormData();\r\n formData.append('action', 'dhlpwc_delivery_time_selection_sync')\r\n\r\n formData.append('selected', true)\r\n formData.append('date', sameDayDeliveryTime[0] ?? '')\r\n formData.append('start_time', sameDayDeliveryTime[1] ?? '')\r\n formData.append('end_time', sameDayDeliveryTime[2] ?? '')\r\n\r\n fetch(\r\n window.dhlpwc_block_data['ajax_url'],\r\n {\r\n method: 'POST',\r\n body: formData\r\n }\r\n )\r\n })\r\n }\r\n }, [props.postalCode, props.countryCode, props.selectedShippingMethod]);\r\n};\r\n","import { useState, useEffect } from '@wordpress/element'\r\nimport { __ } from '@wordpress/i18n';\r\nimport { useDispatch, useSelect } from '@wordpress/data';\r\n\r\nexport const Servicepoints = (props) => {\r\n const VALIDATION_ERROR_PARCELSHOP_EMPTY = 'validation-error-parcelshop-empty'\r\n const getValidationError = useSelect((select) => {\r\n const store = select('wc/store/validation');\r\n\r\n return store.getValidationError( VALIDATION_ERROR_PARCELSHOP_EMPTY );\r\n });\r\n const [parcelshop, setParcelshop] = useState({})\r\n\r\n // Only run this once, intentionally no dependencies given\r\n useEffect(() => {\r\n const script = document.createElement('script')\r\n script.src = 'https://static.dhlecommerce.nl/components/servicepoint-locator-component@latest/servicepoint-locator-component.js'\r\n script.async = true\r\n script.onload = () => loadModal()\r\n\r\n document.body.appendChild(script)\r\n }, [])\r\n\r\n const loadModal = () => {\r\n var options = {\r\n language: window.dhlpwc_block_data['language'],\r\n country: window.dhlpwc_block_data['country_code'] ?? '',\r\n limit: window.dhlpwc_block_data['limit'],\r\n googleMapsApiKey: window.dhlpwc_block_data['google_maps_key'],\r\n header: false,\r\n resizable: true,\r\n onSelect: (parcelshop) => {\r\n setParcelshop(parcelshop)\r\n },\r\n filter: {\r\n serviceType: 'pick-up'\r\n }\r\n }\r\n\r\n const servicePointElement = document.getElementById('dhl-servicepoint-locator-component')\r\n if (servicePointElement === null) {\r\n return\r\n }\r\n window.dhlparcel_shipping_servicepoint_locator = new dhl.servicepoint.Locator(servicePointElement, options)\r\n\r\n // Hide the parcelshop element when parcelshop is not selected\r\n const parcelshopDetails = document.getElementById('dhlpwc-shipping-method-parcelshop-option')\r\n if (parcelshopDetails !== null) {\r\n if (props.selectedShippingMethod === 'dhlpwc-parcelshop') {\r\n parcelshopDetails.style.display = 'block'\r\n } else {\r\n parcelshopDetails.style.display = 'none'\r\n }\r\n }\r\n\r\n // Hide the modal when clicking the X button\r\n const modalCloseElement = document.getElementById('dhlpwc-modal-close')\r\n if (modalCloseElement !== null) {\r\n modalCloseElement.onclick = () => {\r\n const ServicePointModalElement = document.getElementById('dhlpwc-servicepoint-modal')\r\n if (ServicePointModalElement)\r\n ServicePointModalElement.style.display = 'none'\r\n }\r\n }\r\n\r\n // Set background image dynamically\r\n const modalContentElement = document.getElementById('dhlpwc-modal-content')\r\n if (modalContentElement !== null)\r\n modalContentElement.style['background-image'] = 'url(' + window.dhlpwc_block_data['modal_background'] + ')'\r\n }\r\n\r\n /**\r\n * Set the initial parcelshop based on postalCode or countryCode\r\n */\r\n useEffect(() => {\r\n const parcelshopDetails = document.getElementById('dhlpwc-shipping-method-parcelshop-option')\r\n if (parcelshopDetails === null) {\r\n return\r\n }\r\n\r\n if (props.selectedShippingMethod === 'dhlpwc-parcelshop') {\r\n parcelshopDetails.style.display = 'block'\r\n\r\n // Wordpress doesn't like it when we post raw data, so we post it as a form instead\r\n const formData = new FormData();\r\n formData.append('action', 'dhlpwc_get_initial_parcelshop')\r\n formData.append('postal_code', props.postalCode)\r\n formData.append('country_code', props.countryCode)\r\n fetch(\r\n window.dhlpwc_block_data['ajax_url'],\r\n {\r\n method: 'POST',\r\n body: formData\r\n }\r\n ).then(async response => {\r\n response = await response.json()\r\n\r\n if (response.data?.parcelshop) {\r\n setParcelshop(response.data.parcelshop)\r\n } else {\r\n setParcelshop({})\r\n }\r\n })\r\n } else {\r\n parcelshopDetails.style.display = 'none'\r\n setParcelshop({})\r\n }\r\n }, [props.postalCode, props.selectedShippingMethod])\r\n\r\n const { setValidationErrors, clearValidationError } = useDispatch(\r\n 'wc/store/validation'\r\n );\r\n\r\n /**\r\n * Sync the parcelshop (or lack of) with frontend elements and the backend\r\n *\r\n * @param parcelshop\r\n */\r\n useEffect( () => {\r\n const ServicePointModalElement = document.getElementById('dhlpwc-servicepoint-modal')\r\n if (ServicePointModalElement === null) {\r\n return\r\n }\r\n ServicePointModalElement.style.display = 'none'\r\n\r\n // Wordpress doesn't like it when we post raw data, so we post it as a form instead\r\n const formData = new FormData();\r\n formData.append('action', 'dhlpwc_parcelshop_selection_sync')\r\n if (Object.keys(parcelshop).length !== 0 || props.selectedShippingMethod !== 'dhlpwc-parcelshop') {\r\n props.setValidationClass('dhlpwc_notice')\r\n formData.append('parcelshop_id', parcelshop['id'] ?? '')\r\n formData.append('country_code', props.countryCode)\r\n if ( getValidationError ) {\r\n clearValidationError( VALIDATION_ERROR_PARCELSHOP_EMPTY );\r\n }\r\n } else {\r\n props.setValidationClass('dhlpwc-servicepoint-error')\r\n setValidationErrors( {\r\n [ VALIDATION_ERROR_PARCELSHOP_EMPTY ]: {\r\n message: __( 'Please add some text', 'shipping-workshop' ),\r\n hidden: true,\r\n },\r\n } );\r\n }\r\n\r\n fetch(\r\n window.dhlpwc_block_data['ajax_url'],\r\n {\r\n method: 'POST',\r\n body: formData\r\n }\r\n )\r\n }, [parcelshop]);\r\n\r\n /**\r\n * Show the parcelshop selector\r\n */\r\n const showModal = () => {\r\n if (props.postalCode === '') {\r\n document.getElementById('shipping-postcode').value\r\n }\r\n\r\n const modal = document.getElementById('dhlpwc-servicepoint-modal')\r\n if (modal !== null) {\r\n modal.style.display = 'block'\r\n }\r\n\r\n if (typeof window.dhlparcel_shipping_servicepoint_locator !== 'undefined') {\r\n window.dhlparcel_shipping_servicepoint_locator.setCountry(props.countryCode)\r\n window.dhlparcel_shipping_servicepoint_locator.setQuery(props.postalCode)\r\n }\r\n }\r\n\r\n return <div id='dhlpwc-shipping-method-parcelshop-option' className='dhlpwc-shipping-method-parcelshop-option'>\r\n <span className=\"dhlpwc-parcelshop-selection-text\">{__('The following ServicePoint is selected:')}</span>\r\n <span className={`dhlpwc-parcelshop-option-message ${props.validationClass}`}>{parcelshop.name ?? __('⚠ No location selected.')}</span>\r\n <span className={`dhlpwc-parcelshop-option-message ${props.validationClass}`}>{parcelshop?.address?.postal_code} {parcelshop?.address?.city}</span>\r\n <span className={`dhlpwc-parcelshop-option-message ${props.validationClass}`}>{parcelshop?.address?.street} {parcelshop?.address?.number} {parcelshop?.address?.addition}</span>\r\n\r\n <input type='button' className='dhlpwc-parcelshop-option-change' value='Change' onClick={() => showModal()}/>\r\n </div>\r\n};\r\n","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"domReady\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"ReactJSXRuntime\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import domReady from '@wordpress/dom-ready'\r\nimport { render, useEffect } from '@wordpress/element'\r\nimport { Servicepoints } from \"./servicepoints\";\r\nimport { DeliveryTimes } from \"./delivery-times\";\r\nimport { SameDay } from \"./same-day\";\r\nimport { __ } from '@wordpress/i18n';\r\nimport { useState } from '@wordpress/element'\r\n\r\ndomReady(async function () {\r\n const getElementByIdAsync = id => new Promise(resolve => {\r\n const getElement = () => {\r\n const element = document.getElementById(id)\r\n if(element) {\r\n resolve(element)\r\n } else {\r\n requestAnimationFrame(getElement)\r\n }\r\n };\r\n getElement()\r\n });\r\n\r\n const container = await getElementByIdAsync('dhlpwc-app')\r\n render(<App/>, container)\r\n})\r\n\r\nexport const App = () => {\r\n const [postalCode, setPostalCode] = useState(window.dhlpwc_block_data['postal_code'])\r\n const [countryCode, setCountryCode] = useState(window.dhlpwc_block_data['country_code'])\r\n const [selectedShippingMethod, setSelectedShippingMethod] = useState(window.dhlpwc_block_data['initial_shipping_method'])\r\n const [validationClass, setValidationClass] = useState('dhlpwc_warning')\r\n\r\n // Only run this once, intentionally no dependencies given\r\n useEffect(()=>{\r\n\r\n // Track selected shipping method\r\n document.addEventListener( \"change\", trackSelectedShippingMethod );\r\n function trackSelectedShippingMethod(event){\r\n let element = event.target;\r\n if (element.name === 'radio-control-0') {\r\n setSelectedShippingMethod(event.target.value)\r\n }\r\n }\r\n\r\n /**\r\n * Create observer for when shipping methods fundamentally change (WooCommerce does not call the Change method)\r\n * We observe the parent of the radio buttons. When a shipping methods gets added or removed, we update the selectedShippingMethod\r\n */\r\n const observer = new MutationObserver((mutationList) => {\r\n for (const mutation of mutationList) {\r\n if (mutation.type === \"childList\") {\r\n let radioControlElement = document.getElementsByName('radio-control-0')\r\n if (typeof radioControlElement !== \"undefined\" && typeof radioControlElement[0] !== \"undefined\" && typeof radioControlElement[0].value !== \"undefined\") {\r\n setSelectedShippingMethod(radioControlElement[0].value)\r\n }\r\n }\r\n }\r\n });\r\n const radioControlElement = document.getElementsByName('radio-control-0')\r\n // TODO clean up check\r\n if (typeof radioControlElement !== \"undefined\" && typeof radioControlElement[0] !== \"undefined\" && typeof radioControlElement[0].parentElement !== \"undefined\" && typeof radioControlElement[0].parentElement.parentElement !== \"undefined\") {\r\n observer.observe(radioControlElement[0].parentElement.parentElement, {childList: true});\r\n }\r\n\r\n // TODO find a better method to retrieve address data instead of observing requests\r\n const nativeFetch = window.fetch\r\n window.fetch = function(...args) {\r\n let isWantedCall = false\r\n const urlParams = new URLSearchParams(args[0])\r\n urlParams.forEach(function (param) {\r\n if (isWantedCall) {\r\n return\r\n }\r\n\r\n if (param.includes('batch')) {\r\n isWantedCall = true\r\n }\r\n });\r\n\r\n if (!isWantedCall) {\r\n return nativeFetch.apply(window, args);\r\n }\r\n\r\n JSON.parse(args[1].body).requests.forEach((request) => {\r\n if (request.path.includes('update-customer')) {\r\n if (typeof request.body.shipping_address.country !== 'undefined') {\r\n setCountryCode(request.body.shipping_address.country)\r\n }\r\n\r\n if (typeof request.body.shipping_address.postcode !== 'undefined') {\r\n setPostalCode(request.body.shipping_address.postcode);\r\n }\r\n }\r\n })\r\n\r\n return nativeFetch.apply(window, args);\r\n }\r\n }, [])\r\n\r\n const deliveryTimeShippingMethods = [\r\n 'dhlpwc-parcelshop',\r\n 'dhlpwc-home',\r\n 'dhlpwc-home-evening',\r\n 'dhlpwc-home-next-day',\r\n 'dhlpwc-home-no-neighbour',\r\n 'dhlpwc-home-no-neighbour-evening',\r\n 'dhlpwc-home-no-neighbour-next-day',\r\n ]\r\n\r\n useEffect(() => {\r\n const deliveryOptionsElement = document.getElementById('dhlpwc-shipping-method-delivery-options')\r\n if (!deliveryOptionsElement) {\r\n return\r\n }\r\n if (deliveryTimeShippingMethods.indexOf(selectedShippingMethod) !== -1) {\r\n deliveryOptionsElement.style.display = \"block\"\r\n } else {\r\n deliveryOptionsElement.style.display = \"none\"\r\n }\r\n }, [selectedShippingMethod])\r\n\r\n return <div id='dhlpwc-shipping-method-delivery-options' className='dhlpwc-shipping-method-delivery-options'>\r\n <div className=\"dhlpwc-delivery-options-header\">{__('DHL Delivery options')}</div>\r\n <DeliveryTimes\r\n postalCode={postalCode}\r\n countryCode={countryCode}\r\n selectedShippingMethod={selectedShippingMethod}\r\n />\r\n <Servicepoints\r\n postalCode={postalCode}\r\n countryCode={countryCode}\r\n selectedShippingMethod={selectedShippingMethod}\r\n validationClass={validationClass}\r\n setValidationClass={setValidationClass}\r\n />\r\n <SameDay\r\n postalCode={postalCode}\r\n countryCode={countryCode}\r\n selectedShippingMethod={selectedShippingMethod}\r\n />\r\n </div>\r\n}\r\n"],"names":["useState","useEffect","__","SelectControl","jsx","_jsx","jsxs","_jsxs","DeliveryTimes","props","window","dhlpwc_block_data","deliverytimes_enabled","deliveryTimeShippingMethods","deliveryTimes","setDeliveryTimes","selectedTime","setSelectedTime","deliveryTimeDetails","document","getElementById","indexOf","selectedShippingMethod","style","display","formData","FormData","append","postalCode","countryCode","fetch","method","body","then","response","json","parsedDeliveryTimes","Object","values","data","forEach","value","parsedDeliveryTime","label","date","start_time","end_time","identifier","push","split","_selectedTime$","_selectedTime$2","_selectedTime$3","id","className","children","hideLabelFromVision","join","options","onChange","deliveryTime","SameDay","sdd_as_time_window","sameDayElement","parentElement","sameDayNoNeighborElement","sameDayDeliveryMethods","_sameDayDeliveryTime$","_sameDayDeliveryTime$2","_sameDayDeliveryTime$3","sameDayDeliveryTime","useDispatch","useSelect","Servicepoints","_parcelshop$name","VALIDATION_ERROR_PARCELSHOP_EMPTY","getValidationError","select","store","parcelshop","setParcelshop","script","createElement","src","async","onload","loadModal","appendChild","_window$dhlpwc_block_","language","country","limit","googleMapsApiKey","header","resizable","onSelect","filter","serviceType","servicePointElement","dhlparcel_shipping_servicepoint_locator","dhl","servicepoint","Locator","parcelshopDetails","modalCloseElement","onclick","ServicePointModalElement","modalContentElement","setValidationErrors","clearValidationError","keys","length","_parcelshop$id","setValidationClass","message","hidden","showModal","modal","setCountry","setQuery","validationClass","name","address","postal_code","city","street","number","addition","type","onClick","domReady","render","getElementByIdAsync","Promise","resolve","getElement","element","requestAnimationFrame","container","App","setPostalCode","setCountryCode","setSelectedShippingMethod","addEventListener","trackSelectedShippingMethod","event","target","observer","MutationObserver","mutationList","mutation","radioControlElement","getElementsByName","observe","childList","nativeFetch","args","isWantedCall","urlParams","URLSearchParams","param","includes","apply","JSON","parse","requests","request","path","shipping_address","postcode","deliveryOptionsElement"],"sourceRoot":""} -
dhlpwc/trunk/dhlpwoocommerce.php
r3255370 r3273743 5 5 * Description: This is the official DHL eCommerce (Benelux) for WooCommerce plugin. 6 6 * Author: DHL eCommerce 7 * Version: 2.1.1 17 * Version: 2.1.12 8 8 * Requires at least: 4.7 9 9 * Tested up to: 6.6 … … 52 52 53 53 // Set constants 54 $this->define('DHLPWC_PLUGIN_VERSION', '2.1.1 1');54 $this->define('DHLPWC_PLUGIN_VERSION', '2.1.12'); 55 55 $this->define('DHLPWC_PLUGIN_FILE', __FILE__); 56 56 $this->define('DHLPWC_PLUGIN_BASENAME', plugin_basename(__FILE__)); -
dhlpwc/trunk/includes/model/service/class-dhlpwc-model-service-debug.php
r2688414 r3273743 67 67 // Unfortunately, we can only get the plugin version if it's in the admin section 68 68 if (is_admin()) { 69 $plugin_data = get_plugin_data(DHLPWC_PLUGIN_FILE );69 $plugin_data = get_plugin_data(DHLPWC_PLUGIN_FILE, true, false); 70 70 $plugin_version = $plugin_data['Version']; 71 71 } else { -
dhlpwc/trunk/includes/model/service/class-dhlpwc-model-service-shipment.php
r3229375 r3273743 66 66 if (empty($shipment_data->receiver->address->number) && $validate_address_number) { 67 67 $this->set_error(self::CREATE_ERROR, ucfirst(sprintf(__('Receiver %s field is required.', 'dhlpwc'), __('house number', 'dhlpwc')))); 68 return false; 69 } 70 71 if (!$to_business && empty($shipment_data->receiver->name->last_name)) { 72 $this->set_error(self::CREATE_ERROR, ucfirst(sprintf(__('Receiver %s field is required on shipments to consumers.', 'dhlpwc'), __('last name', 'dhlpwc')))); 68 73 return false; 69 74 } -
dhlpwc/trunk/readme.txt
r3255370 r3273743 5 5 Requires PHP: 5.6 6 6 Tested up to: 6.6 7 Stable tag: 2.1.1 17 Stable tag: 2.1.12 8 8 WC requires at least: 3.0.0 9 9 WC tested up to: 9.0.2 … … 56 56 57 57 == Changelog == 58 59 = 2.1.12 = 60 - Added a last name check for label creation 61 - Fixed an incompatibility issue provisionally for WooCommerce 9.8.0 and higher 62 - Known issue: ServicePoint Locator and delivery timeframes are not loaded properly for WooCommerce 9.8.0 and higher 58 63 59 64 = 2.1.11 =
Note: See TracChangeset
for help on using the changeset viewer.