'}}])&&r(t.prototype,n),o&&r(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n tr").forEach((function(e){return e.remove()})),this.products=e,e.forEach((function(e){t.addProductRow(e)})),this.setProductPositions(),this.pagesValue=Math.ceil(this.products.length/this.itemsPerPageValue),this.currentPageValue=0,this.productsChanged()}},{key:"addProductRow",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"addLast";if(this.hasRowTemplateTarget&&this.hasProductsTableTarget){var o=this.rowTemplateTarget;o.content.querySelector("tr").dataset.trimmedPzn=e.trimmed_pzn;var i=o.content.querySelectorAll("td");i[2].textContent=e.name,i[3].textContent=e.trimmed_pzn,e.is_active?i[4].innerHTML='':i[4].innerHTML='',i[5].querySelector('a[data-action="edit-product"]').setAttribute("href",e.url);var r=document.importNode(o.content,!0);r.querySelector('a[data-action="remove-product"]').dataset.trimmedPzn=e.trimmed_pzn,r.querySelector('a[data-action="remove-product"]').addEventListener("click",(function(e){e.preventDefault(),t.removeProduct(e.currentTarget.dataset.trimmedPzn)})),"addFirst"===n?this.productsTableTarget.querySelector("tbody").prepend(r):this.productsTableTarget.querySelector("tbody").appendChild(r)}}},{key:"removeProduct",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.products=this.products.filter((function(t){return t.trimmed_pzn!==e})),this.productsTableTarget.querySelector('tbody > tr[data-trimmed-pzn="'+e+'"]').remove(),t||(this.setProductPositions(),this.pagesValue=Math.ceil(this.products.length/this.itemsPerPageValue),this.showCurrentPage(),this.productsChanged(),this.list.dispatchEvent(new Event("custom:change",{bubbles:!0})))}},{key:"removeSelectedProducts",value:function(e){var t=this;e.preventDefault();var n=this.productsTableTarget.querySelectorAll('tbody > tr input[type="checkbox"]:checked');0!==n.length&&(n.forEach((function(e){t.removeProduct(e.closest("tr").dataset.trimmedPzn)})),this.setProductPositions(),this.pagesValue=Math.ceil(this.products.length/this.itemsPerPageValue),this.showCurrentPage(),this.productsChanged(),this.list.dispatchEvent(new Event("custom:change",{bubbles:!0})))}},{key:"setProductPositions",value:function(){if(this.hasProductsTableTarget){var e=1;this.productsTableTarget.querySelectorAll('tbody > tr > td[data-content="position"]').forEach((function(t){t.textContent=e,e++}))}}},{key:"setupPagination",value:function(){var e=this;if(this.hasPaginationTarget){if(this.paginationTarget.querySelectorAll("li").forEach((function(e){e.remove()})),this.pagesValue<=1)return this.currentPageValue=0,void this.paginationTarget.classList.add("hidden");this.paginationTarget.classList.remove("hidden"),this.paginationTarget.insertAdjacentHTML("beforeend",this.paginator.getPaginationMarkup(this.currentPageValue,this.pagesValue)),this.paginationTarget.querySelectorAll("li > a").forEach((function(t){t.addEventListener("click",(function(t){t.preventDefault();var n=t.currentTarget.dataset.page;"prev"===n?e.currentPageValue>0&&e.currentPageValue--:"next"===n?e.currentPageValuethis.pagesValue-1&&(this.currentPageValue=0),this.highlightCurrentPageInPagination()}}},{key:"highlightCurrentPageInPagination",value:function(){this.paginationTarget.querySelectorAll("li.active").forEach((function(e){return e.classList.remove("active")}));var e=this.paginationTarget.querySelector('li > a[data-page="'+this.currentPageValue+'"]');e&&e.parentElement.classList.add("active")}},{key:"showCurrentPage",value:function(){var e=this.currentPageValue*this.itemsPerPageValue,t=(this.currentPageValue+1)*this.itemsPerPageValue-1,n=0;this.productsTableTarget.querySelectorAll("tbody > tr").forEach((function(o){n>=e&&n<=t?o.classList.remove("hidden"):(o.classList.add("hidden"),o.querySelector('input[type="checkbox"]').checked=!1),n++})),this.checkboxAllTarget.checked=!1}},{key:"setSelectedStateOfVisible",value:function(e){var t=e.currentTarget.checked;this.productsTableTarget.querySelectorAll('tbody > tr:not(.hidden) input[type="checkbox"]').forEach((function(e){return e.checked=t}))}},{key:"productsChanged",value:function(){this.formInputTarget.value=JSON.stringify(this.products.map((function(e){return e.trimmed_pzn})))}},{key:"initSortable",value:function(e){var t=this;new i.bt(e,{onEnd:function(e){var n=t.products[e.oldIndex];t.products.splice(e.oldIndex,1),t.products.splice(e.newIndex,0,n),t.setProductPositions(),t.productsChanged(),t.list.dispatchEvent(new Event("custom:change",{bubbles:!0}))}})}},{key:"loadImportForm",value:function(){var e=this;fetch(this.importFormUrlValue).then((function(e){return e.json()})).then((function(t){e.setupImportForm(t.form)}))}},{key:"setupImportForm",value:function(e){var t=this;this.importFormTarget.innerHTML=e,this.importFormTarget.querySelector("form").addEventListener("submit",(function(e){e.preventDefault();var n=event.currentTarget,o=new FormData(n);fetch(n.getAttribute("action"),{method:n.getAttribute("method"),body:o}).then((function(e){return e.json()})).then((function(e){t.setupImportForm(e.form),e.valid&&(t.insertUploadedProducts(e.products,e.importOrder),e.products.length>0&&_.success(e.products.length+" "+(1===e.products.length?"Produkt wurde":"Produkte wurden")+" erfolgreich einsortiert."),e.numOfUnknownProducts>0&&_.error(e.numOfUnknownProducts+" "+(1===e.numOfUnknownProducts?"Produkt wurde":"Produkte wurden")+" nicht gefunden."))}))}))}},{key:"insertUploadedProducts",value:function(e,t){var n=this;"addFirst"===t&&(e=e.reverse()),e.forEach((function(e){var o=n.products.filter((function(t){return t.trimmed_pzn===e.trimmed_pzn}));o.length>0&&n.removeProduct(o[0].trimmed_pzn,!0),"addFirst"===t?n.products.unshift(e):n.products.push(e),n.addProductRow(e,t)})),this.setProductPositions(),this.pagesValue=Math.ceil(this.products.length/this.itemsPerPageValue),this.productsChanged(),this.showCurrentPage(),this.list.dispatchEvent(new Event("custom:change",{bubbles:!0}))}}],n&&d(t.prototype,n),o&&d(t,o),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.Qr);m(g,"values",{getProductsUrl:String,importFormUrl:String,itemsPerPage:Number,currentPage:Number,pages:Number}),m(g,"targets",["productsTable","rowTemplate","pagination","checkboxAll","formInput","importForm","itemsPerPage"])},6225:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>y});n(5666),n(2222),n(9554),n(1539),n(4747),n(7941),n(8674),n(9070),n(8304),n(489),n(2419),n(8011),n(7042),n(8309),n(1038),n(8783),n(4916),n(2526),n(1817),n(2165),n(6992),n(3948),n(9753);var o=n(6599),i=n(1474);function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw r}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n ul"))}},{key:"toggleChildrenVisibility",value:function(e){var t="1"===e.dataset.childrenVisible,n=e.querySelector('[data-marker="children-visible"]'),o=this.element.querySelector('ul[data-parent-id="'+e.dataset.id+'"]');t?o.classList.add("hidden"):o.classList.remove("hidden"),n&&(t?(n.classList.add("fa-caret-right"),n.classList.remove("fa-caret-down")):(n.classList.remove("fa-caret-right"),n.classList.add("fa-caret-down"))),e.dataset.childrenVisible=t?"0":"1","1"!==o.dataset.sortableSetup&&this.initSortable(o)}},{key:"initSortable",value:function(e){var t=this;new i.bt(e,{onStart:function(e){t.highlight(e.from)},onEnd:function(e){t.removeHighlight(),t.addChange(e.to)}})}},{key:"highlight",value:function(e){this.element.querySelectorAll("ul").forEach((function(t){t!==e&&t.classList.add("unavailable-drop")}))}},{key:"removeHighlight",value:function(){this.element.querySelectorAll("ul").forEach((function(e){e.classList.remove("unavailable-drop")}))}},{key:"save",value:(r=regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),this.hasSaveUrlValue&&0!==Object.keys(this.changes).length){e.next=3;break}return e.abrupt("return");case 3:return(n=t.currentTarget).setAttribute("disabled","disabled"),e.next=7,fetch(this.saveUrlValue,{method:"POST",body:JSON.stringify(this.changes)});case 7:e.sent.ok?g.success("Änderungen wurden gespeichert"):g.error("Änderungen konnten nicht gespeichert werden"),n.removeAttribute("disabled");case 10:case"end":return e.stop()}}),e,this)})),s=function(){var e=this,t=arguments;return new Promise((function(n,o){var i=r.apply(e,t);function a(e){l(i,n,o,a,s,"next",e)}function s(e){l(i,n,o,a,s,"throw",e)}a(void 0)}))},function(e){return s.apply(this,arguments)})},{key:"uiToTree",value:function(e){var t,n=[],o=a(e.children);try{for(o.s();!(t=o.n()).done;){var i=t.value,r={id:i.dataset.id,title:i.querySelector('span[data-content="category-title"]').innerHTML,children:[]};i.querySelector("ul")&&(r.children=this.uiToTree(i.querySelector("ul"))),n.push(r)}}catch(e){o.e(e)}finally{o.f()}return n}},{key:"getCategoryTitles",value:function(e){var t,n=[],o=a(e.children);try{for(o.s();!(t=o.n()).done;){var i=t.value;n.push(this.decodeHtmlEntities(i.querySelector('span[data-content="category-title"]').innerHTML))}}catch(e){o.e(e)}finally{o.f()}return n}},{key:"addChange",value:function(e){for(var t=e.parentElement,n=[];"li"===t.tagName.toLowerCase();){var o=this.decodeHtmlEntities(t.querySelector('span[data-content="category-title"]').innerHTML);n.unshift(o),t=t.parentElement.parentElement}var i=e.dataset.parentId;this.changes[i]={path:n,items:this.getCategoryTitles(e)},this.element.dispatchEvent(new Event("custom:change",{bubbles:!0}))}},{key:"decodeHtmlEntities",value:function(e){var t=document.createElement("textarea");return t.innerHTML=e,t.value}}],n&&u(t.prototype,n),o&&u(t,o),Object.defineProperty(t,"prototype",{writable:!1}),m}(o.Qr);_(y,"values",{saveUrl:String})},5230:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>p});n(4812),n(9554),n(1539),n(4747),n(7327),n(9070),n(8304),n(489),n(2419),n(8011),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n0}},{key:"triggerInputEvent",value:function(e){var t=new Event("input",{bubbles:!1,cancelable:!0});e.dispatchEvent(t)}},{key:"getChecked",value:function(){return this.checkboxTargets.filter((function(e){return e.checked}))}},{key:"getUnchecked",value:function(){return this.checkboxTargets.filter((function(e){return!e.checked}))}}])&&r(t.prototype,n),o&&r(t,o),Object.defineProperty(t,"prototype",{writable:!1}),d}(n(6599).Qr);h=["checkboxAll","checkbox"],(c="targets")in(u=p)?Object.defineProperty(u,c,{value:h,enumerable:!0,configurable:!0,writable:!0}):u[c]=h},834:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>p});n(9070),n(8304),n(489),n(1539),n(2419),n(8011),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n{"use strict";n.r(t),n.d(t,{default:()=>u});n(9554),n(1539),n(4747),n(8304),n(489),n(2419),n(8011),n(9070),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n{"use strict";n.r(t),n.d(t,{default:()=>f});n(9070),n(8304),n(489),n(1539),n(2419),n(8011),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948);var o=n(6599);n(3181);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n{"use strict";n.r(t),n.d(t,{default:()=>_});n(9554),n(1539),n(4747),n(9826),n(9070),n(8304),n(489),n(2419),n(8011),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948);var o=n(6599),i=n(9755),r=n.n(i);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n{"use strict";n.r(t),n.d(t,{default:()=>u});n(8309),n(8304),n(489),n(1539),n(2419),n(8011),n(9070),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n{"use strict";n.r(t),n.d(t,{default:()=>f});n(4916),n(4723),n(4603),n(9714),n(9826),n(1539),n(5306),n(9554),n(4747),n(1058),n(9070),n(9653),n(8304),n(489),n(2419),n(8011),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948);var o=n(6599),i=n(9755),r=n.n(i);n(1963);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n .collection-item").length;r()("#"+n[1].replace(o,i)).length>0;)i++;e=(e=e.replace(o,i)).replace(/__id__/g,n[1].replace(o,i));var a=r()(this.collectionTarget.dataset.widgetTags||'').html(e);return this.insertBeforeAddButtonValue&&this.hasAddButtonTarget?a.insertBefore(r()(this.addButtonTarget)):a.appendTo(this.listTarget),this.sortableValue&&this.setCollectionPositions(),r()(this.collectionTarget).trigger("collection-field-added"),this.collectionTarget.closest("form").dispatchEvent(new Event("collection-field-added")),this.disableInputs(),this.setAddButtonState(),a}},{key:"removeItemFromCollection",value:function(e){r()(this.collectionTarget).trigger("collection-field-removed-before"),this.collectionTarget.closest("form").dispatchEvent(new Event("collection-field-removed-before")),e.remove(),this.sortableValue&&this.setCollectionPositions(),r()(this.collectionTarget).trigger("collection-field-removed-after"),this.collectionTarget.closest("form").dispatchEvent(new Event("collection-field-removed-after")),r()(this.collectionTarget).trigger("collection-field-removed"),this.collectionTarget.closest("form").dispatchEvent(new Event("collection-field-removed")),this.disableInputs(),this.setAddButtonState()}},{key:"initSortable",value:function(){var e=this;r()(this.listTarget).sortable({items:"> .collection-item",stop:function(){e.setCollectionPositions()}})}},{key:"setCollectionPositions",value:function(){var e=1;r()(this.listTarget).find('.collection-item input[data-content="position"]').each((function(){r()(this).val(e),r()(this)[0].dispatchEvent(new Event("change")),e++}))}},{key:"disableInputs",value:function(){var e=-1;r()(this.listTarget).find("> .collection-item").each((function(){e++,r()(this)[0].querySelectorAll("[data-disable-on-index]").forEach((function(t){e===parseInt(t.dataset.disableOnIndex)&&(t.readOnly=!0)}))}))}},{key:"setAddButtonState",value:function(){this.hasLimitEntriesValue&&!(this.limitEntriesValue<=0)&&this.hasAddButtonTarget&&this.hasListTarget&&(this.addButtonTarget.disabled=this.listTarget.children.length>=this.limitEntriesValue)}}])&&l(t.prototype,n),o&&l(t,o),Object.defineProperty(t,"prototype",{writable:!1}),a}(o.Qr);p(f,"targets",["collection","list","addButton"]),p(f,"values",{sortable:Boolean,insertBeforeAddButton:Boolean,limitEntries:Number})},9435:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>d});n(9554),n(1539),n(4747),n(8304),n(489),n(2419),n(8011),n(9070),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){for(var n=0;n{"use strict";n.r(t),n.d(t,{default:()=>p});n(9070),n(8304),n(489),n(1539),n(2419),n(8011),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n{"use strict";n.r(t),n.d(t,{default:()=>m});n(1058),n(9826),n(1539),n(3210),n(9070),n(8304),n(489),n(2419),n(8011),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948);var o=n(6599),i=n(9755);function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n\n
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n \n '));return i(t).find(".fa-search-minus").on("click",(function(t){t.preventDefault(),e.zoomOut()})),i(t).find(".fa-search-plus").on("click",(function(t){t.preventDefault(),e.zoomIn()})),t}},{key:"showImage",value:function(e){e.preventDefault(),this.modal.find(".modal-body").html(''),this.modal.find(".modal-header .modal-title").html(e.currentTarget.dataset.header),this.modal.find(".modal-footer .tokens").html(e.currentTarget.getAttribute("title")),this.setImageSize(),this.modal.modal("show")}},{key:"htmlToElement",value:function(e){var t=document.createElement("template");return e=e.trim(),t.innerHTML=e,t.content.firstChild}},{key:"setImageSize",value:function(e){void 0===e&&(e=this.currentImageSize),this.modal.find(".modal-body img").css("width",500*e/100),this.currentImageSize=e,localStorage.setItem("prescription-size",e)}},{key:"zoomIn",value:function(){this.modal.find('input[type="range"]').val(parseInt(this.modal.find('input[type="range"]').val())+5),this.modal.find('input[type="range"]').trigger("input")}},{key:"zoomOut",value:function(){this.modal.find('input[type="range"]').val(parseInt(this.modal.find('input[type="range"]').val())-5),this.modal.find('input[type="range"]').trigger("input")}}])&&s(t.prototype,n),o&&s(t,o),Object.defineProperty(t,"prototype",{writable:!1}),u}(o.Qr);f=["thumbnail"],(p="targets")in(h=m)?Object.defineProperty(h,p,{value:f,enumerable:!0,configurable:!0,writable:!0}):h[p]=f},4530:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>_});n(2772),n(4916),n(5306),n(8309),n(9826),n(1539),n(9070),n(8304),n(489),n(2419),n(8011),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948);var o=n(6599),i=n(9755),r=n.n(i);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n=0){var t=new FileReader;t.onload=function(t){var n=r()(e.inputTarget).closest(".image-upload");n.find(".file-upload").hide(),n.append('')},t.readAsDataURL(this.inputTarget.files[0])}}}])&&l(t.prototype,n),o&&l(t,o),Object.defineProperty(t,"prototype",{writable:!1}),a}(o.Qr);m=["input"],(f="targets")in(p=_)?Object.defineProperty(p,f,{value:m,enumerable:!0,configurable:!0,writable:!0}):p[f]=m},5129:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>_});n(9826),n(1539),n(8674),n(9070),n(8304),n(489),n(2419),n(8011),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948);var o=n(6599),i=n(9755),r=n.n(i);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n{"use strict";n.r(t),n.d(t,{default:()=>h});n(6699),n(2023),n(9554),n(1539),n(4747),n(2772),n(4916),n(3123),n(8674),n(3210),n(9070),n(8304),n(489),n(2419),n(8011),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948);var o=n(6599);n(3181);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n{"use strict";n.r(t),n.d(t,{default:()=>f});n(9826),n(1539),n(6992),n(8783),n(3948),n(285),n(1637),n(1058),n(9554),n(4747),n(4678),n(4916),n(5306),n(6977),n(9070),n(8304),n(489),n(2419),n(8011),n(2526),n(1817),n(2165);var o=n(6599),i=(n(3181),n(9755)),r=n.n(i);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n100||t<0)){t/=100;var n=this.discountOnTarget.value;if("AVP"===n||"VK"===n){var o=this.priceTypeTarget.value;this.productTableWrapperTarget.querySelectorAll("tr.product").forEach((function(i){var a=0;if(a="EK"===o?"AVP"===n?i.dataset.aep:i.dataset.ek:"AVP"===n?i.dataset.avp:i.dataset.price,a=parseFloat(a),isNaN(a))i.querySelector("EK"===o?"td.new-ek":"td.new-price").innerHTML="","EK"===o?i.dataset.newEk="0":i.dataset.newPrice="0";else{var s=a;s="increase"===e.discountTypeTarget.querySelector("input:checked").value?a*(1+t):a*(1-t),i.querySelector("EK"===o?"td.new-ek":"td.new-price").innerHTML=s.toFixed(2).replace(".",",")+" €","EK"===o?i.dataset.newEk=s+"":i.dataset.newPrice=s+""}"EK"===o?(i.dataset.newPrice=i.dataset.price,i.querySelector("td.new-price").innerHTML=""):(i.dataset.newEk=i.dataset.ek,i.querySelector("td.new-ek").innerHTML="");var l=parseFloat(i.dataset.tax),d=parseFloat(i.dataset.newPrice)/(1+l),u=parseFloat(i.dataset.newEk);isNaN(u)&&(u=0);var c=d-u,h=0!==u?d/u-1:0,p="",f=parseFloat(r()("[data-margin-red]").data("margin-red")),m=parseFloat(r()("[data-margin-yellow]").data("margin-yellow"));p=h<(0!==f?f:.1)?''+Math.round(100*h)+"%":h<(0!=m?m:.25)?''+Math.round(100*h)+"%":''+Math.round(100*h)+"%",i.querySelector("td.margin").innerHTML=p+" "+c.toFixed(2).replace(".",",")+" €"}))}}}},{key:"submit",value:function(e){e.preventDefault();var t=parseInt(this.discountTarget.value);if(isNaN(t)||t>100||t<=0)swal("Fehler","Bitte geben Sie einen gültigen Rabattwert ein.","error");else if(""!==this.categoryIdTarget.value){var n=r()(e.currentTarget);swal({title:"Sind sie sicher?",text:"Sollen die Preise der ausgewählten Produkte um "+this.discountTarget.value+"% ("+this.discountOnTarget.value+") "+("decrease"===this.discountTypeTarget.querySelector("input:checked").value?"gesenkt":"erhöht")+" werden?",type:"warning",showCancelButton:!0,cancelButtonText:"Abbrechen",confirmButtonColor:"#DD6B55",confirmButtonText:"Preise aktualisieren",closeOnConfirm:!1},(function(){var e=n.closest("form");e.append(''),e[0].dispatchEvent(new Event("submit")),e.submit()}))}else swal("Fehler","Bitte wählen Sie eine Kategorie aus.","error")}},{key:"resetToAvp",value:function(e){e.preventDefault();var t=r()(e.currentTarget),n="AVP";"EK"===this.priceTypeTarget.value&&(n="AEP");var o="Sollen die Preise der ausgewählten Produkte auf den "+n+" zurückgesetzt werden?";"1"===this.categoryIdTarget.value&&(o="Es werden alle Preise auf den AVP/UVP zurückgesetzt, inkl. zeitlich begrenzte Aktionspreise und Monatsangebote. Möchten Sie fortfahren?"),swal({title:"Sind sie sicher?",text:o,type:"warning",showCancelButton:!0,cancelButtonText:"Abbrechen",confirmButtonColor:"#DD6B55",confirmButtonText:"Preise zurücksetzen",closeOnConfirm:!1},(function(){var e=t.closest("form");e.append(''),e[0].dispatchEvent(new Event("submit")),e.submit()}))}}])&&l(t.prototype,n),o&&l(t,o),Object.defineProperty(t,"prototype",{writable:!1}),a}(o.Qr);p(f,"targets",["categoryLoader","categoryContent","categoryId","includeSubcategories","apoPflicht","featured","productTableWrapper","productTableLoader","discount","discountOn","discountType","priceType","resetToAvp"]),p(f,"values",{productsUrl:String})},2228:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>_});n(9070),n(8304),n(489),n(1539),n(2419),n(8011),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948);var o=n(6599),i=n(9755),r=n.n(i);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n{"use strict";n.r(t),n.d(t,{default:()=>u});n(2564),n(4812),n(8304),n(489),n(1539),n(2419),n(8011),n(9070),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n'):(t[0].className="",t[0].classList.add("fas"),t[0].classList.add("fa-spinner"),t[0].classList.add("fa-spin")),setTimeout(this.disableButton.bind(this))}},{key:"disableButton",value:function(){this.element.setAttribute("disabled","disabled")}}])&&r(t.prototype,n),o&&r(t,o),Object.defineProperty(t,"prototype",{writable:!1}),d}(n(6599).Qr)},1837:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>_});n(9070),n(8304),n(489),n(1539),n(2419),n(8011),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948);var o=n(6599),i=n(9755),r=n.n(i);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n{"use strict";n.r(t),n.d(t,{default:()=>p});n(8304),n(489),n(1539),n(2419),n(8011),n(9070),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948);var o=n(6599),i=n(9755),r=n.n(i);n(8199);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n{"use strict";var o=n(2192);n(4916),n(4723),n(9070),n(8304),n(489),n(1539),n(2419),n(8011),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n