@ikas/storefront-next 6.1.0-beta.39 → 6.1.0-beta.391

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{__awaiter as e,__generator as r}from'./../ext/tslib/tslib.es6.js';import t from"fs";import n from"path";import o from"adm-zip";import s from"axios";import i from"@ikas/storefront-assets/checkout/de.js";import c from"@ikas/storefront-assets/checkout/en.js";import a from"@ikas/storefront-assets/checkout/fr.js";import u from"@ikas/storefront-assets/checkout/tr.js";import{corsMiddleware as l}from"./middleware.js";var d=function(s,d){return e(void 0,void 0,void 0,(function(){var e,h,y,v,g,S,j,w,b;return r(this,(function(r){switch(r.label){case 0:return[4,l(s,d)];case 1:r.sent(),e=function(){d.statusCode=200,d.setHeader("Content-Type","application/json"),d.json({status:"ok"})},h=function(){d.statusCode=400,d.setHeader("Content-Type","application/json"),d.json({status:"failed"})},y="",r.label=2;case 2:return r.trys.push([2,9,10,11]),[4,new Promise((function(e,r){var o=n.join(process.cwd(),"src","theme.json");t.readFile(o,(function(t,n){if(t)return console.error("An error occurred while reading the theme.json file!"),r(t);e(JSON.parse(n.toString()))}))}))];case 3:return v=r.sent(),[4,new Promise((function(e,r){var o=n.join(process.cwd(),"public","locales"),s=function(e){return e.length?e.split(".")[0]:e};t.readdir(o,(function(l,d){if(l)return r(l);var h=d.filter((function(e){return t.lstatSync(n.join(o,e)).isDirectory()})),f={},p=!1;h.forEach((function(e){var r=n.join(process.cwd(),"public","locales",e);f[e]={};try{var o=t.readdirSync(r);o.forEach((function(r){var o=t.readFileSync(n.join(process.cwd(),"public","locales",e,r)),l=s(e).toLowerCase(),d=s(r);f[l][d]=JSON.parse(o.toString()),f[l]["checkout-page"]="tr"===l?u:"de"===l?i:"fr"===l?a:c}))}catch(e){console.error("An error occurred while reading localization files!"),console.error(e),p=!0}})),p?r(null):e(f)}))}))];case 4:return g=r.sent(),[4,f(v,g)];case 5:return S=r.sent(),j=!1,"string"!=typeof S?[3,8]:(T=n.join(process.cwd()),N="theme.zip",L=n.join(process.cwd(),N),k=new o,C=["node_modules",".next","out",".git"],t.readdirSync(T).forEach((function(e){var r=n.join(T,e);if(t.lstatSync(r).isDirectory()){if(C.includes(e))return;k.addLocalFolder(r,e)}else k.addLocalFile(e)})),k.writeZip(L),y=L,w=t.statSync(y),[4,p(S,t.readFileSync(y),w.size)]);case 6:return(j=r.sent())?[4,m()]:[3,8];case 7:j=r.sent(),r.label=8;case 8:return j?e():h(),[3,11];case 9:return b=r.sent(),console.error(b),h(),[3,11];case 10:return y&&function(e){try{t.unlinkSync(e)}catch(e){console.error("An error occurrred while deleting the zip file!"),console.error(e)}}(y),[7];case 11:return[2]}var T,N,L,k,C}))}))},h={};function f(t,n){return e(this,void 0,void 0,(function(){var e,o,i,c,a;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),e=Object.keys(n),o=e.some((function(e){return"en"===e}))?"en":e[0],[4,y()];case 1:return i=r.sent(),[4,s({method:"post",url:process.env.NEXT_PUBLIC_PARTNER_GQL_URL,headers:{"x-api-key":i.apiKey,"Content-Type":"application/json"},data:JSON.stringify({query:"\n mutation createNewThemeVersion($input: CreateNewThemeVersionInput!) {\n createNewThemeVersion(input: $input) {\n themeVersionId\n uploadUrl\n }\n }\n ",variables:{input:{themeId:i.themeId,themeSecret:i.themeSecret,themeJson:JSON.stringify(t),locales:Object.entries(n).map((function(e){var r=e[0],t=e[1];return{isDefaultLocale:r===o,locale:r,localeJson:JSON.stringify(t)}}))}}})})];case 2:return[4,r.sent().data];case 3:return(c=r.sent()).data&&c.data.createNewThemeVersion?[2,c.data.createNewThemeVersion.uploadUrl]:[3,5];case 4:return a=r.sent(),console.error("An error occurred during saveTheme!"),console.log(a),[3,5];case 5:return[2]}}))}))}function p(t,n,o){return e(this,void 0,void 0,(function(){var e,i;return r(this,(function(r){switch(r.label){case 0:e={headers:{"Content-Type":"application/zip","Content-Length":o+""},maxBodyLength:104857600,maxContentLength:104857600},r.label=1;case 1:return r.trys.push([1,3,,4]),[4,s.put(t,n,e)];case 2:return[2,200===r.sent().status];case 3:return i=r.sent(),console.error("An error occurred during uploadTheme!"),console.log(i),[2,!1];case 4:return[2]}}))}))}function m(){return e(this,void 0,void 0,(function(){var e,t;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),[4,y()];case 1:return e=r.sent(),[4,fetch(process.env.NEXT_PUBLIC_PARTNER_GQL_URL,{method:"POST",body:JSON.stringify({query:"\n mutation buildThemeLatestVersion(\n $themeSecret: String!\n $themeId: String!\n ) {\n buildThemeLatestVersion(\n themeSecret: $themeSecret\n themeId: $themeId\n )\n }\n ",variables:{themeSecret:e.themeSecret,themeId:e.themeId}}),headers:{"x-api-key":e.apiKey,"Content-Type":"application/json"}})];case 2:return[4,r.sent().json()];case 3:return r.sent(),[2,!0];case 4:return t=r.sent(),console.error("An error occurred during buildTheme!"),console.log(t),[2,!1];case 5:return[2]}}))}))}function y(){return new Promise((function(e,r){var o=n.join(process.cwd(),"config.json");t.readFile(o,(function(t,n){if(t)return console.error("An error occurred while reading the storefront config!"),r(t);e(JSON.parse(n.toString()))}))}))}export{h as config,d as uploadTheme};
1
+ import{__awaiter as e,__generator as r}from'./../ext/tslib/tslib.es6.js';import n from"fs";import t from"path";import o from"adm-zip";import s from"axios";import i from"@ikas/storefront-assets/checkout/de.js";import a from"@ikas/storefront-assets/checkout/en.js";import c from"@ikas/storefront-assets/checkout/fr.js";import u from"@ikas/storefront-assets/checkout/tr.js";import{corsMiddleware as l}from"./middleware.js";var d=function(s,d){return e(void 0,void 0,void 0,(function(){var e,p,y,T,g,j,v,w,b,S,k;return r(this,(function(r){switch(r.label){case 0:return[4,l(s,d)];case 1:if(r.sent(),"POST"!==s.method)return d.statusCode=405,d.setHeader("Allow","POST"),d.setHeader("Content-Type","application/json"),d.json({status:"failed",message:"Method not allowed. Use POST."}),[2];if(!(e=function(e){if(!e||"object"!=typeof e)return null;var r=e.uploadToken;return"string"==typeof r&&r.trim().length?r:null}(s.body)))return d.statusCode=400,d.setHeader("Content-Type","application/json"),d.json({status:"failed",message:"uploadToken is required and must be a non-empty string."}),[2];p=function(){d.statusCode=200,d.setHeader("Content-Type","application/json"),d.json({status:"ok"})},y=function(){d.statusCode=400,d.setHeader("Content-Type","application/json"),d.json({status:"failed"})},T=function(){d.statusCode=403,d.setHeader("Content-Type","application/json"),d.json({status:"failed",code:"UNAUTHORIZED"})},g="",r.label=2;case 2:return r.trys.push([2,9,10,11]),[4,new Promise((function(e,r){var o=t.join(process.cwd(),"src","theme.json");n.readFile(o,(function(n,t){if(n)return console.error("An error occurred while reading the theme.json file!"),r(n);e(JSON.parse(t.toString()))}))}))];case 3:return j=r.sent(),[4,new Promise((function(e,r){var o=t.join(process.cwd(),"public","locales"),s=function(e){return e.length?e.split(".")[0]:e};n.readdir(o,(function(l,d){if(l)return r(l);var p=d.filter((function(e){return n.lstatSync(t.join(o,e)).isDirectory()})),f={},h=!1;p.forEach((function(e){var r=t.join(process.cwd(),"public","locales",e);f[e]={};try{var o=n.readdirSync(r);o.forEach((function(r){var o=n.readFileSync(t.join(process.cwd(),"public","locales",e,r)),l=s(e).toLowerCase(),d=s(r);f[l][d]=JSON.parse(o.toString()),f[l]["checkout-page"]="tr"===l?u:"de"===l?i:"fr"===l?c:a}))}catch(e){console.error("An error occurred while reading localization files!"),console.error(e),h=!0}})),h?r(null):e(f)}))}))];case 4:return v=r.sent(),[4,f(j,v,e)];case 5:return null===(w=r.sent())?(T(),[2]):(b=!1,"string"!=typeof w?[3,8]:(C=t.join(process.cwd()),N="theme.zip",L=t.join(process.cwd(),N),O=new o,A=["node_modules",".next","out",".git"],n.readdirSync(C).forEach((function(e){var r=t.join(C,e);if(n.lstatSync(r).isDirectory()){if(A.includes(e))return;O.addLocalFolder(r,e)}else O.addLocalFile(e)})),O.writeZip(L),g=L,S=n.statSync(g),[4,h(w,n.readFileSync(g),S.size)]));case 6:return(b=r.sent())?[4,m(e)]:[3,8];case 7:b=r.sent(),r.label=8;case 8:return b?p():y(),[3,11];case 9:return k=r.sent(),console.error(k),y(),[3,11];case 10:return g&&function(e){try{n.unlinkSync(e)}catch(e){console.error("An error occurrred while deleting the zip file!"),console.error(e)}}(g),[7];case 11:return[2]}var C,N,L,O,A}))}))},p={};function f(n,t,o){return e(this,void 0,void 0,(function(){var e,i,a,c,u;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),e=Object.keys(t),i=e.some((function(e){return"en"===e}))?"en":e[0],[4,T()];case 1:return a=r.sent(),[4,s({method:"post",url:process.env.NEXT_PUBLIC_PARTNER_GQL_URL,headers:{"Content-Type":"application/json"},data:JSON.stringify({query:"\n mutation createNewThemeVersion($input: CreateNewThemeVersionInput!) {\n createNewThemeVersion(input: $input) {\n themeVersionId\n uploadUrl\n }\n }\n ",variables:{input:{themeId:a.themeId,uploadToken:o,themeJson:JSON.stringify(n),locales:Object.entries(t).map((function(e){var r=e[0],n=e[1];return{isDefaultLocale:r===i,locale:r,localeJson:JSON.stringify(n)}}))}}})})];case 2:return[4,r.sent().data];case 3:return(c=r.sent()).data&&c.data.createNewThemeVersion?[2,c.data.createNewThemeVersion.uploadUrl]:(y("saveTheme",c.errors),!c.errors&&c.data&&null===c.data.createNewThemeVersion?[2,null]:[3,5]);case 4:return u=r.sent(),console.error("An error occurred during saveTheme!",null==u?void 0:u.message),[3,5];case 5:return[2]}}))}))}function h(n,t,o){return e(this,void 0,void 0,(function(){var e,i;return r(this,(function(r){switch(r.label){case 0:e={headers:{"Content-Type":"application/zip","Content-Length":o+""},maxBodyLength:104857600,maxContentLength:104857600},r.label=1;case 1:return r.trys.push([1,3,,4]),[4,s.put(n,t,e)];case 2:return[2,200===r.sent().status];case 3:return i=r.sent(),console.error("An error occurred during uploadTheme!"),console.log(i),[2,!1];case 4:return[2]}}))}))}function m(n){return e(this,void 0,void 0,(function(){var e,t,o;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),[4,T()];case 1:return e=r.sent(),[4,fetch(process.env.NEXT_PUBLIC_PARTNER_GQL_URL,{method:"POST",body:JSON.stringify({query:"\n mutation buildThemeLatestVersion(\n $themeId: String!\n $uploadToken: String!\n ) {\n buildThemeLatestVersion(\n themeId: $themeId\n uploadToken: $uploadToken\n )\n }\n ",variables:{themeId:e.themeId,uploadToken:n}}),headers:{"Content-Type":"application/json"}})];case 2:return[4,r.sent().json()];case 3:return!(t=r.sent()).errors&&t.data&&!0===t.data.buildThemeLatestVersion?[2,!0]:(y("buildTheme",t.errors),[2,!1]);case 4:return o=r.sent(),console.error("An error occurred during buildTheme!",null==o?void 0:o.message),[2,!1];case 5:return[2]}}))}))}function y(e,r){var n=Array.isArray(r)?r.map((function(e){return e&&e.message})):[];console.error("".concat(e," failed!"),n)}function T(){return new Promise((function(e,r){var o=t.join(process.cwd(),"config.json");n.readFile(o,(function(n,t){if(n)return console.error("An error occurred while reading the storefront config!"),r(n);e(JSON.parse(t.toString()))}))}))}export{p as config,d as uploadTheme};
@@ -1 +1 @@
1
- var n=function(){return n=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n},n.apply(this,arguments)};function t(n,t,e,r){return new(e||(e=Promise))((function(o,a){function l(n){try{i(r.next(n))}catch(n){a(n)}}function c(n){try{i(r.throw(n))}catch(n){a(n)}}function i(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(l,c)}i((r=r.apply(n,t||[])).next())}))}function e(n,t){var e,r,o,a,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(a){return function(c){return function(a){if(e)throw new TypeError("Generator is already executing.");for(;l;)try{if(e=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return l.label++,{value:a[1],done:!1};case 5:l.label++,r=a[1],a=[0];continue;case 7:a=l.ops.pop(),l.trys.pop();continue;default:if(!(o=l.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){l=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){l.label=a[1];break}if(6===a[0]&&l.label<o[1]){l.label=o[1],o=a;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(a);break}o[2]&&l.ops.pop(),l.trys.pop();continue}a=t.call(n,l)}catch(n){a=[6,n],r=0}finally{e=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function r(n,t,e){if(e||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return n.concat(r||Array.prototype.slice.call(t))}export{n as __assign,t as __awaiter,e as __generator,r as __spreadArray};
1
+ var e=function(){return e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},e.apply(this,arguments)};function t(e,t,n,r){return new(n||(n=Promise))((function(o,a){function c(e){try{i(r.next(e))}catch(e){a(e)}}function l(e){try{i(r.throw(e))}catch(e){a(e)}}function i(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,l)}i((r=r.apply(e,t||[])).next())}))}function n(e,t){var n,r,o,a,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,r=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){c=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){c.label=a[1];break}if(6===a[0]&&c.label<o[1]){c.label=o[1],o=a;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(a);break}o[2]&&c.ops.pop(),c.trys.pop();continue}a=t.call(e,c)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function r(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function o(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}export{e as __assign,t as __awaiter,n as __generator,o as __makeTemplateObject,r as __spreadArray};
package/build/index.js CHANGED
@@ -1 +1 @@
1
- export{IkasLocalThemeAPI}from"./api/index.js";import*as a from"./pages/home.js";export{a as IndexPage};import*as s from"./pages/_slug_/index.js";export{s as SlugPage};import*as o from"./pages/pages/_slug_.js";export{o as CustomPage};import*as e from"./pages/checkout.js";export{e as CheckoutPage};import*as r from"./pages/account/index.js";export{r as AccountPage};import*as t from"./pages/account/addresses.js";export{t as AddressesPage};import*as p from"./pages/account/orders/index.js";export{p as OrdersPage};import*as g from"./pages/account/orders/_id_.js";export{g as OrderDetailPage};import*as m from"./pages/account/login.js";export{m as LoginPage};import*as i from"./pages/account/register.js";export{i as RegisterPage};import*as f from"./pages/account/forgot-password.js";export{f as ForgotPasswordPage};import*as c from"./pages/account/recover-password.js";export{c as RecoverPasswordPage};import*as x from"./pages/cart.js";export{x as CartPage};import*as P from"./pages/editor.js";export{P as EditorPage};import*as d from"./pages/account/favorite-products.js";export{d as FavoriteProductsPage};import*as u from"./pages/search.js";export{u as SearchPage};import*as j from"./pages/404.js";export{j as NotFoundPage};import*as n from"./pages/blog/index.js";export{n as BlogPage};import*as l from"./pages/blog/_slug_.js";export{l as BlogSlugPage};import*as _ from"./pages/raffle/_slug_.js";export{_ as RafflePage};import*as v from"./pages/raffle/index.js";export{v as RafflesPage};import*as h from"./pages/account/raffles.js";export{h as AccountRafflesPage};import*as A from"./pages/account/activate.js";export{A as ActivateCustomerPage};export{IkasNextPageDataProvider}from"./provider/page-data-next.js";export{getGoogleFontHref}from"./utils/google-fonts.js";
1
+ export{IkasLocalThemeAPI}from"./api/index.js";import*as a from"./pages/home.js";export{a as IndexPage};import*as o from"./pages/_slug_/index.js";export{o as SlugPage};import*as s from"./pages/pages/_slug_.js";export{s as CustomPage};import*as e from"./pages/checkout.js";export{e as CheckoutPage};import*as r from"./pages/account/index.js";export{r as AccountPage};import*as t from"./pages/account/addresses.js";export{t as AddressesPage};import*as p from"./pages/account/orders/index.js";export{p as OrdersPage};import*as g from"./pages/account/orders/_id_.js";export{g as OrderDetailPage};import*as m from"./pages/account/login.js";export{m as LoginPage};import*as i from"./pages/account/register.js";export{i as RegisterPage};import*as f from"./pages/account/forgot-password.js";export{f as ForgotPasswordPage};import*as c from"./pages/account/recover-password.js";export{c as RecoverPasswordPage};import*as x from"./pages/cart.js";export{x as CartPage};import*as P from"./pages/editor.js";export{P as EditorPage};import*as d from"./pages/account/favorite-products.js";export{d as FavoriteProductsPage};import*as u from"./pages/search.js";export{u as SearchPage};import*as n from"./pages/404.js";export{n as NotFoundPage};import*as j from"./pages/blog/index.js";export{j as BlogPage};import*as l from"./pages/blog/_slug_.js";export{l as BlogSlugPage};import*as _ from"./pages/raffle/_slug_.js";export{_ as RafflePage};import*as v from"./pages/raffle/index.js";export{v as RafflesPage};import*as h from"./pages/account/raffles.js";export{h as AccountRafflesPage};import*as k from"./pages/account/activate.js";export{k as ActivateCustomerPage};export{CheckoutStorefrontType,IkasNextPageDataProvider}from"./provider/page-data-next.js";export{getGoogleFontHref}from"./utils/google-fonts.js";
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from"../../../ext/tslib/tslib.es6.js";import{IkasThemeJsonComponentPropType as a}from"@ikas/storefront-models";import s from"path";import{createFile as r,deleteDirContent as n}from"../../../utils/fs.js";import o from"lodash/uniq";var c=function(){function c(){}return c.generate=function(a,p){return e(this,void 0,void 0,(function(){var e,u,I,k,m,T,L;return t(this,(function(t){switch(t.label){case 0:return[4,n(s.join(p||process.cwd(),"src","components","__generated__","types"))];case 1:t.sent(),e={content:"",imports:[],internalCustomDatas:[]},t.label=2;case 2:t.trys.push([2,5,,6]),a.customData.forEach((function(t){c.generateAllCustomDataTypes(t,e,a)})),u=0,I=0;do{u=e.internalCustomDatas.length,e.internalCustomDatas.forEach((function(t){c.generateAllCustomDataTypes(t,e,a)})),(I=e.internalCustomDatas.length)!==u&&(e.internalCustomDatas=e.internalCustomDatas.splice(u,I))}while(u!==I);return[4,i.generate(a,e)];case 3:return t.sent(),k=s.join(p||process.cwd(),"src","components","__generated__"),e.imports=o(e.imports),m="import {\r\n",e.imports.forEach((function(e){m+="\t".concat(e,",\r\n")})),T=(m+='} from "@ikas/storefront"\r\n\r\n')+e.content,[4,r(k,"types.ts",T)];case 4:return[2,t.sent()];case 5:return L=t.sent(),console.log(L),[2,!1];case 6:return[2]}}))}))},c.generateAllCustomDataTypes=function(e,t,s){var r=e.type===a.ENUM,n="export ".concat(r?"enum":"type"," ").concat(c.generateTypeName(e)).concat(r?"":" = ","{ \r\n"),o="};\r\n\r\n";e.type!==a.DYNAMIC_LIST&&e.type!==a.STATIC_LIST||!e.nestedData?e.type===a.ENUM&&e.enumOptions?(t.content+=n,e.enumOptions.forEach((function(e){var a=e.value;e.value&&!isNaN(parseInt(e.value))&&(a="_"+e.value),t.content+='\t"'.concat(a,'" = "').concat(null==e?void 0:e.value,'",'),t.content+="\r\n"})),t.content+=o):(t.content+=n,e.nestedData&&e.nestedData.forEach((function(e){c.genenateCustomDataType(e,t,s),t.content+="\r\n"})),t.content+=o):c.generateAllCustomDataTypes(e.nestedData[0],t,s)},c.genenateCustomDataType=function(e,t,s){var r=c.getType(e,t,s);e.key&&e.key[0].match(/^\d/)&&(e.key="_"+e.key),t.content+="\t".concat(e.key).concat(e.isRequired?"":"?",": ").concat(r).concat([a.DYNAMIC_LIST,a.STATIC_LIST].includes(e.type)?"[]":"").concat(e.type===a.ENUM?",":";")},c.getType=function(e,t,s){var r="";switch(e.type){case a.TEXT:case a.RICH_TEXT:case a.COLOR:r="string";break;case a.BOOLEAN:r="boolean";break;case a.IMAGE:r="IkasImage",t.imports.push(r);break;case a.IMAGE_LIST:r="IkasImage[]",t.imports.push("IkasImage");break;case a.LINK:r="IkasNavigationLink",t.imports.push(r);break;case a.LIST_OF_LINK:r="IkasNavigationLink[]",t.imports.push("IkasNavigationLink");break;case a.PRODUCT_DETAIL:r="IkasProduct",t.imports.push(r);break;case a.PRODUCT_LIST:r="IkasProductList",t.imports.push("IkasProductList");break;case a.PRODUCT_ATTRIBUTE:r="IkasAttributeDetail",t.imports.push(r);break;case a.PRODUCT_ATTRIBUTE_LIST:r="IkasAttributeList",t.imports.push("IkasAttributeList");break;case a.BRAND:r="IkasBrand",t.imports.push(r);break;case a.BRAND_LIST:r="IkasBrandList",t.imports.push(r);break;case a.CATEGORY:r="IkasCategory",t.imports.push(r);break;case a.CATEGORY_LIST:r="IkasCategoryList",t.imports.push(r);break;case a.CUSTOM:var n=s.customData.find((function(t){return t.id===e.customDataId}));n&&(r=c.generateTypeName(n));break;case a.COMPONENT:r="IkasComponentRenderer",t.imports.push(r);break;case a.COMPONENT_LIST:r="IkasComponentRenderer[]",t.imports.push("IkasComponentRenderer");break;case a.BLOG:r="IkasBlog",t.imports.push(r);break;case a.BLOG_LIST:r="IkasBlogList",t.imports.push(r);break;case a.BLOG_CATEGORY:r="IkasBlogCategory",t.imports.push(r);break;case a.BLOG_CATEGORY_LIST:r="IkasBlogCategoryList",t.imports.push(r);break;case a.RAFFLE:r="IkasRaffle",t.imports.push(r);break;case a.RAFFLE_LIST:r="IkasRaffleList",t.imports.push(r);break;case a.SLIDER:r="IkasSlider",t.imports.push(r);break;case a.VIDEO:r="IkasVideo",t.imports.push(r);break;case a.ENUM:case a.OBJECT:r=c.generateTypeName(e),t.content.includes("export enum ".concat(r))||t.internalCustomDatas.push(e);break;case a.DYNAMIC_LIST:case a.STATIC_LIST:e.nestedData&&(e.nestedData[0].type===a.OBJECT||e.nestedData[0].type===a.ENUM?(r=c.generateTypeName(e.nestedData[0]),t.content.includes("export type ".concat(r))||t.internalCustomDatas.push(e.nestedData[0])):r=c.getType(e.nestedData[0],t,s))}return r},c.generateTypeName=function(e){if(e.typescriptName)return e.typescriptName;var t=e.name||"";return(t=(t=t.replace(/\s/g,"")).replace(/\W/g,""))[0].match(/^\d/)&&(t="_"+t),e.type===a.ENUM&&(t+="Enum"),t},c}(),i=function(){function s(){}return s.generate=function(a,r){return e(this,void 0,void 0,(function(){return t(this,(function(e){return a.components.forEach((function(e){e.props.length>0&&"checkout"!==e.id&&(r.content+="export type ".concat(s.generatePropTypeName(e),"Props = {\n"),e.props.forEach((function(e){r.content+="\t".concat(e.name).concat(e.isRequired?"":"?",": ").concat(s.getType(e,a,r),";\n")})),r.content+="};\r\n\r\n")})),[2]}))}))},s.getType=function(e,t,s){var r="";switch(e.type){case a.TEXT:case a.RICH_TEXT:case a.COLOR:r="string";break;case a.BOOLEAN:r="boolean";break;case a.IMAGE:r="IkasImage",s.imports.push(r);break;case a.IMAGE_LIST:r="IkasImage[]",s.imports.push("IkasImage");break;case a.LINK:r="IkasNavigationLink",s.imports.push(r);break;case a.LIST_OF_LINK:r="IkasNavigationLink[]",s.imports.push("IkasNavigationLink");break;case a.PRODUCT_DETAIL:r="IkasProduct",s.imports.push(r);break;case a.PRODUCT_LIST:r="IkasProductList",s.imports.push("IkasProductList");break;case a.PRODUCT_ATTRIBUTE:r="IkasAttributeDetail",s.imports.push(r);break;case a.PRODUCT_ATTRIBUTE_LIST:r="IkasAttributeList",s.imports.push("IkasAttributeList");break;case a.BRAND:r="IkasBrand",s.imports.push(r);break;case a.BRAND_LIST:r="IkasBrandList",s.imports.push(r);break;case a.CATEGORY:r="IkasCategory",s.imports.push(r);break;case a.CATEGORY_LIST:r="IkasCategoryList",s.imports.push(r);break;case a.CUSTOM:var n=t.customData.find((function(t){return t.id===e.customDataId}));n&&(r=c.getType(n,s,t),n.type!==a.DYNAMIC_LIST&&n.type!==a.STATIC_LIST||(r+="[]"));break;case a.COMPONENT:r="IkasComponentRenderer",s.imports.push(r);break;case a.COMPONENT_LIST:r="IkasComponentRenderer[]",s.imports.push("IkasComponentRenderer");break;case a.BLOG:r="IkasBlog",s.imports.push(r);break;case a.BLOG_LIST:r="IkasBlogList",s.imports.push(r);break;case a.BLOG_CATEGORY:r="IkasBlogCategory",s.imports.push(r);break;case a.BLOG_CATEGORY_LIST:r="IkasBlogCategoryList",s.imports.push(r);break;case a.RAFFLE:r="IkasRaffle",s.imports.push(r);break;case a.RAFFLE_LIST:r="IkasRaffleList",s.imports.push(r);break;case a.SLIDER:r="IkasSlider",s.imports.push(r);break;case a.VIDEO:r="IkasVideo",s.imports.push(r)}return r},s.generatePropTypeName=function(e){if(""!==e.displayName){var t=(e.dir||"").split("-"),a="";return t.forEach((function(e,t){return a+=e.charAt(0).toUpperCase()+e.slice(1)})),a[0].match(/^\d/)&&(a="_"+a),a}},s}();export{c as CustomDataTypesGenerator,i as PropTypeGenarator};
1
+ import{__awaiter as e,__generator as t}from"../../../ext/tslib/tslib.es6.js";import{IkasThemeJsonComponentPropType as a}from"@ikas/storefront-models";import s from"path";import{createFile as r,deleteDirContent as n}from"../../../utils/fs.js";import o from"lodash/uniq";var i=function(){function i(){}return i.generate=function(a,p){return e(this,void 0,void 0,(function(){var e,u,I,k,m,T,L;return t(this,(function(t){switch(t.label){case 0:return[4,n(s.join(p||process.cwd(),"src","components","__generated__","types"))];case 1:t.sent(),e={content:"",imports:[],internalCustomDatas:[]},t.label=2;case 2:t.trys.push([2,5,,6]),a.customData.forEach((function(t){i.generateAllCustomDataTypes(t,e,a)})),u=0,I=0;do{u=e.internalCustomDatas.length,e.internalCustomDatas.forEach((function(t){i.generateAllCustomDataTypes(t,e,a)})),(I=e.internalCustomDatas.length)!==u&&(e.internalCustomDatas=e.internalCustomDatas.splice(u,I))}while(u!==I);return[4,c.generate(a,e)];case 3:return t.sent(),k=s.join(p||process.cwd(),"src","components","__generated__"),e.imports=o(e.imports),m="import {\r\n",e.imports.forEach((function(e){m+="\t".concat(e,",\r\n")})),T=(m+='} from "@ikas/storefront"\r\n\r\n')+e.content,[4,r(k,"types.ts",T)];case 4:return[2,t.sent()];case 5:return L=t.sent(),console.log(L),[2,!1];case 6:return[2]}}))}))},i.generateAllCustomDataTypes=function(e,t,s){var r=e.type===a.ENUM,n="export ".concat(r?"enum":"type"," ").concat(i.generateTypeName(e)).concat(r?"":" = ","{ \r\n"),o="};\r\n\r\n";e.type!==a.DYNAMIC_LIST&&e.type!==a.STATIC_LIST||!e.nestedData?e.type===a.ENUM&&e.enumOptions?(t.content+=n,e.enumOptions.forEach((function(e){var a=e.value;e.value&&!isNaN(parseInt(e.value))&&(a="_"+e.value),t.content+='\t"'.concat(a,'" = "').concat(null==e?void 0:e.value,'",'),t.content+="\r\n"})),t.content+=o):(t.content+=n,e.nestedData&&e.nestedData.forEach((function(e){i.genenateCustomDataType(e,t,s),t.content+="\r\n"})),t.content+=o):i.generateAllCustomDataTypes(e.nestedData[0],t,s)},i.genenateCustomDataType=function(e,t,s){var r=i.getType(e,t,s);e.key&&e.key[0].match(/^\d/)&&(e.key="_"+e.key),t.content+="\t".concat(e.key).concat(e.isRequired?"":"?",": ").concat(r).concat([a.DYNAMIC_LIST,a.STATIC_LIST].includes(e.type)?"[]":"").concat(e.type===a.ENUM?",":";")},i.getType=function(e,t,s){var r="";switch(e.type){case a.TEXT:case a.RICH_TEXT:case a.COLOR:r="string";break;case a.BOOLEAN:r="boolean";break;case a.IMAGE:r="IkasImage",t.imports.push(r);break;case a.IMAGE_LIST:r="IkasImage[]",t.imports.push("IkasImage");break;case a.LINK:r="IkasNavigationLink",t.imports.push(r);break;case a.LIST_OF_LINK:r="IkasNavigationLink[]",t.imports.push("IkasNavigationLink");break;case a.PRODUCT_DETAIL:r="IkasProduct",t.imports.push(r);break;case a.PRODUCT_LIST:r="IkasProductList",t.imports.push("IkasProductList");break;case a.PRODUCT_ATTRIBUTE:r="IkasAttributeDetail",t.imports.push(r);break;case a.PRODUCT_ATTRIBUTE_LIST:r="IkasAttributeList",t.imports.push("IkasAttributeList");break;case a.BRAND:r="IkasBrand",t.imports.push(r);break;case a.BRAND_LIST:r="IkasBrandList",t.imports.push(r);break;case a.CATEGORY:r="IkasCategory",t.imports.push(r);break;case a.CATEGORY_LIST:r="IkasCategoryList",t.imports.push(r);break;case a.CUSTOM:var n=s.customData.find((function(t){return t.id===e.customDataId}));n&&(r=i.generateTypeName(n));break;case a.COMPONENT:r="IkasComponentRenderer",t.imports.push(r);break;case a.COMPONENT_LIST:r="IkasComponentRenderer[]",t.imports.push("IkasComponentRenderer");break;case a.BLOG:r="IkasBlog",t.imports.push(r);break;case a.BLOG_LIST:r="IkasBlogList",t.imports.push(r);break;case a.BLOG_CATEGORY:r="IkasBlogCategory",t.imports.push(r);break;case a.BLOG_CATEGORY_LIST:r="IkasBlogCategoryList",t.imports.push(r);break;case a.RAFFLE:r="IkasRaffle",t.imports.push(r);break;case a.RAFFLE_LIST:r="IkasRaffleList",t.imports.push(r);break;case a.SLIDER:r="IkasSlider",t.imports.push(r);break;case a.VIDEO:r="IkasVideo",t.imports.push(r);break;case a.ENUM:case a.OBJECT:r=i.generateTypeName(e),t.content.includes("export enum ".concat(r))||t.internalCustomDatas.push(e);break;case a.DYNAMIC_LIST:case a.STATIC_LIST:e.nestedData&&(e.nestedData[0].type===a.OBJECT||e.nestedData[0].type===a.ENUM?(r=i.generateTypeName(e.nestedData[0]),t.content.includes("export type ".concat(r))||t.internalCustomDatas.push(e.nestedData[0])):r=i.getType(e.nestedData[0],t,s))}return r},i.generateTypeName=function(e){var t;if(e.typescriptName)return e.typescriptName;if((e.type===a.DYNAMIC_LIST||e.type===a.STATIC_LIST)&&(null===(t=e.nestedData)||void 0===t?void 0:t.length))return i.generateTypeName(e.nestedData[0]);var s=e.name||"";return(s=(s=s.replace(/\s/g,"")).replace(/\W/g,""))[0].match(/^\d/)&&(s="_"+s),e.type===a.ENUM&&(s+="Enum"),s},i}(),c=function(){function s(){}return s.generate=function(a,r){return e(this,void 0,void 0,(function(){return t(this,(function(e){return a.components.forEach((function(e){e.props.length>0&&"checkout"!==e.id&&(r.content+="export type ".concat(s.generatePropTypeName(e),"Props = {\n"),e.props.forEach((function(e){r.content+="\t".concat(e.name).concat(e.isRequired?"":"?",": ").concat(s.getType(e,a,r),";\n")})),r.content+="};\r\n\r\n")})),[2]}))}))},s.getType=function(e,t,s){var r="";switch(e.type){case a.TEXT:case a.RICH_TEXT:case a.COLOR:r="string";break;case a.BOOLEAN:r="boolean";break;case a.IMAGE:r="IkasImage",s.imports.push(r);break;case a.IMAGE_LIST:r="IkasImage[]",s.imports.push("IkasImage");break;case a.LINK:r="IkasNavigationLink",s.imports.push(r);break;case a.LIST_OF_LINK:r="IkasNavigationLink[]",s.imports.push("IkasNavigationLink");break;case a.PRODUCT_DETAIL:r="IkasProduct",s.imports.push(r);break;case a.PRODUCT_LIST:r="IkasProductList",s.imports.push("IkasProductList");break;case a.PRODUCT_ATTRIBUTE:r="IkasAttributeDetail",s.imports.push(r);break;case a.PRODUCT_ATTRIBUTE_LIST:r="IkasAttributeList",s.imports.push("IkasAttributeList");break;case a.BRAND:r="IkasBrand",s.imports.push(r);break;case a.BRAND_LIST:r="IkasBrandList",s.imports.push(r);break;case a.CATEGORY:r="IkasCategory",s.imports.push(r);break;case a.CATEGORY_LIST:r="IkasCategoryList",s.imports.push(r);break;case a.CUSTOM:var n=t.customData.find((function(t){return t.id===e.customDataId}));n&&(r=i.getType(n,s,t),n.type!==a.DYNAMIC_LIST&&n.type!==a.STATIC_LIST||(r+="[]"));break;case a.COMPONENT:r="IkasComponentRenderer",s.imports.push(r);break;case a.COMPONENT_LIST:r="IkasComponentRenderer[]",s.imports.push("IkasComponentRenderer");break;case a.BLOG:r="IkasBlog",s.imports.push(r);break;case a.BLOG_LIST:r="IkasBlogList",s.imports.push(r);break;case a.BLOG_CATEGORY:r="IkasBlogCategory",s.imports.push(r);break;case a.BLOG_CATEGORY_LIST:r="IkasBlogCategoryList",s.imports.push(r);break;case a.RAFFLE:r="IkasRaffle",s.imports.push(r);break;case a.RAFFLE_LIST:r="IkasRaffleList",s.imports.push(r);break;case a.SLIDER:r="IkasSlider",s.imports.push(r);break;case a.VIDEO:r="IkasVideo",s.imports.push(r)}return r},s.generatePropTypeName=function(e){if(""!==e.displayName){var t=(e.dir||"").split("-"),a="";return t.forEach((function(e,t){return a+=e.charAt(0).toUpperCase()+e.slice(1)})),a[0].match(/^\d/)&&(a="_"+a),a}},s}();export{i as CustomDataTypesGenerator,c as PropTypeGenarator};
@@ -1,2 +1,3 @@
1
- import { GetStaticProps } from "next";
1
+ import { GetServerSideProps, GetStaticProps } from "next";
2
+ export declare const getServerSideProps: GetServerSideProps;
2
3
  export declare const getStaticProps: GetStaticProps;
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as r}from'./../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as o}from"@ikas/storefront-models";import{IkasNextPageDataProvider as e}from"../provider/page-data-next.js";var i=function(i){return t(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,e.getStaticProps(i,o.CHECKOUT)];case 1:return[2,t.sent()]}}))}))};export{i as getStaticProps};
1
+ import{__awaiter as t,__generator as r}from'./../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as e}from"@ikas/storefront-models";import{IkasNextPageDataProvider as o}from"../provider/page-data-next.js";var i=function(i){return t(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,o.getServerSideProps(i,e.CHECKOUT)];case 1:return[2,t.sent()]}}))}))},n=function(i){return t(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,o.getStaticProps(i,e.CHECKOUT)];case 1:return[2,t.sent()]}}))}))};export{i as getServerSideProps,n as getStaticProps};
@@ -1,11 +1,21 @@
1
1
  /// <reference types="node" />
2
2
  import { GetServerSidePropsContext, GetStaticPropsContext } from "next";
3
3
  import { ParsedUrlQuery } from "querystring";
4
- import { IkasCustomerReviewSettings, IkasCustomerSettings, IkasImage, IkasMerchantSettings, IkasProductBackInStockSettings, IkasSalesChannel, IkasStorefront, IkasStorefrontPopup, IkasStorefrontRouting, IkasStorefrontThemeLocalization, IkasThemeJson, IkasThemeJsonFavicon, IkasThemeJsonPageType, IkasThemeJsonSettings, IkasThemeJsonStockPreference } from "@ikas/storefront-models";
4
+ import { IkasCustomerReviewSettings, IkasCustomerSettings, IkasImage, IkasLoyaltyProgram, IkasMerchantSettings, IkasProductBackInStockSettings, IkasSalesChannel, IkasStorefront, IkasStorefrontPopup, IkasStorefrontRouting, IkasStorefrontThemeLocalization, IkasThemeJson, IkasThemeJsonFavicon, IkasThemeJsonPageType, IkasThemeJsonSettings, IkasThemeJsonStockPreference } from "@ikas/storefront-models";
5
5
  import { IkasPageDataProvider } from "@ikas/storefront-providers";
6
- import { IkasStorefrontSettings } from "@ikas/storefront-api";
6
+ import { listCheckoutSettings, IkasStorefrontSettings } from "@ikas/storefront-api";
7
7
  export declare class IkasNextPageDataProvider {
8
8
  static startTime: number;
9
+ static getStandaloneCheckoutRequest(context: GetStaticPropsContext<ParsedUrlQuery> | GetServerSidePropsContext<ParsedUrlQuery>): StandaloneCheckoutRequest | null;
10
+ private static getRequestPath;
11
+ static readJsonFile(filePath: string): any;
12
+ static ensureCheckoutPage(themeJson: IkasThemeJson): IkasThemeJson;
13
+ static getCheckoutThemeJson(settings: SettingsData): IkasThemeJson;
14
+ static getHeadlessRouting(routings: IkasStorefrontRouting[], requestPath: string, host?: string): IkasStorefrontRouting;
15
+ static getStudioRouting(routings: IkasStorefrontRouting[], requestPath: string): IkasStorefrontRouting | undefined;
16
+ static getHeadlessLocalizationPath(deployDir: string, storefront: IkasStorefront, locale: string): string | undefined;
17
+ static getStandaloneApiConfig(apiKey: string | undefined, storefrontId: string, storefrontRoutingId: string): StandaloneApiConfig;
18
+ static getStandaloneCheckoutSettings(request: StandaloneCheckoutRequest): Promise<SettingsData | null>;
9
19
  static readLocalTheme(): Promise<IkasThemeJson>;
10
20
  static readSettingsFile(): Promise<SettingsData | null>;
11
21
  static cacheLocalSettingsFile(settings: IkasStorefrontSettings): Promise<void>;
@@ -14,51 +24,77 @@ export declare class IkasNextPageDataProvider {
14
24
  static getProdSettings(locale: string): Promise<SettingsData | null>;
15
25
  static getSettings(locale: string): Promise<SettingsData | null>;
16
26
  static setStorefrontConfig(settings: SettingsData): Promise<void>;
27
+ static applyStorefrontConfig(settings: SettingsData, isStandalone?: boolean): void;
17
28
  static setTranslations(settings: SettingsData, componentIds: string[], pageType?: IkasThemeJsonPageType, isEditor?: boolean, contextLocale?: string): Promise<void>;
29
+ static getLocaleJsonNamespace(localeJson: unknown, namespace: string): Record<string, any> | undefined;
30
+ static loadStandaloneCheckoutTranslations(settings: SettingsData): Promise<Record<string, any>>;
31
+ static mergeTranslations(defaults: Record<string, any>, overrides: Record<string, any>): Record<string, any>;
18
32
  static getExtraProps(settings: SettingsData, provider: IkasPageDataProvider, pageType?: IkasThemeJsonPageType): Promise<Record<string, any>>;
33
+ static buildCheckoutExtraProps(settings: SettingsData, provider: IkasPageDataProvider, checkoutSettings: Awaited<ReturnType<typeof listCheckoutSettings>>): Record<string, any>;
19
34
  static getPageData(context: GetStaticPropsContext<ParsedUrlQuery> | GetServerSidePropsContext<ParsedUrlQuery>, isServer: boolean, pageType?: IkasThemeJsonPageType, possiblePageTypes?: IkasThemeJsonPageType[], isEditor?: boolean): Promise<{
35
+ props: any;
36
+ } | {
20
37
  props: {};
21
38
  notFound: boolean;
22
39
  revalidate?: undefined;
23
40
  } | {
24
41
  props: any;
42
+ revalidate: number;
25
43
  notFound?: undefined;
26
- revalidate?: undefined;
44
+ }>;
45
+ static getStandaloneCheckoutPageData(context: GetStaticPropsContext<ParsedUrlQuery> | GetServerSidePropsContext<ParsedUrlQuery>, request: StandaloneCheckoutRequest): Promise<{
46
+ props: {};
47
+ notFound: true;
27
48
  } | {
28
49
  props: any;
29
- revalidate: number;
30
- notFound?: undefined;
31
50
  }>;
51
+ static omitPaymentStepScripts<T extends Record<string, any>>(props: T, context: GetStaticPropsContext<ParsedUrlQuery> | GetServerSidePropsContext<ParsedUrlQuery>): T;
32
52
  static getStaticProps(context: GetStaticPropsContext<ParsedUrlQuery>, pageType?: IkasThemeJsonPageType, possiblePageTypes?: IkasThemeJsonPageType[], isEditor?: boolean): Promise<{
53
+ props: any;
54
+ } | {
33
55
  props: {};
34
56
  notFound: boolean;
35
57
  revalidate?: undefined;
36
- } | {
37
- props: any;
38
- notFound?: undefined;
39
- revalidate?: undefined;
40
58
  } | {
41
59
  props: any;
42
60
  revalidate: number;
43
61
  notFound?: undefined;
44
62
  }>;
45
63
  static getServerSideProps(context: GetServerSidePropsContext<ParsedUrlQuery>, pageType?: IkasThemeJsonPageType): Promise<{
64
+ props: any;
65
+ } | {
46
66
  props: {};
47
67
  notFound: boolean;
48
68
  revalidate?: undefined;
49
- } | {
50
- props: any;
51
- notFound?: undefined;
52
- revalidate?: undefined;
53
69
  } | {
54
70
  props: any;
55
71
  revalidate: number;
56
72
  notFound?: undefined;
57
73
  }>;
74
+ static createColorStyle(settings: IkasThemeJsonSettings): string | undefined;
58
75
  static createColorScript(settings: IkasThemeJsonSettings): string | undefined;
76
+ private static fontScriptCache;
77
+ static getCachedFontScript(settings: IkasThemeJsonSettings): Promise<string | undefined>;
59
78
  static createFontScript(settings: IkasThemeJsonSettings): Promise<string | undefined>;
60
79
  }
80
+ export declare enum CheckoutStorefrontType {
81
+ STUDIO = "studio",
82
+ HEADLESS = "headless"
83
+ }
84
+ export declare type StandaloneApiConfig = {
85
+ URL: string;
86
+ HEADERS: Record<string, string>;
87
+ };
88
+ export declare type StandaloneCheckoutRequest = {
89
+ requestPath: string;
90
+ settingsPath: string;
91
+ projectJsonPath?: string;
92
+ deployDir?: string;
93
+ host?: string;
94
+ storefrontType: CheckoutStorefrontType;
95
+ };
61
96
  export declare type SettingsData = {
97
+ storefrontType: CheckoutStorefrontType;
62
98
  storefront: IkasStorefront;
63
99
  themeLocalization: IkasStorefrontThemeLocalization;
64
100
  salesChannel: IkasSalesChannel;
@@ -67,6 +103,7 @@ export declare type SettingsData = {
67
103
  favicon: IkasThemeJsonFavicon;
68
104
  stockPreference: IkasThemeJsonStockPreference;
69
105
  storefrontJSScripts: string[];
106
+ themeStyleScripts?: string[];
70
107
  highPriorityStoreFrontJSScripts: string[];
71
108
  domain: string;
72
109
  productBackInStockSettings: IkasProductBackInStockSettings | null;
@@ -75,10 +112,16 @@ export declare type SettingsData = {
75
112
  customerSettings?: IkasCustomerSettings;
76
113
  custom?: Record<string, any> | null;
77
114
  storefrontPopups: IkasStorefrontPopup[];
115
+ loyaltyPrograms: IkasLoyaltyProgram[];
116
+ payWithIkasUrl?: string | null;
117
+ projectJson?: Record<string, any>;
118
+ deployDir?: string;
119
+ apiKey?: string;
78
120
  };
79
121
  export declare type IkasCheckoutCustomizationProps = {
80
122
  logo?: IkasImage;
81
123
  showTax?: boolean;
124
+ showLoyaltyPoints?: boolean;
82
125
  showCampaignOffersDesign?: boolean;
83
126
  showCampaignIsBiggerImage?: boolean;
84
127
  campaignOfferIsSmallDesign?: boolean;
@@ -114,4 +157,5 @@ export declare type IkasCheckoutCustomizationProps = {
114
157
  secondaryButtonBgColor?: string;
115
158
  secondaryButtonTextColor?: string;
116
159
  secondaryButtonBorderColor?: string;
160
+ loyaltyIconColor?: string;
117
161
  };
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t,__spreadArray as o,__assign as n}from'./../ext/tslib/tslib.es6.js';import r from"fs";import s from"next/config.js";import{IkasThemeJsonPageType as i}from"@ikas/storefront-models";import{IkasPageDataProvider as a}from"@ikas/storefront-providers";import{IkasStorefrontConfig as c}from"@ikas/storefront-config";import{getStorefrontSettings as l,listMerchantSettings as u,setAPIClientConfig as p,listCheckoutSettings as g}from"@ikas/storefront-api";import{getGoogleFontHref as d}from"../utils/google-fonts.js";import{I18NFileReader as f}from"../utils/i18n.js";import{createFile as m,deleteDirContent as h}from"../utils/fs.js";var S=function(){function S(){}return S.readLocalTheme=function(){return new Promise((function(e,t){r.readFile("./src/theme.json",{flag:"a+"},(function(o,n){if(o)return t(o);var r=n.length?JSON.parse(n.toString()):{};e(r)}))}))},S.readSettingsFile=function(){return new Promise((function(e){var t=s().serverRuntimeConfig.SETTINGS;r.readFile(t,{flag:"a+"},(function(t,o){if(t)return console.error("SETTINGS FILE READ ERROR!!!"),console.error(t),e(null);var n=o.length?JSON.parse(o.toString()):{};e(n)}))}))},S.cacheLocalSettingsFile=function(o){return e(this,void 0,void 0,(function(){var e,n;return t(this,(function(t){switch(t.label){case 0:return[4,h(e=".ikas")];case 1:return t.sent(),n="settings-".concat(this.startTime,".json"),[4,m(e,n,JSON.stringify(o,null,2))];case 2:return t.sent(),[2]}}))}))},S.readLocalSettingsFile=function(){try{var e=r.readFileSync(".ikas/settings-".concat(this.startTime,".json"));if(e&&e.length)return JSON.parse(e.toString())}catch(e){}},S.getLocalSettings=function(o){return e(this,void 0,void 0,(function(){var e,n,r,s,i,a,c,u,p,g;return t(this,(function(t){switch(t.label){case 0:return[4,S.readLocalSettingsFile()];case 1:return(e=t.sent())?[3,4]:[4,l()];case 2:return(n=t.sent()).isSuccess&&n.data?(e=n.data,[4,this.cacheLocalSettingsFile(e)]):(console.error("Storefront settings fetch failed!"),console.error(n),[2,null]);case 3:t.sent(),t.label=4;case 4:return r=e.storefront,s=e.salesChannel,i=[],a=e.productBackInStockSettings?{customerLoginRequired:e.productBackInStockSettings.customerLoginRequired}:null,c=e.customerReviewSettings?{customerLoginRequired:e.customerReviewSettings.customerLoginRequired||!1,customerPurchaseRequired:e.customerReviewSettings.customerPurchaseRequired||!1}:null,[4,S.readLocalTheme()];case 5:return u=t.sent(),p=S.createColorScript(u.settings),[4,S.createFontScript(u.settings)];case 6:return g=t.sent(),p&&i.push(p),g&&i.push(g),[2,{storefront:r,themeLocalization:{id:"",locale:"en",privacyPolicy:null,returnPolicy:null,storefrontId:r.id,storefrontThemeId:"",termsOfService:null,imprint:null,shippingPolicy:null,themeJson:u},salesChannel:s,routing:r.routings.length?r.routings.find((function(e){return e.locale===o||e.id===o}))||r.routings[0]:{countryCodes:[],domain:"",dynamicCurrencySettings:{roundingFormat:null,targetCurrencyCode:""},id:"",locale:"en",path:null,priceListId:null,currencyCode:"USD",currencySymbol:"$"},favicon:u.settings.favicon,stockPreference:u.settings.stockPreference,storefrontJSScripts:i,highPriorityStoreFrontJSScripts:[],domain:"localhost:3333",productBackInStockSettings:a,customerReviewSettings:c,merchantSettings:e.merchantSettings,customerSettings:e.customerSettings,storefrontPopups:e.storefrontPopups}]}}))}))},S.getProdSettings=function(o){return e(this,void 0,void 0,(function(){var n=this;return t(this,(function(s){return[2,new Promise((function(s){return e(n,void 0,void 0,(function(){var n,i,a,c,l,p,g,d,f,m,h,v,C;return t(this,(function(I){switch(I.label){case 0:return[4,S.readSettingsFile()];case 1:return(n=I.sent())&&n.localizationMap?(i=n.storefront,a=n.salesChannel,c=n.localizationMap,l=n.storefrontJSScripts||[],p=n.highPriorityStoreFrontJSScripts||[],g=n.domain,d=n.productBackInStockSettings?{customerLoginRequired:n.productBackInStockSettings.customerLoginRequired}:null,f=n.customerReviewSettings?{customerLoginRequired:n.customerReviewSettings.customerLoginRequired||!1,customerPurchaseRequired:n.customerReviewSettings.customerPurchaseRequired||!1}:null,(m=n.merchantSettings)?[3,3]:[4,u({})]):[2,s(null)];case 2:if(!(h=I.sent()).isSuccess||!h.data)return console.error("MERCHANT SETTINGS FETCH FAILED!"),[2,s(null)];m=h.data,I.label=3;case 3:return m&&(m.address=null,delete m.merchantAddress),v=c[o],C=i.routings.find((function(e){return e.id===o||e.path===o})),v&&C?(r.readFile(v,{flag:"a+"},(function(o,r){return e(this,void 0,void 0,(function(){var e,c,u,h,v,I,y;return t(this,(function(t){switch(t.label){case 0:return o?(console.error("THEME LOCALIZATION FILE READ ERROR!!!"),console.error(o),[2,s(null)]):(e=r.length?JSON.parse(r.toString()):{},u=(c=e).themeJson.settings.favicon,h=c.themeJson.settings.stockPreference,c.themeJson.settings?(v=S.createColorScript(c.themeJson.settings),[4,S.createFontScript(c.themeJson.settings)]):[3,2]);case 1:I=t.sent(),v&&l.push(v),I&&l.push(I),t.label=2;case 2:return y=n.customerSettings,s({storefront:i,themeLocalization:c,salesChannel:a,routing:C,favicon:u,stockPreference:h,storefrontJSScripts:l,highPriorityStoreFrontJSScripts:p,domain:g,productBackInStockSettings:d,customerReviewSettings:f,merchantSettings:m,customerSettings:y,custom:n.custom,storefrontPopups:n.storefrontPopups}),[2]}}))}))})),[2]):(console.error("THEME LOCALIZATION PATH OR ROUTING MISSING!!!"),[2,s(null)])}}))}))}))]}))}))},S.getSettings=function(o){return e(this,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return"local"===process.env.NEXT_PUBLIC_ENV?[4,this.getLocalSettings(o)]:[3,2];case 1:case 3:return[2,e.sent()];case 2:return[4,this.getProdSettings(o)]}}))}))},S.setStorefrontConfig=function(o){var n;return e(this,void 0,void 0,(function(){var e,r,s,i,a,l,u,g,d,f,m,h,S,v;return t(this,(function(t){return e=o.storefront,r=o.salesChannel,s=o.routing,i=o.favicon,a=o.stockPreference,l=o.storefrontJSScripts,u=o.highPriorityStoreFrontJSScripts,g=o.domain,d=o.productBackInStockSettings,f=o.customerReviewSettings,m=o.merchantSettings,h=o.customerSettings,S=o.custom,v=o.storefrontPopups,c.init({apiUrl:process.env.NEXT_PUBLIC_GQL_URL,cdnUrl:process.env.NEXT_PUBLIC_CDN_URL,storefrontId:e.id,storefrontRoutingId:s.id,storefrontThemeId:e.mainStorefrontThemeId,storefrontB2BSettings:e.b2bSettings||void 0,storefrontType:e.type,salesChannelId:e.salesChannelId,priceListId:s.priceListId||void 0,stockLocationIds:null===(n=r.stockLocations)||void 0===n?void 0:n.map((function(e){return e.id})),routings:e.routings,paymentGateways:r.paymentGateways||[],gtmId:e.gtmId||void 0,fbpId:e.fbpId||void 0,analytics4Id:e.analytics4Id||void 0,universalAnalyticsId:e.universalAnalyticsId||void 0,tiktokPixelId:e.tiktokPixelId||void 0,favicon:i||null,pickUpStockLocationIds:e.pickUpStockLocationIds&&e.pickUpStockLocationIds.length?e.pickUpStockLocationIds:null,stockPreference:a||null,storefrontJSScripts:l||[],highPriorityStoreFrontJSScripts:u||[],domain:g,productBackInStockSettings:d,customerReviewSettings:f,merchantSettings:m,customerSettings:h,metaTemplates:e.metaTemplates||null,custom:S||null,indexPageSeoSettings:e.indexPageSeoSettings,storefrontPopups:v}),p(),[2]}))}))},S.setTranslations=function(n,r,a,l,u){return e(this,void 0,void 0,(function(){var e,p,g,d,m,h,S,v;return t(this,(function(t){switch(t.label){case 0:return e=s().serverRuntimeConfig,p=n.routing,g="local"===process.env.NEXT_PUBLIC_ENV,d=n.themeLocalization.themeJson.components.filter((function(e){return l||r.includes(e.id)})),m=o(["common"],d.map((function(e){return e.dir})),!0),(a===i.CHECKOUT||l)&&m.push("checkout-page"),h=e.nextI18nConf,S=g&&u?u:p.locale,[4,new f(S,m,g?void 0:h.localePath).read()];case 1:return v=t.sent(),c.init({translations:v}),[2]}}))}))},S.getExtraProps=function(o,n,r){var s,a,c,l,u,p,d,f,m,h,S,v,C,I,y,P,L,T,w,O,k,B,b;return e(this,void 0,void 0,(function(){var e,R,V,E,F;return t(this,(function(t){switch(t.label){case 0:return e={},R=o.themeLocalization,r!==i.CHECKOUT?[3,2]:(V=null===(s=n.page)||void 0===s?void 0:s.components[0])?[4,g({})]:[3,2];case 1:(E=t.sent()).isSuccess||(console.error("CHECKOUT SETTINGS FETCH FAILED!"),console.error(E.graphQLErrors),console.error(E.errorCodes)),F={logo:null!==(a=V.propValues.logo)&&void 0!==a?a:null,showTax:null===(c=V.propValues.showTax)||void 0===c||c,showCampaignOffersDesign:null!==(l=V.propValues.showCampaignOffersDesign)&&void 0!==l&&l,showCampaignIsBiggerImage:null!==(u=V.propValues.showCampaignIsBiggerImage)&&void 0!==u&&u,campaignOfferIsSmallDesign:null!==(p=V.propValues.campaignOfferIsSmallDesign)&&void 0!==p&&p,showCampaignHideDiscountBadge:null!==(d=V.propValues.showCampaignHideDiscountBadge)&&void 0!==d&&d,campaignOfferCountdownStyleIsLine:null!==(f=V.propValues.campaignOfferCountdownStyleIsLine)&&void 0!==f&&f,campaignOfferCountdownStyleIsLineSuccessPage:null!==(m=V.propValues.campaignOfferCountdownStyleIsLineSuccessPage)&&void 0!==m&&m,campaignOffersEnableMiddlePhase:null!==(h=V.propValues.campaignOffersEnableMiddlePhase)&&void 0!==h&&h,campaignOffersTitleColor:null!==(S=V.propValues.campaignOffersTitleColor)&&void 0!==S?S:null,campaignOffersDescriptionColor:null!==(v=V.propValues.campaignOffersDescriptionColor)&&void 0!==v?v:null,campaignOffersContainerBgColor:null!==(C=V.propValues.campaignOffersContainerBgColor)&&void 0!==C?C:null,campaignOffersDiscountPercentageColor:null!==(I=V.propValues.campaignOffersDiscountPercentageColor)&&void 0!==I?I:null,campaignOffersDiscountPercentageBgColor:null!==(y=V.propValues.campaignOffersDiscountPercentageBgColor)&&void 0!==y?y:null,campaignOffersCountdownTextColor:null!==(P=V.propValues.campaignOffersCountdownTextColor)&&void 0!==P?P:null,campaignOffersCountdownTimeColor:null!==(L=V.propValues.campaignOffersCountdownTimeColor)&&void 0!==L?L:null,campaignOffersCountdownBgColor:null!==(T=V.propValues.campaignOffersCountdownBgColor)&&void 0!==T?T:null,campaignOffersMiddlePhaseOverlayColor:null!==(w=V.propValues.campaignOffersMiddlePhaseOverlayColor)&&void 0!==w?w:null,buttonBgColor:V.propValues.buttonBgColor,buttonTextColor:V.propValues.buttonTextColor,buttonDisabledBgColor:V.propValues.buttonDisabledBgColor,buttonDisabledTextColor:V.propValues.buttonDisabledTextColor,primaryTextColor:V.propValues.primaryTextColor,secondaryTextColor:V.propValues.secondaryTextColor,primaryBgColor:V.propValues.primaryBgColor,secondaryBgColor:V.propValues.secondaryBgColor,borderColor:V.propValues.borderColor,cardBgColor:V.propValues.cardBgColor,errorColor:V.propValues.errorColor,errorLightColor:V.propValues.errorLightColor,warningColor:V.propValues.warningColor,warningLightColor:V.propValues.warningLightColor,successColor:V.propValues.successColor,successLightColor:V.propValues.successLightColor,secondaryButtonBgColor:null!==(O=V.propValues.secondaryButtonBgColor)&&void 0!==O?O:null,secondaryButtonTextColor:null!==(k=V.propValues.secondaryButtonTextColor)&&void 0!==k?k:null,secondaryButtonBorderColor:null!==(B=V.propValues.secondaryButtonBorderColor)&&void 0!==B?B:null},e.customizationProps=F,e.returnPolicy=R.returnPolicy,e.privacyPolicy=R.privacyPolicy,e.termsOfService=R.termsOfService,e.imprint=R.imprint,e.shippingPolicy=R.shippingPolicy,e.checkoutSettings=(null===(b=null==E?void 0:E.data)||void 0===b?void 0:b.length)?E.data[0]:null,t.label=2;case 2:return[2,e]}}))}))},S.getPageData=function(o,r,s,i,l){var u;return e(this,void 0,void 0,(function(){var e,g,d,f,m,h,v,C;return t(this,(function(t){switch(t.label){case 0:return e="local"===process.env.NEXT_PUBLIC_ENV,g=!e&&l,c.init({apiUrl:process.env.NEXT_PUBLIC_GQL_URL,cdnUrl:process.env.NEXT_PUBLIC_CDN_URL}),p(),g?[3,7]:(d=o.locale)?[4,S.getSettings(d)]:[2,{props:{},notFound:!0}];case 1:return(f=t.sent())&&f.storefront.mainStorefrontThemeId&&f.storefront.salesChannelId?[4,this.setStorefrontConfig(f)]:[2,{props:{},notFound:!0}];case 2:return t.sent(),m=f.themeLocalization,(h=new a(m.themeJson,o.params,s,f.merchantSettings)).possiblePageTypes=i||(s?[s]:[]),l?[3,4]:[4,h.getPageData()];case 3:if(t.sent(),!h.page)return[2,{props:{},notFound:!0}];t.label=4;case 4:return v=l?h.theme.components.map((function(e){return e.id})):(null===(u=h.page)||void 0===u?void 0:u.components.map((function(e){return e.componentId})))||[],[4,this.setTranslations(f,v,s,l,d)];case 5:return t.sent(),[4,this.getExtraProps(f,h,s)];case 6:return C=t.sent(),r?[2,{props:n(n({},h.nextPageData.props),C)}]:[2,{props:n(n({},h.nextPageData.props),C),revalidate:60}];case 7:return[2,{props:{}}];case 8:return[2]}}))}))},S.getStaticProps=function(o,n,r,s){return e(this,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,S.getPageData(o,!1,n,r,s)];case 1:return[2,e.sent()]}}))}))},S.getServerSideProps=function(o,n){return e(this,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,S.getPageData(o,!0,n)];case 1:return[2,e.sent()]}}))}))},S.createColorScript=function(e){if(e.colors)return"<script>".concat(e.colors.map((function(e){return'document.documentElement.style.setProperty("'.concat(e.key,'","').concat(e.color,'");')})).join("\r\n"),"<\/script> \n ")},S.createFontScript=function(o){return e(this,void 0,void 0,(function(){var e,n,r;return t(this,(function(t){switch(t.label){case 0:return(e=d(o.fontFamily))?[4,fetch(e,{headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36"}})]:[3,3];case 1:return[4,t.sent().text()];case 2:return n=t.sent(),r=n.replace(new RegExp("fonts.gstatic.com","g"),"fonts.myikas.com"),[2,"<style>\n ".concat(r,"\n\n body { \n font-family: '").concat(o.fontFamily.name,'\', -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;\n } \n\n </style>')];case 3:return[2]}}))}))},S.startTime=Date.now(),S}();export{S as IkasNextPageDataProvider};
1
+ import{__assign as e,__spreadArray as t,__awaiter as o,__generator as n}from'./../ext/tslib/tslib.es6.js';import r from"fs";import i from"path";import s from"next/config.js";import{IkasThemeJsonPageType as a,IkasThemeJsonStockPreference as c}from"@ikas/storefront-models";import{IkasPageDataProvider as l}from"@ikas/storefront-providers";import{IkasStorefrontConfig as u}from"@ikas/storefront-config";import{setAPIClientConfig as p,getStorefrontSettings as d,listMerchantSettings as g,listCheckoutSettings as f}from"@ikas/storefront-api";import{getGoogleFontHref as h}from"../utils/google-fonts.js";import{I18NFileReader as m,CHECKOUT_TRANSLATION_NAMESPACE as S,readDefaultCheckoutTranslations as v}from"../utils/i18n.js";import{createFile as y,deleteDirContent as C}from"../utils/fs.js";import{getRedirectGuardScript as P}from"../utils/redirect-guard/index.js";var T,I=function(){function I(){}return I.getStandaloneCheckoutRequest=function(e){var t,o=e.req,n=null===(t=null==o?void 0:o.headers)||void 0===t?void 0:t["x-settings-path"];if(!n||"string"!=typeof n)return null;var r=function(e){var t=o.headers[e];return"string"==typeof t&&t?t:void 0},i=r("x-storefront-type");return{requestPath:I.getRequestPath(o)||"",settingsPath:n,projectJsonPath:r("x-project-json-path"),deployDir:r("x-deploy-dir"),host:r("x-host"),storefrontType:i===T.HEADLESS?T.HEADLESS:T.STUDIO}},I.getRequestPath=function(e){var t;try{var o=null===(t=e[Object.getOwnPropertySymbols(e).find((function(e){return"Symbol(NextRequestMeta)"===e.toString()}))])||void 0===t?void 0:t.__NEXT_INIT_URL;if(!o)return e.url;var n=new URL(o,"http://localhost");return n.pathname+n.search}catch(t){return e.url}},I.readJsonFile=function(e){return JSON.parse(r.readFileSync(e,"utf8"))},I.ensureCheckoutPage=function(o){var n=o.components||[],r=o.pages||[],i=n.some((function(e){return"checkout"===e.id})),s=r.some((function(e){return e.type===a.CHECKOUT}));return i&&s?o:e(e({},o),{components:i?n:t(t([],n,!0),[{id:"checkout",dir:"",displayName:"Checkout",props:[],isHeader:!1,isFooter:!1,defaultPropValuesTranslations:{}}],!1),pages:s?r:t(t([],r,!0),[{id:"checkout",name:"Checkout",type:a.CHECKOUT,slug:null,pageTitle:null,description:null,components:[{id:"checkout",componentId:"checkout",propValues:{}}],specifications:null,canonicals:null,disableIndex:null}],!1)})},I.getCheckoutThemeJson=function(e){return e.storefrontType===T.STUDIO?e.projectJson.checkoutThemeJson:e.themeLocalization.themeJson},I.getHeadlessRouting=function(e,t,o){var n=null==o?void 0:o.toLowerCase(),r=n?e.find((function(e){var t;return(null===(t=e.domain)||void 0===t?void 0:t.toLowerCase())===n})):void 0;if(r)return r;var i=t.split("?")[0].split("/")[1],s=i?e.find((function(e){return e.path===i})):void 0;return s||(e.find((function(e){return!e.domain&&!e.path}))||e[0])},I.getStudioRouting=function(e,t){var o=t.split("?")[0].split("/")[1];return o="checkout"===o?null:o,e.find((function(e){return o?e.path===o:!e.path}))},I.getHeadlessLocalizationPath=function(e,t,o){var n=i.join(e,"localizations"),s=i.join(n,"".concat(t.mainStorefrontThemeId,"_").concat(o,".json"));if(r.existsSync(s))return s;try{var a=r.readdirSync(n).filter((function(e){return e.endsWith("_".concat(o,".json"))}));if(1===a.length)return i.join(n,a[0])}catch(e){}},I.getStandaloneApiConfig=function(e,t,o){return{URL:process.env.INTERNAL_GQL_URL||process.env.NEXT_PUBLIC_GQL_URL||"",HEADERS:{"x-api-key":e||"","x-sfid":t,"x-sfrid":o,"x-timezone":Intl.DateTimeFormat().resolvedOptions().timeZone||""}}},I.getStandaloneCheckoutSettings=function(e){var r,i;return o(this,void 0,void 0,(function(){var o,s,a,l,u,p,d,f,h,m,S,v,y,C,P,k,L,R,w,O,E,b,J,D,B;return n(this,(function(n){switch(n.label){case 0:o=e.requestPath,s=e.settingsPath,a=e.projectJsonPath,l=e.deployDir,u=e.host,p=e.storefrontType,d=p===T.STUDIO,n.label=1;case 1:if(n.trys.push([1,11,,12]),!d&&!l)return console.error("[checkout] Deploy dir missing for headless"),[2,null];if(!(null==(f=I.readJsonFile(s))?void 0:f.storefront))return console.error("[checkout] Settings missing"),[2,null];if(h=void 0,d){if(!a)return console.error("[checkout] Project json path missing for studio"),[2,null];h=I.readJsonFile(a)}return m=f.storefront,S=d?I.getStudioRouting(m.routings,o):I.getHeadlessRouting(m.routings,o,u),(v=S?d?null===(r=f.localizationMap)||void 0===r?void 0:r[S.id]:I.getHeadlessLocalizationPath(l,m,S.locale):void 0)&&S?(y=f.merchantSettings)?[3,3]:[4,g({},I.getStandaloneApiConfig(f.apiKey,m.id,S.id))]:(console.error("[checkout] Theme localization path or routing missing"),[2,null]);case 2:if(!(C=n.sent()).isSuccess||!C.data)return console.error("[checkout] Merchant settings fetch failed"),[2,null];y=C.data,n.label=3;case 3:return y.address=null,delete y.merchantAddress,P=I.readJsonFile(v),k=t([],f.storefrontJSScripts||[],!0),L=[],R=void 0,w=void 0,d?(h.checkoutThemeJson=I.ensureCheckoutPage(h.checkoutThemeJson||{}),O=null===(i=m.indexPageSeoSettings)||void 0===i?void 0:i.find((function(e){return e.locale===S.locale})),R={id:(null==O?void 0:O.favIcon)||null},w=c.SHOW_ALL,[3,10]):[3,4];case 4:if(P.themeJson=I.ensureCheckoutPage(P.themeJson),E=P.themeJson.settings,R=null==E?void 0:E.favicon,w=null==E?void 0:E.stockPreference,!E)return[3,10];b=I.createColorStyle(E),J=void 0,n.label=5;case 5:return n.trys.push([5,8,,9]),E.fontFamily?[4,I.getCachedFontScript(E)]:[3,7];case 6:J=n.sent(),n.label=7;case 7:return[3,9];case 8:return D=n.sent(),console.error("[checkout] Font fetch failed",D),[3,9];case 9:b&&L.push(b),J&&L.push(J),n.label=10;case 10:return[2,{storefrontType:p,storefront:m,themeLocalization:P,salesChannel:f.salesChannel,routing:S,favicon:R,stockPreference:w,storefrontJSScripts:k,themeStyleScripts:L,highPriorityStoreFrontJSScripts:f.highPriorityStoreFrontJSScripts||[],domain:f.domain,productBackInStockSettings:f.productBackInStockSettings?{customerLoginRequired:f.productBackInStockSettings.customerLoginRequired}:null,customerReviewSettings:f.customerReviewSettings?{customerLoginRequired:f.customerReviewSettings.customerLoginRequired||!1,customerPurchaseRequired:f.customerReviewSettings.customerPurchaseRequired||!1}:null,merchantSettings:y,customerSettings:f.customerSettings,custom:f.custom,storefrontPopups:f.storefrontPopups||[],loyaltyPrograms:f.loyaltyPrograms||[],payWithIkasUrl:f.payWithIkasUrl,projectJson:h,deployDir:l,apiKey:f.apiKey}];case 11:return B=n.sent(),console.error("[checkout] Settings read error",B),[2,null];case 12:return[2]}}))}))},I.readLocalTheme=function(){return new Promise((function(e,t){r.readFile("./src/theme.json",{flag:"a+"},(function(o,n){if(o)return t(o);var r=n.length?JSON.parse(n.toString()):{};e(r)}))}))},I.readSettingsFile=function(){return new Promise((function(e){var t,o,n=null===(o=null===(t=s())||void 0===t?void 0:t.serverRuntimeConfig)||void 0===o?void 0:o.SETTINGS;if(!n)return console.error("SETTINGS PATH MISSING!!!"),e(null);r.readFile(n,{flag:"a+"},(function(t,o){if(t)return console.error("SETTINGS FILE READ ERROR!!!"),console.error(t),e(null);var n=o.length?JSON.parse(o.toString()):{};e(n)}))}))},I.cacheLocalSettingsFile=function(e){return o(this,void 0,void 0,(function(){var t,o;return n(this,(function(n){switch(n.label){case 0:return[4,C(t=".ikas")];case 1:return n.sent(),o="settings-".concat(this.startTime,".json"),[4,y(t,o,JSON.stringify(e,null,2))];case 2:return n.sent(),[2]}}))}))},I.readLocalSettingsFile=function(){try{var e=r.readFileSync(".ikas/settings-".concat(this.startTime,".json"));if(e&&e.length)return JSON.parse(e.toString())}catch(e){}},I.getLocalSettings=function(e){return o(this,void 0,void 0,(function(){var t,o,r,i,s,a,c,l,u,p,g;return n(this,(function(n){switch(n.label){case 0:return[4,I.readLocalSettingsFile()];case 1:return(t=n.sent())?[3,4]:[4,d()];case 2:return(o=n.sent()).isSuccess&&o.data?(t=o.data,[4,this.cacheLocalSettingsFile(t)]):(console.error("Storefront settings fetch failed!"),console.error(o),[2,null]);case 3:n.sent(),n.label=4;case 4:return r=t.storefront,i=t.salesChannel,s=[],a=[],c=t.productBackInStockSettings?{customerLoginRequired:t.productBackInStockSettings.customerLoginRequired}:null,l=t.customerReviewSettings?{customerLoginRequired:t.customerReviewSettings.customerLoginRequired||!1,customerPurchaseRequired:t.customerReviewSettings.customerPurchaseRequired||!1}:null,[4,I.readLocalTheme()];case 5:return u=n.sent(),p=I.createColorScript(u.settings),[4,I.createFontScript(u.settings)];case 6:return g=n.sent(),p&&a.push(p),g&&a.push(g),[2,{storefrontType:T.HEADLESS,storefront:r,themeLocalization:{id:"",locale:"en",privacyPolicy:null,returnPolicy:null,storefrontId:r.id,storefrontThemeId:"",termsOfService:null,imprint:null,shippingPolicy:null,themeJson:u},salesChannel:i,routing:r.routings.length?r.routings.find((function(t){return t.locale===e||t.id===e}))||r.routings[0]:{countryCodes:[],domain:"",dynamicCurrencySettings:{roundingFormat:null,targetCurrencyCode:""},id:"",locale:"en",path:null,priceListId:null,currencyCode:"USD",currencySymbol:"$"},favicon:u.settings.favicon,stockPreference:u.settings.stockPreference,storefrontJSScripts:s,themeStyleScripts:a,highPriorityStoreFrontJSScripts:[],domain:"localhost:3333",productBackInStockSettings:c,customerReviewSettings:l,merchantSettings:t.merchantSettings,customerSettings:t.customerSettings,storefrontPopups:t.storefrontPopups,loyaltyPrograms:t.loyaltyPrograms}]}}))}))},I.getProdSettings=function(e){return o(this,void 0,void 0,(function(){var t=this;return n(this,(function(i){return[2,new Promise((function(i){return o(t,void 0,void 0,(function(){var t,s,a,c,l,u,p,d,f,h,m,S,v,y;return n(this,(function(C){switch(C.label){case 0:return[4,I.readSettingsFile()];case 1:return(t=C.sent())&&t.localizationMap?(s=t.storefront,a=t.salesChannel,c=t.localizationMap,l=t.storefrontJSScripts||[],u=[],p=t.highPriorityStoreFrontJSScripts||[],d=t.domain,f=t.productBackInStockSettings?{customerLoginRequired:t.productBackInStockSettings.customerLoginRequired}:null,h=t.customerReviewSettings?{customerLoginRequired:t.customerReviewSettings.customerLoginRequired||!1,customerPurchaseRequired:t.customerReviewSettings.customerPurchaseRequired||!1}:null,(m=t.merchantSettings)?[3,3]:[4,g({})]):[2,i(null)];case 2:if(!(S=C.sent()).isSuccess||!S.data)return console.error("MERCHANT SETTINGS FETCH FAILED!"),[2,i(null)];m=S.data,C.label=3;case 3:return m&&(m.address=null,delete m.merchantAddress),v=c[e],y=s.routings.find((function(t){return t.id===e||t.path===e})),v&&y?(r.readFile(v,{flag:"a+"},(function(e,r){return o(this,void 0,void 0,(function(){var o,c,g,S,v,C,P;return n(this,(function(n){switch(n.label){case 0:return e?(console.error("THEME LOCALIZATION FILE READ ERROR!!!"),console.error(e),[2,i(null)]):(o=r.length?JSON.parse(r.toString()):{},g=(c=o).themeJson.settings.favicon,S=c.themeJson.settings.stockPreference,c.themeJson.settings?(v=I.createColorScript(c.themeJson.settings),[4,I.createFontScript(c.themeJson.settings)]):[3,2]);case 1:C=n.sent(),v&&u.push(v),C&&u.push(C),n.label=2;case 2:return P=t.customerSettings,i({storefrontType:T.HEADLESS,storefront:s,themeLocalization:c,salesChannel:a,routing:y,favicon:g,stockPreference:S,storefrontJSScripts:l,themeStyleScripts:u,highPriorityStoreFrontJSScripts:p,domain:d,productBackInStockSettings:f,customerReviewSettings:h,merchantSettings:m,customerSettings:P,custom:t.custom,storefrontPopups:t.storefrontPopups,loyaltyPrograms:t.loyaltyPrograms,payWithIkasUrl:t.payWithIkasUrl}),[2]}}))}))})),[2]):(console.error("THEME LOCALIZATION PATH OR ROUTING MISSING!!!"),[2,i(null)])}}))}))}))]}))}))},I.getSettings=function(e){return o(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return"local"===process.env.NEXT_PUBLIC_ENV?[4,this.getLocalSettings(e)]:[3,2];case 1:case 3:return[2,t.sent()];case 2:return[4,this.getProdSettings(e)]}}))}))},I.setStorefrontConfig=function(e){return o(this,void 0,void 0,(function(){return n(this,(function(t){return I.applyStorefrontConfig(e,!1),[2]}))}))},I.applyStorefrontConfig=function(t,o){var n,r;void 0===o&&(o=!1);var i=t.storefront,s=t.salesChannel,a=t.routing,c=t.favicon,l=t.stockPreference,d=t.storefrontJSScripts,g=t.themeStyleScripts,f=t.highPriorityStoreFrontJSScripts,h=t.domain,m=t.productBackInStockSettings,S=t.customerReviewSettings,v=t.merchantSettings,y=t.customerSettings,C=t.custom,T=t.storefrontPopups,I=t.loyaltyPrograms,k=t.payWithIkasUrl,L=t.apiKey;o&&u.clear(),u.init(e(e({},L?{apiKey:L}:{}),{apiUrl:process.env.INTERNAL_GQL_URL||process.env.NEXT_PUBLIC_GQL_URL,cdnUrl:process.env.NEXT_PUBLIC_CDN_URL,storefrontId:i.id,storefrontRoutingId:a.id,storefrontThemeId:i.mainStorefrontThemeId,storefrontB2BSettings:i.b2bSettings||void 0,storefrontType:i.type,salesChannelId:i.salesChannelId,priceListId:a.priceListId||void 0,stockLocationIds:null===(n=s.stockLocations)||void 0===n?void 0:n.map((function(e){return e.id})),routings:i.routings,paymentGateways:s.paymentGateways||[],gtmId:i.gtmId||void 0,fbpId:i.fbpId||void 0,analytics4Id:i.analytics4Id||void 0,universalAnalyticsId:i.universalAnalyticsId||void 0,tiktokPixelId:i.tiktokPixelId||void 0,openAiPixelId:i.openAiPixelId||void 0,favicon:c||null,pickUpStockLocationIds:i.pickUpStockLocationIds&&i.pickUpStockLocationIds.length?i.pickUpStockLocationIds:null,stockPreference:l||null,storefrontJSScripts:d||[],themeStyleScripts:g||[],highPriorityStoreFrontJSScripts:f||[],navigationWarningScript:o?void 0:P(t),domain:h,productBackInStockSettings:m,customerReviewSettings:S,merchantSettings:v,customerSettings:y,metaTemplates:i.metaTemplates||null,custom:C||null,indexPageSeoSettings:i.indexPageSeoSettings,storefrontPopups:T,loyaltyPrograms:I,payWithIkasUrl:k,milesSmilesSettings:(null===(r=i.socialLoginSettings)||void 0===r?void 0:r.find((function(e){return"miles_smiles"===e.provider})))||null})),p()},I.setTranslations=function(e,r,i,c,l){return o(this,void 0,void 0,(function(){var o,p,d,g,f,h,S,v;return n(this,(function(n){switch(n.label){case 0:return o=s().serverRuntimeConfig,p=e.routing,d="local"===process.env.NEXT_PUBLIC_ENV,g=e.themeLocalization.themeJson.components.filter((function(e){return c||r.includes(e.id)})),f=t(["common"],g.map((function(e){return e.dir})),!0),(i===a.CHECKOUT||c)&&f.push("checkout-page"),h=o.nextI18nConf,S=d&&l?l:p.locale,[4,new m(S,f,d?void 0:h.localePath).read()];case 1:return v=n.sent(),u.init({translations:v}),[2]}}))}))},I.getLocaleJsonNamespace=function(e,t){try{var o="string"==typeof e?JSON.parse(e):e,n=null==o?void 0:o[t];return n&&"object"==typeof n?n:void 0}catch(e){return void console.error("[checkout] localeJson parse error",e)}},I.loadStandaloneCheckoutTranslations=function(e){var t,s,a,c;return o(this,void 0,void 0,(function(){var o,l,u,p,d,g,f;return n(this,(function(n){switch(n.label){case 0:o=e.routing.locale;try{e.storefrontType===T.STUDIO?l=null===(a=null===(s=null===(t=e.projectJson)||void 0===t?void 0:t.i18nTranslations)||void 0===s?void 0:s[o])||void 0===a?void 0:a.checkout_page:!(l=I.getLocaleJsonNamespace(null===(c=e.themeLocalization)||void 0===c?void 0:c.localeJson,S))&&e.deployDir&&(u=i.join(e.deployDir,"public","locales",o),(p=["".concat(S,".json"),"checkout.json"].map((function(e){return i.join(u,e)})).find((function(e){return r.existsSync(e)})))&&(l=I.readJsonFile(p)))}catch(e){console.error("[checkout] Translations read error",e)}n.label=1;case 1:return n.trys.push([1,3,,4]),[4,v(o)];case 2:return d=n.sent(),[3,4];case 3:if(g=n.sent(),console.error("[checkout] Default translations read error",g),!l)throw g;return[3,4];case 4:return[2,(f={},f[S]=l?I.mergeTranslations(d||{},l):d,f)]}}))}))},I.mergeTranslations=function(t,o){var n=e({},t);return Object.entries(o).forEach((function(e){var o=e[0],r=e[1],i=null==t?void 0:t[o];r&&"object"==typeof r&&!Array.isArray(r)?n[o]=i&&"object"==typeof i&&!Array.isArray(i)?I.mergeTranslations(i,r):r:("string"==typeof r&&""!==r||void 0===i&&void 0!==r)&&(n[o]=r)})),n},I.getExtraProps=function(e,t,r){var i;return o(this,void 0,void 0,(function(){var o;return n(this,(function(n){switch(n.label){case 0:return r===a.CHECKOUT&&(null===(i=t.page)||void 0===i?void 0:i.components[0])?[4,f({})]:[2,{}];case 1:return o=n.sent(),[2,I.buildCheckoutExtraProps(e,t,o)]}}))}))},I.buildCheckoutExtraProps=function(e,t,o){var n,r,i,s,a,c,l,u,p,d,g,f,h,m,S,v,y,C,P,T,I,k,L,R,w,O={},E=e.themeLocalization,b=null===(n=t.page)||void 0===n?void 0:n.components[0];if(b){o.isSuccess||(console.error("CHECKOUT SETTINGS FETCH FAILED!"),console.error(o.graphQLErrors),console.error(o.errorCodes));var J={logo:null!==(r=b.propValues.logo)&&void 0!==r?r:null,showTax:null===(i=b.propValues.showTax)||void 0===i||i,showLoyaltyPoints:null!==(s=b.propValues.showLoyaltyPoints)&&void 0!==s&&s,showCampaignOffersDesign:null!==(a=b.propValues.showCampaignOffersDesign)&&void 0!==a&&a,showCampaignIsBiggerImage:null!==(c=b.propValues.showCampaignIsBiggerImage)&&void 0!==c&&c,campaignOfferIsSmallDesign:null!==(l=b.propValues.campaignOfferIsSmallDesign)&&void 0!==l&&l,showCampaignHideDiscountBadge:null!==(u=b.propValues.showCampaignHideDiscountBadge)&&void 0!==u&&u,campaignOfferCountdownStyleIsLine:null!==(p=b.propValues.campaignOfferCountdownStyleIsLine)&&void 0!==p&&p,campaignOfferCountdownStyleIsLineSuccessPage:null!==(d=b.propValues.campaignOfferCountdownStyleIsLineSuccessPage)&&void 0!==d&&d,campaignOffersEnableMiddlePhase:null!==(g=b.propValues.campaignOffersEnableMiddlePhase)&&void 0!==g&&g,campaignOffersTitleColor:null!==(f=b.propValues.campaignOffersTitleColor)&&void 0!==f?f:null,campaignOffersDescriptionColor:null!==(h=b.propValues.campaignOffersDescriptionColor)&&void 0!==h?h:null,campaignOffersContainerBgColor:null!==(m=b.propValues.campaignOffersContainerBgColor)&&void 0!==m?m:null,campaignOffersDiscountPercentageColor:null!==(S=b.propValues.campaignOffersDiscountPercentageColor)&&void 0!==S?S:null,campaignOffersDiscountPercentageBgColor:null!==(v=b.propValues.campaignOffersDiscountPercentageBgColor)&&void 0!==v?v:null,campaignOffersCountdownTextColor:null!==(y=b.propValues.campaignOffersCountdownTextColor)&&void 0!==y?y:null,campaignOffersCountdownTimeColor:null!==(C=b.propValues.campaignOffersCountdownTimeColor)&&void 0!==C?C:null,campaignOffersCountdownBgColor:null!==(P=b.propValues.campaignOffersCountdownBgColor)&&void 0!==P?P:null,campaignOffersMiddlePhaseOverlayColor:null!==(T=b.propValues.campaignOffersMiddlePhaseOverlayColor)&&void 0!==T?T:null,buttonBgColor:b.propValues.buttonBgColor,buttonTextColor:b.propValues.buttonTextColor,buttonDisabledBgColor:b.propValues.buttonDisabledBgColor,buttonDisabledTextColor:b.propValues.buttonDisabledTextColor,primaryTextColor:b.propValues.primaryTextColor,secondaryTextColor:b.propValues.secondaryTextColor,primaryBgColor:b.propValues.primaryBgColor,secondaryBgColor:b.propValues.secondaryBgColor,borderColor:b.propValues.borderColor,cardBgColor:b.propValues.cardBgColor,errorColor:b.propValues.errorColor,errorLightColor:b.propValues.errorLightColor,warningColor:b.propValues.warningColor,warningLightColor:b.propValues.warningLightColor,successColor:b.propValues.successColor,successLightColor:b.propValues.successLightColor,secondaryButtonBgColor:null!==(I=b.propValues.secondaryButtonBgColor)&&void 0!==I?I:null,secondaryButtonTextColor:null!==(k=b.propValues.secondaryButtonTextColor)&&void 0!==k?k:null,secondaryButtonBorderColor:null!==(L=b.propValues.secondaryButtonBorderColor)&&void 0!==L?L:null,loyaltyIconColor:null!==(R=b.propValues.loyaltyIconColor)&&void 0!==R?R:null};O.customizationProps=J,O.returnPolicy=E.returnPolicy,O.privacyPolicy=E.privacyPolicy,O.termsOfService=E.termsOfService,O.imprint=E.imprint,O.shippingPolicy=E.shippingPolicy,O.checkoutSettings=(null===(w=null==o?void 0:o.data)||void 0===w?void 0:w.length)?o.data[0]:null}return O},I.getPageData=function(t,r,i,s,c){var d;return o(this,void 0,void 0,(function(){var o,g,f,h,m,S,v,y,C;return n(this,(function(n){switch(n.label){case 0:return(o=i===a.CHECKOUT?I.getStandaloneCheckoutRequest(t):null)?[2,I.getStandaloneCheckoutPageData(t,o)]:(g="local"===process.env.NEXT_PUBLIC_ENV,f=!g&&c,u.init({apiUrl:process.env.NEXT_PUBLIC_GQL_URL,cdnUrl:process.env.NEXT_PUBLIC_CDN_URL}),p(),f?[3,7]:(h=t.locale)?[4,I.getSettings(h)]:[2,{props:{},notFound:!0}]);case 1:return(m=n.sent())&&m.storefront.mainStorefrontThemeId&&m.storefront.salesChannelId?[4,this.setStorefrontConfig(m)]:[2,{props:{},notFound:!0}];case 2:return n.sent(),S=m.themeLocalization,(v=new l(S.themeJson,t.params,i,m.merchantSettings)).possiblePageTypes=s||(i?[i]:[]),c?[3,4]:[4,v.getPageData()];case 3:if(n.sent(),!v.page)return[2,{props:{},notFound:!0}];n.label=4;case 4:return y=c?v.theme.components.map((function(e){return e.id})):(null===(d=v.page)||void 0===d?void 0:d.components.map((function(e){return e.componentId})))||[],[4,this.setTranslations(m,y,i,c,h)];case 5:return n.sent(),[4,this.getExtraProps(m,v,i)];case 6:return C=n.sent(),r?[2,{props:I.omitPaymentStepScripts(e(e({},v.nextPageData.props),C),t)}]:[2,{props:e(e({},v.nextPageData.props),C),revalidate:60}];case 7:return[2,{props:{}}];case 8:return[2]}}))}))},I.getStandaloneCheckoutPageData=function(t,r){var i,s;return o(this,void 0,void 0,(function(){var o,c,p,d,g,h,m,S;return n(this,(function(n){switch(n.label){case 0:return o={props:{},notFound:!0},t.locale?[4,I.getStandaloneCheckoutSettings(r)]:[2,o];case 1:return(c=n.sent())&&c.storefront.mainStorefrontThemeId&&c.storefront.salesChannelId?((p=new l(I.getCheckoutThemeJson(c),t.params,a.CHECKOUT,c.merchantSettings)).possiblePageTypes=[a.CHECKOUT],[4,p.getPageData()]):[2,o];case 2:return n.sent(),p.page?(d=I.getStandaloneApiConfig(c.apiKey,c.storefront.id,c.routing.id),[4,Promise.all([f({},d),I.loadStandaloneCheckoutTranslations(c)])]):[2,o];case 3:return g=n.sent(),h=g[0],m=g[1],I.applyStorefrontConfig(c,!0),u.init({translations:m}),S=e(e({},p.nextPageData.props),I.buildCheckoutExtraProps(c,p,h)),(null===(i=S.configJson)||void 0===i?void 0:i.storefrontId)!==c.storefront.id?(console.error("[checkout] CONFIG STOREFRONT MISMATCH",{expected:c.storefront.id,actual:null===(s=S.configJson)||void 0===s?void 0:s.storefrontId}),[2,o]):[2,{props:I.omitPaymentStepScripts(S,t)}]}}))}))},I.omitPaymentStepScripts=function(t,o){var n="query"in o?o.query.step:void 0;return"true"===process.env.NEXT_PUBLIC_RESTRICT_PAYMENT_SCRIPTS&&"payment"===n&&t.configJson?e(e({},t),{configJson:e(e({},t.configJson),{storefrontJSScripts:[],highPriorityStoreFrontJSScripts:[]})}):t},I.getStaticProps=function(e,t,r,i){return o(this,void 0,void 0,(function(){return n(this,(function(o){switch(o.label){case 0:return[4,I.getPageData(e,!1,t,r,i)];case 1:return[2,o.sent()]}}))}))},I.getServerSideProps=function(e,t){return o(this,void 0,void 0,(function(){return n(this,(function(o){switch(o.label){case 0:return[4,I.getPageData(e,!0,t)];case 1:return[2,o.sent()]}}))}))},I.createColorStyle=function(e){var t;if(null===(t=e.colors)||void 0===t?void 0:t.length){var o=function(e){return"".concat(e).replace(/[<>{};]/g,"")};return"<style>:root{".concat(e.colors.map((function(e){return"".concat(o(e.key),":").concat(o(e.color),";")})).join(""),"}</style>")}},I.createColorScript=function(e){if(e.colors)return"<script>".concat(e.colors.map((function(e){return'document.documentElement.style.setProperty("'.concat(e.key,'","').concat(e.color,'");')})).join("\r\n"),"<\/script> \n ")},I.getCachedFontScript=function(e){return o(this,void 0,void 0,(function(){var t,o,r,i;return n(this,(function(n){switch(n.label){case 0:return(t=h(e.fontFamily))?(o="".concat(t,"|").concat(e.fontFamily.name),(r=I.fontScriptCache.get(o))&&r.expiresAt>Date.now()?[2,r.script]:[4,I.createFontScript(e)]):[2];case 1:return(i=n.sent())&&I.fontScriptCache.set(o,{script:i,expiresAt:Date.now()+864e5}),[2,i]}}))}))},I.createFontScript=function(e){return o(this,void 0,void 0,(function(){var t,o,r;return n(this,(function(n){switch(n.label){case 0:return(t=h(e.fontFamily))?[4,fetch(t,{headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36"}})]:[3,3];case 1:return[4,n.sent().text()];case 2:return o=n.sent(),r=o.replace(new RegExp("fonts.gstatic.com","g"),"fonts.myikas.com"),[2,"<style>\n ".concat(r,"\n\n body { \n font-family: '").concat(e.fontFamily.name,'\', -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;\n } \n\n </style>')];case 3:return[2]}}))}))},I.startTime=Date.now(),I.fontScriptCache=new Map,I}();!function(e){e.STUDIO="studio",e.HEADLESS="headless"}(T||(T={}));export{T as CheckoutStorefrontType,I as IkasNextPageDataProvider};
@@ -1 +1 @@
1
- var a=function(a){if(a.name){var t=a.name.replace(/ /g,"+"),e="";if(a.variants){e+=":";var r=a.variants.some((function(a){return"italic"===a}));if(r&&(e+="ital,"),e+="wght@",r){var n=new RegExp("italic","i");e+=a.variants.reduce((function(a,t){return n.test(t)?a:a+"0,".concat(t.replace("regular","400"),";")}),""),e+=a.variants.reduce((function(a,t){return n.test(t)?a+"1,".concat("italic"===t?"400":t.replace("italic",""),";"):a}),"")}else e+=a.variants.reduce((function(a,t){return a+"".concat(t.replace("regular","400"),";")}),"");e=e.substring(0,e.length-1),e+="&display=swap"}return"https://fonts.myikas.com/css2?family=".concat(t).concat(e)}};export{a as getGoogleFontHref};
1
+ var a=function(a){if(a.name){var t=a.name.replace(/ /g,"+"),e="";if(a.variants){e+=":";var r=a.variants.some((function(a){return"italic"===a}));if(r&&(e+="ital,"),e+="wght@",r){var n=new RegExp("italic","i");e+=a.variants.reduce((function(a,t){return n.test(t)?a:a+"0,".concat(t.replace("regular","400"),";")}),""),e+=a.variants.reduce((function(a,t){return n.test(t)?a+"1,".concat("italic"===t?"400":t.replace("italic",""),";"):a}),"")}else e+=a.variants.reduce((function(a,t){return a+"".concat(t.replace("regular","400"),";")}),"");e=e.substring(0,e.length-1),e+="&display=swap"}var c=process.env.NEXT_PUBLIC_FONT_DOMAIN||"fonts.myikas.com";return"https://".concat(c,"/css2?family=").concat(t).concat(e)}};export{a as getGoogleFontHref};
@@ -1,4 +1,5 @@
1
1
  export declare const CHECKOUT_TRANSLATION_NAMESPACE = "checkout-page";
2
+ export declare function readDefaultCheckoutTranslations(locale: string): Promise<Record<string, any>>;
2
3
  export declare class I18NFileReader {
3
4
  locale: string;
4
5
  namespaces: string[];
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from'./../ext/tslib/tslib.es6.js';import s from"fs";import r from"path";var o="checkout-page",n=function(){function o(e,t,s){this.locale=e,this.namespaces=t,this.localePath=s}return o.prototype.read=function(){return e(this,void 0,void 0,(function(){var e,o,n,a,c,i,l,u,h;return t(this,(function(t){switch(t.label){case 0:e={},o=0,n=this.namespaces,t.label=1;case 1:if(!(o<n.length))return[3,16];a=n[o],t.label=2;case 2:return t.trys.push([2,14,,15]),c=this.localePath?r.join(this.localePath,this.locale,a+".json"):r.join(process.cwd(),"public","locales",this.locale,a+".json"),s.existsSync(c)?[4,this.readLocaleFile(c)]:[3,4];case 3:return i=t.sent(),e[a]=i,[3,13];case 4:return"checkout-page"!==a?[3,13]:(l={},"tr"!==this.locale?[3,6]:[4,import("@ikas/storefront-assets/checkout/tr.js")]);case 5:return u=t.sent(),l=u.default,[3,12];case 6:return"de"!==this.locale?[3,8]:[4,import("@ikas/storefront-assets/checkout/de.js")];case 7:return u=t.sent(),l=u.default,[3,12];case 8:return"fr"!==this.locale?[3,10]:[4,import("@ikas/storefront-assets/checkout/fr.js")];case 9:return u=t.sent(),l=u.default,[3,12];case 10:return[4,import("@ikas/storefront-assets/checkout/en.js")];case 11:u=t.sent(),l=u.default,t.label=12;case 12:e[a]=l,t.label=13;case 13:return[3,15];case 14:return h=t.sent(),console.error("I18N FILE READ ERROR!"),console.error(h),[3,15];case 15:return o++,[3,1];case 16:return[2,e]}}))}))},o.prototype.readLocaleFile=function(r){return e(this,void 0,void 0,(function(){return t(this,(function(e){return[2,new Promise((function(e,t){s.readFile(r,{flag:"r"},(function(s,r){if(s)return t(s);var o=r.length?JSON.parse(r.toString()):{};e(o)}))}))]}))}))},o}();export{o as CHECKOUT_TRANSLATION_NAMESPACE,n as I18NFileReader};
1
+ import{__awaiter as e,__generator as t}from'./../ext/tslib/tslib.es6.js';import r from"fs";import s from"path";var o="checkout-page";function n(r){return e(this,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return"tr"!==r?[3,2]:[4,import("@ikas/storefront-assets/checkout/tr.js")];case 1:case 3:case 5:case 7:return[2,e.sent().default];case 2:return"de"!==r?[3,4]:[4,import("@ikas/storefront-assets/checkout/de.js")];case 4:return"fr"!==r?[3,6]:[4,import("@ikas/storefront-assets/checkout/fr.js")];case 6:return[4,import("@ikas/storefront-assets/checkout/en.js")]}}))}))}var c=function(){function o(e,t,r){this.locale=e,this.namespaces=t,this.localePath=r}return o.prototype.read=function(){return e(this,void 0,void 0,(function(){var e,o,c,a,i,u,l,h,f;return t(this,(function(t){switch(t.label){case 0:e={},o=0,c=this.namespaces,t.label=1;case 1:if(!(o<c.length))return[3,9];a=c[o],t.label=2;case 2:return t.trys.push([2,7,,8]),i=this.localePath?s.join(this.localePath,this.locale,a+".json"):s.join(process.cwd(),"public","locales",this.locale,a+".json"),r.existsSync(i)?[4,this.readLocaleFile(i)]:[3,4];case 3:return u=t.sent(),e[a]=u,[3,6];case 4:return"checkout-page"!==a?[3,6]:(l=e,h=a,[4,n(this.locale)]);case 5:l[h]=t.sent(),t.label=6;case 6:return[3,8];case 7:return f=t.sent(),console.error("I18N FILE READ ERROR!"),console.error(f),[3,8];case 8:return o++,[3,1];case 9:return[2,e]}}))}))},o.prototype.readLocaleFile=function(s){return e(this,void 0,void 0,(function(){return t(this,(function(e){return[2,new Promise((function(e,t){r.readFile(s,{flag:"r"},(function(r,s){if(r)return t(r);var o=s.length?JSON.parse(s.toString()):{};e(o)}))}))]}))}))},o}();export{o as CHECKOUT_TRANSLATION_NAMESPACE,c as I18NFileReader,n as readDefaultCheckoutTranslations};
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Which hosts the navigation warning lets through without asking (FR-1077). Pure on purpose: the
3
+ * guard's `index.ts` reads the settings and the env and hands the values in, so tests import this
4
+ * file as it is.
5
+ *
6
+ * Two kinds of entry, the same two the backend accepts in `navigationWarningSettings.allowedHosts`
7
+ * — and the matching rule every storefront has to share:
8
+ * - `ornek.com` covers `ornek.com` and its `www.` twin (and `www.ornek.com` covers both too) —
9
+ * merchants type the bare name while their links point at `www.`.
10
+ * - `*.ornek.com` covers every subdomain under `ornek.com`, at any depth, but not `ornek.com`
11
+ * itself: a merchant who wants both adds both.
12
+ */
13
+ /**
14
+ * ikas's starter list. It is not stored anywhere: every store gets it on top of its own
15
+ * `allowedHosts`, and a merchant cannot take an entry out — which is why it holds exact hosts
16
+ * only. A wildcard here would also allow what anyone can publish under the same domain (Google
17
+ * Sites and Forms, a link shim such as `l.facebook.com`, a payment link), and that is exactly
18
+ * where a hijacked script would send a shopper. Payment providers are left out for the same
19
+ * reason: on a Studio page payment happens in checkout, where the warning never runs.
20
+ */
21
+ export declare const IKAS_DEFAULT_ALLOWED_HOSTS: readonly string[];
22
+ /**
23
+ * Where ikas's own social login sends the visitor (`socialLogin` in the storefront's customer
24
+ * store). ikas's own flow, so it is never warned — whatever the merchant's list says.
25
+ */
26
+ export declare const SOCIAL_LOGIN_HOSTS: readonly string[];
27
+ /** The longest host name DNS allows. */
28
+ export declare const MAX_HOST_LENGTH = 253;
29
+ export declare type HostRules = {
30
+ /** Hosts allowed exactly, `www.` twins included. */
31
+ exact: string[];
32
+ /** `*.` entries without the `*.`: every host below one is allowed, the host itself is not. */
33
+ suffix: string[];
34
+ };
35
+ /**
36
+ * One list entry, as a merchant types it or the backend sends it, in the form the browser compares
37
+ * against — or null when it is not a host at all. Goes through `URL` so an IDN becomes the punycode
38
+ * a destination's `hostname` carries, and a scheme, credentials, port, path or query falls away:
39
+ * `https://Örnek.com:8080/a` → `xn--rnek-4qa.com`, `*.Ornek.com.` → `*.ornek.com`. What the
40
+ * backend rejects is rejected here too: IP addresses, single labels, `*` anywhere but the leftmost
41
+ * label, a wildcard over a bare TLD, and labels or hosts longer than DNS allows.
42
+ */
43
+ export declare function normalizeHostPattern(raw: unknown): string | null;
44
+ /**
45
+ * Normalized entries → the two sets the browser checks. Entries that are not normalized are
46
+ * skipped rather than trusted.
47
+ */
48
+ export declare function compileHostRules(patterns: readonly string[]): HostRules;
49
+ declare type OwnHostSources = {
50
+ /** The host this request was served on (`settingsData.domain`). */
51
+ domain?: string | null;
52
+ /** Each routing's own domain, for stores that give a language a domain of its own. */
53
+ routingDomains?: (string | null | undefined)[];
54
+ /** The store's connected domains, as the settings carry them. */
55
+ storefrontDomains?: {
56
+ name?: string | null;
57
+ redirectDomainName?: string | null;
58
+ deleted?: boolean | null;
59
+ }[] | null;
60
+ /** URLs of ikas's own services a flow leaves the page for (Pay with ikas, the storefront API). */
61
+ serviceUrls?: (string | null | undefined)[];
62
+ };
63
+ /**
64
+ * The hosts that are the store itself or ikas's own flows: never warned, never on the merchant's
65
+ * list. Wildcards are not accepted here — `*.myikas.com` in particular would cover every other
66
+ * store, a free trial one included.
67
+ */
68
+ export declare function collectOwnHosts({ domain, routingDomains, storefrontDomains, serviceUrls, }: OwnHostSources): string[];
69
+ export {};
@@ -0,0 +1 @@
1
+ import{__spreadArray as t}from'./../../ext/tslib/tslib.es6.js';var o=["instagram.com","facebook.com","m.facebook.com","x.com","twitter.com","youtube.com","m.youtube.com","youtu.be","tiktok.com","pinterest.com","tr.pinterest.com","pin.it","linkedin.com","tr.linkedin.com","threads.com","threads.net","t.me","wa.me","whatsapp.com","api.whatsapp.com","web.whatsapp.com","google.com","google.com.tr","maps.google.com","maps.app.goo.gl","g.page","search.google.com","play.google.com"],e=["accounts.google.com","www.facebook.com","m.facebook.com","appleid.apple.com","id.twitch.tv"],r=253,a=/^(\*\.)?[a-z0-9-]+(\.[a-z0-9-]+)+$/,n=/^\d+(\.\d+){3}$/;function c(t){if("string"!=typeof t)return null;var o=t.trim().toLowerCase();if(!o||o.length>253)return null;var e,r=o.startsWith("*.");r&&(o=o.slice(2));try{e=new URL(o.includes("://")?o:"http://"+o).hostname.replace(/\.$/,"")}catch(t){return null}if(n.test(e)||e.split(".").some((function(t){return t.length>63})))return null;var c=(r?"*.":"")+e;return a.test(c)?c:null}function i(t){var o=new Set,e=new Set;return t.forEach((function(t){if(c(t)===t)if(t.startsWith("*."))e.add(t.slice(2));else{var r=t.startsWith("www.")&&-1!==t.indexOf(".",4)?t.slice(4):t;o.add(r),o.add("www."+r)}})),{exact:Array.from(o),suffix:Array.from(e)}}function m(o){var e=o.domain,r=o.routingDomains,a=void 0===r?[]:r,n=o.storefrontDomains,i=void 0===n?[]:n,m=o.serviceUrls,s=void 0===m?[]:m,l=t(t(t([e],a,!0),(i||[]).filter((function(t){return!t.deleted})).reduce((function(t,o){return t.concat([o.name,o.redirectDomainName])}),[]),!0),s,!0),u=new Set;return l.forEach((function(t){var o=c(t);o&&!o.startsWith("*.")&&u.add(o)})),Array.from(u)}export{o as IKAS_DEFAULT_ALLOWED_HOSTS,r as MAX_HOST_LENGTH,e as SOCIAL_LOGIN_HOSTS,m as collectOwnHosts,i as compileHostRules,c as normalizeHostPattern};
@@ -0,0 +1,7 @@
1
+ import type { SettingsData } from "../../provider/page-data-next";
2
+ /**
3
+ * The navigation warning's inline script for this store's pages (FR-1116), or "" while the warning
4
+ * is off, which leaves the page exactly as it renders without the guard. Checkout never gets it:
5
+ * the caller skips that page type, and the standalone checkout does not call this at all.
6
+ */
7
+ export declare function getRedirectGuardScript(settings: SettingsData): string;
@@ -0,0 +1 @@
1
+ import{__spreadArray as o}from'./../../ext/tslib/tslib.es6.js';import{collectOwnHosts as r,compileHostRules as t,SOCIAL_LOGIN_HOSTS as s,IKAS_DEFAULT_ALLOWED_HOSTS as n}from"./hosts.js";import{buildRedirectGuardScript as i}from"./script.js";import{parseNavigationWarningSettings as e}from"./settings.js";import{getRedirectGuardTexts as m}from"./texts.js";function a(a){var f,l=e(a.storefront.navigationWarningSettings);if(!l)return"";var p=r({domain:a.domain,routingDomains:(a.storefront.routings||[]).map((function(o){return o.domain})),storefrontDomains:a.storefront.domains,serviceUrls:[a.payWithIkasUrl,process.env.NEXT_PUBLIC_GQL_URL,process.env.NEXT_PUBLIC_BASE_URL]}),u=t(o(o(o(o([],p,!0),s,!0),n,!0),l.allowedHosts,!0));return i({rules:u,texts:m(null===(f=a.routing)||void 0===f?void 0:f.locale)})}export{a as getRedirectGuardScript};
@@ -0,0 +1,50 @@
1
+ /**
2
+ * The navigation warning's browser half (FR-1077): the first script of every page while the store
3
+ * has the warning on, called as `RUNTIME(window, config)` — see `buildRedirectGuardScript`.
4
+ *
5
+ * SAME SCRIPT AS STUDIO (FR-1225): the string below is the runtime Studio stores print, copied
6
+ * verbatim, and must stay so — Next.js and Studio stores have to behave alike. Change it by copying
7
+ * Studio's current runtime again, never by patching this copy alone.
8
+ *
9
+ * ONE PENDING EXCEPTION (FR-1229): `fitToView` — the dialog laid over the visual viewport when the
10
+ * page is wider than the screen (FR-1228 D1, Android Chrome) — was written here first. Studio's
11
+ * runtime has to take the same change, after which the two are verbatim again.
12
+ *
13
+ * WHY A STRING, like the analytics snippets in `render/head.ts`, and not a function inlined through
14
+ * `Function.prototype.toString`: what ships is then exactly what is written and tested here. A
15
+ * stringified function is whatever the compiler made of it — the minified SSR build and tsx's test
16
+ * transform can each add helpers that live outside the function, and the copy that reaches the
17
+ * browser is not the one the tests ran. Hence the rules for the source below: ES2017 (it runs
18
+ * before anything else on the page, in every browser a shopper has), ASCII only, and no backtick or
19
+ * `${` (it sits in a template literal).
20
+ *
21
+ * WHAT IT DOES. It cancels — synchronously, which is the actual protection — every top-level
22
+ * navigation to a host that is neither the store's own nor on the allowlist, and shows the shopper
23
+ * where the page wanted to send them. "Continue" repeats exactly that navigation; anything else
24
+ * leaves them on the page. Three ways in:
25
+ * - The Navigation API's `navigate` event, for every navigation same-origin code starts in this
26
+ * tab: `location.*`, `form.submit()`, meta refresh, `window.open(…, "_self")` and the theme
27
+ * Router's `location.href`. Browsers without the API get the other two only.
28
+ * - A `click` listener for links. Bubble phase, so a page handler that already prevented the click
29
+ * (a link used as a lightbox trigger) is left alone, and registered before the Router's own
30
+ * window listener, so a held link stops there — the Router re-issues every click as
31
+ * `location.href` or, for `target=_blank`, `window.open`, which fires no `navigate` here.
32
+ * - `window.open` itself, for windows opened with a user gesture behind them. One without is left
33
+ * to the browser's popup blocker: asking about it would let "Continue" open a popup the browser
34
+ * was about to block.
35
+ * - The links of same-origin frames — where a chat widget usually draws its window. A link that
36
+ * opens a new tab or takes this tab away is held; one that stays inside the frame is not, and the
37
+ * frame's own `window.open` is left alone so the widget's popups keep working. Frames are hooked
38
+ * on every `load`, as a widget rewriting its frame (`document.open`) wipes its listeners; adding
39
+ * the same listener again is otherwise a no-op.
40
+ *
41
+ * WHAT IT ASSUMES OF THE PAGE: nothing, since everything else on it — apps, GTM, the merchant's own
42
+ * scripts — runs after it and may be hostile. The built-ins it relies on are captured before they
43
+ * can be patched, nothing is reachable from the page (no global, a closed shadow root), Continue
44
+ * takes only a real click and not in the first 600ms, the first destination of a dialog cannot be
45
+ * swapped for another, and a dialog removed from the page counts as "stay". What it cannot catch
46
+ * is listed in the plan and the report: anything inside a cross-origin frame, navigations started
47
+ * by another origin's document (such a frame navigating the top window, a page using
48
+ * `window.opener`), `open` taken from a fresh frame, and anything that runs before it.
49
+ */
50
+ export declare const REDIRECT_GUARD_RUNTIME: string;
@@ -0,0 +1 @@
1
+ import{__makeTemplateObject as e}from'./../../ext/tslib/tslib.es6.js';var n,t=String.raw(n||(n=e(['(function (win, cfg) {\n "use strict";\n var doc = win.document;\n var FunctionP = win.Function.prototype;\n var uncurry = FunctionP.bind.bind(FunctionP.call);\n var apply = uncurry(FunctionP.apply);\n var describe = win.Object.getOwnPropertyDescriptor;\n var protoOf = win.Object.getPrototypeOf;\n var create = win.Object.create;\n var now = win.Date.now;\n var toText = win.String;\n\n function protoIn(realm, name) {\n var C;\n try {\n C = realm[name];\n } catch (error) {\n return null;\n }\n return C ? C.prototype : null;\n }\n function proto(name) {\n return protoIn(win, name);\n }\n function getter(p, name) {\n var d = p ? describe(p, name) : null;\n return d && d.get ? uncurry(d.get) : null;\n }\n function setter(p, name) {\n var d = p ? describe(p, name) : null;\n return d && d.set ? uncurry(d.set) : null;\n }\n function method(p, name) {\n var f = p ? p[name] : null;\n return typeof f === "function" ? uncurry(f) : null;\n }\n\n var EventP = proto("Event");\n var NodeP = proto("Node");\n var ElementP = proto("Element");\n var DocumentP = proto("Document");\n var WeakMapC = win.WeakMap;\n var attachShadow = method(ElementP, "attachShadow");\n if (!doc || !EventP || !NodeP || !attachShadow || !WeakMapC) return;\n\n var EventTargetP = proto("EventTarget");\n var listen = method(EventTargetP, "addEventListener");\n var unlisten = method(EventTargetP, "removeEventListener");\n var preventDefault = method(EventP, "preventDefault");\n var stopImmediatePropagation = method(EventP, "stopImmediatePropagation");\n var typeOf = getter(EventP, "type");\n var bubblesOf = getter(EventP, "bubbles");\n var cancelableOf = getter(EventP, "cancelable");\n var cancelBubbleOf = getter(EventP, "cancelBubble");\n var eventPhaseOf = getter(EventP, "eventPhase");\n var defaultPreventedOf = getter(EventP, "defaultPrevented");\n var targetOf = getter(EventP, "target");\n var composedPath = method(EventP, "composedPath");\n var MouseEventP = proto("MouseEvent");\n var buttonOf = getter(MouseEventP, "button");\n var ctrlKeyOf = getter(MouseEventP, "ctrlKey");\n var metaKeyOf = getter(MouseEventP, "metaKey");\n var shiftKeyOf = getter(MouseEventP, "shiftKey");\n var altKeyOf = getter(MouseEventP, "altKey");\n var submitterOf = getter(proto("SubmitEvent"), "submitter");\n var keyOf = getter(proto("KeyboardEvent"), "key");\n var persistedOf = getter(proto("PageTransitionEvent"), "persisted");\n var appendChild = method(NodeP, "appendChild");\n var removeChild = method(NodeP, "removeChild");\n var parentNodeOf = getter(NodeP, "parentNode");\n var nodeTypeOf = getter(NodeP, "nodeType");\n var isConnectedOf = getter(NodeP, "isConnected");\n var baseURIOf = getter(NodeP, "baseURI");\n var ownerDocumentOf = getter(NodeP, "ownerDocument");\n var setTextContent = setter(NodeP, "textContent");\n var hostOf = getter(proto("ShadowRoot"), "host");\n var localNameOf = getter(ElementP, "localName");\n var getAttribute = method(ElementP, "getAttribute");\n var getAttributeNS = method(ElementP, "getAttributeNS");\n var setAttribute = method(ElementP, "setAttribute");\n var removeAttribute = method(ElementP, "removeAttribute");\n var createElement = method(DocumentP, "createElement");\n var createTextNode = method(DocumentP, "createTextNode");\n var getElementsByTagName = method(DocumentP, "getElementsByTagName");\n var documentElementOf = getter(DocumentP, "documentElement");\n var activeElementOf = getter(DocumentP, "activeElement");\n var defaultViewOf = getter(DocumentP, "defaultView");\n var focus = method(proto("HTMLElement"), "focus");\n var DialogP = proto("HTMLDialogElement");\n var showModal = method(DialogP, "showModal");\n var closeDialog = method(DialogP, "close");\n var dialogOpenOf = getter(DialogP, "open");\n var submitForm = method(proto("HTMLFormElement"), "submit");\n var FormDataC = win.FormData;\n var eachFormEntry = method(proto("FormData"), "forEach");\n var IFrameP = proto("HTMLIFrameElement");\n var contentWindowOf = getter(IFrameP, "contentWindow");\n var contentDocumentOf = getter(IFrameP, "contentDocument");\n var weakGet = method(WeakMapC.prototype, "get");\n var weakSet = method(WeakMapC.prototype, "set");\n var DataTransferC = win.DataTransfer;\n var URLC = win.URL;\n var hrefOf = getter(URLC.prototype, "href");\n var protocolOf = getter(URLC.prototype, "protocol");\n var hostnameOf = getter(URLC.prototype, "hostname");\n var setSearch = setter(URLC.prototype, "search");\n var ParamsC = win.URLSearchParams;\n var appendParam = method(ParamsC && ParamsC.prototype, "append");\n var paramsText = method(ParamsC && ParamsC.prototype, "toString");\n var StringP = win.String.prototype;\n var slice = method(StringP, "slice");\n var indexOf = method(StringP, "indexOf");\n var toLowerCase = method(StringP, "toLowerCase");\n var charCodeAt = method(StringP, "charCodeAt");\n var MutationObserverC = win.MutationObserver;\n var observe = method(proto("MutationObserver"), "observe");\n var disconnect = method(proto("MutationObserver"), "disconnect");\n var loc = win.location;\n var nativeOpen = win.open;\n var innerWidthOf = getter(win, "innerWidth");\n var innerHeightOf = getter(win, "innerHeight");\n var visual = win.visualViewport || null;\n var VisualViewportP = proto("VisualViewport");\n var visualWidthOf = getter(VisualViewportP, "width");\n var visualHeightOf = getter(VisualViewportP, "height");\n var visualLeftOf = getter(VisualViewportP, "offsetLeft");\n var visualTopOf = getter(VisualViewportP, "offsetTop");\n var lengthOf = getter(win, "length");\n var nameOf = getter(win, "name");\n var activation = win.navigator ? win.navigator.userActivation : null;\n var isActiveOf = activation ? getter(protoOf(activation), "isActive") : null;\n var navigation = win.navigation;\n var NavigateEventP = proto("NavigateEvent");\n var navigationTypeOf = getter(NavigateEventP, "navigationType");\n var destinationOf = getter(NavigateEventP, "destination");\n var downloadRequestOf = getter(NavigateEventP, "downloadRequest");\n var formDataOf = getter(NavigateEventP, "formData");\n var sourceElementOf = getter(NavigateEventP, "sourceElement");\n var userInitiatedOf = getter(NavigateEventP, "userInitiated");\n var urlOf = getter(proto("NavigationDestination"), "url");\n var sameDocumentOf = getter(proto("NavigationDestination"), "sameDocument");\n\n var XLINK = "http://www.w3.org/1999/xlink";\n var MAX_SCRIPT_PROMPTS = 3;\n var PROCEED_DELAY = 600;\n var BYPASS_TTL = 2000;\n var STYLE =\n ":host{all:initial!important;display:block!important;position:fixed!important;inset:0!important;" +\n "z-index:2147483647!important;pointer-events:none!important}" +\n "dialog{box-sizing:border-box;position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;" +\n "margin:0;padding:16px;border:0;background:transparent;display:flex;align-items:center;justify-content:center;" +\n "pointer-events:auto;color-scheme:light;color:#141414;font-size:14px;line-height:1.45;text-align:left}" +\n "dialog:not([open]){display:none}" +\n "dialog::backdrop{background:rgba(26,26,26,.35)}" +\n ".fallback{background:rgba(26,26,26,.35)}" +\n ".card{box-sizing:border-box;width:100%;max-width:440px;max-height:100%;overflow:auto;padding:24px;" +\n "border-radius:12px;background:#fff;box-shadow:0 8px 8px -4px rgba(16,24,40,.03),0 20px 24px -4px rgba(16,24,40,.08)}" +\n "h2{margin:0 0 8px;font-size:18px;font-weight:600;line-height:1.35;letter-spacing:-.01em}" +\n "p{margin:0;color:#333}" +\n ".host{padding:1px 6px;border:1px solid #fecaca;border-radius:4px;background:#fee2e2;color:#450a0a;" +\n "font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px;word-break:break-all}" +\n ".actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:20px}" +\n "button{box-sizing:border-box;min-width:120px;height:44px;margin:0;padding:0 20px;border:1px solid #141414;" +\n "border-radius:8px;font:inherit;font-size:14px;font-weight:500;line-height:1.15;cursor:pointer}" +\n ".stay{background:#141414;color:#fff}.stay:hover{background:#111}" +\n ".proceed{background:transparent;color:#141414}.proceed:hover{background:#f5f4f1}" +\n "button:focus-visible{outline:2px solid #141414;outline-offset:2px}" +\n "@media (max-width:480px){.actions{flex-direction:column}button{width:100%}}" +\n "@keyframes fade{from{opacity:0}to{opacity:1}}" +\n "@media (prefers-reduced-motion:no-preference){.card{animation:fade .12s ease-out}}";\n\n var exactHosts = create(null);\n var suffixHosts = create(null);\n var index;\n for (index = 0; index < cfg.rules.exact.length; index++) exactHosts[cfg.rules.exact[index]] = true;\n for (index = 0; index < cfg.rules.suffix.length; index++) suffixHosts[cfg.rules.suffix[index]] = true;\n var here = loc.hostname;\n if (here) {\n exactHosts[here] = true;\n exactHosts[slice(here, 0, 4) === "www." ? slice(here, 4) : "www." + here] = true;\n }\n\n function isTrustedHost(host) {\n if (exactHosts[host] === true) return true;\n for (var dot = indexOf(host, "."); dot !== -1; dot = indexOf(host, ".", dot + 1)) {\n if (suffixHosts[slice(host, dot + 1)] === true) return true;\n }\n return false;\n }\n\n function parseWebUrl(raw, base) {\n var url;\n try {\n url = new URLC(raw, base || baseURIOf(doc));\n } catch (error) {\n return null;\n }\n var protocol = protocolOf(url);\n if (protocol !== "http:" && protocol !== "https:") return null;\n var host = hostnameOf(url);\n if (host.length > 1 && charCodeAt(host, host.length - 1) === 46) host = slice(host, 0, -1);\n return { href: hrefOf(url), host: host };\n }\n\n function isActiveIn(source) {\n return !isActiveOf || !source ? true : isActiveOf(source);\n }\n\n function element(parent, tag, className, text) {\n var node = createElement(doc, tag);\n if (className) setAttribute(node, "class", className);\n if (text) setTextContent(node, text);\n appendChild(parent, node);\n return node;\n }\n\n var texts = cfg.texts;\n var container = createElement(doc, "div");\n var shadow = attachShadow(container, { mode: "closed" });\n element(shadow, "style", "", STYLE);\n var dialog = element(shadow, "dialog", showModal ? "" : "fallback", "");\n setAttribute(dialog, "role", "alertdialog");\n setAttribute(dialog, "aria-modal", "true");\n setAttribute(dialog, "aria-labelledby", "title");\n setAttribute(dialog, "aria-describedby", "body");\n setAttribute(dialog, "lang", texts.lang);\n setAttribute(dialog, "dir", "ltr");\n var card = element(dialog, "div", "card", "");\n setAttribute(element(card, "h2", "", texts.title), "id", "title");\n var body = element(card, "p", "", "");\n setAttribute(body, "id", "body");\n appendChild(body, createTextNode(doc, texts.bodyBefore));\n var hostLabel = element(body, "bdi", "host", "");\n setAttribute(hostLabel, "dir", "ltr");\n appendChild(body, createTextNode(doc, texts.bodyAfter));\n var actions = element(card, "div", "actions", "");\n var stayButton = element(actions, "button", "stay", texts.stay);\n var proceedButton = element(actions, "button", "proceed", texts.proceed);\n setAttribute(stayButton, "type", "button");\n setAttribute(proceedButton, "type", "button");\n\n var pending = null;\n var bypass = null;\n var observer = null;\n var restoreFocusTo = null;\n var savedOverflow = "";\n var focusedButton = stayButton;\n var scriptPrompts = 0;\n\n // A fixed dialog covers the layout viewport. When the page is wider than the screen, Android\n // Chrome widens the layout viewport to the page, so the dialog is centred on the page and lands\n // outside what the shopper sees. Lay it over the visual viewport then; leave it to the CSS\n // whenever the two match, which is every page that fits its screen.\n function fitToView() {\n var style = dialog.style;\n style.left = style.top = style.right = style.bottom = style.width = style.height = "";\n if (!visual || !visualWidthOf || !visualHeightOf || !visualLeftOf || !visualTopOf) return;\n if (!innerWidthOf || !innerHeightOf) return;\n var width = visualWidthOf(visual);\n var height = visualHeightOf(visual);\n var left = visualLeftOf(visual);\n var top = visualTopOf(visual);\n if (!(width > 0 && height > 0)) return;\n // innerWidth/innerHeight: the layout viewport, scrollbars included. The root\'s overflow is\n // hidden while the dialog is open, so on a page that fits there is nothing between the two.\n if (left < 1 && top < 1 && width > innerWidthOf(win) - 1 && height > innerHeightOf(win) - 1) return;\n style.left = left + "px";\n style.top = top + "px";\n style.right = style.bottom = "auto";\n style.width = width + "px";\n style.height = height + "px";\n }\n\n function followView(on) {\n if (!visual) return;\n (on ? listen : unlisten)(visual, "resize", fitToView);\n (on ? listen : unlisten)(visual, "scroll", fitToView);\n }\n\n function show(next) {\n var root = documentElementOf(doc);\n if (!root) return;\n pending = next;\n next.shownAt = now();\n setTextContent(hostLabel, next.host);\n restoreFocusTo = activeElementOf(doc);\n var fontFamily = "";\n try {\n fontFamily = doc.body ? win.getComputedStyle(doc.body).fontFamily : "";\n } catch (error) {}\n card.style.fontFamily = fontFamily || "system-ui,-apple-system,\'Segoe UI\',Roboto,sans-serif";\n appendChild(root, container);\n savedOverflow = root.style.overflow;\n root.style.overflow = "hidden";\n if (showModal) {\n try {\n showModal(dialog);\n } catch (error) {\n setAttribute(dialog, "open", "");\n }\n } else {\n setAttribute(dialog, "open", "");\n }\n fitToView();\n followView(true);\n focus(stayButton);\n if (MutationObserverC && observe) {\n observer = new MutationObserverC(function () {\n if (pending !== null && !isConnectedOf(container)) reset();\n });\n observe(observer, root, { childList: true });\n }\n }\n\n function reset() {\n pending = null;\n followView(false);\n if (observer !== null) {\n disconnect(observer);\n observer = null;\n }\n if (closeDialog && dialogOpenOf(dialog)) closeDialog(dialog);\n else removeAttribute(dialog, "open");\n var parent = parentNodeOf(container);\n if (parent) removeChild(parent, container);\n var root = documentElementOf(doc);\n if (root) root.style.overflow = savedOverflow;\n var previous = restoreFocusTo;\n restoreFocusTo = null;\n if (previous) {\n try {\n focus(previous);\n } catch (error) {}\n }\n }\n\n function stay() {\n if (pending !== null) reset();\n }\n\n function submitCopy(copy, action, target) {\n var root = documentElementOf(doc);\n var form = createElement(doc, "form");\n setAttribute(form, "method", "post");\n setAttribute(form, "action", action);\n setAttribute(form, "enctype", copy.enctype);\n setAttribute(form, "target", target);\n setAttribute(form, "hidden", "");\n for (var i = 0; i < copy.entries.length; i++) {\n var input = createElement(doc, "input");\n var value = copy.entries[i][1];\n setAttribute(input, "name", copy.entries[i][0]);\n if (typeof value === "string") {\n setAttribute(input, "type", "hidden");\n setAttribute(input, "value", value);\n } else {\n if (!DataTransferC) return false;\n var transfer = new DataTransferC();\n transfer.items.add(value);\n setAttribute(input, "type", "file");\n input.files = transfer.files;\n }\n appendChild(form, input);\n }\n if (!root) return false;\n appendChild(root, form);\n submitForm(form);\n if (target !== "_self") removeChild(root, form);\n return true;\n }\n\n function proceed() {\n var approved = pending;\n reset();\n if (approved.newTab) {\n if (approved.form !== null) {\n submitCopy(approved.form, approved.href, "_blank");\n } else {\n apply(nativeOpen, win, [approved.href, approved.target, approved.features ? approved.features + ",noopener" : "noopener"]);\n }\n return;\n }\n bypass = { href: approved.href, until: now() + BYPASS_TTL };\n if (approved.form !== null) {\n if (!submitCopy(approved.form, approved.href, "_self")) bypass = null;\n } else if (approved.replace) {\n loc.replace(approved.href);\n } else {\n loc.assign(approved.href);\n }\n }\n\n function attempt(next) {\n if (pending !== null) {\n if (isConnectedOf(container)) return;\n reset();\n }\n if (next.script) {\n if (scriptPrompts >= MAX_SCRIPT_PROMPTS) return;\n scriptPrompts++;\n }\n show(next);\n }\n\n listen(stayButton, "click", function () {\n stay();\n });\n listen(proceedButton, "click", function (event) {\n if (event.isTrusted && pending !== null && now() - pending.shownAt >= PROCEED_DELAY) proceed();\n });\n listen(stayButton, "focus", function () {\n focusedButton = stayButton;\n });\n listen(proceedButton, "focus", function () {\n focusedButton = proceedButton;\n });\n listen(dialog, "click", function (event) {\n if (targetOf(event) === dialog) stay();\n });\n listen(dialog, "cancel", function (event) {\n preventDefault(event);\n stay();\n });\n listen(dialog, "close", function () {\n if (dialogOpenOf && !dialogOpenOf(dialog)) stay();\n });\n listen(dialog, "keydown", function (event) {\n if (showModal || !keyOf) return;\n var key = keyOf(event);\n if (key === "Escape") {\n stay();\n } else if (key === "Tab") {\n preventDefault(event);\n focus(focusedButton === stayButton ? proceedButton : stayButton);\n }\n });\n\n function isNode(value) {\n try {\n nodeTypeOf(value);\n return true;\n } catch (error) {\n return false;\n }\n }\n\n function linkHref(node) {\n if (!isNode(node) || nodeTypeOf(node) !== 1) return null;\n var name = localNameOf(node);\n if (name !== "a" && name !== "area") return null;\n var href = getAttribute(node, "href");\n if (href === null && getAttributeNS) href = getAttributeNS(node, XLINK, "href");\n return href;\n }\n\n function linkInPath(path, bubbles) {\n for (var i = 0; i < path.length; i++) {\n if (linkHref(path[i]) !== null) return path[i];\n if (!bubbles || !isNode(path[i]) || nodeTypeOf(path[i]) === 9) return null;\n }\n return null;\n }\n\n function parentAcross(node) {\n var parent = parentNodeOf(node);\n if (parent || nodeTypeOf(node) !== 11 || !hostOf) return parent;\n try {\n return hostOf(node);\n } catch (error) {\n return null;\n }\n }\n\n function linkAbove(node, bubbles) {\n for (var current = node, steps = 0; current && steps < 1024; current = parentAcross(current), steps++) {\n if (linkHref(current) !== null) return current;\n if (!bubbles) return null;\n }\n return null;\n }\n\n var watchedRoots = new WeakMapC();\n\n function isWatched(node) {\n var root = node;\n for (var parent = parentNodeOf(node); parent; parent = parentNodeOf(parent)) root = parent;\n return weakGet(watchedRoots, root) === true;\n }\n\n function baseTarget(root) {\n var bases = root ? getElementsByTagName(root, "base") : [];\n for (var i = 0; i < bases.length; i++) {\n var target = getAttribute(bases[i], "target");\n if (target !== null) return target;\n }\n return "";\n }\n\n function windowName(target) {\n try {\n return nameOf ? nameOf(target) : null;\n } catch (error) {\n return null;\n }\n }\n\n function hasFrameNamed(parent, name, level) {\n var count;\n try {\n count = lengthOf ? lengthOf(parent) : 0;\n } catch (error) {\n return false;\n }\n for (var i = 0; i < count && i < 64; i++) {\n var child;\n try {\n child = parent[i];\n } catch (error) {\n continue;\n }\n if (!child) continue;\n if (windowName(child) === name) return true;\n if (level < 4 && hasFrameNamed(child, name, level + 1)) return true;\n }\n return false;\n }\n\n function targetGoesTo(target, depth, realm) {\n var name = toLowerCase(target);\n if (name === "" || name === "_self") return depth === 0 ? "tab" : null;\n if (name === "_top") return "tab";\n if (name === "_parent") return depth <= 1 ? "tab" : null;\n if (name === "_blank") return "new";\n if (realm && windowName(realm) === target) return depth === 0 ? "tab" : null;\n if (windowName(win) === target) return "tab";\n return hasFrameNamed(win, target, 0) ? null : "new";\n }\n\n function viewOf(node) {\n var owner = ownerDocumentOf(node);\n return owner ? defaultViewOf(owner) : null;\n }\n\n function linkAttempt(node, depth, script) {\n var href = linkHref(node);\n if (href === null) return null;\n var url = parseWebUrl(href, baseURIOf(node));\n if (url === null || isTrustedHost(url.host)) return null;\n var target = getAttribute(node, "target");\n var goesTo = targetGoesTo(target === null ? baseTarget(ownerDocumentOf(node)) : target, depth, viewOf(node));\n if (goesTo === null) return null;\n return {\n href: url.href,\n host: url.host,\n newTab: goesTo === "new",\n target: "_blank",\n features: "",\n replace: false,\n form: null,\n script: script,\n };\n }\n\n function copyForm(data, source) {\n var entries = [];\n var hasFile = false;\n eachFormEntry(data, function (value, name) {\n entries[entries.length] = [name, value];\n if (typeof value !== "string") hasFile = true;\n });\n var enctype = null;\n if (source && nodeTypeOf(source) === 1) {\n enctype = getAttribute(source, "formenctype");\n var owner = localNameOf(source) === "form" ? source : source.form;\n if (!enctype && owner) enctype = getAttribute(owner, "enctype");\n }\n if (!enctype) enctype = hasFile ? "multipart/form-data" : "application/x-www-form-urlencoded";\n return { entries: entries, enctype: enctype };\n }\n\n function formValue(button, buttonName, form, formName) {\n var value = button ? getAttribute(button, buttonName) : null;\n return value !== null ? value : getAttribute(form, formName);\n }\n\n function readForm(form, button) {\n try {\n return button ? new FormDataC(form, button) : new FormDataC(form);\n } catch (error) {\n try {\n return new FormDataC(form);\n } catch (retryError) {\n return null;\n }\n }\n }\n\n function withQuery(href, entries) {\n if (!ParamsC || !appendParam || !paramsText || !setSearch) return href;\n var params = new ParamsC();\n for (var i = 0; i < entries.length; i++) {\n var value = entries[i][1];\n appendParam(params, entries[i][0], typeof value === "string" ? value : value.name);\n }\n var url = new URLC(href);\n setSearch(url, paramsText(params));\n return hrefOf(url);\n }\n\n function formAttempt(form, submitter, depth, script, copy) {\n if (!isNode(form) || nodeTypeOf(form) !== 1 || localNameOf(form) !== "form") return null;\n var button = submitter && isNode(submitter) && nodeTypeOf(submitter) === 1 ? submitter : null;\n var action = formValue(button, "formaction", form, "action");\n var url = parseWebUrl(action === null ? "" : action, baseURIOf(form));\n if (url === null || isTrustedHost(url.host)) return null;\n var target = formValue(button, "formtarget", form, "target");\n var goesTo = targetGoesTo(target === null ? baseTarget(ownerDocumentOf(form)) : target, depth, viewOf(form));\n if (goesTo === null || (goesTo === "tab" && navigation)) return null;\n var method = formValue(button, "formmethod", form, "method");\n method = method === null ? "get" : toLowerCase(method);\n if (method === "dialog") return null;\n var next = {\n href: url.href,\n host: url.host,\n newTab: goesTo === "new",\n target: goesTo === "new" ? "_blank" : "_self",\n features: "",\n replace: false,\n form: null,\n script: script,\n };\n if (!copy) return next;\n var data = readForm(form, button);\n if (data === null) return null;\n var copied = copyForm(data, button || form);\n if (method === "post") next.form = copied;\n else next.href = withQuery(url.href, copied.entries);\n return next;\n }\n\n function isMouseEvent(event) {\n try {\n buttonOf(event);\n return true;\n } catch (error) {\n return false;\n }\n }\n\n function isShoppersOwnChoice(event) {\n if (!event.isTrusted) return false;\n try {\n return buttonOf(event) !== 0 || ctrlKeyOf(event) || metaKeyOf(event) || shiftKeyOf(event) || altKeyOf(event);\n } catch (error) {\n return true;\n }\n }\n\n var eventStates = new WeakMapC();\n var armedEvents = [];\n\n function stateOf(event) {\n var state = weakGet(eventStates, event);\n if (!state) {\n state = { decided: false, link: null, armed: null };\n weakSet(eventStates, event, state);\n }\n return state;\n }\n\n function disarm(state) {\n var armed = state.armed;\n if (armed === null || armed.done) return;\n armed.done = true;\n for (var i = 0; i < armed.nodes.length; i++) {\n unlisten(armed.nodes[i], armed.type, armed.check, true);\n unlisten(armed.nodes[i], armed.type, armed.check, false);\n }\n }\n\n function sweep() {\n var live = [];\n for (var i = 0; i < armedEvents.length; i++) {\n if (eventPhaseOf(armedEvents[i]) === 0) disarm(stateOf(armedEvents[i]));\n else live[live.length] = armedEvents[i];\n }\n armedEvents = live;\n }\n\n function arm(event, type, decide) {\n var state = stateOf(event);\n if (state.decided || state.armed !== null || !composedPath || !unlisten) return;\n var check = function (current) {\n if (current === event && cancelBubbleOf(current)) decide(current);\n };\n var path = composedPath(event);\n var nodes = [];\n for (var i = 0; i < path.length; i++) {\n if (!isNode(path[i])) continue;\n listen(path[i], type, check, true);\n listen(path[i], type, check, false);\n nodes[nodes.length] = path[i];\n }\n state.armed = { nodes: nodes, type: type, check: check, done: false };\n armedEvents[armedEvents.length] = event;\n }\n\n function hold(event, next) {\n var state = stateOf(event);\n state.decided = true;\n disarm(state);\n preventDefault(event);\n stopImmediatePropagation(event);\n attempt(next);\n }\n\n function onClickCapture(event, depth, active) {\n sweep();\n var state = stateOf(event);\n if (state.decided || !composedPath) return;\n var link = linkInPath(composedPath(event), bubblesOf(event));\n if (link === null) return;\n state.link = link;\n if (!event.isTrusted) {\n var next = isMouseEvent(event) ? linkAttempt(link, depth, true) : null;\n if (next !== null && next.newTab && active()) hold(event, next);\n return;\n }\n if (isShoppersOwnChoice(event)) return;\n var held = linkAttempt(link, depth, false);\n if (held !== null && (held.newTab || !navigation)) {\n arm(event, "click", function (current) {\n decideClick(current, depth, active);\n });\n }\n }\n\n function decideClick(event, depth, active) {\n var state = stateOf(event);\n if (state.decided || defaultPreventedOf(event) || isShoppersOwnChoice(event)) return;\n if (!event.isTrusted && !isMouseEvent(event)) return;\n var link = state.link;\n if (link === null && composedPath) link = linkInPath(composedPath(event), bubblesOf(event));\n if (link === null) return;\n var next = linkAttempt(link, depth, !event.isTrusted);\n if (next === null || (next.script && next.newTab && !active())) return;\n hold(event, next);\n }\n\n function onSubmitCapture(event, depth, active) {\n sweep();\n var state = stateOf(event);\n if (state.decided) return;\n if (formAttempt(targetOf(event), submitterOf ? submitterOf(event) : null, depth, false, false) === null) return;\n arm(event, "submit", function (current) {\n decideSubmit(current, depth, active);\n });\n }\n\n function decideSubmit(event, depth, active) {\n var state = stateOf(event);\n if (state.decided || defaultPreventedOf(event)) return;\n var form = targetOf(event);\n var submitter = submitterOf ? submitterOf(event) : null;\n var found = formAttempt(form, submitter, depth, !event.isTrusted, false);\n if (found === null || (found.newTab && !active())) return;\n var next = formAttempt(form, submitter, depth, !event.isTrusted, true);\n if (next !== null) hold(event, next);\n }\n\n function holdScriptClick(node, bubbles, uncancelable, depth, active) {\n if (!isNode(node) || (!uncancelable && isWatched(node))) return false;\n var link = linkAbove(node, bubbles);\n if (link === null || (!isConnectedOf(link) && localNameOf(link) !== "a") || !viewOf(link)) return false;\n var next = linkAttempt(link, depth, true);\n if (next === null || (next.newTab && !active())) return false;\n attempt(next);\n return true;\n }\n\n function holdFormCall(form, submitter, unseenOnly, depth, active) {\n if (!isNode(form) || !isConnectedOf(form) || (unseenOnly && isWatched(form))) return false;\n var found = formAttempt(form, submitter, depth, true, false);\n if (found === null || (found.newTab && !active())) return false;\n var next = formAttempt(form, submitter, depth, true, true);\n if (next === null) return false;\n attempt(next);\n return true;\n }\n\n function isClick(event) {\n try {\n return typeOf(event) === "click" && isMouseEvent(event);\n } catch (error) {\n return false;\n }\n }\n\n function openAttempt(args, realm, depth) {\n if (args[0] === "") return null;\n var base;\n try {\n base = baseURIOf(realm.document);\n } catch (error) {\n return null;\n }\n var destination = parseWebUrl(args[0], base);\n if (destination === null || isTrustedHost(destination.host)) return null;\n var name = args[1] === "" ? "_blank" : args[1];\n var goesTo = targetGoesTo(name, depth, realm);\n if (goesTo === null) return null;\n return {\n href: destination.href,\n host: destination.host,\n newTab: goesTo === "new",\n target: name,\n features: args[2],\n replace: false,\n form: null,\n script: true,\n };\n }\n\n var ownFunctions = new WeakMapC();\n\n function wrap(target, name, make) {\n var original;\n try {\n original = target ? target[name] : null;\n } catch (error) {\n return;\n }\n if (typeof original !== "function" || weakGet(ownFunctions, original) === true) return;\n var wrapper = make(original);\n weakSet(ownFunctions, wrapper, true);\n try {\n target[name] = wrapper;\n } catch (error) {}\n }\n\n function wrapRealm(realm, depth, hooks) {\n var active = hooks.active;\n wrap(realm, "open", function (original) {\n return function open() {\n for (var i = 0; i < arguments.length; i++) {\n if (typeof arguments[i] === "symbol") return apply(original, realm, arguments);\n }\n var args = [\n arguments.length > 0 && arguments[0] !== undefined ? toText(arguments[0]) : "",\n arguments.length > 1 && arguments[1] !== undefined ? toText(arguments[1]) : "_blank",\n arguments.length > 2 && arguments[2] !== undefined ? toText(arguments[2]) : "",\n ];\n var next = openAttempt(args, realm, depth);\n if (next === null || (next.newTab && !active())) return apply(original, realm, args);\n attempt(next);\n return null;\n };\n });\n wrap(protoIn(realm, "HTMLElement"), "click", function (original) {\n return function click() {\n if (!holdScriptClick(this, true, false, depth, active)) return apply(original, this, arguments);\n };\n });\n wrap(protoIn(realm, "EventTarget"), "dispatchEvent", function (original) {\n return function dispatchEvent(event) {\n if (isClick(event) && holdScriptClick(this, bubblesOf(event), !cancelableOf(event), depth, active)) {\n return false;\n }\n return apply(original, this, arguments);\n };\n });\n var FormP = protoIn(realm, "HTMLFormElement");\n wrap(FormP, "submit", function (original) {\n return function submit() {\n if (!holdFormCall(this, null, false, depth, active)) return apply(original, this, arguments);\n };\n });\n wrap(FormP, "requestSubmit", function (original) {\n return function requestSubmit() {\n var submitter = arguments.length > 0 ? arguments[0] : null;\n if (!holdFormCall(this, submitter, true, depth, active)) return apply(original, this, arguments);\n };\n });\n wrap(protoIn(realm, "Element"), "attachShadow", function (original) {\n return function attachShadow(init) {\n var root = apply(original, this, arguments);\n watchShadow(root, depth, hooks);\n return root;\n };\n });\n }\n\n function watchShadow(root, depth, hooks) {\n try {\n listen(root, "click", hooks.clickCapture, true);\n listen(root, "submit", hooks.submitCapture, true);\n listen(root, "submit", hooks.submit);\n } catch (error) {\n return;\n }\n weakSet(watchedRoots, root, true);\n watchFrames(root, depth + 1);\n }\n\n var realmHooks = new WeakMapC();\n var frameLoadListeners = new WeakMapC();\n\n function hooksFor(realm, depth) {\n var realmActivation = null;\n if (depth > 0) {\n try {\n realmActivation = realm.navigator ? realm.navigator.userActivation : null;\n } catch (error) {}\n }\n var active = function () {\n return isActiveIn(activation) || (depth > 0 && isActiveIn(realmActivation));\n };\n return {\n active: active,\n clickCapture: function (event) {\n onClickCapture(event, depth, active);\n },\n click: function (event) {\n decideClick(event, depth, active);\n },\n submitCapture: function (event) {\n onSubmitCapture(event, depth, active);\n },\n submit: function (event) {\n decideSubmit(event, depth, active);\n },\n };\n }\n\n function armRealm(realm, depth) {\n var realmDocument;\n try {\n realmDocument = realm.document;\n } catch (error) {\n return;\n }\n if (!realmDocument) return;\n var hooks = weakGet(realmHooks, realm);\n if (!hooks) {\n hooks = hooksFor(realm, depth);\n weakSet(realmHooks, realm, hooks);\n }\n try {\n listen(realm, "click", hooks.clickCapture, true);\n listen(realm, "click", hooks.click);\n listen(realm, "submit", hooks.submitCapture, true);\n listen(realm, "submit", hooks.submit);\n } catch (error) {\n return;\n }\n weakSet(watchedRoots, realmDocument, true);\n wrapRealm(realm, depth, hooks);\n watchFrames(realmDocument, depth + 1);\n }\n\n function guardFrame(frame, depth) {\n var frameWin;\n try {\n frameWin = contentWindowOf(frame);\n if (!frameWin || !contentDocumentOf(frame)) return;\n } catch (error) {\n return;\n }\n armRealm(frameWin, depth);\n }\n\n function watchFrames(root, depth) {\n if (!contentWindowOf || !contentDocumentOf) return;\n var onLoad = weakGet(frameLoadListeners, root);\n if (!onLoad) {\n onLoad = function (event) {\n var frame = targetOf(event);\n if (frame && nodeTypeOf(frame) === 1 && localNameOf(frame) === "iframe") guardFrame(frame, depth);\n };\n weakSet(frameLoadListeners, root, onLoad);\n }\n listen(root, "load", onLoad, true);\n if (nodeTypeOf(root) !== 9) return;\n var frames = getElementsByTagName(root, "iframe");\n for (var i = 0; i < frames.length; i++) guardFrame(frames[i], depth);\n }\n\n armRealm(win, 0);\n\n if (navigation && navigationTypeOf && destinationOf && urlOf) {\n listen(navigation, "navigate", function (event) {\n if (!event.isTrusted || !cancelableOf(event)) return;\n var type = navigationTypeOf(event);\n if (type === "traverse" || type === "reload") return;\n var destination = destinationOf(event);\n if (sameDocumentOf && sameDocumentOf(destination)) return;\n if (downloadRequestOf && downloadRequestOf(event) !== null) return;\n var url = parseWebUrl(urlOf(destination));\n if (url === null) return;\n if (bypass !== null && bypass.href === url.href) {\n var approved = now() <= bypass.until;\n bypass = null;\n if (approved) return;\n }\n if (isTrustedHost(url.host)) return;\n preventDefault(event);\n var data = formDataOf ? formDataOf(event) : null;\n attempt({\n href: url.href,\n host: url.host,\n newTab: false,\n target: "_self",\n features: "",\n replace: type === "replace",\n form: data ? copyForm(data, sourceElementOf ? sourceElementOf(event) : null) : null,\n script: !(userInitiatedOf && userInitiatedOf(event)),\n });\n });\n }\n\n listen(win, "pageshow", function (event) {\n if (pending !== null && persistedOf && persistedOf(event)) reset();\n });\n})'],['(function (win, cfg) {\n "use strict";\n var doc = win.document;\n var FunctionP = win.Function.prototype;\n var uncurry = FunctionP.bind.bind(FunctionP.call);\n var apply = uncurry(FunctionP.apply);\n var describe = win.Object.getOwnPropertyDescriptor;\n var protoOf = win.Object.getPrototypeOf;\n var create = win.Object.create;\n var now = win.Date.now;\n var toText = win.String;\n\n function protoIn(realm, name) {\n var C;\n try {\n C = realm[name];\n } catch (error) {\n return null;\n }\n return C ? C.prototype : null;\n }\n function proto(name) {\n return protoIn(win, name);\n }\n function getter(p, name) {\n var d = p ? describe(p, name) : null;\n return d && d.get ? uncurry(d.get) : null;\n }\n function setter(p, name) {\n var d = p ? describe(p, name) : null;\n return d && d.set ? uncurry(d.set) : null;\n }\n function method(p, name) {\n var f = p ? p[name] : null;\n return typeof f === "function" ? uncurry(f) : null;\n }\n\n var EventP = proto("Event");\n var NodeP = proto("Node");\n var ElementP = proto("Element");\n var DocumentP = proto("Document");\n var WeakMapC = win.WeakMap;\n var attachShadow = method(ElementP, "attachShadow");\n if (!doc || !EventP || !NodeP || !attachShadow || !WeakMapC) return;\n\n var EventTargetP = proto("EventTarget");\n var listen = method(EventTargetP, "addEventListener");\n var unlisten = method(EventTargetP, "removeEventListener");\n var preventDefault = method(EventP, "preventDefault");\n var stopImmediatePropagation = method(EventP, "stopImmediatePropagation");\n var typeOf = getter(EventP, "type");\n var bubblesOf = getter(EventP, "bubbles");\n var cancelableOf = getter(EventP, "cancelable");\n var cancelBubbleOf = getter(EventP, "cancelBubble");\n var eventPhaseOf = getter(EventP, "eventPhase");\n var defaultPreventedOf = getter(EventP, "defaultPrevented");\n var targetOf = getter(EventP, "target");\n var composedPath = method(EventP, "composedPath");\n var MouseEventP = proto("MouseEvent");\n var buttonOf = getter(MouseEventP, "button");\n var ctrlKeyOf = getter(MouseEventP, "ctrlKey");\n var metaKeyOf = getter(MouseEventP, "metaKey");\n var shiftKeyOf = getter(MouseEventP, "shiftKey");\n var altKeyOf = getter(MouseEventP, "altKey");\n var submitterOf = getter(proto("SubmitEvent"), "submitter");\n var keyOf = getter(proto("KeyboardEvent"), "key");\n var persistedOf = getter(proto("PageTransitionEvent"), "persisted");\n var appendChild = method(NodeP, "appendChild");\n var removeChild = method(NodeP, "removeChild");\n var parentNodeOf = getter(NodeP, "parentNode");\n var nodeTypeOf = getter(NodeP, "nodeType");\n var isConnectedOf = getter(NodeP, "isConnected");\n var baseURIOf = getter(NodeP, "baseURI");\n var ownerDocumentOf = getter(NodeP, "ownerDocument");\n var setTextContent = setter(NodeP, "textContent");\n var hostOf = getter(proto("ShadowRoot"), "host");\n var localNameOf = getter(ElementP, "localName");\n var getAttribute = method(ElementP, "getAttribute");\n var getAttributeNS = method(ElementP, "getAttributeNS");\n var setAttribute = method(ElementP, "setAttribute");\n var removeAttribute = method(ElementP, "removeAttribute");\n var createElement = method(DocumentP, "createElement");\n var createTextNode = method(DocumentP, "createTextNode");\n var getElementsByTagName = method(DocumentP, "getElementsByTagName");\n var documentElementOf = getter(DocumentP, "documentElement");\n var activeElementOf = getter(DocumentP, "activeElement");\n var defaultViewOf = getter(DocumentP, "defaultView");\n var focus = method(proto("HTMLElement"), "focus");\n var DialogP = proto("HTMLDialogElement");\n var showModal = method(DialogP, "showModal");\n var closeDialog = method(DialogP, "close");\n var dialogOpenOf = getter(DialogP, "open");\n var submitForm = method(proto("HTMLFormElement"), "submit");\n var FormDataC = win.FormData;\n var eachFormEntry = method(proto("FormData"), "forEach");\n var IFrameP = proto("HTMLIFrameElement");\n var contentWindowOf = getter(IFrameP, "contentWindow");\n var contentDocumentOf = getter(IFrameP, "contentDocument");\n var weakGet = method(WeakMapC.prototype, "get");\n var weakSet = method(WeakMapC.prototype, "set");\n var DataTransferC = win.DataTransfer;\n var URLC = win.URL;\n var hrefOf = getter(URLC.prototype, "href");\n var protocolOf = getter(URLC.prototype, "protocol");\n var hostnameOf = getter(URLC.prototype, "hostname");\n var setSearch = setter(URLC.prototype, "search");\n var ParamsC = win.URLSearchParams;\n var appendParam = method(ParamsC && ParamsC.prototype, "append");\n var paramsText = method(ParamsC && ParamsC.prototype, "toString");\n var StringP = win.String.prototype;\n var slice = method(StringP, "slice");\n var indexOf = method(StringP, "indexOf");\n var toLowerCase = method(StringP, "toLowerCase");\n var charCodeAt = method(StringP, "charCodeAt");\n var MutationObserverC = win.MutationObserver;\n var observe = method(proto("MutationObserver"), "observe");\n var disconnect = method(proto("MutationObserver"), "disconnect");\n var loc = win.location;\n var nativeOpen = win.open;\n var innerWidthOf = getter(win, "innerWidth");\n var innerHeightOf = getter(win, "innerHeight");\n var visual = win.visualViewport || null;\n var VisualViewportP = proto("VisualViewport");\n var visualWidthOf = getter(VisualViewportP, "width");\n var visualHeightOf = getter(VisualViewportP, "height");\n var visualLeftOf = getter(VisualViewportP, "offsetLeft");\n var visualTopOf = getter(VisualViewportP, "offsetTop");\n var lengthOf = getter(win, "length");\n var nameOf = getter(win, "name");\n var activation = win.navigator ? win.navigator.userActivation : null;\n var isActiveOf = activation ? getter(protoOf(activation), "isActive") : null;\n var navigation = win.navigation;\n var NavigateEventP = proto("NavigateEvent");\n var navigationTypeOf = getter(NavigateEventP, "navigationType");\n var destinationOf = getter(NavigateEventP, "destination");\n var downloadRequestOf = getter(NavigateEventP, "downloadRequest");\n var formDataOf = getter(NavigateEventP, "formData");\n var sourceElementOf = getter(NavigateEventP, "sourceElement");\n var userInitiatedOf = getter(NavigateEventP, "userInitiated");\n var urlOf = getter(proto("NavigationDestination"), "url");\n var sameDocumentOf = getter(proto("NavigationDestination"), "sameDocument");\n\n var XLINK = "http://www.w3.org/1999/xlink";\n var MAX_SCRIPT_PROMPTS = 3;\n var PROCEED_DELAY = 600;\n var BYPASS_TTL = 2000;\n var STYLE =\n ":host{all:initial!important;display:block!important;position:fixed!important;inset:0!important;" +\n "z-index:2147483647!important;pointer-events:none!important}" +\n "dialog{box-sizing:border-box;position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;" +\n "margin:0;padding:16px;border:0;background:transparent;display:flex;align-items:center;justify-content:center;" +\n "pointer-events:auto;color-scheme:light;color:#141414;font-size:14px;line-height:1.45;text-align:left}" +\n "dialog:not([open]){display:none}" +\n "dialog::backdrop{background:rgba(26,26,26,.35)}" +\n ".fallback{background:rgba(26,26,26,.35)}" +\n ".card{box-sizing:border-box;width:100%;max-width:440px;max-height:100%;overflow:auto;padding:24px;" +\n "border-radius:12px;background:#fff;box-shadow:0 8px 8px -4px rgba(16,24,40,.03),0 20px 24px -4px rgba(16,24,40,.08)}" +\n "h2{margin:0 0 8px;font-size:18px;font-weight:600;line-height:1.35;letter-spacing:-.01em}" +\n "p{margin:0;color:#333}" +\n ".host{padding:1px 6px;border:1px solid #fecaca;border-radius:4px;background:#fee2e2;color:#450a0a;" +\n "font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px;word-break:break-all}" +\n ".actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:20px}" +\n "button{box-sizing:border-box;min-width:120px;height:44px;margin:0;padding:0 20px;border:1px solid #141414;" +\n "border-radius:8px;font:inherit;font-size:14px;font-weight:500;line-height:1.15;cursor:pointer}" +\n ".stay{background:#141414;color:#fff}.stay:hover{background:#111}" +\n ".proceed{background:transparent;color:#141414}.proceed:hover{background:#f5f4f1}" +\n "button:focus-visible{outline:2px solid #141414;outline-offset:2px}" +\n "@media (max-width:480px){.actions{flex-direction:column}button{width:100%}}" +\n "@keyframes fade{from{opacity:0}to{opacity:1}}" +\n "@media (prefers-reduced-motion:no-preference){.card{animation:fade .12s ease-out}}";\n\n var exactHosts = create(null);\n var suffixHosts = create(null);\n var index;\n for (index = 0; index < cfg.rules.exact.length; index++) exactHosts[cfg.rules.exact[index]] = true;\n for (index = 0; index < cfg.rules.suffix.length; index++) suffixHosts[cfg.rules.suffix[index]] = true;\n var here = loc.hostname;\n if (here) {\n exactHosts[here] = true;\n exactHosts[slice(here, 0, 4) === "www." ? slice(here, 4) : "www." + here] = true;\n }\n\n function isTrustedHost(host) {\n if (exactHosts[host] === true) return true;\n for (var dot = indexOf(host, "."); dot !== -1; dot = indexOf(host, ".", dot + 1)) {\n if (suffixHosts[slice(host, dot + 1)] === true) return true;\n }\n return false;\n }\n\n function parseWebUrl(raw, base) {\n var url;\n try {\n url = new URLC(raw, base || baseURIOf(doc));\n } catch (error) {\n return null;\n }\n var protocol = protocolOf(url);\n if (protocol !== "http:" && protocol !== "https:") return null;\n var host = hostnameOf(url);\n if (host.length > 1 && charCodeAt(host, host.length - 1) === 46) host = slice(host, 0, -1);\n return { href: hrefOf(url), host: host };\n }\n\n function isActiveIn(source) {\n return !isActiveOf || !source ? true : isActiveOf(source);\n }\n\n function element(parent, tag, className, text) {\n var node = createElement(doc, tag);\n if (className) setAttribute(node, "class", className);\n if (text) setTextContent(node, text);\n appendChild(parent, node);\n return node;\n }\n\n var texts = cfg.texts;\n var container = createElement(doc, "div");\n var shadow = attachShadow(container, { mode: "closed" });\n element(shadow, "style", "", STYLE);\n var dialog = element(shadow, "dialog", showModal ? "" : "fallback", "");\n setAttribute(dialog, "role", "alertdialog");\n setAttribute(dialog, "aria-modal", "true");\n setAttribute(dialog, "aria-labelledby", "title");\n setAttribute(dialog, "aria-describedby", "body");\n setAttribute(dialog, "lang", texts.lang);\n setAttribute(dialog, "dir", "ltr");\n var card = element(dialog, "div", "card", "");\n setAttribute(element(card, "h2", "", texts.title), "id", "title");\n var body = element(card, "p", "", "");\n setAttribute(body, "id", "body");\n appendChild(body, createTextNode(doc, texts.bodyBefore));\n var hostLabel = element(body, "bdi", "host", "");\n setAttribute(hostLabel, "dir", "ltr");\n appendChild(body, createTextNode(doc, texts.bodyAfter));\n var actions = element(card, "div", "actions", "");\n var stayButton = element(actions, "button", "stay", texts.stay);\n var proceedButton = element(actions, "button", "proceed", texts.proceed);\n setAttribute(stayButton, "type", "button");\n setAttribute(proceedButton, "type", "button");\n\n var pending = null;\n var bypass = null;\n var observer = null;\n var restoreFocusTo = null;\n var savedOverflow = "";\n var focusedButton = stayButton;\n var scriptPrompts = 0;\n\n // A fixed dialog covers the layout viewport. When the page is wider than the screen, Android\n // Chrome widens the layout viewport to the page, so the dialog is centred on the page and lands\n // outside what the shopper sees. Lay it over the visual viewport then; leave it to the CSS\n // whenever the two match, which is every page that fits its screen.\n function fitToView() {\n var style = dialog.style;\n style.left = style.top = style.right = style.bottom = style.width = style.height = "";\n if (!visual || !visualWidthOf || !visualHeightOf || !visualLeftOf || !visualTopOf) return;\n if (!innerWidthOf || !innerHeightOf) return;\n var width = visualWidthOf(visual);\n var height = visualHeightOf(visual);\n var left = visualLeftOf(visual);\n var top = visualTopOf(visual);\n if (!(width > 0 && height > 0)) return;\n // innerWidth/innerHeight: the layout viewport, scrollbars included. The root\'s overflow is\n // hidden while the dialog is open, so on a page that fits there is nothing between the two.\n if (left < 1 && top < 1 && width > innerWidthOf(win) - 1 && height > innerHeightOf(win) - 1) return;\n style.left = left + "px";\n style.top = top + "px";\n style.right = style.bottom = "auto";\n style.width = width + "px";\n style.height = height + "px";\n }\n\n function followView(on) {\n if (!visual) return;\n (on ? listen : unlisten)(visual, "resize", fitToView);\n (on ? listen : unlisten)(visual, "scroll", fitToView);\n }\n\n function show(next) {\n var root = documentElementOf(doc);\n if (!root) return;\n pending = next;\n next.shownAt = now();\n setTextContent(hostLabel, next.host);\n restoreFocusTo = activeElementOf(doc);\n var fontFamily = "";\n try {\n fontFamily = doc.body ? win.getComputedStyle(doc.body).fontFamily : "";\n } catch (error) {}\n card.style.fontFamily = fontFamily || "system-ui,-apple-system,\'Segoe UI\',Roboto,sans-serif";\n appendChild(root, container);\n savedOverflow = root.style.overflow;\n root.style.overflow = "hidden";\n if (showModal) {\n try {\n showModal(dialog);\n } catch (error) {\n setAttribute(dialog, "open", "");\n }\n } else {\n setAttribute(dialog, "open", "");\n }\n fitToView();\n followView(true);\n focus(stayButton);\n if (MutationObserverC && observe) {\n observer = new MutationObserverC(function () {\n if (pending !== null && !isConnectedOf(container)) reset();\n });\n observe(observer, root, { childList: true });\n }\n }\n\n function reset() {\n pending = null;\n followView(false);\n if (observer !== null) {\n disconnect(observer);\n observer = null;\n }\n if (closeDialog && dialogOpenOf(dialog)) closeDialog(dialog);\n else removeAttribute(dialog, "open");\n var parent = parentNodeOf(container);\n if (parent) removeChild(parent, container);\n var root = documentElementOf(doc);\n if (root) root.style.overflow = savedOverflow;\n var previous = restoreFocusTo;\n restoreFocusTo = null;\n if (previous) {\n try {\n focus(previous);\n } catch (error) {}\n }\n }\n\n function stay() {\n if (pending !== null) reset();\n }\n\n function submitCopy(copy, action, target) {\n var root = documentElementOf(doc);\n var form = createElement(doc, "form");\n setAttribute(form, "method", "post");\n setAttribute(form, "action", action);\n setAttribute(form, "enctype", copy.enctype);\n setAttribute(form, "target", target);\n setAttribute(form, "hidden", "");\n for (var i = 0; i < copy.entries.length; i++) {\n var input = createElement(doc, "input");\n var value = copy.entries[i][1];\n setAttribute(input, "name", copy.entries[i][0]);\n if (typeof value === "string") {\n setAttribute(input, "type", "hidden");\n setAttribute(input, "value", value);\n } else {\n if (!DataTransferC) return false;\n var transfer = new DataTransferC();\n transfer.items.add(value);\n setAttribute(input, "type", "file");\n input.files = transfer.files;\n }\n appendChild(form, input);\n }\n if (!root) return false;\n appendChild(root, form);\n submitForm(form);\n if (target !== "_self") removeChild(root, form);\n return true;\n }\n\n function proceed() {\n var approved = pending;\n reset();\n if (approved.newTab) {\n if (approved.form !== null) {\n submitCopy(approved.form, approved.href, "_blank");\n } else {\n apply(nativeOpen, win, [approved.href, approved.target, approved.features ? approved.features + ",noopener" : "noopener"]);\n }\n return;\n }\n bypass = { href: approved.href, until: now() + BYPASS_TTL };\n if (approved.form !== null) {\n if (!submitCopy(approved.form, approved.href, "_self")) bypass = null;\n } else if (approved.replace) {\n loc.replace(approved.href);\n } else {\n loc.assign(approved.href);\n }\n }\n\n function attempt(next) {\n if (pending !== null) {\n if (isConnectedOf(container)) return;\n reset();\n }\n if (next.script) {\n if (scriptPrompts >= MAX_SCRIPT_PROMPTS) return;\n scriptPrompts++;\n }\n show(next);\n }\n\n listen(stayButton, "click", function () {\n stay();\n });\n listen(proceedButton, "click", function (event) {\n if (event.isTrusted && pending !== null && now() - pending.shownAt >= PROCEED_DELAY) proceed();\n });\n listen(stayButton, "focus", function () {\n focusedButton = stayButton;\n });\n listen(proceedButton, "focus", function () {\n focusedButton = proceedButton;\n });\n listen(dialog, "click", function (event) {\n if (targetOf(event) === dialog) stay();\n });\n listen(dialog, "cancel", function (event) {\n preventDefault(event);\n stay();\n });\n listen(dialog, "close", function () {\n if (dialogOpenOf && !dialogOpenOf(dialog)) stay();\n });\n listen(dialog, "keydown", function (event) {\n if (showModal || !keyOf) return;\n var key = keyOf(event);\n if (key === "Escape") {\n stay();\n } else if (key === "Tab") {\n preventDefault(event);\n focus(focusedButton === stayButton ? proceedButton : stayButton);\n }\n });\n\n function isNode(value) {\n try {\n nodeTypeOf(value);\n return true;\n } catch (error) {\n return false;\n }\n }\n\n function linkHref(node) {\n if (!isNode(node) || nodeTypeOf(node) !== 1) return null;\n var name = localNameOf(node);\n if (name !== "a" && name !== "area") return null;\n var href = getAttribute(node, "href");\n if (href === null && getAttributeNS) href = getAttributeNS(node, XLINK, "href");\n return href;\n }\n\n function linkInPath(path, bubbles) {\n for (var i = 0; i < path.length; i++) {\n if (linkHref(path[i]) !== null) return path[i];\n if (!bubbles || !isNode(path[i]) || nodeTypeOf(path[i]) === 9) return null;\n }\n return null;\n }\n\n function parentAcross(node) {\n var parent = parentNodeOf(node);\n if (parent || nodeTypeOf(node) !== 11 || !hostOf) return parent;\n try {\n return hostOf(node);\n } catch (error) {\n return null;\n }\n }\n\n function linkAbove(node, bubbles) {\n for (var current = node, steps = 0; current && steps < 1024; current = parentAcross(current), steps++) {\n if (linkHref(current) !== null) return current;\n if (!bubbles) return null;\n }\n return null;\n }\n\n var watchedRoots = new WeakMapC();\n\n function isWatched(node) {\n var root = node;\n for (var parent = parentNodeOf(node); parent; parent = parentNodeOf(parent)) root = parent;\n return weakGet(watchedRoots, root) === true;\n }\n\n function baseTarget(root) {\n var bases = root ? getElementsByTagName(root, "base") : [];\n for (var i = 0; i < bases.length; i++) {\n var target = getAttribute(bases[i], "target");\n if (target !== null) return target;\n }\n return "";\n }\n\n function windowName(target) {\n try {\n return nameOf ? nameOf(target) : null;\n } catch (error) {\n return null;\n }\n }\n\n function hasFrameNamed(parent, name, level) {\n var count;\n try {\n count = lengthOf ? lengthOf(parent) : 0;\n } catch (error) {\n return false;\n }\n for (var i = 0; i < count && i < 64; i++) {\n var child;\n try {\n child = parent[i];\n } catch (error) {\n continue;\n }\n if (!child) continue;\n if (windowName(child) === name) return true;\n if (level < 4 && hasFrameNamed(child, name, level + 1)) return true;\n }\n return false;\n }\n\n function targetGoesTo(target, depth, realm) {\n var name = toLowerCase(target);\n if (name === "" || name === "_self") return depth === 0 ? "tab" : null;\n if (name === "_top") return "tab";\n if (name === "_parent") return depth <= 1 ? "tab" : null;\n if (name === "_blank") return "new";\n if (realm && windowName(realm) === target) return depth === 0 ? "tab" : null;\n if (windowName(win) === target) return "tab";\n return hasFrameNamed(win, target, 0) ? null : "new";\n }\n\n function viewOf(node) {\n var owner = ownerDocumentOf(node);\n return owner ? defaultViewOf(owner) : null;\n }\n\n function linkAttempt(node, depth, script) {\n var href = linkHref(node);\n if (href === null) return null;\n var url = parseWebUrl(href, baseURIOf(node));\n if (url === null || isTrustedHost(url.host)) return null;\n var target = getAttribute(node, "target");\n var goesTo = targetGoesTo(target === null ? baseTarget(ownerDocumentOf(node)) : target, depth, viewOf(node));\n if (goesTo === null) return null;\n return {\n href: url.href,\n host: url.host,\n newTab: goesTo === "new",\n target: "_blank",\n features: "",\n replace: false,\n form: null,\n script: script,\n };\n }\n\n function copyForm(data, source) {\n var entries = [];\n var hasFile = false;\n eachFormEntry(data, function (value, name) {\n entries[entries.length] = [name, value];\n if (typeof value !== "string") hasFile = true;\n });\n var enctype = null;\n if (source && nodeTypeOf(source) === 1) {\n enctype = getAttribute(source, "formenctype");\n var owner = localNameOf(source) === "form" ? source : source.form;\n if (!enctype && owner) enctype = getAttribute(owner, "enctype");\n }\n if (!enctype) enctype = hasFile ? "multipart/form-data" : "application/x-www-form-urlencoded";\n return { entries: entries, enctype: enctype };\n }\n\n function formValue(button, buttonName, form, formName) {\n var value = button ? getAttribute(button, buttonName) : null;\n return value !== null ? value : getAttribute(form, formName);\n }\n\n function readForm(form, button) {\n try {\n return button ? new FormDataC(form, button) : new FormDataC(form);\n } catch (error) {\n try {\n return new FormDataC(form);\n } catch (retryError) {\n return null;\n }\n }\n }\n\n function withQuery(href, entries) {\n if (!ParamsC || !appendParam || !paramsText || !setSearch) return href;\n var params = new ParamsC();\n for (var i = 0; i < entries.length; i++) {\n var value = entries[i][1];\n appendParam(params, entries[i][0], typeof value === "string" ? value : value.name);\n }\n var url = new URLC(href);\n setSearch(url, paramsText(params));\n return hrefOf(url);\n }\n\n function formAttempt(form, submitter, depth, script, copy) {\n if (!isNode(form) || nodeTypeOf(form) !== 1 || localNameOf(form) !== "form") return null;\n var button = submitter && isNode(submitter) && nodeTypeOf(submitter) === 1 ? submitter : null;\n var action = formValue(button, "formaction", form, "action");\n var url = parseWebUrl(action === null ? "" : action, baseURIOf(form));\n if (url === null || isTrustedHost(url.host)) return null;\n var target = formValue(button, "formtarget", form, "target");\n var goesTo = targetGoesTo(target === null ? baseTarget(ownerDocumentOf(form)) : target, depth, viewOf(form));\n if (goesTo === null || (goesTo === "tab" && navigation)) return null;\n var method = formValue(button, "formmethod", form, "method");\n method = method === null ? "get" : toLowerCase(method);\n if (method === "dialog") return null;\n var next = {\n href: url.href,\n host: url.host,\n newTab: goesTo === "new",\n target: goesTo === "new" ? "_blank" : "_self",\n features: "",\n replace: false,\n form: null,\n script: script,\n };\n if (!copy) return next;\n var data = readForm(form, button);\n if (data === null) return null;\n var copied = copyForm(data, button || form);\n if (method === "post") next.form = copied;\n else next.href = withQuery(url.href, copied.entries);\n return next;\n }\n\n function isMouseEvent(event) {\n try {\n buttonOf(event);\n return true;\n } catch (error) {\n return false;\n }\n }\n\n function isShoppersOwnChoice(event) {\n if (!event.isTrusted) return false;\n try {\n return buttonOf(event) !== 0 || ctrlKeyOf(event) || metaKeyOf(event) || shiftKeyOf(event) || altKeyOf(event);\n } catch (error) {\n return true;\n }\n }\n\n var eventStates = new WeakMapC();\n var armedEvents = [];\n\n function stateOf(event) {\n var state = weakGet(eventStates, event);\n if (!state) {\n state = { decided: false, link: null, armed: null };\n weakSet(eventStates, event, state);\n }\n return state;\n }\n\n function disarm(state) {\n var armed = state.armed;\n if (armed === null || armed.done) return;\n armed.done = true;\n for (var i = 0; i < armed.nodes.length; i++) {\n unlisten(armed.nodes[i], armed.type, armed.check, true);\n unlisten(armed.nodes[i], armed.type, armed.check, false);\n }\n }\n\n function sweep() {\n var live = [];\n for (var i = 0; i < armedEvents.length; i++) {\n if (eventPhaseOf(armedEvents[i]) === 0) disarm(stateOf(armedEvents[i]));\n else live[live.length] = armedEvents[i];\n }\n armedEvents = live;\n }\n\n function arm(event, type, decide) {\n var state = stateOf(event);\n if (state.decided || state.armed !== null || !composedPath || !unlisten) return;\n var check = function (current) {\n if (current === event && cancelBubbleOf(current)) decide(current);\n };\n var path = composedPath(event);\n var nodes = [];\n for (var i = 0; i < path.length; i++) {\n if (!isNode(path[i])) continue;\n listen(path[i], type, check, true);\n listen(path[i], type, check, false);\n nodes[nodes.length] = path[i];\n }\n state.armed = { nodes: nodes, type: type, check: check, done: false };\n armedEvents[armedEvents.length] = event;\n }\n\n function hold(event, next) {\n var state = stateOf(event);\n state.decided = true;\n disarm(state);\n preventDefault(event);\n stopImmediatePropagation(event);\n attempt(next);\n }\n\n function onClickCapture(event, depth, active) {\n sweep();\n var state = stateOf(event);\n if (state.decided || !composedPath) return;\n var link = linkInPath(composedPath(event), bubblesOf(event));\n if (link === null) return;\n state.link = link;\n if (!event.isTrusted) {\n var next = isMouseEvent(event) ? linkAttempt(link, depth, true) : null;\n if (next !== null && next.newTab && active()) hold(event, next);\n return;\n }\n if (isShoppersOwnChoice(event)) return;\n var held = linkAttempt(link, depth, false);\n if (held !== null && (held.newTab || !navigation)) {\n arm(event, "click", function (current) {\n decideClick(current, depth, active);\n });\n }\n }\n\n function decideClick(event, depth, active) {\n var state = stateOf(event);\n if (state.decided || defaultPreventedOf(event) || isShoppersOwnChoice(event)) return;\n if (!event.isTrusted && !isMouseEvent(event)) return;\n var link = state.link;\n if (link === null && composedPath) link = linkInPath(composedPath(event), bubblesOf(event));\n if (link === null) return;\n var next = linkAttempt(link, depth, !event.isTrusted);\n if (next === null || (next.script && next.newTab && !active())) return;\n hold(event, next);\n }\n\n function onSubmitCapture(event, depth, active) {\n sweep();\n var state = stateOf(event);\n if (state.decided) return;\n if (formAttempt(targetOf(event), submitterOf ? submitterOf(event) : null, depth, false, false) === null) return;\n arm(event, "submit", function (current) {\n decideSubmit(current, depth, active);\n });\n }\n\n function decideSubmit(event, depth, active) {\n var state = stateOf(event);\n if (state.decided || defaultPreventedOf(event)) return;\n var form = targetOf(event);\n var submitter = submitterOf ? submitterOf(event) : null;\n var found = formAttempt(form, submitter, depth, !event.isTrusted, false);\n if (found === null || (found.newTab && !active())) return;\n var next = formAttempt(form, submitter, depth, !event.isTrusted, true);\n if (next !== null) hold(event, next);\n }\n\n function holdScriptClick(node, bubbles, uncancelable, depth, active) {\n if (!isNode(node) || (!uncancelable && isWatched(node))) return false;\n var link = linkAbove(node, bubbles);\n if (link === null || (!isConnectedOf(link) && localNameOf(link) !== "a") || !viewOf(link)) return false;\n var next = linkAttempt(link, depth, true);\n if (next === null || (next.newTab && !active())) return false;\n attempt(next);\n return true;\n }\n\n function holdFormCall(form, submitter, unseenOnly, depth, active) {\n if (!isNode(form) || !isConnectedOf(form) || (unseenOnly && isWatched(form))) return false;\n var found = formAttempt(form, submitter, depth, true, false);\n if (found === null || (found.newTab && !active())) return false;\n var next = formAttempt(form, submitter, depth, true, true);\n if (next === null) return false;\n attempt(next);\n return true;\n }\n\n function isClick(event) {\n try {\n return typeOf(event) === "click" && isMouseEvent(event);\n } catch (error) {\n return false;\n }\n }\n\n function openAttempt(args, realm, depth) {\n if (args[0] === "") return null;\n var base;\n try {\n base = baseURIOf(realm.document);\n } catch (error) {\n return null;\n }\n var destination = parseWebUrl(args[0], base);\n if (destination === null || isTrustedHost(destination.host)) return null;\n var name = args[1] === "" ? "_blank" : args[1];\n var goesTo = targetGoesTo(name, depth, realm);\n if (goesTo === null) return null;\n return {\n href: destination.href,\n host: destination.host,\n newTab: goesTo === "new",\n target: name,\n features: args[2],\n replace: false,\n form: null,\n script: true,\n };\n }\n\n var ownFunctions = new WeakMapC();\n\n function wrap(target, name, make) {\n var original;\n try {\n original = target ? target[name] : null;\n } catch (error) {\n return;\n }\n if (typeof original !== "function" || weakGet(ownFunctions, original) === true) return;\n var wrapper = make(original);\n weakSet(ownFunctions, wrapper, true);\n try {\n target[name] = wrapper;\n } catch (error) {}\n }\n\n function wrapRealm(realm, depth, hooks) {\n var active = hooks.active;\n wrap(realm, "open", function (original) {\n return function open() {\n for (var i = 0; i < arguments.length; i++) {\n if (typeof arguments[i] === "symbol") return apply(original, realm, arguments);\n }\n var args = [\n arguments.length > 0 && arguments[0] !== undefined ? toText(arguments[0]) : "",\n arguments.length > 1 && arguments[1] !== undefined ? toText(arguments[1]) : "_blank",\n arguments.length > 2 && arguments[2] !== undefined ? toText(arguments[2]) : "",\n ];\n var next = openAttempt(args, realm, depth);\n if (next === null || (next.newTab && !active())) return apply(original, realm, args);\n attempt(next);\n return null;\n };\n });\n wrap(protoIn(realm, "HTMLElement"), "click", function (original) {\n return function click() {\n if (!holdScriptClick(this, true, false, depth, active)) return apply(original, this, arguments);\n };\n });\n wrap(protoIn(realm, "EventTarget"), "dispatchEvent", function (original) {\n return function dispatchEvent(event) {\n if (isClick(event) && holdScriptClick(this, bubblesOf(event), !cancelableOf(event), depth, active)) {\n return false;\n }\n return apply(original, this, arguments);\n };\n });\n var FormP = protoIn(realm, "HTMLFormElement");\n wrap(FormP, "submit", function (original) {\n return function submit() {\n if (!holdFormCall(this, null, false, depth, active)) return apply(original, this, arguments);\n };\n });\n wrap(FormP, "requestSubmit", function (original) {\n return function requestSubmit() {\n var submitter = arguments.length > 0 ? arguments[0] : null;\n if (!holdFormCall(this, submitter, true, depth, active)) return apply(original, this, arguments);\n };\n });\n wrap(protoIn(realm, "Element"), "attachShadow", function (original) {\n return function attachShadow(init) {\n var root = apply(original, this, arguments);\n watchShadow(root, depth, hooks);\n return root;\n };\n });\n }\n\n function watchShadow(root, depth, hooks) {\n try {\n listen(root, "click", hooks.clickCapture, true);\n listen(root, "submit", hooks.submitCapture, true);\n listen(root, "submit", hooks.submit);\n } catch (error) {\n return;\n }\n weakSet(watchedRoots, root, true);\n watchFrames(root, depth + 1);\n }\n\n var realmHooks = new WeakMapC();\n var frameLoadListeners = new WeakMapC();\n\n function hooksFor(realm, depth) {\n var realmActivation = null;\n if (depth > 0) {\n try {\n realmActivation = realm.navigator ? realm.navigator.userActivation : null;\n } catch (error) {}\n }\n var active = function () {\n return isActiveIn(activation) || (depth > 0 && isActiveIn(realmActivation));\n };\n return {\n active: active,\n clickCapture: function (event) {\n onClickCapture(event, depth, active);\n },\n click: function (event) {\n decideClick(event, depth, active);\n },\n submitCapture: function (event) {\n onSubmitCapture(event, depth, active);\n },\n submit: function (event) {\n decideSubmit(event, depth, active);\n },\n };\n }\n\n function armRealm(realm, depth) {\n var realmDocument;\n try {\n realmDocument = realm.document;\n } catch (error) {\n return;\n }\n if (!realmDocument) return;\n var hooks = weakGet(realmHooks, realm);\n if (!hooks) {\n hooks = hooksFor(realm, depth);\n weakSet(realmHooks, realm, hooks);\n }\n try {\n listen(realm, "click", hooks.clickCapture, true);\n listen(realm, "click", hooks.click);\n listen(realm, "submit", hooks.submitCapture, true);\n listen(realm, "submit", hooks.submit);\n } catch (error) {\n return;\n }\n weakSet(watchedRoots, realmDocument, true);\n wrapRealm(realm, depth, hooks);\n watchFrames(realmDocument, depth + 1);\n }\n\n function guardFrame(frame, depth) {\n var frameWin;\n try {\n frameWin = contentWindowOf(frame);\n if (!frameWin || !contentDocumentOf(frame)) return;\n } catch (error) {\n return;\n }\n armRealm(frameWin, depth);\n }\n\n function watchFrames(root, depth) {\n if (!contentWindowOf || !contentDocumentOf) return;\n var onLoad = weakGet(frameLoadListeners, root);\n if (!onLoad) {\n onLoad = function (event) {\n var frame = targetOf(event);\n if (frame && nodeTypeOf(frame) === 1 && localNameOf(frame) === "iframe") guardFrame(frame, depth);\n };\n weakSet(frameLoadListeners, root, onLoad);\n }\n listen(root, "load", onLoad, true);\n if (nodeTypeOf(root) !== 9) return;\n var frames = getElementsByTagName(root, "iframe");\n for (var i = 0; i < frames.length; i++) guardFrame(frames[i], depth);\n }\n\n armRealm(win, 0);\n\n if (navigation && navigationTypeOf && destinationOf && urlOf) {\n listen(navigation, "navigate", function (event) {\n if (!event.isTrusted || !cancelableOf(event)) return;\n var type = navigationTypeOf(event);\n if (type === "traverse" || type === "reload") return;\n var destination = destinationOf(event);\n if (sameDocumentOf && sameDocumentOf(destination)) return;\n if (downloadRequestOf && downloadRequestOf(event) !== null) return;\n var url = parseWebUrl(urlOf(destination));\n if (url === null) return;\n if (bypass !== null && bypass.href === url.href) {\n var approved = now() <= bypass.until;\n bypass = null;\n if (approved) return;\n }\n if (isTrustedHost(url.host)) return;\n preventDefault(event);\n var data = formDataOf ? formDataOf(event) : null;\n attempt({\n href: url.href,\n host: url.host,\n newTab: false,\n target: "_self",\n features: "",\n replace: type === "replace",\n form: data ? copyForm(data, sourceElementOf ? sourceElementOf(event) : null) : null,\n script: !(userInitiatedOf && userInitiatedOf(event)),\n });\n });\n }\n\n listen(win, "pageshow", function (event) {\n if (pending !== null && persistedOf && persistedOf(event)) reset();\n });\n})'])));export{t as REDIRECT_GUARD_RUNTIME};
@@ -0,0 +1,14 @@
1
+ import { HostRules } from "./hosts";
2
+ import { RedirectGuardTexts } from "./texts";
3
+ export declare type RedirectGuardConfig = {
4
+ rules: HostRules;
5
+ texts: RedirectGuardTexts;
6
+ };
7
+ /**
8
+ * JSON for an inline script: pure ASCII, and unable to end the script element or open an HTML
9
+ * comment in it. `<`, `>` and `&` become `\u` escapes like every character outside ASCII (U+2028
10
+ * and U+2029 included), so the script means the same under any charset the page is read with.
11
+ */
12
+ export declare function toInlineScriptJson(value: unknown): string;
13
+ /** The guard as the page's first script: the runtime, called with this store's rules and copy. */
14
+ export declare function buildRedirectGuardScript(config: RedirectGuardConfig): string;
@@ -0,0 +1 @@
1
+ import{NAVIGATION_WARNING_SCRIPT_ATTRIBUTE as t}from"@ikas/storefront-config";import{REDIRECT_GUARD_RUNTIME as r}from"./runtime.js";function n(t){return JSON.stringify(t).replace(/[<>&\u007f-\uffff]/g,(function(t){return"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0")}))}function o(o){return"<script ".concat(t,">").concat(r,"(window,").concat(n(o),");<\/script>")}export{o as buildRedirectGuardScript,n as toInlineScriptJson};
@@ -0,0 +1,16 @@
1
+ /** The backend's limit on the merchant's own list; anything past it is dropped, not inlined. */
2
+ export declare const MAX_ALLOWED_HOSTS = 100;
3
+ export declare type NavigationWarningSettings = {
4
+ /** The hosts the merchant added, normalized. ikas's starter list comes on top of these. */
5
+ allowedHosts: string[];
6
+ };
7
+ /**
8
+ * `storefront.navigationWarningSettings` (FR-1077) — `{ isEnabled: boolean, allowedHosts: string[] }`
9
+ * in the backend model — or null when the warning is off.
10
+ *
11
+ * Read as `unknown` all the same: the warning turns on for `isEnabled === true` and nothing else,
12
+ * so a missing field (every store until its merchant turns the warning on) or a malformed one
13
+ * leaves the page exactly as it renders without the warning. The backend validates the list
14
+ * before it stores it; it is normalized again here because these hosts end up inside a script.
15
+ */
16
+ export declare function parseNavigationWarningSettings(value: unknown): NavigationWarningSettings | null;
@@ -0,0 +1 @@
1
+ import{normalizeHostPattern as r}from"./hosts.js";var t=100;function o(t){if(!t||"object"!=typeof t)return null;var o=t,e=o.isEnabled,l=o.allowedHosts;return!0!==e?null:{allowedHosts:(Array.isArray(l)?l:[]).slice(0,100).map(r).filter((function(r){return!!r}))}}export{t as MAX_ALLOWED_HOSTS,o as parseNavigationWarningSettings};
@@ -0,0 +1,12 @@
1
+ export declare type RedirectGuardTexts = {
2
+ /** The language the copy is in, for the dialog's `lang`. */
3
+ lang: string;
4
+ title: string;
5
+ /** The body around the destination host, which the browser fills in. */
6
+ bodyBefore: string;
7
+ bodyAfter: string;
8
+ stay: string;
9
+ proceed: string;
10
+ };
11
+ /** The copy for a routing locale (`tr`, `de-DE`, `en_US`…), English when there is none for it. */
12
+ export declare function getRedirectGuardTexts(locale: string | null | undefined): RedirectGuardTexts;
@@ -0,0 +1 @@
1
+ var e={tr:{title:"Başka bir siteye gidiyorsunuz",body:"Bu sayfa sizi {host} adresine götürmek istiyor. Kartınızı ya da şifrenizi bu adreste girmeyin.",stay:"Bu sayfada kal",proceed:"Devam et"},en:{title:"You're going to another site",body:"This page wants to take you to {host}. Don't enter your card details or password there.",stay:"Stay on this page",proceed:"Continue"},de:{title:"Sie wechseln zu einer anderen Website",body:"Diese Seite möchte Sie zu {host} weiterleiten. Geben Sie dort keine Kartendaten oder Passwörter ein.",stay:"Auf dieser Seite bleiben",proceed:"Weiter"},fr:{title:"Vous allez vers un autre site",body:"Cette page veut vous rediriger vers {host}. N'y saisissez ni vos données de carte ni votre mot de passe.",stay:"Rester sur cette page",proceed:"Continuer"}};function t(t){var r=(t||"").toLowerCase().split(/[-_]/)[0],i=Object.prototype.hasOwnProperty.call(e,r)?r:"en",o=e[i],s=o.title,a=o.body,n=o.stay,d=o.proceed,y=a.split("{host}"),u=y[0],l=y[1];return{lang:i,title:s,bodyBefore:u,bodyAfter:void 0===l?"":l,stay:n,proceed:d}}export{t as getRedirectGuardTexts};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront-next",
3
- "version": "6.1.0-beta.39",
3
+ "version": "6.1.0-beta.391",
4
4
  "description": "Next.js specific functions for ikas storefront themes.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",
@@ -17,23 +17,23 @@
17
17
  },
18
18
  "peerDependencies": {
19
19
  "next": "12.2.0",
20
- "@ikas/storefront-config": "^6.1.0-beta.39",
21
- "@ikas/storefront-providers": "^6.1.0-beta.39",
22
- "@ikas/storefront-models": "^6.1.0-beta.39",
23
- "@ikas/storefront-api": "^6.1.0-beta.39",
24
- "@ikas/storefront-assets": "^6.1.0-beta.39",
20
+ "@ikas/storefront-config": "^6.1.0-beta.391",
21
+ "@ikas/storefront-providers": "^6.1.0-beta.391",
22
+ "@ikas/storefront-models": "^6.1.0-beta.391",
23
+ "@ikas/storefront-api": "^6.1.0-beta.391",
24
+ "@ikas/storefront-assets": "^6.1.0-beta.391",
25
25
  "axios": "^0.26.0",
26
26
  "lodash": "^4.17.21",
27
27
  "cors": "^2.8.5",
28
28
  "adm-zip": "^0.5.9"
29
29
  },
30
30
  "devDependencies": {
31
- "@ikas/storefront-cmd": "^6.1.0-beta.39",
32
- "@ikas/storefront-config": "^6.1.0-beta.39",
33
- "@ikas/storefront-providers": "^6.1.0-beta.39",
34
- "@ikas/storefront-models": "^6.1.0-beta.39",
35
- "@ikas/storefront-api": "^6.1.0-beta.39",
36
- "@ikas/storefront-assets": "^6.1.0-beta.39",
31
+ "@ikas/storefront-cmd": "^6.1.0-beta.391",
32
+ "@ikas/storefront-config": "^6.1.0-beta.391",
33
+ "@ikas/storefront-providers": "^6.1.0-beta.391",
34
+ "@ikas/storefront-models": "^6.1.0-beta.391",
35
+ "@ikas/storefront-api": "^6.1.0-beta.391",
36
+ "@ikas/storefront-assets": "^6.1.0-beta.391",
37
37
  "@rollup/plugin-node-resolve": "^13.3.0",
38
38
  "@rollup/plugin-commonjs": "^22.0.0",
39
39
  "@rollup/plugin-json": "^4.1.0",