PageSourceSearch

https://www.medicig.de/theme/c99961d6b7f4cb1fcec5d283c6c258ef/js/q…ick-order.base-quick-order.plugin.9e5a42.js

js medicig.de collected 2026-10-07 07:02:53 UTC 8,039 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkquick_order=self.webpackChunkquick_order||[]).push([[8202],{156(t){var e=function(t){var e;return!!t&&"object"==typeof t&&"[object RegExp]"!==(e=Object.prototype.toString.call(t))&&"[object Date]"!==e&&t.$$typeof!==i},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function s(t,e){return!1!==e.clone&&e.isMergeableObject(t)?u(Array.isArray(t)?[]:{},t,e):t}function r(t,e,i){return t.concat(e).map(function(t){return s(t,i)})}function n(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function o(t,e){try{return e in t}catch(t){return!1}}function u(t,i,a){(a=a||{}).arrayMerge=a.arrayMerge||r,a.isMergeableObject=a.isMergeableObject||e,a.cloneUnlessOtherwiseSpecified=s;var c,l,d=Array.isArray(i);return d!==Array.isArray(t)?s(i,a):d?a.arrayMerge(t,i,a):(l={},(c=a).isMergeableObject(t)&&n(t).forEach(function(e){l[e]=s(t[e],c)}),n(i).forEach(function(e){(!o(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(o(t,e)&&c.isMergeableObject(i[e])?l[e]=(function(t,e){if(!e.customMerge)return u;var i=e.customMerge(t);return"function"==typeof i?i:u})(e,c)(t[e],i[e],c):l[e]=s(i[e],c))}),l)}u.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,i){return u(t,i,e)},{})},t.exports=u},202(t,e,i){i.r(e),i.d(e,{default:()=>r});var s=i(737);class r extends s.A{init(){this.products=[],this.notFoundProducts=[],this.page=1,this.limit=50,this.duplicatedItem="",document.$emitter.subscribe("QuickOrder/getTotalProducts",this.onGetTotalProducts.bind(this))}load(){document.$emitter.publish("QuickOrder/onProductsLoaded",{products:this.getProducts()})}onGetTotalProducts(t){"function"==typeof t.detail&&t.detail([...this.products])}addProduct(t){let e=this.products.findIndex(e=>e.id===t.id);if(e<0){this.updateDuplicatedItem(""),this.products=[t,...this.products],this.page=1,this.load();return}let i=parseInt(t.quantity)+parseInt(this.products[e].quantity);this.updateDuplicatedItem(`${t.productNumber} - ${t.name}`),this.products=[...this.products.slice(0,e),{...this.products[e],quantity:i},...this.products.slice(e+1)],this.load()}updateProduct(t){let e=t.oldId??t.id,i=this.products.findIndex(t=>t.id===e);i<0||(this.products=[...this.products.slice(0,i),{...this.products[i],...t},...this.products.slice(i+1)],this.duplicatedItem&&this.updateDuplicatedItem(""),this.load())}removeProduct(t){let e=this.products.findIndex(e=>e.id===t);this.products=[...this.products.slice(0,e),...this.products.slice(e+1)],this.duplicatedItem&&this.updateDuplicatedItem(""),0===this.products.length&&this.updateNotFoundProducts([]),this.load()}resetProductList(){this.products=[],this.page=1,this.limit=50,this.notFoundProducts=[],this.duplicatedItem="",this.load()}updateNotFoundProducts(t){this.notFoundProducts=t,this.$emitter.publish("QuickOrder/updateNotFoundProducts",{notFoundProducts:t})}updateDuplicatedItem(t){this.duplicatedItem=t,this.$emitter.publish("QuickOrder/updateDuplicatedItem",{duplicatedItem:t})}updatePagination(t){this.page=t,this.$emitter.publish("QuickOrder/onPageChanged"),this.load()}handleUploadCSVItems(t){this.updateNotFoundProducts(t.errorProducts);let e=this._getProductsFromQuantityMap(t);(!e||e.length)&&(this.products="add"===t.option?this._mergeItems(this.products,e):e,this.load())}_getProductsFromQuantityMap(t){let{products:e,quantityMapping:i}=t,s=[];return e.forEach(t=>{let{productNumber:e,name:r,id:n,minPurchase:o,calculatedMaxPurchase:u,purchaseSteps:a,childCount:c}=t,l=i&&i[e]?i[e]:t.quantity;l>u&&(l=u),l<o&&(l=o);let d=r,h="";t?.variation?.length&&(h=t.variation.map(t=>`${t.group}: ${t.option}`).join(" | "),d=`${d} (${h})`),void 0!==l&&0===c&&s.push({id:n,productNumber:e,name:d,quantity:l,calculatedMaxPurchase:u,minPurchase:o,purchaseSteps:a})}),s}_mergeItems(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i={};return[...e,...t].forEach(t=>{i[t.id]||(i[t.id]=t)}),Object.values(i)}getProducts(){if(!this.limit)return this.products;let t=(this.page-1)*this.limit,e=t+this.limit;return this.products.slice(t,e)}getTotalPages(){return this.limit&&this.products.length?Math.ceil(this.products.length/this.limit):1}}},707(t,e,i){i.d(e,{A:()=>s});class s{static ucFirst(t){return t.charAt(0).toUpperCase()+t.slice(1)}static lcFirst(t){return t.charAt(0).toLowerCase()+t.slice(1)}static toDashCase(t){return t.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(t,e){let i=s.toUpperCamelCase(t,e);return s.lcFirst(i)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>s.ucFirst(t.toLowerCase())).join(""):s.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}}
1,737(t,e,i){i.d(e,{A:()=>u});var s=i(156),r=i.n(s),n=i(707);class o{constructor(t=document){this._el=t,t.$emitter=this,this._listeners=[]}publish(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=new CustomEvent(t,{detail:e,cancelable:i});return this.el.dispatchEvent(s),s}subscribe(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=this,r=t.split("."),n=i.scope?e.bind(i.scope):e;if(i.once&&!0===i.once){let e=n;n=function(i){s.unsubscribe(t),e(i)}}return this.el.addEventListener(r[0],n),this.listeners.push({splitEventName:r,opts:i,cb:n}),!0}unsubscribe(t){arguments.length>1&&"function"==typeof arguments[1]&&console.warn(`[NativeEventEmitter] Unsubscribing by passing the subscriber function as a second argument is not supported. By default, all listeners for the event will be removed. Use a suffix (separated by a dot) on the event name when subscribing/unsubscribing to identify/target your specific listener only, e.g. "${t}.MyCustomPlugin"`);let e=t.split(".");return this.listeners=this.listeners.reduce((t,i)=>([...i.splitEventName].sort().toString()===e.sort().toString()?this.el.removeEventListener(i.splitEventName[0],i.cb):t.push(i),t),[]),!0}reset(){return this.listeners.forEach(t=>{this.el.removeEventListener(t.splitEventName[0],t.cb)}),this.listeners=[],!0}get el(){return this._el}set el(t){this._el=t}get listeners(){return this._listeners}set listeners(t){this._listeners=t}}class u{constructor(t,e={},i=!1){if(!(t instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${i}".`);return}this.el=t,this.$emitter=new o(this.el),this._pluginName=this._getPluginName(i),this.options=this._mergeOptions(e),this._initialized=!1,this._registerInstance(),this._init()}init(){console.warn(`The "init" method for the plugin "${this._pluginName}" is not defined. The plugin will not be initialized.`)}update(){}destroy(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(t){let e=[this.constructor.options,this.options,t];return e.push(this._getConfigFromDataAttribute()),e.push(this._getOptionsFromDataAttribute()),r().all(e.filter(t=>t instanceof Object&&!(t instanceof Array)).map(t=>t||{}))}_getConfigFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=n.A.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${e}-config`);return i?window.PluginConfigManager.get(this._pluginName,i):t}_getOptionsFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=n.A.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${e}-options`);if(i)try{return JSON.parse(i)}catch(t){console.error(`The data attribute "data-${e}-options" could not be parsed to json: ${t.message}`)}return t}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(t){return t||(t=this.constructor.name),t}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.