@loophq/onstore-sdk
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.LoopOnstore=e():t.LoopOnstore=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=107)}([function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||Function("return this")()}).call(this,n(59))},function(t,e,n){var r=n(0),o=n(38),i=n(5),c=n(39),a=n(42),u=n(72),s=o("wks"),l=r.Symbol,f=u?l:c;t.exports=function(t){return i(s,t)||(a&&i(l,t)?s[t]=l[t]:s[t]=f("Symbol."+t)),s[t]}},function(t,e,n){var r=n(8);t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(9),o=n(12),i=n(22);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(3);t.exports=!r((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(0),o=n(18).f,i=n(6),c=n(13),a=n(24),u=n(63),s=n(41);t.exports=function(t,e){var n,l,f,p,d,v=t.target,h=t.global,y=t.stat;if(n=h?r:y?r[v]||a(v,{}):(r[v]||{}).prototype)for(l in e){if(p=e[l],f=t.noTargetGet?(d=o(n,l))&&d.value:n[l],!s(h?l:v+(y?".":"#")+l,t.forced)&&void 0!==f){if(typeof p==typeof f)continue;u(p,f)}(t.sham||f&&f.sham)&&i(p,"sham",!0),c(n,l,p,t)}}},function(t,e,n){var r=n(9),o=n(36),i=n(2),c=n(35),a=Object.defineProperty;e.f=r?a:function(t,e,n){if(i(t),e=c(e,!0),i(n),o)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(0),o=n(6),i=n(5),c=n(24),a=n(25),u=n(26),s=u.get,l=u.enforce,f=String(String).split("String");(t.exports=function(t,e,n,a){var u=!!a&&!!a.unsafe,s=!!a&&!!a.enumerable,p=!!a&&!!a.noTargetGet;"function"==typeof n&&("string"!=typeof e||i(n,"name")||o(n,"name",e),l(n).source=f.join("string"==typeof e?e:"")),t!==r?(u?!p&&t[e]&&(s=!0):delete t[e],s?t[e]=n:o(t,e,n)):s?t[e]=n:c(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&s(this).source||a(this)}))},function(t,e){t.exports=!1},function(t,e,n){var r=n(65),o=n(0),i=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t])||i(o[t]):r[t]&&r[t][e]||o[t]&&o[t][e]}},function(t,e,n){var r=n(10),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e){t.exports={}},function(t,e,n){var r=n(9),o=n(60),i=n(22),c=n(19),a=n(35),u=n(5),s=n(36),l=Object.getOwnPropertyDescriptor;e.f=r?l:function(t,e){if(t=c(t),e=a(e,!0),s)try{return l(t,e)}catch(t){}if(u(t,e))return i(!o.f.call(t,e),t[e])}},function(t,e,n){var r=n(61),o=n(4);t.exports=function(t){return r(o(t))}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,e,n){var r=n(0),o=n(87),i=n(88),c=n(6),a=n(1),u=a("iterator"),s=a("toStringTag"),l=i.values;for(var f in o){var p=r[f],d=p&&p.prototype;if(d){if(d[u]!==l)try{c(d,u,l)}catch(t){d[u]=l}if(d[s]||c(d,s,f),o[f])for(var v in i)if(d[v]!==i[v])try{c(d,v,i[v])}catch(t){d[v]=i[v]}}}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(0),o=n(8),i=r.document,c=o(i)&&o(i.createElement);t.exports=function(t){return c?i.createElement(t):{}}},function(t,e,n){var r=n(0),o=n(6);t.exports=function(t,e){try{o(r,t,e)}catch(n){r[t]=e}return e}},function(t,e,n){var r=n(37),o=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(t){return o.call(t)}),t.exports=r.inspectSource},function(t,e,n){var r,o,i,c=n(62),a=n(0),u=n(8),s=n(6),l=n(5),f=n(27),p=n(28),d=a.WeakMap;if(c){var v=new d,h=v.get,y=v.has,g=v.set;r=function(t,e){return g.call(v,t,e),e},o=function(t){return h.call(v,t)||{}},i=function(t){return y.call(v,t)}}else{var m=f("state");p[m]=!0,r=function(t,e){return s(t,m,e),e},o=function(t){return l(t,m)?t[m]:{}},i=function(t){return l(t,m)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=o(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}}},function(t,e,n){var r=n(38),o=n(39),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},function(t,e){t.exports={}},function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,e,n){var r=n(12).f,o=n(5),i=n(1)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){"use strict";var r=n(6),o=n(13),i=n(3),c=n(1),a=n(32),u=c("species"),s=!i((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),l=!i((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));t.exports=function(t,e,n,f){var p=c(t),d=!i((function(){var e={};return e[p]=function(){return 7},7!=""[t](e)})),v=d&&!i((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[u]=function(){return n},n.flags="",n[p]=/./[p]),n.exec=function(){return e=!0,null},n[p](""),!e}));if(!d||!v||"replace"===t&&!s||"split"===t&&!l){var h=/./[p],y=n(p,""[t],(function(t,e,n,r,o){return e.exec===a?d&&!o?{done:!0,value:h.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}})),g=y[0],m=y[1];o(String.prototype,t,g),o(RegExp.prototype,p,2==e?function(t,e){return m.call(t,this,e)}:function(t){return m.call(t,this)}),f&&r(RegExp.prototype[p],"sham",!0)}}},function(t,e,n){"use strict";var r,o,i=n(101),c=RegExp.prototype.exec,a=String.prototype.replace,u=c,s=(r=/a/,o=/b*/g,c.call(r,"a"),c.call(o,"a"),0!==r.lastIndex||0!==o.lastIndex),l=void 0!==/()??/.exec("")[1];(s||l)&&(u=function(t){var e,n,r,o,u=this;return l&&(n=new RegExp("^"+u.source+"$(?!\\s)",i.call(u))),s&&(e=u.lastIndex),r=c.call(u,t),s&&r&&(u.lastIndex=u.global?r.index+r[0].length:e),l&&r&&r.length>1&&a.call(r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r}),t.exports=u},function(t,e,n){var r=n(7),o=n(32);t.exports=function(t,e){var n=t.exec;if("function"==typeof n){var i=n.call(t,e);if("object"!=typeof i)throw TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==r(t))throw TypeError("RegExp#exec called on incompatible receiver");return o.call(t,e)}},function(t,e,n){"use strict";var r,o,i,c,a=n(11),u=n(14),s=n(0),l=n(15),f=n(70),p=n(13),d=n(71),v=n(30),h=n(73),y=n(8),g=n(20),m=n(74),b=n(7),x=n(25),O=n(75),w=n(81),S=n(44),j=n(45).set,_=n(82),P=n(83),E=n(84),k=n(49),T=n(85),L=n(26),I=n(41),A=n(1),M=n(86),R=A("species"),D="Promise",C=L.get,N=L.set,F=L.getterFor(D),U=f,q=s.TypeError,G=s.document,z=s.process,$=l("fetch"),H=k.f,W=H,V="process"==b(z),B=!!(G&&G.createEvent&&s.dispatchEvent),J=I(D,(function(){if(!(x(U)!==String(U))){if(66===M)return!0;if(!V&&"function"!=typeof PromiseRejectionEvent)return!0}if(u&&!U.prototype.finally)return!0;if(M>=51&&/native code/.test(U))return!1;var t=U.resolve(1),e=function(t){t((function(){}),(function(){}))};return(t.constructor={})[R]=e,!(t.then((function(){}))instanceof e)})),Y=J||!w((function(t){U.all(t).catch((function(){}))})),K=function(t){var e;return!(!y(t)||"function"!=typeof(e=t.then))&&e},X=function(t,e,n){if(!e.notified){e.notified=!0;var r=e.reactions;_((function(){for(var o=e.value,i=1==e.state,c=0;r.length>c;){var a,u,s,l=r[c++],f=i?l.ok:l.fail,p=l.resolve,d=l.reject,v=l.domain;try{f?(i||(2===e.rejection&&et(t,e),e.rejection=1),!0===f?a=o:(v&&v.enter(),a=f(o),v&&(v.exit(),s=!0)),a===l.promise?d(q("Promise-chain cycle")):(u=K(a))?u.call(a,p,d):p(a)):d(o)}catch(t){v&&!s&&v.exit(),d(t)}}e.reactions=[],e.notified=!1,n&&!e.rejection&&Q(t,e)}))}},Z=function(t,e,n){var r,o;B?((r=G.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),s.dispatchEvent(r)):r={promise:e,reason:n},(o=s["on"+t])?o(r):"unhandledrejection"===t&&E("Unhandled promise rejection",n)},Q=function(t,e){j.call(s,(function(){var n,r=e.value;if(tt(e)&&(n=T((function(){V?z.emit("unhandledRejection",r,t):Z("unhandledrejection",t,r)})),e.rejection=V||tt(e)?2:1,n.error))throw n.value}))},tt=function(t){return 1!==t.rejection&&!t.parent},et=function(t,e){j.call(s,(function(){V?z.emit("rejectionHandled",t):Z("rejectionhandled",t,e.value)}))},nt=function(t,e,n,r){return function(o){t(e,n,o,r)}},rt=function(t,e,n,r){e.done||(e.done=!0,r&&(e=r),e.value=n,e.state=2,X(t,e,!0))},ot=function(t,e,n,r){if(!e.done){e.done=!0,r&&(e=r);try{if(t===n)throw q("Promise can't be resolved itself");var o=K(n);o?_((function(){var r={done:!1};try{o.call(n,nt(ot,t,r,e),nt(rt,t,r,e))}catch(n){rt(t,r,n,e)}})):(e.value=n,e.state=1,X(t,e,!1))}catch(n){rt(t,{done:!1},n,e)}}};J&&(U=function(t){m(this,U,D),g(t),r.call(this);var e=C(this);try{t(nt(ot,this,e),nt(rt,this,e))}catch(t){rt(this,e,t)}},(r=function(t){N(this,{type:D,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=d(U.prototype,{then:function(t,e){var n=F(this),r=H(S(this,U));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=V?z.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&X(this,n,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r,e=C(t);this.promise=t,this.resolve=nt(ot,t,e),this.reject=nt(rt,t,e)},k.f=H=function(t){return t===U||t===i?new o(t):W(t)},u||"function"!=typeof f||(c=f.prototype.then,p(f.prototype,"then",(function(t,e){var n=this;return new U((function(t,e){c.call(n,t,e)})).then(t,e)}),{unsafe:!0}),"function"==typeof $&&a({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return P(U,$.apply(s,arguments))}}))),a({global:!0,wrap:!0,forced:J},{Promise:U}),v(U,D,!1,!0),h(D),i=l(D),a({target:D,stat:!0,forced:J},{reject:function(t){var e=H(this);return e.reject.call(void 0,t),e.promise}}),a({target:D,stat:!0,forced:u||J},{resolve:function(t){return P(u&&this===i?U:this,t)}}),a({target:D,stat:!0,forced:Y},{all:function(t){var e=this,n=H(e),r=n.resolve,o=n.reject,i=T((function(){var n=g(e.resolve),i=[],c=0,a=1;O(t,(function(t){var u=c++,s=!1;i.push(void 0),a++,n.call(e,t).then((function(t){s||(s=!0,i[u]=t,--a||r(i))}),o)})),--a||r(i)}));return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=H(e),r=n.reject,o=T((function(){var o=g(e.resolve);O(t,(function(t){o.call(e,t).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}})},function(t,e,n){var r=n(8);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(9),o=n(3),i=n(23);t.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(t,e,n){var r=n(0),o=n(24),i=r["__core-js_shared__"]||o("__core-js_shared__",{});t.exports=i},function(t,e,n){var r=n(14),o=n(37);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.5.0",mode:r?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++n+r).toString(36)}},function(t,e,n){var r=n(5),o=n(19),i=n(67).indexOf,c=n(28);t.exports=function(t,e){var n,a=o(t),u=0,s=[];for(n in a)!r(c,n)&&r(a,n)&&s.push(n);for(;e.length>u;)r(a,n=e[u++])&&(~i(s,n)||s.push(n));return s}},function(t,e,n){var r=n(3),o=/#|\.prototype\./,i=function(t,e){var n=a[c(t)];return n==s||n!=u&&("function"==typeof e?r(e):!!e)},c=i.normalize=function(t){return String(t).replace(o,".").toLowerCase()},a=i.data={},u=i.NATIVE="N",s=i.POLYFILL="P";t.exports=i},function(t,e,n){var r=n(3);t.exports=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())}))},function(t,e,n){var r=n(20);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){var r=n(2),o=n(20),i=n(1)("species");t.exports=function(t,e){var n,c=r(t).constructor;return void 0===c||null==(n=r(c)[i])?e:o(n)}},function(t,e,n){var r,o,i,c=n(0),a=n(3),u=n(7),s=n(43),l=n(46),f=n(23),p=n(47),d=c.location,v=c.setImmediate,h=c.clearImmediate,y=c.process,g=c.MessageChannel,m=c.Dispatch,b=0,x={},O=function(t){if(x.hasOwnProperty(t)){var e=x[t];delete x[t],e()}},w=function(t){return function(){O(t)}},S=function(t){O(t.data)},j=function(t){c.postMessage(t+"",d.protocol+"//"+d.host)};v&&h||(v=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return x[++b]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},r(b),b},h=function(t){delete x[t]},"process"==u(y)?r=function(t){y.nextTick(w(t))}:m&&m.now?r=function(t){m.now(w(t))}:g&&!p?(i=(o=new g).port2,o.port1.onmessage=S,r=s(i.postMessage,i,1)):!c.addEventListener||"function"!=typeof postMessage||c.importScripts||a(j)?r="onreadystatechange"in f("script")?function(t){l.appendChild(f("script")).onreadystatechange=function(){l.removeChild(this),O(t)}}:function(t){setTimeout(w(t),0)}:(r=j,c.addEventListener("message",S,!1))),t.exports={set:v,clear:h}},function(t,e,n){var r=n(15);t.exports=r("document","documentElement")},function(t,e,n){var r=n(48);t.exports=/(iphone|ipod|ipad).*applewebkit/i.test(r)},function(t,e,n){var r=n(15);t.exports=r("navigator","userAgent")||""},function(t,e,n){"use strict";var r=n(20),o=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)};t.exports.f=function(t){return new o(t)}},function(t,e,n){var r=n(2),o=n(90),i=n(29),c=n(28),a=n(46),u=n(23),s=n(27)("IE_PROTO"),l=function(){},f=function(){var t,e=u("iframe"),n=i.length;for(e.style.display="none",a.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),f=t.F;n--;)delete f.prototype[i[n]];return f()};t.exports=Object.create||function(t,e){var n;return null!==t?(l.prototype=r(t),n=new l,l.prototype=null,n[s]=t):n=f(),void 0===e?n:o(n,e)},c[s]=!0},function(t,e,n){"use strict";var r,o,i,c=n(52),a=n(6),u=n(5),s=n(1),l=n(14),f=s("iterator"),p=!1;[].keys&&("next"in(i=[].keys())?(o=c(c(i)))!==Object.prototype&&(r=o):p=!0),null==r&&(r={}),l||u(r,f)||a(r,f,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:p}},function(t,e,n){var r=n(5),o=n(53),i=n(27),c=n(94),a=i("IE_PROTO"),u=Object.prototype;t.exports=c?Object.getPrototypeOf:function(t){return t=o(t),r(t,a)?t[a]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,e,n){var r=n(4);t.exports=function(t){return Object(r(t))}},function(t,e,n){"use strict";var r=n(102).charAt;t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},function(t,e,n){"use strict";var r=n(31),o=n(56),i=n(2),c=n(4),a=n(44),u=n(54),s=n(16),l=n(33),f=n(32),p=n(3),d=[].push,v=Math.min,h=!p((function(){return!RegExp(4294967295,"y")}));r("split",2,(function(t,e,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var r=String(c(this)),i=void 0===n?4294967295:n>>>0;if(0===i)return[];if(void 0===t)return[r];if(!o(t))return e.call(r,t,i);for(var a,u,s,l=[],p=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),v=0,h=new RegExp(t.source,p+"g");(a=f.call(h,r))&&!((u=h.lastIndex)>v&&(l.push(r.slice(v,a.index)),a.length>1&&a.index<r.length&&d.apply(l,a.slice(1)),s=a[0].length,v=u,l.length>=i));)h.lastIndex===a.index&&h.lastIndex++;return v===r.length?!s&&h.test("")||l.push(""):l.push(r.slice(v)),l.length>i?l.slice(0,i):l}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:e.call(this,t,n)}:e,[function(e,n){var o=c(this),i=null==e?void 0:e[t];return void 0!==i?i.call(e,o,n):r.call(String(o),e,n)},function(t,o){var c=n(r,t,this,o,r!==e);if(c.done)return c.value;var f=i(t),p=String(this),d=a(f,RegExp),y=f.unicode,g=(f.ignoreCase?"i":"")+(f.multiline?"m":"")+(f.unicode?"u":"")+(h?"y":"g"),m=new d(h?f:"^(?:"+f.source+")",g),b=void 0===o?4294967295:o>>>0;if(0===b)return[];if(0===p.length)return null===l(m,p)?[p]:[];for(var x=0,O=0,w=[];O<p.length;){m.lastIndex=h?O:0;var S,j=l(m,h?p:p.slice(O));if(null===j||(S=v(s(m.lastIndex+(h?0:O)),p.length))===x)O=u(p,O,y);else{if(w.push(p.slice(x,O)),w.length===b)return w;for(var _=1;_<=j.length-1;_++)if(w.push(j[_]),w.length===b)return w;O=x=S}}return w.push(p.slice(x)),w}]}),!h)},function(t,e,n){var r=n(8),o=n(7),i=n(1)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[i])?!!e:"RegExp"==o(t))}},function(t,e,n){var r=n(56);t.exports=function(t){if(r(t))throw TypeError("The method doesn't accept regular expressions");return t}},function(t,e,n){var r=n(1)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,"/./"[t](e)}catch(t){}}return!1}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!r.call({1:2},1);e.f=i?function(t){var e=o(this,t);return!!e&&e.enumerable}:r},function(t,e,n){var r=n(3),o=n(7),i="".split;t.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?i.call(t,""):Object(t)}:Object},function(t,e,n){var r=n(0),o=n(25),i=r.WeakMap;t.exports="function"==typeof i&&/native code/.test(o(i))},function(t,e,n){var r=n(5),o=n(64),i=n(18),c=n(12);t.exports=function(t,e){for(var n=o(e),a=c.f,u=i.f,s=0;s<n.length;s++){var l=n[s];r(t,l)||a(t,l,u(e,l))}}},function(t,e,n){var r=n(15),o=n(66),i=n(69),c=n(2);t.exports=r("Reflect","ownKeys")||function(t){var e=o.f(c(t)),n=i.f;return n?e.concat(n(t)):e}},function(t,e,n){var r=n(0);t.exports=r},function(t,e,n){var r=n(40),o=n(29).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},function(t,e,n){var r=n(19),o=n(16),i=n(68),c=function(t){return function(e,n,c){var a,u=r(e),s=o(u.length),l=i(c,s);if(t&&n!=n){for(;s>l;)if((a=u[l++])!=a)return!0}else for(;s>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:c(!0),indexOf:c(!1)}},function(t,e,n){var r=n(10),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(0);t.exports=r.Promise},function(t,e,n){var r=n(13);t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},function(t,e,n){var r=n(42);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol()},function(t,e,n){"use strict";var r=n(15),o=n(12),i=n(1),c=n(9),a=i("species");t.exports=function(t){var e=r(t),n=o.f;c&&e&&!e[a]&&n(e,a,{configurable:!0,get:function(){return this}})}},function(t,e){t.exports=function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return t}},function(t,e,n){var r=n(2),o=n(76),i=n(16),c=n(43),a=n(77),u=n(80),s=function(t,e){this.stopped=t,this.result=e};(t.exports=function(t,e,n,l,f){var p,d,v,h,y,g,m,b=c(e,n,l?2:1);if(f)p=t;else{if("function"!=typeof(d=a(t)))throw TypeError("Target is not iterable");if(o(d)){for(v=0,h=i(t.length);h>v;v++)if((y=l?b(r(m=t[v])[0],m[1]):b(t[v]))&&y instanceof s)return y;return new s(!1)}p=d.call(t)}for(g=p.next;!(m=g.call(p)).done;)if("object"==typeof(y=u(p,b,m.value,l))&&y&&y instanceof s)return y;return new s(!1)}).stop=function(t){return new s(!0,t)}},function(t,e,n){var r=n(1),o=n(17),i=r("iterator"),c=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||c[i]===t)}},function(t,e,n){var r=n(78),o=n(17),i=n(1)("iterator");t.exports=function(t){if(null!=t)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,e,n){var r=n(79),o=n(7),i=n(1)("toStringTag"),c="Arguments"==o(function(){return arguments}());t.exports=r?o:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?n:c?o(e):"Object"==(r=o(e))&&"function"==typeof e.callee?"Arguments":r}},function(t,e,n){var r={};r[n(1)("toStringTag")]="z",t.exports="[object z]"===String(r)},function(t,e,n){var r=n(2);t.exports=function(t,e,n,o){try{return o?e(r(n)[0],n[1]):e(n)}catch(e){var i=t.return;throw void 0!==i&&r(i.call(t)),e}}},function(t,e,n){var r=n(1)("iterator"),o=!1;try{var i=0,c={next:function(){return{done:!!i++}},return:function(){o=!0}};c[r]=function(){return this},Array.from(c,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var i={};i[r]=function(){return{next:function(){return{done:n=!0}}}},t(i)}catch(t){}return n}},function(t,e,n){var r,o,i,c,a,u,s,l,f=n(0),p=n(18).f,d=n(7),v=n(45).set,h=n(47),y=f.MutationObserver||f.WebKitMutationObserver,g=f.process,m=f.Promise,b="process"==d(g),x=p(f,"queueMicrotask"),O=x&&x.value;O||(r=function(){var t,e;for(b&&(t=g.domain)&&t.exit();o;){e=o.fn,o=o.next;try{e()}catch(t){throw o?c():i=void 0,t}}i=void 0,t&&t.enter()},b?c=function(){g.nextTick(r)}:y&&!h?(a=!0,u=document.createTextNode(""),new y(r).observe(u,{characterData:!0}),c=function(){u.data=a=!a}):m&&m.resolve?(s=m.resolve(void 0),l=s.then,c=function(){l.call(s,r)}):c=function(){v.call(f,r)}),t.exports=O||function(t){var e={fn:t,next:void 0};i&&(i.next=e),o||(o=e,c()),i=e}},function(t,e,n){var r=n(2),o=n(8),i=n(49);t.exports=function(t,e){if(r(t),o(e)&&e.constructor===t)return e;var n=i.f(t);return(0,n.resolve)(e),n.promise}},function(t,e,n){var r=n(0);t.exports=function(t,e){var n=r.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))}},function(t,e){t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},function(t,e,n){var r,o,i=n(0),c=n(48),a=i.process,u=a&&a.versions,s=u&&u.v8;s?o=(r=s.split("."))[0]+r[1]:c&&(!(r=c.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=c.match(/Chrome\/(\d+)/))&&(o=r[1]),t.exports=o&&+o},function(t,e){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(t,e,n){"use strict";var r=n(19),o=n(89),i=n(17),c=n(26),a=n(92),u=c.set,s=c.getterFor("Array Iterator");t.exports=a(Array,"Array",(function(t,e){u(this,{type:"Array Iterator",target:r(t),index:0,kind:e})}),(function(){var t=s(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},function(t,e,n){var r=n(1),o=n(50),i=n(6),c=r("unscopables"),a=Array.prototype;null==a[c]&&i(a,c,o(null)),t.exports=function(t){a[c][t]=!0}},function(t,e,n){var r=n(9),o=n(12),i=n(2),c=n(91);t.exports=r?Object.defineProperties:function(t,e){i(t);for(var n,r=c(e),a=r.length,u=0;a>u;)o.f(t,n=r[u++],e[n]);return t}},function(t,e,n){var r=n(40),o=n(29);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e,n){"use strict";var r=n(11),o=n(93),i=n(52),c=n(95),a=n(30),u=n(6),s=n(13),l=n(1),f=n(14),p=n(17),d=n(51),v=d.IteratorPrototype,h=d.BUGGY_SAFARI_ITERATORS,y=l("iterator"),g=function(){return this};t.exports=function(t,e,n,l,d,m,b){o(n,e,l);var x,O,w,S=function(t){if(t===d&&k)return k;if(!h&&t in P)return P[t];switch(t){case"keys":case"values":case"entries":return function(){return new n(this,t)}}return function(){return new n(this)}},j=e+" Iterator",_=!1,P=t.prototype,E=P[y]||P["@@iterator"]||d&&P[d],k=!h&&E||S(d),T="Array"==e&&P.entries||E;if(T&&(x=i(T.call(new t)),v!==Object.prototype&&x.next&&(f||i(x)===v||(c?c(x,v):"function"!=typeof x[y]&&u(x,y,g)),a(x,j,!0,!0),f&&(p[j]=g))),"values"==d&&E&&"values"!==E.name&&(_=!0,k=function(){return E.call(this)}),f&&!b||P[y]===k||u(P,y,k),p[e]=k,d)if(O={values:S("values"),keys:m?k:S("keys"),entries:S("entries")},b)for(w in O)!h&&!_&&w in P||s(P,w,O[w]);else r({target:e,proto:!0,forced:h||_},O);return O}},function(t,e,n){"use strict";var r=n(51).IteratorPrototype,o=n(50),i=n(22),c=n(30),a=n(17),u=function(){return this};t.exports=function(t,e,n){var s=e+" Iterator";return t.prototype=o(r,{next:i(1,n)}),c(t,s,!1,!0),a[s]=u,t}},function(t,e,n){var r=n(3);t.exports=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},function(t,e,n){var r=n(2),o=n(96);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),e=n instanceof Array}catch(t){}return function(n,i){return r(n),o(i),e?t.call(n,i):n.__proto__=i,n}}():void 0)},function(t,e,n){var r=n(8);t.exports=function(t){if(!r(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},function(t,e,n){"use strict";var r=n(11),o=n(10),i=n(98),c=n(99),a=n(3),u=1..toFixed,s=Math.floor,l=function(t,e,n){return 0===e?n:e%2==1?l(t,e-1,n*t):l(t*t,e/2,n)};r({target:"Number",proto:!0,forced:u&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!a((function(){u.call({})}))},{toFixed:function(t){var e,n,r,a,u=i(this),f=o(t),p=[0,0,0,0,0,0],d="",v="0",h=function(t,e){for(var n=-1,r=e;++n<6;)r+=t*p[n],p[n]=r%1e7,r=s(r/1e7)},y=function(t){for(var e=6,n=0;--e>=0;)n+=p[e],p[e]=s(n/t),n=n%t*1e7},g=function(){for(var t=6,e="";--t>=0;)if(""!==e||0===t||0!==p[t]){var n=String(p[t]);e=""===e?n:e+c.call("0",7-n.length)+n}return e};if(f<0||f>20)throw RangeError("Incorrect fraction digits");if(u!=u)return"NaN";if(u<=-1e21||u>=1e21)return String(u);if(u<0&&(d="-",u=-u),u>1e-21)if(n=(e=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}(u*l(2,69,1))-69)<0?u*l(2,-e,1):u/l(2,e,1),n*=4503599627370496,(e=52-e)>0){for(h(0,n),r=f;r>=7;)h(1e7,0),r-=7;for(h(l(10,r,1),0),r=e-1;r>=23;)y(1<<23),r-=23;y(1<<r),h(1,1),y(2),v=g()}else h(0,n),h(1<<-e,0),v=g()+c.call("0",f);return v=f>0?d+((a=v.length)<=f?"0."+c.call("0",f-a)+v:v.slice(0,a-f)+"."+v.slice(a-f)):d+v}})},function(t,e,n){var r=n(7);t.exports=function(t){if("number"!=typeof t&&"Number"!=r(t))throw TypeError("Incorrect invocation");return+t}},function(t,e,n){"use strict";var r=n(10),o=n(4);t.exports="".repeat||function(t){var e=String(o(this)),n="",i=r(t);if(i<0||i==1/0)throw RangeError("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(e+=e))1&i&&(n+=e);return n}},function(t,e,n){"use strict";var r=n(31),o=n(2),i=n(53),c=n(16),a=n(10),u=n(4),s=n(54),l=n(33),f=Math.max,p=Math.min,d=Math.floor,v=/\$([$&'`]|\d\d?|<[^>]*>)/g,h=/\$([$&'`]|\d\d?)/g;r("replace",2,(function(t,e,n){return[function(n,r){var o=u(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,o,r):e.call(String(o),n,r)},function(t,i){var u=n(e,t,this,i);if(u.done)return u.value;var d=o(t),v=String(this),h="function"==typeof i;h||(i=String(i));var y=d.global;if(y){var g=d.unicode;d.lastIndex=0}for(var m=[];;){var b=l(d,v);if(null===b)break;if(m.push(b),!y)break;""===String(b[0])&&(d.lastIndex=s(v,c(d.lastIndex),g))}for(var x,O="",w=0,S=0;S<m.length;S++){b=m[S];for(var j=String(b[0]),_=f(p(a(b.index),v.length),0),P=[],E=1;E<b.length;E++)P.push(void 0===(x=b[E])?x:String(x));var k=b.groups;if(h){var T=[j].concat(P,_,v);void 0!==k&&T.push(k);var L=String(i.apply(void 0,T))}else L=r(j,v,_,P,k,i);_>=w&&(O+=v.slice(w,_)+L,w=_+j.length)}return O+v.slice(w)}];function r(t,n,r,o,c,a){var u=r+t.length,s=o.length,l=h;return void 0!==c&&(c=i(c),l=v),e.call(a,l,(function(e,i){var a;switch(i.charAt(0)){case"$":return"$";case"&":return t;case"`":return n.slice(0,r);case"'":return n.slice(u);case"<":a=c[i.slice(1,-1)];break;default:var l=+i;if(0===l)return e;if(l>s){var f=d(l/10);return 0===f?e:f<=s?void 0===o[f-1]?i.charAt(1):o[f-1]+i.charAt(1):e}a=o[l-1]}return void 0===a?"":a}))}}))},function(t,e,n){"use strict";var r=n(2);t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},function(t,e,n){var r=n(10),o=n(4),i=function(t){return function(e,n){var i,c,a=String(o(e)),u=r(n),s=a.length;return u<0||u>=s?t?"":void 0:(i=a.charCodeAt(u))<55296||i>56319||u+1===s||(c=a.charCodeAt(u+1))<56320||c>57343?t?a.charAt(u):i:t?a.slice(u,u+2):c-56320+(i-55296<<10)+65536}};t.exports={codeAt:i(!1),charAt:i(!0)}},function(t,e,n){"use strict";var r=n(11),o=n(57),i=n(4);r({target:"String",proto:!0,forced:!n(58)("includes")},{includes:function(t){return!!~String(i(this)).indexOf(o(t),arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";var r=n(31),o=n(2),i=n(4),c=n(105),a=n(33);r("search",1,(function(t,e,n){return[function(e){var n=i(this),r=null==e?void 0:e[t];return void 0!==r?r.call(e,n):new RegExp(e)[t](String(n))},function(t){var r=n(e,t,this);if(r.done)return r.value;var i=o(t),u=String(this),s=i.lastIndex;c(s,0)||(i.lastIndex=0);var l=a(i,u);return c(i.lastIndex,s)||(i.lastIndex=s),null===l?-1:l.index}]}))},function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},function(t,e,n){"use strict";var r,o=n(11),i=n(18).f,c=n(16),a=n(57),u=n(4),s=n(58),l=n(14),f="".startsWith,p=Math.min,d=s("startsWith");o({target:"String",proto:!0,forced:!!(l||d||(r=i(String.prototype,"startsWith"),!r||r.writable))&&!d},{startsWith:function(t){var e=String(u(this));a(t);var n=c(p(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return f?f.call(e,r,n):e.slice(n,n+r.length)===r}})},function(t,e,n){"use strict";n.r(e);n(34),n(21);var r={get:(t="loop-onstore-data")=>JSON.parse(localStorage.getItem(t)||null),set(t,e="loop-onstore-data"){localStorage.setItem(e,JSON.stringify(t))},remove(t="loop-onstore-data"){localStorage.removeItem(t)}};function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}let c={debug:!1,redirect:!0,active:!1,params:null,key:null,api:null,token:null,id:null,fullPayload:!1};const a=t=>t?c[t]:c,u=(t,e)=>{c[t]=e,r.set(c)},s=()=>{const t=r.get();t&&(c=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach((function(e){i(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},c,{},t))};var l=new Proxy({},{get:(t,e)=>!t[e]&&a("debug")?t=>"string"==typeof t?console[e]("%c".concat(t),"color: #3256E6"):console[e](t):t[e]||function(){}});const f=(t,e)=>{const n=[...document.querySelectorAll(t)];return n.length>1&&l.warn("Attaching Loop.submit() to more than one element. Make sure you're using the right selector!"),n.forEach(t=>{t.addEventListener("click",e)}),n};n(97),n(100),n(55);const p={JPY:{constant:1,decimals:0,decimalSymbol:"",thousandSymbol:",",symbol:"¥"},GBP:{constant:100,decimals:2,decimalSymbol:".",thousandSymbol:",",symbol:"£"},EUR:{constant:100,decimals:2,decimalSymbol:",",thousandSymbol:".",symbol:"€"},USD:{constant:100,decimals:2,decimalSymbol:".",thousandSymbol:",",symbol:"$"},CAD:{constant:100,decimals:2,decimalSymbol:".",thousandSymbol:",",symbol:"$"},AUD:{constant:100,decimals:2,decimalSymbol:".",thousandSymbol:",",symbol:"$"},HKD:{constant:100,decimals:2,decimalSymbol:".",thousandSymbol:",",symbol:"$"},NZD:{constant:100,decimals:2,decimalSymbol:".",thousandSymbol:",",symbol:"$"},SGD:{constant:100,decimals:2,decimalSymbol:".",thousandSymbol:",",symbol:"$"}},d=(t,e="USD")=>{if(!t)return"";const n=p[e];if(n){const{dollars:e,cents:r}=((t,e)=>{const[n,r]=Number.parseFloat(t/e.constant).toFixed(e.decimals).split(".");return{dollars:n?n.replace(/\B(?=(\d{3})+(?!\d))/g,e.thousandSymbol):"0",cents:r||""}})(t,n);return"".concat(n.symbol).concat(e).concat(n.decimalSymbol).concat(r)}return new Intl.NumberFormat("en-US",{style:"currency",currency:e}).format(t/n.constant)};function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?v(Object(n),!0).forEach((function(e){y(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function y(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const g=()=>{var t;return null!==(t=a("api"))&&void 0!==t?t:"https://api.loopreturns.com/api/v1/"},m=t=>{const{token:e,total_discount:n,original_total_price:r,total_price:o,items:i,currency:c,items_subtotal_price:a,cart_level_discount_applications:u}=t;return(t=>{const e="object"==typeof t&&null!==t?JSON.stringify(t):String(t);return window.btoa(unescape(encodeURIComponent(e)))})({token:e,total_discount:n,original_total_price:r,total_price:o,items:i.map(t=>{const{id:e,quantity:n,variant_id:r,price:o,original_price:i,discounted_price:c,original_line_price:a,line_price:u,total_discount:s,final_price:l,final_line_price:f,taxable:p,product_id:d}=t;return{id:e,quantity:n,variant_id:r,price:o,original_price:i,discounted_price:c,original_line_price:a,line_price:u,total_discount:s,final_price:l,final_line_price:f,taxable:p,product_id:d}}),currency:c,items_subtotal_price:a,cart_level_discount_applications:u})},b=(t,e="GET",n)=>{const r=a("key");return new Promise(o=>{const i=null!=n?JSON.stringify(n):null;var c=new XMLHttpRequest;c.withCredentials=!0,c.addEventListener("readystatechange",(function(){this.readyState===this.DONE&&o(JSON.parse(this.responseText))})),c.open(e,t),""!==r&&c.setRequestHeader("x-authorization",r),c.setRequestHeader("content-type","application/json"),c.send(i)})},x=()=>{return b("/cart/clear.js","POST")};function O(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function w(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const S=(t,e)=>{l.info("Creating cart request..."),l.info("Syncing these variants to the Loop cart:"),l.info(t);const n=a("token");return n?((t,e,n)=>{const r=g(),o="".concat(r,"cart/").concat(t);let i={};return a("fullPayload")&&(i={shopify:m(n)}),b(o,"POST",h({cart:e},i))})(n,t,e).then(t=>(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?O(Object(n),!0).forEach((function(e){w(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t})({},t,{token:n})):((t,e)=>{const n=g(),r="".concat(n,"cart/");let o={};return a("fullPayload")&&(o={shopify:m(e)}),b(r,"POST",h({cart:t},o))})(t,e)};n(103),n(104),n(106);function j(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const P=t=>{const e=Number(t);return Number.isNaN(e)?t:e};var E={get:(t=window.location.search)=>t.substr(1).split("&").reduce((t,e)=>{const[n,r]=decodeURIComponent(e).split("=");return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?j(Object(n),!0).forEach((function(e){_(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t,{[n]:P(r)})},{}),hasLoopData:(t=window.location.search)=>t.includes("loop_total"),getKeys:(t,e="loop")=>Object.keys(t).filter(t=>t.startsWith(e)),clear(t=[]){const e=Object.entries(this.get()).reduce((e,[n,r])=>{if(t.includes(n))return e;const o=e.length?"&":"?";return"".concat(e).concat(o).concat(encodeURIComponent(n),"=").concat(encodeURIComponent(r))},"");window.history.replaceState({},"","".concat(window.location.origin).concat(window.location.pathname).concat(e))}};const k={amount:".loop-onstore__amount"},T=(t,e,n)=>{return t.querySelector(n).textContent=e,t};var L=(t,e={})=>{if(t)return t;const n=((t={})=>{const e=document.createElement("div");return e.classList.add("loop-onstore"),e.id="loop-onstore",e.innerHTML='\n <span class="loop-onstore__amount"></span>\n <p class="loop-onstore__copy">\n in available credit\n </p>\n <button class="loop-onstore__back" onClick="LoopOnstore.backToLoop()">Go Back</button>\n',Object.keys(t).forEach(n=>{T(e,t[n],k[n])}),e})(e);return document.body.appendChild(n)};n.d(e,"init",(function(){return A})),n.d(e,"testMode",(function(){return M})),n.d(e,"submit",(function(){return C})),n.d(e,"attach",(function(){return N})),n.d(e,"debug",(function(){return R})),n.d(e,"setKey",(function(){return D})),n.d(e,"backToLoop",(function(){return F})),n.d(e,"isActive",(function(){return U}));const I={bar:null,attached:[]},A=async t=>{if(s(),null==t?void 0:t.key)D(t.key);else if(!a("key"))throw new Error("Loop Returns on-store API requires an API key.");(null==t?void 0:t.api)&&(l.info("Setting api to ".concat(t.api,".")),u("api",t.api));const e=E.get();if(E.hasLoopData()){a("id")!==e.loop_return_id&&u("token",null),u("params",e),u("id",e.loop_return_id),E.clear(E.getKeys(e)),await x();const t=a("token");if(t)try{const{cart:e}=await(t=>{const e=g(),n="".concat(e,"cart/").concat(t);return b(n)})(t);await(t=>{const e=t.reduce((t,e)=>t[e]?h({},t,{[e]:t[e]+1}):h({},t,{[e]:1}),{});return b("/cart/update.js","POST",{updates:e})})(e),l.info("Updating Shopify cart to match loop cart."),document.dispatchEvent(new Event("Loop:Cart Update"))}catch(t){l.warn("Unable to reboot cart"),l.error(t)}}const n=a("params");if(n){u("active",!0),document.body.classList.add("loop-returns-activated");const t=L(null,{amount:d(n.loop_total,n.loop_currency)});(()=>{const t=document.createElement("style");t.type="text/css",t.innerText="\n:root {\n --primary-color: black;\n --text-color: white;\n --button-background: white;\n --button-text: black;\n}\n.loop-returns-activated .loop-onstore {\n transform: translateY(0);\n display: flex;\n}\n.loop-onstore {\n box-sizing: border-box;\n width: 100%;\n position: fixed;\n display: none;\n align-items: center;\n top: auto !important;\n bottom: 0 !important;\n left: 0;\n z-index: 2147483647;\n background-color: var(--primary-color);\n color: var(--text-color);\n transform: translateY(100%);\n transition: transform .2s;\n font-size: 1rem;\n padding: 1.25rem 2rem;\n}\n.loop-onstore *, .loop-onstore *::before, .loop-onstore *::after {\n box-sizing: inherit;\n}\n.loop-onstore__amount {\n margin: 0;\n margin-right: .5rem;\n font-size: 1.5rem;\n font-weight: 800;\n color: var(--text-color);\n}\n.loop-onstore__copy {\n margin: 0;\n color: var(--text-color);\n}\n.loop-onstore__back {\n color: var(--button-text);\n background: var(--button-background);\n display: block;\n padding: .75rem 1.25rem;\n margin-left: auto;\n border: none;\n appearance: none;\n transition: all .2s;\n font-size: 1rem;\n border-radius: 5px;\n cursor: pointer;\n}\n.loop-onstore__back:hover {\n opacity: .7;\n}\n\n@media screen and (max-width: 680px) {\n .loop-onstore {\n z-index: 200;\n bottom: 3.2rem;\n padding: 1rem 1.5rem;\n }\n .loop-onstore__copy {\n font-size: .875rem;\n }\n .loop-onstore__amount {\n font-size: 1.25rem;\n }\n}\n",document.head.appendChild(t)})(),I.bar=t,l.info("Loop returns activated")}(null==t?void 0:t.attach)&&N(t.attach),(null==t?void 0:t.full)&&u("fullPayload",null==t?void 0:t.full)},M=(t=!0)=>{u("debug",!0),l.info("Test mode activated"),u("redirect",t),window.location="".concat(window.location.origin).concat(window.location.pathname,"?loop_domain=example.loopreturns.com&loop_return_id=this-is-a-test&loop_currency=USD&loop_total=12099&loop_base=799&loop_credit=500&loop_subdomain=example&loop_redirect_url=example.loopreturns.com%2F%23%2Fcredit&loop_customer_name=Jane%20Doe")},R=()=>{const t=!a("debug");return u("debug",t),"Debug ".concat(t?"on":"off")},D=t=>{if(!t||"string"!=typeof t)return console.error("Your api key is either undefined or not a string.");u("key",t),l.info("Loop Returns on-store API key set.")},C=async t=>{let e=null;t||(l.info("Requesting updated cart from Shopify"),e=await b("/cart.js"),t=e.items.reduce((t,e)=>[...t,...Array(e.quantity).fill(e.variant_id)],[]));try{const n=await S(t,e);return u("token",n.token),l.info("Cart request successful"),await x(),F(n.token),Promise.resolve(n.token)}catch(t){return l.info("Unable to create Loop Returns cart:"),l.error(t),Promise.reject(t)}},N=t=>{if(a("active")){l.info('Loop attaching to: "'.concat(t,'"'));const e=async t=>{if(a("active")){t.stopImmediatePropagation(),t.preventDefault(),t.target.disabled=!0,t.target.classList.add("loop-activated");try{await C(),t.target.disabled=!1,t.target.classList.remove("loop-activated")}catch(e){t.target.disabled=!1,t.target.classList.remove("loop-activated")}}};I.attached=f(t,e),new MutationObserver(n=>{const r=((t,e)=>t.filter(t=>t[e].length).reduce((t,n)=>[...t,...n[e]],[]))(n,"addedNodes");if(r.length){r.some(e=>e&&1===e.nodeType&&(e.matches(t)||e.querySelector(t)))&&(((t,e)=>{t.forEach(t=>{t.removeEventListener("click",e)})})(I.attached,e),I.attached=f(t,e),l.info('Loop reattached to: "'.concat(t,'"')))}}).observe(document.body,{childList:!0,subtree:!0})}},F=t=>{u("active",!1);const e=a("params"),n=t?"http://".concat(e.loop_domain,"/#/cart/v2/").concat(t):"http://".concat(e.loop_redirect_url);u("params",null),l.info("Redirecting to:"),l.info(n),a("redirect")&&(window.location.href=n)},U=()=>a("active")}])})); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.LoopOnstore=e():t.LoopOnstore=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=107)}([function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||Function("return this")()}).call(this,n(59))},function(t,e,n){var r=n(0),o=n(38),i=n(5),c=n(39),a=n(42),u=n(72),s=o("wks"),l=r.Symbol,f=u?l:c;t.exports=function(t){return i(s,t)||(a&&i(l,t)?s[t]=l[t]:s[t]=f("Symbol."+t)),s[t]}},function(t,e,n){var r=n(8);t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(9),o=n(12),i=n(22);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(3);t.exports=!r((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(0),o=n(18).f,i=n(6),c=n(13),a=n(24),u=n(63),s=n(41);t.exports=function(t,e){var n,l,f,p,d,v=t.target,h=t.global,y=t.stat;if(n=h?r:y?r[v]||a(v,{}):(r[v]||{}).prototype)for(l in e){if(p=e[l],f=t.noTargetGet?(d=o(n,l))&&d.value:n[l],!s(h?l:v+(y?".":"#")+l,t.forced)&&void 0!==f){if(typeof p==typeof f)continue;u(p,f)}(t.sham||f&&f.sham)&&i(p,"sham",!0),c(n,l,p,t)}}},function(t,e,n){var r=n(9),o=n(36),i=n(2),c=n(35),a=Object.defineProperty;e.f=r?a:function(t,e,n){if(i(t),e=c(e,!0),i(n),o)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(0),o=n(6),i=n(5),c=n(24),a=n(25),u=n(26),s=u.get,l=u.enforce,f=String(String).split("String");(t.exports=function(t,e,n,a){var u=!!a&&!!a.unsafe,s=!!a&&!!a.enumerable,p=!!a&&!!a.noTargetGet;"function"==typeof n&&("string"!=typeof e||i(n,"name")||o(n,"name",e),l(n).source=f.join("string"==typeof e?e:"")),t!==r?(u?!p&&t[e]&&(s=!0):delete t[e],s?t[e]=n:o(t,e,n)):s?t[e]=n:c(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&s(this).source||a(this)}))},function(t,e){t.exports=!1},function(t,e,n){var r=n(65),o=n(0),i=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t])||i(o[t]):r[t]&&r[t][e]||o[t]&&o[t][e]}},function(t,e,n){var r=n(10),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e){t.exports={}},function(t,e,n){var r=n(9),o=n(60),i=n(22),c=n(19),a=n(35),u=n(5),s=n(36),l=Object.getOwnPropertyDescriptor;e.f=r?l:function(t,e){if(t=c(t),e=a(e,!0),s)try{return l(t,e)}catch(t){}if(u(t,e))return i(!o.f.call(t,e),t[e])}},function(t,e,n){var r=n(61),o=n(4);t.exports=function(t){return r(o(t))}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,e,n){var r=n(0),o=n(87),i=n(88),c=n(6),a=n(1),u=a("iterator"),s=a("toStringTag"),l=i.values;for(var f in o){var p=r[f],d=p&&p.prototype;if(d){if(d[u]!==l)try{c(d,u,l)}catch(t){d[u]=l}if(d[s]||c(d,s,f),o[f])for(var v in i)if(d[v]!==i[v])try{c(d,v,i[v])}catch(t){d[v]=i[v]}}}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(0),o=n(8),i=r.document,c=o(i)&&o(i.createElement);t.exports=function(t){return c?i.createElement(t):{}}},function(t,e,n){var r=n(0),o=n(6);t.exports=function(t,e){try{o(r,t,e)}catch(n){r[t]=e}return e}},function(t,e,n){var r=n(37),o=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(t){return o.call(t)}),t.exports=r.inspectSource},function(t,e,n){var r,o,i,c=n(62),a=n(0),u=n(8),s=n(6),l=n(5),f=n(27),p=n(28),d=a.WeakMap;if(c){var v=new d,h=v.get,y=v.has,g=v.set;r=function(t,e){return g.call(v,t,e),e},o=function(t){return h.call(v,t)||{}},i=function(t){return y.call(v,t)}}else{var m=f("state");p[m]=!0,r=function(t,e){return s(t,m,e),e},o=function(t){return l(t,m)?t[m]:{}},i=function(t){return l(t,m)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=o(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}}},function(t,e,n){var r=n(38),o=n(39),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},function(t,e){t.exports={}},function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,e,n){var r=n(12).f,o=n(5),i=n(1)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){"use strict";var r=n(6),o=n(13),i=n(3),c=n(1),a=n(32),u=c("species"),s=!i((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),l=!i((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));t.exports=function(t,e,n,f){var p=c(t),d=!i((function(){var e={};return e[p]=function(){return 7},7!=""[t](e)})),v=d&&!i((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[u]=function(){return n},n.flags="",n[p]=/./[p]),n.exec=function(){return e=!0,null},n[p](""),!e}));if(!d||!v||"replace"===t&&!s||"split"===t&&!l){var h=/./[p],y=n(p,""[t],(function(t,e,n,r,o){return e.exec===a?d&&!o?{done:!0,value:h.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}})),g=y[0],m=y[1];o(String.prototype,t,g),o(RegExp.prototype,p,2==e?function(t,e){return m.call(t,this,e)}:function(t){return m.call(t,this)}),f&&r(RegExp.prototype[p],"sham",!0)}}},function(t,e,n){"use strict";var r,o,i=n(101),c=RegExp.prototype.exec,a=String.prototype.replace,u=c,s=(r=/a/,o=/b*/g,c.call(r,"a"),c.call(o,"a"),0!==r.lastIndex||0!==o.lastIndex),l=void 0!==/()??/.exec("")[1];(s||l)&&(u=function(t){var e,n,r,o,u=this;return l&&(n=new RegExp("^"+u.source+"$(?!\\s)",i.call(u))),s&&(e=u.lastIndex),r=c.call(u,t),s&&r&&(u.lastIndex=u.global?r.index+r[0].length:e),l&&r&&r.length>1&&a.call(r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r}),t.exports=u},function(t,e,n){var r=n(7),o=n(32);t.exports=function(t,e){var n=t.exec;if("function"==typeof n){var i=n.call(t,e);if("object"!=typeof i)throw TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==r(t))throw TypeError("RegExp#exec called on incompatible receiver");return o.call(t,e)}},function(t,e,n){"use strict";var r,o,i,c,a=n(11),u=n(14),s=n(0),l=n(15),f=n(70),p=n(13),d=n(71),v=n(30),h=n(73),y=n(8),g=n(20),m=n(74),b=n(7),x=n(25),O=n(75),w=n(81),S=n(44),j=n(45).set,_=n(82),P=n(83),E=n(84),k=n(49),L=n(85),T=n(26),I=n(41),A=n(1),M=n(86),R=A("species"),D="Promise",C=T.get,N=T.set,F=T.getterFor(D),U=f,q=s.TypeError,G=s.document,z=s.process,$=l("fetch"),H=k.f,W=H,B="process"==b(z),V=!!(G&&G.createEvent&&s.dispatchEvent),J=I(D,(function(){if(!(x(U)!==String(U))){if(66===M)return!0;if(!B&&"function"!=typeof PromiseRejectionEvent)return!0}if(u&&!U.prototype.finally)return!0;if(M>=51&&/native code/.test(U))return!1;var t=U.resolve(1),e=function(t){t((function(){}),(function(){}))};return(t.constructor={})[R]=e,!(t.then((function(){}))instanceof e)})),Y=J||!w((function(t){U.all(t).catch((function(){}))})),K=function(t){var e;return!(!y(t)||"function"!=typeof(e=t.then))&&e},X=function(t,e,n){if(!e.notified){e.notified=!0;var r=e.reactions;_((function(){for(var o=e.value,i=1==e.state,c=0;r.length>c;){var a,u,s,l=r[c++],f=i?l.ok:l.fail,p=l.resolve,d=l.reject,v=l.domain;try{f?(i||(2===e.rejection&&et(t,e),e.rejection=1),!0===f?a=o:(v&&v.enter(),a=f(o),v&&(v.exit(),s=!0)),a===l.promise?d(q("Promise-chain cycle")):(u=K(a))?u.call(a,p,d):p(a)):d(o)}catch(t){v&&!s&&v.exit(),d(t)}}e.reactions=[],e.notified=!1,n&&!e.rejection&&Q(t,e)}))}},Z=function(t,e,n){var r,o;V?((r=G.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),s.dispatchEvent(r)):r={promise:e,reason:n},(o=s["on"+t])?o(r):"unhandledrejection"===t&&E("Unhandled promise rejection",n)},Q=function(t,e){j.call(s,(function(){var n,r=e.value;if(tt(e)&&(n=L((function(){B?z.emit("unhandledRejection",r,t):Z("unhandledrejection",t,r)})),e.rejection=B||tt(e)?2:1,n.error))throw n.value}))},tt=function(t){return 1!==t.rejection&&!t.parent},et=function(t,e){j.call(s,(function(){B?z.emit("rejectionHandled",t):Z("rejectionhandled",t,e.value)}))},nt=function(t,e,n,r){return function(o){t(e,n,o,r)}},rt=function(t,e,n,r){e.done||(e.done=!0,r&&(e=r),e.value=n,e.state=2,X(t,e,!0))},ot=function(t,e,n,r){if(!e.done){e.done=!0,r&&(e=r);try{if(t===n)throw q("Promise can't be resolved itself");var o=K(n);o?_((function(){var r={done:!1};try{o.call(n,nt(ot,t,r,e),nt(rt,t,r,e))}catch(n){rt(t,r,n,e)}})):(e.value=n,e.state=1,X(t,e,!1))}catch(n){rt(t,{done:!1},n,e)}}};J&&(U=function(t){m(this,U,D),g(t),r.call(this);var e=C(this);try{t(nt(ot,this,e),nt(rt,this,e))}catch(t){rt(this,e,t)}},(r=function(t){N(this,{type:D,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=d(U.prototype,{then:function(t,e){var n=F(this),r=H(S(this,U));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=B?z.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&X(this,n,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r,e=C(t);this.promise=t,this.resolve=nt(ot,t,e),this.reject=nt(rt,t,e)},k.f=H=function(t){return t===U||t===i?new o(t):W(t)},u||"function"!=typeof f||(c=f.prototype.then,p(f.prototype,"then",(function(t,e){var n=this;return new U((function(t,e){c.call(n,t,e)})).then(t,e)}),{unsafe:!0}),"function"==typeof $&&a({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return P(U,$.apply(s,arguments))}}))),a({global:!0,wrap:!0,forced:J},{Promise:U}),v(U,D,!1,!0),h(D),i=l(D),a({target:D,stat:!0,forced:J},{reject:function(t){var e=H(this);return e.reject.call(void 0,t),e.promise}}),a({target:D,stat:!0,forced:u||J},{resolve:function(t){return P(u&&this===i?U:this,t)}}),a({target:D,stat:!0,forced:Y},{all:function(t){var e=this,n=H(e),r=n.resolve,o=n.reject,i=L((function(){var n=g(e.resolve),i=[],c=0,a=1;O(t,(function(t){var u=c++,s=!1;i.push(void 0),a++,n.call(e,t).then((function(t){s||(s=!0,i[u]=t,--a||r(i))}),o)})),--a||r(i)}));return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=H(e),r=n.reject,o=L((function(){var o=g(e.resolve);O(t,(function(t){o.call(e,t).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}})},function(t,e,n){var r=n(8);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(9),o=n(3),i=n(23);t.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(t,e,n){var r=n(0),o=n(24),i=r["__core-js_shared__"]||o("__core-js_shared__",{});t.exports=i},function(t,e,n){var r=n(14),o=n(37);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.5.0",mode:r?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++n+r).toString(36)}},function(t,e,n){var r=n(5),o=n(19),i=n(67).indexOf,c=n(28);t.exports=function(t,e){var n,a=o(t),u=0,s=[];for(n in a)!r(c,n)&&r(a,n)&&s.push(n);for(;e.length>u;)r(a,n=e[u++])&&(~i(s,n)||s.push(n));return s}},function(t,e,n){var r=n(3),o=/#|\.prototype\./,i=function(t,e){var n=a[c(t)];return n==s||n!=u&&("function"==typeof e?r(e):!!e)},c=i.normalize=function(t){return String(t).replace(o,".").toLowerCase()},a=i.data={},u=i.NATIVE="N",s=i.POLYFILL="P";t.exports=i},function(t,e,n){var r=n(3);t.exports=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())}))},function(t,e,n){var r=n(20);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){var r=n(2),o=n(20),i=n(1)("species");t.exports=function(t,e){var n,c=r(t).constructor;return void 0===c||null==(n=r(c)[i])?e:o(n)}},function(t,e,n){var r,o,i,c=n(0),a=n(3),u=n(7),s=n(43),l=n(46),f=n(23),p=n(47),d=c.location,v=c.setImmediate,h=c.clearImmediate,y=c.process,g=c.MessageChannel,m=c.Dispatch,b=0,x={},O=function(t){if(x.hasOwnProperty(t)){var e=x[t];delete x[t],e()}},w=function(t){return function(){O(t)}},S=function(t){O(t.data)},j=function(t){c.postMessage(t+"",d.protocol+"//"+d.host)};v&&h||(v=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return x[++b]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},r(b),b},h=function(t){delete x[t]},"process"==u(y)?r=function(t){y.nextTick(w(t))}:m&&m.now?r=function(t){m.now(w(t))}:g&&!p?(i=(o=new g).port2,o.port1.onmessage=S,r=s(i.postMessage,i,1)):!c.addEventListener||"function"!=typeof postMessage||c.importScripts||a(j)?r="onreadystatechange"in f("script")?function(t){l.appendChild(f("script")).onreadystatechange=function(){l.removeChild(this),O(t)}}:function(t){setTimeout(w(t),0)}:(r=j,c.addEventListener("message",S,!1))),t.exports={set:v,clear:h}},function(t,e,n){var r=n(15);t.exports=r("document","documentElement")},function(t,e,n){var r=n(48);t.exports=/(iphone|ipod|ipad).*applewebkit/i.test(r)},function(t,e,n){var r=n(15);t.exports=r("navigator","userAgent")||""},function(t,e,n){"use strict";var r=n(20),o=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)};t.exports.f=function(t){return new o(t)}},function(t,e,n){var r=n(2),o=n(90),i=n(29),c=n(28),a=n(46),u=n(23),s=n(27)("IE_PROTO"),l=function(){},f=function(){var t,e=u("iframe"),n=i.length;for(e.style.display="none",a.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),f=t.F;n--;)delete f.prototype[i[n]];return f()};t.exports=Object.create||function(t,e){var n;return null!==t?(l.prototype=r(t),n=new l,l.prototype=null,n[s]=t):n=f(),void 0===e?n:o(n,e)},c[s]=!0},function(t,e,n){"use strict";var r,o,i,c=n(52),a=n(6),u=n(5),s=n(1),l=n(14),f=s("iterator"),p=!1;[].keys&&("next"in(i=[].keys())?(o=c(c(i)))!==Object.prototype&&(r=o):p=!0),null==r&&(r={}),l||u(r,f)||a(r,f,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:p}},function(t,e,n){var r=n(5),o=n(53),i=n(27),c=n(94),a=i("IE_PROTO"),u=Object.prototype;t.exports=c?Object.getPrototypeOf:function(t){return t=o(t),r(t,a)?t[a]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,e,n){var r=n(4);t.exports=function(t){return Object(r(t))}},function(t,e,n){"use strict";var r=n(102).charAt;t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},function(t,e,n){"use strict";var r=n(31),o=n(56),i=n(2),c=n(4),a=n(44),u=n(54),s=n(16),l=n(33),f=n(32),p=n(3),d=[].push,v=Math.min,h=!p((function(){return!RegExp(4294967295,"y")}));r("split",2,(function(t,e,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var r=String(c(this)),i=void 0===n?4294967295:n>>>0;if(0===i)return[];if(void 0===t)return[r];if(!o(t))return e.call(r,t,i);for(var a,u,s,l=[],p=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),v=0,h=new RegExp(t.source,p+"g");(a=f.call(h,r))&&!((u=h.lastIndex)>v&&(l.push(r.slice(v,a.index)),a.length>1&&a.index<r.length&&d.apply(l,a.slice(1)),s=a[0].length,v=u,l.length>=i));)h.lastIndex===a.index&&h.lastIndex++;return v===r.length?!s&&h.test("")||l.push(""):l.push(r.slice(v)),l.length>i?l.slice(0,i):l}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:e.call(this,t,n)}:e,[function(e,n){var o=c(this),i=null==e?void 0:e[t];return void 0!==i?i.call(e,o,n):r.call(String(o),e,n)},function(t,o){var c=n(r,t,this,o,r!==e);if(c.done)return c.value;var f=i(t),p=String(this),d=a(f,RegExp),y=f.unicode,g=(f.ignoreCase?"i":"")+(f.multiline?"m":"")+(f.unicode?"u":"")+(h?"y":"g"),m=new d(h?f:"^(?:"+f.source+")",g),b=void 0===o?4294967295:o>>>0;if(0===b)return[];if(0===p.length)return null===l(m,p)?[p]:[];for(var x=0,O=0,w=[];O<p.length;){m.lastIndex=h?O:0;var S,j=l(m,h?p:p.slice(O));if(null===j||(S=v(s(m.lastIndex+(h?0:O)),p.length))===x)O=u(p,O,y);else{if(w.push(p.slice(x,O)),w.length===b)return w;for(var _=1;_<=j.length-1;_++)if(w.push(j[_]),w.length===b)return w;O=x=S}}return w.push(p.slice(x)),w}]}),!h)},function(t,e,n){var r=n(8),o=n(7),i=n(1)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[i])?!!e:"RegExp"==o(t))}},function(t,e,n){var r=n(56);t.exports=function(t){if(r(t))throw TypeError("The method doesn't accept regular expressions");return t}},function(t,e,n){var r=n(1)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,"/./"[t](e)}catch(t){}}return!1}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!r.call({1:2},1);e.f=i?function(t){var e=o(this,t);return!!e&&e.enumerable}:r},function(t,e,n){var r=n(3),o=n(7),i="".split;t.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?i.call(t,""):Object(t)}:Object},function(t,e,n){var r=n(0),o=n(25),i=r.WeakMap;t.exports="function"==typeof i&&/native code/.test(o(i))},function(t,e,n){var r=n(5),o=n(64),i=n(18),c=n(12);t.exports=function(t,e){for(var n=o(e),a=c.f,u=i.f,s=0;s<n.length;s++){var l=n[s];r(t,l)||a(t,l,u(e,l))}}},function(t,e,n){var r=n(15),o=n(66),i=n(69),c=n(2);t.exports=r("Reflect","ownKeys")||function(t){var e=o.f(c(t)),n=i.f;return n?e.concat(n(t)):e}},function(t,e,n){var r=n(0);t.exports=r},function(t,e,n){var r=n(40),o=n(29).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},function(t,e,n){var r=n(19),o=n(16),i=n(68),c=function(t){return function(e,n,c){var a,u=r(e),s=o(u.length),l=i(c,s);if(t&&n!=n){for(;s>l;)if((a=u[l++])!=a)return!0}else for(;s>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:c(!0),indexOf:c(!1)}},function(t,e,n){var r=n(10),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(0);t.exports=r.Promise},function(t,e,n){var r=n(13);t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},function(t,e,n){var r=n(42);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol()},function(t,e,n){"use strict";var r=n(15),o=n(12),i=n(1),c=n(9),a=i("species");t.exports=function(t){var e=r(t),n=o.f;c&&e&&!e[a]&&n(e,a,{configurable:!0,get:function(){return this}})}},function(t,e){t.exports=function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return t}},function(t,e,n){var r=n(2),o=n(76),i=n(16),c=n(43),a=n(77),u=n(80),s=function(t,e){this.stopped=t,this.result=e};(t.exports=function(t,e,n,l,f){var p,d,v,h,y,g,m,b=c(e,n,l?2:1);if(f)p=t;else{if("function"!=typeof(d=a(t)))throw TypeError("Target is not iterable");if(o(d)){for(v=0,h=i(t.length);h>v;v++)if((y=l?b(r(m=t[v])[0],m[1]):b(t[v]))&&y instanceof s)return y;return new s(!1)}p=d.call(t)}for(g=p.next;!(m=g.call(p)).done;)if("object"==typeof(y=u(p,b,m.value,l))&&y&&y instanceof s)return y;return new s(!1)}).stop=function(t){return new s(!0,t)}},function(t,e,n){var r=n(1),o=n(17),i=r("iterator"),c=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||c[i]===t)}},function(t,e,n){var r=n(78),o=n(17),i=n(1)("iterator");t.exports=function(t){if(null!=t)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,e,n){var r=n(79),o=n(7),i=n(1)("toStringTag"),c="Arguments"==o(function(){return arguments}());t.exports=r?o:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?n:c?o(e):"Object"==(r=o(e))&&"function"==typeof e.callee?"Arguments":r}},function(t,e,n){var r={};r[n(1)("toStringTag")]="z",t.exports="[object z]"===String(r)},function(t,e,n){var r=n(2);t.exports=function(t,e,n,o){try{return o?e(r(n)[0],n[1]):e(n)}catch(e){var i=t.return;throw void 0!==i&&r(i.call(t)),e}}},function(t,e,n){var r=n(1)("iterator"),o=!1;try{var i=0,c={next:function(){return{done:!!i++}},return:function(){o=!0}};c[r]=function(){return this},Array.from(c,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var i={};i[r]=function(){return{next:function(){return{done:n=!0}}}},t(i)}catch(t){}return n}},function(t,e,n){var r,o,i,c,a,u,s,l,f=n(0),p=n(18).f,d=n(7),v=n(45).set,h=n(47),y=f.MutationObserver||f.WebKitMutationObserver,g=f.process,m=f.Promise,b="process"==d(g),x=p(f,"queueMicrotask"),O=x&&x.value;O||(r=function(){var t,e;for(b&&(t=g.domain)&&t.exit();o;){e=o.fn,o=o.next;try{e()}catch(t){throw o?c():i=void 0,t}}i=void 0,t&&t.enter()},b?c=function(){g.nextTick(r)}:y&&!h?(a=!0,u=document.createTextNode(""),new y(r).observe(u,{characterData:!0}),c=function(){u.data=a=!a}):m&&m.resolve?(s=m.resolve(void 0),l=s.then,c=function(){l.call(s,r)}):c=function(){v.call(f,r)}),t.exports=O||function(t){var e={fn:t,next:void 0};i&&(i.next=e),o||(o=e,c()),i=e}},function(t,e,n){var r=n(2),o=n(8),i=n(49);t.exports=function(t,e){if(r(t),o(e)&&e.constructor===t)return e;var n=i.f(t);return(0,n.resolve)(e),n.promise}},function(t,e,n){var r=n(0);t.exports=function(t,e){var n=r.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))}},function(t,e){t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},function(t,e,n){var r,o,i=n(0),c=n(48),a=i.process,u=a&&a.versions,s=u&&u.v8;s?o=(r=s.split("."))[0]+r[1]:c&&(!(r=c.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=c.match(/Chrome\/(\d+)/))&&(o=r[1]),t.exports=o&&+o},function(t,e){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(t,e,n){"use strict";var r=n(19),o=n(89),i=n(17),c=n(26),a=n(92),u=c.set,s=c.getterFor("Array Iterator");t.exports=a(Array,"Array",(function(t,e){u(this,{type:"Array Iterator",target:r(t),index:0,kind:e})}),(function(){var t=s(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},function(t,e,n){var r=n(1),o=n(50),i=n(6),c=r("unscopables"),a=Array.prototype;null==a[c]&&i(a,c,o(null)),t.exports=function(t){a[c][t]=!0}},function(t,e,n){var r=n(9),o=n(12),i=n(2),c=n(91);t.exports=r?Object.defineProperties:function(t,e){i(t);for(var n,r=c(e),a=r.length,u=0;a>u;)o.f(t,n=r[u++],e[n]);return t}},function(t,e,n){var r=n(40),o=n(29);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e,n){"use strict";var r=n(11),o=n(93),i=n(52),c=n(95),a=n(30),u=n(6),s=n(13),l=n(1),f=n(14),p=n(17),d=n(51),v=d.IteratorPrototype,h=d.BUGGY_SAFARI_ITERATORS,y=l("iterator"),g=function(){return this};t.exports=function(t,e,n,l,d,m,b){o(n,e,l);var x,O,w,S=function(t){if(t===d&&k)return k;if(!h&&t in P)return P[t];switch(t){case"keys":case"values":case"entries":return function(){return new n(this,t)}}return function(){return new n(this)}},j=e+" Iterator",_=!1,P=t.prototype,E=P[y]||P["@@iterator"]||d&&P[d],k=!h&&E||S(d),L="Array"==e&&P.entries||E;if(L&&(x=i(L.call(new t)),v!==Object.prototype&&x.next&&(f||i(x)===v||(c?c(x,v):"function"!=typeof x[y]&&u(x,y,g)),a(x,j,!0,!0),f&&(p[j]=g))),"values"==d&&E&&"values"!==E.name&&(_=!0,k=function(){return E.call(this)}),f&&!b||P[y]===k||u(P,y,k),p[e]=k,d)if(O={values:S("values"),keys:m?k:S("keys"),entries:S("entries")},b)for(w in O)!h&&!_&&w in P||s(P,w,O[w]);else r({target:e,proto:!0,forced:h||_},O);return O}},function(t,e,n){"use strict";var r=n(51).IteratorPrototype,o=n(50),i=n(22),c=n(30),a=n(17),u=function(){return this};t.exports=function(t,e,n){var s=e+" Iterator";return t.prototype=o(r,{next:i(1,n)}),c(t,s,!1,!0),a[s]=u,t}},function(t,e,n){var r=n(3);t.exports=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},function(t,e,n){var r=n(2),o=n(96);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),e=n instanceof Array}catch(t){}return function(n,i){return r(n),o(i),e?t.call(n,i):n.__proto__=i,n}}():void 0)},function(t,e,n){var r=n(8);t.exports=function(t){if(!r(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},function(t,e,n){"use strict";var r=n(11),o=n(10),i=n(98),c=n(99),a=n(3),u=1..toFixed,s=Math.floor,l=function(t,e,n){return 0===e?n:e%2==1?l(t,e-1,n*t):l(t*t,e/2,n)};r({target:"Number",proto:!0,forced:u&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!a((function(){u.call({})}))},{toFixed:function(t){var e,n,r,a,u=i(this),f=o(t),p=[0,0,0,0,0,0],d="",v="0",h=function(t,e){for(var n=-1,r=e;++n<6;)r+=t*p[n],p[n]=r%1e7,r=s(r/1e7)},y=function(t){for(var e=6,n=0;--e>=0;)n+=p[e],p[e]=s(n/t),n=n%t*1e7},g=function(){for(var t=6,e="";--t>=0;)if(""!==e||0===t||0!==p[t]){var n=String(p[t]);e=""===e?n:e+c.call("0",7-n.length)+n}return e};if(f<0||f>20)throw RangeError("Incorrect fraction digits");if(u!=u)return"NaN";if(u<=-1e21||u>=1e21)return String(u);if(u<0&&(d="-",u=-u),u>1e-21)if(n=(e=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}(u*l(2,69,1))-69)<0?u*l(2,-e,1):u/l(2,e,1),n*=4503599627370496,(e=52-e)>0){for(h(0,n),r=f;r>=7;)h(1e7,0),r-=7;for(h(l(10,r,1),0),r=e-1;r>=23;)y(1<<23),r-=23;y(1<<r),h(1,1),y(2),v=g()}else h(0,n),h(1<<-e,0),v=g()+c.call("0",f);return v=f>0?d+((a=v.length)<=f?"0."+c.call("0",f-a)+v:v.slice(0,a-f)+"."+v.slice(a-f)):d+v}})},function(t,e,n){var r=n(7);t.exports=function(t){if("number"!=typeof t&&"Number"!=r(t))throw TypeError("Incorrect invocation");return+t}},function(t,e,n){"use strict";var r=n(10),o=n(4);t.exports="".repeat||function(t){var e=String(o(this)),n="",i=r(t);if(i<0||i==1/0)throw RangeError("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(e+=e))1&i&&(n+=e);return n}},function(t,e,n){"use strict";var r=n(31),o=n(2),i=n(53),c=n(16),a=n(10),u=n(4),s=n(54),l=n(33),f=Math.max,p=Math.min,d=Math.floor,v=/\$([$&'`]|\d\d?|<[^>]*>)/g,h=/\$([$&'`]|\d\d?)/g;r("replace",2,(function(t,e,n){return[function(n,r){var o=u(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,o,r):e.call(String(o),n,r)},function(t,i){var u=n(e,t,this,i);if(u.done)return u.value;var d=o(t),v=String(this),h="function"==typeof i;h||(i=String(i));var y=d.global;if(y){var g=d.unicode;d.lastIndex=0}for(var m=[];;){var b=l(d,v);if(null===b)break;if(m.push(b),!y)break;""===String(b[0])&&(d.lastIndex=s(v,c(d.lastIndex),g))}for(var x,O="",w=0,S=0;S<m.length;S++){b=m[S];for(var j=String(b[0]),_=f(p(a(b.index),v.length),0),P=[],E=1;E<b.length;E++)P.push(void 0===(x=b[E])?x:String(x));var k=b.groups;if(h){var L=[j].concat(P,_,v);void 0!==k&&L.push(k);var T=String(i.apply(void 0,L))}else T=r(j,v,_,P,k,i);_>=w&&(O+=v.slice(w,_)+T,w=_+j.length)}return O+v.slice(w)}];function r(t,n,r,o,c,a){var u=r+t.length,s=o.length,l=h;return void 0!==c&&(c=i(c),l=v),e.call(a,l,(function(e,i){var a;switch(i.charAt(0)){case"$":return"$";case"&":return t;case"`":return n.slice(0,r);case"'":return n.slice(u);case"<":a=c[i.slice(1,-1)];break;default:var l=+i;if(0===l)return e;if(l>s){var f=d(l/10);return 0===f?e:f<=s?void 0===o[f-1]?i.charAt(1):o[f-1]+i.charAt(1):e}a=o[l-1]}return void 0===a?"":a}))}}))},function(t,e,n){"use strict";var r=n(2);t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},function(t,e,n){var r=n(10),o=n(4),i=function(t){return function(e,n){var i,c,a=String(o(e)),u=r(n),s=a.length;return u<0||u>=s?t?"":void 0:(i=a.charCodeAt(u))<55296||i>56319||u+1===s||(c=a.charCodeAt(u+1))<56320||c>57343?t?a.charAt(u):i:t?a.slice(u,u+2):c-56320+(i-55296<<10)+65536}};t.exports={codeAt:i(!1),charAt:i(!0)}},function(t,e,n){"use strict";var r=n(11),o=n(57),i=n(4);r({target:"String",proto:!0,forced:!n(58)("includes")},{includes:function(t){return!!~String(i(this)).indexOf(o(t),arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";var r=n(31),o=n(2),i=n(4),c=n(105),a=n(33);r("search",1,(function(t,e,n){return[function(e){var n=i(this),r=null==e?void 0:e[t];return void 0!==r?r.call(e,n):new RegExp(e)[t](String(n))},function(t){var r=n(e,t,this);if(r.done)return r.value;var i=o(t),u=String(this),s=i.lastIndex;c(s,0)||(i.lastIndex=0);var l=a(i,u);return c(i.lastIndex,s)||(i.lastIndex=s),null===l?-1:l.index}]}))},function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},function(t,e,n){"use strict";var r,o=n(11),i=n(18).f,c=n(16),a=n(57),u=n(4),s=n(58),l=n(14),f="".startsWith,p=Math.min,d=s("startsWith");o({target:"String",proto:!0,forced:!!(l||d||(r=i(String.prototype,"startsWith"),!r||r.writable))&&!d},{startsWith:function(t){var e=String(u(this));a(t);var n=c(p(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return f?f.call(e,r,n):e.slice(n,n+r.length)===r}})},function(t,e,n){"use strict";n.r(e);n(34),n(21);var r={get:(t="loop-onstore-data")=>JSON.parse(localStorage.getItem(t)||null),set(t,e="loop-onstore-data"){localStorage.setItem(e,JSON.stringify(t))},remove(t="loop-onstore-data"){localStorage.removeItem(t)}};function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}let c={debug:!1,redirect:!0,active:!1,params:null,key:null,api:null,token:null,id:null,fullPayload:!1};const a=t=>t?c[t]:c,u=(t,e)=>{c[t]=e,r.set(c)},s=()=>{const t=r.get();t&&(c=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach((function(e){i(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},c,{},t))};var l=new Proxy({},{get:(t,e)=>!t[e]&&a("debug")?t=>"string"==typeof t?console[e]("%c".concat(t),"color: #3256E6"):console[e](t):t[e]||function(){}});const f=(t,e)=>{const n=[...document.querySelectorAll(t)];return n.length>1&&l.warn("Attaching Loop.submit() to more than one element. Make sure you're using the right selector!"),n.forEach(t=>{t.addEventListener("click",e)}),n};n(97),n(100),n(55);const p={JPY:{constant:1,decimals:0,decimalSymbol:"",thousandSymbol:",",symbol:"¥"},GBP:{constant:100,decimals:2,decimalSymbol:".",thousandSymbol:",",symbol:"£"},EUR:{constant:100,decimals:2,decimalSymbol:",",thousandSymbol:".",symbol:"€"},USD:{constant:100,decimals:2,decimalSymbol:".",thousandSymbol:",",symbol:"$"},CAD:{constant:100,decimals:2,decimalSymbol:".",thousandSymbol:",",symbol:"$"},AUD:{constant:100,decimals:2,decimalSymbol:".",thousandSymbol:",",symbol:"$"},HKD:{constant:100,decimals:2,decimalSymbol:".",thousandSymbol:",",symbol:"$"},NZD:{constant:100,decimals:2,decimalSymbol:".",thousandSymbol:",",symbol:"$"},SGD:{constant:100,decimals:2,decimalSymbol:".",thousandSymbol:",",symbol:"$"}},d=(t,e="USD")=>{if(!t)return"";const n=p[e];if(n){const{dollars:e,cents:r}=((t,e)=>{const[n,r]=Number.parseFloat(t/e.constant).toFixed(e.decimals).split(".");return{dollars:n?n.replace(/\B(?=(\d{3})+(?!\d))/g,e.thousandSymbol):"0",cents:r||""}})(t,n);return"".concat(n.symbol).concat(e).concat(n.decimalSymbol).concat(r)}return new Intl.NumberFormat("en-US",{style:"currency",currency:e}).format(t/n.constant)};function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?v(Object(n),!0).forEach((function(e){y(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function y(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const g=()=>{var t;return null!==(t=a("api"))&&void 0!==t?t:"https://api.loopreturns.com/api/v1/"},m=t=>{const{token:e,total_discount:n,original_total_price:r,total_price:o,items:i,currency:c,items_subtotal_price:a,cart_level_discount_applications:u}=t;return(t=>{const e="object"==typeof t&&null!==t?JSON.stringify(t):String(t);return window.btoa(unescape(encodeURIComponent(e)))})({token:e,total_discount:n,original_total_price:r,total_price:o,items:i.map(t=>{const{id:e,quantity:n,variant_id:r,price:o,original_price:i,discounted_price:c,original_line_price:a,line_price:u,total_discount:s,final_price:l,final_line_price:f,taxable:p,product_id:d}=t;return{id:e,quantity:n,variant_id:r,price:o,original_price:i,discounted_price:c,original_line_price:a,line_price:u,total_discount:s,final_price:l,final_line_price:f,taxable:p,product_id:d}}),currency:c,items_subtotal_price:a,cart_level_discount_applications:u})},b=(t,e="GET",n)=>{const r=a("key");return new Promise(o=>{const i=null!=n?JSON.stringify(n):null;var c=new XMLHttpRequest;c.withCredentials=!0,c.addEventListener("readystatechange",(function(){this.readyState===this.DONE&&o(JSON.parse(this.responseText))})),c.open(e,t),""!==r&&c.setRequestHeader("x-authorization",r),c.setRequestHeader("content-type","application/json"),c.send(i)})},x=()=>{return b("/cart/clear.js","POST")};function O(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function w(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const S=(t,e)=>{l.info("Creating cart request..."),l.info("Syncing these variants to the Loop cart:"),l.info(t);const n=a("token");return n?((t,e,n)=>{const r=g(),o="".concat(r,"cart/").concat(t);let i={};return a("fullPayload")&&(i={shopify:m(n)}),b(o,"POST",h({cart:e},i))})(n,t,e).then(t=>(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?O(Object(n),!0).forEach((function(e){w(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t})({},t,{token:n})):((t,e)=>{const n=g(),r="".concat(n,"cart/");let o={};return a("fullPayload")&&(o={shopify:m(e)}),b(r,"POST",h({cart:t},o))})(t,e)};n(103),n(104),n(106);function j(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const P=t=>{const e=Number(t);return Number.isNaN(e)?t:e};var E={get:(t=window.location.search)=>t.substr(1).split("&").reduce((t,e)=>{const[n,r]=decodeURIComponent(e).split("=");return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?j(Object(n),!0).forEach((function(e){_(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t,{[n]:P(r)})},{}),hasLoopData:(t=window.location.search)=>t.includes("loop_total"),getKeys:(t,e="loop")=>Object.keys(t).filter(t=>t.startsWith(e)),clear(t=[]){const e=Object.entries(this.get()).reduce((e,[n,r])=>{if(t.includes(n))return e;const o=e.length?"&":"?";return"".concat(e).concat(o).concat(encodeURIComponent(n),"=").concat(encodeURIComponent(r))},"");window.history.replaceState({},"","".concat(window.location.origin).concat(window.location.pathname).concat(e))}};const k={amount:".loop-onstore__amount"},L=(t,e,n)=>{return t.querySelector(n).textContent=e,t};var T=(t,e={})=>{if(t)return t;const n=((t={})=>{const e=document.createElement("div");return e.classList.add("loop-onstore"),e.id="loop-onstore",e.innerHTML='\n <span class="loop-onstore__amount"></span>\n <p class="loop-onstore__copy">\n in available credit\n </p>\n <button class="loop-onstore__back" onClick="LoopOnstore.backToLoop()">Go Back</button>\n',Object.keys(t).forEach(n=>{L(e,t[n],k[n])}),e})(e);return document.body.appendChild(n)};n.d(e,"init",(function(){return A})),n.d(e,"testMode",(function(){return M})),n.d(e,"submit",(function(){return C})),n.d(e,"attach",(function(){return N})),n.d(e,"debug",(function(){return R})),n.d(e,"setKey",(function(){return D})),n.d(e,"backToLoop",(function(){return F})),n.d(e,"isActive",(function(){return U}));const I={bar:null,attached:[]},A=async t=>{if(s(),null==t?void 0:t.key)D(t.key);else if(!a("key"))throw new Error("Loop Returns on-store API requires an API key.");(null==t?void 0:t.api)&&(l.info("Setting api to ".concat(t.api,".")),u("api",t.api));const e=E.get();if(E.hasLoopData()){a("id")!==e.loop_return_id&&u("token",null),u("params",e),u("id",e.loop_return_id),E.clear(E.getKeys(e)),await x();const t=a("token");if(t)try{const{cart:e}=await(t=>{const e=g(),n="".concat(e,"cart/").concat(t);return b(n)})(t);await(t=>{const e=t.reduce((t,e)=>t[e]?h({},t,{[e]:t[e]+1}):h({},t,{[e]:1}),{});return b("/cart/update.js","POST",{updates:e})})(e),l.info("Updating Shopify cart to match loop cart."),document.dispatchEvent(new Event("Loop:Cart Update"))}catch(t){l.warn("Unable to reboot cart"),l.error(t)}}const n=a("params");if(n){u("active",!0),document.body.classList.add("loop-returns-activated");const t=T(null,{amount:d(n.loop_total,n.loop_currency)});(()=>{const t=document.createElement("style");t.type="text/css",t.innerText="\n:root {\n --primary-color: black;\n --text-color: white;\n --button-background: white;\n --button-text: black;\n}\n.loop-returns-activated .loop-onstore {\n transform: translateY(0);\n display: flex;\n}\n.loop-onstore {\n box-sizing: border-box;\n width: 100%;\n position: fixed;\n display: none;\n align-items: center;\n top: auto !important;\n bottom: 0 !important;\n left: 0;\n z-index: 2147483647;\n background-color: var(--primary-color);\n color: var(--text-color);\n transform: translateY(100%);\n transition: transform .2s;\n font-size: 1rem;\n padding: 1.25rem 2rem;\n}\n.loop-onstore *, .loop-onstore *::before, .loop-onstore *::after {\n box-sizing: inherit;\n}\n.loop-onstore__amount {\n margin: 0;\n margin-right: .5rem;\n font-size: 1.5rem;\n font-weight: 800;\n color: var(--text-color);\n}\n.loop-onstore__copy {\n margin: 0;\n color: var(--text-color);\n}\n.loop-onstore__back {\n color: var(--button-text);\n background: var(--button-background);\n display: block;\n padding: .75rem 1.25rem;\n margin-left: auto;\n border: none;\n appearance: none;\n transition: all .2s;\n font-size: 1rem;\n border-radius: 5px;\n cursor: pointer;\n}\n.loop-onstore__back:hover {\n opacity: .7;\n}\n\n@media screen and (max-width: 680px) {\n .loop-onstore {\n z-index: 200;\n bottom: 3.2rem;\n padding: 1rem 1.5rem;\n }\n .loop-onstore__copy {\n font-size: .875rem;\n }\n .loop-onstore__amount {\n font-size: 1.25rem;\n }\n}\n",document.head.appendChild(t)})(),I.bar=t,l.info("Loop returns activated"),document.dispatchEvent(new Event("Loop:Activated"))}(null==t?void 0:t.attach)&&N(t.attach),(null==t?void 0:t.full)&&u("fullPayload",null==t?void 0:t.full)},M=(t=!0)=>{u("debug",!0),l.info("Test mode activated"),u("redirect",t),window.location="".concat(window.location.origin).concat(window.location.pathname,"?loop_domain=example.loopreturns.com&loop_return_id=this-is-a-test&loop_currency=USD&loop_total=12099&loop_base=799&loop_credit=500&loop_subdomain=example&loop_redirect_url=example.loopreturns.com%2F%23%2Fcredit&loop_customer_name=Jane%20Doe")},R=()=>{const t=!a("debug");return u("debug",t),"Debug ".concat(t?"on":"off")},D=t=>{if(!t||"string"!=typeof t)return console.error("Your api key is either undefined or not a string.");u("key",t),l.info("Loop Returns on-store API key set.")},C=async t=>{let e=null;t||(l.info("Requesting updated cart from Shopify"),e=await b("/cart.js"),t=e.items.reduce((t,e)=>[...t,...Array(e.quantity).fill(e.variant_id)],[]));try{const n=await S(t,e);return u("token",n.token),l.info("Cart request successful"),await x(),F(n.token),Promise.resolve(n.token)}catch(t){return l.info("Unable to create Loop Returns cart:"),l.error(t),Promise.reject(t)}},N=t=>{if(a("active")){l.info('Loop attaching to: "'.concat(t,'"'));const e=async t=>{if(a("active")){t.stopImmediatePropagation(),t.preventDefault(),t.target.disabled=!0,t.target.classList.add("loop-activated");try{await C(),t.target.disabled=!1,t.target.classList.remove("loop-activated")}catch(e){t.target.disabled=!1,t.target.classList.remove("loop-activated")}}};I.attached=f(t,e),new MutationObserver(n=>{const r=((t,e)=>t.filter(t=>t[e].length).reduce((t,n)=>[...t,...n[e]],[]))(n,"addedNodes");if(r.length){r.some(e=>e&&1===e.nodeType&&(e.matches(t)||e.querySelector(t)))&&(((t,e)=>{t.forEach(t=>{t.removeEventListener("click",e)})})(I.attached,e),I.attached=f(t,e),l.info('Loop reattached to: "'.concat(t,'"')))}}).observe(document.body,{childList:!0,subtree:!0})}},F=t=>{u("active",!1);const e=a("params"),n=t?"http://".concat(e.loop_domain,"/#/cart/v2/").concat(t):"http://".concat(e.loop_redirect_url);u("params",null),l.info("Redirecting to:"),l.info(n),document.dispatchEvent(new Event("Loop:Back To Loop")),a("redirect")&&(window.location.href=n)},U=()=>a("active")}])})); |
{ | ||
"name": "@loophq/onstore-sdk", | ||
"private": false, | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "An SDK for integrating with loop returns on-store api", | ||
@@ -6,0 +6,0 @@ "main": "dist/loop-onstore-sdk.js", |
@@ -5,8 +5,6 @@ # Loop Onstore SDK | ||
## Usage | ||
## Installing | ||
### Installing | ||
### Add via CDN | ||
#### Add via CDN | ||
The easiest way to get started is to link it into your page via CDN and then use the global variable exposed to use the library. | ||
@@ -21,3 +19,3 @@ | ||
#### Module builds | ||
### Module builds | ||
@@ -36,3 +34,3 @@ If you have a build process in place you can install via npm or yarn and import and use it as you need. | ||
### Examples | ||
## Examples | ||
@@ -56,3 +54,3 @@ ``` | ||
### Styling | ||
## Styling | ||
@@ -72,23 +70,23 @@ Loop Onstore SDK injects a bar with the amount of credit available and a return to Loop Returns button. Default styling is applied, but you can further customize it with CSS as you see fit. To easily style it in browser, you can run `LoopOnstore.testMode()` in your browser console to see what elements we inject into the DOM, and style accordingly. If you just want to customize colors, you can just set these CSS custom properties and the changes will cascade through: | ||
#### Alternative payments or home try-on | ||
### Alternative payments or home try-on | ||
Your store may offer alternative payment options, instead of using Shopify checkout. Because these are not available on Loop On-Store, all alternative payment methods should be hidden. Common alternative payment methods include AfterPay, Google Pay & Paypal. These buttons typically appear on Side Carts and Cart pages. Similarly, if there are buttons for a Home Try-On program, those should also be removed. | ||
#### Help chat widgets | ||
### Help chat widgets | ||
It's not uncommon for your store to have a help chat widget at the bottom of their site. This will collide with the Loop On-Store credit indicator and should be adjusted when in the On-Store experience. You should use CSS to move the chat button up when in the returns experience to accommodate for the Loop on-store credit indicator. | ||
#### Mobile checkout | ||
### Mobile checkout | ||
Mobile bottom-bar add-to-cart buttons can cause trouble for the Loop On-Store experience and should be accounted for. An easy solution for this problem is using the `.loop-returns-activated` class and either move the elements around or simply adding `display: none;` to the items you don't want to show up. | ||
#### Popups and light boxes offering discount codes and special offers | ||
### Popups and light boxes offering discount codes and special offers | ||
It’s a common paradigm now for Shops to show special offers through a pop up modal when a customer enters their site. Anything deviated from a customer adding product to there caught is distracting for returning customers, especially since these discounts will not apply to items bought using the Loop On-Store Experience. It is recommended that these be hidden. | ||
### API | ||
## API | ||
Loop Onstore SDK exposes methods you can use to easily integrate with the Loop onstore API. If you're using the CDN link, you'll access these using the global variable `LoopOnstore`. If you're installing via package manager you can import the methods individually to use. | ||
#### init(options: object) | ||
### init(options: object) | ||
@@ -113,7 +111,7 @@ Initializes the Loop onstore. You'll want to run this on every page load. | ||
##### options | ||
#### options | ||
Type: `object` | ||
###### key | ||
##### key | ||
@@ -124,3 +122,3 @@ Type: `string` | ||
###### attach | ||
##### attach | ||
@@ -131,3 +129,3 @@ Type: `string` | ||
#### isActive | ||
### isActive | ||
@@ -142,3 +140,3 @@ Returns true if the on-store is active. | ||
#### submit(variants?: array) | ||
### submit(variants?: array) | ||
@@ -152,3 +150,3 @@ ``` | ||
##### variants | ||
#### variants | ||
@@ -159,3 +157,3 @@ Type: `array` | ||
#### backToLoop(token?: string) | ||
### backToLoop(token?: string) | ||
@@ -169,3 +167,3 @@ ``` | ||
##### token | ||
#### token | ||
@@ -176,15 +174,15 @@ Type: `string` | ||
#### testMode() | ||
### testMode() | ||
This will send you into the onstore experience with fake data. You'll want to walk through the entire flow to make sure it works properly, but this is nice for testing that all of the functionality is attaching properly, and for styling the bar that we generate. | ||
#### debug() | ||
### debug() | ||
Toggle debug messages on and off, which will log to the console what's happening. Running the testMode method will enable this automatically. You should enable this if you're setting up an on-store integration or if something doesn't seem like it's working right. | ||
#### setKey(key: string) | ||
### setKey(key: string) | ||
Sets your Loop onstore api key. This is required to communicate with the Loop Onstore API. Generally you'll want to do this via the `init()` method instead of directly here. | ||
##### key | ||
#### key | ||
@@ -195,7 +193,7 @@ Type: `string` | ||
#### attach(selector: string) | ||
### attach(selector: string) | ||
Pass this a css selector for your checkout button and the SDK will call the submit method automatically when a user is in the onstore flow. See examples to see how this works. Generally you'll want to do this via the `init()` method instead of directly here. | ||
##### selector | ||
#### selector | ||
@@ -206,2 +204,39 @@ Type: `string` | ||
## Events | ||
In addition to the API, we also fire events at certain points in the flow. These events are fired on the document, meaning you can hook into them by adding an event listener to the document like so: `document.addEventListener('Loop:Activated', () => {});`. | ||
### Activated | ||
**Event:** `Loop:Activated` | ||
This fires as we're activating the on-store experience. Note that this will only fire if the user is coming from the Loop app or is already in an on-store experience. You will not see this fire for normal users, only if on-store is active. | ||
#### Example | ||
``` | ||
document.addEventListener('Loop:Activated', () => {}); | ||
``` | ||
### Cart Update | ||
**Event:** `Loop:Cart Update` | ||
This fires every time we update the Shopify cart. | ||
#### Example | ||
``` | ||
document.addEventListener('Loop:Cart Update', () => {}); | ||
``` | ||
### Back To Loop | ||
**Event:** `Loop:Back To Loop` | ||
This fires directly before the user gets redirected back to the Loop app. | ||
#### Example | ||
``` | ||
document.addEventListener('Loop:Back To Loop', () => {}); | ||
``` | ||
## Versioning | ||
@@ -208,0 +243,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
317933
245