@ikas/storefront 6.1.0-beta.370 → 6.1.0-beta.371

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{__assign as e,__awaiter as t,__generator as n}from'./../ext/tslib/tslib.es6.js';import{makeAutoObservable as r}from"mobx";import{IkasStorefrontConfig as i}from"@ikas/storefront-config";var o="undefined"==typeof window,c=function(){function c(){r(this)}return Object.defineProperty(c,"openAiPixelId",{get:function(){return i.getOpenAiPixelId()},enumerable:!1,configurable:!0}),c.measure=function(e,t,n){!o&&this.openAiPixelId&&this.pendingAdvancedMatching.then((function(){var r=window.oaiq;r&&r("measure",e,t,n?{event_id:n}:{})})).catch((function(e){return console.error(e)}))},c.pageView=function(e){try{return void this.measure("page_viewed",{type:"contents"},e)}catch(e){console.error(e)}},c.productView=function(t,n){try{return void this.measure("contents_viewed",(r=t,i=r.selectedVariant,o=s(i.price.finalPrice,i.price.currency||void 0),e(e({type:"contents"},o),{contents:[e({id:i.id,group_id:r.id,name:r.name,content_type:"product",quantity:1},o)]})),n)}catch(e){console.error(e)}var r,i,o},c.addToCart=function(t,n,r){try{return void this.measure("items_added",function(t,n){return e(e({type:"contents"},s((t.finalPrice||0)*n,t.currencyCode||void 0)),{contents:[u(t,n)]})}(t,n),r)}catch(e){console.error(e)}},c.beginCheckout=function(e,t){try{return void this.measure("checkout_started",a(e),t)}catch(e){console.error(e)}},c.purchase=function(e,t){try{return void this.measure("order_created",a(e),t)}catch(e){console.error(e)}},c.completeRegistration=function(e){try{return void this.measure("registration_completed",{type:"customer_action"},e)}catch(e){console.error(e)}},c.contactForm=function(e){try{return void this.measure("lead_created",{type:"customer_action"},e)}catch(e){console.error(e)}},c.initAdvancedMatching=function(e){var r=this.openAiPixelId;return!o&&r&&window.oaiq?(this.pendingAdvancedMatching=this.pendingAdvancedMatching.then((function(){return function(e,r){return t(this,void 0,void 0,(function(){var t,i,o,c,a,u,s,d;return n(this,(function(n){switch(n.label){case 0:return[4,Promise.all([v(p(r.em)),v(f(r.ph)),v(l(r.external_id)),v(h(r.fn)),v(h(r.ln))])];case 1:return t=n.sent(),i=t[0],o=t[1],c=t[2],a=t[3],u=t[4],s={},i&&(s.email_sha256=i),o&&(s.phone_number_sha256=o),c&&(s.external_id_sha256=c),a&&(s.first_name_sha256=a),u&&(s.last_name_sha256=u),r.country&&(s.country=r.country.toUpperCase().trim()),r.ct&&(s.city=r.ct.trim()),r.st&&(s.region=r.st.trim()),r.zp&&(s.postal_code=r.zp.trim()),(d=window.oaiq)&&Object.keys(s).length>0&&d("init",{pixelId:e,user:s}),[2]}}))}))}(r,e)})).catch((function(e){return console.error(e)})),this.pendingAdvancedMatching):this.pendingAdvancedMatching},c.pendingAdvancedMatching=Promise.resolve(),c}();function a(t){var n,r=(null===(n=t.items[0])||void 0===n?void 0:n.currencyCode)||t.currencyCode||void 0,i=t.items.map((function(e){return u(e,e.quantity)}));return e(e({type:"contents"},s(t.totalFinalPrice,r)),i.length?{contents:i}:{})}function u(t,n){var r=t.variant.productId;return e(e(e({id:t.variant.id||""},r?{group_id:r}:{}),{name:t.variant.name,content_type:"product",quantity:n}),s(t.finalPrice,t.currencyCode||void 0))}function s(e,t){var n=function(e,t){try{if("number"!=typeof e||isNaN(e)||!t)return;var n=d.get(t);return void 0===n&&(n=new Intl.NumberFormat("en",{style:"currency",currency:t}).resolvedOptions().maximumFractionDigits,d.set(t,n)),Math.round(e*Math.pow(10,n))}catch(e){return}}(e,t);return void 0!==n&&t?{amount:n,currency:t}:{}}var d=new Map;function p(e){return e?e.trim().toLowerCase():""}function f(e){if(!e)return"";var t=e.replace(/\D/g,"").replace(/^0+/,"");return/^\d{8,15}$/.test(t)?t:""}function l(e){return e?e.trim():""}function h(e){return e?e.toLowerCase().replace(/[\s!-/:-@[-`{-~]/g,""):""}var m=new Map;function v(e){if(!e)return Promise.resolve(void 0);var r=m.get(e);return r||(r=function(e){return t(this,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:if("undefined"==typeof crypto||!crypto.subtle||"undefined"==typeof TextEncoder)return[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,crypto.subtle.digest("SHA-256",(new TextEncoder).encode(e))];case 2:return t=n.sent(),[2,Array.from(new Uint8Array(t)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")];case 3:return n.sent(),[2];case 4:return[2]}}))}))}(e),m.set(e,r)),r}export{c as OpenAiPixel};
1
+ import{__assign as e,__awaiter as t,__generator as n}from'./../ext/tslib/tslib.es6.js';import{makeAutoObservable as r}from"mobx";import{IkasStorefrontConfig as i}from"@ikas/storefront-config";var o="undefined"==typeof window,c=function(){function c(){r(this)}return Object.defineProperty(c,"openAiPixelId",{get:function(){return i.getOpenAiPixelId()},enumerable:!1,configurable:!0}),c.measure=function(e,t,n){!o&&this.openAiPixelId&&this.pendingAdvancedMatching.then((function(){var r=window.oaiq;r&&r("measure",e,t,n?{event_id:n}:{})})).catch((function(e){return console.error(e)}))},c.pageView=function(e){try{return void this.measure("page_viewed",{type:"contents"},e)}catch(e){console.error(e)}},c.productView=function(t,n){try{return void this.measure("contents_viewed",(r=t,i=r.selectedVariant,o=s(i.price.finalPrice,i.price.currency||void 0),e(e({type:"contents"},o),{contents:[e({id:i.id,name:r.name,content_type:"product",quantity:1},o)]})),n)}catch(e){console.error(e)}var r,i,o},c.addToCart=function(t,n,r){try{return void this.measure("items_added",function(t,n){return e(e({type:"contents"},s((t.finalPrice||0)*n,t.currencyCode||void 0)),{contents:[u(t,n)]})}(t,n),r)}catch(e){console.error(e)}},c.beginCheckout=function(e,t){try{return void this.measure("checkout_started",a(e),t)}catch(e){console.error(e)}},c.purchase=function(e,t){try{return void this.measure("order_created",a(e),t)}catch(e){console.error(e)}},c.completeRegistration=function(e){try{return void this.measure("registration_completed",{type:"customer_action"},e)}catch(e){console.error(e)}},c.contactForm=function(e){try{return void this.measure("lead_created",{type:"customer_action"},e)}catch(e){console.error(e)}},c.initAdvancedMatching=function(e){var r=this.openAiPixelId;return!o&&r&&window.oaiq?(this.pendingAdvancedMatching=this.pendingAdvancedMatching.then((function(){return function(e,r){return t(this,void 0,void 0,(function(){var t,i,o,c,a,u,s,d;return n(this,(function(n){switch(n.label){case 0:return[4,Promise.all([v(p(r.em)),v(f(r.ph)),v(l(r.external_id)),v(h(r.fn)),v(h(r.ln))])];case 1:return t=n.sent(),i=t[0],o=t[1],c=t[2],a=t[3],u=t[4],s={},i&&(s.email_sha256=i),o&&(s.phone_number_sha256=o),c&&(s.external_id_sha256=c),a&&(s.first_name_sha256=a),u&&(s.last_name_sha256=u),r.country&&(s.country=r.country.toUpperCase().trim()),r.ct&&(s.city=r.ct.trim()),r.st&&(s.region=r.st.trim()),r.zp&&(s.postal_code=r.zp.trim()),(d=window.oaiq)&&Object.keys(s).length>0&&d("init",{pixelId:e,user:s}),[2]}}))}))}(r,e)})).catch((function(e){return console.error(e)})),this.pendingAdvancedMatching):this.pendingAdvancedMatching},c.pendingAdvancedMatching=Promise.resolve(),c}();function a(t){var n,r=(null===(n=t.items[0])||void 0===n?void 0:n.currencyCode)||t.currencyCode||void 0,i=t.items.map((function(e){return u(e,e.quantity)}));return e(e({type:"contents"},s(t.totalFinalPrice,r)),i.length?{contents:i}:{})}function u(t,n){return e({id:t.variant.id||"",name:t.variant.name,content_type:"product",quantity:n},s(t.finalPrice,t.currencyCode||void 0))}function s(e,t){var n=function(e,t){try{if("number"!=typeof e||isNaN(e)||!t)return;var n=d.get(t);return void 0===n&&(n=new Intl.NumberFormat("en",{style:"currency",currency:t}).resolvedOptions().maximumFractionDigits,d.set(t,n)),Math.round(e*Math.pow(10,n))}catch(e){return}}(e,t);return void 0!==n&&t?{amount:n,currency:t}:{}}var d=new Map;function p(e){return e?e.trim().toLowerCase():""}function f(e){if(!e)return"";var t=e.replace(/\D/g,"").replace(/^0+/,"");return/^\d{8,15}$/.test(t)?t:""}function l(e){return e?e.trim():""}function h(e){return e?e.toLowerCase().replace(/[\s!-/:-@[-`{-~]/g,""):""}var m=new Map;function v(e){if(!e)return Promise.resolve(void 0);var r=m.get(e);return r||(r=function(e){return t(this,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:if("undefined"==typeof crypto||!crypto.subtle||"undefined"==typeof TextEncoder)return[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,crypto.subtle.digest("SHA-256",(new TextEncoder).encode(e))];case 2:return t=n.sent(),[2,Array.from(new Uint8Array(t)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")];case 3:return n.sent(),[2];case 4:return[2]}}))}))}(e),m.set(e,r)),r}export{c as OpenAiPixel};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "6.1.0-beta.370",
3
+ "version": "6.1.0-beta.371",
4
4
  "description": "Storefront functionality for ikas storefront themes.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",
@@ -23,11 +23,11 @@
23
23
  "swiper": "11.0.6"
24
24
  },
25
25
  "devDependencies": {
26
- "@ikas/storefront-api": "^6.1.0-beta.370",
27
- "@ikas/storefront-config": "^6.1.0-beta.370",
28
- "@ikas/storefront-model-functions": "^6.1.0-beta.370",
29
- "@ikas/storefront-models": "^6.1.0-beta.370",
30
- "@ikas/storefront-providers": "^6.1.0-beta.370",
26
+ "@ikas/storefront-api": "^6.1.0-beta.371",
27
+ "@ikas/storefront-config": "^6.1.0-beta.371",
28
+ "@ikas/storefront-model-functions": "^6.1.0-beta.371",
29
+ "@ikas/storefront-models": "^6.1.0-beta.371",
30
+ "@ikas/storefront-providers": "^6.1.0-beta.371",
31
31
  "@ikas/localized-address": "1.0.0-beta.6",
32
32
  "@adyen/adyen-web": "^5.57.0",
33
33
  "@rollup/plugin-commonjs": "^22.0.0",
@@ -62,11 +62,11 @@
62
62
  },
63
63
  "peerDependencies": {
64
64
  "@ikas/localized-address": "1.0.0-beta.6",
65
- "@ikas/storefront-api": "^6.1.0-beta.370",
66
- "@ikas/storefront-config": "^6.1.0-beta.370",
67
- "@ikas/storefront-model-functions": "^6.1.0-beta.370",
68
- "@ikas/storefront-models": "^6.1.0-beta.370",
69
- "@ikas/storefront-providers": "^6.1.0-beta.370",
65
+ "@ikas/storefront-api": "^6.1.0-beta.371",
66
+ "@ikas/storefront-config": "^6.1.0-beta.371",
67
+ "@ikas/storefront-model-functions": "^6.1.0-beta.371",
68
+ "@ikas/storefront-models": "^6.1.0-beta.371",
69
+ "@ikas/storefront-providers": "^6.1.0-beta.371",
70
70
  "mobx": "^6.1.3",
71
71
  "mobx-react-lite": "^3.1.5",
72
72
  "next": "12.2.0",