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AAG,QAAW,aAEvB,OAAO,QAAU,CACb,YAAa,GACb,MAAO,GACP,YAAa,GACb,YAAa,GACb,cAAe,kBACf,kBAAmB,GAEnB,QAAS,KAET,aAAc,OAEd,aAAc,OAEd,QAAS,OAET,gBAAiB,OACjB,WAAY,QACZ,WAAY,SACZ,WAAY,SACZ,WAAY,WAGxB,CACJ,CAEA2X,EAAI,KAAK,EAGTA,EAAI,oBAAoB,OAAO,kBAAmB,OAAO,wBAAwB,EAEjF,QAAQ,KAAK,oBAAoB","names":["$$","selector","fn","axios","urlsExemptFromOverlay","config","NProgress","$","error","response","BootstrapBreakpoint","CustomHelper","breakpointList","breakpoint","divElement","value","parts","i","el","$target","isLoading","labelText","origWidth","$form","$checkbox","anchor","offset","targetOffset","_a","url","parameter","urlParts","prefix","CustomSwiper","bulletSwiperList","$el","options","Pagination","Swiper","imageSwiperList","imageList","index","className","navSwiperList","Navigation","columns","MiniBasket","q","data","xhr","textStatus","errorThrown","Multilang","multilangElement","multilangJson","multilangObject","labelName","defaultValue","filteredLabels","l","__publicField","PwaHelper","userAgent","isIos","isSamsung","isFirefox","isPwaHelperDismissalFound","isInStandaloneModeIos","isInStandaloneModeChrome","helperElement","helperContentElement","iconElement","closeElement","DataLayerHelper","eventName","eventParam","callback","emitter","mitt","EventBus","event","eventData","eventHandler","eventBus","_QuickScan","hiddenEl","modalEl","modalContentEl","barcodePickerElement","scanditLicenseKey","errorMessagePermission","errorMessageOther","searchArea","scanSettings","barcodePicker","scanResult","barcode","string","updateModel","activate","inputEl","btnEl","isSuccess","ean","productItem","p","QuickScan","SearchScan","searchProductUrl","createItems","self","lookup","items","$listItems","take","item","that","source","keys","key","object","handleClick","createdItems","handleKeyUp","Autocomplete","element","$dropdown","Dropdown","debouncedClickHandler","debounce","debouncedCKeyUpHandler","e","opts","label","idx","classes","ret","clas","SearchSuggestions","input","responseData","suggestionsDictionary","Account","tabList","tabEl","tabTarget","Software","modalSoftwareRequest","softwareName","softwareText","unescape","$this","$sector","$sectorSelect","MessageDialog","identifier","message","messageDialogIdentifier","messageDialogElement","Modal","_BasketStep1","$option","action","name","reference","postData","_b","$container","$item","ProductHelper","eanCode","$deleteLink","result","basketId","basketLineId","productNumber","jsonString","productDataLayerFields","form","divName","divReference","dataLayerProduct","searchParams","natchGtm","NatchGtm","EventNamesSchema","netTotalLineAmount","basketTotalsUpdateModel","messageDialog","psi","BasketStep1","BasketHelper","_c","_d","productId","quantity","unitPrice","orderUnitId","orderSource","isTemplate","templateId","QuantityValidator","isChangeOrderUnit","roundResult","minimum","ioqAmount","ioqRemainder","calculated","calculatedWithRestUp","requestedMultiplier","requestedValue","DiscountValidator","numberOfDecimals","numberValue","powerValue","$quantity","$orderUnit","$unitPrice","$discount","$discountPercentage","$discountUnitPrice","productStock","$availableStockIndicator","$notAvailableStockIndicator","isProductPage","isOnlyChange","isChangeOfOrderUnit","isAddToBasket","$quantityField","$quantityPreviousField","$quantityTotalField","$orderUnitField","$unitPriceField","$priceQuantityField","$currencyCodeField","$isPriceRequestField","$productIdField","$productPriceDataList","isPriceRequest","priceQuantity","currencyCode","unitsPerPack","validationData","correctQuantity","grossUnitPrice","netUnitPrice","correctPriceQuantity","isPriceRequestForData","$productPriceData","minimumOrderQuantity","$discountField","priceDisplayType","salesUnitName","salesUnitQuantity","unitPriceValue","formattedUnitPrice","formattedUnitPricePostfix","totalGrossPriceCalculated","totalNetPriceCalculated","$selectedOrderUnit","changeProductQuantityMessage","warningMessage","$dataLayerCartItem","attributionListId","attributionListName","bootboxTitle","bootboxMessage","_Products","$body","$filterGroup","$filterItem","open","more","checkedFilterGroupIds","filterGroupId","$changeFilterGroup","initStateFilterPropertyId","filterUrl","$favorite","$dataLayerListItem","$dataLayerDetail","$productNumber","relatedProductsEl","failMessage","$parent","$orderQuantity","orderQuantity","id","productDetailSourceEl","productOverviewSourceEl","productOverviewProductCountEl","productCode","isPush","$full","content","productCodeList","title","Popover","Tooltip","forceUpdate","productStockList","$productStockCountSpan","isFavorite","_","Products","Upload","confirmationMessage","$quantityPrevious","$quantityTotal","buttonText","Terminal","localTerminalData","isFallback","selfHostUrl","qGet","dataGet","textStatusGet","xhrGet","errorThrownGet","isAvailableApplicationFile","qPush","dataPush","textStatusPush","xhrPush","errorThrownPush","qPost","dataPost","textStatusPost","xhrPost","errorThrownPost","setRequestHeader","target","isAvailable","isEnabled","args","match","number","stringValue","from","to","PostalCodeValidator","postalCode","countryId","countryName","msg","BasketStep2","selectedValue","transferDateSelector","$transferDate","$disabledDates","disabledDates","disabledTimeList","today","todayWithinThreeMonths","datepickerTransferDate","Datepicker","date","instance","format","dateValue","parsedDateValue","parse","$selectedCountry","deliveryAddressId","BasketStep3","Templates","$row","$details","$templateDetails","templateData","templateLineId","currentPageIndex","actionUrl","withQuery","errorMessage","postUrl","pageUrl","_VueComponentLoader","vueComponent","mountElement","component","defineAsyncComponent","__variableDynamicImportRuntimeHelper","__vitePreload","createApp","VueComponentLoader","App","Button","isBlocked","$link","datePickerId","datePickerInstance","errorThreshold","lineno","columnno","arg","$categoryNavActivator","$languageMenuFixed","modalList","modal","modalNewsMessages","hideList","newsLetterModalElement","emailAddressValue","tabTrigger","Tab"],"sources":["../../../ClientApp/src/scripts/utils/double-dollar.ts","../../../ClientApp/src/scripts/http/set-axios-defaults.ts","../../../ClientApp/src/scripts/models/enums.ts","../../../ClientApp/src/scripts/helpers/custom-helper.ts","../../../ClientApp/src/scripts/components/custom-swiper.ts","../../../ClientApp/src/scripts/components/mini-basket.ts","../../../ClientApp/src/scripts/utils/multilang.ts","../../../ClientApp/src/scripts/components/pwa-helper.ts","../../../ClientApp/src/scripts/helpers/data-layer-helper.ts","../../../ClientApp/src/scripts/utils/event-bus.ts","../../../ClientApp/src/scripts/components/quick-scan.ts","../../../ClientApp/src/scripts/components/search-scan.ts","../../../ClientApp/src/scripts/components/bs5-autocomplete.ts","../../../ClientApp/src/scripts/components/search-suggestions.ts","../../../ClientApp/src/scripts/pages/account.ts","../../../ClientApp/src/scripts/pages/software.ts","../../../ClientApp/src/scripts/components/bs5-message-dialog.ts","../../../ClientApp/src/scripts/pages/basket-step-1.ts","../../../ClientApp/src/scripts/helpers/basket-helper.ts","../../../ClientApp/src/scripts/validators/quantity-validator.ts","../../../ClientApp/src/scripts/validators/discount-validator.ts","../../../ClientApp/src/scripts/extensions/number-extensions.ts","../../../ClientApp/src/scripts/helpers/product-helper.ts","../../../ClientApp/src/scripts/pages/products.ts","../../../ClientApp/src/scripts/pages/upload.ts","../../../ClientApp/src/scripts/pages/terminal.ts","../../../ClientApp/src/scripts/extensions/string-extensions.ts","../../../ClientApp/src/scripts/validators/postal-code-validator.ts","../../../ClientApp/src/scripts/pages/basket-step-2.ts","../../../ClientApp/src/scripts/pages/basket-step-3.ts","../../../ClientApp/src/scripts/pages/templates.ts","../../../ClientApp/src/scripts/vue-component-loader.ts","../../../ClientApp/src/index.ts"],"sourcesContent":["export default function $$(selector: string, fn: (value: Element) => any) {\r\n return [].slice.call(document.querySelectorAll(selector)).map(fn);\r\n}","import $ from \"jquery\";\r\nimport axios, { AxiosResponse } from \"axios\";\r\nimport NProgress from \"nprogress\";\r\n\r\n// make clear to server that axios requests are AJAX requests\r\naxios.defaults.headers.common[\"X-Requested-With\"] = \"XMLHttpRequest\";\r\naxios.defaults.timeout = 10000; // 10 seconds\r\n\r\nconst urlsExemptFromOverlay = [\"\"];\r\n\r\n// Add a request interceptor\r\naxios.interceptors.request.use(\r\n function (config: any) {\r\n // console.log(\"request interceptor:\", config);\r\n if (NProgress) NProgress.start();\r\n\r\n // preventOverlay is not standard axios but javascript's ability to add any property to an object\r\n if (!urlsExemptFromOverlay.includes(config.url ?? \"\") && !(config.preventOverlay ?? false)) {\r\n $(\"body\").css(\"cursor\", \"progress\");\r\n $('
').delay(300).prependTo(\"body\").fadeIn(200);\r\n }\r\n return config;\r\n },\r\n function (error) {\r\n if (NProgress) NProgress.done();\r\n $(\"body\").css(\"cursor\", \"default\"); // cursor doesn't revert until mouse is moved - in chrome\r\n $(\".nt-ajaxing-overlay\").remove();\r\n return Promise.reject(error);\r\n }\r\n);\r\n\r\n// Add a response interceptor\r\naxios.interceptors.response.use(\r\n function (response: AxiosResponse) {\r\n const config = response.config;\r\n // Any status code that lie within the range of 2xx cause this function to trigger\r\n if (NProgress) NProgress.done();\r\n if (!urlsExemptFromOverlay.includes(config.url ?? \"\")) {\r\n $(\"body\").css(\"cursor\", \"default\"); // cursor doesn't revert until mouse is moved - in chrome\r\n $(\".nt-ajaxing-overlay\").remove();\r\n }\r\n return response;\r\n },\r\n function (error) {\r\n // Any status codes that falls outside the range of 2xx cause this function to trigger\r\n if (NProgress) NProgress.done();\r\n $(\"body\").css(\"cursor\", \"default\"); // cursor doesn't revert until mouse is moved - in chrome\r\n $(\".nt-ajaxing-overlay\").remove();\r\n return Promise.reject(error);\r\n }\r\n);\r\n","export enum BootstrapBreakpoint {\r\n none = \"NONE\",\r\n xs = \"XS\",\r\n sm = \"SM\",\r\n md = \"MD\",\r\n lg = \"LG\",\r\n xl = \"XL\",\r\n xxl = \"XXL\"\r\n}","import $ from \"jquery\";\r\nimport axios from \"axios\";\r\nimport {BootstrapBreakpoint} from \"../models/enums\";\r\n\r\nexport default class CustomHelper {\r\n static async checkOnline(): Promise {\r\n try {\r\n const response = await axios.get(\"/api/online/check\");\r\n return response.status === 200;\r\n } catch (error) {\r\n console.error(error);\r\n return false;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the current Bootstrap v5 breakpoint.\r\n * The class list, per breakpoint, contains the classes for which the element will be hidden.\r\n */\r\n static getBootstrapBreakpoint(): BootstrapBreakpoint {\r\n const breakpointList = [\r\n { name: BootstrapBreakpoint.xs, classList: [\"d-none\", \"d-sm-block\"] },\r\n { name: BootstrapBreakpoint.sm, classList: [\"d-sm-none\", \"d-md-block\"] },\r\n { name: BootstrapBreakpoint.md, classList: [\"d-md-none\", \"d-lg-block\"] },\r\n { name: BootstrapBreakpoint.lg, classList: [\"d-lg-none\", \"d-xl-block\"] },\r\n { name: BootstrapBreakpoint.xl, classList: [\"d-xl-none\", \"d-xxl-block\"] },\r\n { name: BootstrapBreakpoint.xxl, classList: [\"d-xxl-none\"] }\r\n ];\r\n\r\n for (let breakpoint of breakpointList) {\r\n const divElement = window.document.createElement(\"div\");\r\n divElement.classList.add(...breakpoint.classList);\r\n\r\n window.document.body.appendChild(divElement);\r\n\r\n if (divElement.offsetParent === null) {\r\n window.document.body.removeChild(divElement);\r\n\r\n console.log(\"Bootstrap Breakpoint\", breakpoint.name.toString());\r\n return breakpoint.name;\r\n }\r\n\r\n window.document.body.removeChild(divElement);\r\n }\r\n\r\n return BootstrapBreakpoint.none;\r\n }\r\n\r\n static getDateFromString(value: any): Date {\r\n if (typeof value === \"undefined\") {\r\n return new Date();\r\n }\r\n\r\n const parts = value.split(/\\-|T/);\r\n return new Date(parts[0], parts[1] - 1, parts[2]);\r\n }\r\n\r\n /**\r\n * Use this method to retrieve a list of codes, where the HTML-tag has a data attribute 'list-item-code'.\r\n */\r\n static getListItemCodeList() {\r\n return $(\"[data-list-item-code]\")\r\n .map((i: number, el: HTMLElement) => {\r\n return $(el).data(\"list-item-code\");\r\n })\r\n .get();\r\n }\r\n\r\n static setLoadingButton($target: any, isLoading: boolean, labelText: string) {\r\n const origWidth = $target.css(\"width\");\r\n\r\n if (isLoading) {\r\n $target.attr(\"disabled\", \"disabled\");\r\n $target.html('');\r\n $target.css(\"width\", origWidth);\r\n } else {\r\n $target.removeAttr(\"disabled\");\r\n $target.text(labelText);\r\n }\r\n }\r\n\r\n static setToggleSubmit($form: any, $checkbox: any) {\r\n if ($checkbox.is(\":checked\")) {\r\n $form.find(\"[type=submit]\").removeAttr(\"disabled\");\r\n $form.find(\".js-button-submit\").removeAttr(\"disabled\");\r\n } else {\r\n $form.find(\"[type=submit]\").attr(\"disabled\", \"disabled\");\r\n $form.find(\".js-button-submit\").attr(\"disabled\", \"disabled\");\r\n }\r\n }\r\n\r\n static smoothScrollTo(anchor: string, offset: number = 0) {\r\n if (anchor === \"#top\") {\r\n $(\"html,body\").animate({ scrollTop: 0 }, 300);\r\n\r\n return true;\r\n }\r\n\r\n let $target = $(anchor);\r\n $target = ($target.length && $target) || $(\"[name=\" + anchor.slice(1) + \"]\");\r\n\r\n if ($target.length > 0) {\r\n const targetOffset = $target.offset()?.top ?? 0 - (offset || 15);\r\n $(\"html,body\").animate({ scrollTop: targetOffset }, 800);\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n static startLoad() {\r\n $(\"body\").css(\"cursor\", \"progress\");\r\n $(\"
\")\r\n .hide()\r\n .prependTo(\"body\")\r\n .delay(300)\r\n .fadeIn(200);\r\n }\r\n\r\n static stopLoad() {\r\n $(\"body\").css(\"cursor\", \"default\"); // cursor doesn't revert until mouse is moved - in chrome\r\n $(\".nt-ajaxing-overlay\").remove();\r\n }\r\n\r\n static removeUrlParameter(url: string, parameter: string) {\r\n // prefer to use l.search if you have a location/link object\r\n const urlParts = url.split(\"?\");\r\n\r\n if (urlParts.length >= 2) {\r\n const prefix = encodeURIComponent(parameter) + \"=\";\r\n const parts = urlParts[1].split(/[&;]/g);\r\n\r\n // reverse iteration as may be destructive\r\n for (let i = parts.length; i-- > 0; ) {\r\n // idiom for string.startsWith\r\n if (parts[i].lastIndexOf(prefix, 0) !== -1) {\r\n parts.splice(i, 1);\r\n }\r\n }\r\n\r\n url = urlParts[0] + (parts.length > 0 ? \"?\" + parts.join(\"&\") : \"\");\r\n }\r\n\r\n return url;\r\n }\r\n}\r\n","import $ from \"jquery\";\r\nimport Swiper, {Navigation, Pagination, SwiperOptions} from \"swiper\";\r\n\r\nexport default class CustomSwiper {\r\n static init() {\r\n let bulletSwiperList = document.querySelectorAll(\"[data-nt-swiper='bullet']\");\r\n for (let i = 0; i < bulletSwiperList.length; i++) {\r\n const el = bulletSwiperList[i] as HTMLElement;\r\n const $el = $(el);\r\n\r\n // display just before initializing the component, to prevent non-swiper elements\r\n $el.toggleClass(\"d-none\", false);\r\n \r\n const options: SwiperOptions = {\r\n direction: \"horizontal\",\r\n watchOverflow: true,\r\n pagination: {\r\n el: \".js-bullet-swiper-pagination\",\r\n clickable: true,\r\n },\r\n modules: [Pagination],\r\n };\r\n\r\n CustomSwiper.setSwiperBreakpoints($el, options);\r\n CustomSwiper.setSwiperSlides($el, options);\r\n\r\n new Swiper(el, options);\r\n }\r\n\r\n let imageSwiperList = document.querySelectorAll(\"[data-nt-swiper='image']\");\r\n for (let i = 0; i < imageSwiperList.length; i++) {\r\n const el = imageSwiperList[i] as HTMLElement;\r\n const $el = $(el);\r\n\r\n // display just before initializing the component, to prevent non-swiper elements\r\n $el.toggleClass(\"d-none\", false);\r\n\r\n let imageList: string[] = [];\r\n\r\n $el\r\n .find(\".swiper-slide\")\r\n .find(\"img\")\r\n .each(function () {\r\n imageList.push($(this).prop(\"src\"));\r\n });\r\n \r\n const options: SwiperOptions = {\r\n direction: \"horizontal\",\r\n watchOverflow: true,\r\n pagination: {\r\n el: \".js-image-swiper-pagination\",\r\n clickable: true,\r\n renderBullet: (index, className) => {\r\n return `\"\"`;\r\n },\r\n },\r\n modules: [Pagination],\r\n };\r\n\r\n CustomSwiper.setSwiperBreakpoints($el, options);\r\n CustomSwiper.setSwiperSlides($el, options);\r\n\r\n new Swiper(el, options);\r\n }\r\n\r\n let navSwiperList = document.querySelectorAll(\"[data-nt-swiper='nav']\");\r\n for (let i = 0; i < navSwiperList.length; i++) {\r\n\r\n const el = navSwiperList[i] as HTMLElement;\r\n const $el = $(el);\r\n\r\n // display just before initializing the component, to prevent non-swiper elements\r\n $el.toggleClass(\"d-none\", false);\r\n \r\n const options: SwiperOptions = {\r\n direction: \"horizontal\",\r\n watchOverflow: true,\r\n navigation: {\r\n prevEl: \".js-nav-swiper-button--prev\",\r\n nextEl: \".js-nav-swiper-button--next\",\r\n },\r\n modules: [Navigation],\r\n };\r\n\r\n CustomSwiper.setSwiperBreakpoints($el, options);\r\n CustomSwiper.setSwiperSlides($el, options);\r\n\r\n new Swiper(el, options);\r\n }\r\n }\r\n\r\n private static setSwiperBreakpoints($el: JQuery, options: SwiperOptions): any {\r\n const setBreakpoints = $el.data(\"nt-swiper-breakpoints\");\r\n\r\n if (!setBreakpoints) {\r\n return;\r\n }\r\n\r\n const columns = $el.data(\"nt-swiper-breakpoints-col\") as number;\r\n\r\n if (columns === 4) {\r\n options.breakpoints = {\r\n 0: {\r\n slidesPerView: 1,\r\n spaceBetween: 24,\r\n },\r\n 768: {\r\n slidesPerView: 2,\r\n spaceBetween: 24,\r\n },\r\n 992: {\r\n slidesPerView: 3,\r\n spaceBetween: 24,\r\n },\r\n 1200: {\r\n slidesPerView: 4,\r\n spaceBetween: 24,\r\n },\r\n };\r\n\r\n return;\r\n }\r\n\r\n if (columns === 3) {\r\n options.breakpoints = {\r\n 0: {\r\n slidesPerView: 1,\r\n spaceBetween: 24,\r\n },\r\n 768: {\r\n slidesPerView: 2,\r\n spaceBetween: 24,\r\n },\r\n 992: {\r\n slidesPerView: 3,\r\n spaceBetween: 24,\r\n },\r\n };\r\n\r\n return;\r\n }\r\n\r\n if (columns === 2) {\r\n options.breakpoints = {\r\n 0: {\r\n slidesPerView: 1,\r\n spaceBetween: 24,\r\n },\r\n 768: {\r\n slidesPerView: 2,\r\n spaceBetween: 24,\r\n },\r\n };\r\n\r\n return;\r\n }\r\n\r\n options.breakpoints = {\r\n 0: {\r\n slidesPerView: 1,\r\n spaceBetween: 24,\r\n },\r\n };\r\n }\r\n\r\n private static setSwiperSlides($el: JQuery, options: SwiperOptions): any {\r\n const setSlides = $el.data(\"nt-swiper-slides\");\r\n\r\n if (!setSlides) {\r\n return;\r\n }\r\n \r\n options.slidesPerView = $el.data(\"nt-swiper-slides-col\") as number;\r\n options.spaceBetween = 24;\r\n }\r\n}","import 'toastr';\r\n\r\nexport default class MiniBasket {\r\n static load() {\r\n const q = $.ajax({\r\n type: \"GET\",\r\n url: \"/api/basket/mini\"\r\n });\r\n\r\n q.done((data: number) => {\r\n $(\".js-mini-basket-count\").text(data);\r\n });\r\n\r\n q.fail((xhr, textStatus, errorThrown) => {\r\n // @ts-ignore\r\n toastr[\"error\"](\"Could not load mini basket.\");\r\n });\r\n }\r\n}","type MultilangLabel = {\r\n name: string;\r\n value: string;\r\n};\r\n\r\nexport default class Multilang {\r\n private static LanguageCode: string;\r\n private static Labels: MultilangLabel[] = [];\r\n\r\n static load() {\r\n const multilangElement = document.querySelector(\".js-multilang\") as HTMLInputElement;\r\n\r\n if (multilangElement === null) {\r\n return;\r\n }\r\n\r\n const multilangJson = multilangElement.value;\r\n const multilangObject = JSON.parse(multilangJson);\r\n\r\n this.LanguageCode = multilangObject.languageCode;\r\n this.Labels = multilangObject.labels;\r\n }\r\n\r\n static getLanguageCode() {\r\n return this.LanguageCode;\r\n }\r\n\r\n static getTranslation(labelName: string, defaultValue: string = \"\"): string {\r\n const filteredLabels = this.Labels.filter((l) => l.name === labelName);\r\n if (filteredLabels.length === 0) {\r\n console.warn(`Could not find multilang label '${labelName}', showing the default translation instead.`);\r\n return defaultValue;\r\n }\r\n\r\n return filteredLabels[0].value;\r\n }\r\n}\r\n","import Multilang from \"../utils/multilang\";\r\n\r\nexport default class PwaHelper {\r\n static init() {\r\n Multilang.load();\r\n\r\n const userAgent = window.navigator.userAgent.toLowerCase();\r\n\r\n const isIos = /iphone|ipad|ipod/i.test(userAgent);\r\n const isSamsung = /samsungbrowser/i.test(userAgent);\r\n const isFirefox = /firefox/i.test(userAgent) && (/mobile/i.test(userAgent) || /tablet/i.test(userAgent));\r\n const isPwaHelperDismissalFound = document.cookie.indexOf(\"nt_pwah=1\") !== -1;\r\n const isInStandaloneModeIos = \"standalone\" in window.navigator && window.navigator.standalone;\r\n const isInStandaloneModeChrome = window.matchMedia(\"(display-mode: standalone)\").matches;\r\n\r\n if (isPwaHelperDismissalFound) {\r\n return;\r\n }\r\n\r\n if ((!isIos || isInStandaloneModeIos) && (!isSamsung || isInStandaloneModeChrome) && !isFirefox) {\r\n return;\r\n }\r\n\r\n const helperElement = document.querySelector(\".pwa-helper\") as HTMLElement;\r\n\r\n if (helperElement !== null) {\r\n const helperContentElement = helperElement.querySelector(\".js-pwa-helper-content\") as HTMLElement;\r\n\r\n const iconElement = document.createElement(\"img\");\r\n iconElement.style.width = \"18px\";\r\n iconElement.style.height = \"18px\";\r\n\r\n if (helperContentElement !== null) {\r\n if (isIos) {\r\n iconElement.src = Multilang.getTranslation(\"pwa-helper.browser.safari.icon\", \"/img/ios-share-icon-46x46.png\");\r\n\r\n helperContentElement.innerHTML = Multilang\r\n .getTranslation(\"pwa-helper.browser.safari.message\", \"Om de webshop als app te installeren kan u de optie 'Add to home screen' (__icon__) gebruiken.\")\r\n .replace(\"__icon__\", iconElement.outerHTML);\r\n }\r\n\r\n if (isSamsung) {\r\n iconElement.src = Multilang.getTranslation(\"pwa-helper.browser.samsung.icon\", \"\");\r\n\r\n helperContentElement.innerHTML = Multilang\r\n .getTranslation(\"pwa-helper.browser.samsung.message\", \"Om de webshop als app te installeren kan u de optie 'Add to home screen' gebruiken.\")\r\n .replace(\"__icon__\", iconElement.outerHTML);\r\n }\r\n\r\n if (isFirefox) {\r\n iconElement.src = Multilang.getTranslation(\"pwa-helper.browser.firefox.icon\", \"\");\r\n\r\n helperContentElement.innerHTML = Multilang\r\n .getTranslation(\"pwa-helper.browser.firefox.message\", \"Om de webshop als app te installeren kan u de optie 'Add to home screen' gebruiken.\")\r\n .replace(\"__icon__\", iconElement.outerHTML);\r\n }\r\n\r\n helperElement.style.display = \"block\";\r\n }\r\n\r\n const closeElement = helperElement.querySelector(\".js-pwa-helper-close\");\r\n\r\n if (closeElement !== null) {\r\n closeElement.addEventListener(\"click\", function () {\r\n helperElement.style.display = \"none\";\r\n document.cookie = `nt_pwah=1; expires=${new Date(2050, 0, 1).toUTCString()}; path=/; domain=${window.location.hostname}; SameSite=lax; Secure`;\r\n });\r\n }\r\n }\r\n }\r\n}\r\n","declare var dataLayer: any[];\r\n\r\nexport default class DataLayerHelper {\r\n static trackCustomEvent(eventName: string, eventParam: string | null = null, callback: Function | null = null) {\r\n eventName = eventName.toLowerCase();\r\n\r\n if (!eventName.startsWith(\"pgb_\")) {\r\n eventName = `pgb_${eventName}`;\r\n }\r\n\r\n if (!dataLayer) {\r\n callback && callback();\r\n return;\r\n }\r\n\r\n console.debug(\"Pushing event to data layer\", eventName)\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n dataLayer.push({\r\n event: eventName,\r\n eventParameter: eventParam,\r\n eventCallback: function () {\r\n callback && callback();\r\n },\r\n eventTimeout: 2000\r\n });\r\n\r\n return;\r\n }\r\n}\r\n","import mitt from \"mitt\"; // Import mitt\r\n\r\nconst emitter = mitt(); // Initialize mitt\r\n\r\ntype Event = \"basket-totals-update\" | \"mobile-product-filter-activate\" | \"quick-scan-update\" | \"quick-scan-toggle-scanner\";\r\n\r\nclass EventBus {\r\n constructor() {\r\n\r\n }\r\n\r\n public emit(event: Event, eventData?: any) {\r\n emitter.emit(event, eventData);\r\n }\r\n\r\n public on(eventName: Event, eventHandler: (data: any) => void) {\r\n emitter.on(eventName, eventHandler);\r\n }\r\n\r\n public off(eventName: Event, eventHandler: (data: any) => void) {\r\n emitter.off(eventName, eventHandler);\r\n }\r\n}\r\n\r\n// singleton it:\r\nconst eventBus = new EventBus();\r\nexport default eventBus;\r\n","import { QuickScanProductModel, QuickScanUpdateModel } from \"../models/quick-scan\";\r\nimport DataLayerHelper from \"../helpers/data-layer-helper\";\r\nimport eventBus from \"../utils/event-bus\";\r\nimport Multilang from \"../utils/multilang\";\r\n\r\nexport default class QuickScan {\r\n static productList: QuickScanProductModel[] = [];\r\n static barcodePicker: any = null;\r\n\r\n static init() {\r\n const quickScanPage = document.querySelector(\"#quick-scan-page\") as HTMLElement | null;\r\n\r\n if (!quickScanPage) {\r\n return;\r\n }\r\n\r\n QuickScan.initProductList();\r\n QuickScan.initScannerComponent();\r\n QuickScan.initManualComponent();\r\n\r\n DataLayerHelper.trackCustomEvent(\"quick_scan_open\");\r\n }\r\n\r\n static initProductList() {\r\n const hiddenEl = document.querySelector(\"#quick-scan-product-list\") as HTMLInputElement | null;\r\n\r\n if (!hiddenEl) {\r\n return;\r\n }\r\n\r\n QuickScan.productList = JSON.parse(hiddenEl.value) as QuickScanProductModel[];\r\n }\r\n\r\n static initScannerComponent() {\r\n const modalEl = document.querySelector(\"#quick-scan-scanner-modal\") as HTMLElement | null;\r\n const modalContentEl = document.querySelector(\"#quick-scan-scanner-modal-content\") as HTMLElement | null;\r\n const barcodePickerElement = document.querySelector(\"#quick-scan-barcode-picker\") as HTMLElement | null;\r\n\r\n if (!modalEl || !modalContentEl || !barcodePickerElement) {\r\n return;\r\n }\r\n\r\n const scanditLicenseKey = barcodePickerElement.dataset.ntLicenseKey as string;\r\n const errorMessagePermission = Multilang.getTranslation(\"scanner.message.error.permission\", \"U dient de browser toegang te geven tot de camera om de scanfunctie te gebruiken.\");\r\n const errorMessageOther = Multilang.getTranslation(\"scanner.message.error.other\", \"Er is een fout opgetreden.\");\r\n\r\n try {\r\n // https://docs.scandit.com/stable/web/\r\n // https://websdk.scandit.com/\r\n\r\n // @ts-ignore\r\n if (typeof ScanditSDK === \"undefined\") {\r\n return;\r\n }\r\n\r\n let searchArea = { x: 0.2, y: 0.45, width: 0.6, height: 0.1 };\r\n\r\n if (/CriOS/i.test(navigator.userAgent) && /iphone|ipod|ipad/i.test(navigator.userAgent)) {\r\n // set search area to full for Chrome on iOS\r\n searchArea = { x: 0.0, y: 0.0, width: 1.0, height: 1.0 };\r\n }\r\n\r\n // @ts-ignore\r\n const scanSettings = new ScanditSDK.ScanSettings({\r\n enabledSymbologies: [\"ean8\", \"ean13\", \"upca\", \"upce\", \"code128\", \"code39\", \"code93\", \"itf\"],\r\n codeDuplicateFilter: 1000, // minimum delay between duplicate results\r\n searchArea: searchArea\r\n });\r\n\r\n // @ts-ignore\r\n ScanditSDK.configure(scanditLicenseKey, {\r\n engineLocation: \"https://cdn.jsdelivr.net/npm/scandit-sdk/build\" // TODO: trial by using ..\\node_modules\\scandit-sdk\\build\r\n }).then(() => {\r\n // @ts-ignore\r\n ScanditSDK.BarcodePicker.create(barcodePickerElement, {\r\n playSoundOnScan: true,\r\n vibrateOnScan: true\r\n }).then((barcodePicker) => {\r\n // barcodePicker is ready here to be used\r\n QuickScan.barcodePicker = barcodePicker;\r\n\r\n barcodePicker.applyScanSettings(scanSettings);\r\n\r\n // NOTE: not needed by demand on 2024-01-18 by Cedric Nolf\r\n // initial pause as it will be activated by a toggle\r\n ////barcodePicker.pauseScanning(); // TODO: remove toggleScannerModal from QuickScanList.onMounted hook when pausing\r\n\r\n barcodePicker.on(\"scan\", (scanResult) => {\r\n barcodePicker.pauseScanning();\r\n\r\n const barcode = scanResult.barcodes.reduce((string, barcode) => {\r\n return string + barcode.data;\r\n }, \"\");\r\n\r\n const updateModel = QuickScan.getUpdateModelFromProductList(barcode);\r\n QuickScan.showFeedback(modalContentEl, updateModel !== null);\r\n\r\n if (updateModel === null) {\r\n console.warn(`Could not find product with ${barcode}`);\r\n DataLayerHelper.trackCustomEvent(\"quick_scan_scan_failed\");\r\n barcodePicker.resumeScanning();\r\n\r\n return;\r\n }\r\n\r\n eventBus.emit(\"quick-scan-update\", updateModel);\r\n DataLayerHelper.trackCustomEvent(\"quick_scan_scan_succeeded\");\r\n barcodePicker.resumeScanning();\r\n });\r\n }).catch((error) => {\r\n if (String(error).includes(\"Permission\") || String(error).includes(\"NotAllowedError\")) {\r\n toastr.error(errorMessagePermission);\r\n }\r\n else {\r\n toastr.error(`${errorMessageOther} (${error})`);\r\n }\r\n\r\n console.error(error);\r\n });\r\n }).catch((error) => {\r\n toastr.error(`${errorMessageOther} (${error})`);\r\n console.error(error);\r\n });\r\n } catch (error) {\r\n toastr.error(`${errorMessageOther} (${error})`);\r\n console.error(error);\r\n }\r\n\r\n eventBus.on(\"quick-scan-toggle-scanner\", (activate: boolean) => {\r\n console.log(\"handling quick-scan-toggle-scanner\", activate);\r\n\r\n if (QuickScan.barcodePicker === null) {\r\n console.warn(\"Could not find barcode picker instance.\");\r\n return;\r\n }\r\n\r\n if (activate) {\r\n QuickScan.barcodePicker.resumeScanning();\r\n }\r\n else {\r\n QuickScan.barcodePicker.pauseScanning();\r\n }\r\n });\r\n }\r\n\r\n static initManualComponent() {\r\n // 5410439114332 -- 500 as ioq\r\n // 5410439120982 -- regular product\r\n // 5410439147231 -- 200 as ioq\r\n // 5902134244266 -- \"no price\" warning for customer \"De Stalen Greep\"\r\n // 5902134709628 -- ST as UOM without EAN, BOX as UOM with EAN\r\n\r\n const modalEl = document.querySelector(\"#quick-scan-manual-modal\") as HTMLElement | null;\r\n const modalContentEl = document.querySelector(\"#quick-scan-manual-modal-content\") as HTMLElement | null;\r\n const inputEl = document.querySelector(\"#quick-scan-manual-input\") as HTMLInputElement | null;\r\n const btnEl = document.querySelector(\"#quick-scan-manual-add-to-list\") as HTMLButtonElement | null;\r\n\r\n if (!modalEl || !modalContentEl || !inputEl || !btnEl) {\r\n return;\r\n }\r\n\r\n btnEl.addEventListener(\"click\", () => {\r\n const updateModel = QuickScan.getUpdateModelFromProductList(inputEl.value);\r\n QuickScan.showFeedback(modalContentEl, updateModel !== null);\r\n\r\n if (updateModel === null) {\r\n console.warn(`Could not find product with ${inputEl.value}`);\r\n DataLayerHelper.trackCustomEvent(\"quick_scan_manual_failed\");\r\n\r\n return;\r\n }\r\n\r\n eventBus.emit(\"quick-scan-update\", updateModel);\r\n DataLayerHelper.trackCustomEvent(\"quick_scan_manual_succeeded\");\r\n inputEl.value = \"\";\r\n });\r\n }\r\n\r\n static showFeedback(modalContentEl: HTMLElement, isSuccess: boolean) {\r\n if (!modalContentEl) {\r\n return;\r\n }\r\n\r\n // clear feedback color\r\n modalContentEl.classList.remove(\"alert-success\");\r\n\r\n // show feedback\r\n if (isSuccess) {\r\n modalContentEl.classList.add(\"alert-success\");\r\n }\r\n else {\r\n toastr.warning(Multilang.getTranslation(\"quick-scan.message.warning.product-not-found\", \"Product kon niet gevonden worden.\"));\r\n }\r\n\r\n // clear feedback color after certain period (notification will disappear by default)\r\n setTimeout(() => {\r\n modalContentEl.classList.remove(\"alert-success\");\r\n }, 1000);\r\n }\r\n\r\n static getUpdateModelFromProductList(ean: string): QuickScanUpdateModel | null {\r\n const productItem = QuickScan.productList.find(p => p.ean === ean);\r\n\r\n if (productItem === undefined) {\r\n return null;\r\n }\r\n\r\n return {\r\n id: productItem!.id,\r\n pgbProductNumber: productItem!.pgbProductNumber,\r\n customerProductNumber: productItem!.customerProductNumber,\r\n unitOfMeasureValue: productItem!.unitOfMeasureValue,\r\n minimumOrderQuantity: productItem!.minimumOrderQuantity,\r\n incrementalOrderQuantity: productItem!.incrementalOrderQuantity,\r\n ean: productItem!.ean,\r\n name: productItem!.name\r\n };\r\n }\r\n}\r\n","import DataLayerHelper from \"../helpers/data-layer-helper\";\r\nimport Multilang from \"../utils/multilang\";\r\n\r\nexport default class SearchScan {\r\n static init() {\r\n const searchScanPage = document.querySelector(\"#search-scan-page\") as HTMLElement | null;\r\n\r\n if (!searchScanPage) {\r\n return;\r\n }\r\n\r\n const barcodePickerElement = document.querySelector(\"#search-scan-barcode-picker\") as HTMLElement | null;\r\n\r\n if (!barcodePickerElement) {\r\n return;\r\n }\r\n\r\n const scanditLicenseKey = barcodePickerElement.dataset.ntLicenseKey as string;\r\n const searchProductUrl = barcodePickerElement.dataset.ntSearchProductUrl as string;\r\n const errorMessagePermission = Multilang.getTranslation(\"scanner.message.error.permission\", \"U dient de browser toegang te geven tot de camera om de scanfunctie te gebruiken.\");\r\n const errorMessageOther = Multilang.getTranslation(\"scanner.message.error.other\", \"Er is een fout opgetreden.\");\r\n\r\n try {\r\n // https://docs.scandit.com/stable/web/\r\n // https://websdk.scandit.com/\r\n\r\n // @ts-ignore\r\n if (typeof ScanditSDK === \"undefined\") {\r\n return;\r\n }\r\n\r\n let searchArea = { x: 0.2, y: 0.45, width: 0.6, height: 0.1 };\r\n\r\n if (/CriOS/i.test(navigator.userAgent) && /iphone|ipod|ipad/i.test(navigator.userAgent)) {\r\n // set search area to full for Chrome on iOS\r\n searchArea = { x: 0.0, y: 0.0, width: 1.0, height: 1.0 };\r\n }\r\n\r\n // @ts-ignore\r\n const scanSettings = new ScanditSDK.ScanSettings({\r\n enabledSymbologies: [\"ean8\", \"ean13\", \"upca\", \"upce\", \"code128\", \"code39\", \"code93\", \"itf\"],\r\n codeDuplicateFilter: 1000,\r\n searchArea: searchArea\r\n });\r\n\r\n // @ts-ignore\r\n ScanditSDK.configure(scanditLicenseKey, {\r\n engineLocation: \"https://cdn.jsdelivr.net/npm/scandit-sdk/build\"\r\n }).then(() => {\r\n // @ts-ignore\r\n ScanditSDK.BarcodePicker.create(barcodePickerElement, {\r\n playSoundOnScan: true,\r\n vibrateOnScan: true\r\n }).then((barcodePicker) => {\r\n // barcodePicker is ready here to be used\r\n barcodePicker.applyScanSettings(scanSettings);\r\n barcodePicker.resumeScanning();\r\n\r\n barcodePicker.on(\"scan\", (scanResult) => {\r\n barcodePicker.pauseScanning();\r\n\r\n const barcode = scanResult.barcodes.reduce((string, barcode) => {\r\n return string + barcode.data;\r\n }, \"\");\r\n\r\n window.location.href = `${searchProductUrl}?searchTerm=${encodeURI(barcode)}&source=scanner`;\r\n });\r\n\r\n DataLayerHelper.trackCustomEvent(\"search_scan_open_scanner\")\r\n }).catch((error) => {\r\n if (String(error).includes(\"Permission\") || String(error).includes(\"NotAllowedError\")) {\r\n toastr.error(errorMessagePermission);\r\n }\r\n else {\r\n toastr.error(`${errorMessageOther} (${error})`);\r\n }\r\n\r\n console.error(error);\r\n });\r\n }).catch((error) => {\r\n toastr.error(`${errorMessageOther} (${error})`);\r\n console.error(error);\r\n });\r\n } catch (error) {\r\n toastr.error(`${errorMessageOther} (${error})`);\r\n console.error(error);\r\n }\r\n }\r\n}\r\n","import { Dropdown } from \"bootstrap\";\r\nimport $ from \"jquery\";\r\nimport debounce from \"lodash-es/debounce\";\r\nimport take from \"lodash-es/take\";\r\n\r\nexport interface AutocompleteItem {\r\n value: string;\r\n label: string;\r\n}\r\n\r\nfunction createItems(self: Autocomplete) {\r\n const lookup = self.$element.val() as string;\r\n if (lookup.length < self.threshold()) {\r\n self.dropdown.hide();\r\n return Promise.resolve(0);\r\n }\r\n\r\n if (!!self.cachedResult && !!self.cachedResult[lookup]) {\r\n const items = self.cachedResult[lookup];\r\n const $listItems = self.$element.next();\r\n $listItems.html(\"\");\r\n take(items, self.maximumItems()).forEach((item) => {\r\n $listItems.append(self.createItem(lookup, item, self.options));\r\n });\r\n\r\n // option action\r\n const that = self;\r\n self.$element\r\n .next()\r\n .find(\".dropdown-item\")\r\n .on(\"click\", function () {\r\n that.$element.val($(this).text());\r\n if (that.options.onSelectItem) {\r\n that.options.onSelectItem(\r\n {\r\n value: $(this).data(\"value\"),\r\n label: $(this).text(),\r\n },\r\n that.element\r\n );\r\n }\r\n });\r\n\r\n return Promise.resolve(items.length);\r\n }\r\n\r\n const items: AutocompleteItem[] = [];\r\n\r\n const source = self.source();\r\n source.then((data) => {\r\n if (!data) {\r\n self.cachedResult = {};\r\n self.cachedResult[lookup] = [];\r\n return 0;\r\n }\r\n\r\n const keys = Object.keys(data);\r\n for (let i = 0; i < keys.length; i++) {\r\n const key = keys[i];\r\n const object = data[key];\r\n const item = {\r\n label: self.options.label ? object[self.options.label] : key,\r\n value: self.options.value ? object[self.options.value] : object,\r\n };\r\n if (item.label.toLowerCase().indexOf(lookup.toLowerCase()) >= 0) {\r\n items.push(item);\r\n }\r\n }\r\n\r\n const $listItems = self.$element.next();\r\n $listItems.html(\"\");\r\n take(items, self.maximumItems()).forEach((item) => {\r\n $listItems.append(self.createItem(lookup, item, self.options));\r\n });\r\n\r\n // option action\r\n const that = self;\r\n self.$element\r\n .next()\r\n .find(\".dropdown-item\")\r\n .on(\"click\", function () {\r\n that.$element.val($(this).text());\r\n if (that.options.onSelectItem) {\r\n that.options.onSelectItem(\r\n {\r\n value: $(this).data(\"value\"),\r\n label: $(this).text(),\r\n },\r\n that.element\r\n );\r\n }\r\n });\r\n\r\n self.cachedResult = {};\r\n self.cachedResult[lookup] = items;\r\n\r\n $(\".js-bs-autocomplete\").toggleClass(\"visually-hidden\", items.length === 0);\r\n\r\n return items.length;\r\n });\r\n\r\n return source;\r\n}\r\n\r\nexport interface AutocompleteOptions {\r\n dropdownOptions?: Dropdown.Options;\r\n dropdownClass?: string | string[];\r\n highlightClass?: string | string[];\r\n highlightTyped?: boolean;\r\n label?: string;\r\n maximumItems?: number;\r\n onSelectItem?: (item: AutocompleteItem, element: Element) => void;\r\n source: () => Promise;\r\n treshold?: number;\r\n value?: string;\r\n}\r\n\r\nfunction handleClick(self: Autocomplete) {\r\n createItems(self)?.then((createdItems) => {\r\n console.log(\"debounce click\", createdItems);\r\n if (createdItems == 0) {\r\n // prevent show empty\r\n self.dropdown.hide();\r\n } else {\r\n self.dropdown.show();\r\n }\r\n });\r\n}\r\n\r\nfunction handleKeyUp(self: Autocomplete) {\r\n createItems(self)?.then((createdItems) => {\r\n console.log(\"debounce keyup\", createdItems);\r\n if (createdItems > 0) {\r\n self.dropdown.show();\r\n } else {\r\n // sets up positioning\r\n self.$element.trigger(\"click\");\r\n }\r\n });\r\n}\r\n\r\nexport default class Autocomplete {\r\n defaults: AutocompleteOptions = {\r\n treshold: 4,\r\n maximumItems: 5,\r\n highlightTyped: true,\r\n highlightClass: \"text-primary\",\r\n source: () => {\r\n return Promise.resolve();\r\n },\r\n };\r\n\r\n element: Element;\r\n $element: JQuery;\r\n options: AutocompleteOptions;\r\n dropdown: Dropdown;\r\n cachedResult: { [query: string]: AutocompleteItem[] };\r\n\r\n constructor(element: Element, options?: AutocompleteOptions) {\r\n this.element = element;\r\n this.options = !!options ? { ...this.defaults, ...options } : this.defaults;\r\n\r\n this.$element = $(this.element);\r\n\r\n this.cachedResult = {};\r\n\r\n // clear previously set autocomplete\r\n this.$element.parent().removeClass(\"dropdown\");\r\n this.$element.removeAttr(\"data-toggle\");\r\n this.$element.removeClass(\"dropdown-toggle\");\r\n this.$element.parent().find(\".dropdown-menu\").remove();\r\n\r\n // const toDispose = new Dropdown(this.element);\r\n // toDispose.dispose();\r\n\r\n // attach dropdown\r\n this.$element.parent().addClass(\"dropdown\");\r\n this.$element.attr(\"data-bs-toggle\", \"dropdown\");\r\n this.$element.addClass(\"dropdown-toggle\");\r\n const $dropdown = $('
    ');\r\n\r\n // attach dropdown class\r\n if (this.options.dropdownClass) $dropdown.addClass(this.options.dropdownClass);\r\n this.$element.after($dropdown);\r\n\r\n this.dropdown = new Dropdown(this.element, this.options.dropdownOptions);\r\n const self = this;\r\n\r\n const debouncedClickHandler = debounce(handleClick, 300);\r\n const debouncedCKeyUpHandler = debounce(handleKeyUp, 300);\r\n\r\n this.$element.off(\"click\").on(\"click\", function (e) {\r\n e.stopPropagation();\r\n debouncedClickHandler(self);\r\n });\r\n\r\n // show options\r\n this.$element.off(\"keyup\").on(\"keyup\", function () {\r\n debouncedCKeyUpHandler(self);\r\n });\r\n }\r\n\r\n public threshold() {\r\n return this.options.treshold ?? 4;\r\n }\r\n\r\n public source() {\r\n return this.options.source() ?? {};\r\n }\r\n\r\n public maximumItems() {\r\n return this.options.maximumItems ?? 5;\r\n }\r\n\r\n public createItem(lookup: string, item: AutocompleteItem, opts: AutocompleteOptions): string {\r\n let label: string;\r\n\r\n if (opts.highlightTyped) {\r\n const idx = item.label.toLowerCase().indexOf(lookup.toLowerCase());\r\n label =\r\n item.label.substring(0, idx) +\r\n '' +\r\n item.label.substring(idx, idx + lookup.length) +\r\n \"\" +\r\n item.label.substring(idx + lookup.length, item.label.length);\r\n } else {\r\n label = item.label;\r\n }\r\n\r\n return (\r\n '
  • \"\r\n );\r\n }\r\n\r\n private expandClassArray(classes?: string | string[]): string | undefined {\r\n if (typeof classes === \"undefined\") {\r\n return undefined;\r\n }\r\n\r\n if (typeof classes == \"string\") {\r\n return classes;\r\n }\r\n\r\n if (classes.length == 0) {\r\n return \"\";\r\n }\r\n\r\n let ret = \"\";\r\n for (const clas of classes) {\r\n ret += clas + \" \";\r\n }\r\n\r\n return ret.substring(0, ret.length - 1);\r\n }\r\n}\r\n","import $ from \"jquery\";\r\nimport axios from \"axios\";\r\nimport 'toastr';\r\nimport Autocomplete, { AutocompleteOptions, AutocompleteItem } from \"./bs5-autocomplete\";\r\n\r\nexport default class SearchSuggestions {\r\n autocomplete: Autocomplete;\r\n $searchTerm: JQuery;\r\n\r\n constructor(element: Element) {\r\n this.$searchTerm = $(element);\r\n\r\n let options: AutocompleteOptions = {\r\n source: () => {\r\n return this.getSuggestions();\r\n },\r\n onSelectItem: (item: AutocompleteItem, element: any) => {\r\n this.$searchTerm.val(item.value);\r\n \r\n const $form = this.$searchTerm.closest(\"form\");\r\n $form.trigger(\"submit\");\r\n },\r\n highlightClass: \"text-success\",\r\n treshold: 0,\r\n maximumItems: 10,\r\n };\r\n\r\n this.autocomplete = new Autocomplete(element, options);\r\n }\r\n\r\n private async getSuggestions() {\r\n const input = this.$searchTerm.val() as string;\r\n\r\n if (input === \"\" || input.length < 3) {\r\n return Promise.resolve();\r\n }\r\n\r\n try {\r\n const response = await axios.get(`/api/search/suggestions?searchTerm=${input}`);\r\n const responseData = response.data as string[];\r\n\r\n let suggestionsDictionary: { [key: string]: string } = {};\r\n responseData.forEach((el) => (suggestionsDictionary[el] = el));\r\n\r\n return suggestionsDictionary;\r\n } catch (error) {\r\n toastr[\"error\"](\"Could not get search suggestions.\");\r\n console.error(error);\r\n }\r\n }\r\n}\r\n","export default class Account {\r\n static init() {\r\n const accountPage = document.querySelector(\"#account-page\") as HTMLElement | null;\r\n\r\n if (!accountPage) {\r\n return;\r\n }\r\n\r\n Account.initTabs();\r\n }\r\n\r\n static initTabs() {\r\n const tabList = document.querySelectorAll(\"button[data-bs-toggle=tab]\") as NodeListOf | null;\r\n\r\n if (!tabList) {\r\n return;\r\n }\r\n\r\n tabList.forEach((tabEl: HTMLButtonElement) => {\r\n tabEl.addEventListener(\"shown.bs.tab\", (e: any) => {\r\n const tabTarget: string | null = e.target?.dataset.bsTarget;\r\n\r\n if (!tabTarget) {\r\n return;\r\n }\r\n\r\n const url: URL = new URL(window.location.href);\r\n url.searchParams.set(\"activeTab\", tabTarget.replace(\"#\", \"\"));\r\n\r\n history.pushState({}, \"\", url);\r\n })\r\n });\r\n }\r\n}\r\n","import $ from \"jquery\";\r\nimport { unescape } from \"lodash-es\";\r\nimport DataLayerHelper from \"../helpers/data-layer-helper\";\r\n\r\nexport default class Software {\r\n static init() {\r\n this.initRequestModal();\r\n this.initRequestForm();\r\n }\r\n\r\n private static initRequestModal() {\r\n const modalSoftwareRequest = document.querySelector(\"#modal-software-request\") as HTMLElement | null;\r\n\r\n if (!modalSoftwareRequest) {\r\n return;\r\n }\r\n\r\n modalSoftwareRequest.addEventListener(\"show.bs.modal\", (e: any) => {\r\n const softwareName: string = e.relatedTarget.dataset.ntSoftwareName;\r\n const softwareText: string = e.relatedTarget.dataset.ntSoftwareText;\r\n\r\n DataLayerHelper.trackCustomEvent(\"software_request\", softwareName);\r\n\r\n $(\"#form-software\").find(\"[name='SoftwareName']\").val(softwareName);\r\n $(\"#modal-software-request-text\").html(unescape(softwareText));\r\n });\r\n }\r\n\r\n private static initRequestForm() {\r\n $(\"#form-software\").on(\"change\", \".js-software-usertype\", function() {\r\n const $this = $(this);\r\n const $form = $this.closest(\"form\");\r\n\r\n const $sector = $form.find(\".js-software-sector\");\r\n $sector.removeClass(\"d-none\");\r\n\r\n const $sectorSelect = $sector.find(\"select\");\r\n $sectorSelect.addClass(\"d-none\");\r\n $sectorSelect.prop(\"disabled\", true);\r\n\r\n const $target = $form.find($this.data(\"target\"));\r\n $target.removeClass(\"d-none\");\r\n $target.prop(\"disabled\", false);\r\n });\r\n }\r\n}\r\n","import { Modal } from \"bootstrap\";\r\nimport $ from \"jquery\";\r\n\r\nexport default class MessageDialog {\r\n public static createInstance(identifier: string, message: string) : Modal {\r\n const messageDialogIdentifier = `#${identifier}`;\r\n const messageDialogText = $(messageDialogIdentifier).find(\"#nt-message-dialog-text\");\r\n messageDialogText.html(message);\r\n \r\n const messageDialogElement = document.getElementById(identifier) as HTMLElement;\r\n return new Modal(messageDialogElement);\r\n }\r\n \r\n public static getElement(identifier: string) : HTMLElement {\r\n return document.getElementById(identifier) as HTMLElement;\r\n }\r\n}","import 'toastr';\r\nimport $ from \"jquery\";\r\nimport axios, { AxiosError, AxiosResponse } from \"axios\";\r\nimport ProductHelper from \"../helpers/product-helper\";\r\nimport MiniBasket from \"../components/mini-basket\";\r\nimport MessageDialog from \"../components/bs5-message-dialog\";\r\nimport NatchGtm, { EventNamesSchema, NatchOsDataLayerProduct } from \"natch-gtm4\";\r\nimport eventBus from \"../utils/event-bus\";\r\nimport { BasketTotalsUpdateModel } from \"../models/basket-totals\";\r\n\r\nexport default class BasketStep1 {\r\n private static totalNet: number;\r\n private static totalNetAvailable: number;\r\n\r\n static init() {\r\n // @ts-ignore\r\n if (typeof (basketLoadData) === \"undefined\") {\r\n return;\r\n }\r\n\r\n BasketStep1.initDropdown();\r\n BasketStep1.initSaveTemplate();\r\n BasketStep1.initChangeProduct();\r\n BasketStep1.initDeleteProduct();\r\n BasketStep1.initDeleteBasket();\r\n BasketStep1.initFormSubmit();\r\n\r\n // @ts-ignore\r\n if (basketLoadData.isTemplate === 0) {\r\n // @ts-ignore\r\n if (basketLoadData.validateStockData) {\r\n BasketStep1.checkStockData(); // when stock must be validated, the calculation of the price data will be executed in the callback\r\n } else {\r\n BasketStep1.calculatePriceData();\r\n }\r\n }\r\n }\r\n\r\n static initDropdown() {\r\n $(\".js-dropdown-options li a\").on(\"click\", (e) => {\r\n e.preventDefault();\r\n\r\n const $option = $(e.currentTarget);\r\n\r\n $option\r\n .closest(\".js-dropdown-container\")\r\n .find(\".js-dropdown-name\")\r\n .text($option.data(\"name\"));\r\n\r\n $option\r\n .closest(\".js-dropdown-container\")\r\n .parent()\r\n .find(\".js-dropdown-value\")\r\n .attr(\"href\", $option.data(\"value\"));\r\n });\r\n }\r\n\r\n static initSaveTemplate() {\r\n $(\"#save-template\").on(\"click\", (e) => {\r\n const action = (name: string, reference: string) => {\r\n const postData = {\r\n name: name,\r\n reference: reference\r\n };\r\n\r\n axios\r\n .post(\"/api/basket/save-template\", postData)\r\n .then((response: AxiosResponse) => response.data)\r\n .then(data => {\r\n // @ts-ignore\r\n toastr.success(basketLoadData.saveTemplateMsg);\r\n })\r\n .catch((error: AxiosError) => {\r\n console.log(error);\r\n\r\n if (error.response?.data) {\r\n toastr.warning(error.response?.data);\r\n } else {\r\n // @ts-ignore\r\n toastr.error(basketLoadData.saveTemplateErrorMsg);\r\n }\r\n });\r\n };\r\n\r\n BasketStep1.callSaveTemplateModal(action, \"\", \"\");\r\n });\r\n }\r\n\r\n static initChangeProduct() {\r\n const isProductPage = 0;\r\n const isOnlyChange = 0;\r\n const isAddToBasket = 0;\r\n\r\n // @ts-ignore\r\n const $container = basketLoadData.isTemplate === 1 ? $(\"#template-list\") : $(\"#form-basket-step-1\");\r\n\r\n $container.off(\"change\", \"[name=quantity]\");\r\n $container.on(\"change\", \"[name=quantity]\", (e) => {\r\n let $item = $(e.currentTarget).closest(\"tr\");\r\n\r\n const isMobile = $(\".js-product-grid\").is(\":visible\");\r\n if (isMobile) {\r\n $item = $(e.currentTarget).closest(\".js-product-grid-item\");\r\n }\r\n\r\n ProductHelper.updateQuantityAndPrice(\r\n e,\r\n $item,\r\n isProductPage,\r\n isOnlyChange,\r\n // @ts-ignore\r\n basketLoadData.isTemplate,\r\n 0,\r\n isAddToBasket\r\n );\r\n\r\n ProductHelper.updateDiscountDisplay($item);\r\n });\r\n\r\n $container.off(\"change\", \"[name=orderunitid]\");\r\n $container.on(\"change\", \"[name=orderunitid]\", (e) => {\r\n let $item = $(e.currentTarget).closest(\"tr\");\r\n\r\n const eanCode = $(e.currentTarget).find(\"option:selected\").data(\"ean\");\r\n $item.find(\"span.js-product-ean\").text(eanCode);\r\n $item.find(\"input.js-product-ean\").val(eanCode);\r\n\r\n const isMobile = $(\".js-product-grid\").is(\":visible\");\r\n if (isMobile) {\r\n $item = $(e.currentTarget).closest(\".js-product-grid-item\");\r\n }\r\n\r\n ProductHelper.updateQuantityAndPrice(\r\n e,\r\n $item,\r\n isProductPage,\r\n isOnlyChange,\r\n // @ts-ignore\r\n basketLoadData.isTemplate,\r\n 1,\r\n isAddToBasket\r\n );\r\n\r\n ProductHelper.updateDiscountDisplay($item);\r\n });\r\n\r\n $container.off(\"keydown\", \"[name=quantity], [name=orderunitid]\");\r\n $container.on(\"keydown\", \"[name=quantity], [name=orderunitid]\", (e) => {\r\n if (e.keyCode === 13) {\r\n e.currentTarget.blur();\r\n }\r\n });\r\n }\r\n\r\n static initDeleteProduct() {\r\n // @ts-ignore\r\n const $container = basketLoadData.isTemplate === 1 ? $(\"#template-list\") : $(\"#form-basket-step-1\");\r\n\r\n $container.off(\"click\", \".js-delete-basketline\");\r\n $container.on(\"click\", \".js-delete-basketline\", (e) => {\r\n e.preventDefault();\r\n\r\n const $deleteLink = $(e.currentTarget);\r\n\r\n // @ts-ignore\r\n bootbox.confirm({\r\n // @ts-ignore\r\n message: basketLoadData.messageDeleteProduct,\r\n buttons: {\r\n confirm: {\r\n // @ts-ignore\r\n label: basketLoadData.messageDeleteProductOk\r\n },\r\n cancel: {\r\n // @ts-ignore\r\n label: basketLoadData.messageDeleteProductCancel\r\n }\r\n },\r\n callback: (result: boolean) => {\r\n if (result) {\r\n const action = $deleteLink.attr(\"href\") as string;\r\n const basketId = $deleteLink.data(\"basketid\");\r\n const basketLineId = $deleteLink.data(\"basketlineid\");\r\n const productNumber = $deleteLink.data(\"productno\");\r\n\r\n const jsonString = $deleteLink.parents(\"[data-datalayer-cartitem]\").attr(\"data-datalayer-cartitem\");\r\n const productDataLayerFields = jsonString ? JSON.parse(jsonString) : null;\r\n\r\n BasketStep1.postDeleteProduct(\r\n action,\r\n basketId,\r\n basketLineId,\r\n productNumber,\r\n productDataLayerFields\r\n );\r\n }\r\n }\r\n });\r\n });\r\n }\r\n\r\n static initDeleteBasket() {\r\n const $form = $(\"#form-basket-step-1\");\r\n\r\n $form.off(\"click\", \".js-delete-basket\");\r\n $form.on(\"click\", \".js-delete-basket\", (e) => {\r\n e.preventDefault();\r\n\r\n const $deleteLink = $(e.currentTarget);\r\n\r\n // @ts-ignore\r\n bootbox.confirm({\r\n // @ts-ignore\r\n message: basketLoadData.messageDeleteBasket,\r\n buttons: {\r\n confirm: {\r\n // @ts-ignore\r\n label: basketLoadData.messageDeleteBasketOk\r\n },\r\n cancel: {\r\n // @ts-ignore\r\n label: basketLoadData.messageDeleteBasketCancel\r\n }\r\n },\r\n callback: (result: boolean) => {\r\n if (result) {\r\n const basketId = $deleteLink.data(\"basketid\");\r\n BasketStep1.postDeleteBasket(basketId);\r\n }\r\n }\r\n });\r\n });\r\n }\r\n\r\n static initFormSubmit() {\r\n $(\"#form-basket-step-1\").on(\"click\", \"[type=submit]\", (e) => {\r\n e.preventDefault();\r\n\r\n const $form = $(e.currentTarget).closest(\"form\");\r\n\r\n // @ts-ignore\r\n if (basketLoadData.validateEmptyStockData) {\r\n BasketStep1.checkEmptyStockData($form);\r\n } else {\r\n $form.trigger(\"submit\");\r\n }\r\n });\r\n }\r\n\r\n static callSaveTemplateModal(action: any, name: string, reference: string) {\r\n const form = $(\"
    \");\r\n\r\n const divName = $(\"
    \");\r\n // @ts-ignore\r\n divName.append(\"\");\r\n // @ts-ignore\r\n divName.append(\"\");\r\n form.append(divName);\r\n\r\n const divReference = $(\"
    \");\r\n // @ts-ignore\r\n divReference.append(\"\");\r\n // @ts-ignore\r\n divReference.append(\"\");\r\n form.append(divReference);\r\n\r\n // @ts-ignore\r\n bootbox.dialog({\r\n message: form,\r\n // @ts-ignore\r\n title: basketLoadData.templateBootboxTitle,\r\n buttons: {\r\n cancel: {\r\n label: \"Cancel\"\r\n },\r\n ok: {\r\n label: \"OK\",\r\n className: \"btn-primary\",\r\n callback: function() {\r\n const name = form.find(\"#template-name\").val();\r\n const reference = form.find(\"#template-reference\").val();\r\n\r\n if (name === null && reference === null) {\r\n console.log(\"Empty name and reference\");\r\n } else {\r\n action(name, reference);\r\n return;\r\n }\r\n }\r\n }\r\n }\r\n });\r\n }\r\n\r\n static postDeleteBasket(basketId: number) {\r\n const postData = {\r\n basketId: basketId\r\n };\r\n\r\n const q = $.ajax({\r\n type: \"POST\",\r\n url: \"/api/basket/deletebasket\",\r\n data: JSON.stringify(postData),\r\n contentType: \"application/json; charset=utf-8\"\r\n });\r\n\r\n q.done((data) => {\r\n // @ts-ignore\r\n toastr[\"success\"](basketLoadData.messageConfirmedDeleteBasket);\r\n\r\n BasketStep1.calculatePriceData();\r\n MiniBasket.load();\r\n\r\n // make the redirect wait a bit otherwise can't see the toastr message\r\n setTimeout(function() {\r\n window.location.href = \"/\";\r\n }, 2000);\r\n });\r\n\r\n q.fail((xhr, textStatus, errorThrown) => {\r\n toastr[\"error\"](\"Could not delete basket.\");\r\n });\r\n }\r\n\r\n static postDeleteProduct(action: string, basketId: number, basketLineId: number, productNumber: string, dataLayerProduct: NatchOsDataLayerProduct | null) {\r\n const searchParams = new URLSearchParams(window.location.search);\r\n\r\n const postData = {\r\n basketId: basketId,\r\n basketLineId: basketLineId,\r\n };\r\n\r\n if (searchParams.has(\"page\")) {\r\n postData[\"page\"] = searchParams.get(\"page\") as unknown as number;\r\n }\r\n\r\n if (searchParams.has(\"up\")) {\r\n postData[\"undeliverableProductList\"] = searchParams.get(\"up\");\r\n }\r\n\r\n const q = $.ajax({\r\n type: \"POST\",\r\n url: action,\r\n data: JSON.stringify(postData),\r\n contentType: \"application/json; charset=utf-8\"\r\n });\r\n\r\n q.done((data) => {\r\n // @ts-ignore\r\n toastr[\"success\"](String.format(basketLoadData.messageConfirmedDeleteProduct, productNumber));\r\n\r\n // @ts-ignore\r\n if (basketLoadData.isTemplate === 1) {\r\n $(\"#template-details-\" + basketId).html(data.viewTemplateDetail);\r\n BasketStep1.initDeleteProduct();\r\n\r\n return;\r\n }\r\n\r\n BasketStep1.calculatePriceData();\r\n MiniBasket.load();\r\n\r\n if (dataLayerProduct) {\r\n const natchGtm = new NatchGtm(EventNamesSchema.OfficialGA4);\r\n const netTotalLineAmount = (dataLayerProduct._price ?? 0) * (dataLayerProduct._quantity ?? 0);\r\n natchGtm.trackRemoveFromCart(dataLayerProduct, netTotalLineAmount);\r\n }\r\n\r\n if (data.returnUrl !== null) {\r\n window.location.href = data.returnUrl;\r\n\r\n return;\r\n }\r\n\r\n $(\"#checkout-basket\").html(data.viewCheckoutBasket);\r\n BasketStep1.initDeleteProduct();\r\n });\r\n\r\n q.fail((xhr, textStatus, errorThrown) => {\r\n toastr[\"error\"](\"Could not delete product.\");\r\n });\r\n }\r\n\r\n static calculatePriceData() {\r\n const postData = {\r\n // @ts-ignore\r\n basketId: basketLoadData.basketId,\r\n };\r\n\r\n const q = $.ajax({\r\n type: \"POST\",\r\n url: \"/api/basket/pricedata\",\r\n data: JSON.stringify(postData),\r\n contentType: \"application/json; charset=utf-8\"\r\n });\r\n\r\n q.done((data) => {\r\n // @ts-ignore\r\n $(\".js-checkout-total\").html(\" \" + Globalize.format(data.totalNet, \"N2\"));\r\n\r\n // @ts-ignore\r\n $(\".js-checkout-total-available\").html(\" \" + Globalize.format(data.totalNetAvailable, \"N2\"));\r\n\r\n BasketStep1.totalNet = data.totalNet;\r\n BasketStep1.totalNetAvailable = data.totalNetAvailable;\r\n\r\n // @ts-ignore\r\n if (basketLoadData.isTemplate === 0) {\r\n const basketTotalsUpdateModel: BasketTotalsUpdateModel = {\r\n totalNet: data.totalNet,\r\n totalNetAvailable: data.totalNetAvailable,\r\n discount: data.discount,\r\n transportCost: data.transportCost,\r\n vatPercentage: data.vatPercentage\r\n };\r\n\r\n eventBus.emit(\"basket-totals-update\", basketTotalsUpdateModel);\r\n }\r\n });\r\n\r\n q.fail((xhr, textStatus, errorThrown) => {\r\n console.error(\"Error in recalculation of total price and discount in basket.\");\r\n });\r\n }\r\n\r\n static checkEmptyStockData($form) {\r\n // @ts-ignore\r\n if (NProgress) NProgress.start();\r\n\r\n // @ts-ignore\r\n const messageDialog = MessageDialog.createInstance(\"nt-message-dialog--check-empty-stock-data\", basketLoadData.messageCheckStockData);\r\n messageDialog.show();\r\n\r\n MessageDialog.getElement(\"nt-message-dialog--check-empty-stock-data\").addEventListener(\"shown.bs.modal\", () => {\r\n const q = $.ajax({\r\n type: \"GET\",\r\n url: \"/api/basket/checkemptystockdata\"\r\n });\r\n\r\n q.done((data) => {\r\n if (data.isStockEmpty) {\r\n let url = document.location.href;\r\n url += (url.split(\"?\")[1] ? \"&\" : \"?\") + \"isStockEmpty=True\";\r\n\r\n document.location.href = url;\r\n } else {\r\n if (typeof $form !== \"undefined\") {\r\n $form.submit();\r\n }\r\n }\r\n });\r\n\r\n q.fail((xhr, textStatus, errorThrown) => {\r\n console.error(xhr);\r\n\r\n if (typeof xhr.responseJSON !== \"undefined\") {\r\n toastr.error(xhr.responseJSON.exceptionMessage);\r\n }\r\n });\r\n\r\n q.always(() => {\r\n // @ts-ignore\r\n if (NProgress) NProgress.done();\r\n\r\n messageDialog.hide();\r\n });\r\n })\r\n }\r\n\r\n static checkStockData() {\r\n // @ts-ignore\r\n if (NProgress) NProgress.start();\r\n\r\n // @ts-ignore\r\n const messageDialog = MessageDialog.createInstance(\"nt-message-dialog--check-stock-data\", basketLoadData.messageCheckStockData)\r\n messageDialog.show();\r\n\r\n MessageDialog.getElement(\"nt-message-dialog--check-stock-data\").addEventListener(\"shown.bs.modal\", () => {\r\n axios.get(`/api/basket/checkstockdata?forceUpdate=true`, { timeout: 30000 })\r\n .then((response: AxiosResponse) => response.data)\r\n .then(data => {\r\n if (data.isStockStatusChange) {\r\n let url = document.location.href;\r\n url += (url.split(\"?\")[1] ? \"&\" : \"?\") + \"isStockChange=True\";\r\n\r\n document.location.href = url;\r\n } else {\r\n for (let psi = 0; psi < data.productStockList.length; psi++) {\r\n ProductHelper.updateStockIndicator(data.productStockList[psi]);\r\n }\r\n\r\n BasketStep1.calculatePriceData();\r\n }\r\n })\r\n .catch((error: AxiosError) => {\r\n console.error(error);\r\n\r\n if (error.response?.statusText) {\r\n toastr.error(error.response?.statusText);\r\n }\r\n })\r\n .finally(() => {\r\n // @ts-ignore\r\n if (NProgress) NProgress.done();\r\n\r\n messageDialog.hide();\r\n });\r\n })\r\n }\r\n}\r\n","import 'toastr';\r\nimport $ from \"jquery\";\r\nimport axios, { AxiosError, AxiosResponse } from \"axios\";\r\nimport NatchGtm, { EventNamesSchema, NatchOsDataLayerProduct } from \"natch-gtm4\";\r\nimport BasketStep1 from \"../pages/basket-step-1\";\r\nimport MiniBasket from \"../components/mini-basket\";\r\nimport ProductHelper from \"./product-helper\";\r\nimport Multilang from \"../utils/multilang\";\r\nimport type { AddToBasketRequest } from \"../models/baskets\";\r\n\r\nexport default class BasketHelper {\r\n static addToBasket(postData: AddToBasketRequest, dataLayerProduct: NatchOsDataLayerProduct | null) {\r\n Multilang.load();\r\n\r\n axios\r\n .post(\"/api/basket/add-from-product\", postData)\r\n .then((response: AxiosResponse) => response.data)\r\n .then(data => {\r\n if (!data) {\r\n return;\r\n }\r\n\r\n toastr[\"success\"](data);\r\n\r\n // removes focus effect on add button\r\n $(\":focus\").trigger(\"blur\");\r\n\r\n MiniBasket.load();\r\n\r\n if (dataLayerProduct) {\r\n dataLayerProduct.list_id = postData.attributionListId;\r\n dataLayerProduct.list_name = postData.attributionListName;\r\n\r\n const natchGtm = new NatchGtm(EventNamesSchema.OfficialGA4);\r\n const netTotalLineAmount = (dataLayerProduct._price ?? 0) * (dataLayerProduct._quantity ?? 0);\r\n natchGtm.trackAddToCart(dataLayerProduct, netTotalLineAmount);\r\n }\r\n })\r\n .catch((error: AxiosError) => {\r\n console.error(error);\r\n\r\n if (error.response?.status === 403) {\r\n toastr[\"warning\"](error.response?.statusText);\r\n }\r\n\r\n if (error.response?.status === 404 || error.response?.status === 500) {\r\n toastr[\"error\"](Multilang.getTranslation(\"AddToBasket.message.exception\", \"Er trad een fout op!\"));\r\n }\r\n });\r\n }\r\n\r\n static changeBasketLine(\r\n basketLineId: number,\r\n productId: number,\r\n quantity: number,\r\n unitPrice: number,\r\n orderUnitId: number,\r\n orderSource: string,\r\n isTemplate: number,\r\n templateId: number\r\n ) {\r\n const postData = {\r\n basketLineId: basketLineId,\r\n productId: productId,\r\n quantity: quantity,\r\n unitPrice: unitPrice,\r\n orderUnitId: orderUnitId,\r\n orderSource: orderSource,\r\n isTemplate: isTemplate,\r\n templateId: templateId\r\n };\r\n\r\n axios\r\n .post(\"/api/basket/change-line\", postData)\r\n .then((response: AxiosResponse) => response.data)\r\n .then(data => {\r\n if (!data) {\r\n return;\r\n }\r\n\r\n toastr[\"success\"](data.message);\r\n\r\n if (isTemplate === 0) {\r\n ProductHelper.updateStockIndicator(data.productStock);\r\n BasketStep1.calculatePriceData();\r\n }\r\n\r\n MiniBasket.load();\r\n })\r\n .catch((error: AxiosError) => {\r\n console.error(error);\r\n\r\n if (error.response?.status === 403) {\r\n toastr[\"warning\"](error.response?.statusText);\r\n }\r\n\r\n if (error.response?.status === 404 || error.response?.status === 500) {\r\n toastr[\"error\"](\"Could not change basket line.\");\r\n }\r\n });\r\n }\r\n}\r\n","export default class QuantityValidator {\r\n /**\r\n * Calculates the correct quantity and order unit.\r\n * @param {object} input: The input data.\r\n * requestedQuantity: The requested quantity.\r\n * requestedUnitsPerPack: The requested units per pack.\r\n * previousQuantity: The previously entered quantity.\r\n * totalQuantity: The total quantity (requested quantity * requested units per pack).\r\n * minimumOrderQuantity: The minimum order quantity.\r\n * maximumOrderQuantity: The maximum order quantity.\r\n * incrementOrderQuantity: The incremental order quantity.\r\n * restOrderQuantity: The rest order quantity.\r\n * roundType: The rounding type.\r\n * roundUnitsPerPack: The rounding units per pack.\r\n * roundOrderUnitId: The rounding order unit.\r\n * @param {boolean} isChangeOrderUnit: If order unit was changed.\r\n */\r\n static validate(input: any, isChangeOrderUnit: boolean) {\r\n // console.log(\"input\", input);\r\n\r\n if (input.minimumOrderQuantity < 1) {\r\n input.minimumOrderQuantity = 1;\r\n }\r\n\r\n if (input.maximumOrderQuantity < 1) {\r\n input.maximumOrderQuantity = 10_000_000 / input.requestedUnitsPerPack;\r\n }\r\n\r\n if (input.incrementOrderQuantity < 1) {\r\n input.incrementOrderQuantity = 1;\r\n }\r\n\r\n const data = {\r\n isRounded: false,\r\n correctQuantity: 0,\r\n correctOrderUnitId: 0\r\n };\r\n\r\n // set correct quantity\r\n if (isNaN(parseFloat(input.requestedQuantity))) {\r\n data.correctQuantity = input.minimumOrderQuantity;\r\n } else {\r\n if (isChangeOrderUnit) {\r\n data.correctQuantity = QuantityValidator.validateByOrderUnit(input);\r\n } else {\r\n data.correctQuantity = QuantityValidator.validateByQuantity(input);\r\n }\r\n }\r\n\r\n // set rounding\r\n if (input.roundType === \"YG00\" || input.roundType === \"YG02\") {\r\n input.requestedQuantity = data.correctQuantity;\r\n\r\n const roundResult = QuantityValidator.round(input);\r\n\r\n if (roundResult !== null) {\r\n data.isRounded = true;\r\n data.correctQuantity = roundResult.correctQuantity;\r\n data.correctOrderUnitId = roundResult.correctOrderUnitId;\r\n }\r\n }\r\n\r\n // console.log(\"data\", data);\r\n\r\n return data;\r\n }\r\n\r\n static validateByQuantity(input: any): number {\r\n // validate minimum is at least REST or MOQ\r\n let minimum = 0;\r\n\r\n if (input.restOrderQuantity !== undefined) {\r\n minimum = Math.max(input.restOrderQuantity > 0 ? input.restOrderQuantity : input.minimumOrderQuantity, 1);\r\n } else {\r\n minimum = Math.max(input.minimumOrderQuantity, 1);\r\n }\r\n\r\n if (input.requestedQuantity < minimum || input.requestedQuantity > input.maximumOrderQuantity) {\r\n return minimum;\r\n }\r\n\r\n // check if quantity is INCREASED or DECREASED to find nearest valid quantity\r\n ////var isIncrease = input.previousQuantity === 0 || input.requestedQuantity >= input.previousQuantity;\r\n const isIncrease = true; // PGB: always go for higher incremental value\r\n\r\n const ioqAmount = input.requestedQuantity - input.minimumOrderQuantity;\r\n const ioqRemainder = isIncrease\r\n ? Math.ceil(ioqAmount / input.incrementOrderQuantity)\r\n : Math.floor(ioqAmount / input.incrementOrderQuantity);\r\n\r\n let calculated = input.minimumOrderQuantity + ioqRemainder * input.incrementOrderQuantity;\r\n if (input.restOrderQuantity) {\r\n if (isIncrease) {\r\n const calculatedWithRestUp =\r\n input.minimumOrderQuantity +\r\n input.restOrderQuantity +\r\n Math.max(ioqRemainder - 1, 0) * input.incrementOrderQuantity;\r\n\r\n if (calculatedWithRestUp >= input.requestedQuantity && calculatedWithRestUp < calculated) {\r\n calculated = calculatedWithRestUp;\r\n }\r\n } else {\r\n const calculatedWithRestDown =\r\n input.minimumOrderQuantity + input.restOrderQuantity + ioqRemainder * input.incrementOrderQuantity;\r\n\r\n if (calculatedWithRestDown <= input.requestedQuantity && calculatedWithRestDown > calculated) {\r\n calculated = calculatedWithRestDown;\r\n }\r\n }\r\n }\r\n\r\n return calculated;\r\n }\r\n\r\n static validateByOrderUnit(input: any): number {\r\n const requestedMultiplier = parseFloat(input.totalQuantity) / parseFloat(input.requestedUnitsPerPack);\r\n // console.log(\"requestedMultiplier\", requestedMultiplier);\r\n\r\n return Math.ceil(requestedMultiplier);\r\n }\r\n\r\n static round(input: any) {\r\n // when rounding type = YG00, 80% of KAR is taken\r\n // when rounding type = YG02, 80% of BOX is taken\r\n const requestedValue = input.requestedQuantity * input.requestedUnitsPerPack / input.roundUnitsPerPack;\r\n\r\n // if requested value is greater than 80% + less than the round quantity\r\n if (requestedValue >= 0.8 && requestedValue < 1) {\r\n return {\r\n correctQuantity: Math.round(requestedValue),\r\n correctOrderUnitId: input.roundOrderUnitId\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n}\r\n","export default class DiscountValidator {\r\n static showDiscount(input): boolean {\r\n return input.discountPercentage !== 0 && input.discountUnitsPerPack !== 0;\r\n }\r\n\r\n static showDiscountValue(input): boolean {\r\n return (\r\n this.showDiscount(input) && (input.requestedUnitsPerPack * input.requestedQuantity) % input.discountUnitsPerPack === 0\r\n );\r\n }\r\n\r\n static calculateNetPrice(input): number {\r\n return this.showDiscountValue(input)\r\n ? input.grossPrice + input.grossPrice / 100 * input.discountPercentage\r\n : input.grossPrice;\r\n }\r\n}","interface Number {\r\n round(numberOfDecimals: number): number;\r\n}\r\n\r\nNumber.prototype.round = function (numberOfDecimals: number) {\r\n const numberValue = this as unknown as number;\r\n const powerValue = Math.pow(10, numberOfDecimals);\r\n return Math.round(numberValue * powerValue + 0.00000000000001) / powerValue;\r\n};\r\n","import 'toastr';\r\nimport $ from \"jquery\";\r\nimport BasketHelper from \"./basket-helper\";\r\nimport QuantityValidator from \"../validators/quantity-validator\";\r\nimport DiscountValidator from \"../validators/discount-validator\";\r\nimport Multilang from \"../utils/multilang\";\r\nimport { AddToBasketRequest } from \"../models/baskets\";\r\nimport { ProductPriceDisplayType } from \"../models/products\";\r\nimport { NatchOsDataLayerProduct } from \"natch-gtm4\";\r\nimport \"../extensions/number-extensions\";\r\n\r\nexport default class ProductHelper {\r\n static updateDiscountDisplay($container: any) {\r\n const $quantity = $container.find(\"[name=quantity]\");\r\n const $orderUnit = $container.find(\"[name=orderunitid]\").find(\"option:selected\");\r\n const $unitPrice = $container.find(\".js-product-unit-price\");\r\n const $discount = $container.find(\".js-product-discount\");\r\n const $discountPercentage = $container.find(\".js-product-discount-percentage\");\r\n const $discountUnitPrice = $container.find(\".js-product-discount-unit-price\");\r\n\r\n const input = {\r\n requestedQuantity: parseFloat($quantity.val()),\r\n requestedUnitsPerPack: $orderUnit.data(\"upp\"),\r\n discountUnitsPerPack: $discount.data(\"unitsperpack\"),\r\n discountPercentage: $discount.data(\"percentage\")\r\n };\r\n\r\n const showDiscount = DiscountValidator.showDiscount(input);\r\n\r\n if (showDiscount) {\r\n $discount.removeClass(\"d-none\");\r\n } else {\r\n $discount.addClass(\"d-none\");\r\n }\r\n\r\n const showDiscountValue = DiscountValidator.showDiscountValue(input);\r\n\r\n if (showDiscountValue) {\r\n $unitPrice.addClass(\"text-decoration-line-through\");\r\n $discountPercentage.addClass(\"d-none\");\r\n $discountUnitPrice.removeClass(\"d-none\");\r\n } else {\r\n $unitPrice.removeClass(\"text-decoration-line-through\");\r\n $discountPercentage.removeClass(\"d-none\");\r\n $discountUnitPrice.addClass(\"d-none\");\r\n }\r\n }\r\n\r\n static updateStockIndicator(productStock) {\r\n const $availableStockIndicator = $(\".js-product-stock-available-\" + productStock.productCode);\r\n const $notAvailableStockIndicator = $(\".js-product-stock-not-available-\" + productStock.productCode);\r\n\r\n $availableStockIndicator.addClass(\"d-none\");\r\n $notAvailableStockIndicator.addClass(\"d-none\");\r\n\r\n if (productStock.isInStock) {\r\n $availableStockIndicator.removeClass(\"d-none\");\r\n } else {\r\n $notAvailableStockIndicator.removeClass(\"d-none\");\r\n }\r\n }\r\n\r\n static updateQuantityAndPrice(\r\n event,\r\n $container,\r\n isProductPage,\r\n isOnlyChange,\r\n isTemplate,\r\n isChangeOfOrderUnit,\r\n isAddToBasket\r\n ) {\r\n event.preventDefault();\r\n\r\n Multilang.load();\r\n\r\n // get fields\r\n const $quantityField: any = $container.find(\"[name=quantity]\");\r\n const $quantityPreviousField: any = $container.find(\".js-product-order-box--quantity-previous\");\r\n const $quantityTotalField: any = $container.find(\".js-product-order-box--quantity-total\");\r\n const $orderUnitField: any = $container.find(\"[name=orderunitid]\");\r\n const $unitPriceField: any = $container.find(\"[name=unitprice]\");\r\n const $priceQuantityField: any = $container.find(\"[name=pricequantity]\");\r\n const $currencyCodeField: any = $container.find(\"[name=currencycode]\");\r\n const $isPriceRequestField: any = $container.find(\"[name=ispricerequest]\");\r\n const $productIdField: any = $container.find(\"[name=productid]\");\r\n const $productPriceDataList: any = $container.find(\".js-product-price-data\");\r\n\r\n // get values from fields\r\n const productId: number = $productIdField.val();\r\n const isPriceRequest: boolean = $isPriceRequestField.val() === \"true\";\r\n const unitPrice: number = parseFloat($unitPriceField.val());\r\n const priceQuantity: number = parseFloat($priceQuantityField.val());\r\n const orderSource: string = isTemplate ? \"List\" : \"Manual\";\r\n\r\n let currencyCode: string = $currencyCodeField.val();\r\n let orderUnitId: number = $orderUnitField.find(\"option:selected\").val();\r\n let unitsPerPack: number = parseFloat($orderUnitField.find(\"option:selected\").data(\"upp\"));\r\n\r\n // difference with js code in basket-step1 is that in product pages we don't have a BasketLineID or BasketID, instead we have a ProductID\r\n let basketLineId: number = 0;\r\n let basketId: number = 0;\r\n\r\n if (isProductPage !== 1) {\r\n basketLineId = $container.find(\"[name=basketlineid]\").val();\r\n basketId = $container.find(\"[name=basketid]\").val(); // is BasketID (checkout) or TemplateID (templates page)\r\n }\r\n\r\n // validate the quantity by giving an input object to the QuantityValidator, returning correctQuantity\r\n const input = {\r\n requestedQuantity: parseFloat($quantityField.val()),\r\n requestedUnitsPerPack: unitsPerPack,\r\n previousQuantity: parseFloat($quantityPreviousField.val()),\r\n totalQuantity: parseFloat($quantityTotalField.val()),\r\n minimumOrderQuantity: parseFloat($quantityField.prop(\"min\")),\r\n maximumOrderQuantity: parseFloat($quantityField.prop(\"max\")),\r\n incrementOrderQuantity: parseFloat($quantityField.prop(\"step\")),\r\n restOrderQuantity: parseFloat($quantityField.data(\"roq\")),\r\n roundType: $quantityField.data(\"rnd-type\"),\r\n roundUnitsPerPack: $quantityField.data(\"rnd-upp\"),\r\n roundOrderUnitId: $quantityField.data(\"rnd-id\"),\r\n discountUnitsPerPack: 0,\r\n discountPercentage: 0,\r\n grossPrice: 0\r\n };\r\n\r\n // set min/max/step for [type=number]\r\n if (input.minimumOrderQuantity < 1) {\r\n input.minimumOrderQuantity = 1;\r\n }\r\n\r\n if (input.maximumOrderQuantity < 1) {\r\n input.maximumOrderQuantity = 10_000_000 / unitsPerPack;\r\n }\r\n\r\n if (input.incrementOrderQuantity < 1) {\r\n input.incrementOrderQuantity = 1;\r\n }\r\n\r\n $quantityField.prop(\"min\", input.minimumOrderQuantity);\r\n $quantityField.prop(\"max\", input.maximumOrderQuantity);\r\n $quantityField.prop(\"step\", input.incrementOrderQuantity);\r\n\r\n // set correct quantity + rounding\r\n const validationData: any = QuantityValidator.validate(input, isChangeOfOrderUnit);\r\n const correctQuantity: number = validationData.correctQuantity;\r\n\r\n if (validationData.isRounded) {\r\n $orderUnitField.val(validationData.correctOrderUnitId);\r\n\r\n orderUnitId = $orderUnitField.find(\"option:selected\").val();\r\n unitsPerPack = parseFloat($orderUnitField.find(\"option:selected\").data(\"upp\"));\r\n }\r\n\r\n let grossUnitPrice: number = unitPrice;\r\n let netUnitPrice: number = unitPrice;\r\n let correctPriceQuantity: number = priceQuantity;\r\n let isPriceRequestForData: boolean = false;\r\n\r\n $productPriceDataList.each(function() {\r\n // @ts-ignore\r\n const $productPriceData: any = $(this);\r\n const unitPrice: number = parseFloat($productPriceData.val() as string);\r\n const priceQuantity: number = parseFloat($productPriceData.data(\"pq\"));\r\n\r\n let minimumOrderQuantity: number = parseFloat($productPriceData.data(\"moq\")) / unitsPerPack;\r\n\r\n if (minimumOrderQuantity < 1) {\r\n minimumOrderQuantity = 1;\r\n }\r\n\r\n // if currency code is empty for base unit price, take one that's filled from other package\r\n if (currencyCode === \"\" && $productPriceData.data(\"crc\") !== \"\") {\r\n currencyCode = $productPriceData.data(\"crc\");\r\n }\r\n\r\n // now compare with quantity asked (correct quantity is the updated one) here\r\n if (minimumOrderQuantity <= correctQuantity) {\r\n // if other unit price than the one before\r\n if (grossUnitPrice !== unitPrice) {\r\n // is overwritten if higher one fits as well (TA 7.2)\r\n grossUnitPrice = unitPrice;\r\n correctPriceQuantity = priceQuantity;\r\n }\r\n }\r\n\r\n // calculate promotion if applicable\r\n if (isProductPage !== 1) {\r\n const $discountField: any = $productPriceData.closest(\"tr\").find(\".js-product-discount\");\r\n\r\n input.requestedQuantity = correctQuantity;\r\n input.discountUnitsPerPack = $discountField.data(\"unitsperpack\");\r\n input.discountPercentage = $discountField.data(\"percentage\");\r\n input.grossPrice = $discountField.data(\"grossprice\");\r\n\r\n if (typeof input.discountPercentage !== \"undefined\" && input.discountPercentage !== 0) {\r\n netUnitPrice = DiscountValidator.calculateNetPrice(input);\r\n }\r\n }\r\n\r\n // make sure, when a price request is true, it isn't overwritten by the next value\r\n if (!isPriceRequestForData) {\r\n isPriceRequestForData = $productPriceData.data(\"ipr\") === true;\r\n }\r\n });\r\n\r\n // create formatted unit price + price quantity\r\n const priceDisplayType: ProductPriceDisplayType = $container.find(\".js-product-order-box--price-display-type\").val();\r\n const salesUnitName: string = $container.find(\".js-product-order-box--sales-unit-name\").val();\r\n const salesUnitQuantity: number = $container.find(\".js-product-order-box--sales-unit-quantity\").val() as number;\r\n const unitPriceValue = priceDisplayType === \"PerSalesUnit\" && correctPriceQuantity > 1 ? (netUnitPrice / correctPriceQuantity * salesUnitQuantity).round(2) : netUnitPrice;\r\n\r\n // @ts-ignore\r\n let formattedUnitPrice: string = Globalize.format(unitPriceValue, \"N2\");\r\n let formattedUnitPricePostfix: string = priceDisplayType === \"PerSalesUnit\" && correctPriceQuantity > 1 ? `/ ${salesUnitName}` : correctPriceQuantity > 1 ? `/ ${correctPriceQuantity}` : \"\";\r\n\r\n if (isPriceRequest || isPriceRequestForData) {\r\n formattedUnitPrice = Multilang.getTranslation(\"product.pricerequest.label.request\", \"Prijs op aanvraag\");\r\n\r\n $container.find(\".js-order-box-product-add\").addClass(\"d-none\");\r\n $container.find(\".js-order-box-product-discount\").addClass(\"d-none\");\r\n $container.find(\".js-order-box-product-price-request\").removeClass(\"d-none\");\r\n } else {\r\n $container.find(\".js-order-box-product-add\").removeClass(\"d-none\");\r\n $container.find(\".js-order-box-product-discount\").removeClass(\"d-none\");\r\n $container.find(\".js-order-box-product-price-request\").addClass(\"d-none\");\r\n }\r\n\r\n if (isProductPage === 1) {\r\n $container.find(\"#unit-price_\" + productId).html(formattedUnitPrice);\r\n $container.find(\"#unit-price-postfix_\" + productId).html(formattedUnitPricePostfix);\r\n\r\n if (isPriceRequest || isPriceRequestForData) {\r\n $container.find(\"#unit-price-currency_\" + productId).addClass(\"d-none\");\r\n $container.find(\"#unit-price-label_\" + productId).addClass(\"d-none\");\r\n $container.find(\"#unit-price-postfix_\" + productId).addClass(\"d-none\");\r\n } else {\r\n $container.find(\"#unit-price-currency_\" + productId).removeClass(\"d-none\");\r\n $container.find(\"#unit-price-label_\" + productId).removeClass(\"d-none\");\r\n $container.find(\"#unit-price-postfix_\" + productId).removeClass(\"d-none\");\r\n }\r\n } else {\r\n $container.find(\"#unit-price_\" + basketLineId + \"_\" + basketId).html(formattedUnitPrice);\r\n $container.find(\"#unit-price-postfix_\" + basketLineId + \"_\" + basketId).html(formattedUnitPricePostfix);\r\n\r\n if (isPriceRequest || isPriceRequestForData) {\r\n $container.find(\"#unit-price-postfix_\" + basketLineId + \"_\" + basketId).addClass(\"d-none\");\r\n } else {\r\n $container.find(\"#unit-price-postfix_\" + basketLineId + \"_\" + basketId).removeClass(\"d-none\");\r\n }\r\n }\r\n\r\n if (isProductPage !== 1) {\r\n // @ts-ignore\r\n const totalGrossPriceCalculated: number = Globalize.format(\r\n correctQuantity * unitsPerPack * grossUnitPrice / correctPriceQuantity,\r\n \"N2\"\r\n );\r\n\r\n // @ts-ignore\r\n const totalNetPriceCalculated: number = Globalize.format(\r\n correctQuantity * unitsPerPack * netUnitPrice / correctPriceQuantity,\r\n \"N2\"\r\n );\r\n\r\n // show data\r\n $container.find(\"#gross-total_\" + basketLineId + \"_\" + basketId).html(totalGrossPriceCalculated);\r\n $container.find(\"#net-total_\" + basketLineId + \"_\" + basketId).html(totalNetPriceCalculated);\r\n\r\n if (isPriceRequest || isPriceRequestForData) {\r\n $container.find(\"#gross-total_\" + basketLineId + \"_\" + basketId).addClass(\"d-none\");\r\n $container.find(\"#net-total_\" + basketLineId + \"_\" + basketId).addClass(\"d-none\");\r\n } else {\r\n $container.find(\"#gross-total_\" + basketLineId + \"_\" + basketId).removeClass(\"d-none\");\r\n $container.find(\"#net-total_\" + basketLineId + \"_\" + basketId).removeClass(\"d-none\");\r\n }\r\n }\r\n\r\n // change hidden price field\r\n $unitPriceField.val(grossUnitPrice);\r\n\r\n // fills DOM with corrected quantity\r\n $quantityField.val(correctQuantity);\r\n $quantityPreviousField.val(correctQuantity);\r\n $quantityTotalField.val(correctQuantity * input.requestedUnitsPerPack);\r\n\r\n const $selectedOrderUnit = $orderUnitField.find(\"option:selected\");\r\n $quantityField.prop(\"min\", $selectedOrderUnit.data(\"min\"));\r\n $quantityField.prop(\"max\", $selectedOrderUnit.data(\"max\"));\r\n $quantityField.prop(\"step\", $selectedOrderUnit.data(\"step\"));\r\n\r\n // part with messages (eventually to be confirmed) and posts\r\n if (isOnlyChange === 1 && isProductPage === 1) {\r\n if (input.requestedQuantity !== correctQuantity) {\r\n const changeProductQuantityMessage = Multilang.getTranslation(\"ChangeProductQuantity.message.exception\", \"Aantal werd automatisch (terug) gezet op {0}.\");\r\n\r\n // @ts-ignore\r\n const warningMessage: string = String.format(changeProductQuantityMessage, correctQuantity);\r\n\r\n // @ts-ignore\r\n toastr[\"warning\"](warningMessage);\r\n }\r\n\r\n return;\r\n }\r\n\r\n // get GTM datalayer data in a safe way\r\n let dataLayerProduct: NatchOsDataLayerProduct | null = null;\r\n\r\n const $dataLayerCartItem = $container.find(\"div[data-datalayer-cartitem]\");\r\n\r\n if ($dataLayerCartItem.length > 0) {\r\n dataLayerProduct = $dataLayerCartItem.data(\"datalayer-cartitem\") as NatchOsDataLayerProduct;\r\n }\r\n\r\n const attributionListId = $quantityField.closest(\"div[data-datalayer-list-id]\").data(\"datalayer-list-id\");\r\n const attributionListName = $quantityField.closest(\"div[data-datalayer-list-name]\").data(\"datalayer-list-name\");\r\n\r\n // if quantity didn't change, just post order\r\n if (input.requestedQuantity === correctQuantity) {\r\n if (isAddToBasket === 1) {\r\n const data: AddToBasketRequest = {\r\n productId: productId,\r\n quantity: input.requestedQuantity,\r\n unitPrice: grossUnitPrice.toString(),\r\n priceQuantity: priceQuantity,\r\n orderUnitId: orderUnitId,\r\n orderSource: orderSource,\r\n attributionListId: attributionListId,\r\n attributionListName: attributionListName\r\n };\r\n\r\n BasketHelper.addToBasket(data, dataLayerProduct);\r\n\r\n return;\r\n }\r\n\r\n BasketHelper.changeBasketLine(\r\n basketLineId,\r\n productId,\r\n input.requestedQuantity,\r\n grossUnitPrice,\r\n orderUnitId,\r\n orderSource,\r\n isTemplate,\r\n basketId\r\n );\r\n\r\n return;\r\n }\r\n\r\n // if quantity changed show bootbox to confirm/accept message and post order\r\n if (isProductPage) {\r\n const bootboxTitle: string = Multilang.getTranslation(\"AddToBasket.QuantityChanged.Title\", \"Aantal gewijzigd\");\r\n\r\n // @ts-ignore\r\n const bootboxMessage: string = String.format(Multilang.getTranslation(\"AddToBasket.QuantityChanged.Message\", \"Opgelet, het ingegeven aantal werd gewijzigd naar {0} om te voldoen aan de hoeveelheid waarin dit product verkocht wordt.\"), correctQuantity);\r\n\r\n // @ts-ignore\r\n bootbox.confirm({\r\n size: \"small\",\r\n title: bootboxTitle,\r\n message: bootboxMessage,\r\n buttons: {\r\n cancel: {\r\n label: Multilang.getTranslation(\"AddToBasket.QuantityChanged.Cancel\", \"Terug\"),\r\n callback: function() {}\r\n },\r\n confirm: {\r\n label: Multilang.getTranslation(\"AddToBasket.QuantityChanged.Confirm\", \"Toevoegen\"),\r\n callback: function() {}\r\n }\r\n },\r\n callback: function(result) {\r\n if (result) {\r\n const data: AddToBasketRequest = {\r\n productId: productId,\r\n quantity: correctQuantity,\r\n unitPrice: grossUnitPrice.toString(),\r\n priceQuantity: priceQuantity,\r\n orderUnitId: orderUnitId,\r\n orderSource: orderSource,\r\n attributionListId: attributionListId,\r\n attributionListName: attributionListName\r\n };\r\n\r\n BasketHelper.addToBasket(data, dataLayerProduct);\r\n }\r\n }\r\n });\r\n return;\r\n }\r\n\r\n // @ts-ignore\r\n const warningMessage: string = String.format(Multilang.getTranslation(\"ChangeProductQuantity.message.exception\", \"Aantal werd automatisch (terug) gezet op {0}.\"), correctQuantity);\r\n\r\n // @ts-ignore\r\n toastr[\"warning\"](warningMessage);\r\n\r\n BasketHelper.changeBasketLine(\r\n basketLineId,\r\n productId,\r\n correctQuantity,\r\n grossUnitPrice,\r\n orderUnitId,\r\n orderSource,\r\n isTemplate,\r\n basketId\r\n );\r\n }\r\n}\r\n","import $ from \"jquery\";\r\nimport $$ from \"../utils/double-dollar\";\r\nimport axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from \"axios\";\r\nimport { Popover, Tooltip } from \"bootstrap\";\r\nimport NatchGtm, { EventNamesSchema, NatchOsDataLayerProduct } from \"natch-gtm4\";\r\nimport CustomSwiper from \"../components/custom-swiper\";\r\nimport CustomHelper from \"../helpers/custom-helper\";\r\nimport DataLayerHelper from \"../helpers/data-layer-helper\";\r\nimport ProductHelper from \"../helpers/product-helper\";\r\nimport Multilang from \"../utils/multilang\";\r\nimport eventBus from \"../utils/event-bus\";\r\n\r\nexport default class Products {\r\n private static filterItemClicked = false;\r\n\r\n static init() {\r\n Products.initOverview();\r\n Products.initDetail();\r\n Products.initChangeProduct();\r\n Products.initPriceRequest();\r\n Products.initScannerEvents();\r\n Products.initStockLoad();\r\n }\r\n\r\n static initOverview() {\r\n Products.initFilters();\r\n Products.initFavorites();\r\n Products.initPageSize();\r\n Products.initOrderProduct();\r\n Products.initMobileFilterToggle();\r\n Products.initMobileNavToggle();\r\n\r\n window.addEventListener(\"popstate\", (e) => {\r\n console.log(\"handling popstate for \" + document.location);\r\n Products.loadOverview(document.location.toString(), false);\r\n });\r\n\r\n $(\"#ajax-container\").on(\"click\", \"a.js-ajaxify\", (e) => {\r\n e.preventDefault();\r\n\r\n const url = $(e.target).closest(\"a\").prop(\"href\") as string;\r\n Products.loadOverview(url, true);\r\n\r\n return true;\r\n });\r\n }\r\n\r\n static initDetail() {\r\n Products.initFavorites();\r\n Products.initProductNumbers();\r\n Products.initRelatedProducts();\r\n Products.initOrderProduct();\r\n Products.initLogDownload();\r\n }\r\n\r\n static initFilters() {\r\n const $body = $(\"body\");\r\n\r\n // erase all filters\r\n $body.off(\"click\", \".js-erase-filters\");\r\n $body.on(\"click\", \".js-erase-filters\", (e) => {\r\n e.preventDefault();\r\n\r\n $(\".js-filter-group-list\")\r\n .find(\"input[type='checkbox']:checked\")\r\n .prop(\"checked\", false);\r\n\r\n let url = CustomHelper.removeUrlParameter(window.location.href, \"filters\");\r\n url = CustomHelper.removeUrlParameter(url, \"initFilterPropertyId\");\r\n\r\n Products.loadOverview(url, true);\r\n });\r\n\r\n // close all filter groups\r\n $body.off(\"click\", \".js-close-filters\");\r\n $body.on(\"click\", \".js-close-filters\", (e) => {\r\n e.preventDefault();\r\n\r\n const $filterGroup = $(\".js-filter-group\");\r\n $filterGroup.find(\"i\").removeClass(\"fa-caret-down\").addClass(\"fa-caret-up\");\r\n $filterGroup.data(\"nt-is-open\", \"False\");\r\n\r\n $(\".js-filter-item-list\").addClass(\"d-none\");\r\n $(\".js-open-filters\").removeClass(\"d-none\");\r\n $(\".js-close-filters\").addClass(\"d-none\");\r\n });\r\n\r\n // open all filter groups\r\n $body.off(\"click\", \".js-open-filters\");\r\n $body.on(\"click\", \".js-open-filters\", (e) => {\r\n e.preventDefault();\r\n\r\n const $filterGroup = $(\".js-filter-group\");\r\n $filterGroup.find(\"i\").removeClass(\"fa-caret-up\").addClass(\"fa-caret-down\");\r\n $filterGroup.data(\"nt-is-open\", \"True\");\r\n\r\n $(\".js-filter-item-list\").removeClass(\"d-none\");\r\n $(\".js-open-filters\").addClass(\"d-none\");\r\n $(\".js-close-filters\").removeClass(\"d-none\");\r\n });\r\n\r\n // toggle filter group\r\n $body.off(\"click\", \".js-toggle-filter-group\");\r\n $body.on(\"click\", \".js-toggle-filter-group\", (e) => {\r\n e.preventDefault();\r\n\r\n const $filterGroup = $(e.target).closest(\".js-filter-group\");\r\n\r\n if ($filterGroup.data(\"nt-is-open\") === \"True\") {\r\n $filterGroup.find(\"i\").removeClass(\"fa-caret-down\").addClass(\"fa-caret-up\");\r\n $filterGroup.data(\"nt-is-open\", \"False\");\r\n $filterGroup.find(\".js-filter-item-list\").addClass(\"d-none\");\r\n } else {\r\n $filterGroup.find(\"i\").removeClass(\"fa-caret-up\").addClass(\"fa-caret-down\");\r\n $filterGroup.data(\"nt-is-open\", \"True\");\r\n $filterGroup.find(\".js-filter-item-list\").removeClass(\"d-none\");\r\n }\r\n });\r\n\r\n // show more filter items\r\n $body.off(\"click\", \".js-show-more\");\r\n $body.on(\"click\", \".js-show-more\", (e) => {\r\n e.preventDefault();\r\n\r\n const $this = $(e.target);\r\n\r\n $this.closest(\".js-filter-item-list\").find(\".js-filter-item\").removeClass(\"d-none\");\r\n $this.closest(\".js-filter-group\").data(\"nt-show-more-link\", \"False\");\r\n $this.addClass(\"d-none\");\r\n });\r\n\r\n // check filter item\r\n $body.off(\"change\", \".js-filter-item input:checkbox\");\r\n $body.on(\"change\", \".js-filter-item input:checkbox\", (e) => {\r\n if (Products.filterItemClicked) {\r\n e.preventDefault();\r\n return false;\r\n }\r\n\r\n Products.filterItemClicked = true;\r\n\r\n const $filterItem = $(e.target).closest(\".js-filter-item\");\r\n\r\n const open: number[] = [];\r\n const more: number[] = [];\r\n const checkedFilterGroupIds: number[] = [];\r\n\r\n const $filterGroups = $filterItem.closest(\".js-filter-group-list\").find(\".js-filter-group\");\r\n $filterGroups.each((i: number, el: HTMLElement) => {\r\n const $filterGroup = $(el);\r\n const filterGroupId = $filterGroup.data(\"id\");\r\n\r\n if ($filterGroup.data(\"nt-is-open\") === \"True\") {\r\n open.push(filterGroupId);\r\n }\r\n\r\n if ($filterGroup.data(\"nt-show-more-link\") === \"True\") {\r\n more.push(filterGroupId);\r\n }\r\n });\r\n\r\n // store checked filter group IDs\r\n const $checkedFilters = $(\".js-filter-item input:checked\");\r\n $checkedFilters.each((i: number, el: HTMLElement) => {\r\n const $filterGroup = $(el).closest(\".js-filter-group\");\r\n\r\n const filterGroupId = $filterGroup.data(\"id\");\r\n if (!checkedFilterGroupIds.includes(filterGroupId)) {\r\n checkedFilterGroupIds.push(parseInt(filterGroupId));\r\n }\r\n });\r\n\r\n const $changeFilterGroup = $(e.target).closest(\".js-filter-group\");\r\n let initStateFilterPropertyId = $changeFilterGroup.data(\"id\");\r\n\r\n const changedFilterPropertyType = $changeFilterGroup.data(\"property-filter-type\");\r\n if (changedFilterPropertyType !== 2) {\r\n // only if filter type = 2 (Union/OR)\r\n initStateFilterPropertyId = 0;\r\n }\r\n\r\n // also, if this was the last prop value in a filter that was unchecked, and there are no more checks in this property, we want the full list again\r\n const checkedCount = $(\":checked\", $changeFilterGroup).length;\r\n if (checkedCount === 0) {\r\n initStateFilterPropertyId = 0;\r\n\r\n // if there is one group left with checks, use that property\r\n if (checkedFilterGroupIds.length === 1) {\r\n initStateFilterPropertyId = checkedFilterGroupIds[0];\r\n }\r\n }\r\n\r\n // filterUrl always has '?', and may contain a query\r\n let filterUrl: string = $filterItem.data(\"url\");\r\n if (!filterUrl.endsWith(\"?\")) {\r\n filterUrl += \"&\";\r\n }\r\n\r\n const url = `${filterUrl}open=${open.join()}&more=${more.join()}&initFilterPropertyId=${initStateFilterPropertyId}`;\r\n Products.loadOverview(url, true);\r\n });\r\n }\r\n\r\n static initFavorites() {\r\n const $body = $(\"body\");\r\n\r\n $body.off(\"click\", \".js-favorite\");\r\n $body.on(\"click\", \".js-favorite\", (e) => {\r\n const $favorite = $(e.currentTarget);\r\n const $dataLayerListItem = $favorite.closest(\"div[data-datalayer-list-item]\");\r\n const $dataLayerDetail = $favorite.closest(\"div[data-datalayer-detail]\");\r\n\r\n let dataLayerProduct: NatchOsDataLayerProduct | null = null;\r\n\r\n if ($dataLayerListItem.length > 0) {\r\n dataLayerProduct = $dataLayerListItem.data(\"datalayer-list-item\") as NatchOsDataLayerProduct;\r\n } else if ($dataLayerDetail.length > 0) {\r\n dataLayerProduct = $dataLayerListItem.data(\"datalayer-detail\") as NatchOsDataLayerProduct;\r\n }\r\n\r\n Products.postFavorite($favorite.data(\"id\"), $favorite.hasClass(\"far\"), dataLayerProduct);\r\n $favorite.toggleClass(\"fa far\");\r\n });\r\n }\r\n\r\n static initPageSize() {\r\n const $body = $(\"body\");\r\n\r\n $body.off(\"change\", \".js-page-size\");\r\n $body.on(\"change\", \".js-page-size\", (e) => {\r\n const url = $(e.target).find(\"option:selected\").data(\"url\");\r\n Products.loadOverview(url, true);\r\n });\r\n }\r\n\r\n static initProductNumbers() {\r\n $(\".js-product-number-change\").on(\"change\", (e) => {\r\n const $productNumber = $(e.currentTarget);\r\n Products.postProductNumber($productNumber.data(\"id\"), $productNumber.val() as string);\r\n });\r\n }\r\n\r\n static initChangeProduct() {\r\n const isProductPage = 1;\r\n const isOnlyChange = 1;\r\n const isTemplate = 0;\r\n const isAddToBasket = 0;\r\n\r\n let $container = $(\"#product-overview\");\r\n if ($container.length === 0) {\r\n $container = $(\"#product-detail\");\r\n }\r\n\r\n const $form = $container.find(\".js-order-product\");\r\n\r\n $form.off(\"change\", \"[name=quantity]\");\r\n $form.on(\"change\", \"[name=quantity]\", (e) => {\r\n const $container = $(e.target).closest(\".js-product-order-box\");\r\n\r\n ProductHelper.updateQuantityAndPrice(\r\n e,\r\n $container,\r\n isProductPage,\r\n isOnlyChange,\r\n isTemplate,\r\n 0,\r\n isAddToBasket\r\n );\r\n\r\n ProductHelper.updateDiscountDisplay($container);\r\n });\r\n\r\n $form.off(\"change\", \"[name=orderunitid]\");\r\n $form.on(\"change\", \"[name=orderunitid]\", (e) => {\r\n const $this = $(e.target);\r\n\r\n const eanCode = $this.find(\"option:selected\").data(\"ean\");\r\n $(\"span.js-product-ean\").text(eanCode);\r\n $(\"input.js-product-ean\").val(eanCode);\r\n\r\n const $container = $this.closest(\".js-product-order-box\");\r\n\r\n ProductHelper.updateQuantityAndPrice(\r\n e,\r\n $container,\r\n isProductPage,\r\n isOnlyChange,\r\n isTemplate,\r\n 1,\r\n isAddToBasket\r\n );\r\n\r\n ProductHelper.updateDiscountDisplay($container);\r\n });\r\n\r\n $(\"[name=quantity], [name=orderunitid]\").on(\"keydown\", (e) => {\r\n if (e.keyCode === 13) {\r\n e.target.blur();\r\n }\r\n });\r\n }\r\n\r\n static initRelatedProducts() {\r\n const relatedProductsEl = document.querySelector(\".js-related-products-async\") as HTMLElement | null;\r\n\r\n if (!relatedProductsEl) {\r\n return;\r\n }\r\n\r\n const action = relatedProductsEl.dataset.action;\r\n\r\n if (typeof action === \"undefined\") {\r\n return;\r\n }\r\n\r\n // preventOverlay is not standard axios but javascript's ability to add any property to an object\r\n axios.get(action, {\r\n timeout: 60000,\r\n preventOverlay: true\r\n } as AxiosRequestConfig)\r\n .then((response: AxiosResponse) => response.data)\r\n .then(data => {\r\n const $relatedProducts = $(relatedProductsEl);\r\n $relatedProducts.html(data.viewRelatedProducts);\r\n\r\n CustomSwiper.init();\r\n\r\n Products.initFavorites();\r\n Products.initOrderProduct();\r\n Products.initChangeProduct();\r\n Products.initPriceRequest();\r\n\r\n const failMessage: string = Multilang.getTranslation(\"productoverview.message.warning.stock.indication\", \"De voorraad per product is een indicatie.\");\r\n Products.loadStock(CustomHelper.getListItemCodeList(), false, failMessage);\r\n })\r\n .catch((error: AxiosError) => {\r\n console.error(error);\r\n });\r\n }\r\n\r\n static initOrderProduct() {\r\n const isProductPage = 1;\r\n const isOnlyChange = 0;\r\n const isChangeOfOrderUnit = 0;\r\n const isAddToBasket = 1;\r\n\r\n let isTemplate = 0;\r\n\r\n let $container = $(\"#product-overview\");\r\n if ($container.length === 0) {\r\n $container = $(\"#product-detail\");\r\n }\r\n\r\n $container.off(\"submit\", \".js-order-product\");\r\n $container.on(\"submit\", \".js-order-product\", (e) => {\r\n const $form = $(e.target);\r\n\r\n isTemplate = $(\"[name=istemplate]\").val() === \"true\" ? 1 : 0;\r\n\r\n ProductHelper.updateQuantityAndPrice(\r\n e,\r\n $form,\r\n isProductPage,\r\n isOnlyChange,\r\n isTemplate,\r\n isChangeOfOrderUnit,\r\n isAddToBasket\r\n );\r\n });\r\n }\r\n\r\n static initMobileFilterToggle() {\r\n $(\"body\").on(\"click\", \".js-mobile-product-filter-activator\", (e) => {\r\n e.preventDefault();\r\n eventBus.emit(\"mobile-product-filter-activate\");\r\n });\r\n }\r\n\r\n static initMobileNavToggle() {\r\n $(\"body\").on(\"click\", \".js-category-nav-trigger\", (e) => {\r\n e.preventDefault();\r\n $(\".js-category-nav-activator\").trigger(\"click\");\r\n });\r\n }\r\n\r\n static initPriceRequest() {\r\n const $body = $(\"body\");\r\n\r\n $body.off(\"click\", \".js-modal-price-request-submit\");\r\n $body.on(\"click\", \".js-modal-price-request-submit\", (e) => {\r\n e.preventDefault();\r\n\r\n const $this = $(e.currentTarget);\r\n const $parent = $this.closest(\".js-modal-price-request\");\r\n const $orderQuantity = $parent.find(\"[name='modal-quantity']\");\r\n const $orderUnit = $parent.find(\"[name='modal-order-unit'] option:selected\");\r\n\r\n let orderQuantity = $orderQuantity.val() as string;\r\n orderQuantity = orderQuantity.replace(\",\", \".\");\r\n\r\n if (orderQuantity.length === 0 || isNaN(parseInt(orderQuantity))) {\r\n $orderQuantity.parent().addClass(\"has-error\");\r\n $orderQuantity.trigger(\"focus\");\r\n\r\n $(\".js-modal-price-request-quantity-warning\").removeClass(\"d-none\");\r\n\r\n return;\r\n } else {\r\n $orderQuantity.parent().removeClass(\"has-error\");\r\n $(\".js-modal-price-request-quantity-warning\").addClass(\"d-none\");\r\n }\r\n\r\n const q = $.ajax({\r\n type: \"GET\",\r\n url: $this.prop(\"href\"),\r\n data: {\r\n orderQuantity: $orderQuantity.val(),\r\n orderUnitName: $orderUnit.text()\r\n }\r\n });\r\n\r\n q.done((data) => {\r\n if (data.isSuccess) {\r\n toastr.success(data.message);\r\n }\r\n });\r\n\r\n q.fail((xhr, textStatus, errorThrown) => {\r\n toastr.error(errorThrown);\r\n });\r\n });\r\n }\r\n\r\n static initLogDownload() {\r\n const $body = $(\"body\");\r\n\r\n $body.off(\"click\", \".js-download\");\r\n $body.on(\"click\", \".js-download\", (e) => {\r\n const $this = $(e.target);\r\n const id = $this.data(\"id\");\r\n const url = $this.attr(\"href\") as string;\r\n Products.postLogDownload(id, url);\r\n });\r\n }\r\n\r\n static initScannerEvents() {\r\n const productDetailSourceEl = document.querySelector(\".js-product-detail--source\") as HTMLInputElement | null;\r\n\r\n if (productDetailSourceEl && productDetailSourceEl.value === \"scanner\") {\r\n DataLayerHelper.trackCustomEvent(\"search_scan_scan_succeeded\");\r\n return;\r\n }\r\n\r\n const productOverviewSourceEl = document.querySelector(\".js-product-overview--source\") as HTMLInputElement | null;\r\n const productOverviewProductCountEl = document.querySelector(\".js-product-overview--product-count\") as HTMLInputElement | null;\r\n\r\n if (productOverviewSourceEl && productOverviewSourceEl.value === \"scanner\") {\r\n if (productOverviewProductCountEl && productOverviewProductCountEl.value === \"0\") {\r\n DataLayerHelper.trackCustomEvent(\"search_scan_scan_failed\");\r\n return;\r\n }\r\n }\r\n }\r\n\r\n static initStockLoad() {\r\n // @ts-ignore\r\n if (Global.IsAuthenticated === false) {\r\n return;\r\n }\r\n\r\n Multilang.load();\r\n\r\n // detail page\r\n const productCode = $(\"[data-detail-code]\").data(\"detail-code\");\r\n\r\n if (typeof (productCode) !== \"undefined\") {\r\n const failMessage = Multilang.getTranslation(\"productdetail.message.warning.stock.indication\", \"De voorraad is een indicatie.\");\r\n Products.loadStock([productCode], true, failMessage);\r\n\r\n return;\r\n }\r\n\r\n // overview page\r\n const failMessage: string = Multilang.getTranslation(\"productoverview.message.warning.stock.indication\", \"De voorraad per product is een indicatie.\");\r\n Products.loadStock(CustomHelper.getListItemCodeList(), false, failMessage);\r\n }\r\n\r\n static loadOverview(url: string, isPush: boolean) {\r\n Multilang.load();\r\n\r\n console.log(\"🚀 loading overview\", url);\r\n\r\n CustomHelper.startLoad();\r\n\r\n $.get(url, (data) => {\r\n const $full = $(data);\r\n const content = $full.find(\"#ajax-container\");\r\n $(\"#ajax-container\").replaceWith(content);\r\n\r\n Products.initFilters();\r\n Products.initFavorites();\r\n Products.initPageSize();\r\n Products.initOrderProduct();\r\n Products.initChangeProduct();\r\n Products.initPriceRequest();\r\n\r\n const productCodeList = CustomHelper.getListItemCodeList();\r\n\r\n const failMessage = Multilang.getTranslation(\"productoverview.message.warning.stock.indication\", \"De voorraad per product is een indicatie.\");\r\n Products.loadStock(productCodeList, false, failMessage);\r\n\r\n CustomHelper.stopLoad();\r\n CustomHelper.smoothScrollTo(\"#ajax-container\");\r\n\r\n const title = $full.filter(\"title\").text();\r\n document.title = title;\r\n\r\n if (isPush) {\r\n history.pushState(null, title, url);\r\n }\r\n\r\n Products.filterItemClicked = false;\r\n\r\n // initialize Bootstrap components\r\n $$(`[data-bs-toggle=\"popover\"]`, el => new Popover(el));\r\n $$(`[data-bs-toggle=\"tooltip\"]`, el => new Tooltip(el));\r\n });\r\n }\r\n\r\n static loadStock(productCodeList: string[], forceUpdate: boolean, failMessage: string) {\r\n if (productCodeList === null || productCodeList.length === 0) {\r\n return;\r\n }\r\n\r\n for (let i = 0; i < productCodeList.length; i++) {\r\n $(\".js-product-stock-loader-\" + productCodeList[i]).removeClass(\"d-none\");\r\n }\r\n\r\n const q = $.ajax({\r\n type: \"get\",\r\n url: \"/api/products/stock\",\r\n data: {\r\n productCodeList: productCodeList,\r\n forceUpdate: forceUpdate\r\n },\r\n dataType: \"json\",\r\n traditional: true\r\n });\r\n\r\n q.done((productStockList) => {\r\n for (let i = 0; i < productCodeList.length; i++) {\r\n $(\".js-product-stock-loader-\" + productCodeList[i]).addClass(\"d-none\");\r\n }\r\n\r\n if (typeof productStockList === \"undefined\") {\r\n return;\r\n }\r\n\r\n for (let i = 0; i < productStockList.length; i++) {\r\n const productStock = productStockList[i];\r\n\r\n ProductHelper.updateStockIndicator(productStock);\r\n\r\n const $productStockCountSpan = $(\"span.js-product-stock-count-\" + productStock.productCode);\r\n $productStockCountSpan.text(productStock.stockCount);\r\n $productStockCountSpan.removeClass(\"d-none\");\r\n\r\n const $productStockCountInput = $(\"input.js-product-stock-count-\" + productStock.productCode);\r\n $productStockCountInput.val(productStock.stockCount);\r\n }\r\n });\r\n\r\n q.fail((xhr, textStatus, errorThrown) => {\r\n if (xhr.status === 500) {\r\n toastr[\"error\"](failMessage);\r\n }\r\n\r\n if (xhr.status === 503) {\r\n toastr[\"warning\"](failMessage);\r\n }\r\n\r\n for (let i = 0; i < productCodeList.length; i++) {\r\n $(\"span.js-product-stock-count-\" + productCodeList[i]).removeClass(\"d-none\"); // show fallback (data from DB)\r\n $(\".js-product-stock-loader-\" + productCodeList[i]).addClass(\"d-none\");\r\n }\r\n });\r\n }\r\n\r\n static postFavorite(productId: number, isFavorite: boolean, dataLayerProduct: NatchOsDataLayerProduct | null) {\r\n const postData = {\r\n productId: productId,\r\n isFavorite: isFavorite\r\n };\r\n\r\n const q = $.ajax({\r\n type: \"POST\",\r\n url: \"/api/products/setfavorite\",\r\n data: JSON.stringify(postData),\r\n contentType: \"application/json; charset=utf-8\"\r\n });\r\n\r\n q.done((data) => {\r\n console.log(\"Product #\" + productId + \" is set to favorite \" + isFavorite);\r\n\r\n if (dataLayerProduct) {\r\n const natchGtm = new NatchGtm(EventNamesSchema.OfficialGA4);\r\n natchGtm.trackAddToFavorites(dataLayerProduct);\r\n }\r\n });\r\n\r\n q.fail((xhr, textStatus, errorThrown) => {\r\n toastr[\"error\"](\"Could not set favorite.\");\r\n });\r\n }\r\n\r\n static postProductNumber(productId: number, productNumber: string) {\r\n Multilang.load();\r\n\r\n const postData = {\r\n productId: productId,\r\n productNumber: productNumber\r\n };\r\n\r\n axios\r\n .post(\"/api/products/set-product-number\", postData)\r\n .then((response: AxiosResponse) => response.data)\r\n .then(_ => {\r\n console.log(`Product #${productId} is set to product number ${productNumber}`);\r\n DataLayerHelper.trackCustomEvent(\"product_number_change\", productNumber);\r\n })\r\n .catch((error: AxiosError) => {\r\n console.error(error);\r\n\r\n toastr[\"error\"](Multilang.getTranslation(\"ChangeProductNumber.message.exception\", \"Er trad een fout op!\"));\r\n });\r\n }\r\n\r\n static postLogDownload(productId: number, url: string) {\r\n const postData = {\r\n productId: productId,\r\n url: url\r\n };\r\n\r\n const q = $.ajax({\r\n type: \"POST\",\r\n url: \"/api/products/logdownload\",\r\n data: JSON.stringify(postData),\r\n contentType: \"application/json; charset=utf-8\"\r\n });\r\n\r\n q.fail((xhr, textStatus, errorThrown) => {\r\n console.error(xhr);\r\n });\r\n }\r\n}\r\n","import 'toastr';\r\nimport $ from \"jquery\";\r\nimport QuantityValidator from \"../validators/quantity-validator\";\r\nimport CustomHelper from \"../helpers/custom-helper\";\r\nimport MiniBasket from \"../components/mini-basket\";\r\nimport Multilang from \"../utils/multilang\";\r\n\r\nexport default class Upload {\r\n static init() {\r\n this.initChangeQuantity();\r\n this.initChangeOrderUnit();\r\n this.initDeleteLine();\r\n this.initForm();\r\n }\r\n\r\n static initChangeQuantity() {\r\n const $form = $(\"#form-product-upload-data\");\r\n\r\n $form.off(\"change\", \".js-upload-quantity\");\r\n $form.on(\"change\", \".js-upload-quantity\", (e) => {\r\n this.changeQuantityData($(e.target).closest(\"tr\"), false);\r\n });\r\n }\r\n\r\n static initChangeOrderUnit() {\r\n const $form = $(\"#form-product-upload-data\");\r\n\r\n $form.off(\"change\", \".js-upload-order-unit\");\r\n $form.on(\"change\", \".js-upload-order-unit\", (e) => {\r\n this.changeQuantityData($(e.target).closest(\"tr\"), true);\r\n });\r\n }\r\n\r\n static initDeleteLine() {\r\n Multilang.load();\r\n\r\n const $form = $(\"#form-product-upload-data\");\r\n\r\n $form.off(\"click\", \".js-upload-delete\");\r\n $form.on(\"click\", \".js-upload-delete\", function() {\r\n const $container = $(this).closest(\"tr\");\r\n\r\n const confirmationMessage = Multilang.getTranslation(\"upload.message.confirm.delete\", \"Bent u zeker dat u deze lijn wenst te verwijderen?\");\r\n\r\n // @ts-ignore\r\n bootbox.confirm(confirmationMessage, function() {\r\n const $isDeleted = $container.find(\".js-upload-isdeleted\");\r\n\r\n $isDeleted.val(\"true\");\r\n $container.addClass(\"d-none\");\r\n });\r\n });\r\n }\r\n\r\n static initForm() {\r\n const $form = $(\"#form-product-upload-data\");\r\n\r\n $form.off(\"submit\");\r\n $form.on(\"submit\", (e) => {\r\n e.preventDefault();\r\n this.postUpload($form);\r\n });\r\n }\r\n\r\n static changeQuantityData($container: any, isChangeOrderUnit: boolean) {\r\n const $quantity = $container.find(\".js-upload-quantity\");\r\n const $quantityPrevious = $container.find(\".js-upload-quantity-previous\");\r\n const $quantityTotal = $container.find(\".js-upload-quantity-total\");\r\n const $orderUnit = $container.find(\".js-upload-order-unit\");\r\n\r\n const unitsPerPack = parseFloat($orderUnit.find(\"option:selected\").data(\"upp\"));\r\n\r\n const input = {\r\n requestedQuantity: parseFloat($quantity.val()),\r\n requestedUnitsPerPack: unitsPerPack,\r\n previousQuantity: parseFloat($quantityPrevious.val()),\r\n totalQuantity: parseFloat($quantityTotal.val()),\r\n minimumOrderQuantity: parseFloat($quantity.data(\"moq\")) / unitsPerPack,\r\n incrementOrderQuantity: parseFloat($quantity.data(\"ioq\")) / unitsPerPack,\r\n restOrderQuantity: parseFloat($quantity.data(\"roq\")),\r\n roundType: $quantity.data(\"rnd-type\"),\r\n roundUnitsPerPack: $quantity.data(\"rnd-upp\"),\r\n roundOrderUnitId: $quantity.data(\"rnd-id\")\r\n };\r\n\r\n // set min/step for [type=number]\r\n $quantity.prop(\"min\", input.minimumOrderQuantity);\r\n $quantity.prop(\"step\", input.incrementOrderQuantity);\r\n\r\n // set correct quantity + rounding\r\n const validationData = QuantityValidator.validate(input, isChangeOrderUnit);\r\n\r\n $quantity.val(validationData.correctQuantity);\r\n $quantityPrevious.val(validationData.correctQuantity);\r\n $quantityTotal.val(validationData.correctQuantity * input.requestedUnitsPerPack);\r\n\r\n if (validationData.isRounded) {\r\n $orderUnit.val(validationData.correctOrderUnitId);\r\n }\r\n }\r\n\r\n static postUpload($form) {\r\n Multilang.load();\r\n\r\n CustomHelper.setLoadingButton($form.find(\"[type=submit]\"), true, \"\");\r\n\r\n const q = $.ajax({\r\n type: \"POST\",\r\n url: $form.attr(\"action\"),\r\n data: $form.serialize()\r\n });\r\n\r\n q.done((data) => {\r\n if (data.isSuccess) {\r\n toastr[\"success\"](data.message);\r\n }\r\n\r\n if (data.isWarning) {\r\n toastr[\"warning\"](data.message);\r\n }\r\n\r\n $(\"#upload-data\").html(data.view);\r\n\r\n MiniBasket.load();\r\n\r\n const buttonText = Multilang.getTranslation(\"upload.action.add\", \"Toevoegen\");\r\n CustomHelper.setLoadingButton($form.find(\"[type=submit]\"), false, buttonText);\r\n });\r\n\r\n q.fail((xhr, textStatus, errorThrown) => {\r\n console.error(xhr);\r\n console.error(textStatus);\r\n console.error(errorThrown);\r\n\r\n toastr[\"error\"](\"Could not upload data.\");\r\n\r\n const buttonText = Multilang.getTranslation(\"upload.action.add\", \"Toevoegen\");\r\n CustomHelper.setLoadingButton($form.find(\"[type=submit]\"), false, buttonText);\r\n });\r\n }\r\n}","import $ from \"jquery\";\r\nimport CustomHelper from \"../helpers/custom-helper\";\r\nimport Multilang from \"../utils/multilang\";\r\nimport Upload from \"./upload\";\r\n\r\ninterface TerminalData {\r\n selfHostUrl: string;\r\n selfHostFallbackUrl: string;\r\n customerId: number;\r\n personId: number;\r\n salesOrganizationId: number;\r\n customerType: string;\r\n languageCode: string;\r\n terminalType: string;\r\n}\r\n\r\nexport default class Terminal {\r\n static init() {\r\n // @ts-ignore\r\n if (typeof(terminalData) === \"undefined\") // \"terminalData\" is set on page\r\n {\r\n return;\r\n }\r\n\r\n // @ts-ignore\r\n const localTerminalData: TerminalData = terminalData;\r\n\r\n Multilang.load();\r\n\r\n // reset terminal config so the COM ports can be scanned again...\r\n Terminal.deleteTerminalConfigFile(localTerminalData, false);\r\n\r\n Terminal.toggleButton(\".js-application-push\", false);\r\n Terminal.toggleButton(\".js-articles-push\", false);\r\n\r\n $(\".js-application-delete\").on(\"click\", function() {\r\n Terminal.deleteApplicationFile(localTerminalData, false);\r\n });\r\n\r\n $(\".js-application-push\").on(\"click\", function() {\r\n Terminal.pushApplicationFile(localTerminalData, false);\r\n });\r\n\r\n $(\".js-articles-delete\").on(\"click\", function() {\r\n Terminal.deleteArticleFile(localTerminalData, false);\r\n });\r\n \r\n $(\".js-articles-push\").on(\"click\", function() {\r\n Terminal.pushArticleFile(localTerminalData, false);\r\n });\r\n\r\n $(\".js-refresh\").on(\"click\", function() {\r\n Terminal.checkApplicationFile(localTerminalData, false);\r\n });\r\n\r\n $(\".js-scan\").on(\"click\", function() {\r\n Terminal.checkScanFile(localTerminalData, false);\r\n });\r\n\r\n $(\".js-scan-delete\").on(\"click\", function() {\r\n Terminal.deleteScanFile(localTerminalData, false);\r\n });\r\n\r\n $(\".js-service-log-send\").on(\"click\", function() {\r\n Terminal.checkServiceLogFile(localTerminalData, false);\r\n });\r\n\r\n $(\".js-terminal-log-send\").on(\"click\", function() {\r\n Terminal.checkTerminalLogFile(localTerminalData, false);\r\n });\r\n }\r\n\r\n static checkApplicationFile(localTerminalData: TerminalData, isFallback: boolean) {\r\n const selfHostUrl = isFallback ? localTerminalData.selfHostFallbackUrl : localTerminalData.selfHostUrl;\r\n console.log(\"Check application file via \" + selfHostUrl);\r\n \r\n Terminal.disableAll();\r\n\r\n const qGet = $.ajax({\r\n type: \"GET\",\r\n url: selfHostUrl + \"/api/applicationfile\",\r\n data: {\r\n tt: localTerminalData.terminalType,\r\n l: localTerminalData.languageCode,\r\n ct: localTerminalData.customerType\r\n },\r\n dataType: \"json\",\r\n xhr: Terminal.clearRequestValidationToken,\r\n cache: false\r\n });\r\n\r\n qGet.done(function(dataGet, textStatusGet, xhrGet) {\r\n Terminal.enableAll();\r\n\r\n if (xhrGet.status === 200) {\r\n toastr[\"info\"](Multilang.getTranslation(\"terminal.message.application.found\", \"Een nieuw applicatie bestand werd gevonden.\"));\r\n\r\n Terminal.setAvailability(\".js-application-push\", true);\r\n Terminal.checkExecutionFile(true, localTerminalData, false);\r\n }\r\n\r\n if (xhrGet.status === 304) {\r\n Terminal.setAvailability(\".js-application-push\", false);\r\n Terminal.checkExecutionFile(false, localTerminalData, false);\r\n }\r\n });\r\n\r\n qGet.fail(function(xhrGet, textStatusGet, errorThrownGet) {\r\n console.warn(\"Exception while checking an application file (\" + xhrGet.status + \")\", xhrGet.responseText);\r\n\r\n Terminal.enableAll();\r\n Terminal.setAvailability(\".js-application-push\", false);\r\n\r\n if (xhrGet.status === 0) {\r\n if (!isFallback) {\r\n console.warn(\"The service TerminalCommunicator does not seem to be running. Retry...\");\r\n Terminal.checkApplicationFile(localTerminalData, true);\r\n return;\r\n }\r\n\r\n console.warn(\"The service TerminalCommunicator does not seem to be running.\");\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.service.notrunning\", \"De service TerminalCommunicator lijkt niet actief te zijn. Start de service adhv de knop 'Download scanner software'.\"));\r\n }\r\n\r\n if (xhrGet.status === 404) {\r\n toastr[\"warning\"](Multilang.getTranslation(\"terminal.message.terminal.notfound\", \"De scanner reageert niet. Zorg ervoor dat de scanner is aangesloten en op staat.\"));\r\n }\r\n\r\n if (xhrGet.status === 500) {\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.exception\", \"Er trad een fout op!\"));\r\n }\r\n });\r\n }\r\n\r\n static checkArticleFile(localTerminalData: TerminalData, isFallback: boolean) {\r\n const selfHostUrl = isFallback ? localTerminalData.selfHostFallbackUrl : localTerminalData.selfHostUrl;\r\n console.log(\"Check article file via \" + selfHostUrl);\r\n\r\n Terminal.disableAll();\r\n\r\n const qGet = $.ajax({\r\n type: \"GET\",\r\n url: selfHostUrl + \"/api/articlefile\",\r\n data: { \r\n l: localTerminalData.languageCode, \r\n ci: localTerminalData.customerId \r\n },\r\n dataType: \"json\",\r\n xhr: Terminal.clearRequestValidationToken,\r\n cache: false\r\n });\r\n\r\n qGet.done(function(dataGet, textStatusGet, xhrGet) {\r\n Terminal.enableAll();\r\n\r\n if (xhrGet.status === 200) {\r\n toastr[\"info\"](Multilang.getTranslation(\"terminal.message.article.found\", \"Een nieuwe artikels bestand werd gevonden.\"));\r\n Terminal.setAvailability(\".js-articles-push\", true);\r\n }\r\n\r\n if (xhrGet.status === 304) {\r\n Terminal.setAvailability(\".js-articles-push\", false);\r\n }\r\n });\r\n\r\n qGet.fail(function(xhrGet, textStatusGet, errorThrownGet) {\r\n console.warn(\"Exception while checking an article file (\" + xhrGet.status + \")\", xhrGet.responseText);\r\n\r\n Terminal.enableAll();\r\n Terminal.setAvailability(\".js-articles-push\", false);\r\n\r\n if (xhrGet.status === 0) {\r\n if (!isFallback) {\r\n console.warn(\"The service TerminalCommunicator does not seem to be running. Retry...\");\r\n Terminal.checkArticleFile(localTerminalData, true);\r\n return;\r\n }\r\n\r\n console.warn(\"The service TerminalCommunicator does not seem to be running.\");\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.service.notrunning\", \"De service TerminalCommunicator lijkt niet actief te zijn. Start de service adhv de knop 'Download scanner software'.\"));\r\n }\r\n\r\n if (xhrGet.status === 404) {\r\n toastr[\"warning\"](Multilang.getTranslation(\"terminal.message.terminal.notfound\", \"De scanner reageert niet. Zorg ervoor dat de scanner is aangesloten en op staat.\"));\r\n }\r\n\r\n if (xhrGet.status === 500) {\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.exception\", \"Er trad een fout op!\"));\r\n }\r\n });\r\n }\r\n \r\n static checkExecutionFile(isAvailableApplicationFile: boolean, localTerminalData: TerminalData, isFallback: boolean) {\r\n const selfHostUrl = isFallback ? localTerminalData.selfHostFallbackUrl : localTerminalData.selfHostUrl;\r\n console.log(\"Check execution file via \" + selfHostUrl);\r\n\r\n Terminal.disableAll();\r\n\r\n const qGet = $.ajax({\r\n type: \"GET\",\r\n url: selfHostUrl + \"/api/executionfile\",\r\n data: {\r\n tt: localTerminalData.terminalType,\r\n l: localTerminalData.languageCode,\r\n ct: localTerminalData.customerType\r\n },\r\n dataType: \"json\",\r\n xhr: Terminal.clearRequestValidationToken,\r\n cache: false\r\n });\r\n\r\n qGet.done(function(dataGet, textStatusGet, xhrGet) {\r\n Terminal.enableAll();\r\n\r\n if (xhrGet.status === 200) {\r\n toastr[\"info\"](Multilang.getTranslation(\"terminal.message.execution.found\", \"Een nieuw uitvoer bestand werd gevonden.\"));\r\n\r\n Terminal.setAvailability(\".js-application-push\", true);\r\n Terminal.checkArticleFile(localTerminalData, false);\r\n }\r\n\r\n if (xhrGet.status === 304) {\r\n Terminal.setAvailability(\".js-application-push\", isAvailableApplicationFile);\r\n Terminal.checkArticleFile(localTerminalData, false);\r\n }\r\n });\r\n\r\n qGet.fail(function(xhrGet, textStatusGet, errorThrownGet) {\r\n console.warn(\"Exception while checking an execution file (\" + xhrGet.status + \")\", xhrGet.responseText);\r\n\r\n Terminal.enableAll();\r\n Terminal.setAvailability(\".js-application-push\", false);\r\n\r\n if (xhrGet.status === 0) {\r\n if (!isFallback) {\r\n console.warn(\"The service TerminalCommunicator does not seem to be running. Retry...\");\r\n Terminal.checkExecutionFile(isAvailableApplicationFile, localTerminalData, true);\r\n return;\r\n }\r\n\r\n console.warn(\"The service TerminalCommunicator does not seem to be running.\");\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.service.notrunning\", \"De service TerminalCommunicator lijkt niet actief te zijn. Start de service adhv de knop 'Download scanner software'.\"));\r\n }\r\n\r\n if (xhrGet.status === 404) {\r\n toastr[\"warning\"](Multilang.getTranslation(\"terminal.message.terminal.notfound\", \"De scanner reageert niet. Zorg ervoor dat de scanner is aangesloten en op staat.\"));\r\n }\r\n\r\n if (xhrGet.status === 500) {\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.exception\", \"Er trad een fout op!\"));\r\n }\r\n });\r\n }\r\n\r\n static checkScanFile(localTerminalData: TerminalData, isFallback: boolean) {\r\n const selfHostUrl = isFallback ? localTerminalData.selfHostFallbackUrl : localTerminalData.selfHostUrl;\r\n console.log(\"Check scan file via \" + selfHostUrl);\r\n\r\n Terminal.disableAll();\r\n CustomHelper.setLoadingButton($(\".js-scan\"), true, \"\");\r\n\r\n const qGet = $.ajax({\r\n type: \"GET\",\r\n url: selfHostUrl + \"/api/scanfile\",\r\n data: { ct: localTerminalData.customerType, d: false },\r\n dataType: \"json\",\r\n xhr: Terminal.clearRequestValidationToken,\r\n cache: false\r\n });\r\n\r\n qGet.done(function(dataGet, textStatusGet, xhrGet) {\r\n if (xhrGet.status === 200) {\r\n toastr[\"info\"](Multilang.getTranslation(\"terminal.message.scan.found\", \"De gescande artikels werden gevonden en worden nu verstuurd naar het winkelmandje...\"));\r\n\r\n console.log(dataGet);\r\n Terminal.postScanFile(localTerminalData, dataGet);\r\n } else {\r\n CustomHelper.setLoadingButton($(\".js-scan\"), false, Multilang.getTranslation(\"terminal.action.validate\", \"Valideer\"));\r\n Terminal.enableAll();\r\n }\r\n });\r\n\r\n qGet.fail(function(xhrGet, textStatusGet, errorThrownGet) {\r\n console.warn(\"Exception while checking a scan file (\" + xhrGet.status + \")\", xhrGet.responseText);\r\n\r\n CustomHelper.setLoadingButton($(\".js-scan\"), false, Multilang.getTranslation(\"terminal.action.validate\", \"Valideer\"));\r\n Terminal.enableAll();\r\n\r\n if (xhrGet.status === 0) {\r\n if (!isFallback) {\r\n console.warn(\"The service TerminalCommunicator does not seem to be running. Retry...\");\r\n Terminal.checkScanFile(localTerminalData, true);\r\n return;\r\n }\r\n\r\n console.warn(\"The service TerminalCommunicator does not seem to be running.\");\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.service.notrunning\", \"De service TerminalCommunicator lijkt niet actief te zijn. Start de service adhv de knop 'Download scanner software'.\"));\r\n }\r\n\r\n if (xhrGet.status === 404) {\r\n if (xhrGet.responseText.indexOf(\"Scan file does not contain the right amount of data columns\") > 0) {\r\n toastr[\"warning\"](Multilang.getTranslation(\"terminal.message.scan.notvalid\", \"De gescande artikels zijn niet volledig. Controleer het scan-bestand op de scanner.\"));\r\n } else {\r\n toastr[\"warning\"](Multilang.getTranslation(\"terminal.message.scan.notfound\", \"De gescande artikels werden niet gevonden. Zorg ervoor dat de scanner is aangesloten en op staat.\"));\r\n }\r\n }\r\n\r\n if (xhrGet.status === 500) {\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.exception\", \"Er trad een fout op!\"));\r\n }\r\n });\r\n }\r\n\r\n static checkServiceLogFile(localTerminalData: TerminalData, isFallback: boolean) {\r\n const selfHostUrl = isFallback ? localTerminalData.selfHostFallbackUrl : localTerminalData.selfHostUrl;\r\n console.log(\"Check service log file via \" + selfHostUrl);\r\n\r\n Terminal.disableAll();\r\n CustomHelper.setLoadingButton($(\".js-service-log-send\"), true, \"\");\r\n\r\n const qGet = $.ajax({\r\n type: \"GET\",\r\n url: selfHostUrl + \"/api/servicelogfile\",\r\n dataType: \"json\",\r\n xhr: Terminal.clearRequestValidationToken,\r\n cache: false\r\n });\r\n\r\n qGet.done(function(dataGet, textStatusGet, xhrGet) {\r\n CustomHelper.setLoadingButton($(\".js-service-log-send\"), false, Multilang.getTranslation(\"terminal.action.send\", \"Versturen\"));\r\n Terminal.enableAll();\r\n\r\n if (xhrGet.status === 200) {\r\n toastr[\"info\"](Multilang.getTranslation(\"terminal.message.servicelog.found\", \"De service log werd gevonden en wordt nu verstuurd naar de website...\"));\r\n\r\n console.log(dataGet);\r\n Terminal.postServiceLog(localTerminalData, dataGet);\r\n }\r\n });\r\n\r\n qGet.fail(function(xhrGet, textStatusGet, errorThrownGet) {\r\n console.warn(\"Exception while checking a service log file (\" + xhrGet.status + \")\", xhrGet.responseText);\r\n\r\n CustomHelper.setLoadingButton($(\".js-service-log-send\"), false, Multilang.getTranslation(\"terminal.action.send\", \"Versturen\"));\r\n Terminal.enableAll();\r\n\r\n if (xhrGet.status === 0) {\r\n if (!isFallback) {\r\n console.warn(\"The service TerminalCommunicator does not seem to be running. Retry...\");\r\n Terminal.checkServiceLogFile(localTerminalData, true);\r\n return;\r\n }\r\n\r\n console.warn(\"The service TerminalCommunicator does not seem to be running.\");\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.service.notrunning\", \"De service TerminalCommunicator lijkt niet actief te zijn. Start de service adhv de knop 'Download scanner software'.\"));\r\n }\r\n\r\n if (xhrGet.status === 404) {\r\n toastr[\"warning\"](Multilang.getTranslation(\"terminal.message.servicelog.notfound\", \"The service log werd niet gevonden.Zorg ervoor dat de scanner is aangesloten en op staat.\"));\r\n }\r\n\r\n if (xhrGet.status === 500) {\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.exception\", \"Er trad een fout op!\"));\r\n }\r\n });\r\n }\r\n\r\n static checkTerminalLogFile(localTerminalData: TerminalData, isFallback: boolean) {\r\n const selfHostUrl = isFallback ? localTerminalData.selfHostFallbackUrl : localTerminalData.selfHostUrl;\r\n console.log(\"Check terminal log file via \" + selfHostUrl);\r\n\r\n Terminal.disableAll();\r\n CustomHelper.setLoadingButton($(\".js-terminal-log-send\"), true, \"\");\r\n\r\n const qGet = $.ajax({\r\n type: \"GET\",\r\n url: selfHostUrl + \"/api/terminallogfile\",\r\n dataType: \"json\",\r\n xhr: Terminal.clearRequestValidationToken,\r\n cache: false\r\n });\r\n\r\n qGet.done(function(dataGet, textStatusGet, xhrGet) {\r\n CustomHelper.setLoadingButton($(\".js-terminal-log-send\"), false, Multilang.getTranslation(\"terminal.action.send\", \"Versturen\"));\r\n Terminal.enableAll();\r\n\r\n if (xhrGet.status === 200) {\r\n toastr[\"info\"](Multilang.getTranslation(\"terminal.message.terminallog.found\", \"De scanner log werd gevonden en wordt nu verstuurd naar de website...\"));\r\n\r\n console.log(dataGet);\r\n Terminal.postTerminalLog(localTerminalData, dataGet);\r\n }\r\n });\r\n\r\n qGet.fail(function(xhrGet, textStatusGet, errorThrownGet) {\r\n console.warn(\"Exception while checking a terminal log file (\" + xhrGet.status + \")\", xhrGet.responseText);\r\n\r\n CustomHelper.setLoadingButton($(\".js-terminal-log-send\"), false, Multilang.getTranslation(\"terminal.action.send\", \"Versturen\"));\r\n Terminal.enableAll();\r\n\r\n if (xhrGet.status === 0) {\r\n if (!isFallback) {\r\n console.warn(\"The service TerminalCommunicator does not seem to be running. Retry...\");\r\n Terminal.checkTerminalLogFile(localTerminalData, true);\r\n return;\r\n }\r\n\r\n console.warn(\"The service TerminalCommunicator does not seem to be running.\");\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.service.notrunning\", \"De service TerminalCommunicator lijkt niet actief te zijn. Start de service adhv de knop 'Download scanner software'.\"));\r\n }\r\n\r\n if (xhrGet.status === 404) {\r\n toastr[\"warning\"](Multilang.getTranslation(\"terminal.message.terminallog.notfound\", \"De scanner log werd niet gevonden. Zorg ervoor dat de scanner is aangesloten en op staat.\"));\r\n }\r\n\r\n if (xhrGet.status === 500) {\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.exception\", \"Er trad een fout op!\"));\r\n }\r\n });\r\n }\r\n\r\n static deleteApplicationFile(localTerminalData: TerminalData, isFallback: boolean) {\r\n const selfHostUrl = isFallback ? localTerminalData.selfHostFallbackUrl : localTerminalData.selfHostUrl;\r\n console.log(\"Delete application file via \" + selfHostUrl);\r\n\r\n Terminal.disableAll();\r\n CustomHelper.setLoadingButton($(\".js-application-delete\"), true, \"\");\r\n\r\n const qPush = $.ajax({\r\n type: \"GET\",\r\n url: selfHostUrl + \"/api/applicationfiledelete\",\r\n dataType: \"json\",\r\n xhr: Terminal.clearRequestValidationToken\r\n });\r\n\r\n qPush.done(function(dataPush, textStatusPush, xhrPush) {\r\n CustomHelper.setLoadingButton($(\".js-application-delete\"), false, Multilang.getTranslation(\"terminal.action.delete\", \"Verwijderen\"));\r\n Terminal.enableAll();\r\n\r\n if (xhrPush.status === 200) {\r\n toastr[\"info\"](Multilang.getTranslation(\"terminal.message.application.success.delete\", \"Het applicatie bestand werd succesvol verwijderd.\"));\r\n\r\n Terminal.setAvailability(\".js-application-delete\", false);\r\n Terminal.deleteExecutionFile(localTerminalData, false);\r\n }\r\n });\r\n\r\n qPush.fail(function(xhrPush, textStatusPush, errorThrownPush) {\r\n console.warn(\"Exception while deleting an application file (\" + xhrPush.status + \")\", xhrPush.responseText);\r\n\r\n CustomHelper.setLoadingButton($(\".js-application-delete\"), false, Multilang.getTranslation(\"terminal.action.delete\", \"Verwijderen\"));\r\n Terminal.enableAll();\r\n\r\n if (xhrPush.status === 0) {\r\n if (!isFallback) {\r\n console.warn(\"The service TerminalCommunicator does not seem to be running. Retry...\");\r\n Terminal.deleteApplicationFile(localTerminalData, true);\r\n return;\r\n }\r\n\r\n console.warn(\"The service TerminalCommunicator does not seem to be running.\");\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.service.notrunning\", \"De service TerminalCommunicator lijkt niet actief te zijn. Start de service adhv de knop 'Download scanner software'.\"));\r\n }\r\n\r\n if (xhrPush.status === 404) {\r\n toastr[\"warning\"](Multilang.getTranslation(\"terminal.message.terminal.notfound\", \"De scanner reageert niet. Zorg ervoor dat de scanner is aangesloten en op staat.\"));\r\n }\r\n\r\n if (xhrPush.status === 500) {\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.exception\", \"Er trad een fout op!\"));\r\n }\r\n });\r\n }\r\n\r\n static deleteArticleFile(localTerminalData: TerminalData, isFallback: boolean) {\r\n const selfHostUrl = isFallback ? localTerminalData.selfHostFallbackUrl : localTerminalData.selfHostUrl;\r\n console.log(\"Delete article file via \" + selfHostUrl);\r\n\r\n Terminal.disableAll();\r\n CustomHelper.setLoadingButton($(\".js-articles-delete\"), true, \"\");\r\n\r\n const qPush = $.ajax({\r\n type: \"GET\",\r\n url: selfHostUrl + \"/api/articlefiledelete\",\r\n dataType: \"json\",\r\n xhr: Terminal.clearRequestValidationToken\r\n });\r\n\r\n qPush.done(function(dataPush, textStatusPush, xhrPush) {\r\n CustomHelper.setLoadingButton($(\".js-articles-delete\"), false, Multilang.getTranslation(\"terminal.action.delete\", \"Verwijderen\"));\r\n Terminal.enableAll();\r\n\r\n if (xhrPush.status === 200) {\r\n toastr[\"info\"](Multilang.getTranslation(\"terminal.message.article.success.delete\", \"Het artikel bestand werd succesvol verwijderd.\"));\r\n\r\n Terminal.setAvailability(\".js-articles-delete\", false);\r\n }\r\n });\r\n\r\n qPush.fail(function(xhrPush, textStatusPush, errorThrownPush) {\r\n console.warn(\"Exception while deleting an article file (\" + xhrPush.status + \")\", xhrPush.responseText);\r\n\r\n CustomHelper.setLoadingButton($(\".js-articles-delete\"), false, Multilang.getTranslation(\"terminal.action.delete\", \"Verwijderen\"));\r\n Terminal.enableAll();\r\n\r\n if (xhrPush.status === 0) {\r\n if (!isFallback) {\r\n console.warn(\"The service TerminalCommunicator does not seem to be running. Retry...\");\r\n Terminal.deleteArticleFile(localTerminalData, true);\r\n return;\r\n }\r\n\r\n console.warn(\"The service TerminalCommunicator does not seem to be running.\");\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.service.notrunning\", \"De service TerminalCommunicator lijkt niet actief te zijn. Start de service adhv de knop 'Download scanner software'.\"));\r\n }\r\n\r\n if (xhrPush.status === 404) {\r\n toastr[\"warning\"](Multilang.getTranslation(\"terminal.message.terminal.notfound\", \"De scanner reageert niet. Zorg ervoor dat de scanner is aangesloten en op staat.\"));\r\n }\r\n\r\n if (xhrPush.status === 500) {\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.exception\", \"Er trad een fout op!\"));\r\n }\r\n });\r\n }\r\n\r\n static deleteExecutionFile(localTerminalData: TerminalData, isFallback: boolean) {\r\n const selfHostUrl = isFallback ? localTerminalData.selfHostFallbackUrl : localTerminalData.selfHostUrl;\r\n console.log(\"Delete execution file via \" + selfHostUrl);\r\n \r\n Terminal.disableAll();\r\n CustomHelper.setLoadingButton($(\".js-application-delete\"), true, \"\");\r\n\r\n const qPush = $.ajax({\r\n type: \"GET\",\r\n url: selfHostUrl + \"/api/executionfiledelete\",\r\n dataType: \"json\",\r\n xhr: Terminal.clearRequestValidationToken\r\n });\r\n\r\n qPush.done(function(dataPush, textStatusPush, xhrPush) {\r\n CustomHelper.setLoadingButton($(\".js-application-delete\"), false, Multilang.getTranslation(\"terminal.action.delete\", \"Verwijderen\"));\r\n Terminal.enableAll();\r\n\r\n if (xhrPush.status === 200) {\r\n toastr[\"info\"](Multilang.getTranslation(\"terminal.message.execution.success.delete\", \"Het uitvoer bestand werd succesvol verwijderd.\"));\r\n\r\n Terminal.setAvailability(\".js-application-delete\", false);\r\n }\r\n });\r\n\r\n qPush.fail(function(xhrPush, textStatusPush, errorThrownPush) {\r\n console.warn(\"Exception while deleting an execution file (\" + xhrPush.status + \")\", xhrPush.responseText);\r\n\r\n CustomHelper.setLoadingButton($(\".js-application-delete\"), false, Multilang.getTranslation(\"terminal.action.delete\", \"Verwijderen\"));\r\n Terminal.enableAll();\r\n\r\n if (xhrPush.status === 0) {\r\n if (!isFallback) {\r\n console.warn(\"The service TerminalCommunicator does not seem to be running. Retry...\");\r\n Terminal.deleteExecutionFile(localTerminalData, true);\r\n return;\r\n }\r\n\r\n console.warn(\"The service TerminalCommunicator does not seem to be running.\");\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.service.notrunning\", \"De service TerminalCommunicator lijkt niet actief te zijn. Start de service adhv de knop 'Download scanner software'.\"));\r\n }\r\n\r\n if (xhrPush.status === 404) {\r\n toastr[\"warning\"](Multilang.getTranslation(\"terminal.message.terminal.notfound\", \"De scanner reageert niet. Zorg ervoor dat de scanner is aangesloten en op staat.\"));\r\n }\r\n\r\n if (xhrPush.status === 500) {\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.exception\", \"Er trad een fout op!\"));\r\n }\r\n });\r\n }\r\n\r\n static deleteScanFile(localTerminalData: TerminalData, isFallback: boolean) {\r\n const selfHostUrl = isFallback ? localTerminalData.selfHostFallbackUrl : localTerminalData.selfHostUrl;\r\n console.log(\"Delete scan file via \" + selfHostUrl);\r\n\r\n Terminal.disableAll();\r\n CustomHelper.setLoadingButton($(\".js-scan-delete\"), true, \"\");\r\n\r\n const qPush = $.ajax({\r\n type: \"GET\",\r\n url: selfHostUrl + \"/api/scanfiledelete\",\r\n dataType: \"json\",\r\n xhr: Terminal.clearRequestValidationToken\r\n });\r\n\r\n qPush.done(function(dataPush, textStatusPush, xhrPush) {\r\n CustomHelper.setLoadingButton($(\".js-scan-delete\"), false, Multilang.getTranslation(\"terminal.action.delete.scan\", \"Gescande artikels verwijderen\"));\r\n Terminal.enableAll();\r\n\r\n if (xhrPush.status === 200) {\r\n toastr[\"info\"](Multilang.getTranslation(\"terminal.message.scan.success.delete\", \"De gescande artikels werden succesvol verwijderd.\"));\r\n\r\n Terminal.setAvailability(\".js-scan-delete\", false);\r\n }\r\n });\r\n\r\n qPush.fail(function(xhrPush, textStatusPush, errorThrownPush) {\r\n console.warn(\"Exception while deleting a scan file (\" + xhrPush.status + \")\", xhrPush.responseText);\r\n\r\n CustomHelper.setLoadingButton($(\".js-scan-delete\"), false, Multilang.getTranslation(\"terminal.action.delete\", \"Verwijderen\"));\r\n Terminal.enableAll();\r\n\r\n if (xhrPush.status === 0) {\r\n if (!isFallback) {\r\n console.warn(\"The service TerminalCommunicator does not seem to be running. Retry...\");\r\n Terminal.deleteScanFile(localTerminalData, true);\r\n return;\r\n }\r\n\r\n console.warn(\"The service TerminalCommunicator does not seem to be running.\");\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.service.notrunning\", \"De service TerminalCommunicator lijkt niet actief te zijn. Start de service adhv de knop 'Download scanner software'.\"));\r\n }\r\n\r\n if (xhrPush.status === 404) {\r\n toastr[\"warning\"](Multilang.getTranslation(\"terminal.message.scan.notfound\", \"De gescande artikels werden niet gevonden. Zorg ervoor dat de scanner is aangesloten en op staat.\"));\r\n }\r\n\r\n if (xhrPush.status === 500) {\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.exception\", \"Er trad een fout op!\"));\r\n }\r\n });\r\n }\r\n\r\n static deleteTerminalConfigFile(localTerminalData: TerminalData, isFallback: boolean) {\r\n const selfHostUrl = isFallback ? localTerminalData.selfHostFallbackUrl : localTerminalData.selfHostUrl;\r\n console.log(\"Delete terminal config file via \" + selfHostUrl);\r\n\r\n const qPush = $.ajax({\r\n type: \"GET\",\r\n url: selfHostUrl + \"/api/terminalconfigfiledelete\",\r\n dataType: \"json\",\r\n xhr: Terminal.clearRequestValidationToken\r\n });\r\n\r\n qPush.done(function(dataPush, textStatusPush, xhrPush) {\r\n // do nothing\r\n });\r\n\r\n qPush.fail(function(xhrPush, textStatusPush, errorThrownPush) {\r\n console.warn(\r\n \"Exception while deleting a terminal config file (\" + xhrPush.status + \")\",\r\n xhrPush.responseText\r\n );\r\n\r\n if (xhrPush.status === 0) {\r\n if (!isFallback) {\r\n console.warn(\"The service TerminalCommunicator does not seem to be running. Retry...\");\r\n Terminal.deleteTerminalConfigFile(localTerminalData, true);\r\n return;\r\n }\r\n\r\n console.warn(\"The service TerminalCommunicator does not seem to be running.\");\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.service.notrunning\", \"De service TerminalCommunicator lijkt niet actief te zijn. Start de service adhv de knop 'Download scanner software'.\"));\r\n }\r\n\r\n if (xhrPush.status === 500) {\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.exception\", \"Er trad een fout op!\"));\r\n }\r\n });\r\n }\r\n\r\n static postScanFile(localTerminalData: TerminalData, data: any) {\r\n const postData = {\r\n customerId: localTerminalData.customerId,\r\n personId: localTerminalData.personId,\r\n salesOrganizationId: localTerminalData.salesOrganizationId,\r\n lines: data\r\n };\r\n\r\n const qPost = $.ajax({\r\n type: \"POST\",\r\n url: \"/upload/validatescanfile\",\r\n data: JSON.stringify(postData),\r\n contentType: \"application/json; charset=utf-8\"\r\n });\r\n\r\n qPost.done(function(dataPost, textStatusPost, xhrPost) {\r\n toastr[\"info\"](Multilang.getTranslation(\"terminal.message.scan.success\", \"De gescande artikels werden succesvol gevalideerd.\"));\r\n\r\n $(\"#upload-data\").html(dataPost.view);\r\n\r\n Upload.init();\r\n\r\n CustomHelper.setLoadingButton($(\".js-scan\"), false, Multilang.getTranslation(\"terminal.action.validate\", \"Valideer\"));\r\n Terminal.enableAll();\r\n });\r\n\r\n qPost.fail(function(xhrPost, textStatusPost, errorThrownPost) {\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.exception\", \"Er trad een fout op!\"));\r\n\r\n CustomHelper.setLoadingButton($(\".js-scan\"), false, Multilang.getTranslation(\"terminal.action.validate\", \"Valideer\"));\r\n Terminal.enableAll();\r\n });\r\n }\r\n\r\n static postServiceLog(localTerminalData: TerminalData, data: any) {\r\n const postData = {\r\n customerId: localTerminalData.customerId,\r\n personId: localTerminalData.personId,\r\n logs: data\r\n };\r\n\r\n const qPost = $.ajax({\r\n type: \"POST\",\r\n url: \"/api/servicelog\",\r\n data: JSON.stringify(postData),\r\n contentType: \"application/json; charset=utf-8\"\r\n });\r\n\r\n qPost.done(function(dataPost, textStatusPost, xhrPost) {\r\n toastr[\"info\"](Multilang.getTranslation(\"terminal.message.servicelog.success\", \"De service log werd succesvol verstuurd.\"));\r\n });\r\n\r\n qPost.fail(function(xhrPost, textStatusPost, errorThrownPost) {\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.exception\", \"Er trad een fout op!\"));\r\n });\r\n }\r\n\r\n static postTerminalLog(localTerminalData: TerminalData, data: any) {\r\n const postData = {\r\n customerId: localTerminalData.customerId,\r\n personId: localTerminalData.personId,\r\n logs: data\r\n };\r\n\r\n const qPost = $.ajax({\r\n type: \"POST\",\r\n url: \"/api/terminallog\",\r\n data: JSON.stringify(postData),\r\n contentType: \"application/json; charset=utf-8\"\r\n });\r\n\r\n qPost.done(function(dataPost, textStatusPost, xhrPost) {\r\n toastr[\"info\"](Multilang.getTranslation(\"terminal.message.terminallog.success\", \"De scanner log werd succesvol verstuurd.\"));\r\n });\r\n\r\n qPost.fail(function(xhrPost, textStatusPost, errorThrownPost) {\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.exception\", \"Er trad een fout op!\"));\r\n });\r\n }\r\n\r\n static pushApplicationFile(localTerminalData: TerminalData, isFallback: boolean) {\r\n const selfHostUrl = isFallback ? localTerminalData.selfHostFallbackUrl : localTerminalData.selfHostUrl;\r\n console.log(\"Push application file via \" + selfHostUrl);\r\n\r\n Terminal.disableAll();\r\n CustomHelper.setLoadingButton($(\".js-application-push\"), true, \"\");\r\n\r\n const qPush = $.ajax({\r\n type: \"GET\",\r\n url: selfHostUrl + \"/api/applicationfilepush\",\r\n dataType: \"json\",\r\n xhr: Terminal.clearRequestValidationToken\r\n });\r\n\r\n qPush.done(function(dataPush, textStatusPush, xhrPush) {\r\n CustomHelper.setLoadingButton($(\".js-application-push\"), false, Multilang.getTranslation(\"terminal.action.update\", \"Aanpassen\"));\r\n Terminal.enableAll();\r\n\r\n if (xhrPush.status === 200) {\r\n toastr[\"info\"](Multilang.getTranslation(\"terminal.message.application.success\", \"Het applicatie bestand werd succesvol overgezet.\"));\r\n\r\n Terminal.setAvailability(\".js-application-push\", false);\r\n Terminal.pushExecutionFile(localTerminalData, false);\r\n }\r\n });\r\n\r\n qPush.fail(function(xhrPush, textStatusPush, errorThrownPush) {\r\n console.warn(\"Exception while pushing an application file (\" + xhrPush.status + \")\", xhrPush.responseText);\r\n\r\n CustomHelper.setLoadingButton($(\".js-application-push\"), false, Multilang.getTranslation(\"terminal.action.update\", \"Aanpassen\"));\r\n Terminal.enableAll();\r\n\r\n if (xhrPush.status === 0) {\r\n if (!isFallback) {\r\n console.warn(\"The service TerminalCommunicator does not seem to be running. Retry...\");\r\n Terminal.pushApplicationFile(localTerminalData, true);\r\n return;\r\n }\r\n\r\n console.warn(\"The service TerminalCommunicator does not seem to be running.\");\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.service.notrunning\", \"De service TerminalCommunicator lijkt niet actief te zijn. Start de service adhv de knop 'Download scanner software'.\"));\r\n }\r\n\r\n if (xhrPush.status === 404) {\r\n toastr[\"warning\"](Multilang.getTranslation(\"terminal.message.execution.fail\", \"Het applicatie bestand werd niet overgezet. Zorg ervoor dat de scanner is aangesloten en op staat.\"));\r\n }\r\n\r\n if (xhrPush.status === 500) {\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.exception\", \"Er trad een fout op!\"));\r\n }\r\n });\r\n }\r\n\r\n static pushArticleFile(localTerminalData: TerminalData, isFallback: boolean) {\r\n const selfHostUrl = isFallback ? localTerminalData.selfHostFallbackUrl : localTerminalData.selfHostUrl;\r\n console.log(\"Push article file via \" + selfHostUrl);\r\n\r\n Terminal.disableAll();\r\n CustomHelper.setLoadingButton($(\".js-articles-push\"), true, \"\");\r\n\r\n const qPush = $.ajax({\r\n type: \"GET\",\r\n url: selfHostUrl + \"/api/articlefilepush\",\r\n dataType: \"json\",\r\n xhr: Terminal.clearRequestValidationToken\r\n });\r\n\r\n qPush.done(function(dataPush, textStatusPush, xhrPush) {\r\n CustomHelper.setLoadingButton($(\".js-articles-push\"), false, Multilang.getTranslation(\"terminal.action.update\", \"Aanpassen\"));\r\n Terminal.enableAll();\r\n\r\n if (xhrPush.status === 200) {\r\n toastr[\"info\"](Multilang.getTranslation(\"terminal.message.article.success\", \"Het artikel bestand werd succesvol overgezet.\"));\r\n\r\n Terminal.setAvailability(\".js-articles-push\", false);\r\n }\r\n });\r\n\r\n qPush.fail(function(xhrPush, textStatusPush, errorThrownPush) {\r\n console.warn(\"Exception while pushing an article file (\" + xhrPush.status + \")\", xhrPush.responseText);\r\n\r\n CustomHelper.setLoadingButton($(\".js-articles-push\"), false, Multilang.getTranslation(\"terminal.action.update\", \"Aanpassen\"));\r\n Terminal.enableAll();\r\n\r\n if (xhrPush.status === 0) {\r\n if (!isFallback) {\r\n console.warn(\"The service TerminalCommunicator does not seem to be running. Retry...\");\r\n Terminal.pushArticleFile(localTerminalData, true);\r\n return;\r\n }\r\n\r\n console.warn(\"The service TerminalCommunicator does not seem to be running.\");\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.service.notrunning\", \"De service TerminalCommunicator lijkt niet actief te zijn. Start de service adhv de knop 'Download scanner software'.\"));\r\n }\r\n\r\n if (xhrPush.status === 404) {\r\n toastr[\"warning\"](Multilang.getTranslation(\"terminal.message.article.fail\", \"Het artikel bestand werd niet overgezet. Zorg ervoor dat de scanner is aangesloten en op staat.\"));\r\n }\r\n\r\n if (xhrPush.status === 500) {\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.exception\", \"Er trad een fout op!\"));\r\n }\r\n });\r\n }\r\n\r\n static pushExecutionFile(localTerminalData: TerminalData, isFallback: boolean) {\r\n const selfHostUrl = isFallback ? localTerminalData.selfHostFallbackUrl : localTerminalData.selfHostUrl;\r\n console.log(\"Push execution file via \" + selfHostUrl);\r\n \r\n Terminal.disableAll();\r\n CustomHelper.setLoadingButton($(\".js-application-push\"), true, \"\");\r\n\r\n const qPush = $.ajax({\r\n type: \"GET\",\r\n url: selfHostUrl + \"/api/executionfilepush\",\r\n dataType: \"json\",\r\n xhr: Terminal.clearRequestValidationToken\r\n });\r\n\r\n qPush.done(function(dataPush, textStatusPush, xhrPush) {\r\n CustomHelper.setLoadingButton($(\".js-application-push\"), false, Multilang.getTranslation(\"terminal.action.update\", \"Aanpassen\"));\r\n Terminal.enableAll();\r\n\r\n if (xhrPush.status === 200) {\r\n toastr[\"info\"](Multilang.getTranslation(\"terminal.message.execution.success\", \"Het uitvoer bestand werd succesvol overgezet.\"));\r\n\r\n Terminal.setAvailability(\".js-application-push\", false);\r\n }\r\n });\r\n\r\n qPush.fail(function(xhrPush, textStatusPush, errorThrownPush) {\r\n console.warn(\"Exception while pushing an execution file (\" + xhrPush.status + \")\", xhrPush.responseText);\r\n\r\n CustomHelper.setLoadingButton($(\".js-application-push\"), false, Multilang.getTranslation(\"terminal.action.update\", \"Aanpassen\"));\r\n Terminal.enableAll();\r\n\r\n if (xhrPush.status === 0) {\r\n if (!isFallback) {\r\n console.warn(\"The service TerminalCommunicator does not seem to be running. Retry...\");\r\n Terminal.pushExecutionFile(localTerminalData, true);\r\n return;\r\n }\r\n\r\n console.warn(\"The service TerminalCommunicator does not seem to be running.\");\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.service.notrunning\", \"De service TerminalCommunicator lijkt niet actief te zijn. Start de service adhv de knop 'Download scanner software'.\"));\r\n }\r\n\r\n if (xhrPush.status === 404) {\r\n toastr[\"warning\"](Multilang.getTranslation(\"terminal.message.execution.fail\", \"Het uitvoer bestand werd niet overgezet. Zorg ervoor dat de scanner is aangesloten en op staat.\"));\r\n }\r\n\r\n if (xhrPush.status === 500) {\r\n toastr[\"error\"](Multilang.getTranslation(\"terminal.message.exception\", \"Er trad een fout op!\"));\r\n }\r\n });\r\n }\r\n\r\n static clearRequestValidationToken(): XMLHttpRequest {\r\n // @ts-ignore\r\n const xhr = $.ajaxSettings.xhr() as XMLHttpRequest;\r\n\r\n const setRequestHeader = xhr.setRequestHeader;\r\n xhr.setRequestHeader = function(name, value) {\r\n if (name === \"__RequestVerificationToken\") return;\r\n setRequestHeader.call(this, name, value);\r\n };\r\n\r\n return xhr;\r\n }\r\n\r\n static setAvailability(target: string, isAvailable: boolean) {\r\n const $target = $(target);\r\n\r\n if (isAvailable) {\r\n $target.removeClass(\"btn-secondary\").addClass(\"btn-primary\");\r\n } else {\r\n $target.removeClass(\"btn-primary\").addClass(\"btn-secondary\");\r\n }\r\n }\r\n\r\n static enableAll() {\r\n Terminal.toggleButton(\".js-scan\", true);\r\n Terminal.toggleButton(\".js-scan-delete\", true);\r\n Terminal.toggleButton(\".js-refresh\", true);\r\n Terminal.toggleButton(\".js-application-push\", true);\r\n Terminal.toggleButton(\".js-articles-push\", true);\r\n Terminal.toggleButton(\".js-application-delete\", true);\r\n Terminal.toggleButton(\".js-articles-delete\", true);\r\n Terminal.toggleButton(\".js-service-log-send\", true);\r\n Terminal.toggleButton(\".js-terminal-log-send\", true);\r\n }\r\n\r\n static disableAll() {\r\n Terminal.toggleButton(\".js-scan\", false);\r\n Terminal.toggleButton(\".js-scan-delete\", false);\r\n Terminal.toggleButton(\".js-refresh\", false);\r\n Terminal.toggleButton(\".js-application-push\", false);\r\n Terminal.toggleButton(\".js-articles-push\", false);\r\n Terminal.toggleButton(\".js-application-delete\", false);\r\n Terminal.toggleButton(\".js-articles-delete\", false);\r\n Terminal.toggleButton(\".js-service-log-send\", false);\r\n Terminal.toggleButton(\".js-terminal-log-send\", false);\r\n }\r\n\r\n static toggleButton(target: string, isEnabled: boolean) {\r\n if (isEnabled) {\r\n $(target).removeAttr(\"disabled\");\r\n } else {\r\n $(target).attr(\"disabled\", \"disabled\");\r\n }\r\n }\r\n}","interface String {\r\n format: any;\r\n slugify(): string;\r\n toArray: any;\r\n toToastrMessageType(): string;\r\n}\r\n\r\nString.prototype.format = function () {\r\n let args = arguments;\r\n return (this as string).replace(/{(\\d+)}/g, function (match, number) {\r\n return typeof args[number] != \"undefined\" ? args[number] : match;\r\n });\r\n};\r\n\r\nString.prototype.slugify = function () {\r\n let stringValue = this as string;\r\n\r\n stringValue = stringValue.replace(/^\\s+|\\s+$/g, \"\");\r\n\r\n // make the string lowercase\r\n stringValue = stringValue.toLowerCase();\r\n\r\n // remove accents, swap ñ for n, etc\r\n const from = \"ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđßÆa·/_,:;\";\r\n const to = \"AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa------\";\r\n for (let i = 0, l = from.length ; i < l ; i++) {\r\n stringValue = stringValue.replace(new RegExp(from.charAt(i), \"g\"), to.charAt(i));\r\n }\r\n\r\n // remove invalid chars\r\n stringValue = stringValue.replace(/[^a-z0-9 -]/g, \"\")\r\n // collapse whitespace and replace by -\r\n .replace(/\\s+/g, \"-\")\r\n // collapse dashes\r\n .replace(/-+/g, \"-\");\r\n\r\n return stringValue;\r\n}\r\n\r\nString.prototype.toArray = function () {\r\n return (this as string).replace(/\\[|\\]/g, \"\").split(\",\") as Array;\r\n};\r\n\r\nString.prototype.toToastrMessageType = function () {\r\n const messageTypeList = {\r\n Success: \"success\",\r\n Error: \"error\",\r\n Information: \"info\",\r\n Warning: \"warn\",\r\n };\r\n\r\n return messageTypeList[this as string];\r\n};\r\n","import 'toastr';\r\nimport axios, { AxiosError, AxiosResponse } from \"axios\";\r\nimport Multilang from \"../utils/multilang\";\r\nimport \"../extensions/string-extensions\";\r\n\r\nexport default class PostalCodeValidator {\r\n static validate(postalCode: string, countryId: number, countryName: string) {\r\n Multilang.load();\r\n\r\n const postData = {\r\n postalCode: postalCode,\r\n countryId: countryId\r\n };\r\n\r\n axios\r\n .post(\"/api/validation/validate-postal-code\", postData)\r\n .then((response: AxiosResponse) => response.data)\r\n .then(data => {\r\n if (!data) {\r\n const msg: string = Multilang.getTranslation(\"ValidatePostalCode.message.NOK\", \"De postcode {0} opgegeven voor {1} heeft geen correcte vorm.\");\r\n toastr[\"error\"](msg.format(postalCode, countryName));\r\n } else {\r\n const msg: string = Multilang.getTranslation(\"ValidatePostalCode.message.OK\", \"De postcode {0} opgegeven voor {1} heeft een correcte vorm.\");\r\n toastr[\"success\"](msg.format(postalCode, countryName));\r\n }\r\n })\r\n .catch((error: AxiosError) => {\r\n console.error(error);\r\n\r\n toastr[\"error\"](\"Could not validate postal code.\");\r\n });\r\n }\r\n}\r\n","import 'toastr';\r\nimport $ from \"jquery\";\r\nimport Datepicker from \"js-datepicker\";\r\nimport PostalCodeValidator from \"../validators/postal-code-validator\";\r\nimport { format, parse } from \"date-fns\";\r\n\r\nexport default class BasketStep2 {\r\n static init() {\r\n this.initDropdown();\r\n this.initDatePicker();\r\n this.initDeliveryAddressValidation();\r\n }\r\n\r\n static initDropdown() {\r\n $(\".js-checkout-delivery-address-change\").on(\"change\", (e) => {\r\n const selectedValue = $(e.target)\r\n .find(\"option:selected\")\r\n .val();\r\n \r\n if (selectedValue === null || selectedValue === \"-1\") {\r\n $(\".js-checkout-delivery-address\").html(\"\");\r\n $(\"#form-delivery-address\").removeClass(\"d-none\");\r\n } else {\r\n this.getDeliveryAddress(selectedValue as number);\r\n }\r\n });\r\n }\r\n\r\n static initDatePicker() {\r\n const transferDateSelector = \"#datepicker-transfer\";\r\n\r\n const $transferDate = $(transferDateSelector);\r\n const $disabledDates = $(\".js-disabled-dates\");\r\n \r\n if ($transferDate.length === 0 || $disabledDates.length === 0) {\r\n return;\r\n }\r\n \r\n const disabledDates = JSON.parse($disabledDates.val() as string);\r\n\r\n // convert with getTime() = best way to compare dates\r\n const disabledTimeList: number[] = [];\r\n for (let i = 0; i < disabledDates.length; i++) {\r\n disabledTimeList.push(new Date(disabledDates[i]).getTime());\r\n }\r\n \r\n const today = new Date();\r\n today.setHours(0, 0, 0, 0);\r\n\r\n const todayWithinThreeMonths = new Date();\r\n todayWithinThreeMonths.setMonth(todayWithinThreeMonths.getMonth() + 3);\r\n \r\n // https://www.npmjs.com/package/js-datepicker\r\n const options = {\r\n startDay: 1,\r\n disableYearOverlay: true,\r\n disabler: (date: Date) => {\r\n return $.inArray(date.getTime(), disabledTimeList) > -1 || date <= today || date > todayWithinThreeMonths;\r\n },\r\n formatter: (input: any, date: Date, instance: any) => {\r\n input.value = format(date, \"dd/MM/yyyy\");\r\n },\r\n onSelect: (instance: any, date: Date) => {\r\n $(\"#btn-go-to-step-3\").removeAttr(\"disabled\");\r\n },\r\n };\r\n\r\n const datepickerTransferDate = Datepicker(transferDateSelector, options);\r\n\r\n const dateValue = $transferDate.val() as string;\r\n const parsedDateValue = parse(dateValue, \"dd/MM/yyyy\", new Date());\r\n datepickerTransferDate.setDate(parsedDateValue, true);\r\n\r\n const $transferDateIcon = $transferDate.closest(\".input-group\").find(`[type=\"button\"]`);\r\n $transferDateIcon.on(\"click\", (e: JQueryEventObject) => {\r\n e.stopPropagation();\r\n datepickerTransferDate.show();\r\n });\r\n }\r\n\r\n static initDeliveryAddressValidation() {\r\n $(\"#js-delivery-address__form\").on(\r\n \"change\",\r\n \"#alternate-delivery-address-postal-code, #alternate-delivery-address-country-name\",\r\n (e) => {\r\n const postalCode = $(\"#alternate-delivery-address-postal-code\").val() as string;\r\n \r\n if (postalCode !== \"\") {\r\n const $selectedCountry = $(\"#alternate-delivery-address-country-name\").find(\":selected\");\r\n const countryId = $selectedCountry.val() as number;\r\n const countryName = $selectedCountry.text();\r\n\r\n PostalCodeValidator.validate(postalCode, countryId, countryName);\r\n }\r\n }\r\n );\r\n }\r\n\r\n static getDeliveryAddress(deliveryAddressId: number) {\r\n const q = $.ajax({\r\n type: \"GET\",\r\n url: \"/api/shippingaddress/getdeliveryaddress\",\r\n data: { deliveryAddressId: deliveryAddressId },\r\n contentType: \"application/json; charset=utf-8\"\r\n });\r\n\r\n q.done((data) => {\r\n $(\".js-checkout-delivery-address\").html(data);\r\n $(\"#form-delivery-address\").addClass(\"d-none\");\r\n });\r\n\r\n q.fail((xhr, textStatus, errorThrown) => {\r\n toastr[\"error\"](\"Could not get delivery address.\");\r\n });\r\n }\r\n}","import $ from \"jquery\";\r\nimport MessageDialog from \"../components/bs5-message-dialog\";\r\n\r\nimport \"jquery-validation\";\r\n\r\nexport default class BasketStep3 {\r\n static init() {\r\n this.initBlockedDelivery();\r\n this.initStockDataValidation();\r\n }\r\n\r\n static initBlockedDelivery() {\r\n // @ts-ignore\r\n if (typeof (blockedDeliveryData) === \"undefined\") {\r\n return;\r\n }\r\n \r\n // @ts-ignore\r\n console.log(\"initBlockedDelivery\", blockedDeliveryData);\r\n\r\n // @ts-ignore\r\n if (blockedDeliveryData.isBlocked === false) {\r\n return;\r\n }\r\n\r\n $(\"form\").on(\"click\", \"[type=submit]\", (e) => {\r\n e.preventDefault();\r\n\r\n const $this = $(e.target);\r\n\r\n // @ts-ignore\r\n bootbox.dialog({\r\n // @ts-ignore\r\n message: blockedDeliveryData.message,\r\n buttons: {\r\n cancel: {\r\n // @ts-ignore\r\n label: blockedDeliveryData.messageCancel\r\n },\r\n ok: {\r\n // @ts-ignore\r\n label: blockedDeliveryData.messageConfirm,\r\n className: \"btn-primary\",\r\n callback: () => {\r\n const $form = $this.closest(\"form\");\r\n\r\n // @ts-ignore\r\n $form.validate();\r\n \r\n // @ts-ignore\r\n if ($form.valid() === false) {\r\n return false;\r\n }\r\n\r\n $form.trigger(\"submit\");\r\n }\r\n }\r\n }\r\n });\r\n });\r\n }\r\n\r\n static initStockDataValidation() {\r\n // @ts-ignore\r\n if (typeof (stockValidationData) === \"undefined\") {\r\n return;\r\n }\r\n \r\n // @ts-ignore\r\n console.log(\"initStockDataValidation\", stockValidationData);\r\n\r\n // @ts-ignore\r\n if (stockValidationData.isBlocked) {\r\n return;\r\n }\r\n\r\n $(\"form\").on(\"click\", \"[type=submit]\", (e) => {\r\n e.preventDefault();\r\n\r\n // @ts-ignore\r\n if (NProgress) NProgress.start();\r\n\r\n // @ts-ignore\r\n const messageDialog = MessageDialog.createInstance(\"nt-message-dialog--check-stock-data\", stockValidationData.messageCheckStockData)\r\n messageDialog.show();\r\n\r\n MessageDialog.getElement(\"nt-message-dialog--check-stock-data\").addEventListener(\"shown.bs.modal\", () => {\r\n const $form = $(e.target).closest(\"form\");\r\n\r\n // @ts-ignore\r\n $form.validate();\r\n \r\n // @ts-ignore\r\n if ($form.valid() === false) {\r\n // @ts-ignore\r\n if (NProgress) NProgress.done();\r\n messageDialog.hide();\r\n\r\n return false;\r\n }\r\n\r\n $form.trigger(\"submit\");\r\n })\r\n });\r\n }\r\n}","import $ from \"jquery\";\r\nimport axios, { AxiosError, AxiosResponse } from \"axios\";\r\nimport { withQuery } from \"ufo\";\r\nimport ProductHelper from \"../helpers/product-helper\";\r\nimport MiniBasket from \"../components/mini-basket\";\r\n\r\nexport default class Templates {\r\n static init() {\r\n const templatesPage = document.querySelector(\"#templates-page\") as HTMLElement | null;\r\n\r\n if (!templatesPage) {\r\n return;\r\n }\r\n\r\n Templates.initTemplates();\r\n Templates.initTemplateDetails();\r\n Templates.initOrderProduct();\r\n }\r\n\r\n static initTemplates() {\r\n const $row = $(\".js-template-row\");\r\n\r\n $row.off(\"click\", \".js-template--add\");\r\n $row.on(\"click\", \".js-template--add\", (e) => {\r\n const templateId = $(e.currentTarget).data(\"template-id\");\r\n this.addTemplate(templateId);\r\n });\r\n\r\n $row.off(\"click\", \".js-template--delete\");\r\n $row.on(\"click\", \".js-template--delete\", (e) => {\r\n // @ts-ignore\r\n bootbox.confirm(basketLoadData.deleteMessage, (result: boolean) => {\r\n if (result) {\r\n const templateId = $(e.currentTarget).data(\"template-id\");\r\n this.deleteTemplate(templateId);\r\n }\r\n });\r\n });\r\n }\r\n\r\n static initTemplateDetails() {\r\n $(\".js-template--collapse-details\").each((idx, el) => {\r\n el.addEventListener(\"show.bs.collapse\", async () => {\r\n const $details = $(el).find(\".js-template--details\");\r\n await this.getTemplateDetails($details, $details.data(\"get-details\"));\r\n });\r\n });\r\n }\r\n\r\n static initOrderProduct() {\r\n const isProductPage = 0;\r\n const isOnlyChange = 0;\r\n const isTemplate = 1;\r\n const isChangeOfOrderUnit = 0;\r\n const isAddToBasket = 1;\r\n\r\n const $templateDetails = $(\".js-template--details\");\r\n\r\n $templateDetails.off(\"submit\", \".js-order-product\");\r\n $templateDetails.on(\"submit\", \".js-order-product\", (e) => {\r\n const $form = $(e.target);\r\n\r\n ProductHelper.updateQuantityAndPrice(\r\n e,\r\n $form,\r\n isProductPage,\r\n isOnlyChange,\r\n isTemplate,\r\n isChangeOfOrderUnit,\r\n isAddToBasket\r\n );\r\n });\r\n }\r\n\r\n static async getTemplateDetails($target: JQuery, action: string) {\r\n const templateData = await axios.get(action);\r\n $target.html(templateData.data.viewTemplateDetail);\r\n\r\n $target.off(\"click\", \".js-template--delete-line\");\r\n $target.on(\"click\", \".js-template--delete-line\", (e) => {\r\n e.preventDefault();\r\n Templates.deleteTemplateLine($(e.currentTarget));\r\n })\r\n\r\n $target.find(\".js-pagination a\").off(\"click\");\r\n $target.find(\".js-pagination a\").on(\"click\", async (e) => {\r\n e.preventDefault();\r\n await Templates.getTemplateDetails($target, $(e.currentTarget).prop(\"href\"));\r\n });\r\n }\r\n\r\n static addTemplate(templateId: number) {\r\n // @ts-ignore\r\n this.executeTemplateAction(\"add\", templateId, basketLoadData.messageConfirmedAddToBasket, basketLoadData.messageFailedAddToBasket);\r\n }\r\n\r\n static deleteTemplate(templateId: number) {\r\n // @ts-ignore\r\n this.executeTemplateAction(\"delete\", templateId, basketLoadData.messageConfirmedDeleteTemplate, basketLoadData.messageFailedDeleteTemplate);\r\n }\r\n\r\n static deleteTemplateLine($deleteLink: JQuery) {\r\n // @ts-ignore\r\n bootbox.confirm({\r\n // @ts-ignore\r\n message: basketLoadData.messageDeleteProduct,\r\n buttons: {\r\n confirm: {\r\n // @ts-ignore\r\n label: basketLoadData.messageDeleteProductOk\r\n },\r\n cancel: {\r\n // @ts-ignore\r\n label: basketLoadData.messageDeleteProductCancel\r\n }\r\n },\r\n callback: async (result: boolean) => {\r\n if (result) {\r\n const action = $deleteLink.attr(\"href\") as string;\r\n const templateId = $deleteLink.data(\"template-id\");\r\n const templateLineId = $deleteLink.data(\"template-line-id\");\r\n const productNumber = $deleteLink.data(\"product-number\");\r\n\r\n const postData = {\r\n templateId: templateId,\r\n templateLineId: templateLineId\r\n };\r\n\r\n await axios.post(action, postData);\r\n\r\n // @ts-ignore\r\n toastr[\"success\"](String.format(basketLoadData.messageConfirmedDeleteProduct, productNumber));\r\n\r\n const $details = $deleteLink.closest(\".js-template--details\");\r\n const currentPageIndex = parseInt($(\".js-pagination--current-page-index\").val() as string);\r\n const actionUrl = withQuery($details.data(\"get-details\"), { page: currentPageIndex + 1 });\r\n\r\n await this.getTemplateDetails($details, actionUrl);\r\n }\r\n }\r\n });\r\n }\r\n\r\n static executeTemplateAction(action: string, templateId: number, confirmationMessage: string, errorMessage: string) {\r\n // @ts-ignore\r\n const postUrl = basketLoadData.actionUrl;\r\n // @ts-ignore\r\n const pageUrl = basketLoadData.pageUrl;\r\n\r\n const postData = {\r\n action: action,\r\n templateId: templateId\r\n };\r\n\r\n axios\r\n .post(postUrl, postData, { timeout: 30000 })\r\n .then((response: AxiosResponse) => response.data)\r\n .then(() => {\r\n toastr.success(confirmationMessage);\r\n\r\n switch (action) {\r\n case \"add\":\r\n MiniBasket.load();\r\n break;\r\n case \"delete\":\r\n window.location.href = pageUrl;\r\n break;\r\n }\r\n })\r\n .catch((error: AxiosError) => {\r\n console.error(error);\r\n toastr.error(errorMessage);\r\n });\r\n }\r\n}\r\n","import { createApp, defineAsyncComponent } from 'vue';\r\n\r\n/*\r\n * Place this on a page to render one of these components:\r\n *
    \r\n */\r\nexport default class VueComponentLoader {\r\n private static vueComponents = [\r\n { componentName: \"BasketTotals\", elementId: \"vue-basket-totals\", checkForVisibility: true },\r\n // { componentName: \"Counter\", elementId: \"vue-counter\", checkForVisibility: true },\r\n // { componentName: \"Fetcher\", elementId: \"vue-fetcher\", checkForVisibility: true },\r\n { componentName: \"Impersonation\", elementId: \"vue-impersonation\", checkForVisibility: true },\r\n { componentName: \"MobileProductFilter\", elementId: \"vue-mobile-product-filter\", checkForVisibility: true },\r\n { componentName: \"PasswordHibpChecker\", elementId: \"vue-password-hibp-checker\", checkForVisibility: true },\r\n { componentName: \"PasswordStrengthIndicator\", elementId: \"vue-password-strength-indicator\", checkForVisibility: true },\r\n { componentName: \"QuickScanList\", elementId: \"vue-quick-scan-list\", checkForVisibility: true }\r\n ];\r\n\r\n static load() {\r\n for (let vueComponent of VueComponentLoader.vueComponents) {\r\n const mountElement = document.getElementById(vueComponent.elementId);\r\n\r\n if (mountElement !== null) {\r\n const doMount = vueComponent.checkForVisibility ? mountElement.offsetWidth > 0 || mountElement.offsetHeight > 0 : true;\r\n\r\n if (doMount) {\r\n // console.log(\"vue mounting...\", mountElement);\r\n const component = defineAsyncComponent(() => import(`../components/${vueComponent.componentName}.vue`));\r\n createApp(component, {...mountElement.dataset}).mount(\"#\" + vueComponent.elementId);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","// entry point for general site code / not for vue code\r\nimport $ from \"jquery\";\r\nimport $$ from \"./scripts/utils/double-dollar\";\r\nimport { Button, Modal, Popover, Tab, Tooltip } from \"bootstrap\";\r\nimport { format, parse } from \"date-fns\";\r\nimport Datepicker from \"js-datepicker\";\r\nimport NatchGtm, { EventNamesSchema } from \"natch-gtm4\";\r\n\r\n////import 'bootbox';\r\nimport \"toastr\";\r\nimport \"jquery-validation\";\r\n\r\nimport \"./scripts/http/set-axios-defaults\";\r\n\r\nimport CustomHelper from \"./scripts/helpers/custom-helper\";\r\n\r\nimport CustomSwiper from \"./scripts/components/custom-swiper\";\r\nimport MiniBasket from \"./scripts/components/mini-basket\";\r\nimport PwaHelper from \"./scripts/components/pwa-helper\";\r\nimport QuickScan from \"./scripts/components/quick-scan\";\r\nimport SearchScan from \"./scripts/components/search-scan\";\r\nimport SearchSuggestions from \"./scripts/components/search-suggestions\";\r\n\r\nimport Account from \"./scripts/pages/account\";\r\nimport Software from \"./scripts/pages/software\";\r\nimport Products from \"./scripts/pages/products\";\r\nimport Upload from \"./scripts/pages/upload\";\r\nimport Terminal from \"./scripts/pages/terminal\";\r\nimport BasketStep1 from \"./scripts/pages/basket-step-1\";\r\nimport BasketStep2 from \"./scripts/pages/basket-step-2\";\r\nimport BasketStep3 from \"./scripts/pages/basket-step-3\";\r\nimport Templates from \"./scripts/pages/templates\";\r\n\r\nimport VueComponentLoader from \"./scripts/vue-component-loader\";\r\n\r\n/* this declaration in /clientapp/types/static.d.ts isn't picked up, so putting it here */\r\ndeclare global {\r\n interface Window {\r\n $: JQueryStatic;\r\n jQuery: JQueryStatic;\r\n }\r\n}\r\n\r\n// need jQuery on the window object for jquery validation\r\nwindow.jQuery = $;\r\n\r\nclass App {\r\n static init() {\r\n App.initErrorHandler();\r\n\r\n // will process product list, product detail, checkout, custom events and custom clicks\r\n const natchGtm = new NatchGtm(EventNamesSchema.OfficialGA4);\r\n natchGtm.processPage();\r\n\r\n $(\".d-none.onload\").hide().removeClass(\"d-none\").removeClass(\"onload\");\r\n\r\n // initialize Bootstrap components\r\n $$(`[data-bs-toggle=\"button\"]`, el => new Button(el));\r\n $$(`[data-bs-toggle=\"popover\"]`, el => new Popover(el));\r\n $$(`[rel=\"tooltip\"]`, el => new Tooltip(el)); // legacy\r\n $$(`[data-bs-toggle=\"tooltip\"]`, el => new Tooltip(el));\r\n\r\n // other\r\n App.initAutoLink();\r\n App.initDatePicker();\r\n App.initDropDownToggle();\r\n App.initForms();\r\n App.initHeader();\r\n App.initInputFocus();\r\n App.initModals();\r\n App.initNewsLetter();\r\n App.initScrollToTop();\r\n App.initSearchSuggestions();\r\n App.initTabs();\r\n App.initToaster();\r\n\r\n MiniBasket.load();\r\n\r\n // components\r\n CustomSwiper.init();\r\n PwaHelper.init();\r\n QuickScan.init();\r\n SearchScan.init();\r\n\r\n // pages\r\n Account.init();\r\n Software.init();\r\n Products.init();\r\n Upload.init();\r\n Terminal.init();\r\n BasketStep1.init();\r\n BasketStep2.init();\r\n BasketStep3.init();\r\n Templates.init();\r\n\r\n // vue components (loader)\r\n VueComponentLoader.load();\r\n }\r\n\r\n static initBlockedDelivery(isBlocked: boolean, message: string) {\r\n if (!isBlocked) {\r\n return;\r\n }\r\n\r\n // @ts-ignore\r\n bootbox.alert(message);\r\n }\r\n\r\n private static initAutoLink() {\r\n $(\".js-auto-link\").each(function(idx, el) {\r\n const $link = $(this).find(\"a\");\r\n\r\n if ($link.length !== 0) {\r\n $(el)\r\n .click(function() {\r\n if ($link.attr(\"target\") === \"_blank\") {\r\n window.open($link.attr(\"href\"));\r\n } else {\r\n document.location.href = $link.attr(\"href\") as string;\r\n }\r\n })\r\n .css(\"cursor\", \"pointer\");\r\n }\r\n });\r\n }\r\n\r\n private static initDatePicker() {\r\n // https://www.npmjs.com/package/js-datepicker\r\n const options = {\r\n startDay: 1,\r\n disableYearOverlay: true,\r\n formatter: (input: any, date: Date, instance: any) => {\r\n input.value = format(date, \"dd/MM/yyyy\");\r\n },\r\n onSelect: (instance: any, date: Date) => {\r\n\r\n },\r\n };\r\n\r\n $$(`[rel=\"datepicker\"]`, el => {\r\n const datePickerId = $(el).prop(\"id\");\r\n const datePickerInstance = Datepicker(`#${datePickerId}`, options);\r\n\r\n const dateValue = $(el).val() as string;\r\n const parsedDateValue = parse(dateValue, \"dd/MM/yyyy\", new Date());\r\n datePickerInstance.setDate(parsedDateValue, true);\r\n\r\n const $datePickerIcon = $(el).closest(\".input-group\").find(`[type=\"button\"]`);\r\n $datePickerIcon.on(\"click\", (e: JQueryEventObject) => {\r\n e.stopPropagation();\r\n datePickerInstance.show();\r\n });\r\n });\r\n }\r\n\r\n private static initDropDownToggle() {\r\n $(\"body\").on(\"click\", \".js-dropdown-submenu-toggle\", (e) => {\r\n e.preventDefault();\r\n document.location.href = $(e.currentTarget).prop(\"href\");\r\n });\r\n }\r\n\r\n private static initErrorHandler() {\r\n const maxErrorThreshold = 3;\r\n let errorThreshold = 0;\r\n\r\n window.onerror = function(message, source, lineno, columnno, error) {\r\n if (errorThreshold++ > maxErrorThreshold) {\r\n return false;\r\n }\r\n\r\n // exception occurs when the quick scan modal is toggled, presumably from the scanner component\r\n if (source?.includes(\"quickscan\") && message === \"ResizeObserver loop completed with undelivered notifications.\") {\r\n return false;\r\n }\r\n\r\n const arg: any = {\r\n message: message,\r\n url: source,\r\n line: lineno,\r\n column: columnno,\r\n errorObject: null\r\n };\r\n\r\n if (error) {\r\n arg.errorObject = JSON.stringify(error);\r\n }\r\n\r\n console.info(\"Sending error to server\");\r\n console.info(arg);\r\n\r\n const xhr = new XMLHttpRequest();\r\n xhr.open(\"POST\", \"/javascript/logerror\");\r\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\r\n xhr.send(JSON.stringify(arg));\r\n\r\n return false;\r\n };\r\n }\r\n\r\n private static initForms() {\r\n const $form = $(\"form\");\r\n\r\n $form.find(\".js-toggle-submit\").each(function () {\r\n const $this = $(this);\r\n CustomHelper.setToggleSubmit($this.parents(\"form\"), $this);\r\n });\r\n\r\n $form.on(\"click\", \".js-toggle-submit\", function () {\r\n const $this = $(this);\r\n CustomHelper.setToggleSubmit($this.parents(\"form\"), $this);\r\n });\r\n\r\n $(\".js-auto-submit\").on(\"click\", function () {\r\n $(this).parents(\"form\").submit();\r\n });\r\n }\r\n\r\n private static initHeader() {\r\n $(\"body\").on(\"click\", \".js-category-nav-activator\", function() {\r\n const $categoryNavActivator = $(this);\r\n\r\n const $languageMenuFixed = $(\".js-language-menu-fixed\");\r\n if ($languageMenuFixed.is(\":visible\")) {\r\n $categoryNavActivator.removeClass(\"activated\");\r\n $languageMenuFixed.addClass(\"d-none\");\r\n } else {\r\n $categoryNavActivator.addClass(\"activated\");\r\n $languageMenuFixed.removeClass(\"d-none\");\r\n }\r\n });\r\n }\r\n\r\n private static initInputFocus() {\r\n $(\".js-input-focus\").trigger(\"focus\");\r\n }\r\n\r\n private static initModals(){\r\n let modalList = document.querySelectorAll(\".modal\");\r\n for (let i = 0; i < modalList.length; i++){\r\n const el = modalList[i] as HTMLElement;\r\n const modal = new Modal(el);\r\n\r\n if (el.dataset.ntShowOnLoad === \"true\"){\r\n modal.show();\r\n }\r\n }\r\n\r\n const modalNewsMessages = document.querySelector(\"#modal-news-messages\") as HTMLElement;\r\n\r\n if (modalNewsMessages) {\r\n modalNewsMessages.addEventListener(\"hide.bs.modal\", (e) => {\r\n const hideList = $(document.querySelector(\"#modal-news-messages-hide-list\") as HTMLElement).val();\r\n document.cookie = `nt_news-messages=${hideList};expires=${new Date(2050, 0, 1).toUTCString()}; path=/; domain=${window.location.hostname}; SameSite=lax; Secure`;\r\n });\r\n }\r\n }\r\n\r\n private static initNewsLetter(){\r\n $(\"#form-newsletter-footer\").on(\"submit\", (e) => {\r\n e.preventDefault();\r\n\r\n const $this = $(e.currentTarget);\r\n const $form = $this.closest(\"form\");\r\n\r\n // @ts-ignore\r\n $form.validate();\r\n\r\n // @ts-ignore\r\n if ($form.valid()){\r\n const newsLetterModalElement = document.getElementById(\"modal-dialog-newsletter\") as HTMLElement;\r\n const newsLetterModal = new Modal(newsLetterModalElement);\r\n newsLetterModal.show();\r\n\r\n const emailAddressValue = $(\"#newsletter-footer-email\").val() as string;\r\n $(\"#newsletter-email\").val(emailAddressValue);\r\n }\r\n })\r\n\r\n $(\"#form-newsletter\").on(\"change\", \".js-newsletter-usertype\", (e) => {\r\n const $this = $(e.currentTarget);\r\n const $form = $this.closest(\"form\");\r\n\r\n const $sector = $form.find(\".js-newsletter-sector\");\r\n $sector.removeClass(\"d-none\");\r\n\r\n const $sectorSelect = $sector.find(\"select\");\r\n $sectorSelect.addClass(\"d-none\");\r\n $sectorSelect.prop(\"disabled\", true);\r\n\r\n const $target = $form.find($this.data(\"target\"));\r\n $target.removeClass(\"d-none\");\r\n $target.prop(\"disabled\", false);\r\n });\r\n }\r\n\r\n private static initScrollToTop() {\r\n $(window).on(\"scroll\",(e) => {\r\n if ($(e.currentTarget)?.scrollTop() ?? 0 > 300) {\r\n $(\".nt-move-to-top\").fadeIn(200);\r\n } else {\r\n $(\".nt-move-to-top\").fadeOut(200);\r\n }\r\n });\r\n }\r\n\r\n private static initSearchSuggestions() {\r\n $$(\".js-search-suggestions-autocomplete\", (el) => new SearchSuggestions(el));\r\n }\r\n\r\n private static initTabs() {\r\n $$(`[rel=\"tab\"]`, el => {\r\n const tabTrigger = new Tab(el);\r\n\r\n el.addEventListener('click', function (event) {\r\n event.preventDefault()\r\n tabTrigger.show()\r\n })\r\n });\r\n }\r\n\r\n private static initToaster() {\r\n // @ts-ignore\r\n if (typeof $.fn.toastr === \"function\") {\r\n // @ts-ignore\r\n toastr.options = {\r\n closeButton: true,\r\n debug: false,\r\n newestOnTop: true,\r\n progressBar: false,\r\n positionClass: \"toast-top-right\",\r\n preventDuplicates: false,\r\n // @ts-ignore\r\n onclick: null,\r\n // @ts-ignore\r\n showDuration: \"3000\",\r\n // @ts-ignore\r\n hideDuration: \"3000\",\r\n // @ts-ignore\r\n timeOut: \"7000\",\r\n // @ts-ignore\r\n extendedTimeOut: \"1000\",\r\n showEasing: \"swing\",\r\n hideEasing: \"linear\",\r\n showMethod: \"fadeIn\",\r\n hideMethod: \"fadeOut\"\r\n };\r\n }\r\n }\r\n}\r\n\r\nApp.init();\r\n\r\n// @ts-ignore\r\nApp.initBlockedDelivery(Global.IsBlockedDelivery, Global.IsBlockedDeliveryMessage);\r\n\r\nconsole.info(\"🚀 index.ts loaded\");\r\n"],"file":"assets/index-82e9ab31.js"}