PageSourceSearch

https://ec-bilm.de/wp-content/cache/wpfc-minified/m1gkrxz3/47exj.js

js ec-bilm.de collected 2026-10-07 02:56:59 UTC 12,692 bytes, 222 lines download raw bytes

1// source --> https://ec-bilm.de/wp-content/plugins/woocommerce-germanized/build/static/unit-price-observer-queue.js?ver=4.1.4 
2/******/ (() => { // webpackBootstrap
3let __webpack_exports__ = {};
4/*global woocommerce_admin_meta_boxes, woocommerce_admin, accounting, woocommerce_admin_meta_boxes_order */
5window.germanized = window.germanized || {};
6(function ($, germanized) {
7  germanized.unit_price_observer_queue = {
8    queue: {},
9    timeout: null,
10    params: {},
11    request: null,
12    init: function () {
13      this.params = wc_gzd_unit_price_observer_queue_params;
14      this.queue = {};
15      this.queuesInExecution = {};
16      this.latestQueueInExection = '';
17      this.aborted = {};
18      this.timeout = null;
19      this.request = null;
20    },
21    execute: function () {
22      var self = germanized.unit_price_observer_queue,
23        data = [],
24        currentQueueId = Date.now() + '';
25      self.queuesInExecution[currentQueueId] = {
26        ...self.queue
27      };
28      self.latestQueueInExection = currentQueueId;
29      self.queue = {};
30
31      /**
32       * Reverse queue
33       */
34      Object.keys(self.queuesInExecution[currentQueueId]).forEach(function (queueKey) {
35        data = data.concat([{
36          'product_id': self.queuesInExecution[currentQueueId][queueKey].productId,
37          'price': self.queuesInExecution[currentQueueId][queueKey].priceData.price,
38          'price_sale': self.queuesInExecution[currentQueueId][queueKey].priceData.sale_price,
39          'quantity': self.queuesInExecution[currentQueueId][queueKey].priceData.quantity,
40          'is_range': self.queuesInExecution[currentQueueId][queueKey].priceData.hasOwnProperty('is_range') ? self.queuesInExecution[currentQueueId][queueKey].priceData.is_range : false,
41          'key': queueKey
42        }]);
43      });
44      self.request = $.ajax({
45        type: "POST",
46        url: self.params.wc_ajax_url.toString().replace('%%endpoint%%', 'gzd_refresh_unit_price'),
47        data: {
48          'security': self.params.refresh_unit_price_nonce,
49          'products': data,
50          'queue_id': currentQueueId
51        },
52        queueId: currentQueueId,
53        success: function (data) {
54          var xhrQueueId = this.queueId,
55            currentQueue = self.queuesInExecution.hasOwnProperty(xhrQueueId) ? self.queuesInExecution[xhrQueueId] : {},
56            aborted = self.aborted.hasOwnProperty(xhrQueueId) ? self.aborted[xhrQueueId] : {};
57          Object.keys(currentQueue).forEach(function (queueId) {
58            if (!aborted.hasOwnProperty(queueId)) {
59              var current = currentQueue[queueId],
60                observer = current.observer,
61                priceData = current.priceData,
62                priceSelector = current.priceSelector,
63                isPrimary = current.isPrimary,
64                unitPrices = self.getUnitPricesFromMap(priceData.unit_price);
65              if (observer) {
66                if (data.products.hasOwnProperty(queueId)) {
67                  var response = data.products[queueId];
68                  observer.stopObserver(observer, priceSelector);
69
70                  /**
71                   * Do only adjust unit price in case current product id has not changed
72                   * in the meantime (e.g. variation change).
73                   */
74                  if (parseInt(response.product_id) === observer.getCurrentProductId(observer)) {
75                    if (response.hasOwnProperty('unit_price_html')) {
76                      observer.unsetUnitPriceLoading(observer, unitPrices, response.unit_price_html);
77                    } else {
78                      observer.unsetUnitPriceLoading(observer, unitPrices);
79                    }
80                  } else {
81                    observer.unsetUnitPriceLoading(observer, unitPrices);
82                  }
83                  observer.startObserver(observer, priceSelector, isPrimary);
84                } else {
85                  observer.stopObserver(observer, priceSelector);
86                  observer.unsetUnitPriceLoading(observer, unitPrices);
87                  observer.startObserver(observer, priceSelector, isPrimary);
88                }
89              }
90            } else {
91              delete self.aborted[xhrQueueId][queueId];
92            }
93          });
94          delete self.queuesInExecution[xhrQueueId];
95        },
96        error: function () {
97          var xhrQueueId = this.queueId,
98            currentQueue = self.queuesInExecution.hasOwnProperty(xhrQueueId) ? self.queuesInExecution[xhrQueueId] : {},
99            aborted = self.aborted.hasOwnProperty(xhrQueueId) ? self.aborted[xhrQueueId] : {};
100          Object.keys(currentQueue).forEach(function (queueId) {
101            if (!aborted.hasOwnProperty(queueId)) {
102              var current = currentQueue[queueId],
103                observer = current.observer,
104                priceData = current.priceData,
105                priceSelector = current.priceSelector,
106                isPrimary = current.isPrimary,
107                unitPrices = self.getUnitPricesFromMap(priceData.unit_price);
108              if (observer) {
109                observer.stopObserver(observer, priceSelector);
110                observer.unsetUnitPriceLoading(observer, unitPrices);
111                observer.startObserver(observer, priceSelector, isPrimary);
112              }
113            } else {
114              delete self.aborted[xhrQueueId][queueId];
115            }
116          });
117          delete self.queuesInExecution[xhrQueueId];
118        },
119        dataType: 'json'
120      });
121    },
122    getUnitPricesFromMap: function (unitPriceMap) {
123      let unitPrices = [];
124      unitPriceMap.forEach(function (unitPrice) {
125        unitPrices = $.merge(unitPrices, $(unitPrice));
126      });
127      return $(unitPrices);
128    },
129    getQueueKey: function (productId) {
130      return (productId + '').replace(/[^a-zA-Z0-9]/g, '');
131    },
132    getLatestQueueInExecution() {
133      var self = germanized.unit_price_observer_queue;
134      return self.queuesInExecution.hasOwnProperty(self.latestQueueInExection) ? self.queuesInExecution[self.latestQueueInExection] : {};
135    },
136    exists: function (productId) {
137      var self = germanized.unit_price_observer_queue,
138        queueKey = self.getQueueKey(productId);
139      return self.queue.hasOwnProperty(queueKey) || self.getLatestQueueInExecution().hasOwnProperty(queueKey);
140    },
141    get: function (productId) {
142      var self = germanized.unit_price_observer_queue,
143        queueKey = self.getQueueKey(productId),
144        queueInExecution = self.getLatestQueueInExecution().hasOwnProperty(queueKey);
145      if (queueInExecution.hasOwnProperty(queueKey)) {
146        return queueInExecution[queueKey];
147      } else if (self.queue.hasOwnProperty(queueKey)) {
148        return self.queue[queueKey];
149      }
150      return false;
151    },
152    abort: function (productId) {
153      var self = germanized.unit_price_observer_queue,
154        queueKey = self.getQueueKey(productId),
155        latestQueueInExecutionKey = self.latestQueueInExection,
156        latestQueueInExecution = self.queuesInExecution.hasOwnProperty(latestQueueInExecutionKey) ? self.queuesInExecution[latestQueueInExecutionKey] : {};
157      if (latestQueueInExecution.hasOwnProperty(queueKey)) {
158        var current = latestQueueInExecution[queueKey],
159          observer = current.observer,
160          priceData = current.priceData,
161          priceSelector = current.priceSelector,
162          isPrimary = current.isPrimary,
163          unitPrices = self.getUnitPricesFromMap(priceData.unit_price);
164        if (observer) {
165          observer.stopObserver(observer, priceSelector);
166          observer.unsetUnitPriceLoading(observer, unitPrices);
167          observer.startObserver(observer, priceSelector, isPrimary);
168        }
169        if (!self.aborted.hasOwnProperty(latestQueueInExecutionKey)) {
170          self.aborted[latestQueueInExecutionKey] = {};
171        }
172        self.aborted[latestQueueInExecutionKey][queueKey] = current;
173        return true;
174      }
175      return false;
176    },
177    add: function (observer, productId, priceData, priceSelector, isPrimary) {
178      var self = germanized.unit_price_observer_queue,
179        queueKey = self.getQueueKey(productId);
180      if (self.queue.hasOwnProperty(queueKey)) {
181        priceData['unit_price'].each(function (i, obj) {
182          if (!self.queue[queueKey]['priceData']['unit_price'].has(obj)) {
183            self.queue[queueKey]['priceData']['unit_price'].set(obj, obj);
184          }
185        });
186      } else {
187        var unitPrices = new Map();
188        priceData['unit_price'].each(function (i, obj) {
189          unitPrices.set(obj, obj);
190        });
191        priceData['unit_price'] = unitPrices;
192        self.queue[queueKey] = {
193          'productId': productId,
194          'observer': observer,
195          'priceData': priceData,
196          'priceSelector': priceSelector,
197          'isPrimary': isPrimary
198        };
199      }
200      clearTimeout(self.timeout);
201      self.timeout = setTimeout(self.execute, 500);
202    }
203  };
204  $(document).ready(function () {
205    germanized.unit_price_observer_queue.init();
206  });
207})(jQuery, window.germanized);
208((window.germanized = window.germanized || {})["static"] = window.germanized["static"] || {})["unit-price-observer-queue"] = __webpack_exports__;
209/******/ })()
210;
211// source --> https://ec-bilm.de/wp-content/plugins/woocommerce/assets/js/accounting/accounting.min.js?ver=0.4.2 
212/*!
213 * accounting.js v0.4.2
214 * Copyright 2014 Open Exchange Rates
215 *
216 * Freely distributable under the MIT license.
217 * Portions of accounting.js are inspired or borrowed from underscore.js
218 *
219 * Full details and documentation:
220 * http://openexchangerates.github.io/accounting.js/
221 */
222!function(n,r){var e={version:"0.4.1",settings:{currency:{symbol:"$",format:"%s%v",decimal:".",thousand:",",precision:2,grouping:3},number:{precision:0,grouping:3,thousand:",",decimal:"."}}},t=Array.prototype.map,o=Array.isArray,a=Object.prototype.toString;function i(n){return!!(""===n||n&&n.charCodeAt&&n.substr)}function u(n){return o?o(n):"[object Array]"===a.call(n)}function c(n){return n&&"[object Object]"===a.call(n)}function s(n,r){var e;for(e in n=n||{},r=r||{})r.hasOwnProperty(e)&&null==n[e]&&(n[e]=r[e]);return n}function f(n,r,e){var o,a,i=[];if(!n)return i;if(t&&n.map===t)return n.map(r,e);for(o=0,a=n.length;o<a;o++)i[o]=r.call(e,n[o],o,n);return i}function p(n,r){return n=Math.round(Math.abs(n)),isNaN(n)?r:n}function l(n){var r=e.settings.currency.format;return"function"==typeof n&&(n=n()),i(n)&&n.match("%v")?{pos:n,neg:n.replace("-","").replace("%v","-%v"),zero:n}:n&&n.pos&&n.pos.match("%v")?n:i(r)?e.settings.currency.format={pos:r,neg:r.replace("%v","-%v"),zero:r}:r}var m,d=e.unformat=e.parse=function(n,r){if(u(n))return f(n,function(n){return d(n,r)});if("number"==typeof(n=n||0))return n;r=r||e.settings.number.decimal;var t=new RegExp("[^0-9-"+r+"]",["g"]),o=parseFloat((""+n).replace(/\((.*)\)/,"-$1").replace(t,"").replace(r,"."));return isNaN(o)?0:o},g=e.toFixed=function(n,r){r=p(r,e.settings.number.precision);var t=Math.pow(10,r);return(Math.round(e.unformat(n)*t)/t).toFixed(r)},h=e.formatNumber=e.format=function(n,r,t,o){if(u(n))return f(n,function(n){return h(n,r,t,o)});n=d(n);var a=s(c(r)?r:{precision:r,thousand:t,decimal:o},e.settings.number),i=p(a.precision),l=n<0?"-":"",m=parseInt(g(Math.abs(n||0),i),10)+"",y=m.length>3?m.length%3:0;return l+(y?m.substr(0,y)+a.thousand:"")+m.substr(y).replace(/(\d{3})(?=\d)/g,"$1"+a.thousand)+(i?a.decimal+g(Math.abs(n),i).split(".")[1]:"")},y=e.formatMoney=function(n,r,t,o,a,i){if(u(n))return f(n,function(n){return y(n,r,t,o,a,i)});n=d(n);var m=s(c(r)?r:{symbol:r,precision:t,thousand:o,decimal:a,format:i},e.settings.currency),g=l(m.format);return(n>0?g.pos:n<0?g.neg:g.zero).replace("%s",m.symbol).replace("%v",h(Math.abs(n),p(m.precision),m.thousand,m.decimal))};e.formatColumn=function(n,r,t,o,a,m){if(!n)return[];var g=s(c(r)?r:{symbol:r,precision:t,thousand:o,decimal:a,format:m},e.settings.currency),y=l(g.format),b=y.pos.indexOf("%s")<y.pos.indexOf("%v"),v=0;return f(f(n,function(n,r){if(u(n))return e.formatColumn(n,g);var t=((n=d(n))>0?y.pos:n<0?y.neg:y.zero).replace("%s",g.symbol).replace("%v",h(Math.abs(n),p(g.precision),g.thousand,g.decimal));return t.length>v&&(v=t.length),t}),function(n,r){return i(n)&&n.length<v?b?n.replace(g.symbol,g.symbol+new Array(v-n.length+1).join(" ")):new Array(v-n.length+1).join(" ")+n:n})},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=e),exports.accounting=e):"function"==typeof define&&define.amd?define([],function(){return e}):(e.noConflict=(m=n.accounting,function(){return n.accounting=m,e.noConflict=void 0,e}),n.accounting=e)}(this);

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.