mirror of
https://github.com/crypto-pro-web/crypto-pro-js.git
synced 2024-11-27 12:56:00 +03:00
9 lines
98 KiB
JavaScript
9 lines
98 KiB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("cryptoPro",[],t):"object"==typeof exports?exports.cryptoPro=t():e.cryptoPro=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=11)}([function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,o){function i(e){try{s(n.next(e))}catch(e){o(e)}}function _(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,_)}s((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:_(0),throw:_(1),return:_(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function _(o){return function(_){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,n=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],n=0}finally{r=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,_])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(1),i=!1,_=!1;t._afterPluginsLoaded=function(e){var t=Boolean(window.Promise);return function(){for(var s=[],c=0;c<arguments.length;c++)s[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(!_){try{r(14)}catch(e){throw console.error(e),new Error(o._extractMeaningfulErrorMessage(e)||"Ошибка при подключении модуля для работы с Cades plugin")}_=!0}if(n=window.cadesplugin,!t)throw new Error("Необходим полифилл для Promise");if(!n)throw new Error("Не подключен модуль для работы с Cades plugin");i||(n.set_log_level(n.LOG_LEVEL_ERROR),i=!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(o._extractMeaningfulErrorMessage(c)||"Ошибка при инициализации модуля для работы с Cades plugin");case 4:return[4,e.apply(this,s)];case 5:return[2,a.sent()]}}))}))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._extractMeaningfulErrorMessage=function(e){var t,r=(null===(t=window.cadesplugin)||void 0===t?void 0:t.getLastError)&&window.cadesplugin.getLastError(e);if(!(null==r?void 0:r.message)){if(!e.message)return null;r=e}if(!/[а-яА-Я]/.test(r.message))return null;var n=r.message.match(/^(.*?)(?:(?:\.?\s?\(?0x)|(?:\.?$))/);return n?n[1]:null}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.__cadesAsyncToken__={},t.__createCadesPluginObject__=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{}},t._generateCadesFn=function(e){var t,r=window.cadesplugin,n=Boolean(r.CreateObjectAsync),a=e.name||"dynamicFn",o=String(e),i=(null===(t=o.match(/^function[\s\w]*?\((.*?)\)/))||void 0===t?void 0:t[1])||"",_=o.replace(/^.*?{([\s\S]*?)}$/,"$1"),s=String(new(n?new Function("","return Object.getPrototypeOf(function*(){}).constructor")():Function)(i,_));return s=(s=s.replace(/\w+?\.__createCadesPluginObject__(\([\s\S]*?\))/gm,"cadesplugin.CreateObject"+(n?"Async":"")+"$1")).replace(/\w+?\.__cadesAsyncToken__\s*?\+\s*?\b/gm,n?"yield ":""),n||(s=s.replace(/propset_(.*?)\((.*?)\)/gm,"$1 = $2")),[n?"cadesplugin.async_spawn("+s+");":"("+s+")();","//# sourceURL=crypto-pro_"+a+".js"].join("")}},function(e,t,r){"use strict";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),n(r(16)),n(r(17)),n(r(18)),n(r(19))},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,t,r,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{t=_generateCadesFn_1.__cadesAsyncToken__+e.Certificates,r=_generateCadesFn_1.__cadesAsyncToken__+t.Count}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка получения списка сертификатов")}if(!r)throw new Error("Нет доступных сертификатов");try{if(t=_generateCadesFn_1.__cadesAsyncToken__+t.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_SHA1_HASH,thumbprint),!(_generateCadesFn_1.__cadesAsyncToken__+t.Count))throw new Error('Сертификат с отпечатком: "'+thumbprint+'" не найден');n=_generateCadesFn_1.__cadesAsyncToken__+t.Item(1)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при получении сертификата")}return e.Close(),n})))}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._getDateObj=function(e){return e.getVarDate?e.getVarDate():e}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var certificate_1=__webpack_require__(7),constants_1=__webpack_require__(3),_afterPluginsLoaded_1=__webpack_require__(0),_extractCommonName_1=__webpack_require__(28),_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,t,r;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{(t=_generateCadesFn_1.__cadesAsyncToken__+e.Certificates)&&(t=_generateCadesFn_1.__cadesAsyncToken__+t.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_VALID),t=_generateCadesFn_1.__cadesAsyncToken__+t.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY,constants_1.CAPICOM_PROPID_KEY_PROV_INFO),r=_generateCadesFn_1.__cadesAsyncToken__+t.Count)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка получения списка сертификатов")}if(!r)throw new Error("Нет доступных сертификатов");var n=[];try{for(;r;){var a=_generateCadesFn_1.__cadesAsyncToken__+t.Item(r);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)),r--}}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка обработки сертификатов")}return e.Close(),certificatesCache=n})))}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(15))},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(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,t,r){"use strict";(function(e){
|
||
/*!
|
||
* The buffer module from node.js, for the browser.
|
||
*
|
||
* @author Feross Aboukhadijeh <http://feross.org>
|
||
* @license MIT
|
||
*/
|
||
var n=r(36),a=r(37),o=r(38);function i(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function _(e,t){if(i()<t)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=s.prototype:(null===e&&(e=new s(t)),e.length=t),e}function s(e,t,r){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return c(this,e,t,r)}function c(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);s.TYPED_ARRAY_SUPPORT?(e=t).__proto__=s.prototype:e=d(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!s.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(t,r),a=(e=_(e,n)).write(t,r);a!==n&&(e=e.slice(0,a));return e}(e,t,r):function(e,t){if(s.isBuffer(t)){var r=0|f(t.length);return 0===(e=_(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?_(e,0):d(e,t);if("Buffer"===t.type&&o(t.data))return d(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}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,t){if(u(t),e=_(e,t<0?0:0|f(t)),!s.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function d(e,t){var r=t.length<0?0:0|f(t.length);e=_(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function f(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function p(e,t){if(s.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 r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(n)return B(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return v(this,t,r);case"utf8":case"utf-8":return S(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return P(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function C(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function E(e,t,r,n,a){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=a?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(a)return-1;r=e.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof t&&(t=s.from(t,n)),s.isBuffer(t))return 0===t.length?-1:h(e,t,r,n,a);if("number"==typeof t)return t&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):h(e,[t],r,n,a);throw new TypeError("val must be string, number or Buffer")}function h(e,t,r,n,a){var o,i=1,_=e.length,s=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;i=2,_/=2,s/=2,r/=2}function c(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(a){var u=-1;for(o=r;o<_;o++)if(c(e,o)===c(t,-1===u?0:o-u)){if(-1===u&&(u=o),o-u+1===s)return u*i}else-1!==u&&(o-=o-u),u=-1}else for(r+s>_&&(r=_-s),o=r;o>=0;o--){for(var l=!0,d=0;d<s;d++)if(c(e,o+d)!==c(t,d)){l=!1;break}if(l)return o}return-1}function A(e,t,r,n){r=Number(r)||0;var a=e.length-r;n?(n=Number(n))>a&&(n=a):n=a;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var i=0;i<n;++i){var _=parseInt(t.substr(2*i,2),16);if(isNaN(_))return i;e[r+i]=_}return i}function O(e,t,r,n){return j(B(t,e.length-r),e,r,n)}function T(e,t,r,n){return j(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function I(e,t,r,n){return T(e,t,r,n)}function y(e,t,r,n){return j(G(t),e,r,n)}function M(e,t,r,n){return j(function(e,t){for(var r,n,a,o=[],i=0;i<e.length&&!((t-=2)<0);++i)r=e.charCodeAt(i),n=r>>8,a=r%256,o.push(a),o.push(n);return o}(t,e.length-r),e,r,n)}function b(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function S(e,t,r){r=Math.min(e.length,r);for(var n=[],a=t;a<r;){var o,i,_,s,c=e[a],u=null,l=c>239?4:c>223?3:c>191?2:1;if(a+l<=r)switch(l){case 1:c<128&&(u=c);break;case 2:128==(192&(o=e[a+1]))&&(s=(31&c)<<6|63&o)>127&&(u=s);break;case 3:o=e[a+1],i=e[a+2],128==(192&o)&&128==(192&i)&&(s=(15&c)<<12|(63&o)<<6|63&i)>2047&&(s<55296||s>57343)&&(u=s);break;case 4:o=e[a+1],i=e[a+2],_=e[a+3],128==(192&o)&&128==(192&i)&&128==(192&_)&&(s=(15&c)<<18|(63&o)<<12|(63&i)<<6|63&_)>65535&&s<1114112&&(u=s)}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 t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}t.Buffer=s,t.SlowBuffer=function(e){+e!=e&&(e=0);return s.alloc(+e)},t.INSPECT_MAX_BYTES=50,s.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}}(),t.kMaxLength=i(),s.poolSize=8192,s._augment=function(e){return e.__proto__=s.prototype,e},s.from=function(e,t,r){return c(null,e,t,r)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(e,t,r){return function(e,t,r,n){return u(t),t<=0?_(e,t):void 0!==r?"string"==typeof n?_(e,t).fill(r,n):_(e,t).fill(r):_(e,t)}(null,e,t,r)},s.allocUnsafe=function(e){return l(null,e)},s.allocUnsafeSlow=function(e){return l(null,e)},s.isBuffer=function(e){return!(null==e||!e._isBuffer)},s.compare=function(e,t){if(!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,a=0,o=Math.min(r,n);a<o;++a)if(e[a]!==t[a]){r=e[a],n=t[a];break}return r<n?-1:n<r?1:0},s.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}},s.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=s.allocUnsafe(t),a=0;for(r=0;r<e.length;++r){var i=e[r];if(!s.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,a),a+=i.length}return n},s.byteLength=p,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)C(this,t,t+1);return this},s.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 t=0;t<e;t+=4)C(this,t,t+3),C(this,t+1,t+2);return this},s.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 t=0;t<e;t+=8)C(this,t,t+7),C(this,t+1,t+6),C(this,t+2,t+5),C(this,t+3,t+4);return this},s.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?S(this,0,e):g.apply(this,arguments)},s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},s.prototype.compare=function(e,t,r,n,a){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),t<0||r>e.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&t>=r)return 0;if(n>=a)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(a>>>=0)-(n>>>=0),i=(r>>>=0)-(t>>>=0),_=Math.min(o,i),c=this.slice(n,a),u=e.slice(t,r),l=0;l<_;++l)if(c[l]!==u[l]){o=c[l],i=u[l];break}return o<i?-1:i<o?1:0},s.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},s.prototype.indexOf=function(e,t,r){return E(this,e,t,r,!0)},s.prototype.lastIndexOf=function(e,t,r){return E(this,e,t,r,!1)},s.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var a=this.length-t;if((void 0===r||r>a)&&(r=a),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return A(this,e,t,r);case"utf8":case"utf-8":return O(this,e,t,r);case"ascii":return T(this,e,t,r);case"latin1":case"binary":return I(this,e,t,r);case"base64":return y(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function w(e,t,r){var n="";r=Math.min(e.length,r);for(var a=t;a<r;++a)n+=String.fromCharCode(127&e[a]);return n}function P(e,t,r){var n="";r=Math.min(e.length,r);for(var a=t;a<r;++a)n+=String.fromCharCode(e[a]);return n}function v(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var a="",o=t;o<r;++o)a+=H(e[o]);return a}function R(e,t,r){for(var n=e.slice(t,r),a="",o=0;o<n.length;o+=2)a+=String.fromCharCode(n[o]+256*n[o+1]);return a}function m(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,a,o){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function D(e,t,r,n){t<0&&(t=65535+t+1);for(var a=0,o=Math.min(e.length-r,2);a<o;++a)e[r+a]=(t&255<<8*(n?a:1-a))>>>8*(n?a:1-a)}function L(e,t,r,n){t<0&&(t=4294967295+t+1);for(var a=0,o=Math.min(e.length-r,4);a<o;++a)e[r+a]=t>>>8*(n?a:3-a)&255}function x(e,t,r,n,a,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(e,t,r,n,o){return o||x(e,0,r,4),a.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,o){return o||x(e,0,r,8),a.write(e,t,r,n,52,8),r+8}s.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),s.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=s.prototype;else{var a=t-e;r=new s(a,void 0);for(var o=0;o<a;++o)r[o]=this[o+e]}return r},s.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||m(e,t,this.length);for(var n=this[e],a=1,o=0;++o<t&&(a*=256);)n+=this[e+o]*a;return n},s.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||m(e,t,this.length);for(var n=this[e+--t],a=1;t>0&&(a*=256);)n+=this[e+--t]*a;return n},s.prototype.readUInt8=function(e,t){return t||m(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return t||m(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return t||m(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return t||m(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return t||m(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||m(e,t,this.length);for(var n=this[e],a=1,o=0;++o<t&&(a*=256);)n+=this[e+o]*a;return n>=(a*=128)&&(n-=Math.pow(2,8*t)),n},s.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||m(e,t,this.length);for(var n=t,a=1,o=this[e+--n];n>0&&(a*=256);)o+=this[e+--n]*a;return o>=(a*=128)&&(o-=Math.pow(2,8*t)),o},s.prototype.readInt8=function(e,t){return t||m(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){t||m(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(e,t){t||m(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(e,t){return t||m(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return t||m(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return t||m(e,4,this.length),a.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return t||m(e,4,this.length),a.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return t||m(e,8,this.length),a.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return t||m(e,8,this.length),a.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||N(this,e,t,r,Math.pow(2,8*r)-1,0);var a=1,o=0;for(this[t]=255&e;++o<r&&(a*=256);)this[t+o]=e/a&255;return t+r},s.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||N(this,e,t,r,Math.pow(2,8*r)-1,0);var a=r-1,o=1;for(this[t+a]=255&e;--a>=0&&(o*=256);)this[t+a]=e/o&255;return t+r},s.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,255,0),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},s.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},s.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):L(this,e,t,!0),t+4},s.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},s.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var a=Math.pow(2,8*r-1);N(this,e,t,r,a-1,-a)}var o=0,i=1,_=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===_&&0!==this[t+o-1]&&(_=1),this[t+o]=(e/i>>0)-_&255;return t+r},s.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var a=Math.pow(2,8*r-1);N(this,e,t,r,a-1,-a)}var o=r-1,i=1,_=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===_&&0!==this[t+o+1]&&(_=1),this[t+o]=(e/i>>0)-_&255;return t+r},s.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,127,-128),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},s.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},s.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):L(this,e,t,!0),t+4},s.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},s.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},s.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},s.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},s.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},s.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=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-t<n-r&&(n=e.length-t+r);var a,o=n-r;if(this===e&&r<t&&t<n)for(a=o-1;a>=0;--a)e[a+t]=this[a+r];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)e[a+t]=this[a+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},s.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=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&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var i=s.isBuffer(e)?e:B(new s(e,n).toString()),_=i.length;for(o=0;o<r-t;++o)this[o+t]=i[o%_]}return this};var k=/[^+\/0-9A-Za-z-_]/g;function H(e){return e<16?"0"+e.toString(16):e.toString(16)}function B(e,t){var r;t=t||1/0;for(var n=e.length,a=null,o=[],i=0;i<n;++i){if((r=e.charCodeAt(i))>55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(i+1===n){(t-=3)>-1&&o.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(t-=3)>-1&&o.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(k,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,r,n){for(var a=0;a<n&&!(a+r>=t.length||a>=e.length);++a)t[a+r]=e[a];return a}}).call(this,r(35))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(12))},function(e,t,r){"use strict";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),n(r(13)),n(r(6)),n(r(9)),n(r(29)),n(r(32)),n(r(33)),n(r(34)),n(r(39)),n(r(7))},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,o){function i(e){try{s(n.next(e))}catch(e){o(e)}}function _(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,_)}s((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:_(0),throw:_(1),return:_(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function _(o){return function(_){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,n=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],n=0}finally{r=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,_])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),i=r(6);t.getCertificate=o._afterPluginsLoaded((function(e){return n(void 0,void 0,void 0,(function(){var t,r;return a(this,(function(n){switch(n.label){case 0:if(!e)throw new Error("Отпечаток не указан");return[4,i.getUserCertificates()];case 1:if(t=n.sent(),!(r=t.find((function(t){return t.thumbprint===e}))))throw new Error('Сертификат с отпечатком: "'+e+'" не найден');return[2,r]}}))}))}))},function(module,exports){!function(){if(!window.cadesplugin){var pluginObject,plugin_resolved=0,plugin_reject,plugin_resolve,isOpera=0,isFireFox=0,isEdge=0,isSafari=0,failed_extensions=0,canPromise=!!window.Promise,cadesplugin;cadesplugin=canPromise?new Promise((function(e,t){plugin_resolve=e,plugin_reject=t})):{};var browserSpecs=check_browser(),ru_cryptopro_npcades_10_native_bridge={callbacksCount:1,callbacks:{},resultForCallback:function(e,t){var r=ru_cryptopro_npcades_10_native_bridge.callbacks[e];r&&r.apply(null,t)},call:function(e,t,r){var n=r&&"function"==typeof r,a=n?ru_cryptopro_npcades_10_native_bridge.callbacksCount++:0;n&&(ru_cryptopro_npcades_10_native_bridge.callbacks[a]=r);var o=document.createElement("IFRAME"),i=new Array("_CPNP_handle");try{o.setAttribute("src","cpnp-js-call:"+e+":"+a+":"+encodeURIComponent(JSON.stringify(t,i)))}catch(e){alert(e)}document.documentElement.appendChild(o),o.parentNode.removeChild(o),o=null}};cadesplugin.JSModuleVersion="2.1.2",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,t=navigator.userAgent,r=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(r[1])?{name:"IE",version:(e=/\brv[ :]+(\d+)/g.exec(t)||[])[1]||""}:"Chrome"===r[1]&&null!=(e=t.match(/\b(OPR|Edge)\/(\d+)/))?{name:e[1].replace("OPR","Opera"),version:e[2]}:(r=r[2]?[r[1],r[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(e=t.match(/version\/(\d+)/i))&&r.splice(1,1,e[1]),{name:r[0],version:r[1]})}function cpcsp_console_log(e,t){if("undefined"!=typeof console)return e<=cadesplugin.current_log_level?(e===cadesplugin.LOG_LEVEL_DEBUG&&console.log("DEBUG: %s",t),e===cadesplugin.LOG_LEVEL_INFO&&console.info("INFO: %s",t),void(e===cadesplugin.LOG_LEVEL_ERROR&&console.error("ERROR: %s",t))):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_LOCAL_MACHINE_STORE=1,cadesplugin.CAPICOM_CURRENT_USER_STORE=2,cadesplugin.CADESCOM_LOCAL_MACHINE_STORE=1,cadesplugin.CADESCOM_CURRENT_USER_STORE=2,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.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.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_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}function async_spawn(e){function t(e,t){var o;try{o=r[e](t)}catch(e){return Promise.reject(e)}return o.done?o.value:Promise.resolve(o.value).then(n,a)}var r=e(Array.prototype.slice.call(arguments,1)),n=t.bind(t,"next"),a=t.bind(t,"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()&&("Edge"===browserSpecs.name?(isEdge=!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(t){try{return document.getElementById("certEnrollClassFactory").CreateObject(e)}catch(e){throw"Для создания обьектов X509Enrollment следует настроить веб-узел на использование проверки подлинности по протоколу HTTPS"}}try{return document.getElementById("webClassFactory").CreateObject(e)}catch(t){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 t=e.message;return t?e.number&&(t+=" (0x"+decimalToHexString(e.number)+")"):t=e,t}function getLastError(e){if(isNativeMessageSupported()||isIE()||isIOS())return GetMessageFromException(e);try{return pluginObject.getLastError()}catch(t){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 install_opera_extension(){window.cadesplugin_skip_extension_install?plugin_loaded_error("Плагин недоступен"):document.addEventListener("DOMContentLoaded",(function(){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 на данном сайте необходимо установить расширение из каталога дополнений Opera.<p><button id='cadesplugin_install' style='font:12px Arial'>Установить расширение</button></p></div>",document.getElementsByTagName("Body")[0].appendChild(e),document.getElementById("cadesplugin_install").addEventListener("click",(function(e){opr.addons.installExtension("epebfcehmdedogndhlcacafjaacknbcm",(function(){document.getElementById("cadesplugin_ovr").style.visibility="hidden",location.reload()}),(function(){}))})),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",document.getElementById("cadesplugin_ovr_item").addEventListener("click",(function(e){e.stopPropagation()}))}))}function firefox_or_edge_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"))if(isFireFox||isEdge||isSafari){var t=e.data.substring(e.data.indexOf("url:")+4),r=document.createElement("script");r.setAttribute("type","text/javascript"),r.setAttribute("src",t),r.onerror=plugin_loaded_error,r.onload=firefox_or_edge_nmcades_onload,document.getElementsByTagName("head")[0].appendChild(r),failed_extensions++}else cpcsp_chrome_nmcades.check_chrome_plugin(plugin_loaded,plugin_loaded_error)}),!1)}function load_extension(){if(isFireFox||isEdge||isSafari)nmcades_api_onload();else{var e=document.createElement("script");e.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),(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)}}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 t=document.createElement("object");t.setAttribute("id","certEnrollClassFactory"),t.setAttribute("classid","clsid:884e2049-217d-11da-b2a4-000e7bbb2b09"),t.setAttribute("style","visibility: hidden"),document.getElementsByTagName("body")[0].appendChild(t);var r=document.createElement("object");r.setAttribute("id","webClassFactory"),r.setAttribute("classid","clsid:B04C8637-10BD-484E-B0DA-B8A039F60024"),r.setAttribute("style","visibility: hidden"),document.getElementsByTagName("body")[0].appendChild(r)}}function plugin_loaded(){plugin_resolved=1,canPromise?plugin_resolve():window.postMessage("cadesplugin_loaded","*")}function plugin_loaded_error(e){if(isNativeMessageSupported()){if(++failed_extensions<2)return;if(isOpera&&(void 0===e||"object"==typeof e))return void install_opera_extension()}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(t){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,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3),a=r(20),o=r(21),i=r(8),_=r(22),s=r(23),c=r(24),u=r(26),l=r(27),d=function(){function e(e,t,r,n,a,o,i){this._cadesCertificate=e,this.name=t,this.issuerName=r,this.subjectName=n,this.thumbprint=a,this.validFrom=o,this.validTo=i}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 s.getExtendedKeyUsage.call(this)},e.prototype.getDecodedExtendedKeyUsage=function(){return _.getDecodedExtendedKeyUsage.call(this)},e.prototype.getAlgorithm=function(){return o.getAlgorithm.call(this)},e.prototype.getCadesProp=function(e){return i.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}();t.Certificate=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CADESCOM_ATTRIBUTE_OTHER=-1,t.CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION=2,t.CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME=1,t.CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME=0,t.CADESCOM_AllowNoOutstandingRequest=1,t.CADESCOM_AllowNone=0,t.CADESCOM_AllowUntrustedCertificate=2,t.CADESCOM_AllowUntrustedRoot=4,t.CADESCOM_BASE64_TO_BINARY=1,t.CADESCOM_CADES_BES=1,t.CADESCOM_CADES_DEFAULT=0,t.CADESCOM_CADES_T=5,t.CADESCOM_CADES_X_LONG_TYPE_1=93,t.CADESCOM_CONTAINER_STORE=100,t.CADESCOM_CURRENT_USER_STORE=2,t.CADESCOM_DISPLAY_DATA_ATTRIBUTE=2,t.CADESCOM_DISPLAY_DATA_CONTENT=1,t.CADESCOM_DISPLAY_DATA_NONE=0,t.CADESCOM_ENCODE_ANY=-1,t.CADESCOM_ENCODE_BASE64=0,t.CADESCOM_ENCODE_BINARY=1,t.CADESCOM_ENCRYPTION_ALGORITHM_3DES=3,t.CADESCOM_ENCRYPTION_ALGORITHM_AES=4,t.CADESCOM_ENCRYPTION_ALGORITHM_DES=2,t.CADESCOM_ENCRYPTION_ALGORITHM_GOST_28147_89=25,t.CADESCOM_ENCRYPTION_ALGORITHM_RC2=0,t.CADESCOM_ENCRYPTION_ALGORITHM_RC4=1,t.CADESCOM_HASH_ALGORITHM_CP_GOST_3411=100,t.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256=101,t.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256_HMAC=111,t.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512=102,t.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512_HMAC=112,t.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_HMAC=110,t.CADESCOM_HASH_ALGORITHM_MD2=1,t.CADESCOM_HASH_ALGORITHM_MD4=2,t.CADESCOM_HASH_ALGORITHM_MD5=3,t.CADESCOM_HASH_ALGORITHM_SHA1=0,t.CADESCOM_HASH_ALGORITHM_SHA_256=4,t.CADESCOM_HASH_ALGORITHM_SHA_384=5,t.CADESCOM_HASH_ALGORITHM_SHA_512=6,t.CADESCOM_LOCAL_MACHINE_STORE=1,t.CADESCOM_PKCS7_TYPE=65535,t.CADESCOM_STRING_TO_UCS2LE=0,t.CADESCOM_SkipInstallToStore=268435456,t.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED=0,t.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING=1,t.CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE=2,t.CAPICOM_ACTIVE_DIRECTORY_USER_STORE=3,t.CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION=2,t.CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME=1,t.CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME=0,t.CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY=7,t.CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY=8,t.CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY=6,t.CAPICOM_CERTIFICATE_FIND_EXTENSION=5,t.CAPICOM_CERTIFICATE_FIND_ISSUER_NAME=2,t.CAPICOM_CERTIFICATE_FIND_KEY_USAGE=12,t.CAPICOM_CERTIFICATE_FIND_ROOT_NAME=3,t.CAPICOM_CERTIFICATE_FIND_SHA1_HASH=0,t.CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME=1,t.CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME=4,t.CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED=11,t.CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID=10,t.CAPICOM_CERTIFICATE_FIND_TIME_VALID=9,t.CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT=0,t.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY=2,t.CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN=1,t.CAPICOM_CERT_INFO_ISSUER_SIMPLE_NAME=1,t.CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME=0,t.CAPICOM_CURRENT_USER_STORE=2,t.CAPICOM_DIGITAL_SIGNATURE_KEY_USAGE=128,t.CAPICOM_EKU_CLIENT_AUTH=2,t.CAPICOM_EKU_OTHER=0,t.CAPICOM_EKU_SMARTCARD_LOGON=5,t.CAPICOM_LOCAL_MACHINE_STORE=1,t.CAPICOM_MEMORY_STORE=0,t.CAPICOM_MY_STORE="My",t.CAPICOM_OID_KEY_USAGE_EXTENSION=10,t.CAPICOM_OID_OTHER=0,t.CAPICOM_PROPID_ACCESS_STATE=14,t.CAPICOM_PROPID_ARCHIVED=19,t.CAPICOM_PROPID_ARCHIVED_KEY_HASH=65,t.CAPICOM_PROPID_AUTO_ENROLL=21,t.CAPICOM_PROPID_CROSS_CERT_DIST_POINTS=23,t.CAPICOM_PROPID_CTL_USAGE=9,t.CAPICOM_PROPID_DATE_STAMP=27,t.CAPICOM_PROPID_DESCRIPTION=13,t.CAPICOM_PROPID_EFS=17,t.CAPICOM_PROPID_ENHKEY_USAGE=9,t.CAPICOM_PROPID_ENROLLMENT=26,t.CAPICOM_PROPID_EXTENDED_ERROR_INFO=30,t.CAPICOM_PROPID_FIRST_RESERVED=66,t.CAPICOM_PROPID_FIRST_USER=32768,t.CAPICOM_PROPID_FORTEZZA_DATA=18,t.CAPICOM_PROPID_FRIENDLY_NAME=11,t.CAPICOM_PROPID_HASH_PROP=3,t.CAPICOM_PROPID_IE30_RESERVED=7,t.CAPICOM_PROPID_ISSUER_PUBLIC_KEY_MD5_HASH=24,t.CAPICOM_PROPID_ISSUER_SERIAL_NUMBER_MD5_HASH=28,t.CAPICOM_PROPID_KEY_CONTEXT=5,t.CAPICOM_PROPID_KEY_IDENTIFIER=20,t.CAPICOM_PROPID_KEY_PROV_HANDLE=1,t.CAPICOM_PROPID_KEY_PROV_INFO=2,t.CAPICOM_PROPID_KEY_SPEC=6,t.CAPICOM_PROPID_LAST_RESERVED=32767,t.CAPICOM_PROPID_LAST_USER=65535,t.CAPICOM_PROPID_MD5_HASH=4,t.CAPICOM_PROPID_NEXT_UPDATE_LOCATION=10,t.CAPICOM_PROPID_PUBKEY_ALG_PARA=22,t.CAPICOM_PROPID_PUBKEY_HASH_RESERVED=8,t.CAPICOM_PROPID_PVK_FILE=12,t.CAPICOM_PROPID_RENEWAL=64,t.CAPICOM_PROPID_SHA1_HASH=3,t.CAPICOM_PROPID_SIGNATURE_HASH=15,t.CAPICOM_PROPID_SMART_CARD_DATA=16,t.CAPICOM_PROPID_SUBJECT_NAME_MD5_HASH=29,t.CAPICOM_PROPID_SUBJECT_PUBLIC_KEY_MD5_HASH=25,t.CAPICOM_PROPID_UNKNOWN=0,t.CAPICOM_SMART_CARD_USER_STORE=4,t.CAPICOM_STORE_OPEN_EXISTING_ONLY=128,t.CAPICOM_STORE_OPEN_INCLUDE_ARCHIVED=256,t.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED=2,t.CAPICOM_STORE_OPEN_READ_ONLY=0,t.CAPICOM_STORE_OPEN_READ_WRITE=1,t.CHECK_NONE=0,t.CHECK_OFFLINE_REVOCATION_STATUS=16,t.CHECK_ONLINE_REVOCATION_STATUS=8,t.CHECK_SIGNATURE_VALIDITY=4,t.CHECK_TIME_VALIDITY=2,t.CHECK_TRUSTED_ROOT=1,t.LOG_LEVEL_DEBUG=4,t.LOG_LEVEL_ERROR=1,t.LOG_LEVEL_INFO=2,t.TRUST_CTL_IS_NOT_SIGNATURE_VALID=262144,t.TRUST_CTL_IS_NOT_TIME_VALID=131072,t.TRUST_CTL_IS_NOT_VALID_FOR_USAGE=524288,t.TRUST_IS_CYCLIC=128,t.TRUST_IS_NOT_SIGNATURE_VALID=8,t.TRUST_IS_NOT_TIME_NESTED=2,t.TRUST_IS_NOT_TIME_VALID=1,t.TRUST_IS_NOT_VALID_FOR_USAGE=16,t.TRUST_IS_PARTIAL_CHAIN=65536,t.TRUST_IS_REVOKED=4,t.TRUST_IS_UNTRUSTED_ROOT=32,t.TRUST_REVOCATION_STATUS_UNKNOWN=64,t.XmlDsigGost3410Url="urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102001-gostr3411",t.XmlDsigGost3410UrlObsolete="http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411",t.XmlDsigGost3411Url="urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411",t.XmlDsigGost3411UrlObsolete="http://www.w3.org/2001/04/xmldsig-more#gostr3411"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.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,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.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,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.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,t={algorithm:null,oid:null};try{e=_generateCadesFn_1.__cadesAsyncToken__+cadesCertificate.PublicKey(),e=_generateCadesFn_1.__cadesAsyncToken__+e.Algorithm,t.algorithm=_generateCadesFn_1.__cadesAsyncToken__+e.FriendlyName,t.oid=_generateCadesFn_1.__cadesAsyncToken__+e.Value}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при получении алгоритма")}return t})))}))},function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,o){function i(e){try{s(n.next(e))}catch(e){o(e)}}function _(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,_)}s((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:_(0),throw:_(1),return:_(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function _(o){return function(_){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,n=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],n=0}finally{r=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,_])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(3),_=r(0);t.getDecodedExtendedKeyUsage=_._afterPluginsLoaded((function(){return a(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.getExtendedKeyUsage()];case 1:return[2,e.sent().reduce((function(e,t){var r;return n(n({},e),((r={})[t]=i.OIDS_DICTIONARY[t]||null,r))}),{})]}}))}))}))},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,t=[];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 r=void 0;r=_generateCadesFn_1.__cadesAsyncToken__+cadesCertificate.ExtendedKeyUsage(),r=_generateCadesFn_1.__cadesAsyncToken__+r.EKUs,r=_generateCadesFn_1.__cadesAsyncToken__+r.Item(e),r=_generateCadesFn_1.__cadesAsyncToken__+r.OID,t.push(r),e--}}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при получении ОИД'ов")}return t})))}))},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,o){function i(e){try{s(n.next(e))}catch(e){o(e)}}function _(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,_)}s((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:_(0),throw:_(1),return:_(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function _(o){return function(_){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,n=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],n=0}finally{r=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,_])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),i=r(1),_=r(25),s=r(8);t.getInfo=o._afterPluginsLoaded((function(e,t){return n(this,void 0,void 0,(function(){var r,n;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,s.getCadesProp.call(this,t)];case 1:return r=a.sent(),[3,3];case 2:throw n=a.sent(),console.error(n),new Error(i._extractMeaningfulErrorMessage(n)||"Ошибка при извлечении информации из сертификата");case 3:return[2,_._parseCertInfo(e,r)]}}))}))}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3);t._parseCertInfo=function(e,t){var r=t.match(/([а-яА-Яa-zA-Z0-9\s.]+)=(?:("[^"]+?")|(.+?))(?:,|$)/g);if(r)return r.map((function(t){var r,a,o,i=t.trim().match(/^([а-яА-Яa-zA-Z0-9\s.]+)=(.+?),?$/),_=null==i?void 0:i[1],s=null===(a=null===(r=null==i?void 0:i[2])||void 0===r?void 0:r.replace(/^"(.*)"/,"$1"))||void 0===a?void 0:a.replace(/"{2}/g,'"'),c=null==_?void 0:_.match(/^OID\.(.*)/),u=null==c?void 0:c[1],l=!1;if(u){var d=n.OIDS_DICTIONARY[u];d&&(_=d,l=!0)}var f=null===(o=e.find((function(e){return e.possibleNames.find((function(e){return e===_}))})))||void 0===o?void 0:o.translation;return f&&(_=f,l=!0),{description:s,title:_,isTranslated:l}}))}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,o){function i(e){try{s(n.next(e))}catch(e){o(e)}}function _(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,_)}s((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:_(0),throw:_(1),return:_(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function _(o){return function(_){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,n=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],n=0}finally{r=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,_])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(0);t.hasExtendedKeyUsage=o._afterPluginsLoaded((function(e){return n(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return[4,this.getExtendedKeyUsage()];case 1:return t=r.sent(),[2,Array.isArray(e)?e.every((function(e){return t.some((function(t){return t===e}))})):t.some((function(t){return t===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(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._extractCommonName=function(e){var t;return null===(t=e.match(/CN=(.+?)(?:,|$)/))||void 0===t?void 0:t[1]}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,o){function i(e){try{s(n.next(e))}catch(e){o(e)}}function _(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,_)}s((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:_(0),throw:_(1),return:_(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function _(o){return function(_){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,n=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],n=0}finally{r=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,_])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),i=r(1),_=r(30),s=r(31),c=r(9);t.isValidSystemSetup=o._afterPluginsLoaded((function(){return n(void 0,void 0,void 0,(function(){var e,t;return a(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,c.getSystemInfo()];case 1:return e=r.sent(),[3,3];case 2:throw t=r.sent(),console.error(t),new Error(i._extractMeaningfulErrorMessage(t)||"Настройки ЭП на данной машине не верны");case 3:if(!_._isSupportedCadesVersion(e.cadesVersion))throw new Error("Не поддерживаемая версия плагина");if(!s._isSupportedCSPVersion(e.cspVersion))throw new Error("Не поддерживаемая версия CSP");return[2,!0]}}))}))}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._isSupportedCadesVersion=function(e){var t=e.match(/(\d+)\.(\d+)\.(\d+)/);if(!t)return!1;var r=t[1],n=(t[2],t[3]);return!(Number(r)<2)&&!(2===Number(r)&&Number(n)<12438)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t._isSupportedCSPVersion=function(e){var t;return e=null===(t=e.match(/\d+?\b(?:\.\d+)?/))||void 0===t?void 0:t[0],Number(e)>=4}},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,o){function i(e){try{s(n.next(e))}catch(e){o(e)}}function _(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,_)}s((n=n.apply(e,t||[])).next())}))},__generator=this&&this.__generator||function(e,t){var r,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:_(0),throw:_(1),return:_(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function _(o){return function(_){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,n=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],n=0}finally{r=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[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.createSignature=_afterPluginsLoaded_1._afterPluginsLoaded((function(thumbprint,messageHash,detachedSignature){return void 0===detachedSignature&&(detachedSignature=!0),__awaiter(void 0,void 0,void 0,(function(){var cadesplugin,cadesCertificate;return __generator(this,(function(_a){switch(_a.label){case 0:return console.warn(['cryptoPro: Метод "createSignature" является устаревшим и будет убран из будущих версий.','Используйте "createAttachedSignature" и "createDetachedSignature".'].join("\n")),cadesplugin=window.cadesplugin,[4,_getCadesCert_1._getCadesCert(thumbprint)];case 1:return cadesCertificate=_a.sent(),[2,eval(_generateCadesFn_1._generateCadesFn((function(){var e,t,r;try{e=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CADESCOM.CPAttribute"),t=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.CadesSignedData"),r=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.CPSigner")}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при инициализации подписи")}var n,a,o=_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(o)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при установке времени подписи")}try{_generateCadesFn_1.__cadesAsyncToken__,r.propset_Certificate(cadesCertificate),n=_generateCadesFn_1.__cadesAsyncToken__+r.AuthenticatedAttributes2,_generateCadesFn_1.__cadesAsyncToken__,n.Add(e),_generateCadesFn_1.__cadesAsyncToken__,t.propset_ContentEncoding(cadesplugin.CADESCOM_BASE64_TO_BINARY),_generateCadesFn_1.__cadesAsyncToken__,t.propset_Content(messageHash),_generateCadesFn_1.__cadesAsyncToken__,r.propset_Options(cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при указании данных для подписи")}try{a=_generateCadesFn_1.__cadesAsyncToken__+t.SignCades(r,cadesplugin.CADESCOM_CADES_BES,detachedSignature)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при подписании данных")}return a})))]}}))}))}))},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,o){function i(e){try{s(n.next(e))}catch(e){o(e)}}function _(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,_)}s((n=n.apply(e,t||[])).next())}))},__generator=this&&this.__generator||function(e,t){var r,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:_(0),throw:_(1),return:_(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function _(o){return function(_){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,n=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],n=0}finally{r=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[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,t,r,n;try{e=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CADESCOM.CPAttribute"),t=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.HashedData"),r=_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,o,i=_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(i)}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__,t.propset_Algorithm(cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256),_generateCadesFn_1.__cadesAsyncToken__,t.SetHashValue(messageHash)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при установке хеша")}try{o=_generateCadesFn_1.__cadesAsyncToken__+r.SignHash(t,n,cadesplugin.CADESCOM_PKCS7_TYPE)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при подписании данных")}return o})))]}}))}))}))},function(module,exports,__webpack_require__){"use strict";(function(Buffer){var __awaiter=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,o){function i(e){try{s(n.next(e))}catch(e){o(e)}}function _(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,_)}s((n=n.apply(e,t||[])).next())}))},__generator=this&&this.__generator||function(e,t){var r,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:_(0),throw:_(1),return:_(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function _(o){return function(_){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,n=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],n=0}finally{r=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[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,t,r;try{e=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CADESCOM.CPAttribute"),t=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.CadesSignedData"),r=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.CPSigner")}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при инициализации подписи")}var n,a,o,i=_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(i)}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__,r.propset_Certificate(cadesCertificate),a=_generateCadesFn_1.__cadesAsyncToken__+r.AuthenticatedAttributes2,_generateCadesFn_1.__cadesAsyncToken__,a.Add(e),_generateCadesFn_1.__cadesAsyncToken__,t.propset_ContentEncoding(cadesplugin.CADESCOM_BASE64_TO_BINARY),_generateCadesFn_1.__cadesAsyncToken__,t.propset_Content(n),_generateCadesFn_1.__cadesAsyncToken__,r.propset_Options(cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при указании данных для подписи")}try{o=_generateCadesFn_1.__cadesAsyncToken__+t.SignCades(r,cadesplugin.CADESCOM_PKCS7_TYPE)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при подписании данных")}return o})))]}}))}))}))}).call(this,__webpack_require__(10).Buffer)},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";t.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=c(e),i=n[0],_=n[1],s=new o(function(e,t,r){return 3*(t+r)/4-r}(0,i,_)),u=0,l=_>0?i-4:i;for(r=0;r<l;r+=4)t=a[e.charCodeAt(r)]<<18|a[e.charCodeAt(r+1)]<<12|a[e.charCodeAt(r+2)]<<6|a[e.charCodeAt(r+3)],s[u++]=t>>16&255,s[u++]=t>>8&255,s[u++]=255&t;2===_&&(t=a[e.charCodeAt(r)]<<2|a[e.charCodeAt(r+1)]>>4,s[u++]=255&t);1===_&&(t=a[e.charCodeAt(r)]<<10|a[e.charCodeAt(r+1)]<<4|a[e.charCodeAt(r+2)]>>2,s[u++]=t>>8&255,s[u++]=255&t);return s},t.fromByteArray=function(e){for(var t,r=e.length,a=r%3,o=[],i=0,_=r-a;i<_;i+=16383)o.push(u(e,i,i+16383>_?_:i+16383));1===a?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===a&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],a=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_=0,s=i.length;_<s;++_)n[_]=i[_],a[i.charCodeAt(_)]=_;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,r){for(var a,o,i=[],_=t;_<r;_+=3)a=(e[_]<<16&16711680)+(e[_+1]<<8&65280)+(255&e[_+2]),i.push(n[(o=a)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return i.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,n,a){var o,i,_=8*a-n-1,s=(1<<_)-1,c=s>>1,u=-7,l=r?a-1:0,d=r?-1:1,f=e[t+l];for(l+=d,o=f&(1<<-u)-1,f>>=-u,u+=_;u>0;o=256*o+e[t+l],l+=d,u-=8);for(i=o&(1<<-u)-1,o>>=-u,u+=n;u>0;i=256*i+e[t+l],l+=d,u-=8);if(0===o)o=1-c;else{if(o===s)return i?NaN:1/0*(f?-1:1);i+=Math.pow(2,n),o-=c}return(f?-1:1)*i*Math.pow(2,o-n)},t.write=function(e,t,r,n,a,o){var i,_,s,c=8*o-a-1,u=(1<<c)-1,l=u>>1,d=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(_=isNaN(t)?1:0,i=u):(i=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-i))<1&&(i--,s*=2),(t+=i+l>=1?d/s:d*Math.pow(2,1-l))*s>=2&&(i++,s/=2),i+l>=u?(_=0,i=u):i+l>=1?(_=(t*s-1)*Math.pow(2,a),i+=l):(_=t*Math.pow(2,l-1)*Math.pow(2,a),i=0));a>=8;e[r+f]=255&_,f+=p,_/=256,a-=8);for(i=i<<a|_,c+=a;c>0;e[r+f]=255&i,f+=p,i/=256,c-=8);e[r+f-p]|=128*g}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){var __awaiter=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,o){function i(e){try{s(n.next(e))}catch(e){o(e)}}function _(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,_)}s((n=n.apply(e,t||[])).next())}))},__generator=this&&this.__generator||function(e,t){var r,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:_(0),throw:_(1),return:_(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function _(o){return function(_){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,n=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],n=0}finally{r=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[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,t,r=_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__,r.propset_Algorithm(cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256),_generateCadesFn_1.__cadesAsyncToken__,r.propset_DataEncoding(cadesplugin.CADESCOM_BASE64_TO_BINARY),_generateCadesFn_1.__cadesAsyncToken__,r.Hash(e)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при инициализации хэширования")}try{t=_generateCadesFn_1.__cadesAsyncToken__+r.Value}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при создании хэша")}return t})))]}))}))}))}).call(this,__webpack_require__(10).Buffer)}])}));
|
||
//# sourceMappingURL=crypto-pro.min.js.map
|