crypto-pro-js/dist/crypto-pro.min.js

9 lines
110 KiB
JavaScript
Raw Normal View History

2021-05-07 14:47:38 +03:00
!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,_){function o(e){try{s(n.next(e))}catch(e){_(e)}}function i(e){try{s(n.throw(e))}catch(e){_(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(o,i)}s((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,a,_,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return _={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(_[Symbol.iterator]=function(){return this}),_;function i(_){return function(i){return function(_){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&_[0]?n.return:_[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,_[1])).done)return a;switch(n=0,a&&(_=[2&_[0],a.value]),_[0]){case 0:case 1:a=_;break;case 4:return o.label++,{value:_[1],done:!1};case 5:o.label++,n=_[1],_=[0];continue;case 7:_=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==_[0]&&2!==_[0])){o=0;continue}if(3===_[0]&&(!a||_[1]>a[0]&&_[1]<a[3])){o.label=_[1];break}if(6===_[0]&&o.label<a[1]){o.label=a[1],a=_;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(_);break}a[2]&&o.ops.pop(),o.trys.pop();continue}_=t.call(e,o)}catch(e){_=[6,e],n=0}finally{r=a=0}if(5&_[0])throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}([_,i])}}};Object.defineProperty(t,"__esModule",{value:!0});var _=r(1),o=!1,i=!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(!i){try{r(14)}catch(e){throw console.error(e),new Error(_._extractMeaningfulErrorMessage(e)||"Ошибка при подключении модуля для работы с Cades plugin")}i=!0}if(n=window.cadesplugin,!t)throw new Error("Необходим полифилл для Promise");if(!n)throw new Error("Не подключен модуль для работы с Cades plugin");o||(n.set_log_level(n.LOG_LEVEL_ERROR),o=!0),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,n];case 2:return a.sent(),[3,4];case 3:throw c=a.sent(),console.error(c),new Error(_._extractMeaningfulErrorMessage(c)||"Ошибка при инициализации модуля для работы с Cades plugin");case 4:return[4,e.apply(this,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}}
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/
2021-05-07 14:47:38 +03:00
var n=r(38),a=r(39),_=r(40);function o(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(e,t){if(o()<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=i(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=i(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?i(e,0):d(e,t);if("Buffer"===t.type&&_(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=i(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=i(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function f(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().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 w(this,t,r);case"ascii":return S(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 m(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=1,i=e.length,s=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs
2020-10-17 16:47:27 +03:00
//# sourceMappingURL=crypto-pro.min.js.map