@it-enterprise/digital-signature 1.3.3 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/euscp/euscp.js CHANGED
@@ -1,8 +1,8 @@
1
- !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e,n){"use strict";n.r(e),n.d(e,"EU_LIBRARY_TYPE_JS",(function(){return i})),n.d(e,"EU_LIBRARY_TYPE_SW",(function(){return o})),n.d(e,"EU_LIBRARY_TYPE_MS",(function(){return s})),n.d(e,"EndUserLibraryType",(function(){return r})),n.d(e,"EU_SUBJECT_TYPE_UNDIFFERENCED",(function(){return u})),n.d(e,"EU_SUBJECT_TYPE_CA",(function(){return c})),n.d(e,"EU_SUBJECT_TYPE_CA_SERVER",(function(){return l})),n.d(e,"EU_SUBJECT_TYPE_RA_ADMINISTRATOR",(function(){return f})),n.d(e,"EU_SUBJECT_TYPE_END_USER",(function(){return _})),n.d(e,"EndUserSubjectType",(function(){return a})),n.d(e,"EU_SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED",(function(){return h})),n.d(e,"EU_SUBJECT_CA_SERVER_SUB_TYPE_CMP",(function(){return E})),n.d(e,"EU_SUBJECT_CA_SERVER_SUB_TYPE_TSP",(function(){return y})),n.d(e,"EU_SUBJECT_CA_SERVER_SUB_TYPE_OCSP",(function(){return S})),n.d(e,"EndUserSubjectCAServerSubType",(function(){return p})),n.d(e,"EU_CERT_KEY_TYPE_UNKNOWN",(function(){return d})),n.d(e,"EU_CERT_KEY_TYPE_DSTU4145",(function(){return A})),n.d(e,"EU_CERT_KEY_TYPE_RSA",(function(){return R})),n.d(e,"EU_CERT_KEY_TYPE_ECDSA",(function(){return m})),n.d(e,"EndUserCertKeyType",(function(){return C})),n.d(e,"EU_CERT_HASH_TYPE_UNKNOWN",(function(){return g})),n.d(e,"EU_CERT_HASH_TYPE_GOST34311",(function(){return P})),n.d(e,"EU_CERT_HASH_TYPE_SHA1",(function(){return v})),n.d(e,"EU_CERT_HASH_TYPE_SHA224",(function(){return I})),n.d(e,"EU_CERT_HASH_TYPE_SHA256",(function(){return U})),n.d(e,"EU_CERT_HASH_TYPE_SHA384",(function(){return b})),n.d(e,"EU_CERT_HASH_TYPE_SHA512",(function(){return D})),n.d(e,"EU_CERT_HASH_TYPE_DSTU7564_256",(function(){return O})),n.d(e,"EU_CERT_HASH_TYPE_DSTU7564_384",(function(){return G})),n.d(e,"EU_CERT_HASH_TYPE_DSTU7564_512",(function(){return N})),n.d(e,"EndUserCertHashType",(function(){return T})),n.d(e,"EU_KEY_USAGE_UNKNOWN",(function(){return M})),n.d(e,"EU_KEY_USAGE_DIGITAL_SIGNATURE",(function(){return L})),n.d(e,"EU_KEY_USAGE_NON_REPUDATION",(function(){return K})),n.d(e,"EU_KEY_USAGE_KEY_AGREEMENT",(function(){return k})),n.d(e,"EndUserKeyUsage",(function(){return w})),n.d(e,"EU_CCS_TYPE_REVOKE",(function(){return B})),n.d(e,"EU_CCS_TYPE_HOLD",(function(){return F})),n.d(e,"EndUserCCSType",(function(){return x})),n.d(e,"EU_REVOCATION_REASON_UNKNOWN",(function(){return Y})),n.d(e,"EU_REVOCATION_REASON_KEY_COMPROMISE",(function(){return j})),n.d(e,"EU_REVOCATION_REASON_NEW_ISSUED",(function(){return V})),n.d(e,"EndUserRevocationReason",(function(){return H})),n.d(e,"EU_KEYS_TYPE_NONE",(function(){return X})),n.d(e,"EU_KEYS_TYPE_DSTU_AND_ECDH_WITH_GOST",(function(){return z})),n.d(e,"EU_KEYS_TYPE_RSA_WITH_SHA",(function(){return J})),n.d(e,"EU_KEYS_TYPE_ECDSA_WITH_SHA",(function(){return q})),n.d(e,"EU_KEYS_TYPE_DSTU_AND_ECDH_WITH_DSTU",(function(){return Z})),n.d(e,"EndUserKeysType",(function(){return W})),n.d(e,"EU_KEYS_LENGTH_DS_UA_191",(function(){return $})),n.d(e,"EU_KEYS_LENGTH_DS_UA_257",(function(){return tt})),n.d(e,"EU_KEYS_LENGTH_DS_UA_307",(function(){return et})),n.d(e,"EU_KEYS_LENGTH_DS_UA_FILE",(function(){return nt})),n.d(e,"EU_KEYS_LENGTH_DS_UA_CERT",(function(){return rt})),n.d(e,"EndUserKeysLengthDSUA",(function(){return Q})),n.d(e,"EU_KEYS_LENGTH_KEP_UA_257",(function(){return ot})),n.d(e,"EU_KEYS_LENGTH_KEP_UA_431",(function(){return st})),n.d(e,"EU_KEYS_LENGTH_KEP_UA_571",(function(){return at})),n.d(e,"EU_KEYS_LENGTH_KEP_UA_FILE",(function(){return ut})),n.d(e,"EU_KEYS_LENGTH_KEP_UA_CERT",(function(){return ct})),n.d(e,"EndUserKeysLengthKEPUA",(function(){return it})),n.d(e,"EU_KEYS_LENGTH_DS_RSA_1024",(function(){return ft})),n.d(e,"EU_KEYS_LENGTH_DS_RSA_2048",(function(){return _t})),n.d(e,"EU_KEYS_LENGTH_DS_RSA_3072",(function(){return pt})),n.d(e,"EU_KEYS_LENGTH_DS_RSA_4096",(function(){return ht})),n.d(e,"EU_KEYS_LENGTH_DS_RSA_FILE",(function(){return Et})),n.d(e,"EU_KEYS_LENGTH_DS_RSA_CERT",(function(){return yt})),n.d(e,"EndUserKeysLengthDSRSA",(function(){return lt})),n.d(e,"EU_KEYS_REQUEST_TYPE_UA_DS",(function(){return Ct})),n.d(e,"EU_KEYS_REQUEST_TYPE_UA_KEP",(function(){return dt})),n.d(e,"EU_KEYS_REQUEST_TYPE_INT_RSA",(function(){return At})),n.d(e,"EndUserRequestTypes",(function(){return St})),n.d(e,"EU_MOBILE_OPERATOR_ID_KYIVSTAR",(function(){return mt})),n.d(e,"EU_MOBILE_OPERATOR_ID_VODAFONE",(function(){return Tt})),n.d(e,"EU_MOBILE_OPERATOR_ID_LIFECELL",(function(){return gt})),n.d(e,"EndUserMobileOperatorID",(function(){return Rt})),n.d(e,"EU_KSP_IIT",(function(){return It})),n.d(e,"EU_KSP_UKEY",(function(){return Ut})),n.d(e,"EU_KSP_PB",(function(){return bt})),n.d(e,"EU_KSP_DIIA",(function(){return Dt})),n.d(e,"EndUserKSP",(function(){return Pt})),n.d(e,"EndUserKSPClientIdType",(function(){return vt})),n.d(e,"EU_SIGN_TYPE_UNKNOWN",(function(){return Gt})),n.d(e,"EU_SIGN_TYPE_CADES_BES",(function(){return Nt})),n.d(e,"EU_SIGN_TYPE_CADES_T",(function(){return wt})),n.d(e,"EU_SIGN_TYPE_CADES_C",(function(){return Mt})),n.d(e,"EU_SIGN_TYPE_CADES_X_LONG",(function(){return Lt})),n.d(e,"EU_SIGN_TYPE_CADES_X_LONG_TRUSTED",(function(){return Kt})),n.d(e,"EndUserSignType",(function(){return Ot})),n.d(e,"EU_CADES_TYPE_UNKNOWN",(function(){return xt})),n.d(e,"EU_CADES_TYPE_DETACHED",(function(){return Bt})),n.d(e,"EU_CADES_TYPE_ENVELOPED",(function(){return Ft})),n.d(e,"EndUserCAdESType",(function(){return kt})),n.d(e,"EU_CTX_SIGN_UNKNOWN",(function(){return Yt})),n.d(e,"EU_CTX_SIGN_DSTU4145_WITH_GOST34311",(function(){return jt})),n.d(e,"EU_CTX_SIGN_RSA_WITH_SHA",(function(){return Vt})),n.d(e,"EU_CTX_SIGN_ECDSA_WITH_SHA",(function(){return Wt})),n.d(e,"EU_CTX_SIGN_DSTU4145_WITH_DSTU7564",(function(){return Xt})),n.d(e,"EndUserSignAlgo",(function(){return Ht})),n.d(e,"EU_SIGN_TYPE_PARAMETER",(function(){return Jt})),n.d(e,"EU_USE_SLOGIN_PRIVATE_KEY",(function(){return qt})),n.d(e,"EU_CHECK_PRIVATE_KEY_CONTEXT_PARAMETER",(function(){return Zt})),n.d(e,"EU_USE_SLOGIN_PRIVATE_KEY_CONTEXT_PARAMETER",(function(){return Qt})),n.d(e,"EU_UA_OID_EXT_KEY_USAGE_STAMP",(function(){return $t})),n.d(e,"EU_USER_INFO_VERSION",(function(){return te})),n.d(e,"EndUserCMPCompatibility",(function(){return zt})),n.d(e,"EU_CTX_HASH_ALGO_UNKNOWN",(function(){return ne})),n.d(e,"EU_CTX_HASH_ALGO_GOST34311",(function(){return re})),n.d(e,"EU_CTX_HASH_ALGO_SHA160",(function(){return ie})),n.d(e,"EU_CTX_HASH_ALGO_SHA224",(function(){return oe})),n.d(e,"EU_CTX_HASH_ALGO_SHA256",(function(){return se})),n.d(e,"EU_CTX_HASH_ALGO_SHA384",(function(){return ae})),n.d(e,"EU_CTX_HASH_ALGO_SHA512",(function(){return ue})),n.d(e,"EU_CTX_HASH_ALGO_DSTU7564_256",(function(){return ce})),n.d(e,"EU_CTX_HASH_ALGO_DSTU7564_384",(function(){return le})),n.d(e,"EU_CTX_HASH_ALGO_DSTU7564_512",(function(){return fe})),n.d(e,"EndUserHashAlgo",(function(){return ee})),n.d(e,"EU_ASIC_TYPE_UNKNOWN",(function(){return pe})),n.d(e,"EU_ASIC_TYPE_S",(function(){return he})),n.d(e,"EU_ASIC_TYPE_E",(function(){return Ee})),n.d(e,"EndUserASiCType",(function(){return _e})),n.d(e,"EU_ASIC_SIGN_TYPE_UNKNOWN",(function(){return Se})),n.d(e,"EU_ASIC_SIGN_TYPE_CADES",(function(){return Ce})),n.d(e,"EU_ASIC_SIGN_TYPE_XADES",(function(){return de})),n.d(e,"EndUserASiCSignType",(function(){return ye})),n.d(e,"EU_XADES_TYPE_UNKNOWN",(function(){return Re})),n.d(e,"EU_XADES_TYPE_DETACHED",(function(){return me})),n.d(e,"EU_XADES_TYPE_ENVELOPING",(function(){return Te})),n.d(e,"EU_XADES_TYPE_ENVELOPED",(function(){return ge})),n.d(e,"EndUserXAdESType",(function(){return Ae})),n.d(e,"EU_XADES_SIGN_LEVEL_UNKNOWN",(function(){return ve})),n.d(e,"EU_XADES_SIGN_LEVEL_B_B",(function(){return Ie})),n.d(e,"EU_XADES_SIGN_LEVEL_B_T",(function(){return Ue})),n.d(e,"EU_XADES_SIGN_LEVEL_B_LT",(function(){return be})),n.d(e,"EU_XADES_SIGN_LEVEL_B_LTA",(function(){return De})),n.d(e,"EndUserXAdESSignLevel",(function(){return Pe})),n.d(e,"EU_PADES_SIGN_LEVEL_UNKNOWN",(function(){return Ne})),n.d(e,"EU_PADES_SIGN_LEVEL_B_B",(function(){return we})),n.d(e,"EU_PADES_SIGN_LEVEL_B_T",(function(){return Me})),n.d(e,"EU_PADES_SIGN_LEVEL_B_LT",(function(){return Le})),n.d(e,"EU_PADES_SIGN_LEVEL_B_LTA",(function(){return Ke})),n.d(e,"EndUserPAdESSignLevel",(function(){return Oe})),n.d(e,"EndUserEventType",(function(){return Ge})),n.d(e,"EU_SIGN_CONTAINER_TYPE_UNKNOWN",(function(){return xe})),n.d(e,"EU_SIGN_CONTAINER_TYPE_CADES",(function(){return Be})),n.d(e,"EU_SIGN_CONTAINER_TYPE_XADES",(function(){return Fe})),n.d(e,"EU_SIGN_CONTAINER_TYPE_PADES",(function(){return He})),n.d(e,"EU_SIGN_CONTAINER_TYPE_ASIC",(function(){return Ye})),n.d(e,"EndUserSignContainerType",(function(){return ke}));var r,i=1,o=2,s=3;!function(t){t[t.JS=i]="JS",t[t.SW=o]="SW",t[t.MS=s]="MS"}(r||(r={}));var a,u=0,c=1,l=2,f=3,_=4;!function(t){t[t.Undifferenced=u]="Undifferenced",t[t.CA=c]="CA",t[t.CAServer=l]="CAServer",t[t.RAAdministrator=f]="RAAdministrator",t[t.EndUser=_]="EndUser"}(a||(a={}));var p,h=0,E=1,y=2,S=3;!function(t){t[t.Undifferenced=h]="Undifferenced",t[t.CMP=E]="CMP",t[t.TSP=y]="TSP",t[t.OCSP=S]="OCSP"}(p||(p={}));var C,d=0,A=1,R=2,m=4;!function(t){t[t.Unknown=d]="Unknown",t[t.DSTU4145=A]="DSTU4145",t[t.RSA=R]="RSA",t[t.ECDSA=m]="ECDSA"}(C||(C={}));var T,g=0,P=1,v=2,I=3,U=4,b=5,D=6,O=7,G=8,N=9;!function(t){t[t.Unknown=g]="Unknown",t[t.GOST34311=P]="GOST34311",t[t.SHA1=v]="SHA1",t[t.SHA224=I]="SHA224",t[t.SHA256=U]="SHA256",t[t.SHA384=b]="SHA384",t[t.SHA512=D]="SHA512",t[t.DSTU7564_256=O]="DSTU7564_256",t[t.DSTU7564_384=G]="DSTU7564_384",t[t.DSTU7564_512=N]="DSTU7564_512"}(T||(T={}));var w,M=0,L=1,K=2,k=16;!function(t){t[t.Unknown=d]="Unknown",t[t.DigitalSignature=L]="DigitalSignature",t[t.NonRepudation=K]="NonRepudation",t[t.KeyAgreement=k]="KeyAgreement"}(w||(w={}));var x,B=1,F=2;!function(t){t[t.Revoke=B]="Revoke",t[t.Hold=F]="Hold"}(x||(x={}));var H,Y=0,j=1,V=2;!function(t){t[t.Unknown=Y]="Unknown",t[t.KeyCompromise=j]="KeyCompromise",t[t.NewIssued=V]="NewIssued"}(H||(H={}));var W,X=0,z=1,J=2,q=4,Z=8;!function(t){t[t.None=X]="None",t[t.DSTUAndECDHWithGOST=z]="DSTUAndECDHWithGOST",t[t.RSAWithSHA=J]="RSAWithSHA",t[t.ECDSAWithSHA=q]="ECDSAWithSHA",t[t.DSTUAndECDHWithDSTU=Z]="DSTUAndECDHWithDSTU"}(W||(W={}));var Q,$=1,tt=2,et=3,nt=4,rt=5;!function(t){t[t.EC_191=$]="EC_191",t[t.EC_257=tt]="EC_257",t[t.EC_307=et]="EC_307",t[t.File=nt]="File",t[t.Cert=rt]="Cert"}(Q||(Q={}));var it,ot=1,st=2,at=3,ut=4,ct=5;!function(t){t[t.EC_257=ot]="EC_257",t[t.EC_431=st]="EC_431",t[t.EC_571=at]="EC_571",t[t.File=nt]="File",t[t.Cert=rt]="Cert"}(it||(it={}));var lt,ft=1,_t=2,pt=3,ht=4,Et=5,yt=6;!function(t){t[t.N_1024=ft]="N_1024",t[t.N_2048=_t]="N_2048",t[t.N_3072=pt]="N_3072",t[t.N_4096=ht]="N_4096",t[t.File=nt]="File",t[t.Cert=rt]="Cert"}(lt||(lt={}));var St,Ct=1,dt=2,At=3;!function(t){t[t.uaDS=Ct]="uaDS",t[t.uaKEP=dt]="uaKEP",t[t.intRSA=At]="intRSA"}(St||(St={}));var Rt,mt=1,Tt=2,gt=3;!function(t){t[t.Kyivstar=mt]="Kyivstar",t[t.Vodafone=Tt]="Vodafone",t[t.Lifecell=gt]="Lifecell"}(Rt||(Rt={}));var Pt,vt,It=4,Ut=5,bt=6,Dt=7;!function(t){t[t.Kyivstar=mt]="Kyivstar",t[t.Vodafone=Tt]="Vodafone",t[t.Lifecell=gt]="Lifecell",t[t.IIT=It]="IIT",t[t.UKey=Ut]="UKey",t[t.PB=bt]="PB",t[t.DIIA=Dt]="DIIA"}(Pt||(Pt={})),function(t){t[t.Default=0]="Default",t[t.Name=1]="Name",t[t.Phone=2]="Phone",t[t.Email=3]="Email"}(vt||(vt={}));var Ot,Gt=0,Nt=1,wt=4,Mt=8,Lt=16,Kt=128;!function(t){t[t.Unknown=Gt]="Unknown",t[t.CAdES_BES=Nt]="CAdES_BES",t[t.CAdES_T=wt]="CAdES_T",t[t.CAdES_C=Mt]="CAdES_C",t[t.CAdES_X_Long=Lt]="CAdES_X_Long",t[t.CAdES_X_Long_Trusted=Kt]="CAdES_X_Long_Trusted"}(Ot||(Ot={}));var kt,xt=0,Bt=1,Ft=3;!function(t){t[t.Unknown=xt]="Unknown",t[t.Detached=Bt]="Detached",t[t.Enveloped=Ft]="Enveloped"}(kt||(kt={}));var Ht,Yt=0,jt=1,Vt=2,Wt=3,Xt=4;!function(t){t[t.Unknown=Yt]="Unknown",t[t.DSTU4145WithGOST34311=jt]="DSTU4145WithGOST34311",t[t.RSAWithSHA=Vt]="RSAWithSHA",t[t.ECDSAWithSHA=Wt]="ECDSAWithSHA",t[t.DSTU4145WithDSTU7564=Xt]="DSTU4145WithDSTU7564"}(Ht||(Ht={}));var zt,Jt="SignType",qt="UseSLoginPrivateKey",Zt="CheckPrivateKey",Qt="UseSLoginPrivateKey",$t="1.2.804.2.1.1.1.3.9",te=3;!function(t){t[t.None=0]="None",t[t.DownloadEUCerts=1]="DownloadEUCerts",t[t.SearchEUCerts=2]="SearchEUCerts"}(zt||(zt={}));var ee,ne=0,re=1,ie=2,oe=3,se=4,ae=5,ue=6,ce=7,le=8,fe=9;!function(t){t[t.Unknown=ne]="Unknown",t[t.GOST34311=re]="GOST34311",t[t.SHA160=ie]="SHA160",t[t.SHA224=oe]="SHA224",t[t.SHA256=se]="SHA256",t[t.SHA384=ae]="SHA384",t[t.SHA512=ue]="SHA512",t[t.DSTU7564_256=ce]="DSTU7564_256",t[t.DSTU7564_384=le]="DSTU7564_384",t[t.DSTU7564_512=fe]="DSTU7564_512"}(ee||(ee={}));var _e,pe=0,he=1,Ee=2;!function(t){t[t.Unknown=pe]="Unknown",t[t.S=he]="S",t[t.E=Ee]="E"}(_e||(_e={}));var ye,Se=0,Ce=1,de=2;!function(t){t[t.Unknown=Se]="Unknown",t[t.CAdES=Ce]="CAdES",t[t.XAdES=de]="XAdES"}(ye||(ye={}));var Ae,Re=0,me=1,Te=2,ge=3;!function(t){t[t.Unknown=Re]="Unknown",t[t.Detached=me]="Detached",t[t.Enveloping=Te]="Enveloping",t[t.Enveloped=ge]="Enveloped"}(Ae||(Ae={}));var Pe,ve=0,Ie=1,Ue=4,be=16,De=32;!function(t){t[t.Unknown=ve]="Unknown",t[t.B_B=Ie]="B_B",t[t.B_T=Ue]="B_T",t[t.B_LT=be]="B_LT",t[t.B_LTA=De]="B_LTA"}(Pe||(Pe={}));var Oe,Ge,Ne=0,we=1,Me=4,Le=16,Ke=32;!function(t){t[t.Unknown=ve]="Unknown",t[t.B_B=we]="B_B",t[t.B_T=Me]="B_T",t[t.B_LT=Le]="B_LT",t[t.B_LTA=Ke]="B_LTA"}(Oe||(Oe={})),function(t){t[t.None=0]="None",t[t.All=1]="All",t[t.ConfirmKSPOperation=2]="ConfirmKSPOperation"}(Ge||(Ge={}));var ke,xe=0,Be=1,Fe=2,He=3,Ye=4;!function(t){t[t.Unknown=xe]="Unknown",t[t.CAdES=Be]="CAdES",t[t.XAdES=Fe]="XAdES",t[t.PAdES=He]="PAdES",t[t.ASiC=Ye]="ASiC"}(ke||(ke={}))},function(t,e,n){"use strict";n.r(e),n.d(e,"EU_ERROR_NONE",(function(){return r})),n.d(e,"EU_ERROR_UNKNOWN",(function(){return i})),n.d(e,"EU_ERROR_NOT_SUPPORTED",(function(){return o})),n.d(e,"EU_ERROR_NOT_INITIALIZED",(function(){return s})),n.d(e,"EU_ERROR_BAD_PARAMETER",(function(){return a})),n.d(e,"EU_ERROR_LIBRARY_LOAD",(function(){return u})),n.d(e,"EU_ERROR_READ_SETTINGS",(function(){return c})),n.d(e,"EU_ERROR_TRANSMIT_REQUEST",(function(){return l})),n.d(e,"EU_ERROR_MEMORY_ALLOCATION",(function(){return f})),n.d(e,"EU_WARNING_END_OF_ENUM",(function(){return _})),n.d(e,"EU_ERROR_PROXY_NOT_AUTHORIZED",(function(){return p})),n.d(e,"EU_ERROR_NO_GUI_DIALOGS",(function(){return h})),n.d(e,"EU_ERROR_DOWNLOAD_FILE",(function(){return E})),n.d(e,"EU_ERROR_WRITE_SETTINGS",(function(){return y})),n.d(e,"EU_ERROR_CANCELED_BY_GUI",(function(){return S})),n.d(e,"EU_ERROR_OFFLINE_MODE",(function(){return C})),n.d(e,"EU_ERROR_KEY_MEDIAS_FAILED",(function(){return d})),n.d(e,"EU_ERROR_KEY_MEDIAS_ACCESS_FAILED",(function(){return A})),n.d(e,"EU_ERROR_KEY_MEDIAS_READ_FAILED",(function(){return R})),n.d(e,"EU_ERROR_KEY_MEDIAS_WRITE_FAILED",(function(){return m})),n.d(e,"EU_WARNING_KEY_MEDIAS_READ_ONLY",(function(){return T})),n.d(e,"EU_ERROR_KEY_MEDIAS_DELETE",(function(){return g})),n.d(e,"EU_ERROR_KEY_MEDIAS_CLEAR",(function(){return P})),n.d(e,"EU_ERROR_BAD_PRIVATE_KEY",(function(){return v})),n.d(e,"EU_ERROR_PKI_FORMATS_FAILED",(function(){return I})),n.d(e,"EU_ERROR_CSP_FAILED",(function(){return U})),n.d(e,"EU_ERROR_BAD_SIGNATURE",(function(){return b})),n.d(e,"EU_ERROR_AUTH_FAILED",(function(){return D})),n.d(e,"EU_ERROR_NOT_RECEIVER",(function(){return O})),n.d(e,"EU_ERROR_STORAGE_FAILED",(function(){return G})),n.d(e,"EU_ERROR_BAD_CERT",(function(){return N})),n.d(e,"EU_ERROR_CERT_NOT_FOUND",(function(){return w})),n.d(e,"EU_ERROR_INVALID_CERT_TIME",(function(){return M})),n.d(e,"EU_ERROR_CERT_IN_CRL",(function(){return L})),n.d(e,"EU_ERROR_BAD_CRL",(function(){return K})),n.d(e,"EU_ERROR_NO_VALID_CRLS",(function(){return k})),n.d(e,"EU_ERROR_GET_TIME_STAMP",(function(){return x})),n.d(e,"EU_ERROR_BAD_TSP_RESPONSE",(function(){return B})),n.d(e,"EU_ERROR_TSP_SERVER_CERT_NOT_FOUND",(function(){return F})),n.d(e,"EU_ERROR_TSP_SERVER_CERT_INVALID",(function(){return H})),n.d(e,"EU_ERROR_GET_OCSP_STATUS",(function(){return Y})),n.d(e,"EU_ERROR_BAD_OCSP_RESPONSE",(function(){return j})),n.d(e,"EU_ERROR_CERT_BAD_BY_OCSP",(function(){return V})),n.d(e,"EU_ERROR_OCSP_SERVER_CERT_NOT_FOUND",(function(){return W})),n.d(e,"EU_ERROR_OCSP_SERVER_CERT_INVALID",(function(){return X})),n.d(e,"EU_ERROR_LDAP_ERROR",(function(){return z})),n.d(e,"EndUserError",(function(){return J}));var r=0,i=65535,o=65534,s=1,a=2,u=3,c=4,l=5,f=6,_=7,p=8,h=9,E=10,y=11,S=12,C=13,d=17,A=18,R=19,m=20,T=21,g=22,P=23,v=24,I=33,U=34,b=35,D=36,O=37,G=49,N=50,w=51,M=52,L=53,K=54,k=55,x=65,B=66,F=67,H=68,Y=81,j=82,V=83,W=84,X=85,z=97,J=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(8),i=n(10),o=n(4),s=function(){function t(){}return t.MapFromKeyMedia=function(t,e){return e.SetTypeIndex(t.typeIndex),e.SetDevIndex(t.devIndex),e.SetPassword(t.user?"##"+t.user+"##"+t.password:t.password),e},t.MapToProxySettings=function(t,e){return e.useProxy=t.GetUseProxy(),e.address=t.GetAddress(),e.port=t.GetPort(),e.anonymous=t.GetAnonymous(),e.user=t.GetUser(),e.password=t.GetPassword(),e.savePassword=t.GetSavePassword(),e},t.MapFromProxySettings=function(t,e){return e.SetUseProxy(t.useProxy),e.SetAddress(t.address),e.SetPort(t.port),e.SetAnonymous(t.anonymous),e.SetUser(t.user),e.SetPassword(t.password),e.SetSavePassword(t.savePassword),e},t.MapEndUserOwnerInfo=function(t,e){return e.isFilled=t.IsFilled(),e.issuer=t.GetIssuer(),e.issuerCN=t.GetIssuerCN(),e.serial=t.GetSerial(),e.subject=t.GetSubject(),e.subjCN=t.GetSubjCN(),e.subjOrg=t.GetSubjOrg(),e.subjOrgUnit=t.GetSubjOrgUnit(),e.subjTitle=t.GetSubjTitle(),e.subjState=t.GetSubjState(),e.subjLocality=t.GetSubjLocality(),e.subjFullName=t.GetSubjFullName(),e.subjAddress=t.GetSubjAddress(),e.subjPhone=t.GetSubjPhone(),e.subjEMail=t.GetSubjEMail(),e.subjDNS=t.GetSubjDNS(),e.subjEDRPOUCode=t.GetSubjEDRPOUCode(),e.subjDRFOCode=t.GetSubjDRFOCode(),e},t.MapToEndUserCertificateInfoEx=function(t,e){return e.isFilled=t.IsFilled(),e.version=t.GetVersion(),e.issuer=t.GetIssuer(),e.issuerCN=t.GetIssuerCN(),e.serial=t.GetSerial(),e.subject=t.GetSubject(),e.subjCN=t.GetSubjCN(),e.subjOrg=t.GetSubjOrg(),e.subjOrgUnit=t.GetSubjOrgUnit(),e.subjTitle=t.GetSubjTitle(),e.subjState=t.GetSubjState(),e.subjLocality=t.GetSubjLocality(),e.subjFullName=t.GetSubjFullName(),e.subjAddress=t.GetSubjAddress(),e.subjPhone=t.GetSubjPhone(),e.subjEMail=t.GetSubjEMail(),e.subjDNS=t.GetSubjDNS(),e.subjEDRPOUCode=t.GetSubjEDRPOUCode(),e.subjDRFOCode=t.GetSubjDRFOCode(),e.subjNBUCode=t.GetSubjNBUCode(),e.subjSPFMCode=t.GetSubjSPFMCode(),e.subjOCode=t.GetSubjOCode(),e.subjOUCode=t.GetSubjOUCode(),e.subjUserCode=t.GetSubjUserCode(),e.certBeginTime=t.GetCertBeginTime(),e.certEndTime=t.GetCertEndTime(),e.isPrivKeyTimesAvail=t.IsPrivKeyTimesAvail(),e.privKeyBeginTime=t.GetPrivKeyBeginTime(),e.privKeyEndTime=t.GetPrivKeyEndTime(),e.publicKeyBits=t.GetPublicKeyBits(),e.publicKey=t.GetPublicKey(),e.publicKeyID=t.GetPublicKeyID(),e.issuerPublicKeyID=t.GetIssuerPublicKeyID(),e.keyUsage=t.GetKeyUsage(),e.extKeyUsages=t.GetExtKeyUsages(),e.policies=t.GetPolicies(),e.crlDistribPoint1=t.GetCRLDistribPoint1(),e.crlDistribPoint2=t.GetCRLDistribPoint2(),e.isPowerCert=t.IsPowerCert(),e.isSubjTypeAvail=t.IsSubjTypeAvail(),e.isSubjCA=t.IsSubjCA(),e.chainLength=t.GetChainLength(),e.UPN=t.GetUPN(),e.publicKeyType=t.GetPublicKeyType(),e.keyUsageType=t.GetKeyUsageType(),e.RSAModul=t.GetRSAModul(),e.RSAExponent=t.GetRSAExponent(),e.OCSPAccessInfo=t.GetOCSPAccessInfo(),e.issuerAccessInfo=t.GetIssuerAccessInfo(),e.TSPAccessInfo=t.GetTSPAccessInfo(),e.isLimitValueAvailable=t.IsLimitValueAvail(),e.limitValue=t.GetLimitValue(),e.limitValueCurrency=t.GetLimitValueCurrency(),e.subjType=t.GetSubjType(),e.subjSubType=t.GetSubjSubType(),e.subjUNZR=t.GetSubjUNZR(),e.subjCountry=t.GetSubjCountry(),e.isQSCD=t.IsQSCD(),e.subjUserID=t.GetSubjUserID(),e.certHashType=t.GetCertHashType(),e},t.MapToEndUserParams=function(t,e){return e.SN=t.GetSN(),e.commonName=t.GetCommonName(),e.locality=t.GetLocality(),e.state=t.GetState(),e.organization=t.GetOrganization(),e.orgUnit=t.GetOrgUnit(),e.title=t.GetTitle(),e.street=t.GetStreet(),e.phone=t.GetPhone(),e.surname=t.GetSurname(),e.givenname=t.GetGivenname(),e.EMail=t.GetEMail(),e.DNS=t.GetDNS(),e.EDRPOUCode=t.GetEDRPOUCode(),e.DRFOCode=t.GetDRFOCode(),e.NBUCode=t.GetNBUCode(),e.SPFMCode=t.GetSPFMCode(),e.information=t.GetInformation(),e.passPhrase=t.GetPassPhrase(),e.isPublishCertificate=t.GetIsPublishCertificate(),e.RAAdminSN=t.GetRAAdminSN(),e},t.MapToEndUserTimeInfo=function(t,e){return e.version=t.GetVersion(),e.isTimeAvail=t.IsTimeAvail(),e.isTimeStamp=t.IsTimeStamp(),e.time=t.GetTime(),e.isSignTimeStampAvail=t.IsSignTimeStampAvail(),e.signTimeStamp=t.GetSignTimeStamp(),e},t.MapToEndUserSignInfo=function(e,n){return n.ownerInfo=t.MapEndUserOwnerInfo(e.GetOwnerInfo(),new i.a),n.timeInfo=t.MapToEndUserTimeInfo(e.GetTimeInfo(),new o.EndUserTimeInfo),n.data=e.GetData(),n.signLevel=0,n},t.MapToEndUserSenderInfo=function(e,n){return n.ownerInfo=t.MapEndUserOwnerInfo(e.GetOwnerInfo(),new i.a),n.timeInfo=t.MapToEndUserTimeInfo(e.GetTimeInfo(),new o.EndUserTimeInfo),n.data=e.GetData(),n},t.MapToEndUserCertificate=function(e,n){return n.data=e.GetData(),n.infoEx=t.MapToEndUserCertificateInfoEx(e.GetInfoEx(),new r.a),n},t.MapFromEndUserInfo=function(t,e){return e.SetCommonName(t.commonName),e.SetLocality(t.locality),e.SetState(t.state),e.SetOrganization(t.organization),e.SetOrgUnit(t.orgUnit),e.SetTitle(t.title),e.SetStreet(t.street),e.SetPhone(t.phone),e.SetSurname(t.surname),e.SetGivenname(t.givenname),e.SetEMail(t.EMail),e.SetDNS(t.DNS),e.SetEDRPOUCode(t.EDRPOUCode),e.SetDRFOCode(t.DRFOCode),e.SetNBUCode(t.NBUCode),e.SetSPFMCode(t.SPFMCode),e.SetOCode(t.OCode),e.SetOUCode(t.OUCode),e.SetUserCode(t.userCode),e.SetUPN(t.UPN),e.SetUNZR(t.UNZR),e.SetCountry(t.country),e},t.MapToEndUserRequestInfo=function(t,e){return e.isFilled=!0,e.data=t.GetRequest(),e.type=t.GetRequestType(),e.fileName=t.GetDefaultRequestFileName(),e.isSimple=t.IsSimple(),e.subject=t.GetSubject(),e.subjCN=t.GetSubjCN(),e.subjOrg=t.GetSubjOrg(),e.subjOrgUnit=t.GetSubjOrgUnit(),e.subjTitle=t.GetSubjTitle(),e.subjState=t.GetSubjState(),e.subjLocality=t.GetSubjLocality(),e.subjFullName=t.GetSubjFullName(),e.subjAddress=t.GetSubjAddress(),e.subjPhone=t.GetSubjPhone(),e.subjEMail=t.GetSubjEMail(),e.subjDNS=t.GetSubjDNS(),e.subjEDRPOUCode=t.GetSubjEDRPOUCode(),e.subjDRFOCode=t.GetSubjDRFOCode(),e.subjNBUCode=t.GetSubjNBUCode(),e.subjSPFMCode=t.GetSubjSPFMCode(),e.subjOCode=t.GetSubjOCode(),e.subjOUCode=t.GetSubjOUCode(),e.subjUserCode=t.GetSubjUserCode(),e.certBeginTime=t.GetCertBeginTime(),e.certEndTime=t.GetCertEndTime(),e.isPrivKeyTimesAvail=t.IsPrivKeyTimesAvail(),e.privKeyBeginTime=t.GetPrivKeyBeginTime(),e.privKeyEndTime=t.GetPrivKeyEndTime(),e.publicKeyType=t.GetPublicKeyType(),e.publicKeyBits=t.GetPublicKeyBits(),e.RSAModul=t.GetRSAModul(),e.RSAExponent=t.GetRSAExponent(),e.publicKey=t.GetPublicKey(),e.publicKeyID=t.GetPublicKeyID(),e.extKeyUsages=t.GetExtKeyUsages(),e.crlDistribPoint1=t.GetCRLDistribPoint1(),e.crlDistribPoint2=t.GetCRLDistribPoint2(),e.isSubjTypeAvail=t.IsSubjTypeAvail(),e.subjType=t.GetSubjType(),e.subjSubType=t.GetSubjSubType(),e.isSelfSigned=t.IsSelfSigned(),e.signIssuer=t.GetSignIssuer(),e.signSerial=t.GetSignSerial(),e.subjUNZR=t.GetSubjUNZR(),e.subjCountry=t.GetSubjCountry(),e.isQSCD=t.IsQSCD(),e},t.MapToEndUserReference=function(t,e){return e.name=t.GetName(),e.val=t.GetData(),e},t.MapFromEndUserReference=function(t,e){return e.SetName(t.name),e.SetData(t.val),e},t}()},function(t,e,n){var r,i,o;i=[],void 0===(o="function"==typeof(r=function(){var t="https://chrome.google.com/webstore/detail/%D1%96%D1%96%D1%82-%D0%BA%D0%BE%D1%80%D0%B8%D1%81%D1%82%D1%83%D0%B2%D0%B0%D1%87-%D1%86%D1%81%D0%BA-1-%D0%B1%D1%96%D0%B1%D0%BB/jffafkigfgmjafhpkoibhfefeaebmccg?utm_source=chrome-app-launcher-info-dialog",e=function(){this.vendor="JSC IIT",this.classVersion=1,this.className="EndUserUTF8Coder"};e.prototype.encode=function(t){for(var e=[],n=0,r=0;r<t.length;r++){var i=t.charCodeAt(r);i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=63&i|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e},e.prototype.decode=function(t){for(var e,n,r,i=[],o=0,s=0;o<t.length;)(e=t[o++])<128?i[s++]=String.fromCharCode(e):e>191&&e<224?(n=t[o++],i[s++]=String.fromCharCode((31&e)<<6|63&n)):(n=t[o++],r=t[o++],i[s++]=String.fromCharCode((15&e)<<12|(63&n)<<6|63&r));return i.join("")};var n=function(){this.vendor="JSC IIT",this.classVersion=1,this.className="EndUserUTF16LECoder"};n.prototype.encode=function(t){for(var e,n=[],r=0;r<t.length;r++)e=t.charCodeAt(r),n.push(255&e),n.push((65280&e)>>8);return n},n.prototype.decode=function(t){var e,n=0,r="";if(t.length%2!=0)return null;for((e=t.length)>0&&0==t[e-2]&&0==t[e-1]&&(e-=2);n<e;)r+=String.fromCharCode(t[n]|t[n+1]<<8),n+=2;return r};var r=function(){this.vendor="JSC IIT",this.classVersion=1,this.className="EndUserCP1251Coder",this.m_cp1251_table={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,20:20,21:21,22:22,23:23,24:24,25:25,26:26,27:27,28:28,29:29,30:30,31:31,32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:92,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:126,127:127,1027:129,8225:135,1046:198,8222:132,1047:199,1168:165,1048:200,1113:154,1049:201,1045:197,1050:202,1028:170,160:160,1040:192,1051:203,164:164,166:166,167:167,169:169,171:171,172:172,173:173,174:174,1053:205,176:176,177:177,1114:156,181:181,182:182,183:183,8221:148,187:187,1029:189,1056:208,1057:209,1058:210,8364:136,1112:188,1115:158,1059:211,1060:212,1030:178,1061:213,1062:214,1063:215,1116:157,1064:216,1065:217,1031:175,1066:218,1067:219,1068:220,1069:221,1070:222,1032:163,8226:149,1071:223,1072:224,8482:153,1073:225,8240:137,1118:162,1074:226,1110:179,8230:133,1075:227,1033:138,1076:228,1077:229,8211:150,1078:230,1119:159,1079:231,1042:194,1080:232,1034:140,1025:168,1081:233,1082:234,8212:151,1083:235,1169:180,1084:236,1052:204,1085:237,1035:142,1086:238,1087:239,1088:240,1089:241,1090:242,1036:141,1041:193,1091:243,1092:244,8224:134,1093:245,8470:185,1094:246,1054:206,1095:247,1096:248,8249:139,1097:249,1098:250,1044:196,1099:251,1111:191,1055:207,1100:252,1038:161,8220:147,1101:253,8250:155,1102:254,8216:145,1103:255,1043:195,1105:184,1039:143,1026:128,1106:144,8218:130,1107:131,8217:146,1108:186,1109:190},this.m_ut8_table=unescape("%u0402%u0403%u201A%u0453%u201E%u2026%u2020%u2021%u20AC%u2030%u0409%u2039%u040A%u040C%u040B%u040F%u0452%u2018%u2019%u201C%u201D%u2022%u2013%u2014%u0000%u2122%u0459%u203A%u045A%u045C%u045B%u045F%u00A0%u040E%u045E%u0408%u00A4%u0490%u00A6%u00A7%u0401%u00A9%u0404%u00AB%u00AC%u00AD%u00AE%u0407%u00B0%u00B1%u0406%u0456%u0491%u00B5%u00B6%u00B7%u0451%u2116%u0454%u00BB%u0458%u0405%u0455%u0457")};r.prototype.encode=function(t){for(var e=[],n=0;n<t.length;n++){var r=t.charCodeAt(n);if(!(r in this.m_cp1251_table))throw"Character "+t.charAt(n)+" isn't supported by win1251!";e.push(this.m_cp1251_table[r])}return e},r.prototype.decode=function(t){for(var e,n="",r=0;r<t.length;r++)n+=(e=t[r])>=192&&e<=255?String.fromCharCode(e-192+1040):e>=128&&e<=191?this.m_ut8_table.charAt(e-128):String.fromCharCode(e);return n};var i={GetCoder:function(t){switch(t=t.toUpperCase()){case"UTF-8":return new e;case"UTF-16LE":return new n;case"WINDOWS-1251":return new r;default:return null}},ArrayToString:function(t,e){var n,r;if(void 0===t&&(t="UTF-8"),null==(n=i.GetCoder(t)))throw new nt(r=et.ERROR_BAD_PARAMETER,et.getErrorDescriptionEx(r,0));return n.decode(e)}},o=function(){this.vendor="JSC IIT",this.classVersion=1,this.className="EndUserDateCoder",this.dateDelimeter=".",this.timeDelimeter=":",this.dateTimeDelimeter=" ",this.format="dd.MM.yyyy HH:mm:ss"};o.prototype.encode=function(t){var e=t.getDate(),n=t.getMonth()+1,r=t.getFullYear(),i=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return e+this.dateDelimeter+n+this.dateDelimeter+r+this.dateTimeDelimeter+i+this.timeDelimeter+o+this.timeDelimeter+s},o.prototype.decode=function(t){try{var e=t.split(this.dateTimeDelimeter),n=e[0].split(this.dateDelimeter),r=e[1].split(this.timeDelimeter),i=parseInt(n[0]),o=parseInt(n[1])-1,s=parseInt(n[2]);if(i<0||i>31||o<0||o>12||s<0)return null;var a=parseInt(r[0]),u=parseInt(r[1]),c=parseInt(r[2]);return a<0||a>23||u<0||u>59||c<0||c>59?null:new Date(s,o,i,a,u,c,0)}catch(t){return null}};var s=function(){this.vendor="JSC IIT",this.classVersion=1,this.className="EndUserBase64Coder",this.m_map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",this.m_codes=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47]};s.prototype._getTextDecoder=function(){try{if("undefined"==typeof TextDecoder)return null;var t=new TextDecoder("utf-8");return"utf-8"!=t.encoding?null:t}catch(t){return null}},s.prototype._encodePart=function(t,e,n){for(var r,i,o=[],s=e;s<n;s+=3)r=t[s]<<16|t[s+1]<<8|t[s+2],i=this.m_map[r>>18&63]+this.m_map[r>>12&63]+this.m_map[r>>6&63]+this.m_map[63&r],o.push(i);return o.join("")},s.prototype.encode=function(t){var e,n,r,i,o,s,a="";if(0==(o=(e="undefined"==typeof Uint8Array?void 0===h?t.slice(0):new h(t):new Uint8Array(t)).length))return"";var u=this._getTextDecoder();if(null!=u){for(s=new Uint8Array(4*parseInt((o+2)/3)),n=0,r=0;n<o-o%3;n+=3,r+=4)i=e[n]<<16|e[n+1]<<8|e[n+2],s[r]=this.m_codes[i>>18&63],s[r+1]=this.m_codes[i>>12&63],s[r+2]=this.m_codes[i>>6&63],s[r+3]=this.m_codes[63&i];switch(o%3){case 1:i=e[n]<<16,s[r]=this.m_codes[i>>18&63],s[r+1]=this.m_codes[i>>12&63],s[r+2]=61,s[r+3]=61;break;case 2:i=e[n]<<16|e[n+1]<<8,s[r]=this.m_codes[i>>18&63],s[r+1]=this.m_codes[i>>12&63],s[r+2]=this.m_codes[i>>6&63],s[r+3]=61}a=u.decode(s)}else{var c,l=null,f=o-o%3,_=parseInt(f/15360);for(s=[],n=0;n<_;n++)l=this._encodePart(e,15360*n,15360*n+15360),s.push(l);switch(15360*_<f&&(l=this._encodePart(e,15360*n,f),s.push(l)),o%3){case 1:i=e[o-1]<<16,c=this.m_map[i>>18&63],c+=this.m_map[i>>12&63],c+="=",c+="=",s.push(c);break;case 2:i=e[o-2]<<16|e[o-1]<<8,c=this.m_map[i>>18&63],c+=this.m_map[i>>12&63],c+=this.m_map[i>>6&63],c+="=",s.push(c)}a=s.join("")}return a},s.prototype.decode=function(t){var e,n,r,i,o,s,a,u,c,l,f;if(""==t||(3&t.length)>0)return"undefined"==typeof Uint8Array?void 0===h?[]:new h(0):new Uint8Array(0);for(n=(s=t.length)/4*3-(a="="==t[s-1]?"="==t[s-2]?2:1:0),e="undefined"==typeof Uint8Array?void 0===h?[]:new h(n):new Uint8Array(n),r=0,i=0,o=0;r<Math.floor((s-a)/4);r++)u=this.m_map.indexOf(t[i++]),c=this.m_map.indexOf(t[i++]),l=this.m_map.indexOf(t[i++]),f=this.m_map.indexOf(t[i++]),e[o++]=u<<2|c>>4,e[o++]=(15&c)<<4|l>>2,e[o++]=(3&l)<<6|63&f;switch(a){case 2:u=this.m_map.indexOf(t[i]),c=this.m_map.indexOf(t[i+1]),e[o++]=u<<2|c>>4;break;case 1:u=this.m_map.indexOf(t[i]),c=this.m_map.indexOf(t[i+1]),l=this.m_map.indexOf(t[i+2]),e[o++]=u<<2|c>>4,e[o++]=(15&c)<<4|l>>2}return e};var a=function(t){return new function(){var e=this,n=function(){var t;e.deferred.length&&((t=[].slice.call(arguments)).unshift(n),e.deferred[0].apply(e,t),e.deferred.shift())};this.deferred=[],this.eu_wait=function(t){return this.deferred.push(t),e},t(n)}},u=function(){var t=this._getBrowserInfo();this.m_name=t.name,this.m_version=t.version,this.m_arch=this._getArch(),this.m_os_name=this._getOSName()};u.BROWSER_NAME_IE="IE",u.BROWSER_NAME_OPERA="Opera",u.BROWSER_NAME_CHROME="Chrome",u.BROWSER_NAME_FIREFOX="Firefox",u.BROWSER_NAME_SAFARI="Safari",u.BROWSER_NAME_EDGE="Edge",u.BROWSER_NAME_UNKNOWN="Unknown",u.OS_NAME_WINDOWS="Windows",u.OS_NAME_LINUX="Linux",u.OS_NAME_UNIX="Unix",u.OS_NAME_MAC="Mac OS X",u.OS_NAME_ANDROID="Android",u.OS_NAME_UNKNOWN="Unknown",u.BROWSER_ARCH_NAME_X86="x86",u.BROWSER_ARCH_NAME_X64="x64",u.BROWSER_ARCH_NAME_ARM="arm",u.BROWSER_ARCH_NAME_UNKNOWN="Unknown",u.prototype._getBrowserInfo=function(){var t,e={name:u.BROWSER_NAME_UNKNOWN,version:""},n=navigator.userAgent,r=n.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/msie/i.test(r[1])||/trident/i.test(r[1])?(e.name=u.BROWSER_NAME_IE,/msie/i.test(r[1])?e.version=parseInt(r[2]):(t=/\brv[ :]+(\d+)/g.exec(n)||[],e.version=parseInt(t[1])),e):"Chrome"===r[1]&&null!=(t=n.match(/\b(OPR|Edge)\/(\d+)/))?(e.name=t[1].replace("OPR",u.BROWSER_NAME_OPERA),e.version=parseInt(t[2]),e):(r=r[2]?[r[1],r[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(t=n.match(/version\/(\d+)/i))&&r.splice(1,1,t[1]),e.name=r[0],e.version=parseInt(r[1]),e)},u.prototype._getOSName=function(){var t=navigator.platform||"",e=(navigator.userAgent||"").toLowerCase(),n=navigator.userAgentData||[];return-1!=t.indexOf("Win")?u.OS_NAME_WINDOWS:-1!=t.indexOf("Mac")?u.OS_NAME_MAC:-1!=t.indexOf("Android")||-1!=e.indexOf("android")||"Android"==n.platform||-1!=t.indexOf("Linux")&&navigator.maxTouchPoints&&navigator.maxTouchPoints>1?u.OS_NAME_ANDROID:-1!=t.indexOf("Linux")?u.OS_NAME_LINUX:-1!=t.indexOf("FreeBSD")?u.OS_NAME_UNIX:u.OS_NAME_UNKNOWN},u.prototype._getArch=function(){var t,e=navigator.platform||"";switch(this._getOSName()){case u.OS_NAME_WINDOWS:t=-1!=e.indexOf("Win32")?u.BROWSER_ARCH_NAME_X86:u.BROWSER_ARCH_NAME_X64;break;case u.OS_NAME_MAC:t=-1!=e.indexOf("MacIntel")?u.BROWSER_ARCH_NAME_X86:u.BROWSER_ARCH_NAME_X64;break;case u.OS_NAME_UNIX:case u.OS_NAME_LINUX:case u.OS_NAME_ANDROID:t=-1!=e.indexOf("armv")?u.BROWSER_ARCH_NAME_ARM:-1!=e.indexOf("x86_64")?u.BROWSER_ARCH_NAME_X64:u.BROWSER_ARCH_NAME_X32;break;default:t=u.BROWSER_ARCH_NAME_UNKNOWN}return t},u.prototype.GetName=function(){return this.m_name},u.prototype.GetVersion=function(){return this.m_version},u.prototype.GetArch=function(){return this.m_arch},u.prototype.GetOSName=function(){return this.m_os_name};var c=[];c[0]="Executed successfully",c[-1]="Unknown error",c[-32300]="Transport error",c[-32400]="System error",c[-32500]="Application error",c[-32510]="Application error. Invalid session",c[-32600]="Server error. Invalid rpc. Not conforming to spec",c[-32601]="Server error. Requested method not found",c[-32602]="Server error. Invalid method parameters",c[-32603]="Server error. Internal rpc error",c[-32700]="Parse error. Not well formed",c[-32701]="Parse error. Unsupported encoding",c[-32702]="Parse error. Invalid character for encoding";var l=function(t,e,n,r){switch(this.Vendor="JSC IIT",this.ClassVersion="1.0.2",this.ClassName="JSONRPCClient",this.m_type=t,this.m_log=!1,this._logFunction("Initialize",arguments,["type","address","port","useHttps"]),t){case 2:this.m_uri=e,this.m_callbacks=[],this._registerOnExtensionRecieveEventHandler();break;case 3:case 4:this.m_uri=e,this.m_callbacks=[];break;case 1:default:this.m_uri="",r&&e.indexOf("https://")?this.m_uri+="https://":0!=e.indexOf("http://")&&(this.m_uri+="http://"),this.m_uri+=e+":"+n}this.m_requests=0,this.m_session_id=this._loadSessionId()};l.prototype._logFunction=function(t,e,n){if(this.m_log){for(var r="(",i=0;i<e.length;i++)r+=n[i]+": "+e[i].toString(),i!=e.length-1&&(r+=", ");r+=")",this._log(t,r)}},l.prototype._log=function(t,e){this.m_log&&console.log(t+": "+e)},l.prototype._loadSessionId=function(){try{var t=sessionStorage.getItem(this.ClassName+"session_id");return void 0===t||null==t||""==t?null:t}catch(t){return null}},l.prototype._saveSessionId=function(t){try{sessionStorage.setItem(this.ClassName+"session_id",t)}catch(t){}},l.prototype._removeSessionId=function(){try{sessionStorage.removeItem(this.ClassName+"session_id")}catch(t){}},l.prototype.createXMLHttpRequest=function(){return"undefined"==typeof XMLHttpRequest&&(XMLHttpRequest=function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}throw c[-32300]}),new XMLHttpRequest},l.prototype.makeRequest=function(t,e,n){var r=null;try{(r={}).jsonrpc="2.0",r.id=n,r.method=t,r.params=e,r.session_id=this.m_session_id,r=JSON.stringify(r)}catch(t){}return r},l.prototype.verifyResponse=function(t,e){try{if("2.0"!=e.jsonrpc)return!1;var n=e.error;if(void 0===n){if(e.id!=t||void 0===e.result)return!1}else{if(void 0===n.code||void 0===n.message)return!1;if(0!=n.code)return!1}if(void 0!==e.session_id)if(null!=this.m_session_id&&null!=e.session_id){if(this.m_session_id!=e.session_id)return!1}else this.m_session_id=e.session_id,this._saveSessionId(this.m_session_id);return!0}catch(t){return!1}},l.prototype.handleResponse=function(t,e){try{return e=JSON.parse(e),this.verifyResponse(t,e)?e:(this.m_session_id=null,this._removeSessionId(),null)}catch(t){return null}},l.prototype._sendHttp=function(t,e,n){var r,i,o=this;try{if((r=this.createXMLHttpRequest()).open("POST",this.m_uri,null!=n),r.setRequestHeader("Content-Type","application/json-rpc"),null!=n&&(r.onload=function(){200==r.status?(i=o.handleResponse(e,r.response),n(null!=i?i.result:null)):n(null)},r.onerror=function(){n(null)}),r.send(t),null!=n)return;return 200!=r.status||null==(i=this.handleResponse(e,r.response))?null:i.result}catch(t){if(null==n)return null;n(null)}},l.prototype._registerOnExtensionRecieveEventHandler=function(){var t=this;window.addEventListener("message",(function(e){if(e.data.sender==t.m_uri)try{var n=e.data.callback_id,r=t.m_callbacks[n-1];delete t.m_callbacks[n-1],t._logFunction("_registerOnExtensionRecieveEventHandler",[r.request_id,e.data.data],["request_id","data"]);var i=t.handleResponse(r.request_id,e.data.data);if(null==i)return void r.callback(null);r.callback(i.result)}catch(t){}}),!1)},l.prototype._sendExtension=function(t,e,n){var r=this;if(r._logFunction("_sendExtension",[arguments[0],arguments[1]],["request","request_id"]),!n)throw"Synchronous calls for web extensions not supported";if(1==document.getElementsByClassName(r.m_uri).length)try{var i={request_id:e,callback:n},o=r.m_callbacks.push(i),s={sender:r.ClassName,request:t,callback_id:o};window.postMessage(s,"*")}catch(t){n(null)}else n(null)},l.prototype._getPluginObject=function(){try{for(var t=document.getElementsByTagName("object"),e=0;e<t.length;e++){var n=t[e].classid;if(!n&&t[e].attributes&&t[e].attributes.classid&&(n=t[e].attributes.classid.value),n===this.m_uri)return t[e]}return null}catch(t){return null}},l.prototype._sendPlugin=function(t,e,n){var r,o=this;o._logFunction("_sendPlugin",[arguments[0],arguments[1]],["request","request_id"]);var a=o._getPluginObject();if(null==a)return null!=n&&n(null),null;var u=function(t){try{for(var e=new s,n=new h(0);;){var r=a.ProcessData(t),o=r.slice(0,5),u=r.slice(5,r.length-1);if(null!=u||""!=u){var c=e.decode(u),l=new h(n.length+c.length);l.set(n),l.set(c,n.length),n=l}switch(o){case'"part':t='"next"';continue;case'"last':return i.ArrayToString("UTF-8",n);default:return null}}}catch(t){return null}};try{return null!=n?void setTimeout((function(){r=u(t),o._logFunction("_sendPlugin",[e,r],["request_id","response"]),null!=(r=o.handleResponse(e,r))?n(r.result):n(null)}),1):(r=u(t),null==(r=o.handleResponse(e,r))?null:r.result)}catch(t){n(null)}},l.prototype.send=function(t,e,n){switch(this.m_type){case 1:return this._sendHttp(t,e,n);case 2:return this._sendExtension(t,e,n);case 3:case 4:return this._sendPlugin(t,e,n)}},l.prototype.execute=function(t,e,n){var r,i;return r=this.m_requests,this.m_requests++,null==(i=this.makeRequest(t,e,r))?null!=n?void n(null):null:null==n?this.send(i,r,n):void this.send(i,r,n)};var f=function(){};f.WEB_LIBRARY_OS_NOT_SUPPORTED=131072,f.WEB_LIBRARY_NOT_INSTALLED_OR_RUN=131073,f.WEB_LIBRARY_JAVA_APPLET_NOT_LOADED=131074,f.WEB_LIBRARY_INSTALLED_VERSION_NOT_SUPPORTED=131075,f.WEB_LIBRARY_INSTALL_PACKAGE=131076,f.WEB_LIBRARY_UPDATE_PACKAGE=131077,f.WEB_LIBRARY_USER_MANUAL=131078,f.WEB_LIBRARY_WEB_EXTENSION_INSTALL_PACKAGE=131079,f.WEB_LIBRARY_CHECK_JRE_VERSION=131080,f.WEB_LIBRARY_WEB_EXTENSION_NOT_INSTALLED_OR_RUN=131081,(f.DESCRIPTIONS=[])[f.WEB_LIBRARY_OS_NOT_SUPPORTED]=["Інсталяційний пакет web-бібліотеки підпису для вашої системи відсутній","Инсталяционный пакет web-библиотеки подписи для вашей системы отсутствует","The installation package of the library for the web signature for your system is absent"],f.DESCRIPTIONS[f.WEB_LIBRARY_NOT_INSTALLED_OR_RUN]=["Бібліотеку web-підпису не запущено або не інстальовано у системі. Для продовження необхідно запустити або інсталювати бібліотеку web-підпису.","Библиотеку web-подписи не запущено или не установлено в системе. Для продолжения необходимо запустить или установить библиотеку web-подписи.","The library for the web signature isn't started or not installed in system. To continue, it is necessary to start or install library for the web signature."],f.DESCRIPTIONS[f.WEB_LIBRARY_INSTALLED_VERSION_NOT_SUPPORTED]=["Інстальована версія web-бібліотеки підпису більше не підтримується. Для продовження необхідно інсталювати оновлену версію web-бібліотеки підпису.","Инсталированная версия web-библиотеки подписи больше не поддерживается. Для продолжения необходимо установить обновленную версию web-библиотеки подписи.","The installed version of library for the web signature isn't supported any more. To continue, it is necessary to install the updated version of the library for the web signature."],f.DESCRIPTIONS[f.WEB_LIBRARY_JAVA_APPLET_NOT_LOADED]=["Java-апплет не завантажено. Необхідно перевірити версію JRE","Java-апплет не загружен. Необходимо проверить версию JRE","Java applet isn't loaded. It is necessary to check the version of JRE"],f.DESCRIPTIONS[f.WEB_LIBRARY_INSTALL_PACKAGE]=["Інсталяційний пакет web-бібліотеки підпису","Инсталяционный пакет web-библиотеки подписи","Install package of library for the web signature"],f.DESCRIPTIONS[f.WEB_LIBRARY_UPDATE_PACKAGE]=["Оновлення web-бібліотеки підпису","Обновление web-библиотеки подписи","Update of library for the web signature"],f.DESCRIPTIONS[f.WEB_LIBRARY_USER_MANUAL]=["Настанова користувача","Руководство пользователя","User manual"],f.DESCRIPTIONS[f.WEB_LIBRARY_WEB_EXTENSION_INSTALL_PACKAGE]=["Інсталяційний пакет бібліотеки підпису (web-розширення)","Инсталяционный пакет библиотеки подписи (web-расширение)","Install package of library for the web signature (web-extension)"],f.DESCRIPTIONS[f.WEB_LIBRARY_CHECK_JRE_VERSION]=["Перевірити версію JRE","Проверить версию JRE","Check JRE version"],f.DESCRIPTIONS[f.WEB_LIBRARY_WEB_EXTENSION_NOT_INSTALLED_OR_RUN]=["Веб-розширення для роботи бібліотеки web-підпису не запущено або не інстальовано в браузері. Для продовження необхідно запустити або інсталювати веб-розширення.","Веб-расширение для работы библиотеки web-подписи не запущено или не установлено в браузере. Для продолжения необходимо запустить или установить веб-расширение.","The web extension for the web signature library is not running or installed in the browser. To continue, you need to run or install the web extension."],f.getString=function(t,e){var n,r;return void 0===(n=f.DESCRIPTIONS[t])&&(n=""),void 0===(r=n[e-1])?n[0]:r};var _=function(t,e,n,r,i){switch(this.m_id=e,this.m_library=null,this.m_language=n,this.m_supportedLibraryTypes=[],this.m_supportedLibraryTypesIndex=0,this.m_noJavaApplet=!1|r,this.m_webExtensionFirst=!1|i,this.m_errorResult=null,t){case _.LIBRARY_TYPE_JAVA_APPLET:case _.LIBRARY_TYPE_SIGN_AGENT:case _.LIBRARY_TYPE_WEB_EXTENSION:case _.LIBRARY_TYPE_NPAPI:case _.LIBRARY_TYPE_ACTIVE_X:this.m_libraryType=t;break;default:this.m_libraryType=_.LIBRARY_TYPE_DEFAULT}this.m_libraryType==_.LIBRARY_TYPE_DEFAULT?(this.m_webExtensionFirst&&_.isWebExtensionSupported()&&this.m_supportedLibraryTypes.push(_.LIBRARY_TYPE_WEB_EXTENSION),_.isSignAgentSupported()&&this.m_supportedLibraryTypes.push(_.LIBRARY_TYPE_SIGN_AGENT),!this.m_webExtensionFirst&&_.isWebExtensionSupported()&&this.m_supportedLibraryTypes.push(_.LIBRARY_TYPE_WEB_EXTENSION),_.isNPAPISupported()&&this.m_supportedLibraryTypes.push(_.LIBRARY_TYPE_NPAPI),_.isActiveXSupported()&&this.m_supportedLibraryTypes.push(_.LIBRARY_TYPE_ACTIVE_X),!this.m_noJavaApplet&&_.isJavaAppletSupported()&&this.m_supportedLibraryTypes.push(_.LIBRARY_TYPE_JAVA_APPLET)):this.m_supportedLibraryTypes.push(this.m_libraryType),this.onload=function(t){},this.onerror=function(t,e,n){},this.getLibraryType=function(){return this.m_libraryType}};_.LIBRARY_TYPE_DEFAULT=0,_.LIBRARY_TYPE_JAVA_APPLET=1,_.LIBRARY_TYPE_SIGN_AGENT=2,_.LIBRARY_TYPE_WEB_EXTENSION=3,_.LIBRARY_TYPE_NPAPI=4,_.LIBRARY_TYPE_ACTIVE_X=5,_.EU_DEFAULT_LANG=0,_.EU_UA_LANG=1,_.EU_RU_LANG=2,_.EU_EN_LANG=3,_.isJavaAppletSupported=function(){var t=new u;if(this.m_noJavaApplet)return!1;switch(t.GetName()){case u.BROWSER_NAME_FIREFOX:case u.BROWSER_NAME_CHROME:return!(t.GetVersion()>44);case u.BROWSER_NAME_OPERA:return!(t.GetVersion()>30);case u.BROWSER_NAME_EDGE:case u.BROWSER_NAME_UNKNOWN:return!1;default:return!0}},_.isSignAgentSupported=function(){var t=new u;switch(t.GetName()){case u.BROWSER_NAME_IE:if(t.GetVersion()<10)return!1;break;case u.BROWSER_NAME_SAFARI:if(t.GetVersion()<7)return!1;break;case u.BROWSER_NAME_UNKNOWN:return!1}switch(t.GetOSName()){case u.OS_NAME_WINDOWS:case u.OS_NAME_MAC:break;case u.OS_NAME_ANDROID:case u.OS_NAME_LINUX:break;case u.OS_NAME_UNKNOWN:default:return!1}return!0},_.isWebExtensionSupported=function(){var t=new u;switch(t.GetName()){case u.BROWSER_NAME_CHROME:break;case u.BROWSER_NAME_OPERA:if(t.GetVersion()<35)return!1;break;case u.BROWSER_NAME_FIREFOX:if(t.GetVersion()<50)return!1;break;case u.BROWSER_NAME_UNKNOWN:default:return!1}switch(t.GetOSName()){case u.OS_NAME_ANDROID:case u.OS_NAME_UNKNOWN:return!1}return!0},_.isNPAPISupported=function(){var t=new u;switch(t.GetName()){case u.BROWSER_NAME_FIREFOX:if(t.GetVersion()>51)return!1;break;default:return!1}return!0},_.isActiveXSupported=function(){var t=new u;switch(t.GetName()){case u.BROWSER_NAME_IE:if(t.GetVersion()<9||t.GetArch()==u.BROWSER_ARCH_NAME_X64)return!1;break;default:return!1}return!0},_.isWebExtensionInstalled=function(){var t=(new u).GetName()==u.BROWSER_NAME_FIREFOX?"eusw@iit.com.ua":"chrome-extension://jffafkigfgmjafhpkoibhfefeaebmccg/";return 1==document.getElementsByClassName(t).length},_.prototype.getLibraryType=function(){return this.m_libraryType},_.prototype.load=function(){var t=this;setTimeout((function(){t._load(t.m_supportedLibraryTypes[t.m_supportedLibraryTypesIndex])}),1)},_.prototype.unload=function(){var t=document.getElementById(this.m_id);t&&t.parentNode&&t.parentNode.removeChild(t)},_.prototype._load=function(t){switch(t){case _.LIBRARY_TYPE_JAVA_APPLET:return void this._loadSignApplet();case _.LIBRARY_TYPE_SIGN_AGENT:return void this._loadSignAgent();case _.LIBRARY_TYPE_WEB_EXTENSION:return void this._loadWebExtension();case _.LIBRARY_TYPE_NPAPI:return void this._loadNPAPI();case _.LIBRARY_TYPE_ACTIVE_X:return void this._loadActiveX()}},_.prototype._onLoad=function(){this.m_libraryType=this.m_supportedLibraryTypes[this.m_supportedLibraryTypesIndex];try{this.onload(this.m_library)}catch(t){console.log(t)}},_.prototype._onLoadError=function(t,e,n,r){null==this.m_errorResult&&(this.m_errorResult={msg:e,code:n,library:r});var i=document.getElementById(this.m_id);if(i&&i.parentNode&&i.parentNode.removeChild(i),t)if(this.m_supportedLibraryTypesIndex++,this.m_supportedLibraryTypesIndex>=this.m_supportedLibraryTypes.length)try{this.onerror(this.m_errorResult.msg,this.m_errorResult.code,this.m_errorResult.library)}catch(t){console.log(t)}else this.load();else try{this.onerror(this.m_errorResult.msg,this.m_errorResult.code,this.m_errorResult.library)}catch(t){console.log(t)}},_.prototype._loadSignApplet=function(){var t=document.createElement("applet");t.setAttribute("codebase","https://sign.eu.iit.com.ua"),t.setAttribute("code","com.iit.certificateAuthority.endUser.libraries.signJava.EndUser.class"),t.setAttribute("archive","EUSignJava.jar"),t.setAttribute("cache_archive","EUSignJava.jar"),t.setAttribute("cache_version","1.3.102"),t.setAttribute("separate_jvm",!0),t.setAttribute("id",this.m_id),t.setAttribute("width","100%"),t.setAttribute("height","1"),document.body.appendChild(t),this.m_library=document.getElementById(this.m_id),this._waitForSignAppletLoad(this,100,1200)},_.prototype._waitForSignAppletLoad=function(t,e,n){try{t.m_library.SetUIMode(!1)}catch(i){if(0!=n)return void setTimeout((function(){t._waitForSignAppletLoad(t,e,n-1)}),e,n);var r="";return r=et.getErrorDescriptionEx(et.ERROR_LIBRARY_COMUNICATION_FAILED,t.m_language)+". ",r+=f.getString(f.WEB_LIBRARY_JAVA_APPLET_NOT_LOADED,t.m_language),r+="<br><br>",r+='<a style="text-indent:18px" href="https://www.java.com/ru/download/installed.jsp">'+f.getString(f.WEB_LIBRARY_CHECK_JRE_VERSION,t.m_language)+"</a>",void t._onLoadError(!0,r,et.ERROR_LIBRARY_COMUNICATION_FAILED,null)}t._onLoad(t.m_library)},_.prototype._appendWebWrapperObject=function(t,e,n,r){try{var i=new rt(t,e),o=document.createElement("object");for(var s in o.setAttribute("id",this.m_id),n?r?(o.setAttribute("classid",t),o.setAttribute("height","1px")):(o.type=t,o.classid=t,o.height="1px"):(o.classid="EUSignCP.class",o.style="display:none",o.style.visibility="hidden"),document.body.appendChild(o),i)o[s]=i[s];return this.m_library=document.getElementById(this.m_id),!0}catch(t){return!1}},_.prototype._onLoadWebLibraryError=function(t){var e,n=this.m_library,r=!0,i="";switch(e=_.isWebExtensionSupported()&&!_.isWebExtensionInstalled()&&this.m_webExtensionFirst,i+=et.getErrorDescriptionEx(et.ERROR_LIBRARY_COMUNICATION_FAILED,this.m_language),i+=". ",t.GetErrorCode()){case et.ERROR_LIBRARY_COMUNICATION_FAILED:i+=f.getString(e?f.WEB_LIBRARY_WEB_EXTENSION_NOT_INSTALLED_OR_RUN:f.WEB_LIBRARY_NOT_INSTALLED_OR_RUN,this.m_language);break;case et.ERROR_LIBRARY_VERSION_NOT_SUPPORTED:i+=f.getString(f.WEB_LIBRARY_INSTALLED_VERSION_NOT_SUPPORTED,this.m_language),r=!1,this.m_errorResult=null;break;default:i+=et.getErrorDescriptionEx(t.GetErrorCode(),this.m_language)+"."}i+="<br><br>",null!=n.GetInstallURL()?(t.GetErrorCode()==et.ERROR_LIBRARY_VERSION_NOT_SUPPORTED?i+='<div><a style="text-indent:18px" href="'+n.GetUpdateURL()+'">'+f.getString(f.WEB_LIBRARY_UPDATE_PACKAGE,this.m_language)+"</a></div>":i+=e?'<div><a style="text-indent:18px" href="'+n.GetWebExtensionInstallURL()+'">'+f.getString(f.WEB_LIBRARY_WEB_EXTENSION_INSTALL_PACKAGE,this.m_language)+"</a></div>":'<div><a style="text-indent:18px" href="'+n.GetInstallURL()+'">'+f.getString(f.WEB_LIBRARY_INSTALL_PACKAGE,this.m_language)+"</a></div>",i+='<div><a style="text-indent:18px" href="'+n.GetHelpURL()+'">'+f.getString(f.WEB_LIBRARY_USER_MANUAL,this.m_language)+"</a></div>"):i+="<div>"+f.getString(f.WEB_LIBRARY_OS_NOT_SUPPORTED,this.m_language)+"</div>",this._onLoadError(r,i,t.GetErrorCode(),n)},_.prototype._loadWebLibrary=function(){var t=this;t.m_library.Load((function(){t._onLoad()}),(function(e){t._onLoadWebLibraryError(e)}))},_.prototype._loadSignAgent=function(){if(this._appendWebWrapperObject("localhost","http:"==window.location.protocol?"8081":"8083",!1,!1))this._loadWebLibrary();else{var t=et.getErrorDescriptionEx(et.ERROR_LIBRARY_COMUNICATION_FAILED,this.m_language);this._onLoadError(!0,t,et.ERROR_LIBRARY_COMUNICATION_FAILED,null)}},_.prototype._loadWebExtension=function(){if(this._appendWebWrapperObject("chrome-extension://jffafkigfgmjafhpkoibhfefeaebmccg/","",!1,!1))this._loadWebLibrary();else{var t=et.getErrorDescriptionEx(et.ERROR_LIBRARY_COMUNICATION_FAILED,this.m_language);this._onLoadError(!0,t,et.ERROR_LIBRARY_COMUNICATION_FAILED,null)}},_.prototype._loadPlugin=function(t,e,n,r){if(this._appendWebWrapperObject(t,"",!0,r))this._waitForPluginLoad(this,e,n);else{var i=et.getErrorDescriptionEx(et.ERROR_LIBRARY_COMUNICATION_FAILED,this.m_language);this._onLoadError(!0,i,et.ERROR_LIBRARY_COMUNICATION_FAILED,null)}},_.prototype._waitForPluginLoad=function(t,e,n){t.m_library.Load((function(){t._onLoad()}),(function(r){r.GetErrorCode()!=et.ERROR_LIBRARY_COMUNICATION_FAILED||0==n?t._onLoadWebLibraryError(r):setTimeout((function(){t._waitForPluginLoad(t,e,n-1)}),e,n)}))},_.prototype._loadNPAPI=function(){this._loadPlugin("application/x-eusign-cp",100,50,!1)},_.prototype._loadActiveX=function(){this._loadPlugin("clsid:B7E24C75-E343-4DA2-A8D3-C80970FB7D7B",100,50,!0)};var p=function(){this.vendor="JSC IIT",this.parentClassName="Object",this.className="EndUserArrayList",this.classVersion=1,this.m_array=[]};p.prototype.add=function(t){return this.m_array.push(t),!0},p.prototype.clear=function(){this.m_array=[]},p.prototype.get=function(t){return this.m_array[t]},p.prototype.size=function(){return this.m_array.length},Object.create||(Object.create=function(t,e){if("object"!=typeof t&&"function"!=typeof t||null===t||void 0!==e)throw new Error("Invalid arguments");function n(){}return n.prototype=t,new n}),Uint8Array.prototype.slice||(Uint8Array.prototype.slice=Uint8Array.prototype.subarray);var h=null;function E(t){return null!=t&&"object"==typeof t&&("EndUserTransferableObject"==t.className||"EndUserTransferableObject"==t.parentClassName)}h="undefined"==typeof Uint8Array?function(t){var e;if("number"==typeof t){e=new Array(t);for(var n=0;n<t;++n)e[n]=0}else e=t.slice(0);return e.buffer=e,e.subarray=function(t,n){return e.slice(t,n)},e.set=function(t,n){arguments.length<2&&(n=0);for(var r=0,i=t.length;r<i;++r,++n)e[n]=255&t[r]},e.byteLength=e.length,"object"==typeof t&&t.buffer&&(e.buffer=t.buffer),e}:Uint8Array;var y=function(){this.vendor="JSC IIT",this.parentClassName="Object",this.className="EndUserTransferableObject",this.classVersion=1,this.isFilled=!1,this.fields={}};y.makeTransferable=function(t){var e,n;n=y,(e=t).prototype=Object.create(n.prototype),e.prototype.constructor=e,y[(new t).className]=t},y.prototype.base64Coder=new s,y.prototype.dateCoder=new o,y.prototype.setClassInfo=function(t,e){this.parentClassName="EndUserTransferableObject",this.className=t,this.classVersion=e},y.prototype.initializeFields=function(){for(var t in this.fields)switch(this.fields[t]){case"boolean":this[t]=!1;break;case"int":case"long":case"number":this[t]=0;break;case"string":this[t]="";break;case"EndUserKeyMedia":this[t]=new C;break;default:this[t]=null}},y.prototype.set=function(t){if(this.className!=t.className)throw"invalid class";for(var e in this.fields)this[e]=t[e]},y.prototype.encode=function(){var t,e;for(var n in e=new Object,t=new Object,this.fields)null!=this[n]?E(this[n])?e[n]=this[n].encode():"byteArray"==this.fields[n]?e[n]=this.base64Coder.encode(this[n]):"time"==this.fields[n]?e[n]=this.dateCoder.encode(this[n]):e[n]=this[n]:e[n]=null;return t.className=this.className,t.classVersion=this.classVersion,t.classFields=e,t},y.prototype.decode=function(t){try{if(null==t.classVersion||null==t.classFields)return!1;var e=t.classFields;for(var n in this.fields)if("time"==this.fields[n])this[n]=this.dateCoder.decode(e[n]);else if("EndUserOwnerInfo"==this.fields[n])this[n]=new D,this[n].decode(e[n]);else if("EndUserTimeInfo"==this.fields[n])this[n]=new O,this[n].decode(e[n]);else if("EndUserKeyMedia"==this.fields[n])this[n]=new C,this[n].decode(e[n]);else if("EndUserCertificateInfoEx"==this.fields[n])this[n]=new M,this[n].decode(e[n]);else if("byteArray"==this.fields[n])null!=e[n]&&(this[n]=this.base64Coder.decode(e[n]));else if("array"==this.fields[n]){this[n]=[];for(var r=e[n],i=0;i<r.length;i++){var o=r[i].className,s=new y[o];if(void 0!==s){if(!s.decode(r[i]))throw"invalid class";"EndUserByteArray"==s.className&&(s=s.GetData()),this[n].push(s)}else this[n].push(r[i])}}else this[n]=e[n];return!0}catch(t){return this.isFilled=!1,!1}};var S=function(t){this.setClassInfo("EndUserByteArray",1),this.fields={data:"byteArray"},this.initializeFields(),this.data=t};y.makeTransferable(S),S.prototype.GetData=function(){return this.data},S.prototype.SetData=function(t){this.data=t};var C=function(){this.setClassInfo("EndUserKeyMedia",1),this.fields={typeIndex:"long",devIndex:"long",password:"string"},this.initializeFields()};y.makeTransferable(C),C.prototype.GetTypeIndex=function(){return this.typeIndex},C.prototype.SetTypeIndex=function(t){this.typeIndex=t},C.prototype.GetDevIndex=function(){return this.devIndex},C.prototype.SetDevIndex=function(t){this.devIndex=t},C.prototype.GetPassword=function(){return this.password},C.prototype.SetPassword=function(t){this.password=t};var d=function(){this.setClassInfo("EndUserFileStoreSettings",1),this.fields={path:"string",checkCRLs:"boolean",autoRefresh:"boolean",ownCRLsOnly:"boolean",fullAndDeltaCRLs:"boolean",autoDownloadCRLs:"boolean",saveLoadedCerts:"boolean",expireTime:"long"},this.initializeFields(),this.expireTime=3600};y.makeTransferable(d),d.prototype.GetPath=function(){return this.path},d.prototype.SetPath=function(t){this.path=t},d.prototype.GetCheckCRLs=function(){return this.checkCRLs},d.prototype.SetCheckCRLs=function(t){this.checkCRLs=t},d.prototype.GetAutoRefresh=function(){return this.autoRefresh},d.prototype.SetAutoRefresh=function(t){this.autoRefresh=t},d.prototype.GetOwnCRLsOnly=function(){return this.ownCRLsOnly},d.prototype.SetOwnCRLsOnly=function(t){this.ownCRLsOnly=t},d.prototype.GetFullAndDeltaCRLs=function(){return this.fullAndDeltaCRLs},d.prototype.SetFullAndDeltaCRLs=function(t){this.fullAndDeltaCRLs=t},d.prototype.GetAutoDownloadCRLs=function(){return this.autoDownloadCRLs},d.prototype.SetAutoDownloadCRLs=function(t){this.autoDownloadCRLs=t},d.prototype.GetSaveLoadedCerts=function(){return this.saveLoadedCerts},d.prototype.SetSaveLoadedCerts=function(t){this.saveLoadedCerts=t},d.prototype.GetExpireTime=function(){return this.expireTime},d.prototype.SetExpireTime=function(t){this.expireTime=t};var A=function(){this.setClassInfo("EndUserProxySettings",1),this.fields={useProxy:"boolean",anonymous:"boolean",address:"string",port:"string",user:"string",password:"string",savePassword:"boolean"},this.initializeFields(),this.port="80"};y.makeTransferable(A),A.prototype.GetUseProxy=function(){return this.useProxy},A.prototype.SetUseProxy=function(t){this.useProxy=t},A.prototype.GetAnonymous=function(){return this.anonymous},A.prototype.SetAnonymous=function(t){this.anonymous=t},A.prototype.GetAddress=function(){return this.address},A.prototype.SetAddress=function(t){this.address=t},A.prototype.GetPort=function(){return this.port},A.prototype.SetPort=function(t){this.port=t},A.prototype.GetUser=function(){return this.user},A.prototype.SetUser=function(t){this.user=t},A.prototype.GetPassword=function(){return this.password},A.prototype.SetPassword=function(t){this.password=t},A.prototype.GetSavePassword=function(){return this.savePassword},A.prototype.SetSavePassword=function(t){this.savePassword=t};var R=function(){this.setClassInfo("EndUserTSPSettings",1),this.fields={getStamps:"boolean",address:"string",port:"string"},this.initializeFields(),this.port="80"};y.makeTransferable(R),R.prototype.GetGetStamps=function(){return this.getStamps},R.prototype.SetGetStamps=function(t){this.getStamps=t},R.prototype.GetAddress=function(){return this.address},R.prototype.SetAddress=function(t){this.address=t},R.prototype.GetPort=function(){return this.port},R.prototype.SetPort=function(t){this.port=t};var m=function(){this.setClassInfo("EndUserOCSPSettings",1),this.fields={useOCSP:"boolean",beforeStore:"boolean",address:"string",port:"string"},this.initializeFields(),this.port="80"};y.makeTransferable(m),m.prototype.GetUseOCSP=function(){return this.useOCSP},m.prototype.SetUseOCSP=function(t){this.useOCSP=t},m.prototype.GetBeforeStore=function(){return this.beforeStore},m.prototype.SetBeforeStore=function(t){this.beforeStore=t},m.prototype.GetAddress=function(){return this.address},m.prototype.SetAddress=function(t){this.address=t},m.prototype.GetPort=function(){return this.port},m.prototype.SetPort=function(t){this.port=t};var T=function(){this.setClassInfo("EndUserLDAPSettings",1),this.fields={useLDAP:"boolean",address:"string",port:"string",anonymous:"boolean",user:"string",password:"string"},this.initializeFields(),this.port="389"};y.makeTransferable(T),T.prototype.GetUseLDAP=function(){return this.useLDAP},T.prototype.SetUseLDAP=function(t){this.useLDAP=t},T.prototype.GetAddress=function(){return this.address},T.prototype.SetAddress=function(t){this.address=t},T.prototype.GetPort=function(){return this.port},T.prototype.SetPort=function(t){this.port=t},T.prototype.GetAnonymous=function(){return this.anonymous},T.prototype.SetAnonymous=function(t){this.anonymous=t},T.prototype.GetUser=function(){return this.user},T.prototype.SetUser=function(t){this.user=t},T.prototype.GetPassword=function(){return this.password},T.prototype.SetPassword=function(t){this.password=t};var g=function(){this.setClassInfo("EndUserCMPSettings",1),this.fields={useCMP:"boolean",address:"string",port:"string",commonName:"string"},this.initializeFields(),this.port="80"};y.makeTransferable(g),g.prototype.GetUseCMP=function(){return this.useCMP},g.prototype.SetUseCMP=function(t){this.useCMP=t},g.prototype.GetAddress=function(){return this.address},g.prototype.SetAddress=function(t){this.address=t},g.prototype.GetPort=function(){return this.port},g.prototype.SetPort=function(t){this.port=t},g.prototype.GetCommonName=function(){return this.commonName},g.prototype.SetCommonName=function(t){this.commonName=t};var P=function(){this.setClassInfo("EndUserModeSettings",1),this.fields={offlineMode:"boolean"},this.initializeFields()};y.makeTransferable(P),P.prototype.GetOfflineMode=function(){return this.offlineMode},P.prototype.SetOfflineMode=function(t){this.offlineMode=t};var v=function(){this.setClassInfo("EndUserOCSPAccessInfoModeSettings",1),this.fields={enabled:"boolean"},this.initializeFields()};y.makeTransferable(v),v.prototype.GetEnabled=function(){return this.enabled},v.prototype.SetEnabled=function(t){this.enabled=t};var I=function(){this.setClassInfo("EndUserOCSPAccessInfoSettings",1),this.fields={issuerCN:"string",address:"string",port:"string"},this.initializeFields()};y.makeTransferable(I),I.prototype.GetIssuerCN=function(){return this.issuerCN},I.prototype.SetIssuerCN=function(t){this.issuerCN=t},I.prototype.GetAddress=function(){return this.address},I.prototype.SetAddress=function(t){this.address=t},I.prototype.GetPort=function(){return this.port},I.prototype.SetPort=function(t){this.port=t};var U=function(){this.setClassInfo("EndUserKeyMediaSettings",1),this.fields={sourceType:"long",showErrors:"boolean",keyMedia:"EndUserKeyMedia"},this.initializeFields(),this.sourceType=1,this.showErrors=!0};y.makeTransferable(U),U.prototype.GetSourceType=function(){return this.sourceType},U.prototype.SetSourceType=function(t){this.sourceType=t},U.prototype.GetShowErrors=function(){return this.showErrors},U.prototype.SetShowErrors=function(t){this.showErrors=t},U.prototype.GetKeyMedia=function(){return this.keyMedia},U.prototype.SetKeyMedia=function(t){this.keyMedia=t};var b=function(){this.setClassInfo("EndUserTSLSettings",1),this.fields={useTSL:"boolean",autoDownloadTSL:"boolean",tslAddress:"string"},this.initializeFields()};y.makeTransferable(b),b.prototype.GetUseTSL=function(){return this.useTSL},b.prototype.SetUseTSL=function(t){this.useTSL=t},b.prototype.GetAutoDownloadTSL=function(){return this.autoDownloadTSL},b.prototype.SetAutoDownloadTSL=function(t){this.autoDownloadTSL=t},b.prototype.GetTSLAddress=function(){return this.tslAddress},b.prototype.SetTSLAddress=function(t){this.tslAddress=t};var D=function(){this.setClassInfo("EndUserOwnerInfo",1),this.fields={isFilled:"boolean",issuer:"string",issuerCN:"string",serial:"string",subject:"string",subjCN:"string",subjOrg:"string",subjOrgUnit:"string",subjTitle:"string",subjState:"string",subjLocality:"string",subjFullName:"string",subjAddress:"string",subjPhone:"string",subjEMail:"string",subjDNS:"string",subjEDRPOUCode:"string",subjDRFOCode:"string"},this.initializeFields()};y.makeTransferable(D),D.prototype.IsFilled=function(){return this.isFilled},D.prototype.GetIssuer=function(){return this.issuer},D.prototype.GetIssuerCN=function(){return this.issuerCN},D.prototype.GetSerial=function(){return this.serial},D.prototype.GetSubject=function(){return this.subject},D.prototype.GetSubjCN=function(){return this.subjCN},D.prototype.GetSubjOrg=function(){return this.subjOrg},D.prototype.GetSubjOrgUnit=function(){return this.subjOrgUnit},D.prototype.GetSubjTitle=function(){return this.subjTitle},D.prototype.GetSubjState=function(){return this.subjState},D.prototype.GetSubjLocality=function(){return this.subjLocality},D.prototype.GetSubjFullName=function(){return this.subjFullName},D.prototype.GetSubjAddress=function(){return this.subjAddress},D.prototype.GetSubjPhone=function(){return this.subjPhone},D.prototype.GetSubjEMail=function(){return this.subjEMail},D.prototype.GetSubjDNS=function(){return this.subjDNS},D.prototype.GetSubjEDRPOUCode=function(){return this.subjEDRPOUCode},D.prototype.GetSubjDRFOCode=function(){return this.subjDRFOCode};var O=function(){this.setClassInfo("EndUserTimeInfo",2),this.fields={version:"number",isTimeAvail:"boolean",isTimeStamp:"boolean",time:"time",isSignTimeStampAvail:"boolean",signTimeStamp:"time"},this.initializeFields()};y.makeTransferable(O),O.prototype.GetVersion=function(){return this.version},O.prototype.IsTimeAvail=function(){return this.isTimeAvail},O.prototype.IsTimeStamp=function(){return this.isTimeStamp},O.prototype.GetTime=function(){return this.time},O.prototype.IsSignTimeStampAvail=function(){return this.isSignTimeStampAvail},O.prototype.GetSignTimeStamp=function(){return this.signTimeStamp};var G=function(){this.setClassInfo("EndUserSignInfo",1),this.fields={ownerInfo:"EndUserOwnerInfo",timeInfo:"EndUserTimeInfo",data:"byteArray"},this.initializeFields()};y.makeTransferable(G),G.prototype.GetOwnerInfo=function(){return this.ownerInfo},G.prototype.GetTimeInfo=function(){return this.timeInfo},G.prototype.GetData=function(){return this.data},G.prototype.GetDataString=function(t){return i.ArrayToString(t,this.data)};var N=function(){this.setClassInfo("EndUserSenderInfo",1),this.fields={ownerInfo:"EndUserOwnerInfo",timeInfo:"EndUserTimeInfo",data:"byteArray"},this.initializeFields()};y.makeTransferable(N),N.prototype.GetOwnerInfo=function(){return this.ownerInfo},N.prototype.GetTimeInfo=function(){return this.timeInfo},N.prototype.GetData=function(){return this.data},N.prototype.GetDataString=function(t){return i.ArrayToString(t,this.data)};var w=function(){this.setClassInfo("EndUserCertificateInfo",1),this.fields={isFilled:"boolean",version:"long",issuer:"string",issuerCN:"string",serial:"string",subject:"string",subjCN:"string",subjOrg:"string",subjOrgUnit:"string",subjTitle:"string",subjState:"string",subjLocality:"string",subjFullName:"string",subjAddress:"string",subjPhone:"string",subjEMail:"string",subjDNS:"string",subjEDRPOUCode:"string",subjDRFOCode:"string",subjNBUCode:"string",subjSPFMCode:"string",subjOCode:"string",subjOUCode:"string",subjUserCode:"string",certBeginTime:"time",certEndTime:"time",isPrivKeyTimesAvail:"boolean",privKeyBeginTime:"time",privKeyEndTime:"time",publicKeyBits:"long",publicKey:"string",publicKeyID:"string",isECDHPublicKeyAvail:"boolean",ECDHPublicKeyBits:"long",ECDHPublicKey:"string",ECDHPublicKeyID:"string",issuerPublicKeyID:"string",keyUsage:"string",extKeyUsages:"string",policies:"string",crlDistribPoint1:"string",crlDistribPoint2:"string",isPowerCert:"boolean",isSubjTypeAvail:"boolean",isSubjCA:"boolean"},this.initializeFields()};y.makeTransferable(w),w.prototype.IsFilled=function(){return this.isFilled},w.prototype.GetVersion=function(){return this.version},w.prototype.GetIssuer=function(){return this.issuer},w.prototype.GetIssuerCN=function(){return this.issuerCN},w.prototype.GetSerial=function(){return this.serial},w.prototype.GetSubject=function(){return this.subject},w.prototype.GetSubjCN=function(){return this.subjCN},w.prototype.GetSubjOrg=function(){return this.subjOrg},w.prototype.GetSubjOrgUnit=function(){return this.subjOrgUnit},w.prototype.GetSubjTitle=function(){return this.subjTitle},w.prototype.GetSubjState=function(){return this.subjState},w.prototype.GetSubjLocality=function(){return this.subjLocality},w.prototype.GetSubjFullName=function(){return this.subjFullName},w.prototype.GetSubjAddress=function(){return this.subjAddress},w.prototype.GetSubjPhone=function(){return this.subjPhone},w.prototype.GetSubjEMail=function(){return this.subjEMail},w.prototype.GetSubjDNS=function(){return this.subjDNS},w.prototype.GetSubjEDRPOUCode=function(){return this.subjEDRPOUCode},w.prototype.GetSubjDRFOCode=function(){return this.subjDRFOCode},w.prototype.GetSubjNBUCode=function(){return this.subjNBUCode},w.prototype.GetSubjSPFMCode=function(){return this.subjSPFMCode},w.prototype.GetSubjOCode=function(){return this.subjOCode},w.prototype.GetSubjOUCode=function(){return this.subjOUCode},w.prototype.GetSubjUserCode=function(){return this.subjUserCode},w.prototype.GetCertBeginTime=function(){return this.certBeginTime},w.prototype.GetCertEndTime=function(){return this.certEndTime},w.prototype.IsPrivKeyTimesAvail=function(){return this.isPrivKeyTimesAvail},w.prototype.GetPrivKeyBeginTime=function(){return this.privKeyBeginTime},w.prototype.GetPrivKeyEndTime=function(){return this.privKeyEndTime},w.prototype.GetPublicKeyBits=function(){return this.publicKeyBits},w.prototype.GetPublicKey=function(){return this.publicKey},w.prototype.GetPublicKeyID=function(){return this.publicKeyID},w.prototype.IsECDHPublicKeyAvail=function(){return this.isECDHPublicKeyAvail},w.prototype.GetECDHPublicKeyBits=function(){return this.ECDHPublicKeyBits},w.prototype.GetECDHPublicKey=function(){return this.ECDHPublicKey},w.prototype.GetECDHPublicKeyID=function(){return this.ECDHPublicKeyID},w.prototype.GetIssuerPublicKeyID=function(){return this.issuerPublicKeyID},w.prototype.GetKeyUsage=function(){return this.keyUsage},w.prototype.GetExtKeyUsages=function(){return this.extKeyUsages},w.prototype.GetPolicies=function(){return this.policies},w.prototype.GetCRLDistribPoint1=function(){return this.crlDistribPoint1},w.prototype.GetCRLDistribPoint2=function(){return this.crlDistribPoint2},w.prototype.IsPowerCert=function(){return this.isPowerCert},w.prototype.IsSubjTypeAvail=function(){return this.isSubjTypeAvail},w.prototype.IsSubjCA=function(){return this.isSubjCA};var M=function(){this.setClassInfo("EndUserCertificateInfoEx",8),this.fields={isFilled:"boolean",version:"long",issuer:"string",issuerCN:"string",serial:"string",subject:"string",subjCN:"string",subjOrg:"string",subjOrgUnit:"string",subjTitle:"string",subjState:"string",subjLocality:"string",subjFullName:"string",subjAddress:"string",subjPhone:"string",subjEMail:"string",subjDNS:"string",subjEDRPOUCode:"string",subjDRFOCode:"string",subjNBUCode:"string",subjSPFMCode:"string",subjOCode:"string",subjOUCode:"string",subjUserCode:"string",certBeginTime:"time",certEndTime:"time",isPrivKeyTimesAvail:"boolean",privKeyBeginTime:"time",privKeyEndTime:"time",publicKeyBits:"long",publicKey:"string",publicKeyID:"string",issuerPublicKeyID:"string",keyUsage:"string",extKeyUsages:"string",policies:"string",crlDistribPoint1:"string",crlDistribPoint2:"string",isPowerCert:"boolean",isSubjTypeAvail:"boolean",isSubjCA:"boolean",chainLength:"int",UPN:"string",publicKeyType:"long",keyUsageType:"long",RSAModul:"string",RSAExponent:"string",OCSPAccessInfo:"string",issuerAccessInfo:"string",TSPAccessInfo:"string",isLimitValueAvailable:"boolean",limitValue:"long",limitValueCurrency:"string",subjType:"long",subjSubType:"long",subjUNZR:"string",subjCountry:"string",fingerprint:"string",isQSCD:"boolean",subjUserID:"string",certHashType:"number"},this.initializeFields();var t=this;this.IsLimitValueAvailable=function(){return t.isLimitValueAvailable}};y.makeTransferable(M),M.prototype.IsFilled=function(){return this.isFilled},M.prototype.GetVersion=function(){return this.version},M.prototype.GetIssuer=function(){return this.issuer},M.prototype.GetIssuerCN=function(){return this.issuerCN},M.prototype.GetSerial=function(){return this.serial},M.prototype.GetSubject=function(){return this.subject},M.prototype.GetSubjCN=function(){return this.subjCN},M.prototype.GetSubjOrg=function(){return this.subjOrg},M.prototype.GetSubjOrgUnit=function(){return this.subjOrgUnit},M.prototype.GetSubjTitle=function(){return this.subjTitle},M.prototype.GetSubjState=function(){return this.subjState},M.prototype.GetSubjLocality=function(){return this.subjLocality},M.prototype.GetSubjFullName=function(){return this.subjFullName},M.prototype.GetSubjAddress=function(){return this.subjAddress},M.prototype.GetSubjPhone=function(){return this.subjPhone},M.prototype.GetSubjEMail=function(){return this.subjEMail},M.prototype.GetSubjDNS=function(){return this.subjDNS},M.prototype.GetSubjEDRPOUCode=function(){return this.subjEDRPOUCode},M.prototype.GetSubjDRFOCode=function(){return this.subjDRFOCode},M.prototype.GetSubjNBUCode=function(){return this.subjNBUCode},M.prototype.GetSubjSPFMCode=function(){return this.subjSPFMCode},M.prototype.GetSubjOCode=function(){return this.subjOCode},M.prototype.GetSubjOUCode=function(){return this.subjOUCode},M.prototype.GetSubjUserCode=function(){return this.subjUserCode},M.prototype.GetCertBeginTime=function(){return this.certBeginTime},M.prototype.GetCertEndTime=function(){return this.certEndTime},M.prototype.IsPrivKeyTimesAvail=function(){return this.isPrivKeyTimesAvail},M.prototype.GetPrivKeyBeginTime=function(){return this.privKeyBeginTime},M.prototype.GetPrivKeyEndTime=function(){return this.privKeyEndTime},M.prototype.GetPublicKeyBits=function(){return this.publicKeyBits},M.prototype.GetPublicKey=function(){return this.publicKey},M.prototype.GetPublicKeyID=function(){return this.publicKeyID},M.prototype.GetIssuerPublicKeyID=function(){return this.issuerPublicKeyID},M.prototype.GetKeyUsage=function(){return this.keyUsage},M.prototype.GetExtKeyUsages=function(){return this.extKeyUsages},M.prototype.GetPolicies=function(){return this.policies},M.prototype.GetCRLDistribPoint1=function(){return this.crlDistribPoint1},M.prototype.GetCRLDistribPoint2=function(){return this.crlDistribPoint2},M.prototype.IsPowerCert=function(){return this.isPowerCert},M.prototype.IsSubjTypeAvail=function(){return this.isSubjTypeAvail},M.prototype.IsSubjCA=function(){return this.isSubjCA},M.prototype.GetChainLength=function(){return this.chainLength},M.prototype.GetUPN=function(){return this.UPN},M.prototype.GetPublicKeyType=function(){return this.publicKeyType},M.prototype.GetKeyUsageType=function(){return this.keyUsageType},M.prototype.GetRSAModul=function(){return this.RSAModul},M.prototype.GetRSAExponent=function(){return this.RSAExponent},M.prototype.GetOCSPAccessInfo=function(){return this.OCSPAccessInfo},M.prototype.GetIssuerAccessInfo=function(){return this.issuerAccessInfo},M.prototype.GetTSPAccessInfo=function(){return this.TSPAccessInfo},M.prototype.IsLimitValueAvail=function(){return this.isLimitValueAvailable},M.prototype.GetLimitValue=function(){return this.limitValue},M.prototype.GetLimitValueCurrency=function(){return this.limitValueCurrency},M.prototype.GetSubjType=function(){return this.subjType},M.prototype.GetSubjSubType=function(){return this.subjSubType},M.prototype.GetSubjUNZR=function(){return this.subjUNZR},M.prototype.GetSubjCountry=function(){return this.subjCountry},M.prototype.GetFingerprint=function(){return this.fingerprint},M.prototype.IsQSCD=function(){return this.isQSCD},M.prototype.GetSubjUserID=function(){return this.subjUserID},M.prototype.GetCertHashType=function(){return this.certHashType};var L=function(){this.setClassInfo("EndUserCertificate",1),this.fields={infoEx:"EndUserCertificateInfoEx",data:"byteArray"},this.initializeFields()};y.makeTransferable(L),L.prototype.GetInfoEx=function(){return this.infoEx},L.prototype.SetInfoEx=function(t){this.infoEx=t},L.prototype.GetData=function(){return this.data},L.prototype.SetData=function(t){this.data=t};var K=function(){this.setClassInfo("EndUserCRLInfo",1,!0,!1),this.fields={isFilled:"boolean",issuer:"string",issuerCN:"string",crlNumber:"long",thisUpdate:"time",nextUpdate:"time"},this.initializeFields()};y.makeTransferable(K),K.prototype.IsFilled=function(){return this.isFilled},K.prototype.GetIssuer=function(){return this.issuer},K.prototype.GetIssuerCN=function(){return this.issuerCN},K.prototype.GetCRLNumber=function(){return this.crlNumber},K.prototype.GetThisUpdate=function(){return this.thisUpdate},K.prototype.GetNextUpdate=function(){return this.nextUpdate};var k=function(){this.setClassInfo("EndUserCRLDetailedInfo",1),this.fields={isFilled:"boolean",version:"long",issuer:"string",issuerCN:"string",issuerPublicKeyID:"string",crlNumber:"long",thisUpdate:"time",nextUpdate:"time",revokedItemsCount:"long"},this.initializeFields()};y.makeTransferable(k),k.prototype.IsFilled=function(){return this.isFilled},k.prototype.GetVersion=function(){return this.version},k.prototype.GetIssuer=function(){return this.issuer},k.prototype.GetIssuerCN=function(){return this.issuerCN},k.prototype.GetIssuerPublicKeyID=function(){return this.issuerPublicKeyID},k.prototype.GetCRLNumber=function(){return this.crlNumber},k.prototype.GetThisUpdate=function(){return this.thisUpdate},k.prototype.GetNextUpdate=function(){return this.nextUpdate},k.prototype.GetRevokedItemsCount=function(){return this.revokedItemsCount};var x=function(){this.setClassInfo("EndUserPrivateKeyInfo",1),this.fields={privateKey:"byteArray",privateKeyInfo:"byteArray"},this.initializeFields()};y.makeTransferable(x),x.prototype.GetPrivateKey=function(){return this.privateKey},x.prototype.SetPrivateKey=function(t){this.privateKey=t},x.prototype.GetPrivateKeyInfo=function(){return this.privateKeyInfo},x.prototype.SetPrivateKeyInfo=function(t){this.privateKeyInfo=t};var B=function(){this.setClassInfo("EndUserJKSPrivateKey",1),this.fields={privateKey:"byteArray",certificates:"array"},this.initializeFields()};y.makeTransferable(B),B.prototype.GetPrivateKey=function(){return this.privateKey},B.prototype.GetCertificate=function(t){return t<0||t>=this.certificates.length?null:this.certificates[t]},B.prototype.GetCertificatesCount=function(){return this.certificates.length},B.prototype.GetCertificates=function(){return this.certificates};var F=function(){this.setClassInfo("EndUserRequestInfo",4),this.fields={request:"byteArray",requestType:"number",defaultRequestFileName:"string",isSimple:"boolean",subject:"string",subjCN:"string",subjOrg:"string",subjOrgUnit:"string",subjTitle:"string",subjState:"string",subjLocality:"string",subjFullName:"string",subjAddress:"string",subjPhone:"string",subjEMail:"string",subjDNS:"string",subjEDRPOUCode:"string",subjDRFOCode:"string",subjNBUCode:"string",subjSPFMCode:"string",subjOCode:"string",subjOUCode:" string",subjUserCode:"string",certBeginTime:"time",certEndTime:"time",isPrivKeyTimesAvail:"boolean",privKeyBeginTime:"time",privKeyEndTime:"time",publicKeyType:"number",publicKeyBits:"number",RSAModul:"string",RSAExponent:"string",publicKey:"string",publicKeyID:"string",extKeyUsages:"string",crlDistribPoint1:"string",crlDistribPoint2:"string",isSubjTypeAvail:"boolean",subjType:"number",subjSubType:"number",isSelfSigned:"boolean",signIssuer:"string",signSerial:"string",subjUNZR:"string",subjCountry:"string",isQSCD:"boolean"},this.initializeFields()};y.makeTransferable(F),F.prototype.GetRequest=function(){return this.request},F.prototype.GetRequestType=function(){return this.requestType},F.prototype.GetDefaultRequestFileName=function(){return this.defaultRequestFileName},F.prototype.IsSimple=function(){return this.isSimple},F.prototype.GetSubject=function(){return this.subject},F.prototype.GetSubjCN=function(){return this.subjCN},F.prototype.GetSubjOrg=function(){return this.subjOrg},F.prototype.GetSubjOrgUnit=function(){return this.subjOrgUnit},F.prototype.GetSubjTitle=function(){return this.subjTitle},F.prototype.GetSubjState=function(){return this.subjState},F.prototype.GetSubjLocality=function(){return this.subjLocality},F.prototype.GetSubjFullName=function(){return this.subjFullName},F.prototype.GetSubjAddress=function(){return this.subjAddress},F.prototype.GetSubjPhone=function(){return this.subjPhone},F.prototype.GetSubjEMail=function(){return this.subjEMail},F.prototype.GetSubjDNS=function(){return this.subjDNS},F.prototype.GetSubjEDRPOUCode=function(){return this.subjEDRPOUCode},F.prototype.GetSubjDRFOCode=function(){return this.subjDRFOCode},F.prototype.GetSubjNBUCode=function(){return this.subjNBUCode},F.prototype.GetSubjSPFMCode=function(){return this.subjSPFMCode},F.prototype.GetSubjOCode=function(){return this.subjOCode},F.prototype.GetSubjOUCode=function(){return this.subjOUCode},F.prototype.GetSubjUserCode=function(){return this.subjUserCode},F.prototype.GetCertBeginTime=function(){return this.certBeginTime},F.prototype.GetCertEndTime=function(){return this.certEndTime},F.prototype.IsPrivKeyTimesAvail=function(){return this.isPrivKeyTimesAvail},F.prototype.GetPrivKeyBeginTime=function(){return this.privKeyBeginTime},F.prototype.GetPrivKeyEndTime=function(){return this.privKeyEndTime},F.prototype.GetPublicKeyType=function(){return this.publicKeyType},F.prototype.GetPublicKeyBits=function(){return this.publicKeyBits},F.prototype.GetRSAModul=function(){return this.RSAModul},F.prototype.GetRSAExponent=function(){return this.RSAExponent},F.prototype.GetPublicKey=function(){return this.publicKey},F.prototype.GetPublicKeyID=function(){return this.publicKeyID},F.prototype.GetExtKeyUsages=function(){return this.extKeyUsages},F.prototype.GetCRLDistribPoint1=function(){return this.crlDistribPoint1},F.prototype.GetCRLDistribPoint2=function(){return this.crlDistribPoint2},F.prototype.IsSubjTypeAvail=function(){return this.isSubjTypeAvail},F.prototype.GetSubjType=function(){return this.subjType},F.prototype.GetSubjSubType=function(){return this.subjSubType},F.prototype.IsSelfSigned=function(){return this.isSelfSigned},F.prototype.GetSignIssuer=function(){return this.signIssuer},F.prototype.GetSignSerial=function(){return this.signSerial},F.prototype.GetSubjUNZR=function(){return this.subjUNZR},F.prototype.GetSubjCountry=function(){return this.subjCountry},F.prototype.IsQSCD=function(){return this.isQSCD};var H=function(){this.setClassInfo("EndUserInfo",3),this.fields={commonName:"string",locality:"string",state:"string",organization:"string",orgUnit:"string",title:"string",street:"string",phone:"string",surname:"string",givenname:"string",EMail:"string",DNS:"string",EDRPOUCode:"string",DRFOCode:"string",NBUCode:"string",SPFMCode:"string",OCode:"string",OUCode:"string",userCode:"string",UPN:"string",UNZR:"string",country:"string"},this.initializeFields()};y.makeTransferable(H),H.prototype.GetCommonName=function(){return this.commonName},H.prototype.SetCommonName=function(t){this.commonName=t},H.prototype.GetLocality=function(){return this.locality},H.prototype.SetLocality=function(t){this.locality=t},H.prototype.GetState=function(){return this.state},H.prototype.SetState=function(t){this.state=t},H.prototype.GetOrganization=function(){return this.organization},H.prototype.SetOrganization=function(t){this.organization=t},H.prototype.GetOrgUnit=function(){return this.orgUnit},H.prototype.SetOrgUnit=function(t){this.orgUnit=t},H.prototype.GetTitle=function(){return this.title},H.prototype.SetTitle=function(t){this.title=t},H.prototype.GetStreet=function(){return this.street},H.prototype.SetStreet=function(t){this.street=t},H.prototype.GetPhone=function(){return this.phone},H.prototype.SetPhone=function(t){this.phone=t},H.prototype.GetSurname=function(){return this.surname},H.prototype.SetSurname=function(t){this.surname=t},H.prototype.GetGivenname=function(){return this.givenname},H.prototype.SetGivenname=function(t){this.givenname=t},H.prototype.GetEMail=function(){return this.EMail},H.prototype.SetEMail=function(t){this.EMail=t},H.prototype.GetDNS=function(){return this.DNS},H.prototype.SetDNS=function(t){this.DNS=t},H.prototype.GetEDRPOUCode=function(){return this.EDRPOUCode},H.prototype.SetEDRPOUCode=function(t){this.EDRPOUCode=t},H.prototype.GetDRFOCode=function(){return this.DRFOCode},H.prototype.SetDRFOCode=function(t){this.DRFOCode=t},H.prototype.GetNBUCode=function(){return this.NBUCode},H.prototype.SetNBUCode=function(t){this.NBUCode=t},H.prototype.GetSPFMCode=function(){return this.SPFMCode},H.prototype.SetSPFMCode=function(t){this.SPFMCode=t},H.prototype.GetOCode=function(){return this.OCode},H.prototype.SetOCode=function(t){this.OCode=t},H.prototype.GetOUCode=function(){return this.OUCode},H.prototype.SetOUCode=function(t){this.OUCode=t},H.prototype.GetUserCode=function(){return this.userCode},H.prototype.SetUserCode=function(t){this.userCode=t},H.prototype.GetUPN=function(){return this.UPN},H.prototype.SetUPN=function(t){this.UPN=t},H.prototype.GetUNZR=function(){return this.UNZR},H.prototype.SetUNZR=function(t){this.UNZR=t},H.prototype.GetCountry=function(){return this.country},H.prototype.SetCountry=function(t){this.country=t};var Y=function(){this.setClassInfo("EndUserParams",1),this.fields={SN:"number",commonName:"string",locality:"string",state:"string",organization:"string",orgUnit:"string",title:"string",street:"string",phone:"string",surname:"string",givenname:"string",EMail:"string",DNS:"string",EDRPOUCode:"string",DRFOCode:"string",NBUCode:"string",SPFMCode:"string",information:"string",passPhrase:"string",isPublishCertificate:"boolean",RAAdminSN:"number"},this.initializeFields()};y.makeTransferable(Y),Y.prototype.GetSN=function(){return this.SN},Y.prototype.SetSN=function(t){this.SN=t},Y.prototype.GetCommonName=function(){return this.commonName},Y.prototype.SetCommonName=function(t){this.commonName=t},Y.prototype.GetLocality=function(){return this.locality},Y.prototype.SetLocality=function(t){this.locality=t},Y.prototype.GetState=function(){return this.state},Y.prototype.SetState=function(t){this.state=t},Y.prototype.GetOrganization=function(){return this.organization},Y.prototype.SetOrganization=function(t){this.organization=t},Y.prototype.GetOrgUnit=function(){return this.orgUnit},Y.prototype.SetOrgUnit=function(t){this.orgUnit=t},Y.prototype.GetTitle=function(){return this.title},Y.prototype.SetTitle=function(t){this.title=t},Y.prototype.GetStreet=function(){return this.street},Y.prototype.SetStreet=function(t){this.street=t},Y.prototype.GetPhone=function(){return this.phone},Y.prototype.SetPhone=function(t){this.phone=t},Y.prototype.GetSurname=function(){return this.surname},Y.prototype.SetSurname=function(t){this.surname=t},Y.prototype.GetGivenname=function(){return this.givenname},Y.prototype.SetGivenname=function(t){this.givenname=t},Y.prototype.GetEMail=function(){return this.EMail},Y.prototype.SetEMail=function(t){this.EMail=t},Y.prototype.GetDNS=function(){return this.DNS},Y.prototype.SetDNS=function(t){this.DNS=t},Y.prototype.GetEDRPOUCode=function(){return this.EDRPOUCode},Y.prototype.SetEDRPOUCode=function(t){this.EDRPOUCode=t},Y.prototype.GetDRFOCode=function(){return this.DRFOCode},Y.prototype.SetDRFOCode=function(t){this.DRFOCode=t},Y.prototype.GetNBUCode=function(){return this.NBUCode},Y.prototype.SetNBUCode=function(t){this.NBUCode=t},Y.prototype.GetSPFMCode=function(){return this.SPFMCode},Y.prototype.SetSPFMCode=function(t){this.SPFMCode=t},Y.prototype.GetInformation=function(){return this.information},Y.prototype.SetInformation=function(t){this.information=t},Y.prototype.GetPassPhrase=function(){return this.passPhrase},Y.prototype.SetPassPhrase=function(t){this.passPhrase=t},Y.prototype.GetIsPublishCertificate=function(){return this.isPublishCertificate},Y.prototype.SetIsPublishCertificate=function(t){this.isPublishCertificate=t},Y.prototype.GetRAAdminSN=function(){return this.RAAdminSN},Y.prototype.SetRAAdminSN=function(t){this.RAAdminSN=t};var j=function(){this.setClassInfo("EndUserOperationContext",1),this.fields={handle:"string"},this.initializeFields(),this.handle=null};y.makeTransferable(j),j.prototype.GetHandle=function(){return this.handle};var V=function(){this.setClassInfo("EndUserSession",1),this.fields={handle:"string",data:"byteArray"},this.initializeFields()};y.makeTransferable(V),V.prototype.GetHandle=function(){return this.handle},V.prototype.GetData=function(){return this.data},V.prototype.SetData=function(t){this.data=t};var W=function(){this.setClassInfo("EndUserSCClientStatistic",1),this.fields={activeSessions:"number",gatedSessions:"number",unprotectedData:"number",protectedData:"number"},this.initializeFields()};y.makeTransferable(W),W.prototype.GetActiveSessions=function(){return this.activeSessions},W.prototype.GetGatedSessions=function(){return this.gatedSessions},W.prototype.GetUnprotectedData=function(){return this.unprotectedData},W.prototype.GetProtectedData=function(){return this.protectedData};var X=function(){this.setClassInfo("EndUserDeviceContext",1),this.fields={handle:"string"},this.initializeFields(),this.handle=null};y.makeTransferable(X),X.prototype.GetHandle=function(){return this.handle};var z=function(){this.setClassInfo("EndUserTransportHeader",1),this.fields={receiptNumber:"number",cryptoData:"byteArray"},this.initializeFields()};y.makeTransferable(z),z.prototype.GetReceiptNumber=function(){return this.receiptNumber},z.prototype.GetCryptoData=function(){return this.cryptoData};var J=function(){this.setClassInfo("EndUserCryptoHeader",1),this.fields={caType:"string",headerType:"number",headerSize:"number",cryptoData:"byteArray"},this.initializeFields()};y.makeTransferable(J),J.prototype.GetCAType=function(){return this.caType},J.prototype.GetHeaderType=function(){return this.headerType},J.prototype.GetHeaderSize=function(){return this.headerSize},J.prototype.GetCryptoData=function(){return this.cryptoData};var q=function(){this.setClassInfo("EndUserContext",1),this.fields={handle:"string"},this.initializeFields()};y.makeTransferable(q),q.prototype.GetHandle=function(){return this.handle};var Z=function(){this.setClassInfo("EndUserHashContext",1),this.fields={handle:"string"},this.initializeFields()};y.makeTransferable(Z),Z.prototype.GetHandle=function(){return this.handle};var Q=function(){this.setClassInfo("EndUserPrivateKeyContext",1),this.fields={handle:"string",ownerInfo:"EndUserOwnerInfo"},this.initializeFields()};y.makeTransferable(Q),Q.prototype.GetHandle=function(){return this.handle},Q.prototype.GetOwnerInfo=function(){return this.ownerInfo};var $=function(t,e){this.setClassInfo("EndUserReference",1),this.fields={name:"string",data:"byteArray"},this.initializeFields(),this.name=t,this.data=e};y.makeTransferable($),$.prototype.GetName=function(){return this.name},$.prototype.SetName=function(t){this.name=t},$.prototype.GetData=function(){return this.data},$.prototype.SetData=function(t){this.data=t};var tt=function(t,e,n,r,i){this.setClassInfo("EndUserSSSignHashResult",1),this.fields={error:"number",hash:"string",signature:"string",statusCode:"number",status:"string"},this.initializeFields(),this.error=t,this.hash=e,this.signature=n,this.statusCode=r,this.status=i};y.makeTransferable(tt),tt.prototype.GetError=function(){return this.error},tt.prototype.GetHash=function(){return this.hash},tt.prototype.GetSignature=function(){return this.signature},tt.prototype.GetStatusCode=function(){return this.statusCode},tt.prototype.GetStatus=function(){return this.status};var et=function(t,e){this.errorCode=t,this.message=e,this.toString=function(){return this.message+" ("+this.errorCode+")"},this.GetErrorCode=function(){return this.errorCode},this.GetMessage=function(){return this.message}};function nt(t,e){this.errorCode=t,this.message=e,this.toString=function(){return this.message+" ("+this.errorCode+")"},this.GetErrorCode=function(){return this.errorCode},this.GetMessage=function(){return this.message}}et.ERROR_NONE=0,et.ERROR_UNKNOWN=65535,et.ERROR_NOT_SUPPORTED=65534,et.ERROR_NOT_INITIALIZED=1,et.ERROR_BAD_PARAMETER=2,et.ERROR_LIBRARY_LOAD=3,et.ERROR_READ_SETTINGS=4,et.ERROR_TRANSMIT_REQUEST=5,et.ERROR_MEMORY_ALLOCATION=6,et.WARNING_END_OF_ENUM=7,et.ERROR_PROXY_NOT_AUTHORIZED=8,et.ERROR_NO_GUI_DIALOGS=9,et.ERROR_DOWNLOAD_FILE=10,et.ERROR_WRITE_SETTINGS=11,et.ERROR_CANCELED_BY_GUI=12,et.ERROR_OFFLINE_MODE=13,et.ERROR_KEY_MEDIAS_FAILED=17,et.ERROR_KEY_MEDIAS_ACCESS_FAILED=18,et.ERROR_KEY_MEDIAS_READ_FAILED=19,et.ERROR_KEY_MEDIAS_WRITE_FAILED=20,et.WARNING_KEY_MEDIAS_READ_ONLY=21,et.ERROR_KEY_MEDIAS_DELETE=22,et.ERROR_KEY_MEDIAS_CLEAR=23,et.ERROR_BAD_PRIVATE_KEY=24,et.ERROR_PKI_FORMATS_FAILED=33,et.ERROR_CSP_FAILED=34,et.ERROR_BAD_SIGNATURE=35,et.ERROR_AUTH_FAILED=36,et.ERROR_NOT_RECEIVER=37,et.ERROR_STORAGE_FAILED=49,et.ERROR_BAD_CERT=50,et.ERROR_CERT_NOT_FOUND=51,et.ERROR_INVALID_CERT_TIME=52,et.ERROR_CERT_IN_CRL=53,et.ERROR_BAD_CRL=54,et.ERROR_NO_VALID_CRLS=55,et.ERROR_GET_TIME_STAMP=65,et.ERROR_BAD_TSP_RESPONSE=66,et.ERROR_TSP_SERVER_CERT_NOT_FOUND=67,et.ERROR_TSP_SERVER_CERT_INVALID=68,et.ERROR_GET_OCSP_STATUS=81,et.ERROR_BAD_OCSP_RESPONSE=82,et.ERROR_CERT_BAD_BY_OCSP=83,et.ERROR_OCSP_SERVER_CERT_NOT_FOUND=84,et.ERROR_OCSP_SERVER_CERT_INVALID=85,et.ERROR_LDAP_ERROR=97,et.ERROR_LIBRARY_COMUNICATION_FAILED=4097,et.ERROR_LIBRARY_VERSION_NOT_SUPPORTED=4098,et.ERROR_BROWSER_NOT_SUPPORTED=65537,et.ERROR_OPEN_FILE=65552,et.ERROR_READ_FILE=65553,et.ERROR_WRITE_FILE=65554,et.ERROR_DESCRIPTIONS_EX=[],et.ERROR_DESCRIPTIONS_EX[et.ERROR_NONE]=["Виконано успішно","Выполнено успешно","Executed successfully"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_NOT_SUPPORTED]=["Операція не підтримується","Операция не поддерживается","Operation is not supported"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_UNKNOWN]=["Невідома помилка","Неизвестная ошибка","Unknown error"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_LIBRARY_LOAD]=["Виникла помилка при завантаженні криптографічної бібліотеки","Возникла ошибка при загрузке криптографической библиотеки","Error at load crypto library"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_NOT_INITIALIZED]=["Бібліотека не ініціалізована","Библиотека не инициализирована","Library is not initialized"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_BAD_PARAMETER]=["Невірний параметр","Неверный параметр","Incorrect parameter"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_BAD_CERT]=["Сертифікат пошкоджений або не може бути використаний","Сертификат поврежден или не может быть использован","Certificate corrupted or cannot be used"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_CERT_NOT_FOUND]=["Сертифікат не знайдено","Сертификат не найден","Certificate not found"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_TRANSMIT_REQUEST]=["Виникла помилка при передачі запиту на сервер ЦСК за протоколом HTTP","Возникла ошибка при передаче запроса на сервер ЦСК по протоколу HTTP","Error at request transfer to CA's server by HTTP protocol"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_DOWNLOAD_FILE]=["Виникла помилка при завантаженні файлу з HTTP-сервера","Возникла ошибка при загрузке файла с HTTP-сервера","Error at the load of file from a HTTP-server"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_LIBRARY_COMUNICATION_FAILED]=["Виникла помилка при взаємодії з криптографічною бібліотекою","Возникла ошибка при взаимодействии с криптографической библиотекой","Error at comunication with crypto library"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_LIBRARY_VERSION_NOT_SUPPORTED]=["Встановлена версія бібліотеки не підтримується","Установленная версия библиотеки не поддерживается","The installed version of the library is not supported"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_BROWSER_NOT_SUPPORTED]=["Ваш браузер не підтримується","Ваш браузер не поддерживается","Your browser is not supported"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_OPEN_FILE]=["Виникла помилка при відкритті файлу","Возникла ошибка при открытии файла","Error at open file"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_READ_FILE]=["Виникла помилка при зчитуванні файлу","Возникла ошибка при чтении файла","Error at read file"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_WRITE_FILE]=["Виникла помилка при записі файлу","Возникла ошибка при записи файла","Error at write file"],et.isError=function(t){return t!=et.ERROR_NONE},et.isSuccess=function(t){return t==et.ERROR_NONE},et.getErrorDescriptionEx=function(t,e){var n,r;return void 0===(n=et.ERROR_DESCRIPTIONS_EX[t])&&(n=et.ERROR_DESCRIPTIONS_EX[et.ERROR_UNKNOWN]),void 0===(r=n[e-1])?n[0]:r};var rt=function(t,n){this.vendor="JSC IIT",this.classVersion="1.3.93",this.className="EUSignCP",this.SUBJECT_TYPE_UNDIFFERENCED=0,this.SUBJECT_TYPE_CA=1,this.SUBJECT_TYPE_CA_SERVER=2,this.SUBJECT_TYPE_RA_ADMINISTRATOR=3,this.SUBJECT_TYPE_END_USER=4,this.EU_SUBJECT_TYPE_UNDIFFERENCED=this.SUBJECT_TYPE_UNDIFFERENCED,this.EU_SUBJECT_TYPE_CA=this.SUBJECT_TYPE_CA,this.EU_SUBJECT_TYPE_CA_SERVER=this.SUBJECT_TYPE_CA_SERVER,this.EU_SUBJECT_TYPE_RA_ADMINISTRATOR=this.SUBJECT_TYPE_RA_ADMINISTRATOR,this.EU_SUBJECT_TYPE_END_USER=this.SUBJECT_TYPE_END_USER,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED=0,this.SUBJECT_CA_SERVER_SUB_TYPE_CMP=1,this.SUBJECT_CA_SERVER_SUB_TYPE_TSP=2,this.SUBJECT_CA_SERVER_SUB_TYPE_OCSP=3,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED=this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_CMP=this.SUBJECT_CA_SERVER_SUB_TYPE_CMP,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_TSP=this.SUBJECT_CA_SERVER_SUB_TYPE_TSP,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_OCSP=this.SUBJECT_CA_SERVER_SUB_TYPE_OCSP,this.CERT_KEY_TYPE_UNKNOWN=0,this.CERT_KEY_TYPE_DSTU4145=1,this.CERT_KEY_TYPE_RSA=2,this.CERT_KEY_TYPE_ECDSA=4,this.EU_CERT_KEY_TYPE_UNKNOWN=this.CERT_KEY_TYPE_UNKNOWN,this.EU_CERT_KEY_TYPE_DSTU4145=this.CERT_KEY_TYPE_DSTU4145,this.EU_CERT_KEY_TYPE_RSA=this.CERT_KEY_TYPE_RSA,this.EU_CERT_KEY_TYPE_ECDSA=this.CERT_KEY_TYPE_ECDSA,this.EU_CERT_HASH_TYPE_UNKNOWN=0,this.EU_CERT_HASH_TYPE_GOST34311=1,this.EU_CERT_HASH_TYPE_SHA1=2,this.EU_CERT_HASH_TYPE_SHA224=3,this.EU_CERT_HASH_TYPE_SHA256=4,this.EU_CERT_HASH_TYPE_SHA384=5,this.EU_CERT_HASH_TYPE_SHA512=6,this.EU_CERT_HASH_TYPE_DSTU7564_256=7,this.EU_CERT_HASH_TYPE_DSTU7564_384=8,this.EU_CERT_HASH_TYPE_DSTU7564_512=9,this.KEY_USAGE_UNKNOWN=0,this.KEY_USAGE_DIGITAL_SIGNATUR=1,this.KEY_KEY_USAGE_KEY_AGREEMENT=16,this.EU_KEY_USAGE_UNKNOWN=this.KEY_USAGE_UNKNOWN,this.EU_KEY_USAGE_DIGITAL_SIGNATURE=this.KEY_USAGE_DIGITAL_SIGNATUR,this.EU_KEY_USAGE_NON_REPUDATION=2,this.EU_KEY_USAGE_KEY_AGREEMENT=this.KEY_KEY_USAGE_KEY_AGREEMENT,this.EU_KEYS_REQUEST_TYPE_UA_DS=1,this.EU_KEYS_REQUEST_TYPE_UA_KEP=2,this.EU_KEYS_REQUEST_TYPE_INTERNATIONAL=3,this.EU_KEYS_TYPE_NONE=0,this.EU_KEYS_TYPE_DSTU_AND_ECDH_WITH_GOSTS=1,this.EU_KEYS_TYPE_RSA_WITH_SHA=2,this.EU_KEYS_TYPE_ECDSA_WITH_SHA=4,this.EU_KEYS_TYPE_DSTU_AND_ECDH_WITH_DSTU=8,this.EU_KEYS_LENGTH_DS_UA_191=1,this.EU_KEYS_LENGTH_DS_UA_257=2,this.EU_KEYS_LENGTH_DS_UA_307=3,this.EU_KEYS_LENGTH_DS_UA_FILE=4,this.EU_KEYS_LENGTH_DS_UA_CERT=5,this.EU_KEYS_LENGTH_KEP_UA_257=1,this.EU_KEYS_LENGTH_KEP_UA_431=2,this.EU_KEYS_LENGTH_KEP_UA_571=3,this.EU_KEYS_LENGTH_KEP_UA_FILE=4,this.EU_KEYS_LENGTH_KEP_UA_CERT=5,this.EU_KEYS_LENGTH_DS_RSA_1024=1,this.EU_KEYS_LENGTH_DS_RSA_2048=2,this.EU_KEYS_LENGTH_DS_RSA_3072=3,this.EU_KEYS_LENGTH_DS_RSA_4096=4,this.EU_KEYS_LENGTH_DS_RSA_FILE=5,this.EU_KEYS_LENGTH_DS_RSA_CERT=6,this.EU_KEYS_LENGTH_DS_ECDSA_192=1,this.EU_KEYS_LENGTH_DS_ECDSA_256=2,this.EU_KEYS_LENGTH_DS_ECDSA_384=3,this.EU_KEYS_LENGTH_DS_ECDSA_521=4,this.EU_KEYS_LENGTH_DS_ECDSA_FILE=5,this.EU_KEYS_LENGTH_DS_ECDSA_CERT=6,this.EU_RECIPIENT_APPEND_ISSUER_AND_SERIAL=1,this.EU_RECIPIENT_APPEND_KEY_ID=2,this.EU_RECIPIENT_APPEND_KEY_ID_USC_COMPAT=3,this.EU_SAVE_SETTINGS_PARAMETER="SaveSettings",this.EU_RESOLVE_OIDS_PARAMETER="ResolveOIDs",this.EU_MAKE_PKEY_PFX_CONTAINER_PARAMETER="MakePKeyPFXContainer",this.EU_SIGN_INCLUDE_CONTENT_TIME_STAMP_PARAMETER="SignIncludeContentTimeStamp",this.EU_SIGN_TYPE_PARAMETER="SignType",this.EU_SIGN_INCLUDE_CA_CERTIFICATES_PARAMETER="SignIncludeCACertificates",this.EU_FS_CALCULATE_FINGERPRINT="FSCalculateFingerprint",this.EU_FORCE_USE_TSP_FROM_SETTINGS_PARAMETER="ForceUseTSPFromSettings",this.EU_STRING_ENCODING_PARAMETER="StringEncoding",this.EU_CHECK_CERT_CHAIN_ON_SIGN_TIME_PARAMETER="CheckCertChainOnSignTime",this.EU_CONNECTIONS_TIMEOUT_PARAMETER="ConnectionsTimeout",this.EU_LOG_EVENTS_THRESHOLD_PARAMETER="LogEventsThreshold",this.EU_USE_SLOGIN_PRIVATE_KEY="UseSLoginPrivateKey",this.EU_SETTINGS_ID_NONE=0,this.EU_SETTINGS_ID_MANDATORY=31,this.EU_SETTINGS_ID_ALL=1023,this.EU_SETTINGS_ID_FSTORE=1,this.EU_SETTINGS_ID_PROXY=2,this.EU_SETTINGS_ID_TSP=4,this.EU_SETTINGS_ID_OCSP=8,this.EU_SETTINGS_ID_LDAP=16,this.EU_SETTINGS_ID_MODE=32,this.EU_SETTINGS_ID_CMP=64,this.EU_SETTINGS_ID_KM=128,this.EU_SETTINGS_ID_OCSP_ACCESS_INFO_MODE=256,this.EU_SETTINGS_ID_OCSP_ACCESS_INFO=512,this.EU_SETTINGS_ID_TSL=1024,this.EU_SETTINGS_ID_LOG=2048,this.EU_HEADER_CA_TYPE="UA1",this.EU_HEADER_PART_TYPE_SIGNED=1,this.EU_HEADER_PART_TYPE_ENCRYPTED=2,this.EU_HEADER_PART_TYPE_STAMPED=3,this.EU_HEADER_PART_TYPE_CERTCRYPT=4,this.EU_HEADER_MAX_CA_TYPE_SIZE=3,this.EU_SIGNED_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_SIGNED,this.EU_ENCRYPTED_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_ENCRYPTED,this.EU_TIMESTAMPED_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_STAMPED,this.EU_CERTCRYPT_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_CERTCRYPT,this.EU_DEFAULT_LANG=0,this.EU_UA_LANG=1,this.EU_RU_LANG=2,this.EU_EN_LANG=3,this.EU_CONTENT_ENC_ALGO_DEFAULT=0,this.EU_CONTENT_ENC_ALGO_GOST28147_CFB=2,this.EU_CONTENT_ENC_ALGO_TDES_CBC=4,this.EU_CONTENT_ENC_ALGO_AES_128_CBC=5,this.EU_CONTENT_ENC_ALGO_AES_192_CBC=6,this.EU_CONTENT_ENC_ALGO_AES_256_CBC=7,this.EU_CONTENT_ENC_ALGO_DSTU7624_256_OFB=8,this.EU_CONTENT_ENC_ALGO_DSTU7624_256_CFB=9,this.EU_DEV_CTX_MIN_PUBLIC_DATA_ID=16,this.EU_DEV_CTX_MAX_PRIVATE_DATA_ID=175,this.EU_UA_OID_EXT_KEY_USAGE_STAMP="1.2.804.2.1.1.1.3.9",this.EU_CCS_TYPE_REVOKE=1,this.EU_CCS_TYPE_HOLD=2,this.EU_REVOCATION_REASON_UNKNOWN=0,this.EU_REVOCATION_REASON_KEY_COMPROMISE=1,this.EU_REVOCATION_REASON_NEW_ISSURED=2,this.EU_SIGN_TYPE_UNKNOWN=0,this.EU_SIGN_TYPE_CADES_BES=1,this.EU_SIGN_TYPE_CADES_T=4,this.EU_SIGN_TYPE_CADES_C=8,this.EU_SIGN_TYPE_CADES_X_LONG=16,this.EU_SIGN_TYPE_CADES_X_LONG_TRUSTED=128,this.EU_CHECK_PRIVATE_KEY_CONTEXT_PARAMETER="CheckPrivateKey",this.EU_RESOLVE_OIDS_CONTEXT_PARAMETER="ResolveOIDs",this.EU_EXPORATABLE_CONTEXT_CONTEXT_PARAMETER="ExportableContext",this.EU_USE_SLOGIN_PRIVATE_KEY_CONTEXT_PARAMETER="UseSLoginPrivateKey",this.EU_RECIPIENT_APPEND_TYPE_BY_ISSUER_SERIAL=1,this.EU_RECIPIENT_APPEND_TYPE_BY_KEY_ID=2,this.EU_CTX_HASH_ALGO_UNKNOWN=0,this.EU_CTX_HASH_ALGO_GOST34311=1,this.EU_CTX_HASH_ALGO_SHA160=2,this.EU_CTX_HASH_ALGO_SHA224=3,this.EU_CTX_HASH_ALGO_SHA256=4,this.EU_CTX_HASH_ALGO_SHA384=5,this.EU_CTX_HASH_ALGO_SHA512=6,this.EU_CTX_HASH_ALGO_DSTU7564_256=7,this.EU_CTX_HASH_ALGO_DSTU7564_384=8,this.EU_CTX_HASH_ALGO_DSTU7564_512=9,this.EU_CTX_SIGN_UNKNOWN=0,this.EU_CTX_SIGN_DSTU4145_WITH_GOST34311=1,this.EU_CTX_SIGN_RSA_WITH_SHA=2,this.EU_CTX_SIGN_ECDSA_WITH_SHA=3,this.EU_CTX_SIGN_DSTU4145_WITH_DSTU7564=4,this.EU_FILE_PROCESS_CHUNK_SIZE=1048576,this.EU_ASIC_TYPE_UNKNOWN=0,this.EU_ASIC_TYPE_S=1,this.EU_ASIC_TYPE_E=2,this.EU_ASIC_SIGN_TYPE_UNKNOWN=0,this.EU_ASIC_SIGN_TYPE_CADES=1,this.EU_ASIC_SIGN_TYPE_XADES=2,this.EU_ASIC_SIGN_LEVEL_BES=1,this.EU_ASIC_SIGN_LEVEL_T=4,this.EU_ASIC_SIGN_LEVEL_C=8,this.EU_ASIC_SIGN_LEVEL_X_LONG=16,this.EU_ASIC_SIGN_LEVEL_X_LONG_TRUSTED=128,this.EU_XADES_SIGN_TYPE_UNKNOWN=0,this.EU_XADES_TYPE_DETACHED=1,this.EU_XADES_TYPE_ENVELOPING=2,this.EU_XADES_TYPE_ENVELOPED=3,this.EU_XADES_SIGN_LEVEL_BES=1,this.EU_XADES_SIGN_LEVEL_T=4,this.EU_XADES_SIGN_LEVEL_B_LT=16,this.EU_XADES_SIGN_LEVEL_B_LTA=32,this.EU_PADES_SIGN_LEVEL_B_B=1,this.EU_PADES_SIGN_LEVEL_B_T=4,this.EU_PADES_SIGN_LEVEL_B_LT=16,this.EU_PADES_SIGN_LEVEL_B_LTA=32,this.EU_CP_ACP_ENCODING=0,this.EU_CP_1251_ENCODING=1251,this.EU_UTF8_ENCODING=65001,this.m_language=this.EU_DEFAULT_LANG,this.m_lastErrorCode=et.ERROR_NONE,this.m_lastError="",this.m_charset="UTF-8",this.m_stringCoder=new e,this.m_base64Coder=new s,this.m_dateCoder=new o,this.m_browserInfo=new u;var r=1;switch(t){case"chrome-extension://jffafkigfgmjafhpkoibhfefeaebmccg/":r=2,this.m_browserInfo.GetName()==u.BROWSER_NAME_FIREFOX&&(t="eusw@iit.com.ua");break;case"clsid:B7E24C75-E343-4DA2-A8D3-C80970FB7D7B":r=4;break;case"application/x-eusign-cp":r=3}this.m_jsonRpcClient=new l(r,t,n,"https:"==window.location.protocol),this.m_monitorLibraryTimer=null};return rt.prototype._funcMakeParams=function(t){var e=[];null==t&&(t=[]);for(var n=function(t){if(E(t))return t.encode();if(Array.isArray(t)){for(var e=t.length,r=[],i=0;i<e;i++)r[i]=n(t[i]);return r}return t},r=t.length,i=0;i<r;i++)e[i]=n(t[i]);return e},rt.prototype._funcCall=function(t,e,n,r,i){var o;if(!this.IsAsync(n,r))return o=this.m_jsonRpcClient.execute(t,e,null),o=this._funcHandleResult(o),i?i(o):o;var s=null==i?n:function(t){i(t,n,r)},a=this;this.m_jsonRpcClient.execute(t,e,(function(t){a._funcHandleResult(t,s,r)}))},rt.prototype._funcHandleResult=function(t,e,n){var r,i,o=this.IsAsync(e,n);if(null==t){if(r=this.MakeError(et.ERROR_LIBRARY_COMUNICATION_FAILED,""),o)return void n(r);throw new nt(r.errorCode,r.message)}if(i=(r=t.error).code,et.isError(i)){if(i==et.WARNING_END_OF_ENUM)return o?void e(null):null;if(r=this.MakeError(i,r.message),o)return void n(r);throw new nt(r.errorCode,r.message)}try{t=this._funcDecodeResult(t.result)}catch(t){if(r=this.MakeError(et.ERROR_LIBRARY_COMUNICATION_FAILED,""),o)return void n(r);throw new nt(r.errorCode,r.message)}if(!o)return t;e(t)},rt.prototype._funcDecodeResult=function(t){if(null==t)return null;var e=function(t){if(Array.isArray(t)){for(var n=[],r=t.length,i=0;i<r;i++)n[i]=e(t[i]);return n}if("object"==typeof t){var o,s=t.className;return(o=new y[s]).decode(t)?"EndUserByteArray"==o.className?o.GetData():o:null}return t};return e(t)},rt.prototype._checkVersion=function(t){try{var e=this.classVersion;if(e==t)return!0;if(e=e.split("."),t=t.split("."),e.length!=t.length)return!1;for(var n=0;n<t.length;n++)if(parseInt(e[n])>parseInt(t[n]))return!1}catch(t){return!1}return!0},rt.prototype._stringToBytes=function(t,e){try{return this.m_stringCoder.encode(t)}catch(t){var n=this.MakeError(et.ERROR_BAD_PARAMETER,"");if(void 0!==e)return setTimeout((function(){e(n)}),1),null;throw new nt(n.errorCode,n.message)}},rt.prototype._bytesToString=function(t,e){try{return this.m_stringCoder.decode(t)}catch(t){var n=this.MakeError(et.ERROR_BAD_PARAMETER,"");if(void 0!==e)return setTimeout((function(){e(n)}),1),null;throw new nt(n.errorCode,n.message)}},rt.prototype._base64Encode=function(t,e){try{return this.m_base64Coder.encode(t)}catch(t){var n=this.MakeError(et.ERROR_BAD_PARAMETER,"");if(void 0!==e)return setTimeout((function(){e(n)}),1),null;throw new nt(n.errorCode,n.message)}},rt.prototype._base64Decode=function(t,e){try{return this.m_base64Coder.decode(t)}catch(t){var n=this.MakeError(et.ERROR_BAD_PARAMETER,"");if(void 0!==e)return setTimeout((function(){e(n)}),1),null;throw new nt(n.errorCode,n.message)}},rt.prototype._copyArrayData=function(t,e){try{if(t.length!=e.length)return!1;if(Array.isArray(e)||Array.isArray(t))for(var n=0;n<e.length;n++)t[n]=e[n];else t.set(e);return!0}catch(t){return!1}},rt.prototype._startMonitorLibraryStatus=function(){var t=this;try{t.m_monitorLibraryTimer=setInterval((function(){t.IsInitialized((function(e){e||t._stopMonitorLibraryStatus()}),(function(e){t._stopMonitorLibraryStatus()}))}),6e5)}catch(t){}},rt.prototype._stopMonitorLibraryStatus=function(){try{if(null==this.m_monitorLibraryTimer)return;clearInterval(this.m_monitorLibraryTimer),this.m_monitorLibraryTimer=null}catch(t){}},rt.prototype._getAndroidAppIntentURL=function(t,e){var n="intent://addurlandstart?url={URL_LOCATION}#Intent;scheme=saclient;package=ua.com.iit.signagentmanagement;S.browser_fallback_url={URL_INSTALL};end;";return n=(n=n.replace("{URL_LOCATION}",encodeURIComponent(location.origin))).replace("{URL_INSTALL}",encodeURIComponent(t+"/"+e))},rt.prototype.IsAsync=function(t,e){return void 0!==t&&void 0!==e},rt.prototype.MakeError=function(t,e){return""==e&&(e=et.getErrorDescriptionEx(t,this.m_language)),this.m_lastErrorCode=t,this.m_lastError=e,new et(t,e)},rt.prototype.RaiseError=function(t,e){var n;throw new nt((n=this.MakeError(t,e)).errorCode,n.message)},rt.prototype.GetInstallURL=function(t,e){var n=this,r=n.m_browserInfo.GetOSName(),i=n.m_browserInfo.GetArch(),o=[];e=e||"https://iit.com.ua/download/productfiles";var s,a=function(t){o.push(e+"/"+t)};switch(r){case u.OS_NAME_WINDOWS:a("EUSignWebInstall.exe");break;case u.OS_NAME_MAC:a("EUSignWebInstall.pkg");break;case u.OS_NAME_LINUX:i==u.BROWSER_ARCH_NAME_X86?(a("euswi.deb"),a("euswi.rpm"),a("euswi.tar")):(a("euswi.64.deb"),a("euswi.64.rpm"),a("euswi.64.tar"));break;case u.OS_NAME_ANDROID:s="EUSignWebInstall.apk",o.push(n._getAndroidAppIntentURL(e,s));break;default:return null}return t?o:o[0]},rt.prototype.GetUpdateURL=function(t,e){var n=this,r=n.m_browserInfo.GetOSName(),i=n.m_browserInfo.GetArch(),o=[];e=e||"https://iit.com.ua/download/productfiles";var s,a=function(t){o.push(e+"/"+t)};switch(r){case u.OS_NAME_WINDOWS:a("EUSignWebUpdate.exe");break;case u.OS_NAME_MAC:a("EUSignWebInstall.pkg");break;case u.OS_NAME_LINUX:i==u.BROWSER_ARCH_NAME_X86?(a("euswi.deb"),a("euswi.rpm"),a("euswi.tar")):(a("euswi.64.deb"),a("euswi.64.rpm"),a("euswi.64.tar"));break;case u.OS_NAME_ANDROID:s="EUSignWebInstall.apk",o.push(n._getAndroidAppIntentURL(e,s));break;default:return null}return t?o:o[0]},rt.prototype.GetHelpURL=function(t){switch(t=t||"https://iit.com.ua/download/productfiles",this.m_browserInfo.GetOSName()){case u.OS_NAME_WINDOWS:case u.OS_NAME_MAC:case u.OS_NAME_LINUX:return t+"/EUSignWebOManual.pdf";default:return null}},rt.prototype.GetWebExtensionInstallURL=function(){switch(this.m_browserInfo.GetName()){case u.BROWSER_NAME_CHROME:return t;case u.BROWSER_NAME_FIREFOX:return"https://eu.iit.com.ua/download/productfiles/eusw@iit.com.ua.xpi";case u.BROWSER_NAME_OPERA:return"https://chrome.google.com/webstore/detail/%D1%96%D1%96%D1%82-%D0%BA%D0%BE%D1%80%D0%B8%D1%81%D1%82%D1%83%D0%B2%D0%B0%D1%87-%D1%86%D1%81%D0%BA-1-%D0%B1%D1%96%D0%B1%D0%BB/jffafkigfgmjafhpkoibhfefeaebmccg?utm_source=chrome-app-launcher-info-dialog";default:return null}},rt.prototype.GetInstallPath=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetInstallPath",n,t,e,null)},rt.prototype.SelectFile=function(t,e,n,r){return this.SelectFileEx(t,e,null,null,null,null,n,r)},rt.prototype.SelectFileEx=function(t,e,n,r,i,o,s,a){var u;return u=this._funcMakeParams([t,e,n,r,i,o]),this._funcCall("SelectFile",u,s,a,null)},rt.prototype.SelectFolder=function(t,e){return this.SelectFolderEx(null,null,null,t,e)},rt.prototype.SelectFolderEx=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n]),this._funcCall("SelectFolder",o,r,i,null)},rt.prototype.CreateFolder=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("CreateFolder",r,e,n,null)},rt.prototype.ReadFile=function(t,e,n){var r=this.IsAsync(e,n),i=this,o=i.EU_FILE_PROCESS_CHUNK_SIZE;if(!r){for(var s,a=i.GetFileSize(t),u=Math.floor(a/o),c=a%o,l=new Uint8Array(a),f=0;f<u;f++)s=i.ReadFileWithOffset(t,f*o,o),l.set(s,f*o,s.length);return 0!=c&&(s=i.ReadFileWithOffset(t,u*o,c),l.set(s,u*o,s.length)),l}var _={buf:null,length:0,curLength:0},p=function(r){if(r.curLength!=r.length){var s=r.length-r.curLength;s>o&&(s=o),i.ReadFileWithOffset(t,r.curLength,s,(function(t){r.buf.set(t,r.curLength,t.length),r.curLength+=t.length,p(r)}),n)}else e(r.buf)};i.GetFileSize(t,(function(t){_.buf=new Uint8Array(t),_.length=t,p(_)}),n)},rt.prototype.WriteFile=function(t,e,n,r){var i=this.IsAsync(n,r),o=this,s=o.EU_FILE_PROCESS_CHUNK_SIZE;if(i){var a={buf:null,length:0,curLength:0},u=function(e,i){if(i||e.curLength!=e.length){var a=e.length-e.curLength;a>s&&(a=s),o.WriteFileWithOffset(t,e.curLength,o.Copy(e.buf,e.curLength,s),(function(){e.curLength+=a,u(e,!1)}),r)}else n()};a.buf=e,a.length=e.length,u(a,!0)}else{for(var c=e.length,l=Math.floor(c/s),f=c%s,_=0;_<l;_++)o.WriteFileWithOffset(t,_*s,o.Copy(e,_*s,s));0==f&&0!=e.length||o.WriteFileWithOffset(t,l*s,o.Copy(e,l*s,f))}},rt.prototype.GetFileSize=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("GetFileSize",r,e,n,null)},rt.prototype.ReadFileWithOffset=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n]),this._funcCall("ReadFileWithOffset",o,r,i,null)},rt.prototype.WriteFileWithOffset=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,new S(n)]),this._funcCall("WriteFileWithOffset",o,r,i,null)},rt.prototype.DeleteFile=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("DeleteFile",r,e,n,null)},rt.prototype.AppendFile=function(t,e,n,r){var i;i=this._funcMakeParams([t,e]),this._funcCall("AppendFile",i,n,r,null)},rt.prototype.CopyFileWithOffset=function(t,e,n,r,i,o){var s;s=this._funcMakeParams([t,e,n,r]),this._funcCall("CopyFileWithOffset",s,i,o,null)},rt.prototype.Load=function(t,e){var n=this.IsAsync(t,e),r=this;if(n)this.GetVersion((function(n){if(r._checkVersion(n))t();else{var i=r.MakeError(et.ERROR_LIBRARY_VERSION_NOT_SUPPORTED,"");e(i)}}),(function(t){t=r.MakeError(et.ERROR_LIBRARY_COMUNICATION_FAILED,""),e(t)}));else{var i;try{i=this._checkVersion(this.GetVersion())}catch(t){this.RaiseError(et.ERROR_LIBRARY_COMUNICATION_FAILED,"")}i||this.RaiseError(et.ERROR_LIBRARY_VERSION_NOT_SUPPORTED,"")}},rt.prototype.GetVersion=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetVersion",n,t,e,null)},rt.prototype.IsInitialized=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("IsInitialized",n,t,e,null)},rt.prototype.Initialize=function(t,e){var n,r=this,i=this.IsAsync(t,e);n=this._funcMakeParams(null),this._funcCall("Initialize",n,i?function(){r._startMonitorLibraryStatus(),t()}:t,e,null),i||r._startMonitorLibraryStatus()},rt.prototype.Finalize=function(t,e){var n;this._stopMonitorLibraryStatus(),n=this._funcMakeParams(null),this._funcCall("Finalize",n,t,e,null)},rt.prototype.ResetOperation=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("ResetOperation",n,t,e,null)},rt.prototype.SetUIMode=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetUIMode",r,e,n,null)},rt.prototype.SetLanguage=function(t,e,n){var r,i=this,o=this.IsAsync(e,n);r=this._funcMakeParams([t]),this._funcCall("SetLanguage",r,o?function(){i.m_language=t,e()}:e,n,null),o||(this.m_language=t)},rt.prototype.SetCharset=function(t,e,n){var r,o=this.IsAsync(e,n);if(null==(r=i.GetCoder(t))){var s=this.MakeError(et.ERROR_BAD_PARAMETER,"");if(o)return void setTimeout((function(){n(s)}),1);throw new nt(s.errorCode,s.message)}this.m_stringCoder=r,this.m_charset=t,o&&setTimeout((function(){e()}),1)},rt.prototype.SetRuntimeParameter=function(t,e,n,r){var i;"boolean"==typeof e&&(e=e?1:0),i=this._funcMakeParams([t,e]),this._funcCall("SetRuntimeParameter",i,n,r,null)},rt.prototype.GetStorageParameter=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetStorageParameter",i,n,r,null)},rt.prototype.SetStorageParameter=function(t,e,n,r,i){var o;o=this._funcMakeParams([t,e,n]),this._funcCall("SetStorageParameter",o,r,i,null)},rt.prototype.CreateArrayList=function(){return new p},rt.prototype.GetLastError=function(){return this.m_lastError},rt.prototype.GetLastErrorCode=function(){return this.m_lastErrorCode},rt.prototype.BASE64Encode=function(t,e,n){var r=this._base64Encode(t,n);if(!this.IsAsync(e,n))return r;setTimeout((function(){e(r)}),1)},rt.prototype.BASE64Decode=function(t,e,n){var r=this._base64Decode(t,n);if(!this.IsAsync(e,n))return r;setTimeout((function(){e(r)}),1)},rt.prototype.StringToBytes=function(t,e,n){var r=this._stringToBytes(t,n);if(!this.IsAsync(e,n))return r;setTimeout((function(){e(r)}),1)},rt.prototype.BytesToString=function(t,e,n){var r=this._bytesToString(t,n);if(!this.IsAsync(e,n))return r;setTimeout((function(){e(r)}),1)},rt.prototype.Concatenate=function(t,e){if(Array.isArray(t)&&Array.isArray(e))return t.concat(e);var n,r=t.length+e.length;if(Array.isArray(t)||Array.isArray(e)){var i,o;for(n=new Array(r),i=0;i<t.length;i++)n[i]=t[i];for(o=0;o<e.length;i++,o++)n[i]=e[o]}else(n=new h(r)).set(t),n.set(e,t.length);return n},rt.prototype.Copy=function(t,e,n){return t.slice(e,e+n)},rt.prototype.SetSettings=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("SetSettings",n,t,e,null)},rt.prototype.DoesNeedSetSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("DoesNeedSetSettings",n,t,e,null)},rt.prototype.InitializeMandatorySettings=function(t,e){var n=this;if(this.IsAsync(t,e))a((function(t){var r=n.CreateFileStoreSettings();n.SetFileStoreSettings(r,t,e)})).eu_wait((function(t){n.GetProxySettings((function(e){t()}),(function(r){n.GetSystemProxySettings((function(r){n.SetProxySettings(r,t,e)}),(function(r){var i=n.CreateProxySettings();n.SetProxySettings(i,t,e)}))}))})).eu_wait((function(t){var r=n.CreateTSPSettings();n.SetTSPSettings(r,t,e)})).eu_wait((function(t){var r=n.CreateLDAPSettings();n.SetLDAPSettings(r,t,e)})).eu_wait((function(){var r=n.CreateOCSPSettings();n.SetOCSPSettings(r,t,e)}));else{var r,i=n.CreateFileStoreSettings();n.SetFileStoreSettings(i);try{r=n.GetProxySettings()}catch(t){r=n.CreateProxySettings();try{r=n.GetSystemProxySettings()}catch(t){}n.SetProxySettings(r)}var o=n.CreateTSPSettings();n.SetTSPSettings(o);var s=n.CreateLDAPSettings();n.SetLDAPSettings(s);var u=n.CreateOCSPSettings();n.SetOCSPSettings(u)}},rt.prototype.CreateModeSettings=function(){return new P},rt.prototype.GetModeSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetModeSettings",n,t,e,null)},rt.prototype.SetModeSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetModeSettings",r,e,n,null)},rt.prototype.CreateKeyMediaSettings=function(){return new U},rt.prototype.GetKeyMediaSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetKeyMediaSettings",n,t,e,null)},rt.prototype.SetKeyMediaSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetKeyMediaSettings",r,e,n,null)},rt.prototype.CreateFileStoreSettings=function(){return new d},rt.prototype.GetFileStoreSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetFileStoreSettings",n,t,e,null)},rt.prototype.SetFileStoreSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetFileStoreSettings",r,e,n,null)},rt.prototype.CreateProxySettings=function(){return new A},rt.prototype.GetProxySettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetProxySettings",n,t,e,null)},rt.prototype.SetProxySettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetProxySettings",r,e,n,null)},rt.prototype.CreateOCSPSettings=function(){return new m},rt.prototype.GetOCSPSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetOCSPSettings",n,t,e,null)},rt.prototype.SetOCSPSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetOCSPSettings",r,e,n,null)},rt.prototype.CreateOCSPAccessInfoModeSettings=function(){return new v},rt.prototype.GetOCSPAccessInfoModeSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetOCSPAccessInfoModeSettings",n,t,e,null)},rt.prototype.SetOCSPAccessInfoModeSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetOCSPAccessInfoModeSettings",r,e,n,null)},rt.prototype.CreateOCSPAccessInfoSettings=function(){return new I},rt.prototype.EnumOCSPAccessInfoSettings=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("EnumOCSPAccessInfoSettings",r,e,n,null)},rt.prototype.GetOCSPAccessInfoSettings=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("GetOCSPAccessInfoSettings",r,e,n,null)},rt.prototype.SetOCSPAccessInfoSettings=function(t,e,n){var r,i=this,o=i.IsAsync(e,n);if(t=Array.isArray(t)?t:[t],o){var s=function(o){o>=t.length?e():(r=i._funcMakeParams([t[o]]),i._funcCall("SetOCSPAccessInfoSettings",r,(function(){s(o+1)}),n,null))};s(0)}else for(var a=0;a<t.length;a++)r=i._funcMakeParams([t[a]]),i._funcCall("SetOCSPAccessInfoSettings",r,e,n,null)},rt.prototype.DeleteOCSPAccessInfoSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("DeleteOCSPAccessInfoSettings",r,e,n,null)},rt.prototype.CreateTSPSettings=function(){return new R},rt.prototype.GetTSPSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetTSPSettings",n,t,e,null)},rt.prototype.SetTSPSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetTSPSettings",r,e,n,null)},rt.prototype.CreateLDAPSettings=function(){return new T},rt.prototype.GetLDAPSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetLDAPSettings",n,t,e,null)},rt.prototype.SetLDAPSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetLDAPSettings",r,e,n,null)},rt.prototype.CreateCMPSettings=function(){return new g},rt.prototype.GetCMPSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetCMPSettings",n,t,e,null)},rt.prototype.SetCMPSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetCMPSettings",r,e,n,null)},rt.prototype.GetSystemProxySettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetSystemProxySettings",n,t,e,null)},rt.prototype.SetOCSPResponseExpireTime=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetOCSPResponseExpireTime",r,e,n,null)},rt.prototype.CreateTSLSettings=function(){return new b},rt.prototype.GetTSLSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetTSLSettings",n,t,e,null)},rt.prototype.SetTSLSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetTSLSettings",r,e,n,null)},rt.prototype.RefreshFileStore=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("RefreshFileStore",r,e,n,null)},rt.prototype.ShowCertificates=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("ShowCertificates",n,t,e,null)},rt.prototype.SelectCertificateInfo=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("SelectCertificateInfo",n,t,e,null)},rt.prototype.GetCertificatesCount=function(t,e,n,r){var i;return"number"==typeof t&&"number"==typeof e||(n=t,r=e,t=this.SUBJECT_TYPE_UNDIFFERENCED,e=this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED),i=this._funcMakeParams([t,e]),this._funcCall("GetCertificatesCount",i,n,r,null)},rt.prototype.GetCACertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_CA,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,t,e)},rt.prototype.GetCAServerCertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,t,e)},rt.prototype.GetCMPServerCertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_CMP,t,e)},rt.prototype.GetOCSPServerCertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_OCSP,t,e)},rt.prototype.GetTSPServerCertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_TSP,t,e)},rt.prototype.GetRAAdministratorCertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_RA_ADMINISTRATOR,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,t,e)},rt.prototype.GetEndUserCertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_END_USER,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,t,e)},rt.prototype.EnumCertificates=function(t,e,n,r,i){var o;return"number"==typeof e&&"number"==typeof n||(r=e,i=n,n=t,t=this.SUBJECT_TYPE_UNDIFFERENCED,e=this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED),o=this._funcMakeParams([t,e,n]),this._funcCall("EnumCertificates",o,r,i,null)},rt.prototype.EnumCACertificates=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_CA,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,e,n)},rt.prototype.EnumCAServerCertificates=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,e,n)},rt.prototype.EnumCMPServerCertificatesCount=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_CMP,e,n)},rt.prototype.EnumOCSPServerCertificatesCount=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_OCSP,e,n)},rt.prototype.EnumTSPServerCertificatesCount=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_TSP,e,n)},rt.prototype.EnumRAAdministratorCertificatesCount=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_RA_ADMINISTRATOR,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,e,n)},rt.prototype.EnumEndUserCertificatesCount=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_END_USER,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,e,n)},rt.prototype.GetCertificateInfo=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificateInfo",i,n,r,null)},rt.prototype.GetCertificateInfoEx=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificateInfoEx",i,n,r,null)},rt.prototype.GetCertificate=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificate",i,n,r,null)},rt.prototype.CheckCertificateByIssuerAndSerial=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("CheckCertificateByIssuerAndSerial",i,n,r,null)},rt.prototype.CheckCertificate=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("CheckCertificate",r,e,n,null)},rt.prototype.ParseCertificate=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("ParseCertificate",r,e,n,null)},rt.prototype.ParseCertificateEx=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("ParseCertificateEx",r,e,n,null)},rt.prototype.SaveCertificate=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("SaveCertificate",r,e,n,null)},rt.prototype.SaveCertificates=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("SaveCertificates",r,e,n,null)},rt.prototype.SaveCertificatesEx=function(t,e,n,r){var i;return i=this._funcMakeParams([new S(t),e?new S(e):null]),this._funcCall("SaveCertificatesEx",i,n,r,null)},rt.prototype.GetCertificatesFromLDAPByEDRPOUCode=function(t,e,n,r,i,o,s){var a;return null!=r&&null!=i?("EndUserArrayList"==r.className&&(r=r.m_array),"EndUserArrayList"==i.className&&(i=i.m_array)):(r=null,i=null),a=this._funcMakeParams([t,e,n,r,i]),this._funcCall("GetCertificatesFromLDAPByEDRPOUCode",a,o,s,null)},rt.prototype.GetCertificateByEmail=function(t,e,n,r,i,o){var s;return"string"!=typeof r&&(r=this.m_dateCoder.encode(r)),s=this._funcMakeParams([t,e,n,r]),this._funcCall("GetCertificateByEmail",s,i,o,null)},rt.prototype.GetCertificateByNBUCode=function(t,e,n,r,i,o){var s;return"string"!=typeof r&&(r=this.m_dateCoder.encode(r)),s=this._funcMakeParams([t,e,n,r]),this._funcCall("GetCertificateByNBUCode",s,i,o,null)},rt.prototype.GetReceiversCertificates=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetReceiversCertificates",n,t,e,null)},rt.prototype.GetReceiversCertificatesInArrayList=function(t,e){var n,r=this;return n=this._funcMakeParams(null),this._funcCall("GetReceiversCertificates",n,t,e,(function(t,e,n){var i=r.IsAsync(e,n);try{for(var o=new p,s=0;s<t.length;s++)o.add(t[s]);if(!i)return o;e(o)}catch(t){var a=r.MakeError(et.ERROR_LIBRARY_COMUNICATION_FAILED,"");if(i)return void n(a);throw new nt(a.errorCode,a.message)}}))},rt.prototype.GetCertificates=function(t,e,n,r){var i,o=this;return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificates",i,n,r,(function(t,e,n){var r=o.IsAsync(e,n);try{for(var i=new p,s=0;s<t.length;s++)i.add(t[s]);if(!r)return i;e(i)}catch(t){var a=o.MakeError(et.ERROR_LIBRARY_COMUNICATION_FAILED,"");if(r)return void n(a);throw new nt(a.errorCode,a.message)}}))},rt.prototype.GetCertificateByFingerprint=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("GetCertificateByFingerprint",r,e,n,null)},rt.prototype.GetCertificatesByEDRPOUAndDRFOCode=function(t,e,n,r){var i,o=this;return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificatesByEDRPOUAndDRFOCode",i,n,r,(function(t,e,n){var r=o.IsAsync(e,n);try{for(var i=new p,s=0;s<t.length;s++)i.add(t[s]);if(!r)return i;e(i)}catch(t){var a=o.MakeError(et.ERROR_LIBRARY_COMUNICATION_FAILED,"");if(r)return void n(a);throw new nt(a.errorCode,a.message)}}))},rt.prototype.ShowCRLs=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("ShowCRLs",n,t,e,null)},rt.prototype.GetCRLsCount=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetCRLsCount",n,t,e,null)},rt.prototype.EnumCRLs=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("EnumCRLs",r,e,n,null)},rt.prototype.GetCRLDetailedInfo=function(t,e,n,r){var i;return i=this._funcMakeParams([t,parseInt(e)]),this._funcCall("GetCRLDetailedInfo",i,n,r,null)},rt.prototype.SaveCRL=function(t,e,n,r){var i;return i=this._funcMakeParams([t,new S(e)]),this._funcCall("SaveCRL",i,n,r,null)},rt.prototype.GetTSPByAccessInfo=function(t,e,n,r,i,o){var s;if("string"==typeof e||null!=(e=this._base64Encode(e,o)))return s=this._funcMakeParams([t,e,n,r]),this._funcCall("GetTSPByAccessInfo",s,i,o,null)},rt.prototype.CheckTSP=function(t,e,n,r,i){var o;"string"==typeof t&&null==(t=this._base64Decode(t,i))||null!=n&&"string"!=typeof n&&null==(n=this._base64Encode(n,i))||(o=this._funcMakeParams([new S(t),e,n]),this._funcCall("CheckTSP",o,r,i,null))},rt.prototype.GetOCSPResponseByAccessInfo=function(t,e,n,r,i){var o;return o=this._funcMakeParams([new S(t),e,n]),this._funcCall("GetOCSPResponseByAccessInfo",o,r,i,null)},rt.prototype.CheckOCSPResponse=function(t,e,n,r){var i;if("string"!=typeof t||null!=(t=this._base64Decode(t,r)))return null!=e&&"string"!=typeof e&&(e=this.m_dateCoder.encode(e)),i=this._funcMakeParams([new S(t),e]),this._funcCall("CheckOCSPResponse",i,n,r,null)},rt.prototype.CreateKeyMedia=function(){return new C},rt.prototype.GetPrivateKeyMedia=function(t,e,n){var r;return"string"!=typeof t&&(t=null),r=this._funcMakeParams([t]),this._funcCall("GetPrivateKeyMedia",r,e,n,null)},rt.prototype.EnumKeyMediaTypes=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("EnumKeyMediaTypes",r,e,n,null)},rt.prototype.EnumKeyMediaDevices=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("EnumKeyMediaDevices",i,n,r,null)},rt.prototype.GetKeyMediaTypes=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetKeyMediaTypes",n,t,e,null)},rt.prototype.GetKeyMediaDevices=function(t,e,n){var r;return"number"==typeof t&&(t=[t]),t&&(t=new S(t)),r=this._funcMakeParams([t]),this._funcCall("GetKeyMediaDevices",r,e,n,null)},rt.prototype.IsPrivateKeyReaded=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("IsPrivateKeyReaded",n,t,e,null)},rt.prototype.ReadPrivateKey=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("ReadPrivateKey",n,t,e,null)},rt.prototype.ReadPrivateKeySilently=function(t,e,n,r,i){var o,s;"number"==typeof t?((s=new C).typeIndex=t,s.devIndex=e,s.password=n):(s=t,r=e,i=n),o=this._funcMakeParams([s]),this._funcCall("ReadPrivateKeySilently",o,r,i,null)},rt.prototype.ReadPrivateKeyBinary=function(t,e,n,r){var i;i=this._funcMakeParams([new S(t),e]),this._funcCall("ReadPrivateKeyBinary",i,n,r,null)},rt.prototype.ReadPrivateKeyFile=function(t,e,n,r){var i;i=this._funcMakeParams([t,e]),this._funcCall("ReadPrivateKeyFile",i,n,r,null)},rt.prototype.CtxReadPrivateKey=function(t,e,n,r,i,o){var s,a;return"number"==typeof e?((a=new C).typeIndex=e,a.devIndex=n,a.password=r):(a=e,i=n,o=r),s=this._funcMakeParams([t,a]),this._funcCall("CtxReadPrivateKey",s,i,o,null)},rt.prototype.CtxReadPrivateKeyBinary=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,new S(e),n]),this._funcCall("CtxReadPrivateKeyBinary",o,r,i,null)},rt.prototype.ResetPrivateKey=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("ResetPrivateKey",n,t,e,null)},rt.prototype.CtxFreePrivateKey=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("CtxFreePrivateKey",r,e,n,null)},rt.prototype.ShowOwnCertificate=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("ShowOwnCertificate",n,t,e,null)},rt.prototype.GetOwnCertificate=function(t,e,n,r){var i;return"number"==typeof t&&"number"==typeof e||(n=t,r=e,t=null,e=null),i=this._funcMakeParams([t,e]),this._funcCall("GetOwnCertificate",i,n,r,null)},rt.prototype.EnumOwnCertificates=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("EnumOwnCertificates",r,e,n,null)},rt.prototype.GetPrivateKeyOwnerInfo=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetPrivateKeyOwnerInfo",n,t,e,null)},rt.prototype.CtxEnumOwnCertificates=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("CtxEnumOwnCertificates",i,n,r,null)},rt.prototype.CtxGetOwnCertificate=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n]),this._funcCall("CtxGetOwnCertificate",o,r,i,null)},rt.prototype.GetKeyInfo=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("GetKeyInfo",r,e,n,null)},rt.prototype.GetKeyInfoSilently=function(t,e,n,r,i){var o;return(o=new C).typeIndex=t,o.devIndex=e,o.password=n,this.GetKeyInfo(o,r,i)},rt.prototype.GetKeyInfoBinary=function(t,e,n,r){var i;return i=this._funcMakeParams([new S(t),e]),this._funcCall("GetKeyInfoBinary",i,n,r,null)},rt.prototype.GetKeyInfoFile=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetKeyInfoFile",i,n,r,null)},rt.prototype.GetCertificateByKeyInfo=function(t,e,n,r){var i,o=[];return"number"==typeof t&&"number"==typeof e||(r=n,n=e),"number"==typeof t&&"number"==typeof e?(o.push(t),o.push(e),o.push(null)):(o.push(null),o.push(null),o.push(new S(t))),i=this._funcMakeParams(o),this._funcCall("GetCertificateByKeyInfo",i,n,r,null)},rt.prototype.GetCertificatesByKeyInfo=function(t,e,n,r,i){var o;return"EndUserPrivateKeyInfo"==t.className&&(t=t.GetPrivateKeyInfo()),null!=e&&null!=n?("EndUserArrayList"==e.className&&(e=e.m_array),"EndUserArrayList"==n.className&&(n=n.m_array)):(e=null,n=null),o=this._funcMakeParams([new S(t),e,n]),this._funcCall("GetCertificatesByKeyInfo",o,r,i,null)},rt.prototype.ChangeSoftwarePrivateKeyPassword=function(t,e,n,r,i){var o;return o=this._funcMakeParams([new S(t),e,n]),this._funcCall("ChangeSoftwarePrivateKeyPassword",o,r,i,null)},rt.prototype.EnumJKSPrivateKeys=function(t,e,n,r){var i;return i=this._funcMakeParams([new S(t),e]),this._funcCall("EnumJKSPrivateKeys",i,n,r,null)},rt.prototype.EnumJKSPrivateKeysFile=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("EnumJKSPrivateKeysFile",i,n,r,null)},rt.prototype.GetJKSPrivateKey=function(t,e,n,r){var i;return i=this._funcMakeParams([new S(t),e]),this._funcCall("GetJKSPrivateKey",i,n,r,null)},rt.prototype.GetJKSPrivateKeyFile=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetJKSPrivateKeyFile",i,n,r,null)},rt.prototype.CreatePrivateKeyInfo=function(){return new x},rt.prototype.CreateEndUserInfo=function(){return new H},rt.prototype._generatePrivateKey=function(t,e,n,r,i,o,s,a,u,c,l,f,_,p,h,E){if(!this.IsAsync(h,E))return this.GeneratePrivateKeyEx(t,e,n,r,!1,i,o,s,a,u,c,l,f,null,null,_,p,h,E).m_array;this.GeneratePrivateKeyEx(t,e,n,r,!1,i,o,s,a,u,c,l,f,null,null,_,p,(function(t){h(t.m_array)}),E)},rt.prototype.GeneratePrivateKey=function(t,e,n,r,i,o,s,a,u,c,l,f,_,p,h,E){if("boolean"==typeof t)return this._generatePrivateKeyEx(t,e,n,r,i,o,s,a,u,c,l,f,_,p,h,E);if("boolean"==typeof n)return this._generatePrivateKey(!0,0,0,"",t,e,n,r,i,o,s,a,null,!1,u,c);if("string"==typeof n)return this._generatePrivateKey(!1,t,e,n,r,i,o,s,a,u,c,l,null,!1,f,_);if("number"==typeof n)return this._generatePrivateKey(!1,0,0,t,e,n,r,i,o,s,a,u,c,!0,l,f);var y=this.MakeError(et.ERROR_BAD_PARAMETER,"");throw new nt(y.errorCode,y.message)},rt.prototype._generatePrivateKeyEx=function(t,e,n,r,i,o,s,a,u,c,l,f,_,h,E,y,S,d,A){var R,m,T=this;return t?m=null:((m=new C).typeIndex=e,m.devIndex=n,m.password="string"!=typeof r?"":r),null==y&&(S=!1),R=this._funcMakeParams([t,m,i,o,s,a,u,c,l,f,_,h,E,null!=y,S]),this._funcCall("GeneratePrivateKeyEx",R,d,A,(function(t,e,n){var r=T.IsAsync(e,n);try{for(var i=t[0],o=new p,s=0;s<i.length;s++)o.add(i[s]);if(null!=y&&y.set(t[1]),!r)return o;e(o)}catch(t){var a=T.MakeError(et.ERROR_LIBRARY_COMUNICATION_FAILED,"");if(r)return void n(a);throw new nt(a.errorCode,a.message)}}))},rt.prototype.GeneratePrivateKeyEx=function(t,e,n,r,i,o,s,a,u,c,l,f,_,p,h,E,y,S,C){if("boolean"==typeof t)return"boolean"==typeof i?this._generatePrivateKeyEx(t,e,n,r,i,o,s,a,u,c,l,f,_,p,h,E,y,S,C):this._generatePrivateKeyEx(t,e,n,r,!1,i,o,s,a,u,c,l,f,null,null,_,p,h,E);if("boolean"==typeof n)return void 0!==c&&null==c||"string"==typeof c?this._generatePrivateKeyEx(!0,0,0,"",!1,t,e,n,r,i,o,s,a,u,c,null,!1,l,f):this._generatePrivateKeyEx(!0,0,0,"",!1,t,e,n,r,i,o,s,a,null,null,null,!1,u,c);if("number"==typeof t)return"boolean"==typeof r?this._generatePrivateKeyEx(!1,t,e,n,r,i,o,s,a,u,c,l,f,_,p,null,!1,h,E):this._generatePrivateKeyEx(!1,t,e,n,!1,r,i,o,s,a,u,c,l,null,null,null,!1,f,_);if("string"==typeof t)return void 0!==l&&null==l||"string"==typeof l?this._generatePrivateKeyEx(!1,0,0,t,!1,e,n,r,i,o,s,a,u,c,l,f,!0,_,p):this._generatePrivateKeyEx(!1,0,0,t,!1,e,n,r,i,o,s,a,u,null,null,c,!0,l,f);var d=this.MakeError(et.ERROR_BAD_PARAMETER,"");throw new nt(d.errorCode,d.message)},rt.prototype.GetCRInfo=function(t,e,n,r,i){var o;return o=this._funcMakeParams([new S(t),e,n]),this._funcCall("GetCRInfo",o,r,i,null)},rt.prototype.IsHardwareKeyMedia=function(t,e,n,r,i){var o,s;return"number"==typeof t?((s=new C).typeIndex=t,s.devIndex=e,s.password=n):(s=null,r=t,i=e),o=this._funcMakeParams([s]),this._funcCall("IsHardwareKeyMedia",o,r,i,null)},rt.prototype.IsPrivateKeyExists=function(t,e,n,r,i){var o,s;return"number"==typeof t?((s=new C).typeIndex=t,s.devIndex=e,s.password=n):(s=null,r=t,i=e),o=this._funcMakeParams([s]),this._funcCall("IsPrivateKeyExists",o,r,i,null)},rt.prototype.ChangePrivateKeyPassword=function(t,e,n,r,i,o){var s,a;"number"==typeof t?((a=new C).typeIndex=t,a.devIndex=e,a.password=n):(a=null,r=null,i=t,o=e),s=this._funcMakeParams([a,r]),this._funcCall("ChangePrivateKeyPassword",s,i,o,null)},rt.prototype.BackupPrivateKey=function(t,e,n,r,i,o,s,a){var u,c,l;"number"==typeof t?((c=new C).typeIndex=t,c.devIndex=e,c.password=n,(l=new C).typeIndex=r,l.devIndex=i,l.password=o):(c=null,l=null,s=t,a=e),u=this._funcMakeParams([c,l]),this._funcCall("BackupPrivateKey",u,s,a,null)},rt.prototype.DestroyPrivateKey=function(t,e,n,r,i){var o,s;"number"==typeof t?((s=new C).typeIndex=t,s.devIndex=e,s.password=n):(s=null,r=t,i=e),o=this._funcMakeParams([s]),this._funcCall("DestroyPrivateKey",o,r,i,null)},rt.prototype.SetKeyMediaPassword=function(t,e,n,r,i){var o,s;"number"==typeof t?((s=new C).typeIndex=t,s.devIndex=e,s.password=n):(s=null,r=t,i=e),o=this._funcMakeParams([s]),this._funcCall("SetKeyMediaPassword",o,r,i,null)},rt.prototype.SetKeyMediaUserPassword=function(t,e,n,r,i,o){var s,a;"number"==typeof e?((a=new C).typeIndex=e,a.devIndex=n,a.password=r):(a=null,i=e,o=n),s=this._funcMakeParams([t,a]),this._funcCall("SetKeyMediaUserPassword",s,i,o,null)},rt.prototype.ChangeOwnCertificatesStatus=function(t,e,n,r){var i;i=this._funcMakeParams([t,e]),this._funcCall("ChangeOwnCertificatesStatus",i,n,r,null)},rt.prototype.CtxChangeOwnCertificatesStatus=function(t,e,n,r,i){var o;o=this._funcMakeParams([t,e,n]),this._funcCall("CtxChangeOwnCertificatesStatus",o,r,i,null)},rt.prototype.MakeNewCertificate=function(t,e,n,r,i,o,s,a,u,c,l,f,_,p,h){var E;return null!=e&&(e=new S(e)),E=this._funcMakeParams([t,e,n,r,i,o,s,a,u,c,l,f,_]),this._funcCall("MakeNewCertificate",E,p,h,null)},rt.prototype.MakeNewOwnCertificate=function(t,e,n,r,i,o,s,a,u,c){var l;return l=this._funcMakeParams([t,e,n,r,i,o,s,a]),this._funcCall("MakeNewOwnCertificate",l,u,c,null)},rt.prototype.CtxMakeNewOwnCertificate=function(t,e,n,r,i,o,s,a,u,c,l){var f;return f=this._funcMakeParams([t,e,n,r,i,o,s,a,u]),this._funcCall("CtxMakeNewOwnCertificate",f,c,l,null)},rt.prototype.CtxMakeNewOwnCertificateWithCR=function(t,e,n,r,i,o,s){var a;return null!=e&&(e=new S(e)),null!=n&&(n=new S(n)),null!=r&&(r=new S(r)),null!=i&&(i=new S(i)),a=this._funcMakeParams([t,e,n,r,i]),this._funcCall("CtxMakeNewOwnCertificateWithCR",a,o,s,null)},rt.prototype.CtxMakeDeviceCertificate=function(t,e,n,r,i,o,s,a,u,c){var l;return null!=n&&(n=new S(n)),null!=r&&(r=new S(r)),null!=i&&(i=new S(i)),null!=o&&(o=new S(o)),l=this._funcMakeParams([t,e,n,r,i,o,s,a]),this._funcCall("CtxMakeDeviceCertificate",l,u,c,null)},rt.prototype.GetOwnEUserParams=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetOwnEUserParams",n,t,e,null)},rt.prototype.ModifyOwnEUserParams=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("ModifyOwnEUserParams",i,n,r,null)},rt.prototype.CtxGetOwnEUserParams=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("CtxGetOwnEUserParams",r,e,n,null)},rt.prototype.CtxModifyOwnEUserParams=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n]),this._funcCall("CtxModifyOwnEUserParams",o,r,i,null)},rt.prototype.Hash=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._stringToBytes(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("Hash",r,e,n,null)},rt.prototype.ContinueHash=function(t,e,n,r,i){var o;"number"==typeof e&&"number"==typeof n||(r=e,i=n),"string"==typeof t&&null==(t=this._stringToBytes(t,i))||("number"==typeof e&&"number"==typeof n&&(t=t.slice(e,e+n)),o=this._funcMakeParams([new S(t)]),this._funcCall("ContinueHash",o,r,i,null))},rt.prototype.EndHash=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("EndHash",n,t,e,null)},rt.prototype.HashWithParams=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._stringToBytes(e,r)))return i=this._funcMakeParams([new S(t),new S(e)]),this._funcCall("HashWithParams",i,n,r,null)},rt.prototype.HashBeginWithParams=function(t,e,n){var r;r=this._funcMakeParams([new S(t)]),this._funcCall("HashBeginWithParams",r,e,n,null)},rt.prototype.HashFile=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("HashFile",r,e,n,null)},rt.prototype.HashFileWithParams=function(t,e,n,r){var i;return i=this._funcMakeParams([new S(t),e]),this._funcCall("HashFileWithParams",i,n,r,null)},rt.prototype.CtxHash=function(t,e,n,r,i,o){var s=this,u=this.IsAsync(i,o),c=s.EU_FILE_PROCESS_CHUNK_SIZE;if("string"!=typeof r||null!=(r=this._stringToBytes(r,o)))if(u){var l={hashContext:null,hash:null},f=function(t){null==l.hashContext?o(t):s.CtxHashFree(l.hashContext,(function(){o(t)}),(function(){o(t)}))};a((function(r){s.CtxHashBegin(t,e,n,r,f)})).eu_wait((function(t,e){l.hashContext=e;var n=function(i){if(i>=r.length)s.CtxHashEnd(e,t,f);else{var o=r.length-i;o>c&&(o=c);var a=r.slice(i,i+o);s.CtxHashContinue(e,a,(function(){n(i+o)}),f)}};n(0)})).eu_wait((function(t,e){l.hash=e,s.CtxHashFree(l.hashContext,t,o)})).eu_wait((function(){i(l.hash)}))}else{var _=null;try{var p,h=0;for(_=s.CtxHashBegin(t,e,n);;){var E=r.length-h;E>c&&(E=c);var y=r.slice(h,h+E);if(s.CtxHashContinue(_,y),!((h+=E)<r.length))break}return p=s.CtxHashEnd(_),s.CtxHashFree(_),_=null,p}catch(t){throw null!=_&&s.CtxHashFree(_),t}}},rt.prototype.CtxHashBegin=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n?new S(n):null]),this._funcCall("CtxHashBegin",o,r,i,null)},rt.prototype.CtxHashContinue=function(t,e,n,r){var i;i=this._funcMakeParams([t,new S(e)]),this._funcCall("CtxHashContinue",i,n,r,null)},rt.prototype.CtxHashEnd=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("CtxHashEnd",r,e,n,null)},rt.prototype.CtxHashFree=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("CtxHashFree",r,e,n,null)},rt.prototype.ShowSignInfo=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("ShowSignInfo",r,e,n,null)},rt.prototype.IsSigned=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("IsSigned",r,e,n,null)},rt.prototype.IsSignedFile=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("IsSignedFile",r,e,n,null)},rt.prototype.GetSignType=function(t,e,n,r){var i;if("string"==typeof e||null!=(e=this._base64Encode(e,r)))return i=this._funcMakeParams([t,e]),this._funcCall("GetSignType",i,n,r,null)},rt.prototype.GetFileSignType=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetFileSignType",i,n,r,null)},rt.prototype.GetSignsCount=function(t,e,n){var r;if("string"==typeof t||null!=(t=this._base64Encode(t,n)))return r=this._funcMakeParams([t]),this._funcCall("GetSignsCount",r,e,n,null)},rt.prototype.GetSignerInfo=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetSignerInfo",i,n,r,null)},rt.prototype.GetSignerCertificate=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetSignerCertificate",i,n,r,null)},rt.prototype.GetFileSignsCount=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("GetFileSignsCount",r,e,n,null)},rt.prototype.GetFileSignerInfo=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetFileSignerInfo",i,n,r,null)},rt.prototype.GetFileSignerCertificate=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetFileSignerCertificate",i,n,r,null)},rt.prototype.CtxGetSignerInfo=function(t,e,n,r,i){var o;if("string"==typeof n||null!=(n=this._base64Encode(n,i)))return o=this._funcMakeParams([t,e,n]),this._funcCall("CtxGetSignerInfo",o,r,i,null)},rt.prototype.Sign=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._stringToBytes(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("Sign",r,e,n,null)},rt.prototype.Verify=function(t,e,n,r,i){var o,s=[];if("boolean"!=typeof n&&(i=r,r=n),"string"!=typeof e||null!=(e=this._stringToBytes(e,i)))return s.push(t),s.push(new S(e)),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("Verify",o,r,i,null)},rt.prototype.ContinueSign=function(t,e,n,r,i){var o;"number"==typeof e&&"number"==typeof n||(r=e,i=n),"string"==typeof t&&null==(t=this._stringToBytes(t,i))||("number"==typeof e&&"number"==typeof n&&(t=t.slice(e,e+n)),o=this._funcMakeParams([new S(t)]),this._funcCall("ContinueSign",o,r,i,null))},rt.prototype.EndSign=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("EndSign",n,t,e,null)},rt.prototype.BeginVerify=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("BeginVerify",r,e,n,null)},rt.prototype.ContinueVerify=function(t,e,n,r,i){var o;"number"==typeof e&&"number"==typeof n||(r=e,i=n),"string"==typeof t&&null==(t=this._stringToBytes(t,i))||("number"==typeof e&&"number"==typeof n&&(t=t.slice(e,e+n)),o=this._funcMakeParams([new S(t)]),this._funcCall("ContinueVerify",o,r,i,null))},rt.prototype.EndVerify=function(t,e,n){var r,i=[];return"boolean"!=typeof t&&(n=e,e=t),"boolean"!=typeof t?i.push(t):i.push(null),r=this._funcMakeParams(i),this._funcCall("EndVerify",r,e,n,null)},rt.prototype.SignHash=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("SignHash",r,e,n,null)},rt.prototype.VerifyHash=function(t,e,n,r,i){var o,s=[];return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(e),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("VerifyHash",o,r,i,null)},rt.prototype.SignInternal=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._stringToBytes(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("SignInternal",i,n,r,null)},rt.prototype.VerifyInternal=function(t,e,n,r){var i,o=[];return"boolean"!=typeof e&&(r=n,n=e),o.push(t),"boolean"==typeof e?o.push(e):o.push(null),i=this._funcMakeParams(o),this._funcCall("VerifyInternal",i,n,r,null)},rt.prototype.VerifyInternalString=function(t,e,n,r){var i=this;if("boolean"!=typeof e&&(r=n,n=e),!this.IsAsync(n,r)){var o=this.VerifyInternal(t,e);return this.BytesToString(o)}this.VerifyInternal(t,e,(function(t){i.BytesToString(t,n,r)}),r)},rt.prototype.SignFile=function(t,e,n,r,i){var o;o=this._funcMakeParams([t,e,n]),this._funcCall("SignFile",o,r,i,null)},rt.prototype.VerifyFile=function(t,e,n,r,i){var o,s=[];return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(e),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("VerifyFile",o,r,i,null)},rt.prototype.VerifyFileWithExternalSign=function(t,e,n,r,i){return this.VerifyFile(e,t,n,r,i)},rt.prototype.VerifyFileWithInternalSign=function(t,e,n,r,i){return this.VerifyFile(t,e,n,r,i)},rt.prototype.IsAlreadySigned=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("IsAlreadySigned",r,e,n,null)},rt.prototype.IsFileAlreadySigned=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("IsFileAlreadySigned",r,e,n,null)},rt.prototype.AppendSign=function(t,e,n,r){var i;if(!("string"==typeof t&&null==(t=this._stringToBytes(t,r))||"string"!=typeof e&&null==(e=this._base64Encode(e,r))))return i=this._funcMakeParams([new S(t),e]),this._funcCall("AppendSign",i,n,r,null)},rt.prototype.VerifySpecific=function(t,e,n,r,i,o){var s,a=[];if("boolean"!=typeof r&&(o=i,i=r),"string"!=typeof e||null!=(e=this._stringToBytes(e,o)))return a.push(t),a.push(new S(e)),a.push(n),"boolean"==typeof r?a.push(r):a.push(null),s=this._funcMakeParams(a),this._funcCall("VerifySpecific",s,i,o,null)},rt.prototype.AppendSignBegin=function(t,e,n){var r;"string"!=typeof t&&null==(t=this._base64Encode(t,n))||(r=this._funcMakeParams([t]),this._funcCall("AppendSignBegin",r,e,n,null))},rt.prototype.VerifyDataSpecificBegin=function(t,e,n,r){var i;i=this._funcMakeParams([t,e]),this._funcCall("VerifyDataSpecificBegin",i,n,r,null)},rt.prototype.AppendSignHash=function(t,e,n,r){var i;if(!("string"!=typeof t&&null==(t=this._base64Encode(t,r))||"string"!=typeof e&&null==(e=this._base64Encode(e,r))))return i=this._funcMakeParams([t,e]),this._funcCall("AppendSignHash",i,n,r,null)},rt.prototype.VerifyHashSpecific=function(t,e,n,r,i,o){var s,a=[];return"boolean"!=typeof r&&(o=i,i=r),a.push(t),a.push(e),a.push(n),"boolean"==typeof r?a.push(r):a.push(null),s=this._funcMakeParams(a),this._funcCall("VerifyHashSpecific",s,i,o,null)},rt.prototype.AppendSignInternal=function(t,e,n,r){var i;if("string"==typeof e||null!=(e=this._base64Encode(e,r)))return i=this._funcMakeParams([t,e]),this._funcCall("AppendSignInternal",i,n,r,null)},rt.prototype.VerifySpecificInternal=function(t,e,n,r,i){var o,s=[];return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(e),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("VerifySpecificInternal",o,r,i,null)},rt.prototype.VerifySpecificInternalString=function(t,e,n,r,i){var o=this;if("boolean"!=typeof n&&(i=r,r=n),!this.IsAsync(r,i)){var s=this.VerifySpecificInternal(t,e,n);return this.BytesToString(s)}this.VerifySpecificInternal(t,e,n,(function(t){o.BytesToString(t,r,i)}),i)},rt.prototype.AppendSignFile=function(t,e,n,r,i,o){var s;return s=this._funcMakeParams([t,e,n,r]),this._funcCall("AppendSignFile",s,i,o,null)},rt.prototype.VerifyFileSpecific=function(t,e,n,r,i,o){var s,a=[];return"boolean"!=typeof r&&(o=i,i=r),a.push(t),a.push(e),a.push(n),"boolean"==typeof r?a.push(r):a.push(null),s=this._funcMakeParams(a),this._funcCall("VerifyFileSpecific",s,i,o,null)},rt.prototype.VerifyFileWithExternalSignSpecific=function(t,e,n,r,i,o){return this.VerifyFileSpecific(t,e,n,r,i,o)},rt.prototype.VerifyFileWithInternalSignSpecific=function(t,e,n,r,i,o){return this.VerifyFileSpecific(t,e,n,r,i,o)},rt.prototype.CreateEmptySign=function(t,e,n){var r,i=[];if(2==arguments.length&&(n=e,e=t),"string"!=typeof t||null!=(t=this._stringToBytes(t,n)))return 1==arguments.length||3==arguments.length?i.push(new S(t)):i.push(null),r=this._funcMakeParams(i),this._funcCall("CreateEmptySign",r,e,n,null)},rt.prototype.CreateSigner=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("CreateSigner",r,e,n,null)},rt.prototype.AppendSigner=function(t,e,n,r,i){var o,s=[];return s.push(t),null!=e?s.push(new S(e)):s.push(null),s.push(n),o=this._funcMakeParams(s),this._funcCall("AppendSigner",o,r,i,null)},rt.prototype.AppendValidationDataToSignerEx=function(t,e,n,r,i){var o,s=[];if("string"==typeof t||null!=(t=this._base64Encode(t,i)))return s.push(t),null!=e?s.push(new S(e)):s.push(null),s.push(n),o=this._funcMakeParams(s),this._funcCall("AppendValidationDataToSignerEx",o,r,i,null)},rt.prototype.IsDataInSignedDataAvailable=function(t,e,n){var r;if("string"==typeof t||null!=(t=this._base64Encode(t,n)))return r=this._funcMakeParams([t]),this._funcCall("IsDataInSignedDataAvailable",r,e,n,null)},rt.prototype.IsDataInSignedFileAvailable=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("IsDataInSignedFileAvailable",r,e,n,null)},rt.prototype.GetDataFromSignedData=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("GetDataFromSignedData",r,e,n,null)},rt.prototype.GetDataFromSignedFile=function(t,e,n,r){var i;i=this._funcMakeParams([t,e]),this._funcCall("GetDataFromSignedFile",i,n,r,null)},rt.prototype.GetCertificateFromSignedData=function(t,e,n,r){var i;if("string"==typeof e||null!=(e=this._base64Encode(e,r)))return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificateFromSignedData",i,n,r,null)},rt.prototype.GetCertificateFromSignedFile=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificateFromSignedFile",i,n,r,null)},rt.prototype.GetSignTimeInfo=function(t,e,n,r){var i;if("string"==typeof e||null!=(e=this._base64Encode(e,r)))return i=this._funcMakeParams([t,e]),this._funcCall("GetSignTimeInfo",i,n,r,null)},rt.prototype.GetFileSignTimeInfo=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetFileSignTimeInfo",i,n,r,null)},rt.prototype.VerifyHashOnTime=function(t,e,n,r,i,o,s){return this.VerifyHashOnTimeEx(t,e,n,r,null!=r,!1,i,o,s)},rt.prototype.VerifyHashOnTimeEx=function(t,e,n,r,i,o,s,a,u){var c,l=[];if("boolean"!=typeof s&&(u=a,a=s),!("string"!=typeof t&&null==(t=this._base64Encode(t,u))||"string"!=typeof n&&null==(n=this._base64Encode(n,u))))return l=[t,e,n,r,i,o],"boolean"==typeof s?l.push(s):l.push(null),c=this._funcMakeParams(l),this._funcCall("VerifyHashOnTimeEx",c,a,u,null)},rt.prototype.VerifyDataOnTime=function(t,e,n,r,i,o,s){return this.VerifyDataOnTimeEx(t,e,n,r,null!=r,!1,i,o,s)},rt.prototype.VerifyDataOnTimeEx=function(t,e,n,r,i,o,s,a,u){var c,l=[];if("boolean"!=typeof s&&(u=a,a=s),!("string"==typeof t&&null==(t=this._stringToBytes(t,u))||"string"!=typeof n&&null==(n=this._base64Encode(n,u))))return l=[new S(t),e,n,r,i,o],"boolean"==typeof s?l.push(s):l.push(null),c=this._funcMakeParams(l),this._funcCall("VerifyDataOnTimeEx",c,a,u,null)},rt.prototype.VerifyDataInternalOnTime=function(t,e,n,r,i,o){return this.VerifyDataInternalOnTimeEx(t,e,n,null!=n,!1,r,i,o)},rt.prototype.VerifyDataInternalOnTimeEx=function(t,e,n,r,i,o,s,a){var u,c=[];if("boolean"!=typeof o&&(a=s,s=o),"string"==typeof t||null!=(t=this._base64Encode(t,a)))return c=[t,e,n,r,i],"boolean"==typeof o?c.push(o):c.push(null),u=this._funcMakeParams(c),this._funcCall("VerifyDataInternalOnTimeEx",u,s,a,null)},rt.prototype.VerifyDataInternalOnTimeString=function(t,e,n,r,i,o){return this.VerifyDataInternalOnTimeStringEx(t,e,n,null!=n,!1,r,i,o)},rt.prototype.VerifyDataInternalOnTimeStringEx=function(t,e,n,r,i,o,s,a){var u=this;if("boolean"!=typeof o&&(a=s,s=o),!this.IsAsync(s,a)){var c=this.VerifyDataInternalOnTimeEx(t,e,n,r,i,o);return this.BytesToString(c)}this.VerifyDataInternalOnTimeEx(t,e,n,r,i,o,(function(t){u.BytesToString(t,s,a)}),a)},rt.prototype.VerifyDataOnTimeBegin=function(t,e,n,r,i){this.VerifyDataOnTimeBeginEx(t,e,n,null!=n,!1,r,i)},rt.prototype.VerifyDataOnTimeBeginEx=function(t,e,n,r,i,o,s){var a;a=this._funcMakeParams([t,e,n,r,i]),this._funcCall("VerifyDataOnTimeBeginEx",a,o,s,null)},rt.prototype.VerifyFileOnTime=function(t,e,n,r,i,o,s,a,u){var c,l=[];return"boolean"!=typeof s&&(u=a,a=s),l=[t,e,n,r,i,o],"boolean"==typeof s?l.push(s):l.push(null),c=this._funcMakeParams(l),this._funcCall("VerifyFileOnTimeEx",c,a,u,null)},rt.prototype.VerifyFileWithExternalSignOnTime=function(t,e,n,r,i,o,s){return this.VerifyFileOnTime(t,n,e,r,null!=r,!1,i,o,s)},rt.prototype.VerifyFileWithExternalSignOnTimeEx=function(t,e,n,r,i,o,s,a,u){return this.VerifyFileOnTime(t,n,e,r,i,o,s,a,u)},rt.prototype.VerifyFileWithInternalSignOnTime=function(t,e,n,r,i,o,s){return this.VerifyFileOnTime(t,e,n,r,null!=r,!1,i,o,s)},rt.prototype.VerifyFileWithInternalSignOnTimeEx=function(t,e,n,r,i,o,s,a,u){return this.VerifyFileOnTime(t,n,e,r,i,o,s,a,u)},rt.prototype.ContinueSignCtx=function(t,e,n,r){var i;if(null==t&&(t=new j),"string"!=typeof e||null!=(e=this._stringToBytes(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ContinueSignCtx",i,n,r,null)},rt.prototype.ContinueSignCtxWithOffset=function(t,e,n,r,i,o){return e=e.slice(n,n+r),this.ContinueSignCtx(t,e,i,o)},rt.prototype.EndSignCtx=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("EndSignCtx",i,n,r,null)},rt.prototype.BeginVerifyCtx=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("BeginVerifyCtx",r,e,n,null)},rt.prototype.ContinueVerifyCtx=function(t,e,n,r,i,o){var s;"number"==typeof n&&"number"==typeof r||(i=n,o=r),"string"==typeof e&&null==(e=this._stringToBytes(e,o))||("number"==typeof n&&"number"==typeof r&&(e=e.slice(n,n+r)),s=this._funcMakeParams([t,new S(e)]),this._funcCall("ContinueVerifyCtx",s,i,o,null))},rt.prototype.EndVerifyCtx=function(t,e,n,r){var i,o=[];return"boolean"!=typeof e&&(r=n=e),o.push(t),"boolean"==typeof e?o.push(e):o.push(null),i=this._funcMakeParams(o),this._funcCall("EndVerifyCtx",i,n,r,null)},rt.prototype.ResetOperationCtx=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("ResetOperationCtx",r,e,n,null)},rt.prototype.SignHashRSA=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("SignHashRSA",r,e,n,null)},rt.prototype.SignRSA=function(t,e,n,r,i){var o;if("string"!=typeof t||null!=(t=this._stringToBytes(t,i)))return o=this._funcMakeParams([new S(t),e,n]),this._funcCall("SignRSA",o,r,i,null)},rt.prototype.ContinueRSASign=function(t,e,n){var r;"string"==typeof t&&null==(t=this._stringToBytes(t,n))||(r=this._funcMakeParams([new S(t)]),this._funcCall("ContinueRSASign",r,e,n,null))},rt.prototype.ContinueRSASignWithOffset=function(t,e,n,r,i){return t=t.slice(e,e+n),this.ContinueRSASign(t,r,i)},rt.prototype.EndRSASign=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("EndRSASign",r,e,n,null)},rt.prototype.SignRSAFile=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n]),this._funcCall("SignRSAFile",o,r,i,null)},rt.prototype.ContinueRSASignCtx=function(t,e,n,r){var i;if(null==t&&(t=new j),"string"!=typeof e||null!=(e=this._stringToBytes(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ContinueRSASignCtx",i,n,r,null)},rt.prototype.ContinueRSASignCtxWithOffset=function(t,e,n,r,i,o){return e=e.slice(n,n+r),this.ContinueRSASignCtx(e,i,o)},rt.prototype.EndRSASignCtx=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("EndRSASignCtx",i,n,r,null)},rt.prototype.SignECDSA=function(t,e,n,r,i){var o;if("string"!=typeof t||null!=(t=this._stringToBytes(t,i)))return o=this._funcMakeParams([new S(t),e,n]),this._funcCall("SignECDSA",o,r,i,null)},rt.prototype.RawSign=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._stringToBytes(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("RawSign",r,e,n,null)},rt.prototype.RawVerify=function(t,e,n,r,i){var o,s=[];if("boolean"!=typeof n&&(i=r,r=n),"string"!=typeof e||null!=(e=this._stringToBytes(e,i)))return s.push(t),s.push(new S(e)),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("RawVerify",o,r,i,null)},rt.prototype.RawSignHash=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("RawSignHash",r,e,n,null)},rt.prototype.RawVerifyHash=function(t,e,n,r,i){var o,s=[];return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(e),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("RawVerifyHash",o,r,i,null)},rt.prototype.RawSignFile=function(t,e,n,r){var i;i=this._funcMakeParams([t,e]),this._funcCall("RawSignFile",i,n,r,null)},rt.prototype.RawVerifyFile=function(t,e,n,r,i){var o,s=[];return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(e),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("RawVerifyFile",o,r,i,null)},rt.prototype.NBUSign=function(t,e,n,r){var i;if("string"!=typeof t||null!=(t=this._stringToBytes(t,r)))return i=this._funcMakeParams([new S(t),e]),this._funcCall("NBUSign",i,n,r,null)},rt.prototype.NBUVerify=function(t,e,n,r,i,o,s){var a,u=[];if("boolean"!=typeof i&&(s=o,o=i),"string"!=typeof n||null!=(n=this._stringToBytes(n,s)))return u.push(t),u.push(e),u.push(new S(n)),u.push(r),"boolean"==typeof i?u.push(i):u.push(null),a=this._funcMakeParams(u),this._funcCall("NBUVerify",a,o,s,null)},rt.prototype.CtxSignHash=function(t,e,n,r,i,o){var s;if("string"==typeof n||null!=(n=this._base64Encode(n,o)))return s=this._funcMakeParams([t,e,n,r]),this._funcCall("CtxSignHash",s,i,o,null)},rt.prototype.CtxSign=function(t,e,n,r,i,o,s){var a;if("string"!=typeof n||null!=(n=this._stringToBytes(n,s)))return a=this._funcMakeParams([t,e,new S(n),r,i]),this._funcCall("CtxSign",a,o,s,null)},rt.prototype.CtxSignFile=function(t,e,n,r,i,o,s,a){var u;u=this._funcMakeParams([t,e,n,r,i,o]),this._funcCall("CtxSignFile",u,s,a,null)},rt.prototype.CtxAppendSignHash=function(t,e,n,r,i,o,s){var a;if(!("string"!=typeof n&&null==(n=this._base64Encode(n,s))||"string"!=typeof r&&null==(r=this._base64Encode(r,s))))return a=this._funcMakeParams([t,e,n,r,i]),this._funcCall("CtxAppendSignHash",a,o,s,null)},rt.prototype.CtxAppendSign=function(t,e,n,r,i,o,s){var a;if(!(null!=n&&"string"==typeof n&&null==(n=this._stringToBytes(n,s))||"string"!=typeof r&&null==(r=this._base64Encode(r,s))))return a=this._funcMakeParams([t,e,n?new S(n):null,r,i]),this._funcCall("CtxAppendSign",a,o,s,null)},rt.prototype.CtxAppendSignFile=function(t,e,n,r,i,o,s,a){var u;u=this._funcMakeParams([t,e,n,r,i,o]),this._funcCall("CtxAppendSignFile",u,s,a,null)},rt.prototype.CtxGetSignValue=function(t,e,n,r,i){var o;if("string"==typeof n||null!=(n=this._base64Encode(n,i)))return o=this._funcMakeParams([t,e,n]),this._funcCall("CtxGetSignValue",o,r,i,null)},rt.prototype.CtxCreateSignerEx=function(t,e,n,r,i,o,s){var a;if("string"==typeof n||null!=(n=this._base64Encode(n,s)))return a=this._funcMakeParams([t,e,n,r,i]),this._funcCall("CtxCreateSignerEx",a,o,s,null)},rt.prototype.ShowSenderInfo=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("ShowSenderInfo",r,e,n,null)},rt.prototype.IsEnveloped=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("IsEnveloped",r,e,n,null)},rt.prototype.IsEnvelopedFile=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("IsEnvelopedFile",r,e,n,null)},rt.prototype.Envelop=function(t,e,n,r,i,o){var s;if("string"!=typeof r||null!=(r=this._stringToBytes(r,o)))return s=this._funcMakeParams([t,e,n,new S(r)]),this._funcCall("Envelop",s,i,o,null)},rt.prototype.Develop=function(t,e,n,r){var i,o=[];if("boolean"!=typeof e&&(r=n,n=e),"string"==typeof t||null!=(t=this._base64Encode(t,r)))return o.push(t),"boolean"==typeof e?o.push(e):o.push(null),i=this._funcMakeParams(o),this._funcCall("Develop",i,n,r,null)},rt.prototype.EnvelopFile=function(t,e,n,r,i,o,s){var a;a=this._funcMakeParams([t,e,n,r,i]),this._funcCall("EnvelopFile",a,o,s,null)},rt.prototype.DevelopFile=function(t,e,n,r,i){var o,s=[];return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(e),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("DevelopFile",o,r,i,null)},rt.prototype.EnvelopEx=function(t,e,n,r,i,o){var s;if("EndUserArrayList"==t.className&&(t=t.m_array),"EndUserArrayList"==e.className&&(e=e.m_array),"string"!=typeof r||null!=(r=this._stringToBytes(r,o)))return s=this._funcMakeParams([t,e,n,new S(r)]),this._funcCall("EnvelopEx",s,i,o,null)},rt.prototype.DevelopEx=function(t,e,n,r,i){var o,s=[];if("boolean"!=typeof n&&(i=r,r=n),"string"==typeof t||null!=(t=this._base64Encode(t,i)))return s.push(t),s.push(e?new S(e):null),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("DevelopEx",o,r,i,null)},rt.prototype.EnvelopFileEx=function(t,e,n,r,i,o,s){var a;"EndUserArrayList"==t.className&&(t=t.m_array),"EndUserArrayList"==e.className&&(e=e.m_array),a=this._funcMakeParams([t,e,n,r,i]),this._funcCall("EnvelopFileEx",a,o,s,null)},rt.prototype.EnvelopToRecipients=function(t,e,n,r,i){var o;"EndUserArrayList"==t.className&&(t=t.m_array);for(var s=[],a=0;a<t.length;a++)s.push(new S(t[a]));if("string"!=typeof n||null!=(n=this._stringToBytes(n,i)))return o=this._funcMakeParams([s,e,new S(n)]),this._funcCall("EnvelopToRecipients",o,r,i,null)},rt.prototype.EnvelopFileToRecipients=function(t,e,n,r,i,o){var s;"EndUserArrayList"==t.className&&(t=t.m_array);for(var a=[],u=0;u<t.length;u++)a.push(new S(t[u]));s=this._funcMakeParams([a,e,n,r]),this._funcCall("EnvelopFileToRecipients",s,i,o,null)},rt.prototype.EnvelopToRecipientsEx=function(t,e,n,r,i,o){var s;"EndUserArrayList"==t.className&&(t=t.m_array);for(var a=[],u=0;u<t.length;u++)a.push(new S(t[u]));if("string"!=typeof r||null!=(r=this._stringToBytes(r,o)))return s=this._funcMakeParams([a,e,n,new S(r)]),this._funcCall("EnvelopToRecipientsEx",s,i,o,null)},rt.prototype.EnvelopFileToRecipientsEx=function(t,e,n,r,i,o,s){var a;"EndUserArrayList"==t.className&&(t=t.m_array);for(var u=[],c=0;c<t.length;c++)u.push(new S(t[c]));a=this._funcMakeParams([u,e,n,r,i]),this._funcCall("EnvelopFileToRecipientsEx",a,o,s,null)},rt.prototype.EnvelopToRecipientsWithOCode=function(t,e,n,r,i,o){var s;if("string"!=typeof r||null!=(r=this._stringToBytes(r,o)))return s=this._funcMakeParams([t,e,n,new S(r)]),this._funcCall("EnvelopToRecipientsWithOCode",s,i,o,null)},rt.prototype.EnvelopExWithDynamicKey=function(t,e,n,r,i,o,s){var a;if("EndUserArrayList"==t.className&&(t=t.m_array),"EndUserArrayList"==e.className&&(e=e.m_array),"string"!=typeof i||null!=(i=this._stringToBytes(i,s)))return a=this._funcMakeParams([t,e,n,r,new S(i)]),this._funcCall("EnvelopExWithDynamicKey",a,o,s,null)},rt.prototype.EnvelopFileExWithDynamicKey=function(t,e,n,r,i,o,s,a){var u;"EndUserArrayList"==t.className&&(t=t.m_array),"EndUserArrayList"==e.className&&(e=e.m_array),u=this._funcMakeParams([t,e,n,r,i,o]),this._funcCall("EnvelopFileExWithDynamicKey",u,s,a,null)},rt.prototype.EnvelopToRecipientsWithDynamicKey=function(t,e,n,r,i,o){var s;"EndUserArrayList"==t.className&&(t=t.m_array);for(var a=[],u=0;u<t.length;u++)a.push(new S(t[u]));if("string"!=typeof r||null!=(r=this._stringToBytes(r,o)))return s=this._funcMakeParams([a,e,n,new S(r)]),this._funcCall("EnvelopToRecipientsWithDynamicKey",s,i,o,null)},rt.prototype.EnvelopFileToRecipientsWithDynamicKey=function(t,e,n,r,i,o,s){var a;"EndUserArrayList"==t.className&&(t=t.m_array);for(var u=[],c=0;c<t.length;c++)u.push(new S(t[c]));a=this._funcMakeParams([u,e,n,r,i]),this._funcCall("EnvelopFileToRecipientsWithDynamicKey",a,o,s,null)},rt.prototype.EnvelopToRecipientsWithSettings=function(t,e,n,r,i,o,s,a,u){var c;if("string"!=typeof n||null!=(n=this._stringToBytes(n,u))){"EndUserArrayList"==t.className&&(t=t.m_array);for(var l=[],f=0;f<t.length;f++)l.push(new S(t[f]));return c=this._funcMakeParams([l,e,new S(n),r,i,o,s]),this._funcCall("EnvelopToRecipientsWithSettings",c,a,u,null)}},rt.prototype.RawEnvelop=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._stringToBytes(e,r)))return i=this._funcMakeParams([new S(t),new S(e)]),this._funcCall("RawEnvelop",i,n,r,null)},rt.prototype.RawDevelop=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("RawDevelop",i,n,r,null)},rt.prototype.EnvelopRSA=function(t,e,n,r,i,o,s){return this.EnvelopRSAEx(t,[e],[n],r,i,o,s)},rt.prototype.EnvelopFileRSA=function(t,e,n,r,i,o,s,a){this.EnvelopFileRSAEx(t,[e],[n],r,i,o,s,a)},rt.prototype.EnvelopRSAEx=function(t,e,n,r,i,o,s){var a;if("EndUserArrayList"==e.className&&(e=e.m_array),"EndUserArrayList"==n.className&&(n=n.m_array),"string"!=typeof i||null!=(i=this._stringToBytes(i,s)))return a=this._funcMakeParams([t,e,n,r,new S(i)]),this._funcCall("EnvelopRSAEx",a,o,s,null)},rt.prototype.EnvelopFileRSAEx=function(t,e,n,r,i,o,s,a){var u;"EndUserArrayList"==e.className&&(e=e.m_array),"EndUserArrayList"==n.className&&(n=n.m_array),u=this._funcMakeParams([t,e,n,r,i,o]),this._funcCall("EnvelopFileRSAEx",u,s,a,null)},rt.prototype.EnvelopToRecipientsRSA=function(t,e,n,r,i,o){var s;"EndUserArrayList"==e.className&&(e=e.m_array);for(var a=[],u=0;u<e.length;u++)a.push(new S(e[u]));if("string"!=typeof r||null!=(r=this._stringToBytes(r,o)))return s=this._funcMakeParams([t,a,n,new S(r)]),this._funcCall("EnvelopToRecipientsRSA",s,i,o,null)},rt.prototype.EnvelopFileToRecipientsRSA=function(t,e,n,r,i,o,s){var a;"EndUserArrayList"==e.className&&(e=e.m_array);for(var u=[],c=0;c<e.length;c++)u.push(new S(e[c]));a=this._funcMakeParams([t,u,n,r,i]),this._funcCall("EnvelopFileToRecipientsRSA",a,o,s,null)},rt.prototype.CtxEnvelop=function(t,e,n,r,i,o,s,a){var u;if("string"!=typeof o||null!=(o=this._stringToBytes(o,a))){"EndUserArrayList"==e.className&&(e=e.m_array);for(var c=[],l=0;l<e.length;l++)c.push(new S(e[l]));return u=this._funcMakeParams([t,c,n,r,i,new S(o)]),this._funcCall("CtxEnvelop",u,s,a,null)}},rt.prototype.CtxEnvelopFile=function(t,e,n,r,i,o,s,a,u){var c;"EndUserArrayList"==e.className&&(e=e.m_array);for(var l=[],f=0;f<e.length;f++)l.push(new S(e[f]));c=this._funcMakeParams([t,l,n,r,i,o,s]),this._funcCall("CtxEnvelopFile",c,a,u,null)},rt.prototype.CtxEnvelopWithDynamicKey=function(t,e,n,r,i,o,s,a){var u;if("string"!=typeof o||null!=(o=this._stringToBytes(o,a))){"EndUserArrayList"==e.className&&(e=e.m_array);for(var c=[],l=0;l<e.length;l++)c.push(new S(e[l]));return u=this._funcMakeParams([t,c,n,r,i,new S(o)]),this._funcCall("CtxEnvelopWithDynamicKey",u,s,a,null)}},rt.prototype.CtxEnvelopFileWithDynamicKey=function(t,e,n,r,i,o,s,a,u){var c;"EndUserArrayList"==e.className&&(e=e.m_array);for(var l=[],f=0;f<e.length;f++)l.push(new S(e[f]));c=this._funcMakeParams([t,l,n,r,i,o,s]),this._funcCall("CtxEnvelopFileWithDynamicKey",c,a,u,null)},rt.prototype.CtxDevelop=function(t,e,n,r,i,o){var s,a=[];if("boolean"!=typeof r&&(o=i,i=r),"string"==typeof e||null!=(e=this._base64Encode(e,o)))return a.push(t),a.push(e),a.push(n?new S(n):null),"boolean"==typeof r?a.push(r):a.push(null),s=this._funcMakeParams(a),this._funcCall("CtxDevelop",s,i,o,null)},rt.prototype.CtxDevelopFile=function(t,e,n,r,i,o,s){var a,u=[];return"boolean"!=typeof i&&(s=o,o=i),u.push(t),u.push(e),u.push(n?new S(n):null),u.push(r),"boolean"==typeof i?u.push(i):u.push(null),a=this._funcMakeParams(u),this._funcCall("CtxDevelopFile",a,o,s,null)},rt.prototype.CtxCreateAuthData=function(t,e,n,r,i){var o;if("string"!=typeof n||null!=(n=this._stringToBytes(n,i)))return o=this._funcMakeParams([t,new S(e),new S(n)]),this._funcCall("CtxCreateAuthData",o,r,i,null)},rt.prototype.ProtectDataByPassword=function(t,e,n,r){var i;if("string"!=typeof t||null!=(t=this._stringToBytes(t,r)))return i=this._funcMakeParams([new S(t),e]),this._funcCall("ProtectDataByPassword",i,n,r,null)},rt.prototype.UnprotectDataByPassword=function(t,e,n,r){var i;if("string"==typeof t||null!=(t=this._base64Encode(t,r)))return i=this._funcMakeParams([t,e]),this._funcCall("UnprotectDataByPassword",i,n,r,null)},rt.prototype.SessionIsInitialized=function(t,e,n){var r;return t.SetData(null),r=this._funcMakeParams([t]),this._funcCall("SessionIsInitialized",r,e,n,null)},rt.prototype.SessionClose=function(t,e,n){var r;t.SetData(null),r=this._funcMakeParams([t]),this._funcCall("SessionClose",r,e,n,null)},rt.prototype.ClientSessionCreateStep1=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("ClientSessionCreateStep1",r,e,n,null)},rt.prototype.ServerSessionCreateStep1=function(t,e,n,r){var i;return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ServerSessionCreateStep1",i,n,r,null)},rt.prototype.ClientSessionCreateStep2=function(t,e,n,r){var i,o=this;t.SetData(null),i=this._funcMakeParams([t,new S(e)]),this._funcCall("ClientSessionCreateStep2",i,n,r,(function(e,n,r){t.SetData(e.GetData()),o.IsAsync(n,r)&&n()}))},rt.prototype.ServerSessionCreateStep2=function(t,e,n,r){var i;t.SetData(null),i=this._funcMakeParams([t,new S(e)]),this._funcCall("ServerSessionCreateStep2",i,n,r,null)},rt.prototype.SessionSave=function(t,e,n){var r;return t.SetData(null),r=this._funcMakeParams([t]),this._funcCall("SessionSave",r,e,n,null)},rt.prototype.SessionLoad=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("SessionLoad",r,e,n,null)},rt.prototype.SessionCheckCertificates=function(t,e,n){var r;return t.SetData(null),r=this._funcMakeParams([t]),this._funcCall("SessionCheckCertificates",r,e,n,null)},rt.prototype.SessionEncrypt=function(t,e,n,r){var i,o=!1,s=this;if("string"!=typeof e||(o=!0,null!=(e=this._stringToBytes(e,r))))return t.SetData(null),i=this._funcMakeParams([t,new S(e)]),this._funcCall("SessionEncrypt",i,n,r,o?function(t,e,n){return s.BASE64Encode(t,e,n)}:null)},rt.prototype.SessionDecrypt=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return t.SetData(null),i=this._funcMakeParams([t,new S(e)]),this._funcCall("SessionDecrypt",i,n,r,null)},rt.prototype.SessionEncryptContinue=function(t,e,n,r){var i,o=this,s=!1;if("string"!=typeof e||(s=!0,null!=(e=this._stringToBytes(e,r))))return t.SetData(null),i=this._funcMakeParams([t,new S(e)]),this._funcCall("SessionEncryptContinue",i,n,r,(function(t,n,r){if(s)return o.BASE64Encode(t,n,r);var i=o.IsAsync(n,r);if(!o._copyArrayData(e,t)){var a=o.MakeError(et.ERROR_BAD_PARAMETER,"");if(i)return void r(a);throw new nt(a.errorCode,a.message)}if(!i)return e;n(e)}))},rt.prototype.SessionDecryptContinue=function(t,e,n,r){var i,o=this;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return t.SetData(null),i=this._funcMakeParams([t,new S(e)]),this._funcCall("SessionDecryptContinue",i,n,r,(function(t,n,r){var i=o.IsAsync(n,r);if(!o._copyArrayData(e,t)){var s=o.MakeError(et.ERROR_BAD_PARAMETER,"");if(i)return void r(s);throw new nt(s.errorCode,s.message)}if(!i)return e;n(e)}))},rt.prototype.SessionGetPeerCertificateInfo=function(t,e,n){var r;return t.SetData(null),r=this._funcMakeParams([t]),this._funcCall("SessionGetPeerCertificateInfo",r,e,n,null)},rt.prototype.ClientDynamicKeySessionCreate=function(t,e,n,r,i){var o,s=[];return"string"==typeof e&&"string"==typeof n||(i=r,r=n),s.push(t),"string"==typeof e&&"string"==typeof n?(s.push(e),s.push(n),s.push(null)):(s.push(null),s.push(null),s.push(new S(e))),o=this._funcMakeParams(s),this._funcCall("ClientDynamicKeySessionCreate",o,r,i,null)},rt.prototype.ServerDynamicKeySessionCreate=function(t,e,n,r){var i;return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ServerDynamicKeySessionCreate",i,n,r,null)},rt.prototype.ClientDynamicKeySessionLoad=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("ClientDynamicKeySessionLoad",r,e,n,null)},rt.prototype.SCClientIsRunning=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("SCClientIsRunning",n,t,e,null)},rt.prototype.SCClientStart=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("SCClientStart",n,t,e,null)},rt.prototype.SCClientStop=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("SCClientStop",n,t,e,null)},rt.prototype.SCClientAddGate=function(t,e,n,r,i,o,s,a){var u;"string"!=typeof i&&(s=i,a=o,i=null,o=null),u=this._funcMakeParams([t,e,n,r,i,o]),this._funcCall("SCClientAddGate",u,s,a,null)},rt.prototype.SCClientRemoveGate=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SCClientRemoveGate",r,e,n,null)},rt.prototype.SCClientGetStatistic=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("SCClientGetStatistic",n,t,e,null)},rt.prototype.AppendTransportHeader=function(t,e,n,r,i,o,s){var a;return a=this._funcMakeParams([t,e,n,new S(r),new S(i)]),this._funcCall("AppendTransportHeader",a,o,s,null)},rt.prototype.ParseTransportHeader=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("ParseTransportHeader",r,e,n,null)},rt.prototype.AppendCryptoHeader=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,new S(n)]),this._funcCall("AppendCryptoHeader",o,r,i,null)},rt.prototype.ParseCryptoHeader=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("ParseCryptoHeader",r,e,n,null)},rt.prototype.AppendFileTransportHeader=function(t,e,n,r,i,o,s,a){var u;u=this._funcMakeParams([t,e,n,new S(r),i,o]),this._funcCall("AppendFileTransportHeader",u,s,a,null)},rt.prototype.ParseFileTransportHeader=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("ParseFileTransportHeader",i,n,r,null)},rt.prototype.AppendFileCryptoHeader=function(t,e,n,r,i,o){var s;s=this._funcMakeParams([t,e,n,r]),this._funcCall("AppendFileCryptoHeader",s,i,o,null)},rt.prototype.ParseFileCryptoHeader=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("ParseFileCryptoHeader",i,n,r,null)},rt.prototype.DevCtxEnum=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("DevCtxEnum",r,e,n,null)},rt.prototype.DevCtxOpen=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n]),this._funcCall("DevCtxOpen",o,r,i,null)},rt.prototype.CreateDeviceContext=function(){return new X},rt.prototype.DevCtxEnumVirtual=function(t,e,n){var r,i=this;return r=this._funcMakeParams([t]),this._funcCall("DevCtxEnumVirtual",r,e,n,(function(e,n,r){var o=i.IsAsync(n,r);try{if(null==e){if(!o)return null;n(null)}if(t.set(e[1]),!o)return e[0];n(e[0])}catch(t){var s=i.MakeError(et.ERROR_LIBRARY_COMUNICATION_FAILED,"");if(o)return void r(s);throw new nt(s.errorCode,s.message)}}))},rt.prototype.DevCtxClose=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("DevCtxClose",r,e,n,null)},rt.prototype.DevCtxGetData=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("DevCtxGetData",i,n,r,null)},rt.prototype.DevCtxChangePassword=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("DevCtxChangePassword",i,n,r,null)},rt.prototype.GetHostInfo=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetHostInfo",n,t,e,null)},rt.prototype.IsRemotelyControlled=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("IsRemotelyControlled",n,t,e,null)},rt.prototype.CtxCreate=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("CtxCreate",n,t,e,null)},rt.prototype.CtxFree=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("CtxFree",r,e,n,null)},rt.prototype.CtxSetParameter=function(t,e,n,r,i){var o;"boolean"==typeof n&&(n=n?1:0),o=this._funcMakeParams([t,e,n]),this._funcCall("CtxSetParameter",o,r,i,null)},rt.prototype.CreateReference=function(t,e){return new $(t,e)},rt.prototype.ASiCGetASiCType=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._base64Decode(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("ASiCGetASiCType",r,e,n,null)},rt.prototype.ASiCGetSignType=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._base64Decode(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("ASiCGetSignType",r,e,n,null)},rt.prototype.ASiCGetSignsCount=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._base64Decode(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("ASiCGetSignsCount",r,e,n,null)},rt.prototype.ASiCGetSignerInfo=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ASiCGetSignerInfo",i,n,r,null)},rt.prototype.ASiCGetSignTimeInfo=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ASiCGetSignTimeInfo",i,n,r,null)},rt.prototype.ASiCGetSignReferences=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ASiCGetSignReferences",i,n,r,null)},rt.prototype.ASiCGetReference=function(t,e,n,r){var i;if("string"!=typeof t||null!=(t=this._base64Decode(t,r)))return i=this._funcMakeParams([new S(t),e]),this._funcCall("ASiCGetReference",i,n,r,null)},rt.prototype.ASiCSign=function(t,e,n,r,i,o){for(var s,a=[],u=[],c=0;c<r.length;c++)a.push(r[c].GetName()),u.push(new S(r[c].GetData()));return s=this._funcMakeParams([t,e,n,a,u]),this._funcCall("ASiCSign",s,i,o,null)},rt.prototype.ASiCAppendSign=function(t,e,n,r,i){var o;if("string"!=typeof n||null!=(n=this._base64Decode(n,i)))return o=this._funcMakeParams([t,e,new S(n)]),this._funcCall("ASiCAppendSign",o,r,i,null)},rt.prototype.ASiCVerify=function(t,e,n,r,i){var o,s=[];if("string"!=typeof e||null!=(e=this._base64Decode(e,i)))return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(new S(e)),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("ASiCVerify",o,r,i,null)},rt.prototype.CtxASiCSign=function(t,e,n,r,i,o,s,a){for(var u,c=[],l=[],f=0;f<o.length;f++)c.push(o[f].GetName()),l.push(new S(o[f].GetData()));return u=this._funcMakeParams([t,e,n,r,i,c,l]),this._funcCall("CtxASiCSign",u,s,a,null)},rt.prototype.CtxASiCAppendSign=function(t,e,n,r,i,o,s){var a;if("string"!=typeof i||null!=(i=this._base64Decode(i,s)))return a=this._funcMakeParams([t,e,n,r,new S(i)]),this._funcCall("CtxASiCAppendSign",a,o,s,null)},rt.prototype.CtxASiCGetSignerInfo=function(t,e,n,r,i){var o;if("string"!=typeof n||null!=(n=this._base64Decode(n,i)))return o=this._funcMakeParams([t,e,new S(n)]),this._funcCall("CtxASiCGetSignerInfo",o,r,i,null)},rt.prototype.ASiCGetSignLevel=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ASiCGetSignLevel",i,n,r,null)},rt.prototype.ASiCIsAllContentCovered=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ASiCIsAllContentCovered",i,n,r,null)},rt.prototype.PDFGetSignType=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("PDFGetSignType",i,n,r,null)},rt.prototype.PDFGetSignsCount=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._base64Decode(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("PDFGetSignsCount",r,e,n,null)},rt.prototype.PDFGetSignerInfo=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("PDFGetSignerInfo",i,n,r,null)},rt.prototype.PDFGetSignTimeInfo=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("PDFGetSignTimeInfo",i,n,r,null)},rt.prototype.PDFSign=function(t,e,n,r){var i;return i=this._funcMakeParams([new S(t),e]),this._funcCall("PDFSign",i,n,r,null)},rt.prototype.PDFVerify=function(t,e,n,r,i){var o,s=[];if("string"!=typeof e||null!=(e=this._base64Decode(e,i)))return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(new S(e)),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("PDFVerify",o,r,i,null)},rt.prototype.CtxPDFSign=function(t,e,n,r,i,o){var s;return s=this._funcMakeParams([t,e,new S(n),r]),this._funcCall("CtxPDFSign",s,i,o,null)},rt.prototype.CtxPDFGetSignerInfo=function(t,e,n,r,i){var o;if("string"!=typeof n||null!=(n=this._base64Decode(n,i)))return o=this._funcMakeParams([t,e,new S(n)]),this._funcCall("CtxPDFGetSignerInfo",o,r,i,null)},rt.prototype.XAdESGetType=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._base64Decode(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("XAdESGetType",r,e,n,null)},rt.prototype.XAdESGetSignsCount=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._base64Decode(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("XAdESGetSignsCount",r,e,n,null)},rt.prototype.XAdESGetSignLevel=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("XAdESGetSignLevel",i,n,r,null)},rt.prototype.XAdESGetSignerInfo=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("XAdESGetSignerInfo",i,n,r,null)},rt.prototype.XAdESGetSignTimeInfo=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("XAdESGetSignTimeInfo",i,n,r,null)},rt.prototype.XAdESGetSignReferences=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("XAdESGetSignReferences",i,n,r,null)},rt.prototype.XAdESGetReference=function(t,e,n,r){var i;if("string"!=typeof t||null!=(t=this._base64Decode(t,r)))return i=this._funcMakeParams([new S(t),e]),this._funcCall("XAdESGetReference",i,n,r,null)},rt.prototype.XAdESSign=function(t,e,n,r,i){for(var o,s=[],a=[],u=0;u<n.length;u++)s.push(n[u].GetName()),a.push(new S(n[u].GetData()));return o=this._funcMakeParams([t,e,s,a]),this._funcCall("XAdESSign",o,r,i,null)},rt.prototype.XAdESVerify=function(t,e,n,r,i,o){var s,a=[],u=null,c=null;if(null!=t){u=[],c=[];for(var l=0;l<t.length;l++)u.push(t[l].GetName()),c.push(new S(t[l].GetData()))}if("string"!=typeof n||null!=(n=this._base64Decode(n,o)))return"boolean"!=typeof r&&(o=i,i=r),a.push(u),a.push(c),a.push(e),a.push(new S(n)),"boolean"==typeof r?a.push(r):a.push(null),s=this._funcMakeParams(a),this._funcCall("XAdESVerify",s,i,o,null)},rt.prototype.CtxXAdESSign=function(t,e,n,r,i,o,s){for(var a,u=[],c=[],l=0;l<i.length;l++)u.push(i[l].GetName()),c.push(new S(i[l].GetData()));return a=this._funcMakeParams([t,e,n,r,u,c]),this._funcCall("CtxXAdESSign",a,o,s,null)},rt.prototype.CtxXAdESGetSignerInfo=function(t,e,n,r,i){var o;if("string"!=typeof n||null!=(n=this._base64Decode(n,i)))return o=this._funcMakeParams([t,e,new S(n)]),this._funcCall("CtxXAdESGetSignerInfo",o,r,i,null)},rt.prototype.SServerClientGeneratePrivateKeyAsync=function(t,e,n,r,i,o,s,a,u,c,l,f,_){var p;return p=this._funcMakeParams([t,e,n,r,i,o,s,a,u,c,l]),this._funcCall("SServerClientGeneratePrivateKeyAsync",p,f,_,null)},rt.prototype.SServerClientCheckGeneratePrivateKeyStatus=function(t,e,n,r,i,o){var s,a=this;return s=this._funcMakeParams([t,e,n,r]),this._funcCall("SServerClientCheckGeneratePrivateKeyStatus",s,i,o,(function(t,e,n){var r=a.IsAsync(e,n);try{for(var i=new p,o=0;o<t.length;o++)i.add(t[o]);if(0==i.size()&&(i=null),!r)return i;e(i)}catch(t){var s=a.MakeError(et.ERROR_LIBRARY_COMUNICATION_FAILED,"");if(r)return void n(s);throw new nt(s.errorCode,s.message)}}))},rt.prototype.SServerClientSignHashAsync=function(t,e,n,r,i,o,s,a,u){var c;if("string"==typeof o||null!=(o=this._base64Encode(o,u)))return c=this._funcMakeParams([t,e,n,r,i,o,s]),this._funcCall("SServerClientSignHashAsync",c,a,u,null)},rt.prototype.SServerClientCheckSignHashStatus=function(t,e,n,r,i,o){var s;return s=this._funcMakeParams([t,e,n,r]),this._funcCall("SServerClientCheckSignHashStatus",s,i,o,null)},rt.prototype.SServerClientSignHashesAsync=function(t,e,n,r,i,o,s,a,u,c){var l;return"EndUserArrayList"==o.className&&(o=o.m_array),"EndUserArrayList"==s.className&&(s=s.m_array),l=this._funcMakeParams([t,e,n,r,i,o,s,a]),this._funcCall("SServerClientSignHashesAsync",l,u,c,null)},rt.prototype.SServerClientCheckSignHashesStatus=function(t,e,n,r,i,o){var s,a=this;return s=this._funcMakeParams([t,e,n,r]),this._funcCall("SServerClientCheckSignHashesStatus",s,i,o,(function(t,e,n){var r=a.IsAsync(e,n);try{for(var i=new p,o=0;o<t.length;o++)i.add(t[o]);if(0==i.size()&&(i=null),!r)return i;e(i)}catch(t){var s=a.MakeError(et.ERROR_LIBRARY_COMUNICATION_FAILED,"");if(r)return void n(s);throw new nt(s.errorCode,s.message)}}))},{EndUserLibraryLoader:_,EUSignCP:rt,EndUserError:et}})?r.apply(e,i):r)||(t.exports=o)},function(t,e,n){"use strict";n.r(e),n.d(e,"CASettings",(function(){return s.a})),n.d(e,"KSPSettings",(function(){return s.d})),n.d(e,"EndUserError",(function(){return i})),n.d(e,"EndUserConstants",(function(){return h})),n.d(e,"EndUserEvents",(function(){return r})),n.d(e,"EndUserLibraryInfoJS",(function(){return o.a})),n.d(e,"EndUserLibraryInfoSW",(function(){return o.b})),n.d(e,"EndUserSettings",(function(){return s.c})),n.d(e,"EndUserProxySettings",(function(){return s.b})),n.d(e,"EndUserOwnerInfo",(function(){return a.a})),n.d(e,"EndUserCertificateInfoEx",(function(){return u.a})),n.d(e,"EndUserCertificate",(function(){return c})),n.d(e,"EndUserKeyMedia",(function(){return l})),n.d(e,"EndUserJKSPrivateKeyInfo",(function(){return f.a})),n.d(e,"EndUserContext",(function(){return _})),n.d(e,"EndUserPrivateKeyContext",(function(){return p})),n.d(e,"EndUserTimeInfo",(function(){return y.a})),n.d(e,"EndUserSignContainerInfo",(function(){return S.a})),n.d(e,"EndUserSignInfo",(function(){return C.a})),n.d(e,"EndUserSenderInfo",(function(){return d.a})),n.d(e,"EndUserParams",(function(){return A.a})),n.d(e,"EndUserInfo",(function(){return R})),n.d(e,"EndUserRequestInfo",(function(){return m.a})),n.d(e,"EndUserClientRegistrationParameters",(function(){return T})),n.d(e,"EndUserClientRegistrationToken",(function(){return g})),n.d(e,"EndUserTaxReport",(function(){return E.b})),n.d(e,"EndUserTaxReceipt",(function(){return E.a})),n.d(e,"EndUser",(function(){return b}));var r={};n.r(r),n.d(r,"EndUserConfirmKSPOperationEvent",(function(){return P}));var i=n(1),o=n(13),s=n(9),a=n(10),u=n(8),c=function(){},l=function(t){this.type=t?t.type:"",this.device=t?t.device:"",this.visibleName=t?t.visibleName:"",this.typeIndex=t?t.typeIndex:-1,this.devIndex=t?t.devIndex:-1,this.password=t?t.password:"",this.user=t?t.user:""},f=n(14),_=function(){},p=function(){},h=n(0),E=n(11),y=n(6),S=n(7),C=n(5),d=n(12),A=n(15),R=function(){this.version=h.EU_USER_INFO_VERSION,this.commonName="",this.locality="",this.state="",this.organization="",this.orgUnit="",this.title="",this.street="",this.phone="",this.surname="",this.givenname="",this.EMail="",this.DNS="",this.EDRPOUCode="",this.DRFOCode="",this.NBUCode="",this.SPFMCode="",this.OCode="",this.OUCode="",this.userCode="",this.UPN="",this.UNZR="",this.country="UA"},m=n(16),T=function(){},g=function(){},P=function(){this.type=h.EndUserEventType.ConfirmKSPOperation},v=n(18),I=function(){function t(t,e){var n=this,r="";"number"==typeof e&&e>0&&("string"==typeof r&&r.length>0&&(r="var EU_MAX_DATA_SIZE_MB = "+e+";"+r),"string"==typeof t&&t.length>0&&(t+=(t.includes("?")?"&":"?")+"maxDataSize="+e)),this.m_worker=new v.a(r,t,(function(t){n.OnEvent(t)})),this.m_eventListeners=new Array}return t.prototype.OnEvent=function(t){try{var e=this.m_eventListeners[t.type]||this.m_eventListeners[h.EndUserEventType.All];e&&e(t)}catch(t){}},t.prototype.AddEventListener=function(t,e){switch(t){case h.EndUserEventType.None:this.m_eventListeners=[];break;case h.EndUserEventType.All:this.m_eventListeners=[],this.m_eventListeners[t]=e;break;default:this.m_eventListeners[t]=e}return this.m_worker.postMessage("AddEventListener",[t])},t.prototype.GetLibraryInfo=function(t){return this.m_worker.postMessage("GetLibraryInfo",Array.prototype.slice.call(arguments))},t.prototype.IsInitialized=function(){return this.m_worker.postMessage("IsInitialized",Array.prototype.slice.call(arguments))},t.prototype.Initialize=function(t){return this.m_worker.postMessage("Initialize",Array.prototype.slice.call(arguments))},t.prototype.SetLanguage=function(t){return this.m_worker.postMessage("SetLanguage",Array.prototype.slice.call(arguments))},t.prototype.SetRuntimeParameter=function(t,e){return this.m_worker.postMessage("SetRuntimeParameter",Array.prototype.slice.call(arguments))},t.prototype.GetStorageParameter=function(t,e){return this.m_worker.postMessage("GetStorageParameter",Array.prototype.slice.call(arguments))},t.prototype.SetStorageParameter=function(t,e,n){return this.m_worker.postMessage("SetStorageParameter",Array.prototype.slice.call(arguments))},t.prototype.GetCAs=function(){return this.m_worker.postMessage("GetCAs",Array.prototype.slice.call(arguments))},t.prototype.GetProxySettings=function(){return this.m_worker.postMessage("GetProxySettings",Array.prototype.slice.call(arguments))},t.prototype.SetProxySettings=function(t){return this.m_worker.postMessage("SetProxySettings",Array.prototype.slice.call(arguments))},t.prototype.GetHostInfo=function(){return this.m_worker.postMessage("GetHostInfo",Array.prototype.slice.call(arguments))},t.prototype.GetKeyMedias=function(){return this.m_worker.postMessage("GetKeyMedias",Array.prototype.slice.call(arguments))},t.prototype.GetJKSPrivateKeys=function(t){return this.m_worker.postMessage("GetJKSPrivateKeys",Array.prototype.slice.call(arguments))},t.prototype.IsPrivateKeyReaded=function(){return this.m_worker.postMessage("IsPrivateKeyReaded",Array.prototype.slice.call(arguments))},t.prototype.ResetPrivateKey=function(){return this.m_worker.postMessage("ResetPrivateKey",Array.prototype.slice.call(arguments))},t.prototype.ResetOperationKSP=function(){return this.m_worker.postMessage("ResetOperationKSP",Array.prototype.slice.call(arguments))},t.prototype.ReadPrivateKey=function(t,e,n){return this.m_worker.postMessage("ReadPrivateKey",Array.prototype.slice.call(arguments))},t.prototype.ReadPrivateKeyBinary=function(t,e,n,r){return this.m_worker.postMessage("ReadPrivateKeyBinary",Array.prototype.slice.call(arguments))},t.prototype.ReadPrivateKeySIM=function(t,e,n,r){return this.m_worker.postMessage("ReadPrivateKeySIM",Array.prototype.slice.call(arguments))},t.prototype.ReadPrivateKeyKSP=function(t,e,n,r,i,o){return this.m_worker.postMessage("ReadPrivateKeyKSP",Array.prototype.slice.call(arguments))},t.prototype.GetOwnCertificates=function(){return this.m_worker.postMessage("GetOwnCertificates",Array.prototype.slice.call(arguments))},t.prototype.GetOwnEUserParams=function(){return this.m_worker.postMessage("GetOwnEUserParams",Array.prototype.slice.call(arguments))},t.prototype.ChangeOwnCertificatesStatus=function(t,e){return this.m_worker.postMessage("ChangeOwnCertificatesStatus",Array.prototype.slice.call(arguments))},t.prototype.MakeNewCertificate=function(t,e,n,r,i,o,s,a,u,c,l,f,_,p,h,E,y,S){return void 0===E&&(E=!1),void 0===y&&(y=null),void 0===S&&(S=null),this.m_worker.postMessage("MakeNewCertificate",Array.prototype.slice.call(arguments))},t.prototype.MakeDeviceCertificate=function(t,e,n,r,i){return this.m_worker.postMessage("MakeDeviceCertificate",Array.prototype.slice.call(arguments))},t.prototype.SetKeyMediaUserPassword=function(t,e){return this.m_worker.postMessage("SetKeyMediaUserPassword",Array.prototype.slice.call(arguments))},t.prototype.ChangePrivateKeyPassword=function(t,e){return this.m_worker.postMessage("ChangePrivateKeyPassword",Array.prototype.slice.call(arguments))},t.prototype.ChangePrivateKeyPasswordBinary=function(t,e,n){return this.m_worker.postMessage("ChangePrivateKeyPasswordBinary",Array.prototype.slice.call(arguments))},t.prototype.GeneratePrivateKey=function(t,e,n,r,i,o,s,a,u,c,l,f){return this.m_worker.postMessage("GeneratePrivateKey",Array.prototype.slice.call(arguments))},t.prototype.GeneratePrivateKeyBinary=function(t,e,n,r,i,o,s,a,u,c,l){return this.m_worker.postMessage("GeneratePrivateKeyBinary",Array.prototype.slice.call(arguments))},t.prototype.GetKeyInfo=function(t){return this.m_worker.postMessage("GetKeyInfo",Array.prototype.slice.call(arguments))},t.prototype.GetKeyInfoBinary=function(t,e){return this.m_worker.postMessage("GetKeyInfoBinary",Array.prototype.slice.call(arguments))},t.prototype.GetClientRegistrationTokenKSP=function(t,e){return void 0===e&&(e=null),this.m_worker.postMessage("GetClientRegistrationTokenKSP",Array.prototype.slice.call(arguments))},t.prototype.HashData=function(t,e,n){return this.m_worker.postMessage("HashData",Array.prototype.slice.call(arguments))},t.prototype.GetSigner=function(t,e,n){return void 0===e&&(e=-1),void 0===n&&(n=!1),this.m_worker.postMessage("GetSigner",Array.prototype.slice.call(arguments))},t.prototype.SignData=function(t,e){return void 0===e&&(e=!1),this.m_worker.postMessage("SignData",Array.prototype.slice.call(arguments))},t.prototype.SignDataInternal=function(t,e,n){return void 0===n&&(n=!1),this.m_worker.postMessage("SignDataInternal",Array.prototype.slice.call(arguments))},t.prototype.SignHash=function(t,e,n,r){return this.m_worker.postMessage("SignHash",Array.prototype.slice.call(arguments))},t.prototype.SignDataEx=function(t,e,n,r,i){return this.m_worker.postMessage("SignDataEx",Array.prototype.slice.call(arguments))},t.prototype.AppendSign=function(t,e,n,r,i){return this.m_worker.postMessage("AppendSign",Array.prototype.slice.call(arguments))},t.prototype.AppendSignHash=function(t,e,n,r,i){return this.m_worker.postMessage("AppendSignHash",Array.prototype.slice.call(arguments))},t.prototype.VerifyHash=function(t,e,n){return void 0===n&&(n=-1),this.m_worker.postMessage("VerifyHash",Array.prototype.slice.call(arguments))},t.prototype.VerifyData=function(t,e,n){return void 0===n&&(n=-1),this.m_worker.postMessage("VerifyData",Array.prototype.slice.call(arguments))},t.prototype.VerifyDataInternal=function(t,e){return void 0===e&&(e=-1),this.m_worker.postMessage("VerifyDataInternal",Array.prototype.slice.call(arguments))},t.prototype.EnvelopData=function(t,e,n,r,i,o){return void 0===o&&(o=!1),this.m_worker.postMessage("EnvelopData",Array.prototype.slice.call(arguments))},t.prototype.DevelopData=function(t,e){return this.m_worker.postMessage("DevelopData",Array.prototype.slice.call(arguments))},t.prototype.CreateAuthData=function(t,e,n){return this.m_worker.postMessage("CreateAuthData",Array.prototype.slice.call(arguments))},t.prototype.ProtectDataByPassword=function(t,e,n){return this.m_worker.postMessage("ProtectDataByPassword",Array.prototype.slice.call(arguments))},t.prototype.UnprotectDataByPassword=function(t,e,n){return this.m_worker.postMessage("UnprotectDataByPassword",Array.prototype.slice.call(arguments))},t.prototype.GetTSPByAccessInfo=function(t,e,n,r,i){return this.m_worker.postMessage("GetTSPByAccessInfo",Array.prototype.slice.call(arguments))},t.prototype.CheckTSP=function(t,e,n){return this.m_worker.postMessage("CheckTSP",Array.prototype.slice.call(arguments))},t.prototype.CtxCreate=function(){return this.m_worker.postMessage("CtxCreate",Array.prototype.slice.call(arguments))},t.prototype.CtxFree=function(t){return this.m_worker.postMessage("CtxFree",Array.prototype.slice.call(arguments))},t.prototype.CtxSetParameter=function(t,e,n){return this.m_worker.postMessage("CtxSetParameter",Array.prototype.slice.call(arguments))},t.prototype.CtxReadPrivateKey=function(t,e,n,r){return this.m_worker.postMessage("CtxReadPrivateKey",Array.prototype.slice.call(arguments))},t.prototype.CtxReadPrivateKeyBinary=function(t,e,n,r,i){return this.m_worker.postMessage("CtxReadPrivateKeyBinary",Array.prototype.slice.call(arguments))},t.prototype.CtxFreePrivateKey=function(t){return this.m_worker.postMessage("CtxFreePrivateKey",Array.prototype.slice.call(arguments))},t.prototype.CtxGetOwnCertificates=function(t){return this.m_worker.postMessage("CtxGetOwnCertificates",Array.prototype.slice.call(arguments))},t.prototype.CtxSignHash=function(t,e,n,r,i){return this.m_worker.postMessage("CtxSignHash",Array.prototype.slice.call(arguments))},t.prototype.CtxSignData=function(t,e,n,r,i,o){return this.m_worker.postMessage("CtxSignData",Array.prototype.slice.call(arguments))},t.prototype.CtxAppendSignHash=function(t,e,n,r,i,o){return this.m_worker.postMessage("CtxAppendSignHash",Array.prototype.slice.call(arguments))},t.prototype.CtxAppendSign=function(t,e,n,r,i,o){return this.m_worker.postMessage("CtxAppendSign",Array.prototype.slice.call(arguments))},t.prototype.CtxGetSignValue=function(t,e,n,r){return this.m_worker.postMessage("CtxGetSignValue",Array.prototype.slice.call(arguments))},t.prototype.CtxEnvelopData=function(t,e,n,r,i,o,s){return this.m_worker.postMessage("CtxEnvelopData",Array.prototype.slice.call(arguments))},t.prototype.CtxDevelopData=function(t,e,n){return this.m_worker.postMessage("CtxDevelopData",Array.prototype.slice.call(arguments))},t.prototype.ProtectTaxReports=function(t,e,n,r,i,o,s){return void 0===t&&(t=null),void 0===e&&(e=null),void 0===n&&(n=null),void 0===s&&(s=!1),this.m_worker.postMessage("ProtectTaxReports",Array.prototype.slice.call(arguments))},t.prototype.UnprotectTaxReceipts=function(t,e){return this.m_worker.postMessage("UnprotectTaxReceipts",Array.prototype.slice.call(arguments))},t.prototype.ASiCGetSigner=function(t,e,n){return this.m_worker.postMessage("ASiCGetSigner",Array.prototype.slice.call(arguments))},t.prototype.ASiCSignData=function(t,e,n,r,i,o){return this.m_worker.postMessage("ASiCSignData",Array.prototype.slice.call(arguments))},t.prototype.ASiCAppendSign=function(t,e,n,r,i){return this.m_worker.postMessage("ASiCAppendSign",Array.prototype.slice.call(arguments))},t.prototype.ASiCVerifyData=function(t,e){return void 0===e&&(e=-1),this.m_worker.postMessage("ASiCVerifyData",Array.prototype.slice.call(arguments))},t.prototype.PDFSignData=function(t,e,n,r){return this.m_worker.postMessage("PDFSignData",Array.prototype.slice.call(arguments))},t.prototype.PDFVerifyData=function(t,e){return void 0===e&&(e=-1),this.m_worker.postMessage("PDFVerifyData",Array.prototype.slice.call(arguments))},t.prototype.PDFGetSigner=function(t,e,n){return void 0===e&&(e=-1),void 0===n&&(n=!1),this.m_worker.postMessage("PDFGetSigner",Array.prototype.slice.call(arguments))},t.prototype.XAdESGetSigner=function(t,e,n){return void 0===e&&(e=-1),void 0===n&&(n=!1),this.m_worker.postMessage("XAdESGetSigner",Array.prototype.slice.call(arguments))},t.prototype.XAdESSignData=function(t,e,n,r,i){return this.m_worker.postMessage("XAdESSignData",Array.prototype.slice.call(arguments))},t.prototype.XAdESVerifyData=function(t,e,n){return void 0===n&&(n=-1),this.m_worker.postMessage("XAdESVerifyData",Array.prototype.slice.call(arguments))},t.prototype.GetSignContainerInfo=function(t){return this.m_worker.postMessage("GetSignContainerInfo",Array.prototype.slice.call(arguments))},t}(),U=n(19),b=function(){function t(t,e,n){switch(void 0===e&&(e=h.EndUserLibraryType.JS),void 0===n&&(n=5),e){case h.EndUserLibraryType.SW:this.m_library=new U.a;break;case h.EndUserLibraryType.JS:case h.EndUserLibraryType.MS:default:this.m_library=new I(t,n)}}return t.prototype.AddEventListener=function(t,e){return this.m_library.AddEventListener(t,e)},t.prototype.GetLibraryInfo=function(t){return this.m_library.GetLibraryInfo(t)},t.prototype.IsInitialized=function(){return this.m_library.IsInitialized()},t.prototype.Initialize=function(t){return this.m_library.Initialize(t)},t.prototype.SetLanguage=function(t){return this.m_library.SetLanguage(t)},t.prototype.SetRuntimeParameter=function(t,e){return this.m_library.SetRuntimeParameter(t,e)},t.prototype.GetStorageParameter=function(t,e){return void 0===e&&(e=!1),this.m_library.GetStorageParameter(t,e)},t.prototype.SetStorageParameter=function(t,e,n){return void 0===n&&(n=!1),this.m_library.SetStorageParameter(t,e,n)},t.prototype.GetCAs=function(){return this.m_library.GetCAs()},t.prototype.GetProxySettings=function(){return this.m_library.GetProxySettings()},t.prototype.SetProxySettings=function(t){return this.m_library.SetProxySettings(t)},t.prototype.GetHostInfo=function(){return this.m_library.GetHostInfo()},t.prototype.GetKeyMedias=function(){return this.m_library.GetKeyMedias()},t.prototype.GetJKSPrivateKeys=function(t){return this.m_library.GetJKSPrivateKeys(t)},t.prototype.IsPrivateKeyReaded=function(){return this.m_library.IsPrivateKeyReaded()},t.prototype.ResetPrivateKey=function(){return this.m_library.ResetPrivateKey()},t.prototype.ResetOperationKSP=function(){return this.m_library.ResetOperationKSP()},t.prototype.ReadPrivateKey=function(t,e,n){return this.m_library.ReadPrivateKey(t,e,n)},t.prototype.ReadPrivateKeyBinary=function(t,e,n,r){return this.m_library.ReadPrivateKeyBinary(t,e,n,r)},t.prototype.ReadPrivateKeySIM=function(t,e,n,r){return void 0===n&&(n=!0),void 0===r&&(r=0),this.m_library.ReadPrivateKeySIM(t,e,n,r)},t.prototype.ReadPrivateKeyKSP=function(t,e,n,r,i,o){return void 0===n&&(n=!0),void 0===r&&(r=0),void 0===i&&(i=null),void 0===o&&(o=null),this.m_library.ReadPrivateKeyKSP(t,e,n,r,i,o)},t.prototype.GetOwnCertificates=function(){return this.m_library.GetOwnCertificates()},t.prototype.GetOwnEUserParams=function(){return this.m_library.GetOwnEUserParams()},t.prototype.ChangeOwnCertificatesStatus=function(t,e){return this.m_library.ChangeOwnCertificatesStatus(t,e)},t.prototype.MakeNewCertificate=function(t,e,n,r,i,o,s,a,u,c,l,f,_,p,h,E,y,S){return void 0===E&&(E=!1),void 0===y&&(y=null),void 0===S&&(S=null),this.m_library.MakeNewCertificate(t,e,n,r,i,o,s,a,u,c,l,f,_,p,h,E,y,S)},t.prototype.MakeDeviceCertificate=function(t,e,n,r,i){return this.m_library.MakeDeviceCertificate(t,e,n,r,i)},t.prototype.SetKeyMediaUserPassword=function(t,e){return this.m_library.SetKeyMediaUserPassword(t,e)},t.prototype.ChangePrivateKeyPassword=function(t,e){return this.m_library.ChangePrivateKeyPassword(t,e)},t.prototype.ChangePrivateKeyPasswordBinary=function(t,e,n){return this.m_library.ChangePrivateKeyPasswordBinary(t,e,n)},t.prototype.GeneratePrivateKey=function(t,e,n,r,i,o,s,a,u,c,l,f){return this.m_library.GeneratePrivateKey(t,e,n,r,i,o,s,a,u,c,l,f)},t.prototype.GeneratePrivateKeyBinary=function(t,e,n,r,i,o,s,a,u,c,l){return this.m_library.GeneratePrivateKeyBinary(t,e,n,r,i,o,s,a,u,c,l)},t.prototype.GetKeyInfo=function(t){return this.m_library.GetKeyInfo(t)},t.prototype.GetKeyInfoBinary=function(t,e){return this.m_library.GetKeyInfoBinary(t,e)},t.prototype.GetClientRegistrationTokenKSP=function(t,e){return this.m_library.GetClientRegistrationTokenKSP(t,e)},t.prototype.HashData=function(t,e,n){return this.m_library.HashData(t,e,n)},t.prototype.GetSigner=function(t,e,n){return this.m_library.GetSigner(t,e,n)},t.prototype.SignData=function(t,e){return void 0===e&&(e=!1),this.m_library.SignData(t,e)},t.prototype.SignDataInternal=function(t,e,n){return void 0===n&&(n=!1),this.m_library.SignDataInternal(t,e,n)},t.prototype.SignHash=function(t,e,n,r){return void 0===r&&(r=!1),this.m_library.SignHash(t,e,n,r)},t.prototype.SignDataEx=function(t,e,n,r,i){return void 0===i&&(i=!1),this.m_library.SignDataEx(t,e,n,r,i)},t.prototype.AppendSign=function(t,e,n,r,i){return void 0===i&&(i=!1),this.m_library.AppendSign(t,e,n,r,i)},t.prototype.AppendSignHash=function(t,e,n,r,i){return this.m_library.AppendSignHash(t,e,n,r,i)},t.prototype.VerifyHash=function(t,e,n){return void 0===n&&(n=-1),this.m_library.VerifyHash(t,e,n)},t.prototype.VerifyData=function(t,e,n){return void 0===n&&(n=-1),this.m_library.VerifyData(t,e,n)},t.prototype.VerifyDataInternal=function(t,e){return void 0===e&&(e=-1),this.m_library.VerifyDataInternal(t,e)},t.prototype.EnvelopData=function(t,e,n,r,i,o){return void 0===o&&(o=!1),this.m_library.EnvelopData(t,e,n,r,i,o)},t.prototype.DevelopData=function(t,e){return this.m_library.DevelopData(t,e)},t.prototype.ProtectDataByPassword=function(t,e,n){return this.m_library.ProtectDataByPassword(t,e,n)},t.prototype.UnprotectDataByPassword=function(t,e,n){return this.m_library.UnprotectDataByPassword(t,e,n)},t.prototype.CreateAuthData=function(t,e,n){return this.m_library.CreateAuthData(t,e,n)},t.prototype.GetTSPByAccessInfo=function(t,e,n,r,i){return this.m_library.GetTSPByAccessInfo(t,e,n,r,i)},t.prototype.CheckTSP=function(t,e,n){return this.m_library.CheckTSP(t,e,n)},t.prototype.CtxCreate=function(){return this.m_library.CtxCreate()},t.prototype.CtxFree=function(t){return this.m_library.CtxFree(t)},t.prototype.CtxSetParameter=function(t,e,n){return this.m_library.CtxSetParameter(t,e,n)},t.prototype.CtxReadPrivateKey=function(t,e,n,r){return void 0===t&&(t=null),this.m_library.CtxReadPrivateKey(t,e,n,r)},t.prototype.CtxReadPrivateKeyBinary=function(t,e,n,r,i){return void 0===t&&(t=null),this.m_library.CtxReadPrivateKeyBinary(t,e,n,r,i)},t.prototype.CtxFreePrivateKey=function(t){return this.m_library.CtxFreePrivateKey(t)},t.prototype.CtxGetOwnCertificates=function(t){return this.m_library.CtxGetOwnCertificates(t)},t.prototype.CtxSignHash=function(t,e,n,r,i){return this.m_library.CtxSignHash(t,e,n,r,i)},t.prototype.CtxSignData=function(t,e,n,r,i,o){return this.m_library.CtxSignData(t,e,n,r,i,o)},t.prototype.CtxAppendSignHash=function(t,e,n,r,i,o){return this.m_library.CtxAppendSignHash(t,e,n,r,i,o)},t.prototype.CtxAppendSign=function(t,e,n,r,i,o){return this.m_library.CtxAppendSign(t,e,n,r,i,o)},t.prototype.CtxGetSignValue=function(t,e,n,r){return this.m_library.CtxGetSignValue(t,e,n,r)},t.prototype.CtxEnvelopData=function(t,e,n,r,i,o,s){return this.m_library.CtxEnvelopData(t,e,n,r,i,o,s)},t.prototype.CtxDevelopData=function(t,e,n){return this.m_library.CtxDevelopData(t,e,n)},t.prototype.ProtectTaxReports=function(t,e,n,r,i,o,s){return void 0===t&&(t=null),void 0===e&&(e=null),void 0===n&&(n=null),this.m_library.ProtectTaxReports(t,e,n,r,i,o,s)},t.prototype.UnprotectTaxReceipts=function(t,e){return this.m_library.UnprotectTaxReceipts(t,e)},t.prototype.ASiCGetSigner=function(t,e,n){return this.m_library.ASiCGetSigner(t,e,n)},t.prototype.ASiCSignData=function(t,e,n,r,i,o){return this.m_library.ASiCSignData(t,e,n,r,i,o)},t.prototype.ASiCAppendSign=function(t,e,n,r,i){return this.m_library.ASiCAppendSign(t,e,n,r,i)},t.prototype.ASiCVerifyData=function(t,e){return this.m_library.ASiCVerifyData(t,e)},t.prototype.PDFGetSigner=function(t,e,n){return this.m_library.PDFGetSigner(t,e,n)},t.prototype.PDFSignData=function(t,e,n,r){return this.m_library.PDFSignData(t,e,n,r)},t.prototype.PDFVerifyData=function(t,e){return this.m_library.PDFVerifyData(t,e)},t.prototype.XAdESGetSigner=function(t,e,n){return this.m_library.XAdESGetSigner(t,e,n)},t.prototype.XAdESSignData=function(t,e,n,r,i){return this.m_library.XAdESSignData(t,e,n,r,i)},t.prototype.XAdESVerifyData=function(t,e,n){return this.m_library.XAdESVerifyData(t,e,n)},t.prototype.GetSignContainerInfo=function(t){return this.m_library.GetSignContainerInfo(t)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0),i=function(){this.type=r.EndUserSignContainerType.Unknown,this.subType=r.EndUserCAdESType.Unknown,this.asicSignType=r.EndUserASiCSignType.Unknown}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"d",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return s}));var r=function(){},i=function(){},o=function(){},s=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));var r=function(){},i=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}));var r=function(){this.version=null,this.supported=!1,this.loaded=!1},i=function(){this.version=null,this.supported=!1,this.loaded=!1,this.isSignAgentSupported=!1,this.isWebExtensionSupported=!1,this.isNPAPISupported=!1,this.isActiveXSupported=!1,this.isWebExtensionInstalled=!1,this.isNativeLibraryNeedUpdate=!1,this.nativeLibraryInstallURL=null,this.nativeLibraryUpdateURL=null,this.webExtensionInstallURL=null,this.helpURL=null}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){(function(e,r){var i;
2
- /*!
3
- * @overview es6-promise - a tiny implementation of Promises/A+.
4
- * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
5
- * @license Licensed under MIT license
6
- * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
7
- * @version 3.3.1
1
+ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e,n){"use strict";n.r(e),n.d(e,"EU_LIBRARY_TYPE_JS",(function(){return i})),n.d(e,"EU_LIBRARY_TYPE_SW",(function(){return o})),n.d(e,"EU_LIBRARY_TYPE_MS",(function(){return s})),n.d(e,"EndUserLibraryType",(function(){return r})),n.d(e,"EU_SUBJECT_TYPE_UNDIFFERENCED",(function(){return u})),n.d(e,"EU_SUBJECT_TYPE_CA",(function(){return c})),n.d(e,"EU_SUBJECT_TYPE_CA_SERVER",(function(){return l})),n.d(e,"EU_SUBJECT_TYPE_RA_ADMINISTRATOR",(function(){return f})),n.d(e,"EU_SUBJECT_TYPE_END_USER",(function(){return _})),n.d(e,"EndUserSubjectType",(function(){return a})),n.d(e,"EU_SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED",(function(){return h})),n.d(e,"EU_SUBJECT_CA_SERVER_SUB_TYPE_CMP",(function(){return E})),n.d(e,"EU_SUBJECT_CA_SERVER_SUB_TYPE_TSP",(function(){return y})),n.d(e,"EU_SUBJECT_CA_SERVER_SUB_TYPE_OCSP",(function(){return S})),n.d(e,"EndUserSubjectCAServerSubType",(function(){return p})),n.d(e,"EU_CERT_KEY_TYPE_UNKNOWN",(function(){return d})),n.d(e,"EU_CERT_KEY_TYPE_DSTU4145",(function(){return A})),n.d(e,"EU_CERT_KEY_TYPE_RSA",(function(){return R})),n.d(e,"EU_CERT_KEY_TYPE_ECDSA",(function(){return m})),n.d(e,"EndUserCertKeyType",(function(){return C})),n.d(e,"EU_CERT_HASH_TYPE_UNKNOWN",(function(){return g})),n.d(e,"EU_CERT_HASH_TYPE_GOST34311",(function(){return P})),n.d(e,"EU_CERT_HASH_TYPE_SHA1",(function(){return v})),n.d(e,"EU_CERT_HASH_TYPE_SHA224",(function(){return I})),n.d(e,"EU_CERT_HASH_TYPE_SHA256",(function(){return U})),n.d(e,"EU_CERT_HASH_TYPE_SHA384",(function(){return b})),n.d(e,"EU_CERT_HASH_TYPE_SHA512",(function(){return D})),n.d(e,"EU_CERT_HASH_TYPE_DSTU7564_256",(function(){return O})),n.d(e,"EU_CERT_HASH_TYPE_DSTU7564_384",(function(){return G})),n.d(e,"EU_CERT_HASH_TYPE_DSTU7564_512",(function(){return N})),n.d(e,"EndUserCertHashType",(function(){return T})),n.d(e,"EU_KEY_USAGE_UNKNOWN",(function(){return M})),n.d(e,"EU_KEY_USAGE_DIGITAL_SIGNATURE",(function(){return L})),n.d(e,"EU_KEY_USAGE_NON_REPUDATION",(function(){return K})),n.d(e,"EU_KEY_USAGE_KEY_AGREEMENT",(function(){return k})),n.d(e,"EndUserKeyUsage",(function(){return w})),n.d(e,"EU_CCS_TYPE_REVOKE",(function(){return B})),n.d(e,"EU_CCS_TYPE_HOLD",(function(){return F})),n.d(e,"EndUserCCSType",(function(){return x})),n.d(e,"EU_REVOCATION_REASON_UNKNOWN",(function(){return Y})),n.d(e,"EU_REVOCATION_REASON_KEY_COMPROMISE",(function(){return j})),n.d(e,"EU_REVOCATION_REASON_NEW_ISSUED",(function(){return V})),n.d(e,"EndUserRevocationReason",(function(){return H})),n.d(e,"EU_KEYS_TYPE_NONE",(function(){return X})),n.d(e,"EU_KEYS_TYPE_DSTU_AND_ECDH_WITH_GOST",(function(){return z})),n.d(e,"EU_KEYS_TYPE_RSA_WITH_SHA",(function(){return J})),n.d(e,"EU_KEYS_TYPE_ECDSA_WITH_SHA",(function(){return q})),n.d(e,"EU_KEYS_TYPE_DSTU_AND_ECDH_WITH_DSTU",(function(){return Z})),n.d(e,"EndUserKeysType",(function(){return W})),n.d(e,"EU_KEYS_LENGTH_DS_UA_191",(function(){return $})),n.d(e,"EU_KEYS_LENGTH_DS_UA_257",(function(){return tt})),n.d(e,"EU_KEYS_LENGTH_DS_UA_307",(function(){return et})),n.d(e,"EU_KEYS_LENGTH_DS_UA_FILE",(function(){return nt})),n.d(e,"EU_KEYS_LENGTH_DS_UA_CERT",(function(){return rt})),n.d(e,"EndUserKeysLengthDSUA",(function(){return Q})),n.d(e,"EU_KEYS_LENGTH_KEP_UA_257",(function(){return ot})),n.d(e,"EU_KEYS_LENGTH_KEP_UA_431",(function(){return st})),n.d(e,"EU_KEYS_LENGTH_KEP_UA_571",(function(){return at})),n.d(e,"EU_KEYS_LENGTH_KEP_UA_FILE",(function(){return ut})),n.d(e,"EU_KEYS_LENGTH_KEP_UA_CERT",(function(){return ct})),n.d(e,"EndUserKeysLengthKEPUA",(function(){return it})),n.d(e,"EU_KEYS_LENGTH_DS_RSA_1024",(function(){return ft})),n.d(e,"EU_KEYS_LENGTH_DS_RSA_2048",(function(){return _t})),n.d(e,"EU_KEYS_LENGTH_DS_RSA_3072",(function(){return pt})),n.d(e,"EU_KEYS_LENGTH_DS_RSA_4096",(function(){return ht})),n.d(e,"EU_KEYS_LENGTH_DS_RSA_FILE",(function(){return Et})),n.d(e,"EU_KEYS_LENGTH_DS_RSA_CERT",(function(){return yt})),n.d(e,"EndUserKeysLengthDSRSA",(function(){return lt})),n.d(e,"EU_KEYS_REQUEST_TYPE_UA_DS",(function(){return Ct})),n.d(e,"EU_KEYS_REQUEST_TYPE_UA_KEP",(function(){return dt})),n.d(e,"EU_KEYS_REQUEST_TYPE_INT_RSA",(function(){return At})),n.d(e,"EndUserRequestTypes",(function(){return St})),n.d(e,"EU_MOBILE_OPERATOR_ID_KYIVSTAR",(function(){return mt})),n.d(e,"EU_MOBILE_OPERATOR_ID_VODAFONE",(function(){return Tt})),n.d(e,"EU_MOBILE_OPERATOR_ID_LIFECELL",(function(){return gt})),n.d(e,"EndUserMobileOperatorID",(function(){return Rt})),n.d(e,"EU_KSP_IIT",(function(){return It})),n.d(e,"EU_KSP_UKEY",(function(){return Ut})),n.d(e,"EU_KSP_PB",(function(){return bt})),n.d(e,"EU_KSP_DIIA",(function(){return Dt})),n.d(e,"EndUserKSP",(function(){return Pt})),n.d(e,"EndUserKSPClientIdType",(function(){return vt})),n.d(e,"EU_SIGN_TYPE_UNKNOWN",(function(){return Gt})),n.d(e,"EU_SIGN_TYPE_CADES_BES",(function(){return Nt})),n.d(e,"EU_SIGN_TYPE_CADES_T",(function(){return wt})),n.d(e,"EU_SIGN_TYPE_CADES_C",(function(){return Mt})),n.d(e,"EU_SIGN_TYPE_CADES_X_LONG",(function(){return Lt})),n.d(e,"EU_SIGN_TYPE_CADES_X_LONG_TRUSTED",(function(){return Kt})),n.d(e,"EndUserSignType",(function(){return Ot})),n.d(e,"EU_CADES_TYPE_UNKNOWN",(function(){return xt})),n.d(e,"EU_CADES_TYPE_DETACHED",(function(){return Bt})),n.d(e,"EU_CADES_TYPE_ENVELOPED",(function(){return Ft})),n.d(e,"EndUserCAdESType",(function(){return kt})),n.d(e,"EU_CTX_SIGN_UNKNOWN",(function(){return Yt})),n.d(e,"EU_CTX_SIGN_DSTU4145_WITH_GOST34311",(function(){return jt})),n.d(e,"EU_CTX_SIGN_RSA_WITH_SHA",(function(){return Vt})),n.d(e,"EU_CTX_SIGN_ECDSA_WITH_SHA",(function(){return Wt})),n.d(e,"EU_CTX_SIGN_DSTU4145_WITH_DSTU7564",(function(){return Xt})),n.d(e,"EndUserSignAlgo",(function(){return Ht})),n.d(e,"EU_SIGN_TYPE_PARAMETER",(function(){return Jt})),n.d(e,"EU_USE_SLOGIN_PRIVATE_KEY",(function(){return qt})),n.d(e,"EU_CHECK_PRIVATE_KEY_CONTEXT_PARAMETER",(function(){return Zt})),n.d(e,"EU_USE_SLOGIN_PRIVATE_KEY_CONTEXT_PARAMETER",(function(){return Qt})),n.d(e,"EU_UA_OID_EXT_KEY_USAGE_STAMP",(function(){return $t})),n.d(e,"EU_USER_INFO_VERSION",(function(){return te})),n.d(e,"EndUserCMPCompatibility",(function(){return zt})),n.d(e,"EU_CTX_HASH_ALGO_UNKNOWN",(function(){return ne})),n.d(e,"EU_CTX_HASH_ALGO_GOST34311",(function(){return re})),n.d(e,"EU_CTX_HASH_ALGO_SHA160",(function(){return ie})),n.d(e,"EU_CTX_HASH_ALGO_SHA224",(function(){return oe})),n.d(e,"EU_CTX_HASH_ALGO_SHA256",(function(){return se})),n.d(e,"EU_CTX_HASH_ALGO_SHA384",(function(){return ae})),n.d(e,"EU_CTX_HASH_ALGO_SHA512",(function(){return ue})),n.d(e,"EU_CTX_HASH_ALGO_DSTU7564_256",(function(){return ce})),n.d(e,"EU_CTX_HASH_ALGO_DSTU7564_384",(function(){return le})),n.d(e,"EU_CTX_HASH_ALGO_DSTU7564_512",(function(){return fe})),n.d(e,"EndUserHashAlgo",(function(){return ee})),n.d(e,"EU_ASIC_TYPE_UNKNOWN",(function(){return pe})),n.d(e,"EU_ASIC_TYPE_S",(function(){return he})),n.d(e,"EU_ASIC_TYPE_E",(function(){return Ee})),n.d(e,"EndUserASiCType",(function(){return _e})),n.d(e,"EU_ASIC_SIGN_TYPE_UNKNOWN",(function(){return Se})),n.d(e,"EU_ASIC_SIGN_TYPE_CADES",(function(){return Ce})),n.d(e,"EU_ASIC_SIGN_TYPE_XADES",(function(){return de})),n.d(e,"EndUserASiCSignType",(function(){return ye})),n.d(e,"EU_XADES_TYPE_UNKNOWN",(function(){return Re})),n.d(e,"EU_XADES_TYPE_DETACHED",(function(){return me})),n.d(e,"EU_XADES_TYPE_ENVELOPING",(function(){return Te})),n.d(e,"EU_XADES_TYPE_ENVELOPED",(function(){return ge})),n.d(e,"EndUserXAdESType",(function(){return Ae})),n.d(e,"EU_XADES_SIGN_LEVEL_UNKNOWN",(function(){return ve})),n.d(e,"EU_XADES_SIGN_LEVEL_B_B",(function(){return Ie})),n.d(e,"EU_XADES_SIGN_LEVEL_B_T",(function(){return Ue})),n.d(e,"EU_XADES_SIGN_LEVEL_B_LT",(function(){return be})),n.d(e,"EU_XADES_SIGN_LEVEL_B_LTA",(function(){return De})),n.d(e,"EndUserXAdESSignLevel",(function(){return Pe})),n.d(e,"EU_PADES_SIGN_LEVEL_UNKNOWN",(function(){return Ne})),n.d(e,"EU_PADES_SIGN_LEVEL_B_B",(function(){return we})),n.d(e,"EU_PADES_SIGN_LEVEL_B_T",(function(){return Me})),n.d(e,"EU_PADES_SIGN_LEVEL_B_LT",(function(){return Le})),n.d(e,"EU_PADES_SIGN_LEVEL_B_LTA",(function(){return Ke})),n.d(e,"EndUserPAdESSignLevel",(function(){return Oe})),n.d(e,"EndUserEventType",(function(){return Ge})),n.d(e,"EU_SIGN_CONTAINER_TYPE_UNKNOWN",(function(){return xe})),n.d(e,"EU_SIGN_CONTAINER_TYPE_CADES",(function(){return Be})),n.d(e,"EU_SIGN_CONTAINER_TYPE_XADES",(function(){return Fe})),n.d(e,"EU_SIGN_CONTAINER_TYPE_PADES",(function(){return He})),n.d(e,"EU_SIGN_CONTAINER_TYPE_ASIC",(function(){return Ye})),n.d(e,"EndUserSignContainerType",(function(){return ke}));var r,i=1,o=2,s=3;!function(t){t[t.JS=i]="JS",t[t.SW=o]="SW",t[t.MS=s]="MS"}(r||(r={}));var a,u=0,c=1,l=2,f=3,_=4;!function(t){t[t.Undifferenced=u]="Undifferenced",t[t.CA=c]="CA",t[t.CAServer=l]="CAServer",t[t.RAAdministrator=f]="RAAdministrator",t[t.EndUser=_]="EndUser"}(a||(a={}));var p,h=0,E=1,y=2,S=3;!function(t){t[t.Undifferenced=h]="Undifferenced",t[t.CMP=E]="CMP",t[t.TSP=y]="TSP",t[t.OCSP=S]="OCSP"}(p||(p={}));var C,d=0,A=1,R=2,m=4;!function(t){t[t.Unknown=d]="Unknown",t[t.DSTU4145=A]="DSTU4145",t[t.RSA=R]="RSA",t[t.ECDSA=m]="ECDSA"}(C||(C={}));var T,g=0,P=1,v=2,I=3,U=4,b=5,D=6,O=7,G=8,N=9;!function(t){t[t.Unknown=g]="Unknown",t[t.GOST34311=P]="GOST34311",t[t.SHA1=v]="SHA1",t[t.SHA224=I]="SHA224",t[t.SHA256=U]="SHA256",t[t.SHA384=b]="SHA384",t[t.SHA512=D]="SHA512",t[t.DSTU7564_256=O]="DSTU7564_256",t[t.DSTU7564_384=G]="DSTU7564_384",t[t.DSTU7564_512=N]="DSTU7564_512"}(T||(T={}));var w,M=0,L=1,K=2,k=16;!function(t){t[t.Unknown=d]="Unknown",t[t.DigitalSignature=L]="DigitalSignature",t[t.NonRepudation=K]="NonRepudation",t[t.KeyAgreement=k]="KeyAgreement"}(w||(w={}));var x,B=1,F=2;!function(t){t[t.Revoke=B]="Revoke",t[t.Hold=F]="Hold"}(x||(x={}));var H,Y=0,j=1,V=2;!function(t){t[t.Unknown=Y]="Unknown",t[t.KeyCompromise=j]="KeyCompromise",t[t.NewIssued=V]="NewIssued"}(H||(H={}));var W,X=0,z=1,J=2,q=4,Z=8;!function(t){t[t.None=X]="None",t[t.DSTUAndECDHWithGOST=z]="DSTUAndECDHWithGOST",t[t.RSAWithSHA=J]="RSAWithSHA",t[t.ECDSAWithSHA=q]="ECDSAWithSHA",t[t.DSTUAndECDHWithDSTU=Z]="DSTUAndECDHWithDSTU"}(W||(W={}));var Q,$=1,tt=2,et=3,nt=4,rt=5;!function(t){t[t.EC_191=$]="EC_191",t[t.EC_257=tt]="EC_257",t[t.EC_307=et]="EC_307",t[t.File=nt]="File",t[t.Cert=rt]="Cert"}(Q||(Q={}));var it,ot=1,st=2,at=3,ut=4,ct=5;!function(t){t[t.EC_257=ot]="EC_257",t[t.EC_431=st]="EC_431",t[t.EC_571=at]="EC_571",t[t.File=nt]="File",t[t.Cert=rt]="Cert"}(it||(it={}));var lt,ft=1,_t=2,pt=3,ht=4,Et=5,yt=6;!function(t){t[t.N_1024=ft]="N_1024",t[t.N_2048=_t]="N_2048",t[t.N_3072=pt]="N_3072",t[t.N_4096=ht]="N_4096",t[t.File=nt]="File",t[t.Cert=rt]="Cert"}(lt||(lt={}));var St,Ct=1,dt=2,At=3;!function(t){t[t.uaDS=Ct]="uaDS",t[t.uaKEP=dt]="uaKEP",t[t.intRSA=At]="intRSA"}(St||(St={}));var Rt,mt=1,Tt=2,gt=3;!function(t){t[t.Kyivstar=mt]="Kyivstar",t[t.Vodafone=Tt]="Vodafone",t[t.Lifecell=gt]="Lifecell"}(Rt||(Rt={}));var Pt,vt,It=4,Ut=5,bt=6,Dt=7;!function(t){t[t.Kyivstar=mt]="Kyivstar",t[t.Vodafone=Tt]="Vodafone",t[t.Lifecell=gt]="Lifecell",t[t.IIT=It]="IIT",t[t.UKey=Ut]="UKey",t[t.PB=bt]="PB",t[t.DIIA=Dt]="DIIA"}(Pt||(Pt={})),function(t){t[t.Default=0]="Default",t[t.Name=1]="Name",t[t.Phone=2]="Phone",t[t.Email=3]="Email"}(vt||(vt={}));var Ot,Gt=0,Nt=1,wt=4,Mt=8,Lt=16,Kt=128;!function(t){t[t.Unknown=Gt]="Unknown",t[t.CAdES_BES=Nt]="CAdES_BES",t[t.CAdES_T=wt]="CAdES_T",t[t.CAdES_C=Mt]="CAdES_C",t[t.CAdES_X_Long=Lt]="CAdES_X_Long",t[t.CAdES_X_Long_Trusted=Kt]="CAdES_X_Long_Trusted"}(Ot||(Ot={}));var kt,xt=0,Bt=1,Ft=3;!function(t){t[t.Unknown=xt]="Unknown",t[t.Detached=Bt]="Detached",t[t.Enveloped=Ft]="Enveloped"}(kt||(kt={}));var Ht,Yt=0,jt=1,Vt=2,Wt=3,Xt=4;!function(t){t[t.Unknown=Yt]="Unknown",t[t.DSTU4145WithGOST34311=jt]="DSTU4145WithGOST34311",t[t.RSAWithSHA=Vt]="RSAWithSHA",t[t.ECDSAWithSHA=Wt]="ECDSAWithSHA",t[t.DSTU4145WithDSTU7564=Xt]="DSTU4145WithDSTU7564"}(Ht||(Ht={}));var zt,Jt="SignType",qt="UseSLoginPrivateKey",Zt="CheckPrivateKey",Qt="UseSLoginPrivateKey",$t="1.2.804.2.1.1.1.3.9",te=3;!function(t){t[t.None=0]="None",t[t.DownloadEUCerts=1]="DownloadEUCerts",t[t.SearchEUCerts=2]="SearchEUCerts"}(zt||(zt={}));var ee,ne=0,re=1,ie=2,oe=3,se=4,ae=5,ue=6,ce=7,le=8,fe=9;!function(t){t[t.Unknown=ne]="Unknown",t[t.GOST34311=re]="GOST34311",t[t.SHA160=ie]="SHA160",t[t.SHA224=oe]="SHA224",t[t.SHA256=se]="SHA256",t[t.SHA384=ae]="SHA384",t[t.SHA512=ue]="SHA512",t[t.DSTU7564_256=ce]="DSTU7564_256",t[t.DSTU7564_384=le]="DSTU7564_384",t[t.DSTU7564_512=fe]="DSTU7564_512"}(ee||(ee={}));var _e,pe=0,he=1,Ee=2;!function(t){t[t.Unknown=pe]="Unknown",t[t.S=he]="S",t[t.E=Ee]="E"}(_e||(_e={}));var ye,Se=0,Ce=1,de=2;!function(t){t[t.Unknown=Se]="Unknown",t[t.CAdES=Ce]="CAdES",t[t.XAdES=de]="XAdES"}(ye||(ye={}));var Ae,Re=0,me=1,Te=2,ge=3;!function(t){t[t.Unknown=Re]="Unknown",t[t.Detached=me]="Detached",t[t.Enveloping=Te]="Enveloping",t[t.Enveloped=ge]="Enveloped"}(Ae||(Ae={}));var Pe,ve=0,Ie=1,Ue=4,be=16,De=32;!function(t){t[t.Unknown=ve]="Unknown",t[t.B_B=Ie]="B_B",t[t.B_T=Ue]="B_T",t[t.B_LT=be]="B_LT",t[t.B_LTA=De]="B_LTA"}(Pe||(Pe={}));var Oe,Ge,Ne=0,we=1,Me=4,Le=16,Ke=32;!function(t){t[t.Unknown=ve]="Unknown",t[t.B_B=we]="B_B",t[t.B_T=Me]="B_T",t[t.B_LT=Le]="B_LT",t[t.B_LTA=Ke]="B_LTA"}(Oe||(Oe={})),function(t){t[t.None=0]="None",t[t.All=1]="All",t[t.ConfirmKSPOperation=2]="ConfirmKSPOperation"}(Ge||(Ge={}));var ke,xe=0,Be=1,Fe=2,He=3,Ye=4;!function(t){t[t.Unknown=xe]="Unknown",t[t.CAdES=Be]="CAdES",t[t.XAdES=Fe]="XAdES",t[t.PAdES=He]="PAdES",t[t.ASiC=Ye]="ASiC"}(ke||(ke={}))},function(t,e,n){"use strict";n.r(e),n.d(e,"EU_ERROR_NONE",(function(){return r})),n.d(e,"EU_ERROR_UNKNOWN",(function(){return i})),n.d(e,"EU_ERROR_NOT_SUPPORTED",(function(){return o})),n.d(e,"EU_ERROR_NOT_INITIALIZED",(function(){return s})),n.d(e,"EU_ERROR_BAD_PARAMETER",(function(){return a})),n.d(e,"EU_ERROR_LIBRARY_LOAD",(function(){return u})),n.d(e,"EU_ERROR_READ_SETTINGS",(function(){return c})),n.d(e,"EU_ERROR_TRANSMIT_REQUEST",(function(){return l})),n.d(e,"EU_ERROR_MEMORY_ALLOCATION",(function(){return f})),n.d(e,"EU_WARNING_END_OF_ENUM",(function(){return _})),n.d(e,"EU_ERROR_PROXY_NOT_AUTHORIZED",(function(){return p})),n.d(e,"EU_ERROR_NO_GUI_DIALOGS",(function(){return h})),n.d(e,"EU_ERROR_DOWNLOAD_FILE",(function(){return E})),n.d(e,"EU_ERROR_WRITE_SETTINGS",(function(){return y})),n.d(e,"EU_ERROR_CANCELED_BY_GUI",(function(){return S})),n.d(e,"EU_ERROR_OFFLINE_MODE",(function(){return C})),n.d(e,"EU_ERROR_KEY_MEDIAS_FAILED",(function(){return d})),n.d(e,"EU_ERROR_KEY_MEDIAS_ACCESS_FAILED",(function(){return A})),n.d(e,"EU_ERROR_KEY_MEDIAS_READ_FAILED",(function(){return R})),n.d(e,"EU_ERROR_KEY_MEDIAS_WRITE_FAILED",(function(){return m})),n.d(e,"EU_WARNING_KEY_MEDIAS_READ_ONLY",(function(){return T})),n.d(e,"EU_ERROR_KEY_MEDIAS_DELETE",(function(){return g})),n.d(e,"EU_ERROR_KEY_MEDIAS_CLEAR",(function(){return P})),n.d(e,"EU_ERROR_BAD_PRIVATE_KEY",(function(){return v})),n.d(e,"EU_ERROR_PKI_FORMATS_FAILED",(function(){return I})),n.d(e,"EU_ERROR_CSP_FAILED",(function(){return U})),n.d(e,"EU_ERROR_BAD_SIGNATURE",(function(){return b})),n.d(e,"EU_ERROR_AUTH_FAILED",(function(){return D})),n.d(e,"EU_ERROR_NOT_RECEIVER",(function(){return O})),n.d(e,"EU_ERROR_STORAGE_FAILED",(function(){return G})),n.d(e,"EU_ERROR_BAD_CERT",(function(){return N})),n.d(e,"EU_ERROR_CERT_NOT_FOUND",(function(){return w})),n.d(e,"EU_ERROR_INVALID_CERT_TIME",(function(){return M})),n.d(e,"EU_ERROR_CERT_IN_CRL",(function(){return L})),n.d(e,"EU_ERROR_BAD_CRL",(function(){return K})),n.d(e,"EU_ERROR_NO_VALID_CRLS",(function(){return k})),n.d(e,"EU_ERROR_GET_TIME_STAMP",(function(){return x})),n.d(e,"EU_ERROR_BAD_TSP_RESPONSE",(function(){return B})),n.d(e,"EU_ERROR_TSP_SERVER_CERT_NOT_FOUND",(function(){return F})),n.d(e,"EU_ERROR_TSP_SERVER_CERT_INVALID",(function(){return H})),n.d(e,"EU_ERROR_GET_OCSP_STATUS",(function(){return Y})),n.d(e,"EU_ERROR_BAD_OCSP_RESPONSE",(function(){return j})),n.d(e,"EU_ERROR_CERT_BAD_BY_OCSP",(function(){return V})),n.d(e,"EU_ERROR_OCSP_SERVER_CERT_NOT_FOUND",(function(){return W})),n.d(e,"EU_ERROR_OCSP_SERVER_CERT_INVALID",(function(){return X})),n.d(e,"EU_ERROR_LDAP_ERROR",(function(){return z})),n.d(e,"EndUserError",(function(){return J}));var r=0,i=65535,o=65534,s=1,a=2,u=3,c=4,l=5,f=6,_=7,p=8,h=9,E=10,y=11,S=12,C=13,d=17,A=18,R=19,m=20,T=21,g=22,P=23,v=24,I=33,U=34,b=35,D=36,O=37,G=49,N=50,w=51,M=52,L=53,K=54,k=55,x=65,B=66,F=67,H=68,Y=81,j=82,V=83,W=84,X=85,z=97,J=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(8),i=n(10),o=n(4),s=function(){function t(){}return t.MapFromKeyMedia=function(t,e){return e.SetTypeIndex(t.typeIndex),e.SetDevIndex(t.devIndex),e.SetPassword(t.user?"##"+t.user+"##"+t.password:t.password),e},t.MapToProxySettings=function(t,e){return e.useProxy=t.GetUseProxy(),e.address=t.GetAddress(),e.port=t.GetPort(),e.anonymous=t.GetAnonymous(),e.user=t.GetUser(),e.password=t.GetPassword(),e.savePassword=t.GetSavePassword(),e},t.MapFromProxySettings=function(t,e){return e.SetUseProxy(t.useProxy),e.SetAddress(t.address),e.SetPort(t.port),e.SetAnonymous(t.anonymous),e.SetUser(t.user),e.SetPassword(t.password),e.SetSavePassword(t.savePassword),e},t.MapEndUserOwnerInfo=function(t,e){return e.isFilled=t.IsFilled(),e.issuer=t.GetIssuer(),e.issuerCN=t.GetIssuerCN(),e.serial=t.GetSerial(),e.subject=t.GetSubject(),e.subjCN=t.GetSubjCN(),e.subjOrg=t.GetSubjOrg(),e.subjOrgUnit=t.GetSubjOrgUnit(),e.subjTitle=t.GetSubjTitle(),e.subjState=t.GetSubjState(),e.subjLocality=t.GetSubjLocality(),e.subjFullName=t.GetSubjFullName(),e.subjAddress=t.GetSubjAddress(),e.subjPhone=t.GetSubjPhone(),e.subjEMail=t.GetSubjEMail(),e.subjDNS=t.GetSubjDNS(),e.subjEDRPOUCode=t.GetSubjEDRPOUCode(),e.subjDRFOCode=t.GetSubjDRFOCode(),e},t.MapToEndUserCertificateInfoEx=function(t,e){return e.isFilled=t.IsFilled(),e.version=t.GetVersion(),e.issuer=t.GetIssuer(),e.issuerCN=t.GetIssuerCN(),e.serial=t.GetSerial(),e.subject=t.GetSubject(),e.subjCN=t.GetSubjCN(),e.subjOrg=t.GetSubjOrg(),e.subjOrgUnit=t.GetSubjOrgUnit(),e.subjTitle=t.GetSubjTitle(),e.subjState=t.GetSubjState(),e.subjLocality=t.GetSubjLocality(),e.subjFullName=t.GetSubjFullName(),e.subjAddress=t.GetSubjAddress(),e.subjPhone=t.GetSubjPhone(),e.subjEMail=t.GetSubjEMail(),e.subjDNS=t.GetSubjDNS(),e.subjEDRPOUCode=t.GetSubjEDRPOUCode(),e.subjDRFOCode=t.GetSubjDRFOCode(),e.subjNBUCode=t.GetSubjNBUCode(),e.subjSPFMCode=t.GetSubjSPFMCode(),e.subjOCode=t.GetSubjOCode(),e.subjOUCode=t.GetSubjOUCode(),e.subjUserCode=t.GetSubjUserCode(),e.certBeginTime=t.GetCertBeginTime(),e.certEndTime=t.GetCertEndTime(),e.isPrivKeyTimesAvail=t.IsPrivKeyTimesAvail(),e.privKeyBeginTime=t.GetPrivKeyBeginTime(),e.privKeyEndTime=t.GetPrivKeyEndTime(),e.publicKeyBits=t.GetPublicKeyBits(),e.publicKey=t.GetPublicKey(),e.publicKeyID=t.GetPublicKeyID(),e.issuerPublicKeyID=t.GetIssuerPublicKeyID(),e.keyUsage=t.GetKeyUsage(),e.extKeyUsages=t.GetExtKeyUsages(),e.policies=t.GetPolicies(),e.crlDistribPoint1=t.GetCRLDistribPoint1(),e.crlDistribPoint2=t.GetCRLDistribPoint2(),e.isPowerCert=t.IsPowerCert(),e.isSubjTypeAvail=t.IsSubjTypeAvail(),e.isSubjCA=t.IsSubjCA(),e.chainLength=t.GetChainLength(),e.UPN=t.GetUPN(),e.publicKeyType=t.GetPublicKeyType(),e.keyUsageType=t.GetKeyUsageType(),e.RSAModul=t.GetRSAModul(),e.RSAExponent=t.GetRSAExponent(),e.OCSPAccessInfo=t.GetOCSPAccessInfo(),e.issuerAccessInfo=t.GetIssuerAccessInfo(),e.TSPAccessInfo=t.GetTSPAccessInfo(),e.isLimitValueAvailable=t.IsLimitValueAvail(),e.limitValue=t.GetLimitValue(),e.limitValueCurrency=t.GetLimitValueCurrency(),e.subjType=t.GetSubjType(),e.subjSubType=t.GetSubjSubType(),e.subjUNZR=t.GetSubjUNZR(),e.subjCountry=t.GetSubjCountry(),e.isQSCD=t.IsQSCD(),e.subjUserID=t.GetSubjUserID(),e.certHashType=t.GetCertHashType(),e},t.MapToEndUserParams=function(t,e){return e.SN=t.GetSN(),e.commonName=t.GetCommonName(),e.locality=t.GetLocality(),e.state=t.GetState(),e.organization=t.GetOrganization(),e.orgUnit=t.GetOrgUnit(),e.title=t.GetTitle(),e.street=t.GetStreet(),e.phone=t.GetPhone(),e.surname=t.GetSurname(),e.givenname=t.GetGivenname(),e.EMail=t.GetEMail(),e.DNS=t.GetDNS(),e.EDRPOUCode=t.GetEDRPOUCode(),e.DRFOCode=t.GetDRFOCode(),e.NBUCode=t.GetNBUCode(),e.SPFMCode=t.GetSPFMCode(),e.information=t.GetInformation(),e.passPhrase=t.GetPassPhrase(),e.isPublishCertificate=t.GetIsPublishCertificate(),e.RAAdminSN=t.GetRAAdminSN(),e},t.MapToEndUserTimeInfo=function(t,e){return e.version=t.GetVersion(),e.isTimeAvail=t.IsTimeAvail(),e.isTimeStamp=t.IsTimeStamp(),e.time=t.GetTime(),e.isSignTimeStampAvail=t.IsSignTimeStampAvail(),e.signTimeStamp=t.GetSignTimeStamp(),e},t.MapToEndUserSignInfo=function(e,n){return n.ownerInfo=t.MapEndUserOwnerInfo(e.GetOwnerInfo(),new i.a),n.timeInfo=t.MapToEndUserTimeInfo(e.GetTimeInfo(),new o.EndUserTimeInfo),n.data=e.GetData(),n.signLevel=0,n},t.MapToEndUserSenderInfo=function(e,n){return n.ownerInfo=t.MapEndUserOwnerInfo(e.GetOwnerInfo(),new i.a),n.timeInfo=t.MapToEndUserTimeInfo(e.GetTimeInfo(),new o.EndUserTimeInfo),n.data=e.GetData(),n},t.MapToEndUserCertificate=function(e,n){return n.data=e.GetData(),n.infoEx=t.MapToEndUserCertificateInfoEx(e.GetInfoEx(),new r.a),n},t.MapFromEndUserInfo=function(t,e){return e.SetCommonName(t.commonName),e.SetLocality(t.locality),e.SetState(t.state),e.SetOrganization(t.organization),e.SetOrgUnit(t.orgUnit),e.SetTitle(t.title),e.SetStreet(t.street),e.SetPhone(t.phone),e.SetSurname(t.surname),e.SetGivenname(t.givenname),e.SetEMail(t.EMail),e.SetDNS(t.DNS),e.SetEDRPOUCode(t.EDRPOUCode),e.SetDRFOCode(t.DRFOCode),e.SetNBUCode(t.NBUCode),e.SetSPFMCode(t.SPFMCode),e.SetOCode(t.OCode),e.SetOUCode(t.OUCode),e.SetUserCode(t.userCode),e.SetUPN(t.UPN),e.SetUNZR(t.UNZR),e.SetCountry(t.country),e},t.MapToEndUserRequestInfo=function(t,e){return e.isFilled=!0,e.data=t.GetRequest(),e.type=t.GetRequestType(),e.fileName=t.GetDefaultRequestFileName(),e.isSimple=t.IsSimple(),e.subject=t.GetSubject(),e.subjCN=t.GetSubjCN(),e.subjOrg=t.GetSubjOrg(),e.subjOrgUnit=t.GetSubjOrgUnit(),e.subjTitle=t.GetSubjTitle(),e.subjState=t.GetSubjState(),e.subjLocality=t.GetSubjLocality(),e.subjFullName=t.GetSubjFullName(),e.subjAddress=t.GetSubjAddress(),e.subjPhone=t.GetSubjPhone(),e.subjEMail=t.GetSubjEMail(),e.subjDNS=t.GetSubjDNS(),e.subjEDRPOUCode=t.GetSubjEDRPOUCode(),e.subjDRFOCode=t.GetSubjDRFOCode(),e.subjNBUCode=t.GetSubjNBUCode(),e.subjSPFMCode=t.GetSubjSPFMCode(),e.subjOCode=t.GetSubjOCode(),e.subjOUCode=t.GetSubjOUCode(),e.subjUserCode=t.GetSubjUserCode(),e.certBeginTime=t.GetCertBeginTime(),e.certEndTime=t.GetCertEndTime(),e.isPrivKeyTimesAvail=t.IsPrivKeyTimesAvail(),e.privKeyBeginTime=t.GetPrivKeyBeginTime(),e.privKeyEndTime=t.GetPrivKeyEndTime(),e.publicKeyType=t.GetPublicKeyType(),e.publicKeyBits=t.GetPublicKeyBits(),e.RSAModul=t.GetRSAModul(),e.RSAExponent=t.GetRSAExponent(),e.publicKey=t.GetPublicKey(),e.publicKeyID=t.GetPublicKeyID(),e.extKeyUsages=t.GetExtKeyUsages(),e.crlDistribPoint1=t.GetCRLDistribPoint1(),e.crlDistribPoint2=t.GetCRLDistribPoint2(),e.isSubjTypeAvail=t.IsSubjTypeAvail(),e.subjType=t.GetSubjType(),e.subjSubType=t.GetSubjSubType(),e.isSelfSigned=t.IsSelfSigned(),e.signIssuer=t.GetSignIssuer(),e.signSerial=t.GetSignSerial(),e.subjUNZR=t.GetSubjUNZR(),e.subjCountry=t.GetSubjCountry(),e.isQSCD=t.IsQSCD(),e},t.MapToEndUserReference=function(t,e){return e.name=t.GetName(),e.val=t.GetData(),e},t.MapFromEndUserReference=function(t,e){return e.SetName(t.name),e.SetData(t.val),e},t}()},function(t,e,n){var r,i,o;i=[],void 0===(o="function"==typeof(r=function(){var t="https://chrome.google.com/webstore/detail/%D1%96%D1%96%D1%82-%D0%BA%D0%BE%D1%80%D0%B8%D1%81%D1%82%D1%83%D0%B2%D0%B0%D1%87-%D1%86%D1%81%D0%BA-1-%D0%B1%D1%96%D0%B1%D0%BB/jffafkigfgmjafhpkoibhfefeaebmccg?utm_source=chrome-app-launcher-info-dialog",e=function(){this.vendor="JSC IIT",this.classVersion=1,this.className="EndUserUTF8Coder"};e.prototype.encode=function(t){for(var e=[],n=0,r=0;r<t.length;r++){var i=t.charCodeAt(r);i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=63&i|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e},e.prototype.decode=function(t){for(var e,n,r,i=[],o=0,s=0;o<t.length;)(e=t[o++])<128?i[s++]=String.fromCharCode(e):e>191&&e<224?(n=t[o++],i[s++]=String.fromCharCode((31&e)<<6|63&n)):(n=t[o++],r=t[o++],i[s++]=String.fromCharCode((15&e)<<12|(63&n)<<6|63&r));return i.join("")};var n=function(){this.vendor="JSC IIT",this.classVersion=1,this.className="EndUserUTF16LECoder"};n.prototype.encode=function(t){for(var e,n=[],r=0;r<t.length;r++)e=t.charCodeAt(r),n.push(255&e),n.push((65280&e)>>8);return n},n.prototype.decode=function(t){var e,n=0,r="";if(t.length%2!=0)return null;for((e=t.length)>0&&0==t[e-2]&&0==t[e-1]&&(e-=2);n<e;)r+=String.fromCharCode(t[n]|t[n+1]<<8),n+=2;return r};var r=function(){this.vendor="JSC IIT",this.classVersion=1,this.className="EndUserCP1251Coder",this.m_cp1251_table={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,20:20,21:21,22:22,23:23,24:24,25:25,26:26,27:27,28:28,29:29,30:30,31:31,32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:92,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:126,127:127,1027:129,8225:135,1046:198,8222:132,1047:199,1168:165,1048:200,1113:154,1049:201,1045:197,1050:202,1028:170,160:160,1040:192,1051:203,164:164,166:166,167:167,169:169,171:171,172:172,173:173,174:174,1053:205,176:176,177:177,1114:156,181:181,182:182,183:183,8221:148,187:187,1029:189,1056:208,1057:209,1058:210,8364:136,1112:188,1115:158,1059:211,1060:212,1030:178,1061:213,1062:214,1063:215,1116:157,1064:216,1065:217,1031:175,1066:218,1067:219,1068:220,1069:221,1070:222,1032:163,8226:149,1071:223,1072:224,8482:153,1073:225,8240:137,1118:162,1074:226,1110:179,8230:133,1075:227,1033:138,1076:228,1077:229,8211:150,1078:230,1119:159,1079:231,1042:194,1080:232,1034:140,1025:168,1081:233,1082:234,8212:151,1083:235,1169:180,1084:236,1052:204,1085:237,1035:142,1086:238,1087:239,1088:240,1089:241,1090:242,1036:141,1041:193,1091:243,1092:244,8224:134,1093:245,8470:185,1094:246,1054:206,1095:247,1096:248,8249:139,1097:249,1098:250,1044:196,1099:251,1111:191,1055:207,1100:252,1038:161,8220:147,1101:253,8250:155,1102:254,8216:145,1103:255,1043:195,1105:184,1039:143,1026:128,1106:144,8218:130,1107:131,8217:146,1108:186,1109:190},this.m_ut8_table=unescape("%u0402%u0403%u201A%u0453%u201E%u2026%u2020%u2021%u20AC%u2030%u0409%u2039%u040A%u040C%u040B%u040F%u0452%u2018%u2019%u201C%u201D%u2022%u2013%u2014%u0000%u2122%u0459%u203A%u045A%u045C%u045B%u045F%u00A0%u040E%u045E%u0408%u00A4%u0490%u00A6%u00A7%u0401%u00A9%u0404%u00AB%u00AC%u00AD%u00AE%u0407%u00B0%u00B1%u0406%u0456%u0491%u00B5%u00B6%u00B7%u0451%u2116%u0454%u00BB%u0458%u0405%u0455%u0457")};r.prototype.encode=function(t){for(var e=[],n=0;n<t.length;n++){var r=t.charCodeAt(n);if(!(r in this.m_cp1251_table))throw"Character "+t.charAt(n)+" isn't supported by win1251!";e.push(this.m_cp1251_table[r])}return e},r.prototype.decode=function(t){for(var e,n="",r=0;r<t.length;r++)n+=(e=t[r])>=192&&e<=255?String.fromCharCode(e-192+1040):e>=128&&e<=191?this.m_ut8_table.charAt(e-128):String.fromCharCode(e);return n};var i={GetCoder:function(t){switch(t=t.toUpperCase()){case"UTF-8":return new e;case"UTF-16LE":return new n;case"WINDOWS-1251":return new r;default:return null}},ArrayToString:function(t,e){var n,r;if(void 0===t&&(t="UTF-8"),null==(n=i.GetCoder(t)))throw new nt(r=et.ERROR_BAD_PARAMETER,et.getErrorDescriptionEx(r,0));return n.decode(e)}},o=function(){this.vendor="JSC IIT",this.classVersion=1,this.className="EndUserDateCoder",this.dateDelimeter=".",this.timeDelimeter=":",this.dateTimeDelimeter=" ",this.format="dd.MM.yyyy HH:mm:ss"};o.prototype.encode=function(t){var e=t.getDate(),n=t.getMonth()+1,r=t.getFullYear(),i=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return e+this.dateDelimeter+n+this.dateDelimeter+r+this.dateTimeDelimeter+i+this.timeDelimeter+o+this.timeDelimeter+s},o.prototype.decode=function(t){try{var e=t.split(this.dateTimeDelimeter),n=e[0].split(this.dateDelimeter),r=e[1].split(this.timeDelimeter),i=parseInt(n[0]),o=parseInt(n[1])-1,s=parseInt(n[2]);if(i<0||i>31||o<0||o>12||s<0)return null;var a=parseInt(r[0]),u=parseInt(r[1]),c=parseInt(r[2]);return a<0||a>23||u<0||u>59||c<0||c>59?null:new Date(s,o,i,a,u,c,0)}catch(t){return null}};var s=function(){this.vendor="JSC IIT",this.classVersion=1,this.className="EndUserBase64Coder",this.m_map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",this.m_codes=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47]};s.prototype._getTextDecoder=function(){try{if("undefined"==typeof TextDecoder)return null;var t=new TextDecoder("utf-8");return"utf-8"!=t.encoding?null:t}catch(t){return null}},s.prototype._encodePart=function(t,e,n){for(var r,i,o=[],s=e;s<n;s+=3)r=t[s]<<16|t[s+1]<<8|t[s+2],i=this.m_map[r>>18&63]+this.m_map[r>>12&63]+this.m_map[r>>6&63]+this.m_map[63&r],o.push(i);return o.join("")},s.prototype.encode=function(t){var e,n,r,i,o,s,a="";if(0==(o=(e="undefined"==typeof Uint8Array?void 0===h?t.slice(0):new h(t):new Uint8Array(t)).length))return"";var u=this._getTextDecoder();if(null!=u){for(s=new Uint8Array(4*parseInt((o+2)/3)),n=0,r=0;n<o-o%3;n+=3,r+=4)i=e[n]<<16|e[n+1]<<8|e[n+2],s[r]=this.m_codes[i>>18&63],s[r+1]=this.m_codes[i>>12&63],s[r+2]=this.m_codes[i>>6&63],s[r+3]=this.m_codes[63&i];switch(o%3){case 1:i=e[n]<<16,s[r]=this.m_codes[i>>18&63],s[r+1]=this.m_codes[i>>12&63],s[r+2]=61,s[r+3]=61;break;case 2:i=e[n]<<16|e[n+1]<<8,s[r]=this.m_codes[i>>18&63],s[r+1]=this.m_codes[i>>12&63],s[r+2]=this.m_codes[i>>6&63],s[r+3]=61}a=u.decode(s)}else{var c,l=null,f=o-o%3,_=parseInt(f/15360);for(s=[],n=0;n<_;n++)l=this._encodePart(e,15360*n,15360*n+15360),s.push(l);switch(15360*_<f&&(l=this._encodePart(e,15360*n,f),s.push(l)),o%3){case 1:i=e[o-1]<<16,c=this.m_map[i>>18&63],c+=this.m_map[i>>12&63],c+="=",c+="=",s.push(c);break;case 2:i=e[o-2]<<16|e[o-1]<<8,c=this.m_map[i>>18&63],c+=this.m_map[i>>12&63],c+=this.m_map[i>>6&63],c+="=",s.push(c)}a=s.join("")}return a},s.prototype.decode=function(t){var e,n,r,i,o,s,a,u,c,l,f;if(""==t||(3&t.length)>0)return"undefined"==typeof Uint8Array?void 0===h?[]:new h(0):new Uint8Array(0);for(n=(s=t.length)/4*3-(a="="==t[s-1]?"="==t[s-2]?2:1:0),e="undefined"==typeof Uint8Array?void 0===h?[]:new h(n):new Uint8Array(n),r=0,i=0,o=0;r<Math.floor((s-a)/4);r++)u=this.m_map.indexOf(t[i++]),c=this.m_map.indexOf(t[i++]),l=this.m_map.indexOf(t[i++]),f=this.m_map.indexOf(t[i++]),e[o++]=u<<2|c>>4,e[o++]=(15&c)<<4|l>>2,e[o++]=(3&l)<<6|63&f;switch(a){case 2:u=this.m_map.indexOf(t[i]),c=this.m_map.indexOf(t[i+1]),e[o++]=u<<2|c>>4;break;case 1:u=this.m_map.indexOf(t[i]),c=this.m_map.indexOf(t[i+1]),l=this.m_map.indexOf(t[i+2]),e[o++]=u<<2|c>>4,e[o++]=(15&c)<<4|l>>2}return e};var a=function(t){return new function(){var e=this,n=function(){var t;e.deferred.length&&((t=[].slice.call(arguments)).unshift(n),e.deferred[0].apply(e,t),e.deferred.shift())};this.deferred=[],this.eu_wait=function(t){return this.deferred.push(t),e},t(n)}},u=function(){var t=this._getBrowserInfo();this.m_name=t.name,this.m_version=t.version,this.m_arch=this._getArch(),this.m_os_name=this._getOSName()};u.BROWSER_NAME_IE="IE",u.BROWSER_NAME_OPERA="Opera",u.BROWSER_NAME_CHROME="Chrome",u.BROWSER_NAME_FIREFOX="Firefox",u.BROWSER_NAME_SAFARI="Safari",u.BROWSER_NAME_EDGE="Edge",u.BROWSER_NAME_UNKNOWN="Unknown",u.OS_NAME_WINDOWS="Windows",u.OS_NAME_LINUX="Linux",u.OS_NAME_UNIX="Unix",u.OS_NAME_MAC="Mac OS X",u.OS_NAME_ANDROID="Android",u.OS_NAME_UNKNOWN="Unknown",u.BROWSER_ARCH_NAME_X86="x86",u.BROWSER_ARCH_NAME_X64="x64",u.BROWSER_ARCH_NAME_ARM="arm",u.BROWSER_ARCH_NAME_UNKNOWN="Unknown",u.prototype._getBrowserInfo=function(){var t,e={name:u.BROWSER_NAME_UNKNOWN,version:""},n=navigator.userAgent,r=n.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/msie/i.test(r[1])||/trident/i.test(r[1])?(e.name=u.BROWSER_NAME_IE,/msie/i.test(r[1])?e.version=parseInt(r[2]):(t=/\brv[ :]+(\d+)/g.exec(n)||[],e.version=parseInt(t[1])),e):"Chrome"===r[1]&&null!=(t=n.match(/\b(OPR|Edge)\/(\d+)/))?(e.name=t[1].replace("OPR",u.BROWSER_NAME_OPERA),e.version=parseInt(t[2]),e):(r=r[2]?[r[1],r[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(t=n.match(/version\/(\d+)/i))&&r.splice(1,1,t[1]),e.name=r[0],e.version=parseInt(r[1]),e)},u.prototype._getOSName=function(){var t=navigator.platform||"",e=(navigator.userAgent||"").toLowerCase(),n=navigator.userAgentData||[];return-1!=t.indexOf("Win")?u.OS_NAME_WINDOWS:-1!=t.indexOf("Mac")?u.OS_NAME_MAC:-1!=t.indexOf("Android")||-1!=e.indexOf("android")||"Android"==n.platform||-1!=t.indexOf("Linux")&&navigator.maxTouchPoints&&navigator.maxTouchPoints>1?u.OS_NAME_ANDROID:-1!=t.indexOf("Linux")?u.OS_NAME_LINUX:-1!=t.indexOf("FreeBSD")?u.OS_NAME_UNIX:u.OS_NAME_UNKNOWN},u.prototype._getArch=function(){var t,e=navigator.platform||"";switch(this._getOSName()){case u.OS_NAME_WINDOWS:t=-1!=e.indexOf("Win32")?u.BROWSER_ARCH_NAME_X86:u.BROWSER_ARCH_NAME_X64;break;case u.OS_NAME_MAC:t=-1!=e.indexOf("MacIntel")?u.BROWSER_ARCH_NAME_X86:u.BROWSER_ARCH_NAME_X64;break;case u.OS_NAME_UNIX:case u.OS_NAME_LINUX:case u.OS_NAME_ANDROID:t=-1!=e.indexOf("armv")?u.BROWSER_ARCH_NAME_ARM:-1!=e.indexOf("x86_64")?u.BROWSER_ARCH_NAME_X64:u.BROWSER_ARCH_NAME_X32;break;default:t=u.BROWSER_ARCH_NAME_UNKNOWN}return t},u.prototype.GetName=function(){return this.m_name},u.prototype.GetVersion=function(){return this.m_version},u.prototype.GetArch=function(){return this.m_arch},u.prototype.GetOSName=function(){return this.m_os_name};var c=[];c[0]="Executed successfully",c[-1]="Unknown error",c[-32300]="Transport error",c[-32400]="System error",c[-32500]="Application error",c[-32510]="Application error. Invalid session",c[-32600]="Server error. Invalid rpc. Not conforming to spec",c[-32601]="Server error. Requested method not found",c[-32602]="Server error. Invalid method parameters",c[-32603]="Server error. Internal rpc error",c[-32700]="Parse error. Not well formed",c[-32701]="Parse error. Unsupported encoding",c[-32702]="Parse error. Invalid character for encoding";var l=function(t,e,n,r){switch(this.Vendor="JSC IIT",this.ClassVersion="1.0.2",this.ClassName="JSONRPCClient",this.m_type=t,this.m_log=!1,this._logFunction("Initialize",arguments,["type","address","port","useHttps"]),t){case 2:this.m_uri=e,this.m_callbacks=[],this._registerOnExtensionRecieveEventHandler();break;case 3:case 4:this.m_uri=e,this.m_callbacks=[];break;case 1:default:this.m_uri="",r&&e.indexOf("https://")?this.m_uri+="https://":0!=e.indexOf("http://")&&(this.m_uri+="http://"),this.m_uri+=e+":"+n}this.m_requests=0,this.m_session_id=this._loadSessionId()};l.prototype._logFunction=function(t,e,n){if(this.m_log){for(var r="(",i=0;i<e.length;i++)r+=n[i]+": "+e[i].toString(),i!=e.length-1&&(r+=", ");r+=")",this._log(t,r)}},l.prototype._log=function(t,e){this.m_log&&console.log(t+": "+e)},l.prototype._loadSessionId=function(){try{var t=sessionStorage.getItem(this.ClassName+"session_id");return void 0===t||null==t||""==t?null:t}catch(t){return null}},l.prototype._saveSessionId=function(t){try{sessionStorage.setItem(this.ClassName+"session_id",t)}catch(t){}},l.prototype._removeSessionId=function(){try{sessionStorage.removeItem(this.ClassName+"session_id")}catch(t){}},l.prototype.createXMLHttpRequest=function(){return"undefined"==typeof XMLHttpRequest&&(XMLHttpRequest=function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}throw c[-32300]}),new XMLHttpRequest},l.prototype.makeRequest=function(t,e,n){var r=null;try{(r={}).jsonrpc="2.0",r.id=n,r.method=t,r.params=e,r.session_id=this.m_session_id,r=JSON.stringify(r)}catch(t){}return r},l.prototype.verifyResponse=function(t,e){try{if("2.0"!=e.jsonrpc)return!1;var n=e.error;if(void 0===n){if(e.id!=t||void 0===e.result)return!1}else{if(void 0===n.code||void 0===n.message)return!1;if(0!=n.code)return!1}if(void 0!==e.session_id)if(null!=this.m_session_id&&null!=e.session_id){if(this.m_session_id!=e.session_id)return!1}else this.m_session_id=e.session_id,this._saveSessionId(this.m_session_id);return!0}catch(t){return!1}},l.prototype.handleResponse=function(t,e){try{return e=JSON.parse(e),this.verifyResponse(t,e)?e:(this.m_session_id=null,this._removeSessionId(),null)}catch(t){return null}},l.prototype._sendHttp=function(t,e,n){var r,i,o=this;try{if((r=this.createXMLHttpRequest()).open("POST",this.m_uri,null!=n),r.setRequestHeader("Content-Type","application/json-rpc"),null!=n&&(r.onload=function(){200==r.status?(i=o.handleResponse(e,r.response),n(null!=i?i.result:null)):n(null)},r.onerror=function(){n(null)}),r.send(t),null!=n)return;return 200!=r.status||null==(i=this.handleResponse(e,r.response))?null:i.result}catch(t){if(null==n)return null;n(null)}},l.prototype._registerOnExtensionRecieveEventHandler=function(){var t=this;window.addEventListener("message",(function(e){if(e.data.sender==t.m_uri)try{var n=e.data.callback_id,r=t.m_callbacks[n-1];delete t.m_callbacks[n-1],t._logFunction("_registerOnExtensionRecieveEventHandler",[r.request_id,e.data.data],["request_id","data"]);var i=t.handleResponse(r.request_id,e.data.data);if(null==i)return void r.callback(null);r.callback(i.result)}catch(t){}}),!1)},l.prototype._sendExtension=function(t,e,n){var r=this;if(r._logFunction("_sendExtension",[arguments[0],arguments[1]],["request","request_id"]),!n)throw"Synchronous calls for web extensions not supported";if(1==document.getElementsByClassName(r.m_uri).length)try{var i={request_id:e,callback:n},o=r.m_callbacks.push(i),s={sender:r.ClassName,request:t,callback_id:o};window.postMessage(s,"*")}catch(t){n(null)}else n(null)},l.prototype._getPluginObject=function(){try{for(var t=document.getElementsByTagName("object"),e=0;e<t.length;e++){var n=t[e].classid;if(!n&&t[e].attributes&&t[e].attributes.classid&&(n=t[e].attributes.classid.value),n===this.m_uri)return t[e]}return null}catch(t){return null}},l.prototype._sendPlugin=function(t,e,n){var r,o=this;o._logFunction("_sendPlugin",[arguments[0],arguments[1]],["request","request_id"]);var a=o._getPluginObject();if(null==a)return null!=n&&n(null),null;var u=function(t){try{for(var e=new s,n=new h(0);;){var r=a.ProcessData(t),o=r.slice(0,5),u=r.slice(5,r.length-1);if(null!=u||""!=u){var c=e.decode(u),l=new h(n.length+c.length);l.set(n),l.set(c,n.length),n=l}switch(o){case'"part':t='"next"';continue;case'"last':return i.ArrayToString("UTF-8",n);default:return null}}}catch(t){return null}};try{return null!=n?void setTimeout((function(){r=u(t),o._logFunction("_sendPlugin",[e,r],["request_id","response"]),null!=(r=o.handleResponse(e,r))?n(r.result):n(null)}),1):(r=u(t),null==(r=o.handleResponse(e,r))?null:r.result)}catch(t){n(null)}},l.prototype.send=function(t,e,n){switch(this.m_type){case 1:return this._sendHttp(t,e,n);case 2:return this._sendExtension(t,e,n);case 3:case 4:return this._sendPlugin(t,e,n)}},l.prototype.execute=function(t,e,n){var r,i;return r=this.m_requests,this.m_requests++,null==(i=this.makeRequest(t,e,r))?null!=n?void n(null):null:null==n?this.send(i,r,n):void this.send(i,r,n)};var f=function(){};f.WEB_LIBRARY_OS_NOT_SUPPORTED=131072,f.WEB_LIBRARY_NOT_INSTALLED_OR_RUN=131073,f.WEB_LIBRARY_JAVA_APPLET_NOT_LOADED=131074,f.WEB_LIBRARY_INSTALLED_VERSION_NOT_SUPPORTED=131075,f.WEB_LIBRARY_INSTALL_PACKAGE=131076,f.WEB_LIBRARY_UPDATE_PACKAGE=131077,f.WEB_LIBRARY_USER_MANUAL=131078,f.WEB_LIBRARY_WEB_EXTENSION_INSTALL_PACKAGE=131079,f.WEB_LIBRARY_CHECK_JRE_VERSION=131080,f.WEB_LIBRARY_WEB_EXTENSION_NOT_INSTALLED_OR_RUN=131081,(f.DESCRIPTIONS=[])[f.WEB_LIBRARY_OS_NOT_SUPPORTED]=["Інсталяційний пакет web-бібліотеки підпису для вашої системи відсутній","Инсталяционный пакет web-библиотеки подписи для вашей системы отсутствует","The installation package of the library for the web signature for your system is absent"],f.DESCRIPTIONS[f.WEB_LIBRARY_NOT_INSTALLED_OR_RUN]=["Бібліотеку web-підпису не запущено або не інстальовано у системі. Для продовження необхідно запустити або інсталювати бібліотеку web-підпису.","Библиотеку web-подписи не запущено или не установлено в системе. Для продолжения необходимо запустить или установить библиотеку web-подписи.","The library for the web signature isn't started or not installed in system. To continue, it is necessary to start or install library for the web signature."],f.DESCRIPTIONS[f.WEB_LIBRARY_INSTALLED_VERSION_NOT_SUPPORTED]=["Інстальована версія web-бібліотеки підпису більше не підтримується. Для продовження необхідно інсталювати оновлену версію web-бібліотеки підпису.","Инсталированная версия web-библиотеки подписи больше не поддерживается. Для продолжения необходимо установить обновленную версию web-библиотеки подписи.","The installed version of library for the web signature isn't supported any more. To continue, it is necessary to install the updated version of the library for the web signature."],f.DESCRIPTIONS[f.WEB_LIBRARY_JAVA_APPLET_NOT_LOADED]=["Java-апплет не завантажено. Необхідно перевірити версію JRE","Java-апплет не загружен. Необходимо проверить версию JRE","Java applet isn't loaded. It is necessary to check the version of JRE"],f.DESCRIPTIONS[f.WEB_LIBRARY_INSTALL_PACKAGE]=["Інсталяційний пакет web-бібліотеки підпису","Инсталяционный пакет web-библиотеки подписи","Install package of library for the web signature"],f.DESCRIPTIONS[f.WEB_LIBRARY_UPDATE_PACKAGE]=["Оновлення web-бібліотеки підпису","Обновление web-библиотеки подписи","Update of library for the web signature"],f.DESCRIPTIONS[f.WEB_LIBRARY_USER_MANUAL]=["Настанова користувача","Руководство пользователя","User manual"],f.DESCRIPTIONS[f.WEB_LIBRARY_WEB_EXTENSION_INSTALL_PACKAGE]=["Інсталяційний пакет бібліотеки підпису (web-розширення)","Инсталяционный пакет библиотеки подписи (web-расширение)","Install package of library for the web signature (web-extension)"],f.DESCRIPTIONS[f.WEB_LIBRARY_CHECK_JRE_VERSION]=["Перевірити версію JRE","Проверить версию JRE","Check JRE version"],f.DESCRIPTIONS[f.WEB_LIBRARY_WEB_EXTENSION_NOT_INSTALLED_OR_RUN]=["Веб-розширення для роботи бібліотеки web-підпису не запущено або не інстальовано в браузері. Для продовження необхідно запустити або інсталювати веб-розширення.","Веб-расширение для работы библиотеки web-подписи не запущено или не установлено в браузере. Для продолжения необходимо запустить или установить веб-расширение.","The web extension for the web signature library is not running or installed in the browser. To continue, you need to run or install the web extension."],f.getString=function(t,e){var n,r;return void 0===(n=f.DESCRIPTIONS[t])&&(n=""),void 0===(r=n[e-1])?n[0]:r};var _=function(t,e,n,r,i){switch(this.m_id=e,this.m_library=null,this.m_language=n,this.m_supportedLibraryTypes=[],this.m_supportedLibraryTypesIndex=0,this.m_noJavaApplet=!1|r,this.m_webExtensionFirst=!1|i,this.m_errorResult=null,t){case _.LIBRARY_TYPE_JAVA_APPLET:case _.LIBRARY_TYPE_SIGN_AGENT:case _.LIBRARY_TYPE_WEB_EXTENSION:case _.LIBRARY_TYPE_NPAPI:case _.LIBRARY_TYPE_ACTIVE_X:this.m_libraryType=t;break;default:this.m_libraryType=_.LIBRARY_TYPE_DEFAULT}this.m_libraryType==_.LIBRARY_TYPE_DEFAULT?(this.m_webExtensionFirst&&_.isWebExtensionSupported()&&this.m_supportedLibraryTypes.push(_.LIBRARY_TYPE_WEB_EXTENSION),_.isSignAgentSupported()&&this.m_supportedLibraryTypes.push(_.LIBRARY_TYPE_SIGN_AGENT),!this.m_webExtensionFirst&&_.isWebExtensionSupported()&&this.m_supportedLibraryTypes.push(_.LIBRARY_TYPE_WEB_EXTENSION),_.isNPAPISupported()&&this.m_supportedLibraryTypes.push(_.LIBRARY_TYPE_NPAPI),_.isActiveXSupported()&&this.m_supportedLibraryTypes.push(_.LIBRARY_TYPE_ACTIVE_X),!this.m_noJavaApplet&&_.isJavaAppletSupported()&&this.m_supportedLibraryTypes.push(_.LIBRARY_TYPE_JAVA_APPLET)):this.m_supportedLibraryTypes.push(this.m_libraryType),this.onload=function(t){},this.onerror=function(t,e,n){},this.getLibraryType=function(){return this.m_libraryType}};_.LIBRARY_TYPE_DEFAULT=0,_.LIBRARY_TYPE_JAVA_APPLET=1,_.LIBRARY_TYPE_SIGN_AGENT=2,_.LIBRARY_TYPE_WEB_EXTENSION=3,_.LIBRARY_TYPE_NPAPI=4,_.LIBRARY_TYPE_ACTIVE_X=5,_.EU_DEFAULT_LANG=0,_.EU_UA_LANG=1,_.EU_RU_LANG=2,_.EU_EN_LANG=3,_.isJavaAppletSupported=function(){var t=new u;if(this.m_noJavaApplet)return!1;switch(t.GetName()){case u.BROWSER_NAME_FIREFOX:case u.BROWSER_NAME_CHROME:return!(t.GetVersion()>44);case u.BROWSER_NAME_OPERA:return!(t.GetVersion()>30);case u.BROWSER_NAME_EDGE:case u.BROWSER_NAME_UNKNOWN:return!1;default:return!0}},_.isSignAgentSupported=function(){var t=new u;switch(t.GetName()){case u.BROWSER_NAME_IE:if(t.GetVersion()<10)return!1;break;case u.BROWSER_NAME_SAFARI:if(t.GetVersion()<7)return!1;break;case u.BROWSER_NAME_UNKNOWN:return!1}switch(t.GetOSName()){case u.OS_NAME_WINDOWS:case u.OS_NAME_MAC:break;case u.OS_NAME_ANDROID:case u.OS_NAME_LINUX:break;case u.OS_NAME_UNKNOWN:default:return!1}return!0},_.isWebExtensionSupported=function(){var t=new u;switch(t.GetName()){case u.BROWSER_NAME_CHROME:break;case u.BROWSER_NAME_OPERA:if(t.GetVersion()<35)return!1;break;case u.BROWSER_NAME_FIREFOX:if(t.GetVersion()<50)return!1;break;case u.BROWSER_NAME_UNKNOWN:default:return!1}switch(t.GetOSName()){case u.OS_NAME_ANDROID:case u.OS_NAME_UNKNOWN:return!1}return!0},_.isNPAPISupported=function(){var t=new u;switch(t.GetName()){case u.BROWSER_NAME_FIREFOX:if(t.GetVersion()>51)return!1;break;default:return!1}return!0},_.isActiveXSupported=function(){var t=new u;switch(t.GetName()){case u.BROWSER_NAME_IE:if(t.GetVersion()<9||t.GetArch()==u.BROWSER_ARCH_NAME_X64)return!1;break;default:return!1}return!0},_.isWebExtensionInstalled=function(){var t=(new u).GetName()==u.BROWSER_NAME_FIREFOX?"eusw@iit.com.ua":"chrome-extension://jffafkigfgmjafhpkoibhfefeaebmccg/";return 1==document.getElementsByClassName(t).length},_.prototype.getLibraryType=function(){return this.m_libraryType},_.prototype.load=function(){var t=this;setTimeout((function(){t._load(t.m_supportedLibraryTypes[t.m_supportedLibraryTypesIndex])}),1)},_.prototype.unload=function(){var t=document.getElementById(this.m_id);t&&t.parentNode&&t.parentNode.removeChild(t)},_.prototype._load=function(t){switch(t){case _.LIBRARY_TYPE_JAVA_APPLET:return void this._loadSignApplet();case _.LIBRARY_TYPE_SIGN_AGENT:return void this._loadSignAgent();case _.LIBRARY_TYPE_WEB_EXTENSION:return void this._loadWebExtension();case _.LIBRARY_TYPE_NPAPI:return void this._loadNPAPI();case _.LIBRARY_TYPE_ACTIVE_X:return void this._loadActiveX()}},_.prototype._onLoad=function(){this.m_libraryType=this.m_supportedLibraryTypes[this.m_supportedLibraryTypesIndex];try{this.onload(this.m_library)}catch(t){console.log(t)}},_.prototype._onLoadError=function(t,e,n,r){null==this.m_errorResult&&(this.m_errorResult={msg:e,code:n,library:r});var i=document.getElementById(this.m_id);if(i&&i.parentNode&&i.parentNode.removeChild(i),t)if(this.m_supportedLibraryTypesIndex++,this.m_supportedLibraryTypesIndex>=this.m_supportedLibraryTypes.length)try{this.onerror(this.m_errorResult.msg,this.m_errorResult.code,this.m_errorResult.library)}catch(t){console.log(t)}else this.load();else try{this.onerror(this.m_errorResult.msg,this.m_errorResult.code,this.m_errorResult.library)}catch(t){console.log(t)}},_.prototype._loadSignApplet=function(){var t=document.createElement("applet");t.setAttribute("codebase","https://sign.eu.iit.com.ua"),t.setAttribute("code","com.iit.certificateAuthority.endUser.libraries.signJava.EndUser.class"),t.setAttribute("archive","EUSignJava.jar"),t.setAttribute("cache_archive","EUSignJava.jar"),t.setAttribute("cache_version","1.3.102"),t.setAttribute("separate_jvm",!0),t.setAttribute("id",this.m_id),t.setAttribute("width","100%"),t.setAttribute("height","1"),document.body.appendChild(t),this.m_library=document.getElementById(this.m_id),this._waitForSignAppletLoad(this,100,1200)},_.prototype._waitForSignAppletLoad=function(t,e,n){try{t.m_library.SetUIMode(!1)}catch(i){if(0!=n)return void setTimeout((function(){t._waitForSignAppletLoad(t,e,n-1)}),e,n);var r="";return r=et.getErrorDescriptionEx(et.ERROR_LIBRARY_COMUNICATION_FAILED,t.m_language)+". ",r+=f.getString(f.WEB_LIBRARY_JAVA_APPLET_NOT_LOADED,t.m_language),r+="<br><br>",r+='<a style="text-indent:18px" href="https://www.java.com/ru/download/installed.jsp">'+f.getString(f.WEB_LIBRARY_CHECK_JRE_VERSION,t.m_language)+"</a>",void t._onLoadError(!0,r,et.ERROR_LIBRARY_COMUNICATION_FAILED,null)}t._onLoad(t.m_library)},_.prototype._appendWebWrapperObject=function(t,e,n,r){try{var i=new rt(t,e),o=document.createElement("object");for(var s in o.setAttribute("id",this.m_id),n?r?(o.setAttribute("classid",t),o.setAttribute("height","1px")):(o.type=t,o.classid=t,o.height="1px"):(o.classid="EUSignCP.class",o.style="display:none",o.style.visibility="hidden"),document.body.appendChild(o),i)o[s]=i[s];return this.m_library=document.getElementById(this.m_id),!0}catch(t){return!1}},_.prototype._onLoadWebLibraryError=function(t){var e,n=this.m_library,r=!0,i="";switch(e=_.isWebExtensionSupported()&&!_.isWebExtensionInstalled()&&this.m_webExtensionFirst,i+=et.getErrorDescriptionEx(et.ERROR_LIBRARY_COMUNICATION_FAILED,this.m_language),i+=". ",t.GetErrorCode()){case et.ERROR_LIBRARY_COMUNICATION_FAILED:i+=f.getString(e?f.WEB_LIBRARY_WEB_EXTENSION_NOT_INSTALLED_OR_RUN:f.WEB_LIBRARY_NOT_INSTALLED_OR_RUN,this.m_language);break;case et.ERROR_LIBRARY_VERSION_NOT_SUPPORTED:i+=f.getString(f.WEB_LIBRARY_INSTALLED_VERSION_NOT_SUPPORTED,this.m_language),r=!1,this.m_errorResult=null;break;default:i+=et.getErrorDescriptionEx(t.GetErrorCode(),this.m_language)+"."}i+="<br><br>",null!=n.GetInstallURL()?(t.GetErrorCode()==et.ERROR_LIBRARY_VERSION_NOT_SUPPORTED?i+='<div><a style="text-indent:18px" href="'+n.GetUpdateURL()+'">'+f.getString(f.WEB_LIBRARY_UPDATE_PACKAGE,this.m_language)+"</a></div>":i+=e?'<div><a style="text-indent:18px" href="'+n.GetWebExtensionInstallURL()+'">'+f.getString(f.WEB_LIBRARY_WEB_EXTENSION_INSTALL_PACKAGE,this.m_language)+"</a></div>":'<div><a style="text-indent:18px" href="'+n.GetInstallURL()+'">'+f.getString(f.WEB_LIBRARY_INSTALL_PACKAGE,this.m_language)+"</a></div>",i+='<div><a style="text-indent:18px" href="'+n.GetHelpURL()+'">'+f.getString(f.WEB_LIBRARY_USER_MANUAL,this.m_language)+"</a></div>"):i+="<div>"+f.getString(f.WEB_LIBRARY_OS_NOT_SUPPORTED,this.m_language)+"</div>",this._onLoadError(r,i,t.GetErrorCode(),n)},_.prototype._loadWebLibrary=function(){var t=this;t.m_library.Load((function(){t._onLoad()}),(function(e){t._onLoadWebLibraryError(e)}))},_.prototype._loadSignAgent=function(){if(this._appendWebWrapperObject("localhost","http:"==window.location.protocol?"8081":"8083",!1,!1))this._loadWebLibrary();else{var t=et.getErrorDescriptionEx(et.ERROR_LIBRARY_COMUNICATION_FAILED,this.m_language);this._onLoadError(!0,t,et.ERROR_LIBRARY_COMUNICATION_FAILED,null)}},_.prototype._loadWebExtension=function(){if(this._appendWebWrapperObject("chrome-extension://jffafkigfgmjafhpkoibhfefeaebmccg/","",!1,!1))this._loadWebLibrary();else{var t=et.getErrorDescriptionEx(et.ERROR_LIBRARY_COMUNICATION_FAILED,this.m_language);this._onLoadError(!0,t,et.ERROR_LIBRARY_COMUNICATION_FAILED,null)}},_.prototype._loadPlugin=function(t,e,n,r){if(this._appendWebWrapperObject(t,"",!0,r))this._waitForPluginLoad(this,e,n);else{var i=et.getErrorDescriptionEx(et.ERROR_LIBRARY_COMUNICATION_FAILED,this.m_language);this._onLoadError(!0,i,et.ERROR_LIBRARY_COMUNICATION_FAILED,null)}},_.prototype._waitForPluginLoad=function(t,e,n){t.m_library.Load((function(){t._onLoad()}),(function(r){r.GetErrorCode()!=et.ERROR_LIBRARY_COMUNICATION_FAILED||0==n?t._onLoadWebLibraryError(r):setTimeout((function(){t._waitForPluginLoad(t,e,n-1)}),e,n)}))},_.prototype._loadNPAPI=function(){this._loadPlugin("application/x-eusign-cp",100,50,!1)},_.prototype._loadActiveX=function(){this._loadPlugin("clsid:B7E24C75-E343-4DA2-A8D3-C80970FB7D7B",100,50,!0)};var p=function(){this.vendor="JSC IIT",this.parentClassName="Object",this.className="EndUserArrayList",this.classVersion=1,this.m_array=[]};p.prototype.add=function(t){return this.m_array.push(t),!0},p.prototype.clear=function(){this.m_array=[]},p.prototype.get=function(t){return this.m_array[t]},p.prototype.size=function(){return this.m_array.length},Object.create||(Object.create=function(t,e){if("object"!=typeof t&&"function"!=typeof t||null===t||void 0!==e)throw new Error("Invalid arguments");function n(){}return n.prototype=t,new n}),Uint8Array.prototype.slice||(Uint8Array.prototype.slice=Uint8Array.prototype.subarray);var h=null;function E(t){return null!=t&&"object"==typeof t&&("EndUserTransferableObject"==t.className||"EndUserTransferableObject"==t.parentClassName)}h="undefined"==typeof Uint8Array?function(t){var e;if("number"==typeof t){e=new Array(t);for(var n=0;n<t;++n)e[n]=0}else e=t.slice(0);return e.buffer=e,e.subarray=function(t,n){return e.slice(t,n)},e.set=function(t,n){arguments.length<2&&(n=0);for(var r=0,i=t.length;r<i;++r,++n)e[n]=255&t[r]},e.byteLength=e.length,"object"==typeof t&&t.buffer&&(e.buffer=t.buffer),e}:Uint8Array;var y=function(){this.vendor="JSC IIT",this.parentClassName="Object",this.className="EndUserTransferableObject",this.classVersion=1,this.isFilled=!1,this.fields={}};y.makeTransferable=function(t){var e,n;n=y,(e=t).prototype=Object.create(n.prototype),e.prototype.constructor=e,y[(new t).className]=t},y.prototype.base64Coder=new s,y.prototype.dateCoder=new o,y.prototype.setClassInfo=function(t,e){this.parentClassName="EndUserTransferableObject",this.className=t,this.classVersion=e},y.prototype.initializeFields=function(){for(var t in this.fields)switch(this.fields[t]){case"boolean":this[t]=!1;break;case"int":case"long":case"number":this[t]=0;break;case"string":this[t]="";break;case"EndUserKeyMedia":this[t]=new C;break;default:this[t]=null}},y.prototype.set=function(t){if(this.className!=t.className)throw"invalid class";for(var e in this.fields)this[e]=t[e]},y.prototype.encode=function(){var t,e;for(var n in e=new Object,t=new Object,this.fields)null!=this[n]?E(this[n])?e[n]=this[n].encode():"byteArray"==this.fields[n]?e[n]=this.base64Coder.encode(this[n]):"time"==this.fields[n]?e[n]=this.dateCoder.encode(this[n]):e[n]=this[n]:e[n]=null;return t.className=this.className,t.classVersion=this.classVersion,t.classFields=e,t},y.prototype.decode=function(t){try{if(null==t.classVersion||null==t.classFields)return!1;var e=t.classFields;for(var n in this.fields)if("time"==this.fields[n])this[n]=this.dateCoder.decode(e[n]);else if("EndUserOwnerInfo"==this.fields[n])this[n]=new D,this[n].decode(e[n]);else if("EndUserTimeInfo"==this.fields[n])this[n]=new O,this[n].decode(e[n]);else if("EndUserKeyMedia"==this.fields[n])this[n]=new C,this[n].decode(e[n]);else if("EndUserCertificateInfoEx"==this.fields[n])this[n]=new M,this[n].decode(e[n]);else if("byteArray"==this.fields[n])null!=e[n]&&(this[n]=this.base64Coder.decode(e[n]));else if("array"==this.fields[n]){this[n]=[];for(var r=e[n],i=0;i<r.length;i++){var o=r[i].className,s=new y[o];if(void 0!==s){if(!s.decode(r[i]))throw"invalid class";"EndUserByteArray"==s.className&&(s=s.GetData()),this[n].push(s)}else this[n].push(r[i])}}else this[n]=e[n];return!0}catch(t){return this.isFilled=!1,!1}};var S=function(t){this.setClassInfo("EndUserByteArray",1),this.fields={data:"byteArray"},this.initializeFields(),this.data=t};y.makeTransferable(S),S.prototype.GetData=function(){return this.data},S.prototype.SetData=function(t){this.data=t};var C=function(){this.setClassInfo("EndUserKeyMedia",1),this.fields={typeIndex:"long",devIndex:"long",password:"string"},this.initializeFields()};y.makeTransferable(C),C.prototype.GetTypeIndex=function(){return this.typeIndex},C.prototype.SetTypeIndex=function(t){this.typeIndex=t},C.prototype.GetDevIndex=function(){return this.devIndex},C.prototype.SetDevIndex=function(t){this.devIndex=t},C.prototype.GetPassword=function(){return this.password},C.prototype.SetPassword=function(t){this.password=t};var d=function(){this.setClassInfo("EndUserFileStoreSettings",1),this.fields={path:"string",checkCRLs:"boolean",autoRefresh:"boolean",ownCRLsOnly:"boolean",fullAndDeltaCRLs:"boolean",autoDownloadCRLs:"boolean",saveLoadedCerts:"boolean",expireTime:"long"},this.initializeFields(),this.expireTime=3600};y.makeTransferable(d),d.prototype.GetPath=function(){return this.path},d.prototype.SetPath=function(t){this.path=t},d.prototype.GetCheckCRLs=function(){return this.checkCRLs},d.prototype.SetCheckCRLs=function(t){this.checkCRLs=t},d.prototype.GetAutoRefresh=function(){return this.autoRefresh},d.prototype.SetAutoRefresh=function(t){this.autoRefresh=t},d.prototype.GetOwnCRLsOnly=function(){return this.ownCRLsOnly},d.prototype.SetOwnCRLsOnly=function(t){this.ownCRLsOnly=t},d.prototype.GetFullAndDeltaCRLs=function(){return this.fullAndDeltaCRLs},d.prototype.SetFullAndDeltaCRLs=function(t){this.fullAndDeltaCRLs=t},d.prototype.GetAutoDownloadCRLs=function(){return this.autoDownloadCRLs},d.prototype.SetAutoDownloadCRLs=function(t){this.autoDownloadCRLs=t},d.prototype.GetSaveLoadedCerts=function(){return this.saveLoadedCerts},d.prototype.SetSaveLoadedCerts=function(t){this.saveLoadedCerts=t},d.prototype.GetExpireTime=function(){return this.expireTime},d.prototype.SetExpireTime=function(t){this.expireTime=t};var A=function(){this.setClassInfo("EndUserProxySettings",1),this.fields={useProxy:"boolean",anonymous:"boolean",address:"string",port:"string",user:"string",password:"string",savePassword:"boolean"},this.initializeFields(),this.port="80"};y.makeTransferable(A),A.prototype.GetUseProxy=function(){return this.useProxy},A.prototype.SetUseProxy=function(t){this.useProxy=t},A.prototype.GetAnonymous=function(){return this.anonymous},A.prototype.SetAnonymous=function(t){this.anonymous=t},A.prototype.GetAddress=function(){return this.address},A.prototype.SetAddress=function(t){this.address=t},A.prototype.GetPort=function(){return this.port},A.prototype.SetPort=function(t){this.port=t},A.prototype.GetUser=function(){return this.user},A.prototype.SetUser=function(t){this.user=t},A.prototype.GetPassword=function(){return this.password},A.prototype.SetPassword=function(t){this.password=t},A.prototype.GetSavePassword=function(){return this.savePassword},A.prototype.SetSavePassword=function(t){this.savePassword=t};var R=function(){this.setClassInfo("EndUserTSPSettings",1),this.fields={getStamps:"boolean",address:"string",port:"string"},this.initializeFields(),this.port="80"};y.makeTransferable(R),R.prototype.GetGetStamps=function(){return this.getStamps},R.prototype.SetGetStamps=function(t){this.getStamps=t},R.prototype.GetAddress=function(){return this.address},R.prototype.SetAddress=function(t){this.address=t},R.prototype.GetPort=function(){return this.port},R.prototype.SetPort=function(t){this.port=t};var m=function(){this.setClassInfo("EndUserOCSPSettings",1),this.fields={useOCSP:"boolean",beforeStore:"boolean",address:"string",port:"string"},this.initializeFields(),this.port="80"};y.makeTransferable(m),m.prototype.GetUseOCSP=function(){return this.useOCSP},m.prototype.SetUseOCSP=function(t){this.useOCSP=t},m.prototype.GetBeforeStore=function(){return this.beforeStore},m.prototype.SetBeforeStore=function(t){this.beforeStore=t},m.prototype.GetAddress=function(){return this.address},m.prototype.SetAddress=function(t){this.address=t},m.prototype.GetPort=function(){return this.port},m.prototype.SetPort=function(t){this.port=t};var T=function(){this.setClassInfo("EndUserLDAPSettings",1),this.fields={useLDAP:"boolean",address:"string",port:"string",anonymous:"boolean",user:"string",password:"string"},this.initializeFields(),this.port="389"};y.makeTransferable(T),T.prototype.GetUseLDAP=function(){return this.useLDAP},T.prototype.SetUseLDAP=function(t){this.useLDAP=t},T.prototype.GetAddress=function(){return this.address},T.prototype.SetAddress=function(t){this.address=t},T.prototype.GetPort=function(){return this.port},T.prototype.SetPort=function(t){this.port=t},T.prototype.GetAnonymous=function(){return this.anonymous},T.prototype.SetAnonymous=function(t){this.anonymous=t},T.prototype.GetUser=function(){return this.user},T.prototype.SetUser=function(t){this.user=t},T.prototype.GetPassword=function(){return this.password},T.prototype.SetPassword=function(t){this.password=t};var g=function(){this.setClassInfo("EndUserCMPSettings",1),this.fields={useCMP:"boolean",address:"string",port:"string",commonName:"string"},this.initializeFields(),this.port="80"};y.makeTransferable(g),g.prototype.GetUseCMP=function(){return this.useCMP},g.prototype.SetUseCMP=function(t){this.useCMP=t},g.prototype.GetAddress=function(){return this.address},g.prototype.SetAddress=function(t){this.address=t},g.prototype.GetPort=function(){return this.port},g.prototype.SetPort=function(t){this.port=t},g.prototype.GetCommonName=function(){return this.commonName},g.prototype.SetCommonName=function(t){this.commonName=t};var P=function(){this.setClassInfo("EndUserModeSettings",1),this.fields={offlineMode:"boolean"},this.initializeFields()};y.makeTransferable(P),P.prototype.GetOfflineMode=function(){return this.offlineMode},P.prototype.SetOfflineMode=function(t){this.offlineMode=t};var v=function(){this.setClassInfo("EndUserOCSPAccessInfoModeSettings",1),this.fields={enabled:"boolean"},this.initializeFields()};y.makeTransferable(v),v.prototype.GetEnabled=function(){return this.enabled},v.prototype.SetEnabled=function(t){this.enabled=t};var I=function(){this.setClassInfo("EndUserOCSPAccessInfoSettings",1),this.fields={issuerCN:"string",address:"string",port:"string"},this.initializeFields()};y.makeTransferable(I),I.prototype.GetIssuerCN=function(){return this.issuerCN},I.prototype.SetIssuerCN=function(t){this.issuerCN=t},I.prototype.GetAddress=function(){return this.address},I.prototype.SetAddress=function(t){this.address=t},I.prototype.GetPort=function(){return this.port},I.prototype.SetPort=function(t){this.port=t};var U=function(){this.setClassInfo("EndUserKeyMediaSettings",1),this.fields={sourceType:"long",showErrors:"boolean",keyMedia:"EndUserKeyMedia"},this.initializeFields(),this.sourceType=1,this.showErrors=!0};y.makeTransferable(U),U.prototype.GetSourceType=function(){return this.sourceType},U.prototype.SetSourceType=function(t){this.sourceType=t},U.prototype.GetShowErrors=function(){return this.showErrors},U.prototype.SetShowErrors=function(t){this.showErrors=t},U.prototype.GetKeyMedia=function(){return this.keyMedia},U.prototype.SetKeyMedia=function(t){this.keyMedia=t};var b=function(){this.setClassInfo("EndUserTSLSettings",1),this.fields={useTSL:"boolean",autoDownloadTSL:"boolean",tslAddress:"string"},this.initializeFields()};y.makeTransferable(b),b.prototype.GetUseTSL=function(){return this.useTSL},b.prototype.SetUseTSL=function(t){this.useTSL=t},b.prototype.GetAutoDownloadTSL=function(){return this.autoDownloadTSL},b.prototype.SetAutoDownloadTSL=function(t){this.autoDownloadTSL=t},b.prototype.GetTSLAddress=function(){return this.tslAddress},b.prototype.SetTSLAddress=function(t){this.tslAddress=t};var D=function(){this.setClassInfo("EndUserOwnerInfo",1),this.fields={isFilled:"boolean",issuer:"string",issuerCN:"string",serial:"string",subject:"string",subjCN:"string",subjOrg:"string",subjOrgUnit:"string",subjTitle:"string",subjState:"string",subjLocality:"string",subjFullName:"string",subjAddress:"string",subjPhone:"string",subjEMail:"string",subjDNS:"string",subjEDRPOUCode:"string",subjDRFOCode:"string"},this.initializeFields()};y.makeTransferable(D),D.prototype.IsFilled=function(){return this.isFilled},D.prototype.GetIssuer=function(){return this.issuer},D.prototype.GetIssuerCN=function(){return this.issuerCN},D.prototype.GetSerial=function(){return this.serial},D.prototype.GetSubject=function(){return this.subject},D.prototype.GetSubjCN=function(){return this.subjCN},D.prototype.GetSubjOrg=function(){return this.subjOrg},D.prototype.GetSubjOrgUnit=function(){return this.subjOrgUnit},D.prototype.GetSubjTitle=function(){return this.subjTitle},D.prototype.GetSubjState=function(){return this.subjState},D.prototype.GetSubjLocality=function(){return this.subjLocality},D.prototype.GetSubjFullName=function(){return this.subjFullName},D.prototype.GetSubjAddress=function(){return this.subjAddress},D.prototype.GetSubjPhone=function(){return this.subjPhone},D.prototype.GetSubjEMail=function(){return this.subjEMail},D.prototype.GetSubjDNS=function(){return this.subjDNS},D.prototype.GetSubjEDRPOUCode=function(){return this.subjEDRPOUCode},D.prototype.GetSubjDRFOCode=function(){return this.subjDRFOCode};var O=function(){this.setClassInfo("EndUserTimeInfo",2),this.fields={version:"number",isTimeAvail:"boolean",isTimeStamp:"boolean",time:"time",isSignTimeStampAvail:"boolean",signTimeStamp:"time"},this.initializeFields()};y.makeTransferable(O),O.prototype.GetVersion=function(){return this.version},O.prototype.IsTimeAvail=function(){return this.isTimeAvail},O.prototype.IsTimeStamp=function(){return this.isTimeStamp},O.prototype.GetTime=function(){return this.time},O.prototype.IsSignTimeStampAvail=function(){return this.isSignTimeStampAvail},O.prototype.GetSignTimeStamp=function(){return this.signTimeStamp};var G=function(){this.setClassInfo("EndUserSignInfo",1),this.fields={ownerInfo:"EndUserOwnerInfo",timeInfo:"EndUserTimeInfo",data:"byteArray"},this.initializeFields()};y.makeTransferable(G),G.prototype.GetOwnerInfo=function(){return this.ownerInfo},G.prototype.GetTimeInfo=function(){return this.timeInfo},G.prototype.GetData=function(){return this.data},G.prototype.GetDataString=function(t){return i.ArrayToString(t,this.data)};var N=function(){this.setClassInfo("EndUserSenderInfo",1),this.fields={ownerInfo:"EndUserOwnerInfo",timeInfo:"EndUserTimeInfo",data:"byteArray"},this.initializeFields()};y.makeTransferable(N),N.prototype.GetOwnerInfo=function(){return this.ownerInfo},N.prototype.GetTimeInfo=function(){return this.timeInfo},N.prototype.GetData=function(){return this.data},N.prototype.GetDataString=function(t){return i.ArrayToString(t,this.data)};var w=function(){this.setClassInfo("EndUserCertificateInfo",1),this.fields={isFilled:"boolean",version:"long",issuer:"string",issuerCN:"string",serial:"string",subject:"string",subjCN:"string",subjOrg:"string",subjOrgUnit:"string",subjTitle:"string",subjState:"string",subjLocality:"string",subjFullName:"string",subjAddress:"string",subjPhone:"string",subjEMail:"string",subjDNS:"string",subjEDRPOUCode:"string",subjDRFOCode:"string",subjNBUCode:"string",subjSPFMCode:"string",subjOCode:"string",subjOUCode:"string",subjUserCode:"string",certBeginTime:"time",certEndTime:"time",isPrivKeyTimesAvail:"boolean",privKeyBeginTime:"time",privKeyEndTime:"time",publicKeyBits:"long",publicKey:"string",publicKeyID:"string",isECDHPublicKeyAvail:"boolean",ECDHPublicKeyBits:"long",ECDHPublicKey:"string",ECDHPublicKeyID:"string",issuerPublicKeyID:"string",keyUsage:"string",extKeyUsages:"string",policies:"string",crlDistribPoint1:"string",crlDistribPoint2:"string",isPowerCert:"boolean",isSubjTypeAvail:"boolean",isSubjCA:"boolean"},this.initializeFields()};y.makeTransferable(w),w.prototype.IsFilled=function(){return this.isFilled},w.prototype.GetVersion=function(){return this.version},w.prototype.GetIssuer=function(){return this.issuer},w.prototype.GetIssuerCN=function(){return this.issuerCN},w.prototype.GetSerial=function(){return this.serial},w.prototype.GetSubject=function(){return this.subject},w.prototype.GetSubjCN=function(){return this.subjCN},w.prototype.GetSubjOrg=function(){return this.subjOrg},w.prototype.GetSubjOrgUnit=function(){return this.subjOrgUnit},w.prototype.GetSubjTitle=function(){return this.subjTitle},w.prototype.GetSubjState=function(){return this.subjState},w.prototype.GetSubjLocality=function(){return this.subjLocality},w.prototype.GetSubjFullName=function(){return this.subjFullName},w.prototype.GetSubjAddress=function(){return this.subjAddress},w.prototype.GetSubjPhone=function(){return this.subjPhone},w.prototype.GetSubjEMail=function(){return this.subjEMail},w.prototype.GetSubjDNS=function(){return this.subjDNS},w.prototype.GetSubjEDRPOUCode=function(){return this.subjEDRPOUCode},w.prototype.GetSubjDRFOCode=function(){return this.subjDRFOCode},w.prototype.GetSubjNBUCode=function(){return this.subjNBUCode},w.prototype.GetSubjSPFMCode=function(){return this.subjSPFMCode},w.prototype.GetSubjOCode=function(){return this.subjOCode},w.prototype.GetSubjOUCode=function(){return this.subjOUCode},w.prototype.GetSubjUserCode=function(){return this.subjUserCode},w.prototype.GetCertBeginTime=function(){return this.certBeginTime},w.prototype.GetCertEndTime=function(){return this.certEndTime},w.prototype.IsPrivKeyTimesAvail=function(){return this.isPrivKeyTimesAvail},w.prototype.GetPrivKeyBeginTime=function(){return this.privKeyBeginTime},w.prototype.GetPrivKeyEndTime=function(){return this.privKeyEndTime},w.prototype.GetPublicKeyBits=function(){return this.publicKeyBits},w.prototype.GetPublicKey=function(){return this.publicKey},w.prototype.GetPublicKeyID=function(){return this.publicKeyID},w.prototype.IsECDHPublicKeyAvail=function(){return this.isECDHPublicKeyAvail},w.prototype.GetECDHPublicKeyBits=function(){return this.ECDHPublicKeyBits},w.prototype.GetECDHPublicKey=function(){return this.ECDHPublicKey},w.prototype.GetECDHPublicKeyID=function(){return this.ECDHPublicKeyID},w.prototype.GetIssuerPublicKeyID=function(){return this.issuerPublicKeyID},w.prototype.GetKeyUsage=function(){return this.keyUsage},w.prototype.GetExtKeyUsages=function(){return this.extKeyUsages},w.prototype.GetPolicies=function(){return this.policies},w.prototype.GetCRLDistribPoint1=function(){return this.crlDistribPoint1},w.prototype.GetCRLDistribPoint2=function(){return this.crlDistribPoint2},w.prototype.IsPowerCert=function(){return this.isPowerCert},w.prototype.IsSubjTypeAvail=function(){return this.isSubjTypeAvail},w.prototype.IsSubjCA=function(){return this.isSubjCA};var M=function(){this.setClassInfo("EndUserCertificateInfoEx",8),this.fields={isFilled:"boolean",version:"long",issuer:"string",issuerCN:"string",serial:"string",subject:"string",subjCN:"string",subjOrg:"string",subjOrgUnit:"string",subjTitle:"string",subjState:"string",subjLocality:"string",subjFullName:"string",subjAddress:"string",subjPhone:"string",subjEMail:"string",subjDNS:"string",subjEDRPOUCode:"string",subjDRFOCode:"string",subjNBUCode:"string",subjSPFMCode:"string",subjOCode:"string",subjOUCode:"string",subjUserCode:"string",certBeginTime:"time",certEndTime:"time",isPrivKeyTimesAvail:"boolean",privKeyBeginTime:"time",privKeyEndTime:"time",publicKeyBits:"long",publicKey:"string",publicKeyID:"string",issuerPublicKeyID:"string",keyUsage:"string",extKeyUsages:"string",policies:"string",crlDistribPoint1:"string",crlDistribPoint2:"string",isPowerCert:"boolean",isSubjTypeAvail:"boolean",isSubjCA:"boolean",chainLength:"int",UPN:"string",publicKeyType:"long",keyUsageType:"long",RSAModul:"string",RSAExponent:"string",OCSPAccessInfo:"string",issuerAccessInfo:"string",TSPAccessInfo:"string",isLimitValueAvailable:"boolean",limitValue:"long",limitValueCurrency:"string",subjType:"long",subjSubType:"long",subjUNZR:"string",subjCountry:"string",fingerprint:"string",isQSCD:"boolean",subjUserID:"string",certHashType:"number"},this.initializeFields();var t=this;this.IsLimitValueAvailable=function(){return t.isLimitValueAvailable}};y.makeTransferable(M),M.prototype.IsFilled=function(){return this.isFilled},M.prototype.GetVersion=function(){return this.version},M.prototype.GetIssuer=function(){return this.issuer},M.prototype.GetIssuerCN=function(){return this.issuerCN},M.prototype.GetSerial=function(){return this.serial},M.prototype.GetSubject=function(){return this.subject},M.prototype.GetSubjCN=function(){return this.subjCN},M.prototype.GetSubjOrg=function(){return this.subjOrg},M.prototype.GetSubjOrgUnit=function(){return this.subjOrgUnit},M.prototype.GetSubjTitle=function(){return this.subjTitle},M.prototype.GetSubjState=function(){return this.subjState},M.prototype.GetSubjLocality=function(){return this.subjLocality},M.prototype.GetSubjFullName=function(){return this.subjFullName},M.prototype.GetSubjAddress=function(){return this.subjAddress},M.prototype.GetSubjPhone=function(){return this.subjPhone},M.prototype.GetSubjEMail=function(){return this.subjEMail},M.prototype.GetSubjDNS=function(){return this.subjDNS},M.prototype.GetSubjEDRPOUCode=function(){return this.subjEDRPOUCode},M.prototype.GetSubjDRFOCode=function(){return this.subjDRFOCode},M.prototype.GetSubjNBUCode=function(){return this.subjNBUCode},M.prototype.GetSubjSPFMCode=function(){return this.subjSPFMCode},M.prototype.GetSubjOCode=function(){return this.subjOCode},M.prototype.GetSubjOUCode=function(){return this.subjOUCode},M.prototype.GetSubjUserCode=function(){return this.subjUserCode},M.prototype.GetCertBeginTime=function(){return this.certBeginTime},M.prototype.GetCertEndTime=function(){return this.certEndTime},M.prototype.IsPrivKeyTimesAvail=function(){return this.isPrivKeyTimesAvail},M.prototype.GetPrivKeyBeginTime=function(){return this.privKeyBeginTime},M.prototype.GetPrivKeyEndTime=function(){return this.privKeyEndTime},M.prototype.GetPublicKeyBits=function(){return this.publicKeyBits},M.prototype.GetPublicKey=function(){return this.publicKey},M.prototype.GetPublicKeyID=function(){return this.publicKeyID},M.prototype.GetIssuerPublicKeyID=function(){return this.issuerPublicKeyID},M.prototype.GetKeyUsage=function(){return this.keyUsage},M.prototype.GetExtKeyUsages=function(){return this.extKeyUsages},M.prototype.GetPolicies=function(){return this.policies},M.prototype.GetCRLDistribPoint1=function(){return this.crlDistribPoint1},M.prototype.GetCRLDistribPoint2=function(){return this.crlDistribPoint2},M.prototype.IsPowerCert=function(){return this.isPowerCert},M.prototype.IsSubjTypeAvail=function(){return this.isSubjTypeAvail},M.prototype.IsSubjCA=function(){return this.isSubjCA},M.prototype.GetChainLength=function(){return this.chainLength},M.prototype.GetUPN=function(){return this.UPN},M.prototype.GetPublicKeyType=function(){return this.publicKeyType},M.prototype.GetKeyUsageType=function(){return this.keyUsageType},M.prototype.GetRSAModul=function(){return this.RSAModul},M.prototype.GetRSAExponent=function(){return this.RSAExponent},M.prototype.GetOCSPAccessInfo=function(){return this.OCSPAccessInfo},M.prototype.GetIssuerAccessInfo=function(){return this.issuerAccessInfo},M.prototype.GetTSPAccessInfo=function(){return this.TSPAccessInfo},M.prototype.IsLimitValueAvail=function(){return this.isLimitValueAvailable},M.prototype.GetLimitValue=function(){return this.limitValue},M.prototype.GetLimitValueCurrency=function(){return this.limitValueCurrency},M.prototype.GetSubjType=function(){return this.subjType},M.prototype.GetSubjSubType=function(){return this.subjSubType},M.prototype.GetSubjUNZR=function(){return this.subjUNZR},M.prototype.GetSubjCountry=function(){return this.subjCountry},M.prototype.GetFingerprint=function(){return this.fingerprint},M.prototype.IsQSCD=function(){return this.isQSCD},M.prototype.GetSubjUserID=function(){return this.subjUserID},M.prototype.GetCertHashType=function(){return this.certHashType};var L=function(){this.setClassInfo("EndUserCertificate",1),this.fields={infoEx:"EndUserCertificateInfoEx",data:"byteArray"},this.initializeFields()};y.makeTransferable(L),L.prototype.GetInfoEx=function(){return this.infoEx},L.prototype.SetInfoEx=function(t){this.infoEx=t},L.prototype.GetData=function(){return this.data},L.prototype.SetData=function(t){this.data=t};var K=function(){this.setClassInfo("EndUserCRLInfo",1,!0,!1),this.fields={isFilled:"boolean",issuer:"string",issuerCN:"string",crlNumber:"long",thisUpdate:"time",nextUpdate:"time"},this.initializeFields()};y.makeTransferable(K),K.prototype.IsFilled=function(){return this.isFilled},K.prototype.GetIssuer=function(){return this.issuer},K.prototype.GetIssuerCN=function(){return this.issuerCN},K.prototype.GetCRLNumber=function(){return this.crlNumber},K.prototype.GetThisUpdate=function(){return this.thisUpdate},K.prototype.GetNextUpdate=function(){return this.nextUpdate};var k=function(){this.setClassInfo("EndUserCRLDetailedInfo",1),this.fields={isFilled:"boolean",version:"long",issuer:"string",issuerCN:"string",issuerPublicKeyID:"string",crlNumber:"long",thisUpdate:"time",nextUpdate:"time",revokedItemsCount:"long"},this.initializeFields()};y.makeTransferable(k),k.prototype.IsFilled=function(){return this.isFilled},k.prototype.GetVersion=function(){return this.version},k.prototype.GetIssuer=function(){return this.issuer},k.prototype.GetIssuerCN=function(){return this.issuerCN},k.prototype.GetIssuerPublicKeyID=function(){return this.issuerPublicKeyID},k.prototype.GetCRLNumber=function(){return this.crlNumber},k.prototype.GetThisUpdate=function(){return this.thisUpdate},k.prototype.GetNextUpdate=function(){return this.nextUpdate},k.prototype.GetRevokedItemsCount=function(){return this.revokedItemsCount};var x=function(){this.setClassInfo("EndUserPrivateKeyInfo",1),this.fields={privateKey:"byteArray",privateKeyInfo:"byteArray"},this.initializeFields()};y.makeTransferable(x),x.prototype.GetPrivateKey=function(){return this.privateKey},x.prototype.SetPrivateKey=function(t){this.privateKey=t},x.prototype.GetPrivateKeyInfo=function(){return this.privateKeyInfo},x.prototype.SetPrivateKeyInfo=function(t){this.privateKeyInfo=t};var B=function(){this.setClassInfo("EndUserJKSPrivateKey",1),this.fields={privateKey:"byteArray",certificates:"array"},this.initializeFields()};y.makeTransferable(B),B.prototype.GetPrivateKey=function(){return this.privateKey},B.prototype.GetCertificate=function(t){return t<0||t>=this.certificates.length?null:this.certificates[t]},B.prototype.GetCertificatesCount=function(){return this.certificates.length},B.prototype.GetCertificates=function(){return this.certificates};var F=function(){this.setClassInfo("EndUserRequestInfo",4),this.fields={request:"byteArray",requestType:"number",defaultRequestFileName:"string",isSimple:"boolean",subject:"string",subjCN:"string",subjOrg:"string",subjOrgUnit:"string",subjTitle:"string",subjState:"string",subjLocality:"string",subjFullName:"string",subjAddress:"string",subjPhone:"string",subjEMail:"string",subjDNS:"string",subjEDRPOUCode:"string",subjDRFOCode:"string",subjNBUCode:"string",subjSPFMCode:"string",subjOCode:"string",subjOUCode:" string",subjUserCode:"string",certBeginTime:"time",certEndTime:"time",isPrivKeyTimesAvail:"boolean",privKeyBeginTime:"time",privKeyEndTime:"time",publicKeyType:"number",publicKeyBits:"number",RSAModul:"string",RSAExponent:"string",publicKey:"string",publicKeyID:"string",extKeyUsages:"string",crlDistribPoint1:"string",crlDistribPoint2:"string",isSubjTypeAvail:"boolean",subjType:"number",subjSubType:"number",isSelfSigned:"boolean",signIssuer:"string",signSerial:"string",subjUNZR:"string",subjCountry:"string",isQSCD:"boolean"},this.initializeFields()};y.makeTransferable(F),F.prototype.GetRequest=function(){return this.request},F.prototype.GetRequestType=function(){return this.requestType},F.prototype.GetDefaultRequestFileName=function(){return this.defaultRequestFileName},F.prototype.IsSimple=function(){return this.isSimple},F.prototype.GetSubject=function(){return this.subject},F.prototype.GetSubjCN=function(){return this.subjCN},F.prototype.GetSubjOrg=function(){return this.subjOrg},F.prototype.GetSubjOrgUnit=function(){return this.subjOrgUnit},F.prototype.GetSubjTitle=function(){return this.subjTitle},F.prototype.GetSubjState=function(){return this.subjState},F.prototype.GetSubjLocality=function(){return this.subjLocality},F.prototype.GetSubjFullName=function(){return this.subjFullName},F.prototype.GetSubjAddress=function(){return this.subjAddress},F.prototype.GetSubjPhone=function(){return this.subjPhone},F.prototype.GetSubjEMail=function(){return this.subjEMail},F.prototype.GetSubjDNS=function(){return this.subjDNS},F.prototype.GetSubjEDRPOUCode=function(){return this.subjEDRPOUCode},F.prototype.GetSubjDRFOCode=function(){return this.subjDRFOCode},F.prototype.GetSubjNBUCode=function(){return this.subjNBUCode},F.prototype.GetSubjSPFMCode=function(){return this.subjSPFMCode},F.prototype.GetSubjOCode=function(){return this.subjOCode},F.prototype.GetSubjOUCode=function(){return this.subjOUCode},F.prototype.GetSubjUserCode=function(){return this.subjUserCode},F.prototype.GetCertBeginTime=function(){return this.certBeginTime},F.prototype.GetCertEndTime=function(){return this.certEndTime},F.prototype.IsPrivKeyTimesAvail=function(){return this.isPrivKeyTimesAvail},F.prototype.GetPrivKeyBeginTime=function(){return this.privKeyBeginTime},F.prototype.GetPrivKeyEndTime=function(){return this.privKeyEndTime},F.prototype.GetPublicKeyType=function(){return this.publicKeyType},F.prototype.GetPublicKeyBits=function(){return this.publicKeyBits},F.prototype.GetRSAModul=function(){return this.RSAModul},F.prototype.GetRSAExponent=function(){return this.RSAExponent},F.prototype.GetPublicKey=function(){return this.publicKey},F.prototype.GetPublicKeyID=function(){return this.publicKeyID},F.prototype.GetExtKeyUsages=function(){return this.extKeyUsages},F.prototype.GetCRLDistribPoint1=function(){return this.crlDistribPoint1},F.prototype.GetCRLDistribPoint2=function(){return this.crlDistribPoint2},F.prototype.IsSubjTypeAvail=function(){return this.isSubjTypeAvail},F.prototype.GetSubjType=function(){return this.subjType},F.prototype.GetSubjSubType=function(){return this.subjSubType},F.prototype.IsSelfSigned=function(){return this.isSelfSigned},F.prototype.GetSignIssuer=function(){return this.signIssuer},F.prototype.GetSignSerial=function(){return this.signSerial},F.prototype.GetSubjUNZR=function(){return this.subjUNZR},F.prototype.GetSubjCountry=function(){return this.subjCountry},F.prototype.IsQSCD=function(){return this.isQSCD};var H=function(){this.setClassInfo("EndUserInfo",3),this.fields={commonName:"string",locality:"string",state:"string",organization:"string",orgUnit:"string",title:"string",street:"string",phone:"string",surname:"string",givenname:"string",EMail:"string",DNS:"string",EDRPOUCode:"string",DRFOCode:"string",NBUCode:"string",SPFMCode:"string",OCode:"string",OUCode:"string",userCode:"string",UPN:"string",UNZR:"string",country:"string"},this.initializeFields()};y.makeTransferable(H),H.prototype.GetCommonName=function(){return this.commonName},H.prototype.SetCommonName=function(t){this.commonName=t},H.prototype.GetLocality=function(){return this.locality},H.prototype.SetLocality=function(t){this.locality=t},H.prototype.GetState=function(){return this.state},H.prototype.SetState=function(t){this.state=t},H.prototype.GetOrganization=function(){return this.organization},H.prototype.SetOrganization=function(t){this.organization=t},H.prototype.GetOrgUnit=function(){return this.orgUnit},H.prototype.SetOrgUnit=function(t){this.orgUnit=t},H.prototype.GetTitle=function(){return this.title},H.prototype.SetTitle=function(t){this.title=t},H.prototype.GetStreet=function(){return this.street},H.prototype.SetStreet=function(t){this.street=t},H.prototype.GetPhone=function(){return this.phone},H.prototype.SetPhone=function(t){this.phone=t},H.prototype.GetSurname=function(){return this.surname},H.prototype.SetSurname=function(t){this.surname=t},H.prototype.GetGivenname=function(){return this.givenname},H.prototype.SetGivenname=function(t){this.givenname=t},H.prototype.GetEMail=function(){return this.EMail},H.prototype.SetEMail=function(t){this.EMail=t},H.prototype.GetDNS=function(){return this.DNS},H.prototype.SetDNS=function(t){this.DNS=t},H.prototype.GetEDRPOUCode=function(){return this.EDRPOUCode},H.prototype.SetEDRPOUCode=function(t){this.EDRPOUCode=t},H.prototype.GetDRFOCode=function(){return this.DRFOCode},H.prototype.SetDRFOCode=function(t){this.DRFOCode=t},H.prototype.GetNBUCode=function(){return this.NBUCode},H.prototype.SetNBUCode=function(t){this.NBUCode=t},H.prototype.GetSPFMCode=function(){return this.SPFMCode},H.prototype.SetSPFMCode=function(t){this.SPFMCode=t},H.prototype.GetOCode=function(){return this.OCode},H.prototype.SetOCode=function(t){this.OCode=t},H.prototype.GetOUCode=function(){return this.OUCode},H.prototype.SetOUCode=function(t){this.OUCode=t},H.prototype.GetUserCode=function(){return this.userCode},H.prototype.SetUserCode=function(t){this.userCode=t},H.prototype.GetUPN=function(){return this.UPN},H.prototype.SetUPN=function(t){this.UPN=t},H.prototype.GetUNZR=function(){return this.UNZR},H.prototype.SetUNZR=function(t){this.UNZR=t},H.prototype.GetCountry=function(){return this.country},H.prototype.SetCountry=function(t){this.country=t};var Y=function(){this.setClassInfo("EndUserParams",1),this.fields={SN:"number",commonName:"string",locality:"string",state:"string",organization:"string",orgUnit:"string",title:"string",street:"string",phone:"string",surname:"string",givenname:"string",EMail:"string",DNS:"string",EDRPOUCode:"string",DRFOCode:"string",NBUCode:"string",SPFMCode:"string",information:"string",passPhrase:"string",isPublishCertificate:"boolean",RAAdminSN:"number"},this.initializeFields()};y.makeTransferable(Y),Y.prototype.GetSN=function(){return this.SN},Y.prototype.SetSN=function(t){this.SN=t},Y.prototype.GetCommonName=function(){return this.commonName},Y.prototype.SetCommonName=function(t){this.commonName=t},Y.prototype.GetLocality=function(){return this.locality},Y.prototype.SetLocality=function(t){this.locality=t},Y.prototype.GetState=function(){return this.state},Y.prototype.SetState=function(t){this.state=t},Y.prototype.GetOrganization=function(){return this.organization},Y.prototype.SetOrganization=function(t){this.organization=t},Y.prototype.GetOrgUnit=function(){return this.orgUnit},Y.prototype.SetOrgUnit=function(t){this.orgUnit=t},Y.prototype.GetTitle=function(){return this.title},Y.prototype.SetTitle=function(t){this.title=t},Y.prototype.GetStreet=function(){return this.street},Y.prototype.SetStreet=function(t){this.street=t},Y.prototype.GetPhone=function(){return this.phone},Y.prototype.SetPhone=function(t){this.phone=t},Y.prototype.GetSurname=function(){return this.surname},Y.prototype.SetSurname=function(t){this.surname=t},Y.prototype.GetGivenname=function(){return this.givenname},Y.prototype.SetGivenname=function(t){this.givenname=t},Y.prototype.GetEMail=function(){return this.EMail},Y.prototype.SetEMail=function(t){this.EMail=t},Y.prototype.GetDNS=function(){return this.DNS},Y.prototype.SetDNS=function(t){this.DNS=t},Y.prototype.GetEDRPOUCode=function(){return this.EDRPOUCode},Y.prototype.SetEDRPOUCode=function(t){this.EDRPOUCode=t},Y.prototype.GetDRFOCode=function(){return this.DRFOCode},Y.prototype.SetDRFOCode=function(t){this.DRFOCode=t},Y.prototype.GetNBUCode=function(){return this.NBUCode},Y.prototype.SetNBUCode=function(t){this.NBUCode=t},Y.prototype.GetSPFMCode=function(){return this.SPFMCode},Y.prototype.SetSPFMCode=function(t){this.SPFMCode=t},Y.prototype.GetInformation=function(){return this.information},Y.prototype.SetInformation=function(t){this.information=t},Y.prototype.GetPassPhrase=function(){return this.passPhrase},Y.prototype.SetPassPhrase=function(t){this.passPhrase=t},Y.prototype.GetIsPublishCertificate=function(){return this.isPublishCertificate},Y.prototype.SetIsPublishCertificate=function(t){this.isPublishCertificate=t},Y.prototype.GetRAAdminSN=function(){return this.RAAdminSN},Y.prototype.SetRAAdminSN=function(t){this.RAAdminSN=t};var j=function(){this.setClassInfo("EndUserOperationContext",1),this.fields={handle:"string"},this.initializeFields(),this.handle=null};y.makeTransferable(j),j.prototype.GetHandle=function(){return this.handle};var V=function(){this.setClassInfo("EndUserSession",1),this.fields={handle:"string",data:"byteArray"},this.initializeFields()};y.makeTransferable(V),V.prototype.GetHandle=function(){return this.handle},V.prototype.GetData=function(){return this.data},V.prototype.SetData=function(t){this.data=t};var W=function(){this.setClassInfo("EndUserSCClientStatistic",1),this.fields={activeSessions:"number",gatedSessions:"number",unprotectedData:"number",protectedData:"number"},this.initializeFields()};y.makeTransferable(W),W.prototype.GetActiveSessions=function(){return this.activeSessions},W.prototype.GetGatedSessions=function(){return this.gatedSessions},W.prototype.GetUnprotectedData=function(){return this.unprotectedData},W.prototype.GetProtectedData=function(){return this.protectedData};var X=function(){this.setClassInfo("EndUserDeviceContext",1),this.fields={handle:"string"},this.initializeFields(),this.handle=null};y.makeTransferable(X),X.prototype.GetHandle=function(){return this.handle};var z=function(){this.setClassInfo("EndUserTransportHeader",1),this.fields={receiptNumber:"number",cryptoData:"byteArray"},this.initializeFields()};y.makeTransferable(z),z.prototype.GetReceiptNumber=function(){return this.receiptNumber},z.prototype.GetCryptoData=function(){return this.cryptoData};var J=function(){this.setClassInfo("EndUserCryptoHeader",1),this.fields={caType:"string",headerType:"number",headerSize:"number",cryptoData:"byteArray"},this.initializeFields()};y.makeTransferable(J),J.prototype.GetCAType=function(){return this.caType},J.prototype.GetHeaderType=function(){return this.headerType},J.prototype.GetHeaderSize=function(){return this.headerSize},J.prototype.GetCryptoData=function(){return this.cryptoData};var q=function(){this.setClassInfo("EndUserContext",1),this.fields={handle:"string"},this.initializeFields()};y.makeTransferable(q),q.prototype.GetHandle=function(){return this.handle};var Z=function(){this.setClassInfo("EndUserHashContext",1),this.fields={handle:"string"},this.initializeFields()};y.makeTransferable(Z),Z.prototype.GetHandle=function(){return this.handle};var Q=function(){this.setClassInfo("EndUserPrivateKeyContext",1),this.fields={handle:"string",ownerInfo:"EndUserOwnerInfo"},this.initializeFields()};y.makeTransferable(Q),Q.prototype.GetHandle=function(){return this.handle},Q.prototype.GetOwnerInfo=function(){return this.ownerInfo};var $=function(t,e){this.setClassInfo("EndUserReference",1),this.fields={name:"string",data:"byteArray"},this.initializeFields(),this.name=t,this.data=e};y.makeTransferable($),$.prototype.GetName=function(){return this.name},$.prototype.SetName=function(t){this.name=t},$.prototype.GetData=function(){return this.data},$.prototype.SetData=function(t){this.data=t};var tt=function(t,e,n,r,i){this.setClassInfo("EndUserSSSignHashResult",1),this.fields={error:"number",hash:"string",signature:"string",statusCode:"number",status:"string"},this.initializeFields(),this.error=t,this.hash=e,this.signature=n,this.statusCode=r,this.status=i};y.makeTransferable(tt),tt.prototype.GetError=function(){return this.error},tt.prototype.GetHash=function(){return this.hash},tt.prototype.GetSignature=function(){return this.signature},tt.prototype.GetStatusCode=function(){return this.statusCode},tt.prototype.GetStatus=function(){return this.status};var et=function(t,e){this.errorCode=t,this.message=e,this.toString=function(){return this.message+" ("+this.errorCode+")"},this.GetErrorCode=function(){return this.errorCode},this.GetMessage=function(){return this.message}};function nt(t,e){this.errorCode=t,this.message=e,this.toString=function(){return this.message+" ("+this.errorCode+")"},this.GetErrorCode=function(){return this.errorCode},this.GetMessage=function(){return this.message}}et.ERROR_NONE=0,et.ERROR_UNKNOWN=65535,et.ERROR_NOT_SUPPORTED=65534,et.ERROR_NOT_INITIALIZED=1,et.ERROR_BAD_PARAMETER=2,et.ERROR_LIBRARY_LOAD=3,et.ERROR_READ_SETTINGS=4,et.ERROR_TRANSMIT_REQUEST=5,et.ERROR_MEMORY_ALLOCATION=6,et.WARNING_END_OF_ENUM=7,et.ERROR_PROXY_NOT_AUTHORIZED=8,et.ERROR_NO_GUI_DIALOGS=9,et.ERROR_DOWNLOAD_FILE=10,et.ERROR_WRITE_SETTINGS=11,et.ERROR_CANCELED_BY_GUI=12,et.ERROR_OFFLINE_MODE=13,et.ERROR_KEY_MEDIAS_FAILED=17,et.ERROR_KEY_MEDIAS_ACCESS_FAILED=18,et.ERROR_KEY_MEDIAS_READ_FAILED=19,et.ERROR_KEY_MEDIAS_WRITE_FAILED=20,et.WARNING_KEY_MEDIAS_READ_ONLY=21,et.ERROR_KEY_MEDIAS_DELETE=22,et.ERROR_KEY_MEDIAS_CLEAR=23,et.ERROR_BAD_PRIVATE_KEY=24,et.ERROR_PKI_FORMATS_FAILED=33,et.ERROR_CSP_FAILED=34,et.ERROR_BAD_SIGNATURE=35,et.ERROR_AUTH_FAILED=36,et.ERROR_NOT_RECEIVER=37,et.ERROR_STORAGE_FAILED=49,et.ERROR_BAD_CERT=50,et.ERROR_CERT_NOT_FOUND=51,et.ERROR_INVALID_CERT_TIME=52,et.ERROR_CERT_IN_CRL=53,et.ERROR_BAD_CRL=54,et.ERROR_NO_VALID_CRLS=55,et.ERROR_GET_TIME_STAMP=65,et.ERROR_BAD_TSP_RESPONSE=66,et.ERROR_TSP_SERVER_CERT_NOT_FOUND=67,et.ERROR_TSP_SERVER_CERT_INVALID=68,et.ERROR_GET_OCSP_STATUS=81,et.ERROR_BAD_OCSP_RESPONSE=82,et.ERROR_CERT_BAD_BY_OCSP=83,et.ERROR_OCSP_SERVER_CERT_NOT_FOUND=84,et.ERROR_OCSP_SERVER_CERT_INVALID=85,et.ERROR_LDAP_ERROR=97,et.ERROR_LIBRARY_COMUNICATION_FAILED=4097,et.ERROR_LIBRARY_VERSION_NOT_SUPPORTED=4098,et.ERROR_BROWSER_NOT_SUPPORTED=65537,et.ERROR_OPEN_FILE=65552,et.ERROR_READ_FILE=65553,et.ERROR_WRITE_FILE=65554,et.ERROR_DESCRIPTIONS_EX=[],et.ERROR_DESCRIPTIONS_EX[et.ERROR_NONE]=["Виконано успішно","Выполнено успешно","Executed successfully"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_NOT_SUPPORTED]=["Операція не підтримується","Операция не поддерживается","Operation is not supported"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_UNKNOWN]=["Невідома помилка","Неизвестная ошибка","Unknown error"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_LIBRARY_LOAD]=["Виникла помилка при завантаженні криптографічної бібліотеки","Возникла ошибка при загрузке криптографической библиотеки","Error at load crypto library"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_NOT_INITIALIZED]=["Бібліотека не ініціалізована","Библиотека не инициализирована","Library is not initialized"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_BAD_PARAMETER]=["Невірний параметр","Неверный параметр","Incorrect parameter"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_BAD_CERT]=["Сертифікат пошкоджений або не може бути використаний","Сертификат поврежден или не может быть использован","Certificate corrupted or cannot be used"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_CERT_NOT_FOUND]=["Сертифікат не знайдено","Сертификат не найден","Certificate not found"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_TRANSMIT_REQUEST]=["Виникла помилка при передачі запиту на сервер ЦСК за протоколом HTTP","Возникла ошибка при передаче запроса на сервер ЦСК по протоколу HTTP","Error at request transfer to CA's server by HTTP protocol"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_DOWNLOAD_FILE]=["Виникла помилка при завантаженні файлу з HTTP-сервера","Возникла ошибка при загрузке файла с HTTP-сервера","Error at the load of file from a HTTP-server"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_LIBRARY_COMUNICATION_FAILED]=["Виникла помилка при взаємодії з криптографічною бібліотекою","Возникла ошибка при взаимодействии с криптографической библиотекой","Error at comunication with crypto library"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_LIBRARY_VERSION_NOT_SUPPORTED]=["Встановлена версія бібліотеки не підтримується","Установленная версия библиотеки не поддерживается","The installed version of the library is not supported"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_BROWSER_NOT_SUPPORTED]=["Ваш браузер не підтримується","Ваш браузер не поддерживается","Your browser is not supported"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_OPEN_FILE]=["Виникла помилка при відкритті файлу","Возникла ошибка при открытии файла","Error at open file"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_READ_FILE]=["Виникла помилка при зчитуванні файлу","Возникла ошибка при чтении файла","Error at read file"],et.ERROR_DESCRIPTIONS_EX[et.ERROR_WRITE_FILE]=["Виникла помилка при записі файлу","Возникла ошибка при записи файла","Error at write file"],et.isError=function(t){return t!=et.ERROR_NONE},et.isSuccess=function(t){return t==et.ERROR_NONE},et.getErrorDescriptionEx=function(t,e){var n,r;return void 0===(n=et.ERROR_DESCRIPTIONS_EX[t])&&(n=et.ERROR_DESCRIPTIONS_EX[et.ERROR_UNKNOWN]),void 0===(r=n[e-1])?n[0]:r};var rt=function(t,n){this.vendor="JSC IIT",this.classVersion="1.3.93",this.className="EUSignCP",this.SUBJECT_TYPE_UNDIFFERENCED=0,this.SUBJECT_TYPE_CA=1,this.SUBJECT_TYPE_CA_SERVER=2,this.SUBJECT_TYPE_RA_ADMINISTRATOR=3,this.SUBJECT_TYPE_END_USER=4,this.EU_SUBJECT_TYPE_UNDIFFERENCED=this.SUBJECT_TYPE_UNDIFFERENCED,this.EU_SUBJECT_TYPE_CA=this.SUBJECT_TYPE_CA,this.EU_SUBJECT_TYPE_CA_SERVER=this.SUBJECT_TYPE_CA_SERVER,this.EU_SUBJECT_TYPE_RA_ADMINISTRATOR=this.SUBJECT_TYPE_RA_ADMINISTRATOR,this.EU_SUBJECT_TYPE_END_USER=this.SUBJECT_TYPE_END_USER,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED=0,this.SUBJECT_CA_SERVER_SUB_TYPE_CMP=1,this.SUBJECT_CA_SERVER_SUB_TYPE_TSP=2,this.SUBJECT_CA_SERVER_SUB_TYPE_OCSP=3,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED=this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_CMP=this.SUBJECT_CA_SERVER_SUB_TYPE_CMP,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_TSP=this.SUBJECT_CA_SERVER_SUB_TYPE_TSP,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_OCSP=this.SUBJECT_CA_SERVER_SUB_TYPE_OCSP,this.CERT_KEY_TYPE_UNKNOWN=0,this.CERT_KEY_TYPE_DSTU4145=1,this.CERT_KEY_TYPE_RSA=2,this.CERT_KEY_TYPE_ECDSA=4,this.EU_CERT_KEY_TYPE_UNKNOWN=this.CERT_KEY_TYPE_UNKNOWN,this.EU_CERT_KEY_TYPE_DSTU4145=this.CERT_KEY_TYPE_DSTU4145,this.EU_CERT_KEY_TYPE_RSA=this.CERT_KEY_TYPE_RSA,this.EU_CERT_KEY_TYPE_ECDSA=this.CERT_KEY_TYPE_ECDSA,this.EU_CERT_HASH_TYPE_UNKNOWN=0,this.EU_CERT_HASH_TYPE_GOST34311=1,this.EU_CERT_HASH_TYPE_SHA1=2,this.EU_CERT_HASH_TYPE_SHA224=3,this.EU_CERT_HASH_TYPE_SHA256=4,this.EU_CERT_HASH_TYPE_SHA384=5,this.EU_CERT_HASH_TYPE_SHA512=6,this.EU_CERT_HASH_TYPE_DSTU7564_256=7,this.EU_CERT_HASH_TYPE_DSTU7564_384=8,this.EU_CERT_HASH_TYPE_DSTU7564_512=9,this.KEY_USAGE_UNKNOWN=0,this.KEY_USAGE_DIGITAL_SIGNATUR=1,this.KEY_KEY_USAGE_KEY_AGREEMENT=16,this.EU_KEY_USAGE_UNKNOWN=this.KEY_USAGE_UNKNOWN,this.EU_KEY_USAGE_DIGITAL_SIGNATURE=this.KEY_USAGE_DIGITAL_SIGNATUR,this.EU_KEY_USAGE_NON_REPUDATION=2,this.EU_KEY_USAGE_KEY_AGREEMENT=this.KEY_KEY_USAGE_KEY_AGREEMENT,this.EU_KEYS_REQUEST_TYPE_UA_DS=1,this.EU_KEYS_REQUEST_TYPE_UA_KEP=2,this.EU_KEYS_REQUEST_TYPE_INTERNATIONAL=3,this.EU_KEYS_TYPE_NONE=0,this.EU_KEYS_TYPE_DSTU_AND_ECDH_WITH_GOSTS=1,this.EU_KEYS_TYPE_RSA_WITH_SHA=2,this.EU_KEYS_TYPE_ECDSA_WITH_SHA=4,this.EU_KEYS_TYPE_DSTU_AND_ECDH_WITH_DSTU=8,this.EU_KEYS_LENGTH_DS_UA_191=1,this.EU_KEYS_LENGTH_DS_UA_257=2,this.EU_KEYS_LENGTH_DS_UA_307=3,this.EU_KEYS_LENGTH_DS_UA_FILE=4,this.EU_KEYS_LENGTH_DS_UA_CERT=5,this.EU_KEYS_LENGTH_KEP_UA_257=1,this.EU_KEYS_LENGTH_KEP_UA_431=2,this.EU_KEYS_LENGTH_KEP_UA_571=3,this.EU_KEYS_LENGTH_KEP_UA_FILE=4,this.EU_KEYS_LENGTH_KEP_UA_CERT=5,this.EU_KEYS_LENGTH_DS_RSA_1024=1,this.EU_KEYS_LENGTH_DS_RSA_2048=2,this.EU_KEYS_LENGTH_DS_RSA_3072=3,this.EU_KEYS_LENGTH_DS_RSA_4096=4,this.EU_KEYS_LENGTH_DS_RSA_FILE=5,this.EU_KEYS_LENGTH_DS_RSA_CERT=6,this.EU_KEYS_LENGTH_DS_ECDSA_192=1,this.EU_KEYS_LENGTH_DS_ECDSA_256=2,this.EU_KEYS_LENGTH_DS_ECDSA_384=3,this.EU_KEYS_LENGTH_DS_ECDSA_521=4,this.EU_KEYS_LENGTH_DS_ECDSA_FILE=5,this.EU_KEYS_LENGTH_DS_ECDSA_CERT=6,this.EU_RECIPIENT_APPEND_ISSUER_AND_SERIAL=1,this.EU_RECIPIENT_APPEND_KEY_ID=2,this.EU_RECIPIENT_APPEND_KEY_ID_USC_COMPAT=3,this.EU_SAVE_SETTINGS_PARAMETER="SaveSettings",this.EU_RESOLVE_OIDS_PARAMETER="ResolveOIDs",this.EU_MAKE_PKEY_PFX_CONTAINER_PARAMETER="MakePKeyPFXContainer",this.EU_SIGN_INCLUDE_CONTENT_TIME_STAMP_PARAMETER="SignIncludeContentTimeStamp",this.EU_SIGN_TYPE_PARAMETER="SignType",this.EU_SIGN_INCLUDE_CA_CERTIFICATES_PARAMETER="SignIncludeCACertificates",this.EU_FS_CALCULATE_FINGERPRINT="FSCalculateFingerprint",this.EU_FORCE_USE_TSP_FROM_SETTINGS_PARAMETER="ForceUseTSPFromSettings",this.EU_STRING_ENCODING_PARAMETER="StringEncoding",this.EU_CHECK_CERT_CHAIN_ON_SIGN_TIME_PARAMETER="CheckCertChainOnSignTime",this.EU_CONNECTIONS_TIMEOUT_PARAMETER="ConnectionsTimeout",this.EU_LOG_EVENTS_THRESHOLD_PARAMETER="LogEventsThreshold",this.EU_USE_SLOGIN_PRIVATE_KEY="UseSLoginPrivateKey",this.EU_SETTINGS_ID_NONE=0,this.EU_SETTINGS_ID_MANDATORY=31,this.EU_SETTINGS_ID_ALL=1023,this.EU_SETTINGS_ID_FSTORE=1,this.EU_SETTINGS_ID_PROXY=2,this.EU_SETTINGS_ID_TSP=4,this.EU_SETTINGS_ID_OCSP=8,this.EU_SETTINGS_ID_LDAP=16,this.EU_SETTINGS_ID_MODE=32,this.EU_SETTINGS_ID_CMP=64,this.EU_SETTINGS_ID_KM=128,this.EU_SETTINGS_ID_OCSP_ACCESS_INFO_MODE=256,this.EU_SETTINGS_ID_OCSP_ACCESS_INFO=512,this.EU_SETTINGS_ID_TSL=1024,this.EU_SETTINGS_ID_LOG=2048,this.EU_HEADER_CA_TYPE="UA1",this.EU_HEADER_PART_TYPE_SIGNED=1,this.EU_HEADER_PART_TYPE_ENCRYPTED=2,this.EU_HEADER_PART_TYPE_STAMPED=3,this.EU_HEADER_PART_TYPE_CERTCRYPT=4,this.EU_HEADER_MAX_CA_TYPE_SIZE=3,this.EU_SIGNED_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_SIGNED,this.EU_ENCRYPTED_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_ENCRYPTED,this.EU_TIMESTAMPED_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_STAMPED,this.EU_CERTCRYPT_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_CERTCRYPT,this.EU_DEFAULT_LANG=0,this.EU_UA_LANG=1,this.EU_RU_LANG=2,this.EU_EN_LANG=3,this.EU_CONTENT_ENC_ALGO_DEFAULT=0,this.EU_CONTENT_ENC_ALGO_GOST28147_CFB=2,this.EU_CONTENT_ENC_ALGO_TDES_CBC=4,this.EU_CONTENT_ENC_ALGO_AES_128_CBC=5,this.EU_CONTENT_ENC_ALGO_AES_192_CBC=6,this.EU_CONTENT_ENC_ALGO_AES_256_CBC=7,this.EU_CONTENT_ENC_ALGO_DSTU7624_256_OFB=8,this.EU_CONTENT_ENC_ALGO_DSTU7624_256_CFB=9,this.EU_DEV_CTX_MIN_PUBLIC_DATA_ID=16,this.EU_DEV_CTX_MAX_PRIVATE_DATA_ID=175,this.EU_UA_OID_EXT_KEY_USAGE_STAMP="1.2.804.2.1.1.1.3.9",this.EU_CCS_TYPE_REVOKE=1,this.EU_CCS_TYPE_HOLD=2,this.EU_REVOCATION_REASON_UNKNOWN=0,this.EU_REVOCATION_REASON_KEY_COMPROMISE=1,this.EU_REVOCATION_REASON_NEW_ISSURED=2,this.EU_SIGN_TYPE_UNKNOWN=0,this.EU_SIGN_TYPE_CADES_BES=1,this.EU_SIGN_TYPE_CADES_T=4,this.EU_SIGN_TYPE_CADES_C=8,this.EU_SIGN_TYPE_CADES_X_LONG=16,this.EU_SIGN_TYPE_CADES_X_LONG_TRUSTED=128,this.EU_CHECK_PRIVATE_KEY_CONTEXT_PARAMETER="CheckPrivateKey",this.EU_RESOLVE_OIDS_CONTEXT_PARAMETER="ResolveOIDs",this.EU_EXPORATABLE_CONTEXT_CONTEXT_PARAMETER="ExportableContext",this.EU_USE_SLOGIN_PRIVATE_KEY_CONTEXT_PARAMETER="UseSLoginPrivateKey",this.EU_RECIPIENT_APPEND_TYPE_BY_ISSUER_SERIAL=1,this.EU_RECIPIENT_APPEND_TYPE_BY_KEY_ID=2,this.EU_CTX_HASH_ALGO_UNKNOWN=0,this.EU_CTX_HASH_ALGO_GOST34311=1,this.EU_CTX_HASH_ALGO_SHA160=2,this.EU_CTX_HASH_ALGO_SHA224=3,this.EU_CTX_HASH_ALGO_SHA256=4,this.EU_CTX_HASH_ALGO_SHA384=5,this.EU_CTX_HASH_ALGO_SHA512=6,this.EU_CTX_HASH_ALGO_DSTU7564_256=7,this.EU_CTX_HASH_ALGO_DSTU7564_384=8,this.EU_CTX_HASH_ALGO_DSTU7564_512=9,this.EU_CTX_SIGN_UNKNOWN=0,this.EU_CTX_SIGN_DSTU4145_WITH_GOST34311=1,this.EU_CTX_SIGN_RSA_WITH_SHA=2,this.EU_CTX_SIGN_ECDSA_WITH_SHA=3,this.EU_CTX_SIGN_DSTU4145_WITH_DSTU7564=4,this.EU_FILE_PROCESS_CHUNK_SIZE=1048576,this.EU_ASIC_TYPE_UNKNOWN=0,this.EU_ASIC_TYPE_S=1,this.EU_ASIC_TYPE_E=2,this.EU_ASIC_SIGN_TYPE_UNKNOWN=0,this.EU_ASIC_SIGN_TYPE_CADES=1,this.EU_ASIC_SIGN_TYPE_XADES=2,this.EU_ASIC_SIGN_LEVEL_BES=1,this.EU_ASIC_SIGN_LEVEL_T=4,this.EU_ASIC_SIGN_LEVEL_C=8,this.EU_ASIC_SIGN_LEVEL_X_LONG=16,this.EU_ASIC_SIGN_LEVEL_X_LONG_TRUSTED=128,this.EU_XADES_SIGN_TYPE_UNKNOWN=0,this.EU_XADES_TYPE_DETACHED=1,this.EU_XADES_TYPE_ENVELOPING=2,this.EU_XADES_TYPE_ENVELOPED=3,this.EU_XADES_SIGN_LEVEL_BES=1,this.EU_XADES_SIGN_LEVEL_T=4,this.EU_XADES_SIGN_LEVEL_B_LT=16,this.EU_XADES_SIGN_LEVEL_B_LTA=32,this.EU_PADES_SIGN_LEVEL_B_B=1,this.EU_PADES_SIGN_LEVEL_B_T=4,this.EU_PADES_SIGN_LEVEL_B_LT=16,this.EU_PADES_SIGN_LEVEL_B_LTA=32,this.EU_CP_ACP_ENCODING=0,this.EU_CP_1251_ENCODING=1251,this.EU_UTF8_ENCODING=65001,this.m_language=this.EU_DEFAULT_LANG,this.m_lastErrorCode=et.ERROR_NONE,this.m_lastError="",this.m_charset="UTF-8",this.m_stringCoder=new e,this.m_base64Coder=new s,this.m_dateCoder=new o,this.m_browserInfo=new u;var r=1;switch(t){case"chrome-extension://jffafkigfgmjafhpkoibhfefeaebmccg/":r=2,this.m_browserInfo.GetName()==u.BROWSER_NAME_FIREFOX&&(t="eusw@iit.com.ua");break;case"clsid:B7E24C75-E343-4DA2-A8D3-C80970FB7D7B":r=4;break;case"application/x-eusign-cp":r=3}this.m_jsonRpcClient=new l(r,t,n,"https:"==window.location.protocol),this.m_monitorLibraryTimer=null};return rt.prototype._funcMakeParams=function(t){var e=[];null==t&&(t=[]);for(var n=function(t){if(E(t))return t.encode();if(Array.isArray(t)){for(var e=t.length,r=[],i=0;i<e;i++)r[i]=n(t[i]);return r}return t},r=t.length,i=0;i<r;i++)e[i]=n(t[i]);return e},rt.prototype._funcCall=function(t,e,n,r,i){var o;if(!this.IsAsync(n,r))return o=this.m_jsonRpcClient.execute(t,e,null),o=this._funcHandleResult(o),i?i(o):o;var s=null==i?n:function(t){i(t,n,r)},a=this;this.m_jsonRpcClient.execute(t,e,(function(t){a._funcHandleResult(t,s,r)}))},rt.prototype._funcHandleResult=function(t,e,n){var r,i,o=this.IsAsync(e,n);if(null==t){if(r=this.MakeError(et.ERROR_LIBRARY_COMUNICATION_FAILED,""),o)return void n(r);throw new nt(r.errorCode,r.message)}if(i=(r=t.error).code,et.isError(i)){if(i==et.WARNING_END_OF_ENUM)return o?void e(null):null;if(r=this.MakeError(i,r.message),o)return void n(r);throw new nt(r.errorCode,r.message)}try{t=this._funcDecodeResult(t.result)}catch(t){if(r=this.MakeError(et.ERROR_LIBRARY_COMUNICATION_FAILED,""),o)return void n(r);throw new nt(r.errorCode,r.message)}if(!o)return t;e(t)},rt.prototype._funcDecodeResult=function(t){if(null==t)return null;var e=function(t){if(Array.isArray(t)){for(var n=[],r=t.length,i=0;i<r;i++)n[i]=e(t[i]);return n}if("object"==typeof t){var o,s=t.className;return(o=new y[s]).decode(t)?"EndUserByteArray"==o.className?o.GetData():o:null}return t};return e(t)},rt.prototype._checkVersion=function(t){try{var e=this.classVersion;if(e==t)return!0;if(e=e.split("."),t=t.split("."),e.length!=t.length)return!1;for(var n=0;n<t.length;n++)if(parseInt(e[n])>parseInt(t[n]))return!1}catch(t){return!1}return!0},rt.prototype._stringToBytes=function(t,e){try{return this.m_stringCoder.encode(t)}catch(t){var n=this.MakeError(et.ERROR_BAD_PARAMETER,"");if(void 0!==e)return setTimeout((function(){e(n)}),1),null;throw new nt(n.errorCode,n.message)}},rt.prototype._bytesToString=function(t,e){try{return this.m_stringCoder.decode(t)}catch(t){var n=this.MakeError(et.ERROR_BAD_PARAMETER,"");if(void 0!==e)return setTimeout((function(){e(n)}),1),null;throw new nt(n.errorCode,n.message)}},rt.prototype._base64Encode=function(t,e){try{return this.m_base64Coder.encode(t)}catch(t){var n=this.MakeError(et.ERROR_BAD_PARAMETER,"");if(void 0!==e)return setTimeout((function(){e(n)}),1),null;throw new nt(n.errorCode,n.message)}},rt.prototype._base64Decode=function(t,e){try{return this.m_base64Coder.decode(t)}catch(t){var n=this.MakeError(et.ERROR_BAD_PARAMETER,"");if(void 0!==e)return setTimeout((function(){e(n)}),1),null;throw new nt(n.errorCode,n.message)}},rt.prototype._copyArrayData=function(t,e){try{if(t.length!=e.length)return!1;if(Array.isArray(e)||Array.isArray(t))for(var n=0;n<e.length;n++)t[n]=e[n];else t.set(e);return!0}catch(t){return!1}},rt.prototype._startMonitorLibraryStatus=function(){var t=this;try{t.m_monitorLibraryTimer=setInterval((function(){t.IsInitialized((function(e){e||t._stopMonitorLibraryStatus()}),(function(e){t._stopMonitorLibraryStatus()}))}),6e5)}catch(t){}},rt.prototype._stopMonitorLibraryStatus=function(){try{if(null==this.m_monitorLibraryTimer)return;clearInterval(this.m_monitorLibraryTimer),this.m_monitorLibraryTimer=null}catch(t){}},rt.prototype._getAndroidAppIntentURL=function(t,e){var n="intent://addurlandstart?url={URL_LOCATION}#Intent;scheme=saclient;package=ua.com.iit.signagentmanagement;S.browser_fallback_url={URL_INSTALL};end;";return n=(n=n.replace("{URL_LOCATION}",encodeURIComponent(location.origin))).replace("{URL_INSTALL}",encodeURIComponent(t+"/"+e))},rt.prototype.IsAsync=function(t,e){return void 0!==t&&void 0!==e},rt.prototype.MakeError=function(t,e){return""==e&&(e=et.getErrorDescriptionEx(t,this.m_language)),this.m_lastErrorCode=t,this.m_lastError=e,new et(t,e)},rt.prototype.RaiseError=function(t,e){var n;throw new nt((n=this.MakeError(t,e)).errorCode,n.message)},rt.prototype.GetInstallURL=function(t,e){var n=this,r=n.m_browserInfo.GetOSName(),i=n.m_browserInfo.GetArch(),o=[];e=e||"https://iit.com.ua/download/productfiles";var s,a=function(t){o.push(e+"/"+t)};switch(r){case u.OS_NAME_WINDOWS:a("EUSignWebInstall.exe");break;case u.OS_NAME_MAC:a("EUSignWebInstall.pkg");break;case u.OS_NAME_LINUX:i==u.BROWSER_ARCH_NAME_X86?(a("euswi.deb"),a("euswi.rpm"),a("euswi.tar")):(a("euswi.64.deb"),a("euswi.64.rpm"),a("euswi.64.tar"));break;case u.OS_NAME_ANDROID:s="EUSignWebInstall.apk",o.push(n._getAndroidAppIntentURL(e,s));break;default:return null}return t?o:o[0]},rt.prototype.GetUpdateURL=function(t,e){var n=this,r=n.m_browserInfo.GetOSName(),i=n.m_browserInfo.GetArch(),o=[];e=e||"https://iit.com.ua/download/productfiles";var s,a=function(t){o.push(e+"/"+t)};switch(r){case u.OS_NAME_WINDOWS:a("EUSignWebUpdate.exe");break;case u.OS_NAME_MAC:a("EUSignWebInstall.pkg");break;case u.OS_NAME_LINUX:i==u.BROWSER_ARCH_NAME_X86?(a("euswi.deb"),a("euswi.rpm"),a("euswi.tar")):(a("euswi.64.deb"),a("euswi.64.rpm"),a("euswi.64.tar"));break;case u.OS_NAME_ANDROID:s="EUSignWebInstall.apk",o.push(n._getAndroidAppIntentURL(e,s));break;default:return null}return t?o:o[0]},rt.prototype.GetHelpURL=function(t){switch(t=t||"https://iit.com.ua/download/productfiles",this.m_browserInfo.GetOSName()){case u.OS_NAME_WINDOWS:case u.OS_NAME_MAC:case u.OS_NAME_LINUX:return t+"/EUSignWebOManual.pdf";default:return null}},rt.prototype.GetWebExtensionInstallURL=function(){switch(this.m_browserInfo.GetName()){case u.BROWSER_NAME_CHROME:return t;case u.BROWSER_NAME_FIREFOX:return"https://eu.iit.com.ua/download/productfiles/eusw@iit.com.ua.xpi";case u.BROWSER_NAME_OPERA:return"https://chrome.google.com/webstore/detail/%D1%96%D1%96%D1%82-%D0%BA%D0%BE%D1%80%D0%B8%D1%81%D1%82%D1%83%D0%B2%D0%B0%D1%87-%D1%86%D1%81%D0%BA-1-%D0%B1%D1%96%D0%B1%D0%BB/jffafkigfgmjafhpkoibhfefeaebmccg?utm_source=chrome-app-launcher-info-dialog";default:return null}},rt.prototype.GetInstallPath=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetInstallPath",n,t,e,null)},rt.prototype.SelectFile=function(t,e,n,r){return this.SelectFileEx(t,e,null,null,null,null,n,r)},rt.prototype.SelectFileEx=function(t,e,n,r,i,o,s,a){var u;return u=this._funcMakeParams([t,e,n,r,i,o]),this._funcCall("SelectFile",u,s,a,null)},rt.prototype.SelectFolder=function(t,e){return this.SelectFolderEx(null,null,null,t,e)},rt.prototype.SelectFolderEx=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n]),this._funcCall("SelectFolder",o,r,i,null)},rt.prototype.CreateFolder=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("CreateFolder",r,e,n,null)},rt.prototype.ReadFile=function(t,e,n){var r=this.IsAsync(e,n),i=this,o=i.EU_FILE_PROCESS_CHUNK_SIZE;if(!r){for(var s,a=i.GetFileSize(t),u=Math.floor(a/o),c=a%o,l=new Uint8Array(a),f=0;f<u;f++)s=i.ReadFileWithOffset(t,f*o,o),l.set(s,f*o,s.length);return 0!=c&&(s=i.ReadFileWithOffset(t,u*o,c),l.set(s,u*o,s.length)),l}var _={buf:null,length:0,curLength:0},p=function(r){if(r.curLength!=r.length){var s=r.length-r.curLength;s>o&&(s=o),i.ReadFileWithOffset(t,r.curLength,s,(function(t){r.buf.set(t,r.curLength,t.length),r.curLength+=t.length,p(r)}),n)}else e(r.buf)};i.GetFileSize(t,(function(t){_.buf=new Uint8Array(t),_.length=t,p(_)}),n)},rt.prototype.WriteFile=function(t,e,n,r){var i=this.IsAsync(n,r),o=this,s=o.EU_FILE_PROCESS_CHUNK_SIZE;if(i){var a={buf:null,length:0,curLength:0},u=function(e,i){if(i||e.curLength!=e.length){var a=e.length-e.curLength;a>s&&(a=s),o.WriteFileWithOffset(t,e.curLength,o.Copy(e.buf,e.curLength,s),(function(){e.curLength+=a,u(e,!1)}),r)}else n()};a.buf=e,a.length=e.length,u(a,!0)}else{for(var c=e.length,l=Math.floor(c/s),f=c%s,_=0;_<l;_++)o.WriteFileWithOffset(t,_*s,o.Copy(e,_*s,s));0==f&&0!=e.length||o.WriteFileWithOffset(t,l*s,o.Copy(e,l*s,f))}},rt.prototype.GetFileSize=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("GetFileSize",r,e,n,null)},rt.prototype.ReadFileWithOffset=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n]),this._funcCall("ReadFileWithOffset",o,r,i,null)},rt.prototype.WriteFileWithOffset=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,new S(n)]),this._funcCall("WriteFileWithOffset",o,r,i,null)},rt.prototype.DeleteFile=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("DeleteFile",r,e,n,null)},rt.prototype.AppendFile=function(t,e,n,r){var i;i=this._funcMakeParams([t,e]),this._funcCall("AppendFile",i,n,r,null)},rt.prototype.CopyFileWithOffset=function(t,e,n,r,i,o){var s;s=this._funcMakeParams([t,e,n,r]),this._funcCall("CopyFileWithOffset",s,i,o,null)},rt.prototype.Load=function(t,e){var n=this.IsAsync(t,e),r=this;if(n)this.GetVersion((function(n){if(r._checkVersion(n))t();else{var i=r.MakeError(et.ERROR_LIBRARY_VERSION_NOT_SUPPORTED,"");e(i)}}),(function(t){t=r.MakeError(et.ERROR_LIBRARY_COMUNICATION_FAILED,""),e(t)}));else{var i;try{i=this._checkVersion(this.GetVersion())}catch(t){this.RaiseError(et.ERROR_LIBRARY_COMUNICATION_FAILED,"")}i||this.RaiseError(et.ERROR_LIBRARY_VERSION_NOT_SUPPORTED,"")}},rt.prototype.GetVersion=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetVersion",n,t,e,null)},rt.prototype.IsInitialized=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("IsInitialized",n,t,e,null)},rt.prototype.Initialize=function(t,e){var n,r=this,i=this.IsAsync(t,e);n=this._funcMakeParams(null),this._funcCall("Initialize",n,i?function(){r._startMonitorLibraryStatus(),t()}:t,e,null),i||r._startMonitorLibraryStatus()},rt.prototype.Finalize=function(t,e){var n;this._stopMonitorLibraryStatus(),n=this._funcMakeParams(null),this._funcCall("Finalize",n,t,e,null)},rt.prototype.ResetOperation=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("ResetOperation",n,t,e,null)},rt.prototype.SetUIMode=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetUIMode",r,e,n,null)},rt.prototype.SetLanguage=function(t,e,n){var r,i=this,o=this.IsAsync(e,n);r=this._funcMakeParams([t]),this._funcCall("SetLanguage",r,o?function(){i.m_language=t,e()}:e,n,null),o||(this.m_language=t)},rt.prototype.SetCharset=function(t,e,n){var r,o=this.IsAsync(e,n);if(null==(r=i.GetCoder(t))){var s=this.MakeError(et.ERROR_BAD_PARAMETER,"");if(o)return void setTimeout((function(){n(s)}),1);throw new nt(s.errorCode,s.message)}this.m_stringCoder=r,this.m_charset=t,o&&setTimeout((function(){e()}),1)},rt.prototype.SetRuntimeParameter=function(t,e,n,r){var i;"boolean"==typeof e&&(e=e?1:0),i=this._funcMakeParams([t,e]),this._funcCall("SetRuntimeParameter",i,n,r,null)},rt.prototype.GetStorageParameter=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetStorageParameter",i,n,r,null)},rt.prototype.SetStorageParameter=function(t,e,n,r,i){var o;o=this._funcMakeParams([t,e,n]),this._funcCall("SetStorageParameter",o,r,i,null)},rt.prototype.CreateArrayList=function(){return new p},rt.prototype.GetLastError=function(){return this.m_lastError},rt.prototype.GetLastErrorCode=function(){return this.m_lastErrorCode},rt.prototype.BASE64Encode=function(t,e,n){var r=this._base64Encode(t,n);if(!this.IsAsync(e,n))return r;setTimeout((function(){e(r)}),1)},rt.prototype.BASE64Decode=function(t,e,n){var r=this._base64Decode(t,n);if(!this.IsAsync(e,n))return r;setTimeout((function(){e(r)}),1)},rt.prototype.StringToBytes=function(t,e,n){var r=this._stringToBytes(t,n);if(!this.IsAsync(e,n))return r;setTimeout((function(){e(r)}),1)},rt.prototype.BytesToString=function(t,e,n){var r=this._bytesToString(t,n);if(!this.IsAsync(e,n))return r;setTimeout((function(){e(r)}),1)},rt.prototype.Concatenate=function(t,e){if(Array.isArray(t)&&Array.isArray(e))return t.concat(e);var n,r=t.length+e.length;if(Array.isArray(t)||Array.isArray(e)){var i,o;for(n=new Array(r),i=0;i<t.length;i++)n[i]=t[i];for(o=0;o<e.length;i++,o++)n[i]=e[o]}else(n=new h(r)).set(t),n.set(e,t.length);return n},rt.prototype.Copy=function(t,e,n){return t.slice(e,e+n)},rt.prototype.SetSettings=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("SetSettings",n,t,e,null)},rt.prototype.DoesNeedSetSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("DoesNeedSetSettings",n,t,e,null)},rt.prototype.InitializeMandatorySettings=function(t,e){var n=this;if(this.IsAsync(t,e))a((function(t){var r=n.CreateFileStoreSettings();n.SetFileStoreSettings(r,t,e)})).eu_wait((function(t){n.GetProxySettings((function(e){t()}),(function(r){n.GetSystemProxySettings((function(r){n.SetProxySettings(r,t,e)}),(function(r){var i=n.CreateProxySettings();n.SetProxySettings(i,t,e)}))}))})).eu_wait((function(t){var r=n.CreateTSPSettings();n.SetTSPSettings(r,t,e)})).eu_wait((function(t){var r=n.CreateLDAPSettings();n.SetLDAPSettings(r,t,e)})).eu_wait((function(){var r=n.CreateOCSPSettings();n.SetOCSPSettings(r,t,e)}));else{var r,i=n.CreateFileStoreSettings();n.SetFileStoreSettings(i);try{r=n.GetProxySettings()}catch(t){r=n.CreateProxySettings();try{r=n.GetSystemProxySettings()}catch(t){}n.SetProxySettings(r)}var o=n.CreateTSPSettings();n.SetTSPSettings(o);var s=n.CreateLDAPSettings();n.SetLDAPSettings(s);var u=n.CreateOCSPSettings();n.SetOCSPSettings(u)}},rt.prototype.CreateModeSettings=function(){return new P},rt.prototype.GetModeSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetModeSettings",n,t,e,null)},rt.prototype.SetModeSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetModeSettings",r,e,n,null)},rt.prototype.CreateKeyMediaSettings=function(){return new U},rt.prototype.GetKeyMediaSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetKeyMediaSettings",n,t,e,null)},rt.prototype.SetKeyMediaSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetKeyMediaSettings",r,e,n,null)},rt.prototype.CreateFileStoreSettings=function(){return new d},rt.prototype.GetFileStoreSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetFileStoreSettings",n,t,e,null)},rt.prototype.SetFileStoreSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetFileStoreSettings",r,e,n,null)},rt.prototype.CreateProxySettings=function(){return new A},rt.prototype.GetProxySettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetProxySettings",n,t,e,null)},rt.prototype.SetProxySettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetProxySettings",r,e,n,null)},rt.prototype.CreateOCSPSettings=function(){return new m},rt.prototype.GetOCSPSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetOCSPSettings",n,t,e,null)},rt.prototype.SetOCSPSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetOCSPSettings",r,e,n,null)},rt.prototype.CreateOCSPAccessInfoModeSettings=function(){return new v},rt.prototype.GetOCSPAccessInfoModeSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetOCSPAccessInfoModeSettings",n,t,e,null)},rt.prototype.SetOCSPAccessInfoModeSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetOCSPAccessInfoModeSettings",r,e,n,null)},rt.prototype.CreateOCSPAccessInfoSettings=function(){return new I},rt.prototype.EnumOCSPAccessInfoSettings=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("EnumOCSPAccessInfoSettings",r,e,n,null)},rt.prototype.GetOCSPAccessInfoSettings=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("GetOCSPAccessInfoSettings",r,e,n,null)},rt.prototype.SetOCSPAccessInfoSettings=function(t,e,n){var r,i=this,o=i.IsAsync(e,n);if(t=Array.isArray(t)?t:[t],o){var s=function(o){o>=t.length?e():(r=i._funcMakeParams([t[o]]),i._funcCall("SetOCSPAccessInfoSettings",r,(function(){s(o+1)}),n,null))};s(0)}else for(var a=0;a<t.length;a++)r=i._funcMakeParams([t[a]]),i._funcCall("SetOCSPAccessInfoSettings",r,e,n,null)},rt.prototype.DeleteOCSPAccessInfoSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("DeleteOCSPAccessInfoSettings",r,e,n,null)},rt.prototype.CreateTSPSettings=function(){return new R},rt.prototype.GetTSPSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetTSPSettings",n,t,e,null)},rt.prototype.SetTSPSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetTSPSettings",r,e,n,null)},rt.prototype.CreateLDAPSettings=function(){return new T},rt.prototype.GetLDAPSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetLDAPSettings",n,t,e,null)},rt.prototype.SetLDAPSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetLDAPSettings",r,e,n,null)},rt.prototype.CreateCMPSettings=function(){return new g},rt.prototype.GetCMPSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetCMPSettings",n,t,e,null)},rt.prototype.SetCMPSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetCMPSettings",r,e,n,null)},rt.prototype.GetSystemProxySettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetSystemProxySettings",n,t,e,null)},rt.prototype.SetOCSPResponseExpireTime=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetOCSPResponseExpireTime",r,e,n,null)},rt.prototype.CreateTSLSettings=function(){return new b},rt.prototype.GetTSLSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetTSLSettings",n,t,e,null)},rt.prototype.SetTSLSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetTSLSettings",r,e,n,null)},rt.prototype.RefreshFileStore=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("RefreshFileStore",r,e,n,null)},rt.prototype.ShowCertificates=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("ShowCertificates",n,t,e,null)},rt.prototype.SelectCertificateInfo=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("SelectCertificateInfo",n,t,e,null)},rt.prototype.GetCertificatesCount=function(t,e,n,r){var i;return"number"==typeof t&&"number"==typeof e||(n=t,r=e,t=this.SUBJECT_TYPE_UNDIFFERENCED,e=this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED),i=this._funcMakeParams([t,e]),this._funcCall("GetCertificatesCount",i,n,r,null)},rt.prototype.GetCACertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_CA,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,t,e)},rt.prototype.GetCAServerCertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,t,e)},rt.prototype.GetCMPServerCertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_CMP,t,e)},rt.prototype.GetOCSPServerCertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_OCSP,t,e)},rt.prototype.GetTSPServerCertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_TSP,t,e)},rt.prototype.GetRAAdministratorCertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_RA_ADMINISTRATOR,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,t,e)},rt.prototype.GetEndUserCertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_END_USER,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,t,e)},rt.prototype.EnumCertificates=function(t,e,n,r,i){var o;return"number"==typeof e&&"number"==typeof n||(r=e,i=n,n=t,t=this.SUBJECT_TYPE_UNDIFFERENCED,e=this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED),o=this._funcMakeParams([t,e,n]),this._funcCall("EnumCertificates",o,r,i,null)},rt.prototype.EnumCACertificates=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_CA,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,e,n)},rt.prototype.EnumCAServerCertificates=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,e,n)},rt.prototype.EnumCMPServerCertificatesCount=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_CMP,e,n)},rt.prototype.EnumOCSPServerCertificatesCount=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_OCSP,e,n)},rt.prototype.EnumTSPServerCertificatesCount=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_TSP,e,n)},rt.prototype.EnumRAAdministratorCertificatesCount=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_RA_ADMINISTRATOR,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,e,n)},rt.prototype.EnumEndUserCertificatesCount=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_END_USER,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,e,n)},rt.prototype.GetCertificateInfo=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificateInfo",i,n,r,null)},rt.prototype.GetCertificateInfoEx=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificateInfoEx",i,n,r,null)},rt.prototype.GetCertificate=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificate",i,n,r,null)},rt.prototype.CheckCertificateByIssuerAndSerial=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("CheckCertificateByIssuerAndSerial",i,n,r,null)},rt.prototype.CheckCertificate=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("CheckCertificate",r,e,n,null)},rt.prototype.ParseCertificate=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("ParseCertificate",r,e,n,null)},rt.prototype.ParseCertificateEx=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("ParseCertificateEx",r,e,n,null)},rt.prototype.SaveCertificate=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("SaveCertificate",r,e,n,null)},rt.prototype.SaveCertificates=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("SaveCertificates",r,e,n,null)},rt.prototype.SaveCertificatesEx=function(t,e,n,r){var i;return i=this._funcMakeParams([new S(t),e?new S(e):null]),this._funcCall("SaveCertificatesEx",i,n,r,null)},rt.prototype.GetCertificatesFromLDAPByEDRPOUCode=function(t,e,n,r,i,o,s){var a;return null!=r&&null!=i?("EndUserArrayList"==r.className&&(r=r.m_array),"EndUserArrayList"==i.className&&(i=i.m_array)):(r=null,i=null),a=this._funcMakeParams([t,e,n,r,i]),this._funcCall("GetCertificatesFromLDAPByEDRPOUCode",a,o,s,null)},rt.prototype.GetCertificateByEmail=function(t,e,n,r,i,o){var s;return"string"!=typeof r&&(r=this.m_dateCoder.encode(r)),s=this._funcMakeParams([t,e,n,r]),this._funcCall("GetCertificateByEmail",s,i,o,null)},rt.prototype.GetCertificateByNBUCode=function(t,e,n,r,i,o){var s;return"string"!=typeof r&&(r=this.m_dateCoder.encode(r)),s=this._funcMakeParams([t,e,n,r]),this._funcCall("GetCertificateByNBUCode",s,i,o,null)},rt.prototype.GetReceiversCertificates=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetReceiversCertificates",n,t,e,null)},rt.prototype.GetReceiversCertificatesInArrayList=function(t,e){var n,r=this;return n=this._funcMakeParams(null),this._funcCall("GetReceiversCertificates",n,t,e,(function(t,e,n){var i=r.IsAsync(e,n);try{for(var o=new p,s=0;s<t.length;s++)o.add(t[s]);if(!i)return o;e(o)}catch(t){var a=r.MakeError(et.ERROR_LIBRARY_COMUNICATION_FAILED,"");if(i)return void n(a);throw new nt(a.errorCode,a.message)}}))},rt.prototype.GetCertificates=function(t,e,n,r){var i,o=this;return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificates",i,n,r,(function(t,e,n){var r=o.IsAsync(e,n);try{for(var i=new p,s=0;s<t.length;s++)i.add(t[s]);if(!r)return i;e(i)}catch(t){var a=o.MakeError(et.ERROR_LIBRARY_COMUNICATION_FAILED,"");if(r)return void n(a);throw new nt(a.errorCode,a.message)}}))},rt.prototype.GetCertificateByFingerprint=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("GetCertificateByFingerprint",r,e,n,null)},rt.prototype.GetCertificatesByEDRPOUAndDRFOCode=function(t,e,n,r){var i,o=this;return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificatesByEDRPOUAndDRFOCode",i,n,r,(function(t,e,n){var r=o.IsAsync(e,n);try{for(var i=new p,s=0;s<t.length;s++)i.add(t[s]);if(!r)return i;e(i)}catch(t){var a=o.MakeError(et.ERROR_LIBRARY_COMUNICATION_FAILED,"");if(r)return void n(a);throw new nt(a.errorCode,a.message)}}))},rt.prototype.ShowCRLs=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("ShowCRLs",n,t,e,null)},rt.prototype.GetCRLsCount=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetCRLsCount",n,t,e,null)},rt.prototype.EnumCRLs=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("EnumCRLs",r,e,n,null)},rt.prototype.GetCRLDetailedInfo=function(t,e,n,r){var i;return i=this._funcMakeParams([t,parseInt(e)]),this._funcCall("GetCRLDetailedInfo",i,n,r,null)},rt.prototype.SaveCRL=function(t,e,n,r){var i;return i=this._funcMakeParams([t,new S(e)]),this._funcCall("SaveCRL",i,n,r,null)},rt.prototype.GetTSPByAccessInfo=function(t,e,n,r,i,o){var s;if("string"==typeof e||null!=(e=this._base64Encode(e,o)))return s=this._funcMakeParams([t,e,n,r]),this._funcCall("GetTSPByAccessInfo",s,i,o,null)},rt.prototype.CheckTSP=function(t,e,n,r,i){var o;"string"==typeof t&&null==(t=this._base64Decode(t,i))||null!=n&&"string"!=typeof n&&null==(n=this._base64Encode(n,i))||(o=this._funcMakeParams([new S(t),e,n]),this._funcCall("CheckTSP",o,r,i,null))},rt.prototype.GetOCSPResponseByAccessInfo=function(t,e,n,r,i){var o;return o=this._funcMakeParams([new S(t),e,n]),this._funcCall("GetOCSPResponseByAccessInfo",o,r,i,null)},rt.prototype.CheckOCSPResponse=function(t,e,n,r){var i;if("string"!=typeof t||null!=(t=this._base64Decode(t,r)))return null!=e&&"string"!=typeof e&&(e=this.m_dateCoder.encode(e)),i=this._funcMakeParams([new S(t),e]),this._funcCall("CheckOCSPResponse",i,n,r,null)},rt.prototype.CreateKeyMedia=function(){return new C},rt.prototype.GetPrivateKeyMedia=function(t,e,n){var r;return"string"!=typeof t&&(t=null),r=this._funcMakeParams([t]),this._funcCall("GetPrivateKeyMedia",r,e,n,null)},rt.prototype.EnumKeyMediaTypes=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("EnumKeyMediaTypes",r,e,n,null)},rt.prototype.EnumKeyMediaDevices=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("EnumKeyMediaDevices",i,n,r,null)},rt.prototype.GetKeyMediaTypes=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetKeyMediaTypes",n,t,e,null)},rt.prototype.GetKeyMediaDevices=function(t,e,n){var r;return"number"==typeof t&&(t=[t]),t&&(t=new S(t)),r=this._funcMakeParams([t]),this._funcCall("GetKeyMediaDevices",r,e,n,null)},rt.prototype.IsPrivateKeyReaded=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("IsPrivateKeyReaded",n,t,e,null)},rt.prototype.ReadPrivateKey=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("ReadPrivateKey",n,t,e,null)},rt.prototype.ReadPrivateKeySilently=function(t,e,n,r,i){var o,s;"number"==typeof t?((s=new C).typeIndex=t,s.devIndex=e,s.password=n):(s=t,r=e,i=n),o=this._funcMakeParams([s]),this._funcCall("ReadPrivateKeySilently",o,r,i,null)},rt.prototype.ReadPrivateKeyBinary=function(t,e,n,r){var i;i=this._funcMakeParams([new S(t),e]),this._funcCall("ReadPrivateKeyBinary",i,n,r,null)},rt.prototype.ReadPrivateKeyFile=function(t,e,n,r){var i;i=this._funcMakeParams([t,e]),this._funcCall("ReadPrivateKeyFile",i,n,r,null)},rt.prototype.CtxReadPrivateKey=function(t,e,n,r,i,o){var s,a;return"number"==typeof e?((a=new C).typeIndex=e,a.devIndex=n,a.password=r):(a=e,i=n,o=r),s=this._funcMakeParams([t,a]),this._funcCall("CtxReadPrivateKey",s,i,o,null)},rt.prototype.CtxReadPrivateKeyBinary=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,new S(e),n]),this._funcCall("CtxReadPrivateKeyBinary",o,r,i,null)},rt.prototype.ResetPrivateKey=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("ResetPrivateKey",n,t,e,null)},rt.prototype.CtxFreePrivateKey=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("CtxFreePrivateKey",r,e,n,null)},rt.prototype.ShowOwnCertificate=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("ShowOwnCertificate",n,t,e,null)},rt.prototype.GetOwnCertificate=function(t,e,n,r){var i;return"number"==typeof t&&"number"==typeof e||(n=t,r=e,t=null,e=null),i=this._funcMakeParams([t,e]),this._funcCall("GetOwnCertificate",i,n,r,null)},rt.prototype.EnumOwnCertificates=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("EnumOwnCertificates",r,e,n,null)},rt.prototype.GetPrivateKeyOwnerInfo=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetPrivateKeyOwnerInfo",n,t,e,null)},rt.prototype.CtxEnumOwnCertificates=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("CtxEnumOwnCertificates",i,n,r,null)},rt.prototype.CtxGetOwnCertificate=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n]),this._funcCall("CtxGetOwnCertificate",o,r,i,null)},rt.prototype.GetKeyInfo=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("GetKeyInfo",r,e,n,null)},rt.prototype.GetKeyInfoSilently=function(t,e,n,r,i){var o;return(o=new C).typeIndex=t,o.devIndex=e,o.password=n,this.GetKeyInfo(o,r,i)},rt.prototype.GetKeyInfoBinary=function(t,e,n,r){var i;return i=this._funcMakeParams([new S(t),e]),this._funcCall("GetKeyInfoBinary",i,n,r,null)},rt.prototype.GetKeyInfoFile=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetKeyInfoFile",i,n,r,null)},rt.prototype.GetCertificateByKeyInfo=function(t,e,n,r){var i,o=[];return"number"==typeof t&&"number"==typeof e||(r=n,n=e),"number"==typeof t&&"number"==typeof e?(o.push(t),o.push(e),o.push(null)):(o.push(null),o.push(null),o.push(new S(t))),i=this._funcMakeParams(o),this._funcCall("GetCertificateByKeyInfo",i,n,r,null)},rt.prototype.GetCertificatesByKeyInfo=function(t,e,n,r,i){var o;return"EndUserPrivateKeyInfo"==t.className&&(t=t.GetPrivateKeyInfo()),null!=e&&null!=n?("EndUserArrayList"==e.className&&(e=e.m_array),"EndUserArrayList"==n.className&&(n=n.m_array)):(e=null,n=null),o=this._funcMakeParams([new S(t),e,n]),this._funcCall("GetCertificatesByKeyInfo",o,r,i,null)},rt.prototype.ChangeSoftwarePrivateKeyPassword=function(t,e,n,r,i){var o;return o=this._funcMakeParams([new S(t),e,n]),this._funcCall("ChangeSoftwarePrivateKeyPassword",o,r,i,null)},rt.prototype.EnumJKSPrivateKeys=function(t,e,n,r){var i;return i=this._funcMakeParams([new S(t),e]),this._funcCall("EnumJKSPrivateKeys",i,n,r,null)},rt.prototype.EnumJKSPrivateKeysFile=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("EnumJKSPrivateKeysFile",i,n,r,null)},rt.prototype.GetJKSPrivateKey=function(t,e,n,r){var i;return i=this._funcMakeParams([new S(t),e]),this._funcCall("GetJKSPrivateKey",i,n,r,null)},rt.prototype.GetJKSPrivateKeyFile=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetJKSPrivateKeyFile",i,n,r,null)},rt.prototype.CreatePrivateKeyInfo=function(){return new x},rt.prototype.CreateEndUserInfo=function(){return new H},rt.prototype._generatePrivateKey=function(t,e,n,r,i,o,s,a,u,c,l,f,_,p,h,E){if(!this.IsAsync(h,E))return this.GeneratePrivateKeyEx(t,e,n,r,!1,i,o,s,a,u,c,l,f,null,null,_,p,h,E).m_array;this.GeneratePrivateKeyEx(t,e,n,r,!1,i,o,s,a,u,c,l,f,null,null,_,p,(function(t){h(t.m_array)}),E)},rt.prototype.GeneratePrivateKey=function(t,e,n,r,i,o,s,a,u,c,l,f,_,p,h,E){if("boolean"==typeof t)return this._generatePrivateKeyEx(t,e,n,r,i,o,s,a,u,c,l,f,_,p,h,E);if("boolean"==typeof n)return this._generatePrivateKey(!0,0,0,"",t,e,n,r,i,o,s,a,null,!1,u,c);if("string"==typeof n)return this._generatePrivateKey(!1,t,e,n,r,i,o,s,a,u,c,l,null,!1,f,_);if("number"==typeof n)return this._generatePrivateKey(!1,0,0,t,e,n,r,i,o,s,a,u,c,!0,l,f);var y=this.MakeError(et.ERROR_BAD_PARAMETER,"");throw new nt(y.errorCode,y.message)},rt.prototype._generatePrivateKeyEx=function(t,e,n,r,i,o,s,a,u,c,l,f,_,h,E,y,S,d,A){var R,m,T=this;return t?m=null:((m=new C).typeIndex=e,m.devIndex=n,m.password="string"!=typeof r?"":r),null==y&&(S=!1),R=this._funcMakeParams([t,m,i,o,s,a,u,c,l,f,_,h,E,null!=y,S]),this._funcCall("GeneratePrivateKeyEx",R,d,A,(function(t,e,n){var r=T.IsAsync(e,n);try{for(var i=t[0],o=new p,s=0;s<i.length;s++)o.add(i[s]);if(null!=y&&y.set(t[1]),!r)return o;e(o)}catch(t){var a=T.MakeError(et.ERROR_LIBRARY_COMUNICATION_FAILED,"");if(r)return void n(a);throw new nt(a.errorCode,a.message)}}))},rt.prototype.GeneratePrivateKeyEx=function(t,e,n,r,i,o,s,a,u,c,l,f,_,p,h,E,y,S,C){if("boolean"==typeof t)return"boolean"==typeof i?this._generatePrivateKeyEx(t,e,n,r,i,o,s,a,u,c,l,f,_,p,h,E,y,S,C):this._generatePrivateKeyEx(t,e,n,r,!1,i,o,s,a,u,c,l,f,null,null,_,p,h,E);if("boolean"==typeof n)return void 0!==c&&null==c||"string"==typeof c?this._generatePrivateKeyEx(!0,0,0,"",!1,t,e,n,r,i,o,s,a,u,c,null,!1,l,f):this._generatePrivateKeyEx(!0,0,0,"",!1,t,e,n,r,i,o,s,a,null,null,null,!1,u,c);if("number"==typeof t)return"boolean"==typeof r?this._generatePrivateKeyEx(!1,t,e,n,r,i,o,s,a,u,c,l,f,_,p,null,!1,h,E):this._generatePrivateKeyEx(!1,t,e,n,!1,r,i,o,s,a,u,c,l,null,null,null,!1,f,_);if("string"==typeof t)return void 0!==l&&null==l||"string"==typeof l?this._generatePrivateKeyEx(!1,0,0,t,!1,e,n,r,i,o,s,a,u,c,l,f,!0,_,p):this._generatePrivateKeyEx(!1,0,0,t,!1,e,n,r,i,o,s,a,u,null,null,c,!0,l,f);var d=this.MakeError(et.ERROR_BAD_PARAMETER,"");throw new nt(d.errorCode,d.message)},rt.prototype.GetCRInfo=function(t,e,n,r,i){var o;return o=this._funcMakeParams([new S(t),e,n]),this._funcCall("GetCRInfo",o,r,i,null)},rt.prototype.IsHardwareKeyMedia=function(t,e,n,r,i){var o,s;return"number"==typeof t?((s=new C).typeIndex=t,s.devIndex=e,s.password=n):(s=null,r=t,i=e),o=this._funcMakeParams([s]),this._funcCall("IsHardwareKeyMedia",o,r,i,null)},rt.prototype.IsPrivateKeyExists=function(t,e,n,r,i){var o,s;return"number"==typeof t?((s=new C).typeIndex=t,s.devIndex=e,s.password=n):(s=null,r=t,i=e),o=this._funcMakeParams([s]),this._funcCall("IsPrivateKeyExists",o,r,i,null)},rt.prototype.ChangePrivateKeyPassword=function(t,e,n,r,i,o){var s,a;"number"==typeof t?((a=new C).typeIndex=t,a.devIndex=e,a.password=n):(a=null,r=null,i=t,o=e),s=this._funcMakeParams([a,r]),this._funcCall("ChangePrivateKeyPassword",s,i,o,null)},rt.prototype.BackupPrivateKey=function(t,e,n,r,i,o,s,a){var u,c,l;"number"==typeof t?((c=new C).typeIndex=t,c.devIndex=e,c.password=n,(l=new C).typeIndex=r,l.devIndex=i,l.password=o):(c=null,l=null,s=t,a=e),u=this._funcMakeParams([c,l]),this._funcCall("BackupPrivateKey",u,s,a,null)},rt.prototype.DestroyPrivateKey=function(t,e,n,r,i){var o,s;"number"==typeof t?((s=new C).typeIndex=t,s.devIndex=e,s.password=n):(s=null,r=t,i=e),o=this._funcMakeParams([s]),this._funcCall("DestroyPrivateKey",o,r,i,null)},rt.prototype.SetKeyMediaPassword=function(t,e,n,r,i){var o,s;"number"==typeof t?((s=new C).typeIndex=t,s.devIndex=e,s.password=n):(s=null,r=t,i=e),o=this._funcMakeParams([s]),this._funcCall("SetKeyMediaPassword",o,r,i,null)},rt.prototype.SetKeyMediaUserPassword=function(t,e,n,r,i,o){var s,a;"number"==typeof e?((a=new C).typeIndex=e,a.devIndex=n,a.password=r):(a=null,i=e,o=n),s=this._funcMakeParams([t,a]),this._funcCall("SetKeyMediaUserPassword",s,i,o,null)},rt.prototype.ChangeOwnCertificatesStatus=function(t,e,n,r){var i;i=this._funcMakeParams([t,e]),this._funcCall("ChangeOwnCertificatesStatus",i,n,r,null)},rt.prototype.CtxChangeOwnCertificatesStatus=function(t,e,n,r,i){var o;o=this._funcMakeParams([t,e,n]),this._funcCall("CtxChangeOwnCertificatesStatus",o,r,i,null)},rt.prototype.MakeNewCertificate=function(t,e,n,r,i,o,s,a,u,c,l,f,_,p,h){var E;return null!=e&&(e=new S(e)),E=this._funcMakeParams([t,e,n,r,i,o,s,a,u,c,l,f,_]),this._funcCall("MakeNewCertificate",E,p,h,null)},rt.prototype.MakeNewOwnCertificate=function(t,e,n,r,i,o,s,a,u,c){var l;return l=this._funcMakeParams([t,e,n,r,i,o,s,a]),this._funcCall("MakeNewOwnCertificate",l,u,c,null)},rt.prototype.CtxMakeNewOwnCertificate=function(t,e,n,r,i,o,s,a,u,c,l){var f;return f=this._funcMakeParams([t,e,n,r,i,o,s,a,u]),this._funcCall("CtxMakeNewOwnCertificate",f,c,l,null)},rt.prototype.CtxMakeNewOwnCertificateWithCR=function(t,e,n,r,i,o,s){var a;return null!=e&&(e=new S(e)),null!=n&&(n=new S(n)),null!=r&&(r=new S(r)),null!=i&&(i=new S(i)),a=this._funcMakeParams([t,e,n,r,i]),this._funcCall("CtxMakeNewOwnCertificateWithCR",a,o,s,null)},rt.prototype.CtxMakeDeviceCertificate=function(t,e,n,r,i,o,s,a,u,c){var l;return null!=n&&(n=new S(n)),null!=r&&(r=new S(r)),null!=i&&(i=new S(i)),null!=o&&(o=new S(o)),l=this._funcMakeParams([t,e,n,r,i,o,s,a]),this._funcCall("CtxMakeDeviceCertificate",l,u,c,null)},rt.prototype.GetOwnEUserParams=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetOwnEUserParams",n,t,e,null)},rt.prototype.ModifyOwnEUserParams=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("ModifyOwnEUserParams",i,n,r,null)},rt.prototype.CtxGetOwnEUserParams=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("CtxGetOwnEUserParams",r,e,n,null)},rt.prototype.CtxModifyOwnEUserParams=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n]),this._funcCall("CtxModifyOwnEUserParams",o,r,i,null)},rt.prototype.Hash=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._stringToBytes(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("Hash",r,e,n,null)},rt.prototype.ContinueHash=function(t,e,n,r,i){var o;"number"==typeof e&&"number"==typeof n||(r=e,i=n),"string"==typeof t&&null==(t=this._stringToBytes(t,i))||("number"==typeof e&&"number"==typeof n&&(t=t.slice(e,e+n)),o=this._funcMakeParams([new S(t)]),this._funcCall("ContinueHash",o,r,i,null))},rt.prototype.EndHash=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("EndHash",n,t,e,null)},rt.prototype.HashWithParams=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._stringToBytes(e,r)))return i=this._funcMakeParams([new S(t),new S(e)]),this._funcCall("HashWithParams",i,n,r,null)},rt.prototype.HashBeginWithParams=function(t,e,n){var r;r=this._funcMakeParams([new S(t)]),this._funcCall("HashBeginWithParams",r,e,n,null)},rt.prototype.HashFile=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("HashFile",r,e,n,null)},rt.prototype.HashFileWithParams=function(t,e,n,r){var i;return i=this._funcMakeParams([new S(t),e]),this._funcCall("HashFileWithParams",i,n,r,null)},rt.prototype.CtxHash=function(t,e,n,r,i,o){var s=this,u=this.IsAsync(i,o),c=s.EU_FILE_PROCESS_CHUNK_SIZE;if("string"!=typeof r||null!=(r=this._stringToBytes(r,o)))if(u){var l={hashContext:null,hash:null},f=function(t){null==l.hashContext?o(t):s.CtxHashFree(l.hashContext,(function(){o(t)}),(function(){o(t)}))};a((function(r){s.CtxHashBegin(t,e,n,r,f)})).eu_wait((function(t,e){l.hashContext=e;var n=function(i){if(i>=r.length)s.CtxHashEnd(e,t,f);else{var o=r.length-i;o>c&&(o=c);var a=r.slice(i,i+o);s.CtxHashContinue(e,a,(function(){n(i+o)}),f)}};n(0)})).eu_wait((function(t,e){l.hash=e,s.CtxHashFree(l.hashContext,t,o)})).eu_wait((function(){i(l.hash)}))}else{var _=null;try{var p,h=0;for(_=s.CtxHashBegin(t,e,n);;){var E=r.length-h;E>c&&(E=c);var y=r.slice(h,h+E);if(s.CtxHashContinue(_,y),!((h+=E)<r.length))break}return p=s.CtxHashEnd(_),s.CtxHashFree(_),_=null,p}catch(t){throw null!=_&&s.CtxHashFree(_),t}}},rt.prototype.CtxHashBegin=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n?new S(n):null]),this._funcCall("CtxHashBegin",o,r,i,null)},rt.prototype.CtxHashContinue=function(t,e,n,r){var i;i=this._funcMakeParams([t,new S(e)]),this._funcCall("CtxHashContinue",i,n,r,null)},rt.prototype.CtxHashEnd=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("CtxHashEnd",r,e,n,null)},rt.prototype.CtxHashFree=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("CtxHashFree",r,e,n,null)},rt.prototype.ShowSignInfo=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("ShowSignInfo",r,e,n,null)},rt.prototype.IsSigned=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("IsSigned",r,e,n,null)},rt.prototype.IsSignedFile=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("IsSignedFile",r,e,n,null)},rt.prototype.GetSignType=function(t,e,n,r){var i;if("string"==typeof e||null!=(e=this._base64Encode(e,r)))return i=this._funcMakeParams([t,e]),this._funcCall("GetSignType",i,n,r,null)},rt.prototype.GetFileSignType=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetFileSignType",i,n,r,null)},rt.prototype.GetSignsCount=function(t,e,n){var r;if("string"==typeof t||null!=(t=this._base64Encode(t,n)))return r=this._funcMakeParams([t]),this._funcCall("GetSignsCount",r,e,n,null)},rt.prototype.GetSignerInfo=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetSignerInfo",i,n,r,null)},rt.prototype.GetSignerCertificate=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetSignerCertificate",i,n,r,null)},rt.prototype.GetFileSignsCount=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("GetFileSignsCount",r,e,n,null)},rt.prototype.GetFileSignerInfo=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetFileSignerInfo",i,n,r,null)},rt.prototype.GetFileSignerCertificate=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetFileSignerCertificate",i,n,r,null)},rt.prototype.CtxGetSignerInfo=function(t,e,n,r,i){var o;if("string"==typeof n||null!=(n=this._base64Encode(n,i)))return o=this._funcMakeParams([t,e,n]),this._funcCall("CtxGetSignerInfo",o,r,i,null)},rt.prototype.Sign=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._stringToBytes(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("Sign",r,e,n,null)},rt.prototype.Verify=function(t,e,n,r,i){var o,s=[];if("boolean"!=typeof n&&(i=r,r=n),"string"!=typeof e||null!=(e=this._stringToBytes(e,i)))return s.push(t),s.push(new S(e)),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("Verify",o,r,i,null)},rt.prototype.ContinueSign=function(t,e,n,r,i){var o;"number"==typeof e&&"number"==typeof n||(r=e,i=n),"string"==typeof t&&null==(t=this._stringToBytes(t,i))||("number"==typeof e&&"number"==typeof n&&(t=t.slice(e,e+n)),o=this._funcMakeParams([new S(t)]),this._funcCall("ContinueSign",o,r,i,null))},rt.prototype.EndSign=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("EndSign",n,t,e,null)},rt.prototype.BeginVerify=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("BeginVerify",r,e,n,null)},rt.prototype.ContinueVerify=function(t,e,n,r,i){var o;"number"==typeof e&&"number"==typeof n||(r=e,i=n),"string"==typeof t&&null==(t=this._stringToBytes(t,i))||("number"==typeof e&&"number"==typeof n&&(t=t.slice(e,e+n)),o=this._funcMakeParams([new S(t)]),this._funcCall("ContinueVerify",o,r,i,null))},rt.prototype.EndVerify=function(t,e,n){var r,i=[];return"boolean"!=typeof t&&(n=e,e=t),"boolean"!=typeof t?i.push(t):i.push(null),r=this._funcMakeParams(i),this._funcCall("EndVerify",r,e,n,null)},rt.prototype.SignHash=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("SignHash",r,e,n,null)},rt.prototype.VerifyHash=function(t,e,n,r,i){var o,s=[];return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(e),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("VerifyHash",o,r,i,null)},rt.prototype.SignInternal=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._stringToBytes(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("SignInternal",i,n,r,null)},rt.prototype.VerifyInternal=function(t,e,n,r){var i,o=[];return"boolean"!=typeof e&&(r=n,n=e),o.push(t),"boolean"==typeof e?o.push(e):o.push(null),i=this._funcMakeParams(o),this._funcCall("VerifyInternal",i,n,r,null)},rt.prototype.VerifyInternalString=function(t,e,n,r){var i=this;if("boolean"!=typeof e&&(r=n,n=e),!this.IsAsync(n,r)){var o=this.VerifyInternal(t,e);return this.BytesToString(o)}this.VerifyInternal(t,e,(function(t){i.BytesToString(t,n,r)}),r)},rt.prototype.SignFile=function(t,e,n,r,i){var o;o=this._funcMakeParams([t,e,n]),this._funcCall("SignFile",o,r,i,null)},rt.prototype.VerifyFile=function(t,e,n,r,i){var o,s=[];return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(e),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("VerifyFile",o,r,i,null)},rt.prototype.VerifyFileWithExternalSign=function(t,e,n,r,i){return this.VerifyFile(e,t,n,r,i)},rt.prototype.VerifyFileWithInternalSign=function(t,e,n,r,i){return this.VerifyFile(t,e,n,r,i)},rt.prototype.IsAlreadySigned=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("IsAlreadySigned",r,e,n,null)},rt.prototype.IsFileAlreadySigned=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("IsFileAlreadySigned",r,e,n,null)},rt.prototype.AppendSign=function(t,e,n,r){var i;if(!("string"==typeof t&&null==(t=this._stringToBytes(t,r))||"string"!=typeof e&&null==(e=this._base64Encode(e,r))))return i=this._funcMakeParams([new S(t),e]),this._funcCall("AppendSign",i,n,r,null)},rt.prototype.VerifySpecific=function(t,e,n,r,i,o){var s,a=[];if("boolean"!=typeof r&&(o=i,i=r),"string"!=typeof e||null!=(e=this._stringToBytes(e,o)))return a.push(t),a.push(new S(e)),a.push(n),"boolean"==typeof r?a.push(r):a.push(null),s=this._funcMakeParams(a),this._funcCall("VerifySpecific",s,i,o,null)},rt.prototype.AppendSignBegin=function(t,e,n){var r;"string"!=typeof t&&null==(t=this._base64Encode(t,n))||(r=this._funcMakeParams([t]),this._funcCall("AppendSignBegin",r,e,n,null))},rt.prototype.VerifyDataSpecificBegin=function(t,e,n,r){var i;i=this._funcMakeParams([t,e]),this._funcCall("VerifyDataSpecificBegin",i,n,r,null)},rt.prototype.AppendSignHash=function(t,e,n,r){var i;if(!("string"!=typeof t&&null==(t=this._base64Encode(t,r))||"string"!=typeof e&&null==(e=this._base64Encode(e,r))))return i=this._funcMakeParams([t,e]),this._funcCall("AppendSignHash",i,n,r,null)},rt.prototype.VerifyHashSpecific=function(t,e,n,r,i,o){var s,a=[];return"boolean"!=typeof r&&(o=i,i=r),a.push(t),a.push(e),a.push(n),"boolean"==typeof r?a.push(r):a.push(null),s=this._funcMakeParams(a),this._funcCall("VerifyHashSpecific",s,i,o,null)},rt.prototype.AppendSignInternal=function(t,e,n,r){var i;if("string"==typeof e||null!=(e=this._base64Encode(e,r)))return i=this._funcMakeParams([t,e]),this._funcCall("AppendSignInternal",i,n,r,null)},rt.prototype.VerifySpecificInternal=function(t,e,n,r,i){var o,s=[];return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(e),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("VerifySpecificInternal",o,r,i,null)},rt.prototype.VerifySpecificInternalString=function(t,e,n,r,i){var o=this;if("boolean"!=typeof n&&(i=r,r=n),!this.IsAsync(r,i)){var s=this.VerifySpecificInternal(t,e,n);return this.BytesToString(s)}this.VerifySpecificInternal(t,e,n,(function(t){o.BytesToString(t,r,i)}),i)},rt.prototype.AppendSignFile=function(t,e,n,r,i,o){var s;return s=this._funcMakeParams([t,e,n,r]),this._funcCall("AppendSignFile",s,i,o,null)},rt.prototype.VerifyFileSpecific=function(t,e,n,r,i,o){var s,a=[];return"boolean"!=typeof r&&(o=i,i=r),a.push(t),a.push(e),a.push(n),"boolean"==typeof r?a.push(r):a.push(null),s=this._funcMakeParams(a),this._funcCall("VerifyFileSpecific",s,i,o,null)},rt.prototype.VerifyFileWithExternalSignSpecific=function(t,e,n,r,i,o){return this.VerifyFileSpecific(t,e,n,r,i,o)},rt.prototype.VerifyFileWithInternalSignSpecific=function(t,e,n,r,i,o){return this.VerifyFileSpecific(t,e,n,r,i,o)},rt.prototype.CreateEmptySign=function(t,e,n){var r,i=[];if(2==arguments.length&&(n=e,e=t),"string"!=typeof t||null!=(t=this._stringToBytes(t,n)))return 1==arguments.length||3==arguments.length?i.push(new S(t)):i.push(null),r=this._funcMakeParams(i),this._funcCall("CreateEmptySign",r,e,n,null)},rt.prototype.CreateSigner=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("CreateSigner",r,e,n,null)},rt.prototype.AppendSigner=function(t,e,n,r,i){var o,s=[];return s.push(t),null!=e?s.push(new S(e)):s.push(null),s.push(n),o=this._funcMakeParams(s),this._funcCall("AppendSigner",o,r,i,null)},rt.prototype.AppendValidationDataToSignerEx=function(t,e,n,r,i){var o,s=[];if("string"==typeof t||null!=(t=this._base64Encode(t,i)))return s.push(t),null!=e?s.push(new S(e)):s.push(null),s.push(n),o=this._funcMakeParams(s),this._funcCall("AppendValidationDataToSignerEx",o,r,i,null)},rt.prototype.IsDataInSignedDataAvailable=function(t,e,n){var r;if("string"==typeof t||null!=(t=this._base64Encode(t,n)))return r=this._funcMakeParams([t]),this._funcCall("IsDataInSignedDataAvailable",r,e,n,null)},rt.prototype.IsDataInSignedFileAvailable=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("IsDataInSignedFileAvailable",r,e,n,null)},rt.prototype.GetDataFromSignedData=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("GetDataFromSignedData",r,e,n,null)},rt.prototype.GetDataFromSignedFile=function(t,e,n,r){var i;i=this._funcMakeParams([t,e]),this._funcCall("GetDataFromSignedFile",i,n,r,null)},rt.prototype.GetCertificateFromSignedData=function(t,e,n,r){var i;if("string"==typeof e||null!=(e=this._base64Encode(e,r)))return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificateFromSignedData",i,n,r,null)},rt.prototype.GetCertificateFromSignedFile=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificateFromSignedFile",i,n,r,null)},rt.prototype.GetSignTimeInfo=function(t,e,n,r){var i;if("string"==typeof e||null!=(e=this._base64Encode(e,r)))return i=this._funcMakeParams([t,e]),this._funcCall("GetSignTimeInfo",i,n,r,null)},rt.prototype.GetFileSignTimeInfo=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetFileSignTimeInfo",i,n,r,null)},rt.prototype.VerifyHashOnTime=function(t,e,n,r,i,o,s){return this.VerifyHashOnTimeEx(t,e,n,r,null!=r,!1,i,o,s)},rt.prototype.VerifyHashOnTimeEx=function(t,e,n,r,i,o,s,a,u){var c,l=[];if("boolean"!=typeof s&&(u=a,a=s),!("string"!=typeof t&&null==(t=this._base64Encode(t,u))||"string"!=typeof n&&null==(n=this._base64Encode(n,u))))return l=[t,e,n,r,i,o],"boolean"==typeof s?l.push(s):l.push(null),c=this._funcMakeParams(l),this._funcCall("VerifyHashOnTimeEx",c,a,u,null)},rt.prototype.VerifyDataOnTime=function(t,e,n,r,i,o,s){return this.VerifyDataOnTimeEx(t,e,n,r,null!=r,!1,i,o,s)},rt.prototype.VerifyDataOnTimeEx=function(t,e,n,r,i,o,s,a,u){var c,l=[];if("boolean"!=typeof s&&(u=a,a=s),!("string"==typeof t&&null==(t=this._stringToBytes(t,u))||"string"!=typeof n&&null==(n=this._base64Encode(n,u))))return l=[new S(t),e,n,r,i,o],"boolean"==typeof s?l.push(s):l.push(null),c=this._funcMakeParams(l),this._funcCall("VerifyDataOnTimeEx",c,a,u,null)},rt.prototype.VerifyDataInternalOnTime=function(t,e,n,r,i,o){return this.VerifyDataInternalOnTimeEx(t,e,n,null!=n,!1,r,i,o)},rt.prototype.VerifyDataInternalOnTimeEx=function(t,e,n,r,i,o,s,a){var u,c=[];if("boolean"!=typeof o&&(a=s,s=o),"string"==typeof t||null!=(t=this._base64Encode(t,a)))return c=[t,e,n,r,i],"boolean"==typeof o?c.push(o):c.push(null),u=this._funcMakeParams(c),this._funcCall("VerifyDataInternalOnTimeEx",u,s,a,null)},rt.prototype.VerifyDataInternalOnTimeString=function(t,e,n,r,i,o){return this.VerifyDataInternalOnTimeStringEx(t,e,n,null!=n,!1,r,i,o)},rt.prototype.VerifyDataInternalOnTimeStringEx=function(t,e,n,r,i,o,s,a){var u=this;if("boolean"!=typeof o&&(a=s,s=o),!this.IsAsync(s,a)){var c=this.VerifyDataInternalOnTimeEx(t,e,n,r,i,o);return this.BytesToString(c)}this.VerifyDataInternalOnTimeEx(t,e,n,r,i,o,(function(t){u.BytesToString(t,s,a)}),a)},rt.prototype.VerifyDataOnTimeBegin=function(t,e,n,r,i){this.VerifyDataOnTimeBeginEx(t,e,n,null!=n,!1,r,i)},rt.prototype.VerifyDataOnTimeBeginEx=function(t,e,n,r,i,o,s){var a;a=this._funcMakeParams([t,e,n,r,i]),this._funcCall("VerifyDataOnTimeBeginEx",a,o,s,null)},rt.prototype.VerifyFileOnTime=function(t,e,n,r,i,o,s,a,u){var c,l=[];return"boolean"!=typeof s&&(u=a,a=s),l=[t,e,n,r,i,o],"boolean"==typeof s?l.push(s):l.push(null),c=this._funcMakeParams(l),this._funcCall("VerifyFileOnTimeEx",c,a,u,null)},rt.prototype.VerifyFileWithExternalSignOnTime=function(t,e,n,r,i,o,s){return this.VerifyFileOnTime(t,n,e,r,null!=r,!1,i,o,s)},rt.prototype.VerifyFileWithExternalSignOnTimeEx=function(t,e,n,r,i,o,s,a,u){return this.VerifyFileOnTime(t,n,e,r,i,o,s,a,u)},rt.prototype.VerifyFileWithInternalSignOnTime=function(t,e,n,r,i,o,s){return this.VerifyFileOnTime(t,e,n,r,null!=r,!1,i,o,s)},rt.prototype.VerifyFileWithInternalSignOnTimeEx=function(t,e,n,r,i,o,s,a,u){return this.VerifyFileOnTime(t,n,e,r,i,o,s,a,u)},rt.prototype.ContinueSignCtx=function(t,e,n,r){var i;if(null==t&&(t=new j),"string"!=typeof e||null!=(e=this._stringToBytes(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ContinueSignCtx",i,n,r,null)},rt.prototype.ContinueSignCtxWithOffset=function(t,e,n,r,i,o){return e=e.slice(n,n+r),this.ContinueSignCtx(t,e,i,o)},rt.prototype.EndSignCtx=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("EndSignCtx",i,n,r,null)},rt.prototype.BeginVerifyCtx=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("BeginVerifyCtx",r,e,n,null)},rt.prototype.ContinueVerifyCtx=function(t,e,n,r,i,o){var s;"number"==typeof n&&"number"==typeof r||(i=n,o=r),"string"==typeof e&&null==(e=this._stringToBytes(e,o))||("number"==typeof n&&"number"==typeof r&&(e=e.slice(n,n+r)),s=this._funcMakeParams([t,new S(e)]),this._funcCall("ContinueVerifyCtx",s,i,o,null))},rt.prototype.EndVerifyCtx=function(t,e,n,r){var i,o=[];return"boolean"!=typeof e&&(r=n=e),o.push(t),"boolean"==typeof e?o.push(e):o.push(null),i=this._funcMakeParams(o),this._funcCall("EndVerifyCtx",i,n,r,null)},rt.prototype.ResetOperationCtx=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("ResetOperationCtx",r,e,n,null)},rt.prototype.SignHashRSA=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("SignHashRSA",r,e,n,null)},rt.prototype.SignRSA=function(t,e,n,r,i){var o;if("string"!=typeof t||null!=(t=this._stringToBytes(t,i)))return o=this._funcMakeParams([new S(t),e,n]),this._funcCall("SignRSA",o,r,i,null)},rt.prototype.ContinueRSASign=function(t,e,n){var r;"string"==typeof t&&null==(t=this._stringToBytes(t,n))||(r=this._funcMakeParams([new S(t)]),this._funcCall("ContinueRSASign",r,e,n,null))},rt.prototype.ContinueRSASignWithOffset=function(t,e,n,r,i){return t=t.slice(e,e+n),this.ContinueRSASign(t,r,i)},rt.prototype.EndRSASign=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("EndRSASign",r,e,n,null)},rt.prototype.SignRSAFile=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n]),this._funcCall("SignRSAFile",o,r,i,null)},rt.prototype.ContinueRSASignCtx=function(t,e,n,r){var i;if(null==t&&(t=new j),"string"!=typeof e||null!=(e=this._stringToBytes(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ContinueRSASignCtx",i,n,r,null)},rt.prototype.ContinueRSASignCtxWithOffset=function(t,e,n,r,i,o){return e=e.slice(n,n+r),this.ContinueRSASignCtx(e,i,o)},rt.prototype.EndRSASignCtx=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("EndRSASignCtx",i,n,r,null)},rt.prototype.SignECDSA=function(t,e,n,r,i){var o;if("string"!=typeof t||null!=(t=this._stringToBytes(t,i)))return o=this._funcMakeParams([new S(t),e,n]),this._funcCall("SignECDSA",o,r,i,null)},rt.prototype.RawSign=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._stringToBytes(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("RawSign",r,e,n,null)},rt.prototype.RawVerify=function(t,e,n,r,i){var o,s=[];if("boolean"!=typeof n&&(i=r,r=n),"string"!=typeof e||null!=(e=this._stringToBytes(e,i)))return s.push(t),s.push(new S(e)),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("RawVerify",o,r,i,null)},rt.prototype.RawSignHash=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("RawSignHash",r,e,n,null)},rt.prototype.RawVerifyHash=function(t,e,n,r,i){var o,s=[];return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(e),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("RawVerifyHash",o,r,i,null)},rt.prototype.RawSignFile=function(t,e,n,r){var i;i=this._funcMakeParams([t,e]),this._funcCall("RawSignFile",i,n,r,null)},rt.prototype.RawVerifyFile=function(t,e,n,r,i){var o,s=[];return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(e),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("RawVerifyFile",o,r,i,null)},rt.prototype.NBUSign=function(t,e,n,r){var i;if("string"!=typeof t||null!=(t=this._stringToBytes(t,r)))return i=this._funcMakeParams([new S(t),e]),this._funcCall("NBUSign",i,n,r,null)},rt.prototype.NBUVerify=function(t,e,n,r,i,o,s){var a,u=[];if("boolean"!=typeof i&&(s=o,o=i),"string"!=typeof n||null!=(n=this._stringToBytes(n,s)))return u.push(t),u.push(e),u.push(new S(n)),u.push(r),"boolean"==typeof i?u.push(i):u.push(null),a=this._funcMakeParams(u),this._funcCall("NBUVerify",a,o,s,null)},rt.prototype.CtxSignHash=function(t,e,n,r,i,o){var s;if("string"==typeof n||null!=(n=this._base64Encode(n,o)))return s=this._funcMakeParams([t,e,n,r]),this._funcCall("CtxSignHash",s,i,o,null)},rt.prototype.CtxSign=function(t,e,n,r,i,o,s){var a;if("string"!=typeof n||null!=(n=this._stringToBytes(n,s)))return a=this._funcMakeParams([t,e,new S(n),r,i]),this._funcCall("CtxSign",a,o,s,null)},rt.prototype.CtxSignFile=function(t,e,n,r,i,o,s,a){var u;u=this._funcMakeParams([t,e,n,r,i,o]),this._funcCall("CtxSignFile",u,s,a,null)},rt.prototype.CtxAppendSignHash=function(t,e,n,r,i,o,s){var a;if(!("string"!=typeof n&&null==(n=this._base64Encode(n,s))||"string"!=typeof r&&null==(r=this._base64Encode(r,s))))return a=this._funcMakeParams([t,e,n,r,i]),this._funcCall("CtxAppendSignHash",a,o,s,null)},rt.prototype.CtxAppendSign=function(t,e,n,r,i,o,s){var a;if(!(null!=n&&"string"==typeof n&&null==(n=this._stringToBytes(n,s))||"string"!=typeof r&&null==(r=this._base64Encode(r,s))))return a=this._funcMakeParams([t,e,n?new S(n):null,r,i]),this._funcCall("CtxAppendSign",a,o,s,null)},rt.prototype.CtxAppendSignFile=function(t,e,n,r,i,o,s,a){var u;u=this._funcMakeParams([t,e,n,r,i,o]),this._funcCall("CtxAppendSignFile",u,s,a,null)},rt.prototype.CtxGetSignValue=function(t,e,n,r,i){var o;if("string"==typeof n||null!=(n=this._base64Encode(n,i)))return o=this._funcMakeParams([t,e,n]),this._funcCall("CtxGetSignValue",o,r,i,null)},rt.prototype.CtxCreateSignerEx=function(t,e,n,r,i,o,s){var a;if("string"==typeof n||null!=(n=this._base64Encode(n,s)))return a=this._funcMakeParams([t,e,n,r,i]),this._funcCall("CtxCreateSignerEx",a,o,s,null)},rt.prototype.ShowSenderInfo=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("ShowSenderInfo",r,e,n,null)},rt.prototype.IsEnveloped=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("IsEnveloped",r,e,n,null)},rt.prototype.IsEnvelopedFile=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("IsEnvelopedFile",r,e,n,null)},rt.prototype.Envelop=function(t,e,n,r,i,o){var s;if("string"!=typeof r||null!=(r=this._stringToBytes(r,o)))return s=this._funcMakeParams([t,e,n,new S(r)]),this._funcCall("Envelop",s,i,o,null)},rt.prototype.Develop=function(t,e,n,r){var i,o=[];if("boolean"!=typeof e&&(r=n,n=e),"string"==typeof t||null!=(t=this._base64Encode(t,r)))return o.push(t),"boolean"==typeof e?o.push(e):o.push(null),i=this._funcMakeParams(o),this._funcCall("Develop",i,n,r,null)},rt.prototype.EnvelopFile=function(t,e,n,r,i,o,s){var a;a=this._funcMakeParams([t,e,n,r,i]),this._funcCall("EnvelopFile",a,o,s,null)},rt.prototype.DevelopFile=function(t,e,n,r,i){var o,s=[];return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(e),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("DevelopFile",o,r,i,null)},rt.prototype.EnvelopEx=function(t,e,n,r,i,o){var s;if("EndUserArrayList"==t.className&&(t=t.m_array),"EndUserArrayList"==e.className&&(e=e.m_array),"string"!=typeof r||null!=(r=this._stringToBytes(r,o)))return s=this._funcMakeParams([t,e,n,new S(r)]),this._funcCall("EnvelopEx",s,i,o,null)},rt.prototype.DevelopEx=function(t,e,n,r,i){var o,s=[];if("boolean"!=typeof n&&(i=r,r=n),"string"==typeof t||null!=(t=this._base64Encode(t,i)))return s.push(t),s.push(e?new S(e):null),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("DevelopEx",o,r,i,null)},rt.prototype.EnvelopFileEx=function(t,e,n,r,i,o,s){var a;"EndUserArrayList"==t.className&&(t=t.m_array),"EndUserArrayList"==e.className&&(e=e.m_array),a=this._funcMakeParams([t,e,n,r,i]),this._funcCall("EnvelopFileEx",a,o,s,null)},rt.prototype.EnvelopToRecipients=function(t,e,n,r,i){var o;"EndUserArrayList"==t.className&&(t=t.m_array);for(var s=[],a=0;a<t.length;a++)s.push(new S(t[a]));if("string"!=typeof n||null!=(n=this._stringToBytes(n,i)))return o=this._funcMakeParams([s,e,new S(n)]),this._funcCall("EnvelopToRecipients",o,r,i,null)},rt.prototype.EnvelopFileToRecipients=function(t,e,n,r,i,o){var s;"EndUserArrayList"==t.className&&(t=t.m_array);for(var a=[],u=0;u<t.length;u++)a.push(new S(t[u]));s=this._funcMakeParams([a,e,n,r]),this._funcCall("EnvelopFileToRecipients",s,i,o,null)},rt.prototype.EnvelopToRecipientsEx=function(t,e,n,r,i,o){var s;"EndUserArrayList"==t.className&&(t=t.m_array);for(var a=[],u=0;u<t.length;u++)a.push(new S(t[u]));if("string"!=typeof r||null!=(r=this._stringToBytes(r,o)))return s=this._funcMakeParams([a,e,n,new S(r)]),this._funcCall("EnvelopToRecipientsEx",s,i,o,null)},rt.prototype.EnvelopFileToRecipientsEx=function(t,e,n,r,i,o,s){var a;"EndUserArrayList"==t.className&&(t=t.m_array);for(var u=[],c=0;c<t.length;c++)u.push(new S(t[c]));a=this._funcMakeParams([u,e,n,r,i]),this._funcCall("EnvelopFileToRecipientsEx",a,o,s,null)},rt.prototype.EnvelopToRecipientsWithOCode=function(t,e,n,r,i,o){var s;if("string"!=typeof r||null!=(r=this._stringToBytes(r,o)))return s=this._funcMakeParams([t,e,n,new S(r)]),this._funcCall("EnvelopToRecipientsWithOCode",s,i,o,null)},rt.prototype.EnvelopExWithDynamicKey=function(t,e,n,r,i,o,s){var a;if("EndUserArrayList"==t.className&&(t=t.m_array),"EndUserArrayList"==e.className&&(e=e.m_array),"string"!=typeof i||null!=(i=this._stringToBytes(i,s)))return a=this._funcMakeParams([t,e,n,r,new S(i)]),this._funcCall("EnvelopExWithDynamicKey",a,o,s,null)},rt.prototype.EnvelopFileExWithDynamicKey=function(t,e,n,r,i,o,s,a){var u;"EndUserArrayList"==t.className&&(t=t.m_array),"EndUserArrayList"==e.className&&(e=e.m_array),u=this._funcMakeParams([t,e,n,r,i,o]),this._funcCall("EnvelopFileExWithDynamicKey",u,s,a,null)},rt.prototype.EnvelopToRecipientsWithDynamicKey=function(t,e,n,r,i,o){var s;"EndUserArrayList"==t.className&&(t=t.m_array);for(var a=[],u=0;u<t.length;u++)a.push(new S(t[u]));if("string"!=typeof r||null!=(r=this._stringToBytes(r,o)))return s=this._funcMakeParams([a,e,n,new S(r)]),this._funcCall("EnvelopToRecipientsWithDynamicKey",s,i,o,null)},rt.prototype.EnvelopFileToRecipientsWithDynamicKey=function(t,e,n,r,i,o,s){var a;"EndUserArrayList"==t.className&&(t=t.m_array);for(var u=[],c=0;c<t.length;c++)u.push(new S(t[c]));a=this._funcMakeParams([u,e,n,r,i]),this._funcCall("EnvelopFileToRecipientsWithDynamicKey",a,o,s,null)},rt.prototype.EnvelopToRecipientsWithSettings=function(t,e,n,r,i,o,s,a,u){var c;if("string"!=typeof n||null!=(n=this._stringToBytes(n,u))){"EndUserArrayList"==t.className&&(t=t.m_array);for(var l=[],f=0;f<t.length;f++)l.push(new S(t[f]));return c=this._funcMakeParams([l,e,new S(n),r,i,o,s]),this._funcCall("EnvelopToRecipientsWithSettings",c,a,u,null)}},rt.prototype.RawEnvelop=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._stringToBytes(e,r)))return i=this._funcMakeParams([new S(t),new S(e)]),this._funcCall("RawEnvelop",i,n,r,null)},rt.prototype.RawDevelop=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("RawDevelop",i,n,r,null)},rt.prototype.EnvelopRSA=function(t,e,n,r,i,o,s){return this.EnvelopRSAEx(t,[e],[n],r,i,o,s)},rt.prototype.EnvelopFileRSA=function(t,e,n,r,i,o,s,a){this.EnvelopFileRSAEx(t,[e],[n],r,i,o,s,a)},rt.prototype.EnvelopRSAEx=function(t,e,n,r,i,o,s){var a;if("EndUserArrayList"==e.className&&(e=e.m_array),"EndUserArrayList"==n.className&&(n=n.m_array),"string"!=typeof i||null!=(i=this._stringToBytes(i,s)))return a=this._funcMakeParams([t,e,n,r,new S(i)]),this._funcCall("EnvelopRSAEx",a,o,s,null)},rt.prototype.EnvelopFileRSAEx=function(t,e,n,r,i,o,s,a){var u;"EndUserArrayList"==e.className&&(e=e.m_array),"EndUserArrayList"==n.className&&(n=n.m_array),u=this._funcMakeParams([t,e,n,r,i,o]),this._funcCall("EnvelopFileRSAEx",u,s,a,null)},rt.prototype.EnvelopToRecipientsRSA=function(t,e,n,r,i,o){var s;"EndUserArrayList"==e.className&&(e=e.m_array);for(var a=[],u=0;u<e.length;u++)a.push(new S(e[u]));if("string"!=typeof r||null!=(r=this._stringToBytes(r,o)))return s=this._funcMakeParams([t,a,n,new S(r)]),this._funcCall("EnvelopToRecipientsRSA",s,i,o,null)},rt.prototype.EnvelopFileToRecipientsRSA=function(t,e,n,r,i,o,s){var a;"EndUserArrayList"==e.className&&(e=e.m_array);for(var u=[],c=0;c<e.length;c++)u.push(new S(e[c]));a=this._funcMakeParams([t,u,n,r,i]),this._funcCall("EnvelopFileToRecipientsRSA",a,o,s,null)},rt.prototype.CtxEnvelop=function(t,e,n,r,i,o,s,a){var u;if("string"!=typeof o||null!=(o=this._stringToBytes(o,a))){"EndUserArrayList"==e.className&&(e=e.m_array);for(var c=[],l=0;l<e.length;l++)c.push(new S(e[l]));return u=this._funcMakeParams([t,c,n,r,i,new S(o)]),this._funcCall("CtxEnvelop",u,s,a,null)}},rt.prototype.CtxEnvelopFile=function(t,e,n,r,i,o,s,a,u){var c;"EndUserArrayList"==e.className&&(e=e.m_array);for(var l=[],f=0;f<e.length;f++)l.push(new S(e[f]));c=this._funcMakeParams([t,l,n,r,i,o,s]),this._funcCall("CtxEnvelopFile",c,a,u,null)},rt.prototype.CtxEnvelopWithDynamicKey=function(t,e,n,r,i,o,s,a){var u;if("string"!=typeof o||null!=(o=this._stringToBytes(o,a))){"EndUserArrayList"==e.className&&(e=e.m_array);for(var c=[],l=0;l<e.length;l++)c.push(new S(e[l]));return u=this._funcMakeParams([t,c,n,r,i,new S(o)]),this._funcCall("CtxEnvelopWithDynamicKey",u,s,a,null)}},rt.prototype.CtxEnvelopFileWithDynamicKey=function(t,e,n,r,i,o,s,a,u){var c;"EndUserArrayList"==e.className&&(e=e.m_array);for(var l=[],f=0;f<e.length;f++)l.push(new S(e[f]));c=this._funcMakeParams([t,l,n,r,i,o,s]),this._funcCall("CtxEnvelopFileWithDynamicKey",c,a,u,null)},rt.prototype.CtxDevelop=function(t,e,n,r,i,o){var s,a=[];if("boolean"!=typeof r&&(o=i,i=r),"string"==typeof e||null!=(e=this._base64Encode(e,o)))return a.push(t),a.push(e),a.push(n?new S(n):null),"boolean"==typeof r?a.push(r):a.push(null),s=this._funcMakeParams(a),this._funcCall("CtxDevelop",s,i,o,null)},rt.prototype.CtxDevelopFile=function(t,e,n,r,i,o,s){var a,u=[];return"boolean"!=typeof i&&(s=o,o=i),u.push(t),u.push(e),u.push(n?new S(n):null),u.push(r),"boolean"==typeof i?u.push(i):u.push(null),a=this._funcMakeParams(u),this._funcCall("CtxDevelopFile",a,o,s,null)},rt.prototype.CtxCreateAuthData=function(t,e,n,r,i){var o;if("string"!=typeof n||null!=(n=this._stringToBytes(n,i)))return o=this._funcMakeParams([t,new S(e),new S(n)]),this._funcCall("CtxCreateAuthData",o,r,i,null)},rt.prototype.ProtectDataByPassword=function(t,e,n,r){var i;if("string"!=typeof t||null!=(t=this._stringToBytes(t,r)))return i=this._funcMakeParams([new S(t),e]),this._funcCall("ProtectDataByPassword",i,n,r,null)},rt.prototype.UnprotectDataByPassword=function(t,e,n,r){var i;if("string"==typeof t||null!=(t=this._base64Encode(t,r)))return i=this._funcMakeParams([t,e]),this._funcCall("UnprotectDataByPassword",i,n,r,null)},rt.prototype.SessionIsInitialized=function(t,e,n){var r;return t.SetData(null),r=this._funcMakeParams([t]),this._funcCall("SessionIsInitialized",r,e,n,null)},rt.prototype.SessionClose=function(t,e,n){var r;t.SetData(null),r=this._funcMakeParams([t]),this._funcCall("SessionClose",r,e,n,null)},rt.prototype.ClientSessionCreateStep1=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("ClientSessionCreateStep1",r,e,n,null)},rt.prototype.ServerSessionCreateStep1=function(t,e,n,r){var i;return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ServerSessionCreateStep1",i,n,r,null)},rt.prototype.ClientSessionCreateStep2=function(t,e,n,r){var i,o=this;t.SetData(null),i=this._funcMakeParams([t,new S(e)]),this._funcCall("ClientSessionCreateStep2",i,n,r,(function(e,n,r){t.SetData(e.GetData()),o.IsAsync(n,r)&&n()}))},rt.prototype.ServerSessionCreateStep2=function(t,e,n,r){var i;t.SetData(null),i=this._funcMakeParams([t,new S(e)]),this._funcCall("ServerSessionCreateStep2",i,n,r,null)},rt.prototype.SessionSave=function(t,e,n){var r;return t.SetData(null),r=this._funcMakeParams([t]),this._funcCall("SessionSave",r,e,n,null)},rt.prototype.SessionLoad=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("SessionLoad",r,e,n,null)},rt.prototype.SessionCheckCertificates=function(t,e,n){var r;return t.SetData(null),r=this._funcMakeParams([t]),this._funcCall("SessionCheckCertificates",r,e,n,null)},rt.prototype.SessionEncrypt=function(t,e,n,r){var i,o=!1,s=this;if("string"!=typeof e||(o=!0,null!=(e=this._stringToBytes(e,r))))return t.SetData(null),i=this._funcMakeParams([t,new S(e)]),this._funcCall("SessionEncrypt",i,n,r,o?function(t,e,n){return s.BASE64Encode(t,e,n)}:null)},rt.prototype.SessionDecrypt=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return t.SetData(null),i=this._funcMakeParams([t,new S(e)]),this._funcCall("SessionDecrypt",i,n,r,null)},rt.prototype.SessionEncryptContinue=function(t,e,n,r){var i,o=this,s=!1;if("string"!=typeof e||(s=!0,null!=(e=this._stringToBytes(e,r))))return t.SetData(null),i=this._funcMakeParams([t,new S(e)]),this._funcCall("SessionEncryptContinue",i,n,r,(function(t,n,r){if(s)return o.BASE64Encode(t,n,r);var i=o.IsAsync(n,r);if(!o._copyArrayData(e,t)){var a=o.MakeError(et.ERROR_BAD_PARAMETER,"");if(i)return void r(a);throw new nt(a.errorCode,a.message)}if(!i)return e;n(e)}))},rt.prototype.SessionDecryptContinue=function(t,e,n,r){var i,o=this;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return t.SetData(null),i=this._funcMakeParams([t,new S(e)]),this._funcCall("SessionDecryptContinue",i,n,r,(function(t,n,r){var i=o.IsAsync(n,r);if(!o._copyArrayData(e,t)){var s=o.MakeError(et.ERROR_BAD_PARAMETER,"");if(i)return void r(s);throw new nt(s.errorCode,s.message)}if(!i)return e;n(e)}))},rt.prototype.SessionGetPeerCertificateInfo=function(t,e,n){var r;return t.SetData(null),r=this._funcMakeParams([t]),this._funcCall("SessionGetPeerCertificateInfo",r,e,n,null)},rt.prototype.ClientDynamicKeySessionCreate=function(t,e,n,r,i){var o,s=[];return"string"==typeof e&&"string"==typeof n||(i=r,r=n),s.push(t),"string"==typeof e&&"string"==typeof n?(s.push(e),s.push(n),s.push(null)):(s.push(null),s.push(null),s.push(new S(e))),o=this._funcMakeParams(s),this._funcCall("ClientDynamicKeySessionCreate",o,r,i,null)},rt.prototype.ServerDynamicKeySessionCreate=function(t,e,n,r){var i;return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ServerDynamicKeySessionCreate",i,n,r,null)},rt.prototype.ClientDynamicKeySessionLoad=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("ClientDynamicKeySessionLoad",r,e,n,null)},rt.prototype.SCClientIsRunning=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("SCClientIsRunning",n,t,e,null)},rt.prototype.SCClientStart=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("SCClientStart",n,t,e,null)},rt.prototype.SCClientStop=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("SCClientStop",n,t,e,null)},rt.prototype.SCClientAddGate=function(t,e,n,r,i,o,s,a){var u;"string"!=typeof i&&(s=i,a=o,i=null,o=null),u=this._funcMakeParams([t,e,n,r,i,o]),this._funcCall("SCClientAddGate",u,s,a,null)},rt.prototype.SCClientRemoveGate=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SCClientRemoveGate",r,e,n,null)},rt.prototype.SCClientGetStatistic=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("SCClientGetStatistic",n,t,e,null)},rt.prototype.AppendTransportHeader=function(t,e,n,r,i,o,s){var a;return a=this._funcMakeParams([t,e,n,new S(r),new S(i)]),this._funcCall("AppendTransportHeader",a,o,s,null)},rt.prototype.ParseTransportHeader=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("ParseTransportHeader",r,e,n,null)},rt.prototype.AppendCryptoHeader=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,new S(n)]),this._funcCall("AppendCryptoHeader",o,r,i,null)},rt.prototype.ParseCryptoHeader=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("ParseCryptoHeader",r,e,n,null)},rt.prototype.AppendFileTransportHeader=function(t,e,n,r,i,o,s,a){var u;u=this._funcMakeParams([t,e,n,new S(r),i,o]),this._funcCall("AppendFileTransportHeader",u,s,a,null)},rt.prototype.ParseFileTransportHeader=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("ParseFileTransportHeader",i,n,r,null)},rt.prototype.AppendFileCryptoHeader=function(t,e,n,r,i,o){var s;s=this._funcMakeParams([t,e,n,r]),this._funcCall("AppendFileCryptoHeader",s,i,o,null)},rt.prototype.ParseFileCryptoHeader=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("ParseFileCryptoHeader",i,n,r,null)},rt.prototype.DevCtxEnum=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("DevCtxEnum",r,e,n,null)},rt.prototype.DevCtxOpen=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n]),this._funcCall("DevCtxOpen",o,r,i,null)},rt.prototype.CreateDeviceContext=function(){return new X},rt.prototype.DevCtxEnumVirtual=function(t,e,n){var r,i=this;return r=this._funcMakeParams([t]),this._funcCall("DevCtxEnumVirtual",r,e,n,(function(e,n,r){var o=i.IsAsync(n,r);try{if(null==e){if(!o)return null;n(null)}if(t.set(e[1]),!o)return e[0];n(e[0])}catch(t){var s=i.MakeError(et.ERROR_LIBRARY_COMUNICATION_FAILED,"");if(o)return void r(s);throw new nt(s.errorCode,s.message)}}))},rt.prototype.DevCtxClose=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("DevCtxClose",r,e,n,null)},rt.prototype.DevCtxGetData=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("DevCtxGetData",i,n,r,null)},rt.prototype.DevCtxChangePassword=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("DevCtxChangePassword",i,n,r,null)},rt.prototype.GetHostInfo=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetHostInfo",n,t,e,null)},rt.prototype.IsRemotelyControlled=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("IsRemotelyControlled",n,t,e,null)},rt.prototype.CtxCreate=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("CtxCreate",n,t,e,null)},rt.prototype.CtxFree=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("CtxFree",r,e,n,null)},rt.prototype.CtxSetParameter=function(t,e,n,r,i){var o;"boolean"==typeof n&&(n=n?1:0),o=this._funcMakeParams([t,e,n]),this._funcCall("CtxSetParameter",o,r,i,null)},rt.prototype.CreateReference=function(t,e){return new $(t,e)},rt.prototype.ASiCGetASiCType=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._base64Decode(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("ASiCGetASiCType",r,e,n,null)},rt.prototype.ASiCGetSignType=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._base64Decode(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("ASiCGetSignType",r,e,n,null)},rt.prototype.ASiCGetSignsCount=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._base64Decode(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("ASiCGetSignsCount",r,e,n,null)},rt.prototype.ASiCGetSignerInfo=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ASiCGetSignerInfo",i,n,r,null)},rt.prototype.ASiCGetSignTimeInfo=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ASiCGetSignTimeInfo",i,n,r,null)},rt.prototype.ASiCGetSignReferences=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ASiCGetSignReferences",i,n,r,null)},rt.prototype.ASiCGetReference=function(t,e,n,r){var i;if("string"!=typeof t||null!=(t=this._base64Decode(t,r)))return i=this._funcMakeParams([new S(t),e]),this._funcCall("ASiCGetReference",i,n,r,null)},rt.prototype.ASiCSign=function(t,e,n,r,i,o){for(var s,a=[],u=[],c=0;c<r.length;c++)a.push(r[c].GetName()),u.push(new S(r[c].GetData()));return s=this._funcMakeParams([t,e,n,a,u]),this._funcCall("ASiCSign",s,i,o,null)},rt.prototype.ASiCAppendSign=function(t,e,n,r,i){var o;if("string"!=typeof n||null!=(n=this._base64Decode(n,i)))return o=this._funcMakeParams([t,e,new S(n)]),this._funcCall("ASiCAppendSign",o,r,i,null)},rt.prototype.ASiCVerify=function(t,e,n,r,i){var o,s=[];if("string"!=typeof e||null!=(e=this._base64Decode(e,i)))return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(new S(e)),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("ASiCVerify",o,r,i,null)},rt.prototype.CtxASiCSign=function(t,e,n,r,i,o,s,a){for(var u,c=[],l=[],f=0;f<o.length;f++)c.push(o[f].GetName()),l.push(new S(o[f].GetData()));return u=this._funcMakeParams([t,e,n,r,i,c,l]),this._funcCall("CtxASiCSign",u,s,a,null)},rt.prototype.CtxASiCAppendSign=function(t,e,n,r,i,o,s){var a;if("string"!=typeof i||null!=(i=this._base64Decode(i,s)))return a=this._funcMakeParams([t,e,n,r,new S(i)]),this._funcCall("CtxASiCAppendSign",a,o,s,null)},rt.prototype.CtxASiCGetSignerInfo=function(t,e,n,r,i){var o;if("string"!=typeof n||null!=(n=this._base64Decode(n,i)))return o=this._funcMakeParams([t,e,new S(n)]),this._funcCall("CtxASiCGetSignerInfo",o,r,i,null)},rt.prototype.ASiCGetSignLevel=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ASiCGetSignLevel",i,n,r,null)},rt.prototype.ASiCIsAllContentCovered=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ASiCIsAllContentCovered",i,n,r,null)},rt.prototype.PDFGetSignType=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("PDFGetSignType",i,n,r,null)},rt.prototype.PDFGetSignsCount=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._base64Decode(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("PDFGetSignsCount",r,e,n,null)},rt.prototype.PDFGetSignerInfo=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("PDFGetSignerInfo",i,n,r,null)},rt.prototype.PDFGetSignTimeInfo=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("PDFGetSignTimeInfo",i,n,r,null)},rt.prototype.PDFSign=function(t,e,n,r){var i;return i=this._funcMakeParams([new S(t),e]),this._funcCall("PDFSign",i,n,r,null)},rt.prototype.PDFVerify=function(t,e,n,r,i){var o,s=[];if("string"!=typeof e||null!=(e=this._base64Decode(e,i)))return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(new S(e)),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("PDFVerify",o,r,i,null)},rt.prototype.CtxPDFSign=function(t,e,n,r,i,o){var s;return s=this._funcMakeParams([t,e,new S(n),r]),this._funcCall("CtxPDFSign",s,i,o,null)},rt.prototype.CtxPDFGetSignerInfo=function(t,e,n,r,i){var o;if("string"!=typeof n||null!=(n=this._base64Decode(n,i)))return o=this._funcMakeParams([t,e,new S(n)]),this._funcCall("CtxPDFGetSignerInfo",o,r,i,null)},rt.prototype.XAdESGetType=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._base64Decode(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("XAdESGetType",r,e,n,null)},rt.prototype.XAdESGetSignsCount=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._base64Decode(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("XAdESGetSignsCount",r,e,n,null)},rt.prototype.XAdESGetSignLevel=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("XAdESGetSignLevel",i,n,r,null)},rt.prototype.XAdESGetSignerInfo=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("XAdESGetSignerInfo",i,n,r,null)},rt.prototype.XAdESGetSignTimeInfo=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("XAdESGetSignTimeInfo",i,n,r,null)},rt.prototype.XAdESGetSignReferences=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("XAdESGetSignReferences",i,n,r,null)},rt.prototype.XAdESGetReference=function(t,e,n,r){var i;if("string"!=typeof t||null!=(t=this._base64Decode(t,r)))return i=this._funcMakeParams([new S(t),e]),this._funcCall("XAdESGetReference",i,n,r,null)},rt.prototype.XAdESSign=function(t,e,n,r,i){for(var o,s=[],a=[],u=0;u<n.length;u++)s.push(n[u].GetName()),a.push(new S(n[u].GetData()));return o=this._funcMakeParams([t,e,s,a]),this._funcCall("XAdESSign",o,r,i,null)},rt.prototype.XAdESVerify=function(t,e,n,r,i,o){var s,a=[],u=null,c=null;if(null!=t){u=[],c=[];for(var l=0;l<t.length;l++)u.push(t[l].GetName()),c.push(new S(t[l].GetData()))}if("string"!=typeof n||null!=(n=this._base64Decode(n,o)))return"boolean"!=typeof r&&(o=i,i=r),a.push(u),a.push(c),a.push(e),a.push(new S(n)),"boolean"==typeof r?a.push(r):a.push(null),s=this._funcMakeParams(a),this._funcCall("XAdESVerify",s,i,o,null)},rt.prototype.CtxXAdESSign=function(t,e,n,r,i,o,s){for(var a,u=[],c=[],l=0;l<i.length;l++)u.push(i[l].GetName()),c.push(new S(i[l].GetData()));return a=this._funcMakeParams([t,e,n,r,u,c]),this._funcCall("CtxXAdESSign",a,o,s,null)},rt.prototype.CtxXAdESGetSignerInfo=function(t,e,n,r,i){var o;if("string"!=typeof n||null!=(n=this._base64Decode(n,i)))return o=this._funcMakeParams([t,e,new S(n)]),this._funcCall("CtxXAdESGetSignerInfo",o,r,i,null)},rt.prototype.SServerClientGeneratePrivateKeyAsync=function(t,e,n,r,i,o,s,a,u,c,l,f,_){var p;return p=this._funcMakeParams([t,e,n,r,i,o,s,a,u,c,l]),this._funcCall("SServerClientGeneratePrivateKeyAsync",p,f,_,null)},rt.prototype.SServerClientCheckGeneratePrivateKeyStatus=function(t,e,n,r,i,o){var s,a=this;return s=this._funcMakeParams([t,e,n,r]),this._funcCall("SServerClientCheckGeneratePrivateKeyStatus",s,i,o,(function(t,e,n){var r=a.IsAsync(e,n);try{for(var i=new p,o=0;o<t.length;o++)i.add(t[o]);if(0==i.size()&&(i=null),!r)return i;e(i)}catch(t){var s=a.MakeError(et.ERROR_LIBRARY_COMUNICATION_FAILED,"");if(r)return void n(s);throw new nt(s.errorCode,s.message)}}))},rt.prototype.SServerClientSignHashAsync=function(t,e,n,r,i,o,s,a,u){var c;if("string"==typeof o||null!=(o=this._base64Encode(o,u)))return c=this._funcMakeParams([t,e,n,r,i,o,s]),this._funcCall("SServerClientSignHashAsync",c,a,u,null)},rt.prototype.SServerClientCheckSignHashStatus=function(t,e,n,r,i,o){var s;return s=this._funcMakeParams([t,e,n,r]),this._funcCall("SServerClientCheckSignHashStatus",s,i,o,null)},rt.prototype.SServerClientSignHashesAsync=function(t,e,n,r,i,o,s,a,u,c){var l;return"EndUserArrayList"==o.className&&(o=o.m_array),"EndUserArrayList"==s.className&&(s=s.m_array),l=this._funcMakeParams([t,e,n,r,i,o,s,a]),this._funcCall("SServerClientSignHashesAsync",l,u,c,null)},rt.prototype.SServerClientCheckSignHashesStatus=function(t,e,n,r,i,o){var s,a=this;return s=this._funcMakeParams([t,e,n,r]),this._funcCall("SServerClientCheckSignHashesStatus",s,i,o,(function(t,e,n){var r=a.IsAsync(e,n);try{for(var i=new p,o=0;o<t.length;o++)i.add(t[o]);if(0==i.size()&&(i=null),!r)return i;e(i)}catch(t){var s=a.MakeError(et.ERROR_LIBRARY_COMUNICATION_FAILED,"");if(r)return void n(s);throw new nt(s.errorCode,s.message)}}))},{EndUserLibraryLoader:_,EUSignCP:rt,EndUserError:et}})?r.apply(e,i):r)||(t.exports=o)},function(t,e,n){"use strict";n.r(e),n.d(e,"CASettings",(function(){return s.a})),n.d(e,"KSPSettings",(function(){return s.d})),n.d(e,"EndUserError",(function(){return i})),n.d(e,"EndUserConstants",(function(){return h})),n.d(e,"EndUserEvents",(function(){return r})),n.d(e,"EndUserLibraryInfoJS",(function(){return o.a})),n.d(e,"EndUserLibraryInfoSW",(function(){return o.b})),n.d(e,"EndUserSettings",(function(){return s.c})),n.d(e,"EndUserProxySettings",(function(){return s.b})),n.d(e,"EndUserOwnerInfo",(function(){return a.a})),n.d(e,"EndUserCertificateInfoEx",(function(){return u.a})),n.d(e,"EndUserCertificate",(function(){return c})),n.d(e,"EndUserKeyMedia",(function(){return l})),n.d(e,"EndUserJKSPrivateKeyInfo",(function(){return f.a})),n.d(e,"EndUserContext",(function(){return _})),n.d(e,"EndUserPrivateKeyContext",(function(){return p})),n.d(e,"EndUserTimeInfo",(function(){return y.a})),n.d(e,"EndUserSignContainerInfo",(function(){return S.a})),n.d(e,"EndUserSignInfo",(function(){return C.a})),n.d(e,"EndUserSenderInfo",(function(){return d.a})),n.d(e,"EndUserParams",(function(){return A.a})),n.d(e,"EndUserInfo",(function(){return R})),n.d(e,"EndUserRequestInfo",(function(){return m.a})),n.d(e,"EndUserClientRegistrationParameters",(function(){return T})),n.d(e,"EndUserClientRegistrationToken",(function(){return g})),n.d(e,"EndUserTaxReport",(function(){return E.b})),n.d(e,"EndUserTaxReceipt",(function(){return E.a})),n.d(e,"EndUser",(function(){return b}));var r={};n.r(r),n.d(r,"EndUserConfirmKSPOperationEvent",(function(){return P}));var i=n(1),o=n(13),s=n(9),a=n(10),u=n(8),c=function(){},l=function(t){this.type=t?t.type:"",this.device=t?t.device:"",this.visibleName=t?t.visibleName:"",this.typeIndex=t?t.typeIndex:-1,this.devIndex=t?t.devIndex:-1,this.password=t?t.password:"",this.user=t?t.user:""},f=n(14),_=function(){},p=function(){},h=n(0),E=n(11),y=n(6),S=n(7),C=n(5),d=n(12),A=n(15),R=function(){this.version=h.EU_USER_INFO_VERSION,this.commonName="",this.locality="",this.state="",this.organization="",this.orgUnit="",this.title="",this.street="",this.phone="",this.surname="",this.givenname="",this.EMail="",this.DNS="",this.EDRPOUCode="",this.DRFOCode="",this.NBUCode="",this.SPFMCode="",this.OCode="",this.OUCode="",this.userCode="",this.UPN="",this.UNZR="",this.country="UA"},m=n(16),T=function(){},g=function(){},P=function(){this.type=h.EndUserEventType.ConfirmKSPOperation},v=n(18),I=function(){function t(t,e){var n=this,r="";"number"==typeof e&&e>0&&("string"==typeof r&&r.length>0&&(r="var EU_MAX_DATA_SIZE_MB = "+e+";"+r),"string"==typeof t&&t.length>0&&(t+=(t.includes("?")?"&":"?")+"maxDataSize="+e)),this.m_worker=new v.a(r,t,(function(t){n.OnEvent(t)})),this.m_eventListeners=new Array}return t.prototype.OnEvent=function(t){try{var e=this.m_eventListeners[t.type]||this.m_eventListeners[h.EndUserEventType.All];e&&e(t)}catch(t){}},t.prototype.AddEventListener=function(t,e){switch(t){case h.EndUserEventType.None:this.m_eventListeners=[];break;case h.EndUserEventType.All:this.m_eventListeners=[],this.m_eventListeners[t]=e;break;default:this.m_eventListeners[t]=e}return this.m_worker.postMessage("AddEventListener",[t])},t.prototype.GetLibraryInfo=function(t){return this.m_worker.postMessage("GetLibraryInfo",Array.prototype.slice.call(arguments))},t.prototype.IsInitialized=function(){return this.m_worker.postMessage("IsInitialized",Array.prototype.slice.call(arguments))},t.prototype.Initialize=function(t){return this.m_worker.postMessage("Initialize",Array.prototype.slice.call(arguments))},t.prototype.SetLanguage=function(t){return this.m_worker.postMessage("SetLanguage",Array.prototype.slice.call(arguments))},t.prototype.SetRuntimeParameter=function(t,e){return this.m_worker.postMessage("SetRuntimeParameter",Array.prototype.slice.call(arguments))},t.prototype.GetStorageParameter=function(t,e){return this.m_worker.postMessage("GetStorageParameter",Array.prototype.slice.call(arguments))},t.prototype.SetStorageParameter=function(t,e,n){return this.m_worker.postMessage("SetStorageParameter",Array.prototype.slice.call(arguments))},t.prototype.GetCAs=function(){return this.m_worker.postMessage("GetCAs",Array.prototype.slice.call(arguments))},t.prototype.GetProxySettings=function(){return this.m_worker.postMessage("GetProxySettings",Array.prototype.slice.call(arguments))},t.prototype.SetProxySettings=function(t){return this.m_worker.postMessage("SetProxySettings",Array.prototype.slice.call(arguments))},t.prototype.GetHostInfo=function(){return this.m_worker.postMessage("GetHostInfo",Array.prototype.slice.call(arguments))},t.prototype.GetKeyMedias=function(){return this.m_worker.postMessage("GetKeyMedias",Array.prototype.slice.call(arguments))},t.prototype.GetJKSPrivateKeys=function(t){return this.m_worker.postMessage("GetJKSPrivateKeys",Array.prototype.slice.call(arguments))},t.prototype.IsPrivateKeyReaded=function(){return this.m_worker.postMessage("IsPrivateKeyReaded",Array.prototype.slice.call(arguments))},t.prototype.ResetPrivateKey=function(){return this.m_worker.postMessage("ResetPrivateKey",Array.prototype.slice.call(arguments))},t.prototype.ResetOperationKSP=function(){return this.m_worker.postMessage("ResetOperationKSP",Array.prototype.slice.call(arguments))},t.prototype.ReadPrivateKey=function(t,e,n){return this.m_worker.postMessage("ReadPrivateKey",Array.prototype.slice.call(arguments))},t.prototype.ReadPrivateKeyBinary=function(t,e,n,r){return this.m_worker.postMessage("ReadPrivateKeyBinary",Array.prototype.slice.call(arguments))},t.prototype.ReadPrivateKeySIM=function(t,e,n,r){return this.m_worker.postMessage("ReadPrivateKeySIM",Array.prototype.slice.call(arguments))},t.prototype.ReadPrivateKeyKSP=function(t,e,n,r,i,o){return this.m_worker.postMessage("ReadPrivateKeyKSP",Array.prototype.slice.call(arguments))},t.prototype.GetOwnCertificates=function(){return this.m_worker.postMessage("GetOwnCertificates",Array.prototype.slice.call(arguments))},t.prototype.GetOwnEUserParams=function(){return this.m_worker.postMessage("GetOwnEUserParams",Array.prototype.slice.call(arguments))},t.prototype.ChangeOwnCertificatesStatus=function(t,e){return this.m_worker.postMessage("ChangeOwnCertificatesStatus",Array.prototype.slice.call(arguments))},t.prototype.MakeNewCertificate=function(t,e,n,r,i,o,s,a,u,c,l,f,_,p,h,E,y,S){return void 0===E&&(E=!1),void 0===y&&(y=null),void 0===S&&(S=null),this.m_worker.postMessage("MakeNewCertificate",Array.prototype.slice.call(arguments))},t.prototype.MakeDeviceCertificate=function(t,e,n,r,i){return this.m_worker.postMessage("MakeDeviceCertificate",Array.prototype.slice.call(arguments))},t.prototype.SetKeyMediaUserPassword=function(t,e){return this.m_worker.postMessage("SetKeyMediaUserPassword",Array.prototype.slice.call(arguments))},t.prototype.ChangePrivateKeyPassword=function(t,e){return this.m_worker.postMessage("ChangePrivateKeyPassword",Array.prototype.slice.call(arguments))},t.prototype.ChangePrivateKeyPasswordBinary=function(t,e,n){return this.m_worker.postMessage("ChangePrivateKeyPasswordBinary",Array.prototype.slice.call(arguments))},t.prototype.GeneratePrivateKey=function(t,e,n,r,i,o,s,a,u,c,l,f){return this.m_worker.postMessage("GeneratePrivateKey",Array.prototype.slice.call(arguments))},t.prototype.GeneratePrivateKeyBinary=function(t,e,n,r,i,o,s,a,u,c,l){return this.m_worker.postMessage("GeneratePrivateKeyBinary",Array.prototype.slice.call(arguments))},t.prototype.GetKeyInfo=function(t){return this.m_worker.postMessage("GetKeyInfo",Array.prototype.slice.call(arguments))},t.prototype.GetKeyInfoBinary=function(t,e){return this.m_worker.postMessage("GetKeyInfoBinary",Array.prototype.slice.call(arguments))},t.prototype.GetClientRegistrationTokenKSP=function(t,e){return void 0===e&&(e=null),this.m_worker.postMessage("GetClientRegistrationTokenKSP",Array.prototype.slice.call(arguments))},t.prototype.HashData=function(t,e,n){return this.m_worker.postMessage("HashData",Array.prototype.slice.call(arguments))},t.prototype.GetSigner=function(t,e,n){return void 0===e&&(e=-1),void 0===n&&(n=!1),this.m_worker.postMessage("GetSigner",Array.prototype.slice.call(arguments))},t.prototype.SignData=function(t,e){return void 0===e&&(e=!1),this.m_worker.postMessage("SignData",Array.prototype.slice.call(arguments))},t.prototype.SignDataInternal=function(t,e,n){return void 0===n&&(n=!1),this.m_worker.postMessage("SignDataInternal",Array.prototype.slice.call(arguments))},t.prototype.SignHash=function(t,e,n,r){return this.m_worker.postMessage("SignHash",Array.prototype.slice.call(arguments))},t.prototype.SignDataEx=function(t,e,n,r,i){return this.m_worker.postMessage("SignDataEx",Array.prototype.slice.call(arguments))},t.prototype.AppendSign=function(t,e,n,r,i){return this.m_worker.postMessage("AppendSign",Array.prototype.slice.call(arguments))},t.prototype.AppendSignHash=function(t,e,n,r,i){return this.m_worker.postMessage("AppendSignHash",Array.prototype.slice.call(arguments))},t.prototype.VerifyHash=function(t,e,n){return void 0===n&&(n=-1),this.m_worker.postMessage("VerifyHash",Array.prototype.slice.call(arguments))},t.prototype.VerifyData=function(t,e,n){return void 0===n&&(n=-1),this.m_worker.postMessage("VerifyData",Array.prototype.slice.call(arguments))},t.prototype.VerifyDataInternal=function(t,e){return void 0===e&&(e=-1),this.m_worker.postMessage("VerifyDataInternal",Array.prototype.slice.call(arguments))},t.prototype.EnvelopData=function(t,e,n,r,i,o){return void 0===o&&(o=!1),this.m_worker.postMessage("EnvelopData",Array.prototype.slice.call(arguments))},t.prototype.DevelopData=function(t,e){return this.m_worker.postMessage("DevelopData",Array.prototype.slice.call(arguments))},t.prototype.CreateAuthData=function(t,e,n){return this.m_worker.postMessage("CreateAuthData",Array.prototype.slice.call(arguments))},t.prototype.ProtectDataByPassword=function(t,e,n){return this.m_worker.postMessage("ProtectDataByPassword",Array.prototype.slice.call(arguments))},t.prototype.UnprotectDataByPassword=function(t,e,n){return this.m_worker.postMessage("UnprotectDataByPassword",Array.prototype.slice.call(arguments))},t.prototype.GetTSPByAccessInfo=function(t,e,n,r,i){return this.m_worker.postMessage("GetTSPByAccessInfo",Array.prototype.slice.call(arguments))},t.prototype.CheckTSP=function(t,e,n){return this.m_worker.postMessage("CheckTSP",Array.prototype.slice.call(arguments))},t.prototype.CtxCreate=function(){return this.m_worker.postMessage("CtxCreate",Array.prototype.slice.call(arguments))},t.prototype.CtxFree=function(t){return this.m_worker.postMessage("CtxFree",Array.prototype.slice.call(arguments))},t.prototype.CtxSetParameter=function(t,e,n){return this.m_worker.postMessage("CtxSetParameter",Array.prototype.slice.call(arguments))},t.prototype.CtxReadPrivateKey=function(t,e,n,r){return this.m_worker.postMessage("CtxReadPrivateKey",Array.prototype.slice.call(arguments))},t.prototype.CtxReadPrivateKeyBinary=function(t,e,n,r,i){return this.m_worker.postMessage("CtxReadPrivateKeyBinary",Array.prototype.slice.call(arguments))},t.prototype.CtxFreePrivateKey=function(t){return this.m_worker.postMessage("CtxFreePrivateKey",Array.prototype.slice.call(arguments))},t.prototype.CtxGetOwnCertificates=function(t){return this.m_worker.postMessage("CtxGetOwnCertificates",Array.prototype.slice.call(arguments))},t.prototype.CtxSignHash=function(t,e,n,r,i){return this.m_worker.postMessage("CtxSignHash",Array.prototype.slice.call(arguments))},t.prototype.CtxSignData=function(t,e,n,r,i,o){return this.m_worker.postMessage("CtxSignData",Array.prototype.slice.call(arguments))},t.prototype.CtxAppendSignHash=function(t,e,n,r,i,o){return this.m_worker.postMessage("CtxAppendSignHash",Array.prototype.slice.call(arguments))},t.prototype.CtxAppendSign=function(t,e,n,r,i,o){return this.m_worker.postMessage("CtxAppendSign",Array.prototype.slice.call(arguments))},t.prototype.CtxGetSignValue=function(t,e,n,r){return this.m_worker.postMessage("CtxGetSignValue",Array.prototype.slice.call(arguments))},t.prototype.CtxEnvelopData=function(t,e,n,r,i,o,s){return this.m_worker.postMessage("CtxEnvelopData",Array.prototype.slice.call(arguments))},t.prototype.CtxDevelopData=function(t,e,n){return this.m_worker.postMessage("CtxDevelopData",Array.prototype.slice.call(arguments))},t.prototype.ProtectTaxReports=function(t,e,n,r,i,o,s){return void 0===t&&(t=null),void 0===e&&(e=null),void 0===n&&(n=null),void 0===s&&(s=!1),this.m_worker.postMessage("ProtectTaxReports",Array.prototype.slice.call(arguments))},t.prototype.UnprotectTaxReceipts=function(t,e){return this.m_worker.postMessage("UnprotectTaxReceipts",Array.prototype.slice.call(arguments))},t.prototype.ASiCGetSigner=function(t,e,n){return this.m_worker.postMessage("ASiCGetSigner",Array.prototype.slice.call(arguments))},t.prototype.ASiCSignData=function(t,e,n,r,i,o){return this.m_worker.postMessage("ASiCSignData",Array.prototype.slice.call(arguments))},t.prototype.ASiCAppendSign=function(t,e,n,r,i){return this.m_worker.postMessage("ASiCAppendSign",Array.prototype.slice.call(arguments))},t.prototype.ASiCVerifyData=function(t,e){return void 0===e&&(e=-1),this.m_worker.postMessage("ASiCVerifyData",Array.prototype.slice.call(arguments))},t.prototype.PDFSignData=function(t,e,n,r){return this.m_worker.postMessage("PDFSignData",Array.prototype.slice.call(arguments))},t.prototype.PDFVerifyData=function(t,e){return void 0===e&&(e=-1),this.m_worker.postMessage("PDFVerifyData",Array.prototype.slice.call(arguments))},t.prototype.PDFGetSigner=function(t,e,n){return void 0===e&&(e=-1),void 0===n&&(n=!1),this.m_worker.postMessage("PDFGetSigner",Array.prototype.slice.call(arguments))},t.prototype.XAdESGetSigner=function(t,e,n){return void 0===e&&(e=-1),void 0===n&&(n=!1),this.m_worker.postMessage("XAdESGetSigner",Array.prototype.slice.call(arguments))},t.prototype.XAdESSignData=function(t,e,n,r,i){return this.m_worker.postMessage("XAdESSignData",Array.prototype.slice.call(arguments))},t.prototype.XAdESVerifyData=function(t,e,n){return void 0===n&&(n=-1),this.m_worker.postMessage("XAdESVerifyData",Array.prototype.slice.call(arguments))},t.prototype.GetSignContainerInfo=function(t){return this.m_worker.postMessage("GetSignContainerInfo",Array.prototype.slice.call(arguments))},t}(),U=n(19),b=function(){function t(t,e,n){switch(void 0===e&&(e=h.EndUserLibraryType.JS),void 0===n&&(n=5),e){case h.EndUserLibraryType.SW:this.m_library=new U.a;break;case h.EndUserLibraryType.JS:case h.EndUserLibraryType.MS:default:this.m_library=new I(t,n)}}return t.prototype.AddEventListener=function(t,e){return this.m_library.AddEventListener(t,e)},t.prototype.GetLibraryInfo=function(t){return this.m_library.GetLibraryInfo(t)},t.prototype.IsInitialized=function(){return this.m_library.IsInitialized()},t.prototype.Initialize=function(t){return this.m_library.Initialize(t)},t.prototype.SetLanguage=function(t){return this.m_library.SetLanguage(t)},t.prototype.SetRuntimeParameter=function(t,e){return this.m_library.SetRuntimeParameter(t,e)},t.prototype.GetStorageParameter=function(t,e){return void 0===e&&(e=!1),this.m_library.GetStorageParameter(t,e)},t.prototype.SetStorageParameter=function(t,e,n){return void 0===n&&(n=!1),this.m_library.SetStorageParameter(t,e,n)},t.prototype.GetCAs=function(){return this.m_library.GetCAs()},t.prototype.GetProxySettings=function(){return this.m_library.GetProxySettings()},t.prototype.SetProxySettings=function(t){return this.m_library.SetProxySettings(t)},t.prototype.GetHostInfo=function(){return this.m_library.GetHostInfo()},t.prototype.GetKeyMedias=function(){return this.m_library.GetKeyMedias()},t.prototype.GetJKSPrivateKeys=function(t){return this.m_library.GetJKSPrivateKeys(t)},t.prototype.IsPrivateKeyReaded=function(){return this.m_library.IsPrivateKeyReaded()},t.prototype.ResetPrivateKey=function(){return this.m_library.ResetPrivateKey()},t.prototype.ResetOperationKSP=function(){return this.m_library.ResetOperationKSP()},t.prototype.ReadPrivateKey=function(t,e,n){return this.m_library.ReadPrivateKey(t,e,n)},t.prototype.ReadPrivateKeyBinary=function(t,e,n,r){return this.m_library.ReadPrivateKeyBinary(t,e,n,r)},t.prototype.ReadPrivateKeySIM=function(t,e,n,r){return void 0===n&&(n=!0),void 0===r&&(r=0),this.m_library.ReadPrivateKeySIM(t,e,n,r)},t.prototype.ReadPrivateKeyKSP=function(t,e,n,r,i,o){return void 0===n&&(n=!0),void 0===r&&(r=0),void 0===i&&(i=null),void 0===o&&(o=null),this.m_library.ReadPrivateKeyKSP(t,e,n,r,i,o)},t.prototype.GetOwnCertificates=function(){return this.m_library.GetOwnCertificates()},t.prototype.GetOwnEUserParams=function(){return this.m_library.GetOwnEUserParams()},t.prototype.ChangeOwnCertificatesStatus=function(t,e){return this.m_library.ChangeOwnCertificatesStatus(t,e)},t.prototype.MakeNewCertificate=function(t,e,n,r,i,o,s,a,u,c,l,f,_,p,h,E,y,S){return void 0===E&&(E=!1),void 0===y&&(y=null),void 0===S&&(S=null),this.m_library.MakeNewCertificate(t,e,n,r,i,o,s,a,u,c,l,f,_,p,h,E,y,S)},t.prototype.MakeDeviceCertificate=function(t,e,n,r,i){return this.m_library.MakeDeviceCertificate(t,e,n,r,i)},t.prototype.SetKeyMediaUserPassword=function(t,e){return this.m_library.SetKeyMediaUserPassword(t,e)},t.prototype.ChangePrivateKeyPassword=function(t,e){return this.m_library.ChangePrivateKeyPassword(t,e)},t.prototype.ChangePrivateKeyPasswordBinary=function(t,e,n){return this.m_library.ChangePrivateKeyPasswordBinary(t,e,n)},t.prototype.GeneratePrivateKey=function(t,e,n,r,i,o,s,a,u,c,l,f){return this.m_library.GeneratePrivateKey(t,e,n,r,i,o,s,a,u,c,l,f)},t.prototype.GeneratePrivateKeyBinary=function(t,e,n,r,i,o,s,a,u,c,l){return this.m_library.GeneratePrivateKeyBinary(t,e,n,r,i,o,s,a,u,c,l)},t.prototype.GetKeyInfo=function(t){return this.m_library.GetKeyInfo(t)},t.prototype.GetKeyInfoBinary=function(t,e){return this.m_library.GetKeyInfoBinary(t,e)},t.prototype.GetClientRegistrationTokenKSP=function(t,e){return this.m_library.GetClientRegistrationTokenKSP(t,e)},t.prototype.HashData=function(t,e,n){return this.m_library.HashData(t,e,n)},t.prototype.GetSigner=function(t,e,n){return this.m_library.GetSigner(t,e,n)},t.prototype.SignData=function(t,e){return void 0===e&&(e=!1),this.m_library.SignData(t,e)},t.prototype.SignDataInternal=function(t,e,n){return void 0===n&&(n=!1),this.m_library.SignDataInternal(t,e,n)},t.prototype.SignHash=function(t,e,n,r){return void 0===r&&(r=!1),this.m_library.SignHash(t,e,n,r)},t.prototype.SignDataEx=function(t,e,n,r,i){return void 0===i&&(i=!1),this.m_library.SignDataEx(t,e,n,r,i)},t.prototype.AppendSign=function(t,e,n,r,i){return void 0===i&&(i=!1),this.m_library.AppendSign(t,e,n,r,i)},t.prototype.AppendSignHash=function(t,e,n,r,i){return this.m_library.AppendSignHash(t,e,n,r,i)},t.prototype.VerifyHash=function(t,e,n){return void 0===n&&(n=-1),this.m_library.VerifyHash(t,e,n)},t.prototype.VerifyData=function(t,e,n){return void 0===n&&(n=-1),this.m_library.VerifyData(t,e,n)},t.prototype.VerifyDataInternal=function(t,e){return void 0===e&&(e=-1),this.m_library.VerifyDataInternal(t,e)},t.prototype.EnvelopData=function(t,e,n,r,i,o){return void 0===o&&(o=!1),this.m_library.EnvelopData(t,e,n,r,i,o)},t.prototype.DevelopData=function(t,e){return this.m_library.DevelopData(t,e)},t.prototype.ProtectDataByPassword=function(t,e,n){return this.m_library.ProtectDataByPassword(t,e,n)},t.prototype.UnprotectDataByPassword=function(t,e,n){return this.m_library.UnprotectDataByPassword(t,e,n)},t.prototype.CreateAuthData=function(t,e,n){return this.m_library.CreateAuthData(t,e,n)},t.prototype.GetTSPByAccessInfo=function(t,e,n,r,i){return this.m_library.GetTSPByAccessInfo(t,e,n,r,i)},t.prototype.CheckTSP=function(t,e,n){return this.m_library.CheckTSP(t,e,n)},t.prototype.CtxCreate=function(){return this.m_library.CtxCreate()},t.prototype.CtxFree=function(t){return this.m_library.CtxFree(t)},t.prototype.CtxSetParameter=function(t,e,n){return this.m_library.CtxSetParameter(t,e,n)},t.prototype.CtxReadPrivateKey=function(t,e,n,r){return void 0===t&&(t=null),this.m_library.CtxReadPrivateKey(t,e,n,r)},t.prototype.CtxReadPrivateKeyBinary=function(t,e,n,r,i){return void 0===t&&(t=null),this.m_library.CtxReadPrivateKeyBinary(t,e,n,r,i)},t.prototype.CtxFreePrivateKey=function(t){return this.m_library.CtxFreePrivateKey(t)},t.prototype.CtxGetOwnCertificates=function(t){return this.m_library.CtxGetOwnCertificates(t)},t.prototype.CtxSignHash=function(t,e,n,r,i){return this.m_library.CtxSignHash(t,e,n,r,i)},t.prototype.CtxSignData=function(t,e,n,r,i,o){return this.m_library.CtxSignData(t,e,n,r,i,o)},t.prototype.CtxAppendSignHash=function(t,e,n,r,i,o){return this.m_library.CtxAppendSignHash(t,e,n,r,i,o)},t.prototype.CtxAppendSign=function(t,e,n,r,i,o){return this.m_library.CtxAppendSign(t,e,n,r,i,o)},t.prototype.CtxGetSignValue=function(t,e,n,r){return this.m_library.CtxGetSignValue(t,e,n,r)},t.prototype.CtxEnvelopData=function(t,e,n,r,i,o,s){return this.m_library.CtxEnvelopData(t,e,n,r,i,o,s)},t.prototype.CtxDevelopData=function(t,e,n){return this.m_library.CtxDevelopData(t,e,n)},t.prototype.ProtectTaxReports=function(t,e,n,r,i,o,s){return void 0===t&&(t=null),void 0===e&&(e=null),void 0===n&&(n=null),this.m_library.ProtectTaxReports(t,e,n,r,i,o,s)},t.prototype.UnprotectTaxReceipts=function(t,e){return this.m_library.UnprotectTaxReceipts(t,e)},t.prototype.ASiCGetSigner=function(t,e,n){return this.m_library.ASiCGetSigner(t,e,n)},t.prototype.ASiCSignData=function(t,e,n,r,i,o){return this.m_library.ASiCSignData(t,e,n,r,i,o)},t.prototype.ASiCAppendSign=function(t,e,n,r,i){return this.m_library.ASiCAppendSign(t,e,n,r,i)},t.prototype.ASiCVerifyData=function(t,e){return this.m_library.ASiCVerifyData(t,e)},t.prototype.PDFGetSigner=function(t,e,n){return this.m_library.PDFGetSigner(t,e,n)},t.prototype.PDFSignData=function(t,e,n,r){return this.m_library.PDFSignData(t,e,n,r)},t.prototype.PDFVerifyData=function(t,e){return this.m_library.PDFVerifyData(t,e)},t.prototype.XAdESGetSigner=function(t,e,n){return this.m_library.XAdESGetSigner(t,e,n)},t.prototype.XAdESSignData=function(t,e,n,r,i){return this.m_library.XAdESSignData(t,e,n,r,i)},t.prototype.XAdESVerifyData=function(t,e,n){return this.m_library.XAdESVerifyData(t,e,n)},t.prototype.GetSignContainerInfo=function(t){return this.m_library.GetSignContainerInfo(t)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0),i=function(){this.type=r.EndUserSignContainerType.Unknown,this.subType=r.EndUserCAdESType.Unknown,this.asicSignType=r.EndUserASiCSignType.Unknown}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"d",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return s}));var r=function(){},i=function(){},o=function(){},s=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));var r=function(){},i=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}));var r=function(){this.version=null,this.supported=!1,this.loaded=!1},i=function(){this.version=null,this.supported=!1,this.loaded=!1,this.isSignAgentSupported=!1,this.isWebExtensionSupported=!1,this.isNPAPISupported=!1,this.isActiveXSupported=!1,this.isWebExtensionInstalled=!1,this.isNativeLibraryNeedUpdate=!1,this.nativeLibraryInstallURL=null,this.nativeLibraryUpdateURL=null,this.webExtensionInstallURL=null,this.helpURL=null}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){(function(e,r){var i;
2
+ /*!
3
+ * @overview es6-promise - a tiny implementation of Promises/A+.
4
+ * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
5
+ * @license Licensed under MIT license
6
+ * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
7
+ * @version 3.3.1
8
8
  */i=function(){"use strict";function t(t){return"function"==typeof t}var i=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},o=0,s=void 0,a=void 0,u=function(t,e){E[o]=t,E[o+1]=e,2===(o+=2)&&(a?a(y):R())},c="undefined"!=typeof window?window:void 0,l=c||{},f=l.MutationObserver||l.WebKitMutationObserver,_="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),p="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var t=setTimeout;return function(){return t(y,1)}}var E=new Array(1e3);function y(){for(var t=0;t<o;t+=2)(0,E[t])(E[t+1]),E[t]=void 0,E[t+1]=void 0;o=0}var S,C,d,A,R=void 0;function m(t,e){var n=arguments,r=this,i=new this.constructor(P);void 0===i[g]&&x(i);var o,s=r._state;return s?(o=n[s-1],u((function(){return K(s,i,o,r._result)}))):N(r,i,t,e),i}function T(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(P);return b(e,t),e}_?R=function(){return e.nextTick(y)}:f?(C=0,d=new f(y),A=document.createTextNode(""),d.observe(A,{characterData:!0}),R=function(){A.data=C=++C%2}):p?((S=new MessageChannel).port1.onmessage=y,R=function(){return S.port2.postMessage(0)}):R=void 0===c?function(){try{var t=n(23);return s=t.runOnLoop||t.runOnContext,function(){s(y)}}catch(t){return h()}}():h();var g=Math.random().toString(36).substring(16);function P(){}var v=new M;function I(t){try{return t.then}catch(t){return v.error=t,v}}function U(e,n,r){n.constructor===e.constructor&&r===m&&n.constructor.resolve===T?function(t,e){1===e._state?O(t,e._result):2===e._state?G(t,e._result):N(e,void 0,(function(e){return b(t,e)}),(function(e){return G(t,e)}))}(e,n):r===v?G(e,v.error):void 0===r?O(e,n):t(r)?function(t,e,n){u((function(t){var r=!1,i=function(t,e,n,r){try{t.call(e,n,r)}catch(t){return t}}(n,e,(function(n){r||(r=!0,e!==n?b(t,n):O(t,n))}),(function(e){r||(r=!0,G(t,e))}),t._label);!r&&i&&(r=!0,G(t,i))}),t)}(e,n,r):O(e,n)}function b(t,e){var n;t===e?G(t,new TypeError("You cannot resolve a promise with itself")):"function"==typeof(n=e)||"object"==typeof n&&null!==n?U(t,e,I(e)):O(t,e)}function D(t){t._onerror&&t._onerror(t._result),w(t)}function O(t,e){void 0===t._state&&(t._result=e,t._state=1,0!==t._subscribers.length&&u(w,t))}function G(t,e){void 0===t._state&&(t._state=2,t._result=e,u(D,t))}function N(t,e,n,r){var i=t._subscribers,o=i.length;t._onerror=null,i[o]=e,i[o+1]=n,i[o+2]=r,0===o&&t._state&&u(w,t)}function w(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,i=void 0,o=t._result,s=0;s<e.length;s+=3)r=e[s],i=e[s+n],r?K(n,r,i,o):i(o);t._subscribers.length=0}}function M(){this.error=null}var L=new M;function K(e,n,r,i){var o=t(r),s=void 0,a=void 0,u=void 0,c=void 0;if(o){if((s=function(t,e){try{return t(e)}catch(t){return L.error=t,L}}(r,i))===L?(c=!0,a=s.error,s=null):u=!0,n===s)return void G(n,new TypeError("A promises callback cannot return that same promise."))}else s=i,u=!0;void 0!==n._state||(o&&u?b(n,s):c?G(n,a):1===e?O(n,s):2===e&&G(n,s))}var k=0;function x(t){t[g]=k++,t._state=void 0,t._result=void 0,t._subscribers=[]}function B(t,e){this._instanceConstructor=t,this.promise=new t(P),this.promise[g]||x(this.promise),i(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?O(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&O(this.promise,this._result))):G(this.promise,new Error("Array Methods must be provided an Array"))}function F(t){this[g]=k++,this._result=this._state=void 0,this._subscribers=[],P!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof F?function(t,e){try{e((function(e){b(t,e)}),(function(e){G(t,e)}))}catch(e){G(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}function H(){var t=void 0;if(void 0!==r)t=r;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var n=null;try{n=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===n&&!e.cast)return}t.Promise=F}return B.prototype._enumerate=function(){for(var t=this.length,e=this._input,n=0;void 0===this._state&&n<t;n++)this._eachEntry(e[n],n)},B.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===T){var i=I(t);if(i===m&&void 0!==t._state)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(n===F){var o=new n(P);U(o,t,i),this._willSettleAt(o,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(r(t),e)},B.prototype._settledAt=function(t,e,n){var r=this.promise;void 0===r._state&&(this._remaining--,2===t?G(r,n):this._result[e]=n),0===this._remaining&&O(r,this._result)},B.prototype._willSettleAt=function(t,e){var n=this;N(t,void 0,(function(t){return n._settledAt(1,e,t)}),(function(t){return n._settledAt(2,e,t)}))},F.all=function(t){return new B(this,t).promise},F.race=function(t){var e=this;return i(t)?new e((function(n,r){for(var i=t.length,o=0;o<i;o++)e.resolve(t[o]).then(n,r)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},F.resolve=T,F.reject=function(t){var e=new this(P);return G(e,t),e},F._setScheduler=function(t){a=t},F._setAsap=function(t){u=t},F._asap=u,F.prototype={constructor:F,then:m,catch:function(t){return this.then(null,t)}},H(),F.polyfill=H,F.Promise=F,F},t.exports=i()}).call(this,n(21),n(22))},function(t,e,n){"use strict";(function(t){var n=function(t,e,n){this.id=t,this.cmd=e,this.params=n,this.origin=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""),this.pathname=window.location.pathname},r=function(t,e,n,r){this.id=t,this.cmd=e,this.result=n,this.error=r},i=function(){function e(t,e,n){var r=this;this.m_worker=this.loadWorker(t,e),this.m_worker.onmessage=function(t){var e=t.data;if(-2!=e.id){var i=r.m_promises[e.id-1];i&&(delete r.m_promises[e.id-1],e.error?i.reject(e.error):i.resolve(e.result))}else n(e.result)},this.m_worker.onerror=function(t){r.m_promises.forEach((function(e){e.reject(t.error)})),r.m_promises=new Array},this.m_promises=new Array}return e.prototype.loadWorker=function(t,e){try{if(!t)throw"No worker content";try{var n,r=window,i=r.URL||r.webkitURL;try{(n=new(r.BlobBuilder||r.WebKitBlobBuilder||r.MozBlobBuilder||r.MSBlobBuilder)).append(t),n=n.getBlob()}catch(e){n=new Blob([t])}return new Worker(i.createObjectURL(n))}catch(e){return new Worker("data:application/javascript,"+encodeURIComponent(t))}}catch(t){if(!e)throw Error("Inline worker is not supported");return new Worker(e)}},e.prototype.postMessage=function(e,r){var i=this,o=new n(-1,e,r),s=new t((function(t,e){o.id=i.m_promises.push({resolve:t,reject:e})}));return this.m_worker.postMessage(o),s},e}();e.a=i;!function(){function t(t){this.m_context=t,this.m_initialized=!1;var e=this;self.onmessage=function(t){e.onMessage(t.data)}}t.prototype.postMessage=function(t,e,n,i){var o=new r(t,e,n,i);self.postMessage(o)},t.prototype.onMessage=function(t){var e=this;this.m_initialized?this.m_context[t.cmd].apply(this.m_context,t.params).then((function(n){e.postMessage(t.id,t.cmd,n)}),(function(n){e.postMessage(t.id,t.cmd,null,n)})):setTimeout((function(){e.onMessage(t)}),50)},t.prototype.initialize=function(){this.m_initialized=!0}}()}).call(this,n(17).Promise)},function(t,e,n){"use strict";(function(t){var r=n(1),i=n(9),o=n(10),s=n(14),a=n(20),u=n(4),c=n(13),l=n(2),f=n(8),_=n(0),p=n(11),h=n(15),E=n(16),y=n(7),S=n(5),C=n(12),d=n(6),A=function(){},R=function(){function e(){this.GetDefaultTSPSettings=function(){for(var t=null,e=this.m_settings.CAs,n=0;n<e.length&&(!e[n].tspAddress||!e[n].tspAddressPort||(t&&"80"!=e[n].tspAddressPort||(t=e[n]),"80"!=t.tspAddressPort));n++);return t},this.MakeExpireDate=function(t){t||(t=300);var e=new Date;return e.setTime(e.getTime()+1e3*t),e},this.m_library=new a.a,this.m_settings=null,this.m_initialized=!1,this.m_kmTypes=null,this.m_kmActiveOperation=!1,this.m_context=null,this.m_pkContext=null,this.m_eventListeners=new Array,this.m_resolveOIDs=!1,this.m_origin=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")}return e.prototype.MapError=function(t){var e=new r.EndUserError;return void 0!==t.GetErrorCode&&void 0!==t.GetMessage?(e.code=t.GetErrorCode(),e.message=t.GetMessage()):void 0!==t.code&&void 0!==t.message?(e.code=t.code,e.message=t.message):(e.code=r.EU_ERROR_UNKNOWN,e.message=t.toString()),e},e.prototype.ProcessArray=function(e,n){var r=this;return new t((function(t,i){var o=Array(),s=0,a=function(){s>=e.length?t(o):(n(e[s]).then((function(t){o.push(t),a()})).catch((function(t){return i(r.MapError(t))})),s++)};a()}))},e.prototype.DataToNamedDataArray=function(t){t=null!=t?t:[],t=Array.isArray(t)?t:[t];for(var e=[],n=0;n<t.length;n++){var r=void 0!==t[n].name&&void 0!==t[n].val;e.push({name:r?t[n].name:"Ім'я відсутнє",val:r?t[n].val:t[n]})}return e},e.prototype.DataToResult=function(t,e){for(var n=[],r=!Array.isArray(t),i=r?[t]:t,o=0;o<i.length;o++){var s=void 0!==i[o].name&&void 0!==i[o].val?{name:i[o].name,val:e[o]}:e[o];n.push(s)}return r?n[0]:n},e.prototype.OnEvent=function(t){try{var e=this.m_eventListeners[t.type]||this.m_eventListeners[_.EndUserEventType.All];e&&e(t)}catch(t){}},e.prototype.CheckInitialize=function(){var e=this,n=e.m_library;return new t((function(t,i){e.m_initialized?t():n.Load().then((function(){throw n.MakeError(r.EU_ERROR_NOT_INITIALIZED,"")})).catch((function(t){return i(e.MapError(t))}))}))},e.prototype.BeginKMOperation=function(){var e=this;return new t((function(t,n){var r=function(){e.m_kmActiveOperation?setTimeout(r,10):(e.m_kmActiveOperation=!0,t())};r()}))},e.prototype.EndKMOperation=function(){this.m_kmActiveOperation=!1},e.prototype.GetCASettings=function(t){if(!t)return null;for(var e=this.m_settings.CAs,n=0;n<e.length;n++)for(var r=e[n].issuerCNs,i=0;i<r.length;i++)if(r[i]==t)return e[n];return null},e.prototype.IsCMPCompatible=function(t,e){return!!t.cmpAddress&&(void 0===t.cmpCompatibility||(t.cmpCompatibility&e)==e)},e.prototype.SetCMPSettings=function(e){var n=this,i=n.m_library,o=this.GetCASettings(e);return new t((function(t,s){if(e&&null==o)throw i.MakeError(r.EU_ERROR_WRITE_SETTINGS,"");var a;a=!(!o||!o.cmpAddress);var u=i.CreateCMPSettings();u.SetUseCMP(a),a&&(u.SetAddress(o.cmpAddress),u.SetPort("80")),i.SetCMPSettings(u).then((function(){t()})).catch((function(t){s(n.MapError(t))}))}))},e.prototype.GetJKSPrivateKey=function(e,n){var r=this,i=r.m_library;return new t((function(t,o){var a={alias:null,info:null};i.EnumJKSPrivateKeys(e,n).then((function(n){if(null!=n)return a.alias=n,i.GetJKSPrivateKey(e,n);t(null)})).then((function(t){a.info=t;for(var e=new Array,n=0;n<t.GetCertificatesCount();n++)e.push(t.GetCertificate(n));return r.ProcessArray(e,(function(t){return i.ParseCertificateEx(t)}))})).then((function(e){var n=new s.a;n.alias=a.alias,n.privateKey=a.info.GetPrivateKey(),n.certificates=new Array,n.digitalStamp=!1;for(var r=0;r<e.length;r++){var o=e[r];if(o.GetSubjType()==i.EU_SUBJECT_TYPE_END_USER){o.GetPublicKeyType()==i.EU_CERT_KEY_TYPE_DSTU4145&&(o.GetKeyUsageType()&i.EU_KEY_USAGE_DIGITAL_SIGNATURE)==i.EU_KEY_USAGE_DIGITAL_SIGNATURE&&(n.digitalStamp=o.GetExtKeyUsages().indexOf(i.EU_UA_OID_EXT_KEY_USAGE_STAMP)>-1);var c=new u.EndUserCertificate;c.data=a.info.GetCertificate(r),c.infoEx=l.a.MapToEndUserCertificateInfoEx(o,new f.a),n.certificates.push(c)}}n.digitalStamp=!1,t(n)})).catch((function(t){return o(r.MapError(t))}))}))},e.prototype.SaveCertificatesInternal=function(e){var n=this,r=this.m_library;return new t((function(t,i){e?Array.isArray(e)?n.ProcessArray(e,(function(t){return r.SaveCertificate(t)})).then((function(){return t()})).catch((function(t){return i(t)})):r.SaveCertificates(e).then((function(){return t()})).catch((function(t){return i(t)})):t()}))},e.prototype.CtxReadPrivateKeyInternal=function(e,n,i,o,s,a){var u=this,c=this.m_library,l={pkContext:null};return e||(e=u.m_context),new t((function(t,f){u.SaveCertificatesInternal(s).then((function(){return u.SetCMPSettings(a)})).then((function(){return null!=n&&null!=i?c.CtxReadPrivateKeyBinary(e,n,i):c.CtxReadPrivateKey(e,o)})).then((function(t){l.pkContext=t;var e=t.GetOwnerInfo();if(!a)return u.SetCMPSettings(e.GetIssuerCN());var n=u.GetCASettings(e.GetIssuerCN());if(!n||-1==n.issuerCNs.indexOf(a))throw c.MakeError(r.EU_ERROR_CERT_NOT_FOUND,"")})).then((function(){t(l.pkContext)})).catch((function(s){null==l.pkContext?u.MapError(s).code!=r.EU_ERROR_CERT_NOT_FOUND||a?f(u.MapError(s)):u.SearchPrivateKeyCertificatesWithCMP(n,i,o).then((function(t){return u.CtxReadPrivateKeyInternal(e,n,i,o,t.certs,t.CACommonName)})).then((function(e){t(e)})).catch((function(t){return f(u.MapError(t))})):c.CtxFreePrivateKey(l.pkContext).then((function(){f(u.MapError(s))})).catch((function(){f(u.MapError(s))}))}))}))},e.prototype.ReadPrivateKeyInternal=function(e,n,r,i,s){var a=this;return new t((function(t,u){a.ResetPrivateKeyInternal().then((function(){return a.CtxReadPrivateKeyInternal(a.m_context,e,n,r,i,s)})).then((function(e){a.m_pkContext=e;var n=l.a.MapEndUserOwnerInfo(e.GetOwnerInfo(),new o.a);t(n)})).catch((function(t){u(a.MapError(t))}))}))},e.prototype.ResetPrivateKeyInternal=function(){var e=this,n=this.m_library;return new t((function(t,r){null!=e.m_pkContext?n.CtxFreePrivateKey(e.m_pkContext).then((function(){e.m_pkContext=null,t()})).catch((function(t){return r(e.MapError(t))})):t()}))},e.prototype.SearchPrivateKeyCertificatesWithCMP=function(e,n,i,o){var s=this,a=s.m_library,u=s.m_settings.CAs;return new t((function(t,c){(null!=e&&null!=n?a.GetKeyInfoBinary(e,n):a.GetKeyInfo(i)).then((function(e){var n=function(i,l){if(i>=u.length){var f=a.MakeError(l?r.EU_ERROR_CERT_NOT_FOUND:r.EU_ERROR_TRANSMIT_REQUEST,"");c(s.MapError(f))}else{var p=o?_.EndUserCMPCompatibility.DownloadEUCerts:_.EndUserCMPCompatibility.SearchEUCerts;s.IsCMPCompatible(u[i],p)?o&&-1==u[i].issuerCNs.indexOf(o)?n(i+1,l):a.GetCertificatesByKeyInfo(e,[u[i].cmpAddress],["80"]).then((function(e){t({certs:e,CACommonName:u[i].issuerCNs[0]})})).catch((function(t){var e=t.GetErrorCode();if(e==r.EU_ERROR_CERT_NOT_FOUND||e==r.EU_ERROR_TRANSMIT_REQUEST)return l=l||e==r.EU_ERROR_CERT_NOT_FOUND,void n(i+1,l);c(s.MapError(t))})):n(i+1,l)}};n(0,!1)})).catch((function(t){return c(s.MapError(t))}))}))},e.prototype.GetUserCertificatesFromCertificates=function(e){var n=this,r=n.m_library;return new t((function(t,i){var o=new Array,s=function(a){r.GetCertificateFromSignedData(a,e).then((function(e){if(null!=e){var n=new u.EndUserCertificate;return n.data=e,o.push(n),r.ParseCertificateEx(e)}for(var i=new Array,s=0;s<o.length;s++){o[s].infoEx.subjType==r.EU_SUBJECT_TYPE_END_USER&&i.push(o[s])}t(i)})).then((function(t){o[a].infoEx=l.a.MapToEndUserCertificateInfoEx(t,new f.a),s(a+1)})).catch((function(t){return i(n.MapError(t))}))};s(0)}))},e.prototype.GeneratePrivateKeyInternal=function(e,n,r,i,o,s,a,u,c,f,_,p,h){var y=this,S=this.m_library;return new t((function(t,C){var d=null==e&&null==r,A=null!=r,R=S.CreatePrivateKeyInfo(),m=null;null!=p&&(m=l.a.MapFromEndUserInfo(p,S.CreateEndUserInfo())),S.GeneratePrivateKeyEx(d,e?e.GetTypeIndex():-1,e?e.GetDevIndex():-1,e?e.GetPassword():r,n,i,o,s,a,u,c,f,_,m,h,R,null!=r).then((function(e){for(var n=new Array,r=0;r<e.size();r++){var i=e.get(r);i=l.a.MapToEndUserRequestInfo(i,new E.a),n.push(i)}var o={key:A?R.GetPrivateKey():null,requests:n};t(o)})).catch((function(t){return C(y.MapError(t))}))}))},e.prototype.GetSignAlgoByCertificate=function(t){switch(t.GetInfoEx().GetPublicKeyType()){case _.EndUserCertKeyType.DSTU4145:return t.GetInfoEx().GetCertHashType()==_.EndUserCertHashType.GOST34311?_.EndUserSignAlgo.DSTU4145WithGOST34311:_.EndUserSignAlgo.DSTU4145WithDSTU7564;case _.EndUserCertKeyType.RSA:return _.EndUserSignAlgo.RSAWithSHA;case _.EndUserCertKeyType.ECDSA:return _.EndUserSignAlgo.ECDSAWithSHA;default:return _.EndUserSignAlgo.Unknown}},e.prototype.GetHashAlgoBySignAlgo=function(t){var e=this.m_library;switch(t){case _.EndUserSignAlgo.DSTU4145WithGOST34311:return _.EndUserHashAlgo.GOST34311;case _.EndUserSignAlgo.RSAWithSHA:case _.EndUserSignAlgo.ECDSAWithSHA:return _.EndUserHashAlgo.SHA256;case _.EndUserSignAlgo.DSTU4145WithDSTU7564:return _.EndUserHashAlgo.DSTU7564_256;default:throw e.MakeError(r.EU_ERROR_BAD_PARAMETER,"")}},e.prototype.CtxSignHashInternal=function(e,n,i,o,s,a){var u=this,c=this.m_library,l=null!=o,f=u.DataToNamedDataArray(i),_=u.DataToNamedDataArray(o);return new t((function(o,p){u.CheckInitialize().then((function(){if(null==e)throw c.MakeError(r.EU_ERROR_BAD_CERT,"");if(l&&f.length!=_.length)throw c.MakeError(r.EU_ERROR_BAD_PARAMETER,"");for(var i=new Array,o=0;o<f.length;o++)i.push({hash:f[o],previousSign:l?_[o]:null});return u.ProcessArray(i,(function(r){return new t((function(t,i){(l?c.CtxAppendSignHash(e,n,r.hash.val,r.previousSign.val,s):c.CtxSignHash(e,n,r.hash.val,s)).then((function(t){return a?t:c.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return i(t)}))}))}))})).then((function(t){var e=u.DataToResult(i,t);o(e)})).catch((function(t){return p(u.MapError(t))}))}))},e.prototype.CtxSignDataInternal=function(e,n,i,o,s,a,u){var c=this,l=this,f=this.m_library,p=null!=o,h=l.DataToNamedDataArray(i),E=l.DataToNamedDataArray(o);return new t((function(y,S){l.CheckInitialize().then((function(){if(null==e)throw f.MakeError(r.EU_ERROR_BAD_CERT,"");if(p&&s&&h.length!=E.length)throw f.MakeError(r.EU_ERROR_BAD_PARAMETER,"");return n!=_.EndUserSignAlgo.Unknown?null:f.CtxEnumOwnCertificates(e,0)})).then((function(t){if(n==_.EndUserSignAlgo.Unknown&&null!=t&&(n=l.GetSignAlgoByCertificate(t)),!s)return h;var e=l.GetHashAlgoBySignAlgo(n);return l.HashData(e,h,!0)})).then((function(r){for(var i=new Array,o=p?E.length:r.length,c=0;c<o;c++)i.push({dataOrHash:null!=r?r[c]:null,previousSign:p?E[c]:null});return l.ProcessArray(i,(function(r){return new t((function(t,i){(p?s?f.CtxAppendSignHash(e,n,r.dataOrHash.val,r.previousSign.val,a):f.CtxAppendSign(e,n,null,r.previousSign.val,a):s?f.CtxSignHash(e,n,r.dataOrHash.val,a):f.CtxSign(e,n,r.dataOrHash.val,!1,a)).then((function(t){return u?t:f.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return i(t)}))}))}))})).then((function(t){var e=c.DataToResult(p&&!s?o:i,t);y(e)})).catch((function(t){return S(l.MapError(t))}))}))},e.prototype.LoadTaxReportPKey=function(e,n,i){var o=this,s=this.m_library;return new t((function(t,a){var u=new A;if(Array.isArray(e)||(e=[e]),e.length>2)a(o.MapError(s.MakeError(r.EU_ERROR_BAD_PARAMETER,"")));else{var c=function(l,f){var p=n[l],h=e[f];s.CtxGetOwnCertificate(h,_.EndUserCertKeyType.DSTU4145,p).then((function(e){if(i&&p&_.EndUserKeyUsage.DigitalSignature&&!(e.GetInfoEx().GetExtKeyUsages().indexOf(s.EU_UA_OID_EXT_KEY_USAGE_STAMP)>-1))throw s.MakeError(r.EU_ERROR_BAD_PARAMETER,"");if(p&_.EndUserKeyUsage.DigitalSignature)u.signPKCtx=h,u.signCert=e;else{if(!(p&_.EndUserKeyUsage.KeyAgreement))throw s.MakeError(r.EU_ERROR_BAD_PARAMETER,"");u.envelopPKCtx=h,u.envelopCert=e}l+1<n.length?c(l+1,0):t(u)})).catch((function(t){if(t.GetErrorCode()==r.EU_ERROR_CERT_NOT_FOUND){if(f+1<e.length)return void c(l,f+1);t=s.MakeError(r.EU_ERROR_BAD_PARAMETER,"")}a(o.MapError(t))}))};c(0,0)}}))},e.prototype.ProtectTaxReport=function(e,n,i,o,s,a,u){var c=this,l=this.m_library,f=new p.b;f.name=a.name;var _=function(e,n){return new t((function(t,r){return l.CtxSign(e.signPKCtx,c.GetSignAlgoByCertificate(e.signCert),n,!1,!0).then((function(t){return l.BASE64Decode(t)})).then((function(t){return l.AppendCryptoHeader(l.EU_HEADER_CA_TYPE,l.EU_HEADER_PART_TYPE_SIGNED,t)})).then((function(e){t(e)})).catch((function(t){return r(c.MapError(t))}))}))},h=function(e,n){return new t((function(r,i){return l.CtxEnvelop(e.envelopPKCtx,[s],l.EU_RECIPIENT_APPEND_ISSUER_AND_SERIAL,!1,!1,n).then((function(t){return l.BASE64Decode(t)})).then((function(t){return l.AppendCryptoHeader(l.EU_HEADER_CA_TYPE,l.EU_HEADER_PART_TYPE_ENCRYPTED,t)})).then((function(n){var r=e.envelopCert,i=l.EU_KEY_USAGE_DIGITAL_SIGNATURE|l.EU_KEY_USAGE_KEY_AGREEMENT;return i==(r.GetInfoEx().GetKeyUsageType()&i)?n:function(e,n){return new t((function(t,r){return l.AppendCryptoHeader(l.EU_HEADER_CA_TYPE,l.EU_HEADER_PART_TYPE_CERTCRYPT,e).then((function(e){var r=new Uint8Array(e.byteLength+n.byteLength);r.set(new Uint8Array(e),0),r.set(new Uint8Array(n),e.byteLength),t(r)})).catch((function(t){return r(c.MapError(t))}))}))}(r.GetData(),n)})).then((function(t){return _(e,t)})).then((function(t){r({reportData:t,ownCert:e.envelopCert.GetData()})})).catch((function(t){return i(c.MapError(t))}))}))};return new t((function(s,p){new t((function(t,e){t(a.data)})).then((function(t){return null!=e?_(e,t):t})).then((function(t){return null!=n?_(n,t):t})).then((function(t){return null!=i?_(i,t):t})).then((function(t){return u&&(f.signedData=t),null!=n||null!=i?h(null!=i?i:n,t):{reportData:t,ownCert:e.signCert.GetData()}})).then((function(t){return l.AppendTransportHeader(l.EU_HEADER_CA_TYPE,a.name,o,t.ownCert,t.reportData)})).then((function(t){f.data=t,f.error=c.MapError(l.MakeError(r.EU_ERROR_NONE,"")),s(f)})).catch((function(t){f.error=c.MapError(t),s(f)}))}))},e.prototype.UnprotectTaxReceipt=function(e,n){var i=this,o=this.m_library,s=new p.a;s.data=null,s.receiptNumber=0,s.initiators=[],s.error=null;return new t((function(a,u){var c;(c=n.data,new t((function(t,e){o.ParseTransportHeader(c).then((function(e){s.receiptNumber=e.GetReceiptNumber(),t(e.GetCryptoData())})).catch((function(n){n.GetErrorCode()==r.EU_ERROR_PKI_FORMATS_FAILED?t(c):e(i.MapError(n))}))}))).then((function(n){var c=function(n){(function(n){var a={headerInfo:null};return new t((function(t,u){o.ParseCryptoHeader(n).then((function(t){a.headerInfo=t;var n=t.GetCryptoData();switch(t.GetHeaderType()){case o.EU_HEADER_PART_TYPE_SIGNED:return o.VerifyDataInternalOnTimeEx(n,0,null,!1,!1);case o.EU_HEADER_PART_TYPE_ENCRYPTED:return o.CtxDevelop(e,n);case o.EU_HEADER_PART_TYPE_STAMPED:case o.EU_HEADER_PART_TYPE_CERTCRYPT:return null;default:throw o.MakeError(r.EU_ERROR_PKI_FORMATS_FAILED,"")}})).then((function(e){if(null!=e){var r=a.headerInfo.GetHeaderType()==o.EU_HEADER_PART_TYPE_SIGNED?l.a.MapToEndUserSignInfo(e,new S.a):l.a.MapToEndUserSenderInfo(e,new C.a);s.initiators.push(r),n=e.GetData()}else n=n.slice(a.headerInfo.GetHeaderSize()+a.headerInfo.GetCryptoData().length,n.length);t(n)})).catch((function(e){e.GetErrorCode()==r.EU_ERROR_BAD_PARAMETER?t(null):u(i.MapError(e))}))}))})(n).then((function(t){if(null==t)return s.data=n,s.error=i.MapError(o.MakeError(r.EU_ERROR_NONE,"")),void a(s);c(t)})).catch((function(t){return u(i.MapError(t))}))};c(n)})).catch((function(t){return u(i.MapError(t))}))}))},e.prototype.GetKSPSettings=function(t){var e;if(!this.m_settings.KSPs)return null;if("string"==typeof t){for(e=0;e<this.m_settings.KSPs.length;e++)if(this.m_settings.KSPs[e].name==t)return this.m_settings.KSPs[e];return null}if("number"==typeof t){for(e=0;e<this.m_settings.KSPs.length;e++)if(this.m_settings.KSPs[e].ksp==t)return this.m_settings.KSPs[e];return null}return null},e.prototype.GetPollingInterval=function(t){return t&&"number"==typeof t.pollingInterval?1e3*t.pollingInterval:1e3},e.prototype.MakeNewCertificateKSP=function(e,n,i,o,s,a,c,f,_,p,h,E,y,S,C,d,A,R){void 0===d&&(d=!1),void 0===A&&(A=null),void 0===R&&(R=null);var m=this,T=m.m_library,g={kspSettings:null,userId:null,operationId:null},P={key:null,certs:null};return new t((function(f,h){m.CheckInitialize().then((function(){return m.BeginKMOperation()})).then((function(){var t=null;return null!=e&&(t=l.a.MapFromKeyMedia(e,T.CreateKeyMedia())),d?null:m.ReadPrivateKeyInternal(n,i,t,null,S)})).then((function(t){return C&&!d?T.CtxGetOwnEUserParams(m.m_pkContext):null})).then((function(t){return C?T.CtxModifyOwnEUserParams(m.m_pkContext,C.phone,C.EMail):null})).then((function(){if(g.userId=A,g.kspSettings=m.GetKSPSettings(R),!g.kspSettings||!g.kspSettings.address)throw T.MakeError(r.EU_ERROR_BAD_PARAMETER,"");var t=[];t[T.EU_KEYS_TYPE_DSTU_AND_ECDH_WITH_GOSTS]="DSTU4145",t[T.EU_KEYS_TYPE_RSA_WITH_SHA]="RSA",s!=T.EU_KEYS_LENGTH_DS_UA_FILE&&s!=T.EU_KEYS_LENGTH_DS_UA_CERT||(s=T.EU_KEYS_LENGTH_DS_UA_257),c!=T.EU_KEYS_LENGTH_KEP_UA_FILE&&c!=T.EU_KEYS_LENGTH_KEP_UA_CERT||(c=T.EU_KEYS_LENGTH_KEP_UA_431),p!=T.EU_KEYS_LENGTH_DS_RSA_FILE&&p!=T.EU_KEYS_LENGTH_DS_RSA_CERT||(p=T.EU_KEYS_LENGTH_DS_RSA_2048);var e=[];e[T.EU_KEYS_LENGTH_DS_UA_191]=191,e[T.EU_KEYS_LENGTH_DS_UA_257]=257,e[T.EU_KEYS_LENGTH_DS_UA_307]=307;var n=[];n[T.EU_KEYS_LENGTH_KEP_UA_257]=257,n[T.EU_KEYS_LENGTH_KEP_UA_431]=431,n[T.EU_KEYS_LENGTH_KEP_UA_571]=571;var i=[];i[T.EU_KEYS_LENGTH_DS_RSA_1024]=1024,i[T.EU_KEYS_LENGTH_DS_RSA_2048]=2048,i[T.EU_KEYS_LENGTH_DS_RSA_3072]=3072,i[T.EU_KEYS_LENGTH_DS_RSA_4096]=4096;var u=t[o]||null,l=e[s]||0,f=n[c]||0,h=t[_]||null,E=i[p]||0,y="Веб-сайт: %s".replace("%s",g.kspSettings.systemId||m.m_origin),S="Генерація ос. ключа у системі %s".replace("%s",g.kspSettings.systemId||m.m_origin);return T.SServerClientGeneratePrivateKeyAsync(g.kspSettings.address,g.kspSettings.port,g.userId,y,S,u,l,a,f,h,E)})).then((function(e){g.operationId=e;var n=m.GetPollingInterval(g.kspSettings),i=m.MakeExpireDate(300);return new t((function(t,e){var o=function(i){new Date>i?e(T.MakeError(r.EU_ERROR_TRANSMIT_REQUEST,"")):m.m_library.SServerClientCheckGeneratePrivateKeyStatus(g.kspSettings.address,g.kspSettings.port,g.userId,g.operationId).then((function(e){null!=e?t(e):setTimeout((function(){o(i)}),n)})).catch((function(t){e(m.MapError(t))}))};o(i)}))})).then((function(t){for(var e=null,n=null,r=null,i=0;i<t.size();i++){var o=t.get(i);switch(o.GetRequestType()){case T.EU_KEYS_REQUEST_TYPE_UA_DS:e=o.GetRequest();break;case T.EU_KEYS_REQUEST_TYPE_UA_KEP:n=o.GetRequest();break;case T.EU_KEYS_REQUEST_TYPE_INTERNATIONAL:r=o.GetRequest()}}return m.m_library.CtxMakeNewOwnCertificateWithCR(m.m_pkContext,e,n,r,null)})).then((function(){var t="Веб-сайт: %s".replace("%s",g.kspSettings.systemId||m.m_origin),e="Ідентифікація клієнта у системі %s".replace("%s",g.kspSettings.systemId||m.m_origin);return T.SServerClientSignHashesAsync(g.kspSettings.address,g.kspSettings.port,g.userId,t,e,["Зчитування ос. ключа"],["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="],"DSTU4145")})).then((function(e){g.operationId=e;var n=m.GetPollingInterval(g.kspSettings),i=m.MakeExpireDate(300);return new t((function(t,e){var o=function(i){new Date>i?e(T.MakeError(r.EU_ERROR_TRANSMIT_REQUEST,"")):T.SServerClientCheckSignHashesStatus(g.kspSettings.address,g.kspSettings.port,g.userId,g.operationId).then((function(s){if(null!=s)if(1==s.size()){var a=s.get(0);if(a.GetError()==r.EU_ERROR_NONE){var c=a.GetSignature(),f=new u.EndUserCertificate;T.CtxGetSignerInfo(m.m_context,0,c).then((function(e){l.a.MapToEndUserCertificate(e,f),t([f])})).catch((function(t){return e(m.MapError(t))}))}else e(T.MakeError(a.GetError(),a.GetStatus()))}else e(T.MakeError(r.EU_ERROR_PKI_FORMATS_FAILED,""));else setTimeout((function(){o(i)}),n)})).catch((function(t){e(m.MapError(t))}))};o(i)}))})).then((function(t){m.EndKMOperation(),P.certs=t,f(P)})).catch((function(t){m.ResetPrivateKeyInternal().then((function(){m.EndKMOperation(),h(m.MapError(t))})).catch((function(){m.EndKMOperation(),h(m.MapError(t))}))}))}))},e.prototype.AddEventListener=function(e,n){var i=this,o=i.m_library;return new t((function(t,s){if([_.EndUserEventType.None,_.EndUserEventType.All,_.EndUserEventType.ConfirmKSPOperation].indexOf(e)<0)s(i.MapError(o.MakeError(r.EU_ERROR_BAD_PARAMETER,"")));else{switch(e){case _.EndUserEventType.None:i.m_eventListeners=[];break;case _.EndUserEventType.All:i.m_eventListeners=[],i.m_eventListeners[e]=n;break;default:i.m_eventListeners[e]=n}t()}}))},e.prototype.GetLibraryInfo=function(e){var n=this,r=this.m_library;return new t((function(t,i){var o=new c.b;o.supported=r.IsSupported(),o.isSignAgentSupported=r.IsSignAgentSupported(),o.isWebExtensionSupported=r.IsWebExtensionSupported(),o.isNPAPISupported=r.IsNPAPISupported(),o.isActiveXSupported=r.IsActiveXSupported(),o.isWebExtensionInstalled=r.IsWebExtensionInstalled(),o.nativeLibraryInstallURLs=r.GetInstallURL(!0,e),o.nativeLibraryInstallURL=o.nativeLibraryInstallURLs?o.nativeLibraryInstallURLs[0]:null,o.nativeLibraryUpdateURLs=r.GetUpdateURL(!0,e),o.nativeLibraryUpdateURL=o.nativeLibraryUpdateURLs?o.nativeLibraryUpdateURLs[0]:null,o.webExtensionInstallURL=r.GetWebExtensionInstallURL(),o.helpURL=r.GetHelpURL(e),o.supported?r.Load().then((function(){o.loaded=!0,r.GetVersion().then((function(e){o.version=e,t(o)})).catch((function(t){return i(n.MapError(t))}))})).catch((function(e){var i=n.MapError(e);o.loaded=!1,o.isNativeLibraryNeedUpdate=r.IsLibraryVersionNotSupportedError(i.code),t(o)})):t(o)}))},e.prototype.IsInitialized=function(){var e=this;return new t((function(t,n){t(e.m_initialized)}))},e.prototype.Initialize=function(e){var n=this,r=n.m_library;n.m_settings=e;var i={offline:!0,tspSettings:null,useOCSP:!1};return new t((function(t,o){r.Load().then((function(){return r.SetRuntimeParameter(r.EU_SAVE_SETTINGS_PARAMETER,r.EU_SETTINGS_ID_PROXY)})).then((function(){return r.SetUIMode(!1)})).then((function(){return r.Initialize()})).then((function(){return r.SetUIMode(!1)})).then((function(){return r.SetCharset(n.m_settings.encoding)})).then((function(){return r.SetLanguage(n.m_settings.language)})).then((function(){return r.InitializeMandatorySettings()})).then((function(){var t=r.CreateFileStoreSettings();return t.SetPath(""),t.SetSaveLoadedCerts(!0),r.SetFileStoreSettings(t)})).then((function(){return null!=n.m_settings.CAs&&"string"==typeof n.m_settings.CAs?r.DownloadData(n.m_settings.CAs,"json"):n.m_settings.CAs})).then((function(t){n.m_settings.CAs=t,i.tspSettings=n.GetDefaultTSPSettings();for(var e=0;e<t.length;e++)if(t[e].ocspAccessPointAddress&&t[e].ocspAccessPointPort){i.useOCSP=!0;break}i.offline=!i.tspSettings&&!i.useOCSP;var o=r.CreateModeSettings();return o.SetOfflineMode(i.offline),r.SetModeSettings(o)})).then((function(){var t=r.CreateTSPSettings();return t.SetGetStamps(!!i.tspSettings),i.tspSettings&&(t.SetAddress(i.tspSettings.tspAddress),t.SetPort(i.tspSettings.tspAddressPort)),r.SetTSPSettings(t)})).then((function(){var t=r.CreateOCSPSettings();return t.SetUseOCSP(i.useOCSP),i.useOCSP&&(t.SetBeforeStore(!0),t.SetAddress("czo.gov.ua"),t.SetPort("80")),r.SetOCSPSettings(t)})).then((function(){var t=r.CreateOCSPAccessInfoModeSettings();return t.SetEnabled(i.useOCSP),r.SetOCSPAccessInfoModeSettings(t)})).then((function(){if(i.useOCSP){for(var t=new Array,e=n.m_settings.CAs,o=0;o<e.length;o++)for(var s=0;s<e[o].issuerCNs.length;s++){var a=r.CreateOCSPAccessInfoSettings();a.SetAddress(e[o].ocspAccessPointAddress),a.SetPort(e[o].ocspAccessPointPort),a.SetIssuerCN(e[o].issuerCNs[s]),t.push(a)}return r.SetOCSPAccessInfoSettings(t)}})).then((function(){return null!=e.CACertificates&&"string"==typeof e.CACertificates?r.DownloadData(e.CACertificates,"binary"):e.CACertificates})).then((function(t){if(null!=e.CACertificates)return r.SaveCertificates(t)})).then((function(){var t=!!e.TSLAddress,n=r.CreateTSLSettings();return n.SetUseTSL(t),n.SetAutoDownloadTSL(!!t),n.SetTSLAddress(t?e.TSLAddress:""),r.SetTSLSettings(n)})).then((function(){return r.SetRuntimeParameter(r.EU_RESOLVE_OIDS_PARAMETER,n.m_resolveOIDs)})).then((function(){if("number"==typeof n.m_settings.connectionTimeout)return r.SetRuntimeParameter(r.EU_CONNECTIONS_TIMEOUT_PARAMETER,n.m_settings.connectionTimeout)})).then((function(){if("number"==typeof e.ocspResponseExpireTime)return r.SetOCSPResponseExpireTime(n.m_settings.ocspResponseExpireTime)})).then((function(){return r.CtxCreate()})).then((function(t){return n.m_context=t,r.CtxSetParameter(t,r.EU_RESOLVE_OIDS_CONTEXT_PARAMETER,n.m_resolveOIDs)})).then((function(){return r.SetRuntimeParameter(r.EU_CHECK_CERT_CHAIN_ON_SIGN_TIME_PARAMETER,!0)})).then((function(){return null!=n.m_settings.signInfoTmpl&&"string"==typeof n.m_settings.signInfoTmpl?r.DownloadData(n.m_settings.signInfoTmpl,""):n.m_settings.signInfoTmpl})).then((function(e){n.m_settings.signInfoTmpl=e,n.m_initialized=!0,t()})).catch((function(t){return o(n.MapError(t))}))}))},e.prototype.SetLanguage=function(e){var n=this,r=n.m_library;return new t((function(t,i){n.CheckInitialize().then((function(){return r.SetLanguage(e)})).then((function(){n.m_settings.language=e})).then((function(){t()})).catch((function(t){return i(n.MapError(t))}))}))},e.prototype.SetRuntimeParameter=function(e,n){var r=this,i=r.m_library;return new t((function(t,o){r.CheckInitialize().then((function(){return i.SetRuntimeParameter(e,n)})).then((function(){return e!=i.EU_USE_SLOGIN_PRIVATE_KEY?null:i.CtxSetParameter(r.m_context,e,n)})).then((function(){t()})).catch((function(t){return o(r.MapError(t))}))}))},e.prototype.GetStorageParameter=function(e,n){var r=this,i=r.m_library;return new t((function(t,o){r.CheckInitialize().then((function(){return i.GetStorageParameter(n,e)})).then((function(e){t(e)})).catch((function(t){return o(r.MapError(t))}))}))},e.prototype.SetStorageParameter=function(e,n,r){var i=this,o=i.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){return o.SetStorageParameter(r,e,n)})).then((function(){t()})).catch((function(t){return s(i.MapError(t))}))}))},e.prototype.GetCAs=function(){var e=this;return new t((function(t,n){e.CheckInitialize().then((function(){t(e.m_settings.CAs)})).catch((function(t){return n(e.MapError(t))}))}))},e.prototype.GetProxySettings=function(){var e=this,n=e.m_library;return new t((function(t,r){e.CheckInitialize().then((function(){return n.GetProxySettings()})).then((function(e){var n=l.a.MapToProxySettings(e,new i.b);t(n)})).catch((function(t){return r(e.MapError(t))}))}))},e.prototype.SetProxySettings=function(e){var n=this,r=n.m_library;return new t((function(t,i){n.CheckInitialize().then((function(){var t=l.a.MapFromProxySettings(e,r.CreateProxySettings());return r.SetProxySettings(t)})).then((function(){t()})).catch((function(t){return i(n.MapError(t))}))}))},e.prototype.GetHostInfo=function(){var e=this,n=e.m_library;return new t((function(t,r){e.CheckInitialize().then((function(){return n.GetHostInfo()})).then((function(e){t(e)})).catch((function(t){return r(e.MapError(t))}))}))},e.prototype.GetKeyMedias=function(){var e=this,n=e.m_library,r=new Array,i=null;return e.m_settings.allowedKeyMediaDevices&&(i={},e.m_settings.allowedKeyMediaDevices.forEach((function(t){i[t.type]=t.devices}))),new t((function(t,o){e.CheckInitialize().then((function(){return e.BeginKMOperation()})).then((function(){return e.m_kmTypes?e.m_kmTypes:n.GetKeyMediaTypes()})).then((function(t){e.m_kmTypes=t;var i=e.m_settings.allowedKeyMediaTypes;r=new Array;for(var o=0;o<t.length;o++){var s=t[o];(!i||i.indexOf(s)>=0)&&r.push(o)}return n.GetKeyMediaDevices(r)})).then((function(n){for(var o=new Array,s=0;s<n.length;s++)for(var a=r[s],c=e.m_kmTypes[a],l=n[s],f=i&&i[c]?i[c]:null,_=0;_<l.length;_++)if(!f||-1!=f.indexOf(l[_])){var p=new u.EndUserKeyMedia;p.typeIndex=a,p.devIndex=_,p.password=null,p.type=c,p.device=l[_],p.visibleName=p.device+"("+p.type+")",o.push(p)}e.EndKMOperation(),t(o)})).catch((function(t){e.EndKMOperation(),o(e.MapError(t))}))}))},e.prototype.GetJKSPrivateKeys=function(e){var n=this;return new t((function(t,r){n.CheckInitialize().then((function(){var i=new Array,o=function(s){n.GetJKSPrivateKey(e,s).then((function(e){e?(i.push(e),o(s+1)):t(i)})).catch((function(t){return r(n.MapError(t))}))};o(0)})).catch((function(t){return r(n.MapError(t))}))}))},e.prototype.IsPrivateKeyReaded=function(){var e=this;return new t((function(t,n){e.CheckInitialize().then((function(){t(null!=e.m_pkContext)})).catch((function(t){return n(e.MapError(t))}))}))},e.prototype.ResetPrivateKey=function(){var e=this;return new t((function(t,n){e.CheckInitialize().then((function(){return e.ResetPrivateKeyInternal()})).then((function(){t()})).catch((function(t){return n(e.MapError(t))}))}))},e.prototype.ResetOperationKSP=function(){var e=this,n=this.m_library;return new t((function(t,i){e.CheckInitialize().then((function(){throw n.MakeError(r.EU_ERROR_NOT_SUPPORTED,"")})).catch((function(t){return i(e.MapError(t))}))}))},e.prototype.ReadPrivateKey=function(e,n,r){var i=this,o=this.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){i.BeginKMOperation()})).then((function(){var t=l.a.MapFromKeyMedia(e,o.CreateKeyMedia());return i.ReadPrivateKeyInternal(null,null,t,n,r)})).then((function(e){i.EndKMOperation(),t(e)})).catch((function(t){i.EndKMOperation(),s(i.MapError(t))}))}))},e.prototype.ReadPrivateKeyBinary=function(e,n,r,i){var o=this;return new t((function(t,s){o.CheckInitialize().then((function(){return o.ReadPrivateKeyInternal(e,n,null,r,i)})).then((function(e){t(e)})).catch((function(t){return s(o.MapError(t))}))}))},e.prototype.ReadPrivateKeySIM=function(e,n,i,o){var s=this,a=this.m_library;return new t((function(t,e){s.CheckInitialize().then((function(){throw a.MakeError(r.EU_ERROR_NOT_SUPPORTED,"")})).catch((function(t){return e(s.MapError(t))}))}))},e.prototype.ReadPrivateKeyKSP=function(e,n,i,o,s,a){var u=this,c=this.m_library;return new t((function(t,e){u.CheckInitialize().then((function(){throw c.MakeError(r.EU_ERROR_NOT_SUPPORTED,"")})).catch((function(t){return e(u.MapError(t))}))}))},e.prototype.GetOwnCertificates=function(){return this.CtxGetOwnCertificates(this.m_pkContext)},e.prototype.GetOwnEUserParams=function(){var e=this,n=e.m_library;return new t((function(t,i){e.CheckInitialize().then((function(){if(null==e.m_pkContext)throw n.MakeError(r.EU_ERROR_BAD_CERT,"");return n.CtxGetOwnEUserParams(e.m_pkContext)})).then((function(e){var n=l.a.MapToEndUserParams(e,new h.a);t(n)})).catch((function(t){return i(e.MapError(t))}))}))},e.prototype.ChangeOwnCertificatesStatus=function(e,n){var i=this,o=i.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){if(null==i.m_pkContext)throw o.MakeError(r.EU_ERROR_BAD_CERT,"");return o.CtxChangeOwnCertificatesStatus(i.m_pkContext,e,n)})).then((function(){t()})).catch((function(t){return s(i.MapError(t))}))}))},e.prototype.MakeNewCertificate=function(e,n,r,i,o,s,a,u,c,f,_,p,h,E,y,S,C,d){void 0===S&&(S=!1),void 0===C&&(C=null),void 0===d&&(d=null);var A=this,R=A.m_library,m={key:null,certs:null};return null!=C||null!=d?A.MakeNewCertificateKSP(e,n,r,i,o,s,a,u,c,f,_,p,h,E,y,S,C,d):new t((function(C,d){A.CheckInitialize().then((function(){return A.BeginKMOperation()})).then((function(){var t=null;return null!=e&&(t=l.a.MapFromKeyMedia(e,R.CreateKeyMedia())),S?null:A.ReadPrivateKeyInternal(n,r,t,null,E)})).then((function(t){return y&&!S?R.CtxGetOwnEUserParams(A.m_pkContext):null})).then((function(t){return y?R.CtxModifyOwnEUserParams(A.m_pkContext,y.phone,y.EMail):null})).then((function(){return S?null:A.ResetPrivateKeyInternal()})).then((function(){if(S)return new t((function(t,n){R.CtxMakeNewOwnCertificate(A.m_pkContext,i,o,s,a,u,c,f,_).then((function(){return A.ResetPrivateKeyInternal()})).then((function(){var t=l.a.MapFromKeyMedia(e,R.CreateKeyMedia());return p&&p.password!=e.password?R.ChangePrivateKeyPassword(t,p.password):null})).then((function(){t(null)})).catch((function(t){n(A.MapError(t))}))}));var E=null,y=null;return e&&(E=l.a.MapFromKeyMedia(e,R.CreateKeyMedia())),p&&(y=l.a.MapFromKeyMedia(p,R.CreateKeyMedia())),R.MakeNewCertificate(E,n,r,i,o,s,a,u,c,f,_,y,h)})).then((function(t){m.key=t;var n=null;return(S&&e||p)&&(n=l.a.MapFromKeyMedia(p||e,R.CreateKeyMedia())),A.SearchPrivateKeyCertificatesWithCMP(t,h,n,E)})).then((function(t){return A.GetUserCertificatesFromCertificates(t.certs)})).then((function(t){A.EndKMOperation(),m.certs=t,C(m)})).catch((function(t){A.EndKMOperation(),d(A.MapError(t))}))}))},e.prototype.MakeDeviceCertificate=function(e,n,i,o,s){var a=this,c=a.m_library;return new t((function(_,p){a.CheckInitialize().then((function(){if(null==a.m_pkContext)throw c.MakeError(r.EU_ERROR_BAD_CERT,"");var t=a.m_pkContext.GetOwnerInfo(),u=a.GetCASettings(t.GetIssuerCN());if(!u||!u.cmpAddress||""==u.cmpAddress)throw c.MakeError(r.EU_ERROR_BAD_PARAMETER,"");return c.CtxMakeDeviceCertificate(a.m_pkContext,e,n,i,o,s,u.cmpAddress,"80")})).then((function(e){return a.ProcessArray(e,(function(e){return new t((function(t,n){c.ParseCertificateEx(e).then((function(n){var r=new u.EndUserCertificate;r.data=e,r.infoEx=l.a.MapToEndUserCertificateInfoEx(n,new f.a),t(r)})).catch((function(t){return n(t)}))}))}))})).then((function(t){_(t)})).catch((function(t){a.EndKMOperation(),p(a.MapError(t))}))}))},e.prototype.SetKeyMediaUserPassword=function(e,n){var r=this,i=r.m_library;return new t((function(t,o){r.CheckInitialize().then((function(){return r.BeginKMOperation()})).then((function(){var t=l.a.MapFromKeyMedia(n,i.CreateKeyMedia());return r.m_library.SetKeyMediaUserPassword(e,t)})).then((function(){r.EndKMOperation(),t()})).catch((function(t){r.EndKMOperation(),o(r.MapError(t))}))}))},e.prototype.ChangePrivateKeyPassword=function(e,n){var r=this,i=r.m_library;return new t((function(t,o){r.CheckInitialize().then((function(){return r.BeginKMOperation()})).then((function(){var t=l.a.MapFromKeyMedia(e,i.CreateKeyMedia());return r.m_library.ChangePrivateKeyPassword(t,n)})).then((function(){r.EndKMOperation(),t()})).catch((function(t){r.EndKMOperation(),o(r.MapError(t))}))}))},e.prototype.ChangePrivateKeyPasswordBinary=function(e,n,r){var i=this,o=i.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){return o.ChangeSoftwarePrivateKeyPassword(e,n,r)})).then((function(e){t(e),t()})).catch((function(t){s(i.MapError(t))}))}))},e.prototype.GeneratePrivateKey=function(e,n,r,i,o,s,a,u,c,f,_,p){var h=this,E=h.m_library;return new t((function(t,y){h.CheckInitialize().then((function(){return h.BeginKMOperation()})).then((function(){var t=null;return e&&(t=l.a.MapFromKeyMedia(e,E.CreateKeyMedia())),h.GeneratePrivateKeyInternal(t,n,null,r,i,o,s,a,u,c,f,_,p)})).then((function(e){h.EndKMOperation(),t(e)})).catch((function(t){h.EndKMOperation(),y(h.MapError(t))}))}))},e.prototype.GeneratePrivateKeyBinary=function(e,n,r,i,o,s,a,u,c,l,f){var _=this;return new t((function(t,p){_.CheckInitialize().then((function(){return _.BeginKMOperation()})).then((function(){return _.GeneratePrivateKeyInternal(null,!1,e,n,r,i,o,s,a,u,c,l,f)})).then((function(e){_.EndKMOperation(),t(e)})).catch((function(t){_.EndKMOperation(),p(_.MapError(t))}))}))},e.prototype.GetKeyInfo=function(e){var n=this,r=n.m_library;return new t((function(t,i){n.CheckInitialize().then((function(){return n.BeginKMOperation()})).then((function(){var t=l.a.MapFromKeyMedia(e,r.CreateKeyMedia());return r.GetKeyInfo(t)})).then((function(e){n.EndKMOperation(),t(e.GetPrivateKeyInfo())})).catch((function(t){n.EndKMOperation(),i(n.MapError(t))}))}))},e.prototype.GetKeyInfoBinary=function(e,n){var r=this,i=r.m_library;return new t((function(t,o){r.CheckInitialize().then((function(){return i.GetKeyInfoBinary(e,n)})).then((function(e){t(e.GetPrivateKeyInfo())})).catch((function(t){o(r.MapError(t))}))}))},e.prototype.GetClientRegistrationTokenKSP=function(e,n){var i=this,o=i.m_library;return new t((function(t,e){i.CheckInitialize().then((function(){throw o.MakeError(r.EU_ERROR_NOT_SUPPORTED,"")})).catch((function(t){e(i.MapError(t))}))}))},e.prototype.HashData=function(e,n,r){var i=this,o=this.m_library,s=i.DataToNamedDataArray(n);return new t((function(a,u){i.CheckInitialize().then((function(){return i.ProcessArray(s,(function(n){return new t((function(t,s){o.CtxHash(i.m_context,e,null,n.val).then((function(t){return r?t:o.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return s(t)}))}))}))})).then((function(t){var e=i.DataToResult(n,t);a(e)})).catch((function(t){u(i.MapError(t))}))}))},e.prototype.GetSigner=function(e,n,r){void 0===n&&(n=-1),void 0===r&&(r=!1);var i=this,o=this.m_library,s={context:null,signersInfo:null};return new t((function(a,c){i.CheckInitialize().then((function(){return o.CtxCreate()})).then((function(t){return s.context=t,o.CtxSetParameter(t,o.EU_RESOLVE_OIDS_CONTEXT_PARAMETER,r)})).then((function(){return-1==n?o.GetSignsCount(e):1})).then((function(r){var a=new Array;if(-1!=n)a.push(n);else for(var c=0;c<r;c++)a.push(c);return i.ProcessArray(a,(function(n){return new t((function(t,r){var a=new u.EndUserCertificate;o.CtxGetSignerInfo(s.context,n,e).then((function(e){l.a.MapToEndUserCertificate(e,a),t(a)})).catch((function(t){return r(i.MapError(t))}))}))}))})).then((function(t){return s.signersInfo=t,o.CtxFree(s.context)})).then((function(){s.context=null,a(-1!=n?s.signersInfo[0]:s.signersInfo)})).catch((function(t){s.context?o.CtxFree(s.context).then((function(){c(i.MapError(t))})).catch((function(){c(i.MapError(t))})):c(i.MapError(t))}))}))},e.prototype.SignData=function(t,e){return void 0===e&&(e=!1),this.SignDataEx(_.EndUserSignAlgo.Unknown,t,!0,!0,e)},e.prototype.SignDataInternal=function(t,e,n){return void 0===n&&(n=!1),this.SignDataEx(_.EndUserSignAlgo.Unknown,e,!1,t,n)},e.prototype.SignHash=function(t,e,n,r){return this.CtxSignHashInternal(this.m_pkContext,t,e,null,n,r)},e.prototype.SignDataEx=function(t,e,n,r,i){return this.CtxSignDataInternal(this.m_pkContext,t,e,null,n,r,i)},e.prototype.AppendSign=function(t,e,n,r,i){return this.CtxSignDataInternal(this.m_pkContext,t,e,n,null!=e,r,i)},e.prototype.AppendSignHash=function(t,e,n,r,i){return this.CtxSignHashInternal(this.m_pkContext,t,e,n,r,i)},e.prototype.VerifyHash=function(e,n,r){void 0===r&&(r=-1);var i=this,o=this.m_library;return new t((function(s,a){i.CheckInitialize().then((function(){return-1==r?o.GetSignsCount(n):1})).then((function(s){var a=new Array;if(-1!=r)a.push(r);else for(var u=0;u<s;u++)a.push(u);return i.ProcessArray(a,(function(r){return new t((function(t,s){var a=new S.a;o.VerifyHashOnTimeEx(e,r,n,null,!1,!1).then((function(t){return l.a.MapToEndUserSignInfo(t,a),o.GetSignTimeInfo(r,n)})).then((function(t){return a.timeInfo=l.a.MapToEndUserTimeInfo(t,new d.a),o.GetSignType(r,n)})).then((function(e){a.signLevel=e,t(a)})).catch((function(t){return s(i.MapError(t))}))}))}))})).then((function(t){s(-1!=r?t[0]:t)})).catch((function(t){return a(i.MapError(t))}))}))},e.prototype.VerifyData=function(e,n,r){void 0===r&&(r=-1);var i=this,o=this.m_library;return new t((function(s,a){i.CheckInitialize().then((function(){return-1==r?o.GetSignsCount(n):1})).then((function(s){var a=new Array;if(-1!=r)a.push(r);else for(var u=0;u<s;u++)a.push(u);return i.ProcessArray(a,(function(r){return new t((function(t,s){var a=new S.a;o.VerifyDataOnTimeEx(e,r,n,null,!1,!1).then((function(t){return l.a.MapToEndUserSignInfo(t,a),o.GetSignTimeInfo(r,n)})).then((function(t){return a.timeInfo=l.a.MapToEndUserTimeInfo(t,new d.a),o.GetSignType(r,n)})).then((function(e){a.signLevel=e,t(a)})).catch((function(t){return s(i.MapError(t))}))}))}))})).then((function(t){s(-1!=r?t[0]:t)})).catch((function(t){return a(i.MapError(t))}))}))},e.prototype.VerifyDataInternal=function(e,n){void 0===n&&(n=-1);var r=this,i=this.m_library;return new t((function(o,s){r.CheckInitialize().then((function(){return-1==n?i.GetSignsCount(e):1})).then((function(o){var s=new Array;if(-1!=n)s.push(n);else for(var a=0;a<o;a++)s.push(a);return r.ProcessArray(s,(function(n){return new t((function(t,o){var s=new S.a;i.VerifyDataInternalOnTimeEx(e,n,null,!1,!1).then((function(t){return l.a.MapToEndUserSignInfo(t,s),i.GetSignTimeInfo(n,e)})).then((function(t){return s.timeInfo=l.a.MapToEndUserTimeInfo(t,new d.a),i.GetSignType(n,e)})).then((function(e){s.signLevel=e,t(s)})).catch((function(t){return o(r.MapError(t))}))}))}))})).then((function(t){o(-1!=n?t[0]:t)})).catch((function(t){return s(r.MapError(t))}))}))},e.prototype.EnvelopData=function(e,n,i,o,s,a){void 0===a&&(a=!1);var u=this,c=this.m_library;return new t((function(t,l){u.CheckInitialize().then((function(){if(null==u.m_pkContext&&(!a||i))throw c.MakeError(r.EU_ERROR_BAD_CERT,"");var t=c.EU_RECIPIENT_APPEND_TYPE_BY_ISSUER_SERIAL;return a?i?c.CtxEnvelopWithDynamicKey(u.m_pkContext,e,t,i,o,n):c.EnvelopToRecipientsWithDynamicKey(e,i,o,n):c.CtxEnvelop(u.m_pkContext,e,t,i,o,n)})).then((function(t){return s?t:c.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return l(u.MapError(t))}))}))},e.prototype.DevelopData=function(e,n){var i=this,o=this.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){if(null==i.m_pkContext)throw o.MakeError(r.EU_ERROR_BAD_CERT,"");return o.CtxDevelop(i.m_pkContext,e,n)})).then((function(e){var n=l.a.MapToEndUserSenderInfo(e,new C.a);t(n)})).catch((function(t){return s(i.MapError(t))}))}))},e.prototype.ProtectDataByPassword=function(e,n,r){var i=this,o=this.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){return o.ProtectDataByPassword(e,n)})).then((function(t){return r?t:o.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return s(i.MapError(t))}))}))},e.prototype.UnprotectDataByPassword=function(e,n,r){var i=this,o=this.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){return o.UnprotectDataByPassword(e,n)})).then((function(t){return r?o.BytesToString(t):t})).then((function(e){t(e)})).catch((function(t){return s(i.MapError(t))}))}))},e.prototype.CreateAuthData=function(e,n,i){var o=this,s=this.m_library;return new t((function(t,a){o.CheckInitialize().then((function(){if(null==o.m_pkContext)throw s.MakeError(r.EU_ERROR_BAD_CERT,"");return s.CtxCreateAuthData(o.m_pkContext,e,n)})).then((function(t){return i?t:s.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return a(o.MapError(t))}))}))},e.prototype.GetTSPByAccessInfo=function(e,n,r,i,o){var s=this,a=this.m_library;return new t((function(t,u){s.CheckInitialize().then((function(){return a.GetTSPByAccessInfo(e,n,r,i)})).then((function(t){return o?a.BASE64Encode(t):t})).then((function(e){t(e)})).catch((function(t){return u(s.MapError(t))}))}))},e.prototype.CheckTSP=function(e,n,r){var i=this,o=this.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){return o.CheckTSP(e,n,r)})).then((function(){t()})).catch((function(t){return s(i.MapError(t))}))}))},e.prototype.CtxCreate=function(){var e=this,n=this.m_library,r={context:null};return new t((function(t,i){e.CheckInitialize().then((function(){return n.CtxCreate()})).then((function(t){return r.context=t,n.CtxSetParameter(t,n.EU_RESOLVE_OIDS_CONTEXT_PARAMETER,e.m_resolveOIDs)})).then((function(){t(r.context)})).catch((function(t){return i(e.MapError(t))}))}))},e.prototype.CtxFree=function(e){var n=this,r=this.m_library;return new t((function(t,i){n.CheckInitialize().then((function(){r.CtxFree(e)})).then((function(){t()})).catch((function(t){return i(n.MapError(t))}))}))},e.prototype.CtxSetParameter=function(e,n,r){var i=this,o=i.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){return null==e&&(e=i.m_context),o.CtxSetParameter(e,n,r)})).then((function(){t()})).catch((function(t){i.EndKMOperation(),s(i.MapError(t))}))}))},e.prototype.CtxReadPrivateKey=function(e,n,r,i){var o=this,s=o.m_library;return new t((function(t,a){o.CheckInitialize().then((function(){return o.BeginKMOperation()})).then((function(){var t=l.a.MapFromKeyMedia(n,s.CreateKeyMedia());return o.CtxReadPrivateKeyInternal(e,null,null,t,r,i)})).then((function(e){o.EndKMOperation(),t(e)})).catch((function(t){o.EndKMOperation(),a(o.MapError(t))}))}))},e.prototype.CtxReadPrivateKeyBinary=function(e,n,r,i,o){var s=this;return new t((function(t,a){s.CheckInitialize().then((function(){return s.CtxReadPrivateKeyInternal(e,n,r,null,i,o)})).then((function(e){t(e)})).catch((function(t){return a(s.MapError(t))}))}))},e.prototype.CtxFreePrivateKey=function(e){var n=this,r=this.m_library;return new t((function(t,i){n.CheckInitialize().then((function(){return r.CtxFreePrivateKey(e)})).then((function(){t()})).catch((function(t){return i(n.MapError(t))}))}))},e.prototype.CtxGetOwnCertificates=function(e){var n=this,i=this.m_library;return new t((function(t,o){n.CheckInitialize().then((function(){if(null==e)throw i.MakeError(r.EU_ERROR_BAD_CERT,"");var s=new Array,a=function(r){i.CtxEnumOwnCertificates(e,r).then((function(e){if(e){var n=l.a.MapToEndUserCertificate(e,new u.EndUserCertificate);s.push(n),a(r+1)}else t(s)})).catch((function(t){return o(n.MapError(t))}))};a(0)})).catch((function(t){return o(n.MapError(t))}))}))},e.prototype.CtxSignHash=function(t,e,n,r,i){return this.CtxSignHashInternal(t,e,n,null,r,i)},e.prototype.CtxSignData=function(t,e,n,r,i,o){return this.CtxSignDataInternal(t,e,n,null,r,i,o)},e.prototype.CtxAppendSignHash=function(t,e,n,r,i,o){return this.CtxSignHashInternal(t,e,n,r,i,o)},e.prototype.CtxAppendSign=function(t,e,n,r,i,o){return this.CtxSignDataInternal(t,e,n,r,null!=n,i,o)},e.prototype.CtxGetSignValue=function(e,n,i,o){var s=this,a=this.m_library,u=s.DataToNamedDataArray(i);return new t((function(c,l){s.CheckInitialize().then((function(){if(null==e)throw a.MakeError(r.EU_ERROR_BAD_CERT,"");return s.ProcessArray(u,(function(r){return new t((function(t,i){a.CtxGetSignValue(e,n,r.val).then((function(t){return o?t:a.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return i(t)}))}))}))})).then((function(t){var e=s.DataToResult(i,t);c(e)})).catch((function(t){return l(s.MapError(t))}))}))},e.prototype.CtxEnvelopData=function(e,n,i,o,s,a,u){var c=this,l=this.m_library;return new t((function(t,f){c.CheckInitialize().then((function(){if(null==e&&(!u||o))throw l.MakeError(r.EU_ERROR_BAD_CERT,"");var t=l.EU_RECIPIENT_APPEND_TYPE_BY_ISSUER_SERIAL;return u?o?l.CtxEnvelopWithDynamicKey(e,n,t,o,s,i):l.EnvelopToRecipientsWithDynamicKey(n,o,s,i):l.CtxEnvelop(e,n,t,o,s,i)})).then((function(t){return a?t:l.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return f(c.MapError(t))}))}))},e.prototype.CtxDevelopData=function(e,n,i){var o=this,s=this.m_library;return new t((function(t,a){o.CheckInitialize().then((function(){if(null==e)throw s.MakeError(r.EU_ERROR_BAD_CERT,"");return s.CtxDevelop(e,n,i)})).then((function(e){var n=l.a.MapToEndUserSenderInfo(e,new C.a);t(n)})).catch((function(t){return a(o.MapError(t))}))}))},e.prototype.ProtectTaxReports=function(e,n,r,i,o,s,a){void 0===e&&(e=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===a&&(a=!1);var u=this;return new t((function(t,c){var l={accountant:null,director:null,stamp:null};u.CheckInitialize().then((function(){var t=[_.EndUserKeyUsage.DigitalSignature];return null!=e?u.LoadTaxReportPKey(e,t,!1):null})).then((function(t){l.accountant=t;var e=[_.EndUserKeyUsage.DigitalSignature];return r||e.push(_.EndUserKeyUsage.KeyAgreement),null!=n?u.LoadTaxReportPKey(n,e,!1):null})).then((function(t){l.director=t;var e=[_.EndUserKeyUsage.DigitalSignature,_.EndUserKeyUsage.KeyAgreement];return null!=r?u.LoadTaxReportPKey(r,e,!0):null})).then((function(t){return l.stamp=t,u.ProcessArray(s,(function(t){return u.ProtectTaxReport(l.accountant,l.director,l.stamp,i,o,t,a)}))})).then((function(e){t(e)})).catch((function(t){return c(u.MapError(t))}))}))},e.prototype.UnprotectTaxReceipts=function(e,n){var r=this;return new t((function(t,i){r.CheckInitialize().then((function(){return r.ProcessArray(n,(function(t){return r.UnprotectTaxReceipt(e,t)}))})).then((function(e){t(e)})).catch((function(t){return i(r.MapError(t))}))}))},e.prototype.ASiCGetSigner=function(e,n,r){void 0===n&&(n=-1),void 0===r&&(r=!1);var i=this,o=this.m_library,s={context:null,signersInfo:null};return new t((function(a,c){i.CheckInitialize().then((function(){return o.CtxCreate()})).then((function(t){return s.context=t,o.CtxSetParameter(t,o.EU_RESOLVE_OIDS_CONTEXT_PARAMETER,r)})).then((function(){return-1==n?o.ASiCGetSignsCount(e):1})).then((function(r){var a=new Array;if(-1!=n)a.push(n);else for(var c=0;c<r;c++)a.push(c);return i.ProcessArray(a,(function(n){return new t((function(t,r){var a=new u.EndUserCertificate;o.CtxASiCGetSignerInfo(s.context,n,e).then((function(e){l.a.MapToEndUserCertificate(e,a),t(a)})).catch((function(t){return r(i.MapError(t))}))}))}))})).then((function(t){return s.signersInfo=t,o.CtxFree(s.context)})).then((function(){a(-1!=n?s.signersInfo[0]:s.signersInfo)})).catch((function(t){s.context&&o.CtxFree(s.context).then((function(){c(i.MapError(t))})).catch((function(){c(i.MapError(t))}))}))}))},e.prototype.ASiCSignData=function(e,n,i,o,s,a){var u=this,c=this,l=this.m_library;return new t((function(t,f){c.CheckInitialize().then((function(){if(null==u.m_pkContext)throw l.MakeError(r.EU_ERROR_BAD_CERT,"");for(var t=[],a=0;a<s.length;a++){var c=l.CreateReference(s[a].name,s[a].val);t.push(c)}return l.CtxASiCSign(u.m_pkContext,e,n,i,o,t)})).then((function(t){return a?t:l.BASE64Decode(t)})).then((function(e){var r={name:s[0].name+(n==_.EndUserASiCType.S?".asics":".asice"),val:e};t(r)})).catch((function(t){return f(c.MapError(t))}))}))},e.prototype.ASiCAppendSign=function(e,n,i,o,s){var a=this,u=this,c=this.m_library,l=u.DataToNamedDataArray(o);return new t((function(t,o){u.CheckInitialize().then((function(){if(null==a.m_pkContext)throw c.MakeError(r.EU_ERROR_BAD_CERT,"");return c.CtxASiCAppendSign(a.m_pkContext,e,n,i,l[0].val)})).then((function(t){return s?t:c.BASE64Decode(t)})).then((function(e){var n={name:l[0].name,val:e};t(n)})).catch((function(t){return o(u.MapError(t))}))}))},e.prototype.ASiCVerifyData=function(e,n){void 0===n&&(n=-1);var r=this,i=this.m_library;return new t((function(o,s){r.CheckInitialize().then((function(){return-1==n?i.ASiCGetSignsCount(e):1})).then((function(o){var s=new Array;if(-1!=n)s.push(n);else for(var a=0;a<o;a++)s.push(a);return r.ProcessArray(s,(function(n){return new t((function(t,o){var s=new S.a;i.ASiCVerify(n,e).then((function(t){return l.a.MapToEndUserSignInfo(t,s),i.ASiCGetSignTimeInfo(n,e)})).then((function(t){return s.timeInfo=l.a.MapToEndUserTimeInfo(t,new d.a),i.ASiCGetSignLevel(n,e)})).then((function(e){s.signLevel=e,t(s)})).catch((function(t){return o(r.MapError(t))}))}))}))})).then((function(t){o(-1!=n?t[0]:t)})).catch((function(t){return s(r.MapError(t))}))}))},e.prototype.PDFGetSigner=function(e,n,r){void 0===n&&(n=-1),void 0===r&&(r=!1);var i=this,o=this.m_library,s={context:null,signersInfo:null};return new t((function(a,c){i.CheckInitialize().then((function(){return o.CtxCreate()})).then((function(t){return s.context=t,o.CtxSetParameter(t,o.EU_RESOLVE_OIDS_CONTEXT_PARAMETER,r)})).then((function(){return-1==n?o.PDFGetSignsCount(e):1})).then((function(r){var a=new Array;if(-1!=n)a.push(n);else for(var c=0;c<r;c++)a.push(c);return i.ProcessArray(a,(function(n){return new t((function(t,r){var a=new u.EndUserCertificate;o.CtxPDFGetSignerInfo(s.context,n,e).then((function(e){l.a.MapToEndUserCertificate(e,a),t(a)})).catch((function(t){return r(i.MapError(t))}))}))}))})).then((function(t){return s.signersInfo=t,o.CtxFree(s.context)})).then((function(){a(-1!=n?s.signersInfo[0]:s.signersInfo)})).catch((function(t){s.context&&o.CtxFree(s.context).then((function(){c(i.MapError(t))})).catch((function(){c(i.MapError(t))}))}))}))},e.prototype.PDFSignData=function(e,n,i,o){var s=this,a=this,u=this.m_library,c=a.DataToNamedDataArray(n);return new t((function(l,f){a.CheckInitialize().then((function(){if(null==s.m_pkContext)throw u.MakeError(r.EU_ERROR_BAD_CERT,"");return a.ProcessArray(c,(function(n){return new t((function(t,r){return u.CtxPDFSign(s.m_pkContext,e,n.val,i).then((function(t){return o?t:u.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return r(t)}))}))}))})).then((function(t){var e=s.DataToResult(n,t);l(e)})).catch((function(t){return f(a.MapError(t))}))}))},e.prototype.PDFVerifyData=function(e,n){void 0===n&&(n=-1);var r=this,i=this.m_library;return new t((function(o,s){r.CheckInitialize().then((function(){return-1==n?i.PDFGetSignsCount(e):1})).then((function(o){var s=new Array;if(-1!=n)s.push(n);else for(var a=0;a<o;a++)s.push(a);return r.ProcessArray(s,(function(n){return new t((function(t,o){var s=new S.a;i.PDFVerify(n,e).then((function(t){return l.a.MapToEndUserSignInfo(t,s),i.PDFGetSignTimeInfo(n,e)})).then((function(t){return s.timeInfo=l.a.MapToEndUserTimeInfo(t,new d.a),i.PDFGetSignType(n,e)})).then((function(e){s.signLevel=e,t(s)})).catch((function(t){return o(r.MapError(t))}))}))}))})).then((function(t){o(-1!=n?t[0]:t)})).catch((function(t){return s(r.MapError(t))}))}))},e.prototype.XAdESGetSigner=function(e,n,r){void 0===n&&(n=-1),void 0===r&&(r=!1);var i=this,o=this.m_library,s={context:null,signersInfo:null};return new t((function(a,c){i.CheckInitialize().then((function(){return o.CtxCreate()})).then((function(t){return s.context=t,o.CtxSetParameter(t,o.EU_RESOLVE_OIDS_CONTEXT_PARAMETER,r)})).then((function(){return-1==n?o.XAdESGetSignsCount(e):1})).then((function(r){var a=new Array;if(-1!=n)a.push(n);else for(var c=0;c<r;c++)a.push(c);return i.ProcessArray(a,(function(n){return new t((function(t,r){var a=new u.EndUserCertificate;o.CtxXAdESGetSignerInfo(s.context,n,e).then((function(e){l.a.MapToEndUserCertificate(e,a),t(a)})).catch((function(t){return r(i.MapError(t))}))}))}))})).then((function(t){return s.signersInfo=t,o.CtxFree(s.context)})).then((function(){a(-1!=n?s.signersInfo[0]:s.signersInfo)})).catch((function(t){s.context&&o.CtxFree(s.context).then((function(){c(i.MapError(t))})).catch((function(){c(i.MapError(t))}))}))}))},e.prototype.XAdESSignData=function(e,n,i,o,s){var a=this,u=this,c=this.m_library;return new t((function(t,l){u.CheckInitialize().then((function(){if(null==a.m_pkContext)throw c.MakeError(r.EU_ERROR_BAD_CERT,"");for(var t=[],s=0;s<o.length;s++){var u=c.CreateReference(o[s].name,o[s].val);t.push(u)}return c.CtxXAdESSign(a.m_pkContext,e,n,i,t)})).then((function(t){return s?t:c.BASE64Decode(t)})).then((function(e){var n={name:o[0].name+(o[0].name.endsWith(".xml")?"":".xml"),val:e};t(n)})).catch((function(t){return l(u.MapError(t))}))}))},e.prototype.XAdESVerifyData=function(e,n,r){void 0===r&&(r=-1);var i=this,o=this.m_library;return new t((function(s,a){i.CheckInitialize().then((function(){return-1==r?o.XAdESGetSignsCount(n):1})).then((function(s){var a=new Array;if(-1!=r)a.push(r);else for(var u=0;u<s;u++)a.push(u);var c=null;if(null!=e){c=[];for(u=0;u<e.length;u++){var f=o.CreateReference(e[u].name,e[u].val);c.push(f)}}return i.ProcessArray(a,(function(e){return new t((function(t,r){var s=new S.a;o.XAdESVerify(c,e,n).then((function(t){return l.a.MapToEndUserSignInfo(t,s),o.XAdESGetSignTimeInfo(e,n)})).then((function(t){return s.timeInfo=l.a.MapToEndUserTimeInfo(t,new d.a),o.XAdESGetSignLevel(e,n)})).then((function(e){s.signLevel=e,t(s)})).catch((function(t){return r(i.MapError(t))}))}))}))})).then((function(t){s(-1!=r?t[0]:t)})).catch((function(t){return a(i.MapError(t))}))}))},e.prototype.GetSignContainerInfo=function(e){var n=this,r=this.m_library,i=(new y.a,function(e){var n=new y.a;return new t((function(t,i){r.IsDataInSignedDataAvailable(e).then((function(e){n.type=_.EndUserSignContainerType.CAdES,n.subType=e?_.EndUserCAdESType.Enveloped:_.EndUserCAdESType.Detached,t(n)})).catch((function(e){t(null)}))}))}),o=function(e){var n=new y.a;return new t((function(t,i){r.XAdESGetType(e).then((function(e){n.type=_.EndUserSignContainerType.XAdES,n.subType=e,t(n)})).catch((function(e){t(null)}))}))},s=function(e){var n=new y.a;return new t((function(t,i){r.PDFGetSignsCount(e).then((function(e){n.type=_.EndUserSignContainerType.PAdES,t(n)})).catch((function(e){t(null)}))}))},a=function(e){var n=new y.a;return new t((function(t,i){r.ASiCGetASiCType(e).then((function(t){return n.type=_.EndUserSignContainerType.ASiC,n.subType=t,r.ASiCGetSignType(e)})).then((function(e){n.asicSignType=e,t(n)})).catch((function(e){t(null)}))}))};return new t((function(u,c){n.CheckInitialize().then((function(){return"string"==typeof e?r.BASE64Decode(e):e})).then((function(e){var n=[],r=function(t,e){if(t.length<e.length)return!1;for(var n=0;n<e.length;n++)if(t[n]!=e[n])return!1;return!0};return n=r(e,[60,63,120,109,108])?[o,i,s,a]:r(e,[37,80,68,70])?[s,i,o,a]:r(e,[80,75])?[a,i,o,s]:[i,o,s,a],new t((function(t,r){var i=function(o){o>=n.length?t(new y.a):n[o](e).then((function(e){null!=e?t(e):i(o+1)})).catch((function(t){return r(t)}))};i(0)}))})).then((function(t){u(t)})).catch((function(t){return c(n.MapError(t))}))}))},e}();e.a=R}).call(this,n(17).Promise)},function(t,e,n){"use strict";(function(t){var r=n(3),i=function(){function e(){this.EU_SUBJECT_TYPE_UNDIFFERENCED=0,this.EU_SUBJECT_TYPE_CA=1,this.EU_SUBJECT_TYPE_CA_SERVER=2,this.EU_SUBJECT_TYPE_RA_ADMINISTRATOR=3,this.EU_SUBJECT_TYPE_END_USER=4,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED=0,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_CMP=1,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_TSP=2,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_OCSP=3,this.EU_CERT_KEY_TYPE_UNKNOWN=0,this.EU_CERT_KEY_TYPE_DSTU4145=1,this.EU_CERT_KEY_TYPE_RSA=2,this.EU_CERT_KEY_TYPE_ECDSA=4,this.EU_KEY_USAGE_UNKNOWN=0,this.EU_KEY_USAGE_DIGITAL_SIGNATURE=1,this.EU_KEY_USAGE_KEY_AGREEMENT=16,this.EU_KEYS_REQUEST_TYPE_UA_DS=1,this.EU_KEYS_REQUEST_TYPE_UA_KEP=2,this.EU_KEYS_REQUEST_TYPE_INTERNATIONAL=3,this.EU_KEYS_TYPE_NONE=0,this.EU_KEYS_TYPE_DSTU_AND_ECDH_WITH_GOSTS=1,this.EU_KEYS_TYPE_RSA_WITH_SHA=2,this.EU_KEYS_LENGTH_DS_UA_191=1,this.EU_KEYS_LENGTH_DS_UA_257=2,this.EU_KEYS_LENGTH_DS_UA_307=3,this.EU_KEYS_LENGTH_DS_UA_FILE=4,this.EU_KEYS_LENGTH_DS_UA_CERT=5,this.EU_KEYS_LENGTH_KEP_UA_257=1,this.EU_KEYS_LENGTH_KEP_UA_431=2,this.EU_KEYS_LENGTH_KEP_UA_571=3,this.EU_KEYS_LENGTH_KEP_UA_FILE=4,this.EU_KEYS_LENGTH_KEP_UA_CERT=5,this.EU_KEYS_LENGTH_DS_RSA_1024=1,this.EU_KEYS_LENGTH_DS_RSA_2048=2,this.EU_KEYS_LENGTH_DS_RSA_3072=3,this.EU_KEYS_LENGTH_DS_RSA_4096=4,this.EU_KEYS_LENGTH_DS_RSA_FILE=5,this.EU_KEYS_LENGTH_DS_RSA_CERT=6,this.EU_RECIPIENT_APPEND_ISSUER_AND_SERIAL=1,this.EU_RECIPIENT_APPEND_KEY_ID=2,this.EU_RECIPIENT_APPEND_KEY_ID_USC_COMPAT=3,this.EU_SAVE_SETTINGS_PARAMETER="SaveSettings",this.EU_RESOLVE_OIDS_PARAMETER="ResolveOIDs",this.EU_MAKE_PKEY_PFX_CONTAINER_PARAMETER="MakePKeyPFXContainer",this.EU_SIGN_INCLUDE_CONTENT_TIME_STAMP_PARAMETER="SignIncludeContentTimeStamp",this.EU_SIGN_TYPE_PARAMETER="SignType",this.EU_SIGN_INCLUDE_CA_CERTIFICATES_PARAMETER="SignIncludeCACertificates",this.EU_FS_CALCULATE_FINGERPRINT="FSCalculateFingerprint",this.EU_CHECK_CERT_CHAIN_ON_SIGN_TIME_PARAMETER="CheckCertChainOnSignTime",this.EU_CONNECTIONS_TIMEOUT_PARAMETER="ConnectionsTimeout",this.EU_LOG_EVENTS_THRESHOLD_PARAMETER="LogEventsThreshold",this.EU_USE_SLOGIN_PRIVATE_KEY="UseSLoginPrivateKey",this.EU_SETTINGS_ID_NONE=0,this.EU_SETTINGS_ID_MANDATORY=31,this.EU_SETTINGS_ID_ALL=4095,this.EU_SETTINGS_ID_FSTORE=1,this.EU_SETTINGS_ID_PROXY=2,this.EU_SETTINGS_ID_TSP=4,this.EU_SETTINGS_ID_OCSP=8,this.EU_SETTINGS_ID_LDAP=16,this.EU_SETTINGS_ID_MODE=32,this.EU_SETTINGS_ID_CMP=64,this.EU_SETTINGS_ID_KM=128,this.EU_SETTINGS_ID_OCSP_ACCESS_INFO_MODE=256,this.EU_SETTINGS_ID_OCSP_ACCESS_INFO=512,this.EU_SETTINGS_ID_TSL=1024,this.EU_SETTINGS_ID_LOG=2048,this.EU_HEADER_CA_TYPE="UA1",this.EU_HEADER_PART_TYPE_SIGNED=1,this.EU_HEADER_PART_TYPE_ENCRYPTED=2,this.EU_HEADER_PART_TYPE_STAMPED=3,this.EU_HEADER_PART_TYPE_CERTCRYPT=4,this.EU_HEADER_MAX_CA_TYPE_SIZE=3,this.EU_SIGNED_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_SIGNED,this.EU_ENCRYPTED_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_ENCRYPTED,this.EU_TIMESTAMPED_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_STAMPED,this.EU_CERTCRYPT_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_CERTCRYPT,this.EU_DEFAULT_LANG=0,this.EU_UA_LANG=1,this.EU_RU_LANG=2,this.EU_EN_LANG=3,this.EU_CONTENT_ENC_ALGO_TDES_CBC=4,this.EU_CONTENT_ENC_ALGO_AES_128_CBC=5,this.EU_CONTENT_ENC_ALGO_AES_192_CBC=6,this.EU_CONTENT_ENC_ALGO_AES_256_CBC=7,this.EU_DEV_CTX_MIN_PUBLIC_DATA_ID=16,this.EU_DEV_CTX_MAX_PRIVATE_DATA_ID=175,this.EU_UA_OID_EXT_KEY_USAGE_STAMP="1.2.804.2.1.1.1.3.9",this.EU_CCS_TYPE_REVOKE=1,this.EU_CCS_TYPE_HOLD=2,this.EU_REVOCATION_REASON_UNKNOWN=0,this.EU_REVOCATION_REASON_KEY_COMPROMISE=1,this.EU_REVOCATION_REASON_NEW_ISSURED=2,this.EU_SIGN_TYPE_UNKNOWN=0,this.EU_SIGN_TYPE_CADES_BES=1,this.EU_SIGN_TYPE_CADES_T=4,this.EU_SIGN_TYPE_CADES_C=8,this.EU_SIGN_TYPE_CADES_X_LONG=16,this.EU_CHECK_PRIVATE_KEY_CONTEXT_PARAMETER="CheckPrivateKey",this.EU_RESOLVE_OIDS_CONTEXT_PARAMETER="ResolveOIDs",this.EU_EXPORATABLE_CONTEXT_CONTEXT_PARAMETER="ExportableContext",this.EU_USE_SLOGIN_PRIVATE_KEY_CONTEXT_PARAMETER="UseSLoginPrivateKey",this.EU_RECIPIENT_APPEND_TYPE_BY_ISSUER_SERIAL=1,this.EU_RECIPIENT_APPEND_TYPE_BY_KEY_ID=2,this.EU_CTX_HASH_ALGO_UNKNOWN=0,this.EU_CTX_HASH_ALGO_GOST34311=1,this.EU_CTX_HASH_ALGO_SHA160=2,this.EU_CTX_HASH_ALGO_SHA224=3,this.EU_CTX_HASH_ALGO_SHA256=4,this.EU_CTX_HASH_ALGO_SHA384=5,this.EU_CTX_HASH_ALGO_SHA512=6,this.EU_CTX_HASH_ALGO_DSTU7564_256=7,this.EU_CTX_HASH_ALGO_DSTU7564_384=8,this.EU_CTX_HASH_ALGO_DSTU7564_512=9,this.EU_CTX_SIGN_UNKNOWN=0,this.EU_CTX_SIGN_DSTU4145_WITH_GOST34311=1,this.EU_CTX_SIGN_RSA_WITH_SHA=2,this.EU_CTX_SIGN_ECDSA_WITH_SHA=3,this.EU_CTX_SIGN_DSTU4145_WITH_DSTU7564=4,this.EU_FILE_PROCESS_CHUNK_SIZE=1048576,this.EU_ASIC_TYPE_UNKNOWN=0,this.EU_ASIC_TYPE_S=1,this.EU_ASIC_TYPE_E=2,this.EU_ASIC_SIGN_TYPE_UNKNOWN=0,this.EU_ASIC_SIGN_TYPE_CADES=1,this.EU_ASIC_SIGN_TYPE_XADES=2,this.EU_ASIC_SIGN_LEVEL_BES=1,this.EnvelopToRecipientsEx=function(e,n,r,i){var o=this.m_library;return new t((function(t,s){o.EnvelopToRecipientsEx(e,n,r,i,t,s)}))},this.EnvelopToRecipientsWithDynamicKey=function(e,n,r,i){var o=this.m_library;return new t((function(t,s){o.EnvelopToRecipientsWithDynamicKey(e,n,r,i,t,s)}))},this.EnvelopToRecipientsWithSettings=function(e,n,r,i,o,s,a){var u=this.m_library;return new t((function(t,c){u.EnvelopToRecipientsWithSettings(e,n,r,i,o,s,a,t,c)}))},this.CtxEnvelop=function(e,n,r,i,o,s){var a=this.m_library;return new t((function(t,u){a.CtxEnvelop(e,n,r,i,o,s,t,u)}))},this.CtxEnvelopWithDynamicKey=function(e,n,r,i,o,s){var a=this.m_library;return new t((function(t,u){a.CtxEnvelopWithDynamicKey(e,n,r,i,o,s,t,u)}))},this.DevelopEx=function(e,n){void 0===n&&(n=null);var r=this.m_library;return new t((function(t,i){r.DevelopEx(e,n,t,i)}))},this.CtxDevelop=function(e,n,r){void 0===r&&(r=null);var i=this.m_library;return new t((function(t,o){i.CtxDevelop(e,n,r,t,o)}))},this.CtxCreateAuthData=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxCreateAuthData(e,n,r,t,o)}))},this.ProtectDataByPassword=function(e,n){var r=this.m_library;return new t((function(t,i){r.ProtectDataByPassword(e,n,t,i)}))},this.UnprotectDataByPassword=function(e,n){var r=this.m_library;return new t((function(t,i){r.UnprotectDataByPassword(e,n,t,i)}))},this.AppendTransportHeader=function(e,n,r,i,o){var s=this.m_library;return new t((function(t,a){s.AppendTransportHeader(e,n,r,i,o,t,a)}))},this.ParseTransportHeader=function(e){var n=this.m_library;return new t((function(t,r){n.ParseTransportHeader(e,t,r)}))},this.AppendCryptoHeader=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.AppendCryptoHeader(e,n,r,t,o)}))},this.ParseCryptoHeader=function(e){var n=this.m_library;return new t((function(t,r){n.ParseCryptoHeader(e,t,r)}))},this.GetHostInfo=function(){var e=this.m_library;return new t((function(t,n){e.GetHostInfo(t,n)}))},this.CtxCreate=function(){var e=this.m_library;return new t((function(t,n){e.CtxCreate(t,n)}))},this.CtxFree=function(e){var n=this.m_library;return new t((function(t,r){n.CtxFree(e,t,r)}))},this.CtxSetParameter=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxSetParameter(e,n,r,t,o)}))},this.ASiCGetASiCType=function(e){var n=this.m_library;return new t((function(t,r){n.ASiCGetASiCType(e,t,r)}))},this.ASiCGetSignType=function(e){var n=this.m_library;return new t((function(t,r){n.ASiCGetSignType(e,t,r)}))},this.ASiCGetSignsCount=function(e){var n=this.m_library;return new t((function(t,r){n.ASiCGetSignsCount(e,t,r)}))},this.ASiCGetSignerInfo=function(e,n){var r=this.m_library;return new t((function(t,i){r.ASiCGetSignerInfo(e,n,t,i)}))},this.ASiCGetSignTimeInfo=function(e,n){var r=this.m_library;return new t((function(t,i){r.ASiCGetSignTimeInfo(e,n,t,i)}))},this.CtxASiCSign=function(e,n,r,i,o,s){var a=this.m_library;return new t((function(t,u){a.CtxASiCSign(e,n,r,i,o,s,t,u)}))},this.CtxASiCAppendSign=function(e,n,r,i,o){var s=this.m_library;return new t((function(t,a){s.CtxASiCAppendSign(e,n,r,i,o,t,a)}))},this.ASiCVerify=function(e,n){var r=this.m_library;return new t((function(t,i){r.ASiCVerify(e,n,t,i)}))},this.CtxASiCGetSignerInfo=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxASiCGetSignerInfo(e,n,r,t,o)}))},this.ASiCGetSignLevel=function(e,n){var r=this.m_library;return new t((function(t,i){r.ASiCGetSignLevel(e,n,t,i)}))},this.PDFGetSignType=function(e,n){var r=this.m_library;return new t((function(t,i){r.PDFGetSignType(e,n,t,i)}))},this.PDFGetSignsCount=function(e){var n=this.m_library;return new t((function(t,r){n.PDFGetSignsCount(e,t,r)}))},this.PDFGetSignerInfo=function(e,n){var r=this.m_library;return new t((function(t,i){r.PDFGetSignerInfo(e,n,t,i)}))},this.PDFGetSignTimeInfo=function(e,n){var r=this.m_library;return new t((function(t,i){r.PDFGetSignTimeInfo(e,n,t,i)}))},this.CtxPDFSign=function(e,n,r,i){var o=this.m_library;return new t((function(t,s){o.CtxPDFSign(e,n,r,i,t,s)}))},this.PDFVerify=function(e,n){var r=this.m_library;return new t((function(t,i){r.PDFVerify(e,n,t,i)}))},this.CtxPDFGetSignerInfo=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxPDFGetSignerInfo(e,n,r,t,o)}))},this.XAdESGetType=function(e){var n=this.m_library;return new t((function(t,r){n.XAdESGetType(e,t,r)}))},this.XAdESGetSignsCount=function(e){var n=this.m_library;return new t((function(t,r){n.XAdESGetSignsCount(e,t,r)}))},this.XAdESGetSignLevel=function(e,n){var r=this.m_library;return new t((function(t,i){r.XAdESGetSignLevel(e,n,t,i)}))},this.XAdESGetSignerInfo=function(e,n){var r=this.m_library;return new t((function(t,i){r.XAdESGetSignerInfo(e,n,t,i)}))},this.XAdESGetSignTimeInfo=function(e,n){var r=this.m_library;return new t((function(t,i){r.XAdESGetSignTimeInfo(e,n,t,i)}))},this.CtxXAdESSign=function(e,n,r,i,o){var s=this.m_library;return new t((function(t,a){s.CtxXAdESSign(e,n,r,i,o,t,a)}))},this.XAdESVerify=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.XAdESVerify(e,n,r,t,o)}))},this.CtxXAdESGetSignerInfo=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxXAdESGetSignerInfo(e,n,r,t,o)}))},this.SServerClientGeneratePrivateKeyAsync=function(e,n,r,i,o,s,a,u,c,l,f){var _=this.m_library;return new t((function(t,p){_.SServerClientGeneratePrivateKeyAsync(e,n,r,i,o,s,a,u,c,l,f,t,p)}))},this.SServerClientCheckGeneratePrivateKeyStatus=function(e,n,r,i){var o=this.m_library;return new t((function(t,s){o.SServerClientCheckGeneratePrivateKeyStatus(e,n,r,i,t,s)}))},this.SServerClientSignHashesAsync=function(e,n,r,i,o,s,a,u){var c=this.m_library;return new t((function(t,l){c.SServerClientSignHashesAsync(e,n,r,i,o,s,a,u,t,l)}))},this.SServerClientCheckSignHashesStatus=function(e,n,r,i){var o=this.m_library;return new t((function(t,s){o.SServerClientCheckSignHashesStatus(e,n,r,i,t,s)}))},this.m_language=0,this.m_library=null}return e.prototype.MakeURL=function(t){var e=location.origin,n=location.pathname;return 0==t.indexOf("http://")||0==t.indexOf("https://")?t:0==t.indexOf("/")&&e?e+t:e&&n?e+n.substr(0,n.lastIndexOf("/"))+"/"+t:t},e.prototype.MakeError=function(t,e){return this.m_library.MakeError(t,e)},e.prototype.IsLibraryLoadError=function(t){return t==r.EndUserError.ERROR_LIBRARY_COMUNICATION_FAILED},e.prototype.IsLibraryVersionNotSupportedError=function(t){return t==r.EndUserError.ERROR_LIBRARY_VERSION_NOT_SUPPORTED},e.prototype.Load=function(){var e=this;return new t((function(t,n){if(null==e.m_library){var i=new r.EndUserLibraryLoader(r.EndUserLibraryLoader.LIBRARY_TYPE_DEFAULT,"euSign",e.m_language,!0,!0);i.onload=function(n){e.m_library=n,t()},i.onerror=function(t,e,i){null==i&&(i=new r.EUSignCP("","")),n(i.MakeError(e,""))},i.load()}else t()}))},e.prototype.IsSupported=function(){return r.EndUserLibraryLoader.isWebExtensionSupported()||r.EndUserLibraryLoader.isSignAgentSupported()||r.EndUserLibraryLoader.isNPAPISupported()||r.EndUserLibraryLoader.isActiveXSupported()},e.prototype.IsSignAgentSupported=function(){return r.EndUserLibraryLoader.isSignAgentSupported()},e.prototype.IsWebExtensionSupported=function(){return r.EndUserLibraryLoader.isWebExtensionSupported()},e.prototype.IsNPAPISupported=function(){return r.EndUserLibraryLoader.isNPAPISupported()},e.prototype.IsActiveXSupported=function(){return r.EndUserLibraryLoader.isActiveXSupported()},e.prototype.IsWebExtensionInstalled=function(){return r.EndUserLibraryLoader.isWebExtensionInstalled()},e.prototype.GetInstallURL=function(t,e){return void 0===t&&(t=!1),new r.EUSignCP("","").GetInstallURL(t,e)},e.prototype.GetUpdateURL=function(t,e){return void 0===t&&(t=!1),new r.EUSignCP("","").GetUpdateURL(t,e)},e.prototype.GetHelpURL=function(t){return new r.EUSignCP("","").GetHelpURL(t)},e.prototype.GetWebExtensionInstallURL=function(){return new r.EUSignCP("","").GetWebExtensionInstallURL()},e.prototype.GetVersion=function(){var e=this.m_library;return new t((function(t,n){e.GetVersion(t,n)}))},e.prototype.IsInitialized=function(){var e=this.m_library;return new t((function(t,n){e.IsInitialized(t,n)}))},e.prototype.Initialize=function(){var e=this.m_library;return new t((function(t,n){e.Initialize(t,n)}))},e.prototype.Finalize=function(){var e=this.m_library;return new t((function(t,n){e.Finalize(t,n)}))},e.prototype.ResetOperation=function(){var e=this.m_library;return new t((function(t,n){e.ResetOperation(t,n)}))},e.prototype.SetUIMode=function(e){var n=this.m_library;return new t((function(t,r){n.SetUIMode(e,t,r)}))},e.prototype.SetLanguage=function(e){var n=this.m_library;if("string"==typeof e)switch(e=e.toLocaleLowerCase()){case"en":e=this.EU_EN_LANG;break;case"ru":e=this.EU_RU_LANG;break;case"uk":case"ua":default:e=this.EU_UA_LANG}return this.m_language=e,new t((function(t,r){n.SetLanguage(e,t,r)}))},e.prototype.SetCharset=function(e){var n=this.m_library;return new t((function(t,r){n.SetCharset(e,t,r)}))},e.prototype.SetRuntimeParameter=function(e,n){var r=this.m_library;return new t((function(t,i){r.SetRuntimeParameter(e,n,t,i)}))},e.prototype.GetStorageParameter=function(e,n){var r=this.m_library;return new t((function(t,i){r.GetStorageParameter(e,n,t,i)}))},e.prototype.SetStorageParameter=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.SetStorageParameter(e,n,r,t,o)}))},e.prototype.BASE64Encode=function(e){var n=this.m_library;return new t((function(t,r){n.BASE64Encode(e,t,r)}))},e.prototype.BASE64Decode=function(e){var n=this.m_library;return new t((function(t,r){n.BASE64Decode(e,t,r)}))},e.prototype.StringToBytes=function(e){var n=this.m_library;return new t((function(t,r){n.StringToBytes(e,t,r)}))},e.prototype.BytesToString=function(e){var n=this.m_library;return new t((function(t,r){n.BytesToString(e,t,r)}))},e.prototype.DoesNeedSetSettings=function(){var e=this.m_library;return new t((function(t,n){e.DoesNeedSetSettings(t,n)}))},e.prototype.InitializeMandatorySettings=function(){var e=this.m_library;return new t((function(t,n){e.InitializeMandatorySettings(t,n)}))},e.prototype.CreateModeSettings=function(){return this.m_library.CreateModeSettings()},e.prototype.GetModeSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetModeSettings(t,n)}))},e.prototype.SetModeSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetModeSettings(e,t,r)}))},e.prototype.CreateKeyMediaSettings=function(){return this.m_library.CreateKeyMediaSettings()},e.prototype.GetKeyMediaSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetKeyMediaSettings(t,n)}))},e.prototype.SetKeyMediaSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetKeyMediaSettings(e,t,r)}))},e.prototype.CreateFileStoreSettings=function(){return this.m_library.CreateFileStoreSettings()},e.prototype.GetFileStoreSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetFileStoreSettings(t,n)}))},e.prototype.SetFileStoreSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetFileStoreSettings(e,t,r)}))},e.prototype.CreateProxySettings=function(){return this.m_library.CreateProxySettings()},e.prototype.GetProxySettings=function(){var e=this.m_library;return new t((function(t,n){e.GetProxySettings(t,n)}))},e.prototype.SetProxySettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetProxySettings(e,t,r)}))},e.prototype.CreateOCSPSettings=function(){return this.m_library.CreateOCSPSettings()},e.prototype.GetOCSPSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetOCSPSettings(t,n)}))},e.prototype.SetOCSPSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetOCSPSettings(e,t,r)}))},e.prototype.CreateOCSPAccessInfoModeSettings=function(){return this.m_library.CreateOCSPAccessInfoModeSettings()},e.prototype.GetOCSPAccessInfoModeSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetOCSPAccessInfoModeSettings(t,n)}))},e.prototype.SetOCSPAccessInfoModeSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetOCSPAccessInfoModeSettings(e,t,r)}))},e.prototype.CreateOCSPAccessInfoSettings=function(){return this.m_library.CreateOCSPAccessInfoSettings()},e.prototype.EnumOCSPAccessInfoSettings=function(e){var n=this.m_library;return new t((function(t,r){n.EnumOCSPAccessInfoSettings(e,t,r)}))},e.prototype.GetOCSPAccessInfoSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetOCSPAccessInfoSettings(t,n)}))},e.prototype.SetOCSPAccessInfoSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetOCSPAccessInfoSettings(e,t,r)}))},e.prototype.DeleteOCSPAccessInfoSettings=function(e){var n=this.m_library;return new t((function(t,r){n.DeleteOCSPAccessInfoSettings(e,t,r)}))},e.prototype.CreateTSPSettings=function(){return this.m_library.CreateTSPSettings()},e.prototype.GetTSPSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetTSPSettings(t,n)}))},e.prototype.SetTSPSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetTSPSettings(e,t,r)}))},e.prototype.CreateLDAPSettings=function(){return this.m_library.CreateLDAPSettings()},e.prototype.GetLDAPSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetLDAPSettings(t,n)}))},e.prototype.SetLDAPSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetLDAPSettings(e,t,r)}))},e.prototype.CreateCMPSettings=function(){return this.m_library.CreateCMPSettings()},e.prototype.GetCMPSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetCMPSettings(t,n)}))},e.prototype.SetCMPSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetCMPSettings(e,t,r)}))},e.prototype.GetSystemProxySettings=function(){var e=this.m_library;return new t((function(t,n){e.GetSystemProxySettings(t,n)}))},e.prototype.CreateTSLSettings=function(){return this.m_library.CreateTSLSettings()},e.prototype.GetTSLSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetTSLSettings(t,n)}))},e.prototype.SetTSLSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetTSLSettings(e,t,r)}))},e.prototype.SetOCSPResponseExpireTime=function(e){var n=this.m_library;return new t((function(t,r){n.SetOCSPResponseExpireTime(e,t,r)}))},e.prototype.GetCertificate=function(e,n){var r=this.m_library;return new t((function(t,i){r.GetCertificate(e,n,t,i)}))},e.prototype.ParseCertificateEx=function(e){var n=this.m_library;return new t((function(t,r){n.ParseCertificateEx(e,t,r)}))},e.prototype.SaveCertificate=function(e){var n=this.m_library;return new t((function(t,r){n.SaveCertificate(e,t,r)}))},e.prototype.SaveCertificates=function(e){var n=this.m_library;return new t((function(t,r){n.SaveCertificates(e,t,r)}))},e.prototype.GetTSPByAccessInfo=function(e,n,r,i){var o=this.m_library;return new t((function(t,s){o.GetTSPByAccessInfo(e,n,r,i,t,s)}))},e.prototype.CheckTSP=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CheckTSP(e,n,r,t,o)}))},e.prototype.DownloadData=function(e,n){var i=this;return new t((function(t,o){try{var s=new XMLHttpRequest;s.onload=function(){if(4==s.readyState){var a=null;try{if(200!=s.status)throw"Download data error. URL - "+e+", status - "+s.status;switch(n){case"binary":a=new Uint8Array(s.response);break;case"json":a=JSON.parse(s.responseText.replace(/\\'/g,"'"));break;default:a=s.responseText}}catch(t){return console.log("EndUser.DowloadData error: "+t),void o(i.MakeError(r.EndUserError.ERROR_DOWNLOAD_FILE,""))}t(a)}},s.onerror=function(){o(i.MakeError(r.EndUserError.ERROR_DOWNLOAD_FILE,""))},e=i.MakeURL(e),s.open("GET",e,!0),"binary"==n&&(s.responseType="arraybuffer"),s.send()}catch(t){o(i.MakeError(r.EndUserError.ERROR_DOWNLOAD_FILE,""))}}))},e.prototype.CreateKeyMedia=function(){return this.m_library.CreateKeyMedia()},e.prototype.GetPrivateKeyMedia=function(e){var n=this.m_library;return new t((function(t,r){n.GetPrivateKeyMedia(e,t,r)}))},e.prototype.EnumKeyMediaTypes=function(e){var n=this.m_library;return new t((function(t,r){n.EnumKeyMediaTypes(e,t,r)}))},e.prototype.EnumKeyMediaDevices=function(e,n){var r=this.m_library;return new t((function(t,i){r.EnumKeyMediaDevices(e,n,t,i)}))},e.prototype.GetKeyMediaTypes=function(){var e=this.m_library;return new t((function(t,n){e.GetKeyMediaTypes(t,n)}))},e.prototype.GetKeyMediaDevices=function(e){var n=this.m_library;return new t((function(t,r){n.GetKeyMediaDevices(e,t,r)}))},e.prototype.IsPrivateKeyReaded=function(){var e=this.m_library;return new t((function(t,n){e.IsPrivateKeyReaded(t,n)}))},e.prototype.ReadPrivateKey=function(){var e=this.m_library;return new t((function(t,n){e.ReadPrivateKey(t,n)}))},e.prototype.ReadPrivateKeySilently=function(e,n,r){var i=this.m_library;return new t((function(t,o){"number"==typeof e?i.ReadPrivateKeySilently(e,n,r,t,o):i.ReadPrivateKeySilently(e,t,o)}))},e.prototype.ReadPrivateKeyBinary=function(e,n){var r=this.m_library;return new t((function(t,i){r.ReadPrivateKeyBinary(e,n,t,i)}))},e.prototype.ReadPrivateKeyFile=function(e,n){var r=this.m_library;return new t((function(t,i){r.ReadPrivateKeyFile(e,n,t,i)}))},e.prototype.ResetPrivateKey=function(){var e=this.m_library;return new t((function(t,n){e.ResetPrivateKey(t,n)}))},e.prototype.CtxReadPrivateKey=function(e,n,r,i){var o=this.m_library;return new t((function(t,s){"number"==typeof n?o.CtxReadPrivateKey(e,n,r,i,t,s):o.CtxReadPrivateKey(e,n,t,s)}))},e.prototype.CtxReadPrivateKeyBinary=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxReadPrivateKeyBinary(e,n,r,t,o)}))},e.prototype.CtxFreePrivateKey=function(e){var n=this.m_library;return new t((function(t,r){n.CtxFreePrivateKey(e,t,r)}))},e.prototype.ShowOwnCertificate=function(){var e=this.m_library;return new t((function(t,n){e.ShowOwnCertificate(t,n)}))},e.prototype.GetOwnCertificate=function(e,n){var r=this.m_library;return new t((function(t,i){"number"==typeof e||"number"==typeof n?r.GetOwnCertificate(e,n,t,i):r.GetOwnCertificate(t,i)}))},e.prototype.GetOwnEUserParams=function(){var e=this.m_library;return new t((function(t,n){e.GetOwnEUserParams(t,n)}))},e.prototype.CtxGetOwnEUserParams=function(e){var n=this.m_library;return new t((function(t,r){n.CtxGetOwnEUserParams(e,t,r)}))},e.prototype.ModifyOwnEUserParams=function(e,n){var r=this.m_library;return new t((function(t,i){r.ModifyOwnEUserParams(e,n,t,i)}))},e.prototype.CtxModifyOwnEUserParams=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxModifyOwnEUserParams(e,n,r,t,o)}))},e.prototype.EnumOwnCertificates=function(e){var n=this.m_library;return new t((function(t,r){n.EnumOwnCertificates(e,t,r)}))},e.prototype.GetPrivateKeyOwnerInfo=function(){var e=this.m_library;return new t((function(t,n){e.GetPrivateKeyOwnerInfo(t,n)}))},e.prototype.CtxEnumOwnCertificates=function(e,n){var r=this.m_library;return new t((function(t,i){r.CtxEnumOwnCertificates(e,n,t,i)}))},e.prototype.CtxGetOwnCertificate=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxGetOwnCertificate(e,n,r,t,o)}))},e.prototype.GetKeyInfo=function(e){var n=this.m_library;return new t((function(t,r){n.GetKeyInfo(e,t,r)}))},e.prototype.GetKeyInfoBinary=function(e,n){var r=this.m_library;return new t((function(t,i){r.GetKeyInfoBinary(e,n,t,i)}))},e.prototype.GetKeyInfoFile=function(e,n){var r=this.m_library;return new t((function(t,i){r.GetKeyInfoFile(e,n,t,i)}))},e.prototype.GetCertificatesByKeyInfo=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.GetCertificatesByKeyInfo(e,n,r,t,o)}))},e.prototype.EnumJKSPrivateKeys=function(e,n){var r=this.m_library;return new t((function(t,i){r.EnumJKSPrivateKeys(e,n,t,i)}))},e.prototype.GetJKSPrivateKey=function(e,n){var r=this.m_library;return new t((function(t,i){r.GetJKSPrivateKey(e,n,t,i)}))},e.prototype.CreatePrivateKeyInfo=function(){return this.m_library.CreatePrivateKeyInfo()},e.prototype.CreateEndUserInfo=function(){return this.m_library.CreateEndUserInfo()},e.prototype.GeneratePrivateKeyEx=function(e,n,r,i,o,s,a,u,c,l,f,_,p,h,E,y,S){var C=this.m_library;return new t((function(t,d){C.GeneratePrivateKeyEx(e,n,r,i,o,s,a,u,c,l,f,_,p,h,E,y,S,t,d)}))},e.prototype.ChangePrivateKeyPassword=function(e,n){var r=this.m_library;return new t((function(t,i){null!=e?r.ChangePrivateKeyPassword(e.GetTypeIndex(),e.GetDevIndex(),e.GetPassword(),n,t,i):r.ChangePrivateKeyPassword(t,i)}))},e.prototype.ChangeSoftwarePrivateKeyPassword=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.ChangeSoftwarePrivateKeyPassword(e,n,r,t,o)}))},e.prototype.SetKeyMediaUserPassword=function(e,n){var r=this.m_library;return new t((function(t,i){null!=n?r.SetKeyMediaUserPassword(e,n.GetTypeIndex(),n.GetDevIndex(),n.GetPassword(),t,i):r.SetKeyMediaUserPassword(e,t,i)}))},e.prototype.ChangeOwnCertificatesStatus=function(e,n){var r=this.m_library;return new t((function(t,i){r.ChangeOwnCertificatesStatus(e,n,t,i)}))},e.prototype.CtxChangeOwnCertificatesStatus=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxChangeOwnCertificatesStatus(e,n,r,t,o)}))},e.prototype.MakeNewCertificate=function(e,n,r,i,o,s,a,u,c,l,f,_,p){var h=this.m_library;return new t((function(t,E){h.MakeNewCertificate(e,n,r,i,o,s,a,u,c,l,f,_,p,t,E)}))},e.prototype.MakeNewOwnCertificate=function(e,n,r,i,o,s,a,u){var c=this.m_library;return new t((function(t,l){c.MakeNewOwnCertificate(e,n,r,i,o,s,a,u,t,l)}))},e.prototype.CtxMakeNewOwnCertificate=function(e,n,r,i,o,s,a,u,c){var l=this.m_library;return new t((function(t,f){l.CtxMakeNewOwnCertificate(e,n,r,i,o,s,a,u,c,t,f)}))},e.prototype.CtxMakeNewOwnCertificateWithCR=function(e,n,r,i,o){var s=this.m_library;return new t((function(t,a){s.CtxMakeNewOwnCertificateWithCR(e,n,r,i,o,t,a)}))},e.prototype.CtxMakeDeviceCertificate=function(e,n,r,i,o,s,a,u){var c=this.m_library;return new t((function(t,l){c.CtxMakeDeviceCertificate(e,n,r,i,o,s,a,u,t,l)}))},e.prototype.CtxHash=function(e,n,r,i){var o=this.m_library;return new t((function(t,s){o.CtxHash(e,n,r,i,t,s)}))},e.prototype.CtxHashBegin=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxHashBegin(e,n,r,t,o)}))},e.prototype.CtxHashContinue=function(e,n){var r=this.m_library;return new t((function(t,i){r.CtxHashContinue(e,n,t,i)}))},e.prototype.CtxHashEnd=function(e){var n=this.m_library;return new t((function(t,r){n.CtxHashEnd(e,t,r)}))},e.prototype.CtxHashFree=function(e){var n=this.m_library;return new t((function(t,r){n.CtxHashFree(e,t,r)}))},e.prototype.GetSignType=function(e,n){var r=this.m_library;return new t((function(t,i){r.GetSignType(e,n,t,i)}))},e.prototype.CtxGetSignerInfo=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxGetSignerInfo(e,n,r,t,o)}))},e.prototype.SignHash=function(e){var n=this.m_library;return new t((function(t,r){n.SignHash(e,t,r)}))},e.prototype.Sign=function(e){var n=this.m_library;return new t((function(t,r){n.Sign(e,t,r)}))},e.prototype.SignInternal=function(e,n){var r=this.m_library;return new t((function(t,i){r.SignInternal(e,n,t,i)}))},e.prototype.SignHashRSA=function(e){var n=this.m_library;return new t((function(t,r){n.SignHashRSA(e,t,r)}))},e.prototype.SignRSA=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.SignRSA(e,n,r,t,o)}))},e.prototype.CtxSignHash=function(e,n,r,i){var o=this.m_library;return new t((function(t,s){o.CtxSignHash(e,n,r,i,t,s)}))},e.prototype.CtxSign=function(e,n,r,i,o){var s=this.m_library;return new t((function(t,a){s.CtxSign(e,n,r,i,o,t,a)}))},e.prototype.CtxSignFile=function(e,n,r,i,o,s){var a=this.m_library;return new t((function(t,u){a.CtxSignFile(e,n,r,i,o,s,t,u)}))},e.prototype.CtxGetSignValue=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxGetSignValue(e,n,r,t,o)}))},e.prototype.AppendSignHash=function(e,n){var r=this.m_library;return new t((function(t,i){r.AppendSignHash(e,n,t,i)}))},e.prototype.AppendSign=function(e,n){var r=this.m_library;return new t((function(t,i){r.AppendSign(e,n,t,i)}))},e.prototype.AppendSignInternal=function(e,n){var r=this.m_library;return new t((function(t,i){r.AppendSignInternal(e,n,t,i)}))},e.prototype.CtxAppendSignHash=function(e,n,r,i,o){var s=this.m_library;return new t((function(t,a){s.CtxAppendSignHash(e,n,r,i,o,t,a)}))},e.prototype.CtxAppendSign=function(e,n,r,i,o){var s=this.m_library;return new t((function(t,a){s.CtxAppendSign(e,n,r,i,o,t,a)}))},e.prototype.CtxAppendSignFile=function(e,n,r,i,o,s){var a=this.m_library;return new t((function(t,u){a.CtxAppendSignFile(e,n,r,i,o,s,t,u)}))},e.prototype.IsDataInSignedDataAvailable=function(e){var n=this.m_library;return new t((function(t,r){n.IsDataInSignedDataAvailable(e,t,r)}))},e.prototype.GetCertificateFromSignedData=function(e,n){var r=this.m_library;return new t((function(t,i){r.GetCertificateFromSignedData(e,n,t,i)}))},e.prototype.GetSignsCount=function(e){var n=this.m_library;return new t((function(t,r){n.GetSignsCount(e,t,r)}))},e.prototype.GetSignTimeInfo=function(e,n){var r=this.m_library;return new t((function(t,i){r.GetSignTimeInfo(e,n,t,i)}))},e.prototype.VerifyHashOnTimeEx=function(e,n,r,i,o,s){var a=this.m_library;return new t((function(t,u){a.VerifyHashOnTimeEx(e,n,r,i,o,s,t,u)}))},e.prototype.VerifyDataOnTimeEx=function(e,n,r,i,o,s){var a=this.m_library;return new t((function(t,u){a.VerifyDataOnTimeEx(e,n,r,i,o,s,t,u)}))},e.prototype.VerifyDataInternalOnTimeEx=function(e,n,r,i,o){var s=this.m_library;return new t((function(t,a){s.VerifyDataInternalOnTimeEx(e,n,r,i,o,t,a)}))},e.prototype.CreateReference=function(t,e){return this.m_library.CreateReference(t,e)},e}();e.a=i}).call(this,n(17).Promise)},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var u,c=[],l=!1,f=-1;function _(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&p())}function p(){if(!l){var t=a(_);l=!0;for(var e=c.length;e;){for(u=c,c=[];++f<e;)u&&u[f].run();f=-1,e=c.length}u=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function E(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new h(t,e)),1!==c.length||l||a(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=E,i.addListener=E,i.once=E,i.off=E,i.removeListener=E,i.removeAllListeners=E,i.emit=E,i.prependListener=E,i.prependOnceListener=E,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){}])}));