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IAAI,CAAC,IAAI,EACpD,IAAI,CAAC,YAAY,CAAC,CAAE,MAAO,QAAS,QAAS,IAAI,CAAC,YAAY,CAAE,OAAQ,CAAe,EAC3F,CAEA,gBAAiB,CACT,IAAI,CAAC,YAAY,EACjB,aAAa,IAAI,CAAC,YAAY,EAGlC,IAAI,CAAC,YAAY,CAAG,OAAO,UAAU,CAAC,KAClC,IAAM,EAAO,CACT,OAAQ,IAAI,CAAC,YAAY,CAAE,KAAK,AACpC,EACA,AAAA,EAAa,CACT,WAAY,IAAI,CAAC,cAAc,CAC/B,eAAgB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAC7C,QAAS,CACb,EACJ,EAAG,IACP,CAEA,gBAAiB,CACb,OAAO,IAAI,AACf,CAQA,oBAAqB,CACjB,SAAS,gBAAgB,CAAC,mBAAoB,KAC1C,IAAI,CAAC,sBAAsB,GAC3B,IAAI,CAAC,4BAA4B,GACjC,IAAI,CAAC,0BAA0B,GAC/B,IAAI,CAAC,mCAAmC,GACxC,IAAI,CAAC,iBAAiB,GACtB,IAAI,CAAC,wBAAwB,GACzB,IAAI,CAAC,cAAc,EACnB,IAAI,CAAC,qBAAqB,EAElC,EACJ,CACJ,CdxCA,IAhBe,cAAsB,EACjC,aAAc,CACV,KAAK,CAAC,CACF,CAAE,KAAM,aAAc,YAAa,CAAU,EAC7C,CAAE,KAAM,cAAe,YAAa,CAAW,EAC/C,CAAE,KAAM,YAAa,YAAa,CAAS,EAC3C,CAAE,KAAM,oBAAqB,YAAa,CAAgB,EAC1D,CAAE,KAAM,kBAAmB,YAAa,CAAc,EACtD,CAAE,KAAM,oBAAqB,YAAa,CAAgB,EAG7D,CACL,CACJ,C","sources":["","node_modules/@parcel/runtime-js/lib/helpers/bundle-manifest.js","node_modules/@parcel/runtime-js/lib/helpers/bundle-url.js","node_modules/@parcel/runtime-js/lib/runtime-036cc9da8100f0a9.js","node_modules/@parcel/runtime-js/lib/helpers/browser/js-loader.js","node_modules/@parcel/runtime-js/lib/helpers/cacheLoader.js","node_modules/@parcel/runtime-js/lib/runtime-41ea62728a42ceda.js","webportal/config/layout/themes/project/ts/contact.ts","webportal/config/layout/themes/tk/ts/utilities/tk.module.factory.ts","webportal/config/layout/themes/tk/ts/basiscs/tk.viewport.ts","webportal/config/layout/themes/tk/ts/utilities/tk.custom.element.factory.ts","webportal/config/layout/themes/tk/ts/components/tk.dialog.ts","webportal/config/layout/themes/tk/ts/utilities/tk.fetch.ts","webportal/config/layout/themes/tk/ts/utilities/tk.notification.ts","webportal/config/layout/themes/tk/ts/utilities/tk.messages.ts","webportal/config/layout/themes/tk/ts/utilities/tk.render.ts","webportal/config/layout/themes/tk/ts/controls/tk.static.content.ts","webportal/config/layout/themes/tk/ts/controls/tk.form.validator.ts","webportal/config/layout/themes/tk/ts/controls/tk.form.zipcity.ts","webportal/config/layout/themes/project/ts/basics/ns.manager.ts","webportal/config/layout/themes/tk/ts/basiscs/tk.manager.ts","webportal/config/layout/themes/project/ts/controls/ns.form.element.ts","webportal/config/layout/themes/tk/ts/controls/tk.form.element.ts"],"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[\"parcelRequire4c53\"];\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[\"parcelRequire4c53\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"iE7OH\", function(module, exports) {\n\n$parcel$export(module.exports, \"register\", function () { return $0380ce8f1f064ccc$export$6503ec6e8aabbaf; }, function (v) { return $0380ce8f1f064ccc$export$6503ec6e8aabbaf = v; });\n$parcel$export(module.exports, \"resolve\", function () { return $0380ce8f1f064ccc$export$f7ad0328861e2f03; }, function (v) { return $0380ce8f1f064ccc$export$f7ad0328861e2f03 = v; });\nvar $0380ce8f1f064ccc$export$6503ec6e8aabbaf;\nvar $0380ce8f1f064ccc$export$f7ad0328861e2f03;\n\"use strict\";\nvar $0380ce8f1f064ccc$var$mapping = new Map();\nfunction $0380ce8f1f064ccc$var$register(baseUrl, manifest) {\n for(var i = 0; i < manifest.length - 1; i += 2)$0380ce8f1f064ccc$var$mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n}\nfunction $0380ce8f1f064ccc$var$resolve(id) {\n var resolved = $0380ce8f1f064ccc$var$mapping.get(id);\n if (resolved == null) throw new Error(\"Could not resolve bundle with id \" + id);\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\n$0380ce8f1f064ccc$export$6503ec6e8aabbaf = $0380ce8f1f064ccc$var$register;\n$0380ce8f1f064ccc$export$f7ad0328861e2f03 = $0380ce8f1f064ccc$var$resolve;\n\n});\n\nparcelRegister(\"aNJCr\", function(module, exports) {\n\n$parcel$export(module.exports, \"getBundleURL\", function () { return $7dd1ddf6834435ca$export$bdfd709ae4826697; }, function (v) { return $7dd1ddf6834435ca$export$bdfd709ae4826697 = v; });\nvar $7dd1ddf6834435ca$export$bdfd709ae4826697;\nvar $7dd1ddf6834435ca$export$c9e73fbda7da57b6;\nvar $7dd1ddf6834435ca$export$5a759dc7a1cfb72a;\n\"use strict\";\nvar $7dd1ddf6834435ca$var$bundleURL = {};\nfunction $7dd1ddf6834435ca$var$getBundleURLCached(id) {\n var value = $7dd1ddf6834435ca$var$bundleURL[id];\n if (!value) {\n value = $7dd1ddf6834435ca$var$getBundleURL();\n $7dd1ddf6834435ca$var$bundleURL[id] = value;\n }\n return value;\n}\nfunction $7dd1ddf6834435ca$var$getBundleURL() {\n try {\n throw new Error();\n } catch (err) {\n var matches = (\"\" + err.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^)\\n]+/g);\n if (matches) // The first two stack frames will be this function and getBundleURLCached.\n // Use the 3rd one, which will be a runtime in the original bundle.\n return $7dd1ddf6834435ca$var$getBaseURL(matches[2]);\n }\n return \"/\";\n}\nfunction $7dd1ddf6834435ca$var$getBaseURL(url) {\n return (\"\" + url).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/.+)\\/[^/]+$/, \"$1\") + \"/\";\n}\n// TODO: Replace uses with `new URL(url).origin` when ie11 is no longer supported.\nfunction $7dd1ddf6834435ca$var$getOrigin(url) {\n var matches = (\"\" + url).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^/]+/);\n if (!matches) throw new Error(\"Origin not found\");\n return matches[0];\n}\n$7dd1ddf6834435ca$export$bdfd709ae4826697 = $7dd1ddf6834435ca$var$getBundleURLCached;\n$7dd1ddf6834435ca$export$c9e73fbda7da57b6 = $7dd1ddf6834435ca$var$getBaseURL;\n$7dd1ddf6834435ca$export$5a759dc7a1cfb72a = $7dd1ddf6834435ca$var$getOrigin;\n\n});\n\nparcelRegister(\"22OJp\", function(module, exports) {\n\n\nmodule.exports = (parcelRequire(\"4WKyX\"))((parcelRequire(\"iE7OH\")).resolve(\"jkN7i\")).then(()=>parcelRequire(\"S0nQY\"));\n\n});\nparcelRegister(\"4WKyX\", function(module, exports) {\n\"use strict\";\n\nvar $2prpb = parcelRequire(\"2prpb\");\nmodule.exports = $2prpb(function(bundle) {\n return new Promise(function(resolve, reject) {\n // Don't insert the same script twice (e.g. if it was already in the HTML)\n var existingScripts = document.getElementsByTagName(\"script\");\n if ([].concat(existingScripts).some(function isCurrentBundle(script) {\n return script.src === bundle;\n })) {\n resolve();\n return;\n }\n var preloadLink = document.createElement(\"link\");\n preloadLink.href = bundle;\n preloadLink.rel = \"preload\";\n preloadLink.as = \"script\";\n document.head.appendChild(preloadLink);\n var script = document.createElement(\"script\");\n script.async = true;\n script.type = \"text/javascript\";\n script.src = bundle;\n script.onerror = function(e) {\n var error = new TypeError(\"Failed to fetch dynamically imported module: \".concat(bundle, \". Error: \").concat(e.message));\n script.onerror = script.onload = null;\n script.remove();\n reject(error);\n };\n script.onload = function() {\n script.onerror = script.onload = null;\n resolve();\n };\n document.getElementsByTagName(\"head\")[0].appendChild(script);\n });\n});\n\n});\nparcelRegister(\"2prpb\", function(module, exports) {\n\"use strict\";\nvar $1c132cac09cd18d9$var$cachedBundles = {};\nvar $1c132cac09cd18d9$var$cachedPreloads = {};\nvar $1c132cac09cd18d9$var$cachedPrefetches = {};\nfunction $1c132cac09cd18d9$var$getCache(type) {\n switch(type){\n case \"preload\":\n return $1c132cac09cd18d9$var$cachedPreloads;\n case \"prefetch\":\n return $1c132cac09cd18d9$var$cachedPrefetches;\n default:\n return $1c132cac09cd18d9$var$cachedBundles;\n }\n}\nmodule.exports = function(loader, type) {\n return function(bundle) {\n var cache = $1c132cac09cd18d9$var$getCache(type);\n if (cache[bundle]) return cache[bundle];\n return cache[bundle] = loader.apply(null, arguments).catch(function(e) {\n delete cache[bundle];\n throw e;\n });\n };\n};\n\n});\n\n\n\nvar $ad710ad9b53619e9$exports = {};\n\n\n(parcelRequire(\"iE7OH\")).register((parcelRequire(\"aNJCr\")).getBundleURL(\"fdQ30\"), JSON.parse('[\"fdQ30\",\"contact.js\",\"jkN7i\",\"../account/tinymce.min.58a25f5e.js\",\"agqxp\",\"../article/tinymce.min.05edad61.js\",\"hAiFf\",\"../checkoutfailed/tinymce.min.f15fad1d.js\",\"8XP1L\",\"tinymce.min.c1c66141.js\",\"6KVic\",\"../general/tinymce.min.0b731625.js\",\"hcLsR\",\"../internal/tinymce.min.798ab06b.js\",\"25mWf\",\"../feedback/tinymce.min.9b5a8c12.js\",\"jMuyX\",\"../staticcontent/tinymce.min.f29932a4.js\",\"jOKl9\",\"contact.css\"]'));\n\nclass $e31d2de11bbf216d$export$2e2bcd8739ae039 {\n constructor(list){\n this.customElementList = list;\n this.init();\n }\n init() {\n this.customElementList.forEach((item)=>{\n !customElements.get(item.name) && customElements.define(item.name, item.constructor);\n });\n }\n}\n\n\nclass $8f658dda969a7982$export$2e2bcd8739ae039 extends HTMLElement {\n constructor(){\n super();\n this.listeners = [];\n }\n // eslint-disable-next-line class-methods-use-this\n connectedCallback() {}\n /**\r\n * If the custom element is getting removed of the dom, all listeners\r\n * are getting removed of the element.\r\n */ disconnectedCallback() {\n this.listeners.forEach((item)=>{\n item.element.removeEventListener(item.event, item.action);\n });\n }\n /**\r\n * Here you can push a listener object directly to the listener array\r\n *\r\n * @param {Listener} {}\r\n */ pushListener({ event: event, element: element, action: action }) {\n this.listeners.push({\n event: event,\n element: element,\n action: action\n });\n element.addEventListener(event, action);\n }\n /**\r\n * Removes the given element from the listener array and removes the\r\n * EventListener from the element and returns the listener object.\r\n * If the element was not found, undefined is returned.\r\n *\r\n * @param {Element} element\r\n * @returns {Listener | undefined}\r\n */ removeListener(element) {\n const foundElement = this.listeners.find((item)=>item.element === element);\n if (!foundElement) return;\n foundElement?.element.removeEventListener(foundElement.event, foundElement.action);\n const newList = this.listeners.filter((item)=>item.element !== element);\n this.listeners = newList;\n return foundElement;\n }\n}\n\n\nclass $2e3d1137f4724c0f$export$2e2bcd8739ae039 extends (0, $8f658dda969a7982$export$2e2bcd8739ae039) {\n constructor(){\n super();\n this.resizeEventName = this.getAttribute(\"data-tk-resize-event-name\") || \"tk-viewport-resize\";\n this.resizeObserver = new ResizeObserver(this.checkSize.bind(this));\n // * These breakpoints must match the CSS breakpoints, otherwise conflicts may occur.\n this.breakpoints = new Map([\n [\n \"xs\",\n 576\n ],\n [\n \"s\",\n 768\n ],\n [\n \"m\",\n 992\n ],\n [\n \"l\",\n 1200\n ],\n [\n \"xl\",\n 1440\n ]\n ]);\n this.currentBreakpoint = this.getCurrentBreakpoint(this.clientWidth);\n }\n connectedCallback() {\n this.resizeObserver.observe(this);\n window.viewport = this;\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.resizeObserver.unobserve(this);\n }\n checkSize(entries) {\n entries.forEach(()=>{\n const currentWidth = window.innerWidth;\n const currentBreakpoint = this.getCurrentBreakpoint(currentWidth);\n if (this.currentBreakpoint !== currentBreakpoint) {\n const event = new CustomEvent(this.resizeEventName, {\n bubbles: true,\n detail: {\n width: currentWidth,\n breakpoint: currentBreakpoint\n }\n });\n this.currentBreakpoint = currentBreakpoint;\n this.dispatchEvent(event);\n }\n });\n }\n getCurrentBreakpoint(width) {\n let currentBreakpoint = \"xs\";\n this.breakpoints.forEach((value, key)=>{\n if (width >= value) currentBreakpoint = key;\n });\n return currentBreakpoint;\n }\n}\n\n\n/* eslint-disable max-len */ const $86b3c5b6d66bd808$var$globalFormErrorMessages = {\n badInput: \"Please enter a number.\",\n patternMismatch: \"Please match the requested format.\",\n rangeOverflow: \"Please select a value that is no more than {max}.\",\n rangeUnderflow: \"Please select a value that is no less than {min}.\",\n stepMismatch: \"Please select a value that is a multiple from {step}.\",\n tooLong: \"Please shorten this text to no more than {maxLength} characters. You are currently using {length} characters.\",\n tooShort: \"Please lengthen this text to {minLength} characters or more. You are currently using {length} characters.\",\n typeMismatch: \"The value you have entered for this field is invalid.\",\n valueMissing: \"Please fill out this field.\",\n // These properties must be empty.\n valid: \"\",\n customError: \"\"\n};\nconst $86b3c5b6d66bd808$var$globalFormPasswordValidityMessages = {\n passwordNotMatching: \"The password does not match the one above.\"\n};\nconst $86b3c5b6d66bd808$var$globalFormExpandErrorMessages = {\n stepAdjust: \"The value you entered for this field is invalid. The value has been changed from {currentValue} to {newValue}\",\n existigName: \"This name {currentValue} already exists.\"\n};\nconst $86b3c5b6d66bd808$var$globalBasketMessages = {\n messageEmptyBasket: {\n code: \"1-6-6220\",\n text: \"Shopping cart is empty\"\n },\n messageAddedToBasket: {\n code: \"1-6-6221\",\n text: \"added to the shopping cart\"\n },\n quickOrderMessageTooShort: {\n code: \"1-6-6222\",\n text: \"At least %1 characters are required for a search.\"\n }\n};\nconst $86b3c5b6d66bd808$var$globalDeliveryMessages = {\n messageDeliveryTypeGeneral: {\n code: \"1-6-6226\",\n text: \"Delivery method changed\"\n }\n};\nconst $86b3c5b6d66bd808$var$globalPaymentMessages = {\n messagePaymentTypeCreditCard: {\n code: \"1-6-6227\",\n text: \"Payment type credit card\"\n },\n messagePaymentTypeInvoice: {\n code: \"1-6-6227\",\n text: \"Payment type invoice\"\n },\n messagePaymentTypeInAdvance: {\n code: \"1-6-6227\",\n text: \"Payment type advance payment\"\n },\n messagePaymentTypeOnDelivery: {\n code: \"1-6-6227\",\n text: \"Payment type cash on delivery\"\n },\n messagePaymentTypeGeneral: {\n code: \"1-6-6227\",\n text: \"Payment type changed\"\n }\n};\nconst $86b3c5b6d66bd808$var$globalCompareMessages = {\n messageHint: {\n code: \"1-6-6240\",\n text: \"\"\n },\n allRemoved: {\n code: \"1-6-6240\",\n text: \"All items removed\"\n },\n empty: {\n code: \"1-6-6240\",\n text: \"Your article comparison is empty.\"\n }\n};\nconst $86b3c5b6d66bd808$var$globalFavoriteMessages = {\n messageInvalidName: {\n code: \"2-6-6270\",\n text: \"Unable to create the wish list; the name is invalid.\"\n },\n messageMaxLists: {\n code: \"2-6-6277\",\n text: \"Max. number of wish lists reached!\"\n },\n messageMaxPositions: {\n code: \"2-6-6278\",\n text: \"Max. number of positions reached!\"\n },\n messageDeleteConfirmation: {\n code: \"2-6-6273\",\n text: \"Do you really want to delete the wish list?\"\n }\n};\nconst $86b3c5b6d66bd808$var$globalAutocompleteMessages = {\n messageNoValueFound: {\n code: \"1-6-6290\",\n text: \"No match found!\"\n }\n};\nconst $86b3c5b6d66bd808$var$globalAccountMessages = {\n messageDelete: {\n code: \"1-6-6200\",\n text: \"Do you really want to delete this address?\"\n },\n messageChangeSuccess: {\n code: \"1-6-6200\",\n text: \"Address successfully modified.\"\n }\n};\nconst $86b3c5b6d66bd808$var$globalGeneralMessages = {\n messageEmptyText: {\n code: \"1-6-6290\",\n text: \"The output was suppressed due to an empty text.\"\n },\n messageOk: {\n code: \"1-6-6290\",\n text: \"Yes\"\n },\n messageCancel: {\n code: \"1-6-6290\",\n text: \"No\"\n },\n messageChange: {\n code: \"1-6-6290\",\n text: \"The selection was changed\"\n },\n messageDefault: {\n code: \"1-6-0000\",\n text: \"\"\n },\n messageDefaultInfo: {\n code: \"1-6-0000\",\n text: \"\"\n },\n messageDefaultWarning: {\n code: \"2-6-0000\",\n text: \"\"\n },\n messageDefaultError: {\n code: \"3-6-0000\",\n text: \"\"\n },\n messageDefaultDebug: {\n code: \"4-6-0000\",\n text: \"\"\n }\n};\nconst $86b3c5b6d66bd808$var$globalDirectSearchSuggestMessages = {\n messageTooShort: {\n code: \"1-6-6260\",\n text: \"At least 3 characters!\"\n },\n messageResultEmpty: {\n code: \"1-6-6260\",\n text: \"No items found!\"\n }\n};\nconst $86b3c5b6d66bd808$var$globalFileuploadAreaMessages = {\n defaultMessage: {\n code: \"1-6-2002\",\n text: \"Store the files here to upload them\"\n },\n fallbackMessage: {\n code: \"2-6-2002\",\n text: \"Your browser does not support drag&drop file uploads\"\n },\n fallbackText: {\n code: \"2-6-2002\",\n text: \"Use the form to upload your files\"\n },\n fileTooBig: {\n code: \"2-6-2002\",\n text: \"The file is too large. The maximum file size is {{maxFileSize}} MB\"\n },\n invalidFileType: {\n code: \"2-6-2002\",\n text: \"Unable to upload files of this type\"\n },\n responseError: {\n code: \"3-6-2002\",\n text: \"The server rejected your request with status {{statusCode}}\"\n },\n cancelUpload: {\n code: \"1-6-2002\",\n text: \"Cancel upload\"\n },\n cancelUploadConfirmation: {\n code: \"1-6-2002\",\n text: \"Cancel upload?\"\n },\n removeFile: {\n code: \"1-6-2002\",\n text: \"Remove file\"\n },\n maxFilesExceeded: {\n code: \"2-6-2002\",\n text: \"You are not allowed to upload any more files\"\n },\n buttonBrowse: {\n code: \"1-6-2002\",\n text: \"Select files to upload\"\n },\n uploadHint: {\n code: \"1-6-2002\",\n text: \"Drag files and folders here\"\n }\n};\nconst $86b3c5b6d66bd808$var$globalFilterMessages = {\n emptyResult: {\n code: \"1-1-6280\",\n text: \"Keine Ergebnisse gefunden.\"\n }\n};\nconst $86b3c5b6d66bd808$var$globalCheckoutMessages = {\n missingTerms: {\n code: \"3-6-6230\",\n text: \"Please accept the General terms and conditions.\"\n },\n loadingCheckoutTitle: {\n code: \"1-6-6260\",\n text: \"Almost done!\"\n },\n loadingCheckoutText: {\n code: \"1-6-6261\",\n text: \"The order is carried out. This can take a moment!\"\n }\n};\nconst $86b3c5b6d66bd808$var$globalHtmlErrorCodeMessages = {\n htmlErrorGeneral: {\n code: \"3-6-6000\",\n text: \"Something has gone wrong!\"\n },\n htmlError401: {\n code: \"3-6-6000\",\n text: \"A valid authentication is required to process the request.\"\n },\n htmlError403: {\n code: \"3-6-6000\",\n text: \"The request could not be processed due to missing authorization of the client.\"\n },\n htmlError404: {\n code: \"3-6-6000\",\n text: \"The requested site does not exist.\"\n },\n htmlError413: {\n code: \"3-6-6000\",\n text: \"The file is too large.\"\n },\n htmlError415: {\n code: \"3-6-6000\",\n text: \"This media type is not supported.\"\n },\n htmlError422: {\n code: \"3-6-6000\",\n text: \"Unable to display the requested site correctly.\"\n },\n htmlError500: {\n code: \"3-6-6000\",\n text: \"Internal server error\"\n },\n htmlError503: {\n code: \"3-6-6000\",\n text: \"The server is temporarily unavailable.\"\n }\n};\nif (!window.opacc) window.opacc = {};\nconst $86b3c5b6d66bd808$export$7ea287b8bcd34b91 = {\n ...$86b3c5b6d66bd808$var$globalFormErrorMessages,\n ...$86b3c5b6d66bd808$var$globalFormPasswordValidityMessages,\n ...$86b3c5b6d66bd808$var$globalFormExpandErrorMessages,\n ...window.opacc.tkFormValidityMessages,\n ...window.opacc.tkFormPasswordValidityMessages,\n ...window.opacc.tkFormExpandErrorMessages,\n ...window.opacc.projectFormValidityMessages,\n ...window.opacc.projectFormPasswordValidityMessages,\n ...window.opacc.projectFormExpandErrorMessages\n};\nconst $86b3c5b6d66bd808$export$35e6ad2b040b8403 = {\n ...$86b3c5b6d66bd808$var$globalFormExpandErrorMessages,\n ...window.opacc.tkFormExpandErrorMessages,\n ...window.opacc.projectFormExpandErrorMessages\n};\nconst $86b3c5b6d66bd808$export$287bafa924522a4d = {\n ...$86b3c5b6d66bd808$var$globalBasketMessages,\n ...window.opacc.tkBasketMessages,\n ...window.opacc.projectBasketMessages\n};\nconst $86b3c5b6d66bd808$export$ad480231e1cfb49 = {\n ...$86b3c5b6d66bd808$var$globalCompareMessages,\n ...window.opacc.tkCompareMessages,\n ...window.opacc.projectCompareMessages\n};\nconst $86b3c5b6d66bd808$export$329e838a9ba51357 = {\n ...$86b3c5b6d66bd808$var$globalFavoriteMessages,\n ...window.opacc.tkFavoriteMessages,\n ...window.opacc.projectFavoriteMessages\n};\nconst $86b3c5b6d66bd808$export$39227038979f1988 = {\n ...$86b3c5b6d66bd808$var$globalGeneralMessages,\n ...window.opacc.tkGeneralMessages,\n ...window.opacc.projectGeneralMessages\n};\nconst $86b3c5b6d66bd808$export$f625b980042672da = {\n ...$86b3c5b6d66bd808$var$globalDirectSearchSuggestMessages,\n ...window.opacc.tkDirectSearchSuggestMessages,\n ...window.opacc.projectDirectSearchSuggestMessages\n};\nconst $86b3c5b6d66bd808$export$fe24ead06f0313ff = {\n ...$86b3c5b6d66bd808$var$globalFileuploadAreaMessages,\n ...window.opacc.tkFileUploadAreaMessages,\n ...window.opacc.projectFileUploadAreaMessages\n};\nconst $86b3c5b6d66bd808$export$1c7f7f3bbe522ebc = {\n ...$86b3c5b6d66bd808$var$globalFilterMessages,\n ...window.opacc.tkFilterMessages,\n ...window.opacc.projectFilterMessages\n};\nconst $86b3c5b6d66bd808$export$fbedd73e1269236f = {\n ...$86b3c5b6d66bd808$var$globalAutocompleteMessages,\n ...window.opacc.tkAutocompleteMessages,\n ...window.opacc.projectAutocompleteMessages\n};\nconst $86b3c5b6d66bd808$export$389a1ce21906c656 = {\n ...$86b3c5b6d66bd808$var$globalPaymentMessages,\n ...window.opacc.tkPaymentMessages,\n ...window.opacc.projectPaymentMessages\n};\nconst $86b3c5b6d66bd808$export$36d5448025feaaa9 = {\n ...$86b3c5b6d66bd808$var$globalDeliveryMessages,\n ...window.opacc.tkDeliveryMessages,\n ...window.opacc.projectDeliveryMessages\n};\nconst $86b3c5b6d66bd808$export$efd88ea7bc399322 = {\n ...$86b3c5b6d66bd808$var$globalAccountMessages,\n ...window.opacc.tkAccountMessages,\n ...window.opacc.projectAccountMessages\n};\nconst $86b3c5b6d66bd808$export$4705307fe5270e12 = {\n ...$86b3c5b6d66bd808$var$globalCheckoutMessages,\n ...window.opacc.tkCheckoutMessages,\n ...window.opacc.projectCheckoutMessages\n};\nconst $86b3c5b6d66bd808$export$6e7e78d2cde281b0 = {\n ...$86b3c5b6d66bd808$var$globalHtmlErrorCodeMessages,\n ...window.opacc.tkHtmlErrorCodeMessages,\n ...window.opacc.projectHtmlErrorCodeMessages\n};\nconst $86b3c5b6d66bd808$export$97a703132b664051 = {\n ...window.opacc.tkZipCityMessages\n};\n\n\n/**\r\n * @param {string} html representing any number of sibling elements\r\n * @return {NodeListOf}\r\n */ const $2d540709c75492d4$var$render = (html, isBody = false)=>{\n if (!html) $2d540709c75492d4$var$render(\"
\");\n const parser = new DOMParser();\n const doc = parser.parseFromString(html, \"text/html\");\n return isBody ? doc.body : doc.body.children.item(0);\n};\nvar $2d540709c75492d4$export$2e2bcd8739ae039 = $2d540709c75492d4$var$render;\n\n\nvar $1221feb2184dfefe$export$9130146a86a85749;\n(function(NotificationType) {\n NotificationType[\"SUCCESS\"] = \"Success\";\n NotificationType[\"WARNING\"] = \"Warning\";\n NotificationType[\"ERROR\"] = \"Error\";\n NotificationType[\"INFO\"] = \"Info\";\n})($1221feb2184dfefe$export$9130146a86a85749 || ($1221feb2184dfefe$export$9130146a86a85749 = {}));\nconst $1221feb2184dfefe$var$mapMessageCodeToText = (response, messages)=>{\n let textMessage;\n if (!response.pluginId) return \"\";\n if (response.pluginId === \"paymentType\") {\n const paymentMessages = {\n 0: messages.messagePaymentTypeGeneral.text,\n 1: messages.messagePaymentTypeCreditCard.text,\n 2: messages.messagePaymentTypeInvoice.text,\n 5: messages.messagePaymentTypeInAdvance.text,\n 6: messages.messagePaymentTypeOnDelivery.text\n };\n textMessage = paymentMessages[Number(response.paymentType) || 0];\n } else if (response.pluginId === \"deliveryType\") textMessage = messages.messageDeliveryTypeGeneral.text;\n else if (response.pluginId === \"checkoutAdressChange\") textMessage = messages.messageChangeSuccess.text;\n return textMessage;\n};\nconst $1221feb2184dfefe$var$getConsoleStyle = (backgroundColor, textColor = \"white\")=>[\n `background: ${backgroundColor}`,\n `color: ${textColor}`,\n \"display: block\"\n ].join(\";\");\nconst $1221feb2184dfefe$var$logToConsole = (message, type)=>{\n const consoleHandler = {\n [\"Success\"] () {\n // eslint-disable-next-line no-console\n console.info(`%c ${message}`, $1221feb2184dfefe$var$getConsoleStyle(\"green\"));\n },\n [\"Warning\"] () {\n // eslint-disable-next-line no-console\n console.warn(`%c ${message}`, $1221feb2184dfefe$var$getConsoleStyle(\"yellow\", \"black\"));\n },\n [\"Error\"] () {\n // eslint-disable-next-line no-console\n console.log(`%c ${message}`, $1221feb2184dfefe$var$getConsoleStyle(\"red\"));\n },\n [\"Info\"] () {\n // eslint-disable-next-line no-console\n console.debug(`%c ${message}`, $1221feb2184dfefe$var$getConsoleStyle(\"blue\"));\n }\n };\n consoleHandler[type]();\n};\nconst $1221feb2184dfefe$var$renderMessageContainer = (parentElement)=>{\n let messageContainer = parentElement.querySelector(\"[data-tk-message-container]\");\n if (!messageContainer) {\n messageContainer = (0, $2d540709c75492d4$export$2e2bcd8739ae039)('
');\n parentElement.insertAdjacentElement(\"beforeend\", messageContainer);\n }\n return messageContainer;\n};\nconst $1221feb2184dfefe$export$3a57e165650c636f = (type, message, wait = 2.5, options = {})=>{\n if (!message) return;\n const dialogs = document.querySelectorAll(\"dialog[open]\");\n let messageContainer;\n if (dialogs.length === 0) messageContainer = $1221feb2184dfefe$var$renderMessageContainer(document.body);\n else {\n const lastDialog = Array.from(dialogs).at(-1);\n if (!lastDialog) messageContainer = $1221feb2184dfefe$var$renderMessageContainer(document.body);\n else messageContainer = $1221feb2184dfefe$var$renderMessageContainer(lastDialog);\n }\n const toast = (0, $2d540709c75492d4$export$2e2bcd8739ae039)(`\r\n
\r\n \r\n ${message}\r\n
\r\n `);\n toast.style.animation = `fadein .5s, fadeout .5s ${wait}s`;\n toast.classList.add(\"tk-message--show\");\n messageContainer.appendChild(toast);\n toast.addEventListener(\"animationend\", (event)=>{\n if (event.animationName !== \"fadeout\") return;\n messageContainer.removeChild(toast);\n });\n options.consoleMessage ? $1221feb2184dfefe$var$logToConsole(options.consoleMessage, type) : $1221feb2184dfefe$var$logToConsole(message, type);\n};\nconst $1221feb2184dfefe$export$146c7c7e50ed1bd2 = (item, messageOverride)=>{\n const type = item.code.substring(0, 1);\n const message = messageOverride || item.text;\n const typeHandler = {\n 1: ()=>$1221feb2184dfefe$export$3a57e165650c636f(\"Success\", message, item.wait),\n 2: ()=>$1221feb2184dfefe$export$3a57e165650c636f(\"Warning\", message, item.wait),\n 3: ()=>$1221feb2184dfefe$export$3a57e165650c636f(\"Error\", message, item.wait),\n 4: ()=>$1221feb2184dfefe$export$3a57e165650c636f(\"Info\", message, item.wait)\n };\n typeHandler[type]();\n};\nconst $1221feb2184dfefe$export$5b256beea4c7e9b5 = (items, response)=>{\n const messages = {\n ...(0, $86b3c5b6d66bd808$export$39227038979f1988),\n ...(0, $86b3c5b6d66bd808$export$efd88ea7bc399322),\n ...(0, $86b3c5b6d66bd808$export$389a1ce21906c656),\n ...(0, $86b3c5b6d66bd808$export$36d5448025feaaa9)\n };\n items.forEach((item)=>{\n $1221feb2184dfefe$export$146c7c7e50ed1bd2(item, $1221feb2184dfefe$var$mapMessageCodeToText(response, messages));\n });\n};\n\n\nconst $1653b55d89a7adce$var$getDefaultErrorFnc = (error)=>{\n throw new Error(`Request failed: ${error}`);\n};\nconst $1653b55d89a7adce$export$a4101276b4831ec4 = (checkForReadOnlyContext = false)=>{\n const asyncUrl = \"/WebPortal/async.aspx\";\n if (!window.opacc || !window.opacc.systemUrls || !checkForReadOnlyContext || !window.opacc.systemUrls.asyncReadOnly) return asyncUrl;\n return window.opacc.systemUrls.asyncReadOnly;\n};\nconst $1653b55d89a7adce$var$prepareJsonResponse = (response, showMessages)=>{\n const data = window.atob(response.data);\n const html = document.createElement(\"div\");\n html.innerHTML = data;\n const json = response.contentType === \"application/json\" && html.innerText !== \"\" ? JSON.parse(html.innerText) : {};\n showMessages && (0, $1221feb2184dfefe$export$5b256beea4c7e9b5)(response.messages, json);\n return {\n status: response.status,\n messages: response.messages,\n dataAsBase64: response.data,\n contentType: response,\n success: response.status === \"ok\",\n dataAsHtml: response.contentType === \"text/html\" ? html.innerText : \"\",\n dataAsJson: json,\n data: data\n };\n};\nconst $1653b55d89a7adce$var$recordToURLSearchParams = (data)=>{\n const searchParams = new URLSearchParams();\n Object.entries(data).forEach(([key, value])=>{\n searchParams.append(key, value || \"\");\n });\n return searchParams;\n};\nconst $1653b55d89a7adce$var$formDataToURLSearchParams = (formData)=>{\n const searchParams = new URLSearchParams();\n formData.forEach((value, key)=>{\n searchParams.append(key, value);\n });\n return searchParams;\n};\nconst $1653b55d89a7adce$export$24835cb787452b46 = async ({ requestURL: requestURL, resolveHandler: resolveHandler, rejectHandler: rejectHandler = $1653b55d89a7adce$var$getDefaultErrorFnc, payload: payload, decodeJSONResponse: decodeJSONResponse = true, cache: cache = \"default\", showMessages: showMessages = true })=>{\n const headers = new Headers({\n \"x-requested-with\": \"XMLHttpRequest\",\n \"response-type\": \"json\"\n });\n let body;\n if (payload) {\n headers.set(\"content-type\", \"application/x-www-form-urlencoded; charset=UTF-8\");\n if (payload instanceof URLSearchParams) body = payload;\n else if (payload instanceof FormData) body = $1653b55d89a7adce$var$formDataToURLSearchParams(payload);\n else if (payload instanceof Object) body = $1653b55d89a7adce$var$recordToURLSearchParams(payload);\n }\n const init = {\n method: payload ? \"POST\" : \"GET\",\n headers: headers,\n cache: cache,\n credentials: \"include\",\n body: body\n };\n try {\n const response = await fetch(requestURL, init);\n const contentType = response.headers.get(\"content-type\");\n const data = contentType?.includes(\"application/json\") ? await response.json() : await response.text();\n const preparedData = decodeJSONResponse ? $1653b55d89a7adce$var$prepareJsonResponse(data, showMessages) : data;\n resolveHandler(preparedData);\n } catch (error) {\n rejectHandler(error);\n }\n};\n\n\n\n\nvar $2215c02a950e9fbf$var$DialogActions;\n/**\r\n * data-tk-dialog-jump-forward\r\n * data-tk-dialog-jump-backward\r\n * data-tk-dialog-jump-to\r\n * data-tk-dialog-close\r\n * data-tk-dialog-close-and-reset\r\n * data-tk-close-on-backdrop-click\r\n */ (function(DialogActions) {\n DialogActions[\"JUMP_FORWARD\"] = \"jump_forward\";\n DialogActions[\"JUMP_BACKWARD\"] = \"jump_backward\";\n DialogActions[\"JUMP_TO\"] = \"jump_to\";\n DialogActions[\"RESET_FORM\"] = \"reset_form\";\n})($2215c02a950e9fbf$var$DialogActions || ($2215c02a950e9fbf$var$DialogActions = {}));\nclass $2215c02a950e9fbf$export$2e2bcd8739ae039 extends (0, $8f658dda969a7982$export$2e2bcd8739ae039) {\n constructor(){\n super();\n this.dialogs = [];\n this.currentDialog = 0;\n this.shouldOpen = false;\n this.closeOnBackdropClick = true;\n this.url = this.getAttribute(\"data-tk-url\") || undefined;\n this.button = this.querySelector(\"button\") || undefined;\n this.shouldOpen = this.hasAttribute(\"data-tk-open\");\n this.closeOnBackdropClick = this.hasAttribute(\"data-tk-close-on-backdrop-click\") ? JSON.parse(this.getAttribute(\"data-tk-close-on-backdrop-click\")) : true;\n this.shouldMaxWidth = this.hasAttribute(\"data-tk-should-max-width\");\n this.dialogClassName = this.getAttribute(\"data-tk-dialog-class-name\") || \"tk-dialog\";\n this.dialogInnerClassName = this.getAttribute(\"data-tk-dialog-inner-class-name\") || \"tk-dialog__inner\";\n this.dialogCloseClassName = this.getAttribute(\"data-tk-dialog-close-class-name\") || \"tk-button tk-button--tertiary tk-button--only-icon tk-dialog__close\";\n this.maxWidthClassName = this.getAttribute(\"data-tk-max-width-class-name\") || \"tk-dialog--max-width\";\n this.formDataString = this.getAttribute(\"data-tk-form-data\") || undefined;\n this.isPopup = this.hasAttribute(\"data-tk-is-popup\");\n this.isConfirm = this.hasAttribute(\"data-tk-is-confirm\");\n this.confirmTitle = this.getAttribute(\"data-tk-confirm-title\") || undefined;\n this.confirmDescription = this.getAttribute(\"data-tk-confirm-description\") || undefined;\n this.confirmCancelIcon = this.getAttribute(\"data-tk-confirm-cancel-icon\") || \"cross\";\n this.confirmCancelLabel = this.getAttribute(\"data-tk-confirm-cancel-label\") || undefined;\n this.confirmSubmitIcon = this.getAttribute(\"data-tk-confirm-submit-icon\") || \"check\";\n this.confirmSubmitLabel = this.getAttribute(\"data-tk-confirm-submit-label\") || undefined;\n this.forceReloadContent = this.hasAttribute(\"data-tk-force-reload-content\");\n }\n connectedCallback() {\n if (!this.url) throw new Error(\"Dialog: URL is missing!\");\n this.registerClickListener();\n this.checkAutoOpen();\n }\n registerClickListener() {\n if (!this.button) return;\n const onClick = this.openDialog.bind(this, this.url);\n this.pushListener({\n event: \"click\",\n element: this.button,\n action: onClick\n });\n }\n registerFormListener(form) {\n const onSubmit = this.handleForm.bind(this, form);\n this.pushListener({\n event: \"submit\",\n element: form,\n action: onSubmit\n });\n }\n registerCloseListener() {\n const onClick = this.closeDialog.bind(this);\n this.pushListener({\n event: \"click\",\n element: window,\n action: onClick\n });\n }\n createDialog(url) {\n const dialog = $2215c02a950e9fbf$export$2e2bcd8739ae039.renderDialog({\n className: `${this.dialogClassName} ${this.shouldMaxWidth ? this.maxWidthClassName : \"\"}`,\n closeClassName: this.dialogCloseClassName,\n innerClassName: this.dialogInnerClassName,\n tag: \"dialog\",\n isConfirm: this.isConfirm,\n confirmURL: url,\n confirmTitle: this.confirmTitle,\n confirmDescription: this.confirmDescription,\n confirmCancelIcon: this.confirmCancelIcon,\n confirmCancelLabel: this.confirmCancelLabel,\n confirmSubmitIcon: this.confirmSubmitIcon,\n confirmSubmitLabel: this.confirmSubmitLabel\n });\n const onClosed = this.closedDialog.bind(this);\n this.pushListener({\n event: \"close\",\n element: dialog,\n action: onClosed\n });\n this.currentDialog = this.dialogs.push({\n url: url,\n dialog: dialog\n }) - 1;\n return dialog;\n }\n getContent(url) {\n if (this.isConfirm) {\n this.closeCurrentDialog();\n const dialog = this.createDialog(url);\n this.isPopup ? dialog.show() : dialog.showModal();\n this.hookAfterShowModal(dialog);\n } else (0, $1653b55d89a7adce$export$24835cb787452b46)({\n requestURL: url,\n resolveHandler: this.handleResponseSuccess.bind(this, url)\n });\n }\n getContentWithData(url, payload) {\n (0, $1653b55d89a7adce$export$24835cb787452b46)({\n requestURL: url,\n resolveHandler: this.handleResponseSuccess.bind(this, url),\n payload: payload\n });\n }\n handleResponseSuccess(url, response) {\n if (!response || !response.success) return;\n this.closeCurrentDialog();\n const dialog = this.createDialog(url);\n const content = dialog.querySelector(\"[data-tk-dialog-content]\");\n if (!content) return;\n content.innerHTML = response.dataAsHtml;\n this.isPopup ? dialog.show() : dialog.showModal();\n this.hookAfterShowModal(dialog);\n const form = content.querySelector(\"form\");\n form && this.registerFormListener(form);\n }\n openDialog(url) {\n this.handleUrlAndDialogs(url);\n // This method would be used to execute code in a non-blocking way to prevent potential delays.\n setTimeout(()=>{\n this.registerCloseListener();\n });\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n closeDialog(event) {\n const dialogItem = this.dialogs.at(this.currentDialog);\n // Used to check if the event isn't triggered by the enter key\n const isRealClickEvent = event.pointerId !== -1;\n if (!dialogItem || !isRealClickEvent) return;\n const { dialog: dialog } = dialogItem;\n if (this.closeOnBackdropClick) $2215c02a950e9fbf$export$2e2bcd8739ae039.closeDialogIfOutside(dialog, event);\n }\n hookAfterShowModal(dialog) {\n $2215c02a950e9fbf$export$2e2bcd8739ae039.attachButtonClickHandler(dialog, \"[data-tk-dialog-close]\", ()=>dialog.close());\n $2215c02a950e9fbf$export$2e2bcd8739ae039.attachButtonClickHandler(dialog, \"[data-tk-dialog-close-and-reset]\", (button)=>this.handleActions(\"reset_form\", button));\n $2215c02a950e9fbf$export$2e2bcd8739ae039.attachButtonClickHandler(dialog, \"[data-tk-dialog-jump-forward]\", (button)=>this.handleActions(\"jump_forward\", button));\n $2215c02a950e9fbf$export$2e2bcd8739ae039.attachButtonClickHandler(dialog, \"[data-tk-dialog-jump-backward]\", (button)=>this.handleActions(\"jump_backward\", button));\n $2215c02a950e9fbf$export$2e2bcd8739ae039.attachButtonClickHandler(dialog, \"[data-tk-dialog-jump-to]\", (button)=>this.handleActions(\"jump_to\", button));\n }\n static attachButtonClickHandler(dialog, selector, callback) {\n const buttons = dialog.querySelectorAll(selector);\n buttons.forEach((button)=>{\n button.addEventListener(\"click\", ()=>callback(button));\n });\n }\n handleActions(action, button) {\n const handler = {\n jump_forward: ()=>this.forward(button),\n jump_backward: ()=>this.backward(),\n jump_to: ()=>this.jumpTo(button),\n reset_form: ()=>this.resetForm(button)\n };\n handler[action]();\n }\n closeCurrentDialog() {\n const dialogItem = this.dialogs.at(this.currentDialog);\n if (!dialogItem) return;\n dialogItem.dialog.close();\n }\n handleUrlAndDialogs(url) {\n const existsURL = this.dialogs.some((dialogItem)=>dialogItem.url === url);\n if (existsURL) {\n const nextDialog = this.getDialogByURL(url);\n if (!nextDialog) return;\n const waitForContent = this.forceReloadContent;\n if (this.forceReloadContent) this.renewDialogContent(nextDialog, url);\n if (waitForContent) return;\n nextDialog.showModal();\n } else try {\n const payload = JSON.parse(this.formDataString || \"{}\");\n Object.keys(payload).length > 0 ? this.getContentWithData(url, payload) : this.getContent(url);\n } catch (error) {\n throw new Error(`Dialog: ${error}`);\n }\n }\n forward(button) {\n // Check if already exists\n const url = button.getAttribute(\"data-tk-url\");\n if (!url) throw new Error(\"Dialog: URL is missing!\");\n this.closeCurrentDialog();\n this.handleUrlAndDialogs(url);\n this.currentDialog += 1;\n }\n backward() {\n const nextDialogItem = this.dialogs.at(this.currentDialog - 1);\n if (!nextDialogItem) return;\n this.closeCurrentDialog();\n nextDialogItem.dialog.showModal();\n this.currentDialog -= 1;\n }\n jumpTo(button) {\n const index = Number(button.getAttribute(\"data-tk-dialog-jump-to\"));\n const nextDialogItem = this.dialogs.at(index);\n if (!nextDialogItem) return;\n this.closeCurrentDialog();\n nextDialogItem.dialog.showModal();\n this.currentDialog = index;\n }\n resetForm(button) {\n button.form?.reset();\n this.closeCurrentDialog();\n }\n handleForm(form, event) {\n const shouldSwitchToNext = form.hasAttribute(\"data-tk-switch-to-next\");\n if (!shouldSwitchToNext) return;\n event.preventDefault();\n const formData = new FormData(form);\n const url = form.action;\n (0, $1653b55d89a7adce$export$24835cb787452b46)({\n requestURL: url,\n resolveHandler: this.handleResponseSuccess.bind(this, url),\n payload: formData\n });\n }\n getDialogByURL(url) {\n const dialogItem = this.dialogs.find((item)=>item.url === url);\n return dialogItem?.dialog;\n }\n closedDialog() {\n const allDialogClosed = this.dialogs.every((item)=>!item.dialog.open);\n if (!allDialogClosed) return;\n this.currentDialog = 0;\n this.removeListener(window);\n }\n static renderDialog(options) {\n const { tag: tag, className: className = \"tk-dialog\", closeClassName: closeClassName = \"tk-button tk-button--tertiary tk-button--only-icon tk-dialog__close\", innerClassName: innerClassName = \"tk-dialog__inner\", content: content, isConfirm: isConfirm = false, confirmURL: confirmURL, confirmTitle: confirmTitle, confirmDescription: confirmDescription, confirmCancelIcon: confirmCancelIcon, confirmCancelLabel: confirmCancelLabel, confirmSubmitIcon: confirmSubmitIcon, confirmSubmitLabel: confirmSubmitLabel } = options;\n const dialog = (0, $2d540709c75492d4$export$2e2bcd8739ae039)(`\r\n ${isConfirm ? `\r\n <${tag} class=\"${className}\">\r\n \r\n
\r\n
\r\n

${confirmTitle}

\r\n

${confirmDescription}

\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n \r\n ` : `\r\n <${tag} class=\"${className}\">\r\n \r\n
\r\n ${content}\r\n
\r\n \r\n `}\r\n `);\n document.body.insertAdjacentElement(\"beforeend\", dialog);\n $2215c02a950e9fbf$export$2e2bcd8739ae039.attachButtonClickHandler(dialog, \"[data-tk-dialog-close]\", ()=>$2215c02a950e9fbf$export$2e2bcd8739ae039.close(dialog));\n return dialog;\n }\n static open(element, isPopup = false) {\n if (element instanceof HTMLDialogElement) isPopup ? element.show() : element.showModal();\n else element.classList.add(\"tk-dialog--open\");\n }\n static close(element) {\n if (element instanceof HTMLDialogElement) element.close();\n else {\n element.classList.remove(\"tk-dialog--open\");\n element.dispatchEvent(new Event(\"close\"));\n }\n }\n static closeDialogIfOutside(element, event) {\n /**\r\n * Checking the coordinates of the client for the value 0 and the\r\n * HTMLSelectElement or HTMLOptionElement element ensures that the\r\n * dialogue does not close in Mozilla. This is a bug in Firefox\r\n * that has not yet been fixed.\r\n */ if (event.clientX === 0 && event.clientY === 0 && (event.target instanceof HTMLSelectElement || event.target instanceof HTMLOptionElement)) return;\n const dialogDimensions = element.getBoundingClientRect();\n if (event.clientX < dialogDimensions.left || event.clientX > dialogDimensions.right || event.clientY < dialogDimensions.top || event.clientY > dialogDimensions.bottom) element.close();\n }\n checkAutoOpen() {\n if (this.shouldOpen) this.openDialog(this.url);\n }\n renewDialogContent(dialog, url) {\n (0, $1653b55d89a7adce$export$24835cb787452b46)({\n requestURL: url,\n resolveHandler: this.getRenewDialogContent.bind(this, dialog)\n });\n }\n getRenewDialogContent(openDialog, response) {\n const dialogInner = openDialog.querySelector(\"[data-tk-dialog-content]\");\n dialogInner.innerHTML = response.dataAsHtml;\n openDialog.showModal();\n this.hookAfterShowModal(openDialog);\n }\n}\n\n\n\n\n\n\nclass $edcef81612fbf4b7$export$2e2bcd8739ae039 extends (0, $8f658dda969a7982$export$2e2bcd8739ae039) {\n constructor(){\n super();\n this.button = this.querySelector(\"[data-tk-static-content-edit]\") || undefined;\n this.target = this.getAttribute(\"data-tk-target\") || \"#tk-static-content-editor\";\n this.boId = this.getAttribute(\"data-tk-bo-id\") || undefined;\n this.boNumber = this.getAttribute(\"data-tk-bo-number\") || undefined;\n this.artTextNumber = this.getAttribute(\"data-tk-art-text-number\") || undefined;\n this.bo = this.getAttribute(\"data-tk-bo\") || undefined;\n this.attr = this.getAttribute(\"data-tk-attr\") || undefined;\n this.itemId = this.getAttribute(\"data-tk-id\") || undefined;\n this.langNumber = this.getAttribute(\"data-tk-lang-number\") || undefined;\n this.dataPer = this.getAttribute(\"data-tk-data-per\") || undefined;\n this.asyncTemplate = this.getAttribute(\"data-tk-async-template\") || undefined;\n this.urlTemplate = [];\n this.templateContentPromiseArray = [];\n this.templatesLoaded = false;\n this.fileUploadIFrameURL = this.getAttribute(\"data-tk-file-upload-iframe-url\") || \"\";\n }\n async connectedCallback() {\n if (!this.button || !this.boId || !this.dataPer || !this.asyncTemplate) return;\n // @ts-ignore Import module\n // eslint-disable-next-line import/extensions, import/no-absolute-path\n await (parcelRequire(\"22OJp\"));\n this.registerClickListener();\n }\n registerClickListener() {\n const onClick = this.sendAjaxRequest.bind(this);\n this.pushListener({\n event: \"click\",\n element: this.button,\n action: onClick\n });\n }\n registerModalListener(modal) {\n const saveButton = modal.querySelector(\"[data-tk-static-content-save]\") || undefined;\n const onSave = this.save.bind(this, saveButton);\n saveButton && this.pushListener({\n event: \"click\",\n element: saveButton,\n action: onSave\n });\n const cancelButton = modal.querySelector(\"[data-tk-static-content-cancel]\");\n const onCancel = this.cancel.bind(this);\n cancelButton && this.pushListener({\n event: \"click\",\n element: cancelButton,\n action: onCancel\n });\n }\n sendAjaxRequest() {\n this.requestData = {\n type: \"staticcontent\",\n boid: this.boId,\n bonumber: this.boNumber,\n arttextno: this.artTextNumber,\n per: this.dataPer,\n template: this.asyncTemplate,\n modalid: this.target,\n bo: this.bo,\n id: this.itemId,\n attr: this.attr\n };\n const url = (0, $1653b55d89a7adce$export$a4101276b4831ec4)(true);\n (0, $1653b55d89a7adce$export$24835cb787452b46)({\n requestURL: url,\n resolveHandler: this.showContentInEditMode.bind(this),\n payload: this.requestData\n });\n }\n save(button) {\n if (!button) return;\n const htmlEncoded = $edcef81612fbf4b7$export$2e2bcd8739ae039.htmlEncode($edcef81612fbf4b7$export$2e2bcd8739ae039.getContentFromEditMode());\n this.requestData = {\n type: \"staticcontent\",\n boid: this.boId,\n bonumber: this.boNumber,\n arttextno: this.artTextNumber,\n bo: this.bo,\n id: this.itemId,\n attr: this.attr,\n html: htmlEncoded\n };\n const url = (0, $1653b55d89a7adce$export$a4101276b4831ec4)();\n (0, $1653b55d89a7adce$export$24835cb787452b46)({\n requestURL: url,\n resolveHandler: this.refreshContent.bind(this),\n payload: this.requestData\n });\n this.cancel();\n }\n cancel() {\n (0, $2215c02a950e9fbf$export$2e2bcd8739ae039).close(this.dialog);\n }\n showContentInEditMode(response) {\n if (!response.success || !this.requestData) return;\n this.dialog = (0, $2215c02a950e9fbf$export$2e2bcd8739ae039).renderDialog({\n content: response.dataAsHtml,\n className: \"tk-dialog tk-dialog--fullscreen\",\n tag: \"div\"\n });\n (0, $2215c02a950e9fbf$export$2e2bcd8739ae039).open(this.dialog);\n this.pushListener({\n event: \"close\",\n element: this.dialog,\n action: ()=>this.dialog?.remove()\n });\n this.initEditor();\n const modal = document.querySelector(this.target);\n if (!modal) return;\n this.registerModalListener(modal);\n }\n static getContentFromEditMode() {\n return window.tinymce.activeEditor?.getContent({\n format: \"raw\"\n }) || \"\";\n }\n refreshContent(response) {\n if (!response.success || !this.requestData) return;\n let contentContainer = document.getElementById(`staticcontent-${this.requestData.boid}-${this.requestData.arttextno}`);\n if (!contentContainer) this.requestData.id !== undefined && (contentContainer = document.getElementById(this.requestData.id));\n else contentContainer.innerHTML = response.dataAsHtml;\n }\n initEditor() {\n if (!this.requestData) return;\n const selector = `${this.requestData.modalid} [data-tk-static-content-textarea]`;\n // Editor must be removed before initialisation\n window.tinymce.remove(selector);\n const options = {\n selector: selector,\n language: $edcef81612fbf4b7$export$2e2bcd8739ae039.getLanguage(),\n plugins: [\n \"advlist\",\n \"autolink\",\n \"lists\",\n \"link\",\n \"image\",\n \"charmap\",\n \"preview\",\n \"anchor\",\n \"pagebreak\",\n \"searchreplace\",\n \"wordcount\",\n \"visualblocks\",\n \"visualchars\",\n \"code\",\n \"fullscreen\",\n \"insertdatetime\",\n \"media\",\n \"nonbreaking\",\n \"save\",\n \"table\",\n \"directionality\",\n \"emoticons\",\n \"template\",\n \"quickbars\"\n ],\n insertdatetime_formats: [\n \"%d.%m.%Y\",\n \"%H:%M\"\n ],\n contextmenu: \"link image table\",\n tools: \"inserttable\",\n toolbar: \"undo redo | styleselect | bold italic | forecolor backcolor | alignleft aligncenteralignright alignjustify | bullist numlist outdent indent | image media link | preview print | filemanager\",\n width: \"100%\",\n base_url: \"/webportal/config/layout/themes/tk/vendor/tinymce/\",\n language_url: `/webportal/config/layout/themes/tk/translations/tinymce/${$edcef81612fbf4b7$export$2e2bcd8739ae039.getLanguage()}.js`,\n promotion: false,\n content_css: [\n \"default\",\n `/webportal/config/layout/themes/project/generated/staticcontent/staticcontent.css?${new Date().getTime()}`\n ],\n templates: this.urlTemplate,\n extended_valid_elements: \"tk-tabs-accordion,tk-tabs-accordion[class],i[data-tk-accordion-icon]\",\n custom_elements: \"tk-tabs-accordion,tk-tabs-accordion\",\n setup: (editor)=>{\n editor.on(\"SaveContent\", (event)=>{\n event.content = $edcef81612fbf4b7$export$2e2bcd8739ae039.htmlEncode($edcef81612fbf4b7$export$2e2bcd8739ae039.htmlDecode(event.content));\n });\n const openmanager = ()=>{\n editor.windowManager.openUrl({\n title: \"File Manager\",\n url: $edcef81612fbf4b7$export$2e2bcd8739ae039.getFileManagerURL(editor),\n width: 900,\n height: 440\n });\n };\n editor.ui.registry.addButton(\"filemanager\", {\n icon: \"browse\",\n tooltip: \"Insert file\",\n onAction: openmanager\n });\n editor.ui.registry.addMenuItem(\"filemanager\", {\n icon: \"browse\",\n text: \"Insert file\",\n onAction: openmanager\n });\n const templateURLElement = document.querySelector(\"[data-tk-staticcontent-templates-url]\");\n const templateURL = templateURLElement && templateURLElement.getAttribute(\"data-op-url\");\n if (templateURL) this.getTemplates(templateURL);\n }\n };\n if (this.fileUploadIFrameURL) options.file_picker_callback = this.handleFilePicker.bind(this);\n window.tinymce.init(options);\n }\n handleFilePicker(callback) {\n window.tinymce.activeEditor?.windowManager.openUrl({\n title: \"Fileupload Area\",\n url: this.fileUploadIFrameURL,\n width: 800,\n height: 600\n });\n window.addEventListener(\"message\", (event)=>{\n const { data: data } = event;\n if (window.location.origin !== event.origin) return;\n callback(data.content);\n });\n }\n static getFileManagerURL(editor) {\n return `/webportal/tinymcefilemanager.aspx?editor=${editor.id}&lang=${$edcef81612fbf4b7$export$2e2bcd8739ae039.getLanguage()}`;\n }\n static htmlEncode(content) {\n return content.toString().replace(/&/g, \"&\").replace(/\"/g, \""\").replace(//g, \">\");\n }\n static htmlDecode(content) {\n return content.toString().replace(/>/g, \">\").replace(/</g, \"<\").replace(/"/g, '\"').replace(/&/g, \"&\");\n }\n static getLanguage() {\n if (window.location.href.indexOf(\"/en/\") !== -1) return \"en_GB\";\n if (window.location.href.indexOf(\"/fr/\") !== -1) return \"fr_FR\";\n if (window.location.href.indexOf(\"/it/\") !== -1) return \"it\";\n return \"de\";\n }\n async getTemplates(templateURL) {\n if (this.templatesLoaded) return;\n // get url content\n return new Promise((resolve)=>{\n (0, $1653b55d89a7adce$export$24835cb787452b46)({\n requestURL: templateURL,\n resolveHandler: (response)=>{\n this.getTemplateContent(response, resolve);\n }\n });\n });\n }\n getTemplateContent(response, resolveFunction) {\n response.dataAsJson.forEach((element)=>{\n this.templateContentPromiseArray = [];\n this.templateContentPromiseArray.push(new Promise((resolve)=>{\n (0, $1653b55d89a7adce$export$24835cb787452b46)({\n requestURL: element.url,\n resolveHandler: (response)=>{\n this.saveTemplateContent(response, element, resolveFunction, resolve);\n }\n });\n }));\n });\n }\n saveTemplateContent(response, element, resolvedAllFunction, resolveArrayElementFunction) {\n const templateContent = response.dataAsHtml;\n const newTemplateEntry = {\n title: element.title,\n description: element.description,\n content: templateContent\n };\n this.urlTemplate.push(newTemplateEntry);\n resolveArrayElementFunction();\n Promise.allSettled(this.templateContentPromiseArray).then(()=>{\n resolvedAllFunction();\n this.templatesLoaded = true;\n });\n }\n}\n\n\n\n\n\n\n\n\nclass $cb17fd7e698c018c$export$2e2bcd8739ae039 extends (0, $8f658dda969a7982$export$2e2bcd8739ae039) {\n constructor(){\n super();\n this.listWrapperClassName = this.getAttribute(\"data-tk-zip-list-class\") || \"tk-form-zipcity__list\";\n this.fieldCountry = this.querySelector(\"[data-tk-zip-country]\") || undefined;\n this.fieldZip = this.querySelector(\"[data-tk-zip-zip]\") || undefined;\n this.fieldCity = this.querySelector(\"[data-tk-zip-city]\") || undefined;\n this.lastSearchTerm = \"\";\n this.selectedField = undefined;\n this.listWrapper = document.createElement(\"div\");\n this.listWrapper.classList.add(this.listWrapperClassName);\n this.listWrapper.hidden = true;\n this.loadingSpinnerTimeout = null;\n this.clearDataTimeout = null;\n this.inputObject = {\n inputField: undefined,\n dropdown: this.listWrapper,\n listItemSelected: undefined,\n data: []\n };\n }\n connectedCallback() {\n this.registerListener();\n }\n registerListener() {\n if (!this.fieldZip && !this.fieldCity) return;\n const onInputHandler = this.searchZipCity.bind(this);\n const onClickHandler = this.toggleDropdown.bind(this);\n const onSelectHandler = this.selectItem.bind(this);\n const onChangeHandler = this.clearFormFields.bind(this);\n const onInputKeyNavigationHandler = this.inputKeyNavigation.bind(this);\n const onDropdownKeyNavigationHandler = this.dropdownKeyNavigation.bind(this);\n this.pushListener({\n event: \"click\",\n element: this.fieldZip,\n action: onClickHandler\n });\n this.pushListener({\n event: \"click\",\n element: this.fieldCity,\n action: onClickHandler\n });\n this.pushListener({\n event: \"click\",\n element: this.inputObject.dropdown,\n action: onSelectHandler\n });\n this.pushListener({\n event: \"input\",\n element: this.fieldZip,\n action: onInputHandler\n });\n this.pushListener({\n event: \"input\",\n element: this.fieldCity,\n action: onInputHandler\n });\n this.pushListener({\n event: \"keydown\",\n element: this.fieldZip,\n action: onInputKeyNavigationHandler\n });\n this.pushListener({\n event: \"keydown\",\n element: this.fieldCity,\n action: onInputKeyNavigationHandler\n });\n this.pushListener({\n event: \"keydown\",\n element: this.inputObject.dropdown,\n action: onDropdownKeyNavigationHandler\n });\n if (this.fieldCountry) this.pushListener({\n event: \"change\",\n element: this.fieldCountry,\n action: onChangeHandler\n });\n }\n inputKeyNavigation(event) {\n if (!(event.code === \"Tab\" || event.code === \"Enter\" || event.code === \"ArrowDown\")) return;\n this.inputObject.listItemSelected = this.inputObject.dropdown?.firstElementChild;\n if (!this.inputObject.listItemSelected) return;\n this.inputObject.dropdown?.classList.remove(\"hide\");\n this.inputObject.listItemSelected.focus();\n event.preventDefault();\n }\n dropdownKeyNavigation(event) {\n const keyActions = {\n ArrowDown: ()=>this.handleArrowKey(true),\n ArrowUp: ()=>this.handleArrowKey(false),\n Enter: ()=>this.selectItem(event),\n Space: ()=>this.selectItem(event),\n Tab: ()=>this.hideDropdown(true),\n Escape: ()=>this.hideDropdown(true)\n };\n const action = keyActions[event.code];\n if (!action) return;\n action();\n event.preventDefault();\n }\n handleArrowKey(isDown) {\n if (this.inputObject.listItemSelected) {\n const nextElement = isDown ? this.inputObject.listItemSelected.nextElementSibling : this.inputObject.listItemSelected.previousElementSibling;\n if (nextElement instanceof HTMLElement) this.inputObject.listItemSelected = nextElement;\n } else this.inputObject.listItemSelected = this.inputObject.dropdown?.firstElementChild;\n if (!this.inputObject.listItemSelected) return;\n this.inputObject.listItemSelected.focus();\n this.setScroller();\n }\n hideDropdown(isHidden = false) {\n if (this.inputObject.dropdown) {\n if (!isHidden) {\n this.showLoadingAnimation();\n this.listWrapper.style.border = \"unset\";\n }\n this.inputObject.dropdown.hidden = isHidden;\n }\n }\n toggleDropdown() {\n if (this.inputObject.dropdown && this.inputObject.dropdown.hasChildNodes()) this.inputObject.dropdown.hidden = !this.inputObject.dropdown.hidden;\n }\n setScroller() {\n const { dropdown: dropdown, listItemSelected: listItemSelected } = this.inputObject;\n if (!dropdown || !listItemSelected) return;\n const index = Array.from(dropdown.children).indexOf(listItemSelected);\n const elHeight = listItemSelected.offsetHeight;\n const { scrollTop: scrollTop } = dropdown;\n const viewport = scrollTop + dropdown.offsetHeight;\n const elOffset = elHeight * index;\n if (elOffset >= scrollTop && elOffset + elHeight <= viewport) return;\n dropdown.scrollTop = elOffset;\n }\n setInputObject() {\n if (!this.selectedField?.parentElement?.querySelector(`.${this.listWrapperClassName}`)) this.selectedField?.insertAdjacentElement(\"afterend\", this.listWrapper);\n this.inputObject.inputField = this.selectedField;\n }\n searchZipCity(event) {\n this.selectedField = event.target;\n const value = this.selectedField.value.trim();\n if (value.length < 2) {\n this.clearDataTimeout && clearTimeout(this.clearDataTimeout);\n this.clearDataTimeout = setTimeout(()=>{\n this.clearData();\n }, 300);\n return;\n }\n this.lastSearchTerm = value;\n this.setInputObject();\n this.timer && clearTimeout(this.timer);\n this.timer = setTimeout(()=>{\n this.callApi(value);\n }, 300);\n }\n callApi(value) {\n if (!this.inputObject.dropdown) return;\n this.hideDropdown(false);\n if (this.lastSearchTerm !== value) return;\n const zipCity = this.parseZipCity(value);\n const apiUrl = `${window.location.origin}/api/portal/v1/zipsearch`;\n const urlObject = new URL(apiUrl);\n const { searchParams: searchParams } = urlObject;\n Object.entries(zipCity).forEach(([key, value])=>{\n searchParams.set(key, value);\n });\n (0, $1653b55d89a7adce$export$24835cb787452b46)({\n requestURL: urlObject.toString(),\n resolveHandler: this.refreshResultList.bind(this),\n decodeJSONResponse: false\n });\n }\n parseZipCity(value) {\n let zip;\n let city;\n const country = this.fieldCountry?.value?.toLowerCase() || \"ch\";\n const arr = value.split(\" \");\n const numberRegex = /^[0-9]+$/;\n const regexTest = arr.find((elem)=>numberRegex.test(elem));\n if (regexTest === undefined) zip = \"\";\n else zip = regexTest;\n if (!zip) {\n if (arr.length > 1) zip = +arr[1] || \"\";\n }\n zip = zip.toString();\n city = value.replace(zip, \"\").trim();\n if (city === \"undefined\") city = \"\";\n return {\n zip: zip,\n city: city,\n country: country\n };\n }\n refreshResultList(response) {\n if (!response) return;\n this.clearData();\n if (Array.isArray(response)) response.forEach((element)=>{\n const listItemTpl = `\r\n `;\n this.inputObject.dropdown.insertAdjacentHTML(\"beforeend\", listItemTpl);\n this.inputObject.data?.push({\n zip: element.zip,\n city: element.city,\n country: element.country\n });\n });\n if (this.inputObject.data.length === 0) {\n const listItemTpl = `\r\n
\r\n
\r\n \r\n \r\n \r\n ${(0, $86b3c5b6d66bd808$export$97a703132b664051).noMatchFound}\r\n
\r\n
`;\n this.inputObject.dropdown.insertAdjacentHTML(\"beforeend\", listItemTpl);\n }\n this.listWrapper.style.border = \"\";\n this.loadingSpinnerTimeout && clearTimeout(this.loadingSpinnerTimeout);\n this.inputObject.dropdown.hidden = false;\n }\n selectItem(event) {\n let selectedItem = event.target;\n selectedItem = selectedItem.closest(\"[data-tk-zip]\");\n if (!selectedItem) return;\n const zip = selectedItem.getAttribute(\"data-tk-zip\");\n const city = selectedItem.getAttribute(\"data-tk-city\");\n const country = selectedItem.getAttribute(\"data-tk-country\");\n if (this.fieldZip) this.fieldZip.value = zip;\n if (this.fieldCity) this.fieldCity.value = city;\n if (this.fieldCountry) this.fieldCountry.value = country;\n this.inputObject.inputField.focus();\n this.clearData();\n }\n clearFormFields() {\n this.clearData();\n this.fieldCity.value = \"\";\n this.fieldZip.value = \"\";\n }\n clearData() {\n if (this.inputObject.dropdown) {\n this.hideDropdown(true);\n this.inputObject.dropdown.replaceChildren();\n }\n this.inputObject.data = [];\n }\n showLoadingAnimation() {\n this.loadingSpinnerTimeout && clearTimeout(this.loadingSpinnerTimeout);\n this.loadingSpinnerTimeout = setTimeout(()=>{\n this.listWrapper.innerHTML = `\r\n
\r\n
\r\n
`;\n }, 300);\n }\n static async isValidZipCity(form) {\n const apiUrl = `${window.location.origin}/api/portal/v1/zipsearch`;\n const zipCityElem = {\n country: form.querySelector(\"[data-tk-zip-country]\") || \"\",\n zip: form.querySelector(\"[data-tk-zip-zip]\") || \"\",\n city: form.querySelector(\"[data-tk-zip-city]\") || \"\"\n };\n const zipCityValue = {\n country: zipCityElem.country.value,\n zip: zipCityElem.zip.value,\n city: zipCityElem.city.value\n };\n const urlObject = new URL(apiUrl);\n const { searchParams: searchParams } = urlObject;\n Object.entries(zipCityValue).forEach(([key, value])=>{\n searchParams.set(key, value);\n });\n return new Promise((resolve)=>{\n (0, $1653b55d89a7adce$export$24835cb787452b46)({\n requestURL: urlObject.toString(),\n decodeJSONResponse: false,\n resolveHandler: (response)=>{\n let isValid = false;\n if (Array.isArray(response)) response.some((item)=>{\n isValid = $cb17fd7e698c018c$export$2e2bcd8739ae039.shallowObjectEquality(zipCityValue, item);\n return isValid;\n });\n resolve(isValid);\n }\n });\n });\n }\n static shallowObjectEquality(object1, object2) {\n const keys1 = Object.keys(object1);\n const keys2 = Object.keys(object2);\n let isEqual = true;\n if (keys1.length !== keys2.length) {\n isEqual = false;\n return isEqual;\n }\n keys1.forEach((key)=>{\n if (object1[key] !== object2[key]) {\n isEqual = false;\n return isEqual;\n }\n });\n return isEqual;\n }\n}\n\n\nvar $21a7ddce6a8de4e2$var$matchType;\n(function(matchType) {\n matchType[\"Some\"] = \"SOME\";\n matchType[\"Full\"] = \"FULLMATCH\";\n})($21a7ddce6a8de4e2$var$matchType || ($21a7ddce6a8de4e2$var$matchType = {}));\nclass $21a7ddce6a8de4e2$export$2e2bcd8739ae039 extends (0, $8f658dda969a7982$export$2e2bcd8739ae039) {\n constructor(){\n super();\n this.validationList = [];\n this.form = this.querySelector(\"form\") || undefined;\n this.fieldWrapperSelector = this.getAttribute(\"data-tk-field-wrapper-selector\") || \"[data-tk-field-wrapper]\";\n this.formErrorClassName = this.getAttribute(\"data-tk-form-error-class-name\") || \"tk-form--error\";\n this.fieldHintClassName = this.getAttribute(\"data-tk-field-hint-class-name\") || \"tk-form__hint\";\n this.shouldValidateInline = this.hasAttribute(\"data-tk-should-validate-inline\");\n this.passwordStrengthMeter = this.querySelector(\"[data-tk-password-strength-meter]\") || undefined;\n this.passwordNewElement = this.querySelector(\"[data-tk-password-new]\") || undefined;\n this.passwordRepeatElement = this.querySelector(\"[data-tk-password-repeat]\") || undefined;\n this.passwordValidClassName = this.getAttribute(\"data-tk-password-valid-class-name\") || \"tk-form--valid\";\n this.passwordInvalidClassName = this.getAttribute(\"data-tk-password-valid-class-name\") || \"tk-form--invalid\";\n this.googleRecaptcha = this.querySelector(\"[data-tk-google-recaptcha]\") || undefined;\n // Selects an element that is clicked when the enter key is pressed\n this.preventEnterDefaultAction = this.getAttribute(\"data-tk-enter-data-attribute-selector\") || undefined;\n }\n connectedCallback() {\n if (!this.form) return;\n this.validationList = [];\n this.setNoValidateForm();\n this.searchFieldElements();\n this.registerSubmitListener();\n this.registerPasswordListener();\n this.shouldValidateInline && this.registerFieldValidationListener();\n }\n setNoValidateForm() {\n if (!this.form) return;\n this.form.noValidate = true;\n }\n searchFieldElements() {\n const formElements = this.querySelectorAll(\"input, select, textarea\");\n const formElementList = Array.from(formElements);\n const filteredFormElements = formElementList.filter((element)=>!element.disabled);\n filteredFormElements.forEach((element)=>{\n const wrapper = element.closest(this.fieldWrapperSelector);\n wrapper && this.validationList.push({\n element: element,\n wrapper: wrapper,\n messages: $21a7ddce6a8de4e2$export$2e2bcd8739ae039.generateValidityMessages(element)\n });\n });\n }\n registerSubmitListener() {\n if (!this.form) return;\n const onSubmitHandler = this.validateForm.bind(this);\n this.pushListener({\n event: \"submit\",\n element: this.form,\n action: onSubmitHandler\n });\n }\n registerPasswordListener() {\n if (!(this.passwordStrengthMeter && this.passwordNewElement && this.passwordRepeatElement)) return;\n const onValidatePassword = this.validatePassword.bind(this);\n this.pushListener({\n event: \"input\",\n element: this.passwordNewElement,\n action: onValidatePassword\n });\n this.pushListener({\n event: \"input\",\n element: this.passwordRepeatElement,\n action: onValidatePassword\n });\n }\n registerFieldValidationListener() {\n this.validationList.forEach((item)=>{\n const onValidation = this.validateField.bind(this, item);\n this.pushListener({\n event: \"blur\",\n element: item.element,\n action: onValidation\n });\n this.pushListener({\n event: \"input\",\n element: item.element,\n action: onValidation\n });\n });\n }\n async validateRecaptcha() {\n if (!this.googleRecaptcha) return true;\n return new Promise((resolve)=>{\n grecaptcha.ready(async ()=>{\n const siteKey = this.googleRecaptcha.getAttribute(\"data-tk-site-key\");\n if (!siteKey) return resolve(false);\n const token = await grecaptcha.execute(siteKey, {\n action: \"submit\"\n });\n if (!token) return resolve(false);\n this.googleRecaptcha.value = token;\n resolve(true);\n });\n });\n }\n async validateZipCity() {\n const validationList = [];\n const fieldElements = this.querySelectorAll(\"[data-tk-field-check-zip-city]\");\n if (fieldElements.length === 0) return true;\n const apiPromises = Array.from(fieldElements).map(async (element)=>{\n const input = element.querySelector(\"input\");\n if (!input) return true;\n const isValid = await (0, $cb17fd7e698c018c$export$2e2bcd8739ae039).isValidZipCity(this.form);\n const validationItem = this.validationList.find((item)=>item.wrapper === element);\n if (!isValid && validationItem) {\n this.removeMessage(validationItem);\n this.createElementMessage(validationItem, (0, $86b3c5b6d66bd808$export$7ea287b8bcd34b91).typeMismatch);\n }\n return isValid;\n });\n const results = await Promise.all(apiPromises);\n validationList.push(...results);\n return validationList.every((item)=>item);\n }\n async validateByAPI() {\n const validationList = [];\n const fieldElements = this.querySelectorAll(\"[data-tk-field-check-api]\");\n if (fieldElements.length === 0) return true;\n const apiPromises = Array.from(fieldElements).map(async (element)=>{\n const apiURL = element.getAttribute(\"data-tk-field-check-api\");\n const input = element.querySelector(\"input\");\n if (!input || !apiURL || input.value === \"\") return true;\n const response = await $21a7ddce6a8de4e2$export$2e2bcd8739ae039.fetchExistAPI(apiURL, input.value);\n const { isValid: isValid } = response.dataAsJson;\n const validationItem = this.validationList.find((item)=>item.wrapper === element);\n if (!isValid && validationItem) {\n this.removeMessage(validationItem);\n this.createElementMessage(validationItem, (0, $86b3c5b6d66bd808$export$35e6ad2b040b8403).existigName);\n }\n return isValid;\n });\n const results = await Promise.all(apiPromises);\n validationList.push(...results);\n return validationList.every((item)=>item);\n }\n static async fetchExistAPI(url, value) {\n return new Promise((resolve)=>{\n (0, $1653b55d89a7adce$export$24835cb787452b46)({\n requestURL: url,\n payload: {\n value: value\n },\n resolveHandler: (response)=>{\n resolve(response);\n }\n });\n });\n }\n async validateForm(event) {\n event.preventDefault();\n const isFormValid = await this.isFormValid();\n if (!isFormValid) return;\n if (this.preventEnterDefaultAction) {\n const elemntToClick = document.querySelector(`[${this.preventEnterDefaultAction}]`);\n elemntToClick?.querySelector(\"button\")?.click();\n return;\n }\n this.form?.submit();\n }\n async isFormValid() {\n await this.validateFields();\n const areFieldsValid = this.validationList.every((item)=>item.element.validity.valid);\n if (!areFieldsValid) return false;\n const isValid = await this.validateByAPI() && await this.validateZipCity();\n const isRecaptchaValid = await this.validateRecaptcha();\n return (!this.passwordStrengthMeter || this.checkPasswordStengthMeter()) && this.checkPasswordMatching() && isValid && isRecaptchaValid;\n }\n async validateFields() {\n this.validationList.forEach((item)=>{\n this.validateField(item);\n });\n this.firstElementToScrollTo = undefined;\n }\n validateField(item) {\n this.removeMessage(item);\n if (!item.element.validity.valid) this.showMessage(item);\n }\n showMessage(item) {\n const validityList = $21a7ddce6a8de4e2$export$2e2bcd8739ae039.createValidityDictionary(item.element);\n const invalidMessage = validityList.find((validity)=>validity.value);\n const message = invalidMessage ? item.messages.find((message)=>message.key === invalidMessage.key)?.value || \"\" : item.element.validationMessage;\n this.createElementMessage(item, message);\n }\n createElementMessage(item, message) {\n const spanElement = document.createElement(\"span\");\n spanElement.classList.add(this.fieldHintClassName);\n spanElement.textContent = $21a7ddce6a8de4e2$export$2e2bcd8739ae039.replacePlaceholders(message, item.element);\n item.messageElement = spanElement;\n item.wrapper.classList.add(this.formErrorClassName);\n item.wrapper.insertAdjacentElement(\"beforeend\", spanElement);\n if (this.firstElementToScrollTo) return;\n this.firstElementToScrollTo = item.messageElement;\n this.firstElementToScrollTo.scrollIntoView({\n behavior: \"smooth\",\n block: \"center\"\n });\n }\n removeMessage(item) {\n const spanElement = item.messageElement;\n if (!spanElement) return;\n spanElement.remove();\n item.wrapper.classList.remove(this.formErrorClassName);\n }\n static createValidityDictionary(element) {\n const { validity: validity } = element;\n const validityList = [];\n // eslint-disable-next-line guard-for-in, no-restricted-syntax\n for(const key in validity){\n const validityItem = {\n key: key,\n value: Boolean(validity[key])\n };\n validityList.push(validityItem);\n }\n return validityList;\n }\n static generateValidityMessages(element) {\n const list = [];\n const customErrorPrefix = \"data-tk-error-msg-\";\n const attributeList = element.getAttributeNames().filter((name)=>name.startsWith(customErrorPrefix));\n attributeList.forEach((key)=>{\n const keyFormatted = key.replace(customErrorPrefix, \"\").replace(/-./g, (x)=>x[1].toUpperCase());\n const value = element.getAttribute(key);\n value && list.push({\n key: keyFormatted,\n value: value\n });\n });\n if (0, $86b3c5b6d66bd808$export$7ea287b8bcd34b91) {\n const messages = (0, $86b3c5b6d66bd808$export$7ea287b8bcd34b91);\n Object.entries(messages).forEach((entry)=>{\n const [key, value] = entry;\n const foundMessage = list.filter((item)=>item.key === key);\n !foundMessage.length && list.push({\n key: key,\n value: value\n });\n });\n }\n return list;\n }\n static replacePlaceholders(value, element) {\n const dictionary = {\n \"{minLength}\": element.getAttribute(\"minlength\") || \"\",\n \"{maxLength}\": element.getAttribute(\"maxlength\") || \"\",\n \"{length}\": element.value.length.toString() || \"\",\n \"{step}\": element.getAttribute(\"step\") || \"\",\n \"{min}\": element.getAttribute(\"min\") || \"\",\n \"{max}\": element.getAttribute(\"max\") || \"\",\n \"{currentValue}\": element.value\n };\n const re = new RegExp(Object.keys(dictionary).join(\"|\"), \"gi\");\n return value.replace(re, (matched)=>dictionary[matched]);\n }\n checkPasswordStengthMeter() {\n const patterns = this.getPasswordPatterns();\n return patterns.every((item)=>item.element?.classList.contains(this.passwordValidClassName));\n }\n checkPasswordMatching() {\n let isValid;\n const newPasswordItem = this.validationList.find((item)=>item.element === this.passwordNewElement);\n const repeatPasswordItem = this.validationList.find((item)=>item.element === this.passwordRepeatElement);\n if (!newPasswordItem || !repeatPasswordItem) return true;\n if (newPasswordItem.element.value !== repeatPasswordItem.element.value) {\n this.removeMessage(repeatPasswordItem);\n this.createElementMessage(repeatPasswordItem, (0, $86b3c5b6d66bd808$export$7ea287b8bcd34b91).passwordNotMatching);\n isValid = false;\n } else isValid = true;\n return isValid;\n }\n validatePassword(event) {\n const target = event.currentTarget;\n const patterns = this.getPasswordPatterns();\n patterns.forEach((item)=>{\n const regex = new RegExp(item.pattern || \"\", item.matchtype === \"FULLMATCH\" ? \"g\" : \"\");\n const regexpMatch = target.value.match(regex);\n if (item.matchtype === \"SOME\") {\n if (regexpMatch) {\n item.element?.classList.remove(this.passwordInvalidClassName);\n item.element?.classList.add(this.passwordValidClassName);\n } else {\n item.element?.classList.remove(this.passwordValidClassName);\n item.element?.classList.add(this.passwordInvalidClassName);\n }\n }\n if (item.matchtype === \"FULLMATCH\") {\n if (regexpMatch?.length === target.value.length) {\n item.element?.classList.remove(this.passwordInvalidClassName);\n item.element?.classList.add(this.passwordValidClassName);\n } else {\n item.element?.classList.remove(this.passwordValidClassName);\n item.element?.classList.add(this.passwordInvalidClassName);\n }\n }\n });\n }\n getPasswordPatterns() {\n const characterPatternElement = this.passwordStrengthMeter?.querySelector(\"[data-tk-pwd-character-pattern]\");\n const upperPatternElement = this.passwordStrengthMeter?.querySelector(\"[data-tk-pwd-upper-pattern]\");\n const numberPatternElement = this.passwordStrengthMeter?.querySelector(\"[data-tk-pwd-number-pattern]\");\n const allowedSymbolPatternElement = this.passwordStrengthMeter?.querySelector(\"[data-tk-pwd-allowed-symbols-pattern]\");\n const characterPattern = characterPatternElement?.getAttribute(\"data-tk-pwd-character-pattern\");\n const upperPattern = upperPatternElement?.getAttribute(\"data-tk-pwd-upper-pattern\");\n const numberPattern = numberPatternElement?.getAttribute(\"data-tk-pwd-number-pattern\");\n const allowedSymbolPattern = allowedSymbolPatternElement?.getAttribute(\"data-tk-pwd-allowed-symbols-pattern\");\n return [\n {\n pattern: characterPattern,\n element: characterPatternElement,\n matchtype: \"SOME\"\n },\n {\n pattern: upperPattern,\n element: upperPatternElement,\n matchtype: \"SOME\"\n },\n {\n pattern: numberPattern,\n element: numberPatternElement,\n matchtype: \"SOME\"\n },\n {\n pattern: allowedSymbolPattern,\n element: allowedSymbolPatternElement,\n matchtype: \"FULLMATCH\"\n }\n ];\n }\n}\n\n\n\n\nclass $4576c900b5c49dcd$export$2e2bcd8739ae039 extends (0, $8f658dda969a7982$export$2e2bcd8739ae039) {\n constructor(){\n super();\n this.eventName = this.getAttribute(\"data-tk-event-name\") || \"event-purchase\";\n this.basketId = this.querySelector(\"[data-tk-otm-basket-id]\") || undefined;\n this.messageContainerSelector = this.getAttribute(\"data-tk-message-container-selector\") || '[id^=\"wp_messages_container_\"]';\n this.sessionTimeoutWrapper = this.querySelector(\"[data-tk-session-timeout-wrapper]\") || undefined;\n this.sessionTime = Number(this.sessionTimeoutWrapper?.getAttribute(\"data-tk-session-time\") || 0);\n this.firstItemToScrollInto = this.querySelector(\"[data-tk-scroll-into]\") || undefined;\n }\n connectedCallback() {\n this.processNotification();\n this.sessionTimeoutWrapper && this.showSessionTimeout();\n this.firstItemToScrollInto && this.scrollToElement();\n if (!this.basketId || !window.dataLayer) return;\n const data = this.getPurchaseData();\n data && window.dataLayer.push(data);\n }\n processNotification() {\n const messageContainer = document.querySelector(this.messageContainerSelector);\n if (!messageContainer || !messageContainer.hasChildNodes()) return;\n const infoMessage = messageContainer.querySelectorAll(\".Info\");\n const errorMessage = messageContainer.querySelectorAll(\".Error\");\n const warningMessage = messageContainer.querySelectorAll(\".Warning\");\n const debugMessage = messageContainer.querySelectorAll(\".Debug\");\n const messageList = Array.from([\n ...infoMessage,\n ...errorMessage,\n ...warningMessage,\n ...debugMessage\n ]);\n const types = {\n Info: (0, $1221feb2184dfefe$export$9130146a86a85749).SUCCESS,\n Error: (0, $1221feb2184dfefe$export$9130146a86a85749).ERROR,\n Warning: (0, $1221feb2184dfefe$export$9130146a86a85749).WARNING,\n Debug: (0, $1221feb2184dfefe$export$9130146a86a85749).INFO\n };\n messageList.forEach((item)=>{\n const type = types[item.className];\n const childList = Array.from(item.firstChild?.childNodes || []);\n const message = childList.find((item)=>item instanceof Text)?.textContent || \"\";\n const code = item.querySelector(\".was-message-code\")?.textContent || \"\";\n const addition = item.querySelector(\".was-message-addition\")?.textContent || \"\";\n const wait = Number(item.querySelector(\".was-message-wait\")?.textContent) || undefined;\n const consoleMessage = `${code}: ${message}} (wait: ${wait} sec.${addition})`;\n (0, $1221feb2184dfefe$export$3a57e165650c636f)(type, message, wait, {\n consoleMessage: consoleMessage\n });\n });\n messageContainer.remove();\n }\n showSessionTimeout() {\n setTimeout(()=>{\n this.sessionTimeoutWrapper.hidden = false;\n }, this.sessionTime);\n }\n getPurchaseData() {\n return {\n event: \"event-purchase\",\n ecommerce: {\n purchase: {\n actionField: this.getActionData(),\n products: this.getProductData()\n }\n }\n };\n }\n getActionData() {\n const affiliation = this.querySelector(\"[data-tk-otm-affiliation]\");\n const revenue = this.querySelector(\"[data-tk-otm-revenue]\");\n const tax = this.querySelector(\"[data-tk-otm-tax]\");\n const shipping = this.querySelector(\"[data-tk-otm-shipping]\");\n return {\n id: this.basketId.innerText,\n affiliation: affiliation ? affiliation.innerText : \"\",\n revenue: revenue ? revenue.innerText : \"\",\n tax: tax ? tax.innerText : \"\",\n shipping: shipping ? shipping.innerText : \"\"\n };\n }\n getProductData() {\n const data = [];\n const items = this.querySelectorAll(\"[data-tk-otm-item]\");\n Array.from(items).forEach((item)=>{\n const id = item.querySelector(\".otm-id\");\n const name = item.querySelector(\".otm-name\");\n const brand = item.querySelector(\".otm-brand\");\n const category = item.querySelector(\".otm-category\");\n const price = item.querySelector(\".otm-price\");\n const quantity = item.querySelector(\".otm-quantity\");\n const position = item.querySelector(\".otm-position\");\n data.push({\n id: id ? id.innerText : \"\",\n name: name ? name.innerText : \"\",\n brand: brand ? brand.innerText : \"\",\n category: category ? category.innerText : \"\",\n price: price ? price.innerText : \"\",\n quantity: quantity ? quantity.innerText : \"\",\n position: position ? position.innerText : \"\"\n });\n });\n return data;\n }\n scrollToElement() {\n const { top: top } = this.firstItemToScrollInto.getBoundingClientRect();\n const offset = Number(this.firstItemToScrollInto?.getAttribute(\"data-tk-scroll-into-offset\")) || 16;\n const mainContainer = this.querySelector(\"main\");\n const mainRect = mainContainer?.getBoundingClientRect();\n const mainRectTop = mainRect?.top || 0;\n const scrollY = top - mainRectTop - offset;\n setTimeout(()=>{\n window.scrollTo({\n top: scrollY,\n behavior: \"smooth\"\n });\n }, 0);\n }\n}\n\n\nclass $c06aa1bb3ae02f99$export$2e2bcd8739ae039 extends (0, $4576c900b5c49dcd$export$2e2bcd8739ae039) {\n constructor(){\n super();\n }\n getPurchaseData() {\n return {\n event: \"event-purchase-ga4\",\n ecommerce: {\n purchase: {\n actionField: this.getActionData(),\n products: this.getProductData()\n }\n }\n };\n }\n getActionData() {\n const affiliation = this.querySelector(\"[data-tk-otm-affiliation]\");\n const revenue = this.querySelector(\"[data-tk-otm-revenue]\");\n const tax = this.querySelector(\"[data-tk-otm-tax]\");\n const shipping = this.querySelector(\"[data-tk-otm-shipping]\");\n const currency = this.querySelector(\"[data-tk-otm-currency]\");\n return {\n id: this.basketId.innerText,\n affiliation: affiliation ? affiliation.innerText : \"\",\n revenue: revenue ? revenue.innerText : \"\",\n tax: tax ? tax.innerText : \"\",\n shipping: shipping ? shipping.innerText : \"\",\n currency: currency ? currency.innerText : \"\"\n };\n }\n getProductData() {\n const data = [];\n const items = this.querySelectorAll(\"[data-tk-otm-item]\");\n Array.from(items).forEach((item)=>{\n const id = item.querySelector(\".otm-id\");\n const name = item.querySelector(\".otm-name\");\n const brand = item.querySelector(\".otm-brand\");\n const category = item.querySelector(\".otm-category\");\n const price = item.querySelector(\".otm-price\");\n const quantity = item.querySelector(\".otm-quantity\");\n const position = item.querySelector(\".otm-position\");\n data.push({\n id: id ? id.innerText : \"\",\n name: name ? name.innerText : \"\",\n brand: brand ? brand.innerText : \"\",\n category: category ? category.innerText : \"\",\n price: price ? price.innerText : \"\",\n quantity: quantity ? quantity.innerText : \"\",\n position: position ? position.innerText : \"\"\n });\n });\n return data;\n }\n}\n\n\n\nvar $9a3403e3213d867d$var$HoverState;\n(function(HoverState) {\n HoverState[\"ACTIVE\"] = \"active\";\n HoverState[\"INACTIVE\"] = \"inactive\";\n})($9a3403e3213d867d$var$HoverState || ($9a3403e3213d867d$var$HoverState = {}));\nclass $9a3403e3213d867d$export$2e2bcd8739ae039 extends (0, $8f658dda969a7982$export$2e2bcd8739ae039) {\n constructor(){\n super();\n this.fieldElement = this.querySelector(\"input, select, textarea\");\n this.labelElement = this.querySelector(\"label\") || undefined;\n this.isMaterial = this.hasAttribute(\"data-tk-is-material\");\n this.materialClass = this.getAttribute(\"data-tk-material-class\") || \"tk-form-material\";\n this.materialNumberInputClass = this.getAttribute(\"data-tk-material-number-input-class\") || \"tk-form-material--number\";\n this.materialLabelInsideClass = this.getAttribute(\"data-tk-material-label-inside-class\") || \"tk-form-material--label-inside\";\n this.materialSelectFocussedClass = this.getAttribute(\"data-tk-material-select-focussed-class\") || \"tk-form-select--focussed\";\n this.materialLoadedClass = this.getAttribute(\"data-tk-material-loaded-class\") || \"tk-form-material--loaded\";\n this.isPasswordInput = this.hasAttribute(\"data-tk-toggle-password\");\n this.disableOnAddonClick = this.hasAttribute(\"data-tk-disable-on-addon-click\");\n this.addonElement = this.querySelector(\"[data-tk-addon]\") || undefined;\n this.waitForSurroundingContent = this.closest(\"[data-wait-for-surrounding-content]\") || undefined;\n this.addonSuffixDistance = 0;\n this.addonPrefixDistance = 0;\n this.addonDefaultPadding = parseInt(this.getAttribute(\"data-tk-addon-default-padding\") || \"0\", 10) || 4;\n this.onTransitionEnd = ()=>{};\n }\n connectedCallback() {\n if (this.isNumberInput() || this.waitForSurroundingContent) {\n this.onDomContentLoaded();\n return;\n }\n this.checkRequiredAttribute();\n this.registerAddonClickedListener();\n this.registerAddonHoverListener();\n this.registerShowPasswordClickedListener();\n this.initMaterialInput();\n this.observeDisabledAttribute();\n }\n /**\r\n * For the Material Number Input or forms inside of tables, it is necessary that all surrounding elements have been\r\n * fullyloaded before the Material Number Element itself is displayed.\r\n * This is because the position of the label in the collapsed state\r\n * needs to be calculated for the Material Number Input. This calculation depends on the surrounding elements\r\n */ onDomContentLoaded() {\n document.addEventListener(\"DOMContentLoaded\", ()=>{\n this.checkRequiredAttribute();\n this.registerAddonClickedListener();\n this.registerAddonHoverListener();\n this.registerShowPasswordClickedListener();\n this.initMaterialInput();\n this.observeDisabledAttribute();\n });\n }\n // #region Required\n checkRequiredAttribute() {\n if (!this.labelElement || !this.fieldElement || !this.fieldElement.hasAttribute(\"required\")) return;\n this.labelElement.textContent = `${this.labelElement.textContent} *`;\n }\n // #endregion\n // #region disabled\n observeDisabledAttribute() {\n if (!this.fieldElement || !this.labelElement) return;\n // inital check\n this.checkDisabledAttribute();\n const observerConfig = {\n attributes: true,\n attributeFilter: [\n \"disabled\"\n ]\n };\n const onCheckDiabledAttribute = this.checkDisabledAttribute.bind(this);\n const observer = new MutationObserver(onCheckDiabledAttribute);\n observer.observe(this.fieldElement, observerConfig);\n }\n checkDisabledAttribute() {\n const addDisabledClass = this.fieldElement.hasAttribute(\"disabled\");\n this.classList.toggle(\"tk-form-input--disabled\", addDisabledClass);\n }\n // #endregion\n // #region Addon\n registerAddonClickedListener() {\n if (!this.addonElement || this.disableOnAddonClick) return;\n const addonClickHandler = this.onAddonClicked.bind(this);\n this.pushListener({\n event: \"click\",\n element: this.addonElement,\n action: addonClickHandler\n });\n }\n registerAddonHoverListener() {\n if (!this.addonElement) return;\n const onHoverStartHandler = this.onAddonHover.bind(this, \"active\");\n this.pushListener({\n event: \"mouseenter\",\n element: this.addonElement,\n action: onHoverStartHandler\n });\n const onHoverEndHandler = this.onAddonHover.bind(this, \"inactive\");\n this.pushListener({\n event: \"mouseleave\",\n element: this.addonElement,\n action: onHoverEndHandler\n });\n }\n onAddonHover(hoverState) {\n if (!this.fieldElement || !(this.fieldElement instanceof HTMLInputElement) && !(this.fieldElement instanceof HTMLTextAreaElement)) throw new Error(\"No Input element found\");\n this.classList.toggle(\"tk-form--addon-hover\", hoverState === \"active\" && !this.fieldElement.disabled);\n }\n onAddonClicked() {\n if (!this.fieldElement || !(this.fieldElement instanceof HTMLInputElement) && !(this.fieldElement instanceof HTMLTextAreaElement)) throw new Error(\"No Input element found\");\n if (this.isPasswordInput) return;\n this.fieldElement.focus();\n const lastCharPosition = this.fieldElement.value.length;\n const isNumberInput = this.fieldElement.type === \"number\";\n if (isNumberInput) this.fieldElement.setAttribute(\"type\", \"text\");\n this.fieldElement.setSelectionRange(lastCharPosition, lastCharPosition);\n if (isNumberInput) this.fieldElement.setAttribute(\"type\", \"number\");\n }\n registerShowPasswordClickedListener() {\n if (!this.isPasswordInput || !this.addonElement) return;\n const passwordShowClickHandler = this.onPasswordShowClicked.bind(this);\n this.pushListener({\n event: \"mousedown\",\n element: this.addonElement,\n action: passwordShowClickHandler\n });\n this.pushListener({\n event: \"mouseup\",\n element: this.addonElement,\n action: passwordShowClickHandler\n });\n this.pushListener({\n event: \"touchstart\",\n element: this.addonElement,\n action: passwordShowClickHandler\n });\n this.pushListener({\n event: \"touchend\",\n element: this.addonElement,\n action: passwordShowClickHandler\n });\n }\n onPasswordShowClicked(event) {\n if (!this.fieldElement || !(this.fieldElement instanceof HTMLInputElement)) throw new Error(\"Missing input element\");\n if (event.type === \"mousedown\" || event.type === \"touchstart\") this.fieldElement.type = \"text\";\n else this.fieldElement.type = \"password\";\n }\n // #endregion\n // #region Material\n initMaterialInput() {\n if (!this.isMaterial) return;\n if (!this.fieldElement) throw new Error(\"No element found\");\n this.classList.add(this.materialClass);\n if (this.isNumberInput()) this.classList.add(this.materialNumberInputClass);\n this.registerLabelTransitionEndListener();\n this.calculateAddonWidth();\n this.setMaterialLabelState();\n this.registerMaterialValueChangeListener();\n this.registerMaterialSelectFocusChangeListener();\n }\n /**\r\n * This function is mainly used to check whether a valid value has been\r\n * set for the data-tk-addon attribute\r\n * @returns addonType: string representing the addon type\r\n */ getAddonType() {\n if (!this.addonElement) throw new Error(\"Missing addon\");\n const addonType = this.addonElement.getAttribute(\"data-tk-addon\");\n if (addonType !== \"prefix\" && addonType !== \"suffix\") throw new Error(\"Wrong addon type\");\n return addonType;\n }\n /**\r\n * Checks whether the element contains a value or not. This information is required\r\n * to determine whether the label should be displayed inside or outside the element.\r\n * @returns isEmptyElement: boolean\r\n */ checkForValue() {\n let isEmptyElement;\n if (this.fieldElement instanceof HTMLSelectElement) {\n const selectedOption = this.querySelector(\"option:checked\");\n const isPlaceholderOption = selectedOption?.hasAttribute(\"data-tk-empty-option\");\n isEmptyElement = isPlaceholderOption;\n } else isEmptyElement = this.fieldElement?.value === \"\";\n return isEmptyElement;\n }\n /**\r\n * This function implements the material functionality by displaying the label either\r\n * inside or outside the control, depending on the content\r\n */ setMaterialLabelState() {\n // check input value\n const isEmptyMaterialInput = this.checkForValue();\n if (isEmptyMaterialInput) {\n this.classList.add(this.materialLabelInsideClass);\n if (!this.labelElement) throw new Error(\"Missing label element\");\n if (this.isNumberInput()) this.setupMaterialNumberLabelStyle();\n if (!this.isNumberInput()) this.setupMaterialDefaultLabelStyle();\n } else {\n this.classList.remove(this.materialLabelInsideClass);\n if (!this.labelElement) throw new Error(\"Missing label element\");\n this.labelElement.removeAttribute(\"style\");\n }\n }\n /**\r\n * This function calculates the label position for a material input that is not of type\r\n * number and where the label is located within the input\r\n */ setupMaterialDefaultLabelStyle() {\n if (this.addonPrefixDistance === 0 && this.addonSuffixDistance === 0) return;\n this.labelElement.style.marginLeft = this.addonPrefixDistance > 0 ? `${this.addonPrefixDistance + this.addonDefaultPadding}px` : \"0px\";\n this.labelElement.style.marginRight = this.addonSuffixDistance > 0 ? `${this.addonSuffixDistance + this.addonDefaultPadding}px` : \"0px\";\n this.labelElement.style.paddingInline = \"0\";\n }\n /**\r\n * This function calculates the label position for a material input of type Number where\r\n * the label is located within the input\r\n */ setupMaterialNumberLabelStyle() {\n this.labelElement.style.paddingInline = \"0\";\n const labelWidthWithPadding = this.labelElement.getBoundingClientRect().width;\n const computedLabelStyle = window.getComputedStyle(this.labelElement);\n const labelPaddingLeft = parseFloat(computedLabelStyle.paddingLeft);\n const labelPaddingRight = parseFloat(computedLabelStyle.paddingRight);\n const labelWidth = labelWidthWithPadding - labelPaddingLeft - labelPaddingRight;\n const formControlWidth = this.getBoundingClientRect().width;\n const computetInputStyle = window.getComputedStyle(this.fieldElement);\n const inputPaddingRight = parseFloat(computetInputStyle.paddingRight);\n const addonWidth = this.addonElement && this.getAddonType() === \"suffix\" ? this.addonElement.getBoundingClientRect().width : 0;\n const xOffset = Math.round(formControlWidth - labelWidth - addonWidth - inputPaddingRight);\n this.labelElement.style.paddingLeft = `${xOffset}px`;\n }\n /**\r\n * This function checks whether the current control has an addon. If so, depending\r\n * on the type of control, it checks whether the material label requires additional\r\n * spacing in the folded state\r\n */ calculateAddonWidth() {\n if (!this.addonElement) return;\n if (this.fieldElement instanceof HTMLSelectElement) return;\n /* The text is displayed right-aligned for the number inputs.\r\n They must therefore be treated separately */ const isNumberInput = this.isNumberInput();\n const addonType = this.getAddonType();\n if (!isNumberInput && addonType === \"prefix\") this.addonPrefixDistance = this.addonElement.offsetWidth;\n else if (isNumberInput && addonType === \"suffix\") this.addonSuffixDistance = this.addonElement.offsetWidth;\n }\n /**\r\n * Checks whether the input is of type Number. This information is required because\r\n * the text does not start on the left when the number input is collapsed\r\n * @returns boolean: representing is input of type number\r\n */ isNumberInput() {\n if (!(this.fieldElement instanceof HTMLInputElement)) return false;\n return this.fieldElement && this.fieldElement.type === \"number\";\n }\n /**\r\n * Listener for material control value changes\r\n */ registerMaterialValueChangeListener() {\n const onValueChanged = this.setMaterialLabelState.bind(this);\n this.pushListener({\n event: \"input\",\n element: this.fieldElement,\n action: onValueChanged\n });\n }\n /**\r\n * Is required so that a class can be added to the focused material select\r\n * element that colors the text of the select white\r\n */ registerMaterialSelectFocusChangeListener() {\n if (!(this.fieldElement instanceof HTMLSelectElement)) return;\n const onFocusChanged = this.onMaterialSelectFocusChanged.bind(this);\n this.pushListener({\n event: \"focusin\",\n element: this.fieldElement,\n action: onFocusChanged\n });\n this.pushListener({\n event: \"focusout\",\n element: this.fieldElement,\n action: onFocusChanged\n });\n }\n /**\r\n * This function is used to add a class to the focused material select, which sets\r\n * the font to white if no option has been selected\r\n * @param event: Used to determin if focus has been set or removed\r\n */ onMaterialSelectFocusChanged(event) {\n const { type: type } = event;\n if (type === \"focusin\") this.classList.add(this.materialSelectFocussedClass);\n else this.classList.remove(this.materialSelectFocussedClass);\n }\n /**\r\n * This function fades in the material element as soon as the label is in\r\n * the correct position\r\n */ registerLabelTransitionEndListener() {\n if (!this.labelElement) throw new Error(\"Missing label element\");\n this.onTransitionEnd = this.addMaterialLoadedModifier.bind(this);\n this.pushListener({\n event: \"transitionend\",\n element: this.labelElement,\n action: this.onTransitionEnd\n });\n }\n addMaterialLoadedModifier() {\n this.classList.add(this.materialLoadedClass);\n this.labelElement.removeEventListener(\"transitionend\", this.onTransitionEnd);\n }\n}\n\n\n\nclass $183c2fdfe1dce147$export$2e2bcd8739ae039 extends (0, $9a3403e3213d867d$export$2e2bcd8739ae039) {\n constructor(){\n super();\n this.processOnInput = this.getAttribute(\"data-tk-process-on-input\") || \"\";\n }\n connectedCallback() {\n super.connectedCallback();\n if (this.processOnInput) this.registerInputListener();\n }\n registerInputListener() {\n if (!this.fieldElement) return;\n const onInputHandler = this.onInputChanged.bind(this);\n this.pushListener({\n event: \"input\",\n element: this.fieldElement,\n action: onInputHandler\n });\n }\n onInputChanged() {\n if (this.inputTimeout) clearTimeout(this.inputTimeout);\n this.inputTimeout = window.setTimeout(()=>{\n const data = {\n remark: this.fieldElement.value\n };\n (0, $1653b55d89a7adce$export$24835cb787452b46)({\n requestURL: this.processOnInput,\n resolveHandler: this.refreshContent.bind(this),\n payload: data\n });\n }, 500);\n }\n refreshContent() {\n return this;\n }\n /**\r\n * For the Material Number Input or forms inside of tables, it is necessary that all surrounding elements have been\r\n * fullyloaded before the Material Number Element itself is displayed.\r\n * This is because the position of the label in the collapsed state\r\n * needs to be calculated for the Material Number Input. This calculation depends on the surrounding elements\r\n */ onDomContentLoaded() {\n document.addEventListener(\"DOMContentLoaded\", ()=>{\n this.checkRequiredAttribute();\n this.registerAddonClickedListener();\n this.registerAddonHoverListener();\n this.registerShowPasswordClickedListener();\n this.initMaterialInput();\n this.observeDisabledAttribute();\n if (this.processOnInput) this.registerInputListener();\n });\n }\n}\n\n\n\nclass $0c064ead9dd24e2e$export$2e2bcd8739ae039 extends (0, $e31d2de11bbf216d$export$2e2bcd8739ae039) {\n constructor(){\n super([\n {\n name: \"tk-manager\",\n constructor: (0, $c06aa1bb3ae02f99$export$2e2bcd8739ae039)\n },\n {\n name: \"tk-viewport\",\n constructor: (0, $2e3d1137f4724c0f$export$2e2bcd8739ae039)\n },\n {\n name: \"tk-dialog\",\n constructor: (0, $2215c02a950e9fbf$export$2e2bcd8739ae039)\n },\n {\n name: \"tk-static-content\",\n constructor: (0, $edcef81612fbf4b7$export$2e2bcd8739ae039)\n },\n {\n name: \"tk-form-element\",\n constructor: (0, $183c2fdfe1dce147$export$2e2bcd8739ae039)\n },\n {\n name: \"tk-form-validator\",\n constructor: (0, $21a7ddce6a8de4e2$export$2e2bcd8739ae039)\n }\n ]);\n }\n}\n// eslint-disable-next-line no-new\nnew $0c064ead9dd24e2e$export$2e2bcd8739ae039();\n\n})();\n//# sourceMappingURL=contact.js.map\n","\"use strict\";\n\nvar mapping = new Map();\nfunction register(baseUrl, manifest) {\n for (var i = 0; i < manifest.length - 1; i += 2) {\n mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n }\n}\nfunction resolve(id) {\n var resolved = mapping.get(id);\n if (resolved == null) {\n throw new Error('Could not resolve bundle with id ' + id);\n }\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\nmodule.exports.register = register;\nmodule.exports.resolve = resolve;","\"use strict\";\n\nvar bundleURL = {};\nfunction getBundleURLCached(id) {\n var value = bundleURL[id];\n if (!value) {\n value = getBundleURL();\n bundleURL[id] = value;\n }\n return value;\n}\nfunction getBundleURL() {\n try {\n throw new Error();\n } catch (err) {\n var matches = ('' + err.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^)\\n]+/g);\n if (matches) {\n // The first two stack frames will be this function and getBundleURLCached.\n // Use the 3rd one, which will be a runtime in the original bundle.\n return getBaseURL(matches[2]);\n }\n }\n return '/';\n}\nfunction getBaseURL(url) {\n return ('' + url).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/.+)\\/[^/]+$/, '$1') + '/';\n}\n\n// TODO: Replace uses with `new URL(url).origin` when ie11 is no longer supported.\nfunction getOrigin(url) {\n var matches = ('' + url).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^/]+/);\n if (!matches) {\n throw new Error('Origin not found');\n }\n return matches[0];\n}\nexports.getBundleURL = getBundleURLCached;\nexports.getBaseURL = getBaseURL;\nexports.getOrigin = getOrigin;","module.exports = (require(\"./helpers/browser/js-loader\")(require('./helpers/bundle-manifest').resolve(\"jkN7i\"))).then(() => parcelRequire('S0nQY'));","\"use strict\";\n\nvar cacheLoader = require('../cacheLoader');\nmodule.exports = cacheLoader(function (bundle) {\n return new Promise(function (resolve, reject) {\n // Don't insert the same script twice (e.g. if it was already in the HTML)\n var existingScripts = document.getElementsByTagName('script');\n if ([].concat(existingScripts).some(function isCurrentBundle(script) {\n return script.src === bundle;\n })) {\n resolve();\n return;\n }\n var preloadLink = document.createElement('link');\n preloadLink.href = bundle;\n preloadLink.rel = 'preload';\n preloadLink.as = 'script';\n document.head.appendChild(preloadLink);\n var script = document.createElement('script');\n script.async = true;\n script.type = 'text/javascript';\n script.src = bundle;\n script.onerror = function (e) {\n var error = new TypeError(\"Failed to fetch dynamically imported module: \".concat(bundle, \". Error: \").concat(e.message));\n script.onerror = script.onload = null;\n script.remove();\n reject(error);\n };\n script.onload = function () {\n script.onerror = script.onload = null;\n resolve();\n };\n document.getElementsByTagName('head')[0].appendChild(script);\n });\n});","\"use strict\";\n\nvar cachedBundles = {};\nvar cachedPreloads = {};\nvar cachedPrefetches = {};\nfunction getCache(type) {\n switch (type) {\n case 'preload':\n return cachedPreloads;\n case 'prefetch':\n return cachedPrefetches;\n default:\n return cachedBundles;\n }\n}\nmodule.exports = function (loader, type) {\n return function (bundle) {\n var cache = getCache(type);\n if (cache[bundle]) {\n return cache[bundle];\n }\n return cache[bundle] = loader.apply(null, arguments).catch(function (e) {\n delete cache[bundle];\n throw e;\n });\n };\n};","require('./helpers/bundle-manifest').register(require('./helpers/bundle-url').getBundleURL('fdQ30'),JSON.parse(\"[\\\"fdQ30\\\",\\\"contact.js\\\",\\\"jkN7i\\\",\\\"../account/tinymce.min.58a25f5e.js\\\",\\\"agqxp\\\",\\\"../article/tinymce.min.05edad61.js\\\",\\\"hAiFf\\\",\\\"../checkoutfailed/tinymce.min.f15fad1d.js\\\",\\\"8XP1L\\\",\\\"tinymce.min.c1c66141.js\\\",\\\"6KVic\\\",\\\"../general/tinymce.min.0b731625.js\\\",\\\"hcLsR\\\",\\\"../internal/tinymce.min.798ab06b.js\\\",\\\"25mWf\\\",\\\"../feedback/tinymce.min.9b5a8c12.js\\\",\\\"jMuyX\\\",\\\"../staticcontent/tinymce.min.f29932a4.js\\\",\\\"jOKl9\\\",\\\"contact.css\\\"]\"));","import TKModuleFactory from '@tk/utilities/tk.module.factory';\r\nimport TKViewport from '@tk/basiscs/tk.viewport';\r\nimport TKDialog from '@tk/components/tk.dialog';\r\nimport TKStaticContent from '@tk/controls/tk.static.content';\r\nimport TKFormValidator from '@tk/controls/tk.form.validator';\r\nimport NSManager from '@/basics/ns.manager';\r\n// NS-53: Compare f�r Phase 1 auskommentiert\r\n// import TKCompareListLink from '@tk/components/tk.compare.list.link';\r\nimport NSFormElement from '@/controls/ns.form.element';\r\n\r\nimport '@scss/modules/contact.scss';\r\n\r\nexport default class Contact extends TKModuleFactory {\r\n constructor() {\r\n super([\r\n { name: 'tk-manager', constructor: NSManager },\r\n { name: 'tk-viewport', constructor: TKViewport },\r\n { name: 'tk-dialog', constructor: TKDialog },\r\n { name: 'tk-static-content', constructor: TKStaticContent },\r\n { name: 'tk-form-element', constructor: NSFormElement },\r\n { name: 'tk-form-validator', constructor: TKFormValidator },\r\n // NS-53: Compare f�r Phase 1 auskommentiert\r\n // { name: 'tk-compare-list-link', constructor: TKCompareListLink },\r\n ]);\r\n }\r\n}\r\n\r\n// eslint-disable-next-line no-new\r\nnew Contact();\r\n","export default class TKModuleFactory {\r\n customElementList: CustomElementList[];\r\n\r\n constructor(list: CustomElementList[]) {\r\n this.customElementList = list;\r\n this.init();\r\n }\r\n\r\n init(): void {\r\n this.customElementList.forEach((item) => {\r\n !customElements.get(item.name) && customElements.define(item.name, item.constructor);\r\n });\r\n }\r\n}\r\n","import TKCustomElementFactory from '@tk/utilities/tk.custom.element.factory';\r\n\r\nexport default class TKViewport extends TKCustomElementFactory {\r\n resizeEventName: string;\r\n resizeObserver: ResizeObserver;\r\n breakpoints: Map;\r\n currentBreakpoint: Breakpoint;\r\n\r\n constructor() {\r\n super();\r\n\r\n this.resizeEventName = this.getAttribute('data-tk-resize-event-name') || 'tk-viewport-resize';\r\n this.resizeObserver = new ResizeObserver(this.checkSize.bind(this));\r\n\r\n // * These breakpoints must match the CSS breakpoints, otherwise conflicts may occur.\r\n this.breakpoints = new Map([\r\n ['xs', 576],\r\n ['s', 768],\r\n ['m', 992],\r\n ['l', 1200],\r\n ['xl', 1440],\r\n ]);\r\n this.currentBreakpoint = this.getCurrentBreakpoint(this.clientWidth);\r\n }\r\n\r\n connectedCallback(): void {\r\n this.resizeObserver.observe(this);\r\n window.viewport = this;\r\n }\r\n\r\n disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n this.resizeObserver.unobserve(this);\r\n }\r\n\r\n checkSize(entries: ResizeObserverEntry[]) {\r\n entries.forEach(() => {\r\n const currentWidth = window.innerWidth;\r\n const currentBreakpoint = this.getCurrentBreakpoint(currentWidth);\r\n if (this.currentBreakpoint !== currentBreakpoint) {\r\n const event = new CustomEvent(this.resizeEventName, {\r\n bubbles: true,\r\n detail: {\r\n width: currentWidth,\r\n breakpoint: currentBreakpoint,\r\n },\r\n });\r\n this.currentBreakpoint = currentBreakpoint;\r\n this.dispatchEvent(event);\r\n }\r\n });\r\n }\r\n\r\n getCurrentBreakpoint(width: number): Breakpoint {\r\n let currentBreakpoint: Breakpoint = 'xs';\r\n this.breakpoints.forEach((value, key) => {\r\n if (width >= value) {\r\n currentBreakpoint = key;\r\n }\r\n });\r\n return currentBreakpoint;\r\n }\r\n}\r\n","export interface Listener {\r\n event: keyof HTMLElementEventMap | TKCustomEventMap;\r\n element: EventTarget;\r\n action: (event: T) => void;\r\n}\r\n\r\nexport default class TKCustomElementFactory extends HTMLElement {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n listeners: Listener[];\r\n\r\n constructor() {\r\n super();\r\n this.listeners = [];\r\n }\r\n\r\n // eslint-disable-next-line class-methods-use-this\r\n connectedCallback(): void {}\r\n\r\n /**\r\n * If the custom element is getting removed of the dom, all listeners\r\n * are getting removed of the element.\r\n */\r\n disconnectedCallback(): void {\r\n this.listeners.forEach((item) => {\r\n item.element.removeEventListener(item.event, item.action);\r\n });\r\n }\r\n\r\n /**\r\n * Here you can push a listener object directly to the listener array\r\n *\r\n * @param {Listener} {}\r\n */\r\n pushListener({ event, element, action }: Listener): void {\r\n this.listeners.push({ event, element, action });\r\n element.addEventListener(event, action as EventListener);\r\n }\r\n\r\n /**\r\n * Removes the given element from the listener array and removes the\r\n * EventListener from the element and returns the listener object.\r\n * If the element was not found, undefined is returned.\r\n *\r\n * @param {Element} element\r\n * @returns {Listener | undefined}\r\n */\r\n removeListener(element: EventTarget): Listener | undefined {\r\n const foundElement = this.listeners.find((item) => item.element === element);\r\n if (!foundElement) return;\r\n foundElement?.element.removeEventListener(foundElement.event, foundElement.action);\r\n const newList = this.listeners.filter((item) => item.element !== element);\r\n this.listeners = newList;\r\n return foundElement;\r\n }\r\n}\r\n","import { fetchRequest } from '@tk/utilities/tk.fetch';\r\nimport TKCustomElementFactory from '@tk/utilities/tk.custom.element.factory';\r\nimport render from '@tk/utilities/tk.render';\r\n\r\n/**\r\n * data-tk-dialog-jump-forward\r\n * data-tk-dialog-jump-backward\r\n * data-tk-dialog-jump-to\r\n * data-tk-dialog-close\r\n * data-tk-dialog-close-and-reset\r\n * data-tk-close-on-backdrop-click\r\n */\r\n\r\nenum DialogActions {\r\n JUMP_FORWARD = 'jump_forward',\r\n JUMP_BACKWARD = 'jump_backward',\r\n JUMP_TO = 'jump_to',\r\n RESET_FORM = 'reset_form',\r\n}\r\n\r\ninterface DialogItem {\r\n url: string;\r\n dialog: HTMLDialogElement;\r\n}\r\n\r\ninterface RenderedDialog {\r\n className?: string;\r\n closeClassName?: string;\r\n innerClassName?: string;\r\n content?: string;\r\n isConfirm?: boolean;\r\n confirmURL?: string;\r\n confirmTitle?: string;\r\n confirmDescription?: string;\r\n confirmCancelIcon?: string;\r\n confirmCancelLabel?: string;\r\n confirmSubmitIcon?: string;\r\n confirmSubmitLabel?: string;\r\n}\r\n\r\nexport default class TKDialog extends TKCustomElementFactory {\r\n protected dialogs: DialogItem[] = [];\r\n protected currentDialog: number = 0;\r\n\r\n url?: string;\r\n button?: HTMLButtonElement;\r\n shouldOpen: boolean = false;\r\n closeOnBackdropClick: boolean = true;\r\n dialogClassName: string;\r\n dialogInnerClassName: string;\r\n dialogCloseClassName: string;\r\n shouldMaxWidth: boolean;\r\n maxWidthClassName: string;\r\n formDataString?: string;\r\n isPopup: boolean;\r\n isConfirm: boolean;\r\n confirmTitle?: string;\r\n confirmDescription?: string;\r\n confirmCancelIcon?: string;\r\n confirmCancelLabel?: string;\r\n confirmSubmitIcon?: string;\r\n confirmSubmitLabel?: string;\r\n forceReloadContent:boolean;\r\n\r\n constructor() {\r\n super();\r\n\r\n this.url = this.getAttribute('data-tk-url') || undefined;\r\n this.button = this.querySelector('button') || undefined;\r\n this.shouldOpen = this.hasAttribute('data-tk-open');\r\n this.closeOnBackdropClick = this.hasAttribute('data-tk-close-on-backdrop-click')\r\n ? JSON.parse(this.getAttribute('data-tk-close-on-backdrop-click')!) : true;\r\n this.shouldMaxWidth = this.hasAttribute('data-tk-should-max-width');\r\n this.dialogClassName = this.getAttribute('data-tk-dialog-class-name') || 'tk-dialog';\r\n this.dialogInnerClassName = this.getAttribute('data-tk-dialog-inner-class-name') || 'tk-dialog__inner';\r\n this.dialogCloseClassName = this.getAttribute('data-tk-dialog-close-class-name')\r\n || 'tk-button tk-button--tertiary tk-button--only-icon tk-dialog__close';\r\n this.maxWidthClassName = this.getAttribute('data-tk-max-width-class-name') || 'tk-dialog--max-width';\r\n this.formDataString = this.getAttribute('data-tk-form-data') || undefined;\r\n this.isPopup = this.hasAttribute('data-tk-is-popup');\r\n this.isConfirm = this.hasAttribute('data-tk-is-confirm');\r\n this.confirmTitle = this.getAttribute('data-tk-confirm-title') || undefined;\r\n this.confirmDescription = this.getAttribute('data-tk-confirm-description') || undefined;\r\n this.confirmCancelIcon = this.getAttribute('data-tk-confirm-cancel-icon') || 'cross';\r\n this.confirmCancelLabel = this.getAttribute('data-tk-confirm-cancel-label') || undefined;\r\n this.confirmSubmitIcon = this.getAttribute('data-tk-confirm-submit-icon') || 'check';\r\n this.confirmSubmitLabel = this.getAttribute('data-tk-confirm-submit-label') || undefined;\r\n this.forceReloadContent = this.hasAttribute('data-tk-force-reload-content');\r\n }\r\n\r\n connectedCallback(): void {\r\n if (!this.url) throw new Error('Dialog: URL is missing!');\r\n this.registerClickListener();\r\n this.checkAutoOpen();\r\n }\r\n\r\n registerClickListener(): void {\r\n if (!this.button) return;\r\n const onClick = this.openDialog.bind(this, this.url!);\r\n this.pushListener({ event: 'click', element: this.button, action: onClick });\r\n }\r\n\r\n registerFormListener(form: HTMLFormElement): void {\r\n const onSubmit = this.handleForm.bind(this, form);\r\n this.pushListener({ event: 'submit', element: form, action: onSubmit });\r\n }\r\n\r\n registerCloseListener(): void {\r\n const onClick = this.closeDialog.bind(this);\r\n this.pushListener({ event: 'click', element: window, action: onClick });\r\n }\r\n\r\n createDialog(url: string): HTMLDialogElement {\r\n const dialog = TKDialog.renderDialog({\r\n className: `${this.dialogClassName} ${this.shouldMaxWidth ? this.maxWidthClassName : ''}`,\r\n closeClassName: this.dialogCloseClassName,\r\n innerClassName: this.dialogInnerClassName,\r\n tag: 'dialog',\r\n isConfirm: this.isConfirm,\r\n confirmURL: url,\r\n confirmTitle: this.confirmTitle,\r\n confirmDescription: this.confirmDescription,\r\n confirmCancelIcon: this.confirmCancelIcon,\r\n confirmCancelLabel: this.confirmCancelLabel,\r\n confirmSubmitIcon: this.confirmSubmitIcon,\r\n confirmSubmitLabel: this.confirmSubmitLabel,\r\n });\r\n const onClosed = this.closedDialog.bind(this);\r\n this.pushListener({ event: 'close', element: dialog, action: onClosed });\r\n this.currentDialog = this.dialogs.push({ url, dialog }) - 1;\r\n return dialog;\r\n }\r\n\r\n getContent(url: string): void {\r\n if (this.isConfirm) {\r\n this.closeCurrentDialog();\r\n const dialog = this.createDialog(url);\r\n this.isPopup ? dialog.show() : dialog.showModal();\r\n this.hookAfterShowModal(dialog);\r\n } else {\r\n fetchRequest({\r\n requestURL: url,\r\n resolveHandler: this.handleResponseSuccess.bind(this, url),\r\n });\r\n }\r\n }\r\n\r\n getContentWithData(url: string, payload: Record): void {\r\n fetchRequest({\r\n requestURL: url,\r\n resolveHandler: this.handleResponseSuccess.bind(this, url),\r\n payload,\r\n });\r\n }\r\n\r\n handleResponseSuccess(url: string, response: TKResponse): void {\r\n if (!response || !response.success) return;\r\n this.closeCurrentDialog();\r\n const dialog = this.createDialog(url);\r\n const content = dialog.querySelector('[data-tk-dialog-content]');\r\n if (!content) return;\r\n content.innerHTML = response.dataAsHtml;\r\n this.isPopup ? dialog.show() : dialog.showModal();\r\n this.hookAfterShowModal(dialog);\r\n const form = content.querySelector('form');\r\n form && this.registerFormListener(form);\r\n }\r\n\r\n openDialog(url: string) {\r\n this.handleUrlAndDialogs(url);\r\n // This method would be used to execute code in a non-blocking way to prevent potential delays.\r\n setTimeout(() => {\r\n this.registerCloseListener();\r\n });\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n closeDialog(event: any): void {\r\n const dialogItem = this.dialogs.at(this.currentDialog);\r\n // Used to check if the event isn't triggered by the enter key\r\n const isRealClickEvent = event.pointerId !== -1;\r\n\r\n if (!dialogItem || !isRealClickEvent) return;\r\n const { dialog } = dialogItem;\r\n if (this.closeOnBackdropClick) {\r\n TKDialog.closeDialogIfOutside(dialog, event);\r\n }\r\n }\r\n\r\n hookAfterShowModal(dialog: HTMLDialogElement): void {\r\n TKDialog.attachButtonClickHandler(\r\n dialog,\r\n '[data-tk-dialog-close]',\r\n () => dialog.close(),\r\n );\r\n TKDialog.attachButtonClickHandler(\r\n dialog,\r\n '[data-tk-dialog-close-and-reset]',\r\n (button) => this.handleActions(DialogActions.RESET_FORM, button),\r\n );\r\n TKDialog.attachButtonClickHandler(\r\n dialog,\r\n '[data-tk-dialog-jump-forward]',\r\n (button) => this.handleActions(DialogActions.JUMP_FORWARD, button),\r\n );\r\n TKDialog.attachButtonClickHandler(\r\n dialog,\r\n '[data-tk-dialog-jump-backward]',\r\n (button) => this.handleActions(DialogActions.JUMP_BACKWARD, button),\r\n );\r\n TKDialog.attachButtonClickHandler(\r\n dialog,\r\n '[data-tk-dialog-jump-to]',\r\n (button) => this.handleActions(DialogActions.JUMP_TO, button),\r\n );\r\n }\r\n\r\n static attachButtonClickHandler(\r\n dialog: T,\r\n selector: string,\r\n callback: (button: HTMLButtonElement) => void,\r\n ): void {\r\n const buttons = dialog.querySelectorAll(selector);\r\n buttons.forEach((button) => {\r\n button.addEventListener('click', () => callback(button));\r\n });\r\n }\r\n\r\n handleActions(action: DialogActions, button: HTMLButtonElement) {\r\n const handler: Record void> = {\r\n jump_forward: () => this.forward(button),\r\n jump_backward: () => this.backward(),\r\n jump_to: () => this.jumpTo(button),\r\n reset_form: () => this.resetForm(button),\r\n };\r\n handler[action]();\r\n }\r\n\r\n closeCurrentDialog() {\r\n const dialogItem = this.dialogs.at(this.currentDialog);\r\n if (!dialogItem) return;\r\n dialogItem.dialog.close();\r\n }\r\n\r\n handleUrlAndDialogs(url: string) {\r\n const existsURL = this.dialogs.some((dialogItem) => dialogItem.url === url);\r\n if (existsURL) {\r\n const nextDialog = this.getDialogByURL(url);\r\n if (!nextDialog) return;\r\n const waitForContent = this.forceReloadContent;\r\n if (this.forceReloadContent) {\r\n this.renewDialogContent(nextDialog, url);\r\n }\r\n if (waitForContent) return;\r\n nextDialog.showModal();\r\n } else {\r\n try {\r\n const payload = JSON.parse(this.formDataString || '{}');\r\n Object.keys(payload).length > 0 ? this.getContentWithData(url, payload) : this.getContent(url);\r\n } catch (error) {\r\n throw new Error(`Dialog: ${error}`);\r\n }\r\n }\r\n }\r\n\r\n forward(button: HTMLButtonElement) {\r\n // Check if already exists\r\n const url = button.getAttribute('data-tk-url');\r\n if (!url) throw new Error('Dialog: URL is missing!');\r\n this.closeCurrentDialog();\r\n this.handleUrlAndDialogs(url);\r\n this.currentDialog += 1;\r\n }\r\n\r\n backward() {\r\n const nextDialogItem = this.dialogs.at(this.currentDialog - 1);\r\n if (!nextDialogItem) return;\r\n this.closeCurrentDialog();\r\n nextDialogItem.dialog.showModal();\r\n this.currentDialog -= 1;\r\n }\r\n\r\n jumpTo(button: HTMLButtonElement) {\r\n const index = Number(button.getAttribute('data-tk-dialog-jump-to'));\r\n const nextDialogItem = this.dialogs.at(index);\r\n if (!nextDialogItem) return;\r\n this.closeCurrentDialog();\r\n nextDialogItem.dialog.showModal();\r\n this.currentDialog = index;\r\n }\r\n\r\n resetForm(button: HTMLButtonElement) {\r\n button.form?.reset();\r\n this.closeCurrentDialog();\r\n }\r\n\r\n handleForm(form: HTMLFormElement, event: SubmitEvent): void {\r\n const shouldSwitchToNext = form.hasAttribute('data-tk-switch-to-next');\r\n if (!shouldSwitchToNext) return;\r\n event.preventDefault();\r\n const formData = new FormData(form);\r\n const url = form.action;\r\n\r\n fetchRequest({\r\n requestURL: url,\r\n resolveHandler: this.handleResponseSuccess.bind(this, url),\r\n payload: formData,\r\n });\r\n }\r\n\r\n getDialogByURL(url: string): HTMLDialogElement | undefined {\r\n const dialogItem = this.dialogs.find((item) => item.url === url);\r\n return dialogItem?.dialog;\r\n }\r\n\r\n closedDialog(): void {\r\n const allDialogClosed = this.dialogs.every((item) => !item.dialog.open);\r\n if (!allDialogClosed) return;\r\n this.currentDialog = 0;\r\n this.removeListener(window);\r\n }\r\n\r\n static renderDialog(\r\n options: RenderedDialog & { tag: keyof HTMLElementTagNameMap },\r\n ): T {\r\n const {\r\n tag,\r\n className = 'tk-dialog',\r\n closeClassName = 'tk-button tk-button--tertiary tk-button--only-icon tk-dialog__close',\r\n innerClassName = 'tk-dialog__inner',\r\n content,\r\n isConfirm = false,\r\n confirmURL,\r\n confirmTitle,\r\n confirmDescription,\r\n confirmCancelIcon,\r\n confirmCancelLabel,\r\n confirmSubmitIcon,\r\n confirmSubmitLabel,\r\n } = options;\r\n\r\n const dialog = render(`\r\n ${isConfirm ? `\r\n <${tag} class=\"${className}\">\r\n \r\n
\r\n
\r\n

${confirmTitle}

\r\n

${confirmDescription}

\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n \r\n ` : `\r\n <${tag} class=\"${className}\">\r\n \r\n
\r\n ${content}\r\n
\r\n \r\n `}\r\n `);\r\n document.body.insertAdjacentElement('beforeend', dialog);\r\n TKDialog.attachButtonClickHandler(\r\n dialog,\r\n '[data-tk-dialog-close]',\r\n () => TKDialog.close(dialog),\r\n );\r\n return dialog;\r\n }\r\n\r\n static open(element: T, isPopup = false) {\r\n if (element instanceof HTMLDialogElement) {\r\n isPopup ? element.show() : element.showModal();\r\n } else {\r\n element.classList.add('tk-dialog--open');\r\n }\r\n }\r\n\r\n static close(element: T) {\r\n if (element instanceof HTMLDialogElement) {\r\n element.close();\r\n } else {\r\n element.classList.remove('tk-dialog--open');\r\n element.dispatchEvent(new Event('close'));\r\n }\r\n }\r\n\r\n static closeDialogIfOutside(element: HTMLDialogElement, event: MouseEvent) {\r\n /**\r\n * Checking the coordinates of the client for the value 0 and the\r\n * HTMLSelectElement or HTMLOptionElement element ensures that the\r\n * dialogue does not close in Mozilla. This is a bug in Firefox\r\n * that has not yet been fixed.\r\n */\r\n if (\r\n event.clientX === 0\r\n && event.clientY === 0\r\n && (event.target instanceof HTMLSelectElement || event.target instanceof HTMLOptionElement)\r\n ) return;\r\n const dialogDimensions = element.getBoundingClientRect();\r\n if (\r\n event.clientX < dialogDimensions.left\r\n || event.clientX > dialogDimensions.right\r\n || event.clientY < dialogDimensions.top\r\n || event.clientY > dialogDimensions.bottom\r\n ) {\r\n element.close();\r\n }\r\n }\r\n\r\n checkAutoOpen() : void {\r\n if (this.shouldOpen) {\r\n this.openDialog(this.url!);\r\n }\r\n }\r\n\r\n renewDialogContent(dialog: HTMLDialogElement, url: string) {\r\n fetchRequest({\r\n requestURL: url,\r\n resolveHandler: this.getRenewDialogContent.bind(this, dialog),\r\n });\r\n }\r\n\r\n getRenewDialogContent(openDialog: HTMLDialogElement, response: TKResponse) {\r\n const dialogInner = openDialog.querySelector('[data-tk-dialog-content]');\r\n dialogInner!.innerHTML = response.dataAsHtml;\r\n openDialog.showModal();\r\n this.hookAfterShowModal(openDialog);\r\n }\r\n}\r\n","import { sendNotificationByItems } from './tk.notification';\r\n\r\nexport interface FetchAsyncParams {\r\n requestURL: string;\r\n resolveHandler: (response: TKResponse) => void;\r\n rejectHandler?: (response: unknown) => void;\r\n payload?: Record | FormData | URLSearchParams;\r\n decodeJSONResponse?: boolean;\r\n cache?: RequestCache;\r\n showMessages?: boolean;\r\n}\r\n\r\nconst getDefaultErrorFnc = (error: unknown) => {\r\n throw new Error(`Request failed: ${error}`);\r\n};\r\n\r\nexport const setAsyncUrl = (checkForReadOnlyContext = false) => {\r\n const asyncUrl = '/WebPortal/async.aspx';\r\n\r\n if (\r\n !window.opacc\r\n || !window.opacc.systemUrls\r\n || !checkForReadOnlyContext\r\n || !window.opacc.systemUrls.asyncReadOnly\r\n ) return asyncUrl;\r\n\r\n return window.opacc.systemUrls.asyncReadOnly;\r\n};\r\n\r\nconst prepareJsonResponse = (response: WASResponse, showMessages: boolean) => {\r\n const data = window.atob(response.data);\r\n const html = document.createElement('div');\r\n html.innerHTML = data;\r\n\r\n const json = response.contentType === 'application/json' && html.innerText !== ''\r\n ? JSON.parse(html.innerText)\r\n : {};\r\n\r\n showMessages && sendNotificationByItems(response.messages, json);\r\n\r\n return {\r\n status: response.status,\r\n messages: response.messages,\r\n dataAsBase64: response.data,\r\n contentType: response,\r\n success: response.status === 'ok',\r\n dataAsHtml: response.contentType === 'text/html' ? html.innerText : '',\r\n dataAsJson: json,\r\n data,\r\n } as unknown as TKResponse;\r\n};\r\n\r\nconst recordToURLSearchParams = (data: Record): URLSearchParams => {\r\n const searchParams = new URLSearchParams();\r\n Object.entries(data).forEach(([key, value]) => {\r\n searchParams.append(key, value || '');\r\n });\r\n return searchParams;\r\n};\r\n\r\nconst formDataToURLSearchParams = (formData: FormData): URLSearchParams => {\r\n const searchParams = new URLSearchParams();\r\n formData.forEach((value, key) => {\r\n searchParams.append(key, value as string);\r\n });\r\n return searchParams;\r\n};\r\n\r\nexport const fetchRequest = async ({\r\n requestURL,\r\n resolveHandler,\r\n rejectHandler = getDefaultErrorFnc,\r\n payload,\r\n decodeJSONResponse = true,\r\n cache = 'default',\r\n showMessages = true,\r\n}: FetchAsyncParams) => {\r\n const headers = new Headers({\r\n 'x-requested-with': 'XMLHttpRequest',\r\n 'response-type': 'json',\r\n });\r\n\r\n let body;\r\n if (payload) {\r\n headers.set('content-type', 'application/x-www-form-urlencoded; charset=UTF-8');\r\n if (payload instanceof URLSearchParams) {\r\n body = payload;\r\n } else if (payload instanceof FormData) {\r\n body = formDataToURLSearchParams(payload);\r\n } else if (payload instanceof Object) {\r\n body = recordToURLSearchParams(payload);\r\n }\r\n }\r\n\r\n const init: RequestInit = {\r\n method: payload ? 'POST' : 'GET',\r\n headers,\r\n cache,\r\n credentials: 'include',\r\n body,\r\n };\r\n\r\n try {\r\n const response = await fetch(requestURL, init);\r\n const contentType = response.headers.get('content-type');\r\n const data = contentType?.includes('application/json')\r\n ? await response.json()\r\n : await response.text();\r\n const preparedData = decodeJSONResponse ? prepareJsonResponse(data, showMessages) : data;\r\n resolveHandler(preparedData);\r\n } catch (error) {\r\n rejectHandler(error);\r\n }\r\n};\r\n","import {\r\n accountMessages, deliveryMessages, generalMessages, paymentMessages,\r\n} from './tk.messages';\r\nimport render from './tk.render';\r\n\r\nexport enum NotificationType {\r\n SUCCESS = 'Success',\r\n WARNING = 'Warning',\r\n ERROR = 'Error',\r\n INFO = 'Info',\r\n}\r\n\r\ninterface MessageResponse {\r\n pluginId: string;\r\n paymentType: string;\r\n}\r\n\r\nconst mapMessageCodeToText = (response: MessageResponse, messages: Record) => {\r\n let textMessage;\r\n if (!response.pluginId) return '';\r\n if (response.pluginId === 'paymentType') {\r\n const paymentMessages: Record = {\r\n 0: messages.messagePaymentTypeGeneral.text,\r\n 1: messages.messagePaymentTypeCreditCard.text,\r\n 2: messages.messagePaymentTypeInvoice.text,\r\n 5: messages.messagePaymentTypeInAdvance.text,\r\n 6: messages.messagePaymentTypeOnDelivery.text,\r\n };\r\n textMessage = paymentMessages[Number(response.paymentType) || 0];\r\n } else if (response.pluginId === 'deliveryType') {\r\n textMessage = messages.messageDeliveryTypeGeneral.text;\r\n } else if (response.pluginId === 'checkoutAdressChange') {\r\n textMessage = messages.messageChangeSuccess.text;\r\n }\r\n return textMessage;\r\n};\r\n\r\nconst getConsoleStyle = (backgroundColor: string, textColor: string = 'white') => [\r\n `background: ${backgroundColor}`,\r\n `color: ${textColor}`,\r\n 'display: block',\r\n].join(';');\r\n\r\nconst logToConsole = (message: string, type: NotificationType) => {\r\n const consoleHandler: Record void> = {\r\n [NotificationType.SUCCESS](): void {\r\n // eslint-disable-next-line no-console\r\n console.info(`%c ${message}`, getConsoleStyle('green'));\r\n },\r\n [NotificationType.WARNING](): void {\r\n // eslint-disable-next-line no-console\r\n console.warn(`%c ${message}`, getConsoleStyle('yellow', 'black'));\r\n },\r\n [NotificationType.ERROR](): void {\r\n // eslint-disable-next-line no-console\r\n console.log(`%c ${message}`, getConsoleStyle('red'));\r\n },\r\n [NotificationType.INFO](): void {\r\n // eslint-disable-next-line no-console\r\n console.debug(`%c ${message}`, getConsoleStyle('blue'));\r\n },\r\n };\r\n\r\n consoleHandler[type]();\r\n};\r\n\r\nconst renderMessageContainer = (parentElement: HTMLElement) => {\r\n let messageContainer = parentElement.querySelector('[data-tk-message-container]');\r\n if (!messageContainer) {\r\n messageContainer = render(\r\n '
',\r\n );\r\n parentElement.insertAdjacentElement('beforeend', messageContainer);\r\n }\r\n\r\n return messageContainer;\r\n};\r\n\r\nexport const sendNotification = (\r\n type: NotificationType,\r\n message?: string,\r\n wait: number = 2.5,\r\n options: { consoleMessage?: string } = {},\r\n) => {\r\n if (!message) return;\r\n const dialogs = document.querySelectorAll('dialog[open]');\r\n let messageContainer: HTMLElement;\r\n\r\n if (dialogs.length === 0) {\r\n messageContainer = renderMessageContainer(document.body);\r\n } else {\r\n const lastDialog = Array.from(dialogs).at(-1);\r\n if (!lastDialog) {\r\n messageContainer = renderMessageContainer(document.body);\r\n } else {\r\n messageContainer = renderMessageContainer(lastDialog);\r\n }\r\n }\r\n\r\n const toast = render(`\r\n
\r\n \r\n ${message}\r\n
\r\n `);\r\n\r\n toast.style.animation = `fadein .5s, fadeout .5s ${wait}s`;\r\n toast.classList.add('tk-message--show');\r\n\r\n messageContainer.appendChild(toast);\r\n\r\n toast.addEventListener('animationend', (event) => {\r\n if ((event as AnimationEvent).animationName !== 'fadeout') return;\r\n messageContainer.removeChild(toast);\r\n });\r\n\r\n options.consoleMessage\r\n ? logToConsole(options.consoleMessage, type)\r\n : logToConsole(message, type);\r\n};\r\n\r\nexport const sendNotificationByItem = (item: Message, messageOverride?: string) => {\r\n const type = item.code.substring(0, 1);\r\n const message = messageOverride || item.text;\r\n\r\n const typeHandler: Record void> = {\r\n 1: () => sendNotification(NotificationType.SUCCESS, message, item.wait),\r\n 2: () => sendNotification(NotificationType.WARNING, message, item.wait),\r\n 3: () => sendNotification(NotificationType.ERROR, message, item.wait),\r\n 4: () => sendNotification(NotificationType.INFO, message, item.wait),\r\n };\r\n\r\n typeHandler[type]();\r\n};\r\n\r\nexport const sendNotificationByItems = (items: Message[], response: MessageResponse) => {\r\n const messages = {\r\n ...generalMessages, ...accountMessages, ...paymentMessages, ...deliveryMessages,\r\n };\r\n items.forEach((item) => {\r\n sendNotificationByItem(item, mapMessageCodeToText(response, messages));\r\n });\r\n};\r\n","/* eslint-disable max-len */\r\n\r\nconst globalFormErrorMessages: FormValidatorMessages = {\r\n badInput: 'Please enter a number.',\r\n patternMismatch: 'Please match the requested format.',\r\n rangeOverflow: 'Please select a value that is no more than {max}.',\r\n rangeUnderflow: 'Please select a value that is no less than {min}.',\r\n stepMismatch: 'Please select a value that is a multiple from {step}.',\r\n tooLong:\r\n 'Please shorten this text to no more than {maxLength} characters. You are currently using {length} characters.',\r\n tooShort:\r\n 'Please lengthen this text to {minLength} characters or more. You are currently using {length} characters.',\r\n typeMismatch: 'The value you have entered for this field is invalid.',\r\n valueMissing: 'Please fill out this field.',\r\n // These properties must be empty.\r\n valid: '',\r\n customError: '',\r\n};\r\n\r\nconst globalFormPasswordValidityMessages: FormExpandValidatorMessages = {\r\n passwordNotMatching: 'The password does not match the one above.',\r\n};\r\n\r\nconst globalFormExpandErrorMessages: FormExpandValidatorMessages = {\r\n stepAdjust: 'The value you entered for this field is invalid. The value has been changed from {currentValue} to {newValue}',\r\n existigName: 'This name {currentValue} already exists.',\r\n};\r\n\r\nconst globalBasketMessages: Translation = {\r\n messageEmptyBasket: { code: '1-6-6220', text: 'Shopping cart is empty' },\r\n messageAddedToBasket: { code: '1-6-6221', text: 'added to the shopping cart' },\r\n quickOrderMessageTooShort: { code: '1-6-6222', text: 'At least %1 characters are required for a search.' },\r\n};\r\n\r\nconst globalDeliveryMessages: Translation = {\r\n messageDeliveryTypeGeneral: { code: '1-6-6226', text: 'Delivery method changed' },\r\n};\r\n\r\nconst globalPaymentMessages: Translation = {\r\n messagePaymentTypeCreditCard: { code: '1-6-6227', text: 'Payment type credit card' },\r\n messagePaymentTypeInvoice: { code: '1-6-6227', text: 'Payment type invoice' },\r\n messagePaymentTypeInAdvance: { code: '1-6-6227', text: 'Payment type advance payment' },\r\n messagePaymentTypeOnDelivery: { code: '1-6-6227', text: 'Payment type cash on delivery' },\r\n messagePaymentTypeGeneral: { code: '1-6-6227', text: 'Payment type changed' },\r\n};\r\n\r\nconst globalCompareMessages: Translation = {\r\n messageHint: { code: '1-6-6240', text: '' },\r\n allRemoved: { code: '1-6-6240', text: 'All items removed' },\r\n empty: { code: '1-6-6240', text: 'Your article comparison is empty.' },\r\n};\r\n\r\nconst globalFavoriteMessages: Translation = {\r\n messageInvalidName: { code: '2-6-6270', text: 'Unable to create the wish list; the name is invalid.' },\r\n messageMaxLists: { code: '2-6-6277', text: 'Max. number of wish lists reached!' },\r\n messageMaxPositions: { code: '2-6-6278', text: 'Max. number of positions reached!' },\r\n messageDeleteConfirmation: { code: '2-6-6273', text: 'Do you really want to delete the wish list?' },\r\n};\r\n\r\nconst globalAutocompleteMessages: Translation = {\r\n messageNoValueFound: { code: '1-6-6290', text: 'No match found!' },\r\n};\r\n\r\nconst globalAccountMessages: Translation = {\r\n messageDelete: { code: '1-6-6200', text: 'Do you really want to delete this address?' },\r\n messageChangeSuccess: { code: '1-6-6200', text: 'Address successfully modified.' },\r\n};\r\n\r\nconst globalGeneralMessages: Translation = {\r\n messageEmptyText: { code: '1-6-6290', text: 'The output was suppressed due to an empty text.' },\r\n messageOk: { code: '1-6-6290', text: 'Yes' },\r\n messageCancel: { code: '1-6-6290', text: 'No' },\r\n messageChange: { code: '1-6-6290', text: 'The selection was changed' },\r\n messageDefault: { code: '1-6-0000', text: '' },\r\n messageDefaultInfo: { code: '1-6-0000', text: '' },\r\n messageDefaultWarning: { code: '2-6-0000', text: '' },\r\n messageDefaultError: { code: '3-6-0000', text: '' },\r\n messageDefaultDebug: { code: '4-6-0000', text: '' },\r\n};\r\n\r\nconst globalDirectSearchSuggestMessages: Translation = {\r\n messageTooShort: { code: '1-6-6260', text: 'At least 3 characters!' },\r\n messageResultEmpty: { code: '1-6-6260', text: 'No items found!' },\r\n};\r\n\r\nconst globalFileuploadAreaMessages: Translation = {\r\n defaultMessage: { code: '1-6-2002', text: 'Store the files here to upload them' },\r\n fallbackMessage: { code: '2-6-2002', text: 'Your browser does not support drag&drop file uploads' },\r\n fallbackText: { code: '2-6-2002', text: 'Use the form to upload your files' },\r\n fileTooBig: { code: '2-6-2002', text: 'The file is too large. The maximum file size is {{maxFileSize}} MB' },\r\n invalidFileType: { code: '2-6-2002', text: 'Unable to upload files of this type' },\r\n responseError: { code: '3-6-2002', text: 'The server rejected your request with status {{statusCode}}' },\r\n cancelUpload: { code: '1-6-2002', text: 'Cancel upload' },\r\n cancelUploadConfirmation: { code: '1-6-2002', text: 'Cancel upload?' },\r\n removeFile: { code: '1-6-2002', text: 'Remove file' },\r\n maxFilesExceeded: { code: '2-6-2002', text: 'You are not allowed to upload any more files' },\r\n buttonBrowse: { code: '1-6-2002', text: 'Select files to upload' },\r\n uploadHint: { code: '1-6-2002', text: 'Drag files and folders here' },\r\n};\r\n\r\nconst globalFilterMessages: Translation = {\r\n emptyResult: { code: '1-1-6280', text: 'Keine Ergebnisse gefunden.' },\r\n};\r\n\r\nconst globalCheckoutMessages: Translation = {\r\n missingTerms: { code: '3-6-6230', text: 'Please accept the General terms and conditions.' },\r\n loadingCheckoutTitle: { code: '1-6-6260', text: 'Almost done!' },\r\n loadingCheckoutText: { code: '1-6-6261', text: 'The order is carried out. This can take a moment!' },\r\n};\r\n\r\nconst globalHtmlErrorCodeMessages: Translation = {\r\n htmlErrorGeneral: { code: '3-6-6000', text: 'Something has gone wrong!' },\r\n htmlError401: { code: '3-6-6000', text: 'A valid authentication is required to process the request.' },\r\n htmlError403: { code: '3-6-6000', text: 'The request could not be processed due to missing authorization of the client.' },\r\n htmlError404: { code: '3-6-6000', text: 'The requested site does not exist.' },\r\n htmlError413: { code: '3-6-6000', text: 'The file is too large.' },\r\n htmlError415: { code: '3-6-6000', text: 'This media type is not supported.' },\r\n htmlError422: { code: '3-6-6000', text: 'Unable to display the requested site correctly.' },\r\n htmlError500: { code: '3-6-6000', text: 'Internal server error' },\r\n htmlError503: { code: '3-6-6000', text: 'The server is temporarily unavailable.' },\r\n};\r\n\r\nif (!window.opacc) {\r\n window.opacc = {};\r\n}\r\n\r\nexport const formErrorMessages: FormValidatorMessages & FormExpandValidatorMessages = {\r\n ...globalFormErrorMessages,\r\n ...globalFormPasswordValidityMessages,\r\n ...globalFormExpandErrorMessages,\r\n ...window.opacc.tkFormValidityMessages,\r\n ...window.opacc.tkFormPasswordValidityMessages,\r\n ...window.opacc.tkFormExpandErrorMessages,\r\n ...window.opacc.projectFormValidityMessages,\r\n ...window.opacc.projectFormPasswordValidityMessages,\r\n ...window.opacc.projectFormExpandErrorMessages,\r\n};\r\n\r\nexport const formExpandErrorMessages = {\r\n ...globalFormExpandErrorMessages,\r\n ...window.opacc.tkFormExpandErrorMessages,\r\n ...window.opacc.projectFormExpandErrorMessages,\r\n};\r\n\r\nexport const basketMessages = {\r\n ...globalBasketMessages,\r\n ...window.opacc.tkBasketMessages,\r\n ...window.opacc.projectBasketMessages,\r\n};\r\n\r\nexport const compareMessages = {\r\n ...globalCompareMessages,\r\n ...window.opacc.tkCompareMessages,\r\n ...window.opacc.projectCompareMessages,\r\n};\r\n\r\nexport const favoriteMessages = {\r\n ...globalFavoriteMessages,\r\n ...window.opacc.tkFavoriteMessages,\r\n ...window.opacc.projectFavoriteMessages,\r\n};\r\n\r\nexport const generalMessages = {\r\n ...globalGeneralMessages,\r\n ...window.opacc.tkGeneralMessages,\r\n ...window.opacc.projectGeneralMessages,\r\n};\r\n\r\nexport const directSearchSuggestMessages = {\r\n ...globalDirectSearchSuggestMessages,\r\n ...window.opacc.tkDirectSearchSuggestMessages,\r\n ...window.opacc.projectDirectSearchSuggestMessages,\r\n};\r\n\r\nexport const fileuploadAreaMessages = {\r\n ...globalFileuploadAreaMessages,\r\n ...window.opacc.tkFileUploadAreaMessages,\r\n ...window.opacc.projectFileUploadAreaMessages,\r\n};\r\n\r\nexport const filterMessages = {\r\n ...globalFilterMessages,\r\n ...window.opacc.tkFilterMessages,\r\n ...window.opacc.projectFilterMessages,\r\n};\r\n\r\nexport const autocompleteMessages = {\r\n ...globalAutocompleteMessages,\r\n ...window.opacc.tkAutocompleteMessages,\r\n ...window.opacc.projectAutocompleteMessages,\r\n};\r\n\r\nexport const paymentMessages = {\r\n ...globalPaymentMessages,\r\n ...window.opacc.tkPaymentMessages,\r\n ...window.opacc.projectPaymentMessages,\r\n};\r\nexport const deliveryMessages = {\r\n ...globalDeliveryMessages,\r\n ...window.opacc.tkDeliveryMessages,\r\n ...window.opacc.projectDeliveryMessages,\r\n};\r\nexport const accountMessages = {\r\n ...globalAccountMessages,\r\n ...window.opacc.tkAccountMessages,\r\n ...window.opacc.projectAccountMessages,\r\n};\r\nexport const checkoutMessages = {\r\n ...globalCheckoutMessages,\r\n ...window.opacc.tkCheckoutMessages,\r\n ...window.opacc.projectCheckoutMessages,\r\n};\r\nexport const htmlErrorCodeMessages = {\r\n ...globalHtmlErrorCodeMessages,\r\n ...window.opacc.tkHtmlErrorCodeMessages,\r\n ...window.opacc.projectHtmlErrorCodeMessages,\r\n};\r\n\r\nexport const zipCityMessages = {\r\n ...window.opacc.tkZipCityMessages,\r\n};\r\n","/**\r\n * @param {string} html representing any number of sibling elements\r\n * @return {NodeListOf}\r\n */\r\nconst render = (html: string, isBody = false): T => {\r\n if (!html) render('
');\r\n const parser = new DOMParser();\r\n const doc = parser.parseFromString(html, 'text/html');\r\n return isBody\r\n ? doc.body as T\r\n : doc.body.children.item(0) as T;\r\n};\r\n\r\nexport default render;\r\n","import { fetchRequest, setAsyncUrl } from '@tk/utilities/tk.fetch';\r\nimport TKCustomElementFactory from '@tk/utilities/tk.custom.element.factory';\r\nimport TKDialog from '@tk/components/tk.dialog';\r\nimport { Editor, RawEditorOptions } from 'tinymce';\r\n\r\ninterface RequestData extends Record {\r\n type: string;\r\n boid?: string;\r\n bonumber?: string;\r\n arttextno?: string;\r\n per?: string;\r\n template?: string;\r\n modalid?: string;\r\n html?: string;\r\n bo?: string;\r\n attr?: string;\r\n id?: string;\r\n}\r\n\r\ninterface ResponseJsonData {\r\n title: string;\r\n description: string;\r\n url: string;\r\n}\r\n\r\ninterface TemplateEntry {\r\n title: string;\r\n description: string;\r\n content: string;\r\n}\r\n\r\nexport default class TKStaticContent extends TKCustomElementFactory {\r\n button?: HTMLButtonElement;\r\n requestData?: RequestData;\r\n dialog?: HTMLDivElement;\r\n urlTemplate: Array;\r\n templateContentPromiseArray: Array>;\r\n templatesLoaded: boolean;\r\n fileUploadIFrameURL: string;\r\n\r\n private target: string;\r\n private boId?: string;\r\n private boNumber?: string;\r\n private artTextNumber?: string;\r\n private langNumber?: string;\r\n private dataPer?: string;\r\n private asyncTemplate?: string;\r\n private bo?: string;\r\n private attr?: string;\r\n private itemId?: string;\r\n\r\n constructor() {\r\n super();\r\n this.button = this.querySelector('[data-tk-static-content-edit]') || undefined;\r\n\r\n this.target = this.getAttribute('data-tk-target') || '#tk-static-content-editor';\r\n this.boId = this.getAttribute('data-tk-bo-id') || undefined;\r\n this.boNumber = this.getAttribute('data-tk-bo-number') || undefined;\r\n this.artTextNumber = this.getAttribute('data-tk-art-text-number') || undefined;\r\n this.bo = this.getAttribute('data-tk-bo') || undefined;\r\n this.attr = this.getAttribute('data-tk-attr') || undefined;\r\n this.itemId = this.getAttribute('data-tk-id') || undefined;\r\n this.langNumber = this.getAttribute('data-tk-lang-number') || undefined;\r\n this.dataPer = this.getAttribute('data-tk-data-per') || undefined;\r\n this.asyncTemplate = this.getAttribute('data-tk-async-template') || undefined;\r\n this.urlTemplate = [];\r\n this.templateContentPromiseArray = [];\r\n this.templatesLoaded = false;\r\n this.fileUploadIFrameURL = this.getAttribute('data-tk-file-upload-iframe-url') || '';\r\n }\r\n\r\n async connectedCallback() {\r\n if (\r\n !this.button\r\n || !this.boId\r\n || !this.dataPer\r\n || !this.asyncTemplate\r\n ) return;\r\n // @ts-ignore Import module\r\n // eslint-disable-next-line import/extensions, import/no-absolute-path\r\n await import('/webportal/config/layout/themes/tk/vendor/tinymce/tinymce.min.js');\r\n this.registerClickListener();\r\n }\r\n\r\n registerClickListener() {\r\n const onClick = this.sendAjaxRequest.bind(this);\r\n this.pushListener({ event: 'click', element: this.button!, action: onClick });\r\n }\r\n\r\n registerModalListener(modal: HTMLElement) {\r\n const saveButton = modal.querySelector('[data-tk-static-content-save]') || undefined;\r\n const onSave = this.save.bind(this, saveButton);\r\n saveButton && this.pushListener({ event: 'click', element: saveButton, action: onSave });\r\n\r\n const cancelButton = modal.querySelector('[data-tk-static-content-cancel]');\r\n const onCancel = this.cancel.bind(this);\r\n cancelButton && this.pushListener({ event: 'click', element: cancelButton, action: onCancel });\r\n }\r\n\r\n sendAjaxRequest() {\r\n this.requestData = {\r\n type: 'staticcontent',\r\n boid: this.boId,\r\n bonumber: this.boNumber,\r\n arttextno: this.artTextNumber,\r\n per: this.dataPer!,\r\n template: this.asyncTemplate!,\r\n modalid: this.target,\r\n bo: this.bo,\r\n id: this.itemId,\r\n attr: this.attr,\r\n };\r\n const url = setAsyncUrl(true);\r\n fetchRequest({\r\n requestURL: url,\r\n resolveHandler: this.showContentInEditMode.bind(this),\r\n payload: this.requestData,\r\n });\r\n }\r\n\r\n save(button?: HTMLButtonElement) {\r\n if (!button) return;\r\n const htmlEncoded = TKStaticContent.htmlEncode(TKStaticContent.getContentFromEditMode());\r\n this.requestData = {\r\n type: 'staticcontent',\r\n boid: this.boId,\r\n bonumber: this.boNumber,\r\n arttextno: this.artTextNumber,\r\n bo: this.bo,\r\n id: this.itemId,\r\n attr: this.attr,\r\n html: htmlEncoded,\r\n };\r\n\r\n const url = setAsyncUrl();\r\n fetchRequest({\r\n requestURL: url,\r\n resolveHandler: this.refreshContent.bind(this),\r\n payload: this.requestData,\r\n });\r\n this.cancel();\r\n }\r\n\r\n cancel() {\r\n TKDialog.close(this.dialog!);\r\n }\r\n\r\n showContentInEditMode(response: TKResponse) {\r\n if (!response.success || !this.requestData) return;\r\n\r\n this.dialog = TKDialog.renderDialog({\r\n content: response.dataAsHtml,\r\n className: 'tk-dialog tk-dialog--fullscreen',\r\n tag: 'div',\r\n });\r\n TKDialog.open(this.dialog);\r\n this.pushListener({ event: 'close', element: this.dialog, action: () => this.dialog?.remove() });\r\n\r\n this.initEditor();\r\n\r\n const modal = document.querySelector(this.target);\r\n if (!modal) return;\r\n this.registerModalListener(modal);\r\n }\r\n\r\n static getContentFromEditMode() {\r\n return window.tinymce.activeEditor?.getContent({ format: 'raw' }) || '';\r\n }\r\n\r\n refreshContent(response: TKResponse) {\r\n if (!response.success || !this.requestData) return;\r\n let contentContainer = document.getElementById(\r\n `staticcontent-${this.requestData.boid}-${this.requestData.arttextno}`,\r\n );\r\n if (!contentContainer) {\r\n this.requestData.id !== undefined && (\r\n contentContainer = document.getElementById(this.requestData.id)\r\n );\r\n } else {\r\n contentContainer.innerHTML = response.dataAsHtml;\r\n }\r\n }\r\n\r\n initEditor() {\r\n if (!this.requestData) return;\r\n const selector = `${this.requestData.modalid} [data-tk-static-content-textarea]`;\r\n // Editor must be removed before initialisation\r\n window.tinymce.remove(selector);\r\n const options = {\r\n selector,\r\n language: TKStaticContent.getLanguage(),\r\n plugins: [\r\n 'advlist', 'autolink', 'lists', 'link', 'image',\r\n 'charmap', 'preview', 'anchor', 'pagebreak', 'searchreplace',\r\n 'wordcount', 'visualblocks', 'visualchars', 'code', 'fullscreen', 'insertdatetime',\r\n 'media', 'nonbreaking', 'save', 'table', 'directionality',\r\n 'emoticons', 'template', 'quickbars',\r\n ],\r\n insertdatetime_formats: ['%d.%m.%Y', '%H:%M'],\r\n contextmenu: 'link image table',\r\n tools: 'inserttable',\r\n toolbar:\r\n 'undo redo | styleselect | bold italic | forecolor backcolor | alignleft aligncenter'\r\n + 'alignright alignjustify | bullist numlist outdent indent | image media link | '\r\n + 'preview print | filemanager',\r\n width: '100%',\r\n base_url: '/webportal/config/layout/themes/tk/vendor/tinymce/',\r\n language_url: `/webportal/config/layout/themes/tk/translations/tinymce/${TKStaticContent.getLanguage()}.js`,\r\n promotion: false,\r\n content_css: [\r\n 'default',\r\n `/webportal/config/layout/themes/project/generated/staticcontent/staticcontent.css?${new Date().getTime()}`,\r\n ],\r\n templates: this.urlTemplate,\r\n extended_valid_elements: 'tk-tabs-accordion,tk-tabs-accordion[class],i[data-tk-accordion-icon]',\r\n custom_elements: 'tk-tabs-accordion,tk-tabs-accordion',\r\n setup: (editor) => {\r\n editor.on('SaveContent', (event) => {\r\n event.content = TKStaticContent.htmlEncode(TKStaticContent.htmlDecode(event.content));\r\n });\r\n\r\n const openmanager = () => {\r\n editor.windowManager.openUrl({\r\n title: 'File Manager',\r\n url: TKStaticContent.getFileManagerURL(editor),\r\n width: 900,\r\n height: 440,\r\n });\r\n };\r\n\r\n editor.ui.registry.addButton('filemanager', {\r\n icon: 'browse',\r\n tooltip: 'Insert file',\r\n onAction: openmanager,\r\n });\r\n\r\n editor.ui.registry.addMenuItem('filemanager', {\r\n icon: 'browse',\r\n text: 'Insert file',\r\n onAction: openmanager,\r\n });\r\n\r\n const templateURLElement = document.querySelector('[data-tk-staticcontent-templates-url]');\r\n const templateURL = templateURLElement && templateURLElement.getAttribute('data-op-url');\r\n\r\n if (templateURL) {\r\n this.getTemplates(templateURL);\r\n }\r\n },\r\n } as RawEditorOptions;\r\n\r\n if (this.fileUploadIFrameURL) options.file_picker_callback = this.handleFilePicker.bind(this);\r\n\r\n window.tinymce.init(options);\r\n }\r\n\r\n handleFilePicker(\r\n callback: (value: string, meta?: Record) => void,\r\n ) {\r\n window.tinymce.activeEditor?.windowManager.openUrl({\r\n title: 'Fileupload Area',\r\n url: this.fileUploadIFrameURL,\r\n width: 800,\r\n height: 600,\r\n });\r\n\r\n window.addEventListener('message', (event) => {\r\n const { data } = event;\r\n if (window.location.origin !== event.origin) return;\r\n callback(data.content);\r\n });\r\n }\r\n\r\n static getFileManagerURL(editor: Editor) {\r\n return `/webportal/tinymcefilemanager.aspx?editor=${editor.id}&lang=${TKStaticContent.getLanguage()}`;\r\n }\r\n\r\n static htmlEncode(content: string) {\r\n return content.toString().replace(/&/g, '&').replace(/\"/g, '"').replace(//g, '>');\r\n }\r\n\r\n static htmlDecode(content: string) {\r\n return content.toString().replace(/>/g, '>').replace(/</g, '<').replace(/"/g, '\"')\r\n .replace(/&/g, '&');\r\n }\r\n\r\n static getLanguage() {\r\n if (window.location.href.indexOf('/en/') !== -1) {\r\n return 'en_GB';\r\n } if (window.location.href.indexOf('/fr/') !== -1) {\r\n return 'fr_FR';\r\n } if (window.location.href.indexOf('/it/') !== -1) {\r\n return 'it';\r\n }\r\n return 'de';\r\n }\r\n\r\n async getTemplates(templateURL: string) {\r\n if (this.templatesLoaded) return;\r\n // get url content\r\n return new Promise((resolve) => {\r\n fetchRequest({\r\n requestURL: templateURL,\r\n resolveHandler: (response: TKResponse) => {\r\n this.getTemplateContent(response, resolve);\r\n },\r\n });\r\n });\r\n }\r\n\r\n getTemplateContent(response: TKResponse, resolveFunction: (data: void) => void) {\r\n (response.dataAsJson as Array).forEach((element) => {\r\n this.templateContentPromiseArray = [];\r\n this.templateContentPromiseArray.push(\r\n new Promise((resolve) => {\r\n fetchRequest({\r\n requestURL: element.url,\r\n resolveHandler: (response: TKResponse) => {\r\n this.saveTemplateContent(response, element, resolveFunction, resolve);\r\n },\r\n });\r\n }),\r\n );\r\n });\r\n }\r\n\r\n saveTemplateContent(\r\n response: TKResponse,\r\n element: ResponseJsonData,\r\n resolvedAllFunction: (data: void) => void,\r\n resolveArrayElementFunction: (data: void) => void,\r\n ) {\r\n const templateContent = response.dataAsHtml;\r\n\r\n const newTemplateEntry = {\r\n title: element.title,\r\n description: element.description,\r\n content: templateContent,\r\n };\r\n\r\n this.urlTemplate.push(newTemplateEntry);\r\n resolveArrayElementFunction();\r\n\r\n Promise.allSettled(this.templateContentPromiseArray).then(() => {\r\n resolvedAllFunction();\r\n this.templatesLoaded = true;\r\n });\r\n }\r\n}\r\n","import TKCustomElementFactory from '@tk/utilities/tk.custom.element.factory';\r\nimport { fetchRequest } from '@tk/utilities/tk.fetch';\r\nimport { formErrorMessages, formExpandErrorMessages } from '@tk/utilities/tk.messages';\r\nimport TKFormZipCity from '@tk/controls/tk.form.zipcity';\r\n\r\ntype FieldElement = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;\r\n\r\ninterface ValidityMessages {\r\n key: keyof ValidityState;\r\n value: string;\r\n}\r\n\r\ninterface Validation {\r\n element: FieldElement;\r\n wrapper: Element;\r\n state?: ValidityState;\r\n messageElement?: HTMLSpanElement;\r\n messages: ValidityMessages[];\r\n}\r\n\r\ninterface ValidityItem {\r\n key: keyof ValidityState;\r\n value: boolean;\r\n}\r\n\r\ninterface ValidationResponse {\r\n isValid: boolean;\r\n}\r\n\r\nenum matchType {\r\n Some = 'SOME',\r\n Full= 'FULLMATCH',\r\n}\r\n\r\nexport default class TKFormValidator extends TKCustomElementFactory {\r\n form?: HTMLFormElement;\r\n validationList: Validation[] = [];\r\n fieldWrapperSelector: string;\r\n formErrorClassName: string;\r\n fieldHintClassName: string;\r\n shouldValidateInline: boolean;\r\n passwordStrengthMeter?: HTMLElement;\r\n passwordNewElement?: HTMLElement;\r\n passwordRepeatElement?: HTMLElement;\r\n passwordValidClassName: string;\r\n passwordInvalidClassName: string;\r\n firstElementToScrollTo?: HTMLElement;\r\n googleRecaptcha?: HTMLInputElement;\r\n preventEnterDefaultAction: string | undefined;\r\n\r\n constructor() {\r\n super();\r\n\r\n this.form = this.querySelector('form') || undefined;\r\n this.fieldWrapperSelector = this.getAttribute('data-tk-field-wrapper-selector') || '[data-tk-field-wrapper]';\r\n this.formErrorClassName = this.getAttribute('data-tk-form-error-class-name') || 'tk-form--error';\r\n this.fieldHintClassName = this.getAttribute('data-tk-field-hint-class-name') || 'tk-form__hint';\r\n this.shouldValidateInline = this.hasAttribute('data-tk-should-validate-inline');\r\n this.passwordStrengthMeter = this.querySelector('[data-tk-password-strength-meter]') || undefined;\r\n this.passwordNewElement = this.querySelector('[data-tk-password-new]') || undefined;\r\n this.passwordRepeatElement = this.querySelector('[data-tk-password-repeat]') || undefined;\r\n this.passwordValidClassName = this.getAttribute('data-tk-password-valid-class-name') || 'tk-form--valid';\r\n this.passwordInvalidClassName = this.getAttribute('data-tk-password-valid-class-name') || 'tk-form--invalid';\r\n this.googleRecaptcha = this.querySelector('[data-tk-google-recaptcha]') || undefined;\r\n // Selects an element that is clicked when the enter key is pressed\r\n this.preventEnterDefaultAction = this.getAttribute('data-tk-enter-data-attribute-selector')\r\n || undefined;\r\n }\r\n\r\n connectedCallback(): void {\r\n if (!this.form) return;\r\n this.validationList = [];\r\n this.setNoValidateForm();\r\n this.searchFieldElements();\r\n this.registerSubmitListener();\r\n this.registerPasswordListener();\r\n this.shouldValidateInline && this.registerFieldValidationListener();\r\n }\r\n\r\n setNoValidateForm() {\r\n if (!this.form) return;\r\n this.form.noValidate = true;\r\n }\r\n\r\n searchFieldElements(): void {\r\n const formElements: NodeListOf = this.querySelectorAll('input, select, textarea');\r\n const formElementList = Array.from(formElements);\r\n const filteredFormElements = formElementList.filter((element) => !element.disabled);\r\n filteredFormElements.forEach((element) => {\r\n const wrapper = element.closest(this.fieldWrapperSelector);\r\n wrapper\r\n && this.validationList.push({\r\n element,\r\n wrapper,\r\n messages: TKFormValidator.generateValidityMessages(element),\r\n });\r\n });\r\n }\r\n\r\n registerSubmitListener() {\r\n if (!this.form) return;\r\n const onSubmitHandler = this.validateForm.bind(this);\r\n this.pushListener({ event: 'submit', element: this.form, action: onSubmitHandler });\r\n }\r\n\r\n registerPasswordListener() {\r\n if (!(this.passwordStrengthMeter && this.passwordNewElement && this.passwordRepeatElement)) return;\r\n\r\n const onValidatePassword = this.validatePassword.bind(this);\r\n this.pushListener({ event: 'input', element: this.passwordNewElement, action: onValidatePassword });\r\n this.pushListener({ event: 'input', element: this.passwordRepeatElement, action: onValidatePassword });\r\n }\r\n\r\n registerFieldValidationListener() {\r\n this.validationList.forEach((item) => {\r\n const onValidation = this.validateField.bind(this, item);\r\n this.pushListener({ event: 'blur', element: item.element, action: onValidation });\r\n this.pushListener({ event: 'input', element: item.element, action: onValidation });\r\n });\r\n }\r\n\r\n async validateRecaptcha(): Promise {\r\n if (!this.googleRecaptcha) return true;\r\n return new Promise((resolve) => {\r\n grecaptcha.ready(async () => {\r\n const siteKey = this.googleRecaptcha!.getAttribute('data-tk-site-key');\r\n if (!siteKey) return resolve(false);\r\n const token = await grecaptcha.execute(siteKey, { action: 'submit' });\r\n if (!token) return resolve(false);\r\n this.googleRecaptcha!.value = token;\r\n resolve(true);\r\n });\r\n });\r\n }\r\n\r\n async validateZipCity(): Promise {\r\n const validationList: boolean[] = [];\r\n const fieldElements = this.querySelectorAll('[data-tk-field-check-zip-city]');\r\n if (fieldElements.length === 0) return true;\r\n\r\n const apiPromises = Array.from(fieldElements).map(async (element) => {\r\n const input = element.querySelector('input');\r\n if (!input) return true;\r\n\r\n const isValid = await TKFormZipCity.isValidZipCity(this.form!);\r\n const validationItem = this.validationList.find((item) => item.wrapper === element);\r\n if (!isValid && validationItem) {\r\n this.removeMessage(validationItem);\r\n this.createElementMessage(\r\n validationItem,\r\n formErrorMessages.typeMismatch,\r\n );\r\n }\r\n return isValid;\r\n });\r\n const results = await Promise.all(apiPromises);\r\n validationList.push(...results);\r\n return validationList.every((item) => item);\r\n }\r\n\r\n async validateByAPI(): Promise {\r\n const validationList: boolean[] = [];\r\n const fieldElements = this.querySelectorAll('[data-tk-field-check-api]');\r\n if (fieldElements.length === 0) return true;\r\n\r\n const apiPromises = Array.from(fieldElements).map(async (element) => {\r\n const apiURL = element.getAttribute('data-tk-field-check-api');\r\n const input = element.querySelector('input');\r\n if (!input || !apiURL || input.value === '') return true;\r\n\r\n const response = await TKFormValidator.fetchExistAPI(apiURL, input.value);\r\n const { isValid } = response.dataAsJson;\r\n const validationItem = this.validationList.find((item) => item.wrapper === element);\r\n if (!isValid && validationItem) {\r\n this.removeMessage(validationItem);\r\n this.createElementMessage(\r\n validationItem,\r\n formExpandErrorMessages.existigName,\r\n );\r\n }\r\n return isValid;\r\n });\r\n const results = await Promise.all(apiPromises);\r\n validationList.push(...results);\r\n return validationList.every((item) => item);\r\n }\r\n\r\n static async fetchExistAPI(url: string, value: string): Promise> {\r\n return new Promise((resolve) => {\r\n fetchRequest({\r\n requestURL: url,\r\n payload: {\r\n value,\r\n },\r\n resolveHandler: (response: TKResponse) => {\r\n resolve(response);\r\n },\r\n });\r\n });\r\n }\r\n\r\n async validateForm(event: Event) {\r\n event.preventDefault();\r\n const isFormValid = await this.isFormValid();\r\n if (!isFormValid) return;\r\n if (this.preventEnterDefaultAction) {\r\n const elemntToClick = document.querySelector(`[${this.preventEnterDefaultAction}]`);\r\n elemntToClick?.querySelector('button')?.click();\r\n return;\r\n }\r\n this.form?.submit();\r\n }\r\n\r\n async isFormValid() {\r\n await this.validateFields();\r\n const areFieldsValid = this.validationList.every((item) => item.element.validity.valid);\r\n if (!areFieldsValid) return false;\r\n const isValid = await this.validateByAPI() && await this.validateZipCity();\r\n const isRecaptchaValid = await this.validateRecaptcha();\r\n\r\n return (\r\n (!this.passwordStrengthMeter || this.checkPasswordStengthMeter())\r\n && this.checkPasswordMatching()\r\n && isValid\r\n && isRecaptchaValid\r\n );\r\n }\r\n\r\n protected async validateFields(): Promise {\r\n this.validationList.forEach((item) => {\r\n this.validateField(item);\r\n });\r\n\r\n this.firstElementToScrollTo = undefined;\r\n }\r\n\r\n validateField(item: Validation) {\r\n this.removeMessage(item);\r\n if (!item.element.validity.valid) {\r\n this.showMessage(item);\r\n }\r\n }\r\n\r\n showMessage(item: Validation) {\r\n const validityList = TKFormValidator.createValidityDictionary(item.element);\r\n const invalidMessage = validityList.find((validity) => validity.value);\r\n const message = invalidMessage\r\n ? item.messages.find((message) => message.key === invalidMessage.key)?.value || ''\r\n : item.element.validationMessage;\r\n\r\n this.createElementMessage(item, message);\r\n }\r\n\r\n createElementMessage(item: Validation, message: string) {\r\n const spanElement = document.createElement('span');\r\n spanElement.classList.add(this.fieldHintClassName);\r\n spanElement.textContent = TKFormValidator.replacePlaceholders(message, item.element);\r\n item.messageElement = spanElement;\r\n item.wrapper.classList.add(this.formErrorClassName);\r\n item.wrapper.insertAdjacentElement('beforeend', spanElement);\r\n if (this.firstElementToScrollTo) return;\r\n this.firstElementToScrollTo = item.messageElement;\r\n this.firstElementToScrollTo.scrollIntoView({ behavior: 'smooth', block: 'center' });\r\n }\r\n\r\n removeMessage(item: Validation) {\r\n const spanElement = item.messageElement;\r\n if (!spanElement) return;\r\n spanElement.remove();\r\n item.wrapper.classList.remove(this.formErrorClassName);\r\n }\r\n\r\n static createValidityDictionary(element: FieldElement) {\r\n const { validity } = element;\r\n const validityList: ValidityItem[] = [];\r\n // eslint-disable-next-line guard-for-in, no-restricted-syntax\r\n for (const key in validity) {\r\n const validityItem: ValidityItem = {\r\n key: key as keyof ValidityState,\r\n value: Boolean(validity[key as keyof ValidityState]),\r\n };\r\n validityList.push(validityItem);\r\n }\r\n return validityList;\r\n }\r\n\r\n static generateValidityMessages(element: FieldElement): ValidityMessages[] {\r\n const list: ValidityMessages[] = [];\r\n const customErrorPrefix = 'data-tk-error-msg-';\r\n const attributeList = element.getAttributeNames().filter((name) => name.startsWith(customErrorPrefix));\r\n attributeList.forEach((key) => {\r\n const keyFormatted = key\r\n .replace(customErrorPrefix, '')\r\n .replace(/-./g, (x) => x[1].toUpperCase()) as keyof ValidityState;\r\n const value = element.getAttribute(key);\r\n value\r\n && list.push({\r\n key: keyFormatted,\r\n value,\r\n });\r\n });\r\n\r\n if (formErrorMessages) {\r\n const messages = formErrorMessages;\r\n Object.entries(messages).forEach((entry) => {\r\n const [key, value] = entry;\r\n const foundMessage = list.filter((item) => item.key === key);\r\n !foundMessage.length\r\n && list.push({\r\n key: key as keyof ValidityState,\r\n value,\r\n });\r\n });\r\n }\r\n\r\n return list;\r\n }\r\n\r\n static replacePlaceholders(value: string, element: FieldElement): string {\r\n const dictionary: Record = {\r\n '{minLength}': element.getAttribute('minlength') || '',\r\n '{maxLength}': element.getAttribute('maxlength') || '',\r\n '{length}': element.value.length.toString() || '',\r\n '{step}': element.getAttribute('step') || '',\r\n '{min}': element.getAttribute('min') || '',\r\n '{max}': element.getAttribute('max') || '',\r\n '{currentValue}': element.value,\r\n };\r\n const re = new RegExp(Object.keys(dictionary).join('|'), 'gi');\r\n return value.replace(re, (matched) => dictionary[matched]);\r\n }\r\n\r\n checkPasswordStengthMeter() {\r\n const patterns = this.getPasswordPatterns();\r\n return patterns.every((item) => item.element?.classList.contains(this.passwordValidClassName));\r\n }\r\n\r\n checkPasswordMatching(): boolean {\r\n let isValid: boolean;\r\n const newPasswordItem = this.validationList.find((item) => item.element === this.passwordNewElement);\r\n const repeatPasswordItem = this.validationList.find((item) => item.element === this.passwordRepeatElement);\r\n if (!newPasswordItem || !repeatPasswordItem) return true;\r\n if (newPasswordItem.element.value !== repeatPasswordItem.element.value) {\r\n this.removeMessage(repeatPasswordItem);\r\n this.createElementMessage(\r\n repeatPasswordItem,\r\n formErrorMessages.passwordNotMatching,\r\n );\r\n isValid = false;\r\n } else {\r\n isValid = true;\r\n }\r\n return isValid;\r\n }\r\n\r\n validatePassword(event: Event) {\r\n const target = event.currentTarget as HTMLInputElement;\r\n const patterns = this.getPasswordPatterns();\r\n\r\n patterns.forEach((item) => {\r\n const regex = new RegExp(item.pattern || '', item.matchtype === matchType.Full ? 'g' : '');\r\n\r\n const regexpMatch = target.value.match(regex);\r\n\r\n if (item.matchtype === matchType.Some) {\r\n if (regexpMatch) {\r\n item.element?.classList.remove(this.passwordInvalidClassName);\r\n item.element?.classList.add(this.passwordValidClassName);\r\n } else {\r\n item.element?.classList.remove(this.passwordValidClassName);\r\n item.element?.classList.add(this.passwordInvalidClassName);\r\n }\r\n }\r\n\r\n if (item.matchtype === matchType.Full) {\r\n if (regexpMatch?.length === target.value.length) {\r\n item.element?.classList.remove(this.passwordInvalidClassName);\r\n item.element?.classList.add(this.passwordValidClassName);\r\n } else {\r\n item.element?.classList.remove(this.passwordValidClassName);\r\n item.element?.classList.add(this.passwordInvalidClassName);\r\n }\r\n }\r\n });\r\n }\r\n\r\n getPasswordPatterns() {\r\n const characterPatternElement = this.passwordStrengthMeter?.querySelector('[data-tk-pwd-character-pattern]');\r\n const upperPatternElement = this.passwordStrengthMeter?.querySelector('[data-tk-pwd-upper-pattern]');\r\n const numberPatternElement = this.passwordStrengthMeter?.querySelector('[data-tk-pwd-number-pattern]');\r\n const allowedSymbolPatternElement = this.passwordStrengthMeter?.querySelector(\r\n '[data-tk-pwd-allowed-symbols-pattern]',\r\n );\r\n const characterPattern = characterPatternElement?.getAttribute('data-tk-pwd-character-pattern');\r\n const upperPattern = upperPatternElement?.getAttribute('data-tk-pwd-upper-pattern');\r\n const numberPattern = numberPatternElement?.getAttribute('data-tk-pwd-number-pattern');\r\n const allowedSymbolPattern = allowedSymbolPatternElement?.getAttribute('data-tk-pwd-allowed-symbols-pattern');\r\n return [\r\n {\r\n pattern: characterPattern,\r\n element: characterPatternElement,\r\n matchtype: matchType.Some,\r\n },\r\n {\r\n pattern: upperPattern,\r\n element: upperPatternElement,\r\n matchtype: matchType.Some,\r\n },\r\n {\r\n pattern: numberPattern,\r\n element: numberPatternElement,\r\n matchtype: matchType.Some,\r\n },\r\n {\r\n pattern: allowedSymbolPattern,\r\n element: allowedSymbolPatternElement,\r\n matchtype: matchType.Full,\r\n },\r\n ];\r\n }\r\n}\r\n","import { fetchRequest } from '@tk/utilities/tk.fetch';\r\nimport TKCustomElementFactory from '@tk/utilities/tk.custom.element.factory';\r\nimport { zipCityMessages } from '@tk/utilities/tk.messages';\r\n\r\ninterface ZipCityData {\r\n zip: string;\r\n city: string;\r\n country: string;\r\n}\r\n\r\ninterface ZipCityField {\r\n inputField?: HTMLInputElement;\r\n dropdown?: HTMLElement;\r\n listItemSelected?: HTMLElement;\r\n data?: ZipCityData[];\r\n}\r\n\r\nexport default class TKFormZipCity extends TKCustomElementFactory {\r\n fieldCountry?: HTMLInputElement | HTMLSelectElement;\r\n fieldZip?: HTMLInputElement;\r\n fieldCity?: HTMLInputElement;\r\n inputObject: ZipCityField;\r\n selectedField?: HTMLInputElement;\r\n listWrapper: HTMLElement;\r\n timer?: ReturnType;\r\n lastSearchTerm: string;\r\n listWrapperClassName: string;\r\n loadingSpinnerTimeout: number | null;\r\n clearDataTimeout: number | null;\r\n\r\n constructor() {\r\n super();\r\n\r\n this.listWrapperClassName = this.getAttribute('data-tk-zip-list-class') || 'tk-form-zipcity__list';\r\n this.fieldCountry = this.querySelector('[data-tk-zip-country]') || undefined;\r\n this.fieldZip = this.querySelector('[data-tk-zip-zip]') || undefined;\r\n this.fieldCity = this.querySelector('[data-tk-zip-city]') || undefined;\r\n this.lastSearchTerm = '';\r\n this.selectedField = undefined;\r\n this.listWrapper = document.createElement('div');\r\n this.listWrapper.classList.add(this.listWrapperClassName);\r\n this.listWrapper.hidden = true;\r\n this.loadingSpinnerTimeout = null;\r\n this.clearDataTimeout = null;\r\n\r\n this.inputObject = {\r\n inputField: undefined,\r\n dropdown: this.listWrapper,\r\n listItemSelected: undefined,\r\n data: [],\r\n };\r\n }\r\n\r\n connectedCallback(): void {\r\n this.registerListener();\r\n }\r\n\r\n registerListener() {\r\n if (!this.fieldZip && !this.fieldCity) return;\r\n\r\n const onInputHandler = this.searchZipCity.bind(this);\r\n const onClickHandler = this.toggleDropdown.bind(this);\r\n const onSelectHandler = this.selectItem.bind(this);\r\n const onChangeHandler = this.clearFormFields.bind(this);\r\n const onInputKeyNavigationHandler = this.inputKeyNavigation.bind(this);\r\n const onDropdownKeyNavigationHandler = this.dropdownKeyNavigation.bind(this);\r\n\r\n this.pushListener({ event: 'click', element: this.fieldZip!, action: onClickHandler });\r\n this.pushListener({ event: 'click', element: this.fieldCity!, action: onClickHandler });\r\n this.pushListener({ event: 'click', element: this.inputObject.dropdown!, action: onSelectHandler });\r\n this.pushListener({ event: 'input', element: this.fieldZip!, action: onInputHandler });\r\n this.pushListener({ event: 'input', element: this.fieldCity!, action: onInputHandler });\r\n this.pushListener({ event: 'keydown', element: this.fieldZip!, action: onInputKeyNavigationHandler });\r\n this.pushListener({ event: 'keydown', element: this.fieldCity!, action: onInputKeyNavigationHandler });\r\n this.pushListener({\r\n event: 'keydown',\r\n element: this.inputObject.dropdown!,\r\n action: onDropdownKeyNavigationHandler,\r\n });\r\n\r\n if (this.fieldCountry) {\r\n this.pushListener({ event: 'change', element: this.fieldCountry, action: onChangeHandler });\r\n }\r\n }\r\n\r\n inputKeyNavigation(event: KeyboardEvent): void {\r\n if (!(event.code === 'Tab' || event.code === 'Enter' || event.code === 'ArrowDown')) return;\r\n\r\n this.inputObject.listItemSelected = this.inputObject.dropdown?.firstElementChild as HTMLElement;\r\n\r\n if (!this.inputObject.listItemSelected) return;\r\n\r\n this.inputObject.dropdown?.classList.remove('hide');\r\n this.inputObject.listItemSelected.focus();\r\n event.preventDefault();\r\n }\r\n\r\n dropdownKeyNavigation(event: KeyboardEvent): void {\r\n const keyActions: Record void> = {\r\n ArrowDown: () => this.handleArrowKey(true),\r\n ArrowUp: () => this.handleArrowKey(false),\r\n Enter: () => this.selectItem(event),\r\n Space: () => this.selectItem(event),\r\n Tab: () => this.hideDropdown(true),\r\n Escape: () => this.hideDropdown(true),\r\n };\r\n\r\n const action = keyActions[event.code];\r\n if (!action) return;\r\n\r\n action();\r\n event.preventDefault();\r\n }\r\n\r\n handleArrowKey(isDown: boolean): void {\r\n if (this.inputObject.listItemSelected) {\r\n const nextElement = isDown\r\n ? this.inputObject.listItemSelected.nextElementSibling\r\n : this.inputObject.listItemSelected.previousElementSibling;\r\n\r\n if (nextElement instanceof HTMLElement) {\r\n this.inputObject.listItemSelected = nextElement;\r\n }\r\n } else {\r\n this.inputObject.listItemSelected = this.inputObject.dropdown?.firstElementChild as HTMLElement;\r\n }\r\n\r\n if (!this.inputObject.listItemSelected) {\r\n return;\r\n }\r\n\r\n this.inputObject.listItemSelected.focus();\r\n this.setScroller();\r\n }\r\n\r\n hideDropdown(isHidden: boolean = false): void {\r\n if (this.inputObject.dropdown) {\r\n if (!isHidden) {\r\n this.showLoadingAnimation();\r\n this.listWrapper.style.border = 'unset';\r\n }\r\n this.inputObject.dropdown.hidden = isHidden;\r\n }\r\n }\r\n\r\n toggleDropdown() {\r\n if (this.inputObject.dropdown && this.inputObject.dropdown.hasChildNodes()) {\r\n this.inputObject.dropdown.hidden = !this.inputObject.dropdown.hidden;\r\n }\r\n }\r\n\r\n setScroller(): void {\r\n const { dropdown, listItemSelected } = this.inputObject;\r\n\r\n if (!dropdown || !listItemSelected) return;\r\n\r\n const index = Array.from(dropdown.children).indexOf(listItemSelected);\r\n const elHeight = listItemSelected.offsetHeight;\r\n const { scrollTop } = dropdown;\r\n const viewport = scrollTop + dropdown.offsetHeight;\r\n const elOffset = elHeight * index;\r\n\r\n if (elOffset >= scrollTop && (elOffset + elHeight) <= viewport) return;\r\n\r\n dropdown.scrollTop = elOffset;\r\n }\r\n\r\n setInputObject(): void {\r\n if (!this.selectedField?.parentElement?.querySelector(`.${this.listWrapperClassName}`)) {\r\n this.selectedField?.insertAdjacentElement('afterend', this.listWrapper);\r\n }\r\n\r\n this.inputObject.inputField = this.selectedField;\r\n }\r\n\r\n searchZipCity(event: Event): void {\r\n this.selectedField = event.target as HTMLInputElement;\r\n const value = this.selectedField!.value.trim();\r\n\r\n if (value.length < 2) {\r\n this.clearDataTimeout && clearTimeout(this.clearDataTimeout);\r\n this.clearDataTimeout = setTimeout(() => {\r\n this.clearData();\r\n }, 300);\r\n return;\r\n }\r\n\r\n this.lastSearchTerm = value;\r\n\r\n this.setInputObject();\r\n this.timer && clearTimeout(this.timer);\r\n this.timer = setTimeout(() => {\r\n this.callApi(value);\r\n }, 300);\r\n }\r\n\r\n callApi(value: string) {\r\n if (!this.inputObject.dropdown) return;\r\n this.hideDropdown(false);\r\n\r\n if (this.lastSearchTerm !== value) return;\r\n\r\n const zipCity = this.parseZipCity(value);\r\n const apiUrl = `${window.location.origin}/api/portal/v1/zipsearch`;\r\n\r\n const urlObject = new URL(apiUrl);\r\n const { searchParams } = urlObject;\r\n\r\n Object.entries(zipCity).forEach(([key, value]) => {\r\n searchParams.set(key, value);\r\n });\r\n\r\n fetchRequest({\r\n requestURL: urlObject.toString(),\r\n resolveHandler: this.refreshResultList.bind(this),\r\n decodeJSONResponse: false,\r\n });\r\n }\r\n\r\n parseZipCity(value: string) {\r\n let zip: string | number;\r\n let city: string;\r\n\r\n const country: string = this.fieldCountry?.value?.toLowerCase() || 'ch';\r\n\r\n const arr = value.split(' ');\r\n const numberRegex = /^[0-9]+$/;\r\n const regexTest = arr.find((elem) => numberRegex.test(elem));\r\n if (regexTest === undefined) {\r\n zip = '';\r\n } else {\r\n zip = regexTest;\r\n }\r\n\r\n if (!zip) {\r\n if (arr.length > 1) {\r\n zip = +arr[1] || '';\r\n }\r\n }\r\n\r\n zip = zip.toString();\r\n city = value.replace(zip, '').trim();\r\n if (city === 'undefined') {\r\n city = '';\r\n }\r\n\r\n return {\r\n zip,\r\n city,\r\n country,\r\n };\r\n }\r\n\r\n refreshResultList(response: TKResponse): void {\r\n if (!response) return;\r\n this.clearData();\r\n if (Array.isArray(response)) {\r\n response.forEach((element: ZipCityData) => {\r\n const listItemTpl: string = `\r\n `;\r\n\r\n this.inputObject.dropdown!.insertAdjacentHTML('beforeend', listItemTpl);\r\n this.inputObject.data?.push({ zip: element.zip, city: element.city, country: element.country });\r\n });\r\n }\r\n\r\n if (this.inputObject.data!.length === 0) {\r\n const listItemTpl: string = `\r\n
\r\n
\r\n \r\n \r\n \r\n ${zipCityMessages.noMatchFound}\r\n
\r\n
`;\r\n\r\n this.inputObject.dropdown!.insertAdjacentHTML('beforeend', listItemTpl);\r\n }\r\n this.listWrapper.style.border = '';\r\n this.loadingSpinnerTimeout && clearTimeout(this.loadingSpinnerTimeout);\r\n this.inputObject.dropdown!.hidden = false;\r\n }\r\n\r\n selectItem(event: Event): void {\r\n let selectedItem: HTMLElement = event.target as HTMLElement;\r\n selectedItem = selectedItem.closest('[data-tk-zip]') as HTMLElement;\r\n\r\n if (!selectedItem) return;\r\n const zip = selectedItem.getAttribute('data-tk-zip') as string;\r\n const city = selectedItem.getAttribute('data-tk-city') as string;\r\n const country = selectedItem.getAttribute('data-tk-country') as string;\r\n\r\n if (this.fieldZip) {\r\n this.fieldZip.value = zip;\r\n }\r\n if (this.fieldCity) {\r\n this.fieldCity.value = city;\r\n }\r\n if (this.fieldCountry) {\r\n this.fieldCountry.value = country;\r\n }\r\n\r\n this.inputObject.inputField!.focus();\r\n this.clearData();\r\n }\r\n\r\n clearFormFields(): void {\r\n this.clearData();\r\n this.fieldCity!.value = '';\r\n this.fieldZip!.value = '';\r\n }\r\n\r\n clearData(): void {\r\n if (this.inputObject.dropdown) {\r\n this.hideDropdown(true);\r\n this.inputObject.dropdown.replaceChildren();\r\n }\r\n this.inputObject.data = [];\r\n }\r\n\r\n showLoadingAnimation() {\r\n this.loadingSpinnerTimeout && clearTimeout(this.loadingSpinnerTimeout);\r\n this.loadingSpinnerTimeout = setTimeout(() => {\r\n this.listWrapper.innerHTML = `\r\n
\r\n
\r\n
`;\r\n }, 300);\r\n }\r\n\r\n static async isValidZipCity(form: HTMLFormElement): Promise {\r\n const apiUrl = `${window.location.origin}/api/portal/v1/zipsearch`;\r\n const zipCityElem = {\r\n country: form.querySelector('[data-tk-zip-country]') as HTMLInputElement || '',\r\n zip: form.querySelector('[data-tk-zip-zip]') as HTMLInputElement || '',\r\n city: form.querySelector('[data-tk-zip-city]') as HTMLInputElement || '',\r\n };\r\n\r\n const zipCityValue: ZipCityData = {\r\n country: zipCityElem.country.value,\r\n zip: zipCityElem.zip.value,\r\n city: zipCityElem.city.value,\r\n };\r\n\r\n const urlObject = new URL(apiUrl);\r\n const { searchParams } = urlObject;\r\n\r\n Object.entries(zipCityValue).forEach(([key, value]) => {\r\n searchParams.set(key, value);\r\n });\r\n\r\n return new Promise((resolve) => {\r\n fetchRequest({\r\n requestURL: urlObject.toString(),\r\n decodeJSONResponse: false,\r\n resolveHandler: (response: TKResponse) => {\r\n let isValid = false;\r\n if (Array.isArray(response)) {\r\n response.some((item: ZipCityData) => {\r\n isValid = TKFormZipCity.shallowObjectEquality(zipCityValue, item);\r\n\r\n return isValid;\r\n });\r\n }\r\n resolve(isValid);\r\n },\r\n });\r\n });\r\n }\r\n\r\n static shallowObjectEquality(object1: ZipCityData, object2: ZipCityData): boolean {\r\n const keys1 = Object.keys(object1);\r\n const keys2 = Object.keys(object2);\r\n let isEqual = true;\r\n\r\n if (keys1.length !== keys2.length) {\r\n isEqual = false;\r\n return isEqual;\r\n }\r\n\r\n keys1.forEach((key) => {\r\n if (object1[key as keyof ZipCityData] !== object2[key as keyof ZipCityData]) {\r\n isEqual = false;\r\n return isEqual;\r\n }\r\n });\r\n return isEqual;\r\n }\r\n}\r\n","import TKManager from '@tk/basiscs/tk.manager';\r\n\r\ninterface ActionItem {\r\n id: string;\r\n affiliation: string;\r\n revenue: string;\r\n tax: string;\r\n shipping: string;\r\n}\r\n\r\ninterface ProductItem {\r\n id: string;\r\n name: string;\r\n brand: string;\r\n category: string;\r\n price: string;\r\n quantity: string;\r\n position: string;\r\n}\r\n\r\nexport default class NSManager extends TKManager {\r\n constructor() {\r\n super();\r\n }\r\n\r\n getPurchaseData() {\r\n return {\r\n event: 'event-purchase-ga4',\r\n ecommerce: {\r\n purchase: {\r\n actionField: this.getActionData(),\r\n products: this.getProductData(),\r\n },\r\n },\r\n };\r\n }\r\n\r\n getActionData() {\r\n const affiliation = this.querySelector('[data-tk-otm-affiliation]');\r\n const revenue = this.querySelector('[data-tk-otm-revenue]');\r\n const tax = this.querySelector('[data-tk-otm-tax]');\r\n const shipping = this.querySelector('[data-tk-otm-shipping]');\r\n const currency = this.querySelector('[data-tk-otm-currency]');\r\n return {\r\n id: this.basketId!.innerText,\r\n affiliation: affiliation ? affiliation.innerText : '',\r\n revenue: revenue ? revenue.innerText : '',\r\n tax: tax ? tax.innerText : '',\r\n shipping: shipping ? shipping.innerText : '',\r\n currency: currency ? currency.innerText : '',\r\n } as ActionItem;\r\n }\r\n\r\n getProductData() {\r\n const data: ProductItem[] = [];\r\n const items = this.querySelectorAll('[data-tk-otm-item]');\r\n Array.from(items).forEach((item) => {\r\n const id = item.querySelector('.otm-id');\r\n const name = item.querySelector('.otm-name');\r\n const brand = item.querySelector('.otm-brand');\r\n const category = item.querySelector('.otm-category');\r\n const price = item.querySelector('.otm-price');\r\n const quantity = item.querySelector('.otm-quantity');\r\n const position = item.querySelector('.otm-position');\r\n data.push({\r\n id: id ? id.innerText : '',\r\n name: name ? name.innerText : '',\r\n brand: brand ? brand.innerText : '',\r\n category: category ? category.innerText : '',\r\n price: price ? price.innerText : '',\r\n quantity: quantity ? quantity.innerText : '',\r\n position: position ? position.innerText : '',\r\n });\r\n });\r\n return data;\r\n }\r\n}\r\n","import TKCustomElementFactory from '@tk/utilities/tk.custom.element.factory';\r\nimport { NotificationType, sendNotification } from '@tk/utilities/tk.notification';\r\n\r\ninterface ActionItem {\r\n id: string;\r\n affiliation: string;\r\n revenue: string;\r\n tax: string;\r\n shipping: string;\r\n}\r\n\r\ninterface ProductItem {\r\n id: string;\r\n name: string;\r\n brand: string;\r\n category: string;\r\n price: string;\r\n quantity: string;\r\n position: string;\r\n}\r\n\r\nexport default class TKManager extends TKCustomElementFactory {\r\n messageContainerSelector: string;\r\n basketId?: HTMLElement;\r\n eventName: string;\r\n sessionTimeoutWrapper?: HTMLElement;\r\n sessionTime?: number;\r\n firstItemToScrollInto?: HTMLElement;\r\n\r\n constructor() {\r\n super();\r\n\r\n this.eventName = this.getAttribute('data-tk-event-name') || 'event-purchase';\r\n this.basketId = this.querySelector('[data-tk-otm-basket-id]') || undefined;\r\n this.messageContainerSelector = (\r\n this.getAttribute('data-tk-message-container-selector')\r\n || '[id^=\"wp_messages_container_\"]'\r\n );\r\n this.sessionTimeoutWrapper = this.querySelector('[data-tk-session-timeout-wrapper]') || undefined;\r\n this.sessionTime = Number(this.sessionTimeoutWrapper?.getAttribute('data-tk-session-time') || 0);\r\n this.firstItemToScrollInto = this.querySelector('[data-tk-scroll-into]') || undefined;\r\n }\r\n\r\n connectedCallback(): void {\r\n this.processNotification();\r\n\r\n this.sessionTimeoutWrapper && this.showSessionTimeout();\r\n\r\n this.firstItemToScrollInto && this.scrollToElement();\r\n\r\n if (!this.basketId || !window.dataLayer) return;\r\n const data = this.getPurchaseData();\r\n data && window.dataLayer.push(data);\r\n }\r\n\r\n processNotification() {\r\n const messageContainer = document.querySelector(this.messageContainerSelector);\r\n if (!messageContainer || !messageContainer.hasChildNodes()) return;\r\n\r\n const infoMessage = messageContainer.querySelectorAll('.Info');\r\n const errorMessage = messageContainer.querySelectorAll('.Error');\r\n const warningMessage = messageContainer.querySelectorAll('.Warning');\r\n const debugMessage = messageContainer.querySelectorAll('.Debug');\r\n\r\n const messageList = Array.from([...infoMessage, ...errorMessage, ...warningMessage, ...debugMessage]);\r\n\r\n const types: Record = {\r\n Info: NotificationType.SUCCESS,\r\n Error: NotificationType.ERROR,\r\n Warning: NotificationType.WARNING,\r\n Debug: NotificationType.INFO,\r\n };\r\n\r\n messageList.forEach((item) => {\r\n const type = types[item.className];\r\n const childList = Array.from(item.firstChild?.childNodes || []);\r\n const message = childList.find((item) => item instanceof Text)?.textContent || '';\r\n const code = item.querySelector('.was-message-code')?.textContent || '';\r\n const addition = item.querySelector('.was-message-addition')?.textContent || '';\r\n const wait = Number(item.querySelector('.was-message-wait')?.textContent) || undefined;\r\n const consoleMessage = `${code}: ${message}} (wait: ${wait} sec.${addition})`;\r\n\r\n sendNotification(type, message, wait, { consoleMessage });\r\n });\r\n messageContainer.remove();\r\n }\r\n\r\n showSessionTimeout() {\r\n setTimeout(() => {\r\n this.sessionTimeoutWrapper!.hidden = false;\r\n }, this.sessionTime);\r\n }\r\n\r\n getPurchaseData() {\r\n return {\r\n event: 'event-purchase',\r\n ecommerce: {\r\n purchase: {\r\n actionField: this.getActionData(),\r\n products: this.getProductData(),\r\n },\r\n },\r\n };\r\n }\r\n\r\n getActionData() {\r\n const affiliation = this.querySelector('[data-tk-otm-affiliation]');\r\n const revenue = this.querySelector('[data-tk-otm-revenue]');\r\n const tax = this.querySelector('[data-tk-otm-tax]');\r\n const shipping = this.querySelector('[data-tk-otm-shipping]');\r\n return {\r\n id: this.basketId!.innerText,\r\n affiliation: affiliation ? affiliation.innerText : '',\r\n revenue: revenue ? revenue.innerText : '',\r\n tax: tax ? tax.innerText : '',\r\n shipping: shipping ? shipping.innerText : '',\r\n } as ActionItem;\r\n }\r\n\r\n getProductData() {\r\n const data: ProductItem[] = [];\r\n const items = this.querySelectorAll('[data-tk-otm-item]');\r\n Array.from(items).forEach((item) => {\r\n const id = item.querySelector('.otm-id');\r\n const name = item.querySelector('.otm-name');\r\n const brand = item.querySelector('.otm-brand');\r\n const category = item.querySelector('.otm-category');\r\n const price = item.querySelector('.otm-price');\r\n const quantity = item.querySelector('.otm-quantity');\r\n const position = item.querySelector('.otm-position');\r\n data.push({\r\n id: id ? id.innerText : '',\r\n name: name ? name.innerText : '',\r\n brand: brand ? brand.innerText : '',\r\n category: category ? category.innerText : '',\r\n price: price ? price.innerText : '',\r\n quantity: quantity ? quantity.innerText : '',\r\n position: position ? position.innerText : '',\r\n });\r\n });\r\n return data;\r\n }\r\n\r\n scrollToElement() {\r\n const { top } = this.firstItemToScrollInto!.getBoundingClientRect();\r\n const offset = Number(this.firstItemToScrollInto?.getAttribute('data-tk-scroll-into-offset')) || 16;\r\n const mainContainer = this.querySelector('main');\r\n const mainRect = mainContainer?.getBoundingClientRect();\r\n const mainRectTop = mainRect?.top || 0;\r\n const scrollY = top - mainRectTop - offset;\r\n setTimeout(() => {\r\n window.scrollTo({ top: scrollY, behavior: 'smooth' });\r\n }, 0);\r\n }\r\n}\r\n","import TKFormElement from '@tk/controls/tk.form.element';\r\nimport { fetchRequest } from '@tk/utilities/tk.fetch';\r\n\r\nexport default class NSFormElement extends TKFormElement {\r\n inputTimeout: number | undefined;\r\n processOnInput: string;\r\n\r\n constructor() {\r\n super();\r\n\r\n this.processOnInput = this.getAttribute('data-tk-process-on-input') || '';\r\n }\r\n\r\n connectedCallback() {\r\n super.connectedCallback();\r\n\r\n if (this.processOnInput) {\r\n this.registerInputListener();\r\n }\r\n }\r\n\r\n registerInputListener() {\r\n if (!this.fieldElement) return;\r\n\r\n const onInputHandler = this.onInputChanged.bind(this);\r\n this.pushListener({ event: 'input', element: this.fieldElement, action: onInputHandler });\r\n }\r\n\r\n onInputChanged() {\r\n if (this.inputTimeout) {\r\n clearTimeout(this.inputTimeout);\r\n }\r\n\r\n this.inputTimeout = window.setTimeout(() => {\r\n const data = {\r\n remark: this.fieldElement!.value,\r\n };\r\n fetchRequest({\r\n requestURL: this.processOnInput as string,\r\n resolveHandler: this.refreshContent.bind(this),\r\n payload: data,\r\n });\r\n }, 500);\r\n }\r\n\r\n refreshContent() {\r\n return this;\r\n }\r\n\r\n /**\r\n * For the Material Number Input or forms inside of tables, it is necessary that all surrounding elements have been\r\n * fullyloaded before the Material Number Element itself is displayed.\r\n * This is because the position of the label in the collapsed state\r\n * needs to be calculated for the Material Number Input. This calculation depends on the surrounding elements\r\n */\r\n onDomContentLoaded() {\r\n document.addEventListener('DOMContentLoaded', () => {\r\n this.checkRequiredAttribute();\r\n this.registerAddonClickedListener();\r\n this.registerAddonHoverListener();\r\n this.registerShowPasswordClickedListener();\r\n this.initMaterialInput();\r\n this.observeDisabledAttribute();\r\n if (this.processOnInput) {\r\n this.registerInputListener();\r\n }\r\n });\r\n }\r\n}\r\n","import TKCustomElementFactory from '@tk/utilities/tk.custom.element.factory';\r\n\r\ntype FieldElement = HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | undefined;\r\ntype AddonType = 'prefix' | 'suffix';\r\n\r\nenum HoverState {\r\n ACTIVE = 'active',\r\n INACTIVE = 'inactive',\r\n}\r\n\r\nexport default class TKFormElement extends TKCustomElementFactory {\r\n fieldElement: FieldElement;\r\n labelElement: HTMLLabelElement | undefined;\r\n isMaterial: boolean;\r\n materialClass: string;\r\n materialNumberInputClass: string;\r\n materialLabelInsideClass: string;\r\n materialSelectFocussedClass: string;\r\n materialLoadedClass: string;\r\n addonElement: HTMLSpanElement | undefined;\r\n addonSuffixDistance: number;\r\n addonPrefixDistance: number;\r\n addonDefaultPadding: number;\r\n isPasswordInput: boolean;\r\n waitForSurroundingContent: HTMLElement | undefined;\r\n disableOnAddonClick: boolean;\r\n onTransitionEnd: () => void;\r\n\r\n constructor() {\r\n super();\r\n this.fieldElement = this.querySelector('input, select, textarea') as FieldElement;\r\n this.labelElement = this.querySelector('label')\r\n || undefined;\r\n this.isMaterial = this.hasAttribute('data-tk-is-material');\r\n this.materialClass = this.getAttribute('data-tk-material-class')\r\n || 'tk-form-material';\r\n this.materialNumberInputClass = this.getAttribute('data-tk-material-number-input-class')\r\n || 'tk-form-material--number';\r\n this.materialLabelInsideClass = this.getAttribute('data-tk-material-label-inside-class')\r\n || 'tk-form-material--label-inside';\r\n this.materialSelectFocussedClass = this.getAttribute('data-tk-material-select-focussed-class')\r\n || 'tk-form-select--focussed';\r\n this.materialLoadedClass = this.getAttribute('data-tk-material-loaded-class')\r\n || 'tk-form-material--loaded';\r\n this.isPasswordInput = this.hasAttribute('data-tk-toggle-password');\r\n this.disableOnAddonClick = this.hasAttribute('data-tk-disable-on-addon-click');\r\n this.addonElement = this.querySelector('[data-tk-addon]')\r\n || undefined;\r\n this.waitForSurroundingContent = (this.closest('[data-wait-for-surrounding-content]') as HTMLElement)\r\n || undefined;\r\n this.addonSuffixDistance = 0;\r\n this.addonPrefixDistance = 0;\r\n this.addonDefaultPadding = parseInt(this.getAttribute('data-tk-addon-default-padding') || '0', 10)\r\n || 4;\r\n this.onTransitionEnd = () => {};\r\n }\r\n\r\n connectedCallback() {\r\n if (this.isNumberInput() || this.waitForSurroundingContent) {\r\n this.onDomContentLoaded();\r\n return;\r\n }\r\n this.checkRequiredAttribute();\r\n this.registerAddonClickedListener();\r\n this.registerAddonHoverListener();\r\n this.registerShowPasswordClickedListener();\r\n this.initMaterialInput();\r\n this.observeDisabledAttribute();\r\n }\r\n\r\n /**\r\n * For the Material Number Input or forms inside of tables, it is necessary that all surrounding elements have been\r\n * fullyloaded before the Material Number Element itself is displayed.\r\n * This is because the position of the label in the collapsed state\r\n * needs to be calculated for the Material Number Input. This calculation depends on the surrounding elements\r\n */\r\n onDomContentLoaded() {\r\n document.addEventListener('DOMContentLoaded', () => {\r\n this.checkRequiredAttribute();\r\n this.registerAddonClickedListener();\r\n this.registerAddonHoverListener();\r\n this.registerShowPasswordClickedListener();\r\n this.initMaterialInput();\r\n this.observeDisabledAttribute();\r\n });\r\n }\r\n\r\n // #region Required\r\n checkRequiredAttribute() {\r\n if (!this.labelElement || !this.fieldElement || !this.fieldElement.hasAttribute('required')) return;\r\n this.labelElement.textContent = `${this.labelElement.textContent} *`;\r\n }\r\n // #endregion\r\n\r\n // #region disabled\r\n observeDisabledAttribute() {\r\n if (!this.fieldElement || !this.labelElement) return;\r\n\r\n // inital check\r\n this.checkDisabledAttribute();\r\n\r\n const observerConfig = { attributes: true, attributeFilter: ['disabled'] };\r\n\r\n const onCheckDiabledAttribute = this.checkDisabledAttribute.bind(this);\r\n\r\n const observer = new MutationObserver(onCheckDiabledAttribute);\r\n observer.observe(this.fieldElement, observerConfig);\r\n }\r\n\r\n checkDisabledAttribute() {\r\n const addDisabledClass = this.fieldElement!.hasAttribute('disabled');\r\n this.classList.toggle('tk-form-input--disabled', addDisabledClass);\r\n }\r\n // #endregion\r\n\r\n // #region Addon\r\n registerAddonClickedListener() {\r\n if (!this.addonElement || this.disableOnAddonClick) return;\r\n\r\n const addonClickHandler = this.onAddonClicked.bind(this);\r\n\r\n this.pushListener({ event: 'click', element: this.addonElement, action: addonClickHandler });\r\n }\r\n\r\n registerAddonHoverListener() {\r\n if (!this.addonElement) return;\r\n const onHoverStartHandler = this.onAddonHover.bind(this, HoverState.ACTIVE);\r\n this.pushListener({ event: 'mouseenter', element: this.addonElement, action: onHoverStartHandler });\r\n const onHoverEndHandler = this.onAddonHover.bind(this, HoverState.INACTIVE);\r\n this.pushListener({ event: 'mouseleave', element: this.addonElement, action: onHoverEndHandler });\r\n }\r\n\r\n onAddonHover(hoverState: HoverState) {\r\n if (\r\n !this.fieldElement\r\n || (!(this.fieldElement instanceof HTMLInputElement)\r\n && !(this.fieldElement instanceof HTMLTextAreaElement))\r\n ) throw new Error('No Input element found');\r\n\r\n this.classList.toggle(\r\n 'tk-form--addon-hover',\r\n (hoverState === HoverState.ACTIVE) && !this.fieldElement.disabled,\r\n );\r\n }\r\n\r\n onAddonClicked() {\r\n if (\r\n !this.fieldElement\r\n || (!(this.fieldElement instanceof HTMLInputElement)\r\n && !(this.fieldElement instanceof HTMLTextAreaElement))\r\n ) throw new Error('No Input element found');\r\n\r\n if (this.isPasswordInput) return;\r\n this.fieldElement.focus();\r\n const lastCharPosition = this.fieldElement.value.length;\r\n const isNumberInput = this.fieldElement.type === 'number';\r\n if (isNumberInput) {\r\n this.fieldElement.setAttribute('type', 'text');\r\n }\r\n this.fieldElement.setSelectionRange(lastCharPosition, lastCharPosition);\r\n if (isNumberInput) {\r\n this.fieldElement.setAttribute('type', 'number');\r\n }\r\n }\r\n\r\n registerShowPasswordClickedListener() {\r\n if (!this.isPasswordInput || !this.addonElement) return;\r\n\r\n const passwordShowClickHandler = this.onPasswordShowClicked.bind(this);\r\n this.pushListener({ event: 'mousedown', element: this.addonElement, action: passwordShowClickHandler });\r\n this.pushListener({ event: 'mouseup', element: this.addonElement, action: passwordShowClickHandler });\r\n this.pushListener({ event: 'touchstart', element: this.addonElement, action: passwordShowClickHandler });\r\n this.pushListener({ event: 'touchend', element: this.addonElement, action: passwordShowClickHandler });\r\n }\r\n\r\n onPasswordShowClicked(event: Event) {\r\n if (\r\n !this.fieldElement\r\n || !(this.fieldElement instanceof HTMLInputElement)\r\n ) throw new Error('Missing input element');\r\n\r\n if (event.type === 'mousedown' || event.type === 'touchstart') {\r\n this.fieldElement.type = 'text';\r\n } else {\r\n this.fieldElement.type = 'password';\r\n }\r\n }\r\n // #endregion\r\n\r\n // #region Material\r\n initMaterialInput() {\r\n if (!this.isMaterial) return;\r\n if (!this.fieldElement) throw new Error('No element found');\r\n\r\n this.classList.add(this.materialClass);\r\n\r\n if (this.isNumberInput()) {\r\n this.classList.add(this.materialNumberInputClass);\r\n }\r\n\r\n this.registerLabelTransitionEndListener();\r\n this.calculateAddonWidth();\r\n this.setMaterialLabelState();\r\n this.registerMaterialValueChangeListener();\r\n this.registerMaterialSelectFocusChangeListener();\r\n }\r\n\r\n /**\r\n * This function is mainly used to check whether a valid value has been\r\n * set for the data-tk-addon attribute\r\n * @returns addonType: string representing the addon type\r\n */\r\n getAddonType() {\r\n if (!this.addonElement) throw new Error('Missing addon');\r\n const addonType = this.addonElement.getAttribute('data-tk-addon') as AddonType;\r\n\r\n if ((addonType !== 'prefix') && (addonType !== 'suffix')) throw new Error('Wrong addon type');\r\n\r\n return addonType;\r\n }\r\n\r\n /**\r\n * Checks whether the element contains a value or not. This information is required\r\n * to determine whether the label should be displayed inside or outside the element.\r\n * @returns isEmptyElement: boolean\r\n */\r\n checkForValue() {\r\n let isEmptyElement;\r\n\r\n if (this.fieldElement instanceof HTMLSelectElement) {\r\n const selectedOption = this.querySelector('option:checked');\r\n const isPlaceholderOption = selectedOption?.hasAttribute('data-tk-empty-option');\r\n isEmptyElement = isPlaceholderOption;\r\n } else {\r\n isEmptyElement = this.fieldElement?.value === '';\r\n }\r\n\r\n return isEmptyElement;\r\n }\r\n\r\n /**\r\n * This function implements the material functionality by displaying the label either\r\n * inside or outside the control, depending on the content\r\n */\r\n setMaterialLabelState() {\r\n // check input value\r\n const isEmptyMaterialInput = this.checkForValue();\r\n\r\n if (isEmptyMaterialInput) {\r\n this.classList.add(this.materialLabelInsideClass);\r\n if (!this.labelElement) throw new Error('Missing label element');\r\n\r\n if (this.isNumberInput()) {\r\n this.setupMaterialNumberLabelStyle();\r\n }\r\n\r\n if (!this.isNumberInput()) {\r\n this.setupMaterialDefaultLabelStyle();\r\n }\r\n } else {\r\n this.classList.remove(this.materialLabelInsideClass);\r\n if (!this.labelElement) throw new Error('Missing label element');\r\n this.labelElement.removeAttribute('style');\r\n }\r\n }\r\n\r\n /**\r\n * This function calculates the label position for a material input that is not of type\r\n * number and where the label is located within the input\r\n */\r\n setupMaterialDefaultLabelStyle() {\r\n if ((this.addonPrefixDistance === 0 && this.addonSuffixDistance === 0)) return;\r\n this.labelElement!.style.marginLeft = this.addonPrefixDistance > 0\r\n ? `${this.addonPrefixDistance + this.addonDefaultPadding}px` : '0px';\r\n this.labelElement!.style.marginRight = this.addonSuffixDistance > 0\r\n ? `${this.addonSuffixDistance + this.addonDefaultPadding}px` : '0px';\r\n this.labelElement!.style.paddingInline = '0';\r\n }\r\n\r\n /**\r\n * This function calculates the label position for a material input of type Number where\r\n * the label is located within the input\r\n */\r\n setupMaterialNumberLabelStyle() {\r\n this.labelElement!.style.paddingInline = '0';\r\n const labelWidthWithPadding = this.labelElement!.getBoundingClientRect().width;\r\n const computedLabelStyle = window.getComputedStyle(this.labelElement!);\r\n const labelPaddingLeft = parseFloat(computedLabelStyle.paddingLeft);\r\n const labelPaddingRight = parseFloat(computedLabelStyle.paddingRight);\r\n const labelWidth = (labelWidthWithPadding - labelPaddingLeft - labelPaddingRight);\r\n\r\n const formControlWidth = this.getBoundingClientRect().width;\r\n\r\n const computetInputStyle = window.getComputedStyle(this.fieldElement!);\r\n const inputPaddingRight = parseFloat(computetInputStyle.paddingRight);\r\n\r\n const addonWidth = (this.addonElement && (this.getAddonType() === 'suffix'))\r\n ? this.addonElement.getBoundingClientRect().width : 0;\r\n\r\n const xOffset = Math.round(formControlWidth - labelWidth - addonWidth - inputPaddingRight);\r\n\r\n this.labelElement!.style.paddingLeft = `${xOffset}px`;\r\n }\r\n\r\n /**\r\n * This function checks whether the current control has an addon. If so, depending\r\n * on the type of control, it checks whether the material label requires additional\r\n * spacing in the folded state\r\n */\r\n calculateAddonWidth() {\r\n if (!this.addonElement) return;\r\n if (this.fieldElement instanceof HTMLSelectElement) return;\r\n\r\n /* The text is displayed right-aligned for the number inputs.\r\n They must therefore be treated separately */\r\n const isNumberInput = this.isNumberInput();\r\n const addonType = this.getAddonType();\r\n\r\n if (!isNumberInput && (addonType === 'prefix')) {\r\n this.addonPrefixDistance = this.addonElement.offsetWidth;\r\n } else if (isNumberInput && (addonType === 'suffix')) {\r\n this.addonSuffixDistance = this.addonElement.offsetWidth;\r\n }\r\n }\r\n\r\n /**\r\n * Checks whether the input is of type Number. This information is required because\r\n * the text does not start on the left when the number input is collapsed\r\n * @returns boolean: representing is input of type number\r\n */\r\n isNumberInput() {\r\n if (!(this.fieldElement instanceof HTMLInputElement)) return false;\r\n\r\n return (this.fieldElement && (this.fieldElement.type === 'number'));\r\n }\r\n\r\n /**\r\n * Listener for material control value changes\r\n */\r\n registerMaterialValueChangeListener() {\r\n const onValueChanged = this.setMaterialLabelState.bind(this);\r\n this.pushListener({ event: 'input', element: this.fieldElement!, action: onValueChanged });\r\n }\r\n\r\n /**\r\n * Is required so that a class can be added to the focused material select\r\n * element that colors the text of the select white\r\n */\r\n registerMaterialSelectFocusChangeListener() {\r\n if (!(this.fieldElement instanceof HTMLSelectElement)) return;\r\n\r\n const onFocusChanged = this.onMaterialSelectFocusChanged.bind(this);\r\n\r\n this.pushListener({ event: 'focusin', element: this.fieldElement, action: onFocusChanged });\r\n this.pushListener({ event: 'focusout', element: this.fieldElement, action: onFocusChanged });\r\n }\r\n\r\n /**\r\n * This function is used to add a class to the focused material select, which sets\r\n * the font to white if no option has been selected\r\n * @param event: Used to determin if focus has been set or removed\r\n */\r\n onMaterialSelectFocusChanged(event: Event) {\r\n const { type } = event;\r\n\r\n if (type === 'focusin') {\r\n this.classList.add(this.materialSelectFocussedClass);\r\n } else {\r\n this.classList.remove(this.materialSelectFocussedClass);\r\n }\r\n }\r\n\r\n /**\r\n * This function fades in the material element as soon as the label is in\r\n * the correct position\r\n */\r\n registerLabelTransitionEndListener() {\r\n if (!this.labelElement) throw new Error('Missing label element');\r\n\r\n this.onTransitionEnd = this.addMaterialLoadedModifier.bind(this);\r\n this.pushListener({ event: 'transitionend', element: this.labelElement, action: this.onTransitionEnd });\r\n }\r\n\r\n addMaterialLoadedModifier() {\r\n this.classList.add(this.materialLoadedClass);\r\n this.labelElement!.removeEventListener('transitionend', this.onTransitionEnd);\r\n }\r\n // #endregion\r\n}\r\n"],"names":["$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","NotificationType","DialogActions","matchType","HoverState","$1221feb2184dfefe$export$9130146a86a85749","$2215c02a950e9fbf$var$DialogActions","$21a7ddce6a8de4e2$var$matchType","$9a3403e3213d867d$var$HoverState","$parcel$global","globalThis","self","window","global","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$0380ce8f1f064ccc$export$6503ec6e8aabbaf","$0380ce8f1f064ccc$export$f7ad0328861e2f03","$0380ce8f1f064ccc$var$mapping","Map","baseUrl","manifest","i","length","path","resolved","URL","toString","$7dd1ddf6834435ca$export$bdfd709ae4826697","$7dd1ddf6834435ca$var$bundleURL","value","$7dd1ddf6834435ca$var$getBundleURL","matches","stack","match","replace","resolve","then","$2prpb","bundle","Promise","reject","concat","document","getElementsByTagName","some","script","src","preloadLink","createElement","href","rel","as","head","appendChild","async","type","onerror","error","TypeError","message","onload","remove","$1c132cac09cd18d9$var$cachedBundles","$1c132cac09cd18d9$var$cachedPreloads","$1c132cac09cd18d9$var$cachedPrefetches","loader","cache","$1c132cac09cd18d9$var$getCache","apply","arguments","catch","getBundleURL","JSON","parse","$e31d2de11bbf216d$export$2e2bcd8739ae039","constructor","list","customElementList","forEach","item","customElements","name","define","$8f658dda969a7982$export$2e2bcd8739ae039","HTMLElement","listeners","connectedCallback","disconnectedCallback","element","removeEventListener","event","action","pushListener","push","addEventListener","removeListener","foundElement","find","newList","filter","$2e3d1137f4724c0f$export$2e2bcd8739ae039","resizeEventName","getAttribute","resizeObserver","ResizeObserver","checkSize","bind","breakpoints","currentBreakpoint","getCurrentBreakpoint","clientWidth","observe","viewport","unobserve","entries","currentWidth","innerWidth","CustomEvent","bubbles","detail","width","breakpoint","dispatchEvent","key","$86b3c5b6d66bd808$var$globalFormExpandErrorMessages","stepAdjust","existigName","opacc","$86b3c5b6d66bd808$export$7ea287b8bcd34b91","badInput","patternMismatch","rangeOverflow","rangeUnderflow","stepMismatch","tooLong","tooShort","typeMismatch","valueMissing","valid","customError","passwordNotMatching","tkFormValidityMessages","tkFormPasswordValidityMessages","tkFormExpandErrorMessages","projectFormValidityMessages","projectFormPasswordValidityMessages","projectFormExpandErrorMessages","$86b3c5b6d66bd808$export$35e6ad2b040b8403","tkBasketMessages","projectBasketMessages","tkCompareMessages","projectCompareMessages","tkFavoriteMessages","projectFavoriteMessages","$86b3c5b6d66bd808$export$39227038979f1988","messageEmptyText","text","messageOk","messageCancel","messageChange","messageDefault","messageDefaultInfo","messageDefaultWarning","messageDefaultError","messageDefaultDebug","tkGeneralMessages","projectGeneralMessages","tkDirectSearchSuggestMessages","projectDirectSearchSuggestMessages","tkFileUploadAreaMessages","projectFileUploadAreaMessages","tkFilterMessages","projectFilterMessages","tkAutocompleteMessages","projectAutocompleteMessages","$86b3c5b6d66bd808$export$389a1ce21906c656","messagePaymentTypeCreditCard","messagePaymentTypeInvoice","messagePaymentTypeInAdvance","messagePaymentTypeOnDelivery","messagePaymentTypeGeneral","tkPaymentMessages","projectPaymentMessages","$86b3c5b6d66bd808$export$36d5448025feaaa9","messageDeliveryTypeGeneral","tkDeliveryMessages","projectDeliveryMessages","$86b3c5b6d66bd808$export$efd88ea7bc399322","messageDelete","messageChangeSuccess","tkAccountMessages","projectAccountMessages","tkCheckoutMessages","projectCheckoutMessages","tkHtmlErrorCodeMessages","projectHtmlErrorCodeMessages","$86b3c5b6d66bd808$export$97a703132b664051","tkZipCityMessages","$2d540709c75492d4$var$render","html","isBody","doc","parser","DOMParser","parseFromString","body","children","$1221feb2184dfefe$var$mapMessageCodeToText","response","messages","textMessage","pluginId","paymentMessages","Number","paymentType","$1221feb2184dfefe$var$getConsoleStyle","backgroundColor","textColor","$1221feb2184dfefe$var$logToConsole","consoleHandler","console","info","warn","log","debug","$1221feb2184dfefe$var$renderMessageContainer","parentElement","messageContainer","querySelector","insertAdjacentElement","$1221feb2184dfefe$export$3a57e165650c636f","wait","options","dialogs","querySelectorAll","lastDialog","Array","from","at","toast","toLowerCase","style","animation","classList","add","animationName","removeChild","consoleMessage","$1221feb2184dfefe$export$146c7c7e50ed1bd2","messageOverride","substring","typeHandler","$1221feb2184dfefe$export$5b256beea4c7e9b5","items","$1653b55d89a7adce$var$getDefaultErrorFnc","$1653b55d89a7adce$export$a4101276b4831ec4","checkForReadOnlyContext","systemUrls","asyncReadOnly","$1653b55d89a7adce$var$prepareJsonResponse","showMessages","data","atob","innerHTML","json","contentType","innerText","status","dataAsBase64","success","dataAsHtml","dataAsJson","$1653b55d89a7adce$var$recordToURLSearchParams","searchParams","URLSearchParams","append","$1653b55d89a7adce$var$formDataToURLSearchParams","formData","$1653b55d89a7adce$export$24835cb787452b46","requestURL","resolveHandler","rejectHandler","payload","decodeJSONResponse","headers","Headers","FormData","method","credentials","fetch","includes","preparedData","$2215c02a950e9fbf$export$2e2bcd8739ae039","currentDialog","shouldOpen","closeOnBackdropClick","url","undefined","button","hasAttribute","shouldMaxWidth","dialogClassName","dialogInnerClassName","dialogCloseClassName","maxWidthClassName","formDataString","isPopup","isConfirm","confirmTitle","confirmDescription","confirmCancelIcon","confirmCancelLabel","confirmSubmitIcon","confirmSubmitLabel","forceReloadContent","registerClickListener","checkAutoOpen","onClick","openDialog","registerFormListener","form","onSubmit","handleForm","registerCloseListener","closeDialog","createDialog","dialog","renderDialog","className","closeClassName","innerClassName","tag","confirmURL","onClosed","closedDialog","getContent","closeCurrentDialog","show","showModal","hookAfterShowModal","handleResponseSuccess","getContentWithData","content","handleUrlAndDialogs","setTimeout","dialogItem","isRealClickEvent","pointerId","closeDialogIfOutside","attachButtonClickHandler","close","handleActions","selector","callback","buttons","handler","jump_forward","forward","jump_backward","backward","jump_to","jumpTo","reset_form","resetForm","nextDialog","getDialogByURL","waitForContent","renewDialogContent","keys","nextDialogItem","index","reset","preventDefault","every","open","HTMLDialogElement","Event","clientX","clientY","target","HTMLSelectElement","HTMLOptionElement","dialogDimensions","getBoundingClientRect","left","right","top","bottom","getRenewDialogContent","dialogInner","$edcef81612fbf4b7$export$2e2bcd8739ae039","boId","boNumber","artTextNumber","bo","attr","itemId","langNumber","dataPer","asyncTemplate","urlTemplate","templateContentPromiseArray","templatesLoaded","fileUploadIFrameURL","sendAjaxRequest","registerModalListener","modal","saveButton","onSave","save","cancelButton","onCancel","cancel","requestData","boid","bonumber","arttextno","per","template","modalid","showContentInEditMode","htmlEncoded","htmlEncode","getContentFromEditMode","refreshContent","initEditor","tinymce","activeEditor","format","contentContainer","getElementById","language","getLanguage","plugins","insertdatetime_formats","contextmenu","tools","toolbar","base_url","language_url","promotion","content_css","Date","getTime","templates","extended_valid_elements","custom_elements","setup","editor","on","htmlDecode","openmanager","windowManager","openUrl","title","getFileManagerURL","height","ui","registry","addButton","icon","tooltip","onAction","addMenuItem","templateURLElement","templateURL","getTemplates","file_picker_callback","handleFilePicker","location","origin","indexOf","getTemplateContent","resolveFunction","saveTemplateContent","resolvedAllFunction","resolveArrayElementFunction","templateContent","newTemplateEntry","description","allSettled","$cb17fd7e698c018c$export$2e2bcd8739ae039","listWrapperClassName","fieldCountry","fieldZip","fieldCity","lastSearchTerm","selectedField","listWrapper","hidden","loadingSpinnerTimeout","clearDataTimeout","inputObject","inputField","dropdown","listItemSelected","registerListener","onInputHandler","searchZipCity","onClickHandler","toggleDropdown","onSelectHandler","selectItem","onChangeHandler","clearFormFields","onInputKeyNavigationHandler","inputKeyNavigation","onDropdownKeyNavigationHandler","dropdownKeyNavigation","firstElementChild","focus","keyActions","ArrowDown","handleArrowKey","ArrowUp","Enter","Space","Tab","hideDropdown","Escape","isDown","nextElement","nextElementSibling","previousElementSibling","setScroller","isHidden","showLoadingAnimation","border","hasChildNodes","elHeight","offsetHeight","scrollTop","elOffset","setInputObject","trim","clearTimeout","clearData","timer","callApi","zipCity","parseZipCity","urlObject","refreshResultList","zip","city","country","arr","split","numberRegex","regexTest","elem","test","isArray","listItemTpl","insertAdjacentHTML","noMatchFound","selectedItem","closest","replaceChildren","isValidZipCity","apiUrl","zipCityElem","zipCityValue","isValid","shallowObjectEquality","object1","object2","keys1","keys2","isEqual","$21a7ddce6a8de4e2$export$2e2bcd8739ae039","validationList","fieldWrapperSelector","formErrorClassName","fieldHintClassName","shouldValidateInline","passwordStrengthMeter","passwordNewElement","passwordRepeatElement","passwordValidClassName","passwordInvalidClassName","googleRecaptcha","preventEnterDefaultAction","setNoValidateForm","searchFieldElements","registerSubmitListener","registerPasswordListener","registerFieldValidationListener","noValidate","filteredFormElements","formElementList","disabled","wrapper","generateValidityMessages","onSubmitHandler","validateForm","onValidatePassword","validatePassword","onValidation","validateField","validateRecaptcha","grecaptcha","ready","siteKey","token","execute","validateZipCity","fieldElements","apiPromises","map","validationItem","removeMessage","createElementMessage","all","validateByAPI","apiURL","input","fetchExistAPI","isFormValid","elemntToClick","click","submit","validateFields","validity","isRecaptchaValid","checkPasswordStengthMeter","checkPasswordMatching","firstElementToScrollTo","showMessage","invalidMessage","validityList","createValidityDictionary","validationMessage","spanElement","textContent","replacePlaceholders","messageElement","scrollIntoView","behavior","block","validityItem","Boolean","customErrorPrefix","attributeList","getAttributeNames","startsWith","keyFormatted","x","toUpperCase","entry","foundMessage","dictionary","re","RegExp","join","matched","patterns","getPasswordPatterns","contains","newPasswordItem","repeatPasswordItem","currentTarget","regex","pattern","matchtype","regexpMatch","characterPatternElement","upperPatternElement","numberPatternElement","allowedSymbolPatternElement","characterPattern","$4576c900b5c49dcd$export$2e2bcd8739ae039","eventName","basketId","messageContainerSelector","sessionTimeoutWrapper","sessionTime","firstItemToScrollInto","processNotification","showSessionTimeout","scrollToElement","dataLayer","getPurchaseData","infoMessage","messageList","types","Info","SUCCESS","ERROR","Warning","WARNING","Debug","INFO","childList","firstChild","childNodes","Text","addition","ecommerce","purchase","actionField","getActionData","products","getProductData","affiliation","revenue","tax","shipping","brand","category","price","quantity","position","offset","mainContainer","mainRect","scrollY","scrollTo","$c06aa1bb3ae02f99$export$2e2bcd8739ae039","currency","$9a3403e3213d867d$export$2e2bcd8739ae039","fieldElement","labelElement","isMaterial","materialClass","materialNumberInputClass","materialLabelInsideClass","materialSelectFocussedClass","materialLoadedClass","isPasswordInput","disableOnAddonClick","addonElement","waitForSurroundingContent","addonSuffixDistance","addonPrefixDistance","addonDefaultPadding","parseInt","onTransitionEnd","isNumberInput","onDomContentLoaded","checkRequiredAttribute","registerAddonClickedListener","registerAddonHoverListener","registerShowPasswordClickedListener","initMaterialInput","observeDisabledAttribute","checkDisabledAttribute","observer","MutationObserver","attributes","attributeFilter","addDisabledClass","toggle","addonClickHandler","onAddonClicked","onHoverStartHandler","onAddonHover","onHoverEndHandler","hoverState","HTMLInputElement","HTMLTextAreaElement","lastCharPosition","setAttribute","setSelectionRange","passwordShowClickHandler","onPasswordShowClicked","registerLabelTransitionEndListener","calculateAddonWidth","setMaterialLabelState","registerMaterialValueChangeListener","registerMaterialSelectFocusChangeListener","getAddonType","addonType","checkForValue","isEmptyElement","selectedOption","setupMaterialNumberLabelStyle","setupMaterialDefaultLabelStyle","removeAttribute","marginLeft","marginRight","paddingInline","labelWidthWithPadding","computedLabelStyle","getComputedStyle","labelPaddingLeft","parseFloat","paddingLeft","labelPaddingRight","paddingRight","formControlWidth","inputPaddingRight","computetInputStyle","addonWidth","Math","round","offsetWidth","onValueChanged","onFocusChanged","onMaterialSelectFocusChanged","addMaterialLoadedModifier","$183c2fdfe1dce147$export$2e2bcd8739ae039","processOnInput","registerInputListener","onInputChanged","inputTimeout","remark"],"version":3,"file":"contact.js.map"}