@flarehr/apollo-benefits 2.12.366 → 2.12.368

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.
Files changed (42) hide show
  1. package/dist/assets/banner-icon-dd5e974a.js +456 -0
  2. package/dist/assets/{contentful-service-ec08fb7b.js → contentful-service-aef0566a.js} +2 -2
  3. package/dist/assets/formik.esm-f59e445c.js +8 -0
  4. package/dist/assets/header-c8b1645a.js +1 -0
  5. package/dist/assets/index-3dc81d1d.js +1 -0
  6. package/dist/assets/index-52c3a920.js +2 -0
  7. package/dist/assets/index-572ac200.js +1 -0
  8. package/dist/assets/index-728c5d9e.js +28 -0
  9. package/dist/assets/index-a63bc832.js +1 -0
  10. package/dist/assets/index-b80f1ed5.js +1 -0
  11. package/dist/assets/index-c5c3bb02.js +1 -0
  12. package/dist/assets/index-c5f8d653.js +1 -0
  13. package/dist/assets/index-d499c1ee.js +1 -0
  14. package/dist/assets/index-fee1b285.js +1 -0
  15. package/dist/assets/{item-details-35ad7588.js → item-details-f4dde7c7.js} +2 -2
  16. package/dist/assets/loading-state-63ca3a52.js +1 -0
  17. package/dist/assets/modal-240be87a.js +1 -0
  18. package/dist/assets/motion-0b0c6f7d.js +1 -0
  19. package/dist/assets/pillar-tag-20509680.js +1 -0
  20. package/dist/assets/use-feature-flag-f624fbae.js +1 -0
  21. package/dist/assets/vendor-ece7687a.js +107 -0
  22. package/dist/index.html +27 -2
  23. package/dist/sw-esm.js +4 -1
  24. package/package.json +1 -1
  25. package/dist/assets/banner-icon-0117e93c.js +0 -456
  26. package/dist/assets/formik.esm-d8b8267f.js +0 -8
  27. package/dist/assets/header-e651d68b.js +0 -1
  28. package/dist/assets/index-24d35a11.js +0 -28
  29. package/dist/assets/index-58cc2d72.js +0 -1
  30. package/dist/assets/index-7ce86e27.js +0 -1
  31. package/dist/assets/index-84b83088.js +0 -1
  32. package/dist/assets/index-bd9ee342.js +0 -1
  33. package/dist/assets/index-c1d302f8.js +0 -1
  34. package/dist/assets/index-c40b5413.js +0 -107
  35. package/dist/assets/index-cfddcd4c.js +0 -1
  36. package/dist/assets/index-e7929e3d.js +0 -1
  37. package/dist/assets/index-f88c4655.js +0 -2
  38. package/dist/assets/loading-state-4b750837.js +0 -1
  39. package/dist/assets/modal-e9f61093.js +0 -1
  40. package/dist/assets/motion-aecc8ecb.js +0 -1
  41. package/dist/assets/pillar-tag-d2869d71.js +0 -1
  42. package/dist/assets/use-feature-flag-17b4c424.js +0 -1
@@ -0,0 +1,107 @@
1
+ const hi={type:null,entityIds:null,skip:!1,payload:null};let Wo=!1;function jl(){Wo=!1}function cr(e,t,n){Rt(e,t,n),Wo=!0}function Rt(e,t,n){Wo===!1&&(hi.type=e,hi.entityIds=t,hi.payload=n)}function Bl(e,t){return function(n,r,s){const a=s.value;return s.value=function(...c){return cr(e,t),a.apply(this,c)},s}}function $r(e,t){return e.hasOwnProperty(t)}function fn(e){return Array.isArray(e)}function tu(e){return e.hasOwnProperty("active")}function nu(e){return fn(e)}function ru({active:e,ids:t,entities:n}){return nu(e)?Hl(e,t):$r(n,e)===!1?null:e}function Hl(e,t){const n=e.filter(r=>t.indexOf(r)>-1);return n.length===e.length?e:n}function $l({state:e,entities:t,idKey:n,options:r={},preAddEntity:s}){let a={},c=[],d=!1;for(const g of t)if($r(e.entities,g[n])===!1){const f=s(g),p=f[n];a[p]=f,r.prepend?c.unshift(p):c.push(p),d=!0}return d?{newState:{...e,entities:{...e.entities,...a},ids:r.prepend?[...c,...e.ids]:[...e.ids,...c]},newIds:c}:null}function sn(e){return e==null}function Vt(e){return sn(e)?[]:Array.isArray(e)?e:[e]}var yo=function(e,t){return yo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[s]=r[s])},yo(e,t)};function pn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");yo(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function Jo(e,t,n,r){var s=arguments.length,a=s<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var d=e.length-1;d>=0;d--)(c=e[d])&&(a=(s<3?c(a):s>3?c(t,n,a):c(t,n))||a);return s>3&&a&&Object.defineProperty(t,n,a),a}function Sn(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Kl(e,t,n,r){function s(a){return a instanceof n?a:new n(function(c){c(a)})}return new(n||(n=Promise))(function(a,c){function d(p){try{f(r.next(p))}catch(h){c(h)}}function g(p){try{f(r.throw(p))}catch(h){c(h)}}function f(p){p.done?a(p.value):s(p.value).then(d,g)}f((r=r.apply(e,t||[])).next())})}function iu(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,s,a,c;return c={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function d(f){return function(p){return g([f,p])}}function g(f){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,f[0]&&(n=0)),n;)try{if(r=1,s&&(a=f[0]&2?s.return:f[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,f[1])).done)return a;switch(s=0,a&&(f=[f[0]&2,a.value]),f[0]){case 0:case 1:a=f;break;case 4:return n.label++,{value:f[1],done:!1};case 5:n.label++,s=f[1],f=[0];continue;case 7:f=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!a||f[1]>a[0]&&f[1]<a[3])){n.label=f[1];break}if(f[0]===6&&n.label<a[1]){n.label=a[1],a=f;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(f);break}a[2]&&n.ops.pop(),n.trys.pop();continue}f=t.call(e,n)}catch(p){f=[6,p],s=0}finally{r=a=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function hr(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Un(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),s,a=[],c;try{for(;(t===void 0||t-- >0)&&!(s=r.next()).done;)a.push(s.value)}catch(d){c={error:d}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(c)throw c.error}}return a}function Gn(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function lr(e){return this instanceof lr?(this.v=e,this):new lr(e)}function Vl(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),s,a=[];return s={},c("next"),c("throw"),c("return"),s[Symbol.asyncIterator]=function(){return this},s;function c(m){r[m]&&(s[m]=function(_){return new Promise(function(w,P){a.push([m,_,w,P])>1||d(m,_)})})}function d(m,_){try{g(r[m](_))}catch(w){h(a[0][3],w)}}function g(m){m.value instanceof lr?Promise.resolve(m.value.v).then(f,p):h(a[0][2],m)}function f(m){d("next",m)}function p(m){d("throw",m)}function h(m,_){m(_),a.shift(),a.length&&d(a[0][0],a[0][1])}}function ql(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof hr=="function"?hr(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=e[a]&&function(c){return new Promise(function(d,g){c=e[a](c),s(d,g,c.done,c.value)})}}function s(a,c,d,g){Promise.resolve(g).then(function(f){a({value:f,done:d})},c)}}function xe(e){return typeof e=="function"}function ou(e){var t=function(r){Error.call(r),r.stack=new Error().stack},n=e(t);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var eo=ou(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription:
2
+ `+n.map(function(r,s){return s+1+") "+r.toString()}).join(`
3
+ `):"",this.name="UnsubscriptionError",this.errors=n}});function yi(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Gr=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,n,r,s,a;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var d=hr(c),g=d.next();!g.done;g=d.next()){var f=g.value;f.remove(this)}}catch(P){t={error:P}}finally{try{g&&!g.done&&(n=d.return)&&n.call(d)}finally{if(t)throw t.error}}else c.remove(this);var p=this.initialTeardown;if(xe(p))try{p()}catch(P){a=P instanceof eo?P.errors:[P]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var m=hr(h),_=m.next();!_.done;_=m.next()){var w=_.value;try{zs(w)}catch(P){a=a??[],P instanceof eo?a=Gn(Gn([],Un(a)),Un(P.errors)):a.push(P)}}}catch(P){r={error:P}}finally{try{_&&!_.done&&(s=m.return)&&s.call(m)}finally{if(r)throw r.error}}}if(a)throw new eo(a)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)zs(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&yi(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&yi(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),su=Gr.EMPTY;function au(e){return e instanceof Gr||e&&"closed"in e&&xe(e.remove)&&xe(e.add)&&xe(e.unsubscribe)}function zs(e){xe(e)?e():e.unsubscribe()}var uu={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},_o={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var s=_o.delegate;return s!=null&&s.setTimeout?s.setTimeout.apply(s,Gn([e,t],Un(n))):setTimeout.apply(void 0,Gn([e,t],Un(n)))},clearTimeout:function(e){var t=_o.delegate;return((t==null?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function cu(e){_o.setTimeout(function(){throw e})}function bo(){}function di(e){e()}var zo=function(e){pn(t,e);function t(n){var r=e.call(this)||this;return r.isStopped=!1,n?(r.destination=n,au(n)&&n.add(r)):r.destination=Yl,r}return t.create=function(n,r,s){return new So(n,r,s)},t.prototype.next=function(n){this.isStopped||this._next(n)},t.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(n){this.destination.next(n)},t.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Gr),Wl=Function.prototype.bind;function to(e,t){return Wl.call(e,t)}var Jl=function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var n=this.partialObserver;if(n.next)try{n.next(t)}catch(r){ci(r)}},e.prototype.error=function(t){var n=this.partialObserver;if(n.error)try{n.error(t)}catch(r){ci(r)}else ci(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(n){ci(n)}},e}(),So=function(e){pn(t,e);function t(n,r,s){var a=e.call(this)||this,c;if(xe(n)||!n)c={next:n??void 0,error:r??void 0,complete:s??void 0};else{var d;a&&uu.useDeprecatedNextContext?(d=Object.create(n),d.unsubscribe=function(){return a.unsubscribe()},c={next:n.next&&to(n.next,d),error:n.error&&to(n.error,d),complete:n.complete&&to(n.complete,d)}):c=n}return a.destination=new Jl(c),a}return t}(zo);function ci(e){cu(e)}function zl(e){throw e}var Yl={closed:!0,next:bo,error:zl,complete:bo},Yo=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function br(e){return e}function Gl(e){return e.length===0?br:e.length===1?e[0]:function(n){return e.reduce(function(r,s){return s(r)},n)}}var Ot=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(t,n,r){var s=this,a=Ql(t)?t:new So(t,n,r);return di(function(){var c=s,d=c.operator,g=c.source;a.add(d?d.call(a,g):g?s._subscribe(a):s._trySubscribe(a))}),a},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(n){t.error(n)}},e.prototype.forEach=function(t,n){var r=this;return n=Ys(n),new n(function(s,a){var c=new So({next:function(d){try{t(d)}catch(g){a(g),c.unsubscribe()}},error:a,complete:s});r.subscribe(c)})},e.prototype._subscribe=function(t){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(t)},e.prototype[Yo]=function(){return this},e.prototype.pipe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Gl(t)(this)},e.prototype.toPromise=function(t){var n=this;return t=Ys(t),new t(function(r,s){var a;n.subscribe(function(c){return a=c},function(c){return s(c)},function(){return r(a)})})},e.create=function(t){return new e(t)},e}();function Ys(e){var t;return(t=e??uu.Promise)!==null&&t!==void 0?t:Promise}function Xl(e){return e&&xe(e.next)&&xe(e.error)&&xe(e.complete)}function Ql(e){return e&&e instanceof zo||Xl(e)&&au(e)}function Zl(e){return xe(e==null?void 0:e.lift)}function Qt(e){return function(t){if(Zl(t))return t.lift(function(n){try{return e(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function Mt(e,t,n,r,s){return new ef(e,t,n,r,s)}var ef=function(e){pn(t,e);function t(n,r,s,a,c,d){var g=e.call(this,n)||this;return g.onFinalize=c,g.shouldUnsubscribe=d,g._next=r?function(f){try{r(f)}catch(p){n.error(p)}}:e.prototype._next,g._error=a?function(f){try{a(f)}catch(p){n.error(p)}finally{this.unsubscribe()}}:e.prototype._error,g._complete=s?function(){try{s()}catch(f){n.error(f)}finally{this.unsubscribe()}}:e.prototype._complete,g}return t.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},t}(zo),tf=ou(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Pn=function(e){pn(t,e);function t(){var n=e.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return t.prototype.lift=function(n){var r=new Gs(this,this);return r.operator=n,r},t.prototype._throwIfClosed=function(){if(this.closed)throw new tf},t.prototype.next=function(n){var r=this;di(function(){var s,a;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var c=hr(r.currentObservers),d=c.next();!d.done;d=c.next()){var g=d.value;g.next(n)}}catch(f){s={error:f}}finally{try{d&&!d.done&&(a=c.return)&&a.call(c)}finally{if(s)throw s.error}}}})},t.prototype.error=function(n){var r=this;di(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var s=r.observers;s.length;)s.shift().error(n)}})},t.prototype.complete=function(){var n=this;di(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(n){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,n)},t.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},t.prototype._innerSubscribe=function(n){var r=this,s=this,a=s.hasError,c=s.isStopped,d=s.observers;return a||c?su:(this.currentObservers=null,d.push(n),new Gr(function(){r.currentObservers=null,yi(d,n)}))},t.prototype._checkFinalizedStatuses=function(n){var r=this,s=r.hasError,a=r.thrownError,c=r.isStopped;s?n.error(a):c&&n.complete()},t.prototype.asObservable=function(){var n=new Ot;return n.source=this,n},t.create=function(n,r){return new Gs(n,r)},t}(Ot),Gs=function(e){pn(t,e);function t(n,r){var s=e.call(this)||this;return s.destination=n,s.source=r,s}return t.prototype.next=function(n){var r,s;(s=(r=this.destination)===null||r===void 0?void 0:r.next)===null||s===void 0||s.call(r,n)},t.prototype.error=function(n){var r,s;(s=(r=this.destination)===null||r===void 0?void 0:r.error)===null||s===void 0||s.call(r,n)},t.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},t.prototype._subscribe=function(n){var r,s;return(s=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&s!==void 0?s:su},t}(Pn),_i=function(e){pn(t,e);function t(n){var r=e.call(this)||this;return r._value=n,r}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(n){var r=e.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},t.prototype.getValue=function(){var n=this,r=n.hasError,s=n.thrownError,a=n._value;if(r)throw s;return this._throwIfClosed(),a},t.prototype.next=function(n){e.prototype.next.call(this,this._value=n)},t}(Pn),Go={now:function(){return(Go.delegate||Date).now()},delegate:void 0},lu=function(e){pn(t,e);function t(n,r,s){n===void 0&&(n=1/0),r===void 0&&(r=1/0),s===void 0&&(s=Go);var a=e.call(this)||this;return a._bufferSize=n,a._windowTime=r,a._timestampProvider=s,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=r===1/0,a._bufferSize=Math.max(1,n),a._windowTime=Math.max(1,r),a}return t.prototype.next=function(n){var r=this,s=r.isStopped,a=r._buffer,c=r._infiniteTimeWindow,d=r._timestampProvider,g=r._windowTime;s||(a.push(n),!c&&a.push(d.now()+g)),this._trimBuffer(),e.prototype.next.call(this,n)},t.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),s=this,a=s._infiniteTimeWindow,c=s._buffer,d=c.slice(),g=0;g<d.length&&!n.closed;g+=a?1:2)n.next(d[g]);return this._checkFinalizedStatuses(n),r},t.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,s=n._timestampProvider,a=n._buffer,c=n._infiniteTimeWindow,d=(c?1:2)*r;if(r<1/0&&d<a.length&&a.splice(0,a.length-d),!c){for(var g=s.now(),f=0,p=1;p<a.length&&a[p]<=g;p+=2)f=p;f&&a.splice(0,f+1)}},t}(Pn),nf=function(e){pn(t,e);function t(n,r){return e.call(this)||this}return t.prototype.schedule=function(n,r){return this},t}(Gr),bi={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var s=bi.delegate;return s!=null&&s.setInterval?s.setInterval.apply(s,Gn([e,t],Un(n))):setInterval.apply(void 0,Gn([e,t],Un(n)))},clearInterval:function(e){var t=bi.delegate;return((t==null?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},rf=function(e){pn(t,e);function t(n,r){var s=e.call(this,n,r)||this;return s.scheduler=n,s.work=r,s.pending=!1,s}return t.prototype.schedule=function(n,r){var s;if(r===void 0&&(r=0),this.closed)return this;this.state=n;var a=this.id,c=this.scheduler;return a!=null&&(this.id=this.recycleAsyncId(c,a,r)),this.pending=!0,this.delay=r,this.id=(s=this.id)!==null&&s!==void 0?s:this.requestAsyncId(c,this.id,r),this},t.prototype.requestAsyncId=function(n,r,s){return s===void 0&&(s=0),bi.setInterval(n.flush.bind(n,this),s)},t.prototype.recycleAsyncId=function(n,r,s){if(s===void 0&&(s=0),s!=null&&this.delay===s&&this.pending===!1)return r;r!=null&&bi.clearInterval(r)},t.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var s=this._execute(n,r);if(s)return s;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(n,r){var s=!1,a;try{this.work(n)}catch(c){s=!0,a=c||new Error("Scheduled action threw falsy error")}if(s)return this.unsubscribe(),a},t.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,s=n.scheduler,a=s.actions;this.work=this.state=this.scheduler=null,this.pending=!1,yi(a,this),r!=null&&(this.id=this.recycleAsyncId(s,r,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(nf),Xs=function(){function e(t,n){n===void 0&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(t,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,t).schedule(r,n)},e.now=Go.now,e}(),of=function(e){pn(t,e);function t(n,r){r===void 0&&(r=Xs.now);var s=e.call(this,n,r)||this;return s.actions=[],s._active=!1,s}return t.prototype.flush=function(n){var r=this.actions;if(this._active){r.push(n);return}var s;this._active=!0;do if(s=n.execute(n.state,n.delay))break;while(n=r.shift());if(this._active=!1,s){for(;n=r.shift();)n.unsubscribe();throw s}},t}(Xs),Di=new of(rf),sf=Di,af=new Ot(function(e){return e.complete()});function fu(e){return e&&xe(e.schedule)}function hu(e){return e[e.length-1]}function uf(e){return xe(hu(e))?e.pop():void 0}function Xo(e){return fu(hu(e))?e.pop():void 0}var Qo=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function du(e){return xe(e==null?void 0:e.then)}function pu(e){return xe(e[Yo])}function gu(e){return Symbol.asyncIterator&&xe(e==null?void 0:e[Symbol.asyncIterator])}function vu(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function cf(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var mu=cf();function yu(e){return xe(e==null?void 0:e[mu])}function _u(e){return Vl(this,arguments,function(){var n,r,s,a;return iu(this,function(c){switch(c.label){case 0:n=e.getReader(),c.label=1;case 1:c.trys.push([1,,9,10]),c.label=2;case 2:return[4,lr(n.read())];case 3:return r=c.sent(),s=r.value,a=r.done,a?[4,lr(void 0)]:[3,5];case 4:return[2,c.sent()];case 5:return[4,lr(s)];case 6:return[4,c.sent()];case 7:return c.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function bu(e){return xe(e==null?void 0:e.getReader)}function Tn(e){if(e instanceof Ot)return e;if(e!=null){if(pu(e))return lf(e);if(Qo(e))return ff(e);if(du(e))return hf(e);if(gu(e))return Su(e);if(yu(e))return df(e);if(bu(e))return pf(e)}throw vu(e)}function lf(e){return new Ot(function(t){var n=e[Yo]();if(xe(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function ff(e){return new Ot(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function hf(e){return new Ot(function(t){e.then(function(n){t.closed||(t.next(n),t.complete())},function(n){return t.error(n)}).then(null,cu)})}function df(e){return new Ot(function(t){var n,r;try{for(var s=hr(e),a=s.next();!a.done;a=s.next()){var c=a.value;if(t.next(c),t.closed)return}}catch(d){n={error:d}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}t.complete()})}function Su(e){return new Ot(function(t){gf(e,t).catch(function(n){return t.error(n)})})}function pf(e){return Su(_u(e))}function gf(e,t){var n,r,s,a;return Kl(this,void 0,void 0,function(){var c,d;return iu(this,function(g){switch(g.label){case 0:g.trys.push([0,5,6,11]),n=ql(e),g.label=1;case 1:return[4,n.next()];case 2:if(r=g.sent(),!!r.done)return[3,4];if(c=r.value,t.next(c),t.closed)return[2];g.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return d=g.sent(),s={error:d},[3,11];case 6:return g.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:g.sent(),g.label=8;case 8:return[3,10];case 9:if(s)throw s.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function wn(e,t,n,r,s){r===void 0&&(r=0),s===void 0&&(s=!1);var a=t.schedule(function(){n(),s?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!s)return a}function wu(e,t){return t===void 0&&(t=0),Qt(function(n,r){n.subscribe(Mt(r,function(s){return wn(r,e,function(){return r.next(s)},t)},function(){return wn(r,e,function(){return r.complete()},t)},function(s){return wn(r,e,function(){return r.error(s)},t)}))})}function Eu(e,t){return t===void 0&&(t=0),Qt(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function vf(e,t){return Tn(e).pipe(Eu(t),wu(t))}function mf(e,t){return Tn(e).pipe(Eu(t),wu(t))}function yf(e,t){return new Ot(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function _f(e,t){return new Ot(function(n){var r;return wn(n,t,function(){r=e[mu](),wn(n,t,function(){var s,a,c;try{s=r.next(),a=s.value,c=s.done}catch(d){n.error(d);return}c?n.complete():n.next(a)},0,!0)}),function(){return xe(r==null?void 0:r.return)&&r.return()}})}function Fu(e,t){if(!e)throw new Error("Iterable cannot be null");return new Ot(function(n){wn(n,t,function(){var r=e[Symbol.asyncIterator]();wn(n,t,function(){r.next().then(function(s){s.done?n.complete():n.next(s.value)})},0,!0)})})}function bf(e,t){return Fu(_u(e),t)}function Sf(e,t){if(e!=null){if(pu(e))return vf(e,t);if(Qo(e))return yf(e,t);if(du(e))return mf(e,t);if(gu(e))return Fu(e,t);if(yu(e))return _f(e,t);if(bu(e))return bf(e,t)}throw vu(e)}function Sr(e,t){return t?Sf(e,t):Tn(e)}function Zo(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Xo(e);return Sr(e,n)}function Au(e){return!!e&&(e instanceof Ot||xe(e.lift)&&xe(e.subscribe))}function wf(e){return e instanceof Date&&!isNaN(e)}function jt(e,t){return Qt(function(n,r){var s=0;n.subscribe(Mt(r,function(a){r.next(e.call(t,a,s++))}))})}var Ef=Array.isArray;function Ff(e,t){return Ef(t)?e.apply(void 0,Gn([],Un(t))):e(t)}function Pu(e){return jt(function(t){return Ff(e,t)})}var Af=Array.isArray,Pf=Object.getPrototypeOf,kf=Object.prototype,Tf=Object.keys;function Cf(e){if(e.length===1){var t=e[0];if(Af(t))return{args:t,keys:null};if(If(t)){var n=Tf(t);return{args:n.map(function(r){return t[r]}),keys:n}}}return{args:e,keys:null}}function If(e){return e&&typeof e=="object"&&Pf(e)===kf}function Rf(e,t){return e.reduce(function(n,r,s){return n[r]=t[s],n},{})}function Of(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Xo(e),r=uf(e),s=Cf(e),a=s.args,c=s.keys;if(a.length===0)return Sr([],n);var d=new Ot(Lf(a,n,c?function(g){return Rf(c,g)}:br));return r?d.pipe(Pu(r)):d}function Lf(e,t,n){return n===void 0&&(n=br),function(r){Qs(t,function(){for(var s=e.length,a=new Array(s),c=s,d=s,g=function(p){Qs(t,function(){var h=Sr(e[p],t),m=!1;h.subscribe(Mt(r,function(_){a[p]=_,m||(m=!0,d--),d||r.next(n(a.slice()))},function(){--c||r.complete()}))},r)},f=0;f<s;f++)g(f)},r)}}function Qs(e,t,n){e?wn(n,e,t):t()}function Df(e,t,n,r,s,a,c,d){var g=[],f=0,p=0,h=!1,m=function(){h&&!g.length&&!f&&t.complete()},_=function(P){return f<r?w(P):g.push(P)},w=function(P){a&&t.next(P),f++;var I=!1;Tn(n(P,p++)).subscribe(Mt(t,function(R){s==null||s(R),a?_(R):t.next(R)},function(){I=!0},void 0,function(){if(I)try{f--;for(var R=function(){var E=g.shift();c?wn(t,c,function(){return w(E)}):w(E)};g.length&&f<r;)R();m()}catch(E){t.error(E)}}))};return e.subscribe(Mt(t,_,function(){h=!0,m()})),function(){d==null||d()}}function Ni(e,t,n){return n===void 0&&(n=1/0),xe(t)?Ni(function(r,s){return jt(function(a,c){return t(r,a,s,c)})(Tn(e(r,s)))},n):(typeof t=="number"&&(n=t),Qt(function(r,s){return Df(r,s,e,n)}))}function Nf(e){return e===void 0&&(e=1/0),Ni(br,e)}function Mf(){return Nf(1)}function Uf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Mf()(Sr(e,Xo(e)))}var xf=["addListener","removeListener"],jf=["addEventListener","removeEventListener"],Bf=["on","off"];function Zs(e,t,n,r){if(xe(n)&&(r=n,n=void 0),r)return Zs(e,t,n).pipe(Pu(r));var s=Un(Kf(e)?jf.map(function(d){return function(g){return e[d](t,g,n)}}):Hf(e)?xf.map(ea(e,t)):$f(e)?Bf.map(ea(e,t)):[],2),a=s[0],c=s[1];if(!a&&Qo(e))return Ni(function(d){return Zs(d,t,n)})(Tn(e));if(!a)throw new TypeError("Invalid event target");return new Ot(function(d){var g=function(){for(var f=[],p=0;p<arguments.length;p++)f[p]=arguments[p];return d.next(1<f.length?f:f[0])};return a(g),function(){return c(g)}})}function ea(e,t){return function(n){return function(r){return e[n](t,r)}}}function Hf(e){return xe(e.addListener)&&xe(e.removeListener)}function $f(e){return xe(e.on)&&xe(e.off)}function Kf(e){return xe(e.addEventListener)&&xe(e.removeEventListener)}function ku(e,t,n){e===void 0&&(e=0),n===void 0&&(n=sf);var r=-1;return t!=null&&(fu(t)?n=t:r=t),new Ot(function(s){var a=wf(e)?+e-n.now():e;a<0&&(a=0);var c=0;return n.schedule(function(){s.closed||(s.next(c++),0<=r?this.schedule(void 0,r):s.complete())},a)})}function Mi(e,t){return Qt(function(n,r){var s=0;n.subscribe(Mt(r,function(a){return e.call(t,a,s++)&&r.next(a)}))})}function Vf(e){return Qt(function(t,n){var r=!1,s=null,a=null,c=!1,d=function(){if(a==null||a.unsubscribe(),a=null,r){r=!1;var f=s;s=null,n.next(f)}c&&n.complete()},g=function(){a=null,c&&n.complete()};t.subscribe(Mt(n,function(f){r=!0,s=f,a||Tn(e(f)).subscribe(a=Mt(n,d,g))},function(){c=!0,(!r||!a||a.closed)&&n.complete()}))})}function qf(e,t){return t===void 0&&(t=Di),Vf(function(){return ku(e,t)})}function lm(e,t){return t===void 0&&(t=Di),Qt(function(n,r){var s=null,a=null,c=null,d=function(){if(s){s.unsubscribe(),s=null;var f=a;a=null,r.next(f)}};function g(){var f=c+e,p=t.now();if(p<f){s=this.schedule(void 0,f-p),r.add(s);return}d()}n.subscribe(Mt(r,function(f){a=f,c=t.now(),s||(s=t.schedule(g,e),r.add(s))},function(){d(),r.complete()},void 0,function(){a=s=null}))})}function wo(e){return e<=0?function(){return af}:Qt(function(t,n){var r=0;t.subscribe(Mt(n,function(s){++r<=e&&(n.next(s),e<=r&&n.complete())}))})}function Wf(){return Qt(function(e,t){e.subscribe(Mt(t,bo))})}function Jf(e){return jt(function(){return e})}function Tu(e,t){return t?function(n){return Uf(t.pipe(wo(1),Wf()),n.pipe(Tu(e)))}:Ni(function(n,r){return Tn(e(n,r)).pipe(wo(1),Jf(n))})}function zf(e,t){t===void 0&&(t=Di);var n=ku(e,t);return Tu(function(){return n})}function Kr(e,t){return t===void 0&&(t=br),e=e??Yf,Qt(function(n,r){var s,a=!0;n.subscribe(Mt(r,function(c){var d=t(c);(a||!e(s,d))&&(a=!1,s=d,r.next(c))}))})}function Yf(e,t){return e===t}function fm(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.length;if(n===0)throw new Error("list of properties cannot be empty.");return jt(function(r){for(var s=r,a=0;a<n;a++){var c=s==null?void 0:s[e[a]];if(typeof c<"u")s=c;else return}return s})}function Gf(e){return Mi(function(t,n){return e<=n})}function pi(e,t){return Qt(function(n,r){var s=null,a=0,c=!1,d=function(){return c&&!s&&r.complete()};n.subscribe(Mt(r,function(g){s==null||s.unsubscribe();var f=0,p=a++;Tn(e(g,p)).subscribe(s=Mt(r,function(h){return r.next(t?t(g,h,p,f++):h)},function(){s=null,d()}))},function(){c=!0,d()}))})}function hm(e,t,n){var r=xe(e)||t||n?{next:e,error:t,complete:n}:e;return r?Qt(function(s,a){var c;(c=r.subscribe)===null||c===void 0||c.call(r);var d=!0;s.subscribe(Mt(a,function(g){var f;(f=r.next)===null||f===void 0||f.call(r,g),a.next(g)},function(){var g;d=!1,(g=r.complete)===null||g===void 0||g.call(r),a.complete()},function(g){var f;d=!1,(f=r.error)===null||f===void 0||f.call(r,g),a.error(g)},function(){var g,f;d&&((g=r.unsubscribe)===null||g===void 0||g.call(r)),(f=r.finalize)===null||f===void 0||f.call(r)}))}):br}const Xf="id";function mn(e){return fn(e)?e.length===0:!1}function ht(e){return typeof e=="function"}function Qf(){return Kr((e,t)=>e===t?!0:!fn(e)||!fn(t)?!1:mn(e)&&mn(t)?!0:e.length!==t.length?!1:t.some((r,s)=>e[s]!==r)===!1)}function es(e){const t=typeof e;return e!=null&&(t=="object"||t=="function")}function dm(e){return Of(e).pipe(qf(0))}let Cu={resettable:!1,ttl:null,producerFn:void 0};function ta(){return Cu}function Zf(){return Cu.producerFn}function Si(e){return sn(e)===!1}const Iu=new Pn,Ru=new lu(50,5e3),eh=new Pn;function th(e){Iu.next(e)}function nh(e){Ru.next(e)}function rh(e,t){eh.next({storeName:e,action:t})}const Ui=typeof window<"u",ih=!Ui,na=()=>{try{return typeof localStorage<"u"}catch{return!1}},oh=()=>{try{return typeof sessionStorage<"u"}catch{return!1}},hn={},Ou={};Ui&&(window.$$stores=hn,window.$$queries=Ou);var wi;(function(e){e.ASC="asc",e.DESC="desc"})(wi||(wi={}));function sh(e,t=wi.ASC){return function(n,r){if(!n.hasOwnProperty(e)||!r.hasOwnProperty(e))return 0;const s=typeof n[e]=="string"?n[e].toUpperCase():n[e],a=typeof r[e]=="string"?r[e].toUpperCase():r[e];let c=0;return s>a?c=1:s<a&&(c=-1),t==wi.DESC?c*-1:c}}function ah(e,t){let n=[];const{ids:r,entities:s}=e,{filterBy:a,limitTo:c,sortBy:d,sortByOrder:g}=t;for(let p=0;p<r.length;p++){const h=s[r[p]];if(!a){n.push(h);continue}Vt(a).every(w=>w(h,p))&&n.push(h)}if(d){let p=ht(d)?d:sh(d,g);n=n.sort((h,m)=>p(h,m,e))}const f=Math.min(c||n.length,n.length);return f===n.length?n:n.slice(0,f)}function uh(e,t){const n={},{filterBy:r,limitTo:s}=t,{ids:a,entities:c}=e;if(!r&&!s)return c;const d=sn(s)===!1;if(r&&d){let g=0;for(let f=0,p=a.length;f<p&&g!==s;f++){const h=a[f],m=c[h];Vt(r).every(w=>w(m,f))&&(n[h]=m,g++)}}else{const g=Math.min(s||a.length,a.length);for(let f=0;f<g;f++){const p=a[f],h=c[p];if(!r){n[p]=h;continue}Vt(r).every(_=>_(h,f))&&(n[p]=h)}}return n}var In;(function(e){e.Set="Set",e.Add="Add",e.Update="Update",e.Remove="Remove"})(In||(In={}));let ts=!0;function pm(){ts=!1,Ui&&(delete window.$$stores,delete window.$$queries)}function lt(){return ts}function ch(e,t,n){let r;if(fn(e))r=e;else if(es(e)){if(sn(n))return;e=Object.assign({wrap:!0},e);const s=t.indexOf(n);if(e.prev){const a=s===0;if(a&&!e.wrap)return;r=a?t[t.length-1]:t[s-1]}else if(e.next){const a=t.length===s+1;if(a&&!e.wrap)return;r=a?t[0]:t[s+1]}}else{if(e===n)return;r=e}return r}const lh=()=>({entities:{},ids:[],loading:!0,error:null});function sr(e){return e===void 0}function fh({state:e,ids:t}){if(sn(t))return hh(e);const n=e.entities;let r={};for(const a of e.ids)t.includes(a)===!1&&(r[a]=n[a]);const s={...e,entities:r,ids:e.ids.filter(a=>t.includes(a)===!1)};return tu(e)&&(s.active=ru(s)),s}function hh(e){return{...e,entities:{},ids:[],active:nu(e.active)?[]:null}}function dh(e,t,n){const r={entities:{},ids:[]};for(const s of e){const a=n(s);r.entities[a[t]]=a,r.ids.push(a[t])}return r}function ph(e){return e.entities&&e.ids}function ra(e,t){let n={};for(const r of Object.keys(e))n[r]=t(e[r]);return n}function gh({state:e,entities:t,idKey:n,preAddEntity:r,isNativePreAdd:s}){let a,c;if(fn(t)){const g=dh(t,n,r);a=g.entities,c=g.ids}else ph(t)?(a=s?t.entities:ra(t.entities,r),c=t.ids):(a=s?t:ra(t,r),c=Object.keys(a).map(g=>isNaN(g)?g:Number(g)));const d={...e,entities:a,ids:c,loading:!1};return tu(e)&&(d.active=ru(d)),d}function Lu(e){Object.freeze(e);const t=typeof e=="function",n=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(e).forEach(function(r){n.call(e,r)&&(!t||r!=="caller"&&r!=="callee"&&r!=="arguments")&&e[r]!==null&&(typeof e[r]=="object"||typeof e[r]=="function")&&!Object.isFrozen(e[r])&&Lu(e[r])}),e}function vh(e,t){e||console.error(`@StoreConfig({ name }) is missing in ${t}`)}function ns(e){return e!=null&&`${e}`!="false"}function Eo(e){return ns(e)&&e.constructor.name==="Object"}const gi="akitaConfig";function gm(e){return function(t){t[gi]={idKey:"id"};for(let n=0,r=Object.keys(e);n<r.length;n++){const s=r[n];s==="name"?t[gi].storeName=e[s]:t[gi][s]=e[s]}}}const mh=new Pn,Du=new _i(!1),Dn={activeTransactions:0,batchTransaction:null};function yh(){Nu()||(Dn.batchTransaction=new Pn),Dn.activeTransactions++,Du.next(!0)}function _h(){--Dn.activeTransactions===0&&(Dn.batchTransaction.next(!0),Dn.batchTransaction.complete(),Du.next(!1),mh.next(!0))}function Nu(){return Dn.activeTransactions>0}function bh(){return Dn.batchTransaction?Dn.batchTransaction.asObservable():Zo(!0)}function rs(e,t=void 0){yh();try{return e.apply(t)}finally{cr("@Transaction"),_h()}}function Mu(){return function(e,t,n){const r=n.value;return n.value=function(...s){return rs(()=>r.apply(this,s),this)},n}}class Sh{constructor(t,n={}){this.options=n,this.inTransaction=!1,this.cache={active:new _i(!1),ttl:null},this.onInit(t)}setLoading(t=!1){t!==this._value().loading&&(lt()&&Rt("Set Loading"),this._setState(n=>({...n,loading:t})))}setHasCache(t,n={restartTTL:!1}){if(t!==this.cache.active.value&&this.cache.active.next(t),n.restartTTL){const r=this.getCacheTTL();r&&(this.cache.ttl!==null&&clearTimeout(this.cache.ttl),this.cache.ttl=setTimeout(()=>this.setHasCache(!1),r))}}getValue(){return this.storeValue}setError(t){t!==this._value().error&&(lt()&&Rt("Set Error"),this._setState(n=>({...n,error:t})))}_select(t){return this.store.asObservable().pipe(jt(n=>t(n.state)),Kr())}_value(){return this.storeValue}_cache(){return this.cache.active}get config(){return this.constructor[gi]||{}}get storeName(){return this.config.storeName||this.options.storeName||this.options.name}get deepFreeze(){return this.config.deepFreezeFn||this.options.deepFreezeFn||Lu}get cacheConfig(){return this.config.cache||this.options.cache}get _producerFn(){return this.config.producerFn||this.options.producerFn||Zf()}get resettable(){return Si(this.config.resettable)?this.config.resettable:this.options.resettable}_setState(t,n=!0){if(ht(t)){const r=t(this._value());this.storeValue=ts?this.deepFreeze(r):r}else this.storeValue=t;if(!this.store){this.store=new _i({state:this.storeValue}),lt()&&this.store.subscribe(({action:r})=>{r&&rh(this.storeName,r)});return}if(Nu()){this.handleTransaction();return}this.dispatch(this.storeValue,n)}reset(){this.isResettable()&&(lt()&&Rt("Reset"),this._setState(()=>Object.assign({},this._initialState)),this.setHasCache(!1))}update(t){lt()&&Rt("Update");let n;const r=this._value();ht(t)?n=ht(this._producerFn)?this._producerFn(r,t):t(r):n=t;const s=this.akitaPreUpdate(r,{...r,...n}),a=Eo(r)?s:new r.constructor(s);this._setState(a)}updateStoreConfig(t){this.options={...this.options,...t}}akitaPreUpdate(t,n){return n}destroy(){!(Ui?window.hmrEnabled:!1)&&this===hn[this.storeName]&&(delete hn[this.storeName],th(this.storeName),this.setHasCache(!1),this.cache.active.complete(),this.store.complete())}onInit(t){hn[this.storeName]=this,this._setState(()=>t),nh(this.storeName),this.isResettable()&&(this._initialState=t),lt()&&vh(this.storeName,this.constructor.name)}dispatch(t,n=!0){let r;n&&(r=hi,jl()),this.store.next({state:t,action:r})}watchTransaction(){bh().subscribe(()=>{this.inTransaction=!1,this.dispatch(this._value())})}isResettable(){return this.resettable===!1?!1:this.resettable||ta().resettable}handleTransaction(){this.inTransaction||(this.watchTransaction(),this.inTransaction=!0)}getCacheTTL(){return this.cacheConfig&&this.cacheConfig.ttl||ta().ttl}}function wh({state:e,ids:t,idKey:n,newStateOrFn:r,preUpdateEntity:s,producerFn:a,onEntityIdChanges:c}){const d={};let g=!1,f;for(const m of t){if($r(e.entities,m)===!1)continue;const _=e.entities[m];let w;ht(r)?w=ht(a)?a(_,r):r(_):w=r;const P=w.hasOwnProperty(n)&&w[n]!==_[n];let I;f=m,P&&(g=!0,f=w[n]);const R={..._,...w};Eo(_)?I=R:Eo(w)?I=new _.constructor(R):I=new w.constructor(R),d[f]=s(_,I)}let p=e.ids,h=e.entities;if(g){const[m]=t,{[m]:_,...w}=e.entities;h=w,p=e.ids.map(P=>P===m?f:P),c(m,f)}return{...e,entities:{...h,...d},ids:p}}var ia;class dr extends Sh{constructor(t={},n={}){super({...lh(),...t},n),this.options=n,this.entityActions=new Pn,this.entityIdChanges=new Pn}get selectEntityAction$(){return this.entityActions.asObservable()}get selectEntityIdChanges$(){return this.entityIdChanges.asObservable()}get idKey(){return this.config.idKey||this.options.idKey||Xf}set(t,n={}){if(sn(t))return;lt()&&Rt("Set Entity");const r=this.akitaPreAddEntity===dr.prototype.akitaPreAddEntity;this.setHasCache(!0,{restartTTL:!0}),this._setState(s=>{const a=gh({state:s,entities:t,idKey:this.idKey,preAddEntity:this.akitaPreAddEntity.bind(this),isNativePreAdd:r});return sr(n.activeId)===!1&&(a.active=n.activeId),a}),this.hasInitialUIState()&&this.handleUICreation(),this.entityActions.next({type:In.Set,ids:this.ids})}add(t,n={loading:!1}){const r=Vt(t);if(mn(r))return;const s=$l({state:this._value(),preAddEntity:this.akitaPreAddEntity.bind(this),entities:r,idKey:this.idKey,options:n});s&&(lt()&&Rt("Add Entity"),s.newState.loading=n.loading,this._setState(()=>s.newState),this.hasInitialUIState()&&this.handleUICreation(!0),this.entityActions.next({type:In.Add,ids:s.newIds}))}update(t,n){if(sr(n)){super.update(t);return}let r=[];if(ht(t)?r=this.ids.filter(a=>t(this.entities[a])):r=sn(t)?this.ids:Vt(t),mn(r))return;lt()&&Rt("Update Entity",r);let s;this._setState(a=>wh({idKey:this.idKey,ids:r,preUpdateEntity:this.akitaPreUpdateEntity.bind(this),state:a,newStateOrFn:n,producerFn:this._producerFn,onEntityIdChanges:(c,d)=>{s={oldId:c,newId:d},this.entityIdChanges.next({...s,pending:!0})}})),s&&this.entityIdChanges.next({...s,pending:!1}),this.entityActions.next({type:In.Update,ids:r})}upsert(t,n,r,s={}){const a=Vt(t),c=h=>m=>$r(this.entities,m)===h,d=ht(r)?s.baseClass:r?r.baseClass:void 0,g=ht(d),f=a.filter(c(!0)),p=a.filter(c(!1)).map(h=>{const m=typeof n=="function"?n({}):n,w={...ht(r)?r(h,m):m,[this.idKey]:h};return g?new d(w):w});this.update(f,n),this.add(p),lt()&&cr("Upsert Entity")}upsertMany(t,n={}){const r=[],s=[],a={};for(const c of t){const d=this.akitaPreCheckEntity(c),g=d[this.idKey];if($r(this.entities,g)){const f=this._value().entities[g],p={...this._value().entities[g],...d},h=n.baseClass?new n.baseClass(p):p,m=this.akitaPreUpdateEntity(f,h),_=m[this.idKey];a[_]=m,s.push(_)}else{const f=n.baseClass?new n.baseClass(d):d,p=this.akitaPreAddEntity(f),h=p[this.idKey];r.push(h),a[h]=p}}lt()&&cr("Upsert Many"),this._setState(c=>({...c,ids:r.length?[...c.ids,...r]:c.ids,entities:{...c.entities,...a},loading:!!n.loading})),s.length&&this.entityActions.next({type:In.Update,ids:s}),r.length&&this.entityActions.next({type:In.Add,ids:r}),r.length&&this.hasUIStore()&&this.handleUICreation(!0)}replace(t,n){const r=Vt(t);if(mn(r))return;const s={};for(const a of r)s[a]={...n,[this.idKey]:a};lt()&&Rt("Replace Entity",t),this._setState(a=>({...a,entities:{...a.entities,...s}}))}move(t,n){const r=this.ids.slice();r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),lt()&&Rt("Move Entity"),this._setState(s=>({...s,entities:{...s.entities},ids:r}))}remove(t){if(mn(this.ids))return;const n=Si(t);let r=[];ht(t)?r=this.ids.filter(s=>t(this.entities[s])):r=n?Vt(t):this.ids,!mn(r)&&(lt()&&Rt("Remove Entity",r),this._setState(s=>fh({state:s,ids:r})),n||this.setHasCache(!1),this.handleUIRemove(r),this.entityActions.next({type:In.Remove,ids:r}))}updateActive(t){const n=Vt(this.active);lt()&&Rt("Update Active",n),this.update(n,t)}setActive(t){const n=ch(t,this.ids,this.active);n!==void 0&&(lt()&&Rt("Set Active",n),this._setActive(n))}addActive(t){const n=Vt(t);mn(n)||n.every(s=>this.active.indexOf(s)>-1)||(lt()&&Rt("Add Active",t),this._setState(s=>{const a=Array.from(new Set([...s.active,...n]));return{...s,active:a}}))}removeActive(t){const n=Vt(t);mn(n)||!n.some(s=>this.active.indexOf(s)>-1)||(lt()&&Rt("Remove Active",t),this._setState(s=>({...s,active:Array.isArray(s.active)?s.active.filter(a=>n.indexOf(a)===-1):null})))}toggleActive(t){const n=Vt(t),r=c=>d=>this.active.includes(d)===c,s=n.filter(r(!0)),a=n.filter(r(!1));this.removeActive(s),this.addActive(a),lt()&&cr("Toggle Active")}createUIStore(t={},n={}){const r={name:`UI/${this.storeName}`,idKey:this.idKey};return this.ui=new oa(t,{...r,...n}),this.ui}destroy(){super.destroy(),this.ui instanceof dr&&this.ui.destroy(),this.entityActions.complete()}akitaPreUpdateEntity(t,n){return n}akitaPreAddEntity(t){return t}akitaPreCheckEntity(t){return t}get ids(){return this._value().ids}get entities(){return this._value().entities}get active(){return this._value().active}_setActive(t){this._setState(n=>({...n,active:t}))}handleUICreation(t=!1){const n=this.ids,r=ht(this.ui._akitaCreateEntityFn);let s;const a=c=>{const d=this.entities[c],g=r?this.ui._akitaCreateEntityFn(d):this.ui._akitaCreateEntityFn;return{[this.idKey]:d[this.idKey],...g}};t?s=this.ids.filter(c=>sr(this.ui.entities[c])).map(a):s=n.map(a),t?this.ui.add(s):this.ui.set(s)}hasInitialUIState(){return this.hasUIStore()&&sr(this.ui._akitaCreateEntityFn)===!1}handleUIRemove(t){this.hasUIStore()&&this.ui.remove(t)}hasUIStore(){return this.ui instanceof oa}}Jo([Mu(),Sn("design:type",Function),Sn("design:paramtypes",[Object,Object,Object,Object]),Sn("design:returntype",void 0)],dr.prototype,"upsert",null);Jo([Mu(),Sn("design:type",Function),Sn("design:paramtypes",[typeof(ia=typeof T<"u"&&T)=="function"?ia:Object]),Sn("design:returntype",void 0)],dr.prototype,"toggleActive",null);class oa extends dr{constructor(t={},n={}){super(t,n)}setInitialEntityState(t){this._akitaCreateEntityFn=t}}function Eh(){return Mi(e=>e!=null)}function Fh(e){return function(t,n){const r=ht(e[0]);return e.some(s=>r?s(t)!==s(n):t[s]!==n[s])===!1}}function Uu(e){return typeof e=="string"}const Ah="akitaQueryConfig";class Ph{constructor(t){this.store=t,this.__store__=t,lt()&&(Ou[t.storeName]=this)}select(t){let n;if(ht(t))n=t;else if(Uu(t))n=r=>r[t];else{if(Array.isArray(t))return this.store._select(r=>r).pipe(Kr(Fh(t)),jt(r=>ht(t[0])?t.map(s=>s(r)):t.reduce((s,a)=>(s[a]=r[a],s),{})));n=r=>r}return this.store._select(n)}selectLoading(){return this.select(t=>t.loading)}selectError(){return this.select(t=>t.error)}getValue(){return this.store._value()}selectHasCache(){return this.store._cache().asObservable()}getHasCache(){return this.store._cache().value}get config(){return this.constructor[Ah]}}function kh(e,t){for(const n of Object.keys(t))if(e(t[n])===!0)return n}function sa(e,t){return function(n){const r=n[e];if(!sr(r))return t?Uu(t)?r[t]:t(r):r}}function Th(e,t){return e.reduce((n,r,s,a)=>{const c=t(r,s,a);return c!==void 0&&n.push(c),n},[])}function Ch(e,t){e.sortBy=e.sortBy||t&&t.sortBy,e.sortByOrder=e.sortByOrder||t&&t.sortByOrder}class Ih extends Ph{constructor(t,n={}){super(t),this.options=n,this.__store__=t}selectAll(t={asObject:!1}){return this.select(n=>n.entities).pipe(jt(()=>this.getAll(t)))}getAll(t={asObject:!1,filterBy:void 0,limitTo:void 0}){return t.asObject?uh(this.getValue(),t):(Ch(t,this.config||this.options),ah(this.getValue(),t))}selectMany(t,n){return!t||!t.length?Zo([]):this.select(r=>r.entities).pipe(jt(r=>Th(t,s=>sa(s,n)(r))),Qf())}selectEntity(t,n){let r=t;return ht(t)&&(r=kh(t,this.getValue().entities)),this.select(s=>s.entities).pipe(jt(sa(r,n)),Kr())}getEntity(t){return this.getValue().entities[t]}selectActiveId(){return this.select(t=>t.active)}getActiveId(){return this.getValue().active}selectActive(t){return fn(this.getActive())?this.selectActiveId().pipe(pi(n=>this.selectMany(n,t))):this.selectActiveId().pipe(pi(n=>this.selectEntity(n,t)))}getActive(){const t=this.getActiveId();return fn(t)?t.map(n=>this.getValue().entities[n]):ns(t)?this.getEntity(t):void 0}selectCount(t){return this.select(n=>n.entities).pipe(jt(()=>this.getCount(t)))}getCount(t){return ht(t)?this.getAll().filter(t).length:this.getValue().ids.length}selectLast(t){return this.selectAt(n=>n[n.length-1],t)}selectFirst(t){return this.selectAt(n=>n[0],t)}selectEntityAction(t){if(sn(t))return this.store.selectEntityAction$;const n=fn(t)?s=>s:({ids:s})=>s,r=Vt(t);return this.store.selectEntityAction$.pipe(Mi(({type:s})=>r.includes(s)),jt(s=>n(s)))}hasEntity(t){return sn(t)?this.getValue().ids.length>0:ht(t)?this.getAll().some(t):fn(t)?t.every(n=>n in this.getValue().entities):t in this.getValue().entities}hasActive(t){const n=this.getValue().active,r=Si(t);return Array.isArray(n)?r?n.includes(t):n.length>0:r?n===t:Si(n)}createUIQuery(){this.ui=new Rh(this.__store__.ui)}selectAt(t,n){return this.select(r=>r.ids).pipe(jt(t),Kr(),pi(r=>this.selectEntity(r,n)))}}class Rh extends Ih{constructor(t){super(t)}}function Fo(e,t){return t.split(".").length===1?e:t.split(".").slice(1).join(".").split(".").reduce((r,s)=>r&&r[s],e)}function xu(e,t,n,r=!1){const s=t.split(".");if(s.length===1)return{...e,...n};e={...e};const a=s.length-2;return t.split(".").slice(1).reduce((d,g,f)=>f!==a?(d[g]={...d[g]},d&&d[g]):(d[g]=r||Array.isArray(d[g])||!es(d[g])?n:{...d[g],...n},d&&d[g]),e),e}let Oh=!1;const Lh=new lu(1);function Dh(){return Oh}function Nh(e){return e&&ht(e.then)}function Dr(e){return Nh(e)||Au(e)?Sr(e):Zo(e)}function vm(e){const t={key:"AkitaStores",enableInNonBrowser:!1,storage:na()?localStorage:e.storage,deserialize:JSON.parse,serialize:JSON.stringify,include:[],select:[],persistOnDestroy:!1,preStorageUpdate:function(D,H){return H},preStoreUpdate:function(D,H){return H},skipStorageUpdate:Dh,preStorageUpdateOperator:()=>D=>D},{storage:n,enableInNonBrowser:r,deserialize:s,serialize:a,include:c,select:d,key:g,preStorageUpdate:f,persistOnDestroy:p,preStorageUpdateOperator:h,preStoreUpdate:m,skipStorageUpdate:_}=Object.assign({},t,e);if(ih&&!r||!n)return;const w=c.length>0,P=d.length>0;let I,R;w&&(I=c.reduce((D,H)=>{if(ht(H))D.fns.push(H);else{const Q=H.split(".")[0];D[Q]=H}return D},{fns:[]})),P&&(R=d.reduce((D,H)=>(D[H.storeName]=H,D),{}));let E={};const A={},N=[],O=[];function L(D){Dr(D).subscribe(()=>{const H=O.shift();H&&L(H)})}const S=na()&&n===localStorage||oh()&&n===sessionStorage;return Dr(n.getItem(g)).subscribe(D=>{let H=es(D)?D:s(D||"{}");function Q(le){H.$cache={...H.$cache||{},...le},H=Object.assign({},H,A),O.push(n.setItem(g,S?a(H):H)),L(O.shift())}function x(le,be){E[le]=hn[le]._select(Se=>Fo(Se,be)).pipe(Gf(1),jt(Se=>P&&R[le]?R[le](Se):Se),Mi(()=>_()===!1),h()).subscribe(Se=>{A[le]=f(le,Se),Promise.resolve().then(()=>Q({[le]:hn[le]._cache().getValue()}))})}function ue(le,be,Se){if(le in H){Rt("@PersistState"),be._setState(Ne=>xu(Ne,Se,m(le,H[le],Ne)));const Te=H.$cache?H.$cache[le]:!1;hn[le].setHasCache(Te,{restartTTL:!0})}}N.push(Iu.subscribe(le=>{E[le]&&(p===!1&&Q({[le]:!1}),E[le].unsubscribe(),delete E[le])})),N.push(Ru.subscribe(le=>{if(le==="router")return;const be=hn[le];if(w){let Se=I[le];if(!Se)if(I.fns.some(Ne=>Ne(le)))Se=le;else return;ue(le,be,Se),x(le,Se)}else ue(le,be,le),x(le,le)})),Lh.next(!0)}),{destroy(){N.forEach(D=>D.unsubscribe());for(let D=0,H=Object.keys(E);D<H.length;D++){const Q=H[D];E[Q].unsubscribe()}E={}},clear(){n.clear()},clearStore(D){if(sn(D)){Dr(n.setItem(g,"{}")).subscribe();return}const H=n.getItem(g);Dr(H).subscribe(Q=>{const x=s(Q||"{}");x[D]&&(delete x[D],Dr(n.setItem(g,a(x))).subscribe())})}}}class Mh{constructor(t,n){this.query=t,n&&n.resetFn}getQuery(){return this.query}getStore(){return this.getQuery().__store__}isEntityBased(t){return ns(t)}selectSource(t,n){return this.isEntityBased(t)?this.getQuery().selectEntity(t).pipe(Eh()):n?this.getQuery().select(r=>Fo(r,this.withStoreName(n))):this.getQuery().select()}getSource(t,n){if(this.isEntityBased(t))return this.getQuery().getEntity(t);const r=this.getQuery().getValue();return n?Fo(r,this.withStoreName(n)):r}withStoreName(t){return`${this.storeName}.${t}`}get storeName(){return this.getStore().storeName}updateStore(t,n,r,s=!1){if(this.isEntityBased(n)){const a=this.getStore();s?a.replace(n,t):a.update(n,t)}else{if(r){this.getStore()._setState(c=>xu(c,this.withStoreName(r),t,!0));return}const a=s?t:c=>({...c,...t});this.getStore()._setState(a)}}onReset(t){const n=this.getStore().reset;this.getStore().reset=(...r)=>{setTimeout(()=>{n.apply(this.getStore(),r),t()})}}}const Uh={pagesControls:!1,range:!1,startWith:1,cacheTimeout:void 0,clearStoreWithCache:!0};class xh extends Mh{constructor(t,n={}){super(t,{resetFn:()=>{this.initial=!1,this.destroy({clearCache:!0,currentPage:1})}}),this.query=t,this.config=n,this.metadata=new Map,this.pages=new Map,this.pagination={currentPage:1,perPage:0,total:0,lastPage:0,data:[]},this.initial=!0,this.isLoading$=this.query.selectLoading().pipe(zf(0)),this.config={...Uh,...n};const{startWith:r,cacheTimeout:s}=this.config;this.page=new _i(r),Au(s)&&(this.clearCacheSubscription=s.subscribe(()=>this.clearCache()))}get pageChanges(){return this.page.asObservable()}get currentPage(){return this.pagination.currentPage}get isFirst(){return this.currentPage===1}get isLast(){return this.currentPage===this.pagination.lastPage}withControls(){return this.config.pagesControls=!0,this}withRange(){return this.config.range=!0,this}setLoading(t=!0){this.getStore().setLoading(t)}update(t){this.pagination=t,this.addPage(t.data)}addPage(t){this.pages.set(this.currentPage,{ids:t.map(n=>n[this.getStore().idKey])}),this.getStore().upsertMany(t)}clearCache(t={}){this.initial||(cr("@Pagination - Clear Cache"),t.clearStore!==!1&&(this.config.clearStoreWithCache||t.clearStore)&&this.getStore().remove(),this.pages=new Map,this.metadata=new Map),this.initial=!1}clearPage(t){this.pages.delete(t)}destroy({clearCache:t,currentPage:n}={}){this.clearCacheSubscription&&this.clearCacheSubscription.unsubscribe(),t&&this.clearCache(),sr(n)||this.setPage(n),this.initial=!0}isPageActive(t){return this.currentPage===t}setPage(t){(t!==this.currentPage||!this.hasPage(t))&&this.page.next(this.pagination.currentPage=t)}nextPage(){this.currentPage!==this.pagination.lastPage&&this.setPage(this.pagination.currentPage+1)}prevPage(){this.pagination.currentPage>1&&this.setPage(this.pagination.currentPage-1)}setLastPage(){this.setPage(this.pagination.lastPage)}setFirstPage(){this.setPage(1)}hasPage(t){return this.pages.has(t)}getPage(t){let n=this.pagination.currentPage;return this.hasPage(n)?this.selectPage(n):(this.setLoading(!0),Sr(t()).pipe(pi(r=>(n=r.currentPage,rs(()=>{this.setLoading(!1),this.update(r)}),this.selectPage(n)))))}getQuery(){return this.query}refreshCurrentPage(){sn(this.currentPage)===!1&&(this.clearPage(this.currentPage),this.setPage(this.currentPage))}getFrom(){return this.isFirst?1:(this.currentPage-1)*this.pagination.perPage+1}getTo(){return this.isLast?this.pagination.total:this.currentPage*this.pagination.perPage}selectPage(t){return this.query.selectAll({asObject:!0}).pipe(wo(1),jt(n=>{const r={...this.pagination,data:this.pages.get(t).ids.map(c=>n[c])},{range:s,pagesControls:a}=this.config;return isNaN(this.pagination.total)&&(r.lastPage===1?r.total=r.data?r.data.length:0:r.total=r.perPage*r.lastPage,this.pagination.total=r.total),s&&(r.from=this.getFrom(),r.to=this.getTo()),a&&(r.pageControls=jh(this.pagination.total,this.pagination.perPage)),r}))}}Jo([Bl("@Pagination - New Page"),Sn("design:type",Function),Sn("design:paramtypes",[Object]),Sn("design:returntype",void 0)],xh.prototype,"update",null);function jh(e,t){const n=Math.ceil(e/t),r=[];for(let s=0;s<n;s++)r.push(s+1);return r}function mm(e){e=Object.assign({},{exclude:[]},e);const n=Object.keys(hn);rs(()=>{for(const r of n){const s=hn[r];e.exclude?e.exclude.indexOf(s.storeName)===-1&&s.reset():s.reset()}})}var Ao;(function(e){e.Update="UPDATE"})(Ao||(Ao={}));Ao.Update+"";var yn;(function(e){e.Update="UPDATE",e.AddEntities="ADD_ENTITIES",e.SetEntities="SET_ENTITIES",e.UpdateEntities="UPDATE_ENTITIES",e.RemoveEntities="REMOVE_ENTITIES",e.UpsertEntities="UPSERT_ENTITIES",e.UpsertManyEntities="UPSERT_MANY_ENTITIES"})(yn||(yn={}));yn.Update+"",yn.AddEntities+"",yn.SetEntities+"",yn.UpdateEntities+"",yn.RemoveEntities+"",yn.UpsertEntities+"",yn.UpsertManyEntities+"";const Bh="modulepreload",Hh=function(e){return"/benefits/app/"+e},aa={},ym=function(t,n,r){if(!n||n.length===0)return t();const s=document.getElementsByTagName("link");return Promise.all(n.map(a=>{if(a=Hh(a),a in aa)return;aa[a]=!0;const c=a.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(!!r)for(let p=s.length-1;p>=0;p--){const h=s[p];if(h.href===a&&(!c||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${d}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":Bh,c||(f.as="script",f.crossOrigin=""),f.href=a,document.head.appendChild(f),c)return new Promise((p,h)=>{f.addEventListener("load",p),f.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>t()).catch(a=>{const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a})};var Xr,ve,ju,qn,ua,Bu,Po,Hu,fr={},$u=[],$h=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,xi=Array.isArray;function bn(e,t){for(var n in t)e[n]=t[n];return e}function Ku(e){var t=e.parentNode;t&&t.removeChild(e)}function _e(e,t,n){var r,s,a,c={};for(a in t)a=="key"?r=t[a]:a=="ref"?s=t[a]:c[a]=t[a];if(arguments.length>2&&(c.children=arguments.length>3?Xr.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)c[a]===void 0&&(c[a]=e.defaultProps[a]);return jr(e,c,r,s,null)}function jr(e,t,n,r,s){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:s??++ju};return s==null&&ve.vnode!=null&&ve.vnode(a),a}function Vr(){return{current:null}}function et(e){return e.children}function Xt(e,t){this.props=e,this.context=t}function qr(e,t){if(t==null)return e.__?qr(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__d||n.__e;return typeof e.type=="function"?qr(e):null}function Vu(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return Vu(e)}}function ko(e){(!e.__d&&(e.__d=!0)&&qn.push(e)&&!Ei.__r++||ua!==ve.debounceRendering)&&((ua=ve.debounceRendering)||Bu)(Ei)}function Ei(){var e,t,n,r,s,a,c,d,g;for(qn.sort(Po);e=qn.shift();)e.__d&&(t=qn.length,r=void 0,s=void 0,a=void 0,d=(c=(n=e).__v).__e,(g=n.__P)&&(r=[],s=[],(a=bn({},c)).__v=c.__v+1,is(g,c,a,n.__n,g.ownerSVGElement!==void 0,c.__h!=null?[d]:null,r,d??qr(c),c.__h,s),zu(r,c,s),c.__e!=d&&Vu(c)),qn.length>t&&qn.sort(Po));Ei.__r=0}function qu(e,t,n,r,s,a,c,d,g,f,p){var h,m,_,w,P,I,R,E,A,N=0,O=r&&r.__k||$u,L=O.length,S=L,D=t.length;for(n.__k=[],h=0;h<D;h++)(w=n.__k[h]=(w=t[h])==null||typeof w=="boolean"||typeof w=="function"?null:typeof w=="string"||typeof w=="number"||typeof w=="bigint"?jr(null,w,null,null,w):xi(w)?jr(et,{children:w},null,null,null):w.__b>0?jr(w.type,w.props,w.key,w.ref?w.ref:null,w.__v):w)!=null?(w.__=n,w.__b=n.__b+1,(E=Kh(w,O,R=h+N,S))===-1?_=fr:(_=O[E]||fr,O[E]=void 0,S--),is(e,w,_,s,a,c,d,g,f,p),P=w.__e,(m=w.ref)&&_.ref!=m&&(_.ref&&os(_.ref,null,w),p.push(m,w.__c||P,w)),P!=null&&(I==null&&(I=P),(A=_===fr||_.__v===null)?E==-1&&N--:E!==R&&(E===R+1?N++:E>R?S>D-R?N+=E-R:N--:N=E<R&&E==R-1?E-R:0),R=h+N,typeof w.type!="function"||E===R&&_.__k!==w.__k?typeof w.type=="function"||E===R&&!A?w.__d!==void 0?(g=w.__d,w.__d=void 0):g=P.nextSibling:g=Ju(e,P,g):g=Wu(w,g,e),typeof n.type=="function"&&(n.__d=g))):(_=O[h])&&_.key==null&&_.__e&&(_.__e==g&&(_.__=r,g=qr(_)),To(_,_,!1),O[h]=null);for(n.__e=I,h=L;h--;)O[h]!=null&&(typeof n.type=="function"&&O[h].__e!=null&&O[h].__e==n.__d&&(n.__d=O[h].__e.nextSibling),To(O[h],O[h]))}function Wu(e,t,n){for(var r,s=e.__k,a=0;s&&a<s.length;a++)(r=s[a])&&(r.__=e,t=typeof r.type=="function"?Wu(r,t,n):Ju(n,r.__e,t));return t}function on(e,t){return t=t||[],e==null||typeof e=="boolean"||(xi(e)?e.some(function(n){on(n,t)}):t.push(e)),t}function Ju(e,t,n){return n==null||n.parentNode!==e?e.insertBefore(t,null):t==n&&t.parentNode!=null||e.insertBefore(t,n),t.nextSibling}function Kh(e,t,n,r){var s=e.key,a=e.type,c=n-1,d=n+1,g=t[n];if(g===null||g&&s==g.key&&a===g.type)return n;if(r>(g!=null?1:0))for(;c>=0||d<t.length;){if(c>=0){if((g=t[c])&&s==g.key&&a===g.type)return c;c--}if(d<t.length){if((g=t[d])&&s==g.key&&a===g.type)return d;d++}}return-1}function Vh(e,t,n,r,s){var a;for(a in n)a==="children"||a==="key"||a in t||Fi(e,a,null,n[a],r);for(a in t)s&&typeof t[a]!="function"||a==="children"||a==="key"||a==="value"||a==="checked"||n[a]===t[a]||Fi(e,a,t[a],n[a],r)}function ca(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||$h.test(t)?n:n+"px"}function Fi(e,t,n,r,s){var a;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||ca(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||ca(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")a=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,a?fa:la,a)):e.removeEventListener(t,a?fa:la,a);else if(t!=="dangerouslySetInnerHTML"){if(s)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t!=="role"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function la(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(ve.event?ve.event(e):e)}function fa(e){return this.l[e.type+!0](ve.event?ve.event(e):e)}function is(e,t,n,r,s,a,c,d,g,f){var p,h,m,_,w,P,I,R,E,A,N,O,L,S,D,H=t.type;if(t.constructor!==void 0)return null;n.__h!=null&&(g=n.__h,d=t.__e=n.__e,t.__h=null,a=[d]),(p=ve.__b)&&p(t);e:if(typeof H=="function")try{if(R=t.props,E=(p=H.contextType)&&r[p.__c],A=p?E?E.props.value:p.__:r,n.__c?I=(h=t.__c=n.__c).__=h.__E:("prototype"in H&&H.prototype.render?t.__c=h=new H(R,A):(t.__c=h=new Xt(R,A),h.constructor=H,h.render=Wh),E&&E.sub(h),h.props=R,h.state||(h.state={}),h.context=A,h.__n=r,m=h.__d=!0,h.__h=[],h._sb=[]),h.__s==null&&(h.__s=h.state),H.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=bn({},h.__s)),bn(h.__s,H.getDerivedStateFromProps(R,h.__s))),_=h.props,w=h.state,h.__v=t,m)H.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(H.getDerivedStateFromProps==null&&R!==_&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(R,A),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(R,h.__s,A)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(h.props=R,h.state=h.__s,h.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(Q){Q&&(Q.__=t)}),N=0;N<h._sb.length;N++)h.__h.push(h._sb[N]);h._sb=[],h.__h.length&&c.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(R,h.__s,A),h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(_,w,P)})}if(h.context=A,h.props=R,h.__P=e,h.__e=!1,O=ve.__r,L=0,"prototype"in H&&H.prototype.render){for(h.state=h.__s,h.__d=!1,O&&O(t),p=h.render(h.props,h.state,h.context),S=0;S<h._sb.length;S++)h.__h.push(h._sb[S]);h._sb=[]}else do h.__d=!1,O&&O(t),p=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++L<25);h.state=h.__s,h.getChildContext!=null&&(r=bn(bn({},r),h.getChildContext())),m||h.getSnapshotBeforeUpdate==null||(P=h.getSnapshotBeforeUpdate(_,w)),qu(e,xi(D=p!=null&&p.type===et&&p.key==null?p.props.children:p)?D:[D],t,n,r,s,a,c,d,g,f),h.base=t.__e,t.__h=null,h.__h.length&&c.push(h),I&&(h.__E=h.__=null)}catch(Q){t.__v=null,(g||a!=null)&&(t.__e=d,t.__h=!!g,a[a.indexOf(d)]=null),ve.__e(Q,t,n)}else a==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=qh(n.__e,t,n,r,s,a,c,g,f);(p=ve.diffed)&&p(t)}function zu(e,t,n){for(var r=0;r<n.length;r++)os(n[r],n[++r],n[++r]);ve.__c&&ve.__c(t,e),e.some(function(s){try{e=s.__h,s.__h=[],e.some(function(a){a.call(s)})}catch(a){ve.__e(a,s.__v)}})}function qh(e,t,n,r,s,a,c,d,g){var f,p,h,m=n.props,_=t.props,w=t.type,P=0;if(w==="svg"&&(s=!0),a!=null){for(;P<a.length;P++)if((f=a[P])&&"setAttribute"in f==!!w&&(w?f.localName===w:f.nodeType===3)){e=f,a[P]=null;break}}if(e==null){if(w===null)return document.createTextNode(_);e=s?document.createElementNS("http://www.w3.org/2000/svg",w):document.createElement(w,_.is&&_),a=null,d=!1}if(w===null)m===_||d&&e.data===_||(e.data=_);else{if(a=a&&Xr.call(e.childNodes),p=(m=n.props||fr).dangerouslySetInnerHTML,h=_.dangerouslySetInnerHTML,!d){if(a!=null)for(m={},P=0;P<e.attributes.length;P++)m[e.attributes[P].name]=e.attributes[P].value;(h||p)&&(h&&(p&&h.__html==p.__html||h.__html===e.innerHTML)||(e.innerHTML=h&&h.__html||""))}if(Vh(e,_,m,s,d),h)t.__k=[];else if(qu(e,xi(P=t.props.children)?P:[P],t,n,r,s&&w!=="foreignObject",a,c,a?a[0]:n.__k&&qr(n,0),d,g),a!=null)for(P=a.length;P--;)a[P]!=null&&Ku(a[P]);d||("value"in _&&(P=_.value)!==void 0&&(P!==e.value||w==="progress"&&!P||w==="option"&&P!==m.value)&&Fi(e,"value",P,m.value,!1),"checked"in _&&(P=_.checked)!==void 0&&P!==e.checked&&Fi(e,"checked",P,m.checked,!1))}return e}function os(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){ve.__e(r,n)}}function To(e,t,n){var r,s;if(ve.unmount&&ve.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||os(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(a){ve.__e(a,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(s=0;s<r.length;s++)r[s]&&To(r[s],t,n||typeof e.type!="function");n||e.__e==null||Ku(e.__e),e.__=e.__e=e.__d=void 0}function Wh(e,t,n){return this.constructor(e,n)}function pr(e,t,n){var r,s,a,c;ve.__&&ve.__(e,t),s=(r=typeof n=="function")?null:n&&n.__k||t.__k,a=[],c=[],is(t,e=(!r&&n||t).__k=_e(et,null,[e]),s||fr,fr,t.ownerSVGElement!==void 0,!r&&n?[n]:s?null:t.firstChild?Xr.call(t.childNodes):null,a,!r&&n?n:s?s.__e:t.firstChild,r,c),zu(a,e,c)}function ss(e,t){pr(e,t,ss)}function Yu(e,t,n){var r,s,a,c,d=bn({},e.props);for(a in e.type&&e.type.defaultProps&&(c=e.type.defaultProps),t)a=="key"?r=t[a]:a=="ref"?s=t[a]:d[a]=t[a]===void 0&&c!==void 0?c[a]:t[a];return arguments.length>2&&(d.children=arguments.length>3?Xr.call(arguments,2):n),jr(e.type,d,r||e.key,s||e.ref,null)}function _t(e,t){var n={__c:t="__cC"+Hu++,__:e,Consumer:function(r,s){return r.children(s)},Provider:function(r){var s,a;return this.getChildContext||(s=[],(a={})[t]=this,this.getChildContext=function(){return a},this.shouldComponentUpdate=function(c){this.props.value!==c.value&&s.some(function(d){d.__e=!0,ko(d)})},this.sub=function(c){s.push(c);var d=c.componentWillUnmount;c.componentWillUnmount=function(){s.splice(s.indexOf(c),1),d&&d.call(c)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}Xr=$u.slice,ve={__e:function(e,t,n,r){for(var s,a,c;t=t.__;)if((s=t.__c)&&!s.__)try{if((a=s.constructor)&&a.getDerivedStateFromError!=null&&(s.setState(a.getDerivedStateFromError(e)),c=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(e,r||{}),c=s.__d),c)return s.__E=s}catch(d){e=d}throw e}},ju=0,Xt.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=bn({},this.state),typeof e=="function"&&(e=e(bn({},n),this.props)),e&&bn(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),ko(this))},Xt.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ko(this))},Xt.prototype.render=et,qn=[],Bu=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Po=function(e,t){return e.__v.__b-t.__v.__b},Ei.__r=0,Hu=0;var kn,$e,no,ha,gr=0,Gu=[],vi=[],da=ve.__b,pa=ve.__r,ga=ve.diffed,va=ve.__c,ma=ve.unmount;function Qn(e,t){ve.__h&&ve.__h($e,e,gr||t),gr=0;var n=$e.__H||($e.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:vi}),n.__[e]}function Et(e){return gr=1,Zn(ec,e)}function Zn(e,t,n){var r=Qn(kn++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):ec(void 0,t),function(d){var g=r.__N?r.__N[0]:r.__[0],f=r.t(g,d);g!==f&&(r.__N=[f,r.__[1]],r.__c.setState({}))}],r.__c=$e,!$e.u)){var s=function(d,g,f){if(!r.__c.__H)return!0;var p=r.__c.__H.__.filter(function(m){return m.__c});if(p.every(function(m){return!m.__N}))return!a||a.call(this,d,g,f);var h=!1;return p.forEach(function(m){if(m.__N){var _=m.__[0];m.__=m.__N,m.__N=void 0,_!==m.__[0]&&(h=!0)}}),!(!h&&r.__c.props===d)&&(!a||a.call(this,d,g,f))};$e.u=!0;var a=$e.shouldComponentUpdate,c=$e.componentWillUpdate;$e.componentWillUpdate=function(d,g,f){if(this.__e){var p=a;a=void 0,s(d,g,f),a=p}c&&c.call(this,d,g,f)},$e.shouldComponentUpdate=s}return r.__N||r.__}function je(e,t){var n=Qn(kn++,3);!ve.__s&&as(n.__H,t)&&(n.__=e,n.i=t,$e.__H.__h.push(n))}function er(e,t){var n=Qn(kn++,4);!ve.__s&&as(n.__H,t)&&(n.__=e,n.i=t,$e.__h.push(n))}function ke(e){return gr=5,Ue(function(){return{current:e}},[])}function Xu(e,t,n){gr=6,er(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function Ue(e,t){var n=Qn(kn++,7);return as(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function On(e,t){return gr=8,Ue(function(){return e},t)}function dt(e){var t=$e.context[e.__c],n=Qn(kn++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub($e)),t.props.value):e.__}function Qu(e,t){ve.useDebugValue&&ve.useDebugValue(t?t(e):e)}function Jh(e){var t=Qn(kn++,10),n=Et();return t.__=e,$e.componentDidCatch||($e.componentDidCatch=function(r,s){t.__&&t.__(r,s),n[1](r)}),[n[0],function(){n[1](void 0)}]}function Zu(){var e=Qn(kn++,11);if(!e.__){for(var t=$e.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function zh(){for(var e;e=Gu.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(mi),e.__H.__h.forEach(Co),e.__H.__h=[]}catch(t){e.__H.__h=[],ve.__e(t,e.__v)}}ve.__b=function(e){$e=null,da&&da(e)},ve.__r=function(e){pa&&pa(e),kn=0;var t=($e=e.__c).__H;t&&(no===$e?(t.__h=[],$e.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=vi,n.__N=n.i=void 0})):(t.__h.forEach(mi),t.__h.forEach(Co),t.__h=[],kn=0)),no=$e},ve.diffed=function(e){ga&&ga(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Gu.push(t)!==1&&ha===ve.requestAnimationFrame||((ha=ve.requestAnimationFrame)||Yh)(zh)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==vi&&(n.__=n.__V),n.i=void 0,n.__V=vi})),no=$e=null},ve.__c=function(e,t){t.some(function(n){try{n.__h.forEach(mi),n.__h=n.__h.filter(function(r){return!r.__||Co(r)})}catch(r){t.some(function(s){s.__h&&(s.__h=[])}),t=[],ve.__e(r,n.__v)}}),va&&va(e,t)},ve.unmount=function(e){ma&&ma(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{mi(r)}catch(s){t=s}}),n.__H=void 0,t&&ve.__e(t,n.__v))};var ya=typeof requestAnimationFrame=="function";function Yh(e){var t,n=function(){clearTimeout(r),ya&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);ya&&(t=requestAnimationFrame(n))}function mi(e){var t=$e,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),$e=t}function Co(e){var t=$e;e.__c=e.__(),$e=t}function as(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function ec(e,t){return typeof t=="function"?t(e):t}let or;const Gh=(e,t)=>{if(or=void 0,t&&t.type==="click"){if(t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button!==0)return e;const n=t.target.closest("a[href]");if(!n||n.origin!=location.origin||/^#/.test(n.getAttribute("href"))||!/^(_?self)?$/i.test(n.target))return e;or=!0,t.preventDefault(),t=n.href.replace(location.origin,"")}else typeof t=="string"?or=!0:t=location.pathname+location.search;return or===!0?history.pushState(null,"",t):or===!1&&history.replaceState(null,"",t),t};function tc(e){const[t,n]=Zn(Gh,e.url||location.pathname+location.search),r=or===!0,s=Ue(()=>{const a=new URL(t,location.origin),c=a.pathname.replace(/(.)\/$/g,"$1");return{url:t,path:c,query:Object.fromEntries(a.searchParams),route:n,wasPush:r}},[t]);return er(()=>(addEventListener("click",n),addEventListener("popstate",n),()=>{removeEventListener("click",n),removeEventListener("popstate",n)}),[]),_e(tc.ctx.Provider,{value:s},e.children)}Promise.resolve();tc.ctx=_t({});_t({});const _a=ve.__e;ve.__e=(e,t,n)=>{if(e&&e.then){let r=t;for(;r=r.__;)if(r.__c&&r.__c.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),t.__k||(t.__k=[]),r.__c.__c(e,t)}_a&&_a(e,t,n)};let ba;function _m(e,t){if(typeof window>"u")return;let n=document.querySelector("script[type=isodata]");t=t||n&&n.parentNode||document.body,!ba&&n?ss(e,t):pr(e,t),ba=!0}function nc(e,t){for(var n in t)e[n]=t[n];return e}function Io(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function ro(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t}function Ai(e){this.props=e}function rc(e,t){function n(s){var a=this.props.ref,c=a==s.ref;return!c&&a&&(a.call?a(null):a.current=null),t?!t(this.props,s)||!c:Io(this.props,s)}function r(s){return this.shouldComponentUpdate=n,_e(e,s)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(Ai.prototype=new Xt).isPureReactComponent=!0,Ai.prototype.shouldComponentUpdate=function(e,t){return Io(this.props,e)||Io(this.state,t)};var Sa=ve.__b;ve.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Sa&&Sa(e)};var Xh=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Lt(e){function t(n){var r=nc({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=Xh,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var wa=function(e,t){return e==null?null:on(on(e).map(t))},ic={map:wa,forEach:wa,count:function(e){return e?on(e).length:0},only:function(e){var t=on(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:on},Qh=ve.__e;ve.__e=function(e,t,n,r){if(e.then){for(var s,a=t;a=a.__;)if((s=a.__c)&&s.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),s.__c(e,t)}Qh(e,t,n,r)};var Ea=ve.unmount;function oc(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=nc({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return oc(r,t,n)})),e}function sc(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return sc(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function Br(){this.__u=0,this.t=null,this.__b=null}function ac(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function uc(e){var t,n,r;function s(a){if(t||(t=e()).then(function(c){n=c.default||c},function(c){r=c}),r)throw r;if(!n)throw t;return _e(n,a)}return s.displayName="Lazy",s.__f=!0,s}function ar(){this.u=null,this.o=null}ve.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&e.__h===!0&&(e.type=null),Ea&&Ea(e)},(Br.prototype=new Xt).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var s=ac(r.__v),a=!1,c=function(){a||(a=!0,n.__R=null,s?s(d):d())};n.__R=c;var d=function(){if(!--r.__u){if(r.state.__a){var f=r.state.__a;r.__v.__k[0]=sc(f,f.__c.__P,f.__c.__O)}var p;for(r.setState({__a:r.__b=null});p=r.t.pop();)p.forceUpdate()}},g=t.__h===!0;r.__u++||g||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(c,c)},Br.prototype.componentWillUnmount=function(){this.t=[]},Br.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=oc(this.__b,n,r.__O=r.__P)}this.__b=null}var s=t.__a&&_e(et,null,e.fallback);return s&&(s.__h=null),[_e(et,null,t.__a?null:e.children),s]};var Fa=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function Zh(e){return this.getChildContext=function(){return e.context},e.children}function ed(e){var t=this,n=e.i;t.componentWillUnmount=function(){pr(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(r){this.childNodes.push(r),t.i.appendChild(r)},insertBefore:function(r,s){this.childNodes.push(r),t.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.i.removeChild(r)}}),pr(_e(Zh,{context:t.context},e.__v),t.l)}function us(e,t){var n=_e(ed,{__v:e,i:t});return n.containerInfo=t,n}(ar.prototype=new Xt).__a=function(e){var t=this,n=ac(t.__v),r=t.o.get(e);return r[0]++,function(s){var a=function(){t.props.revealOrder?(r.push(s),Fa(t,e,r)):s()};n?n(a):a()}},ar.prototype.render=function(e){this.u=null,this.o=new Map;var t=on(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},ar.prototype.componentDidUpdate=ar.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){Fa(e,n,t)})};var cc=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,td=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,nd=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,rd=/[A-Z0-9]/g,id=typeof document<"u",od=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function lc(e,t,n){return t.__k==null&&(t.textContent=""),pr(e,t),typeof n=="function"&&n(),e?e.__c:null}function fc(e,t,n){return ss(e,t),typeof n=="function"&&n(),e?e.__c:null}Xt.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Xt.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Aa=ve.event;function sd(){}function ad(){return this.cancelBubble}function ud(){return this.defaultPrevented}ve.event=function(e){return Aa&&(e=Aa(e)),e.persist=sd,e.isPropagationStopped=ad,e.isDefaultPrevented=ud,e.nativeEvent=e};var cs,cd={enumerable:!1,configurable:!0,get:function(){return this.class}},Pa=ve.vnode;ve.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,s={};for(var a in n){var c=n[a];if(!(a==="value"&&"defaultValue"in n&&c==null||id&&a==="children"&&r==="noscript"||a==="class"||a==="className")){var d=a.toLowerCase();a==="defaultValue"&&"value"in n&&n.value==null?a="value":a==="download"&&c===!0?c="":d==="ondoubleclick"?a="ondblclick":d!=="onchange"||r!=="input"&&r!=="textarea"||od(n.type)?d==="onfocus"?a="onfocusin":d==="onblur"?a="onfocusout":nd.test(a)?a=d:r.indexOf("-")===-1&&td.test(a)?a=a.replace(rd,"-$&").toLowerCase():c===null&&(c=void 0):d=a="oninput",d==="oninput"&&s[a=d]&&(a="oninputCapture"),s[a]=c}}r=="select"&&s.multiple&&Array.isArray(s.value)&&(s.value=on(n.children).forEach(function(g){g.props.selected=s.value.indexOf(g.props.value)!=-1})),r=="select"&&s.defaultValue!=null&&(s.value=on(n.children).forEach(function(g){g.props.selected=s.multiple?s.defaultValue.indexOf(g.props.value)!=-1:s.defaultValue==g.props.value})),n.class&&!n.className?(s.class=n.class,Object.defineProperty(s,"className",cd)):(n.className&&!n.class||n.class&&n.className)&&(s.class=s.className=n.className),t.props=s}(e),e.$$typeof=cc,Pa&&Pa(e)};var ka=ve.__r;ve.__r=function(e){ka&&ka(e),cs=e.__c};var Ta=ve.diffed;ve.diffed=function(e){Ta&&Ta(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),cs=null};var hc={ReactCurrentDispatcher:{current:{readContext:function(e){return cs.__n[e.__c].props.value}}}},ld="17.0.2";function dc(e){return _e.bind(null,e)}function wr(e){return!!e&&e.$$typeof===cc}function pc(e){return wr(e)&&e.type===et}function ls(e){return wr(e)?Yu.apply(null,arguments):e}function gc(e){return!!e.__k&&(pr(null,e),!0)}function vc(e){return e&&(e.base||e.nodeType===1&&e)||null}var mc=function(e,t){return e(t)},yc=function(e,t){return e(t)},_c=et;function fs(e){e()}function bc(e){return e}function Sc(){return[!1,fs]}var wc=er,Ec=wr;function Fc(e,t){var n=t(),r=Et({h:{__:n,v:t}}),s=r[0].h,a=r[1];return er(function(){s.__=n,s.v=t,ro(s.__,t())||a({h:s})},[e,n,t]),je(function(){return ro(s.__,s.v())||a({h:s}),e(function(){ro(s.__,s.v())||a({h:s})})},[e]),n}var we={useState:Et,useId:Zu,useReducer:Zn,useEffect:je,useLayoutEffect:er,useInsertionEffect:wc,useTransition:Sc,useDeferredValue:bc,useSyncExternalStore:Fc,startTransition:fs,useRef:ke,useImperativeHandle:Xu,useMemo:Ue,useCallback:On,useContext:dt,useDebugValue:Qu,version:"17.0.2",Children:ic,render:lc,hydrate:fc,unmountComponentAtNode:gc,createPortal:us,createElement:_e,createContext:_t,createFactory:dc,cloneElement:ls,createRef:Vr,Fragment:et,isValidElement:wr,isElement:Ec,isFragment:pc,findDOMNode:vc,Component:Xt,PureComponent:Ai,memo:rc,forwardRef:Lt,flushSync:yc,unstable_batchedUpdates:mc,StrictMode:_c,Suspense:Br,SuspenseList:ar,lazy:uc,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:hc};const Wr=Object.freeze(Object.defineProperty({__proto__:null,Children:ic,Component:Xt,Fragment:et,PureComponent:Ai,StrictMode:_c,Suspense:Br,SuspenseList:ar,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:hc,cloneElement:ls,createContext:_t,createElement:_e,createFactory:dc,createPortal:us,createRef:Vr,default:we,findDOMNode:vc,flushSync:yc,forwardRef:Lt,hydrate:fc,isElement:Ec,isFragment:pc,isValidElement:wr,lazy:uc,memo:rc,render:lc,startTransition:fs,unmountComponentAtNode:gc,unstable_batchedUpdates:mc,useCallback:On,useContext:dt,useDebugValue:Qu,useDeferredValue:bc,useEffect:je,useErrorBoundary:Jh,useId:Zu,useImperativeHandle:Xu,useInsertionEffect:wc,useLayoutEffect:er,useMemo:Ue,useReducer:Zn,useRef:ke,useState:Et,useSyncExternalStore:Fc,useTransition:Sc,version:ld},Symbol.toStringTag,{value:"Module"}));var Oe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ac(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function bm(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}),n}var Pc={exports:{}};(function(e,t){(function(){function n(){var r=window,s=document;if("scrollBehavior"in s.documentElement.style&&r.__forceSmoothScrollPolyfill__!==!0)return;var a=r.HTMLElement||r.Element,c=468,d={scroll:r.scroll||r.scrollTo,scrollBy:r.scrollBy,elementScroll:a.prototype.scroll||h,scrollIntoView:a.prototype.scrollIntoView},g=r.performance&&r.performance.now?r.performance.now.bind(r.performance):Date.now;function f(N){var O=["MSIE ","Trident/","Edge/"];return new RegExp(O.join("|")).test(N)}var p=f(r.navigator.userAgent)?1:0;function h(N,O){this.scrollLeft=N,this.scrollTop=O}function m(N){return .5*(1-Math.cos(Math.PI*N))}function _(N){if(N===null||typeof N!="object"||N.behavior===void 0||N.behavior==="auto"||N.behavior==="instant")return!0;if(typeof N=="object"&&N.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+N.behavior+" is not a valid value for enumeration ScrollBehavior.")}function w(N,O){if(O==="Y")return N.clientHeight+p<N.scrollHeight;if(O==="X")return N.clientWidth+p<N.scrollWidth}function P(N,O){var L=r.getComputedStyle(N,null)["overflow"+O];return L==="auto"||L==="scroll"}function I(N){var O=w(N,"Y")&&P(N,"Y"),L=w(N,"X")&&P(N,"X");return O||L}function R(N){for(;N!==s.body&&I(N)===!1;)N=N.parentNode||N.host;return N}function E(N){var O=g(),L,S,D,H=(O-N.startTime)/c;H=H>1?1:H,L=m(H),S=N.startX+(N.x-N.startX)*L,D=N.startY+(N.y-N.startY)*L,N.method.call(N.scrollable,S,D),(S!==N.x||D!==N.y)&&r.requestAnimationFrame(E.bind(r,N))}function A(N,O,L){var S,D,H,Q,x=g();N===s.body?(S=r,D=r.scrollX||r.pageXOffset,H=r.scrollY||r.pageYOffset,Q=d.scroll):(S=N,D=N.scrollLeft,H=N.scrollTop,Q=h),E({scrollable:S,method:Q,startTime:x,startX:D,startY:H,x:O,y:L})}r.scroll=r.scrollTo=function(){if(arguments[0]!==void 0){if(_(arguments[0])===!0){d.scroll.call(r,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:r.scrollX||r.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:r.scrollY||r.pageYOffset);return}A.call(r,s.body,arguments[0].left!==void 0?~~arguments[0].left:r.scrollX||r.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:r.scrollY||r.pageYOffset)}},r.scrollBy=function(){if(arguments[0]!==void 0){if(_(arguments[0])){d.scrollBy.call(r,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}A.call(r,s.body,~~arguments[0].left+(r.scrollX||r.pageXOffset),~~arguments[0].top+(r.scrollY||r.pageYOffset))}},a.prototype.scroll=a.prototype.scrollTo=function(){if(arguments[0]!==void 0){if(_(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");d.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}var N=arguments[0].left,O=arguments[0].top;A.call(this,this,typeof N>"u"?this.scrollLeft:~~N,typeof O>"u"?this.scrollTop:~~O)}},a.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(_(arguments[0])===!0){d.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},a.prototype.scrollIntoView=function(){if(_(arguments[0])===!0){d.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}var N=R(this),O=N.getBoundingClientRect(),L=this.getBoundingClientRect();N!==s.body?(A.call(this,N,N.scrollLeft+L.left-O.left,N.scrollTop+L.top-O.top),r.getComputedStyle(N).position!=="fixed"&&r.scrollBy({left:O.left,top:O.top,behavior:"smooth"})):r.scrollBy({left:L.left,top:L.top,behavior:"smooth"})}}e.exports={polyfill:n}})()})(Pc);var fd=Pc.exports;const Sm=Ac(fd);globalThis&&globalThis.__spreadArray;function hd(e){return e}function dd(e){return function(){return e}}var pd=dd(void 0);function wm(e,t,n,r,s,a,c,d,g){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return s(r(n(t(e))));case 6:return a(s(r(n(t(e)))));case 7:return c(a(s(r(n(t(e))))));case 8:return d(c(a(s(r(n(t(e)))))));case 9:return g(d(c(a(s(r(n(t(e))))))));default:{for(var f=arguments[0],p=1;p<arguments.length;p++)f=arguments[p](f);return f}}}globalThis&&globalThis.__spreadArray;var gd=function(e){return e._tag==="Some"},vd={_tag:"None"},md=function(e){return{_tag:"Some",value:e}},hs=vd,kc=md,Em=function(e){return function(t){return ji(t)?hs:kc(e(t.value))}},Fm=gd,ji=function(e){return e._tag==="None"},yd=function(e,t){return function(n){return ji(n)?e():t(n.value)}},Tc=yd,Am=Tc,_d=function(e){return function(t){return ji(t)?e():t.value}},Pm=_d,bd=function(e){return e==null?hs:kc(e)},km=function(e){return function(t){return ji(t)?hs:bd(e(t.value))}},Tm=Tc(pd,hd);function Pi(){return Pi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pi.apply(this,arguments)}var ur;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(ur||(ur={}));var Ca=function(e){return e},Ia="beforeunload",Sd="hashchange",wd="popstate";function Cm(e){e===void 0&&(e={});var t=e,n=t.window,r=n===void 0?document.defaultView:n,s=r.history;function a(){var D=La(r.location.hash.substr(1)),H=D.pathname,Q=H===void 0?"/":H,x=D.search,ue=x===void 0?"":x,le=D.hash,be=le===void 0?"":le,Se=s.state||{};return[Se.idx,Ca({pathname:Q,search:ue,hash:be,state:Se.usr||null,key:Se.key||"default"})]}var c=null;function d(){if(c)_.call(c),c=null;else{var D=ur.Pop,H=a(),Q=H[0],x=H[1];if(_.length){if(Q!=null){var ue=p-Q;ue&&(c={action:D,location:x,retry:function(){L(ue*-1)}},L(ue))}}else A(D)}}r.addEventListener(wd,d),r.addEventListener(Sd,function(){var D=a(),H=D[1];io(H)!==io(h)&&d()});var g=ur.Pop,f=a(),p=f[0],h=f[1],m=Oa(),_=Oa();p==null&&(p=0,s.replaceState(Pi({},s.state,{idx:p}),""));function w(){var D=document.querySelector("base"),H="";if(D&&D.getAttribute("href")){var Q=r.location.href,x=Q.indexOf("#");H=x===-1?Q:Q.slice(0,x)}return H}function P(D){return w()+"#"+(typeof D=="string"?D:io(D))}function I(D,H){return H===void 0&&(H=null),Ca(Pi({pathname:h.pathname,hash:"",search:""},typeof D=="string"?La(D):D,{state:H,key:Ed()}))}function R(D,H){return[{usr:D.state,key:D.key,idx:H},P(D)]}function E(D,H,Q){return!_.length||(_.call({action:D,location:H,retry:Q}),!1)}function A(D){g=D;var H=a();p=H[0],h=H[1],m.call({action:g,location:h})}function N(D,H){var Q=ur.Push,x=I(D,H);function ue(){N(D,H)}if(E(Q,x,ue)){var le=R(x,p+1),be=le[0],Se=le[1];try{s.pushState(be,"",Se)}catch{r.location.assign(Se)}A(Q)}}function O(D,H){var Q=ur.Replace,x=I(D,H);function ue(){O(D,H)}if(E(Q,x,ue)){var le=R(x,p),be=le[0],Se=le[1];s.replaceState(be,"",Se),A(Q)}}function L(D){s.go(D)}var S={get action(){return g},get location(){return h},createHref:P,push:N,replace:O,go:L,back:function(){L(-1)},forward:function(){L(1)},listen:function(H){return m.push(H)},block:function(H){var Q=_.push(H);return _.length===1&&r.addEventListener(Ia,Ra),function(){Q(),_.length||r.removeEventListener(Ia,Ra)}}};return S}function Ra(e){e.preventDefault(),e.returnValue=""}function Oa(){var e=[];return{get length(){return e.length},push:function(n){return e.push(n),function(){e=e.filter(function(r){return r!==n})}},call:function(n){e.forEach(function(r){return r&&r(n)})}}}function Ed(){return Math.random().toString(36).substr(2,8)}function io(e){var t=e.pathname,n=t===void 0?"/":t,r=e.search,s=r===void 0?"":r,a=e.hash,c=a===void 0?"":a;return s&&s!=="?"&&(n+=s.charAt(0)==="?"?s:"?"+s),c&&c!=="#"&&(n+=c.charAt(0)==="#"?c:"#"+c),n}function La(e){var t={};if(e){var n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));var r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var Fd={};function Cc(e,t){for(var n in t)e[n]=t[n];return e}function Ic(e,t,n){var r=/(?:\?([^#]*))?(#.*)?$/,s=e.match(r),a={},c;if(s&&s[1])for(var d=s[1].split("&"),g=0;g<d.length;g++){var f=d[g].split("=");a[decodeURIComponent(f[0])]=decodeURIComponent(f.slice(1).join("="))}e=Ro(e.replace(r,"")),t=Ro(t||"");for(var p=Math.max(e.length,t.length),h=0;h<p;h++)if(t[h]&&t[h].charAt(0)===":"){var m=t[h].replace(/(^:|[+*?]+$)/g,""),_=(t[h].match(/[+*?]+$/)||Fd)[0]||"",w=~_.indexOf("+"),P=~_.indexOf("*"),I=e[h]||"";if(!I&&!P&&(_.indexOf("?")<0||w)){c=!1;break}if(a[m]=decodeURIComponent(I),w||P){a[m]=e.slice(h).map(decodeURIComponent).join("/");break}}else if(t[h]!==e[h]){c=!1;break}return n.default!==!0&&c===!1?!1:a}function Ad(e,t){return e.rank<t.rank?1:e.rank>t.rank?-1:e.index-t.index}function Pd(e,t){return e.index=t,e.rank=Cd(e),e.props}function Ro(e){return e.replace(/(^\/+|\/+$)/g,"").split("/")}function kd(e){return e.charAt(0)==":"?1+"*+?".indexOf(e.charAt(e.length-1))||4:5}function Td(e){return Ro(e).map(kd).join("")}function Cd(e){return e.props.default?0:Td(e.props.path)}var qt=null,Jn=[],Oo=[],Id={};function Rd(e,t){t===void 0&&(t="push"),qt&&qt[t]?qt[t](e):typeof history<"u"&&history[t+"State"]&&history[t+"State"](null,null,e)}function ds(){var e;return qt&&qt.location?e=qt.location:qt&&qt.getCurrentLocation?e=qt.getCurrentLocation():e=typeof location<"u"?location:Id,""+(e.pathname||"")+(e.search||"")}function Rc(e,t){return t===void 0&&(t=!1),typeof e!="string"&&e.url&&(t=e.replace,e=e.url),Od(e)&&Rd(e,t?"replace":"push"),Oc(e)}function Od(e){for(var t=Jn.length;t--;)if(Jn[t].canRoute(e))return!0;return!1}function Oc(e){for(var t=!1,n=0;n<Jn.length;n++)Jn[n].routeTo(e)===!0&&(t=!0);for(var r=Oo.length;r--;)Oo[r](e);return t}function Lc(e){if(!(!e||!e.getAttribute)){var t=e.getAttribute("href"),n=e.getAttribute("target");if(!(!t||!t.match(/^\//g)||n&&!n.match(/^_?self$/i)))return Rc(t)}}function Ld(e){if(!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey||e.button!==0))return Lc(e.currentTarget||e.target||this),Dc(e)}function Dc(e){return e&&(e.stopImmediatePropagation&&e.stopImmediatePropagation(),e.stopPropagation&&e.stopPropagation(),e.preventDefault()),!1}function Dd(e){if(!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey||e.button!==0)){var t=e.target;do if(String(t.nodeName).toUpperCase()==="A"&&t.getAttribute("href")){if(t.hasAttribute("native"))return;if(Lc(t))return Dc(e)}while(t=t.parentNode)}}var Da=!1;function Nd(){Da||(typeof addEventListener=="function"&&(qt||addEventListener("popstate",function(){Oc(ds())}),addEventListener("click",Dd)),Da=!0)}var xn=function(e){function t(n){e.call(this,n),n.history&&(qt=n.history),this.state={url:n.url||ds()},Nd()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.shouldComponentUpdate=function(r){return r.static!==!0?!0:r.url!==this.props.url||r.onChange!==this.props.onChange},t.prototype.canRoute=function(r){var s=on(this.props.children);return this.getMatchingChildren(s,r,!1).length>0},t.prototype.routeTo=function(r){this.setState({url:r});var s=this.canRoute(r);return this.updating||this.forceUpdate(),s},t.prototype.componentWillMount=function(){Jn.push(this),this.updating=!0},t.prototype.componentDidMount=function(){var r=this;qt&&(this.unlisten=qt.listen(function(s){r.routeTo(""+(s.pathname||"")+(s.search||""))})),this.updating=!1},t.prototype.componentWillUnmount=function(){typeof this.unlisten=="function"&&this.unlisten(),Jn.splice(Jn.indexOf(this),1)},t.prototype.componentWillUpdate=function(){this.updating=!0},t.prototype.componentDidUpdate=function(){this.updating=!1},t.prototype.getMatchingChildren=function(r,s,a){return r.filter(Pd).sort(Ad).map(function(c){var d=Ic(s,c.props.path,c.props);if(d){if(a!==!1){var g={url:s,matches:d};return Cc(g,d),delete g.ref,delete g.key,Yu(c,g)}return c}}).filter(Boolean)},t.prototype.render=function(r,s){var a=r.children,c=r.onChange,d=s.url,g=this.getMatchingChildren(on(a),d,!0),f=g[0]||null,p=this.previousUrl;return d!==p&&(this.previousUrl=d,typeof c=="function"&&c({router:this,url:d,previous:p,active:g,current:f})),f},t}(Xt),Md=function(e){return _e("a",Cc({onClick:Ld},e))},Ud=function(e){return _e(e.component,e)};xn.subscribers=Oo;xn.getCurrentUrl=ds;xn.route=Rc;xn.Router=xn;xn.Route=Ud;xn.Link=Md;xn.exec=Ic;const xd="application/json",Nc="Content-Type",ir=Symbol(),Mc=Symbol();function Na(e={}){var t;return(t=Object.entries(e).find(([n])=>n.toLowerCase()===Nc.toLowerCase()))===null||t===void 0?void 0:t[1]}function Ma(e){return/^application\/.*json.*/.test(e)}const zn=function(e,t,n=!1){return Object.entries(t).reduce((r,[s,a])=>{const c=e[s];return Array.isArray(c)&&Array.isArray(a)?r[s]=n?[...c,...a]:a:typeof c=="object"&&typeof a=="object"?r[s]=zn(c,a,n):r[s]=a,r},{...e})},vr={options:{},errorType:"text",polyfills:{},polyfill(e,t=!0,n=!1,...r){const s=this.polyfills[e]||(typeof self<"u"?self[e]:null)||(typeof global<"u"?global[e]:null);if(t&&!s)throw new Error(e+" is not defined");return n&&s?new s(...r):s}};function jd(e,t=!1){vr.options=t?e:zn(vr.options,e)}function Bd(e,t=!1){vr.polyfills=t?e:zn(vr.polyfills,e)}function Hd(e){vr.errorType=e}const $d=e=>t=>e.reduceRight((n,r)=>r(n),t)||t;class Uc extends Error{}const Kd=e=>{const t=Object.create(null);e=e._addons.reduce((A,N)=>N.beforeRequest&&N.beforeRequest(A,e._options,t)||A,e);const{_url:n,_options:r,_config:s,_catchers:a,_resolvers:c,_middlewares:d,_addons:g}=e,f=new Map(a),p=zn(s.options,r);let h=n;const m=$d(d)((A,N)=>(h=A,s.polyfill("fetch")(A,N)))(n,p),_=new Error,w=m.catch(A=>{throw{[ir]:A}}).then(A=>{if(!A.ok){const N=new Uc;if(N.cause=_,N.stack=N.stack+`
4
+ CAUSE: `+_.stack,N.response=A,N.url=h,A.type==="opaque")throw N;return A.text().then(O=>{var L;if(N.message=O,s.errorType==="json"||((L=A.headers.get("Content-Type"))===null||L===void 0?void 0:L.split(";")[0])==="application/json")try{N.json=JSON.parse(O)}catch{}throw N.text=O,N.status=A.status,N})}return A}),P=A=>A.catch(N=>{const O=N.hasOwnProperty(ir),L=O?N[ir]:N,S=(L==null?void 0:L.status)&&f.get(L.status)||f.get(L==null?void 0:L.name)||O&&f.has(ir)&&f.get(ir);if(S)return S(L,e);const D=f.get(Mc);if(D)return D(L,e);throw L}),I=A=>N=>P(A?w.then(O=>O&&O[A]()).then(O=>N?N(O):O):w.then(O=>N?N(O):O)),R={_wretchReq:e,_fetchReq:m,_sharedState:t,res:I(null),json:I("json"),blob:I("blob"),formData:I("formData"),arrayBuffer:I("arrayBuffer"),text:I("text"),error(A,N){return f.set(A,N),this},badRequest(A){return this.error(400,A)},unauthorized(A){return this.error(401,A)},forbidden(A){return this.error(403,A)},notFound(A){return this.error(404,A)},timeout(A){return this.error(408,A)},internalError(A){return this.error(500,A)},fetchError(A){return this.error(ir,A)}},E=g.reduce((A,N)=>({...A,...N.resolver}),R);return c.reduce((A,N)=>N(A,e),E)},Vd={_url:"",_options:{},_config:vr,_catchers:new Map,_resolvers:[],_deferred:[],_middlewares:[],_addons:[],addon(e){return{...this,_addons:[...this._addons,e],...e.wretch}},errorType(e){return{...this,_config:{...this._config,errorType:e}}},polyfills(e,t=!1){return{...this,_config:{...this._config,polyfills:t?e:zn(this._config.polyfills,e)}}},url(e,t=!1){if(t)return{...this,_url:e};const n=this._url.split("?");return{...this,_url:n.length>1?n[0]+e+"?"+n[1]:this._url+e}},options(e,t=!1){return{...this,_options:t?e:zn(this._options,e)}},headers(e){return{...this,_options:zn(this._options,{headers:e||{}})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[Nc]:e})},auth(e){return this.headers({Authorization:e})},catcher(e,t){const n=new Map(this._catchers);return n.set(e,t),{...this,_catchers:n}},catcherFallback(e){return this.catcher(Mc,e)},resolve(e,t=!1){return{...this,_resolvers:t?[e]:[...this._resolvers,e]}},defer(e,t=!1){return{...this,_deferred:t?[e]:[...this._deferred,e]}},middlewares(e,t=!1){return{...this,_middlewares:t?e:[...this._middlewares,...e]}},fetch(e=this._options.method,t="",n=null){let r=this.url(t).options({method:e});const s=Na(r._options.headers),a=typeof n=="object"&&(!r._options.headers||!s||Ma(s));return r=n?a?r.json(n,s):r.body(n):r,Kd(r._deferred.reduce((c,d)=>d(c,c._url,c._options),r))},get(e=""){return this.fetch("GET",e)},delete(e=""){return this.fetch("DELETE",e)},put(e,t=""){return this.fetch("PUT",t,e)},post(e,t=""){return this.fetch("POST",t,e)},patch(e,t=""){return this.fetch("PATCH",t,e)},head(e=""){return this.fetch("HEAD",e)},opts(e=""){return this.fetch("OPTIONS",e)},body(e){return{...this,_options:{...this._options,body:e}}},json(e,t){const n=Na(this._options.headers);return this.content(t||Ma(n)&&n||xd).body(JSON.stringify(e))}};function mr(e="",t={}){return{...Vd,_url:e,_options:t}}mr.default=mr;mr.options=jd;mr.errorType=Hd;mr.polyfills=Bd;mr.WretchError=Uc;var qd=0;function Im(e,t,n,r,s,a){var c,d,g={};for(d in t)d=="ref"?c=t[d]:g[d]=t[d];var f={type:e,props:g,key:n,ref:c,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--qd,__source:s,__self:a};if(typeof e=="function"&&(c=e.defaultProps))for(d in c)g[d]===void 0&&(g[d]=c[d]);return ve.vnode&&ve.vnode(f),f}var Zt={};(function(e){var t=Oe&&Oe.__spreadArray||function(S,D,H){if(H||arguments.length===2)for(var Q=0,x=D.length,ue;Q<x;Q++)(ue||!(Q in D))&&(ue||(ue=Array.prototype.slice.call(D,0,Q)),ue[Q]=D[Q]);return S.concat(ue||Array.prototype.slice.call(D))};Object.defineProperty(e,"__esModule",{value:!0}),e.dual=e.getEndomorphismMonoid=e.not=e.SK=e.hole=e.pipe=e.untupled=e.tupled=e.absurd=e.decrement=e.increment=e.tuple=e.flow=e.flip=e.constVoid=e.constUndefined=e.constNull=e.constFalse=e.constTrue=e.constant=e.unsafeCoerce=e.identity=e.apply=e.getRing=e.getSemiring=e.getMonoid=e.getSemigroup=e.getBooleanAlgebra=void 0;var n=function(S){return function(){return{meet:function(D,H){return function(Q){return S.meet(D(Q),H(Q))}},join:function(D,H){return function(Q){return S.join(D(Q),H(Q))}},zero:function(){return S.zero},one:function(){return S.one},implies:function(D,H){return function(Q){return S.implies(D(Q),H(Q))}},not:function(D){return function(H){return S.not(D(H))}}}}};e.getBooleanAlgebra=n;var r=function(S){return function(){return{concat:function(D,H){return function(Q){return S.concat(D(Q),H(Q))}}}}};e.getSemigroup=r;var s=function(S){var D=(0,e.getSemigroup)(S);return function(){return{concat:D().concat,empty:function(){return S.empty}}}};e.getMonoid=s;var a=function(S){return{add:function(D,H){return function(Q){return S.add(D(Q),H(Q))}},zero:function(){return S.zero},mul:function(D,H){return function(Q){return S.mul(D(Q),H(Q))}},one:function(){return S.one}}};e.getSemiring=a;var c=function(S){var D=(0,e.getSemiring)(S);return{add:D.add,mul:D.mul,one:D.one,zero:D.zero,sub:function(H,Q){return function(x){return S.sub(H(x),Q(x))}}}};e.getRing=c;var d=function(S){return function(D){return D(S)}};e.apply=d;function g(S){return S}e.identity=g,e.unsafeCoerce=g;function f(S){return function(){return S}}e.constant=f,e.constTrue=f(!0),e.constFalse=f(!1),e.constNull=f(null),e.constUndefined=f(void 0),e.constVoid=e.constUndefined;function p(S){return function(){for(var D=[],H=0;H<arguments.length;H++)D[H]=arguments[H];return D.length>1?S(D[1],D[0]):function(Q){return S(Q)(D[0])}}}e.flip=p;function h(S,D,H,Q,x,ue,le,be,Se){switch(arguments.length){case 1:return S;case 2:return function(){return D(S.apply(this,arguments))};case 3:return function(){return H(D(S.apply(this,arguments)))};case 4:return function(){return Q(H(D(S.apply(this,arguments))))};case 5:return function(){return x(Q(H(D(S.apply(this,arguments)))))};case 6:return function(){return ue(x(Q(H(D(S.apply(this,arguments))))))};case 7:return function(){return le(ue(x(Q(H(D(S.apply(this,arguments)))))))};case 8:return function(){return be(le(ue(x(Q(H(D(S.apply(this,arguments))))))))};case 9:return function(){return Se(be(le(ue(x(Q(H(D(S.apply(this,arguments)))))))))}}}e.flow=h;function m(){for(var S=[],D=0;D<arguments.length;D++)S[D]=arguments[D];return S}e.tuple=m;function _(S){return S+1}e.increment=_;function w(S){return S-1}e.decrement=w;function P(S){throw new Error("Called `absurd` function which should be uncallable")}e.absurd=P;function I(S){return function(D){return S.apply(void 0,D)}}e.tupled=I;function R(S){return function(){for(var D=[],H=0;H<arguments.length;H++)D[H]=arguments[H];return S(D)}}e.untupled=R;function E(S,D,H,Q,x,ue,le,be,Se){switch(arguments.length){case 1:return S;case 2:return D(S);case 3:return H(D(S));case 4:return Q(H(D(S)));case 5:return x(Q(H(D(S))));case 6:return ue(x(Q(H(D(S)))));case 7:return le(ue(x(Q(H(D(S))))));case 8:return be(le(ue(x(Q(H(D(S)))))));case 9:return Se(be(le(ue(x(Q(H(D(S))))))));default:{for(var Te=arguments[0],Ne=1;Ne<arguments.length;Ne++)Te=arguments[Ne](Te);return Te}}}e.pipe=E,e.hole=P;var A=function(S,D){return D};e.SK=A;function N(S){return function(D){return!S(D)}}e.not=N;var O=function(){return{concat:function(S,D){return h(S,D)},empty:g}};e.getEndomorphismMonoid=O;var L=function(S,D){var H=typeof S=="number"?function(Q){return Q.length>=S}:S;return function(){var Q=Array.from(arguments);return H(arguments)?D.apply(this,Q):function(x){return D.apply(void 0,t([x],Q,!1))}}};e.dual=L})(Zt);function nn(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map(function(s){return"'"+s+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function yr(e){return!!e&&!!e[Wt]}function Xn(e){var t;return!!e&&(function(n){if(!n||typeof n!="object")return!1;var r=Object.getPrototypeOf(n);if(r===null)return!0;var s=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return s===Object||typeof s=="function"&&Function.toString.call(s)===Zd}(e)||Array.isArray(e)||!!e[Va]||!!(!((t=e.constructor)===null||t===void 0)&&t[Va])||ps(e)||gs(e))}function Jr(e,t,n){n===void 0&&(n=!1),Er(e)===0?(n?Object.keys:bs)(e).forEach(function(r){n&&typeof r=="symbol"||t(r,e[r],e)}):e.forEach(function(r,s){return t(s,r,e)})}function Er(e){var t=e[Wt];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:ps(e)?2:gs(e)?3:0}function Lo(e,t){return Er(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Wd(e,t){return Er(e)===2?e.get(t):e[t]}function xc(e,t,n){var r=Er(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Jd(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function ps(e){return Xd&&e instanceof Map}function gs(e){return Qd&&e instanceof Set}function Vn(e){return e.o||e.t}function vs(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=ep(e);delete t[Wt];for(var n=bs(t),r=0;r<n.length;r++){var s=n[r],a=t[s];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[s]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[s]})}return Object.create(Object.getPrototypeOf(e),t)}function ms(e,t){return t===void 0&&(t=!1),ys(e)||yr(e)||!Xn(e)||(Er(e)>1&&(e.set=e.add=e.clear=e.delete=zd),Object.freeze(e),t&&Jr(e,function(n,r){return ms(r,!0)},!0)),e}function zd(){nn(2)}function ys(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function dn(e){var t=tp[e];return t||nn(18,e),t}function Ua(){return zr}function oo(e,t){t&&(dn("Patches"),e.u=[],e.s=[],e.v=t)}function ki(e){Do(e),e.p.forEach(Yd),e.p=null}function Do(e){e===zr&&(zr=e.l)}function xa(e){return zr={p:[],l:zr,h:e,m:!0,_:0}}function Yd(e){var t=e[Wt];t.i===0||t.i===1?t.j():t.g=!0}function so(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.O||dn("ES5").S(t,e,r),r?(n[Wt].P&&(ki(t),nn(4)),Xn(e)&&(e=Ti(t,e),t.l||Ci(t,e)),t.u&&dn("Patches").M(n[Wt].t,e,t.u,t.s)):e=Ti(t,n,[]),ki(t),t.u&&t.v(t.u,t.s),e!==jc?e:void 0}function Ti(e,t,n){if(ys(t))return t;var r=t[Wt];if(!r)return Jr(t,function(d,g){return ja(e,r,t,d,g,n)},!0),t;if(r.A!==e)return t;if(!r.P)return Ci(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var s=r.i===4||r.i===5?r.o=vs(r.k):r.o,a=s,c=!1;r.i===3&&(a=new Set(s),s.clear(),c=!0),Jr(a,function(d,g){return ja(e,r,s,d,g,n,c)}),Ci(e,s,!1),n&&e.u&&dn("Patches").N(r,n,e.u,e.s)}return r.o}function ja(e,t,n,r,s,a,c){if(yr(s)){var d=Ti(e,s,a&&t&&t.i!==3&&!Lo(t.R,r)?a.concat(r):void 0);if(xc(n,r,d),!yr(d))return;e.m=!1}else c&&n.add(s);if(Xn(s)&&!ys(s)){if(!e.h.D&&e._<1)return;Ti(e,s),t&&t.A.l||Ci(e,s)}}function Ci(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&ms(t,n)}function ao(e,t){var n=e[Wt];return(n?Vn(n):e)[t]}function Ba(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function No(e){e.P||(e.P=!0,e.l&&No(e.l))}function uo(e){e.o||(e.o=vs(e.t))}function Mo(e,t,n){var r=ps(t)?dn("MapSet").F(t,n):gs(t)?dn("MapSet").T(t,n):e.O?function(s,a){var c=Array.isArray(s),d={i:c?1:0,A:a?a.A:Ua(),P:!1,I:!1,R:{},l:a,t:s,k:null,o:null,j:null,C:!1},g=d,f=Uo;c&&(g=[d],f=Ur);var p=Proxy.revocable(g,f),h=p.revoke,m=p.proxy;return d.k=m,d.j=h,m}(t,n):dn("ES5").J(t,n);return(n?n.A:Ua()).p.push(r),r}function Gd(e){return yr(e)||nn(22,e),function t(n){if(!Xn(n))return n;var r,s=n[Wt],a=Er(n);if(s){if(!s.P&&(s.i<4||!dn("ES5").K(s)))return s.t;s.I=!0,r=Ha(n,a),s.I=!1}else r=Ha(n,a);return Jr(r,function(c,d){s&&Wd(s.t,c)===d||xc(r,c,t(d))}),a===3?new Set(r):r}(e)}function Ha(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return vs(e)}var $a,zr,_s=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Xd=typeof Map<"u",Qd=typeof Set<"u",Ka=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",jc=_s?Symbol.for("immer-nothing"):(($a={})["immer-nothing"]=!0,$a),Va=_s?Symbol.for("immer-draftable"):"__$immer_draftable",Wt=_s?Symbol.for("immer-state"):"__$immer_state",Zd=""+Object.prototype.constructor,bs=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,ep=Object.getOwnPropertyDescriptors||function(e){var t={};return bs(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},tp={},Uo={get:function(e,t){if(t===Wt)return e;var n=Vn(e);if(!Lo(n,t))return function(s,a,c){var d,g=Ba(a,c);return g?"value"in g?g.value:(d=g.get)===null||d===void 0?void 0:d.call(s.k):void 0}(e,n,t);var r=n[t];return e.I||!Xn(r)?r:r===ao(e.t,t)?(uo(e),e.o[t]=Mo(e.A.h,r,e)):r},has:function(e,t){return t in Vn(e)},ownKeys:function(e){return Reflect.ownKeys(Vn(e))},set:function(e,t,n){var r=Ba(Vn(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var s=ao(Vn(e),t),a=s==null?void 0:s[Wt];if(a&&a.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(Jd(n,s)&&(n!==void 0||Lo(e.t,t)))return!0;uo(e),No(e)}return e.o[t]===n&&(n!==void 0||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return ao(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,uo(e),No(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=Vn(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty:function(){nn(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){nn(12)}},Ur={};Jr(Uo,function(e,t){Ur[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Ur.deleteProperty=function(e,t){return Ur.set.call(this,e,t,void 0)},Ur.set=function(e,t,n){return Uo.set.call(this,e[0],t,n,e[0])};var np=function(){function e(n){var r=this;this.O=Ka,this.D=!0,this.produce=function(s,a,c){if(typeof s=="function"&&typeof a!="function"){var d=a;a=s;var g=r;return function(P){var I=this;P===void 0&&(P=d);for(var R=arguments.length,E=Array(R>1?R-1:0),A=1;A<R;A++)E[A-1]=arguments[A];return g.produce(P,function(N){var O;return(O=a).call.apply(O,[I,N].concat(E))})}}var f;if(typeof a!="function"&&nn(6),c!==void 0&&typeof c!="function"&&nn(7),Xn(s)){var p=xa(r),h=Mo(r,s,void 0),m=!0;try{f=a(h),m=!1}finally{m?ki(p):Do(p)}return typeof Promise<"u"&&f instanceof Promise?f.then(function(P){return oo(p,c),so(P,p)},function(P){throw ki(p),P}):(oo(p,c),so(f,p))}if(!s||typeof s!="object"){if((f=a(s))===void 0&&(f=s),f===jc&&(f=void 0),r.D&&ms(f,!0),c){var _=[],w=[];dn("Patches").M(s,f,_,w),c(_,w)}return f}nn(21,s)},this.produceWithPatches=function(s,a){if(typeof s=="function")return function(f){for(var p=arguments.length,h=Array(p>1?p-1:0),m=1;m<p;m++)h[m-1]=arguments[m];return r.produceWithPatches(f,function(_){return s.apply(void 0,[_].concat(h))})};var c,d,g=r.produce(s,a,function(f,p){c=f,d=p});return typeof Promise<"u"&&g instanceof Promise?g.then(function(f){return[f,c,d]}):[g,c,d]},typeof(n==null?void 0:n.useProxies)=="boolean"&&this.setUseProxies(n.useProxies),typeof(n==null?void 0:n.autoFreeze)=="boolean"&&this.setAutoFreeze(n.autoFreeze)}var t=e.prototype;return t.createDraft=function(n){Xn(n)||nn(8),yr(n)&&(n=Gd(n));var r=xa(this),s=Mo(this,n,void 0);return s[Wt].C=!0,Do(r),s},t.finishDraft=function(n,r){var s=n&&n[Wt],a=s.A;return oo(a,r),so(void 0,a)},t.setAutoFreeze=function(n){this.D=n},t.setUseProxies=function(n){n&&!Ka&&nn(20),this.O=n},t.applyPatches=function(n,r){var s;for(s=r.length-1;s>=0;s--){var a=r[s];if(a.path.length===0&&a.op==="replace"){n=a.value;break}}s>-1&&(r=r.slice(s+1));var c=dn("Patches").$;return yr(n)?c(n,r):this.produce(n,function(d){return c(d,r)})},e}(),Jt=new np,Rm=Jt.produce;Jt.produceWithPatches.bind(Jt);Jt.setAutoFreeze.bind(Jt);Jt.setUseProxies.bind(Jt);Jt.applyPatches.bind(Jt);Jt.createDraft.bind(Jt);Jt.finishDraft.bind(Jt);var rp={},_r={},Tt={},Fr={};(function(e){var t=Oe&&Oe.__spreadArray||function(S,D,H){if(H||arguments.length===2)for(var Q=0,x=D.length,ue;Q<x;Q++)(ue||!(Q in D))&&(ue||(ue=Array.prototype.slice.call(D,0,Q)),ue[Q]=D[Q]);return S.concat(ue||Array.prototype.slice.call(D))};Object.defineProperty(e,"__esModule",{value:!0}),e.flatMapReader=e.flatMapTask=e.flatMapIO=e.flatMapEither=e.flatMapOption=e.flatMapNullable=e.liftOption=e.liftNullable=e.fromReadonlyNonEmptyArray=e.has=e.emptyRecord=e.emptyReadonlyArray=e.tail=e.head=e.isNonEmpty=e.singleton=e.right=e.left=e.isRight=e.isLeft=e.some=e.none=e.isSome=e.isNone=void 0;var n=Zt,r=function(S){return S._tag==="None"};e.isNone=r;var s=function(S){return S._tag==="Some"};e.isSome=s,e.none={_tag:"None"};var a=function(S){return{_tag:"Some",value:S}};e.some=a;var c=function(S){return S._tag==="Left"};e.isLeft=c;var d=function(S){return S._tag==="Right"};e.isRight=d;var g=function(S){return{_tag:"Left",left:S}};e.left=g;var f=function(S){return{_tag:"Right",right:S}};e.right=f;var p=function(S){return[S]};e.singleton=p;var h=function(S){return S.length>0};e.isNonEmpty=h;var m=function(S){return S[0]};e.head=m;var _=function(S){return S.slice(1)};e.tail=_,e.emptyReadonlyArray=[],e.emptyRecord={},e.has=Object.prototype.hasOwnProperty;var w=function(S){return t([S[0]],S.slice(1),!0)};e.fromReadonlyNonEmptyArray=w;var P=function(S){return function(D,H){return function(){for(var Q=[],x=0;x<arguments.length;x++)Q[x]=arguments[x];var ue=D.apply(void 0,Q);return S.fromEither(ue==null?(0,e.left)(H.apply(void 0,Q)):(0,e.right)(ue))}}};e.liftNullable=P;var I=function(S){return function(D,H){return function(){for(var Q=[],x=0;x<arguments.length;x++)Q[x]=arguments[x];var ue=D.apply(void 0,Q);return S.fromEither((0,e.isNone)(ue)?(0,e.left)(H.apply(void 0,Q)):(0,e.right)(ue.value))}}};e.liftOption=I;var R=function(S,D){return(0,n.dual)(3,function(H,Q,x){return D.flatMap(H,(0,e.liftNullable)(S)(Q,x))})};e.flatMapNullable=R;var E=function(S,D){return(0,n.dual)(3,function(H,Q,x){return D.flatMap(H,(0,e.liftOption)(S)(Q,x))})};e.flatMapOption=E;var A=function(S,D){return(0,n.dual)(2,function(H,Q){return D.flatMap(H,function(x){return S.fromEither(Q(x))})})};e.flatMapEither=A;var N=function(S,D){return(0,n.dual)(2,function(H,Q){return D.flatMap(H,function(x){return S.fromIO(Q(x))})})};e.flatMapIO=N;var O=function(S,D){return(0,n.dual)(2,function(H,Q){return D.flatMap(H,function(x){return S.fromTask(Q(x))})})};e.flatMapTask=O;var L=function(S,D){return(0,n.dual)(2,function(H,Q){return D.flatMap(H,function(x){return S.fromReader(Q(x))})})};e.flatMapReader=L})(Fr);var ip=Oe&&Oe.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(t,n);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,s)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),op=Oe&&Oe.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),sp=Oe&&Oe.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&ip(t,e,n);return op(t,e),t};Object.defineProperty(Tt,"__esModule",{value:!0});Tt.sequenceS=Tt.sequenceT=Tt.getApplySemigroup=Tt.apS=Tt.apSecond=Tt.apFirst=Tt.ap=void 0;var ap=Zt,up=sp(Fr);function cp(e,t){return function(n){return function(r){return e.ap(e.map(r,function(s){return function(a){return t.ap(s,a)}}),n)}}}Tt.ap=cp;function lp(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}Tt.apFirst=lp;function fp(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}Tt.apSecond=fp;function hp(e){return function(t,n){return function(r){return e.ap(e.map(r,function(s){return function(a){var c;return Object.assign({},s,(c={},c[t]=a,c))}}),n)}}}Tt.apS=hp;function dp(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(s){return function(a){return t.concat(s,a)}}),r)}}}}Tt.getApplySemigroup=dp;function Ss(e,t,n){return function(r){for(var s=Array(n.length+1),a=0;a<n.length;a++)s[a]=n[a];return s[n.length]=r,t===0?e.apply(null,s):Ss(e,t-1,s)}}var co={1:function(e){return[e]},2:function(e){return function(t){return[e,t]}},3:function(e){return function(t){return function(n){return[e,t,n]}}},4:function(e){return function(t){return function(n){return function(r){return[e,t,n,r]}}}},5:function(e){return function(t){return function(n){return function(r){return function(s){return[e,t,n,r,s]}}}}}};function pp(e){return up.has.call(co,e)||(co[e]=Ss(ap.tuple,e-1,[])),co[e]}function gp(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,s=pp(r),a=e.map(t[0],s),c=1;c<r;c++)a=e.ap(a,t[c]);return a}}Tt.sequenceT=gp;function vp(e){var t=e.length;switch(t){case 1:return function(n){var r;return r={},r[e[0]]=n,r};case 2:return function(n){return function(r){var s;return s={},s[e[0]]=n,s[e[1]]=r,s}};case 3:return function(n){return function(r){return function(s){var a;return a={},a[e[0]]=n,a[e[1]]=r,a[e[2]]=s,a}}};case 4:return function(n){return function(r){return function(s){return function(a){var c;return c={},c[e[0]]=n,c[e[1]]=r,c[e[2]]=s,c[e[3]]=a,c}}}};case 5:return function(n){return function(r){return function(s){return function(a){return function(c){var d;return d={},d[e[0]]=n,d[e[1]]=r,d[e[2]]=s,d[e[3]]=a,d[e[4]]=c,d}}}}};default:return Ss(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var s={},a=0;a<t;a++)s[e[a]]=n[a];return s},t-1,[])}}function mp(e){return function(t){for(var n=Object.keys(t),r=n.length,s=vp(n),a=e.map(t[n[0]],s),c=1;c<r;c++)a=e.ap(a,t[n[c]]);return a}}Tt.sequenceS=mp;var wt={};Object.defineProperty(wt,"__esModule",{value:!0});wt.asUnit=wt.as=wt.getFunctorComposition=wt.let=wt.bindTo=wt.flap=wt.map=void 0;var yp=Zt;function Bc(e,t){return function(n){return function(r){return e.map(r,function(s){return t.map(s,n)})}}}wt.map=Bc;function _p(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}wt.flap=_p;function bp(e){return function(t){return function(n){return e.map(n,function(r){var s;return s={},s[t]=r,s})}}}wt.bindTo=bp;function Sp(e){return function(t,n){return function(r){return e.map(r,function(s){var a;return Object.assign({},s,(a={},a[t]=n(s),a))})}}}wt.let=Sp;function wp(e,t){var n=Bc(e,t);return{map:function(r,s){return(0,yp.pipe)(r,n(s))}}}wt.getFunctorComposition=wp;function Hc(e){return function(t,n){return e.map(t,function(){return n})}}wt.as=Hc;function Ep(e){var t=Hc(e);return function(n){return t(n,void 0)}}wt.asUnit=Ep;Object.defineProperty(_r,"__esModule",{value:!0});_r.getApplicativeComposition=_r.getApplicativeMonoid=void 0;var $c=Tt,Fp=Zt,Ap=wt;function Pp(e){var t=(0,$c.getApplySemigroup)(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}_r.getApplicativeMonoid=Pp;function kp(e,t){var n=(0,Ap.getFunctorComposition)(e,t).map,r=(0,$c.ap)(e,t);return{map:n,of:function(s){return e.of(t.of(s))},ap:function(s,a){return(0,Fp.pipe)(s,r(a))}}}_r.getApplicativeComposition=kp;var En={};Object.defineProperty(En,"__esModule",{value:!0});En.bind=En.tap=En.chainFirst=void 0;function Tp(e){var t=Kc(e);return function(n){return function(r){return t(r,n)}}}En.chainFirst=Tp;function Kc(e){return function(t,n){return e.chain(t,function(r){return e.map(n(r),function(){return r})})}}En.tap=Kc;function Cp(e){return function(t,n){return function(r){return e.chain(r,function(s){return e.map(n(s),function(a){var c;return Object.assign({},s,(c={},c[t]=a,c))})})}}}En.bind=Cp;var ft={},Ip=Oe&&Oe.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(t,n);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,s)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Rp=Oe&&Oe.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Op=Oe&&Oe.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Ip(t,e,n);return Rp(t,e),t};Object.defineProperty(ft,"__esModule",{value:!0});ft.tapEither=ft.filterOrElse=ft.chainFirstEitherK=ft.chainEitherK=ft.fromEitherK=ft.chainOptionK=ft.fromOptionK=ft.fromPredicate=ft.fromOption=void 0;var Lp=En,Vc=Zt,Yn=Op(Fr);function qc(e){return function(t){return function(n){return e.fromEither(Yn.isNone(n)?Yn.left(t()):Yn.right(n.value))}}}ft.fromOption=qc;function Dp(e){return function(t,n){return function(r){return e.fromEither(t(r)?Yn.right(r):Yn.left(n(r)))}}}ft.fromPredicate=Dp;function Wc(e){var t=qc(e);return function(n){var r=t(n);return function(s){return(0,Vc.flow)(s,r)}}}ft.fromOptionK=Wc;function Np(e,t){var n=Wc(e);return function(r){var s=n(r);return function(a){return function(c){return t.chain(c,s(a))}}}}ft.chainOptionK=Np;function ws(e){return function(t){return(0,Vc.flow)(t,e.fromEither)}}ft.fromEitherK=ws;function Mp(e,t){var n=ws(e);return function(r){return function(s){return t.chain(s,n(r))}}}ft.chainEitherK=Mp;function Up(e,t){var n=Jc(e,t);return function(r){return function(s){return n(s,r)}}}ft.chainFirstEitherK=Up;function xp(e,t){return function(n,r){return function(s){return t.chain(s,function(a){return e.fromEither(n(a)?Yn.right(a):Yn.left(r(a)))})}}}ft.filterOrElse=xp;function Jc(e,t){var n=ws(e),r=(0,Lp.tap)(t);return function(s,a){return r(s,n(a))}}ft.tapEither=Jc;var zc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.and=e.or=e.not=e.Contravariant=e.getMonoidAll=e.getSemigroupAll=e.getMonoidAny=e.getSemigroupAny=e.URI=e.contramap=void 0;var t=Zt,n=function(h,m){return(0,t.pipe)(h,(0,e.contramap)(m))},r=function(h){return function(m){return(0,t.flow)(h,m)}};e.contramap=r,e.URI="Predicate";var s=function(){return{concat:function(h,m){return(0,t.pipe)(h,(0,e.or)(m))}}};e.getSemigroupAny=s;var a=function(){return{concat:(0,e.getSemigroupAny)().concat,empty:t.constFalse}};e.getMonoidAny=a;var c=function(){return{concat:function(h,m){return(0,t.pipe)(h,(0,e.and)(m))}}};e.getSemigroupAll=c;var d=function(){return{concat:(0,e.getSemigroupAll)().concat,empty:t.constTrue}};e.getMonoidAll=d,e.Contravariant={URI:e.URI,contramap:n};var g=function(h){return function(m){return!h(m)}};e.not=g;var f=function(h){return function(m){return function(_){return m(_)||h(_)}}};e.or=f;var p=function(h){return function(m){return function(_){return m(_)&&h(_)}}};e.and=p})(zc);var Yc={},Gt={};Object.defineProperty(Gt,"__esModule",{value:!0});Gt.concatAll=Gt.endo=Gt.filterSecond=Gt.filterFirst=Gt.reverse=void 0;var jp=function(e){return{concat:function(t,n){return e.concat(n,t)}}};Gt.reverse=jp;var Bp=function(e){return function(t){return{concat:function(n,r){return e(n)?t.concat(n,r):r}}}};Gt.filterFirst=Bp;var Hp=function(e){return function(t){return{concat:function(n,r){return e(r)?t.concat(n,r):n}}}};Gt.filterSecond=Hp;var $p=function(e){return function(t){return{concat:function(n,r){return t.concat(e(n),e(r))}}}};Gt.endo=$p;var Kp=function(e){return function(t){return function(n){return n.reduce(function(r,s){return e.concat(r,s)},t)}}};Gt.concatAll=Kp;var Gc={},Xc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.eqDate=e.eqNumber=e.eqString=e.eqBoolean=e.eq=e.strictEqual=e.getStructEq=e.getTupleEq=e.Contravariant=e.getMonoid=e.getSemigroup=e.eqStrict=e.URI=e.contramap=e.tuple=e.struct=e.fromEquals=void 0;var t=Zt,n=function(p){return{equals:function(h,m){return h===m||p(h,m)}}};e.fromEquals=n;var r=function(p){return(0,e.fromEquals)(function(h,m){for(var _ in p)if(!p[_].equals(h[_],m[_]))return!1;return!0})};e.struct=r;var s=function(){for(var p=[],h=0;h<arguments.length;h++)p[h]=arguments[h];return(0,e.fromEquals)(function(m,_){return p.every(function(w,P){return w.equals(m[P],_[P])})})};e.tuple=s;var a=function(p,h){return(0,t.pipe)(p,(0,e.contramap)(h))},c=function(p){return function(h){return(0,e.fromEquals)(function(m,_){return h.equals(p(m),p(_))})}};e.contramap=c,e.URI="Eq",e.eqStrict={equals:function(p,h){return p===h}};var d={equals:function(){return!0}},g=function(){return{concat:function(p,h){return(0,e.fromEquals)(function(m,_){return p.equals(m,_)&&h.equals(m,_)})}}};e.getSemigroup=g;var f=function(){return{concat:(0,e.getSemigroup)().concat,empty:d}};e.getMonoid=f,e.Contravariant={URI:e.URI,contramap:a},e.getTupleEq=e.tuple,e.getStructEq=e.struct,e.strictEqual=e.eqStrict.equals,e.eq=e.Contravariant,e.eqBoolean=e.eqStrict,e.eqString=e.eqStrict,e.eqNumber=e.eqStrict,e.eqDate={equals:function(p,h){return p.valueOf()===h.valueOf()}}})(Xc);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ordDate=e.ordNumber=e.ordString=e.ordBoolean=e.ord=e.getDualOrd=e.getTupleOrd=e.between=e.clamp=e.max=e.min=e.geq=e.leq=e.gt=e.lt=e.equals=e.trivial=e.Contravariant=e.getMonoid=e.getSemigroup=e.URI=e.contramap=e.reverse=e.tuple=e.fromCompare=e.equalsDefault=void 0;var t=Xc,n=Zt,r=function(L){return function(S,D){return S===D||L(S,D)===0}};e.equalsDefault=r;var s=function(L){return{equals:(0,e.equalsDefault)(L),compare:function(S,D){return S===D?0:L(S,D)}}};e.fromCompare=s;var a=function(){for(var L=[],S=0;S<arguments.length;S++)L[S]=arguments[S];return(0,e.fromCompare)(function(D,H){for(var Q=0;Q<L.length-1;Q++){var x=L[Q].compare(D[Q],H[Q]);if(x!==0)return x}return L[Q].compare(D[Q],H[Q])})};e.tuple=a;var c=function(L){return(0,e.fromCompare)(function(S,D){return L.compare(D,S)})};e.reverse=c;var d=function(L,S){return(0,n.pipe)(L,(0,e.contramap)(S))},g=function(L){return function(S){return(0,e.fromCompare)(function(D,H){return S.compare(L(D),L(H))})}};e.contramap=g,e.URI="Ord";var f=function(){return{concat:function(L,S){return(0,e.fromCompare)(function(D,H){var Q=L.compare(D,H);return Q!==0?Q:S.compare(D,H)})}}};e.getSemigroup=f;var p=function(){return{concat:(0,e.getSemigroup)().concat,empty:(0,e.fromCompare)(function(){return 0})}};e.getMonoid=p,e.Contravariant={URI:e.URI,contramap:d},e.trivial={equals:n.constTrue,compare:(0,n.constant)(0)};var h=function(L){return function(S){return function(D){return D===S||L.compare(D,S)===0}}};e.equals=h;var m=function(L){return function(S,D){return L.compare(S,D)===-1}};e.lt=m;var _=function(L){return function(S,D){return L.compare(S,D)===1}};e.gt=_;var w=function(L){return function(S,D){return L.compare(S,D)!==1}};e.leq=w;var P=function(L){return function(S,D){return L.compare(S,D)!==-1}};e.geq=P;var I=function(L){return function(S,D){return S===D||L.compare(S,D)<1?S:D}};e.min=I;var R=function(L){return function(S,D){return S===D||L.compare(S,D)>-1?S:D}};e.max=R;var E=function(L){var S=(0,e.min)(L),D=(0,e.max)(L);return function(H,Q){return function(x){return D(S(x,Q),H)}}};e.clamp=E;var A=function(L){var S=(0,e.lt)(L),D=(0,e.gt)(L);return function(H,Q){return function(x){return!(S(x,H)||D(x,Q))}}};e.between=A,e.getTupleOrd=e.tuple,e.getDualOrd=e.reverse,e.ord=e.Contravariant;function N(L,S){return L<S?-1:L>S?1:0}var O={equals:t.eqStrict.equals,compare:N};e.ordBoolean=O,e.ordString=O,e.ordNumber=O,e.ordDate=(0,n.pipe)(e.ordNumber,(0,e.contramap)(function(L){return L.valueOf()}))})(Gc);(function(e){var t=Oe&&Oe.__createBinding||(Object.create?function(E,A,N,O){O===void 0&&(O=N);var L=Object.getOwnPropertyDescriptor(A,N);(!L||("get"in L?!A.__esModule:L.writable||L.configurable))&&(L={enumerable:!0,get:function(){return A[N]}}),Object.defineProperty(E,O,L)}:function(E,A,N,O){O===void 0&&(O=N),E[O]=A[N]}),n=Oe&&Oe.__setModuleDefault||(Object.create?function(E,A){Object.defineProperty(E,"default",{enumerable:!0,value:A})}:function(E,A){E.default=A}),r=Oe&&Oe.__importStar||function(E){if(E&&E.__esModule)return E;var A={};if(E!=null)for(var N in E)N!=="default"&&Object.prototype.hasOwnProperty.call(E,N)&&t(A,E,N);return n(A,E),A};Object.defineProperty(e,"__esModule",{value:!0}),e.semigroupProduct=e.semigroupSum=e.semigroupString=e.getFunctionSemigroup=e.semigroupAny=e.semigroupAll=e.fold=e.getIntercalateSemigroup=e.getMeetSemigroup=e.getJoinSemigroup=e.getDualSemigroup=e.getStructSemigroup=e.getTupleSemigroup=e.getFirstSemigroup=e.getLastSemigroup=e.getObjectSemigroup=e.semigroupVoid=e.concatAll=e.last=e.first=e.intercalate=e.tuple=e.struct=e.reverse=e.constant=e.max=e.min=void 0;var s=Zt,a=r(Fr),c=r(Gt),d=r(Gc),g=function(E){return{concat:d.min(E)}};e.min=g;var f=function(E){return{concat:d.max(E)}};e.max=f;var p=function(E){return{concat:function(){return E}}};e.constant=p,e.reverse=c.reverse;var h=function(E){return{concat:function(A,N){var O={};for(var L in E)a.has.call(E,L)&&(O[L]=E[L].concat(A[L],N[L]));return O}}};e.struct=h;var m=function(){for(var E=[],A=0;A<arguments.length;A++)E[A]=arguments[A];return{concat:function(N,O){return E.map(function(L,S){return L.concat(N[S],O[S])})}}};e.tuple=m;var _=function(E){return function(A){return{concat:function(N,O){return A.concat(N,A.concat(E,O))}}}};e.intercalate=_;var w=function(){return{concat:s.identity}};e.first=w;var P=function(){return{concat:function(E,A){return A}}};e.last=P,e.concatAll=c.concatAll,e.semigroupVoid=(0,e.constant)(void 0);var I=function(){return{concat:function(E,A){return Object.assign({},E,A)}}};e.getObjectSemigroup=I,e.getLastSemigroup=e.last,e.getFirstSemigroup=e.first,e.getTupleSemigroup=e.tuple,e.getStructSemigroup=e.struct,e.getDualSemigroup=e.reverse,e.getJoinSemigroup=e.max,e.getMeetSemigroup=e.min,e.getIntercalateSemigroup=e.intercalate;function R(E){var A=(0,e.concatAll)(E);return function(N,O){return O===void 0?A(N):A(N)(O)}}e.fold=R,e.semigroupAll={concat:function(E,A){return E&&A}},e.semigroupAny={concat:function(E,A){return E||A}},e.getFunctionSemigroup=s.getSemigroup,e.semigroupString={concat:function(E,A){return E+A}},e.semigroupSum={concat:function(E,A){return E+A}},e.semigroupProduct={concat:function(E,A){return E*A}}})(Yc);var Qc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.right=e.left=e.flap=e.Functor=e.Bifunctor=e.URI=e.bimap=e.mapLeft=e.map=e.separated=void 0;var t=Zt,n=wt,r=function(m,_){return{left:m,right:_}};e.separated=r;var s=function(m,_){return(0,t.pipe)(m,(0,e.map)(_))},a=function(m,_){return(0,t.pipe)(m,(0,e.mapLeft)(_))},c=function(m,_,w){return(0,t.pipe)(m,(0,e.bimap)(_,w))},d=function(m){return function(_){return(0,e.separated)((0,e.left)(_),m((0,e.right)(_)))}};e.map=d;var g=function(m){return function(_){return(0,e.separated)(m((0,e.left)(_)),(0,e.right)(_))}};e.mapLeft=g;var f=function(m,_){return function(w){return(0,e.separated)(m((0,e.left)(w)),_((0,e.right)(w)))}};e.bimap=f,e.URI="Separated",e.Bifunctor={URI:e.URI,mapLeft:a,bimap:c},e.Functor={URI:e.URI,map:s},e.flap=(0,n.flap)(e.Functor);var p=function(m){return m.left};e.left=p;var h=function(m){return m.right};e.right=h})(Qc);var Nn={},Vp=Oe&&Oe.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(t,n);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,s)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),qp=Oe&&Oe.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Wp=Oe&&Oe.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Vp(t,e,n);return qp(t,e),t};Object.defineProperty(Nn,"__esModule",{value:!0});Nn.filterE=Nn.witherDefault=Nn.wiltDefault=void 0;var qa=Wp(Fr);function Jp(e,t){return function(n){var r=e.traverse(n);return function(s,a){return n.map(r(s,a),t.separate)}}}Nn.wiltDefault=Jp;function zp(e,t){return function(n){var r=e.traverse(n);return function(s,a){return n.map(r(s,a),t.compact)}}}Nn.witherDefault=zp;function Yp(e){return function(t){var n=e.wither(t);return function(r){return function(s){return n(s,function(a){return t.map(r(a),function(c){return c?qa.some(a):qa.none})})}}}}Nn.filterE=Yp;var Bi={};Object.defineProperty(Bi,"__esModule",{value:!0});Bi.guard=void 0;function Gp(e,t){return function(n){return n?t.of(void 0):e.zero()}}Bi.guard=Gp;(function(e){var t=Oe&&Oe.__createBinding||(Object.create?function(oe,ae,he,We){We===void 0&&(We=he);var gt=Object.getOwnPropertyDescriptor(ae,he);(!gt||("get"in gt?!ae.__esModule:gt.writable||gt.configurable))&&(gt={enumerable:!0,get:function(){return ae[he]}}),Object.defineProperty(oe,We,gt)}:function(oe,ae,he,We){We===void 0&&(We=he),oe[We]=ae[he]}),n=Oe&&Oe.__setModuleDefault||(Object.create?function(oe,ae){Object.defineProperty(oe,"default",{enumerable:!0,value:ae})}:function(oe,ae){oe.default=ae}),r=Oe&&Oe.__importStar||function(oe){if(oe&&oe.__esModule)return oe;var ae={};if(oe!=null)for(var he in oe)he!=="default"&&Object.prototype.hasOwnProperty.call(oe,he)&&t(ae,oe,he);return n(ae,oe),ae};Object.defineProperty(e,"__esModule",{value:!0}),e.Witherable=e.wilt=e.wither=e.Traversable=e.sequence=e.traverse=e.Filterable=e.partitionMap=e.partition=e.filterMap=e.filter=e.Compactable=e.separate=e.compact=e.Extend=e.extend=e.Alternative=e.guard=e.Zero=e.zero=e.Alt=e.alt=e.altW=e.orElse=e.Foldable=e.reduceRight=e.foldMap=e.reduce=e.Monad=e.Chain=e.flatMap=e.Applicative=e.Apply=e.ap=e.Pointed=e.of=e.asUnit=e.as=e.Functor=e.map=e.getMonoid=e.getOrd=e.getEq=e.getShow=e.URI=e.getRight=e.getLeft=e.fromPredicate=e.some=e.none=void 0,e.getFirstMonoid=e.getApplyMonoid=e.getApplySemigroup=e.option=e.mapNullable=e.getRefinement=e.chainFirst=e.chain=e.sequenceArray=e.traverseArray=e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex=e.traverseReadonlyNonEmptyArrayWithIndex=e.ApT=e.apS=e.bind=e.let=e.bindTo=e.Do=e.exists=e.elem=e.toUndefined=e.toNullable=e.chainNullableK=e.fromNullableK=e.tryCatchK=e.tryCatch=e.fromNullable=e.chainFirstEitherK=e.chainEitherK=e.fromEitherK=e.duplicate=e.tapEither=e.tap=e.flatten=e.apSecond=e.apFirst=e.flap=e.getOrElse=e.getOrElseW=e.fold=e.match=e.foldW=e.matchW=e.isNone=e.isSome=e.FromEither=e.fromEither=e.MonadThrow=e.throwError=void 0,e.getLastMonoid=void 0;var s=_r,a=Tt,c=r(En),d=ft,g=Zt,f=wt,p=r(Fr),h=zc,m=Yc,_=Qc,w=Nn,P=Bi;e.none=p.none,e.some=p.some;function I(oe){return function(ae){return oe(ae)?(0,e.some)(ae):e.none}}e.fromPredicate=I;var R=function(oe){return oe._tag==="Right"?e.none:(0,e.some)(oe.left)};e.getLeft=R;var E=function(oe){return oe._tag==="Left"?e.none:(0,e.some)(oe.right)};e.getRight=E;var A=function(oe,ae){return(0,g.pipe)(oe,(0,e.map)(ae))},N=function(oe,ae){return(0,g.pipe)(oe,(0,e.ap)(ae))},O=function(oe,ae,he){return(0,g.pipe)(oe,(0,e.reduce)(ae,he))},L=function(oe){var ae=(0,e.foldMap)(oe);return function(he,We){return(0,g.pipe)(he,ae(We))}},S=function(oe,ae,he){return(0,g.pipe)(oe,(0,e.reduceRight)(ae,he))},D=function(oe){var ae=(0,e.traverse)(oe);return function(he,We){return(0,g.pipe)(he,ae(We))}},H=function(oe,ae){return(0,g.pipe)(oe,(0,e.alt)(ae))},Q=function(oe,ae){return(0,g.pipe)(oe,(0,e.filter)(ae))},x=function(oe,ae){return(0,g.pipe)(oe,(0,e.filterMap)(ae))},ue=function(oe,ae){return(0,g.pipe)(oe,(0,e.extend)(ae))},le=function(oe,ae){return(0,g.pipe)(oe,(0,e.partition)(ae))},be=function(oe,ae){return(0,g.pipe)(oe,(0,e.partitionMap)(ae))};e.URI="Option";var Se=function(oe){return{show:function(ae){return(0,e.isNone)(ae)?"none":"some(".concat(oe.show(ae.value),")")}}};e.getShow=Se;var Te=function(oe){return{equals:function(ae,he){return ae===he||((0,e.isNone)(ae)?(0,e.isNone)(he):(0,e.isNone)(he)?!1:oe.equals(ae.value,he.value))}}};e.getEq=Te;var Ne=function(oe){return{equals:(0,e.getEq)(oe).equals,compare:function(ae,he){return ae===he?0:(0,e.isSome)(ae)?(0,e.isSome)(he)?oe.compare(ae.value,he.value):1:-1}}};e.getOrd=Ne;var Ke=function(oe){return{concat:function(ae,he){return(0,e.isNone)(ae)?he:(0,e.isNone)(he)?ae:(0,e.some)(oe.concat(ae.value,he.value))},empty:e.none}};e.getMonoid=Ke;var Pe=function(oe){return function(ae){return(0,e.isNone)(ae)?e.none:(0,e.some)(oe(ae.value))}};e.map=Pe,e.Functor={URI:e.URI,map:A},e.as=(0,g.dual)(2,(0,f.as)(e.Functor)),e.asUnit=(0,f.asUnit)(e.Functor),e.of=e.some,e.Pointed={URI:e.URI,of:e.of};var Ae=function(oe){return function(ae){return(0,e.isNone)(ae)||(0,e.isNone)(oe)?e.none:(0,e.some)(ae.value(oe.value))}};e.ap=Ae,e.Apply={URI:e.URI,map:A,ap:N},e.Applicative={URI:e.URI,map:A,ap:N,of:e.of},e.flatMap=(0,g.dual)(2,function(oe,ae){return(0,e.isNone)(oe)?e.none:ae(oe.value)}),e.Chain={URI:e.URI,map:A,ap:N,chain:e.flatMap},e.Monad={URI:e.URI,map:A,ap:N,of:e.of,chain:e.flatMap};var Le=function(oe,ae){return function(he){return(0,e.isNone)(he)?oe:ae(oe,he.value)}};e.reduce=Le;var at=function(oe){return function(ae){return function(he){return(0,e.isNone)(he)?oe.empty:ae(he.value)}}};e.foldMap=at;var Be=function(oe,ae){return function(he){return(0,e.isNone)(he)?oe:ae(he.value,oe)}};e.reduceRight=Be,e.Foldable={URI:e.URI,reduce:O,foldMap:L,reduceRight:S},e.orElse=(0,g.dual)(2,function(oe,ae){return(0,e.isNone)(oe)?ae():oe}),e.altW=e.orElse,e.alt=e.orElse,e.Alt={URI:e.URI,map:A,alt:H};var bt=function(){return e.none};e.zero=bt,e.Zero={URI:e.URI,zero:e.zero},e.guard=(0,P.guard)(e.Zero,e.Pointed),e.Alternative={URI:e.URI,map:A,ap:N,of:e.of,alt:H,zero:e.zero};var Ft=function(oe){return function(ae){return(0,e.isNone)(ae)?e.none:(0,e.some)(oe(ae))}};e.extend=Ft,e.Extend={URI:e.URI,map:A,extend:ue},e.compact=(0,e.flatMap)(g.identity);var Bt=(0,_.separated)(e.none,e.none),At=function(oe){return(0,e.isNone)(oe)?Bt:(0,_.separated)((0,e.getLeft)(oe.value),(0,e.getRight)(oe.value))};e.separate=At,e.Compactable={URI:e.URI,compact:e.compact,separate:e.separate};var rt=function(oe){return function(ae){return(0,e.isNone)(ae)?e.none:oe(ae.value)?ae:e.none}};e.filter=rt;var De=function(oe){return function(ae){return(0,e.isNone)(ae)?e.none:oe(ae.value)}};e.filterMap=De;var He=function(oe){return function(ae){return(0,_.separated)(Q(ae,(0,h.not)(oe)),Q(ae,oe))}};e.partition=He;var q=function(oe){return(0,g.flow)((0,e.map)(oe),e.separate)};e.partitionMap=q,e.Filterable={URI:e.URI,map:A,compact:e.compact,separate:e.separate,filter:Q,filterMap:x,partition:le,partitionMap:be};var b=function(oe){return function(ae){return function(he){return(0,e.isNone)(he)?oe.of(e.none):oe.map(ae(he.value),e.some)}}};e.traverse=b;var F=function(oe){return function(ae){return(0,e.isNone)(ae)?oe.of(e.none):oe.map(ae.value,e.some)}};e.sequence=F,e.Traversable={URI:e.URI,map:A,reduce:O,foldMap:L,reduceRight:S,traverse:D,sequence:e.sequence};var Y=(0,w.witherDefault)(e.Traversable,e.Compactable),G=(0,w.wiltDefault)(e.Traversable,e.Compactable),Z=function(oe){var ae=Y(oe);return function(he){return function(We){return ae(We,he)}}};e.wither=Z;var se=function(oe){var ae=G(oe);return function(he){return function(We){return ae(We,he)}}};e.wilt=se,e.Witherable={URI:e.URI,map:A,reduce:O,foldMap:L,reduceRight:S,traverse:D,sequence:e.sequence,compact:e.compact,separate:e.separate,filter:Q,filterMap:x,partition:le,partitionMap:be,wither:Y,wilt:G};var pe=function(){return e.none};e.throwError=pe,e.MonadThrow={URI:e.URI,map:A,ap:N,of:e.of,chain:e.flatMap,throwError:e.throwError},e.fromEither=e.getRight,e.FromEither={URI:e.URI,fromEither:e.fromEither},e.isSome=p.isSome;var Ee=function(oe){return oe._tag==="None"};e.isNone=Ee;var Me=function(oe,ae){return function(he){return(0,e.isNone)(he)?oe():ae(he.value)}};e.matchW=Me,e.foldW=e.matchW,e.match=e.matchW,e.fold=e.match;var Ie=function(oe){return function(ae){return(0,e.isNone)(ae)?oe():ae.value}};e.getOrElseW=Ie,e.getOrElse=e.getOrElseW,e.flap=(0,f.flap)(e.Functor),e.apFirst=(0,a.apFirst)(e.Apply),e.apSecond=(0,a.apSecond)(e.Apply),e.flatten=e.compact,e.tap=(0,g.dual)(2,c.tap(e.Chain)),e.tapEither=(0,g.dual)(2,(0,d.tapEither)(e.FromEither,e.Chain)),e.duplicate=(0,e.extend)(g.identity),e.fromEitherK=(0,d.fromEitherK)(e.FromEither),e.chainEitherK=(0,d.chainEitherK)(e.FromEither,e.Chain),e.chainFirstEitherK=e.tapEither;var Ge=function(oe){return oe==null?e.none:(0,e.some)(oe)};e.fromNullable=Ge;var St=function(oe){try{return(0,e.some)(oe())}catch{return e.none}};e.tryCatch=St;var Ct=function(oe){return function(){for(var ae=[],he=0;he<arguments.length;he++)ae[he]=arguments[he];return(0,e.tryCatch)(function(){return oe.apply(void 0,ae)})}};e.tryCatchK=Ct;var Ht=function(oe){return(0,g.flow)(oe,e.fromNullable)};e.fromNullableK=Ht;var me=function(oe){return function(ae){return(0,e.isNone)(ae)?e.none:(0,e.fromNullable)(oe(ae.value))}};e.chainNullableK=me,e.toNullable=(0,e.match)(g.constNull,g.identity),e.toUndefined=(0,e.match)(g.constUndefined,g.identity);function Ve(oe){return function(ae,he){if(he===void 0){var We=Ve(oe);return function(gt){return We(ae,gt)}}return(0,e.isNone)(he)?!1:oe.equals(ae,he.value)}}e.elem=Ve;var Re=function(oe){return function(ae){return(0,e.isNone)(ae)?!1:oe(ae.value)}};e.exists=Re,e.Do=(0,e.of)(p.emptyRecord),e.bindTo=(0,f.bindTo)(e.Functor);var un=(0,f.let)(e.Functor);e.let=un,e.bind=c.bind(e.Chain),e.apS=(0,a.apS)(e.Apply),e.ApT=(0,e.of)(p.emptyReadonlyArray);var ni=function(oe){return function(ae){var he=oe(0,p.head(ae));if((0,e.isNone)(he))return e.none;for(var We=[he.value],gt=1;gt<ae.length;gt++){var Ze=oe(gt,ae[gt]);if((0,e.isNone)(Ze))return e.none;We.push(Ze.value)}return(0,e.some)(We)}};e.traverseReadonlyNonEmptyArrayWithIndex=ni;var M=function(oe){var ae=(0,e.traverseReadonlyNonEmptyArrayWithIndex)(oe);return function(he){return p.isNonEmpty(he)?ae(he):e.ApT}};e.traverseReadonlyArrayWithIndex=M,e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex;var Bn=function(oe){return(0,e.traverseReadonlyArrayWithIndex)(function(ae,he){return oe(he)})};e.traverseArray=Bn,e.sequenceArray=(0,e.traverseArray)(g.identity),e.chain=e.flatMap,e.chainFirst=e.tap;function $t(oe){return function(ae){return(0,e.isSome)(oe(ae))}}e.getRefinement=$t,e.mapNullable=e.chainNullableK,e.option={URI:e.URI,map:A,of:e.of,ap:N,chain:e.flatMap,reduce:O,foldMap:L,reduceRight:S,traverse:D,sequence:e.sequence,zero:e.zero,alt:H,extend:ue,compact:e.compact,separate:e.separate,filter:Q,filterMap:x,partition:le,partitionMap:be,wither:Y,wilt:G,throwError:e.throwError},e.getApplySemigroup=(0,a.getApplySemigroup)(e.Apply),e.getApplyMonoid=(0,s.getApplicativeMonoid)(e.Applicative);var fe=function(){return(0,e.getMonoid)((0,m.first)())};e.getFirstMonoid=fe;var ri=function(){return(0,e.getMonoid)((0,m.last)())};e.getLastMonoid=ri})(rp);var Zc={exports:{}};(function(e,t){(function(r,s){e.exports=s()})(Oe,function(){return function(n){var r={};function s(a){if(r[a])return r[a].exports;var c=r[a]={i:a,l:!1,exports:{}};return n[a].call(c.exports,c,c.exports,s),c.l=!0,c.exports}return s.m=n,s.c=r,s.d=function(a,c,d){s.o(a,c)||Object.defineProperty(a,c,{enumerable:!0,get:d})},s.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},s.t=function(a,c){if(1&c&&(a=s(a)),8&c||4&c&&typeof a=="object"&&a&&a.__esModule)return a;var d=Object.create(null);if(s.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:a}),2&c&&typeof a!="string")for(var g in a)s.d(d,g,(function(f){return a[f]}).bind(null,g));return d},s.n=function(a){var c=a&&a.__esModule?function(){return a.default}:function(){return a};return s.d(c,"a",c),c},s.o=function(a,c){return Object.prototype.hasOwnProperty.call(a,c)},s.p="",s(s.s=22)}([function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function f(p,h){for(var m=0;m<h.length;m++){var _=h[m];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(p,_.key,_)}}return function(p,h,m){return h&&f(p.prototype,h),m&&f(p,m),p}}(),c={debug:function(){},info:function(){},warn:function(){},error:function(){}},d=void 0,g=void 0;(r.Log=function(){function f(){(function(h,m){if(!(h instanceof m))throw new TypeError("Cannot call a class as a function")})(this,f)}return f.reset=function(){g=3,d=c},f.debug=function(){if(g>=4){for(var h=arguments.length,m=Array(h),_=0;_<h;_++)m[_]=arguments[_];d.debug.apply(d,Array.from(m))}},f.info=function(){if(g>=3){for(var h=arguments.length,m=Array(h),_=0;_<h;_++)m[_]=arguments[_];d.info.apply(d,Array.from(m))}},f.warn=function(){if(g>=2){for(var h=arguments.length,m=Array(h),_=0;_<h;_++)m[_]=arguments[_];d.warn.apply(d,Array.from(m))}},f.error=function(){if(g>=1){for(var h=arguments.length,m=Array(h),_=0;_<h;_++)m[_]=arguments[_];d.error.apply(d,Array.from(m))}},a(f,null,[{key:"NONE",get:function(){return 0}},{key:"ERROR",get:function(){return 1}},{key:"WARN",get:function(){return 2}},{key:"INFO",get:function(){return 3}},{key:"DEBUG",get:function(){return 4}},{key:"level",get:function(){return g},set:function(h){if(!(0<=h&&h<=4))throw new Error("Invalid log level");g=h}},{key:"logger",get:function(){return d},set:function(h){if(!h.debug&&h.info&&(h.debug=h.info),!(h.debug&&h.info&&h.warn&&h.error))throw new Error("Invalid logger");d=h}}]),f}()).reset()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function f(p,h){for(var m=0;m<h.length;m++){var _=h[m];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(p,_.key,_)}}return function(p,h,m){return h&&f(p.prototype,h),m&&f(p,m),p}}(),c={setInterval:function(f){function p(h,m){return f.apply(this,arguments)}return p.toString=function(){return f.toString()},p}(function(f,p){return setInterval(f,p)}),clearInterval:function(f){function p(h){return f.apply(this,arguments)}return p.toString=function(){return f.toString()},p}(function(f){return clearInterval(f)})},d=!1,g=null;r.Global=function(){function f(){(function(h,m){if(!(h instanceof m))throw new TypeError("Cannot call a class as a function")})(this,f)}return f._testing=function(){d=!0},f.setXMLHttpRequest=function(h){g=h},a(f,null,[{key:"location",get:function(){if(!d)return location}},{key:"localStorage",get:function(){if(!d&&typeof window<"u")return localStorage}},{key:"sessionStorage",get:function(){if(!d&&typeof window<"u")return sessionStorage}},{key:"XMLHttpRequest",get:function(){if(!d&&typeof window<"u")return g||XMLHttpRequest}},{key:"timer",get:function(){if(!d)return c}}]),f}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.MetadataService=void 0;var a=function(){function p(h,m){for(var _=0;_<m.length;_++){var w=m[_];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(h,w.key,w)}}return function(h,m,_){return m&&p(h.prototype,m),_&&p(h,_),h}}(),c=s(0),d=s(7);function g(p,h){if(!(p instanceof h))throw new TypeError("Cannot call a class as a function")}var f=".well-known/openid-configuration";r.MetadataService=function(){function p(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.JsonService;if(g(this,p),!h)throw c.Log.error("MetadataService: No settings passed to MetadataService"),new Error("settings");this._settings=h,this._jsonService=new m(["application/jwk-set+json"])}return p.prototype.resetSigningKeys=function(){this._settings=this._settings||{},this._settings.signingKeys=void 0},p.prototype.getMetadata=function(){var m=this;return this._settings.metadata?(c.Log.debug("MetadataService.getMetadata: Returning metadata from settings"),Promise.resolve(this._settings.metadata)):this.metadataUrl?(c.Log.debug("MetadataService.getMetadata: getting metadata from",this.metadataUrl),this._jsonService.getJson(this.metadataUrl).then(function(_){c.Log.debug("MetadataService.getMetadata: json received");var w=m._settings.metadataSeed||{};return m._settings.metadata=Object.assign({},w,_),m._settings.metadata})):(c.Log.error("MetadataService.getMetadata: No authority or metadataUrl configured on settings"),Promise.reject(new Error("No authority or metadataUrl configured on settings")))},p.prototype.getIssuer=function(){return this._getMetadataProperty("issuer")},p.prototype.getAuthorizationEndpoint=function(){return this._getMetadataProperty("authorization_endpoint")},p.prototype.getUserInfoEndpoint=function(){return this._getMetadataProperty("userinfo_endpoint")},p.prototype.getTokenEndpoint=function(){var m=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return this._getMetadataProperty("token_endpoint",m)},p.prototype.getCheckSessionIframe=function(){return this._getMetadataProperty("check_session_iframe",!0)},p.prototype.getEndSessionEndpoint=function(){return this._getMetadataProperty("end_session_endpoint",!0)},p.prototype.getRevocationEndpoint=function(){return this._getMetadataProperty("revocation_endpoint",!0)},p.prototype.getKeysEndpoint=function(){return this._getMetadataProperty("jwks_uri",!0)},p.prototype._getMetadataProperty=function(m){var _=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return c.Log.debug("MetadataService.getMetadataProperty for: "+m),this.getMetadata().then(function(w){if(c.Log.debug("MetadataService.getMetadataProperty: metadata recieved"),w[m]===void 0){if(_===!0)return void c.Log.warn("MetadataService.getMetadataProperty: Metadata does not contain optional property "+m);throw c.Log.error("MetadataService.getMetadataProperty: Metadata does not contain property "+m),new Error("Metadata does not contain property "+m)}return w[m]})},p.prototype.getSigningKeys=function(){var m=this;return this._settings.signingKeys?(c.Log.debug("MetadataService.getSigningKeys: Returning signingKeys from settings"),Promise.resolve(this._settings.signingKeys)):this._getMetadataProperty("jwks_uri").then(function(_){return c.Log.debug("MetadataService.getSigningKeys: jwks_uri received",_),m._jsonService.getJson(_).then(function(w){if(c.Log.debug("MetadataService.getSigningKeys: key set received",w),!w.keys)throw c.Log.error("MetadataService.getSigningKeys: Missing keys on keyset"),new Error("Missing keys on keyset");return m._settings.signingKeys=w.keys,m._settings.signingKeys})})},a(p,[{key:"metadataUrl",get:function(){return this._metadataUrl||(this._settings.metadataUrl?this._metadataUrl=this._settings.metadataUrl:(this._metadataUrl=this._settings.authority,this._metadataUrl&&this._metadataUrl.indexOf(f)<0&&(this._metadataUrl[this._metadataUrl.length-1]!=="/"&&(this._metadataUrl+="/"),this._metadataUrl+=f))),this._metadataUrl}}]),p}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.UrlUtility=void 0;var a=s(0),c=s(1);r.UrlUtility=function(){function d(){(function(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")})(this,d)}return d.addQueryParam=function(f,p,h){return f.indexOf("?")<0&&(f+="?"),f[f.length-1]!=="?"&&(f+="&"),f+=encodeURIComponent(p),f+="=",f+=encodeURIComponent(h)},d.parseUrlFragment=function(f){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"#",h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:c.Global;typeof f!="string"&&(f=h.location.href);var m=f.lastIndexOf(p);m>=0&&(f=f.substr(m+1)),p==="?"&&(m=f.indexOf("#"))>=0&&(f=f.substr(0,m));for(var _,w={},P=/([^&=]+)=([^&]*)/g,I=0;_=P.exec(f);)if(w[decodeURIComponent(_[1])]=decodeURIComponent(_[2].replace(/\+/g," ")),I++>50)return a.Log.error("UrlUtility.parseUrlFragment: response exceeded expected number of parameters",f),{error:"Response exceeded expected number of parameters"};for(var R in w)return w;return{}},d}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.JoseUtil=void 0;var a=s(26),c=function(g){return g&&g.__esModule?g:{default:g}}(s(33));r.JoseUtil=(0,c.default)({jws:a.jws,KeyUtil:a.KeyUtil,X509:a.X509,crypto:a.crypto,hextob64u:a.hextob64u,b64tohex:a.b64tohex,AllowedSigningAlgs:a.AllowedSigningAlgs})},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.OidcClientSettings=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},c=function(){function R(E,A){for(var N=0;N<A.length;N++){var O=A[N];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(E,O.key,O)}}return function(E,A,N){return A&&R(E.prototype,A),N&&R(E,N),E}}(),d=s(0),g=s(23),f=s(6),p=s(24),h=s(2);function m(R,E){if(!(R instanceof E))throw new TypeError("Cannot call a class as a function")}var _=".well-known/openid-configuration",w="id_token",P="openid",I="client_secret_post";r.OidcClientSettings=function(){function R(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},A=E.authority,N=E.metadataUrl,O=E.metadata,L=E.signingKeys,S=E.metadataSeed,D=E.client_id,H=E.client_secret,Q=E.response_type,x=Q===void 0?w:Q,ue=E.scope,le=ue===void 0?P:ue,be=E.redirect_uri,Se=E.post_logout_redirect_uri,Te=E.client_authentication,Ne=Te===void 0?I:Te,Ke=E.prompt,Pe=E.display,Ae=E.max_age,Le=E.ui_locales,at=E.acr_values,Be=E.resource,bt=E.response_mode,Ft=E.filterProtocolClaims,Bt=Ft===void 0||Ft,At=E.loadUserInfo,rt=At===void 0||At,De=E.staleStateAge,He=De===void 0?900:De,q=E.clockSkew,b=q===void 0?300:q,F=E.clockService,Y=F===void 0?new g.ClockService:F,G=E.userInfoJwtIssuer,Z=G===void 0?"OP":G,se=E.mergeClaims,pe=se!==void 0&&se,Ee=E.stateStore,Me=Ee===void 0?new f.WebStorageStateStore:Ee,Ie=E.ResponseValidatorCtor,Ge=Ie===void 0?p.ResponseValidator:Ie,St=E.MetadataServiceCtor,Ct=St===void 0?h.MetadataService:St,Ht=E.extraQueryParams,me=Ht===void 0?{}:Ht,Ve=E.extraTokenParams,Re=Ve===void 0?{}:Ve;m(this,R),this._authority=A,this._metadataUrl=N,this._metadata=O,this._metadataSeed=S,this._signingKeys=L,this._client_id=D,this._client_secret=H,this._response_type=x,this._scope=le,this._redirect_uri=be,this._post_logout_redirect_uri=Se,this._client_authentication=Ne,this._prompt=Ke,this._display=Pe,this._max_age=Ae,this._ui_locales=Le,this._acr_values=at,this._resource=Be,this._response_mode=bt,this._filterProtocolClaims=!!Bt,this._loadUserInfo=!!rt,this._staleStateAge=He,this._clockSkew=b,this._clockService=Y,this._userInfoJwtIssuer=Z,this._mergeClaims=!!pe,this._stateStore=Me,this._validator=new Ge(this),this._metadataService=new Ct(this),this._extraQueryParams=(me===void 0?"undefined":a(me))==="object"?me:{},this._extraTokenParams=(Re===void 0?"undefined":a(Re))==="object"?Re:{}}return R.prototype.getEpochTime=function(){return this._clockService.getEpochTime()},c(R,[{key:"client_id",get:function(){return this._client_id},set:function(A){if(this._client_id)throw d.Log.error("OidcClientSettings.set_client_id: client_id has already been assigned."),new Error("client_id has already been assigned.");this._client_id=A}},{key:"client_secret",get:function(){return this._client_secret}},{key:"response_type",get:function(){return this._response_type}},{key:"scope",get:function(){return this._scope}},{key:"redirect_uri",get:function(){return this._redirect_uri}},{key:"post_logout_redirect_uri",get:function(){return this._post_logout_redirect_uri}},{key:"client_authentication",get:function(){return this._client_authentication}},{key:"prompt",get:function(){return this._prompt}},{key:"display",get:function(){return this._display}},{key:"max_age",get:function(){return this._max_age}},{key:"ui_locales",get:function(){return this._ui_locales}},{key:"acr_values",get:function(){return this._acr_values}},{key:"resource",get:function(){return this._resource}},{key:"response_mode",get:function(){return this._response_mode}},{key:"authority",get:function(){return this._authority},set:function(A){if(this._authority)throw d.Log.error("OidcClientSettings.set_authority: authority has already been assigned."),new Error("authority has already been assigned.");this._authority=A}},{key:"metadataUrl",get:function(){return this._metadataUrl||(this._metadataUrl=this.authority,this._metadataUrl&&this._metadataUrl.indexOf(_)<0&&(this._metadataUrl[this._metadataUrl.length-1]!=="/"&&(this._metadataUrl+="/"),this._metadataUrl+=_)),this._metadataUrl}},{key:"metadata",get:function(){return this._metadata},set:function(A){this._metadata=A}},{key:"metadataSeed",get:function(){return this._metadataSeed},set:function(A){this._metadataSeed=A}},{key:"signingKeys",get:function(){return this._signingKeys},set:function(A){this._signingKeys=A}},{key:"filterProtocolClaims",get:function(){return this._filterProtocolClaims}},{key:"loadUserInfo",get:function(){return this._loadUserInfo}},{key:"staleStateAge",get:function(){return this._staleStateAge}},{key:"clockSkew",get:function(){return this._clockSkew}},{key:"userInfoJwtIssuer",get:function(){return this._userInfoJwtIssuer}},{key:"mergeClaims",get:function(){return this._mergeClaims}},{key:"stateStore",get:function(){return this._stateStore}},{key:"validator",get:function(){return this._validator}},{key:"metadataService",get:function(){return this._metadataService}},{key:"extraQueryParams",get:function(){return this._extraQueryParams},set:function(A){(A===void 0?"undefined":a(A))==="object"?this._extraQueryParams=A:this._extraQueryParams={}}},{key:"extraTokenParams",get:function(){return this._extraTokenParams},set:function(A){(A===void 0?"undefined":a(A))==="object"?this._extraTokenParams=A:this._extraTokenParams={}}}]),R}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.WebStorageStateStore=void 0;var a=s(0),c=s(1);function d(g,f){if(!(g instanceof f))throw new TypeError("Cannot call a class as a function")}r.WebStorageStateStore=function(){function g(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p=f.prefix,h=p===void 0?"oidc.":p,m=f.store,_=m===void 0?c.Global.localStorage:m;d(this,g),this._store=_,this._prefix=h}return g.prototype.set=function(p,h){return a.Log.debug("WebStorageStateStore.set",p),p=this._prefix+p,this._store.setItem(p,h),Promise.resolve()},g.prototype.get=function(p){a.Log.debug("WebStorageStateStore.get",p),p=this._prefix+p;var h=this._store.getItem(p);return Promise.resolve(h)},g.prototype.remove=function(p){a.Log.debug("WebStorageStateStore.remove",p),p=this._prefix+p;var h=this._store.getItem(p);return this._store.removeItem(p),Promise.resolve(h)},g.prototype.getAllKeys=function(){a.Log.debug("WebStorageStateStore.getAllKeys");for(var p=[],h=0;h<this._store.length;h++){var m=this._store.key(h);m.indexOf(this._prefix)===0&&p.push(m.substr(this._prefix.length))}return Promise.resolve(p)},g}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.JsonService=void 0;var a=s(0),c=s(1);function d(g,f){if(!(g instanceof f))throw new TypeError("Cannot call a class as a function")}r.JsonService=function(){function g(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c.Global.XMLHttpRequest,h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;d(this,g),f&&Array.isArray(f)?this._contentTypes=f.slice():this._contentTypes=[],this._contentTypes.push("application/json"),h&&this._contentTypes.push("application/jwt"),this._XMLHttpRequest=p,this._jwtHandler=h}return g.prototype.getJson=function(p,h){var m=this;if(!p)throw a.Log.error("JsonService.getJson: No url passed"),new Error("url");return a.Log.debug("JsonService.getJson, url: ",p),new Promise(function(_,w){var P=new m._XMLHttpRequest;P.open("GET",p);var I=m._contentTypes,R=m._jwtHandler;P.onload=function(){if(a.Log.debug("JsonService.getJson: HTTP response received, status",P.status),P.status===200){var E=P.getResponseHeader("Content-Type");if(E){var A=I.find(function(N){if(E.startsWith(N))return!0});if(A=="application/jwt")return void R(P).then(_,w);if(A)try{return void _(JSON.parse(P.responseText))}catch(N){return a.Log.error("JsonService.getJson: Error parsing JSON response",N.message),void w(N)}}w(Error("Invalid response Content-Type: "+E+", from URL: "+p))}else w(Error(P.statusText+" ("+P.status+")"))},P.onerror=function(){a.Log.error("JsonService.getJson: network error"),w(Error("Network Error"))},h&&(a.Log.debug("JsonService.getJson: token passed, setting Authorization header"),P.setRequestHeader("Authorization","Bearer "+h)),P.send()})},g.prototype.postForm=function(p,h,m){var _=this;if(!p)throw a.Log.error("JsonService.postForm: No url passed"),new Error("url");return a.Log.debug("JsonService.postForm, url: ",p),new Promise(function(w,P){var I=new _._XMLHttpRequest;I.open("POST",p);var R=_._contentTypes;I.onload=function(){if(a.Log.debug("JsonService.postForm: HTTP response received, status",I.status),I.status!==200){if(I.status===400&&(L=I.getResponseHeader("Content-Type"))&&R.find(function(S){if(L.startsWith(S))return!0}))try{var O=JSON.parse(I.responseText);if(O&&O.error)return a.Log.error("JsonService.postForm: Error from server: ",O.error),void P(new Error(O.error))}catch(S){return a.Log.error("JsonService.postForm: Error parsing JSON response",S.message),void P(S)}P(Error(I.statusText+" ("+I.status+")"))}else{var L;if((L=I.getResponseHeader("Content-Type"))&&R.find(function(S){if(L.startsWith(S))return!0}))try{return void w(JSON.parse(I.responseText))}catch(S){return a.Log.error("JsonService.postForm: Error parsing JSON response",S.message),void P(S)}P(Error("Invalid response Content-Type: "+L+", from URL: "+p))}},I.onerror=function(){a.Log.error("JsonService.postForm: network error"),P(Error("Network Error"))};var E="";for(var A in h){var N=h[A];N&&(E.length>0&&(E+="&"),E+=encodeURIComponent(A),E+="=",E+=encodeURIComponent(N))}I.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),m!==void 0&&I.setRequestHeader("Authorization","Basic "+btoa(m)),I.send(E)})},g}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.SigninRequest=void 0;var a=s(0),c=s(3),d=s(13);r.SigninRequest=function(){function g(f){var p=f.url,h=f.client_id,m=f.redirect_uri,_=f.response_type,w=f.scope,P=f.authority,I=f.data,R=f.prompt,E=f.display,A=f.max_age,N=f.ui_locales,O=f.id_token_hint,L=f.login_hint,S=f.acr_values,D=f.resource,H=f.response_mode,Q=f.request,x=f.request_uri,ue=f.extraQueryParams,le=f.request_type,be=f.client_secret,Se=f.extraTokenParams,Te=f.skipUserInfo;if(function(Be,bt){if(!(Be instanceof bt))throw new TypeError("Cannot call a class as a function")}(this,g),!p)throw a.Log.error("SigninRequest.ctor: No url passed"),new Error("url");if(!h)throw a.Log.error("SigninRequest.ctor: No client_id passed"),new Error("client_id");if(!m)throw a.Log.error("SigninRequest.ctor: No redirect_uri passed"),new Error("redirect_uri");if(!_)throw a.Log.error("SigninRequest.ctor: No response_type passed"),new Error("response_type");if(!w)throw a.Log.error("SigninRequest.ctor: No scope passed"),new Error("scope");if(!P)throw a.Log.error("SigninRequest.ctor: No authority passed"),new Error("authority");var Ne=g.isOidc(_),Ke=g.isCode(_);H||(H=g.isCode(_)?"query":null),this.state=new d.SigninState({nonce:Ne,data:I,client_id:h,authority:P,redirect_uri:m,code_verifier:Ke,request_type:le,response_mode:H,client_secret:be,scope:w,extraTokenParams:Se,skipUserInfo:Te}),p=c.UrlUtility.addQueryParam(p,"client_id",h),p=c.UrlUtility.addQueryParam(p,"redirect_uri",m),p=c.UrlUtility.addQueryParam(p,"response_type",_),p=c.UrlUtility.addQueryParam(p,"scope",w),p=c.UrlUtility.addQueryParam(p,"state",this.state.id),Ne&&(p=c.UrlUtility.addQueryParam(p,"nonce",this.state.nonce)),Ke&&(p=c.UrlUtility.addQueryParam(p,"code_challenge",this.state.code_challenge),p=c.UrlUtility.addQueryParam(p,"code_challenge_method","S256"));var Pe={prompt:R,display:E,max_age:A,ui_locales:N,id_token_hint:O,login_hint:L,acr_values:S,resource:D,request:Q,request_uri:x,response_mode:H};for(var Ae in Pe)Pe[Ae]&&(p=c.UrlUtility.addQueryParam(p,Ae,Pe[Ae]));for(var Le in ue)p=c.UrlUtility.addQueryParam(p,Le,ue[Le]);this.url=p}return g.isOidc=function(p){return!!p.split(/\s+/g).filter(function(h){return h==="id_token"})[0]},g.isOAuth=function(p){return!!p.split(/\s+/g).filter(function(h){return h==="token"})[0]},g.isCode=function(p){return!!p.split(/\s+/g).filter(function(h){return h==="code"})[0]},g}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.State=void 0;var a=function(){function f(p,h){for(var m=0;m<h.length;m++){var _=h[m];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(p,_.key,_)}}return function(p,h,m){return h&&f(p.prototype,h),m&&f(p,m),p}}(),c=s(0),d=function(p){return p&&p.__esModule?p:{default:p}}(s(14));function g(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")}r.State=function(){function f(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=p.id,m=p.data,_=p.created,w=p.request_type;g(this,f),this._id=h||(0,d.default)(),this._data=m,this._created=typeof _=="number"&&_>0?_:parseInt(Date.now()/1e3),this._request_type=w}return f.prototype.toStorageString=function(){return c.Log.debug("State.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})},f.fromStorageString=function(h){return c.Log.debug("State.fromStorageString"),new f(JSON.parse(h))},f.clearStaleState=function(h,m){var _=Date.now()/1e3-m;return h.getAllKeys().then(function(w){c.Log.debug("State.clearStaleState: got keys",w);for(var P=[],I=function(N){var O=w[N];E=h.get(O).then(function(L){var S=!1;if(L)try{var D=f.fromStorageString(L);c.Log.debug("State.clearStaleState: got item from key: ",O,D.created),D.created<=_&&(S=!0)}catch(H){c.Log.error("State.clearStaleState: Error parsing state for key",O,H.message),S=!0}else c.Log.debug("State.clearStaleState: no item in storage for key: ",O),S=!0;if(S)return c.Log.debug("State.clearStaleState: removed item for key: ",O),h.remove(O)}),P.push(E)},R=0;R<w.length;R++){var E;I(R)}return c.Log.debug("State.clearStaleState: waiting on promise count:",P.length),Promise.all(P)})},a(f,[{key:"id",get:function(){return this._id}},{key:"data",get:function(){return this._data}},{key:"created",get:function(){return this._created}},{key:"request_type",get:function(){return this._request_type}}]),f}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.OidcClient=void 0;var a=function(){function I(R,E){for(var A=0;A<E.length;A++){var N=E[A];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(R,N.key,N)}}return function(R,E,A){return E&&I(R.prototype,E),A&&I(R,A),R}}(),c=s(0),d=s(5),g=s(12),f=s(8),p=s(34),h=s(35),m=s(36),_=s(13),w=s(9);function P(I,R){if(!(I instanceof R))throw new TypeError("Cannot call a class as a function")}r.OidcClient=function(){function I(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};P(this,I),R instanceof d.OidcClientSettings?this._settings=R:this._settings=new d.OidcClientSettings(R)}return I.prototype.createSigninRequest=function(){var E=this,A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},N=A.response_type,O=A.scope,L=A.redirect_uri,S=A.data,D=A.state,H=A.prompt,Q=A.display,x=A.max_age,ue=A.ui_locales,le=A.id_token_hint,be=A.login_hint,Se=A.acr_values,Te=A.resource,Ne=A.request,Ke=A.request_uri,Pe=A.response_mode,Ae=A.extraQueryParams,Le=A.extraTokenParams,at=A.request_type,Be=A.skipUserInfo,bt=arguments[1];c.Log.debug("OidcClient.createSigninRequest");var Ft=this._settings.client_id;N=N||this._settings.response_type,O=O||this._settings.scope,L=L||this._settings.redirect_uri,H=H||this._settings.prompt,Q=Q||this._settings.display,x=x||this._settings.max_age,ue=ue||this._settings.ui_locales,Se=Se||this._settings.acr_values,Te=Te||this._settings.resource,Pe=Pe||this._settings.response_mode,Ae=Ae||this._settings.extraQueryParams,Le=Le||this._settings.extraTokenParams;var Bt=this._settings.authority;return f.SigninRequest.isCode(N)&&N!=="code"?Promise.reject(new Error("OpenID Connect hybrid flow is not supported")):this._metadataService.getAuthorizationEndpoint().then(function(At){c.Log.debug("OidcClient.createSigninRequest: Received authorization endpoint",At);var rt=new f.SigninRequest({url:At,client_id:Ft,redirect_uri:L,response_type:N,scope:O,data:S||D,authority:Bt,prompt:H,display:Q,max_age:x,ui_locales:ue,id_token_hint:le,login_hint:be,acr_values:Se,resource:Te,request:Ne,request_uri:Ke,extraQueryParams:Ae,extraTokenParams:Le,request_type:at,response_mode:Pe,client_secret:E._settings.client_secret,skipUserInfo:Be}),De=rt.state;return(bt=bt||E._stateStore).set(De.id,De.toStorageString()).then(function(){return rt})})},I.prototype.readSigninResponseState=function(E,A){var N=arguments.length>2&&arguments[2]!==void 0&&arguments[2];c.Log.debug("OidcClient.readSigninResponseState");var O=this._settings.response_mode==="query"||!this._settings.response_mode&&f.SigninRequest.isCode(this._settings.response_type),L=O?"?":"#",S=new p.SigninResponse(E,L);if(!S.state)return c.Log.error("OidcClient.readSigninResponseState: No state in response"),Promise.reject(new Error("No state in response"));A=A||this._stateStore;var D=N?A.remove.bind(A):A.get.bind(A);return D(S.state).then(function(H){if(!H)throw c.Log.error("OidcClient.readSigninResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:_.SigninState.fromStorageString(H),response:S}})},I.prototype.processSigninResponse=function(E,A){var N=this;return c.Log.debug("OidcClient.processSigninResponse"),this.readSigninResponseState(E,A,!0).then(function(O){var L=O.state,S=O.response;return c.Log.debug("OidcClient.processSigninResponse: Received state from storage; validating response"),N._validator.validateSigninResponse(L,S)})},I.prototype.createSignoutRequest=function(){var E=this,A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},N=A.id_token_hint,O=A.data,L=A.state,S=A.post_logout_redirect_uri,D=A.extraQueryParams,H=A.request_type,Q=arguments[1];return c.Log.debug("OidcClient.createSignoutRequest"),S=S||this._settings.post_logout_redirect_uri,D=D||this._settings.extraQueryParams,this._metadataService.getEndSessionEndpoint().then(function(x){if(!x)throw c.Log.error("OidcClient.createSignoutRequest: No end session endpoint url returned"),new Error("no end session endpoint");c.Log.debug("OidcClient.createSignoutRequest: Received end session endpoint",x);var ue=new h.SignoutRequest({url:x,id_token_hint:N,post_logout_redirect_uri:S,data:O||L,extraQueryParams:D,request_type:H}),le=ue.state;return le&&(c.Log.debug("OidcClient.createSignoutRequest: Signout request has state to persist"),(Q=Q||E._stateStore).set(le.id,le.toStorageString())),ue})},I.prototype.readSignoutResponseState=function(E,A){var N=arguments.length>2&&arguments[2]!==void 0&&arguments[2];c.Log.debug("OidcClient.readSignoutResponseState");var O=new m.SignoutResponse(E);if(!O.state)return c.Log.debug("OidcClient.readSignoutResponseState: No state in response"),O.error?(c.Log.warn("OidcClient.readSignoutResponseState: Response was error: ",O.error),Promise.reject(new g.ErrorResponse(O))):Promise.resolve({state:void 0,response:O});var L=O.state;A=A||this._stateStore;var S=N?A.remove.bind(A):A.get.bind(A);return S(L).then(function(D){if(!D)throw c.Log.error("OidcClient.readSignoutResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:w.State.fromStorageString(D),response:O}})},I.prototype.processSignoutResponse=function(E,A){var N=this;return c.Log.debug("OidcClient.processSignoutResponse"),this.readSignoutResponseState(E,A,!0).then(function(O){var L=O.state,S=O.response;return L?(c.Log.debug("OidcClient.processSignoutResponse: Received state from storage; validating response"),N._validator.validateSignoutResponse(L,S)):(c.Log.debug("OidcClient.processSignoutResponse: No state from storage; skipping validating response"),S)})},I.prototype.clearStaleState=function(E){return c.Log.debug("OidcClient.clearStaleState"),E=E||this._stateStore,w.State.clearStaleState(E,this.settings.staleStateAge)},a(I,[{key:"_stateStore",get:function(){return this.settings.stateStore}},{key:"_validator",get:function(){return this.settings.validator}},{key:"_metadataService",get:function(){return this.settings.metadataService}},{key:"settings",get:function(){return this._settings}},{key:"metadataService",get:function(){return this._metadataService}}]),I}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.TokenClient=void 0;var a=s(7),c=s(2),d=s(0);function g(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")}r.TokenClient=function(){function f(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:a.JsonService,m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:c.MetadataService;if(g(this,f),!p)throw d.Log.error("TokenClient.ctor: No settings passed"),new Error("settings");this._settings=p,this._jsonService=new h,this._metadataService=new m(this._settings)}return f.prototype.exchangeCode=function(){var h=this,m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(m=Object.assign({},m)).grant_type=m.grant_type||"authorization_code",m.client_id=m.client_id||this._settings.client_id,m.client_secret=m.client_secret||this._settings.client_secret,m.redirect_uri=m.redirect_uri||this._settings.redirect_uri;var _=void 0,w=m._client_authentication||this._settings._client_authentication;return delete m._client_authentication,m.code?m.redirect_uri?m.code_verifier?m.client_id?m.client_secret||w!="client_secret_basic"?(w=="client_secret_basic"&&(_=m.client_id+":"+m.client_secret,delete m.client_id,delete m.client_secret),this._metadataService.getTokenEndpoint(!1).then(function(P){return d.Log.debug("TokenClient.exchangeCode: Received token endpoint"),h._jsonService.postForm(P,m,_).then(function(I){return d.Log.debug("TokenClient.exchangeCode: response received"),I})})):(d.Log.error("TokenClient.exchangeCode: No client_secret passed"),Promise.reject(new Error("A client_secret is required"))):(d.Log.error("TokenClient.exchangeCode: No client_id passed"),Promise.reject(new Error("A client_id is required"))):(d.Log.error("TokenClient.exchangeCode: No code_verifier passed"),Promise.reject(new Error("A code_verifier is required"))):(d.Log.error("TokenClient.exchangeCode: No redirect_uri passed"),Promise.reject(new Error("A redirect_uri is required"))):(d.Log.error("TokenClient.exchangeCode: No code passed"),Promise.reject(new Error("A code is required")))},f.prototype.exchangeRefreshToken=function(){var h=this,m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(m=Object.assign({},m)).grant_type=m.grant_type||"refresh_token",m.client_id=m.client_id||this._settings.client_id,m.client_secret=m.client_secret||this._settings.client_secret;var _=void 0,w=m._client_authentication||this._settings._client_authentication;return delete m._client_authentication,m.refresh_token?m.client_id?(w=="client_secret_basic"&&(_=m.client_id+":"+m.client_secret,delete m.client_id,delete m.client_secret),this._metadataService.getTokenEndpoint(!1).then(function(P){return d.Log.debug("TokenClient.exchangeRefreshToken: Received token endpoint"),h._jsonService.postForm(P,m,_).then(function(I){return d.Log.debug("TokenClient.exchangeRefreshToken: response received"),I})})):(d.Log.error("TokenClient.exchangeRefreshToken: No client_id passed"),Promise.reject(new Error("A client_id is required"))):(d.Log.error("TokenClient.exchangeRefreshToken: No refresh_token passed"),Promise.reject(new Error("A refresh_token is required")))},f}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.ErrorResponse=void 0;var a=s(0);function c(g,f){if(!(g instanceof f))throw new TypeError("Cannot call a class as a function")}function d(g,f){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!f||typeof f!="object"&&typeof f!="function"?g:f}r.ErrorResponse=function(g){function f(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=p.error,m=p.error_description,_=p.error_uri,w=p.state,P=p.session_state;if(c(this,f),!h)throw a.Log.error("No error passed to ErrorResponse"),new Error("error");var I=d(this,g.call(this,m||h));return I.name="ErrorResponse",I.error=h,I.error_description=m,I.error_uri=_,I.state=w,I.session_state=P,I}return function(h,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);h.prototype=Object.create(m&&m.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(h,m):h.__proto__=m)}(f,g),f}(Error)},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.SigninState=void 0;var a=function(){function m(_,w){for(var P=0;P<w.length;P++){var I=w[P];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(_,I.key,I)}}return function(_,w,P){return w&&m(_.prototype,w),P&&m(_,P),_}}(),c=s(0),d=s(9),g=s(4),f=function(_){return _&&_.__esModule?_:{default:_}}(s(14));function p(m,_){if(!(m instanceof _))throw new TypeError("Cannot call a class as a function")}function h(m,_){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!_||typeof _!="object"&&typeof _!="function"?m:_}r.SigninState=function(m){function _(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},P=w.nonce,I=w.authority,R=w.client_id,E=w.redirect_uri,A=w.code_verifier,N=w.response_mode,O=w.client_secret,L=w.scope,S=w.extraTokenParams,D=w.skipUserInfo;p(this,_);var H=h(this,m.call(this,arguments[0]));if(P===!0?H._nonce=(0,f.default)():P&&(H._nonce=P),A===!0?H._code_verifier=(0,f.default)()+(0,f.default)()+(0,f.default)():A&&(H._code_verifier=A),H.code_verifier){var Q=g.JoseUtil.hashString(H.code_verifier,"SHA256");H._code_challenge=g.JoseUtil.hexToBase64Url(Q)}return H._redirect_uri=E,H._authority=I,H._client_id=R,H._response_mode=N,H._client_secret=O,H._scope=L,H._extraTokenParams=S,H._skipUserInfo=D,H}return function(P,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);P.prototype=Object.create(I&&I.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(P,I):P.__proto__=I)}(_,m),_.prototype.toStorageString=function(){return c.Log.debug("SigninState.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,nonce:this.nonce,code_verifier:this.code_verifier,redirect_uri:this.redirect_uri,authority:this.authority,client_id:this.client_id,response_mode:this.response_mode,client_secret:this.client_secret,scope:this.scope,extraTokenParams:this.extraTokenParams,skipUserInfo:this.skipUserInfo})},_.fromStorageString=function(P){return c.Log.debug("SigninState.fromStorageString"),new _(JSON.parse(P))},a(_,[{key:"nonce",get:function(){return this._nonce}},{key:"authority",get:function(){return this._authority}},{key:"client_id",get:function(){return this._client_id}},{key:"redirect_uri",get:function(){return this._redirect_uri}},{key:"code_verifier",get:function(){return this._code_verifier}},{key:"code_challenge",get:function(){return this._code_challenge}},{key:"response_mode",get:function(){return this._response_mode}},{key:"client_secret",get:function(){return this._client_secret}},{key:"scope",get:function(){return this._scope}},{key:"extraTokenParams",get:function(){return this._extraTokenParams}},{key:"skipUserInfo",get:function(){return this._skipUserInfo}}]),_}(d.State)},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){return(a!="undefined"&&a!==null&&a.getRandomValues!==void 0?c:d)().replace(/-/g,"")};var a=typeof window<"u"?window.crypto||window.msCrypto:null;function c(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(g){return(g^a.getRandomValues(new Uint8Array(1))[0]&15>>g/4).toString(16)})}function d(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(g){return(g^16*Math.random()>>g/4).toString(16)})}n.exports=r.default},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.User=void 0;var a=function(){function d(g,f){for(var p=0;p<f.length;p++){var h=f[p];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(g,h.key,h)}}return function(g,f,p){return f&&d(g.prototype,f),p&&d(g,p),g}}(),c=s(0);r.User=function(){function d(g){var f=g.id_token,p=g.session_state,h=g.access_token,m=g.refresh_token,_=g.token_type,w=g.scope,P=g.profile,I=g.expires_at,R=g.state;(function(A,N){if(!(A instanceof N))throw new TypeError("Cannot call a class as a function")})(this,d),this.id_token=f,this.session_state=p,this.access_token=h,this.refresh_token=m,this.token_type=_,this.scope=w,this.profile=P,this.expires_at=I,this.state=R}return d.prototype.toStorageString=function(){return c.Log.debug("User.toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})},d.fromStorageString=function(f){return c.Log.debug("User.fromStorageString"),new d(JSON.parse(f))},a(d,[{key:"expires_in",get:function(){if(this.expires_at){var f=parseInt(Date.now()/1e3);return this.expires_at-f}},set:function(f){var p=parseInt(f);if(typeof p=="number"&&p>0){var h=parseInt(Date.now()/1e3);this.expires_at=h+p}}},{key:"expired",get:function(){var f=this.expires_in;if(f!==void 0)return f<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}}]),d}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.AccessTokenEvents=void 0;var a=s(0),c=s(46);function d(g,f){if(!(g instanceof f))throw new TypeError("Cannot call a class as a function")}r.AccessTokenEvents=function(){function g(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p=f.accessTokenExpiringNotificationTime,h=p===void 0?60:p,m=f.accessTokenExpiringTimer,_=m===void 0?new c.Timer("Access token expiring"):m,w=f.accessTokenExpiredTimer,P=w===void 0?new c.Timer("Access token expired"):w;d(this,g),this._accessTokenExpiringNotificationTime=h,this._accessTokenExpiring=_,this._accessTokenExpired=P}return g.prototype.load=function(p){if(p.access_token&&p.expires_in!==void 0){var h=p.expires_in;if(a.Log.debug("AccessTokenEvents.load: access token present, remaining duration:",h),h>0){var m=h-this._accessTokenExpiringNotificationTime;m<=0&&(m=1),a.Log.debug("AccessTokenEvents.load: registering expiring timer in:",m),this._accessTokenExpiring.init(m)}else a.Log.debug("AccessTokenEvents.load: canceling existing expiring timer becase we're past expiration."),this._accessTokenExpiring.cancel();var _=h+1;a.Log.debug("AccessTokenEvents.load: registering expired timer in:",_),this._accessTokenExpired.init(_)}else this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},g.prototype.unload=function(){a.Log.debug("AccessTokenEvents.unload: canceling existing access token timers"),this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},g.prototype.addAccessTokenExpiring=function(p){this._accessTokenExpiring.addHandler(p)},g.prototype.removeAccessTokenExpiring=function(p){this._accessTokenExpiring.removeHandler(p)},g.prototype.addAccessTokenExpired=function(p){this._accessTokenExpired.addHandler(p)},g.prototype.removeAccessTokenExpired=function(p){this._accessTokenExpired.removeHandler(p)},g}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.Event=void 0;var a=s(0);r.Event=function(){function c(d){(function(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")})(this,c),this._name=d,this._callbacks=[]}return c.prototype.addHandler=function(g){this._callbacks.push(g)},c.prototype.removeHandler=function(g){var f=this._callbacks.findIndex(function(p){return p===g});f>=0&&this._callbacks.splice(f,1)},c.prototype.raise=function(){a.Log.debug("Event: Raising event: "+this._name);for(var g=0;g<this._callbacks.length;g++){var f;(f=this._callbacks)[g].apply(f,arguments)}},c}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.SessionMonitor=void 0;var a=function(){function p(h,m){for(var _=0;_<m.length;_++){var w=m[_];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(h,w.key,w)}}return function(h,m,_){return m&&p(h.prototype,m),_&&p(h,_),h}}(),c=s(0),d=s(19),g=s(1);function f(p,h){if(!(p instanceof h))throw new TypeError("Cannot call a class as a function")}r.SessionMonitor=function(){function p(h){var m=this,_=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.CheckSessionIFrame,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:g.Global.timer;if(f(this,p),!h)throw c.Log.error("SessionMonitor.ctor: No user manager passed to SessionMonitor"),new Error("userManager");this._userManager=h,this._CheckSessionIFrameCtor=_,this._timer=w,this._userManager.events.addUserLoaded(this._start.bind(this)),this._userManager.events.addUserUnloaded(this._stop.bind(this)),Promise.resolve(this._userManager.getUser().then(function(P){P?m._start(P):m._settings.monitorAnonymousSession&&m._userManager.querySessionStatus().then(function(I){var R={session_state:I.session_state};I.sub&&I.sid&&(R.profile={sub:I.sub,sid:I.sid}),m._start(R)}).catch(function(I){c.Log.error("SessionMonitor ctor: error from querySessionStatus:",I.message)})}).catch(function(P){c.Log.error("SessionMonitor ctor: error from getUser:",P.message)}))}return p.prototype._start=function(m){var _=this,w=m.session_state;w&&(m.profile?(this._sub=m.profile.sub,this._sid=m.profile.sid,c.Log.debug("SessionMonitor._start: session_state:",w,", sub:",this._sub)):(this._sub=void 0,this._sid=void 0,c.Log.debug("SessionMonitor._start: session_state:",w,", anonymous user")),this._checkSessionIFrame?this._checkSessionIFrame.start(w):this._metadataService.getCheckSessionIframe().then(function(P){if(P){c.Log.debug("SessionMonitor._start: Initializing check session iframe");var I=_._client_id,R=_._checkSessionInterval,E=_._stopCheckSessionOnError;_._checkSessionIFrame=new _._CheckSessionIFrameCtor(_._callback.bind(_),I,P,R,E),_._checkSessionIFrame.load().then(function(){_._checkSessionIFrame.start(w)})}else c.Log.warn("SessionMonitor._start: No check session iframe found in the metadata")}).catch(function(P){c.Log.error("SessionMonitor._start: Error from getCheckSessionIframe:",P.message)}))},p.prototype._stop=function(){var m=this;if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&(c.Log.debug("SessionMonitor._stop"),this._checkSessionIFrame.stop()),this._settings.monitorAnonymousSession)var _=this._timer.setInterval(function(){m._timer.clearInterval(_),m._userManager.querySessionStatus().then(function(w){var P={session_state:w.session_state};w.sub&&w.sid&&(P.profile={sub:w.sub,sid:w.sid}),m._start(P)}).catch(function(w){c.Log.error("SessionMonitor: error from querySessionStatus:",w.message)})},1e3)},p.prototype._callback=function(){var m=this;this._userManager.querySessionStatus().then(function(_){var w=!0;_?_.sub===m._sub?(w=!1,m._checkSessionIFrame.start(_.session_state),_.sid===m._sid?c.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:",_.session_state):(c.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:",_.session_state),m._userManager.events._raiseUserSessionChanged())):c.Log.debug("SessionMonitor._callback: Different subject signed into OP:",_.sub):c.Log.debug("SessionMonitor._callback: Subject no longer signed into OP"),w&&(m._sub?(c.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed out event"),m._userManager.events._raiseUserSignedOut()):(c.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed in event"),m._userManager.events._raiseUserSignedIn()))}).catch(function(_){m._sub&&(c.Log.debug("SessionMonitor._callback: Error calling queryCurrentSigninSession; raising signed out event",_.message),m._userManager.events._raiseUserSignedOut())})},a(p,[{key:"_settings",get:function(){return this._userManager.settings}},{key:"_metadataService",get:function(){return this._userManager.metadataService}},{key:"_client_id",get:function(){return this._settings.client_id}},{key:"_checkSessionInterval",get:function(){return this._settings.checkSessionInterval}},{key:"_stopCheckSessionOnError",get:function(){return this._settings.stopCheckSessionOnError}}]),p}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.CheckSessionIFrame=void 0;var a=s(0);function c(d,g){if(!(d instanceof g))throw new TypeError("Cannot call a class as a function")}r.CheckSessionIFrame=function(){function d(g,f,p,h){var m=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4];c(this,d),this._callback=g,this._client_id=f,this._url=p,this._interval=h||2e3,this._stopOnError=m;var _=p.indexOf("/",p.indexOf("//")+2);this._frame_origin=p.substr(0,_),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.style.display="none",this._frame.width=0,this._frame.height=0,this._frame.src=p}return d.prototype.load=function(){var f=this;return new Promise(function(p){f._frame.onload=function(){p()},window.document.body.appendChild(f._frame),f._boundMessageEvent=f._message.bind(f),window.addEventListener("message",f._boundMessageEvent,!1)})},d.prototype._message=function(f){f.origin===this._frame_origin&&f.source===this._frame.contentWindow&&(f.data==="error"?(a.Log.error("CheckSessionIFrame: error message from check session op iframe"),this._stopOnError&&this.stop()):f.data==="changed"?(a.Log.debug("CheckSessionIFrame: changed message from check session op iframe"),this.stop(),this._callback()):a.Log.debug("CheckSessionIFrame: "+f.data+" message from check session op iframe"))},d.prototype.start=function(f){var p=this;if(this._session_state!==f){a.Log.debug("CheckSessionIFrame.start"),this.stop(),this._session_state=f;var h=function(){p._frame.contentWindow.postMessage(p._client_id+" "+p._session_state,p._frame_origin)};h(),this._timer=window.setInterval(h,this._interval)}},d.prototype.stop=function(){this._session_state=null,this._timer&&(a.Log.debug("CheckSessionIFrame.stop"),window.clearInterval(this._timer),this._timer=null)},d}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.TokenRevocationClient=void 0;var a=s(0),c=s(2),d=s(1);function g(h,m){if(!(h instanceof m))throw new TypeError("Cannot call a class as a function")}var f="access_token",p="refresh_token";r.TokenRevocationClient=function(){function h(m){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.Global.XMLHttpRequest,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:c.MetadataService;if(g(this,h),!m)throw a.Log.error("TokenRevocationClient.ctor: No settings provided"),new Error("No settings provided.");this._settings=m,this._XMLHttpRequestCtor=_,this._metadataService=new w(this._settings)}return h.prototype.revoke=function(_,w){var P=this,I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"access_token";if(!_)throw a.Log.error("TokenRevocationClient.revoke: No token provided"),new Error("No token provided.");if(I!==f&&I!=p)throw a.Log.error("TokenRevocationClient.revoke: Invalid token type"),new Error("Invalid token type.");return this._metadataService.getRevocationEndpoint().then(function(R){if(R){a.Log.debug("TokenRevocationClient.revoke: Revoking "+I);var E=P._settings.client_id,A=P._settings.client_secret;return P._revoke(R,E,A,_,I)}if(w)throw a.Log.error("TokenRevocationClient.revoke: Revocation not supported"),new Error("Revocation not supported")})},h.prototype._revoke=function(_,w,P,I,R){var E=this;return new Promise(function(A,N){var O=new E._XMLHttpRequestCtor;O.open("POST",_),O.onload=function(){a.Log.debug("TokenRevocationClient.revoke: HTTP response received, status",O.status),O.status===200?A():N(Error(O.statusText+" ("+O.status+")"))},O.onerror=function(){a.Log.debug("TokenRevocationClient.revoke: Network Error."),N("Network Error")};var L="client_id="+encodeURIComponent(w);P&&(L+="&client_secret="+encodeURIComponent(P)),L+="&token_type_hint="+encodeURIComponent(R),L+="&token="+encodeURIComponent(I),O.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),O.send(L)})},h}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.CordovaPopupWindow=void 0;var a=function(){function d(g,f){for(var p=0;p<f.length;p++){var h=f[p];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(g,h.key,h)}}return function(g,f,p){return f&&d(g.prototype,f),p&&d(g,p),g}}(),c=s(0);r.CordovaPopupWindow=function(){function d(g){var f=this;(function(h,m){if(!(h instanceof m))throw new TypeError("Cannot call a class as a function")})(this,d),this._promise=new Promise(function(p,h){f._resolve=p,f._reject=h}),this.features=g.popupWindowFeatures||"location=no,toolbar=no,zoom=no",this.target=g.popupWindowTarget||"_blank",this.redirect_uri=g.startUrl,c.Log.debug("CordovaPopupWindow.ctor: redirect_uri: "+this.redirect_uri)}return d.prototype._isInAppBrowserInstalled=function(f){return["cordova-plugin-inappbrowser","cordova-plugin-inappbrowser.inappbrowser","org.apache.cordova.inappbrowser"].some(function(p){return f.hasOwnProperty(p)})},d.prototype.navigate=function(f){if(f&&f.url){if(!window.cordova)return this._error("cordova is undefined");var p=window.cordova.require("cordova/plugin_list").metadata;if(this._isInAppBrowserInstalled(p)===!1)return this._error("InAppBrowser plugin not found");this._popup=cordova.InAppBrowser.open(f.url,this.target,this.features),this._popup?(c.Log.debug("CordovaPopupWindow.navigate: popup successfully created"),this._exitCallbackEvent=this._exitCallback.bind(this),this._loadStartCallbackEvent=this._loadStartCallback.bind(this),this._popup.addEventListener("exit",this._exitCallbackEvent,!1),this._popup.addEventListener("loadstart",this._loadStartCallbackEvent,!1)):this._error("Error opening popup window")}else this._error("No url provided");return this.promise},d.prototype._loadStartCallback=function(f){f.url.indexOf(this.redirect_uri)===0&&this._success({url:f.url})},d.prototype._exitCallback=function(f){this._error(f)},d.prototype._success=function(f){this._cleanup(),c.Log.debug("CordovaPopupWindow: Successful response from cordova popup window"),this._resolve(f)},d.prototype._error=function(f){this._cleanup(),c.Log.error(f),this._reject(new Error(f))},d.prototype.close=function(){this._cleanup()},d.prototype._cleanup=function(){this._popup&&(c.Log.debug("CordovaPopupWindow: cleaning up popup"),this._popup.removeEventListener("exit",this._exitCallbackEvent,!1),this._popup.removeEventListener("loadstart",this._loadStartCallbackEvent,!1),this._popup.close()),this._popup=null},a(d,[{key:"promise",get:function(){return this._promise}}]),d}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=s(0),c=s(10),d=s(5),g=s(6),f=s(37),p=s(38),h=s(16),m=s(2),_=s(48),w=s(49),P=s(19),I=s(20),R=s(18),E=s(1),A=s(15),N=s(50);r.default={Version:N.Version,Log:a.Log,OidcClient:c.OidcClient,OidcClientSettings:d.OidcClientSettings,WebStorageStateStore:g.WebStorageStateStore,InMemoryWebStorage:f.InMemoryWebStorage,UserManager:p.UserManager,AccessTokenEvents:h.AccessTokenEvents,MetadataService:m.MetadataService,CordovaPopupNavigator:_.CordovaPopupNavigator,CordovaIFrameNavigator:w.CordovaIFrameNavigator,CheckSessionIFrame:P.CheckSessionIFrame,TokenRevocationClient:I.TokenRevocationClient,SessionMonitor:R.SessionMonitor,Global:E.Global,User:A.User},n.exports=r.default},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.ClockService=function(){function a(){(function(d,g){if(!(d instanceof g))throw new TypeError("Cannot call a class as a function")})(this,a)}return a.prototype.getEpochTime=function(){return Promise.resolve(Date.now()/1e3|0)},a}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.ResponseValidator=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},c=s(0),d=s(2),g=s(25),f=s(11),p=s(12),h=s(4);function m(w,P){if(!(w instanceof P))throw new TypeError("Cannot call a class as a function")}var _=["nonce","at_hash","iat","nbf","exp","aud","iss","c_hash"];r.ResponseValidator=function(){function w(P){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.MetadataService,R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:g.UserInfoService,E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:h.JoseUtil,A=arguments.length>4&&arguments[4]!==void 0?arguments[4]:f.TokenClient;if(m(this,w),!P)throw c.Log.error("ResponseValidator.ctor: No settings passed to ResponseValidator"),new Error("settings");this._settings=P,this._metadataService=new I(this._settings),this._userInfoService=new R(this._settings),this._joseUtil=E,this._tokenClient=new A(this._settings)}return w.prototype.validateSigninResponse=function(I,R){var E=this;return c.Log.debug("ResponseValidator.validateSigninResponse"),this._processSigninParams(I,R).then(function(A){return c.Log.debug("ResponseValidator.validateSigninResponse: state processed"),E._validateTokens(I,A).then(function(N){return c.Log.debug("ResponseValidator.validateSigninResponse: tokens validated"),E._processClaims(I,N).then(function(O){return c.Log.debug("ResponseValidator.validateSigninResponse: claims processed"),O})})})},w.prototype.validateSignoutResponse=function(I,R){return I.id!==R.state?(c.Log.error("ResponseValidator.validateSignoutResponse: State does not match"),Promise.reject(new Error("State does not match"))):(c.Log.debug("ResponseValidator.validateSignoutResponse: state validated"),R.state=I.data,R.error?(c.Log.warn("ResponseValidator.validateSignoutResponse: Response was error",R.error),Promise.reject(new p.ErrorResponse(R))):Promise.resolve(R))},w.prototype._processSigninParams=function(I,R){if(I.id!==R.state)return c.Log.error("ResponseValidator._processSigninParams: State does not match"),Promise.reject(new Error("State does not match"));if(!I.client_id)return c.Log.error("ResponseValidator._processSigninParams: No client_id on state"),Promise.reject(new Error("No client_id on state"));if(!I.authority)return c.Log.error("ResponseValidator._processSigninParams: No authority on state"),Promise.reject(new Error("No authority on state"));if(this._settings.authority){if(this._settings.authority&&this._settings.authority!==I.authority)return c.Log.error("ResponseValidator._processSigninParams: authority mismatch on settings vs. signin state"),Promise.reject(new Error("authority mismatch on settings vs. signin state"))}else this._settings.authority=I.authority;if(this._settings.client_id){if(this._settings.client_id&&this._settings.client_id!==I.client_id)return c.Log.error("ResponseValidator._processSigninParams: client_id mismatch on settings vs. signin state"),Promise.reject(new Error("client_id mismatch on settings vs. signin state"))}else this._settings.client_id=I.client_id;return c.Log.debug("ResponseValidator._processSigninParams: state validated"),R.state=I.data,R.error?(c.Log.warn("ResponseValidator._processSigninParams: Response was error",R.error),Promise.reject(new p.ErrorResponse(R))):I.nonce&&!R.id_token?(c.Log.error("ResponseValidator._processSigninParams: Expecting id_token in response"),Promise.reject(new Error("No id_token in response"))):!I.nonce&&R.id_token?(c.Log.error("ResponseValidator._processSigninParams: Not expecting id_token in response"),Promise.reject(new Error("Unexpected id_token in response"))):I.code_verifier&&!R.code?(c.Log.error("ResponseValidator._processSigninParams: Expecting code in response"),Promise.reject(new Error("No code in response"))):!I.code_verifier&&R.code?(c.Log.error("ResponseValidator._processSigninParams: Not expecting code in response"),Promise.reject(new Error("Unexpected code in response"))):(R.scope||(R.scope=I.scope),Promise.resolve(R))},w.prototype._processClaims=function(I,R){var E=this;if(R.isOpenIdConnect){if(c.Log.debug("ResponseValidator._processClaims: response is OIDC, processing claims"),R.profile=this._filterProtocolClaims(R.profile),I.skipUserInfo!==!0&&this._settings.loadUserInfo&&R.access_token)return c.Log.debug("ResponseValidator._processClaims: loading user info"),this._userInfoService.getClaims(R.access_token).then(function(A){return c.Log.debug("ResponseValidator._processClaims: user info claims received from user info endpoint"),A.sub!==R.profile.sub?(c.Log.error("ResponseValidator._processClaims: sub from user info endpoint does not match sub in id_token"),Promise.reject(new Error("sub from user info endpoint does not match sub in id_token"))):(R.profile=E._mergeClaims(R.profile,A),c.Log.debug("ResponseValidator._processClaims: user info claims received, updated profile:",R.profile),R)});c.Log.debug("ResponseValidator._processClaims: not loading user info")}else c.Log.debug("ResponseValidator._processClaims: response is not OIDC, not processing claims");return Promise.resolve(R)},w.prototype._mergeClaims=function(I,R){var E=Object.assign({},I);for(var A in R){var N=R[A];Array.isArray(N)||(N=[N]);for(var O=0;O<N.length;O++){var L=N[O];E[A]?Array.isArray(E[A])?E[A].indexOf(L)<0&&E[A].push(L):E[A]!==L&&((L===void 0?"undefined":a(L))==="object"&&this._settings.mergeClaims?E[A]=this._mergeClaims(E[A],L):E[A]=[E[A],L]):E[A]=L}}return E},w.prototype._filterProtocolClaims=function(I){c.Log.debug("ResponseValidator._filterProtocolClaims, incoming claims:",I);var R=Object.assign({},I);return this._settings._filterProtocolClaims?(_.forEach(function(E){delete R[E]}),c.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims filtered",R)):c.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims not filtered"),R},w.prototype._validateTokens=function(I,R){return R.code?(c.Log.debug("ResponseValidator._validateTokens: Validating code"),this._processCode(I,R)):R.id_token?R.access_token?(c.Log.debug("ResponseValidator._validateTokens: Validating id_token and access_token"),this._validateIdTokenAndAccessToken(I,R)):(c.Log.debug("ResponseValidator._validateTokens: Validating id_token"),this._validateIdToken(I,R)):(c.Log.debug("ResponseValidator._validateTokens: No code to process or id_token to validate"),Promise.resolve(R))},w.prototype._processCode=function(I,R){var E=this,A={client_id:I.client_id,client_secret:I.client_secret,code:R.code,redirect_uri:I.redirect_uri,code_verifier:I.code_verifier};return I.extraTokenParams&&a(I.extraTokenParams)==="object"&&Object.assign(A,I.extraTokenParams),this._tokenClient.exchangeCode(A).then(function(N){for(var O in N)R[O]=N[O];return R.id_token?(c.Log.debug("ResponseValidator._processCode: token response successful, processing id_token"),E._validateIdTokenAttributes(I,R)):(c.Log.debug("ResponseValidator._processCode: token response successful, returning response"),R)})},w.prototype._validateIdTokenAttributes=function(I,R){var E=this;return this._metadataService.getIssuer().then(function(A){var N=I.client_id,O=E._settings.clockSkew;return c.Log.debug("ResponseValidator._validateIdTokenAttributes: Validaing JWT attributes; using clock skew (in seconds) of: ",O),E._settings.getEpochTime().then(function(L){return E._joseUtil.validateJwtAttributes(R.id_token,A,N,O,L).then(function(S){return I.nonce&&I.nonce!==S.nonce?(c.Log.error("ResponseValidator._validateIdTokenAttributes: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"))):S.sub?(R.profile=S,R):(c.Log.error("ResponseValidator._validateIdTokenAttributes: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))})})})},w.prototype._validateIdTokenAndAccessToken=function(I,R){var E=this;return this._validateIdToken(I,R).then(function(A){return E._validateAccessToken(A)})},w.prototype._getSigningKeyForJwt=function(I){var R=this;return this._metadataService.getSigningKeys().then(function(E){var A=I.header.kid;if(!E)return c.Log.error("ResponseValidator._validateIdToken: No signing keys from metadata"),Promise.reject(new Error("No signing keys from metadata"));c.Log.debug("ResponseValidator._validateIdToken: Received signing keys");var N=void 0;if(A)N=E.filter(function(O){return O.kid===A})[0];else{if((E=R._filterByAlg(E,I.header.alg)).length>1)return c.Log.error("ResponseValidator._validateIdToken: No kid found in id_token and more than one key found in metadata"),Promise.reject(new Error("No kid found in id_token and more than one key found in metadata"));N=E[0]}return Promise.resolve(N)})},w.prototype._getSigningKeyForJwtWithSingleRetry=function(I){var R=this;return this._getSigningKeyForJwt(I).then(function(E){return E?Promise.resolve(E):(R._metadataService.resetSigningKeys(),R._getSigningKeyForJwt(I))})},w.prototype._validateIdToken=function(I,R){var E=this;if(!I.nonce)return c.Log.error("ResponseValidator._validateIdToken: No nonce on state"),Promise.reject(new Error("No nonce on state"));var A=this._joseUtil.parseJwt(R.id_token);return A&&A.header&&A.payload?I.nonce!==A.payload.nonce?(c.Log.error("ResponseValidator._validateIdToken: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"))):this._metadataService.getIssuer().then(function(N){return c.Log.debug("ResponseValidator._validateIdToken: Received issuer"),E._getSigningKeyForJwtWithSingleRetry(A).then(function(O){if(!O)return c.Log.error("ResponseValidator._validateIdToken: No key matching kid or alg found in signing keys"),Promise.reject(new Error("No key matching kid or alg found in signing keys"));var L=I.client_id,S=E._settings.clockSkew;return c.Log.debug("ResponseValidator._validateIdToken: Validaing JWT; using clock skew (in seconds) of: ",S),E._joseUtil.validateJwt(R.id_token,O,N,L,S).then(function(){return c.Log.debug("ResponseValidator._validateIdToken: JWT validation successful"),A.payload.sub?(R.profile=A.payload,R):(c.Log.error("ResponseValidator._validateIdToken: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))})})}):(c.Log.error("ResponseValidator._validateIdToken: Failed to parse id_token",A),Promise.reject(new Error("Failed to parse id_token")))},w.prototype._filterByAlg=function(I,R){var E=null;if(R.startsWith("RS"))E="RSA";else if(R.startsWith("PS"))E="PS";else{if(!R.startsWith("ES"))return c.Log.debug("ResponseValidator._filterByAlg: alg not supported: ",R),[];E="EC"}return c.Log.debug("ResponseValidator._filterByAlg: Looking for keys that match kty: ",E),I=I.filter(function(A){return A.kty===E}),c.Log.debug("ResponseValidator._filterByAlg: Number of keys that match kty: ",E,I.length),I},w.prototype._validateAccessToken=function(I){if(!I.profile)return c.Log.error("ResponseValidator._validateAccessToken: No profile loaded from id_token"),Promise.reject(new Error("No profile loaded from id_token"));if(!I.profile.at_hash)return c.Log.error("ResponseValidator._validateAccessToken: No at_hash in id_token"),Promise.reject(new Error("No at_hash in id_token"));if(!I.id_token)return c.Log.error("ResponseValidator._validateAccessToken: No id_token"),Promise.reject(new Error("No id_token"));var R=this._joseUtil.parseJwt(I.id_token);if(!R||!R.header)return c.Log.error("ResponseValidator._validateAccessToken: Failed to parse id_token",R),Promise.reject(new Error("Failed to parse id_token"));var E=R.header.alg;if(!E||E.length!==5)return c.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",E),Promise.reject(new Error("Unsupported alg: "+E));var A=E.substr(2,3);if(!A)return c.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",E,A),Promise.reject(new Error("Unsupported alg: "+E));if((A=parseInt(A))!==256&&A!==384&&A!==512)return c.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",E,A),Promise.reject(new Error("Unsupported alg: "+E));var N="sha"+A,O=this._joseUtil.hashString(I.access_token,N);if(!O)return c.Log.error("ResponseValidator._validateAccessToken: access_token hash failed:",N),Promise.reject(new Error("Failed to validate at_hash"));var L=O.substr(0,O.length/2),S=this._joseUtil.hexToBase64Url(L);return S!==I.profile.at_hash?(c.Log.error("ResponseValidator._validateAccessToken: Failed to validate at_hash",S,I.profile.at_hash),Promise.reject(new Error("Failed to validate at_hash"))):(c.Log.debug("ResponseValidator._validateAccessToken: success"),Promise.resolve(I))},w}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.UserInfoService=void 0;var a=s(7),c=s(2),d=s(0),g=s(4);function f(p,h){if(!(p instanceof h))throw new TypeError("Cannot call a class as a function")}r.UserInfoService=function(){function p(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:a.JsonService,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:c.MetadataService,w=arguments.length>3&&arguments[3]!==void 0?arguments[3]:g.JoseUtil;if(f(this,p),!h)throw d.Log.error("UserInfoService.ctor: No settings passed"),new Error("settings");this._settings=h,this._jsonService=new m(void 0,void 0,this._getClaimsFromJwt.bind(this)),this._metadataService=new _(this._settings),this._joseUtil=w}return p.prototype.getClaims=function(m){var _=this;return m?this._metadataService.getUserInfoEndpoint().then(function(w){return d.Log.debug("UserInfoService.getClaims: received userinfo url",w),_._jsonService.getJson(w,m).then(function(P){return d.Log.debug("UserInfoService.getClaims: claims received",P),P})}):(d.Log.error("UserInfoService.getClaims: No token passed"),Promise.reject(new Error("A token is required")))},p.prototype._getClaimsFromJwt=function(m){var _=this;try{var w=this._joseUtil.parseJwt(m.responseText);if(!w||!w.header||!w.payload)return d.Log.error("UserInfoService._getClaimsFromJwt: Failed to parse JWT",w),Promise.reject(new Error("Failed to parse id_token"));var P=w.header.kid,I=void 0;switch(this._settings.userInfoJwtIssuer){case"OP":I=this._metadataService.getIssuer();break;case"ANY":I=Promise.resolve(w.payload.iss);break;default:I=Promise.resolve(this._settings.userInfoJwtIssuer)}return I.then(function(R){return d.Log.debug("UserInfoService._getClaimsFromJwt: Received issuer:"+R),_._metadataService.getSigningKeys().then(function(E){if(!E)return d.Log.error("UserInfoService._getClaimsFromJwt: No signing keys from metadata"),Promise.reject(new Error("No signing keys from metadata"));d.Log.debug("UserInfoService._getClaimsFromJwt: Received signing keys");var A=void 0;if(P)A=E.filter(function(L){return L.kid===P})[0];else{if((E=_._filterByAlg(E,w.header.alg)).length>1)return d.Log.error("UserInfoService._getClaimsFromJwt: No kid found in id_token and more than one key found in metadata"),Promise.reject(new Error("No kid found in id_token and more than one key found in metadata"));A=E[0]}if(!A)return d.Log.error("UserInfoService._getClaimsFromJwt: No key matching kid or alg found in signing keys"),Promise.reject(new Error("No key matching kid or alg found in signing keys"));var N=_._settings.client_id,O=_._settings.clockSkew;return d.Log.debug("UserInfoService._getClaimsFromJwt: Validaing JWT; using clock skew (in seconds) of: ",O),_._joseUtil.validateJwt(m.responseText,A,R,N,O,void 0,!0).then(function(){return d.Log.debug("UserInfoService._getClaimsFromJwt: JWT validation successful"),w.payload})})})}catch(R){return d.Log.error("UserInfoService._getClaimsFromJwt: Error parsing JWT response",R.message),void reject(R)}},p.prototype._filterByAlg=function(m,_){var w=null;if(_.startsWith("RS"))w="RSA";else if(_.startsWith("PS"))w="PS";else{if(!_.startsWith("ES"))return d.Log.debug("UserInfoService._filterByAlg: alg not supported: ",_),[];w="EC"}return d.Log.debug("UserInfoService._filterByAlg: Looking for keys that match kty: ",w),m=m.filter(function(P){return P.kty===w}),d.Log.debug("UserInfoService._filterByAlg: Number of keys that match kty: ",w,m.length),m},p}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.AllowedSigningAlgs=r.b64tohex=r.hextob64u=r.crypto=r.X509=r.KeyUtil=r.jws=void 0;var a=s(27);r.jws=a.jws,r.KeyUtil=a.KEYUTIL,r.X509=a.X509,r.crypto=a.crypto,r.hextob64u=a.hextob64u,r.b64tohex=a.b64tohex,r.AllowedSigningAlgs=["RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"]},function(n,r,s){(function(a){Object.defineProperty(r,"__esModule",{value:!0});var c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},d={userAgent:!1},g={};/*!
5
+ Copyright (c) 2011, Yahoo! Inc. All rights reserved.
6
+ Code licensed under the BSD License:
7
+ http://developer.yahoo.com/yui/license.html
8
+ version: 2.9.0
9
+ */if(f===void 0)var f={};f.lang={extend:function(i,u,l){if(!u||!i)throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");var v=function(){};if(v.prototype=u.prototype,i.prototype=new v,i.prototype.constructor=i,i.superclass=u.prototype,u.prototype.constructor==Object.prototype.constructor&&(u.prototype.constructor=u),l){var y;for(y in l)i.prototype[y]=l[y];var k=function(){},B=["toString","valueOf"];try{/MSIE/.test(d.userAgent)&&(k=function(j,$){for(y=0;y<B.length;y+=1){var V=B[y],J=$[V];typeof J=="function"&&J!=Object.prototype[V]&&(j[V]=J)}})}catch{}k(i.prototype,l)}}};/*! CryptoJS v3.1.2 core-fix.js
10
+ * code.google.com/p/crypto-js
11
+ * (c) 2009-2013 by Jeff Mott. All rights reserved.
12
+ * code.google.com/p/crypto-js/wiki/License
13
+ * THIS IS FIX of 'core.js' to fix Hmac issue.
14
+ * https://code.google.com/p/crypto-js/issues/detail?id=84
15
+ * https://crypto-js.googlecode.com/svn-history/r667/branches/3.x/src/core.js
16
+ */var p,h,m,_,w,P,I,R,E,A,N,O=O||(p=Math,m=(h={}).lib={},_=m.Base=function(){function o(){}return{extend:function(u){o.prototype=this;var l=new o;return u&&l.mixIn(u),l.hasOwnProperty("init")||(l.init=function(){l.$super.init.apply(this,arguments)}),l.init.prototype=l,l.$super=this,l},create:function(){var u=this.extend();return u.init.apply(u,arguments),u},init:function(){},mixIn:function(u){for(var l in u)u.hasOwnProperty(l)&&(this[l]=u[l]);u.hasOwnProperty("toString")&&(this.toString=u.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),w=m.WordArray=_.extend({init:function(i,u){i=this.words=i||[],this.sigBytes=u??4*i.length},toString:function(i){return(i||I).stringify(this)},concat:function(i){var u=this.words,l=i.words,v=this.sigBytes,y=i.sigBytes;if(this.clamp(),v%4)for(var k=0;k<y;k++){var B=l[k>>>2]>>>24-k%4*8&255;u[v+k>>>2]|=B<<24-(v+k)%4*8}else for(k=0;k<y;k+=4)u[v+k>>>2]=l[k>>>2];return this.sigBytes+=y,this},clamp:function(){var i=this.words,u=this.sigBytes;i[u>>>2]&=4294967295<<32-u%4*8,i.length=p.ceil(u/4)},clone:function(){var i=_.clone.call(this);return i.words=this.words.slice(0),i},random:function(i){for(var u=[],l=0;l<i;l+=4)u.push(4294967296*p.random()|0);return new w.init(u,i)}}),P=h.enc={},I=P.Hex={stringify:function(i){for(var u=i.words,l=i.sigBytes,v=[],y=0;y<l;y++){var k=u[y>>>2]>>>24-y%4*8&255;v.push((k>>>4).toString(16)),v.push((15&k).toString(16))}return v.join("")},parse:function(i){for(var u=i.length,l=[],v=0;v<u;v+=2)l[v>>>3]|=parseInt(i.substr(v,2),16)<<24-v%8*4;return new w.init(l,u/2)}},R=P.Latin1={stringify:function(i){for(var u=i.words,l=i.sigBytes,v=[],y=0;y<l;y++){var k=u[y>>>2]>>>24-y%4*8&255;v.push(String.fromCharCode(k))}return v.join("")},parse:function(i){for(var u=i.length,l=[],v=0;v<u;v++)l[v>>>2]|=(255&i.charCodeAt(v))<<24-v%4*8;return new w.init(l,u)}},E=P.Utf8={stringify:function(i){try{return decodeURIComponent(escape(R.stringify(i)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(i){return R.parse(unescape(encodeURIComponent(i)))}},A=m.BufferedBlockAlgorithm=_.extend({reset:function(){this._data=new w.init,this._nDataBytes=0},_append:function(i){typeof i=="string"&&(i=E.parse(i)),this._data.concat(i),this._nDataBytes+=i.sigBytes},_process:function(i){var u=this._data,l=u.words,v=u.sigBytes,y=this.blockSize,k=v/(4*y),B=(k=i?p.ceil(k):p.max((0|k)-this._minBufferSize,0))*y,U=p.min(4*B,v);if(B){for(var j=0;j<B;j+=y)this._doProcessBlock(l,j);var $=l.splice(0,B);u.sigBytes-=U}return new w.init($,U)},clone:function(){var i=_.clone.call(this);return i._data=this._data.clone(),i},_minBufferSize:0}),m.Hasher=A.extend({cfg:_.extend(),init:function(i){this.cfg=this.cfg.extend(i),this.reset()},reset:function(){A.reset.call(this),this._doReset()},update:function(i){return this._append(i),this._process(),this},finalize:function(i){return i&&this._append(i),this._doFinalize()},blockSize:16,_createHelper:function(i){return function(u,l){return new i.init(l).finalize(u)}},_createHmacHelper:function(i){return function(u,l){return new N.HMAC.init(i,l).finalize(u)}}}),N=h.algo={},h);(function(o){var i,u=(i=O).lib,l=u.Base,v=u.WordArray;(i=i.x64={}).Word=l.extend({init:function(k,B){this.high=k,this.low=B}}),i.WordArray=l.extend({init:function(k,B){k=this.words=k||[],this.sigBytes=B??8*k.length},toX32:function(){for(var k=this.words,B=k.length,U=[],j=0;j<B;j++){var $=k[j];U.push($.high),U.push($.low)}return v.create(U,this.sigBytes)},clone:function(){for(var k=l.clone.call(this),B=k.words=this.words.slice(0),U=B.length,j=0;j<U;j++)B[j]=B[j].clone();return k}})})(),function(){var o=O,i=o.lib.WordArray;o.enc.Base64={stringify:function(l){var v=l.words,y=l.sigBytes,k=this._map;l.clamp(),l=[];for(var B=0;B<y;B+=3)for(var U=(v[B>>>2]>>>24-B%4*8&255)<<16|(v[B+1>>>2]>>>24-(B+1)%4*8&255)<<8|v[B+2>>>2]>>>24-(B+2)%4*8&255,j=0;4>j&&B+.75*j<y;j++)l.push(k.charAt(U>>>6*(3-j)&63));if(v=k.charAt(64))for(;l.length%4;)l.push(v);return l.join("")},parse:function(l){var v=l.length,y=this._map;(k=y.charAt(64))&&(k=l.indexOf(k))!=-1&&(v=k);for(var k=[],B=0,U=0;U<v;U++)if(U%4){var j=y.indexOf(l.charAt(U-1))<<U%4*2,$=y.indexOf(l.charAt(U))>>>6-U%4*2;k[B>>>2]|=(j|$)<<24-B%4*8,B++}return i.create(k,B)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(o){for(var i=O,u=(v=i.lib).WordArray,l=v.Hasher,v=i.algo,y=[],k=[],B=function(ne){return 4294967296*(ne-(0|ne))|0},U=2,j=0;64>j;){var $;e:{$=U;for(var V=o.sqrt($),J=2;J<=V;J++)if(!($%J)){$=!1;break e}$=!0}$&&(8>j&&(y[j]=B(o.pow(U,.5))),k[j]=B(o.pow(U,1/3)),j++),U++}var X=[];v=v.SHA256=l.extend({_doReset:function(){this._hash=new u.init(y.slice(0))},_doProcessBlock:function(ne,re){for(var C=this._hash.words,K=C[0],W=C[1],z=C[2],te=C[3],ie=C[4],ge=C[5],ce=C[6],Ce=C[7],de=0;64>de;de++){if(16>de)X[de]=0|ne[re+de];else{var ye=X[de-15],qe=X[de-2];X[de]=((ye<<25|ye>>>7)^(ye<<14|ye>>>18)^ye>>>3)+X[de-7]+((qe<<15|qe>>>17)^(qe<<13|qe>>>19)^qe>>>10)+X[de-16]}ye=Ce+((ie<<26|ie>>>6)^(ie<<21|ie>>>11)^(ie<<7|ie>>>25))+(ie&ge^~ie&ce)+k[de]+X[de],qe=((K<<30|K>>>2)^(K<<19|K>>>13)^(K<<10|K>>>22))+(K&W^K&z^W&z),Ce=ce,ce=ge,ge=ie,ie=te+ye|0,te=z,z=W,W=K,K=ye+qe|0}C[0]=C[0]+K|0,C[1]=C[1]+W|0,C[2]=C[2]+z|0,C[3]=C[3]+te|0,C[4]=C[4]+ie|0,C[5]=C[5]+ge|0,C[6]=C[6]+ce|0,C[7]=C[7]+Ce|0},_doFinalize:function(){var ne=this._data,re=ne.words,C=8*this._nDataBytes,K=8*ne.sigBytes;return re[K>>>5]|=128<<24-K%32,re[14+(K+64>>>9<<4)]=o.floor(C/4294967296),re[15+(K+64>>>9<<4)]=C,ne.sigBytes=4*re.length,this._process(),this._hash},clone:function(){var ne=l.clone.call(this);return ne._hash=this._hash.clone(),ne}}),i.SHA256=l._createHelper(v),i.HmacSHA256=l._createHmacHelper(v)}(Math),function(){function o(){return l.create.apply(l,arguments)}for(var i=O,u=i.lib.Hasher,l=(y=i.x64).Word,v=y.WordArray,y=i.algo,k=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],B=[],U=0;80>U;U++)B[U]=o();y=y.SHA512=u.extend({_doReset:function(){this._hash=new v.init([new l.init(1779033703,4089235720),new l.init(3144134277,2227873595),new l.init(1013904242,4271175723),new l.init(2773480762,1595750129),new l.init(1359893119,2917565137),new l.init(2600822924,725511199),new l.init(528734635,4215389547),new l.init(1541459225,327033209)])},_doProcessBlock:function($,V){for(var J=(W=this._hash.words)[0],X=W[1],ee=W[2],ne=W[3],re=W[4],C=W[5],K=W[6],W=W[7],z=J.high,te=J.low,ie=X.high,ge=X.low,ce=ee.high,Ce=ee.low,de=ne.high,ye=ne.low,qe=re.high,Xe=re.low,ze=C.high,xt=C.low,It=K.high,Dt=K.low,it=W.high,vt=W.low,kt=z,Nt=te,Tr=ie,tr=ge,Cr=ce,nr=Ce,Xi=de,Ir=ye,en=qe,Yt=Xe,ai=ze,Rr=xt,ui=It,Or=Dt,Qi=it,Lr=vt,tn=0;80>tn;tn++){var Hn=B[tn];if(16>tn)var gn=Hn.high=0|$[V+2*tn],Qe=Hn.low=0|$[V+2*tn+1];else{gn=((Qe=(gn=B[tn-15]).high)>>>1|(vn=gn.low)<<31)^(Qe>>>8|vn<<24)^Qe>>>7;var vn=(vn>>>1|Qe<<31)^(vn>>>8|Qe<<24)^(vn>>>7|Qe<<25),rr=((Qe=(rr=B[tn-2]).high)>>>19|(mt=rr.low)<<13)^(Qe<<3|mt>>>29)^Qe>>>6,mt=(mt>>>19|Qe<<13)^(mt<<3|Qe>>>29)^(mt>>>6|Qe<<26),Zi=(Qe=B[tn-7]).high,$n=(Kn=B[tn-16]).high,Kn=Kn.low;gn=(gn=(gn=gn+Zi+((Qe=vn+Qe.low)>>>0<vn>>>0?1:0))+rr+((Qe=Qe+mt)>>>0<mt>>>0?1:0))+$n+((Qe=Qe+Kn)>>>0<Kn>>>0?1:0),Hn.high=gn,Hn.low=Qe}Zi=en&ai^~en&ui,Kn=Yt&Rr^~Yt&Or,Hn=kt&Tr^kt&Cr^Tr&Cr;var Ul=Nt&tr^Nt&nr^tr&nr,xl=(vn=(kt>>>28|Nt<<4)^(kt<<30|Nt>>>2)^(kt<<25|Nt>>>7),rr=(Nt>>>28|kt<<4)^(Nt<<30|kt>>>2)^(Nt<<25|kt>>>7),(mt=k[tn]).high),Js=mt.low;$n=Qi+((en>>>14|Yt<<18)^(en>>>18|Yt<<14)^(en<<23|Yt>>>9))+((mt=Lr+((Yt>>>14|en<<18)^(Yt>>>18|en<<14)^(Yt<<23|en>>>9)))>>>0<Lr>>>0?1:0),Qi=ui,Lr=Or,ui=ai,Or=Rr,ai=en,Rr=Yt,en=Xi+($n=($n=($n=$n+Zi+((mt=mt+Kn)>>>0<Kn>>>0?1:0))+xl+((mt=mt+Js)>>>0<Js>>>0?1:0))+gn+((mt=mt+Qe)>>>0<Qe>>>0?1:0))+((Yt=Ir+mt|0)>>>0<Ir>>>0?1:0)|0,Xi=Cr,Ir=nr,Cr=Tr,nr=tr,Tr=kt,tr=Nt,kt=$n+(Hn=vn+Hn+((Qe=rr+Ul)>>>0<rr>>>0?1:0))+((Nt=mt+Qe|0)>>>0<mt>>>0?1:0)|0}te=J.low=te+Nt,J.high=z+kt+(te>>>0<Nt>>>0?1:0),ge=X.low=ge+tr,X.high=ie+Tr+(ge>>>0<tr>>>0?1:0),Ce=ee.low=Ce+nr,ee.high=ce+Cr+(Ce>>>0<nr>>>0?1:0),ye=ne.low=ye+Ir,ne.high=de+Xi+(ye>>>0<Ir>>>0?1:0),Xe=re.low=Xe+Yt,re.high=qe+en+(Xe>>>0<Yt>>>0?1:0),xt=C.low=xt+Rr,C.high=ze+ai+(xt>>>0<Rr>>>0?1:0),Dt=K.low=Dt+Or,K.high=It+ui+(Dt>>>0<Or>>>0?1:0),vt=W.low=vt+Lr,W.high=it+Qi+(vt>>>0<Lr>>>0?1:0)},_doFinalize:function(){var $=this._data,V=$.words,J=8*this._nDataBytes,X=8*$.sigBytes;return V[X>>>5]|=128<<24-X%32,V[30+(X+128>>>10<<5)]=Math.floor(J/4294967296),V[31+(X+128>>>10<<5)]=J,$.sigBytes=4*V.length,this._process(),this._hash.toX32()},clone:function(){var $=u.clone.call(this);return $._hash=this._hash.clone(),$},blockSize:32}),i.SHA512=u._createHelper(y),i.HmacSHA512=u._createHmacHelper(y)}(),function(){var o=O,i=(v=o.x64).Word,u=v.WordArray,l=(v=o.algo).SHA512,v=v.SHA384=l.extend({_doReset:function(){this._hash=new u.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var k=l._doFinalize.call(this);return k.sigBytes-=16,k}});o.SHA384=l._createHelper(v),o.HmacSHA384=l._createHmacHelper(v)}();/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
17
+ */var L,S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function D(o){var i,u,l="";for(i=0;i+3<=o.length;i+=3)u=parseInt(o.substring(i,i+3),16),l+=S.charAt(u>>6)+S.charAt(63&u);for(i+1==o.length?(u=parseInt(o.substring(i,i+1),16),l+=S.charAt(u<<2)):i+2==o.length&&(u=parseInt(o.substring(i,i+2),16),l+=S.charAt(u>>2)+S.charAt((3&u)<<4)),"=";(3&l.length)>0;)l+="=";return l}function H(o){var i,u,l,v="",y=0;for(i=0;i<o.length&&o.charAt(i)!="=";++i)(l=S.indexOf(o.charAt(i)))<0||(y==0?(v+=Te(l>>2),u=3&l,y=1):y==1?(v+=Te(u<<2|l>>4),u=15&l,y=2):y==2?(v+=Te(u),v+=Te(l>>2),u=3&l,y=3):(v+=Te(u<<2|l>>4),v+=Te(15&l),y=0));return y==1&&(v+=Te(u<<2)),v}function Q(o){var i,u=H(o),l=new Array;for(i=0;2*i<u.length;++i)l[i]=parseInt(u.substring(2*i,2*i+2),16);return l}function x(o,i,u){o!=null&&(typeof o=="number"?this.fromNumber(o,i,u):i==null&&typeof o!="string"?this.fromString(o,256):this.fromString(o,i))}function ue(){return new x(null)}d.appName=="Microsoft Internet Explorer"?(x.prototype.am=function(i,u,l,v,y,k){for(var B=32767&u,U=u>>15;--k>=0;){var j=32767&this[i],$=this[i++]>>15,V=U*j+$*B;y=((j=B*j+((32767&V)<<15)+l[v]+(1073741823&y))>>>30)+(V>>>15)+U*$+(y>>>30),l[v++]=1073741823&j}return y},L=30):d.appName!="Netscape"?(x.prototype.am=function(i,u,l,v,y,k){for(;--k>=0;){var B=u*this[i++]+l[v]+y;y=Math.floor(B/67108864),l[v++]=67108863&B}return y},L=26):(x.prototype.am=function(i,u,l,v,y,k){for(var B=16383&u,U=u>>14;--k>=0;){var j=16383&this[i],$=this[i++]>>14,V=U*j+$*B;y=((j=B*j+((16383&V)<<14)+l[v]+y)>>28)+(V>>14)+U*$,l[v++]=268435455&j}return y},L=28),x.prototype.DB=L,x.prototype.DM=(1<<L)-1,x.prototype.DV=1<<L,x.prototype.FV=Math.pow(2,52),x.prototype.F1=52-L,x.prototype.F2=2*L-52;var le,be,Se=new Array;for(le="0".charCodeAt(0),be=0;be<=9;++be)Se[le++]=be;for(le="a".charCodeAt(0),be=10;be<36;++be)Se[le++]=be;for(le="A".charCodeAt(0),be=10;be<36;++be)Se[le++]=be;function Te(o){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(o)}function Ne(o,i){var u=Se[o.charCodeAt(i)];return u??-1}function Ke(o){var i=ue();return i.fromInt(o),i}function Pe(o){var i,u=1;return(i=o>>>16)!=0&&(o=i,u+=16),(i=o>>8)!=0&&(o=i,u+=8),(i=o>>4)!=0&&(o=i,u+=4),(i=o>>2)!=0&&(o=i,u+=2),(i=o>>1)!=0&&(o=i,u+=1),u}function Ae(o){this.m=o}function Le(o){this.m=o,this.mp=o.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<o.DB-15)-1,this.mt2=2*o.t}function at(o,i){return o&i}function Be(o,i){return o|i}function bt(o,i){return o^i}function Ft(o,i){return o&~i}function Bt(o){if(o==0)return-1;var i=0;return!(65535&o)&&(o>>=16,i+=16),!(255&o)&&(o>>=8,i+=8),!(15&o)&&(o>>=4,i+=4),!(3&o)&&(o>>=2,i+=2),!(1&o)&&++i,i}function At(o){for(var i=0;o!=0;)o&=o-1,++i;return i}function rt(){}function De(o){return o}function He(o){this.r2=ue(),this.q3=ue(),x.ONE.dlShiftTo(2*o.t,this.r2),this.mu=this.r2.divide(o),this.m=o}Ae.prototype.convert=function(i){return i.s<0||i.compareTo(this.m)>=0?i.mod(this.m):i},Ae.prototype.revert=function(i){return i},Ae.prototype.reduce=function(i){i.divRemTo(this.m,null,i)},Ae.prototype.mulTo=function(i,u,l){i.multiplyTo(u,l),this.reduce(l)},Ae.prototype.sqrTo=function(i,u){i.squareTo(u),this.reduce(u)},Le.prototype.convert=function(i){var u=ue();return i.abs().dlShiftTo(this.m.t,u),u.divRemTo(this.m,null,u),i.s<0&&u.compareTo(x.ZERO)>0&&this.m.subTo(u,u),u},Le.prototype.revert=function(i){var u=ue();return i.copyTo(u),this.reduce(u),u},Le.prototype.reduce=function(i){for(;i.t<=this.mt2;)i[i.t++]=0;for(var u=0;u<this.m.t;++u){var l=32767&i[u],v=l*this.mpl+((l*this.mph+(i[u]>>15)*this.mpl&this.um)<<15)&i.DM;for(i[l=u+this.m.t]+=this.m.am(0,v,i,u,0,this.m.t);i[l]>=i.DV;)i[l]-=i.DV,i[++l]++}i.clamp(),i.drShiftTo(this.m.t,i),i.compareTo(this.m)>=0&&i.subTo(this.m,i)},Le.prototype.mulTo=function(i,u,l){i.multiplyTo(u,l),this.reduce(l)},Le.prototype.sqrTo=function(i,u){i.squareTo(u),this.reduce(u)},x.prototype.copyTo=function(i){for(var u=this.t-1;u>=0;--u)i[u]=this[u];i.t=this.t,i.s=this.s},x.prototype.fromInt=function(i){this.t=1,this.s=i<0?-1:0,i>0?this[0]=i:i<-1?this[0]=i+this.DV:this.t=0},x.prototype.fromString=function(i,u){var l;if(u==16)l=4;else if(u==8)l=3;else if(u==256)l=8;else if(u==2)l=1;else if(u==32)l=5;else{if(u!=4)return void this.fromRadix(i,u);l=2}this.t=0,this.s=0;for(var v=i.length,y=!1,k=0;--v>=0;){var B=l==8?255&i[v]:Ne(i,v);B<0?i.charAt(v)=="-"&&(y=!0):(y=!1,k==0?this[this.t++]=B:k+l>this.DB?(this[this.t-1]|=(B&(1<<this.DB-k)-1)<<k,this[this.t++]=B>>this.DB-k):this[this.t-1]|=B<<k,(k+=l)>=this.DB&&(k-=this.DB))}l==8&&128&i[0]&&(this.s=-1,k>0&&(this[this.t-1]|=(1<<this.DB-k)-1<<k)),this.clamp(),y&&x.ZERO.subTo(this,this)},x.prototype.clamp=function(){for(var i=this.s&this.DM;this.t>0&&this[this.t-1]==i;)--this.t},x.prototype.dlShiftTo=function(i,u){var l;for(l=this.t-1;l>=0;--l)u[l+i]=this[l];for(l=i-1;l>=0;--l)u[l]=0;u.t=this.t+i,u.s=this.s},x.prototype.drShiftTo=function(i,u){for(var l=i;l<this.t;++l)u[l-i]=this[l];u.t=Math.max(this.t-i,0),u.s=this.s},x.prototype.lShiftTo=function(i,u){var l,v=i%this.DB,y=this.DB-v,k=(1<<y)-1,B=Math.floor(i/this.DB),U=this.s<<v&this.DM;for(l=this.t-1;l>=0;--l)u[l+B+1]=this[l]>>y|U,U=(this[l]&k)<<v;for(l=B-1;l>=0;--l)u[l]=0;u[B]=U,u.t=this.t+B+1,u.s=this.s,u.clamp()},x.prototype.rShiftTo=function(i,u){u.s=this.s;var l=Math.floor(i/this.DB);if(l>=this.t)u.t=0;else{var v=i%this.DB,y=this.DB-v,k=(1<<v)-1;u[0]=this[l]>>v;for(var B=l+1;B<this.t;++B)u[B-l-1]|=(this[B]&k)<<y,u[B-l]=this[B]>>v;v>0&&(u[this.t-l-1]|=(this.s&k)<<y),u.t=this.t-l,u.clamp()}},x.prototype.subTo=function(i,u){for(var l=0,v=0,y=Math.min(i.t,this.t);l<y;)v+=this[l]-i[l],u[l++]=v&this.DM,v>>=this.DB;if(i.t<this.t){for(v-=i.s;l<this.t;)v+=this[l],u[l++]=v&this.DM,v>>=this.DB;v+=this.s}else{for(v+=this.s;l<i.t;)v-=i[l],u[l++]=v&this.DM,v>>=this.DB;v-=i.s}u.s=v<0?-1:0,v<-1?u[l++]=this.DV+v:v>0&&(u[l++]=v),u.t=l,u.clamp()},x.prototype.multiplyTo=function(i,u){var l=this.abs(),v=i.abs(),y=l.t;for(u.t=y+v.t;--y>=0;)u[y]=0;for(y=0;y<v.t;++y)u[y+l.t]=l.am(0,v[y],u,y,0,l.t);u.s=0,u.clamp(),this.s!=i.s&&x.ZERO.subTo(u,u)},x.prototype.squareTo=function(i){for(var u=this.abs(),l=i.t=2*u.t;--l>=0;)i[l]=0;for(l=0;l<u.t-1;++l){var v=u.am(l,u[l],i,2*l,0,1);(i[l+u.t]+=u.am(l+1,2*u[l],i,2*l+1,v,u.t-l-1))>=u.DV&&(i[l+u.t]-=u.DV,i[l+u.t+1]=1)}i.t>0&&(i[i.t-1]+=u.am(l,u[l],i,2*l,0,1)),i.s=0,i.clamp()},x.prototype.divRemTo=function(i,u,l){var v=i.abs();if(!(v.t<=0)){var y=this.abs();if(y.t<v.t)return u!=null&&u.fromInt(0),void(l!=null&&this.copyTo(l));l==null&&(l=ue());var k=ue(),B=this.s,U=i.s,j=this.DB-Pe(v[v.t-1]);j>0?(v.lShiftTo(j,k),y.lShiftTo(j,l)):(v.copyTo(k),y.copyTo(l));var $=k.t,V=k[$-1];if(V!=0){var J=V*(1<<this.F1)+($>1?k[$-2]>>this.F2:0),X=this.FV/J,ee=(1<<this.F1)/J,ne=1<<this.F2,re=l.t,C=re-$,K=u??ue();for(k.dlShiftTo(C,K),l.compareTo(K)>=0&&(l[l.t++]=1,l.subTo(K,l)),x.ONE.dlShiftTo($,K),K.subTo(k,k);k.t<$;)k[k.t++]=0;for(;--C>=0;){var W=l[--re]==V?this.DM:Math.floor(l[re]*X+(l[re-1]+ne)*ee);if((l[re]+=k.am(0,W,l,C,0,$))<W)for(k.dlShiftTo(C,K),l.subTo(K,l);l[re]<--W;)l.subTo(K,l)}u!=null&&(l.drShiftTo($,u),B!=U&&x.ZERO.subTo(u,u)),l.t=$,l.clamp(),j>0&&l.rShiftTo(j,l),B<0&&x.ZERO.subTo(l,l)}}},x.prototype.invDigit=function(){if(this.t<1)return 0;var i=this[0];if(!(1&i))return 0;var u=3&i;return(u=(u=(u=(u=u*(2-(15&i)*u)&15)*(2-(255&i)*u)&255)*(2-((65535&i)*u&65535))&65535)*(2-i*u%this.DV)%this.DV)>0?this.DV-u:-u},x.prototype.isEven=function(){return(this.t>0?1&this[0]:this.s)==0},x.prototype.exp=function(i,u){if(i>4294967295||i<1)return x.ONE;var l=ue(),v=ue(),y=u.convert(this),k=Pe(i)-1;for(y.copyTo(l);--k>=0;)if(u.sqrTo(l,v),(i&1<<k)>0)u.mulTo(v,y,l);else{var B=l;l=v,v=B}return u.revert(l)},x.prototype.toString=function(i){if(this.s<0)return"-"+this.negate().toString(i);var u;if(i==16)u=4;else if(i==8)u=3;else if(i==2)u=1;else if(i==32)u=5;else{if(i!=4)return this.toRadix(i);u=2}var l,v=(1<<u)-1,y=!1,k="",B=this.t,U=this.DB-B*this.DB%u;if(B-- >0)for(U<this.DB&&(l=this[B]>>U)>0&&(y=!0,k=Te(l));B>=0;)U<u?(l=(this[B]&(1<<U)-1)<<u-U,l|=this[--B]>>(U+=this.DB-u)):(l=this[B]>>(U-=u)&v,U<=0&&(U+=this.DB,--B)),l>0&&(y=!0),y&&(k+=Te(l));return y?k:"0"},x.prototype.negate=function(){var i=ue();return x.ZERO.subTo(this,i),i},x.prototype.abs=function(){return this.s<0?this.negate():this},x.prototype.compareTo=function(i){var u=this.s-i.s;if(u!=0)return u;var l=this.t;if((u=l-i.t)!=0)return this.s<0?-u:u;for(;--l>=0;)if((u=this[l]-i[l])!=0)return u;return 0},x.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+Pe(this[this.t-1]^this.s&this.DM)},x.prototype.mod=function(i){var u=ue();return this.abs().divRemTo(i,null,u),this.s<0&&u.compareTo(x.ZERO)>0&&i.subTo(u,u),u},x.prototype.modPowInt=function(i,u){var l;return l=i<256||u.isEven()?new Ae(u):new Le(u),this.exp(i,l)},x.ZERO=Ke(0),x.ONE=Ke(1),rt.prototype.convert=De,rt.prototype.revert=De,rt.prototype.mulTo=function(i,u,l){i.multiplyTo(u,l)},rt.prototype.sqrTo=function(i,u){i.squareTo(u)},He.prototype.convert=function(i){if(i.s<0||i.t>2*this.m.t)return i.mod(this.m);if(i.compareTo(this.m)<0)return i;var u=ue();return i.copyTo(u),this.reduce(u),u},He.prototype.revert=function(i){return i},He.prototype.reduce=function(i){for(i.drShiftTo(this.m.t-1,this.r2),i.t>this.m.t+1&&(i.t=this.m.t+1,i.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);i.compareTo(this.r2)<0;)i.dAddOffset(1,this.m.t+1);for(i.subTo(this.r2,i);i.compareTo(this.m)>=0;)i.subTo(this.m,i)},He.prototype.mulTo=function(i,u,l){i.multiplyTo(u,l),this.reduce(l)},He.prototype.sqrTo=function(i,u){i.squareTo(u),this.reduce(u)};var q=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],b=(1<<26)/q[q.length-1];/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
18
+ */function F(){this.i=0,this.j=0,this.S=new Array}x.prototype.chunkSize=function(i){return Math.floor(Math.LN2*this.DB/Math.log(i))},x.prototype.toRadix=function(i){if(i==null&&(i=10),this.signum()==0||i<2||i>36)return"0";var u=this.chunkSize(i),l=Math.pow(i,u),v=Ke(l),y=ue(),k=ue(),B="";for(this.divRemTo(v,y,k);y.signum()>0;)B=(l+k.intValue()).toString(i).substr(1)+B,y.divRemTo(v,y,k);return k.intValue().toString(i)+B},x.prototype.fromRadix=function(i,u){this.fromInt(0),u==null&&(u=10);for(var l=this.chunkSize(u),v=Math.pow(u,l),y=!1,k=0,B=0,U=0;U<i.length;++U){var j=Ne(i,U);j<0?i.charAt(U)=="-"&&this.signum()==0&&(y=!0):(B=u*B+j,++k>=l&&(this.dMultiply(v),this.dAddOffset(B,0),k=0,B=0))}k>0&&(this.dMultiply(Math.pow(u,k)),this.dAddOffset(B,0)),y&&x.ZERO.subTo(this,this)},x.prototype.fromNumber=function(i,u,l){if(typeof u=="number")if(i<2)this.fromInt(1);else for(this.fromNumber(i,l),this.testBit(i-1)||this.bitwiseTo(x.ONE.shiftLeft(i-1),Be,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(u);)this.dAddOffset(2,0),this.bitLength()>i&&this.subTo(x.ONE.shiftLeft(i-1),this);else{var v=new Array,y=7&i;v.length=1+(i>>3),u.nextBytes(v),y>0?v[0]&=(1<<y)-1:v[0]=0,this.fromString(v,256)}},x.prototype.bitwiseTo=function(i,u,l){var v,y,k=Math.min(i.t,this.t);for(v=0;v<k;++v)l[v]=u(this[v],i[v]);if(i.t<this.t){for(y=i.s&this.DM,v=k;v<this.t;++v)l[v]=u(this[v],y);l.t=this.t}else{for(y=this.s&this.DM,v=k;v<i.t;++v)l[v]=u(y,i[v]);l.t=i.t}l.s=u(this.s,i.s),l.clamp()},x.prototype.changeBit=function(i,u){var l=x.ONE.shiftLeft(i);return this.bitwiseTo(l,u,l),l},x.prototype.addTo=function(i,u){for(var l=0,v=0,y=Math.min(i.t,this.t);l<y;)v+=this[l]+i[l],u[l++]=v&this.DM,v>>=this.DB;if(i.t<this.t){for(v+=i.s;l<this.t;)v+=this[l],u[l++]=v&this.DM,v>>=this.DB;v+=this.s}else{for(v+=this.s;l<i.t;)v+=i[l],u[l++]=v&this.DM,v>>=this.DB;v+=i.s}u.s=v<0?-1:0,v>0?u[l++]=v:v<-1&&(u[l++]=this.DV+v),u.t=l,u.clamp()},x.prototype.dMultiply=function(i){this[this.t]=this.am(0,i-1,this,0,0,this.t),++this.t,this.clamp()},x.prototype.dAddOffset=function(i,u){if(i!=0){for(;this.t<=u;)this[this.t++]=0;for(this[u]+=i;this[u]>=this.DV;)this[u]-=this.DV,++u>=this.t&&(this[this.t++]=0),++this[u]}},x.prototype.multiplyLowerTo=function(i,u,l){var v,y=Math.min(this.t+i.t,u);for(l.s=0,l.t=y;y>0;)l[--y]=0;for(v=l.t-this.t;y<v;++y)l[y+this.t]=this.am(0,i[y],l,y,0,this.t);for(v=Math.min(i.t,u);y<v;++y)this.am(0,i[y],l,y,0,u-y);l.clamp()},x.prototype.multiplyUpperTo=function(i,u,l){--u;var v=l.t=this.t+i.t-u;for(l.s=0;--v>=0;)l[v]=0;for(v=Math.max(u-this.t,0);v<i.t;++v)l[this.t+v-u]=this.am(u-v,i[v],l,0,0,this.t+v-u);l.clamp(),l.drShiftTo(1,l)},x.prototype.modInt=function(i){if(i<=0)return 0;var u=this.DV%i,l=this.s<0?i-1:0;if(this.t>0)if(u==0)l=this[0]%i;else for(var v=this.t-1;v>=0;--v)l=(u*l+this[v])%i;return l},x.prototype.millerRabin=function(i){var u=this.subtract(x.ONE),l=u.getLowestSetBit();if(l<=0)return!1;var v=u.shiftRight(l);(i=i+1>>1)>q.length&&(i=q.length);for(var y=ue(),k=0;k<i;++k){y.fromInt(q[Math.floor(Math.random()*q.length)]);var B=y.modPow(v,this);if(B.compareTo(x.ONE)!=0&&B.compareTo(u)!=0){for(var U=1;U++<l&&B.compareTo(u)!=0;)if((B=B.modPowInt(2,this)).compareTo(x.ONE)==0)return!1;if(B.compareTo(u)!=0)return!1}}return!0},x.prototype.clone=function(){var i=ue();return this.copyTo(i),i},x.prototype.intValue=function(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},x.prototype.byteValue=function(){return this.t==0?this.s:this[0]<<24>>24},x.prototype.shortValue=function(){return this.t==0?this.s:this[0]<<16>>16},x.prototype.signum=function(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1},x.prototype.toByteArray=function(){var i=this.t,u=new Array;u[0]=this.s;var l,v=this.DB-i*this.DB%8,y=0;if(i-- >0)for(v<this.DB&&(l=this[i]>>v)!=(this.s&this.DM)>>v&&(u[y++]=l|this.s<<this.DB-v);i>=0;)v<8?(l=(this[i]&(1<<v)-1)<<8-v,l|=this[--i]>>(v+=this.DB-8)):(l=this[i]>>(v-=8)&255,v<=0&&(v+=this.DB,--i)),128&l&&(l|=-256),y==0&&(128&this.s)!=(128&l)&&++y,(y>0||l!=this.s)&&(u[y++]=l);return u},x.prototype.equals=function(i){return this.compareTo(i)==0},x.prototype.min=function(i){return this.compareTo(i)<0?this:i},x.prototype.max=function(i){return this.compareTo(i)>0?this:i},x.prototype.and=function(i){var u=ue();return this.bitwiseTo(i,at,u),u},x.prototype.or=function(i){var u=ue();return this.bitwiseTo(i,Be,u),u},x.prototype.xor=function(i){var u=ue();return this.bitwiseTo(i,bt,u),u},x.prototype.andNot=function(i){var u=ue();return this.bitwiseTo(i,Ft,u),u},x.prototype.not=function(){for(var i=ue(),u=0;u<this.t;++u)i[u]=this.DM&~this[u];return i.t=this.t,i.s=~this.s,i},x.prototype.shiftLeft=function(i){var u=ue();return i<0?this.rShiftTo(-i,u):this.lShiftTo(i,u),u},x.prototype.shiftRight=function(i){var u=ue();return i<0?this.lShiftTo(-i,u):this.rShiftTo(i,u),u},x.prototype.getLowestSetBit=function(){for(var i=0;i<this.t;++i)if(this[i]!=0)return i*this.DB+Bt(this[i]);return this.s<0?this.t*this.DB:-1},x.prototype.bitCount=function(){for(var i=0,u=this.s&this.DM,l=0;l<this.t;++l)i+=At(this[l]^u);return i},x.prototype.testBit=function(i){var u=Math.floor(i/this.DB);return u>=this.t?this.s!=0:(this[u]&1<<i%this.DB)!=0},x.prototype.setBit=function(i){return this.changeBit(i,Be)},x.prototype.clearBit=function(i){return this.changeBit(i,Ft)},x.prototype.flipBit=function(i){return this.changeBit(i,bt)},x.prototype.add=function(i){var u=ue();return this.addTo(i,u),u},x.prototype.subtract=function(i){var u=ue();return this.subTo(i,u),u},x.prototype.multiply=function(i){var u=ue();return this.multiplyTo(i,u),u},x.prototype.divide=function(i){var u=ue();return this.divRemTo(i,u,null),u},x.prototype.remainder=function(i){var u=ue();return this.divRemTo(i,null,u),u},x.prototype.divideAndRemainder=function(i){var u=ue(),l=ue();return this.divRemTo(i,u,l),new Array(u,l)},x.prototype.modPow=function(i,u){var l,v,y=i.bitLength(),k=Ke(1);if(y<=0)return k;l=y<18?1:y<48?3:y<144?4:y<768?5:6,v=y<8?new Ae(u):u.isEven()?new He(u):new Le(u);var B=new Array,U=3,j=l-1,$=(1<<l)-1;if(B[1]=v.convert(this),l>1){var V=ue();for(v.sqrTo(B[1],V);U<=$;)B[U]=ue(),v.mulTo(V,B[U-2],B[U]),U+=2}var J,X,ee=i.t-1,ne=!0,re=ue();for(y=Pe(i[ee])-1;ee>=0;){for(y>=j?J=i[ee]>>y-j&$:(J=(i[ee]&(1<<y+1)-1)<<j-y,ee>0&&(J|=i[ee-1]>>this.DB+y-j)),U=l;!(1&J);)J>>=1,--U;if((y-=U)<0&&(y+=this.DB,--ee),ne)B[J].copyTo(k),ne=!1;else{for(;U>1;)v.sqrTo(k,re),v.sqrTo(re,k),U-=2;U>0?v.sqrTo(k,re):(X=k,k=re,re=X),v.mulTo(re,B[J],k)}for(;ee>=0&&!(i[ee]&1<<y);)v.sqrTo(k,re),X=k,k=re,re=X,--y<0&&(y=this.DB-1,--ee)}return v.revert(k)},x.prototype.modInverse=function(i){var u=i.isEven();if(this.isEven()&&u||i.signum()==0)return x.ZERO;for(var l=i.clone(),v=this.clone(),y=Ke(1),k=Ke(0),B=Ke(0),U=Ke(1);l.signum()!=0;){for(;l.isEven();)l.rShiftTo(1,l),u?(y.isEven()&&k.isEven()||(y.addTo(this,y),k.subTo(i,k)),y.rShiftTo(1,y)):k.isEven()||k.subTo(i,k),k.rShiftTo(1,k);for(;v.isEven();)v.rShiftTo(1,v),u?(B.isEven()&&U.isEven()||(B.addTo(this,B),U.subTo(i,U)),B.rShiftTo(1,B)):U.isEven()||U.subTo(i,U),U.rShiftTo(1,U);l.compareTo(v)>=0?(l.subTo(v,l),u&&y.subTo(B,y),k.subTo(U,k)):(v.subTo(l,v),u&&B.subTo(y,B),U.subTo(k,U))}return v.compareTo(x.ONE)!=0?x.ZERO:U.compareTo(i)>=0?U.subtract(i):U.signum()<0?(U.addTo(i,U),U.signum()<0?U.add(i):U):U},x.prototype.pow=function(i){return this.exp(i,new rt)},x.prototype.gcd=function(i){var u=this.s<0?this.negate():this.clone(),l=i.s<0?i.negate():i.clone();if(u.compareTo(l)<0){var v=u;u=l,l=v}var y=u.getLowestSetBit(),k=l.getLowestSetBit();if(k<0)return u;for(y<k&&(k=y),k>0&&(u.rShiftTo(k,u),l.rShiftTo(k,l));u.signum()>0;)(y=u.getLowestSetBit())>0&&u.rShiftTo(y,u),(y=l.getLowestSetBit())>0&&l.rShiftTo(y,l),u.compareTo(l)>=0?(u.subTo(l,u),u.rShiftTo(1,u)):(l.subTo(u,l),l.rShiftTo(1,l));return k>0&&l.lShiftTo(k,l),l},x.prototype.isProbablePrime=function(i){var u,l=this.abs();if(l.t==1&&l[0]<=q[q.length-1]){for(u=0;u<q.length;++u)if(l[0]==q[u])return!0;return!1}if(l.isEven())return!1;for(u=1;u<q.length;){for(var v=q[u],y=u+1;y<q.length&&v<b;)v*=q[y++];for(v=l.modInt(v);u<y;)if(v%q[u++]==0)return!1}return l.millerRabin(i)},x.prototype.square=function(){var i=ue();return this.squareTo(i),i},F.prototype.init=function(i){var u,l,v;for(u=0;u<256;++u)this.S[u]=u;for(l=0,u=0;u<256;++u)l=l+this.S[u]+i[u%i.length]&255,v=this.S[u],this.S[u]=this.S[l],this.S[l]=v;this.i=0,this.j=0},F.prototype.next=function(){var i;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,i=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=i,this.S[i+this.S[this.i]&255]};var Y,G,Z;/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
19
+ */function se(){(function(i){G[Z++]^=255&i,G[Z++]^=i>>8&255,G[Z++]^=i>>16&255,G[Z++]^=i>>24&255,Z>=256&&(Z-=256)})(new Date().getTime())}if(G==null){var pe;if(G=new Array,Z=0,g!==void 0&&(g.crypto!==void 0||g.msCrypto!==void 0)){var Ee=g.crypto||g.msCrypto;if(Ee.getRandomValues){var Me=new Uint8Array(32);for(Ee.getRandomValues(Me),pe=0;pe<32;++pe)G[Z++]=Me[pe]}else if(d.appName=="Netscape"&&d.appVersion<"5"){var Ie=g.crypto.random(32);for(pe=0;pe<Ie.length;++pe)G[Z++]=255&Ie.charCodeAt(pe)}}for(;Z<256;)pe=Math.floor(65536*Math.random()),G[Z++]=pe>>>8,G[Z++]=255&pe;Z=0,se()}function Ge(){if(Y==null){for(se(),(Y=function(){return new F}()).init(G),Z=0;Z<G.length;++Z)G[Z]=0;Z=0}return Y.next()}function St(){}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
20
+ */function Ct(o,i){return new x(o,i)}function Ht(o,i,u){for(var l="",v=0;l.length<i;)l+=u(String.fromCharCode.apply(String,o.concat([(4278190080&v)>>24,(16711680&v)>>16,(65280&v)>>8,255&v]))),v+=1;return l}function me(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
21
+ */function Ve(o,i){this.x=i,this.q=o}function Re(o,i,u,l){this.curve=o,this.x=i,this.y=u,this.z=l??x.ONE,this.zinv=null}function un(o,i,u){this.q=o,this.a=this.fromBigInteger(i),this.b=this.fromBigInteger(u),this.infinity=new Re(this,null,null)}St.prototype.nextBytes=function(i){var u;for(u=0;u<i.length;++u)i[u]=Ge()},me.prototype.doPublic=function(i){return i.modPowInt(this.e,this.n)},me.prototype.setPublic=function(i,u){if(this.isPublic=!0,this.isPrivate=!1,typeof i!="string")this.n=i,this.e=u;else{if(!(i!=null&&u!=null&&i.length>0&&u.length>0))throw"Invalid RSA public key";this.n=Ct(i,16),this.e=parseInt(u,16)}},me.prototype.encrypt=function(i){var u=function(k,B){if(B<k.length+11)throw"Message too long for RSA";for(var U=new Array,j=k.length-1;j>=0&&B>0;){var $=k.charCodeAt(j--);$<128?U[--B]=$:$>127&&$<2048?(U[--B]=63&$|128,U[--B]=$>>6|192):(U[--B]=63&$|128,U[--B]=$>>6&63|128,U[--B]=$>>12|224)}U[--B]=0;for(var V=new St,J=new Array;B>2;){for(J[0]=0;J[0]==0;)V.nextBytes(J);U[--B]=J[0]}return U[--B]=2,U[--B]=0,new x(U)}(i,this.n.bitLength()+7>>3);if(u==null)return null;var l=this.doPublic(u);if(l==null)return null;var v=l.toString(16);return 1&v.length?"0"+v:v},me.prototype.encryptOAEP=function(i,u,l){var v=function(U,j,$,V){var J=M.crypto.MessageDigest,X=M.crypto.Util,ee=null;if($||($="sha1"),typeof $=="string"&&(ee=J.getCanonicalAlgName($),V=J.getHashLength(ee),$=function(ce){return Kt(X.hashHex(cn(ce),ee))}),U.length+2*V+2>j)throw"Message too long for RSA";var ne,re="";for(ne=0;ne<j-U.length-2*V-2;ne+=1)re+="\0";var C=$("")+re+""+U,K=new Array(V);new St().nextBytes(K);var W=Ht(K,C.length,$),z=[];for(ne=0;ne<C.length;ne+=1)z[ne]=C.charCodeAt(ne)^W.charCodeAt(ne);var te=Ht(z,K.length,$),ie=[0];for(ne=0;ne<K.length;ne+=1)ie[ne+1]=K[ne]^te.charCodeAt(ne);return new x(ie.concat(z))}(i,this.n.bitLength()+7>>3,u,l);if(v==null)return null;var y=this.doPublic(v);if(y==null)return null;var k=y.toString(16);return 1&k.length?"0"+k:k},me.prototype.type="RSA",Ve.prototype.equals=function(i){return i==this||this.q.equals(i.q)&&this.x.equals(i.x)},Ve.prototype.toBigInteger=function(){return this.x},Ve.prototype.negate=function(){return new Ve(this.q,this.x.negate().mod(this.q))},Ve.prototype.add=function(i){return new Ve(this.q,this.x.add(i.toBigInteger()).mod(this.q))},Ve.prototype.subtract=function(i){return new Ve(this.q,this.x.subtract(i.toBigInteger()).mod(this.q))},Ve.prototype.multiply=function(i){return new Ve(this.q,this.x.multiply(i.toBigInteger()).mod(this.q))},Ve.prototype.square=function(){return new Ve(this.q,this.x.square().mod(this.q))},Ve.prototype.divide=function(i){return new Ve(this.q,this.x.multiply(i.toBigInteger().modInverse(this.q)).mod(this.q))},Re.prototype.getX=function(){return this.zinv==null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))},Re.prototype.getY=function(){return this.zinv==null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))},Re.prototype.equals=function(i){return i==this||(this.isInfinity()?i.isInfinity():i.isInfinity()?this.isInfinity():!!i.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(i.z)).mod(this.curve.q).equals(x.ZERO)&&i.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(i.z)).mod(this.curve.q).equals(x.ZERO))},Re.prototype.isInfinity=function(){return this.x==null&&this.y==null||this.z.equals(x.ZERO)&&!this.y.toBigInteger().equals(x.ZERO)},Re.prototype.negate=function(){return new Re(this.curve,this.x,this.y.negate(),this.z)},Re.prototype.add=function(i){if(this.isInfinity())return i;if(i.isInfinity())return this;var u=i.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(i.z)).mod(this.curve.q),l=i.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(i.z)).mod(this.curve.q);if(x.ZERO.equals(l))return x.ZERO.equals(u)?this.twice():this.curve.getInfinity();var v=new x("3"),y=this.x.toBigInteger(),k=this.y.toBigInteger(),B=(i.x.toBigInteger(),i.y.toBigInteger(),l.square()),U=B.multiply(l),j=y.multiply(B),$=u.square().multiply(this.z),V=$.subtract(j.shiftLeft(1)).multiply(i.z).subtract(U).multiply(l).mod(this.curve.q),J=j.multiply(v).multiply(u).subtract(k.multiply(U)).subtract($.multiply(u)).multiply(i.z).add(u.multiply(U)).mod(this.curve.q),X=U.multiply(this.z).multiply(i.z).mod(this.curve.q);return new Re(this.curve,this.curve.fromBigInteger(V),this.curve.fromBigInteger(J),X)},Re.prototype.twice=function(){if(this.isInfinity())return this;if(this.y.toBigInteger().signum()==0)return this.curve.getInfinity();var i=new x("3"),u=this.x.toBigInteger(),l=this.y.toBigInteger(),v=l.multiply(this.z),y=v.multiply(l).mod(this.curve.q),k=this.curve.a.toBigInteger(),B=u.square().multiply(i);x.ZERO.equals(k)||(B=B.add(this.z.square().multiply(k)));var U=(B=B.mod(this.curve.q)).square().subtract(u.shiftLeft(3).multiply(y)).shiftLeft(1).multiply(v).mod(this.curve.q),j=B.multiply(i).multiply(u).subtract(y.shiftLeft(1)).shiftLeft(2).multiply(y).subtract(B.square().multiply(B)).mod(this.curve.q),$=v.square().multiply(v).shiftLeft(3).mod(this.curve.q);return new Re(this.curve,this.curve.fromBigInteger(U),this.curve.fromBigInteger(j),$)},Re.prototype.multiply=function(i){if(this.isInfinity())return this;if(i.signum()==0)return this.curve.getInfinity();var u,l=i,v=l.multiply(new x("3")),y=this.negate(),k=this,B=this.curve.q.subtract(i),U=B.multiply(new x("3")),j=new Re(this.curve,this.x,this.y),$=j.negate();for(u=v.bitLength()-2;u>0;--u){k=k.twice();var V=v.testBit(u);V!=l.testBit(u)&&(k=k.add(V?this:y))}for(u=U.bitLength()-2;u>0;--u){j=j.twice();var J=U.testBit(u);J!=B.testBit(u)&&(j=j.add(J?j:$))}return k},Re.prototype.multiplyTwo=function(i,u,l){var v;v=i.bitLength()>l.bitLength()?i.bitLength()-1:l.bitLength()-1;for(var y=this.curve.getInfinity(),k=this.add(u);v>=0;)y=y.twice(),i.testBit(v)?y=l.testBit(v)?y.add(k):y.add(this):l.testBit(v)&&(y=y.add(u)),--v;return y},un.prototype.getQ=function(){return this.q},un.prototype.getA=function(){return this.a},un.prototype.getB=function(){return this.b},un.prototype.equals=function(i){return i==this||this.q.equals(i.q)&&this.a.equals(i.a)&&this.b.equals(i.b)},un.prototype.getInfinity=function(){return this.infinity},un.prototype.fromBigInteger=function(i){return new Ve(this.q,i)},un.prototype.decodePointHex=function(i){switch(parseInt(i.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:return null;case 4:case 6:case 7:var u=(i.length-2)/2,l=i.substr(2,u),v=i.substr(u+2,u);return new Re(this,this.fromBigInteger(new x(l,16)),this.fromBigInteger(new x(v,16)));default:return null}},Ve.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},Re.prototype.getEncoded=function(o){var i=function(k,B){var U=k.toByteArrayUnsigned();if(B<U.length)U=U.slice(U.length-B);else for(;B>U.length;)U.unshift(0);return U},u=this.getX().toBigInteger(),l=this.getY().toBigInteger(),v=i(u,32);return o?l.isEven()?v.unshift(2):v.unshift(3):(v.unshift(4),v=v.concat(i(l,32))),v},Re.decodeFrom=function(o,i){i[0];var u=i.length-1,l=i.slice(1,1+u/2),v=i.slice(1+u/2,1+u);l.unshift(0),v.unshift(0);var y=new x(l),k=new x(v);return new Re(o,o.fromBigInteger(y),o.fromBigInteger(k))},Re.decodeFromHex=function(o,i){i.substr(0,2);var u=i.length-2,l=i.substr(2,u/2),v=i.substr(2+u/2,u/2),y=new x(l,16),k=new x(v,16);return new Re(o,o.fromBigInteger(y),o.fromBigInteger(k))},Re.prototype.add2D=function(o){if(this.isInfinity())return o;if(o.isInfinity())return this;if(this.x.equals(o.x))return this.y.equals(o.y)?this.twice():this.curve.getInfinity();var i=o.x.subtract(this.x),u=o.y.subtract(this.y).divide(i),l=u.square().subtract(this.x).subtract(o.x),v=u.multiply(this.x.subtract(l)).subtract(this.y);return new Re(this.curve,l,v)},Re.prototype.twice2D=function(){if(this.isInfinity())return this;if(this.y.toBigInteger().signum()==0)return this.curve.getInfinity();var o=this.curve.fromBigInteger(x.valueOf(2)),i=this.curve.fromBigInteger(x.valueOf(3)),u=this.x.square().multiply(i).add(this.curve.a).divide(this.y.multiply(o)),l=u.square().subtract(this.x.multiply(o)),v=u.multiply(this.x.subtract(l)).subtract(this.y);return new Re(this.curve,l,v)},Re.prototype.multiply2D=function(o){if(this.isInfinity())return this;if(o.signum()==0)return this.curve.getInfinity();var i,u=o,l=u.multiply(new x("3")),v=this.negate(),y=this;for(i=l.bitLength()-2;i>0;--i){y=y.twice();var k=l.testBit(i);k!=u.testBit(i)&&(y=y.add2D(k?this:v))}return y},Re.prototype.isOnCurve=function(){var o=this.getX().toBigInteger(),i=this.getY().toBigInteger(),u=this.curve.getA().toBigInteger(),l=this.curve.getB().toBigInteger(),v=this.curve.getQ(),y=i.multiply(i).mod(v),k=o.multiply(o).multiply(o).add(u.multiply(o)).add(l).mod(v);return y.equals(k)},Re.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},Re.prototype.validate=function(){var o=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var i=this.getX().toBigInteger(),u=this.getY().toBigInteger();if(i.compareTo(x.ONE)<0||i.compareTo(o.subtract(x.ONE))>0)throw new Error("x coordinate out of bounds");if(u.compareTo(x.ONE)<0||u.compareTo(o.subtract(x.ONE))>0)throw new Error("y coordinate out of bounds");if(!this.isOnCurve())throw new Error("Point is not on the curve.");if(this.multiply(o).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0};/*! Mike Samuel (c) 2009 | code.google.com/p/json-sans-eval
22
+ */var ni=function(){var o=new RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)|(?:"(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))*"))',"g"),i=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),u={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:`
23
+ `,r:"\r",t:" "};function l(k,B,U){return B?u[B]:String.fromCharCode(parseInt(U,16))}var v=new String(""),y=Object.hasOwnProperty;return function(k,B){var U,j,$=k.match(o),V=$[0],J=!1;V==="{"?U={}:V==="["?U=[]:(U=[],J=!0);for(var X=[U],ee=1-J,ne=$.length;ee<ne;++ee){var re;switch((V=$[ee]).charCodeAt(0)){default:(re=X[0])[j||re.length]=+V,j=void 0;break;case 34:if((V=V.substring(1,V.length-1)).indexOf("\\")!==-1&&(V=V.replace(i,l)),re=X[0],!j){if(!(re instanceof Array)){j=V||v;break}j=re.length}re[j]=V,j=void 0;break;case 91:re=X[0],X.unshift(re[j||re.length]=[]),j=void 0;break;case 93:X.shift();break;case 102:(re=X[0])[j||re.length]=!1,j=void 0;break;case 110:(re=X[0])[j||re.length]=null,j=void 0;break;case 116:(re=X[0])[j||re.length]=!0,j=void 0;break;case 123:re=X[0],X.unshift(re[j||re.length]={}),j=void 0;break;case 125:X.shift()}}if(J){if(X.length!==1)throw new Error;U=U[0]}else if(X.length)throw new Error;return B&&(U=function C(K,W){var z=K[W];if(z&&(z===void 0?"undefined":c(z))==="object"){var te=null;for(var ie in z)if(y.call(z,ie)&&z!==K){var ge=C(z,ie);ge!==void 0?z[ie]=ge:(te||(te=[]),te.push(ie))}if(te)for(var ce=te.length;--ce>=0;)delete z[te[ce]]}return B.call(K,W,z)}({"":U},"")),U}}();M!==void 0&&M||(r.KJUR=M={}),M.asn1!==void 0&&M.asn1||(M.asn1={}),M.asn1.ASN1Util=new function(){this.integerToByteHex=function(o){var i=o.toString(16);return i.length%2==1&&(i="0"+i),i},this.bigIntToMinTwosComplementsHex=function(o){var i=o.toString(16);if(i.substr(0,1)!="-")i.length%2==1?i="0"+i:i.match(/^[0-7]/)||(i="00"+i);else{var u=i.substr(1).length;u%2==1?u+=1:i.match(/^[0-7]/)||(u+=2);for(var l="",v=0;v<u;v++)l+="f";i=new x(l,16).xor(o).add(x.ONE).toString(16).replace(/^-/,"")}return i},this.getPEMStringFromHex=function(o,i){return Ut(o,i)},this.newObject=function(o){var i=M.asn1,u=i.ASN1Object,l=i.DERBoolean,v=i.DERInteger,y=i.DERBitString,k=i.DEROctetString,B=i.DERNull,U=i.DERObjectIdentifier,j=i.DEREnumerated,$=i.DERUTF8String,V=i.DERNumericString,J=i.DERPrintableString,X=i.DERTeletexString,ee=i.DERIA5String,ne=i.DERUTCTime,re=i.DERGeneralizedTime,C=i.DERVisibleString,K=i.DERBMPString,W=i.DERSequence,z=i.DERSet,te=i.DERTaggedObject,ie=i.ASN1Util.newObject;if(o instanceof i.ASN1Object)return o;var ge=Object.keys(o);if(ge.length!=1)throw new Error("key of param shall be only one.");var ce=ge[0];if(":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+ce+":")==-1)throw new Error("undefined key: "+ce);if(ce=="bool")return new l(o[ce]);if(ce=="int")return new v(o[ce]);if(ce=="bitstr")return new y(o[ce]);if(ce=="octstr")return new k(o[ce]);if(ce=="null")return new B(o[ce]);if(ce=="oid")return new U(o[ce]);if(ce=="enum")return new j(o[ce]);if(ce=="utf8str")return new $(o[ce]);if(ce=="numstr")return new V(o[ce]);if(ce=="prnstr")return new J(o[ce]);if(ce=="telstr")return new X(o[ce]);if(ce=="ia5str")return new ee(o[ce]);if(ce=="utctime")return new ne(o[ce]);if(ce=="gentime")return new re(o[ce]);if(ce=="visstr")return new C(o[ce]);if(ce=="bmpstr")return new K(o[ce]);if(ce=="asn1")return new u(o[ce]);if(ce=="seq"){for(var Ce=o[ce],de=[],ye=0;ye<Ce.length;ye++){var qe=ie(Ce[ye]);de.push(qe)}return new W({array:de})}if(ce=="set"){for(Ce=o[ce],de=[],ye=0;ye<Ce.length;ye++)qe=ie(Ce[ye]),de.push(qe);return new z({array:de})}if(ce=="tag"){var Xe=o[ce];if(Object.prototype.toString.call(Xe)==="[object Array]"&&Xe.length==3){var ze=ie(Xe[2]);return new te({tag:Xe[0],explicit:Xe[1],obj:ze})}return new te(Xe)}},this.jsonToASN1HEX=function(o){return this.newObject(o).getEncodedHex()}},M.asn1.ASN1Util.oidHexToInt=function(o){for(var i="",u=parseInt(o.substr(0,2),16),l=(i=Math.floor(u/40)+"."+u%40,""),v=2;v<o.length;v+=2){var y=("00000000"+parseInt(o.substr(v,2),16).toString(2)).slice(-8);l+=y.substr(1,7),y.substr(0,1)=="0"&&(i=i+"."+new x(l,2).toString(10),l="")}return i},M.asn1.ASN1Util.oidIntToHex=function(o){var i=function(U){var j=U.toString(16);return j.length==1&&(j="0"+j),j},u=function(U){var j="",$=new x(U,10).toString(2),V=7-$.length%7;V==7&&(V=0);for(var J="",X=0;X<V;X++)J+="0";for($=J+$,X=0;X<$.length-1;X+=7){var ee=$.substr(X,7);X!=$.length-7&&(ee="1"+ee),j+=i(parseInt(ee,2))}return j};if(!o.match(/^[0-9.]+$/))throw"malformed oid string: "+o;var l="",v=o.split("."),y=40*parseInt(v[0])+parseInt(v[1]);l+=i(y),v.splice(0,2);for(var k=0;k<v.length;k++)l+=u(v[k]);return l},M.asn1.ASN1Object=function(o){this.params=null,this.getLengthHexFromValue=function(){if(this.hV===void 0||this.hV==null)throw new Error("this.hV is null or undefined");if(this.hV.length%2==1)throw new Error("value hex must be even length: n=0,v="+this.hV);var i=this.hV.length/2,u=i.toString(16);if(u.length%2==1&&(u="0"+u),i<128)return u;var l=u.length/2;if(l>15)throw"ASN.1 length too long to represent by 8x: n = "+i.toString(16);return(128+l).toString(16)+u},this.getEncodedHex=function(){return(this.hTLV==null||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""},this.setByParam=function(i){this.params=i},o!=null&&o.tlv!=null&&(this.hTLV=o.tlv,this.isModified=!1)},M.asn1.DERAbstractString=function(o){M.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(i){this.hTLV=null,this.isModified=!0,this.s=i,this.hV=Ji(this.s).toLowerCase()},this.setStringHex=function(i){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=i},this.getFreshValueHex=function(){return this.hV},o!==void 0&&(typeof o=="string"?this.setString(o):o.str!==void 0?this.setString(o.str):o.hex!==void 0&&this.setStringHex(o.hex))},f.lang.extend(M.asn1.DERAbstractString,M.asn1.ASN1Object),M.asn1.DERAbstractTime=function(o){M.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(i){var u=i.getTime()+6e4*i.getTimezoneOffset();return new Date(u)},this.formatDate=function(i,u,l){var v=this.zeroPadding,y=this.localDateToUTC(i),k=String(y.getFullYear());u=="utc"&&(k=k.substr(2,2));var B=k+v(String(y.getMonth()+1),2)+v(String(y.getDate()),2)+v(String(y.getHours()),2)+v(String(y.getMinutes()),2)+v(String(y.getSeconds()),2);if(l===!0){var U=y.getMilliseconds();if(U!=0){var j=v(String(U),3);B=B+"."+(j=j.replace(/[0]+$/,""))}}return B+"Z"},this.zeroPadding=function(i,u){return i.length>=u?i:new Array(u-i.length+1).join("0")+i},this.getString=function(){return this.s},this.setString=function(i){this.hTLV=null,this.isModified=!0,this.s=i,this.hV=he(i)},this.setByDateValue=function(i,u,l,v,y,k){var B=new Date(Date.UTC(i,u-1,l,v,y,k,0));this.setByDate(B)},this.getFreshValueHex=function(){return this.hV}},f.lang.extend(M.asn1.DERAbstractTime,M.asn1.ASN1Object),M.asn1.DERAbstractStructured=function(o){M.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(i){this.hTLV=null,this.isModified=!0,this.asn1Array=i},this.appendASN1Object=function(i){this.hTLV=null,this.isModified=!0,this.asn1Array.push(i)},this.asn1Array=new Array,o!==void 0&&o.array!==void 0&&(this.asn1Array=o.array)},f.lang.extend(M.asn1.DERAbstractStructured,M.asn1.ASN1Object),M.asn1.DERBoolean=function(o){M.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=o==0?"010100":"0101ff"},f.lang.extend(M.asn1.DERBoolean,M.asn1.ASN1Object),M.asn1.DERInteger=function(o){M.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(i){this.hTLV=null,this.isModified=!0,this.hV=M.asn1.ASN1Util.bigIntToMinTwosComplementsHex(i)},this.setByInteger=function(i){var u=new x(String(i),10);this.setByBigInteger(u)},this.setValueHex=function(i){this.hV=i},this.getFreshValueHex=function(){return this.hV},o!==void 0&&(o.bigint!==void 0?this.setByBigInteger(o.bigint):o.int!==void 0?this.setByInteger(o.int):typeof o=="number"?this.setByInteger(o):o.hex!==void 0&&this.setValueHex(o.hex))},f.lang.extend(M.asn1.DERInteger,M.asn1.ASN1Object),M.asn1.DERBitString=function(o){if(o!==void 0&&o.obj!==void 0){var i=M.asn1.ASN1Util.newObject(o.obj);o.hex="00"+i.getEncodedHex()}M.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(u){this.hTLV=null,this.isModified=!0,this.hV=u},this.setUnusedBitsAndHexValue=function(u,l){if(u<0||7<u)throw"unused bits shall be from 0 to 7: u = "+u;var v="0"+u;this.hTLV=null,this.isModified=!0,this.hV=v+l},this.setByBinaryString=function(u){var l=8-(u=u.replace(/0+$/,"")).length%8;l==8&&(l=0);for(var v=0;v<=l;v++)u+="0";var y="";for(v=0;v<u.length-1;v+=8){var k=u.substr(v,8),B=parseInt(k,2).toString(16);B.length==1&&(B="0"+B),y+=B}this.hTLV=null,this.isModified=!0,this.hV="0"+l+y},this.setByBooleanArray=function(u){for(var l="",v=0;v<u.length;v++)u[v]==1?l+="1":l+="0";this.setByBinaryString(l)},this.newFalseArray=function(u){for(var l=new Array(u),v=0;v<u;v++)l[v]=!1;return l},this.getFreshValueHex=function(){return this.hV},o!==void 0&&(typeof o=="string"&&o.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(o):o.hex!==void 0?this.setHexValueIncludingUnusedBits(o.hex):o.bin!==void 0?this.setByBinaryString(o.bin):o.array!==void 0&&this.setByBooleanArray(o.array))},f.lang.extend(M.asn1.DERBitString,M.asn1.ASN1Object),M.asn1.DEROctetString=function(o){if(o!==void 0&&o.obj!==void 0){var i=M.asn1.ASN1Util.newObject(o.obj);o.hex=i.getEncodedHex()}M.asn1.DEROctetString.superclass.constructor.call(this,o),this.hT="04"},f.lang.extend(M.asn1.DEROctetString,M.asn1.DERAbstractString),M.asn1.DERNull=function(){M.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},f.lang.extend(M.asn1.DERNull,M.asn1.ASN1Object),M.asn1.DERObjectIdentifier=function(o){M.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(i){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=i},this.setValueOidString=function(i){var u=function(v){var y=function(J){var X=J.toString(16);return X.length==1&&(X="0"+X),X},k=function(J){var X="",ee=parseInt(J,10).toString(2),ne=7-ee.length%7;ne==7&&(ne=0);for(var re="",C=0;C<ne;C++)re+="0";for(ee=re+ee,C=0;C<ee.length-1;C+=7){var K=ee.substr(C,7);C!=ee.length-7&&(K="1"+K),X+=y(parseInt(K,2))}return X};try{if(!v.match(/^[0-9.]+$/))return null;var B="",U=v.split("."),j=40*parseInt(U[0],10)+parseInt(U[1],10);B+=y(j),U.splice(0,2);for(var $=0;$<U.length;$++)B+=k(U[$]);return B}catch{return null}}(i);if(u==null)throw new Error("malformed oid string: "+i);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=u},this.setValueName=function(i){var u=M.asn1.x509.OID.name2oid(i);if(u==="")throw new Error("DERObjectIdentifier oidName undefined: "+i);this.setValueOidString(u)},this.setValueNameOrOid=function(i){i.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(i):this.setValueName(i)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(i){typeof i=="string"?this.setValueNameOrOid(i):i.oid!==void 0?this.setValueNameOrOid(i.oid):i.name!==void 0?this.setValueNameOrOid(i.name):i.hex!==void 0&&this.setValueHex(i.hex)},o!==void 0&&this.setByParam(o)},f.lang.extend(M.asn1.DERObjectIdentifier,M.asn1.ASN1Object),M.asn1.DEREnumerated=function(o){M.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(i){this.hTLV=null,this.isModified=!0,this.hV=M.asn1.ASN1Util.bigIntToMinTwosComplementsHex(i)},this.setByInteger=function(i){var u=new x(String(i),10);this.setByBigInteger(u)},this.setValueHex=function(i){this.hV=i},this.getFreshValueHex=function(){return this.hV},o!==void 0&&(o.int!==void 0?this.setByInteger(o.int):typeof o=="number"?this.setByInteger(o):o.hex!==void 0&&this.setValueHex(o.hex))},f.lang.extend(M.asn1.DEREnumerated,M.asn1.ASN1Object),M.asn1.DERUTF8String=function(o){M.asn1.DERUTF8String.superclass.constructor.call(this,o),this.hT="0c"},f.lang.extend(M.asn1.DERUTF8String,M.asn1.DERAbstractString),M.asn1.DERNumericString=function(o){M.asn1.DERNumericString.superclass.constructor.call(this,o),this.hT="12"},f.lang.extend(M.asn1.DERNumericString,M.asn1.DERAbstractString),M.asn1.DERPrintableString=function(o){M.asn1.DERPrintableString.superclass.constructor.call(this,o),this.hT="13"},f.lang.extend(M.asn1.DERPrintableString,M.asn1.DERAbstractString),M.asn1.DERTeletexString=function(o){M.asn1.DERTeletexString.superclass.constructor.call(this,o),this.hT="14"},f.lang.extend(M.asn1.DERTeletexString,M.asn1.DERAbstractString),M.asn1.DERIA5String=function(o){M.asn1.DERIA5String.superclass.constructor.call(this,o),this.hT="16"},f.lang.extend(M.asn1.DERIA5String,M.asn1.DERAbstractString),M.asn1.DERVisibleString=function(o){M.asn1.DERIA5String.superclass.constructor.call(this,o),this.hT="1a"},f.lang.extend(M.asn1.DERVisibleString,M.asn1.DERAbstractString),M.asn1.DERBMPString=function(o){M.asn1.DERBMPString.superclass.constructor.call(this,o),this.hT="1e"},f.lang.extend(M.asn1.DERBMPString,M.asn1.DERAbstractString),M.asn1.DERUTCTime=function(o){M.asn1.DERUTCTime.superclass.constructor.call(this,o),this.hT="17",this.setByDate=function(i){this.hTLV=null,this.isModified=!0,this.date=i,this.s=this.formatDate(this.date,"utc"),this.hV=he(this.s)},this.getFreshValueHex=function(){return this.date===void 0&&this.s===void 0&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=he(this.s)),this.hV},o!==void 0&&(o.str!==void 0?this.setString(o.str):typeof o=="string"&&o.match(/^[0-9]{12}Z$/)?this.setString(o):o.hex!==void 0?this.setStringHex(o.hex):o.date!==void 0&&this.setByDate(o.date))},f.lang.extend(M.asn1.DERUTCTime,M.asn1.DERAbstractTime),M.asn1.DERGeneralizedTime=function(o){M.asn1.DERGeneralizedTime.superclass.constructor.call(this,o),this.hT="18",this.withMillis=!1,this.setByDate=function(i){this.hTLV=null,this.isModified=!0,this.date=i,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=he(this.s)},this.getFreshValueHex=function(){return this.date===void 0&&this.s===void 0&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=he(this.s)),this.hV},o!==void 0&&(o.str!==void 0?this.setString(o.str):typeof o=="string"&&o.match(/^[0-9]{14}Z$/)?this.setString(o):o.hex!==void 0?this.setStringHex(o.hex):o.date!==void 0&&this.setByDate(o.date),o.millis===!0&&(this.withMillis=!0))},f.lang.extend(M.asn1.DERGeneralizedTime,M.asn1.DERAbstractTime),M.asn1.DERSequence=function(o){M.asn1.DERSequence.superclass.constructor.call(this,o),this.hT="30",this.getFreshValueHex=function(){for(var i="",u=0;u<this.asn1Array.length;u++)i+=this.asn1Array[u].getEncodedHex();return this.hV=i,this.hV}},f.lang.extend(M.asn1.DERSequence,M.asn1.DERAbstractStructured),M.asn1.DERSet=function(o){M.asn1.DERSet.superclass.constructor.call(this,o),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var i=new Array,u=0;u<this.asn1Array.length;u++){var l=this.asn1Array[u];i.push(l.getEncodedHex())}return this.sortFlag==1&&i.sort(),this.hV=i.join(""),this.hV},o!==void 0&&o.sortflag!==void 0&&o.sortflag==0&&(this.sortFlag=!1)},f.lang.extend(M.asn1.DERSet,M.asn1.DERAbstractStructured),M.asn1.DERTaggedObject=function(o){M.asn1.DERTaggedObject.superclass.constructor.call(this);var i=M.asn1;this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(u,l,v){this.hT=l,this.isExplicit=u,this.asn1Object=v,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=v.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,l),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(u){u.tag!=null&&(this.hT=u.tag),u.explicit!=null&&(this.isExplicit=u.explicit),u.tage!=null&&(this.hT=u.tage,this.isExplicit=!0),u.tagi!=null&&(this.hT=u.tagi,this.isExplicit=!1),u.obj!=null&&(u.obj instanceof i.ASN1Object?(this.asn1Object=u.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)):c(u.obj)=="object"&&(this.asn1Object=i.ASN1Util.newObject(u.obj),this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},o!=null&&this.setByParam(o)},f.lang.extend(M.asn1.DERTaggedObject,M.asn1.ASN1Object);var M,Bn,$t,fe=new function(){};function ri(o){for(var i=new Array,u=0;u<o.length;u++)i[u]=o.charCodeAt(u);return i}function oe(o){for(var i="",u=0;u<o.length;u++)i+=String.fromCharCode(o[u]);return i}function ae(o){for(var i="",u=0;u<o.length;u++){var l=o[u].toString(16);l.length==1&&(l="0"+l),i+=l}return i}function he(o){return ae(ri(o))}function We(o){return o=(o=(o=o.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function gt(o){return o.length%4==2?o+="==":o.length%4==3&&(o+="="),o=(o=o.replace(/-/g,"+")).replace(/_/g,"/")}function Ze(o){return o.length%2==1&&(o="0"+o),We(D(o))}function Je(o){return H(gt(o))}function Ji(o){return ii(si(o))}function Pt(o){return decodeURIComponent(oi(o))}function Kt(o){for(var i="",u=0;u<o.length-1;u+=2)i+=String.fromCharCode(parseInt(o.substr(u,2),16));return i}function cn(o){for(var i="",u=0;u<o.length;u++)i+=("0"+o.charCodeAt(u).toString(16)).slice(-2);return i}function Ms(o){return D(o)}function Us(o){var i=Ms(o).replace(/(.{64})/g,`$1\r
24
+ `);return i=i.replace(/\r\n$/,"")}function xs(o){return H(o.replace(/[^0-9A-Za-z\/+=]*/g,""))}function Ut(o,i){return"-----BEGIN "+i+`-----\r
25
+ `+Us(o)+`\r
26
+ -----END `+i+`-----\r
27
+ `}function ln(o,i){if(o.indexOf("-----BEGIN ")==-1)throw"can't find PEM header: "+i;return xs(o=i!==void 0?(o=o.replace(new RegExp("^[^]*-----BEGIN "+i+"-----"),"")).replace(new RegExp("-----END "+i+"-----[^]*$"),""):(o=o.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function zi(o){var i,u,l,v,y,k,B,U,j,$,V;if(V=o.match(/^(\d{2}|\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/))return U=V[1],i=parseInt(U),U.length===2&&(50<=i&&i<100?i=1900+i:0<=i&&i<50&&(i=2e3+i)),u=parseInt(V[2])-1,l=parseInt(V[3]),v=parseInt(V[4]),y=parseInt(V[5]),k=parseInt(V[6]),B=0,(j=V[7])!==""&&($=(j.substr(1)+"00").substr(0,3),B=parseInt($)),Date.UTC(i,u,l,v,y,k,B);throw"unsupported zulu format: "+o}function js(o){return~~(zi(o)/1e3)}function ii(o){return o.replace(/%/g,"")}function oi(o){return o.replace(/(..)/g,"%$1")}function Bs(o){var i="malformed IPv6 address";if(!o.match(/^[0-9A-Fa-f:]+$/))throw i;var u=(o=o.toLowerCase()).split(":").length-1;if(u<2)throw i;var l=":".repeat(7-u+2),v=(o=o.replace("::",l)).split(":");if(v.length!=8)throw i;for(var y=0;y<8;y++)v[y]=("0000"+v[y]).slice(-4);return v.join("")}function Hs(o){if(!o.match(/^[0-9A-Fa-f]{32}$/))throw"malformed IPv6 address octet";for(var i=(o=o.toLowerCase()).match(/.{1,4}/g),u=0;u<8;u++)i[u]=i[u].replace(/^0+/,""),i[u]==""&&(i[u]="0");var l=(o=":"+i.join(":")+":").match(/:(0:){2,}/g);if(l===null)return o.slice(1,-1);var v="";for(u=0;u<l.length;u++)l[u].length>v.length&&(v=l[u]);return(o=o.replace(v,"::")).slice(1,-1)}function Yi(o){var i="malformed hex value";if(!o.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw i;if(o.length!=8)return o.length==32?Hs(o):o;try{return parseInt(o.substr(0,2),16)+"."+parseInt(o.substr(2,2),16)+"."+parseInt(o.substr(4,2),16)+"."+parseInt(o.substr(6,2),16)}catch{throw i}}function si(o){for(var i=encodeURIComponent(o),u="",l=0;l<i.length;l++)i[l]=="%"?(u+=i.substr(l,3),l+=2):u=u+"%"+he(i[l]);return u}function $s(o){return!(o.length%2!=0||!o.match(/^[0-9a-f]+$/)&&!o.match(/^[0-9A-F]+$/))}function Gi(o){return o.length%2==1?"0"+o:o.substr(0,1)>"7"?"00"+o:o}fe.getLblen=function(o,i){if(o.substr(i+2,1)!="8")return 1;var u=parseInt(o.substr(i+3,1));return u==0?-1:0<u&&u<10?u+1:-2},fe.getL=function(o,i){var u=fe.getLblen(o,i);return u<1?"":o.substr(i+2,2*u)},fe.getVblen=function(o,i){var u;return(u=fe.getL(o,i))==""?-1:(u.substr(0,1)==="8"?new x(u.substr(2),16):new x(u,16)).intValue()},fe.getVidx=function(o,i){var u=fe.getLblen(o,i);return u<0?u:i+2*(u+1)},fe.getV=function(o,i){var u=fe.getVidx(o,i),l=fe.getVblen(o,i);return o.substr(u,2*l)},fe.getTLV=function(o,i){return o.substr(i,2)+fe.getL(o,i)+fe.getV(o,i)},fe.getTLVblen=function(o,i){return 2+2*fe.getLblen(o,i)+2*fe.getVblen(o,i)},fe.getNextSiblingIdx=function(o,i){return fe.getVidx(o,i)+2*fe.getVblen(o,i)},fe.getChildIdx=function(o,i){var u,l,v,y=fe,k=[];u=y.getVidx(o,i),l=2*y.getVblen(o,i),o.substr(i,2)=="03"&&(u+=2,l-=2),v=0;for(var B=u;v<=l;){var U=y.getTLVblen(o,B);if((v+=U)<=l&&k.push(B),B+=U,v>=l)break}return k},fe.getNthChildIdx=function(o,i,u){return fe.getChildIdx(o,i)[u]},fe.getIdxbyList=function(o,i,u,l){var v,y,k=fe;return u.length==0?l!==void 0&&o.substr(i,2)!==l?-1:i:(v=u.shift())>=(y=k.getChildIdx(o,i)).length?-1:k.getIdxbyList(o,y[v],u,l)},fe.getIdxbyListEx=function(o,i,u,l){var v,y,k=fe;if(u.length==0)return l!==void 0&&o.substr(i,2)!==l?-1:i;v=u.shift(),y=k.getChildIdx(o,i);for(var B=0,U=0;U<y.length;U++){var j=o.substr(y[U],2);if(typeof v=="number"&&!k.isContextTag(j)&&B==v||typeof v=="string"&&k.isContextTag(j,v))return k.getIdxbyListEx(o,y[U],u,l);k.isContextTag(j)||B++}return-1},fe.getTLVbyList=function(o,i,u,l){var v=fe,y=v.getIdxbyList(o,i,u,l);return y==-1||y>=o.length?null:v.getTLV(o,y)},fe.getTLVbyListEx=function(o,i,u,l){var v=fe,y=v.getIdxbyListEx(o,i,u,l);return y==-1?null:v.getTLV(o,y)},fe.getVbyList=function(o,i,u,l,v){var y,k,B=fe;return(y=B.getIdxbyList(o,i,u,l))==-1||y>=o.length?null:(k=B.getV(o,y),v===!0&&(k=k.substr(2)),k)},fe.getVbyListEx=function(o,i,u,l,v){var y,k,B=fe;return(y=B.getIdxbyListEx(o,i,u,l))==-1?null:(k=B.getV(o,y),o.substr(y,2)=="03"&&v!==!1&&(k=k.substr(2)),k)},fe.getInt=function(o,i,u){u==null&&(u=-1);try{var l=o.substr(i,2);if(l!="02"&&l!="03")return u;var v=fe.getV(o,i);return l=="02"?parseInt(v,16):function(k){try{var B=k.substr(0,2);if(B=="00")return parseInt(k.substr(2),16);var U=parseInt(B,16),j=k.substr(2),$=parseInt(j,16).toString(2);return $=="0"&&($="00000000"),$=$.slice(0,0-U),parseInt($,2)}catch{return-1}}(v)}catch{return u}},fe.getOID=function(o,i,u){u==null&&(u=null);try{return o.substr(i,2)!="06"?u:function(v){if(!$s(v))return null;try{var y=[],k=v.substr(0,2),B=parseInt(k,16);y[0]=new String(Math.floor(B/40)),y[1]=new String(B%40);for(var U=v.substr(2),j=[],$=0;$<U.length/2;$++)j.push(parseInt(U.substr(2*$,2),16));var V=[],J="";for($=0;$<j.length;$++)128&j[$]?J+=Ks((127&j[$]).toString(2),7):(J+=Ks((127&j[$]).toString(2),7),V.push(new String(parseInt(J,2))),J="");var X=y.join(".");return V.length>0&&(X=X+"."+V.join(".")),X}catch{return null}}(fe.getV(o,i))}catch{return u}},fe.getOIDName=function(o,i,u){u==null&&(u=null);try{var l=fe.getOID(o,i,u);if(l==u)return u;var v=M.asn1.x509.OID.oid2name(l);return v==""?l:v}catch{return u}},fe.getString=function(o,i,u){u==null&&(u=null);try{return Kt(fe.getV(o,i))}catch{return u}},fe.hextooidstr=function(o){var i=function(J,X){return J.length>=X?J:new Array(X-J.length+1).join("0")+J},u=[],l=o.substr(0,2),v=parseInt(l,16);u[0]=new String(Math.floor(v/40)),u[1]=new String(v%40);for(var y=o.substr(2),k=[],B=0;B<y.length/2;B++)k.push(parseInt(y.substr(2*B,2),16));var U=[],j="";for(B=0;B<k.length;B++)128&k[B]?j+=i((127&k[B]).toString(2),7):(j+=i((127&k[B]).toString(2),7),U.push(new String(parseInt(j,2))),j="");var $=u.join(".");return U.length>0&&($=$+"."+U.join(".")),$},fe.dump=function(o,i,u,l){var v=fe,y=v.getV,k=v.dump,B=v.getChildIdx,U=o;o instanceof M.asn1.ASN1Object&&(U=o.getEncodedHex());var j=function(ce,Ce){return ce.length<=2*Ce?ce:ce.substr(0,Ce)+"..(total "+ce.length/2+"bytes).."+ce.substr(ce.length-Ce,Ce)};i===void 0&&(i={ommit_long_octet:32}),u===void 0&&(u=0),l===void 0&&(l="");var $,V=i.ommit_long_octet;if(($=U.substr(u,2))=="01")return(J=y(U,u))=="00"?l+`BOOLEAN FALSE
28
+ `:l+`BOOLEAN TRUE
29
+ `;if($=="02")return l+"INTEGER "+j(J=y(U,u),V)+`
30
+ `;if($=="03"){var J=y(U,u);if(v.isASN1HEX(J.substr(2))){var X=l+`BITSTRING, encapsulates
31
+ `;return X+=k(J.substr(2),i,0,l+" ")}return l+"BITSTRING "+j(J,V)+`
32
+ `}if($=="04")return J=y(U,u),v.isASN1HEX(J)?(X=l+`OCTETSTRING, encapsulates
33
+ `,X+=k(J,i,0,l+" ")):l+"OCTETSTRING "+j(J,V)+`
34
+ `;if($=="05")return l+`NULL
35
+ `;if($=="06"){var ee=y(U,u),ne=M.asn1.ASN1Util.oidHexToInt(ee),re=M.asn1.x509.OID.oid2name(ne),C=ne.replace(/\./g," ");return re!=""?l+"ObjectIdentifier "+re+" ("+C+`)
36
+ `:l+"ObjectIdentifier ("+C+`)
37
+ `}if($=="0a")return l+"ENUMERATED "+parseInt(y(U,u))+`
38
+ `;if($=="0c")return l+"UTF8String '"+Pt(y(U,u))+`'
39
+ `;if($=="13")return l+"PrintableString '"+Pt(y(U,u))+`'
40
+ `;if($=="14")return l+"TeletexString '"+Pt(y(U,u))+`'
41
+ `;if($=="16")return l+"IA5String '"+Pt(y(U,u))+`'
42
+ `;if($=="17")return l+"UTCTime "+Pt(y(U,u))+`
43
+ `;if($=="18")return l+"GeneralizedTime "+Pt(y(U,u))+`
44
+ `;if($=="1a")return l+"VisualString '"+Pt(y(U,u))+`'
45
+ `;if($=="1e")return l+"BMPString '"+Pt(y(U,u))+`'
46
+ `;if($=="30"){if(U.substr(u,4)=="3000")return l+`SEQUENCE {}
47
+ `;X=l+`SEQUENCE
48
+ `;var K=i;if(((te=B(U,u)).length==2||te.length==3)&&U.substr(te[0],2)=="06"&&U.substr(te[te.length-1],2)=="04"){re=v.oidname(y(U,te[0]));var W=JSON.parse(JSON.stringify(i));W.x509ExtName=re,K=W}for(var z=0;z<te.length;z++)X+=k(U,K,te[z],l+" ");return X}if($=="31"){X=l+`SET
49
+ `;var te=B(U,u);for(z=0;z<te.length;z++)X+=k(U,i,te[z],l+" ");return X}if(128&($=parseInt($,16))){var ie=31&$;if(32&$){for(X=l+"["+ie+`]
50
+ `,te=B(U,u),z=0;z<te.length;z++)X+=k(U,i,te[z],l+" ");return X}if(J=y(U,u),fe.isASN1HEX(J)){var X=l+"["+ie+`]
51
+ `;return X+=k(J,i,0,l+" ")}return(J.substr(0,8)=="68747470"||i.x509ExtName==="subjectAltName"&&ie==2)&&(J=Pt(J)),X=l+"["+ie+"] "+J+`
52
+ `}return l+"UNKNOWN("+$+") "+y(U,u)+`
53
+ `},fe.isContextTag=function(o,i){var u,l;o=o.toLowerCase();try{u=parseInt(o,16)}catch{return-1}if(i===void 0)return(192&u)==128;try{return i.match(/^\[[0-9]+\]$/)!=null&&!((l=parseInt(i.substr(1,i.length-1),10))>31)&&(192&u)==128&&(31&u)==l}catch{return!1}},fe.isASN1HEX=function(o){var i=fe;if(o.length%2==1)return!1;var u=i.getVblen(o,0),l=o.substr(0,2),v=i.getL(o,0);return o.length-l.length-v.length==2*u},fe.checkStrictDER=function(o,i,u,l,v){var y=fe;if(u===void 0){if(typeof o!="string")throw new Error("not hex string");if(o=o.toLowerCase(),!M.lang.String.isHex(o))throw new Error("not hex string");u=o.length,v=(l=o.length/2)<128?1:Math.ceil(l.toString(16))+1}if(y.getL(o,i).length>2*v)throw new Error("L of TLV too long: idx="+i);var k=y.getVblen(o,i);if(k>l)throw new Error("value of L too long than hex: idx="+i);var B=y.getTLV(o,i),U=B.length-2-y.getL(o,i).length;if(U!==2*k)throw new Error("V string length and L's value not the same:"+U+"/"+2*k);if(i===0&&o.length!=B.length)throw new Error("total length and TLV length unmatch:"+o.length+"!="+B.length);var j=o.substr(i,2);if(j==="02"){var $=y.getVidx(o,i);if(o.substr($,2)=="00"&&o.charCodeAt($+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(j,16)){for(var V=y.getVblen(o,i),J=0,X=y.getChildIdx(o,i),ee=0;ee<X.length;ee++)J+=y.getTLV(o,X[ee]).length,y.checkStrictDER(o,X[ee],u,l,v);if(2*V!=J)throw new Error("sum of children's TLV length and L unmatch: "+2*V+"!="+J)}},fe.oidname=function(o){var i=M.asn1;M.lang.String.isHex(o)&&(o=i.ASN1Util.oidHexToInt(o));var u=i.x509.OID.oid2name(o);return u===""&&(u=o),u},M!==void 0&&M||(r.KJUR=M={}),M.lang!==void 0&&M.lang||(M.lang={}),M.lang.String=function(){},typeof a=="function"?(r.utf8tob64u=Bn=function(i){return We(a.from(i,"utf8").toString("base64"))},r.b64utoutf8=$t=function(i){return a.from(gt(i),"base64").toString("utf8")}):(r.utf8tob64u=Bn=function(i){return Ze(ii(si(i)))},r.b64utoutf8=$t=function(i){return decodeURIComponent(oi(Je(i)))}),M.lang.String.isInteger=function(o){return!!o.match(/^[0-9]+$/)||!!o.match(/^-[0-9]+$/)},M.lang.String.isHex=function(o){return $s(o)},M.lang.String.isBase64=function(o){return!(!(o=o.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||o.length%4!=0)},M.lang.String.isBase64URL=function(o){return!o.match(/[+/=]/)&&(o=gt(o),M.lang.String.isBase64(o))},M.lang.String.isIntegerArray=function(o){return!!(o=o.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},M.lang.String.isPrintable=function(o){return o.match(/^[0-9A-Za-z '()+,-./:=?]*$/)!==null},M.lang.String.isIA5=function(o){return o.match(/^[\x20-\x21\x23-\x7f]*$/)!==null},M.lang.String.isMail=function(o){return o.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)!==null};var Ks=function(i,u,l){return l==null&&(l="0"),i.length>=u?i:new Array(u-i.length+1).join(l)+i};M!==void 0&&M||(r.KJUR=M={}),M.crypto!==void 0&&M.crypto||(M.crypto={}),M.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:O.algo.MD5,sha1:O.algo.SHA1,sha224:O.algo.SHA224,sha256:O.algo.SHA256,sha384:O.algo.SHA384,sha512:O.algo.SHA512,ripemd160:O.algo.RIPEMD160},this.getDigestInfoHex=function(o,i){if(this.DIGESTINFOHEAD[i]===void 0)throw"alg not supported in Util.DIGESTINFOHEAD: "+i;return this.DIGESTINFOHEAD[i]+o},this.getPaddedDigestInfoHex=function(o,i,u){var l=this.getDigestInfoHex(o,i),v=u/4;if(l.length+22>v)throw"key is too short for SigAlg: keylen="+u+","+i;for(var y="0001",k="00"+l,B="",U=v-y.length-k.length,j=0;j<U;j+=2)B+="ff";return y+B+k},this.hashString=function(o,i){return new M.crypto.MessageDigest({alg:i}).digestString(o)},this.hashHex=function(o,i){return new M.crypto.MessageDigest({alg:i}).digestHex(o)},this.sha1=function(o){return this.hashString(o,"sha1")},this.sha256=function(o){return this.hashString(o,"sha256")},this.sha256Hex=function(o){return this.hashHex(o,"sha256")},this.sha512=function(o){return this.hashString(o,"sha512")},this.sha512Hex=function(o){return this.hashHex(o,"sha512")},this.isKey=function(o){return o instanceof me||o instanceof M.crypto.DSA||o instanceof M.crypto.ECDSA}},M.crypto.Util.md5=function(o){return new M.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(o)},M.crypto.Util.ripemd160=function(o){return new M.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(o)},M.crypto.Util.SECURERANDOMGEN=new St,M.crypto.Util.getRandomHexOfNbytes=function(o){var i=new Array(o);return M.crypto.Util.SECURERANDOMGEN.nextBytes(i),ae(i)},M.crypto.Util.getRandomBigIntegerOfNbytes=function(o){return new x(M.crypto.Util.getRandomHexOfNbytes(o),16)},M.crypto.Util.getRandomHexOfNbits=function(o){var i=o%8,u=new Array((o-i)/8+1);return M.crypto.Util.SECURERANDOMGEN.nextBytes(u),u[0]=(255<<i&255^255)&u[0],ae(u)},M.crypto.Util.getRandomBigIntegerOfNbits=function(o){return new x(M.crypto.Util.getRandomHexOfNbits(o),16)},M.crypto.Util.getRandomBigIntegerZeroToMax=function(o){for(var i=o.bitLength();;){var u=M.crypto.Util.getRandomBigIntegerOfNbits(i);if(o.compareTo(u)!=-1)return u}},M.crypto.Util.getRandomBigIntegerMinToMax=function(o,i){var u=o.compareTo(i);if(u==1)throw"biMin is greater than biMax";if(u==0)return o;var l=i.subtract(o);return M.crypto.Util.getRandomBigIntegerZeroToMax(l).add(o)},M.crypto.MessageDigest=function(o){this.setAlgAndProvider=function(i,u){if((i=M.crypto.MessageDigest.getCanonicalAlgName(i))!==null&&u===void 0&&(u=M.crypto.Util.DEFAULTPROVIDER[i]),":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(i)!=-1&&u=="cryptojs"){try{this.md=M.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[i].create()}catch(l){throw"setAlgAndProvider hash alg set fail alg="+i+"/"+l}this.updateString=function(l){this.md.update(l)},this.updateHex=function(l){var v=O.enc.Hex.parse(l);this.md.update(v)},this.digest=function(){return this.md.finalize().toString(O.enc.Hex)},this.digestString=function(l){return this.updateString(l),this.digest()},this.digestHex=function(l){return this.updateHex(l),this.digest()}}if(":sha256:".indexOf(i)!=-1&&u=="sjcl"){try{this.md=new sjcl.hash.sha256}catch(l){throw"setAlgAndProvider hash alg set fail alg="+i+"/"+l}this.updateString=function(l){this.md.update(l)},this.updateHex=function(l){var v=sjcl.codec.hex.toBits(l);this.md.update(v)},this.digest=function(){var l=this.md.finalize();return sjcl.codec.hex.fromBits(l)},this.digestString=function(l){return this.updateString(l),this.digest()},this.digestHex=function(l){return this.updateHex(l),this.digest()}}},this.updateString=function(i){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(i){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(i){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(i){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},o!==void 0&&o.alg!==void 0&&(this.algName=o.alg,o.prov===void 0&&(this.provName=M.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},M.crypto.MessageDigest.getCanonicalAlgName=function(o){return typeof o=="string"&&(o=(o=o.toLowerCase()).replace(/-/,"")),o},M.crypto.MessageDigest.getHashLength=function(o){var i=M.crypto.MessageDigest,u=i.getCanonicalAlgName(o);if(i.HASHLENGTH[u]===void 0)throw"not supported algorithm: "+o;return i.HASHLENGTH[u]},M.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},M.crypto.Mac=function(o){this.setAlgAndProvider=function(i,u){if((i=i.toLowerCase())==null&&(i="hmacsha1"),(i=i.toLowerCase()).substr(0,4)!="hmac")throw"setAlgAndProvider unsupported HMAC alg: "+i;u===void 0&&(u=M.crypto.Util.DEFAULTPROVIDER[i]),this.algProv=i+"/"+u;var l=i.substr(4);if(":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(l)!=-1&&u=="cryptojs"){try{var v=M.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[l];this.mac=O.algo.HMAC.create(v,this.pass)}catch(y){throw"setAlgAndProvider hash alg set fail hashAlg="+l+"/"+y}this.updateString=function(y){this.mac.update(y)},this.updateHex=function(y){var k=O.enc.Hex.parse(y);this.mac.update(k)},this.doFinal=function(){return this.mac.finalize().toString(O.enc.Hex)},this.doFinalString=function(y){return this.updateString(y),this.doFinal()},this.doFinalHex=function(y){return this.updateHex(y),this.doFinal()}}},this.updateString=function(i){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(i){throw"updateHex(hex) not supported for this alg/prov: "+this.algProv},this.doFinal=function(){throw"digest() not supported for this alg/prov: "+this.algProv},this.doFinalString=function(i){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(i){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(i){if(typeof i=="string"){var u=i;return i.length%2!=1&&i.match(/^[0-9A-Fa-f]+$/)||(u=cn(i)),void(this.pass=O.enc.Hex.parse(u))}if((i===void 0?"undefined":c(i))!="object")throw"KJUR.crypto.Mac unsupported password type: "+i;if(u=null,i.hex!==void 0){if(i.hex.length%2!=0||!i.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+i.hex;u=i.hex}if(i.utf8!==void 0&&(u=Ji(i.utf8)),i.rstr!==void 0&&(u=cn(i.rstr)),i.b64!==void 0&&(u=H(i.b64)),i.b64u!==void 0&&(u=Je(i.b64u)),u==null)throw"KJUR.crypto.Mac unsupported password type: "+i;this.pass=O.enc.Hex.parse(u)},o!==void 0&&(o.pass!==void 0&&this.setPassword(o.pass),o.alg!==void 0&&(this.algName=o.alg,o.prov===void 0&&(this.provName=M.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},M.crypto.Signature=function(o){var i=null;if(this._setAlgNames=function(){var u=this.algName.match(/^(.+)with(.+)$/);u&&(this.mdAlgName=u[1].toLowerCase(),this.pubkeyAlgName=u[2].toLowerCase(),this.pubkeyAlgName=="rsaandmgf1"&&this.mdAlgName=="sha"&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(u,l){for(var v="",y=l/4-u.length,k=0;k<y;k++)v+="0";return v+u},this.setAlgAndProvider=function(u,l){if(this._setAlgNames(),l!="cryptojs/jsrsa")throw new Error("provider not supported: "+l);if(":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)!=-1){try{this.md=new M.crypto.MessageDigest({alg:this.mdAlgName})}catch(v){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+v)}this.init=function(v,y){var k=null;try{k=y===void 0?ut.getKey(v):ut.getKey(v,y)}catch(B){throw"init failed:"+B}if(k.isPrivate===!0)this.prvKey=k,this.state="SIGN";else{if(k.isPublic!==!0)throw"init failed.:"+k;this.pubKey=k,this.state="VERIFY"}},this.updateString=function(v){this.md.updateString(v)},this.updateHex=function(v){this.md.updateHex(v)},this.sign=function(){if(this.sHashHex=this.md.digest(),this.prvKey===void 0&&this.ecprvhex!==void 0&&this.eccurvename!==void 0&&M.crypto.ECDSA!==void 0&&(this.prvKey=new M.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof me&&this.pubkeyAlgName==="rsaandmgf1")this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof me&&this.pubkeyAlgName==="rsa")this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof M.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof M.crypto.DSA))throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(v){return this.updateString(v),this.sign()},this.signHex=function(v){return this.updateHex(v),this.sign()},this.verify=function(v){if(this.sHashHex=this.md.digest(),this.pubKey===void 0&&this.ecpubhex!==void 0&&this.eccurvename!==void 0&&M.crypto.ECDSA!==void 0&&(this.pubKey=new M.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof me&&this.pubkeyAlgName==="rsaandmgf1")return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,v,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof me&&this.pubkeyAlgName==="rsa")return this.pubKey.verifyWithMessageHash(this.sHashHex,v);if(M.crypto.ECDSA!==void 0&&this.pubKey instanceof M.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,v);if(M.crypto.DSA!==void 0&&this.pubKey instanceof M.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,v);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(u,l){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(u){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(u){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName},this.signString=function(u){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(u){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(u){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=o,o!==void 0&&(o.alg!==void 0&&(this.algName=o.alg,o.prov===void 0?this.provName=M.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=o.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),o.psssaltlen!==void 0&&(this.pssSaltLen=o.psssaltlen),o.prvkeypem!==void 0)){if(o.prvkeypas!==void 0)throw"both prvkeypem and prvkeypas parameters not supported";try{i=ut.getKey(o.prvkeypem),this.init(i)}catch(u){throw"fatal error to load pem private key: "+u}}},M.crypto.Cipher=function(o){},M.crypto.Cipher.encrypt=function(o,i,u){if(i instanceof me&&i.isPublic){var l=M.crypto.Cipher.getAlgByKeyAndName(i,u);if(l==="RSA")return i.encrypt(o);if(l==="RSAOAEP")return i.encryptOAEP(o,"sha1");var v=l.match(/^RSAOAEP(\d+)$/);if(v!==null)return i.encryptOAEP(o,"sha"+v[1]);throw"Cipher.encrypt: unsupported algorithm for RSAKey: "+u}throw"Cipher.encrypt: unsupported key or algorithm"},M.crypto.Cipher.decrypt=function(o,i,u){if(i instanceof me&&i.isPrivate){var l=M.crypto.Cipher.getAlgByKeyAndName(i,u);if(l==="RSA")return i.decrypt(o);if(l==="RSAOAEP")return i.decryptOAEP(o,"sha1");var v=l.match(/^RSAOAEP(\d+)$/);if(v!==null)return i.decryptOAEP(o,"sha"+v[1]);throw"Cipher.decrypt: unsupported algorithm for RSAKey: "+u}throw"Cipher.decrypt: unsupported key or algorithm"},M.crypto.Cipher.getAlgByKeyAndName=function(o,i){if(o instanceof me){if(":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(i)!=-1)return i;if(i==null)return"RSA";throw"getAlgByKeyAndName: not supported algorithm name for RSAKey: "+i}throw"getAlgByKeyAndName: not supported algorithm name: "+i},M.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040023":"secp521r1","2b81040022":"secp384r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}},M!==void 0&&M||(r.KJUR=M={}),M.crypto!==void 0&&M.crypto||(M.crypto={}),M.crypto.ECDSA=function(o){var i=Error,u=x,l=Re,v=M.crypto.ECDSA,y=M.crypto.ECParameterDB,k=v.getName,B=fe,U=B.getVbyListEx,j=B.isASN1HEX,$=new St;this.type="EC",this.isPrivate=!1,this.isPublic=!1,this.getBigRandom=function(V){return new u(V.bitLength(),$).mod(V.subtract(u.ONE)).add(u.ONE)},this.setNamedCurve=function(V){this.ecparams=y.getByName(V),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=V},this.setPrivateKeyHex=function(V){this.isPrivate=!0,this.prvKeyHex=V},this.setPublicKeyHex=function(V){this.isPublic=!0,this.pubKeyHex=V},this.getPublicKeyXYHex=function(){var V=this.pubKeyHex;if(V.substr(0,2)!=="04")throw"this method supports uncompressed format(04) only";var J=this.ecparams.keylen/4;if(V.length!==2+2*J)throw"malformed public key hex length";var X={};return X.x=V.substr(2,J),X.y=V.substr(2+J),X},this.getShortNISTPCurveName=function(){var V=this.curveName;return V==="secp256r1"||V==="NIST P-256"||V==="P-256"||V==="prime256v1"?"P-256":V==="secp384r1"||V==="NIST P-384"||V==="P-384"?"P-384":null},this.generateKeyPairHex=function(){var V=this.ecparams.n,J=this.getBigRandom(V),X=this.ecparams.G.multiply(J),ee=X.getX().toBigInteger(),ne=X.getY().toBigInteger(),re=this.ecparams.keylen/4,C=("0000000000"+J.toString(16)).slice(-re),K="04"+("0000000000"+ee.toString(16)).slice(-re)+("0000000000"+ne.toString(16)).slice(-re);return this.setPrivateKeyHex(C),this.setPublicKeyHex(K),{ecprvhex:C,ecpubhex:K}},this.signWithMessageHash=function(V){return this.signHex(V,this.prvKeyHex)},this.signHex=function(V,J){var X=new u(J,16),ee=this.ecparams.n,ne=new u(V.substring(0,this.ecparams.keylen/4),16);do var re=this.getBigRandom(ee),C=this.ecparams.G.multiply(re).getX().toBigInteger().mod(ee);while(C.compareTo(u.ZERO)<=0);var K=re.modInverse(ee).multiply(ne.add(X.multiply(C))).mod(ee);return v.biRSSigToASN1Sig(C,K)},this.sign=function(V,J){var X=J,ee=this.ecparams.n,ne=u.fromByteArrayUnsigned(V);do var re=this.getBigRandom(ee),C=this.ecparams.G.multiply(re).getX().toBigInteger().mod(ee);while(C.compareTo(x.ZERO)<=0);var K=re.modInverse(ee).multiply(ne.add(X.multiply(C))).mod(ee);return this.serializeSig(C,K)},this.verifyWithMessageHash=function(V,J){return this.verifyHex(V,J,this.pubKeyHex)},this.verifyHex=function(V,J,X){try{var ee,ne,re=v.parseSigHex(J);ee=re.r,ne=re.s;var C=l.decodeFromHex(this.ecparams.curve,X),K=new u(V.substring(0,this.ecparams.keylen/4),16);return this.verifyRaw(K,ee,ne,C)}catch{return!1}},this.verify=function(V,J,X){var ee,ne,re;if(Bitcoin.Util.isArray(J)){var C=this.parseSig(J);ee=C.r,ne=C.s}else{if((J===void 0?"undefined":c(J))!=="object"||!J.r||!J.s)throw"Invalid value for signature";ee=J.r,ne=J.s}if(X instanceof Re)re=X;else{if(!Bitcoin.Util.isArray(X))throw"Invalid format for pubkey value, must be byte array or ECPointFp";re=l.decodeFrom(this.ecparams.curve,X)}var K=u.fromByteArrayUnsigned(V);return this.verifyRaw(K,ee,ne,re)},this.verifyRaw=function(V,J,X,ee){var ne=this.ecparams.n,re=this.ecparams.G;if(J.compareTo(u.ONE)<0||J.compareTo(ne)>=0||X.compareTo(u.ONE)<0||X.compareTo(ne)>=0)return!1;var C=X.modInverse(ne),K=V.multiply(C).mod(ne),W=J.multiply(C).mod(ne);return re.multiply(K).add(ee.multiply(W)).getX().toBigInteger().mod(ne).equals(J)},this.serializeSig=function(V,J){var X=V.toByteArraySigned(),ee=J.toByteArraySigned(),ne=[];return ne.push(2),ne.push(X.length),(ne=ne.concat(X)).push(2),ne.push(ee.length),(ne=ne.concat(ee)).unshift(ne.length),ne.unshift(48),ne},this.parseSig=function(V){var J;if(V[0]!=48)throw new Error("Signature not a valid DERSequence");if(V[J=2]!=2)throw new Error("First element in signature must be a DERInteger");var X=V.slice(J+2,J+2+V[J+1]);if(V[J+=2+V[J+1]]!=2)throw new Error("Second element in signature must be a DERInteger");var ee=V.slice(J+2,J+2+V[J+1]);return J+=2+V[J+1],{r:u.fromByteArrayUnsigned(X),s:u.fromByteArrayUnsigned(ee)}},this.parseSigCompact=function(V){if(V.length!==65)throw"Signature has the wrong length";var J=V[0]-27;if(J<0||J>7)throw"Invalid signature type";var X=this.ecparams.n;return{r:u.fromByteArrayUnsigned(V.slice(1,33)).mod(X),s:u.fromByteArrayUnsigned(V.slice(33,65)).mod(X),i:J}},this.readPKCS5PrvKeyHex=function(V){if(j(V)===!1)throw new Error("not ASN.1 hex string");var J,X,ee;try{J=U(V,0,["[0]",0],"06"),X=U(V,0,[1],"04");try{ee=U(V,0,["[1]",0],"03")}catch{}}catch{throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=k(J),this.curveName===void 0)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(ee),this.setPrivateKeyHex(X),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(V){if(j(V)===!1)throw new i("not ASN.1 hex string");var J,X,ee;try{U(V,0,[1,0],"06"),J=U(V,0,[1,1],"06"),X=U(V,0,[2,0,1],"04");try{ee=U(V,0,[2,0,"[1]",0],"03")}catch{}}catch{throw new i("malformed PKCS#8 plain ECC private key")}if(this.curveName=k(J),this.curveName===void 0)throw new i("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(ee),this.setPrivateKeyHex(X),this.isPublic=!1},this.readPKCS8PubKeyHex=function(V){if(j(V)===!1)throw new i("not ASN.1 hex string");var J,X;try{U(V,0,[0,0],"06"),J=U(V,0,[0,1],"06"),X=U(V,0,[1],"03")}catch{throw new i("malformed PKCS#8 ECC public key")}if(this.curveName=k(J),this.curveName===null)throw new i("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(X)},this.readCertPubKeyHex=function(V,J){if(j(V)===!1)throw new i("not ASN.1 hex string");var X,ee;try{X=U(V,0,[0,5,0,1],"06"),ee=U(V,0,[0,5,1],"03")}catch{throw new i("malformed X.509 certificate ECC public key")}if(this.curveName=k(X),this.curveName===null)throw new i("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(ee)},o!==void 0&&o.curve!==void 0&&(this.curveName=o.curve),this.curveName===void 0&&(this.curveName="secp256r1"),this.setNamedCurve(this.curveName),o!==void 0&&(o.prv!==void 0&&this.setPrivateKeyHex(o.prv),o.pub!==void 0&&this.setPublicKeyHex(o.pub))},M.crypto.ECDSA.parseSigHex=function(o){var i=M.crypto.ECDSA.parseSigHexInHexRS(o);return{r:new x(i.r,16),s:new x(i.s,16)}},M.crypto.ECDSA.parseSigHexInHexRS=function(o){var i=fe,u=i.getChildIdx,l=i.getV;if(i.checkStrictDER(o,0),o.substr(0,2)!="30")throw new Error("signature is not a ASN.1 sequence");var v=u(o,0);if(v.length!=2)throw new Error("signature shall have two elements");var y=v[0],k=v[1];if(o.substr(y,2)!="02")throw new Error("1st item not ASN.1 integer");if(o.substr(k,2)!="02")throw new Error("2nd item not ASN.1 integer");return{r:l(o,y),s:l(o,k)}},M.crypto.ECDSA.asn1SigToConcatSig=function(o){var i=M.crypto.ECDSA.parseSigHexInHexRS(o),u=i.r,l=i.s;if(u.substr(0,2)=="00"&&u.length%32==2&&(u=u.substr(2)),l.substr(0,2)=="00"&&l.length%32==2&&(l=l.substr(2)),u.length%32==30&&(u="00"+u),l.length%32==30&&(l="00"+l),u.length%32!=0)throw"unknown ECDSA sig r length error";if(l.length%32!=0)throw"unknown ECDSA sig s length error";return u+l},M.crypto.ECDSA.concatSigToASN1Sig=function(o){if(o.length/2*8%128!=0)throw"unknown ECDSA concatinated r-s sig length error";var i=o.substr(0,o.length/2),u=o.substr(o.length/2);return M.crypto.ECDSA.hexRSSigToASN1Sig(i,u)},M.crypto.ECDSA.hexRSSigToASN1Sig=function(o,i){var u=new x(o,16),l=new x(i,16);return M.crypto.ECDSA.biRSSigToASN1Sig(u,l)},M.crypto.ECDSA.biRSSigToASN1Sig=function(o,i){var u=M.asn1,l=new u.DERInteger({bigint:o}),v=new u.DERInteger({bigint:i});return new u.DERSequence({array:[l,v]}).getEncodedHex()},M.crypto.ECDSA.getName=function(o){return o==="2b8104001f"?"secp192k1":o==="2a8648ce3d030107"?"secp256r1":o==="2b8104000a"?"secp256k1":o==="2b81040021"?"secp224r1":o==="2b81040022"?"secp384r1":"|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(o)!==-1?"secp256r1":"|secp256k1|".indexOf(o)!==-1?"secp256k1":"|secp224r1|NIST P-224|P-224|".indexOf(o)!==-1?"secp224r1":"|secp384r1|NIST P-384|P-384|".indexOf(o)!==-1?"secp384r1":null},M!==void 0&&M||(r.KJUR=M={}),M.crypto!==void 0&&M.crypto||(M.crypto={}),M.crypto.ECParameterDB=new function(){var o={},i={};function u(l){return new x(l,16)}this.getByName=function(l){var v=l;if(i[v]!==void 0&&(v=i[l]),o[v]!==void 0)return o[v];throw"unregistered EC curve name: "+v},this.regist=function(l,v,y,k,B,U,j,$,V,J,X,ee){o[l]={};var ne=u(y),re=u(k),C=u(B),K=u(U),W=u(j),z=new un(ne,re,C),te=z.decodePointHex("04"+$+V);o[l].name=l,o[l].keylen=v,o[l].curve=z,o[l].G=te,o[l].n=K,o[l].h=W,o[l].oid=X,o[l].info=ee;for(var ie=0;ie<J.length;ie++)i[J[ie]]=l}},M.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field"),M.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field"),M.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field"),M.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]),M.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]),M.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]),M.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]),M.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]),M.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]),M.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]);var ut=function(){var o=function(j,$,V){return i(O.AES,j,$,V)},i=function(j,$,V,J){var X=O.enc.Hex.parse($),ee=O.enc.Hex.parse(V),ne=O.enc.Hex.parse(J),re={};re.key=ee,re.iv=ne,re.ciphertext=X;var C=j.decrypt(re,ee,{iv:ne});return O.enc.Hex.stringify(C)},u=function(j,$,V){return l(O.AES,j,$,V)},l=function(j,$,V,J){var X=O.enc.Hex.parse($),ee=O.enc.Hex.parse(V),ne=O.enc.Hex.parse(J),re=j.encrypt(X,ee,{iv:ne}),C=O.enc.Hex.parse(re.toString());return O.enc.Base64.stringify(C)},v={"AES-256-CBC":{proc:o,eproc:u,keylen:32,ivlen:16},"AES-192-CBC":{proc:o,eproc:u,keylen:24,ivlen:16},"AES-128-CBC":{proc:o,eproc:u,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(j,$,V){return i(O.TripleDES,j,$,V)},eproc:function(j,$,V){return l(O.TripleDES,j,$,V)},keylen:24,ivlen:8},"DES-CBC":{proc:function(j,$,V){return i(O.DES,j,$,V)},eproc:function(j,$,V){return l(O.DES,j,$,V)},keylen:8,ivlen:8}},y=function(j){var $={},V=j.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));V&&($.cipher=V[1],$.ivsalt=V[2]);var J=j.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));J&&($.type=J[1]);var X=-1,ee=0;j.indexOf(`\r
54
+ \r
55
+ `)!=-1&&(X=j.indexOf(`\r
56
+ \r
57
+ `),ee=2),j.indexOf(`
58
+
59
+ `)!=-1&&(X=j.indexOf(`
60
+
61
+ `),ee=1);var ne=j.indexOf("-----END");if(X!=-1&&ne!=-1){var re=j.substring(X+2*ee,ne-ee);re=re.replace(/\s+/g,""),$.data=re}return $},k=function(j,$,V){for(var J=V.substring(0,16),X=O.enc.Hex.parse(J),ee=O.enc.Utf8.parse($),ne=v[j].keylen+v[j].ivlen,re="",C=null;;){var K=O.algo.MD5.create();if(C!=null&&K.update(C),K.update(ee),K.update(X),C=K.finalize(),(re+=O.enc.Hex.stringify(C)).length>=2*ne)break}var W={};return W.keyhex=re.substr(0,2*v[j].keylen),W.ivhex=re.substr(2*v[j].keylen,2*v[j].ivlen),W},B=function(j,$,V,J){var X=O.enc.Base64.parse(j),ee=O.enc.Hex.stringify(X);return(0,v[$].proc)(ee,V,J)};return{version:"1.0.0",parsePKCS5PEM:function(j){return y(j)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(j,$,V){return k(j,$,V)},decryptKeyB64:function(j,$,V,J){return B(j,$,V,J)},getDecryptedKeyHex:function(j,$){var V=y(j),J=V.cipher,X=V.ivsalt,ee=V.data,ne=k(J,$,X).keyhex;return B(ee,J,ne,X)},getEncryptedPKCS5PEMFromPrvKeyHex:function(j,$,V,J,X){var ee="";if(J!==void 0&&J!=null||(J="AES-256-CBC"),v[J]===void 0)throw"KEYUTIL unsupported algorithm: "+J;X!==void 0&&X!=null||(X=function(C){var K=O.lib.WordArray.random(C);return O.enc.Hex.stringify(K)}(v[J].ivlen).toUpperCase());var ne=function(C,K,W,z){return(0,v[K].eproc)(C,W,z)}($,J,k(J,V,X).keyhex,X);return ee="-----BEGIN "+j+` PRIVATE KEY-----\r
62
+ `,ee+=`Proc-Type: 4,ENCRYPTED\r
63
+ `,ee+="DEK-Info: "+J+","+X+`\r
64
+ `,ee+=`\r
65
+ `,ee+=ne.replace(/(.{64})/g,`$1\r
66
+ `),ee+=`\r
67
+ -----END `+j+` PRIVATE KEY-----\r
68
+ `},parseHexOfEncryptedPKCS8:function(j){var $=fe,V=$.getChildIdx,J=$.getV,X={},ee=V(j,0);if(ee.length!=2)throw"malformed format: SEQUENCE(0).items != 2: "+ee.length;X.ciphertext=J(j,ee[1]);var ne=V(j,ee[0]);if(ne.length!=2)throw"malformed format: SEQUENCE(0.0).items != 2: "+ne.length;if(J(j,ne[0])!="2a864886f70d01050d")throw"this only supports pkcs5PBES2";var re=V(j,ne[1]);if(ne.length!=2)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+re.length;var C=V(j,re[1]);if(C.length!=2)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+C.length;if(J(j,C[0])!="2a864886f70d0307")throw"this only supports TripleDES";X.encryptionSchemeAlg="TripleDES",X.encryptionSchemeIV=J(j,C[1]);var K=V(j,re[0]);if(K.length!=2)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+K.length;if(J(j,K[0])!="2a864886f70d01050c")throw"this only supports pkcs5PBKDF2";var W=V(j,K[1]);if(W.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+W.length;X.pbkdf2Salt=J(j,W[0]);var z=J(j,W[1]);try{X.pbkdf2Iter=parseInt(z,16)}catch{throw"malformed format pbkdf2Iter: "+z}return X},getPBKDF2KeyHexFromParam:function(j,$){var V=O.enc.Hex.parse(j.pbkdf2Salt),J=j.pbkdf2Iter,X=O.PBKDF2($,V,{keySize:6,iterations:J});return O.enc.Hex.stringify(X)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(j,$){var V=ln(j,"ENCRYPTED PRIVATE KEY"),J=this.parseHexOfEncryptedPKCS8(V),X=ut.getPBKDF2KeyHexFromParam(J,$),ee={};ee.ciphertext=O.enc.Hex.parse(J.ciphertext);var ne=O.enc.Hex.parse(X),re=O.enc.Hex.parse(J.encryptionSchemeIV),C=O.TripleDES.decrypt(ee,ne,{iv:re});return O.enc.Hex.stringify(C)},getKeyFromEncryptedPKCS8PEM:function(j,$){var V=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(j,$);return this.getKeyFromPlainPrivatePKCS8Hex(V)},parsePlainPrivatePKCS8Hex:function(j){var $=fe,V=$.getChildIdx,J=$.getV,X={algparam:null};if(j.substr(0,2)!="30")throw"malformed plain PKCS8 private key(code:001)";var ee=V(j,0);if(ee.length!=3)throw"malformed plain PKCS8 private key(code:002)";if(j.substr(ee[1],2)!="30")throw"malformed PKCS8 private key(code:003)";var ne=V(j,ee[1]);if(ne.length!=2)throw"malformed PKCS8 private key(code:004)";if(j.substr(ne[0],2)!="06")throw"malformed PKCS8 private key(code:005)";if(X.algoid=J(j,ne[0]),j.substr(ne[1],2)=="06"&&(X.algparam=J(j,ne[1])),j.substr(ee[2],2)!="04")throw"malformed PKCS8 private key(code:006)";return X.keyidx=$.getVidx(j,ee[2]),X},getKeyFromPlainPrivatePKCS8PEM:function(j){var $=ln(j,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex($)},getKeyFromPlainPrivatePKCS8Hex:function(j){var $,V=this.parsePlainPrivatePKCS8Hex(j);if(V.algoid=="2a864886f70d010101")$=new me;else if(V.algoid=="2a8648ce380401")$=new M.crypto.DSA;else{if(V.algoid!="2a8648ce3d0201")throw"unsupported private key algorithm";$=new M.crypto.ECDSA}return $.readPKCS8PrvKeyHex(j),$},_getKeyFromPublicPKCS8Hex:function(j){var $,V=fe.getVbyList(j,0,[0,0],"06");if(V==="2a864886f70d010101")$=new me;else if(V==="2a8648ce380401")$=new M.crypto.DSA;else{if(V!=="2a8648ce3d0201")throw"unsupported PKCS#8 public key hex";$=new M.crypto.ECDSA}return $.readPKCS8PubKeyHex(j),$},parsePublicRawRSAKeyHex:function(j){var $=fe,V=$.getChildIdx,J=$.getV,X={};if(j.substr(0,2)!="30")throw"malformed RSA key(code:001)";var ee=V(j,0);if(ee.length!=2)throw"malformed RSA key(code:002)";if(j.substr(ee[0],2)!="02")throw"malformed RSA key(code:003)";if(X.n=J(j,ee[0]),j.substr(ee[1],2)!="02")throw"malformed RSA key(code:004)";return X.e=J(j,ee[1]),X},parsePublicPKCS8Hex:function(j){var $=fe,V=$.getChildIdx,J=$.getV,X={algparam:null},ee=V(j,0);if(ee.length!=2)throw"outer DERSequence shall have 2 elements: "+ee.length;var ne=ee[0];if(j.substr(ne,2)!="30")throw"malformed PKCS8 public key(code:001)";var re=V(j,ne);if(re.length!=2)throw"malformed PKCS8 public key(code:002)";if(j.substr(re[0],2)!="06")throw"malformed PKCS8 public key(code:003)";if(X.algoid=J(j,re[0]),j.substr(re[1],2)=="06"?X.algparam=J(j,re[1]):j.substr(re[1],2)=="30"&&(X.algparam={},X.algparam.p=$.getVbyList(j,re[1],[0],"02"),X.algparam.q=$.getVbyList(j,re[1],[1],"02"),X.algparam.g=$.getVbyList(j,re[1],[2],"02")),j.substr(ee[1],2)!="03")throw"malformed PKCS8 public key(code:004)";return X.key=J(j,ee[1]).substr(2),X}}}();ut.getKey=function(o,i,u){var l=(re=fe).getChildIdx,v=(re.getV,re.getVbyList),y=M.crypto,k=y.ECDSA,B=y.DSA,U=me,j=ln,$=ut;if(U!==void 0&&o instanceof U||k!==void 0&&o instanceof k||B!==void 0&&o instanceof B)return o;if(o.curve!==void 0&&o.xy!==void 0&&o.d===void 0)return new k({pub:o.xy,curve:o.curve});if(o.curve!==void 0&&o.d!==void 0)return new k({prv:o.d,curve:o.curve});if(o.kty===void 0&&o.n!==void 0&&o.e!==void 0&&o.d===void 0)return(ye=new U).setPublic(o.n,o.e),ye;if(o.kty===void 0&&o.n!==void 0&&o.e!==void 0&&o.d!==void 0&&o.p!==void 0&&o.q!==void 0&&o.dp!==void 0&&o.dq!==void 0&&o.co!==void 0&&o.qi===void 0)return(ye=new U).setPrivateEx(o.n,o.e,o.d,o.p,o.q,o.dp,o.dq,o.co),ye;if(o.kty===void 0&&o.n!==void 0&&o.e!==void 0&&o.d!==void 0&&o.p===void 0)return(ye=new U).setPrivate(o.n,o.e,o.d),ye;if(o.p!==void 0&&o.q!==void 0&&o.g!==void 0&&o.y!==void 0&&o.x===void 0)return(ye=new B).setPublic(o.p,o.q,o.g,o.y),ye;if(o.p!==void 0&&o.q!==void 0&&o.g!==void 0&&o.y!==void 0&&o.x!==void 0)return(ye=new B).setPrivate(o.p,o.q,o.g,o.y,o.x),ye;if(o.kty==="RSA"&&o.n!==void 0&&o.e!==void 0&&o.d===void 0)return(ye=new U).setPublic(Je(o.n),Je(o.e)),ye;if(o.kty==="RSA"&&o.n!==void 0&&o.e!==void 0&&o.d!==void 0&&o.p!==void 0&&o.q!==void 0&&o.dp!==void 0&&o.dq!==void 0&&o.qi!==void 0)return(ye=new U).setPrivateEx(Je(o.n),Je(o.e),Je(o.d),Je(o.p),Je(o.q),Je(o.dp),Je(o.dq),Je(o.qi)),ye;if(o.kty==="RSA"&&o.n!==void 0&&o.e!==void 0&&o.d!==void 0)return(ye=new U).setPrivate(Je(o.n),Je(o.e),Je(o.d)),ye;if(o.kty==="EC"&&o.crv!==void 0&&o.x!==void 0&&o.y!==void 0&&o.d===void 0){var V=(de=new k({curve:o.crv})).ecparams.keylen/4,J="04"+("0000000000"+Je(o.x)).slice(-V)+("0000000000"+Je(o.y)).slice(-V);return de.setPublicKeyHex(J),de}if(o.kty==="EC"&&o.crv!==void 0&&o.x!==void 0&&o.y!==void 0&&o.d!==void 0){V=(de=new k({curve:o.crv})).ecparams.keylen/4,J="04"+("0000000000"+Je(o.x)).slice(-V)+("0000000000"+Je(o.y)).slice(-V);var X=("0000000000"+Je(o.d)).slice(-V);return de.setPublicKeyHex(J),de.setPrivateKeyHex(X),de}if(u==="pkcs5prv"){var ee,ne=o,re=fe;if((ee=l(ne,0)).length===9)(ye=new U).readPKCS5PrvKeyHex(ne);else if(ee.length===6)(ye=new B).readPKCS5PrvKeyHex(ne);else{if(!(ee.length>2&&ne.substr(ee[1],2)==="04"))throw"unsupported PKCS#1/5 hexadecimal key";(ye=new k).readPKCS5PrvKeyHex(ne)}return ye}if(u==="pkcs8prv")return ye=$.getKeyFromPlainPrivatePKCS8Hex(o);if(u==="pkcs8pub")return $._getKeyFromPublicPKCS8Hex(o);if(u==="x509pub")return ct.getPublicKeyFromCertHex(o);if(o.indexOf("-END CERTIFICATE-",0)!=-1||o.indexOf("-END X509 CERTIFICATE-",0)!=-1||o.indexOf("-END TRUSTED CERTIFICATE-",0)!=-1)return ct.getPublicKeyFromCertPEM(o);if(o.indexOf("-END PUBLIC KEY-")!=-1){var C=ln(o,"PUBLIC KEY");return $._getKeyFromPublicPKCS8Hex(C)}if(o.indexOf("-END RSA PRIVATE KEY-")!=-1&&o.indexOf("4,ENCRYPTED")==-1){var K=j(o,"RSA PRIVATE KEY");return $.getKey(K,null,"pkcs5prv")}if(o.indexOf("-END DSA PRIVATE KEY-")!=-1&&o.indexOf("4,ENCRYPTED")==-1){var W=v(ze=j(o,"DSA PRIVATE KEY"),0,[1],"02"),z=v(ze,0,[2],"02"),te=v(ze,0,[3],"02"),ie=v(ze,0,[4],"02"),ge=v(ze,0,[5],"02");return(ye=new B).setPrivate(new x(W,16),new x(z,16),new x(te,16),new x(ie,16),new x(ge,16)),ye}if(o.indexOf("-END EC PRIVATE KEY-")!=-1&&o.indexOf("4,ENCRYPTED")==-1)return K=j(o,"EC PRIVATE KEY"),$.getKey(K,null,"pkcs5prv");if(o.indexOf("-END PRIVATE KEY-")!=-1)return $.getKeyFromPlainPrivatePKCS8PEM(o);if(o.indexOf("-END RSA PRIVATE KEY-")!=-1&&o.indexOf("4,ENCRYPTED")!=-1){var ce=$.getDecryptedKeyHex(o,i),Ce=new me;return Ce.readPKCS5PrvKeyHex(ce),Ce}if(o.indexOf("-END EC PRIVATE KEY-")!=-1&&o.indexOf("4,ENCRYPTED")!=-1){var de,ye=v(ze=$.getDecryptedKeyHex(o,i),0,[1],"04"),qe=v(ze,0,[2,0],"06"),Xe=v(ze,0,[3,0],"03").substr(2);if(M.crypto.OID.oidhex2name[qe]===void 0)throw"undefined OID(hex) in KJUR.crypto.OID: "+qe;return(de=new k({curve:M.crypto.OID.oidhex2name[qe]})).setPublicKeyHex(Xe),de.setPrivateKeyHex(ye),de.isPublic=!1,de}if(o.indexOf("-END DSA PRIVATE KEY-")!=-1&&o.indexOf("4,ENCRYPTED")!=-1){var ze;return W=v(ze=$.getDecryptedKeyHex(o,i),0,[1],"02"),z=v(ze,0,[2],"02"),te=v(ze,0,[3],"02"),ie=v(ze,0,[4],"02"),ge=v(ze,0,[5],"02"),(ye=new B).setPrivate(new x(W,16),new x(z,16),new x(te,16),new x(ie,16),new x(ge,16)),ye}if(o.indexOf("-END ENCRYPTED PRIVATE KEY-")!=-1)return $.getKeyFromEncryptedPKCS8PEM(o,i);throw new Error("not supported argument")},ut.generateKeypair=function(o,i){if(o=="RSA"){var u=i;(k=new me).generate(u,"10001"),k.isPrivate=!0,k.isPublic=!0;var l=new me,v=k.n.toString(16),y=k.e.toString(16);return l.setPublic(v,y),l.isPrivate=!1,l.isPublic=!0,(B={}).prvKeyObj=k,B.pubKeyObj=l,B}if(o=="EC"){var k,B,U=i,j=new M.crypto.ECDSA({curve:U}).generateKeyPairHex();return(k=new M.crypto.ECDSA({curve:U})).setPublicKeyHex(j.ecpubhex),k.setPrivateKeyHex(j.ecprvhex),k.isPrivate=!0,k.isPublic=!1,(l=new M.crypto.ECDSA({curve:U})).setPublicKeyHex(j.ecpubhex),l.isPrivate=!1,l.isPublic=!0,(B={}).prvKeyObj=k,B.pubKeyObj=l,B}throw"unknown algorithm: "+o},ut.getPEM=function(o,i,u,l,v,y){var k=M,B=k.asn1,U=B.DERObjectIdentifier,j=B.DERInteger,$=B.ASN1Util.newObject,V=B.x509.SubjectPublicKeyInfo,J=k.crypto,X=J.DSA,ee=J.ECDSA,ne=me;function re(de){return $({seq:[{int:0},{int:{bigint:de.n}},{int:de.e},{int:{bigint:de.d}},{int:{bigint:de.p}},{int:{bigint:de.q}},{int:{bigint:de.dmp1}},{int:{bigint:de.dmq1}},{int:{bigint:de.coeff}}]})}function C(de){return $({seq:[{int:1},{octstr:{hex:de.prvKeyHex}},{tag:["a0",!0,{oid:{name:de.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+de.pubKeyHex}}]}]})}function K(de){return $({seq:[{int:0},{int:{bigint:de.p}},{int:{bigint:de.q}},{int:{bigint:de.g}},{int:{bigint:de.y}},{int:{bigint:de.x}}]})}if((ne!==void 0&&o instanceof ne||X!==void 0&&o instanceof X||ee!==void 0&&o instanceof ee)&&o.isPublic==1&&(i===void 0||i=="PKCS8PUB"))return Ut(ie=new V(o).getEncodedHex(),"PUBLIC KEY");if(i=="PKCS1PRV"&&ne!==void 0&&o instanceof ne&&(u===void 0||u==null)&&o.isPrivate==1)return Ut(ie=re(o).getEncodedHex(),"RSA PRIVATE KEY");if(i=="PKCS1PRV"&&ee!==void 0&&o instanceof ee&&(u===void 0||u==null)&&o.isPrivate==1){var W=new U({name:o.curveName}).getEncodedHex(),z=C(o).getEncodedHex(),te="";return te+=Ut(W,"EC PARAMETERS"),te+=Ut(z,"EC PRIVATE KEY")}if(i=="PKCS1PRV"&&X!==void 0&&o instanceof X&&(u===void 0||u==null)&&o.isPrivate==1)return Ut(ie=K(o).getEncodedHex(),"DSA PRIVATE KEY");if(i=="PKCS5PRV"&&ne!==void 0&&o instanceof ne&&u!==void 0&&u!=null&&o.isPrivate==1){var ie=re(o).getEncodedHex();return l===void 0&&(l="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",ie,u,l,y)}if(i=="PKCS5PRV"&&ee!==void 0&&o instanceof ee&&u!==void 0&&u!=null&&o.isPrivate==1)return ie=C(o).getEncodedHex(),l===void 0&&(l="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",ie,u,l,y);if(i=="PKCS5PRV"&&X!==void 0&&o instanceof X&&u!==void 0&&u!=null&&o.isPrivate==1)return ie=K(o).getEncodedHex(),l===void 0&&(l="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",ie,u,l,y);var ge=function(ye,qe){var Xe=ce(ye,qe);return new $({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:Xe.pbkdf2Salt}},{int:Xe.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:Xe.encryptionSchemeIV}}]}]}]},{octstr:{hex:Xe.ciphertext}}]}).getEncodedHex()},ce=function(ye,qe){var Xe=O.lib.WordArray.random(8),ze=O.lib.WordArray.random(8),xt=O.PBKDF2(qe,Xe,{keySize:6,iterations:100}),It=O.enc.Hex.parse(ye),Dt=O.TripleDES.encrypt(It,xt,{iv:ze})+"",it={};return it.ciphertext=Dt,it.pbkdf2Salt=O.enc.Hex.stringify(Xe),it.pbkdf2Iter=100,it.encryptionSchemeAlg="DES-EDE3-CBC",it.encryptionSchemeIV=O.enc.Hex.stringify(ze),it};if(i=="PKCS8PRV"&&ne!=null&&o instanceof ne&&o.isPrivate==1){var Ce=re(o).getEncodedHex();return ie=$({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:Ce}}]}).getEncodedHex(),u===void 0||u==null?Ut(ie,"PRIVATE KEY"):Ut(z=ge(ie,u),"ENCRYPTED PRIVATE KEY")}if(i=="PKCS8PRV"&&ee!==void 0&&o instanceof ee&&o.isPrivate==1)return Ce=new $({seq:[{int:1},{octstr:{hex:o.prvKeyHex}},{tag:["a1",!0,{bitstr:{hex:"00"+o.pubKeyHex}}]}]}).getEncodedHex(),ie=$({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:o.curveName}}]},{octstr:{hex:Ce}}]}).getEncodedHex(),u===void 0||u==null?Ut(ie,"PRIVATE KEY"):Ut(z=ge(ie,u),"ENCRYPTED PRIVATE KEY");if(i=="PKCS8PRV"&&X!==void 0&&o instanceof X&&o.isPrivate==1)return Ce=new j({bigint:o.x}).getEncodedHex(),ie=$({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:o.p}},{int:{bigint:o.q}},{int:{bigint:o.g}}]}]},{octstr:{hex:Ce}}]}).getEncodedHex(),u===void 0||u==null?Ut(ie,"PRIVATE KEY"):Ut(z=ge(ie,u),"ENCRYPTED PRIVATE KEY");throw new Error("unsupported object nor format")},ut.getKeyFromCSRPEM=function(o){var i=ln(o,"CERTIFICATE REQUEST");return ut.getKeyFromCSRHex(i)},ut.getKeyFromCSRHex=function(o){var i=ut.parseCSRHex(o);return ut.getKey(i.p8pubkeyhex,null,"pkcs8pub")},ut.parseCSRHex=function(o){var i=fe,u=i.getChildIdx,l=i.getTLV,v={},y=o;if(y.substr(0,2)!="30")throw"malformed CSR(code:001)";var k=u(y,0);if(k.length<1)throw"malformed CSR(code:002)";if(y.substr(k[0],2)!="30")throw"malformed CSR(code:003)";var B=u(y,k[0]);if(B.length<3)throw"malformed CSR(code:004)";return v.p8pubkeyhex=l(y,B[2]),v},ut.getKeyID=function(o){var i=ut,u=fe;typeof o=="string"&&o.indexOf("BEGIN ")!=-1&&(o=i.getKey(o));var l=ln(i.getPEM(o)),v=u.getIdxbyList(l,0,[1]),y=u.getV(l,v).substring(2);return M.crypto.Util.hashHex(y,"sha1")},ut.getJWKFromKey=function(o){var i={};if(o instanceof me&&o.isPrivate)return i.kty="RSA",i.n=Ze(o.n.toString(16)),i.e=Ze(o.e.toString(16)),i.d=Ze(o.d.toString(16)),i.p=Ze(o.p.toString(16)),i.q=Ze(o.q.toString(16)),i.dp=Ze(o.dmp1.toString(16)),i.dq=Ze(o.dmq1.toString(16)),i.qi=Ze(o.coeff.toString(16)),i;if(o instanceof me&&o.isPublic)return i.kty="RSA",i.n=Ze(o.n.toString(16)),i.e=Ze(o.e.toString(16)),i;if(o instanceof M.crypto.ECDSA&&o.isPrivate){if((l=o.getShortNISTPCurveName())!=="P-256"&&l!=="P-384")throw"unsupported curve name for JWT: "+l;var u=o.getPublicKeyXYHex();return i.kty="EC",i.crv=l,i.x=Ze(u.x),i.y=Ze(u.y),i.d=Ze(o.prvKeyHex),i}if(o instanceof M.crypto.ECDSA&&o.isPublic){var l;if((l=o.getShortNISTPCurveName())!=="P-256"&&l!=="P-384")throw"unsupported curve name for JWT: "+l;return u=o.getPublicKeyXYHex(),i.kty="EC",i.crv=l,i.x=Ze(u.x),i.y=Ze(u.y),i}throw"not supported key object"},me.getPosArrayOfChildrenFromHex=function(o){return fe.getChildIdx(o,0)},me.getHexValueArrayOfChildrenFromHex=function(o){var i,u=fe.getV,l=u(o,(i=me.getPosArrayOfChildrenFromHex(o))[0]),v=u(o,i[1]),y=u(o,i[2]),k=u(o,i[3]),B=u(o,i[4]),U=u(o,i[5]),j=u(o,i[6]),$=u(o,i[7]),V=u(o,i[8]);return(i=new Array).push(l,v,y,k,B,U,j,$,V),i},me.prototype.readPrivateKeyFromPEMString=function(o){var i=ln(o),u=me.getHexValueArrayOfChildrenFromHex(i);this.setPrivateEx(u[1],u[2],u[3],u[4],u[5],u[6],u[7],u[8])},me.prototype.readPKCS5PrvKeyHex=function(o){var i=me.getHexValueArrayOfChildrenFromHex(o);this.setPrivateEx(i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8])},me.prototype.readPKCS8PrvKeyHex=function(o){var i,u,l,v,y,k,B,U,j=fe,$=j.getVbyListEx;if(j.isASN1HEX(o)===!1)throw new Error("not ASN.1 hex string");try{i=$(o,0,[2,0,1],"02"),u=$(o,0,[2,0,2],"02"),l=$(o,0,[2,0,3],"02"),v=$(o,0,[2,0,4],"02"),y=$(o,0,[2,0,5],"02"),k=$(o,0,[2,0,6],"02"),B=$(o,0,[2,0,7],"02"),U=$(o,0,[2,0,8],"02")}catch{throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(i,u,l,v,y,k,B,U)},me.prototype.readPKCS5PubKeyHex=function(o){var i=fe,u=i.getV;if(i.isASN1HEX(o)===!1)throw new Error("keyHex is not ASN.1 hex string");var l=i.getChildIdx(o,0);if(l.length!==2||o.substr(l[0],2)!=="02"||o.substr(l[1],2)!=="02")throw new Error("wrong hex for PKCS#5 public key");var v=u(o,l[0]),y=u(o,l[1]);this.setPublic(v,y)},me.prototype.readPKCS8PubKeyHex=function(o){var i=fe;if(i.isASN1HEX(o)===!1)throw new Error("not ASN.1 hex string");if(i.getTLVbyListEx(o,0,[0,0])!=="06092a864886f70d010101")throw new Error("not PKCS8 RSA public key");var u=i.getTLVbyListEx(o,0,[1,0]);this.readPKCS5PubKeyHex(u)},me.prototype.readCertPubKeyHex=function(o,i){var u,l;(u=new ct).readCertHex(o),l=u.getPublicKeyHex(),this.readPKCS8PubKeyHex(l)};var Pl=new RegExp("[^0-9a-f]","gi");function Vs(o,i){for(var u="",l=i/4-o.length,v=0;v<l;v++)u+="0";return u+o}function qs(o,i,u){for(var l="",v=0;l.length<i;)l+=Kt(u(cn(o+String.fromCharCode.apply(String,[(4278190080&v)>>24,(16711680&v)>>16,(65280&v)>>8,255&v])))),v+=1;return l}function Ws(o){for(var i in M.crypto.Util.DIGESTINFOHEAD){var u=M.crypto.Util.DIGESTINFOHEAD[i],l=u.length;if(o.substring(0,l)==u)return[i,o.substring(l)]}return[]}function ct(o){var i,u=fe,l=u.getChildIdx,v=u.getV,y=u.getTLV,k=u.getVbyList,B=u.getVbyListEx,U=u.getTLVbyList,j=u.getTLVbyListEx,$=u.getIdxbyList,V=u.getIdxbyListEx,J=u.getVidx,X=u.oidname,ee=u.hextooidstr,ne=ct,re=ln;try{i=M.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch{}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){return this.hex===null||this.version!==0?this.version:U(this.hex,0,[0,0])!=="a003020102"?(this.version=1,this.foffset=-1,1):(this.version=3,3)},this.getSerialNumberHex=function(){return B(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var C=j(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(C)},this.getAlgorithmIdentifierName=function(C){for(var K in i)if(C===i[K])return K;return X(B(C,0,[0],"06"))},this.getIssuer=function(){return this.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return U(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){return ne.hex2dn(this.getIssuerHex())},this.getSubject=function(){return this.getX500Name(this.getSubjectHex())},this.getSubjectHex=function(){return U(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return ne.hex2dn(this.getSubjectHex())},this.getNotBefore=function(){var C=k(this.hex,0,[0,4+this.foffset,0]);return C=C.replace(/(..)/g,"%$1"),C=decodeURIComponent(C)},this.getNotAfter=function(){var C=k(this.hex,0,[0,4+this.foffset,1]);return C=C.replace(/(..)/g,"%$1"),C=decodeURIComponent(C)},this.getPublicKeyHex=function(){return u.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyIdx=function(){return $(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var C=this.getPublicKeyIdx();return $(this.hex,C,[1,0],"30")},this.getPublicKey=function(){return ut.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var C=U(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(C)},this.getSignatureValueHex=function(){return k(this.hex,0,[2],"03",!0)},this.verifySignature=function(C){var K=this.getSignatureAlgorithmField(),W=this.getSignatureValueHex(),z=U(this.hex,0,[0],"30"),te=new M.crypto.Signature({alg:K});return te.init(C),te.updateHex(z),te.verify(W)},this.parseExt=function(C){var K,W,z;if(C===void 0){if(z=this.hex,this.version!==3)return-1;K=$(z,0,[0,7,0],"30"),W=l(z,K)}else{z=ln(C);var te=$(z,0,[0,3,0,0],"06");if(v(z,te)!="2a864886f70d01090e")return void(this.aExtInfo=new Array);K=$(z,0,[0,3,0,1,0],"30"),W=l(z,K),this.hex=z}this.aExtInfo=new Array;for(var ie=0;ie<W.length;ie++){var ge={critical:!1},ce=0;l(z,W[ie]).length===3&&(ge.critical=!0,ce=1),ge.oid=u.hextooidstr(k(z,W[ie],[0],"06"));var Ce=$(z,W[ie],[1+ce]);ge.vidx=J(z,Ce),this.aExtInfo.push(ge)}},this.getExtInfo=function(C){var K=this.aExtInfo,W=C;if(C.match(/^[0-9.]+$/)||(W=M.asn1.x509.OID.name2oid(C)),W!==""){for(var z=0;z<K.length;z++)if(K[z].oid===W)return K[z]}},this.getExtBasicConstraints=function(C,K){if(C===void 0&&K===void 0){var W=this.getExtInfo("basicConstraints");if(W===void 0)return;C=y(this.hex,W.vidx),K=W.critical}var z={extname:"basicConstraints"};if(K&&(z.critical=!0),C==="3000")return z;if(C==="30030101ff")return z.cA=!0,z;if(C.substr(0,12)==="30060101ff02"){var te=v(C,10),ie=parseInt(te,16);return z.cA=!0,z.pathLen=ie,z}throw new Error("hExtV parse error: "+C)},this.getExtKeyUsage=function(C,K){if(C===void 0&&K===void 0){var W=this.getExtInfo("keyUsage");if(W===void 0)return;C=y(this.hex,W.vidx),K=W.critical}var z={extname:"keyUsage"};return K&&(z.critical=!0),z.names=this.getExtKeyUsageString(C).split(","),z},this.getExtKeyUsageBin=function(C){if(C===void 0){var K=this.getExtInfo("keyUsage");if(K===void 0)return"";C=y(this.hex,K.vidx)}if(C.length!=8&&C.length!=10)throw new Error("malformed key usage value: "+C);var W="000000000000000"+parseInt(C.substr(6),16).toString(2);return C.length==8&&(W=W.slice(-8)),C.length==10&&(W=W.slice(-16)),(W=W.replace(/0+$/,""))==""&&(W="0"),W},this.getExtKeyUsageString=function(C){for(var K=this.getExtKeyUsageBin(C),W=new Array,z=0;z<K.length;z++)K.substr(z,1)=="1"&&W.push(ct.KEYUSAGE_NAME[z]);return W.join(",")},this.getExtSubjectKeyIdentifier=function(C,K){if(C===void 0&&K===void 0){var W=this.getExtInfo("subjectKeyIdentifier");if(W===void 0)return;C=y(this.hex,W.vidx),K=W.critical}var z={extname:"subjectKeyIdentifier"};K&&(z.critical=!0);var te=v(C,0);return z.kid={hex:te},z},this.getExtAuthorityKeyIdentifier=function(C,K){if(C===void 0&&K===void 0){var W=this.getExtInfo("authorityKeyIdentifier");if(W===void 0)return;C=y(this.hex,W.vidx),K=W.critical}var z={extname:"authorityKeyIdentifier"};K&&(z.critical=!0);for(var te=l(C,0),ie=0;ie<te.length;ie++){var ge=C.substr(te[ie],2);if(ge==="80"&&(z.kid={hex:v(C,te[ie])}),ge==="a1"){var ce=y(C,te[ie]),Ce=this.getGeneralNames(ce);z.issuer=Ce[0].dn}ge==="82"&&(z.sn={hex:v(C,te[ie])})}return z},this.getExtExtKeyUsage=function(C,K){if(C===void 0&&K===void 0){var W=this.getExtInfo("extKeyUsage");if(W===void 0)return;C=y(this.hex,W.vidx),K=W.critical}var z={extname:"extKeyUsage",array:[]};K&&(z.critical=!0);for(var te=l(C,0),ie=0;ie<te.length;ie++)z.array.push(X(v(C,te[ie])));return z},this.getExtExtKeyUsageName=function(){var C=this.getExtInfo("extKeyUsage");if(C===void 0)return C;var K=new Array,W=y(this.hex,C.vidx);if(W==="")return K;for(var z=l(W,0),te=0;te<z.length;te++)K.push(X(v(W,z[te])));return K},this.getExtSubjectAltName=function(C,K){if(C===void 0&&K===void 0){var W=this.getExtInfo("subjectAltName");if(W===void 0)return;C=y(this.hex,W.vidx),K=W.critical}var z={extname:"subjectAltName",array:[]};return K&&(z.critical=!0),z.array=this.getGeneralNames(C),z},this.getExtIssuerAltName=function(C,K){if(C===void 0&&K===void 0){var W=this.getExtInfo("issuerAltName");if(W===void 0)return;C=y(this.hex,W.vidx),K=W.critical}var z={extname:"issuerAltName",array:[]};return K&&(z.critical=!0),z.array=this.getGeneralNames(C),z},this.getGeneralNames=function(C){for(var K=l(C,0),W=[],z=0;z<K.length;z++){var te=this.getGeneralName(y(C,K[z]));te!==void 0&&W.push(te)}return W},this.getGeneralName=function(C){var K=C.substr(0,2),W=v(C,0),z=Kt(W);return K=="81"?{rfc822:z}:K=="82"?{dns:z}:K=="86"?{uri:z}:K=="87"?{ip:Yi(W)}:K=="a4"?{dn:this.getX500Name(W)}:void 0},this.getExtSubjectAltName2=function(){var C,K,W,z=this.getExtInfo("subjectAltName");if(z===void 0)return z;for(var te=new Array,ie=y(this.hex,z.vidx),ge=l(ie,0),ce=0;ce<ge.length;ce++)W=ie.substr(ge[ce],2),C=v(ie,ge[ce]),W==="81"&&(K=Pt(C),te.push(["MAIL",K])),W==="82"&&(K=Pt(C),te.push(["DNS",K])),W==="84"&&(K=ct.hex2dn(C,0),te.push(["DN",K])),W==="86"&&(K=Pt(C),te.push(["URI",K])),W==="87"&&(K=Yi(C),te.push(["IP",K]));return te},this.getExtCRLDistributionPoints=function(C,K){if(C===void 0&&K===void 0){var W=this.getExtInfo("cRLDistributionPoints");if(W===void 0)return;C=y(this.hex,W.vidx),K=W.critical}var z={extname:"cRLDistributionPoints",array:[]};K&&(z.critical=!0);for(var te=l(C,0),ie=0;ie<te.length;ie++){var ge=y(C,te[ie]);z.array.push(this.getDistributionPoint(ge))}return z},this.getDistributionPoint=function(C){for(var K={},W=l(C,0),z=0;z<W.length;z++){var te=C.substr(W[z],2),ie=y(C,W[z]);te=="a0"&&(K.dpname=this.getDistributionPointName(ie))}return K},this.getDistributionPointName=function(C){for(var K={},W=l(C,0),z=0;z<W.length;z++){var te=C.substr(W[z],2),ie=y(C,W[z]);te=="a0"&&(K.full=this.getGeneralNames(ie))}return K},this.getExtCRLDistributionPointsURI=function(){var C=this.getExtInfo("cRLDistributionPoints");if(C===void 0)return C;for(var K=new Array,W=l(this.hex,C.vidx),z=0;z<W.length;z++)try{var te=Pt(k(this.hex,W[z],[0,0,0],"86"));K.push(te)}catch{}return K},this.getExtAIAInfo=function(){var C=this.getExtInfo("authorityInfoAccess");if(C===void 0)return C;for(var K={ocsp:[],caissuer:[]},W=l(this.hex,C.vidx),z=0;z<W.length;z++){var te=k(this.hex,W[z],[0],"06"),ie=k(this.hex,W[z],[1],"86");te==="2b06010505073001"&&K.ocsp.push(Pt(ie)),te==="2b06010505073002"&&K.caissuer.push(Pt(ie))}return K},this.getExtAuthorityInfoAccess=function(C,K){if(C===void 0&&K===void 0){var W=this.getExtInfo("authorityInfoAccess");if(W===void 0)return;C=y(this.hex,W.vidx),K=W.critical}var z={extname:"authorityInfoAccess",array:[]};K&&(z.critical=!0);for(var te=l(C,0),ie=0;ie<te.length;ie++){var ge=B(C,te[ie],[0],"06"),ce=Pt(k(C,te[ie],[1],"86"));if(ge=="2b06010505073001")z.array.push({ocsp:ce});else{if(ge!="2b06010505073002")throw new Error("unknown method: "+ge);z.array.push({caissuer:ce})}}return z},this.getExtCertificatePolicies=function(C,K){if(C===void 0&&K===void 0){var W=this.getExtInfo("certificatePolicies");if(W===void 0)return;C=y(this.hex,W.vidx),K=W.critical}var z={extname:"certificatePolicies",array:[]};K&&(z.critical=!0);for(var te=l(C,0),ie=0;ie<te.length;ie++){var ge=y(C,te[ie]),ce=this.getPolicyInformation(ge);z.array.push(ce)}return z},this.getPolicyInformation=function(C){var K={},W=k(C,0,[0],"06");K.policyoid=X(W);var z=V(C,0,[1],"30");if(z!=-1){K.array=[];for(var te=l(C,z),ie=0;ie<te.length;ie++){var ge=y(C,te[ie]),ce=this.getPolicyQualifierInfo(ge);K.array.push(ce)}}return K},this.getPolicyQualifierInfo=function(C){var K={},W=k(C,0,[0],"06");if(W==="2b06010505070201"){var z=B(C,0,[1],"16");K.cps=Kt(z)}else if(W==="2b06010505070202"){var te=U(C,0,[1],"30");K.unotice=this.getUserNotice(te)}return K},this.getUserNotice=function(C){for(var K={},W=l(C,0),z=0;z<W.length;z++){var te=y(C,W[z]);te.substr(0,2)!="30"&&(K.exptext=this.getDisplayText(te))}return K},this.getDisplayText=function(C){var K={};return K.type={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"}[C.substr(0,2)],K.str=Kt(v(C,0)),K},this.getExtCRLNumber=function(C,K){var W={extname:"cRLNumber"};if(K&&(W.critical=!0),C.substr(0,2)=="02")return W.num={hex:v(C,0)},W;throw new Error("hExtV parse error: "+C)},this.getExtCRLReason=function(C,K){var W={extname:"cRLReason"};if(K&&(W.critical=!0),C.substr(0,2)=="0a")return W.code=parseInt(v(C,0),16),W;throw new Error("hExtV parse error: "+C)},this.getExtOcspNonce=function(C,K){var W={extname:"ocspNonce"};K&&(W.critical=!0);var z=v(C,0);return W.hex=z,W},this.getExtOcspNoCheck=function(C,K){var W={extname:"ocspNoCheck"};return K&&(W.critical=!0),W},this.getExtAdobeTimeStamp=function(C,K){if(C===void 0&&K===void 0){var W=this.getExtInfo("adobeTimeStamp");if(W===void 0)return;C=y(this.hex,W.vidx),K=W.critical}var z={extname:"adobeTimeStamp"};K&&(z.critical=!0);var te=l(C,0);if(te.length>1){var ie=y(C,te[1]),ge=this.getGeneralName(ie);ge.uri!=null&&(z.uri=ge.uri)}if(te.length>2){var ce=y(C,te[2]);ce=="0101ff"&&(z.reqauth=!0),ce=="010100"&&(z.reqauth=!1)}return z},this.getX500NameRule=function(C){for(var K=null,W=[],z=0;z<C.length;z++)for(var te=C[z],ie=0;ie<te.length;ie++)W.push(te[ie]);for(z=0;z<W.length;z++){var ge=W[z],ce=ge.ds,Ce=ge.value,de=ge.type;if(ce!="prn"&&ce!="utf8"&&ce!="ia5")return"mixed";if(ce=="ia5"){if(de!="CN")return"mixed";if(M.lang.String.isMail(Ce))continue;return"mixed"}if(de=="C"){if(ce=="prn")continue;return"mixed"}if(K==null)K=ce;else if(K!==ce)return"mixed"}return K??"prn"},this.getX500Name=function(C){var K=this.getX500NameArray(C);return{array:K,str:this.dnarraytostr(K)}},this.getX500NameArray=function(C){for(var K=[],W=l(C,0),z=0;z<W.length;z++)K.push(this.getRDN(y(C,W[z])));return K},this.getRDN=function(C){for(var K=[],W=l(C,0),z=0;z<W.length;z++)K.push(this.getAttrTypeAndValue(y(C,W[z])));return K},this.getAttrTypeAndValue=function(C){var K={type:null,value:null,ds:null},W=l(C,0),z=k(C,W[0],[],"06"),te=k(C,W[1],[]),ie=M.asn1.ASN1Util.oidHexToInt(z);return K.type=M.asn1.x509.OID.oid2atype(ie),K.value=Kt(te),K.ds=this.HEX2STAG[C.substr(W[1],2)],K},this.readCertPEM=function(C){this.readCertHex(re(C))},this.readCertHex=function(C){this.hex=C,this.getVersion();try{$(this.hex,0,[0,7],"a3"),this.parseExt()}catch{}},this.getParam=function(){var C={};return C.version=this.getVersion(),C.serial={hex:this.getSerialNumberHex()},C.sigalg=this.getSignatureAlgorithmField(),C.issuer=this.getIssuer(),C.notbefore=this.getNotBefore(),C.notafter=this.getNotAfter(),C.subject=this.getSubject(),C.sbjpubkey=Ut(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(C.ext=this.getExtParamArray()),C.sighex=this.getSignatureValueHex(),C},this.getExtParamArray=function(C){C==null&&V(this.hex,0,[0,"[3]"])!=-1&&(C=j(this.hex,0,[0,"[3]",0],"30"));for(var K=[],W=l(C,0),z=0;z<W.length;z++){var te=y(C,W[z]),ie=this.getExtParam(te);ie!=null&&K.push(ie)}return K},this.getExtParam=function(C){var K=l(C,0).length;if(K!=2&&K!=3)throw new Error("wrong number elements in Extension: "+K+" "+C);var W=ee(k(C,0,[0],"06")),z=!1;K==3&&U(C,0,[1])=="0101ff"&&(z=!0);var te=U(C,0,[K-1,0]),ie=void 0;if(W=="2.5.29.14"?ie=this.getExtSubjectKeyIdentifier(te,z):W=="2.5.29.15"?ie=this.getExtKeyUsage(te,z):W=="2.5.29.17"?ie=this.getExtSubjectAltName(te,z):W=="2.5.29.18"?ie=this.getExtIssuerAltName(te,z):W=="2.5.29.19"?ie=this.getExtBasicConstraints(te,z):W=="2.5.29.31"?ie=this.getExtCRLDistributionPoints(te,z):W=="2.5.29.32"?ie=this.getExtCertificatePolicies(te,z):W=="2.5.29.35"?ie=this.getExtAuthorityKeyIdentifier(te,z):W=="2.5.29.37"?ie=this.getExtExtKeyUsage(te,z):W=="1.3.6.1.5.5.7.1.1"?ie=this.getExtAuthorityInfoAccess(te,z):W=="2.5.29.20"?ie=this.getExtCRLNumber(te,z):W=="2.5.29.21"?ie=this.getExtCRLReason(te,z):W=="1.3.6.1.5.5.7.48.1.2"?ie=this.getExtOcspNonce(te,z):W=="1.3.6.1.5.5.7.48.1.5"?ie=this.getExtOcspNoCheck(te,z):W=="1.2.840.113583.1.1.9.1"&&(ie=this.getExtAdobeTimeStamp(te,z)),ie!=null)return ie;var ge={extname:W,extn:te};return z&&(ge.critical=!0),ge},this.findExt=function(C,K){for(var W=0;W<C.length;W++)if(C[W].extname==K)return C[W];return null},this.updateExtCDPFullURI=function(C,K){var W=this.findExt(C,"cRLDistributionPoints");if(W!=null&&W.array!=null){for(var z=W.array,te=0;te<z.length;te++)if(z[te].dpname!=null&&z[te].dpname.full!=null)for(var ie=z[te].dpname.full,ge=0;ge<ie.length;ge++){var ce=ie[te];ce.uri!=null&&(ce.uri=K)}}},this.updateExtAIAOCSP=function(C,K){var W=this.findExt(C,"authorityInfoAccess");if(W!=null&&W.array!=null)for(var z=W.array,te=0;te<z.length;te++)z[te].ocsp!=null&&(z[te].ocsp=K)},this.updateExtAIACAIssuer=function(C,K){var W=this.findExt(C,"authorityInfoAccess");if(W!=null&&W.array!=null)for(var z=W.array,te=0;te<z.length;te++)z[te].caissuer!=null&&(z[te].caissuer=K)},this.dnarraytostr=function(C){return"/"+C.map(function(K){return function(z){return z.map(function(te){return function(ge){return ge.type+"="+ge.value}(te)}).join("+")}(K)}).join("/")},this.getInfo=function(){var C,K,W,z=function(xt){return JSON.stringify(xt.array).replace(/[\[\]\{\}\"]/g,"")},te=function(xt){for(var It="",Dt=xt.array,it=0;it<Dt.length;it++){var vt=Dt[it];if(It+=" policy oid: "+vt.policyoid+`
69
+ `,vt.array!==void 0)for(var kt=0;kt<vt.array.length;kt++){var Nt=vt.array[kt];Nt.cps!==void 0&&(It+=" cps: "+Nt.cps+`
70
+ `)}}return It},ie=function(xt){for(var It="",Dt=xt.array,it=0;it<Dt.length;it++){var vt=Dt[it];try{vt.dpname.full[0].uri!==void 0&&(It+=" "+vt.dpname.full[0].uri+`
71
+ `)}catch{}try{vt.dname.full[0].dn.hex!==void 0&&(It+=" "+ct.hex2dn(vt.dpname.full[0].dn.hex)+`
72
+ `)}catch{}}return It},ge=function(xt){for(var It="",Dt=xt.array,it=0;it<Dt.length;it++){var vt=Dt[it];vt.caissuer!==void 0&&(It+=" caissuer: "+vt.caissuer+`
73
+ `),vt.ocsp!==void 0&&(It+=" ocsp: "+vt.ocsp+`
74
+ `)}return It};if(C=`Basic Fields
75
+ `,C+=" serial number: "+this.getSerialNumberHex()+`
76
+ `,C+=" signature algorithm: "+this.getSignatureAlgorithmField()+`
77
+ `,C+=" issuer: "+this.getIssuerString()+`
78
+ `,C+=" notBefore: "+this.getNotBefore()+`
79
+ `,C+=" notAfter: "+this.getNotAfter()+`
80
+ `,C+=" subject: "+this.getSubjectString()+`
81
+ `,C+=` subject public key info:
82
+ `,C+=" key algorithm: "+(K=this.getPublicKey()).type+`
83
+ `,K.type==="RSA"&&(C+=" n="+Gi(K.n.toString(16)).substr(0,16)+`...
84
+ `,C+=" e="+Gi(K.e.toString(16))+`
85
+ `),(W=this.aExtInfo)!=null){C+=`X509v3 Extensions:
86
+ `;for(var ce=0;ce<W.length;ce++){var Ce=W[ce],de=M.asn1.x509.OID.oid2name(Ce.oid);de===""&&(de=Ce.oid);var ye="";if(Ce.critical===!0&&(ye="CRITICAL"),C+=" "+de+" "+ye+`:
87
+ `,de==="basicConstraints"){var qe=this.getExtBasicConstraints();qe.cA===void 0?C+=` {}
88
+ `:(C+=" cA=true",qe.pathLen!==void 0&&(C+=", pathLen="+qe.pathLen),C+=`
89
+ `)}else if(de==="keyUsage")C+=" "+this.getExtKeyUsageString()+`
90
+ `;else if(de==="subjectKeyIdentifier")C+=" "+this.getExtSubjectKeyIdentifier().kid.hex+`
91
+ `;else if(de==="authorityKeyIdentifier"){var Xe=this.getExtAuthorityKeyIdentifier();Xe.kid!==void 0&&(C+=" kid="+Xe.kid.hex+`
92
+ `)}else de==="extKeyUsage"?C+=" "+this.getExtExtKeyUsage().array.join(", ")+`
93
+ `:de==="subjectAltName"?C+=" "+z(this.getExtSubjectAltName())+`
94
+ `:de==="cRLDistributionPoints"?C+=ie(this.getExtCRLDistributionPoints()):de==="authorityInfoAccess"?C+=ge(this.getExtAuthorityInfoAccess()):de==="certificatePolicies"&&(C+=te(this.getExtCertificatePolicies()))}}return C+="signature algorithm: "+this.getSignatureAlgorithmName()+`
95
+ `,C+="signature: "+this.getSignatureValueHex().substr(0,16)+`...
96
+ `},typeof o=="string"&&(o.indexOf("-----BEGIN")!=-1?this.readCertPEM(o):M.lang.String.isHex(o)&&this.readCertHex(o))}me.prototype.sign=function(o,i){var u=function(v){return M.crypto.Util.hashString(v,i)}(o);return this.signWithMessageHash(u,i)},me.prototype.signWithMessageHash=function(o,i){var u=Ct(M.crypto.Util.getPaddedDigestInfoHex(o,i,this.n.bitLength()),16);return Vs(this.doPrivate(u).toString(16),this.n.bitLength())},me.prototype.signPSS=function(o,i,u){var l=function(y){return M.crypto.Util.hashHex(y,i)}(cn(o));return u===void 0&&(u=-1),this.signWithMessageHashPSS(l,i,u)},me.prototype.signWithMessageHashPSS=function(o,i,u){var l,v=Kt(o),y=v.length,k=this.n.bitLength()-1,B=Math.ceil(k/8),U=function(C){return M.crypto.Util.hashHex(C,i)};if(u===-1||u===void 0)u=y;else if(u===-2)u=B-y-2;else if(u<-2)throw new Error("invalid salt length");if(B<y+u+2)throw new Error("data too long");var j="";u>0&&(j=new Array(u),new St().nextBytes(j),j=String.fromCharCode.apply(String,j));var $=Kt(U(cn("\0\0\0\0\0\0\0\0"+v+j))),V=[];for(l=0;l<B-u-y-2;l+=1)V[l]=0;var J=String.fromCharCode.apply(String,V)+""+j,X=qs($,J.length,U),ee=[];for(l=0;l<J.length;l+=1)ee[l]=J.charCodeAt(l)^X.charCodeAt(l);var ne=65280>>8*B-k&255;for(ee[0]&=~ne,l=0;l<y;l++)ee.push($.charCodeAt(l));return ee.push(188),Vs(this.doPrivate(new x(ee)).toString(16),this.n.bitLength())},me.prototype.verify=function(o,i){var u=Ct(i=(i=i.replace(Pl,"")).replace(/[ \n]+/g,""),16);if(u.bitLength()>this.n.bitLength())return 0;var l=Ws(this.doPublic(u).toString(16).replace(/^1f+00/,""));if(l.length==0)return!1;var v=l[0];return l[1]==function(k){return M.crypto.Util.hashString(k,v)}(o)},me.prototype.verifyWithMessageHash=function(o,i){if(i.length!=Math.ceil(this.n.bitLength()/4))return!1;var u=Ct(i,16);if(u.bitLength()>this.n.bitLength())return 0;var l=Ws(this.doPublic(u).toString(16).replace(/^1f+00/,""));return l.length==0?!1:(l[0],l[1]==o)},me.prototype.verifyPSS=function(o,i,u,l){var v=function(k){return M.crypto.Util.hashHex(k,u)}(cn(o));return l===void 0&&(l=-1),this.verifyWithMessageHashPSS(v,i,u,l)},me.prototype.verifyWithMessageHashPSS=function(o,i,u,l){if(i.length!=Math.ceil(this.n.bitLength()/4))return!1;var v,y=new x(i,16),k=function(W){return M.crypto.Util.hashHex(W,u)},B=Kt(o),U=B.length,j=this.n.bitLength()-1,$=Math.ceil(j/8);if(l===-1||l===void 0)l=U;else if(l===-2)l=$-U-2;else if(l<-2)throw new Error("invalid salt length");if($<U+l+2)throw new Error("data too long");var V=this.doPublic(y).toByteArray();for(v=0;v<V.length;v+=1)V[v]&=255;for(;V.length<$;)V.unshift(0);if(V[$-1]!==188)throw new Error("encoded message does not end in 0xbc");var J=(V=String.fromCharCode.apply(String,V)).substr(0,$-U-1),X=V.substr(J.length,U),ee=65280>>8*$-j&255;if(J.charCodeAt(0)&ee)throw new Error("bits beyond keysize not zero");var ne=qs(X,J.length,k),re=[];for(v=0;v<J.length;v+=1)re[v]=J.charCodeAt(v)^ne.charCodeAt(v);re[0]&=~ee;var C=$-U-l-2;for(v=0;v<C;v+=1)if(re[v]!==0)throw new Error("leftmost octets not zero");if(re[C]!==1)throw new Error("0x01 marker not found");return X===Kt(k(cn("\0\0\0\0\0\0\0\0"+B+String.fromCharCode.apply(String,re.slice(-l)))))},me.SALT_LEN_HLEN=-1,me.SALT_LEN_MAX=-2,me.SALT_LEN_RECOVER=-2,ct.hex2dn=function(o,i){if(i===void 0&&(i=0),o.substr(i,2)!=="30")throw new Error("malformed DN");for(var u=new Array,l=fe.getChildIdx(o,i),v=0;v<l.length;v++)u.push(ct.hex2rdn(o,l[v]));return"/"+(u=u.map(function(y){return y.replace("/","\\/")})).join("/")},ct.hex2rdn=function(o,i){if(i===void 0&&(i=0),o.substr(i,2)!=="31")throw new Error("malformed RDN");for(var u=new Array,l=fe.getChildIdx(o,i),v=0;v<l.length;v++)u.push(ct.hex2attrTypeValue(o,l[v]));return(u=u.map(function(y){return y.replace("+","\\+")})).join("+")},ct.hex2attrTypeValue=function(o,i){var u=fe,l=u.getV;if(i===void 0&&(i=0),o.substr(i,2)!=="30")throw new Error("malformed attribute type and value");var v=u.getChildIdx(o,i);v.length!==2||o.substr(v[0],2);var y=l(o,v[0]),k=M.asn1.ASN1Util.oidHexToInt(y);return M.asn1.x509.OID.oid2atype(k)+"="+Kt(l(o,v[1]))},ct.getPublicKeyFromCertHex=function(o){var i=new ct;return i.readCertHex(o),i.getPublicKey()},ct.getPublicKeyFromCertPEM=function(o){var i=new ct;return i.readCertPEM(o),i.getPublicKey()},ct.getPublicKeyInfoPropOfCertPEM=function(o){var i,u,l=fe.getVbyList,v={};return v.algparam=null,(i=new ct).readCertPEM(o),u=i.getPublicKeyHex(),v.keyhex=l(u,0,[1],"03").substr(2),v.algoid=l(u,0,[0,0],"06"),v.algoid==="2a8648ce3d0201"&&(v.algparam=l(u,0,[0,1],"06")),v},ct.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"],M!==void 0&&M||(r.KJUR=M={}),M.jws!==void 0&&M.jws||(M.jws={}),M.jws.JWS=function(){var o=M.jws.JWS.isSafeJSONString;this.parseJWS=function(i,u){if(this.parsedJWS===void 0||!u&&this.parsedJWS.sigvalH===void 0){var l=i.match(/^([^.]+)\.([^.]+)\.([^.]+)$/);if(l==null)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";var v=l[1],y=l[2],k=l[3],B=v+"."+y;if(this.parsedJWS={},this.parsedJWS.headB64U=v,this.parsedJWS.payloadB64U=y,this.parsedJWS.sigvalB64U=k,this.parsedJWS.si=B,!u){var U=Je(k),j=Ct(U,16);this.parsedJWS.sigvalH=U,this.parsedJWS.sigvalBI=j}var $=$t(v),V=$t(y);if(this.parsedJWS.headS=$,this.parsedJWS.payloadS=V,!o($,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+$}}},M.jws.JWS.sign=function(o,i,u,l,v){var y,k,B,U=M,j=U.jws.JWS,$=j.readSafeJSONString,V=j.isSafeJSONString,J=U.crypto,X=(J.ECDSA,J.Mac),ee=J.Signature,ne=JSON;if(typeof i!="string"&&(i===void 0?"undefined":c(i))!="object")throw"spHeader must be JSON string or object: "+i;if((i===void 0?"undefined":c(i))=="object"&&(k=i,y=ne.stringify(k)),typeof i=="string"){if(!V(y=i))throw"JWS Head is not safe JSON string: "+y;k=$(y)}if(B=u,(u===void 0?"undefined":c(u))=="object"&&(B=ne.stringify(u)),o!=""&&o!=null||k.alg===void 0||(o=k.alg),o!=""&&o!=null&&k.alg===void 0&&(k.alg=o,y=ne.stringify(k)),o!==k.alg)throw"alg and sHeader.alg doesn't match: "+o+"!="+k.alg;var re=null;if(j.jwsalg2sigalg[o]===void 0)throw"unsupported alg name: "+o;re=j.jwsalg2sigalg[o];var C=Bn(y)+"."+Bn(B),K="";if(re.substr(0,4)=="Hmac"){if(l===void 0)throw"mac key shall be specified for HS* alg";var W=new X({alg:re,prov:"cryptojs",pass:l});W.updateString(C),K=W.doFinal()}else if(re.indexOf("withECDSA")!=-1){(te=new ee({alg:re})).init(l,v),te.updateString(C);var z=te.sign();K=M.crypto.ECDSA.asn1SigToConcatSig(z)}else{var te;re!="none"&&((te=new ee({alg:re})).init(l,v),te.updateString(C),K=te.sign())}return C+"."+Ze(K)},M.jws.JWS.verify=function(o,i,u){var l,v=M,y=v.jws.JWS,k=y.readSafeJSONString,B=v.crypto,U=B.ECDSA,j=B.Mac,$=B.Signature;c(me)!==void 0&&(l=me);var V=o.split(".");if(V.length!==3)return!1;var J=V[0]+"."+V[1],X=Je(V[2]),ee=k($t(V[0])),ne=null,re=null;if(ee.alg===void 0)throw"algorithm not specified in header";if(re=(ne=ee.alg).substr(0,2),u!=null&&Object.prototype.toString.call(u)==="[object Array]"&&u.length>0&&(":"+u.join(":")+":").indexOf(":"+ne+":")==-1)throw"algorithm '"+ne+"' not accepted in the list";if(ne!="none"&&i===null)throw"key shall be specified to verify.";if(typeof i=="string"&&i.indexOf("-----BEGIN ")!=-1&&(i=ut.getKey(i)),!(re!="RS"&&re!="PS"||i instanceof l))throw"key shall be a RSAKey obj for RS* and PS* algs";if(re=="ES"&&!(i instanceof U))throw"key shall be a ECDSA obj for ES* algs";var C=null;if(y.jwsalg2sigalg[ee.alg]===void 0)throw"unsupported alg name: "+ne;if((C=y.jwsalg2sigalg[ne])=="none")throw"not supported";if(C.substr(0,4)=="Hmac"){if(i===void 0)throw"hexadecimal key shall be specified for HMAC";var K=new j({alg:C,pass:i});return K.updateString(J),X==K.doFinal()}if(C.indexOf("withECDSA")!=-1){var W,z=null;try{z=U.concatSigToASN1Sig(X)}catch{return!1}return(W=new $({alg:C})).init(i),W.updateString(J),W.verify(z)}return(W=new $({alg:C})).init(i),W.updateString(J),W.verify(X)},M.jws.JWS.parse=function(o){var i,u,l,v=o.split("."),y={};if(v.length!=2&&v.length!=3)throw"malformed sJWS: wrong number of '.' splitted elements";return i=v[0],u=v[1],v.length==3&&(l=v[2]),y.headerObj=M.jws.JWS.readSafeJSONString($t(i)),y.payloadObj=M.jws.JWS.readSafeJSONString($t(u)),y.headerPP=JSON.stringify(y.headerObj,null," "),y.payloadObj==null?y.payloadPP=$t(u):y.payloadPP=JSON.stringify(y.payloadObj,null," "),l!==void 0&&(y.sigHex=Je(l)),y},M.jws.JWS.verifyJWT=function(o,i,u){var l=M.jws,v=l.JWS,y=v.readSafeJSONString,k=v.inArray,B=v.includedArray,U=o.split("."),j=U[0],$=U[1],V=(Je(U[2]),y($t(j))),J=y($t($));if(V.alg===void 0)return!1;if(u.alg===void 0)throw"acceptField.alg shall be specified";if(!k(V.alg,u.alg)||J.iss!==void 0&&c(u.iss)==="object"&&!k(J.iss,u.iss)||J.sub!==void 0&&c(u.sub)==="object"&&!k(J.sub,u.sub))return!1;if(J.aud!==void 0&&c(u.aud)==="object"){if(typeof J.aud=="string"){if(!k(J.aud,u.aud))return!1}else if(c(J.aud)=="object"&&!B(J.aud,u.aud))return!1}var X=l.IntDate.getNow();return u.verifyAt!==void 0&&typeof u.verifyAt=="number"&&(X=u.verifyAt),u.gracePeriod!==void 0&&typeof u.gracePeriod=="number"||(u.gracePeriod=0),!(J.exp!==void 0&&typeof J.exp=="number"&&J.exp+u.gracePeriod<X)&&!(J.nbf!==void 0&&typeof J.nbf=="number"&&X<J.nbf-u.gracePeriod)&&!(J.iat!==void 0&&typeof J.iat=="number"&&X<J.iat-u.gracePeriod)&&(J.jti===void 0||u.jti===void 0||J.jti===u.jti)&&!!v.verify(o,i,u.alg)},M.jws.JWS.includedArray=function(o,i){var u=M.jws.JWS.inArray;if(o===null||(o===void 0?"undefined":c(o))!=="object"||typeof o.length!="number")return!1;for(var l=0;l<o.length;l++)if(!u(o[l],i))return!1;return!0},M.jws.JWS.inArray=function(o,i){if(i===null||(i===void 0?"undefined":c(i))!=="object"||typeof i.length!="number")return!1;for(var u=0;u<i.length;u++)if(i[u]==o)return!0;return!1},M.jws.JWS.jwsalg2sigalg={HS256:"HmacSHA256",HS384:"HmacSHA384",HS512:"HmacSHA512",RS256:"SHA256withRSA",RS384:"SHA384withRSA",RS512:"SHA512withRSA",ES256:"SHA256withECDSA",ES384:"SHA384withECDSA",PS256:"SHA256withRSAandMGF1",PS384:"SHA384withRSAandMGF1",PS512:"SHA512withRSAandMGF1",none:"none"},M.jws.JWS.isSafeJSONString=function(o,i,u){var l=null;try{return((l=ni(o))===void 0?"undefined":c(l))!="object"||l.constructor===Array?0:(i&&(i[u]=l),1)}catch{return 0}},M.jws.JWS.readSafeJSONString=function(o){var i=null;try{return((i=ni(o))===void 0?"undefined":c(i))!="object"||i.constructor===Array?null:i}catch{return null}},M.jws.JWS.getEncodedSignatureValueFromJWS=function(o){var i=o.match(/^[^.]+\.[^.]+\.([^.]+)$/);if(i==null)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";return i[1]},M.jws.JWS.getJWKthumbprint=function(o){if(o.kty!=="RSA"&&o.kty!=="EC"&&o.kty!=="oct")throw"unsupported algorithm for JWK Thumprint";var i="{";if(o.kty==="RSA"){if(typeof o.n!="string"||typeof o.e!="string")throw"wrong n and e value for RSA key";i+='"e":"'+o.e+'",',i+='"kty":"'+o.kty+'",',i+='"n":"'+o.n+'"}'}else if(o.kty==="EC"){if(typeof o.crv!="string"||typeof o.x!="string"||typeof o.y!="string")throw"wrong crv, x and y value for EC key";i+='"crv":"'+o.crv+'",',i+='"kty":"'+o.kty+'",',i+='"x":"'+o.x+'",',i+='"y":"'+o.y+'"}'}else if(o.kty==="oct"){if(typeof o.k!="string")throw"wrong k value for oct(symmetric) key";i+='"kty":"'+o.kty+'",',i+='"k":"'+o.k+'"}'}var u=cn(i);return Ze(M.crypto.Util.hashHex(u,"sha256"))},M.jws.IntDate={},M.jws.IntDate.get=function(o){var i=M.jws.IntDate,u=i.getNow,l=i.getZulu;if(o=="now")return u();if(o=="now + 1hour")return u()+3600;if(o=="now + 1day")return u()+86400;if(o=="now + 1month")return u()+2592e3;if(o=="now + 1year")return u()+31536e3;if(o.match(/Z$/))return l(o);if(o.match(/^[0-9]+$/))return parseInt(o);throw"unsupported format: "+o},M.jws.IntDate.getZulu=function(o){return js(o)},M.jws.IntDate.getNow=function(){return~~(new Date/1e3)},M.jws.IntDate.intDate2UTCString=function(o){return new Date(1e3*o).toUTCString()},M.jws.IntDate.intDate2Zulu=function(o){var i=new Date(1e3*o);return("0000"+i.getUTCFullYear()).slice(-4)+("00"+(i.getUTCMonth()+1)).slice(-2)+("00"+i.getUTCDate()).slice(-2)+("00"+i.getUTCHours()).slice(-2)+("00"+i.getUTCMinutes()).slice(-2)+("00"+i.getUTCSeconds()).slice(-2)+"Z"},r.SecureRandom=St,r.rng_seed_time=se,r.BigInteger=x,r.RSAKey=me;var kl=M.crypto.EDSA;r.EDSA=kl;var Tl=M.crypto.DSA;r.DSA=Tl;var Cl=M.crypto.Signature;r.Signature=Cl;var Il=M.crypto.MessageDigest;r.MessageDigest=Il;var Rl=M.crypto.Mac;r.Mac=Rl;var Ol=M.crypto.Cipher;r.Cipher=Ol,r.KEYUTIL=ut,r.ASN1HEX=fe,r.X509=ct,r.CryptoJS=O,r.b64tohex=H,r.b64toBA=Q,r.stoBA=ri,r.BAtos=oe,r.BAtohex=ae,r.stohex=he,r.stob64=function(i){return D(he(i))},r.stob64u=function(i){return We(D(he(i)))},r.b64utos=function(i){return oe(Q(gt(i)))},r.b64tob64u=We,r.b64utob64=gt,r.hex2b64=D,r.hextob64u=Ze,r.b64utohex=Je,r.utf8tob64u=Bn,r.b64utoutf8=$t,r.utf8tob64=function(i){return D(ii(si(i)))},r.b64toutf8=function(i){return decodeURIComponent(oi(H(i)))},r.utf8tohex=Ji,r.hextoutf8=Pt,r.hextorstr=Kt,r.rstrtohex=cn,r.hextob64=Ms,r.hextob64nl=Us,r.b64nltohex=xs,r.hextopem=Ut,r.pemtohex=ln,r.hextoArrayBuffer=function(i){if(i.length%2!=0)throw"input is not even length";if(i.match(/^[0-9A-Fa-f]+$/)==null)throw"input is not hexadecimal";for(var u=new ArrayBuffer(i.length/2),l=new DataView(u),v=0;v<i.length/2;v++)l.setUint8(v,parseInt(i.substr(2*v,2),16));return u},r.ArrayBuffertohex=function(i){for(var u="",l=new DataView(i),v=0;v<i.byteLength;v++)u+=("00"+l.getUint8(v).toString(16)).slice(-2);return u},r.zulutomsec=zi,r.zulutosec=js,r.zulutodate=function(i){return new Date(zi(i))},r.datetozulu=function(i,u,l){var v,y=i.getUTCFullYear();if(u){if(y<1950||2049<y)throw"not proper year for UTCTime: "+y;v=(""+y).slice(-2)}else v=("000"+y).slice(-4);if(v+=("0"+(i.getUTCMonth()+1)).slice(-2),v+=("0"+i.getUTCDate()).slice(-2),v+=("0"+i.getUTCHours()).slice(-2),v+=("0"+i.getUTCMinutes()).slice(-2),v+=("0"+i.getUTCSeconds()).slice(-2),l){var k=i.getUTCMilliseconds();k!==0&&(v+="."+(k=(k=("00"+k).slice(-3)).replace(/0+$/g,"")))}return v+="Z"},r.uricmptohex=ii,r.hextouricmp=oi,r.ipv6tohex=Bs,r.hextoipv6=Hs,r.hextoip=Yi,r.iptohex=function(i){var u="malformed IP address";if(!(i=i.toLowerCase(i)).match(/^[0-9.]+$/)){if(i.match(/^[0-9a-f:]+$/)&&i.indexOf(":")!==-1)return Bs(i);throw u}var l=i.split(".");if(l.length!==4)throw u;var v="";try{for(var y=0;y<4;y++)v+=("0"+parseInt(l[y]).toString(16)).slice(-2);return v}catch{throw u}},r.encodeURIComponentAll=si,r.newline_toUnix=function(i){return i=i.replace(/\r\n/gm,`
97
+ `)},r.newline_toDos=function(i){return i=(i=i.replace(/\r\n/gm,`
98
+ `)).replace(/\n/gm,`\r
99
+ `)},r.hextoposhex=Gi,r.intarystrtohex=function(i){i=(i=(i=i.replace(/^\s*\[\s*/,"")).replace(/\s*\]\s*$/,"")).replace(/\s*/g,"");try{return i.split(/,/).map(function(u,l,v){var y=parseInt(u);if(y<0||255<y)throw"integer not in range 0-255";return("00"+y.toString(16)).slice(-2)}).join("")}catch(u){throw"malformed integer array string: "+u}},r.strdiffidx=function(i,u){var l=i.length;i.length>u.length&&(l=u.length);for(var v=0;v<l;v++)if(i.charCodeAt(v)!=u.charCodeAt(v))return v;return i.length!=u.length?l:-1},r.KJUR=M;var Ll=M.crypto;r.crypto=Ll;var Dl=M.asn1;r.asn1=Dl;var Nl=M.jws;r.jws=Nl;var Ml=M.lang;r.lang=Ml}).call(this,s(28).Buffer)},function(n,r,s){(function(a){/*!
100
+ * The buffer module from node.js, for the browser.
101
+ *
102
+ * @author Feross Aboukhadijeh <http://feross.org>
103
+ * @license MIT
104
+ */var c=s(30),d=s(31),g=s(32);function f(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function p(q,b){if(f()<b)throw new RangeError("Invalid typed array length");return h.TYPED_ARRAY_SUPPORT?(q=new Uint8Array(b)).__proto__=h.prototype:(q===null&&(q=new h(b)),q.length=b),q}function h(q,b,F){if(!(h.TYPED_ARRAY_SUPPORT||this instanceof h))return new h(q,b,F);if(typeof q=="number"){if(typeof b=="string")throw new Error("If encoding is specified then the first argument must be a string");return w(this,q)}return m(this,q,b,F)}function m(q,b,F,Y){if(typeof b=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&b instanceof ArrayBuffer?function(Z,se,pe,Ee){if(se.byteLength,pe<0||se.byteLength<pe)throw new RangeError("'offset' is out of bounds");if(se.byteLength<pe+(Ee||0))throw new RangeError("'length' is out of bounds");return se=pe===void 0&&Ee===void 0?new Uint8Array(se):Ee===void 0?new Uint8Array(se,pe):new Uint8Array(se,pe,Ee),h.TYPED_ARRAY_SUPPORT?(Z=se).__proto__=h.prototype:Z=P(Z,se),Z}(q,b,F,Y):typeof b=="string"?function(Z,se,pe){if(typeof pe=="string"&&pe!==""||(pe="utf8"),!h.isEncoding(pe))throw new TypeError('"encoding" must be a valid string encoding');var Ee=0|R(se,pe),Me=(Z=p(Z,Ee)).write(se,pe);return Me!==Ee&&(Z=Z.slice(0,Me)),Z}(q,b,F):function(Z,se){if(h.isBuffer(se)){var pe=0|I(se.length);return(Z=p(Z,pe)).length===0||se.copy(Z,0,0,pe),Z}if(se){if(typeof ArrayBuffer<"u"&&se.buffer instanceof ArrayBuffer||"length"in se)return typeof se.length!="number"||function(Me){return Me!=Me}(se.length)?p(Z,0):P(Z,se);if(se.type==="Buffer"&&g(se.data))return P(Z,se.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(q,b)}function _(q){if(typeof q!="number")throw new TypeError('"size" argument must be a number');if(q<0)throw new RangeError('"size" argument must not be negative')}function w(q,b){if(_(b),q=p(q,b<0?0:0|I(b)),!h.TYPED_ARRAY_SUPPORT)for(var F=0;F<b;++F)q[F]=0;return q}function P(q,b){var F=b.length<0?0:0|I(b.length);q=p(q,F);for(var Y=0;Y<F;Y+=1)q[Y]=255&b[Y];return q}function I(q){if(q>=f())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f().toString(16)+" bytes");return 0|q}function R(q,b){if(h.isBuffer(q))return q.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(q)||q instanceof ArrayBuffer))return q.byteLength;typeof q!="string"&&(q=""+q);var F=q.length;if(F===0)return 0;for(var Y=!1;;)switch(b){case"ascii":case"latin1":case"binary":return F;case"utf8":case"utf-8":case void 0:return rt(q).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*F;case"hex":return F>>>1;case"base64":return De(q).length;default:if(Y)return rt(q).length;b=(""+b).toLowerCase(),Y=!0}}function E(q,b,F){var Y=!1;if((b===void 0||b<0)&&(b=0),b>this.length||((F===void 0||F>this.length)&&(F=this.length),F<=0)||(F>>>=0)<=(b>>>=0))return"";for(q||(q="utf8");;)switch(q){case"hex":return Ne(this,b,F);case"utf8":case"utf-8":return le(this,b,F);case"ascii":return Se(this,b,F);case"latin1":case"binary":return Te(this,b,F);case"base64":return ue(this,b,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ke(this,b,F);default:if(Y)throw new TypeError("Unknown encoding: "+q);q=(q+"").toLowerCase(),Y=!0}}function A(q,b,F){var Y=q[b];q[b]=q[F],q[F]=Y}function N(q,b,F,Y,G){if(q.length===0)return-1;if(typeof F=="string"?(Y=F,F=0):F>2147483647?F=2147483647:F<-2147483648&&(F=-2147483648),F=+F,isNaN(F)&&(F=G?0:q.length-1),F<0&&(F=q.length+F),F>=q.length){if(G)return-1;F=q.length-1}else if(F<0){if(!G)return-1;F=0}if(typeof b=="string"&&(b=h.from(b,Y)),h.isBuffer(b))return b.length===0?-1:O(q,b,F,Y,G);if(typeof b=="number")return b&=255,h.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?G?Uint8Array.prototype.indexOf.call(q,b,F):Uint8Array.prototype.lastIndexOf.call(q,b,F):O(q,[b],F,Y,G);throw new TypeError("val must be string, number or Buffer")}function O(q,b,F,Y,G){var Z,se=1,pe=q.length,Ee=b.length;if(Y!==void 0&&((Y=String(Y).toLowerCase())==="ucs2"||Y==="ucs-2"||Y==="utf16le"||Y==="utf-16le")){if(q.length<2||b.length<2)return-1;se=2,pe/=2,Ee/=2,F/=2}function Me(Ct,Ht){return se===1?Ct[Ht]:Ct.readUInt16BE(Ht*se)}if(G){var Ie=-1;for(Z=F;Z<pe;Z++)if(Me(q,Z)===Me(b,Ie===-1?0:Z-Ie)){if(Ie===-1&&(Ie=Z),Z-Ie+1===Ee)return Ie*se}else Ie!==-1&&(Z-=Z-Ie),Ie=-1}else for(F+Ee>pe&&(F=pe-Ee),Z=F;Z>=0;Z--){for(var Ge=!0,St=0;St<Ee;St++)if(Me(q,Z+St)!==Me(b,St)){Ge=!1;break}if(Ge)return Z}return-1}function L(q,b,F,Y){F=Number(F)||0;var G=q.length-F;Y?(Y=Number(Y))>G&&(Y=G):Y=G;var Z=b.length;if(Z%2!=0)throw new TypeError("Invalid hex string");Y>Z/2&&(Y=Z/2);for(var se=0;se<Y;++se){var pe=parseInt(b.substr(2*se,2),16);if(isNaN(pe))return se;q[F+se]=pe}return se}function S(q,b,F,Y){return He(rt(b,q.length-F),q,F,Y)}function D(q,b,F,Y){return He(function(Z){for(var se=[],pe=0;pe<Z.length;++pe)se.push(255&Z.charCodeAt(pe));return se}(b),q,F,Y)}function H(q,b,F,Y){return D(q,b,F,Y)}function Q(q,b,F,Y){return He(De(b),q,F,Y)}function x(q,b,F,Y){return He(function(Z,se){for(var pe,Ee,Me,Ie=[],Ge=0;Ge<Z.length&&!((se-=2)<0);++Ge)Ee=(pe=Z.charCodeAt(Ge))>>8,Me=pe%256,Ie.push(Me),Ie.push(Ee);return Ie}(b,q.length-F),q,F,Y)}function ue(q,b,F){return b===0&&F===q.length?c.fromByteArray(q):c.fromByteArray(q.slice(b,F))}function le(q,b,F){F=Math.min(q.length,F);for(var Y=[],G=b;G<F;){var Z,se,pe,Ee,Me=q[G],Ie=null,Ge=Me>239?4:Me>223?3:Me>191?2:1;if(G+Ge<=F)switch(Ge){case 1:Me<128&&(Ie=Me);break;case 2:(192&(Z=q[G+1]))==128&&(Ee=(31&Me)<<6|63&Z)>127&&(Ie=Ee);break;case 3:Z=q[G+1],se=q[G+2],(192&Z)==128&&(192&se)==128&&(Ee=(15&Me)<<12|(63&Z)<<6|63&se)>2047&&(Ee<55296||Ee>57343)&&(Ie=Ee);break;case 4:Z=q[G+1],se=q[G+2],pe=q[G+3],(192&Z)==128&&(192&se)==128&&(192&pe)==128&&(Ee=(15&Me)<<18|(63&Z)<<12|(63&se)<<6|63&pe)>65535&&Ee<1114112&&(Ie=Ee)}Ie===null?(Ie=65533,Ge=1):Ie>65535&&(Ie-=65536,Y.push(Ie>>>10&1023|55296),Ie=56320|1023&Ie),Y.push(Ie),G+=Ge}return function(Ct){var Ht=Ct.length;if(Ht<=be)return String.fromCharCode.apply(String,Ct);for(var me="",Ve=0;Ve<Ht;)me+=String.fromCharCode.apply(String,Ct.slice(Ve,Ve+=be));return me}(Y)}r.Buffer=h,r.SlowBuffer=function(b){return+b!=b&&(b=0),h.alloc(+b)},r.INSPECT_MAX_BYTES=50,h.TYPED_ARRAY_SUPPORT=a.TYPED_ARRAY_SUPPORT!==void 0?a.TYPED_ARRAY_SUPPORT:function(){try{var b=new Uint8Array(1);return b.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},b.foo()===42&&typeof b.subarray=="function"&&b.subarray(1,1).byteLength===0}catch{return!1}}(),r.kMaxLength=f(),h.poolSize=8192,h._augment=function(q){return q.__proto__=h.prototype,q},h.from=function(q,b,F){return m(null,q,b,F)},h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0})),h.alloc=function(q,b,F){return function(G,Z,se,pe){return _(Z),Z<=0?p(G,Z):se!==void 0?typeof pe=="string"?p(G,Z).fill(se,pe):p(G,Z).fill(se):p(G,Z)}(null,q,b,F)},h.allocUnsafe=function(q){return w(null,q)},h.allocUnsafeSlow=function(q){return w(null,q)},h.isBuffer=function(b){return!(b==null||!b._isBuffer)},h.compare=function(b,F){if(!h.isBuffer(b)||!h.isBuffer(F))throw new TypeError("Arguments must be Buffers");if(b===F)return 0;for(var Y=b.length,G=F.length,Z=0,se=Math.min(Y,G);Z<se;++Z)if(b[Z]!==F[Z]){Y=b[Z],G=F[Z];break}return Y<G?-1:G<Y?1:0},h.isEncoding=function(b){switch(String(b).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},h.concat=function(b,F){if(!g(b))throw new TypeError('"list" argument must be an Array of Buffers');if(b.length===0)return h.alloc(0);var Y;if(F===void 0)for(F=0,Y=0;Y<b.length;++Y)F+=b[Y].length;var G=h.allocUnsafe(F),Z=0;for(Y=0;Y<b.length;++Y){var se=b[Y];if(!h.isBuffer(se))throw new TypeError('"list" argument must be an Array of Buffers');se.copy(G,Z),Z+=se.length}return G},h.byteLength=R,h.prototype._isBuffer=!0,h.prototype.swap16=function(){var b=this.length;if(b%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var F=0;F<b;F+=2)A(this,F,F+1);return this},h.prototype.swap32=function(){var b=this.length;if(b%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var F=0;F<b;F+=4)A(this,F,F+3),A(this,F+1,F+2);return this},h.prototype.swap64=function(){var b=this.length;if(b%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var F=0;F<b;F+=8)A(this,F,F+7),A(this,F+1,F+6),A(this,F+2,F+5),A(this,F+3,F+4);return this},h.prototype.toString=function(){var b=0|this.length;return b===0?"":arguments.length===0?le(this,0,b):E.apply(this,arguments)},h.prototype.equals=function(b){if(!h.isBuffer(b))throw new TypeError("Argument must be a Buffer");return this===b||h.compare(this,b)===0},h.prototype.inspect=function(){var b="",F=r.INSPECT_MAX_BYTES;return this.length>0&&(b=this.toString("hex",0,F).match(/.{2}/g).join(" "),this.length>F&&(b+=" ... ")),"<Buffer "+b+">"},h.prototype.compare=function(b,F,Y,G,Z){if(!h.isBuffer(b))throw new TypeError("Argument must be a Buffer");if(F===void 0&&(F=0),Y===void 0&&(Y=b?b.length:0),G===void 0&&(G=0),Z===void 0&&(Z=this.length),F<0||Y>b.length||G<0||Z>this.length)throw new RangeError("out of range index");if(G>=Z&&F>=Y)return 0;if(G>=Z)return-1;if(F>=Y)return 1;if(this===b)return 0;for(var se=(Z>>>=0)-(G>>>=0),pe=(Y>>>=0)-(F>>>=0),Ee=Math.min(se,pe),Me=this.slice(G,Z),Ie=b.slice(F,Y),Ge=0;Ge<Ee;++Ge)if(Me[Ge]!==Ie[Ge]){se=Me[Ge],pe=Ie[Ge];break}return se<pe?-1:pe<se?1:0},h.prototype.includes=function(b,F,Y){return this.indexOf(b,F,Y)!==-1},h.prototype.indexOf=function(b,F,Y){return N(this,b,F,Y,!0)},h.prototype.lastIndexOf=function(b,F,Y){return N(this,b,F,Y,!1)},h.prototype.write=function(b,F,Y,G){if(F===void 0)G="utf8",Y=this.length,F=0;else if(Y===void 0&&typeof F=="string")G=F,Y=this.length,F=0;else{if(!isFinite(F))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");F|=0,isFinite(Y)?(Y|=0,G===void 0&&(G="utf8")):(G=Y,Y=void 0)}var Z=this.length-F;if((Y===void 0||Y>Z)&&(Y=Z),b.length>0&&(Y<0||F<0)||F>this.length)throw new RangeError("Attempt to write outside buffer bounds");G||(G="utf8");for(var se=!1;;)switch(G){case"hex":return L(this,b,F,Y);case"utf8":case"utf-8":return S(this,b,F,Y);case"ascii":return D(this,b,F,Y);case"latin1":case"binary":return H(this,b,F,Y);case"base64":return Q(this,b,F,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,b,F,Y);default:if(se)throw new TypeError("Unknown encoding: "+G);G=(""+G).toLowerCase(),se=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var be=4096;function Se(q,b,F){var Y="";F=Math.min(q.length,F);for(var G=b;G<F;++G)Y+=String.fromCharCode(127&q[G]);return Y}function Te(q,b,F){var Y="";F=Math.min(q.length,F);for(var G=b;G<F;++G)Y+=String.fromCharCode(q[G]);return Y}function Ne(q,b,F){var Y=q.length;(!b||b<0)&&(b=0),(!F||F<0||F>Y)&&(F=Y);for(var G="",Z=b;Z<F;++Z)G+=At(q[Z]);return G}function Ke(q,b,F){for(var Y=q.slice(b,F),G="",Z=0;Z<Y.length;Z+=2)G+=String.fromCharCode(Y[Z]+256*Y[Z+1]);return G}function Pe(q,b,F){if(q%1!=0||q<0)throw new RangeError("offset is not uint");if(q+b>F)throw new RangeError("Trying to access beyond buffer length")}function Ae(q,b,F,Y,G,Z){if(!h.isBuffer(q))throw new TypeError('"buffer" argument must be a Buffer instance');if(b>G||b<Z)throw new RangeError('"value" argument is out of bounds');if(F+Y>q.length)throw new RangeError("Index out of range")}function Le(q,b,F,Y){b<0&&(b=65535+b+1);for(var G=0,Z=Math.min(q.length-F,2);G<Z;++G)q[F+G]=(b&255<<8*(Y?G:1-G))>>>8*(Y?G:1-G)}function at(q,b,F,Y){b<0&&(b=4294967295+b+1);for(var G=0,Z=Math.min(q.length-F,4);G<Z;++G)q[F+G]=b>>>8*(Y?G:3-G)&255}function Be(q,b,F,Y,G,Z){if(F+Y>q.length)throw new RangeError("Index out of range");if(F<0)throw new RangeError("Index out of range")}function bt(q,b,F,Y,G){return G||Be(q,0,F,4),d.write(q,b,F,Y,23,4),F+4}function Ft(q,b,F,Y,G){return G||Be(q,0,F,8),d.write(q,b,F,Y,52,8),F+8}h.prototype.slice=function(b,F){var Y,G=this.length;if((b=~~b)<0?(b+=G)<0&&(b=0):b>G&&(b=G),(F=F===void 0?G:~~F)<0?(F+=G)<0&&(F=0):F>G&&(F=G),F<b&&(F=b),h.TYPED_ARRAY_SUPPORT)(Y=this.subarray(b,F)).__proto__=h.prototype;else{var Z=F-b;Y=new h(Z,void 0);for(var se=0;se<Z;++se)Y[se]=this[se+b]}return Y},h.prototype.readUIntLE=function(b,F,Y){b|=0,F|=0,Y||Pe(b,F,this.length);for(var G=this[b],Z=1,se=0;++se<F&&(Z*=256);)G+=this[b+se]*Z;return G},h.prototype.readUIntBE=function(b,F,Y){b|=0,F|=0,Y||Pe(b,F,this.length);for(var G=this[b+--F],Z=1;F>0&&(Z*=256);)G+=this[b+--F]*Z;return G},h.prototype.readUInt8=function(b,F){return F||Pe(b,1,this.length),this[b]},h.prototype.readUInt16LE=function(b,F){return F||Pe(b,2,this.length),this[b]|this[b+1]<<8},h.prototype.readUInt16BE=function(b,F){return F||Pe(b,2,this.length),this[b]<<8|this[b+1]},h.prototype.readUInt32LE=function(b,F){return F||Pe(b,4,this.length),(this[b]|this[b+1]<<8|this[b+2]<<16)+16777216*this[b+3]},h.prototype.readUInt32BE=function(b,F){return F||Pe(b,4,this.length),16777216*this[b]+(this[b+1]<<16|this[b+2]<<8|this[b+3])},h.prototype.readIntLE=function(b,F,Y){b|=0,F|=0,Y||Pe(b,F,this.length);for(var G=this[b],Z=1,se=0;++se<F&&(Z*=256);)G+=this[b+se]*Z;return G>=(Z*=128)&&(G-=Math.pow(2,8*F)),G},h.prototype.readIntBE=function(b,F,Y){b|=0,F|=0,Y||Pe(b,F,this.length);for(var G=F,Z=1,se=this[b+--G];G>0&&(Z*=256);)se+=this[b+--G]*Z;return se>=(Z*=128)&&(se-=Math.pow(2,8*F)),se},h.prototype.readInt8=function(b,F){return F||Pe(b,1,this.length),128&this[b]?-1*(255-this[b]+1):this[b]},h.prototype.readInt16LE=function(b,F){F||Pe(b,2,this.length);var Y=this[b]|this[b+1]<<8;return 32768&Y?4294901760|Y:Y},h.prototype.readInt16BE=function(b,F){F||Pe(b,2,this.length);var Y=this[b+1]|this[b]<<8;return 32768&Y?4294901760|Y:Y},h.prototype.readInt32LE=function(b,F){return F||Pe(b,4,this.length),this[b]|this[b+1]<<8|this[b+2]<<16|this[b+3]<<24},h.prototype.readInt32BE=function(b,F){return F||Pe(b,4,this.length),this[b]<<24|this[b+1]<<16|this[b+2]<<8|this[b+3]},h.prototype.readFloatLE=function(b,F){return F||Pe(b,4,this.length),d.read(this,b,!0,23,4)},h.prototype.readFloatBE=function(b,F){return F||Pe(b,4,this.length),d.read(this,b,!1,23,4)},h.prototype.readDoubleLE=function(b,F){return F||Pe(b,8,this.length),d.read(this,b,!0,52,8)},h.prototype.readDoubleBE=function(b,F){return F||Pe(b,8,this.length),d.read(this,b,!1,52,8)},h.prototype.writeUIntLE=function(b,F,Y,G){b=+b,F|=0,Y|=0,G||Ae(this,b,F,Y,Math.pow(2,8*Y)-1,0);var Z=1,se=0;for(this[F]=255&b;++se<Y&&(Z*=256);)this[F+se]=b/Z&255;return F+Y},h.prototype.writeUIntBE=function(b,F,Y,G){b=+b,F|=0,Y|=0,G||Ae(this,b,F,Y,Math.pow(2,8*Y)-1,0);var Z=Y-1,se=1;for(this[F+Z]=255&b;--Z>=0&&(se*=256);)this[F+Z]=b/se&255;return F+Y},h.prototype.writeUInt8=function(b,F,Y){return b=+b,F|=0,Y||Ae(this,b,F,1,255,0),h.TYPED_ARRAY_SUPPORT||(b=Math.floor(b)),this[F]=255&b,F+1},h.prototype.writeUInt16LE=function(b,F,Y){return b=+b,F|=0,Y||Ae(this,b,F,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[F]=255&b,this[F+1]=b>>>8):Le(this,b,F,!0),F+2},h.prototype.writeUInt16BE=function(b,F,Y){return b=+b,F|=0,Y||Ae(this,b,F,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[F]=b>>>8,this[F+1]=255&b):Le(this,b,F,!1),F+2},h.prototype.writeUInt32LE=function(b,F,Y){return b=+b,F|=0,Y||Ae(this,b,F,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[F+3]=b>>>24,this[F+2]=b>>>16,this[F+1]=b>>>8,this[F]=255&b):at(this,b,F,!0),F+4},h.prototype.writeUInt32BE=function(b,F,Y){return b=+b,F|=0,Y||Ae(this,b,F,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[F]=b>>>24,this[F+1]=b>>>16,this[F+2]=b>>>8,this[F+3]=255&b):at(this,b,F,!1),F+4},h.prototype.writeIntLE=function(b,F,Y,G){if(b=+b,F|=0,!G){var Z=Math.pow(2,8*Y-1);Ae(this,b,F,Y,Z-1,-Z)}var se=0,pe=1,Ee=0;for(this[F]=255&b;++se<Y&&(pe*=256);)b<0&&Ee===0&&this[F+se-1]!==0&&(Ee=1),this[F+se]=(b/pe>>0)-Ee&255;return F+Y},h.prototype.writeIntBE=function(b,F,Y,G){if(b=+b,F|=0,!G){var Z=Math.pow(2,8*Y-1);Ae(this,b,F,Y,Z-1,-Z)}var se=Y-1,pe=1,Ee=0;for(this[F+se]=255&b;--se>=0&&(pe*=256);)b<0&&Ee===0&&this[F+se+1]!==0&&(Ee=1),this[F+se]=(b/pe>>0)-Ee&255;return F+Y},h.prototype.writeInt8=function(b,F,Y){return b=+b,F|=0,Y||Ae(this,b,F,1,127,-128),h.TYPED_ARRAY_SUPPORT||(b=Math.floor(b)),b<0&&(b=255+b+1),this[F]=255&b,F+1},h.prototype.writeInt16LE=function(b,F,Y){return b=+b,F|=0,Y||Ae(this,b,F,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[F]=255&b,this[F+1]=b>>>8):Le(this,b,F,!0),F+2},h.prototype.writeInt16BE=function(b,F,Y){return b=+b,F|=0,Y||Ae(this,b,F,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[F]=b>>>8,this[F+1]=255&b):Le(this,b,F,!1),F+2},h.prototype.writeInt32LE=function(b,F,Y){return b=+b,F|=0,Y||Ae(this,b,F,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[F]=255&b,this[F+1]=b>>>8,this[F+2]=b>>>16,this[F+3]=b>>>24):at(this,b,F,!0),F+4},h.prototype.writeInt32BE=function(b,F,Y){return b=+b,F|=0,Y||Ae(this,b,F,4,2147483647,-2147483648),b<0&&(b=4294967295+b+1),h.TYPED_ARRAY_SUPPORT?(this[F]=b>>>24,this[F+1]=b>>>16,this[F+2]=b>>>8,this[F+3]=255&b):at(this,b,F,!1),F+4},h.prototype.writeFloatLE=function(b,F,Y){return bt(this,b,F,!0,Y)},h.prototype.writeFloatBE=function(b,F,Y){return bt(this,b,F,!1,Y)},h.prototype.writeDoubleLE=function(b,F,Y){return Ft(this,b,F,!0,Y)},h.prototype.writeDoubleBE=function(b,F,Y){return Ft(this,b,F,!1,Y)},h.prototype.copy=function(b,F,Y,G){if(Y||(Y=0),G||G===0||(G=this.length),F>=b.length&&(F=b.length),F||(F=0),G>0&&G<Y&&(G=Y),G===Y||b.length===0||this.length===0)return 0;if(F<0)throw new RangeError("targetStart out of bounds");if(Y<0||Y>=this.length)throw new RangeError("sourceStart out of bounds");if(G<0)throw new RangeError("sourceEnd out of bounds");G>this.length&&(G=this.length),b.length-F<G-Y&&(G=b.length-F+Y);var Z,se=G-Y;if(this===b&&Y<F&&F<G)for(Z=se-1;Z>=0;--Z)b[Z+F]=this[Z+Y];else if(se<1e3||!h.TYPED_ARRAY_SUPPORT)for(Z=0;Z<se;++Z)b[Z+F]=this[Z+Y];else Uint8Array.prototype.set.call(b,this.subarray(Y,Y+se),F);return se},h.prototype.fill=function(b,F,Y,G){if(typeof b=="string"){if(typeof F=="string"?(G=F,F=0,Y=this.length):typeof Y=="string"&&(G=Y,Y=this.length),b.length===1){var Z=b.charCodeAt(0);Z<256&&(b=Z)}if(G!==void 0&&typeof G!="string")throw new TypeError("encoding must be a string");if(typeof G=="string"&&!h.isEncoding(G))throw new TypeError("Unknown encoding: "+G)}else typeof b=="number"&&(b&=255);if(F<0||this.length<F||this.length<Y)throw new RangeError("Out of range index");if(Y<=F)return this;var se;if(F>>>=0,Y=Y===void 0?this.length:Y>>>0,b||(b=0),typeof b=="number")for(se=F;se<Y;++se)this[se]=b;else{var pe=h.isBuffer(b)?b:rt(new h(b,G).toString()),Ee=pe.length;for(se=0;se<Y-F;++se)this[se+F]=pe[se%Ee]}return this};var Bt=/[^+\/0-9A-Za-z-_]/g;function At(q){return q<16?"0"+q.toString(16):q.toString(16)}function rt(q,b){var F;b=b||1/0;for(var Y=q.length,G=null,Z=[],se=0;se<Y;++se){if((F=q.charCodeAt(se))>55295&&F<57344){if(!G){if(F>56319){(b-=3)>-1&&Z.push(239,191,189);continue}if(se+1===Y){(b-=3)>-1&&Z.push(239,191,189);continue}G=F;continue}if(F<56320){(b-=3)>-1&&Z.push(239,191,189),G=F;continue}F=65536+(G-55296<<10|F-56320)}else G&&(b-=3)>-1&&Z.push(239,191,189);if(G=null,F<128){if((b-=1)<0)break;Z.push(F)}else if(F<2048){if((b-=2)<0)break;Z.push(F>>6|192,63&F|128)}else if(F<65536){if((b-=3)<0)break;Z.push(F>>12|224,F>>6&63|128,63&F|128)}else{if(!(F<1114112))throw new Error("Invalid code point");if((b-=4)<0)break;Z.push(F>>18|240,F>>12&63|128,F>>6&63|128,63&F|128)}}return Z}function De(q){return c.toByteArray(function(F){if((F=function(G){return G.trim?G.trim():G.replace(/^\s+|\s+$/g,"")}(F).replace(Bt,"")).length<2)return"";for(;F.length%4!=0;)F+="=";return F}(q))}function He(q,b,F,Y){for(var G=0;G<Y&&!(G+F>=b.length||G>=q.length);++G)b[G+F]=q[G];return G}}).call(this,s(29))},function(n,r){var s;s=function(){return this}();try{s=s||new Function("return this")()}catch{typeof window=="object"&&(s=window)}n.exports=s},function(n,r,s){r.byteLength=function(w){var P=h(w),I=P[0],R=P[1];return 3*(I+R)/4-R},r.toByteArray=function(w){var P,I,R=h(w),E=R[0],A=R[1],N=new d(function(D,H,Q){return 3*(H+Q)/4-Q}(0,E,A)),O=0,L=A>0?E-4:E;for(I=0;I<L;I+=4)P=c[w.charCodeAt(I)]<<18|c[w.charCodeAt(I+1)]<<12|c[w.charCodeAt(I+2)]<<6|c[w.charCodeAt(I+3)],N[O++]=P>>16&255,N[O++]=P>>8&255,N[O++]=255&P;return A===2&&(P=c[w.charCodeAt(I)]<<2|c[w.charCodeAt(I+1)]>>4,N[O++]=255&P),A===1&&(P=c[w.charCodeAt(I)]<<10|c[w.charCodeAt(I+1)]<<4|c[w.charCodeAt(I+2)]>>2,N[O++]=P>>8&255,N[O++]=255&P),N},r.fromByteArray=function(w){for(var P,I=w.length,R=I%3,E=[],A=16383,N=0,O=I-R;N<O;N+=A)E.push(m(w,N,N+A>O?O:N+A));return R===1?(P=w[I-1],E.push(a[P>>2]+a[P<<4&63]+"==")):R===2&&(P=(w[I-2]<<8)+w[I-1],E.push(a[P>>10]+a[P>>4&63]+a[P<<2&63]+"=")),E.join("")};for(var a=[],c=[],d=typeof Uint8Array<"u"?Uint8Array:Array,g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,p=g.length;f<p;++f)a[f]=g[f],c[g.charCodeAt(f)]=f;function h(_){var w=_.length;if(w%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var P=_.indexOf("=");return P===-1&&(P=w),[P,P===w?0:4-P%4]}function m(_,w,P){for(var I,R,E=[],A=w;A<P;A+=3)I=(_[A]<<16&16711680)+(_[A+1]<<8&65280)+(255&_[A+2]),E.push(a[(R=I)>>18&63]+a[R>>12&63]+a[R>>6&63]+a[63&R]);return E.join("")}c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},function(n,r){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */r.read=function(s,a,c,d,g){var f,p,h=8*g-d-1,m=(1<<h)-1,_=m>>1,w=-7,P=c?g-1:0,I=c?-1:1,R=s[a+P];for(P+=I,f=R&(1<<-w)-1,R>>=-w,w+=h;w>0;f=256*f+s[a+P],P+=I,w-=8);for(p=f&(1<<-w)-1,f>>=-w,w+=d;w>0;p=256*p+s[a+P],P+=I,w-=8);if(f===0)f=1-_;else{if(f===m)return p?NaN:1/0*(R?-1:1);p+=Math.pow(2,d),f-=_}return(R?-1:1)*p*Math.pow(2,f-d)},r.write=function(s,a,c,d,g,f){var p,h,m,_=8*f-g-1,w=(1<<_)-1,P=w>>1,I=g===23?Math.pow(2,-24)-Math.pow(2,-77):0,R=d?0:f-1,E=d?1:-1,A=a<0||a===0&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(h=isNaN(a)?1:0,p=w):(p=Math.floor(Math.log(a)/Math.LN2),a*(m=Math.pow(2,-p))<1&&(p--,m*=2),(a+=p+P>=1?I/m:I*Math.pow(2,1-P))*m>=2&&(p++,m/=2),p+P>=w?(h=0,p=w):p+P>=1?(h=(a*m-1)*Math.pow(2,g),p+=P):(h=a*Math.pow(2,P-1)*Math.pow(2,g),p=0));g>=8;s[c+R]=255&h,R+=E,h/=256,g-=8);for(p=p<<g|h,_+=g;_>0;s[c+R]=255&p,R+=E,p/=256,_-=8);s[c+R-E]|=128*A}},function(n,r){var s={}.toString;n.exports=Array.isArray||function(a){return s.call(a)=="[object Array]"}},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(d){var g=d.jws,f=d.KeyUtil,p=d.X509,h=d.crypto,m=d.hextob64u,_=d.b64tohex,w=d.AllowedSigningAlgs;return function(){function P(){(function(R,E){if(!(R instanceof E))throw new TypeError("Cannot call a class as a function")})(this,P)}return P.parseJwt=function(R){a.Log.debug("JoseUtil.parseJwt");try{var E=g.JWS.parse(R);return{header:E.headerObj,payload:E.payloadObj}}catch(A){a.Log.error(A)}},P.validateJwt=function(R,E,A,N,O,L,S){a.Log.debug("JoseUtil.validateJwt");try{if(E.kty==="RSA")if(E.e&&E.n)E=f.getKey(E);else{if(!E.x5c||!E.x5c.length)return a.Log.error("JoseUtil.validateJwt: RSA key missing key material",E),Promise.reject(new Error("RSA key missing key material"));var D=_(E.x5c[0]);E=p.getPublicKeyFromCertHex(D)}else{if(E.kty!=="EC")return a.Log.error("JoseUtil.validateJwt: Unsupported key type",E&&E.kty),Promise.reject(new Error(E.kty));if(!(E.crv&&E.x&&E.y))return a.Log.error("JoseUtil.validateJwt: EC key missing key material",E),Promise.reject(new Error("EC key missing key material"));E=f.getKey(E)}return P._validateJwt(R,E,A,N,O,L,S)}catch(H){return a.Log.error(H&&H.message||H),Promise.reject("JWT validation failed")}},P.validateJwtAttributes=function(R,E,A,N,O,L){N||(N=0),O||(O=parseInt(Date.now()/1e3));var S=P.parseJwt(R).payload;if(!S.iss)return a.Log.error("JoseUtil._validateJwt: issuer was not provided"),Promise.reject(new Error("issuer was not provided"));if(S.iss!==E)return a.Log.error("JoseUtil._validateJwt: Invalid issuer in token",S.iss),Promise.reject(new Error("Invalid issuer in token: "+S.iss));if(!S.aud)return a.Log.error("JoseUtil._validateJwt: aud was not provided"),Promise.reject(new Error("aud was not provided"));if(!(S.aud===A||Array.isArray(S.aud)&&S.aud.indexOf(A)>=0))return a.Log.error("JoseUtil._validateJwt: Invalid audience in token",S.aud),Promise.reject(new Error("Invalid audience in token: "+S.aud));if(S.azp&&S.azp!==A)return a.Log.error("JoseUtil._validateJwt: Invalid azp in token",S.azp),Promise.reject(new Error("Invalid azp in token: "+S.azp));if(!L){var D=O+N,H=O-N;if(!S.iat)return a.Log.error("JoseUtil._validateJwt: iat was not provided"),Promise.reject(new Error("iat was not provided"));if(D<S.iat)return a.Log.error("JoseUtil._validateJwt: iat is in the future",S.iat),Promise.reject(new Error("iat is in the future: "+S.iat));if(S.nbf&&D<S.nbf)return a.Log.error("JoseUtil._validateJwt: nbf is in the future",S.nbf),Promise.reject(new Error("nbf is in the future: "+S.nbf));if(!S.exp)return a.Log.error("JoseUtil._validateJwt: exp was not provided"),Promise.reject(new Error("exp was not provided"));if(S.exp<H)return a.Log.error("JoseUtil._validateJwt: exp is in the past",S.exp),Promise.reject(new Error("exp is in the past:"+S.exp))}return Promise.resolve(S)},P._validateJwt=function(R,E,A,N,O,L,S){return P.validateJwtAttributes(R,A,N,O,L,S).then(function(D){try{return g.JWS.verify(R,E,w)?D:(a.Log.error("JoseUtil._validateJwt: signature validation failed"),Promise.reject(new Error("signature validation failed")))}catch(H){return a.Log.error(H&&H.message||H),Promise.reject(new Error("signature validation failed"))}})},P.hashString=function(R,E){try{return h.Util.hashString(R,E)}catch(A){a.Log.error(A)}},P.hexToBase64Url=function(R){try{return m(R)}catch(E){a.Log.error(E)}},P}()};var a=s(0);n.exports=r.default},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.SigninResponse=void 0;var a=function(){function g(f,p){for(var h=0;h<p.length;h++){var m=p[h];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(f,m.key,m)}}return function(f,p,h){return p&&g(f.prototype,p),h&&g(f,h),f}}(),c=s(3);function d(g,f){if(!(g instanceof f))throw new TypeError("Cannot call a class as a function")}r.SigninResponse=function(){function g(f){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"#";d(this,g);var h=c.UrlUtility.parseUrlFragment(f,p);this.error=h.error,this.error_description=h.error_description,this.error_uri=h.error_uri,this.code=h.code,this.state=h.state,this.id_token=h.id_token,this.session_state=h.session_state,this.access_token=h.access_token,this.token_type=h.token_type,this.scope=h.scope,this.profile=void 0,this.expires_in=h.expires_in}return a(g,[{key:"expires_in",get:function(){if(this.expires_at){var p=parseInt(Date.now()/1e3);return this.expires_at-p}},set:function(p){var h=parseInt(p);if(typeof h=="number"&&h>0){var m=parseInt(Date.now()/1e3);this.expires_at=m+h}}},{key:"expired",get:function(){var p=this.expires_in;if(p!==void 0)return p<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}},{key:"isOpenIdConnect",get:function(){return this.scopes.indexOf("openid")>=0||!!this.id_token}}]),g}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.SignoutRequest=void 0;var a=s(0),c=s(3),d=s(9);r.SignoutRequest=function g(f){var p=f.url,h=f.id_token_hint,m=f.post_logout_redirect_uri,_=f.data,w=f.extraQueryParams,P=f.request_type;if(function(E,A){if(!(E instanceof A))throw new TypeError("Cannot call a class as a function")}(this,g),!p)throw a.Log.error("SignoutRequest.ctor: No url passed"),new Error("url");for(var I in h&&(p=c.UrlUtility.addQueryParam(p,"id_token_hint",h)),m&&(p=c.UrlUtility.addQueryParam(p,"post_logout_redirect_uri",m),_&&(this.state=new d.State({data:_,request_type:P}),p=c.UrlUtility.addQueryParam(p,"state",this.state.id))),w)p=c.UrlUtility.addQueryParam(p,I,w[I]);this.url=p}},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.SignoutResponse=void 0;var a=s(3);r.SignoutResponse=function c(d){(function(p,h){if(!(p instanceof h))throw new TypeError("Cannot call a class as a function")})(this,c);var g=a.UrlUtility.parseUrlFragment(d,"?");this.error=g.error,this.error_description=g.error_description,this.error_uri=g.error_uri,this.state=g.state}},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.InMemoryWebStorage=void 0;var a=function(){function d(g,f){for(var p=0;p<f.length;p++){var h=f[p];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(g,h.key,h)}}return function(g,f,p){return f&&d(g.prototype,f),p&&d(g,p),g}}(),c=s(0);r.InMemoryWebStorage=function(){function d(){(function(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")})(this,d),this._data={}}return d.prototype.getItem=function(f){return c.Log.debug("InMemoryWebStorage.getItem",f),this._data[f]},d.prototype.setItem=function(f,p){c.Log.debug("InMemoryWebStorage.setItem",f),this._data[f]=p},d.prototype.removeItem=function(f){c.Log.debug("InMemoryWebStorage.removeItem",f),delete this._data[f]},d.prototype.key=function(f){return Object.getOwnPropertyNames(this._data)[f]},a(d,[{key:"length",get:function(){return Object.getOwnPropertyNames(this._data).length}}]),d}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.UserManager=void 0;var a=function(){function A(N,O){for(var L=0;L<O.length;L++){var S=O[L];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(N,S.key,S)}}return function(N,O,L){return O&&A(N.prototype,O),L&&A(N,L),N}}(),c=s(0),d=s(10),g=s(39),f=s(15),p=s(45),h=s(47),m=s(18),_=s(8),w=s(20),P=s(11),I=s(4);function R(A,N){if(!(A instanceof N))throw new TypeError("Cannot call a class as a function")}function E(A,N){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!N||typeof N!="object"&&typeof N!="function"?A:N}r.UserManager=function(A){function N(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h.SilentRenewService,S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:m.SessionMonitor,D=arguments.length>3&&arguments[3]!==void 0?arguments[3]:w.TokenRevocationClient,H=arguments.length>4&&arguments[4]!==void 0?arguments[4]:P.TokenClient,Q=arguments.length>5&&arguments[5]!==void 0?arguments[5]:I.JoseUtil;R(this,N),O instanceof g.UserManagerSettings||(O=new g.UserManagerSettings(O));var x=E(this,A.call(this,O));return x._events=new p.UserManagerEvents(O),x._silentRenewService=new L(x),x.settings.automaticSilentRenew&&(c.Log.debug("UserManager.ctor: automaticSilentRenew is configured, setting up silent renew"),x.startSilentRenew()),x.settings.monitorSession&&(c.Log.debug("UserManager.ctor: monitorSession is configured, setting up session monitor"),x._sessionMonitor=new S(x)),x._tokenRevocationClient=new D(x._settings),x._tokenClient=new H(x._settings),x._joseUtil=Q,x}return function(L,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);L.prototype=Object.create(S&&S.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(L,S):L.__proto__=S)}(N,A),N.prototype.getUser=function(){var L=this;return this._loadUser().then(function(S){return S?(c.Log.info("UserManager.getUser: user loaded"),L._events.load(S,!1),S):(c.Log.info("UserManager.getUser: user not found in storage"),null)})},N.prototype.removeUser=function(){var L=this;return this.storeUser(null).then(function(){c.Log.info("UserManager.removeUser: user removed from storage"),L._events.unload()})},N.prototype.signinRedirect=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(L=Object.assign({},L)).request_type="si:r";var S={useReplaceToNavigate:L.useReplaceToNavigate};return this._signinStart(L,this._redirectNavigator,S).then(function(){c.Log.info("UserManager.signinRedirect: successful")})},N.prototype.signinRedirectCallback=function(L){return this._signinEnd(L||this._redirectNavigator.url).then(function(S){return S.profile&&S.profile.sub?c.Log.info("UserManager.signinRedirectCallback: successful, signed in sub: ",S.profile.sub):c.Log.info("UserManager.signinRedirectCallback: no sub"),S})},N.prototype.signinPopup=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(L=Object.assign({},L)).request_type="si:p";var S=L.redirect_uri||this.settings.popup_redirect_uri||this.settings.redirect_uri;return S?(L.redirect_uri=S,L.display="popup",this._signin(L,this._popupNavigator,{startUrl:S,popupWindowFeatures:L.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:L.popupWindowTarget||this.settings.popupWindowTarget}).then(function(D){return D&&(D.profile&&D.profile.sub?c.Log.info("UserManager.signinPopup: signinPopup successful, signed in sub: ",D.profile.sub):c.Log.info("UserManager.signinPopup: no sub")),D})):(c.Log.error("UserManager.signinPopup: No popup_redirect_uri or redirect_uri configured"),Promise.reject(new Error("No popup_redirect_uri or redirect_uri configured")))},N.prototype.signinPopupCallback=function(L){return this._signinCallback(L,this._popupNavigator).then(function(S){return S&&(S.profile&&S.profile.sub?c.Log.info("UserManager.signinPopupCallback: successful, signed in sub: ",S.profile.sub):c.Log.info("UserManager.signinPopupCallback: no sub")),S}).catch(function(S){c.Log.error(S.message)})},N.prototype.signinSilent=function(){var L=this,S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return S=Object.assign({},S),this._loadUser().then(function(D){return D&&D.refresh_token?(S.refresh_token=D.refresh_token,L._useRefreshToken(S)):(S.request_type="si:s",S.id_token_hint=S.id_token_hint||L.settings.includeIdTokenInSilentRenew&&D&&D.id_token,D&&L._settings.validateSubOnSilentRenew&&(c.Log.debug("UserManager.signinSilent, subject prior to silent renew: ",D.profile.sub),S.current_sub=D.profile.sub),L._signinSilentIframe(S))})},N.prototype._useRefreshToken=function(){var L=this,S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this._tokenClient.exchangeRefreshToken(S).then(function(D){return D?D.access_token?L._loadUser().then(function(H){if(H){var Q=Promise.resolve();return D.id_token&&(Q=L._validateIdTokenFromTokenRefreshToken(H.profile,D.id_token)),Q.then(function(){return c.Log.debug("UserManager._useRefreshToken: refresh token response success"),H.id_token=D.id_token||H.id_token,H.access_token=D.access_token,H.refresh_token=D.refresh_token||H.refresh_token,H.expires_in=D.expires_in,L.storeUser(H).then(function(){return L._events.load(H),H})})}return null}):(c.Log.error("UserManager._useRefreshToken: No access token returned from token endpoint"),Promise.reject("No access token returned from token endpoint")):(c.Log.error("UserManager._useRefreshToken: No response returned from token endpoint"),Promise.reject("No response returned from token endpoint"))})},N.prototype._validateIdTokenFromTokenRefreshToken=function(L,S){var D=this;return this._metadataService.getIssuer().then(function(H){return D.settings.getEpochTime().then(function(Q){return D._joseUtil.validateJwtAttributes(S,H,D._settings.client_id,D._settings.clockSkew,Q).then(function(x){return x?x.sub!==L.sub?(c.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: sub in id_token does not match current sub"),Promise.reject(new Error("sub in id_token does not match current sub"))):x.auth_time&&x.auth_time!==L.auth_time?(c.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: auth_time in id_token does not match original auth_time"),Promise.reject(new Error("auth_time in id_token does not match original auth_time"))):x.azp&&x.azp!==L.azp?(c.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: azp in id_token does not match original azp"),Promise.reject(new Error("azp in id_token does not match original azp"))):!x.azp&&L.azp?(c.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: azp not in id_token, but present in original id_token"),Promise.reject(new Error("azp not in id_token, but present in original id_token"))):void 0:(c.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: Failed to validate id_token"),Promise.reject(new Error("Failed to validate id_token")))})})})},N.prototype._signinSilentIframe=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},S=L.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return S?(L.redirect_uri=S,L.prompt=L.prompt||"none",this._signin(L,this._iframeNavigator,{startUrl:S,silentRequestTimeout:L.silentRequestTimeout||this.settings.silentRequestTimeout}).then(function(D){return D&&(D.profile&&D.profile.sub?c.Log.info("UserManager.signinSilent: successful, signed in sub: ",D.profile.sub):c.Log.info("UserManager.signinSilent: no sub")),D})):(c.Log.error("UserManager.signinSilent: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},N.prototype.signinSilentCallback=function(L){return this._signinCallback(L,this._iframeNavigator).then(function(S){return S&&(S.profile&&S.profile.sub?c.Log.info("UserManager.signinSilentCallback: successful, signed in sub: ",S.profile.sub):c.Log.info("UserManager.signinSilentCallback: no sub")),S})},N.prototype.signinCallback=function(L){var S=this;return this.readSigninResponseState(L).then(function(D){var H=D.state;return D.response,H.request_type==="si:r"?S.signinRedirectCallback(L):H.request_type==="si:p"?S.signinPopupCallback(L):H.request_type==="si:s"?S.signinSilentCallback(L):Promise.reject(new Error("invalid response_type in state"))})},N.prototype.signoutCallback=function(L,S){var D=this;return this.readSignoutResponseState(L).then(function(H){var Q=H.state,x=H.response;return Q?Q.request_type==="so:r"?D.signoutRedirectCallback(L):Q.request_type==="so:p"?D.signoutPopupCallback(L,S):Promise.reject(new Error("invalid response_type in state")):x})},N.prototype.querySessionStatus=function(){var L=this,S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(S=Object.assign({},S)).request_type="si:s";var D=S.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return D?(S.redirect_uri=D,S.prompt="none",S.response_type=S.response_type||this.settings.query_status_response_type,S.scope=S.scope||"openid",S.skipUserInfo=!0,this._signinStart(S,this._iframeNavigator,{startUrl:D,silentRequestTimeout:S.silentRequestTimeout||this.settings.silentRequestTimeout}).then(function(H){return L.processSigninResponse(H.url).then(function(Q){if(c.Log.debug("UserManager.querySessionStatus: got signin response"),Q.session_state&&Q.profile.sub)return c.Log.info("UserManager.querySessionStatus: querySessionStatus success for sub: ",Q.profile.sub),{session_state:Q.session_state,sub:Q.profile.sub,sid:Q.profile.sid};c.Log.info("querySessionStatus successful, user not authenticated")}).catch(function(Q){if(Q.session_state&&L.settings.monitorAnonymousSession&&(Q.message=="login_required"||Q.message=="consent_required"||Q.message=="interaction_required"||Q.message=="account_selection_required"))return c.Log.info("UserManager.querySessionStatus: querySessionStatus success for anonymous user"),{session_state:Q.session_state};throw Q})})):(c.Log.error("UserManager.querySessionStatus: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},N.prototype._signin=function(L,S){var D=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._signinStart(L,S,H).then(function(Q){return D._signinEnd(Q.url,L)})},N.prototype._signinStart=function(L,S){var D=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return S.prepare(H).then(function(Q){return c.Log.debug("UserManager._signinStart: got navigator window handle"),D.createSigninRequest(L).then(function(x){return c.Log.debug("UserManager._signinStart: got signin request"),H.url=x.url,H.id=x.state.id,Q.navigate(H)}).catch(function(x){throw Q.close&&(c.Log.debug("UserManager._signinStart: Error after preparing navigator, closing navigator window"),Q.close()),x})})},N.prototype._signinEnd=function(L){var S=this,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.processSigninResponse(L).then(function(H){c.Log.debug("UserManager._signinEnd: got signin response");var Q=new f.User(H);if(D.current_sub){if(D.current_sub!==Q.profile.sub)return c.Log.debug("UserManager._signinEnd: current user does not match user returned from signin. sub from signin: ",Q.profile.sub),Promise.reject(new Error("login_required"));c.Log.debug("UserManager._signinEnd: current user matches user returned from signin")}return S.storeUser(Q).then(function(){return c.Log.debug("UserManager._signinEnd: user stored"),S._events.load(Q),Q})})},N.prototype._signinCallback=function(L,S){c.Log.debug("UserManager._signinCallback");var D=this._settings.response_mode==="query"||!this._settings.response_mode&&_.SigninRequest.isCode(this._settings.response_type)?"?":"#";return S.callback(L,void 0,D)},N.prototype.signoutRedirect=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(L=Object.assign({},L)).request_type="so:r";var S=L.post_logout_redirect_uri||this.settings.post_logout_redirect_uri;S&&(L.post_logout_redirect_uri=S);var D={useReplaceToNavigate:L.useReplaceToNavigate};return this._signoutStart(L,this._redirectNavigator,D).then(function(){c.Log.info("UserManager.signoutRedirect: successful")})},N.prototype.signoutRedirectCallback=function(L){return this._signoutEnd(L||this._redirectNavigator.url).then(function(S){return c.Log.info("UserManager.signoutRedirectCallback: successful"),S})},N.prototype.signoutPopup=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(L=Object.assign({},L)).request_type="so:p";var S=L.post_logout_redirect_uri||this.settings.popup_post_logout_redirect_uri||this.settings.post_logout_redirect_uri;return L.post_logout_redirect_uri=S,L.display="popup",L.post_logout_redirect_uri&&(L.state=L.state||{}),this._signout(L,this._popupNavigator,{startUrl:S,popupWindowFeatures:L.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:L.popupWindowTarget||this.settings.popupWindowTarget}).then(function(){c.Log.info("UserManager.signoutPopup: successful")})},N.prototype.signoutPopupCallback=function(L,S){return S===void 0&&typeof L=="boolean"&&(S=L,L=null),this._popupNavigator.callback(L,S,"?").then(function(){c.Log.info("UserManager.signoutPopupCallback: successful")})},N.prototype._signout=function(L,S){var D=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._signoutStart(L,S,H).then(function(Q){return D._signoutEnd(Q.url)})},N.prototype._signoutStart=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},S=this,D=arguments[1],H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return D.prepare(H).then(function(Q){return c.Log.debug("UserManager._signoutStart: got navigator window handle"),S._loadUser().then(function(x){return c.Log.debug("UserManager._signoutStart: loaded current user from storage"),(S._settings.revokeAccessTokenOnSignout?S._revokeInternal(x):Promise.resolve()).then(function(){var ue=L.id_token_hint||x&&x.id_token;return ue&&(c.Log.debug("UserManager._signoutStart: Setting id_token into signout request"),L.id_token_hint=ue),S.removeUser().then(function(){return c.Log.debug("UserManager._signoutStart: user removed, creating signout request"),S.createSignoutRequest(L).then(function(le){return c.Log.debug("UserManager._signoutStart: got signout request"),H.url=le.url,le.state&&(H.id=le.state.id),Q.navigate(H)})})})}).catch(function(x){throw Q.close&&(c.Log.debug("UserManager._signoutStart: Error after preparing navigator, closing navigator window"),Q.close()),x})})},N.prototype._signoutEnd=function(L){return this.processSignoutResponse(L).then(function(S){return c.Log.debug("UserManager._signoutEnd: got signout response"),S})},N.prototype.revokeAccessToken=function(){var L=this;return this._loadUser().then(function(S){return L._revokeInternal(S,!0).then(function(D){if(D)return c.Log.debug("UserManager.revokeAccessToken: removing token properties from user and re-storing"),S.access_token=null,S.refresh_token=null,S.expires_at=null,S.token_type=null,L.storeUser(S).then(function(){c.Log.debug("UserManager.revokeAccessToken: user stored"),L._events.load(S)})})}).then(function(){c.Log.info("UserManager.revokeAccessToken: access token revoked successfully")})},N.prototype._revokeInternal=function(L,S){var D=this;if(L){var H=L.access_token,Q=L.refresh_token;return this._revokeAccessTokenInternal(H,S).then(function(x){return D._revokeRefreshTokenInternal(Q,S).then(function(ue){return x||ue||c.Log.debug("UserManager.revokeAccessToken: no need to revoke due to no token(s), or JWT format"),x||ue})})}return Promise.resolve(!1)},N.prototype._revokeAccessTokenInternal=function(L,S){return!L||L.indexOf(".")>=0?Promise.resolve(!1):this._tokenRevocationClient.revoke(L,S).then(function(){return!0})},N.prototype._revokeRefreshTokenInternal=function(L,S){return L?this._tokenRevocationClient.revoke(L,S,"refresh_token").then(function(){return!0}):Promise.resolve(!1)},N.prototype.startSilentRenew=function(){this._silentRenewService.start()},N.prototype.stopSilentRenew=function(){this._silentRenewService.stop()},N.prototype._loadUser=function(){return this._userStore.get(this._userStoreKey).then(function(L){return L?(c.Log.debug("UserManager._loadUser: user storageString loaded"),f.User.fromStorageString(L)):(c.Log.debug("UserManager._loadUser: no user storageString"),null)})},N.prototype.storeUser=function(L){if(L){c.Log.debug("UserManager.storeUser: storing user");var S=L.toStorageString();return this._userStore.set(this._userStoreKey,S)}return c.Log.debug("storeUser.storeUser: removing user"),this._userStore.remove(this._userStoreKey)},a(N,[{key:"_redirectNavigator",get:function(){return this.settings.redirectNavigator}},{key:"_popupNavigator",get:function(){return this.settings.popupNavigator}},{key:"_iframeNavigator",get:function(){return this.settings.iframeNavigator}},{key:"_userStore",get:function(){return this.settings.userStore}},{key:"events",get:function(){return this._events}},{key:"_userStoreKey",get:function(){return"user:"+this.settings.authority+":"+this.settings.client_id}}]),N}(d.OidcClient)},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.UserManagerSettings=void 0;var a=function(){function P(I,R){for(var E=0;E<R.length;E++){var A=R[E];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(I,A.key,A)}}return function(I,R,E){return R&&P(I.prototype,R),E&&P(I,E),I}}(),c=(s(0),s(5)),d=s(40),g=s(41),f=s(43),p=s(6),h=s(1),m=s(8);function _(P,I){if(!(P instanceof I))throw new TypeError("Cannot call a class as a function")}function w(P,I){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||typeof I!="object"&&typeof I!="function"?P:I}r.UserManagerSettings=function(P){function I(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},E=R.popup_redirect_uri,A=R.popup_post_logout_redirect_uri,N=R.popupWindowFeatures,O=R.popupWindowTarget,L=R.silent_redirect_uri,S=R.silentRequestTimeout,D=R.automaticSilentRenew,H=D!==void 0&&D,Q=R.validateSubOnSilentRenew,x=Q!==void 0&&Q,ue=R.includeIdTokenInSilentRenew,le=ue===void 0||ue,be=R.monitorSession,Se=be===void 0||be,Te=R.monitorAnonymousSession,Ne=Te!==void 0&&Te,Ke=R.checkSessionInterval,Pe=Ke===void 0?2e3:Ke,Ae=R.stopCheckSessionOnError,Le=Ae===void 0||Ae,at=R.query_status_response_type,Be=R.revokeAccessTokenOnSignout,bt=Be!==void 0&&Be,Ft=R.accessTokenExpiringNotificationTime,Bt=Ft===void 0?60:Ft,At=R.redirectNavigator,rt=At===void 0?new d.RedirectNavigator:At,De=R.popupNavigator,He=De===void 0?new g.PopupNavigator:De,q=R.iframeNavigator,b=q===void 0?new f.IFrameNavigator:q,F=R.userStore,Y=F===void 0?new p.WebStorageStateStore({store:h.Global.sessionStorage}):F;_(this,I);var G=w(this,P.call(this,arguments[0]));return G._popup_redirect_uri=E,G._popup_post_logout_redirect_uri=A,G._popupWindowFeatures=N,G._popupWindowTarget=O,G._silent_redirect_uri=L,G._silentRequestTimeout=S,G._automaticSilentRenew=H,G._validateSubOnSilentRenew=x,G._includeIdTokenInSilentRenew=le,G._accessTokenExpiringNotificationTime=Bt,G._monitorSession=Se,G._monitorAnonymousSession=Ne,G._checkSessionInterval=Pe,G._stopCheckSessionOnError=Le,at?G._query_status_response_type=at:arguments[0]&&arguments[0].response_type?G._query_status_response_type=m.SigninRequest.isOidc(arguments[0].response_type)?"id_token":"code":G._query_status_response_type="id_token",G._revokeAccessTokenOnSignout=bt,G._redirectNavigator=rt,G._popupNavigator=He,G._iframeNavigator=b,G._userStore=Y,G}return function(E,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);E.prototype=Object.create(A&&A.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(E,A):E.__proto__=A)}(I,P),a(I,[{key:"popup_redirect_uri",get:function(){return this._popup_redirect_uri}},{key:"popup_post_logout_redirect_uri",get:function(){return this._popup_post_logout_redirect_uri}},{key:"popupWindowFeatures",get:function(){return this._popupWindowFeatures}},{key:"popupWindowTarget",get:function(){return this._popupWindowTarget}},{key:"silent_redirect_uri",get:function(){return this._silent_redirect_uri}},{key:"silentRequestTimeout",get:function(){return this._silentRequestTimeout}},{key:"automaticSilentRenew",get:function(){return this._automaticSilentRenew}},{key:"validateSubOnSilentRenew",get:function(){return this._validateSubOnSilentRenew}},{key:"includeIdTokenInSilentRenew",get:function(){return this._includeIdTokenInSilentRenew}},{key:"accessTokenExpiringNotificationTime",get:function(){return this._accessTokenExpiringNotificationTime}},{key:"monitorSession",get:function(){return this._monitorSession}},{key:"monitorAnonymousSession",get:function(){return this._monitorAnonymousSession}},{key:"checkSessionInterval",get:function(){return this._checkSessionInterval}},{key:"stopCheckSessionOnError",get:function(){return this._stopCheckSessionOnError}},{key:"query_status_response_type",get:function(){return this._query_status_response_type}},{key:"revokeAccessTokenOnSignout",get:function(){return this._revokeAccessTokenOnSignout}},{key:"redirectNavigator",get:function(){return this._redirectNavigator}},{key:"popupNavigator",get:function(){return this._popupNavigator}},{key:"iframeNavigator",get:function(){return this._iframeNavigator}},{key:"userStore",get:function(){return this._userStore}}]),I}(c.OidcClientSettings)},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.RedirectNavigator=void 0;var a=function(){function d(g,f){for(var p=0;p<f.length;p++){var h=f[p];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(g,h.key,h)}}return function(g,f,p){return f&&d(g.prototype,f),p&&d(g,p),g}}(),c=s(0);r.RedirectNavigator=function(){function d(){(function(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")})(this,d)}return d.prototype.prepare=function(){return Promise.resolve(this)},d.prototype.navigate=function(f){return f&&f.url?(f.useReplaceToNavigate?window.location.replace(f.url):window.location=f.url,Promise.resolve()):(c.Log.error("RedirectNavigator.navigate: No url provided"),Promise.reject(new Error("No url provided")))},a(d,[{key:"url",get:function(){return window.location.href}}]),d}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.PopupNavigator=void 0;var a=s(0),c=s(42);r.PopupNavigator=function(){function d(){(function(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")})(this,d)}return d.prototype.prepare=function(f){var p=new c.PopupWindow(f);return Promise.resolve(p)},d.prototype.callback=function(f,p,h){a.Log.debug("PopupNavigator.callback");try{return c.PopupWindow.notifyOpener(f,p,h),Promise.resolve()}catch(m){return Promise.reject(m)}},d}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.PopupWindow=void 0;var a=function(){function g(f,p){for(var h=0;h<p.length;h++){var m=p[h];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(f,m.key,m)}}return function(f,p,h){return p&&g(f.prototype,p),h&&g(f,h),f}}(),c=s(0),d=s(3);r.PopupWindow=function(){function g(f){var p=this;(function(w,P){if(!(w instanceof P))throw new TypeError("Cannot call a class as a function")})(this,g),this._promise=new Promise(function(_,w){p._resolve=_,p._reject=w});var h=f.popupWindowTarget||"_blank",m=f.popupWindowFeatures||"location=no,toolbar=no,width=500,height=500,left=100,top=100;";this._popup=window.open("",h,m),this._popup&&(c.Log.debug("PopupWindow.ctor: popup successfully created"),this._checkForPopupClosedTimer=window.setInterval(this._checkForPopupClosed.bind(this),500))}return g.prototype.navigate=function(p){return this._popup?p&&p.url?(c.Log.debug("PopupWindow.navigate: Setting URL in popup"),this._id=p.id,this._id&&(window["popupCallback_"+p.id]=this._callback.bind(this)),this._popup.focus(),this._popup.window.location=p.url):(this._error("PopupWindow.navigate: no url provided"),this._error("No url provided")):this._error("PopupWindow.navigate: Error opening popup window"),this.promise},g.prototype._success=function(p){c.Log.debug("PopupWindow.callback: Successful response from popup window"),this._cleanup(),this._resolve(p)},g.prototype._error=function(p){c.Log.error("PopupWindow.error: ",p),this._cleanup(),this._reject(new Error(p))},g.prototype.close=function(){this._cleanup(!1)},g.prototype._cleanup=function(p){c.Log.debug("PopupWindow.cleanup"),window.clearInterval(this._checkForPopupClosedTimer),this._checkForPopupClosedTimer=null,delete window["popupCallback_"+this._id],this._popup&&!p&&this._popup.close(),this._popup=null},g.prototype._checkForPopupClosed=function(){this._popup&&!this._popup.closed||this._error("Popup window closed")},g.prototype._callback=function(p,h){this._cleanup(h),p?(c.Log.debug("PopupWindow.callback success"),this._success({url:p})):(c.Log.debug("PopupWindow.callback: Invalid response from popup"),this._error("Invalid response from popup"))},g.notifyOpener=function(p,h,m){if(window.opener){if(p=p||window.location.href){var _=d.UrlUtility.parseUrlFragment(p,m);if(_.state){var w="popupCallback_"+_.state,P=window.opener[w];P?(c.Log.debug("PopupWindow.notifyOpener: passing url message to opener"),P(p,h)):c.Log.warn("PopupWindow.notifyOpener: no matching callback found on opener")}else c.Log.warn("PopupWindow.notifyOpener: no state found in response url")}}else c.Log.warn("PopupWindow.notifyOpener: no window.opener. Can't complete notification.")},a(g,[{key:"promise",get:function(){return this._promise}}]),g}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.IFrameNavigator=void 0;var a=s(0),c=s(44);r.IFrameNavigator=function(){function d(){(function(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")})(this,d)}return d.prototype.prepare=function(f){var p=new c.IFrameWindow(f);return Promise.resolve(p)},d.prototype.callback=function(f){a.Log.debug("IFrameNavigator.callback");try{return c.IFrameWindow.notifyParent(f),Promise.resolve()}catch(p){return Promise.reject(p)}},d}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.IFrameWindow=void 0;var a=function(){function d(g,f){for(var p=0;p<f.length;p++){var h=f[p];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(g,h.key,h)}}return function(g,f,p){return f&&d(g.prototype,f),p&&d(g,p),g}}(),c=s(0);r.IFrameWindow=function(){function d(g){var f=this;(function(h,m){if(!(h instanceof m))throw new TypeError("Cannot call a class as a function")})(this,d),this._promise=new Promise(function(p,h){f._resolve=p,f._reject=h}),this._boundMessageEvent=this._message.bind(this),window.addEventListener("message",this._boundMessageEvent,!1),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.width=0,this._frame.height=0,window.document.body.appendChild(this._frame)}return d.prototype.navigate=function(f){if(f&&f.url){var p=f.silentRequestTimeout||1e4;c.Log.debug("IFrameWindow.navigate: Using timeout of:",p),this._timer=window.setTimeout(this._timeout.bind(this),p),this._frame.src=f.url}else this._error("No url provided");return this.promise},d.prototype._success=function(f){this._cleanup(),c.Log.debug("IFrameWindow: Successful response from frame window"),this._resolve(f)},d.prototype._error=function(f){this._cleanup(),c.Log.error(f),this._reject(new Error(f))},d.prototype.close=function(){this._cleanup()},d.prototype._cleanup=function(){this._frame&&(c.Log.debug("IFrameWindow: cleanup"),window.removeEventListener("message",this._boundMessageEvent,!1),window.clearTimeout(this._timer),window.document.body.removeChild(this._frame),this._timer=null,this._frame=null,this._boundMessageEvent=null)},d.prototype._timeout=function(){c.Log.debug("IFrameWindow.timeout"),this._error("Frame window timed out")},d.prototype._message=function(f){if(c.Log.debug("IFrameWindow.message"),this._timer&&f.origin===this._origin&&f.source===this._frame.contentWindow&&typeof f.data=="string"&&(f.data.startsWith("http://")||f.data.startsWith("https://"))){var p=f.data;p?this._success({url:p}):this._error("Invalid response from frame")}},d.notifyParent=function(f){c.Log.debug("IFrameWindow.notifyParent"),(f=f||window.location.href)&&(c.Log.debug("IFrameWindow.notifyParent: posting url message to parent"),window.parent.postMessage(f,location.protocol+"//"+location.host))},a(d,[{key:"promise",get:function(){return this._promise}},{key:"_origin",get:function(){return location.protocol+"//"+location.host}}]),d}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.UserManagerEvents=void 0;var a=s(0),c=s(16),d=s(17);r.UserManagerEvents=function(g){function f(p){(function(_,w){if(!(_ instanceof w))throw new TypeError("Cannot call a class as a function")})(this,f);var h=function(_,w){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!w||typeof w!="object"&&typeof w!="function"?_:w}(this,g.call(this,p));return h._userLoaded=new d.Event("User loaded"),h._userUnloaded=new d.Event("User unloaded"),h._silentRenewError=new d.Event("Silent renew error"),h._userSignedIn=new d.Event("User signed in"),h._userSignedOut=new d.Event("User signed out"),h._userSessionChanged=new d.Event("User session changed"),h}return function(h,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);h.prototype=Object.create(m&&m.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(h,m):h.__proto__=m)}(f,g),f.prototype.load=function(h){var m=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];a.Log.debug("UserManagerEvents.load"),g.prototype.load.call(this,h),m&&this._userLoaded.raise(h)},f.prototype.unload=function(){a.Log.debug("UserManagerEvents.unload"),g.prototype.unload.call(this),this._userUnloaded.raise()},f.prototype.addUserLoaded=function(h){this._userLoaded.addHandler(h)},f.prototype.removeUserLoaded=function(h){this._userLoaded.removeHandler(h)},f.prototype.addUserUnloaded=function(h){this._userUnloaded.addHandler(h)},f.prototype.removeUserUnloaded=function(h){this._userUnloaded.removeHandler(h)},f.prototype.addSilentRenewError=function(h){this._silentRenewError.addHandler(h)},f.prototype.removeSilentRenewError=function(h){this._silentRenewError.removeHandler(h)},f.prototype._raiseSilentRenewError=function(h){a.Log.debug("UserManagerEvents._raiseSilentRenewError",h.message),this._silentRenewError.raise(h)},f.prototype.addUserSignedIn=function(h){this._userSignedIn.addHandler(h)},f.prototype.removeUserSignedIn=function(h){this._userSignedIn.removeHandler(h)},f.prototype._raiseUserSignedIn=function(){a.Log.debug("UserManagerEvents._raiseUserSignedIn"),this._userSignedIn.raise()},f.prototype.addUserSignedOut=function(h){this._userSignedOut.addHandler(h)},f.prototype.removeUserSignedOut=function(h){this._userSignedOut.removeHandler(h)},f.prototype._raiseUserSignedOut=function(){a.Log.debug("UserManagerEvents._raiseUserSignedOut"),this._userSignedOut.raise()},f.prototype.addUserSessionChanged=function(h){this._userSessionChanged.addHandler(h)},f.prototype.removeUserSessionChanged=function(h){this._userSessionChanged.removeHandler(h)},f.prototype._raiseUserSessionChanged=function(){a.Log.debug("UserManagerEvents._raiseUserSessionChanged"),this._userSessionChanged.raise()},f}(c.AccessTokenEvents)},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.Timer=void 0;var a=function(){function h(m,_){for(var w=0;w<_.length;w++){var P=_[w];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(m,P.key,P)}}return function(m,_,w){return _&&h(m.prototype,_),w&&h(m,w),m}}(),c=s(0),d=s(1),g=s(17);function f(h,m){if(!(h instanceof m))throw new TypeError("Cannot call a class as a function")}function p(h,m){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!m||typeof m!="object"&&typeof m!="function"?h:m}r.Timer=function(h){function m(_){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.Global.timer,P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;f(this,m);var I=p(this,h.call(this,_));return I._timer=w,I._nowFunc=P||function(){return Date.now()/1e3},I}return function(w,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);w.prototype=Object.create(P&&P.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(w,P):w.__proto__=P)}(m,h),m.prototype.init=function(w){w<=0&&(w=1),w=parseInt(w);var P=this.now+w;if(this.expiration===P&&this._timerHandle)c.Log.debug("Timer.init timer "+this._name+" skipping initialization since already initialized for expiration:",this.expiration);else{this.cancel(),c.Log.debug("Timer.init timer "+this._name+" for duration:",w),this._expiration=P;var I=5;w<I&&(I=w),this._timerHandle=this._timer.setInterval(this._callback.bind(this),1e3*I)}},m.prototype.cancel=function(){this._timerHandle&&(c.Log.debug("Timer.cancel: ",this._name),this._timer.clearInterval(this._timerHandle),this._timerHandle=null)},m.prototype._callback=function(){var w=this._expiration-this.now;c.Log.debug("Timer.callback; "+this._name+" timer expires in:",w),this._expiration<=this.now&&(this.cancel(),h.prototype.raise.call(this))},a(m,[{key:"now",get:function(){return parseInt(this._nowFunc())}},{key:"expiration",get:function(){return this._expiration}}]),m}(g.Event)},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.SilentRenewService=void 0;var a=s(0);r.SilentRenewService=function(){function c(d){(function(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")})(this,c),this._userManager=d}return c.prototype.start=function(){this._callback||(this._callback=this._tokenExpiring.bind(this),this._userManager.events.addAccessTokenExpiring(this._callback),this._userManager.getUser().then(function(g){}).catch(function(g){a.Log.error("SilentRenewService.start: Error from getUser:",g.message)}))},c.prototype.stop=function(){this._callback&&(this._userManager.events.removeAccessTokenExpiring(this._callback),delete this._callback)},c.prototype._tokenExpiring=function(){var g=this;this._userManager.signinSilent().then(function(f){a.Log.debug("SilentRenewService._tokenExpiring: Silent token renewal successful")},function(f){a.Log.error("SilentRenewService._tokenExpiring: Error from signinSilent:",f.message),g._userManager.events._raiseSilentRenewError(f)})},c}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.CordovaPopupNavigator=void 0;var a=s(21);r.CordovaPopupNavigator=function(){function c(){(function(g,f){if(!(g instanceof f))throw new TypeError("Cannot call a class as a function")})(this,c)}return c.prototype.prepare=function(g){var f=new a.CordovaPopupWindow(g);return Promise.resolve(f)},c}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.CordovaIFrameNavigator=void 0;var a=s(21);r.CordovaIFrameNavigator=function(){function c(){(function(g,f){if(!(g instanceof f))throw new TypeError("Cannot call a class as a function")})(this,c)}return c.prototype.prepare=function(g){g.popupWindowFeatures="hidden=yes";var f=new a.CordovaPopupWindow(g);return Promise.resolve(f)},c}()},function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.Version="1.11.5"}])})})(Zc);var Xp=Zc.exports;const Om=Ac(Xp);var Qp=Object.defineProperty,Zp=(e,t,n)=>t in e?Qp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lo=(e,t,n)=>(Zp(e,typeof t!="symbol"?t+"":t,n),n);let eg=class{constructor(){lo(this,"current",this.detect()),lo(this,"handoffState","pending"),lo(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Fn=new eg,yt=(e,t)=>{Fn.isServer?je(e,t):er(e,t)};function An(e){let t=ke(e);return yt(()=>{t.current=e},[e]),t}function Hi(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function an(){let e=[],t={addEventListener(n,r,s,a){return n.addEventListener(r,s,a),t.add(()=>n.removeEventListener(r,s,a))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return Hi(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,s){let a=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:s}),this.add(()=>{Object.assign(n.style,{[r]:a})})},group(n){let r=an();return n(r),this.add(()=>r.dispose())},add(n){return e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let s of e.splice(r,1))s()}},dispose(){for(let n of e.splice(0))n()}};return t}function Ar(){let[e]=Et(an);return je(()=>()=>e.dispose(),[e]),e}let Fe=function(e){let t=An(e);return we.useCallback((...n)=>t.current(...n),[t])};function tg(){let e=typeof document>"u";return"useSyncExternalStore"in Wr?(t=>t.useSyncExternalStore)(Wr)(()=>()=>{},()=>!1,()=>!e):!1}function Pr(){let e=tg(),[t,n]=Et(Fn.isHandoffComplete);return t&&Fn.isHandoffComplete===!1&&n(!1),je(()=>{t!==!0&&n(!0)},[t]),je(()=>Fn.handoff(),[]),e?!1:t}var Wa;let zt=(Wa=we.useId)!=null?Wa:function(){let e=Pr(),[t,n]=we.useState(e?()=>Fn.nextId():null);return yt(()=>{t===null&&n(Fn.nextId())},[t]),t!=null?""+t:void 0};function st(e,t,...n){if(e in t){let s=t[e];return typeof s=="function"?s(...n):s}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(s=>`"${s}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,st),r}function Qr(e){return Fn.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let xo=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var _n=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(_n||{}),el=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(el||{}),ng=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(ng||{});function tl(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(xo)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Es=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Es||{});function Fs(e,t=0){var n;return e===((n=Qr(e))==null?void 0:n.body)?!1:st(t,{0(){return e.matches(xo)},1(){let r=e;for(;r!==null;){if(r.matches(xo))return!0;r=r.parentElement}return!1}})}function nl(e){let t=Qr(e);an().nextFrame(()=>{t&&!Fs(t.activeElement,0)&&Mn(e)})}var rg=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(rg||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Mn(e){e==null||e.focus({preventScroll:!0})}let ig=["textarea","input"].join(",");function og(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,ig))!=null?n:!1}function rl(e,t=n=>n){return e.slice().sort((n,r)=>{let s=t(n),a=t(r);if(s===null||a===null)return 0;let c=s.compareDocumentPosition(a);return c&Node.DOCUMENT_POSITION_FOLLOWING?-1:c&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function sg(e,t){return Hr(tl(),t,{relativeTo:e})}function Hr(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:s=[]}={}){let a=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,c=Array.isArray(e)?n?rl(e):e:tl(e);s.length>0&&c.length>1&&(c=c.filter(_=>!s.includes(_))),r=r??a.activeElement;let d=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),g=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,c.indexOf(r))-1;if(t&4)return Math.max(0,c.indexOf(r))+1;if(t&8)return c.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),f=t&32?{preventScroll:!0}:{},p=0,h=c.length,m;do{if(p>=h||p+h<=0)return 0;let _=g+p;if(t&16)_=(_+h)%h;else{if(_<0)return 3;if(_>=h)return 1}m=c[_],m==null||m.focus(f),p+=d}while(m!==a.activeElement);return t&6&&og(m)&&m.select(),2}function li(e,t,n){let r=An(t);je(()=>{function s(a){r.current(a)}return document.addEventListener(e,s,n),()=>document.removeEventListener(e,s,n)},[e,n])}function il(e,t,n){let r=An(t);je(()=>{function s(a){r.current(a)}return window.addEventListener(e,s,n),()=>window.removeEventListener(e,s,n)},[e,n])}function ol(e,t,n=!0){let r=ke(!1);je(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function s(c,d){if(!r.current||c.defaultPrevented)return;let g=d(c);if(g===null||!g.getRootNode().contains(g)||!g.isConnected)return;let f=function p(h){return typeof h=="function"?p(h()):Array.isArray(h)||h instanceof Set?h:[h]}(e);for(let p of f){if(p===null)continue;let h=p instanceof HTMLElement?p:p.current;if(h!=null&&h.contains(g)||c.composed&&c.composedPath().includes(h))return}return!Fs(g,Es.Loose)&&g.tabIndex!==-1&&c.preventDefault(),t(c,g)}let a=ke(null);li("pointerdown",c=>{var d,g;r.current&&(a.current=((g=(d=c.composedPath)==null?void 0:d.call(c))==null?void 0:g[0])||c.target)},!0),li("mousedown",c=>{var d,g;r.current&&(a.current=((g=(d=c.composedPath)==null?void 0:d.call(c))==null?void 0:g[0])||c.target)},!0),li("click",c=>{a.current&&(s(c,()=>a.current),a.current=null)},!0),li("touchend",c=>s(c,()=>c.target instanceof HTMLElement?c.target:null),!0),il("blur",c=>s(c,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Ja(e){var t;if(e.type)return e.type;let n=(t=e.as)!=null?t:"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function As(e,t){let[n,r]=Et(()=>Ja(e));return yt(()=>{r(Ja(e))},[e.type,e.as]),yt(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let sl=Symbol();function al(e,t=!0){return Object.assign(e,{[sl]:t})}function pt(...e){let t=ke(e);je(()=>{t.current=e},[e]);let n=Fe(r=>{for(let s of t.current)s!=null&&(typeof s=="function"?s(r):s.current=r)});return e.every(r=>r==null||(r==null?void 0:r[sl]))?void 0:n}function ag({container:e,accept:t,walk:n,enabled:r=!0}){let s=ke(t),a=ke(n);je(()=>{s.current=t,a.current=n},[t,n]),yt(()=>{if(!e||!r)return;let c=Qr(e);if(!c)return;let d=s.current,g=a.current,f=Object.assign(h=>d(h),{acceptNode:d}),p=c.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,f,!1);for(;p.nextNode();)g(p.currentNode)},[e,r,s,a])}function ug(e){throw new Error("Unexpected object: "+e)}var rn=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(rn||{});function cg(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),s=r??-1,a=(()=>{switch(e.focus){case 0:return n.findIndex(c=>!t.resolveDisabled(c));case 1:{let c=n.slice().reverse().findIndex((d,g,f)=>s!==-1&&f.length-g-1>=s?!1:!t.resolveDisabled(d));return c===-1?c:n.length-1-c}case 2:return n.findIndex((c,d)=>d<=s?!1:!t.resolveDisabled(c));case 3:{let c=n.slice().reverse().findIndex(d=>!t.resolveDisabled(d));return c===-1?c:n.length-1-c}case 4:return n.findIndex(c=>t.resolveId(c)===e.id);case 5:return null;default:ug(e)}})();return a===-1?r:a}function Ii(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var jn=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(jn||{}),Ln=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Ln||{});function tt({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:s,visible:a=!0,name:c}){let d=ul(t,e);if(a)return fi(d,n,r,c);let g=s??0;if(g&2){let{static:f=!1,...p}=d;if(f)return fi(p,n,r,c)}if(g&1){let{unmount:f=!0,...p}=d;return st(f?0:1,{0(){return null},1(){return fi({...p,hidden:!0,style:{display:"none"}},n,r,c)}})}return fi(d,n,r,c)}function fi(e,t={},n,r){let{as:s=n,children:a,refName:c="ref",...d}=fo(e,["unmount","static"]),g=e.ref!==void 0?{[c]:e.ref}:{},f=typeof a=="function"?a(t):a;"className"in d&&d.className&&typeof d.className=="function"&&(d.className=d.className(t));let p={};if(t){let h=!1,m=[];for(let[_,w]of Object.entries(t))typeof w=="boolean"&&(h=!0),w===!0&&m.push(_);h&&(p["data-headlessui-state"]=m.join(" "))}if(s===et&&Object.keys(jo(d)).length>0){if(!wr(f)||Array.isArray(f)&&f.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(d).map(w=>` - ${w}`).join(`
105
+ `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(w=>` - ${w}`).join(`
106
+ `)].join(`
107
+ `));let h=f.props,m=typeof(h==null?void 0:h.className)=="function"?(...w)=>Ii(h==null?void 0:h.className(...w),d.className):Ii(h==null?void 0:h.className,d.className),_=m?{className:m}:{};return ls(f,Object.assign({},ul(f.props,jo(fo(d,["ref"]))),p,g,lg(f.ref,g.ref),_))}return _e(s,Object.assign({},fo(d,["ref"]),s!==et&&g,s!==et&&p),f)}function lg(...e){return{ref:e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}}function ul(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let s in r)s.startsWith("on")&&typeof r[s]=="function"?(n[s]!=null||(n[s]=[]),n[s].push(r[s])):t[s]=r[s];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](s,...a){let c=n[r];for(let d of c){if((s instanceof Event||(s==null?void 0:s.nativeEvent)instanceof Event)&&s.defaultPrevented)return;d(s,...a)}}});return t}function nt(e){var t;return Object.assign(Lt(e),{displayName:(t=e.displayName)!=null?t:e.name})}function jo(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function fo(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function $i(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&fg(n)?!1:r}function fg(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function hg(e){var t,n;let r=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(r){for(let s of r.elements)if(s!==e&&(s.tagName==="INPUT"&&s.type==="submit"||s.tagName==="BUTTON"&&s.type==="submit"||s.nodeName==="INPUT"&&s.type==="image")){s.click();return}(n=r.requestSubmit)==null||n.call(r)}}let dg="div";var Yr=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Yr||{});function pg(e,t){let{features:n=1,...r}=e,s={ref:t,"aria-hidden":(n&2)===2?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return tt({ourProps:s,theirProps:r,slot:{},defaultTag:dg,name:"Hidden"})}let Ri=nt(pg),Ps=_t(null);Ps.displayName="OpenClosedContext";var ot=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(ot||{});function Zr(){return dt(Ps)}function ks({value:e,children:t}){return we.createElement(Ps.Provider,{value:e},t)}var Ye=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Ye||{});function gg(e,t,n){let[r,s]=Et(n),a=e!==void 0,c=ke(a),d=ke(!1),g=ke(!1);return a&&!c.current&&!d.current?(d.current=!0,c.current=a,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!a&&c.current&&!g.current&&(g.current=!0,c.current=a,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[a?e:r,Fe(f=>(a||s(f),t==null?void 0:t(f)))]}function Ts(e,t){let n=ke([]),r=Fe(e);je(()=>{let s=[...n.current];for(let[a,c]of t.entries())if(n.current[a]!==c){let d=r(t,s);return n.current=t,d}},[r,...t])}function za(e){return[e.screenX,e.screenY]}function vg(){let e=ke([-1,-1]);return{wasMoved(t){let n=za(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=za(t)}}}function mg(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function kr(...e){return Ue(()=>Qr(...e),[...e])}var xr=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(xr||{});function yg(){let e=ke(0);return il("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function ei(){let e=ke(!1);return yt(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function cl(e,t,n,r){let s=An(n);je(()=>{e=e??window;function a(c){s.current(c)}return e.addEventListener(t,a,r),()=>e.removeEventListener(t,a,r)},[e,t,r])}function _g(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}function ll(e){let t=Fe(e),n=ke(!1);je(()=>(n.current=!1,()=>{n.current=!0,Hi(()=>{n.current&&t()})}),[t])}function fl(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}let bg="div";var hl=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(hl||{});function Sg(e,t){let n=ke(null),r=pt(n,t),{initialFocus:s,containers:a,features:c=30,...d}=e;Pr()||(c=1);let g=kr(n);Fg({ownerDocument:g},!!(c&16));let f=Ag({ownerDocument:g,container:n,initialFocus:s},!!(c&2));Pg({ownerDocument:g,container:n,containers:a,previousActiveElement:f},!!(c&8));let p=yg(),h=Fe(P=>{let I=n.current;I&&(R=>R())(()=>{st(p.current,{[xr.Forwards]:()=>{Hr(I,_n.First,{skipElements:[P.relatedTarget]})},[xr.Backwards]:()=>{Hr(I,_n.Last,{skipElements:[P.relatedTarget]})}})})}),m=Ar(),_=ke(!1),w={ref:r,onKeyDown(P){P.key=="Tab"&&(_.current=!0,m.requestAnimationFrame(()=>{_.current=!1}))},onBlur(P){let I=fl(a);n.current instanceof HTMLElement&&I.add(n.current);let R=P.relatedTarget;R instanceof HTMLElement&&R.dataset.headlessuiFocusGuard!=="true"&&(dl(I,R)||(_.current?Hr(n.current,st(p.current,{[xr.Forwards]:()=>_n.Next,[xr.Backwards]:()=>_n.Previous})|_n.WrapAround,{relativeTo:P.target}):P.target instanceof HTMLElement&&Mn(P.target)))}};return we.createElement(we.Fragment,null,!!(c&4)&&we.createElement(Ri,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:Yr.Focusable}),tt({ourProps:w,theirProps:d,defaultTag:bg,name:"FocusTrap"}),!!(c&4)&&we.createElement(Ri,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:Yr.Focusable}))}let wg=nt(Sg),Nr=Object.assign(wg,{features:hl}),Rn=[];_g(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&Rn[0]!==t.target&&(Rn.unshift(t.target),Rn=Rn.filter(n=>n!=null&&n.isConnected),Rn.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function Eg(e=!0){let t=ke(Rn.slice());return Ts(([n],[r])=>{r===!0&&n===!1&&Hi(()=>{t.current.splice(0)}),r===!1&&n===!0&&(t.current=Rn.slice())},[e,Rn,t]),Fe(()=>{var n;return(n=t.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function Fg({ownerDocument:e},t){let n=Eg(t);Ts(()=>{t||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&Mn(n())},[t]),ll(()=>{t&&Mn(n())})}function Ag({ownerDocument:e,container:t,initialFocus:n},r){let s=ke(null),a=ei();return Ts(()=>{if(!r)return;let c=t.current;c&&Hi(()=>{if(!a.current)return;let d=e==null?void 0:e.activeElement;if(n!=null&&n.current){if((n==null?void 0:n.current)===d){s.current=d;return}}else if(c.contains(d)){s.current=d;return}n!=null&&n.current?Mn(n.current):Hr(c,_n.First)===el.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),s.current=e==null?void 0:e.activeElement})},[r]),s}function Pg({ownerDocument:e,container:t,containers:n,previousActiveElement:r},s){let a=ei();cl(e==null?void 0:e.defaultView,"focus",c=>{if(!s||!a.current)return;let d=fl(n);t.current instanceof HTMLElement&&d.add(t.current);let g=r.current;if(!g)return;let f=c.target;f&&f instanceof HTMLElement?dl(d,f)?(r.current=f,Mn(f)):(c.preventDefault(),c.stopPropagation(),Mn(g)):Mn(r.current)},!0)}function dl(e,t){for(let n of e)if(n.contains(t))return!0;return!1}let pl=_t(!1);function kg(){return dt(pl)}function Bo(e){return we.createElement(pl.Provider,{value:e.force},e.children)}function Tg(e){let t=kg(),n=dt(gl),r=kr(e),[s,a]=Et(()=>{if(!t&&n!==null||Fn.isServer)return null;let c=r==null?void 0:r.getElementById("headlessui-portal-root");if(c)return c;if(r===null)return null;let d=r.createElement("div");return d.setAttribute("id","headlessui-portal-root"),r.body.appendChild(d)});return je(()=>{s!==null&&(r!=null&&r.body.contains(s)||r==null||r.body.appendChild(s))},[s,r]),je(()=>{t||n!==null&&a(n.current)},[n,a,t]),s}let Cg=et;function Ig(e,t){let n=e,r=ke(null),s=pt(al(p=>{r.current=p}),t),a=kr(r),c=Tg(r),[d]=Et(()=>{var p;return Fn.isServer?null:(p=a==null?void 0:a.createElement("div"))!=null?p:null}),g=dt(Ho),f=Pr();return yt(()=>{!c||!d||c.contains(d)||(d.setAttribute("data-headlessui-portal",""),c.appendChild(d))},[c,d]),yt(()=>{if(d&&g)return g.register(d)},[g,d]),ll(()=>{var p;!c||!d||(d instanceof Node&&c.contains(d)&&c.removeChild(d),c.childNodes.length<=0&&((p=c.parentElement)==null||p.removeChild(c)))}),f?!c||!d?null:us(tt({ourProps:{ref:s},theirProps:n,defaultTag:Cg,name:"Portal"}),d):null}let Rg=et,gl=_t(null);function Og(e,t){let{target:n,...r}=e,s={ref:pt(t)};return we.createElement(gl.Provider,{value:n},tt({ourProps:s,theirProps:r,defaultTag:Rg,name:"Popover.Group"}))}let Ho=_t(null);function Lg(){let e=dt(Ho),t=ke([]),n=Fe(a=>(t.current.push(a),e&&e.register(a),()=>r(a))),r=Fe(a=>{let c=t.current.indexOf(a);c!==-1&&t.current.splice(c,1),e&&e.unregister(a)}),s=Ue(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,Ue(()=>function({children:a}){return we.createElement(Ho.Provider,{value:s},a)},[s])]}let Dg=nt(Ig),Ng=nt(Og),$o=Object.assign(Dg,{Group:Ng}),vl=_t(null);function ml(){let e=dt(vl);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,ml),t}return e}function yl(){let[e,t]=Et([]);return[e.length>0?e.join(" "):void 0,Ue(()=>function(n){let r=Fe(a=>(t(c=>[...c,a]),()=>t(c=>{let d=c.slice(),g=d.indexOf(a);return g!==-1&&d.splice(g,1),d}))),s=Ue(()=>({register:r,slot:n.slot,name:n.name,props:n.props}),[r,n.slot,n.name,n.props]);return we.createElement(vl.Provider,{value:s},n.children)},[t])]}let Mg="p";function Ug(e,t){let n=zt(),{id:r=`headlessui-description-${n}`,...s}=e,a=ml(),c=pt(t);yt(()=>a.register(r),[r,a.register]);let d={ref:c,...a.props,id:r};return tt({ourProps:d,theirProps:s,slot:a.slot||{},defaultTag:Mg,name:a.name||"Description"})}let xg=nt(Ug),_l=Object.assign(xg,{}),Cs=_t(()=>{});Cs.displayName="StackContext";var Ko=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(Ko||{});function jg(){return dt(Cs)}function Bg({children:e,onUpdate:t,type:n,element:r,enabled:s}){let a=jg(),c=Fe((...d)=>{t==null||t(...d),a(...d)});return yt(()=>{let d=s===void 0||s===!0;return d&&c(0,n,r),()=>{d&&c(1,n,r)}},[c,n,r,s]),we.createElement(Cs.Provider,{value:c},e)}function Hg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const $g=typeof Object.is=="function"?Object.is:Hg,{useState:Kg,useEffect:Vg,useLayoutEffect:qg,useDebugValue:Wg}=Wr;function Jg(e,t,n){const r=t(),[{inst:s},a]=Kg({inst:{value:r,getSnapshot:t}});return qg(()=>{s.value=r,s.getSnapshot=t,ho(s)&&a({inst:s})},[e,r,t]),Vg(()=>(ho(s)&&a({inst:s}),e(()=>{ho(s)&&a({inst:s})})),[e]),Wg(r),r}function ho(e){const t=e.getSnapshot,n=e.value;try{const r=t();return!$g(n,r)}catch{return!0}}function zg(e,t,n){return t()}const Yg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Gg=!Yg,Xg=Gg?zg:Jg,Qg="useSyncExternalStore"in Wr?(e=>e.useSyncExternalStore)(Wr):Xg;function Zg(e){return Qg(e.subscribe,e.getSnapshot,e.getSnapshot)}function ev(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(s){return r.add(s),()=>r.delete(s)},dispatch(s,...a){let c=t[s].call(n,...a);c&&(n=c,r.forEach(d=>d()))}}}function tv(){let e;return{before({doc:t}){var n;let r=t.documentElement;e=((n=t.defaultView)!=null?n:window).innerWidth-r.clientWidth},after({doc:t,d:n}){let r=t.documentElement,s=r.clientWidth-r.offsetWidth,a=e-s;n.style(r,"paddingRight",`${a}px`)}}}function nv(){if(!mg())return{};let e;return{before(){e=window.pageYOffset},after({doc:t,d:n,meta:r}){function s(a){return r.containers.flatMap(c=>c()).some(c=>c.contains(a))}n.microTask(()=>{if(window.getComputedStyle(t.documentElement).scrollBehavior!=="auto"){let c=an();c.style(t.documentElement,"scroll-behavior","auto"),n.add(()=>n.microTask(()=>c.dispose()))}n.style(t.body,"marginTop",`-${e}px`),window.scrollTo(0,0);let a=null;n.addEventListener(t,"click",c=>{if(c.target instanceof HTMLElement)try{let d=c.target.closest("a");if(!d)return;let{hash:g}=new URL(d.href),f=t.querySelector(g);f&&!s(f)&&(a=f)}catch{}},!0),n.addEventListener(t,"touchmove",c=>{c.target instanceof HTMLElement&&!s(c.target)&&c.preventDefault()},{passive:!1}),n.add(()=>{window.scrollTo(0,window.pageYOffset+e),a&&a.isConnected&&(a.scrollIntoView({block:"nearest"}),a=null)})})}}}function rv(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function iv(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Wn=ev(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:an(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:iv(n)},s=[nv(),tv(),rv()];s.forEach(({before:a})=>a==null?void 0:a(r)),s.forEach(({after:a})=>a==null?void 0:a(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Wn.subscribe(()=>{let e=Wn.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",s=n.count!==0;(s&&!r||!s&&r)&&Wn.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Wn.dispatch("TEARDOWN",n)}});function ov(e,t,n){let r=Zg(Wn),s=e?r.get(e):void 0,a=s?s.count>0:!1;return yt(()=>{if(!(!e||!t))return Wn.dispatch("PUSH",e,n),()=>Wn.dispatch("POP",e,n)},[t,e]),a}let po=new Map,Mr=new Map;function Ya(e,t=!0){yt(()=>{var n;if(!t)return;let r=typeof e=="function"?e():e.current;if(!r)return;function s(){var c;if(!r)return;let d=(c=Mr.get(r))!=null?c:1;if(d===1?Mr.delete(r):Mr.set(r,d-1),d!==1)return;let g=po.get(r);g&&(g["aria-hidden"]===null?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",g["aria-hidden"]),r.inert=g.inert,po.delete(r))}let a=(n=Mr.get(r))!=null?n:0;return Mr.set(r,a+1),a!==0||(po.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0),s},[e,t])}function sv({defaultContainers:e=[],portals:t,mainTreeNodeRef:n}={}){var r;let s=ke((r=n==null?void 0:n.current)!=null?r:null),a=kr(s),c=Fe(()=>{var d;let g=[];for(let f of e)f!==null&&(f instanceof HTMLElement?g.push(f):"current"in f&&f.current instanceof HTMLElement&&g.push(f.current));if(t!=null&&t.current)for(let f of t.current)g.push(f);for(let f of(d=a==null?void 0:a.querySelectorAll("html > *, body > *"))!=null?d:[])f!==document.body&&f!==document.head&&f instanceof HTMLElement&&f.id!=="headlessui-portal-root"&&(f.contains(s.current)||g.some(p=>f.contains(p))||g.push(f));return g});return{resolveContainers:c,contains:Fe(d=>c().some(g=>g.contains(d))),mainTreeNodeRef:s,MainTreeNode:Ue(()=>function(){return n!=null?null:we.createElement(Ri,{features:Yr.Hidden,ref:s})},[s,n])}}var av=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(av||{}),uv=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(uv||{});let cv={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Oi=_t(null);Oi.displayName="DialogContext";function ti(e){let t=dt(Oi);if(t===null){let n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ti),n}return t}function lv(e,t,n=()=>[document.body]){ov(e,t,r=>{var s;return{containers:[...(s=r.containers)!=null?s:[],n]}})}function fv(e,t){return st(t.type,cv,e,t)}let hv="div",dv=jn.RenderStrategy|jn.Static;function pv(e,t){var n;let r=zt(),{id:s=`headlessui-dialog-${r}`,open:a,onClose:c,initialFocus:d,__demoMode:g=!1,...f}=e,[p,h]=Et(0),m=Zr();a===void 0&&m!==null&&(a=(m&ot.Open)===ot.Open);let _=ke(null),w=pt(_,t),P=kr(_),I=e.hasOwnProperty("open")||m!==null,R=e.hasOwnProperty("onClose");if(!I&&!R)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!I)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!R)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof a!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${a}`);if(typeof c!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${c}`);let E=a?0:1,[A,N]=Zn(fv,{titleId:null,descriptionId:null,panelRef:Vr()}),O=Fe(()=>c(!1)),L=Fe(De=>N({type:0,id:De})),S=Pr()?g?!1:E===0:!1,D=p>1,H=dt(Oi)!==null,[Q,x]=Lg(),{resolveContainers:ue,mainTreeNodeRef:le,MainTreeNode:be}=sv({portals:Q,defaultContainers:[(n=A.panelRef.current)!=null?n:_.current]}),Se=D?"parent":"leaf",Te=m!==null?(m&ot.Closing)===ot.Closing:!1,Ne=(()=>H||Te?!1:S)(),Ke=On(()=>{var De,He;return(He=Array.from((De=P==null?void 0:P.querySelectorAll("body > *"))!=null?De:[]).find(q=>q.id==="headlessui-portal-root"?!1:q.contains(le.current)&&q instanceof HTMLElement))!=null?He:null},[le]);Ya(Ke,Ne);let Pe=(()=>D?!0:S)(),Ae=On(()=>{var De,He;return(He=Array.from((De=P==null?void 0:P.querySelectorAll("[data-headlessui-portal]"))!=null?De:[]).find(q=>q.contains(le.current)&&q instanceof HTMLElement))!=null?He:null},[le]);Ya(Ae,Pe);let Le=(()=>!(!S||D))();ol(ue,O,Le);let at=(()=>!(D||E!==0))();cl(P==null?void 0:P.defaultView,"keydown",De=>{at&&(De.defaultPrevented||De.key===Ye.Escape&&(De.preventDefault(),De.stopPropagation(),O()))});let Be=(()=>!(Te||E!==0||H))();lv(P,Be,ue),je(()=>{if(E!==0||!_.current)return;let De=new ResizeObserver(He=>{for(let q of He){let b=q.target.getBoundingClientRect();b.x===0&&b.y===0&&b.width===0&&b.height===0&&O()}});return De.observe(_.current),()=>De.disconnect()},[E,_,O]);let[bt,Ft]=yl(),Bt=Ue(()=>[{dialogState:E,close:O,setTitleId:L},A],[E,A,O,L]),At=Ue(()=>({open:E===0}),[E]),rt={ref:w,id:s,role:"dialog","aria-modal":E===0?!0:void 0,"aria-labelledby":A.titleId,"aria-describedby":bt};return we.createElement(Bg,{type:"Dialog",enabled:E===0,element:_,onUpdate:Fe((De,He)=>{He==="Dialog"&&st(De,{[Ko.Add]:()=>h(q=>q+1),[Ko.Remove]:()=>h(q=>q-1)})})},we.createElement(Bo,{force:!0},we.createElement($o,null,we.createElement(Oi.Provider,{value:Bt},we.createElement($o.Group,{target:_},we.createElement(Bo,{force:!1},we.createElement(Ft,{slot:At,name:"Dialog.Description"},we.createElement(Nr,{initialFocus:d,containers:ue,features:S?st(Se,{parent:Nr.features.RestoreFocus,leaf:Nr.features.All&~Nr.features.FocusLock}):Nr.features.None},we.createElement(x,null,tt({ourProps:rt,theirProps:f,slot:At,defaultTag:hv,features:dv,visible:E===0,name:"Dialog"}))))))))),we.createElement(be,null))}let gv="div";function vv(e,t){let n=zt(),{id:r=`headlessui-dialog-overlay-${n}`,...s}=e,[{dialogState:a,close:c}]=ti("Dialog.Overlay"),d=pt(t),g=Fe(p=>{if(p.target===p.currentTarget){if($i(p.currentTarget))return p.preventDefault();p.preventDefault(),p.stopPropagation(),c()}}),f=Ue(()=>({open:a===0}),[a]);return tt({ourProps:{ref:d,id:r,"aria-hidden":!0,onClick:g},theirProps:s,slot:f,defaultTag:gv,name:"Dialog.Overlay"})}let mv="div";function yv(e,t){let n=zt(),{id:r=`headlessui-dialog-backdrop-${n}`,...s}=e,[{dialogState:a},c]=ti("Dialog.Backdrop"),d=pt(t);je(()=>{if(c.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[c.panelRef]);let g=Ue(()=>({open:a===0}),[a]);return we.createElement(Bo,{force:!0},we.createElement($o,null,tt({ourProps:{ref:d,id:r,"aria-hidden":!0},theirProps:s,slot:g,defaultTag:mv,name:"Dialog.Backdrop"})))}let _v="div";function bv(e,t){let n=zt(),{id:r=`headlessui-dialog-panel-${n}`,...s}=e,[{dialogState:a},c]=ti("Dialog.Panel"),d=pt(t,c.panelRef),g=Ue(()=>({open:a===0}),[a]),f=Fe(p=>{p.stopPropagation()});return tt({ourProps:{ref:d,id:r,onClick:f},theirProps:s,slot:g,defaultTag:_v,name:"Dialog.Panel"})}let Sv="h2";function wv(e,t){let n=zt(),{id:r=`headlessui-dialog-title-${n}`,...s}=e,[{dialogState:a,setTitleId:c}]=ti("Dialog.Title"),d=pt(t);je(()=>(c(r),()=>c(null)),[r,c]);let g=Ue(()=>({open:a===0}),[a]);return tt({ourProps:{ref:d,id:r},theirProps:s,slot:g,defaultTag:Sv,name:"Dialog.Title"})}let Ev=nt(pv),Fv=nt(yv),Av=nt(bv),Pv=nt(vv),kv=nt(wv),Dm=Object.assign(Ev,{Backdrop:Fv,Panel:Av,Overlay:Pv,Title:kv,Description:_l});var Ga;let Tv=(Ga=we.startTransition)!=null?Ga:function(e){e()};var Cv=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Cv||{}),Iv=(e=>(e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.CloseDisclosure=1]="CloseDisclosure",e[e.SetButtonId=2]="SetButtonId",e[e.SetPanelId=3]="SetPanelId",e[e.LinkPanel=4]="LinkPanel",e[e.UnlinkPanel=5]="UnlinkPanel",e))(Iv||{});let Rv={0:e=>({...e,disclosureState:st(e.disclosureState,{0:1,1:0})}),1:e=>e.disclosureState===1?e:{...e,disclosureState:1},4(e){return e.linkedPanel===!0?e:{...e,linkedPanel:!0}},5(e){return e.linkedPanel===!1?e:{...e,linkedPanel:!1}},2(e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},3(e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}}},Is=_t(null);Is.displayName="DisclosureContext";function Rs(e){let t=dt(Is);if(t===null){let n=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Rs),n}return t}let Os=_t(null);Os.displayName="DisclosureAPIContext";function bl(e){let t=dt(Os);if(t===null){let n=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,bl),n}return t}let Ls=_t(null);Ls.displayName="DisclosurePanelContext";function Ov(){return dt(Ls)}function Lv(e,t){return st(t.type,Rv,e,t)}let Dv=et;function Nv(e,t){let{defaultOpen:n=!1,...r}=e,s=ke(null),a=pt(t,al(I=>{s.current=I},e.as===void 0||e.as===et)),c=ke(null),d=ke(null),g=Zn(Lv,{disclosureState:n?0:1,linkedPanel:!1,buttonRef:d,panelRef:c,buttonId:null,panelId:null}),[{disclosureState:f,buttonId:p},h]=g,m=Fe(I=>{h({type:1});let R=Qr(s);if(!R||!p)return;let E=(()=>I?I instanceof HTMLElement?I:I.current instanceof HTMLElement?I.current:R.getElementById(p):R.getElementById(p))();E==null||E.focus()}),_=Ue(()=>({close:m}),[m]),w=Ue(()=>({open:f===0,close:m}),[f,m]),P={ref:a};return we.createElement(Is.Provider,{value:g},we.createElement(Os.Provider,{value:_},we.createElement(ks,{value:st(f,{0:ot.Open,1:ot.Closed})},tt({ourProps:P,theirProps:r,slot:w,defaultTag:Dv,name:"Disclosure"}))))}let Mv="button";function Uv(e,t){let n=zt(),{id:r=`headlessui-disclosure-button-${n}`,...s}=e,[a,c]=Rs("Disclosure.Button"),d=Ov(),g=d===null?!1:d===a.panelId,f=ke(null),p=pt(f,t,g?null:a.buttonRef);je(()=>{if(!g)return c({type:2,buttonId:r}),()=>{c({type:2,buttonId:null})}},[r,c,g]);let h=Fe(R=>{var E;if(g){if(a.disclosureState===1)return;switch(R.key){case Ye.Space:case Ye.Enter:R.preventDefault(),R.stopPropagation(),c({type:0}),(E=a.buttonRef.current)==null||E.focus();break}}else switch(R.key){case Ye.Space:case Ye.Enter:R.preventDefault(),R.stopPropagation(),c({type:0});break}}),m=Fe(R=>{switch(R.key){case Ye.Space:R.preventDefault();break}}),_=Fe(R=>{var E;$i(R.currentTarget)||e.disabled||(g?(c({type:0}),(E=a.buttonRef.current)==null||E.focus()):c({type:0}))}),w=Ue(()=>({open:a.disclosureState===0}),[a]),P=As(e,f),I=g?{ref:p,type:P,onKeyDown:h,onClick:_}:{ref:p,id:r,type:P,"aria-expanded":a.disclosureState===0,"aria-controls":a.linkedPanel?a.panelId:void 0,onKeyDown:h,onKeyUp:m,onClick:_};return tt({ourProps:I,theirProps:s,slot:w,defaultTag:Mv,name:"Disclosure.Button"})}let xv="div",jv=jn.RenderStrategy|jn.Static;function Bv(e,t){let n=zt(),{id:r=`headlessui-disclosure-panel-${n}`,...s}=e,[a,c]=Rs("Disclosure.Panel"),{close:d}=bl("Disclosure.Panel"),g=pt(t,a.panelRef,_=>{Tv(()=>c({type:_?4:5}))});je(()=>(c({type:3,panelId:r}),()=>{c({type:3,panelId:null})}),[r,c]);let f=Zr(),p=(()=>f!==null?(f&ot.Open)===ot.Open:a.disclosureState===0)(),h=Ue(()=>({open:a.disclosureState===0,close:d}),[a,d]),m={ref:g,id:r};return we.createElement(Ls.Provider,{value:a.panelId},tt({ourProps:m,theirProps:s,slot:h,defaultTag:xv,features:jv,visible:p,name:"Disclosure.Panel"}))}let Hv=nt(Nv),$v=nt(Uv),Kv=nt(Bv),Nm=Object.assign(Hv,{Button:$v,Panel:Kv}),Xa=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Qa(e){var t,n;let r=(t=e.innerText)!=null?t:"",s=e.cloneNode(!0);if(!(s instanceof HTMLElement))return r;let a=!1;for(let d of s.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))d.remove(),a=!0;let c=a?(n=s.innerText)!=null?n:"":r;return Xa.test(c)&&(c=c.replace(Xa,"")),c}function Vv(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(s=>{let a=document.getElementById(s);if(a){let c=a.getAttribute("aria-label");return typeof c=="string"?c.trim():Qa(a).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return Qa(e).trim()}function qv(e){let t=ke(""),n=ke("");return Fe(()=>{let r=e.current;if(!r)return"";let s=r.innerText;if(t.current===s)return n.current;let a=Vv(r).trim().toLowerCase();return t.current=s,n.current=a,a})}var Wv=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Wv||{}),Jv=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Jv||{}),zv=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))(zv||{});function go(e,t=n=>n){let n=e.activeItemIndex!==null?e.items[e.activeItemIndex]:null,r=rl(t(e.items.slice()),a=>a.dataRef.current.domRef.current),s=n?r.indexOf(n):null;return s===-1&&(s=null),{items:r,activeItemIndex:s}}let Yv={1(e){return e.menuState===1?e:{...e,activeItemIndex:null,menuState:1}},0(e){return e.menuState===0?e:{...e,__demoMode:!1,menuState:0}},2:(e,t)=>{var n;let r=go(e),s=cg(t,{resolveItems:()=>r.items,resolveActiveIndex:()=>r.activeItemIndex,resolveId:a=>a.id,resolveDisabled:a=>a.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeItemIndex:s,activationTrigger:(n=t.trigger)!=null?n:1}},3:(e,t)=>{let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),s=(e.activeItemIndex!==null?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find(c=>{var d;return((d=c.dataRef.current.textValue)==null?void 0:d.startsWith(r))&&!c.dataRef.current.disabled}),a=s?e.items.indexOf(s):-1;return a===-1||a===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:a,activationTrigger:1}},4(e){return e.searchQuery===""?e:{...e,searchQuery:"",searchActiveItemIndex:null}},5:(e,t)=>{let n=go(e,r=>[...r,{id:t.id,dataRef:t.dataRef}]);return{...e,...n}},6:(e,t)=>{let n=go(e,r=>{let s=r.findIndex(a=>a.id===t.id);return s!==-1&&r.splice(s,1),r});return{...e,...n,activationTrigger:1}}},Ds=_t(null);Ds.displayName="MenuContext";function Ki(e){let t=dt(Ds);if(t===null){let n=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ki),n}return t}function Gv(e,t){return st(t.type,Yv,e,t)}let Xv=et;function Qv(e,t){let{__demoMode:n=!1,...r}=e,s=Zn(Gv,{__demoMode:n,menuState:n?0:1,buttonRef:Vr(),itemsRef:Vr(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:a,itemsRef:c,buttonRef:d},g]=s,f=pt(t);ol([d,c],(_,w)=>{var P;g({type:1}),Fs(w,Es.Loose)||(_.preventDefault(),(P=d.current)==null||P.focus())},a===0);let p=Fe(()=>{g({type:1})}),h=Ue(()=>({open:a===0,close:p}),[a,p]),m={ref:f};return we.createElement(Ds.Provider,{value:s},we.createElement(ks,{value:st(a,{0:ot.Open,1:ot.Closed})},tt({ourProps:m,theirProps:r,slot:h,defaultTag:Xv,name:"Menu"})))}let Zv="button";function e0(e,t){var n;let r=zt(),{id:s=`headlessui-menu-button-${r}`,...a}=e,[c,d]=Ki("Menu.Button"),g=pt(c.buttonRef,t),f=Ar(),p=Fe(P=>{switch(P.key){case Ye.Space:case Ye.Enter:case Ye.ArrowDown:P.preventDefault(),P.stopPropagation(),d({type:0}),f.nextFrame(()=>d({type:2,focus:rn.First}));break;case Ye.ArrowUp:P.preventDefault(),P.stopPropagation(),d({type:0}),f.nextFrame(()=>d({type:2,focus:rn.Last}));break}}),h=Fe(P=>{switch(P.key){case Ye.Space:P.preventDefault();break}}),m=Fe(P=>{if($i(P.currentTarget))return P.preventDefault();e.disabled||(c.menuState===0?(d({type:1}),f.nextFrame(()=>{var I;return(I=c.buttonRef.current)==null?void 0:I.focus({preventScroll:!0})})):(P.preventDefault(),d({type:0})))}),_=Ue(()=>({open:c.menuState===0}),[c]),w={ref:g,id:s,type:As(e,c.buttonRef),"aria-haspopup":"menu","aria-controls":(n=c.itemsRef.current)==null?void 0:n.id,"aria-expanded":c.menuState===0,onKeyDown:p,onKeyUp:h,onClick:m};return tt({ourProps:w,theirProps:a,slot:_,defaultTag:Zv,name:"Menu.Button"})}let t0="div",n0=jn.RenderStrategy|jn.Static;function r0(e,t){var n,r;let s=zt(),{id:a=`headlessui-menu-items-${s}`,...c}=e,[d,g]=Ki("Menu.Items"),f=pt(d.itemsRef,t),p=kr(d.itemsRef),h=Ar(),m=Zr(),_=(()=>m!==null?(m&ot.Open)===ot.Open:d.menuState===0)();je(()=>{let E=d.itemsRef.current;E&&d.menuState===0&&E!==(p==null?void 0:p.activeElement)&&E.focus({preventScroll:!0})},[d.menuState,d.itemsRef,p]),ag({container:d.itemsRef.current,enabled:d.menuState===0,accept(E){return E.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:E.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(E){E.setAttribute("role","none")}});let w=Fe(E=>{var A,N;switch(h.dispose(),E.key){case Ye.Space:if(d.searchQuery!=="")return E.preventDefault(),E.stopPropagation(),g({type:3,value:E.key});case Ye.Enter:if(E.preventDefault(),E.stopPropagation(),g({type:1}),d.activeItemIndex!==null){let{dataRef:O}=d.items[d.activeItemIndex];(N=(A=O.current)==null?void 0:A.domRef.current)==null||N.click()}nl(d.buttonRef.current);break;case Ye.ArrowDown:return E.preventDefault(),E.stopPropagation(),g({type:2,focus:rn.Next});case Ye.ArrowUp:return E.preventDefault(),E.stopPropagation(),g({type:2,focus:rn.Previous});case Ye.Home:case Ye.PageUp:return E.preventDefault(),E.stopPropagation(),g({type:2,focus:rn.First});case Ye.End:case Ye.PageDown:return E.preventDefault(),E.stopPropagation(),g({type:2,focus:rn.Last});case Ye.Escape:E.preventDefault(),E.stopPropagation(),g({type:1}),an().nextFrame(()=>{var O;return(O=d.buttonRef.current)==null?void 0:O.focus({preventScroll:!0})});break;case Ye.Tab:E.preventDefault(),E.stopPropagation(),g({type:1}),an().nextFrame(()=>{sg(d.buttonRef.current,E.shiftKey?_n.Previous:_n.Next)});break;default:E.key.length===1&&(g({type:3,value:E.key}),h.setTimeout(()=>g({type:4}),350));break}}),P=Fe(E=>{switch(E.key){case Ye.Space:E.preventDefault();break}}),I=Ue(()=>({open:d.menuState===0}),[d]),R={"aria-activedescendant":d.activeItemIndex===null||(n=d.items[d.activeItemIndex])==null?void 0:n.id,"aria-labelledby":(r=d.buttonRef.current)==null?void 0:r.id,id:a,onKeyDown:w,onKeyUp:P,role:"menu",tabIndex:0,ref:f};return tt({ourProps:R,theirProps:c,slot:I,defaultTag:t0,features:n0,visible:_,name:"Menu.Items"})}let i0=et;function o0(e,t){let n=zt(),{id:r=`headlessui-menu-item-${n}`,disabled:s=!1,...a}=e,[c,d]=Ki("Menu.Item"),g=c.activeItemIndex!==null?c.items[c.activeItemIndex].id===r:!1,f=ke(null),p=pt(t,f);yt(()=>{if(c.__demoMode||c.menuState!==0||!g||c.activationTrigger===0)return;let O=an();return O.requestAnimationFrame(()=>{var L,S;(S=(L=f.current)==null?void 0:L.scrollIntoView)==null||S.call(L,{block:"nearest"})}),O.dispose},[c.__demoMode,f,g,c.menuState,c.activationTrigger,c.activeItemIndex]);let h=qv(f),m=ke({disabled:s,domRef:f,get textValue(){return h()}});yt(()=>{m.current.disabled=s},[m,s]),yt(()=>(d({type:5,id:r,dataRef:m}),()=>d({type:6,id:r})),[m,r]);let _=Fe(()=>{d({type:1})}),w=Fe(O=>{if(s)return O.preventDefault();d({type:1}),nl(c.buttonRef.current)}),P=Fe(()=>{if(s)return d({type:2,focus:rn.Nothing});d({type:2,focus:rn.Specific,id:r})}),I=vg(),R=Fe(O=>I.update(O)),E=Fe(O=>{I.wasMoved(O)&&(s||g||d({type:2,focus:rn.Specific,id:r,trigger:0}))}),A=Fe(O=>{I.wasMoved(O)&&(s||g&&d({type:2,focus:rn.Nothing}))}),N=Ue(()=>({active:g,disabled:s,close:_}),[g,s,_]);return tt({ourProps:{id:r,ref:p,role:"menuitem",tabIndex:s===!0?void 0:-1,"aria-disabled":s===!0?!0:void 0,disabled:void 0,onClick:w,onFocus:P,onPointerEnter:R,onMouseEnter:R,onPointerMove:E,onMouseMove:E,onPointerLeave:A,onMouseLeave:A},theirProps:a,slot:N,defaultTag:i0,name:"Menu.Item"})}let s0=nt(Qv),a0=nt(e0),u0=nt(r0),c0=nt(o0),Mm=Object.assign(s0,{Button:a0,Items:u0,Item:c0});function l0(e=0){let[t,n]=Et(e),r=ei(),s=On(g=>{r.current&&n(f=>f|g)},[t,r]),a=On(g=>!!(t&g),[t]),c=On(g=>{r.current&&n(f=>f&~g)},[n,r]),d=On(g=>{r.current&&n(f=>f^g)},[n]);return{flags:t,addFlag:s,hasFlag:a,removeFlag:c,toggleFlag:d}}let Sl=_t(null);function wl(){let e=dt(Sl);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,wl),t}return e}function f0(){let[e,t]=Et([]);return[e.length>0?e.join(" "):void 0,Ue(()=>function(n){let r=Fe(a=>(t(c=>[...c,a]),()=>t(c=>{let d=c.slice(),g=d.indexOf(a);return g!==-1&&d.splice(g,1),d}))),s=Ue(()=>({register:r,slot:n.slot,name:n.name,props:n.props}),[r,n.slot,n.name,n.props]);return we.createElement(Sl.Provider,{value:s},n.children)},[t])]}let h0="label";function d0(e,t){let n=zt(),{id:r=`headlessui-label-${n}`,passive:s=!1,...a}=e,c=wl(),d=pt(t);yt(()=>c.register(r),[r,c.register]);let g={ref:d,...c.props,id:r};return s&&("onClick"in g&&(delete g.htmlFor,delete g.onClick),"onClick"in a&&delete a.onClick),tt({ourProps:g,theirProps:a,slot:c.slot||{},defaultTag:h0,name:c.name||"Label"})}let p0=nt(d0),g0=Object.assign(p0,{}),Ns=_t(null);Ns.displayName="GroupContext";let v0=et;function m0(e){var t;let[n,r]=Et(null),[s,a]=f0(),[c,d]=yl(),g=Ue(()=>({switch:n,setSwitch:r,labelledby:s,describedby:c}),[n,r,s,c]),f={},p=e;return we.createElement(d,{name:"Switch.Description"},we.createElement(a,{name:"Switch.Label",props:{htmlFor:(t=g.switch)==null?void 0:t.id,onClick(h){n&&(h.currentTarget.tagName==="LABEL"&&h.preventDefault(),n.click(),n.focus({preventScroll:!0}))}}},we.createElement(Ns.Provider,{value:g},tt({ourProps:f,theirProps:p,defaultTag:v0,name:"Switch.Group"}))))}let y0="button";function _0(e,t){let n=zt(),{id:r=`headlessui-switch-${n}`,checked:s,defaultChecked:a=!1,onChange:c,name:d,value:g,form:f,...p}=e,h=dt(Ns),m=ke(null),_=pt(m,t,h===null?null:h.setSwitch),[w,P]=gg(s,c,a),I=Fe(()=>P==null?void 0:P(!w)),R=Fe(S=>{if($i(S.currentTarget))return S.preventDefault();S.preventDefault(),I()}),E=Fe(S=>{S.key===Ye.Space?(S.preventDefault(),I()):S.key===Ye.Enter&&hg(S.currentTarget)}),A=Fe(S=>S.preventDefault()),N=Ue(()=>({checked:w}),[w]),O={id:r,ref:_,role:"switch",type:As(e,m),tabIndex:0,"aria-checked":w,"aria-labelledby":h==null?void 0:h.labelledby,"aria-describedby":h==null?void 0:h.describedby,onClick:R,onKeyUp:E,onKeyPress:A},L=Ar();return je(()=>{var S;let D=(S=m.current)==null?void 0:S.closest("form");D&&a!==void 0&&L.addEventListener(D,"reset",()=>{P(a)})},[m,P]),we.createElement(we.Fragment,null,d!=null&&w&&we.createElement(Ri,{features:Yr.Hidden,...jo({as:"input",type:"checkbox",hidden:!0,readOnly:!0,form:f,checked:w,name:d,value:g})}),tt({ourProps:O,theirProps:p,slot:N,defaultTag:y0,name:"Switch"}))}let b0=nt(_0),S0=m0,Um=Object.assign(b0,{Group:S0,Label:g0,Description:_l});function w0(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function vo(e,...t){e&&t.length>0&&e.classList.add(...t)}function mo(e,...t){e&&t.length>0&&e.classList.remove(...t)}function E0(e,t){let n=an();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:s}=getComputedStyle(e),[a,c]=[r,s].map(g=>{let[f=0]=g.split(",").filter(Boolean).map(p=>p.includes("ms")?parseFloat(p):parseFloat(p)*1e3).sort((p,h)=>h-p);return f}),d=a+c;if(d!==0){n.group(f=>{f.setTimeout(()=>{t(),f.dispose()},d),f.addEventListener(e,"transitionrun",p=>{p.target===p.currentTarget&&f.dispose()})});let g=n.addEventListener(e,"transitionend",f=>{f.target===f.currentTarget&&(t(),g())})}else t();return n.add(()=>t()),n.dispose}function F0(e,t,n,r){let s=n?"enter":"leave",a=an(),c=r!==void 0?w0(r):()=>{};s==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let d=st(s,{enter:()=>t.enter,leave:()=>t.leave}),g=st(s,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),f=st(s,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return mo(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),vo(e,...t.base,...d,...f),a.nextFrame(()=>{mo(e,...t.base,...d,...f),vo(e,...t.base,...d,...g),E0(e,()=>(mo(e,...t.base,...d),vo(e,...t.base,...t.entered),c()))}),a.dispose}function A0({immediate:e,container:t,direction:n,classes:r,onStart:s,onStop:a}){let c=ei(),d=Ar(),g=An(n);yt(()=>{e&&(g.current="enter")},[e]),yt(()=>{let f=an();d.add(f.dispose);let p=t.current;if(p&&g.current!=="idle"&&c.current)return f.dispose(),s.current(g.current),f.add(F0(p,r.current,g.current==="enter",()=>{f.dispose(),a.current(g.current)})),f.dispose},[n])}function Cn(e=""){return e.split(" ").filter(t=>t.trim().length>1)}let Vi=_t(null);Vi.displayName="TransitionContext";var P0=(e=>(e.Visible="visible",e.Hidden="hidden",e))(P0||{});function k0(){let e=dt(Vi);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function T0(){let e=dt(qi);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let qi=_t(null);qi.displayName="NestingContext";function Wi(e){return"children"in e?Wi(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function El(e,t){let n=An(e),r=ke([]),s=ei(),a=Ar(),c=Fe((_,w=Ln.Hidden)=>{let P=r.current.findIndex(({el:I})=>I===_);P!==-1&&(st(w,{[Ln.Unmount](){r.current.splice(P,1)},[Ln.Hidden](){r.current[P].state="hidden"}}),a.microTask(()=>{var I;!Wi(r)&&s.current&&((I=n.current)==null||I.call(n))}))}),d=Fe(_=>{let w=r.current.find(({el:P})=>P===_);return w?w.state!=="visible"&&(w.state="visible"):r.current.push({el:_,state:"visible"}),()=>c(_,Ln.Unmount)}),g=ke([]),f=ke(Promise.resolve()),p=ke({enter:[],leave:[],idle:[]}),h=Fe((_,w,P)=>{g.current.splice(0),t&&(t.chains.current[w]=t.chains.current[w].filter(([I])=>I!==_)),t==null||t.chains.current[w].push([_,new Promise(I=>{g.current.push(I)})]),t==null||t.chains.current[w].push([_,new Promise(I=>{Promise.all(p.current[w].map(([R,E])=>E)).then(()=>I())})]),w==="enter"?f.current=f.current.then(()=>t==null?void 0:t.wait.current).then(()=>P(w)):P(w)}),m=Fe((_,w,P)=>{Promise.all(p.current[w].splice(0).map(([I,R])=>R)).then(()=>{var I;(I=g.current.shift())==null||I()}).then(()=>P(w))});return Ue(()=>({children:r,register:d,unregister:c,onStart:h,onStop:m,wait:f,chains:p}),[d,c,r,h,m,p,f])}function C0(){}let I0=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Za(e){var t;let n={};for(let r of I0)n[r]=(t=e[r])!=null?t:C0;return n}function R0(e){let t=ke(Za(e));return je(()=>{t.current=Za(e)},[e]),t}let O0="div",Fl=jn.RenderStrategy;function L0(e,t){var n,r;let{beforeEnter:s,afterEnter:a,beforeLeave:c,afterLeave:d,enter:g,enterFrom:f,enterTo:p,entered:h,leave:m,leaveFrom:_,leaveTo:w,...P}=e,I=ke(null),R=pt(I,t),E=(n=P.unmount)==null||n?Ln.Unmount:Ln.Hidden,{show:A,appear:N,initial:O}=k0(),[L,S]=Et(A?"visible":"hidden"),D=T0(),{register:H,unregister:Q}=D;je(()=>H(I),[H,I]),je(()=>{if(E===Ln.Hidden&&I.current){if(A&&L!=="visible"){S("visible");return}return st(L,{hidden:()=>Q(I),visible:()=>H(I)})}},[L,I,H,Q,A,E]);let x=An({base:Cn(P.className),enter:Cn(g),enterFrom:Cn(f),enterTo:Cn(p),entered:Cn(h),leave:Cn(m),leaveFrom:Cn(_),leaveTo:Cn(w)}),ue=R0({beforeEnter:s,afterEnter:a,beforeLeave:c,afterLeave:d}),le=Pr();je(()=>{if(le&&L==="visible"&&I.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[I,L,le]);let be=O&&!N,Se=N&&A&&O,Te=(()=>!le||be?"idle":A?"enter":"leave")(),Ne=l0(0),Ke=Fe(Be=>st(Be,{enter:()=>{Ne.addFlag(ot.Opening),ue.current.beforeEnter()},leave:()=>{Ne.addFlag(ot.Closing),ue.current.beforeLeave()},idle:()=>{}})),Pe=Fe(Be=>st(Be,{enter:()=>{Ne.removeFlag(ot.Opening),ue.current.afterEnter()},leave:()=>{Ne.removeFlag(ot.Closing),ue.current.afterLeave()},idle:()=>{}})),Ae=El(()=>{S("hidden"),Q(I)},D);A0({immediate:Se,container:I,classes:x,direction:Te,onStart:An(Be=>{Ae.onStart(I,Be,Ke)}),onStop:An(Be=>{Ae.onStop(I,Be,Pe),Be==="leave"&&!Wi(Ae)&&(S("hidden"),Q(I))})});let Le=P,at={ref:R};return Se?Le={...Le,className:Ii(P.className,...x.current.enter,...x.current.enterFrom)}:(Le.className=Ii(P.className,(r=I.current)==null?void 0:r.className),Le.className===""&&delete Le.className),we.createElement(qi.Provider,{value:Ae},we.createElement(ks,{value:st(L,{visible:ot.Open,hidden:ot.Closed})|Ne.flags},tt({ourProps:at,theirProps:Le,defaultTag:O0,features:Fl,visible:L==="visible",name:"Transition.Child"})))}function D0(e,t){let{show:n,appear:r=!1,unmount:s=!0,...a}=e,c=ke(null),d=pt(c,t);Pr();let g=Zr();if(n===void 0&&g!==null&&(n=(g&ot.Open)===ot.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[f,p]=Et(n?"visible":"hidden"),h=El(()=>{p("hidden")}),[m,_]=Et(!0),w=ke([n]);yt(()=>{m!==!1&&w.current[w.current.length-1]!==n&&(w.current.push(n),_(!1))},[w,n]);let P=Ue(()=>({show:n,appear:r,initial:m}),[n,r,m]);je(()=>{if(n)p("visible");else if(!Wi(h))p("hidden");else{let A=c.current;if(!A)return;let N=A.getBoundingClientRect();N.x===0&&N.y===0&&N.width===0&&N.height===0&&p("hidden")}},[n,h]);let I={unmount:s},R=Fe(()=>{var A;m&&_(!1),(A=e.beforeEnter)==null||A.call(e)}),E=Fe(()=>{var A;m&&_(!1),(A=e.beforeLeave)==null||A.call(e)});return we.createElement(qi.Provider,{value:h},we.createElement(Vi.Provider,{value:P},tt({ourProps:{...I,as:et,children:we.createElement(Al,{ref:d,...I,...a,beforeEnter:R,beforeLeave:E})},theirProps:{},defaultTag:et,features:Fl,visible:f==="visible",name:"Transition"})))}function N0(e,t){let n=dt(Vi)!==null,r=Zr()!==null;return we.createElement(we.Fragment,null,!n&&r?we.createElement(Vo,{ref:t,...e}):we.createElement(Al,{ref:t,...e}))}let Vo=nt(D0),Al=nt(L0),M0=nt(N0),xm=Object.assign(Vo,{Child:M0,Root:Vo});function U0({title:e,titleId:t,...n},r){return _e("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?_e("title",{id:t},e):null,_e("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"}))}const x0=Lt(U0),jm=x0;function j0({title:e,titleId:t,...n},r){return _e("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?_e("title",{id:t},e):null,_e("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25H12"}))}const B0=Lt(j0),Bm=B0;function H0({title:e,titleId:t,...n},r){return _e("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?_e("title",{id:t},e):null,_e("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5"}))}const $0=Lt(H0),Hm=$0;function K0({title:e,titleId:t,...n},r){return _e("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?_e("title",{id:t},e):null,_e("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"}))}const V0=Lt(K0),$m=V0;function q0({title:e,titleId:t,...n},r){return _e("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?_e("title",{id:t},e):null,_e("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"}))}const W0=Lt(q0),Km=W0;function J0({title:e,titleId:t,...n},r){return _e("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?_e("title",{id:t},e):null,_e("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"}))}const z0=Lt(J0),Vm=z0;function Y0({title:e,titleId:t,...n},r){return _e("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?_e("title",{id:t},e):null,_e("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"}),_e("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))}const G0=Lt(Y0),qm=G0;function X0({title:e,titleId:t,...n},r){return _e("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?_e("title",{id:t},e):null,_e("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 11.25v8.25a1.5 1.5 0 01-1.5 1.5H5.25a1.5 1.5 0 01-1.5-1.5v-8.25M12 4.875A2.625 2.625 0 109.375 7.5H12m0-2.625V7.5m0-2.625A2.625 2.625 0 1114.625 7.5H12m0 0V21m-8.625-9.75h18c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125h-18c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"}))}const Q0=Lt(X0),Wm=Q0;function Z0({title:e,titleId:t,...n},r){return _e("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?_e("title",{id:t},e):null,_e("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25a3 3 0 013 3m3 0a6 6 0 01-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1121.75 8.25z"}))}const em=Lt(Z0),Jm=em;function tm({title:e,titleId:t,...n},r){return _e("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?_e("title",{id:t},e):null,_e("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.375 12.739l-7.693 7.693a4.5 4.5 0 01-6.364-6.364l10.94-10.94A3 3 0 1119.5 7.372L8.552 18.32m.009-.01l-.01.01m5.699-9.941l-7.81 7.81a1.5 1.5 0 002.112 2.13"}))}const nm=Lt(tm),zm=nm;function rm({title:e,titleId:t,...n},r){return _e("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?_e("title",{id:t},e):null,_e("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6.878V6a2.25 2.25 0 012.25-2.25h7.5A2.25 2.25 0 0118 6v.878m-12 0c.235-.083.487-.128.75-.128h10.5c.263 0 .515.045.75.128m-12 0A2.25 2.25 0 004.5 9v.878m13.5-3A2.25 2.25 0 0119.5 9v.878m0 0a2.246 2.246 0 00-.75-.128H5.25c-.263 0-.515.045-.75.128m15 0A2.25 2.25 0 0121 12v6a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 18v-6c0-.98.626-1.813 1.5-2.122"}))}const im=Lt(rm),Ym=im;function om({title:e,titleId:t,...n},r){return _e("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?_e("title",{id:t},e):null,_e("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"}))}const sm=Lt(om),Gm=sm;function am({title:e,titleId:t,...n},r){return _e("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?_e("title",{id:t},e):null,_e("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}))}const um=Lt(am),Xm=um;function qo(e){this.message=e}qo.prototype=new Error,qo.prototype.name="InvalidCharacterError";var eu=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new qo("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,s=0,a=0,c="";r=t.charAt(a++);~r&&(n=s%4?64*n+r:r,s++%4)?c+=String.fromCharCode(255&n>>(-2*s&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return c};function cm(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(n){return decodeURIComponent(eu(n).replace(/(.)/g,function(r,s){var a=s.charCodeAt(0).toString(16).toUpperCase();return a.length<2&&(a="0"+a),"%"+a}))}(t)}catch{return eu(t)}}function Li(e){this.message=e}function Qm(e,t){if(typeof e!="string")throw new Li("Invalid token specified");var n=(t=t||{}).header===!0?0:1;try{return JSON.parse(cm(e.split(".")[n]))}catch(r){throw new Li("Invalid token specified: "+r.message)}}Li.prototype=new Error,Li.prototype.name="InvalidTokenError";export{Hm as $,Qm as A,Bm as B,dt as C,ds as D,af as E,Ue as F,_e as G,Cm as H,Ud as I,ym as J,vm as K,pm as L,uc as M,Sm as N,Om as O,_m as P,Ph as Q,xn as R,Sh as S,tc as T,Br as U,Mu as V,dr as W,Xm as X,Dm as Y,Wm as Z,Zt as _,mr as a,Ym as a0,Jm as a1,Lt as a2,Ih as a3,dm as a4,jt as a5,jm as a6,ke as a7,bm as a8,Wr as a9,Oe as aa,Em as ab,On as ac,Ac as ad,Zs as ae,fm as af,lm as ag,Vm as ah,Um as ai,Zo as aj,rs as ak,km as al,Tm as am,Km as an,zm as ao,Gm as ap,qm as aq,$m as ar,Xu as as,ic as at,_t as au,er as av,Xt as aw,wc as ax,Zu as ay,gm as b,Rm as c,zf as d,Am as e,Sr as f,Pm as g,kc as h,ji as i,bd as j,Fm as k,rp as l,mm as m,hs as n,Im as o,wm as p,Et as q,Rc as r,pi as s,hm as t,je as u,et as v,Nm as w,Mm as x,xm as y,we as z};