@okta/okta-auth-js 6.3.0 → 6.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see okta-auth-js.umd.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.OktaAuth=t():e.OktaAuth=t()}(self,(function(){return function(){var e={506:function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},575:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},100:function(e,t,n){var r=n(489),o=n(67);function i(t,n,a){return o()?(e.exports=i=Reflect.construct,e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=i=function(e,t,n){var o=[null];o.push.apply(o,t);var i=new(Function.bind.apply(e,o));return n&&r(i,n.prototype),i},e.exports.default=e.exports,e.exports.__esModule=!0),i.apply(null,arguments)}e.exports=i,e.exports.default=e.exports,e.exports.__esModule=!0},913:function(e){function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},754:function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,t(n)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0},205:function(e,t,n){var r=n(489);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},430:function(e){e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")},e.exports.default=e.exports,e.exports.__esModule=!0},67:function(e){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.default=e.exports,e.exports.__esModule=!0},585:function(e,t,n){var r=n(8).default,o=n(506);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},489:function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,t(n,r)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0},8:function(e){function t(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=t=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),t(n)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0},957:function(e,t,n){var r=n(754),o=n(489),i=n(430),a=n(100);function s(t){var n="function"==typeof Map?new Map:void 0;return e.exports=s=function(e){if(null===e||!i(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return a(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o(t,e)},e.exports.default=e.exports,e.exports.__esModule=!0,s(t)}e.exports=s,e.exports.default=e.exports,e.exports.__esModule=!0},757:function(e,t,n){e.exports=n(666)},615:function(e,t,n){"use strict";var r=n(575),o=n(913),i=n(205),a=n(585),s=n(754);function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var c=function(e){i(c,e);var t,n,u=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=s(t);if(n){var o=s(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return a(this,e)});function c(e){var t;return r(this,c),(t=u.call(this,e||"Promise was canceled")).name="CancelError",t}return o(c,[{key:"isCanceled",get:function(){return!0}}]),c}(n(957)(Error)),l=function(){function e(t){var n=this;r(this,e),this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((function(e,r){n._reject=r;var o=function(e){if(!n._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");n._cancelHandlers.push(e)};return Object.defineProperties(o,{shouldReject:{get:function(){return n._rejectOnCancel},set:function(e){n._rejectOnCancel=e}}}),t((function(t){n._isCanceled&&o.shouldReject||(n._isPending=!1,e(t))}),(function(e){n._isPending=!1,r(e)}),o)}))}return o(e,[{key:"then",value:function(e,t){return this._promise.then(e,t)}},{key:"catch",value:function(e){return this._promise.catch(e)}},{key:"finally",value:function(e){return this._promise.finally(e)}},{key:"cancel",value:function(e){if(this._isPending&&!this._isCanceled){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{var t,n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(this._cancelHandlers);try{for(n.s();!(t=n.n()).done;)(0,t.value)()}catch(e){n.e(e)}finally{n.f()}}catch(e){return void this._reject(e)}this._rejectOnCancel&&this._reject(new c(e))}}},{key:"isCanceled",get:function(){return this._isCanceled}}],[{key:"fn",value:function(t){return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return new e((function(e,n,o){r.push(o),t.apply(void 0,r).then(e,n)}))}}}]),e}();Object.setPrototypeOf(l.prototype,Promise.prototype),e.exports=l,e.exports.CancelError=c},98:function(e,t){var n="undefined"!=typeof self?self:this,r=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,o="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),i="FormData"in e,a="ArrayBuffer"in e;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function v(e){var t=new FileReader,n=p(t);return t.readAsArrayBuffer(e),n}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:o&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&o&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=y(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var e,t,n,r=d(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,n=p(t=new FileReader),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(k)}),this.json=function(){return this.text().then(JSON.parse)},this}h.prototype.append=function(e,t){e=c(e),t=l(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},h.prototype.delete=function(e){delete this.map[c(e)]},h.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},h.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},h.prototype.set=function(e,t){this.map[c(e)]=l(t)},h.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},h.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),f(e)},h.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),f(e)},h.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),f(e)},r&&(h.prototype[Symbol.iterator]=h.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var n,r,o=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new h(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new h(t.headers)),this.method=(r=(n=t.method||this.method||"GET").toUpperCase(),m.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function k(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}})),t}function w(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},g.call(b.prototype),g.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var T=[301,302,303,307,308];w.redirect=function(e,t){if(-1===T.indexOf(t))throw new RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function S(e,n){return new Promise((function(r,i){var a=new b(e,n);if(a.signal&&a.signal.aborted)return i(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new h,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}})),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var o="response"in s?s.response:s.responseText;r(new w(o,n))},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request failed"))},s.onabort=function(){i(new t.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",u)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}S.polyfill=!0,e.fetch||(e.fetch=S,e.Headers=h,e.Request=b,e.Response=w),t.Headers=h,t.Request=b,t.Response=w,t.fetch=S,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var o=r;(t=o.fetch).default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t},643:function(e){e.exports=!1},187:function(e){"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}v(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,o)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var o,i,a,c;if(s(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=u(e))>0&&a.length>o&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,c=l,console&&console.warn&&console.warn(c)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=l.bind(r);return o.listener=n,r.wrapFn=o,o}function h(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):p(o,o.length)}function d(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function v(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){r.once&&e.removeEventListener(t,o),n(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return u(this)},i.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)r(u,this,t);else{var c=u.length,l=p(u,c);for(n=0;n<c;++n)r(l[n],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return s(t),this.on(e,f(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,f(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,r,o,i,a;if(s(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return h(this,e,!0)},i.prototype.rawListeners=function(e){return h(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},i.prototype.listenerCount=d,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},321:function(e,t,n){(function(){(e.exports=n(282)).version="5.1.2"}).call(this)},282:function(e,t,n){(function(){var t,r,o=[].splice,i=function(e,t){if(!(e instanceof t))throw new Error("Bound instance method accessed before binding")},a=[].indexOf;r=n(392),t=n(187).EventEmitter,e.exports=function(){class e extends t{constructor(e={}){super(),this.get=this.get.bind(this),this.mget=this.mget.bind(this),this.set=this.set.bind(this),this.mset=this.mset.bind(this),this.del=this.del.bind(this),this.take=this.take.bind(this),this.ttl=this.ttl.bind(this),this.getTtl=this.getTtl.bind(this),this.keys=this.keys.bind(this),this.has=this.has.bind(this),this.getStats=this.getStats.bind(this),this.flushAll=this.flushAll.bind(this),this.flushStats=this.flushStats.bind(this),this.close=this.close.bind(this),this._checkData=this._checkData.bind(this),this._check=this._check.bind(this),this._isInvalidKey=this._isInvalidKey.bind(this),this._wrap=this._wrap.bind(this),this._getValLength=this._getValLength.bind(this),this._error=this._error.bind(this),this._initErrors=this._initErrors.bind(this),this.options=e,this._initErrors(),this.data={},this.options=Object.assign({forceString:!1,objectValueSize:80,promiseValueSize:80,arrayValueSize:40,stdTTL:0,checkperiod:600,useClones:!0,deleteOnExpire:!0,enableLegacyCallbacks:!1,maxKeys:-1},this.options),this.options.enableLegacyCallbacks&&(console.warn("WARNING! node-cache legacy callback support will drop in v6.x"),["get","mget","set","del","ttl","getTtl","keys","has"].forEach((e=>{var t;t=this[e],this[e]=function(...e){var n,r;if(r=e,[...e]=r,[n]=o.call(e,-1),"function"!=typeof n)return t(...e,n);try{n(null,t(...e))}catch(e){n(e)}}}))),this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this.validKeyTypes=["string","number"],this._checkData()}get(t){var n;if(i(this,e),null!=(n=this._isInvalidKey(t)))throw n;return null!=this.data[t]&&this._check(t,this.data[t])?(this.stats.hits++,this._unwrap(this.data[t])):void this.stats.misses++}mget(t){var n,r,o,a,s;if(i(this,e),!Array.isArray(t))throw this._error("EKEYSTYPE");for(s={},r=0,a=t.length;r<a;r++){if(o=t[r],null!=(n=this._isInvalidKey(o)))throw n;null!=this.data[o]&&this._check(o,this.data[o])?(this.stats.hits++,s[o]=this._unwrap(this.data[o])):this.stats.misses++}return s}set(t,n,r){var o,a;if(i(this,e),this.options.maxKeys>-1&&this.stats.keys>=this.options.maxKeys)throw this._error("ECACHEFULL");if(this.options.forceString,null==r&&(r=this.options.stdTTL),null!=(o=this._isInvalidKey(t)))throw o;return a=!1,this.data[t]&&(a=!0,this.stats.vsize-=this._getValLength(this._unwrap(this.data[t],!1))),this.data[t]=this._wrap(n,r),this.stats.vsize+=this._getValLength(n),a||(this.stats.ksize+=this._getKeyLength(t),this.stats.keys++),this.emit("set",t,n),!0}mset(t){var n,r,o,a,s,u,c,l,f;if(i(this,e),this.options.maxKeys>-1&&this.stats.keys+t.length>=this.options.maxKeys)throw this._error("ECACHEFULL");for(r=0,u=t.length;r<u;r++){if(s=t[r],({key:a,val:f,ttl:l}=s),l&&"number"!=typeof l)throw this._error("ETTLTYPE");if(null!=(n=this._isInvalidKey(a)))throw n}for(o=0,c=t.length;o<c;o++)s=t[o],({key:a,val:f,ttl:l}=s),this.set(a,f,l);return!0}del(t){var n,r,o,a,s,u;for(i(this,e),Array.isArray(t)||(t=[t]),n=0,o=0,s=t.length;o<s;o++){if(a=t[o],null!=(r=this._isInvalidKey(a)))throw r;null!=this.data[a]&&(this.stats.vsize-=this._getValLength(this._unwrap(this.data[a],!1)),this.stats.ksize-=this._getKeyLength(a),this.stats.keys--,n++,u=this.data[a],delete this.data[a],this.emit("del",a,u.v))}return n}take(t){var n;return i(this,e),null!=(n=this.get(t))&&this.del(t),n}ttl(t,n){var r;if(i(this,e),n||(n=this.options.stdTTL),!t)return!1;if(null!=(r=this._isInvalidKey(t)))throw r;return!(null==this.data[t]||!this._check(t,this.data[t])||(n>=0?this.data[t]=this._wrap(this.data[t].v,n,!1):this.del(t),0))}getTtl(t){var n;if(i(this,e),t){if(null!=(n=this._isInvalidKey(t)))throw n;return null!=this.data[t]&&this._check(t,this.data[t])?this.data[t].t:void 0}}keys(){return i(this,e),Object.keys(this.data)}has(t){return i(this,e),null!=this.data[t]&&this._check(t,this.data[t])}getStats(){return i(this,e),this.stats}flushAll(t=!0){i(this,e),this.data={},this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this._killCheckPeriod(),this._checkData(t),this.emit("flush")}flushStats(){i(this,e),this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this.emit("flush_stats")}close(){i(this,e),this._killCheckPeriod()}_checkData(t=!0){var n,r,o;for(n in i(this,e),r=this.data)o=r[n],this._check(n,o);t&&this.options.checkperiod>0&&(this.checkTimeout=setTimeout(this._checkData,1e3*this.options.checkperiod,t),null!=this.checkTimeout&&null!=this.checkTimeout.unref&&this.checkTimeout.unref())}_killCheckPeriod(){if(null!=this.checkTimeout)return clearTimeout(this.checkTimeout)}_check(t,n){var r;return i(this,e),r=!0,0!==n.t&&n.t<Date.now()&&(this.options.deleteOnExpire&&(r=!1,this.del(t)),this.emit("expired",t,this._unwrap(n))),r}_isInvalidKey(t){var n;if(i(this,e),n=typeof t,a.call(this.validKeyTypes,n)<0)return this._error("EKEYTYPE",{type:typeof t})}_wrap(t,n,o=!0){var a;return i(this,e),this.options.useClones||(o=!1),a=Date.now(),{t:0===n?0:n?a+1e3*n:0===this.options.stdTTL?this.options.stdTTL:a+1e3*this.options.stdTTL,v:o?r(t):t}}_unwrap(e,t=!0){return this.options.useClones||(t=!1),null!=e.v?t?r(e.v):e.v:null}_getKeyLength(e){return e.toString().length}_getValLength(t){return i(this,e),"string"==typeof t?t.length:this.options.forceString?JSON.stringify(t).length:Array.isArray(t)?this.options.arrayValueSize*t.length:"number"==typeof t?8:"function"==typeof(null!=t?t.then:void 0)?this.options.promiseValueSize:("undefined"!=typeof Buffer&&null!==Buffer?Buffer.isBuffer(t):void 0)?t.length:null!=t&&"object"==typeof t?this.options.objectValueSize*Object.keys(t).length:"boolean"==typeof t?8:0}_error(t,n={}){var r;return i(this,e),(r=new Error).name=t,r.errorcode=t,r.message=null!=this.ERRORS[t]?this.ERRORS[t](n):"-",r.data=n,r}_initErrors(){var t,n,r;for(n in i(this,e),this.ERRORS={},r=this._ERRORS)t=r[n],this.ERRORS[n]=this.createErrorMessage(t)}createErrorMessage(e){return function(t){return e.replace("__key",t.type)}}}return e.prototype._ERRORS={ENOTFOUND:"Key `__key` not found",ECACHEFULL:"Cache max keys amount exceeded",EKEYTYPE:"The key argument has to be of type `string` or `number`. Found: `__key`",EKEYSTYPE:"The keys argument has to be an array.",ETTLTYPE:"The ttl argument has to be a number."},e}.call(this)}).call(this)},392:function(e){var t=function(){"use strict";function e(e,t){return null!=t&&e instanceof t}var t,n,r;try{t=Map}catch(e){t=function(){}}try{n=Set}catch(e){n=function(){}}try{r=Promise}catch(e){r=function(){}}function o(i,s,u,c,l){"object"==typeof s&&(u=s.depth,c=s.prototype,l=s.includeNonEnumerable,s=s.circular);var f=[],h=[],d="undefined"!=typeof Buffer;return void 0===s&&(s=!0),void 0===u&&(u=1/0),function i(u,p){if(null===u)return null;if(0===p)return u;var v,y;if("object"!=typeof u)return u;if(e(u,t))v=new t;else if(e(u,n))v=new n;else if(e(u,r))v=new r((function(e,t){u.then((function(t){e(i(t,p-1))}),(function(e){t(i(e,p-1))}))}));else if(o.__isArray(u))v=[];else if(o.__isRegExp(u))v=new RegExp(u.source,a(u)),u.lastIndex&&(v.lastIndex=u.lastIndex);else if(o.__isDate(u))v=new Date(u.getTime());else{if(d&&Buffer.isBuffer(u))return v=Buffer.allocUnsafe?Buffer.allocUnsafe(u.length):new Buffer(u.length),u.copy(v),v;e(u,Error)?v=Object.create(u):void 0===c?(y=Object.getPrototypeOf(u),v=Object.create(y)):(v=Object.create(c),y=c)}if(s){var g=f.indexOf(u);if(-1!=g)return h[g];f.push(u),h.push(v)}for(var m in e(u,t)&&u.forEach((function(e,t){var n=i(t,p-1),r=i(e,p-1);v.set(n,r)})),e(u,n)&&u.forEach((function(e){var t=i(e,p-1);v.add(t)})),u){var b;y&&(b=Object.getOwnPropertyDescriptor(y,m)),b&&null==b.set||(v[m]=i(u[m],p-1))}if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(u);for(m=0;m<k.length;m++){var w=k[m];(!(S=Object.getOwnPropertyDescriptor(u,w))||S.enumerable||l)&&(v[w]=i(u[w],p-1),S.enumerable||Object.defineProperty(v,w,{enumerable:!1}))}}if(l){var T=Object.getOwnPropertyNames(u);for(m=0;m<T.length;m++){var S,x=T[m];(S=Object.getOwnPropertyDescriptor(u,x))&&S.enumerable||(v[x]=i(u[x],p-1),Object.defineProperty(v,x,{enumerable:!1}))}}return v}(i,u)}function i(e){return Object.prototype.toString.call(e)}function a(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}return o.clonePrototype=function(e){if(null===e)return null;var t=function(){};return t.prototype=e,new t},o.__objToStr=i,o.__isDate=function(e){return"object"==typeof e&&"[object Date]"===i(e)},o.__isArray=function(e){return"object"==typeof e&&"[object Array]"===i(e)},o.__isRegExp=function(e){return"object"==typeof e&&"[object RegExp]"===i(e)},o.__getRegExpFlags=a,o}();e.exports&&(e.exports=t)},666:function(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var o=t&&t.prototype instanceof y?t:y,i=Object.create(o.prototype),a=new A(r||[]);return i._invoke=function(e,t,n){var r=f;return function(o,i){if(r===d)throw new Error("Generator is already running");if(r===p){if("throw"===o)throw i;return P()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=O(a,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var u=l(e,t,n);if("normal"===u.type){if(r=n.done?p:h,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=p,n.method="throw",n.arg=u.arg)}}}(e,n,a),i}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f="suspendedStart",h="suspendedYield",d="executing",p="completed",v={};function y(){}function g(){}function m(){}var b={};b[i]=function(){return this};var k=Object.getPrototypeOf,w=k&&k(k(R([])));w&&w!==n&&r.call(w,i)&&(b=w);var T=m.prototype=y.prototype=Object.create(b);function S(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function n(o,i,a,s){var u=l(e[o],e,i);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(f).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var o;this._invoke=function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}}function O(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=l(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function R(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:P}}function P(){return{value:t,done:!0}}return g.prototype=T.constructor=m,m.constructor=g,g.displayName=u(m,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,u(e,s,"GeneratorFunction")),e.prototype=Object.create(T),e},e.awrap=function(e){return{__await:e}},S(x.prototype),x.prototype[a]=function(){return this},e.AsyncIterator=x,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new x(c(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(T),u(T,s,"Generator"),T[i]=function(){return this},T.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=R,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;E(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:R(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},279:function(e){function t(){}t.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r<o;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],o=[];if(r&&t)for(var i=0,a=r.length;i<a;i++)r[i].fn!==t&&r[i].fn._!==t&&o.push(r[i]);return o.length?n[e]=o:delete n[e],this}},e.exports=t},199:function(){}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return function(){"use strict";n.r(r),n.d(r,{ACCESS_TOKEN_STORAGE_KEY:function(){return se},AuthApiError:function(){return m},AuthPollStopError:function(){return b},AuthSdkError:function(){return k},AuthStateManager:function(){return ao},AuthTransaction:function(){return Le},AuthenticatorKey:function(){return Ht},CACHE_STORAGE_NAME:function(){return te},DEFAULT_CACHE_DURATION:function(){return Y},DEFAULT_CODE_CHALLENGE_METHOD:function(){return de},DEFAULT_MAX_CLOCK_SKEW:function(){return $},DEFAULT_POLLING_DELAY:function(){return J},EVENT_ADDED:function(){return Zn},EVENT_ERROR:function(){return tr},EVENT_EXPIRED:function(){return Qn},EVENT_REMOVED:function(){return er},EVENT_RENEWED:function(){return Xn},IDX_API_VERSION:function(){return pe},IDX_RESPONSE_STORAGE_NAME:function(){return ae},ID_TOKEN_STORAGE_KEY:function(){return ue},INITIAL_AUTH_STATE:function(){return ro},IdxFeature:function(){return qt},IdxStatus:function(){return Kt},MAX_VERIFIER_LENGTH:function(){return he},MIN_VERIFIER_LENGTH:function(){return fe},OAuthError:function(){return w},ORIGINAL_URI_STORAGE_NAME:function(){return ie},OktaAuth:function(){return ks},PKCE_STORAGE_NAME:function(){return ne},REDIRECT_NONCE_COOKIE_NAME:function(){return Z},REDIRECT_OAUTH_PARAMS_NAME:function(){return Q},REDIRECT_STATE_COOKIE_NAME:function(){return X},REFERRER_PATH_STORAGE_KEY:function(){return le},REFRESH_TOKEN_STORAGE_KEY:function(){return ce},SHARED_TRANSACTION_STORAGE_NAME:function(){return oe},STATE_TOKEN_KEY_NAME:function(){return G},StorageManager:function(){return co},TOKEN_STORAGE_NAME:function(){return ee},TRANSACTION_STORAGE_NAME:function(){return re},TokenManager:function(){return nr},addListener:function(){return at},addPostMessageListener:function(){return lt},addStateToken:function(){return Re},assertPKCESupport:function(){return Wt},authenticate:function(){return Ga},bind:function(){return L},buildAuthorizeParams:function(){return Xe},canProceed:function(){return ts},cancel:function(){return Ja},clearTransactionMeta:function(){return wi},clone:function(){return N},convertTokenParamsToOAuthParams:function(){return Qe},createOAuthMeta:function(){return Bt},createTransactionMeta:function(){return yi},crypto:function(){return e},decodeToken:function(){return hn},delay:function(){return Ie},deprecate:function(){return Vn},deprecateWrap:function(){return Wn},exchangeCodeForTokens:function(){return pn},extend:function(){return U},find:function(){return B},genRandomString:function(){return je},generateNonce:function(){return ht},generateState:function(){return ft},getConsole:function(){return Hn},getDefaultTokenParams:function(){return At},getHashOrSearch:function(){return Dt},getKey:function(){return it},getLink:function(){return K},getNativeConsole:function(){return Kn},getOAuthBaseUrl:function(){return pt},getOAuthDomain:function(){return vt},getOAuthUrls:function(){return yt},getPollFn:function(){return Me},getSavedTransactionMeta:function(){return mi},getStateToken:function(){return Pe},getToken:function(){return mn},getTransactionMeta:function(){return bi},getUserInfo:function(){return On},getWellKnown:function(){return ot},getWithPopup:function(){return _n},getWithRedirect:function(){return An},getWithoutPrompt:function(){return bn},handleEmailVerifyCallback:function(){return Za},handleInteractionCodeRedirect:function(){return fs},handleOAuthResponse:function(){return gn},hasAuthorizationCode:function(){return jt},hasErrorInUrl:function(){return Mt},hasInteractionCode:function(){return It},hasSavedInteractionHandle:function(){return gi},hasTokensInHash:function(){return Ct},interact:function(){return Ei},introspect:function(){return Ri},introspectAuthn:function(){return Be},isAbsoluteUrl:function(){return we},isAccessToken:function(){return un},isAuthApiError:function(){return T},isAuthenticator:function(){return an},isAuthorizationCodeError:function(){return Pt},isCodeFlow:function(){return Ut},isCustomAuthTransactionMeta:function(){return rn},isEmailVerifyCallback:function(){return Qa},isEmailVerifyCallbackError:function(){return Ya},isFunction:function(){return be},isIDToken:function(){return cn},isIdxTransactionMeta:function(){return nn},isInteractionRequired:function(){return Ft},isInteractionRequiredError:function(){return Rt},isLoginRedirect:function(){return Nt},isNumber:function(){return me},isOAuthTransactionMeta:function(){return en},isObject:function(){return ge},isPKCETransactionMeta:function(){return tn},isPromise:function(){return ke},isRedirectUri:function(){return Lt},isRefreshToken:function(){return ln},isRefreshTokenError:function(){return Yt},isSameRefreshToken:function(){return $t},isString:function(){return ye},isToken:function(){return sn},isTransactionMeta:function(){return on},isTransactionMetaValid:function(){return Ti},isTransactionMetaValidForFlow:function(){return Si},isTransactionMetaValidForOptions:function(){return xi},isoToUTCString:function(){return Ce},loadFrame:function(){return ut},loadPopup:function(){return ct},omit:function(){return F},parseEmailVerifyCallback:function(){return Xa},parseFromUrl:function(){return jn},pkce:function(){return We},poll:function(){return os},postRefreshToken:function(){return rt},postToTokenEndpoint:function(){return nt},postToTransaction:function(){return qe},preparePKCE:function(){return Gt},prepareTokenParams:function(){return Jt},proceed:function(){return ns},recoverPassword:function(){return ls},register:function(){return us},removeListener:function(){return st},removeNils:function(){return D},removeTrailingSlash:function(){return Oe},renewToken:function(){return Sn},renewTokens:function(){return xn},renewTokensWithRefresh:function(){return kn},resumeTransaction:function(){return Fe},revokeToken:function(){return dn},saveTransactionMeta:function(){return ki},startTransaction:function(){return as},toAbsoluteUrl:function(){return Te},toQueryString:function(){return xe},toRelativeUrl:function(){return Se},transactionExists:function(){return He},transactionStatus:function(){return Ne},transactionStep:function(){return Ke},unlockAccount:function(){return ds},urlParamsToObject:function(){return Qt},validateClaims:function(){return Xt},validateCodeChallengeMethod:function(){return zt},validateToken:function(){return fn},verifyToken:function(){return vn},warn:function(){return qn}});var e={};n.r(e),n.d(e,{atob:function(){return S},base64ToBase64Url:function(){return E},base64UrlDecode:function(){return C},base64UrlToBase64:function(){return A},base64UrlToBuffer:function(){return j},base64UrlToString:function(){return R},btoa:function(){return x},bufferToBase64Url:function(){return I},getOidcHash:function(){return M},stringToBase64Url:function(){return _},stringToBuffer:function(){return P},verifyToken:function(){return H},webcrypto:function(){return O}});var t={};n.r(t),n.d(t,{ACCESS_TOKEN_STORAGE_KEY:function(){return se},CACHE_STORAGE_NAME:function(){return te},DEFAULT_CACHE_DURATION:function(){return Y},DEFAULT_CODE_CHALLENGE_METHOD:function(){return de},DEFAULT_MAX_CLOCK_SKEW:function(){return $},DEFAULT_POLLING_DELAY:function(){return J},IDX_API_VERSION:function(){return pe},IDX_RESPONSE_STORAGE_NAME:function(){return ae},ID_TOKEN_STORAGE_KEY:function(){return ue},MAX_VERIFIER_LENGTH:function(){return he},MIN_VERIFIER_LENGTH:function(){return fe},ORIGINAL_URI_STORAGE_NAME:function(){return ie},PKCE_STORAGE_NAME:function(){return ne},REDIRECT_NONCE_COOKIE_NAME:function(){return Z},REDIRECT_OAUTH_PARAMS_NAME:function(){return Q},REDIRECT_STATE_COOKIE_NAME:function(){return X},REFERRER_PATH_STORAGE_KEY:function(){return le},REFRESH_TOKEN_STORAGE_KEY:function(){return ce},SHARED_TRANSACTION_STORAGE_NAME:function(){return oe},STATE_TOKEN_KEY_NAME:function(){return G},TOKEN_STORAGE_NAME:function(){return ee},TRANSACTION_STORAGE_NAME:function(){return re}});var o={};n.r(o),n.d(o,{getUserAgent:function(){return kt},hasTextEncoder:function(){return xt},isBrowser:function(){return mt},isFingerprintSupported:function(){return wt},isHTTPS:function(){return _t},isIE11OrLess:function(){return bt},isLocalhost:function(){return Et},isPKCESupported:function(){return Ot},isPopupPostMessageSupported:function(){return Tt},isTokenVerifySupported:function(){return St}});var i={};n.r(i),n.d(i,{buildCredentialCreationOptions:function(){return Mn},buildCredentialRequestOptions:function(){return Ln},getAssertion:function(){return Dn},getAttestation:function(){return Un}});var a={};function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?f(e):t}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function v(e,t,n){return v=p()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&u(o,n.prototype),o},v.apply(null,arguments)}function y(e){var t="function"==typeof Map?new Map:void 0;return y=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return v(e,arguments,d(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),u(r,e)},y(e)}n.r(a),n.d(a,{AuthenticatorEnrollmentData:function(){return pa},AuthenticatorVerificationData:function(){return da},ChallengeAuthenticator:function(){return Zi},ChallengePoll:function(){return ea},EnrollAuthenticator:function(){return $i},EnrollPoll:function(){return Yi},EnrollProfile:function(){return na},EnrollmentChannelData:function(){return Xi},Identify:function(){return ra},ReEnrollAuthenticator:function(){return oa},RedirectIdp:function(){return ia},Remediator:function(){return Ui},ResetAuthenticator:function(){return ta},SelectAuthenticatorAuthenticate:function(){return ua},SelectAuthenticatorEnroll:function(){return ca},SelectAuthenticatorUnlockAccount:function(){return la},SelectEnrollProfile:function(){return fa},SelectEnrollmentChannel:function(){return Qi},Skip:function(){return va}});var g=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(e){var t;return s(this,o),t=r.call(this,e),Object.setPrototypeOf(f(t),(this instanceof o?this.constructor:void 0).prototype),t}return o}(y(Error));var m=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(e,t){var n;s(this,o);var i=e.errorSummary;return(n=r.call(this,i)).name="AuthApiError",n.errorSummary=e.errorSummary,n.errorCode=e.errorCode,n.errorLink=e.errorLink,n.errorId=e.errorId,n.errorCauses=e.errorCauses,t&&(n.xhr=t),n}return o}(g);var b=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.call(this,"The poll was stopped by the sdk")}return o}(g);var k=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(e,t){var n;return s(this,o),(n=r.call(this,e)).name="AuthSdkError",n.errorCode="INTERNAL",n.errorSummary=e,n.errorLink="INTERNAL",n.errorId="INTERNAL",n.errorCauses=[],t&&(n.xhr=t),n}return o}(g);var w=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(e,t){var n;return s(this,o),(n=r.call(this,t)).name="OAuthError",n.errorCode=e,n.errorSummary=t,n}return o}(g);function T(e){return e instanceof m}var S=function(e){return atob(e)},x=function(e){return btoa(e)},O="undefined"==typeof crypto?null:crypto;function _(e){return E(x(e))}function E(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function A(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function R(e){var t=A(e);switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new k("Not a valid Base64Url")}var n=S(t);try{return decodeURIComponent(escape(n))}catch(e){return n}}function P(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function C(e){return S(A(e))}function j(e){return Uint8Array.from(C(e),(function(e){return e.charCodeAt(0)}))}function I(e){return x(new Uint8Array(e).reduce((function(e,t){return e+String.fromCharCode(t)}),""))}function M(e){var t=(new TextEncoder).encode(e);return O.subtle.digest("SHA-256",t).then((function(e){var t=new Uint8Array(e).slice(0,16);return _(String.fromCharCode.apply(null,t))}))}function L(e,t){var n=Array.prototype.slice.call(arguments,2);return function(){var r=Array.prototype.slice.call(arguments);return r=n.concat(r),e.apply(t,r)}}function U(){var e=arguments[0],t=[].slice.call(arguments,1);return t.forEach((function(t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&void 0!==t[n]&&(e[n]=t[n])})),e}function D(e){var t={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];null!=r&&(t[n]=r)}return t}function N(e){if(e){var t=JSON.stringify(e);if(t)return JSON.parse(t)}return e}function F(e){for(var t={},n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&-1==r.indexOf(i)&&(t[i]=e[i]);return N(t)}function B(e,t){for(var n=e.length;n--;){var r=e[n],o=!0;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&r[i]!==t[i]){o=!1;break}if(o)return r}}function K(e,t,n){if(e&&e._links){var r=N(e._links[t]);return r&&r.name&&n?r.name===n?r:void 0:r}}function H(e,t){t=N(t);var n={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};return delete t.use,O.subtle.importKey("jwk",t,n,!0,["verify"]).then((function(t){var r=e.split("."),o=P(r[0]+"."+r[1]),i=P(C(r[2]));return O.subtle.verify(n,t,i,o)}))}function q(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function V(e,t,n){return t&&q(e.prototype,t),n&&q(e,n),e}var W=n(757),z=n.n(W),G="oktaStateToken",J=500,$=300,Y=86400,Q="okta-oauth-redirect-params",X="okta-oauth-state",Z="okta-oauth-nonce",ee="okta-token-storage",te="okta-cache-storage",ne="okta-pkce-storage",re="okta-transaction-storage",oe="okta-shared-transaction-storage",ie="okta-original-uri-storage",ae="okta-idx-response-storage",se="accessToken",ue="idToken",ce="refreshToken",le="referrerPath",fe=43,he=128,de="S256",pe="1.0.0";function ve(e,t,n){e.options.headers=e.options.headers||{},e.options.headers[t]=n}function ye(e){return"[object String]"===Object.prototype.toString.call(e)}function ge(e){return"[object Object]"===Object.prototype.toString.call(e)}function me(e){return"[object Number]"===Object.prototype.toString.call(e)}function be(e){return!!e&&"[object Function]"==={}.toString.call(e)}function ke(e){return e&&e.finally&&"function"==typeof e.finally}function we(e){return/^(?:[a-z]+:)?\/\//i.test(e)}function Te(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return we(e)?e:(t=Oe(t),"/"===e[0]?"".concat(t).concat(e):"".concat(t,"/").concat(e))}function Se(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return we(e)&&(e=e.substring(t.length)),"/"===e[0]?e:"/".concat(e)}function xe(e){var t=[];if(null!==e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&void 0!==e[n]&&null!==e[n]&&t.push(n+"="+encodeURIComponent(e[n]));return t.length?"?"+t.join("&"):""}function Oe(e){if(e){var t=e.replace(/^\s+|\s+$/gm,"");return t.replace(/\/+$/,"")}}function _e(e,t){var n=(t=t||{}).url,r=t.method,o=t.args,i=t.saveAuthnState,a=t.accessToken,s=!0===t.withCredentials,u=e.options.storageUtil.storage,c=e.storageManager.getHttpCache(e.options.cookies);if(t.cacheResponse){var f=c.getStorage()[n];if(f&&Date.now()/1e3<f.expiresAt)return Promise.resolve(f.response)}var h=e._oktaUserAgent.getHttpHeader(),d=Object.assign({Accept:"application/json","Content-Type":"application/json"},h);Object.assign(d,e.options.headers,t.headers),d=D(d),a&&ye(a)&&(d.Authorization="Bearer "+a);var p,v,y={headers:d,data:o||void 0,withCredentials:s};return e.options.httpRequestClient(r,n,y).then((function(r){return(v=r.responseText)&&ye(v)&&(v=JSON.parse(v))&&"object"===l(v)&&!v.headers&&(v.headers=r.headers),i&&(v.stateToken||u.delete(G)),v&&v.stateToken&&v.expiresAt&&u.set(G,v.stateToken,v.expiresAt,e.options.cookies),v&&t.cacheResponse&&c.updateStorage(n,{expiresAt:Math.floor(Date.now()/1e3)+Y,response:v}),v})).catch((function(t){var n=t.responseText||{};if(ye(n))try{n=JSON.parse(n)}catch(e){n={errorSummary:"Unknown error"}}throw t.status>=500&&(n.errorSummary="Unknown error"),e.options.transformErrorXHR&&(t=e.options.transformErrorXHR(N(t))),"E0000011"===(p=new m(n,t)).errorCode&&u.delete(G),p}))}function Ee(e,t,n){var r={url:t=we(t)?t:e.getIssuerOrigin()+t,method:"GET"};return Object.assign(r,n),_e(e,r)}function Ae(e,t,n,r){var o={url:t=we(t)?t:e.getIssuerOrigin()+t,method:"POST",args:n,saveAuthnState:!0};return Object.assign(o,r),_e(e,o)}function Re(e,t){var n={};return Object.assign(n,t),!n.stateToken&&e.stateToken&&(n.stateToken=e.stateToken),n}function Pe(e){return Re(e)}function Ce(e){var t=e.match(/\d+/g),n=Date.UTC(t[0],t[1]-1,t[2],t[3],t[4],t[5]);return new Date(n).toUTCString()}function je(e){for(var t="abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",n="",r=0,o=t.length;r<e;++r)n+=t[Math.floor(Math.random()*o)];return n}function Ie(e){return new Promise((function(t){setTimeout(t,e)}))}function Me(e,t,n){return function(r){var o,i,a,s;me(r)?o=r:ge(r)&&(o=(r=r).delay,i=r.rememberDevice,a=r.autoPush,s=r.transactionCallBack),o||0===o||(o=J);var u=K(t,"next","poll");n.isPolling=!0;var c=0;return function r(){return n.isPolling?function(){var n={};if("function"==typeof a)try{n.autoPush=!!a()}catch(e){return Promise.reject(new k("AutoPush resulted in an error."))}else null!=a&&(n.autoPush=!!a);if("function"==typeof i)try{n.rememberDevice=!!i()}catch(e){return Promise.reject(new k("RememberDevice resulted in an error."))}else null!=i&&(n.rememberDevice=!!i);var r=u.href+xe(n);return Ae(e,r,Pe(t),{saveAuthnState:!1,withCredentials:!0})}().then((function(t){if(c=0,t.factorResult&&"WAITING"===t.factorResult){if(!n.isPolling)throw new b;return"function"==typeof s&&s(t),Ie(o).then(r)}return n.isPolling=!1,new Le(e,t)})).catch((function(e){if(e.xhr&&(0===e.xhr.status||429===e.xhr.status)&&c<=4){var t=1e3*Math.pow(2,c);return c++,Ie(t).then(r)}throw e})):Promise.reject(new b)}().catch((function(e){throw n.isPolling=!1,e}))}}var Le=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(s(this,e),this.data=void 0,this.status=void 0,n){if(this.data=n,this.data.interactionHandle)return void(this.status=n.status);Object.assign(this,De(t,n,n,{})),delete this.stateToken,"RECOVERY_CHALLENGE"!==n.status||n._links||(this.cancel=function(){return Promise.resolve(new e(t))})}};function Ue(e,t,n,r,o){if(Array.isArray(r))return function(i,a){if(!i)throw new k("Must provide a link name");var s=B(r,{name:i});if(!s)throw new k("No link found for that name");return Ue(e,t,n,s,o)(a)};if(r.hints&&r.hints.allow&&1===r.hints.allow.length)switch(r.hints.allow[0]){case"GET":return function(){return Ee(e,r.href,{withCredentials:!0})};case"POST":return function(i){o&&o.isPolling&&(o.isPolling=!1);var a=Re(t,i);"MFA_ENROLL"!==t.status&&"FACTOR_ENROLL"!==t.status||Object.assign(a,{factorType:n.factorType,provider:n.provider});var s={},u=a.autoPush;if(void 0!==u){if("function"==typeof u)try{s.autoPush=!!u()}catch(e){return Promise.reject(new k("AutoPush resulted in an error."))}else null!==u&&(s.autoPush=!!u);a=F(a,"autoPush")}var c=a.rememberDevice;if(void 0!==c){if("function"==typeof c)try{s.rememberDevice=!!c()}catch(e){return Promise.reject(new k("RememberDevice resulted in an error."))}else null!==c&&(s.rememberDevice=!!c);a=F(a,"rememberDevice")}else a.profile&&void 0!==a.profile.updatePhone&&(a.profile.updatePhone&&(s.updatePhone=!0),a.profile=F(a.profile,"updatePhone"));var l=r.href+xe(s);return qe(e,l,a)}}}function De(e,t,n,r){if(n=N(n=n||t),Array.isArray(n)){for(var o=[],i=0,a=n.length;i<a;i++)o.push(De(e,t,n[i],r));return o}var s=n._embedded||{};for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(ge(s[u])||Array.isArray(s[u]))&&(s[u]=De(e,t,s[u],r));var c=function(e,t,n,r){var o={};for(var i in n._links)if(Object.prototype.hasOwnProperty.call(n._links,i)){var a=n._links[i];if("next"===i&&(i=a.name),a.type)o[i]=a;else if("poll"===i)o.poll=Me(e,t,r);else{var s=Ue(e,t,n,a,r);s&&(o[i]=s)}}return o}(e,t,n,r);return Object.assign(s,c),n=F(n,"_embedded","_links"),Object.assign(n,s),n}function Ne(e,t){return t=Re(e,t),Ae(e,e.getIssuerOrigin()+"/api/v1/authn",t,{withCredentials:!0})}function Fe(e,t){if(!t||!t.stateToken){var n=e.tx.exists._get(G);if(!n)return Promise.reject(new k("No transaction to resume"));t={stateToken:n}}return e.tx.status(t).then((function(t){return new Le(e,t)}))}function Be(e,t){if(!t||!t.stateToken){var n=e.tx.exists._get(G);if(!n)return Promise.reject(new k("No transaction to evaluate"));t={stateToken:n}}return Ke(e,t).then((function(t){return new Le(e,t)}))}function Ke(e,t){return t=Re(e,t),Ae(e,e.getIssuerOrigin()+"/api/v1/authn/introspect",t,{withCredentials:!0})}function He(e){return!!e.tx.exists._get(G)}function qe(e,t,n,r){return r=Object.assign({withCredentials:!0},r),Ae(e,t,n,r).then((function(t){return new Le(e,t)}))}function Ve(e){return("0"+e.toString(16)).substr(-2)}var We={DEFAULT_CODE_CHALLENGE_METHOD:de,generateVerifier:function(e){var t=e||"";return t.length<fe&&(t+=function(e){var t=new Uint8Array(Math.ceil(e/2));return O.getRandomValues(t),Array.from(t,Ve).join("").slice(0,e)}(fe-t.length)),encodeURIComponent(t).slice(0,he)},computeChallenge:function(e){var t=(new TextEncoder).encode(e);return O.subtle.digest("SHA-256",t).then((function(e){return _(String.fromCharCode.apply(null,new Uint8Array(e)))}))}};function ze(e){return e.session.get().then((function(e){return"ACTIVE"===e.status})).catch((function(){return!1}))}function Ge(e){return Ee(e,"/api/v1/sessions/me",{withCredentials:!0}).then((function(t){var n=F(t,"_links");return n.refresh=function(){return Ae(e,K(t,"refresh").href,{},{withCredentials:!0})},n.user=function(){return Ee(e,K(t,"user").href,{withCredentials:!0})},n})).catch((function(){return{status:"INACTIVE"}}))}function Je(e){return _e(e,{url:e.getIssuerOrigin()+"/api/v1/sessions/me",method:"DELETE",withCredentials:!0})}function $e(e){return Ae(e,"/api/v1/sessions/me/lifecycle/refresh",{},{withCredentials:!0})}function Ye(e,t,n){n=n||window.location.href,window.location.assign(e.getIssuerOrigin()+"/login/sessionCookieRedirect"+xe({checkAccountSetupComplete:!0,token:t,redirectUrl:n}))}function Qe(e){if(!e.clientId)throw new k("A clientId must be specified in the OktaAuth constructor to get a token");if(ye(e.responseType)&&-1!==e.responseType.indexOf(" "))throw new k("Multiple OAuth responseTypes must be defined as an array");var t={client_id:e.clientId,code_challenge:e.codeChallenge,code_challenge_method:e.codeChallengeMethod,display:e.display,idp:e.idp,idp_scope:e.idpScope,login_hint:e.loginHint,max_age:e.maxAge,nonce:e.nonce,prompt:e.prompt,redirect_uri:e.redirectUri,response_mode:e.responseMode,response_type:e.responseType,sessionToken:e.sessionToken,state:e.state};if(t=D(t),["idp_scope","response_type"].forEach((function(e){Array.isArray(t[e])&&(t[e]=t[e].join(" "))})),-1!==e.responseType.indexOf("id_token")&&-1===e.scopes.indexOf("openid"))throw new k("openid scope must be specified in the scopes argument when requesting an id_token");return t.scope=e.scopes.join(" "),t}function Xe(e){var t=Qe(e);return xe(Object.assign(Object.assign({},t),e.extraParams&&Object.assign({},e.extraParams)))}function Ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function et(e,t){if(e){if("string"==typeof e)return Ze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ze(e,t):void 0}}function tt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||et(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nt(e,t,n){!function(e){if(!e.clientId)throw new k("A clientId must be specified in the OktaAuth constructor to get a token");if(!e.redirectUri)throw new k("The redirectUri passed to /authorize must also be passed to /token");if(!e.authorizationCode&&!e.interactionCode)throw new k("An authorization code (returned from /authorize) must be passed to /token");if(!e.codeVerifier)throw new k('The "codeVerifier" (generated and saved by your app) must be passed to /token')}(t);var r=function(e,t){var n=D({client_id:t.clientId,redirect_uri:t.redirectUri,grant_type:t.interactionCode?"interaction_code":"authorization_code",code_verifier:t.codeVerifier});t.interactionCode?n.interaction_code=t.interactionCode:t.authorizationCode&&(n.code=t.authorizationCode);var r=e.options.clientSecret;return r&&(n.client_secret=r),xe(n).slice(1)}(e,t);return _e(e,{url:n.tokenUrl,method:"POST",args:r,headers:{"Content-Type":"application/x-www-form-urlencoded"}})}function rt(e,t,n){return _e(e,{url:n.tokenUrl,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},args:Object.entries({client_id:t.clientId,grant_type:"refresh_token",scope:n.scopes.join(" "),refresh_token:n.refreshToken}).map((function(e){var t=tt(e,2),n=t[0],r=t[1];return n+"="+encodeURIComponent(r)})).join("&")})}function ot(e,t){return Ee(e,(t||e.options.issuer)+"/.well-known/openid-configuration",{cacheResponse:!0})}function it(e,t,n){var r=e.storageManager.getHttpCache(e.options.cookies);return ot(e,t).then((function(t){var o=t.jwks_uri,i=r.getStorage()[o];if(i&&Date.now()/1e3<i.expiresAt){var a=B(i.response.keys,{kid:n});if(a)return a}return r.clearStorage(o),Ee(e,o,{cacheResponse:!0}).then((function(e){var t=B(e.keys,{kid:n});if(t)return t;throw new k("The key id, "+n+", was not found in the server's keys")}))}))}function at(e,t,n){e.addEventListener?e.addEventListener(t,n):e.attachEvent("on"+t,n)}function st(e,t,n){e.removeEventListener?e.removeEventListener(t,n):e.detachEvent("on"+t,n)}function ut(e){var t=document.createElement("iframe");return t.style.display="none",t.src=e,document.body.appendChild(t)}function ct(e,t){var n=t.popupTitle||"External Identity Provider User Authentication";return window.open(e,n,"toolbar=no, scrollbars=yes, resizable=yes, top=100, left=500, width=600, height=600")}function lt(e,t,n){var r,o;return new Promise((function(i,a){r=function(t){if(t.data&&t.data.state===n)return t.origin!==e.getIssuerOrigin()?a(new k("The request does not match client configuration")):void i(t.data)},at(window,"message",r),o=setTimeout((function(){a(new k("OAuth flow timed out"))}),t||12e4)})).finally((function(){clearTimeout(o),st(window,"message",r)}))}function ft(){return je(64)}function ht(){return je(64)}function dt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Oe(t.issuer)||e.options.issuer;return n}function pt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=dt(e,t),r=n.indexOf("/oauth2")>0?n:n+"/oauth2";return r}function vt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=dt(e,t),r=n.split("/oauth2")[0];return r}function yt(e,t){if(arguments.length>2)throw new k('As of version 3.0, "getOAuthUrls" takes only a single set of options');var n=Oe((t=t||{}).authorizeUrl)||e.options.authorizeUrl,r=dt(e,t),o=Oe(t.userinfoUrl)||e.options.userinfoUrl,i=Oe(t.tokenUrl)||e.options.tokenUrl,a=Oe(t.logoutUrl)||e.options.logoutUrl,s=Oe(t.revokeUrl)||e.options.revokeUrl,u=pt(e,t);return{issuer:r,authorizeUrl:n=n||u+"/v1/authorize",userinfoUrl:o=o||u+"/v1/userinfo",tokenUrl:i=i||u+"/v1/token",revokeUrl:s=s||u+"/v1/revoke",logoutUrl:a=a||u+"/v1/logout"}}var gt=/windows phone|iemobile|wpdesktop/i;function mt(){return"undefined"!=typeof document&&"undefined"!=typeof window}function bt(){if(!mt())return!1;var e=document.documentMode;return!!e&&e<=11}function kt(){return navigator.userAgent}function wt(){var e=kt();return e&&!gt.test(e)}function Tt(){if(!mt())return!1;var e=document.documentMode,t=e&&e<10;return void 0!==window.postMessage&&!t}function St(){return null!=O&&void 0!==O.subtle&&"undefined"!=typeof Uint8Array}function xt(){return"undefined"!=typeof TextEncoder}function Ot(){return St()&&xt()}function _t(){return!!mt()&&"https:"===window.location.protocol}function Et(){return mt()&&"localhost"===window.location.hostname}function At(e){var t=e.options,n=t.pkce,r=t.clientId,o=t.redirectUri,i=t.responseType,a=t.responseMode,s=t.scopes,u=t.state,c=t.ignoreSignature,l=mt()?window.location.href:void 0;return D({pkce:n,clientId:r,redirectUri:o||l,responseType:i||["token","id_token"],responseMode:a,state:u||ft(),nonce:ht(),scopes:s||["openid","email"],ignoreSignature:c})}function Rt(e){return"OAuthError"===e.name&&"interaction_required"===e.errorCode}function Pt(e,t){if("AuthApiError"!==t.name)return!1;var n=t.xhr,r=null==n?void 0:n.responseJSON;return e.options.pkce&&"invalid_grant"===(null==r?void 0:r.error)}function Ct(e){return/((id|access)_token=)/i.test(e)}function jt(e){return/(code=)/i.test(e)}function It(e){return/(interaction_code=)/i.test(e)}function Mt(e){return/(error=)/i.test(e)||/(error_description)/i.test(e)}function Lt(e,t){var n=t.options;return!(!e||!n.redirectUri)&&0===e.indexOf(n.redirectUri)}function Ut(e){return e.pkce||"code"===e.responseType||"query"===e.responseMode}function Dt(e){return Ut(e)&&"fragment"!==e.responseMode?window.location.search:window.location.hash}function Nt(e){if(!Lt(window.location.href,e))return!1;var t=Ut(e.options),n=Dt(e.options);return!!Mt(n)||(t?jt(n)||It(n):Ct(window.location.hash))}function Ft(e,t){if(!t){if(!Nt(e))return!1;t=Dt(e.options)}return/(error=interaction_required)/i.test(t)}function Bt(e,t){var n={issuer:e.options.issuer,urls:yt(e,t),clientId:t.clientId,redirectUri:t.redirectUri,responseType:t.responseType,responseMode:t.responseMode,scopes:t.scopes,state:t.state,nonce:t.nonce,ignoreSignature:t.ignoreSignature};return!1===t.pkce?n:Object.assign(Object.assign({},n),{codeVerifier:t.codeVerifier,codeChallengeMethod:t.codeChallengeMethod,codeChallenge:t.codeChallenge})}var Kt,Ht,qt,Vt=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function Wt(e){if(!e.features.isPKCESupported()){var t="PKCE requires a modern browser with encryption support running in a secure context.";throw e.features.isHTTPS()||(t+="\nThe current page is not being served with HTTPS protocol. PKCE requires secure HTTPS protocol."),e.features.hasTextEncoder()||(t+='\n"TextEncoder" is not defined. To use PKCE, you may need to include a polyfill/shim for this browser.'),new k(t)}}function zt(e,t){return Vt(this,void 0,void 0,z().mark((function n(){return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t=t||e.options.codeChallengeMethod||de,n.next=3,ot(e);case 3:if(-1!==(n.sent.code_challenge_methods_supported||[]).indexOf(t)){n.next=7;break}throw new k("Invalid code_challenge_method");case 7:return n.abrupt("return",t);case 8:case"end":return n.stop()}}),n)})))}function Gt(e,t){return Vt(this,void 0,void 0,z().mark((function n(){var r,o,i,a;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(o=(r=t).codeVerifier,i=r.codeChallenge,a=r.codeChallengeMethod,i=i||e.options.codeChallenge){n.next=8;break}return Wt(e),o=o||We.generateVerifier(),n.next=7,We.computeChallenge(o);case 7:i=n.sent;case 8:return n.next=10,zt(e,a);case 10:return a=n.sent,t=Object.assign(Object.assign({},t),{responseType:"code",codeVerifier:o,codeChallenge:i,codeChallengeMethod:a}),n.abrupt("return",t);case 13:case"end":return n.stop()}}),n)})))}function Jt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Vt(this,void 0,void 0,z().mark((function n(){var r;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=At(e),!1!==(t=Object.assign(Object.assign({},r),t)).pkce){n.next=4;break}return n.abrupt("return",t);case 4:return n.abrupt("return",Gt(e,t));case 5:case"end":return n.stop()}}),n)})))}function $t(e,t){return e.refreshToken===t.refreshToken}function Yt(e){return!(!T(e)||!e.xhr||!e.xhr.responseJSON||"invalid_grant"!==e.xhr.responseJSON.error)}function Qt(e){var t=/\+/g,n=/([^&=]+)=?([^&]*)/g,r=e||"";"#"===r.charAt(0)&&"/"===r.charAt(1)&&(r=r.substring(2)),"#"!==r.charAt(0)&&"?"!==r.charAt(0)||(r=r.substring(1));for(var o,i={};o=n.exec(r);){var a=o[1],s=o[2];i[a]="id_token"===a||"access_token"===a||"code"===a?s:decodeURIComponent(s.replace(t," "))}return i}function Xt(e,t,n){var r=n.clientId,o=n.issuer,i=n.nonce;if(!t||!o||!r)throw new k("The jwt, iss, and aud arguments are all required");if(i&&t.nonce!==i)throw new k("OAuth flow response nonce doesn't match request nonce");var a=Math.floor(Date.now()/1e3);if(t.iss!==o)throw new k("The issuer ["+t.iss+"] does not match ["+o+"]");if(t.aud!==r)throw new k("The audience ["+t.aud+"] does not match ["+r+"]");if(t.iat>t.exp)throw new k("The JWT expired before it was issued");if(!e.options.ignoreLifetime){if(a-e.options.maxClockSkew>t.exp)throw new k("The JWT expired and is no longer valid");if(t.iat>a+e.options.maxClockSkew)throw new k("The JWT was issued in the future")}}function Zt(e){return!(!e||"object"!==l(e)||0===Object.values(e).length)}function en(e){return!(!Zt(e)||!e.redirectUri&&!e.responseType)}function tn(e){return!!en(e)&&!!e.codeVerifier}function nn(e){return!!tn(e)&&!!e.interactionHandle}function rn(e){return!!Zt(e)&&void 0===Object.values(e).find((function(e){return"string"!=typeof e}))}function on(e){return!(!en(e)&&!rn(e))}function an(e){return e&&(e.key||e.id)}function sn(e){return!!(e&&(e.accessToken||e.idToken||e.refreshToken)&&Array.isArray(e.scopes))}function un(e){return e&&e.accessToken}function cn(e){return e&&e.idToken}function ln(e){return e&&e.refreshToken}function fn(e,t){if(!cn(e)&&!un(e)&&!ln(e))throw new k("Token must be an Object with scopes, expiresAt, and one of: an idToken, accessToken, or refreshToken property");if("accessToken"===t&&!un(e))throw new k("invalid accessToken");if("idToken"===t&&!cn(e))throw new k("invalid idToken");if("refreshToken"===t&&!ln(e))throw new k("invalid refreshToken")}function hn(e){var t,n=e.split(".");try{t={header:JSON.parse(R(n[0])),payload:JSON.parse(R(n[1])),signature:n[2]}}catch(e){throw new k("Malformed token")}return t}!function(e){e.SUCCESS="SUCCESS",e.PENDING="PENDING",e.FAILURE="FAILURE",e.TERMINAL="TERMINAL",e.CANCELED="CANCELED"}(Kt||(Kt={})),function(e){e.OKTA_PASSWORD="okta_password",e.OKTA_EMAIL="okta_email",e.PHONE_NUMBER="phone_number",e.GOOGLE_AUTHENTICATOR="google_otp",e.SECURITY_QUESTION="security_question",e.OKTA_VERIFY="okta_verify",e.WEBAUTHN="webauthn"}(Ht||(Ht={})),function(e){e.PASSWORD_RECOVERY="recover-password",e.REGISTRATION="enroll-profile",e.SOCIAL_IDP="redirect-idp",e.ACCOUNT_UNLOCK="unlock-account"}(qt||(qt={}));function dn(e,t){return n=this,r=void 0,o=void 0,i=z().mark((function n(){var r,o,i,a,s,u,c;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r="",o="",t&&(r=t.accessToken,o=t.refreshToken),r||o){n.next=5;break}throw new k("A valid access or refresh token object is required");case 5:if(i=e.options.clientId,a=e.options.clientSecret,i){n.next=9;break}throw new k("A clientId must be specified in the OktaAuth constructor to revoke a token");case 9:return s=yt(e).revokeUrl,u=xe({token_type_hint:o?"refresh_token":"access_token",token:o||r}).slice(1),c=x(a?"".concat(i,":").concat(a):i),n.abrupt("return",Ae(e,s,u,{headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:"Basic "+c}}));case 13:case"end":return n.stop()}}),n)})),new(o||(o=Promise))((function(e,t){function a(e){try{u(i.next(e))}catch(e){t(e)}}function s(e){try{u(i.throw(e))}catch(e){t(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(a,s)}u((i=i.apply(n,r||[])).next())}));var n,r,o,i}function pn(e,t,n){n=n||yt(e,t);var r=t=Object.assign({},At(e),N(t)),o=r.authorizationCode,i=r.interactionCode,a=r.codeVerifier,s=r.clientId,u=r.redirectUri,c=r.scopes,l=r.ignoreSignature,f=r.state;return nt(e,{clientId:s,redirectUri:u,authorizationCode:o,interactionCode:i,codeVerifier:a},n).then((function(t){var r=["token"];return-1!==c.indexOf("openid")&&r.push("id_token"),gn(e,{clientId:s,redirectUri:u,scopes:c,responseType:r,ignoreSignature:l},t,n).then((function(e){return e.code=o,e.state=f,e}))})).finally((function(){e.transactionManager.clear()}))}function vn(e,t,n){return r=this,o=void 0,i=void 0,a=z().mark((function r(){var o,i,a,s,u,c;return z().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t&&t.idToken){r.next=2;break}throw new k("Only idTokens may be verified");case 2:return o=hn(t.idToken),i=(null==n?void 0:n.issuer)||e.options.issuer,r.next=6,ot(e,i);case 6:if(a=r.sent,s=a.issuer,u=Object.assign({clientId:e.options.clientId,ignoreSignature:e.options.ignoreSignature},n,{issuer:s}),Xt(e,o.payload,u),1!=u.ignoreSignature&&e.features.isTokenVerifySupported()){r.next=12;break}return r.abrupt("return",t);case 12:return r.next=14,it(e,t.issuer,o.header.kid);case 14:return c=r.sent,r.next=17,H(t.idToken,c);case 17:if(r.sent){r.next=20;break}throw new k("The token signature is not valid");case 20:if(!(n&&n.accessToken&&t.claims.at_hash)){r.next=26;break}return r.next=23,M(n.accessToken);case 23:if(r.sent===t.claims.at_hash){r.next=26;break}throw new k("Token hash verification failed");case 26:return r.abrupt("return",t);case 27:case"end":return r.stop()}}),r)})),new(i||(i=Promise))((function(e,t){function n(e){try{u(a.next(e))}catch(e){t(e)}}function s(e){try{u(a.throw(e))}catch(e){t(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(n,s)}u((a=a.apply(r,o||[])).next())}));var r,o,i,a}function yn(e,t){if(e.error&&e.error_description)throw new w(e.error,e.error_description);if(e.state!==t.state)throw new k("OAuth flow response state doesn't match request state")}function gn(e,t,n,r){return o=this,i=void 0,a=void 0,s=z().mark((function o(){var i,a,s,u,c,l,f,h,d,p,v,y,g,m;return z().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(!1===e.options.pkce||!n.code&&!n.interaction_code){o.next=3;break}return o.abrupt("return",pn(e,Object.assign({},t,{authorizationCode:n.code,interactionCode:n.interaction_code}),r));case 3:if(t=t||At(e),r=r||yt(e,t),i=t.responseType||[],Array.isArray(i)||(i=[i]),a=n.scope?n.scope.split(" "):N(t.scopes),s=t.clientId||e.options.clientId,yn(n,t),u={},c=n.expires_in,l=n.token_type,f=n.access_token,h=n.id_token,d=n.refresh_token,p=Math.floor(Date.now()/1e3),f&&(v=e.token.decode(f),u.accessToken={accessToken:f,claims:v.payload,expiresAt:Number(c)+p,tokenType:l,scopes:a,authorizeUrl:r.authorizeUrl,userinfoUrl:r.userinfoUrl}),d&&(u.refreshToken={refreshToken:d,expiresAt:Number(c)+p,scopes:a,tokenUrl:r.tokenUrl,authorizeUrl:r.authorizeUrl,issuer:r.issuer}),!h){o.next=27;break}return y=e.token.decode(h),g={idToken:h,claims:y.payload,expiresAt:y.payload.exp-y.payload.iat+p,scopes:a,authorizeUrl:r.authorizeUrl,issuer:r.issuer,clientId:s},m={clientId:s,issuer:r.issuer,nonce:t.nonce,accessToken:f},void 0!==t.ignoreSignature&&(m.ignoreSignature=t.ignoreSignature),o.next=26,vn(e,g,m);case 26:u.idToken=g;case 27:if(-1===i.indexOf("token")||u.accessToken){o.next=29;break}throw new k('Unable to parse OAuth flow response: response type "token" was requested but "access_token" was not returned.');case 29:if(-1===i.indexOf("id_token")||u.idToken){o.next=31;break}throw new k('Unable to parse OAuth flow response: response type "id_token" was requested but "id_token" was not returned.');case 31:return o.abrupt("return",{tokens:u,state:n.state,code:n.code});case 32:case"end":return o.stop()}}),o)})),new(a||(a=Promise))((function(e,t){function n(e){try{u(s.next(e))}catch(e){t(e)}}function r(e){try{u(s.throw(e))}catch(e){t(e)}}function u(t){var o;t.done?e(t.value):(o=t.value,o instanceof a?o:new a((function(e){e(o)}))).then(n,r)}u((s=s.apply(o,i||[])).next())}));var o,i,a,s}function mn(e,t){if(arguments.length>2)return Promise.reject(new k('As of version 3.0, "getToken" takes only a single set of options'));var n=(t=t||{}).popupWindow;return t.popupWindow=void 0,Jt(e,t).then((function(r){var o,i;switch(t.sessionToken?Object.assign(r,{prompt:"none",responseMode:"okta_post_message",display:null}):t.idp&&Object.assign(r,{display:"popup"}),i=yt(e,r),o=(t.codeVerifier?i.tokenUrl:i.authorizeUrl)+Xe(r),r.sessionToken||null===r.display?"IFRAME":"popup"===r.display?"POPUP":"IMPLICIT"){case"IFRAME":var a=lt(e,t.timeout,r.state),s=ut(o);return a.then((function(t){return gn(e,r,t,i)})).finally((function(){var e;document.body.contains(s)&&(null===(e=s.parentElement)||void 0===e||e.removeChild(s))}));case"POPUP":var u;if("okta_post_message"===r.responseMode){if(!e.features.isPopupPostMessageSupported())throw new k("This browser doesn't have full postMessage support");u=lt(e,t.timeout,r.state)}return n&&n.location.assign(o),new Promise((function(e,t){var r=setInterval((function(){n&&!n.closed||(clearInterval(r),t(new k("Unable to parse OAuth flow response")))}),100);u.then((function(t){clearInterval(r),e(t)})).catch((function(e){clearInterval(r),t(e)}))})).then((function(t){return gn(e,r,t,i)})).finally((function(){n&&!n.closed&&n.close()}));default:throw new k("The full page redirect flow is not supported")}}))}function bn(e,t){return arguments.length>2?Promise.reject(new k('As of version 3.0, "getWithoutPrompt" takes only a single set of options')):(t=N(t)||{},Object.assign(t,{prompt:"none",responseMode:"okta_post_message",display:null}),mn(e,t))}function kn(e,t,n){return r=this,o=void 0,i=void 0,a=z().mark((function r(){var o,i,a,s,u,c,l;return z().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(o=e.options.clientId){r.next=3;break}throw new k("A clientId must be specified in the OktaAuth constructor to renew tokens");case 3:return i=Object.assign({},t,{clientId:o}),r.next=6,rt(e,i,n);case 6:return a=r.sent,s=yt(e,t),r.next=10,gn(e,i,a,s);case 10:return u=r.sent,c=u.tokens,(l=c.refreshToken)&&!$t(l,n)&&e.tokenManager.updateRefreshToken(l),r.abrupt("return",c);case 15:case"end":return r.stop()}}),r)})),new(i||(i=Promise))((function(e,t){function n(e){try{u(a.next(e))}catch(e){t(e)}}function s(e){try{u(a.throw(e))}catch(e){t(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(n,s)}u((a=a.apply(r,o||[])).next())}));var r,o,i,a}function wn(){throw new k("Renew must be passed a token with an array of scopes and an accessToken or idToken")}function Tn(e,t){return cn(e)?t.idToken:un(e)?t.accessToken:void wn()}function Sn(e,t){return n=this,r=void 0,o=void 0,i=z().mark((function n(){var r,o,i,a,s,u;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(cn(t)||un(t)||wn(),!(r=e.tokenManager.getTokensSync()).refreshToken){n.next=7;break}return n.next=5,kn(e,{scopes:t.scopes},r.refreshToken);case 5:return r=n.sent,n.abrupt("return",Tn(t,r));case 7:return o=e.options.pkce?"code":un(t)?"token":"id_token",i=t.scopes,a=t.authorizeUrl,s=t.userinfoUrl,u=t.issuer,n.abrupt("return",bn(e,{responseType:o,scopes:i,authorizeUrl:a,userinfoUrl:s,issuer:u}).then((function(e){return Tn(t,e.tokens)})));case 10:case"end":return n.stop()}}),n)})),new(o||(o=Promise))((function(e,t){function a(e){try{u(i.next(e))}catch(e){t(e)}}function s(e){try{u(i.throw(e))}catch(e){t(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(a,s)}u((i=i.apply(n,r||[])).next())}));var n,r,o,i}function xn(e,t){return n=this,r=void 0,o=void 0,i=z().mark((function n(){var r,o,i,a,s,u,c,l,f;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(r=e.tokenManager.getTokensSync()).refreshToken){n.next=3;break}return n.abrupt("return",kn(e,t||{},r.refreshToken));case 3:if(r.accessToken||r.idToken){n.next=5;break}throw new k("renewTokens() was called but there is no existing token");case 5:if(o=r.accessToken||{},i=r.idToken||{},a=o.scopes||i.scopes){n.next=10;break}throw new k("renewTokens: invalid tokens: could not read scopes");case 10:if(s=o.authorizeUrl||i.authorizeUrl){n.next=13;break}throw new k("renewTokens: invalid tokens: could not read authorizeUrl");case 13:return u=o.userinfoUrl||e.options.userinfoUrl,c=i.issuer||e.options.issuer,t=Object.assign({scopes:a,authorizeUrl:s,userinfoUrl:u,issuer:c},t),e.options.pkce?t.responseType="code":(l=At(e),f=l.responseType,t.responseType=f),n.abrupt("return",bn(e,t).then((function(e){return e.tokens})));case 18:case"end":return n.stop()}}),n)})),new(o||(o=Promise))((function(e,t){function a(e){try{u(i.next(e))}catch(e){t(e)}}function s(e){try{u(i.throw(e))}catch(e){t(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(a,s)}u((i=i.apply(n,r||[])).next())}));var n,r,o,i}function On(e,t,n){return r=this,o=void 0,i=void 0,a=z().mark((function r(){return z().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t){r.next=4;break}return r.next=3,e.tokenManager.getTokens();case 3:t=r.sent.accessToken;case 4:if(n){r.next=8;break}return r.next=7,e.tokenManager.getTokens();case 7:n=r.sent.idToken;case 8:if(t&&un(t)){r.next=10;break}return r.abrupt("return",Promise.reject(new k("getUserInfo requires an access token object")));case 10:if(n&&cn(n)){r.next=12;break}return r.abrupt("return",Promise.reject(new k("getUserInfo requires an ID token object")));case 12:return r.abrupt("return",_e(e,{url:t.userinfoUrl,method:"GET",accessToken:t.accessToken}).then((function(e){return e.sub===n.claims.sub?e:Promise.reject(new k("getUserInfo request was rejected due to token mismatch"))})).catch((function(e){var t;if(e.xhr&&(401===e.xhr.status||403===e.xhr.status)&&(e.xhr.headers&&be(e.xhr.headers.get)&&e.xhr.headers.get("WWW-Authenticate")?t=e.xhr.headers.get("WWW-Authenticate"):be(e.xhr.getResponseHeader)&&(t=e.xhr.getResponseHeader("WWW-Authenticate")),t)){var n=t.match(/error="(.*?)"/)||[],r=t.match(/error_description="(.*?)"/)||[],o=n[1],i=r[1];o&&i&&(e=new w(o,i))}throw e})));case 13:case"end":return r.stop()}}),r)})),new(i||(i=Promise))((function(e,t){function n(e){try{u(a.next(e))}catch(e){t(e)}}function s(e){try{u(a.throw(e))}catch(e){t(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(n,s)}u((a=a.apply(r,o||[])).next())}));var r,o,i,a}function _n(e,t){if(arguments.length>2)return Promise.reject(new k('As of version 3.0, "getWithPopup" takes only a single set of options'));var n=ct("/",t);return t=N(t)||{},Object.assign(t,{display:"popup",responseMode:"okta_post_message",popupWindow:n}),mn(e,t)}var En=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function An(e,t){return En(this,arguments,void 0,z().mark((function n(){var r,o,i,a=arguments;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(a.length>2)){n.next=2;break}return n.abrupt("return",Promise.reject(new k('As of version 3.0, "getWithRedirect" takes only a single set of options')));case 2:return t=N(t)||{},n.next=5,Jt(e,t);case 5:r=n.sent,o=Bt(e,r),i=o.urls.authorizeUrl+Xe(r),e.transactionManager.save(o,{oauth:!0}),e.token.getWithRedirect._setLocation(i);case 10:case"end":return n.stop()}}),n)})))}function Rn(e){var t=e.options.pkce?"query":"fragment";return e.options.responseMode||t}function Pn(e,t){var n,r=(t=ye(t=t||{})?{url:t}:t).url,o=t.responseMode||Rn(e),i=e.token.parseFromUrl._getLocation();if(!(n="query"===o?r?r.substring(r.indexOf("?")):i.search:r?r.substring(r.indexOf("#")):i.hash))throw new k("Unable to parse a token from the url");return Qt(n)}function Cn(e,t){"query"===(t.responseMode||Rn(e))?function(e){var t=e.token.parseFromUrl._getHistory(),n=e.token.parseFromUrl._getDocument(),r=e.token.parseFromUrl._getLocation();t&&t.replaceState?t.replaceState(null,n.title,r.pathname+r.hash):r.search=""}(e):function(e){var t=e.token.parseFromUrl._getHistory(),n=e.token.parseFromUrl._getDocument(),r=e.token.parseFromUrl._getLocation();t&&t.replaceState?t.replaceState(null,n.title,r.pathname+r.search):r.hash=""}(e)}function jn(e,t){return n=this,r=void 0,o=void 0,i=z().mark((function n(){var r,o,i,a;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(t=ye(t=t||{})?{url:t}:t,r=Pn(e,t),o=r.state,i=e.transactionManager.load({oauth:!0,pkce:e.options.pkce,state:o})){n.next=7;break}return n.abrupt("return",Promise.reject(new k("Unable to retrieve OAuth redirect params from storage")));case 7:return a=i.urls,delete i.urls,t.url||Cn(e,t),n.abrupt("return",gn(e,i,r,a).catch((function(t){throw Rt(t)||e.transactionManager.clear({state:o}),t})).then((function(t){return e.transactionManager.clear({state:o}),t})));case 11:case"end":return n.stop()}}),n)})),new(o||(o=Promise))((function(e,t){function a(e){try{u(i.next(e))}catch(e){t(e)}}function s(e){try{u(i.throw(e))}catch(e){t(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(a,s)}u((i=i.apply(n,r||[])).next())}));var n,r,o,i}var In=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[];return e.forEach((function(e){"webauthn"===e.key&&t.push({type:"public-key",id:j(e.credentialId)})})),t},Mn=function(e,t){return{publicKey:{rp:e.rp,user:{id:j(e.user.id),name:e.user.name,displayName:e.user.displayName},challenge:j(e.challenge),pubKeyCredParams:e.pubKeyCredParams,attestation:e.attestation,authenticatorSelection:e.authenticatorSelection,excludeCredentials:In(t)}}},Ln=function(e,t){return{publicKey:{challenge:j(e.challenge),userVerification:e.userVerification,allowCredentials:In(t)}}},Un=function(e){var t=e.response;return{id:e.id,clientData:I(t.clientDataJSON),attestation:I(t.attestationObject)}},Dn=function(e){var t=e.response;return{id:e.id,clientData:I(t.clientDataJSON),authenticatorData:I(t.authenticatorData),signatureData:I(t.signature)}};function Nn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var Fn=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=Nn({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var a in o)o[a]&&(i+="; "+a,!0!==o[a]&&(i+="="+o[a].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+i}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var i=n[o].split("="),a=i.slice(1).join("=");try{var s=decodeURIComponent(i[0]);if(r[s]=t.read(a,s),e===s)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",Nn({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,Nn({},this.attributes,t))},withConverter:function(t){return e(Nn({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),Bn=Fn;function Kn(){return"undefined"!=typeof window?window.console:"undefined"!=typeof console?console:void 0}function Hn(){var e=Kn();return e&&e.log?e:{log:function(){},warn:function(){},group:function(){},groupEnd:function(){}}}function qn(e){Hn().warn("[okta-auth-sdk] WARN: "+e)}function Vn(e){Hn().warn("[okta-auth-sdk] DEPRECATION: "+e)}function Wn(e,t){return function(){return Vn(e),t.apply(null,arguments)}}var zn={getHttpCache:function(){return null},getPKCEStorage:function(){return null},browserHasLocalStorage:function(){try{var e=this.getLocalStorage();return this.testStorage(e)}catch(e){return!1}},browserHasSessionStorage:function(){try{var e=this.getSessionStorage();return this.testStorage(e)}catch(e){return!1}},testStorageType:function(e){var t=!1;switch(e){case"sessionStorage":t=this.browserHasSessionStorage();break;case"localStorage":t=this.browserHasLocalStorage();break;case"cookie":case"memory":t=!0;break;default:t=!1}return t},getStorageByType:function(e,t){var n;switch(e){case"sessionStorage":n=this.getSessionStorage();break;case"localStorage":n=this.getLocalStorage();break;case"cookie":n=this.getCookieStorage(t);break;case"memory":n=this.getInMemoryStorage();break;default:throw new k("Unrecognized storage option: ".concat(e))}return n},findStorageType:function(e){var t,n;return t=(e=e.slice()).shift(),(n=e.length?e[0]:null)?this.testStorageType(t)?t:(qn("This browser doesn't support ".concat(t,". Switching to ").concat(n,".")),this.findStorageType(e)):t},getLocalStorage:function(){return localStorage},getSessionStorage:function(){return sessionStorage},getCookieStorage:function(e){var t=this,n=e.secure,r=e.sameSite,o=e.sessionCookie;if(void 0===n||void 0===r)throw new k('getCookieStorage: "secure" and "sameSite" options must be provided');var i={getItem:this.storage.get,setItem:function(e,i){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"2200-01-01T00:00:00.000Z";a=o?null:a,t.storage.set(e,i,a,{secure:n,sameSite:r})},removeItem:function(e){t.storage.delete(e)}};return e.useSeparateCookies?{getItem:function(e){var t=i.getItem(),n={};return Object.keys(t).forEach((function(r){0===r.indexOf(e)&&(n[r.replace("".concat(e,"_"),"")]=JSON.parse(t[r]))})),JSON.stringify(n)},setItem:function(e,t){var n=JSON.parse(this.getItem(e));t=JSON.parse(t),Object.keys(t).forEach((function(r){var o=e+"_"+r,a=JSON.stringify(t[r]);i.setItem(o,a),delete n[r]})),Object.keys(n).forEach((function(t){i.removeItem(e+"_"+t)}))},removeItem:function(e){var t=JSON.parse(this.getItem(e));Object.keys(t).forEach((function(t){i.removeItem(e+"_"+t)}))}}:i},inMemoryStore:{},getInMemoryStorage:function(){var e=this;return{getItem:function(t){return e.inMemoryStore[t]},setItem:function(t,n){e.inMemoryStore[t]=n}}},testStorage:function(e){var t="okta-test-storage";try{return e.setItem(t,t),e.removeItem(t),!0}catch(e){return!1}},storage:{set:function(e,t,n,r){var o=r.sameSite,i=r.secure;if(void 0===i||void 0===o)throw new k('storage.set: "secure" and "sameSite" options must be provided');var a={path:r.path||"/",secure:i,sameSite:o};return Date.parse(n)&&(a.expires=new Date(n)),Bn.set(e,t,a),this.get(e)},get:function(e){return arguments.length?Bn.get(e):Bn.get()},delete:function(e){return Bn.remove(e,{path:"/"})}}},Gn=zn,Jn=function(){function e(t){s(this,e),this.localOffset=parseInt(t||0)}return V(e,[{key:"now",value:function(){return(Date.now()+this.localOffset)/1e3}}],[{key:"create",value:function(){return new e(0)}}]),e}(),$n=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Yn={autoRenew:!0,autoRemove:!0,syncStorage:!0,clearPendingRemoveTokens:!0,storage:void 0,expireEarlySeconds:30,storageKey:ee,_storageEventDelay:0},Qn="expired",Xn="renewed",Zn="added",er="removed",tr="error",nr=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(s(this,e),this.sdk=t,this.emitter=t.emitter,!this.emitter)throw new k("Emitter should be initialized before TokenManager");n=Object.assign({},Yn,D(n)),bt()&&(n._storageEventDelay=n._storageEventDelay||1e3),Et()||(n.expireEarlySeconds=Yn.expireEarlySeconds),this.options=n;var r=D({storageKey:n.storageKey,secure:n.secure});"object"===l(n.storage)?r.storageProvider=n.storage:n.storage&&(r.storageType=n.storage),this.storage=t.storageManager.getTokenStorage(Object.assign(Object.assign({},r),{useSeparateCookies:!0})),this.clock=Jn.create(),this.state={expireTimeouts:{},renewPromise:null},this.on=this.emitter.on.bind(this.emitter),this.off=this.emitter.off.bind(this.emitter)}return V(e,[{key:"start",value:function(){this.options.clearPendingRemoveTokens&&this.clearPendingRemoveTokens(),this.setExpireEventTimeoutAll()}},{key:"stop",value:function(){this.clearExpireEventTimeoutAll()}},{key:"getOptions",value:function(){return N(this.options)}},{key:"getExpireTime",value:function(e){var t=this.options.expireEarlySeconds||0;return e.expiresAt-t}},{key:"hasExpired",value:function(e){return this.getExpireTime(e)<=this.clock.now()}},{key:"emitExpired",value:function(e,t){this.emitter.emit(Qn,e,t)}},{key:"emitRenewed",value:function(e,t,n){this.emitter.emit(Xn,e,t,n)}},{key:"emitAdded",value:function(e,t){this.emitter.emit(Zn,e,t)}},{key:"emitRemoved",value:function(e,t){this.emitter.emit(er,e,t)}},{key:"emitError",value:function(e){this.emitter.emit(tr,e)}},{key:"emitEventsForCrossTabsStorageUpdate",value:function(e,t){var n=this,r=this.getTokensFromStorageValue(t),o=this.getTokensFromStorageValue(e);Object.keys(o).forEach((function(e){var t=r[e],i=o[e];JSON.stringify(t)!==JSON.stringify(i)&&n.emitAdded(e,i)})),Object.keys(r).forEach((function(e){var t=r[e];o[e]||n.emitRemoved(e,t)}))}},{key:"clearExpireEventTimeout",value:function(e){clearTimeout(this.state.expireTimeouts[e]),delete this.state.expireTimeouts[e],this.state.renewPromise=null}},{key:"clearExpireEventTimeoutAll",value:function(){var e=this.state.expireTimeouts;for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.clearExpireEventTimeout(t)}},{key:"setExpireEventTimeout",value:function(e,t){var n=this;if(!ln(t)){var r=this.getExpireTime(t),o=1e3*Math.max(r-this.clock.now(),0);this.clearExpireEventTimeout(e);var i=setTimeout((function(){n.emitExpired(e,t)}),o);this.state.expireTimeouts[e]=i}}},{key:"setExpireEventTimeoutAll",value:function(){var e=this.storage.getStorage();for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var n=e[t];this.setExpireEventTimeout(t,n)}}},{key:"resetExpireEventTimeoutAll",value:function(){this.clearExpireEventTimeoutAll(),this.setExpireEventTimeoutAll()}},{key:"add",value:function(e,t){var n=this.storage.getStorage();fn(t),n[e]=t,this.storage.setStorage(n),this.emitAdded(e,t),this.setExpireEventTimeout(e,t)}},{key:"getSync",value:function(e){return this.storage.getStorage()[e]}},{key:"get",value:function(e){return $n(this,void 0,void 0,z().mark((function t(){return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.getSync(e));case 1:case"end":return t.stop()}}),t,this)})))}},{key:"getTokensSync",value:function(){var e={},t=this.storage.getStorage();return Object.keys(t).forEach((function(n){var r=t[n];un(r)?e.accessToken=r:cn(r)?e.idToken=r:ln(r)&&(e.refreshToken=r)})),e}},{key:"getTokens",value:function(){return $n(this,void 0,void 0,z().mark((function e(){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.getTokensSync());case 1:case"end":return e.stop()}}),e,this)})))}},{key:"getStorageKeyByType",value:function(e){var t=this.storage.getStorage();return Object.keys(t).filter((function(n){var r=t[n];return un(r)&&"accessToken"===e||cn(r)&&"idToken"===e||ln(r)&&"refreshToken"===e}))[0]}},{key:"getTokenType",value:function(e){if(un(e))return"accessToken";if(cn(e))return"idToken";if(ln(e))return"refreshToken";throw new k("Unknown token type")}},{key:"setTokens",value:function(e,t,n,r){var o=this,i=function(e,i){var a=o.getTokenType(i);"accessToken"===a?t&&t(e,i):"idToken"===a?n&&n(e,i):"refreshToken"===a&&r&&r(e,i)},a=function(e,t){o.emitAdded(e,t),o.setExpireEventTimeout(e,t),i(e,t)},s=function(e,t){o.clearExpireEventTimeout(e),o.emitRemoved(e,t),i(e,t)},u=["idToken","accessToken","refreshToken"],c=this.getTokensSync();u.forEach((function(t){var n=e[t];n&&fn(n,t)}));var l=u.reduce((function(t,n){var r=e[n];return r&&(t[o.getStorageKeyByType(n)||n]=r),t}),{});this.storage.setStorage(l),u.forEach((function(t){var n,r,u,l=e[t],f=c[t],h=o.getStorageKeyByType(t)||t;l&&f?(s(h,f),a(h,l),n=h,r=l,u=f,o.emitRenewed(n,r,u),o.clearExpireEventTimeout(n),o.setExpireEventTimeout(n,r),i(n,r)):l?a(h,l):f&&s(h,f)}))}},{key:"remove",value:function(e){this.clearExpireEventTimeout(e);var t=this.storage.getStorage(),n=t[e];delete t[e],this.storage.setStorage(t),this.emitRemoved(e,n)}},{key:"renewToken",value:function(e){var t;return $n(this,void 0,void 0,z().mark((function n(){return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",null===(t=this.sdk.token)||void 0===t?void 0:t.renew(e));case 1:case"end":return n.stop()}}),n,this)})))}},{key:"validateToken",value:function(e){return fn(e)}},{key:"renew",value:function(e){var t=this;if(this.state.renewPromise)return this.state.renewPromise;try{var n=this.getSync(e);if(!n)throw new k("The tokenManager has no token for the key: "+e)}catch(e){return Promise.reject(e)}return this.clearExpireEventTimeout(e),this.state.renewPromise=this.sdk.token.renewTokens().then((function(e){return t.setTokens(e),e[t.getTokenType(n)]})).catch((function(n){throw t.remove(e),n.tokenKey=e,t.emitError(n),n})).finally((function(){t.state.renewPromise=null})),this.state.renewPromise}},{key:"clear",value:function(){this.clearExpireEventTimeoutAll(),this.storage.clearStorage()}},{key:"clearPendingRemoveTokens",value:function(){var e=this,t=this.getTokensSync();Object.keys(t).forEach((function(n){t[n].pendingRemove&&e.remove(n)}))}},{key:"getTokensFromStorageValue",value:function(e){var t;try{t=JSON.parse(e)||{}}catch(e){t={}}return t}},{key:"updateRefreshToken",value:function(e){var t=this.getStorageKeyByType("refreshToken")||ce,n=this.storage.getStorage();fn(e),n[t]=e,this.storage.setStorage(n)}},{key:"addPendingRemoveFlags",value:function(){var e=this.getTokensSync();Object.keys(e).forEach((function(t){e[t].pendingRemove=!0})),this.setTokens(e)}}]),e}();function rr(e){return function(e){if(Array.isArray(e))return Ze(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||et(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Promise.resolve(!1);var or=Promise.resolve(!0),ir=Promise.resolve();function ar(e,t){return e||(e=0),new Promise((function(n){return setTimeout((function(){return n(t)}),e)}))}function sr(){return Math.random().toString(36).substring(2)}var ur=0,cr=0;function lr(){var e=(new Date).getTime();return e===ur?1e3*e+ ++cr:(ur=e,cr=0,1e3*e)}var fr="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),hr={create:function(e){var t={messagesCallback:null,bc:new BroadcastChannel(e),subFns:[]};return t.bc.onmessage=function(e){t.messagesCallback&&t.messagesCallback(e.data)},t},close:function(e){e.bc.close(),e.subFns=[]},onMessage:function(e,t){e.messagesCallback=t},postMessage:function(e,t){try{return e.bc.postMessage(t,!1),ir}catch(e){return Promise.reject(e)}},canBeUsed:function(){if(fr&&"undefined"==typeof window)return!1;if("function"==typeof BroadcastChannel){if(BroadcastChannel._pubkey)throw new Error("BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill");return!0}return!1},type:"native",averageResponseTime:function(){return 150},microSeconds:lr},dr=function(){function e(e){this.ttl=e,this.set=new Set,this.timeMap=new Map}return e.prototype.has=function(e){return this.set.has(e)},e.prototype.add=function(e){var t=this;this.timeMap.set(e,pr()),this.set.add(e),setTimeout((function(){!function(e){for(var t=pr()-e.ttl,n=e.set[Symbol.iterator]();;){var r=n.next().value;if(!r)return;if(!(e.timeMap.get(r)<t))return;e.timeMap.delete(r),e.set.delete(r)}}(t)}),0)},e.prototype.clear=function(){this.set.clear(),this.timeMap.clear()},e}();function pr(){return(new Date).getTime()}function vr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=JSON.parse(JSON.stringify(e));return void 0===t.webWorkerSupport&&(t.webWorkerSupport=!0),t.idb||(t.idb={}),t.idb.ttl||(t.idb.ttl=45e3),t.idb.fallbackInterval||(t.idb.fallbackInterval=150),e.idb&&"function"==typeof e.idb.onclose&&(t.idb.onclose=e.idb.onclose),t.localstorage||(t.localstorage={}),t.localstorage.removeTimeout||(t.localstorage.removeTimeout=6e4),e.methods&&(t.methods=e.methods),t.node||(t.node={}),t.node.ttl||(t.node.ttl=12e4),t.node.maxParallelWrites||(t.node.maxParallelWrites=2048),void 0===t.node.useFastPath&&(t.node.useFastPath=!0),t}var yr="messages";function gr(){if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof window){if(void 0!==window.mozIndexedDB)return window.mozIndexedDB;if(void 0!==window.webkitIndexedDB)return window.webkitIndexedDB;if(void 0!==window.msIndexedDB)return window.msIndexedDB}return!1}function mr(e){e.closed||br(e).then((function(){return ar(e.options.idb.fallbackInterval)})).then((function(){return mr(e)}))}function br(e){return e.closed?ir:e.messagesCallback?(t=e.db,n=e.lastCursorId,r=t.transaction(yr).objectStore(yr),o=[],new Promise((function(e){(function(){try{var e=IDBKeyRange.bound(n+1,1/0);return r.openCursor(e)}catch(e){return r.openCursor()}}()).onsuccess=function(t){var r=t.target.result;r?r.value.id<n+1?r.continue(n+1):(o.push(r.value),r.continue()):e(o)}}))).then((function(t){var n=t.filter((function(e){return!!e})).map((function(t){return t.id>e.lastCursorId&&(e.lastCursorId=t.id),t})).filter((function(t){return function(e,t){return!(e.uuid===t.uuid||t.eMIs.has(e.id)||e.data.time<t.messagesCallbackTime)}(t,e)})).sort((function(e,t){return e.time-t.time}));return n.forEach((function(t){e.messagesCallback&&(e.eMIs.add(t.id),e.messagesCallback(t.data))})),ir})):ir;var t,n,r,o}var kr={create:function(e,t){return t=vr(t),function(e){var t="pubkey.broadcast-channel-0-"+e,n=gr().open(t,1);return n.onupgradeneeded=function(e){e.target.result.createObjectStore(yr,{keyPath:"id",autoIncrement:!0})},new Promise((function(e,t){n.onerror=function(e){return t(e)},n.onsuccess=function(){e(n.result)}}))}(e).then((function(n){var r={closed:!1,lastCursorId:0,channelName:e,options:t,uuid:sr(),eMIs:new dr(2*t.idb.ttl),writeBlockPromise:ir,messagesCallback:null,readQueuePromises:[],db:n};return n.onclose=function(){r.closed=!0,t.idb.onclose&&t.idb.onclose()},mr(r),r}))},close:function(e){e.closed=!0,e.db.close()},onMessage:function(e,t,n){e.messagesCallbackTime=n,e.messagesCallback=t,br(e)},postMessage:function(e,t){return e.writeBlockPromise=e.writeBlockPromise.then((function(){return function(e,t,n){var r={uuid:t,time:(new Date).getTime(),data:n},o=e.transaction([yr],"readwrite");return new Promise((function(e,t){o.oncomplete=function(){return e()},o.onerror=function(e){return t(e)},o.objectStore(yr).add(r)}))}(e.db,e.uuid,t)})).then((function(){var t,n;0===(0,10,Math.floor(11*Math.random()+0))&&(t=e.db,n=e.options.idb.ttl,function(e,t){var n=(new Date).getTime()-t,r=e.transaction(yr).objectStore(yr),o=[];return new Promise((function(e){r.openCursor().onsuccess=function(t){var r=t.target.result;if(r){var i=r.value;if(!(i.time<n))return void e(o);o.push(i),r.continue()}else e(o)}}))}(t,n).then((function(e){return Promise.all(e.map((function(e){return function(e,t){var n=e.transaction([yr],"readwrite").objectStore(yr).delete(t);return new Promise((function(e){n.onsuccess=function(){return e()}}))}(t,e.id)})))})))})),e.writeBlockPromise},canBeUsed:function(){return!fr&&!!gr()},type:"idb",averageResponseTime:function(e){return 2*e.idb.fallbackInterval},microSeconds:lr};function wr(){var e;if("undefined"==typeof window)return null;try{e=window.localStorage,e=window["ie8-eventlistener/storage"]||window.localStorage}catch(e){}return e}function Tr(e){return"pubkey.broadcastChannel-"+e}function Sr(){if(fr)return!1;var e=wr();if(!e)return!1;try{var t="__broadcastchannel_check";e.setItem(t,"works"),e.removeItem(t)}catch(e){return!1}return!0}var xr={create:function(e,t){if(t=vr(t),!Sr())throw new Error("BroadcastChannel: localstorage cannot be used");var n=sr(),r=new dr(t.localstorage.removeTimeout),o={channelName:e,uuid:n,eMIs:r};return o.listener=function(e,t){var i=Tr(e),a=function(e){var t;e.key===i&&(t=JSON.parse(e.newValue),o.messagesCallback&&t.uuid!==n&&t.token&&!r.has(t.token)&&(t.data.time&&t.data.time<o.messagesCallbackTime||(r.add(t.token),o.messagesCallback(t.data))))};return window.addEventListener("storage",a),a}(e),o},close:function(e){var t;t=e.listener,window.removeEventListener("storage",t)},onMessage:function(e,t,n){e.messagesCallbackTime=n,e.messagesCallback=t},postMessage:function(e,t){return new Promise((function(n){ar().then((function(){var r=Tr(e.channelName),o={token:sr(),time:(new Date).getTime(),data:t,uuid:e.uuid},i=JSON.stringify(o);wr().setItem(r,i);var a=document.createEvent("Event");a.initEvent("storage",!0,!0),a.key=r,a.newValue=i,window.dispatchEvent(a),n()}))}))},canBeUsed:Sr,type:"localstorage",averageResponseTime:function(){var e=navigator.userAgent.toLowerCase();return e.includes("safari")&&!e.includes("chrome")?240:120},microSeconds:lr},Or=lr,_r=new Set,Er={create:function(e){var t={name:e,messagesCallback:null};return _r.add(t),t},close:function(e){_r.delete(e)},onMessage:function(e,t){e.messagesCallback=t},postMessage:function(e,t){return new Promise((function(n){return setTimeout((function(){Array.from(_r).filter((function(t){return t.name===e.name})).filter((function(t){return t!==e})).filter((function(e){return!!e.messagesCallback})).forEach((function(e){return e.messagesCallback(t)})),n()}),5)}))},canBeUsed:function(){return!0},type:"simulate",averageResponseTime:function(){return 5},microSeconds:Or},Ar=[hr,kr,xr],Rr=new Set,Pr=0,Cr=function(e,t){var n,r,o;this.id=Pr++,Rr.add(this),this.name=e,this.options=vr(t),this.method=function(e){var t=[].concat(e.methods,Ar).filter(Boolean);if(e.type){if("simulate"===e.type)return Er;var n=t.find((function(t){return t.type===e.type}));if(n)return n;throw new Error("method-type "+e.type+" not found")}e.webWorkerSupport||fr||(t=t.filter((function(e){return"idb"!==e.type})));var r=t.find((function(e){return e.canBeUsed()}));if(r)return r;throw new Error("No useable method found in "+JSON.stringify(Ar.map((function(e){return e.type}))))}(this.options),this._iL=!1,this._onML=null,this._addEL={message:[],internal:[]},this._uMP=new Set,this._befC=[],this._prepP=null,(o=r=(n=this).method.create(n.name,n.options))&&"function"==typeof o.then?(n._prepP=r,r.then((function(e){n._state=e}))):n._state=r};function jr(e,t,n){var r={time:e.method.microSeconds(),type:t,data:n};return(e._prepP?e._prepP:ir).then((function(){var t=e.method.postMessage(e._state,r);return e._uMP.add(t),t.catch().then((function(){return e._uMP.delete(t)})),t}))}function Ir(e){return e._addEL.message.length>0||e._addEL.internal.length>0}function Mr(e,t,n){e._addEL[t].push(n),function(e){if(!e._iL&&Ir(e)){var t=function(t){e._addEL[t.type].forEach((function(e){var n=e.time-1e5;t.time>=n&&e.fn(t.data)}))},n=e.method.microSeconds();e._prepP?e._prepP.then((function(){e._iL=!0,e.method.onMessage(e._state,t,n)})):(e._iL=!0,e.method.onMessage(e._state,t,n))}}(e)}function Lr(e,t,n){e._addEL[t]=e._addEL[t].filter((function(e){return e!==n})),function(e){if(e._iL&&!Ir(e)){e._iL=!1;var t=e.method.microSeconds();e.method.onMessage(e._state,null,t)}}(e)}Cr._pubkey=!0,Cr.prototype={postMessage:function(e){if(this.closed)throw new Error("BroadcastChannel.postMessage(): Cannot post message after channel has closed "+JSON.stringify(e));return jr(this,"message",e)},postInternal:function(e){return jr(this,"internal",e)},set onmessage(e){var t={time:this.method.microSeconds(),fn:e};Lr(this,"message",this._onML),e&&"function"==typeof e?(this._onML=t,Mr(this,"message",t)):this._onML=null},addEventListener:function(e,t){Mr(this,e,{time:this.method.microSeconds(),fn:t})},removeEventListener:function(e,t){Lr(this,e,this._addEL[e].find((function(e){return e.fn===t})))},close:function(){var e=this;if(!this.closed){Rr.delete(this),this.closed=!0;var t=this._prepP?this._prepP:ir;return this._onML=null,this._addEL.message=[],t.then((function(){return Promise.all(Array.from(e._uMP))})).then((function(){return Promise.all(e._befC.map((function(e){return e()})))})).then((function(){return e.method.close(e._state)}))}},get type(){return this.method.type},get isClosed(){return this.closed}};var Ur=n(643),Dr=n.n(Ur),Nr={add:function(e){if("function"==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope);else{if("function"!=typeof window.addEventListener)return;window.addEventListener("beforeunload",(function(){e()}),!0),window.addEventListener("unload",(function(){e()}),!0)}}},Fr=n(199),Br=n.n(Fr),Kr=Dr()?Br():Nr,Hr=new Set,qr=!1;function Vr(){var e=[];return Hr.forEach((function(t){e.push(t()),Hr.delete(t)})),Promise.all(e)}var Wr=function(e,t){var n=this;this.broadcastChannel=e,this._options=t,this.isLeader=!1,this.hasLeader=!1,this.isDead=!1,this.token=sr(),this._aplQ=ir,this._aplQC=0,this._unl=[],this._lstns=[],this._dpL=function(){},this._dpLC=!1;var r=function(e){"leader"===e.context&&("death"===e.action&&(n.hasLeader=!1),"tell"===e.action&&(n.hasLeader=!0))};this.broadcastChannel.addEventListener("internal",r),this._lstns.push(r)};function zr(e,t){var n={context:"leader",action:t,token:e.token};return e.broadcastChannel.postInternal(n)}Wr.prototype={applyOnce:function(e){var t=this;if(this.isLeader)return ar(0,!0);if(this.isDead)return ar(0,!1);if(this._aplQC>1)return this._aplQ;var n=function(){if(t.isLeader)return or;var n,r=!1,o=new Promise((function(e){n=function(){r=!0,e()}})),i=[],a=function(e){"leader"===e.context&&e.token!=t.token&&(i.push(e),"apply"===e.action&&e.token>t.token&&n(),"tell"===e.action&&(n(),t.hasLeader=!0))};t.broadcastChannel.addEventListener("internal",a);var s=e?4*t._options.responseTime:t._options.responseTime;return zr(t,"apply").then((function(){return Promise.race([ar(s),o.then((function(){return Promise.reject(new Error)}))])})).then((function(){return zr(t,"apply")})).then((function(){return Promise.race([ar(s),o.then((function(){return Promise.reject(new Error)}))])})).catch((function(){})).then((function(){return t.broadcastChannel.removeEventListener("internal",a),!r&&function(e){e.isLeader=!0,e.hasLeader=!0;var t=function(e){if(qr||(qr=!0,Kr.add(Vr)),"function"!=typeof e)throw new Error("Listener is no function");return Hr.add(e),{remove:function(){return Hr.delete(e)},run:function(){return Hr.delete(e),e()}}}((function(){return e.die()}));e._unl.push(t);var n=function(t){"leader"===t.context&&"apply"===t.action&&zr(e,"tell"),"leader"!==t.context||"tell"!==t.action||e._dpLC||(e._dpLC=!0,e._dpL(),zr(e,"tell"))};return e.broadcastChannel.addEventListener("internal",n),e._lstns.push(n),zr(e,"tell")}(t).then((function(){return!0}))}))};return this._aplQC=this._aplQC+1,this._aplQ=this._aplQ.then((function(){return n()})).then((function(){t._aplQC=t._aplQC-1})),this._aplQ.then((function(){return t.isLeader}))},awaitLeadership:function(){return this._aLP||(this._aLP=(e=this).isLeader?ir:new Promise((function(t){var n=!1;function r(){n||(n=!0,e.broadcastChannel.removeEventListener("internal",o),t(!0))}e.applyOnce().then((function(){e.isLeader&&r()})),function t(){return ar(e._options.fallbackInterval).then((function(){if(!e.isDead&&!n)return e.isLeader?void r():e.applyOnce(!0).then((function(){e.isLeader?r():t()}))}))}();var o=function(t){"leader"===t.context&&"death"===t.action&&(e.hasLeader=!1,e.applyOnce().then((function(){e.isLeader&&r()})))};e.broadcastChannel.addEventListener("internal",o),e._lstns.push(o)}))),this._aLP;var e},set onduplicate(e){this._dpL=e},die:function(){var e=this;return this._lstns.forEach((function(t){return e.broadcastChannel.removeEventListener("internal",t)})),this._lstns=[],this._unl.forEach((function(e){return e.remove()})),this._unl=[],this.isLeader&&(this.hasLeader=!1,this.isLeader=!1),this.isDead=!0,zr(this,"death")}};var Gr=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,e),this.started=!1,this.tokenManager=t,this.options=n,this.renewTimeQueue=[],this.onTokenExpiredHandler=this.onTokenExpiredHandler.bind(this)}return V(e,[{key:"shouldThrottleRenew",value:function(){var e=!1;if(this.renewTimeQueue.push(Date.now()),this.renewTimeQueue.length>=10){var t=this.renewTimeQueue.shift();e=this.renewTimeQueue[this.renewTimeQueue.length-1]-t<3e4}return e}},{key:"requiresLeadership",value:function(){return!!this.options.syncStorage&&mt()}},{key:"onTokenExpiredHandler",value:function(e){if(this.options.autoRenew)if(this.shouldThrottleRenew()){var t=new k("Too many token renew requests");this.tokenManager.emitError(t)}else this.tokenManager.renew(e).catch((function(){}));else this.options.autoRemove&&this.tokenManager.remove(e)}},{key:"canStart",value:function(){return!!this.options.autoRenew||!!this.options.autoRemove}},{key:"start",value:function(){this.canStart()&&(this.stop(),this.tokenManager.on(Qn,this.onTokenExpiredHandler),this.started=!0)}},{key:"stop",value:function(){this.started&&(this.tokenManager.off(Qn,this.onTokenExpiredHandler),this.renewTimeQueue=[],this.started=!1)}},{key:"isStarted",value:function(){return this.started}}]),e}(),Jr=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,e),this.started=!1,this.tokenManager=t,this.options=n,this.storageListener=this.storageListener.bind(this)}return V(e,[{key:"storageListener",value:function(e){var t=this,n=e.key,r=e.newValue,o=e.oldValue,i=this.tokenManager.getOptions();(!n||n===i.storageKey&&r!==o)&&(this.syncTimeout=setTimeout((function(){return t.tokenManager.resetExpireEventTimeoutAll(),void t.tokenManager.emitEventsForCrossTabsStorageUpdate(r,o)}),i._storageEventDelay))}},{key:"requiresLeadership",value:function(){return!1}},{key:"isStarted",value:function(){return this.started}},{key:"canStart",value:function(){return!!this.options.syncStorage&&mt()}},{key:"start",value:function(){this.canStart()&&(this.stop(),window.addEventListener("storage",this.storageListener),this.started=!0)}},{key:"stop",value:function(){this.started&&(window.removeEventListener("storage",this.storageListener),clearTimeout(this.syncTimeout),this.started=!1)}}]),e}();function $r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Yr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Yr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Qr=function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,e),this.sdk=t;var o=t.tokenManager.getOptions(),i=o.autoRenew,a=o.autoRemove,u=o.syncStorage;this.options=Object.assign({},e.defaultOptions,{autoRenew:i,autoRemove:a,syncStorage:u},r),this.started=!1,this.services=new Map,this.onLeaderDuplicate=this.onLeaderDuplicate.bind(this),this.onLeader=this.onLeader.bind(this),e.knownServices.forEach((function(e){var t=n.createService(e);t&&n.services.set(e,t)}))}return V(e,[{key:"onLeader",value:function(){this.started&&this.startServices()}},{key:"onLeaderDuplicate",value:function(){}},{key:"isLeader",value:function(){var e;return!!(null===(e=this.elector)||void 0===e?void 0:e.isLeader)}},{key:"hasLeader",value:function(){var e;return null===(e=this.elector)||void 0===e?void 0:e.hasLeader}},{key:"isLeaderRequired",value:function(){return rr(this.services.values()).some((function(e){return e.requiresLeadership()}))}},{key:"start",value:function(){this.started&&this.stop(),this.isLeaderRequired()&&this.startElector(),this.startServices(),this.started=!0}},{key:"stop",value:function(){this.stopElector(),this.stopServices(),this.started=!1}},{key:"getService",value:function(e){return this.services.get(e)}},{key:"startServices",value:function(){var e,t=$r(this.services.values());try{for(t.s();!(e=t.n()).done;){var n=e.value;n.canStart()&&!n.isStarted()&&(!n.requiresLeadership()||this.isLeader())&&n.start()}}catch(e){t.e(e)}finally{t.f()}}},{key:"stopServices",value:function(){var e,t=$r(this.services.values());try{for(t.s();!(e=t.n()).done;)e.value.stop()}catch(e){t.e(e)}finally{t.f()}}},{key:"startElector",value:function(){if(this.stopElector(),e.canUseLeaderElection()){if(!this.channel){var t=this.options.broadcastChannelName;this.channel=new Cr(t)}this.elector||(this.elector=function(e,t){if(e._leaderElector)throw new Error("BroadcastChannel already has a leader-elector");t=function(e,t){return e||(e={}),(e=JSON.parse(JSON.stringify(e))).fallbackInterval||(e.fallbackInterval=3e3),e.responseTime||(e.responseTime=t.method.averageResponseTime(t.options)),e}(t,e);var n=new Wr(e,t);return e._befC.push((function(){return n.die()})),e._leaderElector=n,n}(this.channel),this.elector.onduplicate=this.onLeaderDuplicate,this.elector.awaitLeadership().then(this.onLeader))}}},{key:"stopElector",value:function(){var e,t;this.elector&&(null===(e=this.elector)||void 0===e||e.die(),this.elector=void 0,null===(t=this.channel)||void 0===t||t.close(),this.channel=void 0)}},{key:"createService",value:function(e){var t,n=this.sdk.tokenManager;switch(e){case"autoRenew":t=new Gr(n,Object.assign({},this.options));break;case"syncStorage":t=new Jr(n,Object.assign({},this.options));break;default:throw new Error("Unknown service ".concat(e))}return t}}],[{key:"canUseLeaderElection",value:function(){return mt()}}]),e}();Qr.knownServices=["autoRenew","syncStorage"],Qr.defaultOptions={autoRenew:!0,autoRemove:!0,syncStorage:!0};var Xr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{quiet:!1};s(this,e),this.queue=[],this.running=!1,this.options=t}return V(e,[{key:"push",value:function(e,t){for(var n=this,r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];return new Promise((function(r,i){n.queue.length>0&&!1!==n.options.quiet&&qn("Async method is being called but another async method is already running. The new method will be delayed until the previous method completes."),n.queue.push({method:e,thisObject:t,args:o,resolve:r,reject:i}),n.run()}))}},{key:"run",value:function(){var e=this;if(!this.running&&0!==this.queue.length){this.running=!0;var t=this.queue.shift(),n=t.method.apply(t.thisObject,t.args);ke(n)?n.then(t.resolve,t.reject).finally((function(){e.running=!1,e.run()})):(t.resolve(n),this.running=!1,this.run())}}}]),e}(),Zr=Xr;function eo(e,t){return t=t||{},wt()?new Promise((function(i,a){(r=document.createElement("iframe")).style.display="none",o=function(t){if(t&&t.data&&t.origin===e.getIssuerOrigin()){try{var n=JSON.parse(t.data)}catch(e){return}if(n)return"FingerprintAvailable"===n.type?i(n.fingerprint):void("FingerprintServiceReady"===n.type&&t.source.postMessage(JSON.stringify({type:"GetFingerprint"}),t.origin))}},at(window,"message",o),r.src=e.getIssuerOrigin()+"/auth/services/devicefingerprint",document.body.appendChild(r),n=setTimeout((function(){a(new k("Fingerprinting timed out"))}),(null==t?void 0:t.timeout)||15e3)})).finally((function(){clearTimeout(n),st(window,"message",o),document.body.contains(r)&&r.parentElement.removeChild(r)})):Promise.reject(new k("Fingerprinting is not supported on this device"));var n,r,o}var to=n(615),no=n.n(to),ro=null,oo={updateAuthStatePromise:null,canceledTimes:0},io="authStateChange",ao=function(){function e(t){var n=this;if(s(this,e),!t.emitter)throw new k("Emitter should be initialized before AuthStateManager");this._sdk=t,this._pending=Object.assign({},oo),this._authState=ro,this._logOptions={},this._prevAuthState=null,this._transformQueue=new Zr({quiet:!0}),t.tokenManager.on(Zn,(function(e,t){n._setLogOptions({event:Zn,key:e,token:t}),n.updateAuthState()})),t.tokenManager.on(er,(function(e,t){n._setLogOptions({event:er,key:e,token:t}),n.updateAuthState()}))}return V(e,[{key:"_setLogOptions",value:function(e){this._logOptions=e}},{key:"getAuthState",value:function(){return this._authState}},{key:"getPreviousAuthState",value:function(){return this._prevAuthState}},{key:"updateAuthState",value:function(){return e=this,t=void 0,n=void 0,r=z().mark((function e(){var t,n,r,o,i,a,s,u=this;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this._sdk.options,n=t.transformAuthState,r=t.devMode,o=function(e){var t=u._logOptions,n=t.event,r=t.key,o=t.token;Hn().group("OKTA-AUTH-JS:updateAuthState: Event:".concat(n," Status:").concat(e)),Hn().log(r,o),Hn().log("Current authState",u._authState),Hn().groupEnd(),u._logOptions={}},i=function(e){var t,n;n=e,(t=u._authState)&&t.isAuthenticated===n.isAuthenticated&&JSON.stringify(t.idToken)===JSON.stringify(n.idToken)&&JSON.stringify(t.accessToken)===JSON.stringify(n.accessToken)&&t.error===n.error?r&&o("unchanged"):(u._prevAuthState=u._authState,u._authState=e,u._sdk.emitter.emit(io,Object.assign({},e)),r&&o("emitted"))},a=function e(t){return u._pending.updateAuthStatePromise.then((function(){var n=u._pending.updateAuthStatePromise;return n&&n!==t?e(n):u.getAuthState()}))},!this._pending.updateAuthStatePromise){e.next=11;break}if(!(this._pending.canceledTimes>=10)){e.next=10;break}return r&&o("terminated"),e.abrupt("return",a(this._pending.updateAuthStatePromise));case 10:this._pending.updateAuthStatePromise.cancel();case 11:return s=new(no())((function(e,t,a){a.shouldReject=!1,a((function(){u._pending.updateAuthStatePromise=null,u._pending.canceledTimes=u._pending.canceledTimes+1,r&&o("canceled")}));var c=function(t){s.isCanceled?e():(i(t),e(),u._pending=Object.assign({},oo))};u._sdk.isAuthenticated().then((function(){if(s.isCanceled)e();else{var t=u._sdk.tokenManager.getTokensSync(),r=t.accessToken,o=t.idToken,i=t.refreshToken,a={accessToken:r,idToken:o,refreshToken:i,isAuthenticated:!(!r||!o)};(n?u._transformQueue.push(n,null,u._sdk,a):Promise.resolve(a)).then((function(e){return c(e)})).catch((function(e){return c({accessToken:r,idToken:o,refreshToken:i,isAuthenticated:!1,error:e})}))}}))})),this._pending.updateAuthStatePromise=s,e.abrupt("return",a(s));case 14:case"end":return e.stop()}}),e,this)})),new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}));var e,t,n,r}},{key:"subscribe",value:function(e){this._sdk.emitter.on(io,e)}},{key:"unsubscribe",value:function(e){this._sdk.emitter.off(io,e)}}]),e}(),so=function(){function e(t,n){if(s(this,e),!t)throw new k('"storage" is required');if("string"!=typeof n||!n.length)throw new k('"storageName" is required');this.storageName=n,this.storageProvider=t}return V(e,[{key:"getItem",value:function(e){return this.getStorage()[e]}},{key:"setItem",value:function(e,t){return this.updateStorage(e,t)}},{key:"removeItem",value:function(e){return this.clearStorage(e)}},{key:"getStorage",value:function(){var e=this.storageProvider.getItem(this.storageName);e=e||"{}";try{return JSON.parse(e)}catch(e){throw new k("Unable to parse storage string: "+this.storageName)}}},{key:"setStorage",value:function(e){try{var t=e?JSON.stringify(e):"{}";this.storageProvider.setItem(this.storageName,t)}catch(e){throw new k("Unable to set storage: "+this.storageName)}}},{key:"clearStorage",value:function(e){if(e){var t=this.getStorage();delete t[e],this.setStorage(t)}else this.storageProvider.removeItem?this.storageProvider.removeItem(this.storageName):this.setStorage()}},{key:"updateStorage",value:function(e,t){var n=this.getStorage();n[e]=t,this.setStorage(n)}}]),e}();function uo(e){mt()||e.storageProvider||e.storageProvider||qn("Memory storage can only support simple single user use case on server side, please provide custom storageProvider or storageKey if advanced scenarios need to be supported.")}var co=function(){function e(t,n,r){s(this,e),this.storageManagerOptions=t,this.cookieOptions=n,this.storageUtil=r}return V(e,[{key:"getOptionsForSection",value:function(e,t){return Object.assign({},this.storageManagerOptions[e],t)}},{key:"getStorage",value:function(e){if((e=Object.assign({},this.cookieOptions,e)).storageProvider)return e.storageProvider;var t=e,n=t.storageType,r=t.storageTypes;if("sessionStorage"===n&&(e.sessionCookie=!0),n&&r){var o=r.indexOf(n);o>=0&&(r=r.slice(o),n=void 0)}return n||(n=this.storageUtil.findStorageType(r)),this.storageUtil.getStorageByType(n,e)}},{key:"getTransactionStorage",value:function(e){uo(e=this.getOptionsForSection("transaction",e));var t=this.getStorage(e),n=e.storageKey||re;return new so(t,n)}},{key:"getSharedTansactionStorage",value:function(e){uo(e=this.getOptionsForSection("shared-transaction",e));var t=this.getStorage(e),n=e.storageKey||oe;return new so(t,n)}},{key:"getOriginalUriStorage",value:function(e){uo(e=this.getOptionsForSection("original-uri",e));var t=this.getStorage(e),n=e.storageKey||ie;return new so(t,n)}},{key:"getIdxResponseStorage",value:function(e){var t;if(mt())try{t=this.storageUtil.getStorageByType("memory",e)}catch(e){qn("No response storage found, you may want to provide custom implementation for intermediate idx responses to optimize the network traffic")}else{var n=this.getTransactionStorage(e);n&&(t={getItem:function(e){var t=n.getStorage();return t&&t[e]?t[e]:null},setItem:function(e,t){var r=n.getStorage();if(!r)throw new k("Transaction has been cleared, failed to save idxState");r[e]=t,n.setStorage(r)},removeItem:function(e){var t=n.getStorage();t&&(delete t[e],n.setStorage(t))}})}return t?new so(t,ae):null}},{key:"getTokenStorage",value:function(e){uo(e=this.getOptionsForSection("token",e));var t=this.getStorage(e),n=e.storageKey||ee;return new so(t,n)}},{key:"getHttpCache",value:function(e){e=this.getOptionsForSection("cache",e);var t=this.getStorage(e),n=e.storageKey||te;return new so(t,n)}},{key:"getLegacyPKCEStorage",value:function(e){e=this.getOptionsForSection("legacy-pkce",e);var t=this.getStorage(e),n=e.storageKey||ne;return new so(t,n)}},{key:"getLegacyOAuthParamsStorage",value:function(e){e=this.getOptionsForSection("legacy-oauth-params",e);var t=this.getStorage(e),n=e.storageKey||Q;return new so(t,n)}}]),e}();function lo(e){return e&&e.version}function fo(e){return e&&lo(e.rawIdxState)}function ho(e){var t=e.getSharedTansactionStorage(),n=t.getStorage();Object.keys(n).forEach((function(e){var t=n[e];Date.now()-t.dateCreated>18e5&&delete n[e]})),t.setStorage(n)}function po(e,t,n){var r=e.getSharedTansactionStorage(),o=r.getStorage();o[t]={dateCreated:Date.now(),transaction:n},r.setStorage(o)}function vo(e,t){var n=e.getSharedTansactionStorage().getStorage()[t];return n&&n.transaction&&on(n.transaction)?n.transaction:null}function yo(e,t){var n=e.getSharedTansactionStorage(),r=n.getStorage();delete r[t],n.setStorage(r)}var go=function(){function e(t){s(this,e),this.storageManager=t.storageManager,this.legacyWidgetSupport=!1!==t.legacyWidgetSupport,this.saveNonceCookie=!1!==t.saveNonceCookie,this.saveStateCookie=!1!==t.saveStateCookie,this.saveParamsCookie=!1!==t.saveParamsCookie,this.enableSharedStorage=!1!==t.enableSharedStorage,this.saveLastResponse=!1!==t.saveLastResponse,this.options=t}return V(e,[{key:"clear",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.storageManager.getTransactionStorage(),n=t.getStorage();if(t.clearStorage(),this.clearIdxResponse(),this.enableSharedStorage&&!1!==e.clearSharedStorage){var r=e.state||(null==n?void 0:n.state);r&&yo(this.storageManager,r)}this.legacyWidgetSupport&&(e.oauth&&this.clearLegacyOAuthParams(),e.pkce&&this.clearLegacyPKCE())}},{key:"save",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.storageManager.getTransactionStorage(),r=n.getStorage();if(on(r)&&!t.muteWarning&&qn("a saved auth transaction exists in storage. This may indicate another auth flow is already in progress."),n.setStorage(e),this.enableSharedStorage&&e.state&&po(this.storageManager,e.state,e),t.oauth&&(this.saveNonceCookie||this.saveStateCookie||this.saveParamsCookie)){var o=this.storageManager.getStorage({storageType:"cookie"});if(this.saveParamsCookie){var i=e.responseType,a=e.state,s=e.nonce,u=e.scopes,c=e.clientId,l=e.urls,f=e.ignoreSignature,h={responseType:i,state:a,nonce:s,scopes:u,clientId:c,urls:l,ignoreSignature:f};o.setItem(Q,JSON.stringify(h),null)}this.saveNonceCookie&&e.nonce&&o.setItem(Z,e.nonce,null),this.saveStateCookie&&e.state&&o.setItem(X,e.state,null)}}},{key:"exists",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t=this.load(e);return!!t}catch(e){return!1}}},{key:"load",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.enableSharedStorage&&t.state&&(ho(this.storageManager),on(e=vo(this.storageManager,t.state))))return e;var n=this.storageManager.getTransactionStorage();if(on(e=n.getStorage()))return e;if(!this.legacyWidgetSupport)return null;if(t.oauth)try{var r=this.loadLegacyOAuthParams();Object.assign(e,r)}finally{this.clearLegacyOAuthParams()}if(t.pkce)try{var o=this.loadLegacyPKCE();Object.assign(e,o)}finally{this.clearLegacyPKCE()}return on(e)?e:null}},{key:"clearLegacyPKCE",value:function(){this.storageManager.storageUtil.testStorageType("localStorage")&&this.storageManager.getLegacyPKCEStorage({storageType:"localStorage"}).clearStorage(),this.storageManager.storageUtil.testStorageType("sessionStorage")&&this.storageManager.getLegacyPKCEStorage({storageType:"sessionStorage"}).clearStorage()}},{key:"loadLegacyPKCE",value:function(){var e;if(this.storageManager.storageUtil.testStorageType("localStorage")&&(e=this.storageManager.getLegacyPKCEStorage({storageType:"localStorage"}).getStorage())&&e.codeVerifier)return e;if(this.storageManager.storageUtil.testStorageType("sessionStorage")&&(e=this.storageManager.getLegacyPKCEStorage({storageType:"sessionStorage"}).getStorage())&&e.codeVerifier)return e;throw new k("Could not load PKCE codeVerifier from storage. This may indicate the auth flow has already completed or multiple auth flows are executing concurrently.",void 0)}},{key:"clearLegacyOAuthParams",value:function(){this.storageManager.storageUtil.testStorageType("sessionStorage")&&this.storageManager.getLegacyOAuthParamsStorage({storageType:"sessionStorage"}).clearStorage(),this.storageManager.storageUtil.testStorageType("cookie")&&this.storageManager.getLegacyOAuthParamsStorage({storageType:"cookie"}).clearStorage()}},{key:"loadLegacyOAuthParams",value:function(){var e;if(this.storageManager.storageUtil.testStorageType("sessionStorage")&&(e=this.storageManager.getLegacyOAuthParamsStorage({storageType:"sessionStorage"}).getStorage()),en(e))return e;if(this.storageManager.storageUtil.testStorageType("cookie")&&(e=this.storageManager.getLegacyOAuthParamsStorage({storageType:"cookie"}).getStorage()),en(e))return e;throw new k("Unable to retrieve OAuth redirect params from storage")}},{key:"saveIdxResponse",value:function(e){var t=e.rawIdxResponse,n=e.requestDidSucceed;if(this.saveLastResponse){var r=this.storageManager.getIdxResponseStorage();r&&r.setStorage({rawIdxResponse:t,requestDidSucceed:n})}}},{key:"loadIdxResponse",value:function(){if(!this.saveLastResponse)return null;var e=this.storageManager.getIdxResponseStorage();if(!e)return null;var t=e.getStorage();return lo(t)?t:null}},{key:"clearIdxResponse",value:function(){if(this.saveLastResponse){var e=this.storageManager.getIdxResponseStorage();null==e||e.clearStorage()}}}]),e}();function mo(e){var t=(e=e||{}).scopes;if(t&&!Array.isArray(t))throw new k('scopes must be a array of strings. Required usage: new OktaAuth({scopes: ["openid", "email"]})');var n=e.issuer;if(!n)throw new k('No issuer passed to constructor. Required usage: new OktaAuth({issuer: "https://{yourOktaDomain}.com/oauth2/{authServerId}"})');if(!new RegExp("^http?s?://.+").test(n))throw new k('Issuer must be a valid URL. Required usage: new OktaAuth({issuer: "https://{yourOktaDomain}.com/oauth2/{authServerId}"})');if(-1!==n.indexOf("-admin."))throw new k('Issuer URL passed to constructor contains "-admin" in subdomain. Required usage: new OktaAuth({issuer: "https://{yourOktaDomain}.com})')}var bo=n(98),ko=n.n(bo);function wo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var To=function(e,t,r){var o=r.data,i=r.headers||{};"application/json"===(i["Content-Type"]||i["content-type"]||"")&&o&&"string"!=typeof o&&(o=JSON.stringify(o));var a=(n.g.fetch||ko())(t,{method:e,headers:r.headers,body:o,credentials:r.withCredentials?"include":"omit"});return a.finally||(a=Promise.resolve(a)),a.then((function(e){var t=!e.ok,n=e.status;return function(e){return e.headers.get("Content-Type")&&e.headers.get("Content-Type").toLowerCase().indexOf("application/json")>=0?e.json().catch((function(e){return{error:e,errorSummary:"Could not parse server response"}})):e.text()}(e).then((function(t){return function(e,t,n){var r,o="object"===l(t),i={},a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return wo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wo(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(n.headers.entries());try{for(a.s();!(r=a.n()).done;){var s=r.value;i[s[0]]=s[1]}}catch(e){a.e(e)}finally{a.f()}var u={responseText:o?JSON.stringify(t):t,status:e,headers:i};return o&&(u.responseType="json",u.responseJSON=t),u}(n,t,e)})).then((function(e){var n;if(t||(null===(n=e.responseJSON)||void 0===n?void 0:n.error))throw e;return e}))}))},So=n(321),xo=n.n(So),Oo="function"==typeof xo()?new(xo()):null,_o=function(){function e(t){s(this,e),this.nodeCache=t}return V(e,[{key:"set",value:function(e,t,n){if(Date.parse(n)){var r=(Date.parse(n)-Date.now())/1e3;this.nodeCache.set(e,t,r)}else this.nodeCache.set(e,t);return this.get(e)}},{key:"get",value:function(e){return this.nodeCache.get(e)}},{key:"delete",value:function(e){return this.nodeCache.del(e)}}]),e}(),Eo=new(function(){function e(t){s(this,e),this.nodeCache=t,this.storage=new _o(t)}return V(e,[{key:"testStorageType",value:function(e){var t=!1;return"memory"===e&&(t=!0),t}},{key:"getStorageByType",value:function(e){if("memory"!==e)throw new k("Unrecognized storage option: ".concat(e));return this.getStorage()}},{key:"findStorageType",value:function(){return"memory"}},{key:"getHttpCache",value:function(){return null}},{key:"getStorage",value:function(){var e=this;return{getItem:this.nodeCache.get,setItem:function(t,n){e.nodeCache.set(t,n,"2200-01-01T00:00:00.000Z")}}}}]),e}())(Oo),Ao={token:{storageTypes:["localStorage","sessionStorage","cookie"]},cache:{storageTypes:["localStorage","sessionStorage","cookie"]},transaction:{storageTypes:["sessionStorage","localStorage","cookie"]},"shared-transaction":{storageTypes:["localStorage"]},"original-uri":{storageTypes:["localStorage"]}},Ro={token:{storageTypes:["memory"]},cache:{storageTypes:["memory"]},transaction:{storageTypes:["memory"]}};function Po(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=e.cookies||{};return void 0===n.secure&&(n.secure=t),void 0===n.sameSite&&(n.sameSite=n.secure?"none":"lax"),n.secure&&!t&&(qn('The current page is not being served with the HTTPS protocol.\nFor security reasons, we strongly recommend using HTTPS.\nIf you cannot use HTTPS, set "cookies.secure" option to false.'),n.secure=!1),"none"!==n.sameSite||n.secure||(n.sameSite="lax"),n}function Co(){var e;e=mt()?Object.assign({},Gn,{inMemoryStore:{}}):Eo;var t=mt()?Ao:Ro,n=!!mt();return{devMode:!1,httpRequestClient:To,storageUtil:e,storageManager:t,transactionManager:{enableSharedStorage:n}}}function jo(e,t){return Object.assign({},e,D(t),{storageManager:Object.assign({},e.storageManager,t.storageManager),transactionManager:Object.assign({},e.transactionManager,t.transactionManager)})}var Io={interceptors:{request:new(function(){function e(){s(this,e),this.handlers=[]}return V(e,[{key:"use",value:function(e){this.handlers.push({before:e})}},{key:"clear",value:function(){this.handlers=[]}}]),e}())}},Mo=function(e,t){var n,r,o,i,a=t.method,s=void 0===a?"POST":a,u=t.headers,c=void 0===u?{}:u,l=t.credentials,f=void 0===l?"include":l,h=t.body;return n=void 0,r=void 0,o=void 0,i=z().mark((function t(){var n,r;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n={url:e,method:s,headers:Object.assign({},c),credentials:f,body:h},Io.interceptors&&Io.interceptors.request.handlers.forEach((function(e){e.before(n)})),r=n.url,delete n.url,t.abrupt("return",ko()(r,n));case 5:case"end":return t.stop()}}),t)})),new(o||(o=Promise))((function(e,t){function a(e){try{u(i.next(e))}catch(e){t(e)}}function s(e){try{u(i.throw(e))}catch(e){t(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(a,s)}u((i=i.apply(n,r||[])).next())}))};function Lo(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Uo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Uo(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Uo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Do=function(e){return!1!==e.mutable},No=function(e){var t,n,r={},o=[],i={};if(!e.value)return o.push(e),{defaultParamsForAction:r,neededParamsForAction:o,immutableParamsForAction:i};var a,s=Lo(e.value);try{for(s.s();!(a=s.n()).done;){var u=a.value;Do(u)?(o.push(u),null!==(t=u.value)&&void 0!==t&&t&&(r[u.name]=u.value)):i[u.name]=null!==(n=u.value)&&void 0!==n?n:""}}catch(e){s.e(e)}finally{s.f()}return{defaultParamsForAction:r,neededParamsForAction:o,immutableParamsForAction:i}},Fo=function(e){var t=e.actionDefinition,n=e.defaultParamsForAction,r=void 0===n?{}:n,o=e.immutableParamsForAction,i=void 0===o?{}:o,a=e.toPersist,s=t.href;return function(e){return n=this,o=void 0,u=void 0,c=z().mark((function n(){var o,u,c,l,f,h,d;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o={"content-type":"application/json",accept:t.accepts||"application/ion+json"},u=JSON.stringify(Object.assign(Object.assign(Object.assign({},r),e),i)),c=a&&!1===a.withCredentials?"omit":"include",n.next=5,Mo(s,{method:t.method,headers:o,body:u,credentials:c});case 5:return l=n.sent,n.next=8,l.json();case 8:if(f=n.sent,h=l.ok,d=ui(f,a,h),401===l.status&&'Oktadevicejwt realm="Okta Device"'===l.headers.get("WWW-Authenticate")&&(d.stepUp=!0),h){n.next=14;break}throw d;case 14:return n.abrupt("return",d);case 15:case"end":return n.stop()}}),n)})),new(u||(u=Promise))((function(e,t){function r(e){try{a(c.next(e))}catch(e){t(e)}}function i(e){try{a(c.throw(e))}catch(e){t(e)}}function a(t){var n;t.done?e(t.value):(n=t.value,n instanceof u?n:new u((function(e){e(n)}))).then(r,i)}a((c=c.apply(n,o||[])).next())}));var n,o,u,c}},Bo=function(e,t){var n=Fo,r=function(e){var t,n=[],r={},o={},i=Lo(e=Array.isArray(e)?e:[e]);try{for(i.s();!(t=i.n()).done;){var a=t.value,s=No(a),u=s.defaultParamsForAction,c=s.neededParamsForAction,l=s.immutableParamsForAction;n.push(c),r[a.name]=u,o[a.name]=l}}catch(e){i.e(e)}finally{i.f()}return{defaultParams:r,neededParams:n,immutableParams:o}}(e),o=r.defaultParams,i=r.neededParams,a=r.immutableParams,s=n({actionDefinition:e,defaultParamsForAction:o[e.name],immutableParamsForAction:a[e.name],toPersist:t});return s.neededParams=i,s};function Ko(e){return Ko="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ko(e)}function Ho(e){return Ho=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ho(e)}function qo(e,t){return qo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},qo(e,t)}function Vo(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function Wo(e,t,n){return Wo=Vo()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&qo(o,n.prototype),o},Wo.apply(null,arguments)}function zo(e){var t="function"==typeof Map?new Map:void 0;return zo=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return Wo(e,arguments,Ho(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),qo(r,e)},zo(e)}function Go(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Jo(e){return function(e){if(Array.isArray(e))return Yo(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||$o(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $o(e,t){if(e){if("string"==typeof e)return Yo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yo(e,t):void 0}}function Yo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Qo=Object.prototype.hasOwnProperty;function Xo(e,t){return(e=e.slice()).push(t),e}function Zo(e,t){return(t=t.slice()).unshift(e),t}var ei=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&qo(e,t)}(o,e);var t,n,r=(t=o,n=Vo(),function(){var e,r=Ho(t);if(n){var o=Ho(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Go(this,e)});function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=r.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)')).avoidNew=!0,t.value=e,t.name="NewError",t}return o}(zo(Error));function ti(e,t,n,r,o){if(!(this instanceof ti))try{return new ti(e,t,n,r,o)}catch(e){if(!e.avoidNew)throw e;return e.value}"string"==typeof e&&(o=r,r=n,n=t,t=e,e=null);var i=e&&"object"===Ko(e);if(e=e||{},this.json=e.json||n,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=!Qo.call(e,"wrap")||e.wrap,this.sandbox=e.sandbox||{},this.preventEval=e.preventEval||!1,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||r||null,this.otherTypeCallback=e.otherTypeCallback||o||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},!1!==e.autostart){var a={path:i?e.path:t};i?"json"in e&&(a.json=e.json):a.json=n;var s=this.evaluate(a);if(!s||"object"!==Ko(s))throw new ei(s);return s}}ti.prototype.evaluate=function(e,t,n,r){var o=this,i=this.parent,a=this.parentProperty,s=this.flatten,u=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,n=n||this.callback,this.currOtherTypeCallback=r||this.otherTypeCallback,t=t||this.json,(e=e||this.path)&&"object"===Ko(e)&&!Array.isArray(e)){if(!e.path&&""!==e.path)throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!Qo.call(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');t=e.json,s=Qo.call(e,"flatten")?e.flatten:s,this.currResultType=Qo.call(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=Qo.call(e,"sandbox")?e.sandbox:this.currSandbox,u=Qo.call(e,"wrap")?e.wrap:u,this.currPreventEval=Qo.call(e,"preventEval")?e.preventEval:this.currPreventEval,n=Qo.call(e,"callback")?e.callback:n,this.currOtherTypeCallback=Qo.call(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,i=Qo.call(e,"parent")?e.parent:i,a=Qo.call(e,"parentProperty")?e.parentProperty:a,e=e.path}if(i=i||null,a=a||null,Array.isArray(e)&&(e=ti.toPathString(e)),(e||""===e)&&t){var c=ti.toPathArray(e);"$"===c[0]&&c.length>1&&c.shift(),this._hasParentSelector=null;var l=this._trace(c,t,["$"],i,a,n).filter((function(e){return e&&!e.isParentSelector}));return l.length?u||1!==l.length||l[0].hasArrExpr?l.reduce((function(e,t){var n=o._getPreferredOutput(t);return s&&Array.isArray(n)?e=e.concat(n):e.push(n),e}),[]):this._getPreferredOutput(l[0]):u?[]:void 0}},ti.prototype._getPreferredOutput=function(e){var t=this.currResultType;switch(t){case"all":var n=Array.isArray(e.path)?e.path:ti.toPathArray(e.path);return e.pointer=ti.toPointer(n),e.path="string"==typeof e.path?e.path:ti.toPathString(e.path),e;case"value":case"parent":case"parentProperty":return e[t];case"path":return ti.toPathString(e[t]);case"pointer":return ti.toPointer(e.path);default:throw new TypeError("Unknown result type")}},ti.prototype._handleCallback=function(e,t,n){if(t){var r=this._getPreferredOutput(e);e.path="string"==typeof e.path?e.path:ti.toPathString(e.path),t(r,n,e)}},ti.prototype._trace=function(e,t,n,r,o,i,a,s){var u,c=this;if(!e.length)return u={path:n,value:t,parent:r,parentProperty:o,hasArrExpr:a},this._handleCallback(u,i,"value"),u;var l=e[0],f=e.slice(1),h=[];function d(e){Array.isArray(e)?e.forEach((function(e){h.push(e)})):h.push(e)}if(("string"!=typeof l||s)&&t&&Qo.call(t,l))d(this._trace(f,t[l],Xo(n,l),t,l,i,a));else if("*"===l)this._walk(l,f,t,n,r,o,i,(function(e,t,n,r,o,i,a,s){d(c._trace(Zo(e,n),r,o,i,a,s,!0,!0))}));else if(".."===l)d(this._trace(f,t,n,r,o,i,a)),this._walk(l,f,t,n,r,o,i,(function(e,t,n,r,o,i,a,s){"object"===Ko(r[e])&&d(c._trace(Zo(t,n),r[e],Xo(o,e),r,e,s,!0))}));else{if("^"===l)return this._hasParentSelector=!0,{path:n.slice(0,-1),expr:f,isParentSelector:!0};if("~"===l)return u={path:Xo(n,l),value:o,parent:r,parentProperty:null},this._handleCallback(u,i,"property"),u;if("$"===l)d(this._trace(f,t,n,null,null,i,a));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(l))d(this._slice(l,f,t,n,r,o,i));else if(0===l.indexOf("?(")){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");this._walk(l,f,t,n,r,o,i,(function(e,t,n,r,o,i,a,s){c._eval(t.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1"),r[e],e,o,i,a)&&d(c._trace(Zo(e,n),r,o,i,a,s,!0))}))}else if("("===l[0]){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");d(this._trace(Zo(this._eval(l,t,n[n.length-1],n.slice(0,-1),r,o),f),t,n,r,o,i,a))}else if("@"===l[0]){var p=!1,v=l.slice(1,-2);switch(v){case"scalar":t&&["object","function"].includes(Ko(t))||(p=!0);break;case"boolean":case"string":case"undefined":case"function":Ko(t)===v&&(p=!0);break;case"integer":!Number.isFinite(t)||t%1||(p=!0);break;case"number":Number.isFinite(t)&&(p=!0);break;case"nonFinite":"number"!=typeof t||Number.isFinite(t)||(p=!0);break;case"object":t&&Ko(t)===v&&(p=!0);break;case"array":Array.isArray(t)&&(p=!0);break;case"other":p=this.currOtherTypeCallback(t,n,r,o);break;case"null":null===t&&(p=!0);break;default:throw new TypeError("Unknown value type "+v)}if(p)return u={path:n,value:t,parent:r,parentProperty:o},this._handleCallback(u,i,"value"),u}else if("`"===l[0]&&t&&Qo.call(t,l.slice(1))){var y=l.slice(1);d(this._trace(f,t[y],Xo(n,y),t,y,i,a,!0))}else if(l.includes(",")){var g,m=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=$o(e))){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(l.split(","));try{for(m.s();!(g=m.n()).done;){var b=g.value;d(this._trace(Zo(b,f),t,n,r,o,i,!0))}}catch(e){m.e(e)}finally{m.f()}}else!s&&t&&Qo.call(t,l)&&d(this._trace(f,t[l],Xo(n,l),t,l,i,a,!0))}if(this._hasParentSelector)for(var k=0;k<h.length;k++){var w=h[k];if(w&&w.isParentSelector){var T=this._trace(w.expr,t,w.path,r,o,i,a);if(Array.isArray(T)){h[k]=T[0];for(var S=T.length,x=1;x<S;x++)k++,h.splice(k,0,T[x])}else h[k]=T}}return h},ti.prototype._walk=function(e,t,n,r,o,i,a,s){if(Array.isArray(n))for(var u=n.length,c=0;c<u;c++)s(c,e,t,n,r,o,i,a);else n&&"object"===Ko(n)&&Object.keys(n).forEach((function(u){s(u,e,t,n,r,o,i,a)}))},ti.prototype._slice=function(e,t,n,r,o,i,a){if(Array.isArray(n)){var s=n.length,u=e.split(":"),c=u[2]&&Number.parseInt(u[2])||1,l=u[0]&&Number.parseInt(u[0])||0,f=u[1]&&Number.parseInt(u[1])||s;l=l<0?Math.max(0,l+s):Math.min(s,l),f=f<0?Math.max(0,f+s):Math.min(s,f);for(var h=[],d=l;d<f;d+=c)this._trace(Zo(d,t),n,r,o,i,a,!0).forEach((function(e){h.push(e)}));return h}},ti.prototype._eval=function(e,t,n,r,o,i){e.includes("@parentProperty")&&(this.currSandbox._$_parentProperty=i,e=e.replace(/@parentProperty/g,"_$_parentProperty")),e.includes("@parent")&&(this.currSandbox._$_parent=o,e=e.replace(/@parent/g,"_$_parent")),e.includes("@property")&&(this.currSandbox._$_property=n,e=e.replace(/@property/g,"_$_property")),e.includes("@path")&&(this.currSandbox._$_path=ti.toPathString(r.concat([n])),e=e.replace(/@path/g,"_$_path")),e.includes("@root")&&(this.currSandbox._$_root=this.json,e=e.replace(/@root/g,"_$_root")),/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/.test(e)&&(this.currSandbox._$_v=t,e=e.replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1"));try{return this.vm.runInNewContext(e,this.currSandbox)}catch(t){throw console.log(t),new Error("jsonPath: "+t.message+": "+e)}},ti.cache={},ti.toPathString=function(e){for(var t=e,n=t.length,r="$",o=1;o<n;o++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[o])||(r+=/^[\*0-9]+$/.test(t[o])?"["+t[o]+"]":"['"+t[o]+"']");return r},ti.toPointer=function(e){for(var t=e,n=t.length,r="",o=1;o<n;o++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[o])||(r+="/"+t[o].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return r},ti.toPathArray=function(e){var t=ti.cache;if(t[e])return t[e].concat();var n=[],r=e.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,(function(e,t){return"[#"+(n.push(t)-1)+"]"})).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,(function(e,t){return"['"+t.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"})).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,(function(e,t){return";"+t.split("").join(";")+";"})).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,"").split(";").map((function(e){var t=e.match(/#([0-9]+)/);return t&&t[1]?n[t[1]]:e}));return t[e]=r,t[e].concat()},ti.prototype.vm={runInNewContext:function(e,t){var n=Object.keys(t),r=[];!function(e,n,r){for(var o=e.length,i=0;i<o;i++)a=e[i],"function"==typeof t[a]&&n.push(e.splice(i--,1)[0]);var a}(n,r);var o=n.map((function(e,n){return t[e]})),i=r.reduce((function(e,n){var r=t[n].toString();return/function/.test(r)||(r="function "+r),"var "+n+"="+r+";"+e}),"");/(["'])use strict\1/.test(e=i+e)||n.includes("arguments")||(e="var arguments = undefined;"+e);var a=(e=e.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"")).lastIndexOf(";"),s=a>-1?e.slice(0,a+1)+" return "+e.slice(a+1):" return "+e;return Wo(Function,Jo(n).concat([s])).apply(void 0,Jo(o))}};var ni=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},ri=Object.fromEntries(["remediation","context"].map((function(e){return[e,!0]}))),oi=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},r={};return Object.keys(e).filter((function(e){return!ri[e]})).forEach((function(o){if("object"===l(e[o])&&e[o])if(e[o].rel)n[e[o].name]=Bo(e[o],t);else{var i=e[o],a=i.value,s=i.type,u=ni(i,["value","type"]);r[o]=Object.assign({type:s},u),"object"===s?(r[o].value={},Object.entries(a).forEach((function(e){var i=tt(e,2),a=i[0],s=i[1];s.rel?n["".concat(o,"-").concat(a.name||a)]=Bo(s,t):r[o].value[a]=s}))):r[o].value=a}else r[o]=e[o]})),{context:r,actions:n}},ii=function e(t,n){Object.keys(n).forEach((function(r){if("relatesTo"===r){var o=Array.isArray(n[r])?n[r][0]:n[r];if("string"==typeof o){var i=ti({path:o,json:t})[0];if(i)return void(n[r]=i)}}Array.isArray(n[r])&&n[r].forEach((function(n){return e(t,n)}))}))},ai=function(e,t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.fromEntries(e.map((function(e){return[e.name,Bo(e,t)]})))}([e],t),r=n[e.name];return Object.assign(Object.assign({},e),{action:r})},si=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function ui(e,t,n){var r,o,i,a=e,s=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(null===(t=e.remediation)||void 0===t?void 0:t.value)||[];r.forEach((function(t){return ii(e,t)}));var o=r.map((function(e){return ai(e,n)})),i=oi(e,n),a=i.context,s=i.actions;return{remediations:o,context:a,actions:s}}(e,t),u=s.remediations,c=s.context,l=s.actions;return{proceed:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return si(this,void 0,void 0,z().mark((function n(){var r;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=u.find((function(t){return t.name===e}))){n.next=3;break}return n.abrupt("return",Promise.reject("Unknown remediation choice: [".concat(e,"]")));case 3:return n.abrupt("return",r.action(t));case 4:case"end":return n.stop()}}),n)})))},neededToProceed:rr(u),actions:l,context:c,rawIdxState:a,interactionCode:null===(i=null===(o=null===(r=a.successWithInteractionCode)||void 0===r?void 0:r.value)||void 0===o?void 0:o.find((function(e){return"interaction_code"===e.name})))||void 0===i?void 0:i.value,toPersist:t,requestDidSucceed:n}}var ci={makeIdxState:ui},li=function(e){switch(e){case"1.0.0":return ci;case void 0:case null:throw new Error("Api version is required");default:throw new Error("Unknown api version: ".concat(e,". Use an exact semver version."))}};function fi(e){if(!e)throw new Error("version is required");if((null!=e?e:"").replace(/[^0-9a-zA-Z._-]/,"")!==e||!e)throw new Error("invalid version supplied - version is required and uses semver syntax");li(e)}var hi=function(e){return e.json().then((function(e){return Promise.reject(e)}))},di="1.0.0",pi={introspect:function(e){var t,n,r,o,i=e.withCredentials,a=e.domain,s=e.interactionHandle,u=e.stateHandle,c=e.version;return t=this,n=void 0,r=void 0,o=z().mark((function e(){var t,n,r,o,l,f,h;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return fi(c),t="".concat(a,"/idp/idx/introspect"),n=u?{stateToken:u}:{interactionHandle:s},r={"content-type":"application/ion+json; okta-version=".concat(c),accept:"application/ion+json; okta-version=".concat(c)},o=!1===i?"omit":"include",e.next=7,Mo(t,{credentials:o,headers:r,body:JSON.stringify(n)});case 7:return l=e.sent,f=l.ok,e.next=11,l.json();case 11:if(h=e.sent,f){e.next=14;break}throw h;case 14:return e.abrupt("return",h);case 15:case"end":return e.stop()}}),e)})),new(r||(r=Promise))((function(e,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,s)}u((o=o.apply(t,n||[])).next())}))},interact:function(e){var t,n,r,o,i=e.withCredentials,a=e.clientId,s=e.baseUrl,u=e.scopes,c=void 0===u?["openid","email"]:u,l=e.redirectUri,f=e.codeChallenge,h=e.codeChallengeMethod,d=e.state,p=e.activationToken,v=e.recoveryToken,y=e.clientSecret;return t=this,n=void 0,r=void 0,o=z().mark((function e(){var t,n,r,o,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="".concat(s,"/v1/interact"),n={client_id:a,scope:c.join(" "),redirect_uri:l,code_challenge:f,code_challenge_method:h,state:d},p&&(n.activation_token=p),v&&(n.recovery_token=v),y&&(n.client_secret=y),r=Object.entries(n).map((function(e){var t=tt(e,2),n=t[0],r=t[1];return"".concat(n,"=").concat(encodeURIComponent(r))})).join("&"),o={"content-type":"application/x-www-form-urlencoded"},u=!1===i?"omit":"include",e.abrupt("return",Mo(t,{credentials:u,headers:o,body:r}).then((function(e){return e.ok?e.json():hi(e)})).then((function(e){return e.interaction_handle})));case 9:case"end":return e.stop()}}),e)})),new(r||(r=Promise))((function(e,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,s)}u((o=o.apply(t,n||[])).next())}))},makeIdxState:li(di).makeIdxState,client:Io,LATEST_SUPPORTED_IDX_API_VERSION:di},vi=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function yi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return vi(this,void 0,void 0,z().mark((function n(){var r,o,i,a,s,u,c,l,f,h,d,p;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.token.prepareTokenParams(t);case 2:return r=n.sent,o=Bt(e,r),i=Object.assign(Object.assign({},e.options),t),a=i.flow,s=void 0===a?"default":a,u=i.withCredentials,c=void 0===u||u,l=i.activationToken,f=void 0===l?void 0:l,h=i.recoveryToken,d=void 0===h?void 0:h,p=Object.assign(Object.assign({},o),{flow:s,withCredentials:c,activationToken:f,recoveryToken:d}),n.abrupt("return",p);case 7:case"end":return n.stop()}}),n)})))}function gi(e,t){var n=mi(e,t);return!!(null==n?void 0:n.interactionHandle)}function mi(e,t){var n;t=D(t),t=Object.assign(Object.assign({},e.options),t);try{n=e.transactionManager.load(t)}catch(e){}if(n)return Ti(n,t)?n:void qn("Saved transaction meta does not match the current configuration. This may indicate that two apps are sharing a storage key.")}function bi(e,t){return vi(this,void 0,void 0,z().mark((function n(){var r;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(t=D(t),t=Object.assign(Object.assign({},e.options),t),!(r=mi(e,t))){n.next=5;break}return n.abrupt("return",r);case 5:return n.abrupt("return",yi(e,t));case 6:case"end":return n.stop()}}),n)})))}function ki(e,t){e.transactionManager.save(t,{muteWarning:!0})}function wi(e){e.transactionManager.clear()}function Ti(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=["issuer","clientId","redirectUri","state","codeChallenge","codeChallengeMethod","activationToken","recoveryToken"];if(!1===xi(e,t,n))return!1;var r=t.flow;return!1!==Si(e,r)}function Si(e,t){return!(t&&"default"!==t&&"proceed"!==t)||t===e.flow}function xi(e,t,n){return!n.some((function(n){var r=t[n];if(r&&r!==e[n])return!0}))}var Oi=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function _i(e){return{meta:e,interactionHandle:e.interactionHandle,state:e.state}}function Ei(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Oi(this,void 0,void 0,z().mark((function n(){var r,o,i,a,s,u,c,l,f,h,d,p,v,y,g;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(t=D(t),!(null==(r=mi(e,t))?void 0:r.interactionHandle)){n.next=4;break}return n.abrupt("return",_i(r));case 4:return n.next=6,yi(e,Object.assign(Object.assign({},r),t));case 6:return r=n.sent,o=pt(e),a=(i=r).clientId,s=i.redirectUri,u=i.state,c=i.scopes,l=i.withCredentials,f=i.codeChallenge,h=i.codeChallengeMethod,d=i.activationToken,p=i.recoveryToken,v=t.clientSecret||e.options.clientSecret,n.next=12,pi.interact({withCredentials:l,clientId:a,baseUrl:o,scopes:c,state:u,redirectUri:s,codeChallenge:f,codeChallengeMethod:h,activationToken:d,recoveryToken:p,clientSecret:v});case 12:return y=n.sent,g=Object.assign(Object.assign({},r),{interactionHandle:y,withCredentials:l,state:u,scopes:c,recoveryToken:p,activationToken:d}),ki(e,g),n.abrupt("return",_i(g));case 16:case"end":return n.stop()}}),n)})))}var Ai=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function Ri(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ai(this,void 0,void 0,z().mark((function n(){var r,o,i,a,s,u;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if((i=e.transactionManager.loadIdxResponse())&&(r=i.rawIdxResponse,o=i.requestDidSucceed),r){n.next=20;break}return a=t.version||pe,s=vt(e),n.prev=5,n.next=8,pi.introspect(Object.assign(Object.assign({domain:s},t),{version:a}));case 8:r=n.sent,o=!0,n.next=20;break;case 12:if(n.prev=12,n.t0=n.catch(5),!lo(n.t0)){n.next=19;break}r=n.t0,o=!1,n.next=20;break;case 19:throw n.t0;case 20:return u=t.withCredentials,n.abrupt("return",pi.makeIdxState(r,{withCredentials:u},o));case 22:case"end":return n.stop()}}),n,null,[[5,12]])})))}function Pi(e){return e.charAt(0).toUpperCase()+e.substring(1)}function Ci(e){return e.value.find((function(e){return"authenticator"===e.name}))}function ji(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ii(e){var t;if(an(e))t=e;else{if("string"!=typeof e)throw new Error("Invalid format for authenticator");t={key:e}}return t}function Mi(e,t){return!!(e&&t&&(e.id&&t.id?e.id===t.id:e.key&&t.key&&e.key===t.key))}function Li(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ui=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};s(this,e),this.values=Object.assign({},n),this.options=Object.assign({},r),this.formatAuthenticators(),this.remediation=t}return V(e,[{key:"formatAuthenticators",value:function(){if(this.values.authenticators=this.values.authenticators||[],this.values.authenticators=this.values.authenticators.map((function(e){return Ii(e)})),this.values.authenticator){var e=Ii(this.values.authenticator);this.values.authenticators.some((function(t){return Mi(e,t)}))||this.values.authenticators.push(e)}this.values.authenticatorsData=this.values.authenticators.reduce((function(e,t){return"object"===l(t)&&Object.keys(t).length>1&&e.push(t),e}),this.values.authenticatorsData||[])}},{key:"getName",value:function(){return this.remediation.name}},{key:"canRemediate",value:function(){var e,t,n=this;return!(e=this.remediation,null===(t=e.value)||void 0===t?void 0:t.reduce((function(e,t){return t.required&&e.push(t.name),e}),[])).find((function(e){return!n.hasData(e)}))}},{key:"getData",value:function(e){var t,n,r=this;if(!e){var o=(t=this.remediation,null===(n=t.value)||void 0===n?void 0:n.map((function(e){return e.name}))).reduce((function(e,t){return e[t]=r.getData(t),e}),{});return o}if("function"==typeof this["map".concat(Pi(e))]){var i=this["map".concat(Pi(e))](this.remediation.value.find((function(t){return t.name===e})));if(i)return i}if(this.map&&this.map[e])for(var a=this.map[e],s=0;s<a.length;s++){var u=this.values[a[s]];if(u)return u}return this.values[e]}},{key:"hasData",value:function(e){return!!this.getData(e)}},{key:"getNextStep",value:function(e){var t=this.getName(),n=this.getInputs(),r=this.getAuthenticator(),o=null==r?void 0:r.type;return Object.assign(Object.assign({name:t,inputs:n},o&&{type:o}),r&&{authenticator:r})}},{key:"getInputs",value:function(){var e=this,t=[];return(this.remediation.value||[]).forEach((function(n){var r,o=n.name,i=n.type;if(!1!==n.visible){if("function"==typeof e["getInput".concat(Pi(o))])r=e["getInput".concat(Pi(o))](n);else if("object"!==i){var a,s=(e.map?e.map[o]:null)||[];a=1===s.length?s[0]:s.find((function(t){return Object.keys(e.values).includes(t)})),a&&(r=Object.assign(Object.assign({},n),{name:a}))}r||(r=n),Array.isArray(r)?r.forEach((function(e){return t.push(e)})):t.push(r)}})),t}},{key:"getValuesAfterProceed",value:function(){var e,t=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Li(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Li(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(this.getInputs());try{for(t.s();!(e=t.n()).done;){var n=e.value;delete this.values[n.name]}}catch(e){t.e(e)}finally{t.f()}return this.values}},{key:"getAuthenticator",value:function(){var e,t,n=null===(e=this.remediation.relatesTo)||void 0===e?void 0:e.value;if(n){var r=Ci(this.remediation);if(!r)return n;var o=r.form.value.find((function(e){return"id"===e.name})).value,i=null===(t=r.form.value.find((function(e){return"enrollmentId"===e.name})))||void 0===t?void 0:t.value;return Object.assign(Object.assign({},n),{id:o,enrollmentId:i})}}}],[{key:"getMessages",value:function(e){var t,n;if(e.value)return null===(n=null===(t=e.value[0])||void 0===t?void 0:t.form)||void 0===n?void 0:n.value.reduce((function(e,t){return t.messages&&(e=[].concat(rr(e),rr(t.messages.value))),e}),[])}}]),e}();function Di(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ni(e,t,n){return Ni="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=d(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}},Ni(e,t,n||e)}var Fi=function e(t){s(this,e),this.meta=t};var Bi=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canVerify",value:function(e){return!!(e.credentials||e.verificationCode||e.otp)}},{key:"mapCredentials",value:function(e){var t=e.credentials,n=e.verificationCode,r=e.otp;if(t||n||r)return t||{passcode:n||r}}},{key:"getInputs",value:function(e){var t;return Object.assign(Object.assign({},null===(t=e.form)||void 0===t?void 0:t.value[0]),{name:"verificationCode",type:"string",required:e.required})}}]),o}(Fi);var Ki=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"mapCredentials",value:function(e){var t=e.verificationCode;if(t)return{totp:t}}}]),o}(Bi);var Hi=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canVerify",value:function(e){return!(!e.credentials&&!e.password)}},{key:"mapCredentials",value:function(e){var t=e.credentials,n=e.password;if(t||n)return t||{passcode:n}}},{key:"getInputs",value:function(e){var t;return Object.assign(Object.assign({},null===(t=e.form)||void 0===t?void 0:t.value[0]),{name:"password",type:"string",required:e.required})}}]),o}(Fi);var qi=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canVerify",value:function(e){var t=e.credentials;if(t&&t.questionKey&&t.answer)return!0;var n=e.questionKey,r=e.question,o=e.answer;return!(!n||!o)||!(!r||!o)}},{key:"mapCredentials",value:function(e){var t=e.questionKey,n=e.question,r=e.answer;if(t||n||r)return{questionKey:n?"custom":t,question:n,answer:r}}},{key:"getInputs",value:function(){return[{name:"questionKey",type:"string",required:!0},{name:"question",type:"string",label:"Create a security question"},{name:"answer",type:"string",label:"Answer",required:!0}]}}]),o}(Fi);var Vi=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canVerify",value:function(e){return!!e.answer}},{key:"mapCredentials",value:function(e){var t=e.answer;if(t)return{questionKey:this.meta.contextualData.enrolledQuestion.questionKey,answer:t}}},{key:"getInputs",value:function(){return[{name:"answer",type:"string",label:"Answer",required:!0}]}}]),o}(Fi);var Wi=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canVerify",value:function(e){var t=e.clientData,n=e.attestation;return!(!t||!n)}},{key:"mapCredentials",value:function(e){var t=e.clientData,n=e.attestation;if(t||n)return{clientData:t,attestation:n}}},{key:"getInputs",value:function(){return[{name:"clientData",type:"string",required:!0,visible:!1,label:"Client Data"},{name:"attestation",type:"string",required:!0,visible:!1,label:"Attestation"}]}}]),o}(Fi);var zi=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canVerify",value:function(e){var t=e.clientData,n=e.authenticatorData,r=e.signatureData;return!!(t&&n&&r)}},{key:"mapCredentials",value:function(e){var t=e.authenticatorData,n=e.clientData,r=e.signatureData;if(t||n||r)return{authenticatorData:t,clientData:n,signatureData:r}}},{key:"getInputs",value:function(){return[{name:"authenticatorData",type:"string",label:"Authenticator Data",required:!0,visible:!1},{name:"clientData",type:"string",label:"Client Data",required:!0,visible:!1},{name:"signatureData",type:"string",label:"Signature Data",required:!0,visible:!1}]}}]),o}(Fi);function Gi(e){var t,n,r=e.relatesTo,o=(null==r?void 0:r.value)||{};switch(o.key){case Ht.OKTA_PASSWORD:return new Hi(o);case Ht.SECURITY_QUESTION:return(null===(t=o.contextualData)||void 0===t?void 0:t.enrolledQuestion)?new Vi(o):new qi(o);case Ht.OKTA_VERIFY:return new Ki(o);case Ht.WEBAUTHN:return(null===(n=o.contextualData)||void 0===n?void 0:n.challengeData)?new zi(o):new Wi(o);default:return new Bi(o)}}var Ji=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(this,o),(t=r.call(this,e,n)).authenticator=Gi(e),t}return V(o,[{key:"getNextStep",value:function(e){var t,n=Ni(d(o.prototype),"getNextStep",this).call(this,e),r=null===(t=null==e?void 0:e.authenticatorEnrollments)||void 0===t?void 0:t.value;return Object.assign(Object.assign({},n),{authenticatorEnrollments:r})}},{key:"canRemediate",value:function(){return this.authenticator.canVerify(this.values)}},{key:"mapCredentials",value:function(){return this.authenticator.mapCredentials(this.values)}},{key:"getInputCredentials",value:function(e){return this.authenticator.getInputs(e)}},{key:"getValuesAfterProceed",value:function(){var e=this;return this.values=Ni(d(o.prototype),"getValuesAfterProceed",this).call(this),Object.keys(this.values).filter((function(e){return"credentials"!==e})).reduce((function(t,n){return Object.assign(Object.assign({},t),Di({},n,e.values[n]))}),{})}}]),o}(Ui);var $i=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return o}(Ji);$i.remediationName="enroll-authenticator";var Yi=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canRemediate",value:function(){return!!this.values.startPolling||"enroll-poll"===this.options.step}},{key:"getNextStep",value:function(e){var t=Ni(d(o.prototype),"getNextStep",this).call(this,e),n=this.getAuthenticator();return!n&&(null==e?void 0:e.currentAuthenticator)&&(n=e.currentAuthenticator.value),Object.assign(Object.assign({},t),{authenticator:n,poll:{required:!0,refresh:this.remediation.refresh}})}},{key:"getValuesAfterProceed",value:function(){var e=this;return Object.keys(this.values).filter((function(e){return"startPolling"!==e})).reduce((function(t,n){return Object.assign(Object.assign({},t),Di({},n,e.values[n]))}),{})}}]),o}(Ui);Yi.remediationName="enroll-poll";var Qi=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canRemediate",value:function(){return Boolean(this.values.channel)}},{key:"getNextStep",value:function(e){var t=Ni(d(o.prototype),"getNextStep",this).call(this),n=this.getChannels(),r=e.currentAuthenticator.value;return Object.assign(Object.assign(Object.assign({},t),n&&{options:n}),{authenticator:r})}},{key:"getChannels",value:function(){var e;return null===(e=Ci(this.remediation).value.form.value.find((function(e){return"channel"===e.name})))||void 0===e?void 0:e.options}},{key:"getData",value:function(){return{authenticator:{id:this.remediation.value[0].value.form.value[0].value,channel:this.values.channel},stateHandle:this.values.stateHandle}}},{key:"getValuesAfterProceed",value:function(){var e=this;return Object.keys(this.values).filter((function(e){return"channel"!==e})).reduce((function(t,n){return Object.assign(Object.assign({},t),Di({},n,e.values[n]))}),{})}}]),o}(Ui);Qi.remediationName="select-enrollment-channel";var Xi=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"getInputEmail",value:function(){return[{name:"email",type:"string",required:!0,label:"Email"}]}},{key:"getInputPhoneNumber",value:function(){return[{name:"phoneNumber",type:"string",required:!0,label:"Phone Number"}]}},{key:"canRemediate",value:function(){return Boolean(this.values.email||this.values.phoneNumber)}},{key:"getNextStep",value:function(e){var t=Ni(d(o.prototype),"getNextStep",this).call(this),n=e.currentAuthenticator.value;return Object.assign(Object.assign({},t),{authenticator:n})}},{key:"getData",value:function(){return{stateHandle:this.values.stateHandle,email:this.values.email,phoneNumber:this.values.phoneNumber}}},{key:"getValuesAfterProceed",value:function(){var e=this;return Object.keys(this.values).filter((function(e){return!["email","phoneNumber"].includes(e)})).reduce((function(t,n){return Object.assign(Object.assign({},t),Di({},n,e.values[n]))}),{})}}]),o}(Ui);Xi.remediationName="enrollment-channel-data";var Zi=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return o}(Ji);Zi.remediationName="challenge-authenticator";var ea=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canRemediate",value:function(){return!!this.values.startPolling||"challenge-poll"===this.options.step}}]),o}(Yi);ea.remediationName="challenge-poll";var ta=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return o}(Ji);ta.remediationName="reset-authenticator";var na=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canRemediate",value:function(){var e=this.getData().userProfile;return!!e&&this.remediation.value.find((function(e){return"userProfile"===e.name})).form.value.reduce((function(t,n){return n.required&&(t=t&&!!e[n.name]),t}),!0)}},{key:"mapUserProfile",value:function(e){var t=this,n=e.form.value.map((function(e){return e.name})).reduce((function(e,n){return t.values[n]?Object.assign(Object.assign({},e),Di({},n,t.values[n])):e}),{});if(0!==Object.keys(n).length)return n}},{key:"getInputUserProfile",value:function(e){return rr(e.form.value)}},{key:"getErrorMessages",value:function(e){return e.value[0].form.value.reduce((function(e,t){return t.messages&&e.push(t.messages.value[0].message),e}),[])}}]),o}(Ui);na.remediationName="enroll-profile";var ra=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){var e;return s(this,o),(e=r.apply(this,arguments)).map={identifier:["username"]},e}return V(o,[{key:"canRemediate",value:function(){return!!this.getData().identifier}},{key:"mapCredentials",value:function(){var e=this.values,t=e.credentials,n=e.password;if(t||n)return t||{passcode:n}}},{key:"getInputCredentials",value:function(e){return Object.assign(Object.assign({},e.form.value[0]),{name:"password",required:e.required})}}]),o}(Ui);ra.remediationName="identify";var oa=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"mapCredentials",value:function(){var e=this.values.newPassword;if(e)return{passcode:e}}},{key:"getInputCredentials",value:function(e){var t="password"===this.getAuthenticator().type?"newPassword":"verificationCode";return Object.assign(Object.assign({},e.form.value[0]),{name:t})}}]),o}(Ui);oa.remediationName="reenroll-authenticator";var ia=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canRemediate",value:function(){return!1}},{key:"getNextStep",value:function(){var e=this.remediation;return{name:e.name,type:e.type,idp:e.idp,href:e.href}}}]),o}(Ui);function aa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}ia.remediationName="redirect-idp";var sa=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"findMatchedOption",value:function(e,t){var n,r,o=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return aa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?aa(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(e);try{var i=function(){var e=r.value;if(n=t.find((function(t){return t.relatesTo.key===e.key})))return"break"};for(o.s();!(r=o.n()).done&&"break"!==i(););}catch(e){o.e(e)}finally{o.f()}return n}},{key:"canRemediate",value:function(){var e=this.values,t=e.authenticators,n=e.authenticator,r=Ci(this.remediation).options;return!!(t&&t.length&&(an(n)&&n.id||this.findMatchedOption(t,r)))}},{key:"getNextStep",value:function(){var e=Ni(d(o.prototype),"getNextStep",this).call(this),t=Ci(this.remediation).options.map((function(e){return{label:e.label,value:e.relatesTo.key}}));return Object.assign(Object.assign({},e),{options:t})}},{key:"mapAuthenticator",value:function(e){var t=this.values,n=t.authenticators,r=t.authenticator;if(an(r)&&r.id)return this.selectedAuthenticator=r,r;var o=function(e,t){var n,r,o=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ji(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ji(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(e);try{var i=function(){var e=r.value;if(n=t.find((function(t){return t.relatesTo.key===e.key})))return"break"};for(o.s();!(r=o.n()).done&&"break"!==i(););}catch(e){o.e(e)}finally{o.f()}return n}(n,e.options);return this.selectedAuthenticator=o.relatesTo,this.selectedOption=o,{id:null==o?void 0:o.value.form.value.find((function(e){return"id"===e.name})).value}}},{key:"getInputAuthenticator",value:function(){return{name:"authenticator",key:"string"}}},{key:"getValuesAfterProceed",value:function(){var e=this;this.values=Ni(d(o.prototype),"getValuesAfterProceed",this).call(this);var t=this.values.authenticators.filter((function(t){return!0!==Mi(t,e.selectedAuthenticator)}));return Object.assign(Object.assign({},this.values),{authenticators:t})}}]),o}(Ui);var ua=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};s(this,o);var u="recoverPassword"===(t=r.call(this,e,i,a)).options.flow,c=null===(n=Ci(e).options)||void 0===n?void 0:n.some((function(e){var t=e.relatesTo;return(null==t?void 0:t.key)===Ht.OKTA_PASSWORD}));return c&&(u||t.values.password)&&(t.values.authenticators=[].concat(rr(t.values.authenticators||[]),[{key:Ht.OKTA_PASSWORD}])),t}return o}(sa);ua.remediationName="select-authenticator-authenticate";var ca=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return o}(sa);ca.remediationName="select-authenticator-enroll";var la=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){var e;return s(this,o),(e=r.apply(this,arguments)).map={identifier:["username"]},e}return V(o,[{key:"canRemediate",value:function(){return!!this.getData("identifier")&&Ni(d(o.prototype),"canRemediate",this).call(this)}},{key:"mapAuthenticator",value:function(e){var t,n,r,i=Ni(d(o.prototype),"mapAuthenticator",this).call(this,e),a=null===(t=this.selectedOption)||void 0===t?void 0:t.value.form.value.find((function(e){return"methodType"===e.name})),s=this.values.methodType||(null==a?void 0:a.value)||(null===(r=null===(n=null==a?void 0:a.options)||void 0===n?void 0:n[0])||void 0===r?void 0:r.value);return s?Object.assign(Object.assign({},i),{methodType:s}):i}},{key:"getInputUsername",value:function(){return{name:"username",key:"string"}}}]),o}(sa);la.remediationName="select-authenticator-unlock-account";var fa=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canRemediate",value:function(){return!0}}]),o}(Ui);fa.remediationName="select-enroll-profile";var ha=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(this,o),(t=r.call(this,e,n)).authenticator=t.getAuthenticator(),t.formatAuthenticatorData(),t}return V(o,[{key:"formatAuthenticatorData",value:function(){var e=this;if(this.getAuthenticatorData())this.values.authenticatorsData=this.values.authenticatorsData.map((function(t){return Mi(e.authenticator,t)?e.mapAuthenticatorDataFromValues(t):t}));else{var t=this.mapAuthenticatorDataFromValues();t&&this.values.authenticatorsData.push(t)}}},{key:"getAuthenticatorData",value:function(){var e=this;return this.values.authenticatorsData.find((function(t){return Mi(e.authenticator,t)}))}},{key:"canRemediate",value:function(){var e=this;return this.values.authenticatorsData.some((function(t){return Mi(e.authenticator,t)}))}},{key:"getNextStep",value:function(){var e=Ni(d(o.prototype),"getNextStep",this).call(this),t=this.getMethodTypes();return Object.assign(Object.assign({},e),t&&{options:t})}},{key:"mapAuthenticatorDataFromValues",value:function(e){var t=this.values,n=t.methodType,r=t.authenticator;!n&&an(r)&&(n=null==r?void 0:r.methodType);var o=this.authenticator,i=o.id,a=o.enrollmentId,s=Object.assign(Object.assign({id:i,enrollmentId:a},e&&e),n&&{methodType:n});return s.methodType?s:null}},{key:"getAuthenticatorFromRemediation",value:function(){return this.remediation.value.find((function(e){return"authenticator"===e.name}))}},{key:"getMethodTypes",value:function(){var e;return null===(e=this.getAuthenticatorFromRemediation().form.value.find((function(e){return"methodType"===e.name})))||void 0===e?void 0:e.options}},{key:"getValuesAfterProceed",value:function(){var e=this;this.values=Ni(d(o.prototype),"getValuesAfterProceed",this).call(this);var t=this.values.authenticatorsData.filter((function(t){return!0!==Mi(e.authenticator,t)}));return Object.assign(Object.assign({},this.values),{authenticatorsData:t})}}]),o}(Ui);var da=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(this,o),(t=r.call(this,e,n)).shouldProceedWithEmailAuthenticator=1===t.authenticator.methods.length&&"email"===t.authenticator.methods[0].type,t}return V(o,[{key:"canRemediate",value:function(){return!!this.shouldProceedWithEmailAuthenticator||Ni(d(o.prototype),"canRemediate",this).call(this)}},{key:"mapAuthenticator",value:function(){var e;return this.shouldProceedWithEmailAuthenticator?null===(e=this.getAuthenticatorFromRemediation().form)||void 0===e?void 0:e.value.reduce((function(e,t){if(t.value)e[t.name]=t.value;else{if(!t.options)throw new k("Unsupported authenticator data type: ".concat(t));e[t.name]=t.options[0].value}return e}),{}):this.getAuthenticatorData()}},{key:"getInputAuthenticator",value:function(){var e=this.getAuthenticatorFromRemediation(),t=e.form.value.find((function(e){return"methodType"===e.name}));return t&&t.options?{name:"methodType",type:"string",required:!0}:rr(e.form.value)}},{key:"getValuesAfterProceed",value:function(){var e=this;return this.values=Ni(d(o.prototype),"getValuesAfterProceed",this).call(this),Object.keys(this.values).filter((function(e){return"authenticator"!==e})).reduce((function(t,n){return Object.assign(Object.assign({},t),Di({},n,e.values[n]))}),{})}}]),o}(ha);da.remediationName="authenticator-verification-data";var pa=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"mapAuthenticator",value:function(){var e=this.getAuthenticatorData();return{id:Ci(this.remediation).form.value.find((function(e){return"id"===e.name})).value,methodType:e.methodType,phoneNumber:e.phoneNumber}}},{key:"getInputAuthenticator",value:function(){return[{name:"methodType",type:"string",required:!0},{name:"phoneNumber",type:"string",required:!0,label:"Phone Number"}]}},{key:"mapAuthenticatorDataFromValues",value:function(e){e=Ni(d(o.prototype),"mapAuthenticatorDataFromValues",this).call(this,e);var t=this.values.phoneNumber;if(e||t)return Object.assign(Object.assign({},e&&e),t&&{phoneNumber:t})}}]),o}(ha);pa.remediationName="authenticator-enrollment-data";var va=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canRemediate",value:function(){return!!this.values.skip||"skip"===this.options.step}}]),o}(Ui);function ya(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ga(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ga(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function ga(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ma(e){var t=e.neededToProceed,n=e.interactionCode;return!t.length&&!n}function ba(e){if(e&&Array.isArray(e))return e.reduce((function(e,t){if(t.messages&&(e=[].concat(rr(e),rr(t.messages.value))),t.form){var n=ba(t.form.value)||[];e=[].concat(rr(e),rr(n))}if(t.options){var r=[];t.options.forEach((function(e){e.value&&"string"!=typeof e.value&&(r=[].concat(rr(r),[e.value]))}));var o=ba(r)||[];e=[].concat(rr(e),rr(o))}return e}),[])}function ka(e){var t,n=[],r=e.rawIdxState,o=e.neededToProceed,i=null===(t=r.messages)||void 0===t?void 0:t.value.map((function(e){return e}));i&&(n=[].concat(rr(n),rr(i)));var a,s=ya(o);try{for(s.s();!(a=s.n()).done;){var u=ba(a.value.value);u&&(n=[].concat(rr(n),rr(u)))}}catch(e){s.e(e)}finally{s.f()}var c={};return n=n.reduce((function(e,t){var n,r=null===(n=t.i18n)||void 0===n?void 0:n.key;return r&&c[r]?e:(c[r]=t,e=[].concat(rr(e),[t]))}),[]),n}function wa(e){var t=[],n=e.actions,r=e.neededToProceed;return n["currentAuthenticator-recover"]&&t.push(qt.PASSWORD_RECOVERY),r.some((function(e){return"select-enroll-profile"===e.name}))&&t.push(qt.REGISTRATION),r.some((function(e){return"redirect-idp"===e.name}))&&t.push(qt.SOCIAL_IDP),r.some((function(e){return"unlock-account"===e.name}))&&t.push(qt.ACCOUNT_UNLOCK),t}function Ta(e){var t,n=[],r=Object.values(a).reduce((function(e,t){return t.remediationName&&(e[t.remediationName]=t),e}),{}),o=ya(e.neededToProceed);try{for(o.s();!(t=o.n()).done;){var i=t.value,s=r[i.name];if(s){var u=new s(i);n.push(u.getNextStep(e.context))}}}catch(e){o.e(e)}finally{o.f()}return n}function Sa(e,t){return e.neededToProceed[0].value.reduce((function(e,n){var r=n.name;return e[r]=t[r],e}),{})}function xa(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Oa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Oa(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Oa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}va.remediationName="skip";function _a(e,t,n){var r,o=n.remediators;if(!n.step){var i,a=[],s=xa(e);try{for(s.s();!(i=s.n()).done;){var u=i.value;if(Object.keys(o).includes(u.name)){if((r=new(0,o[u.name])(u,t,n)).canRemediate())return r;a.push(r)}}}catch(e){s.e(e)}finally{s.f()}return a[0]}var c=e.find((function(e){return e.name===n.step}));if(c){var l=c?o[c.name]:void 0;return l?new l(c,t,n):void 0}qn('step "'.concat(n.step,'" did not match any remediations'))}function Ea(e,t){var n=e.getNextStep(t.context),r=function(e){return e.neededToProceed.some((function(e){return"skip"===e.name}))}(t),o=function(e){return Object.keys(e.actions).some((function(e){return e.includes("resend")}))}(t);return Object.assign(Object.assign(Object.assign({},n),r&&{canSkip:r}),o&&{canResend:o})}function Aa(e,t){var n=fo(e)?e:null;if(!n)throw e;n.requestDidSucceed=!1;var r=ma(n),o=ka(n);if(r)return{idxResponse:n,terminal:r,messages:o};var i=t&&Ea(t,n);return Object.assign({idxResponse:n,messages:o},i&&{nextStep:i})}function Ra(e,t){return Object.keys(t.actions).find((function(t){return!!e.resend&&t.includes("-resend")}))}function Pa(e){return e.resend=void 0,e}function Ca(e,t,n){return r=this,o=void 0,i=void 0,a=z().mark((function r(){var o,i,a,s,u,c,f,h,d,p,v,y,g,m,b,w,T,S,x;return z().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(i=(o=e).neededToProceed,a=o.interactionCode,s=n.remediators,u=n.flow,!a){r.next=4;break}return r.abrupt("return",{idxResponse:e});case 4:if(c=ma(e),f=ka(e),!c){r.next=8;break}return r.abrupt("return",{idxResponse:e,terminal:c,messages:f});case 8:if(h=Ra(t,e),d=n.actions||[],!(p=[].concat(rr(d),rr(h&&[h]||[])))){r.next=31;break}v=xa(p),r.prev=13,g=z().mark((function r(){var o,a,u;return z().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(o=y.value,a=Pa(t),u=Object.assign(Object.assign({},n),{actions:d.filter((function(e){return e!==o}))}),"function"!=typeof e.actions[o]){r.next=17;break}return r.prev=4,r.next=7,e.actions[o]();case 7:(e=r.sent).requestDidSucceed=!0,r.next=14;break;case 11:return r.prev=11,r.t0=r.catch(4),r.abrupt("return",{v:Aa(r.t0,s)});case 14:if("cancel"!==o){r.next=16;break}return r.abrupt("return",{v:{idxResponse:e,canceled:!0}});case 16:return r.abrupt("return",{v:Ca(e,a,u)});case 17:if(!i.find((function(e){return e.name===o}))){r.next=30;break}return r.prev=19,r.next=22,e.proceed(o,{});case 22:(e=r.sent).requestDidSucceed=!0,r.next=29;break;case 26:return r.prev=26,r.t1=r.catch(19),r.abrupt("return",{v:Aa(r.t1,s)});case 29:return r.abrupt("return",{v:Ca(e,t,u)});case 30:case"end":return r.stop()}}),r,null,[[4,11],[19,26]])})),v.s();case 16:if((y=v.n()).done){r.next=23;break}return r.delegateYield(g(),"t0",18);case 18:if("object"!==l(m=r.t0)){r.next=21;break}return r.abrupt("return",m.v);case 21:r.next=16;break;case 23:r.next=28;break;case 25:r.prev=25,r.t1=r.catch(13),v.e(r.t1);case 28:return r.prev=28,v.f(),r.finish(28);case 31:if(b=_a(i,t,n)){r.next=49;break}if(!n.step){r.next=46;break}return t=Sa(e,t),r.prev=35,r.next=38,e.proceed(n.step,t);case 38:return(e=r.sent).requestDidSucceed=!0,r.abrupt("return",{idxResponse:e});case 43:return r.prev=43,r.t2=r.catch(35),r.abrupt("return",Aa(r.t2));case 46:if("default"!==u){r.next=48;break}return r.abrupt("return",{idxResponse:e});case 48:throw new k("\n No remediation can match current flow, check policy settings in your org.\n Remediations: [".concat(i.reduce((function(e,t){return e?e+" ,"+t.name:t.name}),""),"]\n "));case 49:if(!f.length){r.next=52;break}return w=Ea(b,e),r.abrupt("return",{idxResponse:e,nextStep:w,messages:f});case 52:if(b.canRemediate()){r.next=55;break}return T=Ea(b,e),r.abrupt("return",{idxResponse:e,nextStep:T});case 55:return S=b.getName(),x=b.getData(),r.prev=57,r.next=60,e.proceed(S,x);case 60:return(e=r.sent).requestDidSucceed=!0,t=b.getValuesAfterProceed(),delete n.step,r.abrupt("return",Ca(e,t,n));case 67:return r.prev=67,r.t3=r.catch(57),r.abrupt("return",Aa(r.t3,b));case 70:case"end":return r.stop()}}),r,null,[[13,25,28,31],[35,43],[57,67]])})),new(i||(i=Promise))((function(e,t){function n(e){try{u(a.next(e))}catch(e){t(e)}}function s(e){try{u(a.throw(e))}catch(e){t(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(n,s)}u((a=a.apply(r,o||[])).next())}));var r,o,i,a}var ja={identify:ra,"select-authenticator-authenticate":ua,"select-authenticator-enroll":ca,"authenticator-enrollment-data":pa,"authenticator-verification-data":da,"enroll-authenticator":$i,"challenge-authenticator":Zi,"challenge-poll":ea,"reenroll-authenticator":oa,"enroll-poll":Yi,"redirect-idp":ia,skip:va},Ia={identify:ra,"identify-recovery":ra,"select-authenticator-authenticate":ua,"select-authenticator-enroll":ca,"challenge-authenticator":Zi,"authenticator-verification-data":da,"authenticator-enrollment-data":pa,"reset-authenticator":ta,"reenroll-authenticator":oa,"enroll-poll":Yi},Ma={"select-enroll-profile":fa,"enroll-profile":na,"authenticator-enrollment-data":pa,"select-authenticator-enroll":ca,"enroll-poll":Yi,"select-enrollment-channel":Qi,"enrollment-channel-data":Xi,"enroll-authenticator":$i,skip:va},La={identify:ra,"select-authenticator-unlock-account":la,"select-authenticator-authenticate":ua,"challenge-authenticator":Zi,"challenge-poll":ea,"authenticator-verification-data":da};function Ua(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",o=!0;switch(r){case"register":case"signup":case"enrollProfile":t=Ma,o=!1;break;case"recoverPassword":case"resetPassword":t=Ia,n=["currentAuthenticator-recover","currentAuthenticatorEnrollment-recover"],o=!1;break;case"unlockAccount":t=La,o=!1,n=["unlock-account"];break;default:t=ja}return{flow:r,remediators:t,actions:n,withCredentials:o}}var Da=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function Na(e){var t=Object.assign({},e);return["flow","remediators","actions","withCredentials","step"].forEach((function(e){delete t[e]})),t}function Fa(e,t){var n=t.options,r=n.flow,o=n.withCredentials,i=n.remediators,a=n.actions,s=Kt.PENDING;if(r=r||e.idx.getFlow()||"default"){e.idx.setFlow(r);var u=Ua(e,r);o=void 0!==o?o:u.withCredentials,i=i||u.remediators,a=a||u.actions}return Object.assign(Object.assign({},t),{options:Object.assign(Object.assign({},n),{flow:r,withCredentials:o,remediators:i,actions:a}),status:s})}function Ba(e,t){return Da(this,void 0,void 0,z().mark((function n(){var r,o,i,a,s,u,c,l,f,h,d,p;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=t.options,o=r.stateHandle,i=r.withCredentials,a=r.version,s=r.state,u=r.scopes,c=r.recoveryToken,l=r.activationToken,!o){n.next=8;break}return n.next=5,Ri(e,{withCredentials:i,version:a,stateHandle:o});case 5:f=n.sent,n.next=20;break;case 8:if(h=mi(e,{state:s,recoveryToken:c,activationToken:l}),d=null==h?void 0:h.interactionHandle){n.next=17;break}return e.transactionManager.clear(),n.next=14,Ei(e,{withCredentials:i,state:s,scopes:u,activationToken:l,recoveryToken:c});case 14:p=n.sent,d=p.interactionHandle,h=p.meta;case 17:return n.next=19,Ri(e,{withCredentials:i,version:a,interactionHandle:d});case 19:f=n.sent;case 20:return n.abrupt("return",Object.assign(Object.assign({},t),{idxResponse:f,meta:h}));case 21:case"end":return n.stop()}}),n)})))}function Ka(e){return Da(this,void 0,void 0,z().mark((function t(){var n,r,o,i,a,s,u,c,l,f,h,d;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.idxResponse,r=e.options,o=e.values,i=r.autoRemediate,a=r.remediators,s=r.actions,u=r.flow,c=r.step,!1!==i&&(a||s||c)){t.next=5;break}return t.abrupt("return",e);case 5:return o=Object.assign(Object.assign({},o),{stateHandle:n.rawIdxState.stateHandle}),t.next=8,Ca(n,o,{remediators:a,actions:s,flow:u,step:c});case 8:return l=t.sent,f=l.idxResponse,h=l.nextStep,d=l.canceled,n=f,t.abrupt("return",Object.assign(Object.assign({},e),{idxResponse:n,nextStep:h,canceled:d}));case 14:case"end":return t.stop()}}),t)})))}function Ha(e,t){return Da(this,void 0,void 0,z().mark((function n(){var r,o,i,a,s,u,c,l,f,h;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=t.meta,o=t.idxResponse,i=o.interactionCode,a=r.clientId,s=r.codeVerifier,u=r.ignoreSignature,c=r.redirectUri,l=r.urls,f=r.scopes,n.next=5,e.token.exchangeCodeForTokens({interactionCode:i,clientId:a,codeVerifier:s,ignoreSignature:u,redirectUri:c,scopes:f},l);case 5:return h=n.sent,n.abrupt("return",h.tokens);case 7:case"end":return n.stop()}}),n)})))}function qa(e,t){return Da(this,void 0,void 0,z().mark((function n(){var r,o,i,a,s,u,c,l,f,h,d,p,v;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=t.options,o=t.idxResponse,i=t.canceled,a=t.status,s=r.exchangeCodeForTokens,u=!1,c=!0,o&&(h=wa(o),d=Ta(o),p=ka(o),v=ma(o)),!v){n.next=11;break}a=Kt.TERMINAL,u=!0,c=!1,n.next=28;break;case 11:if(!i){n.next=16;break}a=Kt.CANCELED,u=!0,n.next=28;break;case 16:if(!(null==o?void 0:o.interactionCode)){n.next=28;break}if(l=o.interactionCode,!1!==s){n.next=23;break}a=Kt.SUCCESS,u=!1,n.next=28;break;case 23:return n.next=25,Ha(e,t);case 25:f=n.sent,a=Kt.SUCCESS,u=!0;case 28:return n.abrupt("return",Object.assign(Object.assign({},t),{status:a,interactionCode:l,tokens:f,shouldClearTransaction:u,clearSharedStorage:c,enabledFeatures:h,availableSteps:d,messages:p,terminal:v}));case 29:case"end":return n.stop()}}),n)})))}function Va(e,t){var n=t.error,r=t.status;t.shouldClearTransaction;if(!fo(e))throw e;return n=e,r=Kt.FAILURE,!0,Object.assign(Object.assign({},t),{error:n,status:r,shouldClearTransaction:true})}function Wa(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Da(this,void 0,void 0,z().mark((function n(){var r,o,i,a,s,u,c,l,f,h,d,p,v,y,g,m,b,k,w,T,S,x;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r={options:t,values:Na(t)},r=Fa(e,r),n.prev=2,n.next=5,Ba(e,r);case 5:return r=n.sent,n.next=8,Ka(r);case 8:r=n.sent,n.next=14;break;case 11:n.prev=11,n.t0=n.catch(2),r=Va(n.t0,r);case 14:return n.next=16,qa(e,r);case 16:return r=n.sent,i=(o=r).idxResponse,a=o.meta,s=o.shouldClearTransaction,u=o.clearSharedStorage,c=o.status,l=o.enabledFeatures,f=o.availableSteps,h=o.tokens,d=o.nextStep,p=o.messages,v=o.error,y=o.interactionCode,s?e.transactionManager.clear({clearSharedStorage:u}):(ki(e,Object.assign({},a)),i&&(g=i.rawIdxState,m=i.requestDidSucceed,e.transactionManager.saveIdxResponse({rawIdxResponse:g,requestDidSucceed:m}))),k=(b=i||{}).actions,w=b.context,T=b.neededToProceed,S=b.proceed,x=b.rawIdxState,n.abrupt("return",Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({status:c},a&&{meta:a}),l&&{enabledFeatures:l}),f&&{availableSteps:f}),h&&{tokens:h}),d&&{nextStep:d}),p&&p.length&&{messages:p}),v&&{error:v}),{interactionCode:y,actions:k,context:w,neededToProceed:T,proceed:S,rawIdxState:x}));case 21:case"end":return n.stop()}}),n,null,[[2,11]])})))}var za=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function Ga(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return za(this,void 0,void 0,z().mark((function n(){return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t.password&&!t.authenticator&&(t.authenticator=Ht.OKTA_PASSWORD),n.abrupt("return",Wa(e,Object.assign(Object.assign({},t),{flow:"authenticate"})));case 2:case"end":return n.stop()}}),n)})))}function Ja(e,t){return n=this,r=void 0,o=void 0,i=z().mark((function n(){var r,o;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=e.transactionManager.load(),o=Ua(e,r.flow),n.abrupt("return",Wa(e,Object.assign(Object.assign(Object.assign({},t),o),{actions:["cancel"]})));case 3:case"end":return n.stop()}}),n)})),new(o||(o=Promise))((function(e,t){function a(e){try{u(i.next(e))}catch(e){t(e)}}function s(e){try{u(i.throw(e))}catch(e){t(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(a,s)}u((i=i.apply(n,r||[])).next())}));var n,r,o,i}var $a=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(e,t){var n;return s(this,o),(n=r.call(this,"Enter the OTP code in the originating client: ".concat(t))).name="EmailVerifyCallbackError",n.state=e,n.otp=t,n}return o}(g);function Ya(e){return"EmailVerifyCallbackError"===e.name}function Qa(e){return/(otp=)/i.test(e)&&/(state=)/i.test(e)}function Xa(e){return Qt(e)}function Za(e,t){return n=this,r=void 0,o=void 0,i=z().mark((function n(){var r,o,i;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!Qa(t)){n.next=9;break}if(r=Xa(t),o=r.state,i=r.otp,!e.idx.canProceed({state:o})){n.next=8;break}return n.next=5,e.idx.proceed({state:o,otp:i});case 5:return n.abrupt("return",n.sent);case 8:throw new $a(o,i);case 9:case"end":return n.stop()}}),n)})),new(o||(o=Promise))((function(e,t){function a(e){try{u(i.next(e))}catch(e){t(e)}}function s(e){try{u(i.throw(e))}catch(e){t(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(a,s)}u((i=i.apply(n,r||[])).next())}));var n,r,o,i}var es=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function ts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=mi(e,t);return!(!n&&!t.stateHandle)}function ns(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return es(this,void 0,void 0,z().mark((function n(){var r,o,i;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(ts(e,t)){n.next=2;break}throw new k("Unable to proceed: saved transaction could not be loaded");case 2:return r=t.flow,o=t.state,r||(i=mi(e,{state:o}),r=null==i?void 0:i.flow),n.abrupt("return",Wa(e,Object.assign(Object.assign({},t),{flow:r})));case 5:case"end":return n.stop()}}),n)})))}var rs=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function os(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return rs(this,void 0,void 0,z().mark((function r(){var o,i,a;return z().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,ns(e,{startPolling:!0});case 2:if(o=r.sent,i=mi(e),(null==(a=null===(t=null==i?void 0:i.remediations)||void 0===t?void 0:t.find((function(e){return e.includes("poll")})))?void 0:a.length)||qn("No polling remediations available at the current IDX flow stage"),!Number.isInteger(n.refresh)){r.next=8;break}return r.abrupt("return",new Promise((function(t,r){setTimeout((function(){var n,i;return rs(this,void 0,void 0,z().mark((function a(){var s;return z().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:try{s=null===(i=null===(n=o.nextStep)||void 0===n?void 0:n.poll)||void 0===i?void 0:i.refresh,t(s?os(e,{refresh:s}):o)}catch(e){r(e)}case 1:case"end":return a.stop()}}),a)})))}),n.refresh)})));case 8:return r.abrupt("return",o);case 9:case"end":return r.stop()}}),r)})))}var is=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function as(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return is(this,void 0,void 0,z().mark((function n(){return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e.transactionManager.clear(),n.abrupt("return",Wa(e,Object.assign({exchangeCodeForTokens:!1},t)));case 2:case"end":return n.stop()}}),n)})))}var ss=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function us(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ss(this,void 0,void 0,z().mark((function n(){var r,o,i;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(gi(e)){n.next=12;break}return n.next=3,as(e,Object.assign(Object.assign({},t),{flow:"register",autoRemediate:!1}));case 3:if(r=n.sent,o=r.enabledFeatures,i=r.availableSteps,t.activationToken||!o||o.includes(qt.REGISTRATION)){n.next=9;break}throw new k("Registration is not supported based on your current org configuration.");case 9:if(!t.activationToken||!(null==i?void 0:i.some((function(e){return"identify"===e.name})))){n.next=12;break}throw new k("activationToken is not supported based on your current org configuration.");case 12:return n.abrupt("return",Wa(e,Object.assign(Object.assign({},t),{flow:"register"})));case 13:case"end":return n.stop()}}),n)})))}var cs=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function ls(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return cs(this,void 0,void 0,z().mark((function n(){var r;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=Ua(e,"recoverPassword"),n.abrupt("return",Wa(e,Object.assign(Object.assign({},t),r)));case 2:case"end":return n.stop()}}),n)})))}function fs(e,t){return n=this,r=void 0,o=void 0,i=z().mark((function n(){var r,o,i,a,s,u,c,l,f,h;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=e.transactionManager.load()){n.next=3;break}throw new k("No transaction data was found in storage");case 3:if(o=r.codeVerifier,i=r.state,a=new URL(t),s=a.searchParams,u=s.get("state"),c=s.get("interaction_code"),!(l=s.get("error"))){n.next=10;break}throw new w(l,s.get("error_description"));case 10:if(u===i){n.next=12;break}throw new k("State in redirect uri does not match with transaction state");case 12:if(c){n.next=14;break}throw new k("Unable to parse interaction_code from the url");case 14:return n.next=16,e.token.exchangeCodeForTokens({interactionCode:c,codeVerifier:o});case 16:f=n.sent,h=f.tokens,e.tokenManager.setTokens(h);case 19:case"end":return n.stop()}}),n)})),new(o||(o=Promise))((function(e,t){function a(e){try{u(i.next(e))}catch(e){t(e)}}function s(e){try{u(i.throw(e))}catch(e){t(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(a,s)}u((i=i.apply(n,r||[])).next())}));var n,r,o,i}var hs=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function ds(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return hs(this,void 0,void 0,z().mark((function n(){var r,o;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(t.flow="unlockAccount",gi(e)){n.next=8;break}return n.next=4,as(e,Object.assign(Object.assign({},t),{autoRemediate:!1}));case 4:if(r=n.sent,!(o=r.enabledFeatures)||o.includes(qt.ACCOUNT_UNLOCK)){n.next=8;break}throw new k("Self Service Account Unlock is not supported based on your current org configuration.");case 8:return n.abrupt("return",Wa(e,Object.assign({},t)));case 9:case"end":return n.stop()}}),n)})))}var ps=function(){function e(){s(this,e),this.environments=["okta-auth-js/".concat("6.3.0")]}return V(e,[{key:"addEnvironment",value:function(e){this.environments.push(e)}},{key:"getHttpHeader",value:function(){return this.maybeAddNodeEnvironment(),{"X-Okta-User-Agent-Extended":this.environments.join(" ")}}},{key:"getVersion",value:function(){return"6.3.0"}},{key:"maybeAddNodeEnvironment",value:function(){if(!mt()&&process&&process.versions){var e=process.versions.node;this.environments.push("nodejs/".concat(e))}}}]),e}(),vs=n(279),ys=n.n(vs),gs=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},ms=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},bs=function(){function e(t){var n=this;s(this,e);var r=this.options=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return mo(e),D({issuer:Oe((e=jo(Co(),e)).issuer),tokenUrl:Oe(e.tokenUrl),authorizeUrl:Oe(e.authorizeUrl),userinfoUrl:Oe(e.userinfoUrl),revokeUrl:Oe(e.revokeUrl),logoutUrl:Oe(e.logoutUrl),clientId:e.clientId,redirectUri:e.redirectUri,state:e.state,scopes:e.scopes,postLogoutRedirectUri:e.postLogoutRedirectUri,responseMode:e.responseMode,responseType:e.responseType,pkce:!1!==e.pkce,useInteractionCodeFlow:e.useInteractionCodeFlow,httpRequestClient:e.httpRequestClient,transformErrorXHR:e.transformErrorXHR,transformAuthState:e.transformAuthState,restoreOriginalUri:e.restoreOriginalUri,storageUtil:e.storageUtil,headers:e.headers,devMode:!!e.devMode,storageManager:e.storageManager,transactionManager:e.transactionManager,cookies:mt()?Po(e,_t()):e.cookies,flow:e.flow,codeChallenge:e.codeChallenge,codeChallengeMethod:e.codeChallengeMethod,recoveryToken:e.recoveryToken,activationToken:e.activationToken,ignoreSignature:!!e.ignoreSignature,clientSecret:e.clientSecret})}(t);this.storageManager=new co(r.storageManager,r.cookies,r.storageUtil),this.transactionManager=new go(Object.assign({storageManager:this.storageManager},r.transactionManager)),this._oktaUserAgent=new ps,this.tx={status:Ne.bind(null,this),resume:Fe.bind(null,this),exists:Object.assign(He.bind(null,this),{_get:function(e){return r.storageUtil.storage.get(e)}}),introspect:Be.bind(null,this)},this.pkce={DEFAULT_CODE_CHALLENGE_METHOD:We.DEFAULT_CODE_CHALLENGE_METHOD,generateVerifier:We.generateVerifier,computeChallenge:We.computeChallenge},Object.assign(this.options.storageUtil,{getPKCEStorage:this.storageManager.getLegacyPKCEStorage.bind(this.storageManager),getHttpCache:this.storageManager.getHttpCache.bind(this.storageManager)}),this._pending={handleLogin:!1},mt()&&(this.options=Object.assign(this.options,{redirectUri:Te(t.redirectUri,window.location.origin)})),t.maxClockSkew||0===t.maxClockSkew?this.options.maxClockSkew=t.maxClockSkew:this.options.maxClockSkew=$,this.options.ignoreLifetime=!!t.ignoreLifetime,this.session={close:Je.bind(null,this),exists:ze.bind(null,this),get:Ge.bind(null,this),refresh:$e.bind(null,this),setCookieAndRedirect:Ye.bind(null,this)},this._tokenQueue=new Zr;var o=function(e){return Zr.prototype.push.bind(n._tokenQueue,e,null)},i=o(An.bind(null,this)),a=Object.assign(i,{_setLocation:function(e){window.location=e}}),u=o(jn.bind(null,this)),c=Object.assign(u,{_getHistory:function(){return window.history},_getLocation:function(){return window.location},_getDocument:function(){return window.document}});this.token={prepareTokenParams:Jt.bind(null,this),exchangeCodeForTokens:pn.bind(null,this),getWithoutPrompt:bn.bind(null,this),getWithPopup:_n.bind(null,this),getWithRedirect:a,parseFromUrl:c,decode:hn,revoke:dn.bind(null,this),renew:Sn.bind(null,this),renewTokensWithRefresh:kn.bind(null,this),renewTokens:xn.bind(null,this),getUserInfo:On.bind(null,this),verify:vn.bind(null,this),isLoginRedirect:Nt.bind(null,this)};var l=["decode","isLoginRedirect","getWithRedirect","parseFromUrl"];Object.keys(this.token).forEach((function(e){if(!(l.indexOf(e)>=0)){var t=n.token[e];n.token[e]=Zr.prototype.push.bind(n._tokenQueue,t,null)}}));var f,h,d=as.bind(null,this);this.idx={interact:Ei.bind(null,this),introspect:Ri.bind(null,this),authenticate:Ga.bind(null,this),register:us.bind(null,this),start:d,startTransaction:d,poll:os.bind(null,this),proceed:ns.bind(null,this),cancel:Ja.bind(null,this),recoverPassword:ls.bind(null,this),handleInteractionCodeRedirect:fs.bind(null,this),isInteractionRequired:Ft.bind(null,this),isInteractionRequiredError:Rt,handleEmailVerifyCallback:Za.bind(null,this),isEmailVerifyCallback:Qa,parseEmailVerifyCallback:Xa,isEmailVerifyCallbackError:Ya,getSavedTransactionMeta:mi.bind(null,this),createTransactionMeta:yi.bind(null,this),getTransactionMeta:bi.bind(null,this),saveTransactionMeta:ki.bind(null,this),clearTransactionMeta:wi.bind(null,this),isTransactionMetaValid:Ti,setFlow:function(e){n.options.flow=e},getFlow:function(){return n.options.flow},canProceed:ts.bind(null,this),unlockAccount:ds.bind(null,this)},h=this,f=function(e){var t=h._oktaUserAgent.getHttpHeader(),n=Object.assign(Object.assign({},t),h.options.headers);Object.keys(n).forEach((function(t){(h.options.clientSecret||"X-Device-Token"!==t)&&(e.headers[t]=n[t])}))},pi.client.interceptors.request.use(f),this.http={setRequestHeader:ve.bind(null,this)},this.fingerprint=eo.bind(null,this),this.emitter=new(ys()),this.tokenManager=new nr(this,t.tokenManager),this.authStateManager=new ao(this),this.serviceManager=new Qr(this,t.services)}return V(e,[{key:"start",value:function(){this.tokenManager.start(),this.token.isLoginRedirect()||this.authStateManager.updateAuthState(),this.serviceManager.start()}},{key:"stop",value:function(){this.tokenManager.stop(),this.serviceManager.stop()}},{key:"setHeaders",value:function(e){this.options.headers=Object.assign({},this.options.headers,e)}},{key:"signIn",value:function(e){return gs(this,void 0,void 0,z().mark((function t(){return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.signInWithCredentials(e));case 1:case"end":return t.stop()}}),t,this)})))}},{key:"signInWithCredentials",value:function(e){return gs(this,void 0,void 0,z().mark((function t(){var n,r=this;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=N(e||{}),n=function(t){return delete e.sendFingerprint,qe(r,"/api/v1/authn",e,t)},e.sendFingerprint){t.next=4;break}return t.abrupt("return",n());case 4:return t.abrupt("return",this.fingerprint().then((function(e){return n({headers:{"X-Device-Fingerprint":e}})})));case 5:case"end":return t.stop()}}),t,this)})))}},{key:"signInWithRedirect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return gs(this,void 0,void 0,z().mark((function t(){var n,r,o;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.originalUri,r=ms(e,["originalUri"]),!this._pending.handleLogin){t.next=3;break}return t.abrupt("return");case 3:return this._pending.handleLogin=!0,t.prev=4,n&&this.setOriginalUri(n),o=Object.assign({scopes:this.options.scopes||["openid","email","profile"]},r),t.next=9,this.token.getWithRedirect(o);case 9:return t.prev=9,this._pending.handleLogin=!1,t.finish(9);case 12:case"end":return t.stop()}}),t,this,[[4,,9,12]])})))}},{key:"closeSession",value:function(){var e=this;return this.session.close().then((function(){return gs(e,void 0,void 0,z().mark((function e(){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.tokenManager.clear();case 1:case"end":return e.stop()}}),e,this)})))})).catch((function(e){if("AuthApiError"===e.name&&"E0000007"===e.errorCode)return null;throw e}))}},{key:"revokeAccessToken",value:function(e){return gs(this,void 0,void 0,z().mark((function t(){var n;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=6;break}return t.next=3,this.tokenManager.getTokens();case 3:e=t.sent.accessToken,n=this.tokenManager.getStorageKeyByType("accessToken"),this.tokenManager.remove(n);case 6:if(e){t.next=8;break}return t.abrupt("return",Promise.resolve(null));case 8:return t.abrupt("return",this.token.revoke(e));case 9:case"end":return t.stop()}}),t,this)})))}},{key:"revokeRefreshToken",value:function(e){return gs(this,void 0,void 0,z().mark((function t(){var n;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=6;break}return t.next=3,this.tokenManager.getTokens();case 3:e=t.sent.refreshToken,n=this.tokenManager.getStorageKeyByType("refreshToken"),this.tokenManager.remove(n);case 6:if(e){t.next=8;break}return t.abrupt("return",Promise.resolve(null));case 8:return t.abrupt("return",this.token.revoke(e));case 9:case"end":return t.stop()}}),t,this)})))}},{key:"getSignOutRedirectUrl",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.idToken,n=e.postLogoutRedirectUri,r=e.state;if(t||(t=this.tokenManager.getTokensSync().idToken),!t)return"";n||(n=this.options.postLogoutRedirectUri);var o=yt(this).logoutUrl,i=t.idToken,a=o+"?id_token_hint="+encodeURIComponent(i);return n&&(a+="&post_logout_redirect_uri="+encodeURIComponent(n)),r&&(a+="&state="+encodeURIComponent(r)),a}},{key:"signOut",value:function(e){return gs(this,void 0,void 0,z().mark((function t(){var n,r,o,i,a,s,u,c;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=Object.assign({},e),n=window.location.origin,r=window.location.href,o=e.postLogoutRedirectUri||this.options.postLogoutRedirectUri||n,i=e.accessToken,a=e.refreshToken,s=!1!==e.revokeAccessToken,(u=!1!==e.revokeRefreshToken)&&void 0===a&&(a=this.tokenManager.getTokensSync().refreshToken),s&&void 0===i&&(i=this.tokenManager.getTokensSync().accessToken),e.idToken||(e.idToken=this.tokenManager.getTokensSync().idToken),!u||!a){t.next=14;break}return t.next=14,this.revokeRefreshToken(a);case 14:if(!s||!i){t.next=17;break}return t.next=17,this.revokeAccessToken(i);case 17:if(c=this.getSignOutRedirectUrl(Object.assign(Object.assign({},e),{postLogoutRedirectUri:o}))){t.next=22;break}return t.abrupt("return",this.closeSession().then((function(){o===r?window.location.reload():window.location.assign(o)})));case 22:e.clearTokensBeforeRedirect?this.tokenManager.clear():this.tokenManager.addPendingRemoveFlags(),window.location.assign(c);case 24:case"end":return t.stop()}}),t,this)})))}},{key:"webfinger",value:function(e){return Ee(this,"/.well-known/webfinger"+xe(e),{headers:{Accept:"application/jrd+json"}})}},{key:"isAuthenticated",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return gs(this,void 0,void 0,z().mark((function t(){var n,r,o,i,a,s,u,c,l;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.tokenManager.getOptions(),r=n.autoRenew,o=n.autoRemove,i=e.onExpiredToken?"renew"===e.onExpiredToken:r,a=e.onExpiredToken?"remove"===e.onExpiredToken:o,s=this.tokenManager.getTokensSync(),!(u=s.accessToken)||!this.tokenManager.hasExpired(u)){t.next=18;break}if(u=void 0,!i){t.next=17;break}return t.prev=7,t.next=10,this.tokenManager.renew("accessToken");case 10:u=t.sent,t.next=15;break;case 13:t.prev=13,t.t0=t.catch(7);case 15:t.next=18;break;case 17:a&&this.tokenManager.remove("accessToken");case 18:if(c=this.tokenManager.getTokensSync(),!(l=c.idToken)||!this.tokenManager.hasExpired(l)){t.next=33;break}if(l=void 0,!i){t.next=32;break}return t.prev=22,t.next=25,this.tokenManager.renew("idToken");case 25:l=t.sent,t.next=30;break;case 28:t.prev=28,t.t1=t.catch(22);case 30:t.next=33;break;case 32:a&&this.tokenManager.remove("idToken");case 33:return t.abrupt("return",!(!u||!l));case 34:case"end":return t.stop()}}),t,this,[[7,13],[22,28]])})))}},{key:"getUser",value:function(){return gs(this,void 0,void 0,z().mark((function e(){var t,n,r;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.tokenManager.getTokensSync(),n=t.idToken,r=t.accessToken,e.abrupt("return",this.token.getUserInfo(r,n));case 2:case"end":return e.stop()}}),e,this)})))}},{key:"getIdToken",value:function(){var e=this.tokenManager.getTokensSync().idToken;return e?e.idToken:void 0}},{key:"getAccessToken",value:function(){var e=this.tokenManager.getTokensSync().accessToken;return e?e.accessToken:void 0}},{key:"getRefreshToken",value:function(){var e=this.tokenManager.getTokensSync().refreshToken;return e?e.refreshToken:void 0}},{key:"storeTokensFromRedirect",value:function(){return gs(this,void 0,void 0,z().mark((function e(){var t,n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.token.parseFromUrl();case 2:t=e.sent,n=t.tokens,this.tokenManager.setTokens(n);case 5:case"end":return e.stop()}}),e,this)})))}},{key:"setOriginalUri",value:function(e,t){Gn.getSessionStorage().setItem(le,e),(t=t||this.options.state)&&this.storageManager.getOriginalUriStorage().setItem(t,e)}},{key:"getOriginalUri",value:function(e){if(e=e||this.options.state){var t=this.storageManager.getOriginalUriStorage().getItem(e);if(t)return t}var n=Gn.getSessionStorage();return n&&n.getItem(le)||void 0}},{key:"removeOriginalUri",value:function(e){if(Gn.getSessionStorage().removeItem(le),e=e||this.options.state){var t=this.storageManager.getOriginalUriStorage();t.removeItem&&t.removeItem(e)}}},{key:"isLoginRedirect",value:function(){return Nt(this)}},{key:"handleLoginRedirect",value:function(e,t){return gs(this,void 0,void 0,z().mark((function n(){var r,o,i;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=this.options.state,!e){n.next=6;break}this.tokenManager.setTokens(e),t=t||this.getOriginalUri(this.options.state),n.next=25;break;case 6:if(!this.isLoginRedirect()){n.next=24;break}return n.prev=7,n.next=10,Pn(this,{});case 10:return o=n.sent,r=o.state,t=t||this.getOriginalUri(r),n.next=15,this.storeTokensFromRedirect();case 15:n.next=22;break;case 17:return n.prev=17,n.t0=n.catch(7),n.next=21,this.authStateManager.updateAuthState();case 21:throw n.t0;case 22:n.next=25;break;case 24:return n.abrupt("return");case 25:return n.next=27,this.authStateManager.updateAuthState();case 27:if(this.removeOriginalUri(r),!(i=this.options.restoreOriginalUri)){n.next=34;break}return n.next=32,i(this,t);case 32:n.next=35;break;case 34:t&&window.location.replace(t);case 35:case"end":return n.stop()}}),n,this,[[7,17]])})))}},{key:"isPKCE",value:function(){return!!this.options.pkce}},{key:"hasResponseType",value:function(e){return Array.isArray(this.options.responseType)&&this.options.responseType.length?this.options.responseType.indexOf(e)>=0:this.options.responseType===e}},{key:"isAuthorizationCodeFlow",value:function(){return this.hasResponseType("code")}},{key:"getIssuerOrigin",value:function(){return this.options.issuer.split("/oauth2/")[0]}},{key:"forgotPassword",value:function(e){return qe(this,"/api/v1/authn/recovery/password",e)}},{key:"unlockAccount",value:function(e){return qe(this,"/api/v1/authn/recovery/unlock",e)}},{key:"verifyRecoveryToken",value:function(e){return qe(this,"/api/v1/authn/recovery/token",e)}},{key:"invokeApiMethod",value:function(e){return gs(this,void 0,void 0,z().mark((function t(){var n;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.accessToken){t.next=5;break}return t.next=3,this.tokenManager.getTokens();case 3:n=t.sent.accessToken,e.accessToken=null==n?void 0:n.accessToken;case 5:return t.abrupt("return",_e(this,e));case 6:case"end":return t.stop()}}),t,this)})))}}]),e}();bs.features=bs.prototype.features=o,bs.crypto=e,bs.webauthn=i,Object.assign(bs,{constants:t});var ks=bs}(),r}()}));
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.OktaAuth=t():e.OktaAuth=t()}(self,(function(){return function(){var e={506:function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},575:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},100:function(e,t,n){var r=n(489),o=n(67);function i(t,n,a){return o()?(e.exports=i=Reflect.construct,e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=i=function(e,t,n){var o=[null];o.push.apply(o,t);var i=new(Function.bind.apply(e,o));return n&&r(i,n.prototype),i},e.exports.default=e.exports,e.exports.__esModule=!0),i.apply(null,arguments)}e.exports=i,e.exports.default=e.exports,e.exports.__esModule=!0},913:function(e){function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},754:function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,t(n)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0},205:function(e,t,n){var r=n(489);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},430:function(e){e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")},e.exports.default=e.exports,e.exports.__esModule=!0},67:function(e){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.default=e.exports,e.exports.__esModule=!0},585:function(e,t,n){var r=n(8).default,o=n(506);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},489:function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,t(n,r)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0},8:function(e){function t(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=t=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),t(n)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0},957:function(e,t,n){var r=n(754),o=n(489),i=n(430),a=n(100);function s(t){var n="function"==typeof Map?new Map:void 0;return e.exports=s=function(e){if(null===e||!i(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return a(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o(t,e)},e.exports.default=e.exports,e.exports.__esModule=!0,s(t)}e.exports=s,e.exports.default=e.exports,e.exports.__esModule=!0},757:function(e,t,n){e.exports=n(666)},615:function(e,t,n){"use strict";var r=n(575),o=n(913),i=n(205),a=n(585),s=n(754);function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var c=function(e){i(c,e);var t,n,u=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=s(t);if(n){var o=s(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return a(this,e)});function c(e){var t;return r(this,c),(t=u.call(this,e||"Promise was canceled")).name="CancelError",t}return o(c,[{key:"isCanceled",get:function(){return!0}}]),c}(n(957)(Error)),l=function(){function e(t){var n=this;r(this,e),this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((function(e,r){n._reject=r;var o=function(e){if(!n._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");n._cancelHandlers.push(e)};return Object.defineProperties(o,{shouldReject:{get:function(){return n._rejectOnCancel},set:function(e){n._rejectOnCancel=e}}}),t((function(t){n._isCanceled&&o.shouldReject||(n._isPending=!1,e(t))}),(function(e){n._isPending=!1,r(e)}),o)}))}return o(e,[{key:"then",value:function(e,t){return this._promise.then(e,t)}},{key:"catch",value:function(e){return this._promise.catch(e)}},{key:"finally",value:function(e){return this._promise.finally(e)}},{key:"cancel",value:function(e){if(this._isPending&&!this._isCanceled){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{var t,n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(this._cancelHandlers);try{for(n.s();!(t=n.n()).done;)(0,t.value)()}catch(e){n.e(e)}finally{n.f()}}catch(e){return void this._reject(e)}this._rejectOnCancel&&this._reject(new c(e))}}},{key:"isCanceled",get:function(){return this._isCanceled}}],[{key:"fn",value:function(t){return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return new e((function(e,n,o){r.push(o),t.apply(void 0,r).then(e,n)}))}}}]),e}();Object.setPrototypeOf(l.prototype,Promise.prototype),e.exports=l,e.exports.CancelError=c},98:function(e,t){var n="undefined"!=typeof self?self:this,r=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,o="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),i="FormData"in e,a="ArrayBuffer"in e;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function v(e){var t=new FileReader,n=p(t);return t.readAsArrayBuffer(e),n}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:o&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&o&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=y(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var e,t,n,r=d(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,n=p(t=new FileReader),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(k)}),this.json=function(){return this.text().then(JSON.parse)},this}h.prototype.append=function(e,t){e=c(e),t=l(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},h.prototype.delete=function(e){delete this.map[c(e)]},h.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},h.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},h.prototype.set=function(e,t){this.map[c(e)]=l(t)},h.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},h.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),f(e)},h.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),f(e)},h.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),f(e)},r&&(h.prototype[Symbol.iterator]=h.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var n,r,o=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new h(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new h(t.headers)),this.method=(r=(n=t.method||this.method||"GET").toUpperCase(),m.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function k(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}})),t}function w(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},g.call(b.prototype),g.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var T=[301,302,303,307,308];w.redirect=function(e,t){if(-1===T.indexOf(t))throw new RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function S(e,n){return new Promise((function(r,i){var a=new b(e,n);if(a.signal&&a.signal.aborted)return i(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new h,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}})),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var o="response"in s?s.response:s.responseText;r(new w(o,n))},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request failed"))},s.onabort=function(){i(new t.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",u)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}S.polyfill=!0,e.fetch||(e.fetch=S,e.Headers=h,e.Request=b,e.Response=w),t.Headers=h,t.Request=b,t.Response=w,t.fetch=S,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var o=r;(t=o.fetch).default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t},643:function(e){e.exports=!1},187:function(e){"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}v(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,o)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var o,i,a,c;if(s(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=u(e))>0&&a.length>o&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,c=l,console&&console.warn&&console.warn(c)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=l.bind(r);return o.listener=n,r.wrapFn=o,o}function h(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):p(o,o.length)}function d(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function v(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){r.once&&e.removeEventListener(t,o),n(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return u(this)},i.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)r(u,this,t);else{var c=u.length,l=p(u,c);for(n=0;n<c;++n)r(l[n],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return s(t),this.on(e,f(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,f(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,r,o,i,a;if(s(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return h(this,e,!0)},i.prototype.rawListeners=function(e){return h(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},i.prototype.listenerCount=d,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},321:function(e,t,n){(function(){(e.exports=n(282)).version="5.1.2"}).call(this)},282:function(e,t,n){(function(){var t,r,o=[].splice,i=function(e,t){if(!(e instanceof t))throw new Error("Bound instance method accessed before binding")},a=[].indexOf;r=n(392),t=n(187).EventEmitter,e.exports=function(){class e extends t{constructor(e={}){super(),this.get=this.get.bind(this),this.mget=this.mget.bind(this),this.set=this.set.bind(this),this.mset=this.mset.bind(this),this.del=this.del.bind(this),this.take=this.take.bind(this),this.ttl=this.ttl.bind(this),this.getTtl=this.getTtl.bind(this),this.keys=this.keys.bind(this),this.has=this.has.bind(this),this.getStats=this.getStats.bind(this),this.flushAll=this.flushAll.bind(this),this.flushStats=this.flushStats.bind(this),this.close=this.close.bind(this),this._checkData=this._checkData.bind(this),this._check=this._check.bind(this),this._isInvalidKey=this._isInvalidKey.bind(this),this._wrap=this._wrap.bind(this),this._getValLength=this._getValLength.bind(this),this._error=this._error.bind(this),this._initErrors=this._initErrors.bind(this),this.options=e,this._initErrors(),this.data={},this.options=Object.assign({forceString:!1,objectValueSize:80,promiseValueSize:80,arrayValueSize:40,stdTTL:0,checkperiod:600,useClones:!0,deleteOnExpire:!0,enableLegacyCallbacks:!1,maxKeys:-1},this.options),this.options.enableLegacyCallbacks&&(console.warn("WARNING! node-cache legacy callback support will drop in v6.x"),["get","mget","set","del","ttl","getTtl","keys","has"].forEach((e=>{var t;t=this[e],this[e]=function(...e){var n,r;if(r=e,[...e]=r,[n]=o.call(e,-1),"function"!=typeof n)return t(...e,n);try{n(null,t(...e))}catch(e){n(e)}}}))),this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this.validKeyTypes=["string","number"],this._checkData()}get(t){var n;if(i(this,e),null!=(n=this._isInvalidKey(t)))throw n;return null!=this.data[t]&&this._check(t,this.data[t])?(this.stats.hits++,this._unwrap(this.data[t])):void this.stats.misses++}mget(t){var n,r,o,a,s;if(i(this,e),!Array.isArray(t))throw this._error("EKEYSTYPE");for(s={},r=0,a=t.length;r<a;r++){if(o=t[r],null!=(n=this._isInvalidKey(o)))throw n;null!=this.data[o]&&this._check(o,this.data[o])?(this.stats.hits++,s[o]=this._unwrap(this.data[o])):this.stats.misses++}return s}set(t,n,r){var o,a;if(i(this,e),this.options.maxKeys>-1&&this.stats.keys>=this.options.maxKeys)throw this._error("ECACHEFULL");if(this.options.forceString,null==r&&(r=this.options.stdTTL),null!=(o=this._isInvalidKey(t)))throw o;return a=!1,this.data[t]&&(a=!0,this.stats.vsize-=this._getValLength(this._unwrap(this.data[t],!1))),this.data[t]=this._wrap(n,r),this.stats.vsize+=this._getValLength(n),a||(this.stats.ksize+=this._getKeyLength(t),this.stats.keys++),this.emit("set",t,n),!0}mset(t){var n,r,o,a,s,u,c,l,f;if(i(this,e),this.options.maxKeys>-1&&this.stats.keys+t.length>=this.options.maxKeys)throw this._error("ECACHEFULL");for(r=0,u=t.length;r<u;r++){if(s=t[r],({key:a,val:f,ttl:l}=s),l&&"number"!=typeof l)throw this._error("ETTLTYPE");if(null!=(n=this._isInvalidKey(a)))throw n}for(o=0,c=t.length;o<c;o++)s=t[o],({key:a,val:f,ttl:l}=s),this.set(a,f,l);return!0}del(t){var n,r,o,a,s,u;for(i(this,e),Array.isArray(t)||(t=[t]),n=0,o=0,s=t.length;o<s;o++){if(a=t[o],null!=(r=this._isInvalidKey(a)))throw r;null!=this.data[a]&&(this.stats.vsize-=this._getValLength(this._unwrap(this.data[a],!1)),this.stats.ksize-=this._getKeyLength(a),this.stats.keys--,n++,u=this.data[a],delete this.data[a],this.emit("del",a,u.v))}return n}take(t){var n;return i(this,e),null!=(n=this.get(t))&&this.del(t),n}ttl(t,n){var r;if(i(this,e),n||(n=this.options.stdTTL),!t)return!1;if(null!=(r=this._isInvalidKey(t)))throw r;return!(null==this.data[t]||!this._check(t,this.data[t])||(n>=0?this.data[t]=this._wrap(this.data[t].v,n,!1):this.del(t),0))}getTtl(t){var n;if(i(this,e),t){if(null!=(n=this._isInvalidKey(t)))throw n;return null!=this.data[t]&&this._check(t,this.data[t])?this.data[t].t:void 0}}keys(){return i(this,e),Object.keys(this.data)}has(t){return i(this,e),null!=this.data[t]&&this._check(t,this.data[t])}getStats(){return i(this,e),this.stats}flushAll(t=!0){i(this,e),this.data={},this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this._killCheckPeriod(),this._checkData(t),this.emit("flush")}flushStats(){i(this,e),this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this.emit("flush_stats")}close(){i(this,e),this._killCheckPeriod()}_checkData(t=!0){var n,r,o;for(n in i(this,e),r=this.data)o=r[n],this._check(n,o);t&&this.options.checkperiod>0&&(this.checkTimeout=setTimeout(this._checkData,1e3*this.options.checkperiod,t),null!=this.checkTimeout&&null!=this.checkTimeout.unref&&this.checkTimeout.unref())}_killCheckPeriod(){if(null!=this.checkTimeout)return clearTimeout(this.checkTimeout)}_check(t,n){var r;return i(this,e),r=!0,0!==n.t&&n.t<Date.now()&&(this.options.deleteOnExpire&&(r=!1,this.del(t)),this.emit("expired",t,this._unwrap(n))),r}_isInvalidKey(t){var n;if(i(this,e),n=typeof t,a.call(this.validKeyTypes,n)<0)return this._error("EKEYTYPE",{type:typeof t})}_wrap(t,n,o=!0){var a;return i(this,e),this.options.useClones||(o=!1),a=Date.now(),{t:0===n?0:n?a+1e3*n:0===this.options.stdTTL?this.options.stdTTL:a+1e3*this.options.stdTTL,v:o?r(t):t}}_unwrap(e,t=!0){return this.options.useClones||(t=!1),null!=e.v?t?r(e.v):e.v:null}_getKeyLength(e){return e.toString().length}_getValLength(t){return i(this,e),"string"==typeof t?t.length:this.options.forceString?JSON.stringify(t).length:Array.isArray(t)?this.options.arrayValueSize*t.length:"number"==typeof t?8:"function"==typeof(null!=t?t.then:void 0)?this.options.promiseValueSize:("undefined"!=typeof Buffer&&null!==Buffer?Buffer.isBuffer(t):void 0)?t.length:null!=t&&"object"==typeof t?this.options.objectValueSize*Object.keys(t).length:"boolean"==typeof t?8:0}_error(t,n={}){var r;return i(this,e),(r=new Error).name=t,r.errorcode=t,r.message=null!=this.ERRORS[t]?this.ERRORS[t](n):"-",r.data=n,r}_initErrors(){var t,n,r;for(n in i(this,e),this.ERRORS={},r=this._ERRORS)t=r[n],this.ERRORS[n]=this.createErrorMessage(t)}createErrorMessage(e){return function(t){return e.replace("__key",t.type)}}}return e.prototype._ERRORS={ENOTFOUND:"Key `__key` not found",ECACHEFULL:"Cache max keys amount exceeded",EKEYTYPE:"The key argument has to be of type `string` or `number`. Found: `__key`",EKEYSTYPE:"The keys argument has to be an array.",ETTLTYPE:"The ttl argument has to be a number."},e}.call(this)}).call(this)},392:function(e){var t=function(){"use strict";function e(e,t){return null!=t&&e instanceof t}var t,n,r;try{t=Map}catch(e){t=function(){}}try{n=Set}catch(e){n=function(){}}try{r=Promise}catch(e){r=function(){}}function o(i,s,u,c,l){"object"==typeof s&&(u=s.depth,c=s.prototype,l=s.includeNonEnumerable,s=s.circular);var f=[],h=[],d="undefined"!=typeof Buffer;return void 0===s&&(s=!0),void 0===u&&(u=1/0),function i(u,p){if(null===u)return null;if(0===p)return u;var v,y;if("object"!=typeof u)return u;if(e(u,t))v=new t;else if(e(u,n))v=new n;else if(e(u,r))v=new r((function(e,t){u.then((function(t){e(i(t,p-1))}),(function(e){t(i(e,p-1))}))}));else if(o.__isArray(u))v=[];else if(o.__isRegExp(u))v=new RegExp(u.source,a(u)),u.lastIndex&&(v.lastIndex=u.lastIndex);else if(o.__isDate(u))v=new Date(u.getTime());else{if(d&&Buffer.isBuffer(u))return v=Buffer.allocUnsafe?Buffer.allocUnsafe(u.length):new Buffer(u.length),u.copy(v),v;e(u,Error)?v=Object.create(u):void 0===c?(y=Object.getPrototypeOf(u),v=Object.create(y)):(v=Object.create(c),y=c)}if(s){var g=f.indexOf(u);if(-1!=g)return h[g];f.push(u),h.push(v)}for(var m in e(u,t)&&u.forEach((function(e,t){var n=i(t,p-1),r=i(e,p-1);v.set(n,r)})),e(u,n)&&u.forEach((function(e){var t=i(e,p-1);v.add(t)})),u){var b;y&&(b=Object.getOwnPropertyDescriptor(y,m)),b&&null==b.set||(v[m]=i(u[m],p-1))}if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(u);for(m=0;m<k.length;m++){var w=k[m];(!(S=Object.getOwnPropertyDescriptor(u,w))||S.enumerable||l)&&(v[w]=i(u[w],p-1),S.enumerable||Object.defineProperty(v,w,{enumerable:!1}))}}if(l){var T=Object.getOwnPropertyNames(u);for(m=0;m<T.length;m++){var S,x=T[m];(S=Object.getOwnPropertyDescriptor(u,x))&&S.enumerable||(v[x]=i(u[x],p-1),Object.defineProperty(v,x,{enumerable:!1}))}}return v}(i,u)}function i(e){return Object.prototype.toString.call(e)}function a(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}return o.clonePrototype=function(e){if(null===e)return null;var t=function(){};return t.prototype=e,new t},o.__objToStr=i,o.__isDate=function(e){return"object"==typeof e&&"[object Date]"===i(e)},o.__isArray=function(e){return"object"==typeof e&&"[object Array]"===i(e)},o.__isRegExp=function(e){return"object"==typeof e&&"[object RegExp]"===i(e)},o.__getRegExpFlags=a,o}();e.exports&&(e.exports=t)},666:function(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var o=t&&t.prototype instanceof y?t:y,i=Object.create(o.prototype),a=new A(r||[]);return i._invoke=function(e,t,n){var r=f;return function(o,i){if(r===d)throw new Error("Generator is already running");if(r===p){if("throw"===o)throw i;return P()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=O(a,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var u=l(e,t,n);if("normal"===u.type){if(r=n.done?p:h,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=p,n.method="throw",n.arg=u.arg)}}}(e,n,a),i}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f="suspendedStart",h="suspendedYield",d="executing",p="completed",v={};function y(){}function g(){}function m(){}var b={};b[i]=function(){return this};var k=Object.getPrototypeOf,w=k&&k(k(R([])));w&&w!==n&&r.call(w,i)&&(b=w);var T=m.prototype=y.prototype=Object.create(b);function S(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function n(o,i,a,s){var u=l(e[o],e,i);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(f).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var o;this._invoke=function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}}function O(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=l(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function R(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:P}}function P(){return{value:t,done:!0}}return g.prototype=T.constructor=m,m.constructor=g,g.displayName=u(m,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,u(e,s,"GeneratorFunction")),e.prototype=Object.create(T),e},e.awrap=function(e){return{__await:e}},S(x.prototype),x.prototype[a]=function(){return this},e.AsyncIterator=x,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new x(c(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(T),u(T,s,"Generator"),T[i]=function(){return this},T.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=R,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;E(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:R(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},279:function(e){function t(){}t.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r<o;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],o=[];if(r&&t)for(var i=0,a=r.length;i<a;i++)r[i].fn!==t&&r[i].fn._!==t&&o.push(r[i]);return o.length?n[e]=o:delete n[e],this}},e.exports=t},199:function(){}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return function(){"use strict";n.r(r),n.d(r,{ACCESS_TOKEN_STORAGE_KEY:function(){return se},AuthApiError:function(){return m},AuthPollStopError:function(){return b},AuthSdkError:function(){return k},AuthStateManager:function(){return ao},AuthTransaction:function(){return Le},AuthenticatorKey:function(){return Ht},CACHE_STORAGE_NAME:function(){return te},DEFAULT_CACHE_DURATION:function(){return Y},DEFAULT_CODE_CHALLENGE_METHOD:function(){return de},DEFAULT_MAX_CLOCK_SKEW:function(){return $},DEFAULT_POLLING_DELAY:function(){return J},EVENT_ADDED:function(){return Zn},EVENT_ERROR:function(){return tr},EVENT_EXPIRED:function(){return Qn},EVENT_REMOVED:function(){return er},EVENT_RENEWED:function(){return Xn},IDX_API_VERSION:function(){return pe},IDX_RESPONSE_STORAGE_NAME:function(){return ae},ID_TOKEN_STORAGE_KEY:function(){return ue},INITIAL_AUTH_STATE:function(){return ro},IdxFeature:function(){return qt},IdxStatus:function(){return Kt},MAX_VERIFIER_LENGTH:function(){return he},MIN_VERIFIER_LENGTH:function(){return fe},OAuthError:function(){return w},ORIGINAL_URI_STORAGE_NAME:function(){return ie},OktaAuth:function(){return ks},PKCE_STORAGE_NAME:function(){return ne},REDIRECT_NONCE_COOKIE_NAME:function(){return Z},REDIRECT_OAUTH_PARAMS_NAME:function(){return Q},REDIRECT_STATE_COOKIE_NAME:function(){return X},REFERRER_PATH_STORAGE_KEY:function(){return le},REFRESH_TOKEN_STORAGE_KEY:function(){return ce},SHARED_TRANSACTION_STORAGE_NAME:function(){return oe},STATE_TOKEN_KEY_NAME:function(){return G},StorageManager:function(){return co},TOKEN_STORAGE_NAME:function(){return ee},TRANSACTION_STORAGE_NAME:function(){return re},TokenManager:function(){return nr},addListener:function(){return at},addPostMessageListener:function(){return lt},addStateToken:function(){return Re},assertPKCESupport:function(){return Wt},authenticate:function(){return Ga},bind:function(){return L},buildAuthorizeParams:function(){return Xe},canProceed:function(){return ts},cancel:function(){return Ja},clearTransactionMeta:function(){return wi},clone:function(){return N},convertTokenParamsToOAuthParams:function(){return Qe},createOAuthMeta:function(){return Bt},createTransactionMeta:function(){return yi},crypto:function(){return e},decodeToken:function(){return hn},delay:function(){return Ie},deprecate:function(){return Vn},deprecateWrap:function(){return Wn},exchangeCodeForTokens:function(){return pn},extend:function(){return U},find:function(){return B},genRandomString:function(){return je},generateNonce:function(){return ht},generateState:function(){return ft},getConsole:function(){return Hn},getDefaultTokenParams:function(){return At},getHashOrSearch:function(){return Dt},getKey:function(){return it},getLink:function(){return K},getNativeConsole:function(){return Kn},getOAuthBaseUrl:function(){return pt},getOAuthDomain:function(){return vt},getOAuthUrls:function(){return yt},getPollFn:function(){return Me},getSavedTransactionMeta:function(){return mi},getStateToken:function(){return Pe},getToken:function(){return mn},getTransactionMeta:function(){return bi},getUserInfo:function(){return On},getWellKnown:function(){return ot},getWithPopup:function(){return _n},getWithRedirect:function(){return An},getWithoutPrompt:function(){return bn},handleEmailVerifyCallback:function(){return Za},handleInteractionCodeRedirect:function(){return fs},handleOAuthResponse:function(){return gn},hasAuthorizationCode:function(){return jt},hasErrorInUrl:function(){return Mt},hasInteractionCode:function(){return It},hasSavedInteractionHandle:function(){return gi},hasTokensInHash:function(){return Ct},interact:function(){return Ei},introspect:function(){return Ri},introspectAuthn:function(){return Be},isAbsoluteUrl:function(){return we},isAccessToken:function(){return un},isAuthApiError:function(){return T},isAuthenticator:function(){return an},isAuthorizationCodeError:function(){return Pt},isCodeFlow:function(){return Ut},isCustomAuthTransactionMeta:function(){return rn},isEmailVerifyCallback:function(){return Qa},isEmailVerifyCallbackError:function(){return Ya},isFunction:function(){return be},isIDToken:function(){return cn},isIdxTransactionMeta:function(){return nn},isInteractionRequired:function(){return Ft},isInteractionRequiredError:function(){return Rt},isLoginRedirect:function(){return Nt},isNumber:function(){return me},isOAuthTransactionMeta:function(){return en},isObject:function(){return ge},isPKCETransactionMeta:function(){return tn},isPromise:function(){return ke},isRedirectUri:function(){return Lt},isRefreshToken:function(){return ln},isRefreshTokenError:function(){return Yt},isSameRefreshToken:function(){return $t},isString:function(){return ye},isToken:function(){return sn},isTransactionMeta:function(){return on},isTransactionMetaValid:function(){return Ti},isTransactionMetaValidForFlow:function(){return Si},isTransactionMetaValidForOptions:function(){return xi},isoToUTCString:function(){return Ce},loadFrame:function(){return ut},loadPopup:function(){return ct},omit:function(){return F},parseEmailVerifyCallback:function(){return Xa},parseFromUrl:function(){return jn},pkce:function(){return We},poll:function(){return os},postRefreshToken:function(){return rt},postToTokenEndpoint:function(){return nt},postToTransaction:function(){return qe},preparePKCE:function(){return Gt},prepareTokenParams:function(){return Jt},proceed:function(){return ns},recoverPassword:function(){return ls},register:function(){return us},removeListener:function(){return st},removeNils:function(){return D},removeTrailingSlash:function(){return Oe},renewToken:function(){return Sn},renewTokens:function(){return xn},renewTokensWithRefresh:function(){return kn},resumeTransaction:function(){return Fe},revokeToken:function(){return dn},saveTransactionMeta:function(){return ki},startTransaction:function(){return as},toAbsoluteUrl:function(){return Te},toQueryString:function(){return xe},toRelativeUrl:function(){return Se},transactionExists:function(){return He},transactionStatus:function(){return Ne},transactionStep:function(){return Ke},unlockAccount:function(){return ds},urlParamsToObject:function(){return Qt},validateClaims:function(){return Xt},validateCodeChallengeMethod:function(){return zt},validateToken:function(){return fn},verifyToken:function(){return vn},warn:function(){return qn}});var e={};n.r(e),n.d(e,{atob:function(){return S},base64ToBase64Url:function(){return E},base64UrlDecode:function(){return C},base64UrlToBase64:function(){return A},base64UrlToBuffer:function(){return j},base64UrlToString:function(){return R},btoa:function(){return x},bufferToBase64Url:function(){return I},getOidcHash:function(){return M},stringToBase64Url:function(){return _},stringToBuffer:function(){return P},verifyToken:function(){return H},webcrypto:function(){return O}});var t={};n.r(t),n.d(t,{ACCESS_TOKEN_STORAGE_KEY:function(){return se},CACHE_STORAGE_NAME:function(){return te},DEFAULT_CACHE_DURATION:function(){return Y},DEFAULT_CODE_CHALLENGE_METHOD:function(){return de},DEFAULT_MAX_CLOCK_SKEW:function(){return $},DEFAULT_POLLING_DELAY:function(){return J},IDX_API_VERSION:function(){return pe},IDX_RESPONSE_STORAGE_NAME:function(){return ae},ID_TOKEN_STORAGE_KEY:function(){return ue},MAX_VERIFIER_LENGTH:function(){return he},MIN_VERIFIER_LENGTH:function(){return fe},ORIGINAL_URI_STORAGE_NAME:function(){return ie},PKCE_STORAGE_NAME:function(){return ne},REDIRECT_NONCE_COOKIE_NAME:function(){return Z},REDIRECT_OAUTH_PARAMS_NAME:function(){return Q},REDIRECT_STATE_COOKIE_NAME:function(){return X},REFERRER_PATH_STORAGE_KEY:function(){return le},REFRESH_TOKEN_STORAGE_KEY:function(){return ce},SHARED_TRANSACTION_STORAGE_NAME:function(){return oe},STATE_TOKEN_KEY_NAME:function(){return G},TOKEN_STORAGE_NAME:function(){return ee},TRANSACTION_STORAGE_NAME:function(){return re}});var o={};n.r(o),n.d(o,{getUserAgent:function(){return kt},hasTextEncoder:function(){return xt},isBrowser:function(){return mt},isFingerprintSupported:function(){return wt},isHTTPS:function(){return _t},isIE11OrLess:function(){return bt},isLocalhost:function(){return Et},isPKCESupported:function(){return Ot},isPopupPostMessageSupported:function(){return Tt},isTokenVerifySupported:function(){return St}});var i={};n.r(i),n.d(i,{buildCredentialCreationOptions:function(){return Mn},buildCredentialRequestOptions:function(){return Ln},getAssertion:function(){return Dn},getAttestation:function(){return Un}});var a={};function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?f(e):t}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function v(e,t,n){return v=p()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&u(o,n.prototype),o},v.apply(null,arguments)}function y(e){var t="function"==typeof Map?new Map:void 0;return y=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return v(e,arguments,d(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),u(r,e)},y(e)}n.r(a),n.d(a,{AuthenticatorEnrollmentData:function(){return pa},AuthenticatorVerificationData:function(){return da},ChallengeAuthenticator:function(){return Zi},ChallengePoll:function(){return ea},EnrollAuthenticator:function(){return $i},EnrollPoll:function(){return Yi},EnrollProfile:function(){return na},EnrollmentChannelData:function(){return Xi},Identify:function(){return ra},ReEnrollAuthenticator:function(){return oa},RedirectIdp:function(){return ia},Remediator:function(){return Ui},ResetAuthenticator:function(){return ta},SelectAuthenticatorAuthenticate:function(){return ua},SelectAuthenticatorEnroll:function(){return ca},SelectAuthenticatorUnlockAccount:function(){return la},SelectEnrollProfile:function(){return fa},SelectEnrollmentChannel:function(){return Qi},Skip:function(){return va}});var g=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(e){var t;return s(this,o),t=r.call(this,e),Object.setPrototypeOf(f(t),(this instanceof o?this.constructor:void 0).prototype),t}return o}(y(Error));var m=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(e,t){var n;s(this,o);var i=e.errorSummary;return(n=r.call(this,i)).name="AuthApiError",n.errorSummary=e.errorSummary,n.errorCode=e.errorCode,n.errorLink=e.errorLink,n.errorId=e.errorId,n.errorCauses=e.errorCauses,t&&(n.xhr=t),n}return o}(g);var b=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.call(this,"The poll was stopped by the sdk")}return o}(g);var k=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(e,t){var n;return s(this,o),(n=r.call(this,e)).name="AuthSdkError",n.errorCode="INTERNAL",n.errorSummary=e,n.errorLink="INTERNAL",n.errorId="INTERNAL",n.errorCauses=[],t&&(n.xhr=t),n}return o}(g);var w=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(e,t){var n;return s(this,o),(n=r.call(this,t)).name="OAuthError",n.errorCode=e,n.errorSummary=t,n}return o}(g);function T(e){return e instanceof m}var S=function(e){return atob(e)},x=function(e){return btoa(e)},O="undefined"==typeof crypto?null:crypto;function _(e){return E(x(e))}function E(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function A(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function R(e){var t=A(e);switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new k("Not a valid Base64Url")}var n=S(t);try{return decodeURIComponent(escape(n))}catch(e){return n}}function P(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function C(e){return S(A(e))}function j(e){return Uint8Array.from(C(e),(function(e){return e.charCodeAt(0)}))}function I(e){return x(new Uint8Array(e).reduce((function(e,t){return e+String.fromCharCode(t)}),""))}function M(e){var t=(new TextEncoder).encode(e);return O.subtle.digest("SHA-256",t).then((function(e){var t=new Uint8Array(e).slice(0,16);return _(String.fromCharCode.apply(null,t))}))}function L(e,t){var n=Array.prototype.slice.call(arguments,2);return function(){var r=Array.prototype.slice.call(arguments);return r=n.concat(r),e.apply(t,r)}}function U(){var e=arguments[0],t=[].slice.call(arguments,1);return t.forEach((function(t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&void 0!==t[n]&&(e[n]=t[n])})),e}function D(e){var t={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];null!=r&&(t[n]=r)}return t}function N(e){if(e){var t=JSON.stringify(e);if(t)return JSON.parse(t)}return e}function F(e){for(var t={},n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&-1==r.indexOf(i)&&(t[i]=e[i]);return N(t)}function B(e,t){for(var n=e.length;n--;){var r=e[n],o=!0;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&r[i]!==t[i]){o=!1;break}if(o)return r}}function K(e,t,n){if(e&&e._links){var r=N(e._links[t]);return r&&r.name&&n?r.name===n?r:void 0:r}}function H(e,t){t=N(t);var n={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};return delete t.use,O.subtle.importKey("jwk",t,n,!0,["verify"]).then((function(t){var r=e.split("."),o=P(r[0]+"."+r[1]),i=P(C(r[2]));return O.subtle.verify(n,t,i,o)}))}function q(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function V(e,t,n){return t&&q(e.prototype,t),n&&q(e,n),e}var W=n(757),z=n.n(W),G="oktaStateToken",J=500,$=300,Y=86400,Q="okta-oauth-redirect-params",X="okta-oauth-state",Z="okta-oauth-nonce",ee="okta-token-storage",te="okta-cache-storage",ne="okta-pkce-storage",re="okta-transaction-storage",oe="okta-shared-transaction-storage",ie="okta-original-uri-storage",ae="okta-idx-response-storage",se="accessToken",ue="idToken",ce="refreshToken",le="referrerPath",fe=43,he=128,de="S256",pe="1.0.0";function ve(e,t,n){e.options.headers=e.options.headers||{},e.options.headers[t]=n}function ye(e){return"[object String]"===Object.prototype.toString.call(e)}function ge(e){return"[object Object]"===Object.prototype.toString.call(e)}function me(e){return"[object Number]"===Object.prototype.toString.call(e)}function be(e){return!!e&&"[object Function]"==={}.toString.call(e)}function ke(e){return e&&e.finally&&"function"==typeof e.finally}function we(e){return/^(?:[a-z]+:)?\/\//i.test(e)}function Te(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return we(e)?e:(t=Oe(t),"/"===e[0]?"".concat(t).concat(e):"".concat(t,"/").concat(e))}function Se(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return we(e)&&(e=e.substring(t.length)),"/"===e[0]?e:"/".concat(e)}function xe(e){var t=[];if(null!==e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&void 0!==e[n]&&null!==e[n]&&t.push(n+"="+encodeURIComponent(e[n]));return t.length?"?"+t.join("&"):""}function Oe(e){if(e){var t=e.replace(/^\s+|\s+$/gm,"");return t.replace(/\/+$/,"")}}function _e(e,t){var n=(t=t||{}).url,r=t.method,o=t.args,i=t.saveAuthnState,a=t.accessToken,s=!0===t.withCredentials,u=e.options.storageUtil.storage,c=e.storageManager.getHttpCache(e.options.cookies);if(t.cacheResponse){var f=c.getStorage()[n];if(f&&Date.now()/1e3<f.expiresAt)return Promise.resolve(f.response)}var h=e._oktaUserAgent.getHttpHeader(),d=Object.assign({Accept:"application/json","Content-Type":"application/json"},h);Object.assign(d,e.options.headers,t.headers),d=D(d),a&&ye(a)&&(d.Authorization="Bearer "+a);var p,v,y={headers:d,data:o||void 0,withCredentials:s};return e.options.httpRequestClient(r,n,y).then((function(r){return(v=r.responseText)&&ye(v)&&(v=JSON.parse(v))&&"object"===l(v)&&!v.headers&&(v.headers=r.headers),i&&(v.stateToken||u.delete(G)),v&&v.stateToken&&v.expiresAt&&u.set(G,v.stateToken,v.expiresAt,e.options.cookies),v&&t.cacheResponse&&c.updateStorage(n,{expiresAt:Math.floor(Date.now()/1e3)+Y,response:v}),v})).catch((function(t){var n=t.responseText||{};if(ye(n))try{n=JSON.parse(n)}catch(e){n={errorSummary:"Unknown error"}}throw t.status>=500&&(n.errorSummary="Unknown error"),e.options.transformErrorXHR&&(t=e.options.transformErrorXHR(N(t))),"E0000011"===(p=new m(n,t)).errorCode&&u.delete(G),p}))}function Ee(e,t,n){var r={url:t=we(t)?t:e.getIssuerOrigin()+t,method:"GET"};return Object.assign(r,n),_e(e,r)}function Ae(e,t,n,r){var o={url:t=we(t)?t:e.getIssuerOrigin()+t,method:"POST",args:n,saveAuthnState:!0};return Object.assign(o,r),_e(e,o)}function Re(e,t){var n={};return Object.assign(n,t),!n.stateToken&&e.stateToken&&(n.stateToken=e.stateToken),n}function Pe(e){return Re(e)}function Ce(e){var t=e.match(/\d+/g),n=Date.UTC(t[0],t[1]-1,t[2],t[3],t[4],t[5]);return new Date(n).toUTCString()}function je(e){for(var t="abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",n="",r=0,o=t.length;r<e;++r)n+=t[Math.floor(Math.random()*o)];return n}function Ie(e){return new Promise((function(t){setTimeout(t,e)}))}function Me(e,t,n){return function(r){var o,i,a,s;me(r)?o=r:ge(r)&&(o=(r=r).delay,i=r.rememberDevice,a=r.autoPush,s=r.transactionCallBack),o||0===o||(o=J);var u=K(t,"next","poll");n.isPolling=!0;var c=0;return function r(){return n.isPolling?function(){var n={};if("function"==typeof a)try{n.autoPush=!!a()}catch(e){return Promise.reject(new k("AutoPush resulted in an error."))}else null!=a&&(n.autoPush=!!a);if("function"==typeof i)try{n.rememberDevice=!!i()}catch(e){return Promise.reject(new k("RememberDevice resulted in an error."))}else null!=i&&(n.rememberDevice=!!i);var r=u.href+xe(n);return Ae(e,r,Pe(t),{saveAuthnState:!1,withCredentials:!0})}().then((function(t){if(c=0,t.factorResult&&"WAITING"===t.factorResult){if(!n.isPolling)throw new b;return"function"==typeof s&&s(t),Ie(o).then(r)}return n.isPolling=!1,new Le(e,t)})).catch((function(e){if(e.xhr&&(0===e.xhr.status||429===e.xhr.status)&&c<=4){var t=1e3*Math.pow(2,c);return c++,Ie(t).then(r)}throw e})):Promise.reject(new b)}().catch((function(e){throw n.isPolling=!1,e}))}}var Le=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(s(this,e),this.data=void 0,this.status=void 0,n){if(this.data=n,this.data.interactionHandle)return void(this.status=n.status);Object.assign(this,De(t,n,n,{})),delete this.stateToken,"RECOVERY_CHALLENGE"!==n.status||n._links||(this.cancel=function(){return Promise.resolve(new e(t))})}};function Ue(e,t,n,r,o){if(Array.isArray(r))return function(i,a){if(!i)throw new k("Must provide a link name");var s=B(r,{name:i});if(!s)throw new k("No link found for that name");return Ue(e,t,n,s,o)(a)};if(r.hints&&r.hints.allow&&1===r.hints.allow.length)switch(r.hints.allow[0]){case"GET":return function(){return Ee(e,r.href,{withCredentials:!0})};case"POST":return function(i){o&&o.isPolling&&(o.isPolling=!1);var a=Re(t,i);"MFA_ENROLL"!==t.status&&"FACTOR_ENROLL"!==t.status||Object.assign(a,{factorType:n.factorType,provider:n.provider});var s={},u=a.autoPush;if(void 0!==u){if("function"==typeof u)try{s.autoPush=!!u()}catch(e){return Promise.reject(new k("AutoPush resulted in an error."))}else null!==u&&(s.autoPush=!!u);a=F(a,"autoPush")}var c=a.rememberDevice;if(void 0!==c){if("function"==typeof c)try{s.rememberDevice=!!c()}catch(e){return Promise.reject(new k("RememberDevice resulted in an error."))}else null!==c&&(s.rememberDevice=!!c);a=F(a,"rememberDevice")}else a.profile&&void 0!==a.profile.updatePhone&&(a.profile.updatePhone&&(s.updatePhone=!0),a.profile=F(a.profile,"updatePhone"));var l=r.href+xe(s);return qe(e,l,a)}}}function De(e,t,n,r){if(n=N(n=n||t),Array.isArray(n)){for(var o=[],i=0,a=n.length;i<a;i++)o.push(De(e,t,n[i],r));return o}var s=n._embedded||{};for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(ge(s[u])||Array.isArray(s[u]))&&(s[u]=De(e,t,s[u],r));var c=function(e,t,n,r){var o={};for(var i in n._links)if(Object.prototype.hasOwnProperty.call(n._links,i)){var a=n._links[i];if("next"===i&&(i=a.name),a.type)o[i]=a;else if("poll"===i)o.poll=Me(e,t,r);else{var s=Ue(e,t,n,a,r);s&&(o[i]=s)}}return o}(e,t,n,r);return Object.assign(s,c),n=F(n,"_embedded","_links"),Object.assign(n,s),n}function Ne(e,t){return t=Re(e,t),Ae(e,e.getIssuerOrigin()+"/api/v1/authn",t,{withCredentials:!0})}function Fe(e,t){if(!t||!t.stateToken){var n=e.tx.exists._get(G);if(!n)return Promise.reject(new k("No transaction to resume"));t={stateToken:n}}return e.tx.status(t).then((function(t){return new Le(e,t)}))}function Be(e,t){if(!t||!t.stateToken){var n=e.tx.exists._get(G);if(!n)return Promise.reject(new k("No transaction to evaluate"));t={stateToken:n}}return Ke(e,t).then((function(t){return new Le(e,t)}))}function Ke(e,t){return t=Re(e,t),Ae(e,e.getIssuerOrigin()+"/api/v1/authn/introspect",t,{withCredentials:!0})}function He(e){return!!e.tx.exists._get(G)}function qe(e,t,n,r){return r=Object.assign({withCredentials:!0},r),Ae(e,t,n,r).then((function(t){return new Le(e,t)}))}function Ve(e){return("0"+e.toString(16)).substr(-2)}var We={DEFAULT_CODE_CHALLENGE_METHOD:de,generateVerifier:function(e){var t=e||"";return t.length<fe&&(t+=function(e){var t=new Uint8Array(Math.ceil(e/2));return O.getRandomValues(t),Array.from(t,Ve).join("").slice(0,e)}(fe-t.length)),encodeURIComponent(t).slice(0,he)},computeChallenge:function(e){var t=(new TextEncoder).encode(e);return O.subtle.digest("SHA-256",t).then((function(e){return _(String.fromCharCode.apply(null,new Uint8Array(e)))}))}};function ze(e){return e.session.get().then((function(e){return"ACTIVE"===e.status})).catch((function(){return!1}))}function Ge(e){return Ee(e,"/api/v1/sessions/me",{withCredentials:!0}).then((function(t){var n=F(t,"_links");return n.refresh=function(){return Ae(e,K(t,"refresh").href,{},{withCredentials:!0})},n.user=function(){return Ee(e,K(t,"user").href,{withCredentials:!0})},n})).catch((function(){return{status:"INACTIVE"}}))}function Je(e){return _e(e,{url:e.getIssuerOrigin()+"/api/v1/sessions/me",method:"DELETE",withCredentials:!0})}function $e(e){return Ae(e,"/api/v1/sessions/me/lifecycle/refresh",{},{withCredentials:!0})}function Ye(e,t,n){n=n||window.location.href,window.location.assign(e.getIssuerOrigin()+"/login/sessionCookieRedirect"+xe({checkAccountSetupComplete:!0,token:t,redirectUrl:n}))}function Qe(e){if(!e.clientId)throw new k("A clientId must be specified in the OktaAuth constructor to get a token");if(ye(e.responseType)&&-1!==e.responseType.indexOf(" "))throw new k("Multiple OAuth responseTypes must be defined as an array");var t={client_id:e.clientId,code_challenge:e.codeChallenge,code_challenge_method:e.codeChallengeMethod,display:e.display,idp:e.idp,idp_scope:e.idpScope,login_hint:e.loginHint,max_age:e.maxAge,nonce:e.nonce,prompt:e.prompt,redirect_uri:e.redirectUri,response_mode:e.responseMode,response_type:e.responseType,sessionToken:e.sessionToken,state:e.state};if(t=D(t),["idp_scope","response_type"].forEach((function(e){Array.isArray(t[e])&&(t[e]=t[e].join(" "))})),-1!==e.responseType.indexOf("id_token")&&-1===e.scopes.indexOf("openid"))throw new k("openid scope must be specified in the scopes argument when requesting an id_token");return t.scope=e.scopes.join(" "),t}function Xe(e){var t=Qe(e);return xe(Object.assign(Object.assign({},t),e.extraParams&&Object.assign({},e.extraParams)))}function Ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function et(e,t){if(e){if("string"==typeof e)return Ze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ze(e,t):void 0}}function tt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||et(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nt(e,t,n){!function(e){if(!e.clientId)throw new k("A clientId must be specified in the OktaAuth constructor to get a token");if(!e.redirectUri)throw new k("The redirectUri passed to /authorize must also be passed to /token");if(!e.authorizationCode&&!e.interactionCode)throw new k("An authorization code (returned from /authorize) must be passed to /token");if(!e.codeVerifier)throw new k('The "codeVerifier" (generated and saved by your app) must be passed to /token')}(t);var r=function(e,t){var n=D({client_id:t.clientId,redirect_uri:t.redirectUri,grant_type:t.interactionCode?"interaction_code":"authorization_code",code_verifier:t.codeVerifier});t.interactionCode?n.interaction_code=t.interactionCode:t.authorizationCode&&(n.code=t.authorizationCode);var r=e.options.clientSecret;return r&&(n.client_secret=r),xe(n).slice(1)}(e,t);return _e(e,{url:n.tokenUrl,method:"POST",args:r,headers:{"Content-Type":"application/x-www-form-urlencoded"}})}function rt(e,t,n){return _e(e,{url:n.tokenUrl,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},args:Object.entries({client_id:t.clientId,grant_type:"refresh_token",scope:n.scopes.join(" "),refresh_token:n.refreshToken}).map((function(e){var t=tt(e,2),n=t[0],r=t[1];return n+"="+encodeURIComponent(r)})).join("&")})}function ot(e,t){return Ee(e,(t||e.options.issuer)+"/.well-known/openid-configuration",{cacheResponse:!0})}function it(e,t,n){var r=e.storageManager.getHttpCache(e.options.cookies);return ot(e,t).then((function(t){var o=t.jwks_uri,i=r.getStorage()[o];if(i&&Date.now()/1e3<i.expiresAt){var a=B(i.response.keys,{kid:n});if(a)return a}return r.clearStorage(o),Ee(e,o,{cacheResponse:!0}).then((function(e){var t=B(e.keys,{kid:n});if(t)return t;throw new k("The key id, "+n+", was not found in the server's keys")}))}))}function at(e,t,n){e.addEventListener?e.addEventListener(t,n):e.attachEvent("on"+t,n)}function st(e,t,n){e.removeEventListener?e.removeEventListener(t,n):e.detachEvent("on"+t,n)}function ut(e){var t=document.createElement("iframe");return t.style.display="none",t.src=e,document.body.appendChild(t)}function ct(e,t){var n=t.popupTitle||"External Identity Provider User Authentication";return window.open(e,n,"toolbar=no, scrollbars=yes, resizable=yes, top=100, left=500, width=600, height=600")}function lt(e,t,n){var r,o;return new Promise((function(i,a){r=function(t){if(t.data&&t.data.state===n)return t.origin!==e.getIssuerOrigin()?a(new k("The request does not match client configuration")):void i(t.data)},at(window,"message",r),o=setTimeout((function(){a(new k("OAuth flow timed out"))}),t||12e4)})).finally((function(){clearTimeout(o),st(window,"message",r)}))}function ft(){return je(64)}function ht(){return je(64)}function dt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Oe(t.issuer)||e.options.issuer;return n}function pt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=dt(e,t),r=n.indexOf("/oauth2")>0?n:n+"/oauth2";return r}function vt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=dt(e,t),r=n.split("/oauth2")[0];return r}function yt(e,t){if(arguments.length>2)throw new k('As of version 3.0, "getOAuthUrls" takes only a single set of options');var n=Oe((t=t||{}).authorizeUrl)||e.options.authorizeUrl,r=dt(e,t),o=Oe(t.userinfoUrl)||e.options.userinfoUrl,i=Oe(t.tokenUrl)||e.options.tokenUrl,a=Oe(t.logoutUrl)||e.options.logoutUrl,s=Oe(t.revokeUrl)||e.options.revokeUrl,u=pt(e,t);return{issuer:r,authorizeUrl:n=n||u+"/v1/authorize",userinfoUrl:o=o||u+"/v1/userinfo",tokenUrl:i=i||u+"/v1/token",revokeUrl:s=s||u+"/v1/revoke",logoutUrl:a=a||u+"/v1/logout"}}var gt=/windows phone|iemobile|wpdesktop/i;function mt(){return"undefined"!=typeof document&&"undefined"!=typeof window}function bt(){if(!mt())return!1;var e=document.documentMode;return!!e&&e<=11}function kt(){return navigator.userAgent}function wt(){var e=kt();return e&&!gt.test(e)}function Tt(){if(!mt())return!1;var e=document.documentMode,t=e&&e<10;return void 0!==window.postMessage&&!t}function St(){return null!=O&&void 0!==O.subtle&&"undefined"!=typeof Uint8Array}function xt(){return"undefined"!=typeof TextEncoder}function Ot(){return St()&&xt()}function _t(){return!!mt()&&"https:"===window.location.protocol}function Et(){return mt()&&"localhost"===window.location.hostname}function At(e){var t=e.options,n=t.pkce,r=t.clientId,o=t.redirectUri,i=t.responseType,a=t.responseMode,s=t.scopes,u=t.state,c=t.ignoreSignature,l=mt()?window.location.href:void 0;return D({pkce:n,clientId:r,redirectUri:o||l,responseType:i||["token","id_token"],responseMode:a,state:u||ft(),nonce:ht(),scopes:s||["openid","email"],ignoreSignature:c})}function Rt(e){return"OAuthError"===e.name&&"interaction_required"===e.errorCode}function Pt(e,t){if("AuthApiError"!==t.name)return!1;var n=t.xhr,r=null==n?void 0:n.responseJSON;return e.options.pkce&&"invalid_grant"===(null==r?void 0:r.error)}function Ct(e){return/((id|access)_token=)/i.test(e)}function jt(e){return/(code=)/i.test(e)}function It(e){return/(interaction_code=)/i.test(e)}function Mt(e){return/(error=)/i.test(e)||/(error_description)/i.test(e)}function Lt(e,t){var n=t.options;return!(!e||!n.redirectUri)&&0===e.indexOf(n.redirectUri)}function Ut(e){return e.pkce||"code"===e.responseType||"query"===e.responseMode}function Dt(e){return Ut(e)&&"fragment"!==e.responseMode?window.location.search:window.location.hash}function Nt(e){if(!Lt(window.location.href,e))return!1;var t=Ut(e.options),n=Dt(e.options);return!!Mt(n)||(t?jt(n)||It(n):Ct(window.location.hash))}function Ft(e,t){if(!t){if(!Nt(e))return!1;t=Dt(e.options)}return/(error=interaction_required)/i.test(t)}function Bt(e,t){var n={issuer:e.options.issuer,urls:yt(e,t),clientId:t.clientId,redirectUri:t.redirectUri,responseType:t.responseType,responseMode:t.responseMode,scopes:t.scopes,state:t.state,nonce:t.nonce,ignoreSignature:t.ignoreSignature};return!1===t.pkce?n:Object.assign(Object.assign({},n),{codeVerifier:t.codeVerifier,codeChallengeMethod:t.codeChallengeMethod,codeChallenge:t.codeChallenge})}var Kt,Ht,qt,Vt=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function Wt(e){if(!e.features.isPKCESupported()){var t="PKCE requires a modern browser with encryption support running in a secure context.";throw e.features.isHTTPS()||(t+="\nThe current page is not being served with HTTPS protocol. PKCE requires secure HTTPS protocol."),e.features.hasTextEncoder()||(t+='\n"TextEncoder" is not defined. To use PKCE, you may need to include a polyfill/shim for this browser.'),new k(t)}}function zt(e,t){return Vt(this,void 0,void 0,z().mark((function n(){return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t=t||e.options.codeChallengeMethod||de,n.next=3,ot(e);case 3:if(-1!==(n.sent.code_challenge_methods_supported||[]).indexOf(t)){n.next=7;break}throw new k("Invalid code_challenge_method");case 7:return n.abrupt("return",t);case 8:case"end":return n.stop()}}),n)})))}function Gt(e,t){return Vt(this,void 0,void 0,z().mark((function n(){var r,o,i,a;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(o=(r=t).codeVerifier,i=r.codeChallenge,a=r.codeChallengeMethod,i=i||e.options.codeChallenge){n.next=8;break}return Wt(e),o=o||We.generateVerifier(),n.next=7,We.computeChallenge(o);case 7:i=n.sent;case 8:return n.next=10,zt(e,a);case 10:return a=n.sent,t=Object.assign(Object.assign({},t),{responseType:"code",codeVerifier:o,codeChallenge:i,codeChallengeMethod:a}),n.abrupt("return",t);case 13:case"end":return n.stop()}}),n)})))}function Jt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Vt(this,void 0,void 0,z().mark((function n(){var r;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=At(e),!1!==(t=Object.assign(Object.assign({},r),t)).pkce){n.next=4;break}return n.abrupt("return",t);case 4:return n.abrupt("return",Gt(e,t));case 5:case"end":return n.stop()}}),n)})))}function $t(e,t){return e.refreshToken===t.refreshToken}function Yt(e){return!(!T(e)||!e.xhr||!e.xhr.responseJSON||"invalid_grant"!==e.xhr.responseJSON.error)}function Qt(e){var t=/\+/g,n=/([^&=]+)=?([^&]*)/g,r=e||"";"#"===r.charAt(0)&&"/"===r.charAt(1)&&(r=r.substring(2)),"#"!==r.charAt(0)&&"?"!==r.charAt(0)||(r=r.substring(1));for(var o,i={};o=n.exec(r);){var a=o[1],s=o[2];i[a]="id_token"===a||"access_token"===a||"code"===a?s:decodeURIComponent(s.replace(t," "))}return i}function Xt(e,t,n){var r=n.clientId,o=n.issuer,i=n.nonce;if(!t||!o||!r)throw new k("The jwt, iss, and aud arguments are all required");if(i&&t.nonce!==i)throw new k("OAuth flow response nonce doesn't match request nonce");var a=Math.floor(Date.now()/1e3);if(t.iss!==o)throw new k("The issuer ["+t.iss+"] does not match ["+o+"]");if(t.aud!==r)throw new k("The audience ["+t.aud+"] does not match ["+r+"]");if(t.iat>t.exp)throw new k("The JWT expired before it was issued");if(!e.options.ignoreLifetime){if(a-e.options.maxClockSkew>t.exp)throw new k("The JWT expired and is no longer valid");if(t.iat>a+e.options.maxClockSkew)throw new k("The JWT was issued in the future")}}function Zt(e){return!(!e||"object"!==l(e)||0===Object.values(e).length)}function en(e){return!(!Zt(e)||!e.redirectUri&&!e.responseType)}function tn(e){return!!en(e)&&!!e.codeVerifier}function nn(e){return!!tn(e)&&!!e.interactionHandle}function rn(e){return!!Zt(e)&&void 0===Object.values(e).find((function(e){return"string"!=typeof e}))}function on(e){return!(!en(e)&&!rn(e))}function an(e){return e&&(e.key||e.id)}function sn(e){return!!(e&&(e.accessToken||e.idToken||e.refreshToken)&&Array.isArray(e.scopes))}function un(e){return e&&e.accessToken}function cn(e){return e&&e.idToken}function ln(e){return e&&e.refreshToken}function fn(e,t){if(!cn(e)&&!un(e)&&!ln(e))throw new k("Token must be an Object with scopes, expiresAt, and one of: an idToken, accessToken, or refreshToken property");if("accessToken"===t&&!un(e))throw new k("invalid accessToken");if("idToken"===t&&!cn(e))throw new k("invalid idToken");if("refreshToken"===t&&!ln(e))throw new k("invalid refreshToken")}function hn(e){var t,n=e.split(".");try{t={header:JSON.parse(R(n[0])),payload:JSON.parse(R(n[1])),signature:n[2]}}catch(e){throw new k("Malformed token")}return t}!function(e){e.SUCCESS="SUCCESS",e.PENDING="PENDING",e.FAILURE="FAILURE",e.TERMINAL="TERMINAL",e.CANCELED="CANCELED"}(Kt||(Kt={})),function(e){e.OKTA_PASSWORD="okta_password",e.OKTA_EMAIL="okta_email",e.PHONE_NUMBER="phone_number",e.GOOGLE_AUTHENTICATOR="google_otp",e.SECURITY_QUESTION="security_question",e.OKTA_VERIFY="okta_verify",e.WEBAUTHN="webauthn"}(Ht||(Ht={})),function(e){e.PASSWORD_RECOVERY="recover-password",e.REGISTRATION="enroll-profile",e.SOCIAL_IDP="redirect-idp",e.ACCOUNT_UNLOCK="unlock-account"}(qt||(qt={}));function dn(e,t){return n=this,r=void 0,o=void 0,i=z().mark((function n(){var r,o,i,a,s,u,c;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r="",o="",t&&(r=t.accessToken,o=t.refreshToken),r||o){n.next=5;break}throw new k("A valid access or refresh token object is required");case 5:if(i=e.options.clientId,a=e.options.clientSecret,i){n.next=9;break}throw new k("A clientId must be specified in the OktaAuth constructor to revoke a token");case 9:return s=yt(e).revokeUrl,u=xe({token_type_hint:o?"refresh_token":"access_token",token:o||r}).slice(1),c=x(a?"".concat(i,":").concat(a):i),n.abrupt("return",Ae(e,s,u,{headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:"Basic "+c}}));case 13:case"end":return n.stop()}}),n)})),new(o||(o=Promise))((function(e,t){function a(e){try{u(i.next(e))}catch(e){t(e)}}function s(e){try{u(i.throw(e))}catch(e){t(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(a,s)}u((i=i.apply(n,r||[])).next())}));var n,r,o,i}function pn(e,t,n){n=n||yt(e,t);var r=t=Object.assign({},At(e),N(t)),o=r.authorizationCode,i=r.interactionCode,a=r.codeVerifier,s=r.clientId,u=r.redirectUri,c=r.scopes,l=r.ignoreSignature,f=r.state;return nt(e,{clientId:s,redirectUri:u,authorizationCode:o,interactionCode:i,codeVerifier:a},n).then((function(t){var r=["token"];return-1!==c.indexOf("openid")&&r.push("id_token"),gn(e,{clientId:s,redirectUri:u,scopes:c,responseType:r,ignoreSignature:l},t,n).then((function(e){return e.code=o,e.state=f,e}))})).finally((function(){e.transactionManager.clear()}))}function vn(e,t,n){return r=this,o=void 0,i=void 0,a=z().mark((function r(){var o,i,a,s,u,c;return z().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t&&t.idToken){r.next=2;break}throw new k("Only idTokens may be verified");case 2:return o=hn(t.idToken),i=(null==n?void 0:n.issuer)||e.options.issuer,r.next=6,ot(e,i);case 6:if(a=r.sent,s=a.issuer,u=Object.assign({clientId:e.options.clientId,ignoreSignature:e.options.ignoreSignature},n,{issuer:s}),Xt(e,o.payload,u),1!=u.ignoreSignature&&e.features.isTokenVerifySupported()){r.next=12;break}return r.abrupt("return",t);case 12:return r.next=14,it(e,t.issuer,o.header.kid);case 14:return c=r.sent,r.next=17,H(t.idToken,c);case 17:if(r.sent){r.next=20;break}throw new k("The token signature is not valid");case 20:if(!(n&&n.accessToken&&t.claims.at_hash)){r.next=26;break}return r.next=23,M(n.accessToken);case 23:if(r.sent===t.claims.at_hash){r.next=26;break}throw new k("Token hash verification failed");case 26:return r.abrupt("return",t);case 27:case"end":return r.stop()}}),r)})),new(i||(i=Promise))((function(e,t){function n(e){try{u(a.next(e))}catch(e){t(e)}}function s(e){try{u(a.throw(e))}catch(e){t(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(n,s)}u((a=a.apply(r,o||[])).next())}));var r,o,i,a}function yn(e,t){if(e.error&&e.error_description)throw new w(e.error,e.error_description);if(e.state!==t.state)throw new k("OAuth flow response state doesn't match request state")}function gn(e,t,n,r){return o=this,i=void 0,a=void 0,s=z().mark((function o(){var i,a,s,u,c,l,f,h,d,p,v,y,g,m;return z().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(!1===e.options.pkce||!n.code&&!n.interaction_code){o.next=3;break}return o.abrupt("return",pn(e,Object.assign({},t,{authorizationCode:n.code,interactionCode:n.interaction_code}),r));case 3:if(t=t||At(e),r=r||yt(e,t),i=t.responseType||[],Array.isArray(i)||(i=[i]),a=n.scope?n.scope.split(" "):N(t.scopes),s=t.clientId||e.options.clientId,yn(n,t),u={},c=n.expires_in,l=n.token_type,f=n.access_token,h=n.id_token,d=n.refresh_token,p=Math.floor(Date.now()/1e3),f&&(v=e.token.decode(f),u.accessToken={accessToken:f,claims:v.payload,expiresAt:Number(c)+p,tokenType:l,scopes:a,authorizeUrl:r.authorizeUrl,userinfoUrl:r.userinfoUrl}),d&&(u.refreshToken={refreshToken:d,expiresAt:Number(c)+p,scopes:a,tokenUrl:r.tokenUrl,authorizeUrl:r.authorizeUrl,issuer:r.issuer}),!h){o.next=27;break}return y=e.token.decode(h),g={idToken:h,claims:y.payload,expiresAt:y.payload.exp-y.payload.iat+p,scopes:a,authorizeUrl:r.authorizeUrl,issuer:r.issuer,clientId:s},m={clientId:s,issuer:r.issuer,nonce:t.nonce,accessToken:f},void 0!==t.ignoreSignature&&(m.ignoreSignature=t.ignoreSignature),o.next=26,vn(e,g,m);case 26:u.idToken=g;case 27:if(-1===i.indexOf("token")||u.accessToken){o.next=29;break}throw new k('Unable to parse OAuth flow response: response type "token" was requested but "access_token" was not returned.');case 29:if(-1===i.indexOf("id_token")||u.idToken){o.next=31;break}throw new k('Unable to parse OAuth flow response: response type "id_token" was requested but "id_token" was not returned.');case 31:return o.abrupt("return",{tokens:u,state:n.state,code:n.code});case 32:case"end":return o.stop()}}),o)})),new(a||(a=Promise))((function(e,t){function n(e){try{u(s.next(e))}catch(e){t(e)}}function r(e){try{u(s.throw(e))}catch(e){t(e)}}function u(t){var o;t.done?e(t.value):(o=t.value,o instanceof a?o:new a((function(e){e(o)}))).then(n,r)}u((s=s.apply(o,i||[])).next())}));var o,i,a,s}function mn(e,t){if(arguments.length>2)return Promise.reject(new k('As of version 3.0, "getToken" takes only a single set of options'));var n=(t=t||{}).popupWindow;return t.popupWindow=void 0,Jt(e,t).then((function(r){var o,i;switch(t.sessionToken?Object.assign(r,{prompt:"none",responseMode:"okta_post_message",display:null}):t.idp&&Object.assign(r,{display:"popup"}),i=yt(e,r),o=(t.codeVerifier?i.tokenUrl:i.authorizeUrl)+Xe(r),r.sessionToken||null===r.display?"IFRAME":"popup"===r.display?"POPUP":"IMPLICIT"){case"IFRAME":var a=lt(e,t.timeout,r.state),s=ut(o);return a.then((function(t){return gn(e,r,t,i)})).finally((function(){var e;document.body.contains(s)&&(null===(e=s.parentElement)||void 0===e||e.removeChild(s))}));case"POPUP":var u;if("okta_post_message"===r.responseMode){if(!e.features.isPopupPostMessageSupported())throw new k("This browser doesn't have full postMessage support");u=lt(e,t.timeout,r.state)}return n&&n.location.assign(o),new Promise((function(e,t){var r=setInterval((function(){n&&!n.closed||(clearInterval(r),t(new k("Unable to parse OAuth flow response")))}),100);u.then((function(t){clearInterval(r),e(t)})).catch((function(e){clearInterval(r),t(e)}))})).then((function(t){return gn(e,r,t,i)})).finally((function(){n&&!n.closed&&n.close()}));default:throw new k("The full page redirect flow is not supported")}}))}function bn(e,t){return arguments.length>2?Promise.reject(new k('As of version 3.0, "getWithoutPrompt" takes only a single set of options')):(t=N(t)||{},Object.assign(t,{prompt:"none",responseMode:"okta_post_message",display:null}),mn(e,t))}function kn(e,t,n){return r=this,o=void 0,i=void 0,a=z().mark((function r(){var o,i,a,s,u,c,l;return z().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(o=e.options.clientId){r.next=3;break}throw new k("A clientId must be specified in the OktaAuth constructor to renew tokens");case 3:return i=Object.assign({},t,{clientId:o}),r.next=6,rt(e,i,n);case 6:return a=r.sent,s=yt(e,t),r.next=10,gn(e,i,a,s);case 10:return u=r.sent,c=u.tokens,(l=c.refreshToken)&&!$t(l,n)&&e.tokenManager.updateRefreshToken(l),r.abrupt("return",c);case 15:case"end":return r.stop()}}),r)})),new(i||(i=Promise))((function(e,t){function n(e){try{u(a.next(e))}catch(e){t(e)}}function s(e){try{u(a.throw(e))}catch(e){t(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(n,s)}u((a=a.apply(r,o||[])).next())}));var r,o,i,a}function wn(){throw new k("Renew must be passed a token with an array of scopes and an accessToken or idToken")}function Tn(e,t){return cn(e)?t.idToken:un(e)?t.accessToken:void wn()}function Sn(e,t){return n=this,r=void 0,o=void 0,i=z().mark((function n(){var r,o,i,a,s,u;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(cn(t)||un(t)||wn(),!(r=e.tokenManager.getTokensSync()).refreshToken){n.next=7;break}return n.next=5,kn(e,{scopes:t.scopes},r.refreshToken);case 5:return r=n.sent,n.abrupt("return",Tn(t,r));case 7:return o=e.options.pkce?"code":un(t)?"token":"id_token",i=t.scopes,a=t.authorizeUrl,s=t.userinfoUrl,u=t.issuer,n.abrupt("return",bn(e,{responseType:o,scopes:i,authorizeUrl:a,userinfoUrl:s,issuer:u}).then((function(e){return Tn(t,e.tokens)})));case 10:case"end":return n.stop()}}),n)})),new(o||(o=Promise))((function(e,t){function a(e){try{u(i.next(e))}catch(e){t(e)}}function s(e){try{u(i.throw(e))}catch(e){t(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(a,s)}u((i=i.apply(n,r||[])).next())}));var n,r,o,i}function xn(e,t){return n=this,r=void 0,o=void 0,i=z().mark((function n(){var r,o,i,a,s,u,c,l,f;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(r=e.tokenManager.getTokensSync()).refreshToken){n.next=3;break}return n.abrupt("return",kn(e,t||{},r.refreshToken));case 3:if(r.accessToken||r.idToken){n.next=5;break}throw new k("renewTokens() was called but there is no existing token");case 5:if(o=r.accessToken||{},i=r.idToken||{},a=o.scopes||i.scopes){n.next=10;break}throw new k("renewTokens: invalid tokens: could not read scopes");case 10:if(s=o.authorizeUrl||i.authorizeUrl){n.next=13;break}throw new k("renewTokens: invalid tokens: could not read authorizeUrl");case 13:return u=o.userinfoUrl||e.options.userinfoUrl,c=i.issuer||e.options.issuer,t=Object.assign({scopes:a,authorizeUrl:s,userinfoUrl:u,issuer:c},t),e.options.pkce?t.responseType="code":(l=At(e),f=l.responseType,t.responseType=f),n.abrupt("return",bn(e,t).then((function(e){return e.tokens})));case 18:case"end":return n.stop()}}),n)})),new(o||(o=Promise))((function(e,t){function a(e){try{u(i.next(e))}catch(e){t(e)}}function s(e){try{u(i.throw(e))}catch(e){t(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(a,s)}u((i=i.apply(n,r||[])).next())}));var n,r,o,i}function On(e,t,n){return r=this,o=void 0,i=void 0,a=z().mark((function r(){return z().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t){r.next=4;break}return r.next=3,e.tokenManager.getTokens();case 3:t=r.sent.accessToken;case 4:if(n){r.next=8;break}return r.next=7,e.tokenManager.getTokens();case 7:n=r.sent.idToken;case 8:if(t&&un(t)){r.next=10;break}return r.abrupt("return",Promise.reject(new k("getUserInfo requires an access token object")));case 10:if(n&&cn(n)){r.next=12;break}return r.abrupt("return",Promise.reject(new k("getUserInfo requires an ID token object")));case 12:return r.abrupt("return",_e(e,{url:t.userinfoUrl,method:"GET",accessToken:t.accessToken}).then((function(e){return e.sub===n.claims.sub?e:Promise.reject(new k("getUserInfo request was rejected due to token mismatch"))})).catch((function(e){var t;if(e.xhr&&(401===e.xhr.status||403===e.xhr.status)&&(e.xhr.headers&&be(e.xhr.headers.get)&&e.xhr.headers.get("WWW-Authenticate")?t=e.xhr.headers.get("WWW-Authenticate"):be(e.xhr.getResponseHeader)&&(t=e.xhr.getResponseHeader("WWW-Authenticate")),t)){var n=t.match(/error="(.*?)"/)||[],r=t.match(/error_description="(.*?)"/)||[],o=n[1],i=r[1];o&&i&&(e=new w(o,i))}throw e})));case 13:case"end":return r.stop()}}),r)})),new(i||(i=Promise))((function(e,t){function n(e){try{u(a.next(e))}catch(e){t(e)}}function s(e){try{u(a.throw(e))}catch(e){t(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(n,s)}u((a=a.apply(r,o||[])).next())}));var r,o,i,a}function _n(e,t){if(arguments.length>2)return Promise.reject(new k('As of version 3.0, "getWithPopup" takes only a single set of options'));var n=ct("/",t);return t=N(t)||{},Object.assign(t,{display:"popup",responseMode:"okta_post_message",popupWindow:n}),mn(e,t)}var En=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function An(e,t){return En(this,arguments,void 0,z().mark((function n(){var r,o,i,a=arguments;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(a.length>2)){n.next=2;break}return n.abrupt("return",Promise.reject(new k('As of version 3.0, "getWithRedirect" takes only a single set of options')));case 2:return t=N(t)||{},n.next=5,Jt(e,t);case 5:r=n.sent,o=Bt(e,r),i=o.urls.authorizeUrl+Xe(r),e.transactionManager.save(o,{oauth:!0}),e.token.getWithRedirect._setLocation(i);case 10:case"end":return n.stop()}}),n)})))}function Rn(e){var t=e.options.pkce?"query":"fragment";return e.options.responseMode||t}function Pn(e,t){var n,r=(t=ye(t=t||{})?{url:t}:t).url,o=t.responseMode||Rn(e),i=e.token.parseFromUrl._getLocation();if(!(n="query"===o?r?r.substring(r.indexOf("?")):i.search:r?r.substring(r.indexOf("#")):i.hash))throw new k("Unable to parse a token from the url");return Qt(n)}function Cn(e,t){"query"===(t.responseMode||Rn(e))?function(e){var t=e.token.parseFromUrl._getHistory(),n=e.token.parseFromUrl._getDocument(),r=e.token.parseFromUrl._getLocation();t&&t.replaceState?t.replaceState(null,n.title,r.pathname+r.hash):r.search=""}(e):function(e){var t=e.token.parseFromUrl._getHistory(),n=e.token.parseFromUrl._getDocument(),r=e.token.parseFromUrl._getLocation();t&&t.replaceState?t.replaceState(null,n.title,r.pathname+r.search):r.hash=""}(e)}function jn(e,t){return n=this,r=void 0,o=void 0,i=z().mark((function n(){var r,o,i,a;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(t=ye(t=t||{})?{url:t}:t,r=Pn(e,t),o=r.state,i=e.transactionManager.load({oauth:!0,pkce:e.options.pkce,state:o})){n.next=7;break}return n.abrupt("return",Promise.reject(new k("Unable to retrieve OAuth redirect params from storage")));case 7:return a=i.urls,delete i.urls,t.url||Cn(e,t),n.abrupt("return",gn(e,i,r,a).catch((function(t){throw Rt(t)||e.transactionManager.clear({state:o}),t})).then((function(t){return e.transactionManager.clear({state:o}),t})));case 11:case"end":return n.stop()}}),n)})),new(o||(o=Promise))((function(e,t){function a(e){try{u(i.next(e))}catch(e){t(e)}}function s(e){try{u(i.throw(e))}catch(e){t(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(a,s)}u((i=i.apply(n,r||[])).next())}));var n,r,o,i}var In=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[];return e.forEach((function(e){"webauthn"===e.key&&t.push({type:"public-key",id:j(e.credentialId)})})),t},Mn=function(e,t){return{publicKey:{rp:e.rp,user:{id:j(e.user.id),name:e.user.name,displayName:e.user.displayName},challenge:j(e.challenge),pubKeyCredParams:e.pubKeyCredParams,attestation:e.attestation,authenticatorSelection:e.authenticatorSelection,excludeCredentials:In(t)}}},Ln=function(e,t){return{publicKey:{challenge:j(e.challenge),userVerification:e.userVerification,allowCredentials:In(t)}}},Un=function(e){var t=e.response;return{id:e.id,clientData:I(t.clientDataJSON),attestation:I(t.attestationObject)}},Dn=function(e){var t=e.response;return{id:e.id,clientData:I(t.clientDataJSON),authenticatorData:I(t.authenticatorData),signatureData:I(t.signature)}};function Nn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var Fn=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=Nn({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var a in o)o[a]&&(i+="; "+a,!0!==o[a]&&(i+="="+o[a].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+i}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var i=n[o].split("="),a=i.slice(1).join("=");try{var s=decodeURIComponent(i[0]);if(r[s]=t.read(a,s),e===s)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",Nn({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,Nn({},this.attributes,t))},withConverter:function(t){return e(Nn({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),Bn=Fn;function Kn(){return"undefined"!=typeof window?window.console:"undefined"!=typeof console?console:void 0}function Hn(){var e=Kn();return e&&e.log?e:{log:function(){},warn:function(){},group:function(){},groupEnd:function(){}}}function qn(e){Hn().warn("[okta-auth-sdk] WARN: "+e)}function Vn(e){Hn().warn("[okta-auth-sdk] DEPRECATION: "+e)}function Wn(e,t){return function(){return Vn(e),t.apply(null,arguments)}}var zn={getHttpCache:function(){return null},getPKCEStorage:function(){return null},browserHasLocalStorage:function(){try{var e=this.getLocalStorage();return this.testStorage(e)}catch(e){return!1}},browserHasSessionStorage:function(){try{var e=this.getSessionStorage();return this.testStorage(e)}catch(e){return!1}},testStorageType:function(e){var t=!1;switch(e){case"sessionStorage":t=this.browserHasSessionStorage();break;case"localStorage":t=this.browserHasLocalStorage();break;case"cookie":case"memory":t=!0;break;default:t=!1}return t},getStorageByType:function(e,t){var n;switch(e){case"sessionStorage":n=this.getSessionStorage();break;case"localStorage":n=this.getLocalStorage();break;case"cookie":n=this.getCookieStorage(t);break;case"memory":n=this.getInMemoryStorage();break;default:throw new k("Unrecognized storage option: ".concat(e))}return n},findStorageType:function(e){var t,n;return t=(e=e.slice()).shift(),(n=e.length?e[0]:null)?this.testStorageType(t)?t:(qn("This browser doesn't support ".concat(t,". Switching to ").concat(n,".")),this.findStorageType(e)):t},getLocalStorage:function(){return localStorage},getSessionStorage:function(){return sessionStorage},getCookieStorage:function(e){var t=this,n=e.secure,r=e.sameSite,o=e.sessionCookie;if(void 0===n||void 0===r)throw new k('getCookieStorage: "secure" and "sameSite" options must be provided');var i={getItem:this.storage.get,setItem:function(e,i){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"2200-01-01T00:00:00.000Z";a=o?null:a,t.storage.set(e,i,a,{secure:n,sameSite:r})},removeItem:function(e){t.storage.delete(e)}};return e.useSeparateCookies?{getItem:function(e){var t=i.getItem(),n={};return Object.keys(t).forEach((function(r){0===r.indexOf(e)&&(n[r.replace("".concat(e,"_"),"")]=JSON.parse(t[r]))})),JSON.stringify(n)},setItem:function(e,t){var n=JSON.parse(this.getItem(e));t=JSON.parse(t),Object.keys(t).forEach((function(r){var o=e+"_"+r,a=JSON.stringify(t[r]);i.setItem(o,a),delete n[r]})),Object.keys(n).forEach((function(t){i.removeItem(e+"_"+t)}))},removeItem:function(e){var t=JSON.parse(this.getItem(e));Object.keys(t).forEach((function(t){i.removeItem(e+"_"+t)}))}}:i},inMemoryStore:{},getInMemoryStorage:function(){var e=this;return{getItem:function(t){return e.inMemoryStore[t]},setItem:function(t,n){e.inMemoryStore[t]=n}}},testStorage:function(e){var t="okta-test-storage";try{return e.setItem(t,t),e.removeItem(t),!0}catch(e){return!1}},storage:{set:function(e,t,n,r){var o=r.sameSite,i=r.secure;if(void 0===i||void 0===o)throw new k('storage.set: "secure" and "sameSite" options must be provided');var a={path:r.path||"/",secure:i,sameSite:o};return Date.parse(n)&&(a.expires=new Date(n)),Bn.set(e,t,a),this.get(e)},get:function(e){return arguments.length?Bn.get(e):Bn.get()},delete:function(e){return Bn.remove(e,{path:"/"})}}},Gn=zn,Jn=function(){function e(t){s(this,e),this.localOffset=parseInt(t||0)}return V(e,[{key:"now",value:function(){return(Date.now()+this.localOffset)/1e3}}],[{key:"create",value:function(){return new e(0)}}]),e}(),$n=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Yn={autoRenew:!0,autoRemove:!0,syncStorage:!0,clearPendingRemoveTokens:!0,storage:void 0,expireEarlySeconds:30,storageKey:ee,_storageEventDelay:0},Qn="expired",Xn="renewed",Zn="added",er="removed",tr="error",nr=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(s(this,e),this.sdk=t,this.emitter=t.emitter,!this.emitter)throw new k("Emitter should be initialized before TokenManager");n=Object.assign({},Yn,D(n)),bt()&&(n._storageEventDelay=n._storageEventDelay||1e3),Et()||(n.expireEarlySeconds=Yn.expireEarlySeconds),this.options=n;var r=D({storageKey:n.storageKey,secure:n.secure});"object"===l(n.storage)?r.storageProvider=n.storage:n.storage&&(r.storageType=n.storage),this.storage=t.storageManager.getTokenStorage(Object.assign(Object.assign({},r),{useSeparateCookies:!0})),this.clock=Jn.create(),this.state={expireTimeouts:{},renewPromise:null},this.on=this.emitter.on.bind(this.emitter),this.off=this.emitter.off.bind(this.emitter)}return V(e,[{key:"start",value:function(){this.options.clearPendingRemoveTokens&&this.clearPendingRemoveTokens(),this.setExpireEventTimeoutAll()}},{key:"stop",value:function(){this.clearExpireEventTimeoutAll()}},{key:"getOptions",value:function(){return N(this.options)}},{key:"getExpireTime",value:function(e){var t=this.options.expireEarlySeconds||0;return e.expiresAt-t}},{key:"hasExpired",value:function(e){return this.getExpireTime(e)<=this.clock.now()}},{key:"emitExpired",value:function(e,t){this.emitter.emit(Qn,e,t)}},{key:"emitRenewed",value:function(e,t,n){this.emitter.emit(Xn,e,t,n)}},{key:"emitAdded",value:function(e,t){this.emitter.emit(Zn,e,t)}},{key:"emitRemoved",value:function(e,t){this.emitter.emit(er,e,t)}},{key:"emitError",value:function(e){this.emitter.emit(tr,e)}},{key:"emitEventsForCrossTabsStorageUpdate",value:function(e,t){var n=this,r=this.getTokensFromStorageValue(t),o=this.getTokensFromStorageValue(e);Object.keys(o).forEach((function(e){var t=r[e],i=o[e];JSON.stringify(t)!==JSON.stringify(i)&&n.emitAdded(e,i)})),Object.keys(r).forEach((function(e){var t=r[e];o[e]||n.emitRemoved(e,t)}))}},{key:"clearExpireEventTimeout",value:function(e){clearTimeout(this.state.expireTimeouts[e]),delete this.state.expireTimeouts[e],this.state.renewPromise=null}},{key:"clearExpireEventTimeoutAll",value:function(){var e=this.state.expireTimeouts;for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.clearExpireEventTimeout(t)}},{key:"setExpireEventTimeout",value:function(e,t){var n=this;if(!ln(t)){var r=this.getExpireTime(t),o=1e3*Math.max(r-this.clock.now(),0);this.clearExpireEventTimeout(e);var i=setTimeout((function(){n.emitExpired(e,t)}),o);this.state.expireTimeouts[e]=i}}},{key:"setExpireEventTimeoutAll",value:function(){var e=this.storage.getStorage();for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var n=e[t];this.setExpireEventTimeout(t,n)}}},{key:"resetExpireEventTimeoutAll",value:function(){this.clearExpireEventTimeoutAll(),this.setExpireEventTimeoutAll()}},{key:"add",value:function(e,t){var n=this.storage.getStorage();fn(t),n[e]=t,this.storage.setStorage(n),this.emitAdded(e,t),this.setExpireEventTimeout(e,t)}},{key:"getSync",value:function(e){return this.storage.getStorage()[e]}},{key:"get",value:function(e){return $n(this,void 0,void 0,z().mark((function t(){return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.getSync(e));case 1:case"end":return t.stop()}}),t,this)})))}},{key:"getTokensSync",value:function(){var e={},t=this.storage.getStorage();return Object.keys(t).forEach((function(n){var r=t[n];un(r)?e.accessToken=r:cn(r)?e.idToken=r:ln(r)&&(e.refreshToken=r)})),e}},{key:"getTokens",value:function(){return $n(this,void 0,void 0,z().mark((function e(){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.getTokensSync());case 1:case"end":return e.stop()}}),e,this)})))}},{key:"getStorageKeyByType",value:function(e){var t=this.storage.getStorage();return Object.keys(t).filter((function(n){var r=t[n];return un(r)&&"accessToken"===e||cn(r)&&"idToken"===e||ln(r)&&"refreshToken"===e}))[0]}},{key:"getTokenType",value:function(e){if(un(e))return"accessToken";if(cn(e))return"idToken";if(ln(e))return"refreshToken";throw new k("Unknown token type")}},{key:"setTokens",value:function(e,t,n,r){var o=this,i=function(e,i){var a=o.getTokenType(i);"accessToken"===a?t&&t(e,i):"idToken"===a?n&&n(e,i):"refreshToken"===a&&r&&r(e,i)},a=function(e,t){o.emitAdded(e,t),o.setExpireEventTimeout(e,t),i(e,t)},s=function(e,t){o.clearExpireEventTimeout(e),o.emitRemoved(e,t),i(e,t)},u=["idToken","accessToken","refreshToken"],c=this.getTokensSync();u.forEach((function(t){var n=e[t];n&&fn(n,t)}));var l=u.reduce((function(t,n){var r=e[n];return r&&(t[o.getStorageKeyByType(n)||n]=r),t}),{});this.storage.setStorage(l),u.forEach((function(t){var n,r,u,l=e[t],f=c[t],h=o.getStorageKeyByType(t)||t;l&&f?(s(h,f),a(h,l),n=h,r=l,u=f,o.emitRenewed(n,r,u),o.clearExpireEventTimeout(n),o.setExpireEventTimeout(n,r),i(n,r)):l?a(h,l):f&&s(h,f)}))}},{key:"remove",value:function(e){this.clearExpireEventTimeout(e);var t=this.storage.getStorage(),n=t[e];delete t[e],this.storage.setStorage(t),this.emitRemoved(e,n)}},{key:"renewToken",value:function(e){var t;return $n(this,void 0,void 0,z().mark((function n(){return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",null===(t=this.sdk.token)||void 0===t?void 0:t.renew(e));case 1:case"end":return n.stop()}}),n,this)})))}},{key:"validateToken",value:function(e){return fn(e)}},{key:"renew",value:function(e){var t=this;if(this.state.renewPromise)return this.state.renewPromise;try{var n=this.getSync(e);if(!n)throw new k("The tokenManager has no token for the key: "+e)}catch(e){return Promise.reject(e)}return this.clearExpireEventTimeout(e),this.state.renewPromise=this.sdk.token.renewTokens().then((function(e){return t.setTokens(e),e[t.getTokenType(n)]})).catch((function(n){throw t.remove(e),n.tokenKey=e,t.emitError(n),n})).finally((function(){t.state.renewPromise=null})),this.state.renewPromise}},{key:"clear",value:function(){this.clearExpireEventTimeoutAll(),this.storage.clearStorage()}},{key:"clearPendingRemoveTokens",value:function(){var e=this,t=this.getTokensSync();Object.keys(t).forEach((function(n){t[n].pendingRemove&&e.remove(n)}))}},{key:"getTokensFromStorageValue",value:function(e){var t;try{t=JSON.parse(e)||{}}catch(e){t={}}return t}},{key:"updateRefreshToken",value:function(e){var t=this.getStorageKeyByType("refreshToken")||ce,n=this.storage.getStorage();fn(e),n[t]=e,this.storage.setStorage(n)}},{key:"addPendingRemoveFlags",value:function(){var e=this.getTokensSync();Object.keys(e).forEach((function(t){e[t].pendingRemove=!0})),this.setTokens(e)}}]),e}();function rr(e){return function(e){if(Array.isArray(e))return Ze(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||et(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Promise.resolve(!1);var or=Promise.resolve(!0),ir=Promise.resolve();function ar(e,t){return e||(e=0),new Promise((function(n){return setTimeout((function(){return n(t)}),e)}))}function sr(){return Math.random().toString(36).substring(2)}var ur=0,cr=0;function lr(){var e=(new Date).getTime();return e===ur?1e3*e+ ++cr:(ur=e,cr=0,1e3*e)}var fr="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),hr={create:function(e){var t={messagesCallback:null,bc:new BroadcastChannel(e),subFns:[]};return t.bc.onmessage=function(e){t.messagesCallback&&t.messagesCallback(e.data)},t},close:function(e){e.bc.close(),e.subFns=[]},onMessage:function(e,t){e.messagesCallback=t},postMessage:function(e,t){try{return e.bc.postMessage(t,!1),ir}catch(e){return Promise.reject(e)}},canBeUsed:function(){if(fr&&"undefined"==typeof window)return!1;if("function"==typeof BroadcastChannel){if(BroadcastChannel._pubkey)throw new Error("BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill");return!0}return!1},type:"native",averageResponseTime:function(){return 150},microSeconds:lr},dr=function(){function e(e){this.ttl=e,this.set=new Set,this.timeMap=new Map}return e.prototype.has=function(e){return this.set.has(e)},e.prototype.add=function(e){var t=this;this.timeMap.set(e,pr()),this.set.add(e),setTimeout((function(){!function(e){for(var t=pr()-e.ttl,n=e.set[Symbol.iterator]();;){var r=n.next().value;if(!r)return;if(!(e.timeMap.get(r)<t))return;e.timeMap.delete(r),e.set.delete(r)}}(t)}),0)},e.prototype.clear=function(){this.set.clear(),this.timeMap.clear()},e}();function pr(){return(new Date).getTime()}function vr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=JSON.parse(JSON.stringify(e));return void 0===t.webWorkerSupport&&(t.webWorkerSupport=!0),t.idb||(t.idb={}),t.idb.ttl||(t.idb.ttl=45e3),t.idb.fallbackInterval||(t.idb.fallbackInterval=150),e.idb&&"function"==typeof e.idb.onclose&&(t.idb.onclose=e.idb.onclose),t.localstorage||(t.localstorage={}),t.localstorage.removeTimeout||(t.localstorage.removeTimeout=6e4),e.methods&&(t.methods=e.methods),t.node||(t.node={}),t.node.ttl||(t.node.ttl=12e4),t.node.maxParallelWrites||(t.node.maxParallelWrites=2048),void 0===t.node.useFastPath&&(t.node.useFastPath=!0),t}var yr="messages";function gr(){if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof window){if(void 0!==window.mozIndexedDB)return window.mozIndexedDB;if(void 0!==window.webkitIndexedDB)return window.webkitIndexedDB;if(void 0!==window.msIndexedDB)return window.msIndexedDB}return!1}function mr(e){e.closed||br(e).then((function(){return ar(e.options.idb.fallbackInterval)})).then((function(){return mr(e)}))}function br(e){return e.closed?ir:e.messagesCallback?(t=e.db,n=e.lastCursorId,r=t.transaction(yr).objectStore(yr),o=[],new Promise((function(e){(function(){try{var e=IDBKeyRange.bound(n+1,1/0);return r.openCursor(e)}catch(e){return r.openCursor()}}()).onsuccess=function(t){var r=t.target.result;r?r.value.id<n+1?r.continue(n+1):(o.push(r.value),r.continue()):e(o)}}))).then((function(t){var n=t.filter((function(e){return!!e})).map((function(t){return t.id>e.lastCursorId&&(e.lastCursorId=t.id),t})).filter((function(t){return function(e,t){return!(e.uuid===t.uuid||t.eMIs.has(e.id)||e.data.time<t.messagesCallbackTime)}(t,e)})).sort((function(e,t){return e.time-t.time}));return n.forEach((function(t){e.messagesCallback&&(e.eMIs.add(t.id),e.messagesCallback(t.data))})),ir})):ir;var t,n,r,o}var kr={create:function(e,t){return t=vr(t),function(e){var t="pubkey.broadcast-channel-0-"+e,n=gr().open(t,1);return n.onupgradeneeded=function(e){e.target.result.createObjectStore(yr,{keyPath:"id",autoIncrement:!0})},new Promise((function(e,t){n.onerror=function(e){return t(e)},n.onsuccess=function(){e(n.result)}}))}(e).then((function(n){var r={closed:!1,lastCursorId:0,channelName:e,options:t,uuid:sr(),eMIs:new dr(2*t.idb.ttl),writeBlockPromise:ir,messagesCallback:null,readQueuePromises:[],db:n};return n.onclose=function(){r.closed=!0,t.idb.onclose&&t.idb.onclose()},mr(r),r}))},close:function(e){e.closed=!0,e.db.close()},onMessage:function(e,t,n){e.messagesCallbackTime=n,e.messagesCallback=t,br(e)},postMessage:function(e,t){return e.writeBlockPromise=e.writeBlockPromise.then((function(){return function(e,t,n){var r={uuid:t,time:(new Date).getTime(),data:n},o=e.transaction([yr],"readwrite");return new Promise((function(e,t){o.oncomplete=function(){return e()},o.onerror=function(e){return t(e)},o.objectStore(yr).add(r)}))}(e.db,e.uuid,t)})).then((function(){var t,n;0===(0,10,Math.floor(11*Math.random()+0))&&(t=e.db,n=e.options.idb.ttl,function(e,t){var n=(new Date).getTime()-t,r=e.transaction(yr).objectStore(yr),o=[];return new Promise((function(e){r.openCursor().onsuccess=function(t){var r=t.target.result;if(r){var i=r.value;if(!(i.time<n))return void e(o);o.push(i),r.continue()}else e(o)}}))}(t,n).then((function(e){return Promise.all(e.map((function(e){return function(e,t){var n=e.transaction([yr],"readwrite").objectStore(yr).delete(t);return new Promise((function(e){n.onsuccess=function(){return e()}}))}(t,e.id)})))})))})),e.writeBlockPromise},canBeUsed:function(){return!fr&&!!gr()},type:"idb",averageResponseTime:function(e){return 2*e.idb.fallbackInterval},microSeconds:lr};function wr(){var e;if("undefined"==typeof window)return null;try{e=window.localStorage,e=window["ie8-eventlistener/storage"]||window.localStorage}catch(e){}return e}function Tr(e){return"pubkey.broadcastChannel-"+e}function Sr(){if(fr)return!1;var e=wr();if(!e)return!1;try{var t="__broadcastchannel_check";e.setItem(t,"works"),e.removeItem(t)}catch(e){return!1}return!0}var xr={create:function(e,t){if(t=vr(t),!Sr())throw new Error("BroadcastChannel: localstorage cannot be used");var n=sr(),r=new dr(t.localstorage.removeTimeout),o={channelName:e,uuid:n,eMIs:r};return o.listener=function(e,t){var i=Tr(e),a=function(e){var t;e.key===i&&(t=JSON.parse(e.newValue),o.messagesCallback&&t.uuid!==n&&t.token&&!r.has(t.token)&&(t.data.time&&t.data.time<o.messagesCallbackTime||(r.add(t.token),o.messagesCallback(t.data))))};return window.addEventListener("storage",a),a}(e),o},close:function(e){var t;t=e.listener,window.removeEventListener("storage",t)},onMessage:function(e,t,n){e.messagesCallbackTime=n,e.messagesCallback=t},postMessage:function(e,t){return new Promise((function(n){ar().then((function(){var r=Tr(e.channelName),o={token:sr(),time:(new Date).getTime(),data:t,uuid:e.uuid},i=JSON.stringify(o);wr().setItem(r,i);var a=document.createEvent("Event");a.initEvent("storage",!0,!0),a.key=r,a.newValue=i,window.dispatchEvent(a),n()}))}))},canBeUsed:Sr,type:"localstorage",averageResponseTime:function(){var e=navigator.userAgent.toLowerCase();return e.includes("safari")&&!e.includes("chrome")?240:120},microSeconds:lr},Or=lr,_r=new Set,Er={create:function(e){var t={name:e,messagesCallback:null};return _r.add(t),t},close:function(e){_r.delete(e)},onMessage:function(e,t){e.messagesCallback=t},postMessage:function(e,t){return new Promise((function(n){return setTimeout((function(){Array.from(_r).filter((function(t){return t.name===e.name})).filter((function(t){return t!==e})).filter((function(e){return!!e.messagesCallback})).forEach((function(e){return e.messagesCallback(t)})),n()}),5)}))},canBeUsed:function(){return!0},type:"simulate",averageResponseTime:function(){return 5},microSeconds:Or},Ar=[hr,kr,xr],Rr=new Set,Pr=0,Cr=function(e,t){var n,r,o;this.id=Pr++,Rr.add(this),this.name=e,this.options=vr(t),this.method=function(e){var t=[].concat(e.methods,Ar).filter(Boolean);if(e.type){if("simulate"===e.type)return Er;var n=t.find((function(t){return t.type===e.type}));if(n)return n;throw new Error("method-type "+e.type+" not found")}e.webWorkerSupport||fr||(t=t.filter((function(e){return"idb"!==e.type})));var r=t.find((function(e){return e.canBeUsed()}));if(r)return r;throw new Error("No useable method found in "+JSON.stringify(Ar.map((function(e){return e.type}))))}(this.options),this._iL=!1,this._onML=null,this._addEL={message:[],internal:[]},this._uMP=new Set,this._befC=[],this._prepP=null,(o=r=(n=this).method.create(n.name,n.options))&&"function"==typeof o.then?(n._prepP=r,r.then((function(e){n._state=e}))):n._state=r};function jr(e,t,n){var r={time:e.method.microSeconds(),type:t,data:n};return(e._prepP?e._prepP:ir).then((function(){var t=e.method.postMessage(e._state,r);return e._uMP.add(t),t.catch().then((function(){return e._uMP.delete(t)})),t}))}function Ir(e){return e._addEL.message.length>0||e._addEL.internal.length>0}function Mr(e,t,n){e._addEL[t].push(n),function(e){if(!e._iL&&Ir(e)){var t=function(t){e._addEL[t.type].forEach((function(e){var n=e.time-1e5;t.time>=n&&e.fn(t.data)}))},n=e.method.microSeconds();e._prepP?e._prepP.then((function(){e._iL=!0,e.method.onMessage(e._state,t,n)})):(e._iL=!0,e.method.onMessage(e._state,t,n))}}(e)}function Lr(e,t,n){e._addEL[t]=e._addEL[t].filter((function(e){return e!==n})),function(e){if(e._iL&&!Ir(e)){e._iL=!1;var t=e.method.microSeconds();e.method.onMessage(e._state,null,t)}}(e)}Cr._pubkey=!0,Cr.prototype={postMessage:function(e){if(this.closed)throw new Error("BroadcastChannel.postMessage(): Cannot post message after channel has closed "+JSON.stringify(e));return jr(this,"message",e)},postInternal:function(e){return jr(this,"internal",e)},set onmessage(e){var t={time:this.method.microSeconds(),fn:e};Lr(this,"message",this._onML),e&&"function"==typeof e?(this._onML=t,Mr(this,"message",t)):this._onML=null},addEventListener:function(e,t){Mr(this,e,{time:this.method.microSeconds(),fn:t})},removeEventListener:function(e,t){Lr(this,e,this._addEL[e].find((function(e){return e.fn===t})))},close:function(){var e=this;if(!this.closed){Rr.delete(this),this.closed=!0;var t=this._prepP?this._prepP:ir;return this._onML=null,this._addEL.message=[],t.then((function(){return Promise.all(Array.from(e._uMP))})).then((function(){return Promise.all(e._befC.map((function(e){return e()})))})).then((function(){return e.method.close(e._state)}))}},get type(){return this.method.type},get isClosed(){return this.closed}};var Ur=n(643),Dr=n.n(Ur),Nr={add:function(e){if("function"==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope);else{if("function"!=typeof window.addEventListener)return;window.addEventListener("beforeunload",(function(){e()}),!0),window.addEventListener("unload",(function(){e()}),!0)}}},Fr=n(199),Br=n.n(Fr),Kr=Dr()?Br():Nr,Hr=new Set,qr=!1;function Vr(){var e=[];return Hr.forEach((function(t){e.push(t()),Hr.delete(t)})),Promise.all(e)}var Wr=function(e,t){var n=this;this.broadcastChannel=e,this._options=t,this.isLeader=!1,this.hasLeader=!1,this.isDead=!1,this.token=sr(),this._aplQ=ir,this._aplQC=0,this._unl=[],this._lstns=[],this._dpL=function(){},this._dpLC=!1;var r=function(e){"leader"===e.context&&("death"===e.action&&(n.hasLeader=!1),"tell"===e.action&&(n.hasLeader=!0))};this.broadcastChannel.addEventListener("internal",r),this._lstns.push(r)};function zr(e,t){var n={context:"leader",action:t,token:e.token};return e.broadcastChannel.postInternal(n)}Wr.prototype={applyOnce:function(e){var t=this;if(this.isLeader)return ar(0,!0);if(this.isDead)return ar(0,!1);if(this._aplQC>1)return this._aplQ;var n=function(){if(t.isLeader)return or;var n,r=!1,o=new Promise((function(e){n=function(){r=!0,e()}})),i=[],a=function(e){"leader"===e.context&&e.token!=t.token&&(i.push(e),"apply"===e.action&&e.token>t.token&&n(),"tell"===e.action&&(n(),t.hasLeader=!0))};t.broadcastChannel.addEventListener("internal",a);var s=e?4*t._options.responseTime:t._options.responseTime;return zr(t,"apply").then((function(){return Promise.race([ar(s),o.then((function(){return Promise.reject(new Error)}))])})).then((function(){return zr(t,"apply")})).then((function(){return Promise.race([ar(s),o.then((function(){return Promise.reject(new Error)}))])})).catch((function(){})).then((function(){return t.broadcastChannel.removeEventListener("internal",a),!r&&function(e){e.isLeader=!0,e.hasLeader=!0;var t=function(e){if(qr||(qr=!0,Kr.add(Vr)),"function"!=typeof e)throw new Error("Listener is no function");return Hr.add(e),{remove:function(){return Hr.delete(e)},run:function(){return Hr.delete(e),e()}}}((function(){return e.die()}));e._unl.push(t);var n=function(t){"leader"===t.context&&"apply"===t.action&&zr(e,"tell"),"leader"!==t.context||"tell"!==t.action||e._dpLC||(e._dpLC=!0,e._dpL(),zr(e,"tell"))};return e.broadcastChannel.addEventListener("internal",n),e._lstns.push(n),zr(e,"tell")}(t).then((function(){return!0}))}))};return this._aplQC=this._aplQC+1,this._aplQ=this._aplQ.then((function(){return n()})).then((function(){t._aplQC=t._aplQC-1})),this._aplQ.then((function(){return t.isLeader}))},awaitLeadership:function(){return this._aLP||(this._aLP=(e=this).isLeader?ir:new Promise((function(t){var n=!1;function r(){n||(n=!0,e.broadcastChannel.removeEventListener("internal",o),t(!0))}e.applyOnce().then((function(){e.isLeader&&r()})),function t(){return ar(e._options.fallbackInterval).then((function(){if(!e.isDead&&!n)return e.isLeader?void r():e.applyOnce(!0).then((function(){e.isLeader?r():t()}))}))}();var o=function(t){"leader"===t.context&&"death"===t.action&&(e.hasLeader=!1,e.applyOnce().then((function(){e.isLeader&&r()})))};e.broadcastChannel.addEventListener("internal",o),e._lstns.push(o)}))),this._aLP;var e},set onduplicate(e){this._dpL=e},die:function(){var e=this;return this._lstns.forEach((function(t){return e.broadcastChannel.removeEventListener("internal",t)})),this._lstns=[],this._unl.forEach((function(e){return e.remove()})),this._unl=[],this.isLeader&&(this.hasLeader=!1,this.isLeader=!1),this.isDead=!0,zr(this,"death")}};var Gr=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,e),this.started=!1,this.tokenManager=t,this.options=n,this.renewTimeQueue=[],this.onTokenExpiredHandler=this.onTokenExpiredHandler.bind(this)}return V(e,[{key:"shouldThrottleRenew",value:function(){var e=!1;if(this.renewTimeQueue.push(Date.now()),this.renewTimeQueue.length>=10){var t=this.renewTimeQueue.shift();e=this.renewTimeQueue[this.renewTimeQueue.length-1]-t<3e4}return e}},{key:"requiresLeadership",value:function(){return!!this.options.syncStorage&&mt()}},{key:"onTokenExpiredHandler",value:function(e){if(this.options.autoRenew)if(this.shouldThrottleRenew()){var t=new k("Too many token renew requests");this.tokenManager.emitError(t)}else this.tokenManager.renew(e).catch((function(){}));else this.options.autoRemove&&this.tokenManager.remove(e)}},{key:"canStart",value:function(){return!!this.options.autoRenew||!!this.options.autoRemove}},{key:"start",value:function(){this.canStart()&&(this.stop(),this.tokenManager.on(Qn,this.onTokenExpiredHandler),this.started=!0)}},{key:"stop",value:function(){this.started&&(this.tokenManager.off(Qn,this.onTokenExpiredHandler),this.renewTimeQueue=[],this.started=!1)}},{key:"isStarted",value:function(){return this.started}}]),e}(),Jr=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,e),this.started=!1,this.tokenManager=t,this.options=n,this.storageListener=this.storageListener.bind(this)}return V(e,[{key:"storageListener",value:function(e){var t=this,n=e.key,r=e.newValue,o=e.oldValue,i=this.tokenManager.getOptions();(!n||n===i.storageKey&&r!==o)&&(this.syncTimeout=setTimeout((function(){return t.tokenManager.resetExpireEventTimeoutAll(),void t.tokenManager.emitEventsForCrossTabsStorageUpdate(r,o)}),i._storageEventDelay))}},{key:"requiresLeadership",value:function(){return!1}},{key:"isStarted",value:function(){return this.started}},{key:"canStart",value:function(){return!!this.options.syncStorage&&mt()}},{key:"start",value:function(){this.canStart()&&(this.stop(),window.addEventListener("storage",this.storageListener),this.started=!0)}},{key:"stop",value:function(){this.started&&(window.removeEventListener("storage",this.storageListener),clearTimeout(this.syncTimeout),this.started=!1)}}]),e}();function $r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Yr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Yr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Qr=function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,e),this.sdk=t;var o=t.tokenManager.getOptions(),i=o.autoRenew,a=o.autoRemove,u=o.syncStorage;this.options=Object.assign({},e.defaultOptions,{autoRenew:i,autoRemove:a,syncStorage:u},r),this.started=!1,this.services=new Map,this.onLeaderDuplicate=this.onLeaderDuplicate.bind(this),this.onLeader=this.onLeader.bind(this),e.knownServices.forEach((function(e){var t=n.createService(e);t&&n.services.set(e,t)}))}return V(e,[{key:"onLeader",value:function(){this.started&&this.startServices()}},{key:"onLeaderDuplicate",value:function(){}},{key:"isLeader",value:function(){var e;return!!(null===(e=this.elector)||void 0===e?void 0:e.isLeader)}},{key:"hasLeader",value:function(){var e;return null===(e=this.elector)||void 0===e?void 0:e.hasLeader}},{key:"isLeaderRequired",value:function(){return rr(this.services.values()).some((function(e){return e.requiresLeadership()}))}},{key:"start",value:function(){this.started&&this.stop(),this.isLeaderRequired()&&this.startElector(),this.startServices(),this.started=!0}},{key:"stop",value:function(){this.stopElector(),this.stopServices(),this.started=!1}},{key:"getService",value:function(e){return this.services.get(e)}},{key:"startServices",value:function(){var e,t=$r(this.services.values());try{for(t.s();!(e=t.n()).done;){var n=e.value;n.canStart()&&!n.isStarted()&&(!n.requiresLeadership()||this.isLeader())&&n.start()}}catch(e){t.e(e)}finally{t.f()}}},{key:"stopServices",value:function(){var e,t=$r(this.services.values());try{for(t.s();!(e=t.n()).done;)e.value.stop()}catch(e){t.e(e)}finally{t.f()}}},{key:"startElector",value:function(){if(this.stopElector(),e.canUseLeaderElection()){if(!this.channel){var t=this.options.broadcastChannelName;this.channel=new Cr(t)}this.elector||(this.elector=function(e,t){if(e._leaderElector)throw new Error("BroadcastChannel already has a leader-elector");t=function(e,t){return e||(e={}),(e=JSON.parse(JSON.stringify(e))).fallbackInterval||(e.fallbackInterval=3e3),e.responseTime||(e.responseTime=t.method.averageResponseTime(t.options)),e}(t,e);var n=new Wr(e,t);return e._befC.push((function(){return n.die()})),e._leaderElector=n,n}(this.channel),this.elector.onduplicate=this.onLeaderDuplicate,this.elector.awaitLeadership().then(this.onLeader))}}},{key:"stopElector",value:function(){var e,t;this.elector&&(null===(e=this.elector)||void 0===e||e.die(),this.elector=void 0,null===(t=this.channel)||void 0===t||t.close(),this.channel=void 0)}},{key:"createService",value:function(e){var t,n=this.sdk.tokenManager;switch(e){case"autoRenew":t=new Gr(n,Object.assign({},this.options));break;case"syncStorage":t=new Jr(n,Object.assign({},this.options));break;default:throw new Error("Unknown service ".concat(e))}return t}}],[{key:"canUseLeaderElection",value:function(){return mt()}}]),e}();Qr.knownServices=["autoRenew","syncStorage"],Qr.defaultOptions={autoRenew:!0,autoRemove:!0,syncStorage:!0};var Xr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{quiet:!1};s(this,e),this.queue=[],this.running=!1,this.options=t}return V(e,[{key:"push",value:function(e,t){for(var n=this,r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];return new Promise((function(r,i){n.queue.length>0&&!1!==n.options.quiet&&qn("Async method is being called but another async method is already running. The new method will be delayed until the previous method completes."),n.queue.push({method:e,thisObject:t,args:o,resolve:r,reject:i}),n.run()}))}},{key:"run",value:function(){var e=this;if(!this.running&&0!==this.queue.length){this.running=!0;var t=this.queue.shift(),n=t.method.apply(t.thisObject,t.args);ke(n)?n.then(t.resolve,t.reject).finally((function(){e.running=!1,e.run()})):(t.resolve(n),this.running=!1,this.run())}}}]),e}(),Zr=Xr;function eo(e,t){return t=t||{},wt()?new Promise((function(i,a){(r=document.createElement("iframe")).style.display="none",o=function(t){if(t&&t.data&&t.origin===e.getIssuerOrigin()){try{var n=JSON.parse(t.data)}catch(e){return}if(n)return"FingerprintAvailable"===n.type?i(n.fingerprint):void("FingerprintServiceReady"===n.type&&t.source.postMessage(JSON.stringify({type:"GetFingerprint"}),t.origin))}},at(window,"message",o),r.src=e.getIssuerOrigin()+"/auth/services/devicefingerprint",document.body.appendChild(r),n=setTimeout((function(){a(new k("Fingerprinting timed out"))}),(null==t?void 0:t.timeout)||15e3)})).finally((function(){clearTimeout(n),st(window,"message",o),document.body.contains(r)&&r.parentElement.removeChild(r)})):Promise.reject(new k("Fingerprinting is not supported on this device"));var n,r,o}var to=n(615),no=n.n(to),ro=null,oo={updateAuthStatePromise:null,canceledTimes:0},io="authStateChange",ao=function(){function e(t){var n=this;if(s(this,e),!t.emitter)throw new k("Emitter should be initialized before AuthStateManager");this._sdk=t,this._pending=Object.assign({},oo),this._authState=ro,this._logOptions={},this._prevAuthState=null,this._transformQueue=new Zr({quiet:!0}),t.tokenManager.on(Zn,(function(e,t){n._setLogOptions({event:Zn,key:e,token:t}),n.updateAuthState()})),t.tokenManager.on(er,(function(e,t){n._setLogOptions({event:er,key:e,token:t}),n.updateAuthState()}))}return V(e,[{key:"_setLogOptions",value:function(e){this._logOptions=e}},{key:"getAuthState",value:function(){return this._authState}},{key:"getPreviousAuthState",value:function(){return this._prevAuthState}},{key:"updateAuthState",value:function(){return e=this,t=void 0,n=void 0,r=z().mark((function e(){var t,n,r,o,i,a,s,u=this;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this._sdk.options,n=t.transformAuthState,r=t.devMode,o=function(e){var t=u._logOptions,n=t.event,r=t.key,o=t.token;Hn().group("OKTA-AUTH-JS:updateAuthState: Event:".concat(n," Status:").concat(e)),Hn().log(r,o),Hn().log("Current authState",u._authState),Hn().groupEnd(),u._logOptions={}},i=function(e){var t,n;n=e,(t=u._authState)&&t.isAuthenticated===n.isAuthenticated&&JSON.stringify(t.idToken)===JSON.stringify(n.idToken)&&JSON.stringify(t.accessToken)===JSON.stringify(n.accessToken)&&t.error===n.error?r&&o("unchanged"):(u._prevAuthState=u._authState,u._authState=e,u._sdk.emitter.emit(io,Object.assign({},e)),r&&o("emitted"))},a=function e(t){return u._pending.updateAuthStatePromise.then((function(){var n=u._pending.updateAuthStatePromise;return n&&n!==t?e(n):u.getAuthState()}))},!this._pending.updateAuthStatePromise){e.next=11;break}if(!(this._pending.canceledTimes>=10)){e.next=10;break}return r&&o("terminated"),e.abrupt("return",a(this._pending.updateAuthStatePromise));case 10:this._pending.updateAuthStatePromise.cancel();case 11:return s=new(no())((function(e,t,a){a.shouldReject=!1,a((function(){u._pending.updateAuthStatePromise=null,u._pending.canceledTimes=u._pending.canceledTimes+1,r&&o("canceled")}));var c=function(t){s.isCanceled?e():(i(t),e(),u._pending=Object.assign({},oo))};u._sdk.isAuthenticated().then((function(){if(s.isCanceled)e();else{var t=u._sdk.tokenManager.getTokensSync(),r=t.accessToken,o=t.idToken,i=t.refreshToken,a={accessToken:r,idToken:o,refreshToken:i,isAuthenticated:!(!r||!o)};(n?u._transformQueue.push(n,null,u._sdk,a):Promise.resolve(a)).then((function(e){return c(e)})).catch((function(e){return c({accessToken:r,idToken:o,refreshToken:i,isAuthenticated:!1,error:e})}))}}))})),this._pending.updateAuthStatePromise=s,e.abrupt("return",a(s));case 14:case"end":return e.stop()}}),e,this)})),new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}));var e,t,n,r}},{key:"subscribe",value:function(e){this._sdk.emitter.on(io,e)}},{key:"unsubscribe",value:function(e){this._sdk.emitter.off(io,e)}}]),e}(),so=function(){function e(t,n){if(s(this,e),!t)throw new k('"storage" is required');if("string"!=typeof n||!n.length)throw new k('"storageName" is required');this.storageName=n,this.storageProvider=t}return V(e,[{key:"getItem",value:function(e){return this.getStorage()[e]}},{key:"setItem",value:function(e,t){return this.updateStorage(e,t)}},{key:"removeItem",value:function(e){return this.clearStorage(e)}},{key:"getStorage",value:function(){var e=this.storageProvider.getItem(this.storageName);e=e||"{}";try{return JSON.parse(e)}catch(e){throw new k("Unable to parse storage string: "+this.storageName)}}},{key:"setStorage",value:function(e){try{var t=e?JSON.stringify(e):"{}";this.storageProvider.setItem(this.storageName,t)}catch(e){throw new k("Unable to set storage: "+this.storageName)}}},{key:"clearStorage",value:function(e){if(e){var t=this.getStorage();delete t[e],this.setStorage(t)}else this.storageProvider.removeItem?this.storageProvider.removeItem(this.storageName):this.setStorage()}},{key:"updateStorage",value:function(e,t){var n=this.getStorage();n[e]=t,this.setStorage(n)}}]),e}();function uo(e){mt()||e.storageProvider||e.storageProvider||qn("Memory storage can only support simple single user use case on server side, please provide custom storageProvider or storageKey if advanced scenarios need to be supported.")}var co=function(){function e(t,n,r){s(this,e),this.storageManagerOptions=t,this.cookieOptions=n,this.storageUtil=r}return V(e,[{key:"getOptionsForSection",value:function(e,t){return Object.assign({},this.storageManagerOptions[e],t)}},{key:"getStorage",value:function(e){if((e=Object.assign({},this.cookieOptions,e)).storageProvider)return e.storageProvider;var t=e,n=t.storageType,r=t.storageTypes;if("sessionStorage"===n&&(e.sessionCookie=!0),n&&r){var o=r.indexOf(n);o>=0&&(r=r.slice(o),n=void 0)}return n||(n=this.storageUtil.findStorageType(r)),this.storageUtil.getStorageByType(n,e)}},{key:"getTransactionStorage",value:function(e){uo(e=this.getOptionsForSection("transaction",e));var t=this.getStorage(e),n=e.storageKey||re;return new so(t,n)}},{key:"getSharedTansactionStorage",value:function(e){uo(e=this.getOptionsForSection("shared-transaction",e));var t=this.getStorage(e),n=e.storageKey||oe;return new so(t,n)}},{key:"getOriginalUriStorage",value:function(e){uo(e=this.getOptionsForSection("original-uri",e));var t=this.getStorage(e),n=e.storageKey||ie;return new so(t,n)}},{key:"getIdxResponseStorage",value:function(e){var t;if(mt())try{t=this.storageUtil.getStorageByType("memory",e)}catch(e){qn("No response storage found, you may want to provide custom implementation for intermediate idx responses to optimize the network traffic")}else{var n=this.getTransactionStorage(e);n&&(t={getItem:function(e){var t=n.getStorage();return t&&t[e]?t[e]:null},setItem:function(e,t){var r=n.getStorage();if(!r)throw new k("Transaction has been cleared, failed to save idxState");r[e]=t,n.setStorage(r)},removeItem:function(e){var t=n.getStorage();t&&(delete t[e],n.setStorage(t))}})}return t?new so(t,ae):null}},{key:"getTokenStorage",value:function(e){uo(e=this.getOptionsForSection("token",e));var t=this.getStorage(e),n=e.storageKey||ee;return new so(t,n)}},{key:"getHttpCache",value:function(e){e=this.getOptionsForSection("cache",e);var t=this.getStorage(e),n=e.storageKey||te;return new so(t,n)}},{key:"getLegacyPKCEStorage",value:function(e){e=this.getOptionsForSection("legacy-pkce",e);var t=this.getStorage(e),n=e.storageKey||ne;return new so(t,n)}},{key:"getLegacyOAuthParamsStorage",value:function(e){e=this.getOptionsForSection("legacy-oauth-params",e);var t=this.getStorage(e),n=e.storageKey||Q;return new so(t,n)}}]),e}();function lo(e){return e&&e.version}function fo(e){return e&&lo(e.rawIdxState)}function ho(e){var t=e.getSharedTansactionStorage(),n=t.getStorage();Object.keys(n).forEach((function(e){var t=n[e];Date.now()-t.dateCreated>18e5&&delete n[e]})),t.setStorage(n)}function po(e,t,n){var r=e.getSharedTansactionStorage(),o=r.getStorage();o[t]={dateCreated:Date.now(),transaction:n},r.setStorage(o)}function vo(e,t){var n=e.getSharedTansactionStorage().getStorage()[t];return n&&n.transaction&&on(n.transaction)?n.transaction:null}function yo(e,t){var n=e.getSharedTansactionStorage(),r=n.getStorage();delete r[t],n.setStorage(r)}var go=function(){function e(t){s(this,e),this.storageManager=t.storageManager,this.legacyWidgetSupport=!1!==t.legacyWidgetSupport,this.saveNonceCookie=!1!==t.saveNonceCookie,this.saveStateCookie=!1!==t.saveStateCookie,this.saveParamsCookie=!1!==t.saveParamsCookie,this.enableSharedStorage=!1!==t.enableSharedStorage,this.saveLastResponse=!1!==t.saveLastResponse,this.options=t}return V(e,[{key:"clear",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.storageManager.getTransactionStorage(),n=t.getStorage();if(t.clearStorage(),this.clearIdxResponse(),this.enableSharedStorage&&!1!==e.clearSharedStorage){var r=e.state||(null==n?void 0:n.state);r&&yo(this.storageManager,r)}this.legacyWidgetSupport&&(e.oauth&&this.clearLegacyOAuthParams(),e.pkce&&this.clearLegacyPKCE())}},{key:"save",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.storageManager.getTransactionStorage(),r=n.getStorage();if(on(r)&&!t.muteWarning&&qn("a saved auth transaction exists in storage. This may indicate another auth flow is already in progress."),n.setStorage(e),this.enableSharedStorage&&e.state&&po(this.storageManager,e.state,e),t.oauth&&(this.saveNonceCookie||this.saveStateCookie||this.saveParamsCookie)){var o=this.storageManager.getStorage({storageType:"cookie"});if(this.saveParamsCookie){var i=e.responseType,a=e.state,s=e.nonce,u=e.scopes,c=e.clientId,l=e.urls,f=e.ignoreSignature,h={responseType:i,state:a,nonce:s,scopes:u,clientId:c,urls:l,ignoreSignature:f};o.setItem(Q,JSON.stringify(h),null)}this.saveNonceCookie&&e.nonce&&o.setItem(Z,e.nonce,null),this.saveStateCookie&&e.state&&o.setItem(X,e.state,null)}}},{key:"exists",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t=this.load(e);return!!t}catch(e){return!1}}},{key:"load",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.enableSharedStorage&&t.state&&(ho(this.storageManager),on(e=vo(this.storageManager,t.state))))return e;var n=this.storageManager.getTransactionStorage();if(on(e=n.getStorage()))return e;if(!this.legacyWidgetSupport)return null;if(t.oauth)try{var r=this.loadLegacyOAuthParams();Object.assign(e,r)}finally{this.clearLegacyOAuthParams()}if(t.pkce)try{var o=this.loadLegacyPKCE();Object.assign(e,o)}finally{this.clearLegacyPKCE()}return on(e)?e:null}},{key:"clearLegacyPKCE",value:function(){this.storageManager.storageUtil.testStorageType("localStorage")&&this.storageManager.getLegacyPKCEStorage({storageType:"localStorage"}).clearStorage(),this.storageManager.storageUtil.testStorageType("sessionStorage")&&this.storageManager.getLegacyPKCEStorage({storageType:"sessionStorage"}).clearStorage()}},{key:"loadLegacyPKCE",value:function(){var e;if(this.storageManager.storageUtil.testStorageType("localStorage")&&(e=this.storageManager.getLegacyPKCEStorage({storageType:"localStorage"}).getStorage())&&e.codeVerifier)return e;if(this.storageManager.storageUtil.testStorageType("sessionStorage")&&(e=this.storageManager.getLegacyPKCEStorage({storageType:"sessionStorage"}).getStorage())&&e.codeVerifier)return e;throw new k("Could not load PKCE codeVerifier from storage. This may indicate the auth flow has already completed or multiple auth flows are executing concurrently.",void 0)}},{key:"clearLegacyOAuthParams",value:function(){this.storageManager.storageUtil.testStorageType("sessionStorage")&&this.storageManager.getLegacyOAuthParamsStorage({storageType:"sessionStorage"}).clearStorage(),this.storageManager.storageUtil.testStorageType("cookie")&&this.storageManager.getLegacyOAuthParamsStorage({storageType:"cookie"}).clearStorage()}},{key:"loadLegacyOAuthParams",value:function(){var e;if(this.storageManager.storageUtil.testStorageType("sessionStorage")&&(e=this.storageManager.getLegacyOAuthParamsStorage({storageType:"sessionStorage"}).getStorage()),en(e))return e;if(this.storageManager.storageUtil.testStorageType("cookie")&&(e=this.storageManager.getLegacyOAuthParamsStorage({storageType:"cookie"}).getStorage()),en(e))return e;throw new k("Unable to retrieve OAuth redirect params from storage")}},{key:"saveIdxResponse",value:function(e){var t=e.rawIdxResponse,n=e.requestDidSucceed;if(this.saveLastResponse){var r=this.storageManager.getIdxResponseStorage();r&&r.setStorage({rawIdxResponse:t,requestDidSucceed:n})}}},{key:"loadIdxResponse",value:function(){if(!this.saveLastResponse)return null;var e=this.storageManager.getIdxResponseStorage();if(!e)return null;var t=e.getStorage();return t&&lo(t.rawIdxResponse)?t:null}},{key:"clearIdxResponse",value:function(){if(this.saveLastResponse){var e=this.storageManager.getIdxResponseStorage();null==e||e.clearStorage()}}}]),e}();function mo(e){var t=(e=e||{}).scopes;if(t&&!Array.isArray(t))throw new k('scopes must be a array of strings. Required usage: new OktaAuth({scopes: ["openid", "email"]})');var n=e.issuer;if(!n)throw new k('No issuer passed to constructor. Required usage: new OktaAuth({issuer: "https://{yourOktaDomain}.com/oauth2/{authServerId}"})');if(!new RegExp("^http?s?://.+").test(n))throw new k('Issuer must be a valid URL. Required usage: new OktaAuth({issuer: "https://{yourOktaDomain}.com/oauth2/{authServerId}"})');if(-1!==n.indexOf("-admin."))throw new k('Issuer URL passed to constructor contains "-admin" in subdomain. Required usage: new OktaAuth({issuer: "https://{yourOktaDomain}.com})')}var bo=n(98),ko=n.n(bo);function wo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var To=function(e,t,r){var o=r.data,i=r.headers||{};"application/json"===(i["Content-Type"]||i["content-type"]||"")&&o&&"string"!=typeof o&&(o=JSON.stringify(o));var a=(n.g.fetch||ko())(t,{method:e,headers:r.headers,body:o,credentials:r.withCredentials?"include":"omit"});return a.finally||(a=Promise.resolve(a)),a.then((function(e){var t=!e.ok,n=e.status;return function(e){return e.headers.get("Content-Type")&&e.headers.get("Content-Type").toLowerCase().indexOf("application/json")>=0?e.json().catch((function(e){return{error:e,errorSummary:"Could not parse server response"}})):e.text()}(e).then((function(t){return function(e,t,n){var r,o="object"===l(t),i={},a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return wo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wo(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(n.headers.entries());try{for(a.s();!(r=a.n()).done;){var s=r.value;i[s[0]]=s[1]}}catch(e){a.e(e)}finally{a.f()}var u={responseText:o?JSON.stringify(t):t,status:e,headers:i};return o&&(u.responseType="json",u.responseJSON=t),u}(n,t,e)})).then((function(e){var n;if(t||(null===(n=e.responseJSON)||void 0===n?void 0:n.error))throw e;return e}))}))},So=n(321),xo=n.n(So),Oo="function"==typeof xo()?new(xo()):null,_o=function(){function e(t){s(this,e),this.nodeCache=t}return V(e,[{key:"set",value:function(e,t,n){if(Date.parse(n)){var r=(Date.parse(n)-Date.now())/1e3;this.nodeCache.set(e,t,r)}else this.nodeCache.set(e,t);return this.get(e)}},{key:"get",value:function(e){return this.nodeCache.get(e)}},{key:"delete",value:function(e){return this.nodeCache.del(e)}}]),e}(),Eo=new(function(){function e(t){s(this,e),this.nodeCache=t,this.storage=new _o(t)}return V(e,[{key:"testStorageType",value:function(e){var t=!1;return"memory"===e&&(t=!0),t}},{key:"getStorageByType",value:function(e){if("memory"!==e)throw new k("Unrecognized storage option: ".concat(e));return this.getStorage()}},{key:"findStorageType",value:function(){return"memory"}},{key:"getHttpCache",value:function(){return null}},{key:"getStorage",value:function(){var e=this;return{getItem:this.nodeCache.get,setItem:function(t,n){e.nodeCache.set(t,n,"2200-01-01T00:00:00.000Z")}}}}]),e}())(Oo),Ao={token:{storageTypes:["localStorage","sessionStorage","cookie"]},cache:{storageTypes:["localStorage","sessionStorage","cookie"]},transaction:{storageTypes:["sessionStorage","localStorage","cookie"]},"shared-transaction":{storageTypes:["localStorage"]},"original-uri":{storageTypes:["localStorage"]}},Ro={token:{storageTypes:["memory"]},cache:{storageTypes:["memory"]},transaction:{storageTypes:["memory"]}};function Po(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=e.cookies||{};return void 0===n.secure&&(n.secure=t),void 0===n.sameSite&&(n.sameSite=n.secure?"none":"lax"),n.secure&&!t&&(qn('The current page is not being served with the HTTPS protocol.\nFor security reasons, we strongly recommend using HTTPS.\nIf you cannot use HTTPS, set "cookies.secure" option to false.'),n.secure=!1),"none"!==n.sameSite||n.secure||(n.sameSite="lax"),n}function Co(){var e;e=mt()?Object.assign({},Gn,{inMemoryStore:{}}):Eo;var t=mt()?Ao:Ro,n=!!mt();return{devMode:!1,httpRequestClient:To,storageUtil:e,storageManager:t,transactionManager:{enableSharedStorage:n}}}function jo(e,t){return Object.assign({},e,D(t),{storageManager:Object.assign({},e.storageManager,t.storageManager),transactionManager:Object.assign({},e.transactionManager,t.transactionManager)})}var Io={interceptors:{request:new(function(){function e(){s(this,e),this.handlers=[]}return V(e,[{key:"use",value:function(e){this.handlers.push({before:e})}},{key:"clear",value:function(){this.handlers=[]}}]),e}())}},Mo=function(e,t){var n,r,o,i,a=t.method,s=void 0===a?"POST":a,u=t.headers,c=void 0===u?{}:u,l=t.credentials,f=void 0===l?"include":l,h=t.body;return n=void 0,r=void 0,o=void 0,i=z().mark((function t(){var n,r;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n={url:e,method:s,headers:Object.assign({},c),credentials:f,body:h},Io.interceptors&&Io.interceptors.request.handlers.forEach((function(e){e.before(n)})),r=n.url,delete n.url,t.abrupt("return",ko()(r,n));case 5:case"end":return t.stop()}}),t)})),new(o||(o=Promise))((function(e,t){function a(e){try{u(i.next(e))}catch(e){t(e)}}function s(e){try{u(i.throw(e))}catch(e){t(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(a,s)}u((i=i.apply(n,r||[])).next())}))};function Lo(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Uo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Uo(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Uo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Do=function(e){return!1!==e.mutable},No=function(e){var t,n,r={},o=[],i={};if(!e.value)return o.push(e),{defaultParamsForAction:r,neededParamsForAction:o,immutableParamsForAction:i};var a,s=Lo(e.value);try{for(s.s();!(a=s.n()).done;){var u=a.value;Do(u)?(o.push(u),null!==(t=u.value)&&void 0!==t&&t&&(r[u.name]=u.value)):i[u.name]=null!==(n=u.value)&&void 0!==n?n:""}}catch(e){s.e(e)}finally{s.f()}return{defaultParamsForAction:r,neededParamsForAction:o,immutableParamsForAction:i}},Fo=function(e){var t=e.actionDefinition,n=e.defaultParamsForAction,r=void 0===n?{}:n,o=e.immutableParamsForAction,i=void 0===o?{}:o,a=e.toPersist,s=t.href;return function(e){return n=this,o=void 0,u=void 0,c=z().mark((function n(){var o,u,c,l,f,h,d;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o={"content-type":"application/json",accept:t.accepts||"application/ion+json"},u=JSON.stringify(Object.assign(Object.assign(Object.assign({},r),e),i)),c=a&&!1===a.withCredentials?"omit":"include",n.next=5,Mo(s,{method:t.method,headers:o,body:u,credentials:c});case 5:return l=n.sent,n.next=8,l.json();case 8:if(f=n.sent,h=l.ok,d=ui(f,a,h),401===l.status&&'Oktadevicejwt realm="Okta Device"'===l.headers.get("WWW-Authenticate")&&(d.stepUp=!0),h){n.next=14;break}throw d;case 14:return n.abrupt("return",d);case 15:case"end":return n.stop()}}),n)})),new(u||(u=Promise))((function(e,t){function r(e){try{a(c.next(e))}catch(e){t(e)}}function i(e){try{a(c.throw(e))}catch(e){t(e)}}function a(t){var n;t.done?e(t.value):(n=t.value,n instanceof u?n:new u((function(e){e(n)}))).then(r,i)}a((c=c.apply(n,o||[])).next())}));var n,o,u,c}},Bo=function(e,t){var n=Fo,r=function(e){var t,n=[],r={},o={},i=Lo(e=Array.isArray(e)?e:[e]);try{for(i.s();!(t=i.n()).done;){var a=t.value,s=No(a),u=s.defaultParamsForAction,c=s.neededParamsForAction,l=s.immutableParamsForAction;n.push(c),r[a.name]=u,o[a.name]=l}}catch(e){i.e(e)}finally{i.f()}return{defaultParams:r,neededParams:n,immutableParams:o}}(e),o=r.defaultParams,i=r.neededParams,a=r.immutableParams,s=n({actionDefinition:e,defaultParamsForAction:o[e.name],immutableParamsForAction:a[e.name],toPersist:t});return s.neededParams=i,s};function Ko(e){return Ko="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ko(e)}function Ho(e){return Ho=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ho(e)}function qo(e,t){return qo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},qo(e,t)}function Vo(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function Wo(e,t,n){return Wo=Vo()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&qo(o,n.prototype),o},Wo.apply(null,arguments)}function zo(e){var t="function"==typeof Map?new Map:void 0;return zo=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return Wo(e,arguments,Ho(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),qo(r,e)},zo(e)}function Go(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Jo(e){return function(e){if(Array.isArray(e))return Yo(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||$o(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $o(e,t){if(e){if("string"==typeof e)return Yo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yo(e,t):void 0}}function Yo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Qo=Object.prototype.hasOwnProperty;function Xo(e,t){return(e=e.slice()).push(t),e}function Zo(e,t){return(t=t.slice()).unshift(e),t}var ei=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&qo(e,t)}(o,e);var t,n,r=(t=o,n=Vo(),function(){var e,r=Ho(t);if(n){var o=Ho(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Go(this,e)});function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=r.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)')).avoidNew=!0,t.value=e,t.name="NewError",t}return o}(zo(Error));function ti(e,t,n,r,o){if(!(this instanceof ti))try{return new ti(e,t,n,r,o)}catch(e){if(!e.avoidNew)throw e;return e.value}"string"==typeof e&&(o=r,r=n,n=t,t=e,e=null);var i=e&&"object"===Ko(e);if(e=e||{},this.json=e.json||n,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=!Qo.call(e,"wrap")||e.wrap,this.sandbox=e.sandbox||{},this.preventEval=e.preventEval||!1,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||r||null,this.otherTypeCallback=e.otherTypeCallback||o||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},!1!==e.autostart){var a={path:i?e.path:t};i?"json"in e&&(a.json=e.json):a.json=n;var s=this.evaluate(a);if(!s||"object"!==Ko(s))throw new ei(s);return s}}ti.prototype.evaluate=function(e,t,n,r){var o=this,i=this.parent,a=this.parentProperty,s=this.flatten,u=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,n=n||this.callback,this.currOtherTypeCallback=r||this.otherTypeCallback,t=t||this.json,(e=e||this.path)&&"object"===Ko(e)&&!Array.isArray(e)){if(!e.path&&""!==e.path)throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!Qo.call(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');t=e.json,s=Qo.call(e,"flatten")?e.flatten:s,this.currResultType=Qo.call(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=Qo.call(e,"sandbox")?e.sandbox:this.currSandbox,u=Qo.call(e,"wrap")?e.wrap:u,this.currPreventEval=Qo.call(e,"preventEval")?e.preventEval:this.currPreventEval,n=Qo.call(e,"callback")?e.callback:n,this.currOtherTypeCallback=Qo.call(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,i=Qo.call(e,"parent")?e.parent:i,a=Qo.call(e,"parentProperty")?e.parentProperty:a,e=e.path}if(i=i||null,a=a||null,Array.isArray(e)&&(e=ti.toPathString(e)),(e||""===e)&&t){var c=ti.toPathArray(e);"$"===c[0]&&c.length>1&&c.shift(),this._hasParentSelector=null;var l=this._trace(c,t,["$"],i,a,n).filter((function(e){return e&&!e.isParentSelector}));return l.length?u||1!==l.length||l[0].hasArrExpr?l.reduce((function(e,t){var n=o._getPreferredOutput(t);return s&&Array.isArray(n)?e=e.concat(n):e.push(n),e}),[]):this._getPreferredOutput(l[0]):u?[]:void 0}},ti.prototype._getPreferredOutput=function(e){var t=this.currResultType;switch(t){case"all":var n=Array.isArray(e.path)?e.path:ti.toPathArray(e.path);return e.pointer=ti.toPointer(n),e.path="string"==typeof e.path?e.path:ti.toPathString(e.path),e;case"value":case"parent":case"parentProperty":return e[t];case"path":return ti.toPathString(e[t]);case"pointer":return ti.toPointer(e.path);default:throw new TypeError("Unknown result type")}},ti.prototype._handleCallback=function(e,t,n){if(t){var r=this._getPreferredOutput(e);e.path="string"==typeof e.path?e.path:ti.toPathString(e.path),t(r,n,e)}},ti.prototype._trace=function(e,t,n,r,o,i,a,s){var u,c=this;if(!e.length)return u={path:n,value:t,parent:r,parentProperty:o,hasArrExpr:a},this._handleCallback(u,i,"value"),u;var l=e[0],f=e.slice(1),h=[];function d(e){Array.isArray(e)?e.forEach((function(e){h.push(e)})):h.push(e)}if(("string"!=typeof l||s)&&t&&Qo.call(t,l))d(this._trace(f,t[l],Xo(n,l),t,l,i,a));else if("*"===l)this._walk(l,f,t,n,r,o,i,(function(e,t,n,r,o,i,a,s){d(c._trace(Zo(e,n),r,o,i,a,s,!0,!0))}));else if(".."===l)d(this._trace(f,t,n,r,o,i,a)),this._walk(l,f,t,n,r,o,i,(function(e,t,n,r,o,i,a,s){"object"===Ko(r[e])&&d(c._trace(Zo(t,n),r[e],Xo(o,e),r,e,s,!0))}));else{if("^"===l)return this._hasParentSelector=!0,{path:n.slice(0,-1),expr:f,isParentSelector:!0};if("~"===l)return u={path:Xo(n,l),value:o,parent:r,parentProperty:null},this._handleCallback(u,i,"property"),u;if("$"===l)d(this._trace(f,t,n,null,null,i,a));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(l))d(this._slice(l,f,t,n,r,o,i));else if(0===l.indexOf("?(")){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");this._walk(l,f,t,n,r,o,i,(function(e,t,n,r,o,i,a,s){c._eval(t.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1"),r[e],e,o,i,a)&&d(c._trace(Zo(e,n),r,o,i,a,s,!0))}))}else if("("===l[0]){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");d(this._trace(Zo(this._eval(l,t,n[n.length-1],n.slice(0,-1),r,o),f),t,n,r,o,i,a))}else if("@"===l[0]){var p=!1,v=l.slice(1,-2);switch(v){case"scalar":t&&["object","function"].includes(Ko(t))||(p=!0);break;case"boolean":case"string":case"undefined":case"function":Ko(t)===v&&(p=!0);break;case"integer":!Number.isFinite(t)||t%1||(p=!0);break;case"number":Number.isFinite(t)&&(p=!0);break;case"nonFinite":"number"!=typeof t||Number.isFinite(t)||(p=!0);break;case"object":t&&Ko(t)===v&&(p=!0);break;case"array":Array.isArray(t)&&(p=!0);break;case"other":p=this.currOtherTypeCallback(t,n,r,o);break;case"null":null===t&&(p=!0);break;default:throw new TypeError("Unknown value type "+v)}if(p)return u={path:n,value:t,parent:r,parentProperty:o},this._handleCallback(u,i,"value"),u}else if("`"===l[0]&&t&&Qo.call(t,l.slice(1))){var y=l.slice(1);d(this._trace(f,t[y],Xo(n,y),t,y,i,a,!0))}else if(l.includes(",")){var g,m=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=$o(e))){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(l.split(","));try{for(m.s();!(g=m.n()).done;){var b=g.value;d(this._trace(Zo(b,f),t,n,r,o,i,!0))}}catch(e){m.e(e)}finally{m.f()}}else!s&&t&&Qo.call(t,l)&&d(this._trace(f,t[l],Xo(n,l),t,l,i,a,!0))}if(this._hasParentSelector)for(var k=0;k<h.length;k++){var w=h[k];if(w&&w.isParentSelector){var T=this._trace(w.expr,t,w.path,r,o,i,a);if(Array.isArray(T)){h[k]=T[0];for(var S=T.length,x=1;x<S;x++)k++,h.splice(k,0,T[x])}else h[k]=T}}return h},ti.prototype._walk=function(e,t,n,r,o,i,a,s){if(Array.isArray(n))for(var u=n.length,c=0;c<u;c++)s(c,e,t,n,r,o,i,a);else n&&"object"===Ko(n)&&Object.keys(n).forEach((function(u){s(u,e,t,n,r,o,i,a)}))},ti.prototype._slice=function(e,t,n,r,o,i,a){if(Array.isArray(n)){var s=n.length,u=e.split(":"),c=u[2]&&Number.parseInt(u[2])||1,l=u[0]&&Number.parseInt(u[0])||0,f=u[1]&&Number.parseInt(u[1])||s;l=l<0?Math.max(0,l+s):Math.min(s,l),f=f<0?Math.max(0,f+s):Math.min(s,f);for(var h=[],d=l;d<f;d+=c)this._trace(Zo(d,t),n,r,o,i,a,!0).forEach((function(e){h.push(e)}));return h}},ti.prototype._eval=function(e,t,n,r,o,i){e.includes("@parentProperty")&&(this.currSandbox._$_parentProperty=i,e=e.replace(/@parentProperty/g,"_$_parentProperty")),e.includes("@parent")&&(this.currSandbox._$_parent=o,e=e.replace(/@parent/g,"_$_parent")),e.includes("@property")&&(this.currSandbox._$_property=n,e=e.replace(/@property/g,"_$_property")),e.includes("@path")&&(this.currSandbox._$_path=ti.toPathString(r.concat([n])),e=e.replace(/@path/g,"_$_path")),e.includes("@root")&&(this.currSandbox._$_root=this.json,e=e.replace(/@root/g,"_$_root")),/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/.test(e)&&(this.currSandbox._$_v=t,e=e.replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1"));try{return this.vm.runInNewContext(e,this.currSandbox)}catch(t){throw console.log(t),new Error("jsonPath: "+t.message+": "+e)}},ti.cache={},ti.toPathString=function(e){for(var t=e,n=t.length,r="$",o=1;o<n;o++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[o])||(r+=/^[\*0-9]+$/.test(t[o])?"["+t[o]+"]":"['"+t[o]+"']");return r},ti.toPointer=function(e){for(var t=e,n=t.length,r="",o=1;o<n;o++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[o])||(r+="/"+t[o].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return r},ti.toPathArray=function(e){var t=ti.cache;if(t[e])return t[e].concat();var n=[],r=e.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,(function(e,t){return"[#"+(n.push(t)-1)+"]"})).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,(function(e,t){return"['"+t.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"})).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,(function(e,t){return";"+t.split("").join(";")+";"})).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,"").split(";").map((function(e){var t=e.match(/#([0-9]+)/);return t&&t[1]?n[t[1]]:e}));return t[e]=r,t[e].concat()},ti.prototype.vm={runInNewContext:function(e,t){var n=Object.keys(t),r=[];!function(e,n,r){for(var o=e.length,i=0;i<o;i++)a=e[i],"function"==typeof t[a]&&n.push(e.splice(i--,1)[0]);var a}(n,r);var o=n.map((function(e,n){return t[e]})),i=r.reduce((function(e,n){var r=t[n].toString();return/function/.test(r)||(r="function "+r),"var "+n+"="+r+";"+e}),"");/(["'])use strict\1/.test(e=i+e)||n.includes("arguments")||(e="var arguments = undefined;"+e);var a=(e=e.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"")).lastIndexOf(";"),s=a>-1?e.slice(0,a+1)+" return "+e.slice(a+1):" return "+e;return Wo(Function,Jo(n).concat([s])).apply(void 0,Jo(o))}};var ni=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},ri=Object.fromEntries(["remediation","context"].map((function(e){return[e,!0]}))),oi=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},r={};return Object.keys(e).filter((function(e){return!ri[e]})).forEach((function(o){if("object"===l(e[o])&&e[o])if(e[o].rel)n[e[o].name]=Bo(e[o],t);else{var i=e[o],a=i.value,s=i.type,u=ni(i,["value","type"]);r[o]=Object.assign({type:s},u),"object"===s?(r[o].value={},Object.entries(a).forEach((function(e){var i=tt(e,2),a=i[0],s=i[1];s.rel?n["".concat(o,"-").concat(a.name||a)]=Bo(s,t):r[o].value[a]=s}))):r[o].value=a}else r[o]=e[o]})),{context:r,actions:n}},ii=function e(t,n){Object.keys(n).forEach((function(r){if("relatesTo"===r){var o=Array.isArray(n[r])?n[r][0]:n[r];if("string"==typeof o){var i=ti({path:o,json:t})[0];if(i)return void(n[r]=i)}}Array.isArray(n[r])&&n[r].forEach((function(n){return e(t,n)}))}))},ai=function(e,t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.fromEntries(e.map((function(e){return[e.name,Bo(e,t)]})))}([e],t),r=n[e.name];return Object.assign(Object.assign({},e),{action:r})},si=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function ui(e,t,n){var r,o,i,a=e,s=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(null===(t=e.remediation)||void 0===t?void 0:t.value)||[];r.forEach((function(t){return ii(e,t)}));var o=r.map((function(e){return ai(e,n)})),i=oi(e,n),a=i.context,s=i.actions;return{remediations:o,context:a,actions:s}}(e,t),u=s.remediations,c=s.context,l=s.actions;return{proceed:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return si(this,void 0,void 0,z().mark((function n(){var r;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=u.find((function(t){return t.name===e}))){n.next=3;break}return n.abrupt("return",Promise.reject("Unknown remediation choice: [".concat(e,"]")));case 3:return n.abrupt("return",r.action(t));case 4:case"end":return n.stop()}}),n)})))},neededToProceed:rr(u),actions:l,context:c,rawIdxState:a,interactionCode:null===(i=null===(o=null===(r=a.successWithInteractionCode)||void 0===r?void 0:r.value)||void 0===o?void 0:o.find((function(e){return"interaction_code"===e.name})))||void 0===i?void 0:i.value,toPersist:t,requestDidSucceed:n}}var ci={makeIdxState:ui},li=function(e){switch(e){case"1.0.0":return ci;case void 0:case null:throw new Error("Api version is required");default:throw new Error("Unknown api version: ".concat(e,". Use an exact semver version."))}};function fi(e){if(!e)throw new Error("version is required");if((null!=e?e:"").replace(/[^0-9a-zA-Z._-]/,"")!==e||!e)throw new Error("invalid version supplied - version is required and uses semver syntax");li(e)}var hi=function(e){return e.json().then((function(e){return Promise.reject(e)}))},di="1.0.0",pi={introspect:function(e){var t,n,r,o,i=e.withCredentials,a=e.domain,s=e.interactionHandle,u=e.stateHandle,c=e.version;return t=this,n=void 0,r=void 0,o=z().mark((function e(){var t,n,r,o,l,f,h;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return fi(c),t="".concat(a,"/idp/idx/introspect"),n=u?{stateToken:u}:{interactionHandle:s},r={"content-type":"application/ion+json; okta-version=".concat(c),accept:"application/ion+json; okta-version=".concat(c)},o=!1===i?"omit":"include",e.next=7,Mo(t,{credentials:o,headers:r,body:JSON.stringify(n)});case 7:return l=e.sent,f=l.ok,e.next=11,l.json();case 11:if(h=e.sent,f){e.next=14;break}throw h;case 14:return e.abrupt("return",h);case 15:case"end":return e.stop()}}),e)})),new(r||(r=Promise))((function(e,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,s)}u((o=o.apply(t,n||[])).next())}))},interact:function(e){var t,n,r,o,i=e.withCredentials,a=e.clientId,s=e.baseUrl,u=e.scopes,c=void 0===u?["openid","email"]:u,l=e.redirectUri,f=e.codeChallenge,h=e.codeChallengeMethod,d=e.state,p=e.activationToken,v=e.recoveryToken,y=e.clientSecret;return t=this,n=void 0,r=void 0,o=z().mark((function e(){var t,n,r,o,u;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="".concat(s,"/v1/interact"),n={client_id:a,scope:c.join(" "),redirect_uri:l,code_challenge:f,code_challenge_method:h,state:d},p&&(n.activation_token=p),v&&(n.recovery_token=v),y&&(n.client_secret=y),r=Object.entries(n).map((function(e){var t=tt(e,2),n=t[0],r=t[1];return"".concat(n,"=").concat(encodeURIComponent(r))})).join("&"),o={"content-type":"application/x-www-form-urlencoded"},u=!1===i?"omit":"include",e.abrupt("return",Mo(t,{credentials:u,headers:o,body:r}).then((function(e){return e.ok?e.json():hi(e)})).then((function(e){return e.interaction_handle})));case 9:case"end":return e.stop()}}),e)})),new(r||(r=Promise))((function(e,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,s)}u((o=o.apply(t,n||[])).next())}))},makeIdxState:li(di).makeIdxState,client:Io,LATEST_SUPPORTED_IDX_API_VERSION:di},vi=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function yi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return vi(this,void 0,void 0,z().mark((function n(){var r,o,i,a,s,u,c,l,f,h,d,p;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.token.prepareTokenParams(t);case 2:return r=n.sent,o=Bt(e,r),i=Object.assign(Object.assign({},e.options),t),a=i.flow,s=void 0===a?"default":a,u=i.withCredentials,c=void 0===u||u,l=i.activationToken,f=void 0===l?void 0:l,h=i.recoveryToken,d=void 0===h?void 0:h,p=Object.assign(Object.assign({},o),{flow:s,withCredentials:c,activationToken:f,recoveryToken:d}),n.abrupt("return",p);case 7:case"end":return n.stop()}}),n)})))}function gi(e,t){var n=mi(e,t);return!!(null==n?void 0:n.interactionHandle)}function mi(e,t){var n;t=D(t),t=Object.assign(Object.assign({},e.options),t);try{n=e.transactionManager.load(t)}catch(e){}if(n)return Ti(n,t)?n:void qn("Saved transaction meta does not match the current configuration. This may indicate that two apps are sharing a storage key.")}function bi(e,t){return vi(this,void 0,void 0,z().mark((function n(){var r;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(t=D(t),t=Object.assign(Object.assign({},e.options),t),!(r=mi(e,t))){n.next=5;break}return n.abrupt("return",r);case 5:return n.abrupt("return",yi(e,t));case 6:case"end":return n.stop()}}),n)})))}function ki(e,t){e.transactionManager.save(t,{muteWarning:!0})}function wi(e){e.transactionManager.clear()}function Ti(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=["issuer","clientId","redirectUri","state","codeChallenge","codeChallengeMethod","activationToken","recoveryToken"];if(!1===xi(e,t,n))return!1;var r=t.flow;return!1!==Si(e,r)}function Si(e,t){return!(t&&"default"!==t&&"proceed"!==t)||t===e.flow}function xi(e,t,n){return!n.some((function(n){var r=t[n];if(r&&r!==e[n])return!0}))}var Oi=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function _i(e){return{meta:e,interactionHandle:e.interactionHandle,state:e.state}}function Ei(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Oi(this,void 0,void 0,z().mark((function n(){var r,o,i,a,s,u,c,l,f,h,d,p,v,y,g;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(t=D(t),!(null==(r=mi(e,t))?void 0:r.interactionHandle)){n.next=4;break}return n.abrupt("return",_i(r));case 4:return n.next=6,yi(e,Object.assign(Object.assign({},r),t));case 6:return r=n.sent,o=pt(e),a=(i=r).clientId,s=i.redirectUri,u=i.state,c=i.scopes,l=i.withCredentials,f=i.codeChallenge,h=i.codeChallengeMethod,d=i.activationToken,p=i.recoveryToken,v=t.clientSecret||e.options.clientSecret,n.next=12,pi.interact({withCredentials:l,clientId:a,baseUrl:o,scopes:c,state:u,redirectUri:s,codeChallenge:f,codeChallengeMethod:h,activationToken:d,recoveryToken:p,clientSecret:v});case 12:return y=n.sent,g=Object.assign(Object.assign({},r),{interactionHandle:y,withCredentials:l,state:u,scopes:c,recoveryToken:p,activationToken:d}),ki(e,g),n.abrupt("return",_i(g));case 16:case"end":return n.stop()}}),n)})))}var Ai=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function Ri(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ai(this,void 0,void 0,z().mark((function n(){var r,o,i,a,s,u;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if((i=e.transactionManager.loadIdxResponse())&&(r=i.rawIdxResponse,o=i.requestDidSucceed),r){n.next=20;break}return a=t.version||pe,s=vt(e),n.prev=5,n.next=8,pi.introspect(Object.assign(Object.assign({domain:s},t),{version:a}));case 8:r=n.sent,o=!0,n.next=20;break;case 12:if(n.prev=12,n.t0=n.catch(5),!lo(n.t0)){n.next=19;break}r=n.t0,o=!1,n.next=20;break;case 19:throw n.t0;case 20:return u=t.withCredentials,n.abrupt("return",pi.makeIdxState(r,{withCredentials:u},o));case 22:case"end":return n.stop()}}),n,null,[[5,12]])})))}function Pi(e){return e.charAt(0).toUpperCase()+e.substring(1)}function Ci(e){return e.value.find((function(e){return"authenticator"===e.name}))}function ji(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ii(e){var t;if(an(e))t=e;else{if("string"!=typeof e)throw new Error("Invalid format for authenticator");t={key:e}}return t}function Mi(e,t){return!!(e&&t&&(e.id&&t.id?e.id===t.id:e.key&&t.key&&e.key===t.key))}function Li(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ui=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};s(this,e),this.values=Object.assign({},n),this.options=Object.assign({},r),this.formatAuthenticators(),this.remediation=t}return V(e,[{key:"formatAuthenticators",value:function(){if(this.values.authenticators=this.values.authenticators||[],this.values.authenticators=this.values.authenticators.map((function(e){return Ii(e)})),this.values.authenticator){var e=Ii(this.values.authenticator);this.values.authenticators.some((function(t){return Mi(e,t)}))||this.values.authenticators.push(e)}this.values.authenticatorsData=this.values.authenticators.reduce((function(e,t){return"object"===l(t)&&Object.keys(t).length>1&&e.push(t),e}),this.values.authenticatorsData||[])}},{key:"getName",value:function(){return this.remediation.name}},{key:"canRemediate",value:function(){var e,t,n=this;return!(e=this.remediation,null===(t=e.value)||void 0===t?void 0:t.reduce((function(e,t){return t.required&&e.push(t.name),e}),[])).find((function(e){return!n.hasData(e)}))}},{key:"getData",value:function(e){var t,n,r=this;if(!e){var o=(t=this.remediation,null===(n=t.value)||void 0===n?void 0:n.map((function(e){return e.name}))).reduce((function(e,t){return e[t]=r.getData(t),e}),{});return o}if("function"==typeof this["map".concat(Pi(e))]){var i=this["map".concat(Pi(e))](this.remediation.value.find((function(t){return t.name===e})));if(i)return i}if(this.map&&this.map[e])for(var a=this.map[e],s=0;s<a.length;s++){var u=this.values[a[s]];if(u)return u}return this.values[e]}},{key:"hasData",value:function(e){return!!this.getData(e)}},{key:"getNextStep",value:function(e){var t=this.getName(),n=this.getInputs(),r=this.getAuthenticator(),o=null==r?void 0:r.type;return Object.assign(Object.assign({name:t,inputs:n},o&&{type:o}),r&&{authenticator:r})}},{key:"getInputs",value:function(){var e=this,t=[];return(this.remediation.value||[]).forEach((function(n){var r,o=n.name,i=n.type;if(!1!==n.visible){if("function"==typeof e["getInput".concat(Pi(o))])r=e["getInput".concat(Pi(o))](n);else if("object"!==i){var a,s=(e.map?e.map[o]:null)||[];a=1===s.length?s[0]:s.find((function(t){return Object.keys(e.values).includes(t)})),a&&(r=Object.assign(Object.assign({},n),{name:a}))}r||(r=n),Array.isArray(r)?r.forEach((function(e){return t.push(e)})):t.push(r)}})),t}},{key:"getValuesAfterProceed",value:function(){var e,t=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Li(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Li(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(this.getInputs());try{for(t.s();!(e=t.n()).done;){var n=e.value;delete this.values[n.name]}}catch(e){t.e(e)}finally{t.f()}return this.values}},{key:"getAuthenticator",value:function(){var e,t,n=null===(e=this.remediation.relatesTo)||void 0===e?void 0:e.value;if(n){var r=Ci(this.remediation);if(!r)return n;var o=r.form.value.find((function(e){return"id"===e.name})).value,i=null===(t=r.form.value.find((function(e){return"enrollmentId"===e.name})))||void 0===t?void 0:t.value;return Object.assign(Object.assign({},n),{id:o,enrollmentId:i})}}}],[{key:"getMessages",value:function(e){var t,n;if(e.value)return null===(n=null===(t=e.value[0])||void 0===t?void 0:t.form)||void 0===n?void 0:n.value.reduce((function(e,t){return t.messages&&(e=[].concat(rr(e),rr(t.messages.value))),e}),[])}}]),e}();function Di(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ni(e,t,n){return Ni="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=d(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}},Ni(e,t,n||e)}var Fi=function e(t){s(this,e),this.meta=t};var Bi=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canVerify",value:function(e){return!!(e.credentials||e.verificationCode||e.otp)}},{key:"mapCredentials",value:function(e){var t=e.credentials,n=e.verificationCode,r=e.otp;if(t||n||r)return t||{passcode:n||r}}},{key:"getInputs",value:function(e){var t;return Object.assign(Object.assign({},null===(t=e.form)||void 0===t?void 0:t.value[0]),{name:"verificationCode",type:"string",required:e.required})}}]),o}(Fi);var Ki=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"mapCredentials",value:function(e){var t=e.verificationCode;if(t)return{totp:t}}}]),o}(Bi);var Hi=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canVerify",value:function(e){return!(!e.credentials&&!e.password)}},{key:"mapCredentials",value:function(e){var t=e.credentials,n=e.password;if(t||n)return t||{passcode:n}}},{key:"getInputs",value:function(e){var t;return Object.assign(Object.assign({},null===(t=e.form)||void 0===t?void 0:t.value[0]),{name:"password",type:"string",required:e.required})}}]),o}(Fi);var qi=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canVerify",value:function(e){var t=e.credentials;if(t&&t.questionKey&&t.answer)return!0;var n=e.questionKey,r=e.question,o=e.answer;return!(!n||!o)||!(!r||!o)}},{key:"mapCredentials",value:function(e){var t=e.questionKey,n=e.question,r=e.answer;if(t||n||r)return{questionKey:n?"custom":t,question:n,answer:r}}},{key:"getInputs",value:function(){return[{name:"questionKey",type:"string",required:!0},{name:"question",type:"string",label:"Create a security question"},{name:"answer",type:"string",label:"Answer",required:!0}]}}]),o}(Fi);var Vi=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canVerify",value:function(e){return!!e.answer}},{key:"mapCredentials",value:function(e){var t=e.answer;if(t)return{questionKey:this.meta.contextualData.enrolledQuestion.questionKey,answer:t}}},{key:"getInputs",value:function(){return[{name:"answer",type:"string",label:"Answer",required:!0}]}}]),o}(Fi);var Wi=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canVerify",value:function(e){var t=e.clientData,n=e.attestation;return!(!t||!n)}},{key:"mapCredentials",value:function(e){var t=e.clientData,n=e.attestation;if(t||n)return{clientData:t,attestation:n}}},{key:"getInputs",value:function(){return[{name:"clientData",type:"string",required:!0,visible:!1,label:"Client Data"},{name:"attestation",type:"string",required:!0,visible:!1,label:"Attestation"}]}}]),o}(Fi);var zi=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canVerify",value:function(e){var t=e.clientData,n=e.authenticatorData,r=e.signatureData;return!!(t&&n&&r)}},{key:"mapCredentials",value:function(e){var t=e.authenticatorData,n=e.clientData,r=e.signatureData;if(t||n||r)return{authenticatorData:t,clientData:n,signatureData:r}}},{key:"getInputs",value:function(){return[{name:"authenticatorData",type:"string",label:"Authenticator Data",required:!0,visible:!1},{name:"clientData",type:"string",label:"Client Data",required:!0,visible:!1},{name:"signatureData",type:"string",label:"Signature Data",required:!0,visible:!1}]}}]),o}(Fi);function Gi(e){var t,n,r=e.relatesTo,o=(null==r?void 0:r.value)||{};switch(o.key){case Ht.OKTA_PASSWORD:return new Hi(o);case Ht.SECURITY_QUESTION:return(null===(t=o.contextualData)||void 0===t?void 0:t.enrolledQuestion)?new Vi(o):new qi(o);case Ht.OKTA_VERIFY:return new Ki(o);case Ht.WEBAUTHN:return(null===(n=o.contextualData)||void 0===n?void 0:n.challengeData)?new zi(o):new Wi(o);default:return new Bi(o)}}var Ji=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(this,o),(t=r.call(this,e,n)).authenticator=Gi(e),t}return V(o,[{key:"getNextStep",value:function(e){var t,n=Ni(d(o.prototype),"getNextStep",this).call(this,e),r=null===(t=null==e?void 0:e.authenticatorEnrollments)||void 0===t?void 0:t.value;return Object.assign(Object.assign({},n),{authenticatorEnrollments:r})}},{key:"canRemediate",value:function(){return this.authenticator.canVerify(this.values)}},{key:"mapCredentials",value:function(){return this.authenticator.mapCredentials(this.values)}},{key:"getInputCredentials",value:function(e){return this.authenticator.getInputs(e)}},{key:"getValuesAfterProceed",value:function(){var e=this;return this.values=Ni(d(o.prototype),"getValuesAfterProceed",this).call(this),Object.keys(this.values).filter((function(e){return"credentials"!==e})).reduce((function(t,n){return Object.assign(Object.assign({},t),Di({},n,e.values[n]))}),{})}}]),o}(Ui);var $i=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return o}(Ji);$i.remediationName="enroll-authenticator";var Yi=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canRemediate",value:function(){return!!this.values.startPolling||"enroll-poll"===this.options.step}},{key:"getNextStep",value:function(e){var t=Ni(d(o.prototype),"getNextStep",this).call(this,e),n=this.getAuthenticator();return!n&&(null==e?void 0:e.currentAuthenticator)&&(n=e.currentAuthenticator.value),Object.assign(Object.assign({},t),{authenticator:n,poll:{required:!0,refresh:this.remediation.refresh}})}},{key:"getValuesAfterProceed",value:function(){var e=this;return Object.keys(this.values).filter((function(e){return"startPolling"!==e})).reduce((function(t,n){return Object.assign(Object.assign({},t),Di({},n,e.values[n]))}),{})}}]),o}(Ui);Yi.remediationName="enroll-poll";var Qi=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canRemediate",value:function(){return Boolean(this.values.channel)}},{key:"getNextStep",value:function(e){var t=Ni(d(o.prototype),"getNextStep",this).call(this),n=this.getChannels(),r=e.currentAuthenticator.value;return Object.assign(Object.assign(Object.assign({},t),n&&{options:n}),{authenticator:r})}},{key:"getChannels",value:function(){var e;return null===(e=Ci(this.remediation).value.form.value.find((function(e){return"channel"===e.name})))||void 0===e?void 0:e.options}},{key:"getData",value:function(){return{authenticator:{id:this.remediation.value[0].value.form.value[0].value,channel:this.values.channel},stateHandle:this.values.stateHandle}}},{key:"getValuesAfterProceed",value:function(){var e=this;return Object.keys(this.values).filter((function(e){return"channel"!==e})).reduce((function(t,n){return Object.assign(Object.assign({},t),Di({},n,e.values[n]))}),{})}}]),o}(Ui);Qi.remediationName="select-enrollment-channel";var Xi=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"getInputEmail",value:function(){return[{name:"email",type:"string",required:!0,label:"Email"}]}},{key:"getInputPhoneNumber",value:function(){return[{name:"phoneNumber",type:"string",required:!0,label:"Phone Number"}]}},{key:"canRemediate",value:function(){return Boolean(this.values.email||this.values.phoneNumber)}},{key:"getNextStep",value:function(e){var t=Ni(d(o.prototype),"getNextStep",this).call(this),n=e.currentAuthenticator.value;return Object.assign(Object.assign({},t),{authenticator:n})}},{key:"getData",value:function(){return{stateHandle:this.values.stateHandle,email:this.values.email,phoneNumber:this.values.phoneNumber}}},{key:"getValuesAfterProceed",value:function(){var e=this;return Object.keys(this.values).filter((function(e){return!["email","phoneNumber"].includes(e)})).reduce((function(t,n){return Object.assign(Object.assign({},t),Di({},n,e.values[n]))}),{})}}]),o}(Ui);Xi.remediationName="enrollment-channel-data";var Zi=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return o}(Ji);Zi.remediationName="challenge-authenticator";var ea=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canRemediate",value:function(){return!!this.values.startPolling||"challenge-poll"===this.options.step}}]),o}(Yi);ea.remediationName="challenge-poll";var ta=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return o}(Ji);ta.remediationName="reset-authenticator";var na=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canRemediate",value:function(){var e=this.getData().userProfile;return!!e&&this.remediation.value.find((function(e){return"userProfile"===e.name})).form.value.reduce((function(t,n){return n.required&&(t=t&&!!e[n.name]),t}),!0)}},{key:"mapUserProfile",value:function(e){var t=this,n=e.form.value.map((function(e){return e.name})).reduce((function(e,n){return t.values[n]?Object.assign(Object.assign({},e),Di({},n,t.values[n])):e}),{});if(0!==Object.keys(n).length)return n}},{key:"getInputUserProfile",value:function(e){return rr(e.form.value)}},{key:"getErrorMessages",value:function(e){return e.value[0].form.value.reduce((function(e,t){return t.messages&&e.push(t.messages.value[0].message),e}),[])}}]),o}(Ui);na.remediationName="enroll-profile";var ra=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){var e;return s(this,o),(e=r.apply(this,arguments)).map={identifier:["username"]},e}return V(o,[{key:"canRemediate",value:function(){return!!this.getData().identifier}},{key:"mapCredentials",value:function(){var e=this.values,t=e.credentials,n=e.password;if(t||n)return t||{passcode:n}}},{key:"getInputCredentials",value:function(e){return Object.assign(Object.assign({},e.form.value[0]),{name:"password",required:e.required})}}]),o}(Ui);ra.remediationName="identify";var oa=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"mapCredentials",value:function(){var e=this.values.newPassword;if(e)return{passcode:e}}},{key:"getInputCredentials",value:function(e){var t="password"===this.getAuthenticator().type?"newPassword":"verificationCode";return Object.assign(Object.assign({},e.form.value[0]),{name:t})}}]),o}(Ui);oa.remediationName="reenroll-authenticator";var ia=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canRemediate",value:function(){return!1}},{key:"getNextStep",value:function(){var e=this.remediation;return{name:e.name,type:e.type,idp:e.idp,href:e.href}}}]),o}(Ui);function aa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}ia.remediationName="redirect-idp";var sa=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"findMatchedOption",value:function(e,t){var n,r,o=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return aa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?aa(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(e);try{var i=function(){var e=r.value;if(n=t.find((function(t){return t.relatesTo.key===e.key})))return"break"};for(o.s();!(r=o.n()).done&&"break"!==i(););}catch(e){o.e(e)}finally{o.f()}return n}},{key:"canRemediate",value:function(){var e=this.values,t=e.authenticators,n=e.authenticator,r=Ci(this.remediation).options;return!!(t&&t.length&&(an(n)&&n.id||this.findMatchedOption(t,r)))}},{key:"getNextStep",value:function(){var e=Ni(d(o.prototype),"getNextStep",this).call(this),t=Ci(this.remediation).options.map((function(e){return{label:e.label,value:e.relatesTo.key}}));return Object.assign(Object.assign({},e),{options:t})}},{key:"mapAuthenticator",value:function(e){var t=this.values,n=t.authenticators,r=t.authenticator;if(an(r)&&r.id)return this.selectedAuthenticator=r,r;var o=function(e,t){var n,r,o=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ji(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ji(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(e);try{var i=function(){var e=r.value;if(n=t.find((function(t){return t.relatesTo.key===e.key})))return"break"};for(o.s();!(r=o.n()).done&&"break"!==i(););}catch(e){o.e(e)}finally{o.f()}return n}(n,e.options);return this.selectedAuthenticator=o.relatesTo,this.selectedOption=o,{id:null==o?void 0:o.value.form.value.find((function(e){return"id"===e.name})).value}}},{key:"getInputAuthenticator",value:function(){return{name:"authenticator",key:"string"}}},{key:"getValuesAfterProceed",value:function(){var e=this;this.values=Ni(d(o.prototype),"getValuesAfterProceed",this).call(this);var t=this.values.authenticators.filter((function(t){return!0!==Mi(t,e.selectedAuthenticator)}));return Object.assign(Object.assign({},this.values),{authenticators:t})}}]),o}(Ui);var ua=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};s(this,o);var u="recoverPassword"===(t=r.call(this,e,i,a)).options.flow,c=null===(n=Ci(e).options)||void 0===n?void 0:n.some((function(e){var t=e.relatesTo;return(null==t?void 0:t.key)===Ht.OKTA_PASSWORD}));return c&&(u||t.values.password)&&(t.values.authenticators=[].concat(rr(t.values.authenticators||[]),[{key:Ht.OKTA_PASSWORD}])),t}return o}(sa);ua.remediationName="select-authenticator-authenticate";var ca=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return o}(sa);ca.remediationName="select-authenticator-enroll";var la=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){var e;return s(this,o),(e=r.apply(this,arguments)).map={identifier:["username"]},e}return V(o,[{key:"canRemediate",value:function(){return!!this.getData("identifier")&&Ni(d(o.prototype),"canRemediate",this).call(this)}},{key:"mapAuthenticator",value:function(e){var t,n,r,i=Ni(d(o.prototype),"mapAuthenticator",this).call(this,e),a=null===(t=this.selectedOption)||void 0===t?void 0:t.value.form.value.find((function(e){return"methodType"===e.name})),s=this.values.methodType||(null==a?void 0:a.value)||(null===(r=null===(n=null==a?void 0:a.options)||void 0===n?void 0:n[0])||void 0===r?void 0:r.value);return s?Object.assign(Object.assign({},i),{methodType:s}):i}},{key:"getInputUsername",value:function(){return{name:"username",key:"string"}}}]),o}(sa);la.remediationName="select-authenticator-unlock-account";var fa=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canRemediate",value:function(){return!0}}]),o}(Ui);fa.remediationName="select-enroll-profile";var ha=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(this,o),(t=r.call(this,e,n)).authenticator=t.getAuthenticator(),t.formatAuthenticatorData(),t}return V(o,[{key:"formatAuthenticatorData",value:function(){var e=this;if(this.getAuthenticatorData())this.values.authenticatorsData=this.values.authenticatorsData.map((function(t){return Mi(e.authenticator,t)?e.mapAuthenticatorDataFromValues(t):t}));else{var t=this.mapAuthenticatorDataFromValues();t&&this.values.authenticatorsData.push(t)}}},{key:"getAuthenticatorData",value:function(){var e=this;return this.values.authenticatorsData.find((function(t){return Mi(e.authenticator,t)}))}},{key:"canRemediate",value:function(){var e=this;return this.values.authenticatorsData.some((function(t){return Mi(e.authenticator,t)}))}},{key:"getNextStep",value:function(){var e=Ni(d(o.prototype),"getNextStep",this).call(this),t=this.getMethodTypes();return Object.assign(Object.assign({},e),t&&{options:t})}},{key:"mapAuthenticatorDataFromValues",value:function(e){var t=this.values,n=t.methodType,r=t.authenticator;!n&&an(r)&&(n=null==r?void 0:r.methodType);var o=this.authenticator,i=o.id,a=o.enrollmentId,s=Object.assign(Object.assign({id:i,enrollmentId:a},e&&e),n&&{methodType:n});return s.methodType?s:null}},{key:"getAuthenticatorFromRemediation",value:function(){return this.remediation.value.find((function(e){return"authenticator"===e.name}))}},{key:"getMethodTypes",value:function(){var e;return null===(e=this.getAuthenticatorFromRemediation().form.value.find((function(e){return"methodType"===e.name})))||void 0===e?void 0:e.options}},{key:"getValuesAfterProceed",value:function(){var e=this;this.values=Ni(d(o.prototype),"getValuesAfterProceed",this).call(this);var t=this.values.authenticatorsData.filter((function(t){return!0!==Mi(e.authenticator,t)}));return Object.assign(Object.assign({},this.values),{authenticatorsData:t})}}]),o}(Ui);var da=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(this,o),(t=r.call(this,e,n)).shouldProceedWithEmailAuthenticator=1===t.authenticator.methods.length&&"email"===t.authenticator.methods[0].type,t}return V(o,[{key:"canRemediate",value:function(){return!!this.shouldProceedWithEmailAuthenticator||Ni(d(o.prototype),"canRemediate",this).call(this)}},{key:"mapAuthenticator",value:function(){var e;return this.shouldProceedWithEmailAuthenticator?null===(e=this.getAuthenticatorFromRemediation().form)||void 0===e?void 0:e.value.reduce((function(e,t){if(t.value)e[t.name]=t.value;else{if(!t.options)throw new k("Unsupported authenticator data type: ".concat(t));e[t.name]=t.options[0].value}return e}),{}):this.getAuthenticatorData()}},{key:"getInputAuthenticator",value:function(){var e=this.getAuthenticatorFromRemediation(),t=e.form.value.find((function(e){return"methodType"===e.name}));return t&&t.options?{name:"methodType",type:"string",required:!0}:rr(e.form.value)}},{key:"getValuesAfterProceed",value:function(){var e=this;return this.values=Ni(d(o.prototype),"getValuesAfterProceed",this).call(this),Object.keys(this.values).filter((function(e){return"authenticator"!==e})).reduce((function(t,n){return Object.assign(Object.assign({},t),Di({},n,e.values[n]))}),{})}}]),o}(ha);da.remediationName="authenticator-verification-data";var pa=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"mapAuthenticator",value:function(){var e=this.getAuthenticatorData();return{id:Ci(this.remediation).form.value.find((function(e){return"id"===e.name})).value,methodType:e.methodType,phoneNumber:e.phoneNumber}}},{key:"getInputAuthenticator",value:function(){return[{name:"methodType",type:"string",required:!0},{name:"phoneNumber",type:"string",required:!0,label:"Phone Number"}]}},{key:"mapAuthenticatorDataFromValues",value:function(e){e=Ni(d(o.prototype),"mapAuthenticatorDataFromValues",this).call(this,e);var t=this.values.phoneNumber;if(e||t)return Object.assign(Object.assign({},e&&e),t&&{phoneNumber:t})}}]),o}(ha);pa.remediationName="authenticator-enrollment-data";var va=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(){return s(this,o),r.apply(this,arguments)}return V(o,[{key:"canRemediate",value:function(){return!!this.values.skip||"skip"===this.options.step}}]),o}(Ui);function ya(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ga(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ga(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function ga(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ma(e){var t=e.neededToProceed,n=e.interactionCode;return!t.length&&!n}function ba(e){if(e&&Array.isArray(e))return e.reduce((function(e,t){if(t.messages&&(e=[].concat(rr(e),rr(t.messages.value))),t.form){var n=ba(t.form.value)||[];e=[].concat(rr(e),rr(n))}if(t.options){var r=[];t.options.forEach((function(e){e.value&&"string"!=typeof e.value&&(r=[].concat(rr(r),[e.value]))}));var o=ba(r)||[];e=[].concat(rr(e),rr(o))}return e}),[])}function ka(e){var t,n=[],r=e.rawIdxState,o=e.neededToProceed,i=null===(t=r.messages)||void 0===t?void 0:t.value.map((function(e){return e}));i&&(n=[].concat(rr(n),rr(i)));var a,s=ya(o);try{for(s.s();!(a=s.n()).done;){var u=ba(a.value.value);u&&(n=[].concat(rr(n),rr(u)))}}catch(e){s.e(e)}finally{s.f()}var c={};return n=n.reduce((function(e,t){var n,r=null===(n=t.i18n)||void 0===n?void 0:n.key;return r&&c[r]?e:(c[r]=t,e=[].concat(rr(e),[t]))}),[]),n}function wa(e){var t=[],n=e.actions,r=e.neededToProceed;return n["currentAuthenticator-recover"]&&t.push(qt.PASSWORD_RECOVERY),r.some((function(e){return"select-enroll-profile"===e.name}))&&t.push(qt.REGISTRATION),r.some((function(e){return"redirect-idp"===e.name}))&&t.push(qt.SOCIAL_IDP),r.some((function(e){return"unlock-account"===e.name}))&&t.push(qt.ACCOUNT_UNLOCK),t}function Ta(e){var t,n=[],r=Object.values(a).reduce((function(e,t){return t.remediationName&&(e[t.remediationName]=t),e}),{}),o=ya(e.neededToProceed);try{for(o.s();!(t=o.n()).done;){var i=t.value,s=r[i.name];if(s){var u=new s(i);n.push(u.getNextStep(e.context))}}}catch(e){o.e(e)}finally{o.f()}return n}function Sa(e,t){return e.neededToProceed[0].value.reduce((function(e,n){var r=n.name;return e[r]=t[r],e}),{})}function xa(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Oa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Oa(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Oa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}va.remediationName="skip";function _a(e,t,n){var r,o=n.remediators;if(!n.step){var i,a=[],s=xa(e);try{for(s.s();!(i=s.n()).done;){var u=i.value;if(Object.keys(o).includes(u.name)){if((r=new(0,o[u.name])(u,t,n)).canRemediate())return r;a.push(r)}}}catch(e){s.e(e)}finally{s.f()}return a[0]}var c=e.find((function(e){return e.name===n.step}));if(c){var l=c?o[c.name]:void 0;return l?new l(c,t,n):void 0}qn('step "'.concat(n.step,'" did not match any remediations'))}function Ea(e,t){var n=e.getNextStep(t.context),r=function(e){return e.neededToProceed.some((function(e){return"skip"===e.name}))}(t),o=function(e){return Object.keys(e.actions).some((function(e){return e.includes("resend")}))}(t);return Object.assign(Object.assign(Object.assign({},n),r&&{canSkip:r}),o&&{canResend:o})}function Aa(e,t){var n=fo(e)?e:null;if(!n)throw e;n.requestDidSucceed=!1;var r=ma(n),o=ka(n);if(r)return{idxResponse:n,terminal:r,messages:o};var i=t&&Ea(t,n);return Object.assign({idxResponse:n,messages:o},i&&{nextStep:i})}function Ra(e,t){return Object.keys(t.actions).find((function(t){return!!e.resend&&t.includes("-resend")}))}function Pa(e){return e.resend=void 0,e}function Ca(e,t,n){return r=this,o=void 0,i=void 0,a=z().mark((function r(){var o,i,a,s,u,c,f,h,d,p,v,y,g,m,b,w,T,S;return z().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(i=(o=e).neededToProceed,a=o.interactionCode,s=n.flow,!a){r.next=4;break}return r.abrupt("return",{idxResponse:e});case 4:if(u=ma(e),c=ka(e),!u){r.next=8;break}return r.abrupt("return",{idxResponse:e,terminal:u,messages:c});case 8:if(f=_a(i,t,n),h=Ra(t,e),d=n.actions||[],!(p=[].concat(rr(d),rr(h&&[h]||[])))){r.next=32;break}v=xa(p),r.prev=14,g=z().mark((function r(){var o,a,s;return z().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(o=y.value,a=Pa(t),s=Object.assign(Object.assign({},n),{actions:d.filter((function(e){return e!==o}))}),"function"!=typeof e.actions[o]){r.next=17;break}return r.prev=4,r.next=7,e.actions[o]();case 7:(e=r.sent).requestDidSucceed=!0,r.next=14;break;case 11:return r.prev=11,r.t0=r.catch(4),r.abrupt("return",{v:Aa(r.t0,f)});case 14:if("cancel"!==o){r.next=16;break}return r.abrupt("return",{v:{idxResponse:e,canceled:!0}});case 16:return r.abrupt("return",{v:Ca(e,a,s)});case 17:if(!i.find((function(e){return e.name===o}))){r.next=30;break}return r.prev=19,r.next=22,e.proceed(o,{});case 22:(e=r.sent).requestDidSucceed=!0,r.next=29;break;case 26:return r.prev=26,r.t1=r.catch(19),r.abrupt("return",{v:Aa(r.t1,f)});case 29:return r.abrupt("return",{v:Ca(e,t,s)});case 30:case"end":return r.stop()}}),r,null,[[4,11],[19,26]])})),v.s();case 17:if((y=v.n()).done){r.next=24;break}return r.delegateYield(g(),"t0",19);case 19:if("object"!==l(m=r.t0)){r.next=22;break}return r.abrupt("return",m.v);case 22:r.next=17;break;case 24:r.next=29;break;case 26:r.prev=26,r.t1=r.catch(14),v.e(r.t1);case 29:return r.prev=29,v.f(),r.finish(29);case 32:if(f){r.next=49;break}if(!n.step){r.next=46;break}return t=Sa(e,t),r.prev=35,r.next=38,e.proceed(n.step,t);case 38:return(e=r.sent).requestDidSucceed=!0,r.abrupt("return",{idxResponse:e});case 43:return r.prev=43,r.t2=r.catch(35),r.abrupt("return",Aa(r.t2));case 46:if("default"!==s){r.next=48;break}return r.abrupt("return",{idxResponse:e});case 48:throw new k("\n No remediation can match current flow, check policy settings in your org.\n Remediations: [".concat(i.reduce((function(e,t){return e?e+" ,"+t.name:t.name}),""),"]\n "));case 49:if(!c.length){r.next=52;break}return b=Ea(f,e),r.abrupt("return",{idxResponse:e,nextStep:b,messages:c});case 52:if(f.canRemediate()){r.next=55;break}return w=Ea(f,e),r.abrupt("return",{idxResponse:e,nextStep:w});case 55:return T=f.getName(),S=f.getData(),r.prev=57,r.next=60,e.proceed(T,S);case 60:return(e=r.sent).requestDidSucceed=!0,t=f.getValuesAfterProceed(),delete n.step,r.abrupt("return",Ca(e,t,n));case 67:return r.prev=67,r.t3=r.catch(57),r.abrupt("return",Aa(r.t3,f));case 70:case"end":return r.stop()}}),r,null,[[14,26,29,32],[35,43],[57,67]])})),new(i||(i=Promise))((function(e,t){function n(e){try{u(a.next(e))}catch(e){t(e)}}function s(e){try{u(a.throw(e))}catch(e){t(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(n,s)}u((a=a.apply(r,o||[])).next())}));var r,o,i,a}var ja={identify:ra,"select-authenticator-authenticate":ua,"select-authenticator-enroll":ca,"authenticator-enrollment-data":pa,"authenticator-verification-data":da,"enroll-authenticator":$i,"challenge-authenticator":Zi,"challenge-poll":ea,"reenroll-authenticator":oa,"enroll-poll":Yi,"redirect-idp":ia,skip:va},Ia={identify:ra,"identify-recovery":ra,"select-authenticator-authenticate":ua,"select-authenticator-enroll":ca,"challenge-authenticator":Zi,"authenticator-verification-data":da,"authenticator-enrollment-data":pa,"reset-authenticator":ta,"reenroll-authenticator":oa,"enroll-poll":Yi},Ma={"select-enroll-profile":fa,"enroll-profile":na,"authenticator-enrollment-data":pa,"select-authenticator-enroll":ca,"enroll-poll":Yi,"select-enrollment-channel":Qi,"enrollment-channel-data":Xi,"enroll-authenticator":$i,skip:va},La={identify:ra,"select-authenticator-unlock-account":la,"select-authenticator-authenticate":ua,"challenge-authenticator":Zi,"challenge-poll":ea,"authenticator-verification-data":da};function Ua(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",o=!0;switch(r){case"register":case"signup":case"enrollProfile":t=Ma,o=!1;break;case"recoverPassword":case"resetPassword":t=Ia,n=["currentAuthenticator-recover","currentAuthenticatorEnrollment-recover"],o=!1;break;case"unlockAccount":t=La,o=!1,n=["unlock-account"];break;default:t=ja}return{flow:r,remediators:t,actions:n,withCredentials:o}}var Da=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function Na(e){var t=Object.assign({},e);return["flow","remediators","actions","withCredentials","step"].forEach((function(e){delete t[e]})),t}function Fa(e,t){var n=t.options,r=n.flow,o=n.withCredentials,i=n.remediators,a=n.actions,s=Kt.PENDING;if(r=r||e.idx.getFlow()||"default"){e.idx.setFlow(r);var u=Ua(e,r);o=void 0!==o?o:u.withCredentials,i=i||u.remediators,a=a||u.actions}return Object.assign(Object.assign({},t),{options:Object.assign(Object.assign({},n),{flow:r,withCredentials:o,remediators:i,actions:a}),status:s})}function Ba(e,t){return Da(this,void 0,void 0,z().mark((function n(){var r,o,i,a,s,u,c,l,f,h,d,p;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=t.options,o=r.stateHandle,i=r.withCredentials,a=r.version,s=r.state,u=r.scopes,c=r.recoveryToken,l=r.activationToken,!o){n.next=8;break}return n.next=5,Ri(e,{withCredentials:i,version:a,stateHandle:o});case 5:f=n.sent,n.next=20;break;case 8:if(h=mi(e,{state:s,recoveryToken:c,activationToken:l}),d=null==h?void 0:h.interactionHandle){n.next=17;break}return e.transactionManager.clear(),n.next=14,Ei(e,{withCredentials:i,state:s,scopes:u,activationToken:l,recoveryToken:c});case 14:p=n.sent,d=p.interactionHandle,h=p.meta;case 17:return n.next=19,Ri(e,{withCredentials:i,version:a,interactionHandle:d});case 19:f=n.sent;case 20:return n.abrupt("return",Object.assign(Object.assign({},t),{idxResponse:f,meta:h}));case 21:case"end":return n.stop()}}),n)})))}function Ka(e){return Da(this,void 0,void 0,z().mark((function t(){var n,r,o,i,a,s,u,c,l,f,h,d;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.idxResponse,r=e.options,o=e.values,i=r.autoRemediate,a=r.remediators,s=r.actions,u=r.flow,c=r.step,!1!==i&&(a||s||c)){t.next=5;break}return t.abrupt("return",e);case 5:return o=Object.assign(Object.assign({},o),{stateHandle:n.rawIdxState.stateHandle}),t.next=8,Ca(n,o,{remediators:a,actions:s,flow:u,step:c});case 8:return l=t.sent,f=l.idxResponse,h=l.nextStep,d=l.canceled,n=f,t.abrupt("return",Object.assign(Object.assign({},e),{idxResponse:n,nextStep:h,canceled:d}));case 14:case"end":return t.stop()}}),t)})))}function Ha(e,t){return Da(this,void 0,void 0,z().mark((function n(){var r,o,i,a,s,u,c,l,f,h;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=t.meta,o=t.idxResponse,i=o.interactionCode,a=r.clientId,s=r.codeVerifier,u=r.ignoreSignature,c=r.redirectUri,l=r.urls,f=r.scopes,n.next=5,e.token.exchangeCodeForTokens({interactionCode:i,clientId:a,codeVerifier:s,ignoreSignature:u,redirectUri:c,scopes:f},l);case 5:return h=n.sent,n.abrupt("return",h.tokens);case 7:case"end":return n.stop()}}),n)})))}function qa(e,t){return Da(this,void 0,void 0,z().mark((function n(){var r,o,i,a,s,u,c,l,f,h,d,p,v;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=t.options,o=t.idxResponse,i=t.canceled,a=t.status,s=r.exchangeCodeForTokens,u=!1,c=!0,o&&(h=wa(o),d=Ta(o),p=ka(o),v=ma(o)),!v){n.next=11;break}a=Kt.TERMINAL,u=!0,c=!1,n.next=28;break;case 11:if(!i){n.next=16;break}a=Kt.CANCELED,u=!0,n.next=28;break;case 16:if(!(null==o?void 0:o.interactionCode)){n.next=28;break}if(l=o.interactionCode,!1!==s){n.next=23;break}a=Kt.SUCCESS,u=!1,n.next=28;break;case 23:return n.next=25,Ha(e,t);case 25:f=n.sent,a=Kt.SUCCESS,u=!0;case 28:return n.abrupt("return",Object.assign(Object.assign({},t),{status:a,interactionCode:l,tokens:f,shouldClearTransaction:u,clearSharedStorage:c,enabledFeatures:h,availableSteps:d,messages:p,terminal:v}));case 29:case"end":return n.stop()}}),n)})))}function Va(e,t){var n=t.error,r=t.status;t.shouldClearTransaction;if(!fo(e))throw e;return n=e,r=Kt.FAILURE,!0,Object.assign(Object.assign({},t),{error:n,status:r,shouldClearTransaction:true})}function Wa(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Da(this,void 0,void 0,z().mark((function n(){var r,o,i,a,s,u,c,l,f,h,d,p,v,y,g,m,b,k,w,T,S,x;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r={options:t,values:Na(t)},r=Fa(e,r),n.prev=2,n.next=5,Ba(e,r);case 5:return r=n.sent,n.next=8,Ka(r);case 8:r=n.sent,n.next=14;break;case 11:n.prev=11,n.t0=n.catch(2),r=Va(n.t0,r);case 14:return n.next=16,qa(e,r);case 16:return r=n.sent,i=(o=r).idxResponse,a=o.meta,s=o.shouldClearTransaction,u=o.clearSharedStorage,c=o.status,l=o.enabledFeatures,f=o.availableSteps,h=o.tokens,d=o.nextStep,p=o.messages,v=o.error,y=o.interactionCode,s?e.transactionManager.clear({clearSharedStorage:u}):(ki(e,Object.assign({},a)),i&&(g=i.rawIdxState,m=i.requestDidSucceed,e.transactionManager.saveIdxResponse({rawIdxResponse:g,requestDidSucceed:m}))),k=(b=i||{}).actions,w=b.context,T=b.neededToProceed,S=b.proceed,x=b.rawIdxState,n.abrupt("return",Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({status:c},a&&{meta:a}),l&&{enabledFeatures:l}),f&&{availableSteps:f}),h&&{tokens:h}),d&&{nextStep:d}),p&&p.length&&{messages:p}),v&&{error:v}),{interactionCode:y,actions:k,context:w,neededToProceed:T,proceed:S,rawIdxState:x}));case 21:case"end":return n.stop()}}),n,null,[[2,11]])})))}var za=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function Ga(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return za(this,void 0,void 0,z().mark((function n(){return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t.password&&!t.authenticator&&(t.authenticator=Ht.OKTA_PASSWORD),n.abrupt("return",Wa(e,Object.assign(Object.assign({},t),{flow:"authenticate"})));case 2:case"end":return n.stop()}}),n)})))}function Ja(e,t){return n=this,r=void 0,o=void 0,i=z().mark((function n(){var r,o;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=e.transactionManager.load(),o=Ua(e,r.flow),n.abrupt("return",Wa(e,Object.assign(Object.assign(Object.assign({},t),o),{actions:["cancel"]})));case 3:case"end":return n.stop()}}),n)})),new(o||(o=Promise))((function(e,t){function a(e){try{u(i.next(e))}catch(e){t(e)}}function s(e){try{u(i.throw(e))}catch(e){t(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(a,s)}u((i=i.apply(n,r||[])).next())}));var n,r,o,i}var $a=function(e){c(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return h(this,e)});function o(e,t){var n;return s(this,o),(n=r.call(this,"Enter the OTP code in the originating client: ".concat(t))).name="EmailVerifyCallbackError",n.state=e,n.otp=t,n}return o}(g);function Ya(e){return"EmailVerifyCallbackError"===e.name}function Qa(e){return/(otp=)/i.test(e)&&/(state=)/i.test(e)}function Xa(e){return Qt(e)}function Za(e,t){return n=this,r=void 0,o=void 0,i=z().mark((function n(){var r,o,i;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!Qa(t)){n.next=9;break}if(r=Xa(t),o=r.state,i=r.otp,!e.idx.canProceed({state:o})){n.next=8;break}return n.next=5,e.idx.proceed({state:o,otp:i});case 5:return n.abrupt("return",n.sent);case 8:throw new $a(o,i);case 9:case"end":return n.stop()}}),n)})),new(o||(o=Promise))((function(e,t){function a(e){try{u(i.next(e))}catch(e){t(e)}}function s(e){try{u(i.throw(e))}catch(e){t(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(a,s)}u((i=i.apply(n,r||[])).next())}));var n,r,o,i}var es=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function ts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=mi(e,t);return!(!n&&!t.stateHandle)}function ns(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return es(this,void 0,void 0,z().mark((function n(){var r,o,i;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(ts(e,t)){n.next=2;break}throw new k("Unable to proceed: saved transaction could not be loaded");case 2:return r=t.flow,o=t.state,r||(i=mi(e,{state:o}),r=null==i?void 0:i.flow),n.abrupt("return",Wa(e,Object.assign(Object.assign({},t),{flow:r})));case 5:case"end":return n.stop()}}),n)})))}var rs=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function os(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return rs(this,void 0,void 0,z().mark((function r(){var o,i,a;return z().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,ns(e,{startPolling:!0});case 2:if(o=r.sent,i=mi(e),(null==(a=null===(t=null==i?void 0:i.remediations)||void 0===t?void 0:t.find((function(e){return e.includes("poll")})))?void 0:a.length)||qn("No polling remediations available at the current IDX flow stage"),!Number.isInteger(n.refresh)){r.next=8;break}return r.abrupt("return",new Promise((function(t,r){setTimeout((function(){var n,i;return rs(this,void 0,void 0,z().mark((function a(){var s;return z().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:try{s=null===(i=null===(n=o.nextStep)||void 0===n?void 0:n.poll)||void 0===i?void 0:i.refresh,t(s?os(e,{refresh:s}):o)}catch(e){r(e)}case 1:case"end":return a.stop()}}),a)})))}),n.refresh)})));case 8:return r.abrupt("return",o);case 9:case"end":return r.stop()}}),r)})))}var is=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function as(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return is(this,void 0,void 0,z().mark((function n(){return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e.transactionManager.clear(),n.abrupt("return",Wa(e,Object.assign({exchangeCodeForTokens:!1},t)));case 2:case"end":return n.stop()}}),n)})))}var ss=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function us(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ss(this,void 0,void 0,z().mark((function n(){var r,o,i;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(gi(e)){n.next=12;break}return n.next=3,as(e,Object.assign(Object.assign({},t),{flow:"register",autoRemediate:!1}));case 3:if(r=n.sent,o=r.enabledFeatures,i=r.availableSteps,t.activationToken||!o||o.includes(qt.REGISTRATION)){n.next=9;break}throw new k("Registration is not supported based on your current org configuration.");case 9:if(!t.activationToken||!(null==i?void 0:i.some((function(e){return"identify"===e.name})))){n.next=12;break}throw new k("activationToken is not supported based on your current org configuration.");case 12:return n.abrupt("return",Wa(e,Object.assign(Object.assign({},t),{flow:"register"})));case 13:case"end":return n.stop()}}),n)})))}var cs=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function ls(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return cs(this,void 0,void 0,z().mark((function n(){var r;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=Ua(e,"recoverPassword"),n.abrupt("return",Wa(e,Object.assign(Object.assign({},t),r)));case 2:case"end":return n.stop()}}),n)})))}function fs(e,t){return n=this,r=void 0,o=void 0,i=z().mark((function n(){var r,o,i,a,s,u,c,l,f,h;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=e.transactionManager.load()){n.next=3;break}throw new k("No transaction data was found in storage");case 3:if(o=r.codeVerifier,i=r.state,a=new URL(t),s=a.searchParams,u=s.get("state"),c=s.get("interaction_code"),!(l=s.get("error"))){n.next=10;break}throw new w(l,s.get("error_description"));case 10:if(u===i){n.next=12;break}throw new k("State in redirect uri does not match with transaction state");case 12:if(c){n.next=14;break}throw new k("Unable to parse interaction_code from the url");case 14:return n.next=16,e.token.exchangeCodeForTokens({interactionCode:c,codeVerifier:o});case 16:f=n.sent,h=f.tokens,e.tokenManager.setTokens(h);case 19:case"end":return n.stop()}}),n)})),new(o||(o=Promise))((function(e,t){function a(e){try{u(i.next(e))}catch(e){t(e)}}function s(e){try{u(i.throw(e))}catch(e){t(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(a,s)}u((i=i.apply(n,r||[])).next())}));var n,r,o,i}var hs=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function ds(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return hs(this,void 0,void 0,z().mark((function n(){var r,o;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(t.flow="unlockAccount",gi(e)){n.next=8;break}return n.next=4,as(e,Object.assign(Object.assign({},t),{autoRemediate:!1}));case 4:if(r=n.sent,!(o=r.enabledFeatures)||o.includes(qt.ACCOUNT_UNLOCK)){n.next=8;break}throw new k("Self Service Account Unlock is not supported based on your current org configuration.");case 8:return n.abrupt("return",Wa(e,Object.assign({},t)));case 9:case"end":return n.stop()}}),n)})))}var ps=function(){function e(){s(this,e),this.environments=["okta-auth-js/".concat("6.3.1")]}return V(e,[{key:"addEnvironment",value:function(e){this.environments.push(e)}},{key:"getHttpHeader",value:function(){return this.maybeAddNodeEnvironment(),{"X-Okta-User-Agent-Extended":this.environments.join(" ")}}},{key:"getVersion",value:function(){return"6.3.1"}},{key:"maybeAddNodeEnvironment",value:function(){if(!mt()&&process&&process.versions){var e=process.versions.node;this.environments.push("nodejs/".concat(e))}}}]),e}(),vs=n(279),ys=n.n(vs),gs=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},ms=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},bs=function(){function e(t){var n=this;s(this,e);var r=this.options=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return mo(e),D({issuer:Oe((e=jo(Co(),e)).issuer),tokenUrl:Oe(e.tokenUrl),authorizeUrl:Oe(e.authorizeUrl),userinfoUrl:Oe(e.userinfoUrl),revokeUrl:Oe(e.revokeUrl),logoutUrl:Oe(e.logoutUrl),clientId:e.clientId,redirectUri:e.redirectUri,state:e.state,scopes:e.scopes,postLogoutRedirectUri:e.postLogoutRedirectUri,responseMode:e.responseMode,responseType:e.responseType,pkce:!1!==e.pkce,useInteractionCodeFlow:e.useInteractionCodeFlow,httpRequestClient:e.httpRequestClient,transformErrorXHR:e.transformErrorXHR,transformAuthState:e.transformAuthState,restoreOriginalUri:e.restoreOriginalUri,storageUtil:e.storageUtil,headers:e.headers,devMode:!!e.devMode,storageManager:e.storageManager,transactionManager:e.transactionManager,cookies:mt()?Po(e,_t()):e.cookies,flow:e.flow,codeChallenge:e.codeChallenge,codeChallengeMethod:e.codeChallengeMethod,recoveryToken:e.recoveryToken,activationToken:e.activationToken,ignoreSignature:!!e.ignoreSignature,clientSecret:e.clientSecret})}(t);this.storageManager=new co(r.storageManager,r.cookies,r.storageUtil),this.transactionManager=new go(Object.assign({storageManager:this.storageManager},r.transactionManager)),this._oktaUserAgent=new ps,this.tx={status:Ne.bind(null,this),resume:Fe.bind(null,this),exists:Object.assign(He.bind(null,this),{_get:function(e){return r.storageUtil.storage.get(e)}}),introspect:Be.bind(null,this)},this.pkce={DEFAULT_CODE_CHALLENGE_METHOD:We.DEFAULT_CODE_CHALLENGE_METHOD,generateVerifier:We.generateVerifier,computeChallenge:We.computeChallenge},Object.assign(this.options.storageUtil,{getPKCEStorage:this.storageManager.getLegacyPKCEStorage.bind(this.storageManager),getHttpCache:this.storageManager.getHttpCache.bind(this.storageManager)}),this._pending={handleLogin:!1},mt()&&(this.options=Object.assign(this.options,{redirectUri:Te(t.redirectUri,window.location.origin)})),t.maxClockSkew||0===t.maxClockSkew?this.options.maxClockSkew=t.maxClockSkew:this.options.maxClockSkew=$,this.options.ignoreLifetime=!!t.ignoreLifetime,this.session={close:Je.bind(null,this),exists:ze.bind(null,this),get:Ge.bind(null,this),refresh:$e.bind(null,this),setCookieAndRedirect:Ye.bind(null,this)},this._tokenQueue=new Zr;var o=function(e){return Zr.prototype.push.bind(n._tokenQueue,e,null)},i=o(An.bind(null,this)),a=Object.assign(i,{_setLocation:function(e){window.location=e}}),u=o(jn.bind(null,this)),c=Object.assign(u,{_getHistory:function(){return window.history},_getLocation:function(){return window.location},_getDocument:function(){return window.document}});this.token={prepareTokenParams:Jt.bind(null,this),exchangeCodeForTokens:pn.bind(null,this),getWithoutPrompt:bn.bind(null,this),getWithPopup:_n.bind(null,this),getWithRedirect:a,parseFromUrl:c,decode:hn,revoke:dn.bind(null,this),renew:Sn.bind(null,this),renewTokensWithRefresh:kn.bind(null,this),renewTokens:xn.bind(null,this),getUserInfo:On.bind(null,this),verify:vn.bind(null,this),isLoginRedirect:Nt.bind(null,this)};var l=["decode","isLoginRedirect","getWithRedirect","parseFromUrl"];Object.keys(this.token).forEach((function(e){if(!(l.indexOf(e)>=0)){var t=n.token[e];n.token[e]=Zr.prototype.push.bind(n._tokenQueue,t,null)}}));var f,h,d=as.bind(null,this);this.idx={interact:Ei.bind(null,this),introspect:Ri.bind(null,this),authenticate:Ga.bind(null,this),register:us.bind(null,this),start:d,startTransaction:d,poll:os.bind(null,this),proceed:ns.bind(null,this),cancel:Ja.bind(null,this),recoverPassword:ls.bind(null,this),handleInteractionCodeRedirect:fs.bind(null,this),isInteractionRequired:Ft.bind(null,this),isInteractionRequiredError:Rt,handleEmailVerifyCallback:Za.bind(null,this),isEmailVerifyCallback:Qa,parseEmailVerifyCallback:Xa,isEmailVerifyCallbackError:Ya,getSavedTransactionMeta:mi.bind(null,this),createTransactionMeta:yi.bind(null,this),getTransactionMeta:bi.bind(null,this),saveTransactionMeta:ki.bind(null,this),clearTransactionMeta:wi.bind(null,this),isTransactionMetaValid:Ti,setFlow:function(e){n.options.flow=e},getFlow:function(){return n.options.flow},canProceed:ts.bind(null,this),unlockAccount:ds.bind(null,this)},h=this,f=function(e){var t=h._oktaUserAgent.getHttpHeader(),n=Object.assign(Object.assign({},t),h.options.headers);Object.keys(n).forEach((function(t){(h.options.clientSecret||"X-Device-Token"!==t)&&(e.headers[t]=n[t])}))},pi.client.interceptors.request.use(f),this.http={setRequestHeader:ve.bind(null,this)},this.fingerprint=eo.bind(null,this),this.emitter=new(ys()),this.tokenManager=new nr(this,t.tokenManager),this.authStateManager=new ao(this),this.serviceManager=new Qr(this,t.services)}return V(e,[{key:"start",value:function(){this.tokenManager.start(),this.token.isLoginRedirect()||this.authStateManager.updateAuthState(),this.serviceManager.start()}},{key:"stop",value:function(){this.tokenManager.stop(),this.serviceManager.stop()}},{key:"setHeaders",value:function(e){this.options.headers=Object.assign({},this.options.headers,e)}},{key:"signIn",value:function(e){return gs(this,void 0,void 0,z().mark((function t(){return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.signInWithCredentials(e));case 1:case"end":return t.stop()}}),t,this)})))}},{key:"signInWithCredentials",value:function(e){return gs(this,void 0,void 0,z().mark((function t(){var n,r=this;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=N(e||{}),n=function(t){return delete e.sendFingerprint,qe(r,"/api/v1/authn",e,t)},e.sendFingerprint){t.next=4;break}return t.abrupt("return",n());case 4:return t.abrupt("return",this.fingerprint().then((function(e){return n({headers:{"X-Device-Fingerprint":e}})})));case 5:case"end":return t.stop()}}),t,this)})))}},{key:"signInWithRedirect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return gs(this,void 0,void 0,z().mark((function t(){var n,r,o;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.originalUri,r=ms(e,["originalUri"]),!this._pending.handleLogin){t.next=3;break}return t.abrupt("return");case 3:return this._pending.handleLogin=!0,t.prev=4,n&&this.setOriginalUri(n),o=Object.assign({scopes:this.options.scopes||["openid","email","profile"]},r),t.next=9,this.token.getWithRedirect(o);case 9:return t.prev=9,this._pending.handleLogin=!1,t.finish(9);case 12:case"end":return t.stop()}}),t,this,[[4,,9,12]])})))}},{key:"closeSession",value:function(){var e=this;return this.session.close().then((function(){return gs(e,void 0,void 0,z().mark((function e(){return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.tokenManager.clear();case 1:case"end":return e.stop()}}),e,this)})))})).catch((function(e){if("AuthApiError"===e.name&&"E0000007"===e.errorCode)return null;throw e}))}},{key:"revokeAccessToken",value:function(e){return gs(this,void 0,void 0,z().mark((function t(){var n;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=6;break}return t.next=3,this.tokenManager.getTokens();case 3:e=t.sent.accessToken,n=this.tokenManager.getStorageKeyByType("accessToken"),this.tokenManager.remove(n);case 6:if(e){t.next=8;break}return t.abrupt("return",Promise.resolve(null));case 8:return t.abrupt("return",this.token.revoke(e));case 9:case"end":return t.stop()}}),t,this)})))}},{key:"revokeRefreshToken",value:function(e){return gs(this,void 0,void 0,z().mark((function t(){var n;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=6;break}return t.next=3,this.tokenManager.getTokens();case 3:e=t.sent.refreshToken,n=this.tokenManager.getStorageKeyByType("refreshToken"),this.tokenManager.remove(n);case 6:if(e){t.next=8;break}return t.abrupt("return",Promise.resolve(null));case 8:return t.abrupt("return",this.token.revoke(e));case 9:case"end":return t.stop()}}),t,this)})))}},{key:"getSignOutRedirectUrl",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.idToken,n=e.postLogoutRedirectUri,r=e.state;if(t||(t=this.tokenManager.getTokensSync().idToken),!t)return"";n||(n=this.options.postLogoutRedirectUri);var o=yt(this).logoutUrl,i=t.idToken,a=o+"?id_token_hint="+encodeURIComponent(i);return n&&(a+="&post_logout_redirect_uri="+encodeURIComponent(n)),r&&(a+="&state="+encodeURIComponent(r)),a}},{key:"signOut",value:function(e){return gs(this,void 0,void 0,z().mark((function t(){var n,r,o,i,a,s,u,c;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=Object.assign({},e),n=window.location.origin,r=window.location.href,o=e.postLogoutRedirectUri||this.options.postLogoutRedirectUri||n,i=e.accessToken,a=e.refreshToken,s=!1!==e.revokeAccessToken,(u=!1!==e.revokeRefreshToken)&&void 0===a&&(a=this.tokenManager.getTokensSync().refreshToken),s&&void 0===i&&(i=this.tokenManager.getTokensSync().accessToken),e.idToken||(e.idToken=this.tokenManager.getTokensSync().idToken),!u||!a){t.next=14;break}return t.next=14,this.revokeRefreshToken(a);case 14:if(!s||!i){t.next=17;break}return t.next=17,this.revokeAccessToken(i);case 17:if(c=this.getSignOutRedirectUrl(Object.assign(Object.assign({},e),{postLogoutRedirectUri:o}))){t.next=22;break}return t.abrupt("return",this.closeSession().then((function(){o===r?window.location.reload():window.location.assign(o)})));case 22:e.clearTokensBeforeRedirect?this.tokenManager.clear():this.tokenManager.addPendingRemoveFlags(),window.location.assign(c);case 24:case"end":return t.stop()}}),t,this)})))}},{key:"webfinger",value:function(e){return Ee(this,"/.well-known/webfinger"+xe(e),{headers:{Accept:"application/jrd+json"}})}},{key:"isAuthenticated",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return gs(this,void 0,void 0,z().mark((function t(){var n,r,o,i,a,s,u,c,l;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.tokenManager.getOptions(),r=n.autoRenew,o=n.autoRemove,i=e.onExpiredToken?"renew"===e.onExpiredToken:r,a=e.onExpiredToken?"remove"===e.onExpiredToken:o,s=this.tokenManager.getTokensSync(),!(u=s.accessToken)||!this.tokenManager.hasExpired(u)){t.next=18;break}if(u=void 0,!i){t.next=17;break}return t.prev=7,t.next=10,this.tokenManager.renew("accessToken");case 10:u=t.sent,t.next=15;break;case 13:t.prev=13,t.t0=t.catch(7);case 15:t.next=18;break;case 17:a&&this.tokenManager.remove("accessToken");case 18:if(c=this.tokenManager.getTokensSync(),!(l=c.idToken)||!this.tokenManager.hasExpired(l)){t.next=33;break}if(l=void 0,!i){t.next=32;break}return t.prev=22,t.next=25,this.tokenManager.renew("idToken");case 25:l=t.sent,t.next=30;break;case 28:t.prev=28,t.t1=t.catch(22);case 30:t.next=33;break;case 32:a&&this.tokenManager.remove("idToken");case 33:return t.abrupt("return",!(!u||!l));case 34:case"end":return t.stop()}}),t,this,[[7,13],[22,28]])})))}},{key:"getUser",value:function(){return gs(this,void 0,void 0,z().mark((function e(){var t,n,r;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.tokenManager.getTokensSync(),n=t.idToken,r=t.accessToken,e.abrupt("return",this.token.getUserInfo(r,n));case 2:case"end":return e.stop()}}),e,this)})))}},{key:"getIdToken",value:function(){var e=this.tokenManager.getTokensSync().idToken;return e?e.idToken:void 0}},{key:"getAccessToken",value:function(){var e=this.tokenManager.getTokensSync().accessToken;return e?e.accessToken:void 0}},{key:"getRefreshToken",value:function(){var e=this.tokenManager.getTokensSync().refreshToken;return e?e.refreshToken:void 0}},{key:"storeTokensFromRedirect",value:function(){return gs(this,void 0,void 0,z().mark((function e(){var t,n;return z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.token.parseFromUrl();case 2:t=e.sent,n=t.tokens,this.tokenManager.setTokens(n);case 5:case"end":return e.stop()}}),e,this)})))}},{key:"setOriginalUri",value:function(e,t){Gn.getSessionStorage().setItem(le,e),(t=t||this.options.state)&&this.storageManager.getOriginalUriStorage().setItem(t,e)}},{key:"getOriginalUri",value:function(e){if(e=e||this.options.state){var t=this.storageManager.getOriginalUriStorage().getItem(e);if(t)return t}var n=Gn.getSessionStorage();return n&&n.getItem(le)||void 0}},{key:"removeOriginalUri",value:function(e){if(Gn.getSessionStorage().removeItem(le),e=e||this.options.state){var t=this.storageManager.getOriginalUriStorage();t.removeItem&&t.removeItem(e)}}},{key:"isLoginRedirect",value:function(){return Nt(this)}},{key:"handleLoginRedirect",value:function(e,t){return gs(this,void 0,void 0,z().mark((function n(){var r,o,i;return z().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=this.options.state,!e){n.next=6;break}this.tokenManager.setTokens(e),t=t||this.getOriginalUri(this.options.state),n.next=25;break;case 6:if(!this.isLoginRedirect()){n.next=24;break}return n.prev=7,n.next=10,Pn(this,{});case 10:return o=n.sent,r=o.state,t=t||this.getOriginalUri(r),n.next=15,this.storeTokensFromRedirect();case 15:n.next=22;break;case 17:return n.prev=17,n.t0=n.catch(7),n.next=21,this.authStateManager.updateAuthState();case 21:throw n.t0;case 22:n.next=25;break;case 24:return n.abrupt("return");case 25:return n.next=27,this.authStateManager.updateAuthState();case 27:if(this.removeOriginalUri(r),!(i=this.options.restoreOriginalUri)){n.next=34;break}return n.next=32,i(this,t);case 32:n.next=35;break;case 34:t&&window.location.replace(t);case 35:case"end":return n.stop()}}),n,this,[[7,17]])})))}},{key:"isPKCE",value:function(){return!!this.options.pkce}},{key:"hasResponseType",value:function(e){return Array.isArray(this.options.responseType)&&this.options.responseType.length?this.options.responseType.indexOf(e)>=0:this.options.responseType===e}},{key:"isAuthorizationCodeFlow",value:function(){return this.hasResponseType("code")}},{key:"getIssuerOrigin",value:function(){return this.options.issuer.split("/oauth2/")[0]}},{key:"forgotPassword",value:function(e){return qe(this,"/api/v1/authn/recovery/password",e)}},{key:"unlockAccount",value:function(e){return qe(this,"/api/v1/authn/recovery/unlock",e)}},{key:"verifyRecoveryToken",value:function(e){return qe(this,"/api/v1/authn/recovery/token",e)}},{key:"invokeApiMethod",value:function(e){return gs(this,void 0,void 0,z().mark((function t(){var n;return z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.accessToken){t.next=5;break}return t.next=3,this.tokenManager.getTokens();case 3:n=t.sent.accessToken,e.accessToken=null==n?void 0:n.accessToken;case 5:return t.abrupt("return",_e(this,e));case 6:case"end":return t.stop()}}),t,this)})))}}]),e}();bs.features=bs.prototype.features=o,bs.crypto=e,bs.webauthn=i,Object.assign(bs,{constants:t});var ks=bs}(),r}()}));
3
3
  //# sourceMappingURL=okta-auth-js.umd.js.map