graphdb-workbench 2.1.2-RC1 → 2.1.2
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/dist/12.c008cc99a0d358fd58b7.bundle.js +1 -1
- package/dist/12.c008cc99a0d358fd58b7.bundle.js.map +1 -1
- package/dist/136.3199d393576be61f53fd.bundle.js +1 -1
- package/dist/136.3199d393576be61f53fd.bundle.js.map +1 -1
- package/dist/19.b5b3699a309774176fc3.bundle.js +1 -1
- package/dist/19.b5b3699a309774176fc3.bundle.js.map +1 -1
- package/dist/26.176ffe2071a8d5d382b6.bundle.js +1 -1
- package/dist/26.176ffe2071a8d5d382b6.bundle.js.map +1 -1
- package/dist/31.4ecdb66b2c224a63525e.bundle.js +1 -1
- package/dist/31.4ecdb66b2c224a63525e.bundle.js.map +1 -1
- package/dist/37.ef412d4cbc60967faa5e.bundle.js +1 -1
- package/dist/37.ef412d4cbc60967faa5e.bundle.js.map +1 -1
- package/dist/83.73515cde0a2215275d32.bundle.js +1 -1
- package/dist/83.73515cde0a2215275d32.bundle.js.map +1 -1
- package/dist/bundle.595d7082ecc6c2683c9a.bundle.js +2 -2
- package/dist/bundle.595d7082ecc6c2683c9a.bundle.js.map +1 -1
- package/dist/index.html +2 -2
- package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
- package/dist/pages/autocomplete.html +1 -1
- package/dist/pages/choose-repository-type.html +1 -1
- package/dist/pages/cluster-management/clusterInfo.html +3 -3
- package/dist/pages/create-index.html +4 -4
- package/dist/pages/dependencies.html +1 -1
- package/dist/pages/domainRangeInfo.html +2 -2
- package/dist/pages/edit.html +1 -1
- package/dist/pages/explore.html +1 -1
- package/dist/pages/export.html +1 -1
- package/dist/pages/find.html +1 -1
- package/dist/pages/graph-config/saveGraphConfig.html +11 -11
- package/dist/pages/graphs-visualizations.html +7 -7
- package/dist/pages/guides.html +1 -1
- package/dist/pages/import.html +1 -1
- package/dist/pages/jdbc-create.html +5 -5
- package/dist/pages/monitor/queries.html +1 -1
- package/dist/pages/monitor/resources.html +2 -2
- package/dist/pages/namespaces.html +2 -2
- package/dist/pages/plugins.html +1 -1
- package/dist/pages/rdfClassHierarchyInfo.html +7 -7
- package/dist/pages/rdfrank.html +2 -2
- package/dist/pages/repositories.html +2 -2
- package/dist/pages/repository.html +2 -2
- package/dist/pages/similarity-indexes.html +1 -1
- package/dist/pages/sparql-template-create.html +5 -5
- package/dist/pages/sparql.html +3 -3
- package/dist/pages/webapi.html +2 -2
- package/dist/res/swagger/index.html +27 -27
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t){function e(e){for(var n,i,s=e[0],o=e[1],a=0,c=[];a<s.length;a++)i=s[a],Object.prototype.hasOwnProperty.call(r,i)&&r[i]&&c.push(r[i][0]),r[i]=0;for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n]);for(u&&u(e);c.length;)c.shift()()}var n={},r={124:0};function i(e){if(n[e])return n[e].exports;var r=n[e]={i:e,l:!1,exports:{}};return t[e].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.e=function(t){var e=[],n=r[t];if(0!==n)if(n)e.push(n[2]);else{var s=new Promise((function(e,i){n=r[t]=[e,i]}));e.push(n[2]=s);var o,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(t){return i.p+""+({}[t]||t)+"."+{0:"1bd9b49fd9f95db7afda",1:"f95de05c8259e369ca9e",2:"a574cb520c748d9f8d48",3:"82bc14d92c4e25a654be",4:"807e4985b1b0c86a627d",5:"485cd176a5ff0ee389ab",6:"95b7073a568fb73c9148",7:"27bac500c846ad899949",8:"b21d6a5c1a9412deb34f",9:"792187f02fb63192bb83",10:"cabc799d9aabc46e7be7",11:"b2fd98471071348c3964",12:"c008cc99a0d358fd58b7",13:"9b9388352980715b16bb",14:"c512cd1282fe7dec36bf",15:"e870cbcf6346cc68bd66",16:"23e12f234078c8777ed0",17:"d1ac5f88f9ef9ee1c789",18:"63478730d60e02069d90",19:"b5b3699a309774176fc3",20:"d707dfb57f695469ffaa",21:"d5214e697ec9f78652d2",22:"e1562d53daf95dd1fdca",23:"c1b822e6ccc61632355b",24:"740f8b8ec6dd9bb85f67",25:"8c30b7bafb4875a3cc51",26:"176ffe2071a8d5d382b6",27:"be71055c959c1ac75177",28:"af25c8fe6f70c61986cc",29:"54cbff989a44a0f71dfd",30:"238b3282d752df6de2d5",31:"4ecdb66b2c224a63525e",32:"2582e2eccf29e8d5ec80",33:"04790d6b317f0eade307",34:"100b126b4d89e99d4ac4",35:"d2e8f044641a95e453c0",36:"ffb83c2faa7e64cfae57",37:"ef412d4cbc60967faa5e",38:"7deea9e0319084f9f852",39:"be2d8c75e4ab391ba984",40:"9272ebe1d2246ae3054f",41:"f69dd805b7e51756518f",42:"16be14526c7bf039754b",43:"f76be157f75bc7b3ea68",44:"ccd45256fba55ce28d80",45:"f1cb114b656ef4af2bc5",46:"a9d1c07290ab98930744",47:"e3d0e12eb54f0ea80c7b",48:"3c8d17c03f3fc081be89",49:"b4fe44e1a4aeeeb8a39e",50:"6e68d9b649f03d5744b9",51:"d023fa9b3d250baf210b",52:"d84c24bdb469228ecf87",53:"8cf4f5609ed4e19b7426",54:"b7813e67817fea3ffff5",55:"10bb020070b8c5910e4c",56:"f7576b85862142bb7673",57:"f432e4a7f6dbf5fa9e6e",58:"4666a30220eb06c98de3",59:"feebf4602360cb8257bb",60:"854353939d8597b39221",61:"119fc16a46b4ac7fb477",62:"efe6729fb3185cbab1b1",63:"8a51fd07dd8d92177b89",64:"acc32081892f499d8ff3",65:"75e5679260f79e06a315",66:"d0ee50381c28966b1105",67:"58d8539fcac19288b820",68:"9428f49abea727e95256",69:"c88dd57b21890c058b3d",70:"ede527b8438e19a67ebc",71:"2ddcb945966fd051a3a1",72:"d2f8a53e83efcb8ab953",73:"c29f06e5825684d56a9c",74:"b50a23c1751e0fc30aec",75:"4f9197361b6427d97b6c",76:"467d072ae323ab41fd3d",77:"41a60a354d0fb3103b00",78:"7de8a0f70f6dc1debd05",79:"2f8b2ebcbd07d466c913",80:"8e71a1aaf3beb2320bf0",81:"2939c5d2b47cf48be6d5",82:"69913e9f45a1dd96c6be",83:"73515cde0a2215275d32",84:"5e89f3253c2c5885f662",85:"f6ae072160876c4c5beb",86:"4b571d114bba8ed6a350",87:"69eaa604c4d381ec2340",88:"4bfa7b74511d52c5c42f",89:"6e767bc84921c435570c",90:"5c5efc19e9053c029343",91:"8e7850e1155a0f57ff60",92:"b601c9bc8133fcf28163",93:"d4fb5fe720a8d95b2b37",94:"4b1ada797602e279b977",95:"95758068abd9eac4ed40",96:"a4044cdbb3c9f43d86d3",97:"9c2220bd069a1fa37786",98:"8f1b6e94748a6049ed93",99:"0613c1081ad54e17d927",100:"24bbc960b22ec8f26f68",101:"05350fca3dae5c1ef48a",102:"634314c6ee0d129a753e",103:"7d1e3b45f592f13c0bf1",104:"cec277cc444af58efc38",105:"2131aef847d9db645b1a",106:"d8e91ce7c4e16ae96137",107:"21cdf58f864dc9c34960",108:"ff55b38321cd246e0f10",109:"3683904d9ad66df4fe4d",110:"7419abdcd9b1e7b062ad",111:"87635664a5306fc0c6bb",112:"1e565aafd51348ccc32e",113:"2a67bc73a80f0bbf6397",114:"ed2c2d1606cd75dbd7c6",115:"6751a154fb77d1efeec8",116:"75f79d13526f131b61f0",117:"17c60bd040eada2f965d",118:"fc48834f75995ef9202f",119:"44cc6552449537efa8f5",120:"8f48d9b3f8071e4c42fd",121:"f67bb6e90ebd1fee8e30",122:"40527e7a2b7988df1412",123:"866135438008613c5648",127:"026f4ba40e9ec421ef6d",128:"576c4127811b9427dd34",129:"eec124fd2198bff8c473",130:"00a43422f7369916f8be",131:"58b34c4cc71284c7dd69",132:"d9c09b5b823bc08e44a2",133:"40f6db8ba6086a250def",134:"cd1e72606e3566aa2381",135:"5969091e7450f267d7d1",136:"3199d393576be61f53fd",137:"c4f55132ebf517a9973c",138:"345b94a854312dbbaed1",139:"8c3a64d2c82b5b24b083",140:"f9f6709a29ac8b6eec8b",141:"7e703e35c921c84e3bb2",142:"f5a17f658960cb0ff844",143:"ae4bf6eb11e0623aaeb3",144:"6da8664c45932c2856eb",145:"a933d88618b8708d4be4",146:"f796afb9dfe90b1a63c1",147:"6c1252af29b91cdcbcde",148:"9cf53d87afdee45026b2",149:"8e13fb8987a3c37b0378",150:"beaa2fdbe70cc1686c65",151:"6193611cf1ffcc80508a",152:"7fecd985345140837105",153:"c6edb6c09e02a9fa3773",154:"6b8dee2bec5f5395e2ae",155:"96bb3fe77f3c27d6e255",156:"97f2defa2d8196febdf6",157:"40d39dd2463339b6336a",158:"732698a148ed18f790c4",159:"ffa8314699aaa5682fc9",160:"763ca579c94b0c1f7e0c",161:"d311e07a99e3170c6e36",162:"d47b8b8e879e576d959f",163:"8900e66d40917925ada6",164:"7ee6c0b961afd793013c",165:"376c7fbe283d31b68f38",166:"3d9124c1244ea496e32a",167:"ecd03842094984a7a879",168:"eae500060443da4e7972",169:"79980a5bece6dd7eae21",170:"883d200d0c571b72e614",171:"ebb1cf04508fe47600ff",172:"86384ebb60cd0c4bc234",173:"3228bfad91bff600c322",174:"f88467a420b2270009e6",175:"5ea68d979df50218cc7a"}[t]+".bundle.js"}(t);var u=new Error;o=function(e){a.onerror=a.onload=null,clearTimeout(c);var n=r[t];if(0!==n){if(n){var i=e&&("load"===e.type?"missing":e.type),s=e&&e.target&&e.target.src;u.message="Loading chunk "+t+" failed.\n("+i+": "+s+")",u.name="ChunkLoadError",u.type=i,u.request=s,n[1](u)}r[t]=void 0}};var c=setTimeout((function(){o({type:"timeout",target:a})}),12e4);a.onerror=a.onload=o,document.head.appendChild(a)}return Promise.all(e)},i.m=t,i.c=n,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i.oe=function(t){throw console.error(t),t};var s=window.webpackJsonp=window.webpackJsonp||[],o=s.push.bind(s);s.push=e,s=s.slice();for(var a=0;a<s.length;a++)e(s[a]);var u=o;i(i.s=0)}([function(t,e,n){"use strict";n.r(e),n.d(e,"decodeHTML",(function(){return r}));n(4),n(26),n(31),n(190),n(37),n(191),n(21),n(32),n(33);const r=function(t){let e=document.createElement("textarea");return e.innerHTML=t,e.value},i=["ngRoute","graphdb.workbench.se.controllers","graphdb.framework.core","angularCancelOnNavigateModule","oc.lazyLoad","pascalprecht.translate","graphdb.framework.core.interceptors.unauthorized","graphdb.framework.core.directives.rdfresourcesearch.rdfresourcesearch","graphdb.framework.core.directives.languageselector.languageselector","graphdb.framework.guides.services"],s=["$routeProvider","$locationProvider","$menuItemsProvider","toastrConfig","localStorageServiceProvider","$tooltipProvider","$httpProvider","$templateRequestProvider","$translateProvider"];$.get("rest/info/version?local=1",(function(t){const e=t.productVersion.match(/^(\d+\.\d+)/);e.length?t.productShortVersion=e[1]:t.productShortVersion=t.productVersion;const o=t.productVersion.match(/(-.*?)(-|$)/);o&&o.length&&(t.productShortVersion=t.productShortVersion+o[1]),function(t){const e=angular.module("graphdb.workbench",i);e.config([...s,function(e,r,i,s,o,a,u,c,l){l.useStaticFilesLoader({prefix:"i18n/locale-",suffix:".json?v=2.1.2-RC1"}),l.preferredLanguage("en"),l.useSanitizeValueStrategy("escape"),angular.extend(s,{timeOut:5e3,positionClass:"toast-bottom-right",tapToDismiss:!1,extendedTimeOut:5e3}),o.setStorageType("localStorage").setNotify(!0,!0);var h=e.$get[e.$get.length-1]({$on:function(){}});e.when("_openid_implicit_",{controller:function(){},template:"<div></div>"}),h.routes._openid_implicit_.regexp=/[&/](?:id_token=.*&access_token=|access_token=.*&id_token=)/;let f=PluginRegistry.get("route");angular.forEach(f,(function(t){e.when(t.url,{controller:t.controller,templateUrl:t.templateUrl,title:t.title,helpInfo:t.helpInfo,reloadOnSearch:void 0===t.reloadOnSearch||t.reloadOnSearch,resolve:{preload:["$ocLazyLoad","$q",function(e,r){return t.path?n(192)("./"+t.path).then(n=>{e.inject(t.module)}):r.defer().resolve()}]}})})),e.otherwise({templateUrl:"pages/not_found.html"}),r.html5Mode(!0),a.setTriggers({show:"hide"}),a.options({appendToBody:!0}),i.setProductInfo(t),PluginRegistry.get("main.menu").forEach((function(t){t.items.forEach((function(t){i.addItem(t)}))})),u.interceptors.push("$unauthorizedInterceptor");const p=c.$get[3];"function"==typeof p&&(c.$get[3]=function(t,e,n){const r=p(t,e,n);return function(e,n){return t.get(e)||(e+="?v=2.1.2-RC1"),r(e,n)}})}]),e.constant("productInfo",t),e.run(["$rootScope","$route","toastr","$sce","$translate","LocalStorageAdapter","LSKeys","GuidesService",function(t,e,n,i,s,o,a,u){function c(){e.current.title?document.title=r(s.instant(e.current.title))+" | GraphDB Workbench":document.title="GraphDB Workbench",t.helpInfo=i.trustAsHtml(r(s.instant(e.current.helpInfo))),t.title=r(s.instant(e.current.title))}t.$on("$routeChangeSuccess",(function(){c(),n.clear()})),t.$on("$translateChangeSuccess",(function(){c()}));const l=o.get(a.WORKBENCH_SETTINGS);if(l&&l.theme){const t=document.querySelector(":root");"dark"===l.theme&&t.classList.add("dark")}u.init()}]),e.filter("titlecase",(function(){return function(t){var e=""+t;return e.charAt(0).toUpperCase()+e.slice(1)}})),angular.bootstrap(document,["graphdb.workbench"])}(t)}))},function(t,e,n){"use strict";n.r(e),n.d(e,"GuideUtils",(function(){return r}));const r=function(){const t=function(t,e){return r.clickOnElement(r.getGuideElementSelector(t,e))},e=function(t,e=1,n=!0){const r=l(t);return new Promise((function(t,i){let s=1e3*e|1e3;const o=setInterval(()=>{try{const e=document.querySelector(r);null!=e?!n||angular.element(e).is(":visible")?(clearInterval(o),setTimeout(()=>{t(angular.element(e))},0)):(s-=100,s<0&&(clearInterval(o),console.log("Element is not visible: "+r),i())):(s-=100,s<0&&(clearInterval(o),console.log("Element is not found: "+r),i()))}catch(t){clearInterval(o),console.log("Error when processing selector: "+r),console.log(t),i(t)}},100)}))},n=function(t){const e=document.querySelector(t);return e&&angular.element(e).is(":visible")},i=function(t,e){return`[guide-selector="${t}"] ${e||""}`},s=(t,e,n,r)=>{const i=t.use();let s;return angular.isObject(n)?(s=n[i],s||(s=n.en),s=e(s)(r)):s=o(t.instant(n,r)),s},o=t=>{const e=document.createElement("div");return e.innerHTML=t,e.innerText},a=t=>i("queryEditor",t?".CodeMirror-code "+t:".CodeMirror-code"),u=t=>i("yasrResults",t),c=t=>angular.element(t).is(":checked"),l=t=>angular.isFunction(t)?t():t;return{GUIDES_LIST_URL:"rest/guides",GUIDES_DOWNLOAD_URL:"rest/guides/download/",waitFor:e,clickOnElement:function(t){return()=>e(t).then(t=>t.click())},clickOnGuideElement:t,getGuideElementSelector:i,isVisible:n,isGuideElementVisible:function(t){return n(i(t))},awaitAlphaDropD3:function(t,e,r=2,i=.02){return()=>new Promise((function(s){n(t)?s():setTimeout(()=>{let t=1e3*r;const n=setInterval(()=>{e.d3alpha<i?(clearInterval(n),s()):(t-=100,t<0&&(clearInterval(n),s()))},100)},150)}))},graphVizExpandNode:function(t){const e=d3.select(t),n=new CustomEvent("gdb-expand-node",{detail:e.datum()});e.node().dispatchEvent(n)},graphVizShowNodeInfo:function(t){const e=d3.select(t),n=new CustomEvent("gdb-show-node-info",{detail:e.datum()});e.node().dispatchEvent(n)},classHierarchyFocus:function(t){const e=d3.select(t),n=new CustomEvent("gdb-focus",{detail:e.datum()});e.node().dispatchEvent(n)},classHierarchyZoom:function(t){const e=d3.select(t),n=new CustomEvent("gdb-zoom",{detail:e.datum()});e.node().dispatchEvent(n)},validateTextInput:function(t,e,n=!0){const r=$(t).val();return""===r&&n?($(t).val(e),$(t).trigger("change"),!0):r===e},translateLocalMessage:s,unescapeHtml:o,noNextErrorToast:(t,e,n,r,i)=>{t.error(o(s(e,n,r,i)),o(s(e,n,"guide.validate.no-next",i)),{allowHtml:!0})},deferredShow:t=>()=>new Promise((function(e){setTimeout(()=>{e()},t)})),scrollToTop:()=>{window.scrollTo(0,0)},removeWhiteSpaces:t=>t.replace(/\s+/g,""),toResourceDownloadUrl:t=>"rest/guides/download/"+t.resourcePath+"/"+t.resourceFile,getSparqlEditorSelector:a,getSparqlResultsSelector:u,getSparqlResultsSelectorForIri:t=>u("a[title='"+t+"']"),getSparqlResultsSelectorForRow:t=>u("tbody tr:nth-child("+t+")"),isChecked:c,isGuideElementChecked:(t,e)=>c(r.getGuideElementSelector("autocompleteCheckbox",e)),defaultInitPreviousStep:(t,e)=>new Promise((function(n,r){const i=t.ShepherdService.getPreviousStepFromHistory(e);i?i.options.initPreviousStep(t,i.options.id).then(()=>n()).catch(t=>r(t)):n()})),getElementSelector:l,executeSparqlQuery:(n,r,i,s=!1)=>new Promise((o,u)=>{s?(n.url("/sparql"),r.reload(),e(a()).then(()=>{e(".no-query-run").then(()=>{window.editor.setValue(i),t("runSparqlQuery")().then(()=>o()).catch(t=>u(t))}).catch(t=>u(t))}).catch(t=>u(t))):(window.editor.setValue(i),t("runSparqlQuery")().then(()=>o()).catch(t=>u(t)))})}}()},function(t,e,n){"use strict";n.r(e),n.d(e,"UserType",(function(){return i})),n.d(e,"UserRole",(function(){return r})),n.d(e,"UserUtils",(function(){return s}));const r=Object.freeze({ROLE_ADMIN:"ROLE_ADMIN",ROLE_USER:"ROLE_USER",ROLE_REPO_MANAGER:"ROLE_REPO_MANAGER"}),i=Object.freeze({ADMIN:"admin",USER:"user",REPO_MANAGER:"repoManager"}),s={getUserRoleName:function(t){switch(t){case i.USER:return"User";case i.REPO_MANAGER:return"Repository manager";case i.ADMIN:return"Administrator";default:return"Unknown"}}}},function(t,e,n){(function(t){var n,r,i,s,o,a,u,c,l,h,f,p={userAgent:!1},d={},g=g||(n=Math,i=(r={}).lib={},s=i.Base=function(){function t(){}return{extend:function(e){t.prototype=this;var n=new t;return e&&n.mixIn(e),n.hasOwnProperty("init")||(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),o=i.WordArray=s.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||u).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,i=t.sigBytes;if(this.clamp(),r%4)for(var s=0;s<i;s++){var o=n[s>>>2]>>>24-s%4*8&255;e[r+s>>>2]|=o<<24-(r+s)%4*8}else for(s=0;s<i;s+=4)e[r+s>>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,e=this.sigBytes;t[e>>>2]&=4294967295<<32-e%4*8,t.length=n.ceil(e/4)},clone:function(){var t=s.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r<t;r+=4)e.push(4294967296*n.random()|0);return new o.init(e,t)}}),a=r.enc={},u=a.Hex={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i<n;i++){var s=e[i>>>2]>>>24-i%4*8&255;r.push((s>>>4).toString(16)),r.push((15&s).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new o.init(n,e/2)}},c=a.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i<n;i++){var s=e[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(s))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r++)n[r>>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new o.init(n,e)}},l=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},h=i.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=l.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(t){var e=this._data,r=e.words,i=e.sigBytes,s=this.blockSize,a=i/(4*s),u=(a=t?n.ceil(a):n.max((0|a)-this._minBufferSize,0))*s,c=n.min(4*u,i);if(u){for(var l=0;l<u;l+=s)this._doProcessBlock(r,l);var h=r.splice(0,u);e.sigBytes-=c}return new o.init(h,c)},clone:function(){var t=s.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),i.Hasher=h.extend({cfg:s.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,n){return new t.init(n).finalize(e)}},_createHmacHelper:function(t){return function(e,n){return new f.HMAC.init(t,n).finalize(e)}}}),f=r.algo={},r);!function(t){var e,n=(e=g).lib,r=n.Base,i=n.WordArray;(e=e.x64={}).Word=r.extend({init:function(t,e){this.high=t,this.low=e}}),e.WordArray=r.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:8*t.length},toX32:function(){for(var t=this.words,e=t.length,n=[],r=0;r<e;r++){var s=t[r];n.push(s.high),n.push(s.low)}return i.create(n,this.sigBytes)},clone:function(){for(var t=r.clone.call(this),e=t.words=this.words.slice(0),n=e.length,i=0;i<n;i++)e[i]=e[i].clone();return t}})}(),g.lib.Cipher||function(t){var e=(p=g).lib,n=e.Base,r=e.WordArray,i=e.BufferedBlockAlgorithm,s=p.enc.Base64,o=p.algo.EvpKDF,a=e.Cipher=i.extend({cfg:n.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,n){this.cfg=this.cfg.extend(n),this._xformMode=t,this._key=e,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(t){return{encrypt:function(e,n,r){return("string"==typeof n?d:f).encrypt(t,e,n,r)},decrypt:function(e,n,r){return("string"==typeof n?d:f).decrypt(t,e,n,r)}}}});e.StreamCipher=a.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var u=p.mode={},c=function(t,e,n){var r=this._iv;r?this._iv=void 0:r=this._prevBlock;for(var i=0;i<n;i++)t[e+i]^=r[i]},l=(e.BlockCipherMode=n.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}})).extend();l.Encryptor=l.extend({processBlock:function(t,e){var n=this._cipher,r=n.blockSize;c.call(this,t,e,r),n.encryptBlock(t,e),this._prevBlock=t.slice(e,e+r)}}),l.Decryptor=l.extend({processBlock:function(t,e){var n=this._cipher,r=n.blockSize,i=t.slice(e,e+r);n.decryptBlock(t,e),c.call(this,t,e,r),this._prevBlock=i}}),u=u.CBC=l,l=(p.pad={}).Pkcs7={pad:function(t,e){for(var n,i=(n=(n=4*e)-t.sigBytes%n)<<24|n<<16|n<<8|n,s=[],o=0;o<n;o+=4)s.push(i);n=r.create(s,n),t.concat(n)},unpad:function(t){t.sigBytes-=255&t.words[t.sigBytes-1>>>2]}},e.BlockCipher=a.extend({cfg:a.cfg.extend({mode:u,padding:l}),reset:function(){a.reset.call(this);var t=(e=this.cfg).iv,e=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=e.createEncryptor;else n=e.createDecryptor,this._minBufferSize=1;this._mode=n.call(e,this,t&&t.words)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else e=this._process(!0),t.unpad(e);return e},blockSize:4});var h=e.CipherParams=n.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),f=(u=(p.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext;return((t=t.salt)?r.create([1398893684,1701076831]).concat(t).concat(e):e).toString(s)},parse:function(t){var e=(t=s.parse(t)).words;if(1398893684==e[0]&&1701076831==e[1]){var n=r.create(e.slice(2,4));e.splice(0,4),t.sigBytes-=16}return h.create({ciphertext:t,salt:n})}},e.SerializableCipher=n.extend({cfg:n.extend({format:u}),encrypt:function(t,e,n,r){r=this.cfg.extend(r);var i=t.createEncryptor(n,r);return e=i.finalize(e),i=i.cfg,h.create({ciphertext:e,key:n,iv:i.iv,algorithm:t,mode:i.mode,padding:i.padding,blockSize:t.blockSize,formatter:r.format})},decrypt:function(t,e,n,r){return r=this.cfg.extend(r),e=this._parse(e,r.format),t.createDecryptor(n,r).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}})),p=(p.kdf={}).OpenSSL={execute:function(t,e,n,i){return i||(i=r.random(8)),t=o.create({keySize:e+n}).compute(t,i),n=r.create(t.words.slice(e),4*n),t.sigBytes=4*e,h.create({key:t,iv:n,salt:i})}},d=e.PasswordBasedCipher=f.extend({cfg:f.cfg.extend({kdf:p}),encrypt:function(t,e,n,r){return n=(r=this.cfg.extend(r)).kdf.execute(n,t.keySize,t.ivSize),r.iv=n.iv,(t=f.encrypt.call(this,t,e,n.key,r)).mixIn(n),t},decrypt:function(t,e,n,r){return r=this.cfg.extend(r),e=this._parse(e,r.format),n=r.kdf.execute(n,t.keySize,t.ivSize,e.salt),r.iv=n.iv,f.decrypt.call(this,t,e,n.key,r)}})}(),function(){for(var t=g,e=t.lib.BlockCipher,n=t.algo,r=[],i=[],s=[],o=[],a=[],u=[],c=[],l=[],h=[],f=[],p=[],d=0;256>d;d++)p[d]=128>d?d<<1:d<<1^283;var m=0,v=0;for(d=0;256>d;d++){var y=(y=v^v<<1^v<<2^v<<3^v<<4)>>>8^255&y^99;r[m]=y,i[y]=m;var b=p[m],w=p[b],x=p[w],S=257*p[y]^16843008*y;s[m]=S<<24|S>>>8,o[m]=S<<16|S>>>16,a[m]=S<<8|S>>>24,u[m]=S,S=16843009*x^65537*w^257*b^16843008*m,c[y]=S<<24|S>>>8,l[y]=S<<16|S>>>16,h[y]=S<<8|S>>>24,f[y]=S,m?(m=b^p[p[p[x^b]]],v^=p[p[v]]):m=v=1}var E=[0,1,2,4,8,16,32,64,128,27,54];n=n.AES=e.extend({_doReset:function(){for(var t=(n=this._key).words,e=n.sigBytes/4,n=4*((this._nRounds=e+6)+1),i=this._keySchedule=[],s=0;s<n;s++)if(s<e)i[s]=t[s];else{var o=i[s-1];s%e?6<e&&4==s%e&&(o=r[o>>>24]<<24|r[o>>>16&255]<<16|r[o>>>8&255]<<8|r[255&o]):(o=r[(o=o<<8|o>>>24)>>>24]<<24|r[o>>>16&255]<<16|r[o>>>8&255]<<8|r[255&o],o^=E[s/e|0]<<24),i[s]=i[s-e]^o}for(t=this._invKeySchedule=[],e=0;e<n;e++)s=n-e,o=e%4?i[s]:i[s-4],t[e]=4>e||4>=s?o:c[r[o>>>24]]^l[r[o>>>16&255]]^h[r[o>>>8&255]]^f[r[255&o]]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,s,o,a,u,r)},decryptBlock:function(t,e){var n=t[e+1];t[e+1]=t[e+3],t[e+3]=n,this._doCryptBlock(t,e,this._invKeySchedule,c,l,h,f,i),n=t[e+1],t[e+1]=t[e+3],t[e+3]=n},_doCryptBlock:function(t,e,n,r,i,s,o,a){for(var u=this._nRounds,c=t[e]^n[0],l=t[e+1]^n[1],h=t[e+2]^n[2],f=t[e+3]^n[3],p=4,d=1;d<u;d++){var g=r[c>>>24]^i[l>>>16&255]^s[h>>>8&255]^o[255&f]^n[p++],m=r[l>>>24]^i[h>>>16&255]^s[f>>>8&255]^o[255&c]^n[p++],v=r[h>>>24]^i[f>>>16&255]^s[c>>>8&255]^o[255&l]^n[p++];f=r[f>>>24]^i[c>>>16&255]^s[l>>>8&255]^o[255&h]^n[p++],c=g,l=m,h=v}g=(a[c>>>24]<<24|a[l>>>16&255]<<16|a[h>>>8&255]<<8|a[255&f])^n[p++],m=(a[l>>>24]<<24|a[h>>>16&255]<<16|a[f>>>8&255]<<8|a[255&c])^n[p++],v=(a[h>>>24]<<24|a[f>>>16&255]<<16|a[c>>>8&255]<<8|a[255&l])^n[p++],f=(a[f>>>24]<<24|a[c>>>16&255]<<16|a[l>>>8&255]<<8|a[255&h])^n[p++],t[e]=g,t[e+1]=m,t[e+2]=v,t[e+3]=f},keySize:8});t.AES=e._createHelper(n)}(),function(){function t(t,e){var n=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=n,this._lBlock^=n<<t}function e(t,e){var n=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=n,this._rBlock^=n<<t}var n=g,r=(i=n.lib).WordArray,i=i.BlockCipher,s=n.algo,o=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=s.DES=i.extend({_doReset:function(){for(var t=this._key.words,e=[],n=0;56>n;n++){var r=o[n]-1;e[n]=t[r>>>5]>>>31-r%32&1}for(t=this._subKeys=[],r=0;16>r;r++){var i=t[r]=[],s=u[r];for(n=0;24>n;n++)i[n/6|0]|=e[(a[n]-1+s)%28]<<31-n%6,i[4+(n/6|0)]|=e[28+(a[n+24]-1+s)%28]<<31-n%6;for(i[0]=i[0]<<1|i[0]>>>31,n=1;7>n;n++)i[n]>>>=4*(n-1)+3;i[7]=i[7]<<5|i[7]>>>27}for(e=this._invSubKeys=[],n=0;16>n;n++)e[n]=t[15-n]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(n,r,i){this._lBlock=n[r],this._rBlock=n[r+1],t.call(this,4,252645135),t.call(this,16,65535),e.call(this,2,858993459),e.call(this,8,16711935),t.call(this,1,1431655765);for(var s=0;16>s;s++){for(var o=i[s],a=this._lBlock,u=this._rBlock,h=0,f=0;8>f;f++)h|=c[f][((u^o[f])&l[f])>>>0];this._lBlock=u,this._rBlock=a^h}i=this._lBlock,this._lBlock=this._rBlock,this._rBlock=i,t.call(this,1,1431655765),e.call(this,8,16711935),e.call(this,2,858993459),t.call(this,16,65535),t.call(this,4,252645135),n[r]=this._lBlock,n[r+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});n.DES=i._createHelper(h),s=s.TripleDES=i.extend({_doReset:function(){var t=this._key.words;this._des1=h.createEncryptor(r.create(t.slice(0,2))),this._des2=h.createEncryptor(r.create(t.slice(2,4))),this._des3=h.createEncryptor(r.create(t.slice(4,6)))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2}),n.TripleDES=i._createHelper(s)}(),function(){var t=g,e=t.lib.WordArray;t.enc.Base64={stringify:function(t){var e=t.words,n=t.sigBytes,r=this._map;t.clamp(),t=[];for(var i=0;i<n;i+=3)for(var s=(e[i>>>2]>>>24-i%4*8&255)<<16|(e[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|e[i+2>>>2]>>>24-(i+2)%4*8&255,o=0;4>o&&i+.75*o<n;o++)t.push(r.charAt(s>>>6*(3-o)&63));if(e=r.charAt(64))for(;t.length%4;)t.push(e);return t.join("")},parse:function(t){var n=t.length,r=this._map;(i=r.charAt(64))&&(-1!=(i=t.indexOf(i))&&(n=i));for(var i=[],s=0,o=0;o<n;o++)if(o%4){var a=r.indexOf(t.charAt(o-1))<<o%4*2,u=r.indexOf(t.charAt(o))>>>6-o%4*2;i[s>>>2]|=(a|u)<<24-s%4*8,s++}return e.create(i,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(t){function e(t,e,n,r,i,s,o){return((t=t+(e&n|~e&r)+i+o)<<s|t>>>32-s)+e}function n(t,e,n,r,i,s,o){return((t=t+(e&r|n&~r)+i+o)<<s|t>>>32-s)+e}function r(t,e,n,r,i,s,o){return((t=t+(e^n^r)+i+o)<<s|t>>>32-s)+e}function i(t,e,n,r,i,s,o){return((t=t+(n^(e|~r))+i+o)<<s|t>>>32-s)+e}for(var s=g,o=(u=s.lib).WordArray,a=u.Hasher,u=s.algo,c=[],l=0;64>l;l++)c[l]=4294967296*t.abs(t.sin(l+1))|0;u=u.MD5=a.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,s){for(var o=0;16>o;o++){var a=t[u=s+o];t[u]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}o=this._hash.words;var u=t[s+0],l=(a=t[s+1],t[s+2]),h=t[s+3],f=t[s+4],p=t[s+5],d=t[s+6],g=t[s+7],m=t[s+8],v=t[s+9],y=t[s+10],b=t[s+11],w=t[s+12],x=t[s+13],S=t[s+14],E=t[s+15],F=e(F=o[0],D=o[1],C=o[2],A=o[3],u,7,c[0]),A=e(A,F,D,C,a,12,c[1]),C=e(C,A,F,D,l,17,c[2]),D=e(D,C,A,F,h,22,c[3]);F=e(F,D,C,A,f,7,c[4]),A=e(A,F,D,C,p,12,c[5]),C=e(C,A,F,D,d,17,c[6]),D=e(D,C,A,F,g,22,c[7]),F=e(F,D,C,A,m,7,c[8]),A=e(A,F,D,C,v,12,c[9]),C=e(C,A,F,D,y,17,c[10]),D=e(D,C,A,F,b,22,c[11]),F=e(F,D,C,A,w,7,c[12]),A=e(A,F,D,C,x,12,c[13]),C=e(C,A,F,D,S,17,c[14]),F=n(F,D=e(D,C,A,F,E,22,c[15]),C,A,a,5,c[16]),A=n(A,F,D,C,d,9,c[17]),C=n(C,A,F,D,b,14,c[18]),D=n(D,C,A,F,u,20,c[19]),F=n(F,D,C,A,p,5,c[20]),A=n(A,F,D,C,y,9,c[21]),C=n(C,A,F,D,E,14,c[22]),D=n(D,C,A,F,f,20,c[23]),F=n(F,D,C,A,v,5,c[24]),A=n(A,F,D,C,S,9,c[25]),C=n(C,A,F,D,h,14,c[26]),D=n(D,C,A,F,m,20,c[27]),F=n(F,D,C,A,x,5,c[28]),A=n(A,F,D,C,l,9,c[29]),C=n(C,A,F,D,g,14,c[30]),F=r(F,D=n(D,C,A,F,w,20,c[31]),C,A,p,4,c[32]),A=r(A,F,D,C,m,11,c[33]),C=r(C,A,F,D,b,16,c[34]),D=r(D,C,A,F,S,23,c[35]),F=r(F,D,C,A,a,4,c[36]),A=r(A,F,D,C,f,11,c[37]),C=r(C,A,F,D,g,16,c[38]),D=r(D,C,A,F,y,23,c[39]),F=r(F,D,C,A,x,4,c[40]),A=r(A,F,D,C,u,11,c[41]),C=r(C,A,F,D,h,16,c[42]),D=r(D,C,A,F,d,23,c[43]),F=r(F,D,C,A,v,4,c[44]),A=r(A,F,D,C,w,11,c[45]),C=r(C,A,F,D,E,16,c[46]),F=i(F,D=r(D,C,A,F,l,23,c[47]),C,A,u,6,c[48]),A=i(A,F,D,C,g,10,c[49]),C=i(C,A,F,D,S,15,c[50]),D=i(D,C,A,F,p,21,c[51]),F=i(F,D,C,A,w,6,c[52]),A=i(A,F,D,C,h,10,c[53]),C=i(C,A,F,D,y,15,c[54]),D=i(D,C,A,F,a,21,c[55]),F=i(F,D,C,A,m,6,c[56]),A=i(A,F,D,C,E,10,c[57]),C=i(C,A,F,D,d,15,c[58]),D=i(D,C,A,F,x,21,c[59]),F=i(F,D,C,A,f,6,c[60]),A=i(A,F,D,C,b,10,c[61]),C=i(C,A,F,D,l,15,c[62]),D=i(D,C,A,F,v,21,c[63]);o[0]=o[0]+F|0,o[1]=o[1]+D|0,o[2]=o[2]+C|0,o[3]=o[3]+A|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;n[i>>>5]|=128<<24-i%32;var s=t.floor(r/4294967296);for(n[15+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),n[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(n.length+1),this._process(),n=(e=this._hash).words,r=0;4>r;r++)i=n[r],n[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);return e},clone:function(){var t=a.clone.call(this);return t._hash=this._hash.clone(),t}}),s.MD5=a._createHelper(u),s.HmacMD5=a._createHmacHelper(u)}(Math),function(){var t=g,e=(i=t.lib).WordArray,n=i.Hasher,r=[],i=t.algo.SHA1=n.extend({_doReset:function(){this._hash=new e.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=this._hash.words,i=n[0],s=n[1],o=n[2],a=n[3],u=n[4],c=0;80>c;c++){if(16>c)r[c]=0|t[e+c];else{var l=r[c-3]^r[c-8]^r[c-14]^r[c-16];r[c]=l<<1|l>>>31}l=(i<<5|i>>>27)+u+r[c],l=20>c?l+(1518500249+(s&o|~s&a)):40>c?l+(1859775393+(s^o^a)):60>c?l+((s&o|s&a|o&a)-1894007588):l+((s^o^a)-899497514),u=a,a=o,o=s<<30|s>>>2,s=i,i=l}n[0]=n[0]+i|0,n[1]=n[1]+s|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+u|0},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),e[15+(r+64>>>9<<4)]=n,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});t.SHA1=n._createHelper(i),t.HmacSHA1=n._createHmacHelper(i)}(),function(t){for(var e=g,n=(i=e.lib).WordArray,r=i.Hasher,i=e.algo,s=[],o=[],a=function(t){return 4294967296*(t-(0|t))|0},u=2,c=0;64>c;){var l;t:{l=u;for(var h=t.sqrt(l),f=2;f<=h;f++)if(!(l%f)){l=!1;break t}l=!0}l&&(8>c&&(s[c]=a(t.pow(u,.5))),o[c]=a(t.pow(u,1/3)),c++),u++}var p=[];i=i.SHA256=r.extend({_doReset:function(){this._hash=new n.init(s.slice(0))},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],i=n[1],s=n[2],a=n[3],u=n[4],c=n[5],l=n[6],h=n[7],f=0;64>f;f++){if(16>f)p[f]=0|t[e+f];else{var d=p[f-15],g=p[f-2];p[f]=((d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3)+p[f-7]+((g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10)+p[f-16]}d=h+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&l)+o[f]+p[f],g=((r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22))+(r&i^r&s^i&s),h=l,l=c,c=u,u=a+d|0,a=s,s=i,i=r,r=d+g|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+u|0,n[5]=n[5]+c|0,n[6]=n[6]+l|0,n[7]=n[7]+h|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=t.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=r._createHelper(i),e.HmacSHA256=r._createHmacHelper(i)}(Math),function(){var t=g,e=t.lib.WordArray,n=(r=t.algo).SHA256,r=r.SHA224=n.extend({_doReset:function(){this._hash=new e.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=n._doFinalize.call(this);return t.sigBytes-=4,t}});t.SHA224=n._createHelper(r),t.HmacSHA224=n._createHmacHelper(r)}(),function(){function t(){return r.create.apply(r,arguments)}for(var e=g,n=e.lib.Hasher,r=(s=e.x64).Word,i=s.WordArray,s=e.algo,o=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],a=[],u=0;80>u;u++)a[u]=t();s=s.SHA512=n.extend({_doReset:function(){this._hash=new i.init([new r.init(1779033703,4089235720),new r.init(3144134277,2227873595),new r.init(1013904242,4271175723),new r.init(2773480762,1595750129),new r.init(1359893119,2917565137),new r.init(2600822924,725511199),new r.init(528734635,4215389547),new r.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var n=(h=this._hash.words)[0],r=h[1],i=h[2],s=h[3],u=h[4],c=h[5],l=h[6],h=h[7],f=n.high,p=n.low,d=r.high,g=r.low,m=i.high,v=i.low,y=s.high,b=s.low,w=u.high,x=u.low,S=c.high,E=c.low,F=l.high,A=l.low,C=h.high,D=h.low,I=f,$=p,R=d,T=g,_=m,P=v,k=y,O=b,j=w,B=x,N=S,L=E,H=F,M=A,U=C,V=D,q=0;80>q;q++){var K=a[q];if(16>q)var z=K.high=0|t[e+2*q],G=K.low=0|t[e+2*q+1];else{z=((G=(z=a[q-15]).high)>>>1|(W=z.low)<<31)^(G>>>8|W<<24)^G>>>7;var W=(W>>>1|G<<31)^(W>>>8|G<<24)^(W>>>7|G<<25),Y=((G=(Y=a[q-2]).high)>>>19|(X=Y.low)<<13)^(G<<3|X>>>29)^G>>>6,X=(X>>>19|G<<13)^(X<<3|G>>>29)^(X>>>6|G<<26),J=(G=a[q-7]).high,Z=(Q=a[q-16]).high,Q=Q.low;z=(z=(z=z+J+((G=W+G.low)>>>0<W>>>0?1:0))+Y+((G=G+X)>>>0<X>>>0?1:0))+Z+((G=G+Q)>>>0<Q>>>0?1:0);K.high=z,K.low=G}J=j&N^~j&H,Q=B&L^~B&M,K=I&R^I&_^R&_;var tt=$&T^$&P^T&P,et=(W=(I>>>28|$<<4)^(I<<30|$>>>2)^(I<<25|$>>>7),Y=($>>>28|I<<4)^($<<30|I>>>2)^($<<25|I>>>7),(X=o[q]).high),nt=X.low;Z=U+((j>>>14|B<<18)^(j>>>18|B<<14)^(j<<23|B>>>9))+((X=V+((B>>>14|j<<18)^(B>>>18|j<<14)^(B<<23|j>>>9)))>>>0<V>>>0?1:0),U=H,V=M,H=N,M=L,N=j,L=B,j=k+(Z=(Z=(Z=Z+J+((X=X+Q)>>>0<Q>>>0?1:0))+et+((X=X+nt)>>>0<nt>>>0?1:0))+z+((X=X+G)>>>0<G>>>0?1:0))+((B=O+X|0)>>>0<O>>>0?1:0)|0,k=_,O=P,_=R,P=T,R=I,T=$,I=Z+(K=W+K+((G=Y+tt)>>>0<Y>>>0?1:0))+(($=X+G|0)>>>0<X>>>0?1:0)|0}p=n.low=p+$,n.high=f+I+(p>>>0<$>>>0?1:0),g=r.low=g+T,r.high=d+R+(g>>>0<T>>>0?1:0),v=i.low=v+P,i.high=m+_+(v>>>0<P>>>0?1:0),b=s.low=b+O,s.high=y+k+(b>>>0<O>>>0?1:0),x=u.low=x+B,u.high=w+j+(x>>>0<B>>>0?1:0),E=c.low=E+L,c.high=S+N+(E>>>0<L>>>0?1:0),A=l.low=A+M,l.high=F+H+(A>>>0<M>>>0?1:0),D=h.low=D+V,h.high=C+U+(D>>>0<V>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),e[31+(r+128>>>10<<5)]=n,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32}),e.SHA512=n._createHelper(s),e.HmacSHA512=n._createHmacHelper(s)}(),function(){var t=g,e=(i=t.x64).Word,n=i.WordArray,r=(i=t.algo).SHA512,i=i.SHA384=r.extend({_doReset:function(){this._hash=new n.init([new e.init(3418070365,3238371032),new e.init(1654270250,914150663),new e.init(2438529370,812702999),new e.init(355462360,4144912697),new e.init(1731405415,4290775857),new e.init(2394180231,1750603025),new e.init(3675008525,1694076839),new e.init(1203062813,3204075428)])},_doFinalize:function(){var t=r._doFinalize.call(this);return t.sigBytes-=16,t}});t.SHA384=r._createHelper(i),t.HmacSHA384=r._createHmacHelper(i)}(),function(){var t=g,e=(r=t.lib).WordArray,n=r.Hasher,r=t.algo,i=e.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),s=e.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),o=e.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),a=e.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),u=e.create([0,1518500249,1859775393,2400959708,2840853838]),c=e.create([1352829926,1548603684,1836072691,2053994217,0]);r=r.RIPEMD160=n.extend({_doReset:function(){this._hash=e.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=0;16>n;n++){var r=t[w=e+n];t[w]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var l,h,f,p,d,g,m,v,y,b,w=this._hash.words,x=(r=u.words,c.words),S=i.words,E=s.words,F=o.words,A=a.words;g=l=w[0],m=h=w[1],v=f=w[2],y=p=w[3],b=d=w[4];var C;for(n=0;80>n;n+=1)C=l+t[e+S[n]]|0,C=16>n?C+((h^f^p)+r[0]):32>n?C+((h&f|~h&p)+r[1]):48>n?C+(((h|~f)^p)+r[2]):64>n?C+((h&p|f&~p)+r[3]):C+((h^(f|~p))+r[4]),C=(C=(C|=0)<<F[n]|C>>>32-F[n])+d|0,l=d,d=p,p=f<<10|f>>>22,f=h,h=C,C=g+t[e+E[n]]|0,C=16>n?C+((m^(v|~y))+x[0]):32>n?C+((m&y|v&~y)+x[1]):48>n?C+(((m|~v)^y)+x[2]):64>n?C+((m&v|~m&y)+x[3]):C+((m^v^y)+x[4]),C=(C=(C|=0)<<A[n]|C>>>32-A[n])+b|0,g=b,b=y,y=v<<10|v>>>22,v=m,m=C;C=w[1]+f+y|0,w[1]=w[2]+p+b|0,w[2]=w[3]+d+g|0,w[3]=w[4]+l+m|0,w[4]=w[0]+h+v|0,w[0]=C},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;for(e[r>>>5]|=128<<24-r%32,e[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t.sigBytes=4*(e.length+1),this._process(),e=(t=this._hash).words,n=0;5>n;n++)r=e[n],e[n]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8);return t},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});t.RIPEMD160=n._createHelper(r),t.HmacRIPEMD160=n._createHmacHelper(r)}(Math),function(){var t=g,e=t.enc.Utf8;t.algo.HMAC=t.lib.Base.extend({init:function(t,n){t=this._hasher=new t.init,"string"==typeof n&&(n=e.parse(n));var r=t.blockSize,i=4*r;n.sigBytes>i&&(n=t.finalize(n)),n.clamp();for(var s=this._oKey=n.clone(),o=this._iKey=n.clone(),a=s.words,u=o.words,c=0;c<r;c++)a[c]^=1549556828,u[c]^=909522486;s.sigBytes=o.sigBytes=i,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher;return t=e.finalize(t),e.reset(),e.finalize(this._oKey.clone().concat(t))}})}(),function(){var t,e=g,n=(t=e.lib).Base,r=t.WordArray,i=(t=e.algo).HMAC,s=t.PBKDF2=n.extend({cfg:n.extend({keySize:4,hasher:t.SHA1,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){var n=this.cfg,s=i.create(n.hasher,t),o=r.create(),a=r.create([1]),u=o.words,c=a.words,l=n.keySize;for(n=n.iterations;u.length<l;){var h=s.update(e).finalize(a);s.reset();for(var f=h.words,p=f.length,d=h,g=1;g<n;g++){d=s.finalize(d),s.reset();for(var m=d.words,v=0;v<p;v++)f[v]^=m[v]}o.concat(h),c[0]++}return o.sigBytes=4*l,o}});e.PBKDF2=function(t,e,n){return s.create(n).compute(t,e)}}();
|
|
1
|
+
!function(t){function e(e){for(var n,i,s=e[0],o=e[1],a=0,c=[];a<s.length;a++)i=s[a],Object.prototype.hasOwnProperty.call(r,i)&&r[i]&&c.push(r[i][0]),r[i]=0;for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n]);for(u&&u(e);c.length;)c.shift()()}var n={},r={124:0};function i(e){if(n[e])return n[e].exports;var r=n[e]={i:e,l:!1,exports:{}};return t[e].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.e=function(t){var e=[],n=r[t];if(0!==n)if(n)e.push(n[2]);else{var s=new Promise((function(e,i){n=r[t]=[e,i]}));e.push(n[2]=s);var o,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(t){return i.p+""+({}[t]||t)+"."+{0:"1bd9b49fd9f95db7afda",1:"f95de05c8259e369ca9e",2:"a574cb520c748d9f8d48",3:"82bc14d92c4e25a654be",4:"807e4985b1b0c86a627d",5:"485cd176a5ff0ee389ab",6:"95b7073a568fb73c9148",7:"27bac500c846ad899949",8:"b21d6a5c1a9412deb34f",9:"792187f02fb63192bb83",10:"cabc799d9aabc46e7be7",11:"b2fd98471071348c3964",12:"c008cc99a0d358fd58b7",13:"9b9388352980715b16bb",14:"c512cd1282fe7dec36bf",15:"e870cbcf6346cc68bd66",16:"23e12f234078c8777ed0",17:"d1ac5f88f9ef9ee1c789",18:"63478730d60e02069d90",19:"b5b3699a309774176fc3",20:"d707dfb57f695469ffaa",21:"d5214e697ec9f78652d2",22:"e1562d53daf95dd1fdca",23:"c1b822e6ccc61632355b",24:"740f8b8ec6dd9bb85f67",25:"8c30b7bafb4875a3cc51",26:"176ffe2071a8d5d382b6",27:"be71055c959c1ac75177",28:"af25c8fe6f70c61986cc",29:"54cbff989a44a0f71dfd",30:"238b3282d752df6de2d5",31:"4ecdb66b2c224a63525e",32:"2582e2eccf29e8d5ec80",33:"04790d6b317f0eade307",34:"100b126b4d89e99d4ac4",35:"d2e8f044641a95e453c0",36:"ffb83c2faa7e64cfae57",37:"ef412d4cbc60967faa5e",38:"7deea9e0319084f9f852",39:"be2d8c75e4ab391ba984",40:"9272ebe1d2246ae3054f",41:"f69dd805b7e51756518f",42:"16be14526c7bf039754b",43:"f76be157f75bc7b3ea68",44:"ccd45256fba55ce28d80",45:"f1cb114b656ef4af2bc5",46:"a9d1c07290ab98930744",47:"e3d0e12eb54f0ea80c7b",48:"3c8d17c03f3fc081be89",49:"b4fe44e1a4aeeeb8a39e",50:"6e68d9b649f03d5744b9",51:"d023fa9b3d250baf210b",52:"d84c24bdb469228ecf87",53:"8cf4f5609ed4e19b7426",54:"b7813e67817fea3ffff5",55:"10bb020070b8c5910e4c",56:"f7576b85862142bb7673",57:"f432e4a7f6dbf5fa9e6e",58:"4666a30220eb06c98de3",59:"feebf4602360cb8257bb",60:"854353939d8597b39221",61:"119fc16a46b4ac7fb477",62:"efe6729fb3185cbab1b1",63:"8a51fd07dd8d92177b89",64:"acc32081892f499d8ff3",65:"75e5679260f79e06a315",66:"d0ee50381c28966b1105",67:"58d8539fcac19288b820",68:"9428f49abea727e95256",69:"c88dd57b21890c058b3d",70:"ede527b8438e19a67ebc",71:"2ddcb945966fd051a3a1",72:"d2f8a53e83efcb8ab953",73:"c29f06e5825684d56a9c",74:"b50a23c1751e0fc30aec",75:"4f9197361b6427d97b6c",76:"467d072ae323ab41fd3d",77:"41a60a354d0fb3103b00",78:"7de8a0f70f6dc1debd05",79:"2f8b2ebcbd07d466c913",80:"8e71a1aaf3beb2320bf0",81:"2939c5d2b47cf48be6d5",82:"69913e9f45a1dd96c6be",83:"73515cde0a2215275d32",84:"5e89f3253c2c5885f662",85:"f6ae072160876c4c5beb",86:"4b571d114bba8ed6a350",87:"69eaa604c4d381ec2340",88:"4bfa7b74511d52c5c42f",89:"6e767bc84921c435570c",90:"5c5efc19e9053c029343",91:"8e7850e1155a0f57ff60",92:"b601c9bc8133fcf28163",93:"d4fb5fe720a8d95b2b37",94:"4b1ada797602e279b977",95:"95758068abd9eac4ed40",96:"a4044cdbb3c9f43d86d3",97:"9c2220bd069a1fa37786",98:"8f1b6e94748a6049ed93",99:"0613c1081ad54e17d927",100:"24bbc960b22ec8f26f68",101:"05350fca3dae5c1ef48a",102:"634314c6ee0d129a753e",103:"7d1e3b45f592f13c0bf1",104:"cec277cc444af58efc38",105:"2131aef847d9db645b1a",106:"d8e91ce7c4e16ae96137",107:"21cdf58f864dc9c34960",108:"ff55b38321cd246e0f10",109:"3683904d9ad66df4fe4d",110:"7419abdcd9b1e7b062ad",111:"87635664a5306fc0c6bb",112:"1e565aafd51348ccc32e",113:"2a67bc73a80f0bbf6397",114:"ed2c2d1606cd75dbd7c6",115:"6751a154fb77d1efeec8",116:"75f79d13526f131b61f0",117:"17c60bd040eada2f965d",118:"fc48834f75995ef9202f",119:"44cc6552449537efa8f5",120:"8f48d9b3f8071e4c42fd",121:"f67bb6e90ebd1fee8e30",122:"40527e7a2b7988df1412",123:"866135438008613c5648",127:"026f4ba40e9ec421ef6d",128:"576c4127811b9427dd34",129:"eec124fd2198bff8c473",130:"00a43422f7369916f8be",131:"58b34c4cc71284c7dd69",132:"d9c09b5b823bc08e44a2",133:"40f6db8ba6086a250def",134:"cd1e72606e3566aa2381",135:"5969091e7450f267d7d1",136:"3199d393576be61f53fd",137:"c4f55132ebf517a9973c",138:"345b94a854312dbbaed1",139:"8c3a64d2c82b5b24b083",140:"f9f6709a29ac8b6eec8b",141:"7e703e35c921c84e3bb2",142:"f5a17f658960cb0ff844",143:"ae4bf6eb11e0623aaeb3",144:"6da8664c45932c2856eb",145:"a933d88618b8708d4be4",146:"f796afb9dfe90b1a63c1",147:"6c1252af29b91cdcbcde",148:"9cf53d87afdee45026b2",149:"8e13fb8987a3c37b0378",150:"beaa2fdbe70cc1686c65",151:"6193611cf1ffcc80508a",152:"7fecd985345140837105",153:"c6edb6c09e02a9fa3773",154:"6b8dee2bec5f5395e2ae",155:"96bb3fe77f3c27d6e255",156:"97f2defa2d8196febdf6",157:"40d39dd2463339b6336a",158:"732698a148ed18f790c4",159:"ffa8314699aaa5682fc9",160:"763ca579c94b0c1f7e0c",161:"d311e07a99e3170c6e36",162:"d47b8b8e879e576d959f",163:"8900e66d40917925ada6",164:"7ee6c0b961afd793013c",165:"376c7fbe283d31b68f38",166:"3d9124c1244ea496e32a",167:"ecd03842094984a7a879",168:"eae500060443da4e7972",169:"79980a5bece6dd7eae21",170:"883d200d0c571b72e614",171:"ebb1cf04508fe47600ff",172:"86384ebb60cd0c4bc234",173:"3228bfad91bff600c322",174:"f88467a420b2270009e6",175:"5ea68d979df50218cc7a"}[t]+".bundle.js"}(t);var u=new Error;o=function(e){a.onerror=a.onload=null,clearTimeout(c);var n=r[t];if(0!==n){if(n){var i=e&&("load"===e.type?"missing":e.type),s=e&&e.target&&e.target.src;u.message="Loading chunk "+t+" failed.\n("+i+": "+s+")",u.name="ChunkLoadError",u.type=i,u.request=s,n[1](u)}r[t]=void 0}};var c=setTimeout((function(){o({type:"timeout",target:a})}),12e4);a.onerror=a.onload=o,document.head.appendChild(a)}return Promise.all(e)},i.m=t,i.c=n,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i.oe=function(t){throw console.error(t),t};var s=window.webpackJsonp=window.webpackJsonp||[],o=s.push.bind(s);s.push=e,s=s.slice();for(var a=0;a<s.length;a++)e(s[a]);var u=o;i(i.s=0)}([function(t,e,n){"use strict";n.r(e),n.d(e,"decodeHTML",(function(){return r}));n(4),n(26),n(31),n(190),n(37),n(191),n(21),n(32),n(33);const r=function(t){let e=document.createElement("textarea");return e.innerHTML=t,e.value},i=["ngRoute","graphdb.workbench.se.controllers","graphdb.framework.core","angularCancelOnNavigateModule","oc.lazyLoad","pascalprecht.translate","graphdb.framework.core.interceptors.unauthorized","graphdb.framework.core.directives.rdfresourcesearch.rdfresourcesearch","graphdb.framework.core.directives.languageselector.languageselector","graphdb.framework.guides.services"],s=["$routeProvider","$locationProvider","$menuItemsProvider","toastrConfig","localStorageServiceProvider","$tooltipProvider","$httpProvider","$templateRequestProvider","$translateProvider"];$.get("rest/info/version?local=1",(function(t){const e=t.productVersion.match(/^(\d+\.\d+)/);e.length?t.productShortVersion=e[1]:t.productShortVersion=t.productVersion;const o=t.productVersion.match(/(-.*?)(-|$)/);o&&o.length&&(t.productShortVersion=t.productShortVersion+o[1]),function(t){const e=angular.module("graphdb.workbench",i);e.config([...s,function(e,r,i,s,o,a,u,c,l){l.useStaticFilesLoader({prefix:"i18n/locale-",suffix:".json?v=2.1.2"}),l.preferredLanguage("en"),l.useSanitizeValueStrategy("escape"),angular.extend(s,{timeOut:5e3,positionClass:"toast-bottom-right",tapToDismiss:!1,extendedTimeOut:5e3}),o.setStorageType("localStorage").setNotify(!0,!0);var h=e.$get[e.$get.length-1]({$on:function(){}});e.when("_openid_implicit_",{controller:function(){},template:"<div></div>"}),h.routes._openid_implicit_.regexp=/[&/](?:id_token=.*&access_token=|access_token=.*&id_token=)/;let f=PluginRegistry.get("route");angular.forEach(f,(function(t){e.when(t.url,{controller:t.controller,templateUrl:t.templateUrl,title:t.title,helpInfo:t.helpInfo,reloadOnSearch:void 0===t.reloadOnSearch||t.reloadOnSearch,resolve:{preload:["$ocLazyLoad","$q",function(e,r){return t.path?n(192)("./"+t.path).then(n=>{e.inject(t.module)}):r.defer().resolve()}]}})})),e.otherwise({templateUrl:"pages/not_found.html"}),r.html5Mode(!0),a.setTriggers({show:"hide"}),a.options({appendToBody:!0}),i.setProductInfo(t),PluginRegistry.get("main.menu").forEach((function(t){t.items.forEach((function(t){i.addItem(t)}))})),u.interceptors.push("$unauthorizedInterceptor");const p=c.$get[3];"function"==typeof p&&(c.$get[3]=function(t,e,n){const r=p(t,e,n);return function(e,n){return t.get(e)||(e+="?v=2.1.2"),r(e,n)}})}]),e.constant("productInfo",t),e.run(["$rootScope","$route","toastr","$sce","$translate","LocalStorageAdapter","LSKeys","GuidesService",function(t,e,n,i,s,o,a,u){function c(){e.current.title?document.title=r(s.instant(e.current.title))+" | GraphDB Workbench":document.title="GraphDB Workbench",t.helpInfo=i.trustAsHtml(r(s.instant(e.current.helpInfo))),t.title=r(s.instant(e.current.title))}t.$on("$routeChangeSuccess",(function(){c(),n.clear()})),t.$on("$translateChangeSuccess",(function(){c()}));const l=o.get(a.WORKBENCH_SETTINGS);if(l&&l.theme){const t=document.querySelector(":root");"dark"===l.theme&&t.classList.add("dark")}u.init()}]),e.filter("titlecase",(function(){return function(t){var e=""+t;return e.charAt(0).toUpperCase()+e.slice(1)}})),angular.bootstrap(document,["graphdb.workbench"])}(t)}))},function(t,e,n){"use strict";n.r(e),n.d(e,"GuideUtils",(function(){return r}));const r=function(){const t=function(t,e){return r.clickOnElement(r.getGuideElementSelector(t,e))},e=function(t,e=1,n=!0){const r=l(t);return new Promise((function(t,i){let s=1e3*e|1e3;const o=setInterval(()=>{try{const e=document.querySelector(r);null!=e?!n||angular.element(e).is(":visible")?(clearInterval(o),setTimeout(()=>{t(angular.element(e))},0)):(s-=100,s<0&&(clearInterval(o),console.log("Element is not visible: "+r),i())):(s-=100,s<0&&(clearInterval(o),console.log("Element is not found: "+r),i()))}catch(t){clearInterval(o),console.log("Error when processing selector: "+r),console.log(t),i(t)}},100)}))},n=function(t){const e=document.querySelector(t);return e&&angular.element(e).is(":visible")},i=function(t,e){return`[guide-selector="${t}"] ${e||""}`},s=(t,e,n,r)=>{const i=t.use();let s;return angular.isObject(n)?(s=n[i],s||(s=n.en),s=e(s)(r)):s=o(t.instant(n,r)),s},o=t=>{const e=document.createElement("div");return e.innerHTML=t,e.innerText},a=t=>i("queryEditor",t?".CodeMirror-code "+t:".CodeMirror-code"),u=t=>i("yasrResults",t),c=t=>angular.element(t).is(":checked"),l=t=>angular.isFunction(t)?t():t;return{GUIDES_LIST_URL:"rest/guides",GUIDES_DOWNLOAD_URL:"rest/guides/download/",waitFor:e,clickOnElement:function(t){return()=>e(t).then(t=>t.click())},clickOnGuideElement:t,getGuideElementSelector:i,isVisible:n,isGuideElementVisible:function(t){return n(i(t))},awaitAlphaDropD3:function(t,e,r=2,i=.02){return()=>new Promise((function(s){n(t)?s():setTimeout(()=>{let t=1e3*r;const n=setInterval(()=>{e.d3alpha<i?(clearInterval(n),s()):(t-=100,t<0&&(clearInterval(n),s()))},100)},150)}))},graphVizExpandNode:function(t){const e=d3.select(t),n=new CustomEvent("gdb-expand-node",{detail:e.datum()});e.node().dispatchEvent(n)},graphVizShowNodeInfo:function(t){const e=d3.select(t),n=new CustomEvent("gdb-show-node-info",{detail:e.datum()});e.node().dispatchEvent(n)},classHierarchyFocus:function(t){const e=d3.select(t),n=new CustomEvent("gdb-focus",{detail:e.datum()});e.node().dispatchEvent(n)},classHierarchyZoom:function(t){const e=d3.select(t),n=new CustomEvent("gdb-zoom",{detail:e.datum()});e.node().dispatchEvent(n)},validateTextInput:function(t,e,n=!0){const r=$(t).val();return""===r&&n?($(t).val(e),$(t).trigger("change"),!0):r===e},translateLocalMessage:s,unescapeHtml:o,noNextErrorToast:(t,e,n,r,i)=>{t.error(o(s(e,n,r,i)),o(s(e,n,"guide.validate.no-next",i)),{allowHtml:!0})},deferredShow:t=>()=>new Promise((function(e){setTimeout(()=>{e()},t)})),scrollToTop:()=>{window.scrollTo(0,0)},removeWhiteSpaces:t=>t.replace(/\s+/g,""),toResourceDownloadUrl:t=>"rest/guides/download/"+t.resourcePath+"/"+t.resourceFile,getSparqlEditorSelector:a,getSparqlResultsSelector:u,getSparqlResultsSelectorForIri:t=>u("a[title='"+t+"']"),getSparqlResultsSelectorForRow:t=>u("tbody tr:nth-child("+t+")"),isChecked:c,isGuideElementChecked:(t,e)=>c(r.getGuideElementSelector("autocompleteCheckbox",e)),defaultInitPreviousStep:(t,e)=>new Promise((function(n,r){const i=t.ShepherdService.getPreviousStepFromHistory(e);i?i.options.initPreviousStep(t,i.options.id).then(()=>n()).catch(t=>r(t)):n()})),getElementSelector:l,executeSparqlQuery:(n,r,i,s=!1)=>new Promise((o,u)=>{s?(n.url("/sparql"),r.reload(),e(a()).then(()=>{e(".no-query-run").then(()=>{window.editor.setValue(i),t("runSparqlQuery")().then(()=>o()).catch(t=>u(t))}).catch(t=>u(t))}).catch(t=>u(t))):(window.editor.setValue(i),t("runSparqlQuery")().then(()=>o()).catch(t=>u(t)))})}}()},function(t,e,n){"use strict";n.r(e),n.d(e,"UserType",(function(){return i})),n.d(e,"UserRole",(function(){return r})),n.d(e,"UserUtils",(function(){return s}));const r=Object.freeze({ROLE_ADMIN:"ROLE_ADMIN",ROLE_USER:"ROLE_USER",ROLE_REPO_MANAGER:"ROLE_REPO_MANAGER"}),i=Object.freeze({ADMIN:"admin",USER:"user",REPO_MANAGER:"repoManager"}),s={getUserRoleName:function(t){switch(t){case i.USER:return"User";case i.REPO_MANAGER:return"Repository manager";case i.ADMIN:return"Administrator";default:return"Unknown"}}}},function(t,e,n){(function(t){var n,r,i,s,o,a,u,c,l,h,f,p={userAgent:!1},d={},g=g||(n=Math,i=(r={}).lib={},s=i.Base=function(){function t(){}return{extend:function(e){t.prototype=this;var n=new t;return e&&n.mixIn(e),n.hasOwnProperty("init")||(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),o=i.WordArray=s.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||u).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,i=t.sigBytes;if(this.clamp(),r%4)for(var s=0;s<i;s++){var o=n[s>>>2]>>>24-s%4*8&255;e[r+s>>>2]|=o<<24-(r+s)%4*8}else for(s=0;s<i;s+=4)e[r+s>>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,e=this.sigBytes;t[e>>>2]&=4294967295<<32-e%4*8,t.length=n.ceil(e/4)},clone:function(){var t=s.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r<t;r+=4)e.push(4294967296*n.random()|0);return new o.init(e,t)}}),a=r.enc={},u=a.Hex={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i<n;i++){var s=e[i>>>2]>>>24-i%4*8&255;r.push((s>>>4).toString(16)),r.push((15&s).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new o.init(n,e/2)}},c=a.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i<n;i++){var s=e[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(s))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r++)n[r>>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new o.init(n,e)}},l=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},h=i.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=l.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(t){var e=this._data,r=e.words,i=e.sigBytes,s=this.blockSize,a=i/(4*s),u=(a=t?n.ceil(a):n.max((0|a)-this._minBufferSize,0))*s,c=n.min(4*u,i);if(u){for(var l=0;l<u;l+=s)this._doProcessBlock(r,l);var h=r.splice(0,u);e.sigBytes-=c}return new o.init(h,c)},clone:function(){var t=s.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),i.Hasher=h.extend({cfg:s.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,n){return new t.init(n).finalize(e)}},_createHmacHelper:function(t){return function(e,n){return new f.HMAC.init(t,n).finalize(e)}}}),f=r.algo={},r);!function(t){var e,n=(e=g).lib,r=n.Base,i=n.WordArray;(e=e.x64={}).Word=r.extend({init:function(t,e){this.high=t,this.low=e}}),e.WordArray=r.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:8*t.length},toX32:function(){for(var t=this.words,e=t.length,n=[],r=0;r<e;r++){var s=t[r];n.push(s.high),n.push(s.low)}return i.create(n,this.sigBytes)},clone:function(){for(var t=r.clone.call(this),e=t.words=this.words.slice(0),n=e.length,i=0;i<n;i++)e[i]=e[i].clone();return t}})}(),g.lib.Cipher||function(t){var e=(p=g).lib,n=e.Base,r=e.WordArray,i=e.BufferedBlockAlgorithm,s=p.enc.Base64,o=p.algo.EvpKDF,a=e.Cipher=i.extend({cfg:n.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,n){this.cfg=this.cfg.extend(n),this._xformMode=t,this._key=e,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(t){return{encrypt:function(e,n,r){return("string"==typeof n?d:f).encrypt(t,e,n,r)},decrypt:function(e,n,r){return("string"==typeof n?d:f).decrypt(t,e,n,r)}}}});e.StreamCipher=a.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var u=p.mode={},c=function(t,e,n){var r=this._iv;r?this._iv=void 0:r=this._prevBlock;for(var i=0;i<n;i++)t[e+i]^=r[i]},l=(e.BlockCipherMode=n.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}})).extend();l.Encryptor=l.extend({processBlock:function(t,e){var n=this._cipher,r=n.blockSize;c.call(this,t,e,r),n.encryptBlock(t,e),this._prevBlock=t.slice(e,e+r)}}),l.Decryptor=l.extend({processBlock:function(t,e){var n=this._cipher,r=n.blockSize,i=t.slice(e,e+r);n.decryptBlock(t,e),c.call(this,t,e,r),this._prevBlock=i}}),u=u.CBC=l,l=(p.pad={}).Pkcs7={pad:function(t,e){for(var n,i=(n=(n=4*e)-t.sigBytes%n)<<24|n<<16|n<<8|n,s=[],o=0;o<n;o+=4)s.push(i);n=r.create(s,n),t.concat(n)},unpad:function(t){t.sigBytes-=255&t.words[t.sigBytes-1>>>2]}},e.BlockCipher=a.extend({cfg:a.cfg.extend({mode:u,padding:l}),reset:function(){a.reset.call(this);var t=(e=this.cfg).iv,e=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=e.createEncryptor;else n=e.createDecryptor,this._minBufferSize=1;this._mode=n.call(e,this,t&&t.words)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else e=this._process(!0),t.unpad(e);return e},blockSize:4});var h=e.CipherParams=n.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),f=(u=(p.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext;return((t=t.salt)?r.create([1398893684,1701076831]).concat(t).concat(e):e).toString(s)},parse:function(t){var e=(t=s.parse(t)).words;if(1398893684==e[0]&&1701076831==e[1]){var n=r.create(e.slice(2,4));e.splice(0,4),t.sigBytes-=16}return h.create({ciphertext:t,salt:n})}},e.SerializableCipher=n.extend({cfg:n.extend({format:u}),encrypt:function(t,e,n,r){r=this.cfg.extend(r);var i=t.createEncryptor(n,r);return e=i.finalize(e),i=i.cfg,h.create({ciphertext:e,key:n,iv:i.iv,algorithm:t,mode:i.mode,padding:i.padding,blockSize:t.blockSize,formatter:r.format})},decrypt:function(t,e,n,r){return r=this.cfg.extend(r),e=this._parse(e,r.format),t.createDecryptor(n,r).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}})),p=(p.kdf={}).OpenSSL={execute:function(t,e,n,i){return i||(i=r.random(8)),t=o.create({keySize:e+n}).compute(t,i),n=r.create(t.words.slice(e),4*n),t.sigBytes=4*e,h.create({key:t,iv:n,salt:i})}},d=e.PasswordBasedCipher=f.extend({cfg:f.cfg.extend({kdf:p}),encrypt:function(t,e,n,r){return n=(r=this.cfg.extend(r)).kdf.execute(n,t.keySize,t.ivSize),r.iv=n.iv,(t=f.encrypt.call(this,t,e,n.key,r)).mixIn(n),t},decrypt:function(t,e,n,r){return r=this.cfg.extend(r),e=this._parse(e,r.format),n=r.kdf.execute(n,t.keySize,t.ivSize,e.salt),r.iv=n.iv,f.decrypt.call(this,t,e,n.key,r)}})}(),function(){for(var t=g,e=t.lib.BlockCipher,n=t.algo,r=[],i=[],s=[],o=[],a=[],u=[],c=[],l=[],h=[],f=[],p=[],d=0;256>d;d++)p[d]=128>d?d<<1:d<<1^283;var m=0,v=0;for(d=0;256>d;d++){var y=(y=v^v<<1^v<<2^v<<3^v<<4)>>>8^255&y^99;r[m]=y,i[y]=m;var b=p[m],w=p[b],x=p[w],S=257*p[y]^16843008*y;s[m]=S<<24|S>>>8,o[m]=S<<16|S>>>16,a[m]=S<<8|S>>>24,u[m]=S,S=16843009*x^65537*w^257*b^16843008*m,c[y]=S<<24|S>>>8,l[y]=S<<16|S>>>16,h[y]=S<<8|S>>>24,f[y]=S,m?(m=b^p[p[p[x^b]]],v^=p[p[v]]):m=v=1}var E=[0,1,2,4,8,16,32,64,128,27,54];n=n.AES=e.extend({_doReset:function(){for(var t=(n=this._key).words,e=n.sigBytes/4,n=4*((this._nRounds=e+6)+1),i=this._keySchedule=[],s=0;s<n;s++)if(s<e)i[s]=t[s];else{var o=i[s-1];s%e?6<e&&4==s%e&&(o=r[o>>>24]<<24|r[o>>>16&255]<<16|r[o>>>8&255]<<8|r[255&o]):(o=r[(o=o<<8|o>>>24)>>>24]<<24|r[o>>>16&255]<<16|r[o>>>8&255]<<8|r[255&o],o^=E[s/e|0]<<24),i[s]=i[s-e]^o}for(t=this._invKeySchedule=[],e=0;e<n;e++)s=n-e,o=e%4?i[s]:i[s-4],t[e]=4>e||4>=s?o:c[r[o>>>24]]^l[r[o>>>16&255]]^h[r[o>>>8&255]]^f[r[255&o]]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,s,o,a,u,r)},decryptBlock:function(t,e){var n=t[e+1];t[e+1]=t[e+3],t[e+3]=n,this._doCryptBlock(t,e,this._invKeySchedule,c,l,h,f,i),n=t[e+1],t[e+1]=t[e+3],t[e+3]=n},_doCryptBlock:function(t,e,n,r,i,s,o,a){for(var u=this._nRounds,c=t[e]^n[0],l=t[e+1]^n[1],h=t[e+2]^n[2],f=t[e+3]^n[3],p=4,d=1;d<u;d++){var g=r[c>>>24]^i[l>>>16&255]^s[h>>>8&255]^o[255&f]^n[p++],m=r[l>>>24]^i[h>>>16&255]^s[f>>>8&255]^o[255&c]^n[p++],v=r[h>>>24]^i[f>>>16&255]^s[c>>>8&255]^o[255&l]^n[p++];f=r[f>>>24]^i[c>>>16&255]^s[l>>>8&255]^o[255&h]^n[p++],c=g,l=m,h=v}g=(a[c>>>24]<<24|a[l>>>16&255]<<16|a[h>>>8&255]<<8|a[255&f])^n[p++],m=(a[l>>>24]<<24|a[h>>>16&255]<<16|a[f>>>8&255]<<8|a[255&c])^n[p++],v=(a[h>>>24]<<24|a[f>>>16&255]<<16|a[c>>>8&255]<<8|a[255&l])^n[p++],f=(a[f>>>24]<<24|a[c>>>16&255]<<16|a[l>>>8&255]<<8|a[255&h])^n[p++],t[e]=g,t[e+1]=m,t[e+2]=v,t[e+3]=f},keySize:8});t.AES=e._createHelper(n)}(),function(){function t(t,e){var n=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=n,this._lBlock^=n<<t}function e(t,e){var n=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=n,this._rBlock^=n<<t}var n=g,r=(i=n.lib).WordArray,i=i.BlockCipher,s=n.algo,o=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=s.DES=i.extend({_doReset:function(){for(var t=this._key.words,e=[],n=0;56>n;n++){var r=o[n]-1;e[n]=t[r>>>5]>>>31-r%32&1}for(t=this._subKeys=[],r=0;16>r;r++){var i=t[r]=[],s=u[r];for(n=0;24>n;n++)i[n/6|0]|=e[(a[n]-1+s)%28]<<31-n%6,i[4+(n/6|0)]|=e[28+(a[n+24]-1+s)%28]<<31-n%6;for(i[0]=i[0]<<1|i[0]>>>31,n=1;7>n;n++)i[n]>>>=4*(n-1)+3;i[7]=i[7]<<5|i[7]>>>27}for(e=this._invSubKeys=[],n=0;16>n;n++)e[n]=t[15-n]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(n,r,i){this._lBlock=n[r],this._rBlock=n[r+1],t.call(this,4,252645135),t.call(this,16,65535),e.call(this,2,858993459),e.call(this,8,16711935),t.call(this,1,1431655765);for(var s=0;16>s;s++){for(var o=i[s],a=this._lBlock,u=this._rBlock,h=0,f=0;8>f;f++)h|=c[f][((u^o[f])&l[f])>>>0];this._lBlock=u,this._rBlock=a^h}i=this._lBlock,this._lBlock=this._rBlock,this._rBlock=i,t.call(this,1,1431655765),e.call(this,8,16711935),e.call(this,2,858993459),t.call(this,16,65535),t.call(this,4,252645135),n[r]=this._lBlock,n[r+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});n.DES=i._createHelper(h),s=s.TripleDES=i.extend({_doReset:function(){var t=this._key.words;this._des1=h.createEncryptor(r.create(t.slice(0,2))),this._des2=h.createEncryptor(r.create(t.slice(2,4))),this._des3=h.createEncryptor(r.create(t.slice(4,6)))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2}),n.TripleDES=i._createHelper(s)}(),function(){var t=g,e=t.lib.WordArray;t.enc.Base64={stringify:function(t){var e=t.words,n=t.sigBytes,r=this._map;t.clamp(),t=[];for(var i=0;i<n;i+=3)for(var s=(e[i>>>2]>>>24-i%4*8&255)<<16|(e[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|e[i+2>>>2]>>>24-(i+2)%4*8&255,o=0;4>o&&i+.75*o<n;o++)t.push(r.charAt(s>>>6*(3-o)&63));if(e=r.charAt(64))for(;t.length%4;)t.push(e);return t.join("")},parse:function(t){var n=t.length,r=this._map;(i=r.charAt(64))&&(-1!=(i=t.indexOf(i))&&(n=i));for(var i=[],s=0,o=0;o<n;o++)if(o%4){var a=r.indexOf(t.charAt(o-1))<<o%4*2,u=r.indexOf(t.charAt(o))>>>6-o%4*2;i[s>>>2]|=(a|u)<<24-s%4*8,s++}return e.create(i,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(t){function e(t,e,n,r,i,s,o){return((t=t+(e&n|~e&r)+i+o)<<s|t>>>32-s)+e}function n(t,e,n,r,i,s,o){return((t=t+(e&r|n&~r)+i+o)<<s|t>>>32-s)+e}function r(t,e,n,r,i,s,o){return((t=t+(e^n^r)+i+o)<<s|t>>>32-s)+e}function i(t,e,n,r,i,s,o){return((t=t+(n^(e|~r))+i+o)<<s|t>>>32-s)+e}for(var s=g,o=(u=s.lib).WordArray,a=u.Hasher,u=s.algo,c=[],l=0;64>l;l++)c[l]=4294967296*t.abs(t.sin(l+1))|0;u=u.MD5=a.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,s){for(var o=0;16>o;o++){var a=t[u=s+o];t[u]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}o=this._hash.words;var u=t[s+0],l=(a=t[s+1],t[s+2]),h=t[s+3],f=t[s+4],p=t[s+5],d=t[s+6],g=t[s+7],m=t[s+8],v=t[s+9],y=t[s+10],b=t[s+11],w=t[s+12],x=t[s+13],S=t[s+14],E=t[s+15],F=e(F=o[0],D=o[1],C=o[2],A=o[3],u,7,c[0]),A=e(A,F,D,C,a,12,c[1]),C=e(C,A,F,D,l,17,c[2]),D=e(D,C,A,F,h,22,c[3]);F=e(F,D,C,A,f,7,c[4]),A=e(A,F,D,C,p,12,c[5]),C=e(C,A,F,D,d,17,c[6]),D=e(D,C,A,F,g,22,c[7]),F=e(F,D,C,A,m,7,c[8]),A=e(A,F,D,C,v,12,c[9]),C=e(C,A,F,D,y,17,c[10]),D=e(D,C,A,F,b,22,c[11]),F=e(F,D,C,A,w,7,c[12]),A=e(A,F,D,C,x,12,c[13]),C=e(C,A,F,D,S,17,c[14]),F=n(F,D=e(D,C,A,F,E,22,c[15]),C,A,a,5,c[16]),A=n(A,F,D,C,d,9,c[17]),C=n(C,A,F,D,b,14,c[18]),D=n(D,C,A,F,u,20,c[19]),F=n(F,D,C,A,p,5,c[20]),A=n(A,F,D,C,y,9,c[21]),C=n(C,A,F,D,E,14,c[22]),D=n(D,C,A,F,f,20,c[23]),F=n(F,D,C,A,v,5,c[24]),A=n(A,F,D,C,S,9,c[25]),C=n(C,A,F,D,h,14,c[26]),D=n(D,C,A,F,m,20,c[27]),F=n(F,D,C,A,x,5,c[28]),A=n(A,F,D,C,l,9,c[29]),C=n(C,A,F,D,g,14,c[30]),F=r(F,D=n(D,C,A,F,w,20,c[31]),C,A,p,4,c[32]),A=r(A,F,D,C,m,11,c[33]),C=r(C,A,F,D,b,16,c[34]),D=r(D,C,A,F,S,23,c[35]),F=r(F,D,C,A,a,4,c[36]),A=r(A,F,D,C,f,11,c[37]),C=r(C,A,F,D,g,16,c[38]),D=r(D,C,A,F,y,23,c[39]),F=r(F,D,C,A,x,4,c[40]),A=r(A,F,D,C,u,11,c[41]),C=r(C,A,F,D,h,16,c[42]),D=r(D,C,A,F,d,23,c[43]),F=r(F,D,C,A,v,4,c[44]),A=r(A,F,D,C,w,11,c[45]),C=r(C,A,F,D,E,16,c[46]),F=i(F,D=r(D,C,A,F,l,23,c[47]),C,A,u,6,c[48]),A=i(A,F,D,C,g,10,c[49]),C=i(C,A,F,D,S,15,c[50]),D=i(D,C,A,F,p,21,c[51]),F=i(F,D,C,A,w,6,c[52]),A=i(A,F,D,C,h,10,c[53]),C=i(C,A,F,D,y,15,c[54]),D=i(D,C,A,F,a,21,c[55]),F=i(F,D,C,A,m,6,c[56]),A=i(A,F,D,C,E,10,c[57]),C=i(C,A,F,D,d,15,c[58]),D=i(D,C,A,F,x,21,c[59]),F=i(F,D,C,A,f,6,c[60]),A=i(A,F,D,C,b,10,c[61]),C=i(C,A,F,D,l,15,c[62]),D=i(D,C,A,F,v,21,c[63]);o[0]=o[0]+F|0,o[1]=o[1]+D|0,o[2]=o[2]+C|0,o[3]=o[3]+A|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;n[i>>>5]|=128<<24-i%32;var s=t.floor(r/4294967296);for(n[15+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),n[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(n.length+1),this._process(),n=(e=this._hash).words,r=0;4>r;r++)i=n[r],n[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);return e},clone:function(){var t=a.clone.call(this);return t._hash=this._hash.clone(),t}}),s.MD5=a._createHelper(u),s.HmacMD5=a._createHmacHelper(u)}(Math),function(){var t=g,e=(i=t.lib).WordArray,n=i.Hasher,r=[],i=t.algo.SHA1=n.extend({_doReset:function(){this._hash=new e.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=this._hash.words,i=n[0],s=n[1],o=n[2],a=n[3],u=n[4],c=0;80>c;c++){if(16>c)r[c]=0|t[e+c];else{var l=r[c-3]^r[c-8]^r[c-14]^r[c-16];r[c]=l<<1|l>>>31}l=(i<<5|i>>>27)+u+r[c],l=20>c?l+(1518500249+(s&o|~s&a)):40>c?l+(1859775393+(s^o^a)):60>c?l+((s&o|s&a|o&a)-1894007588):l+((s^o^a)-899497514),u=a,a=o,o=s<<30|s>>>2,s=i,i=l}n[0]=n[0]+i|0,n[1]=n[1]+s|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+u|0},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),e[15+(r+64>>>9<<4)]=n,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});t.SHA1=n._createHelper(i),t.HmacSHA1=n._createHmacHelper(i)}(),function(t){for(var e=g,n=(i=e.lib).WordArray,r=i.Hasher,i=e.algo,s=[],o=[],a=function(t){return 4294967296*(t-(0|t))|0},u=2,c=0;64>c;){var l;t:{l=u;for(var h=t.sqrt(l),f=2;f<=h;f++)if(!(l%f)){l=!1;break t}l=!0}l&&(8>c&&(s[c]=a(t.pow(u,.5))),o[c]=a(t.pow(u,1/3)),c++),u++}var p=[];i=i.SHA256=r.extend({_doReset:function(){this._hash=new n.init(s.slice(0))},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],i=n[1],s=n[2],a=n[3],u=n[4],c=n[5],l=n[6],h=n[7],f=0;64>f;f++){if(16>f)p[f]=0|t[e+f];else{var d=p[f-15],g=p[f-2];p[f]=((d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3)+p[f-7]+((g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10)+p[f-16]}d=h+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&l)+o[f]+p[f],g=((r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22))+(r&i^r&s^i&s),h=l,l=c,c=u,u=a+d|0,a=s,s=i,i=r,r=d+g|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+u|0,n[5]=n[5]+c|0,n[6]=n[6]+l|0,n[7]=n[7]+h|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=t.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=r._createHelper(i),e.HmacSHA256=r._createHmacHelper(i)}(Math),function(){var t=g,e=t.lib.WordArray,n=(r=t.algo).SHA256,r=r.SHA224=n.extend({_doReset:function(){this._hash=new e.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=n._doFinalize.call(this);return t.sigBytes-=4,t}});t.SHA224=n._createHelper(r),t.HmacSHA224=n._createHmacHelper(r)}(),function(){function t(){return r.create.apply(r,arguments)}for(var e=g,n=e.lib.Hasher,r=(s=e.x64).Word,i=s.WordArray,s=e.algo,o=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],a=[],u=0;80>u;u++)a[u]=t();s=s.SHA512=n.extend({_doReset:function(){this._hash=new i.init([new r.init(1779033703,4089235720),new r.init(3144134277,2227873595),new r.init(1013904242,4271175723),new r.init(2773480762,1595750129),new r.init(1359893119,2917565137),new r.init(2600822924,725511199),new r.init(528734635,4215389547),new r.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var n=(h=this._hash.words)[0],r=h[1],i=h[2],s=h[3],u=h[4],c=h[5],l=h[6],h=h[7],f=n.high,p=n.low,d=r.high,g=r.low,m=i.high,v=i.low,y=s.high,b=s.low,w=u.high,x=u.low,S=c.high,E=c.low,F=l.high,A=l.low,C=h.high,D=h.low,I=f,$=p,R=d,T=g,_=m,P=v,k=y,O=b,j=w,B=x,N=S,L=E,H=F,M=A,U=C,V=D,q=0;80>q;q++){var K=a[q];if(16>q)var z=K.high=0|t[e+2*q],G=K.low=0|t[e+2*q+1];else{z=((G=(z=a[q-15]).high)>>>1|(W=z.low)<<31)^(G>>>8|W<<24)^G>>>7;var W=(W>>>1|G<<31)^(W>>>8|G<<24)^(W>>>7|G<<25),Y=((G=(Y=a[q-2]).high)>>>19|(X=Y.low)<<13)^(G<<3|X>>>29)^G>>>6,X=(X>>>19|G<<13)^(X<<3|G>>>29)^(X>>>6|G<<26),J=(G=a[q-7]).high,Z=(Q=a[q-16]).high,Q=Q.low;z=(z=(z=z+J+((G=W+G.low)>>>0<W>>>0?1:0))+Y+((G=G+X)>>>0<X>>>0?1:0))+Z+((G=G+Q)>>>0<Q>>>0?1:0);K.high=z,K.low=G}J=j&N^~j&H,Q=B&L^~B&M,K=I&R^I&_^R&_;var tt=$&T^$&P^T&P,et=(W=(I>>>28|$<<4)^(I<<30|$>>>2)^(I<<25|$>>>7),Y=($>>>28|I<<4)^($<<30|I>>>2)^($<<25|I>>>7),(X=o[q]).high),nt=X.low;Z=U+((j>>>14|B<<18)^(j>>>18|B<<14)^(j<<23|B>>>9))+((X=V+((B>>>14|j<<18)^(B>>>18|j<<14)^(B<<23|j>>>9)))>>>0<V>>>0?1:0),U=H,V=M,H=N,M=L,N=j,L=B,j=k+(Z=(Z=(Z=Z+J+((X=X+Q)>>>0<Q>>>0?1:0))+et+((X=X+nt)>>>0<nt>>>0?1:0))+z+((X=X+G)>>>0<G>>>0?1:0))+((B=O+X|0)>>>0<O>>>0?1:0)|0,k=_,O=P,_=R,P=T,R=I,T=$,I=Z+(K=W+K+((G=Y+tt)>>>0<Y>>>0?1:0))+(($=X+G|0)>>>0<X>>>0?1:0)|0}p=n.low=p+$,n.high=f+I+(p>>>0<$>>>0?1:0),g=r.low=g+T,r.high=d+R+(g>>>0<T>>>0?1:0),v=i.low=v+P,i.high=m+_+(v>>>0<P>>>0?1:0),b=s.low=b+O,s.high=y+k+(b>>>0<O>>>0?1:0),x=u.low=x+B,u.high=w+j+(x>>>0<B>>>0?1:0),E=c.low=E+L,c.high=S+N+(E>>>0<L>>>0?1:0),A=l.low=A+M,l.high=F+H+(A>>>0<M>>>0?1:0),D=h.low=D+V,h.high=C+U+(D>>>0<V>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),e[31+(r+128>>>10<<5)]=n,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32}),e.SHA512=n._createHelper(s),e.HmacSHA512=n._createHmacHelper(s)}(),function(){var t=g,e=(i=t.x64).Word,n=i.WordArray,r=(i=t.algo).SHA512,i=i.SHA384=r.extend({_doReset:function(){this._hash=new n.init([new e.init(3418070365,3238371032),new e.init(1654270250,914150663),new e.init(2438529370,812702999),new e.init(355462360,4144912697),new e.init(1731405415,4290775857),new e.init(2394180231,1750603025),new e.init(3675008525,1694076839),new e.init(1203062813,3204075428)])},_doFinalize:function(){var t=r._doFinalize.call(this);return t.sigBytes-=16,t}});t.SHA384=r._createHelper(i),t.HmacSHA384=r._createHmacHelper(i)}(),function(){var t=g,e=(r=t.lib).WordArray,n=r.Hasher,r=t.algo,i=e.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),s=e.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),o=e.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),a=e.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),u=e.create([0,1518500249,1859775393,2400959708,2840853838]),c=e.create([1352829926,1548603684,1836072691,2053994217,0]);r=r.RIPEMD160=n.extend({_doReset:function(){this._hash=e.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=0;16>n;n++){var r=t[w=e+n];t[w]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var l,h,f,p,d,g,m,v,y,b,w=this._hash.words,x=(r=u.words,c.words),S=i.words,E=s.words,F=o.words,A=a.words;g=l=w[0],m=h=w[1],v=f=w[2],y=p=w[3],b=d=w[4];var C;for(n=0;80>n;n+=1)C=l+t[e+S[n]]|0,C=16>n?C+((h^f^p)+r[0]):32>n?C+((h&f|~h&p)+r[1]):48>n?C+(((h|~f)^p)+r[2]):64>n?C+((h&p|f&~p)+r[3]):C+((h^(f|~p))+r[4]),C=(C=(C|=0)<<F[n]|C>>>32-F[n])+d|0,l=d,d=p,p=f<<10|f>>>22,f=h,h=C,C=g+t[e+E[n]]|0,C=16>n?C+((m^(v|~y))+x[0]):32>n?C+((m&y|v&~y)+x[1]):48>n?C+(((m|~v)^y)+x[2]):64>n?C+((m&v|~m&y)+x[3]):C+((m^v^y)+x[4]),C=(C=(C|=0)<<A[n]|C>>>32-A[n])+b|0,g=b,b=y,y=v<<10|v>>>22,v=m,m=C;C=w[1]+f+y|0,w[1]=w[2]+p+b|0,w[2]=w[3]+d+g|0,w[3]=w[4]+l+m|0,w[4]=w[0]+h+v|0,w[0]=C},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;for(e[r>>>5]|=128<<24-r%32,e[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t.sigBytes=4*(e.length+1),this._process(),e=(t=this._hash).words,n=0;5>n;n++)r=e[n],e[n]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8);return t},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});t.RIPEMD160=n._createHelper(r),t.HmacRIPEMD160=n._createHmacHelper(r)}(Math),function(){var t=g,e=t.enc.Utf8;t.algo.HMAC=t.lib.Base.extend({init:function(t,n){t=this._hasher=new t.init,"string"==typeof n&&(n=e.parse(n));var r=t.blockSize,i=4*r;n.sigBytes>i&&(n=t.finalize(n)),n.clamp();for(var s=this._oKey=n.clone(),o=this._iKey=n.clone(),a=s.words,u=o.words,c=0;c<r;c++)a[c]^=1549556828,u[c]^=909522486;s.sigBytes=o.sigBytes=i,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher;return t=e.finalize(t),e.reset(),e.finalize(this._oKey.clone().concat(t))}})}(),function(){var t,e=g,n=(t=e.lib).Base,r=t.WordArray,i=(t=e.algo).HMAC,s=t.PBKDF2=n.extend({cfg:n.extend({keySize:4,hasher:t.SHA1,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){var n=this.cfg,s=i.create(n.hasher,t),o=r.create(),a=r.create([1]),u=o.words,c=a.words,l=n.keySize;for(n=n.iterations;u.length<l;){var h=s.update(e).finalize(a);s.reset();for(var f=h.words,p=f.length,d=h,g=1;g<n;g++){d=s.finalize(d),s.reset();for(var m=d.words,v=0;v<p;v++)f[v]^=m[v]}o.concat(h),c[0]++}return o.sigBytes=4*l,o}});e.PBKDF2=function(t,e,n){return s.create(n).compute(t,e)}}();
|
|
2
2
|
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
3
3
|
*/
|
|
4
4
|
var m,v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function y(t){var e,n,r="";for(e=0;e+3<=t.length;e+=3)n=parseInt(t.substring(e,e+3),16),r+=v.charAt(n>>6)+v.charAt(63&n);for(e+1==t.length?(n=parseInt(t.substring(e,e+1),16),r+=v.charAt(n<<2)):e+2==t.length&&(n=parseInt(t.substring(e,e+2),16),r+=v.charAt(n>>2)+v.charAt((3&n)<<4)),"=";(3&r.length)>0;)r+="=";return r}function b(t){var e,n,r,i="",s=0;for(e=0;e<t.length&&"="!=t.charAt(e);++e)(r=v.indexOf(t.charAt(e)))<0||(0==s?(i+=C(r>>2),n=3&r,s=1):1==s?(i+=C(n<<2|r>>4),n=15&r,s=2):2==s?(i+=C(n),i+=C(r>>2),n=3&r,s=3):(i+=C(n<<2|r>>4),i+=C(15&r),s=0));return 1==s&&(i+=C(n<<2)),i}function w(t){var e,n=b(t),r=new Array;for(e=0;2*e<n.length;++e)r[e]=parseInt(n.substring(2*e,2*e+2),16);return r}function x(t,e,n){null!=t&&("number"==typeof t?this.fromNumber(t,e,n):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function S(){return new x(null)}"Microsoft Internet Explorer"==p.appName?(x.prototype.am=function(t,e,n,r,i,s){for(var o=32767&e,a=e>>15;--s>=0;){var u=32767&this[t],c=this[t++]>>15,l=a*u+c*o;i=((u=o*u+((32767&l)<<15)+n[r]+(1073741823&i))>>>30)+(l>>>15)+a*c+(i>>>30),n[r++]=1073741823&u}return i},m=30):"Netscape"!=p.appName?(x.prototype.am=function(t,e,n,r,i,s){for(;--s>=0;){var o=e*this[t++]+n[r]+i;i=Math.floor(o/67108864),n[r++]=67108863&o}return i},m=26):(x.prototype.am=function(t,e,n,r,i,s){for(var o=16383&e,a=e>>14;--s>=0;){var u=16383&this[t],c=this[t++]>>14,l=a*u+c*o;i=((u=o*u+((16383&l)<<14)+n[r]+i)>>28)+(l>>14)+a*c,n[r++]=268435455&u}return i},m=28),x.prototype.DB=m,x.prototype.DM=(1<<m)-1,x.prototype.DV=1<<m;x.prototype.FV=Math.pow(2,52),x.prototype.F1=52-m,x.prototype.F2=2*m-52;var E,F,A=new Array;for(E="0".charCodeAt(0),F=0;F<=9;++F)A[E++]=F;for(E="a".charCodeAt(0),F=10;F<36;++F)A[E++]=F;for(E="A".charCodeAt(0),F=10;F<36;++F)A[E++]=F;function C(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function D(t,e){var n=A[t.charCodeAt(e)];return null==n?-1:n}function I(t){var e=S();return e.fromInt(t),e}function $(t){var e,n=1;return 0!=(e=t>>>16)&&(t=e,n+=16),0!=(e=t>>8)&&(t=e,n+=8),0!=(e=t>>4)&&(t=e,n+=4),0!=(e=t>>2)&&(t=e,n+=2),0!=(e=t>>1)&&(t=e,n+=1),n}function R(t){this.m=t}function T(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function _(t,e){return t&e}function P(t,e){return t|e}function k(t,e){return t^e}function O(t,e){return t&~e}function j(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function B(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function N(){}function L(t){return t}function H(t){this.r2=S(),this.q3=S(),x.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}R.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},R.prototype.revert=function(t){return t},R.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},R.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},R.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},T.prototype.convert=function(t){var e=S();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(x.ZERO)>0&&this.m.subTo(e,e),e},T.prototype.revert=function(t){var e=S();return t.copyTo(e),this.reduce(e),e},T.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var n=32767&t[e],r=n*this.mpl+((n*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[n=e+this.m.t]+=this.m.am(0,r,t,e,0,this.m.t);t[n]>=t.DV;)t[n]-=t.DV,t[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},T.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},T.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},x.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},x.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},x.prototype.fromString=function(t,e){var n;if(16==e)n=4;else if(8==e)n=3;else if(256==e)n=8;else if(2==e)n=1;else if(32==e)n=5;else{if(4!=e)return void this.fromRadix(t,e);n=2}this.t=0,this.s=0;for(var r=t.length,i=!1,s=0;--r>=0;){var o=8==n?255&t[r]:D(t,r);o<0?"-"==t.charAt(r)&&(i=!0):(i=!1,0==s?this[this.t++]=o:s+n>this.DB?(this[this.t-1]|=(o&(1<<this.DB-s)-1)<<s,this[this.t++]=o>>this.DB-s):this[this.t-1]|=o<<s,(s+=n)>=this.DB&&(s-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&&x.ZERO.subTo(this,this)},x.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},x.prototype.dlShiftTo=function(t,e){var n;for(n=this.t-1;n>=0;--n)e[n+t]=this[n];for(n=t-1;n>=0;--n)e[n]=0;e.t=this.t+t,e.s=this.s},x.prototype.drShiftTo=function(t,e){for(var n=t;n<this.t;++n)e[n-t]=this[n];e.t=Math.max(this.t-t,0),e.s=this.s},x.prototype.lShiftTo=function(t,e){var n,r=t%this.DB,i=this.DB-r,s=(1<<i)-1,o=Math.floor(t/this.DB),a=this.s<<r&this.DM;for(n=this.t-1;n>=0;--n)e[n+o+1]=this[n]>>i|a,a=(this[n]&s)<<r;for(n=o-1;n>=0;--n)e[n]=0;e[o]=a,e.t=this.t+o+1,e.s=this.s,e.clamp()},x.prototype.rShiftTo=function(t,e){e.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t)e.t=0;else{var r=t%this.DB,i=this.DB-r,s=(1<<r)-1;e[0]=this[n]>>r;for(var o=n+1;o<this.t;++o)e[o-n-1]|=(this[o]&s)<<i,e[o-n]=this[o]>>r;r>0&&(e[this.t-n-1]|=(this.s&s)<<i),e.t=this.t-n,e.clamp()}},x.prototype.subTo=function(t,e){for(var n=0,r=0,i=Math.min(t.t,this.t);n<i;)r+=this[n]-t[n],e[n++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r-=t.s;n<this.t;)r+=this[n],e[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<t.t;)r-=t[n],e[n++]=r&this.DM,r>>=this.DB;r-=t.s}e.s=r<0?-1:0,r<-1?e[n++]=this.DV+r:r>0&&(e[n++]=r),e.t=n,e.clamp()},x.prototype.multiplyTo=function(t,e){var n=this.abs(),r=t.abs(),i=n.t;for(e.t=i+r.t;--i>=0;)e[i]=0;for(i=0;i<r.t;++i)e[i+n.t]=n.am(0,r[i],e,i,0,n.t);e.s=0,e.clamp(),this.s!=t.s&&x.ZERO.subTo(e,e)},x.prototype.squareTo=function(t){for(var e=this.abs(),n=t.t=2*e.t;--n>=0;)t[n]=0;for(n=0;n<e.t-1;++n){var r=e.am(n,e[n],t,2*n,0,1);(t[n+e.t]+=e.am(n+1,2*e[n],t,2*n+1,r,e.t-n-1))>=e.DV&&(t[n+e.t]-=e.DV,t[n+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(n,e[n],t,2*n,0,1)),t.s=0,t.clamp()},x.prototype.divRemTo=function(t,e,n){var r=t.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t)return null!=e&&e.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=S());var s=S(),o=this.s,a=t.s,u=this.DB-$(r[r.t-1]);u>0?(r.lShiftTo(u,s),i.lShiftTo(u,n)):(r.copyTo(s),i.copyTo(n));var c=s.t,l=s[c-1];if(0!=l){var h=l*(1<<this.F1)+(c>1?s[c-2]>>this.F2:0),f=this.FV/h,p=(1<<this.F1)/h,d=1<<this.F2,g=n.t,m=g-c,v=null==e?S():e;for(s.dlShiftTo(m,v),n.compareTo(v)>=0&&(n[n.t++]=1,n.subTo(v,n)),x.ONE.dlShiftTo(c,v),v.subTo(s,s);s.t<c;)s[s.t++]=0;for(;--m>=0;){var y=n[--g]==l?this.DM:Math.floor(n[g]*f+(n[g-1]+d)*p);if((n[g]+=s.am(0,y,n,m,0,c))<y)for(s.dlShiftTo(m,v),n.subTo(v,n);n[g]<--y;)n.subTo(v,n)}null!=e&&(n.drShiftTo(c,e),o!=a&&x.ZERO.subTo(e,e)),n.t=c,n.clamp(),u>0&&n.rShiftTo(u,n),o<0&&x.ZERO.subTo(n,n)}}},x.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},x.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},x.prototype.exp=function(t,e){if(t>4294967295||t<1)return x.ONE;var n=S(),r=S(),i=e.convert(this),s=$(t)-1;for(i.copyTo(n);--s>=0;)if(e.sqrTo(n,r),(t&1<<s)>0)e.mulTo(r,i,n);else{var o=n;n=r,r=o}return e.revert(n)},x.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var n,r=(1<<e)-1,i=!1,s="",o=this.t,a=this.DB-o*this.DB%e;if(o-- >0)for(a<this.DB&&(n=this[o]>>a)>0&&(i=!0,s=C(n));o>=0;)a<e?(n=(this[o]&(1<<a)-1)<<e-a,n|=this[--o]>>(a+=this.DB-e)):(n=this[o]>>(a-=e)&r,a<=0&&(a+=this.DB,--o)),n>0&&(i=!0),i&&(s+=C(n));return i?s:"0"},x.prototype.negate=function(){var t=S();return x.ZERO.subTo(this,t),t},x.prototype.abs=function(){return this.s<0?this.negate():this},x.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var n=this.t;if(0!=(e=n-t.t))return this.s<0?-e:e;for(;--n>=0;)if(0!=(e=this[n]-t[n]))return e;return 0},x.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+$(this[this.t-1]^this.s&this.DM)},x.prototype.mod=function(t){var e=S();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(x.ZERO)>0&&t.subTo(e,e),e},x.prototype.modPowInt=function(t,e){var n;return n=t<256||e.isEven()?new R(e):new T(e),this.exp(t,n)},x.ZERO=I(0),x.ONE=I(1),N.prototype.convert=L,N.prototype.revert=L,N.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n)},N.prototype.sqrTo=function(t,e){t.squareTo(e)},H.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=S();return t.copyTo(e),this.reduce(e),e},H.prototype.revert=function(t){return t},H.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},H.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},H.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var M=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],U=(1<<26)/M[M.length-1];
|
|
@@ -25,7 +25,7 @@ it.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bit
|
|
|
25
25
|
/*! Mike Samuel (c) 2009 | code.google.com/p/json-sans-eval
|
|
26
26
|
*/
|
|
27
27
|
var at=function(){var t=new RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)|(?:"(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))*"))',"g"),e=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),n={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function r(t,e,r){return e?n[e]:String.fromCharCode(parseInt(r,16))}var i=new String(""),s=Object.hasOwnProperty;return function(n,o){var a,u,c=n.match(t),l=c[0],h=!1;"{"===l?a={}:"["===l?a=[]:(a=[],h=!0);for(var f=[a],p=1-h,d=c.length;p<d;++p){var g;switch((l=c[p]).charCodeAt(0)){default:(g=f[0])[u||g.length]=+l,u=void 0;break;case 34:if(-1!==(l=l.substring(1,l.length-1)).indexOf("\\")&&(l=l.replace(e,r)),g=f[0],!u){if(!(g instanceof Array)){u=l||i;break}u=g.length}g[u]=l,u=void 0;break;case 91:g=f[0],f.unshift(g[u||g.length]=[]),u=void 0;break;case 93:f.shift();break;case 102:(g=f[0])[u||g.length]=!1,u=void 0;break;case 110:(g=f[0])[u||g.length]=null,u=void 0;break;case 116:(g=f[0])[u||g.length]=!0,u=void 0;break;case 123:g=f[0],f.unshift(g[u||g.length]={}),u=void 0;break;case 125:f.shift()}}if(h){if(1!==f.length)throw new Error;a=a[0]}else if(f.length)throw new Error;if(o){var m=function(t,e){var n=t[e];if(n&&"object"==typeof n){var r=null;for(var i in n)if(s.call(n,i)&&n!==t){var a=m(n,i);void 0!==a?n[i]=a:(r||(r=[]),r.push(i))}if(r)for(var u=r.length;--u>=0;)delete n[r[u]]}return o.call(t,e,n)};a=m({"":a},"")}return a}}();void 0!==ut&&ut||(ut={}),void 0!==ut.asn1&&ut.asn1||(ut.asn1={}),ut.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);return e.length%2==1&&(e="0"+e),e},this.bigIntToMinTwosComplementsHex=function(t){var e=t.toString(16);if("-"!=e.substr(0,1))e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{var n=e.substr(1).length;n%2==1?n+=1:e.match(/^[0-7]/)||(n+=2);for(var r="",i=0;i<n;i++)r+="f";e=new x(r,16).xor(t).add(x.ONE).toString(16).replace(/^-/,"")}return e},this.getPEMStringFromHex=function(t,e){return It(t,e)},this.newObject=function(t){var e=ut.asn1,n=e.ASN1Object,r=e.DERBoolean,i=e.DERInteger,s=e.DERBitString,o=e.DEROctetString,a=e.DERNull,u=e.DERObjectIdentifier,c=e.DEREnumerated,l=e.DERUTF8String,h=e.DERNumericString,f=e.DERPrintableString,p=e.DERTeletexString,d=e.DERIA5String,g=e.DERUTCTime,m=e.DERGeneralizedTime,v=e.DERVisibleString,y=e.DERBMPString,b=e.DERSequence,w=e.DERSet,x=e.DERTaggedObject,S=e.ASN1Util.newObject;if(t instanceof e.ASN1Object)return t;var E=Object.keys(t);if(1!=E.length)throw new Error("key of param shall be only one.");var F=E[0];if(-1==":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+F+":"))throw new Error("undefined key: "+F);if("bool"==F)return new r(t[F]);if("int"==F)return new i(t[F]);if("bitstr"==F)return new s(t[F]);if("octstr"==F)return new o(t[F]);if("null"==F)return new a(t[F]);if("oid"==F)return new u(t[F]);if("enum"==F)return new c(t[F]);if("utf8str"==F)return new l(t[F]);if("numstr"==F)return new h(t[F]);if("prnstr"==F)return new f(t[F]);if("telstr"==F)return new p(t[F]);if("ia5str"==F)return new d(t[F]);if("utctime"==F)return new g(t[F]);if("gentime"==F)return new m(t[F]);if("visstr"==F)return new v(t[F]);if("bmpstr"==F)return new y(t[F]);if("asn1"==F)return new n(t[F]);if("seq"==F){for(var A=t[F],C=[],D=0;D<A.length;D++){var I=S(A[D]);C.push(I)}return new b({array:C})}if("set"==F){for(A=t[F],C=[],D=0;D<A.length;D++){I=S(A[D]);C.push(I)}return new w({array:C})}if("tag"==F){var $=t[F];if("[object Array]"===Object.prototype.toString.call($)&&3==$.length){var R=S($[2]);return new x({tag:$[0],explicit:$[1],obj:R})}return new x($)}},this.jsonToASN1HEX=function(t){return this.newObject(t).tohex()}},ut.asn1.ASN1Util.oidHexToInt=function(t){for(var e="",n=parseInt(t.substr(0,2),16),r=(e=Math.floor(n/40)+"."+n%40,""),i=2;i<t.length;i+=2){var s=("00000000"+parseInt(t.substr(i,2),16).toString(2)).slice(-8);if(r+=s.substr(1,7),"0"==s.substr(0,1))e=e+"."+new x(r,2).toString(10),r=""}return e},ut.asn1.ASN1Util.oidIntToHex=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},n=function(t){var n="",r=new x(t,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var s="",o=0;o<i;o++)s+="0";r=s+r;for(o=0;o<r.length-1;o+=7){var a=r.substr(o,7);o!=r.length-7&&(a="1"+a),n+=e(parseInt(a,2))}return n};if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var r="",i=t.split("."),s=40*parseInt(i[0])+parseInt(i[1]);r+=e(s),i.splice(0,2);for(var o=0;o<i.length;o++)r+=n(i[o]);return r},ut.asn1.ASN1Object=function(t){this.params=null,this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw new Error("this.hV is null or undefined");if(this.hV.length%2==1)throw new Error("value hex must be even length: n="+"".length+",v="+this.hV);var t=this.hV.length/2,e=t.toString(16);if(e.length%2==1&&(e="0"+e),t<128)return e;var n=e.length/2;if(n>15)throw new Error("ASN.1 length too long to represent by 8x: n = "+t.toString(16));return(128+n).toString(16)+e},this.tohex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.getValueHex=function(){return this.tohex(),this.hV},this.getFreshValueHex=function(){return""},this.setByParam=function(t){this.params=t},null!=t&&null!=t.tlv&&(this.hTLV=t.tlv,this.isModified=!1)},ut.asn1.DERAbstractString=function(t){ut.asn1.DERAbstractString.superclass.constructor.call(this);this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=wt(this.s).toLowerCase()},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?this.setString(t):void 0!==t.str?this.setString(t.str):void 0!==t.hex&&this.setStringHex(t.hex))},Zt(ut.asn1.DERAbstractString,ut.asn1.ASN1Object),ut.asn1.DERAbstractTime=function(t){ut.asn1.DERAbstractTime.superclass.constructor.call(this);this.localDateToUTC=function(t){var e=t.getTime()+6e4*t.getTimezoneOffset();return new Date(e)},this.formatDate=function(t,e,n){var r=this.zeroPadding,i=this.localDateToUTC(t),s=String(i.getFullYear());"utc"==e&&(s=s.substr(2,2));var o=s+r(String(i.getMonth()+1),2)+r(String(i.getDate()),2)+r(String(i.getHours()),2)+r(String(i.getMinutes()),2)+r(String(i.getSeconds()),2);if(!0===n){var a=i.getMilliseconds();if(0!=a){var u=r(String(a),3);o=o+"."+(u=u.replace(/[0]+$/,""))}}return o+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.setByParam=function(t){this.hV=null,this.hTLV=null,this.params=t},this.getString=function(){},this.setString=function(t){this.hTLV=null,this.isModified=!0,null==this.params&&(this.params={}),this.params.str=t},this.setByDate=function(t){this.hTLV=null,this.isModified=!0,null==this.params&&(this.params={}),this.params.date=t},this.setByDateValue=function(t,e,n,r,i,s){var o=new Date(Date.UTC(t,e-1,n,r,i,s,0));this.setByDate(o)},this.getFreshValueHex=function(){return this.hV}},Zt(ut.asn1.DERAbstractTime,ut.asn1.ASN1Object),ut.asn1.DERAbstractStructured=function(t){ut.asn1.DERAbstractString.superclass.constructor.call(this);this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&void 0!==t.array&&(this.asn1Array=t.array)},Zt(ut.asn1.DERAbstractStructured,ut.asn1.ASN1Object),ut.asn1.DERBoolean=function(t){ut.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==t?"010100":"0101ff"},Zt(ut.asn1.DERBoolean,ut.asn1.ASN1Object),ut.asn1.DERInteger=function(t){ut.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=ut.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new x(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.bigint?this.setByBigInteger(t.bigint):void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},Zt(ut.asn1.DERInteger,ut.asn1.ASN1Object),ut.asn1.DERBitString=function(t){if(void 0!==t&&void 0!==t.obj){var e=ut.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.tohex()}ut.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7<t)throw"unused bits shall be from 0 to 7: u = "+t;var n="0"+t;this.hTLV=null,this.isModified=!0,this.hV=n+e},this.setByBinaryString=function(t){var e=8-(t=t.replace(/0+$/,"")).length%8;8==e&&(e=0),t+="0000000".substr(0,e);for(var n="",r=0;r<t.length-1;r+=8){var i=t.substr(r,8),s=parseInt(i,2).toString(16);1==s.length&&(s="0"+s),n+=s}this.hTLV=null,this.isModified=!0,this.hV="0"+e+n},this.setByBooleanArray=function(t){for(var e="",n=0;n<t.length;n++)1==t[n]?e+="1":e+="0";this.setByBinaryString(e)},this.newFalseArray=function(t){for(var e=new Array(t),n=0;n<t;n++)e[n]=!1;return e},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t&&t.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(t):void 0!==t.hex?this.setHexValueIncludingUnusedBits(t.hex):void 0!==t.bin?this.setByBinaryString(t.bin):void 0!==t.array&&this.setByBooleanArray(t.array))},Zt(ut.asn1.DERBitString,ut.asn1.ASN1Object),ut.asn1.DEROctetString=function(t){if(void 0!==t&&void 0!==t.obj){var e=ut.asn1.ASN1Util.newObject(t.obj);t.hex=e.tohex()}ut.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},Zt(ut.asn1.DEROctetString,ut.asn1.DERAbstractString),ut.asn1.DERNull=function(){ut.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},Zt(ut.asn1.DERNull,ut.asn1.ASN1Object),ut.asn1.DERObjectIdentifier=function(t){ut.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueOidString=function(t){var e=Kt(t);if(null==e)throw new Error("malformed oid string: "+t);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueName=function(t){var e=ut.asn1.x509.OID.name2oid(t);if(""===e)throw new Error("DERObjectIdentifier oidName undefined: "+t);this.setValueOidString(e)},this.setValueNameOrOid=function(t){t.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(t):this.setValueName(t)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(t){"string"==typeof t?this.setValueNameOrOid(t):void 0!==t.oid?this.setValueNameOrOid(t.oid):void 0!==t.name?this.setValueNameOrOid(t.name):void 0!==t.hex&&this.setValueHex(t.hex)},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.DERObjectIdentifier,ut.asn1.ASN1Object),ut.asn1.DEREnumerated=function(t){ut.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=ut.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new x(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},Zt(ut.asn1.DEREnumerated,ut.asn1.ASN1Object),ut.asn1.DERUTF8String=function(t){ut.asn1.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"},Zt(ut.asn1.DERUTF8String,ut.asn1.DERAbstractString),ut.asn1.DERNumericString=function(t){ut.asn1.DERNumericString.superclass.constructor.call(this,t),this.hT="12"},Zt(ut.asn1.DERNumericString,ut.asn1.DERAbstractString),ut.asn1.DERPrintableString=function(t){ut.asn1.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"},Zt(ut.asn1.DERPrintableString,ut.asn1.DERAbstractString),ut.asn1.DERTeletexString=function(t){ut.asn1.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"},Zt(ut.asn1.DERTeletexString,ut.asn1.DERAbstractString),ut.asn1.DERIA5String=function(t){ut.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="16"},Zt(ut.asn1.DERIA5String,ut.asn1.DERAbstractString),ut.asn1.DERVisibleString=function(t){ut.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="1a"},Zt(ut.asn1.DERVisibleString,ut.asn1.DERAbstractString),ut.asn1.DERBMPString=function(t){ut.asn1.DERBMPString.superclass.constructor.call(this,t),this.hT="1e"},Zt(ut.asn1.DERBMPString,ut.asn1.DERAbstractString),ut.asn1.DERUTCTime=function(t){ut.asn1.DERUTCTime.superclass.constructor.call(this,t),this.hT="17",this.params=void 0,this.getFreshValueHex=function(){var t=this.params;if(null==this.params&&(t={date:new Date}),"string"==typeof t){if(!t.match(/^[0-9]{12}Z$/)&&!t.match(/^[0-9]{12}\.[0-9]+Z$/))throw new Error("malformed string for UTCTime: "+t);this.hV=gt(t)}else if(null!=t.str)this.hV=gt(t.str);else if(null==t.date&&1==t.millis){var e=new Date;this.hV=gt(this.formatDate(e,"utc",!0))}else if(null!=t.date&&t.date instanceof Date){var n=!0===t.millis;this.hV=gt(this.formatDate(t.date,"utc",n))}else t instanceof Date&&(this.hV=gt(this.formatDate(t,"utc")));if(null==this.hV)throw new Error("parameter not specified properly for UTCTime");return this.hV},null!=t&&this.setByParam(t)},Zt(ut.asn1.DERUTCTime,ut.asn1.DERAbstractTime),ut.asn1.DERGeneralizedTime=function(t){ut.asn1.DERGeneralizedTime.superclass.constructor.call(this,t),this.hT="18",this.params=t,this.getFreshValueHex=function(){var t=this.params;if(null==this.params&&(t={date:new Date}),"string"==typeof t){if(!t.match(/^[0-9]{14}Z$/)&&!t.match(/^[0-9]{14}\.[0-9]+Z$/))throw new Error("malformed string for GeneralizedTime: "+t);this.hV=gt(t)}else if(null!=t.str)this.hV=gt(t.str);else if(null==t.date&&1==t.millis){var e=new Date;this.hV=gt(this.formatDate(e,"gen",!0))}else if(null!=t.date&&t.date instanceof Date){var n=!0===t.millis;this.hV=gt(this.formatDate(t.date,"gen",n))}else t instanceof Date&&(this.hV=gt(this.formatDate(t,"gen")));if(null==this.hV)throw new Error("parameter not specified properly for GeneralizedTime");return this.hV},null!=t&&this.setByParam(t)},Zt(ut.asn1.DERGeneralizedTime,ut.asn1.DERAbstractTime),ut.asn1.DERSequence=function(t){ut.asn1.DERSequence.superclass.constructor.call(this,t),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e<this.asn1Array.length;e++){t+=this.asn1Array[e].tohex()}return this.hV=t,this.hV}},Zt(ut.asn1.DERSequence,ut.asn1.DERAbstractStructured),ut.asn1.DERSet=function(t){ut.asn1.DERSet.superclass.constructor.call(this,t),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,e=0;e<this.asn1Array.length;e++){var n=this.asn1Array[e];t.push(n.tohex())}return 1==this.sortFlag&&t.sort(),this.hV=t.join(""),this.hV},void 0!==t&&void 0!==t.sortflag&&0==t.sortflag&&(this.sortFlag=!1)},Zt(ut.asn1.DERSet,ut.asn1.DERAbstractStructured),ut.asn1.DERTaggedObject=function(t){ut.asn1.DERTaggedObject.superclass.constructor.call(this);var e=ut.asn1,n=ht,r=n.getV,i=(n.isASN1HEX,e.ASN1Util.newObject);this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.params={tag:"a0",explicit:!0},this.setASN1Object=function(t,e,n){this.params={tag:e,explicit:t,obj:n}},this.getFreshValueHex=function(){var t=this.params;if(null==t.explicit&&(t.explicit=!0),null!=t.tage&&(t.tag=t.tage,t.explicit=!0),null!=t.tagi&&(t.tag=t.tagi,t.explicit=!1),null!=t.str)this.hV=wt(t.str);else if(null!=t.hex)this.hV=t.hex;else{if(null==t.obj)throw new Error("str, hex nor obj not specified");var n;t.obj instanceof e.ASN1Object?n=t.obj.tohex():"object"==typeof t.obj&&(n=i(t.obj).tohex()),t.explicit?this.hV=n:this.hV=r(n,0)}return null==t.tag&&(t.tag="a0"),this.hT=t.tag,this.hTLV=null,this.isModified=!0,this.hV},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.DERTaggedObject,ut.asn1.ASN1Object);var ut,ct,lt,ht=new function(){};function ft(t){for(var e=new Array,n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function pt(t){for(var e="",n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e}function dt(t){for(var e="",n=0;n<t.length;n++){var r=t[n].toString(16);1==r.length&&(r="0"+r),e+=r}return e}function gt(t){return dt(ft(t))}function mt(t){return t=(t=(t=t.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function vt(t){return t.length%4==2?t+="==":t.length%4==3&&(t+="="),t=(t=t.replace(/-/g,"+")).replace(/_/g,"/")}function yt(t){return t.length%2==1&&(t="0"+t),mt(y(t))}function bt(t){return b(vt(t))}function wt(t){return _t(Mt(t)).toLowerCase()}function xt(t){try{return decodeURIComponent(Pt(t))}catch(t){return null}}function St(t){return xt(function(t){for(var e=t.match(/.{1,2}/g),n=[],r=0;r<e.length;r++){var i=parseInt(e[r],16);161<=i&&i<=191?(n.push("c2"),n.push(e[r])):192<=i&&i<=255?(n.push("c3"),n.push((i-64).toString(16))):n.push(e[r])}return n.join("")}(t))}function Et(t){for(var e="",n=0;n<t.length-1;n+=2)e+=String.fromCharCode(parseInt(t.substr(n,2),16));return e}function Ft(t){for(var e="",n=0;n<t.length;n++)e+=("0"+t.charCodeAt(n).toString(16)).slice(-2);return e}function At(t){return y(t)}function Ct(t){var e=At(t).replace(/(.{64})/g,"$1\r\n");return e=e.replace(/\r\n$/,"")}function Dt(t){return b(t.replace(/[^0-9A-Za-z\/+=]*/g,""))}function It(t,e){return"-----BEGIN "+e+"-----\r\n"+Ct(t)+"\r\n-----END "+e+"-----\r\n"}function $t(t,e){if(-1==t.indexOf("-----BEGIN "))throw"can't find PEM header: "+e;return Dt(t=void 0!==e?(t=t.replace(new RegExp("^[^]*-----BEGIN "+e+"-----"),"")).replace(new RegExp("-----END "+e+"-----[^]*$"),""):(t=t.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function Rt(t){var e,n,r,i,s,o,a,u,c,l,h;if(h=t.match(/^(\d{2}|\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/))return u=h[1],e=parseInt(u),2===u.length&&(50<=e&&e<100?e=1900+e:0<=e&&e<50&&(e=2e3+e)),n=parseInt(h[2])-1,r=parseInt(h[3]),i=parseInt(h[4]),s=parseInt(h[5]),o=parseInt(h[6]),a=0,""!==(c=h[7])&&(l=(c.substr(1)+"00").substr(0,3),a=parseInt(l)),Date.UTC(e,n,r,i,s,o,a);throw new Error("unsupported zulu format: "+t)}function Tt(t){return Math.round(Rt(t)/1e3)}function _t(t){return t.replace(/%/g,"")}function Pt(t){return t.replace(/(..)/g,"%$1")}function kt(t){var e="malformed IPv6 address";if(!t.match(/^[0-9A-Fa-f:]+$/))throw e;var n=(t=t.toLowerCase()).split(":").length-1;if(n<2)throw e;var r=":".repeat(7-n+2),i=(t=t.replace("::",r)).split(":");if(8!=i.length)throw e;for(var s=0;s<8;s++)i[s]=("0000"+i[s]).slice(-4);return i.join("")}function Ot(t){if(!t.match(/^[0-9A-Fa-f]{32}$/))throw new Error("malformed IPv6 address: "+t);var e=(t=t.toLowerCase()).match(/.{1,4}/g),n=(t=":"+(e=(e=e.map((function(t){return t.replace(/^0+/,"")}))).map((function(t){return""==t?"0":t}))).join(":")+":").match(/:(0:){2,}/g);if(null==n)return t.slice(1,-1);var r=n.sort().slice(-1)[0];return"::"!=(t=t.replace(r.substr(0,r.length-1),":")).substr(0,2)&&(t=t.substr(1)),"::"!=t.substr(-2,2)&&(t=t.substr(0,t.length-1)),t}function jt(t){var e=new Error("malformed hex value");if(!t.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw e;if(8==t.length){try{return parseInt(t.substr(0,2),16)+"."+parseInt(t.substr(2,2),16)+"."+parseInt(t.substr(4,2),16)+"."+parseInt(t.substr(6,2),16)}catch(t){throw e}}else{if(16!=t.length){if(32==t.length)return Ot(t);if(64==t.length){try{return Ot(t.substr(0,32))+"/"+Bt(t.substr(32))}catch(t){throw e}return}return t}try{return jt(t.substr(0,8))+"/"+Bt(t.substr(8))}catch(t){throw e}}}function Bt(t){var e,n=new Error("malformed mask");try{e=new x(t,16).toString(2)}catch(t){throw n}if(!e.match(/^1*0*$/))throw n;return e.replace(/0+$/,"").length}function Nt(t){var e=new Error("malformed IP address");if(!(t=t.toLowerCase(t)).match(/^[0-9a-f.:/]+$/))throw e;if(!t.match(/^[0-9.]+$/)){var n;if(t.match(/^[0-9.]+\/[0-9]+$/))return Nt((n=t.split("/"))[0])+Lt(parseInt(n[1]),32);if(t.match(/^[0-9a-f:]+$/)&&-1!==t.indexOf(":"))return kt(t);if(t.match(/^[0-9a-f:]+\/[0-9]+$/)&&-1!==t.indexOf(":"))return kt((n=t.split("/"))[0])+Lt(parseInt(n[1]),128);throw e}var r=t.split(".");if(4!==r.length)throw e;var i="";try{for(var s=0;s<4;s++){i+=("0"+parseInt(r[s]).toString(16)).slice(-2)}return i}catch(t){throw e}}function Lt(t,e){return 32==e&&0==t?"00000000":128==e&&0==t?"00000000000000000000000000000000":new x(Array(t+1).join("1")+Array(e-t+1).join("0"),2).toString(16)}function Ht(t){return t.match(/.{4}/g).map((function(t){var e=parseInt(t.substr(0,2),16),n=parseInt(t.substr(2),16);if(0==e&n<128)return String.fromCharCode(n);if(e<8){var r=128|63&n;return xt((192|(7&e)<<3|(192&n)>>6).toString(16)+r.toString(16))}r=128|(15&e)<<2|(192&n)>>6;var i=128|63&n;return xt((224|(240&e)>>4).toString(16)+r.toString(16)+i.toString(16))})).join("")}function Mt(t){for(var e=encodeURIComponent(t),n="",r=0;r<e.length;r++)"%"==e[r]?(n+=e.substr(r,3),r+=2):n=n+"%"+gt(e[r]);return n}function Ut(t){return!(t.length%2!=0||!t.match(/^[0-9a-f]+$/)&&!t.match(/^[0-9A-F]+$/))}function Vt(t){return!!t.match(/^[0-9A-Za-z-_.]+$/)}function qt(t){return t.length%2==1?"0"+t:t.substr(0,1)>"7"?"00"+t:t}ht.getLblen=function(t,e){if("8"!=t.substr(e+2,1))return 1;var n=parseInt(t.substr(e+3,1));return 0==n?-1:0<n&&n<10?n+1:-2},ht.getL=function(t,e){var n=ht.getLblen(t,e);return n<1?"":t.substr(e+2,2*n)},ht.getVblen=function(t,e){var n;return""==(n=ht.getL(t,e))?-1:("8"===n.substr(0,1)?new x(n.substr(2),16):new x(n,16)).intValue()},ht.getVidx=function(t,e){var n=ht.getLblen(t,e);return n<0?n:e+2*(n+1)},ht.getV=function(t,e){var n=ht.getVidx(t,e),r=ht.getVblen(t,e);return t.substr(n,2*r)},ht.getTLV=function(t,e){return t.substr(e,2)+ht.getL(t,e)+ht.getV(t,e)},ht.getTLVblen=function(t,e){return 2+2*ht.getLblen(t,e)+2*ht.getVblen(t,e)},ht.getNextSiblingIdx=function(t,e){return ht.getVidx(t,e)+2*ht.getVblen(t,e)},ht.getChildIdx=function(t,e){var n,r,i,s=ht,o=[];n=s.getVidx(t,e),r=2*s.getVblen(t,e),"03"==t.substr(e,2)&&(n+=2,r-=2),i=0;for(var a=n;i<=r;){var u=s.getTLVblen(t,a);if((i+=u)<=r&&o.push(a),a+=u,i>=r)break}return o},ht.getNthChildIdx=function(t,e,n){return ht.getChildIdx(t,e)[n]},ht.getIdxbyList=function(t,e,n,r){var i,s,o=ht;return 0==n.length?void 0!==r&&t.substr(e,2)!==r?-1:e:(i=n.shift())>=(s=o.getChildIdx(t,e)).length?-1:o.getIdxbyList(t,s[i],n,r)},ht.getIdxbyListEx=function(t,e,n,r){var i,s,o=ht;if(0==n.length)return void 0!==r&&t.substr(e,2)!==r?-1:e;i=n.shift(),s=o.getChildIdx(t,e);for(var a=0,u=0;u<s.length;u++){var c=t.substr(s[u],2);if("number"==typeof i&&!o.isContextTag(c)&&a==i||"string"==typeof i&&o.isContextTag(c,i))return o.getIdxbyListEx(t,s[u],n,r);o.isContextTag(c)||a++}return-1},ht.getTLVbyList=function(t,e,n,r){var i=ht,s=i.getIdxbyList(t,e,n,r);return-1==s||s>=t.length?null:i.getTLV(t,s)},ht.getTLVbyListEx=function(t,e,n,r){var i=ht,s=i.getIdxbyListEx(t,e,n,r);return-1==s?null:i.getTLV(t,s)},ht.getVbyList=function(t,e,n,r,i){var s,o,a=ht;return-1==(s=a.getIdxbyList(t,e,n,r))||s>=t.length?null:(o=a.getV(t,s),!0===i&&(o=o.substr(2)),o)},ht.getVbyListEx=function(t,e,n,r,i){var s,o,a=ht;return-1==(s=a.getIdxbyListEx(t,e,n,r))?null:(o=a.getV(t,s),"03"==t.substr(s,2)&&!1!==i&&(o=o.substr(2)),o)},ht.getInt=function(t,e,n){null==n&&(n=-1);try{var r=t.substr(e,2);if("02"!=r&&"03"!=r)return n;var i=ht.getV(t,e);return"02"==r?parseInt(i,16):Wt(i)}catch(t){return n}},ht.getOID=function(t,e,n){null==n&&(n=null);try{return"06"!=t.substr(e,2)?n:zt(ht.getV(t,e))}catch(t){return n}},ht.getOIDName=function(t,e,n){null==n&&(n=null);try{var r=ht.getOID(t,e,n);if(r==n)return n;var i=ut.asn1.x509.OID.oid2name(r);return""==i?r:i}catch(t){return n}},ht.getString=function(t,e,n){null==n&&(n=null);try{return Et(ht.getV(t,e))}catch(t){return n}},ht.hextooidstr=function(t){var e=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},n=[],r=t.substr(0,2),i=parseInt(r,16);n[0]=new String(Math.floor(i/40)),n[1]=new String(i%40);for(var s=t.substr(2),o=[],a=0;a<s.length/2;a++)o.push(parseInt(s.substr(2*a,2),16));var u=[],c="";for(a=0;a<o.length;a++)128&o[a]?c+=e((127&o[a]).toString(2),7):(c+=e((127&o[a]).toString(2),7),u.push(new String(parseInt(c,2))),c="");var l=n.join(".");return u.length>0&&(l=l+"."+u.join(".")),l},ht.dump=function(t,e,n,r){var i=ht,s=i.getV,o=i.dump,a=i.getChildIdx,u=t;t instanceof ut.asn1.ASN1Object&&(u=t.tohex());var c=function(t,e){return t.length<=2*e?t:t.substr(0,e)+"..(total "+t.length/2+"bytes).."+t.substr(t.length-e,e)};void 0===e&&(e={ommit_long_octet:32}),void 0===n&&(n=0),void 0===r&&(r="");var l,h=e.ommit_long_octet;if("01"==(l=u.substr(n,2)))return"00"==(f=s(u,n))?r+"BOOLEAN FALSE\n":r+"BOOLEAN TRUE\n";if("02"==l)return r+"INTEGER "+c(f=s(u,n),h)+"\n";if("03"==l){var f=s(u,n);if(i.isASN1HEX(f.substr(2))){var p=r+"BITSTRING, encapsulates\n";return p+=o(f.substr(2),e,0,r+" ")}return r+"BITSTRING "+c(f,h)+"\n"}if("04"==l){f=s(u,n);if(i.isASN1HEX(f)){p=r+"OCTETSTRING, encapsulates\n";return p+=o(f,e,0,r+" ")}return r+"OCTETSTRING "+c(f,h)+"\n"}if("05"==l)return r+"NULL\n";if("06"==l){var d=s(u,n),g=ut.asn1.ASN1Util.oidHexToInt(d),m=ut.asn1.x509.OID.oid2name(g),v=g.replace(/\./g," ");return""!=m?r+"ObjectIdentifier "+m+" ("+v+")\n":r+"ObjectIdentifier ("+v+")\n"}if("0a"==l)return r+"ENUMERATED "+parseInt(s(u,n))+"\n";if("0c"==l)return r+"UTF8String '"+xt(s(u,n))+"'\n";if("13"==l)return r+"PrintableString '"+xt(s(u,n))+"'\n";if("14"==l)return r+"TeletexString '"+xt(s(u,n))+"'\n";if("16"==l)return r+"IA5String '"+xt(s(u,n))+"'\n";if("17"==l)return r+"UTCTime "+xt(s(u,n))+"\n";if("18"==l)return r+"GeneralizedTime "+xt(s(u,n))+"\n";if("1a"==l)return r+"VisualString '"+xt(s(u,n))+"'\n";if("1e"==l)return r+"BMPString '"+Ht(s(u,n))+"'\n";if("30"==l){if("3000"==u.substr(n,4))return r+"SEQUENCE {}\n";p=r+"SEQUENCE\n";var y=e;if((2==(x=a(u,n)).length||3==x.length)&&"06"==u.substr(x[0],2)&&"04"==u.substr(x[x.length-1],2)){m=i.oidname(s(u,x[0]));var b=JSON.parse(JSON.stringify(e));b.x509ExtName=m,y=b}for(var w=0;w<x.length;w++)p+=o(u,y,x[w],r+" ");return p}if("31"==l){p=r+"SET\n";var x=a(u,n);for(w=0;w<x.length;w++)p+=o(u,e,x[w],r+" ");return p}if(0!=(128&(l=parseInt(l,16)))){var S=31&l;if(0!=(32&l)){for(p=r+"["+S+"]\n",x=a(u,n),w=0;w<x.length;w++)p+=o(u,e,x[w],r+" ");return p}f=s(u,n);if(ht.isASN1HEX(f)){var p=r+"["+S+"]\n";return p+=o(f,e,0,r+" ")}return("68747470"==f.substr(0,8)||"subjectAltName"===e.x509ExtName&&2==S)&&(f=xt(f)),p=r+"["+S+"] "+f+"\n"}return r+"UNKNOWN("+l+") "+s(u,n)+"\n"},ht.parse=function(t){var e=ht,n=e.parse,r=e.isASN1HEX,i=e.getV,s=e.getTLV,o=e.getChildIdx,a=ut.asn1,u=a.ASN1Util.oidHexToInt,c=a.x509.OID.oid2name,l=xt,h=Ht,f=St,p={"0c":"utf8str",12:"numstr",13:"prnstr",14:"telstr",16:"ia5str",17:"utctime",18:"gentime","1a":"visstr","1e":"bmpstr",30:"seq",31:"set"},d=t.substr(0,2),g={},m=i(t,0);if("01"==d)return"0101ff"==t?{bool:!0}:{bool:!1};if("02"==d)return{int:{hex:m}};if("03"==d)try{if("00"!=m.substr(0,2))throw"not encap";var v=m.substr(2);if(!r(v))throw"not encap";return{bitstr:{obj:n(v)}}}catch(t){var y=null;return m.length<=10&&(y=Xt(m)),null==y?{bitstr:{hex:m}}:{bitstr:{bin:y}}}else if("04"==d)try{if(!r(m))throw"not encap";return{octstr:{obj:n(m)}}}catch(t){return{octstr:{hex:m}}}else{if("05"==d)return{null:""};if("06"==d){var b=u(m),w=c(b);return""==w?{oid:b}:{oid:w}}if("0a"==d)return m.length>4?{enum:{hex:m}}:{enum:parseInt(m,16)};if("30"==d||"31"==d)return g[p[d]]=function(t){for(var e=[],r=o(t,0),i=0;i<r.length;i++){var a=r[i],u=s(t,a),c=n(u);e.push(c)}return e}(t),g;if("14"==d){var x=f(m);return g[p[d]]={str:x},g}if("1e"==d){x=h(m);return g[p[d]]={str:x},g}if(-1!=":0c:12:13:16:17:18:1a:".indexOf(d)){x=l(m);return g[p[d]]={str:x},g}if(d.match(/^8[0-9]$/))return null==(x=l(m))|""==x||null!=x.match(/[\x00-\x1F\x7F-\x9F]/)||null!=x.match(/[\u0000-\u001F\u0080–\u009F]/)?{tag:{tag:d,explicit:!1,hex:m}}:{tag:{tag:d,explicit:!1,str:x}};if(!d.match(/^a[0-9]$/)){var S=new ut.asn1.ASN1Object;return S.hV=m,{asn1:{tlv:d+S.getLengthHexFromValue()+m}}}try{if(!r(m))throw new Error("not encap");return{tag:{tag:d,explicit:!0,obj:n(m)}}}catch(t){return{tag:{tag:d,explicit:!0,hex:m}}}}},ht.isContextTag=function(t,e){var n,r;t=t.toLowerCase();try{n=parseInt(t,16)}catch(t){return-1}if(void 0===e)return 128==(192&n);try{return null!=e.match(/^\[[0-9]+\]$/)&&(!((r=parseInt(e.substr(1,e.length-1),10))>31)&&(128==(192&n)&&(31&n)==r))}catch(t){return!1}},ht.isASN1HEX=function(t){var e=ht;if(t.length%2==1)return!1;var n=e.getVblen(t,0),r=t.substr(0,2),i=e.getL(t,0);return t.length-r.length-i.length==2*n},ht.checkStrictDER=function(t,e,n,r,i){var s=ht;if(void 0===n){if("string"!=typeof t)throw new Error("not hex string");if(t=t.toLowerCase(),!ut.lang.String.isHex(t))throw new Error("not hex string");n=t.length,i=(r=t.length/2)<128?1:Math.ceil(r.toString(16))+1}if(s.getL(t,e).length>2*i)throw new Error("L of TLV too long: idx="+e);var o=s.getVblen(t,e);if(o>r)throw new Error("value of L too long than hex: idx="+e);var a=s.getTLV(t,e),u=a.length-2-s.getL(t,e).length;if(u!==2*o)throw new Error("V string length and L's value not the same:"+u+"/"+2*o);if(0===e&&t.length!=a.length)throw new Error("total length and TLV length unmatch:"+t.length+"!="+a.length);var c=t.substr(e,2);if("02"===c){var l=s.getVidx(t,e);if("00"==t.substr(l,2)&&t.charCodeAt(l+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(c,16)){for(var h=s.getVblen(t,e),f=0,p=s.getChildIdx(t,e),d=0;d<p.length;d++){f+=s.getTLV(t,p[d]).length,s.checkStrictDER(t,p[d],n,r,i)}if(2*h!=f)throw new Error("sum of children's TLV length and L unmatch: "+2*h+"!="+f)}},ht.oidname=function(t){var e=ut.asn1;ut.lang.String.isHex(t)&&(t=e.ASN1Util.oidHexToInt(t));var n=e.x509.OID.oid2name(t);return""===n&&(n=t),n},void 0!==ut&&ut||(ut={}),void 0!==ut.asn1&&ut.asn1||(ut.asn1={}),void 0!==ut.asn1.x509&&ut.asn1.x509||(ut.asn1.x509={}),ut.asn1.x509.Certificate=function(t){ut.asn1.x509.Certificate.superclass.constructor.call(this);var e=ut.asn1,n=e.DERBitString,r=e.DERSequence,i=e.x509,s=i.TBSCertificate,o=i.AlgorithmIdentifier;this.params=void 0,this.setByParam=function(t){this.params=t},this.sign=function(){var t=this.params,e=t.sigalg;null!=t.sigalg.name&&(e=t.sigalg.name);var n=t.tbsobj.tohex(),r=new ut.crypto.Signature({alg:e});r.init(t.cakey),r.updateHex(n),t.sighex=r.sign()},this.getPEM=function(){return It(this.tohex(),"CERTIFICATE")},this.tohex=function(){var t=this.params;if(null!=t.tbsobj&&null!=t.tbsobj||(t.tbsobj=new s(t)),null==t.sighex&&null!=t.cakey&&this.sign(),null==t.sighex)throw new Error("sighex or cakey parameter not defined");var e=[];return e.push(t.tbsobj),e.push(new o({name:t.sigalg})),e.push(new n({hex:"00"+t.sighex})),new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&(this.params=t)},Zt(ut.asn1.x509.Certificate,ut.asn1.ASN1Object),ut.asn1.x509.TBSCertificate=function(t){ut.asn1.x509.TBSCertificate.superclass.constructor.call(this);var e=ut.asn1,n=e.x509,r=e.DERTaggedObject,i=e.DERInteger,s=e.DERSequence,o=n.AlgorithmIdentifier,a=n.Time,u=n.X500Name,c=n.Extensions,l=n.SubjectPublicKeyInfo;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=[],e=this.params;if(null!=e.version||1!=e.version){var n=2;null!=e.version&&(n=e.version-1);var h=new r({obj:new i({int:n})});t.push(h)}return t.push(new i(e.serial)),t.push(new o({name:e.sigalg})),t.push(new u(e.issuer)),t.push(new s({array:[new a(e.notbefore),new a(e.notafter)]})),t.push(new u(e.subject)),t.push(new l(Qt.getKey(e.sbjpubkey))),void 0!==e.ext&&e.ext.length>0&&t.push(new r({tag:"a3",obj:new c(e.ext)})),new ut.asn1.DERSequence({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.TBSCertificate,ut.asn1.ASN1Object),ut.asn1.x509.Extensions=function(t){ut.asn1.x509.Extensions.superclass.constructor.call(this);var e=ut.asn1,n=e.DERSequence,r=e.x509;this.aParam=[],this.setByParam=function(t){this.aParam=t},this.tohex=function(){for(var t=[],e=0;e<this.aParam.length;e++){var i=this.aParam[e],s=i.extname,o=null;if(null!=i.extn)o=new r.PrivateExtension(i);else if("subjectKeyIdentifier"==s)o=new r.SubjectKeyIdentifier(i);else if("keyUsage"==s)o=new r.KeyUsage(i);else if("subjectAltName"==s)o=new r.SubjectAltName(i);else if("issuerAltName"==s)o=new r.IssuerAltName(i);else if("basicConstraints"==s)o=new r.BasicConstraints(i);else if("nameConstraints"==s)o=new r.NameConstraints(i);else if("cRLDistributionPoints"==s)o=new r.CRLDistributionPoints(i);else if("certificatePolicies"==s)o=new r.CertificatePolicies(i);else if("authorityKeyIdentifier"==s)o=new r.AuthorityKeyIdentifier(i);else if("extKeyUsage"==s)o=new r.ExtKeyUsage(i);else if("authorityInfoAccess"==s)o=new r.AuthorityInfoAccess(i);else if("cRLNumber"==s)o=new r.CRLNumber(i);else if("cRLReason"==s)o=new r.CRLReason(i);else if("ocspNonce"==s)o=new r.OCSPNonce(i);else if("ocspNoCheck"==s)o=new r.OCSPNoCheck(i);else if("adobeTimeStamp"==s)o=new r.AdobeTimeStamp(i);else{if("subjectDirectoryAttributes"!=s)throw new Error("extension not supported:"+JSON.stringify(i));o=new r.SubjectDirectoryAttributes(i)}null!=o&&t.push(o)}return new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.x509.Extensions,ut.asn1.ASN1Object),ut.asn1.x509.Extension=function(t){ut.asn1.x509.Extension.superclass.constructor.call(this);var e=ut.asn1,n=e.DERObjectIdentifier,r=e.DEROctetString,i=(e.DERBitString,e.DERBoolean),s=e.DERSequence;this.tohex=function(){var t=new n({oid:this.oid}),e=new r({hex:this.getExtnValueHex()}),o=new Array;return o.push(t),this.critical&&o.push(new i),o.push(e),new s({array:o}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.critical=!1,void 0!==t&&void 0!==t.critical&&(this.critical=t.critical)},Zt(ut.asn1.x509.Extension,ut.asn1.ASN1Object),ut.asn1.x509.KeyUsage=function(t){ut.asn1.x509.KeyUsage.superclass.constructor.call(this,t);var e=Error,n={digitalSignature:0,nonRepudiation:1,keyEncipherment:2,dataEncipherment:3,keyAgreement:4,keyCertSign:5,cRLSign:6,encipherOnly:7,decipherOnly:8};this.getExtnValueHex=function(){var t=this.getBinValue();return this.asn1ExtnValue=new ut.asn1.DERBitString({bin:t}),this.asn1ExtnValue.tohex()},this.getBinValue=function(){var t=this.params;if("object"!=typeof t||"object"!=typeof t.names&&"string"!=typeof t.bin)throw new e("parameter not yet set");if(null!=t.names)return Jt(t.names,n);if(null!=t.bin)return t.bin;throw new e("parameter not set properly")},this.oid="2.5.29.15",void 0!==t&&(this.params=t)},Zt(ut.asn1.x509.KeyUsage,ut.asn1.x509.Extension),ut.asn1.x509.BasicConstraints=function(t){ut.asn1.x509.BasicConstraints.superclass.constructor.call(this,t);var e=ut.asn1,n=e.DERBoolean,r=e.DERInteger,i=e.DERSequence;this.getExtnValueHex=function(){var t=new Array;this.cA&&t.push(new n),this.pathLen>-1&&t.push(new r({int:this.pathLen}));var e=new i({array:t});return this.asn1ExtnValue=e,this.asn1ExtnValue.tohex()},this.oid="2.5.29.19",this.cA=!1,this.pathLen=-1,void 0!==t&&(void 0!==t.cA&&(this.cA=t.cA),void 0!==t.pathLen&&(this.pathLen=t.pathLen))},Zt(ut.asn1.x509.BasicConstraints,ut.asn1.x509.Extension),ut.asn1.x509.CRLDistributionPoints=function(t){ut.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,t);var e=ut.asn1,n=e.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.setByDPArray=function(t){for(var r=[],i=0;i<t.length;i++)if(t[i]instanceof ut.asn1.ASN1Object)r.push(t[i]);else{var s=new n.DistributionPoint(t[i]);r.push(s)}this.asn1ExtnValue=new e.DERSequence({array:r})},this.setByOneURI=function(t){var e=new n.DistributionPoint({fulluri:t});this.setByDPArray([e])},this.oid="2.5.29.31",void 0!==t&&(void 0!==t.array?this.setByDPArray(t.array):void 0!==t.uri&&this.setByOneURI(t.uri))},Zt(ut.asn1.x509.CRLDistributionPoints,ut.asn1.x509.Extension),ut.asn1.x509.DistributionPoint=function(t){ut.asn1.x509.DistributionPoint.superclass.constructor.call(this);var e=ut.asn1,n=e.x509.DistributionPointName;this.tohex=function(){var t=new e.DERSequence;if(null!=this.asn1DP){var n=new e.DERTaggedObject({explicit:!0,tag:"a0",obj:this.asn1DP});t.appendASN1Object(n)}return this.hTLV=t.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(void 0!==t.dpobj?this.asn1DP=t.dpobj:void 0!==t.dpname?this.asn1DP=new n(t.dpname):void 0!==t.fulluri&&(this.asn1DP=new n({full:[{uri:t.fulluri}]})))},Zt(ut.asn1.x509.DistributionPoint,ut.asn1.ASN1Object),ut.asn1.x509.DistributionPointName=function(t){ut.asn1.x509.DistributionPointName.superclass.constructor.call(this);var e=ut.asn1,n=e.DERTaggedObject;if(this.tohex=function(){if("full"!=this.type)throw new Error("currently type shall be 'full': "+this.type);return this.asn1Obj=new n({explicit:!1,tag:this.tag,obj:this.asn1V}),this.hTLV=this.asn1Obj.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t)if(e.x509.GeneralNames.prototype.isPrototypeOf(t))this.type="full",this.tag="a0",this.asn1V=t;else{if(void 0===t.full)throw new Error("This class supports GeneralNames only as argument");this.type="full",this.tag="a0",this.asn1V=new e.x509.GeneralNames(t.full)}},Zt(ut.asn1.x509.DistributionPointName,ut.asn1.ASN1Object),ut.asn1.x509.CertificatePolicies=function(t){ut.asn1.x509.CertificatePolicies.superclass.constructor.call(this,t);var e=ut.asn1,n=e.x509,r=e.DERSequence,i=n.PolicyInformation;this.params=null,this.getExtnValueHex=function(){for(var t=[],e=0;e<this.params.array.length;e++)t.push(new i(this.params.array[e]));var n=new r({array:t});return this.asn1ExtnValue=n,this.asn1ExtnValue.tohex()},this.oid="2.5.29.32",void 0!==t&&(this.params=t)},Zt(ut.asn1.x509.CertificatePolicies,ut.asn1.x509.Extension),ut.asn1.x509.PolicyInformation=function(t){ut.asn1.x509.PolicyInformation.superclass.constructor.call(this,t);var e=ut.asn1,n=e.DERSequence,r=e.DERObjectIdentifier,i=e.x509.PolicyQualifierInfo;this.params=null,this.tohex=function(){if(void 0===this.params.policyoid&&void 0===this.params.array)throw new Error("parameter oid and array missing");var t=[new r(this.params.policyoid)];if(void 0!==this.params.array){for(var e=[],s=0;s<this.params.array.length;s++)e.push(new i(this.params.array[s]));e.length>0&&t.push(new n({array:e}))}return new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(this.params=t)},Zt(ut.asn1.x509.PolicyInformation,ut.asn1.ASN1Object),ut.asn1.x509.PolicyQualifierInfo=function(t){ut.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,t);var e=ut.asn1,n=e.DERSequence,r=e.DERIA5String,i=e.DERObjectIdentifier,s=e.x509.UserNotice;this.params=null,this.tohex=function(){return void 0!==this.params.cps?new n({array:[new i({oid:"1.3.6.1.5.5.7.2.1"}),new r({str:this.params.cps})]}).tohex():null!=this.params.unotice?new n({array:[new i({oid:"1.3.6.1.5.5.7.2.2"}),new s(this.params.unotice)]}).tohex():void 0},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(this.params=t)},Zt(ut.asn1.x509.PolicyQualifierInfo,ut.asn1.ASN1Object),ut.asn1.x509.UserNotice=function(t){ut.asn1.x509.UserNotice.superclass.constructor.call(this,t);var e=ut.asn1.DERSequence,n=(ut.asn1.DERInteger,ut.asn1.x509.DisplayText),r=ut.asn1.x509.NoticeReference;this.params=null,this.tohex=function(){var t=[];return void 0!==this.params.noticeref&&t.push(new r(this.params.noticeref)),void 0!==this.params.exptext&&t.push(new n(this.params.exptext)),new e({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(this.params=t)},Zt(ut.asn1.x509.UserNotice,ut.asn1.ASN1Object),ut.asn1.x509.NoticeReference=function(t){ut.asn1.x509.NoticeReference.superclass.constructor.call(this,t);var e=ut.asn1.DERSequence,n=ut.asn1.DERInteger,r=ut.asn1.x509.DisplayText;this.params=null,this.tohex=function(){var t=[];if(void 0!==this.params.org&&t.push(new r(this.params.org)),void 0!==this.params.noticenum){for(var i=[],s=this.params.noticenum,o=0;o<s.length;o++)i.push(new n(s[o]));t.push(new e({array:i}))}if(0==t.length)throw new Error("parameter is empty");return new e({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(this.params=t)},Zt(ut.asn1.x509.NoticeReference,ut.asn1.ASN1Object),ut.asn1.x509.DisplayText=function(t){ut.asn1.x509.DisplayText.superclass.constructor.call(this,t),this.hT="0c",void 0!==t&&("ia5"===t.type?this.hT="16":"vis"===t.type?this.hT="1a":"bmp"===t.type&&(this.hT="1e"))},Zt(ut.asn1.x509.DisplayText,ut.asn1.DERAbstractString),ut.asn1.x509.NameConstraints=function(t){ut.asn1.x509.NameConstraints.superclass.constructor.call(this,t);var e=ut.asn1,n=e.x509,r=e.ASN1Util.newObject,i=n.GeneralSubtree;this.params=null,this.getExtnValueHex=function(){var t=this.params,e=[];if(null!=t.permit&&null!=t.permit.length){for(var n=[],s=0;s<t.permit.length;s++)n.push(new i(t.permit[s]));e.push({tag:{tagi:"a0",obj:{seq:n}}})}if(null!=t.exclude&&null!=t.exclude.length){var o=[];for(s=0;s<t.exclude.length;s++)o.push(new i(t.exclude[s]));e.push({tag:{tagi:"a1",obj:{seq:o}}})}return this.asn1ExtnValue=r({seq:e}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.30",void 0!==t&&(this.params=t)},Zt(ut.asn1.x509.NameConstraints,ut.asn1.x509.Extension),ut.asn1.x509.GeneralSubtree=function(t){ut.asn1.x509.GeneralSubtree.superclass.constructor.call(this);var e=ut.asn1,n=e.x509.GeneralName,r=e.ASN1Util.newObject;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params,e=[new n(t)];return null!=t.min&&e.push({tag:{tagi:"80",obj:{int:t.min}}}),null!=t.max&&e.push({tag:{tagi:"81",obj:{int:t.max}}}),r({seq:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.GeneralSubtree,ut.asn1.ASN1Object),ut.asn1.x509.ExtKeyUsage=function(t){ut.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,t);var e=ut.asn1;this.setPurposeArray=function(t){this.asn1ExtnValue=new e.DERSequence;for(var n=0;n<t.length;n++){var r=new e.DERObjectIdentifier(t[n]);this.asn1ExtnValue.appendASN1Object(r)}},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.37",void 0!==t&&void 0!==t.array&&this.setPurposeArray(t.array)},Zt(ut.asn1.x509.ExtKeyUsage,ut.asn1.x509.Extension),ut.asn1.x509.AuthorityKeyIdentifier=function(t){ut.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this,t);var e=ut,n=e.asn1,r=n.DERTaggedObject,i=n.x509.GeneralNames;e.crypto.Util.isKey;this.asn1KID=null,this.asn1CertIssuer=null,this.asn1CertSN=null,this.getExtnValueHex=function(){var t=new Array;this.asn1KID&&t.push(new r({explicit:!1,tag:"80",obj:this.asn1KID})),this.asn1CertIssuer&&t.push(new r({explicit:!1,tag:"a1",obj:new i([{dn:this.asn1CertIssuer}])})),this.asn1CertSN&&t.push(new r({explicit:!1,tag:"82",obj:this.asn1CertSN}));var e=new n.DERSequence({array:t});return this.asn1ExtnValue=e,this.asn1ExtnValue.tohex()},this.setKIDByParam=function(t){if(void 0!==t.str||void 0!==t.hex)this.asn1KID=new ut.asn1.DEROctetString(t);else if("object"==typeof t&&ut.crypto.Util.isKey(t)||"string"==typeof t&&-1!=t.indexOf("BEGIN ")){var e=t;"string"==typeof t&&(e=Qt.getKey(t));var n=Qt.getKeyID(e);this.asn1KID=new ut.asn1.DEROctetString({hex:n})}},this.setCertIssuerByParam=function(t){void 0!==t.str||void 0!==t.ldapstr||void 0!==t.hex||void 0!==t.certsubject||void 0!==t.certissuer?this.asn1CertIssuer=new ut.asn1.x509.X500Name(t):"string"==typeof t&&-1!=t.indexOf("BEGIN ")&&-1!=t.indexOf("CERTIFICATE")&&(this.asn1CertIssuer=new ut.asn1.x509.X500Name({certissuer:t}))},this.setCertSNByParam=function(t){if(void 0!==t.str||void 0!==t.bigint||void 0!==t.hex)this.asn1CertSN=new ut.asn1.DERInteger(t);else if("string"==typeof t&&-1!=t.indexOf("BEGIN ")&&t.indexOf("CERTIFICATE")){var e=new re;e.readCertPEM(t);var n=e.getSerialNumberHex();this.asn1CertSN=new ut.asn1.DERInteger({hex:n})}},this.oid="2.5.29.35",void 0!==t&&(void 0!==t.kid&&this.setKIDByParam(t.kid),void 0!==t.issuer&&this.setCertIssuerByParam(t.issuer),void 0!==t.sn&&this.setCertSNByParam(t.sn),void 0!==t.issuersn&&"string"==typeof t.issuersn&&-1!=t.issuersn.indexOf("BEGIN ")&&t.issuersn.indexOf("CERTIFICATE")&&(this.setCertSNByParam(t.issuersn),this.setCertIssuerByParam(t.issuersn)))},Zt(ut.asn1.x509.AuthorityKeyIdentifier,ut.asn1.x509.Extension),ut.asn1.x509.SubjectKeyIdentifier=function(t){ut.asn1.x509.SubjectKeyIdentifier.superclass.constructor.call(this,t);var e=ut.asn1.DEROctetString;this.asn1KID=null,this.getExtnValueHex=function(){return this.asn1ExtnValue=this.asn1KID,this.asn1ExtnValue.tohex()},this.setKIDByParam=function(t){if(void 0!==t.str||void 0!==t.hex)this.asn1KID=new e(t);else if("object"==typeof t&&ut.crypto.Util.isKey(t)||"string"==typeof t&&-1!=t.indexOf("BEGIN")){var n=t;"string"==typeof t&&(n=Qt.getKey(t));var r=Qt.getKeyID(n);this.asn1KID=new ut.asn1.DEROctetString({hex:r})}},this.oid="2.5.29.14",void 0!==t&&void 0!==t.kid&&this.setKIDByParam(t.kid)},Zt(ut.asn1.x509.SubjectKeyIdentifier,ut.asn1.x509.Extension),ut.asn1.x509.AuthorityInfoAccess=function(t){ut.asn1.x509.AuthorityInfoAccess.superclass.constructor.call(this,t),this.setAccessDescriptionArray=function(t){for(var e=new Array,n=ut.asn1,r=n.DERSequence,i=n.DERObjectIdentifier,s=n.x509.GeneralName,o=0;o<t.length;o++){var a,u=t[o];if(void 0!==u.ocsp)a=new r({array:[new i({oid:"1.3.6.1.5.5.7.48.1"}),new s({uri:u.ocsp})]});else{if(void 0===u.caissuer)throw new Error("unknown AccessMethod parameter: "+JSON.stringify(u));a=new r({array:[new i({oid:"1.3.6.1.5.5.7.48.2"}),new s({uri:u.caissuer})]})}e.push(a)}this.asn1ExtnValue=new r({array:e})},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.1.1",void 0!==t&&void 0!==t.array&&this.setAccessDescriptionArray(t.array)},Zt(ut.asn1.x509.AuthorityInfoAccess,ut.asn1.x509.Extension),ut.asn1.x509.SubjectAltName=function(t){ut.asn1.x509.SubjectAltName.superclass.constructor.call(this,t),this.setNameArray=function(t){this.asn1ExtnValue=new ut.asn1.x509.GeneralNames(t)},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.17",void 0!==t&&void 0!==t.array&&this.setNameArray(t.array)},Zt(ut.asn1.x509.SubjectAltName,ut.asn1.x509.Extension),ut.asn1.x509.IssuerAltName=function(t){ut.asn1.x509.IssuerAltName.superclass.constructor.call(this,t),this.setNameArray=function(t){this.asn1ExtnValue=new ut.asn1.x509.GeneralNames(t)},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.18",void 0!==t&&void 0!==t.array&&this.setNameArray(t.array)},Zt(ut.asn1.x509.IssuerAltName,ut.asn1.x509.Extension),ut.asn1.x509.SubjectDirectoryAttributes=function(t){ut.asn1.x509.SubjectDirectoryAttributes.superclass.constructor.call(this,t);var e=ut.asn1,n=e.DERSequence,r=e.ASN1Util.newObject,i=e.x509.OID.name2oid;this.params=null,this.getExtnValueHex=function(){for(var t=[],e=0;e<this.params.array.length;e++){var s=this.params.array[e],o={seq:[{oid:"1.2.3.4"},{set:[{utf8str:"DE"}]}]};if("dateOfBirth"==s.attr)o.seq[0].oid=i(s.attr),o.seq[1].set[0]={gentime:s.str};else if("placeOfBirth"==s.attr)o.seq[0].oid=i(s.attr),o.seq[1].set[0]={utf8str:s.str};else if("gender"==s.attr)o.seq[0].oid=i(s.attr),o.seq[1].set[0]={prnstr:s.str};else if("countryOfCitizenship"==s.attr)o.seq[0].oid=i(s.attr),o.seq[1].set[0]={prnstr:s.str};else{if("countryOfResidence"!=s.attr)throw new Error("unsupported attribute: "+s.attr);o.seq[0].oid=i(s.attr),o.seq[1].set[0]={prnstr:s.str}}t.push(new r(o))}var a=new n({array:t});return this.asn1ExtnValue=a,this.asn1ExtnValue.tohex()},this.oid="2.5.29.9",void 0!==t&&(this.params=t)},Zt(ut.asn1.x509.SubjectDirectoryAttributes,ut.asn1.x509.Extension),ut.asn1.x509.PrivateExtension=function(t){ut.asn1.x509.PrivateExtension.superclass.constructor.call(this,t);var e=ut,n=e.lang.String.isHex,r=e.asn1,i=r.x509.OID.name2oid,s=r.ASN1Util.newObject;this.params=null,this.setByParam=function(t){this.oid=i(t.extname),this.params=t},this.getExtnValueHex=function(){if(null==this.params.extname||null==this.params.extn)throw new Error("extname or extnhex not specified");var t=this.params.extn;if("string"==typeof t&&n(t))return t;if("object"==typeof t)try{return s(t).tohex()}catch(t){}throw new Error("unsupported extn value")},null!=t&&this.setByParam(t)},Zt(ut.asn1.x509.PrivateExtension,ut.asn1.x509.Extension),ut.asn1.x509.CRL=function(t){ut.asn1.x509.CRL.superclass.constructor.call(this);var e=ut.asn1,n=e.DERSequence,r=e.DERBitString,i=e.x509,s=i.AlgorithmIdentifier,o=i.TBSCertList;this.params=void 0,this.setByParam=function(t){this.params=t},this.sign=function(){var t=new o(this.params).tohex(),e=new ut.crypto.Signature({alg:this.params.sigalg});e.init(this.params.cakey),e.updateHex(t);var n=e.sign();this.params.sighex=n},this.getPEM=function(){return It(this.tohex(),"X509 CRL")},this.tohex=function(){var t=this.params;if(null==t.tbsobj&&(t.tbsobj=new o(t)),null==t.sighex&&null!=t.cakey&&this.sign(),null==t.sighex)throw new Error("sighex or cakey parameter not defined");var e=[];return e.push(t.tbsobj),e.push(new s({name:t.sigalg})),e.push(new r({hex:"00"+t.sighex})),new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&(this.params=t)},Zt(ut.asn1.x509.CRL,ut.asn1.ASN1Object),ut.asn1.x509.TBSCertList=function(t){ut.asn1.x509.TBSCertList.superclass.constructor.call(this);var e=ut.asn1,n=e.DERInteger,r=e.DERSequence,i=e.DERTaggedObject,s=(e.DERObjectIdentifier,e.x509),o=s.AlgorithmIdentifier,a=s.Time,u=s.Extensions,c=s.X500Name;this.params=null,this.setByParam=function(t){this.params=t},this.getRevCertSequence=function(){for(var t=[],e=this.params.revcert,i=0;i<e.length;i++){var s=[new n(e[i].sn),new a(e[i].date)];null!=e[i].ext&&s.push(new u(e[i].ext)),t.push(new r({array:s}))}return new r({array:t})},this.tohex=function(){var t=[],e=this.params;if(null!=e.version){var s=e.version-1,l=new n({int:s});t.push(l)}if(t.push(new o({name:e.sigalg})),t.push(new c(e.issuer)),t.push(new a(e.thisupdate)),null!=e.nextupdate&&t.push(new a(e.nextupdate)),null!=e.revcert&&t.push(this.getRevCertSequence()),null!=e.ext){var h=new u(e.ext);t.push(new i({tag:"a0",explicit:!0,obj:h}))}return new r({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.TBSCertList,ut.asn1.ASN1Object),ut.asn1.x509.CRLEntry=function(t){ut.asn1.x509.CRLEntry.superclass.constructor.call(this);var e=ut.asn1;this.setCertSerial=function(t){this.sn=new e.DERInteger(t)},this.setRevocationDate=function(t){this.time=new e.x509.Time(t)},this.tohex=function(){var t=new e.DERSequence({array:[this.sn,this.time]});return this.TLV=t.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(void 0!==t.time&&this.setRevocationDate(t.time),void 0!==t.sn&&this.setCertSerial(t.sn))},Zt(ut.asn1.x509.CRLEntry,ut.asn1.ASN1Object),ut.asn1.x509.CRLNumber=function(t){ut.asn1.x509.CRLNumber.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new ut.asn1.DERInteger(this.params.num),this.asn1ExtnValue.tohex()},this.oid="2.5.29.20",null!=t&&(this.params=t)},Zt(ut.asn1.x509.CRLNumber,ut.asn1.x509.Extension),ut.asn1.x509.CRLReason=function(t){ut.asn1.x509.CRLReason.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new ut.asn1.DEREnumerated(this.params.code),this.asn1ExtnValue.tohex()},this.oid="2.5.29.21",null!=t&&(this.params=t)},Zt(ut.asn1.x509.CRLReason,ut.asn1.x509.Extension),ut.asn1.x509.OCSPNonce=function(t){ut.asn1.x509.OCSPNonce.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new ut.asn1.DEROctetString(this.params),this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.2",null!=t&&(this.params=t)},Zt(ut.asn1.x509.OCSPNonce,ut.asn1.x509.Extension),ut.asn1.x509.OCSPNoCheck=function(t){ut.asn1.x509.OCSPNoCheck.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new ut.asn1.DERNull,this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.5",null!=t&&(this.params=t)},Zt(ut.asn1.x509.OCSPNoCheck,ut.asn1.x509.Extension),ut.asn1.x509.AdobeTimeStamp=function(t){ut.asn1.x509.AdobeTimeStamp.superclass.constructor.call(this,t);var e=ut.asn1,n=e.DERInteger,r=e.DERBoolean,i=e.DERSequence,s=e.x509.GeneralName;this.params=null,this.getExtnValueHex=function(){var t=this.params,e=[new n(1)];return e.push(new s({uri:t.uri})),null!=t.reqauth&&e.push(new r(t.reqauth)),this.asn1ExtnValue=new i({array:e}),this.asn1ExtnValue.tohex()},this.oid="1.2.840.113583.1.1.9.1",void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.AdobeTimeStamp,ut.asn1.x509.Extension),ut.asn1.x509.X500Name=function(t){ut.asn1.x509.X500Name.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var e=ut.asn1,n=e.x509,r=n.RDN;this.setByString=function(t,e){void 0!==e&&(this.sRule=e);var n=t.split("/");n.shift();for(var i=[],s=0;s<n.length;s++)if(n[s].match(/^[^=]+=.+$/))i.push(n[s]);else{var o=i.length-1;i[o]=i[o]+"/"+n[s]}for(s=0;s<i.length;s++)this.asn1Array.push(new r({str:i[s],rule:this.sRule}))},this.setByLdapString=function(t,e){void 0!==e&&(this.sRule=e);var r=n.X500Name.ldapToCompat(t);this.setByString(r,e)},this.setByObject=function(t,e){for(var n in void 0!==e&&(this.sRule=e),t)if(t.hasOwnProperty(n)){var i=new r({str:n+"="+t[n],rule:this.sRule});this.asn1Array?this.asn1Array.push(i):this.asn1Array=[i]}},this.setByParam=function(t){var e;(void 0!==t.rule&&(this.sRule=t.rule),void 0!==t.array)?this.paramArray=t.array:void 0!==t.str?this.setByString(t.str):void 0!==t.ldapstr?this.setByLdapString(t.ldapstr):void 0!==t.hex?this.hTLV=t.hex:void 0!==t.certissuer?((e=new re).readCertPEM(t.certissuer),this.hTLV=e.getIssuerHex()):void 0!==t.certsubject?((e=new re).readCertPEM(t.certsubject),this.hTLV=e.getSubjectHex()):"object"==typeof t&&void 0===t.certsubject&&void 0===t.certissuer&&this.setByObject(t)},this.tohex=function(){if("string"==typeof this.hTLV)return this.hTLV;if(0==this.asn1Array.length&&this.paramArray.length>0)for(var t=0;t<this.paramArray.length;t++){var n={array:this.paramArray[t]};"utf8"!=this.sRule&&(n.rule=this.sRule);var i=new r(n);this.asn1Array.push(i)}var s=new e.DERSequence({array:this.asn1Array});return this.hTLV=s.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.X500Name,ut.asn1.ASN1Object),ut.asn1.x509.X500Name.compatToLDAP=function(t){if("/"!==t.substr(0,1))throw"malformed input";var e=(t=t.substr(1)).split("/");return e.reverse(),(e=e.map((function(t){return t.replace(/,/,"\\,")}))).join(",")},ut.asn1.x509.X500Name.onelineToLDAP=function(t){return ut.asn1.x509.X500Name.compatToLDAP(t)},ut.asn1.x509.X500Name.ldapToCompat=function(t){for(var e=t.split(","),n=!1,r=[],i=0;e.length>0;i++){var s=e.shift();if(!0===n){var o=(r.pop()+","+s).replace(/\\,/g,",");r.push(o),n=!1}else r.push(s);"\\"===s.substr(-1,1)&&(n=!0)}return(r=r.map((function(t){return t.replace("/","\\/")}))).reverse(),"/"+r.join("/")},ut.asn1.x509.X500Name.ldapToOneline=function(t){return ut.asn1.x509.X500Name.ldapToCompat(t)},ut.asn1.x509.RDN=function(t){ut.asn1.x509.RDN.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var e=ut.asn1.x509.AttributeTypeAndValue;this.setByParam=function(t){void 0!==t.rule&&(this.sRule=t.rule),void 0!==t.str&&this.addByMultiValuedString(t.str),void 0!==t.array&&(this.paramArray=t.array)},this.addByString=function(t){this.asn1Array.push(new ut.asn1.x509.AttributeTypeAndValue({str:t,rule:this.sRule}))},this.addByMultiValuedString=function(t){for(var e=ut.asn1.x509.RDN.parseString(t),n=0;n<e.length;n++)this.addByString(e[n])},this.tohex=function(){if(0==this.asn1Array.length&&this.paramArray.length>0)for(var t=0;t<this.paramArray.length;t++){var n=this.paramArray[t];void 0!==n.rule&&"utf8"!=this.sRule&&(n.rule=this.sRule);var r=new e(n);this.asn1Array.push(r)}var i=new ut.asn1.DERSet({array:this.asn1Array});return this.TLV=i.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.RDN,ut.asn1.ASN1Object),ut.asn1.x509.RDN.parseString=function(t){for(var e=t.split(/\+/),n=!1,r=[],i=0;e.length>0;i++){var s=e.shift();if(!0===n){var o=(r.pop()+"+"+s).replace(/\\\+/g,"+");r.push(o),n=!1}else r.push(s);"\\"===s.substr(-1,1)&&(n=!0)}var a=!1,u=[];for(i=0;r.length>0;i++){s=r.shift();if(!0===a){var c=u.pop();if(s.match(/"$/)){o=(c+"+"+s).replace(/^([^=]+)="(.*)"$/,"$1=$2");u.push(o),a=!1}else u.push(c+"+"+s)}else u.push(s);s.match(/^[^=]+="/)&&(a=!0)}return u},ut.asn1.x509.AttributeTypeAndValue=function(t){ut.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this),this.sRule="utf8",this.sType=null,this.sValue=null,this.dsType=null;var e=ut,n=e.asn1,r=n.DERSequence,i=n.DERUTF8String,s=n.DERPrintableString,o=n.DERTeletexString,a=n.DERIA5String,u=n.DERVisibleString,c=n.DERBMPString,l=e.lang.String.isMail,h=e.lang.String.isPrintable;this.setByParam=function(t){if(void 0!==t.rule&&(this.sRule=t.rule),void 0!==t.ds&&(this.dsType=t.ds),void 0===t.value&&void 0!==t.str){var e=t.str.match(/^([^=]+)=(.+)$/);if(!e)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.sType=e[1],this.sValue=e[2]}else this.sType=t.type,this.sValue=t.value},this.setByString=function(t,e){void 0!==e&&(this.sRule=e);var n=t.match(/^([^=]+)=(.+)$/);if(!n)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.setByAttrTypeAndValueStr(n[1],n[2])},this._getDsType=function(){var t=this.sType,e=this.sValue,n=this.sRule;return"prn"===n?"CN"==t&&l(e)?"ia5":h(e)?"prn":"utf8":"utf8"===n?"CN"==t&&l(e)?"ia5":"C"==t?"prn":"utf8":"utf8"},this.setByAttrTypeAndValueStr=function(t,e,n){void 0!==n&&(this.sRule=n),this.sType=t,this.sValue=e},this.getValueObj=function(t,e){if("utf8"==t)return new i({str:e});if("prn"==t)return new s({str:e});if("tel"==t)return new o({str:e});if("ia5"==t)return new a({str:e});if("vis"==t)return new u({str:e});if("bmp"==t)return new c({str:e});throw new Error("unsupported directory string type: type="+t+" value="+e)},this.tohex=function(){null==this.dsType&&(this.dsType=this._getDsType());var t=ut.asn1.x509.OID.atype2obj(this.sType),e=this.getValueObj(this.dsType,this.sValue),n=new r({array:[t,e]});return this.TLV=n.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.AttributeTypeAndValue,ut.asn1.ASN1Object),ut.asn1.x509.SubjectPublicKeyInfo=function(t){ut.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var e=ut,n=e.asn1,r=n.DERInteger,i=n.DERBitString,s=n.DERObjectIdentifier,o=n.DERSequence,a=n.ASN1Util.newObject,u=n.x509.AlgorithmIdentifier,c=e.crypto;c.ECDSA,c.DSA;this.getASN1Object=function(){if(null==this.asn1AlgId||null==this.asn1SubjPKey)throw"algId and/or subjPubKey not set";return new o({array:[this.asn1AlgId,this.asn1SubjPKey]})},this.tohex=function(){var t=this.getASN1Object();return this.hTLV=t.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.setPubKey=function(t){try{if(t instanceof nt){var e=a({seq:[{int:{bigint:t.n}},{int:{int:t.e}}]}).tohex();this.asn1AlgId=new u({name:"rsaEncryption"}),this.asn1SubjPKey=new i({hex:"00"+e})}}catch(t){}try{if(t instanceof ut.crypto.ECDSA){var n=new s({name:t.curveName});this.asn1AlgId=new u({name:"ecPublicKey",asn1params:n}),this.asn1SubjPKey=new i({hex:"00"+t.pubKeyHex})}}catch(t){}try{if(t instanceof ut.crypto.DSA){n=new a({seq:[{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}}]});this.asn1AlgId=new u({name:"dsa",asn1params:n});var o=new r({bigint:t.y});this.asn1SubjPKey=new i({hex:"00"+o.tohex()})}}catch(t){}},void 0!==t&&this.setPubKey(t)},Zt(ut.asn1.x509.SubjectPublicKeyInfo,ut.asn1.ASN1Object),ut.asn1.x509.Time=function(t){ut.asn1.x509.Time.superclass.constructor.call(this);var e=ut.asn1,n=e.DERUTCTime,r=e.DERGeneralizedTime;this.params=null,this.type=null,this.setTimeParams=function(t){this.timeParams=t},this.setByParam=function(t){this.params=t},this.getType=function(t){return t.match(/^[0-9]{12}Z$/)?"utc":t.match(/^[0-9]{14}Z$/)?"gen":t.match(/^[0-9]{12}\.[0-9]+Z$/)?"utc":t.match(/^[0-9]{14}\.[0-9]+Z$/)?"gen":null},this.tohex=function(){var t=this.params,e=null;if("string"==typeof t&&(t={str:t}),null==t||!t.str||null!=t.type&&null!=t.type||(t.type=this.getType(t.str)),null!=t&&t.str?("utc"==t.type&&(e=new n(t.str)),"gen"==t.type&&(e=new r(t.str))):e="gen"==this.type?new r:new n,null==e)throw new Error("wrong setting for Time");return this.TLV=e.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ut.asn1.x509.Time_bak=function(t){ut.asn1.x509.Time_bak.superclass.constructor.call(this);var e=ut.asn1,n=e.DERUTCTime,r=e.DERGeneralizedTime;this.setTimeParams=function(t){this.timeParams=t},this.tohex=function(){var t=null;return t=null!=this.timeParams?"utc"==this.type?new n(this.timeParams):new r(this.timeParams):"utc"==this.type?new n:new r,this.TLV=t.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},this.type="utc",void 0!==t&&(void 0!==t.type?this.type=t.type:void 0!==t.str&&(t.str.match(/^[0-9]{12}Z$/)&&(this.type="utc"),t.str.match(/^[0-9]{14}Z$/)&&(this.type="gen")),this.timeParams=t)},Zt(ut.asn1.x509.Time,ut.asn1.ASN1Object),ut.asn1.x509.AlgorithmIdentifier=function(t){ut.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this),this.nameAlg=null,this.asn1Alg=null,this.asn1Params=null,this.paramEmpty=!1;var e=ut.asn1,n=e.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;if(this.tohex=function(){if(null===this.nameAlg&&null===this.asn1Alg)throw new Error("algorithm not specified");if(null!==this.nameAlg){var t=null;for(var r in n)r===this.nameAlg&&(t=n[r]);if(null!==t)return this.hTLV=t,this.hTLV}null!==this.nameAlg&&null===this.asn1Alg&&(this.asn1Alg=e.x509.OID.name2obj(this.nameAlg));var i=[this.asn1Alg];null!==this.asn1Params&&i.push(this.asn1Params);var s=new e.DERSequence({array:i});return this.hTLV=s.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(void 0!==t.name&&(this.nameAlg=t.name),void 0!==t.asn1params&&(this.asn1Params=t.asn1params),void 0!==t.paramempty&&(this.paramEmpty=t.paramempty)),null===this.asn1Params&&!1===this.paramEmpty&&null!==this.nameAlg){void 0!==this.nameAlg.name&&(this.nameAlg=this.nameAlg.name);var r=this.nameAlg.toLowerCase();"withdsa"!==r.substr(-7,7)&&"withecdsa"!==r.substr(-9,9)&&(this.asn1Params=new e.DERNull)}},Zt(ut.asn1.x509.AlgorithmIdentifier,ut.asn1.ASN1Object),ut.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"},ut.asn1.x509.GeneralName=function(t){ut.asn1.x509.GeneralName.superclass.constructor.call(this);var e=ut.asn1,n=e.x509,r=n.X500Name,i=n.OtherName,s=e.DERIA5String,o=(e.DERPrintableString,e.DEROctetString),a=e.DERTaggedObject,u=e.ASN1Object,c=Error;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t,e,n=this.params,l=!1;if(void 0!==n.other)t="a0",e=new i(n.other);else if(void 0!==n.rfc822)t="81",e=new s({str:n.rfc822});else if(void 0!==n.dns)t="82",e=new s({str:n.dns});else if(void 0!==n.dn)t="a4",l=!0,e="string"==typeof n.dn?new r({str:n.dn}):n.dn instanceof ut.asn1.x509.X500Name?n.dn:new r(n.dn);else if(void 0!==n.ldapdn)t="a4",l=!0,e=new r({ldapstr:n.ldapdn});else if(void 0!==n.certissuer||void 0!==n.certsubj){var h,f;t="a4",l=!0;var p=null;if(void 0!==n.certsubj?(h=!1,f=n.certsubj):(h=!0,f=n.certissuer),f.match(/^[0-9A-Fa-f]+$/),-1!=f.indexOf("-----BEGIN ")&&(p=$t(f)),null==p)throw new Error("certsubj/certissuer not cert");var d,g=new re;g.hex=p,d=h?g.getIssuerHex():g.getSubjectHex(),(e=new u).hTLV=d}else if(void 0!==n.uri)t="86",e=new s({str:n.uri});else{if(void 0===n.ip)throw new c("improper params");var m;t="87";var v=n.ip;try{if(v.match(/^[0-9a-f]+$/)){var y=v.length;if(8!=y&&16!=y&&32!=y&&64!=y)throw"err";m=v}else m=Nt(v)}catch(t){throw new c("malformed IP address: "+n.ip+":"+t.message)}e=new o({hex:m})}return new a({tag:t,explicit:l,obj:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.GeneralName,ut.asn1.ASN1Object),ut.asn1.x509.GeneralNames=function(t){ut.asn1.x509.GeneralNames.superclass.constructor.call(this);var e=ut.asn1;this.setByParamArray=function(t){for(var n=0;n<t.length;n++){var r=new e.x509.GeneralName(t[n]);this.asn1Array.push(r)}},this.tohex=function(){return new e.DERSequence({array:this.asn1Array}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.asn1Array=new Array,void 0!==t&&this.setByParamArray(t)},Zt(ut.asn1.x509.GeneralNames,ut.asn1.ASN1Object),ut.asn1.x509.OtherName=function(t){ut.asn1.x509.OtherName.superclass.constructor.call(this);var e=ut.asn1,n=e.DERObjectIdentifier,r=e.DERSequence,i=e.ASN1Util.newObject;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params;if(null==t.oid||null==t.value)throw new Error("oid or value not specified");var e=new n({oid:t.oid}),s=i({tag:{tag:"a0",explicit:!0,obj:t.value}});return new r({array:[e,s]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.OtherName,ut.asn1.ASN1Object),ut.asn1.x509.OID=new function(){var t=ut.asn1.DERObjectIdentifier;this.name2oidList={sha1:"1.3.14.3.2.26",sha256:"2.16.840.1.101.3.4.2.1",sha384:"2.16.840.1.101.3.4.2.2",sha512:"2.16.840.1.101.3.4.2.3",sha224:"2.16.840.1.101.3.4.2.4",md5:"1.2.840.113549.2.5",md2:"1.3.14.7.2.2.1",ripemd160:"1.3.36.3.2.1",MD2withRSA:"1.2.840.113549.1.1.2",MD4withRSA:"1.2.840.113549.1.1.3",MD5withRSA:"1.2.840.113549.1.1.4",SHA1withRSA:"1.2.840.113549.1.1.5","pkcs1-MGF":"1.2.840.113549.1.1.8",rsaPSS:"1.2.840.113549.1.1.10",SHA224withRSA:"1.2.840.113549.1.1.14",SHA256withRSA:"1.2.840.113549.1.1.11",SHA384withRSA:"1.2.840.113549.1.1.12",SHA512withRSA:"1.2.840.113549.1.1.13",SHA1withECDSA:"1.2.840.10045.4.1",SHA224withECDSA:"1.2.840.10045.4.3.1",SHA256withECDSA:"1.2.840.10045.4.3.2",SHA384withECDSA:"1.2.840.10045.4.3.3",SHA512withECDSA:"1.2.840.10045.4.3.4",dsa:"1.2.840.10040.4.1",SHA1withDSA:"1.2.840.10040.4.3",SHA224withDSA:"2.16.840.1.101.3.4.3.1",SHA256withDSA:"2.16.840.1.101.3.4.3.2",rsaEncryption:"1.2.840.113549.1.1.1",commonName:"2.5.4.3",countryName:"2.5.4.6",localityName:"2.5.4.7",stateOrProvinceName:"2.5.4.8",streetAddress:"2.5.4.9",organizationName:"2.5.4.10",organizationalUnitName:"2.5.4.11",domainComponent:"0.9.2342.19200300.100.1.25",userId:"0.9.2342.19200300.100.1.1",surname:"2.5.4.4",givenName:"2.5.4.42",title:"2.5.4.12",distinguishedName:"2.5.4.49",emailAddress:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3",subjectDirectoryAttributes:"2.5.29.9",subjectKeyIdentifier:"2.5.29.14",keyUsage:"2.5.29.15",subjectAltName:"2.5.29.17",issuerAltName:"2.5.29.18",basicConstraints:"2.5.29.19",cRLNumber:"2.5.29.20",cRLReason:"2.5.29.21",nameConstraints:"2.5.29.30",cRLDistributionPoints:"2.5.29.31",certificatePolicies:"2.5.29.32",anyPolicy:"2.5.29.32.0",authorityKeyIdentifier:"2.5.29.35",policyConstraints:"2.5.29.36",extKeyUsage:"2.5.29.37",authorityInfoAccess:"1.3.6.1.5.5.7.1.1",ocsp:"1.3.6.1.5.5.7.48.1",ocspBasic:"1.3.6.1.5.5.7.48.1.1",ocspNonce:"1.3.6.1.5.5.7.48.1.2",ocspNoCheck:"1.3.6.1.5.5.7.48.1.5",caIssuers:"1.3.6.1.5.5.7.48.2",anyExtendedKeyUsage:"2.5.29.37.0",serverAuth:"1.3.6.1.5.5.7.3.1",clientAuth:"1.3.6.1.5.5.7.3.2",codeSigning:"1.3.6.1.5.5.7.3.3",emailProtection:"1.3.6.1.5.5.7.3.4",timeStamping:"1.3.6.1.5.5.7.3.8",ocspSigning:"1.3.6.1.5.5.7.3.9",dateOfBirth:"1.3.6.1.5.5.7.9.1",placeOfBirth:"1.3.6.1.5.5.7.9.2",gender:"1.3.6.1.5.5.7.9.3",countryOfCitizenship:"1.3.6.1.5.5.7.9.4",countryOfResidence:"1.3.6.1.5.5.7.9.5",ecPublicKey:"1.2.840.10045.2.1","P-256":"1.2.840.10045.3.1.7",secp256r1:"1.2.840.10045.3.1.7",secp256k1:"1.3.132.0.10",secp384r1:"1.3.132.0.34",secp521r1:"1.3.132.0.35",pkcs5PBES2:"1.2.840.113549.1.5.13",pkcs5PBKDF2:"1.2.840.113549.1.5.12","des-EDE3-CBC":"1.2.840.113549.3.7",data:"1.2.840.113549.1.7.1","signed-data":"1.2.840.113549.1.7.2","enveloped-data":"1.2.840.113549.1.7.3","digested-data":"1.2.840.113549.1.7.5","encrypted-data":"1.2.840.113549.1.7.6","authenticated-data":"1.2.840.113549.1.9.16.1.2",tstinfo:"1.2.840.113549.1.9.16.1.4",signingCertificate:"1.2.840.113549.1.9.16.2.12",timeStampToken:"1.2.840.113549.1.9.16.2.14",signaturePolicyIdentifier:"1.2.840.113549.1.9.16.2.15",etsArchiveTimeStamp:"1.2.840.113549.1.9.16.2.27",signingCertificateV2:"1.2.840.113549.1.9.16.2.47",etsArchiveTimeStampV2:"1.2.840.113549.1.9.16.2.48",extensionRequest:"1.2.840.113549.1.9.14",contentType:"1.2.840.113549.1.9.3",messageDigest:"1.2.840.113549.1.9.4",signingTime:"1.2.840.113549.1.9.5",counterSignature:"1.2.840.113549.1.9.6",archiveTimeStampV3:"0.4.0.1733.2.4",pdfRevocationInfoArchival:"1.2.840.113583.1.1.8",adobeTimeStamp:"1.2.840.113583.1.1.9.1"},this.atype2oidList={CN:"2.5.4.3",L:"2.5.4.7",ST:"2.5.4.8",O:"2.5.4.10",OU:"2.5.4.11",C:"2.5.4.6",STREET:"2.5.4.9",DC:"0.9.2342.19200300.100.1.25",UID:"0.9.2342.19200300.100.1.1",SN:"2.5.4.4",T:"2.5.4.12",DN:"2.5.4.49",E:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",serialNumber:"2.5.4.5",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3"},this.objCache={},this.name2obj=function(e){if(void 0!==this.objCache[e])return this.objCache[e];if(void 0===this.name2oidList[e])throw"Name of ObjectIdentifier not defined: "+e;var n=this.name2oidList[e],r=new t({oid:n});return this.objCache[e]=r,r},this.atype2obj=function(e){if(void 0!==this.objCache[e])return this.objCache[e];var n;if(e.match(/^\d+\.\d+\.[0-9.]+$/))n=e;else if(void 0!==this.atype2oidList[e])n=this.atype2oidList[e];else{if(void 0===this.name2oidList[e])throw new Error("AttributeType name undefined: "+e);n=this.name2oidList[e]}var r=new t({oid:n});return this.objCache[e]=r,r},this.registerOIDs=function(t){if(this.checkOIDs(t))for(var e in t)this.name2oidList[e]=t[e]},this.checkOIDs=function(t){try{var e=Object.keys(t);return 0!=e.length&&(e.map((function(t,e,n){if(!this[t].match(/^[0-2]\.[0-9.]+$/))throw new Error("value is not OID")}),t),!0)}catch(t){return!1}}},ut.asn1.x509.OID.oid2name=function(t){var e=ut.asn1.x509.OID.name2oidList;for(var n in e)if(e[n]==t)return n;return""},ut.asn1.x509.OID.oid2atype=function(t){var e=ut.asn1.x509.OID.atype2oidList;for(var n in e)if(e[n]==t)return n;return t},ut.asn1.x509.OID.name2oid=function(t){if(t.match(/^[0-9.]+$/))return t;var e=ut.asn1.x509.OID.name2oidList;return void 0===e[t]?"":e[t]},ut.asn1.x509.X509Util={},ut.asn1.x509.X509Util.newCertPEM=function(t){var e=ut.asn1.x509;e.TBSCertificate;return new(0,e.Certificate)(t).getPEM()},void 0!==ut&&ut||(ut={}),void 0!==ut.asn1&&ut.asn1||(ut.asn1={}),void 0!==ut.asn1.cms&&ut.asn1.cms||(ut.asn1.cms={}),ut.asn1.cms.Attribute=function(t){var e=Error,n=ut.asn1,r=n.DERSequence,i=n.DERSet,s=n.DERObjectIdentifier;this.params=null,this.typeOid=null,this.setByParam=function(t){this.params=t},this.getValueArray=function(){throw new e("not yet implemented abstract")},this.tohex=function(){var t=new s({oid:this.typeOid}),e=new i({array:this.getValueArray()});return new r({array:[t,e]}).tohex()},this.getEncodedHex=function(){return this.tohex()}},Zt(ut.asn1.cms.Attribute,ut.asn1.ASN1Object),ut.asn1.cms.ContentType=function(t){var e=ut.asn1;e.cms.ContentType.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.3",this.getValueArray=function(){return[new e.DERObjectIdentifier(this.params.type)]},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.ContentType,ut.asn1.cms.Attribute),ut.asn1.cms.MessageDigest=function(t){var e=ut.asn1,n=e.DEROctetString;e.cms.MessageDigest.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.4",this.getValueArray=function(){return[new n(this.params)]},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.MessageDigest,ut.asn1.cms.Attribute),ut.asn1.cms.SigningTime=function(t){var e=ut.asn1;e.cms.SigningTime.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.5",this.getValueArray=function(){return[new e.x509.Time(this.params)]},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.SigningTime,ut.asn1.cms.Attribute),ut.asn1.cms.SigningCertificate=function(t){var e=Error,n=ut,r=n.asn1,i=r.DERSequence,s=r.cms,o=s.ESSCertID;n.crypto;s.SigningCertificate.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.12",this.getValueArray=function(){if(null==this.params||null==this.params||null==this.params.array)throw new e("parameter 'array' not specified");for(var n=this.params.array,r=[],s=0;s<n.length;s++){var a=n[s];0!=t.hasis||"string"!=typeof a||-1==a.indexOf("-----BEGIN")&&!ht.isASN1HEX(a)||(a={cert:a}),0!=a.hasis&&0==t.hasis&&(a.hasis=!1),r.push(new o(a))}var u=new i({array:r});return[new i({array:[u]})]},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.SigningCertificate,ut.asn1.cms.Attribute),ut.asn1.cms.ESSCertID=function(t){ut.asn1.cms.ESSCertID.superclass.constructor.call(this);var e=Error,n=ut,r=n.asn1,i=r.DEROctetString,s=r.DERSequence,o=r.cms.IssuerSerial;this.params=null,this.getCertHash=function(t,r){if(null!=t.hash)return t.hash;if("string"==typeof t&&-1==t.indexOf("-----BEGIN")&&!ht.isASN1HEX(t))return t;var i,s,o;if("string"==typeof t)i=t;else{if(null==t.cert)throw new e("hash nor cert unspecified");i=t.cert}if(s=-1!=i.indexOf("-----BEGIN")?$t(i):i,"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?s=$t(t):ht.isASN1HEX(t)&&(s=t)),null!=t.alg)o=t.alg;else{if(null==r)throw new e("hash alg unspecified");o=r}return n.crypto.Util.hashHex(s,o)},this.tohex=function(){var t=this.params,e=this.getCertHash(t,"sha1"),n=[];return n.push(new i({hex:e})),("string"==typeof t&&-1!=t.indexOf("-----BEGIN")||null!=t.cert&&0!=t.hasis||null!=t.issuer&&null!=t.serial)&&n.push(new o(t)),new s({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.ESSCertID,ut.asn1.ASN1Object),ut.asn1.cms.SigningCertificateV2=function(t){var e=Error,n=ut,r=n.asn1,i=r.DERSequence,s=(r.x509,r.cms),o=s.ESSCertIDv2;n.crypto;s.SigningCertificateV2.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.47",this.getValueArray=function(){if(null==this.params||null==this.params||null==this.params.array)throw new e("parameter 'array' not specified");for(var n=this.params.array,r=[],s=0;s<n.length;s++){var a=n[s];null==t.alg&&0!=t.hasis||"string"!=typeof a||-1==a.indexOf("-----BEGIN")&&!ht.isASN1HEX(a)||(a={cert:a}),null==a.alg&&null!=t.alg&&(a.alg=t.alg),0!=a.hasis&&0==t.hasis&&(a.hasis=!1),r.push(new o(a))}var u=new i({array:r});return[new i({array:[u]})]},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.SigningCertificateV2,ut.asn1.cms.Attribute),ut.asn1.cms.ESSCertIDv2=function(t){ut.asn1.cms.ESSCertIDv2.superclass.constructor.call(this);Error;var e=ut.asn1,n=e.DEROctetString,r=e.DERSequence,i=e.cms.IssuerSerial,s=e.x509.AlgorithmIdentifier;this.params=null,this.tohex=function(){var t=this.params,e=this.getCertHash(t,"sha256"),o=[];return null!=t.alg&&"sha256"!=t.alg&&o.push(new s({name:t.alg})),o.push(new n({hex:e})),("string"==typeof t&&-1!=t.indexOf("-----BEGIN")||null!=t.cert&&0!=t.hasis||null!=t.issuer&&null!=t.serial)&&o.push(new i(t)),new r({array:o}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.ESSCertIDv2,ut.asn1.cms.ESSCertID),ut.asn1.cms.IssuerSerial=function(t){var e=Error,n=ut.asn1,r=n.DERInteger,i=n.DERSequence,s=n.cms,o=n.x509.GeneralNames,a=re;s.IssuerSerial.superclass.constructor.call(this),this.setByParam=function(t){this.params=t},this.tohex=function(){var t,n,s=this.params;if("string"==typeof s&&-1!=s.indexOf("-----BEGIN")||null!=s.cert){var u;u=null!=s.cert?s.cert:s;var c=new a;c.readCertPEM(u),t=c.getIssuer(),n={hex:c.getSerialNumberHex()}}else{if(null==s.issuer||!s.serial)throw new e("cert or issuer and serial parameter not specified");t=s.issuer,n=s.serial}var l=new o([{dn:t}]),h=new r(n);return new i({array:[l,h]}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.IssuerSerial,ut.asn1.ASN1Object),ut.asn1.cms.SignerIdentifier=function(t){var e=ut.asn1,n=(e.DERInteger,e.DERSequence,e.cms),r=n.IssuerAndSerialNumber,i=n.SubjectKeyIdentifier;e.x509.X500Name,Error;n.SignerIdentifier.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if("isssn"==t.type)return new r(t).tohex();if("skid"==t.type)return new i(t).tohex();throw new Error("wrong property for isssn or skid")},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.SignerIdentifier,ut.asn1.ASN1Object),ut.asn1.cms.IssuerAndSerialNumber=function(t){var e=ut.asn1,n=e.DERInteger,r=e.DERSequence,i=e.cms,s=e.x509.X500Name,o=re,a=Error;i.IssuerAndSerialNumber.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t,e,i=this.params;if("string"==typeof i&&-1!=i.indexOf("-----BEGIN")||null!=i.cert){var u;u=null!=i.cert?i.cert:i;var c=new o;c.readCertPEM(u),t=c.getIssuer(),e={hex:c.getSerialNumberHex()}}else{if(null==i.issuer||!i.serial)throw new a("cert or issuer and serial parameter not specified");t=i.issuer,e=i.serial}var l=new s(t),h=new n(e);return new r({array:[l,h]}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.IssuerAndSerialNumber,ut.asn1.ASN1Object),ut.asn1.cms.SubjectKeyIdentifier=function(t){var e=ut.asn1,n=(e.DERInteger,e.DERSequence,e.ASN1Util.newObject),r=e.cms,i=(r.IssuerAndSerialName,r.SubjectKeyIdentifier,e.x509.X500Name,re),s=Error;r.SubjectKeyIdentifier.superclass.constructor.call(this),this.tohex=function(){var t,e=this.params;if(null==e.cert&&null==e.skid)throw new s("property cert nor skid undefined");null!=e.cert?t=new i(e.cert).getExtSubjectKeyIdentifier().kid.hex:null!=e.skid&&(t=e.skid);return n({tag:{tage:"a0",obj:{octstr:{hex:t}}}}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.SubjectKeyIdentifier,ut.asn1.ASN1Object),ut.asn1.cms.AttributeList=function(t){var e=Error,n=ut.asn1,r=n.DERSet,i=n.cms;i.AttributeList.superclass.constructor.call(this),this.params=null,this.hTLV=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params;if(null!=this.hTLV)return this.hTLV;var n=!0;null!=t.sortflag&&(n=t.sortflag);for(var s=t.array,o=[],a=0;a<s.length;a++){var u=s[a],c=u.attr;if("contentType"==c)o.push(new i.ContentType(u));else if("messageDigest"==c)o.push(new i.MessageDigest(u));else if("signingTime"==c)o.push(new i.SigningTime(u));else if("signingCertificate"==c)o.push(new i.SigningCertificate(u));else if("signingCertificateV2"==c)o.push(new i.SigningCertificateV2(u));else if("signaturePolicyIdentifier"==c)o.push(new ut.asn1.cades.SignaturePolicyIdentifier(u));else{if("signatureTimeStamp"!=c&&"timeStampToken"!=c)throw new e("unknown attr: "+c);o.push(new ut.asn1.cades.SignatureTimeStamp(u))}}var l=new r({array:o,sortflag:n});return this.hTLV=l.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.AttributeList,ut.asn1.ASN1Object),ut.asn1.cms.SignerInfo=function(t){var e=Error,n=ut,r=n.asn1,i=r.DERInteger,s=r.DEROctetString,o=r.DERSequence,a=r.DERTaggedObject,u=r.cms,c=u.SignerIdentifier,l=u.AttributeList,h=(u.ContentType,u.EncapsulatedContentInfo,u.MessageDigest,u.SignedData,r.x509.AlgorithmIdentifier),f=n.crypto,p=Qt;u.SignerInfo.superclass.constructor.call(this),this.params=null,this.sign=function(){var t=this.params,e=t.sigalg,n=new l(t.sattrs).tohex(),r=p.getKey(t.signkey),i=new f.Signature({alg:e});i.init(r),i.updateHex(n);var s=i.sign();t.sighex=s},this.tohex=function(){var t=this.params,n=[];if(n.push(new i({int:t.version})),n.push(new c(t.id)),n.push(new h({name:t.hashalg})),null!=t.sattrs){var r=new l(t.sattrs);try{n.push(new a({tag:"a0",explicit:!1,obj:r}))}catch(t){throw new e("si sattr error: "+t)}}if(null!=t.sigalgfield?n.push(new h({name:t.sigalgfield})):n.push(new h({name:t.sigalg})),null==t.sighex&&null!=t.signkey&&this.sign(),n.push(new s({hex:t.sighex})),null!=t.uattrs){r=new l(t.uattrs);try{n.push(new a({tag:"a1",explicit:!1,obj:r}))}catch(t){throw new e("si uattr error: "+t)}}return new o({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.SignerInfo,ut.asn1.ASN1Object),ut.asn1.cms.EncapsulatedContentInfo=function(t){var e=ut.asn1,n=e.DERTaggedObject,r=e.DERSequence,i=e.DERObjectIdentifier,s=e.DEROctetString;e.cms.EncapsulatedContentInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];if(e.push(new i(t.type)),null!=t.content&&(null!=t.content.hex||null!=t.content.str)&&1!=t.isDetached){var o=new s(t.content),a=new n({tag:"a0",explicit:!0,obj:o});e.push(a)}return new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.EncapsulatedContentInfo,ut.asn1.ASN1Object),ut.asn1.cms.ContentInfo=function(t){var e=ut.asn1,n=e.DERTaggedObject,r=e.DERSequence,i=e.DERObjectIdentifier;e.x509.OID.name2obj;ut.asn1.cms.ContentInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];e.push(new i(t.type));var s=new n({tag:"a0",explicit:!0,obj:t.obj});return e.push(s),new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.ContentInfo,ut.asn1.ASN1Object),ut.asn1.cms.SignedData=function(t){Error;var e=ut.asn1,n=(e.ASN1Object,e.DERInteger),r=e.DERSet,i=e.DERSequence,s=(e.DERTaggedObject,e.cms),o=s.EncapsulatedContentInfo,a=s.SignerInfo,u=s.ContentInfo,c=s.CertificateSet,l=s.RevocationInfoChoices,h=e.x509.AlgorithmIdentifier;ut.asn1.cms.SignedData.superclass.constructor.call(this),this.params=null,this.checkAndFixParam=function(){var t=this.params;this._setDigestAlgs(t),this._setContentTypeByEContent(t),this._setMessageDigestByEContent(t),this._setSignerInfoVersion(t),this._setSignedDataVersion(t)},this._setDigestAlgs=function(t){for(var e={},n=t.sinfos,r=0;r<n.length;r++){e[n[r].hashalg]=1}t.hashalgs=Object.keys(e).sort()},this._setContentTypeByEContent=function(t){for(var e=t.econtent.type,n=t.sinfos,r=0;r<n.length;r++){var i=n[r];this._getAttrParamByName(i,"contentType").type=e}},this._setMessageDigestByEContent=function(t){var e=t.econtent,n=(t.econtent.type,e.content.hex);null==n&&"data"==e.type&&null!=e.content.str&&(n=Ft(e.content.str));for(var r=t.sinfos,i=0;i<r.length;i++){var s=r[i],o=s.hashalg,a=this._getAttrParamByName(s,"messageDigest"),u=ut.crypto.Util.hashHex(n,o);a.hex=u}},this._getAttrParamByName=function(t,e){for(var n=t.sattrs.array,r=0;r<n.length;r++)if(n[r].attr==e)return n[r]},this._setSignerInfoVersion=function(t){for(var e=t.sinfos,n=0;n<e.length;n++){var r=e[n],i=1;"skid"==r.id.type&&(i=3),r.version=i}},this._setSignedDataVersion=function(t){var e=this._getSignedDataVersion(t);t.version=e},this._getSignedDataVersion=function(t){if(null!=t.revinfos)for(var e=t.revinfos,n=0;n<e.length;n++){if(null!=e[n].ocsp)return 5}var r=t.sinfos;for(n=0;n<r.length;n++){if(3==t.sinfos[n].version)return 3}return"data"!=t.econtent.type?3:1},this.tohex=function(){var t=this.params;null!=this.getEncodedHexPrepare&&this.getEncodedHexPrepare(),1!=t.fixed&&this.checkAndFixParam();var e=[];e.push(new n({int:t.version}));for(var s=[],u=0;u<t.hashalgs.length;u++){var f=t.hashalgs[u];s.push(new h({name:f}))}e.push(new r({array:s})),e.push(new o(t.econtent)),null!=t.certs&&e.push(new c(t.certs)),null!=t.revinfos&&e.push(new l(t.revinfos));var p=[];for(u=0;u<t.sinfos.length;u++){var d=t.sinfos[u];p.push(new a(d))}return e.push(new r({array:p})),new i({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.getContentInfo=function(){return new u({type:"signed-data",obj:this})},this.getContentInfoEncodedHex=function(){return this.getContentInfo().tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.SignedData,ut.asn1.ASN1Object),ut.asn1.cms.CertificateSet=function(t){ut.asn1.cms.CertificateSet.superclass.constructor.call(this);var e=Error,n=ut.asn1,r=n.DERTaggedObject,i=n.DERSet,s=n.ASN1Object;this.params=null,this.tohex=function(){var t,n=this.params,o=[];if(n instanceof Array)t=n;else{if(null==n.array)throw new e("cert array not specified");t=n.array}for(var a=0;a<t.length;a++){var u=$t(t[a]),c=new s;c.hTLV=u,o.push(c)}var l={array:o};0==n.sortflag&&(l.sortflag=!1);var h=new i(l);return new r({tag:"a0",explicit:!1,obj:h}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.CertificateSet,ut.asn1.ASN1Object),ut.asn1.cms.RevocationInfoChoices=function(t){ut.asn1.cms.RevocationInfoChoices.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(!t instanceof Array)throw new Error("params is not array");for(var e=[],n=0;n<t.length;n++)e.push(new ut.asn1.cms.RevocationInfoChoice(t[n]));return ut.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:{set:e}}}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.RevocationInfoChoices,ut.asn1.ASN1Object),ut.asn1.cms.RevocationInfoChoice=function(t){ut.asn1.cms.RevocationInfoChoice.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(null!=t.crl&&"string"==typeof t.crl){var e=t.crl;return-1!=t.crl.indexOf("-----BEGIN")&&(e=$t(t.crl)),e}if(null!=t.ocsp)return ut.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:new ut.asn1.cms.OtherRevocationFormat(t)}}).tohex();throw new Error("property crl or ocsp undefined")},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.RevocationInfoChoice,ut.asn1.ASN1Object),ut.asn1.cms.OtherRevocationFormat=function(t){ut.asn1.cms.OtherRevocationFormat.superclass.constructor.call(this);var e=Error,n=ut,r=n.asn1.ASN1Util.newObject,i=n.lang.String.isHex;this.params=null,this.tohex=function(){var t=this.params;if(null==t.ocsp)throw new e("property ocsp not specified");if(!i(t.ocsp)||!ht.isASN1HEX(t.ocsp))throw new e("ocsp value not ASN.1 hex string");return r({seq:[{oid:"1.3.6.1.5.5.7.16.2"},{asn1:{tlv:t.ocsp}}]}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.OtherRevocationFormat,ut.asn1.ASN1Object),ut.asn1.cms.CMSUtil=new function(){},ut.asn1.cms.CMSUtil.newSignedData=function(t){return new ut.asn1.cms.SignedData(t)},ut.asn1.cms.CMSUtil.verifySignedData=function(t){var e=ut,n=e.asn1,r=n.cms,i=(r.SignerInfo,r.SignedData,r.SigningTime,r.SigningCertificate,r.SigningCertificateV2,n.cades.SignaturePolicyIdentifier,e.lang.String.isHex),s=ht,o=s.getVbyList,a=s.getTLVbyList,u=s.getIdxbyList,c=s.getChildIdx,l=s.getTLV,h=s.oidname,f=e.crypto.Util.hashHex;void 0===t.cms&&i(t.cms);var p=t.cms,d=function(t,e){var n=e.idx;e.signerid_issuer1=a(t,n,[1,0],"30"),e.signerid_serial1=o(t,n,[1,1],"02"),e.hashalg=h(o(t,n,[2,0],"06"));var r=u(t,n,[3],"a0");e.idxSignedAttrs=r,g(t,e,r);var i=c(t,n).length;if(i<6)throw"malformed SignerInfo";e.sigalg=h(o(t,n,[i-2,0],"06")),e.sigval=o(t,n,[i-1],"04")},g=function(t,e,n){var r=c(t,n);e.signedAttrIdxList=r;for(var i=0;i<r.length;i++){var s,a=r[i],u=o(t,a,[0],"06");"2a864886f70d010905"===u?(s=xt(o(t,a,[1,0])),e.saSigningTime=s):"2a864886f70d010904"===u&&(s=o(t,a,[1,0],"04"),e.saMessageDigest=s)}},m=function(t,e,n,r){n.verifyDetail={};var i=n.verifyDetail,s=e.parse.econtent,o=n.hashalg,a=n.saMessageDigest;i.validMessageDigest=!1,f(s,o)===a&&(i.validMessageDigest=!0),function(t,e,n,r){var i,s=e.parse.certsIdx;if(void 0===e.certs){i=[],e.certkeys=[];for(var o=c(t,s),a=0;a<o.length;a++){var u=l(t,o[a]),h=new re;h.readCertHex(u),i[a]=h,e.certkeys[a]=h.getPublicKey()}e.certs=i}else i=e.certs;e.cccc=i.length,e.cccci=o.length;for(a=0;a<i.length;a++){var f=h.getIssuerHex(),p=h.getSerialNumberHex();n.signerid_issuer1===f&&n.signerid_serial1===p&&(n.certkey_idx=a)}}(t,e,n),i.validSignatureValue=!1;var u=n.sigalg,h="31"+l(t,n.idxSignedAttrs).substr(2);n.signedattrshex=h;var p=e.certs[n.certkey_idx].getPublicKey(),d=new ut.crypto.Signature({alg:u});d.init(p),d.updateHex(h);var g=d.verify(n.sigval);i.validSignatureValue_isValid=g,!0===g&&(i.validSignatureValue=!0),n.isValid=!1,i.validMessageDigest&&i.validSignatureValue&&(n.isValid=!0)},v={isValid:!1,parse:{}};return function(t,e){if("2a864886f70d010702"!==o(t,0,[0],"06"))return e;e.cmsType="signedData",e.econtent=o(t,0,[1,0,2,1,0]),function(t,e){for(var n,r=3;r<6;r++)if(void 0!==(n=u(t,0,[1,0,r]))){var i=t.substr(n,2);"a0"===i&&(e.certsIdx=n),"a1"===i&&(e.revinfosIdx=n),"31"===i&&(e.signerinfosIdx=n)}}(t,e),e.signerInfos=[],function(t,e){var n=e.signerinfosIdx;if(void 0!==n){var r=c(t,n);e.signerInfoIdxList=r;for(var i=0;i<r.length;i++){var s={idx:r[i]};d(t,s),e.signerInfos.push(s)}}}(t,e)}(p,v.parse),function(t,e){for(var n=e.parse.signerInfos,r=n.length,i=!0,s=0;s<r;s++){var o=n[s];m(t,e,o,s),o.isValid||(i=!1)}e.isValid=i}(p,v),v},ut.asn1.cms.CMSParser=function(){var t=Error,e=re,n=new e,r=ht,i=r.getV,s=r.getTLV,o=(r.getIdxbyList,r.getTLVbyList),a=r.getTLVbyListEx,u=r.getVbyList,c=r.getVbyListEx,l=r.getChildIdx;this.getCMSSignedData=function(t){var e=o(t,0,[1,0]);return this.getSignedData(e)},this.getSignedData=function(t){var e=l(t,0),n={},r=i(t,e[0]),o=parseInt(r,16);n.version=o;var u=s(t,e[1]);n.hashalgs=this.getHashAlgArray(u);var c=s(t,e[2]);n.econtent=this.getEContent(c);var h=a(t,0,["[0]"]);null!=h&&(n.certs=this.getCertificateSet(h));a(t,0,["[1]"]);var f=a(t,0,[3]);return n.sinfos=this.getSignerInfos(f),n},this.getHashAlgArray=function(t){for(var n=l(t,0),r=new e,i=[],o=0;o<n.length;o++){var a=s(t,n[o]),u=r.getAlgorithmIdentifierName(a);i.push(u)}return i},this.getEContent=function(t){var e={},n=u(t,0,[0]),r=u(t,0,[1,0]);return e.type=ut.asn1.x509.OID.oid2name(ht.hextooidstr(n)),e.content={hex:r},e},this.getSignerInfos=function(t){for(var e=[],n=l(t,0),r=0;r<n.length;r++){var i=s(t,n[r]),o=this.getSignerInfo(i);e.push(o)}return e},this.getSignerInfo=function(t){var e={},i=l(t,0),o=r.getInt(t,i[0],-1);-1!=o&&(e.version=o);var u=s(t,i[1]),h=this.getIssuerAndSerialNumber(u);e.id=h;var f=s(t,i[2]),p=n.getAlgorithmIdentifierName(f);e.hashalg=p;var d=a(t,0,["[0]"]);if(null!=d){var g=this.getAttributeList(d);e.sattrs=g}var m=a(t,0,[3]),v=n.getAlgorithmIdentifierName(m);e.sigalg=v;var y=c(t,0,[4]);e.sighex=y;var b=a(t,0,["[1]"]);if(null!=b){var w=this.getAttributeList(b);e.uattrs=w}return e},this.getSignerIdentifier=function(t){if("30"==t.substr(0,2))return this.getIssuerAndSerialNumber(t);throw new Error("SKID of signerIdentifier not supported")},this.getIssuerAndSerialNumber=function(t){var e={type:"isssn"},r=l(t,0),o=s(t,r[0]);e.issuer=n.getX500Name(o);var a=i(t,r[1]);return e.serial={hex:a},e},this.getAttributeList=function(t){for(var e=[],n=l(t,0),r=0;r<n.length;r++){var i=s(t,n[r]),o=this.getAttribute(i);e.push(o)}return{array:e}},this.getAttribute=function(t){var e={},n=l(t,0),i=r.getOID(t,n[0]),o=ut.asn1.x509.OID.oid2name(i);e.attr=o;var a=s(t,n[1]),u=l(a,0);if(1==u.length)e.valhex=s(a,u[0]);else{for(var c=[],h=0;h<u.length;h++)c.push(s(a,u[h]));e.valhex=c}return"contentType"==o?this.setContentType(e):"messageDigest"==o?this.setMessageDigest(e):"signingTime"==o?this.setSigningTime(e):"signingCertificate"==o?this.setSigningCertificate(e):"signingCertificateV2"==o?this.setSigningCertificateV2(e):"signaturePolicyIdentifier"==o&&this.setSignaturePolicyIdentifier(e),e},this.setContentType=function(t){var e=r.getOIDName(t.valhex,0,null);null!=e&&(t.type=e,delete t.valhex)},this.setSigningTime=function(t){var e=xt(i(t.valhex,0));t.str=e,delete t.valhex},this.setMessageDigest=function(t){var e=i(t.valhex,0);t.hex=e,delete t.valhex},this.setSigningCertificate=function(t){var e=l(t.valhex,0);if(e.length>0){for(var n=s(t.valhex,e[0]),r=l(n,0),i=[],o=0;o<r.length;o++){var a=s(n,r[o]),u=this.getESSCertID(a);i.push(u)}t.array=i}if(e.length>1){var c=s(t.valhex,e[1]);t.polhex=c}delete t.valhex},this.setSignaturePolicyIdentifier=function(t){var n=l(t.valhex,0);if(n.length>0){var o=r.getOID(t.valhex,n[0]);t.oid=o}if(n.length>1){var a=new e,u=l(t.valhex,n[1]),c=s(t.valhex,u[0]),h=a.getAlgorithmIdentifierName(c);t.alg=h;var f=i(t.valhex,u[1]);t.hash=f}delete t.valhex},this.setSigningCertificateV2=function(t){var e=l(t.valhex,0);if(e.length>0){for(var n=s(t.valhex,e[0]),r=l(n,0),i=[],o=0;o<r.length;o++){var a=s(n,r[o]),u=this.getESSCertIDv2(a);i.push(u)}t.array=i}if(e.length>1){var c=s(t.valhex,e[1]);t.polhex=c}delete t.valhex},this.getESSCertID=function(t){var e={},n=l(t,0);if(n.length>0){var r=i(t,n[0]);e.hash=r}if(n.length>1){var o=s(t,n[1]),a=this.getIssuerSerial(o);null!=a.serial&&(e.serial=a.serial),null!=a.issuer&&(e.issuer=a.issuer)}return e},this.getESSCertIDv2=function(e){var r={},o=l(e,0);if(o.length<1||3<o.length)throw new t("wrong number of elements");var a=0;if("30"==e.substr(o[0],2)){var u=s(e,o[0]);r.alg=n.getAlgorithmIdentifierName(u),a++}else r.alg="sha256";var c=i(e,o[a]);if(r.hash=c,o.length>a+1){var h=s(e,o[a+1]),f=this.getIssuerSerial(h);r.issuer=f.issuer,r.serial=f.serial}return r},this.getIssuerSerial=function(t){var e={},r=l(t,0),o=s(t,r[0]),a=n.getGeneralNames(o)[0].dn;e.issuer=a;var u=i(t,r[1]);return e.serial={hex:u},e},this.getCertificateSet=function(t){for(var e=l(t,0),n=[],r=0;r<e.length;r++){var i=s(t,e[r]);if("30"==i.substr(0,2)){var o=It(i,"CERTIFICATE");n.push(o)}}return{array:n,sortflag:!1}}},void 0!==ut&&ut||(ut={}),void 0!==ut.asn1&&ut.asn1||(ut.asn1={}),void 0!==ut.asn1.tsp&&ut.asn1.tsp||(ut.asn1.tsp={}),ut.asn1.tsp.TimeStampToken=function(t){var e=ut.asn1.tsp;e.TimeStampToken.superclass.constructor.call(this),this.params=null,this.getEncodedHexPrepare=function(){var t=new e.TSTInfo(this.params.econtent.content);this.params.econtent.content.hex=t.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.tsp.TimeStampToken,ut.asn1.cms.SignedData),ut.asn1.tsp.TSTInfo=function(t){Error;var e=ut.asn1,n=e.DERSequence,r=e.DERInteger,i=e.DERBoolean,s=e.DERGeneralizedTime,o=e.DERObjectIdentifier,a=e.DERTaggedObject,u=e.tsp,c=u.MessageImprint,l=u.Accuracy,h=(e.x509.X500Name,e.x509.GeneralName);if(u.TSTInfo.superclass.constructor.call(this),this.dVersion=new r({int:1}),this.dPolicy=null,this.dMessageImprint=null,this.dSerial=null,this.dGenTime=null,this.dAccuracy=null,this.dOrdering=null,this.dNonce=null,this.dTsa=null,this.tohex=function(){var t=[this.dVersion];if(null==this.dPolicy)throw new Error("policy shall be specified.");if(t.push(this.dPolicy),null==this.dMessageImprint)throw new Error("messageImprint shall be specified.");if(t.push(this.dMessageImprint),null==this.dSerial)throw new Error("serialNumber shall be specified.");if(t.push(this.dSerial),null==this.dGenTime)throw new Error("genTime shall be specified.");t.push(this.dGenTime),null!=this.dAccuracy&&t.push(this.dAccuracy),null!=this.dOrdering&&t.push(this.dOrdering),null!=this.dNonce&&t.push(this.dNonce),null!=this.dTsa&&t.push(this.dTsa);var e=new n({array:t});return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t){if("string"==typeof t.policy){if(!t.policy.match(/^[0-9.]+$/))throw"policy shall be oid like 0.1.4.134";this.dPolicy=new o({oid:t.policy})}void 0!==t.messageImprint&&(this.dMessageImprint=new c(t.messageImprint)),void 0!==t.serial&&(this.dSerial=new r(t.serial)),void 0!==t.genTime&&(this.dGenTime=new s(t.genTime)),void 0!==t.accuracy&&(this.dAccuracy=new l(t.accuracy)),void 0!==t.ordering&&1==t.ordering&&(this.dOrdering=new i),void 0!==t.nonce&&(this.dNonce=new r(t.nonce)),void 0!==t.tsa&&(this.dTsa=new a({tag:"a0",explicit:!0,obj:new h({dn:t.tsa})}))}},Zt(ut.asn1.tsp.TSTInfo,ut.asn1.ASN1Object),ut.asn1.tsp.Accuracy=function(t){var e=ut.asn1,n=e.ASN1Util.newObject;e.tsp.Accuracy.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];return null!=t.seconds&&"number"==typeof t.seconds&&e.push({int:t.seconds}),null!=t.millis&&"number"==typeof t.millis&&e.push({tag:{tagi:"80",obj:{int:t.millis}}}),null!=t.micros&&"number"==typeof t.micros&&e.push({tag:{tagi:"81",obj:{int:t.micros}}}),n({seq:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.tsp.Accuracy,ut.asn1.ASN1Object),ut.asn1.tsp.MessageImprint=function(t){var e=ut.asn1,n=e.DERSequence,r=e.DEROctetString,i=e.x509.AlgorithmIdentifier;e.tsp.MessageImprint.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=new i({name:t.alg}),s=new r({hex:t.hash});return new n({array:[e,s]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.tsp.MessageImprint,ut.asn1.ASN1Object),ut.asn1.tsp.TimeStampReq=function(t){var e=ut.asn1,n=e.DERSequence,r=e.DERInteger,i=e.DERBoolean,s=(e.ASN1Object,e.DERObjectIdentifier),o=e.tsp,a=o.MessageImprint;o.TimeStampReq.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];return e.push(new r({int:1})),t.messageImprint instanceof ut.asn1.ASN1Object?e.push(t.messageImprint):e.push(new a(t.messageImprint)),null!=t.policy&&e.push(new s(t.policy)),null!=t.nonce&&e.push(new r(t.nonce)),1==t.certreq&&e.push(new i),new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.tsp.TimeStampReq,ut.asn1.ASN1Object),ut.asn1.tsp.TimeStampResp=function(t){var e=ut.asn1,n=e.DERSequence,r=(e.ASN1Object,e.tsp),i=r.PKIStatusInfo;r.TimeStampResp.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,s=[];if(null!=t.econtent||null!=t.tst)if(null!=t.statusinfo?s.push(new i(t.statusinfo)):s.push(new i("granted")),null!=t.econtent)s.push(new r.TimeStampToken(t).getContentInfo());else{if(!(t.tst instanceof e.ASN1Object))throw new Error("improper member tst value");s.push(t.tst)}else{if(null==t.statusinfo)throw new Error("parameter for token nor statusinfo not specified");s.push(new i(t.statusinfo))}return new n({array:s}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.tsp.TimeStampResp,ut.asn1.ASN1Object),ut.asn1.tsp.PKIStatusInfo=function(t){var e=Error,n=ut.asn1,r=n.DERSequence,i=n.tsp,s=i.PKIStatus,o=i.PKIFreeText,a=i.PKIFailureInfo;i.PKIStatusInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,n=[];if("string"==typeof t)n.push(new s(t));else{if(null==t.status)throw new e("property 'status' unspecified");n.push(new s(t.status)),null!=t.statusstr&&n.push(new o(t.statusstr)),null!=t.failinfo&&n.push(new a(t.failinfo))}return new r({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.tsp.PKIStatusInfo,ut.asn1.ASN1Object),ut.asn1.tsp.PKIStatus=function(t){var e=Error,n=ut.asn1,r=n.DERInteger;n.tsp.PKIStatus.superclass.constructor.call(this);var i={granted:0,grantedWithMods:1,rejection:2,waiting:3,revocationWarning:4,revocationNotification:5};this.params=null,this.tohex=function(){var t,n=this.params;if("string"==typeof n)try{t=i[n]}catch(t){throw new e("undefined name: "+n)}else{if("number"!=typeof n)throw new e("unsupported params");t=n}return new r({int:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.tsp.PKIStatus,ut.asn1.ASN1Object),ut.asn1.tsp.PKIFreeText=function(t){var e=Error,n=ut.asn1,r=n.DERSequence,i=n.DERUTF8String;n.tsp.PKIFreeText.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(!t instanceof Array)throw new e("wrong params: not array");for(var n=[],s=0;s<t.length;s++)n.push(new i({str:t[s]}));return new r({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.tsp.PKIFreeText,ut.asn1.ASN1Object),ut.asn1.tsp.PKIFailureInfo=function(t){var e=Error,n=ut.asn1,r=n.DERBitString,i=n.tsp.PKIFailureInfo,s={badAlg:0,badRequest:2,badDataFormat:5,timeNotAvailable:14,unacceptedPolicy:15,unacceptedExtension:16,addInfoNotAvailable:17,systemFailure:25};i.superclass.constructor.call(this),this.params=null,this.getBinValue=function(){var t=this.params,n=0;if("number"==typeof t&&0<=t&&t<=25){for(var r=(n|=1<<t).toString(2),i="",o=r.length-1;o>=0;o--)i+=r[o];return i}if("string"==typeof t&&null!=s[t])return Jt([t],s);if("object"==typeof t&&null!=t.length)return Jt(t,s);throw new e("wrong params")},this.tohex=function(){this.params;var t=this.getBinValue();return new r({bin:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.tsp.PKIFailureInfo,ut.asn1.ASN1Object),ut.asn1.tsp.AbstractTSAAdapter=function(t){this.getTSTHex=function(t,e){throw"not implemented yet"}},ut.asn1.tsp.SimpleTSAAdapter=function(t){var e=ut,n=e.asn1.tsp,r=e.crypto.Util.hashHex;n.SimpleTSAAdapter.superclass.constructor.call(this),this.params=null,this.serial=0,this.getTSTHex=function(t,e){var i=r(t,e);this.params.econtent.content.messageImprint={alg:e,hash:i},this.params.econtent.content.serial={int:this.serial++};var s=Math.floor(1e9*Math.random());return this.params.econtent.content.nonce={int:s},new n.TimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==t&&(this.params=t)},Zt(ut.asn1.tsp.SimpleTSAAdapter,ut.asn1.tsp.AbstractTSAAdapter),ut.asn1.tsp.FixedTSAAdapter=function(t){var e=ut,n=e.asn1.tsp,r=e.crypto.Util.hashHex;n.FixedTSAAdapter.superclass.constructor.call(this),this.params=null,this.getTSTHex=function(t,e){var i=r(t,e);return this.params.econtent.content.messageImprint={alg:e,hash:i},new n.TimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==t&&(this.params=t)},Zt(ut.asn1.tsp.FixedTSAAdapter,ut.asn1.tsp.AbstractTSAAdapter),ut.asn1.tsp.TSPUtil=new function(){},ut.asn1.tsp.TSPUtil.newTimeStampToken=function(t){return new ut.asn1.tsp.TimeStampToken(t)},ut.asn1.tsp.TSPUtil.parseTimeStampReq=function(t){return(new ut.asn1.tsp.TSPParser).getTimeStampReq(t)},ut.asn1.tsp.TSPUtil.parseMessageImprint=function(t){return(new ut.asn1.tsp.TSPParser).getMessageImprint(t)},ut.asn1.tsp.TSPParser=function(){Error;var t=new re,e=ht,n=e.getV,r=e.getTLV,i=e.getIdxbyList,s=(e.getTLVbyListEx,e.getChildIdx),o=["granted","grantedWithMods","rejection","waiting","revocationWarning","revocationNotification"],a={0:"badAlg",2:"badRequest",5:"badDataFormat",14:"timeNotAvailable",15:"unacceptedPolicy",16:"unacceptedExtension",17:"addInfoNotAvailable",25:"systemFailure"};this.getResponse=function(t){var e=s(t,0);if(1==e.length)return this.getPKIStatusInfo(r(t,e[0]));if(e.length>1){var n=this.getPKIStatusInfo(r(t,e[0])),i=r(t,e[1]),o=this.getToken(i);return o.statusinfo=n,o}},this.getToken=function(t){var e=(new ut.asn1.cms.CMSParser).getCMSSignedData(t);return this.setTSTInfo(e),e},this.setTSTInfo=function(t){var e=t.econtent;if("tstinfo"==e.type){var n=e.content.hex,r=this.getTSTInfo(n);e.content=r}},this.getTSTInfo=function(e){var i={},o=s(e,0),a=n(e,o[1]);i.policy=zt(a);var u=r(e,o[2]);i.messageImprint=this.getMessageImprint(u);var c=n(e,o[3]);i.serial={hex:c};var l=n(e,o[4]);i.genTime={str:xt(l)};var h=0;if(o.length>5&&"30"==e.substr(o[5],2)){var f=r(e,o[5]);i.accuracy=this.getAccuracy(f),h++}o.length>5+h&&"01"==e.substr(o[5+h],2)&&("ff"==n(e,o[5+h])&&(i.ordering=!0),h++);if(o.length>5+h&&"02"==e.substr(o[5+h],2)){var p=n(e,o[5+h]);i.nonce={hex:p},h++}if(o.length>5+h&&"a0"==e.substr(o[5+h],2)){var d=r(e,o[5+h]);d="30"+d.substr(2),pGeneralNames=t.getGeneralNames(d);var g=pGeneralNames[0].dn;i.tsa=g,h++}if(o.length>5+h&&"a1"==e.substr(o[5+h],2)){var m=r(e,o[5+h]);m="30"+m.substr(2);var v=t.getExtParamArray(m);i.ext=v,h++}return i},this.getAccuracy=function(t){for(var e={},r=s(t,0),i=0;i<r.length;i++){var o=t.substr(r[i],2),a=n(t,r[i]),u=parseInt(a,16);"02"==o?e.seconds=u:"80"==o?e.millis=u:"81"==o&&(e.micros=u)}return e},this.getMessageImprint=function(t){if("30"!=t.substr(0,2))throw new Error("head of messageImprint hex shall be x30");var r={},o=(s(t,0),i(t,0,[0,0])),a=n(t,o),u=e.hextooidstr(a),c=ut.asn1.x509.OID.oid2name(u);if(""==c)throw new Error("hashAlg name undefined: "+u);var l=c,h=i(t,0,[1]);return r.alg=l,r.hash=n(t,h),r},this.getPKIStatusInfo=function(t){var e={},i=s(t,0),a=0;try{var u=n(t,i[0]),c=parseInt(u,16);e.status=o[c]}catch(t){}if(i.length>1&&"30"==t.substr(i[1],2)){var l=r(t,i[1]);e.statusstr=this.getPKIFreeText(l),a++}if(i.length>a&&"03"==t.substr(i[1+a],2)){var h=r(t,i[1+a]);e.failinfo=this.getPKIFailureInfo(h)}return e},this.getPKIFreeText=function(t){for(var n=[],r=s(t,0),i=0;i<r.length;i++)n.push(e.getString(t,r[i]));return n},this.getPKIFailureInfo=function(t){var n=e.getInt(t,0);return null!=a[n]?a[n]:n},this.getTimeStampReq=function(t){var i={certreq:!1},o=s(t,0);if(o.length<2)throw new Error("TimeStampReq must have at least 2 items");var a=r(t,o[1]);i.messageImprint=ut.asn1.tsp.TSPUtil.parseMessageImprint(a);for(var u=2;u<o.length;u++){var c=o[u],l=t.substr(c,2);if("06"==l){var h=n(t,c);i.policy=e.hextooidstr(h)}"02"==l&&(i.nonce=n(t,c)),"01"==l&&(i.certreq=!0)}return i}},void 0!==ut&&ut||(ut={}),void 0!==ut.asn1&&ut.asn1||(ut.asn1={}),void 0!==ut.asn1.cades&&ut.asn1.cades||(ut.asn1.cades={}),ut.asn1.cades.SignaturePolicyIdentifier=function(t){var e=ut.asn1.cades,n=e.SignaturePolicyId;e.SignaturePolicyIdentifier.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.15",this.params=null,this.getValueArray=function(){return[new n(this.params)]},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},Zt(ut.asn1.cades.SignaturePolicyIdentifier,ut.asn1.cms.Attribute),ut.asn1.cades.SignaturePolicyId=function(t){var e=ut.asn1,n=e.DERSequence,r=e.DERObjectIdentifier,i=(e.x509.AlgorithmIdentifier,e.cades),s=i.SignaturePolicyId,o=i.OtherHashAlgAndValue;s.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];return e.push(new r(t.oid)),e.push(new o(t)),new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},Zt(ut.asn1.cades.SignaturePolicyId,ut.asn1.ASN1Object),ut.asn1.cades.OtherHashAlgAndValue=function(t){var e=Error,n=ut.asn1,r=n.DERSequence,i=n.DEROctetString,s=n.x509.AlgorithmIdentifier;n.cades.OtherHashAlgAndValue.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(null==t.alg)throw new e("property 'alg' not specified");if(null==t.hash&&null==t.cert)throw new e("property 'hash' nor 'cert' not specified");var n=null;if(null!=t.hash)n=t.hash;else if(null!=t.cert){if("string"!=typeof t.cert)throw new e("cert not string");var o=t.cert;-1!=t.cert.indexOf("-----BEGIN")&&(o=$t(t.cert)),n=ut.crypto.Util.hashHex(o,t.alg)}var a=[];return a.push(new s({name:t.alg})),a.push(new i({hex:n})),new r({array:a}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cades.OtherHashAlgAndValue,ut.asn1.ASN1Object),ut.asn1.cades.OtherHashValue=function(t){ut.asn1.cades.OtherHashValue.superclass.constructor.call(this);var e=Error,n=ut,r=(n.lang.String.isHex,n.asn1.DEROctetString);n.crypto.Util.hashHex;this.params=null,this.tohex=function(){var t=this.params;if(null==t.hash&&null==t.cert)throw new e("hash or cert not specified");var n=null;if(null!=t.hash)n=t.hash;else if(null!=t.cert){if("string"!=typeof t.cert)throw new e("cert not string");var i=t.cert;-1!=t.cert.indexOf("-----BEGIN")&&(i=$t(t.cert)),n=ut.crypto.Util.hashHex(i,"sha1")}return new r({hex:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cades.OtherHashValue,ut.asn1.ASN1Object),ut.asn1.cades.SignatureTimeStamp=function(t){var e=Error,n=ut,r=n.lang.String.isHex,i=n.asn1,s=i.ASN1Object;i.x509;i.cades.SignatureTimeStamp.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.14",this.params=null,this.getValueArray=function(){var t=this.params;if(null!=t.tst){if(r(t.tst))return(i=new s).hTLV=t.tst,[i];if(t.tst instanceof s)return[t.tst];throw new e("params.tst has wrong value")}if(null!=t.res){var n=t.res;if(n instanceof s&&(n=n.tohex()),"string"!=typeof n||!r(n))throw new e("params.res has wrong value");var i;ht.getTLVbyList(n,0,[1]);return(i=new s).hTLV=t.tst,[i]}},null!=t&&this.setByParam(t)},Zt(ut.asn1.cades.SignatureTimeStamp,ut.asn1.cms.Attribute),ut.asn1.cades.CompleteCertificateRefs=function(t){var e=Error,n=ut,r=n.asn1,i=r.DERSequence,s=r.cades,o=s.OtherCertID,a=n.lang.String.isHex;s.CompleteCertificateRefs.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.21",this.params=null,this.getValueArray=function(){for(var t=this.params,n=[],r=0;r<t.array.length;r++){var s=t.array[r];if("string"==typeof s)if(-1!=s.indexOf("-----BEGIN"))s={cert:s};else{if(!a(s))throw new e("unsupported value: "+s);s={hash:s}}null!=t.alg&&null==s.alg&&(s.alg=t.alg),null!=t.hasis&&null==s.hasis&&(s.hasis=t.hasis);var u=new o(s);n.push(u)}return[new i({array:n})]},null!=t&&this.setByParam(t)},Zt(ut.asn1.cades.CompleteCertificateRefs,ut.asn1.cms.Attribute),ut.asn1.cades.OtherCertID=function(t){var e=ut.asn1,n=e.DERSequence,r=e.cms.IssuerSerial,i=e.cades,s=i.OtherHashValue,o=i.OtherHashAlgAndValue;i.OtherCertID.superclass.constructor.call(this),this.params=t,this.tohex=function(){var t=this.params;"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?t={cert:t}:_isHex(t)&&(t={hash:t}));var e=[],i=null;if(i=null!=t.alg?new o(t):new s(t),e.push(i),null!=t.cert&&1==t.hasis||null!=t.issuer&&null!=t.serial){var a=new r(t);e.push(a)}return new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cades.OtherCertID,ut.asn1.ASN1Object),ut.asn1.cades.OtherHash=function(t){Error;var e=ut,n=e.asn1,r=(n.cms,n.cades),i=r.OtherHashAlgAndValue,s=r.OtherHashValue,o=(e.crypto.Util.hashHex,e.lang.String.isHex);r.OtherHash.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?t={cert:t}:o(t)&&(t={hash:t}));return(null!=t.alg?new i(t):new s(t)).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cades.OtherHash,ut.asn1.ASN1Object),ut.asn1.cades.CAdESUtil=new function(){},ut.asn1.cades.CAdESUtil.parseSignedDataForAddingUnsigned=function(t){return(new ut.asn1.cms.CMSParser).getCMSSignedData(t)},ut.asn1.cades.CAdESUtil.parseSignerInfoForAddingUnsigned=function(t,e,n){var r=ht,i=r.getChildIdx,s=r.getTLV,o=r.getV,a=ut.asn1,u=a.ASN1Object,c=a.cms,l=c.AttributeList,h=c.SignerInfo,f={},p=i(t,e);if(6!=p.length)throw"not supported items for SignerInfo (!=6)";var d=p.shift();f.version=s(t,d);var g=p.shift();f.si=s(t,g);var m=p.shift();f.digalg=s(t,m);var v=p.shift();f.sattrs=s(t,v);var y=p.shift();f.sigalg=s(t,y);var b=p.shift();f.sig=s(t,b),f.sigval=o(t,b);var w=null;return f.obj=new h,(w=new u).hTLV=f.version,f.obj.dCMSVersion=w,(w=new u).hTLV=f.si,f.obj.dSignerIdentifier=w,(w=new u).hTLV=f.digalg,f.obj.dDigestAlgorithm=w,(w=new u).hTLV=f.sattrs,f.obj.dSignedAttrs=w,(w=new u).hTLV=f.sigalg,f.obj.dSigAlg=w,(w=new u).hTLV=f.sig,f.obj.dSig=w,f.obj.dUnsignedAttrs=new l,f},void 0!==ut.asn1.csr&&ut.asn1.csr||(ut.asn1.csr={}),ut.asn1.csr.CertificationRequest=function(t){var e=ut.asn1,n=e.DERBitString,r=e.DERSequence,i=e.csr,s=(e.x509,i.CertificationRequestInfo);i.CertificationRequest.superclass.constructor.call(this),this.setByParam=function(t){this.params=t},this.sign=function(){var t=new s(this.params).tohex(),e=new ut.crypto.Signature({alg:this.params.sigalg});e.init(this.params.sbjprvkey),e.updateHex(t);var n=e.sign();this.params.sighex=n},this.getPEM=function(){return It(this.tohex(),"CERTIFICATE REQUEST")},this.tohex=function(){var t=this.params,e=new ut.asn1.csr.CertificationRequestInfo(this.params),i=new ut.asn1.x509.AlgorithmIdentifier({name:t.sigalg});if(null==t.sighex&&null!=t.sbjprvkey&&this.sign(),null==t.sighex)throw new Error("sighex or sbjprvkey parameter not defined");var s=new n({hex:"00"+t.sighex});return new r({array:[e,i,s]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.csr.CertificationRequest,ut.asn1.ASN1Object),ut.asn1.csr.CertificationRequestInfo=function(t){var e=ut.asn1,n=(e.DERBitString,e.DERSequence),r=e.DERInteger,i=e.DERUTF8String,s=e.DERTaggedObject,o=e.ASN1Util.newObject,a=e.csr,u=e.x509,c=u.X500Name,l=u.Extensions,h=u.SubjectPublicKeyInfo;a.AttributeList;a.CertificationRequestInfo.superclass.constructor.call(this),this.params=null,this.setByParam=function(t){null!=t&&(this.params=t)},this.tohex=function(){var t=this.params,e=[];if(e.push(new r({int:0})),e.push(new c(t.subject)),e.push(new h(Qt.getKey(t.sbjpubkey))),null!=t.attrs){var a=function(t){for(var e=Error,n=ut.asn1.x509.Extensions,r=[],i=0;i<t.length;i++){var s=t[i],o=s.attr;if("extensionRequest"==o){var a={seq:[{oid:"1.2.840.113549.1.9.14"},{set:[new n(s.ext)]}]};r.push(a)}else if("unstructuredName"==o){a={seq:[{oid:"1.2.840.113549.1.9.2"},{set:s.names}]};r.push(a)}else{if("challengePassword"!=o)throw new e("unknown CSR attribute");a={seq:[{oid:"1.2.840.113549.1.9.7"},{set:[{utf8str:s.password}]}]};r.push(a)}}return{set:r}}(t.attrs),u=o({tag:{tage:"a0",obj:a}});e.push(u)}else if(null!=t.extreq){var f=new l(t.extreq);u=o({tag:{tage:"a0",obj:{seq:[{oid:"1.2.840.113549.1.9.14"},{set:[f]}]}}});e.push(u)}else e.push(new s({tag:"a0",explicit:!1,obj:new i({str:""})}));return new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.csr.CertificationRequestInfo,ut.asn1.ASN1Object),ut.asn1.csr.AttributeList=function(t){},Zt(ut.asn1.csr.AttributeList,ut.asn1.ASN1Object),ut.asn1.csr.CSRUtil=new function(){},ut.asn1.csr.CSRUtil.newCSRPEM=function(t){return new ut.asn1.csr.CertificationRequest(t).getPEM()},ut.asn1.csr.CSRUtil.getParam=function(t,e){var n=ht,r=n.getV,i=n.getIdxbyList,s=n.getTLVbyList,o=n.getTLVbyListEx,a=n.getVbyListEx,u={};if(-1==t.indexOf("-----BEGIN CERTIFICATE REQUEST"))throw new Error("argument is not PEM file");var c=$t(t,"CERTIFICATE REQUEST");e&&(u.tbs=s(c,0,[0]));try{var l=o(c,0,[0,1]);if("3000"==l)u.subject={};else{var h=new re;u.subject=h.getX500Name(l)}}catch(t){}var f=o(c,0,[0,2]),p=Qt.getKey(f,null,"pkcs8pub");u.sbjpubkey=Qt.getPEM(p,"PKCS8PUB");var d=function(t){var e=i(t,0,[0,3,0,0],"06");return"2a864886f70d01090e"!=r(t,e)?null:s(t,0,[0,3,0,1,0],"30")}(c);h=new re;null!=d&&(u.extreq=h.getExtParamArray(d));try{var g=o(c,0,[1],"30");h=new re;u.sigalg=h.getAlgorithmIdentifierName(g)}catch(t){}try{var m=a(c,0,[2]);u.sighex=m}catch(t){}return u},ut.asn1.csr.CSRUtil.verifySignature=function(t){try{var e=null;if("string"==typeof t&&-1!=t.indexOf("-----BEGIN CERTIFICATE REQUEST")?e=ut.asn1.csr.CSRUtil.getParam(t,!0):"object"==typeof t&&null!=t.sbjpubkey&&null!=t.sigalg&&null!=t.sighex&&null!=t.tbs&&(e=t),null==e)return!1;var n=new ut.crypto.Signature({alg:e.sigalg});return n.init(e.sbjpubkey),n.updateHex(e.tbs),n.verify(e.sighex)}catch(t){return alert(t),!1}},void 0!==ut&&ut||(ut={}),void 0!==ut.asn1&&ut.asn1||(ut.asn1={}),void 0!==ut.asn1.ocsp&&ut.asn1.ocsp||(ut.asn1.ocsp={}),ut.asn1.ocsp.DEFAULT_HASH="sha1",ut.asn1.ocsp.OCSPResponse=function(t){ut.asn1.ocsp.OCSPResponse.superclass.constructor.call(this);ut.asn1.DEREnumerated;var e=ut.asn1.ASN1Util.newObject,n=ut.asn1.ocsp.ResponseBytes,r=["successful","malformedRequest","internalError","tryLater","_not_used_","sigRequired","unauthorized"];this.params=null,this._getStatusCode=function(){var t=this.params.resstatus;return"number"==typeof t?t:"string"!=typeof t?-1:r.indexOf(t)},this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params,r=this._getStatusCode();if(-1==r)throw new Error("responseStatus not supported: "+t.resstatus);if(0!=r)return e({seq:[{enum:{int:r}}]}).tohex();var i=new n(t);return e({seq:[{enum:{int:0}},{tag:{tag:"a0",explicit:!0,obj:i}}]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.OCSPResponse,ut.asn1.ASN1Object),ut.asn1.ocsp.ResponseBytes=function(t){ut.asn1.ocsp.ResponseBytes.superclass.constructor.call(this);var e=ut.asn1,n=e.DERSequence,r=e.DERObjectIdentifier,i=e.DEROctetString,s=e.ocsp.BasicOCSPResponse;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params;if("ocspBasic"!=t.restype)throw new Error("not supported responseType: "+t.restype);var e=new s(t),o=[];return o.push(new r({name:"ocspBasic"})),o.push(new i({hex:e.tohex()})),new n({array:o}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.ResponseBytes,ut.asn1.ASN1Object),ut.asn1.ocsp.BasicOCSPResponse=function(t){ut.asn1.ocsp.BasicOCSPResponse.superclass.constructor.call(this);var e=Error,n=ut.asn1,r=n.ASN1Object,i=n.DERSequence,s=(n.DERGeneralizedTime,n.DERTaggedObject),o=n.DERBitString,a=(n.x509.Extensions,n.x509.AlgorithmIdentifier),u=n.ocsp;u.ResponderID;_SingleResponseList=u.SingleResponseList,_ResponseData=u.ResponseData,this.params=null,this.setByParam=function(t){this.params=t},this.sign=function(){var t=this.params,e=t.tbsresp.tohex(),n=new ut.crypto.Signature({alg:t.sigalg});n.init(t.reskey),n.updateHex(e),t.sighex=n.sign()},this.tohex=function(){var t=this.params;null==t.tbsresp&&(t.tbsresp=new _ResponseData(t)),null==t.sighex&&null!=t.reskey&&this.sign();var n=[];if(n.push(t.tbsresp),n.push(new a({name:t.sigalg})),n.push(new o({hex:"00"+t.sighex})),null!=t.certs&&null!=t.certs.length){for(var u=[],c=0;c<t.certs.length;c++){var l=t.certs[c],h=null;if(ht.isASN1HEX(l))h=l;else{if(!l.match(/-----BEGIN/))throw new e("certs["+c+"] not hex or PEM");h=$t(l)}u.push(new r({tlv:h}))}var f=new i({array:u});n.push(new s({tag:"a0",explicit:!0,obj:f}))}return new i({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.BasicOCSPResponse,ut.asn1.ASN1Object),ut.asn1.ocsp.ResponseData=function(t){ut.asn1.ocsp.ResponseData.superclass.constructor.call(this);var e=Error,n=ut.asn1,r=n.DERSequence,i=n.DERGeneralizedTime,s=n.DERTaggedObject,o=n.x509.Extensions,a=n.ocsp,u=a.ResponderID;_SingleResponseList=a.SingleResponseList,this.params=null,this.tohex=function(){var t=this.params;null!=t.respid&&new e("respid not specified"),null!=t.prodat&&new e("prodat not specified"),null!=t.array&&new e("array not specified");var n=[];if(n.push(new u(t.respid)),n.push(new i(t.prodat)),n.push(new _SingleResponseList(t.array)),null!=t.ext){var a=new o(t.ext);n.push(new s({tag:"a1",explicit:!0,obj:a}))}return new r({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.ResponseData,ut.asn1.ASN1Object),ut.asn1.ocsp.ResponderID=function(t){ut.asn1.ocsp.ResponderID.superclass.constructor.call(this);var e=ut,n=e.asn1,r=n.ASN1Util.newObject,i=n.x509.X500Name,s=e.lang.String.isHex,o=Error;this.params=null,this.tohex=function(){var t=this.params;if(null!=t.key){var e,n=null;if("string"==typeof t.key){if(s(t.key)&&(n=t.key),t.key.match(/-----BEGIN CERTIFICATE/))null!=(e=new re(t.key).getExtSubjectKeyIdentifier())&&(n=e.kid.hex)}else if(t.key instanceof re)null!=(e=t.key.getExtSubjectKeyIdentifier())&&(n=e.kid.hex);if(null==n)throw new o("wrong key member value");return r({tag:{tag:"a2",explicit:!0,obj:{octstr:{hex:n}}}}).tohex()}if(null!=t.name){var a=null;if("string"==typeof t.name&&t.name.match(/-----BEGIN CERTIFICATE/))a=new re(t.name).getSubject();else t.name instanceof re?a=t.name.getSubject():"object"!=typeof t.name||null==t.name.array&&null==t.name.str||(a=t.name);if(null==a)throw new o("wrong name member value");return r({tag:{tag:"a1",explicit:!0,obj:new i(a)}}).tohex()}throw new o("key or name not specified")},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.ResponderID,ut.asn1.ASN1Object),ut.asn1.ocsp.SingleResponseList=function(t){ut.asn1.ocsp.SingleResponseList.superclass.constructor.call(this);var e=ut.asn1,n=e.DERSequence,r=e.ocsp.SingleResponse;this.params=null,this.tohex=function(){var t=this.params;if("object"!=typeof t||null==t.length)throw new Error("params not specified properly");for(var e=[],i=0;i<t.length;i++)e.push(new r(t[i]));return new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.SingleResponseList,ut.asn1.ASN1Object),ut.asn1.ocsp.SingleResponse=function(t){var e=Error,n=ut.asn1,r=n.DERSequence,i=n.DERGeneralizedTime,s=n.DERTaggedObject,o=n.ocsp,a=o.CertID,u=o.CertStatus,c=n.x509.Extensions;o.SingleResponse.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,n=[];if(null==t.certid)throw new e("certid unspecified");if(null==t.status)throw new e("status unspecified");if(null==t.thisupdate)throw new e("thisupdate unspecified");if(n.push(new a(t.certid)),n.push(new u(t.status)),n.push(new i(t.thisupdate)),null!=t.nextupdate){var o=new i(t.nextupdate);n.push(new s({tag:"a0",explicit:!0,obj:o}))}if(null!=t.ext){var l=new c(t.ext);n.push(new s({tag:"a1",explicit:!0,obj:l}))}return new r({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.SingleResponse,ut.asn1.ASN1Object),ut.asn1.ocsp.CertID=function(t){var e=ut,n=e.asn1,r=n.DEROctetString,i=n.DERInteger,s=n.DERSequence,o=n.x509.AlgorithmIdentifier,a=n.ocsp,u=(a.DEFAULT_HASH,e.crypto.Util.hashHex),c=re,l=ht.getVbyList;a.CertID.superclass.constructor.call(this),this.DEFAULT_HASH="sha1",this.params=null,this.setByValue=function(t,e,n,r){null==r&&(r=this.DEFAULT_HASH),this.params={alg:r,issname:t,isskey:e,sbjsn:n}},this.setByCert=function(t,e,n){null==n&&(n=this.DEFAULT_HASH),this.params={alg:n,issuerCert:t,subjectCert:e}},this.getParamByCerts=function(t,e,n){null==n&&(n=this.DEFAULT_HASH);var r=new c(t),i=new c(e),s=u(r.getSubjectHex(),n),o=r.getPublicKeyHex();return{alg:n,issname:s,isskey:u(l(o,0,[1],"03",!0),n),sbjsn:i.getSerialNumberHex()}},this.tohex=function(){if("object"!=typeof this.params)throw new Error("params not set");var t,e,n,a,u=this.params;if(a=null==u.alg?this.DEFAULT_HASH:u.alg,null!=u.issuerCert&&null!=u.subjectCert){var c=this.getParamByCerts(u.issuerCert,u.subjectCert,a);t=c.issname,e=c.isskey,n=c.sbjsn}else{if(null==u.issname||null==u.isskey||null==u.sbjsn)throw new Error("required param members not defined");t=u.issname,e=u.isskey,n=u.sbjsn}var l=new o({name:a}),h=new r({hex:t}),f=new r({hex:e}),p=new i({hex:n}),d=new s({array:[l,h,f,p]});return this.hTLV=d.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.CertID,ut.asn1.ASN1Object),ut.asn1.ocsp.CertStatus=function(t){ut.asn1.ocsp.CertStatus.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if("good"==t.status)return"8000";if("unknown"==t.status)return"8200";if("revoked"==t.status){var e=[{gentime:{str:t.time}}];null!=t.reason&&e.push({tag:{tag:"a0",explicit:!0,obj:{enum:{int:t.reason}}}});var n={tag:"a1",explicit:!1,obj:{seq:e}};return ut.asn1.ASN1Util.newObject({tag:n}).tohex()}throw new Error("bad status")},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.CertStatus,ut.asn1.ASN1Object),ut.asn1.ocsp.Request=function(t){var e=ut.asn1,n=e.DERSequence,r=e.ocsp;if(r.Request.superclass.constructor.call(this),this.dReqCert=null,this.dExt=null,this.tohex=function(){var t=[];if(null===this.dReqCert)throw"reqCert not set";t.push(this.dReqCert);var e=new n({array:t});return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t){var i=new r.CertID(t);this.dReqCert=i}},Zt(ut.asn1.ocsp.Request,ut.asn1.ASN1Object),ut.asn1.ocsp.TBSRequest=function(t){var e=ut.asn1,n=e.DERSequence,r=e.ocsp;r.TBSRequest.superclass.constructor.call(this),this.version=0,this.dRequestorName=null,this.dRequestList=[],this.dRequestExt=null,this.setRequestListByParam=function(t){for(var e=[],n=0;n<t.length;n++){var i=new r.Request(t[0]);e.push(i)}this.dRequestList=e},this.tohex=function(){var t=[];if(0!==this.version)throw"not supported version: "+this.version;if(null!==this.dRequestorName)throw"requestorName not supported";var e=new n({array:this.dRequestList});if(t.push(e),null!==this.dRequestExt)throw"requestExtensions not supported";var r=new n({array:t});return this.hTLV=r.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&void 0!==t.reqList&&this.setRequestListByParam(t.reqList)},Zt(ut.asn1.ocsp.TBSRequest,ut.asn1.ASN1Object),ut.asn1.ocsp.OCSPRequest=function(t){var e=ut.asn1,n=e.DERSequence,r=e.ocsp;if(r.OCSPRequest.superclass.constructor.call(this),this.dTbsRequest=null,this.dOptionalSignature=null,this.tohex=function(){var t=[];if(null===this.dTbsRequest)throw"tbsRequest not set";if(t.push(this.dTbsRequest),null!==this.dOptionalSignature)throw"optionalSignature not supported";var e=new n({array:t});return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&void 0!==t.reqList){var i=new r.TBSRequest(t);this.dTbsRequest=i}},Zt(ut.asn1.ocsp.OCSPRequest,ut.asn1.ASN1Object),ut.asn1.ocsp.OCSPUtil={},ut.asn1.ocsp.OCSPUtil.getRequestHex=function(t,e,n){var r=ut.asn1.ocsp;void 0===n&&(n=r.DEFAULT_HASH);var i={alg:n,issuerCert:t,subjectCert:e};return new r.OCSPRequest({reqList:[i]}).tohex()},ut.asn1.ocsp.OCSPUtil.getOCSPResponseInfo=function(t){var e=ht,n=e.getVbyList,r=e.getVbyListEx,i=e.getIdxbyList,s=(e.getIdxbyListEx,e.getV),o={};try{var a=r(t,0,[0],"0a");o.responseStatus=parseInt(a,16)}catch(t){}if(0!==o.responseStatus)return o;try{var u=i(t,0,[1,0,1,0,0,2,0,1]);"80"===t.substr(u,2)?o.certStatus="good":"a1"===t.substr(u,2)?(o.certStatus="revoked",o.revocationTime=xt(n(t,u,[0]))):"82"===t.substr(u,2)&&(o.certStatus="unknown")}catch(t){}try{var c=i(t,0,[1,0,1,0,0,2,0,2]);o.thisUpdate=xt(s(t,c))}catch(t){}try{var l=i(t,0,[1,0,1,0,0,2,0,3]);"a0"===t.substr(l,2)&&(o.nextUpdate=xt(n(t,l,[0])))}catch(t){}return o},ut.asn1.ocsp.OCSPParser=function(){var t=Error,e=re,n=new e,r=ht,i=r.getV,s=r.getTLV,o=r.getIdxbyList,a=r.getVbyList,u=r.getTLVbyList,c=r.getVbyListEx,l=r.getTLVbyListEx,h=r.getChildIdx;this.getOCSPRequest=function(e){var n=h(e,0);if(1!=n.length&&2!=n.length)throw new t("wrong number elements: "+n.length);return this.getTBSRequest(s(e,n[0]))},this.getTBSRequest=function(t){var e={},r=l(t,0,[0],"30");e.array=this.getRequestList(r);var i=l(t,0,["[2]",0],"30");return null!=i&&(e.ext=n.getExtParamArray(i)),e},this.getRequestList=function(t){for(var e=[],n=h(t,0),r=0;r<n.length;r++){t=s(t,n[r]);e.push(this.getRequest(t))}return e},this.getRequest=function(e){var r=h(e,0);if(1!=r.length&&2!=r.length)throw new t("wrong number elements: "+r.length);var i=this.getCertID(s(e,r[0]));if(2==r.length){var a=o(e,0,[1,0]);i.ext=n.getExtParamArray(s(e,a))}return i},this.getCertID=function(n){var r=h(n,0);if(4!=r.length)throw new t("wrong number elements: "+r.length);var o=new e,a={};return a.alg=o.getAlgorithmIdentifierName(s(n,r[0])),a.issname=i(n,r[1]),a.isskey=i(n,r[2]),a.sbjsn=i(n,r[3]),a},this.getOCSPResponse=function(t){var e,n=h(t,0),r=i(t,n[0]),s=parseInt(r);if(1==n.length)return{resstatus:s};var o=u(t,0,[1,0]);return(e=this.getResponseBytes(o)).resstatus=s,e},this.getResponseBytes=function(t){var e,n=h(t,0),r=u(t,0,[1,0]);e=this.getBasicOCSPResponse(r);var s=i(t,n[0]);return e.restype=ut.asn1.x509.OID.oid2name(zt(s)),e},this.getBasicOCSPResponse=function(t){var e,n=h(t,0);e=this.getResponseData(s(t,n[0]));var r=new re;e.alg=r.getAlgorithmIdentifierName(s(t,n[1]));var o=i(t,n[2]);e.sighex=o.substr(2);var a=c(t,0,["[0]"]);if(null!=a){for(var u=h(a,0),l=[],f=0;f<u.length;f++){var p=s(a,u[f]);l.push(p)}e.certs=l}return e},this.getResponseData=function(t){var e=h(t,0),n=e.length,r={},o=0;"a0"==t.substr(e[0],2)&&o++,r.respid=this.getResponderID(s(t,e[o++]));var a=i(t,e[o++]);if(r.prodat=xt(a),r.array=this.getSingleResponseList(s(t,e[o++])),"a1"==t.substr(e[n-1],2)){var c=u(t,e[n-1],[0]),l=new re;r.ext=l.getExtParamArray(c)}return r},this.getResponderID=function(t){var e={};if("a2"==t.substr(0,2)){var n=a(t,0,[0]);e.key=n}if("a1"==t.substr(0,2)){var r=u(t,0,[0]),i=new re;e.name=i.getX500Name(r)}return e},this.getSingleResponseList=function(t){for(var e=h(t,0),n=[],r=0;r<e.length;r++){var i=this.getSingleResponse(s(t,e[r]));n.push(i)}return n},this.getSingleResponse=function(t){var e=h(t,0),n={},r=this.getCertID(s(t,e[0]));n.certid=r;var o=this.getCertStatus(s(t,e[1]));if(n.status=o,"18"==t.substr(e[2],2)){var c=i(t,e[2]);n.thisupdate=xt(c)}for(var l=3;l<e.length;l++){if("a0"==t.substr(e[l],2)){var f=a(t,e[l],[0],"18");n.nextupdate=xt(f)}if("a1"==t.substr(e[l],2)){var p=new re,d=u(t,0,[l,0]);n.ext=p.getExtParamArray(d)}}return n},this.getCertStatus=function(t){var e={};if("8000"==t)return{status:"good"};if("8200"==t)return{status:"unknown"};if("a1"==t.substr(0,2)){e.status="revoked";var n=xt(a(t,0,[0]));e.time=n}return e}},void 0!==ut&&ut||(ut={}),void 0!==ut.lang&&ut.lang||(ut.lang={}),ut.lang.String=function(){},"function"==typeof t?(ct=function(e){return mt(t.from(e,"utf8").toString("base64"))},lt=function(e){return t.from(vt(e),"base64").toString("utf8")}):(ct=function(t){return yt(_t(Mt(t)))},lt=function(t){return decodeURIComponent(Pt(bt(t)))}),ut.lang.String.isInteger=function(t){return!!t.match(/^[0-9]+$/)||!!t.match(/^-[0-9]+$/)},ut.lang.String.isHex=function(t){return Ut(t)},ut.lang.String.isBase64=function(t){return!(!(t=t.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||t.length%4!=0)},ut.lang.String.isBase64URL=function(t){return!t.match(/[+/=]/)&&(t=vt(t),ut.lang.String.isBase64(t))},ut.lang.String.isIntegerArray=function(t){return!!(t=t.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},ut.lang.String.isPrintable=function(t){return null!==t.match(/^[0-9A-Za-z '()+,-./:=?]*$/)},ut.lang.String.isIA5=function(t){return null!==t.match(/^[\x20-\x21\x23-\x7f]*$/)},ut.lang.String.isMail=function(t){return null!==t.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)};function Kt(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},n=function(t){var n="",r=parseInt(t,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var s="",o=0;o<i;o++)s+="0";r=s+r;for(o=0;o<r.length-1;o+=7){var a=r.substr(o,7);o!=r.length-7&&(a="1"+a),n+=e(parseInt(a,2))}return n};try{if(!t.match(/^[0-9.]+$/))return null;var r="",i=t.split("."),s=40*parseInt(i[0],10)+parseInt(i[1],10);r+=e(s),i.splice(0,2);for(var o=0;o<i.length;o++)r+=n(i[o]);return r}catch(t){return null}}function zt(t){if(!Ut(t))return null;try{var e=[],n=t.substr(0,2),r=parseInt(n,16);e[0]=new String(Math.floor(r/40)),e[1]=new String(r%40);for(var i=t.substr(2),s=[],o=0;o<i.length/2;o++)s.push(parseInt(i.substr(2*o,2),16));var a=[],u="";for(o=0;o<s.length;o++)128&s[o]?u+=Gt((127&s[o]).toString(2),7):(u+=Gt((127&s[o]).toString(2),7),a.push(new String(parseInt(u,2))),u="");var c=e.join(".");return a.length>0&&(c=c+"."+a.join(".")),c}catch(t){return null}}var Gt=function(t,e,n){return null==n&&(n="0"),t.length>=e?t:new Array(e-t.length+1).join(n)+t};function Wt(t){if(t.length%2!=0)return-1;if(null==(t=t.toLowerCase()).match(/^[0-9a-f]+$/))return-1;try{var e=t.substr(0,2);if("00"==e)return parseInt(t.substr(2),16);var n=parseInt(e,16);if(n>7)return-1;var r=t.substr(2),i=parseInt(r,16).toString(2);"0"==i&&(i="00000000"),i=i.slice(0,0-n);var s=parseInt(i,2);return NaN==s?-1:s}catch(t){return-1}}function Yt(t){if("number"!=typeof t)return null;if(t<0)return null;var e=Number(t).toString(2),n=8-e.length%8;8==n&&(n=0),e+=Gt("",n,"0");var r=parseInt(e,2).toString(16);return r.length%2==1&&(r="0"+r),"0"+n+r}function Xt(t){if("string"!=typeof t)return null;if(t.length%2!=0)return null;if(!t.match(/^[0-9a-f]+$/))return null;try{var e=parseInt(t.substr(0,2),16);if(e<0||7<e)return null;for(var n=t.substr(2),r="",i=0;i<n.length;i+=2){var s=n.substr(i,2),o=parseInt(s,16).toString(2);r+=o=("0000000"+o).slice(-8)}return r.substr(0,r.length-e)}catch(t){return null}}function Jt(t,e){for(var n=0,r=0;r<t.length;r++)n|=1<<e[t[r]];var i=n.toString(2),s="";for(r=i.length-1;r>=0;r--)s+=i[r];return s}function Zt(t,e){var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.superclass=e.prototype,e.prototype.constructor==Object.prototype.constructor&&(e.prototype.constructor=e)}void 0!==ut&&ut||(ut={}),void 0!==ut.crypto&&ut.crypto||(ut.crypto={}),ut.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:g.algo.MD5,sha1:g.algo.SHA1,sha224:g.algo.SHA224,sha256:g.algo.SHA256,sha384:g.algo.SHA384,sha512:g.algo.SHA512,ripemd160:g.algo.RIPEMD160},this.getDigestInfoHex=function(t,e){if(void 0===this.DIGESTINFOHEAD[e])throw"alg not supported in Util.DIGESTINFOHEAD: "+e;return this.DIGESTINFOHEAD[e]+t},this.getPaddedDigestInfoHex=function(t,e,n){var r=this.getDigestInfoHex(t,e),i=n/4;if(r.length+22>i)throw"key is too short for SigAlg: keylen="+n+","+e;for(var s="0001",o="00"+r,a="",u=i-s.length-o.length,c=0;c<u;c+=2)a+="ff";return s+a+o},this.hashString=function(t,e){return new ut.crypto.MessageDigest({alg:e}).digestString(t)},this.hashHex=function(t,e){return new ut.crypto.MessageDigest({alg:e}).digestHex(t)},this.sha1=function(t){return this.hashString(t,"sha1")},this.sha256=function(t){return this.hashString(t,"sha256")},this.sha256Hex=function(t){return this.hashHex(t,"sha256")},this.sha512=function(t){return this.hashString(t,"sha512")},this.sha512Hex=function(t){return this.hashHex(t,"sha512")},this.isKey=function(t){return t instanceof nt||t instanceof ut.crypto.DSA||t instanceof ut.crypto.ECDSA}},ut.crypto.Util.md5=function(t){return new ut.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(t)},ut.crypto.Util.ripemd160=function(t){return new ut.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(t)},ut.crypto.Util.SECURERANDOMGEN=new Q,ut.crypto.Util.getRandomHexOfNbytes=function(t){var e=new Array(t);return ut.crypto.Util.SECURERANDOMGEN.nextBytes(e),dt(e)},ut.crypto.Util.getRandomBigIntegerOfNbytes=function(t){return new x(ut.crypto.Util.getRandomHexOfNbytes(t),16)},ut.crypto.Util.getRandomHexOfNbits=function(t){var e=t%8,n=new Array((t-e)/8+1);return ut.crypto.Util.SECURERANDOMGEN.nextBytes(n),n[0]=(255<<e&255^255)&n[0],dt(n)},ut.crypto.Util.getRandomBigIntegerOfNbits=function(t){return new x(ut.crypto.Util.getRandomHexOfNbits(t),16)},ut.crypto.Util.getRandomBigIntegerZeroToMax=function(t){for(var e=t.bitLength();;){var n=ut.crypto.Util.getRandomBigIntegerOfNbits(e);if(-1!=t.compareTo(n))return n}},ut.crypto.Util.getRandomBigIntegerMinToMax=function(t,e){var n=t.compareTo(e);if(1==n)throw"biMin is greater than biMax";if(0==n)return t;var r=e.subtract(t);return ut.crypto.Util.getRandomBigIntegerZeroToMax(r).add(t)},ut.crypto.MessageDigest=function(t){this.setAlgAndProvider=function(t,e){if(null!==(t=ut.crypto.MessageDigest.getCanonicalAlgName(t))&&void 0===e&&(e=ut.crypto.Util.DEFAULTPROVIDER[t]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(t)&&"cryptojs"==e){try{this.md=ut.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[t].create()}catch(e){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+e}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var e=g.enc.Hex.parse(t);this.md.update(e)},this.digest=function(){return this.md.finalize().toString(g.enc.Hex)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}if(-1!=":sha256:".indexOf(t)&&"sjcl"==e){try{this.md=new sjcl.hash.sha256}catch(e){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+e}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var e=sjcl.codec.hex.toBits(t);this.md.update(e)},this.digest=function(){var t=this.md.finalize();return sjcl.codec.hex.fromBits(t)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==t&&void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=ut.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},ut.crypto.MessageDigest.getCanonicalAlgName=function(t){return"string"==typeof t&&(t=(t=t.toLowerCase()).replace(/-/,"")),t},ut.crypto.MessageDigest.getHashLength=function(t){var e=ut.crypto.MessageDigest,n=e.getCanonicalAlgName(t);if(void 0===e.HASHLENGTH[n])throw"not supported algorithm: "+t;return e.HASHLENGTH[n]},ut.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},ut.crypto.Mac=function(t){this.setAlgAndProvider=function(t,e){if(null==(t=t.toLowerCase())&&(t="hmacsha1"),"hmac"!=(t=t.toLowerCase()).substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+t;void 0===e&&(e=ut.crypto.Util.DEFAULTPROVIDER[t]),this.algProv=t+"/"+e;var n=t.substr(4);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(n)&&"cryptojs"==e){try{var r=ut.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[n];this.mac=g.algo.HMAC.create(r,this.pass)}catch(t){throw"setAlgAndProvider hash alg set fail hashAlg="+n+"/"+t}this.updateString=function(t){this.mac.update(t)},this.updateHex=function(t){var e=g.enc.Hex.parse(t);this.mac.update(e)},this.doFinal=function(){return this.mac.finalize().toString(g.enc.Hex)},this.doFinalString=function(t){return this.updateString(t),this.doFinal()},this.doFinalHex=function(t){return this.updateHex(t),this.doFinal()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algProv},this.doFinal=function(){throw"digest() not supported for this alg/prov: "+this.algProv},this.doFinalString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(t){if("string"==typeof t){var e=t;return t.length%2!=1&&t.match(/^[0-9A-Fa-f]+$/)||(e=Ft(t)),void(this.pass=g.enc.Hex.parse(e))}if("object"!=typeof t)throw"KJUR.crypto.Mac unsupported password type: "+t;e=null;if(void 0!==t.hex){if(t.hex.length%2!=0||!t.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+t.hex;e=t.hex}if(void 0!==t.utf8&&(e=wt(t.utf8)),void 0!==t.rstr&&(e=Ft(t.rstr)),void 0!==t.b64&&(e=b(t.b64)),void 0!==t.b64u&&(e=bt(t.b64u)),null==e)throw"KJUR.crypto.Mac unsupported password type: "+t;this.pass=g.enc.Hex.parse(e)},void 0!==t&&(void 0!==t.pass&&this.setPassword(t.pass),void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=ut.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},ut.crypto.Signature=function(t){var e=null;if(this._setAlgNames=function(){var t=this.algName.match(/^(.+)with(.+)$/);t&&(this.mdAlgName=t[1].toLowerCase(),this.pubkeyAlgName=t[2].toLowerCase(),"rsaandmgf1"==this.pubkeyAlgName&&"sha"==this.mdAlgName&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(t,e){for(var n="",r=e/4-t.length,i=0;i<r;i++)n+="0";return n+t},this.setAlgAndProvider=function(t,e){if(this._setAlgNames(),"cryptojs/jsrsa"!=e)throw new Error("provider not supported: "+e);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new ut.crypto.MessageDigest({alg:this.mdAlgName})}catch(t){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+t)}this.init=function(t,e){var n=null;try{n=void 0===e?Qt.getKey(t):Qt.getKey(t,e)}catch(t){throw"init failed:"+t}if(!0===n.isPrivate)this.prvKey=n,this.state="SIGN";else{if(!0!==n.isPublic)throw"init failed.:"+n;this.pubKey=n,this.state="VERIFY"}},this.updateString=function(t){this.md.updateString(t)},this.updateHex=function(t){this.md.updateHex(t)},this.sign=function(){if(this.sHashHex=this.md.digest(),void 0===this.prvKey&&void 0!==this.ecprvhex&&void 0!==this.eccurvename&&void 0!==ut.crypto.ECDSA&&(this.prvKey=new ut.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof nt&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof nt&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof ut.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof ut.crypto.DSA))throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(t){return this.updateString(t),this.sign()},this.signHex=function(t){return this.updateHex(t),this.sign()},this.verify=function(t){if(this.sHashHex=this.md.digest(),void 0===this.pubKey&&void 0!==this.ecpubhex&&void 0!==this.eccurvename&&void 0!==ut.crypto.ECDSA&&(this.pubKey=new ut.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof nt&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,t,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof nt&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==ut.crypto.ECDSA&&this.pubKey instanceof ut.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==ut.crypto.DSA&&this.pubKey instanceof ut.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(t,e){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(t){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName},this.signString=function(t){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(t){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(t){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=t,void 0!==t&&(void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov?this.provName=ut.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=t.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==t.psssaltlen&&(this.pssSaltLen=t.psssaltlen),void 0!==t.prvkeypem)){if(void 0!==t.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{e=Qt.getKey(t.prvkeypem);this.init(e)}catch(t){throw"fatal error to load pem private key: "+t}}},ut.crypto.Cipher=function(t){},ut.crypto.Cipher.encrypt=function(t,e,n){if(e instanceof nt&&e.isPublic){var r=ut.crypto.Cipher.getAlgByKeyAndName(e,n);if("RSA"===r)return e.encrypt(t);if("RSAOAEP"===r)return e.encryptOAEP(t,"sha1");var i=r.match(/^RSAOAEP(\d+)$/);if(null!==i)return e.encryptOAEP(t,"sha"+i[1]);throw"Cipher.encrypt: unsupported algorithm for RSAKey: "+n}throw"Cipher.encrypt: unsupported key or algorithm"},ut.crypto.Cipher.decrypt=function(t,e,n){if(e instanceof nt&&e.isPrivate){var r=ut.crypto.Cipher.getAlgByKeyAndName(e,n);if("RSA"===r)return e.decrypt(t);if("RSAOAEP"===r)return e.decryptOAEP(t,"sha1");var i=r.match(/^RSAOAEP(\d+)$/);if(null!==i)return e.decryptOAEP(t,"sha"+i[1]);throw"Cipher.decrypt: unsupported algorithm for RSAKey: "+n}throw"Cipher.decrypt: unsupported key or algorithm"},ut.crypto.Cipher.getAlgByKeyAndName=function(t,e){if(t instanceof nt){if(-1!=":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(e))return e;if(null==e)return"RSA";throw"getAlgByKeyAndName: not supported algorithm name for RSAKey: "+e}throw"getAlgByKeyAndName: not supported algorithm name: "+e},ut.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040022":"secp384r1","2b81040023":"secp521r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}},void 0!==ut&&ut||(ut={}),void 0!==ut.crypto&&ut.crypto||(ut.crypto={}),ut.crypto.ECDSA=function(t){var e=Error,n=x,r=st,i=ut.crypto.ECDSA,s=ut.crypto.ECParameterDB,o=i.getName,a=ht,u=a.getVbyListEx,c=a.isASN1HEX,l=new Q;this.type="EC",this.isPrivate=!1,this.isPublic=!1,this.getBigRandom=function(t){return new n(t.bitLength(),l).mod(t.subtract(n.ONE)).add(n.ONE)},this.setNamedCurve=function(t){this.ecparams=s.getByName(t),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=t},this.setPrivateKeyHex=function(t){this.isPrivate=!0,this.prvKeyHex=t},this.setPublicKeyHex=function(t){this.isPublic=!0,this.pubKeyHex=t},this.getPublicKeyXYHex=function(){var t=this.pubKeyHex;if("04"!==t.substr(0,2))throw"this method supports uncompressed format(04) only";var e=this.ecparams.keycharlen;if(t.length!==2+2*e)throw"malformed public key hex length";var n={};return n.x=t.substr(2,e),n.y=t.substr(2+e),n},this.getShortNISTPCurveName=function(){var t=this.curveName;return"secp256r1"===t||"NIST P-256"===t||"P-256"===t||"prime256v1"===t?"P-256":"secp384r1"===t||"NIST P-384"===t||"P-384"===t?"P-384":"secp521r1"===t||"NIST P-521"===t||"P-521"===t?"P-521":null},this.generateKeyPairHex=function(){var t=this.ecparams.n,e=this.getBigRandom(t),n=this.ecparams.keycharlen,r=("0000000000"+e.toString(16)).slice(-n);return this.setPrivateKeyHex(r),{ecprvhex:r,ecpubhex:this.generatePublicKeyHex()}},this.generatePublicKeyHex=function(){var t=new n(this.prvKeyHex,16),e=this.ecparams.G.multiply(t),r=e.getX().toBigInteger(),i=e.getY().toBigInteger(),s=this.ecparams.keycharlen,o="04"+("0000000000"+r.toString(16)).slice(-s)+("0000000000"+i.toString(16)).slice(-s);return this.setPublicKeyHex(o),o},this.signWithMessageHash=function(t){return this.signHex(t,this.prvKeyHex)},this.signHex=function(t,e){var r=new n(e,16),s=this.ecparams.n,o=new n(t.substring(0,this.ecparams.keycharlen),16);do{var a=this.getBigRandom(s),u=this.ecparams.G.multiply(a).getX().toBigInteger().mod(s)}while(u.compareTo(n.ZERO)<=0);var c=a.modInverse(s).multiply(o.add(r.multiply(u))).mod(s);return i.biRSSigToASN1Sig(u,c)},this.sign=function(t,e){var r=e,i=this.ecparams.n,s=n.fromByteArrayUnsigned(t);do{var o=this.getBigRandom(i),a=this.ecparams.G.multiply(o).getX().toBigInteger().mod(i)}while(a.compareTo(x.ZERO)<=0);var u=o.modInverse(i).multiply(s.add(r.multiply(a))).mod(i);return this.serializeSig(a,u)},this.verifyWithMessageHash=function(t,e){return this.verifyHex(t,e,this.pubKeyHex)},this.verifyHex=function(t,e,s){try{var o,a,u=i.parseSigHex(e);o=u.r,a=u.s;var c=r.decodeFromHex(this.ecparams.curve,s),l=new n(t.substring(0,this.ecparams.keycharlen),16);return this.verifyRaw(l,o,a,c)}catch(t){return!1}},this.verify=function(t,e,i){var s,o,a;if(Bitcoin.Util.isArray(e)){var u=this.parseSig(e);s=u.r,o=u.s}else{if("object"!=typeof e||!e.r||!e.s)throw"Invalid value for signature";s=e.r,o=e.s}if(i instanceof st)a=i;else{if(!Bitcoin.Util.isArray(i))throw"Invalid format for pubkey value, must be byte array or ECPointFp";a=r.decodeFrom(this.ecparams.curve,i)}var c=n.fromByteArrayUnsigned(t);return this.verifyRaw(c,s,o,a)},this.verifyRaw=function(t,e,r,i){var s=this.ecparams.n,o=this.ecparams.G;if(e.compareTo(n.ONE)<0||e.compareTo(s)>=0)return!1;if(r.compareTo(n.ONE)<0||r.compareTo(s)>=0)return!1;var a=r.modInverse(s),u=t.multiply(a).mod(s),c=e.multiply(a).mod(s);return o.multiply(u).add(i.multiply(c)).getX().toBigInteger().mod(s).equals(e)},this.serializeSig=function(t,e){var n=t.toByteArraySigned(),r=e.toByteArraySigned(),i=[];return i.push(2),i.push(n.length),(i=i.concat(n)).push(2),i.push(r.length),(i=i.concat(r)).unshift(i.length),i.unshift(48),i},this.parseSig=function(t){var e;if(48!=t[0])throw new Error("Signature not a valid DERSequence");if(2!=t[e=2])throw new Error("First element in signature must be a DERInteger");var r=t.slice(e+2,e+2+t[e+1]);if(2!=t[e+=2+t[e+1]])throw new Error("Second element in signature must be a DERInteger");var i=t.slice(e+2,e+2+t[e+1]);return e+=2+t[e+1],{r:n.fromByteArrayUnsigned(r),s:n.fromByteArrayUnsigned(i)}},this.parseSigCompact=function(t){if(65!==t.length)throw"Signature has the wrong length";var e=t[0]-27;if(e<0||e>7)throw"Invalid signature type";var r=this.ecparams.n;return{r:n.fromByteArrayUnsigned(t.slice(1,33)).mod(r),s:n.fromByteArrayUnsigned(t.slice(33,65)).mod(r),i:e}},this.readPKCS5PrvKeyHex=function(t){if(!1===c(t))throw new Error("not ASN.1 hex string");var e,n,r;try{e=u(t,0,["[0]",0],"06"),n=u(t,0,[1],"04");try{r=u(t,0,["[1]",0],"03")}catch(t){}}catch(t){throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=o(e),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(r),this.setPrivateKeyHex(n),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(t){if(!1===c(t))throw new e("not ASN.1 hex string");var n,r,i;try{u(t,0,[1,0],"06"),n=u(t,0,[1,1],"06"),r=u(t,0,[2,0,1],"04");try{i=u(t,0,[2,0,"[1]",0],"03")}catch(t){}}catch(t){throw new e("malformed PKCS#8 plain ECC private key")}if(this.curveName=o(n),void 0===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i),this.setPrivateKeyHex(r),this.isPublic=!1},this.readPKCS8PubKeyHex=function(t){if(!1===c(t))throw new e("not ASN.1 hex string");var n,r;try{u(t,0,[0,0],"06"),n=u(t,0,[0,1],"06"),r=u(t,0,[1],"03")}catch(t){throw new e("malformed PKCS#8 ECC public key")}if(this.curveName=o(n),null===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(r)},this.readCertPubKeyHex=function(t,n){if(!1===c(t))throw new e("not ASN.1 hex string");var r,i;try{r=u(t,0,[0,5,0,1],"06"),i=u(t,0,[0,5,1],"03")}catch(t){throw new e("malformed X.509 certificate ECC public key")}if(this.curveName=o(r),null===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i)},void 0!==t&&void 0!==t.curve&&(this.curveName=t.curve),void 0===this.curveName&&(this.curveName="secp256r1"),this.setNamedCurve(this.curveName),void 0!==t&&(void 0!==t.prv&&this.setPrivateKeyHex(t.prv),void 0!==t.pub&&this.setPublicKeyHex(t.pub))},ut.crypto.ECDSA.parseSigHex=function(t){var e=ut.crypto.ECDSA.parseSigHexInHexRS(t);return{r:new x(e.r,16),s:new x(e.s,16)}},ut.crypto.ECDSA.parseSigHexInHexRS=function(t){var e=ht,n=e.getChildIdx,r=e.getV;if(e.checkStrictDER(t,0),"30"!=t.substr(0,2))throw new Error("signature is not a ASN.1 sequence");var i=n(t,0);if(2!=i.length)throw new Error("signature shall have two elements");var s=i[0],o=i[1];if("02"!=t.substr(s,2))throw new Error("1st item not ASN.1 integer");if("02"!=t.substr(o,2))throw new Error("2nd item not ASN.1 integer");return{r:r(t,s),s:r(t,o)}},ut.crypto.ECDSA.asn1SigToConcatSig=function(t){var e=ut.crypto.ECDSA.parseSigHexInHexRS(t),n=e.r,r=e.s;if(n.length>=130&&n.length<=134){if(n.length%2!=0)throw Error("unknown ECDSA sig r length error");if(r.length%2!=0)throw Error("unknown ECDSA sig s length error");"00"==n.substr(0,2)&&(n=n.substr(2)),"00"==r.substr(0,2)&&(r=r.substr(2));var i=Math.max(n.length,r.length);return(n=("000000"+n).slice(-i))+(r=("000000"+r).slice(-i))}if("00"==n.substr(0,2)&&n.length%32==2&&(n=n.substr(2)),"00"==r.substr(0,2)&&r.length%32==2&&(r=r.substr(2)),n.length%32==30&&(n="00"+n),r.length%32==30&&(r="00"+r),n.length%32!=0)throw Error("unknown ECDSA sig r length error");if(r.length%32!=0)throw Error("unknown ECDSA sig s length error");return n+r},ut.crypto.ECDSA.concatSigToASN1Sig=function(t){if(t.length%4!=0)throw Error("unknown ECDSA concatinated r-s sig length error");var e=t.substr(0,t.length/2),n=t.substr(t.length/2);return ut.crypto.ECDSA.hexRSSigToASN1Sig(e,n)},ut.crypto.ECDSA.hexRSSigToASN1Sig=function(t,e){var n=new x(t,16),r=new x(e,16);return ut.crypto.ECDSA.biRSSigToASN1Sig(n,r)},ut.crypto.ECDSA.biRSSigToASN1Sig=function(t,e){var n=ut.asn1,r=new n.DERInteger({bigint:t}),i=new n.DERInteger({bigint:e});return new n.DERSequence({array:[r,i]}).tohex()},ut.crypto.ECDSA.getName=function(t){return"2b8104001f"===t?"secp192k1":"2a8648ce3d030107"===t?"secp256r1":"2b8104000a"===t?"secp256k1":"2b81040021"===t?"secp224r1":"2b81040022"===t?"secp384r1":"2b81040023"===t?"secp521r1":-1!=="|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(t)?"secp256r1":-1!=="|secp256k1|".indexOf(t)?"secp256k1":-1!=="|secp224r1|NIST P-224|P-224|".indexOf(t)?"secp224r1":-1!=="|secp384r1|NIST P-384|P-384|".indexOf(t)?"secp384r1":-1!=="|secp521r1|NIST P-521|P-521|".indexOf(t)?"secp521r1":null},void 0!==ut&&ut||(ut={}),void 0!==ut.crypto&&ut.crypto||(ut.crypto={}),ut.crypto.ECParameterDB=new function(){var t={},e={};function n(t){return new x(t,16)}this.getByName=function(n){var r=n;if(void 0!==e[r]&&(r=e[n]),void 0!==t[r])return t[r];throw"unregistered EC curve name: "+r},this.regist=function(r,i,s,o,a,u,c,l,h,f,p,d){t[r]={};var g=n(s),m=n(o),v=n(a),y=n(u),b=n(c),w=new ot(g,m,v),x=w.decodePointHex("04"+l+h);t[r].name=r,t[r].keylen=i,t[r].keycharlen=2*Math.ceil(i/8),t[r].curve=w,t[r].G=x,t[r].n=y,t[r].h=b,t[r].oid=p,t[r].info=d;for(var S=0;S<f.length;S++)e[f[S]]=r}},ut.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field"),ut.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field"),ut.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field"),ut.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]),ut.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]),ut.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]),ut.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]),ut.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]),ut.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]),ut.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]),void 0!==ut&&ut||(ut={}),void 0!==ut.crypto&&ut.crypto||(ut.crypto={}),ut.crypto.DSA=function(){var t=ht,e=(t.getVbyList,t.getVbyListEx),n=t.isASN1HEX,r=x;this.p=null,this.q=null,this.g=null,this.y=null,this.x=null,this.type="DSA",this.isPrivate=!1,this.isPublic=!1,this.setPrivate=function(t,e,n,r,i){this.isPrivate=!0,this.p=t,this.q=e,this.g=n,this.y=r,this.x=i},this.setPrivateHex=function(t,e,n,r,i){var s,o,a,u,c;s=new x(t,16),o=new x(e,16),a=new x(n,16),u="string"==typeof r&&r.length>1?new x(r,16):null,c=new x(i,16),this.setPrivate(s,o,a,u,c)},this.setPublic=function(t,e,n,r){this.isPublic=!0,this.p=t,this.q=e,this.g=n,this.y=r,this.x=null},this.setPublicHex=function(t,e,n,r){var i,s,o,a;i=new x(t,16),s=new x(e,16),o=new x(n,16),a=new x(r,16),this.setPublic(i,s,o,a)},this.signWithMessageHash=function(t){var e=this.p,n=this.q,r=this.g,i=(this.y,this.x),s=ut.crypto.Util.getRandomBigIntegerMinToMax(x.ONE.add(x.ONE),n.subtract(x.ONE)),o=new x(t.substr(0,n.bitLength()/4),16),a=r.modPow(s,e).mod(n),u=s.modInverse(n).multiply(o.add(i.multiply(a))).mod(n);return ut.asn1.ASN1Util.jsonToASN1HEX({seq:[{int:{bigint:a}},{int:{bigint:u}}]})},this.verifyWithMessageHash=function(t,e){var n=this.p,r=this.q,i=this.g,s=this.y,o=this.parseASN1Signature(e),a=o[0],u=o[1],c=new x(t.substr(0,r.bitLength()/4),16);if(x.ZERO.compareTo(a)>0||a.compareTo(r)>0)throw"invalid DSA signature";if(x.ZERO.compareTo(u)>=0||u.compareTo(r)>0)throw"invalid DSA signature";var l=u.modInverse(r),h=c.multiply(l).mod(r),f=a.multiply(l).mod(r);return 0==i.modPow(h,n).multiply(s.modPow(f,n)).mod(n).mod(r).compareTo(a)},this.parseASN1Signature=function(t){try{return[new r(e(t,0,[0],"02"),16),new r(e(t,0,[1],"02"),16)]}catch(t){throw new Error("malformed ASN.1 DSA signature")}},this.readPKCS5PrvKeyHex=function(t){var r,i,s,o,a;if(!1===n(t))throw new Error("not ASN.1 hex string");try{r=e(t,0,[1],"02"),i=e(t,0,[2],"02"),s=e(t,0,[3],"02"),o=e(t,0,[4],"02"),a=e(t,0,[5],"02")}catch(t){throw new Error("malformed PKCS#1/5 plain DSA private key")}this.setPrivateHex(r,i,s,o,a)},this.readPKCS8PrvKeyHex=function(t){var r,i,s,o;if(!1===n(t))throw new Error("not ASN.1 hex string");try{r=e(t,0,[1,1,0],"02"),i=e(t,0,[1,1,1],"02"),s=e(t,0,[1,1,2],"02"),o=e(t,0,[2,0],"02")}catch(t){throw new Error("malformed PKCS#8 plain DSA private key")}this.setPrivateHex(r,i,s,null,o)},this.readPKCS8PubKeyHex=function(t){var r,i,s,o;if(!1===n(t))throw new Error("not ASN.1 hex string");try{r=e(t,0,[0,1,0],"02"),i=e(t,0,[0,1,1],"02"),s=e(t,0,[0,1,2],"02"),o=e(t,0,[1,0],"02")}catch(t){throw new Error("malformed PKCS#8 DSA public key")}this.setPublicHex(r,i,s,o)},this.readCertPubKeyHex=function(t,r){var i,s,o,a;if(!1===n(t))throw new Error("not ASN.1 hex string");try{i=e(t,0,[0,5,0,1,0],"02"),s=e(t,0,[0,5,0,1,1],"02"),o=e(t,0,[0,5,0,1,2],"02"),a=e(t,0,[0,5,1,0],"02")}catch(t){throw new Error("malformed X.509 certificate DSA public key")}this.setPublicHex(i,s,o,a)}};var Qt=function(){var t=function(t,n,r){return e(g.AES,t,n,r)},e=function(t,e,n,r){var i=g.enc.Hex.parse(e),s=g.enc.Hex.parse(n),o=g.enc.Hex.parse(r),a={};a.key=s,a.iv=o,a.ciphertext=i;var u=t.decrypt(a,s,{iv:o});return g.enc.Hex.stringify(u)},n=function(t,e,n){return r(g.AES,t,e,n)},r=function(t,e,n,r){var i=g.enc.Hex.parse(e),s=g.enc.Hex.parse(n),o=g.enc.Hex.parse(r),a=t.encrypt(i,s,{iv:o}),u=g.enc.Hex.parse(a.toString());return g.enc.Base64.stringify(u)},i={"AES-256-CBC":{proc:t,eproc:n,keylen:32,ivlen:16},"AES-192-CBC":{proc:t,eproc:n,keylen:24,ivlen:16},"AES-128-CBC":{proc:t,eproc:n,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(t,n,r){return e(g.TripleDES,t,n,r)},eproc:function(t,e,n){return r(g.TripleDES,t,e,n)},keylen:24,ivlen:8},"DES-CBC":{proc:function(t,n,r){return e(g.DES,t,n,r)},eproc:function(t,e,n){return r(g.DES,t,e,n)},keylen:8,ivlen:8}},s=function(t){var e={},n=t.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));n&&(e.cipher=n[1],e.ivsalt=n[2]);var r=t.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));r&&(e.type=r[1]);var i=-1,s=0;-1!=t.indexOf("\r\n\r\n")&&(i=t.indexOf("\r\n\r\n"),s=2),-1!=t.indexOf("\n\n")&&(i=t.indexOf("\n\n"),s=1);var o=t.indexOf("-----END");if(-1!=i&&-1!=o){var a=t.substring(i+2*s,o-s);a=a.replace(/\s+/g,""),e.data=a}return e},o=function(t,e,n){for(var r=n.substring(0,16),s=g.enc.Hex.parse(r),o=g.enc.Utf8.parse(e),a=i[t].keylen+i[t].ivlen,u="",c=null;;){var l=g.algo.MD5.create();if(null!=c&&l.update(c),l.update(o),l.update(s),c=l.finalize(),(u+=g.enc.Hex.stringify(c)).length>=2*a)break}var h={};return h.keyhex=u.substr(0,2*i[t].keylen),h.ivhex=u.substr(2*i[t].keylen,2*i[t].ivlen),h},a=function(t,e,n,r){var s=g.enc.Base64.parse(t),o=g.enc.Hex.stringify(s);return(0,i[e].proc)(o,n,r)};return{version:"1.0.0",parsePKCS5PEM:function(t){return s(t)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(t,e,n){return o(t,e,n)},decryptKeyB64:function(t,e,n,r){return a(t,e,n,r)},getDecryptedKeyHex:function(t,e){var n=s(t),r=(n.type,n.cipher),i=n.ivsalt,u=n.data,c=o(r,e,i).keyhex;return a(u,r,c,i)},getEncryptedPKCS5PEMFromPrvKeyHex:function(t,e,n,r,s){var a="";if(void 0!==r&&null!=r||(r="AES-256-CBC"),void 0===i[r])throw new Error("KEYUTIL unsupported algorithm: "+r);void 0!==s&&null!=s||(s=function(t){var e=g.lib.WordArray.random(t);return g.enc.Hex.stringify(e)}(i[r].ivlen).toUpperCase());var u=function(t,e,n,r){return(0,i[e].eproc)(t,n,r)}(e,r,o(r,n,s).keyhex,s);a="-----BEGIN "+t+" PRIVATE KEY-----\r\n";return a+="Proc-Type: 4,ENCRYPTED\r\n",a+="DEK-Info: "+r+","+s+"\r\n",a+="\r\n",a+=u.replace(/(.{64})/g,"$1\r\n"),a+="\r\n-----END "+t+" PRIVATE KEY-----\r\n"},parseHexOfEncryptedPKCS8:function(t){var e=ht,n=e.getChildIdx,r=e.getV,i={},s=n(t,0);if(2!=s.length)throw new Error("malformed format: SEQUENCE(0).items != 2: "+s.length);i.ciphertext=r(t,s[1]);var o=n(t,s[0]);if(2!=o.length)throw new Error("malformed format: SEQUENCE(0.0).items != 2: "+o.length);if("2a864886f70d01050d"!=r(t,o[0]))throw new Error("this only supports pkcs5PBES2");var a=n(t,o[1]);if(2!=o.length)throw new Error("malformed format: SEQUENCE(0.0.1).items != 2: "+a.length);var u=n(t,a[1]);if(2!=u.length)throw new Error("malformed format: SEQUENCE(0.0.1.1).items != 2: "+u.length);if("2a864886f70d0307"!=r(t,u[0]))throw"this only supports TripleDES";i.encryptionSchemeAlg="TripleDES",i.encryptionSchemeIV=r(t,u[1]);var c=n(t,a[0]);if(2!=c.length)throw new Error("malformed format: SEQUENCE(0.0.1.0).items != 2: "+c.length);if("2a864886f70d01050c"!=r(t,c[0]))throw new Error("this only supports pkcs5PBKDF2");var l=n(t,c[1]);if(l.length<2)throw new Error("malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+l.length);i.pbkdf2Salt=r(t,l[0]);var h=r(t,l[1]);try{i.pbkdf2Iter=parseInt(h,16)}catch(t){throw new Error("malformed format pbkdf2Iter: "+h)}return i},getPBKDF2KeyHexFromParam:function(t,e){var n=g.enc.Hex.parse(t.pbkdf2Salt),r=t.pbkdf2Iter,i=g.PBKDF2(e,n,{keySize:6,iterations:r});return g.enc.Hex.stringify(i)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(t,e){var n=$t(t,"ENCRYPTED PRIVATE KEY"),r=this.parseHexOfEncryptedPKCS8(n),i=Qt.getPBKDF2KeyHexFromParam(r,e),s={};s.ciphertext=g.enc.Hex.parse(r.ciphertext);var o=g.enc.Hex.parse(i),a=g.enc.Hex.parse(r.encryptionSchemeIV),u=g.TripleDES.decrypt(s,o,{iv:a});return g.enc.Hex.stringify(u)},getKeyFromEncryptedPKCS8PEM:function(t,e){var n=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(t,e);return this.getKeyFromPlainPrivatePKCS8Hex(n)},parsePlainPrivatePKCS8Hex:function(t){var e=ht,n=e.getChildIdx,r=e.getV,i={algparam:null};if("30"!=t.substr(0,2))throw new Error("malformed plain PKCS8 private key(code:001)");var s=n(t,0);if(s.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if("30"!=t.substr(s[1],2))throw new Error("malformed PKCS8 private key(code:003)");var o=n(t,s[1]);if(2!=o.length)throw new Error("malformed PKCS8 private key(code:004)");if("06"!=t.substr(o[0],2))throw new Error("malformed PKCS8 private key(code:005)");if(i.algoid=r(t,o[0]),"06"==t.substr(o[1],2)&&(i.algparam=r(t,o[1])),"04"!=t.substr(s[2],2))throw new Error("malformed PKCS8 private key(code:006)");return i.keyidx=e.getVidx(t,s[2]),i},getKeyFromPlainPrivatePKCS8PEM:function(t){var e=$t(t,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(e)},getKeyFromPlainPrivatePKCS8Hex:function(t){var e,n=this.parsePlainPrivatePKCS8Hex(t);if("2a864886f70d010101"==n.algoid)e=new nt;else if("2a8648ce380401"==n.algoid)e=new ut.crypto.DSA;else{if("2a8648ce3d0201"!=n.algoid)throw new Error("unsupported private key algorithm");e=new ut.crypto.ECDSA}return e.readPKCS8PrvKeyHex(t),e},_getKeyFromPublicPKCS8Hex:function(t){var e,n=ht.getVbyList(t,0,[0,0],"06");if("2a864886f70d010101"===n)e=new nt;else if("2a8648ce380401"===n)e=new ut.crypto.DSA;else{if("2a8648ce3d0201"!==n)throw new Error("unsupported PKCS#8 public key hex");e=new ut.crypto.ECDSA}return e.readPKCS8PubKeyHex(t),e},parsePublicRawRSAKeyHex:function(t){var e=ht,n=e.getChildIdx,r=e.getV,i={};if("30"!=t.substr(0,2))throw new Error("malformed RSA key(code:001)");var s=n(t,0);if(2!=s.length)throw new Error("malformed RSA key(code:002)");if("02"!=t.substr(s[0],2))throw new Error("malformed RSA key(code:003)");if(i.n=r(t,s[0]),"02"!=t.substr(s[1],2))throw new Error("malformed RSA key(code:004)");return i.e=r(t,s[1]),i},parsePublicPKCS8Hex:function(t){var e=ht,n=e.getChildIdx,r=e.getV,i={algparam:null},s=n(t,0);if(2!=s.length)throw new Error("outer DERSequence shall have 2 elements: "+s.length);var o=s[0];if("30"!=t.substr(o,2))throw new Error("malformed PKCS8 public key(code:001)");var a=n(t,o);if(2!=a.length)throw new Error("malformed PKCS8 public key(code:002)");if("06"!=t.substr(a[0],2))throw new Error("malformed PKCS8 public key(code:003)");if(i.algoid=r(t,a[0]),"06"==t.substr(a[1],2)?i.algparam=r(t,a[1]):"30"==t.substr(a[1],2)&&(i.algparam={},i.algparam.p=e.getVbyList(t,a[1],[0],"02"),i.algparam.q=e.getVbyList(t,a[1],[1],"02"),i.algparam.g=e.getVbyList(t,a[1],[2],"02")),"03"!=t.substr(s[1],2))throw new Error("malformed PKCS8 public key(code:004)");return i.key=r(t,s[1]).substr(2),i}}}();Qt.getKey=function(t,e,n){var r=(m=ht).getChildIdx,i=(m.getV,m.getVbyList),s=ut.crypto,o=s.ECDSA,a=s.DSA,u=nt,c=$t,l=Qt;if(void 0!==u&&t instanceof u)return t;if(void 0!==o&&t instanceof o)return t;if(void 0!==a&&t instanceof a)return t;if(void 0!==t.curve&&void 0!==t.xy&&void 0===t.d)return new o({pub:t.xy,curve:t.curve});if(void 0!==t.curve&&void 0!==t.d)return new o({prv:t.d,curve:t.curve});if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d)return(I=new u).setPublic(t.n,t.e),I;if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0!==t.p&&void 0!==t.q&&void 0!==t.dp&&void 0!==t.dq&&void 0!==t.co&&void 0===t.qi)return(I=new u).setPrivateEx(t.n,t.e,t.d,t.p,t.q,t.dp,t.dq,t.co),I;if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0===t.p)return(I=new u).setPrivate(t.n,t.e,t.d),I;if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0===t.x)return(I=new a).setPublic(t.p,t.q,t.g,t.y),I;if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0!==t.x)return(I=new a).setPrivate(t.p,t.q,t.g,t.y,t.x),I;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d)return(I=new u).setPublic(bt(t.n),bt(t.e)),I;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0!==t.p&&void 0!==t.q&&void 0!==t.dp&&void 0!==t.dq&&void 0!==t.qi)return(I=new u).setPrivateEx(bt(t.n),bt(t.e),bt(t.d),bt(t.p),bt(t.q),bt(t.dp),bt(t.dq),bt(t.qi)),I;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d)return(I=new u).setPrivate(bt(t.n),bt(t.e),bt(t.d)),I;if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0===t.d){var h=(D=new o({curve:t.crv})).ecparams.keycharlen,f="04"+("0000000000"+bt(t.x)).slice(-h)+("0000000000"+bt(t.y)).slice(-h);return D.setPublicKeyHex(f),D}if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0!==t.d){h=(D=new o({curve:t.crv})).ecparams.keycharlen,f="04"+("0000000000"+bt(t.x)).slice(-h)+("0000000000"+bt(t.y)).slice(-h);var p=("0000000000"+bt(t.d)).slice(-h);return D.setPublicKeyHex(f),D.setPrivateKeyHex(p),D}if("pkcs5prv"===n){var d,g=t,m=ht;if(9===(d=r(g,0)).length)(I=new u).readPKCS5PrvKeyHex(g);else if(6===d.length)(I=new a).readPKCS5PrvKeyHex(g);else{if(!(d.length>2&&"04"===g.substr(d[1],2)))throw new Error("unsupported PKCS#1/5 hexadecimal key");(I=new o).readPKCS5PrvKeyHex(g)}return I}if("pkcs8prv"===n)return I=l.getKeyFromPlainPrivatePKCS8Hex(t);if("pkcs8pub"===n)return l._getKeyFromPublicPKCS8Hex(t);if("x509pub"===n)return re.getPublicKeyFromCertHex(t);if(-1!=t.indexOf("-END CERTIFICATE-",0)||-1!=t.indexOf("-END X509 CERTIFICATE-",0)||-1!=t.indexOf("-END TRUSTED CERTIFICATE-",0))return re.getPublicKeyFromCertPEM(t);if(-1!=t.indexOf("-END PUBLIC KEY-")){var v=$t(t,"PUBLIC KEY");return l._getKeyFromPublicPKCS8Hex(v)}if(-1!=t.indexOf("-END RSA PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){var y=c(t,"RSA PRIVATE KEY");return l.getKey(y,null,"pkcs5prv")}if(-1!=t.indexOf("-END DSA PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){var b=i(T=c(t,"DSA PRIVATE KEY"),0,[1],"02"),w=i(T,0,[2],"02"),S=i(T,0,[3],"02"),E=i(T,0,[4],"02"),F=i(T,0,[5],"02");return(I=new a).setPrivate(new x(b,16),new x(w,16),new x(S,16),new x(E,16),new x(F,16)),I}if(-1!=t.indexOf("-END EC PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){y=c(t,"EC PRIVATE KEY");return l.getKey(y,null,"pkcs5prv")}if(-1!=t.indexOf("-END PRIVATE KEY-"))return l.getKeyFromPlainPrivatePKCS8PEM(t);if(-1!=t.indexOf("-END RSA PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var A=l.getDecryptedKeyHex(t,e),C=new nt;return C.readPKCS5PrvKeyHex(A),C}if(-1!=t.indexOf("-END EC PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var D,I=i(T=l.getDecryptedKeyHex(t,e),0,[1],"04"),$=i(T,0,[2,0],"06"),R=i(T,0,[3,0],"03").substr(2);if(void 0===ut.crypto.OID.oidhex2name[$])throw new Error("undefined OID(hex) in KJUR.crypto.OID: "+$);return(D=new o({curve:ut.crypto.OID.oidhex2name[$]})).setPublicKeyHex(R),D.setPrivateKeyHex(I),D.isPublic=!1,D}if(-1!=t.indexOf("-END DSA PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var T;b=i(T=l.getDecryptedKeyHex(t,e),0,[1],"02"),w=i(T,0,[2],"02"),S=i(T,0,[3],"02"),E=i(T,0,[4],"02"),F=i(T,0,[5],"02");return(I=new a).setPrivate(new x(b,16),new x(w,16),new x(S,16),new x(E,16),new x(F,16)),I}if(-1!=t.indexOf("-END ENCRYPTED PRIVATE KEY-"))return l.getKeyFromEncryptedPKCS8PEM(t,e);throw new Error("not supported argument")},Qt.generateKeypair=function(t,e){if("RSA"==t){var n=e;(o=new nt).generate(n,"10001"),o.isPrivate=!0,o.isPublic=!0;var r=new nt,i=o.n.toString(16),s=o.e.toString(16);return r.setPublic(i,s),r.isPrivate=!1,r.isPublic=!0,(a={}).prvKeyObj=o,a.pubKeyObj=r,a}if("EC"==t){var o,a,u=e,c=new ut.crypto.ECDSA({curve:u}).generateKeyPairHex();return(o=new ut.crypto.ECDSA({curve:u})).setPublicKeyHex(c.ecpubhex),o.setPrivateKeyHex(c.ecprvhex),o.isPrivate=!0,o.isPublic=!1,(r=new ut.crypto.ECDSA({curve:u})).setPublicKeyHex(c.ecpubhex),r.isPrivate=!1,r.isPublic=!0,(a={}).prvKeyObj=o,a.pubKeyObj=r,a}throw new Error("unknown algorithm: "+t)},Qt.getPEM=function(t,e,n,r,i,s){var o=ut,a=o.asn1,u=a.DERObjectIdentifier,c=a.DERInteger,l=a.ASN1Util.newObject,h=a.x509.SubjectPublicKeyInfo,f=o.crypto,p=f.DSA,d=f.ECDSA,m=nt;function v(t){return l({seq:[{int:0},{int:{bigint:t.n}},{int:t.e},{int:{bigint:t.d}},{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.dmp1}},{int:{bigint:t.dmq1}},{int:{bigint:t.coeff}}]})}function y(t){return l({seq:[{int:1},{octstr:{hex:t.prvKeyHex}},{tag:["a0",!0,{oid:{name:t.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]}]})}function b(t){return l({seq:[{int:0},{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}},{int:{bigint:t.y}},{int:{bigint:t.x}}]})}if((void 0!==m&&t instanceof m||void 0!==p&&t instanceof p||void 0!==d&&t instanceof d)&&1==t.isPublic&&(void 0===e||"PKCS8PUB"==e))return It(E=new h(t).tohex(),"PUBLIC KEY");if("PKCS1PRV"==e&&void 0!==m&&t instanceof m&&(void 0===n||null==n)&&1==t.isPrivate)return It(E=v(t).tohex(),"RSA PRIVATE KEY");if("PKCS1PRV"==e&&void 0!==d&&t instanceof d&&(void 0===n||null==n)&&1==t.isPrivate){var w=new u({name:t.curveName}).tohex(),x=y(t).tohex(),S="";return S+=It(w,"EC PARAMETERS"),S+=It(x,"EC PRIVATE KEY")}if("PKCS1PRV"==e&&void 0!==p&&t instanceof p&&(void 0===n||null==n)&&1==t.isPrivate)return It(E=b(t).tohex(),"DSA PRIVATE KEY");if("PKCS5PRV"==e&&void 0!==m&&t instanceof m&&void 0!==n&&null!=n&&1==t.isPrivate){var E=v(t).tohex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",E,n,r,s)}if("PKCS5PRV"==e&&void 0!==d&&t instanceof d&&void 0!==n&&null!=n&&1==t.isPrivate){E=y(t).tohex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",E,n,r,s)}if("PKCS5PRV"==e&&void 0!==p&&t instanceof p&&void 0!==n&&null!=n&&1==t.isPrivate){E=b(t).tohex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",E,n,r,s)}var F=function(t,e){var n=A(t,e);return new l({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:n.pbkdf2Salt}},{int:n.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:n.encryptionSchemeIV}}]}]}]},{octstr:{hex:n.ciphertext}}]}).tohex()},A=function(t,e){var n=g.lib.WordArray.random(8),r=g.lib.WordArray.random(8),i=g.PBKDF2(e,n,{keySize:6,iterations:100}),s=g.enc.Hex.parse(t),o=g.TripleDES.encrypt(s,i,{iv:r})+"",a={};return a.ciphertext=o,a.pbkdf2Salt=g.enc.Hex.stringify(n),a.pbkdf2Iter=100,a.encryptionSchemeAlg="DES-EDE3-CBC",a.encryptionSchemeIV=g.enc.Hex.stringify(r),a};if("PKCS8PRV"==e&&null!=m&&t instanceof m&&1==t.isPrivate){var C=v(t).tohex();E=l({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:C}}]}).tohex();return void 0===n||null==n?It(E,"PRIVATE KEY"):It(x=F(E,n),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==e&&void 0!==d&&t instanceof d&&1==t.isPrivate){var D={seq:[{int:1},{octstr:{hex:t.prvKeyHex}}]};"string"==typeof t.pubKeyHex&&D.seq.push({tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]});C=new l(D).tohex(),E=l({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:t.curveName}}]},{octstr:{hex:C}}]}).tohex();return void 0===n||null==n?It(E,"PRIVATE KEY"):It(x=F(E,n),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==e&&void 0!==p&&t instanceof p&&1==t.isPrivate){C=new c({bigint:t.x}).tohex(),E=l({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}}]}]},{octstr:{hex:C}}]}).tohex();return void 0===n||null==n?It(E,"PRIVATE KEY"):It(x=F(E,n),"ENCRYPTED PRIVATE KEY")}throw new Error("unsupported object nor format")},Qt.getKeyFromCSRPEM=function(t){var e=$t(t,"CERTIFICATE REQUEST");return Qt.getKeyFromCSRHex(e)},Qt.getKeyFromCSRHex=function(t){var e=Qt.parseCSRHex(t);return Qt.getKey(e.p8pubkeyhex,null,"pkcs8pub")},Qt.parseCSRHex=function(t){var e=ht,n=e.getChildIdx,r=e.getTLV,i={},s=t;if("30"!=s.substr(0,2))throw new Error("malformed CSR(code:001)");var o=n(s,0);if(o.length<1)throw new Error("malformed CSR(code:002)");if("30"!=s.substr(o[0],2))throw new Error("malformed CSR(code:003)");var a=n(s,o[0]);if(a.length<3)throw new Error("malformed CSR(code:004)");return i.p8pubkeyhex=r(s,a[2]),i},Qt.getKeyID=function(t){var e=Qt,n=ht;"string"==typeof t&&-1!=t.indexOf("BEGIN ")&&(t=e.getKey(t));var r=$t(e.getPEM(t)),i=n.getIdxbyList(r,0,[1]),s=n.getV(r,i).substring(2);return ut.crypto.Util.hashHex(s,"sha1")},Qt.getJWK=function(t,e,n,r,i){var s,o,a={},u=ut.crypto.Util.hashHex;if("string"==typeof t)s=Qt.getKey(t),-1!=t.indexOf("CERTIFICATE")&&(o=$t(t));else{if("object"!=typeof t)throw new Error("unsupported keyinfo type");t instanceof re?(s=t.getPublicKey(),o=t.hex):s=t}if(s instanceof nt&&s.isPrivate)a.kty="RSA",a.n=yt(s.n.toString(16)),a.e=yt(s.e.toString(16)),a.d=yt(s.d.toString(16)),a.p=yt(s.p.toString(16)),a.q=yt(s.q.toString(16)),a.dp=yt(s.dmp1.toString(16)),a.dq=yt(s.dmq1.toString(16)),a.qi=yt(s.coeff.toString(16));else if(s instanceof nt&&s.isPublic)a.kty="RSA",a.n=yt(s.n.toString(16)),a.e=yt(s.e.toString(16));else if(s instanceof ut.crypto.ECDSA&&s.isPrivate){if("P-256"!==(l=s.getShortNISTPCurveName())&&"P-384"!==l&&"P-521"!==l)throw new Error("unsupported curve name for JWT: "+l);var c=s.getPublicKeyXYHex();a.kty="EC",a.crv=l,a.x=yt(c.x),a.y=yt(c.y),a.d=yt(s.prvKeyHex)}else if(s instanceof ut.crypto.ECDSA&&s.isPublic){var l;if("P-256"!==(l=s.getShortNISTPCurveName())&&"P-384"!==l&&"P-521"!==l)throw new Error("unsupported curve name for JWT: "+l);c=s.getPublicKeyXYHex();a.kty="EC",a.crv=l,a.x=yt(c.x),a.y=yt(c.y)}if(null==a.kty)throw new Error("unsupported keyinfo");return s.isPrivate||1==e||(a.kid=ut.jws.JWS.getJWKthumbprint(a)),null!=o&&1!=n&&(a.x5c=[y(o)]),null!=o&&1!=r&&(a.x5t=mt(y(u(o,"sha1")))),null!=o&&1!=i&&(a["x5t#S256"]=mt(y(u(o,"sha256")))),a},Qt.getJWKFromKey=function(t){return Qt.getJWK(t,!0,!0,!0,!0)},nt.getPosArrayOfChildrenFromHex=function(t){return ht.getChildIdx(t,0)},nt.getHexValueArrayOfChildrenFromHex=function(t){var e,n=ht.getV,r=n(t,(e=nt.getPosArrayOfChildrenFromHex(t))[0]),i=n(t,e[1]),s=n(t,e[2]),o=n(t,e[3]),a=n(t,e[4]),u=n(t,e[5]),c=n(t,e[6]),l=n(t,e[7]),h=n(t,e[8]);return(e=new Array).push(r,i,s,o,a,u,c,l,h),e},nt.prototype.readPrivateKeyFromPEMString=function(t){var e=$t(t),n=nt.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8])},nt.prototype.readPKCS5PrvKeyHex=function(t){var e=nt.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},nt.prototype.readPKCS8PrvKeyHex=function(t){var e,n,r,i,s,o,a,u,c=ht,l=c.getVbyListEx;if(!1===c.isASN1HEX(t))throw new Error("not ASN.1 hex string");try{e=l(t,0,[2,0,1],"02"),n=l(t,0,[2,0,2],"02"),r=l(t,0,[2,0,3],"02"),i=l(t,0,[2,0,4],"02"),s=l(t,0,[2,0,5],"02"),o=l(t,0,[2,0,6],"02"),a=l(t,0,[2,0,7],"02"),u=l(t,0,[2,0,8],"02")}catch(t){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(e,n,r,i,s,o,a,u)},nt.prototype.readPKCS5PubKeyHex=function(t){var e=ht,n=e.getV;if(!1===e.isASN1HEX(t))throw new Error("keyHex is not ASN.1 hex string");var r=e.getChildIdx(t,0);if(2!==r.length||"02"!==t.substr(r[0],2)||"02"!==t.substr(r[1],2))throw new Error("wrong hex for PKCS#5 public key");var i=n(t,r[0]),s=n(t,r[1]);this.setPublic(i,s)},nt.prototype.readPKCS8PubKeyHex=function(t){var e=ht;if(!1===e.isASN1HEX(t))throw new Error("not ASN.1 hex string");if("06092a864886f70d010101"!==e.getTLVbyListEx(t,0,[0,0]))throw new Error("not PKCS8 RSA public key");var n=e.getTLVbyListEx(t,0,[1,0]);this.readPKCS5PubKeyHex(n)},nt.prototype.readCertPubKeyHex=function(t,e){var n,r;(n=new re).readCertHex(t),r=n.getPublicKeyHex(),this.readPKCS8PubKeyHex(r)};new RegExp("[^0-9a-f]","gi");function te(t,e){for(var n="",r=e/4-t.length,i=0;i<r;i++)n+="0";return n+t}function ee(t,e,n){for(var r="",i=0;r.length<e;)r+=Et(n(Ft(t+String.fromCharCode.apply(String,[(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i])))),i+=1;return r}function ne(t){for(var e in ut.crypto.Util.DIGESTINFOHEAD){var n=ut.crypto.Util.DIGESTINFOHEAD[e],r=n.length;if(t.substring(0,r)==n)return[e,t.substring(r)]}return[]}function re(t){var e,n=ht,r=n.getChildIdx,i=n.getV,s=(n.dump,n.parse),o=n.getTLV,a=n.getVbyList,u=n.getVbyListEx,c=n.getTLVbyList,l=n.getTLVbyListEx,h=n.getIdxbyList,f=n.getIdxbyListEx,p=n.getVidx,d=n.getInt,g=n.oidname,m=n.hextooidstr,v=$t;try{e=ut.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(t){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){if(null===this.hex||0!==this.version)return this.version;var t=c(this.hex,0,[0,0]);if("a0"==t.substr(0,2)){var e=c(t,0,[0]),n=d(e,0);if(n<0||2<n)throw new Error("malformed version field");return this.version=n+1,this.version}return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return u(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var t=l(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(t)},this.getAlgorithmIdentifierName=function(t){for(var n in e)if(t===e[n])return n;return g(u(t,0,[0],"06"))},this.getIssuer=function(){return this.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return c(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){return this.getIssuer().str},this.getSubject=function(){return this.getX500Name(this.getSubjectHex())},this.getSubjectHex=function(){return c(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return this.getSubject().str},this.getNotBefore=function(){var t=a(this.hex,0,[0,4+this.foffset,0]);return t=t.replace(/(..)/g,"%$1"),t=decodeURIComponent(t)},this.getNotAfter=function(){var t=a(this.hex,0,[0,4+this.foffset,1]);return t=t.replace(/(..)/g,"%$1"),t=decodeURIComponent(t)},this.getPublicKeyHex=function(){return this.getSPKI()},this.getSPKI=function(){return c(this.hex,0,[0,6+this.foffset],"30")},this.getSPKIValue=function(){var t=this.getSPKI();return null==t?null:a(t,0,[1],"03",!0)},this.getPublicKeyIdx=function(){return h(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var t=this.getPublicKeyIdx();return h(this.hex,t,[1,0],"30")},this.getPublicKey=function(){return Qt.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var t=c(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(t)},this.getSignatureValueHex=function(){return a(this.hex,0,[2],"03",!0)},this.verifySignature=function(t){var e=this.getSignatureAlgorithmField(),n=this.getSignatureValueHex(),r=c(this.hex,0,[0],"30"),i=new ut.crypto.Signature({alg:e});return i.init(t),i.updateHex(r),i.verify(n)},this.parseExt=function(t){var e,s,o;if(void 0===t){if(o=this.hex,3!==this.version)return-1;e=h(o,0,[0,7,0],"30"),s=r(o,e)}else{o=$t(t);var u=h(o,0,[0,3,0,0],"06");if("2a864886f70d01090e"!=i(o,u))return void(this.aExtInfo=new Array);e=h(o,0,[0,3,0,1,0],"30"),s=r(o,e),this.hex=o}this.aExtInfo=new Array;for(var c=0;c<s.length;c++){var l={critical:!1},f=0;3===r(o,s[c]).length&&(l.critical=!0,f=1),l.oid=n.hextooidstr(a(o,s[c],[0],"06"));var d=h(o,s[c],[1+f]);l.vidx=p(o,d),this.aExtInfo.push(l)}},this.getExtInfo=function(t){var e=this.aExtInfo,n=t;if(t.match(/^[0-9.]+$/)||(n=ut.asn1.x509.OID.name2oid(t)),""!==n)for(var r=0;r<e.length;r++)if(e[r].oid===n)return e[r]},this.getExtBasicConstraints=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("basicConstraints");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var r={extname:"basicConstraints"};if(e&&(r.critical=!0),"3000"===t)return r;if("30030101ff"===t)return r.cA=!0,r;if("30060101ff02"===t.substr(0,12)){var s=i(t,10),a=parseInt(s,16);return r.cA=!0,r.pathLen=a,r}throw new Error("hExtV parse error: "+t)},this.getExtNameConstraints=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("nameConstraints");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var i={extname:"nameConstraints"};e&&(i.critical=!0);for(var s=r(t,0),a=0;a<s.length;a++){for(var u=[],c=r(t,s[a]),l=0;l<c.length;l++){var h=o(t,c[l]),f=this.getGeneralSubtree(h);u.push(f)}var p=t.substr(s[a],2);"a0"==p?i.permit=u:"a1"==p&&(i.exclude=u)}return i},this.getGeneralSubtree=function(t){var e=r(t,0),n=e.length;if(n<1||2<n)throw new Error("wrong num elements");for(var s=this.getGeneralName(o(t,e[0])),a=1;a<n;a++){var u=t.substr(e[a],2),c=i(t,e[a]),l=parseInt(c,16);"80"==u&&(s.min=l),"81"==u&&(s.max=l)}return s},this.getExtKeyUsage=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("keyUsage");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var r={extname:"keyUsage"};return e&&(r.critical=!0),r.names=this.getExtKeyUsageString(t).split(","),r},this.getExtKeyUsageBin=function(t){if(void 0===t){var e=this.getExtInfo("keyUsage");if(void 0===e)return"";t=o(this.hex,e.vidx)}if(8!=t.length&&10!=t.length)throw new Error("malformed key usage value: "+t);var n="000000000000000"+parseInt(t.substr(6),16).toString(2);return 8==t.length&&(n=n.slice(-8)),10==t.length&&(n=n.slice(-16)),""==(n=n.replace(/0+$/,""))&&(n="0"),n},this.getExtKeyUsageString=function(t){for(var e=this.getExtKeyUsageBin(t),n=new Array,r=0;r<e.length;r++)"1"==e.substr(r,1)&&n.push(re.KEYUSAGE_NAME[r]);return n.join(",")},this.getExtSubjectKeyIdentifier=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("subjectKeyIdentifier");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var r={extname:"subjectKeyIdentifier"};e&&(r.critical=!0);var s=i(t,0);return r.kid={hex:s},r},this.getExtAuthorityKeyIdentifier=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("authorityKeyIdentifier");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var s={extname:"authorityKeyIdentifier"};e&&(s.critical=!0);for(var a=r(t,0),u=0;u<a.length;u++){var c=t.substr(a[u],2);if("80"===c&&(s.kid={hex:i(t,a[u])}),"a1"===c){var l=o(t,a[u]),h=this.getGeneralNames(l);s.issuer=h[0].dn}"82"===c&&(s.sn={hex:i(t,a[u])})}return s},this.getExtExtKeyUsage=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("extKeyUsage");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var s={extname:"extKeyUsage",array:[]};e&&(s.critical=!0);for(var a=r(t,0),u=0;u<a.length;u++)s.array.push(g(i(t,a[u])));return s},this.getExtExtKeyUsageName=function(){var t=this.getExtInfo("extKeyUsage");if(void 0===t)return t;var e=new Array,n=o(this.hex,t.vidx);if(""===n)return e;for(var s=r(n,0),a=0;a<s.length;a++)e.push(g(i(n,s[a])));return e},this.getExtSubjectAltName=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("subjectAltName");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var r={extname:"subjectAltName",array:[]};return e&&(r.critical=!0),r.array=this.getGeneralNames(t),r},this.getExtIssuerAltName=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("issuerAltName");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var r={extname:"issuerAltName",array:[]};return e&&(r.critical=!0),r.array=this.getGeneralNames(t),r},this.getGeneralNames=function(t){for(var e=r(t,0),n=[],i=0;i<e.length;i++){var s=this.getGeneralName(o(t,e[i]));void 0!==s&&n.push(s)}return n},this.getGeneralName=function(t){var e=t.substr(0,2),n=i(t,0),r=Et(n);return"81"==e?{rfc822:r}:"82"==e?{dns:r}:"86"==e?{uri:r}:"87"==e?{ip:jt(n)}:"a4"==e?{dn:this.getX500Name(n)}:"a0"==e?{other:this.getOtherName(t)}:void 0},this.getExtSubjectAltName2=function(){var t,e,n,s=this.getExtInfo("subjectAltName");if(void 0===s)return s;for(var a=new Array,u=o(this.hex,s.vidx),c=r(u,0),l=0;l<c.length;l++)n=u.substr(c[l],2),t=i(u,c[l]),"81"===n&&(e=xt(t),a.push(["MAIL",e])),"82"===n&&(e=xt(t),a.push(["DNS",e])),"84"===n&&(e=re.hex2dn(t,0),a.push(["DN",e])),"86"===n&&(e=xt(t),a.push(["URI",e])),"87"===n&&(e=jt(t),a.push(["IP",e]));return a},this.getExtCRLDistributionPoints=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("cRLDistributionPoints");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var i={extname:"cRLDistributionPoints",array:[]};e&&(i.critical=!0);for(var s=r(t,0),a=0;a<s.length;a++){var u=o(t,s[a]);i.array.push(this.getDistributionPoint(u))}return i},this.getDistributionPoint=function(t){for(var e={},n=r(t,0),i=0;i<n.length;i++){var s=t.substr(n[i],2),a=o(t,n[i]);"a0"==s&&(e.dpname=this.getDistributionPointName(a))}return e},this.getDistributionPointName=function(t){for(var e={},n=r(t,0),i=0;i<n.length;i++){var s=t.substr(n[i],2),a=o(t,n[i]);"a0"==s&&(e.full=this.getGeneralNames(a))}return e},this.getExtCRLDistributionPointsURI=function(){var t=this.getExtCRLDistributionPoints();if(null==t)return t;for(var e=t.array,n=[],r=0;r<e.length;r++)try{null!=e[r].dpname.full[0].uri&&n.push(e[r].dpname.full[0].uri)}catch(t){}return n},this.getExtAIAInfo=function(){var t=this.getExtInfo("authorityInfoAccess");if(void 0===t)return t;for(var e={ocsp:[],caissuer:[]},n=r(this.hex,t.vidx),i=0;i<n.length;i++){var s=a(this.hex,n[i],[0],"06"),o=a(this.hex,n[i],[1],"86");"2b06010505073001"===s&&e.ocsp.push(xt(o)),"2b06010505073002"===s&&e.caissuer.push(xt(o))}return e},this.getExtAuthorityInfoAccess=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("authorityInfoAccess");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var i={extname:"authorityInfoAccess",array:[]};e&&(i.critical=!0);for(var s=r(t,0),c=0;c<s.length;c++){var l=u(t,s[c],[0],"06"),h=xt(a(t,s[c],[1],"86"));if("2b06010505073001"==l)i.array.push({ocsp:h});else{if("2b06010505073002"!=l)throw new Error("unknown method: "+l);i.array.push({caissuer:h})}}return i},this.getExtCertificatePolicies=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("certificatePolicies");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var i={extname:"certificatePolicies",array:[]};e&&(i.critical=!0);for(var s=r(t,0),a=0;a<s.length;a++){var u=o(t,s[a]),c=this.getPolicyInformation(u);i.array.push(c)}return i},this.getPolicyInformation=function(t){var e={},n=a(t,0,[0],"06");e.policyoid=g(n);var i=f(t,0,[1],"30");if(-1!=i){e.array=[];for(var s=r(t,i),u=0;u<s.length;u++){var c=o(t,s[u]),l=this.getPolicyQualifierInfo(c);e.array.push(l)}}return e},this.getOtherName=function(t){var e={},n=r(t,0),i=a(t,n[0],[],"06"),o=a(t,n[1],[]);return e.oid=ut.asn1.ASN1Util.oidHexToInt(i),e.obj=s(o),e},this.getPolicyQualifierInfo=function(t){var e={},n=a(t,0,[0],"06");if("2b06010505070201"===n){var r=u(t,0,[1],"16");e.cps=Et(r)}else if("2b06010505070202"===n){var i=c(t,0,[1],"30");e.unotice=this.getUserNotice(i)}return e},this.getUserNotice=function(t){for(var e={},n=r(t,0),i=0;i<n.length;i++){var s=o(t,n[i]);"30"!=s.substr(0,2)&&(e.exptext=this.getDisplayText(s))}return e},this.getDisplayText=function(t){var e={};return e.type={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"}[t.substr(0,2)],e.str=Et(i(t,0)),e},this.getExtCRLNumber=function(t,e){var n={extname:"cRLNumber"};if(e&&(n.critical=!0),"02"==t.substr(0,2))return n.num={hex:i(t,0)},n;throw new Error("hExtV parse error: "+t)},this.getExtCRLReason=function(t,e){var n={extname:"cRLReason"};if(e&&(n.critical=!0),"0a"==t.substr(0,2))return n.code=parseInt(i(t,0),16),n;throw new Error("hExtV parse error: "+t)},this.getExtOcspNonce=function(t,e){var n={extname:"ocspNonce"};e&&(n.critical=!0);var r=i(t,0);return n.hex=r,n},this.getExtOcspNoCheck=function(t,e){var n={extname:"ocspNoCheck"};return e&&(n.critical=!0),n},this.getExtAdobeTimeStamp=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("adobeTimeStamp");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var i={extname:"adobeTimeStamp"};e&&(i.critical=!0);var s=r(t,0);if(s.length>1){var a=o(t,s[1]),u=this.getGeneralName(a);null!=u.uri&&(i.uri=u.uri)}if(s.length>2){var c=o(t,s[2]);"0101ff"==c&&(i.reqauth=!0),"010100"==c&&(i.reqauth=!1)}return i};var y=function(t){var e={};try{var n=t.seq[0].oid,r=ut.asn1.x509.OID.name2oid(n);e.type=ut.asn1.x509.OID.oid2atype(r);var i=t.seq[1];if(null!=i.utf8str)e.ds="utf8",e.value=i.utf8str.str;else if(null!=i.numstr)e.ds="num",e.value=i.numstr.str;else if(null!=i.telstr)e.ds="tel",e.value=i.telstr.str;else if(null!=i.prnstr)e.ds="prn",e.value=i.prnstr.str;else if(null!=i.ia5str)e.ds="ia5",e.value=i.ia5str.str;else if(null!=i.visstr)e.ds="vis",e.value=i.visstr.str;else{if(null==i.bmpstr)throw"error";e.ds="bmp",e.value=i.bmpstr.str}return e}catch(t){throw new Erorr("improper ASN.1 parsed AttrTypeAndValue")}},b=function(t){try{return t.set.map((function(t){return y(t)}))}catch(t){throw new Error("improper ASN.1 parsed RDN: "+t)}};this.getX500NameRule=function(t){for(var e=null,n=[],r=0;r<t.length;r++)for(var i=t[r],s=0;s<i.length;s++)n.push(i[s]);for(r=0;r<n.length;r++){var o=n[r],a=o.ds,u=o.value,c=o.type;if(":"+a,"prn"!=a&&"utf8"!=a&&"ia5"!=a)return"mixed";if("ia5"==a){if("CN"!=c)return"mixed";if(ut.lang.String.isMail(u))continue;return"mixed"}if("C"==c){if("prn"==a)continue;return"mixed"}if(":"+a,null==e)e=a;else if(e!==a)return"mixed"}return null==e?"prn":e},this.getAttrTypeAndValue=function(t){var e=s(t);return y(e)},this.getRDN=function(t){var e=s(t);return b(e)},this.getX500NameArray=function(t){return function(t){try{return t.seq.map((function(t){return b(t)}))}catch(t){throw new Error("improper ASN.1 parsed X500Name: "+t)}}(s(t))},this.getX500Name=function(t){var e=this.getX500NameArray(t);return{array:e,str:this.dnarraytostr(e)}},this.readCertPEM=function(t){this.readCertHex(v(t))},this.readCertHex=function(t){this.hex=t,this.getVersion();try{h(this.hex,0,[0,7],"a3"),this.parseExt()}catch(t){}},this.getParam=function(t){var e={};return e.version=this.getVersion(),e.serial={hex:this.getSerialNumberHex()},e.sigalg=this.getSignatureAlgorithmField(),e.issuer=this.getIssuer(),e.notbefore=this.getNotBefore(),e.notafter=this.getNotAfter(),e.subject=this.getSubject(),e.sbjpubkey=It(this.getPublicKeyHex(),"PUBLIC KEY"),null!=this.aExtInfo&&this.aExtInfo.length>0&&(e.ext=this.getExtParamArray()),e.sighex=this.getSignatureValueHex(),"object"==typeof t&&(1==t.tbshex&&(e.tbshex=c(this.hex,0,[0])),1==t.nodnarray&&(delete e.issuer.array,delete e.subject.array)),e},this.getExtParamArray=function(t){null==t&&(-1!=f(this.hex,0,[0,"[3]"])&&(t=l(this.hex,0,[0,"[3]",0],"30")));for(var e=[],n=r(t,0),i=0;i<n.length;i++){var s=o(t,n[i]),a=this.getExtParam(s);null!=a&&e.push(a)}return e},this.getExtParam=function(t){var e=r(t,0).length;if(2!=e&&3!=e)throw new Error("wrong number elements in Extension: "+e+" "+t);var n=m(a(t,0,[0],"06")),i=!1;3==e&&"0101ff"==c(t,0,[1])&&(i=!0);var s=c(t,0,[e-1,0]),o=void 0;if("2.5.29.14"==n?o=this.getExtSubjectKeyIdentifier(s,i):"2.5.29.15"==n?o=this.getExtKeyUsage(s,i):"2.5.29.17"==n?o=this.getExtSubjectAltName(s,i):"2.5.29.18"==n?o=this.getExtIssuerAltName(s,i):"2.5.29.19"==n?o=this.getExtBasicConstraints(s,i):"2.5.29.30"==n?o=this.getExtNameConstraints(s,i):"2.5.29.31"==n?o=this.getExtCRLDistributionPoints(s,i):"2.5.29.32"==n?o=this.getExtCertificatePolicies(s,i):"2.5.29.35"==n?o=this.getExtAuthorityKeyIdentifier(s,i):"2.5.29.37"==n?o=this.getExtExtKeyUsage(s,i):"1.3.6.1.5.5.7.1.1"==n?o=this.getExtAuthorityInfoAccess(s,i):"2.5.29.20"==n?o=this.getExtCRLNumber(s,i):"2.5.29.21"==n?o=this.getExtCRLReason(s,i):"1.3.6.1.5.5.7.48.1.2"==n?o=this.getExtOcspNonce(s,i):"1.3.6.1.5.5.7.48.1.5"==n?o=this.getExtOcspNoCheck(s,i):"1.2.840.113583.1.1.9.1"==n&&(o=this.getExtAdobeTimeStamp(s,i)),null!=o)return o;var u={extname:n,extn:s};return i&&(u.critical=!0),u},this.findExt=function(t,e){for(var n=0;n<t.length;n++)if(t[n].extname==e)return t[n];return null},this.updateExtCDPFullURI=function(t,e){var n=this.findExt(t,"cRLDistributionPoints");if(null!=n&&null!=n.array)for(var r=n.array,i=0;i<r.length;i++)if(null!=r[i].dpname&&null!=r[i].dpname.full)for(var s=r[i].dpname.full,o=0;o<s.length;o++){var a=s[i];null!=a.uri&&(a.uri=e)}},this.updateExtAIAOCSP=function(t,e){var n=this.findExt(t,"authorityInfoAccess");if(null!=n&&null!=n.array)for(var r=n.array,i=0;i<r.length;i++)null!=r[i].ocsp&&(r[i].ocsp=e)},this.updateExtAIACAIssuer=function(t,e){var n=this.findExt(t,"authorityInfoAccess");if(null!=n&&null!=n.array)for(var r=n.array,i=0;i<r.length;i++)null!=r[i].caissuer&&(r[i].caissuer=e)},this.dnarraytostr=function(t){return"/"+t.map((function(t){return function(t){return t.map((function(t){return function(t){return t.type+"="+t.value}(t).replace(/\+/,"\\+")})).join("+")}(t).replace(/\//,"\\/")})).join("/")},this.getInfo=function(){var t,e,n,r,i=function(t){for(var e="",n=t.array,r=0;r<n.length;r++){var i=n[r];if(e+=" policy oid: "+i.policyoid+"\n",void 0!==i.array)for(var s=0;s<i.array.length;s++){var o=i.array[s];void 0!==o.cps&&(e+=" cps: "+o.cps+"\n")}}return e},s=function(t){for(var e="",n=t.array,r=0;r<n.length;r++){var i=n[r];try{void 0!==i.dpname.full[0].uri&&(e+=" "+i.dpname.full[0].uri+"\n")}catch(t){}try{void 0!==i.dname.full[0].dn.hex&&(e+=" "+re.hex2dn(i.dpname.full[0].dn.hex)+"\n")}catch(t){}}return e},o=function(t){for(var e="",n=t.array,r=0;r<n.length;r++){var i=n[r];void 0!==i.caissuer&&(e+=" caissuer: "+i.caissuer+"\n"),void 0!==i.ocsp&&(e+=" ocsp: "+i.ocsp+"\n")}return e};if(t="Basic Fields\n",t+=" serial number: "+this.getSerialNumberHex()+"\n",t+=" signature algorithm: "+this.getSignatureAlgorithmField()+"\n",t+=" issuer: "+this.getIssuerString()+"\n",t+=" notBefore: "+this.getNotBefore()+"\n",t+=" notAfter: "+this.getNotAfter()+"\n",t+=" subject: "+this.getSubjectString()+"\n",t+=" subject public key info: \n",t+=" key algorithm: "+(e=this.getPublicKey()).type+"\n","RSA"===e.type&&(t+=" n="+qt(e.n.toString(16)).substr(0,16)+"...\n",t+=" e="+qt(e.e.toString(16))+"\n"),null!=(n=this.aExtInfo)){t+="X509v3 Extensions:\n";for(var a=0;a<n.length;a++){var u=n[a],c=ut.asn1.x509.OID.oid2name(u.oid);""===c&&(c=u.oid);var l="";if(!0===u.critical&&(l="CRITICAL"),t+=" "+c+" "+l+":\n","basicConstraints"===c){var h=this.getExtBasicConstraints();void 0===h.cA?t+=" {}\n":(t+=" cA=true",void 0!==h.pathLen&&(t+=", pathLen="+h.pathLen),t+="\n")}else if("keyUsage"===c)t+=" "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"===c)t+=" "+this.getExtSubjectKeyIdentifier().kid.hex+"\n";else if("authorityKeyIdentifier"===c){var f=this.getExtAuthorityKeyIdentifier();void 0!==f.kid&&(t+=" kid="+f.kid.hex+"\n")}else{if("extKeyUsage"===c)t+=" "+this.getExtExtKeyUsage().array.join(", ")+"\n";else if("subjectAltName"===c)t+=" "+(r=this.getExtSubjectAltName(),JSON.stringify(r.array).replace(/[\[\]\{\}\"]/g,""))+"\n";else if("cRLDistributionPoints"===c)t+=s(this.getExtCRLDistributionPoints());else if("authorityInfoAccess"===c)t+=o(this.getExtAuthorityInfoAccess());else"certificatePolicies"===c&&(t+=i(this.getExtCertificatePolicies()))}}}return t+="signature algorithm: "+this.getSignatureAlgorithmName()+"\n",t+="signature: "+this.getSignatureValueHex().substr(0,16)+"...\n"},"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?this.readCertPEM(t):ut.lang.String.isHex(t)&&this.readCertHex(t))}nt.prototype.sign=function(t,e){var n=function(t){return ut.crypto.Util.hashString(t,e)}(t);return this.signWithMessageHash(n,e)},nt.prototype.signWithMessageHash=function(t,e){var n=tt(ut.crypto.Util.getPaddedDigestInfoHex(t,e,this.n.bitLength()),16);return te(this.doPrivate(n).toString(16),this.n.bitLength())},nt.prototype.signPSS=function(t,e,n){var r,i=(r=Ft(t),ut.crypto.Util.hashHex(r,e));return void 0===n&&(n=-1),this.signWithMessageHashPSS(i,e,n)},nt.prototype.signWithMessageHashPSS=function(t,e,n){var r,i=Et(t),s=i.length,o=this.n.bitLength()-1,a=Math.ceil(o/8),u=function(t){return ut.crypto.Util.hashHex(t,e)};if(-1===n||void 0===n)n=s;else if(-2===n)n=a-s-2;else if(n<-2)throw new Error("invalid salt length");if(a<s+n+2)throw new Error("data too long");var c="";n>0&&(c=new Array(n),(new Q).nextBytes(c),c=String.fromCharCode.apply(String,c));var l=Et(u(Ft("\0\0\0\0\0\0\0\0"+i+c))),h=[];for(r=0;r<a-n-s-2;r+=1)h[r]=0;var f=String.fromCharCode.apply(String,h)+""+c,p=ee(l,f.length,u),d=[];for(r=0;r<f.length;r+=1)d[r]=f.charCodeAt(r)^p.charCodeAt(r);var g=65280>>8*a-o&255;for(d[0]&=~g,r=0;r<s;r++)d.push(l.charCodeAt(r));return d.push(188),te(this.doPrivate(new x(d)).toString(16),this.n.bitLength())},nt.prototype.verify=function(t,e){if(null==(e=e.toLowerCase()).match(/^[0-9a-f]+$/))return!1;var n=tt(e,16),r=this.n.bitLength();if(n.bitLength()>r)return!1;var i=this.doPublic(n).toString(16);if(i.length+3!=r/4)return!1;var s=ne(i.replace(/^1f+00/,""));if(0==s.length)return!1;var o=s[0];return s[1]==function(t){return ut.crypto.Util.hashString(t,o)}(t)},nt.prototype.verifyWithMessageHash=function(t,e){if(e.length!=Math.ceil(this.n.bitLength()/4))return!1;var n=tt(e,16);if(n.bitLength()>this.n.bitLength())return 0;var r=ne(this.doPublic(n).toString(16).replace(/^1f+00/,""));if(0==r.length)return!1;r[0];return r[1]==t},nt.prototype.verifyPSS=function(t,e,n,r){var i,s=(i=Ft(t),ut.crypto.Util.hashHex(i,n));return void 0===r&&(r=-1),this.verifyWithMessageHashPSS(s,e,n,r)},nt.prototype.verifyWithMessageHashPSS=function(t,e,n,r){if(e.length!=Math.ceil(this.n.bitLength()/4))return!1;var i,s=new x(e,16),o=function(t){return ut.crypto.Util.hashHex(t,n)},a=Et(t),u=a.length,c=this.n.bitLength()-1,l=Math.ceil(c/8);if(-1===r||void 0===r)r=u;else if(-2===r)r=l-u-2;else if(r<-2)throw new Error("invalid salt length");if(l<u+r+2)throw new Error("data too long");var h=this.doPublic(s).toByteArray();for(i=0;i<h.length;i+=1)h[i]&=255;for(;h.length<l;)h.unshift(0);if(188!==h[l-1])throw new Error("encoded message does not end in 0xbc");var f=(h=String.fromCharCode.apply(String,h)).substr(0,l-u-1),p=h.substr(f.length,u),d=65280>>8*l-c&255;if(0!=(f.charCodeAt(0)&d))throw new Error("bits beyond keysize not zero");var g=ee(p,f.length,o),m=[];for(i=0;i<f.length;i+=1)m[i]=f.charCodeAt(i)^g.charCodeAt(i);m[0]&=~d;var v=l-u-r-2;for(i=0;i<v;i+=1)if(0!==m[i])throw new Error("leftmost octets not zero");if(1!==m[v])throw new Error("0x01 marker not found");return p===Et(o(Ft("\0\0\0\0\0\0\0\0"+a+String.fromCharCode.apply(String,m.slice(-r)))))},nt.SALT_LEN_HLEN=-1,nt.SALT_LEN_MAX=-2,nt.SALT_LEN_RECOVER=-2,re.hex2dn=function(t,e){void 0===e&&(e=0);var n=new re;ht.getTLV(t,e);return n.getX500Name(t).str},re.hex2rdn=function(t,e){if(void 0===e&&(e=0),"31"!==t.substr(e,2))throw new Error("malformed RDN");for(var n=new Array,r=ht.getChildIdx(t,e),i=0;i<r.length;i++)n.push(re.hex2attrTypeValue(t,r[i]));return(n=n.map((function(t){return t.replace("+","\\+")}))).join("+")},re.hex2attrTypeValue=function(t,e){var n=ht,r=n.getV;if(void 0===e&&(e=0),"30"!==t.substr(e,2))throw new Error("malformed attribute type and value");var i=n.getChildIdx(t,e);2!==i.length||t.substr(i[0],2);var s=r(t,i[0]),o=ut.asn1.ASN1Util.oidHexToInt(s);return ut.asn1.x509.OID.oid2atype(o)+"="+Et(r(t,i[1]))},re.getPublicKeyFromCertHex=function(t){var e=new re;return e.readCertHex(t),e.getPublicKey()},re.getPublicKeyFromCertPEM=function(t){var e=new re;return e.readCertPEM(t),e.getPublicKey()},re.getPublicKeyInfoPropOfCertPEM=function(t){var e,n,r=ht.getVbyList,i={};return i.algparam=null,(e=new re).readCertPEM(t),n=e.getPublicKeyHex(),i.keyhex=r(n,0,[1],"03").substr(2),i.algoid=r(n,0,[0,0],"06"),"2a8648ce3d0201"===i.algoid&&(i.algparam=r(n,0,[0,1],"06")),i},re.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];void 0!==ut&&ut||(ut={}),void 0!==ut.jws&&ut.jws||(ut.jws={}),ut.jws.JWS=function(){var t=ut.jws.JWS.isSafeJSONString;this.parseJWS=function(e,n){if(void 0===this.parsedJWS||!n&&void 0===this.parsedJWS.sigvalH){var r=e.match(/^([^.]+)\.([^.]+)\.([^.]+)$/);if(null==r)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";var i=r[1],s=r[2],o=r[3],a=i+"."+s;if(this.parsedJWS={},this.parsedJWS.headB64U=i,this.parsedJWS.payloadB64U=s,this.parsedJWS.sigvalB64U=o,this.parsedJWS.si=a,!n){var u=bt(o),c=tt(u,16);this.parsedJWS.sigvalH=u,this.parsedJWS.sigvalBI=c}var l=lt(i),h=lt(s);if(this.parsedJWS.headS=l,this.parsedJWS.payloadS=h,!t(l,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+l}}},ut.jws.JWS.sign=function(t,e,n,r,i){var s,o,a,u=ut,c=u.jws.JWS,l=c.readSafeJSONString,h=c.isSafeJSONString,f=u.crypto,p=(f.ECDSA,f.Mac),d=f.Signature,g=JSON;if("string"!=typeof e&&"object"!=typeof e)throw"spHeader must be JSON string or object: "+e;if("object"==typeof e&&(o=e,s=g.stringify(o)),"string"==typeof e){if(!h(s=e))throw"JWS Head is not safe JSON string: "+s;o=l(s)}if(a=n,"object"==typeof n&&(a=g.stringify(n)),""!=t&&null!=t||void 0===o.alg||(t=o.alg),""!=t&&null!=t&&void 0===o.alg&&(o.alg=t,s=g.stringify(o)),t!==o.alg)throw"alg and sHeader.alg doesn't match: "+t+"!="+o.alg;var m=null;if(void 0===c.jwsalg2sigalg[t])throw"unsupported alg name: "+t;m=c.jwsalg2sigalg[t];var v=ct(s)+"."+ct(a),y="";if("Hmac"==m.substr(0,4)){if(void 0===r)throw"mac key shall be specified for HS* alg";var b=new p({alg:m,prov:"cryptojs",pass:r});b.updateString(v),y=b.doFinal()}else if(-1!=m.indexOf("withECDSA")){(x=new d({alg:m})).init(r,i),x.updateString(v);var w=x.sign();y=ut.crypto.ECDSA.asn1SigToConcatSig(w)}else{var x;if("none"!=m)(x=new d({alg:m})).init(r,i),x.updateString(v),y=x.sign()}return v+"."+yt(y)},ut.jws.JWS.verify=function(t,e,n){var r,i=ut,s=i.jws.JWS,o=s.readSafeJSONString,a=i.crypto,u=a.ECDSA,c=a.Mac,l=a.Signature;if(r=nt,!Vt(t))return!1;var h=t.split(".");if(3!==h.length)return!1;var f=h[0]+"."+h[1],p=bt(h[2]),d=o(lt(h[0])),g=null,m=null;if(void 0===d.alg)throw"algorithm not specified in header";if((m=(g=d.alg).substr(0,2),null!=n&&"[object Array]"===Object.prototype.toString.call(n)&&n.length>0)&&-1==(":"+n.join(":")+":").indexOf(":"+g+":"))throw"algorithm '"+g+"' not accepted in the list";if("none"!=g&&null===e)throw"key shall be specified to verify.";if("string"==typeof e&&-1!=e.indexOf("-----BEGIN ")&&(e=Qt.getKey(e)),!("RS"!=m&&"PS"!=m||e instanceof r))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==m&&!(e instanceof u))throw"key shall be a ECDSA obj for ES* algs";var v=null;if(void 0===s.jwsalg2sigalg[d.alg])throw"unsupported alg name: "+g;if("none"==(v=s.jwsalg2sigalg[g]))throw"not supported";if("Hmac"==v.substr(0,4)){if(void 0===e)throw"hexadecimal key shall be specified for HMAC";var y=new c({alg:v,pass:e});return y.updateString(f),p==y.doFinal()}if(-1!=v.indexOf("withECDSA")){var b,w=null;try{w=u.concatSigToASN1Sig(p)}catch(t){return!1}return(b=new l({alg:v})).init(e),b.updateString(f),b.verify(w)}return(b=new l({alg:v})).init(e),b.updateString(f),b.verify(p)},ut.jws.JWS.parse=function(t){var e,n,r,i=t.split("."),s={};if(2!=i.length&&3!=i.length)throw"malformed sJWS: wrong number of '.' splitted elements";return e=i[0],n=i[1],3==i.length&&(r=i[2]),s.headerObj=ut.jws.JWS.readSafeJSONString(lt(e)),s.payloadObj=ut.jws.JWS.readSafeJSONString(lt(n)),s.headerPP=JSON.stringify(s.headerObj,null," "),null==s.payloadObj?s.payloadPP=lt(n):s.payloadPP=JSON.stringify(s.payloadObj,null," "),void 0!==r&&(s.sigHex=bt(r)),s},ut.jws.JWS.verifyJWT=function(t,e,n){var r=ut.jws,i=r.JWS,s=i.readSafeJSONString,o=i.inArray,a=i.includedArray;if(!Vt(t))return!1;var u=t.split(".");if(3!=u.length)return!1;var c=u[0],l=u[1],h=(bt(u[2]),s(lt(c))),f=s(lt(l));if(void 0===h.alg)return!1;if(void 0===n.alg)throw"acceptField.alg shall be specified";if(!o(h.alg,n.alg))return!1;if(void 0!==f.iss&&"object"==typeof n.iss&&!o(f.iss,n.iss))return!1;if(void 0!==f.sub&&"object"==typeof n.sub&&!o(f.sub,n.sub))return!1;if(void 0!==f.aud&&"object"==typeof n.aud)if("string"==typeof f.aud){if(!o(f.aud,n.aud))return!1}else if("object"==typeof f.aud&&!a(f.aud,n.aud))return!1;var p=r.IntDate.getNow();return void 0!==n.verifyAt&&"number"==typeof n.verifyAt&&(p=n.verifyAt),void 0!==n.gracePeriod&&"number"==typeof n.gracePeriod||(n.gracePeriod=0),!(void 0!==f.exp&&"number"==typeof f.exp&&f.exp+n.gracePeriod<p)&&(!(void 0!==f.nbf&&"number"==typeof f.nbf&&p<f.nbf-n.gracePeriod)&&(!(void 0!==f.iat&&"number"==typeof f.iat&&p<f.iat-n.gracePeriod)&&((void 0===f.jti||void 0===n.jti||f.jti===n.jti)&&!!i.verify(t,e,n.alg))))},ut.jws.JWS.includedArray=function(t,e){var n=ut.jws.JWS.inArray;if(null===t)return!1;if("object"!=typeof t)return!1;if("number"!=typeof t.length)return!1;for(var r=0;r<t.length;r++)if(!n(t[r],e))return!1;return!0},ut.jws.JWS.inArray=function(t,e){if(null===e)return!1;if("object"!=typeof e)return!1;if("number"!=typeof e.length)return!1;for(var n=0;n<e.length;n++)if(e[n]==t)return!0;return!1},ut.jws.JWS.jwsalg2sigalg={HS256:"HmacSHA256",HS384:"HmacSHA384",HS512:"HmacSHA512",RS256:"SHA256withRSA",RS384:"SHA384withRSA",RS512:"SHA512withRSA",ES256:"SHA256withECDSA",ES384:"SHA384withECDSA",ES512:"SHA512withECDSA",PS256:"SHA256withRSAandMGF1",PS384:"SHA384withRSAandMGF1",PS512:"SHA512withRSAandMGF1",none:"none"},ut.jws.JWS.isSafeJSONString=function(t,e,n){var r=null;try{return"object"!=typeof(r=at(t))||r.constructor===Array?0:(e&&(e[n]=r),1)}catch(t){return 0}},ut.jws.JWS.readSafeJSONString=function(t){var e=null;try{return"object"!=typeof(e=at(t))||e.constructor===Array?null:e}catch(t){return null}},ut.jws.JWS.getEncodedSignatureValueFromJWS=function(t){var e=t.match(/^[^.]+\.[^.]+\.([^.]+)$/);if(null==e)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";return e[1]},ut.jws.JWS.getJWKthumbprint=function(t){if("RSA"!==t.kty&&"EC"!==t.kty&&"oct"!==t.kty)throw"unsupported algorithm for JWK Thumprint";var e="{";if("RSA"===t.kty){if("string"!=typeof t.n||"string"!=typeof t.e)throw"wrong n and e value for RSA key";e+='"e":"'+t.e+'",',e+='"kty":"'+t.kty+'",',e+='"n":"'+t.n+'"}'}else if("EC"===t.kty){if("string"!=typeof t.crv||"string"!=typeof t.x||"string"!=typeof t.y)throw"wrong crv, x and y value for EC key";e+='"crv":"'+t.crv+'",',e+='"kty":"'+t.kty+'",',e+='"x":"'+t.x+'",',e+='"y":"'+t.y+'"}'}else if("oct"===t.kty){if("string"!=typeof t.k)throw"wrong k value for oct(symmetric) key";e+='"kty":"'+t.kty+'",',e+='"k":"'+t.k+'"}'}var n=Ft(e);return yt(ut.crypto.Util.hashHex(n,"sha256"))},ut.jws.IntDate={},ut.jws.IntDate.get=function(t){var e=ut.jws.IntDate,n=e.getNow,r=e.getZulu;if("now"==t)return n();if("now + 1hour"==t)return n()+3600;if("now + 1day"==t)return n()+86400;if("now + 1month"==t)return n()+2592e3;if("now + 1year"==t)return n()+31536e3;if(t.match(/Z$/))return r(t);if(t.match(/^[0-9]+$/))return parseInt(t);throw"unsupported format: "+t},ut.jws.IntDate.getZulu=function(t){return Tt(t)},ut.jws.IntDate.getNow=function(){return~~(new Date/1e3)},ut.jws.IntDate.intDate2UTCString=function(t){return new Date(1e3*t).toUTCString()},ut.jws.IntDate.intDate2Zulu=function(t){var e=new Date(1e3*t);return("0000"+e.getUTCFullYear()).slice(-4)+("00"+(e.getUTCMonth()+1)).slice(-2)+("00"+e.getUTCDate()).slice(-2)+("00"+e.getUTCHours()).slice(-2)+("00"+e.getUTCMinutes()).slice(-2)+("00"+e.getUTCSeconds()).slice(-2)+"Z"},void 0!==ut&&ut||(ut={}),void 0!==ut.jws&&ut.jws||(ut.jws={}),ut.jws.JWSJS=function(){var t=ut.jws.JWS,e=t.readSafeJSONString;this.aHeader=[],this.sPayload="",this.aSignature=[],this.init=function(){this.aHeader=[],this.sPayload=void 0,this.aSignature=[]},this.initWithJWS=function(t){this.init();var e=t.split(".");if(3!=e.length)throw"malformed input JWS";this.aHeader.push(e[0]),this.sPayload=e[1],this.aSignature.push(e[2])},this.addSignature=function(t,e,n,r){if(void 0===this.sPayload||null===this.sPayload)throw"there's no JSON-JS signature to add.";var i=this.aHeader.length;if(this.aHeader.length!=this.aSignature.length)throw"aHeader.length != aSignature.length";try{var s=ut.jws.JWS.sign(t,e,this.sPayload,n,r).split(".");s[0],s[2];this.aHeader.push(s[0]),this.aSignature.push(s[2])}catch(t){throw this.aHeader.length>i&&this.aHeader.pop(),this.aSignature.length>i&&this.aSignature.pop(),"addSignature failed: "+t}},this.verifyAll=function(t){if(this.aHeader.length!==t.length||this.aSignature.length!==t.length)return!1;for(var e=0;e<t.length;e++){var n=t[e];if(2!==n.length)return!1;if(!1===this.verifyNth(e,n[0],n[1]))return!1}return!0},this.verifyNth=function(e,n,r){if(this.aHeader.length<=e||this.aSignature.length<=e)return!1;var i=this.aHeader[e],s=this.aSignature[e],o=i+"."+this.sPayload+"."+s,a=!1;try{a=t.verify(o,n,r)}catch(t){return!1}return a},this.readJWSJS=function(t){if("string"==typeof t){var n=e(t);if(null==n)throw"argument is not safe JSON object string";this.aHeader=n.headers,this.sPayload=n.payload,this.aSignature=n.signatures}else try{if(!(t.headers.length>0))throw"malformed header";if(this.aHeader=t.headers,"string"!=typeof t.payload)throw"malformed signatures";if(this.sPayload=t.payload,!(t.signatures.length>0))throw"malformed signatures";this.aSignature=t.signatures}catch(t){throw"malformed JWS-JS JSON object: "+t}},this.getJSON=function(){return{headers:this.aHeader,payload:this.sPayload,signatures:this.aSignature}},this.isEmpty=function(){return 0==this.aHeader.length?1:0}},e.SecureRandom=Q,e.rng_seed_time=G,e.BigInteger=x,e.RSAKey=nt,e.ECDSA=ut.crypto.ECDSA,e.DSA=ut.crypto.DSA,e.Signature=ut.crypto.Signature,e.MessageDigest=ut.crypto.MessageDigest,e.Mac=ut.crypto.Mac,e.Cipher=ut.crypto.Cipher,e.KEYUTIL=Qt,e.ASN1HEX=ht,e.X509=re,e.X509CRL=function(t){var e=ut.lang.String.isHex,n=ht,r=n.getV,i=n.getTLV,s=n.getVbyList,o=n.getTLVbyList,a=n.getTLVbyListEx,u=n.getIdxbyList,c=n.getIdxbyListEx,l=n.getChildIdx,h=new re;this.hex=null,this.posSigAlg=null,this.posRevCert=null,this.parsed=null,this._setPos=function(){var t=u(this.hex,0,[0,0]),e=this.hex.substr(t,2);if("02"==e)this.posSigAlg=1;else{if("30"!=e)throw new Error("malformed 1st item of TBSCertList: "+e);this.posSigAlg=0}var n,r=u(this.hex,0,[0,this.posSigAlg+3]),i=this.hex.substr(r,2);if("17"==i||"18"==i)n=u(this.hex,0,[0,this.posSigAlg+4]),this.posRevCert=null,-1!=n&&"30"==this.hex.substr(n,2)&&(this.posRevCert=this.posSigAlg+4);else if("30"==i)this.posRevCert=this.posSigAlg+3;else{if("a0"!=i)throw new Error("malformed nextUpdate or revCert tag: "+i);this.posRevCert=null}},this.getVersion=function(){return 0==this.posSigAlg?null:parseInt(s(this.hex,0,[0,0],"02"),16)+1},this.getSignatureAlgorithmField=function(){var t=o(this.hex,0,[0,this.posSigAlg],"30");return h.getAlgorithmIdentifierName(t)},this.getIssuer=function(){return h.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return o(this.hex,0,[0,this.posSigAlg+1],"30")},this.getThisUpdate=function(){var t=s(this.hex,0,[0,this.posSigAlg+2]);return result=Et(t)},this.getNextUpdate=function(){var t=u(this.hex,0,[0,this.posSigAlg+3]),e=this.hex.substr(t,2);return"17"!=e&&"18"!=e?null:Et(r(this.hex,t))},this.getRevCertArray=function(){if(null==this.posRevCert)return null;for(var t=[],e=u(this.hex,0,[0,this.posRevCert]),n=l(this.hex,e),r=0;r<n.length;r++){var s=i(this.hex,n[r]);t.push(this.getRevCert(s))}return t},this.getRevCert=function(t){var e={},n=l(t,0);return e.sn={hex:s(t,0,[0],"02")},e.date=Et(s(t,0,[1])),3==n.length&&(e.ext=h.getExtParamArray(o(t,0,[2]))),e},this.findRevCert=function(t){var e=new re(t).getSerialNumberHex();return this.findRevCertBySN(e)},this.findRevCertBySN=function(t){if(null==this.parsed&&this.getParam(),null==this.parsed.revcert)return null;for(var e=this.parsed.revcert,n=0;n<e.length;n++)if(t==e[n].sn.hex)return e[n];return null},this.getSignatureValueHex=function(){return s(this.hex,0,[2],"03",!0)},this.verifySignature=function(t){var e=this.getSignatureAlgorithmField(),n=this.getSignatureValueHex(),r=o(this.hex,0,[0],"30"),i=new ut.crypto.Signature({alg:e});return i.init(t),i.updateHex(r),i.verify(n)},this.getParam=function(t){var e={},n=this.getVersion();null!=n&&(e.version=n),e.sigalg=this.getSignatureAlgorithmField(),e.issuer=this.getIssuer(),e.thisupdate=this.getThisUpdate();var r=this.getNextUpdate();null!=r&&(e.nextupdate=r);var i=this.getRevCertArray();if(null!=i&&(e.revcert=i),-1!=c(this.hex,0,[0,"[0]"])){var s=a(this.hex,0,[0,"[0]",0]);e.ext=h.getExtParamArray(s)}return e.sighex=this.getSignatureValueHex(),this.parsed=e,"object"==typeof t&&(1==t.tbshex&&(e.tbshex=o(this.hex,0,[0])),1==t.nodnarray&&delete e.issuer.array),e},"string"==typeof t&&(e(t)?this.hex=t:t.match(/-----BEGIN X509 CRL/)&&(this.hex=$t(t)),this._setPos())},e.CryptoJS=g,e.b64tohex=b,e.b64toBA=w,e.ECFieldElementFp=it,e.ECPointFp=st,e.ECCurveFp=ot,e.stoBA=ft,e.BAtos=pt,e.BAtohex=dt,e.stohex=gt,e.stob64=function(t){return y(gt(t))},e.stob64u=function(t){return mt(y(gt(t)))},e.b64utos=function(t){return pt(w(vt(t)))},e.b64tob64u=mt,e.b64utob64=vt,e.hex2b64=y,e.hextob64u=yt,e.b64utohex=bt,e.utf8tob64u=ct,e.b64utoutf8=lt,e.utf8tob64=function(t){return y(_t(Mt(t)))},e.b64toutf8=function(t){return decodeURIComponent(Pt(b(t)))},e.utf8tohex=wt,e.hextoutf8=xt,e.hextorstr=Et,e.rstrtohex=Ft,e.hextob64=At,e.hextob64nl=Ct,e.b64nltohex=Dt,e.hextopem=It,e.pemtohex=$t,e.hextoArrayBuffer=function(t){if(t.length%2!=0)throw"input is not even length";if(null==t.match(/^[0-9A-Fa-f]+$/))throw"input is not hexadecimal";for(var e=new ArrayBuffer(t.length/2),n=new DataView(e),r=0;r<t.length/2;r++)n.setUint8(r,parseInt(t.substr(2*r,2),16));return e},e.ArrayBuffertohex=function(t){for(var e="",n=new DataView(t),r=0;r<t.byteLength;r++)e+=("00"+n.getUint8(r).toString(16)).slice(-2);return e},e.zulutomsec=Rt,e.zulutosec=Tt,e.zulutodate=function(t){return new Date(Rt(t))},e.datetozulu=function(t,e,n){var r,i=t.getUTCFullYear();if(e){if(i<1950||2049<i)throw"not proper year for UTCTime: "+i;r=(""+i).slice(-2)}else r=("000"+i).slice(-4);if(r+=("0"+(t.getUTCMonth()+1)).slice(-2),r+=("0"+t.getUTCDate()).slice(-2),r+=("0"+t.getUTCHours()).slice(-2),r+=("0"+t.getUTCMinutes()).slice(-2),r+=("0"+t.getUTCSeconds()).slice(-2),n){var s=t.getUTCMilliseconds();0!==s&&(r+="."+(s=(s=("00"+s).slice(-3)).replace(/0+$/g,"")))}return r+="Z"},e.uricmptohex=_t,e.hextouricmp=Pt,e.ipv6tohex=kt,e.hextoipv6=Ot,e.hextoip=jt,e.iptohex=Nt,e.ucs2hextoutf8=Ht,e.encodeURIComponentAll=Mt,e.newline_toUnix=function(t){return t=t.replace(/\r\n/gm,"\n")},e.newline_toDos=function(t){return t=(t=t.replace(/\r\n/gm,"\n")).replace(/\n/gm,"\r\n")},e.hextoposhex=qt,e.intarystrtohex=function(t){t=(t=(t=t.replace(/^\s*\[\s*/,"")).replace(/\s*\]\s*$/,"")).replace(/\s*/g,"");try{return t.split(/,/).map((function(t,e,n){var r=parseInt(t);if(r<0||255<r)throw"integer not in range 0-255";return("00"+r.toString(16)).slice(-2)})).join("")}catch(t){throw"malformed integer array string: "+t}},e.strdiffidx=function(t,e){var n=t.length;t.length>e.length&&(n=e.length);for(var r=0;r<n;r++)if(t.charCodeAt(r)!=e.charCodeAt(r))return r;return t.length!=e.length?n:-1},e.oidtohex=Kt,e.hextooid=zt,e.strpad=Gt,e.bitstrtoint=Wt,e.inttobitstr=Yt,e.bitstrtobinstr=Xt,e.binstrtobitstr=function(t){if("string"!=typeof t)return null;if(null==t.match(/^[01]+$/))return null;try{return Yt(parseInt(t,2))}catch(t){return null}},e.isBase64URLDot=Vt,e.namearraytobinstr=Jt,e.extendClass=Zt,e.KJUR=ut,e.crypto=ut.crypto,e.asn1=ut.asn1,e.jws=ut.jws,e.lang=ut.lang}).call(this,n(186).Buffer)},function(t,e,n){"use strict";n.r(e);n(174),n(175),n(176),n(177),n(178),n(179),n(181),n(183),n(184),n(25),n(185),n(11),n(16),n(37);function r(t,e,n){return{openSimpleModal:function(e){return t.open({templateUrl:e.warning?"js/angular/core/templates/modal/modal-warning.html":"js/angular/core/templates/modal/modal-simple.html",controller:"SimpleModalCtrl",size:e.size,resolve:{title:function(){return e.title},message:function(){return n.trustAsHtml(e.message)}}})},openCopyToClipboardModal:function(n){const r=t.open({templateUrl:"js/angular/core/templates/modal/copy-to-clipboard-modal.html",controller:"CopyToClipboardModalCtrl",resolve:{uri:function(){return n}}});return r.opened.then((function(){e((function(){$("#clipboardURI")[0].select()}),100)})),r}}}function i(t){return{getDetails:function(e){return t.get("rest/explore/details",{params:{uri:e},headers:{Accept:"application/json"}})},getGraph:function(e){const n=encodeURIComponent(e);return t.get("rest/explore/graph?uri="+n+"&role=subject",{headers:{Accept:"application/rdf+json"}})},getNamespaceUriForPrefix:function(t,e){let n="";for(let r=0;r<t.length;r++)if(t[r].prefix===e){n=t[r].uri;break}return n},getNamespacePrefixForUri:function(t,e){let n="";for(let r=0;r<t.length;r++)if(t[r].uri===e){n=t[r].prefix;break}return n},getLocalName:function(t){if(angular.isUndefined(t))return t;{let e;const n=t.length-1;let r=t.toString().lastIndexOf("/");r===n&&(e=t.substr(0,n),r=e.lastIndexOf("/"));let i=t.toString().lastIndexOf("#");return i===n&&(e=t.substr(0,n),i=e.lastIndexOf("/")),t.toString().substring(Math.max(i,r)+1)}}}}angular.module("graphdb.framework.core",["ui.bootstrap","jlareau.bowser","LocalStorageModule","graphdb.framework.core.controllers","pascalprecht.translate"]).provider("$menuItems",(function(){const t=function(e,n){for(let r=0;r<e.length;r++){const i=e[r];if(i.label===n)return i;const s=t(i.children,n);if(!angular.isUndefined(s))return s}},e=function(t,e){for(let n=0;n<t.length;n++){if(t[n].label===e)return!0}return!1},n=function(t,e){return t.order<e.order?-1:t.order>e.order?1:0},r=function(t,e){return{label:t.label,labelKey:t.labelKey,href:t.href,hrefFun:t.hrefFun,order:t.order,role:t.role,editions:t.editions,icon:t.icon,guideSelector:t.guideSelector,children:e}};let i;const s=[];let o=[];this.addItem=function(t){angular.isUndefined(t.parent)?e(s,t.label)||(s.push(r(t,[])),this.updateItemsWithMissedParent()):this.addItemToParent(t)||o.push(t)},this.addItemToParent=function(n){const i=t(s,n.parent);return!angular.isUndefined(i)&&!e(i.children,n.label)&&(i.children.push(r(n,n.children?n.children:[])),!0)},this.updateItemsWithMissedParent=function(){if(o.length>0){const t=[];let e=this;o.forEach((function(n){e.addItemToParent(n)||t.push(n)})),o=t}},this.$get=function(){s.sort(n);for(let t=0;t<s.length;t++){s[t].children.sort(n)}return s},this.setProductInfo=function(t){i=t},this.getProductInfo=function(){return i}})).factory("ModalService",r).factory("ClassInstanceDetailsService",i),r.$inject=["$modal","$timeout","$sce"],i.$inject=["$http"]},function(t,e){function n(t,e){return{get:function(e){return t.get(e)},set:function(e,n){t.set(e,n)},keys:n,remove:r,clearAll:function(){t.clearAll()},clearClassHieararchyState:function(){n().forEach((function(t){0!==t.indexOf("classHierarchy-")||t===e.CLASS_HIERARCHY_HIDE_PREFIXES||t.startsWith("classHierarchy-selectedGraph-")||r(t)}))}};function n(){return t.keys()}function r(e){t.remove(e)}}angular.module("graphdb.framework.utils.localstorageadapter",[]).factory("LocalStorageAdapter",n).value("LSKeys",{TABS_STATE:"tabs-state",TABS_STATE_CURRENT_ID:"tabs-state-currentid",TABS_STATE_MAXID:"tabs-state-maxid",VIEW_MODE:"viewMode",CLASS_HIERARCHY_HIDE_PREFIXES:"classHierarchy-hidePrefixes",CLASS_HIERARCHY_CURRENT_SLIDER_VALUE:"classHierarchy-currentSliderValue",CLASS_HIERARCHY_SWITCH_PREFIXES:"classHierarchy-switchPrefixes",CLASS_HIERARCHY_LAST_SELECTED_CLASS:"classHierarchy-lastSelectedClass",DOMAIN_RANGE_WENT_BACK:"domainRange-wentBack",DOMAIN_RANGE_COLLAPSE_EDGES:"domainRange-collapseEdges",HIDE_SIMILARITY_HELP:"hide-similarity-help",TUTORIAL_STATE:"tutorial-state",MENU_STATE:"menu-state",HIDE_GRAPH_CONFIG_HELP:"hide-graph-config-help",GRAPHS_VIZ:"graphs-viz",AUTOCOMPLETE_ENABLED:"autocomplete.enabled",RDF_SEARCH_TYPE:"rdf-search.search-type",RDF_SEARCH_INPUT:"rdf-search.search-input",RDF_SEARCH_EXPANDED_URI:"rdf-search.search-expanded-uri",RDF_RESOURCE_DESCRIPTION:"rdf-search.resource-description",PREFERRED_LANG:"preferred-language",WORKBENCH_SETTINGS:"workbench-settings"}),n.$inject=["localStorageService","LSKeys"]},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,n){"use strict";n.r(e),n.d(e,"GUIDE_ID",(function(){return cn})),n.d(e,"GUIDE_CURRENT_STEP_ID",(function(){return ln})),n.d(e,"GUIDE_STEP_HISTORY",(function(){return hn})),n.d(e,"GUIDE_PAUSE",(function(){return fn}));var r=n(1),i=function(t){return function(t){return!!t&&"object"==typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===s}(t)}(t)};
|
|
28
|
-
/*! shepherd.js 10.0.1 */var s="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function o(t,e){return!1!==e.clone&&e.isMergeableObject(t)?h((n=t,Array.isArray(n)?[]:{}),t,e):t;var n}function a(t,e,n){return t.concat(e).map((function(t){return o(t,n)}))}function u(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter((function(e){return t.propertyIsEnumerable(e)})):[]}(t))}function c(t,e){try{return e in t}catch(t){return!1}}function l(t,e,n){var r={};return n.isMergeableObject(t)&&u(t).forEach((function(e){r[e]=o(t[e],n)})),u(e).forEach((function(i){(function(t,e){return c(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))})(t,i)||(c(t,i)&&n.isMergeableObject(e[i])?r[i]=function(t,e){if(!e.customMerge)return h;var n=e.customMerge(t);return"function"==typeof n?n:h}(i,n)(t[i],e[i],n):r[i]=o(e[i],n))})),r}function h(t,e,n){(n=n||{}).arrayMerge=n.arrayMerge||a,n.isMergeableObject=n.isMergeableObject||i,n.cloneUnlessOtherwiseSpecified=o;var r=Array.isArray(e);return r===Array.isArray(t)?r?n.arrayMerge(t,e,n):l(t,e,n):o(e,n)}h.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce((function(t,n){return h(t,n,e)}),{})};var f=h;function p(t){return t instanceof HTMLElement}function d(t){return"function"==typeof t}function g(t){return"string"==typeof t}function m(t){return void 0===t}class v{on(t,e,n,r){return void 0===r&&(r=!1),m(this.bindings)&&(this.bindings={}),m(this.bindings[t])&&(this.bindings[t]=[]),this.bindings[t].push({handler:e,ctx:n,once:r}),this}once(t,e,n){return this.on(t,e,n,!0)}off(t,e){return m(this.bindings)||m(this.bindings[t])||(m(e)?delete this.bindings[t]:this.bindings[t].forEach((n,r)=>{n.handler===e&&this.bindings[t].splice(r,1)})),this}trigger(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return!m(this.bindings)&&this.bindings[t]&&this.bindings[t].forEach((e,r)=>{const{ctx:i,handler:s,once:o}=e,a=i||this;s.apply(a,n),o&&this.bindings[t].splice(r,1)}),this}}function y(t){const e=Object.getOwnPropertyNames(t.constructor.prototype);for(let n=0;n<e.length;n++){const r=e[n],i=t[r];"constructor"!==r&&"function"==typeof i&&(t[r]=i.bind(t))}return t}function b(t){const{event:e,selector:n}=t.options.advanceOn||{};if(!e)return console.error("advanceOn was defined, but no event name was passed.");{const r=function(t,e){return n=>{if(e.isOpen()){const r=e.el&&n.currentTarget===e.el;(!m(t)&&n.currentTarget.matches(t)||r)&&e.tour.next()}}}(n,t);let i;try{i=document.querySelector(n)}catch(t){}if(!m(n)&&!i)return console.error("No element was found for the selector supplied to advanceOn: "+n);i?(i.addEventListener(e,r),t.on("destroy",()=>i.removeEventListener(e,r))):(document.body.addEventListener(e,r,!0),t.on("destroy",()=>document.body.removeEventListener(e,r,!0)))}}var w="top",x="bottom",S="right",E="left",F=[w,x,S,E],A=F.reduce((function(t,e){return t.concat([e+"-start",e+"-end"])}),[]),C=[].concat(F,["auto"]).reduce((function(t,e){return t.concat([e,e+"-start",e+"-end"])}),[]),D=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function I(t){return t?(t.nodeName||"").toLowerCase():null}function $(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function R(t){return t instanceof $(t).Element||t instanceof Element}function T(t){return t instanceof $(t).HTMLElement||t instanceof HTMLElement}function _(t){return"undefined"!=typeof ShadowRoot&&(t instanceof $(t).ShadowRoot||t instanceof ShadowRoot)}var P={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},r=e.attributes[t]||{},i=e.elements[t];T(i)&&I(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(t){var e=r[t];!1===e?i.removeAttribute(t):i.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var r=e.elements[t],i=e.attributes[t]||{},s=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});T(r)&&I(r)&&(Object.assign(r.style,s),Object.keys(i).forEach((function(t){r.removeAttribute(t)})))}))}},requires:["computeStyles"]};function k(t){return t.split("-")[0]}var O=Math.max,j=Math.min,B=Math.round;function N(t,e){void 0===e&&(e=!1);var n=t.getBoundingClientRect(),r=1,i=1;if(T(t)&&e){var s=t.offsetHeight,o=t.offsetWidth;o>0&&(r=B(n.width)/o||1),s>0&&(i=B(n.height)/s||1)}return{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function L(t){var e=N(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function H(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&_(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function M(t){return $(t).getComputedStyle(t)}function U(t){return["table","td","th"].indexOf(I(t))>=0}function V(t){return((R(t)?t.ownerDocument:t.document)||window.document).documentElement}function q(t){return"html"===I(t)?t:t.assignedSlot||t.parentNode||(_(t)?t.host:null)||V(t)}function K(t){return T(t)&&"fixed"!==M(t).position?t.offsetParent:null}function z(t){for(var e=$(t),n=K(t);n&&U(n)&&"static"===M(n).position;)n=K(n);return n&&("html"===I(n)||"body"===I(n)&&"static"===M(n).position)?e:n||function(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&T(t)&&"fixed"===M(t).position)return null;var n=q(t);for(_(n)&&(n=n.host);T(n)&&["html","body"].indexOf(I(n))<0;){var r=M(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||e&&"filter"===r.willChange||e&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(t)||e}function G(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function W(t,e,n){return O(t,j(e,n))}function Y(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function X(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}function J(t){return t.split("-")[1]}var Z={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Q(t){var e,n=t.popper,r=t.popperRect,i=t.placement,s=t.variation,o=t.offsets,a=t.position,u=t.gpuAcceleration,c=t.adaptive,l=t.roundOffsets,h=t.isFixed,f=o.x,p=void 0===f?0:f,d=o.y,g=void 0===d?0:d,m="function"==typeof l?l({x:p,y:g}):{x:p,y:g};p=m.x,g=m.y;var v=o.hasOwnProperty("x"),y=o.hasOwnProperty("y"),b=E,F=w,A=window;if(c){var C=z(n),D="clientHeight",I="clientWidth";if(C===$(n)&&"static"!==M(C=V(n)).position&&"absolute"===a&&(D="scrollHeight",I="scrollWidth"),C=C,i===w||(i===E||i===S)&&"end"===s)F=x,g-=(h&&C===A&&A.visualViewport?A.visualViewport.height:C[D])-r.height,g*=u?1:-1;if(i===E||(i===w||i===x)&&"end"===s)b=S,p-=(h&&C===A&&A.visualViewport?A.visualViewport.width:C[I])-r.width,p*=u?1:-1}var R,T=Object.assign({position:a},c&&Z),_=!0===l?function(t){var e=t.x,n=t.y,r=window.devicePixelRatio||1;return{x:B(e*r)/r||0,y:B(n*r)/r||0}}({x:p,y:g}):{x:p,y:g};return p=_.x,g=_.y,u?Object.assign({},T,((R={})[F]=y?"0":"",R[b]=v?"0":"",R.transform=(A.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",R)):Object.assign({},T,((e={})[F]=y?g+"px":"",e[b]=v?p+"px":"",e.transform="",e))}var tt={passive:!0};var et={left:"right",right:"left",bottom:"top",top:"bottom"};function nt(t){return t.replace(/left|right|bottom|top/g,(function(t){return et[t]}))}var rt={start:"end",end:"start"};function it(t){return t.replace(/start|end/g,(function(t){return rt[t]}))}function st(t){var e=$(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ot(t){return N(V(t)).left+st(t).scrollLeft}function at(t){var e=M(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function ut(t,e){var n;void 0===e&&(e=[]);var r=function t(e){return["html","body","#document"].indexOf(I(e))>=0?e.ownerDocument.body:T(e)&&at(e)?e:t(q(e))}(t),i=r===(null==(n=t.ownerDocument)?void 0:n.body),s=$(r),o=i?[s].concat(s.visualViewport||[],at(r)?r:[]):r,a=e.concat(o);return i?a:a.concat(ut(q(o)))}function ct(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function lt(t,e){return"viewport"===e?ct(function(t){var e=$(t),n=V(t),r=e.visualViewport,i=n.clientWidth,s=n.clientHeight,o=0,a=0;return r&&(i=r.width,s=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=r.offsetLeft,a=r.offsetTop)),{width:i,height:s,x:o+ot(t),y:a}}(t)):R(e)?function(t){var e=N(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(e):ct(function(t){var e,n=V(t),r=st(t),i=null==(e=t.ownerDocument)?void 0:e.body,s=O(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=O(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+ot(t),u=-r.scrollTop;return"rtl"===M(i||n).direction&&(a+=O(n.clientWidth,i?i.clientWidth:0)-s),{width:s,height:o,x:a,y:u}}(V(t)))}function ht(t,e,n){var r="clippingParents"===e?function(t){var e=ut(q(t)),n=["absolute","fixed"].indexOf(M(t).position)>=0&&T(t)?z(t):t;return R(n)?e.filter((function(t){return R(t)&&H(t,n)&&"body"!==I(t)})):[]}(t):[].concat(e),i=[].concat(r,[n]),s=i[0],o=i.reduce((function(e,n){var r=lt(t,n);return e.top=O(r.top,e.top),e.right=j(r.right,e.right),e.bottom=j(r.bottom,e.bottom),e.left=O(r.left,e.left),e}),lt(t,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function ft(t){var e,n=t.reference,r=t.element,i=t.placement,s=i?k(i):null,o=i?J(i):null,a=n.x+n.width/2-r.width/2,u=n.y+n.height/2-r.height/2;switch(s){case w:e={x:a,y:n.y-r.height};break;case x:e={x:a,y:n.y+n.height};break;case S:e={x:n.x+n.width,y:u};break;case E:e={x:n.x-r.width,y:u};break;default:e={x:n.x,y:n.y}}var c=s?G(s):null;if(null!=c){var l="y"===c?"height":"width";switch(o){case"start":e[c]=e[c]-(n[l]/2-r[l]/2);break;case"end":e[c]=e[c]+(n[l]/2-r[l]/2)}}return e}function pt(t,e){void 0===e&&(e={});var n=e,r=n.placement,i=void 0===r?t.placement:r,s=n.boundary,o=void 0===s?"clippingParents":s,a=n.rootBoundary,u=void 0===a?"viewport":a,c=n.elementContext,l=void 0===c?"popper":c,h=n.altBoundary,f=void 0!==h&&h,p=n.padding,d=void 0===p?0:p,g=Y("number"!=typeof d?d:X(d,F)),m="popper"===l?"reference":"popper",v=t.rects.popper,y=t.elements[f?m:l],b=ht(R(y)?y:y.contextElement||V(t.elements.popper),o,u),E=N(t.elements.reference),A=ft({reference:E,element:v,strategy:"absolute",placement:i}),C=ct(Object.assign({},v,A)),D="popper"===l?C:E,I={top:b.top-D.top+g.top,bottom:D.bottom-b.bottom+g.bottom,left:b.left-D.left+g.left,right:D.right-b.right+g.right},$=t.modifiersData.offset;if("popper"===l&&$){var T=$[i];Object.keys(I).forEach((function(t){var e=[S,x].indexOf(t)>=0?1:-1,n=[w,x].indexOf(t)>=0?"y":"x";I[t]+=T[n]*e}))}return I}function dt(t,e){void 0===e&&(e={});var n=e,r=n.placement,i=n.boundary,s=n.rootBoundary,o=n.padding,a=n.flipVariations,u=n.allowedAutoPlacements,c=void 0===u?C:u,l=J(r),h=l?a?A:A.filter((function(t){return J(t)===l})):F,f=h.filter((function(t){return c.indexOf(t)>=0}));0===f.length&&(f=h);var p=f.reduce((function(e,n){return e[n]=pt(t,{placement:n,boundary:i,rootBoundary:s,padding:o})[k(n)],e}),{});return Object.keys(p).sort((function(t,e){return p[t]-p[e]}))}function gt(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function mt(t){return[w,S,x,E].some((function(e){return t[e]>=0}))}function vt(t,e,n){void 0===n&&(n=!1);var r,i,s=T(e),o=T(e)&&function(t){var e=t.getBoundingClientRect(),n=B(e.width)/t.offsetWidth||1,r=B(e.height)/t.offsetHeight||1;return 1!==n||1!==r}(e),a=V(e),u=N(t,o),c={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(s||!s&&!n)&&(("body"!==I(e)||at(a))&&(c=(r=e)!==$(r)&&T(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:st(r)),T(e)?((l=N(e,!0)).x+=e.clientLeft,l.y+=e.clientTop):a&&(l.x=ot(a))),{x:u.left+c.scrollLeft-l.x,y:u.top+c.scrollTop-l.y,width:u.width,height:u.height}}function yt(t){var e=new Map,n=new Set,r=[];return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||function t(i){n.add(i.name),[].concat(i.requires||[],i.requiresIfExists||[]).forEach((function(r){if(!n.has(r)){var i=e.get(r);i&&t(i)}})),r.push(i)}(t)})),r}var bt={placement:"bottom",modifiers:[],strategy:"absolute"};function wt(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function xt(t){void 0===t&&(t={});var e=t,n=e.defaultModifiers,r=void 0===n?[]:n,i=e.defaultOptions,s=void 0===i?bt:i;return function(t,e,n){void 0===n&&(n=s);var i,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},bt,s),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},u=[],c=!1,l={state:a,setOptions:function(n){var i="function"==typeof n?n(a.options):n;h(),a.options=Object.assign({},s,a.options,i),a.scrollParents={reference:R(t)?ut(t):t.contextElement?ut(t.contextElement):[],popper:ut(e)};var o,c,f=function(t){var e=yt(t);return D.reduce((function(t,n){return t.concat(e.filter((function(t){return t.phase===n})))}),[])}((o=[].concat(r,a.options.modifiers),c=o.reduce((function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t}),{}),Object.keys(c).map((function(t){return c[t]}))));return a.orderedModifiers=f.filter((function(t){return t.enabled})),a.orderedModifiers.forEach((function(t){var e=t.name,n=t.options,r=void 0===n?{}:n,i=t.effect;if("function"==typeof i){var s=i({state:a,name:e,instance:l,options:r});u.push(s||function(){})}})),l.update()},forceUpdate:function(){if(!c){var t=a.elements,e=t.reference,n=t.popper;if(wt(e,n)){a.rects={reference:vt(e,z(n),"fixed"===a.options.strategy),popper:L(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(t){return a.modifiersData[t.name]=Object.assign({},t.data)}));for(var r=0;r<a.orderedModifiers.length;r++)if(!0!==a.reset){var i=a.orderedModifiers[r],s=i.fn,o=i.options,u=void 0===o?{}:o,h=i.name;"function"==typeof s&&(a=s({state:a,options:u,name:h,instance:l})||a)}else a.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(t){l.forceUpdate(),t(a)}))},function(){return o||(o=new Promise((function(t){Promise.resolve().then((function(){o=void 0,t(i())}))}))),o}),destroy:function(){h(),c=!0}};if(!wt(t,e))return l;function h(){u.forEach((function(t){return t()})),u=[]}return l.setOptions(n).then((function(t){!c&&n.onFirstUpdate&&n.onFirstUpdate(t)})),l}}var St=xt({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,s=void 0===i||i,o=r.resize,a=void 0===o||o,u=$(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach((function(t){t.addEventListener("scroll",n.update,tt)})),a&&u.addEventListener("resize",n.update,tt),function(){s&&c.forEach((function(t){t.removeEventListener("scroll",n.update,tt)})),a&&u.removeEventListener("resize",n.update,tt)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=ft({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=void 0===r||r,s=n.adaptive,o=void 0===s||s,a=n.roundOffsets,u=void 0===a||a,c={placement:k(e.placement),variation:J(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Q(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:u})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Q(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},P,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,r=t.name,i=n.offset,s=void 0===i?[0,0]:i,o=C.reduce((function(t,n){return t[n]=function(t,e,n){var r=k(t),i=[E,w].indexOf(r)>=0?-1:1,s="function"==typeof n?n(Object.assign({},e,{placement:t})):n,o=s[0],a=s[1];return o=o||0,a=(a||0)*i,[E,S].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}(n,e.rects,s),t}),{}),a=o[e.placement],u=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=o}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,s=void 0===i||i,o=n.altAxis,a=void 0===o||o,u=n.fallbackPlacements,c=n.padding,l=n.boundary,h=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,d=void 0===p||p,g=n.allowedAutoPlacements,m=e.options.placement,v=k(m),y=u||(v===m||!d?[nt(m)]:function(t){if("auto"===k(t))return[];var e=nt(t);return[it(t),e,it(e)]}(m)),b=[m].concat(y).reduce((function(t,n){return t.concat("auto"===k(n)?dt(e,{placement:n,boundary:l,rootBoundary:h,padding:c,flipVariations:d,allowedAutoPlacements:g}):n)}),[]),F=e.rects.reference,A=e.rects.popper,C=new Map,D=!0,I=b[0],$=0;$<b.length;$++){var R=b[$],T=k(R),_="start"===J(R),P=[w,x].indexOf(T)>=0,O=P?"width":"height",j=pt(e,{placement:R,boundary:l,rootBoundary:h,altBoundary:f,padding:c}),B=P?_?S:E:_?x:w;F[O]>A[O]&&(B=nt(B));var N=nt(B),L=[];if(s&&L.push(j[T]<=0),a&&L.push(j[B]<=0,j[N]<=0),L.every((function(t){return t}))){I=R,D=!1;break}C.set(R,L)}if(D)for(var H=function(t){var e=b.find((function(e){var n=C.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return I=e,"break"},M=d?3:1;M>0;M--){if("break"===H(M))break}e.placement!==I&&(e.modifiersData[r]._skip=!0,e.placement=I,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,s=void 0===i||i,o=n.altAxis,a=void 0!==o&&o,u=n.boundary,c=n.rootBoundary,l=n.altBoundary,h=n.padding,f=n.tether,p=void 0===f||f,d=n.tetherOffset,g=void 0===d?0:d,m=pt(e,{boundary:u,rootBoundary:c,padding:h,altBoundary:l}),v=k(e.placement),y=J(e.placement),b=!y,F=G(v),A="x"===F?"y":"x",C=e.modifiersData.popperOffsets,D=e.rects.reference,I=e.rects.popper,$="function"==typeof g?g(Object.assign({},e.rects,{placement:e.placement})):g,R="number"==typeof $?{mainAxis:$,altAxis:$}:Object.assign({mainAxis:0,altAxis:0},$),T=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,_={x:0,y:0};if(C){if(s){var P,B="y"===F?w:E,N="y"===F?x:S,H="y"===F?"height":"width",M=C[F],U=M+m[B],V=M-m[N],q=p?-I[H]/2:0,K="start"===y?D[H]:I[H],Y="start"===y?-I[H]:-D[H],X=e.elements.arrow,Z=p&&X?L(X):{width:0,height:0},Q=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},tt=Q[B],et=Q[N],nt=W(0,D[H],Z[H]),rt=b?D[H]/2-q-nt-tt-R.mainAxis:K-nt-tt-R.mainAxis,it=b?-D[H]/2+q+nt+et+R.mainAxis:Y+nt+et+R.mainAxis,st=e.elements.arrow&&z(e.elements.arrow),ot=st?"y"===F?st.clientTop||0:st.clientLeft||0:0,at=null!=(P=null==T?void 0:T[F])?P:0,ut=M+it-at,ct=W(p?j(U,M+rt-at-ot):U,M,p?O(V,ut):V);C[F]=ct,_[F]=ct-M}if(a){var lt,ht="x"===F?w:E,ft="x"===F?x:S,dt=C[A],gt="y"===A?"height":"width",mt=dt+m[ht],vt=dt-m[ft],yt=-1!==[w,E].indexOf(v),bt=null!=(lt=null==T?void 0:T[A])?lt:0,wt=yt?mt:dt-D[gt]-I[gt]-bt+R.altAxis,xt=yt?dt+D[gt]+I[gt]-bt-R.altAxis:vt,St=p&&yt?function(t,e,n){var r=W(t,e,n);return r>n?n:r}(wt,dt,xt):W(p?wt:mt,dt,p?xt:vt);C[A]=St,_[A]=St-dt}e.modifiersData[r]=_}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,r=t.name,i=t.options,s=n.elements.arrow,o=n.modifiersData.popperOffsets,a=k(n.placement),u=G(a),c=[E,S].indexOf(a)>=0?"height":"width";if(s&&o){var l=function(t,e){return Y("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:X(t,F))}(i.padding,n),h=L(s),f="y"===u?w:E,p="y"===u?x:S,d=n.rects.reference[c]+n.rects.reference[u]-o[u]-n.rects.popper[c],g=o[u]-n.rects.reference[u],m=z(s),v=m?"y"===u?m.clientHeight||0:m.clientWidth||0:0,y=d/2-g/2,b=l[f],A=v-h[c]-l[p],C=v/2-h[c]/2+y,D=W(b,C,A),I=u;n.modifiersData[r]=((e={})[I]=D,e.centerOffset=D-C,e)}},effect:function(t){var e=t.state,n=t.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=e.elements.popper.querySelector(r)))&&H(e.elements.popper,r)&&(e.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,s=e.modifiersData.preventOverflow,o=pt(e,{elementContext:"reference"}),a=pt(e,{altBoundary:!0}),u=gt(o,r),c=gt(a,i,s),l=mt(u),h=mt(c);e.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":h})}}]});function Et(){return(Et=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function Ft(t){return{name:"focusAfterRender",enabled:!0,phase:"afterWrite",fn(){setTimeout(()=>{if(t.el){const e={preventScroll:!0};t.el.focus(e)}},300)}}}function At(t){const e=[{name:"applyStyles",fn(t){let{state:e}=t;Object.keys(e.elements).forEach(t=>{if("popper"!==t)return;const n=e.attributes[t]||{},r=e.elements[t];Object.assign(r.style,{position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)"}),Object.keys(n).forEach(t=>{const e=n[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)})})}},{name:"computeStyles",options:{adaptive:!1}}];let n={placement:"top",strategy:"fixed",modifiers:[Ft(t)]};return n=Et({},n,{modifiers:Array.from(new Set([...n.modifiers,...e]))}),n}function Ct(t){return g(t)&&""!==t?"-"!==t.charAt(t.length-1)?t+"-":t:""}function Dt(t){return null==t||(!t.element||!t.on)}function It(t){t.tooltip&&t.tooltip.destroy();const e=t._getResolvedAttachToOptions();let n=e.element;const r=function(t,e){let n={modifiers:[{name:"preventOverflow",options:{altAxis:!0,tether:!1}},Ft(e)],strategy:"absolute"};Dt(t)?n=At(e):n.placement=t.on;const r=e.tour&&e.tour.options&&e.tour.options.defaultStepOptions;r&&(n=Rt(r,n));return n=Rt(e.options,n),n}(e,t);if(Dt(e)){n=document.body;t.shepherdElementComponent.getElement().classList.add("shepherd-centered")}return t.tooltip=St(n,t.el,r),t.target=e.element,r}function $t(){let t=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)})}function Rt(t,e){if(t.popperOptions){let n=Object.assign({},e,t.popperOptions);if(t.popperOptions.modifiers&&t.popperOptions.modifiers.length>0){const r=t.popperOptions.modifiers.map(t=>t.name),i=e.modifiers.filter(t=>!r.includes(t.name));n.modifiers=Array.from(new Set([...i,...t.popperOptions.modifiers]))}return n}return e}function Tt(){}function _t(t,e){for(const n in e)t[n]=e[n];return t}function Pt(t){return t()}function kt(){return Object.create(null)}function Ot(t){t.forEach(Pt)}function jt(t){return"function"==typeof t}function Bt(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function Nt(t,e){t.appendChild(e)}function Lt(t,e,n){t.insertBefore(e,n||null)}function Ht(t){t.parentNode.removeChild(t)}function Mt(t){return document.createElement(t)}function Ut(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Vt(t){return document.createTextNode(t)}function qt(){return Vt(" ")}function Kt(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function zt(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function Gt(t,e){const n=Object.getOwnPropertyDescriptors(t.__proto__);for(const r in e)null==e[r]?t.removeAttribute(r):"style"===r?t.style.cssText=e[r]:"__value"===r?t.value=t[r]=e[r]:n[r]&&n[r].set?t[r]=e[r]:zt(t,r,e[r])}function Wt(t,e,n){t.classList[n?"add":"remove"](e)}let Yt;function Xt(t){Yt=t}function Jt(){if(!Yt)throw new Error("Function called outside component initialization");return Yt}function Zt(t){Jt().$$.after_update.push(t)}const Qt=[],te=[],ee=[],ne=[],re=Promise.resolve();let ie=!1;function se(t){ee.push(t)}const oe=new Set;let ae=0;function ue(){const t=Yt;do{for(;ae<Qt.length;){const t=Qt[ae];ae++,Xt(t),ce(t.$$)}for(Xt(null),Qt.length=0,ae=0;te.length;)te.pop()();for(let t=0;t<ee.length;t+=1){const e=ee[t];oe.has(e)||(oe.add(e),e())}ee.length=0}while(Qt.length);for(;ne.length;)ne.pop()();ie=!1,oe.clear(),Xt(t)}function ce(t){if(null!==t.fragment){t.update(),Ot(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(se)}}const le=new Set;let he;function fe(){he={r:0,c:[],p:he}}function pe(){he.r||Ot(he.c),he=he.p}function de(t,e){t&&t.i&&(le.delete(t),t.i(e))}function ge(t,e,n,r){if(t&&t.o){if(le.has(t))return;le.add(t),he.c.push(()=>{le.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}else r&&r()}function me(t){t&&t.c()}function ve(t,e,n,r){const{fragment:i,on_mount:s,on_destroy:o,after_update:a}=t.$$;i&&i.m(e,n),r||se(()=>{const e=s.map(Pt).filter(jt);o?o.push(...e):Ot(e),t.$$.on_mount=[]}),a.forEach(se)}function ye(t,e){const n=t.$$;null!==n.fragment&&(Ot(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function be(t,e){-1===t.$$.dirty[0]&&(Qt.push(t),ie||(ie=!0,re.then(ue)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function we(t,e,n,r,i,s,o,a){void 0===a&&(a=[-1]);const u=Yt;Xt(t);const c=t.$$={fragment:null,ctx:null,props:s,update:Tt,not_equal:i,bound:kt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(u?u.$$.context:[])),callbacks:kt(),dirty:a,skip_bound:!1,root:e.target||u.$$.root};o&&o(c.root);let l=!1;if(c.ctx=n?n(t,e.props||{},(function(e,n){const r=!(arguments.length<=2)&&arguments.length-2?arguments.length<=2?void 0:arguments[2]:n;return c.ctx&&i(c.ctx[e],c.ctx[e]=r)&&(!c.skip_bound&&c.bound[e]&&c.bound[e](r),l&&be(t,e)),n})):[],c.update(),l=!0,Ot(c.before_update),c.fragment=!!r&&r(c.ctx),e.target){if(e.hydrate){const t=(h=e.target,Array.from(h.childNodes));c.fragment&&c.fragment.l(t),t.forEach(Ht)}else c.fragment&&c.fragment.c();e.intro&&de(t.$$.fragment),ve(t,e.target,e.anchor,e.customElement),ue()}var h;Xt(u)}class xe{$destroy(){ye(this,1),this.$destroy=Tt}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function Se(t){let e,n,r,i,s;return{c(){e=Mt("button"),zt(e,"aria-label",n=t[3]?t[3]:null),zt(e,"class",r=`${t[1]||""} shepherd-button ${t[4]?"shepherd-button-secondary":""}`),e.disabled=t[2],zt(e,"tabindex","0")},m(n,r){Lt(n,e,r),e.innerHTML=t[5],i||(s=Kt(e,"click",(function(){jt(t[0])&&t[0].apply(this,arguments)})),i=!0)},p(i,s){let[o]=s;t=i,32&o&&(e.innerHTML=t[5]),8&o&&n!==(n=t[3]?t[3]:null)&&zt(e,"aria-label",n),18&o&&r!==(r=`${t[1]||""} shepherd-button ${t[4]?"shepherd-button-secondary":""}`)&&zt(e,"class",r),4&o&&(e.disabled=t[2])},i:Tt,o:Tt,d(t){t&&Ht(e),i=!1,s()}}}function Ee(t,e,n){let r,i,s,o,a,u,{config:c,step:l}=e;function h(t){return d(t)?t.call(l):t}return t.$$set=t=>{"config"in t&&n(6,c=t.config),"step"in t&&n(7,l=t.step)},t.$$.update=()=>{192&t.$$.dirty&&(n(0,r=c.action?c.action.bind(l.tour):null),n(1,i=c.classes),n(2,s=!!c.disabled&&h(c.disabled)),n(3,o=c.label?h(c.label):null),n(4,a=c.secondary),n(5,u=c.text?h(c.text):null))},[r,i,s,o,a,u,c,l]}class Fe extends xe{constructor(t){super(),we(this,t,Ee,Se,Bt,{config:6,step:7})}}function Ae(t,e,n){const r=t.slice();return r[2]=e[n],r}function Ce(t){let e,n,r=t[1],i=[];for(let e=0;e<r.length;e+=1)i[e]=De(Ae(t,r,e));const s=t=>ge(i[t],1,1,()=>{i[t]=null});return{c(){for(let t=0;t<i.length;t+=1)i[t].c();e=Vt("")},m(t,r){for(let e=0;e<i.length;e+=1)i[e].m(t,r);Lt(t,e,r),n=!0},p(t,n){if(3&n){let o;for(r=t[1],o=0;o<r.length;o+=1){const s=Ae(t,r,o);i[o]?(i[o].p(s,n),de(i[o],1)):(i[o]=De(s),i[o].c(),de(i[o],1),i[o].m(e.parentNode,e))}for(fe(),o=r.length;o<i.length;o+=1)s(o);pe()}},i(t){if(!n){for(let t=0;t<r.length;t+=1)de(i[t]);n=!0}},o(t){i=i.filter(Boolean);for(let t=0;t<i.length;t+=1)ge(i[t]);n=!1},d(t){!function(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(i,t),t&&Ht(e)}}}function De(t){let e,n;return e=new Fe({props:{config:t[2],step:t[0]}}),{c(){me(e.$$.fragment)},m(t,r){ve(e,t,r),n=!0},p(t,n){const r={};2&n&&(r.config=t[2]),1&n&&(r.step=t[0]),e.$set(r)},i(t){n||(de(e.$$.fragment,t),n=!0)},o(t){ge(e.$$.fragment,t),n=!1},d(t){ye(e,t)}}}function Ie(t){let e,n,r=t[1]&&Ce(t);return{c(){e=Mt("footer"),r&&r.c(),zt(e,"class","shepherd-footer")},m(t,i){Lt(t,e,i),r&&r.m(e,null),n=!0},p(t,n){let[i]=n;t[1]?r?(r.p(t,i),2&i&&de(r,1)):(r=Ce(t),r.c(),de(r,1),r.m(e,null)):r&&(fe(),ge(r,1,1,()=>{r=null}),pe())},i(t){n||(de(r),n=!0)},o(t){ge(r),n=!1},d(t){t&&Ht(e),r&&r.d()}}}function $e(t,e,n){let r,{step:i}=e;return t.$$set=t=>{"step"in t&&n(0,i=t.step)},t.$$.update=()=>{1&t.$$.dirty&&n(1,r=i.options.buttons)},[i,r]}class Re extends xe{constructor(t){super(),we(this,t,$e,Ie,Bt,{step:0})}}function Te(t){let e,n,r,i,s;return{c(){e=Mt("button"),n=Mt("span"),n.textContent="×",zt(n,"aria-hidden","true"),zt(e,"aria-label",r=t[0].label?t[0].label:"Close Tour"),zt(e,"class","shepherd-cancel-icon"),zt(e,"type","button")},m(r,o){Lt(r,e,o),Nt(e,n),i||(s=Kt(e,"click",t[1]),i=!0)},p(t,n){let[i]=n;1&i&&r!==(r=t[0].label?t[0].label:"Close Tour")&&zt(e,"aria-label",r)},i:Tt,o:Tt,d(t){t&&Ht(e),i=!1,s()}}}function _e(t,e,n){let{cancelIcon:r,step:i}=e;return t.$$set=t=>{"cancelIcon"in t&&n(0,r=t.cancelIcon),"step"in t&&n(2,i=t.step)},[r,t=>{t.preventDefault(),i.cancel()},i]}class Pe extends xe{constructor(t){super(),we(this,t,_e,Te,Bt,{cancelIcon:0,step:2})}}function ke(t){let e;return{c(){e=Mt("h3"),zt(e,"id",t[1]),zt(e,"class","shepherd-title")},m(n,r){Lt(n,e,r),t[3](e)},p(t,n){let[r]=n;2&r&&zt(e,"id",t[1])},i:Tt,o:Tt,d(n){n&&Ht(e),t[3](null)}}}function Oe(t,e,n){let{labelId:r,element:i,title:s}=e;return Zt(()=>{d(s)&&n(2,s=s()),n(0,i.innerHTML=s,i)}),t.$$set=t=>{"labelId"in t&&n(1,r=t.labelId),"element"in t&&n(0,i=t.element),"title"in t&&n(2,s=t.title)},[i,r,s,function(t){te[t?"unshift":"push"](()=>{i=t,n(0,i)})}]}class je extends xe{constructor(t){super(),we(this,t,Oe,ke,Bt,{labelId:1,element:0,title:2})}}function Be(t){let e,n;return e=new je({props:{labelId:t[0],title:t[2]}}),{c(){me(e.$$.fragment)},m(t,r){ve(e,t,r),n=!0},p(t,n){const r={};1&n&&(r.labelId=t[0]),4&n&&(r.title=t[2]),e.$set(r)},i(t){n||(de(e.$$.fragment,t),n=!0)},o(t){ge(e.$$.fragment,t),n=!1},d(t){ye(e,t)}}}function Ne(t){let e,n;return e=new Pe({props:{cancelIcon:t[3],step:t[1]}}),{c(){me(e.$$.fragment)},m(t,r){ve(e,t,r),n=!0},p(t,n){const r={};8&n&&(r.cancelIcon=t[3]),2&n&&(r.step=t[1]),e.$set(r)},i(t){n||(de(e.$$.fragment,t),n=!0)},o(t){ge(e.$$.fragment,t),n=!1},d(t){ye(e,t)}}}function Le(t){let e,n,r,i=t[2]&&Be(t),s=t[3]&&t[3].enabled&&Ne(t);return{c(){e=Mt("header"),i&&i.c(),n=qt(),s&&s.c(),zt(e,"class","shepherd-header")},m(t,o){Lt(t,e,o),i&&i.m(e,null),Nt(e,n),s&&s.m(e,null),r=!0},p(t,r){let[o]=r;t[2]?i?(i.p(t,o),4&o&&de(i,1)):(i=Be(t),i.c(),de(i,1),i.m(e,n)):i&&(fe(),ge(i,1,1,()=>{i=null}),pe()),t[3]&&t[3].enabled?s?(s.p(t,o),8&o&&de(s,1)):(s=Ne(t),s.c(),de(s,1),s.m(e,null)):s&&(fe(),ge(s,1,1,()=>{s=null}),pe())},i(t){r||(de(i),de(s),r=!0)},o(t){ge(i),ge(s),r=!1},d(t){t&&Ht(e),i&&i.d(),s&&s.d()}}}function He(t,e,n){let r,i,{labelId:s,step:o}=e;return t.$$set=t=>{"labelId"in t&&n(0,s=t.labelId),"step"in t&&n(1,o=t.step)},t.$$.update=()=>{2&t.$$.dirty&&(n(2,r=o.options.title),n(3,i=o.options.cancelIcon))},[s,o,r,i]}class Me extends xe{constructor(t){super(),we(this,t,He,Le,Bt,{labelId:0,step:1})}}function Ue(t){let e;return{c(){e=Mt("div"),zt(e,"class","shepherd-text"),zt(e,"id",t[1])},m(n,r){Lt(n,e,r),t[3](e)},p(t,n){let[r]=n;2&r&&zt(e,"id",t[1])},i:Tt,o:Tt,d(n){n&&Ht(e),t[3](null)}}}function Ve(t,e,n){let{descriptionId:r,element:i,step:s}=e;return Zt(()=>{let{text:t}=s.options;d(t)&&(t=t.call(s)),p(t)?i.appendChild(t):n(0,i.innerHTML=t,i)}),t.$$set=t=>{"descriptionId"in t&&n(1,r=t.descriptionId),"element"in t&&n(0,i=t.element),"step"in t&&n(2,s=t.step)},[i,r,s,function(t){te[t?"unshift":"push"](()=>{i=t,n(0,i)})}]}class qe extends xe{constructor(t){super(),we(this,t,Ve,Ue,Bt,{descriptionId:1,element:0,step:2})}}function Ke(t){let e,n;return e=new Me({props:{labelId:t[1],step:t[2]}}),{c(){me(e.$$.fragment)},m(t,r){ve(e,t,r),n=!0},p(t,n){const r={};2&n&&(r.labelId=t[1]),4&n&&(r.step=t[2]),e.$set(r)},i(t){n||(de(e.$$.fragment,t),n=!0)},o(t){ge(e.$$.fragment,t),n=!1},d(t){ye(e,t)}}}function ze(t){let e,n;return e=new qe({props:{descriptionId:t[0],step:t[2]}}),{c(){me(e.$$.fragment)},m(t,r){ve(e,t,r),n=!0},p(t,n){const r={};1&n&&(r.descriptionId=t[0]),4&n&&(r.step=t[2]),e.$set(r)},i(t){n||(de(e.$$.fragment,t),n=!0)},o(t){ge(e.$$.fragment,t),n=!1},d(t){ye(e,t)}}}function Ge(t){let e,n;return e=new Re({props:{step:t[2]}}),{c(){me(e.$$.fragment)},m(t,r){ve(e,t,r),n=!0},p(t,n){const r={};4&n&&(r.step=t[2]),e.$set(r)},i(t){n||(de(e.$$.fragment,t),n=!0)},o(t){ge(e.$$.fragment,t),n=!1},d(t){ye(e,t)}}}function We(t){let e,n,r,i,s=!m(t[2].options.title)||t[2].options.cancelIcon&&t[2].options.cancelIcon.enabled,o=!m(t[2].options.text),a=Array.isArray(t[2].options.buttons)&&t[2].options.buttons.length,u=s&&Ke(t),c=o&&ze(t),l=a&&Ge(t);return{c(){e=Mt("div"),u&&u.c(),n=qt(),c&&c.c(),r=qt(),l&&l.c(),zt(e,"class","shepherd-content")},m(t,s){Lt(t,e,s),u&&u.m(e,null),Nt(e,n),c&&c.m(e,null),Nt(e,r),l&&l.m(e,null),i=!0},p(t,i){let[h]=i;4&h&&(s=!m(t[2].options.title)||t[2].options.cancelIcon&&t[2].options.cancelIcon.enabled),s?u?(u.p(t,h),4&h&&de(u,1)):(u=Ke(t),u.c(),de(u,1),u.m(e,n)):u&&(fe(),ge(u,1,1,()=>{u=null}),pe()),4&h&&(o=!m(t[2].options.text)),o?c?(c.p(t,h),4&h&&de(c,1)):(c=ze(t),c.c(),de(c,1),c.m(e,r)):c&&(fe(),ge(c,1,1,()=>{c=null}),pe()),4&h&&(a=Array.isArray(t[2].options.buttons)&&t[2].options.buttons.length),a?l?(l.p(t,h),4&h&&de(l,1)):(l=Ge(t),l.c(),de(l,1),l.m(e,null)):l&&(fe(),ge(l,1,1,()=>{l=null}),pe())},i(t){i||(de(u),de(c),de(l),i=!0)},o(t){ge(u),ge(c),ge(l),i=!1},d(t){t&&Ht(e),u&&u.d(),c&&c.d(),l&&l.d()}}}function Ye(t,e,n){let{descriptionId:r,labelId:i,step:s}=e;return t.$$set=t=>{"descriptionId"in t&&n(0,r=t.descriptionId),"labelId"in t&&n(1,i=t.labelId),"step"in t&&n(2,s=t.step)},[r,i,s]}class Xe extends xe{constructor(t){super(),we(this,t,Ye,We,Bt,{descriptionId:0,labelId:1,step:2})}}function Je(t){let e;return{c(){e=Mt("div"),zt(e,"class","shepherd-arrow"),zt(e,"data-popper-arrow","")},m(t,n){Lt(t,e,n)},d(t){t&&Ht(e)}}}function Ze(t){let e,n,r,i,s,o,a,u,c=t[4].options.arrow&&t[4].options.attachTo&&t[4].options.attachTo.element&&t[4].options.attachTo.on&&Je();r=new Xe({props:{descriptionId:t[2],labelId:t[3],step:t[4]}});let l=[{"aria-describedby":i=m(t[4].options.text)?null:t[2]},{"aria-labelledby":s=t[4].options.title?t[3]:null},t[1],{role:"dialog"},{tabindex:"0"}],h={};for(let t=0;t<l.length;t+=1)h=_t(h,l[t]);return{c(){e=Mt("div"),c&&c.c(),n=qt(),me(r.$$.fragment),Gt(e,h),Wt(e,"shepherd-has-cancel-icon",t[5]),Wt(e,"shepherd-has-title",t[6]),Wt(e,"shepherd-element",!0)},m(i,s){Lt(i,e,s),c&&c.m(e,null),Nt(e,n),ve(r,e,null),t[13](e),o=!0,a||(u=Kt(e,"keydown",t[7]),a=!0)},p(t,a){let[u]=a;t[4].options.arrow&&t[4].options.attachTo&&t[4].options.attachTo.element&&t[4].options.attachTo.on?c||(c=Je(),c.c(),c.m(e,n)):c&&(c.d(1),c=null);const f={};4&u&&(f.descriptionId=t[2]),8&u&&(f.labelId=t[3]),16&u&&(f.step=t[4]),r.$set(f),Gt(e,h=function(t,e){const n={},r={},i={$$scope:1};let s=t.length;for(;s--;){const o=t[s],a=e[s];if(a){for(const t in o)t in a||(r[t]=1);for(const t in a)i[t]||(n[t]=a[t],i[t]=1);t[s]=a}else for(const t in o)i[t]=1}for(const t in r)t in n||(n[t]=void 0);return n}(l,[(!o||20&u&&i!==(i=m(t[4].options.text)?null:t[2]))&&{"aria-describedby":i},(!o||24&u&&s!==(s=t[4].options.title?t[3]:null))&&{"aria-labelledby":s},2&u&&t[1],{role:"dialog"},{tabindex:"0"}])),Wt(e,"shepherd-has-cancel-icon",t[5]),Wt(e,"shepherd-has-title",t[6]),Wt(e,"shepherd-element",!0)},i(t){o||(de(r.$$.fragment,t),o=!0)},o(t){ge(r.$$.fragment,t),o=!1},d(n){n&&Ht(e),c&&c.d(),ye(r),t[13](null),a=!1,u()}}}function Qe(t){return t.split(" ").filter(t=>!!t.length)}function tn(t,e,n){let r,i,s,{classPrefix:o,element:a,descriptionId:u,firstFocusableElement:c,focusableElements:l,labelId:h,lastFocusableElement:f,step:p,dataStepId:d}=e;var m;m=()=>{n(1,d={[`data-${o}shepherd-step-id`]:p.id}),n(9,l=a.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]')),n(8,c=l[0]),n(10,f=l[l.length-1])},Jt().$$.on_mount.push(m),Zt(()=>{s!==p.options.classes&&(function(t){if(g(t)){const e=Qe(t);e.length&&a.classList.remove(...e)}}(s),s=p.options.classes,function(t){if(g(t)){const e=Qe(t);e.length&&a.classList.add(...e)}}(s))});return t.$$set=t=>{"classPrefix"in t&&n(11,o=t.classPrefix),"element"in t&&n(0,a=t.element),"descriptionId"in t&&n(2,u=t.descriptionId),"firstFocusableElement"in t&&n(8,c=t.firstFocusableElement),"focusableElements"in t&&n(9,l=t.focusableElements),"labelId"in t&&n(3,h=t.labelId),"lastFocusableElement"in t&&n(10,f=t.lastFocusableElement),"step"in t&&n(4,p=t.step),"dataStepId"in t&&n(1,d=t.dataStepId)},t.$$.update=()=>{16&t.$$.dirty&&(n(5,r=p.options&&p.options.cancelIcon&&p.options.cancelIcon.enabled),n(6,i=p.options&&p.options.title))},[a,d,u,h,p,r,i,t=>{const{tour:e}=p;switch(t.keyCode){case 9:if(0===l.length){t.preventDefault();break}t.shiftKey?(document.activeElement===c||document.activeElement.classList.contains("shepherd-element"))&&(t.preventDefault(),f.focus()):document.activeElement===f&&(t.preventDefault(),c.focus());break;case 27:e.options.exitOnEsc&&p.cancel();break;case 37:e.options.keyboardNavigation&&e.back();break;case 39:e.options.keyboardNavigation&&e.next()}},c,l,f,o,()=>a,function(t){te[t?"unshift":"push"](()=>{a=t,n(0,a)})}]}class en extends xe{constructor(t){super(),we(this,t,tn,Ze,Bt,{classPrefix:11,element:0,descriptionId:2,firstFocusableElement:8,focusableElements:9,labelId:3,lastFocusableElement:10,step:4,dataStepId:1,getElement:12})}get getElement(){return this.$$.ctx[12]}}var nn=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t,e){t.exports={polyfill:function(){var t=window,e=document;if(!("scrollBehavior"in e.documentElement.style)||!0===t.__forceSmoothScrollPolyfill__){var n,r=t.HTMLElement||t.Element,i={scroll:t.scroll||t.scrollTo,scrollBy:t.scrollBy,elementScroll:r.prototype.scroll||a,scrollIntoView:r.prototype.scrollIntoView},s=t.performance&&t.performance.now?t.performance.now.bind(t.performance):Date.now,o=(n=t.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);t.scroll=t.scrollTo=function(){void 0!==arguments[0]&&(!0!==u(arguments[0])?d.call(t,e.body,void 0!==arguments[0].left?~~arguments[0].left:t.scrollX||t.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:t.scrollY||t.pageYOffset):i.scroll.call(t,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:t.scrollX||t.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:t.scrollY||t.pageYOffset))},t.scrollBy=function(){void 0!==arguments[0]&&(u(arguments[0])?i.scrollBy.call(t,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):d.call(t,e.body,~~arguments[0].left+(t.scrollX||t.pageXOffset),~~arguments[0].top+(t.scrollY||t.pageYOffset)))},r.prototype.scroll=r.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==u(arguments[0])){var t=arguments[0].left,e=arguments[0].top;d.call(this,this,void 0===t?this.scrollLeft:~~t,void 0===e?this.scrollTop:~~e)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},r.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==u(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},r.prototype.scrollIntoView=function(){if(!0!==u(arguments[0])){var n=f(this),r=n.getBoundingClientRect(),s=this.getBoundingClientRect();n!==e.body?(d.call(this,n,n.scrollLeft+s.left-r.left,n.scrollTop+s.top-r.top),"fixed"!==t.getComputedStyle(n).position&&t.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):t.scrollBy({left:s.left,top:s.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function a(t,e){this.scrollLeft=t,this.scrollTop=e}function u(t){if(null===t||"object"!=typeof t||void 0===t.behavior||"auto"===t.behavior||"instant"===t.behavior)return!0;if("object"==typeof t&&"smooth"===t.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+t.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(t,e){return"Y"===e?t.clientHeight+o<t.scrollHeight:"X"===e?t.clientWidth+o<t.scrollWidth:void 0}function l(e,n){var r=t.getComputedStyle(e,null)["overflow"+n];return"auto"===r||"scroll"===r}function h(t){var e=c(t,"Y")&&l(t,"Y"),n=c(t,"X")&&l(t,"X");return e||n}function f(t){for(;t!==e.body&&!1===h(t);)t=t.parentNode||t.host;return t}function p(e){var n,r,i,o,a=(s()-e.startTime)/468;o=a=a>1?1:a,n=.5*(1-Math.cos(Math.PI*o)),r=e.startX+(e.x-e.startX)*n,i=e.startY+(e.y-e.startY)*n,e.method.call(e.scrollable,r,i),r===e.x&&i===e.y||t.requestAnimationFrame(p.bind(t,e))}function d(n,r,o){var u,c,l,h,f=s();n===e.body?(u=t,c=t.scrollX||t.pageXOffset,l=t.scrollY||t.pageYOffset,h=i.scroll):(u=n,c=n.scrollLeft,l=n.scrollTop,h=a),p({scrollable:u,method:h,startTime:f,startX:c,startY:l,x:r,y:o})}}}}));nn.polyfill,nn.polyfill();class rn extends v{constructor(t,e){return void 0===e&&(e={}),super(t,e),this.tour=t,this.classPrefix=this.tour.options?Ct(this.tour.options.classPrefix):"",this.styles=t.styles,this._resolvedAttachTo=null,y(this),this._setOptions(e),this}cancel(){this.tour.cancel(),this.trigger("cancel")}complete(){this.tour.complete(),this.trigger("complete")}destroy(){this.tooltip&&(this.tooltip.destroy(),this.tooltip=null),p(this.el)&&this.el.parentNode&&(this.el.parentNode.removeChild(this.el),this.el=null),this._updateStepTargetOnHide(),this.trigger("destroy")}getTour(){return this.tour}hide(){this.tour.modal.hide(),this.trigger("before-hide"),this.el&&(this.el.hidden=!0),this._updateStepTargetOnHide(),this.trigger("hide")}_resolveAttachToOptions(){return this._resolvedAttachTo=function(t){const e=t.options.attachTo||{},n=Object.assign({},e);if(d(n.element)&&(n.element=n.element.call(t)),g(n.element)){try{n.element=document.querySelector(n.element)}catch(t){}n.element||console.error("The element for this Shepherd step was not found "+e.element)}return n}(this),this._resolvedAttachTo}_getResolvedAttachToOptions(){return null===this._resolvedAttachTo?this._resolveAttachToOptions():this._resolvedAttachTo}isOpen(){return Boolean(this.el&&!this.el.hidden)}show(){if(d(this.options.beforeShowPromise)){const t=this.options.beforeShowPromise();if(!m(t))return t.then(()=>this._show())}this._show()}updateStepOptions(t){Object.assign(this.options,t),this.shepherdElementComponent&&this.shepherdElementComponent.$set({step:this})}getElement(){return this.el}getTarget(){return this.target}_createTooltipContent(){const t=this.id+"-description",e=this.id+"-label";return this.shepherdElementComponent=new en({target:this.tour.options.stepsContainer||document.body,props:{classPrefix:this.classPrefix,descriptionId:t,labelId:e,step:this,styles:this.styles}}),this.shepherdElementComponent.getElement()}_scrollTo(t){const{element:e}=this._getResolvedAttachToOptions();d(this.options.scrollToHandler)?this.options.scrollToHandler(e):e instanceof Element&&"function"==typeof e.scrollIntoView&&e.scrollIntoView(t)}_getClassOptions(t){const e=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions,n=t.classes?t.classes:"",r=e&&e.classes?e.classes:"",i=[...n.split(" "),...r.split(" ")],s=new Set(i);return Array.from(s).join(" ").trim()}_setOptions(t){void 0===t&&(t={});let e=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions;e=f({},e||{}),this.options=Object.assign({arrow:!0},e,t);const{when:n}=this.options;this.options.classes=this._getClassOptions(t),this.destroy(),this.id=this.options.id||"step-"+$t(),n&&Object.keys(n).forEach(t=>{this.on(t,n[t],this)})}_setupElements(){m(this.el)||this.destroy(),this.el=this._createTooltipContent(),this.options.advanceOn&&b(this),It(this)}_show(){this.trigger("before-show"),this._resolveAttachToOptions(),this._setupElements(),this.tour.modal||this.tour._setupModal(),this.tour.modal.setupForStep(this),this._styleTargetElementForStep(this),this.el.hidden=!1,this.options.scrollTo&&setTimeout(()=>{this._scrollTo(this.options.scrollTo)}),this.el.hidden=!1;const t=this.shepherdElementComponent.getElement(),e=this.target||document.body;e.classList.add(this.classPrefix+"shepherd-enabled"),e.classList.add(this.classPrefix+"shepherd-target"),t.classList.add("shepherd-enabled"),this.trigger("show")}_styleTargetElementForStep(t){const e=t.target;e&&(t.options.highlightClass&&e.classList.add(t.options.highlightClass),e.classList.remove("shepherd-target-click-disabled"),!1===t.options.canClickTarget&&e.classList.add("shepherd-target-click-disabled"))}_updateStepTargetOnHide(){const t=this.target||document.body;this.options.highlightClass&&t.classList.remove(this.options.highlightClass),t.classList.remove("shepherd-target-click-disabled",this.classPrefix+"shepherd-enabled",this.classPrefix+"shepherd-target")}}function sn(t){let e,n,r,i,s;return{c(){e=Ut("svg"),n=Ut("path"),zt(n,"d",t[2]),zt(e,"class",r=(t[1]?"shepherd-modal-is-visible":"")+" shepherd-modal-overlay-container")},m(r,o){Lt(r,e,o),Nt(e,n),t[11](e),i||(s=Kt(e,"touchmove",t[3]),i=!0)},p(t,i){let[s]=i;4&s&&zt(n,"d",t[2]),2&s&&r!==(r=(t[1]?"shepherd-modal-is-visible":"")+" shepherd-modal-overlay-container")&&zt(e,"class",r)},i:Tt,o:Tt,d(n){n&&Ht(e),t[11](null),i=!1,s()}}}function on(t,e,n){let{element:r,openingProperties:i}=e;$t();let s,o=!1,a=void 0;u();function u(){n(4,i={width:0,height:0,x:0,y:0,r:0})}function c(){n(1,o=!1),p()}function l(t,e,r,s){if(void 0===t&&(t=0),void 0===e&&(e=0),s){const{y:o,height:a}=function(t,e){const n=t.getBoundingClientRect();let r=n.y||n.top,i=n.bottom||r+n.height;if(e){const t=e.getBoundingClientRect(),n=t.y||t.top,s=t.bottom||n+t.height;r=Math.max(r,n),i=Math.min(i,s)}return{y:r,height:Math.max(i-r,0)}}(s,r),{x:u,width:c,left:l}=s.getBoundingClientRect();n(4,i={width:c+2*t,height:a+2*t,x:(u||l)-t,y:o-t,r:e})}else u()}function h(){n(1,o=!0)}const f=t=>{t.preventDefault()};function p(){a&&(cancelAnimationFrame(a),a=void 0),window.removeEventListener("touchmove",f,{passive:!1})}return t.$$set=t=>{"element"in t&&n(0,r=t.element),"openingProperties"in t&&n(4,i=t.openingProperties)},t.$$.update=()=>{16&t.$$.dirty&&n(2,s=function(t){let{width:e,height:n,x:r=0,y:i=0,r:s=0}=t;const{innerWidth:o,innerHeight:a}=window;return`M${o},${a}H0V0H${o}V${a}ZM${r+s},${i}a${s},${s},0,0,0-${s},${s}V${n+i-s}a${s},${s},0,0,0,${s},${s}H${e+r-s}a${s},${s},0,0,0,${s}-${s}V${i+s}a${s},${s},0,0,0-${s}-${s}Z`}(i))},[r,o,s,t=>{t.stopPropagation()},i,()=>r,u,c,l,function(t){p(),t.tour.options.useModalOverlay?(!function(t){const{modalOverlayOpeningPadding:e,modalOverlayOpeningRadius:n}=t.options,r=function t(e){if(!e)return null;const n=e instanceof HTMLElement&&window.getComputedStyle(e).overflowY;return"hidden"!==n&&"visible"!==n&&e.scrollHeight>=e.clientHeight?e:t(e.parentElement)}(t.target),i=()=>{a=void 0,l(e,n,r,t.target),a=requestAnimationFrame(i)};i(),window.addEventListener("touchmove",f,{passive:!1})}(t),h()):c()},h,function(t){te[t?"unshift":"push"](()=>{r=t,n(0,r)})}]}class an extends xe{constructor(t){super(),we(this,t,on,sn,Bt,{element:0,openingProperties:4,getElement:5,closeModalOpening:6,hide:7,positionModal:8,setupForStep:9,show:10})}get getElement(){return this.$$.ctx[5]}get closeModalOpening(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[7]}get positionModal(){return this.$$.ctx[8]}get setupForStep(){return this.$$.ctx[9]}get show(){return this.$$.ctx[10]}}const un=new v;Object.assign(un,{Tour:class extends v{constructor(t){void 0===t&&(t={}),super(t),y(this);this.options=Object.assign({},{exitOnEsc:!0,keyboardNavigation:!0},t),this.classPrefix=Ct(this.options.classPrefix),this.steps=[],this.addSteps(this.options.steps);return["active","cancel","complete","inactive","show","start"].map(t=>{(t=>{this.on(t,e=>{(e=e||{}).tour=this,un.trigger(t,e)})})(t)}),this._setTourID(),this}addStep(t,e){let n=t;return n instanceof rn?n.tour=this:n=new rn(this,n),m(e)?this.steps.push(n):this.steps.splice(e,0,n),n}addSteps(t){return Array.isArray(t)&&t.forEach(t=>{this.addStep(t)}),this}back(){const t=this.steps.indexOf(this.currentStep);this.show(t-1,!1)}cancel(){if(this.options.confirmCancel){const t=this.options.confirmCancelMessage||"Are you sure you want to stop the tour?";window.confirm(t)&&this._done("cancel")}else this._done("cancel")}complete(){this._done("complete")}getById(t){return this.steps.find(e=>e.id===t)}getCurrentStep(){return this.currentStep}hide(){const t=this.getCurrentStep();if(t)return t.hide()}isActive(){return un.activeTour===this}next(){const t=this.steps.indexOf(this.currentStep);t===this.steps.length-1?this.complete():this.show(t+1,!0)}removeStep(t){const e=this.getCurrentStep();this.steps.some((e,n)=>{if(e.id===t)return e.isOpen()&&e.hide(),e.destroy(),this.steps.splice(n,1),!0}),e&&e.id===t&&(this.currentStep=void 0,this.steps.length?this.show(0):this.cancel())}show(t,e){void 0===t&&(t=0),void 0===e&&(e=!0);const n=g(t)?this.getById(t):this.steps[t];if(n){this._updateStateBeforeShow();d(n.options.showOn)&&!n.options.showOn()?this._skipStep(n,e):(this.trigger("show",{step:n,previous:this.currentStep}),this.currentStep=n,n.show())}}start(){this.trigger("start"),this.focusedElBeforeOpen=document.activeElement,this.currentStep=null,this._setupModal(),this._setupActiveTour(),this.next()}_done(t){const e=this.steps.indexOf(this.currentStep);if(Array.isArray(this.steps)&&this.steps.forEach(t=>t.destroy()),function(t){if(t){const{steps:e}=t;e.forEach(t=>{t.options&&!1===t.options.canClickTarget&&t.options.attachTo&&t.target instanceof HTMLElement&&t.target.classList.remove("shepherd-target-click-disabled")})}}(this),this.trigger(t,{index:e}),un.activeTour=null,this.trigger("inactive",{tour:this}),this.modal&&this.modal.hide(),("cancel"===t||"complete"===t)&&this.modal){const t=document.querySelector(".shepherd-modal-overlay-container");t&&t.remove()}p(this.focusedElBeforeOpen)&&this.focusedElBeforeOpen.focus()}_setupActiveTour(){this.trigger("active",{tour:this}),un.activeTour=this}_setupModal(){this.modal=new an({target:this.options.modalContainer||document.body,props:{classPrefix:this.classPrefix,styles:this.styles}})}_skipStep(t,e){const n=this.steps.indexOf(t);if(n===this.steps.length-1)this.complete();else{const t=e?n+1:n-1;this.show(t,e)}}_updateStateBeforeShow(){this.currentStep&&this.currentStep.hide(),this.isActive()||this._setupActiveTour()}_setTourID(){const t=this.options.tourName||"tour";this.id=`${t}--${$t()}`}},Step:rn});const cn="shepherd.guide_id",ln="shepherd.guide.current.step.id",hn="shepherd.guide.step.history",fn="shepherd.guide.pause";function pn(t,e,n,i,s,o,a){this.guideCancelSubscription=void 0,this.onPause=()=>{},this.onCancel=()=>{},this.startGuide=(t,e,r,i=!0)=>{if(i&&n.remove(hn),!e)return;const s=this._createGuide(t);this._addGuideSteps(s,e),this._startGuide(s,r)},this.resumeGuide=(t,e,r)=>{n.set(fn,!1),this.startGuide(t,e,r,!1)},this.isActive=()=>un.activeTour&&!this.isPaused(),this.isPaused=()=>"true"===n.get(fn),this.getGuideId=()=>n.get(cn),this.getCurrentStepId=()=>n.get(ln),this.subscribeToGuideCancel=t=>{angular.isFunction(t)&&(this.onCancel=t)},this.subscribeToGuidePause=t=>{angular.isFunction(t)&&(this.onPause=t)},this._createGuide=t=>(this._subscribeToGuideCanceled(),new un.Tour({name:t,useModalOverlay:!0,confirmCancel:!0,confirmCancelMessage:e.instant("guide.confirm.cancel.message"),defaultStepOptions:{classes:"shadow-md bg-purple-dark",scrollTo:!0}})),this._addGuideSteps=(t,e)=>{if(e.length>0&&t.addStep(this._getFirstStep(t,e)),e.length>2)for(let n=1;n<e.length-1;n++)t.addStep(this._getMiddleStep(t,e,n));e.length>1&&t.addStep(this._getLastStep(t,e))},this._startGuide=(s,a)=>{n.remove(fn);let u=s.steps.findIndex(t=>t.options.id===a);u<0&&(u=0);const c=s.steps[u],l=c.options.url;l&&(t.url(l),i.reload()),c.options.attachTo?r.GuideUtils.waitFor(c.options.attachTo.element,c.options.maxWaitTime).then(()=>s.show(u)).catch(t=>{console.log(t),o.error(e.instant("guide.start.unexpected.error.message"))}):s.show(u)},this._subscribeToGuideCanceled=()=>{this.guideCancelSubscription||(this.guideCancelSubscription=un.on("cancel",()=>{this._clearLocaleStorage();const t=un.activeTour.getCurrentStep();t&&angular.isFunction(t.hide)&&t.hide(),this.onCancel&&this.onCancel()}))},this._getFirstStep=function(t,e){const n=e.length>1?e[1]:void 0;return this._toGuideStep(t,void 0,e[0],n)},this._getMiddleStep=(t,e,n)=>this._toGuideStep(t,e[n-1],e[n],e[n+1]),this._getLastStep=(t,e)=>{const n=this._toGuideStep(t,e[e.length-2],e[e.length-1]);return n.buttons.push(this._getBackToGuidesButton(t)),n.buttons.push(this._getCancelButton(t)),n},this._getBackToGuidesButton=t=>this._getButton(e.instant("back.to.guides.btn"),()=>this._backToGuidesButton(t),!0),this._getCancelButton=t=>this._getButton(e.instant("common.close"),()=>this._cancelGuide(t,!1),!0),this._backToGuidesButton=e=>{t.path("guides"),this._cancelGuide(e,!1)},this._cancelGuide=(t,e=!0)=>{t.options.confirmCancel=e,t.cancel(),this.onCancel()&&this.onCancel()},this._toGuideStep=(t,n,r,i)=>{const s=this._toBaseGuideStep(t,e,r,()=>this._updateLocalStorage()),o=[];return n&&o.push(this._getPreviousButton(t)),i&&o.push(this._getNextButton(t,r,i)),r.skipPoint&&o.push(this._getSkipButton(t)),s.buttons=o,s},this._getPauseButton=t=>this._getButton(e.instant("pause.btn"),()=>this._pauseGuide(t),!0),this._getSkipButton=t=>this._getButton(e.instant("skip.btn"),()=>this._skipSteps(t),!0),this._skipSteps=t=>{const e=t.getCurrentStep(),n=t.steps.findIndex(t=>e.id===t.id);this._startGuide(t,this._getNextSkipPointId(t.steps,n))},this._getNextSkipPointId=(t,e)=>{for(let n=e+1;n<t.length;n++){const e=t.at(n);if(e.options.skipPoint)return e.id}return t.at(t.length-1).id},this._pauseGuide=t=>{t.hide();const e=this._getStepWhichCanBePaused(t.steps,t.getCurrentStep().id);this._saveStep(e),n.set(fn,!0);let r=!1;for(;!r;){const t=this._getHistory();t&&t.length>0&&t.at(t.length-1)!==e.options.id?this._removeLastStepFromHistory():r=!0}this.onPause()&&this.onPause()},this._getStepWhichCanBePaused=(t,e)=>{const n=t.findIndex(t=>t.id===e),r=t[n];return r.options.canBePaused?r:n>0?this._getStepWhichCanBePaused(t,t[n-1].id):void 0},this._getPreviousButton=t=>{const n=e.instant("previous.btn"),r=this._getPreviousButtonAction(t);return this._getButton(n,r)},this._getPreviousButtonAction=n=>()=>{const i=this._getPreviousStepIdFromHistory();let s;s=-1===i?n.steps.at(0):n.steps.find(t=>t.options.id===i);const a=n.getCurrentStep();a.hide(),a.options.initPreviousStep({GuideUtils:r.GuideUtils,ShepherdService:this},a.options.id).then(()=>{angular.isFunction(a.options.onPreviousClick)?a.options.onPreviousClick(n).then(t=>{!angular.isUndefined(t)&&null!==t&&t||(a.hide(),n.show(s.id))}).catch(t=>{console.log(t),o.error(e.instant("guide.unexpected.error.message")),this._cancelGuide(n,!1)}):((s.options.forceReload||s.options.url&&s.options.url!==a.options.url)&&t.path(s.options.url),a.hide(),n.show(s.id))}).catch(t=>{console.log(t),o.error(e.instant("guide.unexpected.error.message")),this._cancelGuide(n,!1)})},this._getNextButton=(t,n,r)=>{const i=e.instant("next.btn"),s=u(t,n,r);return this._getButton(i,s)};const u=(n,r,i)=>()=>{let s=!0;if(angular.isFunction(r.onNextValidate)&&(s=r.onNextValidate(r)),s)if(angular.isFunction(r.onNextClick)){const t=r.onNextClick(n,r);t instanceof Promise&&t.catch(t=>{console.log(t),o.error(e.instant("guide.unexpected.error.message")),this._cancelGuide(n,!1)})}else(i.forceReload||i.url&&i.url!==r.url)&&t.path(i.url),n.next()};this._updateLocalStorage=()=>{const t=un.activeTour;if(!t)return;const e=t.getCurrentStep(),n=t.steps.findIndex(t=>t.id===e.id),r=this.getCurrentStepId(),i=t.steps.findIndex(t=>t.id===r);n>i?this._addStepToHistory(e):i>n&&this._removeLastStepFromHistory(),this._saveStep(e)},this._saveStep=t=>{t&&(n.set(cn,t.tour.options.name),n.set(ln,t.options.id))},this._addStepToHistory=t=>{const e=this._getHistory();e.push(t.options.id),n.set(hn,e)},this._getHistory=()=>{const t=n.get(hn);return t||[]},this._removeLastStepFromHistory=()=>{const t=this._getHistory();t.splice(t.length-1,1),n.set(hn,t)},this._getPreviousStepIdFromHistory=t=>{const e=this._getHistory()||[];if(t){const n=e.findIndex(e=>e===t);if(n>0)return e.at(n-1)}else if(e.length>1)return e.at(e.length-2);return-1},this.getPreviousStepFromHistory=t=>{const e=this._getPreviousStepIdFromHistory(t);return un.activeTour.steps.find(t=>t.id===e)},this._clearLocaleStorage=()=>{n.remove(cn),n.remove(fn),n.remove(ln),n.remove(hn)},this._toBaseGuideStep=(t,e,n,i)=>{let o;n.elementSelector&&(o={element:n.elementSelector,on:n.placement});const a=r.GuideUtils.unescapeHtml(r.GuideUtils.translateLocalMessage(e,s,n.title,n));let u="";if(n.stepsTotalN>1){const t=document.createElement("span");t.setAttribute("tooltip",e.instant("guide.block.progress.tooltip",{action:a})),t.setAttribute("tooltip-placement","bottom"),t.setAttribute("tooltip-trigger","mouseenter"),t.setAttribute("tooltip-append-to-body","false"),t.innerText=e.instant("guide.block.progress",{n:n.stepN+1,nn:n.stepsTotalN}),u=" — "+t.outerHTML}const c="readonly"!==n.type,l=n.extraPadding?n.extraPadding:0,h={id:n.id,title:a+u,text:()=>{const t=this._toParagraph(r.GuideUtils.translateLocalMessage(e,s,n.content,n));let i="";return n.extraContent&&(i=r.GuideUtils.translateLocalMessage(e,s,n.extraContent,n),i=this._toParagraph(i,n.extraContentClass)),t+i},url:n.url,maxWaitTime:n.maxWaitTime,cancelIcon:{enabled:!0},attachTo:o,modalOverlayOpeningPadding:l,modalOverlayOpeningRadius:0,canBePaused:n.canBePaused,advanceOn:n.advanceOn,showOn:n.showOn,scrollToHandler:n.scrollToHandler,classes:"guide-dialog",beforeShowPromise:n.beforeShowPromise,canClickTarget:c,keyboardNavigation:!1,skipPoint:n.skipPoint,onPreviousClick:n.onPreviousClick,initPreviousStep:n.initPreviousStep,when:{show:this._getShowFunction(t,n,i)}};return angular.isFunction(n.hide)&&(h.when.hide=n.hide(t)),h},this._getShowFunction=(t,e,n)=>angular.isFunction(e.show)?()=>{e.show(t)(),n(),this._whenStepShow(e)}:()=>{n(),this._whenStepShow(e)},this._whenStepShow=t=>{const e=un.activeTour.getCurrentStep(),n=e.getElement();this._addTotalProgress(e,n),this._addTypeIcon(n,t);const r=angular.element(n).scope();angular.isFunction(t.onScope)&&t.onScope(r),setTimeout(()=>r.$apply(()=>a(n)(r)))},this._toParagraph=(t,e)=>{if(t){const n=document.createElement("p");return e&&(n.className=e),n.innerHTML=t,n.outerHTML}return""},this._addTotalProgress=(t,n)=>{const r=un.activeTour.steps,i=n.querySelector(".shepherd-content"),s=document.createElement("div");s.className="shepherd-progress";const o=document.createElement("span");o.className="text-muted",o.innerText=e.instant("guide.total.progress",{n:r.indexOf(t)+1,nn:r.length}),o.setAttribute("tooltip",e.instant("guide.total.progress.tooltip")),o.setAttribute("tooltip-placement","left"),o.setAttribute("tooltip-trigger","mouseenter"),o.setAttribute("tooltip-append-to-body","false"),s.appendChild(o),i.appendChild(s)},this._addTypeIcon=(t,n)=>{let r,i;switch(n.type){case"clickable":r="focus",i="mouse";break;case"input":r="edit",i="input";break;default:r="info",i="info"}const s=document.createElement("span");s.className="shepherd-step-type icon-"+r+" icon-1-25x",s.setAttribute("tooltip",e.instant("guide.step-type."+i)),s.setAttribute("tooltip-placement","bottom-right"),s.setAttribute("tooltip-trigger","mouseenter"),s.setAttribute("tooltip-append-to-body","false"),angular.element(t.querySelector(".shepherd-header")).prepend(s)},this._getButton=(t,e,n)=>{const r={text:t,classes:n?"btn btn-secondary":"btn btn-primary",action:t=>{t.stopPropagation(),e()}};return r}}angular.module("graphdb.framework.guides.shepherd.services",["graphdb.framework.utils.localstorageadapter"]).service("ShepherdService",pn),pn.$inject=["$location","$translate","LocalStorageAdapter","$route","$interpolate","toastr","$compile"]},function(t,e){angular.module("graphdb.framework.rest.license.service",["ngFileUpload"]).factory("LicenseRestService",r),r.$inject=["$http","Upload"];const n="rest/graphdb-settings/license";function r(t,e){return{getLicenseInfo:function(){return t.get(n)},getHardcodedLicense:function(){return t.get(n+"/hardcoded")},sendLicenseToValidate:function(e){return t.post("rest/info/license/validate",e,{headers:{Accept:"application/json","Content-Type":"text/plain"}})},extractFromLicenseFile:function(t){return e.upload({url:"rest/info/license/to-base-64",file:t,headers:{Accept:"text/plain"}})},checkLicenseHardcoded:function(){return t.get(n+"/hardcoded")},registerLicense:function(e){const r=new Uint8Array(e.length);for(let t=0;t<r.length;t++)r[t]=e.charCodeAt(t);return t({method:"POST",url:n,headers:{"Content-Type":"application/octet-stream"},data:r,transformRequest:[]})},unregisterLicense:function(){return t({method:"DELETE",url:"rest/graphdb-settings/license"})},getInfo:function(){return t.get("rest/info/properties")},getVersion:function(e){return t.get("rest/info/version",{headers:{"X-GraphDB-Repository-Location":e}})},getStatistics:function(){return t.get("rest/graphdb-settings/statistics")},toggleStatistics:function(e){return t({method:"POST",url:"rest/graphdb-settings/statistics",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:"enabled="+e})}}}},function(t,e){angular.module("graphdb.framework.rest.repositories.service",[]).factory("RepositoriesRestService",n),n.$inject=["$http"];function n(t){return{getRepositories:function(e){return t.get("rest/repositories/all",{params:{location:e}})},getRepository:function(e){return t.get("rest/repositories/"+e.id,{params:{location:e.location}})},deleteRepository:function(e){return t.delete("rest/repositories/"+e.id,{params:{location:e.location}})},createRepository:function(e){return t.post("rest/repositories",e)},editRepository:function(e,n){return t.put("rest/repositories/"+e,n)},getRepositoryConfiguration:function(e){return t.get("rest/repositories/default-config/"+e)},getSize:function(e){return t.get(`rest/repositories/${e.id}/size`,{params:{location:e.location}})},getPrefix:function(e,n){return t.post(`rest/repositories/${e}/prefix`,null,{params:n})},getCluster:function(){return t.get("rest/repositories/cluster")},getRepositoryFileContent:function(e){return t.get("rest/repositories/file",{params:{fileLocation:e}})},updateRepositoryFileContent:function(e,n,r){return t.post("rest/repositories/file/update",JSON.stringify(n),{params:{fileLocation:e,location:r}})},validateOntopPropertiesConnection:function(e){return t.post("rest/repositories/ontop/test-connection",e.params.propertiesFile,{params:{location:e.location}})},restartRepository:function(e){return t.post(`rest/repositories/${e.id}/restart`,null,{params:{location:e.location}})},getSupportedDriversData:function(e){return t.get("rest/repositories/ontop/drivers",{params:{location:e.location}})},updatePropertiesFile:function(e,n,r){return t.post("rest/repositories/ontop/jdbc-properties",JSON.stringify(n),{params:{fileLocation:e,location:r}})},loadPropertiesFile:function(e,n){return t.get("rest/repositories/ontop/jdbc-properties",{params:{fileLocation:e,location:n}})},getRepositoriesFromKnownLocation:function(e){return t.get("rest/repositories?location="+e)}}}},function(t,e,n){"use strict";n.r(e);n(4),n(9),n(27),n(8),n(34),n(35);angular.module("graphdb.framework.core.services.repositories",["ngCookies","graphdb.framework.rest.repositories.service","graphdb.framework.rest.locations.service","graphdb.framework.rest.license.service","toastr"]).service("$repositories",["$http","toastr","$rootScope","$timeout","$location","productInfo","$jwtAuth","RepositoriesRestService","LocationsRestService","LicenseRestService","$translate","$q",function(t,e,n,r,i,s,o,a,u,c,l,h){this.repositoryStorageName="com.ontotext.graphdb.repository",this.repositoryStorageLocationName="com.ontotext.graphdb.repository.location",this.location={uri:"",label:"Local",local:!0},this.locationError="",this.loading=!0,this.repository={id:localStorage.getItem(this.repositoryStorageName)||"",location:localStorage.getItem(this.repositoryStorageLocationName)||""},this.locations=[this.location],this.repositories=new Map,this.locationsShouldReload=!0;const f=this,p=function(t,n){f.loading=!1,t&&(f.location={},f.locationError=n,f.repositories=new Map,f.setRepository(""),t.statusText?e.error(t.statusText,l.instant("repositories.service.error.loading.location")):e.error(l.instant("repositories.service.error.loading.location")))};let d;this.resetActiveRepository=function(){let t=f.repositories.get(this.repository.location),e=!1;t&&(e=t.find(t=>this.repository&&t.id===this.repository.id)),e?o.canReadRepo(this.repository)?n.$broadcast("repositoryIsSet",{newRepo:!1}):this.setRepository(""):this.setRepository(this.location.defaultRepository?{id:this.location.defaultRepository,location:this.location.uri}:"")},this.checkLocationsDegraded=function(t){this.locations.forEach(e=>{e.local||(e.errorMsg&&f.repositories.delete(e.uri)&&f.resetActiveRepository(),c.getVersion(e.uri).success((function(t){"object"==typeof t?t.productVersion!==s.productVersion&&(e.degradedReason=l.instant("repositories.service.different.gdb.version",{location:e.name})):e.degradedReason=l.instant("repositories.service.different.gdb.version",{location:e.name})})).error((function(n){e.errorMsg=n,t||(f.locationsShouldReload=!0)})))})},this.getDegradedReason=function(){let t=this.locations.find(t=>t.uri===this.repository.location);return t?t.degradedReason:""},this.clearLocationErrorMsg=function(t){let e=this.locations.find(e=>e.uri===t);e&&e.errorMsg&&(e.errorMsg=null)},this.initQuick=function(){this.hasActiveLocation()&&this.init(null,null,!0)},this.init=function(t,e,r){return this.loading=!0,r||(this.locationsShouldReload=!0),u.getActiveLocation().then((function(i){if(i.data){const s=i.data;if(s.active)return a.getRepositories().then((function(e){f.location=s,Object.entries(e.data).forEach(([t,e])=>{f.clearLocationErrorMsg(t),f.repositories.set(t,e)}),f.resetActiveRepository(),p(),f.checkLocationsDegraded(r),n.globalLocation=f.location,n.globalRepositories=f.getRepositories(),t&&t()})).catch((function(t){p(t),e&&e()}))}else p(),r&&(f.locationsShouldReload=!0),f.location="",f.repositories=new Map,f.setRepository("");n.globalLocation=f.location,n.globalRepositories=f.getRepositories()})).catch((function(t){p(t),e&&e()}))},this.getLocations=function(t){if(this.locationsShouldReload||d)return d||(this.locationsShouldReload=!1,this.locations=[this.location],d=u.getLocations(t).then(t=>(f.locations=t.data,this.locations)).catch((function(){r((function(){f.locationsShouldReload=!0}),2e3)})).finally(()=>{d=null})),d;const e=h.defer();return e.resolve(this.locations),e.promise},this.getActiveLocation=function(){return this.location},this.hasActiveLocation=function(){return!_.isEmpty(this.location)},this.getLocationError=function(){return this.locationError?this.locationError:l.instant("repositories.service.no.active.location")},this.isLoadingLocation=function(){return this.loading},this.getRepositories=function(){let t=[];return this.repositories.forEach(e=>t.push.apply(t,e)),t},this.getReadableRepositories=function(){return _.filter(this.getRepositories(),(function(t){return o.canReadRepo(t)}))},this.getWritableRepositories=function(){const t=this;return _.filter(this.getRepositories(),(function(e){return o.canWriteRepo(e)&&!t.isActiveRepoOntopType(e)}))},this.getActiveRepository=function(){return this.repository.id},this.getActiveRepositoryObject=function(){const t=this;let e=t.repositories.get(t.repository.location);return e?e.find(e=>e.id===t.repository.id):null},this.isSystemRepository=function(){return"SYSTEM"===this.repository.id},this.isActiveRepoOntopType=function(t){const e=this;let n;return t||(t=e.getActiveRepositoryObject()),t&&(n=e.repositories.get(t.location).find(e=>e.id===t.id),n)?"graphdb:OntopRepository"===n.sesameType:void 0===n},this.isActiveRepoFedXType=function(){const t=this;let e,n=t.getActiveRepositoryObject();return n&&(e=t.repositories.get(n.location).find(t=>t.id===n.id),e)?"graphdb:FedXRepository"===e.sesameType:void 0===e},this.getLocationFromUri=function(t){return this.locations.find(e=>e.uri===t)},this.setRepositoryHeaders=function(){t.defaults.headers.common["X-GraphDB-Repository"]=this.repository?this.repository.id:void 0,$.ajaxSetup().headers=$.ajaxSetup().headers||{},$.ajaxSetup().headers["X-GraphDB-Repository"]=this.repository?this.repository.id:void 0,t.defaults.headers.common["X-GraphDB-Repository-Location"]=this.repository?this.repository.location:void 0,$.ajaxSetup().headers=$.ajaxSetup().headers||{},$.ajaxSetup().headers["X-GraphDB-Repository-Location"]=this.repository?this.repository.location:void 0},f.setRepositoryHeaders(),this.setRepository=function(t){this.repository=t,t?(localStorage.setItem(f.repositoryStorageName,this.repository.id),localStorage.setItem(f.repositoryStorageLocationName,this.repository.location)):(localStorage.removeItem(f.repositoryStorageName),localStorage.removeItem(f.repositoryStorageLocationName)),f.setRepositoryHeaders(),n.$broadcast("repositoryIsSet",{newRepo:!0}),t&&!o.canReadRepo(t)&&this.setRepository(""),n.deniedPermissions={}},this.getDefaultRepository=function(){return this.hasActiveLocation()?this.location.defaultRepository:""},this.setDefaultRepository=function(t){if(!this.hasActiveLocation())return void e.error(l.instant("repositories.service.no.active.location"),l.instant("common.error"));const n=this;u.setDefaultRepository(t).success((function(){n.location.defaultRepository=t})).error((function(t){const n=getError(t);e.error(n,l.instant("common.error"))}))},this.deleteLocation=function(t){return u.deleteLocation(encodeURIComponent(t)).success((function(){let e=f.getActiveRepositoryObject();e&&e.location===t&&(f.location="",f.setRepository("")),f.init()})).error((function(t){const n=getError(t);e.error(n,l.instant("common.error"))}))},this.deleteRepository=function(t){return a.deleteRepository(t).success((function(){f.init()})).error((function(t){const n=getError(t);e.error(n,l.instant("common.error"))})).finally(()=>{const e=f.getActiveRepositoryObject();e&&e.id===t.id&&e.location===t.location&&f.setRepository("")})},this.restartRepository=function(t){return a.restartRepository(t).success((function(){e.success(l.instant("repositories.service.restarting.repo",{repositoryId:t.id})),f.initQuick()})).error((function(t){const n=getError(t);e.error(n,l.instant("common.error"))}))},this.getRepositoryTurtleConfig=function(e){return t.get("rest/repositories/"+e.id,{headers:{Accept:"text/turtle"}})},this.isRepoActive=function(t){return!!this.repository&&(t.id===this.repository.id&&t.location===this.repository.location)},this.getRepositoriesFromLocation=function(t){return this.repositories.get(t)},n.$on("securityInit",(function(t,e,n,r){(!e||n||r)&&f.init()}))}])},function(t,e,n){"use strict";n.r(e);n(5);var r=n(0);function i(){return{template:function(t,e){return'<object width="'+e.size+'" height="'+e.size+'" data="js/angular/templates/loader/ot-loader.svg?v=2.1.2-RC1">{{\'common.loading\' | translate}}</object>'}}}function s(){return{template:function(t,e){return'<object width="'+e.size+'" height="'+e.size+'" data="js/angular/templates/loader/ot-loader.svg?v=2.1.2-RC1"></object><div>{{\'common.loading\' | translate}}<div>'}}}function o(t){const e=function(t,n){n.timer=void 0,n.currentMessage=n.getMessage();const r=n.timeout[n.index%n.timeout.length];r&&(n.timer=t((function(){(n.index+1<n.message.length||0===n.message.length)&&(n.index++,e(t,n))}),1e3*r))};return{restrict:"EA",scope:{size:"@",trigger:"@",messageAttr:"=*message",timeoutAttr:"=*timeout",ngShow:"=",ngHide:"="},link:function(n){n.message=n.messageAttr,n.getMessage=function(){return n.message[n.index]},void 0===n.message?n.message=[""]:"function"==typeof n.message?(n.getMessage=n.message,n.message=[]):"object"!=typeof n.message&&(n.message=[n.message]),n.timeout=n.timeoutAttr,void 0===n.timeout?n.timeout=[0]:"object"!=typeof n.timeout&&(n.timeout=[n.timeout]),n.index=0,e(t,n);const r=function(r){n.timer&&t.cancel(n.timer),r&&(n.index=0,e(t,n))};n.$watch("ngShow",(function(t){r(t)})),n.$watch("ngHide",(function(t){r(!t)})),n.$on("$destroy",(function(){n.timer&&t.cancel(n.timer)}))},template:'<div class="ot-loader-new-content"><img width="{{size}}" height="{{size}}" src="js/angular/templates/loader/ot-loader.svg?v=2.1.2-RC1"/><div style="font-size: {{size/4}}px">{{currentMessage}}<div></div>'}}function a(t){return{restrict:"EA",transclude:!0,templateUrl:"js/angular/core/templates/core-errors.html",link:function(e,n,r){let i;e.setAttrs(r),e.setRestricted(),e.showRemoteLocations=!1,e.toggleShowRemoteLocations=()=>{e.showRemoteLocations=!e.showRemoteLocations},e.getAccessibleRepositories=function(){let t=t=>!0;return e.showRemoteLocations||(t=t=>t.local),e.isRestricted?e.getWritableRepositories().filter(t):e.getReadableRepositories().filter(t)},e.showPopoverForRepo=function(n,r){e.hidePopoverForRepo(),e.setPopoverRepo(r),t((function(){const t=$(n.toElement).find(".popover-anchor")[0];i=t,t&&!e.getActiveRepository()&&t.dispatchEvent(new Event("show"))})),n.stopPropagation()},e.hidePopoverForRepo=function(e){if(e){let t=e.relatedTarget;for(;t;){if(0===t.className.indexOf("popover"))return;t=t.parentElement}}i&&t((function(){i&&(i.dispatchEvent(new Event("hide")),i=null)})),e&&e.stopPropagation()}}}}function u(){return function(t,e){$(e).click((function(t){t.preventDefault(),t.stopPropagation()}))}}function c(){return{restrict:"A",require:"ngModel",link:function(t,e,n,r){t.multiRequired||(t.multiRequired=[]);const i=n.multiRequireElement,s=function(e){i&&i%1==0&&(t.multiRequired[i-1]=e)},o=function(){let e=!1,n=!1;for(let r=0;r<t.multiRequired.length;r++)t.multiRequired[r]?e=!0:n=!0;r.$setValidity("multiRequire",!(e&&n))};r.$parsers.unshift((function(t){return s(t),o(),t})),r.$formatters.unshift((function(t){return s(t),o(),t})),$("[multi-required]").on("blur keyup change focusout",(function(){o()}))}}}angular.module("graphdb.framework.core.directives",["graphdb.framework.core.services.repositories","graphdb.framework.utils.localstorageadapter"]).directive("ontoLoader",i).directive("ontoLoaderFancy",s).directive("ontoLoaderNew",o).directive("coreErrors",a).directive("eatClick",u).directive("multiRequired",c).directive("searchResourceInput",h).directive("keyboardShortcuts",f).directive("inactivePluginDirective",p),i.$inject=[],s.$inject=[],o.$inject=["$timeout"],a.$inject=["$timeout"],u.$inject=[],c.$inject=[];const l={table:"table",visual:"visual"};function h(t,e,n,i,s,o,a,u,c,h,f,p){return{restrict:"EA",scope:{namespacespromise:"=",autocompletepromisestatus:"=",textButton:"@",visualButton:"@",textCallback:"&",visualCallback:"&",placeholder:"@",uriValidation:"@",preserveInput:"@",empty:"=",clear:"=?clear",openInNewTab:"@",preserveSearch:"@",radioButtons:"@",clearInputIcon:"@"},templateUrl:"js/angular/core/templates/search-resource-input.html",link:function(d,g,m){g.autoCompleteStatus=void 0,g.autoCompleteWarning=!1,d.empty=!1,d.clear=!1,d.searchDisplayType=l;const v="true"===d.preserveSearch,y=g.find(".view-res-input");let b,w;d.textButtonLabel=d.textButton||"query.editor.table.btn",d.visualButtonLabel=d.visualButton||"query.editor.visual.btn",d.showClearInputIcon=!1,d.searchType=u.get(c.RDF_SEARCH_TYPE)||l.table,d.searchInput="",d.changeSearchType=function(t){d.searchType=t,u.set(c.RDF_SEARCH_TYPE,d.searchType)},d.$on("addStartFixedNodeAutomatically",(function(t,e){d.searchInput||!e.startIRI?d.checkIfValidAndSearchText():d.visualCallback({uri:e.startIRI,label:""})})),d.clearInput=function(){d.searchInput="",d.selectedElementIndex=-1,d.autoCompleteUriResults=[],d.showClearInputIcon=!1,u.remove(c.RDF_SEARCH_INPUT),u.remove(c.RDF_SEARCH_EXPANDED_URI),u.remove(c.RDF_RESOURCE_DESCRIPTION)},d.$watch("namespacespromise",(function(){angular.isDefined(d.namespacespromise)&&d.namespacespromise.success((function(t){g.namespaces=t.results.bindings.map((function(t){return{prefix:t.prefix.value,uri:t.namespace.value}}))})).error((function(t){const n=getError(t);e.error(n,f.instant("error.getting.namespaces.for.repo"))}))})),d.$watch("autocompletepromisestatus",(function(){!h.isActiveRepoFedXType()&&angular.isDefined(d.autocompletepromisestatus)&&d.autocompletepromisestatus.success((function(t){g.autoCompleteStatus=!!t,""!==d.searchInput&&d.onChange()})).error((function(){e.error(f.instant("explore.error.autocomplete"))}))})),d.$watch("empty",(function(){v||(d.searchInput="",d.empty=!1)})),d.$watch("clear",(function(){d.clear&&(d.clearInput(),d.clear=!1)})),s.$on("$translateChangeSuccess",(function(){m.$attr.placeholder?d.placeholder=m.$attr.placeholder:d.placeholder=f.instant("search.resources.msg")+"..."}));const x=function(e){const n=e.type||"uri";"true"===d.openInNewTab?E(!1,e):t.path("resource").search(n,e.uri)},S=function(e){const n=e.type||"uri";"true"===d.openInNewTab?E(!0,e):t.path("graphs-visualizations").search(n,e.uri)},E=function(t,e){const n=t?"graphs-visualizations":"resource";window.open(`${n}?uri=${encodeURIComponent(e.uri)}`)};angular.isUndefined(m.$attr.textCallback)&&(d.textCallback=x),angular.isUndefined(m.$attr.visualCallback)&&(d.visualCallback=S),m.$attr.textButton&&!d.textButton?d.textCallback=d.visualCallback:m.$attr.visualButton&&!d.visualButton&&(d.visualCallback=d.textCallback),m.$attr.placeholder?d.placeholder=m.$attr.placeholder:d.placeholder=f.instant("search.resources.msg")+"...",angular.isDefined(m.$attr.uriValidation)?d.uriValidation=m.$attr.uriValidation:d.uriValidation="true",angular.isDefined(m.$attr.preserveInput)&&(d.preserveInput=m.$attr.preserveInput),d.getResultItemHtml=function(t){return a.trustAsHtml(t.description)},d.searchRdfResource=function(t,e){if("prefix"===t.type)d.searchInput=D(t.value+":"),y.focus(),d.onChange();else{let n;n=angular.isUndefined(t)?d.searchInput:"object"==typeof t?t.value:t;let r="";if(t.description){const e=t.description.indexOf("<"+n+">");e>0&&(r=t.description.substring(0,e).replace(/<\/?b>/g,""))}e({uri:n,description:t.description,label:r,type:t.type}),v?(d.selectedElementIndex=d.activeSearchElm,u.set(c.RDF_SEARCH_EXPANDED_URI,b),u.set(c.RDF_SEARCH_INPUT,d.searchInput),u.set(c.RDF_RESOURCE_DESCRIPTION,t.description)):"true"===d.preserveInput?(d.searchInput=n,d.autoCompleteUriResults=[]):(d.searchInput="",d.autoCompleteUriResults=[])}},d.searchRdfResourceByEvent=function(t,e){d.searchType===l.visual||e.ctrlKey||e.metaKey?d.searchRdfResource(t,d.visualCallback):d.searchRdfResource(t,d.textCallback)};const F=function(t){const n=d.searchInput;""!==n?"false"!==d.uriValidation?g.autoCompleteStatus&&d.autoCompleteUriResults&&d.autoCompleteUriResults.length>0?"prefix"===d.autoCompleteUriResults[d.activeSearchElm].type?(d.searchInput=D(d.autoCompleteUriResults[d.activeSearchElm].value+":"),d.autoCompleteUriResults=[]):d.searchRdfResource(d.autoCompleteUriResults[d.activeSearchElm],t):C(n)?d.searchRdfResource(n,t):e.error(f.instant("invalid.uri.msg")):d.searchRdfResource(n,t):e.error(f.instant("fill.input.field.msg"))};function A(){let t=-1;const n=u.get(c.RDF_RESOURCE_DESCRIPTION);n&&d.autoCompleteUriResults&&(t=d.autoCompleteUriResults.findIndex(t=>t.description===n),d.selectedElementIndex=t,new Promise(t=>{const e=document.getElementById("auto-complete-results-wrapper").getBoundingClientRect();setTimeout(()=>{t(e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth))})}).then((function(){!function(){const t=$("#auto-complete-results-wrapper"),e=$("#auto_"+d.selectedElementIndex);t.animate({scrollTop:e.offset().top-t.offset().top+t.scrollTop()})}()})).catch((function(t){e.error(getError(t),f.instant("no.prev.search.element"))}))),d.activeSearchElm=-1===t?0:t}function C(t){const e=t.indexOf("<")>=0&&t.indexOf(">")>=0,n=-1===t.indexOf("<")&&-1===t.lastIndexOf(">"),r=/^<?(http|urn).*>?/.test(t)&&(e||n);let i=!1;if(r)if(t.indexOf("http")>=0){const e=t.indexOf("//");i=e>4&&t.substring(e+2).length>0}else t.indexOf("urn")>=0&&(i=t.substring(4).length>0);return r&&i}function D(t){if(!/^<?(http|urn).*>?/.test(t)){const e=t.split(":"),r=e[0],i=e[1];if(!angular.isUndefined(i)){const t=n.getNamespaceUriForPrefix(g.namespaces,r);if(b=t!==b?t:b,b)return y.val(b),b+i}}return t}d.checkIfValidAndSearchText=function(){F(d.textCallback)},d.checkIfValidAndSearchVisual=function(){F(d.visualCallback)},d.checkIfValidAndSearchEvent=function(t){d.searchType===l.visual||t.ctrlKey||t.metaKey?F(d.visualCallback):F(d.textCallback)},d.onChange=function(){return d.showClearInputIcon=d.clearInputIcon,v&&u.set(c.RDF_SEARCH_INPUT,d.searchInput),"false"!==d.uriValidation&&(d.searchInput=D(d.searchInput),g.autoCompleteStatus)?function(t){let e=t.replace(b,b+";");if(g.autoCompleteStatus)return";"===e.charAt(0)&&(e=e.slice(1)),e=function(t){let e=t;if(-1===e.indexOf(";")&&C(e)){e=e.replace(/<|>/g,"");const t=/[^/^#]*$/.exec(e)[0];return e.split(t)[0]+";"+t}return e}(e),w&&w.resolve(),w=o.defer(),i.getAutocompleteSuggestions(e,w.promise).then((function(t){w=null,d.autoCompleteUriResults=t.data.suggestions,d.activeSearchElm=0}));return Promise.resolve()}(d.searchInput):Promise.resolve()},d.onKeyDown=function(t){if(13===t.keyCode){if(t.preventDefault(),p.isActive())return;"false"!==d.uriValidation?g.autoCompleteStatus?d.checkIfValidAndSearchEvent(t):C(t.target.value)?d.searchRdfResourceByEvent(t.target.value,t):e.error(f.instant("invalid.uri.msg")):d.searchRdfResourceByEvent(t.target.value,t)}else if(d.searchInput.length>0&&!g.autoCompleteWarning&&!g.autoCompleteStatus){g.autoCompleteWarning=!0;const t=Object(r.decodeHTML)(f.instant("explore.autocomplete.warning.msg"));e.warning("",`<div class="autocomplete-toast"><a href="autocomplete">${t}</a></div>`,{allowHtml:!0})}if(g.autoCompleteStatus&&!angular.isUndefined(d.autoCompleteUriResults)){if(40===t.keyCode&&d.activeSearchElm<d.autoCompleteUriResults.length-1&&(d.activeSearchElm++,d.searchInput=d.autoCompleteUriResults[d.activeSearchElm].value,function(){const t=$("#auto-complete-results-wrapper"),e=t.children("div"),n=t.children("div.active");void 0!==n[0]&&n[0].offsetTop-e.height()-6-t.scrollTop()>170&&t.scrollTop(n[0].offsetTop-e.height()-6-170)}()),38===t.keyCode&&d.activeSearchElm>0&&(t.preventDefault(),d.activeSearchElm--,d.searchInput=d.autoCompleteUriResults[d.activeSearchElm].value,function(){const t=$("#auto-complete-results-wrapper"),e=t.children("div"),n=t.children("div.active");void 0!==n[0]&&n[0].offsetTop-e.height()-40<=t.scrollTop()&&t.scrollTop(t.scrollTop()-34)}()),27===t.keyCode){if(v)return;d.searchInput="",d.autoCompleteUriResults=[]}d.searchInput||d.clearInput()}},d.$on("rdfResourceSearchExpanded",(function(){(v?(d.preserveInput="true",d.searchInput=u.get(c.RDF_SEARCH_INPUT)||"",b=u.get(c.RDF_SEARCH_EXPANDED_URI),d.onChange()):Promise.resolve()).then((function(){A()}))})),d.setActiveClassOnMouseMove=function(t){g.autoCompleteStatus&&(d.activeSearchElm=t)}}}}function f(t){return{restrict:"AE",link:function(e,n,r){function i(t){27===t.keyCode&&(e.toggleCheatSheet(),e.$apply())}e.getTemplateUrl=function(){return r.templateUrl},e.shortcutsVisible=!1,e.toggleCheatSheet=function(){e.shortcutsVisible=!e.shortcutsVisible,e.shortcutsVisible?t.on("keydown",i):t.off("keydown",i)}},template:'<ng-include src="getTemplateUrl()" />'}}function p(t,e,n,i,s,o){return{restrict:"E",transclude:!0,scope:{loadSaved:"&",setPluginActive:"&",pluginName:"@",humanReadablePluginName:"@"},templateUrl:"js/angular/core/templates/inactive-plugin-warning-page.html",link:function(a){function u(){if(s.isLicenseValid()&&i.getActiveRepository()&&!i.isActiveRepoOntopType()&&!i.isActiveRepoFedXType())return e.checkPluginIsActive(a.pluginName).done((function(t){a.pluginIsActive=t.indexOf("true")>0,a.setPluginActive({isPluginActive:a.pluginIsActive})})).fail((function(e){t.error(getError(e),o.instant("check.active.plugin.failure"))}))}a.pluginIsActive=!0,a.activatePlugin=function(){const i=Object(r.decodeHTML)(o.instant("activate.plugin.warning.msg",{humanReadablePluginName:a.humanReadablePluginName}));n.openSimpleModal({title:o.instant("activate.plugin.confirmation"),message:`<p>${i}</p>`,warning:!0}).result.then((function(){e.activatePlugin(a.pluginName).done((function(){a.pluginIsActive=!0,a.setPluginActive({isPluginActive:a.pluginIsActive}),a.loadSaved()})).fail((function(e){t.error(getError(e),o.instant("activate.plugin.failure"))}))}))};const c=a.$on("repositoryIsSet",(function(){u()}));window.addEventListener("beforeunload",(function t(){c(),window.removeEventListener("beforeunload",t)})),a.$on("checkIsActive",u),u()}}}h.$inject=["$location","toastr","ClassInstanceDetailsService","AutocompleteRestService","$rootScope","$q","$sce","LocalStorageAdapter","LSKeys","$repositories","$translate","GuidesService"],f.$inject=["$document"],p.$inject=["toastr","RDF4JRepositoriesRestService","ModalService","$repositories","$licenseService","$translate"]},function(t,e,n){"use strict";n.r(e);n(4),n(23),n(24);var r=n(2);angular.module("graphdb.framework.core.services.jwtauth",["toastr","graphdb.framework.rest.security.service","graphdb.framework.core.services.openIDService"]).service("$jwtAuth",["$http","toastr","$location","$rootScope","SecurityRestService","$openIDAuth","$translate","$q",function(t,e,n,i,s,o,a,u){const c=this;i.deniedPermissions={},i.setPermissionDenied=function(t){return!("/"===t||"/login"===t||!c.isAuthenticated())&&(i.deniedPermissions[t]=!0,!0)},i.hasPermission=function(){const t=n.path();return!i.deniedPermissions[t]},i.redirectToLogin=function(t,e){return c.authTokenIsType("Bearer")&&(t=!0),c.clearAuthenticationInternal(),0!==n.url().indexOf("/login")&&(i.returnToUrl=n.url()),n.path("/login"),e?n.search("noaccess"):t&&n.search("expired"),new Promise(t=>{setTimeout(()=>{t(!0)},100)})},i.hasExternalAuthUser=function(){return c.hasExternalAuthUser()},this.authStorageName="com.ontotext.graphdb.auth",this.securityEnabled=!0,this.freeAccess=!1,this.hasOverrideAuth=!1,this.externalAuthUser=!1,this.securityInitialized=!1;const l=this;this.clearStorage=function(){localStorage.removeItem(l.authStorageName)},this.getAuthenticatedUserFromBackend=function(t,e){s.getAuthenticatedUser().success((function(t,e,n){l.auth&&l.auth.startsWith("GDB")?(l.externalAuthUser=!1,l.principal=t,i.$broadcast("securityInit",l.securityEnabled,!0,l.freeAccess)):l.openIDEnabled&&l.auth&&l.auth.startsWith("Bearer")?l.authenticate(t,l.auth):(l.externalAuthUser=!0,l.authenticate(t,""))})).error((function(){t||!l.freeAccess?i.redirectToLogin(!1,e):(l.securityInitialized=!0,l.hasExplicitAuthentication()||l.clearAuthentication())}))},this.initSecurity=function(){this.securityInitialized=!1,this.auth=localStorage.getItem(this.authStorageName),s.getSecurityConfig().then((function(t){if(l.securityEnabled=t.data.enabled,l.externalAuth=t.data.hasExternalAuth,l.authImplementation=t.data.authImplementation,l.openIDEnabled=t.data.openIdEnabled,l.passwordLoginEnabled=t.data.passwordLoginEnabled,l.securityEnabled){const e=t.data.freeAccess;l.freeAccess=e.enabled,l.freeAccess&&(l.freeAccessPrincipal={authorities:e.authorities,appSettings:e.appSettings}),l.openIDEnabled?(l.openIDConfig=t.data.methodSettings.openid,l.gdbUrl=n.absUrl().replace(n.url().substr(1),""),o.initOpenId(l.openIDConfig,l.gdbUrl,(function(t){l.auth=o.authHeaderGraphDB(),c.setAuthHeaders(),console.log("oidc: set id/access token as GraphDB auth"),l.getAuthenticatedUserFromBackend(!0,t)}),(function(){console.log("oidc: not logged or login error"),l.authTokenIsType("Bearer")?setTimeout(()=>{i.redirectToLogin(!0)},0):l.getAuthenticatedUserFromBackend()}))):l.getAuthenticatedUserFromBackend()}else{l.clearStorage();const e=t.data.overrideAuth;if(l.hasOverrideAuth=e.enabled,!l.hasOverrideAuth)return s.getAdminUser().then((function(t){l.principal={username:"admin",appSettings:t.data.appSettings,authorities:t.data.grantedAuthorities},i.$broadcast("securityInit",l.securityEnabled,!0,l.hasOverrideAuth)}));l.principal={username:"overrideauth",authorities:e.authorities,appSettings:e.appSettings},i.$broadcast("securityInit",l.securityEnabled,!0,l.hasOverrideAuth)}}))},this.initSecurity(),this.reinitializeSecurity=function(){this.securityInitialized||this.initSecurity()},this.isSecurityEnabled=function(){return this.securityEnabled},this.hasExternalAuth=function(){return this.externalAuth},this.getAuthImplementation=function(){return this.authImplementation},this.isFreeAccessEnabled=function(){return this.freeAccess},this.isDefaultAuthEnabled=function(){return this.hasOverrideAuth&&this.principal&&"overrideauth"===this.principal.username},this.getAuthToken=function(){return this.auth},this.authTokenIsType=function(t){return this.auth&&this.auth.startsWith(t)},this.loginOpenID=function(){o.login(this.openIDConfig,this.gdbUrl)},this.toggleSecurity=function(t){t!==this.securityEnabled&&(this.securityEnabled=t,s.toggleSecurity(t).then((function(){e.success(a.instant("jwt.auth.security.status",{status:a.instant(t?"enabled.status":"disabled.status")})),l.clearStorage(),l.initSecurity()}),(function(t){e.error(t.data.error.message,a.instant("common.error"))})))},this.toggleFreeAccess=function(t,n,r,o){(t!==this.freeAccess||o)&&(this.freeAccess=t,this.freeAccessPrincipal=t?{authorities:n,appSettings:r}:void 0,s.setFreeAccess({enabled:t?"true":"false",authorities:n,appSettings:r}).then((function(){o?e.success(a.instant("jwt.auth.free.access.updated.msg")):e.success(a.instant("jwt.auth.free.access.status",{status:a.instant(t?"enabled.status":"disabled.status")}))}),(function(t){e.error(t.data.error.message,a.instant("common.error"))})),i.$broadcast("securityInit",this.securityEnabled,this.hasExplicitAuthentication(),this.freeAccess))},this.setAuthHeaders=function(){return new Promise(e=>{const n=this.auth?this.auth:void 0;t.defaults.headers.common.Authorization=n,t.defaults.headers.common["X-Requested-With"]="XMLHttpRequest",$.ajaxSetup().headers=$.ajaxSetup().headers||{},$.ajaxSetup().headers.Authorization=n,$.ajaxSetup().headers["X-Requested-With"]="XMLHttpRequest",setTimeout(()=>{e(!0)})})},this.setAuthHeaders(),this.authenticate=function(t,e){return new Promise(n=>{l.clearStorage(),e&&(this.auth=e,localStorage.setItem(l.authStorageName,this.auth),this.externalAuthUser=!1),this.principal=t,i.deniedPermissions={},this.securityInitialized=!0,l.setAuthHeaders().then(()=>{i.$broadcast("securityInit",this.securityEnabled,l.hasExplicitAuthentication(),this.freeAccess)}),setTimeout(()=>{n(!0)})})},this.authenticateOpenID=function(t){this.clearStorage(),t&&(this.auth=t,localStorage.setItem(this.authStorageName,this.auth),this.externalAuthUser=!1)},this.hasExternalAuthUser=function(){return this.externalAuthUser},this.hasExplicitAuthentication=function(){return null!=this.auth||this.externalAuthUser},this.getPrincipal=function(){if(this.principal)return Promise.resolve(this.principal);const t=u.defer();return i.$on("securityInit",()=>{t.resolve(this.principal)}),t.promise},this.clearAuthenticationInternal=function(){o.softLogout(),this.auth=null,this.principal=this.freeAccessPrincipal,this.clearStorage(),this.setAuthHeaders()},this.clearAuthentication=function(){this.clearAuthenticationInternal(),i.$broadcast("securityInit",this.securityEnabled,!1,this.freeAccess)},this.isAuthenticated=function(){return!this.securityEnabled||this.hasExplicitAuthentication()},this.hasPermission=function(){},this.hasRole=function(t){if(void 0!==t&&(this.securityEnabled||this.hasOverrideAuth)){"string"==typeof t&&(t=[t]);const e=!_.isEmpty(this.principal);return!!e&&("IS_AUTHENTICATED_FULLY"===t[0]?e:_.intersection(t,this.principal.authorities).length>0)}return!0},this.isAdmin=function(){return this.hasRole(r.UserRole.ROLE_ADMIN)},this.checkForWrite=function(t,e){return"WRITE_REPO"===t?this.canWriteRepo(e):this.hasRole(t)},this.hasAdminRole=function(){return this.isAdmin()||this.hasRole(r.UserRole.ROLE_REPO_MANAGER)},this.canWriteRepo=function(t){return!!t&&(!this.securityEnabled&&!this.hasOverrideAuth||!_.isEmpty(this.principal)&&(!!this.hasAdminRole()||this.checkRights(t,"WRITE")))},this.canReadRepo=function(t){return!!t&&(!this.securityEnabled||!_.isEmpty(this.principal)&&(!!this.hasAdminRole()||this.checkRights(t,"READ")))},this.checkRights=function(t,e){if(t)for(let n=0;n<this.principal.authorities.length;n++){const r=this.principal.authorities[n],i=r.split("_",2),s=r.slice(i[0].length+i[1].length+2),o=t.location?`${t.id}@${t.location}`:t.id;if(i[0]===e&&(o===s||"SYSTEM"!==t.id&&"*"===s))return!0}return!1}}])},function(t,e){let n;angular.module("graphdb.framework.utils.uriutils",[]).factory("UriUtils",(function(){return{isValidIri:function(t){return void 0!==t&&!!t.match(n)},validateRdfUri:function(t){const e=t.indexOf("<")>=0&&t.indexOf(">")>=0,n=-1===t.indexOf("<")&&-1===t.lastIndexOf(">"),r=/^<?(http|urn).*>?/.test(t)&&(e||n);let i=!1;if(r)if(t.indexOf("http")>=0){const e=t.indexOf("//");i=e>4&&t.substring(e+2).length>0}else t.indexOf("urn")>=0&&(i=t.substring(4).length>0);return r&&i},shortenIri:function(t){const e=document.createElement("a");e.href=t;let n=e.hostname;return function(t){const e=t.split(".");for(let t=0,n=0;t<e.length;t++)if(parseInt(e[t],10)>=0&&parseInt(e[t],10)<=255?n++:n=0,4===n)return!0;return!1}(e.hostname)||(n=e.hostname.split(".")[0]),n+":"+e.port}}}));try{n=new RegExp("^[a-z](?:[-a-z0-9\\+\\.])*:(?:\\/\\/(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:])*@)?(?:\\[(?:(?:(?:[0-9a-f]{1,4}:){6}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|::(?:[0-9a-f]{1,4}:){5}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:[0-9a-f]{1,4}:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|v[0-9a-f]+[-a-z0-9\\._~!\\$&'\\(\\)\\*\\+,;=:]+)\\]|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}|(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=@])*)(?::[0-9]*)?(?:\\/(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))*)*|\\/(?:(?:(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))+)(?:\\/(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))*)*)?|(?:(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))+)(?:\\/(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))*)*|(?!(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@])))(?:\\?(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@])|[\\u{E000}-\\u{F8FF}\\u{F0000}-\\u{FFFFD}\\u{100000}-\\u{10FFFD}\\/\\?])*)?(?:#(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@])|[\\/\\?])*)?$","ui")}catch(t){n=new RegExp("^[a-z](?:[-a-z0-9\\+\\.])*:","i")}},function(t,e){angular.module("graphdb.framework.rest.monitoring.service",[]).factory("MonitoringRestService",n),n.$inject=["$http"];function n(t){return{monitorResources:function(){return t.get("rest/monitor/resource")},monitorGC:function(){return t.post("rest/monitor/resource/gc")},monitorQuery:function(){return t.get("rest/monitor/query")},abortQueryByAlias:function(e){return t.delete("rest/monitor/query?queryAlias="+encodeURIComponent(e))},deleteQuery:function(e){return t.delete("rest/monitor/query?queryId="+encodeURIComponent(e))},getQueryCount:function(){return t({url:"rest/monitor/query/count",method:"GET",timeout:1e4})},checkAutocompleteStatus:function(){return t.get("rest/autocomplete/enabled")}}}},function(t,e){angular.module("graphdb.framework.rest.rdf4j.repositories.service",[]).factory("RDF4JRepositoriesRestService",r),r.$inject=["$http","$repositories","$translate"];const n="select ?o where {\n?s <http://www.ontotext.com/owlim/system#listplugins> ?o .\nfilter(str(?s) = '{{pluginName}}')\n} ";function r(t,e,r){return{getNamespaces:function(e){return t.get(`repositories/${e}/namespaces`)},getRepositoryNamespaces:function(){return t.get(`repositories/${e.getActiveRepository()}/namespaces`)},updateNamespacePrefix:function(e,n,r){return t({url:`repositories/${e}/namespaces/${r}`,method:"PUT",data:n})},deleteNamespacePrefix:function(e,n){return t({url:`repositories/${e}/namespaces/${n}`,method:"DELETE"})},addStatements:function(e,n){return t({url:`repositories/${e}/statements`,method:"POST",data:n,headers:{"Content-Type":"application/x-www-form-urlencoded"}})},activatePlugin:function(t){return $.ajax({method:"POST",url:`repositories/${e.getActiveRepository()}/statements`,data:{update:"INSERT DATA { <u:a> <http://www.ontotext.com/owlim/system#startplugin> '{{pluginName}}' .}".replace("{{pluginName}}",t)}})},checkPluginIsActive:function(t){return $.ajax({method:"GET",url:"repositories/"+e.getActiveRepository(),data:{query:n.replace("{{pluginName}}",t)}})},getRepositorySize:function(){return t.get(`repositories/${e.getActiveRepository()}/size`)},getGraphs:i,resolveGraphs:function(){const t=e.getActiveRepository();let n=[];if(t)return i(t).success((function(t){t.results.bindings.unshift({contextID:{type:"default",value:"import.default.graph"}}),Object.keys(t.results.bindings).forEach((function(e){const n=t.results.bindings[e];"bnode"===n.contextID.type?n.contextID.value="_:"+n.contextID.value:"default"===n.contextID.type?n.contextID.uri="http://www.openrdf.org/schema/sesame#nil":n.contextID.uri=n.contextID.value})),t.results.bindings.unshift(allGraphs),n=t.results.bindings}));return n}};function i(e){return t.get(`repositories/${e}/contexts`)}}},function(t,e){function n(t,e,n,r){t.title=n,t.message=r,t.ok=function(){e.close()},t.cancel=function(){e.dismiss("cancel")}}function r(t,e,n,r,i){t.clipboardURI=n,t.ok=function(){try{document.getElementById("clipboardURI").select(),document.execCommand("copy"),r.success(i.instant("modal.ctr.copy.url.success"))}catch(t){r.error(i.instant("modal.ctr.copy.not.supported.warning"))}e.close()},t.cancel=function(){e.dismiss("cancel")}}function i(t,e,n,r,i){t.query=n,t.cancel=function(){e.dismiss("cancel")},t.selectQuery=function(){t.selectElement($("#create-query"))},t.copyQueryToClipboard=function(){try{t.selectQuery(),document.execCommand("copy"),e.close(),r.success(i.instant("modal.ctr.copy.query.success"))}catch(t){r.error(i.instant("modal.ctr.copy.not.supported.warning"))}},t.selectElement=function(t){if(t.length>0)if(window.getSelection){const e=window.getSelection();e.removeAllRanges();const n=document.createRange();n.selectNodeContents(t[0].firstChild),e.addRange(n)}else if(document.selection){const e=document.body.createTextRange();e.moveToElementText(t[0]),e.select()}}}angular.module("graphdb.framework.core.controllers",[]).controller("CopyToClipboardModalCtrl",r).controller("SimpleModalCtrl",n).controller("ViewQueryCtrl",i),n.$inject=["$scope","$modalInstance","title","message"],r.$inject=["$scope","$modalInstance","uri","toastr","$translate"],i.$inject=["$scope","$modalInstance","query","toastr","$translate"]},function(t,e){angular.module("graphdb.framework.rest.sparql.service",[]).factory("SparqlRestService",n),n.$inject=["$http"];function n(t){return{getSavedQueries:function(){return t.get("rest/sparql/saved-queries")},getSavedQuery:function(e,n){let r="";null!=n&&(r="&owner="+encodeURIComponent(n));return t.get(`rest/sparql/saved-queries?name=${encodeURIComponent(e)}${r}`)},addKnownPrefixes:function(e){return t.post("rest/sparql/add-known-prefixes",e)},editSavedQuery:function(e){return t.put("rest/sparql/saved-queries",e)},deleteSavedQuery:function(e){return t.delete("rest/sparql/saved-queries?name="+encodeURIComponent(e))},addNewSavedQuery:function(e){return t.post("rest/sparql/saved-queries",e)}}}},function(t,e){angular.module("graphdb.framework.rest.autocomplete.service",[]).factory("AutocompleteRestService",n);function n(t){return{checkAutocompleteStatus:function(){return t.get("rest/autocomplete/enabled")},refreshIndexStatus:function(){return t.get("rest/autocomplete/status")},refreshLabelConfig:function(){return t.get("rest/autocomplete/labels")},addLabelConfig:function(e){return t.put("rest/autocomplete/labels",e)},removeLabelConfig:function(e){return t.delete("rest/autocomplete/labels",{data:e,headers:{"Content-Type":"application/json;charset=utf-8"}})},toggleAutocomplete:function(e){return t.post("rest/autocomplete/enabled?enabled="+e)},refreshIndexIRIs:function(){return t.get("rest/autocomplete/iris")},toggleIndexIRIs:function(e){return t.post("rest/autocomplete/iris?enabled="+e)},buildIndex:function(){return t.post("rest/autocomplete/reindex")},interruptIndexing:function(){return t.post("rest/autocomplete/interrupt")},checkForPlugin:function(){return t.get("rest/autocomplete/plugin-found")},getAutocompleteSuggestions:function(e,n){return t.get("rest/autocomplete/query",{params:{q:e},timeout:n})}}}n.$inject=["$http"]},function(t,e){angular.module("graphdb.framework.rest.plugins.service",[]).factory("PluginsRestService",n);function n(t){return{togglePlugin:function(e,n,r){return n?t.post(`repositories/${e}/statements`,void 0,{params:{update:`INSERT DATA { <u:a> <http://www.ontotext.com/owlim/system#stopplugin> "${r}".}`}}):t.post(`repositories/${e}/statements`,void 0,{params:{update:`INSERT DATA { <u:a> <http://www.ontotext.com/owlim/system#startplugin> "${r}".}`}})},getPlugins:function(e){return t.get("repositories/"+e,{params:{query:"select ?s ?o where { ?s <http://www.ontotext.com/owlim/system#listplugins> ?o .}"}})}}}n.$inject=["$http"]},function(t,e,n){"use strict";n.r(e);n(5),n(7);var r=n(1);function i(t,e,n,i,s,o,a,u,c,l){this.guideResumeSubscription=void 0,this.languageChangeSubscription=void 0,this.guideCancelSubscription=void 0,this.init=()=>{this._subscribeToGuideResumed(),this._subscribeToGuideCancel(),this._subscribeToGuidePause()},this.startGuide=(t,a)=>{if(t&&t.options&&t.options.repositoryIdBase){const e=o.getRepositories();t.options.repositoryId=t.options.repositoryIdBase;for(let n=2;e.find(e=>e.id===t.options.repositoryId);n++)t.options.repositoryId=t.options.repositoryIdBase+n;t.options.translatedGuideName=r.GuideUtils.translateLocalMessage(n,i,t.guideName,{}),t.options.translatedGuideDescription=r.GuideUtils.translateLocalMessage(n,i,t.guideDescription,{})}const u=this._toStepsDescriptions(t);for(let t=0;t<u.length;t++)u[t].id=t;angular.isDefined(a)?s.resumeGuide(t.guideId,u,a):s.startGuide(t.guideId,u,a),e.$broadcast("guideStarted")},this.getGuides=()=>new Promise(e=>{t.get(r.GuideUtils.GUIDES_LIST_URL).success((function(t){angular.forEach(t,(t,e)=>{void 0===t.guideId&&(t.guideId=e)}),e(t)}))}),this.isActive=()=>s.isActive(),this._toStepsDescriptions=t=>{if(!t)return[];let e=[];return t.steps.forEach(n=>{e=e.concat(this._getSteps(n,t.options))}),e},this._getSteps=(t,h)=>{const f={$translate:n,$interpolate:i,GuideUtils:r.GuideUtils,$rootScope:e,toastr:a,$location:u,$route:c,$timeout:l,ShepherdService:s,$repositories:o};let p=[];if(angular.isArray(t))t.forEach(e=>{p=p.concat(this._getSteps(e,angular.extend({},t.options,h)))});else{const e=PluginRegistry.get("guide.step").find(e=>e.guideBlockName===t.guideBlockName);if(e){const n=angular.extend({},e.options,t.options,h);e.getSteps?p=p.concat(this._getSteps(angular.copy(e.getSteps(n,f)),h)):e.getStep?p.push(angular.copy(e.getStep(n,f))):p=p.concat(this._getSteps(angular.copy(e,e.options),h))}}return p.forEach((t,e)=>{t.stepN=e,t.stepsTotalN=p.length,!t.title&&t.mainAction&&(t.title="guide.step-action."+t.mainAction)}),p},this._subscribeToGuideResumed=()=>{this.guideResumeSubscription||(this.guideResumeSubscription=e.$on("guideResume",()=>{const t=s.getGuideId();this.getGuides().then(e=>{const n=e.find(e=>e.guideId===t),r=s.getCurrentStepId();this.startGuide(n,r)})}))},this._subscribeToGuideCancel=()=>{s.subscribeToGuideCancel(()=>e.$broadcast("guideReset"))},this._subscribeToGuidePause=()=>{s.subscribeToGuidePause(()=>e.$broadcast("guidePaused"))}}angular.module("graphdb.framework.guides.services",["graphdb.framework.guides.shepherd.services"]).service("GuidesService",i),i.$inject=["$http","$rootScope","$translate","$interpolate","ShepherdService","$repositories","toastr","$location","$route","$timeout"]},function(t,e,n){"use strict";n.r(e);n(4);angular.module("graphdb.framework.core.interceptors.unauthorized",["ngCookies"]).factory("$unauthorizedInterceptor",["$q","$location","$rootScope","$translate",function(t,e,n,r){return{responseError:function(i){let s=!1;return 401===i.status?i.config.url.indexOf("rest/security/authenticated-user")<0&&!n.hasExternalAuthUser()&&(s=!0):403===i.status&&(n.setPermissionDenied(e.path())?console.log(r.instant("unauthorized.console.warning")):s=!0),s?Promise.resolve(n.redirectToLogin()).then(()=>t.reject(i)):t.reject(i)}}}])},,function(t,e,n){"use strict";n.r(e);var r=n(3);const i={headers:{"X-GraphDB-Repository-Location":void 0,"X-GraphDB-Repository":void 0,"X-Requested-With":void 0,Authorization:void 0}};angular.module("graphdb.framework.core.services.openIDService",["toastr"]).service("$openIDAuth",["$http","$location","$window","toastr","$translate",function(t,e,n,s,o){const a="com.ontotext.graphdb.openid.",u=this;function c(t){const e=[];for(let n in t)t.hasOwnProperty(n)&&e.push(`${n}=${encodeURIComponent(t[n])}`);return e.join("&")}this.login=function(t,e){const r=u.generateRandomString(),i=t.authFlow;if("code"===i){u.setStorageItem("pkce_state",r);const i=u.generateRandomString();u.setStorageItem("pkce_code_verifier",i);const s=u.pkceChallengeFromVerifier(i);n.location.href=u.getLoginUrl(r,s,e,t)}else"code_no_pkce"===i?(u.removeStorageItem("pkce_code_verifier"),n.location.href=u.getLoginUrl(r,"",e,t)):"implicit"===i?(u.setStorageItem("nonce",r),n.location.href=u.getLoginUrl(r,"",e,t)):(console.log("oidc: unknown auth flow: "+i),s.error(o.instant("openid.auth.unknown.flow",{authFlow:i})))},this.getLoginUrl=function(t,e,n,r){const i=[];let s="";switch(r.authFlow){case"code":s="code",i.push("state="+encodeURIComponent(t)),i.push("code_challenge="+encodeURIComponent(e)),i.push("code_challenge_method=S256");break;case"code_no_pkce":s="code";break;case"implicit":s="token id_token",i.push("nonce="+encodeURIComponent(t));break;default:throw new Error(o.instant("openid.auth.unknown.flow",{authFlow:r.authFlow}))}return i.unshift("response_type="+encodeURIComponent(s),"scope="+encodeURIComponent(u.getScope(r.extraScopes)),"client_id="+encodeURIComponent(r.clientId),"redirect_uri="+encodeURIComponent(n)),r.oracleDomain&&i.push("domain="+encodeURIComponent(r.oracleDomain)),r.authorizeParameters&&i.push(r.authorizeParameters),`${r.oidcAuthorizationEndpoint}?${i.join("&")}`},this.withOpenIdKeys=function(e,n){t.get(e,i).success((function(t){u.openIdKeys={},t.keys.forEach((function(t){u.openIdKeys[t.kid]=t})),n()}))},this.initOpenId=function(t,e,r,a){u.clientId=t.clientId,u.tokenType=t.tokenType,u.idTokenAudience=t.clientId,u.idTokenIssuer=t.issuer,u.accessTokenAudience=t.tokenAudience,u.accessTokenIssuer=t.tokenIssuer,u.openIdTokenUrl=t.oidcTokenEndpoint;let c=t.oidcJwksUri;t.proxyOidc&&(c="rest/openid/jwks",u.openIdTokenUrl="rest/openid/token"),u.openIdEndSessionUrl=t.oidcEndSessionEndpoint,u.supportsOfflineAccess=t.oidcScopesSupported.includes("offline_access"),t.oracleDomain&&(i.headers["X-OAuth-Identity-Domain-Name"]=t.oracleDomain),u.withOpenIdKeys(c,(function(){if(u.isLoggedIn=u.hasValidIdToken(),u.isLoggedIn)u.setupTokensRefresh(!1,r,a);else if(u.hasValidRefreshToken())u.refreshTokens(r,a);else{const i=r;r=function(){u.isLoggedIn=!0,i(!0)},u.softLogout();const c=u.parseQueryString(n.location.search.substring(1));if(c.code)"code"===t.authFlow?u.getStorageItem("pkce_state")!==c.state?(s.error(o.instant("openid.auth.invalid.pkce.state")),console.log("oidc: PKCE state mismatch "+u.getStorageItem("pkce_state")+" != "+c.state),a()):u.retrieveTokensByCode(c.code,e,r,a):"code_no_pkce"===t.authFlow&&u.retrieveTokensByCode(c.code,e,r,a);else{const t=u.parseQueryString(n.location.pathname.substring(1));t.id_token?u.saveTokens(t,!0,!1,r):a()}}}))},this.authHeaderGraphDB=function(){return"id"===u.getStorageItem("token_type")?"Bearer "+u.getToken("id"):"Bearer "+u.getToken("access")},this.softLogout=function(){u.isLoggedIn=!1,u.setToken("id",null),u.setToken("access",null),u.setToken("refresh",null)},this.hardLogout=function(t){u.softLogout(),u.openIdEndSessionUrl&&(n.location.href=`${u.openIdEndSessionUrl}?client_id=${encodeURIComponent(u.clientId)}&post_logout_redirect_uri=${encodeURIComponent(t)}`)},this.getToken=function(t){return u.getStorageItem(t+"_token")},this.setToken=function(t,e){e?u.setStorageItem(t+"_token",e):u.removeStorageItem(t+"_token")},this.tokenHeader=function(t){const e=u.getToken(t);if(e){try{const t=r.KJUR.jws.JWS.readSafeJSONString(Object(r.b64utoutf8)(e.split(".")[0]));if(t)return t}catch(t){}return{error:o.instant("openid.auth.not.jwt.token",{token:e})}}return{}},this.verifyToken=function(t){const e=u.getToken(t),n=u.tokenHeader(t);if(!n.kid)return"id"!==t?n.error?(console.log(`oidc: token ${t} is not a JWT token (token considered valid)`),!0):(console.log(`oidc: invalid token ${t} (token is empty)`),!1):(console.log("oidc: invalid token id (not a JWT token)"),!1);const i=u.openIdKeys[n.kid];if(!i)return console.log("oidc: no key to verify JWT token (token considered invalid)"),!1;const s=r.KEYUTIL.getKey(i),o={alg:[n.alg],iss:[u.idTokenIssuer]};return"id"===t?(o.aud=[u.idTokenAudience,u.idTokenIssuer],o.nonce=[u.getStorageItem("nonce")]):"access"===t&&(o.aud=[u.accessTokenAudience],o.iss=[u.accessTokenIssuer]),r.KJUR.jws.JWS.verifyJWT(e,s,o)},this.hasValidIdToken=function(){return u.getToken("id")?u.verifyToken("id")?(console.log("oidc: valid id token found"),!0):(console.log("oidc: stale id token"),!1):(console.log("oidc: no id token"),!1)},this.tokenPayload=function(t){const e=u.getToken(t);if(e){try{const t=r.KJUR.jws.JWS.readSafeJSONString(Object(r.b64utoutf8)(e.split(".")[1]));if(t)return t}catch(t){}return{error:o.instant("openid.auth.not.jwt.token",{token:e})}}return{}},this.saveTokens=function(t,n,r,i){(n||t.refresh_token)&&u.setToken("refresh",t.refresh_token),u.setToken("access",t.access_token),u.setToken("id",t.id_token),u.setStorageItem("token_type",u.tokenType),console.log("oidc: saved tokens"),u.setupTokensRefresh(n||r,i),u.removeStorageItem("pkce_state"),u.removeStorageItem("pkce_code_verifier"),n&&e.url("/")},this.retrieveTokensByCode=function(e,n,r,a){const l={grant_type:"authorization_code",client_id:u.clientId,redirect_uri:n,code:e},h=u.getStorageItem("pkce_code_verifier");h&&(l.code_verifier=h);const f={...i.headers,"Content-type":"application/x-www-form-urlencoded; charset=utf-8"};t({method:"POST",url:u.openIdTokenUrl,headers:f,transformRequest:c,data:l}).success((function(t){u.saveTokens(t,!0,!1,r)})).error((function(t){s.error(o.instant("openid.auth.cannot.retrieve.token.msg",{error:getError(t)})),a()}))},this.refreshTokens=function(e,n){if(u.hasValidRefreshToken()){const r={grant_type:"refresh_token",client_id:u.clientId,refresh_token:u.getToken("refresh")},a={...i.headers,"Content-type":"application/x-www-form-urlencoded; charset=utf-8"};t({method:"POST",url:u.openIdTokenUrl,headers:a,transformRequest:c,data:r}).success((function(t){console.log("oidc: refreshed tokens"),u.saveTokens(t,!1,!0,e),u.isLoggedIn=!0})).error((function(t){console.log("oidc: could not refresh tokens"),s.error(o.instant("openid.auth.cannot.refresh.token.msg",{error:getError(t)})),n&&n()}))}else console.log("oidc: refresh requested without a valid refresh token")},this.hasValidRefreshToken=function(){const t=u.tokenPayload("refresh");return!(t.nbf&&1e3*t.nbf-Date.now()>5e3)&&(!(t.exp&&Date.now()-1e3*t.exp>5e3)&&!(!t.iat&&!t.error))},this.setupTokensRefresh=function(t,e,n){if(u.hasValidRefreshToken()){clearTimeout(u.previousTimer);const r=u.tokenPayload("id");if(r.exp>0){const i=1e3*r.exp-Date.now()-6e4;if(!(t||i>1e3))return u.previousTimer=null,console.log("oidc: tokens will refresh now, "+i+"; "+t),void u.refreshTokens(e,n);u.previousTimer=setTimeout((function(){u.refreshTokens(e)}),i),console.log("oidc: tokens will refresh in "+i/1e3+" seconds at "+new Date(Date.now()+i))}}else console.log("oidc: no valid refresh token");e()},this.parseQueryString=function(t){const e={access_token:null,code:null,id_token:null,state:null};if(""===t)return e;return t.split("&").map((function(t){return t.split("=")})).forEach((function(t){e[t[0]]=decodeURIComponent(t[1])})),e},this.generateRandomString=function(){const t=new Uint32Array(28);return window.crypto.getRandomValues(t),Array.from(t,(function(t){return("0"+t.toString(16)).substr(-2)})).join("")},this.pkceChallengeFromVerifier=function(t){const e=new r.KJUR.crypto.MessageDigest({alg:"sha256",prov:"cryptojs"});return Object(r.hextob64u)(e.digestString(t))},this.getScope=function(t){let e="openid"+(u.supportsOfflineAccess?" offline_access":"");return t&&(e+=" "+t),console.log(`oidc: requesting scopes '${e}'`),e},this.setStorageItem=function(t,e){localStorage.setItem(a+t,e)},this.getStorageItem=function(t){return localStorage.getItem(a+t)},this.removeStorageItem=function(t){localStorage.removeItem(a+t)}}])},function(t,e){angular.module("graphdb.framework.rest.security.service",[]).factory("SecurityRestService",n),n.$inject=["$http"];function n(t){return{getUser:function(n){return t.get("rest/security/users/"+e(n))},getAdminUser:function(){return t.get("rest/security/users/admin")},getUsers:function(){return t.get("rest/security/users")},createUser:function(n){return t({method:"POST",url:"rest/security/users/"+e(n.username),data:{password:n.pass,appSettings:n.appSettings,grantedAuthorities:n.grantedAuthorities}})},updateUser:function(n){return t({method:"PUT",url:"rest/security/users/"+e(n.username),data:{password:n.pass,appSettings:n.appSettings,grantedAuthorities:n.grantedAuthorities}})},updateUserData:function(n){return t({method:"PATCH",url:"rest/security/users/"+e(n.username),data:{password:n.pass,appSettings:n.appSettings}})},deleteUser:function(n){return t.delete("rest/security/users/"+e(n))},getFreeAccess:function(){return t.get("rest/security/free-access")},setFreeAccess:function(e){return t.post("rest/security/free-access",e)},getSecurityConfig:function(){return t.get("rest/security/all")},toggleSecurity:function(e){return t.post("rest/security",e?"true":"false")},getRoles:function(){return t.get("rest/roles")},getRolesMapping:function(e){return t.get("rest/roles/mapping",{params:e})},getAuthenticatedUser:function(){return t.get("rest/security/authenticated-user")}};function e(t){return encodeURIComponent(t).replace(/[.!'()*]/g,(function(t){return"%"+t.charCodeAt(0).toString(16)}))}}},function(t,e){!function(t){t.getError=function(t,e,n){if(angular.isObject(t)&&t.status&&t.data)return getError(t.data,e,n);if(e&&403===e)return"Access is restricted";if(t){let r="Generic error";if(angular.isString(t))-1===t.indexOf("<html>")&&(r=t,r=r.replace(/^(([a-z0-9_]+\.)+[a-zA-Z0-9_]+: )+/,""));else if(angular.isObject(t)){if("message"in t&&(r=t.message),"error"in t&&(r=t.error.message),"responseJSON"in t&&"message"in t.responseJSON)return getError(t.responseJSON,e,n);"responseText"in t&&(r=t.responseText)}return n>0&&r.length>n&&(r=r.substr(0,n)+"..."),r}return"There is an error"}}(window)},function(t,e,n){"use strict";n.r(e);n(4),n(17),n(18),n(19),n(14),n(8),n(9),n(15),n(34),n(35),n(12),n(10),n(28);var r=n(2),i=(n(5),n(13),n(29),n(0)),s=(n(20),n(30),n(7));function o(t,e,n,r,i,s,o,a,u,c){function l(){t.getActiveRepository()&&(t.getNamespacesPromise=c.getNamespaces(t.getActiveRepository()).success((function(){h()})),t.getActiveRepositorySize())}function h(){s.isLicenseValid()&&(t.getAutocompletePromise=o.checkAutocompleteStatus())}t.doClear=!1,t.getActiveRepositorySize=function(){const e=r.getActiveRepositoryObject();e&&(t.activeRepositorySizeError=void 0,u.getSize(e).then((function(e){t.activeRepositorySize=e.data})).catch((function(e){t.activeRepositorySizeError=e.data.message})))},t.$on("autocompleteStatus",(function(){h()})),t.$on("repositoryIsSet",l),t.$on("$routeChangeSuccess",(function(t,n,r){r&&(i.isAuthenticated()||i.isFreeAccessEnabled()?l():e.redirectToLogin())})),t.onKeyDown=function(e){27===e.keyCode&&(t.doClear=!0)}}function a(t,e,n,o,a,u,c,l,h,f,p,d,g,m,v,y,b,w,x,S,E,F,A,C,D){t.descr=F.instant("main.gdb.description"),t.documentation="",t.menu=e,t.tutorialState=1!==S.get(E.TUTORIAL_STATE),t.userLoggedIn=!1,t.embedded=u.search().embedded,t.productInfo=f,t.guidePaused="true"===S.get(s.GUIDE_PAUSE);function I(){$(window).width()<=720?($(".container-fluid.main-container").addClass("expanded"),$(".main-menu").addClass("collapsed"),$(".main-menu .icon-caret-left").toggleClass("icon-caret-left").toggleClass("icon-caret-right"),$(".toggle-menu").hide()):$(window).width()>720&&"collapsedMenu"===S.get(E.MENU_STATE)?($(".container-fluid.main-container").addClass("expanded"),$(".main-menu").addClass("collapsed"),$(".toggle-menu").show(),$(".main-menu .icon-caret-left").toggleClass("icon-caret-left").toggleClass("icon-caret-right")):($(".container-fluid.main-container").removeClass("expanded"),$(".main-menu").removeClass("collapsed"),$(".toggle-menu").show(),$(".main-menu .icon-caret-right").toggleClass("icon-caret-right").toggleClass("icon-caret-left"))}!function(){const e=new Date;t.currentYear=e.getFullYear(),t.previousYear=2002}(),$("#repositorySelectDropdown").on("hide.bs.dropdown",(function(t){D.isActive()&&$("#repositorySelectDropdown.autoCloseOff").length>0&&t.preventDefault()})),t.$on("$routeChangeSuccess",(function(e,n,r){t.clicked=!1,$(".menu-element-root").removeClass("active"),p((function(){$(".menu-element.open a.menu-element-root").addClass("active"),$(".main-menu.collapsed .menu-element.open .menu-element-root").addClass("active")}),400),r&&l.checkLicenseStatus()})),t.resumeGuide=function(){h.$broadcast("guideResume")},h.$on("guideReset",(function(){t.guidePaused=!1,h.guidePaused=!1})),h.$on("guideStarted",(function(){t.guidePaused=!1,h.guidePaused=!1})),h.$on("guidePaused",(function(){t.guidePaused=!0,h.guidePaused=!0})),h.$on("$translateChangeSuccess",(function(){t.menu.forEach((function(t){t.label=F.instant(t.labelKey),t.children&&t.children.forEach((function(t){t.label=F.instant(t.labelKey)}))})),h.helpInfo=x.trustAsHtml(Object(i.decodeHTML)(F.instant(h.helpInfo))),h.title=Object(i.decodeHTML)(F.instant(h.title)),t.initTutorial()})),t.checkMenu=function(){return $(".main-menu").hasClass("collapsed")},t.copyToClipboard=function(t){d.openCopyToClipboardModal(t)},t.goToAddRepo=function(){u.path("/repository/create").search({previous:"home"})},t.goToEditRepo=function(t){u.path("repository/edit/"+t.id).search({previous:"home",location:t.location})},t.getLocationFromUri=function(t){return c.getLocationFromUri(t)},t.$on("$locationChangeSuccess",(function(){t.showFooter="/"===u.url()})),t.$on("repositoryIsSet",(function(){t.setRestricted(),S.clearClassHieararchyState()})),t.graphdbVersion=t.engineVersion=f.productVersion,t.workbenchVersion=f.Workbench,t.connectorsVersion=f.connectors,t.sesameVersion=f.sesame,t.select=function(e,n,r){$(".main-menu").hasClass("collapsed")?$(n.target).parents(".menu-element").children(".menu-element-root").hasClass("active")?(t.selected=e,t.clicked=!r):(!$(n.target).parents(".menu-element").hasClass("open")&&r?t.clicked=!0:t.clicked=!r,t.selected===e?t.selected=-1:t.selected=e):(!$(n.target).parents(".menu-element").hasClass("open")&&r?t.clicked=!0:t.clicked=!r,0!==$(n.target).parent(".menu-element").find(".sub-menu").length?($(n.target).parents(".menu-element").children(".menu-element-root").hasClass("active")?$(".sub-menu li.active").parents(".menu-element").children(".menu-element-root").removeClass("active"):$(".sub-menu li.active").parents(".menu-element").children(".menu-element-root").addClass("active"),t.selected===e?t.selected=-1:t.selected=e):(p((function(){$(n.target).parents(".menu-element").children(".menu-element-root").addClass("active")}),50),t.selected=e))},$("body").bind("click",(function(e){!$(e.target).parents(".main-menu").length&&$(".main-menu").hasClass("collapsed")&&(t.clicked=!1,t.selected=-1)})),t.isCurrentPath=function(t){return u.path()==="/"+t},t.isCurrentSubmenuChildPath=function(e){return 0!==e.children.length&&e.children.some((function(e){return t.isCurrentPath(e.href)}))},"/"===u.path()?t.selected=-1:(p((function(){const e=u.path().replace("/",""),n=$('a[href^="'+e+'"]');t.selected=n.closest(".menu-element").index()-1}),200),t.isCurrentPath(u.path())),t.popoverTemplate="js/angular/templates/repositorySize.html",t.securityEnabled=!0,t.isSecurityEnabled=function(){return n.isSecurityEnabled()},t.isFreeAccessEnabled=function(){return n.isFreeAccessEnabled()},t.hasExternalAuthUser=function(){return n.hasExternalAuthUser()},t.isDefaultAuthEnabled=function(){return n.isDefaultAuthEnabled()},t.isUserLoggedIn=function(){return t.userLoggedIn},t.hasActiveLocation=function(){return c.hasActiveLocation()},t.getActiveLocation=function(){return c.getActiveLocation()},t.isLoadingLocation=function(){return c.isLoadingLocation()},t.getRepositories=function(){return c.getRepositories()},t.getReadableRepositories=function(){return c.getReadableRepositories()},t.getWritableRepositories=function(){return c.getWritableRepositories()},t.getActiveRepository=function(){return c.getActiveRepository()},t.canWriteRepoInLocation=function(t){return n.canWriteRepo(t)},t.canWriteActiveRepo=function(t){const e=c.getActiveRepositoryObject();return!!e&&(n.canWriteRepo(e)&&("SYSTEM"!==e.id||!t))},t.getActiveRepositoryObject=function(){return c.getActiveRepositoryObject()},t.getActiveRepositoryShortLocation=function(){const t=c.getActiveRepositoryObject();if(t){const e=t.location;if(e)return"@"+A.shortenIri(e)}return""},t.isActiveRepoOntopType=function(){return c.isActiveRepoOntopType()},t.isActiveRepoFedXType=function(){return c.isActiveRepoFedXType()},t.isLicenseValid=function(){return l.isLicenseValid()},t.setAttrs=function(e){t.attrs=e},t.setRestricted=function(){t.attrs&&(t.isRestricted=t.attrs.hasOwnProperty("license")&&!l.isLicenseValid()||t.attrs.hasOwnProperty("write")&&t.isSecurityEnabled()&&!t.canWriteActiveRepo()||t.attrs.hasOwnProperty("ontop")&&t.isActiveRepoOntopType()||t.attrs.hasOwnProperty("fedx")&&t.isActiveRepoFedXType())},t.toHumanReadableType=function(t){switch(t){case"graphdb":return"Graphdb";case"system":return"System";case"ontop":return"Ontop";case"fedx":return"FedX";default:return"Unknown"}},t.setRepository=function(t){c.setRepository(t)},t.logout=function(){n.clearAuthentication(),a.success("Signed out"),n.freeAccess?c.resetActiveRepository():n.isSecurityEnabled()&&h.redirectToLogin()},t.isAdmin=function(){return t.hasRole(r.UserRole.ROLE_ADMIN)},t.isUser=function(){return t.hasRole(r.UserRole.ROLE_USER)},t.hasRole=function(t){return!!angular.isUndefined(t)||n.hasRole(t)},t.hasPermission=function(){return h.hasPermission()},t.canReadRepo=function(t){return n.canReadRepo(t)},t.checkForWrite=function(t,e){return n.checkForWrite(t,e)},t.setPopoverRepo=function(e){t.popoverRepo=e},t.isRepoActive=function(t){return c.isRepoActive(t)},t.getRepositorySize=function(){t.repositorySize={},t.popoverRepo&&(t.repositorySize.loading=!0,y.getSize(t.popoverRepo).then((function(e){t.repositorySize=e.data})))},t.getDegradedReason=function(){return c.getDegradedReason()},t.canManageRepositories=function(){return n.hasRole(r.UserRole.ROLE_REPO_MANAGER)&&!c.getDegradedReason()},t.getSavedQueries=function(){w.getSavedQueries().success((function(e){t.sampleQueries=e})).error((function(t){const e=getError(t);a.error(e,F.instant("query.editor.get.saved.queries.error"))}))},t.goToSparqlEditor=function(t){u.path("/sparql").search({savedQueryName:t.name,owner:t.owner,execute:!0})},t.declineTutorial=function(){S.set(E.TUTORIAL_STATE,1),t.tutorialState=!1},t.showTutorial=function(){t.tutorialState=!0,S.remove(E.TUTORIAL_STATE)},t.initTutorial=function(){if(!t.tutorialState&&"/"!==u.path())return;t.tutorialInfo=[{title:F.instant("main.info.title.welcome.page"),info:"<p>"+Object(i.decodeHTML)(F.instant("main.info.welcome.page"))+"</p><p>"+Object(i.decodeHTML)(F.instant("main.info.welcome.page.guides"))+"</p><p>"+Object(i.decodeHTML)(F.instant("main.info.welcome.page.footer"))+"</p>"},{title:F.instant("main.info.title.create.repo.page"),info:Object(i.decodeHTML)(F.instant("main.info.create.repo.page",{link:'<a href="https://graphdb.ontotext.com/documentation/'+f.productShortVersion+'/configuring-a-repository.html" target="_blank">'}))},{title:F.instant("main.info.title.load.sample.dataset"),info:F.instant("main.info.load.sample.dataset")},{title:F.instant("main.info.title.run.sparql.query"),info:Object(i.decodeHTML)(F.instant("main.info.run.sparql.query"))},{title:F.instant("menu.rest.api.label"),info:Object(i.decodeHTML)(F.instant("main.info.rest.api"))}],t.activePage=0,$(".pages-wrapper .page-slide").css("opacity",100);const e=$(".main-container")[0].offsetWidth+200;p((function(){const n=$(".pages-wrapper .page-slide");n.css("left",e+"px"),$(n[t.activePage]).css("left","0px"),$($(".btn-toolbar.pull-right .btn-group .btn")[0]).focus()}),50)},t.getTutorialPageHtml=function(t){return x.trustAsHtml(t.info)},t.checkSubMenuPosition=function(t){0===t?$(".main-menu.collapsed .sub-menu").removeClass("align-bottom"):$(window).height()<735?$(".main-menu.collapsed .sub-menu").addClass("align-bottom"):$(".main-menu.collapsed .sub-menu").removeClass("align-bottom")},I(),$(window).resize((function(){angular.isDefined(t.menuState)?$(window).width()<=720?($(".container-fluid.main-container").addClass("expanded"),$(".main-menu").addClass("collapsed"),$(".toggle-menu").hide(),$(".main-menu .icon-caret-left").toggleClass("icon-caret-left").toggleClass("icon-caret-right")):$(window).width()>720&&t.menuState?$(".toggle-menu").show():($(".container-fluid.main-container").removeClass("expanded"),$(".main-menu").removeClass("collapsed"),$(".toggle-menu").show(),$(".main-menu .icon-caret-right").toggleClass("icon-caret-right").toggleClass("icon-caret-left")):I(),t.tutorialState&&"/"===u.path()&&t.initTutorial(),$(window).height()<735?($(".sub-menu").addClass("align-bottom"),$(".main-menu.collapsed li:nth-child(2) .sub-menu").removeClass("align-bottom")):$(".sub-menu").removeClass("align-bottom")})),t.slideToPage=function(e){const n=$(".main-container")[0].offsetWidth,r=$(".pages-wrapper .page-slide");r.css("opacity","0").delay(200).css("left",n+"px"),t.activePage=e,$(r[t.activePage]).css("opacity","100").css("left","0px")},t.slideNext=function(){let e=++t.activePage;e>=t.tutorialInfo.length&&(e=0),t.slideToPage(e),$($(".btn-toolbar.pull-right .btn-group .btn")[t.activePage]).focus()},t.toggleNavigation=function(){const e=$(".main-menu"),n=$(".sub-menu li.active");if(e.hasClass("collapsed"))n.parents(".menu-element").hasClass("open")?n.parents(".menu-element").children(".menu-element-root").removeClass("active"):n.parents(".menu-element").children(".menu-element-root").addClass("active"),$(".container-fluid.main-container").removeClass("expanded"),e.removeClass("collapsed"),$(".main-menu .icon-caret-right").toggleClass("icon-caret-right").toggleClass("icon-caret-left"),h.$broadcast("onToggleNavWidth",!1);else{n.parents(".menu-element").children(".menu-element-root").addClass("active");const r=$(".menu-element");r.hasClass("open")&&(r.removeClass("open"),t.clicked=!1,t.selected=-1),$(".container-fluid.main-container").addClass("expanded"),e.addClass("collapsed"),$(".main-menu .icon-caret-left").toggleClass("icon-caret-left").toggleClass("icon-caret-right"),$(".main-menu.collapsed .menu-element.clicked").removeClass("clicked"),h.$broadcast("onToggleNavWidth",!0)}},t.$on("onToggleNavWidth",(function(e,n){if(t.menuState=n,n?S.set(E.MENU_STATE,"collapsedMenu"):S.set(E.MENU_STATE,"expandedMenu"),t.tutorialState&&"/"===u.path()){const e=$(".pages-wrapper")[0].offsetWidth+200;p((function(){const n=$(".pages-wrapper .page-slide");n.css("left",e+"px"),$(n[t.activePage]).css("left","0px")}),50)}})),t.numberOfActiveImports=0,t.getNumberOfActiveImportsRunning=!1,t.getNumberOfActiveImports=function(){t.getNumberOfActiveImportsRunning||t.canWriteActiveRepo()&&"SYSTEM"!==t.getActiveRepository()&&(t.getNumberOfActiveImportsRunning=!0,o({method:"GET",url:"rest/repositories/"+t.getActiveRepository()+"/import/active",timeout:1e4}).success((function(e){t.numberOfActiveImports=e})).finally((function(){t.getNumberOfActiveImportsRunning=!1})))},t.getQueriesRunning=!1,t.skipGetQueriesTimes=0;const R=function(){let t=0,e=1;return{next:function(){const n=e;return e=t+e,t=n,n},reset:function(){t=0,e=1}}}();t.getQueries=function(){t.getQueriesRunning||(t.skipGetQueriesTimes>0?t.skipGetQueriesTimes--:c.getActiveRepository()&&"SYSTEM"!==c.getActiveRepository()&&!c.isActiveRepoOntopType()&&t.hasRole(r.UserRole.ROLE_USER)?(t.getQueriesRunning=!0,b.getQueryCount().success((function(e){t.queryCount=e,R.reset()})).error((function(){t.queryCount=0,t.skipGetQueriesTimes=R.next()})).finally((function(){t.getQueriesRunning=!1}))):t.queryCount=0)};const T=g((function(){t.getDegradedReason()||(t.getQueries(),t.getNumberOfActiveImports())}),2e3);t.$on("$destroy",(function(){g.cancel(T)})),n.securityInitialized&&t.getSavedQueries(),t.$on("securityInit",(function(e,r,i,s){t.securityEnabled=r,t.userLoggedIn=i,!r||i||s?(C.when(n.getPrincipal()).then(e=>{t.principal=e,t.isIgnoreSharedQueries=e&&e.appSettings.IGNORE_SHARED_QUERIES}),l.checkLicenseStatus(),t.getSavedQueries()):"/login"!==u.path()&&h.redirectToLogin()})),t.isEnterprise=function(){return"enterprise"===t.getProductType()},t.isFreeEdition=function(){return"free"===t.getProductType()},t.checkEdition=function(e){return null==e||_.indexOf(e,t.getProductType())>=0},t.showLicense=function(){return l.showLicense},t.getLicense=function(){return l.license},t.isLicenseHardcoded=function(){return l.isLicenseHardcoded},t.getProductType=function(){return l.productType},t.getProductTypeHuman=function(){return l.productTypeHuman},t.getHumanReadableSeconds=function(t,e){const n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60);let s;s=e&&t<10?t<1?_.ceil(t%60,1):_.round(t%60,1):_.round(t%60,0);let o="";return n&&(o+=n+"d "),(n||r)&&(o+=r+"h "),(n||r||i)&&(o+=i+"m "),o+=s+"s",o.replace(/( 0[a-z])+$/,"")},t.getHumanReadableTimestamp=function(t){const e=Date.now(),n=(e-t)/1e3;if(n<60)return F.instant("timestamp.moments.ago");if(n<600)return F.instant("timestamp.minutes.ago");{const r=new Date(e),i=new Date(t);if(r.getYear()===i.getYear()&&r.getMonth()===i.getMonth()&&r.getDate()===i.getDate())return m("date")(t,"'"+F.instant("timestamp.today.at")+"' HH:mm");if(n<86400)return m("date")(t,"'"+F.instant("timestamp.yesterday.at")+"' HH:mm")}return m("date")(t,"'"+F.instant("timestamp.on")+"' yyyy-MM-dd '"+F.instant("timestamp.at")+"' HH:mm")}}function u(t,e,n){t.getRepositorySize=function(e){n.getSize(e).then((function(e){t.size=e.data}))}}angular.module("graphdb.workbench.se.controllers",["graphdb.framework.core.services.jwtauth","graphdb.framework.core.services.repositories","graphdb.framework.core.services.licenseService","ngCookies","ngFileUpload","graphdb.framework.core","graphdb.framework.core.controllers","graphdb.framework.core.directives","graphdb.framework.rest.license.service","graphdb.framework.rest.autocomplete.service","graphdb.framework.rest.repositories.service","graphdb.framework.rest.sparql.service","graphdb.framework.rest.autocomplete.service","graphdb.framework.rest.plugins.service","graphdb.framework.rest.monitoring.service","graphdb.framework.rest.rdf4j.repositories.service","graphdb.framework.utils.localstorageadapter","graphdb.framework.core.services.autocompleteStatus","graphdb.framework.utils.uriutils","graphdb.framework.guides.directives","graphdb.framework.guides.services"]).controller("mainCtrl",a).controller("homeCtrl",o).controller("repositorySizeCtrl",u),o.$inject=["$scope","$rootScope","$http","$repositories","$jwtAuth","$licenseService","AutocompleteRestService","LicenseRestService","RepositoriesRestService","RDF4JRepositoriesRestService"],a.$inject=["$scope","$menuItems","$jwtAuth","$http","toastr","$location","$repositories","$licenseService","$rootScope","productInfo","$timeout","ModalService","$interval","$filter","LicenseRestService","RepositoriesRestService","MonitoringRestService","SparqlRestService","$sce","LocalStorageAdapter","LSKeys","$translate","UriUtils","$q","GuidesService"],u.$inject=["$scope","$http","RepositoriesRestService"]},function(t,e){angular.module("graphdb.framework.rest.locations.service",[]).factory("LocationsRestService",n),n.$inject=["$http"];function n(t){return{getLocations:function(e){return t.get("rest/locations",{timeout:e?e.promise:null})},addLocation:function(e){return t.post("rest/locations",e)},editLocation:function(e){return t.put("rest/locations",e)},deleteLocation:function(e){return t.delete("rest/locations?uri="+e)},getActiveLocation:function(){return t({method:"GET",url:"rest/locations/active",noCancelOnRouteChange:!0})},setDefaultRepository:function(e){return t({url:"rest/locations/active/default-repository",method:"POST",data:{defaultRepository:e}})},getLocationRpcAddress:function(e){return t.get("rest/info/rpc-address",{params:{location:e}})}}}},function(t,e){angular.module("graphdb.framework.core.services.licenseService",[]).service("$licenseService",["$rootScope","LicenseRestService","$translate",function(t,e,n){const r=this;this.checkLicenseStatus=function(){r.loadingLicense=!0,e.getHardcodedLicense().success((function(t){r.isLicenseHardcoded="true"===t})).error((function(){r.isLicenseHardcoded=!0})).then((function(){e.getLicenseInfo().then((function(t){r.license=t.data,r.showLicense=!0,r.loadingLicense=!1,i(r.license)}),(function(){r.license={message:n.instant("no.license.set.msg"),valid:!1},r.showLicense=!0,r.loadingLicense=!1,i(r.license)}))}))};const i=function(t){r.productType=t.productType,"standard"===r.productType?r.productTypeHuman="Standard":"enterprise"===r.productType?r.productTypeHuman="Enterprise":"free"===r.productType?r.productTypeHuman="Free":"graphdb"===r.productType&&(r.productTypeHuman="GraphDB")};this.checkLicenseStatus(),this.isLicenseValid=function(){return r.license&&r.license.valid}}])},function(t,e){angular.module("graphdb.framework.core.services.autocompleteStatus",[]).service("$autocompleteStatus",["$rootScope","AutocompleteRestService","LocalStorageAdapter","LSKeys","$repositories",function(t,e,n,r,i){const s=this;this.setAutocompleteStatus=function(e){n.set(r.AUTOCOMPLETE_ENABLED,e),t.$broadcast("autocompleteStatus",e)},t.$watch((function(){return n.get(r.AUTOCOMPLETE_ENABLED)}),(function(t){s.setAutocompleteStatus(t)}),!0),t.$on("repositoryIsSet",(function(){!i.getActiveRepository()||i.isActiveRepoOntopType()||i.isActiveRepoFedXType()||e.checkAutocompleteStatus().success((function(t){s.setAutocompleteStatus(t)}))}))}])},function(t,e){angular.module("graphdb.framework.guides.directives",[]).directive("guideSelector",(function(){return{}}))},function(t,e){
|
|
28
|
+
/*! shepherd.js 10.0.1 */var s="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function o(t,e){return!1!==e.clone&&e.isMergeableObject(t)?h((n=t,Array.isArray(n)?[]:{}),t,e):t;var n}function a(t,e,n){return t.concat(e).map((function(t){return o(t,n)}))}function u(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter((function(e){return t.propertyIsEnumerable(e)})):[]}(t))}function c(t,e){try{return e in t}catch(t){return!1}}function l(t,e,n){var r={};return n.isMergeableObject(t)&&u(t).forEach((function(e){r[e]=o(t[e],n)})),u(e).forEach((function(i){(function(t,e){return c(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))})(t,i)||(c(t,i)&&n.isMergeableObject(e[i])?r[i]=function(t,e){if(!e.customMerge)return h;var n=e.customMerge(t);return"function"==typeof n?n:h}(i,n)(t[i],e[i],n):r[i]=o(e[i],n))})),r}function h(t,e,n){(n=n||{}).arrayMerge=n.arrayMerge||a,n.isMergeableObject=n.isMergeableObject||i,n.cloneUnlessOtherwiseSpecified=o;var r=Array.isArray(e);return r===Array.isArray(t)?r?n.arrayMerge(t,e,n):l(t,e,n):o(e,n)}h.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce((function(t,n){return h(t,n,e)}),{})};var f=h;function p(t){return t instanceof HTMLElement}function d(t){return"function"==typeof t}function g(t){return"string"==typeof t}function m(t){return void 0===t}class v{on(t,e,n,r){return void 0===r&&(r=!1),m(this.bindings)&&(this.bindings={}),m(this.bindings[t])&&(this.bindings[t]=[]),this.bindings[t].push({handler:e,ctx:n,once:r}),this}once(t,e,n){return this.on(t,e,n,!0)}off(t,e){return m(this.bindings)||m(this.bindings[t])||(m(e)?delete this.bindings[t]:this.bindings[t].forEach((n,r)=>{n.handler===e&&this.bindings[t].splice(r,1)})),this}trigger(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return!m(this.bindings)&&this.bindings[t]&&this.bindings[t].forEach((e,r)=>{const{ctx:i,handler:s,once:o}=e,a=i||this;s.apply(a,n),o&&this.bindings[t].splice(r,1)}),this}}function y(t){const e=Object.getOwnPropertyNames(t.constructor.prototype);for(let n=0;n<e.length;n++){const r=e[n],i=t[r];"constructor"!==r&&"function"==typeof i&&(t[r]=i.bind(t))}return t}function b(t){const{event:e,selector:n}=t.options.advanceOn||{};if(!e)return console.error("advanceOn was defined, but no event name was passed.");{const r=function(t,e){return n=>{if(e.isOpen()){const r=e.el&&n.currentTarget===e.el;(!m(t)&&n.currentTarget.matches(t)||r)&&e.tour.next()}}}(n,t);let i;try{i=document.querySelector(n)}catch(t){}if(!m(n)&&!i)return console.error("No element was found for the selector supplied to advanceOn: "+n);i?(i.addEventListener(e,r),t.on("destroy",()=>i.removeEventListener(e,r))):(document.body.addEventListener(e,r,!0),t.on("destroy",()=>document.body.removeEventListener(e,r,!0)))}}var w="top",x="bottom",S="right",E="left",F=[w,x,S,E],A=F.reduce((function(t,e){return t.concat([e+"-start",e+"-end"])}),[]),C=[].concat(F,["auto"]).reduce((function(t,e){return t.concat([e,e+"-start",e+"-end"])}),[]),D=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function I(t){return t?(t.nodeName||"").toLowerCase():null}function $(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function R(t){return t instanceof $(t).Element||t instanceof Element}function T(t){return t instanceof $(t).HTMLElement||t instanceof HTMLElement}function _(t){return"undefined"!=typeof ShadowRoot&&(t instanceof $(t).ShadowRoot||t instanceof ShadowRoot)}var P={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},r=e.attributes[t]||{},i=e.elements[t];T(i)&&I(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(t){var e=r[t];!1===e?i.removeAttribute(t):i.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var r=e.elements[t],i=e.attributes[t]||{},s=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});T(r)&&I(r)&&(Object.assign(r.style,s),Object.keys(i).forEach((function(t){r.removeAttribute(t)})))}))}},requires:["computeStyles"]};function k(t){return t.split("-")[0]}var O=Math.max,j=Math.min,B=Math.round;function N(t,e){void 0===e&&(e=!1);var n=t.getBoundingClientRect(),r=1,i=1;if(T(t)&&e){var s=t.offsetHeight,o=t.offsetWidth;o>0&&(r=B(n.width)/o||1),s>0&&(i=B(n.height)/s||1)}return{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function L(t){var e=N(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function H(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&_(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function M(t){return $(t).getComputedStyle(t)}function U(t){return["table","td","th"].indexOf(I(t))>=0}function V(t){return((R(t)?t.ownerDocument:t.document)||window.document).documentElement}function q(t){return"html"===I(t)?t:t.assignedSlot||t.parentNode||(_(t)?t.host:null)||V(t)}function K(t){return T(t)&&"fixed"!==M(t).position?t.offsetParent:null}function z(t){for(var e=$(t),n=K(t);n&&U(n)&&"static"===M(n).position;)n=K(n);return n&&("html"===I(n)||"body"===I(n)&&"static"===M(n).position)?e:n||function(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&T(t)&&"fixed"===M(t).position)return null;var n=q(t);for(_(n)&&(n=n.host);T(n)&&["html","body"].indexOf(I(n))<0;){var r=M(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||e&&"filter"===r.willChange||e&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(t)||e}function G(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function W(t,e,n){return O(t,j(e,n))}function Y(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function X(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}function J(t){return t.split("-")[1]}var Z={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Q(t){var e,n=t.popper,r=t.popperRect,i=t.placement,s=t.variation,o=t.offsets,a=t.position,u=t.gpuAcceleration,c=t.adaptive,l=t.roundOffsets,h=t.isFixed,f=o.x,p=void 0===f?0:f,d=o.y,g=void 0===d?0:d,m="function"==typeof l?l({x:p,y:g}):{x:p,y:g};p=m.x,g=m.y;var v=o.hasOwnProperty("x"),y=o.hasOwnProperty("y"),b=E,F=w,A=window;if(c){var C=z(n),D="clientHeight",I="clientWidth";if(C===$(n)&&"static"!==M(C=V(n)).position&&"absolute"===a&&(D="scrollHeight",I="scrollWidth"),C=C,i===w||(i===E||i===S)&&"end"===s)F=x,g-=(h&&C===A&&A.visualViewport?A.visualViewport.height:C[D])-r.height,g*=u?1:-1;if(i===E||(i===w||i===x)&&"end"===s)b=S,p-=(h&&C===A&&A.visualViewport?A.visualViewport.width:C[I])-r.width,p*=u?1:-1}var R,T=Object.assign({position:a},c&&Z),_=!0===l?function(t){var e=t.x,n=t.y,r=window.devicePixelRatio||1;return{x:B(e*r)/r||0,y:B(n*r)/r||0}}({x:p,y:g}):{x:p,y:g};return p=_.x,g=_.y,u?Object.assign({},T,((R={})[F]=y?"0":"",R[b]=v?"0":"",R.transform=(A.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",R)):Object.assign({},T,((e={})[F]=y?g+"px":"",e[b]=v?p+"px":"",e.transform="",e))}var tt={passive:!0};var et={left:"right",right:"left",bottom:"top",top:"bottom"};function nt(t){return t.replace(/left|right|bottom|top/g,(function(t){return et[t]}))}var rt={start:"end",end:"start"};function it(t){return t.replace(/start|end/g,(function(t){return rt[t]}))}function st(t){var e=$(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ot(t){return N(V(t)).left+st(t).scrollLeft}function at(t){var e=M(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function ut(t,e){var n;void 0===e&&(e=[]);var r=function t(e){return["html","body","#document"].indexOf(I(e))>=0?e.ownerDocument.body:T(e)&&at(e)?e:t(q(e))}(t),i=r===(null==(n=t.ownerDocument)?void 0:n.body),s=$(r),o=i?[s].concat(s.visualViewport||[],at(r)?r:[]):r,a=e.concat(o);return i?a:a.concat(ut(q(o)))}function ct(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function lt(t,e){return"viewport"===e?ct(function(t){var e=$(t),n=V(t),r=e.visualViewport,i=n.clientWidth,s=n.clientHeight,o=0,a=0;return r&&(i=r.width,s=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=r.offsetLeft,a=r.offsetTop)),{width:i,height:s,x:o+ot(t),y:a}}(t)):R(e)?function(t){var e=N(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(e):ct(function(t){var e,n=V(t),r=st(t),i=null==(e=t.ownerDocument)?void 0:e.body,s=O(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=O(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+ot(t),u=-r.scrollTop;return"rtl"===M(i||n).direction&&(a+=O(n.clientWidth,i?i.clientWidth:0)-s),{width:s,height:o,x:a,y:u}}(V(t)))}function ht(t,e,n){var r="clippingParents"===e?function(t){var e=ut(q(t)),n=["absolute","fixed"].indexOf(M(t).position)>=0&&T(t)?z(t):t;return R(n)?e.filter((function(t){return R(t)&&H(t,n)&&"body"!==I(t)})):[]}(t):[].concat(e),i=[].concat(r,[n]),s=i[0],o=i.reduce((function(e,n){var r=lt(t,n);return e.top=O(r.top,e.top),e.right=j(r.right,e.right),e.bottom=j(r.bottom,e.bottom),e.left=O(r.left,e.left),e}),lt(t,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function ft(t){var e,n=t.reference,r=t.element,i=t.placement,s=i?k(i):null,o=i?J(i):null,a=n.x+n.width/2-r.width/2,u=n.y+n.height/2-r.height/2;switch(s){case w:e={x:a,y:n.y-r.height};break;case x:e={x:a,y:n.y+n.height};break;case S:e={x:n.x+n.width,y:u};break;case E:e={x:n.x-r.width,y:u};break;default:e={x:n.x,y:n.y}}var c=s?G(s):null;if(null!=c){var l="y"===c?"height":"width";switch(o){case"start":e[c]=e[c]-(n[l]/2-r[l]/2);break;case"end":e[c]=e[c]+(n[l]/2-r[l]/2)}}return e}function pt(t,e){void 0===e&&(e={});var n=e,r=n.placement,i=void 0===r?t.placement:r,s=n.boundary,o=void 0===s?"clippingParents":s,a=n.rootBoundary,u=void 0===a?"viewport":a,c=n.elementContext,l=void 0===c?"popper":c,h=n.altBoundary,f=void 0!==h&&h,p=n.padding,d=void 0===p?0:p,g=Y("number"!=typeof d?d:X(d,F)),m="popper"===l?"reference":"popper",v=t.rects.popper,y=t.elements[f?m:l],b=ht(R(y)?y:y.contextElement||V(t.elements.popper),o,u),E=N(t.elements.reference),A=ft({reference:E,element:v,strategy:"absolute",placement:i}),C=ct(Object.assign({},v,A)),D="popper"===l?C:E,I={top:b.top-D.top+g.top,bottom:D.bottom-b.bottom+g.bottom,left:b.left-D.left+g.left,right:D.right-b.right+g.right},$=t.modifiersData.offset;if("popper"===l&&$){var T=$[i];Object.keys(I).forEach((function(t){var e=[S,x].indexOf(t)>=0?1:-1,n=[w,x].indexOf(t)>=0?"y":"x";I[t]+=T[n]*e}))}return I}function dt(t,e){void 0===e&&(e={});var n=e,r=n.placement,i=n.boundary,s=n.rootBoundary,o=n.padding,a=n.flipVariations,u=n.allowedAutoPlacements,c=void 0===u?C:u,l=J(r),h=l?a?A:A.filter((function(t){return J(t)===l})):F,f=h.filter((function(t){return c.indexOf(t)>=0}));0===f.length&&(f=h);var p=f.reduce((function(e,n){return e[n]=pt(t,{placement:n,boundary:i,rootBoundary:s,padding:o})[k(n)],e}),{});return Object.keys(p).sort((function(t,e){return p[t]-p[e]}))}function gt(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function mt(t){return[w,S,x,E].some((function(e){return t[e]>=0}))}function vt(t,e,n){void 0===n&&(n=!1);var r,i,s=T(e),o=T(e)&&function(t){var e=t.getBoundingClientRect(),n=B(e.width)/t.offsetWidth||1,r=B(e.height)/t.offsetHeight||1;return 1!==n||1!==r}(e),a=V(e),u=N(t,o),c={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(s||!s&&!n)&&(("body"!==I(e)||at(a))&&(c=(r=e)!==$(r)&&T(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:st(r)),T(e)?((l=N(e,!0)).x+=e.clientLeft,l.y+=e.clientTop):a&&(l.x=ot(a))),{x:u.left+c.scrollLeft-l.x,y:u.top+c.scrollTop-l.y,width:u.width,height:u.height}}function yt(t){var e=new Map,n=new Set,r=[];return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||function t(i){n.add(i.name),[].concat(i.requires||[],i.requiresIfExists||[]).forEach((function(r){if(!n.has(r)){var i=e.get(r);i&&t(i)}})),r.push(i)}(t)})),r}var bt={placement:"bottom",modifiers:[],strategy:"absolute"};function wt(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function xt(t){void 0===t&&(t={});var e=t,n=e.defaultModifiers,r=void 0===n?[]:n,i=e.defaultOptions,s=void 0===i?bt:i;return function(t,e,n){void 0===n&&(n=s);var i,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},bt,s),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},u=[],c=!1,l={state:a,setOptions:function(n){var i="function"==typeof n?n(a.options):n;h(),a.options=Object.assign({},s,a.options,i),a.scrollParents={reference:R(t)?ut(t):t.contextElement?ut(t.contextElement):[],popper:ut(e)};var o,c,f=function(t){var e=yt(t);return D.reduce((function(t,n){return t.concat(e.filter((function(t){return t.phase===n})))}),[])}((o=[].concat(r,a.options.modifiers),c=o.reduce((function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t}),{}),Object.keys(c).map((function(t){return c[t]}))));return a.orderedModifiers=f.filter((function(t){return t.enabled})),a.orderedModifiers.forEach((function(t){var e=t.name,n=t.options,r=void 0===n?{}:n,i=t.effect;if("function"==typeof i){var s=i({state:a,name:e,instance:l,options:r});u.push(s||function(){})}})),l.update()},forceUpdate:function(){if(!c){var t=a.elements,e=t.reference,n=t.popper;if(wt(e,n)){a.rects={reference:vt(e,z(n),"fixed"===a.options.strategy),popper:L(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(t){return a.modifiersData[t.name]=Object.assign({},t.data)}));for(var r=0;r<a.orderedModifiers.length;r++)if(!0!==a.reset){var i=a.orderedModifiers[r],s=i.fn,o=i.options,u=void 0===o?{}:o,h=i.name;"function"==typeof s&&(a=s({state:a,options:u,name:h,instance:l})||a)}else a.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(t){l.forceUpdate(),t(a)}))},function(){return o||(o=new Promise((function(t){Promise.resolve().then((function(){o=void 0,t(i())}))}))),o}),destroy:function(){h(),c=!0}};if(!wt(t,e))return l;function h(){u.forEach((function(t){return t()})),u=[]}return l.setOptions(n).then((function(t){!c&&n.onFirstUpdate&&n.onFirstUpdate(t)})),l}}var St=xt({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,s=void 0===i||i,o=r.resize,a=void 0===o||o,u=$(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach((function(t){t.addEventListener("scroll",n.update,tt)})),a&&u.addEventListener("resize",n.update,tt),function(){s&&c.forEach((function(t){t.removeEventListener("scroll",n.update,tt)})),a&&u.removeEventListener("resize",n.update,tt)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=ft({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=void 0===r||r,s=n.adaptive,o=void 0===s||s,a=n.roundOffsets,u=void 0===a||a,c={placement:k(e.placement),variation:J(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Q(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:u})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Q(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},P,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,r=t.name,i=n.offset,s=void 0===i?[0,0]:i,o=C.reduce((function(t,n){return t[n]=function(t,e,n){var r=k(t),i=[E,w].indexOf(r)>=0?-1:1,s="function"==typeof n?n(Object.assign({},e,{placement:t})):n,o=s[0],a=s[1];return o=o||0,a=(a||0)*i,[E,S].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}(n,e.rects,s),t}),{}),a=o[e.placement],u=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=o}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,s=void 0===i||i,o=n.altAxis,a=void 0===o||o,u=n.fallbackPlacements,c=n.padding,l=n.boundary,h=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,d=void 0===p||p,g=n.allowedAutoPlacements,m=e.options.placement,v=k(m),y=u||(v===m||!d?[nt(m)]:function(t){if("auto"===k(t))return[];var e=nt(t);return[it(t),e,it(e)]}(m)),b=[m].concat(y).reduce((function(t,n){return t.concat("auto"===k(n)?dt(e,{placement:n,boundary:l,rootBoundary:h,padding:c,flipVariations:d,allowedAutoPlacements:g}):n)}),[]),F=e.rects.reference,A=e.rects.popper,C=new Map,D=!0,I=b[0],$=0;$<b.length;$++){var R=b[$],T=k(R),_="start"===J(R),P=[w,x].indexOf(T)>=0,O=P?"width":"height",j=pt(e,{placement:R,boundary:l,rootBoundary:h,altBoundary:f,padding:c}),B=P?_?S:E:_?x:w;F[O]>A[O]&&(B=nt(B));var N=nt(B),L=[];if(s&&L.push(j[T]<=0),a&&L.push(j[B]<=0,j[N]<=0),L.every((function(t){return t}))){I=R,D=!1;break}C.set(R,L)}if(D)for(var H=function(t){var e=b.find((function(e){var n=C.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return I=e,"break"},M=d?3:1;M>0;M--){if("break"===H(M))break}e.placement!==I&&(e.modifiersData[r]._skip=!0,e.placement=I,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,s=void 0===i||i,o=n.altAxis,a=void 0!==o&&o,u=n.boundary,c=n.rootBoundary,l=n.altBoundary,h=n.padding,f=n.tether,p=void 0===f||f,d=n.tetherOffset,g=void 0===d?0:d,m=pt(e,{boundary:u,rootBoundary:c,padding:h,altBoundary:l}),v=k(e.placement),y=J(e.placement),b=!y,F=G(v),A="x"===F?"y":"x",C=e.modifiersData.popperOffsets,D=e.rects.reference,I=e.rects.popper,$="function"==typeof g?g(Object.assign({},e.rects,{placement:e.placement})):g,R="number"==typeof $?{mainAxis:$,altAxis:$}:Object.assign({mainAxis:0,altAxis:0},$),T=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,_={x:0,y:0};if(C){if(s){var P,B="y"===F?w:E,N="y"===F?x:S,H="y"===F?"height":"width",M=C[F],U=M+m[B],V=M-m[N],q=p?-I[H]/2:0,K="start"===y?D[H]:I[H],Y="start"===y?-I[H]:-D[H],X=e.elements.arrow,Z=p&&X?L(X):{width:0,height:0},Q=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},tt=Q[B],et=Q[N],nt=W(0,D[H],Z[H]),rt=b?D[H]/2-q-nt-tt-R.mainAxis:K-nt-tt-R.mainAxis,it=b?-D[H]/2+q+nt+et+R.mainAxis:Y+nt+et+R.mainAxis,st=e.elements.arrow&&z(e.elements.arrow),ot=st?"y"===F?st.clientTop||0:st.clientLeft||0:0,at=null!=(P=null==T?void 0:T[F])?P:0,ut=M+it-at,ct=W(p?j(U,M+rt-at-ot):U,M,p?O(V,ut):V);C[F]=ct,_[F]=ct-M}if(a){var lt,ht="x"===F?w:E,ft="x"===F?x:S,dt=C[A],gt="y"===A?"height":"width",mt=dt+m[ht],vt=dt-m[ft],yt=-1!==[w,E].indexOf(v),bt=null!=(lt=null==T?void 0:T[A])?lt:0,wt=yt?mt:dt-D[gt]-I[gt]-bt+R.altAxis,xt=yt?dt+D[gt]+I[gt]-bt-R.altAxis:vt,St=p&&yt?function(t,e,n){var r=W(t,e,n);return r>n?n:r}(wt,dt,xt):W(p?wt:mt,dt,p?xt:vt);C[A]=St,_[A]=St-dt}e.modifiersData[r]=_}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,r=t.name,i=t.options,s=n.elements.arrow,o=n.modifiersData.popperOffsets,a=k(n.placement),u=G(a),c=[E,S].indexOf(a)>=0?"height":"width";if(s&&o){var l=function(t,e){return Y("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:X(t,F))}(i.padding,n),h=L(s),f="y"===u?w:E,p="y"===u?x:S,d=n.rects.reference[c]+n.rects.reference[u]-o[u]-n.rects.popper[c],g=o[u]-n.rects.reference[u],m=z(s),v=m?"y"===u?m.clientHeight||0:m.clientWidth||0:0,y=d/2-g/2,b=l[f],A=v-h[c]-l[p],C=v/2-h[c]/2+y,D=W(b,C,A),I=u;n.modifiersData[r]=((e={})[I]=D,e.centerOffset=D-C,e)}},effect:function(t){var e=t.state,n=t.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=e.elements.popper.querySelector(r)))&&H(e.elements.popper,r)&&(e.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,s=e.modifiersData.preventOverflow,o=pt(e,{elementContext:"reference"}),a=pt(e,{altBoundary:!0}),u=gt(o,r),c=gt(a,i,s),l=mt(u),h=mt(c);e.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":h})}}]});function Et(){return(Et=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function Ft(t){return{name:"focusAfterRender",enabled:!0,phase:"afterWrite",fn(){setTimeout(()=>{if(t.el){const e={preventScroll:!0};t.el.focus(e)}},300)}}}function At(t){const e=[{name:"applyStyles",fn(t){let{state:e}=t;Object.keys(e.elements).forEach(t=>{if("popper"!==t)return;const n=e.attributes[t]||{},r=e.elements[t];Object.assign(r.style,{position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)"}),Object.keys(n).forEach(t=>{const e=n[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)})})}},{name:"computeStyles",options:{adaptive:!1}}];let n={placement:"top",strategy:"fixed",modifiers:[Ft(t)]};return n=Et({},n,{modifiers:Array.from(new Set([...n.modifiers,...e]))}),n}function Ct(t){return g(t)&&""!==t?"-"!==t.charAt(t.length-1)?t+"-":t:""}function Dt(t){return null==t||(!t.element||!t.on)}function It(t){t.tooltip&&t.tooltip.destroy();const e=t._getResolvedAttachToOptions();let n=e.element;const r=function(t,e){let n={modifiers:[{name:"preventOverflow",options:{altAxis:!0,tether:!1}},Ft(e)],strategy:"absolute"};Dt(t)?n=At(e):n.placement=t.on;const r=e.tour&&e.tour.options&&e.tour.options.defaultStepOptions;r&&(n=Rt(r,n));return n=Rt(e.options,n),n}(e,t);if(Dt(e)){n=document.body;t.shepherdElementComponent.getElement().classList.add("shepherd-centered")}return t.tooltip=St(n,t.el,r),t.target=e.element,r}function $t(){let t=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)})}function Rt(t,e){if(t.popperOptions){let n=Object.assign({},e,t.popperOptions);if(t.popperOptions.modifiers&&t.popperOptions.modifiers.length>0){const r=t.popperOptions.modifiers.map(t=>t.name),i=e.modifiers.filter(t=>!r.includes(t.name));n.modifiers=Array.from(new Set([...i,...t.popperOptions.modifiers]))}return n}return e}function Tt(){}function _t(t,e){for(const n in e)t[n]=e[n];return t}function Pt(t){return t()}function kt(){return Object.create(null)}function Ot(t){t.forEach(Pt)}function jt(t){return"function"==typeof t}function Bt(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function Nt(t,e){t.appendChild(e)}function Lt(t,e,n){t.insertBefore(e,n||null)}function Ht(t){t.parentNode.removeChild(t)}function Mt(t){return document.createElement(t)}function Ut(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Vt(t){return document.createTextNode(t)}function qt(){return Vt(" ")}function Kt(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function zt(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function Gt(t,e){const n=Object.getOwnPropertyDescriptors(t.__proto__);for(const r in e)null==e[r]?t.removeAttribute(r):"style"===r?t.style.cssText=e[r]:"__value"===r?t.value=t[r]=e[r]:n[r]&&n[r].set?t[r]=e[r]:zt(t,r,e[r])}function Wt(t,e,n){t.classList[n?"add":"remove"](e)}let Yt;function Xt(t){Yt=t}function Jt(){if(!Yt)throw new Error("Function called outside component initialization");return Yt}function Zt(t){Jt().$$.after_update.push(t)}const Qt=[],te=[],ee=[],ne=[],re=Promise.resolve();let ie=!1;function se(t){ee.push(t)}const oe=new Set;let ae=0;function ue(){const t=Yt;do{for(;ae<Qt.length;){const t=Qt[ae];ae++,Xt(t),ce(t.$$)}for(Xt(null),Qt.length=0,ae=0;te.length;)te.pop()();for(let t=0;t<ee.length;t+=1){const e=ee[t];oe.has(e)||(oe.add(e),e())}ee.length=0}while(Qt.length);for(;ne.length;)ne.pop()();ie=!1,oe.clear(),Xt(t)}function ce(t){if(null!==t.fragment){t.update(),Ot(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(se)}}const le=new Set;let he;function fe(){he={r:0,c:[],p:he}}function pe(){he.r||Ot(he.c),he=he.p}function de(t,e){t&&t.i&&(le.delete(t),t.i(e))}function ge(t,e,n,r){if(t&&t.o){if(le.has(t))return;le.add(t),he.c.push(()=>{le.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}else r&&r()}function me(t){t&&t.c()}function ve(t,e,n,r){const{fragment:i,on_mount:s,on_destroy:o,after_update:a}=t.$$;i&&i.m(e,n),r||se(()=>{const e=s.map(Pt).filter(jt);o?o.push(...e):Ot(e),t.$$.on_mount=[]}),a.forEach(se)}function ye(t,e){const n=t.$$;null!==n.fragment&&(Ot(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function be(t,e){-1===t.$$.dirty[0]&&(Qt.push(t),ie||(ie=!0,re.then(ue)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function we(t,e,n,r,i,s,o,a){void 0===a&&(a=[-1]);const u=Yt;Xt(t);const c=t.$$={fragment:null,ctx:null,props:s,update:Tt,not_equal:i,bound:kt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(u?u.$$.context:[])),callbacks:kt(),dirty:a,skip_bound:!1,root:e.target||u.$$.root};o&&o(c.root);let l=!1;if(c.ctx=n?n(t,e.props||{},(function(e,n){const r=!(arguments.length<=2)&&arguments.length-2?arguments.length<=2?void 0:arguments[2]:n;return c.ctx&&i(c.ctx[e],c.ctx[e]=r)&&(!c.skip_bound&&c.bound[e]&&c.bound[e](r),l&&be(t,e)),n})):[],c.update(),l=!0,Ot(c.before_update),c.fragment=!!r&&r(c.ctx),e.target){if(e.hydrate){const t=(h=e.target,Array.from(h.childNodes));c.fragment&&c.fragment.l(t),t.forEach(Ht)}else c.fragment&&c.fragment.c();e.intro&&de(t.$$.fragment),ve(t,e.target,e.anchor,e.customElement),ue()}var h;Xt(u)}class xe{$destroy(){ye(this,1),this.$destroy=Tt}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function Se(t){let e,n,r,i,s;return{c(){e=Mt("button"),zt(e,"aria-label",n=t[3]?t[3]:null),zt(e,"class",r=`${t[1]||""} shepherd-button ${t[4]?"shepherd-button-secondary":""}`),e.disabled=t[2],zt(e,"tabindex","0")},m(n,r){Lt(n,e,r),e.innerHTML=t[5],i||(s=Kt(e,"click",(function(){jt(t[0])&&t[0].apply(this,arguments)})),i=!0)},p(i,s){let[o]=s;t=i,32&o&&(e.innerHTML=t[5]),8&o&&n!==(n=t[3]?t[3]:null)&&zt(e,"aria-label",n),18&o&&r!==(r=`${t[1]||""} shepherd-button ${t[4]?"shepherd-button-secondary":""}`)&&zt(e,"class",r),4&o&&(e.disabled=t[2])},i:Tt,o:Tt,d(t){t&&Ht(e),i=!1,s()}}}function Ee(t,e,n){let r,i,s,o,a,u,{config:c,step:l}=e;function h(t){return d(t)?t.call(l):t}return t.$$set=t=>{"config"in t&&n(6,c=t.config),"step"in t&&n(7,l=t.step)},t.$$.update=()=>{192&t.$$.dirty&&(n(0,r=c.action?c.action.bind(l.tour):null),n(1,i=c.classes),n(2,s=!!c.disabled&&h(c.disabled)),n(3,o=c.label?h(c.label):null),n(4,a=c.secondary),n(5,u=c.text?h(c.text):null))},[r,i,s,o,a,u,c,l]}class Fe extends xe{constructor(t){super(),we(this,t,Ee,Se,Bt,{config:6,step:7})}}function Ae(t,e,n){const r=t.slice();return r[2]=e[n],r}function Ce(t){let e,n,r=t[1],i=[];for(let e=0;e<r.length;e+=1)i[e]=De(Ae(t,r,e));const s=t=>ge(i[t],1,1,()=>{i[t]=null});return{c(){for(let t=0;t<i.length;t+=1)i[t].c();e=Vt("")},m(t,r){for(let e=0;e<i.length;e+=1)i[e].m(t,r);Lt(t,e,r),n=!0},p(t,n){if(3&n){let o;for(r=t[1],o=0;o<r.length;o+=1){const s=Ae(t,r,o);i[o]?(i[o].p(s,n),de(i[o],1)):(i[o]=De(s),i[o].c(),de(i[o],1),i[o].m(e.parentNode,e))}for(fe(),o=r.length;o<i.length;o+=1)s(o);pe()}},i(t){if(!n){for(let t=0;t<r.length;t+=1)de(i[t]);n=!0}},o(t){i=i.filter(Boolean);for(let t=0;t<i.length;t+=1)ge(i[t]);n=!1},d(t){!function(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(i,t),t&&Ht(e)}}}function De(t){let e,n;return e=new Fe({props:{config:t[2],step:t[0]}}),{c(){me(e.$$.fragment)},m(t,r){ve(e,t,r),n=!0},p(t,n){const r={};2&n&&(r.config=t[2]),1&n&&(r.step=t[0]),e.$set(r)},i(t){n||(de(e.$$.fragment,t),n=!0)},o(t){ge(e.$$.fragment,t),n=!1},d(t){ye(e,t)}}}function Ie(t){let e,n,r=t[1]&&Ce(t);return{c(){e=Mt("footer"),r&&r.c(),zt(e,"class","shepherd-footer")},m(t,i){Lt(t,e,i),r&&r.m(e,null),n=!0},p(t,n){let[i]=n;t[1]?r?(r.p(t,i),2&i&&de(r,1)):(r=Ce(t),r.c(),de(r,1),r.m(e,null)):r&&(fe(),ge(r,1,1,()=>{r=null}),pe())},i(t){n||(de(r),n=!0)},o(t){ge(r),n=!1},d(t){t&&Ht(e),r&&r.d()}}}function $e(t,e,n){let r,{step:i}=e;return t.$$set=t=>{"step"in t&&n(0,i=t.step)},t.$$.update=()=>{1&t.$$.dirty&&n(1,r=i.options.buttons)},[i,r]}class Re extends xe{constructor(t){super(),we(this,t,$e,Ie,Bt,{step:0})}}function Te(t){let e,n,r,i,s;return{c(){e=Mt("button"),n=Mt("span"),n.textContent="×",zt(n,"aria-hidden","true"),zt(e,"aria-label",r=t[0].label?t[0].label:"Close Tour"),zt(e,"class","shepherd-cancel-icon"),zt(e,"type","button")},m(r,o){Lt(r,e,o),Nt(e,n),i||(s=Kt(e,"click",t[1]),i=!0)},p(t,n){let[i]=n;1&i&&r!==(r=t[0].label?t[0].label:"Close Tour")&&zt(e,"aria-label",r)},i:Tt,o:Tt,d(t){t&&Ht(e),i=!1,s()}}}function _e(t,e,n){let{cancelIcon:r,step:i}=e;return t.$$set=t=>{"cancelIcon"in t&&n(0,r=t.cancelIcon),"step"in t&&n(2,i=t.step)},[r,t=>{t.preventDefault(),i.cancel()},i]}class Pe extends xe{constructor(t){super(),we(this,t,_e,Te,Bt,{cancelIcon:0,step:2})}}function ke(t){let e;return{c(){e=Mt("h3"),zt(e,"id",t[1]),zt(e,"class","shepherd-title")},m(n,r){Lt(n,e,r),t[3](e)},p(t,n){let[r]=n;2&r&&zt(e,"id",t[1])},i:Tt,o:Tt,d(n){n&&Ht(e),t[3](null)}}}function Oe(t,e,n){let{labelId:r,element:i,title:s}=e;return Zt(()=>{d(s)&&n(2,s=s()),n(0,i.innerHTML=s,i)}),t.$$set=t=>{"labelId"in t&&n(1,r=t.labelId),"element"in t&&n(0,i=t.element),"title"in t&&n(2,s=t.title)},[i,r,s,function(t){te[t?"unshift":"push"](()=>{i=t,n(0,i)})}]}class je extends xe{constructor(t){super(),we(this,t,Oe,ke,Bt,{labelId:1,element:0,title:2})}}function Be(t){let e,n;return e=new je({props:{labelId:t[0],title:t[2]}}),{c(){me(e.$$.fragment)},m(t,r){ve(e,t,r),n=!0},p(t,n){const r={};1&n&&(r.labelId=t[0]),4&n&&(r.title=t[2]),e.$set(r)},i(t){n||(de(e.$$.fragment,t),n=!0)},o(t){ge(e.$$.fragment,t),n=!1},d(t){ye(e,t)}}}function Ne(t){let e,n;return e=new Pe({props:{cancelIcon:t[3],step:t[1]}}),{c(){me(e.$$.fragment)},m(t,r){ve(e,t,r),n=!0},p(t,n){const r={};8&n&&(r.cancelIcon=t[3]),2&n&&(r.step=t[1]),e.$set(r)},i(t){n||(de(e.$$.fragment,t),n=!0)},o(t){ge(e.$$.fragment,t),n=!1},d(t){ye(e,t)}}}function Le(t){let e,n,r,i=t[2]&&Be(t),s=t[3]&&t[3].enabled&&Ne(t);return{c(){e=Mt("header"),i&&i.c(),n=qt(),s&&s.c(),zt(e,"class","shepherd-header")},m(t,o){Lt(t,e,o),i&&i.m(e,null),Nt(e,n),s&&s.m(e,null),r=!0},p(t,r){let[o]=r;t[2]?i?(i.p(t,o),4&o&&de(i,1)):(i=Be(t),i.c(),de(i,1),i.m(e,n)):i&&(fe(),ge(i,1,1,()=>{i=null}),pe()),t[3]&&t[3].enabled?s?(s.p(t,o),8&o&&de(s,1)):(s=Ne(t),s.c(),de(s,1),s.m(e,null)):s&&(fe(),ge(s,1,1,()=>{s=null}),pe())},i(t){r||(de(i),de(s),r=!0)},o(t){ge(i),ge(s),r=!1},d(t){t&&Ht(e),i&&i.d(),s&&s.d()}}}function He(t,e,n){let r,i,{labelId:s,step:o}=e;return t.$$set=t=>{"labelId"in t&&n(0,s=t.labelId),"step"in t&&n(1,o=t.step)},t.$$.update=()=>{2&t.$$.dirty&&(n(2,r=o.options.title),n(3,i=o.options.cancelIcon))},[s,o,r,i]}class Me extends xe{constructor(t){super(),we(this,t,He,Le,Bt,{labelId:0,step:1})}}function Ue(t){let e;return{c(){e=Mt("div"),zt(e,"class","shepherd-text"),zt(e,"id",t[1])},m(n,r){Lt(n,e,r),t[3](e)},p(t,n){let[r]=n;2&r&&zt(e,"id",t[1])},i:Tt,o:Tt,d(n){n&&Ht(e),t[3](null)}}}function Ve(t,e,n){let{descriptionId:r,element:i,step:s}=e;return Zt(()=>{let{text:t}=s.options;d(t)&&(t=t.call(s)),p(t)?i.appendChild(t):n(0,i.innerHTML=t,i)}),t.$$set=t=>{"descriptionId"in t&&n(1,r=t.descriptionId),"element"in t&&n(0,i=t.element),"step"in t&&n(2,s=t.step)},[i,r,s,function(t){te[t?"unshift":"push"](()=>{i=t,n(0,i)})}]}class qe extends xe{constructor(t){super(),we(this,t,Ve,Ue,Bt,{descriptionId:1,element:0,step:2})}}function Ke(t){let e,n;return e=new Me({props:{labelId:t[1],step:t[2]}}),{c(){me(e.$$.fragment)},m(t,r){ve(e,t,r),n=!0},p(t,n){const r={};2&n&&(r.labelId=t[1]),4&n&&(r.step=t[2]),e.$set(r)},i(t){n||(de(e.$$.fragment,t),n=!0)},o(t){ge(e.$$.fragment,t),n=!1},d(t){ye(e,t)}}}function ze(t){let e,n;return e=new qe({props:{descriptionId:t[0],step:t[2]}}),{c(){me(e.$$.fragment)},m(t,r){ve(e,t,r),n=!0},p(t,n){const r={};1&n&&(r.descriptionId=t[0]),4&n&&(r.step=t[2]),e.$set(r)},i(t){n||(de(e.$$.fragment,t),n=!0)},o(t){ge(e.$$.fragment,t),n=!1},d(t){ye(e,t)}}}function Ge(t){let e,n;return e=new Re({props:{step:t[2]}}),{c(){me(e.$$.fragment)},m(t,r){ve(e,t,r),n=!0},p(t,n){const r={};4&n&&(r.step=t[2]),e.$set(r)},i(t){n||(de(e.$$.fragment,t),n=!0)},o(t){ge(e.$$.fragment,t),n=!1},d(t){ye(e,t)}}}function We(t){let e,n,r,i,s=!m(t[2].options.title)||t[2].options.cancelIcon&&t[2].options.cancelIcon.enabled,o=!m(t[2].options.text),a=Array.isArray(t[2].options.buttons)&&t[2].options.buttons.length,u=s&&Ke(t),c=o&&ze(t),l=a&&Ge(t);return{c(){e=Mt("div"),u&&u.c(),n=qt(),c&&c.c(),r=qt(),l&&l.c(),zt(e,"class","shepherd-content")},m(t,s){Lt(t,e,s),u&&u.m(e,null),Nt(e,n),c&&c.m(e,null),Nt(e,r),l&&l.m(e,null),i=!0},p(t,i){let[h]=i;4&h&&(s=!m(t[2].options.title)||t[2].options.cancelIcon&&t[2].options.cancelIcon.enabled),s?u?(u.p(t,h),4&h&&de(u,1)):(u=Ke(t),u.c(),de(u,1),u.m(e,n)):u&&(fe(),ge(u,1,1,()=>{u=null}),pe()),4&h&&(o=!m(t[2].options.text)),o?c?(c.p(t,h),4&h&&de(c,1)):(c=ze(t),c.c(),de(c,1),c.m(e,r)):c&&(fe(),ge(c,1,1,()=>{c=null}),pe()),4&h&&(a=Array.isArray(t[2].options.buttons)&&t[2].options.buttons.length),a?l?(l.p(t,h),4&h&&de(l,1)):(l=Ge(t),l.c(),de(l,1),l.m(e,null)):l&&(fe(),ge(l,1,1,()=>{l=null}),pe())},i(t){i||(de(u),de(c),de(l),i=!0)},o(t){ge(u),ge(c),ge(l),i=!1},d(t){t&&Ht(e),u&&u.d(),c&&c.d(),l&&l.d()}}}function Ye(t,e,n){let{descriptionId:r,labelId:i,step:s}=e;return t.$$set=t=>{"descriptionId"in t&&n(0,r=t.descriptionId),"labelId"in t&&n(1,i=t.labelId),"step"in t&&n(2,s=t.step)},[r,i,s]}class Xe extends xe{constructor(t){super(),we(this,t,Ye,We,Bt,{descriptionId:0,labelId:1,step:2})}}function Je(t){let e;return{c(){e=Mt("div"),zt(e,"class","shepherd-arrow"),zt(e,"data-popper-arrow","")},m(t,n){Lt(t,e,n)},d(t){t&&Ht(e)}}}function Ze(t){let e,n,r,i,s,o,a,u,c=t[4].options.arrow&&t[4].options.attachTo&&t[4].options.attachTo.element&&t[4].options.attachTo.on&&Je();r=new Xe({props:{descriptionId:t[2],labelId:t[3],step:t[4]}});let l=[{"aria-describedby":i=m(t[4].options.text)?null:t[2]},{"aria-labelledby":s=t[4].options.title?t[3]:null},t[1],{role:"dialog"},{tabindex:"0"}],h={};for(let t=0;t<l.length;t+=1)h=_t(h,l[t]);return{c(){e=Mt("div"),c&&c.c(),n=qt(),me(r.$$.fragment),Gt(e,h),Wt(e,"shepherd-has-cancel-icon",t[5]),Wt(e,"shepherd-has-title",t[6]),Wt(e,"shepherd-element",!0)},m(i,s){Lt(i,e,s),c&&c.m(e,null),Nt(e,n),ve(r,e,null),t[13](e),o=!0,a||(u=Kt(e,"keydown",t[7]),a=!0)},p(t,a){let[u]=a;t[4].options.arrow&&t[4].options.attachTo&&t[4].options.attachTo.element&&t[4].options.attachTo.on?c||(c=Je(),c.c(),c.m(e,n)):c&&(c.d(1),c=null);const f={};4&u&&(f.descriptionId=t[2]),8&u&&(f.labelId=t[3]),16&u&&(f.step=t[4]),r.$set(f),Gt(e,h=function(t,e){const n={},r={},i={$$scope:1};let s=t.length;for(;s--;){const o=t[s],a=e[s];if(a){for(const t in o)t in a||(r[t]=1);for(const t in a)i[t]||(n[t]=a[t],i[t]=1);t[s]=a}else for(const t in o)i[t]=1}for(const t in r)t in n||(n[t]=void 0);return n}(l,[(!o||20&u&&i!==(i=m(t[4].options.text)?null:t[2]))&&{"aria-describedby":i},(!o||24&u&&s!==(s=t[4].options.title?t[3]:null))&&{"aria-labelledby":s},2&u&&t[1],{role:"dialog"},{tabindex:"0"}])),Wt(e,"shepherd-has-cancel-icon",t[5]),Wt(e,"shepherd-has-title",t[6]),Wt(e,"shepherd-element",!0)},i(t){o||(de(r.$$.fragment,t),o=!0)},o(t){ge(r.$$.fragment,t),o=!1},d(n){n&&Ht(e),c&&c.d(),ye(r),t[13](null),a=!1,u()}}}function Qe(t){return t.split(" ").filter(t=>!!t.length)}function tn(t,e,n){let r,i,s,{classPrefix:o,element:a,descriptionId:u,firstFocusableElement:c,focusableElements:l,labelId:h,lastFocusableElement:f,step:p,dataStepId:d}=e;var m;m=()=>{n(1,d={[`data-${o}shepherd-step-id`]:p.id}),n(9,l=a.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]')),n(8,c=l[0]),n(10,f=l[l.length-1])},Jt().$$.on_mount.push(m),Zt(()=>{s!==p.options.classes&&(function(t){if(g(t)){const e=Qe(t);e.length&&a.classList.remove(...e)}}(s),s=p.options.classes,function(t){if(g(t)){const e=Qe(t);e.length&&a.classList.add(...e)}}(s))});return t.$$set=t=>{"classPrefix"in t&&n(11,o=t.classPrefix),"element"in t&&n(0,a=t.element),"descriptionId"in t&&n(2,u=t.descriptionId),"firstFocusableElement"in t&&n(8,c=t.firstFocusableElement),"focusableElements"in t&&n(9,l=t.focusableElements),"labelId"in t&&n(3,h=t.labelId),"lastFocusableElement"in t&&n(10,f=t.lastFocusableElement),"step"in t&&n(4,p=t.step),"dataStepId"in t&&n(1,d=t.dataStepId)},t.$$.update=()=>{16&t.$$.dirty&&(n(5,r=p.options&&p.options.cancelIcon&&p.options.cancelIcon.enabled),n(6,i=p.options&&p.options.title))},[a,d,u,h,p,r,i,t=>{const{tour:e}=p;switch(t.keyCode){case 9:if(0===l.length){t.preventDefault();break}t.shiftKey?(document.activeElement===c||document.activeElement.classList.contains("shepherd-element"))&&(t.preventDefault(),f.focus()):document.activeElement===f&&(t.preventDefault(),c.focus());break;case 27:e.options.exitOnEsc&&p.cancel();break;case 37:e.options.keyboardNavigation&&e.back();break;case 39:e.options.keyboardNavigation&&e.next()}},c,l,f,o,()=>a,function(t){te[t?"unshift":"push"](()=>{a=t,n(0,a)})}]}class en extends xe{constructor(t){super(),we(this,t,tn,Ze,Bt,{classPrefix:11,element:0,descriptionId:2,firstFocusableElement:8,focusableElements:9,labelId:3,lastFocusableElement:10,step:4,dataStepId:1,getElement:12})}get getElement(){return this.$$.ctx[12]}}var nn=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t,e){t.exports={polyfill:function(){var t=window,e=document;if(!("scrollBehavior"in e.documentElement.style)||!0===t.__forceSmoothScrollPolyfill__){var n,r=t.HTMLElement||t.Element,i={scroll:t.scroll||t.scrollTo,scrollBy:t.scrollBy,elementScroll:r.prototype.scroll||a,scrollIntoView:r.prototype.scrollIntoView},s=t.performance&&t.performance.now?t.performance.now.bind(t.performance):Date.now,o=(n=t.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);t.scroll=t.scrollTo=function(){void 0!==arguments[0]&&(!0!==u(arguments[0])?d.call(t,e.body,void 0!==arguments[0].left?~~arguments[0].left:t.scrollX||t.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:t.scrollY||t.pageYOffset):i.scroll.call(t,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:t.scrollX||t.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:t.scrollY||t.pageYOffset))},t.scrollBy=function(){void 0!==arguments[0]&&(u(arguments[0])?i.scrollBy.call(t,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):d.call(t,e.body,~~arguments[0].left+(t.scrollX||t.pageXOffset),~~arguments[0].top+(t.scrollY||t.pageYOffset)))},r.prototype.scroll=r.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==u(arguments[0])){var t=arguments[0].left,e=arguments[0].top;d.call(this,this,void 0===t?this.scrollLeft:~~t,void 0===e?this.scrollTop:~~e)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},r.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==u(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},r.prototype.scrollIntoView=function(){if(!0!==u(arguments[0])){var n=f(this),r=n.getBoundingClientRect(),s=this.getBoundingClientRect();n!==e.body?(d.call(this,n,n.scrollLeft+s.left-r.left,n.scrollTop+s.top-r.top),"fixed"!==t.getComputedStyle(n).position&&t.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):t.scrollBy({left:s.left,top:s.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function a(t,e){this.scrollLeft=t,this.scrollTop=e}function u(t){if(null===t||"object"!=typeof t||void 0===t.behavior||"auto"===t.behavior||"instant"===t.behavior)return!0;if("object"==typeof t&&"smooth"===t.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+t.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(t,e){return"Y"===e?t.clientHeight+o<t.scrollHeight:"X"===e?t.clientWidth+o<t.scrollWidth:void 0}function l(e,n){var r=t.getComputedStyle(e,null)["overflow"+n];return"auto"===r||"scroll"===r}function h(t){var e=c(t,"Y")&&l(t,"Y"),n=c(t,"X")&&l(t,"X");return e||n}function f(t){for(;t!==e.body&&!1===h(t);)t=t.parentNode||t.host;return t}function p(e){var n,r,i,o,a=(s()-e.startTime)/468;o=a=a>1?1:a,n=.5*(1-Math.cos(Math.PI*o)),r=e.startX+(e.x-e.startX)*n,i=e.startY+(e.y-e.startY)*n,e.method.call(e.scrollable,r,i),r===e.x&&i===e.y||t.requestAnimationFrame(p.bind(t,e))}function d(n,r,o){var u,c,l,h,f=s();n===e.body?(u=t,c=t.scrollX||t.pageXOffset,l=t.scrollY||t.pageYOffset,h=i.scroll):(u=n,c=n.scrollLeft,l=n.scrollTop,h=a),p({scrollable:u,method:h,startTime:f,startX:c,startY:l,x:r,y:o})}}}}));nn.polyfill,nn.polyfill();class rn extends v{constructor(t,e){return void 0===e&&(e={}),super(t,e),this.tour=t,this.classPrefix=this.tour.options?Ct(this.tour.options.classPrefix):"",this.styles=t.styles,this._resolvedAttachTo=null,y(this),this._setOptions(e),this}cancel(){this.tour.cancel(),this.trigger("cancel")}complete(){this.tour.complete(),this.trigger("complete")}destroy(){this.tooltip&&(this.tooltip.destroy(),this.tooltip=null),p(this.el)&&this.el.parentNode&&(this.el.parentNode.removeChild(this.el),this.el=null),this._updateStepTargetOnHide(),this.trigger("destroy")}getTour(){return this.tour}hide(){this.tour.modal.hide(),this.trigger("before-hide"),this.el&&(this.el.hidden=!0),this._updateStepTargetOnHide(),this.trigger("hide")}_resolveAttachToOptions(){return this._resolvedAttachTo=function(t){const e=t.options.attachTo||{},n=Object.assign({},e);if(d(n.element)&&(n.element=n.element.call(t)),g(n.element)){try{n.element=document.querySelector(n.element)}catch(t){}n.element||console.error("The element for this Shepherd step was not found "+e.element)}return n}(this),this._resolvedAttachTo}_getResolvedAttachToOptions(){return null===this._resolvedAttachTo?this._resolveAttachToOptions():this._resolvedAttachTo}isOpen(){return Boolean(this.el&&!this.el.hidden)}show(){if(d(this.options.beforeShowPromise)){const t=this.options.beforeShowPromise();if(!m(t))return t.then(()=>this._show())}this._show()}updateStepOptions(t){Object.assign(this.options,t),this.shepherdElementComponent&&this.shepherdElementComponent.$set({step:this})}getElement(){return this.el}getTarget(){return this.target}_createTooltipContent(){const t=this.id+"-description",e=this.id+"-label";return this.shepherdElementComponent=new en({target:this.tour.options.stepsContainer||document.body,props:{classPrefix:this.classPrefix,descriptionId:t,labelId:e,step:this,styles:this.styles}}),this.shepherdElementComponent.getElement()}_scrollTo(t){const{element:e}=this._getResolvedAttachToOptions();d(this.options.scrollToHandler)?this.options.scrollToHandler(e):e instanceof Element&&"function"==typeof e.scrollIntoView&&e.scrollIntoView(t)}_getClassOptions(t){const e=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions,n=t.classes?t.classes:"",r=e&&e.classes?e.classes:"",i=[...n.split(" "),...r.split(" ")],s=new Set(i);return Array.from(s).join(" ").trim()}_setOptions(t){void 0===t&&(t={});let e=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions;e=f({},e||{}),this.options=Object.assign({arrow:!0},e,t);const{when:n}=this.options;this.options.classes=this._getClassOptions(t),this.destroy(),this.id=this.options.id||"step-"+$t(),n&&Object.keys(n).forEach(t=>{this.on(t,n[t],this)})}_setupElements(){m(this.el)||this.destroy(),this.el=this._createTooltipContent(),this.options.advanceOn&&b(this),It(this)}_show(){this.trigger("before-show"),this._resolveAttachToOptions(),this._setupElements(),this.tour.modal||this.tour._setupModal(),this.tour.modal.setupForStep(this),this._styleTargetElementForStep(this),this.el.hidden=!1,this.options.scrollTo&&setTimeout(()=>{this._scrollTo(this.options.scrollTo)}),this.el.hidden=!1;const t=this.shepherdElementComponent.getElement(),e=this.target||document.body;e.classList.add(this.classPrefix+"shepherd-enabled"),e.classList.add(this.classPrefix+"shepherd-target"),t.classList.add("shepherd-enabled"),this.trigger("show")}_styleTargetElementForStep(t){const e=t.target;e&&(t.options.highlightClass&&e.classList.add(t.options.highlightClass),e.classList.remove("shepherd-target-click-disabled"),!1===t.options.canClickTarget&&e.classList.add("shepherd-target-click-disabled"))}_updateStepTargetOnHide(){const t=this.target||document.body;this.options.highlightClass&&t.classList.remove(this.options.highlightClass),t.classList.remove("shepherd-target-click-disabled",this.classPrefix+"shepherd-enabled",this.classPrefix+"shepherd-target")}}function sn(t){let e,n,r,i,s;return{c(){e=Ut("svg"),n=Ut("path"),zt(n,"d",t[2]),zt(e,"class",r=(t[1]?"shepherd-modal-is-visible":"")+" shepherd-modal-overlay-container")},m(r,o){Lt(r,e,o),Nt(e,n),t[11](e),i||(s=Kt(e,"touchmove",t[3]),i=!0)},p(t,i){let[s]=i;4&s&&zt(n,"d",t[2]),2&s&&r!==(r=(t[1]?"shepherd-modal-is-visible":"")+" shepherd-modal-overlay-container")&&zt(e,"class",r)},i:Tt,o:Tt,d(n){n&&Ht(e),t[11](null),i=!1,s()}}}function on(t,e,n){let{element:r,openingProperties:i}=e;$t();let s,o=!1,a=void 0;u();function u(){n(4,i={width:0,height:0,x:0,y:0,r:0})}function c(){n(1,o=!1),p()}function l(t,e,r,s){if(void 0===t&&(t=0),void 0===e&&(e=0),s){const{y:o,height:a}=function(t,e){const n=t.getBoundingClientRect();let r=n.y||n.top,i=n.bottom||r+n.height;if(e){const t=e.getBoundingClientRect(),n=t.y||t.top,s=t.bottom||n+t.height;r=Math.max(r,n),i=Math.min(i,s)}return{y:r,height:Math.max(i-r,0)}}(s,r),{x:u,width:c,left:l}=s.getBoundingClientRect();n(4,i={width:c+2*t,height:a+2*t,x:(u||l)-t,y:o-t,r:e})}else u()}function h(){n(1,o=!0)}const f=t=>{t.preventDefault()};function p(){a&&(cancelAnimationFrame(a),a=void 0),window.removeEventListener("touchmove",f,{passive:!1})}return t.$$set=t=>{"element"in t&&n(0,r=t.element),"openingProperties"in t&&n(4,i=t.openingProperties)},t.$$.update=()=>{16&t.$$.dirty&&n(2,s=function(t){let{width:e,height:n,x:r=0,y:i=0,r:s=0}=t;const{innerWidth:o,innerHeight:a}=window;return`M${o},${a}H0V0H${o}V${a}ZM${r+s},${i}a${s},${s},0,0,0-${s},${s}V${n+i-s}a${s},${s},0,0,0,${s},${s}H${e+r-s}a${s},${s},0,0,0,${s}-${s}V${i+s}a${s},${s},0,0,0-${s}-${s}Z`}(i))},[r,o,s,t=>{t.stopPropagation()},i,()=>r,u,c,l,function(t){p(),t.tour.options.useModalOverlay?(!function(t){const{modalOverlayOpeningPadding:e,modalOverlayOpeningRadius:n}=t.options,r=function t(e){if(!e)return null;const n=e instanceof HTMLElement&&window.getComputedStyle(e).overflowY;return"hidden"!==n&&"visible"!==n&&e.scrollHeight>=e.clientHeight?e:t(e.parentElement)}(t.target),i=()=>{a=void 0,l(e,n,r,t.target),a=requestAnimationFrame(i)};i(),window.addEventListener("touchmove",f,{passive:!1})}(t),h()):c()},h,function(t){te[t?"unshift":"push"](()=>{r=t,n(0,r)})}]}class an extends xe{constructor(t){super(),we(this,t,on,sn,Bt,{element:0,openingProperties:4,getElement:5,closeModalOpening:6,hide:7,positionModal:8,setupForStep:9,show:10})}get getElement(){return this.$$.ctx[5]}get closeModalOpening(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[7]}get positionModal(){return this.$$.ctx[8]}get setupForStep(){return this.$$.ctx[9]}get show(){return this.$$.ctx[10]}}const un=new v;Object.assign(un,{Tour:class extends v{constructor(t){void 0===t&&(t={}),super(t),y(this);this.options=Object.assign({},{exitOnEsc:!0,keyboardNavigation:!0},t),this.classPrefix=Ct(this.options.classPrefix),this.steps=[],this.addSteps(this.options.steps);return["active","cancel","complete","inactive","show","start"].map(t=>{(t=>{this.on(t,e=>{(e=e||{}).tour=this,un.trigger(t,e)})})(t)}),this._setTourID(),this}addStep(t,e){let n=t;return n instanceof rn?n.tour=this:n=new rn(this,n),m(e)?this.steps.push(n):this.steps.splice(e,0,n),n}addSteps(t){return Array.isArray(t)&&t.forEach(t=>{this.addStep(t)}),this}back(){const t=this.steps.indexOf(this.currentStep);this.show(t-1,!1)}cancel(){if(this.options.confirmCancel){const t=this.options.confirmCancelMessage||"Are you sure you want to stop the tour?";window.confirm(t)&&this._done("cancel")}else this._done("cancel")}complete(){this._done("complete")}getById(t){return this.steps.find(e=>e.id===t)}getCurrentStep(){return this.currentStep}hide(){const t=this.getCurrentStep();if(t)return t.hide()}isActive(){return un.activeTour===this}next(){const t=this.steps.indexOf(this.currentStep);t===this.steps.length-1?this.complete():this.show(t+1,!0)}removeStep(t){const e=this.getCurrentStep();this.steps.some((e,n)=>{if(e.id===t)return e.isOpen()&&e.hide(),e.destroy(),this.steps.splice(n,1),!0}),e&&e.id===t&&(this.currentStep=void 0,this.steps.length?this.show(0):this.cancel())}show(t,e){void 0===t&&(t=0),void 0===e&&(e=!0);const n=g(t)?this.getById(t):this.steps[t];if(n){this._updateStateBeforeShow();d(n.options.showOn)&&!n.options.showOn()?this._skipStep(n,e):(this.trigger("show",{step:n,previous:this.currentStep}),this.currentStep=n,n.show())}}start(){this.trigger("start"),this.focusedElBeforeOpen=document.activeElement,this.currentStep=null,this._setupModal(),this._setupActiveTour(),this.next()}_done(t){const e=this.steps.indexOf(this.currentStep);if(Array.isArray(this.steps)&&this.steps.forEach(t=>t.destroy()),function(t){if(t){const{steps:e}=t;e.forEach(t=>{t.options&&!1===t.options.canClickTarget&&t.options.attachTo&&t.target instanceof HTMLElement&&t.target.classList.remove("shepherd-target-click-disabled")})}}(this),this.trigger(t,{index:e}),un.activeTour=null,this.trigger("inactive",{tour:this}),this.modal&&this.modal.hide(),("cancel"===t||"complete"===t)&&this.modal){const t=document.querySelector(".shepherd-modal-overlay-container");t&&t.remove()}p(this.focusedElBeforeOpen)&&this.focusedElBeforeOpen.focus()}_setupActiveTour(){this.trigger("active",{tour:this}),un.activeTour=this}_setupModal(){this.modal=new an({target:this.options.modalContainer||document.body,props:{classPrefix:this.classPrefix,styles:this.styles}})}_skipStep(t,e){const n=this.steps.indexOf(t);if(n===this.steps.length-1)this.complete();else{const t=e?n+1:n-1;this.show(t,e)}}_updateStateBeforeShow(){this.currentStep&&this.currentStep.hide(),this.isActive()||this._setupActiveTour()}_setTourID(){const t=this.options.tourName||"tour";this.id=`${t}--${$t()}`}},Step:rn});const cn="shepherd.guide_id",ln="shepherd.guide.current.step.id",hn="shepherd.guide.step.history",fn="shepherd.guide.pause";function pn(t,e,n,i,s,o,a){this.guideCancelSubscription=void 0,this.onPause=()=>{},this.onCancel=()=>{},this.startGuide=(t,e,r,i=!0)=>{if(i&&n.remove(hn),!e)return;const s=this._createGuide(t);this._addGuideSteps(s,e),this._startGuide(s,r)},this.resumeGuide=(t,e,r)=>{n.set(fn,!1),this.startGuide(t,e,r,!1)},this.isActive=()=>un.activeTour&&!this.isPaused(),this.isPaused=()=>"true"===n.get(fn),this.getGuideId=()=>n.get(cn),this.getCurrentStepId=()=>n.get(ln),this.subscribeToGuideCancel=t=>{angular.isFunction(t)&&(this.onCancel=t)},this.subscribeToGuidePause=t=>{angular.isFunction(t)&&(this.onPause=t)},this._createGuide=t=>(this._subscribeToGuideCanceled(),new un.Tour({name:t,useModalOverlay:!0,confirmCancel:!0,confirmCancelMessage:e.instant("guide.confirm.cancel.message"),defaultStepOptions:{classes:"shadow-md bg-purple-dark",scrollTo:!0}})),this._addGuideSteps=(t,e)=>{if(e.length>0&&t.addStep(this._getFirstStep(t,e)),e.length>2)for(let n=1;n<e.length-1;n++)t.addStep(this._getMiddleStep(t,e,n));e.length>1&&t.addStep(this._getLastStep(t,e))},this._startGuide=(s,a)=>{n.remove(fn);let u=s.steps.findIndex(t=>t.options.id===a);u<0&&(u=0);const c=s.steps[u],l=c.options.url;l&&(t.url(l),i.reload()),c.options.attachTo?r.GuideUtils.waitFor(c.options.attachTo.element,c.options.maxWaitTime).then(()=>s.show(u)).catch(t=>{console.log(t),o.error(e.instant("guide.start.unexpected.error.message"))}):s.show(u)},this._subscribeToGuideCanceled=()=>{this.guideCancelSubscription||(this.guideCancelSubscription=un.on("cancel",()=>{this._clearLocaleStorage();const t=un.activeTour.getCurrentStep();t&&angular.isFunction(t.hide)&&t.hide(),this.onCancel&&this.onCancel()}))},this._getFirstStep=function(t,e){const n=e.length>1?e[1]:void 0;return this._toGuideStep(t,void 0,e[0],n)},this._getMiddleStep=(t,e,n)=>this._toGuideStep(t,e[n-1],e[n],e[n+1]),this._getLastStep=(t,e)=>{const n=this._toGuideStep(t,e[e.length-2],e[e.length-1]);return n.buttons.push(this._getBackToGuidesButton(t)),n.buttons.push(this._getCancelButton(t)),n},this._getBackToGuidesButton=t=>this._getButton(e.instant("back.to.guides.btn"),()=>this._backToGuidesButton(t),!0),this._getCancelButton=t=>this._getButton(e.instant("common.close"),()=>this._cancelGuide(t,!1),!0),this._backToGuidesButton=e=>{t.path("guides"),this._cancelGuide(e,!1)},this._cancelGuide=(t,e=!0)=>{t.options.confirmCancel=e,t.cancel(),this.onCancel()&&this.onCancel()},this._toGuideStep=(t,n,r,i)=>{const s=this._toBaseGuideStep(t,e,r,()=>this._updateLocalStorage()),o=[];return n&&o.push(this._getPreviousButton(t)),i&&o.push(this._getNextButton(t,r,i)),r.skipPoint&&o.push(this._getSkipButton(t)),s.buttons=o,s},this._getPauseButton=t=>this._getButton(e.instant("pause.btn"),()=>this._pauseGuide(t),!0),this._getSkipButton=t=>this._getButton(e.instant("skip.btn"),()=>this._skipSteps(t),!0),this._skipSteps=t=>{const e=t.getCurrentStep(),n=t.steps.findIndex(t=>e.id===t.id);this._startGuide(t,this._getNextSkipPointId(t.steps,n))},this._getNextSkipPointId=(t,e)=>{for(let n=e+1;n<t.length;n++){const e=t.at(n);if(e.options.skipPoint)return e.id}return t.at(t.length-1).id},this._pauseGuide=t=>{t.hide();const e=this._getStepWhichCanBePaused(t.steps,t.getCurrentStep().id);this._saveStep(e),n.set(fn,!0);let r=!1;for(;!r;){const t=this._getHistory();t&&t.length>0&&t.at(t.length-1)!==e.options.id?this._removeLastStepFromHistory():r=!0}this.onPause()&&this.onPause()},this._getStepWhichCanBePaused=(t,e)=>{const n=t.findIndex(t=>t.id===e),r=t[n];return r.options.canBePaused?r:n>0?this._getStepWhichCanBePaused(t,t[n-1].id):void 0},this._getPreviousButton=t=>{const n=e.instant("previous.btn"),r=this._getPreviousButtonAction(t);return this._getButton(n,r)},this._getPreviousButtonAction=n=>()=>{const i=this._getPreviousStepIdFromHistory();let s;s=-1===i?n.steps.at(0):n.steps.find(t=>t.options.id===i);const a=n.getCurrentStep();a.hide(),a.options.initPreviousStep({GuideUtils:r.GuideUtils,ShepherdService:this},a.options.id).then(()=>{angular.isFunction(a.options.onPreviousClick)?a.options.onPreviousClick(n).then(t=>{!angular.isUndefined(t)&&null!==t&&t||(a.hide(),n.show(s.id))}).catch(t=>{console.log(t),o.error(e.instant("guide.unexpected.error.message")),this._cancelGuide(n,!1)}):((s.options.forceReload||s.options.url&&s.options.url!==a.options.url)&&t.path(s.options.url),a.hide(),n.show(s.id))}).catch(t=>{console.log(t),o.error(e.instant("guide.unexpected.error.message")),this._cancelGuide(n,!1)})},this._getNextButton=(t,n,r)=>{const i=e.instant("next.btn"),s=u(t,n,r);return this._getButton(i,s)};const u=(n,r,i)=>()=>{let s=!0;if(angular.isFunction(r.onNextValidate)&&(s=r.onNextValidate(r)),s)if(angular.isFunction(r.onNextClick)){const t=r.onNextClick(n,r);t instanceof Promise&&t.catch(t=>{console.log(t),o.error(e.instant("guide.unexpected.error.message")),this._cancelGuide(n,!1)})}else(i.forceReload||i.url&&i.url!==r.url)&&t.path(i.url),n.next()};this._updateLocalStorage=()=>{const t=un.activeTour;if(!t)return;const e=t.getCurrentStep(),n=t.steps.findIndex(t=>t.id===e.id),r=this.getCurrentStepId(),i=t.steps.findIndex(t=>t.id===r);n>i?this._addStepToHistory(e):i>n&&this._removeLastStepFromHistory(),this._saveStep(e)},this._saveStep=t=>{t&&(n.set(cn,t.tour.options.name),n.set(ln,t.options.id))},this._addStepToHistory=t=>{const e=this._getHistory();e.push(t.options.id),n.set(hn,e)},this._getHistory=()=>{const t=n.get(hn);return t||[]},this._removeLastStepFromHistory=()=>{const t=this._getHistory();t.splice(t.length-1,1),n.set(hn,t)},this._getPreviousStepIdFromHistory=t=>{const e=this._getHistory()||[];if(t){const n=e.findIndex(e=>e===t);if(n>0)return e.at(n-1)}else if(e.length>1)return e.at(e.length-2);return-1},this.getPreviousStepFromHistory=t=>{const e=this._getPreviousStepIdFromHistory(t);return un.activeTour.steps.find(t=>t.id===e)},this._clearLocaleStorage=()=>{n.remove(cn),n.remove(fn),n.remove(ln),n.remove(hn)},this._toBaseGuideStep=(t,e,n,i)=>{let o;n.elementSelector&&(o={element:n.elementSelector,on:n.placement});const a=r.GuideUtils.unescapeHtml(r.GuideUtils.translateLocalMessage(e,s,n.title,n));let u="";if(n.stepsTotalN>1){const t=document.createElement("span");t.setAttribute("tooltip",e.instant("guide.block.progress.tooltip",{action:a})),t.setAttribute("tooltip-placement","bottom"),t.setAttribute("tooltip-trigger","mouseenter"),t.setAttribute("tooltip-append-to-body","false"),t.innerText=e.instant("guide.block.progress",{n:n.stepN+1,nn:n.stepsTotalN}),u=" — "+t.outerHTML}const c="readonly"!==n.type,l=n.extraPadding?n.extraPadding:0,h={id:n.id,title:a+u,text:()=>{const t=this._toParagraph(r.GuideUtils.translateLocalMessage(e,s,n.content,n));let i="";return n.extraContent&&(i=r.GuideUtils.translateLocalMessage(e,s,n.extraContent,n),i=this._toParagraph(i,n.extraContentClass)),t+i},url:n.url,maxWaitTime:n.maxWaitTime,cancelIcon:{enabled:!0},attachTo:o,modalOverlayOpeningPadding:l,modalOverlayOpeningRadius:0,canBePaused:n.canBePaused,advanceOn:n.advanceOn,showOn:n.showOn,scrollToHandler:n.scrollToHandler,classes:"guide-dialog",beforeShowPromise:n.beforeShowPromise,canClickTarget:c,keyboardNavigation:!1,skipPoint:n.skipPoint,onPreviousClick:n.onPreviousClick,initPreviousStep:n.initPreviousStep,when:{show:this._getShowFunction(t,n,i)}};return angular.isFunction(n.hide)&&(h.when.hide=n.hide(t)),h},this._getShowFunction=(t,e,n)=>angular.isFunction(e.show)?()=>{e.show(t)(),n(),this._whenStepShow(e)}:()=>{n(),this._whenStepShow(e)},this._whenStepShow=t=>{const e=un.activeTour.getCurrentStep(),n=e.getElement();this._addTotalProgress(e,n),this._addTypeIcon(n,t);const r=angular.element(n).scope();angular.isFunction(t.onScope)&&t.onScope(r),setTimeout(()=>r.$apply(()=>a(n)(r)))},this._toParagraph=(t,e)=>{if(t){const n=document.createElement("p");return e&&(n.className=e),n.innerHTML=t,n.outerHTML}return""},this._addTotalProgress=(t,n)=>{const r=un.activeTour.steps,i=n.querySelector(".shepherd-content"),s=document.createElement("div");s.className="shepherd-progress";const o=document.createElement("span");o.className="text-muted",o.innerText=e.instant("guide.total.progress",{n:r.indexOf(t)+1,nn:r.length}),o.setAttribute("tooltip",e.instant("guide.total.progress.tooltip")),o.setAttribute("tooltip-placement","left"),o.setAttribute("tooltip-trigger","mouseenter"),o.setAttribute("tooltip-append-to-body","false"),s.appendChild(o),i.appendChild(s)},this._addTypeIcon=(t,n)=>{let r,i;switch(n.type){case"clickable":r="focus",i="mouse";break;case"input":r="edit",i="input";break;default:r="info",i="info"}const s=document.createElement("span");s.className="shepherd-step-type icon-"+r+" icon-1-25x",s.setAttribute("tooltip",e.instant("guide.step-type."+i)),s.setAttribute("tooltip-placement","bottom-right"),s.setAttribute("tooltip-trigger","mouseenter"),s.setAttribute("tooltip-append-to-body","false"),angular.element(t.querySelector(".shepherd-header")).prepend(s)},this._getButton=(t,e,n)=>{const r={text:t,classes:n?"btn btn-secondary":"btn btn-primary",action:t=>{t.stopPropagation(),e()}};return r}}angular.module("graphdb.framework.guides.shepherd.services",["graphdb.framework.utils.localstorageadapter"]).service("ShepherdService",pn),pn.$inject=["$location","$translate","LocalStorageAdapter","$route","$interpolate","toastr","$compile"]},function(t,e){angular.module("graphdb.framework.rest.license.service",["ngFileUpload"]).factory("LicenseRestService",r),r.$inject=["$http","Upload"];const n="rest/graphdb-settings/license";function r(t,e){return{getLicenseInfo:function(){return t.get(n)},getHardcodedLicense:function(){return t.get(n+"/hardcoded")},sendLicenseToValidate:function(e){return t.post("rest/info/license/validate",e,{headers:{Accept:"application/json","Content-Type":"text/plain"}})},extractFromLicenseFile:function(t){return e.upload({url:"rest/info/license/to-base-64",file:t,headers:{Accept:"text/plain"}})},checkLicenseHardcoded:function(){return t.get(n+"/hardcoded")},registerLicense:function(e){const r=new Uint8Array(e.length);for(let t=0;t<r.length;t++)r[t]=e.charCodeAt(t);return t({method:"POST",url:n,headers:{"Content-Type":"application/octet-stream"},data:r,transformRequest:[]})},unregisterLicense:function(){return t({method:"DELETE",url:"rest/graphdb-settings/license"})},getInfo:function(){return t.get("rest/info/properties")},getVersion:function(e){return t.get("rest/info/version",{headers:{"X-GraphDB-Repository-Location":e}})},getStatistics:function(){return t.get("rest/graphdb-settings/statistics")},toggleStatistics:function(e){return t({method:"POST",url:"rest/graphdb-settings/statistics",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:"enabled="+e})}}}},function(t,e){angular.module("graphdb.framework.rest.repositories.service",[]).factory("RepositoriesRestService",n),n.$inject=["$http"];function n(t){return{getRepositories:function(e){return t.get("rest/repositories/all",{params:{location:e}})},getRepository:function(e){return t.get("rest/repositories/"+e.id,{params:{location:e.location}})},deleteRepository:function(e){return t.delete("rest/repositories/"+e.id,{params:{location:e.location}})},createRepository:function(e){return t.post("rest/repositories",e)},editRepository:function(e,n){return t.put("rest/repositories/"+e,n)},getRepositoryConfiguration:function(e){return t.get("rest/repositories/default-config/"+e)},getSize:function(e){return t.get(`rest/repositories/${e.id}/size`,{params:{location:e.location}})},getPrefix:function(e,n){return t.post(`rest/repositories/${e}/prefix`,null,{params:n})},getCluster:function(){return t.get("rest/repositories/cluster")},getRepositoryFileContent:function(e){return t.get("rest/repositories/file",{params:{fileLocation:e}})},updateRepositoryFileContent:function(e,n,r){return t.post("rest/repositories/file/update",JSON.stringify(n),{params:{fileLocation:e,location:r}})},validateOntopPropertiesConnection:function(e){return t.post("rest/repositories/ontop/test-connection",e.params.propertiesFile,{params:{location:e.location}})},restartRepository:function(e){return t.post(`rest/repositories/${e.id}/restart`,null,{params:{location:e.location}})},getSupportedDriversData:function(e){return t.get("rest/repositories/ontop/drivers",{params:{location:e.location}})},updatePropertiesFile:function(e,n,r){return t.post("rest/repositories/ontop/jdbc-properties",JSON.stringify(n),{params:{fileLocation:e,location:r}})},loadPropertiesFile:function(e,n){return t.get("rest/repositories/ontop/jdbc-properties",{params:{fileLocation:e,location:n}})},getRepositoriesFromKnownLocation:function(e){return t.get("rest/repositories?location="+e)}}}},function(t,e,n){"use strict";n.r(e);n(4),n(9),n(27),n(8),n(34),n(35);angular.module("graphdb.framework.core.services.repositories",["ngCookies","graphdb.framework.rest.repositories.service","graphdb.framework.rest.locations.service","graphdb.framework.rest.license.service","toastr"]).service("$repositories",["$http","toastr","$rootScope","$timeout","$location","productInfo","$jwtAuth","RepositoriesRestService","LocationsRestService","LicenseRestService","$translate","$q",function(t,e,n,r,i,s,o,a,u,c,l,h){this.repositoryStorageName="com.ontotext.graphdb.repository",this.repositoryStorageLocationName="com.ontotext.graphdb.repository.location",this.location={uri:"",label:"Local",local:!0},this.locationError="",this.loading=!0,this.repository={id:localStorage.getItem(this.repositoryStorageName)||"",location:localStorage.getItem(this.repositoryStorageLocationName)||""},this.locations=[this.location],this.repositories=new Map,this.locationsShouldReload=!0;const f=this,p=function(t,n){f.loading=!1,t&&(f.location={},f.locationError=n,f.repositories=new Map,f.setRepository(""),t.statusText?e.error(t.statusText,l.instant("repositories.service.error.loading.location")):e.error(l.instant("repositories.service.error.loading.location")))};let d;this.resetActiveRepository=function(){let t=f.repositories.get(this.repository.location),e=!1;t&&(e=t.find(t=>this.repository&&t.id===this.repository.id)),e?o.canReadRepo(this.repository)?n.$broadcast("repositoryIsSet",{newRepo:!1}):this.setRepository(""):this.setRepository(this.location.defaultRepository?{id:this.location.defaultRepository,location:this.location.uri}:"")},this.checkLocationsDegraded=function(t){this.locations.forEach(e=>{e.local||(e.errorMsg&&f.repositories.delete(e.uri)&&f.resetActiveRepository(),c.getVersion(e.uri).success((function(t){"object"==typeof t?t.productVersion!==s.productVersion&&(e.degradedReason=l.instant("repositories.service.different.gdb.version",{location:e.name})):e.degradedReason=l.instant("repositories.service.different.gdb.version",{location:e.name})})).error((function(n){e.errorMsg=n,t||(f.locationsShouldReload=!0)})))})},this.getDegradedReason=function(){let t=this.locations.find(t=>t.uri===this.repository.location);return t?t.degradedReason:""},this.clearLocationErrorMsg=function(t){let e=this.locations.find(e=>e.uri===t);e&&e.errorMsg&&(e.errorMsg=null)},this.initQuick=function(){this.hasActiveLocation()&&this.init(null,null,!0)},this.init=function(t,e,r){return this.loading=!0,r||(this.locationsShouldReload=!0),u.getActiveLocation().then((function(i){if(i.data){const s=i.data;if(s.active)return a.getRepositories().then((function(e){f.location=s,Object.entries(e.data).forEach(([t,e])=>{f.clearLocationErrorMsg(t),f.repositories.set(t,e)}),f.resetActiveRepository(),p(),f.checkLocationsDegraded(r),n.globalLocation=f.location,n.globalRepositories=f.getRepositories(),t&&t()})).catch((function(t){p(t),e&&e()}))}else p(),r&&(f.locationsShouldReload=!0),f.location="",f.repositories=new Map,f.setRepository("");n.globalLocation=f.location,n.globalRepositories=f.getRepositories()})).catch((function(t){p(t),e&&e()}))},this.getLocations=function(t){if(this.locationsShouldReload||d)return d||(this.locationsShouldReload=!1,this.locations=[this.location],d=u.getLocations(t).then(t=>(f.locations=t.data,this.locations)).catch((function(){r((function(){f.locationsShouldReload=!0}),2e3)})).finally(()=>{d=null})),d;const e=h.defer();return e.resolve(this.locations),e.promise},this.getActiveLocation=function(){return this.location},this.hasActiveLocation=function(){return!_.isEmpty(this.location)},this.getLocationError=function(){return this.locationError?this.locationError:l.instant("repositories.service.no.active.location")},this.isLoadingLocation=function(){return this.loading},this.getRepositories=function(){let t=[];return this.repositories.forEach(e=>t.push.apply(t,e)),t},this.getReadableRepositories=function(){return _.filter(this.getRepositories(),(function(t){return o.canReadRepo(t)}))},this.getWritableRepositories=function(){const t=this;return _.filter(this.getRepositories(),(function(e){return o.canWriteRepo(e)&&!t.isActiveRepoOntopType(e)}))},this.getActiveRepository=function(){return this.repository.id},this.getActiveRepositoryObject=function(){const t=this;let e=t.repositories.get(t.repository.location);return e?e.find(e=>e.id===t.repository.id):null},this.isSystemRepository=function(){return"SYSTEM"===this.repository.id},this.isActiveRepoOntopType=function(t){const e=this;let n;return t||(t=e.getActiveRepositoryObject()),t&&(n=e.repositories.get(t.location).find(e=>e.id===t.id),n)?"graphdb:OntopRepository"===n.sesameType:void 0===n},this.isActiveRepoFedXType=function(){const t=this;let e,n=t.getActiveRepositoryObject();return n&&(e=t.repositories.get(n.location).find(t=>t.id===n.id),e)?"graphdb:FedXRepository"===e.sesameType:void 0===e},this.getLocationFromUri=function(t){return this.locations.find(e=>e.uri===t)},this.setRepositoryHeaders=function(){t.defaults.headers.common["X-GraphDB-Repository"]=this.repository?this.repository.id:void 0,$.ajaxSetup().headers=$.ajaxSetup().headers||{},$.ajaxSetup().headers["X-GraphDB-Repository"]=this.repository?this.repository.id:void 0,t.defaults.headers.common["X-GraphDB-Repository-Location"]=this.repository?this.repository.location:void 0,$.ajaxSetup().headers=$.ajaxSetup().headers||{},$.ajaxSetup().headers["X-GraphDB-Repository-Location"]=this.repository?this.repository.location:void 0},f.setRepositoryHeaders(),this.setRepository=function(t){this.repository=t,t?(localStorage.setItem(f.repositoryStorageName,this.repository.id),localStorage.setItem(f.repositoryStorageLocationName,this.repository.location)):(localStorage.removeItem(f.repositoryStorageName),localStorage.removeItem(f.repositoryStorageLocationName)),f.setRepositoryHeaders(),n.$broadcast("repositoryIsSet",{newRepo:!0}),t&&!o.canReadRepo(t)&&this.setRepository(""),n.deniedPermissions={}},this.getDefaultRepository=function(){return this.hasActiveLocation()?this.location.defaultRepository:""},this.setDefaultRepository=function(t){if(!this.hasActiveLocation())return void e.error(l.instant("repositories.service.no.active.location"),l.instant("common.error"));const n=this;u.setDefaultRepository(t).success((function(){n.location.defaultRepository=t})).error((function(t){const n=getError(t);e.error(n,l.instant("common.error"))}))},this.deleteLocation=function(t){return u.deleteLocation(encodeURIComponent(t)).success((function(){let e=f.getActiveRepositoryObject();e&&e.location===t&&(f.location="",f.setRepository("")),f.init()})).error((function(t){const n=getError(t);e.error(n,l.instant("common.error"))}))},this.deleteRepository=function(t){return a.deleteRepository(t).success((function(){f.init()})).error((function(t){const n=getError(t);e.error(n,l.instant("common.error"))})).finally(()=>{const e=f.getActiveRepositoryObject();e&&e.id===t.id&&e.location===t.location&&f.setRepository("")})},this.restartRepository=function(t){return a.restartRepository(t).success((function(){e.success(l.instant("repositories.service.restarting.repo",{repositoryId:t.id})),f.initQuick()})).error((function(t){const n=getError(t);e.error(n,l.instant("common.error"))}))},this.getRepositoryTurtleConfig=function(e){return t.get("rest/repositories/"+e.id,{headers:{Accept:"text/turtle"}})},this.isRepoActive=function(t){return!!this.repository&&(t.id===this.repository.id&&t.location===this.repository.location)},this.getRepositoriesFromLocation=function(t){return this.repositories.get(t)},n.$on("securityInit",(function(t,e,n,r){(!e||n||r)&&f.init()}))}])},function(t,e,n){"use strict";n.r(e);n(5);var r=n(0);function i(){return{template:function(t,e){return'<object width="'+e.size+'" height="'+e.size+'" data="js/angular/templates/loader/ot-loader.svg?v=2.1.2">{{\'common.loading\' | translate}}</object>'}}}function s(){return{template:function(t,e){return'<object width="'+e.size+'" height="'+e.size+'" data="js/angular/templates/loader/ot-loader.svg?v=2.1.2"></object><div>{{\'common.loading\' | translate}}<div>'}}}function o(t){const e=function(t,n){n.timer=void 0,n.currentMessage=n.getMessage();const r=n.timeout[n.index%n.timeout.length];r&&(n.timer=t((function(){(n.index+1<n.message.length||0===n.message.length)&&(n.index++,e(t,n))}),1e3*r))};return{restrict:"EA",scope:{size:"@",trigger:"@",messageAttr:"=*message",timeoutAttr:"=*timeout",ngShow:"=",ngHide:"="},link:function(n){n.message=n.messageAttr,n.getMessage=function(){return n.message[n.index]},void 0===n.message?n.message=[""]:"function"==typeof n.message?(n.getMessage=n.message,n.message=[]):"object"!=typeof n.message&&(n.message=[n.message]),n.timeout=n.timeoutAttr,void 0===n.timeout?n.timeout=[0]:"object"!=typeof n.timeout&&(n.timeout=[n.timeout]),n.index=0,e(t,n);const r=function(r){n.timer&&t.cancel(n.timer),r&&(n.index=0,e(t,n))};n.$watch("ngShow",(function(t){r(t)})),n.$watch("ngHide",(function(t){r(!t)})),n.$on("$destroy",(function(){n.timer&&t.cancel(n.timer)}))},template:'<div class="ot-loader-new-content"><img width="{{size}}" height="{{size}}" src="js/angular/templates/loader/ot-loader.svg?v=2.1.2"/><div style="font-size: {{size/4}}px">{{currentMessage}}<div></div>'}}function a(t){return{restrict:"EA",transclude:!0,templateUrl:"js/angular/core/templates/core-errors.html",link:function(e,n,r){let i;e.setAttrs(r),e.setRestricted(),e.showRemoteLocations=!1,e.toggleShowRemoteLocations=()=>{e.showRemoteLocations=!e.showRemoteLocations},e.getAccessibleRepositories=function(){let t=t=>!0;return e.showRemoteLocations||(t=t=>t.local),e.isRestricted?e.getWritableRepositories().filter(t):e.getReadableRepositories().filter(t)},e.showPopoverForRepo=function(n,r){e.hidePopoverForRepo(),e.setPopoverRepo(r),t((function(){const t=$(n.toElement).find(".popover-anchor")[0];i=t,t&&!e.getActiveRepository()&&t.dispatchEvent(new Event("show"))})),n.stopPropagation()},e.hidePopoverForRepo=function(e){if(e){let t=e.relatedTarget;for(;t;){if(0===t.className.indexOf("popover"))return;t=t.parentElement}}i&&t((function(){i&&(i.dispatchEvent(new Event("hide")),i=null)})),e&&e.stopPropagation()}}}}function u(){return function(t,e){$(e).click((function(t){t.preventDefault(),t.stopPropagation()}))}}function c(){return{restrict:"A",require:"ngModel",link:function(t,e,n,r){t.multiRequired||(t.multiRequired=[]);const i=n.multiRequireElement,s=function(e){i&&i%1==0&&(t.multiRequired[i-1]=e)},o=function(){let e=!1,n=!1;for(let r=0;r<t.multiRequired.length;r++)t.multiRequired[r]?e=!0:n=!0;r.$setValidity("multiRequire",!(e&&n))};r.$parsers.unshift((function(t){return s(t),o(),t})),r.$formatters.unshift((function(t){return s(t),o(),t})),$("[multi-required]").on("blur keyup change focusout",(function(){o()}))}}}angular.module("graphdb.framework.core.directives",["graphdb.framework.core.services.repositories","graphdb.framework.utils.localstorageadapter"]).directive("ontoLoader",i).directive("ontoLoaderFancy",s).directive("ontoLoaderNew",o).directive("coreErrors",a).directive("eatClick",u).directive("multiRequired",c).directive("searchResourceInput",h).directive("keyboardShortcuts",f).directive("inactivePluginDirective",p),i.$inject=[],s.$inject=[],o.$inject=["$timeout"],a.$inject=["$timeout"],u.$inject=[],c.$inject=[];const l={table:"table",visual:"visual"};function h(t,e,n,i,s,o,a,u,c,h,f,p){return{restrict:"EA",scope:{namespacespromise:"=",autocompletepromisestatus:"=",textButton:"@",visualButton:"@",textCallback:"&",visualCallback:"&",placeholder:"@",uriValidation:"@",preserveInput:"@",empty:"=",clear:"=?clear",openInNewTab:"@",preserveSearch:"@",radioButtons:"@",clearInputIcon:"@"},templateUrl:"js/angular/core/templates/search-resource-input.html",link:function(d,g,m){g.autoCompleteStatus=void 0,g.autoCompleteWarning=!1,d.empty=!1,d.clear=!1,d.searchDisplayType=l;const v="true"===d.preserveSearch,y=g.find(".view-res-input");let b,w;d.textButtonLabel=d.textButton||"query.editor.table.btn",d.visualButtonLabel=d.visualButton||"query.editor.visual.btn",d.showClearInputIcon=!1,d.searchType=u.get(c.RDF_SEARCH_TYPE)||l.table,d.searchInput="",d.changeSearchType=function(t){d.searchType=t,u.set(c.RDF_SEARCH_TYPE,d.searchType)},d.$on("addStartFixedNodeAutomatically",(function(t,e){d.searchInput||!e.startIRI?d.checkIfValidAndSearchText():d.visualCallback({uri:e.startIRI,label:""})})),d.clearInput=function(){d.searchInput="",d.selectedElementIndex=-1,d.autoCompleteUriResults=[],d.showClearInputIcon=!1,u.remove(c.RDF_SEARCH_INPUT),u.remove(c.RDF_SEARCH_EXPANDED_URI),u.remove(c.RDF_RESOURCE_DESCRIPTION)},d.$watch("namespacespromise",(function(){angular.isDefined(d.namespacespromise)&&d.namespacespromise.success((function(t){g.namespaces=t.results.bindings.map((function(t){return{prefix:t.prefix.value,uri:t.namespace.value}}))})).error((function(t){const n=getError(t);e.error(n,f.instant("error.getting.namespaces.for.repo"))}))})),d.$watch("autocompletepromisestatus",(function(){!h.isActiveRepoFedXType()&&angular.isDefined(d.autocompletepromisestatus)&&d.autocompletepromisestatus.success((function(t){g.autoCompleteStatus=!!t,""!==d.searchInput&&d.onChange()})).error((function(){e.error(f.instant("explore.error.autocomplete"))}))})),d.$watch("empty",(function(){v||(d.searchInput="",d.empty=!1)})),d.$watch("clear",(function(){d.clear&&(d.clearInput(),d.clear=!1)})),s.$on("$translateChangeSuccess",(function(){m.$attr.placeholder?d.placeholder=m.$attr.placeholder:d.placeholder=f.instant("search.resources.msg")+"..."}));const x=function(e){const n=e.type||"uri";"true"===d.openInNewTab?E(!1,e):t.path("resource").search(n,e.uri)},S=function(e){const n=e.type||"uri";"true"===d.openInNewTab?E(!0,e):t.path("graphs-visualizations").search(n,e.uri)},E=function(t,e){const n=t?"graphs-visualizations":"resource";window.open(`${n}?uri=${encodeURIComponent(e.uri)}`)};angular.isUndefined(m.$attr.textCallback)&&(d.textCallback=x),angular.isUndefined(m.$attr.visualCallback)&&(d.visualCallback=S),m.$attr.textButton&&!d.textButton?d.textCallback=d.visualCallback:m.$attr.visualButton&&!d.visualButton&&(d.visualCallback=d.textCallback),m.$attr.placeholder?d.placeholder=m.$attr.placeholder:d.placeholder=f.instant("search.resources.msg")+"...",angular.isDefined(m.$attr.uriValidation)?d.uriValidation=m.$attr.uriValidation:d.uriValidation="true",angular.isDefined(m.$attr.preserveInput)&&(d.preserveInput=m.$attr.preserveInput),d.getResultItemHtml=function(t){return a.trustAsHtml(t.description)},d.searchRdfResource=function(t,e){if("prefix"===t.type)d.searchInput=D(t.value+":"),y.focus(),d.onChange();else{let n;n=angular.isUndefined(t)?d.searchInput:"object"==typeof t?t.value:t;let r="";if(t.description){const e=t.description.indexOf("<"+n+">");e>0&&(r=t.description.substring(0,e).replace(/<\/?b>/g,""))}e({uri:n,description:t.description,label:r,type:t.type}),v?(d.selectedElementIndex=d.activeSearchElm,u.set(c.RDF_SEARCH_EXPANDED_URI,b),u.set(c.RDF_SEARCH_INPUT,d.searchInput),u.set(c.RDF_RESOURCE_DESCRIPTION,t.description)):"true"===d.preserveInput?(d.searchInput=n,d.autoCompleteUriResults=[]):(d.searchInput="",d.autoCompleteUriResults=[])}},d.searchRdfResourceByEvent=function(t,e){d.searchType===l.visual||e.ctrlKey||e.metaKey?d.searchRdfResource(t,d.visualCallback):d.searchRdfResource(t,d.textCallback)};const F=function(t){const n=d.searchInput;""!==n?"false"!==d.uriValidation?g.autoCompleteStatus&&d.autoCompleteUriResults&&d.autoCompleteUriResults.length>0?"prefix"===d.autoCompleteUriResults[d.activeSearchElm].type?(d.searchInput=D(d.autoCompleteUriResults[d.activeSearchElm].value+":"),d.autoCompleteUriResults=[]):d.searchRdfResource(d.autoCompleteUriResults[d.activeSearchElm],t):C(n)?d.searchRdfResource(n,t):e.error(f.instant("invalid.uri.msg")):d.searchRdfResource(n,t):e.error(f.instant("fill.input.field.msg"))};function A(){let t=-1;const n=u.get(c.RDF_RESOURCE_DESCRIPTION);n&&d.autoCompleteUriResults&&(t=d.autoCompleteUriResults.findIndex(t=>t.description===n),d.selectedElementIndex=t,new Promise(t=>{const e=document.getElementById("auto-complete-results-wrapper").getBoundingClientRect();setTimeout(()=>{t(e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth))})}).then((function(){!function(){const t=$("#auto-complete-results-wrapper"),e=$("#auto_"+d.selectedElementIndex);t.animate({scrollTop:e.offset().top-t.offset().top+t.scrollTop()})}()})).catch((function(t){e.error(getError(t),f.instant("no.prev.search.element"))}))),d.activeSearchElm=-1===t?0:t}function C(t){const e=t.indexOf("<")>=0&&t.indexOf(">")>=0,n=-1===t.indexOf("<")&&-1===t.lastIndexOf(">"),r=/^<?(http|urn).*>?/.test(t)&&(e||n);let i=!1;if(r)if(t.indexOf("http")>=0){const e=t.indexOf("//");i=e>4&&t.substring(e+2).length>0}else t.indexOf("urn")>=0&&(i=t.substring(4).length>0);return r&&i}function D(t){if(!/^<?(http|urn).*>?/.test(t)){const e=t.split(":"),r=e[0],i=e[1];if(!angular.isUndefined(i)){const t=n.getNamespaceUriForPrefix(g.namespaces,r);if(b=t!==b?t:b,b)return y.val(b),b+i}}return t}d.checkIfValidAndSearchText=function(){F(d.textCallback)},d.checkIfValidAndSearchVisual=function(){F(d.visualCallback)},d.checkIfValidAndSearchEvent=function(t){d.searchType===l.visual||t.ctrlKey||t.metaKey?F(d.visualCallback):F(d.textCallback)},d.onChange=function(){return d.showClearInputIcon=d.clearInputIcon,v&&u.set(c.RDF_SEARCH_INPUT,d.searchInput),"false"!==d.uriValidation&&(d.searchInput=D(d.searchInput),g.autoCompleteStatus)?function(t){let e=t.replace(b,b+";");if(g.autoCompleteStatus)return";"===e.charAt(0)&&(e=e.slice(1)),e=function(t){let e=t;if(-1===e.indexOf(";")&&C(e)){e=e.replace(/<|>/g,"");const t=/[^/^#]*$/.exec(e)[0];return e.split(t)[0]+";"+t}return e}(e),w&&w.resolve(),w=o.defer(),i.getAutocompleteSuggestions(e,w.promise).then((function(t){w=null,d.autoCompleteUriResults=t.data.suggestions,d.activeSearchElm=0}));return Promise.resolve()}(d.searchInput):Promise.resolve()},d.onKeyDown=function(t){if(13===t.keyCode){if(t.preventDefault(),p.isActive())return;"false"!==d.uriValidation?g.autoCompleteStatus?d.checkIfValidAndSearchEvent(t):C(t.target.value)?d.searchRdfResourceByEvent(t.target.value,t):e.error(f.instant("invalid.uri.msg")):d.searchRdfResourceByEvent(t.target.value,t)}else if(d.searchInput.length>0&&!g.autoCompleteWarning&&!g.autoCompleteStatus){g.autoCompleteWarning=!0;const t=Object(r.decodeHTML)(f.instant("explore.autocomplete.warning.msg"));e.warning("",`<div class="autocomplete-toast"><a href="autocomplete">${t}</a></div>`,{allowHtml:!0})}if(g.autoCompleteStatus&&!angular.isUndefined(d.autoCompleteUriResults)){if(40===t.keyCode&&d.activeSearchElm<d.autoCompleteUriResults.length-1&&(d.activeSearchElm++,d.searchInput=d.autoCompleteUriResults[d.activeSearchElm].value,function(){const t=$("#auto-complete-results-wrapper"),e=t.children("div"),n=t.children("div.active");void 0!==n[0]&&n[0].offsetTop-e.height()-6-t.scrollTop()>170&&t.scrollTop(n[0].offsetTop-e.height()-6-170)}()),38===t.keyCode&&d.activeSearchElm>0&&(t.preventDefault(),d.activeSearchElm--,d.searchInput=d.autoCompleteUriResults[d.activeSearchElm].value,function(){const t=$("#auto-complete-results-wrapper"),e=t.children("div"),n=t.children("div.active");void 0!==n[0]&&n[0].offsetTop-e.height()-40<=t.scrollTop()&&t.scrollTop(t.scrollTop()-34)}()),27===t.keyCode){if(v)return;d.searchInput="",d.autoCompleteUriResults=[]}d.searchInput||d.clearInput()}},d.$on("rdfResourceSearchExpanded",(function(){(v?(d.preserveInput="true",d.searchInput=u.get(c.RDF_SEARCH_INPUT)||"",b=u.get(c.RDF_SEARCH_EXPANDED_URI),d.onChange()):Promise.resolve()).then((function(){A()}))})),d.setActiveClassOnMouseMove=function(t){g.autoCompleteStatus&&(d.activeSearchElm=t)}}}}function f(t){return{restrict:"AE",link:function(e,n,r){function i(t){27===t.keyCode&&(e.toggleCheatSheet(),e.$apply())}e.getTemplateUrl=function(){return r.templateUrl},e.shortcutsVisible=!1,e.toggleCheatSheet=function(){e.shortcutsVisible=!e.shortcutsVisible,e.shortcutsVisible?t.on("keydown",i):t.off("keydown",i)}},template:'<ng-include src="getTemplateUrl()" />'}}function p(t,e,n,i,s,o){return{restrict:"E",transclude:!0,scope:{loadSaved:"&",setPluginActive:"&",pluginName:"@",humanReadablePluginName:"@"},templateUrl:"js/angular/core/templates/inactive-plugin-warning-page.html",link:function(a){function u(){if(s.isLicenseValid()&&i.getActiveRepository()&&!i.isActiveRepoOntopType()&&!i.isActiveRepoFedXType())return e.checkPluginIsActive(a.pluginName).done((function(t){a.pluginIsActive=t.indexOf("true")>0,a.setPluginActive({isPluginActive:a.pluginIsActive})})).fail((function(e){t.error(getError(e),o.instant("check.active.plugin.failure"))}))}a.pluginIsActive=!0,a.activatePlugin=function(){const i=Object(r.decodeHTML)(o.instant("activate.plugin.warning.msg",{humanReadablePluginName:a.humanReadablePluginName}));n.openSimpleModal({title:o.instant("activate.plugin.confirmation"),message:`<p>${i}</p>`,warning:!0}).result.then((function(){e.activatePlugin(a.pluginName).done((function(){a.pluginIsActive=!0,a.setPluginActive({isPluginActive:a.pluginIsActive}),a.loadSaved()})).fail((function(e){t.error(getError(e),o.instant("activate.plugin.failure"))}))}))};const c=a.$on("repositoryIsSet",(function(){u()}));window.addEventListener("beforeunload",(function t(){c(),window.removeEventListener("beforeunload",t)})),a.$on("checkIsActive",u),u()}}}h.$inject=["$location","toastr","ClassInstanceDetailsService","AutocompleteRestService","$rootScope","$q","$sce","LocalStorageAdapter","LSKeys","$repositories","$translate","GuidesService"],f.$inject=["$document"],p.$inject=["toastr","RDF4JRepositoriesRestService","ModalService","$repositories","$licenseService","$translate"]},function(t,e,n){"use strict";n.r(e);n(4),n(23),n(24);var r=n(2);angular.module("graphdb.framework.core.services.jwtauth",["toastr","graphdb.framework.rest.security.service","graphdb.framework.core.services.openIDService"]).service("$jwtAuth",["$http","toastr","$location","$rootScope","SecurityRestService","$openIDAuth","$translate","$q",function(t,e,n,i,s,o,a,u){const c=this;i.deniedPermissions={},i.setPermissionDenied=function(t){return!("/"===t||"/login"===t||!c.isAuthenticated())&&(i.deniedPermissions[t]=!0,!0)},i.hasPermission=function(){const t=n.path();return!i.deniedPermissions[t]},i.redirectToLogin=function(t,e){return c.authTokenIsType("Bearer")&&(t=!0),c.clearAuthenticationInternal(),0!==n.url().indexOf("/login")&&(i.returnToUrl=n.url()),n.path("/login"),e?n.search("noaccess"):t&&n.search("expired"),new Promise(t=>{setTimeout(()=>{t(!0)},100)})},i.hasExternalAuthUser=function(){return c.hasExternalAuthUser()},this.authStorageName="com.ontotext.graphdb.auth",this.securityEnabled=!0,this.freeAccess=!1,this.hasOverrideAuth=!1,this.externalAuthUser=!1,this.securityInitialized=!1;const l=this;this.clearStorage=function(){localStorage.removeItem(l.authStorageName)},this.getAuthenticatedUserFromBackend=function(t,e){s.getAuthenticatedUser().success((function(t,e,n){l.auth&&l.auth.startsWith("GDB")?(l.externalAuthUser=!1,l.principal=t,i.$broadcast("securityInit",l.securityEnabled,!0,l.freeAccess)):l.openIDEnabled&&l.auth&&l.auth.startsWith("Bearer")?l.authenticate(t,l.auth):(l.externalAuthUser=!0,l.authenticate(t,""))})).error((function(){t||!l.freeAccess?i.redirectToLogin(!1,e):(l.securityInitialized=!0,l.hasExplicitAuthentication()||l.clearAuthentication())}))},this.initSecurity=function(){this.securityInitialized=!1,this.auth=localStorage.getItem(this.authStorageName),s.getSecurityConfig().then((function(t){if(l.securityEnabled=t.data.enabled,l.externalAuth=t.data.hasExternalAuth,l.authImplementation=t.data.authImplementation,l.openIDEnabled=t.data.openIdEnabled,l.passwordLoginEnabled=t.data.passwordLoginEnabled,l.securityEnabled){const e=t.data.freeAccess;l.freeAccess=e.enabled,l.freeAccess&&(l.freeAccessPrincipal={authorities:e.authorities,appSettings:e.appSettings}),l.openIDEnabled?(l.openIDConfig=t.data.methodSettings.openid,l.gdbUrl=n.absUrl().replace(n.url().substr(1),""),o.initOpenId(l.openIDConfig,l.gdbUrl,(function(t){l.auth=o.authHeaderGraphDB(),c.setAuthHeaders(),console.log("oidc: set id/access token as GraphDB auth"),l.getAuthenticatedUserFromBackend(!0,t)}),(function(){console.log("oidc: not logged or login error"),l.authTokenIsType("Bearer")?setTimeout(()=>{i.redirectToLogin(!0)},0):l.getAuthenticatedUserFromBackend()}))):l.getAuthenticatedUserFromBackend()}else{l.clearStorage();const e=t.data.overrideAuth;if(l.hasOverrideAuth=e.enabled,!l.hasOverrideAuth)return s.getAdminUser().then((function(t){l.principal={username:"admin",appSettings:t.data.appSettings,authorities:t.data.grantedAuthorities},i.$broadcast("securityInit",l.securityEnabled,!0,l.hasOverrideAuth)}));l.principal={username:"overrideauth",authorities:e.authorities,appSettings:e.appSettings},i.$broadcast("securityInit",l.securityEnabled,!0,l.hasOverrideAuth)}}))},this.initSecurity(),this.reinitializeSecurity=function(){this.securityInitialized||this.initSecurity()},this.isSecurityEnabled=function(){return this.securityEnabled},this.hasExternalAuth=function(){return this.externalAuth},this.getAuthImplementation=function(){return this.authImplementation},this.isFreeAccessEnabled=function(){return this.freeAccess},this.isDefaultAuthEnabled=function(){return this.hasOverrideAuth&&this.principal&&"overrideauth"===this.principal.username},this.getAuthToken=function(){return this.auth},this.authTokenIsType=function(t){return this.auth&&this.auth.startsWith(t)},this.loginOpenID=function(){o.login(this.openIDConfig,this.gdbUrl)},this.toggleSecurity=function(t){t!==this.securityEnabled&&(this.securityEnabled=t,s.toggleSecurity(t).then((function(){e.success(a.instant("jwt.auth.security.status",{status:a.instant(t?"enabled.status":"disabled.status")})),l.clearStorage(),l.initSecurity()}),(function(t){e.error(t.data.error.message,a.instant("common.error"))})))},this.toggleFreeAccess=function(t,n,r,o){(t!==this.freeAccess||o)&&(this.freeAccess=t,this.freeAccessPrincipal=t?{authorities:n,appSettings:r}:void 0,s.setFreeAccess({enabled:t?"true":"false",authorities:n,appSettings:r}).then((function(){o?e.success(a.instant("jwt.auth.free.access.updated.msg")):e.success(a.instant("jwt.auth.free.access.status",{status:a.instant(t?"enabled.status":"disabled.status")}))}),(function(t){e.error(t.data.error.message,a.instant("common.error"))})),i.$broadcast("securityInit",this.securityEnabled,this.hasExplicitAuthentication(),this.freeAccess))},this.setAuthHeaders=function(){return new Promise(e=>{const n=this.auth?this.auth:void 0;t.defaults.headers.common.Authorization=n,t.defaults.headers.common["X-Requested-With"]="XMLHttpRequest",$.ajaxSetup().headers=$.ajaxSetup().headers||{},$.ajaxSetup().headers.Authorization=n,$.ajaxSetup().headers["X-Requested-With"]="XMLHttpRequest",setTimeout(()=>{e(!0)})})},this.setAuthHeaders(),this.authenticate=function(t,e){return new Promise(n=>{l.clearStorage(),e&&(this.auth=e,localStorage.setItem(l.authStorageName,this.auth),this.externalAuthUser=!1),this.principal=t,i.deniedPermissions={},this.securityInitialized=!0,l.setAuthHeaders().then(()=>{i.$broadcast("securityInit",this.securityEnabled,l.hasExplicitAuthentication(),this.freeAccess)}),setTimeout(()=>{n(!0)})})},this.authenticateOpenID=function(t){this.clearStorage(),t&&(this.auth=t,localStorage.setItem(this.authStorageName,this.auth),this.externalAuthUser=!1)},this.hasExternalAuthUser=function(){return this.externalAuthUser},this.hasExplicitAuthentication=function(){return null!=this.auth||this.externalAuthUser},this.getPrincipal=function(){if(this.principal)return Promise.resolve(this.principal);const t=u.defer();return i.$on("securityInit",()=>{t.resolve(this.principal)}),t.promise},this.clearAuthenticationInternal=function(){o.softLogout(),this.auth=null,this.principal=this.freeAccessPrincipal,this.clearStorage(),this.setAuthHeaders()},this.clearAuthentication=function(){this.clearAuthenticationInternal(),i.$broadcast("securityInit",this.securityEnabled,!1,this.freeAccess)},this.isAuthenticated=function(){return!this.securityEnabled||this.hasExplicitAuthentication()},this.hasPermission=function(){},this.hasRole=function(t){if(void 0!==t&&(this.securityEnabled||this.hasOverrideAuth)){"string"==typeof t&&(t=[t]);const e=!_.isEmpty(this.principal);return!!e&&("IS_AUTHENTICATED_FULLY"===t[0]?e:_.intersection(t,this.principal.authorities).length>0)}return!0},this.isAdmin=function(){return this.hasRole(r.UserRole.ROLE_ADMIN)},this.checkForWrite=function(t,e){return"WRITE_REPO"===t?this.canWriteRepo(e):this.hasRole(t)},this.hasAdminRole=function(){return this.isAdmin()||this.hasRole(r.UserRole.ROLE_REPO_MANAGER)},this.canWriteRepo=function(t){return!!t&&(!this.securityEnabled&&!this.hasOverrideAuth||!_.isEmpty(this.principal)&&(!!this.hasAdminRole()||this.checkRights(t,"WRITE")))},this.canReadRepo=function(t){return!!t&&(!this.securityEnabled||!_.isEmpty(this.principal)&&(!!this.hasAdminRole()||this.checkRights(t,"READ")))},this.checkRights=function(t,e){if(t)for(let n=0;n<this.principal.authorities.length;n++){const r=this.principal.authorities[n],i=r.split("_",2),s=r.slice(i[0].length+i[1].length+2),o=t.location?`${t.id}@${t.location}`:t.id;if(i[0]===e&&(o===s||"SYSTEM"!==t.id&&"*"===s))return!0}return!1}}])},function(t,e){let n;angular.module("graphdb.framework.utils.uriutils",[]).factory("UriUtils",(function(){return{isValidIri:function(t){return void 0!==t&&!!t.match(n)},validateRdfUri:function(t){const e=t.indexOf("<")>=0&&t.indexOf(">")>=0,n=-1===t.indexOf("<")&&-1===t.lastIndexOf(">"),r=/^<?(http|urn).*>?/.test(t)&&(e||n);let i=!1;if(r)if(t.indexOf("http")>=0){const e=t.indexOf("//");i=e>4&&t.substring(e+2).length>0}else t.indexOf("urn")>=0&&(i=t.substring(4).length>0);return r&&i},shortenIri:function(t){const e=document.createElement("a");e.href=t;let n=e.hostname;return function(t){const e=t.split(".");for(let t=0,n=0;t<e.length;t++)if(parseInt(e[t],10)>=0&&parseInt(e[t],10)<=255?n++:n=0,4===n)return!0;return!1}(e.hostname)||(n=e.hostname.split(".")[0]),n+":"+e.port}}}));try{n=new RegExp("^[a-z](?:[-a-z0-9\\+\\.])*:(?:\\/\\/(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:])*@)?(?:\\[(?:(?:(?:[0-9a-f]{1,4}:){6}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|::(?:[0-9a-f]{1,4}:){5}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:[0-9a-f]{1,4}:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|v[0-9a-f]+[-a-z0-9\\._~!\\$&'\\(\\)\\*\\+,;=:]+)\\]|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}|(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=@])*)(?::[0-9]*)?(?:\\/(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))*)*|\\/(?:(?:(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))+)(?:\\/(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))*)*)?|(?:(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))+)(?:\\/(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))*)*|(?!(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@])))(?:\\?(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@])|[\\u{E000}-\\u{F8FF}\\u{F0000}-\\u{FFFFD}\\u{100000}-\\u{10FFFD}\\/\\?])*)?(?:#(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@])|[\\/\\?])*)?$","ui")}catch(t){n=new RegExp("^[a-z](?:[-a-z0-9\\+\\.])*:","i")}},function(t,e){angular.module("graphdb.framework.rest.monitoring.service",[]).factory("MonitoringRestService",n),n.$inject=["$http"];function n(t){return{monitorResources:function(){return t.get("rest/monitor/resource")},monitorGC:function(){return t.post("rest/monitor/resource/gc")},monitorQuery:function(){return t.get("rest/monitor/query")},abortQueryByAlias:function(e){return t.delete("rest/monitor/query?queryAlias="+encodeURIComponent(e))},deleteQuery:function(e){return t.delete("rest/monitor/query?queryId="+encodeURIComponent(e))},getQueryCount:function(){return t({url:"rest/monitor/query/count",method:"GET",timeout:1e4})},checkAutocompleteStatus:function(){return t.get("rest/autocomplete/enabled")}}}},function(t,e){angular.module("graphdb.framework.rest.rdf4j.repositories.service",[]).factory("RDF4JRepositoriesRestService",r),r.$inject=["$http","$repositories","$translate"];const n="select ?o where {\n?s <http://www.ontotext.com/owlim/system#listplugins> ?o .\nfilter(str(?s) = '{{pluginName}}')\n} ";function r(t,e,r){return{getNamespaces:function(e){return t.get(`repositories/${e}/namespaces`)},getRepositoryNamespaces:function(){return t.get(`repositories/${e.getActiveRepository()}/namespaces`)},updateNamespacePrefix:function(e,n,r){return t({url:`repositories/${e}/namespaces/${r}`,method:"PUT",data:n})},deleteNamespacePrefix:function(e,n){return t({url:`repositories/${e}/namespaces/${n}`,method:"DELETE"})},addStatements:function(e,n){return t({url:`repositories/${e}/statements`,method:"POST",data:n,headers:{"Content-Type":"application/x-www-form-urlencoded"}})},activatePlugin:function(t){return $.ajax({method:"POST",url:`repositories/${e.getActiveRepository()}/statements`,data:{update:"INSERT DATA { <u:a> <http://www.ontotext.com/owlim/system#startplugin> '{{pluginName}}' .}".replace("{{pluginName}}",t)}})},checkPluginIsActive:function(t){return $.ajax({method:"GET",url:"repositories/"+e.getActiveRepository(),data:{query:n.replace("{{pluginName}}",t)}})},getRepositorySize:function(){return t.get(`repositories/${e.getActiveRepository()}/size`)},getGraphs:i,resolveGraphs:function(){const t=e.getActiveRepository();let n=[];if(t)return i(t).success((function(t){t.results.bindings.unshift({contextID:{type:"default",value:"import.default.graph"}}),Object.keys(t.results.bindings).forEach((function(e){const n=t.results.bindings[e];"bnode"===n.contextID.type?n.contextID.value="_:"+n.contextID.value:"default"===n.contextID.type?n.contextID.uri="http://www.openrdf.org/schema/sesame#nil":n.contextID.uri=n.contextID.value})),t.results.bindings.unshift(allGraphs),n=t.results.bindings}));return n}};function i(e){return t.get(`repositories/${e}/contexts`)}}},function(t,e){function n(t,e,n,r){t.title=n,t.message=r,t.ok=function(){e.close()},t.cancel=function(){e.dismiss("cancel")}}function r(t,e,n,r,i){t.clipboardURI=n,t.ok=function(){try{document.getElementById("clipboardURI").select(),document.execCommand("copy"),r.success(i.instant("modal.ctr.copy.url.success"))}catch(t){r.error(i.instant("modal.ctr.copy.not.supported.warning"))}e.close()},t.cancel=function(){e.dismiss("cancel")}}function i(t,e,n,r,i){t.query=n,t.cancel=function(){e.dismiss("cancel")},t.selectQuery=function(){t.selectElement($("#create-query"))},t.copyQueryToClipboard=function(){try{t.selectQuery(),document.execCommand("copy"),e.close(),r.success(i.instant("modal.ctr.copy.query.success"))}catch(t){r.error(i.instant("modal.ctr.copy.not.supported.warning"))}},t.selectElement=function(t){if(t.length>0)if(window.getSelection){const e=window.getSelection();e.removeAllRanges();const n=document.createRange();n.selectNodeContents(t[0].firstChild),e.addRange(n)}else if(document.selection){const e=document.body.createTextRange();e.moveToElementText(t[0]),e.select()}}}angular.module("graphdb.framework.core.controllers",[]).controller("CopyToClipboardModalCtrl",r).controller("SimpleModalCtrl",n).controller("ViewQueryCtrl",i),n.$inject=["$scope","$modalInstance","title","message"],r.$inject=["$scope","$modalInstance","uri","toastr","$translate"],i.$inject=["$scope","$modalInstance","query","toastr","$translate"]},function(t,e){angular.module("graphdb.framework.rest.sparql.service",[]).factory("SparqlRestService",n),n.$inject=["$http"];function n(t){return{getSavedQueries:function(){return t.get("rest/sparql/saved-queries")},getSavedQuery:function(e,n){let r="";null!=n&&(r="&owner="+encodeURIComponent(n));return t.get(`rest/sparql/saved-queries?name=${encodeURIComponent(e)}${r}`)},addKnownPrefixes:function(e){return t.post("rest/sparql/add-known-prefixes",e)},editSavedQuery:function(e){return t.put("rest/sparql/saved-queries",e)},deleteSavedQuery:function(e){return t.delete("rest/sparql/saved-queries?name="+encodeURIComponent(e))},addNewSavedQuery:function(e){return t.post("rest/sparql/saved-queries",e)}}}},function(t,e){angular.module("graphdb.framework.rest.autocomplete.service",[]).factory("AutocompleteRestService",n);function n(t){return{checkAutocompleteStatus:function(){return t.get("rest/autocomplete/enabled")},refreshIndexStatus:function(){return t.get("rest/autocomplete/status")},refreshLabelConfig:function(){return t.get("rest/autocomplete/labels")},addLabelConfig:function(e){return t.put("rest/autocomplete/labels",e)},removeLabelConfig:function(e){return t.delete("rest/autocomplete/labels",{data:e,headers:{"Content-Type":"application/json;charset=utf-8"}})},toggleAutocomplete:function(e){return t.post("rest/autocomplete/enabled?enabled="+e)},refreshIndexIRIs:function(){return t.get("rest/autocomplete/iris")},toggleIndexIRIs:function(e){return t.post("rest/autocomplete/iris?enabled="+e)},buildIndex:function(){return t.post("rest/autocomplete/reindex")},interruptIndexing:function(){return t.post("rest/autocomplete/interrupt")},checkForPlugin:function(){return t.get("rest/autocomplete/plugin-found")},getAutocompleteSuggestions:function(e,n){return t.get("rest/autocomplete/query",{params:{q:e},timeout:n})}}}n.$inject=["$http"]},function(t,e){angular.module("graphdb.framework.rest.plugins.service",[]).factory("PluginsRestService",n);function n(t){return{togglePlugin:function(e,n,r){return n?t.post(`repositories/${e}/statements`,void 0,{params:{update:`INSERT DATA { <u:a> <http://www.ontotext.com/owlim/system#stopplugin> "${r}".}`}}):t.post(`repositories/${e}/statements`,void 0,{params:{update:`INSERT DATA { <u:a> <http://www.ontotext.com/owlim/system#startplugin> "${r}".}`}})},getPlugins:function(e){return t.get("repositories/"+e,{params:{query:"select ?s ?o where { ?s <http://www.ontotext.com/owlim/system#listplugins> ?o .}"}})}}}n.$inject=["$http"]},function(t,e,n){"use strict";n.r(e);n(5),n(7);var r=n(1);function i(t,e,n,i,s,o,a,u,c,l){this.guideResumeSubscription=void 0,this.languageChangeSubscription=void 0,this.guideCancelSubscription=void 0,this.init=()=>{this._subscribeToGuideResumed(),this._subscribeToGuideCancel(),this._subscribeToGuidePause()},this.startGuide=(t,a)=>{if(t&&t.options&&t.options.repositoryIdBase){const e=o.getRepositories();t.options.repositoryId=t.options.repositoryIdBase;for(let n=2;e.find(e=>e.id===t.options.repositoryId);n++)t.options.repositoryId=t.options.repositoryIdBase+n;t.options.translatedGuideName=r.GuideUtils.translateLocalMessage(n,i,t.guideName,{}),t.options.translatedGuideDescription=r.GuideUtils.translateLocalMessage(n,i,t.guideDescription,{})}const u=this._toStepsDescriptions(t);for(let t=0;t<u.length;t++)u[t].id=t;angular.isDefined(a)?s.resumeGuide(t.guideId,u,a):s.startGuide(t.guideId,u,a),e.$broadcast("guideStarted")},this.getGuides=()=>new Promise(e=>{t.get(r.GuideUtils.GUIDES_LIST_URL).success((function(t){angular.forEach(t,(t,e)=>{void 0===t.guideId&&(t.guideId=e)}),e(t)}))}),this.isActive=()=>s.isActive(),this._toStepsDescriptions=t=>{if(!t)return[];let e=[];return t.steps.forEach(n=>{e=e.concat(this._getSteps(n,t.options))}),e},this._getSteps=(t,h)=>{const f={$translate:n,$interpolate:i,GuideUtils:r.GuideUtils,$rootScope:e,toastr:a,$location:u,$route:c,$timeout:l,ShepherdService:s,$repositories:o};let p=[];if(angular.isArray(t))t.forEach(e=>{p=p.concat(this._getSteps(e,angular.extend({},t.options,h)))});else{const e=PluginRegistry.get("guide.step").find(e=>e.guideBlockName===t.guideBlockName);if(e){const n=angular.extend({},e.options,t.options,h);e.getSteps?p=p.concat(this._getSteps(angular.copy(e.getSteps(n,f)),h)):e.getStep?p.push(angular.copy(e.getStep(n,f))):p=p.concat(this._getSteps(angular.copy(e,e.options),h))}}return p.forEach((t,e)=>{t.stepN=e,t.stepsTotalN=p.length,!t.title&&t.mainAction&&(t.title="guide.step-action."+t.mainAction)}),p},this._subscribeToGuideResumed=()=>{this.guideResumeSubscription||(this.guideResumeSubscription=e.$on("guideResume",()=>{const t=s.getGuideId();this.getGuides().then(e=>{const n=e.find(e=>e.guideId===t),r=s.getCurrentStepId();this.startGuide(n,r)})}))},this._subscribeToGuideCancel=()=>{s.subscribeToGuideCancel(()=>e.$broadcast("guideReset"))},this._subscribeToGuidePause=()=>{s.subscribeToGuidePause(()=>e.$broadcast("guidePaused"))}}angular.module("graphdb.framework.guides.services",["graphdb.framework.guides.shepherd.services"]).service("GuidesService",i),i.$inject=["$http","$rootScope","$translate","$interpolate","ShepherdService","$repositories","toastr","$location","$route","$timeout"]},function(t,e,n){"use strict";n.r(e);n(4);angular.module("graphdb.framework.core.interceptors.unauthorized",["ngCookies"]).factory("$unauthorizedInterceptor",["$q","$location","$rootScope","$translate",function(t,e,n,r){return{responseError:function(i){let s=!1;return 401===i.status?i.config.url.indexOf("rest/security/authenticated-user")<0&&!n.hasExternalAuthUser()&&(s=!0):403===i.status&&(n.setPermissionDenied(e.path())?console.log(r.instant("unauthorized.console.warning")):s=!0),s?Promise.resolve(n.redirectToLogin()).then(()=>t.reject(i)):t.reject(i)}}}])},,function(t,e,n){"use strict";n.r(e);var r=n(3);const i={headers:{"X-GraphDB-Repository-Location":void 0,"X-GraphDB-Repository":void 0,"X-Requested-With":void 0,Authorization:void 0}};angular.module("graphdb.framework.core.services.openIDService",["toastr"]).service("$openIDAuth",["$http","$location","$window","toastr","$translate",function(t,e,n,s,o){const a="com.ontotext.graphdb.openid.",u=this;function c(t){const e=[];for(let n in t)t.hasOwnProperty(n)&&e.push(`${n}=${encodeURIComponent(t[n])}`);return e.join("&")}this.login=function(t,e){const r=u.generateRandomString(),i=t.authFlow;if("code"===i){u.setStorageItem("pkce_state",r);const i=u.generateRandomString();u.setStorageItem("pkce_code_verifier",i);const s=u.pkceChallengeFromVerifier(i);n.location.href=u.getLoginUrl(r,s,e,t)}else"code_no_pkce"===i?(u.removeStorageItem("pkce_code_verifier"),n.location.href=u.getLoginUrl(r,"",e,t)):"implicit"===i?(u.setStorageItem("nonce",r),n.location.href=u.getLoginUrl(r,"",e,t)):(console.log("oidc: unknown auth flow: "+i),s.error(o.instant("openid.auth.unknown.flow",{authFlow:i})))},this.getLoginUrl=function(t,e,n,r){const i=[];let s="";switch(r.authFlow){case"code":s="code",i.push("state="+encodeURIComponent(t)),i.push("code_challenge="+encodeURIComponent(e)),i.push("code_challenge_method=S256");break;case"code_no_pkce":s="code";break;case"implicit":s="token id_token",i.push("nonce="+encodeURIComponent(t));break;default:throw new Error(o.instant("openid.auth.unknown.flow",{authFlow:r.authFlow}))}return i.unshift("response_type="+encodeURIComponent(s),"scope="+encodeURIComponent(u.getScope(r.extraScopes)),"client_id="+encodeURIComponent(r.clientId),"redirect_uri="+encodeURIComponent(n)),r.oracleDomain&&i.push("domain="+encodeURIComponent(r.oracleDomain)),r.authorizeParameters&&i.push(r.authorizeParameters),`${r.oidcAuthorizationEndpoint}?${i.join("&")}`},this.withOpenIdKeys=function(e,n){t.get(e,i).success((function(t){u.openIdKeys={},t.keys.forEach((function(t){u.openIdKeys[t.kid]=t})),n()}))},this.initOpenId=function(t,e,r,a){u.clientId=t.clientId,u.tokenType=t.tokenType,u.idTokenAudience=t.clientId,u.idTokenIssuer=t.issuer,u.accessTokenAudience=t.tokenAudience,u.accessTokenIssuer=t.tokenIssuer,u.openIdTokenUrl=t.oidcTokenEndpoint;let c=t.oidcJwksUri;t.proxyOidc&&(c="rest/openid/jwks",u.openIdTokenUrl="rest/openid/token"),u.openIdEndSessionUrl=t.oidcEndSessionEndpoint,u.supportsOfflineAccess=t.oidcScopesSupported.includes("offline_access"),t.oracleDomain&&(i.headers["X-OAuth-Identity-Domain-Name"]=t.oracleDomain),u.withOpenIdKeys(c,(function(){if(u.isLoggedIn=u.hasValidIdToken(),u.isLoggedIn)u.setupTokensRefresh(!1,r,a);else if(u.hasValidRefreshToken())u.refreshTokens(r,a);else{const i=r;r=function(){u.isLoggedIn=!0,i(!0)},u.softLogout();const c=u.parseQueryString(n.location.search.substring(1));if(c.code)"code"===t.authFlow?u.getStorageItem("pkce_state")!==c.state?(s.error(o.instant("openid.auth.invalid.pkce.state")),console.log("oidc: PKCE state mismatch "+u.getStorageItem("pkce_state")+" != "+c.state),a()):u.retrieveTokensByCode(c.code,e,r,a):"code_no_pkce"===t.authFlow&&u.retrieveTokensByCode(c.code,e,r,a);else{const t=u.parseQueryString(n.location.pathname.substring(1));t.id_token?u.saveTokens(t,!0,!1,r):a()}}}))},this.authHeaderGraphDB=function(){return"id"===u.getStorageItem("token_type")?"Bearer "+u.getToken("id"):"Bearer "+u.getToken("access")},this.softLogout=function(){u.isLoggedIn=!1,u.setToken("id",null),u.setToken("access",null),u.setToken("refresh",null)},this.hardLogout=function(t){u.softLogout(),u.openIdEndSessionUrl&&(n.location.href=`${u.openIdEndSessionUrl}?client_id=${encodeURIComponent(u.clientId)}&post_logout_redirect_uri=${encodeURIComponent(t)}`)},this.getToken=function(t){return u.getStorageItem(t+"_token")},this.setToken=function(t,e){e?u.setStorageItem(t+"_token",e):u.removeStorageItem(t+"_token")},this.tokenHeader=function(t){const e=u.getToken(t);if(e){try{const t=r.KJUR.jws.JWS.readSafeJSONString(Object(r.b64utoutf8)(e.split(".")[0]));if(t)return t}catch(t){}return{error:o.instant("openid.auth.not.jwt.token",{token:e})}}return{}},this.verifyToken=function(t){const e=u.getToken(t),n=u.tokenHeader(t);if(!n.kid)return"id"!==t?n.error?(console.log(`oidc: token ${t} is not a JWT token (token considered valid)`),!0):(console.log(`oidc: invalid token ${t} (token is empty)`),!1):(console.log("oidc: invalid token id (not a JWT token)"),!1);const i=u.openIdKeys[n.kid];if(!i)return console.log("oidc: no key to verify JWT token (token considered invalid)"),!1;const s=r.KEYUTIL.getKey(i),o={alg:[n.alg],iss:[u.idTokenIssuer]};return"id"===t?(o.aud=[u.idTokenAudience,u.idTokenIssuer],o.nonce=[u.getStorageItem("nonce")]):"access"===t&&(o.aud=[u.accessTokenAudience],o.iss=[u.accessTokenIssuer]),r.KJUR.jws.JWS.verifyJWT(e,s,o)},this.hasValidIdToken=function(){return u.getToken("id")?u.verifyToken("id")?(console.log("oidc: valid id token found"),!0):(console.log("oidc: stale id token"),!1):(console.log("oidc: no id token"),!1)},this.tokenPayload=function(t){const e=u.getToken(t);if(e){try{const t=r.KJUR.jws.JWS.readSafeJSONString(Object(r.b64utoutf8)(e.split(".")[1]));if(t)return t}catch(t){}return{error:o.instant("openid.auth.not.jwt.token",{token:e})}}return{}},this.saveTokens=function(t,n,r,i){(n||t.refresh_token)&&u.setToken("refresh",t.refresh_token),u.setToken("access",t.access_token),u.setToken("id",t.id_token),u.setStorageItem("token_type",u.tokenType),console.log("oidc: saved tokens"),u.setupTokensRefresh(n||r,i),u.removeStorageItem("pkce_state"),u.removeStorageItem("pkce_code_verifier"),n&&e.url("/")},this.retrieveTokensByCode=function(e,n,r,a){const l={grant_type:"authorization_code",client_id:u.clientId,redirect_uri:n,code:e},h=u.getStorageItem("pkce_code_verifier");h&&(l.code_verifier=h);const f={...i.headers,"Content-type":"application/x-www-form-urlencoded; charset=utf-8"};t({method:"POST",url:u.openIdTokenUrl,headers:f,transformRequest:c,data:l}).success((function(t){u.saveTokens(t,!0,!1,r)})).error((function(t){s.error(o.instant("openid.auth.cannot.retrieve.token.msg",{error:getError(t)})),a()}))},this.refreshTokens=function(e,n){if(u.hasValidRefreshToken()){const r={grant_type:"refresh_token",client_id:u.clientId,refresh_token:u.getToken("refresh")},a={...i.headers,"Content-type":"application/x-www-form-urlencoded; charset=utf-8"};t({method:"POST",url:u.openIdTokenUrl,headers:a,transformRequest:c,data:r}).success((function(t){console.log("oidc: refreshed tokens"),u.saveTokens(t,!1,!0,e),u.isLoggedIn=!0})).error((function(t){console.log("oidc: could not refresh tokens"),s.error(o.instant("openid.auth.cannot.refresh.token.msg",{error:getError(t)})),n&&n()}))}else console.log("oidc: refresh requested without a valid refresh token")},this.hasValidRefreshToken=function(){const t=u.tokenPayload("refresh");return!(t.nbf&&1e3*t.nbf-Date.now()>5e3)&&(!(t.exp&&Date.now()-1e3*t.exp>5e3)&&!(!t.iat&&!t.error))},this.setupTokensRefresh=function(t,e,n){if(u.hasValidRefreshToken()){clearTimeout(u.previousTimer);const r=u.tokenPayload("id");if(r.exp>0){const i=1e3*r.exp-Date.now()-6e4;if(!(t||i>1e3))return u.previousTimer=null,console.log("oidc: tokens will refresh now, "+i+"; "+t),void u.refreshTokens(e,n);u.previousTimer=setTimeout((function(){u.refreshTokens(e)}),i),console.log("oidc: tokens will refresh in "+i/1e3+" seconds at "+new Date(Date.now()+i))}}else console.log("oidc: no valid refresh token");e()},this.parseQueryString=function(t){const e={access_token:null,code:null,id_token:null,state:null};if(""===t)return e;return t.split("&").map((function(t){return t.split("=")})).forEach((function(t){e[t[0]]=decodeURIComponent(t[1])})),e},this.generateRandomString=function(){const t=new Uint32Array(28);return window.crypto.getRandomValues(t),Array.from(t,(function(t){return("0"+t.toString(16)).substr(-2)})).join("")},this.pkceChallengeFromVerifier=function(t){const e=new r.KJUR.crypto.MessageDigest({alg:"sha256",prov:"cryptojs"});return Object(r.hextob64u)(e.digestString(t))},this.getScope=function(t){let e="openid"+(u.supportsOfflineAccess?" offline_access":"");return t&&(e+=" "+t),console.log(`oidc: requesting scopes '${e}'`),e},this.setStorageItem=function(t,e){localStorage.setItem(a+t,e)},this.getStorageItem=function(t){return localStorage.getItem(a+t)},this.removeStorageItem=function(t){localStorage.removeItem(a+t)}}])},function(t,e){angular.module("graphdb.framework.rest.security.service",[]).factory("SecurityRestService",n),n.$inject=["$http"];function n(t){return{getUser:function(n){return t.get("rest/security/users/"+e(n))},getAdminUser:function(){return t.get("rest/security/users/admin")},getUsers:function(){return t.get("rest/security/users")},createUser:function(n){return t({method:"POST",url:"rest/security/users/"+e(n.username),data:{password:n.pass,appSettings:n.appSettings,grantedAuthorities:n.grantedAuthorities}})},updateUser:function(n){return t({method:"PUT",url:"rest/security/users/"+e(n.username),data:{password:n.pass,appSettings:n.appSettings,grantedAuthorities:n.grantedAuthorities}})},updateUserData:function(n){return t({method:"PATCH",url:"rest/security/users/"+e(n.username),data:{password:n.pass,appSettings:n.appSettings}})},deleteUser:function(n){return t.delete("rest/security/users/"+e(n))},getFreeAccess:function(){return t.get("rest/security/free-access")},setFreeAccess:function(e){return t.post("rest/security/free-access",e)},getSecurityConfig:function(){return t.get("rest/security/all")},toggleSecurity:function(e){return t.post("rest/security",e?"true":"false")},getRoles:function(){return t.get("rest/roles")},getRolesMapping:function(e){return t.get("rest/roles/mapping",{params:e})},getAuthenticatedUser:function(){return t.get("rest/security/authenticated-user")}};function e(t){return encodeURIComponent(t).replace(/[.!'()*]/g,(function(t){return"%"+t.charCodeAt(0).toString(16)}))}}},function(t,e){!function(t){t.getError=function(t,e,n){if(angular.isObject(t)&&t.status&&t.data)return getError(t.data,e,n);if(e&&403===e)return"Access is restricted";if(t){let r="Generic error";if(angular.isString(t))-1===t.indexOf("<html>")&&(r=t,r=r.replace(/^(([a-z0-9_]+\.)+[a-zA-Z0-9_]+: )+/,""));else if(angular.isObject(t)){if("message"in t&&(r=t.message),"error"in t&&(r=t.error.message),"responseJSON"in t&&"message"in t.responseJSON)return getError(t.responseJSON,e,n);"responseText"in t&&(r=t.responseText)}return n>0&&r.length>n&&(r=r.substr(0,n)+"..."),r}return"There is an error"}}(window)},function(t,e,n){"use strict";n.r(e);n(4),n(17),n(18),n(19),n(14),n(8),n(9),n(15),n(34),n(35),n(12),n(10),n(28);var r=n(2),i=(n(5),n(13),n(29),n(0)),s=(n(20),n(30),n(7));function o(t,e,n,r,i,s,o,a,u,c){function l(){t.getActiveRepository()&&(t.getNamespacesPromise=c.getNamespaces(t.getActiveRepository()).success((function(){h()})),t.getActiveRepositorySize())}function h(){s.isLicenseValid()&&(t.getAutocompletePromise=o.checkAutocompleteStatus())}t.doClear=!1,t.getActiveRepositorySize=function(){const e=r.getActiveRepositoryObject();e&&(t.activeRepositorySizeError=void 0,u.getSize(e).then((function(e){t.activeRepositorySize=e.data})).catch((function(e){t.activeRepositorySizeError=e.data.message})))},t.$on("autocompleteStatus",(function(){h()})),t.$on("repositoryIsSet",l),t.$on("$routeChangeSuccess",(function(t,n,r){r&&(i.isAuthenticated()||i.isFreeAccessEnabled()?l():e.redirectToLogin())})),t.onKeyDown=function(e){27===e.keyCode&&(t.doClear=!0)}}function a(t,e,n,o,a,u,c,l,h,f,p,d,g,m,v,y,b,w,x,S,E,F,A,C,D){t.descr=F.instant("main.gdb.description"),t.documentation="",t.menu=e,t.tutorialState=1!==S.get(E.TUTORIAL_STATE),t.userLoggedIn=!1,t.embedded=u.search().embedded,t.productInfo=f,t.guidePaused="true"===S.get(s.GUIDE_PAUSE);function I(){$(window).width()<=720?($(".container-fluid.main-container").addClass("expanded"),$(".main-menu").addClass("collapsed"),$(".main-menu .icon-caret-left").toggleClass("icon-caret-left").toggleClass("icon-caret-right"),$(".toggle-menu").hide()):$(window).width()>720&&"collapsedMenu"===S.get(E.MENU_STATE)?($(".container-fluid.main-container").addClass("expanded"),$(".main-menu").addClass("collapsed"),$(".toggle-menu").show(),$(".main-menu .icon-caret-left").toggleClass("icon-caret-left").toggleClass("icon-caret-right")):($(".container-fluid.main-container").removeClass("expanded"),$(".main-menu").removeClass("collapsed"),$(".toggle-menu").show(),$(".main-menu .icon-caret-right").toggleClass("icon-caret-right").toggleClass("icon-caret-left"))}!function(){const e=new Date;t.currentYear=e.getFullYear(),t.previousYear=2002}(),$("#repositorySelectDropdown").on("hide.bs.dropdown",(function(t){D.isActive()&&$("#repositorySelectDropdown.autoCloseOff").length>0&&t.preventDefault()})),t.$on("$routeChangeSuccess",(function(e,n,r){t.clicked=!1,$(".menu-element-root").removeClass("active"),p((function(){$(".menu-element.open a.menu-element-root").addClass("active"),$(".main-menu.collapsed .menu-element.open .menu-element-root").addClass("active")}),400),r&&l.checkLicenseStatus()})),t.resumeGuide=function(){h.$broadcast("guideResume")},h.$on("guideReset",(function(){t.guidePaused=!1,h.guidePaused=!1})),h.$on("guideStarted",(function(){t.guidePaused=!1,h.guidePaused=!1})),h.$on("guidePaused",(function(){t.guidePaused=!0,h.guidePaused=!0})),h.$on("$translateChangeSuccess",(function(){t.menu.forEach((function(t){t.label=F.instant(t.labelKey),t.children&&t.children.forEach((function(t){t.label=F.instant(t.labelKey)}))})),h.helpInfo=x.trustAsHtml(Object(i.decodeHTML)(F.instant(h.helpInfo))),h.title=Object(i.decodeHTML)(F.instant(h.title)),t.initTutorial()})),t.checkMenu=function(){return $(".main-menu").hasClass("collapsed")},t.copyToClipboard=function(t){d.openCopyToClipboardModal(t)},t.goToAddRepo=function(){u.path("/repository/create").search({previous:"home"})},t.goToEditRepo=function(t){u.path("repository/edit/"+t.id).search({previous:"home",location:t.location})},t.getLocationFromUri=function(t){return c.getLocationFromUri(t)},t.$on("$locationChangeSuccess",(function(){t.showFooter="/"===u.url()})),t.$on("repositoryIsSet",(function(){t.setRestricted(),S.clearClassHieararchyState()})),t.graphdbVersion=t.engineVersion=f.productVersion,t.workbenchVersion=f.Workbench,t.connectorsVersion=f.connectors,t.sesameVersion=f.sesame,t.select=function(e,n,r){$(".main-menu").hasClass("collapsed")?$(n.target).parents(".menu-element").children(".menu-element-root").hasClass("active")?(t.selected=e,t.clicked=!r):(!$(n.target).parents(".menu-element").hasClass("open")&&r?t.clicked=!0:t.clicked=!r,t.selected===e?t.selected=-1:t.selected=e):(!$(n.target).parents(".menu-element").hasClass("open")&&r?t.clicked=!0:t.clicked=!r,0!==$(n.target).parent(".menu-element").find(".sub-menu").length?($(n.target).parents(".menu-element").children(".menu-element-root").hasClass("active")?$(".sub-menu li.active").parents(".menu-element").children(".menu-element-root").removeClass("active"):$(".sub-menu li.active").parents(".menu-element").children(".menu-element-root").addClass("active"),t.selected===e?t.selected=-1:t.selected=e):(p((function(){$(n.target).parents(".menu-element").children(".menu-element-root").addClass("active")}),50),t.selected=e))},$("body").bind("click",(function(e){!$(e.target).parents(".main-menu").length&&$(".main-menu").hasClass("collapsed")&&(t.clicked=!1,t.selected=-1)})),t.isCurrentPath=function(t){return u.path()==="/"+t},t.isCurrentSubmenuChildPath=function(e){return 0!==e.children.length&&e.children.some((function(e){return t.isCurrentPath(e.href)}))},"/"===u.path()?t.selected=-1:(p((function(){const e=u.path().replace("/",""),n=$('a[href^="'+e+'"]');t.selected=n.closest(".menu-element").index()-1}),200),t.isCurrentPath(u.path())),t.popoverTemplate="js/angular/templates/repositorySize.html",t.securityEnabled=!0,t.isSecurityEnabled=function(){return n.isSecurityEnabled()},t.isFreeAccessEnabled=function(){return n.isFreeAccessEnabled()},t.hasExternalAuthUser=function(){return n.hasExternalAuthUser()},t.isDefaultAuthEnabled=function(){return n.isDefaultAuthEnabled()},t.isUserLoggedIn=function(){return t.userLoggedIn},t.hasActiveLocation=function(){return c.hasActiveLocation()},t.getActiveLocation=function(){return c.getActiveLocation()},t.isLoadingLocation=function(){return c.isLoadingLocation()},t.getRepositories=function(){return c.getRepositories()},t.getReadableRepositories=function(){return c.getReadableRepositories()},t.getWritableRepositories=function(){return c.getWritableRepositories()},t.getActiveRepository=function(){return c.getActiveRepository()},t.canWriteRepoInLocation=function(t){return n.canWriteRepo(t)},t.canWriteActiveRepo=function(t){const e=c.getActiveRepositoryObject();return!!e&&(n.canWriteRepo(e)&&("SYSTEM"!==e.id||!t))},t.getActiveRepositoryObject=function(){return c.getActiveRepositoryObject()},t.getActiveRepositoryShortLocation=function(){const t=c.getActiveRepositoryObject();if(t){const e=t.location;if(e)return"@"+A.shortenIri(e)}return""},t.isActiveRepoOntopType=function(){return c.isActiveRepoOntopType()},t.isActiveRepoFedXType=function(){return c.isActiveRepoFedXType()},t.isLicenseValid=function(){return l.isLicenseValid()},t.setAttrs=function(e){t.attrs=e},t.setRestricted=function(){t.attrs&&(t.isRestricted=t.attrs.hasOwnProperty("license")&&!l.isLicenseValid()||t.attrs.hasOwnProperty("write")&&t.isSecurityEnabled()&&!t.canWriteActiveRepo()||t.attrs.hasOwnProperty("ontop")&&t.isActiveRepoOntopType()||t.attrs.hasOwnProperty("fedx")&&t.isActiveRepoFedXType())},t.toHumanReadableType=function(t){switch(t){case"graphdb":return"Graphdb";case"system":return"System";case"ontop":return"Ontop";case"fedx":return"FedX";default:return"Unknown"}},t.setRepository=function(t){c.setRepository(t)},t.logout=function(){n.clearAuthentication(),a.success("Signed out"),n.freeAccess?c.resetActiveRepository():n.isSecurityEnabled()&&h.redirectToLogin()},t.isAdmin=function(){return t.hasRole(r.UserRole.ROLE_ADMIN)},t.isUser=function(){return t.hasRole(r.UserRole.ROLE_USER)},t.hasRole=function(t){return!!angular.isUndefined(t)||n.hasRole(t)},t.hasPermission=function(){return h.hasPermission()},t.canReadRepo=function(t){return n.canReadRepo(t)},t.checkForWrite=function(t,e){return n.checkForWrite(t,e)},t.setPopoverRepo=function(e){t.popoverRepo=e},t.isRepoActive=function(t){return c.isRepoActive(t)},t.getRepositorySize=function(){t.repositorySize={},t.popoverRepo&&(t.repositorySize.loading=!0,y.getSize(t.popoverRepo).then((function(e){t.repositorySize=e.data})))},t.getDegradedReason=function(){return c.getDegradedReason()},t.canManageRepositories=function(){return n.hasRole(r.UserRole.ROLE_REPO_MANAGER)&&!c.getDegradedReason()},t.getSavedQueries=function(){w.getSavedQueries().success((function(e){t.sampleQueries=e})).error((function(t){const e=getError(t);a.error(e,F.instant("query.editor.get.saved.queries.error"))}))},t.goToSparqlEditor=function(t){u.path("/sparql").search({savedQueryName:t.name,owner:t.owner,execute:!0})},t.declineTutorial=function(){S.set(E.TUTORIAL_STATE,1),t.tutorialState=!1},t.showTutorial=function(){t.tutorialState=!0,S.remove(E.TUTORIAL_STATE)},t.initTutorial=function(){if(!t.tutorialState&&"/"!==u.path())return;t.tutorialInfo=[{title:F.instant("main.info.title.welcome.page"),info:"<p>"+Object(i.decodeHTML)(F.instant("main.info.welcome.page"))+"</p><p>"+Object(i.decodeHTML)(F.instant("main.info.welcome.page.guides"))+"</p><p>"+Object(i.decodeHTML)(F.instant("main.info.welcome.page.footer"))+"</p>"},{title:F.instant("main.info.title.create.repo.page"),info:Object(i.decodeHTML)(F.instant("main.info.create.repo.page",{link:'<a href="https://graphdb.ontotext.com/documentation/'+f.productShortVersion+'/configuring-a-repository.html" target="_blank">'}))},{title:F.instant("main.info.title.load.sample.dataset"),info:F.instant("main.info.load.sample.dataset")},{title:F.instant("main.info.title.run.sparql.query"),info:Object(i.decodeHTML)(F.instant("main.info.run.sparql.query"))},{title:F.instant("menu.rest.api.label"),info:Object(i.decodeHTML)(F.instant("main.info.rest.api"))}],t.activePage=0,$(".pages-wrapper .page-slide").css("opacity",100);const e=$(".main-container")[0].offsetWidth+200;p((function(){const n=$(".pages-wrapper .page-slide");n.css("left",e+"px"),$(n[t.activePage]).css("left","0px"),$($(".btn-toolbar.pull-right .btn-group .btn")[0]).focus()}),50)},t.getTutorialPageHtml=function(t){return x.trustAsHtml(t.info)},t.checkSubMenuPosition=function(t){0===t?$(".main-menu.collapsed .sub-menu").removeClass("align-bottom"):$(window).height()<735?$(".main-menu.collapsed .sub-menu").addClass("align-bottom"):$(".main-menu.collapsed .sub-menu").removeClass("align-bottom")},I(),$(window).resize((function(){angular.isDefined(t.menuState)?$(window).width()<=720?($(".container-fluid.main-container").addClass("expanded"),$(".main-menu").addClass("collapsed"),$(".toggle-menu").hide(),$(".main-menu .icon-caret-left").toggleClass("icon-caret-left").toggleClass("icon-caret-right")):$(window).width()>720&&t.menuState?$(".toggle-menu").show():($(".container-fluid.main-container").removeClass("expanded"),$(".main-menu").removeClass("collapsed"),$(".toggle-menu").show(),$(".main-menu .icon-caret-right").toggleClass("icon-caret-right").toggleClass("icon-caret-left")):I(),t.tutorialState&&"/"===u.path()&&t.initTutorial(),$(window).height()<735?($(".sub-menu").addClass("align-bottom"),$(".main-menu.collapsed li:nth-child(2) .sub-menu").removeClass("align-bottom")):$(".sub-menu").removeClass("align-bottom")})),t.slideToPage=function(e){const n=$(".main-container")[0].offsetWidth,r=$(".pages-wrapper .page-slide");r.css("opacity","0").delay(200).css("left",n+"px"),t.activePage=e,$(r[t.activePage]).css("opacity","100").css("left","0px")},t.slideNext=function(){let e=++t.activePage;e>=t.tutorialInfo.length&&(e=0),t.slideToPage(e),$($(".btn-toolbar.pull-right .btn-group .btn")[t.activePage]).focus()},t.toggleNavigation=function(){const e=$(".main-menu"),n=$(".sub-menu li.active");if(e.hasClass("collapsed"))n.parents(".menu-element").hasClass("open")?n.parents(".menu-element").children(".menu-element-root").removeClass("active"):n.parents(".menu-element").children(".menu-element-root").addClass("active"),$(".container-fluid.main-container").removeClass("expanded"),e.removeClass("collapsed"),$(".main-menu .icon-caret-right").toggleClass("icon-caret-right").toggleClass("icon-caret-left"),h.$broadcast("onToggleNavWidth",!1);else{n.parents(".menu-element").children(".menu-element-root").addClass("active");const r=$(".menu-element");r.hasClass("open")&&(r.removeClass("open"),t.clicked=!1,t.selected=-1),$(".container-fluid.main-container").addClass("expanded"),e.addClass("collapsed"),$(".main-menu .icon-caret-left").toggleClass("icon-caret-left").toggleClass("icon-caret-right"),$(".main-menu.collapsed .menu-element.clicked").removeClass("clicked"),h.$broadcast("onToggleNavWidth",!0)}},t.$on("onToggleNavWidth",(function(e,n){if(t.menuState=n,n?S.set(E.MENU_STATE,"collapsedMenu"):S.set(E.MENU_STATE,"expandedMenu"),t.tutorialState&&"/"===u.path()){const e=$(".pages-wrapper")[0].offsetWidth+200;p((function(){const n=$(".pages-wrapper .page-slide");n.css("left",e+"px"),$(n[t.activePage]).css("left","0px")}),50)}})),t.numberOfActiveImports=0,t.getNumberOfActiveImportsRunning=!1,t.getNumberOfActiveImports=function(){t.getNumberOfActiveImportsRunning||t.canWriteActiveRepo()&&"SYSTEM"!==t.getActiveRepository()&&(t.getNumberOfActiveImportsRunning=!0,o({method:"GET",url:"rest/repositories/"+t.getActiveRepository()+"/import/active",timeout:1e4}).success((function(e){t.numberOfActiveImports=e})).finally((function(){t.getNumberOfActiveImportsRunning=!1})))},t.getQueriesRunning=!1,t.skipGetQueriesTimes=0;const R=function(){let t=0,e=1;return{next:function(){const n=e;return e=t+e,t=n,n},reset:function(){t=0,e=1}}}();t.getQueries=function(){t.getQueriesRunning||(t.skipGetQueriesTimes>0?t.skipGetQueriesTimes--:c.getActiveRepository()&&"SYSTEM"!==c.getActiveRepository()&&!c.isActiveRepoOntopType()&&t.hasRole(r.UserRole.ROLE_USER)?(t.getQueriesRunning=!0,b.getQueryCount().success((function(e){t.queryCount=e,R.reset()})).error((function(){t.queryCount=0,t.skipGetQueriesTimes=R.next()})).finally((function(){t.getQueriesRunning=!1}))):t.queryCount=0)};const T=g((function(){t.getDegradedReason()||(t.getQueries(),t.getNumberOfActiveImports())}),2e3);t.$on("$destroy",(function(){g.cancel(T)})),n.securityInitialized&&t.getSavedQueries(),t.$on("securityInit",(function(e,r,i,s){t.securityEnabled=r,t.userLoggedIn=i,!r||i||s?(C.when(n.getPrincipal()).then(e=>{t.principal=e,t.isIgnoreSharedQueries=e&&e.appSettings.IGNORE_SHARED_QUERIES}),l.checkLicenseStatus(),t.getSavedQueries()):"/login"!==u.path()&&h.redirectToLogin()})),t.isEnterprise=function(){return"enterprise"===t.getProductType()},t.isFreeEdition=function(){return"free"===t.getProductType()},t.checkEdition=function(e){return null==e||_.indexOf(e,t.getProductType())>=0},t.showLicense=function(){return l.showLicense},t.getLicense=function(){return l.license},t.isLicenseHardcoded=function(){return l.isLicenseHardcoded},t.getProductType=function(){return l.productType},t.getProductTypeHuman=function(){return l.productTypeHuman},t.getHumanReadableSeconds=function(t,e){const n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60);let s;s=e&&t<10?t<1?_.ceil(t%60,1):_.round(t%60,1):_.round(t%60,0);let o="";return n&&(o+=n+"d "),(n||r)&&(o+=r+"h "),(n||r||i)&&(o+=i+"m "),o+=s+"s",o.replace(/( 0[a-z])+$/,"")},t.getHumanReadableTimestamp=function(t){const e=Date.now(),n=(e-t)/1e3;if(n<60)return F.instant("timestamp.moments.ago");if(n<600)return F.instant("timestamp.minutes.ago");{const r=new Date(e),i=new Date(t);if(r.getYear()===i.getYear()&&r.getMonth()===i.getMonth()&&r.getDate()===i.getDate())return m("date")(t,"'"+F.instant("timestamp.today.at")+"' HH:mm");if(n<86400)return m("date")(t,"'"+F.instant("timestamp.yesterday.at")+"' HH:mm")}return m("date")(t,"'"+F.instant("timestamp.on")+"' yyyy-MM-dd '"+F.instant("timestamp.at")+"' HH:mm")}}function u(t,e,n){t.getRepositorySize=function(e){n.getSize(e).then((function(e){t.size=e.data}))}}angular.module("graphdb.workbench.se.controllers",["graphdb.framework.core.services.jwtauth","graphdb.framework.core.services.repositories","graphdb.framework.core.services.licenseService","ngCookies","ngFileUpload","graphdb.framework.core","graphdb.framework.core.controllers","graphdb.framework.core.directives","graphdb.framework.rest.license.service","graphdb.framework.rest.autocomplete.service","graphdb.framework.rest.repositories.service","graphdb.framework.rest.sparql.service","graphdb.framework.rest.autocomplete.service","graphdb.framework.rest.plugins.service","graphdb.framework.rest.monitoring.service","graphdb.framework.rest.rdf4j.repositories.service","graphdb.framework.utils.localstorageadapter","graphdb.framework.core.services.autocompleteStatus","graphdb.framework.utils.uriutils","graphdb.framework.guides.directives","graphdb.framework.guides.services"]).controller("mainCtrl",a).controller("homeCtrl",o).controller("repositorySizeCtrl",u),o.$inject=["$scope","$rootScope","$http","$repositories","$jwtAuth","$licenseService","AutocompleteRestService","LicenseRestService","RepositoriesRestService","RDF4JRepositoriesRestService"],a.$inject=["$scope","$menuItems","$jwtAuth","$http","toastr","$location","$repositories","$licenseService","$rootScope","productInfo","$timeout","ModalService","$interval","$filter","LicenseRestService","RepositoriesRestService","MonitoringRestService","SparqlRestService","$sce","LocalStorageAdapter","LSKeys","$translate","UriUtils","$q","GuidesService"],u.$inject=["$scope","$http","RepositoriesRestService"]},function(t,e){angular.module("graphdb.framework.rest.locations.service",[]).factory("LocationsRestService",n),n.$inject=["$http"];function n(t){return{getLocations:function(e){return t.get("rest/locations",{timeout:e?e.promise:null})},addLocation:function(e){return t.post("rest/locations",e)},editLocation:function(e){return t.put("rest/locations",e)},deleteLocation:function(e){return t.delete("rest/locations?uri="+e)},getActiveLocation:function(){return t({method:"GET",url:"rest/locations/active",noCancelOnRouteChange:!0})},setDefaultRepository:function(e){return t({url:"rest/locations/active/default-repository",method:"POST",data:{defaultRepository:e}})},getLocationRpcAddress:function(e){return t.get("rest/info/rpc-address",{params:{location:e}})}}}},function(t,e){angular.module("graphdb.framework.core.services.licenseService",[]).service("$licenseService",["$rootScope","LicenseRestService","$translate",function(t,e,n){const r=this;this.checkLicenseStatus=function(){r.loadingLicense=!0,e.getHardcodedLicense().success((function(t){r.isLicenseHardcoded="true"===t})).error((function(){r.isLicenseHardcoded=!0})).then((function(){e.getLicenseInfo().then((function(t){r.license=t.data,r.showLicense=!0,r.loadingLicense=!1,i(r.license)}),(function(){r.license={message:n.instant("no.license.set.msg"),valid:!1},r.showLicense=!0,r.loadingLicense=!1,i(r.license)}))}))};const i=function(t){r.productType=t.productType,"standard"===r.productType?r.productTypeHuman="Standard":"enterprise"===r.productType?r.productTypeHuman="Enterprise":"free"===r.productType?r.productTypeHuman="Free":"graphdb"===r.productType&&(r.productTypeHuman="GraphDB")};this.checkLicenseStatus(),this.isLicenseValid=function(){return r.license&&r.license.valid}}])},function(t,e){angular.module("graphdb.framework.core.services.autocompleteStatus",[]).service("$autocompleteStatus",["$rootScope","AutocompleteRestService","LocalStorageAdapter","LSKeys","$repositories",function(t,e,n,r,i){const s=this;this.setAutocompleteStatus=function(e){n.set(r.AUTOCOMPLETE_ENABLED,e),t.$broadcast("autocompleteStatus",e)},t.$watch((function(){return n.get(r.AUTOCOMPLETE_ENABLED)}),(function(t){s.setAutocompleteStatus(t)}),!0),t.$on("repositoryIsSet",(function(){!i.getActiveRepository()||i.isActiveRepoOntopType()||i.isActiveRepoFedXType()||e.checkAutocompleteStatus().success((function(t){s.setAutocompleteStatus(t)}))}))}])},function(t,e){angular.module("graphdb.framework.guides.directives",[]).directive("guideSelector",(function(){return{}}))},function(t,e){
|
|
29
29
|
/**
|
|
30
30
|
* angular-cancel-on-navigate - AngularJS module that cancels HTTP requests on location change (navigation)
|
|
31
31
|
* @version v0.1.0
|