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AK,EAAE,CAAK,EAAK,EAAE,CAAC,OAAO,CAAC,WAAY,IAIxB,SAAhB,EAAK,OAAO,EACZ,EAAK,YAAY,CAAC,MAAO,EAAK,YAAY,CAAC,OAAO,OAAO,CAAC,WAAY,GAG9E,GAG+F,MAA1F,CAAA,aAAe,SAAS,aAAa,CAAC,+CAAA,GACvC,aAAa,YAAY,CAAC,QAAS,EAAU,MAAM,CAG3D,EA/BM,EAAY,SAAS,gBAAgB,CAAC,4BAG5C,GAAK,EAKL,IAAK,IAAI,EAAE,EAAG,EAAE,EAAU,MAAM,CAAE,IAAlC,EAAA,EAwBJ,CAEA,SAAS,IAGL,IAAM,EAAY,SAAS,gBAAgB,CAAC,4BAGvC,GAKA,AAAuF,MAAvF,CAAA,eAAiB,SAAS,aAAa,CAAC,0CAAA,GACzC,CAAA,eAAe,SAAS,CAAI,GAAM,AAAC,CAAA,EAAU,MAAM,CAAG,CAAA,EAAK,CAAA,CAGnE,C","sources":["","node_modules/@swc/helpers/esm/_type_of.js","www.nrla.org.uk/src/js/utils/createElement.js","node_modules/@swc/helpers/esm/_sliced_to_array.js","node_modules/@swc/helpers/esm/_array_with_holes.js","node_modules/@swc/helpers/esm/_iterable_to_array_limit.js","node_modules/@swc/helpers/esm/_non_iterable_rest.js","node_modules/@swc/helpers/esm/_unsupported_iterable_to_array.js","node_modules/@swc/helpers/esm/_array_like_to_array.js","www.nrla.org.uk/src/js/creditcheck.js"],"sourcesContent":["(function () {\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequired124\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequired124\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"h9OH6\", function(module, exports) {\n\n$parcel$export(module.exports, \"_type_of\", function () { return $c7da99bc8f965133$export$5f0017c582d45a2d; });\n$parcel$export(module.exports, \"_\", function () { return $c7da99bc8f965133$export$5f0017c582d45a2d; });\nfunction $c7da99bc8f965133$export$5f0017c582d45a2d(obj) {\n \"@swc/helpers - typeof\";\n return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\n\n});\n\nparcelRegister(\"70P4J\", function(module, exports) {\n/**\r\n * Create a dom element\r\n * @param string elementType Required - The type of element to create\r\n * @param object attributes Optional - A list of attribute to add to the element\r\n * @param string textNode Optional - Any text to add to the element\r\n * @return object Element\r\n */ \nvar $haqKc = parcelRequire(\"haqKc\");\nmodule.exports = function(elementType, attributes, textNode) {\n var element = document.createElement(elementType);\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n //\n for(var _iterator = Object.entries(attributes || {})[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var _step_value = (0, $haqKc._)(_step.value, 2), attributeName = _step_value[0], attributeValue = _step_value[1];\n if (attributeName in element) element[attributeName] = attributeValue;\n else element.setAttribute(attributeName, attributeValue);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n //\n if (typeof textNode !== \"undefined\") element.append(document.createTextNode(textNode));\n //\n return element;\n};\n\n});\nparcelRegister(\"haqKc\", function(module, exports) {\n\n$parcel$export(module.exports, \"_\", function () { return $c7f81dae783d026c$export$fdf2a89c76341bbf; });\n\nvar $kAoWz = parcelRequire(\"kAoWz\");\n\nvar $51zgv = parcelRequire(\"51zgv\");\n\nvar $8w5yq = parcelRequire(\"8w5yq\");\n\nvar $8YVFh = parcelRequire(\"8YVFh\");\nfunction $c7f81dae783d026c$export$fdf2a89c76341bbf(arr, i) {\n return (0, $kAoWz._array_with_holes)(arr) || (0, $51zgv._iterable_to_array_limit)(arr, i) || (0, $8YVFh._unsupported_iterable_to_array)(arr, i) || (0, $8w5yq._non_iterable_rest)();\n}\n\n});\nparcelRegister(\"kAoWz\", function(module, exports) {\n\n$parcel$export(module.exports, \"_array_with_holes\", function () { return $efca84b713134a66$export$e6256bf45c68d561; });\nfunction $efca84b713134a66$export$e6256bf45c68d561(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\n});\n\nparcelRegister(\"51zgv\", function(module, exports) {\n\n$parcel$export(module.exports, \"_iterable_to_array_limit\", function () { return $3a8866aa092b1ebb$export$2fd15edff6687200; });\nfunction $3a8866aa092b1ebb$export$2fd15edff6687200(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _s, _e;\n try {\n for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally{\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally{\n if (_d) throw _e;\n }\n }\n return _arr;\n}\n\n});\n\nparcelRegister(\"8w5yq\", function(module, exports) {\n\n$parcel$export(module.exports, \"_non_iterable_rest\", function () { return $63359ed8917f3ec8$export$60dbc22abd7da546; });\nfunction $63359ed8917f3ec8$export$60dbc22abd7da546() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\n});\n\nparcelRegister(\"8YVFh\", function(module, exports) {\n\n$parcel$export(module.exports, \"_unsupported_iterable_to_array\", function () { return $68a0a85bb5bfa568$export$a5be06335b3a083c; });\n\nvar $822BU = parcelRequire(\"822BU\");\nfunction $68a0a85bb5bfa568$export$a5be06335b3a083c(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return (0, $822BU._array_like_to_array)(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return (0, $822BU._array_like_to_array)(o, minLen);\n}\n\n});\nparcelRegister(\"822BU\", function(module, exports) {\n\n$parcel$export(module.exports, \"_array_like_to_array\", function () { return $5d9088fdefde415d$export$79e617b1955a2616; });\nfunction $5d9088fdefde415d$export$79e617b1955a2616(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];\n return arr2;\n}\n\n});\n\n\n\n\n//\n\nvar $h9OH6 = parcelRequire(\"h9OH6\");\n\nvar $70P4J = parcelRequire(\"70P4J\");\n//\n$ba66290d7469d0f5$var$addActionToRemoveButtons();\n$ba66290d7469d0f5$var$calculateTotalFee();\n//add new address\nvar $ba66290d7469d0f5$var$template = document.querySelector('script[id=\"tpl-address\"]');\nif ($ba66290d7469d0f5$var$template) {\n //\n var $ba66290d7469d0f5$var$addressWrapper = document.querySelector('[data-name=\"tenants-addresses\"]');\n //\n var $ba66290d7469d0f5$var$addButtonWrapper = document.querySelector('[data-name=\"add-address-button-wrapper\"]');\n var $ba66290d7469d0f5$var$addAddressButton = document.querySelector('button[data-action=\"add-address\"]');\n //\n if ($ba66290d7469d0f5$var$addressWrapper !== null && $ba66290d7469d0f5$var$addButtonWrapper !== null && $ba66290d7469d0f5$var$addAddressButton !== null) $ba66290d7469d0f5$var$addAddressButton.addEventListener(\"click\", function(event) {\n //\n var index = document.querySelectorAll('div[data-name=\"address\"]').length;\n //\n var address = $70P4J(\"div\", {\n \"data-name\": \"address\",\n \"data-id\": index\n });\n //\n address.innerHTML = $ba66290d7469d0f5$var$template.innerHTML;\n //\n $ba66290d7469d0f5$var$addressWrapper.append(address);\n //\n $ba66290d7469d0f5$var$addActionToRemoveButtons();\n $ba66290d7469d0f5$var$resetIDS();\n $ba66290d7469d0f5$var$calculateTotalFee();\n //if there are 3 or more addresses added - hide the add button\n $ba66290d7469d0f5$var$addButtonWrapper.toggleAttribute(\"hidden\", document.querySelectorAll('div[data-name=\"address\"]').length >= $ba66290d7469d0f5$var$addressWrapper.dataset.maxAllowedAddresses);\n });\n}\n//add action to all address removal buttons\nfunction $ba66290d7469d0f5$var$addActionToRemoveButtons() {\n var _loop = function(i) {\n //\n if ((removeButton = addresses[i].querySelector('button[data-name=\"remove\"]')) != null) {\n //\n if (removeButton.dataset.event == \"true\") return {\n v: void void 0\n };\n //\n removeButton.addEventListener(\"click\", function(event) {\n //\n removeButton.setAttribute(\"event\", \"true\");\n addresses[i].remove();\n $ba66290d7469d0f5$var$resetIDS();\n $ba66290d7469d0f5$var$calculateTotalFee();\n //if there are less than 3 addresses, show the add address button\n var addButtonWrapper = document.querySelector('[data-name=\"add-address-button-wrapper\"]');\n addButtonWrapper.classList.toggle(\"hidden\", document.querySelectorAll('div[data-name=\"address\"]').length >= 3);\n });\n }\n };\n //\n var addresses = document.querySelectorAll('div[data-name=\"address\"]');\n //\n for(var i = 0; i < addresses.length; i++){\n var _ret = _loop(i);\n if ((0, $h9OH6._)(_ret) === \"object\") return _ret.v;\n }\n}\n//change the ids for all input and label within each address div\nfunction $ba66290d7469d0f5$var$resetIDS() {\n var _loop = function(i) {\n //\n addresses[i].querySelectorAll(\"input, label\").forEach(function(item) {\n //\n if (item.tagName == \"INPUT\") {\n item.name = item.name.replace(/([0-9])$/, i);\n item.id = item.id.replace(/([0-9])$/, i);\n }\n //\n if (item.tagName == \"LABEL\") item.setAttribute(\"for\", item.getAttribute(\"for\").replace(/([0-9])$/, i));\n });\n //\n if ((addressCount = document.querySelector('form input[name=\"creditcheck_address_count\"]')) != null) addressCount.setAttribute(\"value\", addresses.length);\n };\n //\n var addresses = document.querySelectorAll('div[data-name=\"address\"]');\n //\n if (!addresses) return;\n //\n for(var i = 0; i < addresses.length; i++)_loop(i);\n}\nfunction $ba66290d7469d0f5$var$calculateTotalFee() {\n //\n var addresses = document.querySelectorAll('div[data-name=\"address\"]');\n //\n if (!addresses) return;\n //\n if ((creditcheckFee = document.querySelector('span[data-name=\"creditcheck-total-fee\"]')) != null) creditcheckFee.innerText = 12 + (addresses.length - 1) * 1;\n}\n\n})();\n//# sourceMappingURL=creditcheck.min.js.map\n","export function _type_of(obj) {\n \"@swc/helpers - typeof\";\n\n return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nexport { _type_of as _ };\n","/**\r\n * Create a dom element\r\n * @param string elementType Required - The type of element to create\r\n * @param object attributes Optional - A list of attribute to add to the element\r\n * @param string textNode Optional - Any text to add to the element\r\n * @return object Element\r\n */\r\nmodule.exports = (elementType, attributes, textNode) => {\r\n const element = document.createElement(elementType);\r\n\r\n //\r\n for (const [attributeName, attributeValue] of Object.entries((attributes || {}))) {\r\n if (attributeName in element) {\r\n element[attributeName] = attributeValue\r\n } else {\r\n element.setAttribute(attributeName, attributeValue);\r\n }\r\n }\r\n\r\n //\r\n if (typeof textNode !== 'undefined') {\r\n element.append(document.createTextNode(textNode));\r\n }\r\n\r\n //\r\n return element;\r\n\r\n};","import { _array_with_holes } from \"./_array_with_holes.js\";\nimport { _iterable_to_array_limit } from \"./_iterable_to_array_limit.js\";\nimport { _non_iterable_rest } from \"./_non_iterable_rest.js\";\nimport { _unsupported_iterable_to_array } from \"./_unsupported_iterable_to_array.js\";\n\nexport function _sliced_to_array(arr, i) {\n return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();\n}\nexport { _sliced_to_array as _ };\n","export function _array_with_holes(arr) {\n if (Array.isArray(arr)) return arr;\n}\nexport { _array_with_holes as _ };\n","export function _iterable_to_array_limit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n\n if (_i == null) return;\n\n var _arr = [];\n var _n = true;\n var _d = false;\n var _s, _e;\n\n try {\n for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\nexport { _iterable_to_array_limit as _ };\n","export function _non_iterable_rest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nexport { _non_iterable_rest as _ };\n","import { _array_like_to_array } from \"./_array_like_to_array.js\";\n\nexport function _unsupported_iterable_to_array(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _array_like_to_array(o, minLen);\n\n var n = Object.prototype.toString.call(o).slice(8, -1);\n\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);\n}\nexport { _unsupported_iterable_to_array as _ };\n","export function _array_like_to_array(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\nexport { _array_like_to_array as _ };\n","\r\n//\r\nconst createElement = require('./utils/createElement.js');\r\n\r\n//\r\naddActionToRemoveButtons();\r\ncalculateTotalFee();\r\n\r\n//add new address\r\nconst template = document.querySelector('script[id=\"tpl-address\"]');\r\n\r\nif (template) {\r\n\r\n //\r\n const addressWrapper = document.querySelector('[data-name=\"tenants-addresses\"]');\r\n\r\n //\r\n const addButtonWrapper = document.querySelector('[data-name=\"add-address-button-wrapper\"]');\r\n const addAddressButton = document.querySelector('button[data-action=\"add-address\"]')\r\n\r\n //\r\n if (addressWrapper !== null && addButtonWrapper !== null && addAddressButton !== null) {\r\n addAddressButton.addEventListener('click', (event) => {\r\n\r\n //\r\n const index = document.querySelectorAll('div[data-name=\"address\"]').length;\r\n\r\n //\r\n const address = createElement('div', {\r\n 'data-name' : 'address',\r\n 'data-id' : index,\r\n });\r\n\r\n //\r\n address.innerHTML = template.innerHTML;\r\n\r\n //\r\n addressWrapper.append(address);\r\n\r\n //\r\n addActionToRemoveButtons();\r\n resetIDS();\r\n calculateTotalFee();\r\n\r\n //if there are 3 or more addresses added - hide the add button\r\n addButtonWrapper.toggleAttribute('hidden', (document.querySelectorAll('div[data-name=\"address\"]').length >= addressWrapper.dataset.maxAllowedAddresses));\r\n\r\n });\r\n }\r\n\r\n}\r\n\r\n//add action to all address removal buttons\r\nfunction addActionToRemoveButtons(){\r\n\r\n //\r\n const addresses = document.querySelectorAll('div[data-name=\"address\"]');\r\n\r\n //\r\n for (let i=0; i {\r\n\r\n //\r\n removeButton.setAttribute('event', 'true');\r\n addresses[i].remove();\r\n resetIDS();\r\n calculateTotalFee();\r\n\r\n //if there are less than 3 addresses, show the add address button\r\n const addButtonWrapper = document.querySelector('[data-name=\"add-address-button-wrapper\"]');\r\n addButtonWrapper.classList.toggle('hidden', (document.querySelectorAll('div[data-name=\"address\"]').length >= 3));\r\n\r\n });\r\n\r\n }\r\n\r\n }\r\n\r\n}\r\n\r\n//change the ids for all input and label within each address div\r\nfunction resetIDS() {\r\n\r\n //\r\n const addresses = document.querySelectorAll('div[data-name=\"address\"]');\r\n\r\n //\r\n if (!addresses) {\r\n return;\r\n }\r\n\r\n //\r\n for (let i=0; i {\r\n\r\n //\r\n if (item.tagName == 'INPUT') {\r\n item.name = item.name.replace(/([0-9])$/, i);\r\n item.id = item.id.replace(/([0-9])$/, i);\r\n }\r\n\r\n //\r\n if (item.tagName == 'LABEL') {\r\n item.setAttribute('for', item.getAttribute('for').replace(/([0-9])$/, i));\r\n }\r\n\r\n });\r\n\r\n //\r\n if ((addressCount = document.querySelector('form input[name=\"creditcheck_address_count\"]')) != null) {\r\n addressCount.setAttribute('value', addresses.length);\r\n }\r\n\r\n }\r\n}\r\n\r\nfunction calculateTotalFee() {\r\n\r\n //\r\n const addresses = document.querySelectorAll('div[data-name=\"address\"]');\r\n\r\n //\r\n if (!addresses) {\r\n return;\r\n }\r\n\r\n //\r\n if ((creditcheckFee = document.querySelector('span[data-name=\"creditcheck-total-fee\"]')) != null) {\r\n creditcheckFee.innerText = (12 + ((addresses.length - 1) * 1));\r\n }\r\n\r\n}\r\n"],"names":["$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","self","window","global","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$c7da99bc8f965133$export$5f0017c582d45a2d","obj","Symbol","constructor","$haqKc","elementType","attributes","textNode","element","document","createElement","_iteratorNormalCompletion","_didIteratorError","_iteratorError","undefined","_step","_iterator","entries","iterator","next","done","_step_value","_","value","attributeName","attributeValue","setAttribute","return","append","createTextNode","$c7f81dae783d026c$export$fdf2a89c76341bbf","$kAoWz","$51zgv","$8w5yq","$8YVFh","arr","i","_array_with_holes","_iterable_to_array_limit","_unsupported_iterable_to_array","_non_iterable_rest","$efca84b713134a66$export$e6256bf45c68d561","Array","isArray","$3a8866aa092b1ebb$export$2fd15edff6687200","_s","_e","_i","_arr","_n","_d","push","length","$63359ed8917f3ec8$export$60dbc22abd7da546","TypeError","$68a0a85bb5bfa568$export$a5be06335b3a083c","$822BU","o","minLen","_array_like_to_array","prototype","toString","slice","name","from","test","$5d9088fdefde415d$export$79e617b1955a2616","len","arr2","$h9OH6","$70P4J","$ba66290d7469d0f5$var$addActionToRemoveButtons","$ba66290d7469d0f5$var$calculateTotalFee","$ba66290d7469d0f5$var$template","querySelector","$ba66290d7469d0f5$var$addressWrapper","$ba66290d7469d0f5$var$addButtonWrapper","$ba66290d7469d0f5$var$addAddressButton","addEventListener","event","address","querySelectorAll","innerHTML","$ba66290d7469d0f5$var$resetIDS","toggleAttribute","dataset","maxAllowedAddresses","_loop","removeButton","addresses","remove","addButtonWrapper","classList","toggle","_ret","forEach","item","tagName","replace","getAttribute","addressCount","creditcheckFee","innerText"],"version":3,"file":"creditcheck.min.js.map"}