define(['jquery','mage/mage','js-cookie/cookie-wrapper'],function($){'use strict';var CookieHelper=function(){this.defaults={expires:null,path:'/',domain:null,secure:false,lifetime:null,samesite:'lax'};function lifetimeToExpires(options,defaults){var expires,lifetime;lifetime=options.lifetime||defaults.lifetime;if(lifetime&&lifetime>0){expires=options.expires||new Date();return new Date(expires.getTime()+lifetime*1000);} return null;} this.set=function(name,value,options){var expires,path,domain,secure,samesite;options=$.extend({},this.defaults,options||{});expires=lifetimeToExpires(options,this.defaults)||options.expires;path=options.path;domain=options.domain;secure=options.secure;samesite=options.samesite;document.cookie=name+'='+encodeURIComponent(value)+ (expires?'; expires='+expires.toUTCString():'')+ (path?'; path='+path:'')+ (domain?'; domain='+domain:'')+ (secure?'; secure':'')+'; samesite='+(samesite?samesite:'lax');};this.get=function(name){var arg=name+'=',aLength=arg.length,cookie=document.cookie,cLength=cookie.length,i=0,j=0;while(i