1
0
mirror of https://codeberg.org/nobody/LocalCDN.git synced 2024-12-22 08:04:10 +01:00
LocalCDN-Firefox-Chrome-Brave/resources/findify-bundle/6.9.15/initializer.jsm

2 lines
45 KiB
JavaScript
Raw Normal View History

(window.findifyJsonp=window.findifyJsonp||[]).push([[5],{"+PzY":function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var o=n("PpOF"),a=n("G7Dt"),c=function(e){return Array.prototype.slice.call(e)},u=function(e){return void 0===e&&(e={}),Object.keys(e).reduce(function(t,n){return r({},t,((i={})[a.decamelize(n).replace("findify_","")]=e[n],i));var i},{})},s=function(e){return{product_id:"item_id",price_currency_code:"currency",order_number:"order_id"}[e]||e},l=function(e){return c(e).reduce(function(e,t){return r({},e,u(t.dataset),!!t.className&&((n={})[s(t.className)]=!t.children.length&&t.innerText||(e[s(t.className)]||[]).concat([l(t.children)]),n));var n},{})};t.getEventData=function(e){var t=u(e.dataset);if([o.EventName.purchase,o.EventName.updateCart].includes(t.event))return r({},t,{line_items:c(e.children).map(function(e){return u(e.dataset)})});var n=l(e.children);return r({},t,n)},t.getEventsOnPage=function(e){return c(e.querySelectorAll("[data-findify-event]")).map(t.getEventData).reduce(function(e,t){var n,o=t.event,a=i(t,["event"]);return r({},e,((n={})[o]=a,n))},{})},t.getDeprecatedEvents=function(e){var t={},n=e.querySelector(".findify_page_product"),o=e.querySelector(".findify_purchase_order");if(n){var a={item_id:n.innerHTML};t["page-view"]=a,t["view-page"]=a}if(o){var c=l(o.children),u=c.line_item,s=i(c,["line_item"]);t.purchase=r({},s,{line_items:u,revenue:u&&u.length&&u.reduce(function(e,t){var n=t.unit_price;return e+parseFloat(n)},0)})}return t}},"3qlQ":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFiltersOnPage=function(e){return Array.prototype.slice.call(e.querySelectorAll("[data-findify-filter]")).map(function(e){var t=e.getAttribute("data-findify-filter"),n=e.getAttribute("data-findify-filter-value"),r=e.getAttribute("data-findify-filter-type"),i=void 0;try{if(!isNaN(Number(n)))throw new Error;i=JSON.parse(n)}catch(e){i=[{value:n.split(/,|>/).map(function(e){return e&&e.trim()})}]}return{name:t,values:i,type:r||void 0}}).filter(function(e){return!!e})}},"4Iql":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scrollTo=void 0;var r,i=(r=n("AO1H"))&&r.__esModule?r:{default:r},o=n("zu4L"),a=new Map,c=(0,o.debounce)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(document){var n=a.get(e)||function(e){var t=document.querySelector(e.split(" ").map(function(e){return"."+e}).join(""));return a.set(e,t),t}(e);if(n&&!(n.getBoundingClientRect().top>0))return(0,i.default)(n,{offset:t})}},200);t.scrollTo=c},"5Ihg":function(e,t,n){"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),o(this,"states",void 0),o(this,"transitionMapping",{}),o(this,"signalProcessors",{}),o(this,"signa
//# sourceMappingURL=initializer.js.map