(()=>{var e={2634:(e,t,r)=>{"use strict";r.d(t,{h4:()=>Be,ab:()=>ce});var n=function(){return Object.create(null)},i=Array.prototype,a=i.forEach,o=i.slice,s=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=n),this.weakness=e,this.makeData=t}return e.prototype.lookup=function(){for(var e=[],t=0;tthis.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),v=new p;function g(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var m=[];function b(e,t){if(!e)throw new Error(t||"assertion failure")}function E(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var S=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(1===this.value.length&&!w(this))return this.value[0]},e.prototype.recompute=function(e){return b(!this.recomputing,"already recomputing"),function(e){var t=v.getValue();if(t)e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),w(e)?I(t,e):k(t,e)}(this),w(this)?function(e,t){B(e),v.withValue(e,C,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{g(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){if(e.dirty=!1,w(e))return;A(e)}(e);return E(e.value)}(this,e):E(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,T(this),B(this),g(this))},e.prototype.dispose=function(){var e=this;B(this),g(this),this.parents.forEach((function(t){t.setDirty(),N(t,e)}))},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=m.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(this.deps.forEach((function(t){return t.delete(e)})),this.deps.clear(),m.push(this.deps),this.deps=null)},e.count=0,e}();function C(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(t){e.value[1]=t}e.recomputing=!1}function w(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function T(e){e.parents.forEach((function(t){return I(t,e)}))}function A(e){e.parents.forEach((function(t){return k(t,e)}))}function I(e,t){if(b(e.childValues.has(t)),b(w(t)),e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=m.pop()||new Set;e.dirtyChildren.add(t),T(e)}function k(e,t){b(e.childValues.has(t)),b(!w(t));var r,n,i,a=e.childValues.get(t);0===a.length?e.childValues.set(t,t.value.slice(0)):(r=a,n=t.value,(i=r.length)>0&&i===n.length&&r[i-1]===n[i-1]||e.setDirty()),_(e,t),w(e)||A(e)}function _(e,t){var r=e.dirtyChildren;r&&(r.delete(t),0===r.size&&(m.length<100&&m.push(r),e.dirtyChildren=null))}function B(e){e.childValues.size>0&&e.childValues.forEach((function(t,r){N(e,r)})),e.forgetDeps(),b(null===e.dirtyChildren)}function N(e,t){t.parents.delete(e),e.childValues.delete(t),_(e,t)}function O(e){var t=new Map,r=e&&e.subscribe;function n(e){var n=v.getValue();if(n){var i=t.get(e);i||t.set(e,i=new Set),n.dependOn(i),"function"==typeof r&&(g(i),i.unsubscribe=r(e))}}return n.dirty=function(e){var r=t.get(e);r&&(r.forEach((function(e){return e.setDirty()})),t.delete(e),g(r))},n}var R=new s("function"==typeof WeakMap);function x(){for(var e=[],t=0;t0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof ee?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),r=this.toObject();t.forEach((function(n){q.call(r,n)&&(Object.keys(e.findChildRefIds(n)).forEach(t.add,t),delete r[n])}));var n=Object.keys(r);if(n.length){for(var i=this;i instanceof ee;)i=i.parent;n.forEach((function(e){return i.delete(e)}))}return n},e.prototype.findChildRefIds=function(e){if(!q.call(this.refs,e)){var t=this.refs[e]=Object.create(null),r=new Set([this.data[e]]),n=function(e){return null!==e&&"object"==typeof e};r.forEach((function(e){(0,L.hh)(e)?t[e.__ref]=!0:n(e)&&Object.values(e).filter(n).forEach(r.add,r)}))}return this.refs[e]},e.prototype.makeCacheKey=function(){for(var e=[],t=0;t0;if(l&&!s)throw c.missing[0];return{result:c.result,missing:c.missing,complete:!l}},e.prototype.isFresh=function(e,t,r,n){if(re(n.store)&&this.knownResults.get(e)===r){var i=this.executeSelectionSet.peek(r,t,n);if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,r=e.selectionSet,n=e.objectOrReference,i=e.context;if((0,L.hh)(n)&&!i.policies.rootTypenamesById[n.__ref]&&!i.store.has(n.__ref))return{result:{},missing:[ne(new K.ej(4),i)]};var a=i.variables,o=i.policies,s=i.store,u=[],c={result:null},l=s.getFieldValue(n,"__typename");function f(){return c.missing||(c.missing=[])}function h(e){var t;return e.missing&&(t=f()).push.apply(t,e.missing),e.result}this.config.addTypename&&"string"==typeof l&&!o.rootIdsByTypename[l]&&u.push({__typename:l});var p=new Set(r.selections);return p.forEach((function(e){var r;if((0,L.LZ)(e,a))if((0,L.My)(e)){var s=o.readField({fieldName:e.name.value,field:e,variables:i.variables,from:n},i),c=(0,L.u2)(e);i.path.push(c);var d=i.clientOnly;i.clientOnly=d||!(!e.directives||!e.directives.some((function(e){return"client"===e.name.value}))),void 0===s?L.Gw.added(e)||f().push(ne(new K.ej(5),i)):Array.isArray(s)?s=h(t.executeSubSelectedArray({field:e,array:s,context:i})):e.selectionSet&&null!=s&&(s=h(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:s,context:i}))),void 0!==s&&u.push(((r={})[c]=s,r)),i.clientOnly=d,(0,K.kG)(i.path.pop()===c)}else{var y=(0,L.hi)(e,i.fragmentMap);y&&o.fragmentMatches(y,l)&&y.selectionSet.selections.forEach(p.add,p)}})),c.result=(0,L.bw)(u),this.knownResults.set(c.result,r),c},e.prototype.execSubSelectedArrayImpl=function(e){var t,r=this,n=e.field,i=e.array,a=e.context;function o(e,r){return e.missing&&(t=t||[]).push.apply(t,e.missing),(0,K.kG)(a.path.pop()===r),e.result}return n.selectionSet&&(i=i.filter(a.store.canRead)),{result:i=i.map((function(e,t){return null===e?null:(a.path.push(t),Array.isArray(e)?o(r.executeSubSelectedArray({field:n,array:e,context:a}),t):n.selectionSet?o(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:e,context:a}),t):((0,K.kG)(a.path.pop()===t),e))})),missing:t}},e}();var ae=function(){function e(e,t){this.cache=e,this.reader=t}return e.prototype.writeToStore=function(e){var t=e.query,r=e.result,n=e.dataId,i=e.store,a=e.variables,o=(0,L.$H)(t),s=new L.w0;a=(0,V.pi)((0,V.pi)({},(0,L.O4)(o)),a);var u=this.processSelectionSet({result:r||Object.create(null),dataId:n,selectionSet:o.selectionSet,mergeTree:{map:new Map},context:{store:i,written:Object.create(null),merge:function(e,t){return s.merge(e,t)},variables:a,varString:JSON.stringify(a),fragmentMap:(0,L.F)((0,L.kU)(t))}});if(!(0,L.hh)(u))throw new K.ej(7);return i.retain(u.__ref),u},e.prototype.processSelectionSet=function(e){var t=this,r=e.dataId,n=e.result,i=e.selectionSet,a=e.context,o=e.mergeTree,s=this.cache.policies,u=s.identify(n,i,a.fragmentMap),c=u[0],l=u[1];if("string"==typeof(r=r||c)){var f=a.written[r]||(a.written[r]=[]),h=(0,L.kQ)(r);if(f.indexOf(i)>=0)return h;if(f.push(i),this.reader&&this.reader.isFresh(n,h,i,a))return h}var p=Object.create(null);l&&(p=a.merge(p,l));var d=r&&s.rootTypenamesById[r]||(0,L.qw)(n,i,a.fragmentMap)||r&&a.store.get(r,"__typename");"string"==typeof d&&(p.__typename=d);var y=new Set(i.selections);if(y.forEach((function(e){var r;if((0,L.LZ)(e,a.variables))if((0,L.My)(e)){var i=(0,L.u2)(e),u=n[i];if(void 0!==u){var c=s.getStoreFieldName({typename:d,fieldName:e.name.value,field:e,variables:a.variables}),l=se(o,c),f=t.processFieldValue(u,e,a,l),h=e.selectionSet&&a.store.getFieldValue(f,"__typename")||void 0,v=s.getMergeFunction(d,e.name.value,h);v?l.info={field:e,typename:d,merge:v}:ue(o,c),p=a.merge(p,((r={})[c]=f,r))}else if(s.usingPossibleTypes&&!(0,L.FS)(["defer","client"],e))throw new K.ej(8)}else{var g=(0,L.hi)(e,a.fragmentMap);g&&s.fragmentMatches(g,d,n,a.variables)&&g.selectionSet.selections.forEach(y.add,y)}})),"string"==typeof r){var v=(0,L.kQ)(r);return o.map.size&&(p=this.applyMerges(o,v,p,a)),a.store.merge(r,p),v}return p},e.prototype.processFieldValue=function(e,t,r,n){var i=this;return t.selectionSet&&null!==e?Array.isArray(e)?e.map((function(e,a){var o=i.processFieldValue(e,t,r,se(n,a));return ue(n,a),o})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:r,mergeTree:n}):e},e.prototype.applyMerges=function(e,t,r,n,i){var a,o=this;if(e.map.size&&!(0,L.hh)(r)){var s,u=Array.isArray(r)||!(0,L.hh)(t)&&!Q(t)?void 0:t,c=r;u&&!i&&(i=[(0,L.hh)(u)?u.__ref:u]);var l=function(e,t){return Array.isArray(e)?"number"==typeof t?e[t]:void 0:n.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){i&&i.push(t);var r=l(u,t),a=l(c,t),f=o.applyMerges(e,r,a,n,i);f!==a&&(s=s||new Map).set(t,f),i&&(0,K.kG)(i.pop()===t)})),s&&(r=Array.isArray(c)?c.slice(0):(0,V.pi)({},c),s.forEach((function(e,t){r[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,r,e.info,n,i&&(a=n.store).getStorage.apply(a,i)):r},e}(),oe=[];function se(e,t){var r=e.map;return r.has(t)||r.set(t,oe.pop()||{map:new Map}),r.get(t)}function ue(e,t){var r=e.map,n=r.get(t);!n||n.info||n.map.size||(oe.push(n),r.delete(t))}new Set;var ce=new p;function le(e,t){if(e.size){var r=[];e.forEach((function(e){return r.push(e)})),e.clear(),r.forEach(t)}}var fe=new WeakMap;function he(e){var t=fe.get(e);return t||fe.set(e,t={vars:new Set,dep:O()}),t}function pe(e){var t=new Set,r=new Set,n=function(a){if(arguments.length>0)e!==a&&(e=a,t.forEach((function(e){he(e).dep.dirty(n),de(e)})),le(r,(function(t){return t(e)})));else{var o=ce.getValue();o&&(i(o),he(o).dep(n))}return e};n.onNextChange=function(e){return r.add(e),function(){r.delete(e)}};var i=n.attachCache=function(e){return t.add(e),he(e).vars.add(n),n};return n.forgetCache=function(e){return t.delete(e)},n}function de(e){e.broadcastWatches&&e.broadcastWatches()}function ye(e){return void 0!==e.args?e.args:e.field?(0,L.NC)(e.field,e.variables):null}var ve=function(e,t){var r=e.__typename,n=e.id,i=e._id;if("string"==typeof r&&(t&&(t.keyObject=void 0!==n?{id:n}:void 0!==i?{_id:i}:void 0),void 0===n&&(n=i),void 0!==n))return r+":"+("number"==typeof n||"string"==typeof n?n:JSON.stringify(n))},ge=function(){},me=function(e,t){return t.fieldName},be=function(e,t,r){return(0,r.mergeObjects)(e,t)},Ee=function(e,t){return t},Se=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=(0,V.pi)({dataIdFromObject:ve},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t,r){var n=t&&r?(0,L.qw)(e,t,r):e.__typename;if(n===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var i,a={typename:n,selectionSet:t,fragmentMap:r},o=n&&this.getTypePolicy(n),s=o&&o.keyFn||this.config.dataIdFromObject;s;){var u=s(e,a);if(!Array.isArray(u)){i=u;break}s=Ae(u)}return i=i&&String(i),a.keyObject?[i,a.keyObject]:[i]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(r){var n=e[r],i=n.queryType,a=n.mutationType,o=n.subscriptionType,s=(0,V._T)(n,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",r),a&&t.setRootTypename("Mutation",r),o&&t.setRootTypename("Subscription",r),q.call(t.toBeAdded,r)?t.toBeAdded[r].push(s):t.toBeAdded[r]=[s]}))},e.prototype.updateTypePolicy=function(e,t){var r=this,n=this.getTypePolicy(e),i=t.keyFields,a=t.fields;function o(e,t){e.merge="function"==typeof t?t:!0===t?be:!1===t?Ee:e.merge}o(n,t.merge),n.keyFn=!1===i?ge:Array.isArray(i)?Ae(i):"function"==typeof i?i:n.keyFn,a&&Object.keys(a).forEach((function(t){var n=r.getFieldPolicy(e,t,!0),i=a[t];if("function"==typeof i)n.read=i;else{var s=i.keyArgs,u=i.read,c=i.merge;n.keyFn=!1===s?me:Array.isArray(s)?Te(s):"function"==typeof s?s:n.keyFn,"function"==typeof u&&(n.read=u),o(n,c)}n.read&&n.merge&&(n.keyFn=n.keyFn||me)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var r="ROOT_"+e.toUpperCase(),n=this.rootTypenamesById[r];t!==n&&((0,K.kG)(!n||n===e,1),n&&delete this.rootIdsByTypename[n],this.rootIdsByTypename[t]=r,this.rootTypenamesById[r]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(r){t.getSupertypeSet(r,!0),e[r].forEach((function(e){t.getSupertypeSet(e,!0).add(r);var n=e.match(z);n&&n[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!q.call(this.typePolicies,e)){var r=this.typePolicies[e]=Object.create(null);r.fields=Object.create(null);var n=this.supertypeMap.get(e);n&&n.size&&n.forEach((function(e){var n=t.getTypePolicy(e),i=n.fields,a=(0,V._T)(n,["fields"]);Object.assign(r,a),Object.assign(r.fields,i)}))}var i=this.toBeAdded[e];return i&&i.length&&this.updateTypePolicy(e,L.oA.apply(void 0,i.splice(0))),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,r){if(e){var n=this.getTypePolicy(e).fields;return n[t]||r&&(n[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var r=this.supertypeMap.get(e);return!r&&t&&this.supertypeMap.set(e,r=new Set),r},e.prototype.fragmentMatches=function(e,t,r,n){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var a=e.typeCondition.name.value;if(t===a)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(a))for(var o=this.getSupertypeSet(t,!0),s=[o],u=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&s.indexOf(t)<0&&s.push(t)},c=!(!r||!this.fuzzySubtypes.size),l=0;l{},5765:(e,t,r)=>{"use strict";r.d(t,{f:()=>w});var n=r(655),i=r(2924),a=r(1707),o=r(496),s=r(9950),u=r(2152),c=r(1498),l=r(6282),f=r(5942),h=r(7636),p=r(2634),d=function(){function e(e){var t=e.cache,r=e.client,n=e.resolvers,i=e.fragmentMatcher;this.cache=t,r&&(this.client=r),n&&this.addResolvers(n),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=(0,o.Ee)(t.resolvers,e)})):this.resolvers=(0,o.Ee)(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,r=e.remoteResult,i=e.context,a=e.variables,o=e.onlyRunForcedResolvers,s=void 0!==o&&o;return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(e){return t?[2,this.resolveDocument(t,r.data,i,a,this.fragmentMatcher,s).then((function(e){return(0,n.pi)((0,n.pi)({},r),{data:e.result})}))]:[2,r]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return(0,o.FS)(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return(0,o.ob)(e)},e.prototype.prepareContext=function(e){var t=this.cache;return(0,n.pi)((0,n.pi)({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e,t,r){return void 0===t&&(t={}),void 0===r&&(r={}),(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(r),t).then((function(e){return(0,n.pi)((0,n.pi)({},t),e.exportedVariables)}))]:[2,(0,n.pi)({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return(0,h.Vn)(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return h.$_}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:(0,o.aL)(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,r,i,a,s){return void 0===r&&(r={}),void 0===i&&(i={}),void 0===a&&(a=function(){return!0}),void 0===s&&(s=!1),(0,n.mG)(this,void 0,void 0,(function(){var u,c,l,f,h,p,d,y,v;return(0,n.Jh)(this,(function(g){return u=(0,o.p$)(e),c=(0,o.kU)(e),l=(0,o.F)(c),f=u.operation,h=f?f.charAt(0).toUpperCase()+f.slice(1):"Query",d=(p=this).cache,y=p.client,v={fragmentMap:l,context:(0,n.pi)((0,n.pi)({},r),{cache:d,client:y}),variables:i,fragmentMatcher:a,defaultOperationType:h,exportedVariables:{},onlyRunForcedResolvers:s},[2,this.resolveSelectionSet(u.selectionSet,t,v).then((function(e){return{result:e,exportedVariables:v.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,r){return(0,n.mG)(this,void 0,void 0,(function(){var a,s,u,c,l,f=this;return(0,n.Jh)(this,(function(h){return a=r.fragmentMap,s=r.context,u=r.variables,c=[t],l=function(e){return(0,n.mG)(f,void 0,void 0,(function(){var l,f;return(0,n.Jh)(this,(function(n){return(0,o.LZ)(e,u)?(0,o.My)(e)?[2,this.resolveField(e,t,r).then((function(t){var r;void 0!==t&&c.push(((r={})[(0,o.u2)(e)]=t,r))}))]:((0,o.Ao)(e)?l=e:(l=a[e.name.value],(0,i.kG)(l,11)),l&&l.typeCondition&&(f=l.typeCondition.name.value,r.fragmentMatcher(t,f,s))?[2,this.resolveSelectionSet(l.selectionSet,t,r).then((function(e){c.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(l)).then((function(){return(0,o.bw)(c)}))]}))}))},e.prototype.resolveField=function(e,t,r){return(0,n.mG)(this,void 0,void 0,(function(){var i,a,s,u,c,l,f,h,d,y=this;return(0,n.Jh)(this,(function(n){return i=r.variables,a=e.name.value,s=(0,o.u2)(e),u=a!==s,c=t[s]||t[a],l=Promise.resolve(c),r.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(f=t.__typename||r.defaultOperationType,(h=this.resolvers&&this.resolvers[f])&&(d=h[u?a:s])&&(l=Promise.resolve(p.ab.withValue(this.cache,d,[t,(0,o.NC)(e,i),r.context,{field:e,fragmentMap:r.fragmentMap}])))),[2,l.then((function(t){return void 0===t&&(t=c),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(r.exportedVariables[e.value.value]=t)}))})),e.selectionSet?null==t?t:Array.isArray(t)?y.resolveSubSelectedArray(e,t,r):e.selectionSet?y.resolveSelectionSet(e.selectionSet,t,r):void 0:t}))]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,r){var n=this;return Promise.all(t.map((function(t){return null===t?null:Array.isArray(t)?n.resolveSubSelectedArray(e,t,r):e.selectionSet?n.resolveSelectionSet(e.selectionSet,t,r):void 0})))},e}(),y=new(o.mr?WeakMap:Map);function v(e,t){var r=e[t];"function"==typeof r&&(e[t]=function(){return y.set(e,(y.get(e)+1)%1e15),r.apply(this,arguments)})}function g(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var m=function(){function e(e){this.cache=e,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.diff=null,this.observableQuery=null,y.has(e)||(y.set(e,0),v(e,"evict"),v(e,"modify"),v(e,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||f.I.loading;return this.variables&&this.networkStatus!==f.I.loading&&!(0,u.D)(this.variables,e.variables)&&(t=f.I.setVariables),(0,u.D)(e.variables,this.variables)||(this.diff=null),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.reset=function(){g(this),this.diff=null,this.dirty=!1},e.prototype.getDiff=function(e){return void 0===e&&(e=this.variables),this.diff&&(0,u.D)(e,this.variables)?this.diff:(this.updateWatch(this.variables=e),this.diff=this.cache.diff({query:this.document,variables:e,returnPartialData:!0,optimistic:!0}))},e.prototype.setDiff=function(e){var t=this,r=this.diff;this.diff=e,this.dirty||(e&&e.result)===(r&&r.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return t.notify()}),0)))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():e.reobserve()})):delete this.oqListener)},e.prototype.notify=function(){var e=this;g(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if((0,f.O)(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.cancel(),delete this.cancel,this.subscriptions.forEach((function(e){return e.unsubscribe()}));var e=this.observableQuery;e&&e.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var r=this.observableQuery;r&&"no-cache"===r.options.fetchPolicy||this.lastWatch&&this.lastWatch.query===this.document&&(0,u.D)(e,this.lastWatch.variables)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch={query:this.document,variables:e,optimistic:!0,callback:function(e){return t.setDiff(e)}}))},e.prototype.shouldWrite=function(e,t){var r=this.lastWrite;return!(r&&r.dmCount===y.get(this.cache)&&(0,u.D)(t,r.variables)&&(0,u.D)(e.data,r.result.data))},e.prototype.markResult=function(e,t,r){var n=this;this.graphQLErrors=(0,o.Of)(e.errors)?e.errors:[],this.reset(),"no-cache"===t.fetchPolicy?this.diff={result:e.data,complete:!0}:!this.stopped&&r&&(b(e,t.errorPolicy)?this.cache.performTransaction((function(r){if(n.shouldWrite(e,t.variables))r.writeQuery({query:n.document,data:e.data,variables:t.variables}),n.lastWrite={result:e,variables:t.variables,dmCount:y.get(n.cache)};else if(n.diff&&n.diff.complete)return void(e.data=n.diff.result);var i=r.diff({query:n.document,variables:t.variables,returnPartialData:!0,optimistic:!0});n.stopped||n.updateWatch(t.variables),n.diff=i,i.complete&&(e.data=i.result)})):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=f.I.ready},e.prototype.markError=function(e){return this.networkStatus=f.I.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function b(e,t){void 0===t&&(t="none");var r="ignore"===t||"all"===t,n=!(0,o.d2)(e);return!n&&r&&e.data&&(n=!0),n}var E=Object.prototype.hasOwnProperty,S=function(){function e(e){var t=e.cache,r=e.link,n=e.queryDeduplication,i=void 0!==n&&n,a=e.onBroadcast,s=e.ssrMode,u=void 0!==s&&s,c=e.clientAwareness,l=void 0===c?{}:c,f=e.localState,h=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(o.mr?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=r,this.queryDeduplication=i,this.clientAwareness=l,this.localState=f||new d({cache:t}),this.ssrMode=u,this.assumeImmutableResults=!!h,(this.onBroadcast=a)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,r){e.stopQueryNoBroadcast(r)})),this.cancelPendingFetches(new i.ej(12))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){var t=e.mutation,r=e.variables,a=e.optimisticResponse,s=e.updateQueries,u=e.refetchQueries,l=void 0===u?[]:u,f=e.awaitRefetchQueries,h=void 0!==f&&f,p=e.update,d=e.errorPolicy,y=void 0===d?"none":d,v=e.fetchPolicy,g=e.context,m=void 0===g?{}:g;return(0,n.mG)(this,void 0,void 0,(function(){var e,u,f;return(0,n.Jh)(this,(function(d){switch(d.label){case 0:return(0,i.kG)(t,13),(0,i.kG)(!v||"no-cache"===v,14),e=this.generateMutationId(),t=this.transform(t).document,r=this.getVariables(t,r),this.transform(t).hasClientExports?[4,this.localState.addExportedVariables(t,r,m)]:[3,2];case 1:r=d.sent(),d.label=2;case 2:return u=this.mutationStore&&(this.mutationStore[e]={mutation:t,variables:r,loading:!0,error:null}),a&&this.markMutationOptimistic(a,{mutationId:e,document:t,variables:r,errorPolicy:y,updateQueries:s,update:p}),this.broadcastQueries(),f=this,[2,new Promise((function(i,d){var g,b;f.getObservableFromLink(t,(0,n.pi)((0,n.pi)({},m),{optimisticResponse:a}),r,!1).subscribe({next:function(n){if((0,o.d2)(n)&&"none"===y)b=new c.c({graphQLErrors:n.errors});else{if(u&&(u.loading=!1,u.error=null),"no-cache"!==v)try{f.markMutationResult({mutationId:e,result:n,document:t,variables:r,errorPolicy:y,updateQueries:s,update:p})}catch(e){return void(b=new c.c({networkError:e}))}g=n}},error:function(t){u&&(u.loading=!1,u.error=t),a&&f.cache.removeOptimistic(e),f.broadcastQueries(),d(new c.c({networkError:t}))},complete:function(){if(b&&u&&(u.loading=!1,u.error=b),a&&f.cache.removeOptimistic(e),f.broadcastQueries(),b)d(b);else{"function"==typeof l&&(l=l(g));var t=[];(0,o.Of)(l)&&l.forEach((function(e){if("string"==typeof e)f.queries.forEach((function(r){var n=r.observableQuery;n&&n.queryName===e&&t.push(n.refetch())}));else{var r={query:e.query,variables:e.variables,fetchPolicy:"network-only"};e.context&&(r.context=e.context),t.push(f.query(r))}})),Promise.all(h?t:[]).then((function(){"ignore"===y&&g&&(0,o.d2)(g)&&delete g.errors,i(g)}),d)}}})}))]}}))}))},e.prototype.markMutationResult=function(e,t){var r=this;if(void 0===t&&(t=this.cache),b(e.result,e.errorPolicy)){var n=[{result:e.result.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}],i=e.updateQueries;i&&this.queries.forEach((function(a,s){var u=a.observableQuery,c=u&&u.queryName;if(c&&E.call(i,c)){var l=i[c],f=r.queries.get(s),h=f.document,p=f.variables,d=t.diff({query:h,variables:p,returnPartialData:!0,optimistic:!1}),y=d.result;if(d.complete&&y){var v=l(y,{mutationResult:e.result,queryName:h&&(0,o.rY)(h)||void 0,queryVariables:p});v&&n.push({result:v,dataId:"ROOT_QUERY",query:h,variables:p})}}})),t.performTransaction((function(t){n.forEach((function(e){return t.write(e)}));var r=e.update;r&&r(t,e.result)}),null)}},e.prototype.markMutationOptimistic=function(e,t){var r=this,i="function"==typeof e?e(t.variables):e;return this.cache.recordOptimisticTransaction((function(e){try{r.markMutationResult((0,n.pi)((0,n.pi)({},t),{result:{data:i}}),e)}catch(e){}}),t.mutationId)},e.prototype.fetchQuery=function(e,t,r){return this.fetchQueryObservable(e,t,r).promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,r){e[r]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var r=this.cache.transformDocument(e),n=(0,o.Fo)(this.cache.transformForLink(r)),i=this.localState.clientQuery(r),a=n&&this.localState.serverQuery(n),s={document:r,hasClientExports:(0,o.mj)(r),hasForcedResolvers:this.localState.shouldForceResolvers(r),clientQuery:i,serverQuery:a,defaultVars:(0,o.O4)((0,o.$H)(r))},u=function(e){e&&!t.has(e)&&t.set(e,s)};u(e),u(r),u(i),u(a)}return t.get(e)},e.prototype.getVariables=function(e,t){return(0,n.pi)((0,n.pi)({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e){void 0===(e=(0,n.pi)((0,n.pi)({},e),{variables:this.getVariables(e.query,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var t=new m(this.cache),r=new l.u({queryManager:this,queryInfo:t,options:e});return this.queries.set(r.queryId,t),t.init({document:e.query,observableQuery:r,variables:e.variables}),r},e.prototype.query=function(e){var t=this;(0,i.kG)(e.query,15),(0,i.kG)("Document"===e.query.kind,16),(0,i.kG)(!e.returnPartialData,17),(0,i.kG)(!e.pollInterval,18);var r=this.generateQueryId();return this.fetchQuery(r,e).finally((function(){return t.stopQuery(r)}))},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(){return this.cancelPendingFetches(new i.ej(19)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=f.I.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset()},e.prototype.resetStore=function(){var e=this;return this.clearStore().then((function(){return e.reFetchObservableQueries()}))},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var r=[];return this.queries.forEach((function(n,i){var a=n.observableQuery;if(a&&a.hasObservers()){var o=a.options.fetchPolicy;a.resetLastResults(),"cache-only"===o||!e&&"standby"===o||r.push(a.refetch()),t.getQuery(i).setDiff(null)}})),this.broadcastQueries(),Promise.all(r)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,r=e.query,n=e.fetchPolicy,i=e.errorPolicy,a=e.variables,s=e.context,u=void 0===s?{}:s;r=this.transform(r).document,a=this.getVariables(r,a);var l=function(e){return t.getObservableFromLink(r,u,e,!1).map((function(a){if("no-cache"!==n&&(b(a,i)&&t.cache.write({query:r,result:a.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries()),(0,o.d2)(a))throw new c.c({graphQLErrors:a.errors});return a}))};if(this.transform(r).hasClientExports){var f=this.localState.addExportedVariables(r,a,u).then(l);return new o.y$((function(e){var t=null;return f.then((function(r){return t=r.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return l(a)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.getQuery(e).stop(),this.queries.delete(e)},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,r,i){var s,u,c=this;void 0===i&&(i=null!==(s=null==t?void 0:t.queryDeduplication)&&void 0!==s?s:this.queryDeduplication);var l=this.transform(e).serverQuery;if(l){var f=this.inFlightLinkObservables,h=this.link,p={query:l,variables:r,operationName:(0,o.rY)(l)||void 0,context:this.prepareContext((0,n.pi)((0,n.pi)({},t),{forceFetch:!i}))};if(t=p.context,i){var d=f.get(l)||new Map;f.set(l,d);var y=JSON.stringify(r);if(!(u=d.get(y))){var v=new o.X_([(0,a.ht)(h,p)]);d.set(y,u=v),v.cleanup((function(){d.delete(y)&&d.size<1&&f.delete(l)}))}}else u=new o.X_([(0,a.ht)(h,p)])}else u=new o.X_([o.y$.of({data:{}})]),t=this.prepareContext(t);var g=this.transform(e).clientQuery;return g&&(u=(0,o.sz)(u,(function(e){return c.localState.runResolvers({document:g,remoteResult:e,context:t,variables:r})}))),u},e.prototype.getResultsFromLink=function(e,t,r){var n=e.lastRequestId;return(0,o.sz)(this.getObservableFromLink(e.document,r.context,r.variables),(function(i){var a=(0,o.Of)(i.errors);if(n>=e.lastRequestId){if(a&&"none"===r.errorPolicy)throw e.markError(new c.c({graphQLErrors:i.errors}));e.markResult(i,r,t),e.markReady()}var s={data:i.data,loading:!1,networkStatus:e.networkStatus||f.I.ready};return a&&"ignore"!==r.errorPolicy&&(s.errors=i.errors),s}),(function(t){var r=(0,c.M)(t)?t:new c.c({networkError:t});throw n>=e.lastRequestId&&e.markError(r),r}))},e.prototype.fetchQueryObservable=function(e,t,r){var n=this;void 0===r&&(r=f.I.loading);var i=this.transform(t.query).document,a=this.getVariables(i,t.variables),s=this.getQuery(e),u=s.networkStatus,c=t.fetchPolicy,l=void 0===c?"cache-first":c,h=t.errorPolicy,p=void 0===h?"none":h,d=t.returnPartialData,y=void 0!==d&&d,v=t.notifyOnNetworkStatusChange,g=void 0!==v&&v,m=t.context,b=void 0===m?{}:m;("cache-first"===l||"cache-and-network"===l||"network-only"===l||"no-cache"===l)&&g&&"number"==typeof u&&u!==r&&(0,f.O)(r)&&("cache-first"!==l&&(l="cache-and-network"),y=!0);var E=Object.assign({},t,{query:i,variables:a,fetchPolicy:l,errorPolicy:p,returnPartialData:y,notifyOnNetworkStatusChange:g,context:b}),S=function(e){return E.variables=e,n.fetchQueryByPolicy(s,E,r)};this.fetchCancelFns.set(e,(function(e){Promise.resolve().then((function(){return C.cancel(e)}))}));var C=new o.X_(this.transform(E.query).hasClientExports?this.localState.addExportedVariables(E.query,E.variables,E.context).then(S):S(E.variables));return C.cleanup((function(){n.fetchCancelFns.delete(e);var r=t.nextFetchPolicy;r&&(t.nextFetchPolicy=void 0,t.fetchPolicy="function"==typeof r?r.call(t,t.fetchPolicy||"cache-first"):r)})),C},e.prototype.fetchQueryByPolicy=function(e,t,r){var i=this,a=t.query,s=t.variables,u=t.fetchPolicy,c=t.errorPolicy,l=t.returnPartialData,h=t.context;e.init({document:a,variables:s,lastRequestId:this.generateRequestId(),networkStatus:r});var p=function(){return e.getDiff(s)},d=function(t,r){void 0===r&&(r=e.networkStatus||f.I.loading);var u=t.result;var c=function(e){return o.y$.of((0,n.pi)({data:e,loading:(0,f.O)(r),networkStatus:r},t.complete?null:{partial:!0}))};return i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:u},context:h,variables:s,onlyRunForcedResolvers:!0}).then((function(e){return c(e.data)})):c(u)},y=function(t){return i.getResultsFromLink(e,t,{variables:s,context:h,fetchPolicy:u,errorPolicy:c})};switch(u){default:case"cache-first":return(v=p()).complete?[d(v,e.markReady())]:l?[d(v),y(!0)]:[y(!0)];case"cache-and-network":var v;return(v=p()).complete||l?[d(v),y(!0)]:[y(!0)];case"cache-only":return[d(p(),e.markReady())];case"network-only":return[y(!0)];case"no-cache":return[y(!1)];case"standby":return[]}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new m(this.cache)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return(0,n.pi)((0,n.pi)({},t),{clientAwareness:this.clientAwareness})},e}();function C(e,t){return(0,o.oA)(e,t,t.variables&&{variables:(0,n.pi)((0,n.pi)({},e.variables),t.variables)})}var w=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=e.uri,n=e.credentials,o=e.headers,u=e.cache,c=e.ssrMode,l=void 0!==c&&c,f=e.ssrForceFetchDelay,h=void 0===f?0:f,p=e.connectToDevTools,y=void 0===p?"object"==typeof window&&!window.__APOLLO_CLIENT__&&!1:p,v=e.queryDeduplication,g=void 0===v||v,m=e.defaultOptions,b=e.assumeImmutableResults,E=void 0!==b&&b,C=e.resolvers,w=e.typeDefs,T=e.fragmentMatcher,A=e.name,I=e.version,k=e.link;if(k||(k=r?new s.uG({uri:r,credentials:n,headers:o}):a.i0.empty()),!u)throw new i.ej(9);this.link=k,this.cache=u,this.disableNetworkFetches=l||h>0,this.queryDeduplication=g,this.defaultOptions=m||{},this.typeDefs=w,h&&setTimeout((function(){return t.disableNetworkFetches=!1}),h),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),y&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),this.version="3.3.11",this.localState=new d({cache:u,client:this,resolvers:C,fragmentMatcher:T}),this.queryManager=new S({cache:this.cache,link:this.link,queryDeduplication:g,ssrMode:l,clientAwareness:{name:A,version:I},localState:this.localState,assumeImmutableResults:E,onBroadcast:y?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=C(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=(0,n.pi)((0,n.pi)({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=C(this.defaultOptions.query,e)),(0,i.kG)("cache-and-network"!==e.fetchPolicy,10),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=(0,n.pi)((0,n.pi)({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=C(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){this.cache.writeQuery(e),this.queryManager.broadcastQueries()},e.prototype.writeFragment=function(e){this.cache.writeFragment(e),this.queryManager.broadcastQueries()},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return(0,a.ht)(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},e}()},6282:(e,t,r)=>{"use strict";r.d(t,{u:()=>c});var n=r(655),i=r(2924),a=r(2152),o=r(5942),s=r(496),u=function(){function e(e,t,r,n){this.observer=e,this.options=t,this.fetch=r,this.shouldFetch=n}return e.prototype.reobserve=function(e,t){e?this.updateOptions(e):this.updatePolling();var r=this.fetch(this.options,t);return this.concast&&this.concast.removeObserver(this.observer,!0),r.addObserver(this.observer),(this.concast=r).promise},e.prototype.updateOptions=function(e){return Object.assign(this.options,(0,s.oA)(e)),this.updatePolling(),this},e.prototype.stop=function(){this.concast&&(this.concast.removeObserver(this.observer),delete this.concast),this.pollingInfo&&(clearTimeout(this.pollingInfo.timeout),this.options.pollInterval=0,this.updatePolling())},e.prototype.updatePolling=function(){var e=this,t=this.pollingInfo,r=this.options.pollInterval;if(r){if((!t||t.interval!==r)&&((0,i.kG)(r,20),!1!==this.shouldFetch)){(t||(this.pollingInfo={})).interval=r;var n=function(){e.pollingInfo&&(e.shouldFetch&&e.shouldFetch()?e.reobserve({fetchPolicy:"network-only",nextFetchPolicy:e.options.fetchPolicy||"cache-first"},o.I.poll).then(a,a):a())},a=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(n,t.interval))};a()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)},e}(),c=function(e){function t(t){var r=t.queryManager,i=t.queryInfo,a=t.options,u=e.call(this,(function(e){return u.onSubscribe(e)}))||this;u.observers=new Set,u.subscriptions=new Set,u.observer={next:function(e){(u.lastError||u.isDifferentFromLastResult(e))&&(u.updateLastResult(e),(0,s.pM)(u.observers,"next",e))},error:function(e){u.updateLastResult((0,n.pi)((0,n.pi)({},u.lastResult),{error:e,errors:e.graphQLErrors,networkStatus:o.I.error,loading:!1})),(0,s.pM)(u.observers,"error",u.lastError=e)}},u.isTornDown=!1,u.options=a,u.queryId=r.generateQueryId();var c=(0,s.$H)(a.query);return u.queryName=c&&c.name&&c.name.value,u.queryManager=r,u.queryInfo=i,u}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise((function(t,r){var n={next:function(r){t(r),e.observers.delete(n),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:r},i=e.subscribe(n)}))},t.prototype.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.lastResult,r=this.queryInfo.networkStatus||t&&t.networkStatus||o.I.ready,i=(0,n.pi)((0,n.pi)({},t),{loading:(0,o.O)(r),networkStatus:r});if(this.isTornDown)return i;var a=this.options.fetchPolicy,s=void 0===a?"cache-first":a;if("no-cache"===s||"network-only"===s)delete i.partial;else if(!i.data||!this.queryManager.transform(this.options.query).hasForcedResolvers){var u=this.queryInfo.getDiff();i.data=u.complete||this.options.returnPartialData?u.result:void 0,u.complete?(i.networkStatus!==o.I.loading||"cache-first"!==s&&"cache-only"!==s||(i.networkStatus=o.I.ready,i.loading=!1),delete i.partial):i.partial=!0}return e&&this.updateLastResult(i),i},t.prototype.isDifferentFromLastResult=function(e){return!(0,a.D)(this.lastResultSnapshot,e)},t.prototype.getLastResult=function(){return this.lastResult},t.prototype.getLastError=function(){return this.lastError},t.prototype.resetLastResults=function(){delete this.lastResult,delete this.lastResultSnapshot,delete this.lastError,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t={pollInterval:0},r=this.options.fetchPolicy;return"no-cache"!==r&&"cache-and-network"!==r&&(t.fetchPolicy="network-only",t.nextFetchPolicy=r||"cache-first"),e&&!(0,a.D)(this.options.variables,e)&&(t.variables=this.options.variables=(0,n.pi)((0,n.pi)({},this.options.variables),e)),this.newReobserver(!1).reobserve(t,o.I.refetch)},t.prototype.fetchMore=function(e){var t=this,r=(0,n.pi)((0,n.pi)({},e.query?e:(0,n.pi)((0,n.pi)((0,n.pi)({},this.options),e),{variables:(0,n.pi)((0,n.pi)({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"}),i=this.queryManager.generateQueryId();return r.notifyOnNetworkStatusChange&&(this.queryInfo.networkStatus=o.I.fetchMore,this.observe()),this.queryManager.fetchQuery(i,r,o.I.fetchMore).then((function(n){var i=n.data,a=e.updateQuery;return a?t.updateQuery((function(e){return a(e,{fetchMoreResult:i,variables:r.variables})})):t.queryManager.cache.writeQuery({query:r.query,variables:r.variables,data:i}),n})).finally((function(){t.queryManager.stopQuery(i),t.reobserve()}))},t.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(r){var n=e.updateQuery;n&&t.updateQuery((function(e,t){var i=t.variables;return n(e,{subscriptionData:r,variables:i})}))},error:function(t){e.onError&&e.onError(t)}});return this.subscriptions.add(r),function(){t.subscriptions.delete(r)&&r.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.setVariables=function(e){if((0,a.D)(this.variables,e))return this.observers.size?this.result():Promise.resolve();if(this.options.variables=e,!this.observers.size)return Promise.resolve();var t=this.options.fetchPolicy,r=void 0===t?"cache-first":t,n={fetchPolicy:r,variables:e};return"cache-first"!==r&&"no-cache"!==r&&"network-only"!==r&&(n.fetchPolicy="cache-and-network",n.nextFetchPolicy=r),this.reobserve(n,o.I.setVariables)},t.prototype.updateQuery=function(e){var t,r=this.queryManager,n=e(r.cache.diff({query:this.options.query,variables:this.variables,previousResult:null===(t=this.lastResult)||void 0===t?void 0:t.data,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});n&&(r.cache.writeQuery({query:this.options.query,data:n,variables:this.variables}),r.broadcastQueries())},t.prototype.startPolling=function(e){this.getReobserver().updateOptions({pollInterval:e})},t.prototype.stopPolling=function(){this.reobserver&&this.reobserver.updateOptions({pollInterval:0})},t.prototype.updateLastResult=function(e){var t=this.lastResult;return this.lastResult=e,this.lastResultSnapshot=this.queryManager.assumeImmutableResults?e:(0,s.Xh)(e),(0,s.Of)(e.errors)||delete this.lastError,t},t.prototype.onSubscribe=function(e){var t=this;if(e===this.observer)return function(){};try{var r=e._subscription._observer;r&&!r.error&&(r.error=l)}catch(e){}var n=!this.observers.size;return this.observers.add(e),this.lastError?e.error&&e.error(this.lastError):this.lastResult&&e.next&&e.next(this.lastResult),n&&this.reobserve().catch((function(e){})),function(){t.observers.delete(e)&&!t.observers.size&&t.tearDownQuery()}},t.prototype.getReobserver=function(){return this.reobserver||(this.reobserver=this.newReobserver(!0))},t.prototype.newReobserver=function(e){var t=this,r=this.queryManager,i=this.queryId;return r.setObservableQuery(this),new u(this.observer,e?this.options:(0,n.pi)({},this.options),(function(e,n){return r.setObservableQuery(t),r.fetchQueryObservable(i,e,n)}),!r.ssrMode&&function(){return!(0,o.O)(t.queryInfo.networkStatus)})},t.prototype.reobserve=function(e,t){return this.isTornDown=!1,this.getReobserver().reobserve(e,t)},t.prototype.observe=function(){this.observer.next(this.getCurrentResult(!1))},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.reobserver&&(this.reobserver.stop(),delete this.reobserver),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t}(s.y$);function l(e){}(0,s.Dy)(c)},1439:(e,t,r)=>{"use strict";r.d(t,{fe:()=>n.f,h4:()=>a.h4,HttpLink:()=>u.uG});var n=r(5765),i=(r(6282),r(5942),r(2191));r.o(i,"HttpLink")&&r.d(t,{HttpLink:function(){return i.HttpLink}});r(1498);var a=r(2634),o=r(5367);r.o(o,"HttpLink")&&r.d(t,{HttpLink:function(){return o.HttpLink}});var s=r(1707);r.o(s,"HttpLink")&&r.d(t,{HttpLink:function(){return s.HttpLink}});var u=r(9950),c=(r(4913),r(496),r(2924)),l=r(2527);(0,c.U6)("log");l.ZP.resetCaches,l.ZP.disableFragmentWarnings,l.ZP.enableExperimentalFragmentVariables,l.ZP.disableExperimentalFragmentVariables},5942:(e,t,r)=>{"use strict";var n;function i(e){return!!e&&e<7}r.d(t,{I:()=>n,O:()=>i}),function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(n||(n={}))},2191:()=>{},1498:(e,t,r)=>{"use strict";r.d(t,{M:()=>a,c:()=>o});var n=r(655),i=r(496);function a(e){return e.hasOwnProperty("graphQLErrors")}var o=function(e){function t(r){var n,a,o=r.graphQLErrors,s=r.networkError,u=r.errorMessage,c=r.extraInfo,l=e.call(this,u)||this;return l.graphQLErrors=o||[],l.networkError=s||null,l.message=u||(n=l,a="",(0,i.Of)(n.graphQLErrors)&&n.graphQLErrors.forEach((function(e){var t=e?e.message:"Error message not found.";a+=t+"\n"})),n.networkError&&(a+=n.networkError.message+"\n"),a=a.replace(/\n$/,"")),l.extraInfo=c,l.__proto__=t.prototype,l}return(0,n.ZT)(t,e),t}(Error)},7222:(e,t,r)=>{"use strict";r.d(t,{i:()=>l});var n=r(655),i=r(2924),a=r(496),o=r(4913);function s(e,t){return t?t(e):a.y$.of()}function u(e){return"function"==typeof e?new l(e):e}function c(e){return e.request.length<=1}!function(e){function t(t,r){var n=e.call(this,t)||this;return n.link=r,n}(0,n.ZT)(t,e)}(Error);var l=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return a.y$.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map(u).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,r,n){var i=u(r),o=u(n||new e(s));return c(i)&&c(o)?new e((function(e){return t(e)?i.request(e)||a.y$.of():o.request(e)||a.y$.of()})):new e((function(e,r){return t(e)?i.request(e,r)||a.y$.of():o.request(e,r)||a.y$.of()}))},e.execute=function(e,t){return e.request((0,o.zi)(t.context,(0,o.DQ)((0,o.Ak)(t))))||a.y$.of()},e.concat=function(t,r){var n=u(t);if(c(n))return n;var i=u(r);return c(i)?new e((function(e){return n.request(e,(function(e){return i.request(e)||a.y$.of()}))||a.y$.of()})):new e((function(e,t){return n.request(e,(function(e){return i.request(e,t)||a.y$.of()}))||a.y$.of()}))},e.prototype.split=function(t,r,n){return this.concat(e.split(t,r,n||new e(s)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw new i.ej(21)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}()},4957:(e,t,r)=>{"use strict";r(7222).i.concat},7325:(e,t,r)=>{"use strict";r(7222).i.empty},2550:(e,t,r)=>{"use strict";r.d(t,{h:()=>n});var n=r(7222).i.execute},4674:(e,t,r)=>{"use strict";r(7222).i.from},1707:(e,t,r)=>{"use strict";r.d(t,{ht:()=>n.h,i0:()=>i.i});r(7325),r(4674),r(4738),r(4957);var n=r(2550),i=r(7222),a=r(9875);r.o(a,"HttpLink")&&r.d(t,{HttpLink:function(){return a.HttpLink}})},4738:(e,t,r)=>{"use strict";r(7222).i.split},9875:()=>{},9950:(e,t,r)=>{"use strict";r.d(t,{uG:()=>T});var n=r(4913),i=Object.prototype.hasOwnProperty;var a=r(2924),o=function(e,t){var r;try{r=JSON.stringify(e)}catch(e){var n=new a.ej(23);throw n.parseError=e,n}return r},s=r(655),u=r(7636),c=r(7420);function l(e){return(0,u.Vn)(e,{leave:f})}var f={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return p(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,r=e.name,n=y("(",p(e.variableDefinitions,", "),")"),i=p(e.directives," "),a=e.selectionSet;return r||i||n||"query"!==t?p([t,p([r,n]),i,a]," "):a},VariableDefinition:function(e){var t=e.variable,r=e.type,n=e.defaultValue,i=e.directives;return t+": "+r+y(" = ",n)+y(" ",p(i," "))},SelectionSet:function(e){return d(e.selections)},Field:function(e){var t=e.alias,r=e.name,n=e.arguments,i=e.directives,a=e.selectionSet,o=y("",t,": ")+r,s=o+y("(",p(n,", "),")");return s.length>80&&(s=o+y("(\n",v(p(n,"\n")),"\n)")),p([s,p(i," "),a]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+y(" ",p(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,r=e.directives,n=e.selectionSet;return p(["...",y("on ",t),p(r," "),n]," ")},FragmentDefinition:function(e){var t=e.name,r=e.typeCondition,n=e.variableDefinitions,i=e.directives,a=e.selectionSet;return"fragment ".concat(t).concat(y("(",p(n,", "),")")," ")+"on ".concat(r," ").concat(y("",p(i," ")," "))+a},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var r=e.value;return e.block?(0,c.LZ)(r,"description"===t?"":" "):JSON.stringify(r)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+p(e.values,", ")+"]"},ObjectValue:function(e){return"{"+p(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+y("(",p(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:h((function(e){var t=e.directives,r=e.operationTypes;return p(["schema",p(t," "),d(r)]," ")})),OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:h((function(e){return p(["scalar",e.name,p(e.directives," ")]," ")})),ObjectTypeDefinition:h((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["type",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")})),FieldDefinition:h((function(e){var t=e.name,r=e.arguments,n=e.type,i=e.directives;return t+(m(r)?y("(\n",v(p(r,"\n")),"\n)"):y("(",p(r,", "),")"))+": "+n+y(" ",p(i," "))})),InputValueDefinition:h((function(e){var t=e.name,r=e.type,n=e.defaultValue,i=e.directives;return p([t+": "+r,y("= ",n),p(i," ")]," ")})),InterfaceTypeDefinition:h((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["interface",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")})),UnionTypeDefinition:h((function(e){var t=e.name,r=e.directives,n=e.types;return p(["union",t,p(r," "),n&&0!==n.length?"= "+p(n," | "):""]," ")})),EnumTypeDefinition:h((function(e){var t=e.name,r=e.directives,n=e.values;return p(["enum",t,p(r," "),d(n)]," ")})),EnumValueDefinition:h((function(e){return p([e.name,p(e.directives," ")]," ")})),InputObjectTypeDefinition:h((function(e){var t=e.name,r=e.directives,n=e.fields;return p(["input",t,p(r," "),d(n)]," ")})),DirectiveDefinition:h((function(e){var t=e.name,r=e.arguments,n=e.repeatable,i=e.locations;return"directive @"+t+(m(r)?y("(\n",v(p(r,"\n")),"\n)"):y("(",p(r,", "),")"))+(n?" repeatable":"")+" on "+p(i," | ")})),SchemaExtension:function(e){var t=e.directives,r=e.operationTypes;return p(["extend schema",p(t," "),d(r)]," ")},ScalarTypeExtension:function(e){return p(["extend scalar",e.name,p(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["extend type",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["extend interface",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")},UnionTypeExtension:function(e){var t=e.name,r=e.directives,n=e.types;return p(["extend union",t,p(r," "),n&&0!==n.length?"= "+p(n," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,r=e.directives,n=e.values;return p(["extend enum",t,p(r," "),d(n)]," ")},InputObjectTypeExtension:function(e){var t=e.name,r=e.directives,n=e.fields;return p(["extend input",t,p(r," "),d(n)]," ")}};function h(e){return function(t){return p([t.description,e(t)],"\n")}}function p(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter((function(e){return e})).join(r))&&void 0!==t?t:""}function d(e){return y("{\n",v(p(e,"\n")),"\n}")}function y(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return null!=t&&""!==t?e+t+r:""}function v(e){return y(" ",e.replace(/\n/g,"\n "))}function g(e){return-1!==e.indexOf("\n")}function m(e){return null!=e&&e.some(g)}var b={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},E=r(285),S=r(1707),C=r(496);var w=function(e){void 0===e&&(e={});var t=e.uri,r=void 0===t?"/graphql":t,u=e.fetch,c=e.includeExtensions,f=e.useGETForQueries,h=e.includeUnusedVariables,p=void 0!==h&&h,d=(0,s._T)(e,["uri","fetch","includeExtensions","useGETForQueries","includeUnusedVariables"]);!function(e){if(!e&&"undefined"==typeof fetch)throw new a.ej(22)}(u),u||(u=fetch);var y={http:{includeExtensions:c},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new S.i0((function(e){var t=function(e,t){return e.getContext().uri||("function"==typeof t?t(e):t||"/graphql")}(e,r),a=e.getContext(),c={};if(a.clientAwareness){var h=a.clientAwareness,d=h.name,v=h.version;d&&(c["apollographql-client-name"]=d),v&&(c["apollographql-client-version"]=v)}var g,m=(0,s.pi)((0,s.pi)({},c),a.headers),S={http:a.http,options:a.fetchOptions,credentials:a.credentials,headers:m},w=function(e,t){for(var r=[],n=2;n=300&&(0,n.PW)(e,t,"Response not successful: Received status code "+e.status),Array.isArray(t)||i.call(t,"data")||i.call(t,"errors")||(0,n.PW)(e,t,"Server response was missing for query '"+(Array.isArray(a)?a.map((function(e){return e.operationName})):a.operationName)+"'."),t}))})).then((function(e){return r.next(e),r.complete(),e})).catch((function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&r.next(e.result),r.error(e))})),function(){g&&g.abort()}}))}))},T=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,w(t).request)||this;return r.options=t,r}return(0,s.ZT)(t,e),t}(S.i0)},4913:(e,t,r)=>{"use strict";r.d(t,{zi:()=>c,Qc:()=>i,PW:()=>o,DQ:()=>l,Ak:()=>s});var n=r(496);function i(e){return new n.y$((function(t){t.error(e)}))}var a=r(2924);var o=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n};function s(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r{"use strict";r.d(t,{X_:()=>oe,w0:()=>Y,y$:()=>J(),Gw:()=>U,NC:()=>E,sz:()=>ne,aL:()=>M,mr:()=>ce,Xh:()=>$,oA:()=>le,F:()=>l,Dy:()=>ie,O4:()=>O,kU:()=>_,hi:()=>f,Yk:()=>c,p$:()=>N,$H:()=>I,rY:()=>k,iW:()=>B,PT:()=>b,qw:()=>C,d2:()=>ue,mj:()=>s,FS:()=>o,My:()=>w,Ao:()=>T,Of:()=>se,hh:()=>y,pM:()=>re,kQ:()=>d,Jv:()=>te,Ee:()=>H,bw:()=>G,ob:()=>q,Fo:()=>V,u2:()=>S,LZ:()=>a,vf:()=>g});var n=r(7636),i=r(2924);function a(e,t){var r=e.directives;return!r||!r.length||function(e){var t=[];e&&e.length&&e.forEach((function(e){if(function(e){var t=e.name.value;return"skip"===t||"include"===t}(e)){var r=e.arguments;e.name.value;(0,i.kG)(r&&1===r.length,39);var n=r[0];(0,i.kG)(n.name&&"if"===n.name.value,40);var a=n.value;(0,i.kG)(a&&("Variable"===a.kind||"BooleanValue"===a.kind),41),t.push({directive:e,ifArgument:n})}}));return t}(r).every((function(e){var r=e.directive,n=e.ifArgument,a=!1;return"Variable"===n.value.kind?(a=t&&t[n.value.name.value],(0,i.kG)(void 0!==a,38)):a=n.value.value,"skip"===r.name.value?!a:a}))}function o(e,t){return function(e){var t=[];return(0,n.Vn)(e,{Directive:function(e){t.push(e.name.value)}}),t}(t).some((function(t){return e.indexOf(t)>-1}))}function s(e){return e&&o(["client"],e)&&o(["export"],e)}var u=r(655);function c(e,t){var r=t,n=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw new i.ej(42);"FragmentDefinition"===e.kind&&n.push(e)})),void 0===r&&((0,i.kG)(1===n.length,43),r=n[0].name.value),(0,u.pi)((0,u.pi)({},e),{definitions:(0,u.pr)([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions)})}function l(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function f(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var r=t&&t[e.name.value];return(0,i.kG)(r,44),r;default:return null}}var h=r(5035),p=r.n(h);function d(e){return{__ref:String(e)}}function y(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function v(e,t,r,n){if(function(e){return"IntValue"===e.kind}(r)||function(e){return"FloatValue"===e.kind}(r))e[t.value]=Number(r.value);else if(function(e){return"BooleanValue"===e.kind}(r)||function(e){return"StringValue"===e.kind}(r))e[t.value]=r.value;else if(function(e){return"ObjectValue"===e.kind}(r)){var a={};r.fields.map((function(e){return v(a,e.name,e.value,n)})),e[t.value]=a}else if(function(e){return"Variable"===e.kind}(r)){var o=(n||{})[r.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(r))e[t.value]=r.values.map((function(e){var r={};return v(r,t,e,n),r[t.value]}));else if(function(e){return"EnumValue"===e.kind}(r))e[t.value]=r.value;else{if(!function(e){return"NullValue"===e.kind}(r))throw new i.ej(53);e[t.value]=null}}function g(e,t){var r=null;e.directives&&(r={},e.directives.forEach((function(e){r[e.name.value]={},e.arguments&&e.arguments.forEach((function(n){var i=n.name,a=n.value;return v(r[e.name.value],i,a,t)}))})));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach((function(e){var r=e.name,i=e.value;return v(n,r,i,t)}))),b(e.name.value,n,r)}var m=["connection","include","skip","client","rest","export"];function b(e,t,r){if(t&&r&&r.connection&&r.connection.key){if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach((function(e){i[e]=t[e]})),r.connection.key+"("+JSON.stringify(i)+")"}return r.connection.key}var a=e;if(t){var o=p()(t);a+="("+o+")"}return r&&Object.keys(r).forEach((function(e){-1===m.indexOf(e)&&(r[e]&&Object.keys(r[e]).length?a+="@"+e+"("+JSON.stringify(r[e])+")":a+="@"+e)})),a}function E(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach((function(e){var n=e.name,i=e.value;return v(r,n,i,t)})),r}return null}function S(e){return e.alias?e.alias.value:e.name.value}function C(e,t,r){if("string"==typeof e.__typename)return e.__typename;for(var n=0,i=t.selections;n1)for(var n=new Y,i=1;i0}function ue(e){return e.errors&&e.errors.length>0||!1}ie(oe);var ce="function"==typeof WeakMap&&!("object"==typeof navigator&&"ReactNative"===navigator.product);function le(){for(var e=[],t=0;t{"use strict";r.d(t,{D:()=>u});var n=Object.prototype,i=n.toString,a=n.hasOwnProperty,o=Function.prototype.toString,s=new Map;function u(e,t){try{return c(e,t)}finally{s.clear()}}function c(e,t){if(e===t)return!0;var r,n,s,u=i.call(e);if(u!==i.call(t))return!1;switch(u){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(p(e,t))return!0;var f=l(e),d=l(t),y=f.length;if(y!==d.length)return!1;for(var v=0;v=0&&r.indexOf(n,s)===s))}return!1}function l(e){return Object.keys(e).filter(f,e)}function f(e){return void 0!==this[e]}var h="{ [native code] }";function p(e,t){var r=s.get(e);if(r){if(r.has(t))return!0}else s.set(e,r=new Set);return r.add(t),!1}},9742:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=u(e),o=a[0],s=a[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,s)),l=0,f=s>0?o-4:o;for(r=0;r>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,u=n-i;su?u:s+o));1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,s=a.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,a,o=[],s=t;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2240:(e,t,r)=>{"use strict";var n=r(1518);function i(e,t){return void 0===t&&(t="utf8"),Buffer.isBuffer(e)?o(e.toString("base64")):o(Buffer.from(e,t).toString("base64"))}function a(e){return e=e.toString(),n.default(e).replace(/\-/g,"+").replace(/_/g,"/")}function o(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var s=i;s.encode=i,s.decode=function(e,t){return void 0===t&&(t="utf8"),Buffer.from(a(e),"base64").toString(t)},s.toBase64=a,s.fromBase64=o,s.toBuffer=function(e){return Buffer.from(a(e),"base64")},t.default=s},1518:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.length,r=t%4;if(!r)return e;var n=t,i=4-r,a=t+i,o=Buffer.alloc(a);for(o.write(e);i--;)o.write("=",n++);return o.toString()}},5772:(e,t,r)=>{e.exports=r(2240).default,e.exports.default=e.exports},8764:(e,t,r)=>{"use strict";var n=r(9742),i=r(645),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null; /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */t.lW=u,t.h2=50;var o=2147483647;function s(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|y(e,t),n=s(r),i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(K(e,Uint8Array)){var t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);var i=function(e){if(u.isBuffer(e)){var t=0|d(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||M(e.length)?s(0):h(e);if("Buffer"===e.type&&Array.isArray(e.data))return h(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),s(e<0?0:0|d(e))}function h(e){for(var t=e.length<0?0:0|d(e.length),r=s(t),n=0;n=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return j(e).length;default:if(i)return n?-1:U(e).length;t=(""+t).toLowerCase(),i=!0}}function v(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return N(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return _(this,t,r);case"latin1":case"binary":return B(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),M(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){var a,o=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var l=-1;for(a=r;as&&(r=s-u),a=r;a>=0;a--){for(var f=!0,h=0;hi&&(n=i):n=i;var a=t.length;n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function I(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&c)<<6|63&a)>127&&(l=u);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(u=(15&c)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(u=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=f}return function(e){var t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);var r="",n=0;for(;nn.length?u.from(a).copy(n,i):Uint8Array.prototype.set.call(n,a,i);else{if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tr&&(e+=" ... "),""},a&&(u.prototype[a]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(n,i),l=e.slice(t,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return E(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":case"latin1":case"binary":return C(this,e,t,r);case"base64":return w(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function _(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function x(e,t,r,n,i,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function P(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(e,t,r,n,a){return t=+t,r>>>=0,a||P(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function D(e,t,r,n,a){return t=+t,r>>>=0,a||P(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e],i=1,a=0;++a>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||R(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||R(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return e>>>=0,t||R(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||R(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||R(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||R(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||x(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,n)||x(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function j(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function M(e){return e!=e}var q=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},2702:function(e,t,r){ /*! * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) * @license Licensed under MIT license * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE * @version v4.2.8+1e68dce6 */ e.exports=function(){"use strict";function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function t(e){return"function"==typeof e}var n=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,a=void 0,o=void 0,s=function(e,t){E[i]=e,E[i+1]=t,2===(i+=2)&&(o?o(S):w())};function u(e){o=e}function c(e){s=e}var l="undefined"!=typeof window?window:void 0,f=l||{},h=f.MutationObserver||f.WebKitMutationObserver,p="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function y(){return function(){return process.nextTick(S)}}function v(){return void 0!==a?function(){a(S)}:b()}function g(){var e=0,t=new h(S),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function m(){var e=new MessageChannel;return e.port1.onmessage=S,function(){return e.port2.postMessage(0)}}function b(){var e=setTimeout;return function(){return e(S,1)}}var E=new Array(1e3);function S(){for(var e=0;e{"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r,n="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(r=t.cmp,function(e){return function(t,n){var i={key:t,value:e[t]},a={key:n,value:e[n]};return r(i,a)}}),a=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var r,o;if(Array.isArray(t)){for(o="[",r=0;r{"use strict";r.d(t,{ZP:()=>ee});var n=r(655);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}"function"==typeof Symbol&&null!=Symbol.iterator&&Symbol.iterator,"function"==typeof Symbol&&null!=Symbol.asyncIterator&&Symbol.asyncIterator;var a="function"==typeof Symbol&&null!=Symbol.toStringTag?Symbol.toStringTag:"@@toStringTag";function o(e,t){for(var r,n=/\r\n|[\n\r]/g,i=1,a=t+1;(r=n.exec(e.body))&&r.index120){for(var d=Math.floor(u/80),y=u%80,v=[],g=0;g",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"}),A=r(6589);function I(e,t){if(!Boolean(e))throw new Error(t)}const k=function(e,t){return e instanceof t};function _(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||I(0,"Body must be a string. Received: ".concat((0,A.Z)(e),".")),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||I(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||I(0,"column in locationOffset is 1-indexed and must be positive.")}var t,r,n;return t=e,(r=[{key:a,get:function(){return"Source"}}])&&_(t.prototype,r),n&&_(t,n),e}();var N=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"}),O=r(7420),R=function(){function e(e){var t=new w.WU(T.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},t.lookahead=function(){var e=this.token;if(e.kind!==T.EOF)do{var t;e=null!==(t=e.next)&&void 0!==t?t:e.next=P(this,e)}while(e.kind===T.COMMENT);return e},e}();function x(e){return isNaN(e)?T.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function P(e,t){for(var r=e.source,n=r.body,i=n.length,a=t.end;a31||9===a));return new w.WU(T.COMMENT,t,s,r,n,i,o.slice(t+1,s))}function L(e,t,r,n,i,a){var o=e.body,s=r,u=t,c=!1;if(45===s&&(s=o.charCodeAt(++u)),48===s){if((s=o.charCodeAt(++u))>=48&&s<=57)throw S(e,u,"Invalid number, unexpected digit after 0: ".concat(x(s),"."))}else u=U(e,u,s),s=o.charCodeAt(u);if(46===s&&(c=!0,s=o.charCodeAt(++u),u=U(e,u,s),s=o.charCodeAt(u)),69!==s&&101!==s||(c=!0,43!==(s=o.charCodeAt(++u))&&45!==s||(s=o.charCodeAt(++u)),u=U(e,u,s),s=o.charCodeAt(u)),46===s||function(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(s))throw S(e,u,"Invalid number, expected digit but got: ".concat(x(s),"."));return new w.WU(c?T.FLOAT:T.INT,t,u,n,i,a,o.slice(t,u))}function U(e,t,r){var n=e.body,i=t,a=r;if(a>=48&&a<=57){do{a=n.charCodeAt(++i)}while(a>=48&&a<=57);return i}throw S(e,i,"Invalid number, expected digit but got: ".concat(x(a),"."))}function j(e,t,r,n,i){for(var a,o,s,u,c=e.body,l=t+1,f=l,h=0,p="";l=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function M(e,t,r,n,i){for(var a=e.body,o=a.length,s=t+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new w.WU(T.NAME,t,s,r,n,i,a.slice(t,s))}var q=function(){function e(e,t){var r=function(e){return k(e,B)}(e)?e:new B(e);this._lexer=new R(r),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(T.NAME);return{kind:C.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:C.DOCUMENT,definitions:this.many(T.SOF,this.parseDefinition,T.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(T.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(T.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(T.BRACE_L))return{kind:C.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,r=this.parseOperationType();return this.peek(T.NAME)&&(t=this.parseName()),{kind:C.OPERATION_DEFINITION,operation:r,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(T.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(T.PAREN_L,this.parseVariableDefinition,T.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:C.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(T.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(T.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(T.DOLLAR),{kind:C.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:C.SELECTION_SET,selections:this.many(T.BRACE_L,this.parseSelection,T.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(T.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,r=this._lexer.token,n=this.parseName();return this.expectOptionalToken(T.COLON)?(e=n,t=this.parseName()):t=n,{kind:C.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(T.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(r)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(T.PAREN_L,t,T.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(T.COLON),{kind:C.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:C.ARGUMENT,name:this.parseName(),value:(this.expectToken(T.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(T.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(T.NAME)?{kind:C.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:C.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e,t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)?{kind:C.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:C.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case T.BRACKET_L:return this.parseList(e);case T.BRACE_L:return this.parseObject(e);case T.INT:return this._lexer.advance(),{kind:C.INT,value:t.value,loc:this.loc(t)};case T.FLOAT:return this._lexer.advance(),{kind:C.FLOAT,value:t.value,loc:this.loc(t)};case T.STRING:case T.BLOCK_STRING:return this.parseStringLiteral();case T.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:C.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:C.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:C.NULL,loc:this.loc(t)};default:return{kind:C.ENUM,value:t.value,loc:this.loc(t)}}case T.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:C.STRING,value:e.value,block:e.kind===T.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,r=this._lexer.token;return{kind:C.LIST,values:this.any(T.BRACKET_L,(function(){return t.parseValueLiteral(e)}),T.BRACKET_R),loc:this.loc(r)}},t.parseObject=function(e){var t=this,r=this._lexer.token;return{kind:C.OBJECT,fields:this.any(T.BRACE_L,(function(){return t.parseObjectField(e)}),T.BRACE_R),loc:this.loc(r)}},t.parseObjectField=function(e){var t=this._lexer.token,r=this.parseName();return this.expectToken(T.COLON),{kind:C.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(T.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(T.AT),{kind:C.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(T.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(T.BRACKET_R),e={kind:C.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(T.BANG)?{kind:C.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:C.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===T.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(T.STRING)||this.peek(T.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var r=this.parseDirectives(!0),n=this.many(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);return{kind:C.SCHEMA_DEFINITION,description:t,directives:r,operationTypes:n,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(T.COLON);var r=this.parseNamedType();return{kind:C.OPERATION_TYPE_DEFINITION,operation:t,type:r,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var r=this.parseName(),n=this.parseDirectives(!0);return{kind:C.SCALAR_TYPE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:C.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:a,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if(!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)){var t=[];this.expectOptionalToken(T.AMP);do{t.push(this.parseNamedType())}while(this.expectOptionalToken(T.AMP)||this.peek(T.NAME));return t}return this.delimitedMany(T.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(T.BRACE_L)&&this._lexer.lookahead().kind===T.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(T.BRACE_L,this.parseFieldDefinition,T.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(T.COLON);var i=this.parseTypeReference(),a=this.parseDirectives(!0);return{kind:C.FIELD_DEFINITION,description:t,name:r,arguments:n,type:i,directives:a,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(T.PAREN_L,this.parseInputValueDef,T.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName();this.expectToken(T.COLON);var n,i=this.parseTypeReference();this.expectOptionalToken(T.EQUALS)&&(n=this.parseValueLiteral(!0));var a=this.parseDirectives(!0);return{kind:C.INPUT_VALUE_DEFINITION,description:t,name:r,type:i,defaultValue:n,directives:a,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:C.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:a,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:C.UNION_TYPE_DEFINITION,description:t,name:r,directives:n,types:i,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(T.EQUALS)?this.delimitedMany(T.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:C.ENUM_TYPE_DEFINITION,description:t,name:r,directives:n,values:i,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(T.BRACE_L,this.parseEnumValueDefinition,T.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseDirectives(!0);return{kind:C.ENUM_VALUE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:C.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(T.BRACE_L,this.parseInputValueDef,T.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===T.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),r=this.optionalMany(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return{kind:C.SCHEMA_EXTENSION,directives:t,operationTypes:r,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),r=this.parseDirectives(!0);if(0===r.length)throw this.unexpected();return{kind:C.SCALAR_TYPE_EXTENSION,name:t,directives:r,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:C.OBJECT_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:C.INTERFACE_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseUnionMemberTypes();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.UNION_TYPE_EXTENSION,name:t,directives:r,types:n,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseEnumValuesDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.ENUM_TYPE_EXTENSION,name:t,directives:r,values:n,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseInputFieldsDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:r,fields:n,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(T.AT);var r=this.parseName(),n=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var a=this.parseDirectiveLocations();return{kind:C.DIRECTIVE_DEFINITION,description:t,name:r,arguments:n,repeatable:i,locations:a,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(T.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==N[t.value])return t;throw this.unexpected(e)},t.loc=function(e){var t;if(!0!==(null===(t=this._options)||void 0===t?void 0:t.noLocation))return new w.Ye(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw S(this._lexer.source,t.start,"Expected ".concat(H(e),", found ").concat(z(t),"."))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==T.NAME||t.value!==e)throw S(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(z(t),"."));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===T.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return S(this._lexer.source,t.start,"Unexpected ".concat(z(t),"."))},t.any=function(e,t,r){this.expectToken(e);for(var n=[];!this.expectOptionalToken(r);)n.push(t.call(this));return n},t.optionalMany=function(e,t,r){if(this.expectOptionalToken(e)){var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n}return[]},t.many=function(e,t,r){this.expectToken(e);var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n},t.delimitedMany=function(e,t){this.expectOptionalToken(e);var r=[];do{r.push(t.call(this))}while(this.expectOptionalToken(e));return r},e}();function z(e){var t=e.value;return H(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function H(e){return function(e){return e===T.BANG||e===T.DOLLAR||e===T.AMP||e===T.PAREN_L||e===T.PAREN_R||e===T.SPREAD||e===T.COLON||e===T.EQUALS||e===T.AT||e===T.BRACKET_L||e===T.BRACKET_R||e===T.BRACE_L||e===T.PIPE||e===T.BRACE_R}(e)?'"'.concat(e,'"'):e}var G=new Map,Q=new Map,W=!0,Y=!1;function Z(e){return e.replace(/[\s,]+/g," ").trim()}function J(e){var t=new Set,r=[];return e.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var n=e.name.value,i=Z((o=e.loc).source.body.substring(o.start,o.end)),a=Q.get(n);a&&!a.has(i)?W&&console.warn("Warning: fragment with name "+n+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):a||Q.set(n,a=new Set),a.add(i),t.has(i)||(t.add(i),r.push(e))}else r.push(e);var o})),(0,n.pi)((0,n.pi)({},e),{definitions:r})}function X(e){var t=Z(e);if(!G.has(t)){var r=function(e,t){return new q(e,t).parseDocument()}(e,{experimentalFragmentVariables:Y});if(!r||"Document"!==r.kind)throw new Error("Not a valid GraphQL document.");G.set(t,function(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(r){var n=e[r];n&&"object"==typeof n&&t.add(n)}))}));var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}(J(r)))}return G.get(t)}function $(e){for(var t=[],r=1;r{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetElectionLogEntries"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"electionUniqueId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"types"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"election"},arguments:[{kind:"Argument",name:{kind:"Name",value:"uniqueId"},value:{kind:"Variable",name:{kind:"Name",value:"electionUniqueId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"logEntries"},arguments:[{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"types"},value:{kind:"Variable",name:{kind:"Name",value:"types"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"messageId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:242}};t.loc.source={body:"query GetElectionLogEntries(\n $electionUniqueId: String!\n $after: String\n $types: [String!]\n) {\n election(uniqueId: $electionUniqueId) {\n logEntries(after: $after, types: $types) {\n id\n messageId\n signedData\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"GetElectionLogEntries")},5073:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetLogEntry"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"electionUniqueId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"contentHash"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"logEntry"},arguments:[{kind:"Argument",name:{kind:"Name",value:"electionUniqueId"},value:{kind:"Variable",name:{kind:"Name",value:"electionUniqueId"}}},{kind:"Argument",name:{kind:"Name",value:"contentHash"},value:{kind:"Variable",name:{kind:"Name",value:"contentHash"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"messageId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"contentHash"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:199}};t.loc.source={body:"query GetLogEntry($electionUniqueId: String!, $contentHash: String!) {\n logEntry(electionUniqueId: $electionUniqueId, contentHash: $contentHash) {\n messageId\n signedData\n contentHash\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"GetLogEntry")},5053:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetPendingMessageByMessageId"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pendingMessage"},arguments:[{kind:"Argument",name:{kind:"Name",value:"messageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:117}};t.loc.source={body:"query GetPendingMessageByMessageId($messageId: String!) {\n pendingMessage(messageId: $messageId) {\n status\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"GetPendingMessageByMessageId")},9120:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProcessKeyCeremonyStep"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"signedData"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"processKeyCeremonyStep"},arguments:[{kind:"Argument",name:{kind:"Name",value:"messageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}},{kind:"Argument",name:{kind:"Name",value:"signedData"},value:{kind:"Variable",name:{kind:"Name",value:"signedData"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pendingMessage"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"error"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:212}};t.loc.source={body:"mutation ProcessKeyCeremonyStep($messageId: String!, $signedData: String!) {\n processKeyCeremonyStep(messageId: $messageId, signedData: $signedData) {\n pendingMessage {\n signedData\n }\n error\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"ProcessKeyCeremonyStep")},1798:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProcessTallyStep"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"signedData"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"processTallyStep"},arguments:[{kind:"Argument",name:{kind:"Name",value:"messageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}},{kind:"Argument",name:{kind:"Name",value:"signedData"},value:{kind:"Variable",name:{kind:"Name",value:"signedData"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pendingMessage"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"error"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:200}};t.loc.source={body:"mutation ProcessTallyStep($messageId: String!, $signedData: String!) {\n processTallyStep(messageId: $messageId, signedData: $signedData) {\n pendingMessage {\n signedData\n }\n error\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"ProcessTallyStep")},972:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.prototype.toJSON;"function"==typeof t||(0,n.default)(0),e.prototype.inspect=t,i.default&&(e.prototype[i.default]=t)};var n=a(r(7706)),i=a(r(8554));function a(e){return e&&e.__esModule?e:{default:e}}},8002:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return o(e,[])};var n,i=(n=r(8554))&&n.__esModule?n:{default:n};function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){switch(a(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),n=function(e){var t=e[String(i.default)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==n){var a=n.call(e);if(a!==e)return"string"==typeof a?a:o(a,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var r=Math.min(10,e.length),n=e.length-r,i=[],a=0;a1&&i.push("... ".concat(n," more items"));return"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);if(0===r.length)return"{}";if(t.length>2)return"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]";return"{ "+r.map((function(r){return r+": "+o(e[r],t)})).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}},6589:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(7986);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e){return o(e,[])}function o(e,t){switch(i(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),i=function(e){var t=e[String(n.Z)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==i){var a=i.call(e);if(a!==e)return"string"==typeof a?a:o(a,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var r=Math.min(10,e.length),n=e.length-r,i=[],a=0;a1&&i.push("... ".concat(n," more items"));return"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);if(0===r.length)return"{}";if(t.length>2)return"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]";return"{ "+r.map((function(r){return r+": "+o(e[r],t)})).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}},7706:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}},8554:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;t.default=r},7986:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0},1807:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNode=function(e){return null!=e&&"string"==typeof e.kind},t.Token=t.Location=void 0;var n,i=(n=r(972))&&n.__esModule?n:{default:n};var a=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();t.Location=a,(0,i.default)(a);var o=function(){function e(e,t,r,n,i,a,o){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=o,this.prev=a,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();t.Token=o,(0,i.default)(o)},3059:(e,t,r)=>{"use strict";r.d(t,{Ye:()=>a,WU:()=>o,UG:()=>s});var n=r(7986);function i(e){var t=e.prototype.toJSON;"function"==typeof t||function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}(0),e.prototype.inspect=t,n.Z&&(e.prototype[n.Z]=t)}var a=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();i(a);var o=function(){function e(e,t,r,n,i,a,o){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=o,this.prev=a,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();function s(e){return null!=e&&"string"==typeof e.kind}i(o)},7420:(e,t,r)=>{"use strict";function n(e){var t=e.split(/\r\n|[\n\r]/g),r=function(e){for(var t,r=!0,n=!0,i=0,a=null,o=0;oa&&i(t[o-1]);)--o;return t.slice(a,o).join("\n")}function i(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=-1===e.indexOf("\n"),i=" "===e[0]||"\t"===e[0],a='"'===e[e.length-1],o="\\"===e[e.length-1],s=!n||a||o||r,u="";return!s||n&&i||(u+="\n"+t),u+=t?e.replace(/\n/g,"\n"+t):e,s&&(u+="\n"),'"""'+u.replace(/"""/g,'\\"""')+'"""'}r.d(t,{W7:()=>n,LZ:()=>a})},285:(e,t,r)=>{"use strict";t.Vn=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=void 0,c=Array.isArray(e),l=[e],f=-1,h=[],p=void 0,d=void 0,y=void 0,v=[],g=[],m=e;do{var b=++f===l.length,E=b&&0!==h.length;if(b){if(d=0===g.length?void 0:v[v.length-1],p=y,y=g.pop(),E){if(c)p=p.slice();else{for(var S={},C=0,w=Object.keys(p);C{"use strict";r.d(t,{$_:()=>o,Vn:()=>s});var n=r(6589),i=r(3059),a={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},o=Object.freeze({});function s(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a,s=void 0,c=Array.isArray(e),l=[e],f=-1,h=[],p=void 0,d=void 0,y=void 0,v=[],g=[],m=e;do{var b=++f===l.length,E=b&&0!==h.length;if(b){if(d=0===g.length?void 0:v[v.length-1],p=y,y=g.pop(),E){if(c)p=p.slice();else{for(var S={},C=0,w=Object.keys(p);C{ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<>1,l=-7,f=r?i-1:0,h=r?-1:1,p=e[t+f];for(f+=h,a=p&(1<<-l)-1,p>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=h,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=256*o+e[t+f],f+=h,l-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,u,c=8*a-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=l?(s=0,o=l):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;e[r+p]=255&o,p+=d,o/=256,c-=8);e[r+p-d]|=128*y}},8552:(e,t,r)=>{var n=r(852)(r(5639),"DataView");e.exports=n},1989:(e,t,r)=>{var n=r(1789),i=r(401),a=r(7667),o=r(1327),s=r(1866);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t{var n=r(3118),i=r(9435);function a(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}a.prototype=n(i.prototype),a.prototype.constructor=a,e.exports=a},8407:(e,t,r)=>{var n=r(7040),i=r(4125),a=r(2117),o=r(7518),s=r(4705);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t{var n=r(3118),i=r(9435);function a(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}a.prototype=n(i.prototype),a.prototype.constructor=a,e.exports=a},7071:(e,t,r)=>{var n=r(852)(r(5639),"Map");e.exports=n},3369:(e,t,r)=>{var n=r(4785),i=r(1285),a=r(6e3),o=r(9916),s=r(5265);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t{var n=r(852)(r(5639),"Promise");e.exports=n},8525:(e,t,r)=>{var n=r(852)(r(5639),"Set");e.exports=n},8668:(e,t,r)=>{var n=r(3369),i=r(619),a=r(2385);function o(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t{var n=r(8407),i=r(7465),a=r(3779),o=r(7599),s=r(4758),u=r(4309);function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=i,c.prototype.delete=a,c.prototype.get=o,c.prototype.has=s,c.prototype.set=u,e.exports=c},2705:(e,t,r)=>{var n=r(5639).Symbol;e.exports=n},1149:(e,t,r)=>{var n=r(5639).Uint8Array;e.exports=n},577:(e,t,r)=>{var n=r(852)(r(5639),"WeakMap");e.exports=n},6874:e=>{e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},7412:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=0,a=[];++r{var n=r(2118);e.exports=function(e,t){return!!(null==e?0:e.length)&&n(e,t,0)>-1}},1196:e=>{e.exports=function(e,t,r){for(var n=-1,i=null==e?0:e.length;++n{var n=r(2545),i=r(5694),a=r(1469),o=r(4144),s=r(5776),u=r(6719),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=a(e),l=!r&&i(e),f=!r&&!l&&o(e),h=!r&&!l&&!f&&u(e),p=r||l||f||h,d=p?n(e.length,String):[],y=d.length;for(var v in e)!t&&!c.call(e,v)||p&&("length"==v||f&&("offset"==v||"parent"==v)||h&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,y))||d.push(v);return d}},9932:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r{e.exports=function(e,t){for(var r=-1,n=t.length,i=e.length;++r{var n=r(9465),i=r(7813);e.exports=function(e,t,r){(void 0!==r&&!i(e[t],r)||void 0===r&&!(t in e))&&n(e,t,r)}},4865:(e,t,r)=>{var n=r(9465),i=r(7813),a=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var o=e[t];a.call(e,t)&&i(o,r)&&(void 0!==r||t in e)||n(e,t,r)}},8470:(e,t,r)=>{var n=r(7813);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},4037:(e,t,r)=>{var n=r(8363),i=r(3674);e.exports=function(e,t){return e&&n(t,i(t),e)}},3886:(e,t,r)=>{var n=r(8363),i=r(1704);e.exports=function(e,t){return e&&n(t,i(t),e)}},9465:(e,t,r)=>{var n=r(8777);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},9750:e=>{e.exports=function(e,t,r){return e==e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e}},5990:(e,t,r)=>{var n=r(6384),i=r(7412),a=r(4865),o=r(4037),s=r(3886),u=r(4626),c=r(278),l=r(8805),f=r(1911),h=r(8234),p=r(6904),d=r(4160),y=r(3824),v=r(9148),g=r(8517),m=r(1469),b=r(4144),E=r(6688),S=r(3218),C=r(2928),w=r(3674),T=r(1704),A="[object Arguments]",I="[object Function]",k="[object Object]",_={};_[A]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object DataView]"]=_["[object Boolean]"]=_["[object Date]"]=_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Map]"]=_["[object Number]"]=_[k]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object Symbol]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_["[object Error]"]=_[I]=_["[object WeakMap]"]=!1,e.exports=function e(t,r,B,N,O,R){var x,P=1&r,F=2&r,D=4&r;if(B&&(x=O?B(t,N,O,R):B(t)),void 0!==x)return x;if(!S(t))return t;var L=m(t);if(L){if(x=y(t),!P)return c(t,x)}else{var U=d(t),j=U==I||"[object GeneratorFunction]"==U;if(b(t))return u(t,P);if(U==k||U==A||j&&!O){if(x=F||j?{}:g(t),!P)return F?f(t,s(x,t)):l(t,o(x,t))}else{if(!_[U])return O?t:{};x=v(t,U,P)}}R||(R=new n);var V=R.get(t);if(V)return V;R.set(t,x),C(t)?t.forEach((function(n){x.add(e(n,r,B,n,t,R))})):E(t)&&t.forEach((function(n,i){x.set(i,e(n,r,B,i,t,R))}));var K=L?void 0:(D?F?p:h:F?T:w)(t);return i(K||t,(function(n,i){K&&(n=t[i=n]),a(x,i,e(n,r,B,i,t,R))})),x}},3118:(e,t,r)=>{var n=r(3218),i=Object.create,a=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=a},5082:(e,t,r)=>{var n=r(554),i=r(8958);e.exports=function(e,t,r,a){var o=e.length;for((r=n(r))<0&&(r=-r>o?0:o+r),(a=void 0===a||a>o?o:n(a))<0&&(a+=o),a=r>a?0:i(a);r{e.exports=function(e,t,r,n){for(var i=e.length,a=r+(n?1:-1);n?a--:++a{var n=r(2488),i=r(7285);e.exports=function e(t,r,a,o,s){var u=-1,c=t.length;for(a||(a=i),s||(s=[]);++u0&&a(l)?r>1?e(l,r-1,a,o,s):n(s,l):o||(s[s.length]=l)}return s}},8483:(e,t,r)=>{var n=r(5063)();e.exports=n},7786:(e,t,r)=>{var n=r(1811),i=r(327);e.exports=function(e,t){for(var r=0,a=(t=n(t,e)).length;null!=e&&r{var n=r(2488),i=r(1469);e.exports=function(e,t,r){var a=t(e);return i(e)?a:n(a,r(e))}},4239:(e,t,r)=>{var n=r(2705),i=r(9607),a=r(2333),o=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?i(e):a(e)}},13:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},2118:(e,t,r)=>{var n=r(1848),i=r(2722),a=r(2351);e.exports=function(e,t,r){return t==t?a(e,t,r):n(e,i,r)}},7556:(e,t,r)=>{var n=r(8668),i=r(7443),a=r(1196),o=r(9932),s=r(1717),u=r(4757),c=Math.min;e.exports=function(e,t,r){for(var l=r?a:i,f=e[0].length,h=e.length,p=h,d=Array(h),y=1/0,v=[];p--;){var g=e[p];p&&t&&(g=o(g,s(t))),y=c(g.length,y),d[p]=!r&&(t||f>=120&&g.length>=120)?new n(p&&g):void 0}g=e[0];var m=-1,b=d[0];e:for(;++m{var n=r(4239),i=r(7005);e.exports=function(e){return i(e)&&"[object Arguments]"==n(e)}},5588:(e,t,r)=>{var n=r(4160),i=r(7005);e.exports=function(e){return i(e)&&"[object Map]"==n(e)}},2722:e=>{e.exports=function(e){return e!=e}},8458:(e,t,r)=>{var n=r(3560),i=r(5346),a=r(3218),o=r(346),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,f=c.hasOwnProperty,h=RegExp("^"+l.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||i(e))&&(n(e)?h:s).test(o(e))}},9221:(e,t,r)=>{var n=r(4160),i=r(7005);e.exports=function(e){return i(e)&&"[object Set]"==n(e)}},8749:(e,t,r)=>{var n=r(4239),i=r(1780),a=r(7005),o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,e.exports=function(e){return a(e)&&i(e.length)&&!!o[n(e)]}},280:(e,t,r)=>{var n=r(5726),i=r(6916),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=[];for(var r in Object(e))a.call(e,r)&&"constructor"!=r&&t.push(r);return t}},313:(e,t,r)=>{var n=r(3218),i=r(5726),a=r(3498),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return a(e);var t=i(e),r=[];for(var s in e)("constructor"!=s||!t&&o.call(e,s))&&r.push(s);return r}},9435:e=>{e.exports=function(){}},2980:(e,t,r)=>{var n=r(6384),i=r(6556),a=r(8483),o=r(9783),s=r(3218),u=r(1704),c=r(6390);e.exports=function e(t,r,l,f,h){t!==r&&a(r,(function(a,u){if(h||(h=new n),s(a))o(t,r,u,l,e,f,h);else{var p=f?f(c(t,u),a,u+"",t,r,h):void 0;void 0===p&&(p=a),i(t,u,p)}}),u)}},9783:(e,t,r)=>{var n=r(6556),i=r(4626),a=r(7133),o=r(278),s=r(8517),u=r(5694),c=r(1469),l=r(9246),f=r(4144),h=r(3560),p=r(3218),d=r(8630),y=r(6719),v=r(6390),g=r(9881);e.exports=function(e,t,r,m,b,E,S){var C=v(e,r),w=v(t,r),T=S.get(w);if(T)n(e,r,T);else{var A=E?E(C,w,r+"",e,t,S):void 0,I=void 0===A;if(I){var k=c(w),_=!k&&f(w),B=!k&&!_&&y(w);A=w,k||_||B?c(C)?A=C:l(C)?A=o(C):_?(I=!1,A=i(w,!0)):B?(I=!1,A=a(w,!0)):A=[]:d(w)||u(w)?(A=C,u(C)?A=g(C):p(C)&&!h(C)||(A=s(w))):I=!1}I&&(S.set(w,A),b(A,w,m,E,S),S.delete(w)),n(e,r,A)}}},5970:(e,t,r)=>{var n=r(3012),i=r(9095);e.exports=function(e,t){return n(e,t,(function(t,r){return i(e,r)}))}},3012:(e,t,r)=>{var n=r(7786),i=r(611),a=r(1811);e.exports=function(e,t,r){for(var o=-1,s=t.length,u={};++o{var n=r(6557),i=r(5357),a=r(61);e.exports=function(e,t){return a(i(e,t,n),e+"")}},611:(e,t,r)=>{var n=r(4865),i=r(1811),a=r(5776),o=r(3218),s=r(327);e.exports=function(e,t,r,u){if(!o(e))return e;for(var c=-1,l=(t=i(t,e)).length,f=l-1,h=e;null!=h&&++c{var n=r(6557),i=r(9250),a=i?function(e,t){return i.set(e,t),e}:n;e.exports=a},6560:(e,t,r)=>{var n=r(5703),i=r(8777),a=r(6557),o=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:a;e.exports=o},4259:e=>{e.exports=function(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n{e.exports=function(e,t){for(var r=-1,n=Array(e);++r{var n=r(2705),i=r(9932),a=r(1469),o=r(3448),s=n?n.prototype:void 0,u=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(a(t))return i(t,e)+"";if(o(t))return u?u.call(t):"";var r=t+"";return"0"==r&&1/t==-Infinity?"-0":r}},7561:(e,t,r)=>{var n=r(7990),i=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(i,""):e}},1717:e=>{e.exports=function(e){return function(t){return e(t)}}},5652:(e,t,r)=>{var n=r(8668),i=r(7443),a=r(1196),o=r(4757),s=r(3593),u=r(1814);e.exports=function(e,t,r){var c=-1,l=i,f=e.length,h=!0,p=[],d=p;if(r)h=!1,l=a;else if(f>=200){var y=t?null:s(e);if(y)return u(y);h=!1,l=o,d=new n}else d=t?[]:p;e:for(;++c{var n=r(1811),i=r(928),a=r(292),o=r(327);e.exports=function(e,t){return t=n(t,e),null==(e=a(e,t))||delete e[o(i(t))]}},4757:e=>{e.exports=function(e,t){return e.has(t)}},4387:(e,t,r)=>{var n=r(9246);e.exports=function(e){return n(e)?e:[]}},1811:(e,t,r)=>{var n=r(1469),i=r(5403),a=r(5514),o=r(9833);e.exports=function(e,t){return n(e)?e:i(e,t)?[e]:a(o(e))}},4318:(e,t,r)=>{var n=r(1149);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},4626:(e,t,r)=>{e=r.nmd(e);var n=r(5639),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i?n.Buffer:void 0,s=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=s?s(r):new e.constructor(r);return e.copy(n),n}},7157:(e,t,r)=>{var n=r(4318);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}},3147:e=>{var t=/\w*$/;e.exports=function(e){var r=new e.constructor(e.source,t.exec(e));return r.lastIndex=e.lastIndex,r}},419:(e,t,r)=>{var n=r(2705),i=n?n.prototype:void 0,a=i?i.valueOf:void 0;e.exports=function(e){return a?Object(a.call(e)):{}}},7133:(e,t,r)=>{var n=r(4318);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},2157:e=>{var t=Math.max;e.exports=function(e,r,n,i){for(var a=-1,o=e.length,s=n.length,u=-1,c=r.length,l=t(o-s,0),f=Array(c+l),h=!i;++u{var t=Math.max;e.exports=function(e,r,n,i){for(var a=-1,o=e.length,s=-1,u=n.length,c=-1,l=r.length,f=t(o-u,0),h=Array(f+l),p=!i;++a{e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r{var n=r(4865),i=r(9465);e.exports=function(e,t,r,a){var o=!r;r||(r={});for(var s=-1,u=t.length;++s{var n=r(8363),i=r(9551);e.exports=function(e,t){return n(e,i(e),t)}},1911:(e,t,r)=>{var n=r(8363),i=r(1442);e.exports=function(e,t){return n(e,i(e),t)}},4429:(e,t,r)=>{var n=r(5639)["__core-js_shared__"];e.exports=n},7991:e=>{e.exports=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}},1463:(e,t,r)=>{var n=r(5976),i=r(6612);e.exports=function(e){return n((function(t,r){var n=-1,a=r.length,o=a>1?r[a-1]:void 0,s=a>2?r[2]:void 0;for(o=e.length>3&&"function"==typeof o?(a--,o):void 0,s&&i(r[0],r[1],s)&&(o=a<3?void 0:o,a=1),t=Object(t);++n{e.exports=function(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var u=o[e?s:++i];if(!1===r(a[u],u,a))break}return t}}},2402:(e,t,r)=>{var n=r(1774),i=r(5639);e.exports=function(e,t,r){var a=1&t,o=n(e);return function t(){var n=this&&this!==i&&this instanceof t?o:e;return n.apply(a?r:this,arguments)}}},1774:(e,t,r)=>{var n=r(3118),i=r(3218);e.exports=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=n(e.prototype),a=e.apply(r,t);return i(a)?a:r}}},6347:(e,t,r)=>{var n=r(6874),i=r(1774),a=r(6935),o=r(4487),s=r(893),u=r(6460),c=r(5639);e.exports=function(e,t,r){var l=i(e);return function i(){for(var f=arguments.length,h=Array(f),p=f,d=s(i);p--;)h[p]=arguments[p];var y=f<3&&h[0]!==d&&h[f-1]!==d?[]:u(h,d);if((f-=y.length){var n=r(2157),i=r(4054),a=r(7991),o=r(1774),s=r(4487),u=r(893),c=r(451),l=r(6460),f=r(5639);e.exports=function e(t,r,h,p,d,y,v,g,m,b){var E=128&r,S=1&r,C=2&r,w=24&r,T=512&r,A=C?void 0:o(t);return function I(){for(var k=arguments.length,_=Array(k),B=k;B--;)_[B]=arguments[B];if(w)var N=u(I),O=a(_,N);if(p&&(_=n(_,p,d,w)),y&&(_=i(_,y,v,w)),k-=O,w&&k1&&_.reverse(),E&&m{var n=r(6874),i=r(1774),a=r(5639);e.exports=function(e,t,r,o){var s=1&t,u=i(e);return function t(){for(var i=-1,c=arguments.length,l=-1,f=o.length,h=Array(f+c),p=this&&this!==a&&this instanceof t?u:e;++l{var n=r(6528),i=r(258),a=r(9255);e.exports=function(e,t,r,o,s,u,c,l,f,h){var p=8&t;t|=p?32:64,4&(t&=~(p?64:32))||(t&=-4);var d=[e,t,s,p?u:void 0,p?c:void 0,p?void 0:u,p?void 0:c,l,f,h],y=r.apply(void 0,d);return n(e)&&i(y,d),y.placeholder=o,a(y,e,t)}},3593:(e,t,r)=>{var n=r(8525),i=r(308),a=r(1814),o=n&&1/a(new n([,-0]))[1]==1/0?function(e){return new n(e)}:i;e.exports=o},7727:(e,t,r)=>{var n=r(8045),i=r(2402),a=r(6347),o=r(6935),s=r(4375),u=r(6833),c=r(3833),l=r(258),f=r(9255),h=r(554),p=Math.max;e.exports=function(e,t,r,d,y,v,g,m){var b=2&t;if(!b&&"function"!=typeof e)throw new TypeError("Expected a function");var E=d?d.length:0;if(E||(t&=-97,d=y=void 0),g=void 0===g?g:p(h(g),0),m=void 0===m?m:h(m),E-=y?y.length:0,64&t){var S=d,C=y;d=y=void 0}var w=b?void 0:u(e),T=[e,t,r,d,y,S,C,v,g,m];if(w&&c(T,w),e=T[0],t=T[1],r=T[2],d=T[3],y=T[4],!(m=T[9]=void 0===T[9]?b?0:e.length:p(T[9]-E,0))&&24&t&&(t&=-25),t&&1!=t)A=8==t||16==t?a(e,t,m):32!=t&&33!=t||y.length?o.apply(void 0,T):s(e,t,r,d);else var A=i(e,t,r);return f((w?n:l)(A,T),e,t)}},696:(e,t,r)=>{var n=r(8630);e.exports=function(e){return n(e)?void 0:e}},8777:(e,t,r)=>{var n=r(852),i=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},9021:(e,t,r)=>{var n=r(5564),i=r(5357),a=r(61);e.exports=function(e){return a(i(e,void 0,n),e+"")}},1957:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},8234:(e,t,r)=>{var n=r(8866),i=r(9551),a=r(3674);e.exports=function(e){return n(e,a,i)}},6904:(e,t,r)=>{var n=r(8866),i=r(1442),a=r(1704);e.exports=function(e){return n(e,a,i)}},6833:(e,t,r)=>{var n=r(9250),i=r(308),a=n?function(e){return n.get(e)}:i;e.exports=a},7658:(e,t,r)=>{var n=r(2060),i=Object.prototype.hasOwnProperty;e.exports=function(e){for(var t=e.name+"",r=n[t],a=i.call(n,t)?r.length:0;a--;){var o=r[a],s=o.func;if(null==s||s==e)return o.name}return t}},893:e=>{e.exports=function(e){return e.placeholder}},5050:(e,t,r)=>{var n=r(7019);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},852:(e,t,r)=>{var n=r(8458),i=r(7801);e.exports=function(e,t){var r=i(e,t);return n(r)?r:void 0}},9882:(e,t,r)=>{var n=r(5569)(Object.getPrototypeOf,Object);e.exports=n},9607:(e,t,r)=>{var n=r(2705),i=Object.prototype,a=i.hasOwnProperty,o=i.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=a.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=o.call(e);return n&&(t?e[s]=r:delete e[s]),i}},9551:(e,t,r)=>{var n=r(4963),i=r(479),a=Object.prototype.propertyIsEnumerable,o=Object.getOwnPropertySymbols,s=o?function(e){return null==e?[]:(e=Object(e),n(o(e),(function(t){return a.call(e,t)})))}:i;e.exports=s},1442:(e,t,r)=>{var n=r(2488),i=r(9882),a=r(9551),o=r(479),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,a(e)),e=i(e);return t}:o;e.exports=s},4160:(e,t,r)=>{var n=r(8552),i=r(7071),a=r(3818),o=r(8525),s=r(577),u=r(4239),c=r(346),l="[object Map]",f="[object Promise]",h="[object Set]",p="[object WeakMap]",d="[object DataView]",y=c(n),v=c(i),g=c(a),m=c(o),b=c(s),E=u;(n&&E(new n(new ArrayBuffer(1)))!=d||i&&E(new i)!=l||a&&E(a.resolve())!=f||o&&E(new o)!=h||s&&E(new s)!=p)&&(E=function(e){var t=u(e),r="[object Object]"==t?e.constructor:void 0,n=r?c(r):"";if(n)switch(n){case y:return d;case v:return l;case g:return f;case m:return h;case b:return p}return t}),e.exports=E},7801:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},8775:e=>{var t=/\{\n\/\* \[wrapped with (.+)\] \*/,r=/,? & /;e.exports=function(e){var n=e.match(t);return n?n[1].split(r):[]}},222:(e,t,r)=>{var n=r(1811),i=r(5694),a=r(1469),o=r(5776),s=r(1780),u=r(327);e.exports=function(e,t,r){for(var c=-1,l=(t=n(t,e)).length,f=!1;++c{var n=r(4536);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},401:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},7667:(e,t,r)=>{var n=r(4536),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return i.call(t,e)?t[e]:void 0}},1327:(e,t,r)=>{var n=r(4536),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:i.call(t,e)}},1866:(e,t,r)=>{var n=r(4536);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},3824:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var r=e.length,n=new e.constructor(r);return r&&"string"==typeof e[0]&&t.call(e,"index")&&(n.index=e.index,n.input=e.input),n}},9148:(e,t,r)=>{var n=r(4318),i=r(7157),a=r(3147),o=r(419),s=r(7133);e.exports=function(e,t,r){var u=e.constructor;switch(t){case"[object ArrayBuffer]":return n(e);case"[object Boolean]":case"[object Date]":return new u(+e);case"[object DataView]":return i(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,r);case"[object Map]":return new u;case"[object Number]":case"[object String]":return new u(e);case"[object RegExp]":return a(e);case"[object Set]":return new u;case"[object Symbol]":return o(e)}}},8517:(e,t,r)=>{var n=r(3118),i=r(9882),a=r(5726);e.exports=function(e){return"function"!=typeof e.constructor||a(e)?{}:n(i(e))}},3112:e=>{var t=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;e.exports=function(e,r){var n=r.length;if(!n)return e;var i=n-1;return r[i]=(n>1?"& ":"")+r[i],r=r.join(n>2?", ":" "),e.replace(t,"{\n/* [wrapped with "+r+"] */\n")}},7285:(e,t,r)=>{var n=r(2705),i=r(5694),a=r(1469),o=n?n.isConcatSpreadable:void 0;e.exports=function(e){return a(e)||i(e)||!!(o&&e&&e[o])}},5776:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e{var n=r(7813),i=r(8612),a=r(5776),o=r(3218);e.exports=function(e,t,r){if(!o(r))return!1;var s=typeof t;return!!("number"==s?i(r)&&a(t,r.length):"string"==s&&t in r)&&n(r[t],e)}},5403:(e,t,r)=>{var n=r(1469),i=r(3448),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;e.exports=function(e,t){if(n(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!i(e))||(o.test(e)||!a.test(e)||null!=t&&e in Object(t))}},7019:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},6528:(e,t,r)=>{var n=r(6425),i=r(6833),a=r(7658),o=r(8111);e.exports=function(e){var t=a(e),r=o[t];if("function"!=typeof r||!(t in n.prototype))return!1;if(e===r)return!0;var s=i(r);return!!s&&e===s[0]}},5346:(e,t,r)=>{var n,i=r(4429),a=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!a&&a in e}},5726:e=>{var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},7040:e=>{e.exports=function(){this.__data__=[],this.size=0}},4125:(e,t,r)=>{var n=r(8470),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0)&&(r==t.length-1?t.pop():i.call(t,r,1),--this.size,!0)}},2117:(e,t,r)=>{var n=r(8470);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},7518:(e,t,r)=>{var n=r(8470);e.exports=function(e){return n(this.__data__,e)>-1}},4705:(e,t,r)=>{var n=r(8470);e.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},4785:(e,t,r)=>{var n=r(1989),i=r(8407),a=r(7071);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||i),string:new n}}},1285:(e,t,r)=>{var n=r(5050);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},6e3:(e,t,r)=>{var n=r(5050);e.exports=function(e){return n(this,e).get(e)}},9916:(e,t,r)=>{var n=r(5050);e.exports=function(e){return n(this,e).has(e)}},5265:(e,t,r)=>{var n=r(5050);e.exports=function(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}},4523:(e,t,r)=>{var n=r(8306);e.exports=function(e){var t=n(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}},3833:(e,t,r)=>{var n=r(2157),i=r(4054),a=r(6460),o="__lodash_placeholder__",s=128,u=Math.min;e.exports=function(e,t){var r=e[1],c=t[1],l=r|c,f=l<131,h=c==s&&8==r||c==s&&256==r&&e[7].length<=t[8]||384==c&&t[7].length<=t[8]&&8==r;if(!f&&!h)return e;1&c&&(e[2]=t[2],l|=1&r?0:4);var p=t[3];if(p){var d=e[3];e[3]=d?n(d,p,t[4]):p,e[4]=d?a(e[3],o):t[4]}return(p=t[5])&&(d=e[5],e[5]=d?i(d,p,t[6]):p,e[6]=d?a(e[5],o):t[6]),(p=t[7])&&(e[7]=p),c&s&&(e[8]=null==e[8]?t[8]:u(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=l,e}},9250:(e,t,r)=>{var n=r(577),i=n&&new n;e.exports=i},4536:(e,t,r)=>{var n=r(852)(Object,"create");e.exports=n},6916:(e,t,r)=>{var n=r(5569)(Object.keys,Object);e.exports=n},3498:e=>{e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},1167:(e,t,r)=>{e=r.nmd(e);var n=r(1957),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i&&n.process,s=function(){try{var e=a&&a.require&&a.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=s},2333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},5357:(e,t,r)=>{var n=r(6874),i=Math.max;e.exports=function(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=i(a.length-t,0),u=Array(s);++o{var n=r(7786),i=r(4259);e.exports=function(e,t){return t.length<2?e:n(e,i(t,0,-1))}},2060:e=>{e.exports={}},451:(e,t,r)=>{var n=r(278),i=r(5776),a=Math.min;e.exports=function(e,t){for(var r=e.length,o=a(t.length,r),s=n(e);o--;){var u=t[o];e[o]=i(u,r)?s[u]:void 0}return e}},6460:e=>{var t="__lodash_placeholder__";e.exports=function(e,r){for(var n=-1,i=e.length,a=0,o=[];++n{var n=r(1957),i="object"==typeof self&&self&&self.Object===Object&&self,a=n||i||Function("return this")();e.exports=a},6390:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},619:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},2385:e=>{e.exports=function(e){return this.__data__.has(e)}},258:(e,t,r)=>{var n=r(8045),i=r(1275)(n);e.exports=i},1814:e=>{e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}},61:(e,t,r)=>{var n=r(6560),i=r(1275)(n);e.exports=i},9255:(e,t,r)=>{var n=r(8775),i=r(3112),a=r(61),o=r(7241);e.exports=function(e,t,r){var s=t+"";return a(e,i(s,o(n(s),r)))}},1275:e=>{var t=Date.now;e.exports=function(e){var r=0,n=0;return function(){var i=t(),a=16-(i-n);if(n=i,a>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},7465:(e,t,r)=>{var n=r(8407);e.exports=function(){this.__data__=new n,this.size=0}},3779:e=>{e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},7599:e=>{e.exports=function(e){return this.__data__.get(e)}},4758:e=>{e.exports=function(e){return this.__data__.has(e)}},4309:(e,t,r)=>{var n=r(8407),i=r(7071),a=r(3369);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var o=r.__data__;if(!i||o.length<199)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(o)}return r.set(e,t),this.size=r.size,this}},2351:e=>{e.exports=function(e,t,r){for(var n=r-1,i=e.length;++n{var n=r(4523),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,o=n((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,r,n,i){t.push(n?i.replace(a,"$1"):r||e)})),t}));e.exports=o},327:(e,t,r)=>{var n=r(3448);e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}},346:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},7990:e=>{var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},7241:(e,t,r)=>{var n=r(7412),i=r(7443),a=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];e.exports=function(e,t){return n(a,(function(r){var n="_."+r[0];t&r[1]&&!i(e,n)&&e.push(n)})),e.sort()}},1913:(e,t,r)=>{var n=r(6425),i=r(7548),a=r(278);e.exports=function(e){if(e instanceof n)return e.clone();var t=new i(e.__wrapped__,e.__chain__);return t.__actions__=a(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}},8583:(e,t,r)=>{var n=r(4865),i=r(8363),a=r(1463),o=r(8612),s=r(5726),u=r(3674),c=Object.prototype.hasOwnProperty,l=a((function(e,t){if(s(t)||o(t))i(t,u(t),e);else for(var r in t)c.call(t,r)&&n(e,r,t[r])}));e.exports=l},6678:(e,t,r)=>{var n=r(5990);e.exports=function(e){return n(e,4)}},5703:e=>{e.exports=function(e){return function(){return e}}},7813:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},9873:(e,t,r)=>{var n=r(5082),i=r(6612);e.exports=function(e,t,r,a){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&i(e,t,r)&&(r=0,a=o),n(e,t,r,a)):[]}},5564:(e,t,r)=>{var n=r(1078);e.exports=function(e){return(null==e?0:e.length)?n(e,1):[]}},9095:(e,t,r)=>{var n=r(13),i=r(222);e.exports=function(e,t){return null!=e&&i(e,t,n)}},6557:e=>{e.exports=function(e){return e}},5325:(e,t,r)=>{var n=r(9932),i=r(7556),a=r(5976),o=r(4387),s=a((function(e){var t=n(e,o);return t.length&&t[0]===e[0]?i(t):[]}));e.exports=s},5694:(e,t,r)=>{var n=r(9454),i=r(7005),a=Object.prototype,o=a.hasOwnProperty,s=a.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(e){return i(e)&&o.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},1469:e=>{var t=Array.isArray;e.exports=t},8612:(e,t,r)=>{var n=r(3560),i=r(1780);e.exports=function(e){return null!=e&&i(e.length)&&!n(e)}},9246:(e,t,r)=>{var n=r(8612),i=r(7005);e.exports=function(e){return i(e)&&n(e)}},4144:(e,t,r)=>{e=r.nmd(e);var n=r(5639),i=r(5062),a=t&&!t.nodeType&&t,o=a&&e&&!e.nodeType&&e,s=o&&o.exports===a?n.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;e.exports=u},3560:(e,t,r)=>{var n=r(4239),i=r(3218);e.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},6688:(e,t,r)=>{var n=r(5588),i=r(1717),a=r(1167),o=a&&a.isMap,s=o?i(o):n;e.exports=s},3218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},8630:(e,t,r)=>{var n=r(4239),i=r(9882),a=r(7005),o=Function.prototype,s=Object.prototype,u=o.toString,c=s.hasOwnProperty,l=u.call(Object);e.exports=function(e){if(!a(e)||"[object Object]"!=n(e))return!1;var t=i(e);if(null===t)return!0;var r=c.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&u.call(r)==l}},2928:(e,t,r)=>{var n=r(9221),i=r(1717),a=r(1167),o=a&&a.isSet,s=o?i(o):n;e.exports=s},3448:(e,t,r)=>{var n=r(4239),i=r(7005);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==n(e)}},6719:(e,t,r)=>{var n=r(8749),i=r(1717),a=r(1167),o=a&&a.isTypedArray,s=o?i(o):n;e.exports=s},3674:(e,t,r)=>{var n=r(4636),i=r(280),a=r(8612);e.exports=function(e){return a(e)?n(e):i(e)}},1704:(e,t,r)=>{var n=r(4636),i=r(313),a=r(8612);e.exports=function(e){return a(e)?n(e,!0):i(e)}},928:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},8306:(e,t,r)=>{var n=r(3369);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(i.Cache||n),r}i.Cache=n,e.exports=i},2492:(e,t,r)=>{var n=r(2980),i=r(1463)((function(e,t,r){n(e,t,r)}));e.exports=i},308:e=>{e.exports=function(){}},7557:(e,t,r)=>{var n=r(9932),i=r(5990),a=r(7406),o=r(1811),s=r(8363),u=r(696),c=r(9021),l=r(6904),f=c((function(e,t){var r={};if(null==e)return r;var c=!1;t=n(t,(function(t){return t=o(t,e),c||(c=t.length>1),t})),s(e,l(e),r),c&&(r=i(r,7,u));for(var f=t.length;f--;)a(r,t[f]);return r}));e.exports=f},5544:(e,t,r)=>{var n=r(5976),i=r(7727),a=r(893),o=r(6460),s=n((function(e,t){var r=o(t,a(s));return i(e,64,void 0,t,r)}));s.placeholder={},e.exports=s},8718:(e,t,r)=>{var n=r(5970),i=r(9021)((function(e,t){return null==e?{}:n(e,t)}));e.exports=i},479:e=>{e.exports=function(){return[]}},5062:e=>{e.exports=function(){return!1}},8601:(e,t,r)=>{var n=r(4841),i=1/0;e.exports=function(e){return e?(e=n(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},554:(e,t,r)=>{var n=r(8601);e.exports=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},8958:(e,t,r)=>{var n=r(9750),i=r(554);e.exports=function(e){return e?n(i(e),0,4294967295):0}},4841:(e,t,r)=>{var n=r(7561),i=r(3218),a=r(3448),o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=s.test(e);return r||u.test(e)?c(e.slice(2),r?2:8):o.test(e)?NaN:+e}},9881:(e,t,r)=>{var n=r(8363),i=r(1704);e.exports=function(e){return n(e,i(e))}},9833:(e,t,r)=>{var n=r(531);e.exports=function(e){return null==e?"":n(e)}},4908:(e,t,r)=>{var n=r(5652);e.exports=function(e){return e&&e.length?n(e):[]}},8111:(e,t,r)=>{var n=r(6425),i=r(7548),a=r(9435),o=r(1469),s=r(7005),u=r(1913),c=Object.prototype.hasOwnProperty;function l(e){if(s(e)&&!o(e)&&!(e instanceof n)){if(e instanceof i)return e;if(c.call(e,"__wrapped__"))return u(e)}return new i(e)}l.prototype=a.prototype,l.prototype.constructor=l,e.exports=l},3720:e=>{e.exports=r;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function r(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function n(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=n;var i={},a={};function o(e,t){var r,n,o;return t?(o=0<=(e>>>=0)&&e<256)&&(n=a[e])?n:(r=u(e,(0|e)<0?-1:0,!0),o&&(a[e]=r),r):(o=-128<=(e|=0)&&e<128)&&(n=i[e])?n:(r=u(e,e<0?-1:0,!1),o&&(i[e]=r),r)}function s(e,t){if(isNaN(e))return t?g:v;if(t){if(e<0)return g;if(e>=p)return C}else{if(e<=-d)return w;if(e+1>=d)return S}return e<0?s(-e,t).neg():u(e%h|0,e/h|0,t)}function u(e,t,n){return new r(e,t,n)}r.fromInt=o,r.fromNumber=s,r.fromBits=u;var c=Math.pow;function l(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return v;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||360)throw Error("interior hyphen");if(0===n)return l(e.substring(1),t,r).neg();for(var i=s(c(r,8)),a=v,o=0;o>>0:this.low},T.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},T.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((a=u).isZero())return l+o;for(;l.length<6;)l="0"+l;o=""+l+o}},T.getHighBits=function(){return this.high},T.getHighBitsUnsigned=function(){return this.high>>>0},T.getLowBits=function(){return this.low},T.getLowBitsUnsigned=function(){return this.low>>>0},T.getNumBitsAbs=function(){if(this.isNegative())return this.eq(w)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},T.isOdd=function(){return 1==(1&this.low)},T.isEven=function(){return 0==(1&this.low)},T.equals=function(e){return n(e)||(e=f(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},T.eq=T.equals,T.notEquals=function(e){return!this.eq(e)},T.neq=T.notEquals,T.ne=T.notEquals,T.lessThan=function(e){return this.comp(e)<0},T.lt=T.lessThan,T.lessThanOrEqual=function(e){return this.comp(e)<=0},T.lte=T.lessThanOrEqual,T.le=T.lessThanOrEqual,T.greaterThan=function(e){return this.comp(e)>0},T.gt=T.greaterThan,T.greaterThanOrEqual=function(e){return this.comp(e)>=0},T.gte=T.greaterThanOrEqual,T.ge=T.greaterThanOrEqual,T.compare=function(e){if(n(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},T.comp=T.compare,T.negate=function(){return!this.unsigned&&this.eq(w)?w:this.not().add(m)},T.neg=T.negate,T.add=function(e){n(e)||(e=f(e));var t=this.high>>>16,r=65535&this.high,i=this.low>>>16,a=65535&this.low,o=e.high>>>16,s=65535&e.high,c=e.low>>>16,l=0,h=0,p=0,d=0;return p+=(d+=a+(65535&e.low))>>>16,h+=(p+=i+c)>>>16,l+=(h+=r+s)>>>16,l+=t+o,u((p&=65535)<<16|(d&=65535),(l&=65535)<<16|(h&=65535),this.unsigned)},T.subtract=function(e){return n(e)||(e=f(e)),this.add(e.neg())},T.sub=T.subtract,T.multiply=function(e){if(this.isZero())return v;if(n(e)||(e=f(e)),t)return u(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return v;if(this.eq(w))return e.isOdd()?w:v;if(e.eq(w))return this.isOdd()?w:v;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(y)&&e.lt(y))return s(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,i=65535&this.high,a=this.low>>>16,o=65535&this.low,c=e.high>>>16,l=65535&e.high,h=e.low>>>16,p=65535&e.low,d=0,g=0,m=0,b=0;return m+=(b+=o*p)>>>16,g+=(m+=a*p)>>>16,m&=65535,g+=(m+=o*h)>>>16,d+=(g+=i*p)>>>16,g&=65535,d+=(g+=a*h)>>>16,g&=65535,d+=(g+=o*l)>>>16,d+=r*p+i*h+a*l+o*c,u((m&=65535)<<16|(b&=65535),(d&=65535)<<16|(g&=65535),this.unsigned)},T.mul=T.multiply,T.divide=function(e){if(n(e)||(e=f(e)),e.isZero())throw Error("division by zero");var r,i,a;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?u((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?g:v;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return b;a=g}else{if(this.eq(w))return e.eq(m)||e.eq(E)?w:e.eq(w)?m:(r=this.shr(1).div(e).shl(1)).eq(v)?e.isNegative()?m:E:(i=this.sub(e.mul(r)),a=r.add(i.div(e)));if(e.eq(w))return this.unsigned?g:v;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=v}for(i=this;i.gte(e);){r=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),l=o<=48?1:c(2,o-48),h=s(r),p=h.mul(e);p.isNegative()||p.gt(i);)p=(h=s(r-=l,this.unsigned)).mul(e);h.isZero()&&(h=m),a=a.add(h),i=i.sub(p)}return a},T.div=T.divide,T.modulo=function(e){return n(e)||(e=f(e)),t?u((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},T.mod=T.modulo,T.rem=T.modulo,T.not=function(){return u(~this.low,~this.high,this.unsigned)},T.and=function(e){return n(e)||(e=f(e)),u(this.low&e.low,this.high&e.high,this.unsigned)},T.or=function(e){return n(e)||(e=f(e)),u(this.low|e.low,this.high|e.high,this.unsigned)},T.xor=function(e){return n(e)||(e=f(e)),u(this.low^e.low,this.high^e.high,this.unsigned)},T.shiftLeft=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low<>>32-e,this.unsigned):u(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):u(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},T.shr=T.shiftRight,T.shiftRightUnsigned=function(e){if(n(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?u(this.low>>>e|t<<32-e,t>>>e,this.unsigned):u(32===e?t:t>>>e-32,0,this.unsigned)},T.shru=T.shiftRightUnsigned,T.shr_u=T.shiftRightUnsigned,T.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},T.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},T.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},T.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},T.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,n){return n?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},8925:(e,t,r)=>{var n=r(3832);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.aes.Algorithm(e,t)}))}r(5649),r(1967),r(7116),e.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i},n.aes.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},n.aes.startDecrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i},n.aes.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},n.aes.Algorithm=function(e,t){l||f();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return p(r._w,e,t,!1)},decrypt:function(e,t){return p(r._w,e,t,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,r=e.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(n.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=n.util.createBuffer();for(var i=0;i>>=2;for(i=0;i>8^255&f^99,a[y]=f,o[f]=y,p=(h=e[f])<<24^f<<16^f<<8^f^h,d=((r=e[y])^(n=e[r])^(i=e[n]))<<24^(y^i)<<16^(y^n^i)<<8^y^r^i;for(var g=0;g<4;++g)u[g][y]=p,c[g][f]=d,p=p<<24|p>>>8,d=d<<24|d>>>8;0===y?y=v=1:(y=r^e[e[e[r^i]]],v^=e[e[v]])}}function h(e,t){for(var r,n=e.slice(0),i=1,o=n.length,u=4*(o+6+1),l=o;l>>16&255]<<24^a[r>>>8&255]<<16^a[255&r]<<8^a[r>>>24]^s[i]<<24,i++):o>6&&l%o==4&&(r=a[r>>>24]<<24^a[r>>>16&255]<<16^a[r>>>8&255]<<8^a[255&r]),n[l]=n[l-o]^r;if(t){for(var f,h=c[0],p=c[1],d=c[2],y=c[3],v=n.slice(0),g=(l=0,(u=n.length)-4);l>>24]]^p[a[f>>>16&255]]^d[a[f>>>8&255]]^y[a[255&f]];n=v}return n}function p(e,t,r,n){var i,s,l,f,h,p,d,y,v,g,m,b,E=e.length/4-1;n?(i=c[0],s=c[1],l=c[2],f=c[3],h=o):(i=u[0],s=u[1],l=u[2],f=u[3],h=a),p=t[0]^e[0],d=t[n?3:1]^e[1],y=t[2]^e[2],v=t[n?1:3]^e[3];for(var S=3,C=1;C>>24]^s[d>>>16&255]^l[y>>>8&255]^f[255&v]^e[++S],m=i[d>>>24]^s[y>>>16&255]^l[v>>>8&255]^f[255&p]^e[++S],b=i[y>>>24]^s[v>>>16&255]^l[p>>>8&255]^f[255&d]^e[++S],v=i[v>>>24]^s[p>>>16&255]^l[d>>>8&255]^f[255&y]^e[++S],p=g,d=m,y=b;r[0]=h[p>>>24]<<24^h[d>>>16&255]<<16^h[y>>>8&255]<<8^h[255&v]^e[++S],r[n?3:1]=h[d>>>24]<<24^h[y>>>16&255]<<16^h[v>>>8&255]<<8^h[255&p]^e[++S],r[2]=h[y>>>24]<<24^h[v>>>16&255]<<16^h[p>>>8&255]<<8^h[255&d]^e[++S],r[n?1:3]=h[v>>>24]<<24^h[p>>>16&255]<<16^h[d>>>8&255]<<8^h[255&y]^e[++S]}function d(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var a=null;r instanceof n.util.ByteBuffer&&(a=r,r={}),(r=r||{}).output=a,r.iv=e,i.call(t,r)},t}},3068:(e,t,r)=>{var n=r(3832);r(7116),r(6270);var i=e.exports=n.asn1=n.asn1||{};function a(e,t,r){if(r>t){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.create=function(e,t,r,a,o){if(n.util.isArray(a)){for(var s=[],u=0;ut){if(n.strict){var d=new Error("Too few bytes to read ASN.1 value.");throw d.available=e.length(),d.remaining=t,d.requested=p,d}p=t}var y=32==(32&u);if(y)if(f=[],void 0===p)for(;;){if(a(e,t,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),t-=2;break}s=e.length(),f.push(o(e,t,r+1,n)),t-=s-e.length()}else for(;p>0;)s=e.length(),f.push(o(e,p,r+1,n)),t-=s-e.length(),p-=s-e.length();if(void 0===f&&c===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&(h=e.bytes(p)),void 0===f&&n.decodeBitStrings&&c===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&p>1){var v=e.read,g=t,m=0;if(l===i.Type.BITSTRING&&(a(e,t,1),m=e.getByte(),t--),0===m)try{s=e.length();var b=o(e,t,r+1,{verbose:n.verbose,strict:!0,decodeBitStrings:!0}),E=s-e.length();t-=E,l==i.Type.BITSTRING&&E++;var S=b.tagClass;E!==p||S!==i.Class.UNIVERSAL&&S!==i.Class.CONTEXT_SPECIFIC||(f=[b])}catch(e){}void 0===f&&(e.read=v,t=g)}if(void 0===f){if(void 0===p){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");p=t}if(l===i.Type.BMPSTRING)for(f="";p>0;p-=2)a(e,t,2),f+=String.fromCharCode(e.getInt16()),t-=2;else f=e.getBytes(p)}var C=void 0===h?null:{bitStringContents:h};return i.create(c,l,y,f,C)}i.fromDer=function(e,t){return void 0===t&&(t={strict:!0,decodeBitStrings:!0}),"boolean"==typeof t&&(t={strict:t,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"string"==typeof e&&(e=n.util.createBuffer(e)),o(e,e.length(),0,t)},i.toDer=function(e){var t=n.util.createBuffer(),r=e.tagClass|e.type,a=n.util.createBuffer(),o=!1;if("bitStringContents"in e&&(o=!0,e.original&&(o=i.equals(e,e.original))),o)a.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:a.putByte(0);for(var s=0;s1&&(0===e.value.charCodeAt(0)&&0==(128&e.value.charCodeAt(1))||255===e.value.charCodeAt(0)&&128==(128&e.value.charCodeAt(1)))?a.putBytes(e.value.substr(1)):a.putBytes(e.value);if(t.putByte(r),a.length()<=127)t.putByte(127&a.length());else{var u=a.length(),c="";do{c+=String.fromCharCode(255&u),u>>>=8}while(u>0);t.putByte(128|c.length);for(s=c.length-1;s>=0;--s)t.putByte(c.charCodeAt(s))}return t.putBuffer(a),t},i.oidToDer=function(e){var t,r,i,a,o=e.split("."),s=n.util.createBuffer();s.putByte(40*parseInt(o[0],10)+parseInt(o[1],10));for(var u=2;u>>=7,t||(a|=128),r.push(a),t=!1}while(i>0);for(var c=r.length-1;c>=0;--c)s.putByte(r[c])}return s},i.derToOid=function(e){var t;"string"==typeof e&&(e=n.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var i=0;e.length()>0;)i<<=7,128&(r=e.getByte())?i+=127&r:(t+="."+(i+r),i=0);return t},i.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),a=parseInt(e.substr(6,2),10),o=parseInt(e.substr(8,2),10),s=0;if(e.length>11){var u=e.charAt(10),c=10;"+"!==u&&"-"!==u&&(s=parseInt(e.substr(10,2),10),c+=2)}if(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,0),c&&("+"===(u=e.charAt(c))||"-"===u)){var l=60*parseInt(e.substr(c+1,2),10)+parseInt(e.substr(c+4,2),10);l*=6e4,"+"===u?t.setTime(+t-l):t.setTime(+t+l)}return t},i.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),a=parseInt(e.substr(8,2),10),o=parseInt(e.substr(10,2),10),s=parseInt(e.substr(12,2),10),u=0,c=0,l=!1;"Z"===e.charAt(e.length-1)&&(l=!0);var f=e.length-5,h=e.charAt(f);"+"!==h&&"-"!==h||(c=60*parseInt(e.substr(f+1,2),10)+parseInt(e.substr(f+4,2),10),c*=6e4,"+"===h&&(c*=-1),l=!0);return"."===e.charAt(14)&&(u=1e3*parseFloat(e.substr(14),10)),l?(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,u),t.setTime(+t+c)):(t.setFullYear(r,n,i),t.setHours(a,o,s,u)),t},i.dateToUtcTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r},i.derToInteger=function(e){"string"==typeof e&&(e=n.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},i.validate=function(e,t,r,a){var o=!1;if(e.tagClass!==t.tagClass&&void 0!==t.tagClass||e.type!==t.type&&void 0!==t.type)a&&(e.tagClass!==t.tagClass&&a.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&a.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||void 0===t.constructed){if(o=!0,t.value&&n.util.isArray(t.value))for(var s=0,u=0;o&&u0&&(a+="\n");for(var o="",u=0;u1?a+="0x"+n.util.bytesToHex(e.value.slice(1)):a+="(none)",e.value.length>0){var h=e.value.charCodeAt(0);1==h?a+=" (1 unused bit shown)":h>1&&(a+=" ("+h+" unused bits shown)")}}else e.type===i.Type.OCTETSTRING?(s.test(e.value)||(a+="("+e.value+") "),a+="0x"+n.util.bytesToHex(e.value)):e.type===i.Type.UTF8?a+=n.util.decodeUtf8(e.value):e.type===i.Type.PRINTABLESTRING||e.type===i.Type.IA5String?a+=e.value:s.test(e.value)?a+="0x"+n.util.bytesToHex(e.value):0===e.value.length?a+="[null]":a+=e.value}return a}},8807:e=>{var t={};e.exports=t;var r={};t.encode=function(e,t,r){if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(e instanceof Uint8Array){var i=0,a=t.length,o=t.charAt(0),s=[0];for(i=0;i0;)s.push(c%a),c=c/a|0}for(i=0;0===e[i]&&i=0;--i)n+=t[s[i]]}else n=function(e,t){var r=0,n=t.length,i=t.charAt(0),a=[0];for(r=0;r0;)a.push(s%n),s=s/n|0}var u="";for(r=0;0===e.at(r)&&r=0;--r)u+=t[a[r]];return u}(e,t);if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join("\r\n")}return n},t.decode=function(e,t){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');var n=r[t];if(!n){n=r[t]=[];for(var i=0;i>=8;for(;l>0;)s.push(255&l),l>>=8}for(var f=0;e[f]===o&&f{var n=r(3832);r(7116),e.exports=n.cipher=n.cipher||{},n.cipher.algorithms=n.cipher.algorithms||{},n.cipher.createCipher=function(e,t){var r=e;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})},n.cipher.createDecipher=function(e,t){var r=e;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})},n.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),n.cipher.algorithms[e]=t},n.cipher.getAlgorithm=function(e){return(e=e.toUpperCase())in n.cipher.algorithms?n.cipher.algorithms[e]:null};var i=n.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};i.prototype.start=function(e){e=e||{};var t={};for(var r in e)t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=n.util.createBuffer(),this.output=e.output||n.util.createBuffer(),this.mode.start(t)},i.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},i.prototype.finish=function(e){!e||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(t){return e(this.blockSize,t,!1)},this.mode.unpad=function(t){return e(this.blockSize,t,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t))&&(this._finish=!0,this.update(),!(this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t))&&!(this.mode.afterFinish&&!this.mode.afterFinish(this.output,t)))}},1967:(e,t,r)=>{var n=r(3832);r(7116),n.cipher=n.cipher||{};var i=e.exports=n.cipher.modes=n.cipher.modes||{};function a(e,t){if("string"==typeof e&&(e=n.util.createBuffer(e)),n.util.isArray(e)&&e.length>4){var r=e;e=n.util.createBuffer();for(var i=0;i0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},i.cbc.prototype.encrypt=function(e,t,r){if(e.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i0)e.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i0)e.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i0)e.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}o(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},i.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,r=n.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?n.util.createBuffer(e.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=n.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=r.length();if(12===i)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(s(8*i)))}this._inBlock=this._j0.slice(0),o(this._inBlock),this._partialBytes=0,t=n.util.createBuffer(t),this._aDataLength=s(8*t.length());var a=t.length()%this.blockSize;for(a&&t.fillWithByte(0,this.blockSize-a),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},i.gcm.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),o(this._inBlock)},i.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),o(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i0;--n)t[n]=e[n]>>>1|(1&e[n-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},i.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=e[r/8|0]>>>4*(7-r%8)&15,i=this._m[r][n];t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3]}return t},i.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},i.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,i=16*r,a=new Array(i),o=0;o>>1,i=new Array(r);i[n]=e.slice(0);for(var a=n>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a{var n=r(3832);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.des.Algorithm(e,t)}))}r(5649),r(1967),r(7116),e.exports=n.des=n.des||{},n.des.startEncrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!1,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},n.des.startDecrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!0,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},n.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return p(r._keys,e,t,!1)},decrypt:function(e,t){return p(r._keys,e,t,!0)}}}),r._init=!1},n.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=n.util.createBuffer(e.key);if(0===this.name.indexOf("3DES")&&24!==t.length())throw new Error("Invalid Triple-DES key size: "+8*t.length());this._keys=function(e){for(var t,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],a=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],o=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],u=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],p=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],d=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],y=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],v=e.length()>8?3:1,g=[],m=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],b=0,E=0;E>>4^C))<<4,S^=t=65535&((C^=t)>>>-16^S),S^=(t=858993459&(S>>>2^(C^=t<<-16)))<<2,S^=t=65535&((C^=t)>>>-16^S),S^=(t=1431655765&(S>>>1^(C^=t<<-16)))<<1,S^=t=16711935&((C^=t)>>>8^S),t=(S^=(t=1431655765&(S>>>1^(C^=t<<8)))<<1)<<8|(C^=t)>>>20&240,S=C<<24|C<<8&16711680|C>>>8&65280|C>>>24&240,C=t;for(var w=0;w>>26,C=C<<2|C>>>26):(S=S<<1|S>>>27,C=C<<1|C>>>27),C&=-15;var T=r[(S&=-15)>>>28]|n[S>>>24&15]|i[S>>>20&15]|a[S>>>16&15]|o[S>>>12&15]|s[S>>>8&15]|u[S>>>4&15],A=c[C>>>28]|l[C>>>24&15]|f[C>>>20&15]|h[C>>>16&15]|p[C>>>12&15]|d[C>>>8&15]|y[C>>>4&15];t=65535&(A>>>16^T),g[b++]=T^t,g[b++]=A^t<<16}}return g}(t),this._init=!0}},i("DES-ECB",n.cipher.modes.ecb),i("DES-CBC",n.cipher.modes.cbc),i("DES-CFB",n.cipher.modes.cfb),i("DES-OFB",n.cipher.modes.ofb),i("DES-CTR",n.cipher.modes.ctr),i("3DES-ECB",n.cipher.modes.ecb),i("3DES-CBC",n.cipher.modes.cbc),i("3DES-CFB",n.cipher.modes.cfb),i("3DES-OFB",n.cipher.modes.ofb),i("3DES-CTR",n.cipher.modes.ctr);var a=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],o=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],s=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],c=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],f=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],h=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function p(e,t,r,n){var i,p,d=32===e.length?3:9;i=3===d?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=t[0],v=t[1];y^=(p=252645135&(y>>>4^v))<<4,y^=(p=65535&(y>>>16^(v^=p)))<<16,y^=p=858993459&((v^=p)>>>2^y),y^=p=16711935&((v^=p<<2)>>>8^y),y=(y^=(p=1431655765&(y>>>1^(v^=p<<8)))<<1)<<1|y>>>31,v=(v^=p)<<1|v>>>31;for(var g=0;g>>4|v<<28)^e[E+1];p=y,y=v,v=p^(o[S>>>24&63]|u[S>>>16&63]|l[S>>>8&63]|h[63&S]|a[C>>>24&63]|s[C>>>16&63]|c[C>>>8&63]|f[63&C])}p=y,y=v,v=p}v=v>>>1|v<<31,v^=p=1431655765&((y=y>>>1|y<<31)>>>1^v),v^=(p=16711935&(v>>>8^(y^=p<<1)))<<8,v^=(p=858993459&(v>>>2^(y^=p)))<<2,v^=p=65535&((y^=p)>>>16^v),v^=p=252645135&((y^=p<<16)>>>4^v),y^=p<<4,r[0]=y,r[1]=v}function d(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var a=null;r instanceof n.util.ByteBuffer&&(a=r,r={}),(r=r||{}).output=a,r.iv=e,i.call(t,r)},t}},3832:e=>{e.exports={options:{usePureJavaScript:!1}}},6607:(e,t,r)=>{var n=r(3832);r(8991),r(7116),(e.exports=n.hmac=n.hmac||{}).create=function(){var e=null,t=null,r=null,i=null,a={start:function(a,o){if(null!==a)if("string"==typeof a){if(!((a=a.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+a+'"');t=n.md.algorithms[a].create()}else t=a;if(null===o)o=e;else{if("string"==typeof o)o=n.util.createBuffer(o);else if(n.util.isArray(o)){var s=o;o=n.util.createBuffer();for(var u=0;ut.blockLength&&(t.start(),t.update(o.bytes()),o=t.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),c=o.length();for(u=0;u{var n,i=r(3832);e.exports=i.jsbn=i.jsbn||{};function a(e,t,r){this.data=[],null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function o(){return new a(null)}function s(e,t,r,n,i,a){for(var o=16383&t,s=t>>14;--a>=0;){var u=16383&this.data[e],c=this.data[e++]>>14,l=s*u+c*o;i=((u=o*u+((16383&l)<<14)+r.data[n]+i)>>28)+(l>>14)+s*c,r.data[n++]=268435455&u}return i}i.jsbn.BigInteger=a,"undefined"==typeof navigator?(a.prototype.am=s,n=28):"Microsoft Internet Explorer"==navigator.appName?(a.prototype.am=function(e,t,r,n,i,a){for(var o=32767&t,s=t>>15;--a>=0;){var u=32767&this.data[e],c=this.data[e++]>>15,l=s*u+c*o;i=((u=o*u+((32767&l)<<15)+r.data[n]+(1073741823&i))>>>30)+(l>>>15)+s*c+(i>>>30),r.data[n++]=1073741823&u}return i},n=30):"Netscape"!=navigator.appName?(a.prototype.am=function(e,t,r,n,i,a){for(;--a>=0;){var o=t*this.data[e++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=67108863&o}return i},n=26):(a.prototype.am=s,n=28),a.prototype.DB=n,a.prototype.DM=(1<>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function y(e){this.m=e}function v(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function C(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function w(){}function T(e){return e}function A(e){this.r2=o(),this.q3=o(),a.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}y.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},y.prototype.revert=function(e){return e},y.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},v.prototype.convert=function(e){var t=o();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(a.ZERO)>0&&this.m.subTo(t,t),t},v.prototype.revert=function(e){var t=o();return e.copyTo(t),this.reduce(t),t},v.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},v.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},a.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},a.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},a.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,o=0;--n>=0;){var s=8==r?255&e[n]:h(e,n);s<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==o?this.data[this.t++]=s:o+r>this.DB?(this.data[this.t-1]|=(s&(1<>this.DB-o):this.data[this.t-1]|=s<=this.DB&&(o-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,o>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==e;)--this.t},a.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},a.prototype.drShiftTo=function(e,t){for(var r=e;r=0;--r)t.data[r+o+1]=this.data[r]>>i|s,s=(this.data[r]&a)<=0;--r)t.data[r]=0;t.data[o]=s,t.t=this.t+o+1,t.s=this.s,t.clamp()},a.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,a=(1<>n;for(var o=r+1;o>n;n>0&&(t.data[this.t-r-1]|=(this.s&a)<>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp()},a.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t.data[i]=0;for(i=0;i=0;)e.data[r]=0;for(r=0;r=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},a.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t0?(n.lShiftTo(l,s),i.lShiftTo(l,r)):(n.copyTo(s),i.copyTo(r));var f=s.t,h=s.data[f-1];if(0!=h){var p=h*(1<1?s.data[f-2]>>this.F2:0),y=this.FV/p,v=(1<=0&&(r.data[r.t++]=1,r.subTo(E,r)),a.ONE.dlShiftTo(f,E),E.subTo(s,s);s.t=0;){var S=r.data[--m]==h?this.DM:Math.floor(r.data[m]*y+(r.data[m-1]+g)*v);if((r.data[m]+=s.am(0,S,r,b,0,f))0&&r.rShiftTo(l,r),u<0&&a.ZERO.subTo(r,r)}}},a.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},a.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},a.prototype.exp=function(e,t){if(e>4294967295||e<1)return a.ONE;var r=o(),n=o(),i=t.convert(this),s=d(e)-1;for(i.copyTo(r);--s>=0;)if(t.sqrTo(r,n),(e&1<0)t.mulTo(n,i,r);else{var u=r;r=n,n=u}return t.revert(r)},a.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<0)for(s>s)>0&&(i=!0,a=f(r));o>=0;)s>(s+=this.DB-t)):(r=this.data[o]>>(s-=t)&n,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=f(r));return i?a:"0"},a.prototype.negate=function(){var e=o();return a.ZERO.subTo(this,e),e},a.prototype.abs=function(){return this.s<0?this.negate():this},a.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0},a.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+d(this.data[this.t-1]^this.s&this.DM)},a.prototype.mod=function(e){var t=o();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(a.ZERO)>0&&e.subTo(t,t),t},a.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new y(t):new v(t),this.exp(e,r)},a.ZERO=p(0),a.ONE=p(1),w.prototype.convert=T,w.prototype.revert=T,w.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},w.prototype.sqrTo=function(e,t){e.squareTo(t)},A.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=o();return e.copyTo(t),this.reduce(t),t},A.prototype.revert=function(e){return e},A.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},A.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},A.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var I=[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],k=(1<<26)/I[I.length-1];a.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},a.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=p(r),i=o(),a=o(),s="";for(this.divRemTo(n,i,a);i.signum()>0;)s=(r+a.intValue()).toString(e).substr(1)+s,i.divRemTo(n,i,a);return a.intValue().toString(e)+s},a.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,o=0,s=0,u=0;u=r&&(this.dMultiply(n),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(s,0)),i&&a.ZERO.subTo(this,this)},a.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(a.ONE.shiftLeft(e-1),m,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(a.ONE.shiftLeft(e-1),this);else{var n=new Array,i=7&e;n.length=1+(e>>3),t.nextBytes(n),i>0?n[0]&=(1<>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp()},a.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},a.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},a.prototype.multiplyLowerTo=function(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(n=r.t-this.t;i=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n0)if(0==t)r=this.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r},a.prototype.millerRabin=function(e){var t=this.subtract(a.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n,i=t.shiftRight(r),o={nextBytes:function(e){for(var t=0;t=0);var u=n.modPow(i,this);if(0!=u.compareTo(a.ONE)&&0!=u.compareTo(t)){for(var c=1;c++>24},a.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},a.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},a.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<=0;)n<8?(r=(this.data[e]&(1<>(n+=this.DB-8)):(r=this.data[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},a.prototype.equals=function(e){return 0==this.compareTo(e)},a.prototype.min=function(e){return this.compareTo(e)<0?this:e},a.prototype.max=function(e){return this.compareTo(e)>0?this:e},a.prototype.and=function(e){var t=o();return this.bitwiseTo(e,g,t),t},a.prototype.or=function(e){var t=o();return this.bitwiseTo(e,m,t),t},a.prototype.xor=function(e){var t=o();return this.bitwiseTo(e,b,t),t},a.prototype.andNot=function(e){var t=o();return this.bitwiseTo(e,E,t),t},a.prototype.not=function(){for(var e=o(),t=0;t=this.t?0!=this.s:0!=(this.data[t]&1<1){var f=o();for(n.sqrTo(s[1],f);u<=l;)s[u]=o(),n.mulTo(f,s[u-2],s[u]),u+=2}var h,g,m=e.t-1,b=!0,E=o();for(i=d(e.data[m])-1;m>=0;){for(i>=c?h=e.data[m]>>i-c&l:(h=(e.data[m]&(1<0&&(h|=e.data[m-1]>>this.DB+i-c)),u=r;0==(1&h);)h>>=1,--u;if((i-=u)<0&&(i+=this.DB,--m),b)s[h].copyTo(a),b=!1;else{for(;u>1;)n.sqrTo(a,E),n.sqrTo(E,a),u-=2;u>0?n.sqrTo(a,E):(g=a,a=E,E=g),n.mulTo(E,s[h],a)}for(;m>=0&&0==(e.data[m]&1<=0?(r.subTo(n,r),t&&i.subTo(s,i),o.subTo(u,o)):(n.subTo(r,n),t&&s.subTo(i,s),u.subTo(o,u))}return 0!=n.compareTo(a.ONE)?a.ZERO:u.compareTo(e)>=0?u.subtract(e):u.signum()<0?(u.addTo(e,u),u.signum()<0?u.add(e):u):u},a.prototype.pow=function(e){return this.exp(e,new w)},a.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return t;for(i0&&(t.rShiftTo(a,t),r.rShiftTo(a,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r},a.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=I[I.length-1]){for(t=0;t{var n=r(3832);e.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},6971:(e,t,r)=>{var n=r(3832);r(3453),e.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1},3453:(e,t,r)=>{var n=r(3832);r(7116),n.mgf=n.mgf||{},(e.exports=n.mgf.mgf1=n.mgf1=n.mgf1||{}).create=function(e){return{generate:function(t,r){for(var i=new n.util.ByteBuffer,a=Math.ceil(r/e.digestLength),o=0;o{var n=r(3832);n.pki=n.pki||{};var i=e.exports=n.pki.oids=n.oids=n.oids||{};function a(e,t){i[e]=t,i[t]=e}function o(e,t){i[e]=t}a("1.2.840.113549.1.1.1","rsaEncryption"),a("1.2.840.113549.1.1.4","md5WithRSAEncryption"),a("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),a("1.2.840.113549.1.1.7","RSAES-OAEP"),a("1.2.840.113549.1.1.8","mgf1"),a("1.2.840.113549.1.1.9","pSpecified"),a("1.2.840.113549.1.1.10","RSASSA-PSS"),a("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),a("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),a("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),a("1.3.101.112","EdDSA25519"),a("1.2.840.10040.4.3","dsa-with-sha1"),a("1.3.14.3.2.7","desCBC"),a("1.3.14.3.2.26","sha1"),a("2.16.840.1.101.3.4.2.1","sha256"),a("2.16.840.1.101.3.4.2.2","sha384"),a("2.16.840.1.101.3.4.2.3","sha512"),a("1.2.840.113549.2.5","md5"),a("1.2.840.113549.1.7.1","data"),a("1.2.840.113549.1.7.2","signedData"),a("1.2.840.113549.1.7.3","envelopedData"),a("1.2.840.113549.1.7.4","signedAndEnvelopedData"),a("1.2.840.113549.1.7.5","digestedData"),a("1.2.840.113549.1.7.6","encryptedData"),a("1.2.840.113549.1.9.1","emailAddress"),a("1.2.840.113549.1.9.2","unstructuredName"),a("1.2.840.113549.1.9.3","contentType"),a("1.2.840.113549.1.9.4","messageDigest"),a("1.2.840.113549.1.9.5","signingTime"),a("1.2.840.113549.1.9.6","counterSignature"),a("1.2.840.113549.1.9.7","challengePassword"),a("1.2.840.113549.1.9.8","unstructuredAddress"),a("1.2.840.113549.1.9.14","extensionRequest"),a("1.2.840.113549.1.9.20","friendlyName"),a("1.2.840.113549.1.9.21","localKeyId"),a("1.2.840.113549.1.9.22.1","x509Certificate"),a("1.2.840.113549.1.12.10.1.1","keyBag"),a("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),a("1.2.840.113549.1.12.10.1.3","certBag"),a("1.2.840.113549.1.12.10.1.4","crlBag"),a("1.2.840.113549.1.12.10.1.5","secretBag"),a("1.2.840.113549.1.12.10.1.6","safeContentsBag"),a("1.2.840.113549.1.5.13","pkcs5PBES2"),a("1.2.840.113549.1.5.12","pkcs5PBKDF2"),a("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),a("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),a("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),a("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),a("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),a("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),a("1.2.840.113549.2.7","hmacWithSHA1"),a("1.2.840.113549.2.8","hmacWithSHA224"),a("1.2.840.113549.2.9","hmacWithSHA256"),a("1.2.840.113549.2.10","hmacWithSHA384"),a("1.2.840.113549.2.11","hmacWithSHA512"),a("1.2.840.113549.3.7","des-EDE3-CBC"),a("2.16.840.1.101.3.4.1.2","aes128-CBC"),a("2.16.840.1.101.3.4.1.22","aes192-CBC"),a("2.16.840.1.101.3.4.1.42","aes256-CBC"),a("2.5.4.3","commonName"),a("2.5.4.5","serialName"),a("2.5.4.6","countryName"),a("2.5.4.7","localityName"),a("2.5.4.8","stateOrProvinceName"),a("2.5.4.9","streetAddress"),a("2.5.4.10","organizationName"),a("2.5.4.11","organizationalUnitName"),a("2.5.4.13","description"),a("2.5.4.15","businessCategory"),a("2.5.4.17","postalCode"),a("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),a("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),a("2.16.840.1.113730.1.1","nsCertType"),a("2.16.840.1.113730.1.13","nsComment"),o("2.5.29.1","authorityKeyIdentifier"),o("2.5.29.2","keyAttributes"),o("2.5.29.3","certificatePolicies"),o("2.5.29.4","keyUsageRestriction"),o("2.5.29.5","policyMapping"),o("2.5.29.6","subtreesConstraint"),o("2.5.29.7","subjectAltName"),o("2.5.29.8","issuerAltName"),o("2.5.29.9","subjectDirectoryAttributes"),o("2.5.29.10","basicConstraints"),o("2.5.29.11","nameConstraints"),o("2.5.29.12","policyConstraints"),o("2.5.29.13","basicConstraints"),a("2.5.29.14","subjectKeyIdentifier"),a("2.5.29.15","keyUsage"),o("2.5.29.16","privateKeyUsagePeriod"),a("2.5.29.17","subjectAltName"),a("2.5.29.18","issuerAltName"),a("2.5.29.19","basicConstraints"),o("2.5.29.20","cRLNumber"),o("2.5.29.21","cRLReason"),o("2.5.29.22","expirationDate"),o("2.5.29.23","instructionCode"),o("2.5.29.24","invalidityDate"),o("2.5.29.25","cRLDistributionPoints"),o("2.5.29.26","issuingDistributionPoint"),o("2.5.29.27","deltaCRLIndicator"),o("2.5.29.28","issuingDistributionPoint"),o("2.5.29.29","certificateIssuer"),o("2.5.29.30","nameConstraints"),a("2.5.29.31","cRLDistributionPoints"),a("2.5.29.32","certificatePolicies"),o("2.5.29.33","policyMappings"),o("2.5.29.34","policyConstraints"),a("2.5.29.35","authorityKeyIdentifier"),o("2.5.29.36","policyConstraints"),a("2.5.29.37","extKeyUsage"),o("2.5.29.46","freshestCRL"),o("2.5.29.54","inhibitAnyPolicy"),a("1.3.6.1.4.1.11129.2.4.2","timestampList"),a("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),a("1.3.6.1.5.5.7.3.1","serverAuth"),a("1.3.6.1.5.5.7.3.2","clientAuth"),a("1.3.6.1.5.5.7.3.3","codeSigning"),a("1.3.6.1.5.5.7.3.4","emailProtection"),a("1.3.6.1.5.5.7.3.8","timeStamping")},7450:(e,t,r)=>{var n=r(3832);if(r(8925),r(3068),r(3480),r(8991),r(6270),r(8960),r(6953),r(9563),r(9372),r(8095),r(7116),void 0===i)var i=n.jsbn.BigInteger;var a=n.asn1,o=n.pki=n.pki||{};e.exports=o.pbe=n.pbe=n.pbe||{};var s=o.oids,u={name:"EncryptedPrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},c={name:"PBES2Algorithms",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},l={name:"pkcs-12PbeParams",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"iterations"}]};function f(e,t){return e.start().update(t).digest().getBytes()}function h(e){var t;if(e){if(!(t=o.oids[a.derToOid(e)])){var r=new Error("Unsupported PRF OID.");throw r.oid=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else t="hmacWithSHA1";return p(t)}function p(e){var t=n.md;switch(e){case"hmacWithSHA224":t=n.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}o.encryptPrivateKeyInfo=function(e,t,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var i,u,c,l=n.random.getBytesSync(r.saltSize),f=r.count,h=a.integerToDer(f);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var d,y,v;switch(r.algorithm){case"aes128":i=16,d=16,y=s["aes128-CBC"],v=n.aes.createEncryptionCipher;break;case"aes192":i=24,d=16,y=s["aes192-CBC"],v=n.aes.createEncryptionCipher;break;case"aes256":i=32,d=16,y=s["aes256-CBC"],v=n.aes.createEncryptionCipher;break;case"des":i=8,d=8,y=s.desCBC,v=n.des.createEncryptionCipher;break;default:throw(C=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,C}var g="hmacWith"+r.prfAlgorithm.toUpperCase(),m=p(g),b=n.pkcs5.pbkdf2(t,l,f,i,m),E=n.random.getBytesSync(d);(w=v(b)).start(E),w.update(a.toDer(e)),w.finish(),c=w.output.getBytes();var S=function(e,t,r,i){var s=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,e),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,t.getBytes())]);"hmacWithSHA1"!==i&&s.value.push(a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,n.util.hexToBytes(r.toString(16))),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(o.oids[i]).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]));return s}(l,h,i,g);u=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(s.pkcs5PBES2).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(s.pkcs5PBKDF2).getBytes()),S]),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(y).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,E)])])])}else{var C;if("3des"!==r.algorithm)throw(C=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,C;i=24;var w,T=new n.util.ByteBuffer(l);b=o.pbe.generatePkcs12Key(t,T,1,f,i),E=o.pbe.generatePkcs12Key(t,T,2,f,i);(w=n.des.createEncryptionCipher(b)).start(E),w.update(a.toDer(e)),w.finish(),c=w.output.getBytes(),u=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(s["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,l),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,h.getBytes())])])}return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[u,a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,c)])},o.decryptPrivateKeyInfo=function(e,t){var r=null,i={},s=[];if(!a.validate(e,u,i,s)){var c=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw c.errors=s,c}var l=a.derToOid(i.encryptionOid),f=o.pbe.getCipher(l,i.encryptionParams,t),h=n.util.createBuffer(i.encryptedData);return f.update(h),f.finish()&&(r=a.fromDer(f.output)),r},o.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:a.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})},o.encryptedPrivateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==t.type){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return a.fromDer(t.body)},o.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var i=o.wrapRsaPrivateKey(o.privateKeyToAsn1(e));return i=o.encryptPrivateKeyInfo(i,t,r),o.encryptedPrivateKeyToPem(i)}var s,u,c,l;switch(r.algorithm){case"aes128":s="AES-128-CBC",c=16,u=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"aes192":s="AES-192-CBC",c=24,u=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"aes256":s="AES-256-CBC",c=32,u=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"3des":s="DES-EDE3-CBC",c=24,u=n.random.getBytesSync(8),l=n.des.createEncryptionCipher;break;case"des":s="DES-CBC",c=8,u=n.random.getBytesSync(8),l=n.des.createEncryptionCipher;break;default:var f=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw f.algorithm=r.algorithm,f}var h=l(n.pbe.opensslDeriveBytes(t,u.substr(0,8),c));h.start(u),h.update(a.toDer(o.privateKeyToAsn1(e))),h.finish();var p={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:s,parameters:n.util.bytesToHex(u).toUpperCase()},body:h.output.getBytes()};return n.pem.encode(p)},o.decryptRsaPrivateKey=function(e,t){var r=null,i=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==i.type&&"PRIVATE KEY"!==i.type&&"RSA PRIVATE KEY"!==i.type)throw(c=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=c,c;if(i.procType&&"ENCRYPTED"===i.procType.type){var s,u;switch(i.dekInfo.algorithm){case"DES-CBC":s=8,u=n.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,u=n.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,u=n.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,u=n.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,u=n.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,u=function(e){return n.rc2.createDecryptionCipher(e,40)};break;case"RC2-64-CBC":s=8,u=function(e){return n.rc2.createDecryptionCipher(e,64)};break;case"RC2-128-CBC":s=16,u=function(e){return n.rc2.createDecryptionCipher(e,128)};break;default:var c;throw(c=new Error('Could not decrypt private key; unsupported encryption algorithm "'+i.dekInfo.algorithm+'".')).algorithm=i.dekInfo.algorithm,c}var l=n.util.hexToBytes(i.dekInfo.parameters),f=u(n.pbe.opensslDeriveBytes(t,l.substr(0,8),s));if(f.start(l),f.update(n.util.createBuffer(i.body)),!f.finish())return r;r=f.output.getBytes()}else r=i.body;return null!==(r="ENCRYPTED PRIVATE KEY"===i.type?o.decryptPrivateKeyInfo(a.fromDer(r),t):a.fromDer(r))&&(r=o.privateKeyFromAsn1(r)),r},o.pbe.generatePkcs12Key=function(e,t,r,i,a,o){var s,u;if(null==o){if(!("sha1"in n.md))throw new Error('"sha1" hash algorithm unavailable.');o=n.md.sha1.create()}var c=o.digestLength,l=o.blockLength,f=new n.util.ByteBuffer,h=new n.util.ByteBuffer;if(null!=e){for(u=0;u=0;u--)B>>=8,B+=A.at(u)+_.at(u),_.setAt(u,255&B);k.putBuffer(_)}E=k,f.putBuffer(w)}return f.truncate(f.length()-a),f},o.pbe.getCipher=function(e,t,r){switch(e){case o.oids.pkcs5PBES2:return o.pbe.getCipherForPBES2(e,t,r);case o.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case o.oids["pbewithSHAAnd40BitRC2-CBC"]:return o.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},o.pbe.getCipherForPBES2=function(e,t,r){var i,s={},u=[];if(!a.validate(t,c,s,u))throw(i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=u,i;if((e=a.derToOid(s.kdfOid))!==o.oids.pkcs5PBKDF2)throw(i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,i.supportedOids=["pkcs5PBKDF2"],i;if((e=a.derToOid(s.encOid))!==o.oids["aes128-CBC"]&&e!==o.oids["aes192-CBC"]&&e!==o.oids["aes256-CBC"]&&e!==o.oids["des-EDE3-CBC"]&&e!==o.oids.desCBC)throw(i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i;var l,f,p=s.kdfSalt,d=n.util.createBuffer(s.kdfIterationCount);switch(d=d.getInt(d.length()<<3),o.oids[e]){case"aes128-CBC":l=16,f=n.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,f=n.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,f=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,f=n.des.createDecryptionCipher;break;case"desCBC":l=8,f=n.des.createDecryptionCipher}var y=h(s.prfOid),v=n.pkcs5.pbkdf2(r,p,d,l,y),g=s.encIv,m=f(v);return m.start(g),m},o.pbe.getCipherForPKCS12PBE=function(e,t,r){var i={},s=[];if(!a.validate(t,l,i,s))throw(y=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=s,y;var u,c,f,p=n.util.createBuffer(i.salt),d=n.util.createBuffer(i.iterations);switch(d=d.getInt(d.length()<<3),e){case o.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,c=8,f=n.des.startDecrypting;break;case o.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,c=8,f=function(e,t){var r=n.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var y;throw(y=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,y}var v=h(i.prfOid),g=o.pbe.generatePkcs12Key(r,p,1,d,u,v);return v.start(),f(g,o.pbe.generatePkcs12Key(r,p,2,d,c,v))},o.pbe.opensslDeriveBytes=function(e,t,r,i){if(null==i){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');i=n.md.md5.create()}null===t&&(t="");for(var a=[f(i,e+t)],o=16,s=1;o{var n=r(3832);r(6607),r(8991),r(7116);var i,a=n.pkcs5=n.pkcs5||{};n.util.isNodejs&&!n.options.usePureJavaScript&&(i=r(5819)),e.exports=n.pbkdf2=a.pbkdf2=function(e,t,r,a,o,s){if("function"==typeof o&&(s=o,o=null),n.util.isNodejs&&!n.options.usePureJavaScript&&i.pbkdf2&&(null===o||"object"!=typeof o)&&(i.pbkdf2Sync.length>4||!o||"sha1"===o))return"string"!=typeof o&&(o="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),s?4===i.pbkdf2Sync.length?i.pbkdf2(e,t,r,a,(function(e,t){if(e)return s(e);s(null,t.toString("binary"))})):i.pbkdf2(e,t,r,a,o,(function(e,t){if(e)return s(e);s(null,t.toString("binary"))})):4===i.pbkdf2Sync.length?i.pbkdf2Sync(e,t,r,a).toString("binary"):i.pbkdf2Sync(e,t,r,a,o).toString("binary");if(null==o&&(o="sha1"),"string"==typeof o){if(!(o in n.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=n.md[o].create()}var u=o.digestLength;if(a>4294967295*u){var c=new Error("Derived key is too long.");if(s)return s(c);throw c}var l=Math.ceil(a/u),f=a-(l-1)*u,h=n.hmac.create();h.start(o,e);var p,d,y,v="";if(!s){for(var g=1;g<=l;++g){h.start(null,null),h.update(t),h.update(n.util.int32ToBytes(g)),p=y=h.digest().getBytes();for(var m=2;m<=r;++m)h.start(null,null),h.update(y),d=h.digest().getBytes(),p=n.util.xorBytes(p,d,u),y=d;v+=gl)return s(null,v);h.start(null,null),h.update(t),h.update(n.util.int32ToBytes(g)),p=y=h.digest().getBytes(),m=2,E()}function E(){if(m<=r)return h.start(null,null),h.update(y),d=h.digest().getBytes(),p=n.util.xorBytes(p,d,u),y=d,++m,n.util.setImmediate(E);v+=g{var n=r(3832);r(7116);var i=e.exports=n.pem=n.pem||{};function a(e){for(var t=e.name+": ",r=[],n=function(e,t){return" "+t},i=0;i65&&-1!==o){var s=t[o];","===s?(++o,t=t.substr(0,o)+"\r\n "+t.substr(o)):t=t.substr(0,o)+"\r\n"+s+t.substr(o+1),a=i-o-1,o=-1,++i}else" "!==t[i]&&"\t"!==t[i]&&","!==t[i]||(o=i);return t}function o(e){return e.replace(/^\s+/,"")}i.encode=function(e,t){t=t||{};var r,i="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(i+=a(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(i+=a(r={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),i+=a(r)),e.headers)for(var o=0;o{var n=r(3832);r(7116),r(9563),r(137);var i=e.exports=n.pkcs1=n.pkcs1||{};function a(e,t,r){r||(r=n.md.sha1.create());for(var i="",a=Math.ceil(t/r.digestLength),o=0;o>24&255,o>>16&255,o>>8&255,255&o);r.start(),r.update(e+s),i+=r.digest().getBytes()}return i.substring(0,t)}i.encode_rsa_oaep=function(e,t,r){var i,o,s,u;"string"==typeof r?(i=r,o=arguments[3]||void 0,s=arguments[4]||void 0):r&&(i=r.label||void 0,o=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(u=r.mgf1.md)),s?s.start():s=n.md.sha1.create(),u||(u=s);var c=Math.ceil(e.n.bitLength()/8),l=c-2*s.digestLength-2;if(t.length>l)throw(v=new Error("RSAES-OAEP input message length is too long.")).length=t.length,v.maxLength=l,v;i||(i=""),s.update(i,"raw");for(var f=s.digest(),h="",p=l-t.length,d=0;d{var n=r(3832);r(3068),r(6607),r(6270),r(5496),r(7450),r(9563),r(8095),r(137),r(7116),r(5414);var i=n.asn1,a=n.pki,o=e.exports=n.pkcs12=n.pkcs12||{},s={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},u={name:"PFX",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},s,{name:"PFX.macData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},c={name:"SafeBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},l={name:"Attribute",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,capture:"values"}]},f={name:"CertBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:i.Class.UNIVERSAL,type:i.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function h(e,t,r,n){for(var i=[],a=0;a=0&&i.push(s):i.push(s))}return i}function p(e){if(e.composed||e.constructed){for(var t=n.util.createBuffer(),r=0;r0&&(u=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,f));var h=[],p=[];null!==t&&(p=n.util.isArray(t)?t:[t]);for(var d=[],y=0;y0){var b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,d),E=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(b).getBytes())])]);h.push(E)}var S=null;if(null!==e){var C=a.wrapRsaPrivateKey(a.privateKeyToAsn1(e));S=null===r?i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.keyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[C]),u]):i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.pkcs8ShroudedKeyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[a.encryptPrivateKeyInfo(C,r,s)]),u]);var w=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[S]),T=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(w).getBytes())])]);h.push(T)}var A,I=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,h);if(s.useMac){var k=n.md.sha1.create(),_=new n.util.ByteBuffer(n.random.getBytes(s.saltSize)),B=s.count,N=(e=o.generateKey(r,_,3,B,20),n.hmac.create());N.start(k,e),N.update(i.toDer(I).getBytes());var O=N.getMac();A=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.sha1).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,O.getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,_.getBytes()),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(B).getBytes())])}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(3).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(I).getBytes())])]),A])},o.generateKey=n.pbe.generatePkcs12Key},9437:(e,t,r)=>{var n=r(3832);r(8925),r(3068),r(3480),r(6270),r(6953),r(5496),r(9563),r(7116),r(5414);var i=n.asn1,a=e.exports=n.pkcs7=n.pkcs7||{};function o(e){var t={},r=[];if(!i.validate(e,a.asn1.recipientInfoValidator,t,r)){var o=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw o.errors=r,o}return{version:t.version.charCodeAt(0),issuer:n.pki.RDNAttributesAsArray(t.issuer),serialNumber:n.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:i.derToOid(t.encAlgorithm),parameter:t.encParameter.value,content:t.encKey}}}function s(e){for(var t,r=[],a=0;a0){for(var r=i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[]),a=0;a=r&&o0&&o.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,t)),a.length>0&&o.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,a)),o.value[0].value.push(i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.signerInfos)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),o])},addSigner:function(t){var r=t.issuer,i=t.serialNumber;if(t.certificate){var a=t.certificate;"string"==typeof a&&(a=n.pki.certificateFromPem(a)),r=a.issuer.attributes,i=a.serialNumber}var o=t.key;if(!o)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof o&&(o=n.pki.privateKeyFromPem(o));var s=t.digestAlgorithm||n.pki.oids.sha1;switch(s){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+s)}var u=t.authenticatedAttributes||[];if(u.length>0){for(var c=!1,l=!1,f=0;f{var n=r(3832);r(3068),r(7116);var i=n.asn1,a=e.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=a;var o={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};a.contentInfoValidator=o;var s={name:"EncryptedContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};a.envelopedDataValidator={name:"EnvelopedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(s)},a.encryptedDataValidator={name:"EncryptedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"}].concat(s)};var u={name:"SignerInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};a.signedDataValidator={name:"SignedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},o,{name:"SignedData.Certificates",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,capture:"signerInfos",optional:!0,value:[u]}]},a.recipientInfoValidator={name:"RecipientInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},4742:(e,t,r)=>{var n=r(3832);r(3068),r(6270),r(7450),r(6953),r(8960),r(5147),r(6007),r(8095),r(7116),r(5414);var i=n.asn1,a=e.exports=n.pki=n.pki||{};a.pemToDer=function(e){var t=n.pem.decode(e)[0];if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PEM to DER; PEM is encrypted.");return n.util.createBuffer(t.body)},a.privateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("PRIVATE KEY"!==t.type&&"RSA PRIVATE KEY"!==t.type){var r=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert private key from PEM; PEM is encrypted.");var o=i.fromDer(t.body);return a.privateKeyFromAsn1(o)},a.privateKeyToPem=function(e,t){var r={type:"RSA PRIVATE KEY",body:i.toDer(a.privateKeyToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.privateKeyInfoToPem=function(e,t){var r={type:"PRIVATE KEY",body:i.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})}},9654:(e,t,r)=>{var n=r(3832);r(7116),r(5764),r(9563),function(){if(n.prime)e.exports=n.prime;else{var t=e.exports=n.prime=n.prime||{},r=n.jsbn.BigInteger,i=[6,4,2,4,2,4,6,2],a=new r(null);a.fromInt(30);var o=function(e,t){return e|t};t.generateProbablePrime=function(e,t,i){"function"==typeof t&&(i=t,t={});var a=(t=t||{}).algorithm||"PRIMEINC";"string"==typeof a&&(a={name:a}),a.options=a.options||{};var o=t.prng||n.random,u={nextBytes:function(e){for(var t=o.getBytesSync(e.length),r=0;re&&(o=c(e,t));var p=o.toString(16);i.target.postMessage({hex:p,workLoad:l}),o.dAddOffset(f,0)}}}p()}(e,t,i,a);return s(e,t,i,a)}(e,u,a.options,i);throw new Error("Invalid prime generation algorithm: "+a.name)}}function s(e,t,r,n){var i=c(e,t),a=function(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}(i.bitLength());"millerRabinTests"in r&&(a=r.millerRabinTests);var o=10;"maxBlockTime"in r&&(o=r.maxBlockTime),u(i,e,t,0,a,o,n)}function u(e,t,r,a,o,s,l){var f=+new Date;do{if(e.bitLength()>t&&(e=c(t,r)),e.isProbablePrime(o))return l(null,e);e.dAddOffset(i[a++%8],0)}while(s<0||+new Date-f{var n=r(3832);r(7116);var i=null;!n.util.isNodejs||n.options.usePureJavaScript||process.versions["node-webkit"]||(i=r(5819)),(e.exports=n.prng=n.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,a=new Array(32),o=0;o<32;++o)a[o]=r.create();function s(){if(t.pools[0].messageLength>=32)return u();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),u()}function u(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,n=0;n<32;++n)t.reseeds%r==0&&(e.update(t.pools[n].digest().getBytes()),t.pools[n].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var i=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(i),t.generated=0}function c(e){var t=null,r=n.util.globalScope,i=r.crypto||r.msCrypto;i&&i.getRandomValues&&(t=function(e){return i.getRandomValues(e)});var a=n.util.createBuffer();if(t)for(;a.length()>16)))<<16,h=4294967295&(l=(2147483647&(l+=c>>15))+(l>>31));for(u=0;u<3;++u)f=h>>>(u<<3),f^=Math.floor(256*Math.random()),a.putByte(String.fromCharCode(255&f))}return a.getBytes(e)}return t.pools=a,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var i=t.plugin.cipher,a=t.plugin.increment,o=t.plugin.formatKey,s=t.plugin.formatSeed,c=n.util.createBuffer();t.key=null,function l(f){if(f)return r(f);if(c.length()>=e)return r(null,c.getBytes(e));t.generated>1048575&&(t.key=null);if(null===t.key)return n.util.nextTick((function(){!function(e){if(t.pools[0].messageLength>=32)return u(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,(function(r,n){if(r)return e(r);t.collect(n),u(),e()}))}(l)}));var h=i(t.key,t.seed);t.generated+=h.length,c.putBytes(h),t.key=o(i(t.key,a(t.seed))),t.seed=s(i(t.key,t.seed)),n.util.setImmediate(l)}()},t.generateSync=function(e){var r=t.plugin.cipher,i=t.plugin.increment,a=t.plugin.formatKey,o=t.plugin.formatSeed;t.key=null;for(var u=n.util.createBuffer();u.length()1048575&&(t.key=null),null===t.key&&s();var c=r(t.key,t.seed);t.generated+=c.length,u.putBytes(c),t.key=a(r(t.key,i(t.seed))),t.seed=o(r(t.key,t.seed))}return u.getBytes(e)},i?(t.seedFile=function(e,t){i.randomBytes(e,(function(e,r){if(e)return t(e);t(null,r.toString())}))},t.seedFileSync=function(e){return i.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,c(e))}catch(e){t(e)}},t.seedFileSync=c),t.collect=function(e){for(var r=e.length,n=0;n>i&255);t.collect(n)},t.registerWorker=function(e){if(e===self)t.seedFile=function(e,t){self.addEventListener("message",(function e(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",e),t(n.forge.prng.err,n.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:e}}})};else{e.addEventListener("message",(function(r){var n=r.data;n.forge&&n.forge.prng&&t.seedFile(n.forge.prng.needed,(function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})}))}))}},t}},6007:(e,t,r)=>{var n=r(3832);r(9563),r(7116),(e.exports=n.pss=n.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,i=e.mgf,a=r.digestLength,o=e.salt||null;if("string"==typeof o&&(o=n.util.createBuffer(o)),"saltLength"in e)t=e.saltLength;else{if(null===o)throw new Error("Salt length not specified or specific salt not given.");t=o.length()}if(null!==o&&o.length()!==t)throw new Error("Given salt length does not match length of given salt.");var s=e.prng||n.random,u={encode:function(e,u){var c,l,f=u-1,h=Math.ceil(f/8),p=e.digest().getBytes();if(h>8*h-f&255;return(E=String.fromCharCode(E.charCodeAt(0)&~S)+E.substr(1))+y+String.fromCharCode(188)},verify:function(e,o,s){var u,c=s-1,l=Math.ceil(c/8);if(o=o.substr(-l),l>8*l-c&255;if(0!=(h.charCodeAt(0)&d))throw new Error("Bits beyond keysize not zero as expected.");var y=i.generate(p,f),v="";for(u=0;u{var n=r(3832);r(8925),r(1668),r(4933),r(7116),n.random&&n.random.getBytes?e.exports=n.random:function(t){var r={},i=new Array(4),a=n.util.createBuffer();function o(){var e=n.prng.create(r);return e.getBytes=function(t,r){return e.generate(t,r)},e.getBytesSync=function(t){return e.generate(t)},e}r.formatKey=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),n.aes._expandKey(e,!1)},r.formatSeed=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),e},r.cipher=function(e,t){return n.aes._updateBlock(e,t,i,!1),a.putInt32(i[0]),a.putInt32(i[1]),a.putInt32(i[2]),a.putInt32(i[3]),a.getBytes()},r.increment=function(e){return++e[3],e},r.md=n.md.sha256;var s=o(),u=null,c=n.util.globalScope,l=c.crypto||c.msCrypto;if(l&&l.getRandomValues&&(u=function(e){return l.getRandomValues(e)}),n.options.usePureJavaScript||!n.util.isNodejs&&!u){if("undefined"==typeof window||window.document,s.collectInt(+new Date,32),"undefined"!=typeof navigator){var f="";for(var h in navigator)try{"string"==typeof navigator[h]&&(f+=navigator[h])}catch(e){}s.collect(f),f=null}t&&(t().mousemove((function(e){s.collectInt(e.clientX,16),s.collectInt(e.clientY,16)})),t().keypress((function(e){s.collectInt(e.charCode,8)})))}if(n.random)for(var h in s)n.random[h]=s[h];else n.random=s;n.random.createInstance=o,e.exports=n.random}("undefined"!=typeof jQuery?jQuery:null)},9372:(e,t,r)=>{var n=r(3832);r(7116);var i=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],a=[1,2,3,5],o=function(e,t){return e<>16-t},s=function(e,t){return(65535&e)>>t|e<<16-t&65535};e.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(e,t){"string"==typeof e&&(e=n.util.createBuffer(e)),t=t||128;var r,a=e,o=e.length(),s=t,u=Math.ceil(s/8),c=255>>(7&s);for(r=o;r<128;r++)a.putByte(i[a.at(r-1)+a.at(r-o)&255]);for(a.setAt(128-u,i[a.at(128-u)&c]),r=127-u;r>=0;r--)a.setAt(r,i[a.at(r+1)^a.at(r+u)]);return a};var u=function(e,t,r){var i,u,c,l,f=!1,h=null,p=null,d=null,y=[];for(e=n.rc2.expandKey(e,t),c=0;c<64;c++)y.push(e.getInt16Le());r?(i=function(e){for(c=0;c<4;c++)e[c]+=y[l]+(e[(c+3)%4]&e[(c+2)%4])+(~e[(c+3)%4]&e[(c+1)%4]),e[c]=o(e[c],a[c]),l++},u=function(e){for(c=0;c<4;c++)e[c]+=y[63&e[(c+3)%4]]}):(i=function(e){for(c=3;c>=0;c--)e[c]=s(e[c],a[c]),e[c]-=y[l]+(e[(c+3)%4]&e[(c+2)%4])+(~e[(c+3)%4]&e[(c+1)%4]),l--},u=function(e){for(c=3;c>=0;c--)e[c]-=y[63&e[(c+3)%4]]});var v=function(e){var t=[];for(c=0;c<4;c++){var n=h.getInt16Le();null!==d&&(r?n^=d.getInt16Le():d.putInt16Le(n)),t.push(65535&n)}l=r?0:63;for(var i=0;i=8;)v([[5,i],[1,u],[6,i],[1,u],[5,i]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,h,!r);else{var n=8===h.length()?8:8-h.length();h.fillWithByte(n,n)}if(t&&(f=!0,g.update()),!r&&(t=0===h.length()))if(e)t=e(8,p,!r);else{var i=p.length(),a=p.at(i-1);a>i?t=!1:p.truncate(a)}return t}}};n.rc2.startEncrypting=function(e,t,r){var i=n.rc2.createEncryptionCipher(e,128);return i.start(t,r),i},n.rc2.createEncryptionCipher=function(e,t){return u(e,t,!0)},n.rc2.startDecrypting=function(e,t,r){var i=n.rc2.createDecryptionCipher(e,128);return i.start(t,r),i},n.rc2.createDecryptionCipher=function(e,t){return u(e,t,!1)}},8095:(e,t,r)=>{var n=r(3832);if(r(3068),r(5764),r(6270),r(8936),r(9654),r(9563),r(7116),void 0===i)var i=n.jsbn.BigInteger;var a=n.util.isNodejs?r(5819):null,o=n.asn1,s=n.util;n.pki=n.pki||{},e.exports=n.pki.rsa=n.rsa=n.rsa||{};var u=n.pki,c=[6,4,2,4,2,4,6,2],l={name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},f={name:"RSAPrivateKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},h={name:"RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},p=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},d=function(e){var t;if(!(e.algorithm in u.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=u.oids[e.algorithm];var n=o.oidToDer(t).getBytes(),i=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]),a=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]);a.value.push(o.create(o.Class.UNIVERSAL,o.Type.OID,!1,n)),a.value.push(o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,""));var s=o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(a),i.value.push(s),o.toDer(i).getBytes()},y=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var a;t.dP||(t.dP=t.d.mod(t.p.subtract(i.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(i.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{a=new i(n.util.bytesToHex(n.random.getBytes(t.n.bitLength()/8)),16)}while(a.compareTo(t.n)>=0||!a.gcd(t.n).equals(i.ONE));for(var o=(e=e.multiply(a.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),s=e.mod(t.q).modPow(t.dQ,t.q);o.compareTo(s)<0;)o=o.add(t.p);var u=o.subtract(s).multiply(t.qInv).mod(t.p).multiply(t.q).add(s);return u=u.multiply(a.modInverse(t.n)).mod(t.n)};function v(e,t,r){var i=n.util.createBuffer(),a=Math.ceil(t.n.bitLength()/8);if(e.length>a-11){var o=new Error("Message is too long for PKCS#1 v1.5 padding.");throw o.length=e.length,o.max=a-11,o}i.putByte(0),i.putByte(r);var s,u=a-3-e.length;if(0===r||1===r){s=0===r?0:255;for(var c=0;c0;){var l=0,f=n.random.getBytes(u);for(c=0;c1;){if(255!==o.getByte()){--o.read;break}++c}else if(2===u)for(c=0;o.length()>1;){if(0===o.getByte()){--o.read;break}++c}if(0!==o.getByte()||c!==a-3-o.length())throw new Error("Encryption block is invalid.");return o.getBytes()}function m(e,t,r){"function"==typeof t&&(r=t,t={});var a={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function o(){s(e.pBits,(function(t,n){return t?r(t):(e.p=n,null!==e.q?c(t,e.q):void s(e.qBits,c))}))}function s(e,t){n.prime.generateProbablePrime(e,a,t)}function c(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var a=e.p;e.p=e.q,e.q=a}if(0!==e.p.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.p=null,void o();if(0!==e.q.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.q=null,void s(e.qBits,c);if(e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(i.ONE))return e.p=e.q=null,void o();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void s(e.qBits,c);var l=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,l,e.p,e.q,l.mod(e.p1),l.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"prng"in t&&(a.prng=t.prng),o()}function b(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=n.util.hexToBytes(t);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function E(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function S(e){return n.util.isNodejs&&"function"==typeof a[e]}function C(e){return void 0!==s.globalScope&&"object"==typeof s.globalScope.crypto&&"object"==typeof s.globalScope.crypto.subtle&&"function"==typeof s.globalScope.crypto.subtle[e]}function w(e){return void 0!==s.globalScope&&"object"==typeof s.globalScope.msCrypto&&"object"==typeof s.globalScope.msCrypto.subtle&&"function"==typeof s.globalScope.msCrypto.subtle[e]}function T(e){for(var t=n.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),i=0;i0;)l.putByte(0),--f;return l.putBytes(n.util.hexToBytes(c)),l.getBytes()},u.rsa.decrypt=function(e,t,r,a){var o=Math.ceil(t.n.bitLength()/8);if(e.length!==o){var s=new Error("Encrypted message length is invalid.");throw s.length=e.length,s.expected=o,s}var u=new i(n.util.createBuffer(e).toHex(),16);if(u.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var c=y(u,t,r).toString(16),l=n.util.createBuffer(),f=o-Math.ceil(c.length/2);f>0;)l.putByte(0),--f;return l.putBytes(n.util.hexToBytes(c)),!1!==a?g(l.getBytes(),t,r):l.getBytes()},u.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var a,o=(r=r||{}).prng||n.random,s={nextBytes:function(e){for(var t=o.getBytesSync(e.length),r=0;r>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(a.eInt),a},u.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n,a=0,o=function(e,t){return e|t},s=+new Date,l=0;null===e.keys&&(t<=0||lf?e.pqState=0:e.num.isProbablePrime(E(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(c[a++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(i.ONE).gcd(e.e).compareTo(i.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(i.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var p=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,p,e.p,e.q,p.mod(e.p1),p.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)}}l+=(n=+new Date)-s,s=n}return null!==e.keys},u.rsa.generateKeyPair=function(e,t,r,i){if(1===arguments.length?"object"==typeof e?(r=e,e=void 0):"function"==typeof e&&(i=e,e=void 0):2===arguments.length?"number"==typeof e?"function"==typeof t?(i=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,i=t,e=void 0,t=void 0):3===arguments.length&&("number"==typeof t?"function"==typeof r&&(i=r,r=void 0):(i=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(i){if(S("generateKeyPair"))return a.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(e,t,r){if(e)return i(e);i(null,{privateKey:u.privateKeyFromPem(r),publicKey:u.publicKeyFromPem(t)})}));if(C("generateKey")&&C("exportKey"))return s.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:T(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(e){return s.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)})).then(void 0,(function(e){i(e)})).then((function(e){if(e){var t=u.privateKeyFromAsn1(o.fromDer(n.util.createBuffer(e)));i(null,{privateKey:t,publicKey:u.setRsaPublicKey(t.n,t.e)})}}));if(w("generateKey")&&w("exportKey")){var c=s.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:T(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return c.oncomplete=function(e){var t=e.target.result,r=s.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=u.privateKeyFromAsn1(o.fromDer(n.util.createBuffer(t)));i(null,{privateKey:r,publicKey:u.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){i(e)}},void(c.onerror=function(e){i(e)})}}else if(S("generateKeyPairSync")){var l=a.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:u.privateKeyFromPem(l.privateKey),publicKey:u.publicKeyFromPem(l.publicKey)}}var f=u.rsa.createKeyPairGenerationState(e,t,r);if(!i)return u.rsa.stepKeyPairGenerationState(f,0),f.keys;m(f,r,i)},u.setRsaPublicKey=u.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,i){if("string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return v(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return n.pkcs1.encode_rsa_oaep(t,e,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"==typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var a=t.encode(e,r,!0);return u.rsa.encrypt(a,r,!0)},verify:function(e,t,n){"string"==typeof n?n=n.toUpperCase():void 0===n&&(n="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===n?n={verify:function(e,t){return t=g(t,r,!0),e===o.fromDer(t).value[1].value}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(e,t){return e===(t=g(t,r,!0))}});var i=u.rsa.decrypt(t,r,!0,!1);return n.verify(e,i,r.n.bitLength())}};return r},u.setRsaPrivateKey=u.rsa.setPrivateKey=function(e,t,r,i,a,o,s,c){var l={n:e,e:t,d:r,p:i,q:a,dP:o,dQ:s,qInv:c,decrypt:function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var i=u.rsa.decrypt(e,l,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:g};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return n.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(t))throw new Error('Unsupported encryption scheme: "'+t+'".');t={decode:function(e){return e}}}return t.decode(i,l,!1)},sign:function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:d},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,l.n.bitLength());return u.rsa.encrypt(n,l,r)}};return l},u.wrapRsaPrivateKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(u.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,o.toDer(e).getBytes())])},u.privateKeyFromAsn1=function(e){var t,r,a,s,c,h,p,d,y={},v=[];if(o.validate(e,l,y,v)&&(e=o.fromDer(n.util.createBuffer(y.privateKey))),y={},v=[],!o.validate(e,f,y,v)){var g=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw g.errors=v,g}return t=n.util.createBuffer(y.privateKeyModulus).toHex(),r=n.util.createBuffer(y.privateKeyPublicExponent).toHex(),a=n.util.createBuffer(y.privateKeyPrivateExponent).toHex(),s=n.util.createBuffer(y.privateKeyPrime1).toHex(),c=n.util.createBuffer(y.privateKeyPrime2).toHex(),h=n.util.createBuffer(y.privateKeyExponent1).toHex(),p=n.util.createBuffer(y.privateKeyExponent2).toHex(),d=n.util.createBuffer(y.privateKeyCoefficient).toHex(),u.setRsaPrivateKey(new i(t,16),new i(r,16),new i(a,16),new i(s,16),new i(c,16),new i(h,16),new i(p,16),new i(d,16))},u.privateKeyToAsn1=u.privateKeyToRSAPrivateKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.e)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.d)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.p)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.q)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.dP)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.dQ)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.qInv))])},u.publicKeyFromAsn1=function(e){var t={},r=[];if(o.validate(e,p,t,r)){var a,s=o.derToOid(t.publicKeyOid);if(s!==u.oids.rsaEncryption)throw(a=new Error("Cannot read public key. Unknown OID.")).oid=s,a;e=t.rsaPublicKey}if(r=[],!o.validate(e,h,t,r))throw(a=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,a;var c=n.util.createBuffer(t.publicKeyModulus).toHex(),l=n.util.createBuffer(t.publicKeyExponent).toHex();return u.setRsaPublicKey(new i(c,16),new i(l,16))},u.publicKeyToAsn1=u.publicKeyToSubjectPublicKeyInfo=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(u.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.BITSTRING,!1,[u.publicKeyToRSAPublicKey(e)])])},u.publicKeyToRSAPublicKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.e))])}},137:(e,t,r)=>{var n=r(3832);r(8991),r(7116);var i=e.exports=n.sha1=n.sha1||{};n.md.sha1=n.md.algorithms.sha1=i,i.create=function(){o||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),o=!0);var e=null,t=n.util.createBuffer(),r=new Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a>>0,u>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=u[1],u[1]=u[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,u[0]=u[1]/4294967296>>>0;return t.putBytes(a),s(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o=n.util.createBuffer();o.putBytes(t.bytes());var u,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;o.putBytes(a.substr(0,i.blockLength-c));for(var l=8*i.fullMessageLength[0],f=0;f>>0,o.putInt32(l>>>0),l=u>>>0;o.putInt32(l);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};s(h,r,o);var p=n.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p},i};var a=null,o=!1;function s(e,t,r){for(var n,i,a,o,s,u,c,l=r.length();l>=64;){for(i=e.h0,a=e.h1,o=e.h2,s=e.h3,u=e.h4,c=0;c<16;++c)n=r.getInt32(),t[c]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+u+1518500249+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<20;++c)n=(n=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|n>>>31,t[c]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+u+1518500249+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<32;++c)n=(n=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|n>>>31,t[c]=n,n=(i<<5|i>>>27)+(a^o^s)+u+1859775393+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<40;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(a^o^s)+u+1859775393+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<60;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(a&o|s&(a^o))+u+2400959708+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<80;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(a^o^s)+u+3395469782+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+o|0,e.h3=e.h3+s|0,e.h4=e.h4+u|0,l-=64}}},1668:(e,t,r)=>{var n=r(3832);r(8991),r(7116);var i=e.exports=n.sha256=n.sha256||{};n.md.sha256=n.md.algorithms.sha256=i,i.create=function(){o||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],o=!0);var e=null,t=n.util.createBuffer(),r=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a>>0,s>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=s[1],s[1]=s[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(a),u(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o=n.util.createBuffer();o.putBytes(t.bytes());var s,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;o.putBytes(a.substr(0,i.blockLength-c));for(var l=8*i.fullMessageLength[0],f=0;f>>0,o.putInt32(l>>>0),l=s>>>0;o.putInt32(l);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};u(h,r,o);var p=n.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p.putInt32(h.h5),p.putInt32(h.h6),p.putInt32(h.h7),p},i};var a=null,o=!1,s=null;function u(e,t,r){for(var n,i,a,o,u,c,l,f,h,p,d,y,v,g=r.length();g>=64;){for(u=0;u<16;++u)t[u]=r.getInt32();for(;u<64;++u)n=((n=t[u-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=t[u-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[u]=n+t[u-7]+i+t[u-16]|0;for(c=e.h0,l=e.h1,f=e.h2,h=e.h3,p=e.h4,d=e.h5,y=e.h6,v=e.h7,u=0;u<64;++u)a=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),o=c&l|f&(c^l),n=v+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(y^p&(d^y))+s[u]+t[u],v=y,y=d,d=p,p=h+n>>>0,h=f,f=l,l=c,c=n+(i=a+o)>>>0;e.h0=e.h0+c|0,e.h1=e.h1+l|0,e.h2=e.h2+f|0,e.h3=e.h3+h|0,e.h4=e.h4+p|0,e.h5=e.h5+d|0,e.h6=e.h6+y|0,e.h7=e.h7+v|0,g-=64}}},3219:(e,t,r)=>{var n=r(3832);r(8991),r(7116);var i=e.exports=n.sha512=n.sha512||{};n.md.sha512=n.md.algorithms.sha512=i;var a=n.sha384=n.sha512.sha384=n.sha512.sha384||{};a.create=function(){return i.create("SHA-384")},n.md.sha384=n.md.algorithms.sha384=a,n.sha512.sha256=n.sha512.sha256||{create:function(){return i.create("SHA-512/256")}},n.md["sha512/256"]=n.md.algorithms["sha512/256"]=n.sha512.sha256,n.sha512.sha224=n.sha512.sha224||{create:function(){return i.create("SHA-512/224")}},n.md["sha512/224"]=n.md.algorithms["sha512/224"]=n.sha512.sha224,i.create=function(e){if(s||(o=String.fromCharCode(128),o+=n.util.fillString(String.fromCharCode(0),128),u=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],(c={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],c["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],c["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],c["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],s=!0),void 0===e&&(e="SHA-512"),!(e in c))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=c[e],r=null,i=n.util.createBuffer(),a=new Array(80),f=0;f<80;++f)a[f]=new Array(2);var h=64;switch(e){case"SHA-384":h=48;break;case"SHA-512/256":h=32;break;case"SHA-512/224":h=28}var p={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:h,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){p.messageLength=0,p.fullMessageLength=p.messageLength128=[];for(var e=p.messageLengthSize/4,a=0;a>>0,o>>>0];for(var s=p.fullMessageLength.length-1;s>=0;--s)p.fullMessageLength[s]+=o[1],o[1]=o[0]+(p.fullMessageLength[s]/4294967296>>>0),p.fullMessageLength[s]=p.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return i.putBytes(e),l(r,a,i),(i.read>2048||0===i.length())&&i.compact(),p},p.digest=function(){var t=n.util.createBuffer();t.putBytes(i.bytes());var s,u=p.fullMessageLength[p.fullMessageLength.length-1]+p.messageLengthSize&p.blockLength-1;t.putBytes(o.substr(0,p.blockLength-u));for(var c=8*p.fullMessageLength[0],f=0;f>>0,t.putInt32(c>>>0),c=s>>>0;t.putInt32(c);var h=new Array(r.length);for(f=0;f=128;){for(N=0;N<16;++N)t[N][0]=r.getInt32()>>>0,t[N][1]=r.getInt32()>>>0;for(;N<80;++N)n=(((O=(x=t[N-2])[0])>>>19|(R=x[1])<<13)^(R>>>29|O<<3)^O>>>6)>>>0,i=((O<<13|R>>>19)^(R<<3|O>>>29)^(O<<26|R>>>6))>>>0,a=(((O=(F=t[N-15])[0])>>>1|(R=F[1])<<31)^(O>>>8|R<<24)^O>>>7)>>>0,o=((O<<31|R>>>1)^(O<<24|R>>>8)^(O<<25|R>>>7))>>>0,P=t[N-7],D=t[N-16],R=i+P[1]+o+D[1],t[N][0]=n+P[0]+a+D[0]+(R/4294967296>>>0)>>>0,t[N][1]=R>>>0;for(d=e[0][0],y=e[0][1],v=e[1][0],g=e[1][1],m=e[2][0],b=e[2][1],E=e[3][0],S=e[3][1],C=e[4][0],w=e[4][1],T=e[5][0],A=e[5][1],I=e[6][0],k=e[6][1],_=e[7][0],B=e[7][1],N=0;N<80;++N)l=((C>>>14|w<<18)^(C>>>18|w<<14)^(w>>>9|C<<23))>>>0,f=(I^C&(T^I))>>>0,s=((d>>>28|y<<4)^(y>>>2|d<<30)^(y>>>7|d<<25))>>>0,c=((d<<4|y>>>28)^(y<<30|d>>>2)^(y<<25|d>>>7))>>>0,h=(d&v|m&(d^v))>>>0,p=(y&g|b&(y^g))>>>0,R=B+(((C<<18|w>>>14)^(C<<14|w>>>18)^(w<<23|C>>>9))>>>0)+((k^w&(A^k))>>>0)+u[N][1]+t[N][1],n=_+l+f+u[N][0]+t[N][0]+(R/4294967296>>>0)>>>0,i=R>>>0,a=s+h+((R=c+p)/4294967296>>>0)>>>0,o=R>>>0,_=I,B=k,I=T,k=A,T=C,A=w,C=E+n+((R=S+i)/4294967296>>>0)>>>0,w=R>>>0,E=m,S=b,m=v,b=g,v=d,g=y,d=n+a+((R=i+o)/4294967296>>>0)>>>0,y=R>>>0;R=e[0][1]+y,e[0][0]=e[0][0]+d+(R/4294967296>>>0)>>>0,e[0][1]=R>>>0,R=e[1][1]+g,e[1][0]=e[1][0]+v+(R/4294967296>>>0)>>>0,e[1][1]=R>>>0,R=e[2][1]+b,e[2][0]=e[2][0]+m+(R/4294967296>>>0)>>>0,e[2][1]=R>>>0,R=e[3][1]+S,e[3][0]=e[3][0]+E+(R/4294967296>>>0)>>>0,e[3][1]=R>>>0,R=e[4][1]+w,e[4][0]=e[4][0]+C+(R/4294967296>>>0)>>>0,e[4][1]=R>>>0,R=e[5][1]+A,e[5][0]=e[5][0]+T+(R/4294967296>>>0)>>>0,e[5][1]=R>>>0,R=e[6][1]+k,e[6][0]=e[6][0]+I+(R/4294967296>>>0)>>>0,e[6][1]=R>>>0,R=e[7][1]+B,e[7][0]=e[7][0]+_+(R/4294967296>>>0)>>>0,e[7][1]=R>>>0,L-=128}}},7116:(e,t,r)=>{var n=r(3832),i=r(8807),a=e.exports=n.util=n.util||{};function o(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function s(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(a.isArrayBuffer(e)||a.isArrayBufferView(e))if("undefined"!=typeof Buffer&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(e){for(var r=0;r15?(r=Date.now(),o(e)):(t.push(e),1===t.length&&i.setAttribute("a",n=!n))}}a.nextTick=a.setImmediate}(),a.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,a.globalScope=a.isNodejs?r.g:"undefined"==typeof self?window:self,a.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},a.isArrayBufferView=function(e){return e&&a.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},a.ByteBuffer=s,a.ByteStringBuffer=s;a.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},a.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},a.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},a.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},a.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},a.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},a.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(a.encodeUtf8(e))},a.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},a.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},a.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},a.ByteStringBuffer.prototype.putInt=function(e,t){o(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},a.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<0);return t},a.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},a.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},a.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},a.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},a.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},a.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},a.ByteStringBuffer.prototype.copy=function(){var e=a.createBuffer(this.data);return e.read=this.read,e},a.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},a.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},a.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},a.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},a.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},a.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},a.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},a.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},a.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},a.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},a.DataBuffer.prototype.putInt=function(e,t){o(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},a.DataBuffer.prototype.putSignedInt=function(e,t){return o(t),this.accommodate(t/8),e<0&&(e+=2<0);return t},a.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},a.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},a.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},a.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},a.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},a.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},a.DataBuffer.prototype.copy=function(){return new a.DataBuffer(this)},a.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},a.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},a.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},a.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},a.xorBytes=function(e,t,r){for(var n="",i="",a="",o=0,s=0;r>0;--r,++o)i=e.charCodeAt(o)^t.charCodeAt(o),s>=10&&(n+=a,a="",s=0),a+=String.fromCharCode(i),++s;return n+=a},a.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],l="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";a.encode64=function(e,t){for(var r,n,i,a="",o="",s=0;s>2),a+=u.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=u.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":u.charAt(63&i)),t&&a.length>t&&(o+=a.substr(0,t)+"\r\n",a=a.substr(t));return o+=a},a.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,i,a="",o=0;o>4),64!==n&&(a+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(a+=String.fromCharCode((3&n)<<6|i)));return a},a.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},a.decodeUtf8=function(e){return decodeURIComponent(escape(e))},a.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:i.encode,decode:i.decode}},a.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},a.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,a=0;a>2),a+=u.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=u.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":u.charAt(63&i)),t&&a.length>t&&(o+=a.substr(0,t)+"\r\n",a=a.substr(t));return o+=a},a.binary.base64.decode=function(e,t,r){var n,i,a,o,s=t;s||(s=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,l=r=r||0;u>4,64!==a&&(s[l++]=(15&i)<<4|a>>2,64!==o&&(s[l++]=(3&a)<<6|o));return t?l-r:s.subarray(0,l)},a.binary.base58.encode=function(e,t){return a.binary.baseN.encode(e,l,t)},a.binary.base58.decode=function(e,t){return a.binary.baseN.decode(e,l,t)},a.text={utf8:{},utf16:{}},a.text.utf8.encode=function(e,t,r){e=a.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,o=0;o0?(i=r[n].substring(0,o),a=r[n].substring(o+1)):(i=r[n],a=null),i in t||(t[i]=[]),i in Object.prototype||null===a||t[i].push(unescape(a))}return t};return void 0===e?(null===m&&(m="undefined"!=typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),t=m):t=r(e),t},a.parseFragment=function(e){var t=e,r="",n=e.indexOf("?");n>0&&(t=e.substring(0,n),r=e.substring(n+1));var i=t.split("/");return i.length>0&&""===i[0]&&i.shift(),{pathString:t,queryString:r,path:i,query:""===r?{}:a.getQueryVariables(r)}},a.makeRequest=function(e){var t=a.parseFragment(e),r={path:t.pathString,query:t.queryString,getPath:function(e){return void 0===e?t.path:t.path[e]},getQuery:function(e,r){var n;return void 0===e?n=t.query:(n=t.query[e])&&void 0!==r&&(n=n[r]),n},getQueryLast:function(e,t){var n=r.getQuery(e);return n?n[n.length-1]:t}};return r},a.makeLink=function(e,t,r){e=jQuery.isArray(e)?e.join("/"):e;var n=jQuery.param(t||{});return r=r||"",e+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},a.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},a.format=function(e){for(var t,r,n=/%./g,i=0,a=[],o=0;t=n.exec(e);){(r=e.substring(o,n.lastIndex-2)).length>0&&a.push(r),o=n.lastIndex;var s=t[0][1];switch(s){case"s":case"o":i");break;case"%":a.push("%");break;default:a.push("<%"+s+"?>")}}return a.push(e.substring(o)),a.join("")},a.formatNumber=function(e,t,r,n){var i=e,a=isNaN(t=Math.abs(t))?2:t,o=void 0===r?",":r,s=void 0===n?".":n,u=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",l=c.length>3?c.length%3:0;return u+(l?c.substr(0,l)+s:"")+c.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+s)+(a?o+Math.abs(i-c).toFixed(a).slice(2):"")},a.formatSize=function(e){return e=e>=1073741824?a.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?a.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?a.formatNumber(e/1024,0)+" KiB":a.formatNumber(e,0)+" bytes"},a.bytesFromIP=function(e){return-1!==e.indexOf(".")?a.bytesFromIPv4(e):-1!==e.indexOf(":")?a.bytesFromIPv6(e):null},a.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=a.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1)):r.push({start:u,end:u})}t.push(o)}if(r.length>0){var c=r[n];c.end-c.start>0&&(t.splice(c.start,c.end-c.start+1,""),0===c.start&&t.unshift(""),7===c.end&&t.push(""))}return t.join(":")},a.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in a&&!e.update)return t(null,a.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return a.cores=navigator.hardwareConcurrency,t(null,a.cores);if("undefined"==typeof Worker)return a.cores=1,t(null,a.cores);if("undefined"==typeof Blob)return a.cores=2,t(null,a.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){for(var t=Date.now(),r=t+4;Date.now()s.st&&i.sti.st&&s.st{var n=r(3832);r(8925),r(3068),r(3480),r(8991),r(6971),r(6270),r(6953),r(6007),r(8095),r(7116);var i=n.asn1,a=e.exports=n.pki=n.pki||{},o=a.oids,s={};s.CN=o.commonName,s.commonName="CN",s.C=o.countryName,s.countryName="C",s.L=o.localityName,s.localityName="L",s.ST=o.stateOrProvinceName,s.stateOrProvinceName="ST",s.O=o.organizationName,s.organizationName="O",s.OU=o.organizationalUnitName,s.organizationalUnitName="OU",s.E=o.emailAddress,s.emailAddress="E";var u=n.pki.rsa.publicKeyValidator,c={name:"Certificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},u,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},l={name:"rsapss",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},f={name:"CertificationRequestInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},u,{name:"CertificationRequestInfo.attributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0}]}]}]},h={name:"CertificationRequest",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[f,{name:"CertificationRequest.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function p(e,t){"string"==typeof t&&(t={shortName:t});for(var r,n=null,i=0;null===n&&i128)throw new Error('Invalid "nsComment" content.');e.value=i.create(i.Class.UNIVERSAL,i.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var p=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=p.toHex(),e.value=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,p.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);l=e.value.value;if(e.keyIdentifier){var d=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;l.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!1,d))}if(e.authorityCertIssuer){var v=[i.create(i.Class.CONTEXT_SPECIFIC,4,!0,[y(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];l.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,v))}if(e.serialNumber){var g=n.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);l.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!1,g))}}else if("cRLDistributionPoints"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);l=e.value.value;var m,b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),E=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(h=0;h2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(f.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(u.validity.notBefore=f[0],u.validity.notAfter=f[1],u.tbsCertificate=r.tbsCertificate,t){var h;if(u.md=null,u.signatureOid in o)switch(o[u.signatureOid]){case"sha1WithRSAEncryption":u.md=n.md.sha1.create();break;case"md5WithRSAEncryption":u.md=n.md.md5.create();break;case"sha256WithRSAEncryption":u.md=n.md.sha256.create();break;case"sha384WithRSAEncryption":u.md=n.md.sha384.create();break;case"sha512WithRSAEncryption":u.md=n.md.sha512.create();break;case"RSASSA-PSS":u.md=n.md.sha256.create()}if(null===u.md)throw(h=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=u.signatureOid,h;var y=i.toDer(u.tbsCertificate);u.md.update(y.getBytes())}var g=n.md.sha1.create();u.issuer.getField=function(e){return p(u.issuer,e)},u.issuer.addField=function(e){v([e]),u.issuer.attributes.push(e)},u.issuer.attributes=a.RDNAttributesAsArray(r.certIssuer,g),r.certIssuerUniqueId&&(u.issuer.uniqueId=r.certIssuerUniqueId),u.issuer.hash=g.digest().toHex();var m=n.md.sha1.create();return u.subject.getField=function(e){return p(u.subject,e)},u.subject.addField=function(e){v([e]),u.subject.attributes.push(e)},u.subject.attributes=a.RDNAttributesAsArray(r.certSubject,m),r.certSubjectUniqueId&&(u.subject.uniqueId=r.certSubjectUniqueId),u.subject.hash=m.digest().toHex(),r.certExtensions?u.extensions=a.certificateExtensionsFromAsn1(r.certExtensions):u.extensions=[],u.publicKey=a.publicKeyFromAsn1(r.subjectPublicKeyInfo),u},a.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r1&&(r=u.value.charCodeAt(1),a=u.value.length>2?u.value.charCodeAt(2):0),t.digitalSignature=128==(128&r),t.nonRepudiation=64==(64&r),t.keyEncipherment=32==(32&r),t.dataEncipherment=16==(16&r),t.keyAgreement=8==(8&r),t.keyCertSign=4==(4&r),t.cRLSign=2==(2&r),t.encipherOnly=1==(1&r),t.decipherOnly=128==(128&a)}else if("basicConstraints"===t.name){(u=i.fromDer(t.value)).value.length>0&&u.value[0].type===i.Type.BOOLEAN?t.cA=0!==u.value[0].value.charCodeAt(0):t.cA=!1;var s=null;u.value.length>0&&u.value[0].type===i.Type.INTEGER?s=u.value[0].value:u.value.length>1&&(s=u.value[1].value),null!==s&&(t.pathLenConstraint=i.derToInteger(s))}else if("extKeyUsage"===t.name)for(var u=i.fromDer(t.value),c=0;c1&&(r=u.value.charCodeAt(1)),t.client=128==(128&r),t.server=64==(64&r),t.email=32==(32&r),t.objsign=16==(16&r),t.reserved=8==(8&r),t.sslCA=4==(4&r),t.emailCA=2==(2&r),t.objCA=1==(1&r)}else if("subjectAltName"===t.name||"issuerAltName"===t.name){var f;t.altNames=[];u=i.fromDer(t.value);for(var h=0;h=E&&e0&&o.value.push(a.certificateExtensionsToAsn1(e.extensions)),o},a.getCertificationRequestInfo=function(e){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),y(e.subject),a.publicKeyToAsn1(e.publicKey),b(e)])},a.distinguishedNameToAsn1=function(e){return y(e)},a.certificateToAsn1=function(e){var t=e.tbsCertificate||a.getTBSCertificate(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),m(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},a.certificateExtensionsToAsn1=function(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,3,!0,[]),r=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(r);for(var n=0;nl.validity.notAfter)&&(u={message:"Certificate is not valid yet or has expired.",error:a.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:o}),null===u){if(null===(f=t[0]||e.getIssuer(l))&&l.isIssuer(l)&&(h=!0,f=l),f){var p=f;n.util.isArray(p)||(p=[p]);for(var d=!1;!d&&p.length>0;){f=p.shift();try{d=f.verify(l)}catch(e){}}d||(u={message:"Certificate signature is invalid.",error:a.certificateError.bad_certificate})}null!==u||f&&!h||e.hasCertificate(l)||(u={message:"Certificate is not trusted.",error:a.certificateError.unknown_ca})}if(null===u&&f&&!l.isIssuer(f)&&(u={message:"Certificate issuer is invalid.",error:a.certificateError.bad_certificate}),null===u)for(var y={keyUsage:!0,basicConstraints:!0},v=0;null===u&&vm.pathLenConstraint&&(u={message:"Certificate basicConstraints pathLenConstraint violated.",error:a.certificateError.bad_certificate})}var E=null===u||u.error,S=r.verify?r.verify(E,c,i):E;if(!0!==S)throw!0===E&&(u={message:"The application rejected the certificate.",error:a.certificateError.bad_certificate}),(S||0===S)&&("object"!=typeof S||n.util.isArray(S)?"string"==typeof S&&(u.error=S):(S.message&&(u.message=S.message),S.error&&(u.error=S.error))),u;u=null,s=!1,++c}while(t.length>0);return!0}},1379:(e,t,r)=>{"use strict"; /*! * algorithms/aes-cbc-hmac-sha2.js - AES-CBC-HMAC-SHA2 Composited Encryption * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(3748),i=r(1733),a=r(8545),o=r(1194),s=r(4678),u=r(4237);function c(e){if(16!==e.length)throw new Error("invalid iv")}function l(e){return n.setupFallback((function(t,r,i){try{c(i)}catch(e){return Promise.reject(e)}var a=Promise.resolve(r);return a=a.then((function(r){var a="AES-"+e+"-CBC",o=n.nodeCrypto.createCipheriv(a,t,i);return Buffer.concat([o.update(r),o.final()])}))}),(function(e,t,r){try{c(r)}catch(e){return Promise.reject(e)}var i=Promise.resolve();return i=(i=(i=i.then((function(){return n.subtleCrypto.importKey("raw",e,{name:"AES-CBC"},!0,["encrypt"])}))).then((function(e){var i={name:"AES-CBC",iv:r};return n.subtleCrypto.encrypt(i,e,t)}))).then((function(e){return e=Buffer.from(e)}))}),(function(e,t,r){try{c(r)}catch(e){return Promise.reject(e)}var n=Promise.resolve();return n=n.then((function(){var n=o.cipher.createCipher("AES-CBC",new s(e));return n.start({iv:new s(r)}),n.update(new s(t)),n.finish()?Buffer.from(n.output.bytes(),"binary"):Promise.reject(new Error("encryption failed"))}))}))}function f(e){return n.setupFallback((function(t,r,i){try{c(i)}catch(e){return Promise.reject(e)}var a=Promise.resolve();return a=a.then((function(){var a="AES-"+e+"-CBC",o=n.nodeCrypto.createDecipheriv(a,t,i);return Buffer.concat([o.update(r),o.final()])}))}),(function(e,t,r){try{c(r)}catch(e){return Promise.reject(e)}var i=Promise.resolve();return i=(i=(i=i.then((function(){return n.subtleCrypto.importKey("raw",e,{name:"AES-CBC"},!0,["decrypt"])}))).then((function(e){var i={name:"AES-CBC",iv:r};return n.subtleCrypto.decrypt(i,e,t)}))).then((function(e){return e=Buffer.from(e)}))}),(function(e,t,r){try{c(r)}catch(e){return Promise.reject(e)}var n=Promise.resolve();return n=n.then((function(){var n=o.cipher.createDecipher("AES-CBC",new s(e));return n.start({iv:new s(r)}),n.update(new s(t)),n.finish()?Buffer.from(n.output.bytes(),"binary"):Promise.reject(new Error("encryption failed"))}))}))}function h(e,t){if(t<<1!=e.length<<3)throw new Error("invalid encryption key size")}function p(e){var t=l(e);return function(r,a,o){try{h(r,e)}catch(e){return Promise.reject(e)}var s=r.slice(e/8),u=r.slice(0,e/8),c=o.iv||Buffer.alloc(0),l=o.aad||o.adata||Buffer.alloc(0),f=t(s,a,c);return f=f.then((function(t){var r=Buffer.concat([l,c,t,n.int64ToBuffer(8*l.length)]);return i["HS"+2*e].sign(u,r,{length:e}).then((function(r){var n=r.mac.slice(0,e/8);return{data:t,tag:n}}))}))}}function d(e){var t=f(e);return function(r,a,o){try{h(r,e)}catch(e){return Promise.reject(e)}var s=r.slice(e/8),u=r.slice(0,e/8),c=o.iv||Buffer.alloc(0),l=o.aad||o.adata||Buffer.alloc(0),f=o.tag||o.mac||Buffer.alloc(0),p=Promise.resolve();return p=(p=p.then((function(){var t=Buffer.concat([l,c,a,n.int64ToBuffer(8*l.length)]);return i["HS"+2*e].verify(u,t,f,{length:e}).then((function(){return a}),(function(){throw new Error("mac check failed")}))}))).then((function(){return t(s,a,c)}))}}var y=Buffer.from("Encryption","utf8"),v=Buffer.from("Integrity","utf8"),g=Buffer.from(".","utf8");function m(e,t,r,i){var o=8*e.length,s=o/2,u=Promise.resolve();return u=(u=u.then((function(){return Buffer.concat([n.int32ToBuffer(1),e,n.int32ToBuffer(s),Buffer.from(t,"utf8"),r,i,y])}))).then((function(e){return a["SHA-"+o].digest(e).then((function(e){return e.slice(0,s/8)}))})),u=Promise.resolve(u)}function b(e,t,r,i){var o=8*e.length,s=o,u=Promise.resolve();return u=(u=u.then((function(){return Buffer.concat([n.int32ToBuffer(1),e,n.int32ToBuffer(s),Buffer.from(t,"utf8"),r,i,v])}))).then((function(e){return a["SHA-"+o].digest(e).then((function(e){return e.slice(0,s/8)}))})),u=Promise.resolve(u)}function E(e,t){var r=l(e);return function(a,o,s){var c,l,f=s.epu||n.int32ToBuffer(0),h=s.epv||n.int32ToBuffer(0),p=s.iv||Buffer.alloc(0),d=s.aad||s.adata||Buffer.alloc(0),y=s.kdata||Buffer.alloc(0),v=[m(a,t,f,h),b(a,t,f,h)],E=Promise.all(v).then((function(e){c=e[0],l=e[1]}));return E=(E=(E=E.then((function(){return r(c,o,p)}))).then((function(t){var r=Buffer.concat([d,g,Buffer.from(y),g,Buffer.from(u.base64url.encode(p),"utf8"),g,Buffer.from(u.base64url.encode(t),"utf8")]);return Promise.all([Promise.resolve(t),i["HS"+2*e].sign(l,r,{length:e})])}))).then((function(e){return{data:e[0],tag:e[1].mac}}))}}function S(e,t){var r=f(e);return function(a,o,s){var c,l,f=s.epu||n.int32ToBuffer(0),h=s.epv||n.int32ToBuffer(0),p=s.iv||Buffer.alloc(0),d=s.aad||s.adata||Buffer.alloc(0),y=s.kdata||Buffer.alloc(0),v=s.tag||s.mac||Buffer.alloc(0),E=[m(a,t,f,h),b(a,t,f,h)],S=Promise.all(E).then((function(e){c=e[0],l=e[1]}));return S=(S=S.then((function(){var t=Buffer.concat([d,g,Buffer.from(y),g,Buffer.from(u.base64url.encode(p),"utf8"),g,Buffer.from(u.base64url.encode(o),"utf8")]);try{return i["HS"+2*e].verify(l,t,v,{loose:!1})}catch(e){throw new Error("mac check failed")}}))).then((function(){return r(c,o,p)}))}}var C={};["A128CBC-HS256","A192CBC-HS384","A256CBC-HS512"].forEach((function(e){var t=parseInt(/A(\d+)CBC-HS(\d+)?/g.exec(e)[1]);C[e]={encrypt:p(t),decrypt:d(t)}})),["A128CBC+HS256","A192CBC+HS384","A256CBC+HS512"].forEach((function(e){var t=parseInt(/A(\d+)CBC\+HS(\d+)?/g.exec(e)[1]);C[e]={encrypt:E(t,e),decrypt:S(t,e)}})),e.exports=C},2736:(e,t,r)=>{"use strict"; /*! * algorithms/aes-gcm.js - AES-GCM Encryption and Key-Wrapping * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(3748),i=r(4237),a=r(414),o=r(9560);function s(e,t){function r(r,n){if(e!==r.length<<3)throw new Error("invalid key size");if(!n&&!t)throw new Error("invalid iv");if(n&&12!==n.length)throw new Error("invalid iv")}function s(e){if(t){var r=i.base64url.encode(e.iv),n=i.base64url.encode(e.tag);e={data:e.data,header:{iv:r,tag:n}}}return e}return n.setupFallback((function(e,t,a){var o=a.iv,u=a.aad||a.adata||Buffer.alloc(0);try{r(e,o)}catch(e){return Promise.reject(e)}o=o||i.randomBytes(12);var c,l="aes-"+8*e.length+"-gcm";try{c=n.nodeCrypto.createCipheriv(l,e,o)}catch(e){throw new Error("unsupported algorithm: "+l)}if("function"!=typeof c.setAAD)throw new Error("unsupported algorithm: "+l);return u.length&&c.setAAD(u),s({data:Buffer.concat([c.update(t),c.final()]),iv:o,tag:c.getAuthTag()})}),(function(e,t,a){var o=a.iv,u=a.aad||a.adata||Buffer.alloc(0);try{r(e,o)}catch(e){return Promise.reject(e)}o=o||i.randomBytes(12);var c={name:"AES-GCM"};return n.subtleCrypto.importKey("raw",e,c,!0,["encrypt"]).then((function(e){return c.iv=o,c.tagLength=128,u.length&&(c.additionalData=u),n.subtleCrypto.encrypt(c,e,t)})).then((function(e){var t=e.byteLength-16,r=e.slice(t);r=Buffer.from(r);var n=e.slice(0,t);return s({data:n=Buffer.from(n),iv:o,tag:r})}))}),(function(e,t,n){var u,c,l=n.iv,f=n.aad||n.adata||Buffer.alloc(0);try{r(e,l)}catch(e){return Promise.reject(e)}return l=l||i.randomBytes(12),u=o.createCipher({key:e,iv:l,additionalData:f}),c=Buffer.alloc(t.length),new Promise((function(e,r){var n=a.CHUNK_SIZE,i=0,o=0;!function a(){var f=Math.min(n,t.length-o);if(i+=u.update(t,o,f,c,i),o+=f,t.length>o)setTimeout(a,0);else if((i+=u.finish(c,i))===t.length){var h=u.tag;e(s({data:c,iv:l,tag:h}))}else r(new Error("encryption failed"))}()}))}))}function u(e){function t(t,r,n){if(e!==t.length<<3)throw new Error("invalid key size");if(12!==r.length)throw new Error("invalid iv");if(16!==n.length)throw new Error("invalid tag length")}return n.setupFallback((function(e,r,i){var a=i.aad||i.adata||Buffer.alloc(0),o=i.iv||Buffer.alloc(0),s=i.tag||i.mac||Buffer.alloc(0);try{t(e,o,s)}catch(e){return Promise.reject(e)}var u,c="aes-"+8*e.length+"-gcm";try{u=n.nodeCrypto.createDecipheriv(c,e,o)}catch(e){throw new Error("unsupported algorithm: "+c)}if("function"!=typeof u.setAAD)throw new Error("unsupported algorithm: "+c);u.setAuthTag(s),a.length&&u.setAAD(a);try{return Buffer.concat([u.update(r),u.final()])}catch(e){throw new Error("decryption failed")}}),(function(e,r,i){var a=i.aad||i.adata||Buffer.alloc(0),o=i.iv||Buffer.alloc(0),s=i.tag||i.mac||Buffer.alloc(0);try{t(e,o,s)}catch(e){return Promise.reject(e)}var u={name:"AES-GCM"};return n.subtleCrypto.importKey("raw",e,u,!0,["decrypt"]).then((function(e){return u.iv=o,u.tagLength=128,a.length&&(u.additionalData=a),r=Buffer.concat([r,s],r.length+s.length),n.subtleCrypto.decrypt(u,e,r)})).then((function(e){return e=Buffer.from(e)}))}),(function(e,r,n){var i,s,u=n.aad||n.adata||Buffer.alloc(0),c=n.iv||Buffer.alloc(0),l=n.tag||n.mac||Buffer.alloc(0);try{t(e,c,l)}catch(e){return Promise.reject(e)}return i=o.createDecipher({key:e,iv:c,additionalData:u,tag:l}),s=Buffer.alloc(r.length),new Promise((function(e,t){var n=a.CHUNK_SIZE,o=0,u=0;!function a(){var c=Math.min(n,r.length-u);if(o+=i.update(r,u,c,s,o),u+=c,r.length>u)setTimeout(a,0);else{try{o+=i.finish(s,o)}catch(e){return void t(new Error("decryption failed"))}o===r.length?e(s):t(new Error("decryption failed"))}}()}))}))}var c={};["A128GCM","A192GCM","A256GCM","A128GCMKW","A192GCMKW","A256GCMKW"].forEach((function(e){var t=/A(\d+)GCM(KW)?/g.exec(e),r=parseInt(t[1]),n="KW"===t[2];c[e]={encrypt:s(r,n),decrypt:u(r)}})),e.exports=c},4179:(e,t,r)=>{"use strict"; /*! * algorithms/aes-kw.js - AES-KW Key-Wrapping * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(3748),i=r(1194),a=r(4678),o=Buffer.from("a6a6a6a6a6a6a6a6","hex");function s(e,t){for(var r=Math.max(e.length,t.length),n=Buffer.alloc(r),i=0;r>i;i++)n[i]=(e[i]||0)^(t[i]||0);return n}function u(e,t){for(var r=[],n=0;e.length>n;n+=t)r.push(e.slice(n,n+t));return r}function c(e){var t=Math.floor(e/4294967296),r=e%4294967296,n=Buffer.alloc(8);return n[0]=255&t>>>24,n[1]=255&t>>>16,n[2]=255&t>>>8,n[3]=255&t>>>0,n[4]=255&r>>>24,n[5]=255&r>>>16,n[6]=255&r>>>8,n[7]=255&r>>>0,n}function l(e){function t(t,r){if(e!==t.length<<3)throw new Error("invalid key size");if(0d;d++)for(var y=0;h.length>y;y++){f=h.length*d+y+1,l=Buffer.concat([a,h[y]]),a=s((l=n.nodeCrypto.createCipheriv("AES"+e,r,p).update(l)).slice(0,8),c(f)),h[y]=l.slice(8,16)}h=[a].concat(h);var v=Buffer.concat(h);return Promise.resolve({data:v})}),(function(e,r){try{t(e,r)}catch(e){return Promise.reject(e)}var i={name:"AES-KW"},a=[n.subtleCrypto.importKey("raw",r,{name:"HMAC",hash:"SHA-256"},!0,["sign"]),n.subtleCrypto.importKey("raw",e,i,!0,["wrapKey"])];return a=(a=(a=Promise.all(a)).then((function(e){return n.subtleCrypto.wrapKey("raw",e[0],e[1],i)}))).then((function(e){return{data:e=Buffer.from(e)}}))}),(function(e,r){try{t(e,r)}catch(e){return Promise.reject(e)}var n,l,f,h=i.cipher.createCipher("AES",new a(e)),p=u(r,8);n=o;for(var d=0;6>d;d++)for(var y=0;p.length>y;y++)f=p.length*d+y+1,l=Buffer.concat([n,p[y]]),h.start(),h.update(new a(l)),h.finish(),n=s((l=Buffer.from(h.output.bytes(),"binary")).slice(0,8),c(f)),p[y]=l.slice(8,16);p=[n].concat(p);var v=Buffer.concat(p);return Promise.resolve({data:v})}))}function f(e){function t(t,r){if(e!==t.length<<3)throw new Error("invalid key size");if(0{"use strict"; /*! * algorithms/concat.js - Concat Key Derivation * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(414),i=r(8545);function a(e){e=e.replace("CONCAT-","");return function(t,r){var a=(r=r||{}).length,o=n.HASHLENGTH[e];if(!a)return Promise.reject(new Error("invalid key length"));if(!r.otherInfo)return Promise.reject(new Error("invalid otherInfo"));var s=r.otherInfo,u=i[e].digest,c=Math.ceil(a/o),l=0,f=[];return function e(){if(c===l++)return Buffer.concat(f).slice(0,a);var r=Buffer.alloc(4+t.length+s.length);return r.writeUInt32BE(l,0),t.copy(r,4),s.copy(r,4+t.length),u(r).then((function(t){return f.push(t),e()}))}()}}var o={};["CONCAT-SHA-1","CONCAT-SHA-256","CONCAT-SHA-384","CONCAT-SHA-512"].forEach((function(e){o[e]={derive:a(e)}})),e.exports=o},414:e=>{"use strict"; /*! * algorithms/constants.js - Constants used in Cryptographic Algorithms * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */e.exports={CHUNK_SIZE:1024,HASHLENGTH:{"SHA-1":160,"SHA-256":256,"SHA-384":384,"SHA-512":512},ENCLENGTH:{"AES-128-CBC":128,"AES-192-CBC":192,"AES-256-CBC":256,"AES-128-KW":128,"AES-192-KW":192,"AES-256-KW":256},KEYLENGTH:{"A128CBC-HS256":256,"A192CBC-HS384":384,"A256CBC-HS512":512,"A128CBC+HS256":256,"A192CBC+HS384":384,"A256CBC+HS512":512,A128GCM:128,A192GCM:192,A256GCM:256,A128KW:128,A192KW:192,A256KW:256,"ECDH-ES+A128KW":128,"ECDH-ES+A192KW":192,"ECDH-ES+A256KW":256},NONCELENGTH:{"A128CBC-HS256":128,"A192CBC-HS384":128,"A256CBC-HS512":128,"A128CBC+HS256":128,"A192CBC+HS384":128,"A256CBC+HS512":128,A128GCM:96,A192GCM:96,A256GCM:96}}},2274:e=>{"use strict"; /*! * algorithms/dir.js - Direct key mode * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var t={dir:{encrypt:function(e){return Promise.resolve({data:e,once:!0,direct:!0})},decrypt:function(e){return Promise.resolve(e)}}};e.exports=t},1762:(e,t,r)=>{"use strict"; /*! * algorithms/ec-util.js - Elliptic Curve Utility Functions * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(6678),i=r(1634),a=r(1194),o=r(4237),s={"P-256":256,"P-384":384,"P-521":521};function u(e,t){var r=n(e);return(t?["x","y"]:["d"]).forEach((function(e){r[e]=o.asBuffer(r[e],"base64url")})),r}var c=Buffer.from([4]);var l="1.2.840.10045.2.1";var f="Could not extract parameters from DER signature";function h(e,t,r){for(var n=0;t+n=128&&--n,n}e.exports={convertToForge:function(e,t){var r=t?["x","y"]:["d"];return r=r.map((function(t){return new a.jsbn.BigInteger(e[t].toString("hex"),16)})),r=[e.crv].concat(r),(t?i.asPublicKey:i.asPrivateKey).apply(i,r)},convertToJWK:function(e,t){var r=n(e);return(t?["x","y"]:["x","y","d"]).forEach((function(e){r[e]=o.base64url.encode(r[e])})),delete r.key_ops,delete r.use,delete r.alg,t&&delete r.d,r},convertToObj:u,convertToBuffer:function(e,t){return e=u(e,t),t?Buffer.concat([c,e.x,e.y]):e.d},curveSize:function(e){return s[e||""]||NaN},derToConcat:function(e,t){var r=0;if(48!==e[r++])throw new Error(f);var n=e[r++];if(129===n&&(n=e[r++]),n>e.length-r)throw new Error(f);if(2!==e[r++])throw new Error(f);var i=e[r++];if(i>e.length-r-2)throw new Error(f);if(i>t+1)throw new Error(f);var a=r;if(r+=i,2!==e[r++])throw new Error(f);var o=e[r++];if(o!==e.length-r)throw new Error(f);if(o>t+1)throw new Error(f);var s=r;if((r+=o)!==e.length)throw new Error(f);var u=t-i,c=t-o,l=Buffer.alloc(u+i+c+o);for(r=0;r{"use strict"; /*! * algorithms/ecdh.js - Elliptic Curve Diffie-Hellman algorithms * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(5029),i=r(4237),a=r(1762),o=r(5141),s=r(2319),u=r(4179),c=r(3748),l=r(414),f=r(6678),h=r(7557),p=r(8718);function d(e){switch(e){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new Error("unsupported curve: "+e)}}var y=e.exports={};function v(e,t,r){function n(e){return Buffer.concat([c.int32ToBuffer(e.length),e])}var a=r.algorithm||"",o=l.KEYLENGTH[a],s=i.asBuffer(r.apu||"","base64url"),u=i.asBuffer(r.apv||"","base64url"),f={public:t,length:o/8,hash:"SHA-256",otherInfo:Buffer.concat([n(Buffer.from(a,"utf8")),n(s),n(u),c.int32ToBuffer(o)])};return y["ECDH-CONCAT"].derive(e,f)}["ECDH","ECDH-HKDF","ECDH-CONCAT"].forEach((function(e){var t,r,i=/^ECDH(?:-(\w+))?$/g.exec(e||"")[1],u=y[e]=y[e]||{};switch(i||""){case"CONCAT":u.derive=function(e,t){var r;t=t||{};try{if(!(r=t.hash||d(e.crv)))throw new Error("invalid hash: "+r);r.toUpperCase()}catch(e){return Promise.reject(e)}var n=["public"],i=y.ECDH.derive(e,p(t,n));return i.then((function(e){return s["CONCAT-"+r].derive(e,h(t,n))}))};break;case"HKDF":u.derive=function(e,t){var r;t=t||{};try{if(!(r=t.hash||d(e.crv)))throw new Error("invalid hash: "+r);r.toUpperCase()}catch(e){return Promise.reject(e)}var n=["public"],i=y.ECDH.derive(e,p(t,n));return i.then((function(e){return o["HKDF-"+r].derive(e,h(t,n))}))};break;case"":u.derive=(t={name:"ECDH"},r=function(e,t){var r=e&&a.convertToForge(e,!0);if(!r||!r.isValid())return Promise.reject(new Error("invalid EC public key"));switch(t){case"jwk":r=a.convertToJWK(e,!0);break;case"buffer":r=a.convertToBuffer(e,!0)}return Promise.resolve(r)},c.setupFallback((function(e,t){if("function"!=typeof c.nodeCrypto.createECDH)throw new Error("unsupported algorithm: ECDH");var n,i=(t=t||{}).length||0;switch(e.crv){case"P-256":n="prime256v1";break;case"P-384":n="secp384r1";break;case"P-521":n="secp521r1";break;default:return Promise.reject(new Error("invalid curve: "+n))}var o=a.convertToBuffer(e,!1),s=r(t.public,"buffer");return s.then((function(e){var t=c.nodeCrypto.createECDH(n);t.setPrivateKey(o);var r=t.computeSecret(e);if(i){if(r.length{"use strict"; /*! * algorithms/ecdsa.js - Elliptic Curve Digitial Signature Algorithms * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(1762),i=r(3748),a=r(8545);function o(e){switch(e){case"SHA-256":return"P-256";case"SHA-384":return"P-384";case"SHA-512":return"P-521";default:throw new Error("unsupported hash: "+e)}}function s(e){var t,r=o(e),s=e.toLowerCase().replace("-","");return i.nodeCrypto&&i.nodeCrypto.getHashes().indexOf(s)>-1&&(t=function(e,t){if(r!==e.crv)return Promise.reject(new Error("invalid curve"));var a,o;switch(a=(a=Promise.resolve(i.nodeCrypto.createSign(s))).then((function(e){return e.update(t),e})),s.slice(-3)){case"384":o=48;break;case"512":o=66;break;default:o=32}return a=(a=a.then((function(t){return n.derToConcat(t.sign(n.convertToPEM(e,!0)),o)}))).then((function(e){return{data:t,mac:e}}))}),i.setupFallback(t,(function(t,a){if(r!==t.crv)return Promise.reject(new Error("invalid curve"));var o=n.convertToJWK(t,!1),s={name:"ECDSA",namedCurve:o.crv,hash:{name:e}};return i.subtleCrypto.importKey("jwk",o,s,!0,["sign"]).then((function(e){return i.subtleCrypto.sign(s,e,a)})).then((function(e){return e=Buffer.from(e),{data:a,mac:e}}))}),(function(t,i){if(r!==t.crv)return Promise.reject(new Error("invalid curve"));var o=n.convertToForge(t,!1);return a[e].digest(i).then((function(e){return e=o.sign(e),e=Buffer.concat([e.r,e.s]),{data:i,mac:e}}))}))}function u(e){var t,r=o(e),s=e.toLowerCase().replace("-","");return i.nodeCrypto&&i.nodeCrypto.getHashes().indexOf(s)>-1&&(t=function(e,t,a){if(r!==e.crv)return Promise.reject(new Error("invalid curve"));var o;switch(s.slice(-3)){case"384":o=48;break;case"512":o=66;break;default:o=32}return Promise.resolve(i.nodeCrypto.createVerify(s)).then((function(r){return r.update(t),r.end(),r.verify(n.convertToPEM(e,!1),n.concatToDer(a,o))})).then((function(e){if(!e)throw new Error("verification failed");return{data:t,mac:a,valid:!0}}))}),i.setupFallback(t,(function(t,a,o){if(r!==t.crv)return Promise.reject(new Error("invalid curve"));var s=n.convertToJWK(t,!0),u={name:"ECDSA",namedCurve:s.crv,hash:{name:e}};return i.subtleCrypto.importKey("jwk",s,u,!0,["verify"]).then((function(e){return i.subtleCrypto.verify(u,e,o,a)})).then((function(e){return e?{data:a,mac:o,valid:!0}:Promise.reject(new Error("verification failed"))}))}),(function(t,i,o){if(r!==t.crv)return Promise.reject(new Error("invalid curve"));var s=n.convertToForge(t,!0);return a[e].digest(i).then((function(e){var t=o.length/2,r={r:o.slice(0,t),s:o.slice(t)};return s.verify(e,r)?{data:i,mac:o,valid:!0}:Promise.reject(new Error("verification failed"))}))}))}var c={};["ES256","ES384","ES512"].forEach((function(e){var t=e.replace(/ES(\d+)/g,(function(e,t){return"SHA-"+t}));c[e]={sign:s(t),verify:u(t)}})),e.exports=c},3748:(e,t,r)=>{"use strict"; /*! * algorithms/helpers.js - Internal functions and fields used in Cryptographic * Algorithms * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */"undefined"==typeof Promise&&r(2702).polyfill(),t.int32ToBuffer=function(e,t){return(t=t||Buffer.alloc(4))[0]=e>>>24&255,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=255&e,t};var n=Math.pow(2,32);t.int64ToBuffer=function(e,r){r=r||Buffer.alloc(8);var i=Math.floor(e/n),a=e%n;return i=t.int32ToBuffer(i),a=t.int32ToBuffer(a),r=Buffer.concat([i,a])};var i={};Object.defineProperty(t,"subtleCrypto",{get:function(){return"subtleCrypto"in i?i.subtleCrypto:i.subtleCrypto=function(){if("undefined"!=typeof crypto&&void 0!==crypto.subtle)return crypto.subtle}()},enumerable:!0}),Object.defineProperty(t,"nodeCrypto",{get:function(){return"nodeCrypto"in i?i.nodeCrypto:i.nodeCrypto=function(){var e;try{e=r(3438)}catch(e){return}if(Object.keys(e).length)return e}()},enumerable:!0}),t.setupFallback=function(e,r,n){return e&&t.nodeCrypto?function(){var t,r=arguments;function i(e){return 0===e.message.indexOf("unsupported algorithm:")?n.apply(null,r):Promise.reject(e)}try{t=Promise.resolve(e.apply(null,r))}catch(e){t=i(e)}return t}:r&&t.subtleCrypto?function(){var e,t=arguments;function i(e){return e.code!==DOMException.NOT_SUPPORTED_ERR&&"Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData"!==e.message&&e instanceof Error?Promise.reject(e):n.apply(null,t)}try{e=(e=r.apply(null,t)).catch(i)}catch(t){e=i(t)}return e}:n}},5141:(e,t,r)=>{"use strict"; /*! * algorithms/hkdf.js - HMAC-based Extract-and-Expand Key Derivation * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(414),i=r(1733);function a(e){var t=e.replace("HKDF-",""),r=e.replace("HKDF-SHA-","HS");return function(e,a){var o=n.HASHLENGTH[t]/8;"string"==typeof r&&(r=i[r].sign);var s=(a=a||{}).salt;s&&0!==s.length||(s=Buffer.alloc(o));var u=a.info||Buffer.alloc(0),c=a.length||o,l=Math.ceil(c/o),f=[],h=0;function p(e,t){return l===h++?Buffer.concat(f).slice(0,c):(t||(t=Buffer.alloc(0)),t=Buffer.concat([t,u,Buffer.from([h])]),t=(t=r(e,t)).then((function(r){return t=r.mac,f.push(t),p(e,t)})))}return r(s,e,{length:8*s.length}).then((function(e){return p(e.mac)}))}}var o={};["HKDF-SHA-1","HKDF-SHA-256","HKDF-SHA-384","HKDF-SHA-512"].forEach((function(e){o[e]={derive:a(e)}})),e.exports=o},1733:(e,t,r)=>{"use strict"; /*! * algorithms/hmac.js - HMAC-based "signatures" * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(414),i=r(1194),a=r(4678),o=r(3748);function s(e){var t=e.replace("HS","SHA").toLowerCase(),r=e.replace("HS","SHA-");function a(e,t){return(e=(e||n.HASHLENGTH[r])/8)>t.length?Promise.reject(new Error("invalid key length")):Promise.resolve(t)}return o.setupFallback((function(e,r,n){return a((n=n||{}).length,e).then((function(){var n=o.nodeCrypto.createHmac(t,e);n.update(r);var i=n.digest();return{data:r,mac:i}}))}),(function(e,t,n){var i={name:"HMAC",hash:{name:r}};return a((n=n||{}).length,e).then((function(){return o.subtleCrypto.importKey("raw",e,i,!0,["sign"])})).then((function(e){return o.subtleCrypto.sign(i,e,t)})).then((function(e){var r=Buffer.from(e);return{data:t,mac:r}}))}),(function(e,r,n){return a((n=n||{}).length,e).then((function(){var n=i.hmac.create();return n.start(t,e.toString("binary")),n.update(r.toString("binary")),n=Buffer.from(n.digest().bytes(),"binary"),{data:r,mac:n}}))}))}function u(e){var t=e.replace("HS","SHA").toLowerCase(),r=e.replace("HS","SHA-");function s(e,t,i){e=(e||n.HASHLENGTH[r])/8;for(var a=!0,o=0;e>o;o++)a=a&&t[o]===i[o];return a}return o.setupFallback((function(e,r,n,i){i=i||{};var a=o.nodeCrypto.createHmac(t,e);a.update(r);var u=a.digest();if(!s(i.length,n,u))throw new Error("verification failed");return{data:r,mac:u,valid:!0}}),(function(e,t,n,i){var a={name:"HMAC",hash:{name:r}};return((i=i||{}).length?o.subtleCrypto.importKey("raw",e,a,!0,["sign"]).then((function(e){return o.subtleCrypto.sign(a,e,t)})).then((function(e){var t=Buffer.from(e);return s(i.length,n,t)})):o.subtleCrypto.importKey("raw",e,a,!0,["verify"]).then((function(e){return o.subtleCrypto.verify(a,e,n,t)}))).then((function(e){return e?{data:t,mac:n,valid:!0}:Promise.reject(new Error("verifaction failed"))}))}),(function(e,r,n,o){o=o||{};var u=i.hmac.create();return u.start(t,new a(e)),u.update(r.toString("binary")),u=Buffer.from(u.digest().bytes(),"binary"),s(o.length,n,u)?Promise.resolve({data:r,mac:n,valid:!0}):Promise.reject(new Error("verification failed"))}))}var c={};["HS1","HS256","HS384","HS512"].forEach((function(e){c[e]={sign:s(e),verify:u(e)}})),e.exports=c},5382:(e,t,r)=>{"use strict"; /*! * algorithms/index.js - Cryptographic Algorithms Entry Point * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=[r(1379),r(2736),r(4179),r(2319),r(2274),r(3724),r(4008),r(5141),r(1733),r(152),r(3516),r(4658),r(8545)],i={},a={},o={},s={},u={},c={};n.forEach((function(e){Object.keys(e).forEach((function(t){var r=e[t];"function"==typeof r.encrypt&&(u[t]=r.encrypt),"function"==typeof r.decrypt&&(c[t]=r.decrypt),"function"==typeof r.sign&&(o[t]=r.sign),"function"==typeof r.verify&&(s[t]=r.verify),"function"==typeof r.digest&&(i[t]=r.digest),"function"==typeof r.derive&&(a[t]=r.derive)}))})),t.digest=function(e,t,r){var n=i[e];return n?n(t,r):Promise.reject(new Error("unsupported algorithm: "+e))},t.derive=function(e,t,r){var n=a[e];return n?n(t,r):Promise.reject(new Error("unsupported algorithm: "+e))},t.sign=function(e,t,r,n){var i=o[e];return i?i(t,r,n||{}):Promise.reject(new Error("unsupported algorithm: "+e))},t.verify=function(e,t,r,n,i){var a=s[e];return a?a(t,r,n,i||{}):Promise.reject(new Error("unsupported algorithm: "+e))},t.encrypt=function(e,t,r,n){var i=u[e];return i?i(t,r,n||{}):Promise.reject(new Error("unsupported algorithm: "+e))},t.decrypt=function(e,t,r,n){var i=c[e];return i?i(t,r,n||{}):Promise.reject(new Error("unsupported algorithm: "+e))}},152:(e,t,r)=>{"use strict"; /*! * algorithms/pbes2.js - Password-Based Encryption (v2) Algorithms * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(1194),i=r(5029),a=r(4237),o=r(3748),s=r(414),u=r(4179),c=Buffer.from([0]);function l(e,t,r){var n="PBES2-"+e+"+"+t,i=[Buffer.from(n,"utf8"),c,r];return Buffer.concat(i)}function f(e){function t(e){var t=(e=e||{}).length||0,r=a.asBuffer(e.salt||Buffer.alloc(0),"base64u4l"),n=e.iterations||0;if(0>=t)throw new Error("invalid key length");if(0>=n)throw new Error("invalid iteration count");return e.length=t,e.salt=r,e.iterations=n,e}return o.setupFallback((function(r,n){if(6>o.nodeCrypto.pbkdf2.length)throw new Error("unsupported algorithm: PBKDF2-"+e);try{n=t(n)}catch(e){return Promise.reject(e)}var i=n.length,a=n.salt,s=n.iterations,u=e.replace("-","");return new Promise((function(e,t){o.nodeCrypto.pbkdf2(r,a,s,i,u,(function(r,n){r?t(r):e(n)}))}))}),(function(r,n){try{n=t(n)}catch(e){return Promise.reject(e)}var i=n.length,s=n.salt,u=n.iterations,c=Promise.resolve(r);return c=(c=(c=c.then((function(e){return o.subtleCrypto.importKey("raw",e,"PBKDF2",!1,["deriveBits"])}))).then((function(t){var r={name:"PBKDF2",salt:new Uint8Array(s),iterations:u,hash:e};return o.subtleCrypto.deriveBits(r,t,8*i)}))).then((function(e){return a.asBuffer(e)}))}),(function(r,i){try{i=t(i)}catch(e){return Promise.reject(e)}var a=i.length,o=i.salt,s=i.iterations;return new Promise((function(t,i){var u=n.md[e.replace("-","").toLowerCase()].create();n.pkcs5.pbkdf2(r.toString("binary"),o.toString("binary"),s,a,u,(function(e,r){e?i(e):(r=Buffer.from(r,"binary"),t(r))}))}))}))}function h(e,t){var r="PBKDF2-"+e.replace("HS","SHA-"),n=s.KEYLENGTH[t]/8;return function(o,s,c){c=c||{};var f=a.asBuffer(c.p2s||Buffer.alloc(0),"base64url"),h=c.p2c||8192;if(0>=h)throw new Error("invalid iteration count");if(0===f.length)f=a.randomBytes(16);else if(8>f.length)throw new Error("salt too small");var p={p2s:a.base64url.encode(f),p2c:h};f=l(e,t,f),c=i(c,{salt:f,iterations:h,length:n});var y=Promise.resolve(o);return y=(y=(y=y.then((function(e){return d[r].derive(e,c)}))).then((function(e){return u[t].encrypt(e,s)}))).then((function(e){return e.header=i(e.header||{},p),e}))}}function p(e,t){var r="PBKDF2-"+e.replace("HS","SHA-"),n=s.KEYLENGTH[t]/8;return function(o,s,c){c=c||{};var f=a.asBuffer(c.p2s||Buffer.alloc(0),"base64url"),h=c.p2c||0;if(0>=h)return Promise.reject(new Error("invalid iteration count"));if(8>f.length)return Promise.reject(new Error("salt too small"));f=l(e,t,f),c=i(c,{salt:f,iterations:h,length:n});var p=Promise.resolve(o);return p=(p=p.then((function(e){return d[r].derive(e,c)}))).then((function(e){return u[t].decrypt(e,s)}))}}var d={};["PBKDF2-SHA-256","PBKDF2-SHA-384","PBKDF2-SHA-512"].forEach((function(e){var t=e.replace("PBKDF2-","");d[e]={derive:f(t)}})),["PBES2-HS256+A128KW","PBES2-HS384+A192KW","PBES2-HS512+A256KW"].forEach((function(e){var t=/PBES2-(HS\d+)\+(A\d+KW)/g.exec(e),r=t[1],n=t[2];d[e]={encrypt:h(r,n),decrypt:p(r,n)}})),e.exports=d},8501:(e,t,r)=>{"use strict"; /*! * algorithms/rsa-util.js - RSA Utility Functions * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(6678),i=r(1194),a=r(4237);function o(e,t){var r=t?["n","e"]:["n","e","d","p","q","dp","dq","qi"];return r=r.map((function(t){return new i.jsbn.BigInteger(e[t].toString("hex"),16)})),(t?i.pki.rsa.setPublicKey:i.pki.rsa.setPrivateKey).apply(i.pki.rsa,r)}e.exports={convertToForge:o,convertToJWK:function(e,t){var r=n(e);return(t?["n","e"]:["n","e","d","p","q","dp","dq","qi"]).forEach((function(e){r[e]=a.base64url.encode(r[e])})),delete r.key_ops,delete r.use,delete r.alg,t&&(delete r.d,delete r.p,delete r.q,delete r.dp,delete r.dq,delete r.qi),r},convertToPem:function(e,t){var r,n=t?"__cachedPublicPem":"__cachedPrivatePem";return e[n]?e[n]:(r=t?i.pki.publicKeyToPem(o(e,t)):i.pki.privateKeyToPem(o(e,t)),Object.defineProperty(e,n,{value:r}),r)}}},3516:(e,t,r)=>{"use strict"; /*! * algorithms/rsaes.js - RSA Signatures * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(1194),i=r(3748),a=r(4678),o=r(8501),s={"RSA-OAEP":"RSA_PKCS1_OAEP_PADDING",RSA1_5:"RSA_PKCS1_PADDING"};function u(e){return i.nodeCrypto&&i.nodeCrypto.constants&&-1!==Object.keys(s).indexOf(e)}function c(e){var t={name:e};"RSA-OAEP-256"===e?(t.name="RSA-OAEP",t.hash={name:"SHA-256"}):"RSA-OAEP"===e?t.hash={name:"SHA-1"}:t.name="RSAES-PKCS1-v1_5";var r,c;return r="RSAES-PKCS1-v1_5"!==t.name?function(e,r){return e=o.convertToJWK(e,!0),i.subtleCrypto.importKey("jwk",e,t,!0,["encrypt"]).then((function(e){return i.subtleCrypto.encrypt(t,e,r)})).then((function(e){return{data:Buffer.from(e)}}))}:null,u(e)&&(c=function(t,r){return t=o.convertToPem(t,!0),{data:i.nodeCrypto.publicEncrypt({key:t,padding:i.nodeCrypto.constants[s[e]]},r)}}),i.setupFallback(c,r,(function(e,r){r=new a(r).bytes();var i=o.convertToForge(e,!0),s={};"RSA-OAEP"===t.name&&(s.md=t.hash.name.toLowerCase().replace(/-/g,""),s.md=n.md[s.md].create());var u=i.encrypt(r,t.name.toUpperCase(),s);return u=new a(u).native(),Promise.resolve({data:u})}))}function l(e){var t={name:e};"RSA-OAEP-256"===e?(t.name="RSA-OAEP",t.hash={name:"SHA-256"}):"RSA-OAEP"===e?t.hash={name:"SHA-1"}:t.name="RSAES-PKCS1-v1_5";var r,c;return r="RSAES-PKCS1-v1_5"!==t.name?function(e,r){return e=o.convertToJWK(e,!1),i.subtleCrypto.importKey("jwk",e,t,!0,["decrypt"]).then((function(e){return i.subtleCrypto.decrypt(t,e,r)})).then((function(e){return Buffer.from(e)}))}:null,u(e)?c=function(t,r){return t=o.convertToPem(t,!1),i.nodeCrypto.privateDecrypt({key:t,padding:i.nodeCrypto.constants[s[e]]},r)}:i.nodeCrypto&&"RSA-OAEP"===e&&(c=function(e,t){return e=o.convertToPem(e,!1),i.nodeCrypto.privateDecrypt(e,t)}),i.setupFallback(c,r,(function(e,r){r=new a(r).bytes();var i=o.convertToForge(e,!1),s={};"RSA-OAEP"===t.name&&(s.md=t.hash.name.toLowerCase().replace(/-/g,""),s.md=n.md[s.md].create());var u=i.decrypt(r,t.name.toUpperCase(),s);return u=new a(u).native(),Promise.resolve(u)}))}var f={};["RSA-OAEP","RSA-OAEP-256","RSA1_5"].forEach((function(e){f[e]={encrypt:c(e),decrypt:l(e)}})),e.exports=f},4658:(e,t,r)=>{"use strict"; /*! * algorithms/rsassa.js - RSA Signatures * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(1194),i=r(414),a=r(3748),o=r(8501);function s(){return a.nodeCrypto&&a.nodeCrypto.constants&&a.nodeCrypto.constants.RSA_PSS_SALTLEN_DIGEST}function u(e){var t,r=e.replace("RS","SHA").toLowerCase(),i=e.replace("RS","SHA-"),s={name:"RSASSA-PKCS1-V1_5",hash:{name:i}},u="RSA-"+i.replace("-","");return a.nodeCrypto&&a.nodeCrypto.getHashes().indexOf(u)>-1&&(t=function(e,t){var r=a.nodeCrypto.createSign(u);return r.update(t),{data:t,mac:r.sign(o.convertToPem(e,!1))}}),a.setupFallback(t,(function(e,t){return e=o.convertToJWK(e,!1),a.subtleCrypto.importKey("jwk",e,s,!0,["sign"]).then((function(e){return a.subtleCrypto.sign(s,e,t)})).then((function(e){var r=Buffer.from(e);return{data:t,mac:r}}))}),(function(e,t){var i=n.md[r].create();i.start(),i.update(t);var a=o.convertToForge(e,!1).sign(i,"RSASSA-PKCS1-V1_5");return a=Buffer.from(a,"binary"),Promise.resolve({data:t,mac:a})}))}function c(e){var t,r=e.replace("RS","SHA").toLowerCase(),i={name:"RSASSA-PKCS1-V1_5",hash:{name:e.replace("RS","SHA-")}};return a.nodeCrypto&&a.nodeCrypto.getHashes().indexOf(r)>-1&&(t=function(e,t,n){var i=a.nodeCrypto.createVerify(r);return i.update(t),i.end(),i.verify(o.convertToPem(e,!0),n)?{data:t,mac:n,valid:!0}:Promise.reject(new Error("verification failed"))}),a.setupFallback(t,(function(e,t,r){return e=o.convertToJWK(e,!0),a.subtleCrypto.importKey("jwk",e,i,!0,["verify"]).then((function(e){return a.subtleCrypto.verify(i,e,r,t)})).then((function(e){return e?{data:t,mac:r,valid:!0}:Promise.reject(new Error("verification failed"))}))}),(function(e,t,i){var a=n.md[r].create();a.start(),a.update(t),a=a.digest().bytes();var s=o.convertToForge(e,!0),u=i.toString("binary");return s.verify(a,u,"RSASSA-PKCS1-V1_5")?Promise.resolve({data:t,mac:i,valid:!0}):Promise.reject(new Error("verification failed"))}))}function l(e){var t,r=e.replace("PS","SHA").toLowerCase(),u=e.replace("PS","SHA-"),c={name:"RSA-PSS",hash:{name:u},saltLength:i.HASHLENGTH[u]/8},l="RSA-"+u.replace("-","");return s()&&(t=function(e,t){var r=a.nodeCrypto.createSign(l);return r.update(t),{data:t,mac:r.sign({key:o.convertToPem(e,!1),padding:a.nodeCrypto.constants.RSA_PKCS1_PSS_PADDING,saltLength:a.nodeCrypto.constants.RSA_PSS_SALTLEN_DIGEST})}}),a.setupFallback(t,(function(e,t){return e=o.convertToJWK(e,!1),a.subtleCrypto.importKey("jwk",e,c,!0,["sign"]).then((function(e){return a.subtleCrypto.sign(c,e,t)})).then((function(e){var r=Buffer.from(e);return{data:t,mac:r}}))}),(function(e,t){var a=n.md[r].create();a.start(),a.update(t);var s=n.pss.create({md:n.md[r].create(),mgf:n.mgf.mgf1.create(n.md[r].create()),saltLength:i.HASHLENGTH[u]/8}),c=o.convertToForge(e,!1).sign(a,s);return c=Buffer.from(c,"binary"),Promise.resolve({data:t,mac:c})}))}function f(e){var t,r=e.replace("PS","SHA").toLowerCase(),u=e.replace("PS","SHA-"),c={name:"RSA-PSS",hash:{name:u},saltLength:i.HASHLENGTH[u]/8};return s()&&(t=function(e,t,n){var i=a.nodeCrypto.createVerify(r);return i.update(t),i.end(),i.verify({key:o.convertToPem(e,!0),padding:a.nodeCrypto.constants.RSA_PKCS1_PSS_PADDING,saltLength:a.nodeCrypto.constants.RSA_PSS_SALTLEN_DIGEST},n)?{data:t,mac:n,valid:!0}:Promise.reject(new Error("verification failed"))}),a.setupFallback(t,(function(e,t,r){return e=o.convertToJWK(e,!0),a.subtleCrypto.importKey("jwk",e,c,!0,["verify"]).then((function(e){return a.subtleCrypto.verify(c,e,r,t)})).then((function(e){return e?{data:t,mac:r,valid:!0}:Promise.reject(new Error("verification failed"))}))}),(function(e,t,a){var s=n.md[r].create();s.start(),s.update(t),s=s.digest().bytes();var c=n.pss.create({md:n.md[r].create(),mgf:n.mgf.mgf1.create(n.md[r].create()),saltLength:i.HASHLENGTH[u]/8}),l=o.convertToForge(e,!0),f=a.toString("binary");return l.verify(s,f,c)?Promise.resolve({data:t,mac:a,valid:!0}):Promise.reject(new Error("verification failed"))}))}var h={};["PS256","PS384","PS512"].forEach((function(e){h[e]={sign:l(e),verify:f(e)}})),["RS256","RS384","RS512"].forEach((function(e){h[e]={sign:u(e),verify:c(e)}})),e.exports=h},8545:(e,t,r)=>{"use strict"; /*! * algorithms/sha.js - Cryptographic Secure Hash Algorithms, versions 1 and 2 * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(1194),i=r(3748);var a={};["SHA-1","SHA-256","SHA-384","SHA-512"].forEach((function(e){var t,r,o;a[e]={digest:(t=e,r=t.replace("SHA-","SHA").toLowerCase(),o={name:t},i.setupFallback((function(e){var t=i.nodeCrypto.createHash(r);return t.update(e),t.digest()}),(function(e){return i.subtleCrypto.digest(o,e).then((function(e){return e=Buffer.from(e)}))}),(function(e){var t=n.md[r].create();return t.update(e.toString("binary")),t=Buffer.from(t.digest().bytes(),"binary"),Promise.resolve(t)})))}})),e.exports=a},2150:(e,t,r)=>{"use strict"; /*! * deps/ciphermodes/gcm/helpers.js - AES-GCM Helper Functions * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(3720),i=r(9873),a=r(3891),o=3774873600,s=new n(o>>8);var u=e.exports={E1:o,E1B:225,E1L:s,LOOKUP:function(){for(var e=[],t=0;t<256;++t){for(var r=0,n=7;n>=0;--n)0!=(t&1<>>7-n);e.push(r)}return e}(),arrayCopy:function(e,t,r,n,i){if(t<0||n<0||i<0)throw new TypeError("Invalid input.");if(r instanceof Uint8Array){if(n>=r.length||n+i>r.length)throw new TypeError("Invalid input.");(0!==t||i>>1,n=r<<31,r=e[1],e[1]=r>>>1|n,n=r<<31,r=e[2],e[2]=r>>>1|n,n=r<<31,r=e[3],e[3]=r>>>1|n,r<<31&4294967295;case 2:return r=e[0],t[0]=r>>>1,n=r<<31,r=e[1],t[1]=r>>>1|n,n=r<<31,r=e[2],t[2]=r>>>1|n,n=r<<31,r=e[3],t[3]=r>>>1|n,r<<31&4294967295;default:throw new TypeError("Expected 1 or 2 arguments.")}},shiftRightN:function(e,t,r){var n,i,a;switch(arguments.length){case 2:return i=e[0],n=32-t,e[0]=i>>>t,a=i<>>t|a,a=i<>>t|a,a=i<>>t|a,i<>>t,a=i<>>t|a,a=i<>>t|a,a=i<>>t|a,i<=0;--o)0!=(a&1<>>24];break;case 2:r=u.shiftRightN(e,8,t),t[0]^=u.LOOKUP[r>>>24];break;default:throw new TypeError("Expected 1 or 2 arguments.")}}}},9560:(e,t,r)=>{"use strict"; /*! * deps/ciphermodes/gcm/index.js - AES-GCM implementation Entry Point * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(3720),i=r(1194),a=r(8140),o=r(2150),s=r(3891),u=r(4678),c=r(7826);function l(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=this.blockSize||16}e.exports={createCipher:function(e){var t=new i.aes.Algorithm("AES-GCM",l);return t.initialize({key:new u(e.key)}),t.mode.start(e),t.mode},createDecipher:function(e){var t=new i.aes.Algorithm("AES-GCM",l);return t.initialize({key:new u(e.key)}),t.mode._decrypt=!0,t.mode.start(e),t.mode}},l.prototype.start=function(e){if(this.tag=null,!("iv"in(e=e||{})))throw new Error("Gcm needs ParametersWithIV or AEADParameters");if(this.nonce=e.iv,null==this.nonce||this.nonce.length<1)throw new Error("IV must be at least 1 byte");this.tagLength=16,"tag"in e&&(this.tag=Buffer.from(e.tag));var t=this._decrypt?this.blockSize+this.tagLength:this.blockSize;this.bufBlock=Buffer.alloc(t);var r=e.multiplier;if(null==r&&(r=new a["8k"]),this.multiplier=r,this.H=this.zeroBlock(),c.encrypt(this.cipher,this.H,0,this.H,0),this.multiplier.init(this.H),this.exp=null,this.J0=this.zeroBlock(),12===this.nonce.length)this.nonce.copy(this.J0,0,0,this.nonce.length),this.J0[this.blockSize-1]=1;else{this.gHASH(this.J0,this.nonce,this.nonce.length);var i=this.zeroBlock();s.longToBigEndian(new n(this.nonce.length).multiply(8),i,8),this.gHASHBlock(this.J0,i)}this.S=this.zeroBlock(),this.SAt=this.zeroBlock(),this.SAtPre=this.zeroBlock(),this.atBlock=this.zeroBlock(),this.atBlockPos=0,this.atLength=n.ZERO,this.atLengthPre=n.ZERO,this.counter=Buffer.from(this.J0),this.bufOff=0,this.totalLength=n.ZERO,"additionalData"in e&&this.processAADBytes(e.additionalData,0,e.additionalData.length)},l.prototype.update=function(e,t,r,n,i){for(var a=0;r>0;){var o=Math.min(r,this.bufBlock.length-this.bufOff);e.copy(this.bufBlock,this.bufOff,t,t+o),r-=o,t+=o,this.bufOff+=o,this.bufOff===this.bufBlock.length&&(this.outputBlock(n,i+a),a+=this.blockSize)}return a},l.prototype.finish=function(e,t){var r=0;this._decrypt&&(r+=this.update(this.tag,0,this.tag.length,e,t)),this.totalLength.isZero()&&this.initCipher();var n=this.bufOff;if(this._decrypt){if(n0&&(this.gCTRPartial(this.bufBlock,0,n,e,t+r),r+=n),this.atLength=this.atLength.add(this.atBlockPos);var i=this.zeroBlock();s.longToBigEndian(this.atLength.multiply(8),i,0),s.longToBigEndian(this.totalLength.multiply(8),i,8),this.gHASHBlock(this.S,i);var a=Buffer.alloc(this.blockSize);if(c.encrypt(this.cipher,this.J0,0,a,0),this.xor(a,this.S),this._decrypt){if(!o.arrayEqual(this.tag,a))throw new Error("mac check in Gcm failed")}else this.tag=Buffer.alloc(this.tagLength),a.copy(this.tag,0,0,this.tagLength);return r},l.prototype.initCipher=function(){this.atLength.greaterThan(n.ZERO)&&(this.SAt.copy(this.SAtPre,0,0,this.blockSize),this.atLengthPre=this.atLength.add(n.ZERO)),this.atBlockPos>0&&(this.gHASHPartial(this.SAtPre,this.atBlock,0,this.atBlockPos),this.atLengthPre=this.atLengthPre.add(this.atBlockPos)),this.atLengthPre.greaterThan(n.ZERO)&&this.SAtPre.copy(this.S,0,0,this.blockSize)},l.prototype.outputBlock=function(e,t){this.totalLength.isZero()&&this.initCipher(),this.gCTRBlock(this.bufBlock,e,t),this._decrypt?(this.bufBlock.copy(this.bufBlock,0,this.blockSize,this.blockSize+this.tagLength),this.bufOff=this.tagLength):this.bufOff=0},l.prototype.processAADBytes=function(e,t,r){for(var n=0;n=12;--e){var t=this.counter[e]+1&255;if(this.counter[e]=t,0!==t)break}var r=Buffer.alloc(this.blockSize);return c.encrypt(this.cipher,this.counter,0,r,0),r},l.prototype.gCTRBlock=function(e,t,r){var n=this.getNextCounterBlock();this.xor(n,e),n.copy(t,r,0,this.blockSize),this.gHASHBlock(this.S,this._decrypt?e:n),this.totalLength=this.totalLength.add(this.blockSize)},l.prototype.gCTRPartial=function(e,t,r,n,i){var a=this.getNextCounterBlock();this.xor(a,e,t,r),a.copy(n,i,0,r),this.gHASHPartial(this.S,this._decrypt?e:a,0,r),this.totalLength=this.totalLength.add(r)},l.prototype.gHASHBlock=function(e,t){this.xor(e,t),this.multiplier.multiplyH(e)},l.prototype.gHASHPartial=function(e,t,r,n){this.xor(e,t,r,n),this.multiplier.multiplyH(e)},l.prototype.xor=function(e,t,r,n){switch(arguments.length){case 2:for(var i=15;i>=0;--i)e[i]^=t[i];break;case 4:for(;n-- >0;)e[n]^=t[r+n];break;default:throw new TypeError("Expected 2 or 4 arguments.")}return e},l.prototype.zeroBlock=function(){return Buffer.alloc(16)}},8140:(e,t,r)=>{"use strict"; /*! * deps/ciphermodes/gcm/multipliers.js - AES-GCM Multipliers * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(2150),i=r(3891);function a(){this.H=[],this.M=null}a.prototype.init=function(e){var t,r,i;if(null==this.M)for(this.M=[],t=0;t<32;++t)for(this.M[t]=[],r=0;r<16;++r)for(this.M[t][r]=[],i=0;i<4;++i)this.M[t][r][i]=0;else if(n.arrayEqual(this.H,e))return;for(this.H=e.slice(),n.asInts(e,this.M[1][8]),r=4;r>=1;r>>=1)n.multiplyP(this.M[1][r+r],this.M[1][r]);for(n.multiplyP(this.M[1][1],this.M[0][8]),r=4;r>=1;r>>=1)n.multiplyP(this.M[0][r+r],this.M[0][r]);for(t=0;;){for(r=2;r<16;r+=r)for(i=1;i1)for(r=8;r>0;r>>=1)n.multiplyP8(this.M[t-2][r],this.M[t][r])}},a.prototype.multiplyH=function(e){for(var t=[],r=15;r>=0;--r){var n=this.M[r+r][15&e[r]];t[0]^=n[0],t[1]^=n[1],t[2]^=n[2],t[3]^=n[3],n=this.M[r+r+1][(240&e[r])>>>4],t[0]^=n[0],t[1]^=n[1],t[2]^=n[2],t[3]^=n[3]}i.intToBigEndian(t,e,0)},e.exports={"8k":a}},7826:(e,t,r)=>{"use strict"; /*! * deps/ciphermodes/helpers.js - Cipher Helper Functions * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(3891);e.exports={encrypt:function(e,t,r,i,a){var o=new Array(4),s=new Array(4);n.bigEndianToInt(t,r,o),e.encrypt(o,s),n.intToBigEndian(s,i,a)}}},3891:(e,t,r)=>{"use strict"; /*! * deps/ciphermodes/pack.js - Pack/Unpack Functions * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(3720),i=e.exports={intToBigEndian:function(e,t,r){if("number"==typeof e)switch(arguments.length){case 1:t=Buffer.alloc(4),i.intToBigEndian(e,t,0);break;case 3:t[r]=255&e>>>24,t[++r]=255&e>>>16,t[++r]=255&e>>>8,t[++r]=255&e;break;default:throw new TypeError("Expected 1 or 3 arguments.")}else switch(arguments.length){case 1:t=Buffer.alloc(4*e.length),i.intToBigEndian(e,t,0);break;case 3:for(var n=0;n{"use strict";var n=r(1194).jsbn.BigInteger,i=r(7118);function a(e,t,r,n){this.curve=e,this.g=t,this.n=r,this.h=n}function o(e){return new n(e,16)}a.prototype.getCurve=function(){return this.curve},a.prototype.getG=function(){return this.g},a.prototype.getN=function(){return this.n},a.prototype.getH=function(){return this.h};var s,u,c,l,f,h,p,d=e.exports={secp256r1:(s=o("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),u=o("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),c=o("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),l=o("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),f=n.ONE,h=new i.ECCurveFp(s,u,c),p=h.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"),new a(h,p,l,f)),secp384r1:function(){var e=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF"),t=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC"),r=o("B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF"),s=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973"),u=n.ONE,c=new i.ECCurveFp(e,t,r),l=c.decodePointHex("04AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB73617DE4A96262C6F5D9E98BF9292DC29F8F41DBD289A147CE9DA3113B5F0B8C00A60B1CE1D7E819D7A431D7C90EA0E5F");return new a(c,l,s,u)}(),secp521r1:function(){var e=o("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),t=o("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC"),r=o("0051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00"),s=o("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409"),u=n.ONE,c=new i.ECCurveFp(e,t,r),l=c.decodePointHex("0400C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66011839296A789A3BC0045C8A5FB42C7D1BD998F54449579B446817AFBD17273E662C97EE72995EF42640C550B9013FAD0761353C7086A272C24088BE94769FD16650");return new a(c,l,s,u)}()};d["P-256"]=d.secp256r1,d["P-384"]=d.secp384r1,d["P-521"]=d.secp521r1},1634:(e,t,r)=>{"use strict";var n=r(1194),i=n.jsbn.BigInteger,a=r(7118),o=r(6778);function s(e){return new i(e,16)}function u(e,t){t||(t=Math.ceil(e.bitLength()/8)),t*=2;var r=e.toString(16);for(r=r.substring(Math.max(r.length-t,0));t>r.length;)r="0"+r;return Buffer.from(r,"hex")}function c(e){return"string"==typeof e&&(e=Buffer.from(e,"binary")),s(e.toString("hex"))}function l(e){return Math.ceil(e.getN().bitLength()/8)}function f(e){var t=o[e];if(!t)throw new TypeError("unsupported named curve: "+e);return t}function h(e,t){var r=e.getN().bitLength(),n=8*t.length,i=c(t);return r=0)return!1;if(o.compareTo(i.ONE)<0||a.compareTo(r)>=0)return!1;var s=h(this.params,e),u=o.modInverse(r),l=s.multiply(u).mod(r),f=a.multiply(u).mod(r),p=n.multiplyTwo(l,this.point,f).getX().toBigInteger();return(p=p.mod(r)).equals(a)},d.prototype.toPublicKey=function(){var e=c(this.d),t=this.params.getG().multiply(e);return new p(this.curve,t.getX().toBigInteger(),t.getY().toBigInteger())},d.prototype.sign=function(e){var t,r,a,o,s=l(this.params),f=this.params.getN(),p=this.params.getG(),d=h(this.params,e),y=c(this.d);do{do{do{a=c(n.random.getBytes(s))}while(a.equals(i.ZERO)||a.compareTo(f)>=0);t=p.multiply(a).getX().toBigInteger().mod(f)}while(t.equals(i.ZERO));o=y.multiply(t),o=d.add(o),r=a.modInverse(f).multiply(o).mod(f)}while(r.equals(i.ONE));var v=l(this.params);return{r:t=u(t,v),s:r=u(r,v)}},d.prototype.isValid=function(){var e=c(this.d),t=this.params.getN().subtract(i.ONE);return e.compareTo(i.ONE)>=0&&e.compareTo(t)<0},d.prototype.computeSecret=function(e){var t=c(this.d),r=e.point.multiply(t).getX().toBigInteger();return r=u(r,l(this.params))},t.generateKeyPair=function(e){var t=f(e),r=t.getN(),a=n.random.getBytes(l(t));a=c(a);var o=r.subtract(i.ONE),s=new d(e,a.mod(o).add(i.ONE)),u=s.toPublicKey();return{private:s,public:u}},t.asPublicKey=function(e,t,r){return"string"==typeof t?t=s(t):Buffer.isBuffer(t)&&(t=c(t)),"string"==typeof r?r=s(r):Buffer.isBuffer(r)&&(r=c(r)),new p(e,t,r)},t.asPrivateKey=function(e,t){return"string"==typeof t?t=s(t):Buffer.isBuffer(t)&&(t=c(t)),new d(e,t)}},7118:(e,t,r)=>{"use strict";var n=r(1194).jsbn.BigInteger;function i(){return new n(null)}function a(e){this.r2=i(),this.q3=i(),n.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function o(e,t){this.x=t,this.p=e}function s(e,t,r,i){this.curve=e,this.x=t,this.y=r,this.z=i||n.ONE,this.zinv=null}function u(e,t,r){this.p=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new s(this,null,null),this.reducer=new a(this.p)}a.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=i();return e.copyTo(t),this.reduce(t),t},a.prototype.revert=function(e){return e},a.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},a.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},a.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},o.prototype.equals=function(e){return e===this||this.p.equals(e.p)&&this.x.equals(e.x)},o.prototype.toBigInteger=function(){return this.x},o.prototype.negate=function(){return new o(this.p,this.x.negate().mod(this.p))},o.prototype.add=function(e){return new o(this.p,this.x.add(e.toBigInteger()).mod(this.p))},o.prototype.subtract=function(e){return new o(this.p,this.x.subtract(e.toBigInteger()).mod(this.p))},o.prototype.multiply=function(e){return new o(this.p,this.x.multiply(e.toBigInteger()).mod(this.p))},o.prototype.square=function(){return new o(this.p,this.x.pow(2).mod(this.p))},o.prototype.divide=function(e){return new o(this.p,this.x.multiply(e.toBigInteger().modInverse(this.p)).mod(this.p))},s.prototype.getX=function(){this.zinv||(this.zinv=this.z.modInverse(this.curve.p));var e=this.x.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},s.prototype.getY=function(){this.zinv||(this.zinv=this.z.modInverse(this.curve.p));var e=this.y.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},s.prototype.equals=function(e){return e===this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.p).equals(n.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.p).equals(n.ZERO))},s.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(n.ZERO)&&!this.y.toBigInteger().equals(n.ZERO)},s.prototype.negate=function(){return new s(this.curve,this.x,this.y.negate(),this.z)},s.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.p),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.p);if(n.ZERO.equals(r))return n.ZERO.equals(t)?this.twice():this.curve.getInfinity();var i=new n("3"),a=this.x.toBigInteger(),o=this.y.toBigInteger(),u=r.pow(2),c=u.multiply(r),l=a.multiply(u),f=t.pow(2).multiply(this.z),h=f.subtract(l.shiftLeft(1)).multiply(e.z).subtract(c).multiply(r).mod(this.curve.p),p=l.multiply(i).multiply(t).subtract(o.multiply(c)).subtract(f.multiply(t)).multiply(e.z).add(t.multiply(c)).mod(this.curve.p),d=c.multiply(this.z).multiply(e.z).mod(this.curve.p);return new s(this.curve,this.curve.fromBigInteger(h),this.curve.fromBigInteger(p),d)},s.prototype.twice=function(){if(this.isInfinity())return this;if(0===this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new n("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),i=r.multiply(this.z),a=i.multiply(r).mod(this.curve.p),o=this.curve.a.toBigInteger(),u=t.pow(2).multiply(e);n.ZERO.equals(o)||(u=u.add(this.z.pow(2).multiply(o)));var c=(u=u.mod(this.curve.p)).pow(2).subtract(t.shiftLeft(3).multiply(a)).shiftLeft(1).multiply(i).mod(this.curve.p),l=u.multiply(e).multiply(t).subtract(a.shiftLeft(1)).shiftLeft(2).multiply(a).subtract(u.pow(2).multiply(u)).mod(this.curve.p),f=i.pow(2).multiply(i).shiftLeft(3).mod(this.curve.p);return new s(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(l),f)},s.prototype.multiply=function(e){if(this.isInfinity())return this;if(0===e.signum())return this.curve.getInfinity();var t,r=e,i=r.multiply(new n("3")),a=this.negate(),o=this;for(t=i.bitLength()-2;t>0;--t){o=o.twice();var s=i.testBit(t);s!==r.testBit(t)&&(o=o.add(s?this:a))}return o},s.prototype.multiplyTwo=function(e,t,r){var n;n=e.bitLength()>r.bitLength()?e.bitLength()-1:r.bitLength()-1;for(var i=this.curve.getInfinity(),a=this.add(t);n>=0;)i=i.twice(),e.testBit(n)?i=r.testBit(n)?i.add(a):i.add(this):r.testBit(n)&&(i=i.add(t)),--n;return i},u.prototype.getP=function(){return this.p},u.prototype.getA=function(){return this.a},u.prototype.getB=function(){return this.b},u.prototype.equals=function(e){return e===this||this.p.equals(e.p)&&this.a.equals(e.a)&&this.b.equals(e.b)},u.prototype.contains=function(e){var t=e.getX().toBigInteger(),r=e.getY().toBigInteger(),n=this.a.toBigInteger(),i=this.b.toBigInteger(),a=this.p,o=r.pow(2).mod(a),s=t.pow(3).add(n.multiply(t)).add(i).mod(a);return o.equals(s)},u.prototype.getInfinity=function(){return this.infinity},u.prototype.fromBigInteger=function(e){return new o(this.p,e)},u.prototype.reduce=function(e){this.reducer.reduce(e)},u.prototype.decodePointHex=function(e){switch(parseInt(e.substring(0,2),16)){case 0:return this.infinity;case 2:case 3:return null;case 4:case 6:case 7:var t=(e.length-2)/2,r=e.substr(2,t),i=e.substr(t+2,t);return new s(this,this.fromBigInteger(new n(r,16)),this.fromBigInteger(new n(i,16)));default:return null}},u.prototype.encodePointHex=function(e){if(e.isInfinity())return"00";var t=e.getX().toBigInteger().toString(16),r=e.getY().toBigInteger().toString(16),n=this.getP().toString(16).length;for(n%2!=0&&n++;t.length{"use strict"; /*! * deps/forge.js - Forge Package Customization * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n,i,a=r(3832);function o(e){e=e||{},this.name="",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._blocks=this.blockSize/4,this._inBlock=new Array(this._blocks),this._outBlock=new Array(this._blocks)}r(8925),r(3068),r(5649),r(6607),r(3453),r(8960),r(6953),r(8936),r(9437),r(4742),r(9654),r(4933),r(6007),r(9563),r(137),r(1668),r(3219),r(7116),o.prototype.start=function(){},o.prototype.encrypt=function(e,t,r){if(e.length()0))return!0;var n;for(n=0;n0))return!0;var n;for(n=0;n{"use strict"; /*! * index.js - Main Entry Point * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */"undefined"==typeof Promise&&r(2702).polyfill(),"undefined"==typeof Buffer&&((r.g||window).Buffer=r(8764).lW),"undefined"==typeof process&&((r.g||window).process=r(4155)),process.version||(process.version="");var n=r(2109);e.exports={JWA:r(5382),JWE:r(701),JWK:r(2543),JWS:n,util:r(4237),parse:r(8650),canYouSee:n.createVerify}},4581:(e,t,r)=>{"use strict"; /*! * jwe/decrypt.js - Decrypt from a JWE * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(9752),i=r(3171),a=r(2543),o=r(5029),s=r(9591),u={algorithms:"*"};function c(e,t){var r,c;if(a.isKey(e))c=(r=e).keystore;else{if(!a.isKeyStore(e))throw new TypeError("Keystore must be provided");c=e}t=o(u,t),Object.defineProperty(this,"decrypt",{value:function(e,u){var l=(u=o({},t,u||{})).handlers||{},f=Object.keys(l),h=new i(u.algorithms);if("string"==typeof e)e={protected:(e=e.split("."))[0],recipients:[{encrypted_key:e[1]}],iv:e[2],ciphertext:e[3],tag:e[4]};else if(!e||"object"!=typeof e)throw new Error("invalid input");"encrypted_key"in e&&(e.recipients=[{encrypted_key:e.encrypted_key}]);var p,d,y,v,g,m=e.recipients||[{}];return Promise.resolve(m).then((function(t){if(e.protected){d=n.decode(e.protected).toString("utf8");var r=(d=JSON.parse(d)).crit;if(r){if(!Array.isArray(r))return Promise.reject(new Error("Invalid 'crit' header"));for(var i=0;r.length>i;i++)if(-1===f.indexOf(r[i]))return Promise.reject(new Error("Critical extension is not supported: "+r[i]))}p=d,d=Object.keys(d)}else p={},d=[];return p=o(e.unprotected||{},p),t=t.map((function(e){var t=Promise.resolve(),r=e.header||{};return r=o(r,p),e.header=r,e.protected=d,h.match(r.alg)||(t=t.then((function(){return Promise.reject(new Error("Algorithm not allowed: "+r.alg))}))),h.match(r.enc)||(t=t.then((function(){return Promise.reject(new Error("Algorithm not allowed: "+r.enc))}))),r.epk&&(t=(t=t.then((function(){return a.asKey(r.epk)}))).then((function(e){r.epk=e.toObject(!1)}))),t.then((function(){return e}))})),Promise.all(t)})).then((function(e){var t={};return new Promise((function(i,o){var s=function(){var u=e.shift();if(u){var l=Promise.resolve(u);(l=(l=l.then((function(e){var t=g=e.encrypted_key||"";return t=n.decode(t),(y=r||c.get({use:"enc",alg:e.header.alg,kid:e.header.kid}))?y.unwrap(e.header.alg,t,e.header):Promise.reject()}))).then((function(e){v={kty:"oct",k:n.encode(e)},v=a.asKey(v),t.key=y,t.header=u.header,t.protected=u.protected,i(t)}))).catch(s)}else o(new Error("no key found"))};s()}))})).then((function(t){return t.iv=e.iv,t.tag=e.tag,t.ciphertext=e.ciphertext,t})).then((function(e){var t=[];return f.forEach((function(r){var n;"function"==typeof(r=l[r])?n=r(e):"object"==typeof r&&"function"==typeof r.prepare&&(n=r.prepare(e)),n&&t.push(Promise.resolve(n))})),Promise.all(t).then((function(){return e}))})).then((function(e){return Buffer.isBuffer(e.ciphertext)||(e.ciphertext=n.decode(e.ciphertext)),e})).then((function(t){var r=e.protected;"aad"in e&&null!=e.aad&&(r+="."+e.aad);var n={iv:t.iv,adata:r,tag:t.tag,kdata:g,epu:t.epu,epv:t.epv},i=t.ciphertext;return delete t.iv,delete t.tag,delete t.ciphertext,v.then((function(e){return e.decrypt(t.header.enc,i,n).then((function(e){return t.payload=t.plaintext=e,t}))}))})).then((function(e){return"DEF"===e.header.zip?new Promise((function(t,r){try{var n=s.inflateRaw(Buffer.from(e.plaintext));e.payload=e.plaintext=Buffer.from(n),t(e)}catch(e){r(e)}})):e})).then((function(e){var t=[];return f.forEach((function(r){var n;"object"==typeof(r=l[r])&&"function"==typeof r.complete&&(n=r.complete(e)),n&&t.push(Promise.resolve(n))})),Promise.all(t).then((function(){return e}))}))}})}e.exports={decrypter:c,createDecrypt:function(e,t){return new c(e,t)}}},4051:e=>{"use strict"; /*! * jwe/defaults.js - Defaults for JWEs * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */e.exports={zip:!1,format:"general",contentAlg:"A128CBC-HS256",protect:"*"}},8414:(e,t,r)=>{"use strict"; /*! * jwe/encrypt.js - Encrypt to a JWE * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(4237),i=r(9077).generateCEK,a=r(2543),o=r(9077).slice,s=r(9591),u=r(414),c=r(8583),l=r(6678),f=r(4051);function h(e,t,r){var o=!1,f=e.format||"general",h=!!e.protectAll,p=Buffer.alloc(0);Object.defineProperty(this,"zip",{get:function(){return t.zip||""},enumerable:!0}),Object.defineProperty(this,"compact",{get:function(){return"compact"===f},enumerable:!0}),Object.defineProperty(this,"format",{get:function(){return f},enumerable:!0}),Object.defineProperty(this,"protected",{get:function(){return l(e.protect)},enumerable:!0}),Object.defineProperty(this,"header",{get:function(){return l(t)},enumerable:!0}),Object.defineProperty(this,"update",{value:function(e,t){if(o)throw new Error("already final");return null!=e&&(e=n.asBuffer(e,t),p=p.length?Buffer.concat([p,e],p.length+e.length):e),this}}),Object.defineProperty(this,"final",{value:function(d,y){if(o)return Promise.reject(new Error("already final"));this.update(d,y),o=!0;var v,g=Promise.resolve({}),m=t.enc;g=(g=g.then((function(t){return e.cek&&(v=a.asKey(e.cek)),t}))).then((function(o){var s=Promise.all(r);return s=(s=s.then((function(r){var o=1===r.length;return r=r.map((function(r){return function(r,o){var s={};s=c(s,t),s=c(s,r.header);var u,f,h=r.key,p=s.alg;return 0===(s.alg||"").indexOf("ECDH-ES")?(u=h.keystore.temp(),f=r.epk?Promise.resolve(r.epk).then((function(e){r.header.epk=e.toJSON(!1,["kid"]),s.epk=e.toObject(!0,["kid"])})):u.generate("EC",h.get("crv")).then((function(e){r.header.epk=e.toJSON(!1,["kid"]),s.epk=e.toObject(!0,["kid"])}))):f=Promise.resolve(),(f=f.then((function(){var r,n;return"dir"===p&&o?n=(v=Promise.resolve(h)).then((function(e){return m||(s.enc=t.enc=m=e.algorithms(a.MODE_ENCRYPT)[0]),{once:!0,direct:!0}})):(v||(m||(s.enc=t.enc=m=e.contentAlg),v=i(m)),n=(n=v.then((function(e){return r=e.get("k",!0),h}))).then((function(e){return e.wrap(p,r,s)}))),n}))).then((function(e){if(e.once&&!o)return Promise.reject(new Error("cannot use 'alg':'"+p+"' with multiple recipients"));var t,i={};return e.data&&(t=e.data,t=n.base64url.encode(t)),e.direct&&t?v=a.asKey({kty:"oct",k:t}):t&&(i.encrypted_key=t),r.header&&Object.keys(r.header).length&&(i.header=l(r.header||{})),e.header&&(i.header=c(i.header||{},e.header)),i}))}(r,o)})),Promise.all(r)}))).then((function(e){return o.recipients=e.filter((function(e){return!!e})),o}))}));var b={};switch(g=(g=(g=g.then((function(r){var i,a,o,s;return o=l(t),h&&1===r.recipients.length||"compact"===f?(i={},i=c({},o,r.recipients[0].header),a=Object.keys(i).length,o=void 0,s=0,delete r.recipients[0].header,0===Object.keys(r.recipients[0]).length&&r.recipients.splice(0,1)):(i={},a=0,s=Object.keys(o).length,e.protect.forEach((function(e){e in o&&(i[e]=o[e],a++,delete o[e],s--)})),r.recipients=(r.recipients||[]).map((function(e){var t=(e=e||{}).header;return t&&(Object.keys(t).forEach((function(e){e in i&&delete t[e]})),Object.keys(t).length||delete e.header),e}))),r.recipients&&0!==r.recipients.length||delete r.recipients,o&&s>0&&(b=c(b,o),r.unprotected=o),i&&a>0&&(b=c(b,i),i=JSON.stringify(i),r.protected=n.base64url.encode(i,"utf8")),r}))).then((function(e){var t=p;return b.zip?"DEF"===b.zip?new Promise((function(r,n){try{var i=s.deflateRaw(Buffer.from(t,"binary"));e.plaintext=i,r(e)}catch(e){n(e)}})):Promise.reject(new Error("unsupported 'zip' mode")):(e.plaintext=t,e)}))).then((function(t){b.adata=t.protected,"aad"in e&&null!=e.aad&&(b.adata+="."+e.aad,b.adata=Buffer.from(b.adata,"utf8"));var r=e.iv||n.randomBytes(u.NONCELENGTH[m]/8);"string"==typeof r&&(r=n.base64url.decode(r)),b.iv=r,"recipients"in t&&1===t.recipients.length&&(b.kdata=t.recipients[0].encrypted_key),"epu"in e&&null!=e.epu&&(b.epu=e.epu),"epv"in e&&null!=e.epv&&(b.epv=e.epv);var i=t.plaintext;return delete t.plaintext,v.then((function(a){var o=a.encrypt(m,i,b);return o=o.then((function(i){return t.iv=n.base64url.encode(r,"binary"),"aad"in e&&null!=e.aad&&(t.aad=e.aad),t.ciphertext=n.base64url.encode(i.data,"binary"),t.tag=n.base64url.encode(i.tag,"binary"),t}))}))})),f){case"compact":g=g.then((function(e){var t=new Array(5);return t[0]=e.protected,e.recipients&&e.recipients[0]&&(t[1]=e.recipients[0].encrypted_key),t[2]=e.iv,t[3]=e.ciphertext,t[4]=e.tag,t=t.join(".")}));break;case"flattened":g=g.then((function(e){var t={},r=e.recipients&&e.recipients[0];return e.protected&&(t.protected=e.protected),e.unprotected&&(t.unprotected=e.unprotected),["header","encrypted_key"].forEach((function(e){r&&e in r&&r[e]&&("object"!=typeof r[e]||Object.keys(r[e]).length)&&(t[e]=r[e])})),e.aad&&(t.aad=e.aad),t.iv=e.iv,t.ciphertext=e.ciphertext,t.tag=e.tag,t}));break;case"general":g=g.then((function(e){var t=e.recipients||[];return(t=(t=t.map((function(e){if(Object.keys(e).length)return e}))).filter((function(e){return!!e}))).length?e.recipients=t:delete e.recipients,e}))}return g}})}e.exports={encrypter:h,createEncrypt:function(e,t){var r=e,i=1,s=t;if(0===arguments.length)throw new Error("at least one recipient must be provided");1===arguments.length||a.isKey(e)||e&&"kty"in e||e&&"key"in e&&(a.isKey(e.key)||"kty"in e.key)?(s=e,i=0,r={}):r=l(e),Array.isArray(s)||(s=o(arguments,i)),r=c(l(f),r);var u=l(r.fields||{});switch(r.zip&&(u.zip="boolean"==typeof r.zip?!!r.zip&&"DEF":r.zip),r.format=(r.compact?"compact":r.format)||"general",r.format){case"compact":if("aad"in e)throw new Error("additional authenticated data cannot be used for compact serialization");case"flattened":if(s.length>1)throw new Error("too many recipients for compact serialization")}var p=!1;if("compact"===r.format||"*"===r.protect)p=!0,r.protect=Object.keys(u).concat("enc");else if("string"==typeof r.protect)r.protect=[r.protect];else if(Array.isArray(r.protect))r.protect=r.protect.concat();else{if(r.protect)throw new Error("protect must be a list of fields");r.protect=[]}if(p&&1{"use strict"; /*! * jwe/helpers.js - JWE Internal Helper Functions * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(414),i=r(2543);e.exports={slice:function(e,t){return Array.prototype.slice.call(e,t||0)},generateCEK:function(e){var t=i.createKeyStore(),r=n.KEYLENGTH[e];if(r)return t.generate("oct",r);throw new Error("unsupported encryption algorithm")}}},701:(e,t,r)=>{"use strict"; /*! * jwe/index.js - JSON Web Encryption (JWE) Entry Point * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n={createEncrypt:r(8414).createEncrypt,createDecrypt:r(4581).createDecrypt};e.exports=n},7136:(e,t,r)=>{"use strict"; /*! * jwk/basekey.js - JWK Key Base Class Implementation * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(5029),i=r(5877),a=r(8583),o=r(6678),s=r(5564),u=r(5325),c=r(7557),l=r(8718),f=r(4908),h=r(5382),p=r(6395),d=r(9684),y=r(4237);e.exports=function(e,t,r,v){if(!e)throw new Error("kty cannot be null");if(!t)throw new Error("keystore cannot be null");if(!r)throw new Error("props cannot be null");if("string"==typeof r&&(r=JSON.parse(r)),!v)throw new Error("cfg cannot be null");var g,m,b=[],E={},S={};r=o(r),g=a({},r[d.INTERNALS.THUMBPRINT_KEY]||{}),delete r[d.INTERNALS.THUMBPRINT_KEY],Object.keys(g).forEach((function(e){var t=g[e];m||(m=t,Buffer.isBuffer(m)&&(m=y.base64url.encode(m))),Buffer.isBuffer(t)||(t=y.base64url.decode(t),g[e]=t)})),r.kty=e,r.kid=r.kid||m||i();var C,w=Object.keys(d.COMMON_PROPS).map((function(e){return d.COMMON_PROPS[e].name}));S.base=l(r,w),b=b.concat(Object.keys(S.base)),S.public=o(r),E.public=v.publicKey(S.public),E.public&&(b=b.concat(Object.keys(S.public))),S.private=o(r),E.private=v.privateKey(S.private),E.private&&(b=b.concat(Object.keys(S.private))),S.extra=c(r,b),C=E.public&&"length"in E.public?E.public.length:E.private&&"length"in E.private?E.private.length:NaN,Object.defineProperty(this,"keystore",{value:t,enumerable:!0}),Object.defineProperty(this,"length",{value:C,enumerable:!0}),Object.defineProperty(this,"kty",{value:e,enumerable:!0}),Object.defineProperty(this,"kid",{value:S.base.kid,enumerable:!0}),Object.defineProperty(this,"use",{value:S.base.use||"",enumerable:!0}),Object.defineProperty(this,"alg",{value:S.base.alg||"",enumerable:!0}),Object.defineProperty(this,"thumbprint",{value:function(e){if(e=(e||d.INTERNALS.THUMBPRINT_HASH).toUpperCase(),g[e])return Promise.resolve(g[e]);var t=d.thumbprint(v,S,e);return t=t.then((function(t){return t&&(g[e]=t),t}))}}),Object.defineProperty(this,"algorithms",{value:function(t){var r=[];this.use&&"sig"!==this.use||(t&&p.MODE_SIGN!==t||r.push(p.MODE_SIGN),t&&p.MODE_VERIFY!==t||r.push(p.MODE_VERIFY)),this.use&&"enc"!==this.use||(t&&p.MODE_ENCRYPT!==t||r.push(p.MODE_ENCRYPT),t&&p.MODE_DECRYPT!==t||r.push(p.MODE_DECRYPT),t&&p.MODE_WRAP!==t||r.push(p.MODE_WRAP),t&&p.MODE_UNWRAP!==t||r.push(p.MODE_UNWRAP));var n,i=this,a=r.map((function(e){return v.algorithms.call(i,E,e)}));(a=s(a),a=f(a),this.alg)&&(n="oct"===e?[this.alg,"dir"]:[this.alg],a=u(a,n));return a}}),Object.defineProperty(this,"supports",{value:function(e,t){return-1!==this.algorithms(t).indexOf(e)}}),Object.defineProperty(this,"has",{value:function(e,t){var r=!1;return r=(r=(r=(r=r||!(!S.base||!(e in S.base)))||!(!E.public||!(e in E.public)))||!(!S.extra||!(e in S.extra)))||!!(t&&E.private&&e in E.private)}}),Object.defineProperty(this,"get",{value:function(e,t){var r;return S.base&&e in S.base?r=S.base:E.public&&e in E.public?r=E.public:S.extra&&e in S.extra?r=S.extra:t&&E.private&&e in E.private&&(r=E.private),r&&r[e]||null}}),Object.defineProperty(this,"toJSON",{value:function(e,t){Array.isArray(e)&&(t=e,e=!1);var r={};return r=n(r,S.base,S.public,"boolean"==typeof e&&e?S.private:{},S.extra),r=c(r,t||[])}}),Object.defineProperty(this,"toPEM",{value:function(e){if(null===e&&(e=!1),!v.convertToPEM)throw new Error("Unsupported key type for PEM encoding");var t=e?E.private:E.public;if(!t)throw new Error("Invalid key");return v.convertToPEM.call(this,t,e)}}),Object.defineProperty(this,"toObject",{value:function(e,t){Array.isArray(e)&&(t=e,e=!1);var r={};return r=n(r,S.base,E.public,"boolean"==typeof e&&e?E.private:{},S.extra),r=c(r,(t||[]).concat("length"))}}),Object.defineProperty(this,"sign",{value:function(e,t,r){if(-1===this.algorithms("sign").indexOf(e))return Promise.reject(new Error("unsupported algorithm"));var i=v.signKey.call(this,e,E);return i?(r=r?o(r):{},v.signProps&&(r=n(r,v.signProps.call(this,e,r))),h.sign(e,i,t,r)):Promise.reject(new Error("improper key"))}}),Object.defineProperty(this,"verify",{value:function(e,t,r,i){if(-1===this.algorithms("verify").indexOf(e))return Promise.reject(new Error("unsupported algorithm"));var a=v.verifyKey.call(this,e,E);return a?(i=i?o(i):{},v.verifyProps&&(i=n(i,v.verifyProps.call(this,e,i))),h.verify(e,a,t,r,i)):Promise.reject(new Error("improper key"))}}),Object.defineProperty(this,"encrypt",{value:function(e,t,r){if(-1===this.algorithms("encrypt").indexOf(e))return Promise.reject(new Error("unsupported algorithm"));var i=v.encryptKey.call(this,e,E);return i?(r=r?o(r):{},v.encryptProps&&(r=n(r,v.encryptProps.call(this,e,r))),h.encrypt(e,i,t,r)):Promise.reject(new Error("improper key"))}}),Object.defineProperty(this,"decrypt",{value:function(e,t,r){if(-1===this.algorithms("decrypt").indexOf(e))return Promise.reject(new Error("unsupported algorithm"));var i=v.decryptKey.call(this,e,E);return i?(r=r?o(r):{},v.decryptProps&&(r=n(r,v.decryptProps.call(this,e,r))),h.decrypt(e,i,t,r)):Promise.reject(new Error("improper key"))}}),Object.defineProperty(this,"wrap",{value:function(e,t,r){if(-1===this.algorithms("wrap").indexOf(e))return Promise.reject(new Error("unsupported algorithm"));var i=v.wrapKey.call(this,e,E);return i?(r=r?o(r):{},v.wrapProps&&(r=n(r,v.wrapProps.call(this,e,r))),h.encrypt(e,i,t,r)):Promise.reject(new Error("improper key"))}}),Object.defineProperty(this,"unwrap",{value:function(e,t,r){if(-1===this.algorithms("unwrap").indexOf(e))return Promise.reject(new Error("unsupported algorithm"));var i=v.unwrapKey.call(this,e,E);return i?(r=r?o(r):{},v.unwrapProps&&(r=n(r,v.unwrapProps.call(this,e,r))),h.decrypt(e,i,t,r)):Promise.reject(new Error("improper key"))}})}},6395:e=>{"use strict"; /*! * jwk/constants.js - Constants for JWKs * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */e.exports={MODE_SIGN:"sign",MODE_VERIFY:"verify",MODE_ENCRYPT:"encrypt",MODE_DECRYPT:"decrypt",MODE_WRAP:"wrap",MODE_UNWRAP:"unwrap"}},5339:(e,t,r)=>{"use strict"; /*! * jwk/rsa.js - RSA Key Representation * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(1762),i=r(1194),a=r(1634),o={BaseKey:r(7136),helpers:r(9684)},s=["ES256","ES384","ES512"],u=["ECDH-ES","ECDH-ES+A128KW","ECDH-ES+A192KW","ECDH-ES+A256KW"],c=n.EC_OID;function l(e){switch(e){case"1.2.840.10045.3.1.7":return"P-256";case"1.3.132.0.34":return"P-384";case"1.3.132.0.35":return"P-521";default:return null}}var f={publicKey:function(e){var t=o.helpers.COMMON_PROPS.concat([{name:"crv",type:"string"},{name:"x",type:"binary"},{name:"y",type:"binary"}]),r=o.helpers.unpackProps(e,t);return r&&r.crv&&r.x&&r.y?r.length=n.curveSize(r.crv):(delete r.crv,delete r.x,delete r.y),r},privateKey:function(e){var t=o.helpers.COMMON_PROPS.concat([{name:"crv",type:"string"},{name:"x",type:"binary"},{name:"y",type:"binary"},{name:"d",type:"binary"}]),r=o.helpers.unpackProps(e,t);return r&&r.crv&&r.x&&r.y&&r.d?r.length=n.curveSize(r.crv):r=void 0,r},thumbprint:function(e){return e.public&&(e=e.public),{crv:e.crv,kty:"EC",x:e.x,y:e.y}},algorithms:function(e,t){var r=e.public&&e.public.length||e.private&&e.private.length||0;switch(521===r&&(r=512),t){case"encrypt":case"decrypt":return[];case"wrap":return e.public&&u||[];case"unwrap":return e.private&&u||[];case"sign":return e.private?s.filter((function(e){return e==="ES"+r})):[];case"verify":return e.public?s.filter((function(e){return e==="ES"+r})):[]}},encryptKey:function(e,t){return t.public},decryptKey:function(e,t){return t.private},wrapKey:function(e,t){return t.public},unwrapKey:function(e,t){return t.private},signKey:function(e,t){return t.private},verifyKey:function(e,t){return t.public}};f.convertToPEM=n.convertToPEM;var h={oid:c,privateKey:{name:"ECPrivateKey",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"ECPrivateKey.version",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.INTEGER,constructed:!1},{name:"ECPrivateKey.private",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.OCTETSTRING,constructed:!1,capture:"d"},{tagClass:i.asn1.Class.CONTEXT_SPECIFIC,name:"ECPrivateKey.parameters",constructed:!0,value:[{name:"ECPrivateKey.namedCurve",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.OID,constructed:!1,capture:"crv"}]},{name:"ECPrivateKey.publicKey",tagClass:i.asn1.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"ECPrivateKey.point",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.BITSTRING,constructed:!1,capture:"point"}]}]},embeddedPrivateKey:{name:"ECPrivateKey",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"ECPrivateKey.version",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.INTEGER,constructed:!1},{name:"ECPrivateKey.private",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.OCTETSTRING,constructed:!1,capture:"d"},{name:"ECPrivateKey.publicKey",tagClass:i.asn1.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"ECPrivateKey.point",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.BITSTRING,constructed:!1,capture:"point"}]}]}},p={kty:"EC",validators:h,prepare:function(e){var t=f,r=Promise.resolve(e);return r=(r=r.then((function(e){return o.helpers.thumbprint(t,e)}))).then((function(r){var n={};return n[o.helpers.INTERNALS.THUMBPRINT_HASH]=r,e[o.helpers.INTERNALS.THUMBPRINT_KEY]=n,t}))},generate:function(e){var t=a.generateKeyPair(e),r={crv:e,x:t.public.x,y:t.public.y,d:t.private.d};return Promise.resolve(r)},import:function(e){if(h.oid!==e.keyOid)return null;var t;if(e.keyParams&&i.asn1.Type.OID===e.keyParams.type?t=l(t=i.asn1.derToOid(e.keyParams.value)):e.crv&&(t=l(t=i.asn1.derToOid(e.crv))),!t)return null;if(!e.parsed){var r={};if("private"===e.type){if("string"==typeof e.keyValue?e.keyValue=i.asn1.fromDer(e.keyValue):Array.isArray(e.keyValue)&&(e.keyValue=e.keyValue[0]),!i.asn1.validate(e.keyValue,h.embeddedPrivateKey,r,[]))return null}else r.point=e.keyValue;e=r}var n={kty:"EC",crv:t};if(e.d&&(n.d=Buffer.from(e.d,"binary")),e.point){var a=Buffer.from(e.point,"binary");if(4!==a.readUInt16BE(0))return null;var o=(a=a.slice(2)).length/2;n.x=a.slice(0,o),n.y=a.slice(o)}return n}};e.exports=Object.freeze({config:f,factory:p}),r(4567).registry.register(p)},9684:(e,t,r)=>{"use strict"; /*! * jwk/helpers.js - JWK Internal Helper Functions and Constants * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(6678),i=r(4237),a=r(1194),o=r(5382),s={name:"PrivateKeyInfo",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.INTEGER,constructed:!1,capture:"keyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.OID,constructed:!1,capture:"keyOid"},{name:"AlgorithmIdentifier.parameters",captureAsn1:"keyParams"}]},{name:"PrivateKeyInfo",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.OCTETSTRING,constructed:!1,capture:"keyValue"}]},u={name:"SubjectPublicKeyInfo",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.OID,constructed:!1,capture:"keyOid"},{name:"AlgorithmIdentifier.parameters",captureAsn1:"keyParams"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.BITSTRING,constructed:!1,capture:"keyValue"}]},c={name:"Certificate",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,captureAsn1:"certificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:a.asn1.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:a.asn1.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},u,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:a.asn1.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.BITSTRING,constructed:!1,capture:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:a.asn1.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.BITSTRING,constructed:!1,capture:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:a.asn1.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:a.asn1.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.BITSTRING,constructed:!1,capture:"certSignature"}]},l={THUMBPRINT_KEY:"internal\0thumbprint",THUMBPRINT_HASH:"SHA-256"};e.exports={validators:{privateKey:s,publicKey:u,certificate:c},thumbprint:function(e,t,r){if("function"!=typeof e.thumbprint)return Promise.reject(new Error("thumbprint not supported"));r=(r||l.THUMBPRINT_HASH).toUpperCase();var n=e.thumbprint(t),a=Object.keys(n).sort().map((function(e){var t=n[e];return Buffer.isBuffer(t)&&(t=i.base64url.encode(t)),JSON.stringify(e)+":"+JSON.stringify(t)}));a="{"+a.join(",")+"}";try{return o.digest(r,Buffer.from(a,"utf8"))}catch(e){return Promise.reject(e)}},unpackProps:function(e,t){var r;t.forEach((function(t){if(t.name in e){r=r||{};var a=e[t.name];switch(t.type){case"binary":Buffer.isBuffer(a)?e[t.name]=i.base64url.encode(a):a=i.base64url.decode(a);break;case"string":case"number":case"boolean":break;case"array":a=[].concat(a);break;case"object":a=n(a)}r[t.name]=a}}));var a=r||{};return Object.keys(e).forEach((function(t){t in a||delete e[t]})),r},COMMON_PROPS:[{name:"kty",type:"string"},{name:"kid",type:"string"},{name:"use",type:"string"},{name:"alg",type:"string"},{name:"x5c",type:"array"},{name:"x5t",type:"binary"},{name:"x5u",type:"string"},{name:"key_ops",type:"array"}],INTERNALS:l}},2543:(e,t,r)=>{"use strict"; /*! * jwk/index.js - JSON Web Key (JWK) Entry Point * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(4567);Object.keys(n.KeyStore).forEach((function(e){t[e]=n.KeyStore[e]}));var i=r(6395);Object.keys(i).forEach((function(e){t[e]=i[e]})),r(9170),r(9746),r(5339)},4567:(e,t,r)=>{"use strict"; /*! * jwk/keystore.js - JWK KeyStore Implementation * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(6678),i=r(5029),a=r(1194),o=r(4237),s={BaseKey:r(7136),helpers:r(9684)},u=function(){var e={};Object.defineProperty(this,"register",{value:function(t){if(!t||"string"!=typeof t.kty||!t.kty)throw new Error("invalid Key factory");var r=t.kty;return e[r]=t,this}}),Object.defineProperty(this,"unregister",{value:function(t){if(!t||"string"!=typeof t.kty||!t.kty)throw new Error("invalid Key factory");var r=t.kty;return t===e[r]&&delete e[r],this}}),Object.defineProperty(this,"get",{value:function(t){return e[t||""]||void 0}}),Object.defineProperty(this,"all",{value:function(){return Object.keys(e).map((function(t){return e[t]}))}})},c=new u;function l(e,t){var r,n={},i=[],u=t.form,l=t.body,f=null;switch(t=a.asn1.fromDer(l),u){case"private":e.all().some((function(e){if(r)return!1;if(!e.validators)return!1;var o=e.validators.oid,s=e.validators.privateKey;return!!s&&(n={},i=[],(r=a.asn1.validate(t,s,n,i))&&(n.keyOid=a.asn1.oidToDer(o),n.parsed=!0),r)})),n.type="private";break;case"pkcs8":r=a.asn1.validate(t,s.helpers.validators.privateKey,n,i),n.type="private";break;case"public":case"spki":r=a.asn1.validate(t,s.helpers.validators.publicKey,n,i),n.type="public";break;case"pkix":case"x509":if(r=a.asn1.validate(t,s.helpers.validators.certificate,n,i)){n=function(e){return["certIssuer","certSubject"].forEach((function(t){var r=a.pki.RDNAttributesAsArray(e[t]),n=e[t]={};r.forEach((function(e){n[e.name||e.type]=e.value}))})),e}(n);var h=a.md.sha1.create();h.update(l),f=o.base64url.encode(Buffer.from(h.digest().toHex(),"hex"))}n.type="public"}return r?(n.keyOid&&(n.keyOid=a.asn1.derToOid(n.keyOid)),r=null,c.all().forEach((function(e){r||e&&"function"==typeof e.import&&(r=e.import(n))})),r&&n.certSubject&&n.certSubject.commonName&&(r.kid=n.certSubject.commonName),r&&f&&(r.x5t=f),r):null}var f=function(e,t){var r={};Object.defineProperty(this,"generate",{value:function(t,r,a){var o=e.get(t);if(!o)return Promise.reject(new Error("unsupported key type"));(a=n(a||{})).kty=t;var s=this;return o.generate(r).then((function(e){return e=i(a,e,{kty:t}),s.add(e)}))}}),Object.defineProperty(this,"add",{value:function(t,i,o){var u;if(o=o||{},Buffer.isBuffer(t)||"string"==typeof t)if("json"===(i=(i||"json").toLowerCase()))t=JSON.parse(t.toString("utf8"));else try{if(u="pem"===i?function(e){var t={};if(!a.pem.decode(e).some((function(e){switch(e.type){case"CERTIFICATE":t.form="pkix";break;case"PUBLIC KEY":t.form="spki";break;case"PRIVATE KEY":t.form="pkcs8";break;case"EC PRIVATE KEY":case"RSA PRIVATE KEY":t.form="private";break;default:return!1}return t.body=e.body,!0})))throw new Error("supported PEM type not found");return t}(t):{body:t.toString("binary"),form:i},!(t=l(e,u)))throw new Error("no importer for key");Object.keys(o).forEach((function(e){t[e]=o[e]}))}catch(e){return Promise.reject(e)}else t=f.isKey(t)?t.toJSON(!0):n(t);var c=e.get(t.kty);if(!c)return Promise.reject(new Error("unsupported key type"));var h=this;return c.prepare(t).then((function(e){return new s.BaseKey(t.kty,h,t,e)})).then((function(e){var t=e.kid||"";return(r[t]=r[t]||[]).push(e),e}))}}),Object.defineProperty(this,"remove",{value:function(e){if(e){var t=r[e.kid];if(t){var n=t.indexOf(e);-1!==n&&(t.splice(n,1),t.length||delete r[e.kid])}}}}),Object.defineProperty(this,"all",{value:function(e,n){void 0!==(e=e||{}).kid&&null!==e.kid&&"string"!=typeof e.kid&&(e.kid=String(e.kid));var i=[],a=function(t){return(!e.kty||!t.kty||e.kty===t.kty)&&((!e.use||!t.use||e.use===t.use)&&(!e.alg||("dir"===e.alg||!t.alg||e.alg===t.alg)&&t.supports(e.alg)))};return Object.keys(r).forEach((function(t){if(!e.kid||e.kid===t){var n=r[t].filter(a);n.length&&(i=i.concat(n))}})),!n&&t&&(i=i.concat(t.all(e))),i}}),Object.defineProperty(this,"get",{value:function(e,r,n){"boolean"==typeof e?(n=e,r=e=null):"object"==typeof e&&(n=r,r=e,e=null),r=r||{},e&&(r.kid=e),void 0!==r.kid&&null!==r.kid&&"string"!=typeof r.kid&&(r.kid=String(r.kid));var i=this.all(r,!0);return i.length||!t||n||(i=t.get(r,n)),i[0]||null}}),Object.defineProperty(this,"temp",{value:function(){return new f(e,this)}}),Object.defineProperty(this,"toJSON",{value:function(e){var t=[];return Object.keys(r).forEach((function(n){var i=r[n].map((function(t){return t.toJSON(e)}));t=t.concat(i)})),{keys:t}}})};f.isKeyStore=function(e){return!!e&&("object"==typeof e&&("function"==typeof e.get&&"function"==typeof e.all&&"function"==typeof e.generate&&"function"==typeof e.add&&"function"==typeof e.remove))},f.createKeyStore=function(){return new f(c)},f.asKeyStore=function(e){if(f.isKeyStore(e))return Promise.resolve(e);var t,r=f.createKeyStore();if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e))t=e;else{if(!("keys"in e))return Promise.reject(new Error("invalid keystore"));t=e.keys}t=t.map((function(e){return r.add(e)}));var n=Promise.all(t);return n=n.then((function(){return r}))},f.isKey=function(e){return!!e&&("object"==typeof e&&(!!f.isKeyStore(e.keystore)&&("string"==typeof e.kty&&"number"==typeof e.length&&"function"==typeof e.algorithms&&"function"==typeof e.supports&&"function"==typeof e.encrypt&&"function"==typeof e.decrypt&&"function"==typeof e.wrap&&"function"==typeof e.unwrap&&"function"==typeof e.sign&&"function"==typeof e.verify)))},f.createKey=function(e,t,r){return f.createKeyStore().generate(e,t,r)},f.asKey=function(e,t,r){return f.isKey(e)?Promise.resolve(e):e=f.createKeyStore().add(e,t,r)},e.exports={KeyRegistry:u,KeyStore:f,registry:c}},9170:(e,t,r)=>{"use strict"; /*! * jwk/octkey.js - Symmetric Octet Key Representation * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(4237),i={BaseKey:r(7136),helpers:r(9684)},a=["HS256","HS384","HS512"],o=["A128GCM","A192GCM","A256GCM","A128CBC-HS256","A192CBC-HS384","A256CBC-HS512","A128CBC+HS256","A192CBC+HS384","A256CBC+HS512"],s=["A128KW","A192KW","A256KW","A128GCMKW","A192GCMKW","A256GCMKW","PBES2-HS256+A128KW","PBES2-HS384+A192KW","PBES2-HS512+A256KW","dir"];function u(e,t){return"iv"in t&&(t.iv=Buffer.isBuffer(t.iv)?t.iv:n.base64url.decode(t.iv||"")),"adata"in t&&(t.adata=Buffer.isBuffer(t.adata)?t.adata:Buffer.from(t.adata||"","utf8")),"mac"in t&&(t.mac=Buffer.isBuffer(t.mac)?t.mac:n.base64url.decode(t.mac||"")),"tag"in t&&(t.tag=Buffer.isBuffer(t.tag)?t.tag:n.base64url.decode(t.tag||"")),t}function c(e,t){return"iv"in t&&(t.iv=Buffer.isBuffer(t.iv)?t.iv:n.base64url.decode(t.iv||"")),"adata"in t&&(t.adata=Buffer.isBuffer(t.adata)?t.adata:Buffer.from(t.adata||"","utf8")),t}var l={publicKey:function(e){var t=i.helpers.COMMON_PROPS.concat([]);return i.helpers.unpackProps(e,t)},privateKey:function(e){var t,r=i.helpers.COMMON_PROPS.concat([{name:"k",type:"binary"}]);return(t=i.helpers.unpackProps(e,r))&&t.k?t.length=8*t.k.length:t=void 0,t},thumbprint:function(e){return e.private&&(e=e.private),{k:e.k||"",kty:"oct"}},algorithms:function(e,t){var r=e.private&&8*e.private.k.length,n=[256,384,512];if(!r)return[];switch(t){case"encrypt":case"decrypt":return o.filter((function(e){return e==="A"+r/2+"CBC-HS"+r||e==="A"+r/2+"CBC+HS"+r||e==="A"+r+"GCM"}));case"sign":case"verify":return a.filter((function(e){var t=!1;return n.forEach((function(n){n>r||(t|=e==="HS"+n)})),t}));case"wrap":case"unwrap":return s.filter((function(e){return e==="A"+r+"KW"||e==="A"+r+"GCMKW"||0===e.indexOf("PBES2-")||"dir"===e}))}return[]},encryptKey:function(e,t){return t.private&&t.private.k},encryptProps:c,decryptKey:function(e,t){return t.private&&t.private.k},decryptProps:u,wrapKey:function(e,t){return t.private&&t.private.k},wrapProps:c,unwrapKey:function(e,t){return t.private&&t.private.k},unwrapProps:u,signKey:function(e,t){return t.private&&t.private.k},verifyKey:function(e,t){return t.private&&t.private.k}},f={kty:"oct",prepare:function(e){var t=l,r=Promise.resolve(e);return r=(r=r.then((function(e){return i.helpers.thumbprint(t,e)}))).then((function(r){var n={};return n[i.helpers.INTERNALS.THUMBPRINT_HASH]=r,e[i.helpers.INTERNALS.THUMBPRINT_KEY]=n,t}))},generate:function(e){var t=n.randomBytes(e/8);return Promise.resolve({k:t})}};e.exports=Object.freeze({config:l,factory:f}),r(4567).registry.register(f)},9746:(e,t,r)=>{"use strict"; /*! * jwk/rsa.js - RSA Key Representation * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(1194),i=r(8501),a=r(3748).nodeCrypto,o={BaseKey:r(7136),helpers:r(9684)},s=["RS256","RS384","RS512","PS256","PS384","PS512"],u=["RSA-OAEP","RSA-OAEP-256","RSA1_5"],c={publicKey:function(e){var t,r=o.helpers.COMMON_PROPS.concat([{name:"n",type:"binary"},{name:"e",type:"binary"}]);return(t=o.helpers.unpackProps(e,r))&&t.n&&t.e?t.length=8*t.n.length:(delete t.e,delete t.n),t},privateKey:function(e){var t,r=o.helpers.COMMON_PROPS.concat([{name:"n",type:"binary"},{name:"e",type:"binary"},{name:"d",type:"binary"},{name:"p",type:"binary"},{name:"q",type:"binary"},{name:"dp",type:"binary"},{name:"dq",type:"binary"},{name:"qi",type:"binary"}]);return(t=o.helpers.unpackProps(e,r))&&t.d&&t.n&&t.e&&t.p&&t.q&&t.dp&&t.dq&&t.qi?t.length=8*t.d.length:t=void 0,t},thumbprint:function(e){return e.public&&(e=e.public),{e:e.e,kty:"RSA",n:e.n}},algorithms:function(e,t){switch(t){case"encrypt":case"decrypt":return[];case"wrap":return e.public&&u.slice()||[];case"unwrap":return e.private&&u.slice()||[];case"sign":return e.private&&s.slice()||[];case"verify":return e.public&&s.slice()||[]}return[]},wrapKey:function(e,t){return t.public},unwrapKey:function(e,t){return t.private},signKey:function(e,t){return t.private},verifyKey:function(e,t){return t.public},convertToPEM:function(e,t){var r=i.convertToForge(e,!t);return t?n.pki.privateKeyToPem(r):n.pki.publicKeyToPem(r)}};var l={oid:"1.2.840.113549.1.1.1",privateKey:{name:"RSAPrivateKey",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"version"},{name:"RSAPrivateKey.modulus",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"n"},{name:"RSAPrivateKey.publicExponent",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"e"},{name:"RSAPrivateKey.privateExponent",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"d"},{name:"RSAPrivateKey.prime1",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"p"},{name:"RSAPrivateKey.prime2",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"q"},{name:"RSAPrivateKey.exponent1",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"dp"},{name:"RSAPrivateKey.exponent2",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"dq"},{name:"RSAPrivateKey.coefficient",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"qi"}]},publicKey:{name:"RSAPublicKey",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"n"},{name:"RSAPublicKey.exponent",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"e"}]}},f={kty:"RSA",validators:l,prepare:function(e){var t=c,r=Promise.resolve(e);return r=(r=r.then((function(e){return o.helpers.thumbprint(t,e)}))).then((function(r){var n={};return n[o.helpers.INTERNALS.THUMBPRINT_HASH]=r,e[o.helpers.INTERNALS.THUMBPRINT_KEY]=n,t}))},generate:function(e){var t;if(a)t=new Promise((function(t,r){n.pki.rsa.generateKeyPair({bits:e,e:65537},(function(e,n){if(e)return r(e);t(n.privateKey)}))}));else{var r=n.pki.rsa.generateKeyPair({bits:e,e:65537});t=Promise.resolve(r.privateKey)}return t.then((function(e){var t={};return["e","n","d","p","q",{incoming:"dP",outgoing:"dp"},{incoming:"dQ",outgoing:"dq"},{incoming:"qInv",outgoing:"qi"}].forEach((function(r){var n,i,a;"string"==typeof r?n=i=r:(n=r.incoming,i=r.outgoing),n in e&&(t[i]=((a=(a=e[n]).toString(16)).length%2&&(a="0"+a),Buffer.from(a,"hex")))})),t}))},import:function(e){if(l.oid!==e.keyOid)return null;if(!e.parsed){"string"==typeof e.keyValue?e.keyValue=n.asn1.fromDer(e.keyValue):Array.isArray(e.keyValue)&&(e.keyValue=e.keyValue[0]);var t="private"===e.type?l.privateKey:l.publicKey,r={};if(!n.asn1.validate(e.keyValue,t,r,[]))return null;e=r}var i={kty:"RSA"};return["n","e","d","p","q","dp","dq","qi"].forEach((function(t){if(t in e){var r=Buffer.from(e[t],"binary");0===r[0]&&(r=r.slice(1)),i[t]=r}})),i}};e.exports=Object.freeze({config:c,factory:f}),r(4567).registry.register(f)},3206:e=>{"use strict"; /*! * jws/defaults.js - Defaults for JWSs * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */e.exports={compact:!1,protect:"*"}},7286:e=>{"use strict"; /*! * jws/helpers.js - JWS Internal Helper Functions * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */e.exports={slice:function(e,t){return Array.prototype.slice.call(e,t||0)}}},2109:(e,t,r)=>{"use strict"; /*! * jws/index.js - JSON Web Signature (JWS) Entry Point * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n={createSign:r(4873).createSign,createVerify:r(8747).createVerify};e.exports=n},4873:(e,t,r)=>{"use strict"; /*! * jws/sign.js - Sign to JWS * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(5029),i=r(4237),a=r(2543),o=r(7286).slice,s=r(6678),u=r(4908),c=r(3206),l=function(e,t){var r=!1,n=e.format||"general",a=Buffer.alloc(0);Object.defineProperty(this,"compact",{get:function(){return"compact"===n},enumerable:!0}),Object.defineProperty(this,"format",{get:function(){return n},enumerable:!0}),Object.defineProperty(this,"update",{value:function(e,t){if(r)throw new Error("already final");return null!=e&&(e=i.asBuffer(e,t),a=a.length?Buffer.concat([a,e],a.length+e.length):e),this}}),Object.defineProperty(this,"final",{value:function(e,o){if(r)return Promise.reject(new Error("already final"));var u;switch(this.update(e,o),r=!0,u=(u=(u=Promise.all(t)).then((function(e){return a=i.base64url.encode(a),e=e.map((function(e){var t={},r=0,n=s(e.header),o=Object.keys(n).length;e.protected.forEach((function(e){e in n&&(t[e]=n[e],r++,delete n[e],o--)})),r>0?(t=JSON.stringify(t),t=i.base64url.encode(t)):t="";var u=Buffer.from(t+"."+a,"ascii");return e=(e=e.key.sign(e.header.alg,u,e.header)).then((function(e){var a={};return 0{"use strict"; /*! * jws/verify.js - Verifies from a JWS * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(6678),i=r(5029),a=r(9752),o=r(3171),s=r(2543),u={algorithms:"*",allowEmbeddedKey:!1},c=function(e,t){var r,c;c=s.isKey(e)?(r=e).keystore:s.isKeyStore(e)?e:s.createKeyStore(),t=i(u,t),Object.defineProperty(this,"defaultKey",{value:r||void 0,enumerable:!0}),Object.defineProperty(this,"keystore",{value:c,enumerable:!0}),Object.defineProperty(this,"verify",{value:function(e,u){var l=(u=i({},t,u||{})).handlers||{},f=Object.keys(l),h=new o(u.algorithms);if("string"==typeof e)e={payload:(e=e.split("."))[1],signatures:[{protected:e[0],signature:e[2]}]};else if(!e||"object"!=typeof e)throw new Error("invalid input");e.signature&&(e.signatures=[{protected:e.protected||void 0,header:e.header||void 0,signature:e.signature}]);var p=e.signatures||[{}];p=p.map((function(e){var t=n(e.header||{}),r=e.protected?JSON.parse(a.decode(e.protected,"utf8")):{};t=i(t,r);var o=a.decode(e.signature);if(!h.match(t.alg))return Promise.reject(new Error("Algorithm not allowed: "+t.alg));var s=r.crit;if(s){if(!Array.isArray(s))return Promise.reject(new Error("Invalid 'crit' header"));for(var u=0;s.length>u;u++)if(-1===f.indexOf(s[u]))return Promise.reject(new Error("Critical extension is not supported: "+s[u]))}return r=Object.keys(r),Promise.resolve({protected:r,aad:e.protected||"",header:t,signature:o})}));var d=Promise.all(p);return d=d.then((function(t){return new Promise((function(n,o){var h=function(){var p=t.shift();if(p){p=i({},p,{payload:e.payload});var d=Promise.resolve(p);(d=(d=(d=(d=(d=(d=d.then((function(e){var t;return u.allowEmbeddedKey&&e.header.jwk?t=s.asKey(e.header.jwk):u.allowEmbeddedKey&&e.header.x5c?(t=e.header.x5c[0],t=Buffer.from(t,"base64"),t=s.asKey(t,"pkix")):t=Promise.resolve(r||c.get({use:"sig",alg:e.header.alg,kid:e.header.kid})),t.then((function(t){return t?(e.key=t,e):Promise.reject(new Error("key does not match"))}))}))).then((function(e){var t=[];return f.forEach((function(r){var n;"function"==typeof(r=l[r])?n=r(e):"object"==typeof r&&"function"==typeof r.prepare&&(n=r.prepare(e)),n&&t.push(Promise.resolve(n))})),Promise.all(t).then((function(){return e}))}))).then((function(e){var t=e.aad||"",r=e.payload||"",n=Buffer.alloc(1+t.length+r.length),i=0;return n.write(t,i,"ascii"),i+=t.length,n.write(".",i,"ascii"),i++,Buffer.isBuffer(r)?r.copy(n,i):n.write(r,i,"binary"),e.content=n,e}))).then((function(e){return e.key.verify(e.header.alg,e.content,e.signature)}))).then((function(e){var t=p.payload;return t=a.decode(t),{protected:p.protected,header:p.header,payload:t,signature:e.mac,key:p.key}}))).then((function(e){var t=[];return f.forEach((function(r){var n;"object"==typeof(r=l[r])&&"function"==typeof r.complete&&(n=r.complete(e)),n&&t.push(Promise.resolve(n))})),Promise.all(t).then((function(){return e}))}))).then(n,h)}else o(new Error("no key found"))};h()}))}))}})};e.exports={verifier:c,createVerify:function(e,t){return new c(e,t)}}},2393:(e,t,r)=>{"use strict"; /*! * parse/compact.js - JOSE Compact Serialization Parser * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n={JWE:r(701),JWS:r(2109),util:r(4237)};e.exports=function(e){var t,r,i,a=e.split(".");if(3===a.length)t="JWS",r=function(t,r){return n.JWS.createVerify(t).verify(e,r)};else{if(5!==a.length)throw new TypeError("invalid jose serialization");t="JWE",r=function(t,r){return n.JWE.createDecrypt(t).decrypt(e,r)}}return i=n.util.base64url.decode(a[0],"utf8"),i=JSON.parse(i),{type:t,format:"compact",input:e,header:i,perform:r}}},8650:(e,t,r)=>{"use strict"; /*! * parse/index.js - JOSE Parser Entry Point * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(2393),i=r(4631),a=e.exports=function(e){if(Buffer.isBuffer(e))return n(e.toString("ascii"));if("string"==typeof e)return n(e);if(e)return i(e);throw new TypeError("invalid input")};a.compact=n,a.json=i},4631:(e,t,r)=>{"use strict"; /*! * parse/compact.js - JOSE JSON Serialization Parser * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(5029),i={JWE:r(701),JWS:r(2109),util:r(4237)};e.exports=function(e){var t,r,a;if("signatures"in e||"signature"in e)t="JWS",r=function(t,r){return i.JWS.createVerify(t).verify(e,r)},a=(a=e.signatures||[{protected:e.protected,header:e.header,signature:e.signature}]).map((function(e){var t,r={};return e.header&&(r=n(r,e.header)),e.protected&&(t=e.protected,t=i.util.base64url.decode(t,"utf8"),t=JSON.parse(t),r=n(r,t)),r}));else if("ciphertext"in e){t="JWE",r=function(t,r){return i.JWE.createDecrypt(t).decrypt(e,r)};var o={};e.protected&&(o.protected=e.protected,o.protected=i.util.base64url.decode(o.protected,"utf8"),o.protected=JSON.parse(o.protected)),e.unprotected&&(o.unprotected=e.unprotected),a=(a=e.recipients||[{}]).map((function(e){var t={};return e.header&&(t=n(t,e.header)),o.unprotected&&(t=n(t,o.unprotected)),o.protected&&(t=n(t,o.protected)),t}))}return{type:t,format:"json",input:e,all:a,perform:r}}},3171:e=>{"use strict"; /*! * util/algconfig.js - Functions for managing algorithm set options * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */function t(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}e.exports=function(e){e?"string"==typeof e&&(e=e.split(" ")):e=[];var r,n=[],i=[],a=[],o=[],s=/^(!)?([^*]*)(\*?)([^*]*)$/;e.forEach((function(e){if(e){s.lastIndex=0;var u=s.exec(e);u&&(r="("+function(e,r,n){var i=[];return i.push("^"),e&&(e=t(e),i.push(e)),r&&i.push(e||n?".*":".+"),n&&(n=t(n),i.push(n)),i.push("$"),i.join("")}(u[2],u[3],u[4])+")",u[1]?(o.push(r),i.push(u[0])):(a.push(r),n.push(u[0])))}})),a=a.length?new RegExp(a.join("|")):null,o=o.length?new RegExp(o.join("|")):null,n.length||(n=["*"]),Object.defineProperty(this,"spec",{value:n.join(" ")+" "+i.join(" "),enumerable:!0}),Object.defineProperty(this,"match",{value:function(e){var t=Boolean(e);return t&&a&&(a.lastIndex=0,t=a.test(e)),t&&o&&(o.lastIndex=0,t=!o.test(e)),t}})}},9752:(e,t,r)=>{"use strict"; /*! * util/base64url.js - Implementation of web-safe Base64 Encoder/Decoder * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(5772),i={encode:function(e,t){return e instanceof ArrayBuffer&&(e=new Uint8Array(e)),Buffer.isBuffer(e)||(e=Buffer.from(e,t)),n.encode(e)},decode:n.toBuffer};e.exports=i},4678:(e,t,r)=>{"use strict"; /*! * util/databuffer.js - Forge-compatible Buffer based on Node.js Buffers * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n=r(1194),i=r(9752);function a(e,t){t=t||{},Buffer.isBuffer(e)?this.data=e:n.util.isArrayBuffer(e)?(e=new Uint8Array(e),this.data=Buffer.from(e)):n.util.isArrayBufferView(e)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),this.data=Buffer.from(e)),this.data&&(this.write=this.data.length,e=void 0),this.growSize=t.growSize||a.DEFAULT_GROW_SIZE,this.write=this.write||0,this.read=this.read||0,e?this.putBytes(e):this.data||this.accommodate(0),t.readOffset="readOffset"in t?t.readOffset:this.read,this.write="writeOffset"in t?t.writeOffset:this.write,this.read=Math.min(t.readOffset,this.write)}a.DEFAULT_GROW_SIZE=16,a.prototype.length=function(){return this.write-this.read},a.prototype.available=function(){return this.data.length-this.write},a.prototype.isEmpty=function(){return this.length()<=0},a.prototype.accommodate=function(e){if(this.data){if(this.available()0&&(this.write===this.read?this.read=this.write=0:(this.data.copy(this.data,0,this.read,this.write),this.write=this.write-this.read,this.read=0),this.data.fill(0,this.write)),this},a.prototype.copy=function(){return new a(this,{readOffset:this.read,writeOffset:this.write,growSize:this.growSize})},a.prototype.equals=function(e){if(!a.isBuffer(e))return!1;if(e.length()!==this.length())return!1;for(var t=!0,r=this.read-e.read,n=e.read;e.write>n;n++)t=t&&this.data[n+r]===e.data[n];return t},a.prototype.at=function(e){return this.data[this.read+e]},a.prototype.setAt=function(e,t){return this.data[this.read+e]=t,this},a.prototype.last=function(){return this.data[this.write-1]},a.prototype.bytes=function(e){var t;if(void 0===e?e=this.length():e&&(e=Math.min(e,this.length())),0===e)t="";else{var r=this.read,n=r+e,i=this.data.slice(r,n);t=String.fromCharCode.apply(null,i)}return t},a.prototype.buffer=function(e){var t;if(void 0===e?e=this.length():e&&(e=Math.min(e,this.length())),0===e)t=new ArrayBuffer(0);else{var r=this.read,n=r+e,i=this.data.slice(r,n);(t=new Uint8Array(n-r)).set(i)}return t},a.prototype.native=function(e){var t;if(void 0===e?e=this.length():e&&(e=Math.min(e,this.length())),0===e)t=Buffer.alloc(0);else{var r=this.read,n=r+e;t=this.data.slice(r,n)}return t},a.prototype.toHex=function(){return this.toString("hex")},a.prototype.toString=function(e){if(0===this.length())return"";var t=this.data.slice(this.read,this.write);switch(e=e||"utf8"){case"raw":return t.toString("binary");case"base64url":return i.encode(t);case"utf16":return t.toString("ucs2");default:return t.toString(e)}},a.prototype.fillWithByte=function(e,t){return t||(t=this.available()),this.accommodate(t),this.data.fill(e,this.write,this.write+t),this.write+=t,this},a.prototype.getBuffer=function(e){var t=this.buffer(e);return this.read+=t.byteLength,t},a.prototype.putBuffer=function(e){return this.putBytes(e)},a.prototype.getBytes=function(e){var t=this.bytes(e);return this.read+=t.length,t},a.prototype.putBytes=function(e,t){if("string"==typeof e){switch(t=t||"binary"){case"utf16":t="ucs-2";break;case"raw":t="binary";break;case"base64url":e=i.decode(e)}Buffer.isBuffer(e)||(e=Buffer.from(e,t))}var r,o;if(e instanceof a){var s=e;e=s.data.slice(s.read,s.write),s.read=s.write}else e instanceof n.util.ByteStringBuffer&&(e=e.getBytes());if(Buffer.isBuffer(e))r=e;else if(Array.isArray(e))r=Buffer.from(e);else if(n.util.isArrayBuffer(e))r=new Uint8Array(e),r=Buffer.from(r);else{if(!n.util.isArrayBufferView(e))throw new TypeError("invalid source type");r=e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),r=Buffer.from(r)}return this.accommodate(r.length),o=this.data,r.copy(o,this.write),this.write+=r.length,this},a.prototype.getNative=function(e){var t=this.native(e);return this.read+=t.length,t},a.prototype.putNative=a.prototype.putBuffer,a.prototype.getByte=function(){var e=this.data[this.read];return this.read=Math.min(this.read+1,this.write),e},a.prototype.putByte=function(e){return this.accommodate(1),this.data[this.write]=255&e,this.write++,this},a.prototype.getInt16=function(){var e=this.data[this.read]<<8^this.data[this.read+1];return this.read=Math.min(this.read+2,this.write),e},a.prototype.putInt16=function(e){return this.accommodate(2),this.data[this.write]=e>>>8&255,this.data[this.write+1]=255&e,this.write+=2,this},a.prototype.getInt24=function(){var e=this.data[this.read]<<16^this.data[this.read+1]<<8^this.data[this.read+2];return this.read=Math.min(this.read+3,this.write),e},a.prototype.putInt24=function(e){return this.accommodate(3),this.data[this.write]=e>>>16&255,this.data[this.write+1]=e>>>8&255,this.data[this.write+2]=255&e,this.write+=3,this},a.prototype.getInt32=function(){var e=this.data[this.read]<<24^this.data[this.read+1]<<16^this.data[this.read+2]<<8^this.data[this.read+3];return this.read=Math.min(this.read+4,this.write),e},a.prototype.putInt32=function(e){return this.accommodate(4),this.data[this.write]=e>>>24&255,this.data[this.write+1]=e>>>16&255,this.data[this.write+2]=e>>>8&255,this.data[this.write+3]=255&e,this.write+=4,this},a.prototype.getInt16Le=function(){var e=this.data[this.read+1]<<8^this.data[this.read];return this.read=Math.min(this.read+2,this.write),e},a.prototype.putInt16Le=function(e){return this.accommodate(2),this.data[this.write+1]=e>>>8&255,this.data[this.write]=255&e,this.write+=2,this},a.prototype.getInt24Le=function(){var e=this.data[this.read+2]<<16^this.data[this.read+1]<<8^this.data[this.read];return this.read=Math.min(this.read+3,this.write),e},a.prototype.putInt24Le=function(e){return this.accommodate(3),this.data[this.write+2]=e>>>16&255,this.data[this.write+1]=e>>>8&255,this.data[this.write]=255&e,this.write+=3,this},a.prototype.getInt32Le=function(){var e=this.data[this.read+3]<<24^this.data[this.read+2]<<16^this.data[this.read+1]<<8^this.data[this.read];return this.read=Math.min(this.read+4,this.write),e},a.prototype.putInt32Le=function(e){return this.accommodate(4),this.data[this.write+3]=e>>>24&255,this.data[this.write+2]=e>>>16&255,this.data[this.write+1]=e>>>8&255,this.data[this.write]=255&e,this.write+=4,this},a.prototype.getInt=function(e){var t=0;do{t=t<<8|this.getByte(),e-=8}while(e>0);return t},a.prototype.putInt=function(e,t){this.accommodate(Math.ceil(t/8));do{t-=8,this.putByte(e>>t&255)}while(t>0);return this},a.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<{"use strict"; /*! * util/index.js - Utilities Entry Point * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n,i=r(1194);n={base64url:r(9752),utf8:r(8572),asBuffer:function(e,t){return Buffer.isBuffer(e)?e:"string"==typeof e?"base64url"===(t=t||"binary")?n.base64url.decode(e):Buffer.from(e,t):(i.util.isArrayBufferView(e)?e=e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteOffset+e.byteLength):i.util.isArrayBuffer(e)&&(e=new Uint8Array(e)),Buffer.from(e))},randomBytes:function(e){return Buffer.from(i.random.getBytes(e),"binary")}},e.exports=n},5029:(e,t,r)=>{"use strict"; /*! * util/utf8.js - Implementation of UTF-8 Encoder/Decoder * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var n,i=r(5544),a=r(2492),o=(n=[],"undefined"!=typeof Uint8ClampedArray&&n.push(Uint8ClampedArray),"undefined"!=typeof Uint8Array&&n.push(Uint8Array),"undefined"!=typeof Uint16Array&&n.push(Uint16Array),"undefined"!=typeof Uint32Array&&n.push(Uint32Array),"undefined"!=typeof Float32Array&&n.push(Float32Array),"undefined"!=typeof Float64Array&&n.push(Float64Array),n);e.exports=i(a,(function(e,t){if(Buffer.isBuffer(t))t=Buffer.from(t);else{var r=function(e){for(var t,r=0;!t&&o.length>r;r++)e instanceof o[r]&&(t=o[r]);return t}(t);t=r?new r(t,t.byteOffset,t.byteLength):void 0}return t,t}))},8572:(e,t)=>{"use strict"; /*! * util/utf8.js - Implementation of UTF-8 Encoder/Decoder * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */var r=t;r.encode=function(e){var t=encodeURIComponent(e||"");return t=t.replace(/%([0-9a-fA-F]{2})/g,(function(e,t){return t=parseInt(t,16),String.fromCharCode(t)}))},r.decode=function(e){var t=(e||"").replace(/[\u0080-\u00ff]/g,(function(e){return"%"+(256|e.charCodeAt(0)).toString(16).substring(1)}));return t=decodeURIComponent(t)}},9591:(e,t,r)=>{"use strict";var n={};(0,r(4236).assign)(n,r(4555),r(8843),r(1619)),e.exports=n},4555:(e,t,r)=>{"use strict";var n=r(405),i=r(4236),a=r(9373),o=r(8898),s=r(2292),u=Object.prototype.toString;function c(e){if(!(this instanceof c))return new c(e);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==r)throw new Error(o[r]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){var l;if(l="string"==typeof t.dictionary?a.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(r=n.deflateSetDictionary(this.strm,l)))throw new Error(o[r]);this._dict_set=!0}}function l(e,t){var r=new c(t);if(r.push(e,!0),r.err)throw r.msg||o[r.err];return r.result}c.prototype.push=function(e,t){var r,o,s=this.strm,c=this.options.chunkSize;if(this.ended)return!1;o=t===~~t?t:!0===t?4:0,"string"==typeof e?s.input=a.string2buf(e):"[object ArrayBuffer]"===u.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(c),s.next_out=0,s.avail_out=c),1!==(r=n.deflate(s,o))&&0!==r)return this.onEnd(r),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(a.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r);return 4===o?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==o||(this.onEnd(0),s.avail_out=0,!0)},c.prototype.onData=function(e){this.chunks.push(e)},c.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=c,t.deflate=l,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,l(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,l(e,t)}},8843:(e,t,r)=>{"use strict";var n=r(7948),i=r(4236),a=r(9373),o=r(1619),s=r(8898),u=r(2292),c=r(2401),l=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==o.Z_OK)throw new Error(s[r]);if(this.header=new c,n.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=a.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=n.inflateSetDictionary(this.strm,t.dictionary))!==o.Z_OK))throw new Error(s[r])}function h(e,t){var r=new f(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}f.prototype.push=function(e,t){var r,s,u,c,f,h=this.strm,p=this.options.chunkSize,d=this.options.dictionary,y=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof e?h.input=a.binstring2buf(e):"[object ArrayBuffer]"===l.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(p),h.next_out=0,h.avail_out=p),(r=n.inflate(h,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&d&&(r=n.inflateSetDictionary(this.strm,d)),r===o.Z_BUF_ERROR&&!0===y&&(r=o.Z_OK,y=!1),r!==o.Z_STREAM_END&&r!==o.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==o.Z_STREAM_END&&(0!==h.avail_in||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(u=a.utf8border(h.output,h.next_out),c=h.next_out-u,f=a.buf2string(h.output,u),h.next_out=c,h.avail_out=p-c,c&&i.arraySet(h.output,h.output,u,c,0),this.onData(f)):this.onData(i.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(y=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==o.Z_STREAM_END);return r===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),h.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=f,t.inflate=h,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},t.ungzip=h},4236:(e,t)=>{"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var i in r)n(r,i)&&(e[i]=r[i])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var a=0;a{"use strict";var n=r(4236),i=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){a=!1}for(var o=new n.Buf8(256),s=0;s<256;s++)o[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function u(e,t){if(t<65534&&(e.subarray&&a||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",o=0;o>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},t.buf2binstring=function(e){return u(e,e.length)},t.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r4)c[n++]=65533,r+=a-1;else{for(i&=2===a?31:3===a?15:7;a>1&&r1?c[n++]=65533:i<65536?c[n++]=i:(i-=65536,c[n++]=55296|i>>10&1023,c[n++]=56320|1023&i)}return u(c,n)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+o[e[r]]>t?r:t}},6069:e=>{"use strict";e.exports=function(e,t,r,n){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{a=a+(i=i+t[n++]|0)|0}while(--o);i%=65521,a%=65521}return i|a<<16|0}},1619:e=>{"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},2869:e=>{"use strict";var t=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,r,n,i){var a=t,o=i+n;e^=-1;for(var s=i;s>>8^a[255&(e^r[s])];return-1^e}},405:(e,t,r)=>{"use strict";var n,i=r(4236),a=r(342),o=r(6069),s=r(2869),u=r(8898),c=-2,l=258,f=262,h=103,p=113,d=666;function y(e,t){return e.msg=u[t],t}function v(e){return(e<<1)-(e>4?9:0)}function g(e){for(var t=e.length;--t>=0;)e[t]=0}function m(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function b(e,t){a._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,m(e.strm)}function E(e,t){e.pending_buf[e.pending++]=t}function S(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function C(e,t){var r,n,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-f?e.strstart-(e.w_size-f):0,c=e.window,h=e.w_mask,p=e.prev,d=e.strstart+l,y=c[a+o-1],v=c[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(c[(r=t)+o]===v&&c[r+o-1]===y&&c[r]===c[a]&&c[++r]===c[a+1]){a+=2,r++;do{}while(c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&ao){if(e.match_start=t,o=n,n>=s)break;y=c[a+o-1],v=c[a+o]}}}while((t=p[t&h])>u&&0!=--i);return o<=e.lookahead?o:e.lookahead}function w(e){var t,r,n,a,u,c,l,h,p,d,y=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=y+(y-f)){i.arraySet(e.window,e.window,y,y,0),e.match_start-=y,e.strstart-=y,e.block_start-=y,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=y?n-y:0}while(--r);t=r=y;do{n=e.prev[--t],e.prev[t]=n>=y?n-y:0}while(--r);a+=y}if(0===e.strm.avail_in)break;if(c=e.strm,l=e.window,h=e.strstart+e.lookahead,p=a,d=void 0,(d=c.avail_in)>p&&(d=p),r=0===d?0:(c.avail_in-=d,i.arraySet(l,c.input,c.next_in,d,h),1===c.state.wrap?c.adler=o(c.adler,l,d,h):2===c.state.wrap&&(c.adler=s(c.adler,l,d,h)),c.next_in+=d,c.total_in+=d,d),e.lookahead+=r,e.lookahead+e.insert>=3)for(u=e.strstart-e.insert,e.ins_h=e.window[u],e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<=3)if(n=a._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<15&&(s=2,n-=16),a<1||a>9||8!==r||n<8||n>15||t<0||t>9||o<0||o>4)return y(e,c);8===n&&(n=9);var u=new k;return e.state=u,u.strm=e,u.wrap=s,u.gzhead=null,u.w_bits=n,u.w_size=1<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(w(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,b(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-f&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(b(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(b(e,!1),e.strm.avail_out),1)})),new I(4,4,8,4,T),new I(4,5,16,8,T),new I(4,6,32,32,T),new I(4,4,16,16,A),new I(8,16,32,32,A),new I(8,16,128,128,A),new I(8,32,128,256,A),new I(32,128,258,1024,A),new I(32,258,258,4096,A)],t.deflateInit=function(e,t){return N(e,t,8,15,8,0)},t.deflateInit2=N,t.deflateReset=B,t.deflateResetKeep=_,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?c:(e.state.gzhead=t,0):c},t.deflate=function(e,t){var r,i,o,u;if(!e||!e.state||t>5||t<0)return e?y(e,c):c;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===d&&4!==t)return y(e,0===e.avail_out?-5:c);if(i.strm=e,r=i.last_flush,i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,E(i,31),E(i,139),E(i,8),i.gzhead?(E(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),E(i,255&i.gzhead.time),E(i,i.gzhead.time>>8&255),E(i,i.gzhead.time>>16&255),E(i,i.gzhead.time>>24&255),E(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),E(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(E(i,255&i.gzhead.extra.length),E(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(E(i,0),E(i,0),E(i,0),E(i,0),E(i,0),E(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),E(i,3),i.status=p);else{var f=8+(i.w_bits-8<<4)<<8;f|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(f|=32),f+=31-f%31,i.status=p,S(i,f),0!==i.strstart&&(S(i,e.adler>>>16),S(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),m(e),o=i.pending,i.pending!==i.pending_buf_size));)E(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),m(e),o=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),m(e),o=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),0===u&&(i.status=h)}else i.status=h;if(i.status===h&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&m(e),i.pending+2<=i.pending_buf_size&&(E(i,255&e.adler),E(i,e.adler>>8&255),e.adler=0,i.status=p)):i.status=p),0!==i.pending){if(m(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&v(t)<=v(r)&&4!==t)return y(e,-5);if(i.status===d&&0!==e.avail_in)return y(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&i.status!==d){var C=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(w(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(b(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(b(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var r,n,i,o,s=e.window;;){if(e.lookahead<=l){if(w(e),e.lookahead<=l&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=s[i=e.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){o=e.strstart+l;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=a._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(b(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(b(e,!1),0===e.strm.avail_out)?1:2}(i,t):n[i.level].func(i,t);if(3!==C&&4!==C||(i.status=d),1===C||3===C)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===C&&(1===t?a._tr_align(i):5!==t&&(a._tr_stored_block(i,0,0,!1),3===t&&(g(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),m(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(E(i,255&e.adler),E(i,e.adler>>8&255),E(i,e.adler>>16&255),E(i,e.adler>>24&255),E(i,255&e.total_in),E(i,e.total_in>>8&255),E(i,e.total_in>>16&255),E(i,e.total_in>>24&255)):(S(i,e.adler>>>16),S(i,65535&e.adler)),m(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},t.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==h&&t!==p&&t!==d?y(e,c):(e.state=null,t===p?y(e,-3):0):c},t.deflateSetDictionary=function(e,t){var r,n,a,s,u,l,f,h,p=t.length;if(!e||!e.state)return c;if(2===(s=(r=e.state).wrap)||1===s&&42!==r.status||r.lookahead)return c;for(1===s&&(e.adler=o(e.adler,t,p,0)),r.wrap=0,p>=r.w_size&&(0===s&&(g(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new i.Buf8(r.w_size),i.arraySet(h,t,p-r.w_size,r.w_size,0),t=h,p=r.w_size),u=e.avail_in,l=e.next_in,f=e.input,e.avail_in=p,e.next_in=0,e.input=t,w(r);r.lookahead>=3;){n=r.strstart,a=r.lookahead-2;do{r.ins_h=(r.ins_h<{"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},4264:e=>{"use strict";e.exports=function(e,t){var r,n,i,a,o,s,u,c,l,f,h,p,d,y,v,g,m,b,E,S,C,w,T,A,I;r=e.state,n=e.next_in,A=e.input,i=n+(e.avail_in-5),a=e.next_out,I=e.output,o=a-(t-e.avail_out),s=a+(e.avail_out-257),u=r.dmax,c=r.wsize,l=r.whave,f=r.wnext,h=r.window,p=r.hold,d=r.bits,y=r.lencode,v=r.distcode,g=(1<>>=E=b>>>24,d-=E,0===(E=b>>>16&255))I[a++]=65535&b;else{if(!(16&E)){if(0==(64&E)){b=y[(65535&b)+(p&(1<>>=E,d-=E),d<15&&(p+=A[n++]<>>=E=b>>>24,d-=E,!(16&(E=b>>>16&255))){if(0==(64&E)){b=v[(65535&b)+(p&(1<u){e.msg="invalid distance too far back",r.mode=30;break e}if(p>>>=E,d-=E,C>(E=a-o)){if((E=C-E)>l&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(w=0,T=h,0===f){if(w+=c-E,E2;)I[a++]=T[w++],I[a++]=T[w++],I[a++]=T[w++],S-=3;S&&(I[a++]=T[w++],S>1&&(I[a++]=T[w++]))}else{w=a-C;do{I[a++]=I[w++],I[a++]=I[w++],I[a++]=I[w++],S-=3}while(S>2);S&&(I[a++]=I[w++],S>1&&(I[a++]=I[w++]))}break}}break}}while(n>3,p&=(1<<(d-=S<<3))-1,e.next_in=n,e.next_out=a,e.avail_in=n{"use strict";var n=r(4236),i=r(6069),a=r(2869),o=r(4264),s=r(9241),u=-2,c=12,l=30;function f(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function h(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function p(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):u}function d(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,p(e)):u}function y(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?u:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,d(e))):u}function v(e,t){var r,n;return e?(n=new h,e.state=n,n.window=null,0!==(r=y(e,t))&&(e.state=null),r):u}var g,m,b=!0;function E(e){if(b){var t;for(g=new n.Buf32(512),m=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(1,e.lens,0,288,g,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,m,0,e.work,{bits:5}),b=!1}e.lencode=g,e.lenbits=9,e.distcode=m,e.distbits=5}function S(e,t,r,i){var a,o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(n.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((a=o.wsize-o.wnext)>i&&(a=i),n.arraySet(o.window,t,r-i,a,o.wnext),(i-=a)?(n.arraySet(o.window,t,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=a(r.check,U,2,0),m=0,b=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&m)<<8)+(m>>8))%31){e.msg="incorrect header check",r.mode=l;break}if(8!=(15&m)){e.msg="unknown compression method",r.mode=l;break}if(b-=4,x=8+(15&(m>>>=4)),0===r.wbits)r.wbits=x;else if(x>r.wbits){e.msg="invalid window size",r.mode=l;break}r.dmax=1<>8&1),512&r.flags&&(U[0]=255&m,U[1]=m>>>8&255,r.check=a(r.check,U,2,0)),m=0,b=0,r.mode=3;case 3:for(;b<32;){if(0===v)break e;v--,m+=h[d++]<>>8&255,U[2]=m>>>16&255,U[3]=m>>>24&255,r.check=a(r.check,U,4,0)),m=0,b=0,r.mode=4;case 4:for(;b<16;){if(0===v)break e;v--,m+=h[d++]<>8),512&r.flags&&(U[0]=255&m,U[1]=m>>>8&255,r.check=a(r.check,U,2,0)),m=0,b=0,r.mode=5;case 5:if(1024&r.flags){for(;b<16;){if(0===v)break e;v--,m+=h[d++]<>>8&255,r.check=a(r.check,U,2,0)),m=0,b=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((T=r.length)>v&&(T=v),T&&(r.head&&(x=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,h,d,T,x)),512&r.flags&&(r.check=a(r.check,h,T,d)),v-=T,d+=T,r.length-=T),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===v)break e;T=0;do{x=h[d+T++],r.head&&x&&r.length<65536&&(r.head.name+=String.fromCharCode(x))}while(x&&T>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=c;break;case 10:for(;b<32;){if(0===v)break e;v--,m+=h[d++]<>>=7&b,b-=7&b,r.mode=27;break}for(;b<3;){if(0===v)break e;v--,m+=h[d++]<>>=1)){case 0:r.mode=14;break;case 1:if(E(r),r.mode=20,6===t){m>>>=2,b-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=l}m>>>=2,b-=2;break;case 14:for(m>>>=7&b,b-=7&b;b<32;){if(0===v)break e;v--,m+=h[d++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=l;break}if(r.length=65535&m,m=0,b=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(T=r.length){if(T>v&&(T=v),T>g&&(T=g),0===T)break e;n.arraySet(p,h,d,T,y),v-=T,d+=T,g-=T,y+=T,r.length-=T;break}r.mode=c;break;case 17:for(;b<14;){if(0===v)break e;v--,m+=h[d++]<>>=5,b-=5,r.ndist=1+(31&m),m>>>=5,b-=5,r.ncode=4+(15&m),m>>>=4,b-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=l;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,b-=3}for(;r.have<19;)r.lens[j[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,F={bits:r.lenbits},P=s(0,r.lens,0,19,r.lencode,0,r.work,F),r.lenbits=F.bits,P){e.msg="invalid code lengths set",r.mode=l;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,B=65535&L,!((k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<>>=k,b-=k,r.lens[r.have++]=B;else{if(16===B){for(D=k+2;b>>=k,b-=k,0===r.have){e.msg="invalid bit length repeat",r.mode=l;break}x=r.lens[r.have-1],T=3+(3&m),m>>>=2,b-=2}else if(17===B){for(D=k+3;b>>=k)),m>>>=3,b-=3}else{for(D=k+7;b>>=k)),m>>>=7,b-=7}if(r.have+T>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=l;break}for(;T--;)r.lens[r.have++]=x}}if(r.mode===l)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=l;break}if(r.lenbits=9,F={bits:r.lenbits},P=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,F),r.lenbits=F.bits,P){e.msg="invalid literal/lengths set",r.mode=l;break}if(r.distbits=6,r.distcode=r.distdyn,F={bits:r.distbits},P=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,F),r.distbits=F.bits,P){e.msg="invalid distances set",r.mode=l;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(v>=6&&g>=258){e.next_out=y,e.avail_out=g,e.next_in=d,e.avail_in=v,r.hold=m,r.bits=b,o(e,w),y=e.next_out,p=e.output,g=e.avail_out,d=e.next_in,h=e.input,v=e.avail_in,m=r.hold,b=r.bits,r.mode===c&&(r.back=-1);break}for(r.back=0;_=(L=r.lencode[m&(1<>>16&255,B=65535&L,!((k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<>N)])>>>16&255,B=65535&L,!(N+(k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<>>=N,b-=N,r.back+=N}if(m>>>=k,b-=k,r.back+=k,r.length=B,0===_){r.mode=26;break}if(32&_){r.back=-1,r.mode=c;break}if(64&_){e.msg="invalid literal/length code",r.mode=l;break}r.extra=15&_,r.mode=22;case 22:if(r.extra){for(D=r.extra;b>>=r.extra,b-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;_=(L=r.distcode[m&(1<>>16&255,B=65535&L,!((k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<>N)])>>>16&255,B=65535&L,!(N+(k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<>>=N,b-=N,r.back+=N}if(m>>>=k,b-=k,r.back+=k,64&_){e.msg="invalid distance code",r.mode=l;break}r.offset=B,r.extra=15&_,r.mode=24;case 24:if(r.extra){for(D=r.extra;b>>=r.extra,b-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=l;break}r.mode=25;case 25:if(0===g)break e;if(T=w-g,r.offset>T){if((T=r.offset-T)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=l;break}T>r.wnext?(T-=r.wnext,A=r.wsize-T):A=r.wnext-T,T>r.length&&(T=r.length),I=r.window}else I=p,A=y-r.offset,T=r.length;T>g&&(T=g),g-=T,r.length-=T;do{p[y++]=I[A++]}while(--T);0===r.length&&(r.mode=21);break;case 26:if(0===g)break e;p[y++]=r.length,g--,r.mode=21;break;case 27:if(r.wrap){for(;b<32;){if(0===v)break e;v--,m|=h[d++]<{"use strict";var n=r(4236),i=15,a=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],u=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(e,t,r,c,l,f,h,p){var d,y,v,g,m,b,E,S,C,w=p.bits,T=0,A=0,I=0,k=0,_=0,B=0,N=0,O=0,R=0,x=0,P=null,F=0,D=new n.Buf16(16),L=new n.Buf16(16),U=null,j=0;for(T=0;T<=i;T++)D[T]=0;for(A=0;A=1&&0===D[k];k--);if(_>k&&(_=k),0===k)return l[f++]=20971520,l[f++]=20971520,p.bits=1,0;for(I=1;I0&&(0===e||1!==k))return-1;for(L[1]=0,T=1;T852||2===e&&R>592)return 1;for(;;){E=T-N,h[A]b?(S=U[j+h[A]],C=P[F+h[A]]):(S=96,C=0),d=1<>N)+(y-=d)]=E<<24|S<<16|C|0}while(0!==y);for(d=1<>=1;if(0!==d?(x&=d-1,x+=d):x=0,A++,0==--D[T]){if(T===k)break;T=t[r+h[A]]}if(T>_&&(x&g)!==v){for(0===N&&(N=_),m+=I,O=1<<(B=T-N);B+N852||2===e&&R>592)return 1;l[v=x&g]=_<<24|B<<16|m-f|0}}return 0!==x&&(l[m+x]=T-N<<24|64<<16|0),p.bits=_,0}},8898:e=>{"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},342:(e,t,r)=>{"use strict";var n=r(4236);function i(e){for(var t=e.length;--t>=0;)e[t]=0}var a=256,o=286,s=30,u=15,c=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],l=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],h=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],p=new Array(576);i(p);var d=new Array(60);i(d);var y=new Array(512);i(y);var v=new Array(256);i(v);var g=new Array(29);i(g);var m,b,E,S=new Array(s);function C(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function w(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function T(e){return e<256?y[e]:y[256+(e>>>7)]}function A(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function I(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function B(e,t,r){var n,i,a=new Array(16),o=0;for(n=1;n<=u;n++)a[n]=o=o+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=_(a[s]++,s))}}function N(e){var t;for(t=0;t8?A(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function R(e,t,r,n){var i=2*t,a=2*r;return e[i]>1;r>=1;r--)x(e,a,r);i=c;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],x(e,a,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,a[2*i]=a[2*r]+a[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,a[2*r+1]=a[2*n+1]=i,e.heap[1]=i++,x(e,a,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,a,o,s,c=t.dyn_tree,l=t.max_code,f=t.stat_desc.static_tree,h=t.stat_desc.has_stree,p=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,y=t.stat_desc.max_length,v=0;for(a=0;a<=u;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(a=c[2*c[2*(n=e.heap[r])+1]+1]+1)>y&&(a=y,v++),c[2*n+1]=a,n>l||(e.bl_count[a]++,o=0,n>=d&&(o=p[n-d]),s=c[2*n],e.opt_len+=s*(a+o),h&&(e.static_len+=s*(f[2*n+1]+o)));if(0!==v){do{for(a=y-1;0===e.bl_count[a];)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[y]--,v-=2}while(v>0);for(a=y;0!==a;a--)for(n=e.bl_count[a];0!==n;)(i=e.heap[--r])>l||(c[2*i+1]!==a&&(e.opt_len+=(a-c[2*i+1])*c[2*i],c[2*i+1]=a),n--)}}(e,t),B(a,l,e.bl_count)}function D(e,t,r){var n,i,a=-1,o=t[1],s=0,u=7,c=4;for(0===o&&(u=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=o,o=t[2*(n+1)+1],++s>=7;n0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t=3&&0===e.bl_tree[2*h[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?j(e,t,r,n):4===e.strategy||o===i?(I(e,2+(n?1:0),3),P(e,p,d)):(I(e,4+(n?1:0),3),function(e,t,r,n){var i;for(I(e,t-257,5),I(e,r-1,5),I(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(v[r]+a+1)]++,e.dyn_dtree[2*T(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){I(e,2,3),k(e,256,p),function(e){16===e.bi_valid?(A(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},2292:e=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},4155:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,u=[],c=!1,l=-1;function f(){c&&s&&(c=!1,s.length?u=s.concat(u):l=-1,u.length&&h())}function h(){if(!c){var e=o(f);c=!0;for(var t=u.length;t;){for(s=u,u=[];++l1)for(var r=1;r{"use strict";e=r.hmd(e);!function(e){var t,r=e.Symbol;if("function"==typeof r)if(r.observable)t=r.observable;else{t=r.for("https://github.com/benlesh/symbol-observable");try{r.observable=t}catch(e){}}else t="@@observable"}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:e)},2924:(e,t,r)=>{"use strict";r.d(t,{ej:()=>l,kG:()=>f,U6:()=>y});var n=r(655);!function(e){function t(){var t=this||self;t.globalThis=t,delete e.prototype._T_}"object"!=typeof globalThis&&(this?t():(e.defineProperty(e.prototype,"_T_",{configurable:!0,get:t}),_T_))}(Object);const i=globalThis;var a=i,o=a.console,s="Invariant Violation",u=Object.setPrototypeOf,c=void 0===u?function(e,t){return e.__proto__=t,e}:u,l=function(e){function t(r){void 0===r&&(r=s);var n=e.call(this,"number"==typeof r?s+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=s,c(n,t.prototype),n}return(0,n.ZT)(t,e),t}(Error);function f(e,t){if(!e)throw new l(t)}var h=["log","warn","error","silent"],p=h.indexOf("log");function d(e){return function(){if(h.indexOf(e)>=p)return o[e].apply(o,arguments)}}function y(e){var t=h[p];return p=Math.max(0,h.indexOf(e)),t}!function(e){e.log=d("log"),e.warn=d("warn"),e.error=d("error")}(f||(f={}));var v=a.process||{env:{}};if(!a.process)try{Object.defineProperty(i,"process",{value:v})}catch(e){}},655:(e,t,r)=>{"use strict";r.d(t,{ZT:()=>i,pi:()=>a,_T:()=>o,mG:()=>s,Jh:()=>u,pr:()=>c}); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var a=function(){return(a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]{var n=r(3570),i=r(1171),a=i;a.v1=n,a.v4=i,e.exports=a},5327:e=>{for(var t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);e.exports=function(e,r){var n=r||0,i=t;return[i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]]].join("")}},5217:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var r=new Uint8Array(16);e.exports=function(){return t(r),r}}else{var n=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}}},3570:(e,t,r)=>{var n,i,a=r(5217),o=r(5327),s=0,u=0;e.exports=function(e,t,r){var c=t&&r||0,l=t||[],f=(e=e||{}).node||n,h=void 0!==e.clockseq?e.clockseq:i;if(null==f||null==h){var p=a();null==f&&(f=n=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==h&&(h=i=16383&(p[6]<<8|p[7]))}var d=void 0!==e.msecs?e.msecs:(new Date).getTime(),y=void 0!==e.nsecs?e.nsecs:u+1,v=d-s+(y-u)/1e4;if(v<0&&void 0===e.clockseq&&(h=h+1&16383),(v<0||d>s)&&void 0===e.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=d,u=y,i=h;var g=(1e4*(268435455&(d+=122192928e5))+y)%4294967296;l[c++]=g>>>24&255,l[c++]=g>>>16&255,l[c++]=g>>>8&255,l[c++]=255&g;var m=d/4294967296*1e4&268435455;l[c++]=m>>>8&255,l[c++]=255&m,l[c++]=m>>>24&15|16,l[c++]=m>>>16&255,l[c++]=h>>>8|128,l[c++]=255&h;for(var b=0;b<6;++b)l[c+b]=f[b];return t||o(l)}},1171:(e,t,r)=>{var n=r(5217),i=r(5327);e.exports=function(e,t,r){var a=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||n)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var s=0;s<16;++s)t[a+s]=o[s];return t||i(o)}},9329:(e,t,r)=>{e.exports=r(516).Observable},516:(e,t)=>{"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var r=0;r1,i=!1,a=arguments[1],o=a;return new r((function(r){return t.subscribe({next:function(t){var a=!i;if(i=!0,!a||n)try{o=e(o,t)}catch(e){return r.error(e)}else o=t},error:function(e){r.error(e)},complete:function(){if(!i&&!n)return r.error(new TypeError("Cannot reduce an empty sequence"));r.next(o),r.complete()}})}))}},{key:"concat",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n=0&&i.splice(e,1),o()}});i.push(a)},error:function(e){n.error(e)},complete:function(){o()}});function o(){a.closed&&0===i.length&&n.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),a.unsubscribe()}}))}},{key:c,value:function(){return this}}],[{key:"from",value:function(t){var r="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var n=f(t,c);if(n){var i=n.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return p(i)&&i.constructor===r?i:new r((function(e){return i.subscribe(e)}))}if(o("iterator")&&(n=f(t,u)))return new r((function(e){y((function(){if(!e.closed){var r=!0,i=!1,a=void 0;try{for(var o,s=n.call(t)[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;if(e.next(u),e.closed)return}}catch(e){i=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}e.complete()}}))}));if(Array.isArray(t))return new r((function(e){y((function(){if(!e.closed){for(var r=0;r{},3438:()=>{}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};(()=>{"use strict";r.r(n),r.d(n,{Client:()=>d,Election:()=>m,IdentificationKeys:()=>$,KeyCeremonyComponent:()=>ee,MESSAGE_PROCESSED:()=>G,MESSAGE_RECEIVED:()=>H,MessageIdentifier:()=>g,TallyComponent:()=>te,Trustee:()=>J,VoteComponent:()=>re,Voter:()=>X});var e=r(1439),t=r(4206),i=r.n(t),a=r(9120),o=r.n(a),s=r(1798),u=r.n(s),c=r(5073),l=r.n(c),f=r(5053),h=r.n(f);class p{constructor({apiEndpointUrl:t,headers:r}){const n=new e.HttpLink({uri:t,headers:r});this.apolloClient=new e.fe({link:n,cache:new e.h4})}async getLogEntry({electionUniqueId:e,contentHash:t}){return(await this.apolloClient.query({query:l(),variables:{electionUniqueId:e,contentHash:t}})).data.logEntry}async getElectionLogEntries({electionUniqueId:e,after:t,types:r}){return(await this.apolloClient.query({query:i(),variables:{electionUniqueId:e,after:t,types:r},fetchPolicy:"no-cache"})).data.election.logEntries}async processKeyCeremonyStep({messageId:e,signedData:t}){const r=await this.apolloClient.mutate({mutation:o(),variables:{messageId:e,signedData:t}});if(r.data.processKeyCeremonyStep.error)throw new Error(r.data.processKeyCeremonyStep.error);return r.data.processKeyCeremonyStep.pendingMessage}async getPendingMessageByMessageId({messageId:e}){return(await this.apolloClient.query({query:h(),variables:{messageId:e}})).data.pendingMessage}async processTallyStep({messageId:e,signedData:t}){const r=await this.apolloClient.mutate({mutation:u(),variables:{messageId:e,signedData:t}});if(r.data.processTallyStep.error)throw new Error(r.data.processTallyStep.error);return r.data.processTallyStep.pendingMessage}}class d{constructor(e){this.apiClient=new p(e)}getLogEntry({electionUniqueId:e,contentHash:t}){return this.apiClient.getLogEntry({electionUniqueId:e,contentHash:t})}getElectionLogEntries(e){return this.apiClient.getElectionLogEntries(e)}processKeyCeremonyStep(e){return this.apiClient.processKeyCeremonyStep(e)}processTallyStep(e){return this.apiClient.processTallyStep(e)}waitForPendingMessageToBeProcessed(e,t=1e3){return new Promise((r=>{const n=setInterval((()=>{this.apiClient.getPendingMessageByMessageId({messageId:e}).then((e=>{"enqueued"!==e.status&&(clearInterval(n),r(e))}))}),t)}))}}const y="t",v=["a","b","v",y];class g{static parse(e){const[t,r]=e.split("+"),[n,i,a,o]=t.split(".",4),[s,u]=r.split(".",2),c=o?`.${o}`:"";if(!v.includes(s))throw new Error("Invalid message identifier format");return{electionId:`${n}.${i}`,type:a,subtype:o,typeSubtype:`${a}${c}`,author:{type:s,id:u}}}static format(e,t,r,n){return`${e}.${t}+${r}.${n}`}}class m{constructor({uniqueId:e,bulletinBoardClient:t,typesFilter:r,options:n}){this.uniqueId=e,this.bulletinBoardClient=t,this.logEntries=[],this.typesFilter=r,this.subscriptionId=null,this.options=n||{waitUntilNextCheck:2e3}}async subscribeToLogEntriesChanges(){this.unsubscribeToLogEntriesChanges(),await this.getLogEntries(),this.subscriptionId=setInterval((()=>{this.getLogEntries()}),this.options.waitUntilNextCheck)}unsubscribeToLogEntriesChanges(){null!==this.subscriptionId&&(clearInterval(this.subscriptionId),this.subscriptionId=null)}getLastMessageFromTrustee(e){for(let t=this.logEntries.length-1;t>=0;t--){const r=this.logEntries[t],n=g.parse(r.messageId);if(n.author.type===y&&n.author.id===e)return r}return null}getLogEntries(){const e=this.logEntries[this.logEntries.length-1],t=e&&e.id||null;return new Promise((e=>{this.bulletinBoardClient.getElectionLogEntries({electionUniqueId:this.uniqueId,after:t,types:this.typesFilter}).then((t=>{t.length&&(this.logEntries=[...this.logEntries,...t]),e()}))}))}}var b=r(655);function E(e){return"function"==typeof e}var S=!1,C={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack;S=e},get useDeprecatedSynchronousErrorHandling(){return S}};function w(e){setTimeout((function(){throw e}),0)}var T={closed:!0,next:function(e){},error:function(e){if(C.useDeprecatedSynchronousErrorHandling)throw e;w(e)},complete:function(){}},A=function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}();var I=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),k=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var t;if(!this.closed){var r,n=this,i=n._parentOrParents,a=n._ctorUnsubscribe,o=n._unsubscribe,s=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,i instanceof e)i.remove(this);else if(null!==i)for(var u=0;u{n.b[t.slug]=e})));for(const e of r)i.push(this.loadKey(e).then((t=>{n.t[e.slug]=t})));return await Promise.all(i),n}loadKey(e){return W.JWK.asKey(e.public_key,"json")}}class J{constructor({uniqueId:e,bulletinBoardClient:t,authorityPublicKeyJSON:r,identificationKeys:n,election:i,wrapperAdapter:a,options:o}){this.uniqueId=e,this.bulletinBoardClient=t,this.identificationKeys=n,this.election=i,this.options=o||{waitUntilNextCheck:100},this.wrapperAdapter=a,this.parser=new Z({authorityPublicKeyJSON:r}),this.events=new Q,this.nextLogEntryIndexToProcess=0,this.lastMessageProcessedWithResult=null,this.hasSetupKeyCeremony=!1}async setup(){return await this.wrapperAdapter.setup(),this.election.subscribeToLogEntriesChanges()}tearDown(){this.election.unsubscribeToLogEntriesChanges()}async*setupKeyCeremony(){let e;for(;!e;)e=await this.waitForNextLogEntryResult();return yield await this.wrapperAdapter.backup(),await this.processKeyCeremonyStep(e),this.hasSetupKeyCeremony=!0,this.hasSetupKeyCeremony}async runKeyCeremony(){if(!this.hasSetupKeyCeremony)throw new Error("The key ceremony has not been setup yet");if(await this.needsToBeRestored())throw new Error("You need to restore the wrapper state to continue");return this.waitForNextLogEntryResult().then((async e=>(await this.processKeyCeremonyStep(e),await this.wrapperAdapter.isKeyCeremonyDone()?this.tearDown():this.runKeyCeremony())))}async runTally(){if(await this.needsToBeRestored())throw new Error("You need to restore the wrapper state to continue");return this.waitForNextLogEntryResult().then((async e=>(await this.processTallyStep(e),await this.wrapperAdapter.isTallyDone()?this.tearDown():this.runTally())))}async needsToBeRestored(){return this.election.getLastMessageFromTrustee(this.uniqueId)&&await this.wrapperAdapter.isFresh()}async restore(e){const t=this.election.getLastMessageFromTrustee(this.uniqueId);return this.hasSetupKeyCeremony=t&&await this.wrapperAdapter.restore(e),this.hasSetupKeyCeremony}async waitForNextLogEntryResult(){return await new Promise((e=>{const t=setInterval((async()=>{const{logEntries:r}=this.election;r.length>this.nextLogEntryIndexToProcess&&(clearInterval(t),e())}),this.options.waitUntilNextCheck)})),this.processNextLogEntry()}async processNextLogEntry(){const{logEntries:e}=this.election,t=e[this.nextLogEntryIndexToProcess];this.events.broadcastMessageReceived(t);const{messageIdentifier:r,decodedData:n}=await this.parser.parse(t),i=await this.wrapperAdapter.processMessage(r.typeSubtype,n);if(this.events.broadcastMessageProcessed(t,i),this.nextLogEntryIndexToProcess+=1,i){const{messageType:e,content:t}=i;return{message_id:g.format(this.election.uniqueId,e,y,this.uniqueId),content:t}}return i}async processKeyCeremonyStep(e){if(e&&!this.isMessageAlreadyLogged(e)){const t=await this.signMessage(e);return this.bulletinBoardClient.processKeyCeremonyStep({messageId:e.message_id,signedData:t})}}async processTallyStep(e){if(e&&!this.isMessageAlreadyLogged(e)){const t=await this.signMessage(e);return this.bulletinBoardClient.processTallyStep({messageId:e.message_id,signedData:t})}}isMessageAlreadyLogged({message_id:e}){const{logEntries:t}=this.election;return t.find((t=>t.messageId===e))}signMessage(e){return this.identificationKeys.sign({iat:Math.floor(new Date/1e3),...e})}}class X{constructor({bulletinBoardClient:e,authorityPublicKeyJSON:t,election:r,uniqueId:n,wrapperAdapter:i}){this.uniqueId=n,this.election=r,this.bulletinBoardClient=e,this.wrapperAdapter=i,this.parser=new Z({authorityPublicKeyJSON:t})}async setup(){return await this.wrapperAdapter.setup(),this.bulletinBoardClient.getElectionLogEntries({electionUniqueId:this.election.uniqueId,types:["create_election","end_key_ceremony"]}).then((async e=>{for(const t of e){const{messageIdentifier:e,decodedData:r}=await this.parser.parse(t);await this.wrapperAdapter.processMessage(e.typeSubtype,r)}}))}async encrypt(e){const{encryptedData:t,auditableData:r}=await this.wrapperAdapter.encrypt(e);return{encryptedData:t,encryptedDataHash:await this.hash(t),auditableData:r}}async hash(e){return window.crypto.subtle.digest("SHA-256",(new TextEncoder).encode(e)).then((e=>Array.from(new Uint8Array(e)).map((e=>e.toString(16).padStart(2,"0"))).join("")))}verifyVote(e){const{uniqueId:t}=this.election;return this.bulletinBoardClient.getLogEntry({electionUniqueId:t,contentHash:e})}}class ${constructor(e,t){this.format="jwk",this.algorithm={name:"RSASSA-PKCS1-v1_5",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},this.usages=["sign"],this.publicKeyAttrs=["alg","e","kty","n"],this.jwtHeader=this._encode64(JSON.stringify({alg:"RS256",typ:"JWT"})),this.trusteeUniqueId=e,this.privateKey=null,this.publicKey=null,this.storedPublicKey=JSON.parse(t||null),this.keyIdentifier=`${e}-private-key`,this.browserSupport=this._checkBrowserSupport(),this.textEncoder=new TextEncoder("utf-8"),this.dbName="identification_keys",this.dbVersion=1,this.presentPromise=this._read()}present(e){this.presentPromise.then((()=>{this._matchesStoredPublicKey(this.publicKey)?e(this.browserSupport&&null!==this.privateKey):this.reset().then(e(!1))}))}async generate(){return!(!this.browserSupport||this.storedPublicKey)&&new Promise(((e,t)=>{try{return this.crypto.subtle.generateKey(this.algorithm,!0,this.usages).then((t=>this.crypto.subtle.exportKey(this.format,t.privateKey).then((t=>{this.publicKey=this._publicKeyFromPrivateKey(t);const r=document.createElement("a");return r.setAttribute("href",`data:text/plain;charset=utf-8,${encodeURIComponent(JSON.stringify(t))}`),r.setAttribute("download",`${this.keyIdentifier}.jwk`),r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),e()})).catch(this._handleErrors)))}catch(e){return t(e)}}))}async upload(e){return!(!this.browserSupport||null!==this.privateKey)&&new Promise(((t,r)=>{if(e)this.onUploadInputChange(e,t,r);else{const e=document.createElement("input");e.setAttribute("type","file"),e.setAttribute("accept",".jwk"),e.style.display="none",document.body.appendChild(e),e.addEventListener("change",(n=>{document.body.removeChild(e),this.onUploadInputChange(n,t,r)})),e.click()}}))}onUploadInputChange(e,t,r){const n=new FileReader;n.readAsText(e.target.files[0]),n.onload=e=>{let n="";try{n=JSON.parse(e.target.result)}catch(e){return r("invalid_format")}return this.crypto.subtle.importKey(this.format,n,this.algorithm,!1,this.usages).then((e=>{const i=this._publicKeyFromPrivateKey(n);this._matchesStoredPublicKey(i)?(this.publicKey=i,this.privateKey=e,this._save().then((()=>t(!0))).catch((()=>{r("could not be saved")}))):r("invalid_public_key")})).catch((()=>{r("invalid_key")}))}}reset(){return this.privateKey=this.publicKey=null,this._clear()}async sign(e){if(!this.browserSupport||null===this.privateKey)return!1;const t=`${this.jwtHeader}.${this._encode64(JSON.stringify(e))}`,r=await this.crypto.subtle.sign(this.algorithm,this.privateKey,this.textEncoder.encode(t));return`${t}.${btoa(Reflect.apply(String.fromCharCode,null,new Uint8Array(r))).replace(/[=]/g,"").replace(/\+/g,"-").replace(/\//g,"_")}`}_checkBrowserSupport(){return this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,this.crypto=window.crypto||window.msCrypto,window.indexedDB&&window.crypto}_handleErrors(e){throw e}_publicKeyFromPrivateKey(e){return Object.keys(e).filter((e=>this.publicKeyAttrs.includes(e))).reduce(((t,r)=>(t[r]=e[r],t)),{})}_matchesStoredPublicKey(e){return Y(e,this.storedPublicKey)}_encode64(e){return btoa(unescape(encodeURIComponent(e))).replace(/[=]/g,"").replace(/\+/g,"-").replace(/\//g,"_")}async _read(){return this._useDb("readonly",(e=>{e.get(this.keyIdentifier).onsuccess=e=>{e.target.result&&(this.privateKey=e.target.result.privateKey,this.publicKey=e.target.result.publicKey)}}))}async _save(){return this._useDb("readwrite",(e=>{e.add({privateKey:this.privateKey,publicKey:this.publicKey},this.keyIdentifier)}))}async _clear(){return this._useDb("readwrite",(e=>{e.delete(this.keyIdentifier)}))}async _useDb(e,t){return new Promise(((r,n)=>{let i=null;const a=this.indexedDB.open(this.dbName,this.dbVersion);a.onerror=e=>{i=null,n(e)},a.onupgradeneeded=()=>{i=a.result,i.createObjectStore("IdentificationKeys")},a.onsuccess=()=>{i=a.result;const n=i.transaction(["IdentificationKeys"],e);t(n.objectStore("IdentificationKeys")),n.oncomplete=()=>{i.close(),r()}}}))}}class ee{constructor({bulletinBoardClientParams:e,authorityPublicKeyJSON:t,electionUniqueId:r,trusteeUniqueId:n,trusteeIdentificationKeys:i,trusteeWrapperAdapter:a}){const o=new d(e);this.election=new m({uniqueId:r,bulletinBoardClient:o,typesFilter:["create_election","start_key_ceremony","key_ceremony","end_key_ceremony"]}),this.trustee=new J({uniqueId:n,bulletinBoardClient:o,authorityPublicKeyJSON:t,identificationKeys:i,election:this.election,wrapperAdapter:a})}async bindEvents({onEvent:e,onBindRestoreButton:t,onBindStartButton:r,onRestore:n,onComplete:i,onStart:a,onTrusteeNeedsToBeRestored:o,onBackupNeeded:s,onBindBackupButton:u,onBackupStarted:c}){const l=this.trustee.setup();this.trustee.events.subscribe(e),r((async e=>{if(a(),e.preventDefault(),await l,await this.trustee.needsToBeRestored())o();else{const e=this.trustee.setupKeyCeremony(),{value:t}=await e.next();s(),u(t,`${this.trustee.uniqueId}-election-${this.election.uniqueId}.bak`,(async()=>{c(),await e.next(),await this.trustee.runKeyCeremony(),i()}))}})),t((async e=>{await l;const t=e.target.files[0],r=new FileReader;r.onload=async({target:e})=>{const t=e.result;await this.trustee.restore(t)&&(n(),await this.trustee.runKeyCeremony(),i())},r.readAsText(t)}))}}class te{constructor({bulletinBoardClientParams:e,authorityPublicKeyJSON:t,electionUniqueId:r,trusteeUniqueId:n,trusteeIdentificationKeys:i,trusteeWrapperAdapter:a}){const o=new d(e);this.election=new m({uniqueId:r,bulletinBoardClient:o,typesFilter:["create_election","start_key_ceremony","key_ceremony","end_key_ceremony","start_tally","tally","end_tally"]}),this.trustee=new J({uniqueId:n,bulletinBoardClient:o,authorityPublicKeyJSON:t,identificationKeys:i,election:this.election,wrapperAdapter:a})}async bindEvents({onEvent:e,onBindRestoreButton:t,onBindStartButton:r,onRestore:n,onComplete:i,onStart:a,onTrusteeNeedsToBeRestored:o}){const s=this.trustee.setup();this.trustee.events.subscribe(e),r((async e=>{a(),e.preventDefault(),await s,await this.trustee.needsToBeRestored()?o():(await this.trustee.runTally(),i())})),t((async e=>{await s;const t=e.target.files[0],r=new FileReader;r.onload=async({target:e})=>{const t=e.result;await this.trustee.restore(t)&&(n(),await this.trustee.runTally(),i())},r.readAsText(t)}))}}class re{constructor({bulletinBoardClientParams:e,authorityPublicKeyJSON:t,electionUniqueId:r,voterUniqueId:n,voterWrapperAdapter:i}){this.bulletinBoardClient=new d(e);const a=new m({uniqueId:r,bulletinBoardClient:this.bulletinBoardClient});this.voter=new X({bulletinBoardClient:this.bulletinBoardClient,authorityPublicKeyJSON:t,election:a,uniqueId:n,wrapperAdapter:i})}async bindEvents({onBindEncryptButton:e,onStart:t,onVoteEncryption:r,castOrAuditBallot:n,onBindAuditBallotButton:i,onBindCastBallotButton:a,onAuditBallot:o,onCastBallot:s,onAuditComplete:u,onCastComplete:c,onInvalid:l}){const f=this.voter.setup();e((async()=>{t(),await f,r((e=>{this.voter.encrypt(e).then((e=>{n(e),i((()=>{o(e,`${this.voter.uniqueId}-election-${this.voter.election.uniqueId}.txt`),u()})),a((async()=>{try{await s(e),c()}catch{l()}}))}))}),(()=>{l()}))}))}}})(),window.decidimBulletinBoard=n})();