New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@loophq/onstore-sdk

Package Overview
Dependencies
Maintainers
0
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loophq/onstore-sdk - npm Package Compare versions

Comparing version 1.3.3 to 1.3.4

2

dist/loop-onstore-sdk.js

@@ -1,1 +0,1 @@

!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.LoopOnstore=n():t.LoopOnstore=n()}(window,(function(){return function(t){var n={};function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}return e.m=t,e.c=n,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:o})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(e.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var r in t)e.d(o,r,function(n){return t[n]}.bind(null,r));return o},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=107)}([function(t,n,e){(function(n){var e=function(t){return t&&t.Math==Math&&t};t.exports=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof n&&n)||Function("return this")()}).call(this,e(59))},function(t,n,e){var o=e(0),r=e(38),i=e(5),c=e(39),a=e(42),s=e(72),u=r("wks"),l=o.Symbol,p=s?l:c;t.exports=function(t){return i(u,t)||(a&&i(l,t)?u[t]=l[t]:u[t]=p("Symbol."+t)),u[t]}},function(t,n,e){var o=e(8);t.exports=function(t){if(!o(t))throw TypeError(String(t)+" is not an object");return t}},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},function(t,n,e){var o=e(9),r=e(12),i=e(22);t.exports=o?function(t,n,e){return r.f(t,n,i(1,e))}:function(t,n,e){return t[n]=e,t}},function(t,n){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,e){var o=e(3);t.exports=!o((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,n){var e=Math.ceil,o=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?o:e)(t)}},function(t,n,e){var o=e(0),r=e(18).f,i=e(6),c=e(13),a=e(24),s=e(63),u=e(41);t.exports=function(t,n){var e,l,p,f,d,v=t.target,h=t.global,m=t.stat;if(e=h?o:m?o[v]||a(v,{}):(o[v]||{}).prototype)for(l in n){if(f=n[l],p=t.noTargetGet?(d=r(e,l))&&d.value:e[l],!u(h?l:v+(m?".":"#")+l,t.forced)&&void 0!==p){if(typeof f==typeof p)continue;s(f,p)}(t.sham||p&&p.sham)&&i(f,"sham",!0),c(e,l,f,t)}}},function(t,n,e){var o=e(9),r=e(36),i=e(2),c=e(35),a=Object.defineProperty;n.f=o?a:function(t,n,e){if(i(t),n=c(n,!0),i(e),r)try{return a(t,n,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported");return"value"in e&&(t[n]=e.value),t}},function(t,n,e){var o=e(0),r=e(6),i=e(5),c=e(24),a=e(25),s=e(26),u=s.get,l=s.enforce,p=String(String).split("String");(t.exports=function(t,n,e,a){var s=!!a&&!!a.unsafe,u=!!a&&!!a.enumerable,f=!!a&&!!a.noTargetGet;"function"==typeof e&&("string"!=typeof n||i(e,"name")||r(e,"name",n),l(e).source=p.join("string"==typeof n?n:"")),t!==o?(s?!f&&t[n]&&(u=!0):delete t[n],u?t[n]=e:r(t,n,e)):u?t[n]=e:c(n,e)})(Function.prototype,"toString",(function(){return"function"==typeof this&&u(this).source||a(this)}))},function(t,n){t.exports=!1},function(t,n,e){var o=e(65),r=e(0),i=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,n){return arguments.length<2?i(o[t])||i(r[t]):o[t]&&o[t][n]||r[t]&&r[t][n]}},function(t,n,e){var o=e(10),r=Math.min;t.exports=function(t){return t>0?r(o(t),9007199254740991):0}},function(t,n){t.exports={}},function(t,n,e){var o=e(9),r=e(60),i=e(22),c=e(19),a=e(35),s=e(5),u=e(36),l=Object.getOwnPropertyDescriptor;n.f=o?l:function(t,n){if(t=c(t),n=a(n,!0),u)try{return l(t,n)}catch(t){}if(s(t,n))return i(!r.f.call(t,n),t[n])}},function(t,n,e){var o=e(61),r=e(4);t.exports=function(t){return o(r(t))}},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,n,e){var o=e(0),r=e(87),i=e(88),c=e(6),a=e(1),s=a("iterator"),u=a("toStringTag"),l=i.values;for(var p in r){var f=o[p],d=f&&f.prototype;if(d){if(d[s]!==l)try{c(d,s,l)}catch(t){d[s]=l}if(d[u]||c(d,u,p),r[p])for(var v in i)if(d[v]!==i[v])try{c(d,v,i[v])}catch(t){d[v]=i[v]}}}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,e){var o=e(0),r=e(8),i=o.document,c=r(i)&&r(i.createElement);t.exports=function(t){return c?i.createElement(t):{}}},function(t,n,e){var o=e(0),r=e(6);t.exports=function(t,n){try{r(o,t,n)}catch(e){o[t]=n}return n}},function(t,n,e){var o=e(37),r=Function.toString;"function"!=typeof o.inspectSource&&(o.inspectSource=function(t){return r.call(t)}),t.exports=o.inspectSource},function(t,n,e){var o,r,i,c=e(62),a=e(0),s=e(8),u=e(6),l=e(5),p=e(27),f=e(28),d=a.WeakMap;if(c){var v=new d,h=v.get,m=v.has,y=v.set;o=function(t,n){return y.call(v,t,n),n},r=function(t){return h.call(v,t)||{}},i=function(t){return m.call(v,t)}}else{var g=p("state");f[g]=!0,o=function(t,n){return u(t,g,n),n},r=function(t){return l(t,g)?t[g]:{}},i=function(t){return l(t,g)}}t.exports={set:o,get:r,has:i,enforce:function(t){return i(t)?r(t):o(t,{})},getterFor:function(t){return function(n){var e;if(!s(n)||(e=r(n)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return e}}}},function(t,n,e){var o=e(38),r=e(39),i=o("keys");t.exports=function(t){return i[t]||(i[t]=r(t))}},function(t,n){t.exports={}},function(t,n){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,n,e){var o=e(12).f,r=e(5),i=e(1)("toStringTag");t.exports=function(t,n,e){t&&!r(t=e?t:t.prototype,i)&&o(t,i,{configurable:!0,value:n})}},function(t,n,e){"use strict";var o=e(6),r=e(13),i=e(3),c=e(1),a=e(32),s=c("species"),u=!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=/(?:)/,n=t.exec;t.exec=function(){return n.apply(this,arguments)};var e="ab".split(t);return 2!==e.length||"a"!==e[0]||"b"!==e[1]}));t.exports=function(t,n,e,p){var f=c(t),d=!i((function(){var n={};return n[f]=function(){return 7},7!=""[t](n)})),v=d&&!i((function(){var n=!1,e=/a/;return"split"===t&&((e={}).constructor={},e.constructor[s]=function(){return e},e.flags="",e[f]=/./[f]),e.exec=function(){return n=!0,null},e[f](""),!n}));if(!d||!v||"replace"===t&&!u||"split"===t&&!l){var h=/./[f],m=e(f,""[t],(function(t,n,e,o,r){return n.exec===a?d&&!r?{done:!0,value:h.call(n,e,o)}:{done:!0,value:t.call(e,n,o)}:{done:!1}})),y=m[0],g=m[1];r(String.prototype,t,y),r(RegExp.prototype,f,2==n?function(t,n){return g.call(t,this,n)}:function(t){return g.call(t,this)}),p&&o(RegExp.prototype[f],"sham",!0)}}},function(t,n,e){"use strict";var o,r,i=e(101),c=RegExp.prototype.exec,a=String.prototype.replace,s=c,u=(o=/a/,r=/b*/g,c.call(o,"a"),c.call(r,"a"),0!==o.lastIndex||0!==r.lastIndex),l=void 0!==/()??/.exec("")[1];(u||l)&&(s=function(t){var n,e,o,r,s=this;return l&&(e=new RegExp("^"+s.source+"$(?!\\s)",i.call(s))),u&&(n=s.lastIndex),o=c.call(s,t),u&&o&&(s.lastIndex=s.global?o.index+o[0].length:n),l&&o&&o.length>1&&a.call(o[0],e,(function(){for(r=1;r<arguments.length-2;r++)void 0===arguments[r]&&(o[r]=void 0)})),o}),t.exports=s},function(t,n,e){var o=e(7),r=e(32);t.exports=function(t,n){var e=t.exec;if("function"==typeof e){var i=e.call(t,n);if("object"!=typeof i)throw TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==o(t))throw TypeError("RegExp#exec called on incompatible receiver");return r.call(t,n)}},function(t,n,e){"use strict";var o,r,i,c,a=e(11),s=e(14),u=e(0),l=e(15),p=e(70),f=e(13),d=e(71),v=e(30),h=e(73),m=e(8),y=e(20),g=e(74),b=e(7),x=e(25),_=e(75),w=e(81),S=e(44),O=e(45).set,j=e(82),k=e(83),E=e(84),P=e(49),L=e(85),C=e(26),T=e(41),I=e(1),M=e(86),A=I("species"),D="Promise",R=C.get,N=C.set,F=C.getterFor(D),U=p,H=u.TypeError,q=u.document,B=u.process,z=l("fetch"),G=P.f,$=G,W="process"==b(B),V=!!(q&&q.createEvent&&u.dispatchEvent),J=T(D,(function(){if(!(x(U)!==String(U))){if(66===M)return!0;if(!W&&"function"!=typeof PromiseRejectionEvent)return!0}if(s&&!U.prototype.finally)return!0;if(M>=51&&/native code/.test(U))return!1;var t=U.resolve(1),n=function(t){t((function(){}),(function(){}))};return(t.constructor={})[A]=n,!(t.then((function(){}))instanceof n)})),Y=J||!w((function(t){U.all(t).catch((function(){}))})),K=function(t){var n;return!(!m(t)||"function"!=typeof(n=t.then))&&n},Z=function(t,n,e){if(!n.notified){n.notified=!0;var o=n.reactions;j((function(){for(var r=n.value,i=1==n.state,c=0;o.length>c;){var a,s,u,l=o[c++],p=i?l.ok:l.fail,f=l.resolve,d=l.reject,v=l.domain;try{p?(i||(2===n.rejection&&nt(t,n),n.rejection=1),!0===p?a=r:(v&&v.enter(),a=p(r),v&&(v.exit(),u=!0)),a===l.promise?d(H("Promise-chain cycle")):(s=K(a))?s.call(a,f,d):f(a)):d(r)}catch(t){v&&!u&&v.exit(),d(t)}}n.reactions=[],n.notified=!1,e&&!n.rejection&&Q(t,n)}))}},X=function(t,n,e){var o,r;V?((o=q.createEvent("Event")).promise=n,o.reason=e,o.initEvent(t,!1,!0),u.dispatchEvent(o)):o={promise:n,reason:e},(r=u["on"+t])?r(o):"unhandledrejection"===t&&E("Unhandled promise rejection",e)},Q=function(t,n){O.call(u,(function(){var e,o=n.value;if(tt(n)&&(e=L((function(){W?B.emit("unhandledRejection",o,t):X("unhandledrejection",t,o)})),n.rejection=W||tt(n)?2:1,e.error))throw e.value}))},tt=function(t){return 1!==t.rejection&&!t.parent},nt=function(t,n){O.call(u,(function(){W?B.emit("rejectionHandled",t):X("rejectionhandled",t,n.value)}))},et=function(t,n,e,o){return function(r){t(n,e,r,o)}},ot=function(t,n,e,o){n.done||(n.done=!0,o&&(n=o),n.value=e,n.state=2,Z(t,n,!0))},rt=function(t,n,e,o){if(!n.done){n.done=!0,o&&(n=o);try{if(t===e)throw H("Promise can't be resolved itself");var r=K(e);r?j((function(){var o={done:!1};try{r.call(e,et(rt,t,o,n),et(ot,t,o,n))}catch(e){ot(t,o,e,n)}})):(n.value=e,n.state=1,Z(t,n,!1))}catch(e){ot(t,{done:!1},e,n)}}};J&&(U=function(t){g(this,U,D),y(t),o.call(this);var n=R(this);try{t(et(rt,this,n),et(ot,this,n))}catch(t){ot(this,n,t)}},(o=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,n){var e=F(this),o=G(S(this,U));return o.ok="function"!=typeof t||t,o.fail="function"==typeof n&&n,o.domain=W?B.domain:void 0,e.parent=!0,e.reactions.push(o),0!=e.state&&Z(this,e,!1),o.promise},catch:function(t){return this.then(void 0,t)}}),r=function(){var t=new o,n=R(t);this.promise=t,this.resolve=et(rt,t,n),this.reject=et(ot,t,n)},P.f=G=function(t){return t===U||t===i?new r(t):$(t)},s||"function"!=typeof p||(c=p.prototype.then,f(p.prototype,"then",(function(t,n){var e=this;return new U((function(t,n){c.call(e,t,n)})).then(t,n)}),{unsafe:!0}),"function"==typeof z&&a({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return k(U,z.apply(u,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 n=G(this);return n.reject.call(void 0,t),n.promise}}),a({target:D,stat:!0,forced:s||J},{resolve:function(t){return k(s&&this===i?U:this,t)}}),a({target:D,stat:!0,forced:Y},{all:function(t){var n=this,e=G(n),o=e.resolve,r=e.reject,i=L((function(){var e=y(n.resolve),i=[],c=0,a=1;_(t,(function(t){var s=c++,u=!1;i.push(void 0),a++,e.call(n,t).then((function(t){u||(u=!0,i[s]=t,--a||o(i))}),r)})),--a||o(i)}));return i.error&&r(i.value),e.promise},race:function(t){var n=this,e=G(n),o=e.reject,r=L((function(){var r=y(n.resolve);_(t,(function(t){r.call(n,t).then(e.resolve,o)}))}));return r.error&&o(r.value),e.promise}})},function(t,n,e){var o=e(8);t.exports=function(t,n){if(!o(t))return t;var e,r;if(n&&"function"==typeof(e=t.toString)&&!o(r=e.call(t)))return r;if("function"==typeof(e=t.valueOf)&&!o(r=e.call(t)))return r;if(!n&&"function"==typeof(e=t.toString)&&!o(r=e.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},function(t,n,e){var o=e(9),r=e(3),i=e(23);t.exports=!o&&!r((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(t,n,e){var o=e(0),r=e(24),i=o["__core-js_shared__"]||r("__core-js_shared__",{});t.exports=i},function(t,n,e){var o=e(14),r=e(37);(t.exports=function(t,n){return r[t]||(r[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.5.0",mode:o?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,n){var e=0,o=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++e+o).toString(36)}},function(t,n,e){var o=e(5),r=e(19),i=e(67).indexOf,c=e(28);t.exports=function(t,n){var e,a=r(t),s=0,u=[];for(e in a)!o(c,e)&&o(a,e)&&u.push(e);for(;n.length>s;)o(a,e=n[s++])&&(~i(u,e)||u.push(e));return u}},function(t,n,e){var o=e(3),r=/#|\.prototype\./,i=function(t,n){var e=a[c(t)];return e==u||e!=s&&("function"==typeof n?o(n):!!n)},c=i.normalize=function(t){return String(t).replace(r,".").toLowerCase()},a=i.data={},s=i.NATIVE="N",u=i.POLYFILL="P";t.exports=i},function(t,n,e){var o=e(3);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){return!String(Symbol())}))},function(t,n,e){var o=e(20);t.exports=function(t,n,e){if(o(t),void 0===n)return t;switch(e){case 0:return function(){return t.call(n)};case 1:return function(e){return t.call(n,e)};case 2:return function(e,o){return t.call(n,e,o)};case 3:return function(e,o,r){return t.call(n,e,o,r)}}return function(){return t.apply(n,arguments)}}},function(t,n,e){var o=e(2),r=e(20),i=e(1)("species");t.exports=function(t,n){var e,c=o(t).constructor;return void 0===c||null==(e=o(c)[i])?n:r(e)}},function(t,n,e){var o,r,i,c=e(0),a=e(3),s=e(7),u=e(43),l=e(46),p=e(23),f=e(47),d=c.location,v=c.setImmediate,h=c.clearImmediate,m=c.process,y=c.MessageChannel,g=c.Dispatch,b=0,x={},_=function(t){if(x.hasOwnProperty(t)){var n=x[t];delete x[t],n()}},w=function(t){return function(){_(t)}},S=function(t){_(t.data)},O=function(t){c.postMessage(t+"",d.protocol+"//"+d.host)};v&&h||(v=function(t){for(var n=[],e=1;arguments.length>e;)n.push(arguments[e++]);return x[++b]=function(){("function"==typeof t?t:Function(t)).apply(void 0,n)},o(b),b},h=function(t){delete x[t]},"process"==s(m)?o=function(t){m.nextTick(w(t))}:g&&g.now?o=function(t){g.now(w(t))}:y&&!f?(i=(r=new y).port2,r.port1.onmessage=S,o=u(i.postMessage,i,1)):!c.addEventListener||"function"!=typeof postMessage||c.importScripts||a(O)?o="onreadystatechange"in p("script")?function(t){l.appendChild(p("script")).onreadystatechange=function(){l.removeChild(this),_(t)}}:function(t){setTimeout(w(t),0)}:(o=O,c.addEventListener("message",S,!1))),t.exports={set:v,clear:h}},function(t,n,e){var o=e(15);t.exports=o("document","documentElement")},function(t,n,e){var o=e(48);t.exports=/(iphone|ipod|ipad).*applewebkit/i.test(o)},function(t,n,e){var o=e(15);t.exports=o("navigator","userAgent")||""},function(t,n,e){"use strict";var o=e(20),r=function(t){var n,e;this.promise=new t((function(t,o){if(void 0!==n||void 0!==e)throw TypeError("Bad Promise constructor");n=t,e=o})),this.resolve=o(n),this.reject=o(e)};t.exports.f=function(t){return new r(t)}},function(t,n,e){var o=e(2),r=e(90),i=e(29),c=e(28),a=e(46),s=e(23),u=e(27)("IE_PROTO"),l=function(){},p=function(){var t,n=s("iframe"),e=i.length;for(n.style.display="none",a.appendChild(n),n.src=String("javascript:"),(t=n.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),p=t.F;e--;)delete p.prototype[i[e]];return p()};t.exports=Object.create||function(t,n){var e;return null!==t?(l.prototype=o(t),e=new l,l.prototype=null,e[u]=t):e=p(),void 0===n?e:r(e,n)},c[u]=!0},function(t,n,e){"use strict";var o,r,i,c=e(52),a=e(6),s=e(5),u=e(1),l=e(14),p=u("iterator"),f=!1;[].keys&&("next"in(i=[].keys())?(r=c(c(i)))!==Object.prototype&&(o=r):f=!0),null==o&&(o={}),l||s(o,p)||a(o,p,(function(){return this})),t.exports={IteratorPrototype:o,BUGGY_SAFARI_ITERATORS:f}},function(t,n,e){var o=e(5),r=e(53),i=e(27),c=e(94),a=i("IE_PROTO"),s=Object.prototype;t.exports=c?Object.getPrototypeOf:function(t){return t=r(t),o(t,a)?t[a]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,n,e){var o=e(4);t.exports=function(t){return Object(o(t))}},function(t,n,e){"use strict";var o=e(102).charAt;t.exports=function(t,n,e){return n+(e?o(t,n).length:1)}},function(t,n,e){"use strict";var o=e(31),r=e(56),i=e(2),c=e(4),a=e(44),s=e(54),u=e(16),l=e(33),p=e(32),f=e(3),d=[].push,v=Math.min,h=!f((function(){return!RegExp(4294967295,"y")}));o("split",2,(function(t,n,e){var o;return o="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,e){var o=String(c(this)),i=void 0===e?4294967295:e>>>0;if(0===i)return[];if(void 0===t)return[o];if(!r(t))return n.call(o,t,i);for(var a,s,u,l=[],f=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),v=0,h=new RegExp(t.source,f+"g");(a=p.call(h,o))&&!((s=h.lastIndex)>v&&(l.push(o.slice(v,a.index)),a.length>1&&a.index<o.length&&d.apply(l,a.slice(1)),u=a[0].length,v=s,l.length>=i));)h.lastIndex===a.index&&h.lastIndex++;return v===o.length?!u&&h.test("")||l.push(""):l.push(o.slice(v)),l.length>i?l.slice(0,i):l}:"0".split(void 0,0).length?function(t,e){return void 0===t&&0===e?[]:n.call(this,t,e)}:n,[function(n,e){var r=c(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,r,e):o.call(String(r),n,e)},function(t,r){var c=e(o,t,this,r,o!==n);if(c.done)return c.value;var p=i(t),f=String(this),d=a(p,RegExp),m=p.unicode,y=(p.ignoreCase?"i":"")+(p.multiline?"m":"")+(p.unicode?"u":"")+(h?"y":"g"),g=new d(h?p:"^(?:"+p.source+")",y),b=void 0===r?4294967295:r>>>0;if(0===b)return[];if(0===f.length)return null===l(g,f)?[f]:[];for(var x=0,_=0,w=[];_<f.length;){g.lastIndex=h?_:0;var S,O=l(g,h?f:f.slice(_));if(null===O||(S=v(u(g.lastIndex+(h?0:_)),f.length))===x)_=s(f,_,m);else{if(w.push(f.slice(x,_)),w.length===b)return w;for(var j=1;j<=O.length-1;j++)if(w.push(O[j]),w.length===b)return w;_=x=S}}return w.push(f.slice(x)),w}]}),!h)},function(t,n,e){var o=e(8),r=e(7),i=e(1)("match");t.exports=function(t){var n;return o(t)&&(void 0!==(n=t[i])?!!n:"RegExp"==r(t))}},function(t,n,e){var o=e(56);t.exports=function(t){if(o(t))throw TypeError("The method doesn't accept regular expressions");return t}},function(t,n,e){var o=e(1)("match");t.exports=function(t){var n=/./;try{"/./"[t](n)}catch(e){try{return n[o]=!1,"/./"[t](n)}catch(t){}}return!1}},function(t,n){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,n,e){"use strict";var o={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!o.call({1:2},1);n.f=i?function(t){var n=r(this,t);return!!n&&n.enumerable}:o},function(t,n,e){var o=e(3),r=e(7),i="".split;t.exports=o((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==r(t)?i.call(t,""):Object(t)}:Object},function(t,n,e){var o=e(0),r=e(25),i=o.WeakMap;t.exports="function"==typeof i&&/native code/.test(r(i))},function(t,n,e){var o=e(5),r=e(64),i=e(18),c=e(12);t.exports=function(t,n){for(var e=r(n),a=c.f,s=i.f,u=0;u<e.length;u++){var l=e[u];o(t,l)||a(t,l,s(n,l))}}},function(t,n,e){var o=e(15),r=e(66),i=e(69),c=e(2);t.exports=o("Reflect","ownKeys")||function(t){var n=r.f(c(t)),e=i.f;return e?n.concat(e(t)):n}},function(t,n,e){var o=e(0);t.exports=o},function(t,n,e){var o=e(40),r=e(29).concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return o(t,r)}},function(t,n,e){var o=e(19),r=e(16),i=e(68),c=function(t){return function(n,e,c){var a,s=o(n),u=r(s.length),l=i(c,u);if(t&&e!=e){for(;u>l;)if((a=s[l++])!=a)return!0}else for(;u>l;l++)if((t||l in s)&&s[l]===e)return t||l||0;return!t&&-1}};t.exports={includes:c(!0),indexOf:c(!1)}},function(t,n,e){var o=e(10),r=Math.max,i=Math.min;t.exports=function(t,n){var e=o(t);return e<0?r(e+n,0):i(e,n)}},function(t,n){n.f=Object.getOwnPropertySymbols},function(t,n,e){var o=e(0);t.exports=o.Promise},function(t,n,e){var o=e(13);t.exports=function(t,n,e){for(var r in n)o(t,r,n[r],e);return t}},function(t,n,e){var o=e(42);t.exports=o&&!Symbol.sham&&"symbol"==typeof Symbol()},function(t,n,e){"use strict";var o=e(15),r=e(12),i=e(1),c=e(9),a=i("species");t.exports=function(t){var n=o(t),e=r.f;c&&n&&!n[a]&&e(n,a,{configurable:!0,get:function(){return this}})}},function(t,n){t.exports=function(t,n,e){if(!(t instanceof n))throw TypeError("Incorrect "+(e?e+" ":"")+"invocation");return t}},function(t,n,e){var o=e(2),r=e(76),i=e(16),c=e(43),a=e(77),s=e(80),u=function(t,n){this.stopped=t,this.result=n};(t.exports=function(t,n,e,l,p){var f,d,v,h,m,y,g,b=c(n,e,l?2:1);if(p)f=t;else{if("function"!=typeof(d=a(t)))throw TypeError("Target is not iterable");if(r(d)){for(v=0,h=i(t.length);h>v;v++)if((m=l?b(o(g=t[v])[0],g[1]):b(t[v]))&&m instanceof u)return m;return new u(!1)}f=d.call(t)}for(y=f.next;!(g=y.call(f)).done;)if("object"==typeof(m=s(f,b,g.value,l))&&m&&m instanceof u)return m;return new u(!1)}).stop=function(t){return new u(!0,t)}},function(t,n,e){var o=e(1),r=e(17),i=o("iterator"),c=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||c[i]===t)}},function(t,n,e){var o=e(78),r=e(17),i=e(1)("iterator");t.exports=function(t){if(null!=t)return t[i]||t["@@iterator"]||r[o(t)]}},function(t,n,e){var o=e(79),r=e(7),i=e(1)("toStringTag"),c="Arguments"==r(function(){return arguments}());t.exports=o?r:function(t){var n,e,o;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=function(t,n){try{return t[n]}catch(t){}}(n=Object(t),i))?e:c?r(n):"Object"==(o=r(n))&&"function"==typeof n.callee?"Arguments":o}},function(t,n,e){var o={};o[e(1)("toStringTag")]="z",t.exports="[object z]"===String(o)},function(t,n,e){var o=e(2);t.exports=function(t,n,e,r){try{return r?n(o(e)[0],e[1]):n(e)}catch(n){var i=t.return;throw void 0!==i&&o(i.call(t)),n}}},function(t,n,e){var o=e(1)("iterator"),r=!1;try{var i=0,c={next:function(){return{done:!!i++}},return:function(){r=!0}};c[o]=function(){return this},Array.from(c,(function(){throw 2}))}catch(t){}t.exports=function(t,n){if(!n&&!r)return!1;var e=!1;try{var i={};i[o]=function(){return{next:function(){return{done:e=!0}}}},t(i)}catch(t){}return e}},function(t,n,e){var o,r,i,c,a,s,u,l,p=e(0),f=e(18).f,d=e(7),v=e(45).set,h=e(47),m=p.MutationObserver||p.WebKitMutationObserver,y=p.process,g=p.Promise,b="process"==d(y),x=f(p,"queueMicrotask"),_=x&&x.value;_||(o=function(){var t,n;for(b&&(t=y.domain)&&t.exit();r;){n=r.fn,r=r.next;try{n()}catch(t){throw r?c():i=void 0,t}}i=void 0,t&&t.enter()},b?c=function(){y.nextTick(o)}:m&&!h?(a=!0,s=document.createTextNode(""),new m(o).observe(s,{characterData:!0}),c=function(){s.data=a=!a}):g&&g.resolve?(u=g.resolve(void 0),l=u.then,c=function(){l.call(u,o)}):c=function(){v.call(p,o)}),t.exports=_||function(t){var n={fn:t,next:void 0};i&&(i.next=n),r||(r=n,c()),i=n}},function(t,n,e){var o=e(2),r=e(8),i=e(49);t.exports=function(t,n){if(o(t),r(n)&&n.constructor===t)return n;var e=i.f(t);return(0,e.resolve)(n),e.promise}},function(t,n,e){var o=e(0);t.exports=function(t,n){var e=o.console;e&&e.error&&(1===arguments.length?e.error(t):e.error(t,n))}},function(t,n){t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},function(t,n,e){var o,r,i=e(0),c=e(48),a=i.process,s=a&&a.versions,u=s&&s.v8;u?r=(o=u.split("."))[0]+o[1]:c&&(!(o=c.match(/Edge\/(\d+)/))||o[1]>=74)&&(o=c.match(/Chrome\/(\d+)/))&&(r=o[1]),t.exports=r&&+r},function(t,n){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,n,e){"use strict";var o=e(19),r=e(89),i=e(17),c=e(26),a=e(92),s=c.set,u=c.getterFor("Array Iterator");t.exports=a(Array,"Array",(function(t,n){s(this,{type:"Array Iterator",target:o(t),index:0,kind:n})}),(function(){var t=u(this),n=t.target,e=t.kind,o=t.index++;return!n||o>=n.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==e?{value:o,done:!1}:"values"==e?{value:n[o],done:!1}:{value:[o,n[o]],done:!1}}),"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(t,n,e){var o=e(1),r=e(50),i=e(6),c=o("unscopables"),a=Array.prototype;null==a[c]&&i(a,c,r(null)),t.exports=function(t){a[c][t]=!0}},function(t,n,e){var o=e(9),r=e(12),i=e(2),c=e(91);t.exports=o?Object.defineProperties:function(t,n){i(t);for(var e,o=c(n),a=o.length,s=0;a>s;)r.f(t,e=o[s++],n[e]);return t}},function(t,n,e){var o=e(40),r=e(29);t.exports=Object.keys||function(t){return o(t,r)}},function(t,n,e){"use strict";var o=e(11),r=e(93),i=e(52),c=e(95),a=e(30),s=e(6),u=e(13),l=e(1),p=e(14),f=e(17),d=e(51),v=d.IteratorPrototype,h=d.BUGGY_SAFARI_ITERATORS,m=l("iterator"),y=function(){return this};t.exports=function(t,n,e,l,d,g,b){r(e,n,l);var x,_,w,S=function(t){if(t===d&&P)return P;if(!h&&t in k)return k[t];switch(t){case"keys":case"values":case"entries":return function(){return new e(this,t)}}return function(){return new e(this)}},O=n+" Iterator",j=!1,k=t.prototype,E=k[m]||k["@@iterator"]||d&&k[d],P=!h&&E||S(d),L="Array"==n&&k.entries||E;if(L&&(x=i(L.call(new t)),v!==Object.prototype&&x.next&&(p||i(x)===v||(c?c(x,v):"function"!=typeof x[m]&&s(x,m,y)),a(x,O,!0,!0),p&&(f[O]=y))),"values"==d&&E&&"values"!==E.name&&(j=!0,P=function(){return E.call(this)}),p&&!b||k[m]===P||s(k,m,P),f[n]=P,d)if(_={values:S("values"),keys:g?P:S("keys"),entries:S("entries")},b)for(w in _)!h&&!j&&w in k||u(k,w,_[w]);else o({target:n,proto:!0,forced:h||j},_);return _}},function(t,n,e){"use strict";var o=e(51).IteratorPrototype,r=e(50),i=e(22),c=e(30),a=e(17),s=function(){return this};t.exports=function(t,n,e){var u=n+" Iterator";return t.prototype=r(o,{next:i(1,e)}),c(t,u,!1,!0),a[u]=s,t}},function(t,n,e){var o=e(3);t.exports=!o((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},function(t,n,e){var o=e(2),r=e(96);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,n=!1,e={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(e,[]),n=e instanceof Array}catch(t){}return function(e,i){return o(e),r(i),n?t.call(e,i):e.__proto__=i,e}}():void 0)},function(t,n,e){var o=e(8);t.exports=function(t){if(!o(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},function(t,n,e){"use strict";var o=e(11),r=e(10),i=e(98),c=e(99),a=e(3),s=1..toFixed,u=Math.floor,l=function(t,n,e){return 0===n?e:n%2==1?l(t,n-1,e*t):l(t*t,n/2,e)};o({target:"Number",proto:!0,forced:s&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!a((function(){s.call({})}))},{toFixed:function(t){var n,e,o,a,s=i(this),p=r(t),f=[0,0,0,0,0,0],d="",v="0",h=function(t,n){for(var e=-1,o=n;++e<6;)o+=t*f[e],f[e]=o%1e7,o=u(o/1e7)},m=function(t){for(var n=6,e=0;--n>=0;)e+=f[n],f[n]=u(e/t),e=e%t*1e7},y=function(){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==f[t]){var e=String(f[t]);n=""===n?e:n+c.call("0",7-e.length)+e}return n};if(p<0||p>20)throw RangeError("Incorrect fraction digits");if(s!=s)return"NaN";if(s<=-1e21||s>=1e21)return String(s);if(s<0&&(d="-",s=-s),s>1e-21)if(e=(n=function(t){for(var n=0,e=t;e>=4096;)n+=12,e/=4096;for(;e>=2;)n+=1,e/=2;return n}(s*l(2,69,1))-69)<0?s*l(2,-n,1):s/l(2,n,1),e*=4503599627370496,(n=52-n)>0){for(h(0,e),o=p;o>=7;)h(1e7,0),o-=7;for(h(l(10,o,1),0),o=n-1;o>=23;)m(1<<23),o-=23;m(1<<o),h(1,1),m(2),v=y()}else h(0,e),h(1<<-n,0),v=y()+c.call("0",p);return v=p>0?d+((a=v.length)<=p?"0."+c.call("0",p-a)+v:v.slice(0,a-p)+"."+v.slice(a-p)):d+v}})},function(t,n,e){var o=e(7);t.exports=function(t){if("number"!=typeof t&&"Number"!=o(t))throw TypeError("Incorrect invocation");return+t}},function(t,n,e){"use strict";var o=e(10),r=e(4);t.exports="".repeat||function(t){var n=String(r(this)),e="",i=o(t);if(i<0||i==1/0)throw RangeError("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(n+=n))1&i&&(e+=n);return e}},function(t,n,e){"use strict";var o=e(31),r=e(2),i=e(53),c=e(16),a=e(10),s=e(4),u=e(54),l=e(33),p=Math.max,f=Math.min,d=Math.floor,v=/\$([$&'`]|\d\d?|<[^>]*>)/g,h=/\$([$&'`]|\d\d?)/g;o("replace",2,(function(t,n,e){return[function(e,o){var r=s(this),i=null==e?void 0:e[t];return void 0!==i?i.call(e,r,o):n.call(String(r),e,o)},function(t,i){var s=e(n,t,this,i);if(s.done)return s.value;var d=r(t),v=String(this),h="function"==typeof i;h||(i=String(i));var m=d.global;if(m){var y=d.unicode;d.lastIndex=0}for(var g=[];;){var b=l(d,v);if(null===b)break;if(g.push(b),!m)break;""===String(b[0])&&(d.lastIndex=u(v,c(d.lastIndex),y))}for(var x,_="",w=0,S=0;S<g.length;S++){b=g[S];for(var O=String(b[0]),j=p(f(a(b.index),v.length),0),k=[],E=1;E<b.length;E++)k.push(void 0===(x=b[E])?x:String(x));var P=b.groups;if(h){var L=[O].concat(k,j,v);void 0!==P&&L.push(P);var C=String(i.apply(void 0,L))}else C=o(O,v,j,k,P,i);j>=w&&(_+=v.slice(w,j)+C,w=j+O.length)}return _+v.slice(w)}];function o(t,e,o,r,c,a){var s=o+t.length,u=r.length,l=h;return void 0!==c&&(c=i(c),l=v),n.call(a,l,(function(n,i){var a;switch(i.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,o);case"'":return e.slice(s);case"<":a=c[i.slice(1,-1)];break;default:var l=+i;if(0===l)return n;if(l>u){var p=d(l/10);return 0===p?n:p<=u?void 0===r[p-1]?i.charAt(1):r[p-1]+i.charAt(1):n}a=r[l-1]}return void 0===a?"":a}))}}))},function(t,n,e){"use strict";var o=e(2);t.exports=function(){var t=o(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.dotAll&&(n+="s"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n}},function(t,n,e){var o=e(10),r=e(4),i=function(t){return function(n,e){var i,c,a=String(r(n)),s=o(e),u=a.length;return s<0||s>=u?t?"":void 0:(i=a.charCodeAt(s))<55296||i>56319||s+1===u||(c=a.charCodeAt(s+1))<56320||c>57343?t?a.charAt(s):i:t?a.slice(s,s+2):c-56320+(i-55296<<10)+65536}};t.exports={codeAt:i(!1),charAt:i(!0)}},function(t,n,e){"use strict";var o=e(11),r=e(57),i=e(4);o({target:"String",proto:!0,forced:!e(58)("includes")},{includes:function(t){return!!~String(i(this)).indexOf(r(t),arguments.length>1?arguments[1]:void 0)}})},function(t,n,e){"use strict";var o=e(31),r=e(2),i=e(4),c=e(105),a=e(33);o("search",1,(function(t,n,e){return[function(n){var e=i(this),o=null==n?void 0:n[t];return void 0!==o?o.call(n,e):new RegExp(n)[t](String(e))},function(t){var o=e(n,t,this);if(o.done)return o.value;var i=r(t),s=String(this),u=i.lastIndex;c(u,0)||(i.lastIndex=0);var l=a(i,s);return c(i.lastIndex,u)||(i.lastIndex=u),null===l?-1:l.index}]}))},function(t,n){t.exports=Object.is||function(t,n){return t===n?0!==t||1/t==1/n:t!=t&&n!=n}},function(t,n,e){"use strict";var o,r=e(11),i=e(18).f,c=e(16),a=e(57),s=e(4),u=e(58),l=e(14),p="".startsWith,f=Math.min,d=u("startsWith");r({target:"String",proto:!0,forced:!!(l||d||(o=i(String.prototype,"startsWith"),!o||o.writable))&&!d},{startsWith:function(t){var n=String(s(this));a(t);var e=c(f(arguments.length>1?arguments[1]:void 0,n.length)),o=String(t);return p?p.call(n,o,e):n.slice(e,e+o.length)===o}})},function(t,n,e){"use strict";e.r(n);e(34),e(21);var o={get:(t="loop-onstore-data")=>JSON.parse(localStorage.getItem(t)||null),set(t,n="loop-onstore-data"){localStorage.setItem(n,JSON.stringify(t))},remove(t="loop-onstore-data"){localStorage.removeItem(t)}};function r(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,o)}return e}function i(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}let c={debug:!1,testMode:!1,redirect:!0,active:!1,params:null,key:null,api:null,token:null,id:null,fullPayload:!1,preserveCart:!1,draftOrderId:null,inExperiment:!1,singleItem:!1,attach:null};const a=t=>t?c[t]:c,s=(t,n)=>{c[t]=n,o.set(c)},u=()=>{const t=o.get();t&&(c=function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?r(Object(e),!0).forEach((function(n){i(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):r(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},c,{},t))};var l=new Proxy({},{get:(t,n)=>!t[n]&&a("debug")?t=>"string"==typeof t?console[n]("%c".concat(t),"color: #3256E6"):console[n](t):t[n]||function(){}});class p extends HTMLElement{constructor(){super()}connectedCallback(){var t;if(!LoopOnstore.isActive()||!a("inExperiment"))return;const n=a("attach");(null!==(t=document.querySelectorAll(n))&&void 0!==t?t:[]).forEach(t=>t.remove());const e=this.buildBtnContainer();this.attachShadow({mode:"open"}).appendChild(e)}buildBtnContainer(){const t=document.createElement("div");t.className="loop-onstore-btn-container",t.style="display:flex; flex-direction: column; gap: 1rem;";const n=this.buildCheckoutBtn(),e=this.buildAddMoreBtn();return t.appendChild(n),a("singleItem")||t.appendChild(e),t}buildAddMoreBtn(){const t=document.createElement("button");return t.textContent="Select more items to return",t.part="loop-onstore-add-more-btn",t.addEventListener("click",this.handleAddMore),t}buildCheckoutBtn(){const t=document.createElement("button");return t.textContent="Checkout",t.part="loop-onstore-checkout-btn",t.addEventListener("click",this.handleCheckout),t}handleCheckout(){LoopOnstore.submit()}handleAddMore(){LoopOnstore.submit(null,"lineItems")}}const f=t=>{if((t=>t instanceof HTMLElement||t instanceof Array&&t.some(t=>t instanceof HTMLElement))(t)){if(!(t instanceof Array))return[t];const n=t.filter(t=>t instanceof HTMLElement),e=t.filter(t=>!(t instanceof HTMLElement));return[...n,...document.querySelectorAll(e)]}return[...document.querySelectorAll(t)]},d=(t,n)=>{const e=f(t);return e.length>1&&l.warn("Attaching Loop.submit() to more than one element. Make sure you're using the right selector!"),e.forEach(t=>{t.addEventListener("click",n)}),customElements.get("loop-onstore")||customElements.define("loop-onstore",p),e};e(97),e(100),e(55);const v={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:"$"}},h=(t,n="USD")=>{if(!t)return"";const e=v[n];if(e){const{dollars:n,cents:o}=((t,n)=>{const[e,o]=Number.parseFloat(t/n.constant).toFixed(n.decimals).split(".");return{dollars:e?e.replace(/\B(?=(\d{3})+(?!\d))/g,n.thousandSymbol):"0",cents:o||""}})(t,e);return"".concat(e.symbol).concat(n).concat(e.decimalSymbol).concat(o)}return new Intl.NumberFormat("en-US",{style:"currency",currency:n}).format(t/e.constant)};function m(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,o)}return e}function y(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?m(Object(e),!0).forEach((function(n){g(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):m(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}function g(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}const b=()=>{var t;return null!==(t=a("api"))&&void 0!==t?t:"https://api.loopreturns.com/api/v1/"},x=t=>{const{token:n,total_discount:e,original_total_price:o,total_price:r,items:i,currency:c,items_subtotal_price:a,cart_level_discount_applications:s}=t;return(t=>{const n="object"==typeof t&&null!==t?JSON.stringify(t):String(t);return window.btoa(unescape(encodeURIComponent(n)))})({token:n,total_discount:e,original_total_price:o,total_price:r,items:i.map(t=>{const{id:n,quantity:e,variant_id:o,price:r,original_price:i,discounted_price:c,original_line_price:a,line_price:s,total_discount:u,final_price:l,final_line_price:p,taxable:f,product_id:d,discount_allocations:v,line_level_discount_allocations:h}=t;return{id:n,quantity:e,variant_id:o,price:r,original_price:i,discounted_price:c,original_line_price:a,line_price:s,total_discount:u,final_price:l,final_line_price:p,taxable:f,product_id:d,discount_allocations:v,line_level_discount_allocations:h}}),currency:c,items_subtotal_price:a,cart_level_discount_applications:s})},_=(t,n="GET",e)=>{const o=a("key");return new Promise(r=>{const i=null!=e?JSON.stringify(e):null;var c=new XMLHttpRequest;c.withCredentials=!0,c.addEventListener("readystatechange",(function(){this.readyState===this.DONE&&r(JSON.parse(this.responseText))})),c.open(n,t),""!==o&&c.setRequestHeader("x-authorization",o),c.setRequestHeader("content-type","application/json"),c.send(i)})},w=()=>{return _("/cart/clear.js","POST")};function S(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,o)}return e}function O(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}const j=(t,n)=>{l.info("Creating cart request..."),l.info("Syncing these variants to the Loop cart:"),l.info(t);const e=a("token");return e?((t,n,e)=>{const o=b(),r="".concat(o,"cart/").concat(t);let i={};return a("fullPayload")&&(i={shopify:x(e)}),_(r,"POST",y({cart:n,draftOrderId:a("draftOrderId")},i))})(e,t,n).then(t=>(function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?S(Object(e),!0).forEach((function(n){O(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):S(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t})({},t,{token:e})):((t,n)=>{const e=b(),o="".concat(e,"cart/");let r={};return a("fullPayload")&&(r={shopify:x(n)}),_(o,"POST",y({cart:t,draftOrderId:a("draftOrderId")},r))})(t,n)};e(103),e(104),e(106);function k(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,o)}return e}function E(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}const P=t=>{const n=Number(t);return Number.isNaN(n)?t:n};var L={get:(t=window.location.search)=>t.substr(1).split("&").reduce((t,n)=>{const[e,o]=decodeURIComponent(n).split("=");return function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?k(Object(e),!0).forEach((function(n){E(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):k(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},t,{[e]:P(o)})},{}),hasLoopData:(t=window.location.search)=>t.includes("loop_total"),getKeys:(t,n="loop")=>Object.keys(t).filter(t=>t.startsWith(n)),clear(t=[]){const n=Object.entries(this.get()).reduce((n,[e,o])=>{if(t.includes(e))return n;const r=n.length?"&":"?";return"".concat(n).concat(r).concat(encodeURIComponent(e),"=").concat(encodeURIComponent(o))},"");window.history.replaceState({},"","".concat(window.location.origin).concat(window.location.pathname).concat(n))}};const C={credit:{container:".loop-onstore__credit",amount:".loop-onstore__credit-amount"},percentDiscount:{container:".loop-onstore__percent-discount",amount:".loop-onstore__percent-discount-amount"}};var T=(t,n={})=>{if(t)return t;const e=((t={})=>{const n=document.createElement("div");return n.classList.add("loop-onstore"),n.id="loop-onstore",n.innerHTML='\n <div class="loop-onstore__percent-discount">\n <span class="loop-onstore__percent-discount-amount"></span>\n <span class="loop-onstore__copy loop-onstore__percent-discount-copy">\n applied at checkout\n </span>\n </div>\n <div class="loop-onstore__credit">\n <span class="loop-onstore__amount loop-onstore__credit-amount"></span>\n <span class="loop-onstore__copy loop-onstore__credit-copy">\n in available credit\n </span>\n <span class="loop-onstore__copy loop-onstore__mobile-credit-copy">\n credit\n </span>\n </div>\n <button class="loop-onstore__back" onClick="LoopOnstore.backToLoop()">\n <svg \n class="loop-onstore__back-icon"\n width="16"\n height="16"\n viewBox="0 0 16 16"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path d="M12.6667 8H3.33333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M8 12.6666L3.33333 7.99998L8 3.33331" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n </svg> \n <span>Go back</span>\n </button>\n\n',Object.keys(t).forEach(e=>{const o=t[e],r=C[e];if(r&&o){const t=n.querySelector(r.container);if(t){t.style.display="flex";const n=t.querySelector(r.amount);n&&o.amount&&(n.textContent=o.amount)}}}),n})(n);return document.body.appendChild(e)};e.d(n,"init",(function(){return M})),e.d(n,"testMode",(function(){return A})),e.d(n,"submit",(function(){return N})),e.d(n,"attach",(function(){return F})),e.d(n,"debug",(function(){return D})),e.d(n,"setKey",(function(){return R})),e.d(n,"backToLoop",(function(){return U})),e.d(n,"isActive",(function(){return H}));const I={bar:null,attached:[]},M=async t=>{if(u(),null==t?void 0:t.key)R(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,".")),s("api",t.api)),(null==t?void 0:t.preserveCart)&&(l.info("Setting preserve cart to ".concat(t.preserveCart)),s("preserveCart",t.preserveCart));const n=L.get();if(L.hasLoopData()){var e,o;a("id")!==n.loop_return_id&&s("token",null),s("params",n),s("id",n.loop_return_id),s("inExperiment",null!==(e=Boolean("true"===(null==n?void 0:n.loop_experiment_b_eligible)))&&void 0!==e&&e),s("singleItem",null!==(o=null==n?void 0:n.loop_single_item_eligible)&&void 0!==o&&o),a("inExperiment")&&s("preserveCart",!0),L.clear(L.getKeys(n)),await w();const t=a("token");if(t)try{const{cart:n}=await(t=>{const n=b(),e="".concat(n,"cart/").concat(t);return _(e)})(t);await(t=>{const n=t.reduce((t,n)=>t[n]?y({},t,{[n]:t[n]+1}):y({},t,{[n]:1}),{});return _("/cart/update.js","POST",{updates:n})})(n),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 r=a("params");if(r){var i,c;s("active",!0),document.body.classList.add("loop-returns-activated");const t={};null!==(i=r.loop_total)&&void 0!==i&&i&&(t.credit={amount:h(r.loop_total,r.loop_currency)}),null!==(c=r.loop_discount_percentage)&&void 0!==c&&c&&(t.percentDiscount={amount:r.loop_discount_percentage+"% off"});const n=T(null,t);(()=>{const t=document.createElement("style");t.type="text/css",t.innerText="\n:root {\n --loop-primary-color: #030712;\n --loop-text-color: white;\n --loop-badge-background: #F9FAFB;\n --loop-badge-text: #374151;\n --loop-button-background: white;\n --loop-button-text: #1F2937;\n --loop-button-border: #D1D5DB;\n \n --loop-onstore-button-padding: 14px 16px;\n --loop-onstore-checkout-background: #030712;\n --loop-onstore-checkout-text-color: white;\n --loop-onstore-button-radius: 0;\n --loop-onstore-button-gap: 0.25rem;\n --loop-onstore-add-more-background: white;\n --loop-onstore-add-more-text-color: black;\n --loop-onstore-add-more-border: black;\n --loop-onstore-casing: uppercase;\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 justify-content: space-between;\n top: auto !important;\n bottom: 0 !important;\n left: 0;\n z-index: 2147483647;\n background-color: var(--loop-primary-color);\n color: var(--loop-text-color);\n font-family: 'SF Pro Text', untitled sans, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji' !important;\n transform: translateY(100%);\n transition: transform .2s;\n font-size: 0.875rem;\n font-style: normal;\n font-weight: 400;\n line-height: 150%;\n padding: 1rem 1.5rem;\n}\n.loop-onstore *, .loop-onstore *::before, .loop-onstore *::after {\n box-sizing: inherit;\n}\n.loop-onstore__credit {\n display: none;\n align-items: flex-start;\n gap: 0.25rem;\n}\n.loop-onstore__credit-amount {\n font-weight: 600;\n}\n.loop-onstore__mobile-credit-copy {\n display: none;\n}\n.loop-onstore__percent-discount {\n display: none;\n align-items: flex-start;\n gap: 0.5rem; \n}\n.loop-onstore__percent-discount-amount {\n display: flex;\n padding: 0.125rem 0.5rem;\n justify-content: center;\n align-items: center;\n gap: 0.375rem;\n border-radius: 100px;\n background: var(--loop-badge-background);\n font-weight: 600;\n font-size: 0.75rem;\n color: var(--loop-badge-text);\n}\n.loop-onstore__percent-discount-copy {\n text-align: center;\n}\n.loop-onstore__back {\n color: var(--loop-button-text);\n background: var(--loop-button-background);\n border: none;\n appearance: none;\n transition: all .2s;\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.5rem;\n border-radius: 0.5rem;\n border: 1px solid var(--loop-button-border);\n display: flex;\n padding: 0.5rem 1rem;\n align-items: center;\n gap: 0.25rem; \n cursor: pointer;\n}\n.loop-onstore__back:hover {\n opacity: .7;\n}\n.loop-onstore__back-icon path {\n stroke: var(--loop-button-text); \n}\n\n.loop-returns-modal {\n font-family: 'SF Pro Text', untitled sans,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji !important;\n -moz-osx-font-smoothing: grayscale;\n -webkit-font-smoothing: antialiased;\n font-style: normal;\n display: flex;\n justify-content: center;\n align-items: center;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 999;\n }\n\n .loop-returns-modal__backdrop{\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(65, 69, 74, 0.7);\n }\n\n .loop-returns-modal__content {\n overflow: auto;\n max-height: 600px;\n background-color: #fff;\n box-shadow: 0px 1px 4px rgb(0 0 0 / 12%), 0px 6px 12px rgb(0 0 0 / 8%);\n border-radius: 8px;\n width: 500px;\n max-width: 700px;\n position: relative;\n z-index: 1000;\n }\n\n .loop-returns-modal__header {\n color: #3256E5;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 15px 20px;\n border-bottom: 1px solid #EAEAEA;\n font-size: 1.25rem;\n font-weight: 500;\n }\n\n .loop-returns-modal__close--icon {\n height: 20px;\n width: 20px;\n cursor: pointer;\n }\n\n .loop-returns-modal__body {\n padding: 20px;\n }\n\n loop-onstore {\n flex: 1;\n }\n\n loop-onstore::part(loop-onstore-checkout-btn) {\n padding: var(--loop-onstore-button-padding);\n background: var(--loop-primary-color);\n color: var(--loop-onstore-checkout-text-color);\n border-radius: var(--loop-onstore-button-radius);\n cursor: pointer;\n font-weight: 500;\n text-transform: var(--loop-onstore-casing);\n }\n\n loop-onstore::part(loop-onstore-add-more-btn) {\n padding: var(--loop-onstore-button-padding);\n background: transparent;\n border: 1px solid var(--loop-onstore-add-more-border);\n border-radius: var(--loop-onstore-button-radius);\n color: var(--loop-onstore-add-more-text-color);\n cursor: pointer;\n font-weight: 500;\n text-transform: var(--loop-onstore-casing);\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__mobile-credit-copy {\n display: block;\n }\n .loop-onstore__credit-copy {\n display: none;\n }\n .loop-onstore__percent-discount-copy {\n display: none;\n }\n .loop-onstore__back {\n font-size: 0.875rem;\n line-height: 1.25rem;\n }\n}\n",document.head.appendChild(t)})(),I.bar=n,l.info("Loop returns activated"),document.dispatchEvent(new Event("Loop:Activated"))}(null==t?void 0:t.attach)&&(s("attach",null==t?void 0:t.attach),F(t.attach)),(null==t?void 0:t.full)&&s("fullPayload",null==t?void 0:t.full)},A=(t=!0)=>{s("debug",!0),s("testMode",!0),l.info("Test mode activated"),s("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_discount_percentage=25&loop_base=799&loop_credit=500&loop_subdomain=example&loop_redirect_url=example.loopreturns.com%2F%23%2Fcredit&loop_customer_name=Jane%20Doe")},D=()=>{const t=!a("debug");return s("debug",t),"Debug ".concat(t?"on":"off")},R=t=>{if(!t||"string"!=typeof t)return console.error("Your api key is either undefined or not a string.");s("key",t),l.info("Loop Returns on-store API key set.")},N=async(t,n=null)=>{let e=null;t||(l.info("Requesting updated cart from Shopify"),e=await _("/cart.js"),t=e.items.reduce((t,n)=>[...t,...Array(n.quantity).fill(n.variant_id)],[]));try{var o;if(window.stackableService&&"function"==typeof(null===(o=window.stackableService)||void 0===o?void 0:o.send)){window.stackableService.send({type:"checkout",data:{preventRedirect:!0}});let t=0;await(async()=>await new Promise(n=>{const e=setInterval(()=>{(window.stackableService.state.context.draftOrderId||6===t)&&(n(),clearInterval(e)),t++},500)}))(),s("draftOrderId",window.stackableService.state.context.draftOrderId)}const r=await j(t,e);return s("token",r.token),a("preserveCart")||await w(),U(r.token,n),Promise.resolve(r.token)}catch(t){return l.info("Unable to create Loop Returns cart:"),l.error(t),Promise.reject(t)}},F=t=>{if(a("active")){l.info('Loop attaching to: "'.concat(t,'"'));const n=async t=>{if(a("active")){t.stopImmediatePropagation(),t.preventDefault(),t.target.disabled=!0,t.target.classList.add("loop-activated");try{await N(),t.target.disabled=!1,t.target.classList.remove("loop-activated")}catch(n){t.target.disabled=!1,t.target.classList.remove("loop-activated")}}};I.attached=d(t,n),new MutationObserver(e=>{const o=((t,n)=>t.filter(t=>t[n].length).reduce((t,e)=>[...t,...e[n]],[]))(e,"addedNodes");let r=t;if(t instanceof HTMLElement&&(r=[]),t instanceof Array&&(r=t.filter(t=>!(t instanceof HTMLElement))),o.length){o.some(t=>{var n;return!(null===(n=r)||void 0===n||!n.length)&&(t&&1===t.nodeType&&(t.matches(r)||(null==t?void 0:t.querySelector(r))))})&&(((t,n)=>{t.forEach(t=>{t.removeEventListener("click",n)})})(I.attached,n),I.attached=d(t,n),l.info('Loop reattached to: "'.concat(t,'"')))}}).observe(document.body,{childList:!0,subtree:!0})}},U=(t,n=null)=>{const e=a("testMode");s("active",!1);const o=a("params");let r="http://".concat(o.loop_redirect_url);if(t&&o.loop_return_key?r="http://".concat(o.loop_domain,"/#/cart/v2/").concat(t,"/").concat(o.loop_return_key):t&&(r="http://".concat(o.loop_domain,"/#/cart/v2/").concat(t).concat(n?"?to="+n:"")),s("params",null),l.info("Redirecting to:"),l.info(r),document.dispatchEvent(new Event("Loop:Back To Loop")),e)return(()=>{document.body.style.overflow="hidden";const t=document.createElement("div");t.classList.add("loop-returns-modal"),t.innerHTML='\n <div class="loop-returns-modal">\n <div class="loop-returns-modal__backdrop"></div>\n <div class="loop-returns-modal__content">\n <div class="loop-returns-modal__header">\n <div class="loop-returns-modal__text">Loop Onstore Installed</div>\n <div class="loop-returns-modal__close">\n <svg class="loop-returns-modal__close--icon width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M0 7.50024C0 3.36474 3.3645 0.000244141 7.5 0.000244141C11.6355 0.000244141 15 3.36474 15 7.50024C15 11.6357 11.6355 15.0002 7.5 15.0002C3.3645 15.0002 0 11.6357 0 7.50024ZM5.78025 4.71999C5.6388 4.58338 5.44935 4.50778 5.2527 4.50949C5.05605 4.5112 4.86794 4.59007 4.72889 4.72913C4.58983 4.86819 4.51095 5.0563 4.50924 5.25294C4.50754 5.44959 4.58313 5.63904 4.71975 5.78049L6.4395 7.50024L4.71975 9.21999C4.64812 9.28918 4.59098 9.37194 4.55167 9.46344C4.51237 9.55494 4.49168 9.65336 4.49081 9.75294C4.48995 9.85253 4.50892 9.95129 4.54663 10.0435C4.58434 10.1356 4.64003 10.2194 4.71045 10.2898C4.78087 10.3602 4.86461 10.4159 4.95678 10.4536C5.04896 10.4913 5.14772 10.5103 5.2473 10.5094C5.34689 10.5086 5.4453 10.4879 5.5368 10.4486C5.62831 10.4093 5.71106 10.3521 5.78025 10.2805L7.5 8.56074L9.21975 10.2805C9.3612 10.4171 9.55065 10.4927 9.7473 10.491C9.94395 10.4893 10.1321 10.4104 10.2711 10.2714C10.4102 10.1323 10.489 9.94419 10.4908 9.74754C10.4925 9.5509 10.4169 9.36145 10.2802 9.21999L8.5605 7.50024L10.2802 5.78049C10.4169 5.63904 10.4925 5.44959 10.4908 5.25294C10.489 5.0563 10.4102 4.86819 10.2711 4.72913C10.1321 4.59007 9.94395 4.5112 9.7473 4.50949C9.55065 4.50778 9.3612 4.58338 9.21975 4.71999L7.5 6.43974L5.78025 4.71999Z"\n fill="black" />\n </svg>\n </div>\n </div>\n <div class="loop-returns-modal__body">\n Test Mode Successful\n </div>\n </div>\n </div>\n </div>',document.body.appendChild(t);const n=document.querySelector(".loop-returns-modal__close"),e=document.querySelector(".loop-returns-modal__backdrop"),o=n=>{"Escape"===n.key&&(t.remove(),document.removeEventListener("keydown",o))};document.addEventListener("keydown",o),null==n||n.addEventListener("click",()=>{t.remove(),document.removeEventListener("keydown",o),document.body.style.overflow="auto"}),null==e||e.addEventListener("click",()=>{t.remove(),document.removeEventListener("keydown",o),document.body.style.overflow="auto"})})(),void s("testMode",!1);a("redirect")&&(window.location.href=r)},H=()=>a("active")}])}));
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.LoopOnstore=n():t.LoopOnstore=n()}(window,(function(){return function(t){var n={};function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}return e.m=t,e.c=n,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:o})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(e.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var r in t)e.d(o,r,function(n){return t[n]}.bind(null,r));return o},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=107)}([function(t,n,e){(function(n){var e=function(t){return t&&t.Math==Math&&t};t.exports=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof n&&n)||Function("return this")()}).call(this,e(59))},function(t,n,e){var o=e(0),r=e(38),i=e(5),c=e(39),a=e(42),s=e(72),u=r("wks"),l=o.Symbol,p=s?l:c;t.exports=function(t){return i(u,t)||(a&&i(l,t)?u[t]=l[t]:u[t]=p("Symbol."+t)),u[t]}},function(t,n,e){var o=e(8);t.exports=function(t){if(!o(t))throw TypeError(String(t)+" is not an object");return t}},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},function(t,n,e){var o=e(9),r=e(12),i=e(22);t.exports=o?function(t,n,e){return r.f(t,n,i(1,e))}:function(t,n,e){return t[n]=e,t}},function(t,n){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,e){var o=e(3);t.exports=!o((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,n){var e=Math.ceil,o=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?o:e)(t)}},function(t,n,e){var o=e(0),r=e(18).f,i=e(6),c=e(13),a=e(24),s=e(63),u=e(41);t.exports=function(t,n){var e,l,p,f,d,v=t.target,h=t.global,m=t.stat;if(e=h?o:m?o[v]||a(v,{}):(o[v]||{}).prototype)for(l in n){if(f=n[l],p=t.noTargetGet?(d=r(e,l))&&d.value:e[l],!u(h?l:v+(m?".":"#")+l,t.forced)&&void 0!==p){if(typeof f==typeof p)continue;s(f,p)}(t.sham||p&&p.sham)&&i(f,"sham",!0),c(e,l,f,t)}}},function(t,n,e){var o=e(9),r=e(36),i=e(2),c=e(35),a=Object.defineProperty;n.f=o?a:function(t,n,e){if(i(t),n=c(n,!0),i(e),r)try{return a(t,n,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported");return"value"in e&&(t[n]=e.value),t}},function(t,n,e){var o=e(0),r=e(6),i=e(5),c=e(24),a=e(25),s=e(26),u=s.get,l=s.enforce,p=String(String).split("String");(t.exports=function(t,n,e,a){var s=!!a&&!!a.unsafe,u=!!a&&!!a.enumerable,f=!!a&&!!a.noTargetGet;"function"==typeof e&&("string"!=typeof n||i(e,"name")||r(e,"name",n),l(e).source=p.join("string"==typeof n?n:"")),t!==o?(s?!f&&t[n]&&(u=!0):delete t[n],u?t[n]=e:r(t,n,e)):u?t[n]=e:c(n,e)})(Function.prototype,"toString",(function(){return"function"==typeof this&&u(this).source||a(this)}))},function(t,n){t.exports=!1},function(t,n,e){var o=e(65),r=e(0),i=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,n){return arguments.length<2?i(o[t])||i(r[t]):o[t]&&o[t][n]||r[t]&&r[t][n]}},function(t,n,e){var o=e(10),r=Math.min;t.exports=function(t){return t>0?r(o(t),9007199254740991):0}},function(t,n){t.exports={}},function(t,n,e){var o=e(9),r=e(60),i=e(22),c=e(19),a=e(35),s=e(5),u=e(36),l=Object.getOwnPropertyDescriptor;n.f=o?l:function(t,n){if(t=c(t),n=a(n,!0),u)try{return l(t,n)}catch(t){}if(s(t,n))return i(!r.f.call(t,n),t[n])}},function(t,n,e){var o=e(61),r=e(4);t.exports=function(t){return o(r(t))}},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,n,e){var o=e(0),r=e(87),i=e(88),c=e(6),a=e(1),s=a("iterator"),u=a("toStringTag"),l=i.values;for(var p in r){var f=o[p],d=f&&f.prototype;if(d){if(d[s]!==l)try{c(d,s,l)}catch(t){d[s]=l}if(d[u]||c(d,u,p),r[p])for(var v in i)if(d[v]!==i[v])try{c(d,v,i[v])}catch(t){d[v]=i[v]}}}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,e){var o=e(0),r=e(8),i=o.document,c=r(i)&&r(i.createElement);t.exports=function(t){return c?i.createElement(t):{}}},function(t,n,e){var o=e(0),r=e(6);t.exports=function(t,n){try{r(o,t,n)}catch(e){o[t]=n}return n}},function(t,n,e){var o=e(37),r=Function.toString;"function"!=typeof o.inspectSource&&(o.inspectSource=function(t){return r.call(t)}),t.exports=o.inspectSource},function(t,n,e){var o,r,i,c=e(62),a=e(0),s=e(8),u=e(6),l=e(5),p=e(27),f=e(28),d=a.WeakMap;if(c){var v=new d,h=v.get,m=v.has,y=v.set;o=function(t,n){return y.call(v,t,n),n},r=function(t){return h.call(v,t)||{}},i=function(t){return m.call(v,t)}}else{var g=p("state");f[g]=!0,o=function(t,n){return u(t,g,n),n},r=function(t){return l(t,g)?t[g]:{}},i=function(t){return l(t,g)}}t.exports={set:o,get:r,has:i,enforce:function(t){return i(t)?r(t):o(t,{})},getterFor:function(t){return function(n){var e;if(!s(n)||(e=r(n)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return e}}}},function(t,n,e){var o=e(38),r=e(39),i=o("keys");t.exports=function(t){return i[t]||(i[t]=r(t))}},function(t,n){t.exports={}},function(t,n){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,n,e){var o=e(12).f,r=e(5),i=e(1)("toStringTag");t.exports=function(t,n,e){t&&!r(t=e?t:t.prototype,i)&&o(t,i,{configurable:!0,value:n})}},function(t,n,e){"use strict";var o=e(6),r=e(13),i=e(3),c=e(1),a=e(32),s=c("species"),u=!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=/(?:)/,n=t.exec;t.exec=function(){return n.apply(this,arguments)};var e="ab".split(t);return 2!==e.length||"a"!==e[0]||"b"!==e[1]}));t.exports=function(t,n,e,p){var f=c(t),d=!i((function(){var n={};return n[f]=function(){return 7},7!=""[t](n)})),v=d&&!i((function(){var n=!1,e=/a/;return"split"===t&&((e={}).constructor={},e.constructor[s]=function(){return e},e.flags="",e[f]=/./[f]),e.exec=function(){return n=!0,null},e[f](""),!n}));if(!d||!v||"replace"===t&&!u||"split"===t&&!l){var h=/./[f],m=e(f,""[t],(function(t,n,e,o,r){return n.exec===a?d&&!r?{done:!0,value:h.call(n,e,o)}:{done:!0,value:t.call(e,n,o)}:{done:!1}})),y=m[0],g=m[1];r(String.prototype,t,y),r(RegExp.prototype,f,2==n?function(t,n){return g.call(t,this,n)}:function(t){return g.call(t,this)}),p&&o(RegExp.prototype[f],"sham",!0)}}},function(t,n,e){"use strict";var o,r,i=e(101),c=RegExp.prototype.exec,a=String.prototype.replace,s=c,u=(o=/a/,r=/b*/g,c.call(o,"a"),c.call(r,"a"),0!==o.lastIndex||0!==r.lastIndex),l=void 0!==/()??/.exec("")[1];(u||l)&&(s=function(t){var n,e,o,r,s=this;return l&&(e=new RegExp("^"+s.source+"$(?!\\s)",i.call(s))),u&&(n=s.lastIndex),o=c.call(s,t),u&&o&&(s.lastIndex=s.global?o.index+o[0].length:n),l&&o&&o.length>1&&a.call(o[0],e,(function(){for(r=1;r<arguments.length-2;r++)void 0===arguments[r]&&(o[r]=void 0)})),o}),t.exports=s},function(t,n,e){var o=e(7),r=e(32);t.exports=function(t,n){var e=t.exec;if("function"==typeof e){var i=e.call(t,n);if("object"!=typeof i)throw TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==o(t))throw TypeError("RegExp#exec called on incompatible receiver");return r.call(t,n)}},function(t,n,e){"use strict";var o,r,i,c,a=e(11),s=e(14),u=e(0),l=e(15),p=e(70),f=e(13),d=e(71),v=e(30),h=e(73),m=e(8),y=e(20),g=e(74),b=e(7),x=e(25),_=e(75),w=e(81),S=e(44),O=e(45).set,j=e(82),k=e(83),E=e(84),P=e(49),L=e(85),C=e(26),T=e(41),I=e(1),M=e(86),A=I("species"),D="Promise",R=C.get,N=C.set,F=C.getterFor(D),U=p,H=u.TypeError,q=u.document,B=u.process,z=l("fetch"),G=P.f,$=G,W="process"==b(B),V=!!(q&&q.createEvent&&u.dispatchEvent),J=T(D,(function(){if(!(x(U)!==String(U))){if(66===M)return!0;if(!W&&"function"!=typeof PromiseRejectionEvent)return!0}if(s&&!U.prototype.finally)return!0;if(M>=51&&/native code/.test(U))return!1;var t=U.resolve(1),n=function(t){t((function(){}),(function(){}))};return(t.constructor={})[A]=n,!(t.then((function(){}))instanceof n)})),Y=J||!w((function(t){U.all(t).catch((function(){}))})),K=function(t){var n;return!(!m(t)||"function"!=typeof(n=t.then))&&n},Z=function(t,n,e){if(!n.notified){n.notified=!0;var o=n.reactions;j((function(){for(var r=n.value,i=1==n.state,c=0;o.length>c;){var a,s,u,l=o[c++],p=i?l.ok:l.fail,f=l.resolve,d=l.reject,v=l.domain;try{p?(i||(2===n.rejection&&nt(t,n),n.rejection=1),!0===p?a=r:(v&&v.enter(),a=p(r),v&&(v.exit(),u=!0)),a===l.promise?d(H("Promise-chain cycle")):(s=K(a))?s.call(a,f,d):f(a)):d(r)}catch(t){v&&!u&&v.exit(),d(t)}}n.reactions=[],n.notified=!1,e&&!n.rejection&&Q(t,n)}))}},X=function(t,n,e){var o,r;V?((o=q.createEvent("Event")).promise=n,o.reason=e,o.initEvent(t,!1,!0),u.dispatchEvent(o)):o={promise:n,reason:e},(r=u["on"+t])?r(o):"unhandledrejection"===t&&E("Unhandled promise rejection",e)},Q=function(t,n){O.call(u,(function(){var e,o=n.value;if(tt(n)&&(e=L((function(){W?B.emit("unhandledRejection",o,t):X("unhandledrejection",t,o)})),n.rejection=W||tt(n)?2:1,e.error))throw e.value}))},tt=function(t){return 1!==t.rejection&&!t.parent},nt=function(t,n){O.call(u,(function(){W?B.emit("rejectionHandled",t):X("rejectionhandled",t,n.value)}))},et=function(t,n,e,o){return function(r){t(n,e,r,o)}},ot=function(t,n,e,o){n.done||(n.done=!0,o&&(n=o),n.value=e,n.state=2,Z(t,n,!0))},rt=function(t,n,e,o){if(!n.done){n.done=!0,o&&(n=o);try{if(t===e)throw H("Promise can't be resolved itself");var r=K(e);r?j((function(){var o={done:!1};try{r.call(e,et(rt,t,o,n),et(ot,t,o,n))}catch(e){ot(t,o,e,n)}})):(n.value=e,n.state=1,Z(t,n,!1))}catch(e){ot(t,{done:!1},e,n)}}};J&&(U=function(t){g(this,U,D),y(t),o.call(this);var n=R(this);try{t(et(rt,this,n),et(ot,this,n))}catch(t){ot(this,n,t)}},(o=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,n){var e=F(this),o=G(S(this,U));return o.ok="function"!=typeof t||t,o.fail="function"==typeof n&&n,o.domain=W?B.domain:void 0,e.parent=!0,e.reactions.push(o),0!=e.state&&Z(this,e,!1),o.promise},catch:function(t){return this.then(void 0,t)}}),r=function(){var t=new o,n=R(t);this.promise=t,this.resolve=et(rt,t,n),this.reject=et(ot,t,n)},P.f=G=function(t){return t===U||t===i?new r(t):$(t)},s||"function"!=typeof p||(c=p.prototype.then,f(p.prototype,"then",(function(t,n){var e=this;return new U((function(t,n){c.call(e,t,n)})).then(t,n)}),{unsafe:!0}),"function"==typeof z&&a({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return k(U,z.apply(u,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 n=G(this);return n.reject.call(void 0,t),n.promise}}),a({target:D,stat:!0,forced:s||J},{resolve:function(t){return k(s&&this===i?U:this,t)}}),a({target:D,stat:!0,forced:Y},{all:function(t){var n=this,e=G(n),o=e.resolve,r=e.reject,i=L((function(){var e=y(n.resolve),i=[],c=0,a=1;_(t,(function(t){var s=c++,u=!1;i.push(void 0),a++,e.call(n,t).then((function(t){u||(u=!0,i[s]=t,--a||o(i))}),r)})),--a||o(i)}));return i.error&&r(i.value),e.promise},race:function(t){var n=this,e=G(n),o=e.reject,r=L((function(){var r=y(n.resolve);_(t,(function(t){r.call(n,t).then(e.resolve,o)}))}));return r.error&&o(r.value),e.promise}})},function(t,n,e){var o=e(8);t.exports=function(t,n){if(!o(t))return t;var e,r;if(n&&"function"==typeof(e=t.toString)&&!o(r=e.call(t)))return r;if("function"==typeof(e=t.valueOf)&&!o(r=e.call(t)))return r;if(!n&&"function"==typeof(e=t.toString)&&!o(r=e.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},function(t,n,e){var o=e(9),r=e(3),i=e(23);t.exports=!o&&!r((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(t,n,e){var o=e(0),r=e(24),i=o["__core-js_shared__"]||r("__core-js_shared__",{});t.exports=i},function(t,n,e){var o=e(14),r=e(37);(t.exports=function(t,n){return r[t]||(r[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.5.0",mode:o?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,n){var e=0,o=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++e+o).toString(36)}},function(t,n,e){var o=e(5),r=e(19),i=e(67).indexOf,c=e(28);t.exports=function(t,n){var e,a=r(t),s=0,u=[];for(e in a)!o(c,e)&&o(a,e)&&u.push(e);for(;n.length>s;)o(a,e=n[s++])&&(~i(u,e)||u.push(e));return u}},function(t,n,e){var o=e(3),r=/#|\.prototype\./,i=function(t,n){var e=a[c(t)];return e==u||e!=s&&("function"==typeof n?o(n):!!n)},c=i.normalize=function(t){return String(t).replace(r,".").toLowerCase()},a=i.data={},s=i.NATIVE="N",u=i.POLYFILL="P";t.exports=i},function(t,n,e){var o=e(3);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){return!String(Symbol())}))},function(t,n,e){var o=e(20);t.exports=function(t,n,e){if(o(t),void 0===n)return t;switch(e){case 0:return function(){return t.call(n)};case 1:return function(e){return t.call(n,e)};case 2:return function(e,o){return t.call(n,e,o)};case 3:return function(e,o,r){return t.call(n,e,o,r)}}return function(){return t.apply(n,arguments)}}},function(t,n,e){var o=e(2),r=e(20),i=e(1)("species");t.exports=function(t,n){var e,c=o(t).constructor;return void 0===c||null==(e=o(c)[i])?n:r(e)}},function(t,n,e){var o,r,i,c=e(0),a=e(3),s=e(7),u=e(43),l=e(46),p=e(23),f=e(47),d=c.location,v=c.setImmediate,h=c.clearImmediate,m=c.process,y=c.MessageChannel,g=c.Dispatch,b=0,x={},_=function(t){if(x.hasOwnProperty(t)){var n=x[t];delete x[t],n()}},w=function(t){return function(){_(t)}},S=function(t){_(t.data)},O=function(t){c.postMessage(t+"",d.protocol+"//"+d.host)};v&&h||(v=function(t){for(var n=[],e=1;arguments.length>e;)n.push(arguments[e++]);return x[++b]=function(){("function"==typeof t?t:Function(t)).apply(void 0,n)},o(b),b},h=function(t){delete x[t]},"process"==s(m)?o=function(t){m.nextTick(w(t))}:g&&g.now?o=function(t){g.now(w(t))}:y&&!f?(i=(r=new y).port2,r.port1.onmessage=S,o=u(i.postMessage,i,1)):!c.addEventListener||"function"!=typeof postMessage||c.importScripts||a(O)?o="onreadystatechange"in p("script")?function(t){l.appendChild(p("script")).onreadystatechange=function(){l.removeChild(this),_(t)}}:function(t){setTimeout(w(t),0)}:(o=O,c.addEventListener("message",S,!1))),t.exports={set:v,clear:h}},function(t,n,e){var o=e(15);t.exports=o("document","documentElement")},function(t,n,e){var o=e(48);t.exports=/(iphone|ipod|ipad).*applewebkit/i.test(o)},function(t,n,e){var o=e(15);t.exports=o("navigator","userAgent")||""},function(t,n,e){"use strict";var o=e(20),r=function(t){var n,e;this.promise=new t((function(t,o){if(void 0!==n||void 0!==e)throw TypeError("Bad Promise constructor");n=t,e=o})),this.resolve=o(n),this.reject=o(e)};t.exports.f=function(t){return new r(t)}},function(t,n,e){var o=e(2),r=e(90),i=e(29),c=e(28),a=e(46),s=e(23),u=e(27)("IE_PROTO"),l=function(){},p=function(){var t,n=s("iframe"),e=i.length;for(n.style.display="none",a.appendChild(n),n.src=String("javascript:"),(t=n.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),p=t.F;e--;)delete p.prototype[i[e]];return p()};t.exports=Object.create||function(t,n){var e;return null!==t?(l.prototype=o(t),e=new l,l.prototype=null,e[u]=t):e=p(),void 0===n?e:r(e,n)},c[u]=!0},function(t,n,e){"use strict";var o,r,i,c=e(52),a=e(6),s=e(5),u=e(1),l=e(14),p=u("iterator"),f=!1;[].keys&&("next"in(i=[].keys())?(r=c(c(i)))!==Object.prototype&&(o=r):f=!0),null==o&&(o={}),l||s(o,p)||a(o,p,(function(){return this})),t.exports={IteratorPrototype:o,BUGGY_SAFARI_ITERATORS:f}},function(t,n,e){var o=e(5),r=e(53),i=e(27),c=e(94),a=i("IE_PROTO"),s=Object.prototype;t.exports=c?Object.getPrototypeOf:function(t){return t=r(t),o(t,a)?t[a]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,n,e){var o=e(4);t.exports=function(t){return Object(o(t))}},function(t,n,e){"use strict";var o=e(102).charAt;t.exports=function(t,n,e){return n+(e?o(t,n).length:1)}},function(t,n,e){"use strict";var o=e(31),r=e(56),i=e(2),c=e(4),a=e(44),s=e(54),u=e(16),l=e(33),p=e(32),f=e(3),d=[].push,v=Math.min,h=!f((function(){return!RegExp(4294967295,"y")}));o("split",2,(function(t,n,e){var o;return o="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,e){var o=String(c(this)),i=void 0===e?4294967295:e>>>0;if(0===i)return[];if(void 0===t)return[o];if(!r(t))return n.call(o,t,i);for(var a,s,u,l=[],f=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),v=0,h=new RegExp(t.source,f+"g");(a=p.call(h,o))&&!((s=h.lastIndex)>v&&(l.push(o.slice(v,a.index)),a.length>1&&a.index<o.length&&d.apply(l,a.slice(1)),u=a[0].length,v=s,l.length>=i));)h.lastIndex===a.index&&h.lastIndex++;return v===o.length?!u&&h.test("")||l.push(""):l.push(o.slice(v)),l.length>i?l.slice(0,i):l}:"0".split(void 0,0).length?function(t,e){return void 0===t&&0===e?[]:n.call(this,t,e)}:n,[function(n,e){var r=c(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,r,e):o.call(String(r),n,e)},function(t,r){var c=e(o,t,this,r,o!==n);if(c.done)return c.value;var p=i(t),f=String(this),d=a(p,RegExp),m=p.unicode,y=(p.ignoreCase?"i":"")+(p.multiline?"m":"")+(p.unicode?"u":"")+(h?"y":"g"),g=new d(h?p:"^(?:"+p.source+")",y),b=void 0===r?4294967295:r>>>0;if(0===b)return[];if(0===f.length)return null===l(g,f)?[f]:[];for(var x=0,_=0,w=[];_<f.length;){g.lastIndex=h?_:0;var S,O=l(g,h?f:f.slice(_));if(null===O||(S=v(u(g.lastIndex+(h?0:_)),f.length))===x)_=s(f,_,m);else{if(w.push(f.slice(x,_)),w.length===b)return w;for(var j=1;j<=O.length-1;j++)if(w.push(O[j]),w.length===b)return w;_=x=S}}return w.push(f.slice(x)),w}]}),!h)},function(t,n,e){var o=e(8),r=e(7),i=e(1)("match");t.exports=function(t){var n;return o(t)&&(void 0!==(n=t[i])?!!n:"RegExp"==r(t))}},function(t,n,e){var o=e(56);t.exports=function(t){if(o(t))throw TypeError("The method doesn't accept regular expressions");return t}},function(t,n,e){var o=e(1)("match");t.exports=function(t){var n=/./;try{"/./"[t](n)}catch(e){try{return n[o]=!1,"/./"[t](n)}catch(t){}}return!1}},function(t,n){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,n,e){"use strict";var o={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!o.call({1:2},1);n.f=i?function(t){var n=r(this,t);return!!n&&n.enumerable}:o},function(t,n,e){var o=e(3),r=e(7),i="".split;t.exports=o((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==r(t)?i.call(t,""):Object(t)}:Object},function(t,n,e){var o=e(0),r=e(25),i=o.WeakMap;t.exports="function"==typeof i&&/native code/.test(r(i))},function(t,n,e){var o=e(5),r=e(64),i=e(18),c=e(12);t.exports=function(t,n){for(var e=r(n),a=c.f,s=i.f,u=0;u<e.length;u++){var l=e[u];o(t,l)||a(t,l,s(n,l))}}},function(t,n,e){var o=e(15),r=e(66),i=e(69),c=e(2);t.exports=o("Reflect","ownKeys")||function(t){var n=r.f(c(t)),e=i.f;return e?n.concat(e(t)):n}},function(t,n,e){var o=e(0);t.exports=o},function(t,n,e){var o=e(40),r=e(29).concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return o(t,r)}},function(t,n,e){var o=e(19),r=e(16),i=e(68),c=function(t){return function(n,e,c){var a,s=o(n),u=r(s.length),l=i(c,u);if(t&&e!=e){for(;u>l;)if((a=s[l++])!=a)return!0}else for(;u>l;l++)if((t||l in s)&&s[l]===e)return t||l||0;return!t&&-1}};t.exports={includes:c(!0),indexOf:c(!1)}},function(t,n,e){var o=e(10),r=Math.max,i=Math.min;t.exports=function(t,n){var e=o(t);return e<0?r(e+n,0):i(e,n)}},function(t,n){n.f=Object.getOwnPropertySymbols},function(t,n,e){var o=e(0);t.exports=o.Promise},function(t,n,e){var o=e(13);t.exports=function(t,n,e){for(var r in n)o(t,r,n[r],e);return t}},function(t,n,e){var o=e(42);t.exports=o&&!Symbol.sham&&"symbol"==typeof Symbol()},function(t,n,e){"use strict";var o=e(15),r=e(12),i=e(1),c=e(9),a=i("species");t.exports=function(t){var n=o(t),e=r.f;c&&n&&!n[a]&&e(n,a,{configurable:!0,get:function(){return this}})}},function(t,n){t.exports=function(t,n,e){if(!(t instanceof n))throw TypeError("Incorrect "+(e?e+" ":"")+"invocation");return t}},function(t,n,e){var o=e(2),r=e(76),i=e(16),c=e(43),a=e(77),s=e(80),u=function(t,n){this.stopped=t,this.result=n};(t.exports=function(t,n,e,l,p){var f,d,v,h,m,y,g,b=c(n,e,l?2:1);if(p)f=t;else{if("function"!=typeof(d=a(t)))throw TypeError("Target is not iterable");if(r(d)){for(v=0,h=i(t.length);h>v;v++)if((m=l?b(o(g=t[v])[0],g[1]):b(t[v]))&&m instanceof u)return m;return new u(!1)}f=d.call(t)}for(y=f.next;!(g=y.call(f)).done;)if("object"==typeof(m=s(f,b,g.value,l))&&m&&m instanceof u)return m;return new u(!1)}).stop=function(t){return new u(!0,t)}},function(t,n,e){var o=e(1),r=e(17),i=o("iterator"),c=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||c[i]===t)}},function(t,n,e){var o=e(78),r=e(17),i=e(1)("iterator");t.exports=function(t){if(null!=t)return t[i]||t["@@iterator"]||r[o(t)]}},function(t,n,e){var o=e(79),r=e(7),i=e(1)("toStringTag"),c="Arguments"==r(function(){return arguments}());t.exports=o?r:function(t){var n,e,o;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=function(t,n){try{return t[n]}catch(t){}}(n=Object(t),i))?e:c?r(n):"Object"==(o=r(n))&&"function"==typeof n.callee?"Arguments":o}},function(t,n,e){var o={};o[e(1)("toStringTag")]="z",t.exports="[object z]"===String(o)},function(t,n,e){var o=e(2);t.exports=function(t,n,e,r){try{return r?n(o(e)[0],e[1]):n(e)}catch(n){var i=t.return;throw void 0!==i&&o(i.call(t)),n}}},function(t,n,e){var o=e(1)("iterator"),r=!1;try{var i=0,c={next:function(){return{done:!!i++}},return:function(){r=!0}};c[o]=function(){return this},Array.from(c,(function(){throw 2}))}catch(t){}t.exports=function(t,n){if(!n&&!r)return!1;var e=!1;try{var i={};i[o]=function(){return{next:function(){return{done:e=!0}}}},t(i)}catch(t){}return e}},function(t,n,e){var o,r,i,c,a,s,u,l,p=e(0),f=e(18).f,d=e(7),v=e(45).set,h=e(47),m=p.MutationObserver||p.WebKitMutationObserver,y=p.process,g=p.Promise,b="process"==d(y),x=f(p,"queueMicrotask"),_=x&&x.value;_||(o=function(){var t,n;for(b&&(t=y.domain)&&t.exit();r;){n=r.fn,r=r.next;try{n()}catch(t){throw r?c():i=void 0,t}}i=void 0,t&&t.enter()},b?c=function(){y.nextTick(o)}:m&&!h?(a=!0,s=document.createTextNode(""),new m(o).observe(s,{characterData:!0}),c=function(){s.data=a=!a}):g&&g.resolve?(u=g.resolve(void 0),l=u.then,c=function(){l.call(u,o)}):c=function(){v.call(p,o)}),t.exports=_||function(t){var n={fn:t,next:void 0};i&&(i.next=n),r||(r=n,c()),i=n}},function(t,n,e){var o=e(2),r=e(8),i=e(49);t.exports=function(t,n){if(o(t),r(n)&&n.constructor===t)return n;var e=i.f(t);return(0,e.resolve)(n),e.promise}},function(t,n,e){var o=e(0);t.exports=function(t,n){var e=o.console;e&&e.error&&(1===arguments.length?e.error(t):e.error(t,n))}},function(t,n){t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},function(t,n,e){var o,r,i=e(0),c=e(48),a=i.process,s=a&&a.versions,u=s&&s.v8;u?r=(o=u.split("."))[0]+o[1]:c&&(!(o=c.match(/Edge\/(\d+)/))||o[1]>=74)&&(o=c.match(/Chrome\/(\d+)/))&&(r=o[1]),t.exports=r&&+r},function(t,n){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,n,e){"use strict";var o=e(19),r=e(89),i=e(17),c=e(26),a=e(92),s=c.set,u=c.getterFor("Array Iterator");t.exports=a(Array,"Array",(function(t,n){s(this,{type:"Array Iterator",target:o(t),index:0,kind:n})}),(function(){var t=u(this),n=t.target,e=t.kind,o=t.index++;return!n||o>=n.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==e?{value:o,done:!1}:"values"==e?{value:n[o],done:!1}:{value:[o,n[o]],done:!1}}),"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(t,n,e){var o=e(1),r=e(50),i=e(6),c=o("unscopables"),a=Array.prototype;null==a[c]&&i(a,c,r(null)),t.exports=function(t){a[c][t]=!0}},function(t,n,e){var o=e(9),r=e(12),i=e(2),c=e(91);t.exports=o?Object.defineProperties:function(t,n){i(t);for(var e,o=c(n),a=o.length,s=0;a>s;)r.f(t,e=o[s++],n[e]);return t}},function(t,n,e){var o=e(40),r=e(29);t.exports=Object.keys||function(t){return o(t,r)}},function(t,n,e){"use strict";var o=e(11),r=e(93),i=e(52),c=e(95),a=e(30),s=e(6),u=e(13),l=e(1),p=e(14),f=e(17),d=e(51),v=d.IteratorPrototype,h=d.BUGGY_SAFARI_ITERATORS,m=l("iterator"),y=function(){return this};t.exports=function(t,n,e,l,d,g,b){r(e,n,l);var x,_,w,S=function(t){if(t===d&&P)return P;if(!h&&t in k)return k[t];switch(t){case"keys":case"values":case"entries":return function(){return new e(this,t)}}return function(){return new e(this)}},O=n+" Iterator",j=!1,k=t.prototype,E=k[m]||k["@@iterator"]||d&&k[d],P=!h&&E||S(d),L="Array"==n&&k.entries||E;if(L&&(x=i(L.call(new t)),v!==Object.prototype&&x.next&&(p||i(x)===v||(c?c(x,v):"function"!=typeof x[m]&&s(x,m,y)),a(x,O,!0,!0),p&&(f[O]=y))),"values"==d&&E&&"values"!==E.name&&(j=!0,P=function(){return E.call(this)}),p&&!b||k[m]===P||s(k,m,P),f[n]=P,d)if(_={values:S("values"),keys:g?P:S("keys"),entries:S("entries")},b)for(w in _)!h&&!j&&w in k||u(k,w,_[w]);else o({target:n,proto:!0,forced:h||j},_);return _}},function(t,n,e){"use strict";var o=e(51).IteratorPrototype,r=e(50),i=e(22),c=e(30),a=e(17),s=function(){return this};t.exports=function(t,n,e){var u=n+" Iterator";return t.prototype=r(o,{next:i(1,e)}),c(t,u,!1,!0),a[u]=s,t}},function(t,n,e){var o=e(3);t.exports=!o((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},function(t,n,e){var o=e(2),r=e(96);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,n=!1,e={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(e,[]),n=e instanceof Array}catch(t){}return function(e,i){return o(e),r(i),n?t.call(e,i):e.__proto__=i,e}}():void 0)},function(t,n,e){var o=e(8);t.exports=function(t){if(!o(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},function(t,n,e){"use strict";var o=e(11),r=e(10),i=e(98),c=e(99),a=e(3),s=1..toFixed,u=Math.floor,l=function(t,n,e){return 0===n?e:n%2==1?l(t,n-1,e*t):l(t*t,n/2,e)};o({target:"Number",proto:!0,forced:s&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!a((function(){s.call({})}))},{toFixed:function(t){var n,e,o,a,s=i(this),p=r(t),f=[0,0,0,0,0,0],d="",v="0",h=function(t,n){for(var e=-1,o=n;++e<6;)o+=t*f[e],f[e]=o%1e7,o=u(o/1e7)},m=function(t){for(var n=6,e=0;--n>=0;)e+=f[n],f[n]=u(e/t),e=e%t*1e7},y=function(){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==f[t]){var e=String(f[t]);n=""===n?e:n+c.call("0",7-e.length)+e}return n};if(p<0||p>20)throw RangeError("Incorrect fraction digits");if(s!=s)return"NaN";if(s<=-1e21||s>=1e21)return String(s);if(s<0&&(d="-",s=-s),s>1e-21)if(e=(n=function(t){for(var n=0,e=t;e>=4096;)n+=12,e/=4096;for(;e>=2;)n+=1,e/=2;return n}(s*l(2,69,1))-69)<0?s*l(2,-n,1):s/l(2,n,1),e*=4503599627370496,(n=52-n)>0){for(h(0,e),o=p;o>=7;)h(1e7,0),o-=7;for(h(l(10,o,1),0),o=n-1;o>=23;)m(1<<23),o-=23;m(1<<o),h(1,1),m(2),v=y()}else h(0,e),h(1<<-n,0),v=y()+c.call("0",p);return v=p>0?d+((a=v.length)<=p?"0."+c.call("0",p-a)+v:v.slice(0,a-p)+"."+v.slice(a-p)):d+v}})},function(t,n,e){var o=e(7);t.exports=function(t){if("number"!=typeof t&&"Number"!=o(t))throw TypeError("Incorrect invocation");return+t}},function(t,n,e){"use strict";var o=e(10),r=e(4);t.exports="".repeat||function(t){var n=String(r(this)),e="",i=o(t);if(i<0||i==1/0)throw RangeError("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(n+=n))1&i&&(e+=n);return e}},function(t,n,e){"use strict";var o=e(31),r=e(2),i=e(53),c=e(16),a=e(10),s=e(4),u=e(54),l=e(33),p=Math.max,f=Math.min,d=Math.floor,v=/\$([$&'`]|\d\d?|<[^>]*>)/g,h=/\$([$&'`]|\d\d?)/g;o("replace",2,(function(t,n,e){return[function(e,o){var r=s(this),i=null==e?void 0:e[t];return void 0!==i?i.call(e,r,o):n.call(String(r),e,o)},function(t,i){var s=e(n,t,this,i);if(s.done)return s.value;var d=r(t),v=String(this),h="function"==typeof i;h||(i=String(i));var m=d.global;if(m){var y=d.unicode;d.lastIndex=0}for(var g=[];;){var b=l(d,v);if(null===b)break;if(g.push(b),!m)break;""===String(b[0])&&(d.lastIndex=u(v,c(d.lastIndex),y))}for(var x,_="",w=0,S=0;S<g.length;S++){b=g[S];for(var O=String(b[0]),j=p(f(a(b.index),v.length),0),k=[],E=1;E<b.length;E++)k.push(void 0===(x=b[E])?x:String(x));var P=b.groups;if(h){var L=[O].concat(k,j,v);void 0!==P&&L.push(P);var C=String(i.apply(void 0,L))}else C=o(O,v,j,k,P,i);j>=w&&(_+=v.slice(w,j)+C,w=j+O.length)}return _+v.slice(w)}];function o(t,e,o,r,c,a){var s=o+t.length,u=r.length,l=h;return void 0!==c&&(c=i(c),l=v),n.call(a,l,(function(n,i){var a;switch(i.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,o);case"'":return e.slice(s);case"<":a=c[i.slice(1,-1)];break;default:var l=+i;if(0===l)return n;if(l>u){var p=d(l/10);return 0===p?n:p<=u?void 0===r[p-1]?i.charAt(1):r[p-1]+i.charAt(1):n}a=r[l-1]}return void 0===a?"":a}))}}))},function(t,n,e){"use strict";var o=e(2);t.exports=function(){var t=o(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.dotAll&&(n+="s"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n}},function(t,n,e){var o=e(10),r=e(4),i=function(t){return function(n,e){var i,c,a=String(r(n)),s=o(e),u=a.length;return s<0||s>=u?t?"":void 0:(i=a.charCodeAt(s))<55296||i>56319||s+1===u||(c=a.charCodeAt(s+1))<56320||c>57343?t?a.charAt(s):i:t?a.slice(s,s+2):c-56320+(i-55296<<10)+65536}};t.exports={codeAt:i(!1),charAt:i(!0)}},function(t,n,e){"use strict";var o=e(11),r=e(57),i=e(4);o({target:"String",proto:!0,forced:!e(58)("includes")},{includes:function(t){return!!~String(i(this)).indexOf(r(t),arguments.length>1?arguments[1]:void 0)}})},function(t,n,e){"use strict";var o=e(31),r=e(2),i=e(4),c=e(105),a=e(33);o("search",1,(function(t,n,e){return[function(n){var e=i(this),o=null==n?void 0:n[t];return void 0!==o?o.call(n,e):new RegExp(n)[t](String(e))},function(t){var o=e(n,t,this);if(o.done)return o.value;var i=r(t),s=String(this),u=i.lastIndex;c(u,0)||(i.lastIndex=0);var l=a(i,s);return c(i.lastIndex,u)||(i.lastIndex=u),null===l?-1:l.index}]}))},function(t,n){t.exports=Object.is||function(t,n){return t===n?0!==t||1/t==1/n:t!=t&&n!=n}},function(t,n,e){"use strict";var o,r=e(11),i=e(18).f,c=e(16),a=e(57),s=e(4),u=e(58),l=e(14),p="".startsWith,f=Math.min,d=u("startsWith");r({target:"String",proto:!0,forced:!!(l||d||(o=i(String.prototype,"startsWith"),!o||o.writable))&&!d},{startsWith:function(t){var n=String(s(this));a(t);var e=c(f(arguments.length>1?arguments[1]:void 0,n.length)),o=String(t);return p?p.call(n,o,e):n.slice(e,e+o.length)===o}})},function(t,n,e){"use strict";e.r(n);e(34),e(21);var o={get:(t="loop-onstore-data")=>JSON.parse(localStorage.getItem(t)||null),set(t,n="loop-onstore-data"){localStorage.setItem(n,JSON.stringify(t))},remove(t="loop-onstore-data"){localStorage.removeItem(t)}};function r(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,o)}return e}function i(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}let c={debug:!1,testMode:!1,redirect:!0,active:!1,params:null,key:null,api:null,token:null,id:null,fullPayload:!1,preserveCart:!1,draftOrderId:null,inExperiment:!1,singleItem:!1,attach:null};const a=t=>t?c[t]:c,s=(t,n)=>{c[t]=n,o.set(c)},u=()=>{const t=o.get();t&&(c=function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?r(Object(e),!0).forEach((function(n){i(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):r(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},c,{},t))};var l=new Proxy({},{get:(t,n)=>!t[n]&&a("debug")?t=>"string"==typeof t?console[n]("%c".concat(t),"color: #3256E6"):console[n](t):t[n]||function(){}});class p extends HTMLElement{constructor(){super()}connectedCallback(){var t;if(!LoopOnstore.isActive()||!a("inExperiment"))return;const n=a("attach");(null!==(t=document.querySelectorAll(n))&&void 0!==t?t:[]).forEach(t=>t.remove());const e=this.buildBtnContainer();this.attachShadow({mode:"open"}).appendChild(e)}buildBtnContainer(){const t=document.createElement("div");t.className="loop-onstore-btn-container",t.style="display:flex; flex-direction: column; gap: 1rem;";const n=this.buildCheckoutBtn(),e=this.buildAddMoreBtn();return t.appendChild(n),a("singleItem")||t.appendChild(e),t}buildAddMoreBtn(){const t=document.createElement("button");return t.textContent="Select more items to return",t.part="loop-onstore-add-more-btn",t.addEventListener("click",this.handleAddMore),t}buildCheckoutBtn(){const t=document.createElement("button");return t.textContent="Checkout",t.part="loop-onstore-checkout-btn",t.addEventListener("click",this.handleCheckout),t}handleCheckout(){LoopOnstore.submit()}handleAddMore(){LoopOnstore.submit(null,"lineItems")}}const f=t=>{if((t=>t instanceof HTMLElement||t instanceof Array&&t.some(t=>t instanceof HTMLElement))(t)){if(!(t instanceof Array))return[t];const n=t.filter(t=>t instanceof HTMLElement),e=t.filter(t=>!(t instanceof HTMLElement));return[...n,...document.querySelectorAll(e)]}return[...document.querySelectorAll(t)]},d=(t,n)=>{const e=f(t);return e.length>1&&l.warn("Attaching Loop.submit() to more than one element. Make sure you're using the right selector!"),e.forEach(t=>{t.addEventListener("click",n)}),customElements.get("loop-onstore")||customElements.define("loop-onstore",p),e};e(97),e(100),e(55);const v={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:"$"}},h=(t,n="USD")=>{if(!t)return"";const e=v[n];if(e){const{dollars:n,cents:o}=((t,n)=>{const[e,o]=Number.parseFloat(t/n.constant).toFixed(n.decimals).split(".");return{dollars:e?e.replace(/\B(?=(\d{3})+(?!\d))/g,n.thousandSymbol):"0",cents:o||""}})(t,e);return"".concat(e.symbol).concat(n).concat(e.decimalSymbol).concat(o)}return new Intl.NumberFormat("en-US",{style:"currency",currency:n}).format(t/e.constant)};function m(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,o)}return e}function y(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?m(Object(e),!0).forEach((function(n){g(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):m(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}function g(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}const b=()=>{var t;return null!==(t=a("api"))&&void 0!==t?t:"https://api.loopreturns.com/api/v1/"},x=t=>{const{token:n,total_discount:e,original_total_price:o,total_price:r,items:i,currency:c,items_subtotal_price:a,cart_level_discount_applications:s}=t;return(t=>{const n="object"==typeof t&&null!==t?JSON.stringify(t):String(t);return window.btoa(unescape(encodeURIComponent(n)))})({token:n,total_discount:e,original_total_price:o,total_price:r,items:i.map(t=>{const{id:n,quantity:e,variant_id:o,price:r,original_price:i,discounted_price:c,original_line_price:a,line_price:s,total_discount:u,final_price:l,final_line_price:p,taxable:f,product_id:d,discount_allocations:v,line_level_discount_allocations:h}=t;return{id:n,quantity:e,variant_id:o,price:r,original_price:i,discounted_price:c,original_line_price:a,line_price:s,total_discount:u,final_price:l,final_line_price:p,taxable:f,product_id:d,discount_allocations:v,line_level_discount_allocations:h}}),currency:c,items_subtotal_price:a,cart_level_discount_applications:s})},_=(t,n="GET",e)=>{const o=a("key");return new Promise(r=>{const i=null!=e?JSON.stringify(e):null;var c=new XMLHttpRequest;c.withCredentials=!0,c.addEventListener("readystatechange",(function(){this.readyState===this.DONE&&r(JSON.parse(this.responseText))})),c.open(n,t),""!==o&&c.setRequestHeader("x-authorization",o),c.setRequestHeader("content-type","application/json"),c.send(i)})},w=()=>{return _("/cart/clear.js","POST")};function S(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,o)}return e}function O(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}const j=(t,n)=>{l.info("Creating cart request..."),l.info("Syncing these variants to the Loop cart:"),l.info(t);const e=a("token");return e?((t,n,e)=>{const o=b(),r="".concat(o,"cart/").concat(t);let i={};return a("fullPayload")&&(i={shopify:x(e)}),_(r,"POST",y({cart:n,draftOrderId:a("draftOrderId")},i))})(e,t,n).then(t=>(function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?S(Object(e),!0).forEach((function(n){O(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):S(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t})({},t,{token:e})):((t,n)=>{const e=b(),o="".concat(e,"cart/");let r={};return a("fullPayload")&&(r={shopify:x(n)}),_(o,"POST",y({cart:t,draftOrderId:a("draftOrderId")},r))})(t,n)};e(103),e(104),e(106);function k(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,o)}return e}function E(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}const P=t=>{const n=Number(t);return Number.isNaN(n)?t:n};var L={get:(t=window.location.search)=>t.substr(1).split("&").reduce((t,n)=>{const[e,o]=decodeURIComponent(n).split("=");return function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?k(Object(e),!0).forEach((function(n){E(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):k(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},t,{[e]:P(o)})},{}),hasLoopData:(t=window.location.search)=>t.includes("loop_total"),getKeys:(t,n="loop")=>Object.keys(t).filter(t=>t.startsWith(n)),clear(t=[]){const n=Object.entries(this.get()).reduce((n,[e,o])=>{if(t.includes(e))return n;const r=n.length?"&":"?";return"".concat(n).concat(r).concat(encodeURIComponent(e),"=").concat(encodeURIComponent(o))},"");window.history.replaceState({},"","".concat(window.location.origin).concat(window.location.pathname).concat(n))}};const C={credit:{container:".loop-onstore__credit",amount:".loop-onstore__credit-amount"},percentDiscount:{container:".loop-onstore__percent-discount",amount:".loop-onstore__percent-discount-amount"}};var T=(t,n={})=>{if(t)return t;const e=((t={})=>{const n=document.createElement("div");return n.classList.add("loop-onstore"),n.id="loop-onstore",n.innerHTML='\n <div class="loop-onstore__percent-discount">\n <span class="loop-onstore__percent-discount-amount"></span>\n <span class="loop-onstore__copy loop-onstore__percent-discount-copy">\n applied at checkout\n </span>\n </div>\n <div class="loop-onstore__credit">\n <span class="loop-onstore__amount loop-onstore__credit-amount"></span>\n <span class="loop-onstore__copy loop-onstore__credit-copy">\n in available credit\n </span>\n <span class="loop-onstore__copy loop-onstore__mobile-credit-copy">\n credit\n </span>\n </div>\n <button class="loop-onstore__back" onClick="LoopOnstore.backToLoop()">\n <svg \n class="loop-onstore__back-icon"\n width="16"\n height="16"\n viewBox="0 0 16 16"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path d="M12.6667 8H3.33333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M8 12.6666L3.33333 7.99998L8 3.33331" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n </svg> \n <span>Go back</span>\n </button>\n\n',Object.keys(t).forEach(e=>{const o=t[e],r=C[e];if(r&&o){const t=n.querySelector(r.container);if(t){t.style.display="flex";const n=t.querySelector(r.amount);n&&o.amount&&(n.textContent=o.amount)}}}),n})(n);return document.body.appendChild(e)};e.d(n,"init",(function(){return M})),e.d(n,"testMode",(function(){return A})),e.d(n,"submit",(function(){return N})),e.d(n,"attach",(function(){return F})),e.d(n,"debug",(function(){return D})),e.d(n,"setKey",(function(){return R})),e.d(n,"backToLoop",(function(){return U})),e.d(n,"isActive",(function(){return H}));const I={bar:null,attached:[]},M=async t=>{if(u(),null==t?void 0:t.key)R(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,".")),s("api",t.api)),(null==t?void 0:t.preserveCart)&&(l.info("Setting preserve cart to ".concat(t.preserveCart)),s("preserveCart",t.preserveCart));const n=L.get();if(L.hasLoopData()){var e,o;a("id")!==n.loop_return_id&&s("token",null),s("params",n),s("id",n.loop_return_id),s("inExperiment",null!==(e=Boolean("true"===(null==n?void 0:n.loop_experiment_b_eligible)))&&void 0!==e&&e),s("singleItem",null!==(o=null==n?void 0:n.loop_single_item_eligible)&&void 0!==o&&o),a("inExperiment")&&s("preserveCart",!0),L.clear(L.getKeys(n)),await w();const t=a("token");if(t)try{const{cart:n}=await(t=>{const n=b(),e="".concat(n,"cart/").concat(t);return _(e)})(t);await(t=>{if(!(null==t?void 0:t.length))return w();const n=t.reduce((t,n)=>t[n]?y({},t,{[n]:t[n]+1}):y({},t,{[n]:1}),{});return _("/cart/update.js","POST",{updates:n})})(n),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 r=a("params");if(r){var i,c;s("active",!0),document.body.classList.add("loop-returns-activated");const t={};null!==(i=r.loop_total)&&void 0!==i&&i&&(t.credit={amount:h(r.loop_total,r.loop_currency)}),null!==(c=r.loop_discount_percentage)&&void 0!==c&&c&&(t.percentDiscount={amount:r.loop_discount_percentage+"% off"});const n=T(null,t);(()=>{const t=document.createElement("style");t.type="text/css",t.innerText="\n:root {\n --loop-primary-color: #030712;\n --loop-text-color: white;\n --loop-badge-background: #F9FAFB;\n --loop-badge-text: #374151;\n --loop-button-background: white;\n --loop-button-text: #1F2937;\n --loop-button-border: #D1D5DB;\n \n --loop-onstore-button-padding: 14px 16px;\n --loop-onstore-checkout-background: #030712;\n --loop-onstore-checkout-text-color: white;\n --loop-onstore-button-radius: 0;\n --loop-onstore-button-gap: 0.25rem;\n --loop-onstore-add-more-background: white;\n --loop-onstore-add-more-text-color: black;\n --loop-onstore-add-more-border: black;\n --loop-onstore-casing: uppercase;\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 justify-content: space-between;\n top: auto !important;\n bottom: 0 !important;\n left: 0;\n z-index: 2147483647;\n background-color: var(--loop-primary-color);\n color: var(--loop-text-color);\n font-family: 'SF Pro Text', untitled sans, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji' !important;\n transform: translateY(100%);\n transition: transform .2s;\n font-size: 0.875rem;\n font-style: normal;\n font-weight: 400;\n line-height: 150%;\n padding: 1rem 1.5rem;\n}\n.loop-onstore *, .loop-onstore *::before, .loop-onstore *::after {\n box-sizing: inherit;\n}\n.loop-onstore__credit {\n display: none;\n align-items: flex-start;\n gap: 0.25rem;\n}\n.loop-onstore__credit-amount {\n font-weight: 600;\n}\n.loop-onstore__mobile-credit-copy {\n display: none;\n}\n.loop-onstore__percent-discount {\n display: none;\n align-items: flex-start;\n gap: 0.5rem; \n}\n.loop-onstore__percent-discount-amount {\n display: flex;\n padding: 0.125rem 0.5rem;\n justify-content: center;\n align-items: center;\n gap: 0.375rem;\n border-radius: 100px;\n background: var(--loop-badge-background);\n font-weight: 600;\n font-size: 0.75rem;\n color: var(--loop-badge-text);\n}\n.loop-onstore__percent-discount-copy {\n text-align: center;\n}\n.loop-onstore__back {\n color: var(--loop-button-text);\n background: var(--loop-button-background);\n border: none;\n appearance: none;\n transition: all .2s;\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.5rem;\n border-radius: 0.5rem;\n border: 1px solid var(--loop-button-border);\n display: flex;\n padding: 0.5rem 1rem;\n align-items: center;\n gap: 0.25rem; \n cursor: pointer;\n}\n.loop-onstore__back:hover {\n opacity: .7;\n}\n.loop-onstore__back-icon path {\n stroke: var(--loop-button-text); \n}\n\n.loop-returns-modal {\n font-family: 'SF Pro Text', untitled sans,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji !important;\n -moz-osx-font-smoothing: grayscale;\n -webkit-font-smoothing: antialiased;\n font-style: normal;\n display: flex;\n justify-content: center;\n align-items: center;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 999;\n }\n\n .loop-returns-modal__backdrop{\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(65, 69, 74, 0.7);\n }\n\n .loop-returns-modal__content {\n overflow: auto;\n max-height: 600px;\n background-color: #fff;\n box-shadow: 0px 1px 4px rgb(0 0 0 / 12%), 0px 6px 12px rgb(0 0 0 / 8%);\n border-radius: 8px;\n width: 500px;\n max-width: 700px;\n position: relative;\n z-index: 1000;\n }\n\n .loop-returns-modal__header {\n color: #3256E5;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 15px 20px;\n border-bottom: 1px solid #EAEAEA;\n font-size: 1.25rem;\n font-weight: 500;\n }\n\n .loop-returns-modal__close--icon {\n height: 20px;\n width: 20px;\n cursor: pointer;\n }\n\n .loop-returns-modal__body {\n padding: 20px;\n }\n\n loop-onstore {\n flex: 1;\n }\n\n loop-onstore::part(loop-onstore-checkout-btn) {\n padding: var(--loop-onstore-button-padding);\n background: var(--loop-primary-color);\n color: var(--loop-onstore-checkout-text-color);\n border-radius: var(--loop-onstore-button-radius);\n cursor: pointer;\n font-weight: 500;\n text-transform: var(--loop-onstore-casing);\n }\n\n loop-onstore::part(loop-onstore-add-more-btn) {\n padding: var(--loop-onstore-button-padding);\n background: transparent;\n border: 1px solid var(--loop-onstore-add-more-border);\n border-radius: var(--loop-onstore-button-radius);\n color: var(--loop-onstore-add-more-text-color);\n cursor: pointer;\n font-weight: 500;\n text-transform: var(--loop-onstore-casing);\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__mobile-credit-copy {\n display: block;\n }\n .loop-onstore__credit-copy {\n display: none;\n }\n .loop-onstore__percent-discount-copy {\n display: none;\n }\n .loop-onstore__back {\n font-size: 0.875rem;\n line-height: 1.25rem;\n }\n}\n",document.head.appendChild(t)})(),I.bar=n,l.info("Loop returns activated"),document.dispatchEvent(new Event("Loop:Activated"))}(null==t?void 0:t.attach)&&(s("attach",null==t?void 0:t.attach),F(t.attach)),(null==t?void 0:t.full)&&s("fullPayload",null==t?void 0:t.full)},A=(t=!0)=>{s("debug",!0),s("testMode",!0),l.info("Test mode activated"),s("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_discount_percentage=25&loop_base=799&loop_credit=500&loop_subdomain=example&loop_redirect_url=example.loopreturns.com%2F%23%2Fcredit&loop_customer_name=Jane%20Doe")},D=()=>{const t=!a("debug");return s("debug",t),"Debug ".concat(t?"on":"off")},R=t=>{if(!t||"string"!=typeof t)return console.error("Your api key is either undefined or not a string.");s("key",t),l.info("Loop Returns on-store API key set.")},N=async(t,n=null)=>{let e=null;t||(l.info("Requesting updated cart from Shopify"),e=await _("/cart.js"),t=e.items.reduce((t,n)=>[...t,...Array(n.quantity).fill(n.variant_id)],[]));try{var o;if(window.stackableService&&"function"==typeof(null===(o=window.stackableService)||void 0===o?void 0:o.send)){window.stackableService.send({type:"checkout",data:{preventRedirect:!0}});let t=0;await(async()=>await new Promise(n=>{const e=setInterval(()=>{(window.stackableService.state.context.draftOrderId||6===t)&&(n(),clearInterval(e)),t++},500)}))(),s("draftOrderId",window.stackableService.state.context.draftOrderId)}const r=await j(t,e);return s("token",r.token),a("preserveCart")||await w(),U(r.token,n),Promise.resolve(r.token)}catch(t){return l.info("Unable to create Loop Returns cart:"),l.error(t),Promise.reject(t)}},F=t=>{if(a("active")){l.info('Loop attaching to: "'.concat(t,'"'));const n=async t=>{if(a("active")){t.stopImmediatePropagation(),t.preventDefault(),t.target.disabled=!0,t.target.classList.add("loop-activated");try{await N(),t.target.disabled=!1,t.target.classList.remove("loop-activated")}catch(n){t.target.disabled=!1,t.target.classList.remove("loop-activated")}}};I.attached=d(t,n),new MutationObserver(e=>{const o=((t,n)=>t.filter(t=>t[n].length).reduce((t,e)=>[...t,...e[n]],[]))(e,"addedNodes");let r=t;if(t instanceof HTMLElement&&(r=[]),t instanceof Array&&(r=t.filter(t=>!(t instanceof HTMLElement))),o.length){o.some(t=>{var n;return!(null===(n=r)||void 0===n||!n.length)&&(t&&1===t.nodeType&&(t.matches(r)||(null==t?void 0:t.querySelector(r))))})&&(((t,n)=>{t.forEach(t=>{t.removeEventListener("click",n)})})(I.attached,n),I.attached=d(t,n),l.info('Loop reattached to: "'.concat(t,'"')))}}).observe(document.body,{childList:!0,subtree:!0})}},U=(t,n=null)=>{const e=a("testMode");s("active",!1);const o=a("params");let r="http://".concat(o.loop_redirect_url);if(t&&o.loop_return_key?r="http://".concat(o.loop_domain,"/#/cart/v2/").concat(t,"/").concat(o.loop_return_key):t&&(r="http://".concat(o.loop_domain,"/#/cart/v2/").concat(t).concat(n?"?to="+n:"")),s("params",null),l.info("Redirecting to:"),l.info(r),document.dispatchEvent(new Event("Loop:Back To Loop")),e)return(()=>{document.body.style.overflow="hidden";const t=document.createElement("div");t.classList.add("loop-returns-modal"),t.innerHTML='\n <div class="loop-returns-modal">\n <div class="loop-returns-modal__backdrop"></div>\n <div class="loop-returns-modal__content">\n <div class="loop-returns-modal__header">\n <div class="loop-returns-modal__text">Loop Onstore Installed</div>\n <div class="loop-returns-modal__close">\n <svg class="loop-returns-modal__close--icon width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M0 7.50024C0 3.36474 3.3645 0.000244141 7.5 0.000244141C11.6355 0.000244141 15 3.36474 15 7.50024C15 11.6357 11.6355 15.0002 7.5 15.0002C3.3645 15.0002 0 11.6357 0 7.50024ZM5.78025 4.71999C5.6388 4.58338 5.44935 4.50778 5.2527 4.50949C5.05605 4.5112 4.86794 4.59007 4.72889 4.72913C4.58983 4.86819 4.51095 5.0563 4.50924 5.25294C4.50754 5.44959 4.58313 5.63904 4.71975 5.78049L6.4395 7.50024L4.71975 9.21999C4.64812 9.28918 4.59098 9.37194 4.55167 9.46344C4.51237 9.55494 4.49168 9.65336 4.49081 9.75294C4.48995 9.85253 4.50892 9.95129 4.54663 10.0435C4.58434 10.1356 4.64003 10.2194 4.71045 10.2898C4.78087 10.3602 4.86461 10.4159 4.95678 10.4536C5.04896 10.4913 5.14772 10.5103 5.2473 10.5094C5.34689 10.5086 5.4453 10.4879 5.5368 10.4486C5.62831 10.4093 5.71106 10.3521 5.78025 10.2805L7.5 8.56074L9.21975 10.2805C9.3612 10.4171 9.55065 10.4927 9.7473 10.491C9.94395 10.4893 10.1321 10.4104 10.2711 10.2714C10.4102 10.1323 10.489 9.94419 10.4908 9.74754C10.4925 9.5509 10.4169 9.36145 10.2802 9.21999L8.5605 7.50024L10.2802 5.78049C10.4169 5.63904 10.4925 5.44959 10.4908 5.25294C10.489 5.0563 10.4102 4.86819 10.2711 4.72913C10.1321 4.59007 9.94395 4.5112 9.7473 4.50949C9.55065 4.50778 9.3612 4.58338 9.21975 4.71999L7.5 6.43974L5.78025 4.71999Z"\n fill="black" />\n </svg>\n </div>\n </div>\n <div class="loop-returns-modal__body">\n Test Mode Successful\n </div>\n </div>\n </div>\n </div>',document.body.appendChild(t);const n=document.querySelector(".loop-returns-modal__close"),e=document.querySelector(".loop-returns-modal__backdrop"),o=n=>{"Escape"===n.key&&(t.remove(),document.removeEventListener("keydown",o))};document.addEventListener("keydown",o),null==n||n.addEventListener("click",()=>{t.remove(),document.removeEventListener("keydown",o),document.body.style.overflow="auto"}),null==e||e.addEventListener("click",()=>{t.remove(),document.removeEventListener("keydown",o),document.body.style.overflow="auto"})})(),void s("testMode",!1);a("redirect")&&(window.location.href=r)},H=()=>a("active")}])}));
{
"name": "@loophq/onstore-sdk",
"private": false,
"version": "1.3.3",
"version": "1.3.4",
"description": "An SDK for integrating with loop returns on-store api",

@@ -6,0 +6,0 @@ "main": "dist/loop-onstore-sdk.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc