text: import t from"fast-json-stable-stringify";import{assert as e,ACTIONS as n}from"@pollyjs/utils";import r from"bowser";import o from"utf8-byte-length";import i from"set-cookie-parser";var s=Object.freeze({}),c=Math.ceil,u=Math.floor,a=function(t){return isNaN(t=+t)?0:(t>0?u:c)(t)},f=function(t){if(null==t)throw TypeError("Can't call method on  "+t);return t};function l(t,e){return t(e={exports:{}},e.exports),e.exports}var h=l(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),p=l(function(t){var e=t.exports={version:"2.6.9"};"number"==typeof __e&&(__e=e)}),v=(p.version,function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}),d=function(t,e,n){if(v(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}},y=function(t){return"object"==typeof t?null!==t:"function"==typeof t},g=function(t){if(!y(t))throw TypeError(t+" is not an object!");return t},_=function(t){try{return!!t()}catch(t){return!0}},m=!_(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),b=h.document,w=y(b)&&y(b.createElement),O=function(t){return w?b.createElement(t):{}},S=!m&&!_(function(){return 7!=Object.defineProperty(O("div"),"a",{get:function(){return 7}}).a}),j=function(t,e){if(!y(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!y(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!y(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!y(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},P=Object.defineProperty,E={f:m?Object.defineProperty:function(t,e,n){if(g(t),e=j(e,!0),g(n),S)try{return P(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},T=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},k=m?function(t,e,n){return E.f(t,e,T(1,n))}:function(t,e,n){return t[e]=n,t},x={}.hasOwnProperty,M=function(t,e){return x.call(t,e)},R=function(t,e,n){var r,o,i,s=t&R.F,c=t&R.G,u=t&R.S,a=t&R.P,f=t&R.B,l=t&R.W,v=c?p:p[e]||(p[e]={}),y=v.prototype,g=c?h:u?h[e]:(h[e]||{}).prototype;for(r in c&&(n=e),n)(o=!s&&g&&void 0!==g[r])&&M(v,r)||(i=o?g[r]:n[r],v[r]=c&&"function"!=typeof g[r]?n[r]:f&&o?d(i,h):l&&g[r]==i?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(i):a&&"function"==typeof i?d(Function.call,i):i,a&&((v.virtual||(v.virtual={}))[r]=i,t&R.R&&y&&!y[r]&&k(y,r,i)))};R.F=1,R.G=2,R.S=4,R.P=8,R.B=16,R.W=32,R.U=64,R.R=128;var F,A=R,L=k,C={},z={}.toString,N=function(t){return z.call(t).slice(8,-1)},D=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==N(t)?t.split(""):Object(t)},I=function(t){return D(f(t))},q=Math.min,$=function(t){return t>0?q(a(t),9007199254740991):0},G=Math.max,H=Math.min,U=l(function(t){var e=h["__core-js_shared__"]||(h["__core-js_shared__"]={});(t.exports=function(t,n){return e[t]||(e[t]=void 0!==n?n:{})})("versions",[]).push({version:p.version,mode:"pure",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),V=0,W=Math.random(),J=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++V+W).toString(36))},K=U("keys"),B=function(t){return K[t]||(K[t]=J(t))},Y=(F=!1,function(t,e,n){var r,o=I(t),i=$(o.length),s=function(t,e){return(t=a(t))<0?G(t+e,0):H(t,e)}(n,i);if(F&&e!=e){for(;i>s;)if((r=o[s++])!=r)return!0}else for(;i>s;s++)if((F||s in o)&&o[s]===e)return F||s||0;return!F&&-1}),Q=B("IE_PROTO"),X=function(t,e){var n,r=I(t),o=0,i=[];for(n in r)n!=Q&&M(r,n)&&i.push(n);for(;e.length>o;)M(r,n=e[o++])&&(~Y(i,n)||i.push(n));return i},Z="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),tt=Object.keys||function(t){return X(t,Z)},et=m?Object.defineProperties:function(t,e){g(t);for(var n,r=tt(e),o=r.length,i=0;o>i;)E.f(t,n=r[i++],e[n]);return t},nt=h.document,rt=nt&&nt.documentElement,ot=B("IE_PROTO"),it=function(){},st=function(){var t,e=O("iframe"),n=Z.length;for(e.style.display="none",rt.appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),st=t.F;n--;)delete st.prototype[Z[n]];return st()},ct=Object.create||function(t,e){var n;return null!==t?(it.prototype=g(t),n=new it,it.prototype=null,n[ot]=t):n=st(),void 0===e?n:et(n,e)},ut=l(function(t){var e=U("wks"),n=h.Symbol,r="function"==typeof n;(t.exports=function(t){return e[t]||(e[t]=r&&n[t]||(r?n:J)("Symbol."+t))}).store=e}),at=E.f,ft=ut("toStringTag"),lt=function(t,e,n){t&&!M(t=n?t:t.prototype,ft)&&at(t,ft,{configurable:!0,value:e})},ht={};k(ht,ut("iterator"),function(){return this});var pt,vt=function(t,e,n){t.prototype=ct(ht,{next:T(1,n)}),lt(t,e+" Iterator")},dt=function(t){return Object(f(t))},yt=B("IE_PROTO"),gt=Object.prototype,_t=Object.getPrototypeOf||function(t){return t=dt(t),M(t,yt)?t[yt]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?gt:null},mt=ut("iterator"),bt=!([].keys&&"next"in[].keys()),wt=function(){return this},Ot=function(t,e,n,r,o,i,s){vt(n,e,r);var c,u,a,f=function(t){if(!bt&&t in v)return v[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},l=e+" Iterator",h="values"==o,p=!1,v=t.prototype,d=v[mt]||v["@@iterator"]||o&&v[o],y=d||f(o),g=o?h?f("entries"):y:void 0,_="Array"==e&&v.entries||d;if(_&&(a=_t(_.call(new t)))!==Object.prototype&&a.next&&lt(a,l,!0),h&&d&&"values"!==d.name&&(p=!0,y=function(){return d.call(this)}),s&&(bt||p||!v[mt])&&k(v,mt,y),C[e]=y,C[l]=wt,o)if(c={values:h?y:f("values"),keys:i?y:f("keys"),entries:g},s)for(u in c)u in v||L(v,u,c[u]);else A(A.P+A.F*(bt||p),e,c);return c},St=(pt=!0,function(t,e){var n,r,o=String(f(t)),i=a(e),s=o.length;return i<0||i>=s?pt?"":void 0:(n=o.charCodeAt(i))<55296||n>56319||i+1===s||(r=o.charCodeAt(i+1))<56320||r>57343?pt?o.charAt(i):n:pt?o.slice(i,i+2):r-56320+(n-55296<<10)+65536});Ot(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=St(e,n),this._i+=t.length,{value:t,done:!1})});var jt=function(t,e){return{value:e,done:!!t}};Ot(Array,"Array",function(t,e){this._t=I(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,jt(1)):jt(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values");C.Arguments=C.Array;for(var Pt=ut("toStringTag"),Et="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),Tt=0;Tt<Et.length;Tt++){var kt=Et[Tt],xt=h[kt],Mt=xt&&xt.prototype;Mt&&!Mt[Pt]&&k(Mt,Pt,kt),C[kt]=C.Array}var Rt,Ft,At,Lt=ut("toStringTag"),Ct="Arguments"==N(function(){return arguments}()),zt=function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),Lt))?n:Ct?N(e):"Object"==(r=N(e))&&"function"==typeof e.callee?"Arguments":r},Nt=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t},Dt=function(t,e,n,r){try{return r?e(g(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&g(o.call(t)),e}},It=ut("iterator"),qt=Array.prototype,$t=ut("iterator"),Gt=p.getIteratorMethod=function(t){if(null!=t)return t[$t]||t["@@iterator"]||C[zt(t)]},Ht=l(function(t){var e={},n={},r=t.exports=function(t,r,o,i,s){var c,u,a,f,l,h=s?function(){return t}:Gt(t),p=d(o,i,r?2:1),v=0;if("function"!=typeof h)throw TypeError(t+" is not iterable!");if(void 0===(l=h)||C.Array!==l&&qt[It]!==l){for(a=h.call(t);!(u=a.next()).done;)if((f=Dt(a,p,u.value,r))===e||f===n)return f}else for(c=$(t.length);c>v;v++)if((f=r?p(g(u=t[v])[0],u[1]):p(t[v]))===e||f===n)return f};r.BREAK=e,r.RETURN=n}),Ut=ut("species"),Vt=function(t,e){var n,r=g(t).constructor;return void 0===r||null==(n=g(r)[Ut])?e:v(n)},Wt=h.process,Jt=h.setImmediate,Kt=h.clearImmediate,Bt=h.MessageChannel,Yt=h.Dispatch,Qt=0,Xt={},Zt=function(){var t=+this;if(Xt.hasOwnProperty(t)){var e=Xt[t];delete Xt[t],e()}},te=function(t){Zt.call(t.data)};Jt&&Kt||(Jt=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return Xt[++Qt]=function(){!function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}t.apply(n,e)}("function"==typeof t?t:Function(t),e)},Rt(Qt),Qt},Kt=function(t){delete Xt[t]},"process"==N(Wt)?Rt=function(t){Wt.nextTick(d(Zt,t,1))}:Yt&&Yt.now?Rt=function(t){Yt.now(d(Zt,t,1))}:Bt?(At=(Ft=new Bt).port2,Ft.port1.onmessage=te,Rt=d(At.postMessage,At,1)):h.addEventListener&&"function"==typeof postMessage&&!h.importScripts?(Rt=function(t){h.postMessage(t+"","*")},h.addEventListener("message",te,!1)):Rt="onreadystatechange"in O("script")?function(t){rt.appendChild(O("script")).onreadystatechange=function(){rt.removeChild(this),Zt.call(t)}}:function(t){setTimeout(d(Zt,t,1),0)});var ee={set:Jt,clear:Kt},ne=ee.set,re=h.MutationObserver||h.WebKitMutationObserver,oe=h.process,ie=h.Promise,se="process"==N(oe);function ce(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r}),this.resolve=v(e),this.reject=v(n)}var ue={f:function(t){return new ce(t)}},ae=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}},fe=h.navigator,le=fe&&fe.userAgent||"",he=function(t,e){if(g(t),y(e)&&e.constructor===t)return e;var n=ue.f(t);return(0,n.resolve)(e),n.promise},pe=function(t,e,n){for(var r in e)n&&t[r]?t[r]=e[r]:k(t,r,e[r]);return t},ve=ut("species"),de=function(t){var e="function"==typeof p[t]?p[t]:h[t];m&&e&&!e[ve]&&E.f(e,ve,{configurable:!0,get:function(){return this}})},ye=ut("iterator"),ge=!1;try{var _e=[7][ye]();_e.return=function(){ge=!0},Array.from(_e,function(){throw 2})}catch(t){}var me,be,we,Oe,Se,je=ee.set,Pe=function(){var t,e,n,r=function(){var r,o;for(se&&(r=oe.domain)&&r.exit();t;){o=t.fn,t=t.next;try{o()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(se)n=function(){oe.nextTick(r)};else if(!re||h.navigator&&h.navigator.standalone)if(ie&&ie.resolve){var o=ie.resolve(void 0);n=function(){o.then(r)}}else n=function(){ne.call(h,r)};else{var i=!0,s=document.createTextNode("");new re(r).observe(s,{characterData:!0}),n=function(){s.data=i=!i}}return function(r){var o={fn:r,next:void 0};e&&(e.next=o),t||(t=o,n()),e=o}}(),Ee=h.TypeError,Te=h.process,ke=Te&&Te.versions,xe=ke&&ke.v8||"",Me=h.Promise,Re="process"==zt(Te),Fe=function(){},Ae=be=ue.f,Le=!!function(){try{var t=Me.resolve(1),e=(t.constructor={})[ut("species")]=function(t){t(Fe,Fe)};return(Re||"function"==typeof PromiseRejectionEvent)&&t.then(Fe)instanceof e&&0!==xe.indexOf("6.6")&&-1===le.indexOf("Chrome/66")}catch(t){}}(),Ce=function(t){var e;return!(!y(t)||"function"!=typeof(e=t.then))&&e},ze=function(t,e){if(!t._n){t._n=!0;var n=t._c;Pe(function(){for(var r=t._v,o=1==t._s,i=0,s=function(e){var n,i,s,c=o?e.ok:e.fail,u=e.resolve,a=e.reject,f=e.domain;try{c?(o||(2==t._h&&Ie(t),t._h=1),!0===c?n=r:(f&&f.enter(),n=c(r),f&&(f.exit(),s=!0)),n===e.promise?a(Ee("Promise-chain cycle")):(i=Ce(n))?i.call(n,u,a):u(n)):a(r)}catch(t){f&&!s&&f.exit(),a(t)}};n.length>i;)s(n[i++]);t._c=[],t._n=!1,e&&!t._h&&Ne(t)})}},Ne=function(t){je.call(h,function(){var e,n,r,o=t._v,i=De(t);if(i&&(e=ae(function(){Re?Te.emit("unhandledRejection",o,t):(n=h.onunhandledrejection)?n({promise:t,reason:o}):(r=h.console)&&r.error&&r.error("Unhandled promise rejection",o)}),t._h=Re||De(t)?2:1),t._a=void 0,i&&e.e)throw e.v})},De=function(t){return 1!==t._h&&0===(t._a||t._c).length},Ie=function(t){je.call(h,function(){var e;Re?Te.emit("rejectionHandled",t):(e=h.onrejectionhandled)&&e({promise:t,reason:t._v})})},qe=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),ze(e,!0))},$e=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw Ee("Promise can't be resolved itself");(e=Ce(t))?Pe(function(){var r={_w:n,_d:!1};try{e.call(t,d($e,r,1),d(qe,r,1))}catch(t){qe.call(r,t)}}):(n._v=t,n._s=1,ze(n,!1))}catch(t){qe.call({_w:n,_d:!1},t)}}};Le||(Me=function(t){Nt(this,Me,"Promise","_h"),v(t),me.call(this);try{t(d($e,this,1),d(qe,this,1))}catch(t){qe.call(this,t)}},(me=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=pe(Me.prototype,{then:function(t,e){var n=Ae(Vt(this,Me));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=Re?Te.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&ze(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),we=function(){var t=new me;this.promise=t,this.resolve=d($e,t,1),this.reject=d(qe,t,1)},ue.f=Ae=function(t){return t===Me||t===Oe?new we(t):be(t)}),A(A.G+A.W+A.F*!Le,{Promise:Me}),lt(Me,"Promise"),de("Promise"),Oe=p.Promise,A(A.S+A.F*!Le,"Promise",{reject:function(t){var e=Ae(this);return(0,e.reject)(t),e.promise}}),A(A.S+!0*A.F,"Promise",{resolve:function(t){return he(this===Oe?Me:this,t)}}),A(A.S+A.F*!(Le&&function(t,e){if(!e&&!ge)return!1;var n=!1;try{var r=[7],o=r[ye]();o.next=function(){return{done:n=!0}},r[ye]=function(){return o},t(r)}catch(t){}return n}(function(t){Me.all(t).catch(Fe)})),"Promise",{all:function(t){var e=this,n=Ae(e),r=n.resolve,o=n.reject,i=ae(function(){var n=[],i=0,s=1;Ht(t,!1,function(t){var c=i++,u=!1;n.push(void 0),s++,e.resolve(t).then(function(t){u||(u=!0,n[c]=t,--s||r(n))},o)}),--s||r(n)});return i.e&&o(i.v),n.promise},race:function(t){var e=this,n=Ae(e),r=n.reject,o=ae(function(){Ht(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}}),A(A.P+A.R,"Promise",{finally:function(t){var e=Vt(this,p.Promise||h.Promise),n="function"==typeof t;return this.then(n?function(n){return he(e,t()).then(function(){return n})}:t,n?function(n){return he(e,t()).then(function(){throw n})}:t)}}),A(A.S,"Promise",{try:function(t){var e=ue.f(this),n=ae(t);return(n.e?e.reject:e.resolve)(n.v),e.promise}}),(Se=s)&&Se.default;var Ge=p.Promise,He={f:{}.propertyIsEnumerable},Ue=Object.getOwnPropertyDescriptor,Ve={f:m?Ue:function(t,e){if(t=I(t),e=j(e,!0),S)try{return Ue(t,e)}catch(t){}if(M(t,e))return T(!He.f.call(t,e),t[e])}},We=function(t,e){var n=(p.Object||{})[t]||Object[t],r={};r[t]=e(n),A(A.S+A.F*_(function(){n(1)}),"Object",r)},Je=Ve.f;We("getOwnPropertyDescriptor",function(){return function(t,e){return Je(I(t),e)}});var Ke=p.Object,Be=function(t,e){return Ke.getOwnPropertyDescriptor(t,e)},Ye=l(function(t){var e=J("meta"),n=E.f,r=0,o=Object.isExtensible||function(){return!0},i=!_(function(){return o(Object.preventExtensions({}))}),s=function(t){n(t,e,{value:{i:"O"+ ++r,w:{}}})},c=t.exports={KEY:e,NEED:!1,fastKey:function(t,n){if(!y(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!M(t,e)){if(!o(t))return"F";if(!n)return"E";s(t)}return t[e].i},getWeak:function(t,n){if(!M(t,e)){if(!o(t))return!0;if(!n)return!1;s(t)}return t[e].w},onFreeze:function(t){return i&&c.NEED&&o(t)&&!M(t,e)&&s(t),t}}}),Qe=(Ye.KEY,Ye.NEED,Ye.fastKey,Ye.getWeak,Ye.onFreeze,{f:ut}),Xe=E.f,Ze=function(t){var e=p.Symbol||(p.Symbol={});"_"==t.charAt(0)||t in e||Xe(e,t,{value:Qe.f(t)})},tn={f:Object.getOwnPropertySymbols},en=Array.isArray||function(t){return"Array"==N(t)},nn=Z.concat("length","prototype"),rn={f:Object.getOwnPropertyNames||function(t){return X(t,nn)}},on=rn.f,sn={}.toString,cn="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],un={f:function(t){return cn&&"[object Window]"==sn.call(t)?function(t){try{return on(t)}catch(t){return cn.slice()}}(t):on(I(t))}},an=Ye.KEY,fn=Ve.f,ln=E.f,hn=un.f,pn=h.Symbol,vn=h.JSON,dn=vn&&vn.stringify,yn=ut("_hidden"),gn=ut("toPrimitive"),_n={}.propertyIsEnumerable,mn=U("symbol-registry"),bn=U("symbols"),wn=U("op-symbols"),On=Object.prototype,Sn="function"==typeof pn&&!!tn.f,jn=h.QObject,Pn=!jn||!jn.prototype||!jn.prototype.findChild,En=m&&_(function(){return 7!=ct(ln({},"a",{get:function(){return ln(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=fn(On,e);r&&delete On[e],ln(t,e,n),r&&t!==On&&ln(On,e,r)}:ln,Tn=function(t){var e=bn[t]=ct(pn.prototype);return e._k=t,e},kn=Sn&&"symbol"==typeof pn.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof pn},xn=function(t,e,n){return t===On&&xn(wn,e,n),g(t),e=j(e,!0),g(n),M(bn,e)?(n.enumerable?(M(t,yn)&&t[yn][e]&&(t[yn][e]=!1),n=ct(n,{enumerable:T(0,!1)})):(M(t,yn)||ln(t,yn,T(1,{})),t[yn][e]=!0),En(t,e,n)):ln(t,e,n)},Mn=function(t,e){g(t);for(var n,r=function(t){var e=tt(t),n=tn.f;if(n)for(var r,o=n(t),i=He.f,s=0;o.length>s;)i.call(t,r=o[s++])&&e.push(r);return e}(e=I(e)),o=0,i=r.length;i>o;)xn(t,n=r[o++],e[n]);return t},Rn=function(t){var e=_n.call(this,t=j(t,!0));return!(this===On&&M(bn,t)&&!M(wn,t))&&(!(e||!M(this,t)||!M(bn,t)||M(this,yn)&&this[yn][t])||e)},Fn=function(t,e){if(t=I(t),e=j(e,!0),t!==On||!M(bn,e)||M(wn,e)){var n=fn(t,e);return!n||!M(bn,e)||M(t,yn)&&t[yn][e]||(n.enumerable=!0),n}},An=function(t){for(var e,n=hn(I(t)),r=[],o=0;n.length>o;)M(bn,e=n[o++])||e==yn||e==an||r.push(e);return r},Ln=function(t){for(var e,n=t===On,r=hn(n?wn:I(t)),o=[],i=0;r.length>i;)!M(bn,e=r[i++])||n&&!M(On,e)||o.push(bn[e]);return o};Sn||(L((pn=function(){if(this instanceof pn)throw TypeError("Symbol is not a constructor!");var t=J(arguments.length>0?arguments[0]:void 0),e=function(n){this===On&&e.call(wn,n),M(this,yn)&&M(this[yn],t)&&(this[yn][t]=!1),En(this,t,T(1,n))};return m&&Pn&&En(On,t,{configurable:!0,set:e}),Tn(t)}).prototype,"toString",function(){return this._k}),Ve.f=Fn,E.f=xn,rn.f=un.f=An,He.f=Rn,tn.f=Ln,Qe.f=function(t){return Tn(ut(t))}),A(A.G+A.W+A.F*!Sn,{Symbol:pn});for(var Cn="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),zn=0;Cn.length>zn;)ut(Cn[zn++]);for(var Nn=tt(ut.store),Dn=0;Nn.length>Dn;)Ze(Nn[Dn++]);A(A.S+A.F*!Sn,"Symbol",{for:function(t){return M(mn,t+="")?mn[t]:mn[t]=pn(t)},keyFor:function(t){if(!kn(t))throw TypeError(t+" is not a symbol!");for(var e in mn)if(mn[e]===t)return e},useSetter:function(){Pn=!0},useSimple:function(){Pn=!1}}),A(A.S+A.F*!Sn,"Object",{create:function(t,e){return void 0===e?ct(t):Mn(ct(t),e)},defineProperty:xn,defineProperties:Mn,getOwnPropertyDescriptor:Fn,getOwnPropertyNames:An,getOwnPropertySymbols:Ln});var In=_(function(){tn.f(1)});A(A.S+A.F*In,"Object",{getOwnPropertySymbols:function(t){return tn.f(dt(t))}}),vn&&A(A.S+A.F*(!Sn||_(function(){var t=pn();return"[null]"!=dn([t])||"{}"!=dn({a:t})||"{}"!=dn(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);if(n=e=r[1],(y(e)||void 0!==t)&&!kn(t))return en(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!kn(e))return e}),r[1]=e,dn.apply(vn,r)}}),pn.prototype[gn]||k(pn.prototype,gn,pn.prototype.valueOf),lt(pn,"Symbol"),lt(Math,"Math",!0),lt(h.JSON,"JSON",!0);var qn=p.Object.getOwnPropertySymbols;We("keys",function(){return function(t){return tt(dt(t))}});var $n=p.Object.keys;A(A.S+A.F*!m,"Object",{defineProperty:E.f});var Gn=p.Object,Hn=function(t,e,n){return Gn.defineProperty(t,e,n)};var Un=function(t,e,n){return e in t?Hn(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};var Vn=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=$n(n);"function"==typeof qn&&(r=r.concat(qn(n).filter(function(t){return Be(n,t).enumerable}))),r.forEach(function(e){Un(t,e,n[e])})}return t},Wn=function(t,e){if(!y(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t},Jn=E.f,Kn=Ye.fastKey,Bn=m?"_s":"size",Yn=function(t,e){var n,r=Kn(e);if("F"!==r)return t._i[r];for(n=t._f;n;n=n.n)if(n.k==e)return n},Qn={getConstructor:function(t,e,n,r){var o=t(function(t,i){Nt(t,o,e,"_i"),t._t=e,t._i=ct(null),t._f=void 0,t._l=void 0,t[Bn]=0,null!=i&&Ht(i,n,t[r],t)});return pe(o.prototype,{clear:function(){for(var t=Wn(this,e),n=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];t._f=t._l=void 0,t[Bn]=0},delete:function(t){var n=Wn(this,e),r=Yn(n,t);if(r){var o=r.n,i=r.p;delete n._i[r.i],r.r=!0,i&&(i.n=o),o&&(o.p=i),n._f==r&&(n._f=o),n._l==r&&(n._l=i),n[Bn]--}return!!r},forEach:function(t){Wn(this,e);for(var n,r=d(t,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(t){return!!Yn(Wn(this,e),t)}}),m&&Jn(o.prototype,"size",{get:function(){return Wn(this,e)[Bn]}}),o},def:function(t,e,n){var r,o,i=Yn(t,e);return i?i.v=n:(t._l=i={i:o=Kn(e,!0),k:e,v:n,p:r=t._l,n:void 0,r:!1},t._f||(t._f=i),r&&(r.n=i),t[Bn]++,"F"!==o&&(t._i[o]=i)),t},getEntry:Yn,setStrong:function(t,e,n){Ot(t,e,function(t,n){this._t=Wn(t,e),this._k=n,this._l=void 0},function(){for(var t=this._k,e=this._l;e&&e.r;)e=e.p;return this._t&&(this._l=e=e?e.n:this._t._f)?jt(0,"keys"==t?e.k:"values"==t?e.v:[e.k,e.v]):(this._t=void 0,jt(1))},n?"entries":"values",!n,!0),de(e)}},Xn=ut("species"),Zn=function(t,e){return new(function(t){var e;return en(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!en(e.prototype)||(e=void 0),y(e)&&null===(e=e[Xn])&&(e=void 0)),void 0===e?Array:e}(t))(e)},tr=E.f,er=function(t,e){var n=1==t,r=2==t,o=3==t,i=4==t,s=6==t,c=5==t||s,u=e||Zn;return function(e,a,f){for(var l,h,p=dt(e),v=D(p),y=d(a,f,3),g=$(v.length),_=0,m=n?u(e,g):r?u(e,0):void 0;g>_;_++)if((c||_ in v)&&(h=y(l=v[_],_,p),t))if(n)m[_]=h;else if(h)switch(t){case 3:return!0;case 5:return l;case 6:return _;case 2:m.push(l)}else if(i)return!1;return s?-1:o||i?i:m}}(0);!function(t,e,n,r,o,i){var s=h[t],c=s,u=o?"set":"add",a=c&&c.prototype,f={};m&&"function"==typeof c&&(i||a.forEach&&!_(function(){(new c).entries().next()}))?(c=e(function(e,n){Nt(e,c,t,"_c"),e._c=new s,null!=n&&Ht(n,o,e[u],e)}),er("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(t){var e="add"==t||"set"==t;t in a&&(!i||"clear"!=t)&&k(c.prototype,t,function(n,r){if(Nt(this,c,t),!e&&i&&!y(n))return"get"==t&&void 0;var o=this._c[t](0===n?0:n,r);return e?this:o})}),i||tr(c.prototype,"size",{get:function(){return this._c.size}})):(c=r.getConstructor(e,t,o,u),pe(c.prototype,n),Ye.NEED=!0),lt(c,t),f[t]=c,A(A.G+A.W+A.F,f),i||r.setStrong(c,t,o)}("Map",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{get:function(t){var e=Qn.getEntry(Wn(this,"Map"),t);return e&&e.v},set:function(t,e){return Qn.def(Wn(this,"Map"),0===t?0:t,e)}},Qn,!0);A(A.P+A.R,"Map",{toJSON:function(t){return function(){if(zt(this)!=t)throw TypeError(t+"#toJSON isn't generic");return function(t,e){var n=[];return Ht(t,!1,n.push,n,e),n}(this)}}("Map")});var nr;nr="Map",A(A.S,nr,{of:function(){for(var t=arguments.length,e=new Array(t);t--;)e[t]=arguments[t];return new this(e)}});!function(t){A(A.S,t,{from:function(t){var e,n,r,o,i=arguments[1];return v(this),(e=void 0!==i)&&v(i),null==t?new this:(n=[],e?(r=0,o=d(i,arguments[2],2),Ht(t,!1,function(t){n.push(o(t,r++))})):Ht(t,!1,n.push,n),new this(n))}})}("Map");var rr=p.Map,or=Object.assign,ir=!or||_(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=or({},t)[n]||Object.keys(or({},e)).join("")!=r})?function(t,e){for(var n=dt(t),r=arguments.length,o=1,i=tn.f,s=He.f;r>o;)for(var c,u=D(arguments[o++]),a=i?tt(u).concat(i(u)):tt(u),f=a.length,l=0;f>l;)c=a[l++],m&&!s.call(u,c)||(n[c]=u[c]);return n}:or;A(A.S+A.F,"Object",{assign:ir});var sr=p.Object.assign,cr="object"==typeof global&&global&&global.Object===Object&&global,ur="object"==typeof self&&self&&self.Object===Object&&self,ar=cr||ur||Function("return this")(),fr=ar.Symbol,lr=Object.prototype,hr=lr.hasOwnProperty,pr=lr.toString,vr=fr?fr.toStringTag:void 0;var dr=Object.prototype.toString;var yr="[object Null]",gr="[object Undefined]",_r=fr?fr.toStringTag:void 0;function mr(t){return null==t?void 0===t?gr:yr:_r&&_r in Object(t)?function(t){var e=hr.call(t,vr),n=t[vr];try{t[vr]=void 0;var r=!0}catch(t){}var o=pr.call(t);return r&&(e?t[vr]=n:delete t[vr]),o}(t):function(t){return dr.call(t)}(t)}function br(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var wr="[object AsyncFunction]",Or="[object Function]",Sr="[object GeneratorFunction]",jr="[object Proxy]";var Pr,Er=ar["__core-js_shared__"],Tr=(Pr=/[^.]+$/.exec(Er&&Er.keys&&Er.keys.IE_PROTO||""))?"Symbol(src)_1."+Pr:"";var kr=Function.prototype.toString;var xr=/^\[object .+?Constructor\]$/,Mr=Function.prototype,Rr=Object.prototype,Fr=Mr.toString,Ar=Rr.hasOwnProperty,Lr=RegExp("^"+Fr.call(Ar).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Cr(t){return!(!br(t)||(e=t,Tr&&Tr in e))&&(function(t){if(!br(t))return!1;var e=mr(t);return e==Or||e==Sr||e==wr||e==jr}(t)?Lr:xr).test(function(t){if(null!=t){try{return kr.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t));var e}function zr(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return Cr(n)?n:void 0}var Nr=zr(Object,"create");var Dr="__lodash_hash_undefined__",Ir=Object.prototype.hasOwnProperty;var qr=Object.prototype.hasOwnProperty;var $r="__lodash_hash_undefined__";function Gr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Hr(t,e){for(var n,r,o=t.length;o--;)if((n=t[o][0])===(r=e)||n!=n&&r!=r)return o;return-1}Gr.prototype.clear=function(){this.__data__=Nr?Nr(null):{},this.size=0},Gr.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Gr.prototype.get=function(t){var e=this.__data__;if(Nr){var n=e[t];return n===Dr?void 0:n}return Ir.call(e,t)?e[t]:void 0},Gr.prototype.has=function(t){var e=this.__data__;return Nr?void 0!==e[t]:qr.call(e,t)},Gr.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Nr&&void 0===e?$r:e,this};var Ur=Array.prototype.splice;function Vr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Vr.prototype.clear=function(){this.__data__=[],this.size=0},Vr.prototype.delete=function(t){var e=this.__data__,n=Hr(e,t);return!(n<0||(n==e.length-1?e.pop():Ur.call(e,n,1),--this.size,0))},Vr.prototype.get=function(t){var e=this.__data__,n=Hr(e,t);return n<0?void 0:e[n][1]},Vr.prototype.has=function(t){return Hr(this.__data__,t)>-1},Vr.prototype.set=function(t,e){var n=this.__data__,r=Hr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var Wr=zr(ar,"Map");function Jr(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function Kr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Kr.prototype.clear=function(){this.size=0,this.__data__={hash:new Gr,map:new(Wr||Vr),string:new Gr}},Kr.prototype.delete=function(t){var e=Jr(this,t).delete(t);return this.size-=e?1:0,e},Kr.prototype.get=function(t){return Jr(this,t).get(t)},Kr.prototype.has=function(t){return Jr(this,t).has(t)},Kr.prototype.set=function(t,e){var n=Jr(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var Br="__lodash_hash_undefined__";function Yr(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Kr;++e<n;)this.add(t[e])}function Qr(t){return t!=t}function Xr(t,e){return!!(null==t?0:t.length)&&function(t,e,n){return e==e?function(t,e,n){for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}(t,e,n):function(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}(t,Qr,n)}(t,e,0)>-1}function Zr(t,e,n){for(var r=-1,o=null==t?0:t.length;++r<o;)if(n(e,t[r]))return!0;return!1}function to(t,e){return t.has(e)}Yr.prototype.add=Yr.prototype.push=function(t){return this.__data__.set(t,Br),this},Yr.prototype.has=function(t){return this.__data__.has(t)};var eo=zr(ar,"Set");function no(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}var ro=eo&&1/no(new eo([,-0]))[1]==1/0?function(t){return new eo(t)}:function(){},oo=200;function io(t,e){return e="function"==typeof e?e:void 0,t&&t.length?function(t,e,n){var r=-1,o=Xr,i=t.length,s=!0,c=[],u=c;if(n)s=!1,o=Zr;else if(i>=oo){var a=e?null:ro(t);if(a)return no(a);s=!1,o=to,u=new Yr}else u=e?[]:c;t:for(;++r<i;){var f=t[r],l=e?e(f):f;if(f=n||0!==f?f:0,s&&l==l){for(var h=u.length;h--;)if(u[h]===l)continue t;e&&u.push(l),c.push(f)}else o(u,l,n)||(u!==c&&u.push(l),c.push(f))}return c}(t,void 0,e):[]}const so=global.navigator&&global.navigator.userAgent?r.getParser(global.navigator.userAgent).getBrowser():null,co=so&&so.name&&so.version?{name:so.name,version:so.version}:null;class uo{constructor(t={}){sr(this,{version:"1.2",entries:[],pages:[]},t),!this.browser&&co&&(this.browser=co)}addEntries(t=[]){this.entries=io([...t,...this.entries],(t,e)=>t._id===e._id&&t._order===e._order),this.sortEntries()}sortEntries(){this.entries=this.entries.sort((t,e)=>new Date(t.startedDateTime)-new Date(e.startedDateTime))}}class ao{constructor(t={}){this.log=new uo(t.log)}}var fo="\t\n\v\f\r   ᠎             　\u2028\u2029\ufeff",lo="["+fo+"]",ho=RegExp("^"+lo+lo+"*"),po=RegExp(lo+lo+"*$"),vo=function(t,e,n){var r={},o=_(function(){return!!fo[t]()||"​"!="​"[t]()}),i=r[t]=o?e(yo):fo[t];n&&(r[n]=i),A(A.P+A.F*o,"String",r)},yo=vo.trim=function(t,e){return t=String(f(t)),1&e&&(t=t.replace(ho,"")),2&e&&(t=t.replace(po,"")),t},go=vo,_o=h.parseInt,mo=go.trim,bo=/^[-+]?0[xX]/,wo=8!==_o(fo+"08")||22!==_o(fo+"0x16")?function(t,e){var n=mo(String(t),3);return _o(n,e>>>0||(bo.test(n)?16:10))}:_o;A(A.G+A.F*(parseInt!=wo),{parseInt:wo});var Oo=p.parseInt;const{keys:So}=Object,{isArray:jo}=Array;function Po(t){return So(t||{}).reduce((e,n)=>{const r=t[n];return jo(r)?e.push(...r.map(t=>({name:n,value:t,_fromType:"array"}))):e.push({name:n,value:r}),e},[])}const{isArray:Eo}=Array;function To(t,e){const n=t.getHeader(e);return Eo(n)?n.length>0?n[0]:"":n}class ko{constructor(t){this.httpVersion="HTTP/1.1",this.url=t.absoluteUrl,this.method=t.method,this.headers=Po(t.headers),this.headersSize=function(t){const e=[],n=[];t.headers.forEach(({name:t,value:r})=>{e.push(t),n.push(r)});const r=t.method+t.url+e.join()+n.join();return o(r)+2*e.length+2+12+2}(this),this.queryString=Po(t.query),this.cookies=i.parse(t.getHeader("Set-Cookie")),t.body&&(this.postData={mimeType:To(t,"Content-Type")||"text/plain",params:[]},"string"==typeof t.body&&(this.postData.text=t.body));const e=To(t,"Content-Length");this.bodySize=e?Oo(e,10):this.postData&&this.postData.text?o(this.postData.text):0}}class xo{constructor(t){this.httpVersion="HTTP/1.1",this.status=t.statusCode,this.statusText=t.statusText,this.headers=Po(t.headers),this.headersSize=function(t){const e=[],n=[];t.headers.forEach(({name:t,value:r})=>{e.push(t),n.push(r)});const r=e.join()+n.join();return o(r)+2*e.length+2+2}(this),this.cookies=i.parse(t.getHeader("Set-Cookie")),this.redirectURL=To(t,"Location")||"",this.content={mimeType:To(t,"Content-Type")||"text/plain"},t.body&&"string"==typeof t.body&&(this.content.text=t.body);const e=To(t,"Content-Length");this.content.size=e?Oo(e,10):this.content.text?o(this.content.text):0,this.bodySize=this.content.size}}const{keys:Mo}=Object;class Ro{constructor(t){this._id=t.id,this._order=t.order,this.startedDateTime=t.timestamp,this.request=new ko(t),this.response=new xo(t.response),this.cache={},this.timings={blocked:-1,dns:-1,connect:-1,send:0,wait:t.responseTime,receive:0,ssl:-1},this.time=function(t={}){return Mo(t).reduce((e,n)=>t[n]>0?e+=t[n]:e,0)}(this.timings)}}const Fo="Polly.JS";export default class{constructor(t){this.polly=t,this.pending=new rr,this._cache=new rr}static get type(){return"persister"}static get name(){e("Must override the static `name` getter.")}get defaultOptions(){return{}}get options(){const{name:t}=this.constructor;return Vn({},this.defaultOptions||{},(this.polly.config.persisterOptions||{})[t]||{})}get hasPending(){return this.pending.size>0}async persist(){if(!this.hasPending)return;const t=[],e={name:Fo,version:this.polly.constructor.VERSION,comment:`${this.constructor.type}:${this.constructor.name}`};for(const[n,{name:r,requests:o}]of this.pending){const i=[],s=await this.find(n);let c;c=new ao(s||{log:{creator:e,_recordingName:r}});for(const t of o){const e=new Ro(t);this.assert(`Cannot persist response for [${e.request.method}] ${e.request.url} because the status code was ${e.response.status} and \`recordFailedRequests\` is \`false\``,t.response.ok||t.config.recordFailedRequests),await t._emit("beforePersist",e),i.push(e)}c.log.addEntries(i),this.polly.config.persisterOptions.keepUnusedRequests||this._removeUnusedEntries(n,c),t.push(this.save(n,c))}await Ge.all(t),this.pending.clear()}recordRequest(t){this.assert("You must pass a PollyRequest to 'recordRequest'.",t),this.assert("Cannot save a request with no response.",t.didRespond);const{recordingId:e,recordingName:n}=t;this.pending.has(e)||this.pending.set(e,{name:n,requests:[]}),this.pending.get(e).requests.push(t)}async find(t){const{_cache:e}=this;if(!e.has(t)){const n=async()=>{const n=await this.findRecording(t);return n?(this.assert(`Recording with id '${t}' is invalid. Please delete the recording so a new one can be created.`,n.log&&n.log.creator.name===Fo),n):(e.delete(t),null)};e.set(t,n())}return e.get(t)}async save(t){await this.saveRecording(...arguments),this._cache.delete(t)}async delete(t){await this.deleteRecording(...arguments),this._cache.delete(t)}async findEntry(t){const{id:e,order:n,recordingId:r}=t,o=await this.find(r);return o&&o.log.entries.find(t=>t._id===e&&t._order===n)||null}stringify(){return t(...arguments)}assert(t,...n){e(`[${this.constructor.type}:${this.constructor.name}] ${t}`,...n)}_removeUnusedEntries(t,e){const r=this.polly._requests.filter(e=>e.recordingId===t&&(e.action===n.RECORD||e.action===n.REPLAY));e.log.entries=e.log.entries.filter(t=>r.find(e=>t._id===e.id&&t._order===e.order))}findRecording(){this.assert("Must implement the `findRecording` hook.")}saveRecording(){this.assert("Must implement the `saveRecording` hook.")}deleteRecording(){this.assert("Must implement the `deleteRecording` hook.")}}
  //# sourceMappingURL=pollyjs-persister.min.js.map
  