mirror of
https://github.com/crypto-pro-web/crypto-pro-js.git
synced 2024-11-24 00:55:00 +03:00
11 lines
110 KiB
JavaScript
11 lines
110 KiB
JavaScript
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("cryptoPro",[],r):"object"==typeof exports?exports.cryptoPro=r():e.cryptoPro=r()}(window,(function(){return function(e){var r={};function t(n){if(r[n])return r[n].exports;var a=r[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,t),a.l=!0,a.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var a in e)t.d(n,a,function(r){return e[r]}.bind(null,a));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=12)}([function(e,r,t){"use strict";var n=this&&this.__awaiter||function(e,r,t,n){return new(t||(t=Promise))((function(a,_){function s(e){try{i(n.next(e))}catch(e){_(e)}}function o(e){try{i(n.throw(e))}catch(e){_(e)}}function i(e){var r;e.done?a(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(s,o)}i((n=n.apply(e,r||[])).next())}))},a=this&&this.__generator||function(e,r){var t,n,a,_,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return _={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(_[Symbol.iterator]=function(){return this}),_;function o(_){return function(o){return function(_){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(a=2&_[0]?n.return:_[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,_[1])).done)return a;switch(n=0,a&&(_=[2&_[0],a.value]),_[0]){case 0:case 1:a=_;break;case 4:return s.label++,{value:_[1],done:!1};case 5:s.label++,n=_[1],_=[0];continue;case 7:_=s.ops.pop(),s.trys.pop();continue;default:if(!(a=s.trys,(a=a.length>0&&a[a.length-1])||6!==_[0]&&2!==_[0])){s=0;continue}if(3===_[0]&&(!a||_[1]>a[0]&&_[1]<a[3])){s.label=_[1];break}if(6===_[0]&&s.label<a[1]){s.label=a[1],a=_;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(_);break}a[2]&&s.ops.pop(),s.trys.pop();continue}_=r.call(e,s)}catch(e){_=[6,e],n=0}finally{t=a=0}if(5&_[0])throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}([_,o])}}};Object.defineProperty(r,"__esModule",{value:!0});var _=t(1),s=!1,o=!1;r._afterPluginsLoaded=function(e){var r=Boolean(window.Promise);return function(){for(var i=[],c=0;c<arguments.length;c++)i[c]=arguments[c];return n(this,void 0,void 0,(function(){var n,c;return a(this,(function(a){switch(a.label){case 0:if(!o){try{t(15)}catch(e){throw console.error(e),new Error(_._extractMeaningfulErrorMessage(e)||"Ошибка при подключении модуля для работы с Cades plugin")}o=!0}if(n=window.cadesplugin,!r)throw new Error("Необходим полифилл для Promise");if(!n)throw new Error("Не подключен модуль для работы с Cades plugin");s||(n.set_log_level(n.LOG_LEVEL_ERROR),s=!0),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,n];case 2:return a.sent(),[3,4];case 3:throw c=a.sent(),console.error(c),new Error(_._extractMeaningfulErrorMessage(c)||"Ошибка при инициализации модуля для работы с Cades plugin");case 4:return[4,e.apply(this,i)];case 5:return[2,a.sent()]}}))}))}}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r._extractMeaningfulErrorMessage=function(e){var r,t=(null===(r=window.cadesplugin)||void 0===r?void 0:r.getLastError)&&window.cadesplugin.getLastError(e);if(!(null==t?void 0:t.message)){if(!e.message)return null;t=e}if(!/[а-яА-Я]/.test(t.message))return null;var n=t.message.match(/^(.*?)(?:(?:\.?\s?\(?(0x[0-9a-zA-Z]{1,8})\)?)|(?:\.?$))/);return n?n[1]+(n[2]?" (Код ошибки: "+n[2]+")":""):null}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.__cadesAsyncToken__={},r.__createCadesPluginObject__=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return{}},r._generateCadesFn=function(e){var r,t=window.cadesplugin,n=Boolean(t.CreateObjectAsync),a=e.name||"dynamicFn",_=String(e),s=(null===(r=_.match(/^function[\s\w]*?\((.*?)\)/))||void 0===r?void 0:r[1])||"",o=_.replace(/^.*?{([\s\S]*?)}$/,"$1"),i=String(new(n?new Function("","return Object.getPrototypeOf(function*(){}).constructor")():Function)(s,o));return i=(i=i.replace(/\w+?\.__createCadesPluginObject__(\([\s\S]*?\))/gm,"cadesplugin.CreateObject"+(n?"Async":"")+"$1")).replace(/\w+?\.__cadesAsyncToken__\s*?\+\s*?\b/gm,n?"yield ":""),n||(i=i.replace(/propset_(.*?)\((.*?)\)/gm,"$1 = $2")),[n?"cadesplugin.async_spawn("+i+");":"("+i+")();","//# sourceURL=crypto-pro_"+a+".js"].join("")}},function(e,r,t){"use strict";function n(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}Object.defineProperty(r,"__esModule",{value:!0}),n(t(17)),n(t(18)),n(t(19)),n(t(20))},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _afterPluginsLoaded_1=__webpack_require__(0),_extractMeaningfulErrorMessage_1=__webpack_require__(1),_generateCadesFn_1=__webpack_require__(2);exports._getCadesCert=_afterPluginsLoaded_1._afterPluginsLoaded((function(thumbprint){var cadesplugin=window.cadesplugin;return eval(_generateCadesFn_1._generateCadesFn((function(){var e,r,t,n;try{e=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.Store")}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при попытке доступа к хранилищу")}if(!e)throw new Error("Не удалось получить доступ к хранилищу сертификатов");try{_generateCadesFn_1.__cadesAsyncToken__,e.Open(cadesplugin.CAPICOM_CURRENT_USER_STORE,cadesplugin.CAPICOM_MY_STORE,cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при открытии хранилища")}try{r=_generateCadesFn_1.__cadesAsyncToken__+e.Certificates,t=_generateCadesFn_1.__cadesAsyncToken__+r.Count}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка получения списка сертификатов")}if(!t)throw new Error("Нет доступных сертификатов");try{if(r=_generateCadesFn_1.__cadesAsyncToken__+r.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_SHA1_HASH,thumbprint),!(_generateCadesFn_1.__cadesAsyncToken__+r.Count))throw new Error('Сертификат с отпечатком: "'+thumbprint+'" не найден');n=_generateCadesFn_1.__cadesAsyncToken__+r.Item(1)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при получении сертификата")}return e.Close(),n})))}))},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r._getDateObj=function(e){return e.getVarDate?e.getVarDate():e}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),function(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}(t(16))},function(e,r,t){"use strict";(function(e){
|
||
/*!
|
||
* The buffer module from node.js, for the browser.
|
||
*
|
||
* @author Feross Aboukhadijeh <http://feross.org>
|
||
* @license MIT
|
||
*/
|
||
var n=t(38),a=t(39),_=t(40);function s(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,r){if(s()<r)throw new RangeError("Invalid typed array length");return i.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(r)).__proto__=i.prototype:(null===e&&(e=new i(r)),e.length=r),e}function i(e,r,t){if(!(i.TYPED_ARRAY_SUPPORT||this instanceof i))return new i(e,r,t);if("number"==typeof e){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return c(this,e,r,t)}function c(e,r,t,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?function(e,r,t,n){if(r.byteLength,t<0||r.byteLength<t)throw new RangeError("'offset' is out of bounds");if(r.byteLength<t+(n||0))throw new RangeError("'length' is out of bounds");r=void 0===t&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,t):new Uint8Array(r,t,n);i.TYPED_ARRAY_SUPPORT?(e=r).__proto__=i.prototype:e=d(e,r);return e}(e,r,t,n):"string"==typeof r?function(e,r,t){"string"==typeof t&&""!==t||(t="utf8");if(!i.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=0|g(r,t),a=(e=o(e,n)).write(r,t);a!==n&&(e=e.slice(0,a));return e}(e,r,t):function(e,r){if(i.isBuffer(r)){var t=0|f(r.length);return 0===(e=o(e,t)).length||r.copy(e,0,0,t),e}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||(n=r.length)!=n?o(e,0):d(e,r);if("Buffer"===r.type&&_(r.data))return d(e,r.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,r)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,r){if(u(r),e=o(e,r<0?0:0|f(r)),!i.TYPED_ARRAY_SUPPORT)for(var t=0;t<r;++t)e[t]=0;return e}function d(e,r){var t=r.length<0?0:0|f(r.length);e=o(e,t);for(var n=0;n<t;n+=1)e[n]=255&r[n];return e}function f(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function g(e,r){if(i.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var t=e.length;if(0===t)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t;case"hex":return t>>>1;case"base64":return B(e).length;default:if(n)return G(e).length;r=(""+r).toLowerCase(),n=!0}}function p(e,r,t){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===t||t>this.length)&&(t=this.length),t<=0)return"";if((t>>>=0)<=(r>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return v(this,r,t);case"utf8":case"utf-8":return w(this,r,t);case"ascii":return S(this,r,t);case"latin1":case"binary":return P(this,r,t);case"base64":return b(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,r,t);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function C(e,r,t){var n=e[r];e[r]=e[t],e[t]=n}function E(e,r,t,n,a){if(0===e.length)return-1;if("string"==typeof t?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=a?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(a)return-1;t=e.length-1}else if(t<0){if(!a)return-1;t=0}if("string"==typeof r&&(r=i.from(r,n)),i.isBuffer(r))return 0===r.length?-1:A(e,r,t,n,a);if("number"==typeof r)return r&=255,i.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):A(e,[r],t,n,a);throw new TypeError("val must be string, number or Buffer")}function A(e,r,t,n,a){var _,s=1,o=e.length,i=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||r.length<2)return-1;s=2,o/=2,i/=2,t/=2}function c(e,r){return 1===s?e[r]:e.readUInt16BE(r*s)}if(a){var u=-1;for(_=t;_<o;_++)if(c(e,_)===c(r,-1===u?0:_-u)){if(-1===u&&(u=_),_-u+1===i)return u*s}else-1!==u&&(_-=_-u),u=-1}else for(t+i>o&&(t=o-i),_=t;_>=0;_--){for(var l=!0,d=0;d<i;d++)if(c(e,_+d)!==c(r,d)){l=!1;break}if(l)return _}return-1}function h(e,r,t,n){t=Number(t)||0;var a=e.length-t;n?(n=Number(n))>a&&(n=a):n=a;var _=r.length;if(_%2!=0)throw new TypeError("Invalid hex string");n>_/2&&(n=_/2);for(var s=0;s<n;++s){var o=parseInt(r.substr(2*s,2),16);if(isNaN(o))return s;e[t+s]=o}return s}function O(e,r,t,n){return j(G(r,e.length-t),e,t,n)}function T(e,r,t,n){return j(function(e){for(var r=[],t=0;t<e.length;++t)r.push(255&e.charCodeAt(t));return r}(r),e,t,n)}function M(e,r,t,n){return T(e,r,t,n)}function y(e,r,t,n){return j(B(r),e,t,n)}function I(e,r,t,n){return j(function(e,r){for(var t,n,a,_=[],s=0;s<e.length&&!((r-=2)<0);++s)t=e.charCodeAt(s),n=t>>8,a=t%256,_.push(a),_.push(n);return _}(r,e.length-t),e,t,n)}function b(e,r,t){return 0===r&&t===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(r,t))}function w(e,r,t){t=Math.min(e.length,t);for(var n=[],a=r;a<t;){var _,s,o,i,c=e[a],u=null,l=c>239?4:c>223?3:c>191?2:1;if(a+l<=t)switch(l){case 1:c<128&&(u=c);break;case 2:128==(192&(_=e[a+1]))&&(i=(31&c)<<6|63&_)>127&&(u=i);break;case 3:_=e[a+1],s=e[a+2],128==(192&_)&&128==(192&s)&&(i=(15&c)<<12|(63&_)<<6|63&s)>2047&&(i<55296||i>57343)&&(u=i);break;case 4:_=e[a+1],s=e[a+2],o=e[a+3],128==(192&_)&&128==(192&s)&&128==(192&o)&&(i=(15&c)<<18|(63&_)<<12|(63&s)<<6|63&o)>65535&&i<1114112&&(u=i)}null===u?(u=65533,l=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),a+=l}return function(e){var r=e.length;if(r<=4096)return String.fromCharCode.apply(String,e);var t="",n=0;for(;n<r;)t+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return t}(n)}r.Buffer=i,r.SlowBuffer=function(e){+e!=e&&(e=0);return i.alloc(+e)},r.INSPECT_MAX_BYTES=50,i.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),r.kMaxLength=s(),i.poolSize=8192,i._augment=function(e){return e.__proto__=i.prototype,e},i.from=function(e,r,t){return c(null,e,r,t)},i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0})),i.alloc=function(e,r,t){return function(e,r,t,n){return u(r),r<=0?o(e,r):void 0!==t?"string"==typeof n?o(e,r).fill(t,n):o(e,r).fill(t):o(e,r)}(null,e,r,t)},i.allocUnsafe=function(e){return l(null,e)},i.allocUnsafeSlow=function(e){return l(null,e)},i.isBuffer=function(e){return!(null==e||!e._isBuffer)},i.compare=function(e,r){if(!i.isBuffer(e)||!i.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var t=e.length,n=r.length,a=0,_=Math.min(t,n);a<_;++a)if(e[a]!==r[a]){t=e[a],n=r[a];break}return t<n?-1:n<t?1:0},i.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(e,r){if(!_(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return i.alloc(0);var t;if(void 0===r)for(r=0,t=0;t<e.length;++t)r+=e[t].length;var n=i.allocUnsafe(r),a=0;for(t=0;t<e.length;++t){var s=e[t];if(!i.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,a),a+=s.length}return n},i.byteLength=g,i.prototype._isBuffer=!0,i.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 r=0;r<e;r+=2)C(this,r,r+1);return this},i.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)C(this,r,r+3),C(this,r+1,r+2);return this},i.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)C(this,r,r+7),C(this,r+1,r+6),C(this,r+2,r+5),C(this,r+3,r+4);return this},i.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?w(this,0,e):p.apply(this,arguments)},i.prototype.equals=function(e){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===i.compare(this,e)},i.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},i.prototype.compare=function(e,r,t,n,a){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===t&&(t=e?e.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),r<0||t>e.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&r>=t)return 0;if(n>=a)return-1;if(r>=t)return 1;if(this===e)return 0;for(var _=(a>>>=0)-(n>>>=0),s=(t>>>=0)-(r>>>=0),o=Math.min(_,s),c=this.slice(n,a),u=e.slice(r,t),l=0;l<o;++l)if(c[l]!==u[l]){_=c[l],s=u[l];break}return _<s?-1:s<_?1:0},i.prototype.includes=function(e,r,t){return-1!==this.indexOf(e,r,t)},i.prototype.indexOf=function(e,r,t){return E(this,e,r,t,!0)},i.prototype.lastIndexOf=function(e,r,t){return E(this,e,r,t,!1)},i.prototype.write=function(e,r,t,n){if(void 0===r)n="utf8",t=this.length,r=0;else if(void 0===t&&"string"==typeof r)n=r,t=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(t)?(t|=0,void 0===n&&(n="utf8")):(n=t,t=void 0)}var a=this.length-r;if((void 0===t||t>a)&&(t=a),e.length>0&&(t<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var _=!1;;)switch(n){case"hex":return h(this,e,r,t);case"utf8":case"utf-8":return O(this,e,r,t);case"ascii":return T(this,e,r,t);case"latin1":case"binary":return M(this,e,r,t);case"base64":return y(this,e,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r,t);default:if(_)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),_=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function S(e,r,t){var n="";t=Math.min(e.length,t);for(var a=r;a<t;++a)n+=String.fromCharCode(127&e[a]);return n}function P(e,r,t){var n="";t=Math.min(e.length,t);for(var a=r;a<t;++a)n+=String.fromCharCode(e[a]);return n}function v(e,r,t){var n=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>n)&&(t=n);for(var a="",_=r;_<t;++_)a+=H(e[_]);return a}function R(e,r,t){for(var n=e.slice(r,t),a="",_=0;_<n.length;_+=2)a+=String.fromCharCode(n[_]+256*n[_+1]);return a}function m(e,r,t){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}function D(e,r,t,n,a,_){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>a||r<_)throw new RangeError('"value" argument is out of bounds');if(t+n>e.length)throw new RangeError("Index out of range")}function N(e,r,t,n){r<0&&(r=65535+r+1);for(var a=0,_=Math.min(e.length-t,2);a<_;++a)e[t+a]=(r&255<<8*(n?a:1-a))>>>8*(n?a:1-a)}function x(e,r,t,n){r<0&&(r=4294967295+r+1);for(var a=0,_=Math.min(e.length-t,4);a<_;++a)e[t+a]=r>>>8*(n?a:3-a)&255}function L(e,r,t,n,a,_){if(t+n>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function F(e,r,t,n,_){return _||L(e,0,t,4),a.write(e,r,t,n,23,4),t+4}function k(e,r,t,n,_){return _||L(e,0,t,8),a.write(e,r,t,n,52,8),t+8}i.prototype.slice=function(e,r){var t,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<e&&(r=e),i.TYPED_ARRAY_SUPPORT)(t=this.subarray(e,r)).__proto__=i.prototype;else{var a=r-e;t=new i(a,void 0);for(var _=0;_<a;++_)t[_]=this[_+e]}return t},i.prototype.readUIntLE=function(e,r,t){e|=0,r|=0,t||m(e,r,this.length);for(var n=this[e],a=1,_=0;++_<r&&(a*=256);)n+=this[e+_]*a;return n},i.prototype.readUIntBE=function(e,r,t){e|=0,r|=0,t||m(e,r,this.length);for(var n=this[e+--r],a=1;r>0&&(a*=256);)n+=this[e+--r]*a;return n},i.prototype.readUInt8=function(e,r){return r||m(e,1,this.length),this[e]},i.prototype.readUInt16LE=function(e,r){return r||m(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUInt16BE=function(e,r){return r||m(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUInt32LE=function(e,r){return r||m(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUInt32BE=function(e,r){return r||m(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,r,t){e|=0,r|=0,t||m(e,r,this.length);for(var n=this[e],a=1,_=0;++_<r&&(a*=256);)n+=this[e+_]*a;return n>=(a*=128)&&(n-=Math.pow(2,8*r)),n},i.prototype.readIntBE=function(e,r,t){e|=0,r|=0,t||m(e,r,this.length);for(var n=r,a=1,_=this[e+--n];n>0&&(a*=256);)_+=this[e+--n]*a;return _>=(a*=128)&&(_-=Math.pow(2,8*r)),_},i.prototype.readInt8=function(e,r){return r||m(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,r){r||m(e,2,this.length);var t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},i.prototype.readInt16BE=function(e,r){r||m(e,2,this.length);var t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},i.prototype.readInt32LE=function(e,r){return r||m(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,r){return r||m(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,r){return r||m(e,4,this.length),a.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,r){return r||m(e,4,this.length),a.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,r){return r||m(e,8,this.length),a.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,r){return r||m(e,8,this.length),a.read(this,e,!1,52,8)},i.prototype.writeUIntLE=function(e,r,t,n){(e=+e,r|=0,t|=0,n)||D(this,e,r,t,Math.pow(2,8*t)-1,0);var a=1,_=0;for(this[r]=255&e;++_<t&&(a*=256);)this[r+_]=e/a&255;return r+t},i.prototype.writeUIntBE=function(e,r,t,n){(e=+e,r|=0,t|=0,n)||D(this,e,r,t,Math.pow(2,8*t)-1,0);var a=t-1,_=1;for(this[r+a]=255&e;--a>=0&&(_*=256);)this[r+a]=e/_&255;return r+t},i.prototype.writeUInt8=function(e,r,t){return e=+e,r|=0,t||D(this,e,r,1,255,0),i.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=255&e,r+1},i.prototype.writeUInt16LE=function(e,r,t){return e=+e,r|=0,t||D(this,e,r,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):N(this,e,r,!0),r+2},i.prototype.writeUInt16BE=function(e,r,t){return e=+e,r|=0,t||D(this,e,r,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):N(this,e,r,!1),r+2},i.prototype.writeUInt32LE=function(e,r,t){return e=+e,r|=0,t||D(this,e,r,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=255&e):x(this,e,r,!0),r+4},i.prototype.writeUInt32BE=function(e,r,t){return e=+e,r|=0,t||D(this,e,r,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):x(this,e,r,!1),r+4},i.prototype.writeIntLE=function(e,r,t,n){if(e=+e,r|=0,!n){var a=Math.pow(2,8*t-1);D(this,e,r,t,a-1,-a)}var _=0,s=1,o=0;for(this[r]=255&e;++_<t&&(s*=256);)e<0&&0===o&&0!==this[r+_-1]&&(o=1),this[r+_]=(e/s>>0)-o&255;return r+t},i.prototype.writeIntBE=function(e,r,t,n){if(e=+e,r|=0,!n){var a=Math.pow(2,8*t-1);D(this,e,r,t,a-1,-a)}var _=t-1,s=1,o=0;for(this[r+_]=255&e;--_>=0&&(s*=256);)e<0&&0===o&&0!==this[r+_+1]&&(o=1),this[r+_]=(e/s>>0)-o&255;return r+t},i.prototype.writeInt8=function(e,r,t){return e=+e,r|=0,t||D(this,e,r,1,127,-128),i.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=255&e,r+1},i.prototype.writeInt16LE=function(e,r,t){return e=+e,r|=0,t||D(this,e,r,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):N(this,e,r,!0),r+2},i.prototype.writeInt16BE=function(e,r,t){return e=+e,r|=0,t||D(this,e,r,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):N(this,e,r,!1),r+2},i.prototype.writeInt32LE=function(e,r,t){return e=+e,r|=0,t||D(this,e,r,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):x(this,e,r,!0),r+4},i.prototype.writeInt32BE=function(e,r,t){return e=+e,r|=0,t||D(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),i.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):x(this,e,r,!1),r+4},i.prototype.writeFloatLE=function(e,r,t){return F(this,e,r,!0,t)},i.prototype.writeFloatBE=function(e,r,t){return F(this,e,r,!1,t)},i.prototype.writeDoubleLE=function(e,r,t){return k(this,e,r,!0,t)},i.prototype.writeDoubleBE=function(e,r,t){return k(this,e,r,!1,t)},i.prototype.copy=function(e,r,t,n){if(t||(t=0),n||0===n||(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n<t&&(n=t),n===t)return 0;if(0===e.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(t<0||t>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r<n-t&&(n=e.length-r+t);var a,_=n-t;if(this===e&&t<r&&r<n)for(a=_-1;a>=0;--a)e[a+r]=this[a+t];else if(_<1e3||!i.TYPED_ARRAY_SUPPORT)for(a=0;a<_;++a)e[a+r]=this[a+t];else Uint8Array.prototype.set.call(e,this.subarray(t,t+_),r);return _},i.prototype.fill=function(e,r,t,n){if("string"==typeof e){if("string"==typeof r?(n=r,r=0,t=this.length):"string"==typeof t&&(n=t,t=this.length),1===e.length){var a=e.charCodeAt(0);a<256&&(e=a)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(r<0||this.length<r||this.length<t)throw new RangeError("Out of range index");if(t<=r)return this;var _;if(r>>>=0,t=void 0===t?this.length:t>>>0,e||(e=0),"number"==typeof e)for(_=r;_<t;++_)this[_]=e;else{var s=i.isBuffer(e)?e:G(new i(e,n).toString()),o=s.length;for(_=0;_<t-r;++_)this[_+r]=s[_%o]}return this};var U=/[^+\/0-9A-Za-z-_]/g;function H(e){return e<16?"0"+e.toString(16):e.toString(16)}function G(e,r){var t;r=r||1/0;for(var n=e.length,a=null,_=[],s=0;s<n;++s){if((t=e.charCodeAt(s))>55295&&t<57344){if(!a){if(t>56319){(r-=3)>-1&&_.push(239,191,189);continue}if(s+1===n){(r-=3)>-1&&_.push(239,191,189);continue}a=t;continue}if(t<56320){(r-=3)>-1&&_.push(239,191,189),a=t;continue}t=65536+(a-55296<<10|t-56320)}else a&&(r-=3)>-1&&_.push(239,191,189);if(a=null,t<128){if((r-=1)<0)break;_.push(t)}else if(t<2048){if((r-=2)<0)break;_.push(t>>6|192,63&t|128)}else if(t<65536){if((r-=3)<0)break;_.push(t>>12|224,t>>6&63|128,63&t|128)}else{if(!(t<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;_.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}}return _}function B(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,r,t,n){for(var a=0;a<n&&!(a+t>=r.length||a>=e.length);++a)r[a+t]=e[a];return a}}).call(this,t(37))},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var certificate_1=__webpack_require__(6),constants_1=__webpack_require__(3),_afterPluginsLoaded_1=__webpack_require__(0),_extractCommonName_1=__webpack_require__(10),_extractMeaningfulErrorMessage_1=__webpack_require__(1),_generateCadesFn_1=__webpack_require__(2),certificatesCache;exports.getUserCertificates=_afterPluginsLoaded_1._afterPluginsLoaded((function(resetCache){void 0===resetCache&&(resetCache=!1);var cadesplugin=window.cadesplugin;return!resetCache&&certificatesCache?certificatesCache:eval(_generateCadesFn_1._generateCadesFn((function(){var e,r,t;try{e=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.Store")}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при попытке доступа к хранилищу")}try{_generateCadesFn_1.__cadesAsyncToken__,e.Open(cadesplugin.CAPICOM_CURRENT_USER_STORE,cadesplugin.CAPICOM_MY_STORE,cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при открытии хранилища")}try{(r=_generateCadesFn_1.__cadesAsyncToken__+e.Certificates)&&(r=_generateCadesFn_1.__cadesAsyncToken__+r.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_VALID),r=_generateCadesFn_1.__cadesAsyncToken__+r.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY,constants_1.CAPICOM_PROPID_KEY_PROV_INFO),t=_generateCadesFn_1.__cadesAsyncToken__+r.Count)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка получения списка сертификатов")}if(!t)throw new Error("Нет доступных сертификатов");var n=[];try{for(;t;){var a=_generateCadesFn_1.__cadesAsyncToken__+r.Item(t);n.push(new certificate_1.Certificate(a,_extractCommonName_1._extractCommonName(_generateCadesFn_1.__cadesAsyncToken__+a.SubjectName),_generateCadesFn_1.__cadesAsyncToken__+a.IssuerName,_generateCadesFn_1.__cadesAsyncToken__+a.SubjectName,_generateCadesFn_1.__cadesAsyncToken__+a.Thumbprint,_generateCadesFn_1.__cadesAsyncToken__+a.ValidFromDate,_generateCadesFn_1.__cadesAsyncToken__+a.ValidToDate)),t--}}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка обработки сертификатов")}return e.Close(),certificatesCache=n})))}))},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _afterPluginsLoaded_1=__webpack_require__(0),_extractMeaningfulErrorMessage_1=__webpack_require__(1),_generateCadesFn_1=__webpack_require__(2);exports.getCadesProp=_afterPluginsLoaded_1._afterPluginsLoaded((function(propName){var cadesCertificate=this._cadesCertificate;return eval(_generateCadesFn_1._generateCadesFn((function(){var e;try{e=_generateCadesFn_1.__cadesAsyncToken__+cadesCertificate[propName]}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при обращении к свойству сертификата")}return e})))}))},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r._extractCommonName=function(e){var r,t;return null===(t=null===(r=e.match(/CN="?(.+?)"?(?:,|$)/))||void 0===r?void 0:r[1])||void 0===t?void 0:t.replace(/"{2}/g,'"')}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _afterPluginsLoaded_1=__webpack_require__(0),_extractMeaningfulErrorMessage_1=__webpack_require__(1),_generateCadesFn_1=__webpack_require__(2);exports.getSystemInfo=_afterPluginsLoaded_1._afterPluginsLoaded((function(){var sysInfo={cadesVersion:null,cspVersion:null};return eval(_generateCadesFn_1._generateCadesFn((function(){var e;try{e=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.About"),sysInfo.cadesVersion=_generateCadesFn_1.__cadesAsyncToken__+e.PluginVersion,sysInfo.cspVersion=_generateCadesFn_1.__cadesAsyncToken__+e.CSPVersion(),sysInfo.cadesVersion||(sysInfo.cadesVersion=_generateCadesFn_1.__cadesAsyncToken__+e.Version),sysInfo.cadesVersion=_generateCadesFn_1.__cadesAsyncToken__+sysInfo.cadesVersion.toString(),sysInfo.cspVersion=_generateCadesFn_1.__cadesAsyncToken__+sysInfo.cspVersion.toString()}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при получении информации о системе")}return sysInfo})))}))},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),function(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}(t(13))},function(e,r,t){"use strict";function n(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}Object.defineProperty(r,"__esModule",{value:!0}),n(t(14)),n(t(8)),n(t(29)),n(t(11)),n(t(30)),n(t(33)),n(t(34)),n(t(35)),n(t(36)),n(t(41)),n(t(42)),n(t(6)),n(t(43)),n(t(44))},function(e,r,t){"use strict";var n=this&&this.__awaiter||function(e,r,t,n){return new(t||(t=Promise))((function(a,_){function s(e){try{i(n.next(e))}catch(e){_(e)}}function o(e){try{i(n.throw(e))}catch(e){_(e)}}function i(e){var r;e.done?a(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(s,o)}i((n=n.apply(e,r||[])).next())}))},a=this&&this.__generator||function(e,r){var t,n,a,_,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return _={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(_[Symbol.iterator]=function(){return this}),_;function o(_){return function(o){return function(_){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(a=2&_[0]?n.return:_[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,_[1])).done)return a;switch(n=0,a&&(_=[2&_[0],a.value]),_[0]){case 0:case 1:a=_;break;case 4:return s.label++,{value:_[1],done:!1};case 5:s.label++,n=_[1],_=[0];continue;case 7:_=s.ops.pop(),s.trys.pop();continue;default:if(!(a=s.trys,(a=a.length>0&&a[a.length-1])||6!==_[0]&&2!==_[0])){s=0;continue}if(3===_[0]&&(!a||_[1]>a[0]&&_[1]<a[3])){s.label=_[1];break}if(6===_[0]&&s.label<a[1]){s.label=a[1],a=_;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(_);break}a[2]&&s.ops.pop(),s.trys.pop();continue}_=r.call(e,s)}catch(e){_=[6,e],n=0}finally{t=a=0}if(5&_[0])throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}([_,o])}}};Object.defineProperty(r,"__esModule",{value:!0});var _=t(0),s=t(8);r.getCertificate=_._afterPluginsLoaded((function(e){return n(void 0,void 0,void 0,(function(){var r,t;return a(this,(function(n){switch(n.label){case 0:if(!e)throw new Error("Отпечаток не указан");return[4,s.getUserCertificates()];case 1:if(r=n.sent(),!(t=r.find((function(r){return r.thumbprint===e}))))throw new Error('Сертификат с отпечатком: "'+e+'" не найден');return[2,t]}}))}))}))},function(module,exports){!function(){if(!window.cadesplugin){var pluginObject,plugin_resolved=0,plugin_reject,plugin_resolve,isOpera=0,isFireFox=0,isSafari=0,isYandex=0,canPromise=!!window.Promise,cadesplugin_loaded_event_recieved=!1,cadesplugin;cadesplugin=canPromise?new Promise((function(e,r){plugin_resolve=e,plugin_reject=r})):{};var browserSpecs=check_browser(),ru_cryptopro_npcades_10_native_bridge={callbacksCount:1,callbacks:{},resultForCallback:function(e,r){var t=ru_cryptopro_npcades_10_native_bridge.callbacks[e];t&&t.apply(null,r)},call:function(e,r,t){var n=t&&"function"==typeof t,a=n?ru_cryptopro_npcades_10_native_bridge.callbacksCount++:0;n&&(ru_cryptopro_npcades_10_native_bridge.callbacks[a]=t);var _=document.createElement("IFRAME"),s=new Array("_CPNP_handle");try{_.setAttribute("src","cpnp-js-call:"+e+":"+a+":"+encodeURIComponent(JSON.stringify(r,s)))}catch(e){alert(e)}document.documentElement.appendChild(_),_.parentNode.removeChild(_),_=null}};cadesplugin.JSModuleVersion="2.3.1",cadesplugin.async_spawn=async_spawn,cadesplugin.set=set_pluginObject,cadesplugin.set_log_level=set_log_level,cadesplugin.getLastError=getLastError,cadesplugin.is_capilite_enabled=is_capilite_enabled,isNativeMessageSupported()&&(cadesplugin.CreateObjectAsync=CreateObjectAsync,cadesplugin.ReleasePluginObjects=ReleasePluginObjects),isNativeMessageSupported()||(cadesplugin.CreateObject=CreateObject),window.cadesplugin_load_timeout?setTimeout(check_load_timeout,window.cadesplugin_load_timeout):setTimeout(check_load_timeout,2e4),set_constantValues(),cadesplugin.current_log_level=cadesplugin.LOG_LEVEL_ERROR,window.cadesplugin=cadesplugin,check_plugin_working()}function check_browser(){var e,r=navigator.userAgent,t=r.match(/(opera|yabrowser|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(t[1])?{name:"IE",version:(e=/\brv[ :]+(\d+)/g.exec(r)||[])[1]||""}:"Chrome"===t[1]&&null!=(e=r.match(/\b(OPR|Edg|YaBrowser)\/(\d+)/))?{name:e[1].replace("OPR","Opera"),version:e[2]}:(t=t[2]?[t[1],t[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(e=r.match(/version\/(\d+)/i))&&t.splice(1,1,e[1]),{name:t[0],version:t[1]})}function cpcsp_console_log(e,r){if("undefined"!=typeof console)return e<=cadesplugin.current_log_level?(e===cadesplugin.LOG_LEVEL_DEBUG&&console.log("DEBUG: %s",r),e===cadesplugin.LOG_LEVEL_INFO&&console.info("INFO: %s",r),void(e===cadesplugin.LOG_LEVEL_ERROR&&console.error("ERROR: %s",r))):void 0}function set_log_level(e){e===cadesplugin.LOG_LEVEL_DEBUG||e===cadesplugin.LOG_LEVEL_INFO||e===cadesplugin.LOG_LEVEL_ERROR?(cadesplugin.current_log_level=e,cadesplugin.current_log_level===cadesplugin.LOG_LEVEL_DEBUG&&cpcsp_console_log(cadesplugin.LOG_LEVEL_INFO,"cadesplugin_api.js: log_level = DEBUG"),cadesplugin.current_log_level===cadesplugin.LOG_LEVEL_INFO&&cpcsp_console_log(cadesplugin.LOG_LEVEL_INFO,"cadesplugin_api.js: log_level = INFO"),cadesplugin.current_log_level===cadesplugin.LOG_LEVEL_ERROR&&cpcsp_console_log(cadesplugin.LOG_LEVEL_INFO,"cadesplugin_api.js: log_level = ERROR"),isNativeMessageSupported()&&(cadesplugin.current_log_level===cadesplugin.LOG_LEVEL_DEBUG&&window.postMessage("set_log_level=debug","*"),cadesplugin.current_log_level===cadesplugin.LOG_LEVEL_INFO&&window.postMessage("set_log_level=info","*"),cadesplugin.current_log_level===cadesplugin.LOG_LEVEL_ERROR&&window.postMessage("set_log_level=error","*"))):cpcsp_console_log(cadesplugin.LOG_LEVEL_ERROR,"cadesplugin_api.js: Incorrect log_level: "+e)}function set_constantValues(){cadesplugin.CAPICOM_MEMORY_STORE=0,cadesplugin.CAPICOM_LOCAL_MACHINE_STORE=1,cadesplugin.CAPICOM_CURRENT_USER_STORE=2,cadesplugin.CAPICOM_SMART_CARD_USER_STORE=4,cadesplugin.CADESCOM_MEMORY_STORE=0,cadesplugin.CADESCOM_LOCAL_MACHINE_STORE=1,cadesplugin.CADESCOM_CURRENT_USER_STORE=2,cadesplugin.CADESCOM_SMART_CARD_USER_STORE=4,cadesplugin.CADESCOM_CONTAINER_STORE=100,cadesplugin.CAPICOM_MY_STORE="My",cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED=2,cadesplugin.CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME=1,cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED=0,cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING=1,cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE=2,cadesplugin.CADESCOM_XADES_DEFAULT=16,cadesplugin.CADESCOM_XADES_BES=32,cadesplugin.CADESCOM_XADES_T=80,cadesplugin.CADESCOM_XADES_X_LONG_TYPE_1=1488,cadesplugin.CADESCOM_XMLDSIG_TYPE=0,cadesplugin.XmlDsigGost3410UrlObsolete="http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411",cadesplugin.XmlDsigGost3411UrlObsolete="http://www.w3.org/2001/04/xmldsig-more#gostr3411",cadesplugin.XmlDsigGost3410Url="urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102001-gostr3411",cadesplugin.XmlDsigGost3411Url="urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411",cadesplugin.XmlDsigGost3411Url2012256="urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34112012-256",cadesplugin.XmlDsigGost3410Url2012256="urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102012-gostr34112012-256",cadesplugin.XmlDsigGost3411Url2012512="urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34112012-512",cadesplugin.XmlDsigGost3410Url2012512="urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102012-gostr34112012-512",cadesplugin.CADESCOM_CADES_DEFAULT=0,cadesplugin.CADESCOM_CADES_BES=1,cadesplugin.CADESCOM_CADES_T=5,cadesplugin.CADESCOM_CADES_X_LONG_TYPE_1=93,cadesplugin.CADESCOM_PKCS7_TYPE=65535,cadesplugin.CADESCOM_ENCODE_BASE64=0,cadesplugin.CADESCOM_ENCODE_BINARY=1,cadesplugin.CADESCOM_ENCODE_ANY=-1,cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT=0,cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN=1,cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY=2,cadesplugin.CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME=0,cadesplugin.CAPICOM_CERT_INFO_ISSUER_SIMPLE_NAME=1,cadesplugin.CAPICOM_CERTIFICATE_FIND_SHA1_HASH=0,cadesplugin.CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME=1,cadesplugin.CAPICOM_CERTIFICATE_FIND_ISSUER_NAME=2,cadesplugin.CAPICOM_CERTIFICATE_FIND_ROOT_NAME=3,cadesplugin.CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME=4,cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENSION=5,cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY=6,cadesplugin.CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY=7,cadesplugin.CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY=8,cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_VALID=9,cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID=10,cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED=11,cadesplugin.CAPICOM_CERTIFICATE_FIND_KEY_USAGE=12,cadesplugin.CAPICOM_DIGITAL_SIGNATURE_KEY_USAGE=128,cadesplugin.CAPICOM_PROPID_ENHKEY_USAGE=9,cadesplugin.CAPICOM_OID_OTHER=0,cadesplugin.CAPICOM_OID_KEY_USAGE_EXTENSION=10,cadesplugin.CAPICOM_EKU_CLIENT_AUTH=2,cadesplugin.CAPICOM_EKU_SMARTCARD_LOGON=5,cadesplugin.CAPICOM_EKU_OTHER=0,cadesplugin.CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME=0,cadesplugin.CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME=1,cadesplugin.CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION=2,cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME=0,cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME=1,cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION=2,cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_MACHINE_INFO=256,cadesplugin.CADESCOM_ATTRIBUTE_OTHER=-1,cadesplugin.CADESCOM_STRING_TO_UCS2LE=0,cadesplugin.CADESCOM_BASE64_TO_BINARY=1,cadesplugin.CADESCOM_DISPLAY_DATA_NONE=0,cadesplugin.CADESCOM_DISPLAY_DATA_CONTENT=1,cadesplugin.CADESCOM_DISPLAY_DATA_ATTRIBUTE=2,cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_RC2=0,cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_RC4=1,cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_DES=2,cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_3DES=3,cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_AES=4,cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_GOST_28147_89=25,cadesplugin.CADESCOM_HASH_ALGORITHM_SHA1=0,cadesplugin.CADESCOM_HASH_ALGORITHM_MD2=1,cadesplugin.CADESCOM_HASH_ALGORITHM_MD4=2,cadesplugin.CADESCOM_HASH_ALGORITHM_MD5=3,cadesplugin.CADESCOM_HASH_ALGORITHM_SHA_256=4,cadesplugin.CADESCOM_HASH_ALGORITHM_SHA_384=5,cadesplugin.CADESCOM_HASH_ALGORITHM_SHA_512=6,cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411=100,cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256=101,cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512=102,cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_HMAC=110,cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256_HMAC=111,cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512_HMAC=112,cadesplugin.LOG_LEVEL_DEBUG=4,cadesplugin.LOG_LEVEL_INFO=2,cadesplugin.LOG_LEVEL_ERROR=1,cadesplugin.CADESCOM_AllowNone=0,cadesplugin.CADESCOM_AllowNoOutstandingRequest=1,cadesplugin.CADESCOM_AllowUntrustedCertificate=2,cadesplugin.CADESCOM_AllowUntrustedRoot=4,cadesplugin.CADESCOM_SkipInstallToStore=268435456,cadesplugin.CADESCOM_InstallCertChainToContainer=536870912,cadesplugin.CADESCOM_UseContainerStore=1073741824,cadesplugin.ENABLE_CARRIER_TYPE_CSP=1,cadesplugin.ENABLE_CARRIER_TYPE_FKC_NO_SM=2,cadesplugin.ENABLE_CARRIER_TYPE_FKC_SM=4,cadesplugin.ENABLE_ANY_CARRIER_TYPE=7,cadesplugin.DISABLE_EVERY_CARRIER_OPERATION=0,cadesplugin.ENABLE_CARRIER_OPEN_ENUM=1,cadesplugin.ENABLE_CARRIER_CREATE=2,cadesplugin.ENABLE_ANY_OPERATION=3,cadesplugin.CADESCOM_PRODUCT_CSP=0,cadesplugin.CADESCOM_PRODUCT_OCSP=1,cadesplugin.CADESCOM_PRODUCT_TSP=2,cadesplugin.MEDIA_TYPE_REGISTRY=1,cadesplugin.MEDIA_TYPE_HDIMAGE=2,cadesplugin.MEDIA_TYPE_CLOUD=4,cadesplugin.MEDIA_TYPE_SCARD=8,cadesplugin.XCN_CRYPT_STRING_BASE64HEADER=0,cadesplugin.AT_KEYEXCHANGE=1,cadesplugin.AT_SIGNATURE=2}function async_spawn(e){function r(e,r){var _;try{_=t[e](r)}catch(e){return Promise.reject(e)}return _.done?_.value:Promise.resolve(_.value).then(n,a)}var t=e(Array.prototype.slice.call(arguments,1)),n=r.bind(r,"next"),a=r.bind(r,"throw");return n()}function isIE(){return"IE"===browserSpecs.name||"MSIE"===browserSpecs.name}function isIOS(){return navigator.userAgent.match(/ipod/i)||navigator.userAgent.match(/ipad/i)||navigator.userAgent.match(/iphone/i)}function isNativeMessageSupported(){return!isIE()&&("Edg"===browserSpecs.name||("YaBrowser"===browserSpecs.name?(isYandex=!0,!0):"Opera"===browserSpecs.name?(isOpera=!0,browserSpecs.version>=33):"Firefox"===browserSpecs.name?(isFireFox=!0,browserSpecs.version>=52):"Chrome"===browserSpecs.name?browserSpecs.version>=42:"Safari"===browserSpecs.name?(isSafari=!0,browserSpecs.version>=12):void 0))}function CreateObject(e){if(isIOS())return call_ru_cryptopro_npcades_10_native_bridge("CreateObject",[e]);if(isIE()){if(e.match(/X509Enrollment/i))try{return document.getElementById("webClassFactory").CreateObject(e)}catch(r){try{return document.getElementById("certEnrollClassFactory").CreateObject(e)}catch(e){throw"Для создания обьектов X509Enrollment следует настроить веб-узел на использование проверки подлинности по протоколу HTTPS"}}try{return document.getElementById("webClassFactory").CreateObject(e)}catch(r){return new ActiveXObject(e)}}return pluginObject.CreateObject(e)}function decimalToHexString(e){return e<0&&(e=4294967295+e+1),e.toString(16).toUpperCase()}function GetMessageFromException(e){var r=e.message;return r?e.number&&(r+=" (0x"+decimalToHexString(e.number)+")"):r=e,r}function getLastError(e){if(isNativeMessageSupported()||isIE()||isIOS())return GetMessageFromException(e);try{return pluginObject.getLastError()}catch(r){return GetMessageFromException(e)}}function ReleasePluginObjects(){return cpcsp_chrome_nmcades.ReleasePluginObjects()}function CreateObjectAsync(e){return pluginObject.CreateObjectAsync(e)}function call_ru_cryptopro_npcades_10_native_bridge(functionName,array){var tmpobj,ex;if(ru_cryptopro_npcades_10_native_bridge.call(functionName,array,(function(e,response){ex=e;var str="tmpobj="+response;eval(str),"string"==typeof tmpobj&&(tmpobj=tmpobj.replace(/\\\n/gm,"\n"),tmpobj=tmpobj.replace(/\\\r/gm,"\r"))})),ex)throw ex;return tmpobj}function show_firefox_missing_extension_dialog(){if(!window.cadesplugin_skip_extension_install){var e=document.createElement("div");e.id="cadesplugin_ovr",e.style="visibility: hidden; position: fixed; left: 0px; top: 0px; width:100%; height:100%; background-color: rgba(0,0,0,0.7)",e.innerHTML="<div id='cadesplugin_ovr_item' style='position:relative; width:400px; margin:100px auto; background-color:#fff; border:2px solid #000; padding:10px; text-align:center; opacity: 1; z-index: 1500'><button id='cadesplugin_close_install' style='float: right; font-size: 10px; background: transparent; border: 1; margin: -5px'>X</button><p>Для работы КриптоПро ЭЦП Browser plugin на данном сайте необходимо расширение для браузера. Убедитесь, что оно у Вас включено или установите его.<p><a href='https://www.cryptopro.ru/sites/default/files/products/cades/extensions/firefox_cryptopro_extension_latest.xpi'>Скачать расширение</a></p></div>",document.getElementsByTagName("Body")[0].appendChild(e),document.getElementById("cadesplugin_close_install").addEventListener("click",(function(){plugin_loaded_error("Плагин недоступен"),document.getElementById("cadesplugin_ovr").style.visibility="hidden"})),e.addEventListener("click",(function(){plugin_loaded_error("Плагин недоступен"),document.getElementById("cadesplugin_ovr").style.visibility="hidden"})),e.style.visibility="visible"}}function firefox_or_safari_nmcades_onload(){cpcsp_chrome_nmcades.check_chrome_plugin(plugin_loaded,plugin_loaded_error)}function nmcades_api_onload(){window.postMessage("cadesplugin_echo_request","*"),window.addEventListener("message",(function(e){if("string"==typeof e.data&&e.data.match("cadesplugin_loaded")&&!cadesplugin_loaded_event_recieved){if(isFireFox||isSafari){var r=e.data.substring(e.data.indexOf("url:")+4);if(!r.match("^moz-extension://[a-zA-Z0-9-]+/nmcades_plugin_api.js$")&&!r.match("^safari-extension://[a-zA-Z0-9-]+/[a-zA-Z0-9]+/nmcades_plugin_api.js$"))return cpcsp_console_log(cadesplugin.LOG_LEVEL_ERROR,'Bad url "'+r+'" for load CryptoPro Extension for CAdES Browser plug-in'),void plugin_loaded_error();var t=document.createElement("script");t.setAttribute("type","text/javascript"),t.setAttribute("src",r),t.onerror=plugin_loaded_error,t.onload=firefox_or_safari_nmcades_onload,document.getElementsByTagName("head")[0].appendChild(t)}else cpcsp_chrome_nmcades.check_chrome_plugin(plugin_loaded,plugin_loaded_error);cadesplugin_loaded_event_recieved=!0}}),!1)}function load_extension(){var e;isFireFox||isSafari?nmcades_api_onload():isOpera||isYandex?((e=document.createElement("script")).setAttribute("type","text/javascript"),e.setAttribute("src","chrome-extension://epebfcehmdedogndhlcacafjaacknbcm/nmcades_plugin_api.js"),e.onerror=plugin_loaded_error,e.onload=nmcades_api_onload,document.getElementsByTagName("head")[0].appendChild(e)):((e=document.createElement("script")).setAttribute("type","text/javascript"),e.setAttribute("src","chrome-extension://iifchhfnnmpdbibifmljnfjhpififfog/nmcades_plugin_api.js"),e.onerror=plugin_loaded_error,e.onload=nmcades_api_onload,document.getElementsByTagName("head")[0].appendChild(e))}function load_npapi_plugin(){var e=document.createElement("object");if(e.setAttribute("id","cadesplugin_object"),e.setAttribute("type","application/x-cades"),e.setAttribute("style","visibility: hidden"),document.getElementsByTagName("body")[0].appendChild(e),pluginObject=document.getElementById("cadesplugin_object"),isIE()){var r=document.createElement("object");r.setAttribute("id","certEnrollClassFactory"),r.setAttribute("classid","clsid:884e2049-217d-11da-b2a4-000e7bbb2b09"),r.setAttribute("style","visibility: hidden"),document.getElementsByTagName("body")[0].appendChild(r);var t=document.createElement("object");t.setAttribute("id","webClassFactory"),t.setAttribute("classid","clsid:B04C8637-10BD-484E-B0DA-B8A039F60024"),t.setAttribute("style","visibility: hidden"),document.getElementsByTagName("body")[0].appendChild(t)}}function plugin_loaded(){plugin_resolved=1,canPromise?plugin_resolve():window.postMessage("cadesplugin_loaded","*")}function plugin_loaded_error(e){void 0!==e&&"object"!=typeof e||(e="Плагин недоступен"),plugin_resolved=1,canPromise?plugin_reject(e):window.postMessage("cadesplugin_load_error","*")}function check_load_timeout(){1!==plugin_resolved&&(isFireFox&&show_firefox_missing_extension_dialog(),plugin_resolved=1,canPromise?plugin_reject("Истекло время ожидания загрузки плагина"):window.postMessage("cadesplugin_load_error","*"))}function createPromise(e){return new Promise(e)}function check_npapi_plugin(){try{CreateObject("CAdESCOM.About");plugin_loaded()}catch(r){document.getElementById("cadesplugin_object").style.display="none";var e=navigator.mimeTypes["application/x-cades"];if(e)plugin_loaded_error(e.enabledPlugin?"Плагин загружен, но не создаются обьекты":"Ошибка при загрузке плагина");else plugin_loaded_error("Плагин недоступен")}}function check_plugin_working(){var e=document.createElement("div");e.innerHTML="\x3c!--[if lt IE 9]><i></i><![endif]--\x3e",1===e.getElementsByTagName("i").length?plugin_loaded_error("Internet Explorer версии 8 и ниже не поддерживается"):isNativeMessageSupported()?load_extension():canPromise?"complete"===document.readyState?(load_npapi_plugin(),check_npapi_plugin()):window.addEventListener("load",(function(e){load_npapi_plugin(),check_npapi_plugin()}),!1):window.addEventListener("message",(function(e){"cadesplugin_echo_request"===e.data&&(load_npapi_plugin(),check_npapi_plugin())}),!1)}function set_pluginObject(e){pluginObject=e}function is_capilite_enabled(){return!(void 0===cadesplugin.EnableInternalCSP||!cadesplugin.EnableInternalCSP)}}()},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(3),a=t(21),_=t(22),s=t(9),o=t(23),i=t(24),c=t(25),u=t(27),l=t(28),d=function(){function e(e,r,t,n,a,_,s){this._cadesCertificate=e,this.name=r,this.issuerName=t,this.subjectName=n,this.thumbprint=a,this.validFrom=_,this.validTo=s}return e.prototype.getOwnerInfo=function(){return c.getInfo.call(this,n.SUBJECT_TAGS_TRANSLATIONS,"SubjectName")},e.prototype.getIssuerInfo=function(){return c.getInfo.call(this,n.ISSUER_TAGS_TRANSLATIONS,"IssuerName")},e.prototype.getExtendedKeyUsage=function(){return i.getExtendedKeyUsage.call(this)},e.prototype.getDecodedExtendedKeyUsage=function(){return o.getDecodedExtendedKeyUsage.call(this)},e.prototype.getAlgorithm=function(){return _.getAlgorithm.call(this)},e.prototype.getCadesProp=function(e){return s.getCadesProp.call(this,e)},e.prototype.isValid=function(){return l.isValid.call(this)},e.prototype.exportBase64=function(){return a.exportBase64.call(this)},e.prototype.hasExtendedKeyUsage=function(e){return u.hasExtendedKeyUsage.call(this,e)},e}();r.Certificate=d},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.CADESCOM_ATTRIBUTE_OTHER=-1,r.CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION=2,r.CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME=1,r.CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME=0,r.CADESCOM_AllowNoOutstandingRequest=1,r.CADESCOM_AllowNone=0,r.CADESCOM_AllowUntrustedCertificate=2,r.CADESCOM_AllowUntrustedRoot=4,r.CADESCOM_BASE64_TO_BINARY=1,r.CADESCOM_CADES_BES=1,r.CADESCOM_CADES_DEFAULT=0,r.CADESCOM_CADES_T=5,r.CADESCOM_CADES_X_LONG_TYPE_1=93,r.CADESCOM_CONTAINER_STORE=100,r.CADESCOM_CURRENT_USER_STORE=2,r.CADESCOM_DISPLAY_DATA_ATTRIBUTE=2,r.CADESCOM_DISPLAY_DATA_CONTENT=1,r.CADESCOM_DISPLAY_DATA_NONE=0,r.CADESCOM_ENCODE_ANY=-1,r.CADESCOM_ENCODE_BASE64=0,r.CADESCOM_ENCODE_BINARY=1,r.CADESCOM_ENCRYPTION_ALGORITHM_3DES=3,r.CADESCOM_ENCRYPTION_ALGORITHM_AES=4,r.CADESCOM_ENCRYPTION_ALGORITHM_DES=2,r.CADESCOM_ENCRYPTION_ALGORITHM_GOST_28147_89=25,r.CADESCOM_ENCRYPTION_ALGORITHM_RC2=0,r.CADESCOM_ENCRYPTION_ALGORITHM_RC4=1,r.CADESCOM_HASH_ALGORITHM_CP_GOST_3411=100,r.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256=101,r.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256_HMAC=111,r.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512=102,r.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512_HMAC=112,r.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_HMAC=110,r.CADESCOM_HASH_ALGORITHM_MD2=1,r.CADESCOM_HASH_ALGORITHM_MD4=2,r.CADESCOM_HASH_ALGORITHM_MD5=3,r.CADESCOM_HASH_ALGORITHM_SHA1=0,r.CADESCOM_HASH_ALGORITHM_SHA_256=4,r.CADESCOM_HASH_ALGORITHM_SHA_384=5,r.CADESCOM_HASH_ALGORITHM_SHA_512=6,r.CADESCOM_LOCAL_MACHINE_STORE=1,r.CADESCOM_PKCS7_TYPE=65535,r.CADESCOM_STRING_TO_UCS2LE=0,r.CADESCOM_SkipInstallToStore=268435456,r.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED=0,r.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING=1,r.CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE=2,r.CAPICOM_ACTIVE_DIRECTORY_USER_STORE=3,r.CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION=2,r.CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME=1,r.CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME=0,r.CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY=7,r.CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY=8,r.CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY=6,r.CAPICOM_CERTIFICATE_FIND_EXTENSION=5,r.CAPICOM_CERTIFICATE_FIND_ISSUER_NAME=2,r.CAPICOM_CERTIFICATE_FIND_KEY_USAGE=12,r.CAPICOM_CERTIFICATE_FIND_ROOT_NAME=3,r.CAPICOM_CERTIFICATE_FIND_SHA1_HASH=0,r.CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME=1,r.CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME=4,r.CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED=11,r.CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID=10,r.CAPICOM_CERTIFICATE_FIND_TIME_VALID=9,r.CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT=0,r.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY=2,r.CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN=1,r.CAPICOM_CERT_INFO_ISSUER_SIMPLE_NAME=1,r.CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME=0,r.CAPICOM_CURRENT_USER_STORE=2,r.CAPICOM_DIGITAL_SIGNATURE_KEY_USAGE=128,r.CAPICOM_EKU_CLIENT_AUTH=2,r.CAPICOM_EKU_OTHER=0,r.CAPICOM_EKU_SMARTCARD_LOGON=5,r.CAPICOM_LOCAL_MACHINE_STORE=1,r.CAPICOM_MEMORY_STORE=0,r.CAPICOM_MY_STORE="My",r.CAPICOM_OID_KEY_USAGE_EXTENSION=10,r.CAPICOM_OID_OTHER=0,r.CAPICOM_PROPID_ACCESS_STATE=14,r.CAPICOM_PROPID_ARCHIVED=19,r.CAPICOM_PROPID_ARCHIVED_KEY_HASH=65,r.CAPICOM_PROPID_AUTO_ENROLL=21,r.CAPICOM_PROPID_CROSS_CERT_DIST_POINTS=23,r.CAPICOM_PROPID_CTL_USAGE=9,r.CAPICOM_PROPID_DATE_STAMP=27,r.CAPICOM_PROPID_DESCRIPTION=13,r.CAPICOM_PROPID_EFS=17,r.CAPICOM_PROPID_ENHKEY_USAGE=9,r.CAPICOM_PROPID_ENROLLMENT=26,r.CAPICOM_PROPID_EXTENDED_ERROR_INFO=30,r.CAPICOM_PROPID_FIRST_RESERVED=66,r.CAPICOM_PROPID_FIRST_USER=32768,r.CAPICOM_PROPID_FORTEZZA_DATA=18,r.CAPICOM_PROPID_FRIENDLY_NAME=11,r.CAPICOM_PROPID_HASH_PROP=3,r.CAPICOM_PROPID_IE30_RESERVED=7,r.CAPICOM_PROPID_ISSUER_PUBLIC_KEY_MD5_HASH=24,r.CAPICOM_PROPID_ISSUER_SERIAL_NUMBER_MD5_HASH=28,r.CAPICOM_PROPID_KEY_CONTEXT=5,r.CAPICOM_PROPID_KEY_IDENTIFIER=20,r.CAPICOM_PROPID_KEY_PROV_HANDLE=1,r.CAPICOM_PROPID_KEY_PROV_INFO=2,r.CAPICOM_PROPID_KEY_SPEC=6,r.CAPICOM_PROPID_LAST_RESERVED=32767,r.CAPICOM_PROPID_LAST_USER=65535,r.CAPICOM_PROPID_MD5_HASH=4,r.CAPICOM_PROPID_NEXT_UPDATE_LOCATION=10,r.CAPICOM_PROPID_PUBKEY_ALG_PARA=22,r.CAPICOM_PROPID_PUBKEY_HASH_RESERVED=8,r.CAPICOM_PROPID_PVK_FILE=12,r.CAPICOM_PROPID_RENEWAL=64,r.CAPICOM_PROPID_SHA1_HASH=3,r.CAPICOM_PROPID_SIGNATURE_HASH=15,r.CAPICOM_PROPID_SMART_CARD_DATA=16,r.CAPICOM_PROPID_SUBJECT_NAME_MD5_HASH=29,r.CAPICOM_PROPID_SUBJECT_PUBLIC_KEY_MD5_HASH=25,r.CAPICOM_PROPID_UNKNOWN=0,r.CAPICOM_SMART_CARD_USER_STORE=4,r.CAPICOM_STORE_OPEN_EXISTING_ONLY=128,r.CAPICOM_STORE_OPEN_INCLUDE_ARCHIVED=256,r.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED=2,r.CAPICOM_STORE_OPEN_READ_ONLY=0,r.CAPICOM_STORE_OPEN_READ_WRITE=1,r.CHECK_NONE=0,r.CHECK_OFFLINE_REVOCATION_STATUS=16,r.CHECK_ONLINE_REVOCATION_STATUS=8,r.CHECK_SIGNATURE_VALIDITY=4,r.CHECK_TIME_VALIDITY=2,r.CHECK_TRUSTED_ROOT=1,r.LOG_LEVEL_DEBUG=4,r.LOG_LEVEL_ERROR=1,r.LOG_LEVEL_INFO=2,r.TRUST_CTL_IS_NOT_SIGNATURE_VALID=262144,r.TRUST_CTL_IS_NOT_TIME_VALID=131072,r.TRUST_CTL_IS_NOT_VALID_FOR_USAGE=524288,r.TRUST_IS_CYCLIC=128,r.TRUST_IS_NOT_SIGNATURE_VALID=8,r.TRUST_IS_NOT_TIME_NESTED=2,r.TRUST_IS_NOT_TIME_VALID=1,r.TRUST_IS_NOT_VALID_FOR_USAGE=16,r.TRUST_IS_PARTIAL_CHAIN=65536,r.TRUST_IS_REVOKED=4,r.TRUST_IS_UNTRUSTED_ROOT=32,r.TRUST_REVOCATION_STATUS_UNKNOWN=64,r.XmlDsigGost3410Url="urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102001-gostr3411",r.XmlDsigGost3410UrlObsolete="http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411",r.XmlDsigGost3411Url="urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411",r.XmlDsigGost3411UrlObsolete="http://www.w3.org/2001/04/xmldsig-more#gostr3411"},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ISSUER_TAGS_TRANSLATIONS=[{possibleNames:["UnstructuredName"],translation:"Неструктурированное имя"},{possibleNames:["CN"],translation:"Удостоверяющий центр"},{possibleNames:["C"],translation:"Страна"},{possibleNames:["S"],translation:"Регион"},{possibleNames:["STREET"],translation:"Адрес"},{possibleNames:["O"],translation:"Компания"},{possibleNames:["OU"],translation:"Тип"},{possibleNames:["T"],translation:"Должность"},{possibleNames:["ОГРН","OGRN"],translation:"ОГРН"},{possibleNames:["ОГРНИП","OGRNIP"],translation:"ОГРНИП"},{possibleNames:["СНИЛС","SNILS"],translation:"СНИЛС"},{possibleNames:["ИНН","INN","ИНН организации"],translation:"ИНН"},{possibleNames:["E"],translation:"Email"},{possibleNames:["L"],translation:"Город"}]},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.OIDS_DICTIONARY={"1.2.643.2.2.34.6":"Пользователь Центра Регистрации","1.2.643.2.39.1.1":'Использование в программных продуктах системы "1С:Предприятие 8"',"1.2.643.3.131.1.1":"ИНН","1.2.643.3.141.1.1":"РНС ФСС","1.2.643.3.141.1.2":"КП ФСС","1.2.643.3.2.100.65.13.11":'Использование в системе АИС "Госзакупки" Сахалинской области.',"1.2.643.3.8.100.1":'Сертификат типа "ekey-ГОСТ"',"1.2.643.3.8.100.1.1":"Общее использование в системах ИОК без права заверения финансовых документов","1.2.643.3.8.100.1.10":"Для участия в электронных торгах и подписания государственного контракта в информационных системах Тендерного комитета города Москвы уполномоченными лицами участников размещения государственного заказа города Москвы","1.2.643.3.8.100.1.11":"Подписание электронных документов в автоматизированной информационной системе размещения государственного и муниципального заказа Саратовской области","1.2.643.3.8.100.1.12":"Использование в системе государственного заказа Иркутской области","1.2.643.3.8.100.1.13":"Использование в электронной торговой площадке агентства государственного заказа Красноярского края","1.2.643.3.8.100.1.14":'Использование в электронной торговой площадке "Тендер"',"1.2.643.3.8.100.1.2":"Передача отчетности по ТКС","1.2.643.3.8.100.1.3":"Оформление взаимных обязательств, соглашений, договоров, актов и т.п.","1.2.643.3.8.100.1.4":"Внутрикорпоративный документооборот","1.2.643.3.8.100.1.5":"Использование в системах электронной торговли","1.2.643.3.8.100.1.6":'Использование в торгово-закупочной системе "ЭЛЕКТРА"',"1.2.643.3.8.100.1.7":"Использование в системе Портал государственных закупок Ставропольского края.","1.2.643.3.8.100.1.8":"Использование в Единой системе электронной торговли B2B-Center и B2G.","1.2.643.3.8.100.1.9":"Для участия в электронных торгах и подписания государственного контракта в электронной площадке ОАО «ЕЭТП» уполномоченными лицами участников размещения государственного или муниципального заказа","1.2.643.5.1.24.2.1.3":"Формирование документов для получения государственных услуг в сфере ведения государственного кадастра недвижимости со стороны заявителя","1.2.643.5.1.24.2.1.3.1":"Формирование кадастровым инженером документов для получения государственных услуг в сфере ведения государственного кадастра недвижимости со стороны заявителя","1.2.643.5.1.24.2.2.2":"Формирование документов как результата оказания услуги со стороны органов регистрации прав","1.2.643.5.1.24.2.2.3":"Формирование документов для получения государственных услуг в сфере государственной регистрации прав на недвижимое имущество и сделок с ним со стороны заявителя","1.2.643.6.2.1.7.1":"Использование единоличным исполнительным органом юридического лица или уполномоченными представителями юридического лица в отношениях, связанных с возникновением, исполнением (осуществлением) и прекращением гражданских и иных прав и обязанностей в сфере негосударственного пенсионного обеспечения, негосударственного пенсионного страхования, в сфере деятельности паевых инвестиционных фондов, акционерных инвестиционных фондов, профессиональных участников рынка ценных бумаг, а также связанной с обслуживанием указанной деятельности услуг кредитных и иных организаций","1.2.643.6.2.1.7.2":"Использование физическим лицом в отношениях, связанных с возникновением, исполнением (осуществлением) и прекращением гражданских прав и обязанностей в отношении инвестиционных паев паевых инвестиционных фондов, в том числе отношения, связанные с учетом и/или фиксацией прав на инвестиционные паи паевых инвестиционных фондов","1.2.643.6.3":"Использование в электронных торговых системах и в программном обеспечении, связанным с обменом электронных сообщений","1.2.643.6.3.1.1":"Использование на электронных площадок отобранных для проведения аукционах в электронной форме","1.2.643.6.3.1.2.1":"Тип участника - Юридическое лицо","1.2.643.6.3.1.2.2":"Тип участника - Физическое лицо","1.2.643.6.3.1.2.3":"Тип участника - Индивидуальный предприниматель","1.2.643.6.3.1.3.1":"Участник размещения заказа","1.2.643.6.3.1.4.1":"Администратор организации","1.2.643.6.3.1.4.2":"Уполномоченный специалист","1.2.643.6.3.1.4.3":"Специалист с правом подписи контракта","1.2.840.113549.1.9.2":"Неструктурированное имя","1.3.6.1.4.1.24138.1.1.8.1":'Обеспечение юридической значимости в Системе "Электронная Торговая Площадка"',"1.3.6.1.4.1.29919.21":'Использование в системе Портал государственных закупок Ростовской области "Рефери".',"1.3.6.1.5.5.7.3.2":"Проверка подлинности клиента","1.3.6.1.5.5.7.3.4":"Защищенная электронная почта","1.3.643.3.8.100.15":'Использование в ЭТП "uTender"'}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.SUBJECT_TAGS_TRANSLATIONS=[{possibleNames:["UnstructuredName"],translation:"Неструктурированное имя"},{possibleNames:["CN"],translation:"Владелец"},{possibleNames:["SN"],translation:"Фамилия"},{possibleNames:["G"],translation:"Имя Отчество"},{possibleNames:["C"],translation:"Страна"},{possibleNames:["S"],translation:"Регион"},{possibleNames:["STREET"],translation:"Адрес"},{possibleNames:["O"],translation:"Компания"},{possibleNames:["OU"],translation:"Отдел/подразделение"},{possibleNames:["T"],translation:"Должность"},{possibleNames:["ОГРН","OGRN"],translation:"ОГРН"},{possibleNames:["ОГРНИП","OGRNIP"],translation:"ОГРНИП"},{possibleNames:["СНИЛС","SNILS"],translation:"СНИЛС"},{possibleNames:["ИНН","INN","ИНН организации"],translation:"ИНН"},{possibleNames:["E"],translation:"Email"},{possibleNames:["L"],translation:"Город"}]},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _afterPluginsLoaded_1=__webpack_require__(0),_extractMeaningfulErrorMessage_1=__webpack_require__(1),_generateCadesFn_1=__webpack_require__(2);exports.exportBase64=_afterPluginsLoaded_1._afterPluginsLoaded((function(){var cadesCertificate=this._cadesCertificate;return eval(_generateCadesFn_1._generateCadesFn((function(){var e;try{e=_generateCadesFn_1.__cadesAsyncToken__+cadesCertificate.Export(0)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при экспорте сертификата")}return e})))}))},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _afterPluginsLoaded_1=__webpack_require__(0),_extractMeaningfulErrorMessage_1=__webpack_require__(1),_generateCadesFn_1=__webpack_require__(2);exports.getAlgorithm=_afterPluginsLoaded_1._afterPluginsLoaded((function(){var cadesCertificate=this._cadesCertificate;return eval(_generateCadesFn_1._generateCadesFn((function(){var e,r={algorithm:null,oid:null};try{e=_generateCadesFn_1.__cadesAsyncToken__+cadesCertificate.PublicKey(),e=_generateCadesFn_1.__cadesAsyncToken__+e.Algorithm,r.algorithm=_generateCadesFn_1.__cadesAsyncToken__+e.FriendlyName,r.oid=_generateCadesFn_1.__cadesAsyncToken__+e.Value}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при получении алгоритма")}return r})))}))},function(e,r,t){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e}).apply(this,arguments)},a=this&&this.__awaiter||function(e,r,t,n){return new(t||(t=Promise))((function(a,_){function s(e){try{i(n.next(e))}catch(e){_(e)}}function o(e){try{i(n.throw(e))}catch(e){_(e)}}function i(e){var r;e.done?a(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(s,o)}i((n=n.apply(e,r||[])).next())}))},_=this&&this.__generator||function(e,r){var t,n,a,_,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return _={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(_[Symbol.iterator]=function(){return this}),_;function o(_){return function(o){return function(_){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(a=2&_[0]?n.return:_[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,_[1])).done)return a;switch(n=0,a&&(_=[2&_[0],a.value]),_[0]){case 0:case 1:a=_;break;case 4:return s.label++,{value:_[1],done:!1};case 5:s.label++,n=_[1],_=[0];continue;case 7:_=s.ops.pop(),s.trys.pop();continue;default:if(!(a=s.trys,(a=a.length>0&&a[a.length-1])||6!==_[0]&&2!==_[0])){s=0;continue}if(3===_[0]&&(!a||_[1]>a[0]&&_[1]<a[3])){s.label=_[1];break}if(6===_[0]&&s.label<a[1]){s.label=a[1],a=_;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(_);break}a[2]&&s.ops.pop(),s.trys.pop();continue}_=r.call(e,s)}catch(e){_=[6,e],n=0}finally{t=a=0}if(5&_[0])throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}([_,o])}}};Object.defineProperty(r,"__esModule",{value:!0});var s=t(3),o=t(0);r.getDecodedExtendedKeyUsage=o._afterPluginsLoaded((function(){return a(this,void 0,void 0,(function(){return _(this,(function(e){switch(e.label){case 0:return[4,this.getExtendedKeyUsage()];case 1:return[2,e.sent().reduce((function(e,r){var t;return n(n({},e),((t={})[r]=s.OIDS_DICTIONARY[r]||null,t))}),{})]}}))}))}))},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _afterPluginsLoaded_1=__webpack_require__(0),_extractMeaningfulErrorMessage_1=__webpack_require__(1),_generateCadesFn_1=__webpack_require__(2);exports.getExtendedKeyUsage=_afterPluginsLoaded_1._afterPluginsLoaded((function(){var cadesCertificate=this._cadesCertificate;return eval(_generateCadesFn_1._generateCadesFn((function(){var e,r=[];try{if(e=_generateCadesFn_1.__cadesAsyncToken__+cadesCertificate.ExtendedKeyUsage(),e=_generateCadesFn_1.__cadesAsyncToken__+e.EKUs,(e=_generateCadesFn_1.__cadesAsyncToken__+e.Count)>0)for(;e>0;){var t=void 0;t=_generateCadesFn_1.__cadesAsyncToken__+cadesCertificate.ExtendedKeyUsage(),t=_generateCadesFn_1.__cadesAsyncToken__+t.EKUs,t=_generateCadesFn_1.__cadesAsyncToken__+t.Item(e),t=_generateCadesFn_1.__cadesAsyncToken__+t.OID,r.push(t),e--}}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при получении ОИД'ов")}return r})))}))},function(e,r,t){"use strict";var n=this&&this.__awaiter||function(e,r,t,n){return new(t||(t=Promise))((function(a,_){function s(e){try{i(n.next(e))}catch(e){_(e)}}function o(e){try{i(n.throw(e))}catch(e){_(e)}}function i(e){var r;e.done?a(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(s,o)}i((n=n.apply(e,r||[])).next())}))},a=this&&this.__generator||function(e,r){var t,n,a,_,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return _={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(_[Symbol.iterator]=function(){return this}),_;function o(_){return function(o){return function(_){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(a=2&_[0]?n.return:_[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,_[1])).done)return a;switch(n=0,a&&(_=[2&_[0],a.value]),_[0]){case 0:case 1:a=_;break;case 4:return s.label++,{value:_[1],done:!1};case 5:s.label++,n=_[1],_=[0];continue;case 7:_=s.ops.pop(),s.trys.pop();continue;default:if(!(a=s.trys,(a=a.length>0&&a[a.length-1])||6!==_[0]&&2!==_[0])){s=0;continue}if(3===_[0]&&(!a||_[1]>a[0]&&_[1]<a[3])){s.label=_[1];break}if(6===_[0]&&s.label<a[1]){s.label=a[1],a=_;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(_);break}a[2]&&s.ops.pop(),s.trys.pop();continue}_=r.call(e,s)}catch(e){_=[6,e],n=0}finally{t=a=0}if(5&_[0])throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}([_,o])}}};Object.defineProperty(r,"__esModule",{value:!0});var _=t(0),s=t(1),o=t(26),i=t(9);r.getInfo=_._afterPluginsLoaded((function(e,r){return n(this,void 0,void 0,(function(){var t,n;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,i.getCadesProp.call(this,r)];case 1:return t=a.sent(),[3,3];case 2:throw n=a.sent(),console.error(n),new Error(s._extractMeaningfulErrorMessage(n)||"Ошибка при извлечении информации из сертификата");case 3:return[2,o._parseCertInfo(e,t)]}}))}))}))},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(3);r._parseCertInfo=function(e,r){var t=r.match(/([а-яА-Яa-zA-Z0-9\s.]+)=(?:("[^"]+?")|(.+?))(?:,|$)/g);if(t)return t.map((function(r){var t,a,_,s=r.trim().match(/^([а-яА-Яa-zA-Z0-9\s.]+)=(.+?),?$/),o=null==s?void 0:s[1],i=null===(a=null===(t=null==s?void 0:s[2])||void 0===t?void 0:t.replace(/^"(.*)"/,"$1"))||void 0===a?void 0:a.replace(/"{2}/g,'"'),c=null==o?void 0:o.match(/^OID\.(.*)/),u=null==c?void 0:c[1],l=!1;if(u){var d=n.OIDS_DICTIONARY[u];d&&(o=d,l=!0)}var f=null===(_=e.find((function(e){return e.possibleNames.find((function(e){return e===o}))})))||void 0===_?void 0:_.translation;return f&&(o=f,l=!0),{description:i,title:o,isTranslated:l}}))}},function(e,r,t){"use strict";var n=this&&this.__awaiter||function(e,r,t,n){return new(t||(t=Promise))((function(a,_){function s(e){try{i(n.next(e))}catch(e){_(e)}}function o(e){try{i(n.throw(e))}catch(e){_(e)}}function i(e){var r;e.done?a(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(s,o)}i((n=n.apply(e,r||[])).next())}))},a=this&&this.__generator||function(e,r){var t,n,a,_,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return _={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(_[Symbol.iterator]=function(){return this}),_;function o(_){return function(o){return function(_){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(a=2&_[0]?n.return:_[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,_[1])).done)return a;switch(n=0,a&&(_=[2&_[0],a.value]),_[0]){case 0:case 1:a=_;break;case 4:return s.label++,{value:_[1],done:!1};case 5:s.label++,n=_[1],_=[0];continue;case 7:_=s.ops.pop(),s.trys.pop();continue;default:if(!(a=s.trys,(a=a.length>0&&a[a.length-1])||6!==_[0]&&2!==_[0])){s=0;continue}if(3===_[0]&&(!a||_[1]>a[0]&&_[1]<a[3])){s.label=_[1];break}if(6===_[0]&&s.label<a[1]){s.label=a[1],a=_;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(_);break}a[2]&&s.ops.pop(),s.trys.pop();continue}_=r.call(e,s)}catch(e){_=[6,e],n=0}finally{t=a=0}if(5&_[0])throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}([_,o])}}};Object.defineProperty(r,"__esModule",{value:!0});var _=t(0);r.hasExtendedKeyUsage=_._afterPluginsLoaded((function(e){return n(this,void 0,void 0,(function(){var r;return a(this,(function(t){switch(t.label){case 0:return[4,this.getExtendedKeyUsage()];case 1:return r=t.sent(),[2,Array.isArray(e)?e.every((function(e){return r.some((function(r){return r===e}))})):r.some((function(r){return r===e}))]}}))}))}))},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _afterPluginsLoaded_1=__webpack_require__(0),_extractMeaningfulErrorMessage_1=__webpack_require__(1),_generateCadesFn_1=__webpack_require__(2);exports.isValid=_afterPluginsLoaded_1._afterPluginsLoaded((function(){var cadesCertificate=this._cadesCertificate;return eval(_generateCadesFn_1._generateCadesFn((function(){var e;try{e=_generateCadesFn_1.__cadesAsyncToken__+cadesCertificate.IsValid(),e=_generateCadesFn_1.__cadesAsyncToken__+e.Result}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при проверке сертификата")}return Boolean(e)})))}))},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var certificate_1=__webpack_require__(6),_afterPluginsLoaded_1=__webpack_require__(0),_extractCommonName_1=__webpack_require__(10),_extractMeaningfulErrorMessage_1=__webpack_require__(1),_generateCadesFn_1=__webpack_require__(2),certificatesCache;exports.getAllUserCertificates=_afterPluginsLoaded_1._afterPluginsLoaded((function(resetCache){void 0===resetCache&&(resetCache=!1);var cadesplugin=window.cadesplugin;return!resetCache&&certificatesCache?certificatesCache:eval(_generateCadesFn_1._generateCadesFn((function(){var e,r,t;try{e=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.Store")}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при попытке доступа к хранилищу")}try{_generateCadesFn_1.__cadesAsyncToken__,e.Open(cadesplugin.CAPICOM_CURRENT_USER_STORE,cadesplugin.CAPICOM_MY_STORE,cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при открытии хранилища")}try{r=_generateCadesFn_1.__cadesAsyncToken__+e.Certificates,t=_generateCadesFn_1.__cadesAsyncToken__+r.Count}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка получения списка сертификатов")}if(!t)throw new Error("Нет доступных сертификатов");var n=[];try{for(;t;){var a=_generateCadesFn_1.__cadesAsyncToken__+r.Item(t);n.push(new certificate_1.Certificate(a,_extractCommonName_1._extractCommonName(_generateCadesFn_1.__cadesAsyncToken__+a.SubjectName),_generateCadesFn_1.__cadesAsyncToken__+a.IssuerName,_generateCadesFn_1.__cadesAsyncToken__+a.SubjectName,_generateCadesFn_1.__cadesAsyncToken__+a.Thumbprint,_generateCadesFn_1.__cadesAsyncToken__+a.ValidFromDate,_generateCadesFn_1.__cadesAsyncToken__+a.ValidToDate)),t--}}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка обработки сертификатов")}return e.Close(),certificatesCache=n})))}))},function(e,r,t){"use strict";var n=this&&this.__awaiter||function(e,r,t,n){return new(t||(t=Promise))((function(a,_){function s(e){try{i(n.next(e))}catch(e){_(e)}}function o(e){try{i(n.throw(e))}catch(e){_(e)}}function i(e){var r;e.done?a(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(s,o)}i((n=n.apply(e,r||[])).next())}))},a=this&&this.__generator||function(e,r){var t,n,a,_,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return _={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(_[Symbol.iterator]=function(){return this}),_;function o(_){return function(o){return function(_){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(a=2&_[0]?n.return:_[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,_[1])).done)return a;switch(n=0,a&&(_=[2&_[0],a.value]),_[0]){case 0:case 1:a=_;break;case 4:return s.label++,{value:_[1],done:!1};case 5:s.label++,n=_[1],_=[0];continue;case 7:_=s.ops.pop(),s.trys.pop();continue;default:if(!(a=s.trys,(a=a.length>0&&a[a.length-1])||6!==_[0]&&2!==_[0])){s=0;continue}if(3===_[0]&&(!a||_[1]>a[0]&&_[1]<a[3])){s.label=_[1];break}if(6===_[0]&&s.label<a[1]){s.label=a[1],a=_;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(_);break}a[2]&&s.ops.pop(),s.trys.pop();continue}_=r.call(e,s)}catch(e){_=[6,e],n=0}finally{t=a=0}if(5&_[0])throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}([_,o])}}};Object.defineProperty(r,"__esModule",{value:!0});var _=t(0),s=t(1),o=t(31),i=t(32),c=t(11);r.isValidSystemSetup=_._afterPluginsLoaded((function(){return n(void 0,void 0,void 0,(function(){var e,r;return a(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,c.getSystemInfo()];case 1:return e=t.sent(),[3,3];case 2:throw r=t.sent(),console.error(r),new Error(s._extractMeaningfulErrorMessage(r)||"Настройки ЭП на данной машине не верны");case 3:if(!o._isSupportedCadesVersion(e.cadesVersion))throw new Error("Не поддерживаемая версия плагина");if(!i._isSupportedCSPVersion(e.cspVersion))throw new Error("Не поддерживаемая версия CSP");return[2,!0]}}))}))}))},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r._isSupportedCadesVersion=function(e){var r=e.match(/(\d+)\.(\d+)\.(\d+)/);if(!r)return!1;var t=r[1],n=(r[2],r[3]);return!(Number(t)<2)&&!(2===Number(t)&&Number(n)<12438)}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r._isSupportedCSPVersion=function(e){var r;return e=null===(r=e.match(/\d+?\b(?:\.\d+)?/))||void 0===r?void 0:r[0],Number(e)>=4}},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(e,r,t,n){return new(t||(t=Promise))((function(a,_){function s(e){try{i(n.next(e))}catch(e){_(e)}}function o(e){try{i(n.throw(e))}catch(e){_(e)}}function i(e){var r;e.done?a(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(s,o)}i((n=n.apply(e,r||[])).next())}))},__generator=this&&this.__generator||function(e,r){var t,n,a,_,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return _={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(_[Symbol.iterator]=function(){return this}),_;function o(_){return function(o){return function(_){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(a=2&_[0]?n.return:_[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,_[1])).done)return a;switch(n=0,a&&(_=[2&_[0],a.value]),_[0]){case 0:case 1:a=_;break;case 4:return s.label++,{value:_[1],done:!1};case 5:s.label++,n=_[1],_=[0];continue;case 7:_=s.ops.pop(),s.trys.pop();continue;default:if(!(a=s.trys,(a=a.length>0&&a[a.length-1])||6!==_[0]&&2!==_[0])){s=0;continue}if(3===_[0]&&(!a||_[1]>a[0]&&_[1]<a[3])){s.label=_[1];break}if(6===_[0]&&s.label<a[1]){s.label=a[1],a=_;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(_);break}a[2]&&s.ops.pop(),s.trys.pop();continue}_=r.call(e,s)}catch(e){_=[6,e],n=0}finally{t=a=0}if(5&_[0])throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}([_,o])}}};Object.defineProperty(exports,"__esModule",{value:!0});var _afterPluginsLoaded_1=__webpack_require__(0),_extractMeaningfulErrorMessage_1=__webpack_require__(1),_generateCadesFn_1=__webpack_require__(2),_getCadesCert_1=__webpack_require__(4);exports.createXMLSignature=_afterPluginsLoaded_1._afterPluginsLoaded((function(thumbprint,unencryptedMessage){return __awaiter(void 0,void 0,void 0,(function(){var cadesplugin,cadesCertificate;return __generator(this,(function(_a){switch(_a.label){case 0:return cadesplugin=window.cadesplugin,[4,_getCadesCert_1._getCadesCert(thumbprint)];case 1:return cadesCertificate=_a.sent(),[2,eval(_generateCadesFn_1._generateCadesFn((function(){var e,r,t;try{e=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.CPSigner"),r=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.SignedXML")}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при инициализации подписи")}try{_generateCadesFn_1.__cadesAsyncToken__,e.propset_Certificate(cadesCertificate),_generateCadesFn_1.__cadesAsyncToken__,e.propset_CheckCertificate(!0),_generateCadesFn_1.__cadesAsyncToken__,r.propset_Content(unencryptedMessage),_generateCadesFn_1.__cadesAsyncToken__,r.propset_SignatureType(cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED),_generateCadesFn_1.__cadesAsyncToken__,r.propset_SignatureMethod("urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102012-gostr34112012-256"),_generateCadesFn_1.__cadesAsyncToken__,r.propset_DigestMethod("urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34112012-256")}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при указании данных для подписи")}try{t=_generateCadesFn_1.__cadesAsyncToken__+r.Sign(e)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при подписании данных")}return t})))]}}))}))}))},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(e,r,t,n){return new(t||(t=Promise))((function(a,_){function s(e){try{i(n.next(e))}catch(e){_(e)}}function o(e){try{i(n.throw(e))}catch(e){_(e)}}function i(e){var r;e.done?a(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(s,o)}i((n=n.apply(e,r||[])).next())}))},__generator=this&&this.__generator||function(e,r){var t,n,a,_,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return _={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(_[Symbol.iterator]=function(){return this}),_;function o(_){return function(o){return function(_){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(a=2&_[0]?n.return:_[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,_[1])).done)return a;switch(n=0,a&&(_=[2&_[0],a.value]),_[0]){case 0:case 1:a=_;break;case 4:return s.label++,{value:_[1],done:!1};case 5:s.label++,n=_[1],_=[0];continue;case 7:_=s.ops.pop(),s.trys.pop();continue;default:if(!(a=s.trys,(a=a.length>0&&a[a.length-1])||6!==_[0]&&2!==_[0])){s=0;continue}if(3===_[0]&&(!a||_[1]>a[0]&&_[1]<a[3])){s.label=_[1];break}if(6===_[0]&&s.label<a[1]){s.label=a[1],a=_;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(_);break}a[2]&&s.ops.pop(),s.trys.pop();continue}_=r.call(e,s)}catch(e){_=[6,e],n=0}finally{t=a=0}if(5&_[0])throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}([_,o])}}};Object.defineProperty(exports,"__esModule",{value:!0});var constants_1=__webpack_require__(3),_afterPluginsLoaded_1=__webpack_require__(0),_extractMeaningfulErrorMessage_1=__webpack_require__(1),_generateCadesFn_1=__webpack_require__(2),_getCadesCert_1=__webpack_require__(4),_getDateObj_1=__webpack_require__(5);exports.createDetachedSignature=_afterPluginsLoaded_1._afterPluginsLoaded((function(thumbprint,messageHash){return __awaiter(void 0,void 0,void 0,(function(){var cadesplugin,cadesCertificate;return __generator(this,(function(_a){switch(_a.label){case 0:return cadesplugin=window.cadesplugin,[4,_getCadesCert_1._getCadesCert(thumbprint)];case 1:return cadesCertificate=_a.sent(),[2,eval(_generateCadesFn_1._generateCadesFn((function(){var e,r,t,n;try{e=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CADESCOM.CPAttribute"),r=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.HashedData"),t=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.CadesSignedData"),n=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.CPSigner")}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при инициализации подписи")}var a,_,s=_getDateObj_1._getDateObj(new Date);try{_generateCadesFn_1.__cadesAsyncToken__,e.propset_Name(constants_1.CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME),_generateCadesFn_1.__cadesAsyncToken__,e.propset_Value(s)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при установке времени подписи")}try{_generateCadesFn_1.__cadesAsyncToken__,n.propset_Certificate(cadesCertificate),a=_generateCadesFn_1.__cadesAsyncToken__+n.AuthenticatedAttributes2,_generateCadesFn_1.__cadesAsyncToken__,a.Add(e),_generateCadesFn_1.__cadesAsyncToken__,n.propset_Options(cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при установке сертификата")}try{_generateCadesFn_1.__cadesAsyncToken__,r.propset_Algorithm(cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256),_generateCadesFn_1.__cadesAsyncToken__,r.SetHashValue(messageHash)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при установке хеша")}try{_=_generateCadesFn_1.__cadesAsyncToken__+t.SignHash(r,n,cadesplugin.CADESCOM_PKCS7_TYPE)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при подписании данных")}return _})))]}}))}))}))},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(e,r,t,n){return new(t||(t=Promise))((function(a,_){function s(e){try{i(n.next(e))}catch(e){_(e)}}function o(e){try{i(n.throw(e))}catch(e){_(e)}}function i(e){var r;e.done?a(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(s,o)}i((n=n.apply(e,r||[])).next())}))},__generator=this&&this.__generator||function(e,r){var t,n,a,_,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return _={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(_[Symbol.iterator]=function(){return this}),_;function o(_){return function(o){return function(_){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(a=2&_[0]?n.return:_[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,_[1])).done)return a;switch(n=0,a&&(_=[2&_[0],a.value]),_[0]){case 0:case 1:a=_;break;case 4:return s.label++,{value:_[1],done:!1};case 5:s.label++,n=_[1],_=[0];continue;case 7:_=s.ops.pop(),s.trys.pop();continue;default:if(!(a=s.trys,(a=a.length>0&&a[a.length-1])||6!==_[0]&&2!==_[0])){s=0;continue}if(3===_[0]&&(!a||_[1]>a[0]&&_[1]<a[3])){s.label=_[1];break}if(6===_[0]&&s.label<a[1]){s.label=a[1],a=_;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(_);break}a[2]&&s.ops.pop(),s.trys.pop();continue}_=r.call(e,s)}catch(e){_=[6,e],n=0}finally{t=a=0}if(5&_[0])throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}([_,o])}}};Object.defineProperty(exports,"__esModule",{value:!0});var constants_1=__webpack_require__(3),_afterPluginsLoaded_1=__webpack_require__(0),_extractMeaningfulErrorMessage_1=__webpack_require__(1),_generateCadesFn_1=__webpack_require__(2),_getCadesCert_1=__webpack_require__(4),_getDateObj_1=__webpack_require__(5);exports.addDetachedSignature=_afterPluginsLoaded_1._afterPluginsLoaded((function(thumbprint,signedMessage,messageHash){return __awaiter(void 0,void 0,void 0,(function(){var cadesplugin,cadesCertificate;return __generator(this,(function(_a){switch(_a.label){case 0:return cadesplugin=window.cadesplugin,[4,_getCadesCert_1._getCadesCert(thumbprint)];case 1:return cadesCertificate=_a.sent(),[2,eval(_generateCadesFn_1._generateCadesFn((function(){var e,r,t,n;try{e=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CADESCOM.CPAttribute"),r=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.HashedData"),t=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.CadesSignedData"),n=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.CPSigner")}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при инициализации подписи")}var a,_,s=_getDateObj_1._getDateObj(new Date);try{_generateCadesFn_1.__cadesAsyncToken__,e.propset_Name(constants_1.CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME),_generateCadesFn_1.__cadesAsyncToken__,e.propset_Value(s)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при установке времени подписи")}try{_generateCadesFn_1.__cadesAsyncToken__,n.propset_Certificate(cadesCertificate),a=_generateCadesFn_1.__cadesAsyncToken__+n.AuthenticatedAttributes2,_generateCadesFn_1.__cadesAsyncToken__,a.Add(e),_generateCadesFn_1.__cadesAsyncToken__,n.propset_Options(cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при установке сертификата")}try{_generateCadesFn_1.__cadesAsyncToken__,r.propset_Algorithm(cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256),_generateCadesFn_1.__cadesAsyncToken__,r.SetHashValue(messageHash)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при установке хеша")}try{_generateCadesFn_1.__cadesAsyncToken__,t.VerifyHash(r,signedMessage,cadesplugin.CADESCOM_PKCS7_TYPE),_=_generateCadesFn_1.__cadesAsyncToken__+t.CoSignHash(r,n,cadesplugin.CADESCOM_PKCS7_TYPE)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при подписании данных")}return _})))]}}))}))}))},function(module,exports,__webpack_require__){"use strict";(function(Buffer){var __awaiter=this&&this.__awaiter||function(e,r,t,n){return new(t||(t=Promise))((function(a,_){function s(e){try{i(n.next(e))}catch(e){_(e)}}function o(e){try{i(n.throw(e))}catch(e){_(e)}}function i(e){var r;e.done?a(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(s,o)}i((n=n.apply(e,r||[])).next())}))},__generator=this&&this.__generator||function(e,r){var t,n,a,_,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return _={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(_[Symbol.iterator]=function(){return this}),_;function o(_){return function(o){return function(_){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(a=2&_[0]?n.return:_[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,_[1])).done)return a;switch(n=0,a&&(_=[2&_[0],a.value]),_[0]){case 0:case 1:a=_;break;case 4:return s.label++,{value:_[1],done:!1};case 5:s.label++,n=_[1],_=[0];continue;case 7:_=s.ops.pop(),s.trys.pop();continue;default:if(!(a=s.trys,(a=a.length>0&&a[a.length-1])||6!==_[0]&&2!==_[0])){s=0;continue}if(3===_[0]&&(!a||_[1]>a[0]&&_[1]<a[3])){s.label=_[1];break}if(6===_[0]&&s.label<a[1]){s.label=a[1],a=_;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(_);break}a[2]&&s.ops.pop(),s.trys.pop();continue}_=r.call(e,s)}catch(e){_=[6,e],n=0}finally{t=a=0}if(5&_[0])throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}([_,o])}}};Object.defineProperty(exports,"__esModule",{value:!0});var constants_1=__webpack_require__(3),_afterPluginsLoaded_1=__webpack_require__(0),_extractMeaningfulErrorMessage_1=__webpack_require__(1),_generateCadesFn_1=__webpack_require__(2),_getCadesCert_1=__webpack_require__(4),_getDateObj_1=__webpack_require__(5);exports.createAttachedSignature=_afterPluginsLoaded_1._afterPluginsLoaded((function(thumbprint,unencryptedMessage){return __awaiter(void 0,void 0,void 0,(function(){var cadesplugin,cadesCertificate;return __generator(this,(function(_a){switch(_a.label){case 0:return cadesplugin=window.cadesplugin,[4,_getCadesCert_1._getCadesCert(thumbprint)];case 1:return cadesCertificate=_a.sent(),[2,eval(_generateCadesFn_1._generateCadesFn((function(){var e,r,t;try{e=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CADESCOM.CPAttribute"),r=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.CadesSignedData"),t=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.CPSigner")}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при инициализации подписи")}var n,a,_,s=_getDateObj_1._getDateObj(new Date);try{_generateCadesFn_1.__cadesAsyncToken__,e.propset_Name(constants_1.CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME),_generateCadesFn_1.__cadesAsyncToken__,e.propset_Value(s)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при установке времени подписи")}try{n=Buffer.from(unencryptedMessage).toString("base64")}catch(e){throw console.error(e),new Error("Ошибка при преобразовании сообщения в Base64")}try{_generateCadesFn_1.__cadesAsyncToken__,t.propset_Certificate(cadesCertificate),a=_generateCadesFn_1.__cadesAsyncToken__+t.AuthenticatedAttributes2,_generateCadesFn_1.__cadesAsyncToken__,a.Add(e),_generateCadesFn_1.__cadesAsyncToken__,r.propset_ContentEncoding(cadesplugin.CADESCOM_BASE64_TO_BINARY),_generateCadesFn_1.__cadesAsyncToken__,r.propset_Content(n),_generateCadesFn_1.__cadesAsyncToken__,t.propset_Options(cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при указании данных для подписи")}try{_=_generateCadesFn_1.__cadesAsyncToken__+r.SignCades(t,cadesplugin.CADESCOM_PKCS7_TYPE)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при подписании данных")}return _})))]}}))}))}))}).call(this,__webpack_require__(7).Buffer)},function(e,r){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch(e){"object"==typeof window&&(t=window)}e.exports=t},function(e,r,t){"use strict";r.byteLength=function(e){var r=c(e),t=r[0],n=r[1];return 3*(t+n)/4-n},r.toByteArray=function(e){var r,t,n=c(e),s=n[0],o=n[1],i=new _(function(e,r,t){return 3*(r+t)/4-t}(0,s,o)),u=0,l=o>0?s-4:s;for(t=0;t<l;t+=4)r=a[e.charCodeAt(t)]<<18|a[e.charCodeAt(t+1)]<<12|a[e.charCodeAt(t+2)]<<6|a[e.charCodeAt(t+3)],i[u++]=r>>16&255,i[u++]=r>>8&255,i[u++]=255&r;2===o&&(r=a[e.charCodeAt(t)]<<2|a[e.charCodeAt(t+1)]>>4,i[u++]=255&r);1===o&&(r=a[e.charCodeAt(t)]<<10|a[e.charCodeAt(t+1)]<<4|a[e.charCodeAt(t+2)]>>2,i[u++]=r>>8&255,i[u++]=255&r);return i},r.fromByteArray=function(e){for(var r,t=e.length,a=t%3,_=[],s=0,o=t-a;s<o;s+=16383)_.push(u(e,s,s+16383>o?o:s+16383));1===a?(r=e[t-1],_.push(n[r>>2]+n[r<<4&63]+"==")):2===a&&(r=(e[t-2]<<8)+e[t-1],_.push(n[r>>10]+n[r>>4&63]+n[r<<2&63]+"="));return _.join("")};for(var n=[],a=[],_="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,i=s.length;o<i;++o)n[o]=s[o],a[s.charCodeAt(o)]=o;function c(e){var r=e.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");return-1===t&&(t=r),[t,t===r?0:4-t%4]}function u(e,r,t){for(var a,_,s=[],o=r;o<t;o+=3)a=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),s.push(n[(_=a)>>18&63]+n[_>>12&63]+n[_>>6&63]+n[63&_]);return s.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},function(e,r){
|
||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||
r.read=function(e,r,t,n,a){var _,s,o=8*a-n-1,i=(1<<o)-1,c=i>>1,u=-7,l=t?a-1:0,d=t?-1:1,f=e[r+l];for(l+=d,_=f&(1<<-u)-1,f>>=-u,u+=o;u>0;_=256*_+e[r+l],l+=d,u-=8);for(s=_&(1<<-u)-1,_>>=-u,u+=n;u>0;s=256*s+e[r+l],l+=d,u-=8);if(0===_)_=1-c;else{if(_===i)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),_-=c}return(f?-1:1)*s*Math.pow(2,_-n)},r.write=function(e,r,t,n,a,_){var s,o,i,c=8*_-a-1,u=(1<<c)-1,l=u>>1,d=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:_-1,g=n?1:-1,p=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(o=isNaN(r)?1:0,s=u):(s=Math.floor(Math.log(r)/Math.LN2),r*(i=Math.pow(2,-s))<1&&(s--,i*=2),(r+=s+l>=1?d/i:d*Math.pow(2,1-l))*i>=2&&(s++,i/=2),s+l>=u?(o=0,s=u):s+l>=1?(o=(r*i-1)*Math.pow(2,a),s+=l):(o=r*Math.pow(2,l-1)*Math.pow(2,a),s=0));a>=8;e[t+f]=255&o,f+=g,o/=256,a-=8);for(s=s<<a|o,c+=a;c>0;e[t+f]=255&s,f+=g,s/=256,c-=8);e[t+f-g]|=128*p}},function(e,r){var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){var __awaiter=this&&this.__awaiter||function(e,r,t,n){return new(t||(t=Promise))((function(a,_){function s(e){try{i(n.next(e))}catch(e){_(e)}}function o(e){try{i(n.throw(e))}catch(e){_(e)}}function i(e){var r;e.done?a(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(s,o)}i((n=n.apply(e,r||[])).next())}))},__generator=this&&this.__generator||function(e,r){var t,n,a,_,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return _={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(_[Symbol.iterator]=function(){return this}),_;function o(_){return function(o){return function(_){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(a=2&_[0]?n.return:_[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,_[1])).done)return a;switch(n=0,a&&(_=[2&_[0],a.value]),_[0]){case 0:case 1:a=_;break;case 4:return s.label++,{value:_[1],done:!1};case 5:s.label++,n=_[1],_=[0];continue;case 7:_=s.ops.pop(),s.trys.pop();continue;default:if(!(a=s.trys,(a=a.length>0&&a[a.length-1])||6!==_[0]&&2!==_[0])){s=0;continue}if(3===_[0]&&(!a||_[1]>a[0]&&_[1]<a[3])){s.label=_[1];break}if(6===_[0]&&s.label<a[1]){s.label=a[1],a=_;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(_);break}a[2]&&s.ops.pop(),s.trys.pop();continue}_=r.call(e,s)}catch(e){_=[6,e],n=0}finally{t=a=0}if(5&_[0])throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}([_,o])}}};Object.defineProperty(exports,"__esModule",{value:!0});var constants_1=__webpack_require__(3),_afterPluginsLoaded_1=__webpack_require__(0),_extractMeaningfulErrorMessage_1=__webpack_require__(1),_generateCadesFn_1=__webpack_require__(2),_getCadesCert_1=__webpack_require__(4),_getDateObj_1=__webpack_require__(5);exports.addAttachedSignature=_afterPluginsLoaded_1._afterPluginsLoaded((function(thumbprint,signedMessage){return __awaiter(void 0,void 0,void 0,(function(){var cadesplugin,cadesCertificate;return __generator(this,(function(_a){switch(_a.label){case 0:return cadesplugin=window.cadesplugin,[4,_getCadesCert_1._getCadesCert(thumbprint)];case 1:return cadesCertificate=_a.sent(),[2,eval(_generateCadesFn_1._generateCadesFn((function(){var e,r,t;try{e=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CADESCOM.CPAttribute"),r=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.CadesSignedData"),t=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.CPSigner")}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при инициализации подписи")}var n,a,_,s=_getDateObj_1._getDateObj(new Date);try{_generateCadesFn_1.__cadesAsyncToken__,e.propset_Name(constants_1.CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME),_generateCadesFn_1.__cadesAsyncToken__,e.propset_Value(s)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при установке времени подписи")}try{n=Buffer.from(signedMessage).toString("base64")}catch(e){throw console.error(e),new Error("Ошибка при преобразовании сообщения в Base64")}try{_generateCadesFn_1.__cadesAsyncToken__,t.propset_Certificate(cadesCertificate),a=_generateCadesFn_1.__cadesAsyncToken__+t.AuthenticatedAttributes2,_generateCadesFn_1.__cadesAsyncToken__,a.Add(e),_generateCadesFn_1.__cadesAsyncToken__,r.propset_ContentEncoding(cadesplugin.CADESCOM_BASE64_TO_BINARY),_generateCadesFn_1.__cadesAsyncToken__,r.propset_Content(n),_generateCadesFn_1.__cadesAsyncToken__,t.propset_Options(cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при указании данных для подписи")}try{_generateCadesFn_1.__cadesAsyncToken__,r.VerifyCades(signedMessage,cadesplugin.CADESCOM_PKCS7_TYPE),_=_generateCadesFn_1.__cadesAsyncToken__+r.CoSignCades(t,cadesplugin.CADESCOM_PKCS7_TYPE)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при подписании данных")}return _})))]}}))}))}))}).call(this,__webpack_require__(7).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){var __awaiter=this&&this.__awaiter||function(e,r,t,n){return new(t||(t=Promise))((function(a,_){function s(e){try{i(n.next(e))}catch(e){_(e)}}function o(e){try{i(n.throw(e))}catch(e){_(e)}}function i(e){var r;e.done?a(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(s,o)}i((n=n.apply(e,r||[])).next())}))},__generator=this&&this.__generator||function(e,r){var t,n,a,_,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return _={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(_[Symbol.iterator]=function(){return this}),_;function o(_){return function(o){return function(_){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(a=2&_[0]?n.return:_[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,_[1])).done)return a;switch(n=0,a&&(_=[2&_[0],a.value]),_[0]){case 0:case 1:a=_;break;case 4:return s.label++,{value:_[1],done:!1};case 5:s.label++,n=_[1],_=[0];continue;case 7:_=s.ops.pop(),s.trys.pop();continue;default:if(!(a=s.trys,(a=a.length>0&&a[a.length-1])||6!==_[0]&&2!==_[0])){s=0;continue}if(3===_[0]&&(!a||_[1]>a[0]&&_[1]<a[3])){s.label=_[1];break}if(6===_[0]&&s.label<a[1]){s.label=a[1],a=_;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(_);break}a[2]&&s.ops.pop(),s.trys.pop();continue}_=r.call(e,s)}catch(e){_=[6,e],n=0}finally{t=a=0}if(5&_[0])throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}([_,o])}}};Object.defineProperty(exports,"__esModule",{value:!0});var _afterPluginsLoaded_1=__webpack_require__(0),_extractMeaningfulErrorMessage_1=__webpack_require__(1),_generateCadesFn_1=__webpack_require__(2);exports.createHash=_afterPluginsLoaded_1._afterPluginsLoaded((function(unencryptedMessage){return __awaiter(void 0,void 0,void 0,(function(){var cadesplugin;return __generator(this,(function(_a){return cadesplugin=window.cadesplugin,[2,eval(_generateCadesFn_1._generateCadesFn((function(){var e,r,t=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.HashedData");try{e=Buffer.from(unencryptedMessage).toString("base64")}catch(e){throw console.error(e),new Error("Ошибка при преобразовании сообщения в Base64")}try{_generateCadesFn_1.__cadesAsyncToken__,t.propset_Algorithm(cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256),_generateCadesFn_1.__cadesAsyncToken__,t.propset_DataEncoding(cadesplugin.CADESCOM_BASE64_TO_BINARY),_generateCadesFn_1.__cadesAsyncToken__,t.Hash(e)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при инициализации хэширования")}try{r=_generateCadesFn_1.__cadesAsyncToken__+t.Value}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при создании хэша")}return r})))]}))}))}))}).call(this,__webpack_require__(7).Buffer)},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _afterPluginsLoaded_1=__webpack_require__(0),_extractMeaningfulErrorMessage_1=__webpack_require__(1),_generateCadesFn_1=__webpack_require__(2);exports.getCspVersion=_afterPluginsLoaded_1._afterPluginsLoaded((function(){var cspVersion=null;return eval(_generateCadesFn_1._generateCadesFn((function(){var e;try{e=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.About"),cspVersion=_generateCadesFn_1.__cadesAsyncToken__+e.CSPVersion(),cspVersion=_generateCadesFn_1.__cadesAsyncToken__+cspVersion.toString()}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при получении версии системы")}return cspVersion})))}))},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _afterPluginsLoaded_1=__webpack_require__(0),_generateCadesFn_1=__webpack_require__(2),_extractMeaningfulErrorMessage_1=__webpack_require__(1);exports.getPluginVersion=_afterPluginsLoaded_1._afterPluginsLoaded((function(){var cadesVersion=null;return eval(_generateCadesFn_1._generateCadesFn((function(){var e;try{e=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.About"),(cadesVersion=_generateCadesFn_1.__cadesAsyncToken__+e.PluginVersion)||(cadesVersion=_generateCadesFn_1.__cadesAsyncToken__+e.Version),cadesVersion=_generateCadesFn_1.__cadesAsyncToken__+cadesVersion.toString()}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при получении информации о плагине")}return cadesVersion})))}))}])}));
|
||
//# sourceMappingURL=crypto-pro-js.min.js.map
|