!function(e,t){"object"==typeofexports&&"object"==typeofmodule?module.exports=t():"function"==typeofdefine&&define.amd?define("cryptoPro",[],t):"object"==typeofexports?exports.cryptoPro=t():e.cryptoPro=t()}(window,(function(){returnfunction(e){vart={};functionr(n){if(t[n])returnt[n].exports;vara=t[n]={i:n,l:!1,exports:{}};returne[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}returnr.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"!=typeofSymbol&&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)returne;if(4&t&&"object"==typeofe&&e&&e.__esModule)returne;varn=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeofe)for(varaine)r.d(n,a,function(t){returne[t]}.bind(null,a));returnn},r.n=function(e){vart=e&&e.__esModule?function(){returne.default}:function(){returne};returnr.d(t,"a",t),t},r.o=function(e,t){returnObject.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=8)}([function(e,t,r){"use strict";varn=this&&this.__awaiter||function(e,t,r,n){returnnew(r||(r=Promise))((function(a,i){functiono(e){try{_(n.next(e))}catch(e){i(e)}}functions(e){try{_(n.throw(e))}catch(e){i(e)}}function_(e){vart;e.done?a(e.value):(t=e.value,tinstanceofr?t:newr((function(e){e(t)}))).then(o,s)}_((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){varr,n,a,i,o={label:0,sent:function(){if(1&a[0])throwa[1];returna[1]},trys:[],ops:[]};returni={next:s(0),throw:s(1),return:s(2)},"function"==typeofSymbol&&(i[Symbol.iterator]=function(){returnthis}),i;functions(i){returnfunction(s){returnfunction(i){if(r)thrownewTypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)returna;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case0:case1:a=i;break;case4:returno.label++,{value:i[1],done:!1};case5:o.label++,n=i[1],i=[0];continue;case7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],n=0}finally{r=a=0}if(5&i[0])throwi[1];return{value:i[0]?i[1]:void0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});vari=r(1),o=!1,s=!1;t._afterPluginsLoaded=function(e){vart=Boolean(window.Promise);returnfunction(){for(var_=[],c=0;c<arguments.length;c++)_[c]=arguments[c];returnn(this,void0,void0,(function(){varn,c;returna(this,(function(a){switch(a.label){case0:if(!s){try{r(11)}catch(e){throwconsole.error(e),newError(i._extractMeaningfulErrorMessage(e)||"Ошибка при подключении модуля для работы с Cades plugin")}s=!0}if(n=window.cadesplugin,!t)thrownewError("Необходим полифилл для Promise");if(!n)thrownewError("Не подключен модуль для работы с Cades plugin");o||(n.set_log_level(n.LOG_LEVEL_ERROR),o=!0),a.label=1;case1:returna.trys.push([1,3,,4]),[4,n];case2:returna.sent(),[3,4];case3:throwc=a.sent(),console.error(c),newError(i._extractMeaningfulErrorMessage(c)||"Ошибка при инициализации модуля для работы с Cades plugin");case4:return[4,e.apply(this,_)];case5:return[2,a.sent()]}}))}))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._extractMeaningfulErrorMessage=function(e){vart,r=(null===(t=window.cadesplugin)||void0===t?void0:t.getLastError)&&window.cadesplugin.getLastError(e);if(!(null==r?void0:r.message)){if(!e.message)returnnull;r=e}if(!/[а-яА-Я]/.test(r.message))returnnull;varn=r.message.match(/^(.*?)(?:(?:\.?\s?\(?0x)|(?:\.?$))/);returnn?n[1]:null}},
/*!
*Thebuffermodulefromnode.js,forthebrowser.
*
*@authorFerossAboukhadijeh<http://feross.org>
*@licenseMIT
*/
varn=r(35),a=r(36),i=r(37);functiono(){return_.TYPED_ARRAY_SUPPORT?2147483647:1073741823}functions(e,t){if(o()<t)thrownewRangeError("Invalid typed array length");return_.TYPED_ARRAY_SUPPORT?(e=newUint8Array(t)).__proto__=_.prototype:(null===e&&(e=new_(t)),e.length=t),e}function_(e,t,r){if(!(_.TYPED_ARRAY_SUPPORT||thisinstanceof_))returnnew_(e,t,r);if("number"==typeofe){if("string"==typeoft)thrownewError("If encoding is specified then the first argument must be a string");returnl(this,e)}returnc(this,e,t,r)}functionc(e,t,r,n){if("number"==typeoft)thrownewTypeError('"value" argument must not be a number');return"undefined"!=typeofArrayBuffer&&tinstanceofArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)thrownewRangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))thrownewRangeError("'length' is out of bounds");t=void0===r&&void0===n?newUint8Array(t):void0===n?newUint8Array(t,r):newUint8Array(t,r,n);_.TYPED_ARRAY_SUPPORT?(e=t).__proto__=_.prototype:e=d(e,t);returne}(e,t,r,n):"string"==typeoft?function(e,t,r){"string"==typeofr&&""!==r||(r="utf8");if(!_.isEncoding(r))thrownewTypeError('"encoding" must be a valid string encoding');varn=0|p(t,r),a=(e=s(e,n)).write(t,r);a!==n&&(e=e.slice(0,a));returne}(e,t,r):function(e,t){if(_.isBuffer(t)){varr=0|f(t.length);return0===(e=s(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeofArrayBuffer&&t.bufferinstanceofArrayBuffer||"length"int)return"number"!=typeoft.length||(n=t.length)!=n?s(e,0):d(e,t);if("Buffer"===t.type&&i(t.data))returnd(e,t.data)}varn;thrownewTypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}functionu(e){if("number"!=typeofe)thrownewTypeError('"size" argument must be a number');if(e<0)thrownewRangeError('"size" argument must not be negative')}functionl(e,t){if(u(t),e=s(e,t<0?0:0|f(t)),!_.TYPED_ARRAY_SUPPORT)for(varr=0;r<t;++r)e[r]=0;returne}functiond(e,t){varr=t.length<0?0:0|f(t.length);e=s(e,r);for(varn=0;n<r;n+=1)e[n]=255&t[n];returne}functionf(e){if(e>=o())thrownewRangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return0|e}functionp(e,t){if(_.isBuffer(e))returne.length;if("undefined"!=typeofArrayBuffer&&"function"==typeofArrayBuffer.isView&&(ArrayBuffer.isView(e)||einstanceofArrayBuffer))returne.byteLength;"string"!=typeofe&&(e=""+e);varr=e.length;if(0===r)return0;for(varn=!1;;)switch(t){case"ascii":case"latin1":case"binary":returnr;case"utf8":case"utf-8":casevoid0:returnB(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return2*r;case"hex":returnr>>>1;case"base64":returnG(e).length;default:if(n)returnB(e).length;t=(""+t).toLowerCase(),n=!0}}functiong(e,t,r){varn=!1;if((void0===t||t<0)&&(t=0),t>this.length)return"";if((void0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":returnv(this,t,r);case"utf8":case"utf-8":returnb(this,t,r);case"ascii":returnP(this,t,r);case"latin1":case"binary":returnw(this,t,r);case"base64":returnS(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":returnR(this,t,r);default:if(n)thrownewTypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}functionE(e,t,r){varn=e[t];e[t]=e[r],e[r]=n}functionC(e,t,r,n,a){if(0===e.length)return-1;if("string"==typeofr?(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}elseif(r<0){if(!a)return-1;r=0}if("string"==typeoft&&(t=_.from(t,n)),_.isBuffer(t))return0===t.length?-1:h(e,t,r,n,a);if("number"==typeoft)returnt&=255,_.TYPED_ARRAY_SUPPORT&&"function"==typeofUint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):h(e,[t],r,n,a);thrownewTypeError("val must be string, number or Buffer")}functionh(e,t,r,n,a){vari,o=1,s=e.length,_=t.length;if(void0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs