solid-ui 2.4.27 → 2.4.28

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.
Files changed (91) hide show
  1. package/README.md +6 -1
  2. package/dist/670.solid-ui.min.js +1 -0
  3. package/dist/805.solid-ui.min.js +3 -0
  4. package/dist/805.solid-ui.min.js.LICENSE.txt +58 -0
  5. package/dist/805.solid-ui.min.js.map +1 -0
  6. package/dist/_2b19.solid-ui.js +14 -0
  7. package/dist/_2b19.solid-ui.js.map +1 -0
  8. package/dist/index.html +1 -9
  9. package/dist/{main.js → solid-ui.js} +7906 -20465
  10. package/dist/solid-ui.js.map +1 -0
  11. package/dist/solid-ui.min.js +3 -0
  12. package/dist/solid-ui.min.js.LICENSE.txt +54 -0
  13. package/dist/solid-ui.min.js.map +1 -0
  14. package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js +12134 -0
  15. package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js.map +1 -0
  16. package/lib/acl/access-controller.d.ts +2 -3
  17. package/lib/acl/access-controller.d.ts.map +1 -1
  18. package/lib/acl/access-controller.js +17 -15
  19. package/lib/acl/access-controller.js.map +1 -1
  20. package/lib/acl/access-groups.d.ts.map +1 -1
  21. package/lib/acl/access-groups.js +78 -8
  22. package/lib/acl/access-groups.js.map +1 -1
  23. package/lib/acl/acl-control.d.ts.map +1 -1
  24. package/lib/acl/acl-control.js +10 -11
  25. package/lib/acl/acl-control.js.map +1 -1
  26. package/lib/acl/acl.d.ts +1 -1
  27. package/lib/acl/acl.js +1 -1
  28. package/lib/acl/acl.js.map +1 -1
  29. package/lib/acl/add-agent-buttons.d.ts.map +1 -1
  30. package/lib/acl/add-agent-buttons.js +4 -3
  31. package/lib/acl/add-agent-buttons.js.map +1 -1
  32. package/lib/chat/chatLogic.js +63 -26
  33. package/lib/chat/chatLogic.js.map +1 -1
  34. package/lib/chat/keys.d.ts +13 -0
  35. package/lib/chat/keys.d.ts.map +1 -0
  36. package/lib/chat/keys.js +233 -0
  37. package/lib/chat/keys.js.map +1 -0
  38. package/lib/chat/message.js +67 -8
  39. package/lib/chat/message.js.map +1 -1
  40. package/lib/chat/signature.d.ts +24 -0
  41. package/lib/chat/signature.d.ts.map +1 -0
  42. package/lib/chat/signature.js +112 -0
  43. package/lib/chat/signature.js.map +1 -0
  44. package/lib/footer/index.d.ts.map +1 -1
  45. package/lib/footer/index.js +5 -1
  46. package/lib/footer/index.js.map +1 -1
  47. package/lib/header/index.d.ts.map +1 -1
  48. package/lib/header/index.js +41 -20
  49. package/lib/header/index.js.map +1 -1
  50. package/lib/login/login.d.ts.map +1 -1
  51. package/lib/login/login.js +39 -37
  52. package/lib/login/login.js.map +1 -1
  53. package/lib/style.js +60 -2
  54. package/lib/style.js.map +1 -1
  55. package/lib/utils/headerFooterHelpers.d.ts +0 -4
  56. package/lib/utils/headerFooterHelpers.d.ts.map +1 -1
  57. package/lib/utils/headerFooterHelpers.js +0 -27
  58. package/lib/utils/headerFooterHelpers.js.map +1 -1
  59. package/lib/utils/keyHelpers/accessData.d.ts +10 -0
  60. package/lib/utils/keyHelpers/accessData.d.ts.map +1 -0
  61. package/lib/utils/keyHelpers/accessData.js +232 -0
  62. package/lib/utils/keyHelpers/accessData.js.map +1 -0
  63. package/lib/utils/keyHelpers/acl.d.ts +20 -0
  64. package/lib/utils/keyHelpers/acl.d.ts.map +1 -0
  65. package/lib/utils/keyHelpers/acl.js +93 -0
  66. package/lib/utils/keyHelpers/acl.js.map +1 -0
  67. package/lib/versionInfo.js +6 -6
  68. package/lib/versionInfo.js.map +1 -1
  69. package/lib/widgets/buttons.d.ts.map +1 -1
  70. package/lib/widgets/buttons.js +43 -49
  71. package/lib/widgets/buttons.js.map +1 -1
  72. package/lib/widgets/forms.js +8 -4
  73. package/lib/widgets/forms.js.map +1 -1
  74. package/package.json +13 -10
  75. package/dist/main.js.map +0 -1
  76. package/lib/acl/styles.d.ts +0 -90
  77. package/lib/acl/styles.d.ts.map +0 -1
  78. package/lib/acl/styles.js +0 -98
  79. package/lib/acl/styles.js.map +0 -1
  80. package/lib/footer/styleMap.d.ts +0 -8
  81. package/lib/footer/styleMap.d.ts.map +0 -1
  82. package/lib/footer/styleMap.js +0 -15
  83. package/lib/footer/styleMap.js.map +0 -1
  84. package/lib/header/styleMap.d.ts +0 -117
  85. package/lib/header/styleMap.d.ts.map +0 -1
  86. package/lib/header/styleMap.js +0 -139
  87. package/lib/header/styleMap.js.map +0 -1
  88. package/lib/jss/index.d.ts +0 -20
  89. package/lib/jss/index.d.ts.map +0 -1
  90. package/lib/jss/index.js +0 -47
  91. package/lib/jss/index.js.map +0 -1
@@ -0,0 +1,3 @@
1
+ /*! For license information please see solid-ui.min.js.LICENSE.txt */
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["solid-ui"]=t():e["solid-ui"]=t()}(self,(()=>(()=>{var e,t,r,n,i={3319:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.AccessController=void 0;var o=n(r(4687)),a=n(r(7156)),s=n(r(6690)),c=n(r(9728)),u=n(r(8416)),l=r(3422),d=r(6022),p=r(5678),f=r(3723),h=y(r(5666)),m=y(r(4433)),g=y(r(2853));function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(v=function(e){return e?r:t})(e)}function y(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=v(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}var b=function(){function e(t,r,n,i,o,a,c,d,f,h,m,v){if((0,s.default)(this,e),this.subject=t,this.noun=r,this.context=n,this.statusElement=i,this.targetIsProtected=o,this.targetDoc=a,this.targetACLDoc=c,this.defaultHolder=d,this.defaultACLDoc=f,this.prospectiveDefaultHolder=h,this.store=m,this.dom=v,(0,u.default)(this,"mainCombo",void 0),(0,u.default)(this,"defaultsCombo",void 0),(0,u.default)(this,"isContainer",void 0),(0,u.default)(this,"defaultsDiffer",void 0),(0,u.default)(this,"rootElement",void 0),(0,u.default)(this,"isUsingDefaults",void 0),this.rootElement=v.createElement("div"),this.rootElement.setAttribute("style",g.aclGroupContent),this.isContainer="/"===a.uri.slice(-1),d&&f){this.isUsingDefaults=!0;var y=(0,l.adoptACLDefault)(this.targetDoc,c,d,f);this.mainCombo=new p.AccessGroups(a,c,this,y,{defaults:this.isContainer}),this.defaultsCombo=null,this.defaultsDiffer=!1}else this.isUsingDefaults=!1,this.mainCombo=new p.AccessGroups(a,c,this,m),this.defaultsCombo=new p.AccessGroups(a,c,this,m,{defaults:this.isContainer}),this.defaultsDiffer=!(0,l.sameACL)(this.mainCombo.aclMap,this.defaultsCombo.aclMap)}var t,r,n,i;return(0,c.default)(e,[{key:"isEditable",get:function(){return!this.isUsingDefaults}},{key:"render",value:function(){if(this.rootElement.innerHTML="",this.isUsingDefaults){if(this.renderStatus("The sharing for this ".concat(this.noun," is the default for folder ")),this.defaultHolder){var e=this.statusElement.appendChild(this.dom.createElement("a"));e.href=this.defaultHolder.uri,e.innerText=(0,f.shortNameForFolder)(this.defaultHolder)}}else!this.defaultsDiffer&&this.isContainer?this.renderStatus("This is also the default for things in this folder."):this.renderStatus("");return this.rootElement.appendChild(this.mainCombo.render()),this.defaultsCombo&&this.defaultsDiffer?(this.rootElement.appendChild(this.renderRemoveDefaultsController()),this.rootElement.appendChild(this.defaultsCombo.render())):this.isEditable&&this.isContainer&&this.rootElement.appendChild(this.renderAddDefaultsController()),!this.targetIsProtected&&this.isUsingDefaults?this.rootElement.appendChild(this.renderAddAclsController()):this.targetIsProtected||this.rootElement.appendChild(this.renderRemoveAclsController()),this.rootElement}},{key:"renderRemoveAclsController",value:function(){var e=this,t=this.dom.createElement("button");return t.innerText="Remove custom sharing settings for this ".concat(this.noun," -- just use default").concat(this.prospectiveDefaultHolder?" for ".concat(h.label(this.prospectiveDefaultHolder)):""),t.setAttribute("style",g.bigButton),t.addEventListener("click",(function(){return e.removeAcls().then((function(){return e.render()})).catch((function(t){return e.renderStatus(t)}))})),t}},{key:"renderAddAclsController",value:function(){var e=this,t=this.dom.createElement("button");return t.innerText="Set specific sharing for this ".concat(this.noun),t.setAttribute("style",g.bigButton),t.addEventListener("click",(function(){return e.addAcls().then((function(){return e.render()})).catch((function(t){return e.renderStatus(t)}))})),t}},{key:"renderAddDefaultsController",value:function(){var e=this,t=this.dom.createElement("div");t.setAttribute("style",g.defaultsController);var r=t.appendChild(this.dom.createElement("div"));r.innerText="Sharing for things within the folder currently tracks sharing for the folder.",r.setAttribute("style",g.defaultsControllerNotice);var n=t.appendChild(this.dom.createElement("button"));return n.innerText="Set the sharing of folder contents separately from the sharing for the folder",n.setAttribute("style",g.bigButton),n.addEventListener("click",(function(){return e.addDefaults().then((function(){return e.render()}))})),t}},{key:"renderRemoveDefaultsController",value:function(){var e=this,t=this.dom.createElement("div");t.setAttribute("style",g.defaultsController);var r=t.appendChild(this.dom.createElement("div"));r.innerText="Access to things within this folder:",r.setAttribute("style",g.defaultsControllerNotice);var n=t.appendChild(this.dom.createElement("button"));return n.innerText="Set default for folder contents to just track the sharing for the folder",n.setAttribute("style",g.bigButton),n.addEventListener("click",(function(){return e.removeDefaults().then((function(){return e.render()})).catch((function(t){return e.renderStatus(t)}))})),t}},{key:"renderTemporaryStatus",value:function(e){var t=this;this.statusElement.setAttribute("style",g.aclControlBoxStatusRevealed),this.statusElement.innerText=e,this.statusElement.setAttribute("style",g.temporaryStatusInit),setTimeout((function(){t.statusElement.setAttribute("style",g.temporaryStatusEnd)})),setTimeout((function(){t.statusElement.innerText=""}),5e3)}},{key:"renderStatus",value:function(e){e||this.statusElement.setAttribute("style",g.aclControlBoxStatusRevealed),this.statusElement.innerText=e}},{key:"addAcls",value:(i=(0,a.default)(o.default.mark((function e(){var t,r,n=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.defaultHolder&&this.defaultACLDoc){e.next=4;break}return t="Unable to find defaults to copy",m.error(t),e.abrupt("return",Promise.reject(t));case 4:return(0,l.adoptACLDefault)(this.targetDoc,this.targetACLDoc,this.defaultHolder,this.defaultACLDoc).statements.forEach((function(e){return n.store.add(e.subject,e.predicate,e.object,n.targetACLDoc)})),e.prev=6,e.next=9,this.store.fetcher.putBack(this.targetACLDoc);case 9:return this.isUsingDefaults=!1,e.abrupt("return",Promise.resolve());case 13:return e.prev=13,e.t0=e.catch(6),r=" Error writing back access control file! ".concat(e.t0),m.error(r),e.abrupt("return",Promise.reject(r));case 18:case"end":return e.stop()}}),e,this,[[6,13]])}))),function(){return i.apply(this,arguments)})},{key:"addDefaults",value:(n=(0,a.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.defaultsCombo=new p.AccessGroups(this.targetDoc,this.targetACLDoc,this,this.store,{defaults:!0}),this.defaultsDiffer=!0;case 2:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"removeAcls",value:(r=(0,a.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.store.fetcher.delete(this.targetACLDoc.uri,{});case 3:return this.isUsingDefaults=!0,e.prev=4,e.next=7,(0,l.getProspectiveHolder)(this.targetDoc.uri);case 7:this.prospectiveDefaultHolder=e.sent,e.next=13;break;case 10:e.prev=10,e.t0=e.catch(4),m.warn(e.t0);case 13:e.next=20;break;case 15:return e.prev=15,e.t1=e.catch(0),t="Error deleting access control file: ".concat(this.targetACLDoc,": ").concat(e.t1),m.error(t),e.abrupt("return",Promise.reject(t));case 20:case"end":return e.stop()}}),e,this,[[0,15],[4,10]])}))),function(){return r.apply(this,arguments)})},{key:"removeDefaults",value:(t=(0,a.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.defaultsCombo,e.prev=1,this.defaultsCombo=null,this.defaultsDiffer=!1,e.next=6,this.save();case 6:e.next=14;break;case 8:return e.prev=8,e.t0=e.catch(1),this.defaultsCombo=t,this.defaultsDiffer=!0,m.error(e.t0),e.abrupt("return",Promise.reject(e.t0));case 14:case"end":return e.stop()}}),e,this,[[1,8]])}))),function(){return t.apply(this,arguments)})},{key:"save",value:function(){var e=this,t=(0,d.graph)();this.isContainer?this.defaultsCombo&&this.defaultsDiffer?((0,l.makeACLGraphbyCombo)(t,this.targetDoc,this.mainCombo.byCombo,this.targetACLDoc,!0),(0,l.makeACLGraphbyCombo)(t,this.targetDoc,this.defaultsCombo.byCombo,this.targetACLDoc,!1,!0)):(0,l.makeACLGraphbyCombo)(t,this.targetDoc,this.mainCombo.byCombo,this.targetACLDoc,!0,!0):(0,l.makeACLGraphbyCombo)(t,this.targetDoc,this.mainCombo.byCombo,this.targetACLDoc,!0),t.fetcher=(0,d.fetcher)(t,{fetch:this.store.fetcher._fetch});var r=t.updater||new d.UpdateManager(t);return new Promise((function(n,i){r.put(e.targetACLDoc,t.statementsMatching(void 0,void 0,void 0,e.targetACLDoc),"text/turtle",(function(r,o,a){if(!o)return i(new Error("ACL file save failed: ".concat(a)));e.store.fetcher.unload(e.targetACLDoc),e.store.add(t.statements),e.store.fetcher.requested[e.targetACLDoc.uri]="done",e.mainCombo.store=e.store,e.defaultsCombo&&(e.defaultsCombo.store=e.store),e.defaultsDiffer=!!e.defaultsCombo&&!(0,l.sameACL)(e.mainCombo.aclMap,e.defaultsCombo.aclMap),m.log("ACL modification: success!"),n()}))}))}}]),e}();t.AccessController=b},5678:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.AccessGroups=void 0;var o=n(r(4687)),a=n(r(7156)),s=n(r(7424)),c=n(r(6690)),u=n(r(9728)),l=n(r(8416)),d=r(6022),p=r(3422),f=b(r(2457)),h=b(r(6590)),m=r(1349),g=b(r(4433)),v=b(r(2853));function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(y=function(e){return e?r:t})(e)}function b(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=y(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}var w=h.acl,x={13:"Owners",9:"Owners (write locked)",5:"Editors",3:"Posters",2:"Submitters",1:"Viewers"},_={13:!0,5:!0,3:!0,2:!0,1:!0},E={13:"can read, write, and control sharing.",9:"can read and control sharing, currently write-locked.",5:"can read and change information",3:"can add new information, and read but not change existing information",2:"can add new information but not read any",1:"can read but not change information"},k=function(){function e(t,r,n,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};(0,c.default)(this,e),this.doc=t,this.aclDoc=r,this.controller=n,this.options=o,(0,l.default)(this,"defaults",void 0),(0,l.default)(this,"byCombo",void 0),(0,l.default)(this,"aclMap",void 0),(0,l.default)(this,"addAgentButton",void 0),(0,l.default)(this,"rootElement",void 0),(0,l.default)(this,"_store",void 0),this.defaults=o.defaults||!1,this._store=i,this.aclMap=(0,p.readACL)(t,r,i,this.defaults),this.byCombo=(0,p.ACLbyCombination)(this.aclMap),this.addAgentButton=new m.AddAgentButtons(this),this.rootElement=this.controller.dom.createElement("div"),this.rootElement.setAttribute("style",v.accessGroupList)}var t,r,n,i;return(0,u.default)(e,[{key:"store",get:function(){return this._store},set:function(e){this._store=e,this.aclMap=(0,p.readACL)(this.doc,this.aclDoc,e,this.defaults),this.byCombo=(0,p.ACLbyCombination)(this.aclMap)}},{key:"render",value:function(){var e=this;return this.rootElement.innerHTML="",this.renderGroups().forEach((function(t){return e.rootElement.appendChild(t)})),this.controller.isEditable&&this.rootElement.appendChild(this.addAgentButton.render()),this.rootElement}},{key:"renderGroups",value:function(){for(var e=[],t=15;t>0;t--){var r=S(t);(this.controller.isEditable&&_[t]||this.byCombo[r])&&e.push(this.renderGroup(t,r))}return e}},{key:"renderGroup",value:function(e,t){var r=this,n=this.controller.dom.createElement("div");return n.setAttribute("style",v.accessGroupListItem),f.makeDropTarget(n,(function(e){return r.handleDroppedUris(e,t).then((function(){return r.controller.render()})).catch((function(e){return r.controller.renderStatus(e)}))})),this.renderGroupElements(e,t).forEach((function(e){return n.appendChild(e)})),n}},{key:"renderGroupElements",value:function(e,t){var r=this,n=this.controller.dom.createElement("div");if(n.setAttribute("style",v.group),this.controller.isEditable)switch(e){case 1:n.setAttribute("style",v.group1);break;case 2:n.setAttribute("style",v.group2);break;case 3:n.setAttribute("style",v.group3);break;case 5:n.setAttribute("style",v.group5);break;case 9:n.setAttribute("style",v.group9);break;case 13:n.setAttribute("style",v.group13);break;default:n.setAttribute("style",v.group)}n.innerText=x[e]||function(e){for(var t="",r=["Read","Append","Write","Control"],n=0;n<4;n++)e&1<<n&&(t+=r[n]);return t}(e);var i=this.controller.dom.createElement("div");if(i.setAttribute("style",v.group),this.controller.isEditable)switch(e){case 1:i.setAttribute("style",v.group1);break;case 2:i.setAttribute("style",v.group2);break;case 3:i.setAttribute("style",v.group3);break;case 5:i.setAttribute("style",v.group5);break;case 9:i.setAttribute("style",v.group9);break;case 13:i.setAttribute("style",v.group13);break;default:i.setAttribute("style",v.group)}var o=i.appendChild(this.controller.dom.createElement("table"));(this.byCombo[t]||[]).map((function(e){var n=(0,s.default)(e,2),i=n[0],a=n[1];return r.renderAgent(o,t,i,a)})).forEach((function(e){return o.appendChild(e)}));var a=this.controller.dom.createElement("div");if(a.setAttribute("style",v.group),this.controller.isEditable)switch(e){case 1:a.setAttribute("style",v.group1);break;case 2:a.setAttribute("style",v.group2);break;case 3:a.setAttribute("style",v.group3);break;case 5:a.setAttribute("style",v.group5);break;case 9:a.setAttribute("style",v.group9);break;case 13:a.setAttribute("style",v.group13);break;default:a.setAttribute("style",v.group)}return a.innerText=E[e]||"Unusual combination",[n,i,a]}},{key:"renderAgent",value:function(e,t,r,n){var i=this,o=f.personTR(this.controller.dom,w(r),(0,d.sym)(n),this.controller.isEditable?{deleteFunction:function(){return i.deleteAgent(t,r,n).then((function(){return e.removeChild(o)})).catch((function(e){return i.controller.renderStatus(e)}))}}:{});return o}},{key:"deleteAgent",value:(i=(0,a.default)(o.default.mark((function e(t,r,n){var i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this.byCombo[t]||[],(a=i.find((function(e){var t=(0,s.default)(e,2),i=t[0],o=t[1];return i===r&&o===n})))&&i.splice(i.indexOf(a),1),e.next=5,this.controller.save();case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return i.apply(this,arguments)})},{key:"addNewURI",value:(n=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.handleDroppedUri(t,S(1));case 2:return e.next=4,this.controller.save();case 4:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"handleDroppedUris",value:(r=(0,a.default)(o.default.mark((function e(t,r){var n=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.all(t.map((function(e){return n.handleDroppedUri(e,r)})));case 3:return e.next=5,this.controller.save();case 5:e.next=10;break;case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e,t){return r.apply(this,arguments)})},{key:"handleDroppedUri",value:(t=(0,a.default)((function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return o.default.mark((function i(){var a,s,c,u,l,p;return o.default.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(a=A(e,r.store),s=(0,d.sym)(e),a||n){i.next=17;break}return g.log(" Not obvious: looking up dropped thing ".concat(s)),i.prev=4,i.next=7,null===(c=r._store)||void 0===c||null===(u=c.fetcher)||void 0===u?void 0:u.load(s.doc());case 7:i.next=14;break;case 9:return i.prev=9,i.t0=i.catch(4),l="Ignore error looking up dropped thing: ".concat(i.t0),g.error(l),i.abrupt("return",Promise.reject(new Error(l)));case 14:return i.abrupt("return",r.handleDroppedUri(e,t,!0));case 17:if(a){i.next=21;break}return p=" Error: Drop fails to drop appropriate thing! ".concat(e),g.error(p),i.abrupt("return",Promise.reject(new Error(p)));case 21:r.setACLCombo(t,e,a,r.controller.subject);case 22:case"end":return i.stop()}}),i,null,[[4,9]])}))()})),function(e,r){return t.apply(this,arguments)})},{key:"setACLCombo",value:function(e,t,r,n){e in this.byCombo||(this.byCombo[e]=[]),this.removeAgentFromCombos(t),this.byCombo[e].push([r.pred,r.obj.uri]),g.log("ACL: setting access to ".concat(n," by ").concat(r.pred,": ").concat(r.obj))}},{key:"removeAgentFromCombos",value:function(e){for(var t=0;t<16;t++){var r=this.byCombo[S(t)];if(r)for(var n=0;n<r.length;n++)for(;n<r.length&&r[n][1]===e;)r.splice(n,1)}}}]),e}();function S(e){for(var t=["Read","Append","Write","Control"],r=[],n=0;n<4;n++)e&1<<n&&r.push("http://www.w3.org/ns/auth/acl#"+t[n]);return r.sort(),r.join("\n")}function A(e,t){var r=(0,d.sym)(e),n=t.findTypeURIs(r);for(var i in n)g.log(" drop object type includes: "+i);if(e.startsWith("http")&&3===e.split("/").length)return{pred:"origin",obj:r};if(e.startsWith("http")&&4===e.split("/").length&&e.endsWith("/"))return g.log("Assuming final slash on dragged origin URI was unintended!"),{pred:"origin",obj:(0,d.sym)(e.slice(0,-1))};if(h.vcard("WebID").uri in n)return{pred:"agent",obj:r};if(h.vcard("Group").uri in n)return{pred:"agentGroup",obj:r};if(r.sameTerm(h.foaf("Agent"))||r.sameTerm(h.acl("AuthenticatedAgent"))||r.sameTerm(h.rdf("Resource"))||r.sameTerm(h.owl("Thing")))return{pred:"agentClass",obj:r};if(h.vcard("Individual").uri in n||h.foaf("Person").uri in n||h.foaf("Agent").uri in n){var o=t.any(r,h.foaf("preferredURI"));return o?{pred:"agent",obj:(0,d.sym)(o)}:{pred:"agent",obj:r}}return h.solid("AppProvider").uri in n?{pred:"origin",obj:r}:h.solid("AppProviderClass").uri in n?{pred:"originClass",obj:r}:(g.log(" Triage fails for "+e),null)}t.AccessGroups=k},3723:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.ACLControlBox5=function(e,t,r,n){var i=t.dom,o=e.doc(),a=i.createElement("div");a.setAttribute("style",d.aclControlBoxContainer);var s=a.appendChild(i.createElement("h1"));s.textContent="Sharing for ".concat(r," ").concat(c.label(e)),s.setAttribute("style",d.aclControlBoxHeader);var u=a.appendChild(i.createElement("div"));u.setAttribute("style",d.aclControlBoxStatus);try{(function(e,t,r,n,i,o,a){return b.apply(this,arguments)})(o,n,e,r,t,i,u).then((function(e){return a.appendChild(e.render())}))}catch(e){u.innerText=e}return a},t.handleDrop=y,t.preventBrowserDropEvents=function(e){if((0,p.log)("preventBrowserDropEvents called."),void 0!==m){if(m[g])return;m[g]=!0}e.addEventListener("drop",y,!1),e.addEventListener("dragenter",v,!1),e.addEventListener("dragover",v,!1)},t.preventDrag=v,t.setGlobalWindow=function(e){m=e},t.shortNameForFolder=function(e){var t=e.uri;"/"===t.slice(-1)&&(t=t.slice(0,-1));var r=t.lastIndexOf("/");return r>=0&&(t=t.slice(r+1)),t||"/"};var o=n(r(4687)),a=n(r(7156)),s=h(r(6590)),c=h(r(5666)),u=r(3422),l=r(3319),d=h(r(2853)),p=r(4433);function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(f=function(e){return e?r:t})(e)}function h(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=f(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}var m=window,g=Symbol("prevent double triggering of drop event");function v(e){e.stopPropagation(),e.preventDefault()}function y(e){e.dataTransfer.files.length>0&&(m.confirm("Are you sure you want to drop this file here? (Cancel opens it in a new tab)")||(e.stopPropagation(),e.preventDefault(),(0,p.log)("@@@@ document-level DROP suppressed: "+e.dataTransfer.dropEffect)))}function b(){return b=(0,a.default)(o.default.mark((function e(t,r,n,i,s,c,d){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,f){return(0,u.getACLorDefault)(t,function(){var t=(0,a.default)(o.default.mark((function t(a,h,m,g,v,y){var b,E,k,S;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(S=function(e){return new l.AccessController(n,i,s,d,E,m,g,v,y,e,r,c)},a){t.next=3;break}return t.abrupt("return",f(new Error("Error reading ".concat(h?"":" default ","ACL. status ").concat(m,": ").concat(g))));case 3:if(b=w(m),(E=x(m,g,r)||_(m))||!b){t.next=16;break}return t.prev=6,t.next=9,(0,u.getProspectiveHolder)(b);case 9:return k=t.sent,t.abrupt("return",e(S(k)));case 13:t.prev=13,t.t0=t.catch(6),(0,p.warn)(t.t0);case 16:return t.abrupt("return",e(S()));case 17:case"end":return t.stop()}}),t,null,[[6,13]])})));return function(e,r,n,i,o,a){return t.apply(this,arguments)}}())})));case 1:case"end":return e.stop()}}),e)}))),b.apply(this,arguments)}function w(e){var t=e.uri.split("#")[0],r=t.slice(0,-1).lastIndexOf("/"),n=t.indexOf("//");return n>=0&&r<n+2||r<0?null:t.slice(0,r+1)}function x(e,t,r){return r.holds(e,s.rdf("type"),s.space("Storage"),t)}function _(e){return e.uri===e.site().uri}},3422:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.ACLToString=function(e){return _(b(e))},t.ACLbyCombination=b,t.ACLunion=v,t.adoptACLDefault=function(e,t,r,n){var i=s.acl,o="/"===e.uri.slice(-1),a=h.each(void 0,i("default"),r,n).concat(h.each(void 0,i("defaultForNew"),r,n)).reduce((function(t,r){return t.concat(h.statementsMatching(r,s.rdf("type"),i("Authorization"),n)).concat(h.statementsMatching(r,i("agent"),void 0,n)).concat(h.statementsMatching(r,i("agentClass"),void 0,n)).concat(h.statementsMatching(r,i("agentGroup"),void 0,n)).concat(h.statementsMatching(r,i("origin"),void 0,n)).concat(h.statementsMatching(r,i("originClass"),void 0,n)).concat(h.statementsMatching(r,i("mode"),void 0,n)).concat((0,d.st)(r,i("accessTo"),e,n)).concat(o?(0,d.st)(r,i("default"),e,n):[])}),[]),c=(0,d.graph)();return a.forEach((function(e){return c.add(u(e.subject),u(e.predicate),u(e.object),(0,d.sym)(t.uri))})),c;function u(e){var r=n.uri.length;return(0,d.sym)(e.uri.slice(0,r)===n.uri?t.uri+e.uri.slice(r):e.uri)}},t.comboToString=_,t.fixIndividualACL=S,t.fixIndividualCardACL=function(e,t,r){var n=h.each(void 0,s.vcard("hasMember"),e);n?S(e,n,t,r):(t("This card is in no groups"),r(!0))},t.getACL=C,t.getACLorDefault=A,t.getProspectiveHolder=function(e){return T.apply(this,arguments)},t.loadUnionACL=y,t.makeACLGraph=w,t.makeACLGraphbyCombo=x,t.makeACLString=function(e,t,r){var n=(0,d.graph)();return w(n,e,t,r),(0,d.serialize)(r,n,r.uri,"text/turtle")||""},t.putACLObject=E,t.putACLbyCombo=k,t.readACL=m,t.sameACL=g,t.setACL=function(e,t,r){var n=h.any(e,c.ACL_LINK);if(!h.fetcher)throw new Error("Store has no fetcher");n?h.fetcher.webOperation("PUT",n.value,{data:t,contentType:"text/turtle"}).then((function(e){r(e.ok,e.error||"")})):h.fetcher.nowOrWhenFetched(e,void 0,(function(n,i){if(!n)return r(n,"Gettting headers for ACL: "+i);var o=h.any(e,c.ACL_LINK);if(o){if(!h.fetcher)throw new Error("Store has no fetcher");h.fetcher.webOperation("PUT",o.value,{data:t,contentType:"text/turtle"}).then((function(e){r(e.ok,e.error||"")}))}else r(!1,"No Link rel=ACL header for "+e)}))};var o=n(r(4687)),a=n(r(7156)),s=f(r(6590)),c=r(166),u=f(r(5666)),l=f(r(4433)),d=r(6022);function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(p=function(e){return e?r:t})(e)}function f(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=p(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}var h=c.solidLogicSingleton.store;function m(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=n?c(r,s):r.each(void 0,s.acl("accessTo"),e),o=s.acl,a={agent:{},agentClass:{},agentGroup:{},origin:{},originClass:{}};return Object.keys(a).forEach((function(e){i.forEach((function(t){r.each(t,o("mode")).forEach((function(n){r.each(t,o(e)).forEach((function(r){a[e][r.uri]=a[e][r.uri]||{},a[e][r.uri][n.uri]=t}))}))}))})),a;function c(t,r){return t.each(void 0,r.acl("default"),e).concat(t.each(void 0,r.acl("defaultForNew"),e))}}function g(e,t){var r=function(e,t){for(var r in{agent:!0,agentClass:!0,agentGroup:!0,origin:!0,originClass:!0})if(e[r])for(var n in e[r])for(var i in e[r][n])if(!t[r][n]||!t[r][n][i])return!1;return!0};return r(e,t)&&r(t,e)}function v(e){for(var t,r,n=e[0],i=function(i){["agent","agentClass","agentGroup","origin","originClass"].forEach((function(o){if((t=e[i])[o])for(r in t[o])for(var a in t[o][r])n[o][r]||(n[o][r]=[]),n[o][r][a]=!0}))},o=1;o<e.length;o++)i(o);return n}function y(e,t){var r=[];!function e(n){n.length?A(n.shift().doc(),(function(i,o,a,s,c,u){var l=!o;if(!i||!c||!u)return t(i,s);var d=l?m(c,u):m(a,s);r.push(d),e(n.slice(1))})):t(!0,v(r))}(e)}function b(e){var t={};return["agent","agentClass","agentGroup","origin","originClass"].forEach((function(r){for(var n in e[r]){var i=[];for(var o in e[r][n])i.push(o);i.sort();var a=i.join("\n");t[a]||(t[a]=[]),t[a].push([r,n])}})),t}function w(e,t,r,n){return x(e,t,b(r),n)}function x(e,t,r,n,i,o){var a=s.acl;for(var c in r){var u=r[c];if(u.length){var l=c.split("\n"),d=l.map((function(e){return e.split("#")[1]})).join("");o&&!i&&(d+="Default");var p=e.sym(n.uri+"#"+d);e.add(p,s.rdf("type"),a("Authorization"),n),i&&e.add(p,a("accessTo"),t,n),o&&e.add(p,a("default"),t,n);for(var f=0;f<l.length;f++)e.add(p,a("mode"),e.sym(l[f]),n);for(var h=0;h<u.length;h++){var m=u[h][0],g=u[h][1];e.add(p,a(m),e.sym(g),n)}}}}function _(e){var t="";for(var r in e){t+=r.split("\n").map((function(e){return e.split("#")[1][0]})).join("")+":";for(var n=e[r],i=0;i<n.length;i++){var o=n[i][0],a=(0,d.sym)(n[i][1]);t+="agent"===o?"@":"",t+=a.sameTerm(s.foaf("Agent"))?"*":u.label(a),i<n.length-1&&(t+=",")}t+=";"}return"{"+t.slice(0,-1)+"}"}function E(e,t,r,n,i){return k(e,t,b(r),n,i)}function k(e,t,r,n,i){var o,a=(0,d.graph)();x(a,t,r,n,!0),null===(o=e.updater)||void 0===o||o.put(n,a.statementsMatching(void 0,void 0,void 0,n),"text/turtle",(function(o,a,s){var c;a?(null===(c=e.fetcher)||void 0===c||c.unload(n),x(e,t,r,n,!0),e.fetcher.requested[n.uri]="done",i(a)):i(a,s)}))}function S(e,t,r,n){r=r||l.log;var i=e.doc();A(i,(function(o,a,s,c,l,d){if(!o||!l||!d)return n(!1,c);var p=a?m(s,c):m(l,d);y(t,(function(t,o){if(!t)return n(!1,o);g(o,p)?r("Nice - same ACL. no change "+u.label(e)+" "+i):(r("Group ACLs differ for "+u.label(e)+" "+i),E(h,s,o,c,n))}))}))}function A(e,t){C(e,(function(r,n,i,o){var a=s.acl;return r?r?404!==n?403===n?t(!1,!1,n,"(Sharing not available to you)".concat(o)):200!==n?t(!1,!1,n,"Error ".concat(n," accessing Access Control information for ").concat(e,": ").concat(o)):t(!0,!0,e,i):void function r(n){"/"===n.slice(-1)&&(n=n.slice(0,-1));var o=n.lastIndexOf("/");if(n.indexOf("/",n.indexOf("//")+2)>o)return t(!1,!0,404,"Found no ACL resource");n=n.slice(0,o+1);var s=(0,d.sym)(n);C(s,(function(o,c,u){if(!o)return t(!1,!0,c,"( No ACL pointer ".concat(n," ").concat(c,")").concat(u));if(403===c)return t(!1,!0,c,"( default ACL file FORBIDDEN. Stop.".concat(n,")"));if(404===c)return r(n);if(200!==c)return t(!1,!0,c,"Error status '".concat(c,"' searching for default for ").concat(s));if(!h.each(void 0,a("default"),h.sym(n),u).concat(h.each(void 0,a("defaultForNew"),h.sym(n),u)).length)return r(n);var l=h.sym(n);return t(!0,!1,e,i,l,u)}))}(e.uri):t(!1,!1,n,"Error accessing Access Control information for ".concat(e,") ").concat(o)):t(!1,!1,n,o)}))}function C(e,t){if(!h.fetcher)throw new Error("kb has no fetcher");h.fetcher.nowOrWhenFetched(e,void 0,(function(r,n){if(!r)return t(r,"Can't get headers to find ACL for ".concat(e,": ").concat(n));var i=h.any(e,c.ACL_LINK);if(i){if(!h.fetcher)throw new Error("kb has no fetcher");if(h.fetcher.nonexistent[i.value])return t(!0,404,i,"ACL file ".concat(i," does not exist."));h.fetcher.nowOrWhenFetched(i,void 0,(function(e,r,n){e?t(!0,200,i):t(!0,n.status,i,"Can't read Access Control File ".concat(i,": ").concat(r))}))}else t(!1,900,"No Link rel=ACL header for ".concat(e))}))}function T(){return(T=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){return A((0,d.sym)(t),(function(n,i,o,a,s){return n?e(i?o:s):r(new Error("Error loading ".concat(t)))}))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},1349:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.AddAgentButtons=void 0;var o=n(r(4687)),a=n(r(7156)),s=n(r(6690)),c=n(r(9728)),u=n(r(8416)),l=y(r(4433)),d=r(1124),p=r(3210),f=y(r(6590)),h=y(r(5666)),m=y(r(2457)),g=y(r(2853));function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(v=function(e){return e?r:t})(e)}function y(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=v(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}var b=function(){function e(t){(0,s.default)(this,e),this.groupList=t,(0,u.default)(this,"rootElement",void 0),(0,u.default)(this,"barElement",void 0),(0,u.default)(this,"isExpanded",!1),this.rootElement=t.controller.dom.createElement("div"),this.barElement=t.controller.dom.createElement("div")}var t,r,n,i,v,y;return(0,c.default)(e,[{key:"render",value:function(){return this.rootElement.innerHTML="",this.rootElement.appendChild(this.renderAddButton()),this.rootElement.appendChild(this.barElement),this.rootElement}},{key:"renderAddButton",value:function(){var e=this;return m.button(this.groupList.controller.dom,"".concat(d.icons.iconBase,"noun_34653_green.svg"),"Add ...",(function(){e.toggleBar(),e.renderBar()}))}},{key:"renderBar",value:function(){this.barElement.innerHTML="",this.isExpanded&&(this.barElement.appendChild(this.renderPersonButton()),this.barElement.appendChild(this.renderGroupButton()),this.barElement.appendChild(this.renderPublicButton()),this.barElement.appendChild(this.renderAuthenticatedAgentButton()),this.barElement.appendChild(this.renderBotButton()),this.barElement.appendChild(this.renderAppsButton()))}},{key:"renderSimplifiedBar",value:function(e){var t=this;Array.from(this.barElement.children).filter((function(t){return t!==e})).forEach((function(e){return t.barElement.removeChild(e)}))}},{key:"renderPersonButton",value:function(){var e=this;return m.button(this.groupList.controller.dom,d.icons.iconBase+m.iconForClass["vcard:Individual"],"Add Person",(function(t){e.renderSimplifiedBar(t.target),e.renderNameForm(f.vcard("Individual"),"person").then((function(t){return e.addPerson(t)})).then((function(){return e.renderCleanup()})).catch((function(t){return e.groupList.controller.renderStatus(t)}))}))}},{key:"renderGroupButton",value:function(){var e=this;return m.button(this.groupList.controller.dom,d.icons.iconBase+m.iconForClass["vcard:Group"],"Add Group",(function(t){e.renderSimplifiedBar(t.target),e.renderNameForm(f.vcard("Group"),"group").then((function(t){return e.addGroup(t)})).then((function(){return e.renderCleanup()})).catch((function(t){return e.groupList.controller.renderStatus(t)}))}))}},{key:"renderNameForm",value:function(e,t){return m.askName(this.groupList.controller.dom,this.groupList.store,this.barElement,f.vcard("URI"),e,t)}},{key:"renderPublicButton",value:function(){var e=this;return m.button(this.groupList.controller.dom,d.icons.iconBase+m.iconForClass["foaf:Agent"],"Add Everyone",(function(){return e.addAgent(f.foaf("Agent").uri).then((function(){return e.groupList.controller.renderTemporaryStatus("Adding the general public to those who can read. Drag the globe to a different level to give them more access.")})).then((function(){return e.renderCleanup()}))}))}},{key:"renderAuthenticatedAgentButton",value:function(){var e=this;return m.button(this.groupList.controller.dom,"".concat(d.icons.iconBase,"noun_99101.svg"),"Anyone logged In",(function(){return e.addAgent(f.acl("AuthenticatedAgent").uri).then((function(){return e.groupList.controller.renderTemporaryStatus("Adding anyone logged in to those who can read. Drag the ID icon to a different level to give them more access.")})).then((function(){return e.renderCleanup()}))}))}},{key:"renderBotButton",value:function(){var e=this;return m.button(this.groupList.controller.dom,d.icons.iconBase+"noun_Robot_849764.svg","A Software Agent (bot)",(function(t){e.renderSimplifiedBar(t.target),e.renderNameForm(f.schema("Application"),"bot").then((function(t){return e.addBot(t)})).then((function(){return e.renderCleanup()}))}))}},{key:"renderAppsButton",value:function(){var e=this;return m.button(this.groupList.controller.dom,"".concat(d.icons.iconBase,"noun_15177.svg"),"A Web App (origin)",(function(t){e.renderSimplifiedBar(t.target);var r={div:e.barElement,dom:e.groupList.controller.dom},n=e.renderAppsTable(r).catch((function(t){return e.groupList.controller.renderStatus(t)}));e.renderAppsView();var i=e.renderNameForm(f.schema("WebApplication"),"webapp domain").then((function(t){return e.getOriginFromName(t)}));Promise.race([n,i]).then((function(t){t&&e.groupList.addNewURI(t)})).then((function(){return e.renderCleanup()}))}))}},{key:"renderAppsView",value:function(){var e=this,t=this.groupList.controller.context.session.paneRegistry.byName("trustedApplications");if(t){var r=t.render(null,this.groupList.controller.context);r.setAttribute("style",g.trustedAppController);var n=m.cancelButton(this.groupList.controller.dom,(function(){return e.renderCleanup()}));n.setAttribute("style",g.trustedAppCancelButton),r.insertBefore(n,r.firstChild),this.barElement.appendChild(r)}}},{key:"renderAppsTable",value:(y=(0,a.default)(o.default.mark((function e(t){var r,n,i=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,p.ensureLoadedProfile)(t);case 2:return r=this.groupList.store.each(t.me,f.acl("trustedApp")),n=r.flatMap((function(e){return i.groupList.store.each(e,f.acl("origin"))})),this.barElement.appendChild(this.groupList.controller.dom.createElement("p")).textContent="You have ".concat(n.length," selected web apps."),e.abrupt("return",new Promise((function(e,t){var n=i.barElement.appendChild(i.groupList.controller.dom.createElement("table"));n.setAttribute("style",g.trustedAppAddApplicationsTable),r.forEach((function(r){var o=i.groupList.store.any(r,f.acl("origin"));o||t(new Error("Unable to pick app: ".concat(r.value)));var a=m.personTR(i.groupList.controller.dom,f.acl("origin"),o,{}),s=i.groupList.controller.dom.createElement("table"),c=s.appendChild(i.groupList.controller.dom.createElement("tr"));c.appendChild(i.groupList.controller.dom.createElement("td")).appendChild(a),c.appendChild(i.groupList.controller.dom.createElement("td")).textContent="Give access to ".concat(i.groupList.controller.noun," ").concat(h.label(i.groupList.controller.subject),"?"),c.appendChild(i.groupList.controller.dom.createElement("td")).appendChild(m.continueButton(i.groupList.controller.dom,(function(){return e(o.value)}))),n.appendChild(s)}))})));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"renderCleanup",value:function(){this.renderBar(),this.groupList.render()}},{key:"addPerson",value:(v=(0,a.default)(o.default.mark((function e(t){var r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",this.toggleBar());case 2:if(r=/^https?:/i,t.match(r)){e.next=5;break}return e.abrupt("return",Promise.reject(new Error("Not a http URI")));case 5:return l.log("Adding to ACL person: ".concat(t)),e.next=8,this.groupList.addNewURI(t);case 8:this.toggleBar();case 9:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"addGroup",value:(i=(0,a.default)(o.default.mark((function e(t){var r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",this.toggleBar());case 2:if(r=/^https?:/i,t.match(r)){e.next=5;break}return e.abrupt("return",Promise.reject(new Error("Not a http URI")));case 5:return l.log("Adding to ACL group: "+t),e.next=8,this.groupList.addNewURI(t);case 8:this.toggleBar();case 9:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"addAgent",value:(n=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.groupList.addNewURI(t);case 2:this.toggleBar();case 3:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"addBot",value:(r=(0,a.default)(o.default.mark((function e(t){var r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",this.toggleBar());case 2:if(r=/^https?:/i,t.match(r)){e.next=5;break}return e.abrupt("return",Promise.reject(new Error("Not a http URI")));case 5:return l.log("Adding to ACL bot: "+t),e.next=8,this.groupList.addNewURI(t);case 8:this.toggleBar();case 9:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"getOriginFromName",value:(t=(0,a.default)(o.default.mark((function e(t){var r,n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",Promise.resolve());case 2:if(r=/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i,t.match(r)){e.next=5;break}return e.abrupt("return",Promise.reject(new Error("Not a domain name")));case 5:return n="https://"+t,l.log("Adding to ACL origin: "+n),this.toggleBar(),e.abrupt("return",n);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"toggleBar",value:function(){this.isExpanded=!this.isExpanded}}]),e}();t.AddAgentButtons=b},8123:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.aclControl=t.acl=void 0;var n=r(3422),i=r(3723),o={adoptACLDefault:n.adoptACLDefault,readACL:n.readACL,sameACL:n.sameACL,ACLunion:n.ACLunion,loadUnionACL:n.loadUnionACL,ACLbyCombination:n.ACLbyCombination,makeACLGraph:n.makeACLGraph,makeACLGraphbyCombo:n.makeACLGraphbyCombo,ACLToString:n.ACLToString,comboToString:n.comboToString,makeACLString:n.makeACLString,putACLObject:n.putACLObject,putACLbyCombo:n.putACLbyCombo,fixIndividualCardACL:n.fixIndividualCardACL,fixIndividualACL:n.fixIndividualACL,setACL:n.setACL,getACLorDefault:n.getACLorDefault,getACL:n.getACL};t.acl=o;var a={preventBrowserDropEvents:i.preventBrowserDropEvents,shortNameForFolder:i.shortNameForFolder,ACLControlBox5:i.ACLControlBox5};t.aclControl=a},3060:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.findBookmarkDocument=function(e){return T.apply(this,arguments)},t.renderBookmarksButton=function(e,t){return N.apply(this,arguments)},t.toggleBookmark=F;var o=n(r(4687)),a=n(r(7156)),s=b(r(4433)),c=r(1124),u=r(2843),l=b(r(6590)),d=b(r(4004)),p=b(r(6022)),f=b(r(2853)),h=b(r(5666)),m=b(r(2457)),g=r(166),v=r(3210);function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(y=function(e){return e?r:t})(e)}function b(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=y(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}var w={icons:c.icons,ns:l,media:u.media,pad:d,rdf:p,style:f,utils:h,widgets:m},x=w.rdf,_=x.Namespace("http://www.w3.org/2002/01/bookmark#"),E="noun_45961.svg",k=h.label,S=window.document||null;function A(e){return new Promise((function(t,r){g.store.fetcher.load(e).then((function(r){s.log("createIfNotExists doc exists, all good "+e),t(r)}),(function(n){404===n.response.status?(s.log("createIfNotExists doc does NOT exist, will create... "+e),g.store.fetcher.webOperation("PUT",e.uri,{data:"",contentType:"text/turtle"}).then((function(r){delete g.store.fetcher.requested[e.uri],s.log("createIfNotExists doc created ok "+e),t(r)}),(function(t){s.log("createIfNotExists doc FAILED: "+e+": "+t),r(t)}))):(s.log("createIfNotExists doc load error NOT 404: "+e+": "+n),r(n))}))}))}function C(e,t){return new Promise((function(r,n){g.store.updater.update(e,t,(function(e,t,i){t?r():n(new Error(i))}))}))}function T(){return(T=(0,a.default)(o.default.mark((function e(t){var r,n,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=_("Bookmark"),n="bookmarks.ttl",e.next=5,(0,v.findAppInstances)(t,r,!0);case 5:if(!(t.instances&&t.instances.length>0)){e.next=10;break}t.bookmarkDocument=t.instances[0],t.instances.length>1&&alert("More than one bookmark file! "+t.instances),e.next=28;break;case 10:if(!t.publicProfile){e.next=27;break}return i=x.sym(t.publicProfile.dir().uri+n),e.prev=12,s.log("Creating new bookmark file "+i),e.next=16,A(i);case 16:e.next=22;break;case 18:return e.prev=18,e.t0=e.catch(12),alert.error("Can't make fresh bookmark file:"+e.t0),e.abrupt("return",t);case 22:return e.next=24,(0,g.registerInTypeIndex)(i,t.index,r);case 24:t.bookmarkDocument=i,e.next=28;break;case 27:alert("You seem to have no bookmark file and not even a profile file.");case 28:return e.abrupt("return",t);case 29:case"end":return e.stop()}}),e,null,[[12,18]])})))).apply(this,arguments)}function O(e,t){return P.apply(this,arguments)}function P(){return(P=(0,a.default)(o.default.mark((function e(t,r){var n,i,a,s,c,u,d;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n="",i=g.authn.currentUser()){e.next=4;break}throw new Error("Must be logged on to add Bookmark");case 4:return a=g.store.any(r,l.foaf("maker")),n=k(a)+": "+g.store.anyValue(r,l.sioc("content")).slice(0,80),s=t.bookmarkDocument,c=w.widgets.newThing(s,n),u=[x.st(s,w.ns.dct("references"),c,s),x.st(c,w.ns.rdf("type"),_("Bookmark"),s),x.st(c,w.ns.dct("created"),new Date,s),x.st(c,_("recalls"),r,s),x.st(c,w.ns.foaf("maker"),i,s),x.st(c,w.ns.dct("title"),n,s)],e.prev=9,e.next=12,C([],u);case 12:e.next=19;break;case 14:return e.prev=14,e.t0=e.catch(9),d="Making bookmark: "+e.t0,alert.error(d),e.abrupt("return",null);case 19:return e.abrupt("return",c);case 20:case"end":return e.stop()}}),e,null,[[9,14]])})))).apply(this,arguments)}function F(e,t,r){return I.apply(this,arguments)}function I(){return(I=(0,a.default)(o.default.mark((function e(t,r,n){var i,a,c;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,g.store.fetcher.load(t.bookmarkDocument);case 2:if(!(i=g.store.each(null,_("recalls"),r,t.bookmarkDocument)).length){e.next=24;break}if(confirm("Delete bookmark on this?"+i.length)){e.next=6;break}return e.abrupt("return");case 6:a=0;case 7:if(!(a<i.length)){e.next=22;break}return e.prev=8,e.next=11,C(g.store.connectedStatements(i[a]),[]);case 11:n.style.backgroundColor="white",s.log("Bookmark deleted: "+i[a]),e.next=19;break;case 15:e.prev=15,e.t0=e.catch(8),s.error("Cant delete bookmark:"+e.t0),alert("Cant delete bookmark:"+e.t0);case 19:a++,e.next=7;break;case 22:e.next=29;break;case 24:return e.next=26,O(t,r);case 26:c=e.sent,n.style.backgroundColor="yellow",s.log("Bookmark added: "+c);case 29:case"end":return e.stop()}}),e,null,[[8,15]])})))).apply(this,arguments)}function N(){return N=(0,a.default)(o.default.mark((function e(t,r){var n,i,s;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=function(){return i=(0,a.default)(o.default.mark((function e(r){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,g.store.fetcher.load(t.bookmarkDocument);case 2:n=g.store.any(null,_("recalls"),r.target,t.bookmarkDocument),r.style=w.style.buttonStyle,n&&(r.style.backgroundColor="yellow");case 5:case"end":return e.stop()}}),e)}))),i.apply(this,arguments)},n=function(e){return i.apply(this,arguments)},!t.bookmarkDocument){e.next=8;break}return(s=w.widgets.button(S,w.icons.iconBase+E,k(_("Bookmark")),(function(){F(t,r,s)}))).target=r,e.next=7,n(s);case 7:return e.abrupt("return",s);case 8:case"end":return e.stop()}}),e)}))),N.apply(this,arguments)}},6712:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.ChatChannel=void 0,t._createIfNotExists=function(e){return x.apply(this,arguments)},t.isDeleted=function(e){return d.store.holds(e,p.schema("dateDeleted"),null,e.doc())},t.isHidden=function(e){return this.isDeleted(e)||this.isReplaced(e)},t.isReplaced=function(e){return d.store.holds(e,p.dct("isReplacedBy"),null,e.doc())},t.mostRecentVersion=w,t.nick=function(e){var t=d.store.any(e,p.foaf("nick"));return t?""+t.value:""+h.label(e)},t.originalVersion=function(e){for(var t=e;t;)e=t,t=d.store.any(null,p.dct("isReplacedBy"),e,e.doc());return e};var o=n(r(4687)),a=n(r(7156)),s=n(r(6690)),c=n(r(9728)),u=y(r(4433)),l=r(3823),d=r(166),p=y(r(6590)),f=y(r(6022)),h=y(r(5666)),m=r(2452),g=r(1918);function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(v=function(e){return e?r:t})(e)}function y(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=v(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}var b=function(){function e(t,r){(0,s.default)(this,e),this.channel=t,this.channelRoot=t.doc(),this.options=r,this.dateFolder=new l.DateFolder(this.channelRoot,"chat.ttl"),this.div=null}var t,r,n;return(0,c.default)(e,[{key:"createMessage",value:(n=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.updateMessage(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"updateMessage",value:(r=(0,a.default)((function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0;return o.default.mark((function i(){var a,s,c,l,h,v,y,b,x,_,E,k,S;return o.default.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(a=[],s=new Date,c=""+s.getTime(),l=f.term(s),h=r?r.doc():t.dateFolder.leafDocumentFromDate(s),v=d.store.sym(h.uri+"#Msg"+c),y=d.authn.currentUser(),(b=(0,m.getBlankMsg)()).id=v.uri,!r){i.next=22;break}if((x=d.store.any(r,p.foaf("maker"))).uri!==y.uri){i.next=16;break}a.push(f.st(w(r),p.dct("isReplacedBy"),v,h)),n&&a.push(f.st(v,p.schema("dateDeleted"),l,h)),i.next=20;break;case 16:throw _="Error you cannot delete/edit a message from someone else : \n"+x.uri,u.warn(_),alert(_),new Error(_);case 20:i.next=23;break;case 22:a.push(f.st(t.channel,p.wf("message"),v,h));case 23:if(a.push(f.st(v,p.sioc("content"),d.store.literal(e),h)),b.content=e,a.push(f.st(v,p.dct("created"),l,h)),b.created=l.value,!y){i.next=35;break}return a.push(f.st(v,p.foaf("maker"),y,h)),b.maker=y.uri,i.next=32,(0,g.getPrivateKey)(y);case 32:E=i.sent,k=(0,m.signMsg)(b,E),a.push(f.st(v,f.sym("".concat(m.SEC,"proofValue")),f.lit(k),h));case 35:return i.prev=35,i.next=38,d.store.updater.update([],a);case 38:i.next=46;break;case 40:throw i.prev=40,i.t0=i.catch(35),S="Error saving chat message: "+i.t0,u.warn(S),alert(S),new Error(S);case 46:return i.abrupt("return",v);case 47:case"end":return i.stop()}}),i,null,[[35,40]])}))()})),function(e){return r.apply(this,arguments)})},{key:"deleteMessage",value:(t=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.updateMessage("(message deleted)",t,!0));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}();function w(e){for(var t=e;t;)e=t,t=d.store.any(e,p.dct("isReplacedBy"),null,e.doc());return e}function x(){return x=(0,a.default)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text/turtle",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return o.default.mark((function n(){var i;return o.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,d.store.fetcher.load(e);case 3:i=n.sent,n.next=26;break;case 6:if(n.prev=6,n.t0=n.catch(0),404!==n.t0.response.status){n.next=24;break}return u.log("createIfNotExists: doc does NOT exist, will create... "+e),n.prev=10,n.next=13,d.store.fetcher.webOperation("PUT",e.uri,{data:r,contentType:t});case 13:i=n.sent,n.next=20;break;case 16:throw n.prev=16,n.t1=n.catch(10),u.log("createIfNotExists doc FAILED: "+e+": "+n.t1),n.t1;case 20:return delete d.store.fetcher.requested[e.uri],n.abrupt("return",i);case 24:throw u.log("createIfNotExists doc load error NOT 404: "+e+": "+n.t0),n.t0;case 26:return n.abrupt("return",i);case 27:case"end":return n.stop()}}),n,null,[[0,6],[10,16]])}))()})),x.apply(this,arguments)}t.ChatChannel=b},3823:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.DateFolder=void 0;var o=n(r(4687)),a=n(r(7156)),s=n(r(6690)),c=n(r(9728)),u=h(r(4433)),l=r(166),d=h(r(6590)),p=h(r(6022));function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(f=function(e){return e?r:t})(e)}function h(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=f(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}var m=function(){function e(t,r,n){(0,s.default)(this,e),this.root=t,this.rootFolder=t.dir(),this.leafFileName=r||"index.ttl",this.membershipProperty=n||d.wf("leafObject")}var t,r;return(0,c.default)(e,[{key:"leafDocumentFromDate",value:function(e){var t=e.toISOString().split("T")[0].replace(/-/g,"/");return t=this.root.dir().uri+t+"/"+this.leafFileName,l.store.sym(t)}},{key:"dateFromLeafDocument",value:function(e){var t=this.rootFolder.uri.length,r=e.uri.slice(t,t+10).replace(/\//g,"-"),n=new Date(r);return u.log("Date for "+e+":"+n.toISOString()),n}},{key:"loadPrevious",value:(r=(0,a.default)(o.default.mark((function e(t,r){var n,i,s,c,p,f;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=function(){return s=(0,a.default)(o.default.mark((function e(t,s){var c,p,f,h,m,g,v,y,b,w;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h=function(){return h=(0,a.default)(o.default.mark((function e(t){var i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((t=t.filter(p)).sort(),r||t.reverse(),3===s){e.next=5;break}return e.abrupt("return",t.pop());case 5:if(!t.length){e.next=14;break}return i=t.pop(),a=l.store.sym(i.uri+n.leafFileName),e.next=10,l.store.fetcher.load(a);case 10:if(!(l.store.statementsMatching(null,d.dct("created"),null,a).length>0)){e.next=12;break}return e.abrupt("return",i);case 12:e.next=5;break;case 14:return e.abrupt("return",null);case 15:case"end":return e.stop()}}),e)}))),h.apply(this,arguments)},f=function(e){return h.apply(this,arguments)},p=function(e){var t=e.uri.slice(0,-1).split("/").slice(-1)[0];return!!"0123456789".includes(t[0])},c=function(e){return!(r?e.uri>=t.uri:e.uri<=t.uri)},m=t.dir(),e.prev=5,e.next=8,l.store.fetcher.load(m);case 8:return g=(g=l.store.each(m,d.ldp("contains"))).filter(c),e.next=12,f(g);case 12:if(!(v=e.sent)){e.next=15;break}return e.abrupt("return",v);case 15:e.next=25;break;case 17:if(e.prev=17,e.t0=e.catch(5),!e.t0.response||!e.t0.response.status||404!==e.t0.response.status){e.next=23;break}u.log("Error 404 for chat parent file "+m),e.next=25;break;case 23:throw u.log("*** Error NON 404 for chat parent file "+m),new Error("*** ".concat(e.t0.message," for chat folder ").concat(m));case 25:if(0!==s){e.next=27;break}return e.abrupt("return",null);case 27:return e.next=29,i(m,s-1);case 29:if(y=e.sent){e.next=32;break}return e.abrupt("return",null);case 32:return e.next=34,l.store.fetcher.load(y);case 34:return b=l.store.each(y,d.ldp("contains")),e.next=37,f(b);case 37:return w=e.sent,e.abrupt("return",w);case 39:case"end":return e.stop()}}),e,null,[[5,17]])}))),s.apply(this,arguments)},i=function(e,t){return s.apply(this,arguments)},n=this,c=this.leafDocumentFromDate(t).dir(),e.next=6,i(c,3);case 6:if(!(p=e.sent)){e.next=10;break}return f=l.store.sym(p.uri+this.leafFileName),e.abrupt("return",this.dateFromLeafDocument(f));case 10:return e.abrupt("return",null);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"firstLeaf",value:(t=(0,a.default)(o.default.mark((function e(t){var r,n,i,s,c,l,f,h,m,g,v;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=function(){return(s=(0,a.default)(o.default.mark((function e(i){var a,s;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=function(e){var t=e.uri.slice(0,-1).split("/").slice(-1)[0];return!!"0123456789".includes(t[0])},u.log(" parent "+i),delete n.requested[i.uri],e.next=5,n.load(i,{force:!0});case 5:if(0!==(s=(s=r.each(i,d.ldp("contains"))).filter(a)).length){e.next=9;break}throw new Error(" @@@ No children to parent2 "+i);case 9:return s.sort(),t&&s.reverse(),e.abrupt("return",s[0]);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)},i=function(e){return s.apply(this,arguments)},r=p.graph(),n=new p.Fetcher(r),e.next=6,i(this.root.dir());case 6:return c=e.sent,e.next=9,i(c);case 9:return l=e.sent,e.next=12,i(l);case 12:return f=e.sent,h=p.sym(f.uri+"chat.ttl"),e.next=16,n.load(h);case 16:if(0!==(m=r.each(this.root,this.membershipProperty,null,h)).length){e.next=21;break}throw g=" INCONSISTENCY -- no chat leafObject in file "+h,u.trace(g),new Error(g);case 21:return(v=m.map((function(e){return[r.any(e,d.dct("created")),e]}))).sort(),t&&v.reverse(),u.log((t?"Latest":"Earliest")+" leafObject is "+v[0][1]),e.abrupt("return",v[0][1]);case 26:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}();t.DateFolder=m},1786:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.desktopNotification=v,t.infiniteMessageArea=function(e,t,r,n){return b.apply(this,arguments)},t.insertMessageIntoTable=y;var o=n(r(4687)),a=n(r(7156)),s=g(r(6022)),c=r(166),u=g(r(4433)),l=r(1124),d=g(r(6590)),p=g(r(2457)),f=r(6712),h=r(1305);function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(m=function(e){return e?r:t})(e)}function g(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=m(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function v(e){"Notification"in window?"granted"===Notification.permission?new Notification(e):"denied"!==Notification.permission&&Notification.requestPermission().then((function(t){"granted"===t&&new Notification(e)})):u.warn("This browser does no t support desktop notification")}function y(e,t,r,n,i,o){var a=(0,h.renderMessageRow)(e,r,n,i,o);i.selectedMessage&&i.selectedMessage.sameTerm(r)&&(a.style.backgroundColor="yellow",i.selectedElement=a,t.selectedElement=a);for(var s=!1,c=t.firstChild;c;c=c.nextSibling){var u=!0===i.newestfirst,l=a.AJAR_date;if(l>c.AJAR_date&&u||l<c.AJAR_date&&!u){t.insertBefore(a,c),s=!0;break}}s||t.appendChild(a)}function b(){return b=(0,a.default)(o.default.mark((function e(t,r,n,i){var m,g,b,w,x,_,E,k,S,A,C,T,O,P,F,I,N,j,R,L,D,M,U,B,H,q;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return I=function(){return(I=(0,a.default)(o.default.mark((function e(){var t,r,n,a,s,c,u,l;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=function(){i.selectedElement?i.selectedElement.scrollIntoView({block:"center"}):U.inputRow.scrollIntoView&&U.inputRow.scrollIntoView(N)},t=function(){u.selectedElement.scrollIntoView({block:"center"})},i.selectedMessage&&(a=i.selectedMessage.doc(),s=new Date,c=R.leafDocumentFromDate(s),n=c.sameTerm(a)),!i.selectedMessage||n){e.next=15;break}return l=R.dateFromLeafDocument(a),e.next=7,_(l,n);case 7:u=e.sent,L.appendChild(u),B.messageTable=u,H.messageTable=u,t(),setTimeout(t,1e3),e.next=19;break;case 15:return e.next=17,C();case 17:B.messageTable=U,H.messageTable=U;case 19:return e.next=21,O(null,r);case 21:L.addEventListener("scroll",O),i.solo&&document.body.addEventListener("scroll",O);case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)},F=function(){return I.apply(this,arguments)},P=function(){return(P=(0,a.default)(o.default.mark((function e(t,r){var n,a,s,c,l;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!q){e.next=2;break}return e.abrupt("return");case 2:q=!0,n=!r,a=150;case 5:if(!(L.scrollTop<a&&B.messageTable&&!B.messageTable.initial&&B.messageTable.extendBackwards)){e.next=21;break}if(0!==L.scrollHeight){e.next=10;break}return setTimeout(O,2e3),q=!1,e.abrupt("return");case 10:return c=L.scrollHeight-L.scrollTop,u.log("infinite scroll: adding above: top "+L.scrollTop),e.next=14,B.messageTable.extendBackwards();case 14:if(s=e.sent,n&&(L.scrollTop=L.scrollHeight-c),r&&r(),!s){e.next=19;break}return e.abrupt("break",21);case 19:e.next=5;break;case 21:if(!(i.selectedMessage&&L.scrollHeight-L.scrollTop-L.clientHeight<a&&H.messageTable&&!H.messageTable.final&&H.messageTable.extendForwards)){e.next=33;break}return l=L.scrollTop,u.log("infinite scroll: adding below: bottom: "+(L.scrollHeight-L.scrollTop-L.clientHeight)),e.next=26,H.messageTable.extendForwards();case 26:if(s=e.sent,n&&(L.scrollTop=l),r&&r(),!s){e.next=31;break}return e.abrupt("break",33);case 31:e.next=21;break;case 33:q=!1;case 34:case"end":return e.stop()}}),e)})))).apply(this,arguments)},O=function(e,t){return P.apply(this,arguments)},T=function(){return(T=(0,a.default)(o.default.mark((function e(){var t,r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new Date,r=R.leafDocumentFromDate(t),e.next=4,_(t,!0);case 4:return i=e.sent,L.appendChild(i),L.refresh=(0,a.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S(new Date);case 2:m(n,i),v(n);case 4:case"end":return e.stop()}}),e)}))),c.store.updater.addDownstreamChangeListener(r,L.refresh),U=i,H.messageTable=U,e.abrupt("return",i);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)},C=function(){return T.apply(this,arguments)},A=function(){return(A=(0,a.default)(o.default.mark((function e(){var t,r,n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((t=R.leafDocumentFromDate(new Date)).sameTerm(H.messageTable.chatDocument)){e.next=7;break}return U.inputRow&&(U.removeChild(U.inputRow),delete U.inputRow),r=H.messageTable.chatDocument,e.next=6,C();case 6:if(!c.store.holds(r,d.rdfs("seeAlso"),t,r)){n=[s.st(r,d.rdfs("seeAlso"),t,r)];try{c.store.updater.update([],n)}catch(e){alert("Unable to link old chat file to new one:"+e)}}case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)},S=function(){return A.apply(this,arguments)},k=function(e,r){var n,s;function u(){return f.apply(this,arguments)}function f(){return(f=(0,a.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b(!0);case 2:return(t=e.sent)?(n&&(n.firstChild.setAttribute("src",l.icons.iconBase+"noun_T-Block_1114655_000000.svg"),n.disabled=!0),k.initial=!0):k.extendedBack=!0,m(),e.abrupt("return",t);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function m(){if(n){var e=k.extendedBack?!N:N,t=k.initial?"noun_T-Block_1114655_000000.svg":function(e){return e?"noun_1369241.svg":"noun_1369237.svg"}(e);n.firstChild.setAttribute("src",l.icons.iconBase+t)}}function v(){return(v=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!k.extendedBack){e.next=6;break}x(!0,k),k.extendedBack=!1,m(),e.next=8;break;case 6:return e.next=8,u();case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function y(){return w.apply(this,arguments)}function w(){return(w=(0,a.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b(!1);case 2:return(t=e.sent)?(s.firstChild.setAttribute("src",l.icons.iconBase+"noun_T-Block_1114655_000000.svg"),s.disabled=!0,k.final=!0):k.extendedForwards=!0,_(),e.abrupt("return",t);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _(){var e=k.extendedForwards?!N:N,t=k.final?"noun_T-Block_1114657_000000.svg":function(e){return e?"noun_1369237.svg":"noun_1369241.svg"}(e);s.firstChild.setAttribute("src",l.icons.iconBase+t)}function E(){return(E=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!k.extendedForwards){e.next=6;break}x(!1,k),k.extendedForwards=!1,_(),e.next=9;break;case 6:return e.next=8,y();case 8:H.messageTable.scrollIntoView(N);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var k=t.createElement("table");k.extendBackwards=u,k.extendForwards=y,k.date=e;var S=R.leafDocumentFromDate(e);if(k.chatDocument=S,k.fresh=!1,k.setAttribute("style","width: 100%;"),r){k.final=!0,U=k,H.messageTable=k;var A=(0,h.renderMessageEditor)(j,k,M,i);N?k.insertBefore(A,k.firstChild):k.appendChild(A),k.inputRow=A}if(i.infinite){var C=t.createElement("tr"),T=C.appendChild(t.createElement("td")),O=N?"noun_1369241.svg":"noun_1369237.svg";n=p.button(t,l.icons.iconBase+O,"Previous messages ..."),T.style="width:3em; height:3em;",n.addEventListener("click",(function(e){return v.apply(this,arguments)}),!1),k.extendedBack=!1,T.appendChild(n),m();var P=C.appendChild(t.createElement("td"));P.style="text-align: center; vertical-align: middle; color: #888; font-style: italic;",P.textContent=p.shortDate(e.toISOString(),!0);var F=C.appendChild(t.createElement("td")),I=N?"noun_1369241.svg":"noun_1369237.svg";s=p.button(t,l.icons.iconBase+I,"Later messages ..."),F.appendChild(s),F.style="width:3em; height:3em;",s.addEventListener("click",(function(e){return E.apply(this,arguments)}),!1),k.extendedForward=!1,_(),k.extendedForwards=!1,N?k.appendChild(C):k.insertBefore(C,k.firstChild)}var L=c.store.statementsMatching(null,d.wf("message"),null,S);return!r&&L.length,L.forEach((function(e){g(e.object,k)})),k.fresh=!0,k.fresh=!1,k},E=function(){return(E=(0,a.default)(o.default.mark((function e(r,n){var i,a,s;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u.log(" createMessageTable for "+r),i=R.leafDocumentFromDate(r),e.prev=2,e.next=5,c.store.fetcher.load(i);case 5:e.next=19;break;case 7:if(e.prev=7,e.t0=e.catch(2),a=t.createElement("table"),s=a.appendChild(t.createElement("tr")),!e.t0.response||!e.t0.response.status||404!==e.t0.response.status){e.next=16;break}return u.log("Error 404 for chat file "+i),e.abrupt("return",k(r,n));case 16:u.log("*** Error NON 404 for chat file "+i),s.appendChild(p.errorMessageBlock(t,e.t0,"pink"));case 18:return e.abrupt("return",s);case 19:return e.abrupt("return",k(r,n));case 20:case"end":return e.stop()}}),e,null,[[2,7]])})))).apply(this,arguments)},_=function(e,t){return E.apply(this,arguments)},x=function(e,t){if(e?N:!N)for(;t.nextSibling;)L.removeChild(t.nextSibling);else for(;t.previousSibling;)L.removeChild(t.previousSibling);(e?B:H).messageTable=t},w=function(){return(w=(0,a.default)(o.default.mark((function e(t){var r,n,i,a,s,c;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(r=t?B:H).messageTable.date,e.next=4,R.loadPrevious(n,t);case 4:if(n=e.sent,u.log("insertPreviousMessages: from ".concat(t?"backwards":"forwards"," loadPrevious: ").concat(n)),n||t||U){e.next=9;break}return e.next=9,C();case 9:if(n){e.next=11;break}return e.abrupt("return",!0);case 11:return i=!1,t||(a=R.leafDocumentFromDate(new Date),s=R.leafDocumentFromDate(n),i=s.sameTerm(a)),e.next=15,_(n,i);case 15:return c=e.sent,r.messageTable=c,(t?N:!N)?L.appendChild(c):L.insertBefore(c,L.firstChild),e.abrupt("return",i);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)},b=function(e){return w.apply(this,arguments)},g=function(e,t){var r=(0,f.mostRecentVersion)(e);(0,f.isDeleted)(r)&&!i.showDeletedMessages||y(j,t,e,t.fresh,i,M)},m=function(e,t){var r,n,i={};for(r=t.firstChild;r;r=r.nextSibling)r.AJAR_subject&&(i[r.AJAR_subject.uri]=!0);var o=c.store.statementsMatching(e,d.wf("message"),null,t.chatDocument).map((function(e){return e.object})),a={};for(o.forEach((function(e){a[e.uri]=!0,i[e.uri]||g(e,t)})),r=t.firstChild;r;)n=r.nextSibling,r.AJAR_subject&&!a[r.AJAR_subject.uri]&&t.removeChild(r),r=n;for(r=t.firstChild;r;r=r.nextSibling)r.AJAR_subject&&p.refreshTree(r)},(i=i||{}).authorDateOnLeft=!1,N="1"===i.newestFirst||!0===i.newestFirst,j=new f.ChatChannel(n,i),R=j.dateFolder,L=t.createElement("div"),j.div=L,D=L.appendChild(t.createElement("div")),M={dom:t,statusArea:D,div:D},B={messageTable:null},H={messageTable:null},q=!1,e.next=30,F();case 30:return e.abrupt("return",L);case 31:case"end":return e.stop()}}),e)}))),b.apply(this,arguments)}},1918:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.generatePrivateKey=v,t.generatePublicKey=y,t.getPrivateKey=function(e){return w.apply(this,arguments)},t.getPublicKey=function(e){return b.apply(this,arguments)};var o=n(r(4687)),a=n(r(7156)),s=g(r(4433)),c=r(3497),u=r(8089),l=g(r(6590)),d=r(166),p=g(r(6022)),f=r(1936),h=r(9021);function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(m=function(e){return e?r:t})(e)}function g(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=m(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function v(){return(0,u.bytesToHex)(c.schnorr.utils.randomPrivateKey())}function y(e){return(0,u.bytesToHex)(c.schnorr.getPublicKey(e))}function b(){return(b=(0,a.default)(o.default.mark((function e(t){var r,n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.store.fetcher.load(t);case 2:return e.next=4,(0,f.pubKeyUrl)(t);case 4:return r=e.sent,e.prev=5,e.next=8,d.store.fetcher.load(r);case 8:return n=d.store.any(t,l.solid("publicKey")),e.abrupt("return",null==n?void 0:n.value);case 12:return e.prev=12,e.t0=e.catch(5),e.abrupt("return",void 0);case 15:case"end":return e.stop()}}),e,null,[[5,12]])})))).apply(this,arguments)}function w(){return(w=(0,a.default)(o.default.mark((function e(t){var r,n,i,a,c,u,m,g,b;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.store.fetcher.load(t);case 2:return e.next=4,(0,f.pubKeyUrl)(t);case 4:return r=e.sent,e.next=7,(0,f.privKeyUrl)(t);case 7:return n=e.sent,e.next=10,(0,f.getExistingPublicKey)(t,r);case 10:return i=e.sent,e.next=13,(0,f.getExistingPrivateKey)(t,n);case 13:if(a=e.sent,c=!0,a&&i!==y(a)&&confirm("This is strange the publicKey is not valid for\n"+(null==t?void 0:t.uri)+"'shall we repair keeping the private key ?")&&(c=!1),a&&i&&c){e.next=34;break}if(u=[],m=[],a){e.next=24;break}return a=v(),m=[p.st(t,l.solid("privateKey"),p.literal(a),d.store.sym(n))],e.next=24,_(n,[],m,t.uri);case 24:if(i&&c){e.next=31;break}return u=[],i&&(u=[p.st(t,l.solid("publicKey"),p.lit(i),d.store.sym(r))],s.log(u)),g=y(a),m=[p.st(t,l.solid("publicKey"),p.literal(g),d.store.sym(r))],e.next=31,_(r,u,m);case 31:return b=n.substring(0,n.lastIndexOf("/")+1),e.next=34,(0,h.setAcl)(b,(0,h.keyContainerAclBody)(t.uri));case 34:return e.abrupt("return",a);case 35:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var x=function(){var e=(0,a.default)(o.default.mark((function e(t){var r,n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.store.fetcher.load(t);case 2:if(!(r=d.store.any(d.store.sym(t),d.store.sym("http://www.iana.org/assignments/link-relations/acl")))){e.next=16;break}return e.prev=4,e.next=7,d.store.fetcher.webOperation("DELETE",r.value);case 7:n=e.sent,s.log("delete "+r.value+" "+n.status),e.next=16;break;case 11:if(e.prev=11,e.t0=e.catch(4),404===e.t0.response.status){e.next=15;break}throw new Error(e.t0);case 15:s.log("delete "+r.value+" "+e.t0.response.status);case 16:case"end":return e.stop()}}),e,null,[[4,11]])})));return function(t){return e.apply(this,arguments)}}();function _(e,t,r){return E.apply(this,arguments)}function E(){return E=(0,a.default)((function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return o.default.mark((function i(){var a;return o.default.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,x(e);case 2:return i.next=4,d.store.updater.updateMany(t,r);case 4:return a=(0,h.keyAclBody)(e,n),i.next=7,(0,h.setAcl)(e,a);case 7:case"end":return i.stop()}}),i)}))()})),E.apply(this,arguments)}},1305:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.creatorAndDate=N,t.creatorAndDateHorizontal=j,t.elementForImageURI=P,t.renderMessageEditor=R,t.renderMessageRow=function(e,t,r,n,i){var o=!1,a="1"===n.colorizeByAuthor||!0===n.colorizeByAuthor,s=f.store.any(t,g.foaf("maker")),u=f.store.any(t,g.dct("created")),h=(0,l.mostRecentVersion)(t),m=f.store.any(h,g.foaf("maker")),y=s.uri===m.uri?h:t,b=f.store.any(y,g.sioc("content")),E=f.store.any(y,$rdf.sym("".concat(x.SEC,"proofValue"))),k=(0,x.getBlankMsg)();k.id=y.uri,k.created=f.store.any(y,g.dct("created")).value,k.content=b.value,k.maker=s.uri,null!=E&&E.value?(0,_.getPublicKey)(s).then((function(e){d.log(s.uri+"\n"+k.created+"\n"+k.id+"\n"+e),e||d.warn("message is signed but "+s.uri+" is missing publicKey"),null!=e&&e.match(/[0-9A-Fa-f]{6}/g)?null!=E&&E.value&&!(0,x.verifySignature)(null==E?void 0:E.value,k,e)&&d.warn("invalid signature\n"+k.id):d.warn("invalid publicKey hex string\n"+s.uri+"\n"+e)})):(o=!0,d.warn(y.uri+" is unsigned"));var S=(0,l.originalVersion)(t),A=!t.sameTerm(S),O=f.store.the(S,g.dct("created"),null,S.doc()),F=C.createElement("tr");o&&F.setAttribute("style","background-color: red"),F.AJAR_date=O.value,F.AJAR_subject=t;var I=C.createElement("td");if(F.appendChild(I),n.authorDateOnLeft)N(I,s,w.shortDate(O.value),t);else{var R=C.createElement("img");R.setAttribute("style","max-height: 2.5em; max-width: 2.5em; border-radius: 0.5em; margin: auto;"),w.setImage(R,s),I.appendChild(R)}var L=w.shortDate(O.value);A&&(L+=" ... "+w.shortDate(u.value));var D=F.appendChild(C.createElement("td"));n.authorDateOnLeft||j(D,s,L,t);var M=b.value.trim(),U=null;if(/^https?:\/[^ <>]*$/i.test(M))if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(M)&&n.expandImagesInline){var B=P(M,n);D.appendChild(B)}else{var H=D.appendChild(C.createElement("a"));U=H.appendChild(C.createElement("p")),H.href=M,U.textContent=M,D.appendChild(H)}else U=C.createElement("p"),D.appendChild(U),U.textContent=M;if(U){var q=a?v.lightColorHash(s):function(e){return e?"#e8ffe8":"white"}(r);U.setAttribute("style",T+"background-color: "+q+";")}var K=(0,c.sentimentStripLinked)(t,t.doc());K.children.length&&(D.appendChild(C.createElement("br")),D.appendChild(K));var W=C.createElement("td");F.appendChild(W);var V=w.button(C,p.icons.iconBase+"noun_243787.svg","...");return W.appendChild(V),V.addEventListener("click",(function(r){if(F.toolTR)return F.parentNode.removeChild(F.toolTR),void delete F.toolTR;var n=C.createElement("tr"),o=(0,c.messageToolbar)(t,F,i,e);o.style="border: 0.05em solid #888; border-radius: 0 0 0.7em 0.7em; border-top: 0; height:3.5em; background-color: #fff;",F.nextSibling?F.parentElement.insertBefore(n,F.nextSibling):F.parentElement.appendChild(n),F.toolTR=n,n.appendChild(C.createElement("td"));var a=n.appendChild(C.createElement("td"));n.appendChild(C.createElement("td")),a.appendChild(o)})),F},t.switchToEditor=function(e,t,r,n){var i=e.parentNode,o=R(r,i,n,r.options,(0,l.mostRecentVersion)(t));i.insertBefore(o,e),o.originalRow=e,e.style.visibility="hidden"};var o=n(r(4687)),a=n(r(7156)),s=r(1786),c=r(6126),u=r(3060),l=r(6712),d=k(r(4433)),p=r(1124),f=r(166),h=r(3210),m=r(2843),g=k(r(6590)),v=k(r(4004)),y=k(r(2853)),b=k(r(5666)),w=k(r(2457)),x=r(2452),_=r(1918);function E(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(E=function(e){return e?r:t})(e)}function k(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=E(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function S(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return A(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?A(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var C=window.document,T=y.messageBodyStyle,O=b.label;function P(e,t){var r=C.createElement("img"),n="10";t.inlineImageHeightEms&&(n=(""+t.inlineImageHeightEms).trim()),r.setAttribute("style","max-height: "+n+"em; border-radius: 1em; margin: 0.7em;"),e&&r.setAttribute("src",e);var i=C.createElement("a");return i.setAttribute("href",e),i.setAttribute("target","images"),i.appendChild(r),w.makeDraggable(r,$rdf.sym(e)),i}var F=function(e,t){var r=C.createElement("a");return t&&t.uri&&(r.setAttribute("href",t.uri),r.addEventListener("click",w.openHrefInOutlineMode,!0),r.setAttribute("style","color: #3B5998; text-decoration: none; ")),r.textContent=e,r};function I(e){var t=f.store.any(e,g.foaf("nick"));return t?""+t.value:""+O(e)}function N(e,t,r,n){var i=e.appendChild(F(I(t),t));t.uri&&f.store.fetcher.nowOrWhenFetched(t.doc(),void 0,(function(e,r){i.textContent=I(t)})),e.appendChild(C.createElement("br")),e.appendChild(F(r,n))}function j(e,t,r,n){var i=e.appendChild(F(O(t),t));t.uri&&f.store.fetcher.nowOrWhenFetched(t.doc(),void 0,(function(e,r){i.textContent=I(t)}));var o=e.appendChild(F(r,n));o.style.fontSize="80%",o.style.marginLeft="1em",e.appendChild(C.createElement("br"))}function R(e,t,r,n,i){function c(e){return l.apply(this,arguments)}function l(){return(l=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b(O.value,!0);case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function b(e,t){return x.apply(this,arguments)}function x(){return(x=(0,a.default)(o.default.mark((function a(c,u){var l,p;return o.default.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return l=function(o,a){if((0,s.insertMessageIntoTable)(e,t,o,!1,n,r),i){var c=F.originalRow;c.parentNode?c.parentNode.removeChild(c):(d.warn("No parentNode on old message "+c.textContent),c.style.backgroundColor="#fee",c.style.visibility="hidden"),F.parentNode.removeChild(F)}else u&&(O.value="",O.setAttribute("style",T),O.disabled=!1,O.scrollIntoView(n.newestFirst),O.focus(),O.select())},u&&(O.setAttribute("style",T+"color: #bbb;"),O.disabled=!0),o.prev=2,o.next=5,e.updateMessage(c,i);case 5:p=o.sent,o.next=13;break;case 8:return o.prev=8,o.t0=o.catch(2),(r.statusArea||F).appendChild(w.errorMessageBlock(C,"Error writing message: "+o.t0)),o.abrupt("return");case 13:l(p,c);case 14:case"end":return o.stop()}}),a,null,[[2,8]])})))).apply(this,arguments)}function _(e){var r=t.chatDocument.dir().uri;w.uploadFiles(f.store.fetcher,e,r+"Files",r+"Pictures",function(){var e=(0,a.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b(r);case 2:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}())}var E,k,A=function(){var e=(0,a.default)(o.default.mark((function e(t){var r,n,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=S(t),e.prev=1,r.s();case 3:if((n=r.n()).done){e.next=9;break}return i=n.value,e.next=7,b(i);case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),r.e(e.t0);case 14:return e.prev=14,r.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])})));return function(t){return e.apply(this,arguments)}}();i?(E=f.store.anyValue(i,g.dct("created"),null,i.doc()),k=p.icons.iconBase+"noun_1180158.svg"):(k=p.icons.iconBase+"noun_383448.svg",E="9999-01-01T00:00:00Z");var O,P,F=C.createElement("tr"),I=C.createElement("td"),j=C.createElement("td"),R=C.createElement("td");F.appendChild(I),F.appendChild(j),F.appendChild(R),F.AJAR_date=E;var L={div:j,dom:C};return(0,h.ensureLoggedIn)(L).then((function(t){!function(){function t(){return(t=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=3;break}return e.next=3,b(t.uri);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}if(n.menuHandler){var r=w.button(C,p.icons.iconBase+"noun_243787.svg","More");r.setAttribute("style",y.buttonStyle+"float: right;"),R.appendChild(r)}n.menuHandler;var s=f.authn.currentUser();if(N(I,s,"",null),O=C.createElement("textarea"),j.innerHTML="",j.appendChild(O),O.rows=3,i&&(O.value=f.store.anyValue(i,g.sioc("content"),null,i.doc())),O.setAttribute("style",T+"background-color: #eef;"),O.addEventListener("keydown",function(){var e=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("Enter"!==t.code){e.next=4;break}if(!(!t.shiftKey&&!n.shiftEnterSendsMessage||t.shiftKey&&n.shiftEnterSendsMessage)){e.next=4;break}return e.next=4,c(t);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),!1),w.makeDropTarget(O,A,_),R.innerHTML="",(P=w.button(C,k,"Send")).style.float="right",P.addEventListener("click",(function(e){return c()}),!1),R.appendChild(P),i){var u=R.appendChild(w.cancelButton(C));u.style.float="left",u.addEventListener("click",(function(e){return function(e){e.originalRow.style.visibility="visible",e.parentNode.removeChild(e)}(F)}),!1),R.appendChild(u)}var l=e.dateFolder.leafDocumentFromDate(new Date);j.appendChild(m.media.cameraButton(C,f.store,(function(){return $rdf.sym(l.dir().uri+"Image_"+Date.now()+".png")}),(function(e){return t.apply(this,arguments)}))),v.recordParticipation(e.channel,e.channel.doc())}(),Object.assign(t,r),(0,u.findBookmarkDocument)(t).then((function(e){}))})),F}},6126:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.messageToolbar=function(e,t,r,n){function i(){return(i=(0,a.default)(o.default.mark((function i(){var a,s;return o.default.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(a=m.store.any(e,l.foaf("maker")),E){i.next=5;break}alert("You can't delete the message, you are not logged in."),i.next=22;break;case 5:if(!E.sameTerm(a)){i.next=21;break}return i.prev=6,i.next=9,n.deleteMessage(e);case 9:i.next=18;break;case 11:i.prev=11,i.t0=i.catch(6),s="Error deleting messaage "+i.t0,c.warn(s),alert(s),(r.statusArea||t.parentNode).appendChild(f.errorMessageBlock(w,s));case 18:t.parentNode.removeChild(t),i.next=22;break;case 21:alert("You can't delete the message, you are not logged in as the author, "+a);case 22:b();case 23:case"end":return i.stop()}}),i,null,[[6,11]])})))).apply(this,arguments)}function s(){return s=(0,a.default)(o.default.mark((function t(i){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:E.value===m.store.any(e,l.foaf("maker")).value&&(b(),(0,v.switchToEditor)(i,e,n,r));case 1:case"end":return t.stop()}}),t)}))),s.apply(this,arguments)}var y=w.createElement("div");if((0,g.mostRecentVersion)(e).value===l.schema("dateDeleted").value)return y;function b(){y.parentElement.parentElement.removeChild(y.parentElement)}function x(e){return _.apply(this,arguments)}function _(){return(_=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,m.store.updater.update(m.store.connectedStatements(t),[]);case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var E=m.authn.currentUser();function k(e,r,n,i,s,c){function u(){g.style.backgroundColor=h?"yellow":"white"}var h,g=f.button(w,n,p.label(i),function(){var n=(0,a.default)(o.default.mark((function n(a){var p,g,y,b;return o.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!h){n.next=7;break}return n.next=3,x(h);case 3:h=null,u(),n.next=25;break;case 7:return h=f.newThing(s),p=[d.st(h,l.schema("agent"),e.me,s),d.st(h,l.rdf("type"),i,s),d.st(h,l.schema("target"),r,s)],n.next=11,m.store.updater.update([],p);case 11:if(u(),!c){n.next=25;break}g=!1,y=0;case 15:if(!(y<c.length)){n.next=24;break}if(!(b=v(c[y]))){n.next=21;break}return n.next=20,x(b);case 20:g=!0;case 21:y++,n.next=15;break;case 24:g&&f.refreshTree(t);case 25:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}());function v(t){var n=m.store.each(null,l.schema("agent"),e.me,s).filter((function(e){return m.store.holds(e,l.rdf("type"),t,s)})).filter((function(e){return m.store.holds(e,l.schema("target"),r,s)}));return n.length?n[0]:null}function y(){h=v(i),u()}return g.refresh=y,y(),g}if(E&&m.store.holds(e,l.foaf("maker"),E)&&(y.appendChild(f.deleteButtonWithCheck(w,y,"message",(function(){return i.apply(this,arguments)}))),y.appendChild(f.button(w,u.icons.iconBase+"noun_253504.svg","edit",(function(){return function(e){return s.apply(this,arguments)}(t)})))),(0,h.renderBookmarksButton)(r).then((function(e){e&&y.appendChild(e)})),(E=m.authn.currentUser())&&(0,g.mostRecentVersion)(e).value!==l.schema("dateDeleted").value){var S={me:E,dom:w,div:y};y.appendChild(k(S,e,u.icons.iconBase+"noun_1384132.svg",l.schema("AgreeAction"),e.doc(),[l.schema("DisagreeAction")])),y.appendChild(k(S,e,u.icons.iconBase+"noun_1384135.svg",l.schema("DisagreeAction"),e.doc(),[l.schema("AgreeAction")]))}var A=y.appendChild(f.cancelButton(w));return A.style.float="right",A.firstChild.style.opacity="0.3",A.addEventListener("click",b),y},t.sentimentStrip=function(e,t){var r=(0,g.mostRecentVersion)(e),n=(m.store.holds(r,l.schema("dateDeleted").value,null,r.doc())?m.store.each(null,l.schema("target"),e,t):[]).map((function(e){return m.store.any(e,l.rdf("type"),null,t)}));n.sort();var i=n.map((function(e){return x[e]||""}));return w.createTextNode(i.join(" "))},t.sentimentStripLinked=function(e,t){var r=w.createElement("span");function n(){r.innerHTML="";var n=((0,g.mostRecentVersion)(e).uri!==l.schema("dateDeleted").uri?m.store.each(null,l.schema("target"),e,t):[]).map((function(e){return[m.store.any(e,l.rdf("type"),null,t),m.store.any(e,l.schema("agent"),null,t)]}));n.sort(),n.forEach((function(e){var t,n=(0,s.default)(e,2),i=n[0],o=n[1];o?(t=w.createElement("a")).setAttribute("href",o.uri):t=w.createTextNode(""),t.textContent=x[i]||"*",r.appendChild(t)}))}return n(),r.refresh=n,r};var o=n(r(4687)),a=n(r(7156)),s=n(r(7424)),c=b(r(4433)),u=r(1124),l=b(r(6590)),d=b(r(6022)),p=b(r(5666)),f=b(r(2457)),h=r(3060),m=r(166),g=r(6712),v=r(1305);function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(y=function(e){return e?r:t})(e)}function b(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=y(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}var w=window.document,x={};x[l.schema("AgreeAction")]="👍",x[l.schema("DisagreeAction")]="👎",x[l.schema("EndorseAction")]="⭐️",x[l.schema("LikeAction")]="❤️"},2452:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SEC=void 0,t.getBlankMsg=function(){return{id:"",created:"",dateDeleted:"",content:"",maker:"",sig:""}},t.getMsgHash=u,t.serializeMsg=c,t.signMsg=function(e,t){return(0,i.bytesToHex)(n.schnorr.sign(u(e),t))},t.utf8Encoder=t.utf8Decoder=void 0,t.verifySignature=function(e,t,r){return n.schnorr.verify(e,u(t),r)};var n=r(3497),i=r(8089),o=r(3061),a=new TextDecoder("utf-8");t.utf8Decoder=a;var s=new TextEncoder;function c(e){return JSON.stringify(e)}function u(e){var t=(0,o.sha256)(s.encode(c(e)));return(0,i.bytesToHex)(t)}t.utf8Encoder=s,t.SEC="https://w3id.org/security#"},4615:(e,t,r)=>{"use strict";var n=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.newThingUI=function(e,t,r){var n=e.dom,i=e.div;if(e.me&&!e.me.uri)throw new Error("newThingUI: Invalid userid: "+e.me);var d="padding: 0.7em; width: 2em; height: 2em;",p=i.appendChild(n.createElement("img")),h=!1;p.setAttribute("src",a.icons.iconBase+"noun_34653_green.svg"),p.setAttribute("style",d),p.setAttribute("title","Add another tool");var m=function(e){var t=i.appendChild(n.createElement("pre"));t.setAttribute("style","background-color: pink"),t.appendChild(n.createTextNode(e))};function g(e){for(var t=0;t<y.length;t++){var r=d+e;y[t].disabled&&(r+="opacity: 0.3;"),y[t].setAttribute("style",r)}}function v(e){h=!h,p.setAttribute("style",d+(h?"background-color: yellow;":"")),g(h?"":"display: none;")}p.addEventListener("click",v);var y=[],b=Object.values(r).filter((function(e){return e.mintNew})),w=b.reduce((function(e,t){return t.mintClass&&(e[t.mintClass.uri]=(e[t.mintClass.uri]||0)+1),e}),{});b.forEach((function(r){var i=e.div.appendChild(n.createElement("img"));i.setAttribute("src",r.icon);var a=r.mintClass?w[r.mintClass.uri]>1?"".concat(u.label(r.mintClass)," (using ").concat(r.name," pane)"):u.label(r.mintClass):r.name+" @@";i.setAttribute("title","Make new "+a),i.setAttribute("style",d+"display: none;"),y.push(i),i.disabled||i.addEventListener("click",(function(p){var h;!function(e){g("display: none;"),e.setAttribute("style",d+"background-color: yellow;")}(i),h={event:p,folder:e.folder||null,iconEle:i,pane:r,noun:a,noIndexHTML:!0,div:e.div,me:e.me,dom:e.dom,refreshTarget:e.refreshTarget},new Promise((function(r,i){var a;function d(r,a){(0,s.ensureLoadedProfile)(e).then((function(e){var s=Object.assign({newBase:a,folder:h.folder||void 0,workspace:r},h);for(var u in h)s[u]=h[u];o.log("newThingUI: Minting new ".concat(s.pane.name," at ").concat(s.newBase)),h.pane.mintNew(t,s).then((function(e){if(!e||!e.newInstance)throw new Error("Cannot mint new - missing newInstance");if(e.folder){var t=e.newInstance.uri.slice(e.folder.uri.length).includes("/");o.log(" new thing is packge? "+t),t?f.add(e.folder,c.ldp("contains"),f.sym(e.newBase),e.folder.doc()):f.add(e.folder,c.ldp("contains"),e.newInstance,e.folder.doc()),e.refreshTarget&&e.refreshTarget.refresh&&e.refreshTarget.refresh()}else{var r=h.div.appendChild(n.createElement("p"));r.setAttribute("style","font-size: 120%;"),r.innerHTML="Your <a target='_blank' href='"+e.newInstance.uri+"'><b>new "+h.noun+"</b></a> is ready to be set up. <br/><br/><a target='_blank' href='"+e.newInstance.uri+"'>Go to your new "+h.noun+".</a>"}v()})).catch((function(e){m(e),i(e)}))}),(function(e){m("Error logging on: "+e)}))}var p=h.pane;h.noun=p.mintClass?u.label(p.mintClass):p.name,h.appPathSegment=h.noun.slice(0,1).toUpperCase()+h.noun.slice(1),h.folder?l.askName(n,f,h.div,c.foaf("name"),null,h.noun).then((function(e){if(e){var t=h.folder.uri;t.endsWith("/")||(t+="/"),d(null,t=t+encodeURIComponent(e)+"/")}else v()})):(a=(0,s.selectWorkspace)(n,{noun:h.noun,appPathSegment:h.appPathSegment},d),h.div.appendChild(a))}))}))}))};var i=r(166),o=p(r(4433)),a=r(1124),s=r(3210),c=p(r(6590)),u=p(r(5666)),l=p(r(2457));function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(d=function(e){return e?r:t})(e)}function p(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=d(t);if(r&&r.has(e))return r.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}var f=i.solidLogicSingleton.store},9056:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.create=void 0;var n={newThingUI:r(4615).newThingUI};t.create=n},5438:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4433:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.error=function(){var e;(e=console).error.apply(e,arguments)},t.log=function(){var e;(e=console).log.apply(e,arguments)},t.trace=function(){var e;(e=console).trace.apply(e,arguments)},t.warn=function(){var e;(e=console).warn.apply(e,arguments)}},9459:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.createControllerInfoBlock=f,t.initFooter=function(e,t){return d.apply(this,arguments)},t.rebuildFooter=p;var o=n(r(4687)),a=n(r(7156)),s=r(166),c=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}(r(2853)),u=r(2665);function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(l=function(e){return e?r:t})(e)}function d(){return(d=(0,a.default)(o.default.mark((function e(t,r){var n,i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=document.getElementById("PageFooter")){e.next=3;break}return e.abrupt("return");case 3:return i=(0,u.getPod)(),e.next=6,(0,u.getPodOwner)(i,t);case 6:a=e.sent,p(n,t,i,a,r)(),s.authSession.onLogin(p(n,t,i,a,r)),s.authSession.onLogout(p(n,t,i,a,r));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(e,t,r,n,i){return(0,a.default)(o.default.mark((function a(){var c;return o.default.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return c=s.authn.currentUser(),e.innerHTML="",o.t0=e,o.next=5,f(t,c,r,n,i);case 5:o.t1=o.sent,o.t0.appendChild.call(o.t0,o.t1);case 7:case"end":return o.stop()}}),a)})))}function f(e,t,r,n,i){var o=document.createElement("div");if(!r||!n||t&&t.equals(n))return o;o.setAttribute("style",c.footer);var a=document.createElement("span");a.innerText="You're visiting ";var s=document.createElement("a");s.href=r.uri,s.innerText="the Pod";var l=document.createElement("span");l.innerText=" controlled by ";var d=document.createElement("a");d.href=n.uri,d.innerText=(0,u.getName)(e,n);var p=document.createElement("span");p.innerText=". For more info, check out ";var f=document.createElement("a");f.href=i&&i.solidProjectUrl?i.solidProjectUrl:"https://solidproject.org",f.innerText=i&&i.solidProjectName?i.solidProjectName:"solidproject.org";var h=document.createElement("span");return h.innerText=".",o.appendChild(a),o.appendChild(s),o.appendChild(l),o.appendChild(d),o.appendChild(p),o.appendChild(f),o.appendChild(h),o}},2864:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.emptyProfile=void 0,t.emptyProfile='\n<svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 26 26" fill="none">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M13 25C19.6274 25 25 19.6274 25 13C25 6.37258 19.6274 1 13 1C6.37258 1 1 6.37258 1 13C1 19.6274 6.37258 25 13 25Z" fill="#D8D8D8" stroke="#8B8B8B"/>\n <mask id="mask0" mask-type="alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="26" height="26">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M13 25C19.6274 25 25 19.6274 25 13C25 6.37258 19.6274 1 13 1C6.37258 1 1 6.37258 1 13C1 19.6274 6.37258 25 13 25Z" fill="white" stroke="white"/>\n </mask>\n <g mask="url(#mask0)">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M17.0468 10.4586C17.0468 14.4979 15.4281 16.9214 12.9999 16.9214C10.5718 16.9214 8.95298 14.4979 8.95298 10.4586C8.95298 6.41931 12.9999 6.41931 12.9999 6.41931C12.9999 6.41931 17.0468 6.41931 17.0468 10.4586ZM4.09668 23.3842C6.52483 17.7293 12.9999 17.7293 12.9999 17.7293C12.9999 17.7293 19.475 17.7293 21.9031 23.3842C21.9031 23.3842 17.8481 25 12.9999 25C8.15169 25 4.09668 23.3842 4.09668 23.3842Z" fill="#8B8B8B"/>\n </g>\n</svg>'},1397:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.createBanner=w,t.createHelpMenu=_,t.createLoginSignUpButtons=E,t.createUserMenu=A,t.createUserMenuButton=k,t.createUserMenuItem=T,t.createUserMenuLink=S,t.getProfileImg=O,t.initHeader=function(e,t,r){return y.apply(this,arguments)},t.rebuildHeader=b;var o=n(r(4687)),a=n(r(7156)),s=r(1568),c=r(166),u=r(3210),l=m(r(2457)),d=m(r(2853)),p=r(2864),f=r(2665);function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(h=function(e){return e?r:t})(e)}function m(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=h(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}var g=s.icons.iconBase+"noun_help.svg",v="https://solidproject.org/assets/img/solid-emblem.svg";function y(){return(y=(0,a.default)(o.default.mark((function e(t,r,n){var i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=document.getElementById("PageHeader")){e.next=3;break}return e.abrupt("return");case 3:a=(0,f.getPod)(),b(i,t,a,r,n)(),c.authSession.onLogout(b(i,t,a,r,n)),c.authSession.onLogin(b(i,t,a,r,n));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function b(e,t,r,n,i){return(0,a.default)(o.default.mark((function a(){var s;return o.default.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return s=c.authn.currentUser(),e.innerHTML="",o.t0=e,o.next=5,w(t,r,s,n,i);case 5:o.t1=o.sent,o.t0.appendChild.call(o.t0,o.t1);case 7:case"end":return o.stop()}}),a)})))}function w(e,t,r,n,i){return x.apply(this,arguments)}function x(){return(x=(0,a.default)(o.default.mark((function e(t,r,n,i,a){var s,c,u,l,p,f;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((s=document.createElement("a")).href=r.uri,s.setAttribute("style",d.headerBannerLink),c=document.createElement("img"),a&&(c.src=a.logo?a.logo:v),c.setAttribute("style",d.headerBannerIcon),s.appendChild(c),!n){e.next=13;break}return e.next=10,A(t,n,i);case 10:e.t0=e.sent,e.next=14;break;case 13:e.t0=E();case 14:return u=e.t0,(l=document.createElement("div")).setAttribute("style",d.headerBanner),l.appendChild(s),(p=document.createElement("div")).setAttribute("style",d.headerBannerRightMenu),p.appendChild(u),a&&a.helpMenuList&&(f=_(a,a.helpMenuList),p.appendChild(f)),l.appendChild(p),e.abrupt("return",l);case 24:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _(e,t){if(t){var r=document.createElement("ul");r.setAttribute("style",d.headerUserMenuList),t.forEach((function(e){"url"==(e.url?"url":"onclick")?r.appendChild(T(S(e.label,e.url,e.target))):r.appendChild(T(k(e.label,e.onclick)))}));var n=document.createElement("nav");n.setAttribute("style",d.headerUserMenuNavigationMenuNotDisplayed),n.setAttribute("aria-hidden","true"),n.setAttribute("id","helperNav"),n.appendChild(r);var i=document.createElement("div");i.setAttribute("style",d.headerBannerUserMenu),i.appendChild(n);var o=document.createElement("button");o.setAttribute("style",d.headerUserMenuTrigger),o.type="button";var a=document.createElement("img");a.src=e&&e.helpIcon?e.helpIcon:s.icons.iconBase+g,a.setAttribute("style",d.headerUserMenuTriggerImg),i.appendChild(o),o.appendChild(a);var c=(0,f.throttle)((function(e){return P(e,o,n)}),50);o.addEventListener("click",c);var u=setTimeout((function(){return null}),0);return i.addEventListener("mouseover",(function(e){clearTimeout(u),c(e);var t=document.getElementById("helperNav");null==t||t.setAttribute("style",d.headerUserMenuNavigationMenu)})),i.addEventListener("mouseout",(function(e){u=setTimeout((function(){return c(e)}),200);var t=document.getElementById("helperNav");null==t||t.setAttribute("style",d.headerUserMenuNavigationMenuNotDisplayed)})),i}}function E(){var e=document.createElement("div");return e.setAttribute("style",d.headerBannerLogin),e.appendChild((0,u.loginStatusBox)(document,null,{})),e}function k(e,t){var r=document.createElement("button");return r.setAttribute("style",d.headerUserMenuButton),r.onmouseover=function(){r.setAttribute("style",d.headerUserMenuButtonHover)},r.onmouseout=function(){r.setAttribute("style",d.headerUserMenuButton)},r.addEventListener("click",t),r.innerText=e,r}function S(e,t,r){var n=document.createElement("a");return n.setAttribute("style",d.headerUserMenuLink),n.onmouseover=function(){n.setAttribute("style",d.headerUserMenuLinkHover)},n.onmouseout=function(){n.setAttribute("style",d.headerUserMenuLink)},n.href=t,n.innerText=e,r&&(n.target=r),n}function A(e,t,r){return C.apply(this,arguments)}function C(){return(C=(0,a.default)(o.default.mark((function e(t,r,n){var i,a,s,c,u,l,p,h;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(i=t.fetcher)){e.next=4;break}return e.next=4,i.load(r);case 4:return(a=document.createElement("ul")).setAttribute("style",d.headerUserMenuList),n&&n.forEach((function(e){"url"==(e.url?"url":"onclick")?a.appendChild(T(S(e.label,e.url,e.target))):a.appendChild(T(k(e.label,e.onclick)))})),(s=document.createElement("nav")).setAttribute("style",d.headerUserMenuNavigationMenuNotDisplayed),s.setAttribute("aria-hidden","true"),s.setAttribute("id","loggedInNav"),s.appendChild(a),(c=document.createElement("button")).setAttribute("style",d.headerUserMenuTrigger),c.type="button","string"==typeof(u=O(0,r))?c.innerHTML=u:c.appendChild(u),(l=document.createElement("div")).setAttribute("style",d.headerBannerUserMenuNotDisplayed),l.appendChild(c),l.appendChild(s),p=(0,f.throttle)((function(e){return P(e,c,s)}),50),c.addEventListener("click",p),h=setTimeout((function(){return null}),0),l.addEventListener("mouseover",(function(e){clearTimeout(h),p(e);var t=document.getElementById("loggedInNav");null==t||t.setAttribute("style",d.headerUserMenuNavigationMenu)})),l.addEventListener("mouseout",(function(e){h=setTimeout((function(){return p(e)}),200);var t=document.getElementById("loggedInNav");null==t||t.setAttribute("style",d.headerUserMenuNavigationMenuNotDisplayed)})),e.abrupt("return",l);case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function T(e){var t=document.createElement("li");return t.setAttribute("style",d.headerUserMenuListItem),t.appendChild(e),t}function O(e,t){var r=null;try{if(!(r=l.findImage(t)))return p.emptyProfile}catch(e){return p.emptyProfile}var n=document.createElement("div");return n.setAttribute("style",d.headerUserMenuPhoto),n.style.backgroundImage="url(".concat(r,")"),n}function P(e,t,r){var n="true"===t.getAttribute("aria-expanded"),i="mouseover"===e.type,o="mouseout"===e.type;n&&i||!n&&o||(t.setAttribute("aria-expanded",(!n).toString()),r.setAttribute("aria-hidden",n.toString()))}},1124:(e,t,r)=>{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0}),t.originalIconBase=t.icons=t.iconBase=void 0;var n=r(4433),i="https://solidos.github.io/solid-ui/src",o=e.scriptURI?{iconBase:e.scriptURI.slice(0,e.scriptURI.lastIndexOf("/"))+"/icons/",originalIconBase:e.scriptURI.slice(0,e.scriptURI.lastIndexOf("/"))+"/originalIcons/"}:"undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.iconBase?{iconBase:$SolidTestEnvironment.iconBase,originalIconBase:$SolidTestEnvironment.originalIconBase}:{iconBase:i+"/icons/",originalIconBase:i+"/originalIcons/"};t.icons=o,(0,n.log)(" icons.iconBase is set to : "+o.iconBase);var a=o.iconBase;t.iconBase=a;var s=o.originalIconBase;t.originalIconBase=s},1568:(e,t,r)=>{"use strict";var n=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"acl",{enumerable:!0,get:function(){return a.acl}}),Object.defineProperty(t,"aclControl",{enumerable:!0,get:function(){return a.aclControl}}),Object.defineProperty(t,"authn",{enumerable:!0,get:function(){return T.authn}}),Object.defineProperty(t,"create",{enumerable:!0,get:function(){return s.create}}),t.dom=t.createTypes=void 0,Object.defineProperty(t,"icons",{enumerable:!0,get:function(){return c.icons}}),Object.defineProperty(t,"infiniteMessageArea",{enumerable:!0,get:function(){return h.infiniteMessageArea}}),Object.defineProperty(t,"initFooter",{enumerable:!0,get:function(){return A.initFooter}}),Object.defineProperty(t,"initHeader",{enumerable:!0,get:function(){return S.initHeader}}),t.login=t.log=t.language=void 0,Object.defineProperty(t,"matrix",{enumerable:!0,get:function(){return d.matrix}}),Object.defineProperty(t,"media",{enumerable:!0,get:function(){return p.media}}),Object.defineProperty(t,"messageArea",{enumerable:!0,get:function(){return f.messageArea}}),t.rdf=t.preferences=t.participation=t.pad=t.ns=void 0,Object.defineProperty(t,"store",{enumerable:!0,get:function(){return T.store}}),t.style=void 0,Object.defineProperty(t,"table",{enumerable:!0,get:function(){return b.renderTableViewPane}}),t.utils=t.tabs=void 0,Object.defineProperty(t,"versionInfo",{enumerable:!0,get:function(){return k.versionInfo}}),t.widgets=void 0;var i=P(r(6022));t.rdf=i;var o=P(r(6590));t.ns=o;var a=r(8123),s=r(9056),c=r(1124),u=P(r(8214));t.language=u;var l=P(r(8853));t.log=l;var d=r(7740),p=r(2843),f=r(4440),h=r(1786),m=P(r(4004));t.pad=m;var g=P(r(8412));t.participation=g;var v=P(r(3489));t.preferences=v;var y=P(r(2853));t.style=y;var b=r(303),w=P(r(5084));t.tabs=w;var x=P(r(5666));t.utils=x;var _=P(r(3210));t.login=_;var E=P(r(2457));t.widgets=E;var k=r(7269),S=r(1397),A=r(9459),C=P(r(5438));t.createTypes=C;var T=r(166);function O(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(O=function(e){return e?r:t})(e)}function P(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=O(t);if(r&&r.has(e))return r.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}var F=window?window.document:null;t.dom=F,"undefined"!=typeof window&&(window.UI={authn:T.authn,store:T.store,ns:o,rdf:i,acl:a.acl,aclControl:a.aclControl,create:s.create,createTypes:C,dom:F,icons:c.icons,language:u,log:l,login:_,matrix:d.matrix,media:p.media,messageArea:f.messageArea,infiniteMessageArea:h.infiniteMessageArea,pad:m,participation:g,preferences:v,style:y,table:b.renderTableViewPane,tabs:w,utils:x,widgets:E,versionInfo:k.versionInfo,initHeader:S.initHeader,initFooter:A.initFooter})},8853:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.LogLevel=void 0,t.alert=function(e){a&&void 0!==a.alert?a.alert(e):c(e)},t.clear=function(){var e,t=null===(e=o)||void 0===e?void 0:e.getElementById("status");t&&(t.innerHTML="")},t.debug=u,t.dumpHTML=function(){var e,t;if(o){var r=n;n=63,u((null===(e=o)||void 0===e||null===(t=e.body)||void 0===t?void 0:t.innerHTML)||""),n=r}},t.error=function(e){s(e,1,"eror")},t.escapeForXML=l,t.info=function(e){s(e,16,"info")},t.logAscending=function(){i=!0},t.logDescending=function(){i=!1},t.msg=function(e){s(e)},t.setInternals=function(e,t){a=e,o=t},t.setLevel=function(e){n=63,u("Log level is now "+e),n=e},t.success=function(e){s(e,8,"good")},t.warn=c,t.LogLevel=r,function(e){e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Message=4]="Message",e[e.Success=8]="Success",e[e.Info=16]="Info",e[e.Debug=32]="Debug",e[e.All=63]="All"}(r||(t.LogLevel=r={}));var n=7,i=!1,o=document,a=window;function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"mesg";if(n&t)if(void 0!==o){var a=o.getElementById("status");if(!a)return;var s=o.createElement("span");s.setAttribute("class",r);var c=new Date;s.innerHTML="".concat(c.getHours(),":").concat(c.getMinutes(),":").concat(c.getSeconds()," [").concat(r,"] ").concat(l(e),"<br/>"),i?a.insertBefore(s,a.firstChild):a.appendChild(s)}else"undefined"!=typeof console&&console.log(e)}function c(e){s(e,2,"warn")}function u(e){s(e,32,"dbug")}function l(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}},3210:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.ensureLoadedPreferences=P,t.ensureLoadedProfile=I,t.ensureLoggedIn=O,t.filterAvailablePanes=function(e){return V.apply(this,arguments)},t.findAppInstances=function(e,t,r){return j.apply(this,arguments)},t.getUserRoles=K,t.loginStatusBox=H,t.newAppInstance=function(e,t,r){var n=function(e,t){r(e,t)},i=e.createElement("div"),o=e.createElement("button");return o.setAttribute("type","button"),i.appendChild(o),o.innerHTML="Make new ".concat(t.noun),o.addEventListener("click",(function(r){i.appendChild(q(e,t,n))}),!1),i.appendChild(o),i},t.registrationControl=function(e,t,r){return L.apply(this,arguments)},t.registrationList=function(e,t){return M.apply(this,arguments)},t.renderScopeHeadingRow=D,t.renderSignInPopup=B,t.scopeLabel=R,t.selectWorkspace=q;var o=n(r(4687)),a=n(r(7156)),s=r(6022),c=r(166),u=v(r(4433)),l=v(r(2853)),d=r(8853),p=v(r(6590)),f=r(4412),h=v(r(5666)),m=v(r(2457));function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(g=function(e){return e?r:t})(e)}function v(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=g(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function y(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return b(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?b(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}c.solidLogicSingleton.store;var w=c.solidLogicSingleton.profile,x=w.loadPreferences,_=w.loadProfile,E=c.solidLogicSingleton.typeIndex,k=E.getScopedAppInstances,S=E.getRegistrations,A=E.loadAllTypeIndexes,C=E.getScopedAppsFromIndex,T=E.deleteTypeIndexRegistration;function O(e){var t=c.authn.currentUser();return t?(c.authn.saveUser(t,e),Promise.resolve(e)):new Promise((function(t){c.authn.checkUser().then((function(r){if(r)return u.log("logIn: Already logged in as ".concat(r)),t(e);if(!e.div||!e.dom)return t(e);var n=H(e.dom,(function(r){c.authn.saveUser(r,e),t(e)}));e.div.appendChild(n)}))}))}function P(e){return F.apply(this,arguments)}function F(){return(F=(0,a.default)(o.default.mark((function e(t){var r,n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.preferencesFile){e.next=3;break}return e.abrupt("return",Promise.resolve(t));case 3:return t.statusArea||t.div||null,e.prev=4,e.next=7,I(t);case 7:return t=e.sent,e.next=10,x(t.me);case 10:r=e.sent,t.preferencesFile=r,e.next=51;break;case 15:if(e.prev=15,e.t0=e.catch(4),!(e.t0 instanceof c.UnauthorizedError)){e.next=22;break}n="Ooops - you are not authenticated (properly logged in) to for me to read your preference file. Try loggin out and logging in?",(0,d.alert)(n),e.next=51;break;case 22:if(!(e.t0 instanceof c.CrossOriginForbiddenError)){e.next=28;break}return n="Unauthorized: Assuming preference file blocked for origin ".concat(window.location.origin),t.preferencesFileError=n,e.abrupt("return",t);case 28:if(!(e.t0 instanceof c.SameOriginForbiddenError)){e.next=34;break}return n="You are not authorized to read your preference file. This may be because you are using an untrusted web app.",u.warn(n),e.abrupt("return",t);case 34:if(!(e.t0 instanceof c.NotEditableError)){e.next=40;break}return n="You are not authorized to edit your preference file. This may be because you are using an untrusted web app.",u.warn(n),e.abrupt("return",t);case 40:if(!(e.t0 instanceof c.WebOperationError)){e.next=45;break}n="You are not authorized to edit your preference file. This may be because you are using an untrusted web app.",u.warn(n),e.next=51;break;case 45:if(!(e.t0 instanceof c.FetchError)){e.next=50;break}n="Strange: Error ".concat(e.t0.status," trying to read your preference file.").concat(e.t0.message),(0,d.alert)(n),e.next=51;break;case 50:throw new Error("(via loadPrefs) ".concat(e.t0));case 51:return e.abrupt("return",t);case 52:case"end":return e.stop()}}),e,null,[[4,15]])})))).apply(this,arguments)}function I(e){return N.apply(this,arguments)}function N(){return(N=(0,a.default)(o.default.mark((function e(t){var r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.publicProfile){e.next=2;break}return e.abrupt("return",t);case 2:return e.prev=2,e.next=5,O(t);case 5:if((r=e.sent).me){e.next=8;break}throw new Error("Could not log in");case 8:return e.next=10,_(r.me);case 10:t.publicProfile=e.sent,e.next=17;break;case 13:throw e.prev=13,e.t0=e.catch(2),t.div&&t.dom&&t.div.appendChild(m.errorMessageBlock(t.dom,e.t0.message)),new Error("Can't log in: ".concat(e.t0));case 17:return e.abrupt("return",t);case 18:case"end":return e.stop()}}),e,null,[[2,13]])})))).apply(this,arguments)}function j(){return(j=(0,a.default)(o.default.mark((function e(t,r,n){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.me){e.next=6;break}return e.next=3,k(r,t.me);case 3:e.t0=e.sent,e.next=7;break;case 6:e.t0=[];case 7:return i=e.t0,!0===n?i=i.filter((function(e){return"public"===e.scope.label})):!1===n&&(i=i.filter((function(e){return"private"===e.scope.label}))),t.instances=i.map((function(e){return e.instance})),e.abrupt("return",t);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function R(e,t){var r=e.me&&e.me.sameTerm(t.agent)?"":h.label(t.agent)+" ";return"".concat(r).concat(t.label)}function L(){return(L=(0,a.default)(o.default.mark((function e(t,r,n){var i,a,l,d,f,h,g,v,b,w,x,_;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=function(e){var r=i(e.index),n=R(t,e),o="".concat(n," link to this ").concat(t.noun);return m.buildCheckboxForm(t.dom,c.solidLogicSingleton.store,o,null,r,b,e.index)},i=function(e){var t=S(r,n),i=t.length?t[0]:m.newThing(e);return[(0,s.st)(i,p.solid("instance"),r,e),(0,s.st)(i,p.solid("forClass"),n,e)]},(l=t.dom)&&t.div){e.next=5;break}throw new Error("registrationControl: need dom and div");case 5:if(d=l.createElement("div"),t.div.appendChild(d),t.me=c.authn.currentUser(),f=t.me){e.next=12;break}return d.innerHTML='<p style="margin:2em;">(Log in to save a link to this)</p>',e.abrupt("return",t);case 12:return e.prev=12,e.next=15,A(f);case 15:h=e.sent,e.next=23;break;case 18:return e.prev=18,e.t0=e.catch(12),t.div&&t.preferencesFileError?(g="(Lists of stuff not available)",t.div.appendChild(l.createElement("p")).textContent=g):t.div&&(g="registrationControl: Type indexes not available: ".concat(e.t0),t.div.appendChild(m.errorMessageBlock(t.dom,e.t0))),u.log(g),e.abrupt("return",t);case 23:d.innerHTML="<table><tbody></tbody></table>",d.setAttribute("style","font-size: 120%; text-align: right; padding: 1em; border: solid gray 0.05em;"),v=d.children[0].children[0],b=new s.BlankNode,w=y(h);try{for(w.s();!(x=w.n()).done;)_=x.value,v.appendChild(l.createElement("tr")).appendChild(a(_))}catch(e){w.e(e)}finally{w.f()}return e.abrupt("return",t);case 30:case"end":return e.stop()}}),e,null,[[12,18]])})))).apply(this,arguments)}function D(e,t,r){var n=e.dom,i=R(e,r),o=n.createElement("tr"),a=o.appendChild(n.createElement("td"));a.setAttribute("colspan","3"),a.style.backgoundColor={private:"#fee",public:"#efe"}[r.label]||"white";var s=a.appendChild(n.createElement("h3"));return s.textContent=i+" links",s.style.textAlign="left",o}function M(){return M=(0,a.default)(o.default.mark((function e(t,r){var n,i,s,u,l,d,f,h,g,v,b,w,x,_;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.dom,i=t.div,s=n.createElement("div"),i.appendChild(s),t.me=c.authn.currentUser(),t.me){e.next=8;break}return s.innerHTML='<p style="margin:2em;">(Log in list your stuff)</p>',e.abrupt("return",t);case 8:return e.next=10,A(t.me);case 10:u=e.sent,s.innerHTML="<table><tbody></tbody></table>",s.setAttribute("style","font-size: 120%; text-align: right; padding: 1em; border: solid #eee 0.5em;"),l=s.firstChild,d=l.firstChild,f=y(u),e.prev=16,f.s();case 18:if((h=f.n()).done){e.next=44;break}return g=h.value,v=D(t,0,g),d.appendChild(v),e.next=24,C(g,r.type||null);case 24:0===(b=e.sent).length&&(v.style.display="none"),w=y(b),e.prev=27,_=o.default.mark((function e(){var t,r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=x.value,r=m.personTR(n,p.solid("instance"),t.instance,{deleteFunction:function(){var e=(0,a.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,T(t);case 2:d.removeChild(r);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}),r.children[0].style.paddingLeft="3em",d.appendChild(r);case 4:case"end":return e.stop()}}),e)})),w.s();case 30:if((x=w.n()).done){e.next=34;break}return e.delegateYield(_(),"t0",32);case 32:e.next=30;break;case 34:e.next=39;break;case 36:e.prev=36,e.t1=e.catch(27),w.e(e.t1);case 39:return e.prev=39,w.f(),e.finish(39);case 42:e.next=18;break;case 44:e.next=49;break;case 46:e.prev=46,e.t2=e.catch(16),f.e(e.t2);case 49:return e.prev=49,f.f(),e.finish(49);case 52:return e.abrupt("return",t);case 53:case"end":return e.stop()}}),e,null,[[16,46,49,52],[27,36,39,42]])}))),M.apply(this,arguments)}function U(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=(r=r||{}).buttonStyle||"padding: 1em; border-radius:0.5em; font-size: 100%;",i=e.createElement("div"),o="SolidSignInOrSignUpBox";u.log("widgets.signInOrSignUpBox"),i.setUserCallback=t,i.setAttribute("class",o),i.setAttribute("style","display:flex;");var a=e.createElement("input");i.appendChild(a),a.setAttribute("type","button"),a.setAttribute("value","Log in"),a.setAttribute("style","".concat(n,"background-color: #eef;").concat(l.headerBannerLoginInput)),c.authSession.onLogin((function(){var t=c.authn.currentUser();if(t){var r=t.uri,n=e.getElementsByClassName(o);u.log("Logged in, ".concat(n.length," panels to be serviced"));for(var i=0;i<n.length;i++){var a=n[i];if(a.setUserCallback)try{a.setUserCallback(r);var s=a.parentNode;s&&s.removeChild(a)}catch(t){u.log("## Error satisfying login box: ".concat(t)),a.appendChild(m.errorMessageBlock(e,t))}}}})),a.addEventListener("click",(function(){var r=(0,c.offlineTestID)();if(r)return t(r.uri);B(e)}),!1);var s=e.createElement("input");return i.appendChild(s),s.setAttribute("type","button"),s.setAttribute("value","Sign Up for Solid"),s.setAttribute("style","".concat(n,"background-color: #efe;").concat(l.headerBannerLoginInput)),s.addEventListener("click",(function(e){(new f.Signup).signup().then((function(e){u.log("signInOrSignUpBox signed up "+e),t(e)}))}),!1),i}function B(e){var t=e.createElement("div");t.setAttribute("style","position: fixed; top: 0; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; align-items: center;"),e.body.appendChild(t);var r=e.createElement("div");r.setAttribute("style","\n background-color: white;\n box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.2);\n -webkit-box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.2);\n -moz-box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.2);\n -o-box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.2);\n border-radius: 4px;\n min-width: 400px;\n padding: 10px;\n z-index : 10;\n "),t.appendChild(r);var n=e.createElement("div");n.setAttribute("style","\n border-bottom: 1px solid #DDD;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n "),r.appendChild(n);var i=e.createElement("label");i.setAttribute("style","margin-right: 5px; font-weight: 800"),i.innerText="Select an identity provider";var s=e.createElement("button");s.innerHTML='<img src="https://solidos.github.io/solid-ui/src/icons/noun_1180156.svg" style="width: 2em; height: 2em;" title="Cancel">',s.setAttribute("style","background-color: transparent; border: none;"),s.addEventListener("click",(function(){t.remove()})),n.appendChild(i),n.appendChild(s);var u=function(){var e=(0,a.default)(o.default.mark((function e(t){var r,n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,c.solidLogicSingleton.store.updater.flagAuthorizationMetadata(),(r=new URL(window.location.href).hash)&&window.localStorage.setItem("preLoginRedirectHash",r),window.localStorage.setItem("loginIssuer",t),(n=new URL(window.location.href)).hash="",e.next=9,c.authSession.login({redirectUrl:n.href,oidcIssuer:t});case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),(0,d.alert)(e.t0.message);case 14:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(t){return e.apply(this,arguments)}}(),l=e.createElement("div");l.setAttribute("style","\n border-bottom: 1px solid #DDD;\n display: flex;\n flex-direction: column;\n padding-top: 10px;\n ");var p=e.createElement("div");p.setAttribute("style","\n display: flex;\n flex-direction: row;\n ");var f=e.createElement("label");f.innerText="Enter the URL of your identity provider:",f.setAttribute("style","color: #888");var h=e.createElement("input");h.setAttribute("type","text"),h.setAttribute("style","margin-left: 0 !important; flex: 1; margin-right: 5px !important"),h.setAttribute("placeholder","https://example.com"),h.value=localStorage.getItem("loginIssuer")||"";var m=e.createElement("button");m.innerText="Go",m.setAttribute("style","margin-top: 12px; margin-bottom: 12px;"),m.addEventListener("click",(function(){u(h.value)})),l.appendChild(f),p.appendChild(h),p.appendChild(m),l.appendChild(p),r.appendChild(l);var g=e.createElement("div");g.setAttribute("style","\n display: flex;\n flex-direction: column;\n padding-top: 10px;\n ");var v=e.createElement("label");v.innerText="Or pick an identity provider from the list below:",v.setAttribute("style","color: #888"),g.appendChild(v),(0,c.getSuggestedIssuers)().forEach((function(t){var r=e.createElement("button");r.innerText=t.name,r.setAttribute("style","height: 38px; margin-top: 10px"),r.addEventListener("click",(function(){u(t.uri)})),g.appendChild(r)})),r.appendChild(g)}function H(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=(0,c.offlineTestID)(),i=e.createElement("div");function o(e){e&&(n=c.authn.saveUser(e),i.refresh(),t&&t(n.uri))}function a(e){var r=n;c.authSession.logout().then((function(){var e="Your WebID was ".concat(r,". It has been forgotten.");n=null;try{(0,d.alert)(e)}catch(t){window.alert(e)}i.refresh(),t&&t(null)}),(function(e){(0,d.alert)("Fail to log out:"+e)}))}function s(t,r){var n=r.buttonStyle||"padding: 1em; border-radius:0.5em; font-size: 100%;",i="WebID logout";if(t){var o=c.solidLogicSingleton.store.any(t,p.foaf("nick"))||c.solidLogicSingleton.store.any(t,p.foaf("name"));o&&(i="Logout "+o.value)}var s=e.createElement("input");return s.setAttribute("type","button"),s.setAttribute("value",i),s.setAttribute("style","".concat(n,"background-color: #eee;")),s.addEventListener("click",a,!1),s}function u(){n=c.authn.currentUser(),i.refresh()}return i.refresh=function(){var t=c.authSession.info;((n=t&&t.webId&&t.isLoggedIn?c.solidLogicSingleton.store.sym(t.webId):null)&&i.me!==n.uri||!n&&i.me)&&(m.clearElement(i),n?i.appendChild(s(n,r)):i.appendChild(U(e,o,r))),i.me=n?n.uri:null},i.refresh(),u(),c.authSession.onLogin(u),c.authSession.onLogout(u),i.me="99999",i.refresh(),i}function q(e,t,r){var n=t.noun,i=t.appPathSegment,d=(0,c.offlineTestID)(),f=e.createElement("div"),h={me:d,dom:e,div:f};function g(t,r){f.appendChild(m.errorMessageBlock(e,t,r))}function v(e){var t,r=c.solidLogicSingleton.store.any(e,p.space("uriPrefix"));"/"!==(t=r?r.value:e.uri.split("#")[0]).slice(-1)&&(u.log("".concat(i,": No / at end of uriPrefix ").concat(t)),t="".concat(t,"/"));var n=new Date;return t+"".concat(i,"/id").concat(n.getTime(),"/")}return P(h).then((function(t){function i(){return i=(0,a.default)(o.default.mark((function r(n){var i,a,u,l,d;return o.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=w.appendChild(e.createElement("tr")),(a=i.appendChild(e.createElement("td"))).setAttribute("colspan","3"),a.style.padding="0.5em",r.t0=encodeURI,r.next=7,m.askName(e,c.solidLogicSingleton.store,a,p.solid("URL"),p.space("Workspace"),"Workspace");case 7:if(r.t1=r.sent,u=(0,r.t0)(r.t1),l=m.newThing(t.preferencesFile),d=[(0,s.st)(t.me,p.space("workspace"),l,t.preferencesFile),(0,s.st)(l,p.space("uriPrefix"),u,t.preferencesFile)],c.solidLogicSingleton.store.updater){r.next=13;break}throw new Error("store has no updater");case 13:return r.next=15,c.solidLogicSingleton.store.updater.update([],d);case 15:case"end":return r.stop()}}),r)}))),i.apply(this,arguments)}var u=t.me,d=t.preferencesFile,h=null,y=c.solidLogicSingleton.store.each(u,p.space("workspace"),void 0,d),b=c.solidLogicSingleton.store.each(u,p.space("storage"));0===y.length&&b&&(g("You don't seem to have any workspaces. You have ".concat(b.length," storage spaces."),"white"),b.map((function(e){return y=y.concat(c.solidLogicSingleton.store.each(e,p.ldp("contains")))})).filter((function(e){return e.id?["public","private"].includes(e.id().toLowerCase()):""}))),1===y.length&&(g("Workspace used: ".concat(y[0].uri),"white"),h=v(y[0]));var w=e.createElement("table");w.setAttribute("style","border-collapse:separate; border-spacing: 0.5em;"),f.appendChild(w),f.appendChild(e.createElement("hr"));var x=f.appendChild(e.createElement("p"));x.setAttribute("style",l.commentStyle),x.textContent="Where would you like to store the data for the ".concat(n,"?\n Give the URL of the folder where you would like the data stored.\n It can be anywhere in solid world - this URI is just an idea.");var _=f.appendChild(e.createElement("input"));_.setAttribute("type","text"),_.setAttribute("style",l.textInputStyle),_.size=80,_.label="base URL",_.autocomplete="on",h&&(_.value=h),t.baseField=_,f.appendChild(e.createElement("br"));var E,k,S,A,C,T,O,P=f.appendChild(e.createElement("button"));P.setAttribute("style",l.buttonStyle),P.textContent="Start new ".concat(n," at this URI"),P.addEventListener("click",(function(e){var t=_.value.replace(" ","%20");"/"!==t.slice(-1)&&(t+="/"),r(null,t)})),y=y.filter((function(e){return!c.solidLogicSingleton.store.holds(e,p.rdf("type"),p.space("MasterWorkspace"))}));for(var F,I="height: 3em; margin: 1em; padding: 1em white; border-radius: 0.3em;",N="".concat(I,"border: 0px;"),j=0;j<y.length;j++){if(C=y[j],A=e.createElement("tr"),0===j&&((E=e.createElement("td")).setAttribute("rowspan","".concat(y.length)),E.textContent="Choose a workspace for this:",E.setAttribute("style","vertical-align:middle;"),A.appendChild(E)),k=e.createElement("td"),!(T=c.solidLogicSingleton.store.anyValue(C,p.ui("style")))){var R="#".concat((16777215&(F=C.uri,F.split("").reduce((function(e,t){return(e=(e<<5)-e+t.charCodeAt(0))&e}),0))|12632256).toString(16));T="color: black ; background-color: ".concat(R,";")}k.setAttribute("style",N+T),A.target=C.uri;var L=c.solidLogicSingleton.store.any(C,p.rdfs("label"));L||(L=C.uri.split("/").slice(-1)[0]||C.uri.split("/").slice(-2)[0]),k.textContent=L||"???",A.appendChild(k),0===j&&((S=e.createElement("td")).setAttribute("rowspan","".concat(y.length,"1")),S.setAttribute("style","width:50%;"),A.appendChild(S)),w.appendChild(A),O=(O=c.solidLogicSingleton.store.any(C,p.rdfs("comment")))?O.value:"Use this workspace",k.addEventListener("click",(function(t){S.textContent=O?O.value:"",S.setAttribute("style",N+T);var n=e.createElement("button");n.textContent="Continue";var i=v(C);_.value=i,n.addEventListener("click",(function(e){n.disabled=!0,r(C,i),n.textContent="----\x3e"}),!0),S.appendChild(n)}),!0)}var D=e.createElement("tr");(k=e.createElement("td")).setAttribute("style",I),k.textContent="+ Make a new workspace",k.addEventListener("click",(function(e){return i.apply(this,arguments)})),D.appendChild(k),w.appendChild(D)})).catch((function(e){f.appendChild(m.errorMessageBlock(h.dom,e))})),f}function K(){return W.apply(this,arguments)}function W(){return(W=(0,a.default)(o.default.mark((function e(){var t,r,n,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,P({});case 3:if(t=e.sent,r=t.me,n=t.preferencesFile,i=t.preferencesFileError,n&&!i){e.next=9;break}throw new Error(i);case 9:return e.abrupt("return",c.solidLogicSingleton.store.each(r,p.rdf("type"),null,n.doc()));case 12:e.prev=12,e.t0=e.catch(0),u.warn("Unable to fetch your preferences - this was the error: ",e.t0);case 15:return e.abrupt("return",[]);case 16:case"end":return e.stop()}}),e,null,[[0,12]])})))).apply(this,arguments)}function V(){return(V=(0,a.default)(o.default.mark((function e(t){var r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,K();case 2:return r=e.sent,e.abrupt("return",t.filter((function(e){return z(e,r)})));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function z(e,t){return(e.audience||[]).reduce((function(e,r){return e&&!!t.find((function(e){return e.equals(r)}))}),!0)}c.authSession.onLogout((0,a.default)(o.default.mark((function e(){var t,r,n,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=window.localStorage.getItem("loginIssuer"))){e.next=20;break}return e.prev=2,c.solidLogicSingleton.store.updater.flagAuthorizationMetadata(),(r=new URL(t)).pathname="/.well-known/openid-configuration",e.next=8,fetch(r.toString());case 8:if(200!==(n=e.sent).status){e.next=16;break}return e.next=12,n.json();case 12:if(!(i=e.sent)||!i.end_session_endpoint){e.next=16;break}return e.next=16,fetch(i.end_session_endpoint,{credentials:"include"});case 16:e.next=20;break;case 18:e.prev=18,e.t0=e.catch(2);case 20:window.location.reload();case 21:case"end":return e.stop()}}),e,null,[[2,18]])}))))},7740:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matrix=void 0;var n={matrixForQuery:r(4616).matrixForQuery};t.matrix=n},4616:(e,t,r)=>{"use strict";var n=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.matrixForQuery=function(e,t,r,n,a,s,u){var l=e.createElement("table"),d=e.createElement("tr");d.appendChild(e.createElement("td")).setAttribute("class","MatrixCorner"),l.appendChild(d),l.lastHeader=d;var p=[],f=[],h=function(e,t,r,n){for(;e.firstChild;)e.removeChild(e.firstChild);e.setAttribute("style",""),e.style.textAlign="center",s.cellFunction?s.cellFunction(e,t,r,n):(e.textContent=i.label(n),e.setAttribute("style","padding: 0.3em")),delete e.old},m=function(t){var r=t.toNT();if(f[r])return f[r];var n=e.createElement("tr"),a=n.appendChild(e.createElement("td"));a.setAttribute("style","padding: 0.3em;"),a.textContent=i.label(t),"NamedNode"===t.termType&&c.fetcher.nowOrWhenFetched(t.uri.split("#")[0],void 0,(function(e,r,n){e&&(a.textContent=i.label(t))}));for(var u=0;u<p.length;u++)h(n.appendChild(e.createElement("td")),o.fromNT(p[u]),t,null);n.dataValueNT=r,f[r]=n;for(var d=l.lastHeader.nextSibling;d;d=d.nextSibling)if(r>d.dataValueNT&&s&&s.yDecreasing||r<d.dataValueNT&&(!s||!s.yDecreasing))return l.insertBefore(n,d);return l.appendChild(n)},g=function(t){for(var r=t.toNT(),n=null,a=0;a<p.length;a++){if(p[a]===r)return a;if(r>p[a]&&s.xDecreasing||r<p[a]&&!s.xDecreasing){p=p.slice(0,a).concat([r]).concat(p.slice(a)),n=a;break}}null===n&&(n=p.length,p.push(r));for(var c=l.firstChild;c;c=c.nextSibling){var u=c.dataValueNT,d=e.createElement("td");if(d.style.textAlign="center",c===l.firstChild?d.textContent=i.label(t):h(d,t,o.fromNT(u),null),n===p.length-1)c.appendChild(d);else{for(var f=c.firstChild,m=0;m<n+1;m++)f=f.nextSibling;c.insertBefore(d,f)}}return n},v=function(){var e,t,r=[],n=[];if(s.set_y)for(var i=0;i<s.set_y.length;i++)n[s.set_y[i]]=!0;if(s.set_x)for(var a=0;a<s.set_x.length;a++)r[g(s.set_x[a])+1]=!0;for(var c=1;c<l.children.length;c++){e=l.children[c];for(var u=1;u<e.children.length;u++)if((t=e.children[u]).old){var d=o.fromNT(e.dataValueNT),m=o.fromNT(p[u-1]);h(t,m,d,null)}else n[e.dataValueNT]=!0,r[u]=!0}for(var v=0;v<l.children.length;v++)if(e=l.children[v],v>0&&!n[e.dataValueNT])delete f[e.dataValueNT],l.removeChild(e);else for(var y=e.children.length-1;y>0;y--){var b=e.children[y];r[y]||e.removeChild(b)}for(var w=[],x=0;x<p.length;x++)r[x+1]&&w.push(p[x]);p=w};l.refresh=function(){!function(){for(var e=1;e<l.children.length;e++)for(var t=l.children[e],r=1;r<t.children.length;r++)t.children[r].old=!0}(),c.query(t,y,void 0,v)};var y=function(e){var t=e[r.toString()],i=e[n.toString()],o=e[a.toString()],s=m(i),c=g(t),u=s.children[c+1];h(u,t,i,o)};if(s.set_y)for(var b=0;b<s.set_y.length;b++)m(s.set_y[b]);if(s.set_x)for(var w=0;w<s.set_x.length;w++)g(s.set_x[w]);return c.query(t,y,void 0,u),l};var i=s(r(5666)),o=s(r(6022));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}function s(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var c=o?Object.getOwnPropertyDescriptor(e,s):null;c&&(c.get||c.set)?Object.defineProperty(i,s,c):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}var c=r(166).solidLogicSingleton.store},2843:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.media=void 0;var n=r(4083),i={cameraCaptureControl:n.cameraCaptureControl,cameraButton:n.cameraButton};t.media=i},4083:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.cameraButton=function(e,t,r,n){var i,s=e.createElement("div"),c=u.button(e,p,"Take picture");function l(e){return d.apply(this,arguments)}function d(){return(d=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.removeChild(i),s.appendChild(c),n(t);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return s.appendChild(c),c.addEventListener("click",(function(n){s.removeChild(c),i=m(e,t,r,l),s.appendChild(i)})),s},t.cameraCaptureControl=m;var o=n(r(4687)),a=n(r(7156)),s=d(r(4433)),c=r(1124),u=d(r(2457));function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(l=function(e){return e?r:t})(e)}function d(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}var p=c.icons.iconBase+"noun_Camera_1618446_000000.svg",f=c.icons.iconBase+"noun_479395.svg",h="border-radius: 0.5em; margin: 0.8em; width: ".concat("640","; height:").concat("480",";");function m(e,t,r,n){var i,o,a,l,d=e.createElement("div"),p=d.appendChild(e.createElement("table")),m=p.appendChild(e.createElement("tr")).appendChild(e.createElement("td"));m.setAttribute("colspan","4");var g=p.appendChild(e.createElement("tr"));g.appendChild(e.createElement("td")).appendChild(u.cancelButton(e)).addEventListener("click",(function(e){_(),n(null)}));var v=g.appendChild(e.createElement("td")).appendChild(u.button(e,f,"Retake"));v.addEventListener("click",(function(e){m.removeChild(l),w()})),v.style.visibility="collapse";var y=g.appendChild(e.createElement("td")).appendChild(u.button(e,c.icons.iconBase+"noun_10636.svg","Snap"));y.addEventListener("click",(function(){(l=e.createElement("canvas")).setAttribute("width","640"),l.setAttribute("height","480"),l.setAttribute("style",h),m.appendChild(l),l.getContext("2d").drawImage(a,0,0,l.width,l.height),a.parentNode.removeChild(a),l.toBlob((function(e){var t="got blob type ".concat(e.type," size ").concat(e.size);s.log(t),i=r(),o=e,b.style.visibility="visible",v.style.visibility="visible",y.style.visibility="collapse"}),"image/png")})),y.style.visibility="collapse";var b=g.appendChild(e.createElement("td")).appendChild(u.continueButton(e));function w(){if((a=m.appendChild(e.createElement("video"))).setAttribute("controls","1"),a.setAttribute("autoplay","1"),a.setAttribute("style",h),!navigator.mediaDevices)throw new Error("navigator.mediaDevices not available");navigator.mediaDevices.getUserMedia(x).then((function(e){a.srcObject=e,y.style.visibility="visible",b.style.visibility="collapse",v.style.visibility="collapse"}))}b.addEventListener("click",(function(e){!function(e,r){var i=e.type;s.log("Putting "+e.size+" bytes of "+i+" to "+r),t.fetcher.webOperation("PUT",r.uri,{data:e,contentType:i}).then((function(e){s.log("ok saved "+r),_(),n(r)}),(function(e){_(),alert(e)}))}(o,i)})),b.style.visibility="collapse";var x={video:!0};function _(){a&&a.srcObject&&a.srcObject.getVideoTracks().forEach((function(e){return e.stop()}))}return w(),d}},4440:(e,t,r)=>{"use strict";var n=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.messageArea=function(e,t,r,n,i){t=t||a.solidLogicSingleton.store,n=n.doc();var s,u,d=h.ns,p=c.Namespace("http://www.w3.org/2005/01/wf/flow#"),f=c.Namespace("http://purl.org/dc/terms/"),m=!!(i=i||{}).newestFirst,g="white-space: pre-wrap; width: 90%; font-size:100%; border: 0.07em solid #eee; padding: .2em 0.5em; margin: 0.1em 1em 0.1em 1em;",v=e.createElement("div"),y=a.solidLogicSingleton.store.updater,b=function(t,r){var n=e.createElement("a");return r&&r.uri&&(n.setAttribute("href",r.uri),n.addEventListener("click",h.widgets.openHrefInOutlineMode,!0),n.setAttribute("style","color: #3B5998; text-decoration: none; ")),n.textContent=t,n},w=function(t,r){var n=e.createElement("pre");return n.setAttribute("style",r||"color: grey"),v.appendChild(n),n.appendChild(e.createTextNode(t)),n},x=function(e){w(e,"color: #800;")};function _(e){var t=a.solidLogicSingleton.store.any(e,h.ns.foaf("nick"));return t?""+t.value:""+l.label(e)}function E(t,r,n,i){var o=t.appendChild(b(_(r),r));r.uri&&a.solidLogicSingleton.store.fetcher.nowOrWhenFetched(r.doc(),void 0,(function(e,t){o.textContent=_(r)})),t.appendChild(e.createElement("br")),t.appendChild(b(n,i))}function k(e,r){var n,i,o={};for(n=r.firstChild;n;n=n.nextSibling)n.AJAR_subject&&(o[n.AJAR_subject.uri]=!0);var a=t.each(e,d.wf("message")),s={};for(a.forEach((function(e){s[e.uri]=!0,o[e.uri]||S(e)})),n=r.firstChild;n;)i=n.nextSibling,n.AJAR_subject&&!s[n.AJAR_subject.uri]&&r.removeChild(n),n=i}var S=function(e){var r={"?msg":e,"?creator":t.any(e,d.foaf("maker")),"?date":t.any(e,f("created")),"?content":t.any(e,d.sioc("content"))};A(r,!0)},A=function(n,i){var o=n["?creator"],a=n["?msg"],c=n["?date"],u=n["?content"],l=c.value,d=e.createElement("tr");d.AJAR_date=l,d.AJAR_subject=a;for(var p=!1,f=s.firstChild;f;f=f.nextSibling)if(l>f.AJAR_date&&m||l<f.AJAR_date&&!m){s.insertBefore(d,f),p=!0;break}p||s.appendChild(d);var v=e.createElement("td");d.appendChild(v),E(v,o,h.widgets.shortDate(l),a);var b=e.createElement("td");d.appendChild(b);var w=e.createElement("p");w.setAttribute("style",g+(i?"background-color: #e8ffe8;":"background-color: #white;")),b.appendChild(w),w.textContent=u.value;var _=e.createElement("td");d.appendChild(_);var S=e.createElement("button");_.appendChild(S),S.textContent="-",d.setAttribute("class","hoverControl"),S.setAttribute("class","hoverControlHide"),S.setAttribute("style","color: red;"),S.addEventListener("click",(function(n){_.removeChild(S);var i=e.createElement("button");i.textContent="cancel",_.appendChild(i).addEventListener("click",(function(e){_.removeChild(o),_.removeChild(i),_.appendChild(S)}),!1);var o=e.createElement("button");o.textContent="Delete message",_.appendChild(o).addEventListener("click",(function(e){_.removeChild(o),_.removeChild(i),function(e){var n=t.statementsMatching(e).concat(t.statementsMatching(void 0,void 0,e));y.update(n,[],(function(e,t,n){t?k(r,s):x("Cant delete messages:"+n)}))}(a)}),!1)}),!1)};(s=e.createElement("table")).fresh=!1,v.appendChild(s),s.setAttribute("style","width: 100%;");var C,T=function(){var i=e.createElement("tr"),a=e.createElement("td"),s=e.createElement("td"),l=e.createElement("td");i.appendChild(a),i.appendChild(s),i.appendChild(l),i.AJAR_date="9999-01-01T00:00:00Z";var p,m,v=function(){p.setAttribute("class","pendingedit"),p.disabled=!0;var o=[],a=new Date,s=""+a.getTime(),l=c.term(a),m=t.sym(n.uri+"#Msg"+s);o.push(new c.Statement(r,d.wf("message"),m,n)),o.push(new c.Statement(m,d.sioc("content"),t.literal(p.value),n)),o.push(new c.Statement(m,f("created"),l,n)),u&&o.push(new c.Statement(m,d.foaf("maker"),u,n)),y.update([],o,(function(r,n,o){if(n){var a={"?msg":m,"?content":t.literal(p.value),"?date":l,"?creator":u};A(a,!1),p.value="",p.setAttribute("class",""),p.disabled=!1}else i.appendChild(h.widgets.errorMessageBlock(e,"Error writing message: "+o))}))};i.appendChild(e.createElement("br"));var b={div:s,dom:e};return o.ensureLoggedIn(b).then((function(t){u=t.me,E(a,u,"",null),p=e.createElement("textarea"),s.innerHTML="",s.appendChild(p),p.rows=3,p.setAttribute("style",g+"background-color: #eef;"),p.addEventListener("keyup",(function(e){13===e.keyCode&&(e.altKey||v())}),!1),l.innerHTML="",(m=h.widgets.button(e,h.icons.iconBase+"noun_383448.svg","Send")).setAttribute("style",h.style.buttonStyle+"float: right;"),m.addEventListener("click",v,!1),l.appendChild(m)})),i}();if(m?s.insertBefore(T,s.firstChild):s.appendChild(T),i.query)C=i.query;else{C=new c.Query("Messages");var O={};["msg","date","creator","content"].forEach((function(e){C.vars.push(O[e]=c.variable(e))})),C.pat.add(r,p("message"),O.msg),C.pat.add(O.msg,d.dct("created"),O.date),C.pat.add(O.msg,d.foaf("maker"),O.creator),C.pat.add(O.msg,d.sioc("content"),O.content)}return t.query(C,A,void 0,(function(){s.fresh=!0})),v.refresh=function(){k(r,s)},v};var i=r(1124),o=f(r(3210)),a=r(166),s=f(r(6590)),c=f(r(6022)),u=f(r(2853)),l=f(r(5666)),d=f(r(2457));function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(p=function(e){return e?r:t})(e)}function f(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=p(t);if(r&&r.has(e))return r.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}var h={icons:i.icons,ns:s,rdf:c,style:u,widgets:d}},6590:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698),o=n(r(3180)),a=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var c=o?Object.getOwnPropertyDescriptor(e,a):null;c&&(c.get||c.set)?Object.defineProperty(n,a,c):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}(r(6022));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}e.exports=(0,o.default)(a)},4004:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.getChunks=g,t.lightColorHash=m,Object.defineProperty(t,"manageParticipation",{enumerable:!0,get:function(){return d.manageParticipation}}),t.notepad=function(e,t,r,n,i){var l=(i=i||{}).exists,d=e.createElement("table"),p=f;if(n&&!n.uri)throw new Error("UI.pad.notepad: Invalid userid");var h=f.updater,g=(0,a.Namespace)("http://www.w3.org/ns/pim/pad#");d.setAttribute("style","padding: 1em; overflow: auto; resize: horizontal; min-width: 40em;");var v=null,y=null;if(i.statusArea){var b=i.statusArea.appendChild(e.createElement("table")).appendChild(e.createElement("tr"));v=b.appendChild(e.createElement("td")),y=b.appendChild(e.createElement("td")),v&&v.setAttribute("style","width:50%"),y&&y.setAttribute("style","width:50%")}var w=function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,u.log)(t),i.statusArea&&(r?v:y).appendChild((0,s.errorMessageBlock)(e,t,"pink"))},x=function(e){i.statusArea&&(i.statusArea.innerHTML="")},_=function(e,t,r){var n=e.subject;t=t||"";var i=p.any(n,o.dc("author"));!t&&i&&(t="color: "+(r?"#888":"black")+"; background-color: "+m(i)+";");var a=p.any(n,g("indent")),s=(a=a?a.value:0)>=0?"font-size: 100%; font-family: monospace; width: 100%; border: none; white-space: pre-wrap;text-indent: "+3*a+"em;":"font-family: sans-serif; font-weight: bold; border: none;"+["font-size: 110%; padding-top: 0.5em; padding-bottom: 0.5em; width: 100%;","font-size: 120%; padding-top: 1em; padding-bottom: 1em; width: 100%;","font-size: 150%; padding-top: 1em; padding-bottom: 1em; width: 100%;"][-1-a];e.setAttribute("style",s+t)},E=function(e){var n=e.subject;if(!n)throw new Error("No chunk for line to be deleted!");var i=p.any(void 0,g("next"),n),o=p.any(n,g("next"));if(i.sameTerm(r)&&o.sameTerm(r))(0,u.log)("You can't delete the only line.");else{var s=p.statementsMatching(n,void 0,void 0,t).concat(p.statementsMatching(void 0,void 0,n,t)),l=[(0,a.st)(i,g("next"),o,t)];if(n instanceof a.NamedNode){var d=n.uri.slice(-4);(0,u.log)("Deleting line "+d)}if(!h)throw new Error("have no updater");h.update(s,l,(function(t,r,i,o){if(r){var a=e.parentNode;if(a){var l=a.previousSibling;a.parentNode&&a.parentNode.removeChild(a),l&&l.firstChild&&l.firstChild.focus()}}else if(o&&409===o.status)_(e,"color: black; background-color: #ffd;"),e.state=0,(0,c.beep)(.5,512),setTimeout((function(){F()}),1e3);else{(0,u.log)(" removePart FAILED "+n+": "+i),(0,u.log)(" removePart was deleteing :'"+s),_(e,"color: black; background-color: #fdd;");var d=o?o.status:" [no response field] ";w("Error "+d+" saving changes: "+i.true)}}))}},k=function(e,r){e.addEventListener("keydown",(function(n){if(!h)throw new Error("no updater");var i,o;switch(n.keyCode){case 13:var s=n.shiftKey;if((0,u.log)("enter"),s?(o=p.any(void 0,g("next"),r),i="newlinesAfter"):(o=p.any(r,g("next")),i="newlinesBefore"),o[i]=o[i]||0,o[i]+=1,o[i]>1)return void(0,u.log)(" queueing newline queue = "+o[i]);(0,u.log)(" go ahead line before "+o[i]),A(e,s);break;case 8:if(0===e.value.length)switch((0,u.log)("Delete key line "+r.uri.slice(-4)+" state "+e.state),e.state){case 1:case 2:return void(e.state=4);case 3:case 4:return;case void 0:case 0:e.state=3,E(e),n.preventDefault();break;default:throw new Error("pad: Unexpected state "+e)}break;case 9:var c=n.shiftKey?-1:1;!function(e,r,n){var i=p.statementsMatching(r,g("indent")),o=i.length?Number(i[0].object.value):0;if(!(o+n<-3)){var s=o+n,c=(0,a.st)(r,g("indent"),s,t);if(!h)throw new Error("no updater");h.update(i,c,(function(r,n,i){n?_(e):((0,u.log)("Indent change FAILED '"+s+"' for "+t+": "+i),_(e,"color: black; background-color: #fdd;"),h.requestDownstreamAction(t,F))}))}}(e,r,c),n.preventDefault();break;case 27:(0,u.log)("escape"),h.requestDownstreamAction(t,F),n.preventDefault();break;case 38:e.parentNode.previousSibling&&(e.parentNode.previousSibling.firstChild.focus(),n.preventDefault());break;case 40:e.parentNode.nextSibling&&(e.parentNode.nextSibling.firstChild.focus(),n.preventDefault())}}));var n=function e(r){var n=r.subject;_(r,void 0,!0);var i,s=p.any(n,o.sioc("content")).value,l=[(0,a.st)(n,o.sioc("content"),s,t)];r.value&&(i=[(0,a.st)(n,o.sioc("content"),r.value,t)]);var d=r.value;if(r.lastSent&&s!==r.lastSent)throw new Error("Out of order, last sent expected '"+s+"' but found '"+r.lastSent+"'");if(r.lastSent=d,!h)throw new Error("no updater");h.update(l,i,(function(n,i,o,a){i?(x(),_(r),(0,u.log)(" Patch ok '"+s+"' -> '"+d+"' "),4===r.state?(r.state=3,E(r)):3===r.state||(2===r.state?(r.state=1,e(r)):r.state=0)):((0,u.log)(" patch FAILED "+a.status+" for '"+s+"' -> '"+d+"': "+o),409===a.status?(_(r,"color: black; background-color: #fdd;"),r.state=0,(0,c.beep)(.5,512),setTimeout((function(){h.requestDownstreamAction(t,F)}),1e3)):(_(r,"color: black; background-color: #fdd;"),r.state=0,w(" Error "+a.status+" sending data: "+o,!0),(0,c.beep)(1,128)))}))};e.addEventListener("input",(function(t){switch(_(e,void 0,!0),(0,u.log)("Input event state "+e.state+" value '"+e.value+"'"),e.state){case 3:case 4:case 2:return;case 1:return void(e.state=2);case 0:case void 0:e.state=1,n(e)}}))},S=function(t,r,i){var a=p.any(r,o.sioc("content"));a=a?a.value:"";var s=e.createElement("tr");i?d.insertBefore(s,t):t&&t.nextSibling?d.insertBefore(s,t.nextSibling):d.appendChild(s);var c=s.appendChild(e.createElement("input"));return c.subject=r,c.setAttribute("type","text"),c.value=a,n?(_(c,""),k(c,r)):(_(c,"color: #222; background-color: #fff"),(0,u.log)("Note can't add listeners - not logged in")),c},A=function e(i,c){var l,d,p,m,v,y=f,b=0,w=null;i?("input"!==i.tagName.toLowerCase()&&(0,u.log)("return pressed when current document is: "+i.tagName),l=i.subject,b=(b=y.any(l,g("indent")))?Number(b.value):0,c?(d=y.any(void 0,g("next"),l),p=l,m=d,w="newlinesAfter"):(d=l,p=y.any(l,g("next")),m=p,w="newlinesBefore"),v=i.parentNode):(d=r,p=r,v=void 0);var x=(0,s.newThing)(t),E=x.uri.slice(-4),k=[(0,a.st)(d,g("next"),p,t)],A=[(0,a.st)(d,g("next"),x,t),(0,a.st)(x,g("next"),p,t),(0,a.st)(x,o.dc("author"),n,t),(0,a.st)(x,o.sioc("content"),"",t)];if(b>0&&A.push((0,a.st)(x,g("indent"),b,t)),(0,u.log)(" Fresh chunk "+E+" proposed"),!h)throw new Error("no updater");h.update(k,A,(function(t,r,n,i){if(r){var o=S(v,x,c);_(o),o.focus(),w&&((0,u.log)(" Fresh chunk "+E+" updated, queue = "+m[w]),m[w]-=1,m[w]>0&&((0,u.log)(" Implementing queued newlines = "+p.newLinesBefore),e(o,c)))}else(0,u.log)(" ERROR writing new line "+E+": "+n)}))},C=function(){var e={},t=0;function n(e){w(e),t++}if(!p.the(r,g("next")))return n("No initial next pointer"),!1;for(var i,a=r;(i=p.the(a,g("next")))||n("No next pointer from "+a),!i.sameTerm(r);){a=i;var s=i.uri.split("#")[1];if(e[i.uri])return n("Loop!"),!1;e[i.uri]=!0;var c=p.each(i,g("next")).length;1!==c&&n("Should be 1 not "+c+" next pointer for "+s),(c=p.each(i,g("indent")).length)>1&&n("Should be 0 or 1 not "+c+" indent for "+s),1!==(c=p.each(i,o.sioc("content")).length)&&n("Should be 1 not "+c+" contents for "+s),1!==(c=p.each(i,o.dc("author")).length)&&n("Should be 1 not "+c+" author for "+s),p.statementsMatching(void 0,o.sioc("contents")).forEach((function(t){e[t.subject.value]||n("Loose chunk! "+t.subject.value)}))}return!t},T=function(){if(1!==p.each(r,g("next")).length){var e="Pad: Inconsistent data - NEXT pointers: "+p.each(r,g("next")).length;return(0,u.log)(e),void(i.statusArea&&(i.statusArea.textContent+=e))}for(var t,n=[],a=p.the(r,g("next"));!a.sameTerm(r);a=p.the(a,g("next")))for(var s=0;s<d.children.length;s++){var c=d.children[s];c.firstChild&&c.firstChild.subject.sameTerm(a)&&(n[a.uri]=c.firstChild)}for(var l=d.children.length-1;l>=0;l--)n[(t=d.children[l]).firstChild.subject.uri]||d.removeChild(t);t=d.firstChild;for(var f=p.the(r,g("next"));!f.sameTerm(r);f=p.the(f,g("next"))){var h=p.any(f,o.sioc("content")).value;if(t&&n[f.uri]){var m=t.firstChild;h!==m.value&&(m.value=h),_(m),m.state=0,delete m.lastSent,t=t.nextSibling}else S(t,f,!0)}},O=function e(t){if(t.refresh)t.refresh();else for(var r=0;r<t.children.length;r++)e(t.children[r])},P=!1,F=function(){if(P)(0,u.log)(" Already reloading - stop");else{P=!0;var e=1e3;!function r(){if((0,u.log)("try reload - timeout = "+e),!h)throw new Error("no updater");h.reload(h.store,t,(function(n,i,o){P=!1,n?((0,u.log)(" reloaded OK"),x(),C()?O(d):w("CONSITENCY CHECK FAILED")):0===o.status?(w("Network error refreshing the pad. Retrying in "+e/1e3),P=!0,e*=2,setTimeout(r,e)):w("Error "+o.status+"refreshing the pad:"+i+". Stopped. "+t)}))}()}};if(d.refresh=T,d.reloadAndSync=F,n||(0,u.log)("Warning: must be logged in for pad to be edited"),l)(0,u.log)("Existing pad."),C()?(T(),p.holds(r,g("next"),r)&&A()):(0,u.log)(d.textContent="Inconsistent data. Abort");else{(0,u.log)("No pad exists - making new one.");var I=[(0,a.st)(r,o.rdf("type"),g("Notepad"),t),(0,a.st)(r,o.dc("author"),n,t),(0,a.st)(r,o.dc("created"),new Date,t),(0,a.st)(r,g("next"),r,t)];if(!h)throw new Error("no updater");h.update([],I,(function(e,t,r){t?((0,u.log)("Initial pad created"),A()):w(r||"")}))}return d},t.notepadToHTML=function(e,t){var r=g(e,t),n="<html>\n <head>\n",i=t.anyValue(e,o.dct("title"));i&&(n+=" <title>".concat(v(i),"</title>\n")),n+=" </head>\n <body>\n";var a=0;function s(e){for(;a>e;a--)n+="</ul>\n"}return r.forEach((function(e){var r=t.anyJS(e,h("indent")),i=t.anyJS(e,o.sioc("content"));if(i){var c=v(i);if(r<0){s(0);var u=r>=-3?4+r:1;n+="\n<h".concat(u,">").concat(c,"</h").concat(u,">\n")}else r>0?(s(r),function(e){for(;a<e;a++)n+="<ul>\n"}(r),n+="<li>".concat(c,"</li>\n")):(s(r),n+="<p>".concat(c,"</p>\n"))}})),s(0),n+=" </body>\n</html>\n"},Object.defineProperty(t,"participationObject",{enumerable:!0,get:function(){return d.participationObject}}),Object.defineProperty(t,"recordParticipation",{enumerable:!0,get:function(){return d.recordParticipation}}),Object.defineProperty(t,"renderPartipants",{enumerable:!0,get:function(){return d.renderPartipants}}),t.xmlEncode=v;n(r(9728)),n(r(6690)),n(r(6115)),n(r(1655)),n(r(4993)),n(r(3808)),n(r(3496)),n(r(8416));var o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=p(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}(r(6590)),a=r(6022),s=r(2457),c=r(5666),u=r(4433),l=r(166),d=r(8412);function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(p=function(e){return e?r:t})(e)}var f=l.solidLogicSingleton.store,h=(0,a.Namespace)("http://www.w3.org/ns/pim/pad#");function m(e){var t;return e&&e.uri?"#"+(16777215&(t=e.uri,t.split("").reduce((function(e,t){return(e=(e<<5)-e+t.charCodeAt(0))&e}),0))|12632256).toString(16):"#ffffff"}function g(e,t){for(var r=[],n=t.the(e,h("next"));!n.sameTerm(e);n=t.the(n,h("next")))r.push(n);return r}function v(e){return e.replace("&","&amp;").replace("<","&lt;").replace(">","&gt;")}HTMLElement,HTMLElement},8412:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.manageParticipation=function(e,t,r,n,i,o){var a=e.createElement("table");t.appendChild(a),g(e,a,0,n,0,o);try{v(n,r,a)}catch(r){t.appendChild((0,c.errorMessageBlock)(e,"Error recording your partipation: "+r))}return a},t.participationObject=function(e,t,r){return new Promise((function(n,i){if(!r)throw new Error("No user id");var u=m.each(e,s.wf("participation")).filter((function(e){return m.holds(e,s.wf("participant"),r)}));if(u.length>1){var d,p=[],f=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(e,t):void 0}}(e))){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(u);try{for(f.s();!(d=f.n()).done;){var g=d.value,v=m.anyValue(g,s.cal("dtstart"));v&&p.push([v,g])}}catch(e){f.e(e)}finally{f.f()}p.sort(),o.warn("Multiple particpation objects, picking earliest, in "+t),n(p[0][1])}if(u.length)n(u[0]);else{var y=(0,c.newThing)(t),b=[(0,a.st)(e,s.wf("participation"),y,t),(0,a.st)(y,s.wf("participant"),r,t),(0,a.st)(y,s.cal("dtstart"),new Date,t),(0,a.st)(y,s.ui("backgroundColor"),(0,l.lightColorHash)(r),t)];m.updater.update([],b,(function(e,t,r){t?n(y):i(new Error("Error recording your partipation: "+r))})),n(y)}}))},t.recordParticipation=v,t.renderPartipants=g;n(r(9728)),n(r(6690)),n(r(6115)),n(r(1655)),n(r(4993)),n(r(3808)),n(r(3496)),n(r(8416));var o=f(r(4433)),a=r(6022),s=f(r(6590)),c=r(2457),u=r(5666),l=r(4004),d=r(166);function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(p=function(e){return e?r:t})(e)}function f(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=p(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}HTMLTableElement;var m=d.solidLogicSingleton.store;function g(e,t,r,n,i,a){t.setAttribute("style","margin: 0.8em;");var l=function(r){var n,i=m.any(r,s.wf("participant"));if(!i)return(n=e.createElement("tr")).textContent="???",n;var o=m.anyValue(r,s.ui("backgroundColor"))||"white",u=e.createElement("div");u.setAttribute("style","height: 1.5em; width: 1.5em; margin: 0.3em; border 0.01em solid #888; background-color: "+o),n=(0,c.personTR)(e,null,i,a),t.appendChild(n);var l=e.createElement("td");return l.setAttribute("style","vertical-align: middle;"),l.appendChild(u),n.insertBefore(l,n.firstChild),n},d=function(){var e=m.each(n,s.wf("participation")).map((function(e){return(0,o.log)("in participants"),[m.anyValue(e,s.cal("dtstart"))||"9999-12-31",e]}));e.sort();var r=e.map((function(e){return e[1]}));(0,u.syncTableToArray)(t,r,l)};return t.refresh=d,d(),t}function v(e,t,r){var n=d.authn.currentUser();if(n){var i=m.each(e,s.wf("participation")).filter((function(e){return m.holds(e,s.wf("participant"),n)}));if(i.length>1)throw new Error("Multiple records of your participation");if(i.length)return i[0];if(!m.updater.editable(t))return o.log("Not recording participation, as no write acesss as "+n+" to "+t),null;var u=(0,c.newThing)(t),p=[(0,a.st)(e,s.wf("participation"),u,t),(0,a.st)(u,s.wf("participant"),n,t),(0,a.st)(u,s.cal("dtstart"),new Date,t),(0,a.st)(u,s.ui("backgroundColor"),(0,l.lightColorHash)(n),t)];return m.updater.update([],p,(function(e,t,n){if(!t)throw new Error("Error recording your partipation: "+n);r&&r.refresh&&r.refresh()})),u}}},3489:(e,t,r)=>{"use strict";var n=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.get=function(e){return h[e]},t.getPreferencesForClass=function(e,t,r,n){return new Promise((function(i,o){m(e,n).then((function(n){var a=n.sharedPreferences;if(n.me)u.participationObject(e,e.doc(),n.me).then((function(e){g(t,n).then((function(t){var n=[],o=t.personalDefaults;r.forEach((function(t){var r=f.any(e,t)||f.any(a,t)||f.any(o,t);r&&(n[t.uri]=v(r))})),i(n)}),o)}),o);else{var s=[];r.forEach((function(e){var t=f.any(a,e);t&&(s[e.uri]=v(t))})),i(s)}}))}))},t.recordPersonalDefaults=g,t.recordSharedPreferences=m,t.renderPreferencesForm=function(e,t,r,n){var i=n.dom.createElement("div");return u.participationObject(e,e.doc(),n.me).then((function(o){var a=n.dom;function s(e){i.appendChild(a.createElement("h5")).textContent=e}s("My view of this "+n.noun),l.appendForm(a,i,{},o,r,e.doc(),(function(e,t){e||l.complain(n,t)})),s("Everyone's view of this "+n.noun),m(e,n).then((function(n){var o=n.sharedPreferences;l.appendForm(a,i,{},o,r,e.doc(),(function(e,t){e||l.complain(n,t)})),s("My default view of any "+n.noun),g(t,n).then((function(e){l.appendForm(a,i,{},e.personalDefaults,r,e.preferencesFile,(function(t,r){t||l.complain(e,r)}))}),(function(e){l.complain(n,e)}))}))}),(function(e){i.appendChild(l.errorMessageBlock(n.dom,e))})),i},t.set=function(e,t){if("string"!=typeof t)throw a.log("Non-string value of preference "+e+": "+t),new Error("Non-string value of preference "+e+": "+t);this.value[e]=t},t.value=void 0;var i=p(r(6022)),o=r(166),a=p(r(4433)),s=r(3210),c=p(r(6590)),u=p(r(8412)),l=p(r(2457));function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(d=function(e){return e?r:t})(e)}function p(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=d(t);if(r&&r.has(e))return r.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}var f=o.store,h=[];function m(e,t){return new Promise((function(r,n){var o=f.any(e,c.ui("sharedPreferences"));if(o)t.sharedPreferences=o,r(t);else{var s=i.sym(e.doc().uri+"#SharedPreferences"),u=[i.st(e,c.ui("sharedPreferences"),s,e.doc())];a.log("Creating shared preferences "+s),f.updater.update([],u,(function(e,i,o){i?(t.sharedPreferences=s,r(t)):n(new Error("Error creating shared prefs: "+o))}))}}))}function g(e,t){return new Promise((function(r,n){(0,s.ensureLoadedPreferences)(t).then((function(t){if(t.preferencesFile){var o,s,u=f.each(null,c.solid("forClass"),e,t.preferencesFile),d=[];if(u.length){if(u.forEach((function(e){o=o||f.any(e,c.solid("personalDefaults"))})),o)return t.personalDefaults=o,void r(t);o=l.newThing(t.preferencesFile),s=u[0]}else s=l.newThing(t.preferencesFile),d=[i.st(s,c.rdf("type"),c.solid("TypeRegistration"),t.preferencesFile),i.st(s,c.solid("forClass"),e,t.preferencesFile)];o=l.newThing(t.preferencesFile),d.push(i.st(s,c.solid("personalDefaults"),o,t.preferencesFile)),f.updater.update([],d,(function(i,a,s){a?(t.personalDefaults=o,r(t)):n(new Error("Setting preferences for "+e+": "+s))}))}else a.log("Not doing private class preferences as no access to preferences file. "+t.preferencesFileError)}),(function(e){n(e)}))}))}function v(e){return e.datatype?e.datatype.equals(c.xsd("boolean"))?"1"===e.value:e.datatype.equals(c.xsd("dateTime"))||e.datatype.equals(c.xsd("date"))?new Date(e.value):e.datatype.equals(c.xsd("integer"))||e.datatype.equals(c.xsd("float"))||e.datatype.equals(c.xsd("decimal"))?Number(e.value):e.value:e}t.value=h},8677:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={authEndpoint:"",fallbackAuthEndpoint:"https://databox.me/",signupEndpoint:"https://solidproject.org/use-solid/",signupWindowHeight:600,signupWindowWidth:1024,key:"",cert:""}},4412:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.Signup=o;var i=n(r(8677));function o(e){this.config=e||i.default}o.prototype.listen=function(){return new Promise((function(e,t){var r=window.addEventListener?"addEventListener":"attachEvent";(0,window[r])("attachEvent"===r?"onmessage":"message",(function(r){var n=r.data;if("User:"===n.slice(0,5)){var i=n.slice(5,n.length);return i&&i.length>0&&"http"===i.slice(0,4)?e(i):t(i)}}),!0)}))},o.prototype.signup=function(e){e=e||this.config.signupEndpoint;var t=this.config.signupWindowWidth,r=this.config.signupWindowHeight,n=window.screen.width/2-(t/2+10),i=window.screen.height/2-(r/2+50),o=e+"?origin="+encodeURIComponent(window.location.origin),a="resizable,scrollbars,status,width="+t+",height="+r+",left="+n+",top="+i;window.open(o,"Solid signup",a);var s=this;return new Promise((function(e){s.listen().then((function(t){return e(t)}))}))}},2853:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.style=void 0;var r="#888888",n={checkboxStyle:"color: black; font-size: 100%; padding-left: 0.5 em; padding-right: 0.5 em;",checkboxInputStyle:"font-size: 150%; height: 1.2em; width: 1.2em; background-color: #eef; border-radius:0.2em; margin: 0.1em",fieldLabelStyle:"color: #3B5998; text-decoration: none;",formSelectSTyle:"background-color: #eef; padding: 0.5em; border: .05em solid #88c; border-radius:0.2em; font-size: 100%; margin:0.4em;",textInputStyle:"background-color: #eef; padding: 0.5em; border: .05em solid #88c; border-radius:0.2em; font-size: 100%; margin:0.4em;",textInputStyleUneditable:"background-color: white; padding: 0.5em; border: .05em solid white; border-radius:0.2em; font-size: 100%; margin:0.4em;",textInputSize:20,buttonStyle:"background-color: #fff; padding: 0.7em; border: .01em solid white; border-radius:0.2em; font-size: 100%; margin: 0.3em;",commentStyle:"padding: 0.7em; border: none; font-size: 100%; white-space: pre-wrap;",iconStyle:"width: 3em; height: 3em; margin: 0.1em; border-radius: 1em;",smallButtonStyle:"margin: 0.2em; width: 1em; height:1em;",classIconStyle:"width: 3em; height: 3em; margin: 0.1em; border-radius: 0.2em; border: 0.1em solid green; padding: 0.2em; background-color: #efe;",confirmPopupStyle:"padding: 0.7em; border-radius: 0.2em; border: 0.1em solid orange; background-color: white; box-shadow: 0.5em 0.9em #888;",tabBorderRadius:"0.2em",messageBodyStyle:"white-space: pre-wrap; width: 99%; font-size:100%; border: 0.07em solid #eee; border-radius:0.2em; padding: .3em 0.5em; margin: 0.1em;",pendingeditModifier:"color: #bbb;",highlightColor:"#7C4DFF",personaBarStyle:"width: 100%; height: 4em; background-color: #eee; vertical-align: middle;",searchInputStyle:"border: 0.1em solid #444; border-radius: 0.2em; width: 100%; font-size: 100%; padding: 0.1em 0.6em; margin 0.2em;",autocompleteRowStyle:"border: 0.2em solid straw;",signInButtonStyle:"padding: 1em; border-radius:0.2em; font-size: 100%;",heading1Style:"font-size: 180%; font-weight: bold; color: #888888; padding: 0.5em; margin: 0.7em 0.0m;",heading2Style:"font-size: 130%; font-weight: bold; color: #888888; padding: 0.4em; margin: 0.7em 0.0em;",heading3Style:"font-size: 120%; font-weight: bold; color: #888888; padding: 0.3em; margin: 0.7em 0.0em;",heading4Style:"font-size: 110%; font-weight: bold; color: #888888; padding: 0.2em; margin: 0.7em 0.0em;",formBorderColor:r,formHeadingColor:"#888888",formHeadingStyle:"font-size: 110%; font-weight: bold; color: #888888; padding: 0.2em; margin: 0.7em 0.0em;",formTextInput:"font-size: 100%; margin: 0.1em; padding: 0.1em;",formGroupStyle:["padding-left: 0em; border: 0.0em solid ".concat(r,"; border-radius: 0.2em;"),"padding-left: 2em; border: 0.05em solid ".concat(r,"; border-radius: 0.2em;"),"padding-left: 2em; border: 0.1em solid ".concat(r,"; border-radius: 0.2em;"),"padding-left: 2em; border: 0.2em solid ".concat(r,"; border-radius: 0.2em;")],formFieldLabelStyle:"'color: ".concat("#3B5998","; text-decoration: none;'"),formFieldNameBoxWidth:"8em",formFieldNameBoxStyle:"padding: 0.3em; vertical-align: middle; width:".concat("8em",";"),textInputBackgroundColor:"#eef",textInputBackgroundColorUneditable:"#fff",textInputColor:"#000",textInputColorPending:"#888",multilineTextInputStyle:"font-size:100%; white-space: pre-wrap; background-color: #eef; border: 0.07em solid gray; padding: 1em 0.5em; margin: 1em 1em;",renderAsDivStyle:"display: flex; align-items: center; justify-content: space-between; height: 2.5em; padding: 1em;",imageDivStyle:"width:2.5em; padding:0.5em; height: 2.5em;",linkDivStyle:"width:2em; padding:0.5em; height: 4em;",aclControlBoxContainer:"margin: 1em",aclControlBoxHeader:"font-size: 120%; margin: 0 0 1rem",aclControlBoxStatus:"display: none; margin: 1rem 0",aclControlBoxStatusRevealed:"display: block",aclGroupContent:"maxWidth: 650",accessGroupList:"display: grid; grid-template-columns: 1fr; margin: 1em; width: 100%",accessGroupListItem:"display: grid; grid-template-columns: 100px auto 30%",defaultsController:"display: flex",defaultsControllerNotice:"color: #888; flexGrow: 1; fontSize: 80%",bigButton:"background-color: white; border: 0.1em solid #888; border-radius: 0.3em; max-width: 50%; padding-bottom: 1em; padding-top: 1em",group:"color: #888",group1:"color: green",group2:"color: #cc0",group3:"color: orange",group5:"color: red",group9:"color: blue",group13:"color: purple",trustedAppAddApplicationsTable:"background-color: #eee",trustedAppCancelButton:"float: right",trustedAppControllerI:"border-color: orange; borderRadius: 1em; borderWidth: 0.1em",temporaryStatusInit:"background: green",temporaryStatusEnd:"background: transparent; transition: background 5s linear",headerUserMenuLink:"background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%; text-decoration: none",headerUserMenuLinkHover:"background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%; text-decoration: none; background-image: linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)",headerUserMenuTrigger:"background: none; border: 0; cursor: pointer; width: 60px; height: 60px",headerUserMenuTriggerImg:"border-radius: 50%; height: 56px; width: 28px !important",headerUserMenuButton:"background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%",headerUserMenuButtonHover:"background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%; background-image: linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)",headerUserMenuList:"list-style: none; margin: 0; padding: 0",headerUserMenuListDisplay:"list-style: none; margin: 0; padding: 0; display:true",headerUserMenuNavigationMenu:"background: white; border: solid 1px #000000; border-right: 0; position: absolute; right: 0; top: 60px; width: 200px; z-index: 1; display: true",headerUserMenuNavigationMenuNotDisplayed:"background: white; border: solid 1px #000000; border-right: 0; position: absolute; right: 0; top: 60px; width: 200px; z-index: 1; display: none",headerUserMenuListItem:"border-bottom: solid 1px #000000",headerUserMenuPhoto:"border-radius: 50%; background-position: center; background-repeat: no-repeat; background-size: cover; height: 50px; width: 50px",headerBanner:"box-shadow: 0px 1px 4px #000000; display: flex; justify-content: space-between; padding: 0 1.5em; margin-bottom: 4px",headerBannerLink:"display: block",headerBannerRightMenu:"display: flex",headerBannerLogin:"margin-left: auto",allChildrenVisible:"display:true",headerBannerLoginInput:"margin: 0.75em 0 0.75em 0.5em !important; padding: 0.5em !important",headerBannerUserMenu:"border-left: solid 1px #000000; margin-left: auto",headerBannerHelpMenu:"border-left: solid 1px #000000; margin.left: auto",headerBannerIcon:"background-size: 65px 60px !important; height: 60px !important; width: 65px !important",footer:"border-top: solid 1px $divider-color; font-size: 0.9em; padding: 0.5em 1.5em",primaryButton:"background-color: #7c4dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none",primaryButtonHover:"background-color: #9f7dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out",primaryButtonNoBorder:"background-color: #ffffff; color: #7c4dff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none",primaryButtonNoBorderHover:"background-color: #7c4dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em; text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out",secondaryButton:"background-color: #01c9ea; color: #ffffff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #01c9ea; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none",secondaryButtonHover:"background-color: #37cde6; color: #ffffff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out",secondaryButtonNoBorder:"background-color: #ffffff; color: #01c9ea; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #01c9ea; border: 1px solid; cursor: pointer; font-size: .8em; text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none",secondaryButtonNoBorderHover:"background-color: #01c9ea; color: #ffffff; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #01c9ea; border: 1px solid; cursor: pointer; font-size: .8em; text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out"};t.style=n,n.setStyle=function(e,t){e.style=n[t]},e.exports=n},4946:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.style=void 0;var r={multiselect__container:"\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n background-color: #fff;\n border-radius: 2px;\n -webkit-box-shadow: 0 1px 3px 0 #d1d1d2, 0 0 0 1px #d1d1d2;\n box-shadow: 0 1px 3px 0 #d1d1d2, 0 0 0 1px #d1d1d2;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n min-height: 36px;\n padding: 4px 8px 0 8px;\n position: relative;\n width: 354px;\n margin-bottom: 5px;\n font-size: 100%\n ",multiselect__wrapper:"\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n height: 100%;\n width: 100%;\n ",multiselect__clear_btn:"\n cursor: pointer;\n align-items: center;\n margin-bottom: 4px;\n margin-left: 4px;\n ",multiselect__options:"\n background-color: #f6f6f6;\n border-radius: 2px;\n left: 0;\n max-height: 0;\n overflow: hidden;\n position: absolute;\n top: calc(100% + 3px);\n z-index: 9999;\n width: 100%;\n opacity: 0;\n transition: max-height 0.1s ease;\n ",multiselect__options_visible:"\n background-color: #f6f6f6;\n border-radius: 2px;\n left: 0;\n max-height: 0;\n overflow: hidden;\n position: absolute;\n top: calc(100% + 3px);\n z-index: 9999;\n width: 100%;\n opacity: 0;\n transition: max-height 0.1s ease;\n max-height: 200px;\n -webkit-box-shadow: 0 1px 3px 0 #d1d1d2, 0 0 0 1px #d1d1d2;\n box-shadow: 0 1px 3px 0 #d1d1d2, 0 0 0 1px #d1d1d2;\n opacity: 1;\n transition: max-height 0.2s ease;\n ",multiselect__options_ul:"\n list-style: none;\n margin: 0;\n padding: 2px 0;\n max-height: 200px;\n overflow: auto;\n ",multiselect__options_ul_li:"\n cursor: pointer;\n padding: 4px 8px;\n ",multiselect__options_ul_li_hover:"\n background-color: #dedede;\n ",multiselect__options_ul_p_multiselect__options_no_results:"\n margin: 0;\n padding: 8px;\n text-align: center;\n ",multiselect__options_ul_p_multiselect__options_no_data:"\n margin: 0;\n padding: 8px;\n text-align: center;\n ",multiselect__options_ul_li_multiselect__options_selected:"\n background-color: #656565;\n color: #fff;\n ",multiselect__options_ul_li_multiselect__options_selected_hover:"\n background-color: #656565;\n ",multiselect__options_ul_li_arrow_selected:"\n border: 2px solid rgba(101, 101, 101, 0.5);\n ",multiselect__selected:"\n background-color: #656565;\n border-radius: 2px;\n color: #fff;\n margin-bottom: 4px;\n margin-right: 4px;\n padding: 4px 8px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n ",multiselect__selected_multiselect__remove_btn:"\n cursor: pointer;\n display: flex;\n margin-left: 6px;\n ",multiselect__input:"\n border: none;\n -ms-flex-preferred-size: 40%;\n flex-basis: 40%;\n -webkit-box-flex: 1;\n -ms-flex-positive: 1;\n flex-grow: 1;\n height: 5px; \n margin-bottom: 4px;\n min-width: 40%;\n outline: none; \n "};t.style=r,r.setStyle=function(e,t){e.style=r[t]},e.exports=r},303:(e,t,r)=>{"use strict";var n=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.renderTableViewPane=function(e,t){var r,n,o,s,c=t.sourceDocument,d=t.tableClass,p=t.query,f=h.ns,m=a.store,g={},v={"http://www.w3.org/2002/07/owl#sameAs":!0,"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":!0},y={"http://www.w3.org/2001/XMLSchema#decimal":!0,"http://www.w3.org/2001/XMLSchema#float":!0,"http://www.w3.org/2001/XMLSchema#double":!0,"http://www.w3.org/2001/XMLSchema#integer":!0,"http://www.w3.org/2001/XMLSchema#nonNegativeInteger":!0,"http://www.w3.org/2001/XMLSchema#positiveInteger":!0,"http://www.w3.org/2001/XMLSchema#nonPositiveInteger":!0,"http://www.w3.org/2001/XMLSchema#negativeInteger":!0,"http://www.w3.org/2001/XMLSchema#long":!0,"http://www.w3.org/2001/XMLSchema#int":!0,"http://www.w3.org/2001/XMLSchema#short":!0,"http://www.w3.org/2001/XMLSchema#byte":!0,"http://www.w3.org/2001/XMLSchema#unsignedLong":!0,"http://www.w3.org/2001/XMLSchema#unsignedInt":!0,"http://www.w3.org/2001/XMLSchema#unsignedShort":!0,"http://www.w3.org/2001/XMLSchema#unsignedByte":!0},b={"http://www.w3.org/2001/XMLSchema#dateTime":!0,"http://www.w3.org/2001/XMLSchema#date":!0},w={"http://xmlns.com/foaf/0.1/Image":!0,"http://purl.org/dc/terms/Image":!0},x=t.keyVariable||"?_row",_=0,E=null,k=null,S=e.createElement("div");S.className="tableViewPane",S.appendChild(function(){var t=e.createElement("table");t.setAttribute("class","toolbar");var r=e.createElement("tr");return o=e.createElement("td"),r.appendChild(o),s=e.createElement("td"),r.appendChild(s),t.appendChild(r),t}());var A,C=e.createElement("div");if(S.appendChild(C),S.refresh=function(){Y(A.query,A.logicalRows,A.columns,A)},p)A=te(p),C.appendChild(A);else{var T=function(){var e,t,r=function(){for(var e={},t=m.statementsMatching(void 0,h.ns.rdf("type"),d,c),r={},n=0;n<t.length;++n){var i=t[n].object;if("NamedNode"===i.termType){var o=L(e,i);i.uri in r||(r[i.uri]=[]),r[i.uri].push(t[n].subject),o.addUse()}}return[r,e]}();for(var n in e=r[0],t=r[1],e){var i=e[n];M(t[n],i)}return[new F(null),N(t)]}();r=T[0],n=T[1],d||o.appendChild(function(t,r){var n=e.createElement("div");n.appendChild(e.createTextNode("Select type: "));var i=e.createElement("select");for(var o in i.appendChild(j("All types","null")),r)i.appendChild(j(r[o].getLabel(),o));return i.addEventListener("click",(function(){O("null"===i.value?t:r[i.value])}),!1),n.appendChild(i),n}(r,n)),k=function(e){var t,r=-1,n=null;for(t in e){var i=e[t];i.useCount>r&&(n=i,r=i.useCount)}return n}(n),O(k||r)}return S;function O(t){P(s),s.appendChild(function(t){var r=e.createElement("div"),n=t.getUnusedColumns();if(n.sort((function(e,t){var r=e.sortKey(),n=t.sortKey();return(r>n)-(r<n)})),n.length>0){r.appendChild(e.createTextNode("Add column: "));var i=e.createElement("select");i.appendChild(j("","-1"));for(var o=0;o<n.length;++o){var a=n[o];i.appendChild(j(a.getLabel(),""+o))}r.appendChild(i),i.addEventListener("click",(function(){var e=Number(i.value);e>=0&&(t.addColumn(n[e]),O(t))}),!1)}return r}(t)),function(e,t){E&&(E.running=!1);var r=te(e,t);P(C),C.appendChild(r),E=e}(function(e){var t=new u.Query,r=m.variable(x.slice(1));return function(e,t){for(var r=t.getColumns(),n=0;n<r.length;++n){var i=m.variable("_col"+n);e.vars.push(i),r[n].setVariable(i)}}(t,e),function(e,t,r){var n=r.type;n||(n=m.variable("_any")),e.pat.add(t,h.ns.rdf("type"),n)}(t,r,e),function(e,t,r){for(var n=r.getColumns(),i=0;i<n.length;++i){var o=n[i],a=m.formula();a.add(t,o.predicate,o.getVariable()),e.pat.optional.push(a)}}(t,r,e),t}(t),t)}function P(e){for(;e.childNodes.length>0;)e.removeChild(e.childNodes[0])}function F(e){this.type=e,this.columns=null,this.allColumns=[],this.useCount=0,this.getAllColumns=function(){return this.allColumns},this.getColumns=function(){if(!this.columns){var e=this.getAllColumns();this.columns=e.slice(0,7)}return this.columns},this.getUnusedColumns=function(){for(var e=this.getAllColumns(),t=this.getColumns(),r=[],n=0;n<e.length;++n)-1===t.indexOf(e[n])&&r.push(e[n]);return r},this.addColumn=function(e){this.columns.push(e)},this.removeColumn=function(e){this.columns=this.columns.filter((function(t){return t!==e}))},this.getLabel=function(){return l.label(this.type)},this.addUse=function(){this.useCount+=1}}function I(){this.useCount=0,this.checkedAnyValues=!1,this.possiblyLiteral=!0,this.possiblyNumber=!0,this.constraints=[],this.checkValue=function(e){var t=e.termType;this.possiblyLiteral&&"Literal"!==t&&"NamedNode"!==t?(this.possiblyNumber=!1,this.possiblyLiteral=!1):this.possiblyNumber&&("Literal"!==t?this.possiblyNumber=!1:e.value.match(/^-?\d+(\.\d*)?$/)||(this.possiblyNumber=!1)),this.checkedAnyValues=!0},this.getVariable=function(){return this.variable},this.setVariable=function(e){this.variable=e},this.getKey=function(){return this.variable.toString()},this.addUse=function(){this.useCount+=1},this.getHints=function(){return t&&t.hints&&this.variable&&t.hints[this.variable.toNT()]?t.hints[this.variable.toNT()]:{}},this.getLabel=function(){return this.getHints().label?this.getHints().label:this.predicate?this.predicate.sameTerm(f.rdf("type"))&&this.superClass?l.label(this.superClass,!0):l.label(this.predicate):this.variable?this.variable.toString():"unlabeled column?"},this.setPredicate=function(e,t,r){t?(this.inverse=e,this.constraints=this.constraints.concat(m.each(e,h.ns.rdfs("domain"))),e.sameTerm(f.rdfs("subClassOf"))&&"NamedNode"===r.termType&&(this.superClass=r,this.alternatives=m.each(void 0,f.rdfs("subClassOf"),r))):(this.predicate=e,this.constraints=this.constraints.concat(m.each(e,h.ns.rdfs("range"))))},this.getConstraints=function(){return this.constraints},this.filterFunction=function(){return!0},this.sortKey=function(){return this.getLabel().toLowerCase()},this.isImageColumn=function(){for(var e=0;e<this.constraints.length;e++)if(this.constraints[e].uri in w)return!0;return!1}}function N(e,t){var r=[];for(var n in e){var i=e[n];t&&!t(n,i)||r.push(i)}return r}function j(t,r){var n=e.createElement("option");return n.setAttribute("value",r),n.appendChild(e.createTextNode(t)),n}function R(e,t){var r;return t.uri in e?r=e[t.uri]:((r=new I).setPredicate(t),e[t.uri]=r),r}function L(e,t){var r;return t.uri in e?r=e[t.uri]:(r=new F(t),e[t.uri]=r),r}function D(e,t){for(var r=m.statementsMatching(e,void 0,void 0,c),n={},i=0;i<r.length;++i){var o=r[i].predicate;if(!(o.uri in v)){var a=R(t,o);a.checkValue(r[i].object),n[o.uri]=a}}return n}function M(e,t){for(var r={},n=0;n<t.length;++n){var i=D(t[n],r);for(var o in i)i[o].addUse()}var a=N(r);!function(e){e.sort((function(e,t){return(e.useCount<t.useCount)-(e.useCount>t.useCount)}))}(a),e.allColumns=a}function U(t,r){var n=e.createElement("a");return n.appendChild(e.createTextNode("[x]")),n.addEventListener("click",(function(){t.removeColumn(r),O(t)}),!1),n}function B(e,t){for(var r=!0,n=0;n<t.length;++n){var i=t[n],o=i.getKey(),a=null;if(o in e.values&&(a=e.values[o][0]),!i.filterFunction(a)){r=!1;break}}e._htmlRow.style.display=r?"":"none"}function H(e,t){for(var r=0;r<e.length;++r)B(e[r],t)}function q(e,t,r){function n(e){return e?"Literal"===e.termType?e.value.toLowerCase():"NamedNode"===e.termType?l.label(e).toLowerCase():e.value.toLowerCase():""}!function(e,t,r,i){var o=t.getKey();if(e.sort((function(e,t){var r=null,a=null;o in e.values&&(r=e.values[o][0]),o in t.values&&(a=t.values[o][0]);var s,c,u,l=(s=a,c=n(r),u=n(s),c<u?-1:c>u?1:0);return i?-l:l})),e.length){for(var a=e[0]._htmlRow.parentNode,s=0;s<e.length;++s)a.removeChild(e[s]._htmlRow);for(var c=0;c<e.length;++c)a.appendChild(e[c]._htmlRow)}}(e,t,0,r)}function K(t,r,n){var i=e.createElement("div"),o=e.createElement("input");o.setAttribute("type","text"),o.style.width="70%",i.appendChild(o);var a=e.createElement("span");a.appendChild(e.createTextNode("▼")),a.addEventListener("click",(function(){q(t,n,!1)}),!1),i.appendChild(a);var s=e.createElement("span");s.appendChild(e.createTextNode("▲")),s.addEventListener("click",(function(){q(t,n,!0)}),!1),i.appendChild(s);var c=null;return n.filterFunction=function(e){return!c||!!e&&("Literal"===e.termType?e.value:"NamedNode"===e.termType?l.label(e):"").toLowerCase().indexOf(c)>=0},o.addEventListener("keyup",(function(){c=""!==o.value?o.value.toLowerCase():null,H(t,r)}),!1),i}function W(t,r,n,i){for(var o=e.createElement("div"),a=e.createElement("select"),s={},c=0;c<i.length;++c){var u=i[c];s[u.uri]=!0}var d=Z(n).initialSelection;d&&(s=d),a.setAttribute("multiple","true");for(var p=0;p<i.length;++p){var f=i[p],h=j(l.label(f),p);s[f.uri]&&(h.selected=!0),a.appendChild(h)}return o.appendChild(a),n.filterFunction=function(e){return!s||e&&s[e.uri]},a.addEventListener("click",(function(){s={};for(var e=a.options,n=0;n<e.length;n++){var o=e[n],c=Number(o.value);e[n].selected&&(s[i[c].uri]=!0)}H(t,r)}),!0),o}function V(t,r,n){var i=e.createElement("div"),o=e.createElement("input");o.setAttribute("type","text"),o.style.width="40px",i.appendChild(o);var a=e.createElement("input");a.setAttribute("type","text"),a.style.width="40px",i.appendChild(a);var s=null,c=null;function u(){s=""===o.value?null:Number(o.value),c=""===a.value?null:Number(a.value),H(t,r)}return n.filterFunction=function(e){return e&&(e=Number(e)),!(s&&(!e||e<s)||c&&(!e||e>c))},o.addEventListener("keyup",u,!1),a.addEventListener("keyup",u,!1),i}function z(e,t,r){if(r.superClass&&r.alternatives.length>0)return W(e,t,r,r.alternatives);for(var n,i=r.getConstraints(),o=0;o<i.length;o++){if(n=i[o],r.checkedAnyValues&&r.possiblyNumber||n.uri in y)return V(e,t,r);if("http://www.w3.org/2000/01/rdf-schema#Literal"===n.uri)return K(e,t,r);var a=m.each(n,h.ns.owl("oneOf"));if(a.length>0)return W(e,t,r,a.elements)}return function(e,t,r){return r.checkedAnyValues&&r.possiblyNumber?V(e,t,r):r.possiblyLiteral?K(e,t,r):null}(e,t,r)}function J(t,r,n){n=n||{};var o=e.createElement("a"),a=n.linkFunction;return o.setAttribute("href",t),o.appendChild(e.createTextNode(r)),a?o.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation();var t=l.getTarget(e).getAttribute("href");t||i.log("No href found \n"),a(t)}),!0):o.addEventListener("click",h.widgets.openHrefInOutlineMode,!0),o}function Z(e){return t&&t.hints&&e.variable&&t.hints[e.variable.toNT()]?t.hints[e.variable.toNT()]:{}}function $(t,r){var n=Z(r),i=n.cellFormat;if(!i){if("Literal"===t.termType){if(t.datatype){if(b[t.datatype.uri])return e.createTextNode(h.widgets.shortDate(t.value));if(y[t.datatype.uri]){var o=e.createElement("span");return o.textContent=t.value,o.setAttribute("style","text-align: right"),o}}return e.createTextNode(t.value)}if("NamedNode"===t.termType&&r.isImageColumn())return function(t){var r=e.createElement("img");return r.setAttribute("src",t.uri),r.style.height="40px",r}(t);if("NamedNode"===t.termType||"BlankNode"===t.termType)return function(e,t){var r=!1;return e.uri&&(r=e.uri.match(/^mailto:(.*)/)),J(e.uri,r?r[1]:l.label(e),t)}(t,n);if("Collection"===t.termType){var a=e.createElement("span");return a.appendChild(e.createTextNode("[")),t.elements.forEach((function(t){a.appendChild($(t,r)),a.appendChild(e.createTextNode(", "))})),a.removeChild(a.lastChild),a.appendChild(e.createTextNode("]")),a}return e.createTextNode("unknown termtype '"+t.termType+"'!")}if("shortDate"===i)return e.createTextNode(h.widgets.shortDate(t.value))}function G(e,t){var r,n=null;if("Literal"===e.termType)n="value";else{if("NamedNode"!==e.termType)return t.indexOf(e)>=0;n="uri"}for(r=0;r<t.length;++r)if(t[r].termType===e.termType&&t[r][n]===e[n])return!0;return!1}function X(e){if("uri"in e)return e.uri;if("_subject_id"in e)return e._subject_id;var t=""+_;return e._subject_id=t,++_,t}function Y(r,n,o,a){r.running=!0;var s=Date.now(),c=e.createElement("tr");a.appendChild(c),c.textContent="Loading ...";for(var u=0;u<n.length;u++)n[u].original=!0,n[u].originalValues||(n[u].originalValues=n[u].values),n[u].values={};m.query(r,(function(t){if(r.running){c.textContent+=".";var i,s=null,u=null;if(x in t&&(i=X(u=t[x]))in g&&(s=g[i]),!s){var l=e.createElement("tr");a.appendChild(l),s={_htmlRow:l,_subject:u,values:{}},n.push(s),u&&(g[i]=s)}delete s.original,function(t,r,n){var i,o=!1;for(i in n){var a=n[i];i in t.values||(t.values[i]=[]),G(a,t.values[i])||(t.values[i].push(a),o=!0)}o&&(P(t._htmlRow),function(t,r,n,i){var o=e.createElement("td");r._subject&&"uri"in r._subject&&o.appendChild(J(r._subject.uri,"→")),t.appendChild(o);for(var a=0;a<n.length;++a){var s=n[a],c=e.createElement("td"),u=void 0,l=s.getKey();if(l in r.values){var d=r.values[l],p=!1;r.originalValues&&r.originalValues[l]&&d.length!==r.originalValues[l].length&&(p=!0);for(var f=0;f<d.length;++f){var h=d[f];r.originalValues&&r.originalValues[l]&&r.originalValues[l].length>f&&(u=r.originalValues[l][f],h.toString()!==u.toString()&&(p=!0)),c.appendChild($(h,s)),f!==d.length-1&&c.appendChild(e.createTextNode(",\n")),p&&(c.style.background="#efe")}}t.appendChild(c)}r._htmlRow=t}(t._htmlRow,t,r)),B(t,r)}(s,o,t)}}),void 0,(function(){c&&c.parentNode&&c.parentNode.removeChild&&(c.parentNode.removeChild(c),c=null);var e=Date.now()-s;i.log("Query done: "+n.length+" rows, "+e+"ms");for(var r=n.length-1;r>=0;r--)if(n[r].original){i.log(" deleting row "+n[r]._subject);var a=n[r]._htmlRow;a.parentNode.removeChild(a),delete g[X(n[r]._subject)],n.splice(r,1)}if(t.sortBy){var u=function(e,t){for(var r in e){var n=e[r];if(n.variable.toNT()===t)return n}throw new Error("getColumnForVariable: no column for variable ".concat(t))}(o,t.sortBy);q(n,u,t.sortReverse)}t.onDone&&t.onDone(S)}))}function Q(e,t){h.log.debug(">> processing formula");for(var r=0;r<t.statements.length;++r){var n=t.statements[r];if("NamedNode"===n.predicate.termType&&"Variable"===n.object.termType){var i=n.object.toString();i in e&&e[i].setPredicate(n.predicate,!1,n.subject)}if("NamedNode"===n.predicate.termType&&"Variable"===n.subject.termType){var o=n.subject.toString();o in e&&e[o].setPredicate(n.predicate,!0,n.object)}}for(var a=0;a<t.optional.length;++a)h.log.debug("recurse to optional subformula "+a),Q(e,t.optional[a]);h.log.debug("<< finished processing formula")}function ee(e){for(var t=[],r={},n=0;n<e.vars.length;++n){var i=new I,o=e.vars[n];h.log.debug("column "+n+" : "+o),i.setVariable(o),r[o]=i,t.push(i)}return Q(r,e.pat),t}function te(t,r){var n;n=p?ee(t):r.getColumns();var i=[],o=e.createElement("table");return o.appendChild(function(t,r){var n=e.createElement("tr"),i=e.createElement("th");n.appendChild(i);for(var o=0;o<t.length;++o){var a=e.createElement("th"),s=t[o];a.appendChild(e.createTextNode(s.getLabel())),r&&a.appendChild(U(r,s)),n.appendChild(a)}return n}(n,r)),o.appendChild(function(t,r){var n=e.createElement("tr");n.className="selectors",n.appendChild(e.createElement("td"));for(var i=0;i<r.length;++i){var o=e.createElement("td"),a=z(t,r,r[i]);a&&o.appendChild(a),n.appendChild(o)}return n}(i,n)),o.logicalRows=i,o.columns=n,o.query=t,Y(t,i,n,o),o}};var i=f(r(4433)),o=r(1124),a=r(166),s=f(r(8853)),c=f(r(6590)),u=f(r(6022)),l=f(r(5666)),d=f(r(2457));function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(p=function(e){return e?r:t})(e)}function f(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=p(t);if(r&&r.has(e))return r.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}var h={icons:o.icons,log:s,ns:c,utils:l,widgets:d}},5084:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.TabWidgetElement=void 0,t.tabWidget=function(e){var t=e.subject,r=e.dom||document,n=parseInt(e.orientation||"0"),o=e.backgroundColor||"#ddddcc",a=2&n,s=1&n,c=e.onClose,u=function(e){return function(e){for(var t=0,r=0;r<3;r++)t+=parseInt(e.slice(2*r+1,2*r+3),16);return t>384}(e)?[v(e,"#ffffff",.3),"#000000"]:[v(e,"#000000",.3),"#ffffff"]}(o),l=(0,i.default)(u,2),d=l[0],p=l[1],g="flex: 2; width: auto; height: 100%; border: 0.1em; border-style: solid; border-color: ".concat(d,"; padding: 1em;"),y=r.createElement("div");y.setAttribute("style","display: flex; height: 100%; width: 100%; flex-direction: "+(s?"row":"column")+(a?"-reverse;":";"));var b=y.appendChild(r.createElement("nav"));b.setAttribute("style","margin: 0;");var w=y.appendChild(r.createElement("main"));w.setAttribute("style","margin: 0; width:100%; height: 100%;");var x=b.appendChild(r.createElement("ul"));x.setAttribute("style","\n list-style-type: none;\n display: flex;\n height: 100%;\n width: 100%;\n margin: 0;\n padding: 0;\n flex-direction: ".concat(s?"column":"row","\n "));var _=w;y.tabContainer=x,y.bodyContainer=_;var E=["0.2em","0.2em","0","0"],k=E.concat(E).slice(n,n+4),S="border-radius: ".concat(k.join(" "),";"),A=["0.3em","0.3em","0","0.3em"],C=A.concat(A).slice(n,n+4),T="margin: ".concat(C.join(" "),";"),O="padding: ".concat(C.join(" "),";"),P=S+"position: relative; padding: 0.7em; max-width: 20em; color: ".concat(p,";"),F="".concat(P+T," opacity: 50%; background-color: ").concat(o,";"),I="".concat(P+T," background-color: ").concat(d,";"),N="height: 100%; width: 100%;",j=N+"display: none;";if(y.refresh=U,U(),!e.startEmpty&&x.children.length&&e.selectedTab){var R=Array.from(x.children).map((function(e){return e.firstChild})).find((function(t){return t.dataset.name===e.selectedTab})),L=e.selectedTab.uri,D=(Array.from(x.children).find((function(e){return e.subject&&e.subject.uri&&e.subject.uri===L}))||R||x.children[0]).firstChild;D&&D.click()}else e.startEmpty||x.children[0].firstChild.click();return y;function M(t){var n=r.createElement("li");n.setAttribute("style",F),n.subject=t;var i=n.appendChild(r.createElement("button"));if(i.setAttribute("style","background: none; border: none; font: inherit; cursor: pointer"),i.onclick=function(){if(B(),H(),n.setAttribute("style",I),n.bodyTR){n.bodyTR.setAttribute("style",N);var r=a(n);e.renderMain&&n.subject&&!1!==r.asSettings&&(r.innerHTML="loading item ..."+t,e.renderMain(r,n.subject),r.asSettings=!1)}},e.renderTabSettings&&n.subject){var o=r.createElement("button");o.textContent="...",o.setAttribute("style","position: absolute; right: 0; bottom: 0; width: 20%; background: none; color: inherit; border: none; padding: 0; font: inherit; cursor: pointer; outline: inherit;"),o.onclick=function(){if(B(),H(),n.setAttribute("style",I),n.bodyTR){n.bodyTR.setAttribute("style",N);var r=a(n);e.renderTabSettings&&n.subject&&!0!==r.asSettings&&(r.innerHTML="loading settings ..."+t,e.renderTabSettings(r,n.subject),r.asSettings=!0)}},n.appendChild(o)}return e.renderTab?e.renderTab(i,t):i.innerHTML=(0,h.label)(t),n;function a(e){var t,n=null===(t=e.bodyTR)||void 0===t?void 0:t.children[0];if(n)return n;var i=e.bodyTR.appendChild(r.createElement("main"));return i.setAttribute("style",g),i}}function U(){var n,i,o,a,s,u=e.items?e.items:!1!==e.ordered?m.store.the(t,e.predicate).elements:m.store.each(t,e.predicate),l=!1;for(a=0;a<x.children.length;a++)if(n=x.children[a],a>=u.length||n.subject&&!n.subject.sameTerm(u[a])){l=!0;break}if(l||u.length!==x.children.length){for(s=x.children.length-1;s>=0&&(n=x.children[s],o=s-x.children.length+u.length,!n.subject||n.subject.sameTerm(u[o]));s--);for(var d=u.slice(a,s-x.children.length+u.length+1);s>=a;)x.removeChild(x.children[a]),_.removeChild(_.children[a]),s-=1;for(i=0;i<d.length;i++){var p=M(d[i]),h=r.createElement("div");p.bodyTR=h,a===x.children.length?(x.appendChild(p),_.appendChild(h)):(x.insertBefore(p,x.children[a+i]),_.insertBefore(h,_.children[a+i]))}c&&function(e){if(e.dataset.onCloseSet){var t=e.querySelector(".unstyled");e.removeChild(t)}var n=r.createElement("li");n.classList.add("unstyled");var i=(0,f.cancelButton)(r,c);i.setAttribute("style",i.getAttribute("style")+O),n.appendChild(i),e.appendChild(n),e.dataset.onCloseSet="true"}(x)}}function B(){for(var e=0;e<x.children.length;e++){var t=x.children[e];t.classList.contains("unstyled")||t.setAttribute("style",F)}}function H(){for(var e=0;e<_.children.length;e++)_.children[e].setAttribute("style",j)}};var i=n(r(7424)),o=n(r(9728)),a=n(r(6690)),s=n(r(6115)),c=n(r(1655)),u=n(r(4993)),l=n(r(3808)),d=n(r(3496)),p=n(r(8416)),f=r(2457),h=r(5666),m=r(166);HTMLElement;var g=function(e){(0,c.default)(i,e);var t,r,n=(t=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,l.default)(t);if(r){var i=(0,l.default)(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return(0,u.default)(this,e)});function i(){var e;(0,a.default)(this,i);for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return e=n.call.apply(n,[this].concat(r)),(0,p.default)((0,s.default)(e),"bodyContainer",void 0),(0,p.default)((0,s.default)(e),"refresh",void 0),(0,p.default)((0,s.default)(e),"tabContainer",void 0),e}return(0,o.default)(i)}((0,d.default)(HTMLElement));function v(e,t,r){for(var n,i,o="#",a="0123456789abcdef",s=0;s<3;s++){n=parseInt(e.slice(2*s+1,2*s+3),16),i=parseInt(t.slice(2*s+1,2*s+3),16);var c=parseInt((""+(n*(1-r)+i*r)).split(".")[0]),u=parseInt((""+c/16).split(".")[0]),l=parseInt((""+c%16).split(".")[0]);o+=a[u]+a[l]}return o}t.TabWidgetElement=g,HTMLElement},2665:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.getName=function(e,t){return e.anyValue(t,s.ns.vcard("fn"),null,t.doc())||e.anyValue(t,s.ns.foaf("name"),null,t.doc())||t.uri},t.getPod=function(){return(0,a.sym)(document.location.origin).site()},t.getPodOwner=function(e,t){return c.apply(this,arguments)},t.throttle=function(e,t){var r,n,i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=null,s=0,c=function(){s=o.leading?Date.now():0,a=null,i=e.apply(r,n),a||(r=n=null)};return function(){var u=Date.now();s||o.leading||(s=u);var l=t-(u-s);return r=this,n=arguments,l<=0||l>t?(a&&(clearTimeout(a),a=null),s=u,i=e.apply(r,n),a||(r=n=null)):a||!1===o.trailing||(a=setTimeout(c,l)),i}};var i=n(r(4687)),o=n(r(7156)),a=r(6022),s=r(1568);function c(){return(c=(0,o.default)(i.default.mark((function e(t,r){var n,o,c,u;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,r.any(t,null,s.ns.ldp("Container"),t)){e.next=7;break}return e.next=4,r.fetcher.webOperation("GET",t.uri,r.fetcher.initFetchOptions(t.uri,{headers:{accept:"text/turtle"}}));case 4:n=e.sent,o=n.responseText,(0,a.parse)(o,r,t.uri,"text/turtle");case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(0),console.error("Error loading pod "+t+": "+e.t0),e.abrupt("return",null);case 13:if(r.holds(t,s.ns.rdf("type"),s.ns.space("Storage"),t)){e.next=16;break}return console.warn("Pod "+t+" does not declare itself as a space:Storage"),e.abrupt("return",null);case 16:if(!(c=r.any(t,s.ns.solid("owner"),null,t)||r.any(null,s.ns.space("storage"),t,t))){e.next=31;break}return e.prev=18,e.next=21,r.fetcher.load(c.doc());case 21:e.next=27;break;case 23:return e.prev=23,e.t1=e.catch(18),console.warn("Unable to load profile of pod owner "+c),e.abrupt("return",null);case 27:return r.holds(c,s.ns.space("storage"),t,c.doc())||console.warn("Pod owner ".concat(c," does NOT list pod ").concat(t," as their storage")),e.abrupt("return",c);case 31:return u=(0,a.sym)("".concat(t.uri,"profile/card#me")),e.prev=32,e.next=35,r.fetcher.load(u);case 35:e.next=41;break;case 37:return e.prev=37,e.t2=e.catch(32),console.error("Ooops. Guessed wrong pod owner webid {$guess} : can't load it."),e.abrupt("return",null);case 41:if(!r.holds(u,s.ns.space("storage"),t,u.doc())){e.next=44;break}return console.warn("Using guessed pod owner webid but it links back."),e.abrupt("return",u);case 44:return e.abrupt("return",null);case 45:case"end":return e.stop()}}),e,null,[[0,9],[18,23],[32,37]])})))).apply(this,arguments)}},5666:(e,t,r)=>{"use strict";var n=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.AJARImage=function(e,t,r,n){n||(n=document);var i=n.createElement("img");return i.setAttribute("src",e),i.addEventListener("copy",(function(e){e.clipboardData.setData("text/plain",""),e.clipboardData.setData("text/html",""),e.preventDefault()})),void 0!==r&&i.setAttribute("title",r),i},t.RDFComparePredicateObject=function(e,t){var r=e.predicate.compareTerm(t.predicate);return 0!==r?r:e.object.compareTerm(t.object)},t.RDFComparePredicateSubject=function(e,t){var r=e.predicate.compareTerm(t.predicate);return 0!==r?r:e.subject.compareTerm(t.subject)},t.addLoadEvent=function(e){var t=window.onload;"function"!=typeof window.onload?window.onload=e:window.onload=function(){t(),e()}},t.ancestor=function(e,t){var r;for(r=e;r;r=r.parentNode)try{if(r.tagName===t)return r}catch(e){return}},t.beep=function(){if(d){var e=new d;return function(t,r,n,i){t=+(t||.3),n=n||"sine","function"!=typeof i&&(i=function(){});var o=e.createOscillator();o.type=n,o.frequency.value=r||256,o.connect(e.destination),o.start(0),o.stop(t)}}},t.clearVariableNames=function(){f=0},t.emptyNode=function(e){for(var t=e.childNodes,r=t.length-1;r>=0;r--)e.removeChild(t[r]);return e},t.escapeForXML=v,t.findPos=m,t.genUuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},t.getAbout=h,t.getEyeFocus=function(e,t,r,n){n||(n=window);var i=m(e)[1],o=window.SolidAppContext||{},a=i-(o&&o.scroll||52)-n.scrollY;if(t)return r?void n.scrollBy(0,i+e.clientHeight-(n.scrollY+n.innerHeight)):void n.scrollBy(0,a);var s=n.setInterval((function(){n.scrollBy(0,a/10),10==++c&&n.clearInterval(s)}),50),c=0},t.getTarget=function(e){var t;return(e=e||window.event).target?t=e.target:e.srcElement&&(t=e.srcElement),3===t.nodeType&&(t=t.parentNode),t},t.getTerm=function(e){var t=e.parentNode,r=t?t.AJAR_statement:void 0;switch(r?e.className:""){case"pred":case"pred selected":return r.predicate;case"obj":case"obj selected":return t.AJAR_inverse?r.subject:r.object;case"":case"selected":return h(o.store,e);case"undetermined selected":return e.nextSibling?r.predicate:t.AJAR_inverse?r.subject:r.object}},t.hashColor=function(e){return"#"+(16777215&(t=e=e.uri||e,t.split("").reduce((function(e,t){return(e=(e<<5)-e+t.charCodeAt(0))&e}),0))|12632256).toString(16);var t},t.include=function(e,t){var r=e.createElement("script");return r.setAttribute("type","text/javascript"),r.setAttribute("src",t),r},Object.defineProperty(t,"label",{enumerable:!0,get:function(){return c.label}}),t.labelForXML=function(e){return v((0,c.label)(e))},t.labelWithOntology=function(e,t){var r=o.store.findTypeURIs(e);return r[p.ns.rdf("Predicate").uri]||r[p.ns.rdfs("Class").uri]?(0,c.label)(e,t)+" ("+g(e)+")":(0,c.label)(e,t)},t.newVariableName=function(){return"v"+f++},t.ontologyLabel=g,t.predParentOf=function(e){for(var t=e;;){if(t.getAttribute("predTR"))return t;if(!t.previousSibling||"TR"!==t.previousSibling.nodeName)return p.log.error("Could not find predParent"),e;t=t.previousSibling}},t.predicateLabel=y,t.predicateLabelForXML=function(e,t){return v(y(e,t))},t.shortName=function(e){var t=e;"#/".indexOf(t[t.length-1])>=0&&(t=t.slice(0,-1));var r,n=[];for(var i in this.prefixes)n[this.prefixes[i]]=i;var o,a=function(e){return"ns"!==e&&(r=e,!0)},s=t.lastIndexOf("#");for(s>=0&&(t=t.slice(s-1));;){var c=t.lastIndexOf("/");for(c>=0&&(t=t.slice(c+1)),o=0;o<t.length&&this.prefixchars.indexOf(t[o]);)o++;if((t=t.slice(0,o)).length<6&&a(t))return r;if(a(t.slice(0,3)))return r;if(a(t.slice(0,2)))return r;if(a(t.slice(0,4)))return r;if(a(t.slice(0,1)))return r;if(a(t.slice(0,5)))return r;for(o=0;;o++)if(a(t.slice(0,3)+o))return r}},t.stackString=function(e){var t,r=e+"\n";if(!e.stack)return r+"No stack available.\n";var n=e.stack.toString().split("\n"),i=[];for(t=0;t<n.length;t++){var o=n[t];if(o.indexOf("ecmaunit.js")>-1)break;"("===o.charAt(0)&&(o="function"+o);var a=o.split("@");i.push(a)}for(t=0;t<i.length;t++)r+=" "+i[t][1]+"\n "+i[t][0];return r},t.syncTableToArray=function(e,t,r){var n,i,o;for(o=0;o<e.children.length;o++)(i=e.children[o]).trashMe=!0;for(var a=0;a<t.length;a++){var s=t[a];for(n=!1,o=0;o<e.children.length;o++)if((i=e.children[o]).subject&&i.subject.sameTerm(s)){i.trashMe=!1,n=!0;break}if(!n){var c=r(s);if(a>=e.children.length)e.appendChild(c);else{var u=e.children[a];e.insertBefore(c,u)}c.subject=s}}for(o=0;o<e.children.length;o++)(i=e.children[o]).trashMe&&e.removeChild(i)},t.syncTableToArrayReOrdered=function(e,t,r){for(var n={},i=0;i<e.children.length;i++){var o=e.children[i];n[o.subject.toNT()]=o}for(var a=0;a<t.length;a++){var s=t[a];if(a>=e.children.length){var c=r(s);c.subject=s,e.appendChild(c)}else{var u=e.children[a];if(u.subject.sameTerm(s));else{var l=n[s.toNT()];if(l)e.removeChild(l),e.insertBefore(l,u);else{var d=r(s);u.before(d),d.subject=s}}}}for(;e.children.length>t.length;)e.removeChild(e.children[e.children.length-1])};var i=l(r(8853)),o=r(166),a=l(r(6590)),s=l(r(6022)),c=r(7762);function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function l(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}var d,p={log:i,ns:a,rdf:s},f=0;function h(e,t){var r,n;for(r=t;r&&1===r.nodeType;r=r.parentNode)if(n=r.getAttribute("about"))return e.fromNT(n);p.log.debug("getAbout: No about found")}function m(e){var t=e.ownerDocument.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return[r.left-t.left,r.top-t.top]}function g(e){if(void 0===e.uri)return"??";var t,r=e.uri,n=[],i=r.lastIndexOf("#");if(i>=0)r=r.slice(0,i+1);else{if(!((i=r.lastIndexOf("/"))>=0))return e.uri+"?!";r=r.slice(0,i+1)}for(var o in p.ns)n[p.ns[o]]=o;try{return n[r]}catch(e){}for(r=r.slice(0,-1);r;){if(!((i=r.lastIndexOf("/"))>=0))return e.uri+"!?";if(t=r.slice(i+1),r=r.slice(0,i),"ns"!==t&&"0123456789".indexOf(t[0])<0)return t}}function v(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;")}function y(e,t){var r=(0,c.label)(e);if(t){var n=o.store.any(e,p.ns.owl("inverseOf"))||o.store.any(void 0,p.ns.owl("inverseOf"),e);return n?(0,c.label)(n):"type"===r?"...":"is "+r+" of"}return r}"undefined"!=typeof AudioContext?d=AudioContext:"undefined"!=typeof window&&(d=window.AudioContext||window.webkitAudioContext)},1936:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.getExistingPrivateKey=function(e,t){return g.apply(this,arguments)},t.getExistingPublicKey=function(e,t){return h.apply(this,arguments)},t.getKeyIfExists=v,t.pubKeyUrl=t.privKeyUrl=t.getPodRoot=void 0;var o=n(r(4687)),a=n(r(7156)),s=d(r(4433)),c=r(166),u=d(r(6590));function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(l=function(e){return e?r:t})(e)}function d(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}var p=function(){var e=(0,a.default)(o.default.mark((function e(t){var r,n,i,a,l,d;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new URL(t.uri),e.next=3,c.store.fetcher.load(t.uri);case 3:if(null!=(n=c.store.each(t,u.space("storage"),null,t.doc()))&&n.length){e.next=19;break}a=r.pathname;case 6:if(!a.length){e.next=17;break}return a=a.substring(0,a.lastIndexOf("/")),i=c.store.sym(r.origin+a+"/"),e.next=11,c.store.fetcher.webOperation("HEAD",i.uri);case 11:if(d=e.sent,null===(l=d.headers.get("link"))||void 0===l||!l.includes(u.space("Storage").value)){e.next=14;break}return e.abrupt("break",17);case 14:a||s.warn("Current user storage not found for\n".concat(t)),e.next=6;break;case 17:e.next=21;break;case 19:(i=n.find((function(e){return r.origin===new URL(e.value).origin})))||(i=n[0]);case 21:return e.abrupt("return",i);case 22:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();t.getPodRoot=p;var f=function(){var e=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,p(t);case 3:return e.t0=e.sent.value,e.abrupt("return",e.t0+"profile/keys/publicKey.ttl");case 7:throw e.prev=7,e.t1=e.catch(0),new Error(e.t1);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}();function h(){return(h=(0,a.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(t,r,"publicKey");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.pubKeyUrl=f;var m=function(){var e=(0,a.default)(o.default.mark((function e(t){var r,n,i,a,s;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=null===(r=c.store.any(t,u.space("preferencesFile"),null,t.doc()))||void 0===r?void 0:r.value,i=null===(n=i)||void 0===n?void 0:n.split("/").slice(0,-1).join("/"),e.prev=2,e.next=5,p(t);case 5:if(s=e.sent,null!==(a=i)&&void 0!==a&&a.startsWith(s.value)){e.next=8;break}throw new Error("/settings/ is expected to be in ".concat(s.value));case 8:return e.abrupt("return","".concat(i,"/keys/privateKey.ttl"));case 11:throw e.prev=11,e.t0=e.catch(2),new Error(e.t0);case 14:case"end":return e.stop()}}),e,null,[[2,11]])})));return function(t){return e.apply(this,arguments)}}();function g(){return(g=(0,a.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(t,r,"privateKey");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(e,t,r){return y.apply(this,arguments)}function y(){return(y=(0,a.default)(o.default.mark((function e(t,r,n){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,c.store.fetcher.load(r);case 3:return i=c.store.any(t,u.solid(n)),e.abrupt("return",null==i?void 0:i.value);case 7:if(e.prev=7,e.t0=e.catch(0),404!==e.t0.response.status){e.next=24;break}return s.log("createIfNotExists: doc does NOT exist, will create... "+r),e.prev=11,e.next=14,c.store.fetcher.webOperation("PUT",r,{data:"",contentType:"text/turtle"});case 14:e.next=20;break;case 16:throw e.prev=16,e.t1=e.catch(11),s.log("createIfNotExists doc FAILED: "+r+": "+e.t1),e.t1;case 20:return delete c.store.fetcher.requested[r],e.abrupt("return",void 0);case 24:throw s.log("createIfNotExists doc FAILED: "+r+": "+e.t0),e.t0;case 26:case"end":return e.stop()}}),e,null,[[0,7],[11,16]])})))).apply(this,arguments)}t.privKeyUrl=m},9021:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.keyContainerAclBody=t.keyAclBody=void 0,t.setAcl=function(e,t){return l.apply(this,arguments)};var o=n(r(4687)),a=n(r(7156)),s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}(r(4433)),c=r(166);function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function l(){return(l=(0,a.default)(o.default.mark((function e(t,r){var n,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c.store.fetcher.load(t);case 2:if(s.log(c.store.statementsMatching(c.store.sym(t),c.store.sym("http://www.iana.org/assignments/link-relations/acl"))),n=c.store.any(c.store.sym(t),c.store.sym("http://www.iana.org/assignments/link-relations/acl"))){e.next=6;break}throw new Error("Key ACL doc not found!");case 6:return e.prev=6,e.next=9,c.store.fetcher.webOperation("PUT",n.value,{data:r,contentType:"text/turtle"});case 9:e.next=16;break;case 11:if(e.prev=11,e.t0=e.catch(6),404===(null===e.t0||void 0===e.t0||null===(i=e.t0.response)||void 0===i?void 0:i.status)){e.next=15;break}throw new Error(e.t0);case 15:s.log("delete "+n.value+" "+e.t0.response.status);case 16:case"end":return e.stop()}}),e,null,[[6,11]])})))).apply(this,arguments)}t.keyContainerAclBody=function(e){return"\n@prefix : <#>.\n@prefix acl: <http://www.w3.org/ns/auth/acl#>.\n@prefix foaf: <http://xmlns.com/foaf/0.1/>.\n@prefix key: <./>.\n\n:ReadWrite\n a acl:Authorization;\n acl:accessTo key:;\n acl:default key:;\n acl:agent <".concat(e,">;\n acl:mode acl:Read, acl:Write.\n")},t.keyAclBody=function(e,t){var r="acl:agentClass foaf:Agent";return null!=t&&t.length&&(r="acl:agent <".concat(t,">")),"\n@prefix foaf: <http://xmlns.com/foaf/0.1/>.\n@prefix acl: <http://www.w3.org/ns/auth/acl#>.\n<#Read>\n a acl:Authorization;\n ".concat(r,";\n acl:accessTo <").concat(e.split("/").pop(),">;\n acl:mode acl:Read.\n")}},7762:(e,t,r)=>{"use strict";var n=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.label=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function r(e){return t?e.slice(0,1).toUpperCase()+e.slice(1):e}function n(e){var t="";"/"===e.slice(-1)&&(e=e.slice(0,-1));for(var n=0;n<e.length;n++)"_"!==e[n]&&"-"!==e[n]?(t+=e[n],n+1<e.length&&e[n].toUpperCase()!==e[n]&&e[n+1].toLowerCase()!==e[n+1]&&(t+=" ")):t+=" ";return"has "===t.slice(0,4)&&(t=t.slice(4)),r(t)}var i=l(e);if(i)return r(i.value);if("BlankNode"===e.termType)return"...";if("Collection"===e.termType)return"("+e.elements.length+")";var o=e.uri;if(void 0===o)return e.toString();try{o=o.split("/").map(decodeURIComponent).join("/")}catch(e){for(var a=o.length-3;a>0;a--)for(var s="0123456789abcefABCDEF";"%"===o[a]&&s.indexOf(o[a+1])>=0&&s.indexOf(o[a+2])>=0;)o=o.slice(0,a)+String.fromCharCode(parseInt(o.slice(a+1,a+3),16))+o.slice(a+3)}o=u(o,"/profile/card#me"),o=u(o,"#this");var c=(o=u(o,"#me")).indexOf("#");if(c>=0)return n(o.slice(c+1));var d=o.lastIndexOf("/",o.length-2);return d>=0&&d<e.uri.length?n(o.slice(d+1)):r(decodeURIComponent(e.uri))};var i=s(r(8853)),o=r(166);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}function s(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var c=o?Object.getOwnPropertyDescriptor(e,s):null;c&&(c.get||c.set)?Object.defineProperty(i,s,c):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}var c={log:i,ns:s(r(6590)),rdf:s(r(6022))};function u(e,t){var r=-1*t.length;return e.slice(r)===t?e.slice(0,r):e}function l(e){return o.store.any(e,c.ns.ui("label"))||o.store.any(e,c.ns.link("message"))||o.store.any(e,c.ns.vcard("fn"))||o.store.any(e,c.ns.foaf("name"))||o.store.any(e,c.ns.dct("title"))||o.store.any(e,c.ns.dc("title"))||o.store.any(e,c.ns.rss("title"))||o.store.any(e,c.ns.contact("fullName"))||o.store.any(e,o.store.sym("http://www.w3.org/2001/04/roadmap/org#name"))||o.store.any(e,c.ns.cal("summary"))||o.store.any(e,c.ns.foaf("nick"))||o.store.any(e,c.ns.as("name"))||o.store.any(e,c.ns.schema("name"))||o.store.any(e,c.ns.rdfs("label"))||o.store.any(e,o.store.sym("http://www.w3.org/2004/02/skos/core#prefLabel"))}},7269:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.versionInfo=void 0,t.versionInfo={buildTime:"2023-05-25T09:43:51Z",commit:"6f763399cd83ecfe031ae11f0f50b71da1ff3bd5",npmInfo:{"solid-ui":"2.4.28",npm:"8.19.4",node:"16.20.0",v8:"9.4.146.26-node.26",uv:"1.43.0",zlib:"1.2.11",brotli:"1.0.9",ares:"1.19.0",modules:"93",nghttp2:"1.47.0",napi:"8",llhttp:"6.0.10",openssl:"1.1.1t+quic",cldr:"41.0",icu:"71.1",tz:"2022f",unicode:"14.0",ngtcp2:"0.8.1",nghttp3:"0.7.0"}}},6186:(e,t,r)=>{"use strict";var n=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.addStyleSheet=function(e,t){for(var r=e.querySelectorAll("link"),n=0;n<r.length;n++)if("stylesheet"===(r[n].getAttribute("rel")||"")&&(r[n].getAttribute("href")||"")===t)return;var i=e.createElement("link");i.setAttribute("rel","stylesheet"),i.setAttribute("type","text/css"),i.setAttribute("href",t),e.getElementsByTagName("head")[0].appendChild(i)},t.allClassURIs=function(){var e={};return d.store.statementsMatching(void 0,a.rdf("type"),void 0).forEach((function(t){t.object.value&&(e[t.object.value]=!0)})),d.store.statementsMatching(void 0,a.rdfs("subClassOf"),void 0).forEach((function(t){t.object.value&&(e[t.object.value]=!0),t.subject.value&&(e[t.subject.value]=!0)})),d.store.each(void 0,a.rdf("type"),a.rdfs("Class")).forEach((function(t){t.value&&(e[t.value]=!0)})),e},t.askName=function(e,t,r,n,i,o){return new Promise((function(t,c){var u=e.createElement("div");n=n||a.foaf("name");var l=(o=o||(i?p.label(i):" "))+" "+p.label(n)+": ";u.appendChild(e.createElement("p")).textContent=l;var d=e.createElement("input");function f(){u.parentNode.removeChild(u),t(d.value.trim())}d.setAttribute("type","text"),d.setAttribute("size","100"),d.setAttribute("maxLength","2048"),d.setAttribute("style",s.textInputStyle),d.select(),u.appendChild(d),r.appendChild(u),d.addEventListener("keyup",(function(e){13===e.keyCode&&f()}),!1),u.appendChild(e.createElement("br")),u.appendChild(N(e,(function(e){u.parentNode.removeChild(u),t(null)}))),u.appendChild(j(e,(function(e){f()}))),d.focus()}))},t.attachmentList=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=function(e){if(!_.updater)throw new Error("kb has no updater");_.updater.update((0,i.st)(t,b,e,m),[],(function(e,t,r,n){t?u():x(void 0,"Error deleting one: "+r)}))};function s(t){var r=t,n={noun:w};return g&&(n.deleteFunction=function(){o(r)}),R(e,b,t,n)}var u=function(){var e=_.each(t,b);e.sort(),p.syncTableToArray(C,e,s)};function f(e){var r=[];if(e.forEach((function(e){var n=(0,i.sym)(e);c.log("Dropped on attachemnt "+e),r.push((0,i.st)(t,b,n,m))})),!_.updater)throw new Error("kb has no updater");_.updater.update([],r,(function(e,t,r,n){t?u():x(void 0,"Error adding one: "+r)}))}function h(e){var r,o;(0,l.uploadFiles)(_.fetcher,e,null===(r=n.uploadFolder)||void 0===r?void 0:r.uri,null===(o=n.uploadFolder)||void 0===o?void 0:o.uri,(function(e,r){var n=[(0,i.st)(t,b,_.sym(r),m)];if(!_.updater)throw new Error("kb has no updater");_.updater.update([],n,(function(e,t,r,n){t?u():x(void 0,"Error adding link to uploaded file: "+r)}))}))}var m=n.doc||t.doc();void 0===n.modify&&(n.modify=!0);var g=n.modify,v=n.promptIcon||y+"noun_748003.svg",b=n.predicate||a.wf("attachment"),w=n.noun||"attachment",_=d.store,E=r.appendChild(e.createElement("table"));E.setAttribute("style","margin-top: 1em; margin-bottom: 1em;");var k=E.appendChild(e.createElement("tr")),S=k.appendChild(e.createElement("td")),A=k.appendChild(e.createElement("td")),C=A.appendChild(e.createElement("table"));if(C.appendChild(e.createElement("tr")),E.refresh=u,u(),g){var T=I(e,v,"Drop attachments here");S.appendChild(T);var O=n.uploadFolder?h:null;if((0,l.makeDropTarget)(T,f,O),(0,l.makeDropTarget)(S,f,O),n.uploadFolder){var P=q(e,h);S.appendChild(P)}}return E},t.button=I,t.cancelButton=N,t.clearElement=function(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e},t.complain=x,t.continueButton=j,t.createLinkDiv=M,t.createNameDiv=D,t.defaultAnnotationStore=function(e){if(void 0!==e.uri){var t=e.uri;if("http://"===t.slice(0,7)){var r=(t=t.slice(7)).indexOf("#");if(r>=0)t=t.slice(0,r);else{var n=t.lastIndexOf("/");if(n<0)return;t=t.slice(0,n)}return d.store.sym("http://tabulator.org/wiki/annnotation/"+t)}}},t.deleteButtonWithCheck=F,t.extractLogURI=function(e){var t=e.search(/logFile=/),r=e.search(/&rulesFile=/);return e.substring(t+8,r)},t.faviconOrDefault=P,t.fileUploadButtonDiv=q,t.findImage=C,t.findImageFromURI=A,t.formatDateTime=_,t.iconForClass=void 0,t.imagesOf=function(e,t){return t.each(e,a.sioc("avatar")).concat(t.each(e,a.foaf("img"))).concat(t.each(e,a.vcard("logo"))).concat(t.each(e,a.vcard("hasPhoto"))).concat(t.each(e,a.vcard("photo"))).concat(t.each(e,a.foaf("depiction")))},t.index=void 0,t.isAudio=function(e){return H(e,"audio")},t.isImage=H,t.isVideo=function(e){return H(e,"video")},t.linkButton=function(e,t){var r=e.createElement("button");return r.setAttribute("type","button"),r.textContent="Goto "+p.label(t),r.addEventListener("click",(function(r){e.outlineManager.GotoSubject(t,!0,void 0,!0,void 0)}),!0),r},t.openHrefInOutlineMode=function(e){e.preventDefault(),e.stopPropagation();var t=p.getTarget(e).getAttribute("href");if(!t)return c.log("openHrefInOutlineMode: No href found!\n");var r=window.document;r.outlineManager?r.outlineManager.GotoSubject(d.store.sym(t),!0,void 0,!0,void 0):window&&window.panes&&window.panes.getOutliner?window.panes.getOutliner().GotoSubject(d.store.sym(t),!0,void 0,!0,void 0):c.log("ERROR: Can't access outline manager in this config")},t.personTR=void 0,t.propertyTriage=function(e){var t={},r={},n={},i=0,o=0,s=0,c=e.predicateIndex;for(var l in c)"Literal"===c[l][0].object.termType?(r[l]=!0,o++):(n[l]=!0,i++);for(var d=e.each(void 0,a.rdf("type"),a.rdf("Property")),p=0;p<d.length;p++){var f=d[p].toNT();n[f]||r[f]||(r[f]=!0,n[f]=!0,s++)}return t.op=n,t.dp=r,(0,u.info)("propertyTriage: ".concat(i," non-lit, ").concat(o," literal. ").concat(s," unknown.")),t},t.refreshTree=function e(t){if(t.refresh)t.refresh();else for(var r=0;r<t.children.length;r++)e(t.children[r])},t.removeButton=function(e,t){var r=e.createElement("button");return r.setAttribute("type","button"),r.textContent="✕",r.addEventListener("click",(function(e){t.parentNode.removeChild(t)}),!0),r},t.renderAsDiv=function(e,t,r){var n=e.createElement("div");n.setAttribute("style",s.renderAsDivStyle);var i=(r=r||{}).image||P(e,t);return(0,h.createImageDiv)(e,n,i),D(e,n,r.title,t),M(e,n,t,r),r.clickable&&r.onClickFunction&&(0,h.addClickListenerToElement)(n,r.onClickFunction),r.wrapInATR?(0,h.wrapDivInATR)(e,n,t):n},t.renderAsRow=L,t.selectorPanel=function(e,t,r,n,i,o,a,s,c){return U(e.createElement("div"),e,t,r,n,i,o,a,s,c)},t.selectorPanelRefresh=U,t.setImage=O,t.setName=E,t.shortDate=function(e,t){if(!e)return"???";try{var r=(new Date).toISOString();return e.slice(0,10)!==r.slice(0,10)||t?e.slice(0,4)===r.slice(0,4)?["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][parseInt(e.slice(5,7),10)-1]+" "+parseInt(e.slice(8,10),10):e.slice(0,10):e.slice(11,16)}catch(e){return"shortdate:"+e}},t.shortTime=function(){return _(new Date,"{Hours}:{Minutes}:{Seconds}.{Milliseconds}")},t.timestamp=function(){return _(new Date,"{FullYear}-{Month}-{Date}T{Hours}:{Minutes}:{Seconds}.{Milliseconds}")};var i=r(6022),o=r(1124),a=v(r(6590)),s=v(r(2853)),c=v(r(4433)),u=r(8853),l=r(3983),d=r(166),p=v(r(5666)),f=r(9449),h=r(398),m=r(1552);function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(g=function(e){return e?r:t})(e)}function v(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=g(t);if(r&&r.has(e))return r.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}var y=o.icons.iconBase,b=y+"noun_1180156.svg",w=y+"noun_1180158.svg";function x(e,t){if(t){var r=function(e){var t=e&&e.statusArea||e&&e.div||null;if(t)return t;var r=e&&e.dom;if(r||"undefined"==typeof document||(r=document),r){var n=r.getElementsByTagName("body")[0];return t=r.createElement("div"),n.insertBefore(t,n.firstElementChild),e&&(e.statusArea=t),t}return null}(e);c.log("Complaint: "+t),r?r.appendChild((0,f.errorMessageBlock)(e&&e.dom||document,t)):alert(t)}}function _(e,t){return t.split("{").map((function(t){var r=t.split("}")[0];return t?("000"+(e["get"+r]()+({Month:1}[r]||0))).slice(-({Milliseconds:3,FullYear:4}[r]||2))+t.split("}")[1]:""})).join("")}function E(e,t){var r=d.store,n=function(e){var t=r.any(e,a.vcard("fn"))||r.any(e,a.foaf("name"))||r.any(e,a.vcard("organization-name"));return t?t.value:null},i=t.sameTerm(a.foaf("Agent"))?"Everyone":n(t);if(e.textContent=i||p.label(t),!i&&t.uri){if(!r.fetcher)throw new Error("kb has no fetcher");r.fetcher.nowOrWhenFetched(t.doc(),void 0,(function(r){e.textContent=n(t)||p.label(t)}))}}var k={"solid:AppProviderClass":"noun_144.svg","solid:AppProvider":"noun_15177.svg","solid:Pod":"noun_Cabinet_1434380.svg","vcard:Group":"noun_339237.svg","vcard:Organization":"noun_143899.svg","vcard:Individual":"noun_15059.svg","schema:Person":"noun_15059.svg","foaf:Person":"noun_15059.svg","foaf:Agent":"noun_98053.svg","acl:AuthenticatedAgent":"noun_99101.svg","prov:SoftwareAgent":"noun_Robot_849764.svg","vcard:AddressBook":"noun_15695.svg","trip:Trip":"noun_581629.svg","meeting:LongChat":"noun_1689339.svg","meeting:Meeting":"noun_66617.svg","meeting:Project":"noun_1036577.svg","ui:Form":"noun_122196.svg","rdfs:Class":"class-rectangle.svg","rdf:Property":"property-diamond.svg","owl:Ontology":"noun_classification_1479198.svg","wf:Tracker":"noun_122196.svg","wf:Task":"noun_17020_gray-tick.svg","wf:Open":"noun_17020_sans-tick.svg","wf:Closed":"noun_17020.svg"};function S(e){var t=e.uri.split("#")[0],r=t.indexOf("//");if(r<0)throw new Error("This URI does not have a web site part (origin)");var n=t.indexOf("/",r+2);return n<0?t.slice(0)+"/":t.slice(0,n+1)}function A(e){var t=y;return"string"!=typeof e&&e.uri?4!==e.uri.split("/").length||e.uri.split("/")[1]||e.uri.split("/")[3]?e.uri.startsWith("message:")||e.uri.startsWith("mid:")?t+"noun_480183.svg":e.uri.startsWith("mailto:")?t+"noun_567486.svg":e.uri.startsWith("https:")&&e.uri.indexOf("#")<0?S(e)+"favicon.ico":null:t+"noun_15177.svg":t+"noun_10636_grey.svg"}function C(e){var t=d.store,r=y;if(e.sameTerm(a.foaf("Agent"))||e.sameTerm(a.rdf("Resource")))return r+"noun_98053.svg";var n=t.any(e,a.sioc("avatar"))||t.any(e,a.foaf("img"))||t.any(e,a.vcard("logo"))||t.any(e,a.vcard("hasPhoto"))||t.any(e,a.vcard("photo"))||t.any(e,a.foaf("depiction"));return n?n.uri:null}function T(e,t,r){var n=d.store,i=C(t);if(i)return e.setAttribute("src",i),!0;var o=r[t.uri];if(o)return e.setAttribute("src",o),e.style=s.classIconStyle,!0;var a=A(t);if(a)return e.setAttribute("src",a),!0;var c=n.findTypeURIs(t);for(var u in c)if(r[u])return e.setAttribute("src",r[u]),!1;return e.setAttribute("src",y+"noun_10636_grey.svg"),!1}function O(e,t){var r=d.store,n={};for(var o in k){var s=o.split(":")[0],c=o.split(":")[1],u=a[s](c);n[u.uri]=i.uri.join(k[o],y)}if(!T(e,t,n)&&t.uri){if(!r.fetcher)throw new Error("kb has no fetcher");r.fetcher.nowOrWhenFetched(t.doc(),void 0,(function(r){r&&T(e,t,n)}))}}function P(e,t){var r=e.createElement("img");if(r.style=s.iconStyle,r.setAttribute("src",y+(function(e){if(!e.uri)return!1;var t=e.uri.split("/");return 3===t.length||4===t.length&&""===t[3]}(t)?"noun_15177.svg":"noun_681601.svg")),t.uri&&t.uri.startsWith("https:")&&t.uri.indexOf("#")<0){var n=e.createElement("object");return n.setAttribute("data",S(t)+"favicon.ico"),n.setAttribute("type","image/x-icon"),n.appendChild(r),n}return O(r,t),r}function F(e,t,r,n){var i=y+"noun_2188_red.svg",a=e.createElement("img");a.setAttribute("src",i),a.setAttribute("style",s.smallButtonStyle),a.style.float="right";var c="Remove this "+r;return a.title=c,a.classList.add("hoverControlHide"),a.addEventListener("click",(function(){var r=e.createElement("div");t.insertBefore(r,a),r.style.position="relative",r.appendChild(function(e,t,r,n){function i(){t.parentElement.removeChild(t)}function a(){i(),n()}var c=e.createElement("div");c.style=s.confirmPopupStyle,c.style.position="absolute",c.style.top="-1em",c.style.display="grid",c.style.gridTemplateColumns="auto auto";var u=e.createElement("div");u.style.gridColumn="1/2",u.style.gridRow="1";var l=e.createElement("div");l.style.gridColumn="1/2",l.style.gridRow="2";var d=N(e,i);c.appendChild(d),d.style.gridColumn="1",d.style.gridRow="2";var p=c.appendChild(e.createElement("button"));p.style=s.buttonStyle,p.style.gridRow="2",p.style.gridColumn="2",p.textContent="Cancel";var f=I(e,o.icons.iconBase+"noun_925021.svg","Delete it");c.appendChild(f),f.style.gridRow="1",f.style.gridColumn="1";var h=c.appendChild(e.createElement("button"));return h.style=s.buttonStyle,h.style.gridRow="1",h.style.gridColumn="2",h.textContent=r,c.appendChild(h),f.addEventListener("click",a),h.addEventListener("click",a),p.addEventListener("click",i),c}(e,r,c,n))})),t.classList.add("hoverControl"),t.appendChild(a),a.setAttribute("data-testid","deleteButtonWithCheck"),a}function I(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{buttonColor:"Primary",needsBorder:!1},o=e.createElement("button");if(o.setAttribute("type","button"),t){var a=o.appendChild(e.createElement("img"));a.setAttribute("src",t),a.setAttribute("style","width: 2em; height: 2em;"),a.title=r,o.setAttribute("style",s.buttonStyle)}else o.textContent=r.toLocaleUpperCase(),o.onmouseover=function(){"Secondary"===i.buttonColor?i.needsBorder?o.setAttribute("style",s.secondaryButtonNoBorderHover):o.setAttribute("style",s.secondaryButtonHover):i.needsBorder?o.setAttribute("style",s.primaryButtonNoBorderHover):o.setAttribute("style",s.primaryButtonHover)},o.onmouseout=function(){"Secondary"===i.buttonColor?i.needsBorder?o.setAttribute("style",s.secondaryButtonNoBorder):o.setAttribute("style",s.secondaryButton):i.needsBorder?o.setAttribute("style",s.primaryButtonNoBorder):o.setAttribute("style",s.primaryButton)},"Secondary"===i.buttonColor?i.needsBorder?o.setAttribute("style",s.secondaryButtonNoBorder):o.setAttribute("style",s.secondaryButton):i.needsBorder?o.setAttribute("style",s.primaryButtonNoBorder):o.setAttribute("style",s.primaryButton);return n&&o.addEventListener("click",n,!1),o}function N(e,t){var r=I(e,b,"Cancel",t);return r.firstChild&&(r.firstChild.style.opacity="0.3"),r}function j(e,t){return I(e,w,"Continue",t)}t.iconForClass=k;var R=L;function L(e,t,r,n){var i=e.createElement("tr");n=n||{};var o=i.appendChild(e.createElement("td")),a=i.appendChild(e.createElement("td")),s=i.appendChild(e.createElement("td")),c=n.image||P(e,r);return o.setAttribute("style","vertical-align: middle; width:2.5em; padding:0.5em; height: 2.5em;"),a.setAttribute("style","vertical-align: middle; text-align:left;"),s.setAttribute("style","vertical-align: middle; width:2em; padding:0.5em; height: 4em;"),o.appendChild(c),n.title?a.textContent=n.title:E(a,r),n.deleteFunction&&F(e,s,n.noun||"one",n.deleteFunction),r.uri&&(!1!==n.link&&(s.appendChild((0,m.linkIcon)(e,r)).classList.add("HoverControlHide"),s.appendChild(e.createElement("br"))),!1!==n.draggable&&(c.setAttribute("draggable","false"),(0,l.makeDraggable)(i,r))),i.subject=r,i}function D(e,t,r,n){var i=t.appendChild(e.createElement("div"));r?i.textContent=r:E(i,n)}function M(e,t,r,n){var i=t.appendChild(e.createElement("div"));i.setAttribute("style",s.linkDivStyle),n.deleteFunction&&F(e,i,n.noun||"one",n.deleteFunction),r.uri&&(!1!==n.link&&(0,m.createLinkForURI)(e,i,r),(0,l.makeDraggable)(t,r))}function U(e,t,r,n,i,o,a,s,c,u){var l="border: 0.1em solid #ddd; border-bottom: none; width: 95%; height: 2em; padding: 0.5em;",d=null;e.innerHTML="";for(var p=function(e,a){var p,f,h=function(){var e=o?r.each(void 0,i,a):r.each(a,i);b.setAttribute("class",0===e.length?"hideTillHover":""),f.setAttribute("src",s.connectIcon||y+"noun_25830.svg"),f.setAttribute("title",e.length?e.length:"attach")},m=B.twoLine.widgetForClass(n);(p=m(t,a)).setAttribute("style",l);var g=t.createElement("div");g.setAttribute("class","hideTillHover"),g.setAttribute("style","float:right; width:10%");var v=t.createElement("a");v.setAttribute("href",a.uri),v.setAttribute("style","float:right"),g.appendChild(v).textContent=">",e.appendChild(g);var b=t.createElement("div");return b.setAttribute("style",(o?"float:left;":"float:right;")+" width:30px;"),f=t.createElement("img"),h(),b.appendChild(f),e.appendChild(b),p.addEventListener("click",(function(e){d===p?(p.setAttribute("style",l),d=null):(d&&d.setAttribute("style",l),p.setAttribute("style",l+"background-color: #ccc; color:black;"),d=p),c(a,e,d===p),h()}),!1),f.addEventListener("click",(function(e){u(a,e,o,h)}),!1),e.appendChild(p),e},f=0;f<a.length;f++){var h=t.createElement("div");e.appendChild(h),p(h,a[f])}return e}t.personTR=R;var B={};function H(e,t){var r=t||"image",n=d.store.findTypeURIs(e),o=i.Util.mediaTypeClass(r+"/*").uri.split("*")[0];for(var a in n)if(a.startsWith(o))return!0;return{audio:"http://purl.org/dc/dcmitype/Sound",image:"http://purl.org/dc/dcmitype/Image",video:"http://purl.org/dc/dcmitype/MovingImage"}[r]in n}function q(e,t){var r=e.createElement("div"),n=r.appendChild(e.createElement("input"));n.setAttribute("type","file"),n.setAttribute("multiple","true"),n.addEventListener("change",(function(e){c.log("File drop event: ",e),e.files?t(e.files):e.target&&e.target.files?t(e.target.files):alert("Sorry no files .. internal error?")}),!1),n.style="display:none";var i=r.appendChild(I(e,y+"noun_Upload_76574_000000.svg","Upload files",(function(e){n.click()})));return(0,l.makeDropTarget)(i,null,t),r}t.index=B,t.index=B={line:{},twoLine:{"":function(e,t){var r=e.createElement("div");return r.textContent=p.label(t),r},"http://www.w3.org/2000/10/swap/pim/qif#Transaction":function(e,t){var r="",n=function(e){var n=d.store.any(t,a.qu(e));return n||(r+="@@ No value for "+e+"! "),n?p.escapeForXML(n.value):"?"},i=e.createElement("table");return i.innerHTML='\n <tr>\n <td colspan="2"> '.concat(n("payee"),"</td>\n < /tr>\n < tr >\n <td>").concat(n("date").slice(0,10),'</td>\n <td style = "text-align: right;">').concat(n("amount"),"</td>\n </tr>"),r&&(i.innerHTML='\n <tr>\n <td><a href="'.concat(p.escapeForXML(t.uri),'">').concat(p.escapeForXML(r),"</a></td>\n </tr>")),i},"http://www.w3.org/ns/pim/trip#Trip":function(e,t){var r=function(e){var r=d.store.any(t,e);return r?p.escapeForXML(r.value):"?"},n=e.createElement("table");return n.innerHTML='\n <tr>\n <td colspan="2">'.concat(r(a.dc("title")),'</td>\n </tr>\n <tr style="color: #777">\n <td>').concat(r(a.cal("dtstart")),"</td>\n <td>").concat(r(a.cal("dtend")),"</td>\n </tr>"),n},widgetForClass:function(e){var t=B.twoLine[e.uri],r=d.store;if(t)return t;var n=r.findSuperClassesNT(e);for(var i in n)if(t=B.twoLine[r.fromNT(i).uri])return t;return B.twoLine[""]}}}},1552:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLinkForURI=void 0,t.linkIcon=i;var n=r(1124);function i(e,t,r){var i=e.createElement("a");i.setAttribute("href",t.uri),t.uri.startsWith("http")&&i.setAttribute("target","_blank");var o=i.appendChild(e.createElement("img"));return o.setAttribute("src",r||n.originalIconBase+"go-to-this.png"),o.setAttribute("style","margin: 0.3em;"),i}t.createLinkForURI=function(e,t,r){var n=i(e,r);t.appendChild(n).classList.add("HoverControlHide"),t.appendChild(e.createElement("br"))}},3983:(e,t,r)=>{"use strict";var n=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.makeDraggable=function(e,t){e.setAttribute("draggable","true"),e.addEventListener("dragstart",(function(r){e.style.fontWeight="bold",r.dataTransfer.setData("text/uri-list",t.uri),r.dataTransfer.setData("text/plain",t.uri),r.dataTransfer.setData("text/html",e.outerHTML),i.log("Dragstart: "+e+" -> "+t+"de: "+r.dataTransfer.dropEffect)}),!1),e.addEventListener("drag",(function(e){e.preventDefault(),e.stopPropagation()}),!1),e.addEventListener("dragend",(function(r){e.style.fontWeight="normal",i.log("Dragend dropeffect: "+r.dataTransfer.dropEffect),i.log("Dragend: "+e+" -> "+t)}),!1)},t.makeDropTarget=function(e,t,r){var n=function(e){e.preventDefault(),e.dataTransfer.dropEffect="copy"},o=function(e){i.log("dragenter event dropEffect: "+e.dataTransfer.dropEffect),this.style&&(this.savedStyle||(this.savedStyle={},this.savedStyle.border=this.style.border,this.savedStyle.backgroundColor=this.style.backgroundColor,this.savedStyle.borderRadius=this.style.borderRadius),this.style.backgroundColor="#ccc",this.style.border="0.25em dashed black",this.style.borderRadius="0.3em"),e.dataTransfer.dropEffect="link",i.log("dragenter event dropEffect 2: "+e.dataTransfer.dropEffect)},a=function(e){i.log("dragleave event dropEffect: "+e.dataTransfer.dropEffect),this.savedStyle?(this.style.border=this.savedStyle.border,this.style.backgroundColor=this.savedStyle.backgroundColor,this.style.borderRadius=this.savedStyle.borderRadius):(this.style.backgroundColor="white",this.style.border="0em solid black")},s=function(e){e.preventDefault&&e.preventDefault(),i.log("Drop event. dropEffect: "+e.dataTransfer.dropEffect),i.log("Drop event. types: "+(e.dataTransfer.types?e.dataTransfer.types.join(", "):"NOPE"));var n,o=null;if(e.dataTransfer.types){for(var a=0;a<e.dataTransfer.types.length;a++){var s=e.dataTransfer.types[a];if("text/uri-list"===s)o=e.dataTransfer.getData(s).split("\n"),i.log("Dropped text/uri-list: "+o);else if("text/plain"===s)n=e.dataTransfer.getData(s);else if("Files"===s&&r){for(var c=e.dataTransfer.files,u=0;c[u];u++){var l=c[u];i.log("Filename: "+l.name+", type: "+(l.type||"n/a")+" size: "+l.size+" bytes, last modified: "+(l.lastModifiedDate?l.lastModifiedDate.toLocaleDateString():"n/a"))}r(c)}}null===o&&n&&"http"===n.slice(0,4)&&(o=n,i.log("Waring: Poor man's drop: using text for URI"))}else o=[e.dataTransfer.getData("Text")],i.log("WARNING non-standard drop event: "+o[0]);return i.log("Dropped URI list (2): "+o),o&&t(o),this.style.backgroundColor="white",!1};!function(e){e||i.log("@@@ addTargetListeners: ele "+e),e.addEventListener("dragover",n),e.addEventListener("dragenter",o),e.addEventListener("dragleave",a),e.addEventListener("drop",s)}(e)},t.uploadFiles=function(e,t,r,n,a){for(var s=0;t[s];s++){var c=t[s];i.log(" dropped: Filename: "+c.name+", type: "+(c.type||"n/a")+" size: "+c.size+" bytes, last modified: "+(c.lastModifiedDate?c.lastModifiedDate.toLocaleDateString():"n/a"));var u=new FileReader;u.onload=function(t){return function(s){var c=s.target.result,u="";i.log(" File read byteLength : "+c.byteLength);var l=t.type;if(t.type&&""!==t.type){var d=o.extension(t.type);d&&"false"!==d&&!t.name.endsWith("."+d)&&t.type!==o.lookup(t.name)&&(u="_."+d)}else if(!(l=o.lookup(t.name))){var p="Filename needs to have an extension which gives a type we know: "+t.name;throw i.log(p),alert(p),new Error(p)}var f=t.type.startsWith("image/")&&n||r,h=f+(f.endsWith("/")?"":"/")+encodeURIComponent(t.name)+u;e.webOperation("PUT",h,{data:c,contentType:l}).then((function(e){i.log(" Upload: put OK: "+h),a(t,h)}),(function(e){var t=" Upload: FAIL "+h+", Error: "+e;throw i.log(t),alert(t),new Error(t)}))}}(c),u.readAsArrayBuffer(c)}};var i=s(r(4433)),o=s(r(983));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}function s(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var c=o?Object.getOwnPropertyDescriptor(e,s):null;c&&(c.get||c.set)?Object.defineProperty(i,s,c):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}},9449:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorMessageBlock=function(e,t,r,i){var o=e.createElement("div"),a=i||t instanceof Error?t:null;return a?(console.error("errorMessageBlock: ".concat(a," at: ").concat(a.stack||"??"),a),o.textContent=a.message):o.textContent=t,o.appendChild((0,n.cancelButton)(e,(function(){o.parentNode&&o.parentNode.removeChild(o)}))).style="width: 2em; height: 2em; align: right;",o.setAttribute("style","margin: 0.1em; padding: 0.5em; border: 0.05em solid gray; background-color: "+(r||"#fee")+"; color:black;"),o};var n=r(2457)},6206:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.appendForm=I,Object.defineProperty(t,"basicField",{enumerable:!0,get:function(){return f.basicField}}),t.buildCheckboxForm=H,t.editFormButton=function(e,t,r,n,i){var o=e.createElement("button");return o.setAttribute("type","button"),o.innerHTML="Edit "+x.label(y.ui("Form")),o.addEventListener("click",(function(a){I(e,t,{},r,y.ui("FormForm"),n,i).setAttribute("style",y.ui("FormForm").sameTerm(r)?"background-color: #fee;":"background-color: #ffffe7;"),o.parentNode.removeChild(o)}),!0),o},Object.defineProperty(t,"field",{enumerable:!0,get:function(){return u.field}}),Object.defineProperty(t,"fieldFunction",{enumerable:!0,get:function(){return u.fieldFunction}}),Object.defineProperty(t,"fieldLabel",{enumerable:!0,get:function(){return f.fieldLabel}}),Object.defineProperty(t,"fieldParams",{enumerable:!0,get:function(){return c.fieldParams}}),Object.defineProperty(t,"fieldStore",{enumerable:!0,get:function(){return f.fieldStore}}),t.findClosest=N,t.formsFor=function(e){var t=w.store;v.debug("formsFor: subject="+e);var r,n=t.findTypeURIs(e);for(r in n)v.debug(" type: "+r);var i=t.bottomTypeURIs(n),o=[];for(var a in i)v.debug("candidatesFor: trying bottom type ="+a),o=(o=o.concat(N(t,a,y.ui("creationForm")))).concat(N(t,a,y.ui("annotationForm")));return o},t.makeDescription=D,t.makeSelectForCategory=U,t.makeSelectForChoice=K,t.makeSelectForClassifierOptions=M,t.makeSelectForNestedCategory=B,t.makeSelectForOptions=function(e,t,r,n,i,o,a,s){v.debug("Select list length now "+i.length);for(var c,u=0,l={},f=t.updater.editable(a.uri),h=0;h<i.length;h++){var g=i[h];g.uri||d.warn("makeSelectForOptions: option does not have an uri: ".concat(g,", with predicate: ").concat(n)),g.uri&&!(g.uri in l)&&(l[g.uri]=!0,u++)}if(0===u)return(0,p.errorMessageBlock)(e,"Can't do selector with no options, subject= "+r+" property = "+n+".");v.debug("makeSelectForOptions: dataDoc="+a);var w=function(){return c={},n.sameTerm(y.rdf("type"))?c=t.findTypeURIs(r):t.each(r,n,null,a).forEach((function(e){e.uri&&(c[e.uri]=!0)})),c};c=w();var _=e.createElement("select");for(var E in _.setAttribute("style",m.formSelectSTyle),_.currentURI=null,_.refresh=function(){c=w();for(var e=0;e<_.children.length;e++){var t=_.children[e];t.AJAR_uri&&(t.selected=t.AJAR_uri in c)}_.disabled=!1},l){var k=t.sym(E),S=e.createElement("option");o.disambiguate?S.appendChild(e.createTextNode(x.labelWithOntology(k,!0))):S.appendChild(e.createTextNode(x.label(k,!0)));var A=t.any(k,t.sym("http://www.w3.org/ns/ui#backgroundColor"));A&&S.setAttribute("style","background-color: "+A.value+"; "),S.AJAR_uri=E,E in c&&(S.setAttribute("selected","true"),_.currentURI=E),_.appendChild(S)}if(!_.currentURI){var C=e.createElement("option");C.appendChild(e.createTextNode(o.nullLabel)),_.insertBefore(C,_.firstChild),C.selected=!0}return f&&_.addEventListener("change",(function(i){_.disabled=!0;for(var o=[],u=[],l=function(e){t.holds(r,n,e,a)&&o.push(b.st(r,n,e,a))},d=0;d<_.options.length;d++){var f=_.options[d];f.AJAR_uri&&(f.selected&&!(f.AJAR_uri in c)&&u.push(b.st(r,n,t.sym(f.AJAR_uri),a)),!f.selected&&f.AJAR_uri in c&&l(t.sym(f.AJAR_uri)),f.selected&&(_.currentURI=f.AJAR_uri))}for(var h=_.subSelect;h&&h.currentURI;)l(t.sym(h.currentURI)),h=h.subSelect;for(h=_.superSelect;h&&h.currentURI;)l(t.sym(h.currentURI)),h=h.superSelect;v.info("selectForOptions: data doc = "+a),t.updater.update(o,u,(function(t,r,n){if(c=w(),!r)return _.parentNode.appendChild((0,p.errorMessageBlock)(e,"Error updating data in select: "+n));_.disabled=!1,s&&s(r,{widget:"select",event:"change"})}))}),!1),_},Object.defineProperty(t,"mostSpecificClassURI",{enumerable:!0,get:function(){return u.mostSpecificClassURI}}),t.newButton=function(e,t,r,n,i,o,a,s){var c=e.createElement("button");return c.setAttribute("type","button"),c.innerHTML="New "+x.label(i),c.addEventListener("click",(function(u){c.parentNode.appendChild(L(e,t,r,n,i,o,a,s))}),!1),c},t.newThing=q,t.promptForNew=L,t.propertiesForClass=function(e,t){var r=e.each(void 0,y.rdf("range"),t);[y.rdfs("comment"),y.dc("title"),y.foaf("name"),y.foaf("homepage")].forEach((function(e){r.push(e)}));var n=e.each(void 0,y.rdf("type"),t);n.length>60&&(n=n.slice(0,60));for(var i={},o=0;o<(n.length>60?60:n.length);o++)e.statementsMatching(n[o],void 0,void 0).forEach((function(e){i[e.predicate.uri]=!0}));r.forEach((function(e){i[e.uri]=!0}));var a=[];for(var s in i)a.push(e.sym(s));return a},Object.defineProperty(t,"renderNameValuePair",{enumerable:!0,get:function(){return f.renderNameValuePair}}),t.sortByLabel=R,t.sortBySequence=j;var o=n(r(4687)),a=n(r(7156)),s=S(r(6186)),c=r(4246),u=r(4816),l=r(9742),d=S(r(4433)),p=r(9449),f=r(4322),h=r(4179),m=S(r(2853)),g=r(1124),v=S(r(8853)),y=S(r(6590)),b=S(r(6022)),w=r(166),x=S(r(5666)),_=r(1989),E=S(r(2457));function k(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(k=function(e){return e?r:t})(e)}function S(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=k(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function A(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return C(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?C(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var T=w.store;function O(e,t,r,n,i,o,a){for(var s=o.children,c=0;c<a.length;c++){var l=a[c];if((0,u.mostSpecificClassURI)(l)===y.ui("Options").uri){var p=(0,u.fieldFunction)(e,l)(e,null,t,r,l,n,i);d.log("Refreshing Options field by replacing it."),o.insertBefore(p,s[c]),o.removeChild(s[c+1])}}}function P(e,t,r,n,i,o,a,s){var c=y.ui,u=w.store,l=u.any(i,c("property"));if(!l){var d=(0,p.errorMessageBlock)(e,"No property to boolean field: "+i);return t&&t.appendChild(d),d}var h=u.any(i,c("label"));h||(h=x.label(l,!0)),o=(0,f.fieldStore)(n,l,o);var m=u.any(n,l);void 0===m&&(m=!1);var g=b.st(n,l,!0,o),v=H(e,u,h,b.st(n,l,!1,o),g,i,o,s);return t&&t.appendChild(v),v}function F(e,t,r,n,i,o,a){(0,u.fieldFunction)(e,i)(e,t,r,n,i,o,a)}function I(e,t,r,n,i,o,a){return(0,u.fieldFunction)(e,i)(e,t,r,n,i,o,a)}function N(e,t,r){for(var n=[e.sym(t)];n.length>0;){var i=n.shift(),o=e.each(i,r);if(v.debug("Lists for "+i+", "+r+": "+o.length),0!==o.length)return o;for(var a=e.each(i,y.rdfs("subClassOf")),s=0;s<a.length;s++)n.push(a[s]),v.debug("findClosest: add super: "+a[s])}return[]}function j(e){var t=e.map((function(e){return[T.any(e,y.ui("sequence"))||9999,e]}));return t.sort((function(e,t){return e[0]-t[0]})),t.map((function(e){return e[1]}))}function R(e){var t=e.map((function(e){return[x.label(e).toLowerCase(),e]}));return t.sort(),t.map((function(e){return e[1]}))}function L(e,t,r,n,i,o,a,c){var l=e.createElement("form");if(!o){var d=N(t,i.uri,y.ui("creationForm"));if(0===d.length){l.appendChild(e.createElement("p")).textContent="I am sorry, you need to provide information about a "+x.label(i)+" but I don't know enough information about those to ask you.";var p=l.appendChild(e.createElement("button"));return p.setAttribute("type","button"),p.setAttribute("style","float: right;"),p.innerHTML="Goto "+x.label(i),p.addEventListener("click",(function(t){e.outlineManager.GotoSubject(i,!0,void 0,!0,void 0)}),!1),l}v.debug("lists[0] is "+d[0]),o=d[0]}v.debug("form is "+o),l.setAttribute("style","border: 0.05em solid ".concat(m.formBorderColor,"; color: ").concat(m.formBorderColor)),l.innerHTML="<h3>New "+x.label(i)+"</h3>";var f=(0,u.fieldFunction)(e,o),h=q(a),g=!1;function w(e,t,r){return c(t,r)}v.info("paneUtils Object is "+h);var _=f(e,l,{},h,o,a,(function(o,u){if(!o)return c(o,u);var d=[];r&&!t.holds(r,n,h,a)&&d.push(b.st(r,n,h,a)),r&&!t.holds(h,y.rdf("type"),i,a)&&d.push(b.st(h,y.rdf("type"),i,a)),d.length?t.updater.update([],d,w):c(!0,u),g||(g=l.appendChild(s.linkButton(e,h)))}));return s.removeButton(e,_).setAttribute("style","float: right;"),l.AJAR_subject=h,l}function D(e,t,r,n,i,o){var a,s=e.createElement("div"),c=t.anyJS(r,n,null,i)||"",u=e.createElement("textarea");function l(c){a.disabled=!0,a.setAttribute("style","visibility: hidden; float: right;"),u.disabled=!0,u.style.color=m.textInputColorPending;var l=t.statementsMatching(r,n,null,i),d=b.st(r,n,u.value,i);t.updater.update(l,d,(function(t,r,n){r?(u.style.color=m.textInputColor,u.disabled=!1):s.appendChild((0,p.errorMessageBlock)(e,"Error (while saving change to "+i.uri+"): "+n)),o&&o(r,n)}))}return s.appendChild(u),u.rows=c?c.split("\n").length+2:2,u.cols=80,u.setAttribute("style",m.multilineTextInputStyle),null!==c?u.value=c:u.select(),s.refresh=function(){var e=t.any(r,n,null,i);e&&e.value!==u.value&&(u.value=e.value)},t.updater.editable(i.uri)?((a=E.continueButton(e,l)).disabled=!0,a.style.visibility="hidden",a.style.float="right",s.appendChild(a),u.addEventListener("keyup",(function(e){u.style.color="green",a&&(a.disabled=!1,a.style.visibility="")}),!0),u.addEventListener("change",l,!0)):(u.disabled=!0,u.style.backgroundColor=m.textInputBackgroundColorUneditable),s}function M(e,t,r,n,i,o,a,s){v.debug("Select list length now "+i.length);for(var c,l=0,f={},h=t.updater.editable(a.uri),g=0;g<i.length;g++){var w=i[g];w.uri||d.warn("makeSelectForClassifierOptions: option does not have an uri: ".concat(w,", with predicate: ").concat(n)),w.uri&&!(w.uri in f)&&(f[w.uri]=!0,l++)}if(0===l&&!o.mint)return(0,p.errorMessageBlock)(e,"Can't do selector with no options, subject= "+r+" property = "+n+".");v.debug("makeSelectForClassifierOptions: dataDoc="+a);var _=function(){return c={},n.sameTerm(y.rdf("type"))?c=t.findTypeURIs(r):t.each(r,n,null,a).forEach((function(e){c[e.uri]=!0})),c};c=_();var E=e.createElement("select");for(var k in E.setAttribute("style",m.formSelectSTyle),o.multiple&&E.setAttribute("multiple","true"),E.currentURI=null,E.refresh=function(){c=_();for(var e=0;e<E.children.length;e++){var t=E.children[e];t.AJAR_uri&&(t.selected=t.AJAR_uri in c)}E.disabled=!1},f){var S=t.sym(k),A=e.createElement("option");o.disambiguate?A.appendChild(e.createTextNode(x.labelWithOntology(S,!0))):A.appendChild(e.createTextNode(x.label(S,!0)));var C=t.any(S,t.sym("http://www.w3.org/ns/ui#backgroundColor"));C&&A.setAttribute("style","background-color: "+C.value+"; "),A.AJAR_uri=k,k in c&&(A.setAttribute("selected","true"),E.currentURI=k),E.appendChild(A)}if(h&&o.mint){var T=e.createElement("option");T.appendChild(e.createTextNode(o.mint)),T.AJAR_mint=!0,E.insertBefore(T,E.firstChild)}if(null==E.currentURI&&!o.multiple){var O=e.createElement("option");O.appendChild(e.createTextNode(o.nullLabel)),E.insertBefore(O,E.firstChild),O.selected=!0}return h&&E.addEventListener("change",(function(i){E.disabled=!0;for(var l,d=[],f=[],h=function(e){t.holds(r,n,e,a)&&d.push(b.st(r,n,e,a))},m=0;m<E.options.length;m++){var g=E.options[m];if(g.selected&&g.AJAR_mint){if(o.mintClass){var y=L(e,t,r,n,o.mintClass,null,a,(function(e,t){e||s(e,t,{change:"new"})}));E.parentNode.appendChild(y),l=y.AJAR_subject}else l=q(a);f.push(b.st(r,n,l,a)),o.mintStatementsFun&&(f=f.concat(o.mintStatementsFun(l)))}g.AJAR_uri&&(g.selected&&!(g.AJAR_uri in c)&&f.push(b.st(r,n,t.sym(g.AJAR_uri),a)),!g.selected&&g.AJAR_uri in c&&h(t.sym(g.AJAR_uri)),g.selected&&(E.currentURI=g.AJAR_uri))}for(var w=E.subSelect;w&&w.currentURI;)h(t.sym(w.currentURI)),w=w.subSelect;for(w=E.superSelect;w&&w.currentURI;)h(t.sym(w.currentURI)),w=w.superSelect;function x(e,t){s(e,{widget:"select",event:"new"})}v.info("makeSelectForClassifierOptions: data doc = "+a),t.updater.update(d,f,(function(t,r,n){if(c=_(),!r)return E.parentNode.appendChild((0,p.errorMessageBlock)(e,"Error updating data in select: "+n));E.disabled=!1,l&&(0,u.fieldFunction)(e,o.subForm)(e,E.parentNode,{},l,o.subForm,a,x),s&&s(r,{widget:"select",event:"change"})}))}),!1),E}function U(e,t,r,n,i,o){var a,s=t.any(n,y.owl("disjointUnionOf")),c=!1;return s?a=s.elements:(a=t.each(void 0,y.rdfs("subClassOf"),n),c=!0),v.debug("Select list length "+a.length),0===a.length?(0,p.errorMessageBlock)(e,"Can't do "+(c?"multiple ":"")+"selector with no subclasses of category: "+n):1===a.length?(0,p.errorMessageBlock)(e,"Can't do "+(c?"multiple ":"")+"selector with only 1 subclass of category: "+n+":"+a[1]):M(e,t,r,y.rdf("type"),a,{multiple:c,nullLabel:"* Select type *"},i,o)}function B(e,t,r,n,i,o){function a(){c&&(s.removeChild(c),c=null),u.currentURI&&t.any(t.sym(u.currentURI),y.owl("disjointUnionOf"))&&(c=B(e,t,r,t.sym(u.currentURI),i,o),u.subSelect=c.firstChild,u.subSelect.superSelect=u,s.appendChild(c))}var s=e.createElement("span"),c=null,u=U(e,t,r,n,i,(function(e,t){e&&a(),o(e,t)}));return s.appendChild(u),a(),s}function H(e,t,r,n,i,o,a,s){var c=e.createElement("div"),u=(0,f.renderNameValuePair)(e,t,c,o,r),l=t.updater.editable(a.uri),h=e.createElement("button"),g=h;function v(e){if(!e)return[];if(e.object)return e.why||(e.why=a),[e];if(e instanceof Array)return e;throw new Error("buildCheckboxForm: bad param "+e)}function b(e){return 0===e.filter((function(e){return!t.holds(e.subject,e.predicate,e.object,e.why)})).length}return h.style=m.checkboxInputStyle,u.appendChild(h),i=v(i),n=v(n),function(){var r=b(i),a=r;if(n.length){var u=b(n);if(r&&u)return c.appendChild(E.errorMessageBlock(e,"Inconsistent data in dataDoc!\n"+i+" and\n"+n)),c;if(!r&&!u){r=null;var l=t.any(o,y.ui("default"));a=l?"1"===l.value:!!s&&null}}h.state=r,h.textContent={true:"✓",false:s?"✕":" ",null:"-"}[a]}(),l?(h.addEventListener("click",(function(r){g.style.color="#bbb";var o=!0===h.state?i:!1===h.state?n:[];h.newState=null===h.state||!0!==h.state&&(!s||null);var a=!0===h.newState?i:!1===h.newState?n:[];d.log(" Deleting ".concat(o)),d.log(" Inserting ".concat(a)),t.updater.update(o,a,(function(r,n,i){n?(g.style.color="#000",h.state=h.newState,h.textContent={true:"✓",false:"✕",null:"-"}[h.state]):(o.why&&t.holds(o.subject,o.predicate,o.object,o.why)&&d.log(" @@@@@ weird if 409 - does hold statement"),g.style.color="#000",g.style.backgroundColor="#fee",c.appendChild((0,p.errorMessageBlock)(e,"Checkbox: Error updating dataDoc from ".concat(h.state," to ").concat(h.newState,":\n\n").concat(i))))}))}),!1),c):c}function q(e){var t=new Date;return b.sym(e.uri+"#id"+t.getTime())}function K(e,t,r,n,i,o,a,s,c,u,l){for(var d={},f=r.updater.editable(u.uri),h=0;h<o.length;h++){var g=o[h];g.uri&&!(g.uri in d)&&(d[g.uri]=!0)}if(0===Object.keys(d).length&&!c.mint)return(0,p.errorMessageBlock)(e,"Can't do selector with no options, subject= "+n+" property = "+i+".");v.debug("makeSelectForChoice: dataDoc="+u);var w,_,E=e.createElement("select");for(var k in E.setAttribute("style",m.formSelectSTyle),E.setAttribute("id","formSelect"),E.currentURI=null,d)E.appendChild(C(k));if(f&&c.mint){var S=e.createElement("option");S.appendChild(e.createTextNode(c.mint)),S.AJAR_mint=!0,E.insertBefore(S,E.firstChild)}function C(t){var n,i=e.createElement("option"),o=r.sym(t);n=c.disambiguate?x.labelWithOntology(o,!0):x.label(o,!0),i.appendChild(e.createTextNode(n)),i.setAttribute("value",t);var s=r.any(o,r.sym("http://www.w3.org/ns/ui#backgroundColor"));return s&&i.setAttribute("style","background-color: "+s.value+"; "),i.AJAR_uri=t,W(o.value,a)&&i.setAttribute("selected","true"),i}return 0===E.children.length&&E.insertBefore(((_=e.createElement("option")).appendChild(e.createTextNode((w="--- choice ---",i&&"BlankNode"!==i.termType&&(w="* Select for property: "+x.label(i)+" *"),n&&"BlankNode"!==n.termType&&(w="* Select for "+x.label(n,!0)+" *"),w))),_.disabled=!0,_.value=!0,_.hidden=!0,_.selected=!0,_),E.firstChild),E.update=function(t){a=t;var o,c,d=[],f=[],h=function(e){r.holds(n,i,e,u)||f.push(b.st(n,i,e,u)),s&&!r.holds(e,y.rdf("type"),r.sym(s),u)&&f.push(b.st(e,y.rdf("type"),r.sym(s),u))},m=r.each(n,i,null,u).map((function(e){return e.value})),g=A(m);try{for(g.s();!(o=g.n()).done;){var v=o.value;W(v,a)||(c=b.sym(v),r.holds(n,i,c,u)&&d.push(b.st(n,i,c,u)))}}catch(e){g.e(e)}finally{g.f()}var w,x=A(a);try{for(x.s();!(w=x.n()).done;){var _=w.value;_ in m||h(b.sym(_))}}catch(e){x.e(e)}finally{x.f()}r.updater.update(d,f,(function(t,r,n){if(!r)return E.parentNode.appendChild((0,p.errorMessageBlock)(e,"Error updating data in select: "+n));E.refresh(),l&&l(r,{widget:"select",event:"change"})}))},E.refresh=function(){E.disabled=!0;for(var o,d=[],f=0;f<E.options.length;f++){var h=E.options[f];if(h.selected&&h.AJAR_mint){if(c.mintClass){var m=L(e,r,n,i,s,c.subForm,u,(function(e,t){e||l(e,t,{change:"new"})}));E.parentNode.appendChild(m),o=m.AJAR_subject}else o=q(u);d.push(b.st(n,i,r.sym(o),u)),s&&d.push(b.st(o,y.rdf("type"),r.sym(s),u)),c.mintStatementsFun&&(d=d.concat(c.mintStatementsFun(o))),E.currentURI=o}h.AJAR_uri&&(h.selected&&W(h.AJAR_uri,a)&&(E.currentURI=h.AJAR_uri),W(h.AJAR_uri,a)||h.removeAttribute("selected"),W(h.AJAR_uri,a)&&h.setAttribute("selected","true"))}v.info("selectForOptions: data doc = "+u),E.currentURI&&c.subForm&&!c.multiSelect&&F(e,t,{},b.sym(E.currentURI),c.subForm,u,(function(n,i){n?(r.updater.update([],d,(function(r,n,i){n||t.appendChild((0,p.errorMessageBlock)(e,"Error updating select: "+i))})),l&&l(n,{widget:"select",event:"new"})):t.appendChild((0,p.errorMessageBlock)(e,"Error updating data in field of select: "+i))})),E.disabled=!1},f&&E.addEventListener("change",(function(e){t.removeChild(t.lastChild),E.refresh()}),!1),E}function W(e,t){var r;for(r=0;r<t.length;r++)if(t[r]===e)return!0;return!1}u.field[y.ui("AutocompleteField").uri]=h.autocompleteField,u.field[y.ui("Form").uri]=u.field[y.ui("Group").uri]=function(e,t,r,n,i,o,a){var s=e.createElement("div"),c=y.ui;if(t&&t.appendChild(s),i){var l=n.toNT()+"|"+i.toNT();if(r[l])return s.appendChild(e.createTextNode("Group: see above "+l)),s;var d={};for(var f in r)d[f]=1;d[l]=1;var h=i.doc?i.doc():null,g=T.any(i,c("weight"),null,h),v=g?Number(g.value):1;if(v>3||v<0)return s.appendChild((0,p.errorMessageBlock)(e,"Form Group weight ".concat(v," should be 0-3")));s.setAttribute("style",m.formGroupStyle[v]),s.style.display="flex",s.style.flexDirection="column",s.class="form-weight-"+v;var b,w=T.any(i,c("parts"),null,h);if(w?b=w.elements:(w=T.each(i,c("part"),null,h),b=j(w)),!w)return s.appendChild((0,p.errorMessageBlock)(e,"No parts to form! "));for(var x=0;x<b.length;x++){var _=b[x],E=(0,u.fieldFunction)(e,_);s.appendChild(E(e,null,d,n,_,o,(function(t,i){t&&i&&i.widget&&"select"===i.widget&&O(e,r,n,o,a,s,b),a(t,{widget:"group",change:i})})))}return s}},u.field[y.ui("Options").uri]=function(e,t,r,n,i,o,a){var s=w.store,c=e.createElement("div"),u=i.doc?i.doc():null,l=y.ui;t&&t.appendChild(c);var d=s.any(i,l("dependingOn"));d||(d=y.rdf("type"));var f,h=s.each(i,l("case"),null,u);h||c.appendChild((0,p.errorMessageBlock)(e,"No cases to Options form. ")),f=d.sameTerm(y.rdf("type"))?Object.keys(s.findTypeURIs(n)).map((function(e){return b.sym(e)})):s.each(n,d);for(var m=0;m<h.length;m++){for(var g=h[m],v=s.each(g,l("for"),null,u),x=!1,_=0;_<v.length;_++){var E,k=A(f);try{for(k.s();!(E=k.n()).done;){var S=E.value,C=v[_];(S.sameTerm(v)||S.termType===C.termType&&S.value===C.value)&&(x=!0)}}catch(e){k.e(e)}finally{k.f()}}if(x){var T=s.the(g,l("use"));if(!T)return c.appendChild((0,p.errorMessageBlock)(e,'No "use" part for case in form '+i)),c;I(e,c,r,n,T,o,a);break}}return c},u.field[y.ui("Multiple").uri]=function(e,t,r,n,i,c,l){function f(e){return e.map((function(e){return e.toString().slice(-7)})).join(", ")}function h(){return m.apply(this,arguments)}function m(){return(m=(0,a.default)(o.default.mark((function t(){var r,i,a;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=q(c),!P){t.next=8;break}return K(),L.elements.push(r),t.next=6,W();case 6:t.next=20;break;case 8:return i=I?[b.st(r,F,n,c)]:[b.st(n,F,r,c)],t.prev=9,t.next=12,k.updater.update([],i);case 12:t.next=19;break;case 14:t.prev=14,t.t0=t.catch(9),a="Error adding to unordered multiple: "+t.t0,A.appendChild((0,p.errorMessageBlock)(e,a)),d.error(a);case 19:z();case 20:case"end":return t.stop()}}),t,null,[[9,14]])})))).apply(this,arguments)}function _(t){function i(){return(i=(0,a.default)(o.default.mark((function r(){var i,a;return o.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!P){r.next=14;break}d.log("pre delete: "+f(L.elements)),i=0;case 3:if(!(i<L.elements.length)){r.next=12;break}if(!L.elements[i].sameTerm(t)){r.next=9;break}return L.elements.splice(i,1),r.next=8,W();case 8:return r.abrupt("return");case 9:i++,r.next=3;break;case 12:r.next=15;break;case 14:k.holds(n,F,t,c)&&(a=[b.st(n,F,t,c)],k.updater.update(a,[],(function(t,r,n){r?M.removeChild(y):M.appendChild((0,p.errorMessageBlock)(e,"Multiple: delete failed: "+n))})));case 15:case"end":return r.stop()}}),r)})))).apply(this,arguments)}function h(e,t){return m.apply(this,arguments)}function m(){return(m=(0,a.default)(o.default.mark((function e(r,n){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:d.log("pre move: "+f(L.elements)),i=0;case 2:if(!(i<L.elements.length)){e.next=8;break}if(!L.elements[i].sameTerm(t)){e.next=5;break}return e.abrupt("break",8);case 5:i++,e.next=2;break;case 8:if(i===L.elements.length&&alert("list move: not found element for "+t),!n){e.next=16;break}if(0!==i){e.next=13;break}return alert("@@ boop - already at top -temp message"),e.abrupt("return");case 13:L.elements.splice(i-1,2,L.elements[i],L.elements[i-1]),e.next=20;break;case 16:if(i!==L.elements.length-1){e.next=19;break}return alert("@@ boop - already at bottom -temp message"),e.abrupt("return");case 19:L.elements.splice(i,2,L.elements[i+1],L.elements[i]);case 20:return e.next=22,W();case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}v.debug("Multiple: render object: "+t);var y=(0,u.fieldFunction)(e,R)(e,null,r,t,R,c,(function(e,r){d.log("Item done callback for item ".concat(t.toString())),e||d.error(" Item done callback: Error: "+r),l(e,r)}));if(y.subject=t,k.updater.editable(c.uri)&&(s.deleteButtonWithCheck(e,y,N,(function(){return i.apply(this,arguments)})),P)){var w=e.createElement("div");w.style.display="grid",w.style.gridTemplateColumns="auto 3em",w.style.gridTemplateRows="50% 50%";var x=s.button(e,g.icons.iconBase+"noun_1369237.svg","Move Up",function(){var e=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",h(t,!0));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),_=s.button(e,g.icons.iconBase+"noun_1369241.svg","Move Down",function(){var e=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",h(t,!1));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),E=e.createElement("div");return E.appendChild(y),w.appendChild(E),w.appendChild(x),w.appendChild(_),x.style.gridColumn=2,_.style.gridColumn=2,x.style.gridRow=1,_.style.padding="0em",x.style.padding="0em",_.style.gridRow=2,E.style.gridColumn=1,E.style.gridRowStart="span 2",w}return y}var E=g.icons.iconBase+"noun_19460_green.svg",k=w.store,S=i.doc?i.doc():null,A=e.createElement("div"),C=A,T=y.ui;t&&t.appendChild(A);var O=k.any(i,T("ordered")),P=!!O&&b.Node.toJS(O),F=k.any(i,T("property")),I=k.anyJS(i,T("reverse"),null,S);if(!F)return A.appendChild((0,p.errorMessageBlock)(e,"No property to multiple: "+i)),C;var N=k.any(i,T("label"));N||(N=x.label(F));var j=k.any(i,T("min"));j=j?0+j.value:0;var R=k.any(i,T("part"));if(!R)return A.appendChild((0,p.errorMessageBlock)(e,"No part to multiple: "+i)),C;var L,D,M=A.appendChild(e.createElement("div"));if(M.style.display="flex",M.style.flexDirection="column",D=I?k.any(null,F,n,c):k.any(n,F,null,c),P?(L=I?k.any(null,F,n,c):k.any(n,F,null,c),D=L?L.elements:[]):(D=I?k.each(null,F,n,c):k.each(n,F,null,c),L=null),k.updater.editable(c.uri)){var U=A.appendChild(e.createElement("div"));U.style.padding="0.5em";var B=U.appendChild(e.createElement("img"));B.setAttribute("src",E),B.setAttribute("style","margin: 0.2em; width: 1.5em; height:1.5em"),B.title="Click to add another "+N;var H=e.createElement("span");H.textContent=(0===D.length?"Add another ":"Add ")+N,U.addEventListener("click",function(){var e=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,h();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),!0),U.appendChild(H)}function K(){L||(L=new b.Collection,I?k.add(L,F,n,c):k.add(n,F,L,c))}function W(){return V.apply(this,arguments)}function V(){return(V=(0,a.default)(o.default.mark((function t(){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d.log("save list: "+f(L.elements)),K(),t.prev=2,t.next=5,k.fetcher.putBack(c);case 5:t.next=11;break;case 7:return t.prev=7,t.t0=t.catch(2),A.appendChild((0,p.errorMessageBlock)(e,"Error trying to put back a list: "+t.t0)),t.abrupt("return");case 11:z();case 12:case"end":return t.stop()}}),t,null,[[2,7]])})))).apply(this,arguments)}function z(){var e;if(P){var t=I?k.the(null,F,n,c):k.the(n,F,null,c);e=t?t.elements:[]}else(e=I?k.each(null,F,n,c):k.each(n,F,null,c)).sort();x.syncTableToArrayReOrdered(M,e,_)}function J(){return(J=(0,a.default)(o.default.mark((function e(){var t,r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((t=j-D.length)>0)){e.next=12;break}r=0;case 3:if(!(r<t)){e.next=10;break}return d.log("Adding extra: min "+j),e.next=7,h();case 7:r++,e.next=3;break;case 10:return e.next=12,W();case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return M.refresh=z,z(),function(){return J.apply(this,arguments)}().then((function(){d.log(" Multiple render: async stuff ok")}),(function(e){d.error(" Multiple render: async stuff fails. #### ",e)})),C},u.field[y.ui("PhoneField").uri]=f.basicField,u.field[y.ui("EmailField").uri]=f.basicField,u.field[y.ui("ColorField").uri]=f.basicField,u.field[y.ui("DateField").uri]=f.basicField,u.field[y.ui("DateTimeField").uri]=f.basicField,u.field[y.ui("TimeField").uri]=f.basicField,u.field[y.ui("NumericField").uri]=f.basicField,u.field[y.ui("IntegerField").uri]=f.basicField,u.field[y.ui("DecimalField").uri]=f.basicField,u.field[y.ui("FloatField").uri]=f.basicField,u.field[y.ui("TextField").uri]=f.basicField,u.field[y.ui("SingleLineTextField").uri]=f.basicField,u.field[y.ui("NamedNodeURIField").uri]=f.basicField,u.field[y.ui("MultiLineTextField").uri]=function(e,t,r,n,i,o,a){var s=y.ui,c=w.store,u=i.doc?i.doc():null,l=c.any(i,s("property"));if(!l)return(0,p.errorMessageBlock)(e,"No property to text field: "+i);var d=e.createElement("div");d.style.display="flex",d.style.flexDirection="row";var h=d.appendChild(e.createElement("div"));h.style.width=m.formFieldNameBoxWidth;var g=d.appendChild(e.createElement("div"));h.appendChild((0,f.fieldLabel)(e,l,i)),o=(0,f.fieldStore)(n,l,o);var v=c.anyJS(n,l,null,o)||"",b=c.updater.editable(o.uri),x=i&&c.anyJS(i,y.ui("suppressEmptyUneditable"),null,u);!b&&x&&""===v&&(d.style.display="none");var _=D(e,c,n,l,o,a);return g.appendChild(_),t&&t.appendChild(d),d},u.field[y.ui("BooleanField").uri]=function(e,t,r,n,i,o,a){return P(e,t,0,n,i,o,0,!1)},u.field[y.ui("TristateField").uri]=function(e,t,r,n,i,o,a){return P(e,t,0,n,i,o,0,!0)},u.field[y.ui("Classifier").uri]=function(e,t,r,n,i,o,a){var s=w.store,c=y.ui,u=s.any(i,c("category"));if(!u)return(0,p.errorMessageBlock)(e,"No category for classifier: "+i);v.debug("Classifier: dataDoc="+o);var l=B(e,s,n,u,o,(function(e,t){return a(e,t)}));return t&&t.appendChild(l),l},u.field[y.ui("Choice").uri]=function(e,t,r,n,i,o,a){var c,u=y.ui,l=w.store,d=i.doc?i.doc():null,h=e.createElement("div");h.setAttribute("class","choiceBox"),t&&t.appendChild(h);var m=e.createElement("div");m.setAttribute("class","formFieldName choiceBox-label"),h.appendChild(m);var g=e.createElement("div");g.setAttribute("class","formFieldValue choiceBox-selectBox"),h.appendChild(g);var v=l.any(i,u("property"));if(!v)return h.appendChild((0,p.errorMessageBlock)(e,"No property for Choice: "+i));m.appendChild((0,f.fieldLabel)(e,v,i));var x=l.any(i,u("from"));if(!x)return(0,p.errorMessageBlock)(e,"No 'from' for Choice: "+i);var E=l.any(i,u("use")),k={form:i,subForm:E,disambiguate:!1};l.any(i,u("canMintNew"))&&(k.mint="* Create new *");var S=l.any(i,u("multiselect"));S&&(k.multiSelect=!0);var A,C=l.any(i,u("search-full-store")).length?null:o;return g.refresh=function(){var t=l.each(n,v,null,o).map((function(e){return e.value})),r=function(e){var t,r=[];for(var n in r=l.each(void 0,y.rdf("type"),x,d),function(e,t,r){var n,i,o,a,s,c,u,l,d,p,f,h={};h[t.toNT()]=!0;var m={},g=e.transitiveClosure(h,e.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0);for(var v in g){for(var y=0,b=(s=e.statementsMatching(null,e.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),e.fromNT(v),r)).length;y<b;y++)m[(p=s[y]).subject.toNT()]=p;for(var w=0,x=(c=e.each(null,e.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"),e.fromNT(v),r)).length;w<x;w++)for(a=c[w],o=0,n=(u=e.statementsMatching(null,a,null,r)).length;o<n;o++)m[(p=u[o]).subject.toNT()]=p;for(var _=0,E=(l=e.each(null,e.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"),e.fromNT(v),r)).length;_<E;_++)for(a=l[_],f=0,i=(d=e.statementsMatching(null,a,null,r)).length;f<i;f++)m[(p=d[f]).object.toNT()]=p}return m}(l,x,e))r.push(l.fromNT(n));if(x.sameTerm(y.rdfs("Class")))for(c in s.allClassURIs())r.push(l.sym(c));else if(x.sameTerm(y.rdf("Property"))){for(c in(t=s.propertyTriage(l)).op)r.push(l.fromNT(c));for(c in t.dp)r.push(l.fromNT(c));k.disambiguate=!0}else if(x.sameTerm(y.owl("ObjectProperty"))){for(c in(t=s.propertyTriage(l)).op)r.push(l.fromNT(c));k.disambiguate=!0}else if(x.sameTerm(y.owl("DatatypeProperty"))){for(c in(t=s.propertyTriage(l)).dp)r.push(l.fromNT(c));k.disambiguate=!0}return r}(C);if(r.push(t),r=R(r),A=K(e,g,l,n,v,r,t,x,k,o,a),g.innerHTML="",g.appendChild(A),S){var i=new _.IconicMultiSelect({placeholder:A.selected,select:A,container:g,textField:"textField",valueField:"valueField"});i.init(),i.subscribe((function(r){if("REMOVE_OPTION"===r.action&&(t=t.filter((function(e){return e!==r.value}))),"CLEAR_ALL_OPTIONS"===r.action&&(t=[]),"ADD_OPTION"===r.action)if((r.value+"").includes("Create new")){var i=q(o),s=[];s.push(b.st(n,v,l.sym(i),o)),x&&s.push(b.st(i,y.rdf("type"),l.sym(x),o)),E&&F(e,g,{},b.sym(i),E,o,(function(r,n){r?(l.updater.update([],s,(function(t,r,n){r||g.appendChild((0,p.errorMessageBlock)(e,"Error updating select: "+n))})),t.push(i),a&&a(r,{widget:"select",event:"new"})):g.appendChild((0,p.errorMessageBlock)(e,"Error updating data in field of select: "+n))}))}else t.push(r.value);A.update(t)}))}},g.refresh(),A&&A.refresh&&A.refresh(),h},u.field[y.ui("Comment").uri]=u.field[y.ui("Heading").uri]=function(e,t,r,n,i,o,a){var s=y.ui,d=w.store,p=d.any(i,s("contents"));p||(p="Error: No contents in comment field.");var f=i.doc?i.doc():null,h=(0,u.mostSpecificClassURI)(i),m=c.fieldParams[h]||{},g=e.createElement("div");t&&t.appendChild(g);var v=g.appendChild(e.createElement(m.element));v.textContent=p,(0,l.setFieldStyle)(v,i);var b=d.anyJS(i,y.ui("suppressIfUneditable"),null,f),x=d.updater.editable(o.uri);return b&&!x&&(g.style.display="none"),g}},611:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.renderAutocompleteControl=function(e,t,r,n,i,o){return x.apply(this,arguments)};var o=n(r(4687)),a=n(r(7156)),s=h(r(6590)),c=r(1124),u=r(166),l=h(r(2457)),d=h(r(5666)),p=r(6674);function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(f=function(e){return e?r:t})(e)}function h(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=f(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function m(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var v="Solid ID",y=c.icons.iconBase+"noun_34653_green.svg",b=c.icons.iconBase+"noun_Search_875351.svg",w=c.icons.iconBase+"noun_253504.svg";function x(){return x=(0,a.default)(o.default.mark((function e(t,r,n,i,c,f){var h,g,x,_,E,k,S,A,C,T,O,P,F,I,N,j,R,L,D,M,U,B,H;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(D=function(){L?((0,p.setVisible)(R,!1),(0,p.setVisible)(P,!1),(0,p.setVisible)(F,!1)):((0,p.setVisible)(R,!0),(0,p.setVisible)(P,!1),(0,p.setVisible)(F,!1))},O=function(){return(O=(0,a.default)(o.default.mark((function e(t){var n,i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=m(t),e.prev=1,n.s();case 3:if((i=n.n()).done){e.next=9;break}return a=i.value,e.next=7,c(r,a);case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),n.e(e.t0);case 14:return e.prev=14,n.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])})))).apply(this,arguments)},T=function(e){return O.apply(this,arguments)},C=function(){return(C=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!U){e.next=5;break}B.removeChild(U),U=void 0,e.next=7;break;case 5:return e.next=7,k();case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)},A=function(e){return C.apply(this,arguments)},S=function(){return(S=(0,a.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(U=t.createElement("div")).setAttribute("style","display: flex; flex-flow: wrap;"),e.t0=U,e.next=5,(0,p.renderAutoComplete)(t,i,M,h);case 5:e.t1=e.sent,e.t0.appendChild.call(e.t0,e.t1),U.appendChild(P),U.appendChild(F),U.appendChild(R),U.appendChild(I),B.appendChild(U);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)},k=function(){return S.apply(this,arguments)},E=function(){U&&(B.removeChild(U),U=void 0)},_=function(){return(_=(0,a.default)(o.default.mark((function e(n){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l.askName(t,u.store,B,s.vcard("url"),void 0,v);case 2:if(i=e.sent){e.next=5;break}return e.abrupt("return");case 5:return e.abrupt("return",c(r,i));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)},x=function(e){return _.apply(this,arguments)},g=function(){return(g=(0,a.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.permanent?((0,p.setVisible)(R,!0),(0,p.setVisible)(P,!1),(0,p.setVisible)(F,!1)):E(),e.abrupt("return",c(t,r));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)},h=function(e,t){return g.apply(this,arguments)},(P=l.continueButton(t)).setAttribute("data-testid","accept-button"),(F=l.cancelButton(t)).setAttribute("data-testid","cancel-button"),I=t.createElement("div"),N=i.targetClass?d.label(i.targetClass):"item",(j=l.deleteButtonWithCheck(t,I,N,f)).setAttribute("data-testid","delete-button"),(R=l.button(t,w,"Edit",(function(e){L=!L,D()}))).setAttribute("data-testid","edit-button"),L=!0,M={acceptButton:P,cancelButton:F,editButton:R,deleteButton:j},U=void 0,(B=t.createElement("div")).style.display="flex",B.style.flexDirection="row",!i.permanent&&!i.currentObject){e.next=31;break}return e.next=31,k();case 31:return n.editable&&(B.style.width="100%",n.manualURIEntry&&(H=B.appendChild(l.button(t,y,n.idNoun,x)),l.makeDropTarget(H,T,void 0)),!n.dbLookup||i.currentObject||i.permanent||B.appendChild(l.button(t,b,n.idNoun,A))),D(),e.abrupt("return",B);case 34:case"end":return e.stop()}}),e)}))),x.apply(this,arguments)}},4179:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.autocompleteField=function(e,t,r,n,i,f,h){var m;function g(){return(g=(0,a.default)(o.default.mark((function t(r,i){var a,s,c,l,d;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i){t.next=2;break}throw new Error("autocompleteField: No name set.");case 2:if(!(a=y.the(n,E,null,f))){t.next=7;break}if(s=y.any(a,k,null,f),!(a.equals(r)&&s&&s.sameTerm(i))){t.next=7;break}return t.abrupt("return");case 7:return c=a?y.statementsMatching(n,E,a,f).concat(y.statementsMatching(a,k,null,f)):[],l=[(0,p.st)(n,E,r,f),(0,p.st)(r,k,i,f)],t.prev=9,t.next=12,null===(d=y.updater)||void 0===d?void 0:d.updateMany(c,l);case 12:t.next=19;break;case 14:return t.prev=14,t.t0=t.catch(9),h(!1,t.t0),w.appendChild(u.errorMessageBlock(e,"Autocomplete form data update error:"+t.t0,null,t.t0)),t.abrupt("return");case 19:h(!0,"");case 20:case"end":return t.stop()}}),t,null,[[9,14]])})))).apply(this,arguments)}function v(){return(v=(0,a.default)(o.default.mark((function t(r,i){var a,s,c,l,d;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=y.the(n,E,null,f)){t.next=5;break}return h(!1,"NO data to elete"),w.appendChild(u.errorMessageBlock(e,"Autocomplete delete: no old data!")),t.abrupt("return");case 5:return s=y.statementsMatching(n,E,a,f).concat(y.statementsMatching(a,k,null,f)),c=[],t.prev=7,t.next=10,null===(l=y.updater)||void 0===l?void 0:l.updateMany(s,c);case 10:t.next=18;break;case 12:return t.prev=12,t.t0=t.catch(7),d=new Error("Autocomplete form data delete error:"+t.t0),h(!1,t.t0),w.appendChild(u.errorMessageBlock(e,d,null,t.t0)),t.abrupt("return");case 18:h(!0,"");case 19:case"end":return t.stop()}}),t,null,[[7,12]])})))).apply(this,arguments)}if("NamedNode"!==n.termType)throw new Error("Sorry this field only works on NamedNode subjects (for editable)");var y=c.store,b=i.doc?i.doc():null,w=e.createElement("div");t&&t.appendChild(w);var x=e.createElement("div");x.setAttribute("class","formFieldName"),x.setAttribute("style",l.formFieldNameBoxStyle),w.appendChild(x);var _=e.createElement("div");_.setAttribute("class","formFieldValue"),w.appendChild(_);var E=y.any(i,s.ui("property"));if(!E)return w.appendChild(u.errorMessageBlock(e,"Error: No property given for autocomplete field: "+i));var k=y.any(i,s.ui("labelProperty"))||s.schema("name"),S=y.any(i,s.ui("dataSource"));if(!S)return w.appendChild(u.errorMessageBlock(e,"Error: No data source given for autocomplete field: "+i));var A={label:y.anyJS(S,s.schema("name"),null,S.doc()),logo:y.any(S,s.schema("logo"),null,S.doc())},C=y.any(i,s.ui("targetClass"),null,i.doc())||y.any(S,s.ui("targetClass"),null,S.doc());C&&(A.targetClass=C),A.objectURIBase=y.any(S,s.ui("objectURIBase"),null,S.doc())||void 0;var T=y.anyJS(S,s.ui("endpoint"),null,S.doc());if(T){if(A.endpoint=T,A.searchByNameQuery=y.anyJS(S,s.ui("searchByNameQuery"),null,S.doc()),!A.searchByNameQuery)return w.appendChild(u.errorMessageBlock(e,"Error: No searchByNameQuery given for endpoint data Source: "+i));A.insitituteDetailsQuery=y.anyJS(S,s.ui("insitituteDetailsQuery"),null,S.doc())}else{var O=y.anyJS(S,s.ui("searchByNameURI"));if(!O)return w.appendChild(u.errorMessageBlock(e,"Error: No searchByNameURI OR sparql endpoint given for dataSource: "+S));A.searchByNameURI=O}var P=y.anyJS(i,s.ui("suppressEmptyUneditable"),null,b),F=null===(m=y.updater)||void 0===m?void 0:m.editable(f.uri),I={permanent:!0,targetClass:A.targetClass,queryParams:A};I.size=y.anyJS(i,s.ui("size"),null,b)||void 0;var N=y.any(n,E,void 0,f);if(N)I.currentObject=N,I.currentName=y.any(I.currentObject,k,null,f);else if(N=y.any(i,s.ui("default")))I.currentObject=N,I.currentName=y.any(I.currentObject,k,null,f);else if(P&&!F)return w.style.display="none",w;x.appendChild(u.fieldLabel(e,E,i));var j={editable:F,dbLookup:!0};return(0,d.renderAutocompleteControl)(e,n,j,I,(function(e,t){return g.apply(this,arguments)}),(function(e,t){return v.apply(this,arguments)})).then((function(e){_.appendChild(e)}),(function(t){_.appendChild(u.errorMessageBlock(e,"Error rendering autocomplete ".concat(i,": ").concat(t),"#fee",t))})),w};var o=n(r(4687)),a=n(r(7156)),s=h(r(6590)),c=r(166),u=h(r(2457)),l=h(r(2853)),d=r(611),p=r(6022);function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(f=function(e){return e?r:t})(e)}function h(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=f(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}},6674:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.renderAutoComplete=function(e,t,r,n){return b.apply(this,arguments)},t.setVisible=y;var o=n(r(4687)),a=n(r(7156)),s=h(r(4433)),c=h(r(2853)),u=h(r(2457)),l=r(166),d=r(5454),p=r(8214);function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(f=function(e){return e?r:t})(e)}function h(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=f(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function m(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var v=20;function y(e,t){e.style.display=t?"":"none"}function b(){return b=(0,a.default)(o.default.mark((function e(t,r,n,i){var f,h,g,b,w,x,_,E,k,S,A,C,T,O,P,F,I,N,j,R,L,D,M,U,B,H,q,K,W,V,z,J,Z,$;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(N=function(){r.currentObject?(J.value=r.currentName?r.currentName.value:"??? wot no name for "+r.currentObject,q=r.currentName,U=r.currentName?r.currentName.value:void 0,K=r.currentObject):(J.value="",U=void 0,K=void 0),n.deleteButton&&y(n.deleteButton,!!r.currentObject),n.acceptButton&&y(n.acceptButton,!1),n.editButton&&y(n.editButton,!0),n.cancelButton&&y(n.cancelButton,!1),D=!1,S()},I=function(){return I=(0,a.default)(o.default.mark((function e(){var r,n,i,u,l,f,h,y,b;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=function(e,t){return t.name.value>e.name.value?1:t.name.name<e.name.value?-1:0},r=function(e){var r=t.createElement("tr");c.setStyle(r,"autocompleteRowStyle"),r.setAttribute("style","padding: 0.3em;"),r.style.color=M?"#080":"#088",r.textContent=e.name.value;var n=(0,d.bindingToTerm)(e.subject),i=(0,d.bindingToTerm)(e.name);return r.addEventListener("click",function(){var e=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.log(" click row textContent: "+r.textContent),s.log(" click name: "+i.value),n&&i&&g(n,i);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),r},!D){e.next=5;break}return s.log('Ignoring "'.concat(J.value,'" because of lock ')),e.abrupt("return");case 5:return s.log('Setting lock at "'.concat(J.value,'"')),D=!0,e.next=9,(0,p.getPreferredLanguages)();case 9:if(i=e.sent,!((u=J.value.trim().toLowerCase()).length<4)){e.next=16;break}S(),B=v,e.next=31;break;case 16:if(M&&U&&u.startsWith(U)){e.next=21;break}return s.log(' Querying database at "'.concat(u,'" cf last "').concat(U,'".')),e.next=20,T(u,i);case 20:R=e.sent;case 21:l=P(u,R),L&&l.length<=40&&(B=l.length),M=L&&l.length<=B,s.log(' Filter:"'.concat(u,'" lastBindings: ').concat(R.length,", slimmed to ").concat(l.length,"; rows: ").concat(B,", Enough? ").concat(L,", All displayed? ").concat(M)),(f=l.slice(0,B)).sort(n),S(),h=m(f);try{for(h.s();!(y=h.n()).done;)b=y.value,W.appendChild(r(b))}catch(e){h.e(e)}finally{h.f()}1===l.length&&g((0,d.bindingToTerm)(l[0].subject),(0,d.bindingToTerm)(l[0].name));case 31:D=!1;case 32:case"end":return e.stop()}}),e)}))),I.apply(this,arguments)},F=function(){return I.apply(this,arguments)},P=function(e,t){return t.filter((function(t){return k(e,t.name.value)}))},O=function(){return(O=(0,a.default)(o.default.mark((function e(t,n){var i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,d.queryPublicDataByName)(t,j,n||p.defaultPreferredLanguages,r.queryParams);case 3:i=e.sent,e.next=11;break;case 6:return e.prev=6,e.t0=e.catch(0),f("Error querying db of organizations: "+e.t0),D=!1,e.abrupt("return");case 11:return L=i.length<d.AUTOCOMPLETE_LIMIT,U=L?t:void 0,S(),a=(0,p.filterByLanguage)(i,n),e.abrupt("return",a);case 16:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)},T=function(e,t){return O.apply(this,arguments)},C=function(){return(C=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:y(n.cancelButton,!0),F();case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)},A=function(e){return C.apply(this,arguments)},S=function(){for(;W.children.length>1;)W.removeChild(W.lastChild)},k=function(e,t){for(var r=e.split(" "),n=0;n<r.length;n++){var i=r[n];if(t.toLowerCase().indexOf(i)<0)return!1}return!0},E=function(){return(E=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.log("Auto complete: Canceled by user! "),r.permanent?N():H.parentNode&&H.parentNode.removeChild(H);case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)},_=function(e){return E.apply(this,arguments)},x=function(){return(x=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:q&&J.value===q.value&&h(K,q);case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)},w=function(e){return x.apply(this,arguments)},b=function(){return(b=(0,a.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.acceptButton){e.next=10;break}return n.acceptButton.disbaled=!1,y(n.acceptButton,!0),J.value=r.value,q=r,K=t,s.log("Auto complete: name: "+r),s.log("Auto complete: waiting for accept "+t),S(),e.abrupt("return");case 10:y(n.cancelButton,!0),h(t,r);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)},g=function(e,t){return b.apply(this,arguments)},h=function(e,t){s.log("Auto complete: finish! "+e),"Literal"===e.termType&&r.queryParams.objectURIBase&&(e=l.store.sym(r.queryParams.objectURIBase.value+e.value)),S(),i(e,t)},f=function(e){var r=W.appendChild(t.createElement("tr"));s.log(e);var n=new Error(e);r.appendChild(u.errorMessageBlock(t,n,"pink")),c.setStyle(r,"autocompleteRowStyle"),r.style.padding="1em"},j=r.targetClass){e.next=21;break}throw new Error("renderAutoComplete: missing targetClass");case 21:return n.acceptButton&&n.acceptButton.addEventListener("click",w,!1),n.cancelButton&&n.cancelButton.addEventListener("click",_,!1),L=!1,D=!1,M=!1,U=void 0,B=v,H=t.createElement("div"),q=void 0,K=void 0,(W=H.appendChild(t.createElement("table"))).setAttribute("data-testid","autocomplete-table"),W.setAttribute("style","max-width: 30em; margin: 0.5em;"),V=W.appendChild(t.createElement("tr")),c.setStyle(V,"autocompleteRowStyle"),z=V.appendChild(t.createElement("td")),(J=z.appendChild(t.createElement("input"))).setAttribute("type","text"),N(),Z=r.size||c.textInputSize||20,J.setAttribute("size",Z),J.setAttribute("data-testid","autocomplete-input"),$=c.textInputStyle||"border: 0.1em solid #444; border-radius: 0.5em; width: 100%; font-size: 100%; padding: 0.1em 0.6em",J.setAttribute("style",$),J.addEventListener("keyup",(function(e){13===e.keyCode&&w(e)}),!1),J.addEventListener("input",A),e.abrupt("return",H);case 48:case"end":return e.stop()}}),e)}))),b.apply(this,arguments)}},8214:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.addDefaults=h,t.defaultPreferredLanguages=void 0,t.filterByLanguage=function(e,t){var r={};e.forEach((function(e){var t=e.subject.value;r[t]=r[t]||[],r[t].push(e)}));var n=t||f;n.reverse();var i=[];for(var o in r){var a=r[o].map((function(e){var t=e.name["xml:lang"];return[n.indexOf(t),e]}));a.sort(),a.reverse(),i.push(a[0][1])}return s.log(" Filter by language: ".concat(e.length," -> ").concat(i.length)),i},t.getPreferredLanguages=function(){return v.apply(this,arguments)},t.getPreferredLanguagesFor=m,t.languageCodeURIBase=void 0;var o=n(r(4687)),a=n(r(7156)),s=d(r(4433)),c=r(166),u=d(r(6590));function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(l=function(e){return e?r:t})(e)}function d(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}var p="https://www.w3.org/ns/iana/language-code/";t.languageCodeURIBase=p;var f=["en","fr","de","it","ar"];function h(e){return e||(e=[]),e.concat(f.filter((function(t){return!e.includes(t)})))}function m(e){return g.apply(this,arguments)}function g(){return(g=(0,a.default)(o.default.mark((function e(t){var r,n,i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.doc(),e.next=3,null===(r=c.store.fetcher)||void 0===r?void 0:r.load(n);case 3:if(i=c.store.any(t,u.schema("knowsLanguage"),null,n)){e.next=6;break}return e.abrupt("return",f);case 6:if(a=[],i.elements.forEach((function(e){var t=c.store.any(e,u.solid("publicId"),null,n);if(t)if(t.value.startsWith(p)){var r=t.value.slice(p.length);a.push(r)}else console.error("What should be a language code ".concat(t.value," does not start with ").concat(p));else console.warn("getPreferredLanguages: No publiID of language.")})),!(a.length>0)){e.next=11;break}return console.log(' User knows languages with codes: "'.concat(a.join(","),'"')),e.abrupt("return",h(a));case 11:return e.abrupt("return",null);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(){return(v=(0,a.default)(o.default.mark((function e(){var t,r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c.authn.currentUser();case 2:if(!(t=e.sent)){e.next=9;break}return e.next=6,m(t);case 6:if(!(r=e.sent)){e.next=9;break}return e.abrupt("return",r);case 9:if("undefined"==typeof navigator){e.next=14;break}if(!navigator.languages){e.next=12;break}return e.abrupt("return",h(navigator.languages.map((function(e){return e.split("-")[0]}))));case 12:if(!navigator.language){e.next=14;break}return e.abrupt("return",h([navigator.language.split("-")[0]]));case 14:return e.abrupt("return",f);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.defaultPreferredLanguages=f},5454:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.AUTOCOMPLETE_LIMIT=void 0,t.ESCOResultToBindings=k,t.bindingToTerm=function(e){var t=e.type.toLowerCase();if("uri"===t||"iri"===t)return c.store.sym(e.value);if("literal"===t)return e["xml:lang"]?new s.Literal(e.value,e["xml:lang"]):new s.Literal(e.value);throw new Error('bindingToTerm: Unexpected type "'.concat(e.type,'" in sparql binding}'))},t.fetcherOptionsJsonPublicData=t.escoParameters=t.dbpediaParameters=t.dbPediaTypeMap=void 0,t.getDbpediaDetails=D,t.getWikidataDetails=N,t.getWikidataDetailsOld=function(e,t,r){return R.apply(this,arguments)},t.getWikidataLocation=function(e,t,r){return L.apply(this,arguments)},t.instituteDetailsWikidataQuery=void 0,t.loadFromBindings=E,t.loadPublicDataThing=function(e,t,r){return I.apply(this,arguments)},t.queryESCODataByName=function(e,t,r){return S.apply(this,arguments)},t.queryPublicDataByName=function(e,t,r,n){return C.apply(this,arguments)},t.queryPublicDataConstruct=P,t.queryPublicDataSelect=T,t.wikidataParameters=t.wikidataOutgoingClassMap=t.wikidataIncomingClassMap=t.wikidataClasses=t.variableNameToPredicateMap=void 0;var o=n(r(4687)),a=n(r(7156)),s=r(6022),c=r(166),u=f(r(4433)),l=f(r(6590)),d=r(8214);function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(p=function(e){return e?r:t})(e)}function f(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=p(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}var h=200;t.AUTOCOMPLETE_LIMIT=h;var m=/\$\(subject\)/g;t.wikidataClasses={Corporation:"http://www.wikidata.org/entity/Q6881511",EducationalOrganization:"http://www.wikidata.org/entity/Q178706",GovernmentOrganization:"http://www.wikidata.org/entity/Q327333",MedicalOrganization:"http://www.wikidata.org/entity/Q4287745",MusicGroup:"http://www.wikidata.org/entity/Q32178211",NGO:"http://www.wikidata.org/entity/Q163740",Occupation:"http://www.wikidata.org/entity/Q28640",Project:"http://www.wikidata.org/entity/Q170584",ResearchOrganization:"http://www.wikidata.org/entity/Q31855",SportsOrganization:"http://www.wikidata.org/entity/Q4438121"};var g='prefix vcard: <http://www.w3.org/2006/vcard/ns#>\nCONSTRUCT\n{ wd:Q49108 vcard:fn ?itemLabel.\nwd:Q49108 rdf:type ?klass. ?klass rdfs:label ?klassLabel; rdfs:comment ?klassDescription .\nwd:Q49108 schema:logo ?logo;\n schema:image ?image;\n schema:logo ?sealImage;\n schema:subOrganization ?subsidiary .\n ?subsidiary rdfs:label ?subsidiaryLabel .\n ?supersidiary schema:subOrganization wd:Q49108 .\n ?supersidiary rdfs:label ?supersidiaryLabel .\n wd:Q49108 schema:location ?location .\n ?location schema:elevation ?elevation .\n ?location wdt:P131 ?region . ?region rdfs:label ?regionLabel .\n ?location wdt:P625 ?coordinates .\n ?location schema:country ?country . ?country rdfs:label ?countryLabel .\n}\nWHERE\n{ optional {wd:Q49108 rdfs:label ?itemLabel} .\n optional {wd:Q49108 wdt:P154 ?logo .}\n optional {wd:Q49108 wdt:P31 ?klass .}\n optional {wd:Q49108 wdt:P158 ?sealImage .}\n optional {wd:Q49108 wdt:P18 ?image .}\n\n optional { wd:Q49108 wdt:P355 ?subsidiary . }\n optional { ?supersidiary wdt:P355 wd:Q49108. }\n\n optional { wd:Q49108 wdt:P276 ?location .\n\n optional { ?location schema:eleveation ?elevation }\n optional { ?location wdt:P131 ?region }\n optional { ?location wdt:P625 ?coordinates }\n optional { ?location wdt:P17 ?country }\n }\n SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en,de,it". }\n}';t.instituteDetailsWikidataQuery=g;var v={credentials:"omit",headers:new Headers({Accept:"application/json"})};t.fetcherOptionsJsonPublicData=v;var y={label:"ESCO",logo:c.store.sym("https://ec.europa.eu/esco/portal/static_resource2/images/logo/logo_en.gif"),searchByNameURI:"https://ec.europa.eu/esco/api/search?language=$(language)&type=occupation&text=$(name)"};t.escoParameters=y;var b={label:"DBPedia",logo:c.store.sym("https://upload.wikimedia.org/wikipedia/commons/thumb/7/73/DBpediaLogo.svg/263px-DBpediaLogo.svg.png"),searchByNameQuery:'select distinct ?subject, ?name where {\n ?subject a $(targetClass); rdfs:label ?name\n FILTER regex(?name, "$(name)", "i")\n } LIMIT $(limit)',endpoint:"https://dbpedia.org/sparql/"};t.dbpediaParameters=b,t.dbPediaTypeMap={AcademicInsitution:"http://umbel.org/umbel/rc/EducationalOrganization"},t.wikidataOutgoingClassMap={AcademicInsitution:"http://www.wikidata.org/entity/Q4671277",Enterprise:"http://www.wikidata.org/entity/Q6881511",Business:"http://www.wikidata.org/entity/Q4830453",NGO:"http://www.wikidata.org/entity/Q79913",CharitableOrganization:"http://www.wikidata.org/entity/Q708676",Insitute:"http://www.wikidata.org/entity/Q1664720"};var w={label:"WikiData",limit:3e3,logo:c.store.sym("https://www.wikimedia.org/static/images/project-logos/wikidatawiki.png"),endpoint:"https://query.wikidata.org/sparql",searchByNameQuery:'SELECT ?subject ?name\n WHERE {\n ?klass wdt:P279* $(targetClass) .\n ?subject wdt:P31 ?klass .\n ?subject rdfs:label ?name.\n FILTER regex(?name, "$(name)", "i")\n } LIMIT $(limit) ',insitituteDetailsQuery:'CONSTRUCT\n{ wd:Q49108 schema:name ?itemLabel;\n schema:logo ?logo;\n schema:logo ?sealImage;\n schema:subOrganization ?subsidiary .\n ?subsidiary schema:name ?subsidiaryLabel .\n}\nWHERE\n{\n wd:Q49108 # rdfs:label ?itemLabel ;\n wdt:P154 ?logo;\n wdt:P158 ?sealImage ;\n wdt:P355 ?subsidiary .\n # ?subsidiary rdfs:label ?subsidiaryLabel .\n\n SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], fr". }\n}'};t.wikidataParameters=w;var x={"http://www.wikidata.org/entity/Q15936437":l.schema("CollegeOrUniversity"),"http://www.wikidata.org/entity/Q1664720":l.schema("EducationalOrganization"),"http://www.wikidata.org/entity/Q43229":l.schema("Organization"),"http://www.wikidata.org/entity/Q3918":l.schema("CollegeOrUniversity"),"http://www.wikidata.org/entity/Q170584":l.schema("Project"),"http://www.wikidata.org/entity/Q327333":l.schema("GovernmentOrganization"),"http://www.wikidata.org/entity/Q2221906":l.schema("Place"),"http://www.wikidata.org/entity/Q167037":l.schema("Corporation")};t.wikidataIncomingClassMap=x;var _={targetClass:l.rdf("type"),sealImage:l.schema("logo"),shortName:l.foaf("nick"),subsidiary:l.schema("subOrganization"),city:l.vcard("locality"),state:l.vcard("region"),country:l.vcard("country-name"),homepage:l.foaf("homepage"),lat:l.schema("latitude"),long:l.schema("longitude")};function E(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:_,o={};u.log("loadFromBindings: subject: ".concat(t)),u.log(" doc: ".concat(n)),r.forEach((function(e){for(var t in e){var r=e[t],n=JSON.stringify(r);o[t]=o[t]||new Set,o[t].add(n)}}));var a=function(r){var a=o[r];u.log(" results ".concat(r," -> ").concat(a)),a.forEach((function(o){var a,c=JSON.parse(o),d=c.type,p=c.value;if("uri"===d)a=e.sym(p);else{if("literal"!==d)throw new Error("loadFromBindings: unexpected type: ".concat(d));a=new s.Literal(p,c.language,c.datatype)}if("type"===r)x[p]?a=x[p]:u.warn("Unmapped Wikidata Class: "+p);else if("coordinates"===r){u.log(" @@@ hey a point: "+p);var f=/.*\(([-0-9.-]*) ([-0-9.-]*)\)/.exec(p);if(f){var h=l.xsd("float"),m=new s.Literal(f[1],null,h),g=new s.Literal(f[2],null,h);e.add(t,l.schema("longitude"),g,n),e.add(t,l.schema("latitude"),m,n)}else u.log("Bad coordinates syntax: "+p)}else{var v=i[r]||l.schema(r);e.add(t,v,a,n),u.log(" public data ".concat(v," ").concat(a,"."))}}))};for(var c in o)a(c)}function k(e){return e._embedded.results.map((function(e){return{name:{value:e.title,type:"literal"},subject:{type:"IRI",value:e.uri}}}))}function S(){return(S=(0,a.default)(o.default.mark((function e(t,r,n){var i,a,s,l,d,p;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.searchByNameURI){e.next=2;break}throw new Error("Missing queryTarget.searchByNameURI on queryESCODataByName");case 2:return a=n.limit||h,s=n.searchByNameURI.replace("$(name)",t).replace("$(limit)",""+a).replace("$(targetClass)",r.toNT()),u.log("Querying ESCO data - uri: "+s),e.next=7,null===(i=c.store.fetcher)||void 0===i?void 0:i.webOperation("GET",s,v);case 7:if(l=e.sent,d=(null==l?void 0:l.responseText)||"",u.log(" Query result text"+d.slice(0,500)+"..."),0!==d.length){e.next=12;break}throw new Error("Wot no text back from ESCO query "+s);case 12:return p=JSON.parse(d),u.log(" ESCO Query result JSON"+JSON.stringify(p,null,4).slice(0,500)+"..."),e.abrupt("return",k(p));case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function A(e){var t=e.indexOf("SPARQL-QUERY");if(t<0)return e;u.warn(" ### Fixing JSON with wikidata error code injection "+e.slice(t,t+200));var r=e.lastIndexOf("}, {");return e.slice(0,r)+" } ] } } "}function C(){return(C=(0,a.default)(o.default.mark((function e(t,r,n,i){var a,s,l,p,f,m,g,y,b,w,x;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=function(e){var n=i.limit||h;return e.replace("$(name)",t).replace("$(limit)",""+n).replace("$(language)",l).replace("$(targetClass)",r.toNT())},r){e.next=3;break}throw new Error("queryPublicDataByName: No class provided");case 3:return e.next=5,(0,d.getPreferredLanguages)();case 5:if(e.t0=e.sent,e.t0){e.next=8;break}e.t0=d.defaultPreferredLanguages;case 8:if(s=e.t0,l=s[0]||"en",!i.searchByNameQuery){e.next=16;break}return p=a(i.searchByNameQuery),u.log("Querying public data - sparql: "+p),e.abrupt("return",T(p,i));case 16:if(!i.searchByNameURI){e.next=46;break}return f=a(i.searchByNameURI),e.prev=18,e.next=21,null===(g=c.store.fetcher)||void 0===g?void 0:g.webOperation("GET",f,v);case 21:m=e.sent,e.next=27;break;case 24:throw e.prev=24,e.t1=e.catch(18),new Error("Exception when trying to fetch ".concat(f," \n ").concat(e.t1));case 27:if(y=m.responseText||"",200===m.status){e.next=30;break}throw new Error("HTTP error status ".concat(m.status," trying to fetch ").concat(f," "));case 30:if(u.log(" Query result text"+y.slice(0,500)+"..."),0!==y.length){e.next=33;break}throw new Error("queryPublicDataByName: No text back from public data query "+f);case 33:if(b=A(y),w=JSON.parse(b),u.log(" API Query result JSON"+JSON.stringify(w,null,4).slice(0,500)+"..."),!w._embedded){e.next=42;break}return u.log(" Looks like ESCO"),x=k(w),e.abrupt("return",x);case 42:throw alert("Code me: unrecognized API return format"),new Error("*** Need to add code to parse unrecognized API JSON return\n".concat(JSON.stringify(w,null,4)));case 44:e.next=47;break;case 46:throw new Error("Query source must have either rest API or SPARQL endpoint.");case 47:case"end":return e.stop()}}),e,null,[[18,24]])})))).apply(this,arguments)}function T(e,t){return O.apply(this,arguments)}function O(){return(O=(0,a.default)(o.default.mark((function e(t,r){var n,i,a,s,l,d,p,f,h,m;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.endpoint){e.next=2;break}throw new Error("Missing queryTarget.endpoint required for queryPublicDataSelect");case 2:return(i=new URL(r.endpoint)).searchParams.append("query",t),a=i.href,u.log(" queryPublicDataSelect uri: "+a),(s=new Headers).append("Accept","application/json"),l={credentials:"omit",headers:s},e.next=11,null===(n=c.store.fetcher)||void 0===n?void 0:n.webOperation("GET",a,l);case 11:if(d=e.sent,0!==(p=(null==d?void 0:d.responseText)||"").length){e.next=15;break}throw new Error("No text back from query "+a);case 15:return f=A(p),h=JSON.parse(f),u.log(" Query result JSON"+JSON.stringify(h,null,4).slice(0,100)+"..."),m=h.results.bindings,e.abrupt("return",m);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function P(e,t,r){return F.apply(this,arguments)}function F(){return(F=(0,a.default)(o.default.mark((function e(t,r,n){var i,a,l,d,p,f,h,m;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u.log("queryPublicDataConstruct: sparql:",t),n.endpoint){e.next=3;break}throw new Error("Missing queryTarget.endpoint required for queryPublicDataConstruct");case 3:return(a=new URL(n.endpoint)).searchParams.append("query",t),l=a.href,u.log(" queryPublicDataConstruct uri: "+l),(d=new Headers).append("Accept","text/turtle"),p={credentials:"omit",headers:d},e.next=12,null===(i=c.store.fetcher)||void 0===i?void 0:i.webOperation("GET",l,p);case 12:if(f=e.sent,h=(null==f?void 0:f.responseText)||"No response text?",m=h.length>500?h.slice(0,200)+" ... "+h.slice(-200):h,u.log(" queryPublicDataConstruct result text:"+m),0!==h.length){e.next=18;break}throw new Error("queryPublicDataConstruct: No text back from construct query:"+l);case 18:(0,s.parse)(h,c.store,r.uri,"text/turtle");case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function I(){return(I=(0,a.default)(o.default.mark((function e(t,r,n){var i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.uri.startsWith("https://dbpedia.org/resource/")){e.next=4;break}return e.abrupt("return",D(t,r,n));case 4:if(!n.uri.match(/^https?:\/\/www\.wikidata\.org\/entity\/.*/)){e.next=9;break}return e.next=7,N(t,r,n);case 7:e.next=13;break;case 9:return i=n.uri.startsWith("http:")?t.sym("https:"+n.uri.slice(5)):n,(a=new Headers).append("Accept","text/turtle"),e.abrupt("return",t.fetcher.load(i,{credentials:"omit",headers:a}));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function N(e,t,r){return j.apply(this,arguments)}function j(){return(j=(0,a.default)(o.default.mark((function e(t,r,n){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=g.replace(/wd:Q49108/g,n.toNT()),e.next=4,P(i,n,w);case 4:u.log("getWikidataDetails: loaded.",n);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function R(){return(R=(0,a.default)(o.default.mark((function e(t,r,n){var i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i='select distinct * where {\n optional { $(subject) wdt:P31 ?targetClass } # instance of\n optional { $(subject) wdt:P154 ?logo }\n optional { $(subject) wdt:P158 ?sealImage }\n# optional { $(subject) wdt:P159 ?headquartersLocation }\n\noptional { $(subject) wdt:P17 ?country }\noptional { $(subject) wdt:P18 ?image }\noptional { $(subject) wdt:P1813 ?shortName }\n\noptional { $(subject) wdt:P355 ?subsidiary }\n# SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en,de,it" }\n}'.replace(m,n.toNT()),e.next=3,T(i,w);case 3:a=e.sent,E(t,n,a,n.doc());case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function L(){return(L=(0,a.default)(o.default.mark((function e(t,r,n){var i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i='select distinct * where {\n\n $(subject) wdt:P276 ?location .\n\n optional { ?location wdt:P2044 ?elevation }\n optional { ?location wdt:P131 ?region }\n optional { ?location wdt:P625 ?coordinates }\noptional { ?location wdt:P17 ?country }\n\n# SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en,de,it" }\n}'.replace(m,n.toNT()),u.log(" location query sparql:"+i),e.next=4,T(i,w);case 4:a=e.sent,u.log(" location query bindings:",a),E(t,n,a,n.doc());case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function D(e,t,r){return M.apply(this,arguments)}function M(){return(M=(0,a.default)(o.default.mark((function e(t,r,n){var i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i="select distinct ?city, ?state, ?country, ?homepage, ?logo, ?lat, ?long, WHERE {\n OPTIONAL { <".concat(n,"> <http://dbpedia.org/ontology/city> ?city }\n OPTIONAL { ").concat(n," <http://dbpedia.org/ontology/state> ?state }\n OPTIONAL { ").concat(n," <http://dbpedia.org/ontology/country> ?country }\n OPTIONAL { ").concat(n," foaf:homepage ?homepage }\n OPTIONAL { ").concat(n," foaf:lat ?lat; foaf:long ?long }\n OPTIONAL { ").concat(n," <http://dbpedia.org/ontology/country> ?country }\n }"),e.next=3,T(i,b);case 3:a=e.sent,E(t,n,a,n.doc()),u.log("Finished getDbpediaDetails.");case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.variableNameToPredicateMap=_},4322:(e,t,r)=>{"use strict";var n=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.basicField=function(e,t,r,n,o,c,p){var m=f,v=o.doc?o.doc():null,y=e.createElement("div"),b=m.any(o,a.ui("property"));if(t&&t.appendChild(y),!b)return y.appendChild((0,u.errorMessageBlock)(e,"Error: No property given for text field: "+o));var w=h(e,m,y,o),x=m.anyJS(o,a.ui("suppressEmptyUneditable"),null,v),_=(0,l.mostSpecificClassURI)(o),E=d.fieldParams[_];void 0===E&&(E={style:""});var k=E.style||"",S=s.textInputStyle+k,A=e.createElement("input");A.style=S,w.appendChild(A),A.setAttribute("type",E.type?E.type:"text");var C=m.anyJS(o,a.ui("size"))||s.textInputSize||20;A.setAttribute("size",C);var T=m.any(o,a.ui("maxLength"));A.setAttribute("maxLength",T?""+T:"4096"),c=c||g(n,b,c);var O=m.any(n,b,void 0,c);if(O||(O=m.any(o,a.ui("default"))),O&&O.value&&E.uriPrefix?A.value=decodeURIComponent(O.value.replace(E.uriPrefix,"")).replace(/ /g,""):O&&(A.value=O.value||O.value||""),A.setAttribute("style",S),!m.updater)throw new Error("kb has no updater");return m.updater.editable(c.uri)?(A.addEventListener("keyup",(function(e){E.pattern&&A.setAttribute("style",S+(A.value.match(E.pattern)?"color: green;":"color: red;"))}),!0),A.addEventListener("change",(function(t){if(!E.pattern||A.value.match(E.pattern)){A.disabled=!0,A.setAttribute("style",S+"color: gray;");var r,o=m.statementsMatching(n,b);E.namedNode?r=m.sym(A.value):E.uriPrefix?(r=encodeURIComponent(A.value.replace(/ /g,"")),r=m.sym(E.uriPrefix+A.value)):r=E.dt?new i.Literal(A.value.trim(),void 0,a.xsd(E.dt)):new i.Literal(A.value);var s=o.map((function(e){return(0,i.st)(e.subject,e.predicate,r,e.why)}));0===s.length&&(s=[(0,i.st)(n,b,r,c)]),function e(t,r,n){var i=[];if(r.forEach((function(e){i.includes(e.why.uri)||i.push(e.why.uri)})),t.forEach((function(e){i.includes(e.why.uri)||i.push(e.why.uri)})),0===i.length)throw new Error("updateMany has no docs to patch");if(!m.updater)throw new Error("kb has no updater");if(1===i.length)return m.updater.update(t,r,n);var o=i.pop(),a=r.filter((function(e){return e.why.uri===o})),s=r.filter((function(e){return e.why.uri!==o})),c=t.filter((function(e){return e.why.uri===o})),u=t.filter((function(e){return e.why.uri!==o}));m.updater.update(c,a,(function(t,r,i){r?e(u,s,n):n(t,r,i)}))}(o,s,(function(t,r,n){r?(A.disabled=!1,A.setAttribute("style",S)):y.appendChild((0,u.errorMessageBlock)(e,n)),p(r,n)}))}}),!0),y):(A.readOnly=!0,A.style=s.textInputStyleUneditable+k,x&&""===A.value&&(y.style.display="none"),y)},t.fieldLabel=m,t.fieldStore=g,t.renderNameValuePair=h;var i=r(6022),o=r(166),a=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=p(t);if(r&&r.has(e))return r.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}(r(6590)),s=r(2853),c=r(5666),u=r(9449),l=r(4816),d=r(4246);function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(p=function(e){return e?r:t})(e)}var f=o.solidLogicSingleton.store;function h(e,t,r,n,i){r.style.display="flex",r.style.flexDirection="row";var o=r.appendChild(e.createElement("div"));o.style.width=s.formFieldNameBoxWidth;var c=r.appendChild(e.createElement("div"));return o.setAttribute("class","formFieldName"),o.setAttribute("style",s.formFieldNameBoxStyle),c.setAttribute("class","formFieldValue"),i?o.appendChild(e.createTextNode(i)):t.any(n,a.ui("property"))?o.appendChild(m(e,t.any(n,a.ui("property")),n)):(c.appendChild((0,u.errorMessageBlock)(e,"No property or label given for form field: "+n)),o.appendChild(e.createTextNode("???"))),c}function m(e,t,r){var n=f.any(r,a.ui("label"));if(n||(n=(0,c.label)(t,!0)),void 0===t)return e.createTextNode("@@Internal error: undefined property");var i=e.createElement("a");return t.uri&&i.setAttribute("href",t.uri),i.setAttribute("style","color: #3B5998; text-decoration: none;"),i.textContent=n,i}function g(e,t,r){var n=f.statementsMatching(e,t);if(0===n.length)return r;if(!f.updater)throw new Error("Store has no updater");return n.length>0&&n[0].why.value&&f.updater.editable(n[0].why.value,f)?f.sym(n[0].why.value):r}},4816:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.field=void 0,t.fieldFunction=function(e,t){var r=c(t),n=s[r];return(0,i.debug)("paneUtils: Going to implement field "+t+" of type "+r),n||function(e,n){var i=(0,o.errorMessageBlock)(e,"No handler for field "+t+" of type "+r);return n&&n.appendChild(i),i}},t.mostSpecificClassURI=c;var n=r(166),i=r(8853),o=r(9449),a=n.solidLogicSingleton.store,s={};function c(e){var t=a,r=t.findTypeURIs(e),n=t.bottomTypeURIs(r),i=[];for(var o in n)i.push(o);return i[0]}t.field=s},4246:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.fieldParams=void 0;var o,a=n(r(8416)),s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}(r(6590)),c=r(2853);function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}var l=(o={},(0,a.default)(o,s.ui("ColorField").uri,{size:9,type:"color",style:"height: 3em;",dt:"color",pattern:/^\s*#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]([0-9a-f][0-9a-f])?\s*$/}),(0,a.default)(o,s.ui("DateField").uri,{size:20,type:"date",dt:"date",pattern:/^\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?Z?\s*$/}),(0,a.default)(o,s.ui("DateTimeField").uri,{size:20,type:"datetime-local",dt:"dateTime",pattern:/^\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?(T[0-2][0-9]:[0-5][0-9](:[0-5][0-9])?)?Z?\s*$/}),(0,a.default)(o,s.ui("TimeField").uri,{size:10,type:"time",dt:"time",pattern:/^\s*([0-2]?[0-9]:[0-5][0-9](:[0-5][0-9])?)\s*$/}),(0,a.default)(o,s.ui("IntegerField").uri,{size:12,style:"text-align: right;",dt:"integer",pattern:/^\s*-?[0-9]+\s*$/}),(0,a.default)(o,s.ui("DecimalField").uri,{size:12,style:"text-align: right;",dt:"decimal",pattern:/^\s*-?[0-9]*(\.[0-9]*)?\s*$/}),(0,a.default)(o,s.ui("FloatField").uri,{size:12,style:"text-align: right;",dt:"float",pattern:/^\s*-?[0-9]*(\.[0-9]*)?((e|E)-?[0-9]*)?\s*$/}),(0,a.default)(o,s.ui("SingleLineTextField").uri,{}),(0,a.default)(o,s.ui("NamedNodeURIField").uri,{namedNode:!0}),(0,a.default)(o,s.ui("TextField").uri,{}),(0,a.default)(o,s.ui("PhoneField").uri,{size:20,uriPrefix:"tel:",pattern:/^\+?[\d-]+[\d]*$/}),(0,a.default)(o,s.ui("EmailField").uri,{size:30,uriPrefix:"mailto:",pattern:/^\s*.*@.*\..*\s*$/}),(0,a.default)(o,s.ui("Group").uri,{style:c.formGroupStyle}),(0,a.default)(o,s.ui("Comment").uri,{element:"p",style:c.commentStyle}),(0,a.default)(o,s.ui("Heading").uri,{element:"h3",style:c.formHeadingStyle}),o);t.fieldParams=l},9742:(e,t,r)=>{"use strict";var n=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.setFieldStyle=function(e,t){var r=(0,s.mostSpecificClassURI)(t),n=a.fieldParams[r]||{},c=o.store.any(t,i.ui("style"));c?"Literal"===c.termType?c&&e.setAttribute("style",c.value):o.store.statementsMatching(c,null,null,t.doc()).forEach((function(t){if(t.predicate.uri&&t.predicate.uri.startsWith(u)){var r=t.predicate.uri.slice(u.length);try{e.style[r]=t.object.value}catch(n){console.warn("setFieldStyle: Error setting element style ".concat(r,' to "').concat(t.object.value,'"')),console.warn('setFieldStyle: ... Element tagName was "'.concat(e.tagName||"???",'"'))}}})):n.style&&e.setAttribute("style",n.style)};var i=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=c(t);if(r&&r.has(e))return r.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}(r(6590)),o=r(166),a=r(4246),s=r(4816);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(c=function(e){return e?r:t})(e)}var u="https://www.w3.org/ns/css#"},2457:(e,t,r)=>{"use strict";var n=r(8698);Object.defineProperty(t,"__esModule",{value:!0});var i={publicData:!0};t.publicData=void 0;var o=r(6472);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}));var a=r(3983);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))}));var s=r(6186);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===s[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}}))}));var c=r(1552);Object.keys(c).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===c[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return c[e]}}))}));var u=r(9449);Object.keys(u).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===u[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return u[e]}}))}));var l=r(6206);Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===l[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}}))}));var d=r(611);Object.keys(d).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===d[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return d[e]}}))}));var p=r(6674);Object.keys(p).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===p[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return p[e]}}))}));var f=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=h(t);if(r&&r.has(e))return r.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}(r(5454));function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(h=function(e){return e?r:t})(e)}t.publicData=f},1989:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.IconicMultiSelect=void 0;var o=n(r(861)),a=n(r(6690)),s=n(r(9728)),c=n(r(8416)),u=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}(r(4946));function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(l=function(e){return e?r:t})(e)}var d=function(){function e(t){var r=t.data,n=t.itemTemplate,i=t.noData,o=t.noResults,s=t.placeholder,u=t.select,l=t.container,d=t.tagTemplate,p=t.textField,f=t.valueField;(0,a.default)(this,e),(0,c.default)(this,"_data",void 0),(0,c.default)(this,"_domElements",void 0),(0,c.default)(this,"_event",(function(){})),(0,c.default)(this,"_itemTemplate",void 0),(0,c.default)(this,"_multiselect",void 0),(0,c.default)(this,"_noData",void 0),(0,c.default)(this,"_noResults",void 0),(0,c.default)(this,"_options",[]),(0,c.default)(this,"_placeholder",void 0),(0,c.default)(this,"_select",void 0),(0,c.default)(this,"_selectContainer",void 0),(0,c.default)(this,"_selectedOptions",[]),(0,c.default)(this,"_tagTemplate",void 0),(0,c.default)(this,"_textField",void 0),(0,c.default)(this,"_valueField",void 0),(0,c.default)(this,"_cross",'\n <svg\n width="24"\n height="24"\n viewBox="0 0 24 24"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M6.2253 4.81108C5.83477 4.42056 5.20161 4.42056 4.81108 4.81108C4.42056 5.20161 4.42056 5.83477 4.81108 6.2253L10.5858 12L4.81114 17.7747C4.42062 18.1652 4.42062 18.7984 4.81114 19.1889C5.20167 19.5794 5.83483 19.5794 6.22535 19.1889L12 13.4142L17.7747 19.1889C18.1652 19.5794 18.7984 19.5794 19.1889 19.1889C19.5794 18.7984 19.5794 18.1652 19.1889 17.7747L13.4142 12L19.189 6.2253C19.5795 5.83477 19.5795 5.20161 19.189 4.81108C18.7985 4.42056 18.1653 4.42056 17.7748 4.81108L12 10.5858L6.2253 4.81108Z"\n fill="currentColor"\n />\n </svg>\n '),this._data=null!=r?r:[],this._itemTemplate=null!=n?n:null,this._noData=null!=i?i:"No data found.",this._noResults=null!=o?o:"No results found.",this._placeholder=null!=s?s:"Select...",this._select=u,this._selectContainer=l,this._tagTemplate=null!=d?d:null,this._textField=null!=p?p:null,this._valueField=null!=f?f:null}return(0,s.default)(e,[{key:"init",value:function(){if(!this._select||"SELECT"!==this._select.nodeName)throw new Error("The selector '".concat(this._select,"' did not select any valid select tag."));if(this._itemTemplate&&0===this._data.length)throw new Error("itemTemplate must be initialized with data from the component settings");if(this._tagTemplate&&0===this._data.length)throw new Error("tagTemplate must be initialized with data from the component settings");this._options=this._data.length>0?this._getDataFromSettings():this._getDataFromSelectTag(),this._renderMultiselect(),this._renderOptionsList(),this._domElements={clear:this._multiselect.querySelector(".multiselect__clear-btn"),input:this._multiselect.querySelector(".multiselect__input"),optionsContainer:this._multiselect.querySelector(".multiselect__options"),optionsContainerList:this._multiselect.querySelector(".multiselect__options > ul"),options:{list:this._multiselect.querySelectorAll(".multiselect__options > ul > li"),find:function(e){for(var t=0;t<this.list.length;t++){var r=this.list[t];if(e(r))return r}},some:function(e){for(var t=0;t<this.list.length;t++)if(e(this.list[t],t))return!0;return!1}}},this._enableEventListenners(),this._initSelectedList()}},{key:"subscribe",value:function(e){if("function"!=typeof e)throw new Error("parameter in the subscribe method is not a function");this._event=e}},{key:"_addOptionToList",value:function(e,t){var r=this,n='<span class="multiselect__selected" style="'.concat(u.multiselect__selected,'" data-value="').concat(e.value,'">').concat(this._tagTemplate?this._processTemplate(this._tagTemplate,t):e.text,'<span class="multiselect__remove-btn" style="').concat(u.multiselect__remove_btn,'">').concat(this._cross,"</span></span>");this._domElements.input.insertAdjacentHTML("beforebegin",n),this._multiselect.querySelector('span[data-value="'.concat(e.value,'"]')).lastElementChild.addEventListener("click",(function(){var t=r._domElements.options.find((function(t){return t.dataset.value===e.value}));r._handleOption(t)}))}},{key:"_clearSelection",value:function(){for(var e=this,t=function(){var t=e._selectedOptions[r],n=e._domElements.options.find((function(e){return e.dataset.value===t.value}));n.classList.remove("multiselect__options--selected"),n.setAttribute("style",u.multiselect__options),e._removeOptionFromList(n.dataset.value)},r=0;r<this._selectedOptions.length;r++)t();this._selectedOptions=[],this._handleClearSelectionBtn(),this._handlePlaceholder(),this._dispatchEvent({action:"CLEAR_ALL_OPTIONS",selection:this._selectedOptions})}},{key:"_closeList",value:function(){this._domElements.input.value="",this._domElements.optionsContainer.classList.remove("visible"),this._domElements.optionsContainer.setAttribute("style",u.multiselect__options),this._filterOptions(""),this._removeAllArrowSelected()}},{key:"_dispatchEvent",value:function(e){this._event(e)}},{key:"_enableEventListenners",value:function(){var e=this;document.addEventListener("mouseup",(function(t){var r=t.target;e._multiselect.contains(r)||(e._filterOptions(""),e._closeList(),e._handlePlaceholder())})),this._domElements.clear.addEventListener("click",(function(){e._clearSelection()}));for(var t=0;t<this._domElements.options.list.length;t++)this._domElements.options.list[t].addEventListener("click",(function(t){var r=t.target;e._handleOption(r),e._closeList()}));this._domElements.input.addEventListener("focus",(function(){e._domElements.optionsContainer.classList.add("visible"),e._domElements.optionsContainer.setAttribute("style",u.multiselect__options_visible)})),this._domElements.input.addEventListener("input",(function(t){var r=t.target.value;e._domElements.options.list.length>0&&e._filterOptions(r)})),this._domElements.input.addEventListener("keydown",(function(t){e._handleArrows(t),e._handleBackspace(t),e._handleEnter(t)}))}},{key:"_filterOptions",value:function(e){var t=this,r=this._domElements.optionsContainer.classList.contains("visible"),n=e.toLowerCase();if(!r&&e.length>0&&(this._domElements.optionsContainer.classList.add("visible"),this._domElements.optionsContainer.setAttribute("style",u.multiselect__options_visible)),this._domElements.options.list.length>0){for(var i=0;i<this._domElements.options.list.length;i++){var o=this._domElements.options.list[i];(this._itemTemplate?this._data[i][this._textField]:o.textContent).toLowerCase().substring(0,n.length)===n?this._domElements.optionsContainerList.appendChild(o):o.parentNode&&o.parentNode.removeChild(o)}var a=this._domElements.options.some((function(e,r){return(t._itemTemplate?t._data[r][t._textField]:e.textContent).toLowerCase().substring(0,n.length)===n}));this._showNoResults(!a)}}},{key:"_generateId",value:function(e){for(var t="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=r.length,i=0;i<e;i++)t+=r.charAt(Math.floor(Math.random()*n));return t}},{key:"_getDataFromSelectTag",value:function(){for(var e=[],t=this._select.options,r=0;r<t.length;r++){var n=t[r];e.push({text:n.text,value:n.value,selected:n.hasAttribute("selected")})}return e}},{key:"_getDataFromSettings",value:function(){if(this._data.length>0&&this._valueField&&this._textField){var e="string"==typeof this._valueField,t="string"==typeof this._textField,r=[];if(!e||!t)throw new Error("textField and valueField must be of type string");for(var n=0;n<this._data.length;n++){var i=this._data[n];r.push({value:i[this._valueField],text:i[this._textField],selected:"boolean"==typeof i.selected&&i.selected})}return r}return null}},{key:"_handleArrows",value:function(e){if(40===e.keyCode||38===e.keyCode){e.preventDefault();var t=this._domElements.optionsContainer.classList.contains("visible"),r=this._multiselect.querySelector(".multiselect__options > ul");if(t){var n=this._multiselect.querySelector(".multiselect__options ul li.arrow-selected"),i={ArrowUp:"previous",Up:"previous",ArrowDown:"next",Down:"next"};if(!n)return r.firstElementChild.classList.add("arrow-selected"),r.firstElementChild.setAttribute("style",u.multiselect__options_ul_li_arrow_selected),void r.firstElementChild.scrollIntoView(!1);if(n.classList.remove("arrow-selected"),n.setAttribute("style",u.multiselect__options_ul_li),!(n=n[i[e.key]+"ElementSibling"]))return(n=r.children["next"===i[e.key]?0:r.children.length-1]).classList.add("arrow-selected"),n.setAttribute("style",u.multiselect__options_ul_li_arrow_selected),void this._scrollIntoView(r,n);n.classList.add("arrow-selected"),n.setAttribute("style",u.multiselect__options_ul_li_arrow_selected),this._scrollIntoView(r,n)}else this._domElements.optionsContainer.classList.add("visible"),this._domElements.optionsContainer.setAttribute("style",u.multiselect__options_visible),r.firstElementChild.classList.add("arrow-selected"),r.firstElementChild.setAttribute("style",u.multiselect__options_ul_li_arrow_selected),r.firstElementChild.scrollIntoView(!1)}}},{key:"_handleBackspace",value:function(e){if(8===e.keyCode&&""===e.target.value){var t=this._selectedOptions.length>0?this._selectedOptions[this._selectedOptions.length-1]:null;if(t){var r=this._multiselect.querySelector('li[data-value="'.concat(t.value,'"]'));this._handleOption(r),0===this._selectedOptions.length&&(this._domElements.optionsContainer.classList.remove("visible"),this._domElements.optionsContainer.setAttribute("style",u.multiselect__options))}}}},{key:"_handleClearSelectionBtn",value:function(){this._selectedOptions.length>0?this._domElements.clear.style.display="flex":this._domElements.clear.style.display="none"}},{key:"_handleEnter",value:function(e){if(13===e.keyCode){var t=this._multiselect.querySelector(".multiselect__options ul li.arrow-selected");t&&(this._handleOption(t),this._closeList())}}},{key:"_handleOption",value:function(e){for(var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=0;r<this._selectedOptions.length;r++){var n=this._selectedOptions[r];if(n.value===e.dataset.value)return e.classList.remove("multiselect__options--selected"),e.setAttribute("style",u.multiselect__options),this._selectedOptions.splice(r,1),this._removeOptionFromList(e.dataset.value),this._handleClearSelectionBtn(),this._handlePlaceholder(),t&&this._dispatchEvent({action:"REMOVE_OPTION",value:e.dataset.value,selection:this._selectedOptions})}for(var i=0;i<this._options.length;i++){var a=this._options[i];if(a.value===e.dataset.value)return e.classList.add("multiselect__options--selected"),e.setAttribute("style",u.multiselect__options_selected),this._selectedOptions=[].concat((0,o.default)(this._selectedOptions),[a]),this._addOptionToList(a,i),this._handleClearSelectionBtn(),this._handlePlaceholder(),t&&this._dispatchEvent({action:"ADD_OPTION",value:e.dataset.value,selection:this._selectedOptions})}}},{key:"_handlePlaceholder",value:function(){this._domElements.input.placeholder=this._placeholder}},{key:"_initSelectedList",value:function(){for(var e=this,t=!1,r=function(){var r=e._options[n];if(r.selected){t=!0;var i=e._domElements.options.find((function(e){return e.dataset.value===r.value}));i.classList.add("multiselect__options--selected"),i.setAttribute("style",u.multiselect__options_selected),e._selectedOptions=[].concat((0,o.default)(e._selectedOptions),[r]),e._addOptionToList(r,n)}},n=0;n<this._options.length;n++)r();t&&this._handleClearSelectionBtn(),this._handlePlaceholder()}},{key:"_processTemplate",value:function(e,t){for(var r=e,n=e.match(/\$\{(\w+)\}/g).map((function(e){return e.replace(/\$\{|\}/g,"")})),i=0;i<n.length;i++){var o,a=n[i];r=r.replace("${".concat(a,"}"),null!==(o=this._data[t][a])&&void 0!==o?o:"")}return r}},{key:"_removeAllArrowSelected",value:function(){var e="arrow-selected",t=this._domElements.options.find((function(t){return t.classList.contains(e)}));t&&t.classList.remove(e)&&t.setAttribute("style",u.multiselect__options_ul_li)}},{key:"_removeOptionFromList",value:function(e){var t=this._multiselect.querySelector('span[data-value="'.concat(e,'"]'));t&&t.parentNode&&t.parentNode.removeChild(t)}},{key:"_renderOptionsList",value:function(){var e=this,t='\n <div class="multiselect__options" style="'.concat(u.multiselect__options,'">\n <ul style="').concat(u.multiselect__options_ul,'">\n ').concat(this._options.length>0&&!this._itemTemplate?this._options.map((function(e){return'\n <li data-value="'.concat(e.value,'" style="').concat(u.multiselect__options_ul_li,'">').concat(e.text,"</li>\n ")})).join(""):"","\n\n ").concat(this._options.length>0&&this._itemTemplate?this._options.map((function(t,r){return'\n <li data-value="'.concat(t.value,'" style="').concat(u.multiselect__options_ul_li,'">').concat(e._processTemplate(e._itemTemplate,r),"</li>\n ")})).join(""):"","\n ").concat(this._showNoData(0===this._options.length),"\n </ul>\n </div>\n ");this._multiselect.insertAdjacentHTML("beforeend",t)}},{key:"_renderMultiselect",value:function(){this._select.style.display="none";var e="iconic-"+this._generateId(20);this._multiselect=document.createElement("div"),this._multiselect.setAttribute("id",e),this._multiselect.setAttribute("class","multiselect__container"),this._multiselect.setAttribute("style",u.multiselect__container);var t='\n <div class="multiselect__wrapper" style="'.concat(u.multiselect__wrapper,'">\n <input class="multiselect__input" style="').concat(u.multiselect__input,'" placeholder="').concat(this._placeholder,'" />\n </div>\n <span style="display: none;" class="multiselect__clear-btn" style="').concat(u.multiselect__clear_btn,'">').concat(this._cross,"</span>\n ");this._multiselect.innerHTML=t,this._selectContainer.appendChild(this._multiselect)}},{key:"_scrollIntoView",value:function(e,t){var r=e.getBoundingClientRect(),n=t.getBoundingClientRect();r.top<n.bottom-t.offsetHeight||(e.scrollTop=t.clientHeight+(t.offsetTop-t.offsetHeight)),r.bottom>n.top+t.offsetHeight||(e.scrollTop=t.clientHeight+(t.offsetTop-t.offsetHeight)-(e.offsetHeight-(t.offsetHeight+(t.offsetHeight-t.clientHeight))))}},{key:"_showNoData",value:function(e){return e?'<p class="multiselect__options--no-data" style="'.concat(u.multiselect__options_ul_p_multiselect__options_no_data,'">').concat(this._noData,"</p>"):""}},{key:"_showNoResults",value:function(e){var t=this._multiselect.querySelector(".multiselect__options--no-results");if(e){var r='<p class="multiselect__options--no-results" style="'.concat(u.multiselect__options_ul_p_multiselect__options_no_results,'">').concat(this._noResults,"</p>");!t&&this._domElements.optionsContainerList.insertAdjacentHTML("beforeend",r)}else t&&t.parentNode&&t.parentNode.removeChild(t)}}]),e}();t.IconicMultiSelect=d},6472:(e,t,r)=>{"use strict";var n=r(4836),i=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.Person=t.PeoplePicker=t.GroupPicker=t.GroupBuilder=t.Group=void 0;var o,a=n(r(9400)),s=n(r(6690)),c=n(r(9728)),u=n(r(5573)),l=n(r(1614)),d=y(r(6022)),p=y(r(4433)),f=r(3983),h=r(9449),m=r(1124),g=y(r(6590));function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(v=function(e){return e?r:t})(e)}function y(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=v(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}var b=r(166).solidLogicSingleton.store,w=function(){function e(t,r,n,i){(0,s.default)(this,e),this.options=i||{},this.element=t,this.typeIndex=r,this.groupPickedCb=n,this.selectedgroup=this.options.selectedgroup,this.onSelectGroup=this.onSelectGroup.bind(this)}return(0,c.default)(e,[{key:"render",value:function(){var e=this,t=document.createElement("div");if(t.style.maxWidth="350px",t.style.minHeight="200px",t.style.outline="1px solid black",t.style.display="flex",this.selectedgroup){t.style.flexDirection="column";var r=document.createElement("div");new _(r,this.selectedgroup).render();var n=document.createElement("button");n.textContent=(0,u.default)("Change group"),n.addEventListener("click",(function(t){e.selectedgroup=null,e.render()})),t.appendChild(r),t.appendChild(n)}else this.findAddressBook(this.typeIndex).then((function(r){var n=r.book,i=document.createElement("button");i.textContent=(0,u.default)("Pick an existing group"),i.style.margin="auto",i.addEventListener("click",(function(r){new x(t,n,e.onSelectGroup).render()}));var o=document.createElement("button");o.textContent=(0,u.default)("Create a new group"),o.style.margin="auto",o.addEventListener("click",(function(t){e.createNewGroup(n,e.options.defaultNewGroupName).then((function(t){var r=t.group;new E(e.element,n,r,e.onSelectGroup).render()})).catch((function(t){e.element.appendChild((0,h.errorMessageBlock)(document,(0,u.default)("Error creating a new group. (".concat(t,")"))))}))})),t.appendChild(i),t.appendChild(o),e.element.innerHTML="",e.element.appendChild(t)})).catch((function(t){e.element.appendChild((0,h.errorMessageBlock)(document,(0,u.default)("Could find your groups. (".concat(t,")"))))}));return this.element.innerHTML="",this.element.appendChild(t),this}},{key:"findAddressBook",value:function(e){return new Promise((function(t,r){b.fetcher.nowOrWhenFetched(e,(function(n,i){if(!n)return r(i);var o=b.any(null,g.solid("forClass"),g.vcard("AddressBook"));if(!o)return r(new Error("no address book registered in the solid type index "+e));var a=b.any(o,g.solid("instance"));if(!a)return r(new Error("incomplete address book registration"));b.fetcher.load(a).then((function(e){return t({book:a})})).catch((function(e){return r(new Error("Could not load address book "+e))}))}))}))}},{key:"createNewGroup",value:function(e,t){var r=C(e),n=r.groupIndex,i=r.groupContainer,o=d.sym("".concat(i.uri).concat(l.default.v4().slice(0,8),".ttl#this")),a=t||"Untitled Group",s=[o.doc(),n].map((function(t){var r=d.st(o,g.rdf("type"),g.vcard("Group"),t),i=d.st(o,g.vcard("fn"),a,o.doc(),t),s=d.st(e,g.vcard("includesGroup"),o,t),c=t.equals(n)?[r,i,s]:[r,i];return A(t.uri,{toIns:c}).then((function(){c.forEach((function(e){b.add(e)}))}))}));return Promise.all(s).then((function(){return{group:o}})).catch((function(e){throw p.log("Could not create new group. PATCH failed "+e),new Error("Couldn't create new group. PATCH failed for (".concat(e.xhr?e.xhr.responseURL:""," )"))}))}},{key:"onSelectGroup",value:function(e){this.selectedgroup=e,this.groupPickedCb(e),this.render()}}]),e}();t.PeoplePicker=w;var x=function(){function e(t,r,n){(0,s.default)(this,e),this.element=t,this.book=r,this.onSelectGroup=n}return(0,c.default)(e,[{key:"render",value:function(){var e=this;return this.loadGroups().then((function(t){var r=document.createElement("div");r.style.display="flex",r.style.flexDirection="column",t.forEach((function(t){var n=document.createElement("button");n.addEventListener("click",e.handleClickGroup(t)),new _(n,t).render(),r.appendChild(n)})),e.element.innerHTML="",e.element.appendChild(r)})).catch((function(t){e.element.appendChild((0,h.errorMessageBlock)(document,(0,u.default)("There was an error loading your groups. (".concat(t,")"))))})),this}},{key:"loadGroups",value:function(){var e=this;return new Promise((function(t,r){var n=C(e.book).groupIndex;b.fetcher.nowOrWhenFetched(n,(function(n,i){if(!n)return r(i);var o=b.each(e.book,g.vcard("includesGroup"));return t(o)}))}))}},{key:"handleClickGroup",value:function(e){var t=this;return function(r){t.onSelectGroup(e)}}}]),e}();t.GroupPicker=x;var _=function(){function e(t,r){(0,s.default)(this,e),this.element=t,this.group=r}return(0,c.default)(e,[{key:"render",value:function(){var e=document.createElement("div");return e.textContent=(0,u.default)(S(this.group,g.vcard("fn"),"[".concat(this.group.value,"]"))),this.element.innerHTML="",this.element.appendChild(e),this}}]),e}();t.Group=_;var E=function(){function e(t,r,n,i,o){(0,s.default)(this,e),this.element=t,this.book=r,this.group=n,this.onGroupChanged=function(e,t,r){o&&o(e,t,r)},this.groupChangedCb=o,this.doneBuildingCb=i}return(0,c.default)(e,[{key:"refresh",value:function(){}},{key:"render",value:function(){var e=this,t=document.createElement("div");t.style.maxWidth="350px",t.style.minHeight="200px",t.style.outline="1px solid black",t.style.display="flex",t.style.flexDirection="column",(0,f.makeDropTarget)(t,(function(t){t.forEach((function(t){e.add(t).catch((function(t){e.element.appendChild((0,h.errorMessageBlock)(document,(0,u.default)("Could not add the given WebId. (".concat(t,")"))))}))}))}));var r=document.createElement("input");r.type="text",r.value=S(this.group,g.vcard("fn"),"Untitled Group"),r.addEventListener("change",(function(t){e.setGroupName(t.target.value).catch((function(t){e.element.appendChild((0,h.errorMessageBlock)(document,"Error changing group name. (".concat(t,")")))}))}));var n=document.createElement("label");if(n.textContent=(0,u.default)("Group Name:"),n.appendChild(r),t.appendChild(n),b.any(this.group,g.vcard("hasMember")))b.match(this.group,g.vcard("hasMember")).forEach((function(r){var n=r.object,i=document.createElement("div");new k(i,n,e.handleRemove(n)).render(),t.appendChild(i)}));else{var i=document.createElement("p");i.textContent=(0,u.default)(o||(o=(0,a.default)(["\n To add someone to this group, drag and drop their WebID URL onto the box.\n "]))),t.appendChild(i)}var s=document.createElement("button");return s.textContent=(0,u.default)("Done"),s.addEventListener("click",(function(t){e.doneBuildingCb(e.group)})),t.appendChild(s),this.element.innerHTML="",this.element.appendChild(t),this}},{key:"add",value:function(e){var t=this;return new Promise((function(r,n){b.fetcher.nowOrWhenFetched(e,(function(i,o){if(!i)return t.onGroupChanged(o),n(o);var a=d.namedNode(e),s=b.any(a,g.rdf("type"));return s&&s.equals(g.foaf("Person"))?r(a):n(new Error("Only people supported right now. (tried to add something of type ".concat(s.value,")")))}))})).then((function(e){var r=d.st(t.group,g.vcard("hasMember"),e);return b.holdsStatement(r)?e:A(t.group.doc().uri,{toIns:[r]}).then((function(){r.why=t.group.doc(),b.add(r),t.onGroupChanged(null,"added",e),t.render()}))}))}},{key:"handleRemove",value:function(e){var t=this;return function(r){var n=d.st(t.group,g.vcard("hasMember"),e);return A(t.group.doc().uri,{toDel:[n]}).then((function(){return b.remove(n),t.onGroupChanged(null,"removed",e),t.render(),!0})).catch((function(t){var r=b.any(e,g.foaf("name")),n=r&&r.value?"Could not remove ".concat(r.value,". (").concat(t,")"):"Could not remove ".concat(e.value,". (").concat(t,")");throw new Error(n)}))}}},{key:"setGroupName",value:function(e){var t=this,r=C(this.book).groupIndex,n=[this.group.doc(),r].map((function(r){var n=b.match(t.group,g.vcard("fn"),null,r),i=d.st(t.group,g.vcard("fn"),d.literal(e));return A(r.value,{toDel:n,toIns:[i]}).then((function(e){b.removeStatements(n),i.why=r,b.add(i)}))}));return Promise.all(n)}}]),e}();t.GroupBuilder=E;var k=function(){function e(t,r,n){(0,s.default)(this,e),this.webIdNode=r,this.element=t,this.handleRemove=n}return(0,c.default)(e,[{key:"render",value:function(){var e=this,t=document.createElement("div");t.style.display="flex";var r=S(this.webIdNode,g.foaf("img"),m.iconBase+"noun_15059.svg"),n=document.createElement("img");n.src=(0,u.default)(r),n.width="50",n.height="50",n.style.margin="5px";var i=S(this.webIdNode,g.foaf("name"),"[".concat(this.webIdNode,"]")),o=document.createElement("span");o.innerHTML=(0,u.default)(i),o.style.flexGrow="1",o.style.margin="auto 0";var a=document.createElement("button");return a.textContent="Remove",a.addEventListener("click",(function(t){return e.handleRemove().catch((function(t){e.element.appendChild((0,h.errorMessageBlock)(document,(0,u.default)("".concat(t))))}))})),a.style.margin="5px",t.appendChild(n),t.appendChild(o),t.appendChild(a),this.element.innerHTML="",this.element.appendChild(t),this}}]),e}();function S(e,t,r){var n=b.any(e,t);return n?n.value:r}function A(e,t){var r=t.toDel,n=t.toIns;return new Promise((function(e,t){b.updater.update(r,n,(function(r,n,i){if(!n)return t(new Error("PATCH failed for resource <".concat(r,">: ").concat(i)));e()}))}))}function C(e){return{groupIndex:b.any(e,g.vcard("groupIndex")),groupContainer:b.sym(e.dir().uri+"Group/")}}t.Person=k},398:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wrapDivInATR=t.createImageDiv=t.addClickListenerToElement=void 0;var n=r(2853);t.wrapDivInATR=function(e,t,r){var n=e.createElement("tr");return n.appendChild(e.createElement("td")).appendChild(t),n.subject=r,n},t.addClickListenerToElement=function(e,t){e.addEventListener("click",t)},t.createImageDiv=function(e,t,r){var i=t.appendChild(e.createElement("div"));i.setAttribute("style",n.imageDivStyle),i.appendChild(r),r.setAttribute("draggable","false")}},6913:function(e,t,r){var n,i;void 0===(i="function"==typeof(n=function(){"use strict";function e(t,r,n,i){this.message=t,this.expected=r,this.found=n,this.location=i,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),e.buildMessage=function(e,t){var r={literal:function(e){return'"'+i(e.text)+'"'},class:function(e){var t,r="";for(t=0;t<e.parts.length;t++)r+=e.parts[t]instanceof Array?o(e.parts[t][0])+"-"+o(e.parts[t][1]):o(e.parts[t]);return"["+(e.inverted?"^":"")+r+"]"},any:function(e){return"any character"},end:function(e){return"end of input"},other:function(e){return e.description}};function n(e){return e.charCodeAt(0).toString(16).toUpperCase()}function i(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function o(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}return"Expected "+function(e){var t,n,i,o=new Array(e.length);for(t=0;t<e.length;t++)o[t]=(i=e[t],r[i.type](i));if(o.sort(),o.length>0){for(t=1,n=1;t<o.length;t++)o[t-1]!==o[t]&&(o[n]=o[t],n++);o.length=n}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(e)+" but "+function(e){return e?'"'+i(e)+'"':"end of input"}(t)+" found."},{SyntaxError:e,parse:function(t,n){n=void 0!==n?n:{};var i,o={},a={turtleDoc:Lt},s=Lt,c=".",u=Ft(".",!1),l=Ft("#",!1),d=/^[^\n]/,p=It(["\n"],!0,!1),f=Ft("\n",!1),h=function(e){return e.join("")},m="@prefix",g=Ft("@prefix",!1),v=function(e,t){return cr.addPrefix(""===e?"0":e,t),{}},y="@base",b=Ft("@base",!1),w=function(e){return cr.addBase(e),{}},x=/^[Bb]/,_=It(["B","b"],!1,!1),E=/^[Aa]/,k=It(["A","a"],!1,!1),S=/^[Ss]/,A=It(["S","s"],!1,!1),C=/^[Ee]/,T=It(["E","e"],!1,!1),O=/^[Pp]/,P=It(["P","p"],!1,!1),F=/^[Rr]/,I=It(["R","r"],!1,!1),N=/^[Ff]/,j=It(["F","f"],!1,!1),R=/^[Ii]/,L=It(["I","i"],!1,!1),D=/^[Xx]/,M=It(["X","x"],!1,!1),U=Ft(";",!1),B=function(e,t,r,n){var i={};return i[r]=n,i},H=function(e,t,r){return r},q=Ft(",",!1),K=function(e,t){return t},W=Ft("a",!1),V=Ft("[",!1),z=Ft("]",!1),J=Ft("(",!1),Z=Ft(")",!1),$="^^",G=Ft("^^",!1),X="true",Y=Ft("true",!1),Q="false",ee=Ft("false",!1),te=Ft("<",!1),re=/^[^\0- <>"{}|\^`\\]/,ne=It([["\0"," "],"<",">",'"',"{","}","|","^","`","\\"],!0,!1),ie=Ft(">",!1),oe=":",ae=Ft(":",!1),se="_:",ce=Ft("_:",!1),ue=/^[0-9]/,le=It([["0","9"]],!1,!1),de=Ft("@",!1),pe=/^[a-zA-Z]/,fe=It([["a","z"],["A","Z"]],!1,!1),he="-",me=Ft("-",!1),ge=/^[a-zA-Z0-9]/,ve=It([["a","z"],["A","Z"],["0","9"]],!1,!1),ye=function(e,t){return"-"+t.join("")},be=/^[+\-]/,we=It(["+","-"],!1,!1),xe=/^[eE]/,_e=It(["e","E"],!1,!1),Ee='"',ke=Ft('"',!1),Se=/^[^"\\\n\r]/,Ae=It(['"',"\\","\n","\r"],!0,!1),Ce="'",Te=Ft("'",!1),Oe=/^[^'\\\n\r]/,Pe=It(["'","\\","\n","\r"],!0,!1),Fe="'''",Ie=Ft("'''",!1),Ne=/^[^'\\]/,je=It(["'","\\"],!0,!1),Re="''",Le=Ft("''",!1),De=function(e,t){return"''"+t.join("")},Me=function(e,t){return"'"+t.join("")},Ue=function(e,t){return e.join("")+t.join("")},Be='"""',He=Ft('"""',!1),qe=/^[^"\\]/,Ke=It(['"',"\\"],!0,!1),We='""',Ve=Ft('""',!1),ze=function(e,t){return'""'+t.join("")},Je=function(e,t){return'"'+t.join("")},Ze=Ft("\\U",!1),$e=Ft("\\u",!1),Ge=Ft("\\t",!1),Xe=Ft("\\b",!1),Ye=Ft("\\n",!1),Qe=Ft("\\r",!1),et=Ft("\\f",!1),tt=Ft('\\"',!1),rt=Ft("\\'",!1),nt=Ft("\\\\",!1),it=/^[ \t\r\n]/,ot=It([" ","\t","\r","\n"],!1,!1),at=/^[\uD800-\uDBFF]/,st=It([["\ud800","\udbff"]],!1,!1),ct=/^[\uDC00-\uDFFF]/,ut=It([["\udc00","\udfff"]],!1,!1),lt=/^[A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,dt=It([["A","Z"],["a","z"],["À","Ö"],["Ø","ö"],["ø","˿"],["Ͱ","ͽ"],["Ϳ","῿"],["‌","‍"],["⁰","↏"],["Ⰰ","⿯"],["、","퟿"],["豈","﷏"],["ﷰ","�"]],!1,!1),pt=Ft("_",!1),ft=Ft("·",!1),ht=/^[\u0300-\u036F]/,mt=It([["̀","ͯ"]],!1,!1),gt=/^[\u203F-\u2040]/,vt=It([["‿","⁀"]],!1,!1),yt=function(e,t,r,n){return r.join("")+n.join("")},bt=Ft("%",!1),wt=/^[0-9A-Fa-f]/,xt=It([["0","9"],["A","F"],["a","f"]],!1,!1),_t=Ft("\\",!1),Et=/^[_~.!$&'()*+,;=\/?#@%\-]/,kt=It(["_","~",".","!","$","&","'","(",")","*","+",",",";","=","/","?","#","@","%","-"],!1,!1),St=0,At=0,Ct=[{line:1,column:1}],Tt=0,Ot=[];if("startRule"in n){if(!(n.startRule in a))throw new Error("Can't start parsing from rule \""+n.startRule+'".');s=a[n.startRule]}function Pt(t,r){throw function(t,r){return new e(t,null,null,r)}(t,r=void 0!==r?r:jt(At,St))}function Ft(e,t){return{type:"literal",text:e,ignoreCase:t}}function It(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function Nt(e){var r,n=Ct[e];if(n)return n;for(r=e-1;!Ct[r];)r--;for(n={line:(n=Ct[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return Ct[e]=n,n}function jt(e,t){var r=Nt(e),n=Nt(t);return{start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:n.line,column:n.column}}}function Rt(e){St<Tt||(St>Tt&&(Tt=St,Ot=[]),Ot.push(e))}function Lt(){var e,t,r,n,i,a;for(e=St,t=[],r=Dt();r!==o;)t.push(r),r=Dt();if(t!==o){for(r=[],n=Mt();n!==o;)r.push(n),n=Mt();r!==o?(At=e,i=t,(a=cr.toJSON())["@graph"]=[],i.filter((e=>Array.isArray(e))).forEach((e=>{e.forEach((e=>{a["@graph"].push(e)}))})),1===a["@graph"].length&&(Object.assign(a,a["@graph"][0]),delete a["@graph"]),e=t=a):(St=e,e=o)}else St=e,e=o;return e}function Dt(){var e,r,n,i;if((e=function(){var e;return(e=function(){var e,r,n,i,a,s,l,d,p;for(e=St,r=[],n=Mt();n!==o;)r.push(n),n=Mt();if(r!==o)if(t.substr(St,7)===m?(n=m,St+=7):(n=o,Rt(g)),n!==o){for(i=[],a=Mt();a!==o;)i.push(a),a=Mt();if(i!==o)if((a=Gt())!==o){for(s=[],l=Mt();l!==o;)s.push(l),l=Mt();if(s!==o)if((l=Zt())!==o){for(d=[],p=Mt();p!==o;)d.push(p),p=Mt();d!==o?(46===t.charCodeAt(St)?(p=c,St++):(p=o,Rt(u)),p!==o?(At=e,e=r=v(a,l)):(St=e,e=o)):(St=e,e=o)}else St=e,e=o;else St=e,e=o}else St=e,e=o;else St=e,e=o}else St=e,e=o;else St=e,e=o;return e}())===o&&(e=function(){var e,r,n,i,a,s,l;for(e=St,r=[],n=Mt();n!==o;)r.push(n),n=Mt();if(r!==o)if(t.substr(St,5)===y?(n=y,St+=5):(n=o,Rt(b)),n!==o){for(i=[],a=Mt();a!==o;)i.push(a),a=Mt();if(i!==o)if((a=Zt())!==o){for(s=[],l=Mt();l!==o;)s.push(l),l=Mt();s!==o?(46===t.charCodeAt(St)?(l=c,St++):(l=o,Rt(u)),l!==o?(At=e,e=r=w(a)):(St=e,e=o)):(St=e,e=o)}else St=e,e=o;else St=e,e=o}else St=e,e=o;else St=e,e=o;return e}())===o&&(e=function(){var e,r,n,i,a,s,c,u,l,d,p,f;for(e=St,r=[],n=Mt();n!==o;)r.push(n),n=Mt();if(r!==o)if(O.test(t.charAt(St))?(n=t.charAt(St),St++):(n=o,Rt(P)),n!==o)if(F.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(I)),i!==o)if(C.test(t.charAt(St))?(a=t.charAt(St),St++):(a=o,Rt(T)),a!==o)if(N.test(t.charAt(St))?(s=t.charAt(St),St++):(s=o,Rt(j)),s!==o)if(R.test(t.charAt(St))?(c=t.charAt(St),St++):(c=o,Rt(L)),c!==o)if(D.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(M)),u!==o){for(l=[],d=Mt();d!==o;)l.push(d),d=Mt();if(l!==o)if((d=Gt())!==o){for(p=[],f=Mt();f!==o;)p.push(f),f=Mt();p!==o&&(f=Zt())!==o?(At=e,e=r=v(d,f)):(St=e,e=o)}else St=e,e=o;else St=e,e=o}else St=e,e=o;else St=e,e=o;else St=e,e=o;else St=e,e=o;else St=e,e=o;else St=e,e=o;else St=e,e=o;return e}())===o&&(e=function(){var e,r,n,i,a,s,c,u;for(e=St,r=[],n=Mt();n!==o;)r.push(n),n=Mt();if(r!==o)if(x.test(t.charAt(St))?(n=t.charAt(St),St++):(n=o,Rt(_)),n!==o)if(E.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(k)),i!==o)if(S.test(t.charAt(St))?(a=t.charAt(St),St++):(a=o,Rt(A)),a!==o)if(C.test(t.charAt(St))?(s=t.charAt(St),St++):(s=o,Rt(T)),s!==o){for(c=[],u=Mt();u!==o;)c.push(u),u=Mt();c!==o&&(u=Zt())!==o?(At=e,e=r=w(u)):(St=e,e=o)}else St=e,e=o;else St=e,e=o;else St=e,e=o;else St=e,e=o;else St=e,e=o;return e}()),e}())===o)if(e=St,(r=function(){var e,t,r;return e=St,(t=function(){var e,t;return e=St,(t=Wt())!==o&&(At=e,r=t,t=ur(r,!0)),(e=t)===o&&(e=Jt())===o&&(e=zt()),e;var r}())!==o&&(r=Ut())!==o?(At=e,n=t,i=r,a={},"string"==typeof n&&"[]"!==n?a["@id"]=n:"object"==typeof n&&Object.assign(a,n),i&&Object.assign(a,i),e=t=[a]):(St=e,e=o),e===o&&(e=St,(t=Kt())!==o?((r=Ut())===o&&(r=null),r!==o?(At=e,e=t=function(e,t){var r={};return e&&Object.assign(r,e),t&&Object.assign(r,t),[r]}(t,r)):(St=e,e=o)):(St=e,e=o)),e;var n,i,a}())!==o){for(n=[],i=Mt();i!==o;)n.push(i),i=Mt();n!==o?(46===t.charCodeAt(St)?(i=c,St++):(i=o,Rt(u)),i!==o?(At=e,e=r):(St=e,e=o)):(St=e,e=o)}else St=e,e=o;return e}function Mt(){var e;return(e=function(){var e;return it.test(t.charAt(St))?(e=t.charAt(St),St++):(e=o,Rt(ot)),e}())===o&&(e=function(){var e,r,n,i;if(e=St,35===t.charCodeAt(St)?(r="#",St++):(r=o,Rt(l)),r!==o){for(n=[],d.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(p));i!==o;)n.push(i),d.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(p));n!==o?(10===t.charCodeAt(St)?(i="\n",St++):(i=o,Rt(f)),i!==o?(At=e,e=r=h(n)):(St=e,e=o)):(St=e,e=o)}else St=e,e=o;return e}()),e}function Ut(){var e,r,n,i,a,s,c,u,l,d,p,f,h,m;if(e=St,(r=Ht())!==o)if((n=Bt())!==o){for(i=[],a=St,s=[],c=Mt();c!==o;)s.push(c),c=Mt();for(s!==o?(59===t.charCodeAt(St)?(c=";",St++):(c=o,Rt(U)),c!==o?(u=St,(l=Ht())!==o&&(d=Bt())!==o?(At=u,u=l=B(0,0,l,d)):(St=u,u=o),u===o&&(u=null),u!==o?(At=a,a=s=H(0,0,u)):(St=a,a=o)):(St=a,a=o)):(St=a,a=o);a!==o;){for(i.push(a),a=St,s=[],c=Mt();c!==o;)s.push(c),c=Mt();s!==o?(59===t.charCodeAt(St)?(c=";",St++):(c=o,Rt(U)),c!==o?(u=St,(l=Ht())!==o&&(d=Bt())!==o?(At=u,u=l=B(0,0,l,d)):(St=u,u=o),u===o&&(u=null),u!==o?(At=a,a=s=H(0,0,u)):(St=a,a=o)):(St=a,a=o)):(St=a,a=o)}i!==o?(At=e,p=r,f=n,m={},(h=i).unshift(function(e,t){var r={};return r[e]=t,r}(p,f)),h.forEach((e=>{e&&Object.keys(e).forEach((t=>{e[t].forEach((e=>{"@type"===t&&void 0!==e["@id"]&&(e=e["@id"]),void 0===m[t]?m[t]=e:Array.isArray(m[t])?m[t].push(e):m[t]=[m[t],e]}))}))})),e=r=m):(St=e,e=o)}else St=e,e=o;else St=e,e=o;return e}function Bt(){var e,r,n,i,a,s,c,u,l;if(e=St,(r=qt())!==o){for(n=[],i=St,a=[],s=Mt();s!==o;)a.push(s),s=Mt();for(a!==o?(44===t.charCodeAt(St)?(s=",",St++):(s=o,Rt(q)),s!==o&&(c=qt())!==o?(At=i,i=a=K(0,c)):(St=i,i=o)):(St=i,i=o);i!==o;){for(n.push(i),i=St,a=[],s=Mt();s!==o;)a.push(s),s=Mt();a!==o?(44===t.charCodeAt(St)?(s=",",St++):(s=o,Rt(q)),s!==o&&(c=qt())!==o?(At=i,i=a=K(0,c)):(St=i,i=o)):(St=i,i=o)}n!==o?(At=e,u=r,(l=n).unshift(u),e=r=l):(St=e,e=o)}else St=e,e=o;return e}function Ht(){var e,r,n;if(e=St,(r=function(){var e,t,r;for(e=St,t=[],r=Mt();r!==o;)t.push(r),r=Mt();return t!==o&&(r=zt())!==o?(At=e,e=t=r):(St=e,e=o),e}())!==o&&(At=e),(e=r)===o){for(e=St,r=[],n=Mt();n!==o;)r.push(n),n=Mt();r!==o?(97===t.charCodeAt(St)?(n="a",St++):(n=o,Rt(W)),n!==o?(At=e,e=r="@type"):(St=e,e=o)):(St=e,e=o)}return e}function qt(){var e,r;return(e=function(){var e;return(e=function(){var e,r,n,i,a,s,c;for(e=St,r=[],n=Mt();n!==o;)r.push(n),n=Mt();if(r!==o)if((n=Vt())!==o){for(i=[],a=Mt();a!==o;)i.push(a),a=Mt();i!==o&&(a=function(){var e,r,n,i,a,s,c,u;if(e=St,64===t.charCodeAt(St)?(r="@",St++):(r=o,Rt(de)),r!==o){if(n=[],pe.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(fe)),i!==o)for(;i!==o;)n.push(i),pe.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(fe));else n=o;if(n!==o){if(i=[],a=St,45===t.charCodeAt(St)?(s=he,St++):(s=o,Rt(me)),s!==o){if(c=[],ge.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(ve)),u!==o)for(;u!==o;)c.push(u),ge.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(ve));else c=o;c!==o?(At=a,a=s=ye(0,c)):(St=a,a=o)}else St=a,a=o;for(;a!==o;)if(i.push(a),a=St,45===t.charCodeAt(St)?(s=he,St++):(s=o,Rt(me)),s!==o){if(c=[],ge.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(ve)),u!==o)for(;u!==o;)c.push(u),ge.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(ve));else c=o;c!==o?(At=a,a=s=ye(0,c)):(St=a,a=o)}else St=a,a=o;i!==o?(At=e,l=i,e=r=n.join("")+l.join("")):(St=e,e=o)}else St=e,e=o}else St=e,e=o;var l;return e}())!==o?(At=e,e=r={"@value":n,"@language":a}):(St=e,e=o)}else St=e,e=o;else St=e,e=o;if(e===o){for(e=St,r=[],n=Mt();n!==o;)r.push(n),n=Mt();if(r!==o)if((n=Vt())!==o){for(i=[],a=Mt();a!==o;)i.push(a),a=Mt();if(i!==o)if(t.substr(St,2)===$?(a=$,St+=2):(a=o,Rt(G)),a!==o){for(s=[],c=Mt();c!==o;)s.push(c),c=Mt();s!==o&&(c=zt())!==o?(At=e,e=r=function(e,t){if("http://www.w3.org/2001/XMLSchema#boolean"===t&&"true"===e)return!0;if("http://www.w3.org/2001/XMLSchema#boolean"===t&&"false"===e)return!1;if("http://www.w3.org/2001/XMLSchema#integer"===t)return parseInt(e);if("http://www.w3.org/2001/XMLSchema#double"===t)return parseFloat(e);const r=cr.resolve(t,!0);if(r){const n=t.split(":")[0];if("http://www.w3.org/2001/XMLSchema#boolean"===r&&"true"===e)return cr.decrement(n),!0;if("http://www.w3.org/2001/XMLSchema#boolean"===r&&"false"===e)return cr.decrement(n),!1;if("http://www.w3.org/2001/XMLSchema#integer"===r)return cr.decrement(n),parseInt(e);if("http://www.w3.org/2001/XMLSchema#double"===r)return cr.decrement(n),parseFloat(e)}return{"@value":e,"@type":t}}(n,c)):(St=e,e=o)}else St=e,e=o;else St=e,e=o}else St=e,e=o;else St=e,e=o;if(e===o){for(e=St,r=[],n=Mt();n!==o;)r.push(n),n=Mt();r!==o&&(n=Vt())!==o?(At=e,e=r=n):(St=e,e=o)}}return e}())===o&&(e=function(){var e,r,n;for(e=St,r=[],n=Mt();n!==o;)r.push(n),n=Mt();return r!==o?((n=function(){var e,r,n,i,a,s,l,d,p;if(e=St,r=St,n=St,be.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(we)),i===o&&(i=null),i!==o){if(a=St,s=[],ue.test(t.charAt(St))?(l=t.charAt(St),St++):(l=o,Rt(le)),l!==o)for(;l!==o;)s.push(l),ue.test(t.charAt(St))?(l=t.charAt(St),St++):(l=o,Rt(le));else s=o;if(s!==o)if(46===t.charCodeAt(St)?(l=c,St++):(l=o,Rt(u)),l!==o){for(d=[],ue.test(t.charAt(St))?(p=t.charAt(St),St++):(p=o,Rt(le));p!==o;)d.push(p),ue.test(t.charAt(St))?(p=t.charAt(St),St++):(p=o,Rt(le));d!==o&&(p=Xt())!==o?a=s=[s,l,d,p]:(St=a,a=o)}else St=a,a=o;else St=a,a=o;if(a===o){if(a=St,46===t.charCodeAt(St)?(s=c,St++):(s=o,Rt(u)),s!==o){if(l=[],ue.test(t.charAt(St))?(d=t.charAt(St),St++):(d=o,Rt(le)),d!==o)for(;d!==o;)l.push(d),ue.test(t.charAt(St))?(d=t.charAt(St),St++):(d=o,Rt(le));else l=o;l!==o&&(d=Xt())!==o?a=s=[s,l,d]:(St=a,a=o)}else St=a,a=o;if(a===o){if(a=St,s=[],ue.test(t.charAt(St))?(l=t.charAt(St),St++):(l=o,Rt(le)),l!==o)for(;l!==o;)s.push(l),ue.test(t.charAt(St))?(l=t.charAt(St),St++):(l=o,Rt(le));else s=o;s!==o&&(l=Xt())!==o?a=s=[s,l]:(St=a,a=o)}}a!==o?n=i=[i,a]:(St=n,n=o)}else St=n,n=o;return(r=n!==o?t.substring(r,St):n)!==o&&(At=e,f=r,r={"@value":f,"@type":"http://www.w3.org/2001/XMLSchema#double"}),r;var f}())===o&&(n=function(){var e,r,n,i,a,s,l,d;if(e=St,r=St,n=St,be.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(we)),i===o&&(i=null),i!==o){for(a=[],ue.test(t.charAt(St))?(s=t.charAt(St),St++):(s=o,Rt(le));s!==o;)a.push(s),ue.test(t.charAt(St))?(s=t.charAt(St),St++):(s=o,Rt(le));if(a!==o)if(46===t.charCodeAt(St)?(s=c,St++):(s=o,Rt(u)),s!==o){if(l=[],ue.test(t.charAt(St))?(d=t.charAt(St),St++):(d=o,Rt(le)),d!==o)for(;d!==o;)l.push(d),ue.test(t.charAt(St))?(d=t.charAt(St),St++):(d=o,Rt(le));else l=o;l!==o?n=i=[i,a,s,l]:(St=n,n=o)}else St=n,n=o;else St=n,n=o}else St=n,n=o;return(r=n!==o?t.substring(r,St):n)!==o&&(At=e,p=r,r={"@value":p,"@type":"http://www.w3.org/2001/XMLSchema#decimal"}),r;var p}())===o&&(n=function(){var e,r,n,i,a,s;if(e=St,r=St,n=St,be.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(we)),i===o&&(i=null),i!==o){if(a=[],ue.test(t.charAt(St))?(s=t.charAt(St),St++):(s=o,Rt(le)),s!==o)for(;s!==o;)a.push(s),ue.test(t.charAt(St))?(s=t.charAt(St),St++):(s=o,Rt(le));else a=o;a!==o?n=i=[i,a]:(St=n,n=o)}else St=n,n=o;return(r=n!==o?t.substring(r,St):n)!==o&&(At=e,c=r,r=c.match(/^[0+][0-9]+$/)?{"@value":c,"@type":"http://www.w3.org/2001/XMLSchema#integer"}:parseInt(c)),r;var c}()),n!==o?(At=e,e=r=n):(St=e,e=o)):(St=e,e=o),e}())===o&&(e=function(){var e,r,n;for(e=St,r=[],n=Mt();n!==o;)r.push(n),n=Mt();if(r!==o?(t.substr(St,4)===X?(n=X,St+=4):(n=o,Rt(Y)),n!==o?(At=e,e=r=!0):(St=e,e=o)):(St=e,e=o),e===o){for(e=St,r=[],n=Mt();n!==o;)r.push(n),n=Mt();r!==o?(t.substr(St,5)===Q?(n=Q,St+=5):(n=o,Rt(ee)),n!==o?(At=e,e=r=!1):(St=e,e=o)):(St=e,e=o)}return e}()),e}())===o&&(e=St,(r=Wt())!==o&&(At=e,r=ur(r,!1)),(e=r)===o&&(e=St,(r=Jt())!==o&&(At=e,r=function(e){return"[]"===e?{}:{"@id":e}}(r)),(e=r)===o&&(e=St,(r=Kt())!==o&&(At=e),(e=r)===o&&(e=St,(r=zt())!==o&&(At=e,r=function(e){return{"@id":e}}(r)),e=r)))),e}function Kt(){var e,r,n,i,a,s;for(e=St,r=[],n=Mt();n!==o;)r.push(n),n=Mt();if(r!==o)if(91===t.charCodeAt(St)?(n="[",St++):(n=o,Rt(V)),n!==o)if((i=Ut())!==o){for(a=[],s=Mt();s!==o;)a.push(s),s=Mt();a!==o?(93===t.charCodeAt(St)?(s="]",St++):(s=o,Rt(z)),s!==o?(At=e,e=r=i):(St=e,e=o)):(St=e,e=o)}else St=e,e=o;else St=e,e=o;else St=e,e=o;return e}function Wt(){var e,r,n,i,a,s;for(e=St,r=[],n=Mt();n!==o;)r.push(n),n=Mt();if(r!==o)if(40===t.charCodeAt(St)?(n="(",St++):(n=o,Rt(J)),n!==o){for(i=[],a=qt();a!==o;)i.push(a),a=qt();if(i!==o){for(a=[],s=Mt();s!==o;)a.push(s),s=Mt();a!==o?(41===t.charCodeAt(St)?(s=")",St++):(s=o,Rt(Z)),s!==o?(At=e,e=r={"@list":i}):(St=e,e=o)):(St=e,e=o)}else St=e,e=o}else St=e,e=o;else St=e,e=o;return e}function Vt(){var e,r,n;for(e=St,r=[],n=Mt();n!==o;)r.push(n),n=Mt();return r!==o?((n=function(){var e,r,n,i,a,s,c,u;if(e=St,t.substr(St,3)===Fe?(r=Fe,St+=3):(r=o,Rt(Ie)),r!==o){for(n=[],Ne.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(je)),i===o&&(i=Qt())===o&&(i=Yt());i!==o;)n.push(i),Ne.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(je)),i===o&&(i=Qt())===o&&(i=Yt());if(n!==o){if(i=[],a=St,t.substr(St,2)===Re?(s=Re,St+=2):(s=o,Rt(Le)),s!==o){if(c=[],Ne.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(je)),u===o&&(u=Qt())===o&&(u=Yt()),u!==o)for(;u!==o;)c.push(u),Ne.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(je)),u===o&&(u=Qt())===o&&(u=Yt());else c=o;c!==o?(At=a,a=s=De(0,c)):(St=a,a=o)}else St=a,a=o;if(a===o)if(a=St,39===t.charCodeAt(St)?(s=Ce,St++):(s=o,Rt(Te)),s!==o){if(c=[],Ne.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(je)),u===o&&(u=Qt())===o&&(u=Yt()),u!==o)for(;u!==o;)c.push(u),Ne.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(je)),u===o&&(u=Qt())===o&&(u=Yt());else c=o;c!==o?(At=a,a=s=Me(0,c)):(St=a,a=o)}else St=a,a=o;for(;a!==o;){if(i.push(a),a=St,t.substr(St,2)===Re?(s=Re,St+=2):(s=o,Rt(Le)),s!==o){if(c=[],Ne.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(je)),u===o&&(u=Qt())===o&&(u=Yt()),u!==o)for(;u!==o;)c.push(u),Ne.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(je)),u===o&&(u=Qt())===o&&(u=Yt());else c=o;c!==o?(At=a,a=s=De(0,c)):(St=a,a=o)}else St=a,a=o;if(a===o)if(a=St,39===t.charCodeAt(St)?(s=Ce,St++):(s=o,Rt(Te)),s!==o){if(c=[],Ne.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(je)),u===o&&(u=Qt())===o&&(u=Yt()),u!==o)for(;u!==o;)c.push(u),Ne.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(je)),u===o&&(u=Qt())===o&&(u=Yt());else c=o;c!==o?(At=a,a=s=Me(0,c)):(St=a,a=o)}else St=a,a=o}i!==o?(t.substr(St,3)===Fe?(a=Fe,St+=3):(a=o,Rt(Ie)),a!==o?(At=e,e=r=Ue(n,i)):(St=e,e=o)):(St=e,e=o)}else St=e,e=o}else St=e,e=o;return e}())===o&&(n=function(){var e,r,n,i,a,s,c,u;if(e=St,t.substr(St,3)===Be?(r=Be,St+=3):(r=o,Rt(He)),r!==o){for(n=[],qe.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(Ke)),i===o&&(i=Qt())===o&&(i=Yt());i!==o;)n.push(i),qe.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(Ke)),i===o&&(i=Qt())===o&&(i=Yt());if(n!==o){if(i=[],a=St,t.substr(St,2)===We?(s=We,St+=2):(s=o,Rt(Ve)),s!==o){if(c=[],qe.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(Ke)),u===o&&(u=Qt())===o&&(u=Yt()),u!==o)for(;u!==o;)c.push(u),qe.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(Ke)),u===o&&(u=Qt())===o&&(u=Yt());else c=o;c!==o?(At=a,a=s=ze(0,c)):(St=a,a=o)}else St=a,a=o;if(a===o)if(a=St,34===t.charCodeAt(St)?(s=Ee,St++):(s=o,Rt(ke)),s!==o){if(c=[],qe.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(Ke)),u===o&&(u=Qt())===o&&(u=Yt()),u!==o)for(;u!==o;)c.push(u),qe.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(Ke)),u===o&&(u=Qt())===o&&(u=Yt());else c=o;c!==o?(At=a,a=s=Je(0,c)):(St=a,a=o)}else St=a,a=o;for(;a!==o;){if(i.push(a),a=St,t.substr(St,2)===We?(s=We,St+=2):(s=o,Rt(Ve)),s!==o){if(c=[],qe.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(Ke)),u===o&&(u=Qt())===o&&(u=Yt()),u!==o)for(;u!==o;)c.push(u),qe.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(Ke)),u===o&&(u=Qt())===o&&(u=Yt());else c=o;c!==o?(At=a,a=s=ze(0,c)):(St=a,a=o)}else St=a,a=o;if(a===o)if(a=St,34===t.charCodeAt(St)?(s=Ee,St++):(s=o,Rt(ke)),s!==o){if(c=[],qe.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(Ke)),u===o&&(u=Qt())===o&&(u=Yt()),u!==o)for(;u!==o;)c.push(u),qe.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(Ke)),u===o&&(u=Qt())===o&&(u=Yt());else c=o;c!==o?(At=a,a=s=Je(0,c)):(St=a,a=o)}else St=a,a=o}i!==o?(t.substr(St,3)===Be?(a=Be,St+=3):(a=o,Rt(He)),a!==o?(At=e,e=r=Ue(n,i)):(St=e,e=o)):(St=e,e=o)}else St=e,e=o}else St=e,e=o;return e}())===o&&(n=function(){var e,r,n,i;if(e=St,39===t.charCodeAt(St)?(r=Ce,St++):(r=o,Rt(Te)),r!==o){for(n=[],Oe.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(Pe)),i===o&&(i=Qt())===o&&(i=Yt());i!==o;)n.push(i),Oe.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(Pe)),i===o&&(i=Qt())===o&&(i=Yt());n!==o?(39===t.charCodeAt(St)?(i=Ce,St++):(i=o,Rt(Te)),i!==o?(At=e,e=r=h(n)):(St=e,e=o)):(St=e,e=o)}else St=e,e=o;return e}())===o&&(n=function(){var e,r,n,i;if(e=St,34===t.charCodeAt(St)?(r=Ee,St++):(r=o,Rt(ke)),r!==o){for(n=[],Se.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(Ae)),i===o&&(i=Qt())===o&&(i=Yt());i!==o;)n.push(i),Se.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(Ae)),i===o&&(i=Qt())===o&&(i=Yt());n!==o?(34===t.charCodeAt(St)?(i=Ee,St++):(i=o,Rt(ke)),i!==o?(At=e,e=r=h(n)):(St=e,e=o)):(St=e,e=o)}else St=e,e=o;return e}()),n!==o?(At=e,e=r=n):(St=e,e=o)):(St=e,e=o),e}function zt(){var e,r,n;for(e=St,r=[],n=Mt();n!==o;)r.push(n),n=Mt();if(r!==o&&(n=Zt())!==o?(At=e,e=r=n):(St=e,e=o),e===o){for(e=St,r=[],n=Mt();n!==o;)r.push(n),n=Mt();r!==o&&(n=function(){var e,r;return(e=function(){var e,r,n;return e=St,(r=$t())!==o&&(n=function(){var e,r,n,i,a,s,l,d;if(e=St,(r=tr())===o&&(58===t.charCodeAt(St)?(r=oe,St++):(r=o,Rt(ae)),r===o&&(ue.test(t.charAt(St))?(r=t.charAt(St),St++):(r=o,Rt(le)),r===o&&(r=ir()))),r!==o){for(n=[],(i=rr())===o&&(58===t.charCodeAt(St)?(i=oe,St++):(i=o,Rt(ae)),i===o&&(i=ir()));i!==o;)n.push(i),(i=rr())===o&&(58===t.charCodeAt(St)?(i=oe,St++):(i=o,Rt(ae)),i===o&&(i=ir()));if(n!==o){if(i=[],a=St,s=[],46===t.charCodeAt(St)?(l=c,St++):(l=o,Rt(u)),l!==o)for(;l!==o;)s.push(l),46===t.charCodeAt(St)?(l=c,St++):(l=o,Rt(u));else s=o;if(s!==o){if(l=[],(d=rr())===o&&(58===t.charCodeAt(St)?(d=oe,St++):(d=o,Rt(ae)),d===o&&(d=ir())),d!==o)for(;d!==o;)l.push(d),(d=rr())===o&&(58===t.charCodeAt(St)?(d=oe,St++):(d=o,Rt(ae)),d===o&&(d=ir()));else l=o;l!==o?(At=a,a=s=yt(0,0,s,l)):(St=a,a=o)}else St=a,a=o;for(;a!==o;){if(i.push(a),a=St,s=[],46===t.charCodeAt(St)?(l=c,St++):(l=o,Rt(u)),l!==o)for(;l!==o;)s.push(l),46===t.charCodeAt(St)?(l=c,St++):(l=o,Rt(u));else s=o;if(s!==o){if(l=[],(d=rr())===o&&(58===t.charCodeAt(St)?(d=oe,St++):(d=o,Rt(ae)),d===o&&(d=ir())),d!==o)for(;d!==o;)l.push(d),(d=rr())===o&&(58===t.charCodeAt(St)?(d=oe,St++):(d=o,Rt(ae)),d===o&&(d=ir()));else l=o;l!==o?(At=a,a=s=yt(0,0,s,l)):(St=a,a=o)}else St=a,a=o}i!==o?(At=e,p=i,e=r=r+n.join("")+p.join("")):(St=e,e=o)}else St=e,e=o}else St=e,e=o;var p;return e}())!==o?(At=e,i=r,a=n,cr.increment(i),e=r=cr.resolve(i+":"+a)):(St=e,e=o),e;var i,a}())===o&&(e=St,(r=$t())!==o&&(At=e,n=r,r=n+":"),e=r),e;var n}())!==o?(At=e,e=r=n):(St=e,e=o)}return e}function Jt(){var e,r,n;for(e=St,r=[],n=Mt();n!==o;)r.push(n),n=Mt();if(r!==o&&(n=function(){var e,r,n,i,a,s,l,d,p,f;if(e=St,r=St,t.substr(St,2)===se?(n=se,St+=2):(n=o,Rt(ce)),n!==o)if((i=tr())===o&&(ue.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(le))),i!==o){for(a=[],s=rr();s!==o;)a.push(s),s=rr();if(a!==o){if(s=[],l=St,d=[],46===t.charCodeAt(St)?(p=c,St++):(p=o,Rt(u)),p!==o)for(;p!==o;)d.push(p),46===t.charCodeAt(St)?(p=c,St++):(p=o,Rt(u));else d=o;if(d!==o){if(p=[],(f=rr())!==o)for(;f!==o;)p.push(f),f=rr();else p=o;p!==o?l=d=[d,p]:(St=l,l=o)}else St=l,l=o;for(;l!==o;){if(s.push(l),l=St,d=[],46===t.charCodeAt(St)?(p=c,St++):(p=o,Rt(u)),p!==o)for(;p!==o;)d.push(p),46===t.charCodeAt(St)?(p=c,St++):(p=o,Rt(u));else d=o;if(d!==o){if(p=[],(f=rr())!==o)for(;f!==o;)p.push(f),f=rr();else p=o;p!==o?l=d=[d,p]:(St=l,l=o)}else St=l,l=o}s!==o?r=n=[n,i,a,s]:(St=r,r=o)}else St=r,r=o}else St=r,r=o;else St=r,r=o;return r!==o?t.substring(e,St):r}())!==o?(At=e,e=r=n):(St=e,e=o),e===o){for(e=St,r=[],n=Mt();n!==o;)r.push(n),n=Mt();r!==o&&(n=function(){var e,r,n,i;if(e=St,91===t.charCodeAt(St)?(r="[",St++):(r=o,Rt(V)),r!==o){for(n=[],i=Mt();i!==o;)n.push(i),i=Mt();n!==o?(93===t.charCodeAt(St)?(i="]",St++):(i=o,Rt(z)),i!==o?(At=e,e=r="[]"):(St=e,e=o)):(St=e,e=o)}else St=e,e=o;return e}())!==o?(At=e,e=r=n):(St=e,e=o)}return e}function Zt(){var e,r,n,i;if(e=St,60===t.charCodeAt(St)?(r="<",St++):(r=o,Rt(te)),r!==o){for(n=[],re.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(ne)),i===o&&(i=Yt());i!==o;)n.push(i),re.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(ne)),i===o&&(i=Yt());n!==o?(62===t.charCodeAt(St)?(i=">",St++):(i=o,Rt(ie)),i!==o?(At=e,e=r=function(e){const t=e.map((e=>65536<=e.codePointAt(0)&&e.codePointAt(0)<=983039?"a":1===e.length?e:6===e.length?String.fromCharCode("0x"+e.substring(2)):10===e.length?String.fromCodePoint("0x"+e.substring(2)):e)).join("");if(t.match(/^[^\u0000-\u0020<>"{}|^`\\]*$/)){var r=e.join("");try{return cr.resolve(r)}catch(e){Pt("Invalid IRIREF "+r)}}else Pt("Invalid IRIREF "+e.join("")+" / "+t)}(n)):(St=e,e=o)):(St=e,e=o)}else St=e,e=o;return e}function $t(){var e,r,n,i;return e=St,(r=nr())===o&&(r=null),r!==o?(58===t.charCodeAt(St)?(n=oe,St++):(n=o,Rt(ae)),n!==o?(At=e,i=(i=r)||"0",!1===cr.hasPrefix(i)&&Pt("undefined prefix "+i),e=r=i):(St=e,e=o)):(St=e,e=o),e}function Gt(){var e,r,n;return e=St,(r=nr())===o&&(r=null),r!==o?(58===t.charCodeAt(St)?(n=oe,St++):(n=o,Rt(ae)),n!==o?(At=e,e=r=r||""):(St=e,e=o)):(St=e,e=o),e}function Xt(){var e,r,n,i,a,s;if(e=St,r=St,xe.test(t.charAt(St))?(n=t.charAt(St),St++):(n=o,Rt(_e)),n!==o)if(be.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(we)),i===o&&(i=null),i!==o){if(a=[],ue.test(t.charAt(St))?(s=t.charAt(St),St++):(s=o,Rt(le)),s!==o)for(;s!==o;)a.push(s),ue.test(t.charAt(St))?(s=t.charAt(St),St++):(s=o,Rt(le));else a=o;a!==o?r=n=[n,i,a]:(St=r,r=o)}else St=r,r=o;else St=r,r=o;return r!==o?t.substring(e,St):r}function Yt(){var e,r,n,i,a,s,c,u,l,d,p,f;return e=St,"\\U"===t.substr(St,2)?(r="\\U",St+=2):(r=o,Rt(Ze)),r!==o?(n=St,(i=or())!==o&&(a=or())!==o&&(s=or())!==o&&(c=or())!==o&&(u=or())!==o&&(l=or())!==o&&(d=or())!==o&&(p=or())!==o?n=i=[i,a,s,c,u,l,d,p]:(St=n,n=o),n!==o?(At=e,f=n,e=r=String.fromCodePoint(parseInt(f.join(""),16))):(St=e,e=o)):(St=e,e=o),e===o&&(e=St,"\\u"===t.substr(St,2)?(r="\\u",St+=2):(r=o,Rt($e)),r!==o?(n=St,(i=or())!==o&&(a=or())!==o&&(s=or())!==o&&(c=or())!==o?n=i=[i,a,s,c]:(St=n,n=o),n!==o?(At=e,e=r=function(e){return String.fromCharCode(parseInt(e.join(""),16))}(n)):(St=e,e=o)):(St=e,e=o)),e}function Qt(){var e,r;return e=St,"\\t"===t.substr(St,2)?(r="\\t",St+=2):(r=o,Rt(Ge)),r!==o&&(At=e,r="\t"),(e=r)===o&&(e=St,"\\b"===t.substr(St,2)?(r="\\b",St+=2):(r=o,Rt(Xe)),r!==o&&(At=e,r="\b"),(e=r)===o&&(e=St,"\\n"===t.substr(St,2)?(r="\\n",St+=2):(r=o,Rt(Ye)),r!==o&&(At=e,r="\n"),(e=r)===o&&(e=St,"\\r"===t.substr(St,2)?(r="\\r",St+=2):(r=o,Rt(Qe)),r!==o&&(At=e,r="\r"),(e=r)===o&&(e=St,"\\f"===t.substr(St,2)?(r="\\f",St+=2):(r=o,Rt(et)),r!==o&&(At=e,r="\f"),(e=r)===o&&(e=St,'\\"'===t.substr(St,2)?(r='\\"',St+=2):(r=o,Rt(tt)),r!==o&&(At=e,r='"'),(e=r)===o&&(e=St,"\\'"===t.substr(St,2)?(r="\\'",St+=2):(r=o,Rt(rt)),r!==o&&(At=e,r="'"),(e=r)===o&&(e=St,"\\\\"===t.substr(St,2)?(r="\\\\",St+=2):(r=o,Rt(nt)),r!==o&&(At=e,r="\\"),e=r))))))),e}function er(){var e,r,n;return e=St,at.test(t.charAt(St))?(r=t.charAt(St),St++):(r=o,Rt(st)),r!==o?(ct.test(t.charAt(St))?(n=t.charAt(St),St++):(n=o,Rt(ut)),n!==o?(At=e,e=r=r+n):(St=e,e=o)):(St=e,e=o),e===o&&(lt.test(t.charAt(St))?(e=t.charAt(St),St++):(e=o,Rt(dt))),e}function tr(){var e;return(e=er())===o&&(95===t.charCodeAt(St)?(e="_",St++):(e=o,Rt(pt))),e}function rr(){var e;return(e=tr())===o&&(45===t.charCodeAt(St)?(e=he,St++):(e=o,Rt(me)),e===o&&(ue.test(t.charAt(St))?(e=t.charAt(St),St++):(e=o,Rt(le)),e===o&&(183===t.charCodeAt(St)?(e="·",St++):(e=o,Rt(ft)),e===o&&(ht.test(t.charAt(St))?(e=t.charAt(St),St++):(e=o,Rt(mt)),e===o&&(gt.test(t.charAt(St))?(e=t.charAt(St),St++):(e=o,Rt(vt))))))),e}function nr(){var e,r,n,i,a,s,l,d,p;if(e=St,r=St,(n=er())!==o){for(i=[],a=rr();a!==o;)i.push(a),a=rr();if(i!==o){if(a=[],s=St,l=[],46===t.charCodeAt(St)?(d=c,St++):(d=o,Rt(u)),d!==o)for(;d!==o;)l.push(d),46===t.charCodeAt(St)?(d=c,St++):(d=o,Rt(u));else l=o;if(l!==o){if(d=[],(p=rr())!==o)for(;p!==o;)d.push(p),p=rr();else d=o;d!==o?s=l=[l,d]:(St=s,s=o)}else St=s,s=o;for(;s!==o;){if(a.push(s),s=St,l=[],46===t.charCodeAt(St)?(d=c,St++):(d=o,Rt(u)),d!==o)for(;d!==o;)l.push(d),46===t.charCodeAt(St)?(d=c,St++):(d=o,Rt(u));else l=o;if(l!==o){if(d=[],(p=rr())!==o)for(;p!==o;)d.push(p),p=rr();else d=o;d!==o?s=l=[l,d]:(St=s,s=o)}else St=s,s=o}a!==o?r=n=[n,i,a]:(St=r,r=o)}else St=r,r=o}else St=r,r=o;return r!==o?t.substring(e,St):r}function ir(){var e;return(e=function(){var e,r,n,i,a;return e=St,r=St,37===t.charCodeAt(St)?(n="%",St++):(n=o,Rt(bt)),n!==o&&(i=or())!==o&&(a=or())!==o?r=n=[n,i,a]:(St=r,r=o),r!==o?t.substring(e,St):r}())===o&&(e=function(){var e,r,n;return e=St,92===t.charCodeAt(St)?(r="\\",St++):(r=o,Rt(_t)),r!==o?(Et.test(t.charAt(St))?(n=t.charAt(St),St++):(n=o,Rt(kt)),n!==o?(At=e,e=r=n):(St=e,e=o)):(St=e,e=o),e}()),e}function or(){var e;return wt.test(t.charAt(St))?(e=t.charAt(St),St++):(e=o,Rt(xt)),e}var ar=new Function("try {return this===window;}catch(e){ return false;}")()?window.URL:r(8575).URL,sr=function(e){return e.match(/^[a-z](.*?):(.+?)/g)},cr={base:[],data:{},addBase:function(e){if(0===cr.base.length)return void cr.base.push(e);const t=cr.base[cr.base.length-1];t!==e&&cr.base.push(new ar(e,t).toString())},addPrefix:function(e,t){const r=cr.data[e];void 0===r?cr.data[e]=[{uri:t,count:0}]:r[r.length-1].uri!==t&&r.push({uri:t,count:0})},hasPrefix:function(e){return void 0!==this.data[e]},resolve:function(e,t){const r=Object.keys(cr.data).find((t=>0===e.indexOf(t+":")));if(void 0!==r){const n=cr.data[r];if(1===n.length&&!0!==t&&sr(n[0].uri))return e;const i=n[n.length-1].uri;return e.replace(r+":",i)}var i=0===cr.base.length?n.baseIRI:cr.base[cr.base.length-1];return!i||e.match(/^(http:|https:|urn:|file:)/)?e:0===e.indexOf("//")&&i?i.split("//")[0]+e:new ar(e,i).toString()},increment:function(e){const t=cr.data[e];void 0!==t&&t[t.length-1].count++},decrement:function(e){const t=cr.data[e];void 0!==t&&t[t.length-1].count--},toJSON:function(){const e={};return cr.base.length>0&&(void 0===e["@context"]&&(e["@context"]={}),e["@context"]["@base"]=cr.base[0]),Object.keys(cr.data).forEach((t=>{const r=cr.data[t][0];"http://www.w3.org/2001/XMLSchema#"===r.uri&&r.count<1||sr(r.uri)&&(void 0===e["@context"]&&(e["@context"]={}),e["@context"][t]=r.uri)})),e}};function ur(e,t){if(void 0===e["@list"])return e;if(!t&&!e["@list"].find((e=>void 0!==e["@list"])))return e;if(0===e["@list"].length)return{"@id":"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"};var r={},n=null;return e["@list"].forEach((e=>{null===n?n=r:(n["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"]={},n=n["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"]),n["http://www.w3.org/1999/02/22-rdf-syntax-ns#first"]=ur(e,!0),n["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"]={"@id":"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"}})),r}if((i=s())!==o&&St===t.length)return i;throw i!==o&&St<t.length&&Rt({type:"end"}),function(t,r,n){return new e(e.buildMessage(t,r),t,r,n)}(Ot,Tt<t.length?t.charAt(Tt):null,Tt<t.length?jt(Tt,Tt+1):jt(Tt,Tt))}}})?n.apply(t,[]):n)||(e.exports=i)},5036:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CordovaIFrameNavigator:()=>n.CordovaIFrameNavigator,CordovaPopupNavigator:()=>n.CordovaPopupNavigator,InMemoryWebStorage:()=>n.InMemoryWebStorage,Log:()=>n.Log,OidcClient:()=>n.OidcClient,SessionMonitor:()=>n.SessionMonitor,User:()=>n.User,UserManager:()=>n.UserManager,Version:()=>n.Version,WebStorageStateStore:()=>n.WebStorageStateStore,clearOidcPersistentStorage:()=>F,getBearerToken:()=>C,getDpopToken:()=>T,refresh:()=>O,registerClient:()=>k,removeOidcQueryParam:()=>P});var n=r(1478);r(7187),globalThis.fetch;const{fetch:i,Response:o,Request:a,Headers:s}=globalThis;var c=r(1548);const u={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let l;const d=new Uint8Array(16);function p(){if(!l&&(l="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!l))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return l(d)}const f=[];for(let e=0;e<256;++e)f.push((e+256).toString(16).slice(1));const h=function(e,t,r){if(u.randomUUID&&!t&&!e)return u.randomUUID();const n=(e=e||{}).random||(e.rng||p)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return function(e,t=0){return(f[e[t+0]]+f[e[t+1]]+f[e[t+2]]+f[e[t+3]]+"-"+f[e[t+4]]+f[e[t+5]]+"-"+f[e[t+6]]+f[e[t+7]]+"-"+f[e[t+8]]+f[e[t+9]]+"-"+f[e[t+10]]+f[e[t+11]]+f[e[t+12]]+f[e[t+13]]+f[e[t+14]]+f[e[t+15]]).toLowerCase()}(n)},m=["ES256","RS256"],g=["openid","offline_access","webid"].join(" ");async function v(e,t,r,n){const o=await async function(e,t){const r=await i(e);if(200!==r.status)throw new Error(`Could not fetch JWKS for [${t}] at [${e}]: ${r.status} ${r.statusText}`);let n;try{n=(await r.json()).keys[0]}catch(r){throw new Error(`Malformed JWKS for [${t}] at [${e}]: ${r.message}`)}return n}(t,r);let a;try{const{payload:t}=await(0,c.jwtVerify)(e,await(0,c.importJWK)(o),{issuer:r,audience:n});a=t}catch(e){throw new Error(`Token verification failed: ${e.stack}`)}if("string"==typeof a.webid)return a.webid;if("string"!=typeof a.sub)throw new Error(`The token ${JSON.stringify(a)} is invalid: it has no 'webid' claim and no 'sub' claim.`);try{return new URL(a.sub),a.sub}catch(e){throw new Error(`The token has no 'webid' claim, and its 'sub' claim of [${a.sub}] is invalid as a URL - error [${e}].`)}}class y extends Error{constructor(e){super(e)}}class b extends Error{constructor(e){super(`[${e}] is not implemented`)}}class w extends Error{constructor(e){super(`Invalid response from OIDC provider: missing fields ${e}`),this.missingFields=e}}class x extends Error{constructor(e,t,r){super(e),this.error=t,this.errorDescription=r}}function _(e){const t=new URL(e);return new URL(t.pathname,t.origin).toString()}async function E(e,t,r){return new c.SignJWT({htu:_(e),htm:t.toUpperCase(),jti:h()}).setProtectedHeader({alg:m[0],jwk:r.publicKey,typ:"dpop+jwt"}).setIssuedAt().sign(r.privateKey,{})}async function k(e,t){var r;if(!t.registrationEndpoint)throw new Error("Dynamic Registration could not be completed because the issuer has no registration endpoint.");if(!Array.isArray(t.idTokenSigningAlgValuesSupported))throw new Error("The OIDC issuer discovery profile is missing the 'id_token_signing_alg_values_supported' value, which is mandatory.");const n=function(e,t){var r;return null!==(r=t.find((t=>e.includes(t))))&&void 0!==r?r:null}(t.idTokenSigningAlgValuesSupported,m),i={client_name:e.clientName,application_type:"web",redirect_uris:[null===(r=e.redirectUrl)||void 0===r?void 0:r.toString()],subject_type:"public",token_endpoint_auth_method:"client_secret_basic",id_token_signed_response_alg:n,grant_types:["authorization_code","refresh_token"]},o=await fetch(t.registrationEndpoint.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(o.ok){const t=await o.json();return function(e,t){if(void 0===e.client_id)throw new Error(`Dynamic client registration failed: no client_id has been found on ${JSON.stringify(e)}`);if(t.redirectUrl&&(void 0===e.redirect_uris||e.redirect_uris[0]!==t.redirectUrl.toString()))throw new Error(`Dynamic client registration failed: the returned redirect URIs ${JSON.stringify(e.redirect_uris)} don't match the provided ${JSON.stringify([t.redirectUrl.toString()])}`)}(t,e),{clientId:t.client_id,clientSecret:t.client_secret,idTokenSignedResponseAlg:t.id_token_signed_response_alg,clientType:"dynamic"}}throw 400===o.status&&function(e,t){var r,n,i,o;if("invalid_redirect_uri"===e.error)throw new Error(`Dynamic client registration failed: the provided redirect uri [${null===(r=t.redirectUrl)||void 0===r?void 0:r.toString()}] is invalid - ${null!==(n=e.error_description)&&void 0!==n?n:""}`);if("invalid_client_metadata"===e.error)throw new Error(`Dynamic client registration failed: the provided client metadata ${JSON.stringify(t)} is invalid - ${null!==(i=e.error_description)&&void 0!==i?i:""}`);throw new Error(`Dynamic client registration failed: ${e.error} - ${null!==(o=e.error_description)&&void 0!==o?o:""}`)}(await o.json(),e),new Error(`Dynamic client registration failed: the server returned ${o.status} ${o.statusText} - ${await o.text()}`)}function S(e){return void 0!==e.error_description&&"string"==typeof e.error_description}function A(e,t){if(void 0!==(r=e).error&&"string"==typeof r.error)throw new x(`Token endpoint returned error [${e.error}]${S(e)?`: ${e.error_description}`:""}${function(e){return void 0!==e.error_uri&&"string"==typeof e.error_uri}(e)?` (see ${e.error_uri})`:""}`,e.error,S(e)?e.error_description:void 0);var r;if(!function(e){return void 0!==e.access_token&&"string"==typeof e.access_token}(e))throw new w(["access_token"]);if(!function(e){return void 0!==e.id_token&&"string"==typeof e.id_token}(e))throw new w(["id_token"]);if(!function(e){return void 0!==e.token_type&&"string"==typeof e.token_type}(e))throw new w(["token_type"]);if(!function(e){return void 0===e.expires_in||"number"==typeof e.expires_in}(e))throw new w(["expires_in"]);if(!t&&"bearer"!==e.token_type.toLowerCase())throw new Error(`Invalid token endpoint response: requested a [Bearer] token, but got a 'token_type' value of [${e.token_type}].`);return e}async function C(e){let t;try{const r=new n.OidcClient({response_mode:"query",loadUserInfo:!1});if(t=await r.processSigninResponse(e),void 0===r.settings.metadata)throw new Error("Cannot retrieve issuer metadata from client information in storage.");if(void 0===r.settings.metadata.jwks_uri)throw new Error("Missing some issuer metadata from client information in storage: 'jwks_uri' is undefined");if(void 0===r.settings.metadata.issuer)throw new Error("Missing some issuer metadata from client information in storage: 'issuer' is undefined");if(void 0===r.settings.client_id)throw new Error("Missing some client information in storage: 'client_id' is undefined");const i=await v(t.id_token,r.settings.metadata.jwks_uri,r.settings.metadata.issuer,r.settings.client_id);return{accessToken:t.access_token,idToken:t.id_token,webId:i,refreshToken:t.refresh_token}}catch(t){throw new Error(`Problem handling Auth Code Grant (Flow) redirect - URL [${e}]: ${t}`)}}async function T(e,t,r){return async function(e,t,r,n){!function(e,t){if(t.grantType&&(!e.grantTypesSupported||!e.grantTypesSupported.includes(t.grantType)))throw new Error(`The issuer [${e.issuer}] does not support the [${t.grantType}] grant`);if(!e.tokenEndpoint)throw new Error(`This issuer [${e.issuer}] does not have a token endpoint`)}(e,r);const o={"content-type":"application/x-www-form-urlencoded"};let a;n&&(a=await async function(){const{privateKey:e,publicKey:t}=await(0,c.generateKeyPair)(m[0]),r={privateKey:e,publicKey:await(0,c.exportJWK)(t)};return[r.publicKey.alg]=m,r}(),o.DPoP=await E(e.tokenEndpoint,"POST",a)),t.clientSecret&&(o.Authorization=`Basic ${btoa(`${t.clientId}:${t.clientSecret}`)}`);const s={grant_type:r.grantType,redirect_uri:r.redirectUrl,code:r.code,code_verifier:r.codeVerifier,client_id:t.clientId},u={method:"POST",headers:o,body:new URLSearchParams(s).toString()},l=await i(e.tokenEndpoint,u),d=A(await l.json(),n),p=await v(d.id_token,e.jwksUri,e.issuer,t.clientId);return{accessToken:d.access_token,idToken:d.id_token,refreshToken:(f=d,void 0!==f.refresh_token&&"string"==typeof f.refresh_token?d.refresh_token:void 0),webId:p,dpopKey:a,expiresIn:d.expires_in};var f}(e,t,r,!0)}async function O(e,t,r,n){if(void 0===r.clientId)throw new Error("No client ID available when trying to refresh the access token.");const o={grant_type:"refresh_token",refresh_token:e,scope:g};let a={};void 0!==n&&(a={DPoP:await E(t.tokenEndpoint,"POST",n)});let s={};void 0!==r.clientSecret?s={Authorization:`Basic ${btoa(`${r.clientId}:${r.clientSecret}`)}`}:(e=>{try{return new URL(e),!0}catch(e){return!1}})(r.clientId)&&(o.client_id=r.clientId);const c=await i(t.tokenEndpoint,{method:"POST",body:new URLSearchParams(o).toString(),headers:{...a,...s,"Content-Type":"application/x-www-form-urlencoded"}});let u;try{u=await c.json()}catch(e){throw new Error(`The token endpoint of issuer ${t.issuer} returned a malformed response.`)}const l=A(u,void 0!==n),d=await v(l.id_token,t.jwksUri,t.issuer,r.clientId);return{accessToken:l.access_token,idToken:l.id_token,refreshToken:"string"==typeof l.refresh_token?l.refresh_token:void 0,webId:d,dpopKey:n,expiresIn:l.expires_in}}function P(e){const t=new URL(e);return t.searchParams.delete("code"),t.searchParams.delete("state"),t.hash="",e.includes(`${t.origin}/`)?t.href:`${t.origin}${t.href.substring(t.origin.length+1)}`}async function F(){const e=new n.OidcClient({response_mode:"query"});await e.clearStaleState(new n.WebStorageStateStore({}));const t=window.localStorage,r=[];for(let e=0;e<=t.length;e+=1){const n=t.key(e);n&&(n.match(/^oidc\..+$/)||n.match(/^solidClientAuthenticationUser:.+$/))&&r.push(n)}r.forEach((e=>t.removeItem(e)))}},1478:function(e){var t;t=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=22)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i={debug:function(){},info:function(){},warn:function(){},error:function(){}},o=void 0,a=void 0;(t.Log=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.reset=function(){a=3,o=i},e.debug=function(){if(a>=4){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];o.debug.apply(o,Array.from(t))}},e.info=function(){if(a>=3){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];o.info.apply(o,Array.from(t))}},e.warn=function(){if(a>=2){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];o.warn.apply(o,Array.from(t))}},e.error=function(){if(a>=1){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];o.error.apply(o,Array.from(t))}},n(e,null,[{key:"NONE",get:function(){return 0}},{key:"ERROR",get:function(){return 1}},{key:"WARN",get:function(){return 2}},{key:"INFO",get:function(){return 3}},{key:"DEBUG",get:function(){return 4}},{key:"level",get:function(){return a},set:function(e){if(!(0<=e&&e<=4))throw new Error("Invalid log level");a=e}},{key:"logger",get:function(){return o},set:function(e){if(!e.debug&&e.info&&(e.debug=e.info),!(e.debug&&e.info&&e.warn&&e.error))throw new Error("Invalid logger");o=e}}]),e}()).reset()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i={setInterval:function(e){function t(t,r){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t){return setInterval(e,t)})),clearInterval:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return clearInterval(e)}))},o=!1,a=null;t.Global=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e._testing=function(){o=!0},e.setXMLHttpRequest=function(e){a=e},n(e,null,[{key:"location",get:function(){if(!o)return location}},{key:"localStorage",get:function(){if(!o&&"undefined"!=typeof window)return localStorage}},{key:"sessionStorage",get:function(){if(!o&&"undefined"!=typeof window)return sessionStorage}},{key:"XMLHttpRequest",get:function(){if(!o&&"undefined"!=typeof window)return a||XMLHttpRequest}},{key:"timer",get:function(){if(!o)return i}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MetadataService=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),o=r(7);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=".well-known/openid-configuration";t.MetadataService=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.JsonService;if(a(this,e),!t)throw i.Log.error("MetadataService: No settings passed to MetadataService"),new Error("settings");this._settings=t,this._jsonService=new r(["application/jwk-set+json"])}return e.prototype.resetSigningKeys=function(){this._settings=this._settings||{},this._settings.signingKeys=void 0},e.prototype.getMetadata=function(){var e=this;return this._settings.metadata?(i.Log.debug("MetadataService.getMetadata: Returning metadata from settings"),Promise.resolve(this._settings.metadata)):this.metadataUrl?(i.Log.debug("MetadataService.getMetadata: getting metadata from",this.metadataUrl),this._jsonService.getJson(this.metadataUrl).then((function(t){i.Log.debug("MetadataService.getMetadata: json received");var r=e._settings.metadataSeed||{};return e._settings.metadata=Object.assign({},r,t),e._settings.metadata}))):(i.Log.error("MetadataService.getMetadata: No authority or metadataUrl configured on settings"),Promise.reject(new Error("No authority or metadataUrl configured on settings")))},e.prototype.getIssuer=function(){return this._getMetadataProperty("issuer")},e.prototype.getAuthorizationEndpoint=function(){return this._getMetadataProperty("authorization_endpoint")},e.prototype.getUserInfoEndpoint=function(){return this._getMetadataProperty("userinfo_endpoint")},e.prototype.getTokenEndpoint=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._getMetadataProperty("token_endpoint",e)},e.prototype.getCheckSessionIframe=function(){return this._getMetadataProperty("check_session_iframe",!0)},e.prototype.getEndSessionEndpoint=function(){return this._getMetadataProperty("end_session_endpoint",!0)},e.prototype.getRevocationEndpoint=function(){return this._getMetadataProperty("revocation_endpoint",!0)},e.prototype.getKeysEndpoint=function(){return this._getMetadataProperty("jwks_uri",!0)},e.prototype._getMetadataProperty=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return i.Log.debug("MetadataService.getMetadataProperty for: "+e),this.getMetadata().then((function(r){if(i.Log.debug("MetadataService.getMetadataProperty: metadata recieved"),void 0===r[e]){if(!0===t)return void i.Log.warn("MetadataService.getMetadataProperty: Metadata does not contain optional property "+e);throw i.Log.error("MetadataService.getMetadataProperty: Metadata does not contain property "+e),new Error("Metadata does not contain property "+e)}return r[e]}))},e.prototype.getSigningKeys=function(){var e=this;return this._settings.signingKeys?(i.Log.debug("MetadataService.getSigningKeys: Returning signingKeys from settings"),Promise.resolve(this._settings.signingKeys)):this._getMetadataProperty("jwks_uri").then((function(t){return i.Log.debug("MetadataService.getSigningKeys: jwks_uri received",t),e._jsonService.getJson(t).then((function(t){if(i.Log.debug("MetadataService.getSigningKeys: key set received",t),!t.keys)throw i.Log.error("MetadataService.getSigningKeys: Missing keys on keyset"),new Error("Missing keys on keyset");return e._settings.signingKeys=t.keys,e._settings.signingKeys}))}))},n(e,[{key:"metadataUrl",get:function(){return this._metadataUrl||(this._settings.metadataUrl?this._metadataUrl=this._settings.metadataUrl:(this._metadataUrl=this._settings.authority,this._metadataUrl&&this._metadataUrl.indexOf(s)<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=s))),this._metadataUrl}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UrlUtility=void 0;var n=r(0),i=r(1);t.UrlUtility=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.addQueryParam=function(e,t,r){return e.indexOf("?")<0&&(e+="?"),"?"!==e[e.length-1]&&(e+="&"),e+=encodeURIComponent(t),(e+="=")+encodeURIComponent(r)},e.parseUrlFragment=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.Global;"string"!=typeof e&&(e=r.location.href);var o=e.lastIndexOf(t);o>=0&&(e=e.substr(o+1)),"?"===t&&(o=e.indexOf("#"))>=0&&(e=e.substr(0,o));for(var a,s={},c=/([^&=]+)=([^&]*)/g,u=0;a=c.exec(e);)if(s[decodeURIComponent(a[1])]=decodeURIComponent(a[2].replace(/\+/g," ")),u++>50)return n.Log.error("UrlUtility.parseUrlFragment: response exceeded expected number of parameters",e),{error:"Response exceeded expected number of parameters"};for(var l in s)return s;return{}},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JoseUtil=void 0;var n=r(26),i=function(e){return e&&e.__esModule?e:{default:e}}(r(33));t.JoseUtil=(0,i.default)({jws:n.jws,KeyUtil:n.KeyUtil,X509:n.X509,crypto:n.crypto,hextob64u:n.hextob64u,b64tohex:n.b64tohex,AllowedSigningAlgs:n.AllowedSigningAlgs})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OidcClientSettings=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(0),a=r(23),s=r(6),c=r(24),u=r(2);function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var d=".well-known/openid-configuration",p="id_token",f="openid",h="client_secret_post";t.OidcClientSettings=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.authority,i=t.metadataUrl,o=t.metadata,d=t.signingKeys,m=t.metadataSeed,g=t.client_id,v=t.client_secret,y=t.response_type,b=void 0===y?p:y,w=t.scope,x=void 0===w?f:w,_=t.redirect_uri,E=t.post_logout_redirect_uri,k=t.client_authentication,S=void 0===k?h:k,A=t.prompt,C=t.display,T=t.max_age,O=t.ui_locales,P=t.acr_values,F=t.resource,I=t.response_mode,N=t.filterProtocolClaims,j=void 0===N||N,R=t.loadUserInfo,L=void 0===R||R,D=t.staleStateAge,M=void 0===D?900:D,U=t.clockSkew,B=void 0===U?300:U,H=t.clockService,q=void 0===H?new a.ClockService:H,K=t.userInfoJwtIssuer,W=void 0===K?"OP":K,V=t.mergeClaims,z=void 0!==V&&V,J=t.stateStore,Z=void 0===J?new s.WebStorageStateStore:J,$=t.ResponseValidatorCtor,G=void 0===$?c.ResponseValidator:$,X=t.MetadataServiceCtor,Y=void 0===X?u.MetadataService:X,Q=t.extraQueryParams,ee=void 0===Q?{}:Q,te=t.extraTokenParams,re=void 0===te?{}:te;l(this,e),this._authority=r,this._metadataUrl=i,this._metadata=o,this._metadataSeed=m,this._signingKeys=d,this._client_id=g,this._client_secret=v,this._response_type=b,this._scope=x,this._redirect_uri=_,this._post_logout_redirect_uri=E,this._client_authentication=S,this._prompt=A,this._display=C,this._max_age=T,this._ui_locales=O,this._acr_values=P,this._resource=F,this._response_mode=I,this._filterProtocolClaims=!!j,this._loadUserInfo=!!L,this._staleStateAge=M,this._clockSkew=B,this._clockService=q,this._userInfoJwtIssuer=W,this._mergeClaims=!!z,this._stateStore=Z,this._validator=new G(this),this._metadataService=new Y(this),this._extraQueryParams="object"===(void 0===ee?"undefined":n(ee))?ee:{},this._extraTokenParams="object"===(void 0===re?"undefined":n(re))?re:{}}return e.prototype.getEpochTime=function(){return this._clockService.getEpochTime()},i(e,[{key:"client_id",get:function(){return this._client_id},set:function(e){if(this._client_id)throw o.Log.error("OidcClientSettings.set_client_id: client_id has already been assigned."),new Error("client_id has already been assigned.");this._client_id=e}},{key:"client_secret",get:function(){return this._client_secret}},{key:"response_type",get:function(){return this._response_type}},{key:"scope",get:function(){return this._scope}},{key:"redirect_uri",get:function(){return this._redirect_uri}},{key:"post_logout_redirect_uri",get:function(){return this._post_logout_redirect_uri}},{key:"client_authentication",get:function(){return this._client_authentication}},{key:"prompt",get:function(){return this._prompt}},{key:"display",get:function(){return this._display}},{key:"max_age",get:function(){return this._max_age}},{key:"ui_locales",get:function(){return this._ui_locales}},{key:"acr_values",get:function(){return this._acr_values}},{key:"resource",get:function(){return this._resource}},{key:"response_mode",get:function(){return this._response_mode}},{key:"authority",get:function(){return this._authority},set:function(e){if(this._authority)throw o.Log.error("OidcClientSettings.set_authority: authority has already been assigned."),new Error("authority has already been assigned.");this._authority=e}},{key:"metadataUrl",get:function(){return this._metadataUrl||(this._metadataUrl=this.authority,this._metadataUrl&&this._metadataUrl.indexOf(d)<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=d)),this._metadataUrl}},{key:"metadata",get:function(){return this._metadata},set:function(e){this._metadata=e}},{key:"metadataSeed",get:function(){return this._metadataSeed},set:function(e){this._metadataSeed=e}},{key:"signingKeys",get:function(){return this._signingKeys},set:function(e){this._signingKeys=e}},{key:"filterProtocolClaims",get:function(){return this._filterProtocolClaims}},{key:"loadUserInfo",get:function(){return this._loadUserInfo}},{key:"staleStateAge",get:function(){return this._staleStateAge}},{key:"clockSkew",get:function(){return this._clockSkew}},{key:"userInfoJwtIssuer",get:function(){return this._userInfoJwtIssuer}},{key:"mergeClaims",get:function(){return this._mergeClaims}},{key:"stateStore",get:function(){return this._stateStore}},{key:"validator",get:function(){return this._validator}},{key:"metadataService",get:function(){return this._metadataService}},{key:"extraQueryParams",get:function(){return this._extraQueryParams},set:function(e){"object"===(void 0===e?"undefined":n(e))?this._extraQueryParams=e:this._extraQueryParams={}}},{key:"extraTokenParams",get:function(){return this._extraTokenParams},set:function(e){"object"===(void 0===e?"undefined":n(e))?this._extraTokenParams=e:this._extraTokenParams={}}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebStorageStateStore=void 0;var n=r(0),i=r(1);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.WebStorageStateStore=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.prefix,n=void 0===r?"oidc.":r,a=t.store,s=void 0===a?i.Global.localStorage:a;o(this,e),this._store=s,this._prefix=n}return e.prototype.set=function(e,t){return n.Log.debug("WebStorageStateStore.set",e),e=this._prefix+e,this._store.setItem(e,t),Promise.resolve()},e.prototype.get=function(e){n.Log.debug("WebStorageStateStore.get",e),e=this._prefix+e;var t=this._store.getItem(e);return Promise.resolve(t)},e.prototype.remove=function(e){n.Log.debug("WebStorageStateStore.remove",e),e=this._prefix+e;var t=this._store.getItem(e);return this._store.removeItem(e),Promise.resolve(t)},e.prototype.getAllKeys=function(){n.Log.debug("WebStorageStateStore.getAllKeys");for(var e=[],t=0;t<this._store.length;t++){var r=this._store.key(t);0===r.indexOf(this._prefix)&&e.push(r.substr(this._prefix.length))}return Promise.resolve(e)},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JsonService=void 0;var n=r(0),i=r(1);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.JsonService=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.Global.XMLHttpRequest,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;o(this,e),t&&Array.isArray(t)?this._contentTypes=t.slice():this._contentTypes=[],this._contentTypes.push("application/json"),n&&this._contentTypes.push("application/jwt"),this._XMLHttpRequest=r,this._jwtHandler=n}return e.prototype.getJson=function(e,t){var r=this;if(!e)throw n.Log.error("JsonService.getJson: No url passed"),new Error("url");return n.Log.debug("JsonService.getJson, url: ",e),new Promise((function(i,o){var a=new r._XMLHttpRequest;a.open("GET",e);var s=r._contentTypes,c=r._jwtHandler;a.onload=function(){if(n.Log.debug("JsonService.getJson: HTTP response received, status",a.status),200===a.status){var t=a.getResponseHeader("Content-Type");if(t){var r=s.find((function(e){if(t.startsWith(e))return!0}));if("application/jwt"==r)return void c(a).then(i,o);if(r)try{return void i(JSON.parse(a.responseText))}catch(e){return n.Log.error("JsonService.getJson: Error parsing JSON response",e.message),void o(e)}}o(Error("Invalid response Content-Type: "+t+", from URL: "+e))}else o(Error(a.statusText+" ("+a.status+")"))},a.onerror=function(){n.Log.error("JsonService.getJson: network error"),o(Error("Network Error"))},t&&(n.Log.debug("JsonService.getJson: token passed, setting Authorization header"),a.setRequestHeader("Authorization","Bearer "+t)),a.send()}))},e.prototype.postForm=function(e,t,r){var i=this;if(!e)throw n.Log.error("JsonService.postForm: No url passed"),new Error("url");return n.Log.debug("JsonService.postForm, url: ",e),new Promise((function(o,a){var s=new i._XMLHttpRequest;s.open("POST",e);var c=i._contentTypes;s.onload=function(){if(n.Log.debug("JsonService.postForm: HTTP response received, status",s.status),200!==s.status){if(400===s.status&&(r=s.getResponseHeader("Content-Type"))&&c.find((function(e){if(r.startsWith(e))return!0})))try{var t=JSON.parse(s.responseText);if(t&&t.error)return n.Log.error("JsonService.postForm: Error from server: ",t.error),void a(new Error(t.error))}catch(e){return n.Log.error("JsonService.postForm: Error parsing JSON response",e.message),void a(e)}a(Error(s.statusText+" ("+s.status+")"))}else{var r;if((r=s.getResponseHeader("Content-Type"))&&c.find((function(e){if(r.startsWith(e))return!0})))try{return void o(JSON.parse(s.responseText))}catch(e){return n.Log.error("JsonService.postForm: Error parsing JSON response",e.message),void a(e)}a(Error("Invalid response Content-Type: "+r+", from URL: "+e))}},s.onerror=function(){n.Log.error("JsonService.postForm: network error"),a(Error("Network Error"))};var u="";for(var l in t){var d=t[l];d&&(u.length>0&&(u+="&"),u+=encodeURIComponent(l),u+="=",u+=encodeURIComponent(d))}s.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),void 0!==r&&s.setRequestHeader("Authorization","Basic "+btoa(r)),s.send(u)}))},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SigninRequest=void 0;var n=r(0),i=r(3),o=r(13);t.SigninRequest=function(){function e(t){var r=t.url,a=t.client_id,s=t.redirect_uri,c=t.response_type,u=t.scope,l=t.authority,d=t.data,p=t.prompt,f=t.display,h=t.max_age,m=t.ui_locales,g=t.id_token_hint,v=t.login_hint,y=t.acr_values,b=t.resource,w=t.response_mode,x=t.request,_=t.request_uri,E=t.extraQueryParams,k=t.request_type,S=t.client_secret,A=t.extraTokenParams,C=t.skipUserInfo;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!r)throw n.Log.error("SigninRequest.ctor: No url passed"),new Error("url");if(!a)throw n.Log.error("SigninRequest.ctor: No client_id passed"),new Error("client_id");if(!s)throw n.Log.error("SigninRequest.ctor: No redirect_uri passed"),new Error("redirect_uri");if(!c)throw n.Log.error("SigninRequest.ctor: No response_type passed"),new Error("response_type");if(!u)throw n.Log.error("SigninRequest.ctor: No scope passed"),new Error("scope");if(!l)throw n.Log.error("SigninRequest.ctor: No authority passed"),new Error("authority");var T=e.isOidc(c),O=e.isCode(c);w||(w=e.isCode(c)?"query":null),this.state=new o.SigninState({nonce:T,data:d,client_id:a,authority:l,redirect_uri:s,code_verifier:O,request_type:k,response_mode:w,client_secret:S,scope:u,extraTokenParams:A,skipUserInfo:C}),r=i.UrlUtility.addQueryParam(r,"client_id",a),r=i.UrlUtility.addQueryParam(r,"redirect_uri",s),r=i.UrlUtility.addQueryParam(r,"response_type",c),r=i.UrlUtility.addQueryParam(r,"scope",u),r=i.UrlUtility.addQueryParam(r,"state",this.state.id),T&&(r=i.UrlUtility.addQueryParam(r,"nonce",this.state.nonce)),O&&(r=i.UrlUtility.addQueryParam(r,"code_challenge",this.state.code_challenge),r=i.UrlUtility.addQueryParam(r,"code_challenge_method","S256"));var P={prompt:p,display:f,max_age:h,ui_locales:m,id_token_hint:g,login_hint:v,acr_values:y,resource:b,request:x,request_uri:_,response_mode:w};for(var F in P)P[F]&&(r=i.UrlUtility.addQueryParam(r,F,P[F]));for(var I in E)r=i.UrlUtility.addQueryParam(r,I,E[I]);this.url=r}return e.isOidc=function(e){return!!e.split(/\s+/g).filter((function(e){return"id_token"===e}))[0]},e.isOAuth=function(e){return!!e.split(/\s+/g).filter((function(e){return"token"===e}))[0]},e.isCode=function(e){return!!e.split(/\s+/g).filter((function(e){return"code"===e}))[0]},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.State=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),o=function(e){return e&&e.__esModule?e:{default:e}}(r(14));function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.State=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.id,n=t.data,i=t.created,s=t.request_type;a(this,e),this._id=r||(0,o.default)(),this._data=n,this._created="number"==typeof i&&i>0?i:parseInt(Date.now()/1e3),this._request_type=s}return e.prototype.toStorageString=function(){return i.Log.debug("State.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})},e.fromStorageString=function(t){return i.Log.debug("State.fromStorageString"),new e(JSON.parse(t))},e.clearStaleState=function(t,r){var n=Date.now()/1e3-r;return t.getAllKeys().then((function(r){i.Log.debug("State.clearStaleState: got keys",r);for(var o=[],a=function(a){var s=r[a];c=t.get(s).then((function(r){var o=!1;if(r)try{var a=e.fromStorageString(r);i.Log.debug("State.clearStaleState: got item from key: ",s,a.created),a.created<=n&&(o=!0)}catch(e){i.Log.error("State.clearStaleState: Error parsing state for key",s,e.message),o=!0}else i.Log.debug("State.clearStaleState: no item in storage for key: ",s),o=!0;if(o)return i.Log.debug("State.clearStaleState: removed item for key: ",s),t.remove(s)})),o.push(c)},s=0;s<r.length;s++){var c;a(s)}return i.Log.debug("State.clearStaleState: waiting on promise count:",o.length),Promise.all(o)}))},n(e,[{key:"id",get:function(){return this._id}},{key:"data",get:function(){return this._data}},{key:"created",get:function(){return this._created}},{key:"request_type",get:function(){return this._request_type}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OidcClient=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),o=r(5),a=r(12),s=r(8),c=r(34),u=r(35),l=r(36),d=r(13),p=r(9);function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.OidcClient=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};f(this,e),t instanceof o.OidcClientSettings?this._settings=t:this._settings=new o.OidcClientSettings(t)}return e.prototype.createSigninRequest=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.response_type,n=t.scope,o=t.redirect_uri,a=t.data,c=t.state,u=t.prompt,l=t.display,d=t.max_age,p=t.ui_locales,f=t.id_token_hint,h=t.login_hint,m=t.acr_values,g=t.resource,v=t.request,y=t.request_uri,b=t.response_mode,w=t.extraQueryParams,x=t.extraTokenParams,_=t.request_type,E=t.skipUserInfo,k=arguments[1];i.Log.debug("OidcClient.createSigninRequest");var S=this._settings.client_id;r=r||this._settings.response_type,n=n||this._settings.scope,o=o||this._settings.redirect_uri,u=u||this._settings.prompt,l=l||this._settings.display,d=d||this._settings.max_age,p=p||this._settings.ui_locales,m=m||this._settings.acr_values,g=g||this._settings.resource,b=b||this._settings.response_mode,w=w||this._settings.extraQueryParams,x=x||this._settings.extraTokenParams;var A=this._settings.authority;return s.SigninRequest.isCode(r)&&"code"!==r?Promise.reject(new Error("OpenID Connect hybrid flow is not supported")):this._metadataService.getAuthorizationEndpoint().then((function(t){i.Log.debug("OidcClient.createSigninRequest: Received authorization endpoint",t);var C=new s.SigninRequest({url:t,client_id:S,redirect_uri:o,response_type:r,scope:n,data:a||c,authority:A,prompt:u,display:l,max_age:d,ui_locales:p,id_token_hint:f,login_hint:h,acr_values:m,resource:g,request:v,request_uri:y,extraQueryParams:w,extraTokenParams:x,request_type:_,response_mode:b,client_secret:e._settings.client_secret,skipUserInfo:E}),T=C.state;return(k=k||e._stateStore).set(T.id,T.toStorageString()).then((function(){return C}))}))},e.prototype.readSigninResponseState=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];i.Log.debug("OidcClient.readSigninResponseState");var n="query"===this._settings.response_mode||!this._settings.response_mode&&s.SigninRequest.isCode(this._settings.response_type),o=n?"?":"#",a=new c.SigninResponse(e,o);if(!a.state)return i.Log.error("OidcClient.readSigninResponseState: No state in response"),Promise.reject(new Error("No state in response"));t=t||this._stateStore;var u=r?t.remove.bind(t):t.get.bind(t);return u(a.state).then((function(e){if(!e)throw i.Log.error("OidcClient.readSigninResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:d.SigninState.fromStorageString(e),response:a}}))},e.prototype.processSigninResponse=function(e,t){var r=this;return i.Log.debug("OidcClient.processSigninResponse"),this.readSigninResponseState(e,t,!0).then((function(e){var t=e.state,n=e.response;return i.Log.debug("OidcClient.processSigninResponse: Received state from storage; validating response"),r._validator.validateSigninResponse(t,n)}))},e.prototype.createSignoutRequest=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.id_token_hint,n=t.data,o=t.state,a=t.post_logout_redirect_uri,s=t.extraQueryParams,c=t.request_type,l=arguments[1];return i.Log.debug("OidcClient.createSignoutRequest"),a=a||this._settings.post_logout_redirect_uri,s=s||this._settings.extraQueryParams,this._metadataService.getEndSessionEndpoint().then((function(t){if(!t)throw i.Log.error("OidcClient.createSignoutRequest: No end session endpoint url returned"),new Error("no end session endpoint");i.Log.debug("OidcClient.createSignoutRequest: Received end session endpoint",t);var d=new u.SignoutRequest({url:t,id_token_hint:r,post_logout_redirect_uri:a,data:n||o,extraQueryParams:s,request_type:c}),p=d.state;return p&&(i.Log.debug("OidcClient.createSignoutRequest: Signout request has state to persist"),(l=l||e._stateStore).set(p.id,p.toStorageString())),d}))},e.prototype.readSignoutResponseState=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];i.Log.debug("OidcClient.readSignoutResponseState");var n=new l.SignoutResponse(e);if(!n.state)return i.Log.debug("OidcClient.readSignoutResponseState: No state in response"),n.error?(i.Log.warn("OidcClient.readSignoutResponseState: Response was error: ",n.error),Promise.reject(new a.ErrorResponse(n))):Promise.resolve({state:void 0,response:n});var o=n.state;t=t||this._stateStore;var s=r?t.remove.bind(t):t.get.bind(t);return s(o).then((function(e){if(!e)throw i.Log.error("OidcClient.readSignoutResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:p.State.fromStorageString(e),response:n}}))},e.prototype.processSignoutResponse=function(e,t){var r=this;return i.Log.debug("OidcClient.processSignoutResponse"),this.readSignoutResponseState(e,t,!0).then((function(e){var t=e.state,n=e.response;return t?(i.Log.debug("OidcClient.processSignoutResponse: Received state from storage; validating response"),r._validator.validateSignoutResponse(t,n)):(i.Log.debug("OidcClient.processSignoutResponse: No state from storage; skipping validating response"),n)}))},e.prototype.clearStaleState=function(e){return i.Log.debug("OidcClient.clearStaleState"),e=e||this._stateStore,p.State.clearStaleState(e,this.settings.staleStateAge)},n(e,[{key:"_stateStore",get:function(){return this.settings.stateStore}},{key:"_validator",get:function(){return this.settings.validator}},{key:"_metadataService",get:function(){return this.settings.metadataService}},{key:"settings",get:function(){return this._settings}},{key:"metadataService",get:function(){return this._metadataService}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClient=void 0;var n=r(7),i=r(2),o=r(0);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.TokenClient=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.JsonService,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.MetadataService;if(a(this,e),!t)throw o.Log.error("TokenClient.ctor: No settings passed"),new Error("settings");this._settings=t,this._jsonService=new r,this._metadataService=new s(this._settings)}return e.prototype.exchangeCode=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).grant_type=t.grant_type||"authorization_code",t.client_id=t.client_id||this._settings.client_id,t.client_secret=t.client_secret||this._settings.client_secret,t.redirect_uri=t.redirect_uri||this._settings.redirect_uri;var r=void 0,n=t._client_authentication||this._settings._client_authentication;return delete t._client_authentication,t.code?t.redirect_uri?t.code_verifier?t.client_id?t.client_secret||"client_secret_basic"!=n?("client_secret_basic"==n&&(r=t.client_id+":"+t.client_secret,delete t.client_id,delete t.client_secret),this._metadataService.getTokenEndpoint(!1).then((function(n){return o.Log.debug("TokenClient.exchangeCode: Received token endpoint"),e._jsonService.postForm(n,t,r).then((function(e){return o.Log.debug("TokenClient.exchangeCode: response received"),e}))}))):(o.Log.error("TokenClient.exchangeCode: No client_secret passed"),Promise.reject(new Error("A client_secret is required"))):(o.Log.error("TokenClient.exchangeCode: No client_id passed"),Promise.reject(new Error("A client_id is required"))):(o.Log.error("TokenClient.exchangeCode: No code_verifier passed"),Promise.reject(new Error("A code_verifier is required"))):(o.Log.error("TokenClient.exchangeCode: No redirect_uri passed"),Promise.reject(new Error("A redirect_uri is required"))):(o.Log.error("TokenClient.exchangeCode: No code passed"),Promise.reject(new Error("A code is required")))},e.prototype.exchangeRefreshToken=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).grant_type=t.grant_type||"refresh_token",t.client_id=t.client_id||this._settings.client_id,t.client_secret=t.client_secret||this._settings.client_secret;var r=void 0,n=t._client_authentication||this._settings._client_authentication;return delete t._client_authentication,t.refresh_token?t.client_id?("client_secret_basic"==n&&(r=t.client_id+":"+t.client_secret,delete t.client_id,delete t.client_secret),this._metadataService.getTokenEndpoint(!1).then((function(n){return o.Log.debug("TokenClient.exchangeRefreshToken: Received token endpoint"),e._jsonService.postForm(n,t,r).then((function(e){return o.Log.debug("TokenClient.exchangeRefreshToken: response received"),e}))}))):(o.Log.error("TokenClient.exchangeRefreshToken: No client_id passed"),Promise.reject(new Error("A client_id is required"))):(o.Log.error("TokenClient.exchangeRefreshToken: No refresh_token passed"),Promise.reject(new Error("A refresh_token is required")))},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorResponse=void 0;var n=r(0);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}t.ErrorResponse=function(e){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=r.error,s=r.error_description,c=r.error_uri,u=r.state,l=r.session_state;if(i(this,t),!a)throw n.Log.error("No error passed to ErrorResponse"),new Error("error");var d=o(this,e.call(this,s||a));return d.name="ErrorResponse",d.error=a,d.error_description=s,d.error_uri=c,d.state=u,d.session_state=l,d}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(Error)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SigninState=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),o=r(9),a=r(4),s=function(e){return e&&e.__esModule?e:{default:e}}(r(14));function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}t.SigninState=function(e){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.nonce,i=r.authority,o=r.client_id,l=r.redirect_uri,d=r.code_verifier,p=r.response_mode,f=r.client_secret,h=r.scope,m=r.extraTokenParams,g=r.skipUserInfo;c(this,t);var v=u(this,e.call(this,arguments[0]));if(!0===n?v._nonce=(0,s.default)():n&&(v._nonce=n),!0===d?v._code_verifier=(0,s.default)()+(0,s.default)()+(0,s.default)():d&&(v._code_verifier=d),v.code_verifier){var y=a.JoseUtil.hashString(v.code_verifier,"SHA256");v._code_challenge=a.JoseUtil.hexToBase64Url(y)}return v._redirect_uri=l,v._authority=i,v._client_id=o,v._response_mode=p,v._client_secret=f,v._scope=h,v._extraTokenParams=m,v._skipUserInfo=g,v}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.toStorageString=function(){return i.Log.debug("SigninState.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,nonce:this.nonce,code_verifier:this.code_verifier,redirect_uri:this.redirect_uri,authority:this.authority,client_id:this.client_id,response_mode:this.response_mode,client_secret:this.client_secret,scope:this.scope,extraTokenParams:this.extraTokenParams,skipUserInfo:this.skipUserInfo})},t.fromStorageString=function(e){return i.Log.debug("SigninState.fromStorageString"),new t(JSON.parse(e))},n(t,[{key:"nonce",get:function(){return this._nonce}},{key:"authority",get:function(){return this._authority}},{key:"client_id",get:function(){return this._client_id}},{key:"redirect_uri",get:function(){return this._redirect_uri}},{key:"code_verifier",get:function(){return this._code_verifier}},{key:"code_challenge",get:function(){return this._code_challenge}},{key:"response_mode",get:function(){return this._response_mode}},{key:"client_secret",get:function(){return this._client_secret}},{key:"scope",get:function(){return this._scope}},{key:"extraTokenParams",get:function(){return this._extraTokenParams}},{key:"skipUserInfo",get:function(){return this._skipUserInfo}}]),t}(o.State)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return("undefined"!=n&&null!==n&&void 0!==n.getRandomValues?i:o)().replace(/-/g,"")};var n="undefined"!=typeof window?window.crypto||window.msCrypto:null;function i(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(e){return(e^n.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)}))}function o(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(e){return(e^16*Math.random()>>e/4).toString(16)}))}e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.User=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0);t.User=function(){function e(t){var r=t.id_token,n=t.session_state,i=t.access_token,o=t.refresh_token,a=t.token_type,s=t.scope,c=t.profile,u=t.expires_at,l=t.state;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id_token=r,this.session_state=n,this.access_token=i,this.refresh_token=o,this.token_type=a,this.scope=s,this.profile=c,this.expires_at=u,this.state=l}return e.prototype.toStorageString=function(){return i.Log.debug("User.toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})},e.fromStorageString=function(t){return i.Log.debug("User.fromStorageString"),new e(JSON.parse(t))},n(e,[{key:"expires_in",get:function(){if(this.expires_at){var e=parseInt(Date.now()/1e3);return this.expires_at-e}},set:function(e){var t=parseInt(e);if("number"==typeof t&&t>0){var r=parseInt(Date.now()/1e3);this.expires_at=r+t}}},{key:"expired",get:function(){var e=this.expires_in;if(void 0!==e)return e<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccessTokenEvents=void 0;var n=r(0),i=r(46);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.AccessTokenEvents=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.accessTokenExpiringNotificationTime,n=void 0===r?60:r,a=t.accessTokenExpiringTimer,s=void 0===a?new i.Timer("Access token expiring"):a,c=t.accessTokenExpiredTimer,u=void 0===c?new i.Timer("Access token expired"):c;o(this,e),this._accessTokenExpiringNotificationTime=n,this._accessTokenExpiring=s,this._accessTokenExpired=u}return e.prototype.load=function(e){if(e.access_token&&void 0!==e.expires_in){var t=e.expires_in;if(n.Log.debug("AccessTokenEvents.load: access token present, remaining duration:",t),t>0){var r=t-this._accessTokenExpiringNotificationTime;r<=0&&(r=1),n.Log.debug("AccessTokenEvents.load: registering expiring timer in:",r),this._accessTokenExpiring.init(r)}else n.Log.debug("AccessTokenEvents.load: canceling existing expiring timer becase we're past expiration."),this._accessTokenExpiring.cancel();var i=t+1;n.Log.debug("AccessTokenEvents.load: registering expired timer in:",i),this._accessTokenExpired.init(i)}else this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},e.prototype.unload=function(){n.Log.debug("AccessTokenEvents.unload: canceling existing access token timers"),this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},e.prototype.addAccessTokenExpiring=function(e){this._accessTokenExpiring.addHandler(e)},e.prototype.removeAccessTokenExpiring=function(e){this._accessTokenExpiring.removeHandler(e)},e.prototype.addAccessTokenExpired=function(e){this._accessTokenExpired.addHandler(e)},e.prototype.removeAccessTokenExpired=function(e){this._accessTokenExpired.removeHandler(e)},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Event=void 0;var n=r(0);t.Event=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t,this._callbacks=[]}return e.prototype.addHandler=function(e){this._callbacks.push(e)},e.prototype.removeHandler=function(e){var t=this._callbacks.findIndex((function(t){return t===e}));t>=0&&this._callbacks.splice(t,1)},e.prototype.raise=function(){n.Log.debug("Event: Raising event: "+this._name);for(var e=0;e<this._callbacks.length;e++){var t;(t=this._callbacks)[e].apply(t,arguments)}},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionMonitor=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),o=r(19),a=r(1);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.SessionMonitor=function(){function e(t){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.CheckSessionIFrame,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.Global.timer;if(s(this,e),!t)throw i.Log.error("SessionMonitor.ctor: No user manager passed to SessionMonitor"),new Error("userManager");this._userManager=t,this._CheckSessionIFrameCtor=n,this._timer=c,this._userManager.events.addUserLoaded(this._start.bind(this)),this._userManager.events.addUserUnloaded(this._stop.bind(this)),Promise.resolve(this._userManager.getUser().then((function(e){e?r._start(e):r._settings.monitorAnonymousSession&&r._userManager.querySessionStatus().then((function(e){var t={session_state:e.session_state};e.sub&&e.sid&&(t.profile={sub:e.sub,sid:e.sid}),r._start(t)})).catch((function(e){i.Log.error("SessionMonitor ctor: error from querySessionStatus:",e.message)}))})).catch((function(e){i.Log.error("SessionMonitor ctor: error from getUser:",e.message)})))}return e.prototype._start=function(e){var t=this,r=e.session_state;r&&(e.profile?(this._sub=e.profile.sub,this._sid=e.profile.sid,i.Log.debug("SessionMonitor._start: session_state:",r,", sub:",this._sub)):(this._sub=void 0,this._sid=void 0,i.Log.debug("SessionMonitor._start: session_state:",r,", anonymous user")),this._checkSessionIFrame?this._checkSessionIFrame.start(r):this._metadataService.getCheckSessionIframe().then((function(e){if(e){i.Log.debug("SessionMonitor._start: Initializing check session iframe");var n=t._client_id,o=t._checkSessionInterval,a=t._stopCheckSessionOnError;t._checkSessionIFrame=new t._CheckSessionIFrameCtor(t._callback.bind(t),n,e,o,a),t._checkSessionIFrame.load().then((function(){t._checkSessionIFrame.start(r)}))}else i.Log.warn("SessionMonitor._start: No check session iframe found in the metadata")})).catch((function(e){i.Log.error("SessionMonitor._start: Error from getCheckSessionIframe:",e.message)})))},e.prototype._stop=function(){var e=this;if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&(i.Log.debug("SessionMonitor._stop"),this._checkSessionIFrame.stop()),this._settings.monitorAnonymousSession)var t=this._timer.setInterval((function(){e._timer.clearInterval(t),e._userManager.querySessionStatus().then((function(t){var r={session_state:t.session_state};t.sub&&t.sid&&(r.profile={sub:t.sub,sid:t.sid}),e._start(r)})).catch((function(e){i.Log.error("SessionMonitor: error from querySessionStatus:",e.message)}))}),1e3)},e.prototype._callback=function(){var e=this;this._userManager.querySessionStatus().then((function(t){var r=!0;t?t.sub===e._sub?(r=!1,e._checkSessionIFrame.start(t.session_state),t.sid===e._sid?i.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:",t.session_state):(i.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:",t.session_state),e._userManager.events._raiseUserSessionChanged())):i.Log.debug("SessionMonitor._callback: Different subject signed into OP:",t.sub):i.Log.debug("SessionMonitor._callback: Subject no longer signed into OP"),r&&(e._sub?(i.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed out event"),e._userManager.events._raiseUserSignedOut()):(i.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed in event"),e._userManager.events._raiseUserSignedIn()))})).catch((function(t){e._sub&&(i.Log.debug("SessionMonitor._callback: Error calling queryCurrentSigninSession; raising signed out event",t.message),e._userManager.events._raiseUserSignedOut())}))},n(e,[{key:"_settings",get:function(){return this._userManager.settings}},{key:"_metadataService",get:function(){return this._userManager.metadataService}},{key:"_client_id",get:function(){return this._settings.client_id}},{key:"_checkSessionInterval",get:function(){return this._settings.checkSessionInterval}},{key:"_stopCheckSessionOnError",get:function(){return this._settings.stopCheckSessionOnError}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CheckSessionIFrame=void 0;var n=r(0);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.CheckSessionIFrame=function(){function e(t,r,n,o){var a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];i(this,e),this._callback=t,this._client_id=r,this._url=n,this._interval=o||2e3,this._stopOnError=a;var s=n.indexOf("/",n.indexOf("//")+2);this._frame_origin=n.substr(0,s),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.style.display="none",this._frame.width=0,this._frame.height=0,this._frame.src=n}return e.prototype.load=function(){var e=this;return new Promise((function(t){e._frame.onload=function(){t()},window.document.body.appendChild(e._frame),e._boundMessageEvent=e._message.bind(e),window.addEventListener("message",e._boundMessageEvent,!1)}))},e.prototype._message=function(e){e.origin===this._frame_origin&&e.source===this._frame.contentWindow&&("error"===e.data?(n.Log.error("CheckSessionIFrame: error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===e.data?(n.Log.debug("CheckSessionIFrame: changed message from check session op iframe"),this.stop(),this._callback()):n.Log.debug("CheckSessionIFrame: "+e.data+" message from check session op iframe"))},e.prototype.start=function(e){var t=this;if(this._session_state!==e){n.Log.debug("CheckSessionIFrame.start"),this.stop(),this._session_state=e;var r=function(){t._frame.contentWindow.postMessage(t._client_id+" "+t._session_state,t._frame_origin)};r(),this._timer=window.setInterval(r,this._interval)}},e.prototype.stop=function(){this._session_state=null,this._timer&&(n.Log.debug("CheckSessionIFrame.stop"),window.clearInterval(this._timer),this._timer=null)},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenRevocationClient=void 0;var n=r(0),i=r(2),o=r(1);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s="access_token",c="refresh_token";t.TokenRevocationClient=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.Global.XMLHttpRequest,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.MetadataService;if(a(this,e),!t)throw n.Log.error("TokenRevocationClient.ctor: No settings provided"),new Error("No settings provided.");this._settings=t,this._XMLHttpRequestCtor=r,this._metadataService=new s(this._settings)}return e.prototype.revoke=function(e,t){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"access_token";if(!e)throw n.Log.error("TokenRevocationClient.revoke: No token provided"),new Error("No token provided.");if(i!==s&&i!=c)throw n.Log.error("TokenRevocationClient.revoke: Invalid token type"),new Error("Invalid token type.");return this._metadataService.getRevocationEndpoint().then((function(o){if(o){n.Log.debug("TokenRevocationClient.revoke: Revoking "+i);var a=r._settings.client_id,s=r._settings.client_secret;return r._revoke(o,a,s,e,i)}if(t)throw n.Log.error("TokenRevocationClient.revoke: Revocation not supported"),new Error("Revocation not supported")}))},e.prototype._revoke=function(e,t,r,i,o){var a=this;return new Promise((function(s,c){var u=new a._XMLHttpRequestCtor;u.open("POST",e),u.onload=function(){n.Log.debug("TokenRevocationClient.revoke: HTTP response received, status",u.status),200===u.status?s():c(Error(u.statusText+" ("+u.status+")"))},u.onerror=function(){n.Log.debug("TokenRevocationClient.revoke: Network Error."),c("Network Error")};var l="client_id="+encodeURIComponent(t);r&&(l+="&client_secret="+encodeURIComponent(r)),l+="&token_type_hint="+encodeURIComponent(o),l+="&token="+encodeURIComponent(i),u.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),u.send(l)}))},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CordovaPopupWindow=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0);t.CordovaPopupWindow=function(){function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._promise=new Promise((function(e,t){r._resolve=e,r._reject=t})),this.features=t.popupWindowFeatures||"location=no,toolbar=no,zoom=no",this.target=t.popupWindowTarget||"_blank",this.redirect_uri=t.startUrl,i.Log.debug("CordovaPopupWindow.ctor: redirect_uri: "+this.redirect_uri)}return e.prototype._isInAppBrowserInstalled=function(e){return["cordova-plugin-inappbrowser","cordova-plugin-inappbrowser.inappbrowser","org.apache.cordova.inappbrowser"].some((function(t){return e.hasOwnProperty(t)}))},e.prototype.navigate=function(e){if(e&&e.url){if(!window.cordova)return this._error("cordova is undefined");var t=window.cordova.require("cordova/plugin_list").metadata;if(!1===this._isInAppBrowserInstalled(t))return this._error("InAppBrowser plugin not found");this._popup=cordova.InAppBrowser.open(e.url,this.target,this.features),this._popup?(i.Log.debug("CordovaPopupWindow.navigate: popup successfully created"),this._exitCallbackEvent=this._exitCallback.bind(this),this._loadStartCallbackEvent=this._loadStartCallback.bind(this),this._popup.addEventListener("exit",this._exitCallbackEvent,!1),this._popup.addEventListener("loadstart",this._loadStartCallbackEvent,!1)):this._error("Error opening popup window")}else this._error("No url provided");return this.promise},e.prototype._loadStartCallback=function(e){0===e.url.indexOf(this.redirect_uri)&&this._success({url:e.url})},e.prototype._exitCallback=function(e){this._error(e)},e.prototype._success=function(e){this._cleanup(),i.Log.debug("CordovaPopupWindow: Successful response from cordova popup window"),this._resolve(e)},e.prototype._error=function(e){this._cleanup(),i.Log.error(e),this._reject(new Error(e))},e.prototype.close=function(){this._cleanup()},e.prototype._cleanup=function(){this._popup&&(i.Log.debug("CordovaPopupWindow: cleaning up popup"),this._popup.removeEventListener("exit",this._exitCallbackEvent,!1),this._popup.removeEventListener("loadstart",this._loadStartCallbackEvent,!1),this._popup.close()),this._popup=null},n(e,[{key:"promise",get:function(){return this._promise}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=r(10),o=r(5),a=r(6),s=r(37),c=r(38),u=r(16),l=r(2),d=r(48),p=r(49),f=r(19),h=r(20),m=r(18),g=r(1),v=r(15),y=r(50);t.default={Version:y.Version,Log:n.Log,OidcClient:i.OidcClient,OidcClientSettings:o.OidcClientSettings,WebStorageStateStore:a.WebStorageStateStore,InMemoryWebStorage:s.InMemoryWebStorage,UserManager:c.UserManager,AccessTokenEvents:u.AccessTokenEvents,MetadataService:l.MetadataService,CordovaPopupNavigator:d.CordovaPopupNavigator,CordovaIFrameNavigator:p.CordovaIFrameNavigator,CheckSessionIFrame:f.CheckSessionIFrame,TokenRevocationClient:h.TokenRevocationClient,SessionMonitor:m.SessionMonitor,Global:g.Global,User:v.User},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClockService=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.prototype.getEpochTime=function(){return Promise.resolve(Date.now()/1e3|0)},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResponseValidator=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(0),o=r(2),a=r(25),s=r(11),c=r(12),u=r(4);function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var d=["nonce","at_hash","iat","nbf","exp","aud","iss","c_hash"];t.ResponseValidator=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.MetadataService,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.UserInfoService,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:u.JoseUtil,d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:s.TokenClient;if(l(this,e),!t)throw i.Log.error("ResponseValidator.ctor: No settings passed to ResponseValidator"),new Error("settings");this._settings=t,this._metadataService=new r(this._settings),this._userInfoService=new n(this._settings),this._joseUtil=c,this._tokenClient=new d(this._settings)}return e.prototype.validateSigninResponse=function(e,t){var r=this;return i.Log.debug("ResponseValidator.validateSigninResponse"),this._processSigninParams(e,t).then((function(t){return i.Log.debug("ResponseValidator.validateSigninResponse: state processed"),r._validateTokens(e,t).then((function(t){return i.Log.debug("ResponseValidator.validateSigninResponse: tokens validated"),r._processClaims(e,t).then((function(e){return i.Log.debug("ResponseValidator.validateSigninResponse: claims processed"),e}))}))}))},e.prototype.validateSignoutResponse=function(e,t){return e.id!==t.state?(i.Log.error("ResponseValidator.validateSignoutResponse: State does not match"),Promise.reject(new Error("State does not match"))):(i.Log.debug("ResponseValidator.validateSignoutResponse: state validated"),t.state=e.data,t.error?(i.Log.warn("ResponseValidator.validateSignoutResponse: Response was error",t.error),Promise.reject(new c.ErrorResponse(t))):Promise.resolve(t))},e.prototype._processSigninParams=function(e,t){if(e.id!==t.state)return i.Log.error("ResponseValidator._processSigninParams: State does not match"),Promise.reject(new Error("State does not match"));if(!e.client_id)return i.Log.error("ResponseValidator._processSigninParams: No client_id on state"),Promise.reject(new Error("No client_id on state"));if(!e.authority)return i.Log.error("ResponseValidator._processSigninParams: No authority on state"),Promise.reject(new Error("No authority on state"));if(this._settings.authority){if(this._settings.authority&&this._settings.authority!==e.authority)return i.Log.error("ResponseValidator._processSigninParams: authority mismatch on settings vs. signin state"),Promise.reject(new Error("authority mismatch on settings vs. signin state"))}else this._settings.authority=e.authority;if(this._settings.client_id){if(this._settings.client_id&&this._settings.client_id!==e.client_id)return i.Log.error("ResponseValidator._processSigninParams: client_id mismatch on settings vs. signin state"),Promise.reject(new Error("client_id mismatch on settings vs. signin state"))}else this._settings.client_id=e.client_id;return i.Log.debug("ResponseValidator._processSigninParams: state validated"),t.state=e.data,t.error?(i.Log.warn("ResponseValidator._processSigninParams: Response was error",t.error),Promise.reject(new c.ErrorResponse(t))):e.nonce&&!t.id_token?(i.Log.error("ResponseValidator._processSigninParams: Expecting id_token in response"),Promise.reject(new Error("No id_token in response"))):!e.nonce&&t.id_token?(i.Log.error("ResponseValidator._processSigninParams: Not expecting id_token in response"),Promise.reject(new Error("Unexpected id_token in response"))):e.code_verifier&&!t.code?(i.Log.error("ResponseValidator._processSigninParams: Expecting code in response"),Promise.reject(new Error("No code in response"))):!e.code_verifier&&t.code?(i.Log.error("ResponseValidator._processSigninParams: Not expecting code in response"),Promise.reject(new Error("Unexpected code in response"))):(t.scope||(t.scope=e.scope),Promise.resolve(t))},e.prototype._processClaims=function(e,t){var r=this;if(t.isOpenIdConnect){if(i.Log.debug("ResponseValidator._processClaims: response is OIDC, processing claims"),t.profile=this._filterProtocolClaims(t.profile),!0!==e.skipUserInfo&&this._settings.loadUserInfo&&t.access_token)return i.Log.debug("ResponseValidator._processClaims: loading user info"),this._userInfoService.getClaims(t.access_token).then((function(e){return i.Log.debug("ResponseValidator._processClaims: user info claims received from user info endpoint"),e.sub!==t.profile.sub?(i.Log.error("ResponseValidator._processClaims: sub from user info endpoint does not match sub in id_token"),Promise.reject(new Error("sub from user info endpoint does not match sub in id_token"))):(t.profile=r._mergeClaims(t.profile,e),i.Log.debug("ResponseValidator._processClaims: user info claims received, updated profile:",t.profile),t)}));i.Log.debug("ResponseValidator._processClaims: not loading user info")}else i.Log.debug("ResponseValidator._processClaims: response is not OIDC, not processing claims");return Promise.resolve(t)},e.prototype._mergeClaims=function(e,t){var r=Object.assign({},e);for(var i in t){var o=t[i];Array.isArray(o)||(o=[o]);for(var a=0;a<o.length;a++){var s=o[a];r[i]?Array.isArray(r[i])?r[i].indexOf(s)<0&&r[i].push(s):r[i]!==s&&("object"===(void 0===s?"undefined":n(s))&&this._settings.mergeClaims?r[i]=this._mergeClaims(r[i],s):r[i]=[r[i],s]):r[i]=s}}return r},e.prototype._filterProtocolClaims=function(e){i.Log.debug("ResponseValidator._filterProtocolClaims, incoming claims:",e);var t=Object.assign({},e);return this._settings._filterProtocolClaims?(d.forEach((function(e){delete t[e]})),i.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims filtered",t)):i.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims not filtered"),t},e.prototype._validateTokens=function(e,t){return t.code?(i.Log.debug("ResponseValidator._validateTokens: Validating code"),this._processCode(e,t)):t.id_token?t.access_token?(i.Log.debug("ResponseValidator._validateTokens: Validating id_token and access_token"),this._validateIdTokenAndAccessToken(e,t)):(i.Log.debug("ResponseValidator._validateTokens: Validating id_token"),this._validateIdToken(e,t)):(i.Log.debug("ResponseValidator._validateTokens: No code to process or id_token to validate"),Promise.resolve(t))},e.prototype._processCode=function(e,t){var r=this,o={client_id:e.client_id,client_secret:e.client_secret,code:t.code,redirect_uri:e.redirect_uri,code_verifier:e.code_verifier};return e.extraTokenParams&&"object"===n(e.extraTokenParams)&&Object.assign(o,e.extraTokenParams),this._tokenClient.exchangeCode(o).then((function(n){for(var o in n)t[o]=n[o];return t.id_token?(i.Log.debug("ResponseValidator._processCode: token response successful, processing id_token"),r._validateIdTokenAttributes(e,t)):(i.Log.debug("ResponseValidator._processCode: token response successful, returning response"),t)}))},e.prototype._validateIdTokenAttributes=function(e,t){var r=this;return this._metadataService.getIssuer().then((function(n){var o=e.client_id,a=r._settings.clockSkew;return i.Log.debug("ResponseValidator._validateIdTokenAttributes: Validaing JWT attributes; using clock skew (in seconds) of: ",a),r._settings.getEpochTime().then((function(s){return r._joseUtil.validateJwtAttributes(t.id_token,n,o,a,s).then((function(r){return e.nonce&&e.nonce!==r.nonce?(i.Log.error("ResponseValidator._validateIdTokenAttributes: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"))):r.sub?(t.profile=r,t):(i.Log.error("ResponseValidator._validateIdTokenAttributes: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))}))}))}))},e.prototype._validateIdTokenAndAccessToken=function(e,t){var r=this;return this._validateIdToken(e,t).then((function(e){return r._validateAccessToken(e)}))},e.prototype._getSigningKeyForJwt=function(e){var t=this;return this._metadataService.getSigningKeys().then((function(r){var n=e.header.kid;if(!r)return i.Log.error("ResponseValidator._validateIdToken: No signing keys from metadata"),Promise.reject(new Error("No signing keys from metadata"));i.Log.debug("ResponseValidator._validateIdToken: Received signing keys");var o=void 0;if(n)o=r.filter((function(e){return e.kid===n}))[0];else{if((r=t._filterByAlg(r,e.header.alg)).length>1)return i.Log.error("ResponseValidator._validateIdToken: No kid found in id_token and more than one key found in metadata"),Promise.reject(new Error("No kid found in id_token and more than one key found in metadata"));o=r[0]}return Promise.resolve(o)}))},e.prototype._getSigningKeyForJwtWithSingleRetry=function(e){var t=this;return this._getSigningKeyForJwt(e).then((function(r){return r?Promise.resolve(r):(t._metadataService.resetSigningKeys(),t._getSigningKeyForJwt(e))}))},e.prototype._validateIdToken=function(e,t){var r=this;if(!e.nonce)return i.Log.error("ResponseValidator._validateIdToken: No nonce on state"),Promise.reject(new Error("No nonce on state"));var n=this._joseUtil.parseJwt(t.id_token);return n&&n.header&&n.payload?e.nonce!==n.payload.nonce?(i.Log.error("ResponseValidator._validateIdToken: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"))):this._metadataService.getIssuer().then((function(o){return i.Log.debug("ResponseValidator._validateIdToken: Received issuer"),r._getSigningKeyForJwtWithSingleRetry(n).then((function(a){if(!a)return i.Log.error("ResponseValidator._validateIdToken: No key matching kid or alg found in signing keys"),Promise.reject(new Error("No key matching kid or alg found in signing keys"));var s=e.client_id,c=r._settings.clockSkew;return i.Log.debug("ResponseValidator._validateIdToken: Validaing JWT; using clock skew (in seconds) of: ",c),r._joseUtil.validateJwt(t.id_token,a,o,s,c).then((function(){return i.Log.debug("ResponseValidator._validateIdToken: JWT validation successful"),n.payload.sub?(t.profile=n.payload,t):(i.Log.error("ResponseValidator._validateIdToken: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))}))}))})):(i.Log.error("ResponseValidator._validateIdToken: Failed to parse id_token",n),Promise.reject(new Error("Failed to parse id_token")))},e.prototype._filterByAlg=function(e,t){var r=null;if(t.startsWith("RS"))r="RSA";else if(t.startsWith("PS"))r="PS";else{if(!t.startsWith("ES"))return i.Log.debug("ResponseValidator._filterByAlg: alg not supported: ",t),[];r="EC"}return i.Log.debug("ResponseValidator._filterByAlg: Looking for keys that match kty: ",r),e=e.filter((function(e){return e.kty===r})),i.Log.debug("ResponseValidator._filterByAlg: Number of keys that match kty: ",r,e.length),e},e.prototype._validateAccessToken=function(e){if(!e.profile)return i.Log.error("ResponseValidator._validateAccessToken: No profile loaded from id_token"),Promise.reject(new Error("No profile loaded from id_token"));if(!e.profile.at_hash)return i.Log.error("ResponseValidator._validateAccessToken: No at_hash in id_token"),Promise.reject(new Error("No at_hash in id_token"));if(!e.id_token)return i.Log.error("ResponseValidator._validateAccessToken: No id_token"),Promise.reject(new Error("No id_token"));var t=this._joseUtil.parseJwt(e.id_token);if(!t||!t.header)return i.Log.error("ResponseValidator._validateAccessToken: Failed to parse id_token",t),Promise.reject(new Error("Failed to parse id_token"));var r=t.header.alg;if(!r||5!==r.length)return i.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",r),Promise.reject(new Error("Unsupported alg: "+r));var n=r.substr(2,3);if(!n)return i.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",r,n),Promise.reject(new Error("Unsupported alg: "+r));if(256!==(n=parseInt(n))&&384!==n&&512!==n)return i.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",r,n),Promise.reject(new Error("Unsupported alg: "+r));var o="sha"+n,a=this._joseUtil.hashString(e.access_token,o);if(!a)return i.Log.error("ResponseValidator._validateAccessToken: access_token hash failed:",o),Promise.reject(new Error("Failed to validate at_hash"));var s=a.substr(0,a.length/2),c=this._joseUtil.hexToBase64Url(s);return c!==e.profile.at_hash?(i.Log.error("ResponseValidator._validateAccessToken: Failed to validate at_hash",c,e.profile.at_hash),Promise.reject(new Error("Failed to validate at_hash"))):(i.Log.debug("ResponseValidator._validateAccessToken: success"),Promise.resolve(e))},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserInfoService=void 0;var n=r(7),i=r(2),o=r(0),a=r(4);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.UserInfoService=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.JsonService,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.MetadataService,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.JoseUtil;if(s(this,e),!t)throw o.Log.error("UserInfoService.ctor: No settings passed"),new Error("settings");this._settings=t,this._jsonService=new r(void 0,void 0,this._getClaimsFromJwt.bind(this)),this._metadataService=new c(this._settings),this._joseUtil=u}return e.prototype.getClaims=function(e){var t=this;return e?this._metadataService.getUserInfoEndpoint().then((function(r){return o.Log.debug("UserInfoService.getClaims: received userinfo url",r),t._jsonService.getJson(r,e).then((function(e){return o.Log.debug("UserInfoService.getClaims: claims received",e),e}))})):(o.Log.error("UserInfoService.getClaims: No token passed"),Promise.reject(new Error("A token is required")))},e.prototype._getClaimsFromJwt=function e(t){var r=this;try{var n=this._joseUtil.parseJwt(t.responseText);if(!n||!n.header||!n.payload)return o.Log.error("UserInfoService._getClaimsFromJwt: Failed to parse JWT",n),Promise.reject(new Error("Failed to parse id_token"));var i=n.header.kid,a=void 0;switch(this._settings.userInfoJwtIssuer){case"OP":a=this._metadataService.getIssuer();break;case"ANY":a=Promise.resolve(n.payload.iss);break;default:a=Promise.resolve(this._settings.userInfoJwtIssuer)}return a.then((function(e){return o.Log.debug("UserInfoService._getClaimsFromJwt: Received issuer:"+e),r._metadataService.getSigningKeys().then((function(a){if(!a)return o.Log.error("UserInfoService._getClaimsFromJwt: No signing keys from metadata"),Promise.reject(new Error("No signing keys from metadata"));o.Log.debug("UserInfoService._getClaimsFromJwt: Received signing keys");var s=void 0;if(i)s=a.filter((function(e){return e.kid===i}))[0];else{if((a=r._filterByAlg(a,n.header.alg)).length>1)return o.Log.error("UserInfoService._getClaimsFromJwt: No kid found in id_token and more than one key found in metadata"),Promise.reject(new Error("No kid found in id_token and more than one key found in metadata"));s=a[0]}if(!s)return o.Log.error("UserInfoService._getClaimsFromJwt: No key matching kid or alg found in signing keys"),Promise.reject(new Error("No key matching kid or alg found in signing keys"));var c=r._settings.client_id,u=r._settings.clockSkew;return o.Log.debug("UserInfoService._getClaimsFromJwt: Validaing JWT; using clock skew (in seconds) of: ",u),r._joseUtil.validateJwt(t.responseText,s,e,c,u,void 0,!0).then((function(){return o.Log.debug("UserInfoService._getClaimsFromJwt: JWT validation successful"),n.payload}))}))}))}catch(e){return o.Log.error("UserInfoService._getClaimsFromJwt: Error parsing JWT response",e.message),void reject(e)}},e.prototype._filterByAlg=function(e,t){var r=null;if(t.startsWith("RS"))r="RSA";else if(t.startsWith("PS"))r="PS";else{if(!t.startsWith("ES"))return o.Log.debug("UserInfoService._filterByAlg: alg not supported: ",t),[];r="EC"}return o.Log.debug("UserInfoService._filterByAlg: Looking for keys that match kty: ",r),e=e.filter((function(e){return e.kty===r})),o.Log.debug("UserInfoService._filterByAlg: Number of keys that match kty: ",r,e.length),e},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AllowedSigningAlgs=t.b64tohex=t.hextob64u=t.crypto=t.X509=t.KeyUtil=t.jws=void 0;var n=r(27);t.jws=n.jws,t.KeyUtil=n.KEYUTIL,t.X509=n.X509,t.crypto=n.crypto,t.hextob64u=n.hextob64u,t.b64tohex=n.b64tohex,t.AllowedSigningAlgs=["RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"]},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var r,n,i,o,a,s,c,u,l,d,p,f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h={userAgent:!1},m={},g=g||(r=Math,i=(n={}).lib={},o=i.Base=function(){function e(){}return{extend:function(t){e.prototype=this;var r=new e;return t&&r.mixIn(t),r.hasOwnProperty("init")||(r.init=function(){r.$super.init.apply(this,arguments)}),r.init.prototype=r,r.$super=this,r},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),a=i.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o<i;o++){var a=r[o>>>2]>>>24-o%4*8&255;t[n+o>>>2]|=a<<24-(n+o)%4*8}else for(o=0;o<i;o+=4)t[n+o>>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-t%4*8,e.length=r.ceil(t/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(4294967296*r.random()|0);return new a.init(t,e)}}),s=n.enc={},c=s.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new a.init(r,t/2)}},u=s.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new a.init(r,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},d=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,n=t.words,i=t.sigBytes,o=this.blockSize,s=i/(4*o),c=(s=e?r.ceil(s):r.max((0|s)-this._minBufferSize,0))*o,u=r.min(4*c,i);if(c){for(var l=0;l<c;l+=o)this._doProcessBlock(n,l);var d=n.splice(0,c);t.sigBytes-=u}return new a.init(d,u)},clone:function(){var e=o.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),i.Hasher=d.extend({cfg:o.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new p.HMAC.init(e,r).finalize(t)}}}),p=n.algo={},n);!function(e){var t,r=(t=g).lib,n=r.Base,i=r.WordArray;(t=t.x64={}).Word=n.extend({init:function(e,t){this.high=e,this.low=t}}),t.WordArray=n.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n<t;n++){var o=e[n];r.push(o.high),r.push(o.low)}return i.create(r,this.sigBytes)},clone:function(){for(var e=n.clone.call(this),t=e.words=this.words.slice(0),r=t.length,i=0;i<r;i++)t[i]=t[i].clone();return e}})}(),function(){var e=g,t=e.lib.WordArray;e.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp(),e=[];for(var i=0;i<r;i+=3)for(var o=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;4>a&&i+.75*a<r;a++)e.push(n.charAt(o>>>6*(3-a)&63));if(t=n.charAt(64))for(;e.length%4;)e.push(t);return e.join("")},parse:function(e){var r=e.length,n=this._map;(i=n.charAt(64))&&-1!=(i=e.indexOf(i))&&(r=i);for(var i=[],o=0,a=0;a<r;a++)if(a%4){var s=n.indexOf(e.charAt(a-1))<<a%4*2,c=n.indexOf(e.charAt(a))>>>6-a%4*2;i[o>>>2]|=(s|c)<<24-o%4*8,o++}return t.create(i,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(e){for(var t=g,r=(i=t.lib).WordArray,n=i.Hasher,i=t.algo,o=[],a=[],s=function(e){return 4294967296*(e-(0|e))|0},c=2,u=0;64>u;){var l;e:{l=c;for(var d=e.sqrt(l),p=2;p<=d;p++)if(!(l%p)){l=!1;break e}l=!0}l&&(8>u&&(o[u]=s(e.pow(c,.5))),a[u]=s(e.pow(c,1/3)),u++),c++}var f=[];i=i.SHA256=n.extend({_doReset:function(){this._hash=new r.init(o.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],c=r[4],u=r[5],l=r[6],d=r[7],p=0;64>p;p++){if(16>p)f[p]=0|e[t+p];else{var h=f[p-15],m=f[p-2];f[p]=((h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3)+f[p-7]+((m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10)+f[p-16]}h=d+((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+(c&u^~c&l)+a[p]+f[p],m=((n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22))+(n&i^n&o^i&o),d=l,l=u,u=c,c=s+h|0,s=o,o=i,i=n,n=h+m|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+c|0,r[5]=r[5]+u|0,r[6]=r[6]+l|0,r[7]=r[7]+d|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA256=n._createHelper(i),t.HmacSHA256=n._createHmacHelper(i)}(Math),function(){function e(){return n.create.apply(n,arguments)}for(var t=g,r=t.lib.Hasher,n=(o=t.x64).Word,i=o.WordArray,o=t.algo,a=[e(1116352408,3609767458),e(1899447441,602891725),e(3049323471,3964484399),e(3921009573,2173295548),e(961987163,4081628472),e(1508970993,3053834265),e(2453635748,2937671579),e(2870763221,3664609560),e(3624381080,2734883394),e(310598401,1164996542),e(607225278,1323610764),e(1426881987,3590304994),e(1925078388,4068182383),e(2162078206,991336113),e(2614888103,633803317),e(3248222580,3479774868),e(3835390401,2666613458),e(4022224774,944711139),e(264347078,2341262773),e(604807628,2007800933),e(770255983,1495990901),e(1249150122,1856431235),e(1555081692,3175218132),e(1996064986,2198950837),e(2554220882,3999719339),e(2821834349,766784016),e(2952996808,2566594879),e(3210313671,3203337956),e(3336571891,1034457026),e(3584528711,2466948901),e(113926993,3758326383),e(338241895,168717936),e(666307205,1188179964),e(773529912,1546045734),e(1294757372,1522805485),e(1396182291,2643833823),e(1695183700,2343527390),e(1986661051,1014477480),e(2177026350,1206759142),e(2456956037,344077627),e(2730485921,1290863460),e(2820302411,3158454273),e(3259730800,3505952657),e(3345764771,106217008),e(3516065817,3606008344),e(3600352804,1432725776),e(4094571909,1467031594),e(275423344,851169720),e(430227734,3100823752),e(506948616,1363258195),e(659060556,3750685593),e(883997877,3785050280),e(958139571,3318307427),e(1322822218,3812723403),e(1537002063,2003034995),e(1747873779,3602036899),e(1955562222,1575990012),e(2024104815,1125592928),e(2227730452,2716904306),e(2361852424,442776044),e(2428436474,593698344),e(2756734187,3733110249),e(3204031479,2999351573),e(3329325298,3815920427),e(3391569614,3928383900),e(3515267271,566280711),e(3940187606,3454069534),e(4118630271,4000239992),e(116418474,1914138554),e(174292421,2731055270),e(289380356,3203993006),e(460393269,320620315),e(685471733,587496836),e(852142971,1086792851),e(1017036298,365543100),e(1126000580,2618297676),e(1288033470,3409855158),e(1501505948,4234509866),e(1607167915,987167468),e(1816402316,1246189591)],s=[],c=0;80>c;c++)s[c]=e();o=o.SHA512=r.extend({_doReset:function(){this._hash=new i.init([new n.init(1779033703,4089235720),new n.init(3144134277,2227873595),new n.init(1013904242,4271175723),new n.init(2773480762,1595750129),new n.init(1359893119,2917565137),new n.init(2600822924,725511199),new n.init(528734635,4215389547),new n.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=(d=this._hash.words)[0],n=d[1],i=d[2],o=d[3],c=d[4],u=d[5],l=d[6],d=d[7],p=r.high,f=r.low,h=n.high,m=n.low,g=i.high,v=i.low,y=o.high,b=o.low,w=c.high,x=c.low,_=u.high,E=u.low,k=l.high,S=l.low,A=d.high,C=d.low,T=p,O=f,P=h,F=m,I=g,N=v,j=y,R=b,L=w,D=x,M=_,U=E,B=k,H=S,q=A,K=C,W=0;80>W;W++){var V=s[W];if(16>W)var z=V.high=0|e[t+2*W],J=V.low=0|e[t+2*W+1];else{z=((J=(z=s[W-15]).high)>>>1|(Z=z.low)<<31)^(J>>>8|Z<<24)^J>>>7;var Z=(Z>>>1|J<<31)^(Z>>>8|J<<24)^(Z>>>7|J<<25),$=((J=($=s[W-2]).high)>>>19|(G=$.low)<<13)^(J<<3|G>>>29)^J>>>6,G=(G>>>19|J<<13)^(G<<3|J>>>29)^(G>>>6|J<<26),X=(J=s[W-7]).high,Y=(Q=s[W-16]).high,Q=Q.low;z=(z=(z=z+X+((J=Z+J.low)>>>0<Z>>>0?1:0))+$+((J+=G)>>>0<G>>>0?1:0))+Y+((J+=Q)>>>0<Q>>>0?1:0),V.high=z,V.low=J}X=L&M^~L&B,Q=D&U^~D&H,V=T&P^T&I^P&I;var ee=O&F^O&N^F&N,te=(Z=(T>>>28|O<<4)^(T<<30|O>>>2)^(T<<25|O>>>7),$=(O>>>28|T<<4)^(O<<30|T>>>2)^(O<<25|T>>>7),(G=a[W]).high),re=G.low;Y=q+((L>>>14|D<<18)^(L>>>18|D<<14)^(L<<23|D>>>9))+((G=K+((D>>>14|L<<18)^(D>>>18|L<<14)^(D<<23|L>>>9)))>>>0<K>>>0?1:0),q=B,K=H,B=M,H=U,M=L,U=D,L=j+(Y=(Y=(Y=Y+X+((G+=Q)>>>0<Q>>>0?1:0))+te+((G+=re)>>>0<re>>>0?1:0))+z+((G+=J)>>>0<J>>>0?1:0))+((D=R+G|0)>>>0<R>>>0?1:0)|0,j=I,R=N,I=P,N=F,P=T,F=O,T=Y+(V=Z+V+((J=$+ee)>>>0<$>>>0?1:0))+((O=G+J|0)>>>0<G>>>0?1:0)|0}f=r.low=f+O,r.high=p+T+(f>>>0<O>>>0?1:0),m=n.low=m+F,n.high=h+P+(m>>>0<F>>>0?1:0),v=i.low=v+N,i.high=g+I+(v>>>0<N>>>0?1:0),b=o.low=b+R,o.high=y+j+(b>>>0<R>>>0?1:0),x=c.low=x+D,c.high=w+L+(x>>>0<D>>>0?1:0),E=u.low=E+U,u.high=_+M+(E>>>0<U>>>0?1:0),S=l.low=S+H,l.high=k+B+(S>>>0<H>>>0?1:0),C=d.low=C+K,d.high=A+q+(C>>>0<K>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32}),t.SHA512=r._createHelper(o),t.HmacSHA512=r._createHmacHelper(o)}(),function(){var e=g,t=(i=e.x64).Word,r=i.WordArray,n=(i=e.algo).SHA512,i=i.SHA384=n.extend({_doReset:function(){this._hash=new r.init([new t.init(3418070365,3238371032),new t.init(1654270250,914150663),new t.init(2438529370,812702999),new t.init(355462360,4144912697),new t.init(1731405415,4290775857),new t.init(2394180231,1750603025),new t.init(3675008525,1694076839),new t.init(1203062813,3204075428)])},_doFinalize:function(){var e=n._doFinalize.call(this);return e.sigBytes-=16,e}});e.SHA384=n._createHelper(i),e.HmacSHA384=n._createHmacHelper(i)}();var v,y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function b(e){var t,r,n="";for(t=0;t+3<=e.length;t+=3)r=parseInt(e.substring(t,t+3),16),n+=y.charAt(r>>6)+y.charAt(63&r);for(t+1==e.length?(r=parseInt(e.substring(t,t+1),16),n+=y.charAt(r<<2)):t+2==e.length&&(r=parseInt(e.substring(t,t+2),16),n+=y.charAt(r>>2)+y.charAt((3&r)<<4));(3&n.length)>0;)n+="=";return n}function w(e){var t,r,n,i="",o=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t)(n=y.indexOf(e.charAt(t)))<0||(0==o?(i+=C(n>>2),r=3&n,o=1):1==o?(i+=C(r<<2|n>>4),r=15&n,o=2):2==o?(i+=C(r),i+=C(n>>2),r=3&n,o=3):(i+=C(r<<2|n>>4),i+=C(15&n),o=0));return 1==o&&(i+=C(r<<2)),i}function x(e){var t,r=w(e),n=new Array;for(t=0;2*t<r.length;++t)n[t]=parseInt(r.substring(2*t,2*t+2),16);return n}function _(e,t,r){null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function E(){return new _(null)}"Microsoft Internet Explorer"==h.appName?(_.prototype.am=function(e,t,r,n,i,o){for(var a=32767&t,s=t>>15;--o>=0;){var c=32767&this[e],u=this[e++]>>15,l=s*c+u*a;i=((c=a*c+((32767&l)<<15)+r[n]+(1073741823&i))>>>30)+(l>>>15)+s*u+(i>>>30),r[n++]=1073741823&c}return i},v=30):"Netscape"!=h.appName?(_.prototype.am=function(e,t,r,n,i,o){for(;--o>=0;){var a=t*this[e++]+r[n]+i;i=Math.floor(a/67108864),r[n++]=67108863&a}return i},v=26):(_.prototype.am=function(e,t,r,n,i,o){for(var a=16383&t,s=t>>14;--o>=0;){var c=16383&this[e],u=this[e++]>>14,l=s*c+u*a;i=((c=a*c+((16383&l)<<14)+r[n]+i)>>28)+(l>>14)+s*u,r[n++]=268435455&c}return i},v=28),_.prototype.DB=v,_.prototype.DM=(1<<v)-1,_.prototype.DV=1<<v,_.prototype.FV=Math.pow(2,52),_.prototype.F1=52-v,_.prototype.F2=2*v-52;var k,S,A=new Array;for(k="0".charCodeAt(0),S=0;S<=9;++S)A[k++]=S;for(k="a".charCodeAt(0),S=10;S<36;++S)A[k++]=S;for(k="A".charCodeAt(0),S=10;S<36;++S)A[k++]=S;function C(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function T(e,t){var r=A[e.charCodeAt(t)];return null==r?-1:r}function O(e){var t=E();return t.fromInt(e),t}function P(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function F(e){this.m=e}function I(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function N(e,t){return e&t}function j(e,t){return e|t}function R(e,t){return e^t}function L(e,t){return e&~t}function D(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function M(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function U(){}function B(e){return e}function H(e){this.r2=E(),this.q3=E(),_.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}F.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},F.prototype.revert=function(e){return e},F.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},F.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},F.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},I.prototype.convert=function(e){var t=E();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(_.ZERO)>0&&this.m.subTo(t,t),t},I.prototype.revert=function(e){var t=E();return e.copyTo(t),this.reduce(t),t},I.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e[t],n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[r=t+this.m.t]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},I.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},I.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},_.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},_.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},_.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,o=0;--n>=0;){var a=8==r?255&e[n]:T(e,n);a<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==o?this[this.t++]=a:o+r>this.DB?(this[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this[this.t++]=a>>this.DB-o):this[this.t-1]|=a<<o,(o+=r)>=this.DB&&(o-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),i&&_.ZERO.subTo(this,this)},_.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},_.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s},_.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s},_.prototype.lShiftTo=function(e,t){var r,n=e%this.DB,i=this.DB-n,o=(1<<i)-1,a=Math.floor(e/this.DB),s=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t[r+a+1]=this[r]>>i|s,s=(this[r]&o)<<n;for(r=a-1;r>=0;--r)t[r]=0;t[a]=s,t.t=this.t+a+1,t.s=this.s,t.clamp()},_.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,o=(1<<n)-1;t[0]=this[r]>>n;for(var a=r+1;a<this.t;++a)t[a-r-1]|=(this[a]&o)<<i,t[a-r]=this[a]>>n;n>0&&(t[this.t-r-1]|=(this.s&o)<<i),t.t=this.t-r,t.clamp()}},_.prototype.subTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()},_.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t[i]=0;for(i=0;i<n.t;++i)t[i+r.t]=r.am(0,n[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&_.ZERO.subTo(t,t)},_.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()},_.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=E());var o=E(),a=this.s,s=e.s,c=this.DB-P(n[n.t-1]);c>0?(n.lShiftTo(c,o),i.lShiftTo(c,r)):(n.copyTo(o),i.copyTo(r));var u=o.t,l=o[u-1];if(0!=l){var d=l*(1<<this.F1)+(u>1?o[u-2]>>this.F2:0),p=this.FV/d,f=(1<<this.F1)/d,h=1<<this.F2,m=r.t,g=m-u,v=null==t?E():t;for(o.dlShiftTo(g,v),r.compareTo(v)>=0&&(r[r.t++]=1,r.subTo(v,r)),_.ONE.dlShiftTo(u,v),v.subTo(o,o);o.t<u;)o[o.t++]=0;for(;--g>=0;){var y=r[--m]==l?this.DM:Math.floor(r[m]*p+(r[m-1]+h)*f);if((r[m]+=o.am(0,y,r,g,0,u))<y)for(o.dlShiftTo(g,v),r.subTo(v,r);r[m]<--y;)r.subTo(v,r)}null!=t&&(r.drShiftTo(u,t),a!=s&&_.ZERO.subTo(t,t)),r.t=u,r.clamp(),c>0&&r.rShiftTo(c,r),a<0&&_.ZERO.subTo(r,r)}}},_.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},_.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},_.prototype.exp=function(e,t){if(e>4294967295||e<1)return _.ONE;var r=E(),n=E(),i=t.convert(this),o=P(e)-1;for(i.copyTo(r);--o>=0;)if(t.sqrTo(r,n),(e&1<<o)>0)t.mulTo(n,i,r);else{var a=r;r=n,n=a}return t.revert(r)},_.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,i=!1,o="",a=this.t,s=this.DB-a*this.DB%t;if(a-- >0)for(s<this.DB&&(r=this[a]>>s)>0&&(i=!0,o=C(r));a>=0;)s<t?(r=(this[a]&(1<<s)-1)<<t-s,r|=this[--a]>>(s+=this.DB-t)):(r=this[a]>>(s-=t)&n,s<=0&&(s+=this.DB,--a)),r>0&&(i=!0),i&&(o+=C(r));return i?o:"0"},_.prototype.negate=function(){var e=E();return _.ZERO.subTo(this,e),e},_.prototype.abs=function(){return this.s<0?this.negate():this},_.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this[r]-e[r]))return t;return 0},_.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+P(this[this.t-1]^this.s&this.DM)},_.prototype.mod=function(e){var t=E();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(_.ZERO)>0&&e.subTo(t,t),t},_.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new F(t):new I(t),this.exp(e,r)},_.ZERO=O(0),_.ONE=O(1),U.prototype.convert=B,U.prototype.revert=B,U.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},U.prototype.sqrTo=function(e,t){e.squareTo(t)},H.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=E();return e.copyTo(t),this.reduce(t),t},H.prototype.revert=function(e){return e},H.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},H.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},H.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var q,K,W,V=[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],z=(1<<26)/V[V.length-1];function J(){this.i=0,this.j=0,this.S=new Array}function Z(){!function(e){K[W++]^=255&e,K[W++]^=e>>8&255,K[W++]^=e>>16&255,K[W++]^=e>>24&255,W>=256&&(W-=256)}((new Date).getTime())}if(_.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},_.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=O(r),i=E(),o=E(),a="";for(this.divRemTo(n,i,o);i.signum()>0;)a=(r+o.intValue()).toString(e).substr(1)+a,i.divRemTo(n,i,o);return o.intValue().toString(e)+a},_.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,o=0,a=0,s=0;s<e.length;++s){var c=T(e,s);c<0?"-"==e.charAt(s)&&0==this.signum()&&(i=!0):(a=t*a+c,++o>=r&&(this.dMultiply(n),this.dAddOffset(a,0),o=0,a=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(a,0)),i&&_.ZERO.subTo(this,this)},_.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(_.ONE.shiftLeft(e-1),j,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(_.ONE.shiftLeft(e-1),this);else{var n=new Array,i=7&e;n.length=1+(e>>3),t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}},_.prototype.bitwiseTo=function(e,t,r){var n,i,o=Math.min(e.t,this.t);for(n=0;n<o;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(i=e.s&this.DM,n=o;n<this.t;++n)r[n]=t(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=o;n<e.t;++n)r[n]=t(i,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},_.prototype.changeBit=function(e,t){var r=_.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},_.prototype.addTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()},_.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},_.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},_.prototype.multiplyLowerTo=function(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(n=r.t-this.t;i<n;++i)r[i+this.t]=this.am(0,e[i],r,i,0,this.t);for(n=Math.min(e.t,t);i<n;++i)this.am(0,e[i],r,i,0,t-i);r.clamp()},_.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},_.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r},_.prototype.millerRabin=function(e){var t=this.subtract(_.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);(e=e+1>>1)>V.length&&(e=V.length);for(var i=E(),o=0;o<e;++o){i.fromInt(V[Math.floor(Math.random()*V.length)]);var a=i.modPow(n,this);if(0!=a.compareTo(_.ONE)&&0!=a.compareTo(t)){for(var s=1;s++<r&&0!=a.compareTo(t);)if(0==(a=a.modPowInt(2,this)).compareTo(_.ONE))return!1;if(0!=a.compareTo(t))return!1}}return!0},_.prototype.clone=function(){var e=E();return this.copyTo(e),e},_.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},_.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},_.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},_.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},_.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n<this.DB&&(r=this[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this[e]&(1<<n)-1)<<8-n,r|=this[--e]>>(n+=this.DB-8)):(r=this[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},_.prototype.equals=function(e){return 0==this.compareTo(e)},_.prototype.min=function(e){return this.compareTo(e)<0?this:e},_.prototype.max=function(e){return this.compareTo(e)>0?this:e},_.prototype.and=function(e){var t=E();return this.bitwiseTo(e,N,t),t},_.prototype.or=function(e){var t=E();return this.bitwiseTo(e,j,t),t},_.prototype.xor=function(e){var t=E();return this.bitwiseTo(e,R,t),t},_.prototype.andNot=function(e){var t=E();return this.bitwiseTo(e,L,t),t},_.prototype.not=function(){for(var e=E(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},_.prototype.shiftLeft=function(e){var t=E();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},_.prototype.shiftRight=function(e){var t=E();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},_.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+D(this[e]);return this.s<0?this.t*this.DB:-1},_.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=M(this[r]^t);return e},_.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)},_.prototype.setBit=function(e){return this.changeBit(e,j)},_.prototype.clearBit=function(e){return this.changeBit(e,L)},_.prototype.flipBit=function(e){return this.changeBit(e,R)},_.prototype.add=function(e){var t=E();return this.addTo(e,t),t},_.prototype.subtract=function(e){var t=E();return this.subTo(e,t),t},_.prototype.multiply=function(e){var t=E();return this.multiplyTo(e,t),t},_.prototype.divide=function(e){var t=E();return this.divRemTo(e,t,null),t},_.prototype.remainder=function(e){var t=E();return this.divRemTo(e,null,t),t},_.prototype.divideAndRemainder=function(e){var t=E(),r=E();return this.divRemTo(e,t,r),new Array(t,r)},_.prototype.modPow=function(e,t){var r,n,i=e.bitLength(),o=O(1);if(i<=0)return o;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new F(t):t.isEven()?new H(t):new I(t);var a=new Array,s=3,c=r-1,u=(1<<r)-1;if(a[1]=n.convert(this),r>1){var l=E();for(n.sqrTo(a[1],l);s<=u;)a[s]=E(),n.mulTo(l,a[s-2],a[s]),s+=2}var d,p,f=e.t-1,h=!0,m=E();for(i=P(e[f])-1;f>=0;){for(i>=c?d=e[f]>>i-c&u:(d=(e[f]&(1<<i+1)-1)<<c-i,f>0&&(d|=e[f-1]>>this.DB+i-c)),s=r;0==(1&d);)d>>=1,--s;if((i-=s)<0&&(i+=this.DB,--f),h)a[d].copyTo(o),h=!1;else{for(;s>1;)n.sqrTo(o,m),n.sqrTo(m,o),s-=2;s>0?n.sqrTo(o,m):(p=o,o=m,m=p),n.mulTo(m,a[d],o)}for(;f>=0&&0==(e[f]&1<<i);)n.sqrTo(o,m),p=o,o=m,m=p,--i<0&&(i=this.DB-1,--f)}return n.revert(o)},_.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return _.ZERO;for(var r=e.clone(),n=this.clone(),i=O(1),o=O(0),a=O(0),s=O(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(i.isEven()&&o.isEven()||(i.addTo(this,i),o.subTo(e,o)),i.rShiftTo(1,i)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);for(;n.isEven();)n.rShiftTo(1,n),t?(a.isEven()&&s.isEven()||(a.addTo(this,a),s.subTo(e,s)),a.rShiftTo(1,a)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(a,i),o.subTo(s,o)):(n.subTo(r,n),t&&a.subTo(i,a),s.subTo(o,s))}return 0!=n.compareTo(_.ONE)?_.ZERO:s.compareTo(e)>=0?s.subtract(e):s.signum()<0?(s.addTo(e,s),s.signum()<0?s.add(e):s):s},_.prototype.pow=function(e){return this.exp(e,new U)},_.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return t;for(i<o&&(o=i),o>0&&(t.rShiftTo(o,t),r.rShiftTo(o,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},_.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r[0]<=V[V.length-1]){for(t=0;t<V.length;++t)if(r[0]==V[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<V.length;){for(var n=V[t],i=t+1;i<V.length&&n<z;)n*=V[i++];for(n=r.modInt(n);t<i;)if(n%V[t++]==0)return!1}return r.millerRabin(e)},_.prototype.square=function(){var e=E();return this.squareTo(e),e},J.prototype.init=function(e){var t,r,n;for(t=0;t<256;++t)this.S[t]=t;for(r=0,t=0;t<256;++t)r=r+this.S[t]+e[t%e.length]&255,n=this.S[t],this.S[t]=this.S[r],this.S[r]=n;this.i=0,this.j=0},J.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]},null==K){var $;if(K=new Array,W=0,void 0!==m&&(void 0!==m.crypto||void 0!==m.msCrypto)){var G=m.crypto||m.msCrypto;if(G.getRandomValues){var X=new Uint8Array(32);for(G.getRandomValues(X),$=0;$<32;++$)K[W++]=X[$]}else if("Netscape"==h.appName&&h.appVersion<"5"){var Y=m.crypto.random(32);for($=0;$<Y.length;++$)K[W++]=255&Y.charCodeAt($)}}for(;W<256;)$=Math.floor(65536*Math.random()),K[W++]=$>>>8,K[W++]=255&$;W=0,Z()}function Q(){if(null==q){for(Z(),(q=new J).init(K),W=0;W<K.length;++W)K[W]=0;W=0}return q.next()}function ee(){}function te(e,t){return new _(e,t)}function re(e,t,r){for(var n="",i=0;n.length<t;)n+=r(String.fromCharCode.apply(String,e.concat([(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i]))),i+=1;return n}function ne(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function ie(e,t){this.x=t,this.q=e}function oe(e,t,r,n){this.curve=e,this.x=t,this.y=r,this.z=null==n?_.ONE:n,this.zinv=null}function ae(e,t,r){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new oe(this,null,null)}ee.prototype.nextBytes=function(e){var t;for(t=0;t<e.length;++t)e[t]=Q()},ne.prototype.doPublic=function(e){return e.modPowInt(this.e,this.n)},ne.prototype.setPublic=function(e,t){if(this.isPublic=!0,this.isPrivate=!1,"string"!=typeof e)this.n=e,this.e=t;else{if(!(null!=e&&null!=t&&e.length>0&&t.length>0))throw"Invalid RSA public key";this.n=te(e,16),this.e=parseInt(t,16)}},ne.prototype.encrypt=function(e){var t=function(e,t){if(t<e.length+11)throw"Message too long for RSA";for(var r=new Array,n=e.length-1;n>=0&&t>0;){var i=e.charCodeAt(n--);i<128?r[--t]=i:i>127&&i<2048?(r[--t]=63&i|128,r[--t]=i>>6|192):(r[--t]=63&i|128,r[--t]=i>>6&63|128,r[--t]=i>>12|224)}r[--t]=0;for(var o=new ee,a=new Array;t>2;){for(a[0]=0;0==a[0];)o.nextBytes(a);r[--t]=a[0]}return r[--t]=2,r[--t]=0,new _(r)}(e,this.n.bitLength()+7>>3);if(null==t)return null;var r=this.doPublic(t);if(null==r)return null;var n=r.toString(16);return 0==(1&n.length)?n:"0"+n},ne.prototype.encryptOAEP=function(e,t,r){var n=function(e,t,r,n){var i=ce.crypto.MessageDigest,o=ce.crypto.Util,a=null;if(r||(r="sha1"),"string"==typeof r&&(a=i.getCanonicalAlgName(r),n=i.getHashLength(a),r=function(e){return _e(o.hashHex(Ee(e),a))}),e.length+2*n+2>t)throw"Message too long for RSA";var s,c="";for(s=0;s<t-e.length-2*n-2;s+=1)c+="\0";var u=r("")+c+""+e,l=new Array(n);(new ee).nextBytes(l);var d=re(l,u.length,r),p=[];for(s=0;s<u.length;s+=1)p[s]=u.charCodeAt(s)^d.charCodeAt(s);var f=re(p,l.length,r),h=[0];for(s=0;s<l.length;s+=1)h[s+1]=l[s]^f.charCodeAt(s);return new _(h.concat(p))}(e,this.n.bitLength()+7>>3,t,r);if(null==n)return null;var i=this.doPublic(n);if(null==i)return null;var o=i.toString(16);return 0==(1&o.length)?o:"0"+o},ne.prototype.type="RSA",ie.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.x.equals(e.x)},ie.prototype.toBigInteger=function(){return this.x},ie.prototype.negate=function(){return new ie(this.q,this.x.negate().mod(this.q))},ie.prototype.add=function(e){return new ie(this.q,this.x.add(e.toBigInteger()).mod(this.q))},ie.prototype.subtract=function(e){return new ie(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))},ie.prototype.multiply=function(e){return new ie(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))},ie.prototype.square=function(){return new ie(this.q,this.x.square().mod(this.q))},ie.prototype.divide=function(e){return new ie(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))},oe.prototype.getX=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))},oe.prototype.getY=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))},oe.prototype.equals=function(e){return e==this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(_.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(_.ZERO))},oe.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(_.ZERO)&&!this.y.toBigInteger().equals(_.ZERO)},oe.prototype.negate=function(){return new oe(this.curve,this.x,this.y.negate(),this.z)},oe.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(_.ZERO.equals(r))return _.ZERO.equals(t)?this.twice():this.curve.getInfinity();var n=new _("3"),i=this.x.toBigInteger(),o=this.y.toBigInteger(),a=(e.x.toBigInteger(),e.y.toBigInteger(),r.square()),s=a.multiply(r),c=i.multiply(a),u=t.square().multiply(this.z),l=u.subtract(c.shiftLeft(1)).multiply(e.z).subtract(s).multiply(r).mod(this.curve.q),d=c.multiply(n).multiply(t).subtract(o.multiply(s)).subtract(u.multiply(t)).multiply(e.z).add(t.multiply(s)).mod(this.curve.q),p=s.multiply(this.z).multiply(e.z).mod(this.curve.q);return new oe(this.curve,this.curve.fromBigInteger(l),this.curve.fromBigInteger(d),p)},oe.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new _("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),n=r.multiply(this.z),i=n.multiply(r).mod(this.curve.q),o=this.curve.a.toBigInteger(),a=t.square().multiply(e);_.ZERO.equals(o)||(a=a.add(this.z.square().multiply(o)));var s=(a=a.mod(this.curve.q)).square().subtract(t.shiftLeft(3).multiply(i)).shiftLeft(1).multiply(n).mod(this.curve.q),c=a.multiply(e).multiply(t).subtract(i.shiftLeft(1)).shiftLeft(2).multiply(i).subtract(a.square().multiply(a)).mod(this.curve.q),u=n.square().multiply(n).shiftLeft(3).mod(this.curve.q);return new oe(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(c),u)},oe.prototype.multiply=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e,n=r.multiply(new _("3")),i=this.negate(),o=this,a=this.curve.q.subtract(e),s=a.multiply(new _("3")),c=new oe(this.curve,this.x,this.y),u=c.negate();for(t=n.bitLength()-2;t>0;--t){o=o.twice();var l=n.testBit(t);l!=r.testBit(t)&&(o=o.add(l?this:i))}for(t=s.bitLength()-2;t>0;--t){c=c.twice();var d=s.testBit(t);d!=a.testBit(t)&&(c=c.add(d?c:u))}return o},oe.prototype.multiplyTwo=function(e,t,r){var n;n=e.bitLength()>r.bitLength()?e.bitLength()-1:r.bitLength()-1;for(var i=this.curve.getInfinity(),o=this.add(t);n>=0;)i=i.twice(),e.testBit(n)?i=r.testBit(n)?i.add(o):i.add(this):r.testBit(n)&&(i=i.add(t)),--n;return i},ae.prototype.getQ=function(){return this.q},ae.prototype.getA=function(){return this.a},ae.prototype.getB=function(){return this.b},ae.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)},ae.prototype.getInfinity=function(){return this.infinity},ae.prototype.fromBigInteger=function(e){return new ie(this.q,e)},ae.prototype.decodePointHex=function(e){switch(parseInt(e.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:default:return null;case 4:case 6:case 7:var t=(e.length-2)/2,r=e.substr(2,t),n=e.substr(t+2,t);return new oe(this,this.fromBigInteger(new _(r,16)),this.fromBigInteger(new _(n,16)))}},ie.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},oe.prototype.getEncoded=function(e){var t=function(e,t){var r=e.toByteArrayUnsigned();if(t<r.length)r=r.slice(r.length-t);else for(;t>r.length;)r.unshift(0);return r},r=this.getX().toBigInteger(),n=this.getY().toBigInteger(),i=t(r,32);return e?n.isEven()?i.unshift(2):i.unshift(3):(i.unshift(4),i=i.concat(t(n,32))),i},oe.decodeFrom=function(e,t){t[0];var r=t.length-1,n=t.slice(1,1+r/2),i=t.slice(1+r/2,1+r);n.unshift(0),i.unshift(0);var o=new _(n),a=new _(i);return new oe(e,e.fromBigInteger(o),e.fromBigInteger(a))},oe.decodeFromHex=function(e,t){t.substr(0,2);var r=t.length-2,n=t.substr(2,r/2),i=t.substr(2+r/2,r/2),o=new _(n,16),a=new _(i,16);return new oe(e,e.fromBigInteger(o),e.fromBigInteger(a))},oe.prototype.add2D=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;if(this.x.equals(e.x))return this.y.equals(e.y)?this.twice():this.curve.getInfinity();var t=e.x.subtract(this.x),r=e.y.subtract(this.y).divide(t),n=r.square().subtract(this.x).subtract(e.x),i=r.multiply(this.x.subtract(n)).subtract(this.y);return new oe(this.curve,n,i)},oe.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=this.curve.fromBigInteger(_.valueOf(2)),t=this.curve.fromBigInteger(_.valueOf(3)),r=this.x.square().multiply(t).add(this.curve.a).divide(this.y.multiply(e)),n=r.square().subtract(this.x.multiply(e)),i=r.multiply(this.x.subtract(n)).subtract(this.y);return new oe(this.curve,n,i)},oe.prototype.multiply2D=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e,n=r.multiply(new _("3")),i=this.negate(),o=this;for(t=n.bitLength()-2;t>0;--t){o=o.twice();var a=n.testBit(t);a!=r.testBit(t)&&(o=o.add2D(a?this:i))}return o},oe.prototype.isOnCurve=function(){var e=this.getX().toBigInteger(),t=this.getY().toBigInteger(),r=this.curve.getA().toBigInteger(),n=this.curve.getB().toBigInteger(),i=this.curve.getQ(),o=t.multiply(t).mod(i),a=e.multiply(e).multiply(e).add(r.multiply(e)).add(n).mod(i);return o.equals(a)},oe.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},oe.prototype.validate=function(){var e=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var t=this.getX().toBigInteger(),r=this.getY().toBigInteger();if(t.compareTo(_.ONE)<0||t.compareTo(e.subtract(_.ONE))>0)throw new Error("x coordinate out of bounds");if(r.compareTo(_.ONE)<0||r.compareTo(e.subtract(_.ONE))>0)throw new Error("y coordinate out of bounds");if(!this.isOnCurve())throw new Error("Point is not on the curve.");if(this.multiply(e).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0};var se=function(){var e=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"),t=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),r={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function n(e,t,n){return t?r[t]:String.fromCharCode(parseInt(n,16))}var i=new String(""),o=Object.hasOwnProperty;return function(r,a){var s,c,u=r.match(e),l=u[0],d=!1;"{"===l?s={}:"["===l?s=[]:(s=[],d=!0);for(var p=[s],h=1-d,m=u.length;h<m;++h){var g;switch((l=u[h]).charCodeAt(0)){default:(g=p[0])[c||g.length]=+l,c=void 0;break;case 34:if(-1!==(l=l.substring(1,l.length-1)).indexOf("\\")&&(l=l.replace(t,n)),g=p[0],!c){if(!(g instanceof Array)){c=l||i;break}c=g.length}g[c]=l,c=void 0;break;case 91:g=p[0],p.unshift(g[c||g.length]=[]),c=void 0;break;case 93:case 125:p.shift();break;case 102:(g=p[0])[c||g.length]=!1,c=void 0;break;case 110:(g=p[0])[c||g.length]=null,c=void 0;break;case 116:(g=p[0])[c||g.length]=!0,c=void 0;break;case 123:g=p[0],p.unshift(g[c||g.length]={}),c=void 0}}if(d){if(1!==p.length)throw new Error;s=s[0]}else if(p.length)throw new Error;return a&&(s=function e(t,r){var n=t[r];if(n&&"object"===(void 0===n?"undefined":f(n))){var i=null;for(var s in n)if(o.call(n,s)&&n!==t){var c=e(n,s);void 0!==c?n[s]=c:(i||(i=[]),i.push(s))}if(i)for(var u=i.length;--u>=0;)delete n[i[u]]}return a.call(t,r,n)}({"":s},"")),s}}();void 0!==ce&&ce||(t.KJUR=ce={}),void 0!==ce.asn1&&ce.asn1||(ce.asn1={}),ce.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var r=t.substr(1).length;r%2==1?r+=1:t.match(/^[0-7]/)||(r+=2);for(var n="",i=0;i<r;i++)n+="f";t=new _(n,16).xor(e).add(_.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return Ce(e,t)},this.newObject=function(e){var t=ce.asn1,r=t.ASN1Object,n=t.DERBoolean,i=t.DERInteger,o=t.DERBitString,a=t.DEROctetString,s=t.DERNull,c=t.DERObjectIdentifier,u=t.DEREnumerated,l=t.DERUTF8String,d=t.DERNumericString,p=t.DERPrintableString,f=t.DERTeletexString,h=t.DERIA5String,m=t.DERUTCTime,g=t.DERGeneralizedTime,v=t.DERVisibleString,y=t.DERBMPString,b=t.DERSequence,w=t.DERSet,x=t.DERTaggedObject,_=t.ASN1Util.newObject;if(e instanceof t.ASN1Object)return e;var E=Object.keys(e);if(1!=E.length)throw new Error("key of param shall be only one.");var k=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(":"+k+":"))throw new Error("undefined key: "+k);if("bool"==k)return new n(e[k]);if("int"==k)return new i(e[k]);if("bitstr"==k)return new o(e[k]);if("octstr"==k)return new a(e[k]);if("null"==k)return new s(e[k]);if("oid"==k)return new c(e[k]);if("enum"==k)return new u(e[k]);if("utf8str"==k)return new l(e[k]);if("numstr"==k)return new d(e[k]);if("prnstr"==k)return new p(e[k]);if("telstr"==k)return new f(e[k]);if("ia5str"==k)return new h(e[k]);if("utctime"==k)return new m(e[k]);if("gentime"==k)return new g(e[k]);if("visstr"==k)return new v(e[k]);if("bmpstr"==k)return new y(e[k]);if("asn1"==k)return new r(e[k]);if("seq"==k){for(var S=e[k],A=[],C=0;C<S.length;C++){var T=_(S[C]);A.push(T)}return new b({array:A})}if("set"==k){for(S=e[k],A=[],C=0;C<S.length;C++)T=_(S[C]),A.push(T);return new w({array:A})}if("tag"==k){var O=e[k];if("[object Array]"===Object.prototype.toString.call(O)&&3==O.length){var P=_(O[2]);return new x({tag:O[0],explicit:O[1],obj:P})}return new x(O)}},this.jsonToASN1HEX=function(e){return this.newObject(e).getEncodedHex()}},ce.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",r=parseInt(e.substr(0,2),16),n=(t=Math.floor(r/40)+"."+r%40,""),i=2;i<e.length;i+=2){var o=("00000000"+parseInt(e.substr(i,2),16).toString(2)).slice(-8);n+=o.substr(1,7),"0"==o.substr(0,1)&&(t=t+"."+new _(n,2).toString(10),n="")}return t},ce.asn1.ASN1Util.oidIntToHex=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},r=function(e){var r="",n=new _(e,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var o="",a=0;a<i;a++)o+="0";for(n=o+n,a=0;a<n.length-1;a+=7){var s=n.substr(a,7);a!=n.length-7&&(s="1"+s),r+=t(parseInt(s,2))}return r};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",i=e.split("."),o=40*parseInt(i[0])+parseInt(i[1]);n+=t(o),i.splice(0,2);for(var a=0;a<i.length;a++)n+=r(i[a]);return n},ce.asn1.ASN1Object=function(e){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 e=this.hV.length/2,t=e.toString(16);if(t.length%2==1&&(t="0"+t),e<128)return t;var r=t.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);return(128+r).toString(16)+t},this.getEncodedHex=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.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""},this.setByParam=function(e){this.params=e},null!=e&&null!=e.tlv&&(this.hTLV=e.tlv,this.isModified=!1)},ce.asn1.DERAbstractString=function(e){ce.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=we(this.s).toLowerCase()},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?this.setString(e):void 0!==e.str?this.setString(e.str):void 0!==e.hex&&this.setStringHex(e.hex))},He(ce.asn1.DERAbstractString,ce.asn1.ASN1Object),ce.asn1.DERAbstractTime=function(e){ce.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){var t=e.getTime()+6e4*e.getTimezoneOffset();return new Date(t)},this.formatDate=function(e,t,r){var n=this.zeroPadding,i=this.localDateToUTC(e),o=String(i.getFullYear());"utc"==t&&(o=o.substr(2,2));var a=o+n(String(i.getMonth()+1),2)+n(String(i.getDate()),2)+n(String(i.getHours()),2)+n(String(i.getMinutes()),2)+n(String(i.getSeconds()),2);if(!0===r){var s=i.getMilliseconds();if(0!=s){var c=n(String(s),3);a=a+"."+(c=c.replace(/[0]+$/,""))}}return a+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=me(e)},this.setByDateValue=function(e,t,r,n,i,o){var a=new Date(Date.UTC(e,t-1,r,n,i,o,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}},He(ce.asn1.DERAbstractTime,ce.asn1.ASN1Object),ce.asn1.DERAbstractStructured=function(e){ce.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=new Array,void 0!==e&&void 0!==e.array&&(this.asn1Array=e.array)},He(ce.asn1.DERAbstractStructured,ce.asn1.ASN1Object),ce.asn1.DERBoolean=function(e){ce.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==e?"010100":"0101ff"},He(ce.asn1.DERBoolean,ce.asn1.ASN1Object),ce.asn1.DERInteger=function(e){ce.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=ce.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new _(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.bigint?this.setByBigInteger(e.bigint):void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},He(ce.asn1.DERInteger,ce.asn1.ASN1Object),ce.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=ce.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}ce.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var r="0"+e;this.hTLV=null,this.isModified=!0,this.hV=r+t},this.setByBinaryString=function(e){var t=8-(e=e.replace(/0+$/,"")).length%8;8==t&&(t=0);for(var r=0;r<=t;r++)e+="0";var n="";for(r=0;r<e.length-1;r+=8){var i=e.substr(r,8),o=parseInt(i,2).toString(16);1==o.length&&(o="0"+o),n+=o}this.hTLV=null,this.isModified=!0,this.hV="0"+t+n},this.setByBooleanArray=function(e){for(var t="",r=0;r<e.length;r++)1==e[r]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):void 0!==e.hex?this.setHexValueIncludingUnusedBits(e.hex):void 0!==e.bin?this.setByBinaryString(e.bin):void 0!==e.array&&this.setByBooleanArray(e.array))},He(ce.asn1.DERBitString,ce.asn1.ASN1Object),ce.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=ce.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}ce.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},He(ce.asn1.DEROctetString,ce.asn1.DERAbstractString),ce.asn1.DERNull=function(){ce.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},He(ce.asn1.DERNull,ce.asn1.ASN1Object),ce.asn1.DERObjectIdentifier=function(e){ce.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueOidString=function(e){var t=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},r=function(e){var r="",n=parseInt(e,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var o="",a=0;a<i;a++)o+="0";for(n=o+n,a=0;a<n.length-1;a+=7){var s=n.substr(a,7);a!=n.length-7&&(s="1"+s),r+=t(parseInt(s,2))}return r};try{if(!e.match(/^[0-9.]+$/))return null;var n="",i=e.split("."),o=40*parseInt(i[0],10)+parseInt(i[1],10);n+=t(o),i.splice(0,2);for(var a=0;a<i.length;a++)n+=r(i[a]);return n}catch(e){return null}}(e);if(null==t)throw new Error("malformed oid string: "+e);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueName=function(e){var t=ce.asn1.x509.OID.name2oid(e);if(""===t)throw new Error("DERObjectIdentifier oidName undefined: "+e);this.setValueOidString(t)},this.setValueNameOrOid=function(e){e.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(e):this.setValueName(e)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(e){"string"==typeof e?this.setValueNameOrOid(e):void 0!==e.oid?this.setValueNameOrOid(e.oid):void 0!==e.name?this.setValueNameOrOid(e.name):void 0!==e.hex&&this.setValueHex(e.hex)},void 0!==e&&this.setByParam(e)},He(ce.asn1.DERObjectIdentifier,ce.asn1.ASN1Object),ce.asn1.DEREnumerated=function(e){ce.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=ce.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new _(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},He(ce.asn1.DEREnumerated,ce.asn1.ASN1Object),ce.asn1.DERUTF8String=function(e){ce.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},He(ce.asn1.DERUTF8String,ce.asn1.DERAbstractString),ce.asn1.DERNumericString=function(e){ce.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},He(ce.asn1.DERNumericString,ce.asn1.DERAbstractString),ce.asn1.DERPrintableString=function(e){ce.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},He(ce.asn1.DERPrintableString,ce.asn1.DERAbstractString),ce.asn1.DERTeletexString=function(e){ce.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},He(ce.asn1.DERTeletexString,ce.asn1.DERAbstractString),ce.asn1.DERIA5String=function(e){ce.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},He(ce.asn1.DERIA5String,ce.asn1.DERAbstractString),ce.asn1.DERVisibleString=function(e){ce.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="1a"},He(ce.asn1.DERVisibleString,ce.asn1.DERAbstractString),ce.asn1.DERBMPString=function(e){ce.asn1.DERBMPString.superclass.constructor.call(this,e),this.hT="1e"},He(ce.asn1.DERBMPString,ce.asn1.DERAbstractString),ce.asn1.DERUTCTime=function(e){ce.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"utc"),this.hV=me(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=me(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{12}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date))},He(ce.asn1.DERUTCTime,ce.asn1.DERAbstractTime),ce.asn1.DERGeneralizedTime=function(e){ce.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.withMillis=!1,this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=me(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=me(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{14}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date),!0===e.millis&&(this.withMillis=!0))},He(ce.asn1.DERGeneralizedTime,ce.asn1.DERAbstractTime),ce.asn1.DERSequence=function(e){ce.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var e="",t=0;t<this.asn1Array.length;t++)e+=this.asn1Array[t].getEncodedHex();return this.hV=e,this.hV}},He(ce.asn1.DERSequence,ce.asn1.DERAbstractStructured),ce.asn1.DERSet=function(e){ce.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,t=0;t<this.asn1Array.length;t++){var r=this.asn1Array[t];e.push(r.getEncodedHex())}return 1==this.sortFlag&&e.sort(),this.hV=e.join(""),this.hV},void 0!==e&&void 0!==e.sortflag&&0==e.sortflag&&(this.sortFlag=!1)},He(ce.asn1.DERSet,ce.asn1.DERAbstractStructured),ce.asn1.DERTaggedObject=function(e){ce.asn1.DERTaggedObject.superclass.constructor.call(this);var t=ce.asn1;this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(e,t,r){this.hT=t,this.isExplicit=e,this.asn1Object=r,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=r.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(e){null!=e.tag&&(this.hT=e.tag),null!=e.explicit&&(this.isExplicit=e.explicit),null!=e.tage&&(this.hT=e.tage,this.isExplicit=!0),null!=e.tagi&&(this.hT=e.tagi,this.isExplicit=!1),null!=e.obj&&(e.obj instanceof t.ASN1Object?(this.asn1Object=e.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)):"object"==f(e.obj)&&(this.asn1Object=t.ASN1Util.newObject(e.obj),this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},null!=e&&this.setByParam(e)},He(ce.asn1.DERTaggedObject,ce.asn1.ASN1Object);var ce,ue,le,de=new function(){};function pe(e){for(var t=new Array,r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function fe(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}function he(e){for(var t="",r=0;r<e.length;r++){var n=e[r].toString(16);1==n.length&&(n="0"+n),t+=n}return t}function me(e){return he(pe(e))}function ge(e){return(e=(e=e.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function ve(e){return e.length%4==2?e+="==":e.length%4==3&&(e+="="),(e=e.replace(/-/g,"+")).replace(/_/g,"/")}function ye(e){return e.length%2==1&&(e="0"+e),ge(b(e))}function be(e){return w(ve(e))}function we(e){return Fe(De(e))}function xe(e){return decodeURIComponent(Ie(e))}function _e(e){for(var t="",r=0;r<e.length-1;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t}function Ee(e){for(var t="",r=0;r<e.length;r++)t+=("0"+e.charCodeAt(r).toString(16)).slice(-2);return t}function ke(e){return b(e)}function Se(e){return ke(e).replace(/(.{64})/g,"$1\r\n").replace(/\r\n$/,"")}function Ae(e){return w(e.replace(/[^0-9A-Za-z\/+=]*/g,""))}function Ce(e,t){return"-----BEGIN "+t+"-----\r\n"+Se(e)+"\r\n-----END "+t+"-----\r\n"}function Te(e,t){if(-1==e.indexOf("-----BEGIN "))throw"can't find PEM header: "+t;return Ae(e=void 0!==t?(e=e.replace(new RegExp("^[^]*-----BEGIN "+t+"-----"),"")).replace(new RegExp("-----END "+t+"-----[^]*$"),""):(e=e.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function Oe(e){var t,r,n,i,o,a,s,c,u,l,d;if(d=e.match(/^(\d{2}|\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/))return c=d[1],t=parseInt(c),2===c.length&&(50<=t&&t<100?t=1900+t:0<=t&&t<50&&(t=2e3+t)),r=parseInt(d[2])-1,n=parseInt(d[3]),i=parseInt(d[4]),o=parseInt(d[5]),a=parseInt(d[6]),s=0,""!==(u=d[7])&&(l=(u.substr(1)+"00").substr(0,3),s=parseInt(l)),Date.UTC(t,r,n,i,o,a,s);throw"unsupported zulu format: "+e}function Pe(e){return~~(Oe(e)/1e3)}function Fe(e){return e.replace(/%/g,"")}function Ie(e){return e.replace(/(..)/g,"%$1")}function Ne(e){var t="malformed IPv6 address";if(!e.match(/^[0-9A-Fa-f:]+$/))throw t;var r=(e=e.toLowerCase()).split(":").length-1;if(r<2)throw t;var n=":".repeat(7-r+2),i=(e=e.replace("::",n)).split(":");if(8!=i.length)throw t;for(var o=0;o<8;o++)i[o]=("0000"+i[o]).slice(-4);return i.join("")}function je(e){if(!e.match(/^[0-9A-Fa-f]{32}$/))throw"malformed IPv6 address octet";for(var t=(e=e.toLowerCase()).match(/.{1,4}/g),r=0;r<8;r++)t[r]=t[r].replace(/^0+/,""),""==t[r]&&(t[r]="0");var n=(e=":"+t.join(":")+":").match(/:(0:){2,}/g);if(null===n)return e.slice(1,-1);var i="";for(r=0;r<n.length;r++)n[r].length>i.length&&(i=n[r]);return(e=e.replace(i,"::")).slice(1,-1)}function Re(e){var t="malformed hex value";if(!e.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw t;if(8!=e.length)return 32==e.length?je(e):e;try{return parseInt(e.substr(0,2),16)+"."+parseInt(e.substr(2,2),16)+"."+parseInt(e.substr(4,2),16)+"."+parseInt(e.substr(6,2),16)}catch(e){throw t}}function Le(e){return e.match(/.{4}/g).map((function(e){var t=parseInt(e.substr(0,2),16),r=parseInt(e.substr(2),16);if(0==t&r<128)return String.fromCharCode(r);if(t<8){var n=128|63&r;return xe((192|(7&t)<<3|(192&r)>>6).toString(16)+n.toString(16))}n=128|(15&t)<<2|(192&r)>>6;var i=128|63&r;return xe((224|(240&t)>>4).toString(16)+n.toString(16)+i.toString(16))})).join("")}function De(e){for(var t=encodeURIComponent(e),r="",n=0;n<t.length;n++)"%"==t[n]?(r+=t.substr(n,3),n+=2):r=r+"%"+me(t[n]);return r}function Me(e){return!(e.length%2!=0||!e.match(/^[0-9a-f]+$/)&&!e.match(/^[0-9A-F]+$/))}function Ue(e){return e.length%2==1?"0"+e:e.substr(0,1)>"7"?"00"+e:e}de.getLblen=function(e,t){if("8"!=e.substr(t+2,1))return 1;var r=parseInt(e.substr(t+3,1));return 0==r?-1:0<r&&r<10?r+1:-2},de.getL=function(e,t){var r=de.getLblen(e,t);return r<1?"":e.substr(t+2,2*r)},de.getVblen=function(e,t){var r;return""==(r=de.getL(e,t))?-1:("8"===r.substr(0,1)?new _(r.substr(2),16):new _(r,16)).intValue()},de.getVidx=function(e,t){var r=de.getLblen(e,t);return r<0?r:t+2*(r+1)},de.getV=function(e,t){var r=de.getVidx(e,t),n=de.getVblen(e,t);return e.substr(r,2*n)},de.getTLV=function(e,t){return e.substr(t,2)+de.getL(e,t)+de.getV(e,t)},de.getTLVblen=function(e,t){return 2+2*de.getLblen(e,t)+2*de.getVblen(e,t)},de.getNextSiblingIdx=function(e,t){return de.getVidx(e,t)+2*de.getVblen(e,t)},de.getChildIdx=function(e,t){var r,n,i,o=de,a=[];r=o.getVidx(e,t),n=2*o.getVblen(e,t),"03"==e.substr(t,2)&&(r+=2,n-=2),i=0;for(var s=r;i<=n;){var c=o.getTLVblen(e,s);if((i+=c)<=n&&a.push(s),s+=c,i>=n)break}return a},de.getNthChildIdx=function(e,t,r){return de.getChildIdx(e,t)[r]},de.getIdxbyList=function(e,t,r,n){var i,o,a=de;return 0==r.length?void 0!==n&&e.substr(t,2)!==n?-1:t:(i=r.shift())>=(o=a.getChildIdx(e,t)).length?-1:a.getIdxbyList(e,o[i],r,n)},de.getIdxbyListEx=function(e,t,r,n){var i,o,a=de;if(0==r.length)return void 0!==n&&e.substr(t,2)!==n?-1:t;i=r.shift(),o=a.getChildIdx(e,t);for(var s=0,c=0;c<o.length;c++){var u=e.substr(o[c],2);if("number"==typeof i&&!a.isContextTag(u)&&s==i||"string"==typeof i&&a.isContextTag(u,i))return a.getIdxbyListEx(e,o[c],r,n);a.isContextTag(u)||s++}return-1},de.getTLVbyList=function(e,t,r,n){var i=de,o=i.getIdxbyList(e,t,r,n);return-1==o||o>=e.length?null:i.getTLV(e,o)},de.getTLVbyListEx=function(e,t,r,n){var i=de,o=i.getIdxbyListEx(e,t,r,n);return-1==o?null:i.getTLV(e,o)},de.getVbyList=function(e,t,r,n,i){var o,a,s=de;return-1==(o=s.getIdxbyList(e,t,r,n))||o>=e.length?null:(a=s.getV(e,o),!0===i&&(a=a.substr(2)),a)},de.getVbyListEx=function(e,t,r,n,i){var o,a,s=de;return-1==(o=s.getIdxbyListEx(e,t,r,n))?null:(a=s.getV(e,o),"03"==e.substr(o,2)&&!1!==i&&(a=a.substr(2)),a)},de.getInt=function(e,t,r){null==r&&(r=-1);try{var n=e.substr(t,2);if("02"!=n&&"03"!=n)return r;var i=de.getV(e,t);return"02"==n?parseInt(i,16):function(e){try{var t=e.substr(0,2);if("00"==t)return parseInt(e.substr(2),16);var r=parseInt(t,16),n=e.substr(2),i=parseInt(n,16).toString(2);return"0"==i&&(i="00000000"),i=i.slice(0,0-r),parseInt(i,2)}catch(e){return-1}}(i)}catch(e){return r}},de.getOID=function(e,t,r){null==r&&(r=null);try{return"06"!=e.substr(t,2)?r:function(e){if(!Me(e))return null;try{var t=[],r=e.substr(0,2),n=parseInt(r,16);t[0]=new String(Math.floor(n/40)),t[1]=new String(n%40);for(var i=e.substr(2),o=[],a=0;a<i.length/2;a++)o.push(parseInt(i.substr(2*a,2),16));var s=[],c="";for(a=0;a<o.length;a++)128&o[a]?c+=Be((127&o[a]).toString(2),7):(c+=Be((127&o[a]).toString(2),7),s.push(new String(parseInt(c,2))),c="");var u=t.join(".");return s.length>0&&(u=u+"."+s.join(".")),u}catch(e){return null}}(de.getV(e,t))}catch(e){return r}},de.getOIDName=function(e,t,r){null==r&&(r=null);try{var n=de.getOID(e,t,r);if(n==r)return r;var i=ce.asn1.x509.OID.oid2name(n);return""==i?n:i}catch(e){return r}},de.getString=function(e,t,r){null==r&&(r=null);try{return _e(de.getV(e,t))}catch(e){return r}},de.hextooidstr=function(e){var t=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},r=[],n=e.substr(0,2),i=parseInt(n,16);r[0]=new String(Math.floor(i/40)),r[1]=new String(i%40);for(var o=e.substr(2),a=[],s=0;s<o.length/2;s++)a.push(parseInt(o.substr(2*s,2),16));var c=[],u="";for(s=0;s<a.length;s++)128&a[s]?u+=t((127&a[s]).toString(2),7):(u+=t((127&a[s]).toString(2),7),c.push(new String(parseInt(u,2))),u="");var l=r.join(".");return c.length>0&&(l=l+"."+c.join(".")),l},de.dump=function(e,t,r,n){var i=de,o=i.getV,a=i.dump,s=i.getChildIdx,c=e;e instanceof ce.asn1.ASN1Object&&(c=e.getEncodedHex());var u=function(e,t){return e.length<=2*t?e:e.substr(0,t)+"..(total "+e.length/2+"bytes).."+e.substr(e.length-t,t)};void 0===t&&(t={ommit_long_octet:32}),void 0===r&&(r=0),void 0===n&&(n="");var l,d=t.ommit_long_octet;if("01"==(l=c.substr(r,2)))return"00"==(p=o(c,r))?n+"BOOLEAN FALSE\n":n+"BOOLEAN TRUE\n";if("02"==l)return n+"INTEGER "+u(p=o(c,r),d)+"\n";if("03"==l){var p=o(c,r);return i.isASN1HEX(p.substr(2))?(x=n+"BITSTRING, encapsulates\n")+a(p.substr(2),t,0,n+" "):n+"BITSTRING "+u(p,d)+"\n"}if("04"==l)return p=o(c,r),i.isASN1HEX(p)?(x=n+"OCTETSTRING, encapsulates\n")+a(p,t,0,n+" "):n+"OCTETSTRING "+u(p,d)+"\n";if("05"==l)return n+"NULL\n";if("06"==l){var f=o(c,r),h=ce.asn1.ASN1Util.oidHexToInt(f),m=ce.asn1.x509.OID.oid2name(h),g=h.replace(/\./g," ");return""!=m?n+"ObjectIdentifier "+m+" ("+g+")\n":n+"ObjectIdentifier ("+g+")\n"}if("0a"==l)return n+"ENUMERATED "+parseInt(o(c,r))+"\n";if("0c"==l)return n+"UTF8String '"+xe(o(c,r))+"'\n";if("13"==l)return n+"PrintableString '"+xe(o(c,r))+"'\n";if("14"==l)return n+"TeletexString '"+xe(o(c,r))+"'\n";if("16"==l)return n+"IA5String '"+xe(o(c,r))+"'\n";if("17"==l)return n+"UTCTime "+xe(o(c,r))+"\n";if("18"==l)return n+"GeneralizedTime "+xe(o(c,r))+"\n";if("1a"==l)return n+"VisualString '"+xe(o(c,r))+"'\n";if("1e"==l)return n+"BMPString '"+Le(o(c,r))+"'\n";if("30"==l){if("3000"==c.substr(r,4))return n+"SEQUENCE {}\n";x=n+"SEQUENCE\n";var v=t;if((2==(w=s(c,r)).length||3==w.length)&&"06"==c.substr(w[0],2)&&"04"==c.substr(w[w.length-1],2)){m=i.oidname(o(c,w[0]));var y=JSON.parse(JSON.stringify(t));y.x509ExtName=m,v=y}for(var b=0;b<w.length;b++)x+=a(c,v,w[b],n+" ");return x}if("31"==l){x=n+"SET\n";var w=s(c,r);for(b=0;b<w.length;b++)x+=a(c,t,w[b],n+" ");return x}if(0!=(128&(l=parseInt(l,16)))){var x,_=31&l;if(0!=(32&l)){for(x=n+"["+_+"]\n",w=s(c,r),b=0;b<w.length;b++)x+=a(c,t,w[b],n+" ");return x}return p=o(c,r),de.isASN1HEX(p)?(x=n+"["+_+"]\n")+a(p,t,0,n+" "):(("68747470"==p.substr(0,8)||"subjectAltName"===t.x509ExtName&&2==_)&&(p=xe(p)),n+"["+_+"] "+p+"\n")}return n+"UNKNOWN("+l+") "+o(c,r)+"\n"},de.isContextTag=function(e,t){var r,n;e=e.toLowerCase();try{r=parseInt(e,16)}catch(e){return-1}if(void 0===t)return 128==(192&r);try{return null!=t.match(/^\[[0-9]+\]$/)&&!((n=parseInt(t.substr(1,t.length-1),10))>31)&&128==(192&r)&&(31&r)==n}catch(e){return!1}},de.isASN1HEX=function(e){var t=de;if(e.length%2==1)return!1;var r=t.getVblen(e,0),n=e.substr(0,2),i=t.getL(e,0);return e.length-n.length-i.length==2*r},de.checkStrictDER=function(e,t,r,n,i){var o=de;if(void 0===r){if("string"!=typeof e)throw new Error("not hex string");if(e=e.toLowerCase(),!ce.lang.String.isHex(e))throw new Error("not hex string");r=e.length,i=(n=e.length/2)<128?1:Math.ceil(n.toString(16))+1}if(o.getL(e,t).length>2*i)throw new Error("L of TLV too long: idx="+t);var a=o.getVblen(e,t);if(a>n)throw new Error("value of L too long than hex: idx="+t);var s=o.getTLV(e,t),c=s.length-2-o.getL(e,t).length;if(c!==2*a)throw new Error("V string length and L's value not the same:"+c+"/"+2*a);if(0===t&&e.length!=s.length)throw new Error("total length and TLV length unmatch:"+e.length+"!="+s.length);var u=e.substr(t,2);if("02"===u){var l=o.getVidx(e,t);if("00"==e.substr(l,2)&&e.charCodeAt(l+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(u,16)){for(var d=o.getVblen(e,t),p=0,f=o.getChildIdx(e,t),h=0;h<f.length;h++)p+=o.getTLV(e,f[h]).length,o.checkStrictDER(e,f[h],r,n,i);if(2*d!=p)throw new Error("sum of children's TLV length and L unmatch: "+2*d+"!="+p)}},de.oidname=function(e){var t=ce.asn1;ce.lang.String.isHex(e)&&(e=t.ASN1Util.oidHexToInt(e));var r=t.x509.OID.oid2name(e);return""===r&&(r=e),r},void 0!==ce&&ce||(t.KJUR=ce={}),void 0!==ce.lang&&ce.lang||(ce.lang={}),ce.lang.String=function(){},"function"==typeof e?(t.utf8tob64u=ue=function(t){return ge(e.from(t,"utf8").toString("base64"))},t.b64utoutf8=le=function(t){return e.from(ve(t),"base64").toString("utf8")}):(t.utf8tob64u=ue=function(e){return ye(Fe(De(e)))},t.b64utoutf8=le=function(e){return decodeURIComponent(Ie(be(e)))}),ce.lang.String.isInteger=function(e){return!!e.match(/^[0-9]+$/)||!!e.match(/^-[0-9]+$/)},ce.lang.String.isHex=function(e){return Me(e)},ce.lang.String.isBase64=function(e){return!(!(e=e.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||e.length%4!=0)},ce.lang.String.isBase64URL=function(e){return!e.match(/[+/=]/)&&(e=ve(e),ce.lang.String.isBase64(e))},ce.lang.String.isIntegerArray=function(e){return!!(e=e.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},ce.lang.String.isPrintable=function(e){return null!==e.match(/^[0-9A-Za-z '()+,-./:=?]*$/)},ce.lang.String.isIA5=function(e){return null!==e.match(/^[\x20-\x21\x23-\x7f]*$/)},ce.lang.String.isMail=function(e){return null!==e.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)};var Be=function(e,t,r){return null==r&&(r="0"),e.length>=t?e:new Array(t-e.length+1).join(r)+e};function He(e,t){var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e,e.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t)}void 0!==ce&&ce||(t.KJUR=ce={}),void 0!==ce.crypto&&ce.crypto||(ce.crypto={}),ce.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(e,t){if(void 0===this.DIGESTINFOHEAD[t])throw"alg not supported in Util.DIGESTINFOHEAD: "+t;return this.DIGESTINFOHEAD[t]+e},this.getPaddedDigestInfoHex=function(e,t,r){var n=this.getDigestInfoHex(e,t),i=r/4;if(n.length+22>i)throw"key is too short for SigAlg: keylen="+r+","+t;for(var o="0001",a="00"+n,s="",c=i-o.length-a.length,u=0;u<c;u+=2)s+="ff";return o+s+a},this.hashString=function(e,t){return new ce.crypto.MessageDigest({alg:t}).digestString(e)},this.hashHex=function(e,t){return new ce.crypto.MessageDigest({alg:t}).digestHex(e)},this.sha1=function(e){return this.hashString(e,"sha1")},this.sha256=function(e){return this.hashString(e,"sha256")},this.sha256Hex=function(e){return this.hashHex(e,"sha256")},this.sha512=function(e){return this.hashString(e,"sha512")},this.sha512Hex=function(e){return this.hashHex(e,"sha512")},this.isKey=function(e){return e instanceof ne||e instanceof ce.crypto.DSA||e instanceof ce.crypto.ECDSA}},ce.crypto.Util.md5=function(e){return new ce.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(e)},ce.crypto.Util.ripemd160=function(e){return new ce.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(e)},ce.crypto.Util.SECURERANDOMGEN=new ee,ce.crypto.Util.getRandomHexOfNbytes=function(e){var t=new Array(e);return ce.crypto.Util.SECURERANDOMGEN.nextBytes(t),he(t)},ce.crypto.Util.getRandomBigIntegerOfNbytes=function(e){return new _(ce.crypto.Util.getRandomHexOfNbytes(e),16)},ce.crypto.Util.getRandomHexOfNbits=function(e){var t=e%8,r=new Array((e-t)/8+1);return ce.crypto.Util.SECURERANDOMGEN.nextBytes(r),r[0]=(255<<t&255^255)&r[0],he(r)},ce.crypto.Util.getRandomBigIntegerOfNbits=function(e){return new _(ce.crypto.Util.getRandomHexOfNbits(e),16)},ce.crypto.Util.getRandomBigIntegerZeroToMax=function(e){for(var t=e.bitLength();;){var r=ce.crypto.Util.getRandomBigIntegerOfNbits(t);if(-1!=e.compareTo(r))return r}},ce.crypto.Util.getRandomBigIntegerMinToMax=function(e,t){var r=e.compareTo(t);if(1==r)throw"biMin is greater than biMax";if(0==r)return e;var n=t.subtract(e);return ce.crypto.Util.getRandomBigIntegerZeroToMax(n).add(e)},ce.crypto.MessageDigest=function(e){this.setAlgAndProvider=function(e,t){if(null!==(e=ce.crypto.MessageDigest.getCanonicalAlgName(e))&&void 0===t&&(t=ce.crypto.Util.DEFAULTPROVIDER[e]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(e)&&"cryptojs"==t){try{this.md=ce.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[e].create()}catch(t){throw"setAlgAndProvider hash alg set fail alg="+e+"/"+t}this.updateString=function(e){this.md.update(e)},this.updateHex=function(e){var t=g.enc.Hex.parse(e);this.md.update(t)},this.digest=function(){return this.md.finalize().toString(g.enc.Hex)},this.digestString=function(e){return this.updateString(e),this.digest()},this.digestHex=function(e){return this.updateHex(e),this.digest()}}if(-1!=":sha256:".indexOf(e)&&"sjcl"==t){try{this.md=new sjcl.hash.sha256}catch(t){throw"setAlgAndProvider hash alg set fail alg="+e+"/"+t}this.updateString=function(e){this.md.update(e)},this.updateHex=function(e){var t=sjcl.codec.hex.toBits(e);this.md.update(t)},this.digest=function(){var e=this.md.finalize();return sjcl.codec.hex.fromBits(e)},this.digestString=function(e){return this.updateString(e),this.digest()},this.digestHex=function(e){return this.updateHex(e),this.digest()}}},this.updateString=function(e){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(e){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(e){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(e){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==e&&void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov&&(this.provName=ce.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},ce.crypto.MessageDigest.getCanonicalAlgName=function(e){return"string"==typeof e&&(e=(e=e.toLowerCase()).replace(/-/,"")),e},ce.crypto.MessageDigest.getHashLength=function(e){var t=ce.crypto.MessageDigest,r=t.getCanonicalAlgName(e);if(void 0===t.HASHLENGTH[r])throw"not supported algorithm: "+e;return t.HASHLENGTH[r]},ce.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},ce.crypto.Mac=function(e){this.setAlgAndProvider=function(e,t){if(null==(e=e.toLowerCase())&&(e="hmacsha1"),"hmac"!=(e=e.toLowerCase()).substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+e;void 0===t&&(t=ce.crypto.Util.DEFAULTPROVIDER[e]),this.algProv=e+"/"+t;var r=e.substr(4);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(r)&&"cryptojs"==t){try{var n=ce.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[r];this.mac=g.algo.HMAC.create(n,this.pass)}catch(e){throw"setAlgAndProvider hash alg set fail hashAlg="+r+"/"+e}this.updateString=function(e){this.mac.update(e)},this.updateHex=function(e){var t=g.enc.Hex.parse(e);this.mac.update(t)},this.doFinal=function(){return this.mac.finalize().toString(g.enc.Hex)},this.doFinalString=function(e){return this.updateString(e),this.doFinal()},this.doFinalHex=function(e){return this.updateHex(e),this.doFinal()}}},this.updateString=function(e){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(e){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(e){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(e){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(e){if("string"==typeof e){var t=e;return e.length%2!=1&&e.match(/^[0-9A-Fa-f]+$/)||(t=Ee(e)),void(this.pass=g.enc.Hex.parse(t))}if("object"!=(void 0===e?"undefined":f(e)))throw"KJUR.crypto.Mac unsupported password type: "+e;if(t=null,void 0!==e.hex){if(e.hex.length%2!=0||!e.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+e.hex;t=e.hex}if(void 0!==e.utf8&&(t=we(e.utf8)),void 0!==e.rstr&&(t=Ee(e.rstr)),void 0!==e.b64&&(t=w(e.b64)),void 0!==e.b64u&&(t=be(e.b64u)),null==t)throw"KJUR.crypto.Mac unsupported password type: "+e;this.pass=g.enc.Hex.parse(t)},void 0!==e&&(void 0!==e.pass&&this.setPassword(e.pass),void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov&&(this.provName=ce.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},ce.crypto.Signature=function(e){var t=null;if(this._setAlgNames=function(){var e=this.algName.match(/^(.+)with(.+)$/);e&&(this.mdAlgName=e[1].toLowerCase(),this.pubkeyAlgName=e[2].toLowerCase(),"rsaandmgf1"==this.pubkeyAlgName&&"sha"==this.mdAlgName&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(e,t){for(var r="",n=t/4-e.length,i=0;i<n;i++)r+="0";return r+e},this.setAlgAndProvider=function(e,t){if(this._setAlgNames(),"cryptojs/jsrsa"!=t)throw new Error("provider not supported: "+t);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new ce.crypto.MessageDigest({alg:this.mdAlgName})}catch(e){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+e)}this.init=function(e,t){var r=null;try{r=void 0===t?qe.getKey(e):qe.getKey(e,t)}catch(e){throw"init failed:"+e}if(!0===r.isPrivate)this.prvKey=r,this.state="SIGN";else{if(!0!==r.isPublic)throw"init failed.:"+r;this.pubKey=r,this.state="VERIFY"}},this.updateString=function(e){this.md.updateString(e)},this.updateHex=function(e){this.md.updateHex(e)},this.sign=function(){if(this.sHashHex=this.md.digest(),void 0===this.prvKey&&void 0!==this.ecprvhex&&void 0!==this.eccurvename&&void 0!==ce.crypto.ECDSA&&(this.prvKey=new ce.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof ne&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof ne&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof ce.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof ce.crypto.DSA))throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(e){return this.updateString(e),this.sign()},this.signHex=function(e){return this.updateHex(e),this.sign()},this.verify=function(e){if(this.sHashHex=this.md.digest(),void 0===this.pubKey&&void 0!==this.ecpubhex&&void 0!==this.eccurvename&&void 0!==ce.crypto.ECDSA&&(this.pubKey=new ce.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof ne&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,e,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof ne&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);if(void 0!==ce.crypto.ECDSA&&this.pubKey instanceof ce.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);if(void 0!==ce.crypto.DSA&&this.pubKey instanceof ce.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(e,t){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(e){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(e){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(e){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(e){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(e){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=e,void 0!==e&&(void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov?this.provName=ce.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=e.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==e.psssaltlen&&(this.pssSaltLen=e.psssaltlen),void 0!==e.prvkeypem)){if(void 0!==e.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{t=qe.getKey(e.prvkeypem),this.init(t)}catch(e){throw"fatal error to load pem private key: "+e}}},ce.crypto.Cipher=function(e){},ce.crypto.Cipher.encrypt=function(e,t,r){if(t instanceof ne&&t.isPublic){var n=ce.crypto.Cipher.getAlgByKeyAndName(t,r);if("RSA"===n)return t.encrypt(e);if("RSAOAEP"===n)return t.encryptOAEP(e,"sha1");var i=n.match(/^RSAOAEP(\d+)$/);if(null!==i)return t.encryptOAEP(e,"sha"+i[1]);throw"Cipher.encrypt: unsupported algorithm for RSAKey: "+r}throw"Cipher.encrypt: unsupported key or algorithm"},ce.crypto.Cipher.decrypt=function(e,t,r){if(t instanceof ne&&t.isPrivate){var n=ce.crypto.Cipher.getAlgByKeyAndName(t,r);if("RSA"===n)return t.decrypt(e);if("RSAOAEP"===n)return t.decryptOAEP(e,"sha1");var i=n.match(/^RSAOAEP(\d+)$/);if(null!==i)return t.decryptOAEP(e,"sha"+i[1]);throw"Cipher.decrypt: unsupported algorithm for RSAKey: "+r}throw"Cipher.decrypt: unsupported key or algorithm"},ce.crypto.Cipher.getAlgByKeyAndName=function(e,t){if(e instanceof ne){if(-1!=":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(t))return t;if(null==t)return"RSA";throw"getAlgByKeyAndName: not supported algorithm name for RSAKey: "+t}throw"getAlgByKeyAndName: not supported algorithm name: "+t},ce.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040023":"secp521r1","2b81040022":"secp384r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}},void 0!==ce&&ce||(t.KJUR=ce={}),void 0!==ce.crypto&&ce.crypto||(ce.crypto={}),ce.crypto.ECDSA=function(e){var t=Error,r=_,n=oe,i=ce.crypto.ECDSA,o=ce.crypto.ECParameterDB,a=i.getName,s=de,c=s.getVbyListEx,u=s.isASN1HEX,l=new ee;this.type="EC",this.isPrivate=!1,this.isPublic=!1,this.getBigRandom=function(e){return new r(e.bitLength(),l).mod(e.subtract(r.ONE)).add(r.ONE)},this.setNamedCurve=function(e){this.ecparams=o.getByName(e),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=e},this.setPrivateKeyHex=function(e){this.isPrivate=!0,this.prvKeyHex=e},this.setPublicKeyHex=function(e){this.isPublic=!0,this.pubKeyHex=e},this.getPublicKeyXYHex=function(){var e=this.pubKeyHex;if("04"!==e.substr(0,2))throw"this method supports uncompressed format(04) only";var t=this.ecparams.keylen/4;if(e.length!==2+2*t)throw"malformed public key hex length";var r={};return r.x=e.substr(2,t),r.y=e.substr(2+t),r},this.getShortNISTPCurveName=function(){var e=this.curveName;return"secp256r1"===e||"NIST P-256"===e||"P-256"===e||"prime256v1"===e?"P-256":"secp384r1"===e||"NIST P-384"===e||"P-384"===e?"P-384":null},this.generateKeyPairHex=function(){var e=this.ecparams.n,t=this.getBigRandom(e),r=this.ecparams.G.multiply(t),n=r.getX().toBigInteger(),i=r.getY().toBigInteger(),o=this.ecparams.keylen/4,a=("0000000000"+t.toString(16)).slice(-o),s="04"+("0000000000"+n.toString(16)).slice(-o)+("0000000000"+i.toString(16)).slice(-o);return this.setPrivateKeyHex(a),this.setPublicKeyHex(s),{ecprvhex:a,ecpubhex:s}},this.signWithMessageHash=function(e){return this.signHex(e,this.prvKeyHex)},this.signHex=function(e,t){var n=new r(t,16),o=this.ecparams.n,a=new r(e.substring(0,this.ecparams.keylen/4),16);do{var s=this.getBigRandom(o),c=this.ecparams.G.multiply(s).getX().toBigInteger().mod(o)}while(c.compareTo(r.ZERO)<=0);var u=s.modInverse(o).multiply(a.add(n.multiply(c))).mod(o);return i.biRSSigToASN1Sig(c,u)},this.sign=function(e,t){var n=t,i=this.ecparams.n,o=r.fromByteArrayUnsigned(e);do{var a=this.getBigRandom(i),s=this.ecparams.G.multiply(a).getX().toBigInteger().mod(i)}while(s.compareTo(_.ZERO)<=0);var c=a.modInverse(i).multiply(o.add(n.multiply(s))).mod(i);return this.serializeSig(s,c)},this.verifyWithMessageHash=function(e,t){return this.verifyHex(e,t,this.pubKeyHex)},this.verifyHex=function(e,t,o){try{var a,s,c=i.parseSigHex(t);a=c.r,s=c.s;var u=n.decodeFromHex(this.ecparams.curve,o),l=new r(e.substring(0,this.ecparams.keylen/4),16);return this.verifyRaw(l,a,s,u)}catch(e){return!1}},this.verify=function(e,t,i){var o,a,s;if(Bitcoin.Util.isArray(t)){var c=this.parseSig(t);o=c.r,a=c.s}else{if("object"!==(void 0===t?"undefined":f(t))||!t.r||!t.s)throw"Invalid value for signature";o=t.r,a=t.s}if(i instanceof oe)s=i;else{if(!Bitcoin.Util.isArray(i))throw"Invalid format for pubkey value, must be byte array or ECPointFp";s=n.decodeFrom(this.ecparams.curve,i)}var u=r.fromByteArrayUnsigned(e);return this.verifyRaw(u,o,a,s)},this.verifyRaw=function(e,t,n,i){var o=this.ecparams.n,a=this.ecparams.G;if(t.compareTo(r.ONE)<0||t.compareTo(o)>=0)return!1;if(n.compareTo(r.ONE)<0||n.compareTo(o)>=0)return!1;var s=n.modInverse(o),c=e.multiply(s).mod(o),u=t.multiply(s).mod(o);return a.multiply(c).add(i.multiply(u)).getX().toBigInteger().mod(o).equals(t)},this.serializeSig=function(e,t){var r=e.toByteArraySigned(),n=t.toByteArraySigned(),i=[];return i.push(2),i.push(r.length),(i=i.concat(r)).push(2),i.push(n.length),(i=i.concat(n)).unshift(i.length),i.unshift(48),i},this.parseSig=function(e){var t;if(48!=e[0])throw new Error("Signature not a valid DERSequence");if(2!=e[t=2])throw new Error("First element in signature must be a DERInteger");var n=e.slice(t+2,t+2+e[t+1]);if(2!=e[t+=2+e[t+1]])throw new Error("Second element in signature must be a DERInteger");var i=e.slice(t+2,t+2+e[t+1]);return t+=2+e[t+1],{r:r.fromByteArrayUnsigned(n),s:r.fromByteArrayUnsigned(i)}},this.parseSigCompact=function(e){if(65!==e.length)throw"Signature has the wrong length";var t=e[0]-27;if(t<0||t>7)throw"Invalid signature type";var n=this.ecparams.n;return{r:r.fromByteArrayUnsigned(e.slice(1,33)).mod(n),s:r.fromByteArrayUnsigned(e.slice(33,65)).mod(n),i:t}},this.readPKCS5PrvKeyHex=function(e){if(!1===u(e))throw new Error("not ASN.1 hex string");var t,r,n;try{t=c(e,0,["[0]",0],"06"),r=c(e,0,[1],"04");try{n=c(e,0,["[1]",0],"03")}catch(e){}}catch(e){throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=a(t),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(n),this.setPrivateKeyHex(r),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(e){if(!1===u(e))throw new t("not ASN.1 hex string");var r,n,i;try{c(e,0,[1,0],"06"),r=c(e,0,[1,1],"06"),n=c(e,0,[2,0,1],"04");try{i=c(e,0,[2,0,"[1]",0],"03")}catch(e){}}catch(e){throw new t("malformed PKCS#8 plain ECC private key")}if(this.curveName=a(r),void 0===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i),this.setPrivateKeyHex(n),this.isPublic=!1},this.readPKCS8PubKeyHex=function(e){if(!1===u(e))throw new t("not ASN.1 hex string");var r,n;try{c(e,0,[0,0],"06"),r=c(e,0,[0,1],"06"),n=c(e,0,[1],"03")}catch(e){throw new t("malformed PKCS#8 ECC public key")}if(this.curveName=a(r),null===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(n)},this.readCertPubKeyHex=function(e,r){if(!1===u(e))throw new t("not ASN.1 hex string");var n,i;try{n=c(e,0,[0,5,0,1],"06"),i=c(e,0,[0,5,1],"03")}catch(e){throw new t("malformed X.509 certificate ECC public key")}if(this.curveName=a(n),null===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i)},void 0!==e&&void 0!==e.curve&&(this.curveName=e.curve),void 0===this.curveName&&(this.curveName="secp256r1"),this.setNamedCurve(this.curveName),void 0!==e&&(void 0!==e.prv&&this.setPrivateKeyHex(e.prv),void 0!==e.pub&&this.setPublicKeyHex(e.pub))},ce.crypto.ECDSA.parseSigHex=function(e){var t=ce.crypto.ECDSA.parseSigHexInHexRS(e);return{r:new _(t.r,16),s:new _(t.s,16)}},ce.crypto.ECDSA.parseSigHexInHexRS=function(e){var t=de,r=t.getChildIdx,n=t.getV;if(t.checkStrictDER(e,0),"30"!=e.substr(0,2))throw new Error("signature is not a ASN.1 sequence");var i=r(e,0);if(2!=i.length)throw new Error("signature shall have two elements");var o=i[0],a=i[1];if("02"!=e.substr(o,2))throw new Error("1st item not ASN.1 integer");if("02"!=e.substr(a,2))throw new Error("2nd item not ASN.1 integer");return{r:n(e,o),s:n(e,a)}},ce.crypto.ECDSA.asn1SigToConcatSig=function(e){var t=ce.crypto.ECDSA.parseSigHexInHexRS(e),r=t.r,n=t.s;if("00"==r.substr(0,2)&&r.length%32==2&&(r=r.substr(2)),"00"==n.substr(0,2)&&n.length%32==2&&(n=n.substr(2)),r.length%32==30&&(r="00"+r),n.length%32==30&&(n="00"+n),r.length%32!=0)throw"unknown ECDSA sig r length error";if(n.length%32!=0)throw"unknown ECDSA sig s length error";return r+n},ce.crypto.ECDSA.concatSigToASN1Sig=function(e){if(e.length/2*8%128!=0)throw"unknown ECDSA concatinated r-s sig length error";var t=e.substr(0,e.length/2),r=e.substr(e.length/2);return ce.crypto.ECDSA.hexRSSigToASN1Sig(t,r)},ce.crypto.ECDSA.hexRSSigToASN1Sig=function(e,t){var r=new _(e,16),n=new _(t,16);return ce.crypto.ECDSA.biRSSigToASN1Sig(r,n)},ce.crypto.ECDSA.biRSSigToASN1Sig=function(e,t){var r=ce.asn1,n=new r.DERInteger({bigint:e}),i=new r.DERInteger({bigint:t});return new r.DERSequence({array:[n,i]}).getEncodedHex()},ce.crypto.ECDSA.getName=function(e){return"2b8104001f"===e?"secp192k1":"2a8648ce3d030107"===e?"secp256r1":"2b8104000a"===e?"secp256k1":"2b81040021"===e?"secp224r1":"2b81040022"===e?"secp384r1":-1!=="|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(e)?"secp256r1":-1!=="|secp256k1|".indexOf(e)?"secp256k1":-1!=="|secp224r1|NIST P-224|P-224|".indexOf(e)?"secp224r1":-1!=="|secp384r1|NIST P-384|P-384|".indexOf(e)?"secp384r1":null},void 0!==ce&&ce||(t.KJUR=ce={}),void 0!==ce.crypto&&ce.crypto||(ce.crypto={}),ce.crypto.ECParameterDB=new function(){var e={},t={};function r(e){return new _(e,16)}this.getByName=function(r){var n=r;if(void 0!==t[n]&&(n=t[r]),void 0!==e[n])return e[n];throw"unregistered EC curve name: "+n},this.regist=function(n,i,o,a,s,c,u,l,d,p,f,h){e[n]={};var m=r(o),g=r(a),v=r(s),y=r(c),b=r(u),w=new ae(m,g,v),x=w.decodePointHex("04"+l+d);e[n].name=n,e[n].keylen=i,e[n].curve=w,e[n].G=x,e[n].n=y,e[n].h=b,e[n].oid=f,e[n].info=h;for(var _=0;_<p.length;_++)t[p[_]]=n}},ce.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field"),ce.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field"),ce.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field"),ce.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]),ce.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]),ce.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]),ce.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]),ce.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]),ce.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]),ce.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]);var qe=function(){var e=function(e,r,n){return t(g.AES,e,r,n)},t=function(e,t,r,n){var i=g.enc.Hex.parse(t),o=g.enc.Hex.parse(r),a=g.enc.Hex.parse(n),s={};s.key=o,s.iv=a,s.ciphertext=i;var c=e.decrypt(s,o,{iv:a});return g.enc.Hex.stringify(c)},r=function(e,t,r){return n(g.AES,e,t,r)},n=function(e,t,r,n){var i=g.enc.Hex.parse(t),o=g.enc.Hex.parse(r),a=g.enc.Hex.parse(n),s=e.encrypt(i,o,{iv:a}),c=g.enc.Hex.parse(s.toString());return g.enc.Base64.stringify(c)},i={"AES-256-CBC":{proc:e,eproc:r,keylen:32,ivlen:16},"AES-192-CBC":{proc:e,eproc:r,keylen:24,ivlen:16},"AES-128-CBC":{proc:e,eproc:r,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(e,r,n){return t(g.TripleDES,e,r,n)},eproc:function(e,t,r){return n(g.TripleDES,e,t,r)},keylen:24,ivlen:8},"DES-CBC":{proc:function(e,r,n){return t(g.DES,e,r,n)},eproc:function(e,t,r){return n(g.DES,e,t,r)},keylen:8,ivlen:8}},o=function(e){var t={},r=e.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));r&&(t.cipher=r[1],t.ivsalt=r[2]);var n=e.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));n&&(t.type=n[1]);var i=-1,o=0;-1!=e.indexOf("\r\n\r\n")&&(i=e.indexOf("\r\n\r\n"),o=2),-1!=e.indexOf("\n\n")&&(i=e.indexOf("\n\n"),o=1);var a=e.indexOf("-----END");if(-1!=i&&-1!=a){var s=e.substring(i+2*o,a-o);s=s.replace(/\s+/g,""),t.data=s}return t},a=function(e,t,r){for(var n=r.substring(0,16),o=g.enc.Hex.parse(n),a=g.enc.Utf8.parse(t),s=i[e].keylen+i[e].ivlen,c="",u=null;;){var l=g.algo.MD5.create();if(null!=u&&l.update(u),l.update(a),l.update(o),u=l.finalize(),(c+=g.enc.Hex.stringify(u)).length>=2*s)break}var d={};return d.keyhex=c.substr(0,2*i[e].keylen),d.ivhex=c.substr(2*i[e].keylen,2*i[e].ivlen),d},s=function(e,t,r,n){var o=g.enc.Base64.parse(e),a=g.enc.Hex.stringify(o);return(0,i[t].proc)(a,r,n)};return{version:"1.0.0",parsePKCS5PEM:function(e){return o(e)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(e,t,r){return a(e,t,r)},decryptKeyB64:function(e,t,r,n){return s(e,t,r,n)},getDecryptedKeyHex:function(e,t){var r=o(e),n=(r.type,r.cipher),i=r.ivsalt,c=r.data,u=a(n,t,i).keyhex;return s(c,n,u,i)},getEncryptedPKCS5PEMFromPrvKeyHex:function(e,t,r,n,o){var s="";if(void 0!==n&&null!=n||(n="AES-256-CBC"),void 0===i[n])throw new Error("KEYUTIL unsupported algorithm: "+n);void 0!==o&&null!=o||(o=function(e){var t=g.lib.WordArray.random(e);return g.enc.Hex.stringify(t)}(i[n].ivlen).toUpperCase());var c=function(e,t,r,n){return(0,i[t].eproc)(e,r,n)}(t,n,a(n,r,o).keyhex,o);return s="-----BEGIN "+e+" PRIVATE KEY-----\r\n",s+="Proc-Type: 4,ENCRYPTED\r\n",s+="DEK-Info: "+n+","+o+"\r\n",s+="\r\n",(s+=c.replace(/(.{64})/g,"$1\r\n"))+"\r\n-----END "+e+" PRIVATE KEY-----\r\n"},parseHexOfEncryptedPKCS8:function(e){var t=de,r=t.getChildIdx,n=t.getV,i={},o=r(e,0);if(2!=o.length)throw new Error("malformed format: SEQUENCE(0).items != 2: "+o.length);i.ciphertext=n(e,o[1]);var a=r(e,o[0]);if(2!=a.length)throw new Error("malformed format: SEQUENCE(0.0).items != 2: "+a.length);if("2a864886f70d01050d"!=n(e,a[0]))throw new Error("this only supports pkcs5PBES2");var s=r(e,a[1]);if(2!=a.length)throw new Error("malformed format: SEQUENCE(0.0.1).items != 2: "+s.length);var c=r(e,s[1]);if(2!=c.length)throw new Error("malformed format: SEQUENCE(0.0.1.1).items != 2: "+c.length);if("2a864886f70d0307"!=n(e,c[0]))throw"this only supports TripleDES";i.encryptionSchemeAlg="TripleDES",i.encryptionSchemeIV=n(e,c[1]);var u=r(e,s[0]);if(2!=u.length)throw new Error("malformed format: SEQUENCE(0.0.1.0).items != 2: "+u.length);if("2a864886f70d01050c"!=n(e,u[0]))throw new Error("this only supports pkcs5PBKDF2");var l=r(e,u[1]);if(l.length<2)throw new Error("malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+l.length);i.pbkdf2Salt=n(e,l[0]);var d=n(e,l[1]);try{i.pbkdf2Iter=parseInt(d,16)}catch(e){throw new Error("malformed format pbkdf2Iter: "+d)}return i},getPBKDF2KeyHexFromParam:function(e,t){var r=g.enc.Hex.parse(e.pbkdf2Salt),n=e.pbkdf2Iter,i=g.PBKDF2(t,r,{keySize:6,iterations:n});return g.enc.Hex.stringify(i)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(e,t){var r=Te(e,"ENCRYPTED PRIVATE KEY"),n=this.parseHexOfEncryptedPKCS8(r),i=qe.getPBKDF2KeyHexFromParam(n,t),o={};o.ciphertext=g.enc.Hex.parse(n.ciphertext);var a=g.enc.Hex.parse(i),s=g.enc.Hex.parse(n.encryptionSchemeIV),c=g.TripleDES.decrypt(o,a,{iv:s});return g.enc.Hex.stringify(c)},getKeyFromEncryptedPKCS8PEM:function(e,t){var r=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(e,t);return this.getKeyFromPlainPrivatePKCS8Hex(r)},parsePlainPrivatePKCS8Hex:function(e){var t=de,r=t.getChildIdx,n=t.getV,i={algparam:null};if("30"!=e.substr(0,2))throw new Error("malformed plain PKCS8 private key(code:001)");var o=r(e,0);if(o.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if("30"!=e.substr(o[1],2))throw new Error("malformed PKCS8 private key(code:003)");var a=r(e,o[1]);if(2!=a.length)throw new Error("malformed PKCS8 private key(code:004)");if("06"!=e.substr(a[0],2))throw new Error("malformed PKCS8 private key(code:005)");if(i.algoid=n(e,a[0]),"06"==e.substr(a[1],2)&&(i.algparam=n(e,a[1])),"04"!=e.substr(o[2],2))throw new Error("malformed PKCS8 private key(code:006)");return i.keyidx=t.getVidx(e,o[2]),i},getKeyFromPlainPrivatePKCS8PEM:function(e){var t=Te(e,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(t)},getKeyFromPlainPrivatePKCS8Hex:function(e){var t,r=this.parsePlainPrivatePKCS8Hex(e);if("2a864886f70d010101"==r.algoid)t=new ne;else if("2a8648ce380401"==r.algoid)t=new ce.crypto.DSA;else{if("2a8648ce3d0201"!=r.algoid)throw new Error("unsupported private key algorithm");t=new ce.crypto.ECDSA}return t.readPKCS8PrvKeyHex(e),t},_getKeyFromPublicPKCS8Hex:function(e){var t,r=de.getVbyList(e,0,[0,0],"06");if("2a864886f70d010101"===r)t=new ne;else if("2a8648ce380401"===r)t=new ce.crypto.DSA;else{if("2a8648ce3d0201"!==r)throw new Error("unsupported PKCS#8 public key hex");t=new ce.crypto.ECDSA}return t.readPKCS8PubKeyHex(e),t},parsePublicRawRSAKeyHex:function(e){var t=de,r=t.getChildIdx,n=t.getV,i={};if("30"!=e.substr(0,2))throw new Error("malformed RSA key(code:001)");var o=r(e,0);if(2!=o.length)throw new Error("malformed RSA key(code:002)");if("02"!=e.substr(o[0],2))throw new Error("malformed RSA key(code:003)");if(i.n=n(e,o[0]),"02"!=e.substr(o[1],2))throw new Error("malformed RSA key(code:004)");return i.e=n(e,o[1]),i},parsePublicPKCS8Hex:function(e){var t=de,r=t.getChildIdx,n=t.getV,i={algparam:null},o=r(e,0);if(2!=o.length)throw new Error("outer DERSequence shall have 2 elements: "+o.length);var a=o[0];if("30"!=e.substr(a,2))throw new Error("malformed PKCS8 public key(code:001)");var s=r(e,a);if(2!=s.length)throw new Error("malformed PKCS8 public key(code:002)");if("06"!=e.substr(s[0],2))throw new Error("malformed PKCS8 public key(code:003)");if(i.algoid=n(e,s[0]),"06"==e.substr(s[1],2)?i.algparam=n(e,s[1]):"30"==e.substr(s[1],2)&&(i.algparam={},i.algparam.p=t.getVbyList(e,s[1],[0],"02"),i.algparam.q=t.getVbyList(e,s[1],[1],"02"),i.algparam.g=t.getVbyList(e,s[1],[2],"02")),"03"!=e.substr(o[1],2))throw new Error("malformed PKCS8 public key(code:004)");return i.key=n(e,o[1]).substr(2),i}}}();function Ke(e,t){for(var r="",n=t/4-e.length,i=0;i<n;i++)r+="0";return r+e}function We(e,t,r){for(var n="",i=0;n.length<t;)n+=_e(r(Ee(e+String.fromCharCode.apply(String,[(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i])))),i+=1;return n}function Ve(e){for(var t in ce.crypto.Util.DIGESTINFOHEAD){var r=ce.crypto.Util.DIGESTINFOHEAD[t],n=r.length;if(e.substring(0,n)==r)return[t,e.substring(n)]}return[]}function ze(e){var t,r=de,n=r.getChildIdx,i=r.getV,o=r.getTLV,a=r.getVbyList,s=r.getVbyListEx,c=r.getTLVbyList,u=r.getTLVbyListEx,l=r.getIdxbyList,d=r.getIdxbyListEx,p=r.getVidx,f=r.getInt,h=r.oidname,m=r.hextooidstr,g=Te;try{t=ce.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(e){}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 e=c(this.hex,0,[0,0]);if("a0"==e.substr(0,2)){var t=c(e,0,[0]),r=f(t,0);if(r<0||2<r)throw new Error("malformed version field");return this.version=r+1,this.version}return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return s(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var e=u(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(e)},this.getAlgorithmIdentifierName=function(e){for(var r in t)if(e===t[r])return r;return h(s(e,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 e=a(this.hex,0,[0,4+this.foffset,0]);return e=e.replace(/(..)/g,"%$1"),decodeURIComponent(e)},this.getNotAfter=function(){var e=a(this.hex,0,[0,4+this.foffset,1]);return e=e.replace(/(..)/g,"%$1"),decodeURIComponent(e)},this.getPublicKeyHex=function(){return r.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyIdx=function(){return l(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var e=this.getPublicKeyIdx();return l(this.hex,e,[1,0],"30")},this.getPublicKey=function(){return qe.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var e=c(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(e)},this.getSignatureValueHex=function(){return a(this.hex,0,[2],"03",!0)},this.verifySignature=function(e){var t=this.getSignatureAlgorithmField(),r=this.getSignatureValueHex(),n=c(this.hex,0,[0],"30"),i=new ce.crypto.Signature({alg:t});return i.init(e),i.updateHex(n),i.verify(r)},this.parseExt=function(e){var t,o,s;if(void 0===e){if(s=this.hex,3!==this.version)return-1;t=l(s,0,[0,7,0],"30"),o=n(s,t)}else{s=Te(e);var c=l(s,0,[0,3,0,0],"06");if("2a864886f70d01090e"!=i(s,c))return void(this.aExtInfo=new Array);t=l(s,0,[0,3,0,1,0],"30"),o=n(s,t),this.hex=s}this.aExtInfo=new Array;for(var u=0;u<o.length;u++){var d={critical:!1},f=0;3===n(s,o[u]).length&&(d.critical=!0,f=1),d.oid=r.hextooidstr(a(s,o[u],[0],"06"));var h=l(s,o[u],[1+f]);d.vidx=p(s,h),this.aExtInfo.push(d)}},this.getExtInfo=function(e){var t=this.aExtInfo,r=e;if(e.match(/^[0-9.]+$/)||(r=ce.asn1.x509.OID.name2oid(e)),""!==r)for(var n=0;n<t.length;n++)if(t[n].oid===r)return t[n]},this.getExtBasicConstraints=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("basicConstraints");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var n={extname:"basicConstraints"};if(t&&(n.critical=!0),"3000"===e)return n;if("30030101ff"===e)return n.cA=!0,n;if("30060101ff02"===e.substr(0,12)){var a=i(e,10),s=parseInt(a,16);return n.cA=!0,n.pathLen=s,n}throw new Error("hExtV parse error: "+e)},this.getExtKeyUsage=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("keyUsage");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var n={extname:"keyUsage"};return t&&(n.critical=!0),n.names=this.getExtKeyUsageString(e).split(","),n},this.getExtKeyUsageBin=function(e){if(void 0===e){var t=this.getExtInfo("keyUsage");if(void 0===t)return"";e=o(this.hex,t.vidx)}if(8!=e.length&&10!=e.length)throw new Error("malformed key usage value: "+e);var r="000000000000000"+parseInt(e.substr(6),16).toString(2);return 8==e.length&&(r=r.slice(-8)),10==e.length&&(r=r.slice(-16)),""==(r=r.replace(/0+$/,""))&&(r="0"),r},this.getExtKeyUsageString=function(e){for(var t=this.getExtKeyUsageBin(e),r=new Array,n=0;n<t.length;n++)"1"==t.substr(n,1)&&r.push(ze.KEYUSAGE_NAME[n]);return r.join(",")},this.getExtSubjectKeyIdentifier=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("subjectKeyIdentifier");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var n={extname:"subjectKeyIdentifier"};t&&(n.critical=!0);var a=i(e,0);return n.kid={hex:a},n},this.getExtAuthorityKeyIdentifier=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("authorityKeyIdentifier");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var a={extname:"authorityKeyIdentifier"};t&&(a.critical=!0);for(var s=n(e,0),c=0;c<s.length;c++){var u=e.substr(s[c],2);if("80"===u&&(a.kid={hex:i(e,s[c])}),"a1"===u){var l=o(e,s[c]),d=this.getGeneralNames(l);a.issuer=d[0].dn}"82"===u&&(a.sn={hex:i(e,s[c])})}return a},this.getExtExtKeyUsage=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("extKeyUsage");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var a={extname:"extKeyUsage",array:[]};t&&(a.critical=!0);for(var s=n(e,0),c=0;c<s.length;c++)a.array.push(h(i(e,s[c])));return a},this.getExtExtKeyUsageName=function(){var e=this.getExtInfo("extKeyUsage");if(void 0===e)return e;var t=new Array,r=o(this.hex,e.vidx);if(""===r)return t;for(var a=n(r,0),s=0;s<a.length;s++)t.push(h(i(r,a[s])));return t},this.getExtSubjectAltName=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("subjectAltName");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var n={extname:"subjectAltName",array:[]};return t&&(n.critical=!0),n.array=this.getGeneralNames(e),n},this.getExtIssuerAltName=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("issuerAltName");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var n={extname:"issuerAltName",array:[]};return t&&(n.critical=!0),n.array=this.getGeneralNames(e),n},this.getGeneralNames=function(e){for(var t=n(e,0),r=[],i=0;i<t.length;i++){var a=this.getGeneralName(o(e,t[i]));void 0!==a&&r.push(a)}return r},this.getGeneralName=function(e){var t=e.substr(0,2),r=i(e,0),n=_e(r);return"81"==t?{rfc822:n}:"82"==t?{dns:n}:"86"==t?{uri:n}:"87"==t?{ip:Re(r)}:"a4"==t?{dn:this.getX500Name(r)}:void 0},this.getExtSubjectAltName2=function(){var e,t,r,a=this.getExtInfo("subjectAltName");if(void 0===a)return a;for(var s=new Array,c=o(this.hex,a.vidx),u=n(c,0),l=0;l<u.length;l++)r=c.substr(u[l],2),e=i(c,u[l]),"81"===r&&(t=xe(e),s.push(["MAIL",t])),"82"===r&&(t=xe(e),s.push(["DNS",t])),"84"===r&&(t=ze.hex2dn(e,0),s.push(["DN",t])),"86"===r&&(t=xe(e),s.push(["URI",t])),"87"===r&&(t=Re(e),s.push(["IP",t]));return s},this.getExtCRLDistributionPoints=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("cRLDistributionPoints");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var i={extname:"cRLDistributionPoints",array:[]};t&&(i.critical=!0);for(var a=n(e,0),s=0;s<a.length;s++){var c=o(e,a[s]);i.array.push(this.getDistributionPoint(c))}return i},this.getDistributionPoint=function(e){for(var t={},r=n(e,0),i=0;i<r.length;i++){var a=e.substr(r[i],2),s=o(e,r[i]);"a0"==a&&(t.dpname=this.getDistributionPointName(s))}return t},this.getDistributionPointName=function(e){for(var t={},r=n(e,0),i=0;i<r.length;i++){var a=e.substr(r[i],2),s=o(e,r[i]);"a0"==a&&(t.full=this.getGeneralNames(s))}return t},this.getExtCRLDistributionPointsURI=function(){var e=this.getExtInfo("cRLDistributionPoints");if(void 0===e)return e;for(var t=new Array,r=n(this.hex,e.vidx),i=0;i<r.length;i++)try{var o=xe(a(this.hex,r[i],[0,0,0],"86"));t.push(o)}catch(e){}return t},this.getExtAIAInfo=function(){var e=this.getExtInfo("authorityInfoAccess");if(void 0===e)return e;for(var t={ocsp:[],caissuer:[]},r=n(this.hex,e.vidx),i=0;i<r.length;i++){var o=a(this.hex,r[i],[0],"06"),s=a(this.hex,r[i],[1],"86");"2b06010505073001"===o&&t.ocsp.push(xe(s)),"2b06010505073002"===o&&t.caissuer.push(xe(s))}return t},this.getExtAuthorityInfoAccess=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("authorityInfoAccess");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var i={extname:"authorityInfoAccess",array:[]};t&&(i.critical=!0);for(var c=n(e,0),u=0;u<c.length;u++){var l=s(e,c[u],[0],"06"),d=xe(a(e,c[u],[1],"86"));if("2b06010505073001"==l)i.array.push({ocsp:d});else{if("2b06010505073002"!=l)throw new Error("unknown method: "+l);i.array.push({caissuer:d})}}return i},this.getExtCertificatePolicies=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("certificatePolicies");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var i={extname:"certificatePolicies",array:[]};t&&(i.critical=!0);for(var a=n(e,0),s=0;s<a.length;s++){var c=o(e,a[s]),u=this.getPolicyInformation(c);i.array.push(u)}return i},this.getPolicyInformation=function(e){var t={},r=a(e,0,[0],"06");t.policyoid=h(r);var i=d(e,0,[1],"30");if(-1!=i){t.array=[];for(var s=n(e,i),c=0;c<s.length;c++){var u=o(e,s[c]),l=this.getPolicyQualifierInfo(u);t.array.push(l)}}return t},this.getPolicyQualifierInfo=function(e){var t={},r=a(e,0,[0],"06");if("2b06010505070201"===r){var n=s(e,0,[1],"16");t.cps=_e(n)}else if("2b06010505070202"===r){var i=c(e,0,[1],"30");t.unotice=this.getUserNotice(i)}return t},this.getUserNotice=function(e){for(var t={},r=n(e,0),i=0;i<r.length;i++){var a=o(e,r[i]);"30"!=a.substr(0,2)&&(t.exptext=this.getDisplayText(a))}return t},this.getDisplayText=function(e){var t={};return t.type={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"}[e.substr(0,2)],t.str=_e(i(e,0)),t},this.getExtCRLNumber=function(e,t){var r={extname:"cRLNumber"};if(t&&(r.critical=!0),"02"==e.substr(0,2))return r.num={hex:i(e,0)},r;throw new Error("hExtV parse error: "+e)},this.getExtCRLReason=function(e,t){var r={extname:"cRLReason"};if(t&&(r.critical=!0),"0a"==e.substr(0,2))return r.code=parseInt(i(e,0),16),r;throw new Error("hExtV parse error: "+e)},this.getExtOcspNonce=function(e,t){var r={extname:"ocspNonce"};t&&(r.critical=!0);var n=i(e,0);return r.hex=n,r},this.getExtOcspNoCheck=function(e,t){var r={extname:"ocspNoCheck"};return t&&(r.critical=!0),r},this.getExtAdobeTimeStamp=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("adobeTimeStamp");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var i={extname:"adobeTimeStamp"};t&&(i.critical=!0);var a=n(e,0);if(a.length>1){var s=o(e,a[1]),c=this.getGeneralName(s);null!=c.uri&&(i.uri=c.uri)}if(a.length>2){var u=o(e,a[2]);"0101ff"==u&&(i.reqauth=!0),"010100"==u&&(i.reqauth=!1)}return i},this.getX500NameRule=function(e){for(var t=null,r=[],n=0;n<e.length;n++)for(var i=e[n],o=0;o<i.length;o++)r.push(i[o]);for(n=0;n<r.length;n++){var a=r[n],s=a.ds,c=a.value,u=a.type;if("prn"!=s&&"utf8"!=s&&"ia5"!=s)return"mixed";if("ia5"==s){if("CN"!=u)return"mixed";if(ce.lang.String.isMail(c))continue;return"mixed"}if("C"==u){if("prn"==s)continue;return"mixed"}if(null==t)t=s;else if(t!==s)return"mixed"}return null==t?"prn":t},this.getX500Name=function(e){var t=this.getX500NameArray(e);return{array:t,str:this.dnarraytostr(t)}},this.getX500NameArray=function(e){for(var t=[],r=n(e,0),i=0;i<r.length;i++)t.push(this.getRDN(o(e,r[i])));return t},this.getRDN=function(e){for(var t=[],r=n(e,0),i=0;i<r.length;i++)t.push(this.getAttrTypeAndValue(o(e,r[i])));return t},this.getAttrTypeAndValue=function(e){var t={type:null,value:null,ds:null},r=n(e,0),i=a(e,r[0],[],"06"),o=a(e,r[1],[]),s=ce.asn1.ASN1Util.oidHexToInt(i);return t.type=ce.asn1.x509.OID.oid2atype(s),t.ds=this.HEX2STAG[e.substr(r[1],2)],"bmp"!=t.ds?t.value=xe(o):t.value=Le(o),t},this.readCertPEM=function(e){this.readCertHex(g(e))},this.readCertHex=function(e){this.hex=e,this.getVersion();try{l(this.hex,0,[0,7],"a3"),this.parseExt()}catch(e){}},this.getParam=function(){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=Ce(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(e.ext=this.getExtParamArray()),e.sighex=this.getSignatureValueHex(),e},this.getExtParamArray=function(e){null==e&&-1!=d(this.hex,0,[0,"[3]"])&&(e=u(this.hex,0,[0,"[3]",0],"30"));for(var t=[],r=n(e,0),i=0;i<r.length;i++){var a=o(e,r[i]),s=this.getExtParam(a);null!=s&&t.push(s)}return t},this.getExtParam=function(e){var t=n(e,0).length;if(2!=t&&3!=t)throw new Error("wrong number elements in Extension: "+t+" "+e);var r=m(a(e,0,[0],"06")),i=!1;3==t&&"0101ff"==c(e,0,[1])&&(i=!0);var o=c(e,0,[t-1,0]),s=void 0;if("2.5.29.14"==r?s=this.getExtSubjectKeyIdentifier(o,i):"2.5.29.15"==r?s=this.getExtKeyUsage(o,i):"2.5.29.17"==r?s=this.getExtSubjectAltName(o,i):"2.5.29.18"==r?s=this.getExtIssuerAltName(o,i):"2.5.29.19"==r?s=this.getExtBasicConstraints(o,i):"2.5.29.31"==r?s=this.getExtCRLDistributionPoints(o,i):"2.5.29.32"==r?s=this.getExtCertificatePolicies(o,i):"2.5.29.35"==r?s=this.getExtAuthorityKeyIdentifier(o,i):"2.5.29.37"==r?s=this.getExtExtKeyUsage(o,i):"1.3.6.1.5.5.7.1.1"==r?s=this.getExtAuthorityInfoAccess(o,i):"2.5.29.20"==r?s=this.getExtCRLNumber(o,i):"2.5.29.21"==r?s=this.getExtCRLReason(o,i):"1.3.6.1.5.5.7.48.1.2"==r?s=this.getExtOcspNonce(o,i):"1.3.6.1.5.5.7.48.1.5"==r?s=this.getExtOcspNoCheck(o,i):"1.2.840.113583.1.1.9.1"==r&&(s=this.getExtAdobeTimeStamp(o,i)),null!=s)return s;var u={extname:r,extn:o};return i&&(u.critical=!0),u},this.findExt=function(e,t){for(var r=0;r<e.length;r++)if(e[r].extname==t)return e[r];return null},this.updateExtCDPFullURI=function(e,t){var r=this.findExt(e,"cRLDistributionPoints");if(null!=r&&null!=r.array)for(var n=r.array,i=0;i<n.length;i++)if(null!=n[i].dpname&&null!=n[i].dpname.full)for(var o=n[i].dpname.full,a=0;a<o.length;a++){var s=o[i];null!=s.uri&&(s.uri=t)}},this.updateExtAIAOCSP=function(e,t){var r=this.findExt(e,"authorityInfoAccess");if(null!=r&&null!=r.array)for(var n=r.array,i=0;i<n.length;i++)null!=n[i].ocsp&&(n[i].ocsp=t)},this.updateExtAIACAIssuer=function(e,t){var r=this.findExt(e,"authorityInfoAccess");if(null!=r&&null!=r.array)for(var n=r.array,i=0;i<n.length;i++)null!=n[i].caissuer&&(n[i].caissuer=t)},this.dnarraytostr=function(e){return"/"+e.map((function(e){return function(e){return e.map((function(e){return function(e){return e.type+"="+e.value}(e).replace(/\+/,"\\+")})).join("+")}(e).replace(/\//,"\\/")})).join("/")},this.getInfo=function(){var e,t,r,n=function(e){return JSON.stringify(e.array).replace(/[\[\]\{\}\"]/g,"")},i=function(e){for(var t="",r=e.array,n=0;n<r.length;n++){var i=r[n];if(t+=" policy oid: "+i.policyoid+"\n",void 0!==i.array)for(var o=0;o<i.array.length;o++){var a=i.array[o];void 0!==a.cps&&(t+=" cps: "+a.cps+"\n")}}return t},o=function(e){for(var t="",r=e.array,n=0;n<r.length;n++){var i=r[n];try{void 0!==i.dpname.full[0].uri&&(t+=" "+i.dpname.full[0].uri+"\n")}catch(e){}try{void 0!==i.dname.full[0].dn.hex&&(t+=" "+ze.hex2dn(i.dpname.full[0].dn.hex)+"\n")}catch(e){}}return t},a=function(e){for(var t="",r=e.array,n=0;n<r.length;n++){var i=r[n];void 0!==i.caissuer&&(t+=" caissuer: "+i.caissuer+"\n"),void 0!==i.ocsp&&(t+=" ocsp: "+i.ocsp+"\n")}return t};if(e="Basic Fields\n",e+=" serial number: "+this.getSerialNumberHex()+"\n",e+=" signature algorithm: "+this.getSignatureAlgorithmField()+"\n",e+=" issuer: "+this.getIssuerString()+"\n",e+=" notBefore: "+this.getNotBefore()+"\n",e+=" notAfter: "+this.getNotAfter()+"\n",e+=" subject: "+this.getSubjectString()+"\n",e+=" subject public key info: \n",e+=" key algorithm: "+(t=this.getPublicKey()).type+"\n","RSA"===t.type&&(e+=" n="+Ue(t.n.toString(16)).substr(0,16)+"...\n",e+=" e="+Ue(t.e.toString(16))+"\n"),null!=(r=this.aExtInfo)){e+="X509v3 Extensions:\n";for(var s=0;s<r.length;s++){var c=r[s],u=ce.asn1.x509.OID.oid2name(c.oid);""===u&&(u=c.oid);var l="";if(!0===c.critical&&(l="CRITICAL"),e+=" "+u+" "+l+":\n","basicConstraints"===u){var d=this.getExtBasicConstraints();void 0===d.cA?e+=" {}\n":(e+=" cA=true",void 0!==d.pathLen&&(e+=", pathLen="+d.pathLen),e+="\n")}else if("keyUsage"===u)e+=" "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"===u)e+=" "+this.getExtSubjectKeyIdentifier().kid.hex+"\n";else if("authorityKeyIdentifier"===u){var p=this.getExtAuthorityKeyIdentifier();void 0!==p.kid&&(e+=" kid="+p.kid.hex+"\n")}else"extKeyUsage"===u?e+=" "+this.getExtExtKeyUsage().array.join(", ")+"\n":"subjectAltName"===u?e+=" "+n(this.getExtSubjectAltName())+"\n":"cRLDistributionPoints"===u?e+=o(this.getExtCRLDistributionPoints()):"authorityInfoAccess"===u?e+=a(this.getExtAuthorityInfoAccess()):"certificatePolicies"===u&&(e+=i(this.getExtCertificatePolicies()))}}return(e+="signature algorithm: "+this.getSignatureAlgorithmName()+"\n")+"signature: "+this.getSignatureValueHex().substr(0,16)+"...\n"},"string"==typeof e&&(-1!=e.indexOf("-----BEGIN")?this.readCertPEM(e):ce.lang.String.isHex(e)&&this.readCertHex(e))}qe.getKey=function(e,t,r){var n,i=(v=de).getChildIdx,o=(v.getV,v.getVbyList),a=ce.crypto,s=a.ECDSA,c=a.DSA,u=ne,l=Te,d=qe;if(void 0!==u&&e instanceof u)return e;if(void 0!==s&&e instanceof s)return e;if(void 0!==c&&e instanceof c)return e;if(void 0!==e.curve&&void 0!==e.xy&&void 0===e.d)return new s({pub:e.xy,curve:e.curve});if(void 0!==e.curve&&void 0!==e.d)return new s({prv:e.d,curve:e.curve});if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(O=new u).setPublic(e.n,e.e),O;if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0!==e.p&&void 0!==e.q&&void 0!==e.dp&&void 0!==e.dq&&void 0!==e.co&&void 0===e.qi)return(O=new u).setPrivateEx(e.n,e.e,e.d,e.p,e.q,e.dp,e.dq,e.co),O;if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0===e.p)return(O=new u).setPrivate(e.n,e.e,e.d),O;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0===e.x)return(O=new c).setPublic(e.p,e.q,e.g,e.y),O;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0!==e.x)return(O=new c).setPrivate(e.p,e.q,e.g,e.y,e.x),O;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(O=new u).setPublic(be(e.n),be(e.e)),O;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0!==e.p&&void 0!==e.q&&void 0!==e.dp&&void 0!==e.dq&&void 0!==e.qi)return(O=new u).setPrivateEx(be(e.n),be(e.e),be(e.d),be(e.p),be(e.q),be(e.dp),be(e.dq),be(e.qi)),O;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d)return(O=new u).setPrivate(be(e.n),be(e.e),be(e.d)),O;if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0===e.d){var p=(T=new s({curve:e.crv})).ecparams.keylen/4,f="04"+("0000000000"+be(e.x)).slice(-p)+("0000000000"+be(e.y)).slice(-p);return T.setPublicKeyHex(f),T}if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0!==e.d){p=(T=new s({curve:e.crv})).ecparams.keylen/4,f="04"+("0000000000"+be(e.x)).slice(-p)+("0000000000"+be(e.y)).slice(-p);var h=("0000000000"+be(e.d)).slice(-p);return T.setPublicKeyHex(f),T.setPrivateKeyHex(h),T}if("pkcs5prv"===r){var m,g=e,v=de;if(9===(m=i(g,0)).length)(O=new u).readPKCS5PrvKeyHex(g);else if(6===m.length)(O=new c).readPKCS5PrvKeyHex(g);else{if(!(m.length>2&&"04"===g.substr(m[1],2)))throw new Error("unsupported PKCS#1/5 hexadecimal key");(O=new s).readPKCS5PrvKeyHex(g)}return O}if("pkcs8prv"===r)return d.getKeyFromPlainPrivatePKCS8Hex(e);if("pkcs8pub"===r)return d._getKeyFromPublicPKCS8Hex(e);if("x509pub"===r)return ze.getPublicKeyFromCertHex(e);if(-1!=e.indexOf("-END CERTIFICATE-",0)||-1!=e.indexOf("-END X509 CERTIFICATE-",0)||-1!=e.indexOf("-END TRUSTED CERTIFICATE-",0))return ze.getPublicKeyFromCertPEM(e);if(-1!=e.indexOf("-END PUBLIC KEY-")){var y=Te(e,"PUBLIC KEY");return d._getKeyFromPublicPKCS8Hex(y)}if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var b=l(e,"RSA PRIVATE KEY");return d.getKey(b,null,"pkcs5prv")}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var w=o(n=l(e,"DSA PRIVATE KEY"),0,[1],"02"),x=o(n,0,[2],"02"),E=o(n,0,[3],"02"),k=o(n,0,[4],"02"),S=o(n,0,[5],"02");return(O=new c).setPrivate(new _(w,16),new _(x,16),new _(E,16),new _(k,16),new _(S,16)),O}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED"))return b=l(e,"EC PRIVATE KEY"),d.getKey(b,null,"pkcs5prv");if(-1!=e.indexOf("-END PRIVATE KEY-"))return d.getKeyFromPlainPrivatePKCS8PEM(e);if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var A=d.getDecryptedKeyHex(e,t),C=new ne;return C.readPKCS5PrvKeyHex(A),C}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var T,O=o(n=d.getDecryptedKeyHex(e,t),0,[1],"04"),P=o(n,0,[2,0],"06"),F=o(n,0,[3,0],"03").substr(2);if(void 0===ce.crypto.OID.oidhex2name[P])throw new Error("undefined OID(hex) in KJUR.crypto.OID: "+P);return(T=new s({curve:ce.crypto.OID.oidhex2name[P]})).setPublicKeyHex(F),T.setPrivateKeyHex(O),T.isPublic=!1,T}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED"))return w=o(n=d.getDecryptedKeyHex(e,t),0,[1],"02"),x=o(n,0,[2],"02"),E=o(n,0,[3],"02"),k=o(n,0,[4],"02"),S=o(n,0,[5],"02"),(O=new c).setPrivate(new _(w,16),new _(x,16),new _(E,16),new _(k,16),new _(S,16)),O;if(-1!=e.indexOf("-END ENCRYPTED PRIVATE KEY-"))return d.getKeyFromEncryptedPKCS8PEM(e,t);throw new Error("not supported argument")},qe.generateKeypair=function(e,t){if("RSA"==e){var r=t;(a=new ne).generate(r,"10001"),a.isPrivate=!0,a.isPublic=!0;var n=new ne,i=a.n.toString(16),o=a.e.toString(16);return n.setPublic(i,o),n.isPrivate=!1,n.isPublic=!0,(s={}).prvKeyObj=a,s.pubKeyObj=n,s}if("EC"==e){var a,s,c=t,u=new ce.crypto.ECDSA({curve:c}).generateKeyPairHex();return(a=new ce.crypto.ECDSA({curve:c})).setPublicKeyHex(u.ecpubhex),a.setPrivateKeyHex(u.ecprvhex),a.isPrivate=!0,a.isPublic=!1,(n=new ce.crypto.ECDSA({curve:c})).setPublicKeyHex(u.ecpubhex),n.isPrivate=!1,n.isPublic=!0,(s={}).prvKeyObj=a,s.pubKeyObj=n,s}throw new Error("unknown algorithm: "+e)},qe.getPEM=function(e,t,r,n,i,o){var a=ce,s=a.asn1,c=s.DERObjectIdentifier,u=s.DERInteger,l=s.ASN1Util.newObject,d=s.x509.SubjectPublicKeyInfo,p=a.crypto,f=p.DSA,h=p.ECDSA,m=ne;function v(e){return l({seq:[{int:0},{int:{bigint:e.n}},{int:e.e},{int:{bigint:e.d}},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.dmp1}},{int:{bigint:e.dmq1}},{int:{bigint:e.coeff}}]})}function y(e){return l({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a0",!0,{oid:{name:e.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]})}function b(e){return l({seq:[{int:0},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}},{int:{bigint:e.y}},{int:{bigint:e.x}}]})}if((void 0!==m&&e instanceof m||void 0!==f&&e instanceof f||void 0!==h&&e instanceof h)&&1==e.isPublic&&(void 0===t||"PKCS8PUB"==t))return Ce(E=new d(e).getEncodedHex(),"PUBLIC KEY");if("PKCS1PRV"==t&&void 0!==m&&e instanceof m&&(void 0===r||null==r)&&1==e.isPrivate)return Ce(E=v(e).getEncodedHex(),"RSA PRIVATE KEY");if("PKCS1PRV"==t&&void 0!==h&&e instanceof h&&(void 0===r||null==r)&&1==e.isPrivate){var w=new c({name:e.curveName}).getEncodedHex(),x=y(e).getEncodedHex(),_="";return(_+=Ce(w,"EC PARAMETERS"))+Ce(x,"EC PRIVATE KEY")}if("PKCS1PRV"==t&&void 0!==f&&e instanceof f&&(void 0===r||null==r)&&1==e.isPrivate)return Ce(E=b(e).getEncodedHex(),"DSA PRIVATE KEY");if("PKCS5PRV"==t&&void 0!==m&&e instanceof m&&void 0!==r&&null!=r&&1==e.isPrivate){var E=v(e).getEncodedHex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",E,r,n,o)}if("PKCS5PRV"==t&&void 0!==h&&e instanceof h&&void 0!==r&&null!=r&&1==e.isPrivate)return E=y(e).getEncodedHex(),void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",E,r,n,o);if("PKCS5PRV"==t&&void 0!==f&&e instanceof f&&void 0!==r&&null!=r&&1==e.isPrivate)return E=b(e).getEncodedHex(),void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",E,r,n,o);var k=function(e,t){var r=S(e,t);return new l({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:r.pbkdf2Salt}},{int:r.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:r.encryptionSchemeIV}}]}]}]},{octstr:{hex:r.ciphertext}}]}).getEncodedHex()},S=function(e,t){var r=g.lib.WordArray.random(8),n=g.lib.WordArray.random(8),i=g.PBKDF2(t,r,{keySize:6,iterations:100}),o=g.enc.Hex.parse(e),a=g.TripleDES.encrypt(o,i,{iv:n})+"",s={};return s.ciphertext=a,s.pbkdf2Salt=g.enc.Hex.stringify(r),s.pbkdf2Iter=100,s.encryptionSchemeAlg="DES-EDE3-CBC",s.encryptionSchemeIV=g.enc.Hex.stringify(n),s};if("PKCS8PRV"==t&&null!=m&&e instanceof m&&1==e.isPrivate){var A=v(e).getEncodedHex();return E=l({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:A}}]}).getEncodedHex(),void 0===r||null==r?Ce(E,"PRIVATE KEY"):Ce(x=k(E,r),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==t&&void 0!==h&&e instanceof h&&1==e.isPrivate)return A=new l({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]}).getEncodedHex(),E=l({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:e.curveName}}]},{octstr:{hex:A}}]}).getEncodedHex(),void 0===r||null==r?Ce(E,"PRIVATE KEY"):Ce(x=k(E,r),"ENCRYPTED PRIVATE KEY");if("PKCS8PRV"==t&&void 0!==f&&e instanceof f&&1==e.isPrivate)return A=new u({bigint:e.x}).getEncodedHex(),E=l({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]}]},{octstr:{hex:A}}]}).getEncodedHex(),void 0===r||null==r?Ce(E,"PRIVATE KEY"):Ce(x=k(E,r),"ENCRYPTED PRIVATE KEY");throw new Error("unsupported object nor format")},qe.getKeyFromCSRPEM=function(e){var t=Te(e,"CERTIFICATE REQUEST");return qe.getKeyFromCSRHex(t)},qe.getKeyFromCSRHex=function(e){var t=qe.parseCSRHex(e);return qe.getKey(t.p8pubkeyhex,null,"pkcs8pub")},qe.parseCSRHex=function(e){var t=de,r=t.getChildIdx,n=t.getTLV,i={},o=e;if("30"!=o.substr(0,2))throw new Error("malformed CSR(code:001)");var a=r(o,0);if(a.length<1)throw new Error("malformed CSR(code:002)");if("30"!=o.substr(a[0],2))throw new Error("malformed CSR(code:003)");var s=r(o,a[0]);if(s.length<3)throw new Error("malformed CSR(code:004)");return i.p8pubkeyhex=n(o,s[2]),i},qe.getKeyID=function(e){var t=qe,r=de;"string"==typeof e&&-1!=e.indexOf("BEGIN ")&&(e=t.getKey(e));var n=Te(t.getPEM(e)),i=r.getIdxbyList(n,0,[1]),o=r.getV(n,i).substring(2);return ce.crypto.Util.hashHex(o,"sha1")},qe.getJWKFromKey=function(e){var t={};if(e instanceof ne&&e.isPrivate)return t.kty="RSA",t.n=ye(e.n.toString(16)),t.e=ye(e.e.toString(16)),t.d=ye(e.d.toString(16)),t.p=ye(e.p.toString(16)),t.q=ye(e.q.toString(16)),t.dp=ye(e.dmp1.toString(16)),t.dq=ye(e.dmq1.toString(16)),t.qi=ye(e.coeff.toString(16)),t;if(e instanceof ne&&e.isPublic)return t.kty="RSA",t.n=ye(e.n.toString(16)),t.e=ye(e.e.toString(16)),t;if(e instanceof ce.crypto.ECDSA&&e.isPrivate){if("P-256"!==(n=e.getShortNISTPCurveName())&&"P-384"!==n)throw new Error("unsupported curve name for JWT: "+n);var r=e.getPublicKeyXYHex();return t.kty="EC",t.crv=n,t.x=ye(r.x),t.y=ye(r.y),t.d=ye(e.prvKeyHex),t}if(e instanceof ce.crypto.ECDSA&&e.isPublic){var n;if("P-256"!==(n=e.getShortNISTPCurveName())&&"P-384"!==n)throw new Error("unsupported curve name for JWT: "+n);return r=e.getPublicKeyXYHex(),t.kty="EC",t.crv=n,t.x=ye(r.x),t.y=ye(r.y),t}throw new Error("not supported key object")},ne.getPosArrayOfChildrenFromHex=function(e){return de.getChildIdx(e,0)},ne.getHexValueArrayOfChildrenFromHex=function(e){var t,r=de.getV,n=r(e,(t=ne.getPosArrayOfChildrenFromHex(e))[0]),i=r(e,t[1]),o=r(e,t[2]),a=r(e,t[3]),s=r(e,t[4]),c=r(e,t[5]),u=r(e,t[6]),l=r(e,t[7]),d=r(e,t[8]);return(t=new Array).push(n,i,o,a,s,c,u,l,d),t},ne.prototype.readPrivateKeyFromPEMString=function(e){var t=Te(e),r=ne.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])},ne.prototype.readPKCS5PrvKeyHex=function(e){var t=ne.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},ne.prototype.readPKCS8PrvKeyHex=function(e){var t,r,n,i,o,a,s,c,u=de,l=u.getVbyListEx;if(!1===u.isASN1HEX(e))throw new Error("not ASN.1 hex string");try{t=l(e,0,[2,0,1],"02"),r=l(e,0,[2,0,2],"02"),n=l(e,0,[2,0,3],"02"),i=l(e,0,[2,0,4],"02"),o=l(e,0,[2,0,5],"02"),a=l(e,0,[2,0,6],"02"),s=l(e,0,[2,0,7],"02"),c=l(e,0,[2,0,8],"02")}catch(e){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,r,n,i,o,a,s,c)},ne.prototype.readPKCS5PubKeyHex=function(e){var t=de,r=t.getV;if(!1===t.isASN1HEX(e))throw new Error("keyHex is not ASN.1 hex string");var n=t.getChildIdx(e,0);if(2!==n.length||"02"!==e.substr(n[0],2)||"02"!==e.substr(n[1],2))throw new Error("wrong hex for PKCS#5 public key");var i=r(e,n[0]),o=r(e,n[1]);this.setPublic(i,o)},ne.prototype.readPKCS8PubKeyHex=function(e){var t=de;if(!1===t.isASN1HEX(e))throw new Error("not ASN.1 hex string");if("06092a864886f70d010101"!==t.getTLVbyListEx(e,0,[0,0]))throw new Error("not PKCS8 RSA public key");var r=t.getTLVbyListEx(e,0,[1,0]);this.readPKCS5PubKeyHex(r)},ne.prototype.readCertPubKeyHex=function(e,t){var r,n;(r=new ze).readCertHex(e),n=r.getPublicKeyHex(),this.readPKCS8PubKeyHex(n)},new RegExp("[^0-9a-f]","gi"),ne.prototype.sign=function(e,t){var r=function(e){return ce.crypto.Util.hashString(e,t)}(e);return this.signWithMessageHash(r,t)},ne.prototype.signWithMessageHash=function(e,t){var r=te(ce.crypto.Util.getPaddedDigestInfoHex(e,t,this.n.bitLength()),16);return Ke(this.doPrivate(r).toString(16),this.n.bitLength())},ne.prototype.signPSS=function(e,t,r){var n=function(e){return ce.crypto.Util.hashHex(e,t)}(Ee(e));return void 0===r&&(r=-1),this.signWithMessageHashPSS(n,t,r)},ne.prototype.signWithMessageHashPSS=function(e,t,r){var n,i=_e(e),o=i.length,a=this.n.bitLength()-1,s=Math.ceil(a/8),c=function(e){return ce.crypto.Util.hashHex(e,t)};if(-1===r||void 0===r)r=o;else if(-2===r)r=s-o-2;else if(r<-2)throw new Error("invalid salt length");if(s<o+r+2)throw new Error("data too long");var u="";r>0&&(u=new Array(r),(new ee).nextBytes(u),u=String.fromCharCode.apply(String,u));var l=_e(c(Ee("\0\0\0\0\0\0\0\0"+i+u))),d=[];for(n=0;n<s-r-o-2;n+=1)d[n]=0;var p=String.fromCharCode.apply(String,d)+""+u,f=We(l,p.length,c),h=[];for(n=0;n<p.length;n+=1)h[n]=p.charCodeAt(n)^f.charCodeAt(n);var m=65280>>8*s-a&255;for(h[0]&=~m,n=0;n<o;n++)h.push(l.charCodeAt(n));return h.push(188),Ke(this.doPrivate(new _(h)).toString(16),this.n.bitLength())},ne.prototype.verify=function(e,t){if(null==(t=t.toLowerCase()).match(/^[0-9a-f]+$/))return!1;var r=te(t,16),n=this.n.bitLength();if(r.bitLength()>n)return!1;var i=this.doPublic(r).toString(16);if(i.length+3!=n/4)return!1;var o=Ve(i.replace(/^1f+00/,""));if(0==o.length)return!1;var a=o[0];return o[1]==function(e){return ce.crypto.Util.hashString(e,a)}(e)},ne.prototype.verifyWithMessageHash=function(e,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var r=te(t,16);if(r.bitLength()>this.n.bitLength())return 0;var n=Ve(this.doPublic(r).toString(16).replace(/^1f+00/,""));return 0!=n.length&&(n[0],n[1]==e)},ne.prototype.verifyPSS=function(e,t,r,n){var i=function(e){return ce.crypto.Util.hashHex(e,r)}(Ee(e));return void 0===n&&(n=-1),this.verifyWithMessageHashPSS(i,t,r,n)},ne.prototype.verifyWithMessageHashPSS=function(e,t,r,n){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i,o=new _(t,16),a=function(e){return ce.crypto.Util.hashHex(e,r)},s=_e(e),c=s.length,u=this.n.bitLength()-1,l=Math.ceil(u/8);if(-1===n||void 0===n)n=c;else if(-2===n)n=l-c-2;else if(n<-2)throw new Error("invalid salt length");if(l<c+n+2)throw new Error("data too long");var d=this.doPublic(o).toByteArray();for(i=0;i<d.length;i+=1)d[i]&=255;for(;d.length<l;)d.unshift(0);if(188!==d[l-1])throw new Error("encoded message does not end in 0xbc");var p=(d=String.fromCharCode.apply(String,d)).substr(0,l-c-1),f=d.substr(p.length,c),h=65280>>8*l-u&255;if(0!=(p.charCodeAt(0)&h))throw new Error("bits beyond keysize not zero");var m=We(f,p.length,a),g=[];for(i=0;i<p.length;i+=1)g[i]=p.charCodeAt(i)^m.charCodeAt(i);g[0]&=~h;var v=l-c-n-2;for(i=0;i<v;i+=1)if(0!==g[i])throw new Error("leftmost octets not zero");if(1!==g[v])throw new Error("0x01 marker not found");return f===_e(a(Ee("\0\0\0\0\0\0\0\0"+s+String.fromCharCode.apply(String,g.slice(-n)))))},ne.SALT_LEN_HLEN=-1,ne.SALT_LEN_MAX=-2,ne.SALT_LEN_RECOVER=-2,ze.hex2dn=function(e,t){void 0===t&&(t=0);var r=new ze;return de.getTLV(e,t),r.getX500Name(e).str},ze.hex2rdn=function(e,t){if(void 0===t&&(t=0),"31"!==e.substr(t,2))throw new Error("malformed RDN");for(var r=new Array,n=de.getChildIdx(e,t),i=0;i<n.length;i++)r.push(ze.hex2attrTypeValue(e,n[i]));return(r=r.map((function(e){return e.replace("+","\\+")}))).join("+")},ze.hex2attrTypeValue=function(e,t){var r=de,n=r.getV;if(void 0===t&&(t=0),"30"!==e.substr(t,2))throw new Error("malformed attribute type and value");var i=r.getChildIdx(e,t);2!==i.length||e.substr(i[0],2);var o=n(e,i[0]),a=ce.asn1.ASN1Util.oidHexToInt(o);return ce.asn1.x509.OID.oid2atype(a)+"="+_e(n(e,i[1]))},ze.getPublicKeyFromCertHex=function(e){var t=new ze;return t.readCertHex(e),t.getPublicKey()},ze.getPublicKeyFromCertPEM=function(e){var t=new ze;return t.readCertPEM(e),t.getPublicKey()},ze.getPublicKeyInfoPropOfCertPEM=function(e){var t,r,n=de.getVbyList,i={algparam:null};return(t=new ze).readCertPEM(e),r=t.getPublicKeyHex(),i.keyhex=n(r,0,[1],"03").substr(2),i.algoid=n(r,0,[0,0],"06"),"2a8648ce3d0201"===i.algoid&&(i.algparam=n(r,0,[0,1],"06")),i},ze.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"],void 0!==ce&&ce||(t.KJUR=ce={}),void 0!==ce.jws&&ce.jws||(ce.jws={}),ce.jws.JWS=function(){var e=ce.jws.JWS.isSafeJSONString;this.parseJWS=function(t,r){if(void 0===this.parsedJWS||!r&&void 0===this.parsedJWS.sigvalH){var n=t.match(/^([^.]+)\.([^.]+)\.([^.]+)$/);if(null==n)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";var i=n[1],o=n[2],a=n[3],s=i+"."+o;if(this.parsedJWS={},this.parsedJWS.headB64U=i,this.parsedJWS.payloadB64U=o,this.parsedJWS.sigvalB64U=a,this.parsedJWS.si=s,!r){var c=be(a),u=te(c,16);this.parsedJWS.sigvalH=c,this.parsedJWS.sigvalBI=u}var l=le(i),d=le(o);if(this.parsedJWS.headS=l,this.parsedJWS.payloadS=d,!e(l,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+l}}},ce.jws.JWS.sign=function(e,t,r,n,i){var o,a,s,c=ce,u=c.jws.JWS,l=u.readSafeJSONString,d=u.isSafeJSONString,p=c.crypto,h=(p.ECDSA,p.Mac),m=p.Signature,g=JSON;if("string"!=typeof t&&"object"!=(void 0===t?"undefined":f(t)))throw"spHeader must be JSON string or object: "+t;if("object"==(void 0===t?"undefined":f(t))&&(a=t,o=g.stringify(a)),"string"==typeof t){if(!d(o=t))throw"JWS Head is not safe JSON string: "+o;a=l(o)}if(s=r,"object"==(void 0===r?"undefined":f(r))&&(s=g.stringify(r)),""!=e&&null!=e||void 0===a.alg||(e=a.alg),""!=e&&null!=e&&void 0===a.alg&&(a.alg=e,o=g.stringify(a)),e!==a.alg)throw"alg and sHeader.alg doesn't match: "+e+"!="+a.alg;var v=null;if(void 0===u.jwsalg2sigalg[e])throw"unsupported alg name: "+e;v=u.jwsalg2sigalg[e];var y=ue(o)+"."+ue(s),b="";if("Hmac"==v.substr(0,4)){if(void 0===n)throw"mac key shall be specified for HS* alg";var w=new h({alg:v,prov:"cryptojs",pass:n});w.updateString(y),b=w.doFinal()}else if(-1!=v.indexOf("withECDSA")){(_=new m({alg:v})).init(n,i),_.updateString(y);var x=_.sign();b=ce.crypto.ECDSA.asn1SigToConcatSig(x)}else{var _;"none"!=v&&((_=new m({alg:v})).init(n,i),_.updateString(y),b=_.sign())}return y+"."+ye(b)},ce.jws.JWS.verify=function(e,t,r){var n,i=ce,o=i.jws.JWS,a=o.readSafeJSONString,s=i.crypto,c=s.ECDSA,u=s.Mac,l=s.Signature;void 0!==f(ne)&&(n=ne);var d=e.split(".");if(3!==d.length)return!1;var p,h=d[0]+"."+d[1],m=be(d[2]),g=a(le(d[0])),v=null;if(void 0===g.alg)throw"algorithm not specified in header";if(p=(v=g.alg).substr(0,2),null!=r&&"[object Array]"===Object.prototype.toString.call(r)&&r.length>0&&-1==(":"+r.join(":")+":").indexOf(":"+v+":"))throw"algorithm '"+v+"' not accepted in the list";if("none"!=v&&null===t)throw"key shall be specified to verify.";if("string"==typeof t&&-1!=t.indexOf("-----BEGIN ")&&(t=qe.getKey(t)),!("RS"!=p&&"PS"!=p||t instanceof n))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==p&&!(t instanceof c))throw"key shall be a ECDSA obj for ES* algs";var y=null;if(void 0===o.jwsalg2sigalg[g.alg])throw"unsupported alg name: "+v;if("none"==(y=o.jwsalg2sigalg[v]))throw"not supported";if("Hmac"==y.substr(0,4)){if(void 0===t)throw"hexadecimal key shall be specified for HMAC";var b=new u({alg:y,pass:t});return b.updateString(h),m==b.doFinal()}if(-1!=y.indexOf("withECDSA")){var w,x=null;try{x=c.concatSigToASN1Sig(m)}catch(e){return!1}return(w=new l({alg:y})).init(t),w.updateString(h),w.verify(x)}return(w=new l({alg:y})).init(t),w.updateString(h),w.verify(m)},ce.jws.JWS.parse=function(e){var t,r,n,i=e.split("."),o={};if(2!=i.length&&3!=i.length)throw"malformed sJWS: wrong number of '.' splitted elements";return t=i[0],r=i[1],3==i.length&&(n=i[2]),o.headerObj=ce.jws.JWS.readSafeJSONString(le(t)),o.payloadObj=ce.jws.JWS.readSafeJSONString(le(r)),o.headerPP=JSON.stringify(o.headerObj,null," "),null==o.payloadObj?o.payloadPP=le(r):o.payloadPP=JSON.stringify(o.payloadObj,null," "),void 0!==n&&(o.sigHex=be(n)),o},ce.jws.JWS.verifyJWT=function(e,t,r){var n=ce.jws,i=n.JWS,o=i.readSafeJSONString,a=i.inArray,s=i.includedArray,c=e.split("."),u=c[0],l=c[1],d=(be(c[2]),o(le(u))),p=o(le(l));if(void 0===d.alg)return!1;if(void 0===r.alg)throw"acceptField.alg shall be specified";if(!a(d.alg,r.alg))return!1;if(void 0!==p.iss&&"object"===f(r.iss)&&!a(p.iss,r.iss))return!1;if(void 0!==p.sub&&"object"===f(r.sub)&&!a(p.sub,r.sub))return!1;if(void 0!==p.aud&&"object"===f(r.aud))if("string"==typeof p.aud){if(!a(p.aud,r.aud))return!1}else if("object"==f(p.aud)&&!s(p.aud,r.aud))return!1;var h=n.IntDate.getNow();return void 0!==r.verifyAt&&"number"==typeof r.verifyAt&&(h=r.verifyAt),void 0!==r.gracePeriod&&"number"==typeof r.gracePeriod||(r.gracePeriod=0),!(void 0!==p.exp&&"number"==typeof p.exp&&p.exp+r.gracePeriod<h||void 0!==p.nbf&&"number"==typeof p.nbf&&h<p.nbf-r.gracePeriod||void 0!==p.iat&&"number"==typeof p.iat&&h<p.iat-r.gracePeriod||void 0!==p.jti&&void 0!==r.jti&&p.jti!==r.jti||!i.verify(e,t,r.alg))},ce.jws.JWS.includedArray=function(e,t){var r=ce.jws.JWS.inArray;if(null===e)return!1;if("object"!==(void 0===e?"undefined":f(e)))return!1;if("number"!=typeof e.length)return!1;for(var n=0;n<e.length;n++)if(!r(e[n],t))return!1;return!0},ce.jws.JWS.inArray=function(e,t){if(null===t)return!1;if("object"!==(void 0===t?"undefined":f(t)))return!1;if("number"!=typeof t.length)return!1;for(var r=0;r<t.length;r++)if(t[r]==e)return!0;return!1},ce.jws.JWS.jwsalg2sigalg={HS256:"HmacSHA256",HS384:"HmacSHA384",HS512:"HmacSHA512",RS256:"SHA256withRSA",RS384:"SHA384withRSA",RS512:"SHA512withRSA",ES256:"SHA256withECDSA",ES384:"SHA384withECDSA",PS256:"SHA256withRSAandMGF1",PS384:"SHA384withRSAandMGF1",PS512:"SHA512withRSAandMGF1",none:"none"},ce.jws.JWS.isSafeJSONString=function(e,t,r){var n=null;try{return"object"!=(void 0===(n=se(e))?"undefined":f(n))||n.constructor===Array?0:(t&&(t[r]=n),1)}catch(e){return 0}},ce.jws.JWS.readSafeJSONString=function(e){var t=null;try{return"object"!=(void 0===(t=se(e))?"undefined":f(t))||t.constructor===Array?null:t}catch(e){return null}},ce.jws.JWS.getEncodedSignatureValueFromJWS=function(e){var t=e.match(/^[^.]+\.[^.]+\.([^.]+)$/);if(null==t)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";return t[1]},ce.jws.JWS.getJWKthumbprint=function(e){if("RSA"!==e.kty&&"EC"!==e.kty&&"oct"!==e.kty)throw"unsupported algorithm for JWK Thumprint";var t="{";if("RSA"===e.kty){if("string"!=typeof e.n||"string"!=typeof e.e)throw"wrong n and e value for RSA key";t+='"e":"'+e.e+'",',t+='"kty":"'+e.kty+'",',t+='"n":"'+e.n+'"}'}else if("EC"===e.kty){if("string"!=typeof e.crv||"string"!=typeof e.x||"string"!=typeof e.y)throw"wrong crv, x and y value for EC key";t+='"crv":"'+e.crv+'",',t+='"kty":"'+e.kty+'",',t+='"x":"'+e.x+'",',t+='"y":"'+e.y+'"}'}else if("oct"===e.kty){if("string"!=typeof e.k)throw"wrong k value for oct(symmetric) key";t+='"kty":"'+e.kty+'",',t+='"k":"'+e.k+'"}'}var r=Ee(t);return ye(ce.crypto.Util.hashHex(r,"sha256"))},ce.jws.IntDate={},ce.jws.IntDate.get=function(e){var t=ce.jws.IntDate,r=t.getNow,n=t.getZulu;if("now"==e)return r();if("now + 1hour"==e)return r()+3600;if("now + 1day"==e)return r()+86400;if("now + 1month"==e)return r()+2592e3;if("now + 1year"==e)return r()+31536e3;if(e.match(/Z$/))return n(e);if(e.match(/^[0-9]+$/))return parseInt(e);throw"unsupported format: "+e},ce.jws.IntDate.getZulu=function(e){return Pe(e)},ce.jws.IntDate.getNow=function(){return~~(new Date/1e3)},ce.jws.IntDate.intDate2UTCString=function(e){return new Date(1e3*e).toUTCString()},ce.jws.IntDate.intDate2Zulu=function(e){var t=new Date(1e3*e);return("0000"+t.getUTCFullYear()).slice(-4)+("00"+(t.getUTCMonth()+1)).slice(-2)+("00"+t.getUTCDate()).slice(-2)+("00"+t.getUTCHours()).slice(-2)+("00"+t.getUTCMinutes()).slice(-2)+("00"+t.getUTCSeconds()).slice(-2)+"Z"},t.SecureRandom=ee,t.rng_seed_time=Z,t.BigInteger=_,t.RSAKey=ne;var Je=ce.crypto.EDSA;t.EDSA=Je;var Ze=ce.crypto.DSA;t.DSA=Ze;var $e=ce.crypto.Signature;t.Signature=$e;var Ge=ce.crypto.MessageDigest;t.MessageDigest=Ge;var Xe=ce.crypto.Mac;t.Mac=Xe;var Ye=ce.crypto.Cipher;t.Cipher=Ye,t.KEYUTIL=qe,t.ASN1HEX=de,t.X509=ze,t.CryptoJS=g,t.b64tohex=w,t.b64toBA=x,t.stoBA=pe,t.BAtos=fe,t.BAtohex=he,t.stohex=me,t.stob64=function(e){return b(me(e))},t.stob64u=function(e){return ge(b(me(e)))},t.b64utos=function(e){return fe(x(ve(e)))},t.b64tob64u=ge,t.b64utob64=ve,t.hex2b64=b,t.hextob64u=ye,t.b64utohex=be,t.utf8tob64u=ue,t.b64utoutf8=le,t.utf8tob64=function(e){return b(Fe(De(e)))},t.b64toutf8=function(e){return decodeURIComponent(Ie(w(e)))},t.utf8tohex=we,t.hextoutf8=xe,t.hextorstr=_e,t.rstrtohex=Ee,t.hextob64=ke,t.hextob64nl=Se,t.b64nltohex=Ae,t.hextopem=Ce,t.pemtohex=Te,t.hextoArrayBuffer=function(e){if(e.length%2!=0)throw"input is not even length";if(null==e.match(/^[0-9A-Fa-f]+$/))throw"input is not hexadecimal";for(var t=new ArrayBuffer(e.length/2),r=new DataView(t),n=0;n<e.length/2;n++)r.setUint8(n,parseInt(e.substr(2*n,2),16));return t},t.ArrayBuffertohex=function(e){for(var t="",r=new DataView(e),n=0;n<e.byteLength;n++)t+=("00"+r.getUint8(n).toString(16)).slice(-2);return t},t.zulutomsec=Oe,t.zulutosec=Pe,t.zulutodate=function(e){return new Date(Oe(e))},t.datetozulu=function(e,t,r){var n,i=e.getUTCFullYear();if(t){if(i<1950||2049<i)throw"not proper year for UTCTime: "+i;n=(""+i).slice(-2)}else n=("000"+i).slice(-4);if(n+=("0"+(e.getUTCMonth()+1)).slice(-2),n+=("0"+e.getUTCDate()).slice(-2),n+=("0"+e.getUTCHours()).slice(-2),n+=("0"+e.getUTCMinutes()).slice(-2),n+=("0"+e.getUTCSeconds()).slice(-2),r){var o=e.getUTCMilliseconds();0!==o&&(n+="."+(o=(o=("00"+o).slice(-3)).replace(/0+$/g,"")))}return n+"Z"},t.uricmptohex=Fe,t.hextouricmp=Ie,t.ipv6tohex=Ne,t.hextoipv6=je,t.hextoip=Re,t.iptohex=function(e){var t="malformed IP address";if(!(e=e.toLowerCase(e)).match(/^[0-9.]+$/)){if(e.match(/^[0-9a-f:]+$/)&&-1!==e.indexOf(":"))return Ne(e);throw t}var r=e.split(".");if(4!==r.length)throw t;var n="";try{for(var i=0;i<4;i++)n+=("0"+parseInt(r[i]).toString(16)).slice(-2);return n}catch(e){throw t}},t.encodeURIComponentAll=De,t.newline_toUnix=function(e){return e.replace(/\r\n/gm,"\n")},t.newline_toDos=function(e){return(e=e.replace(/\r\n/gm,"\n")).replace(/\n/gm,"\r\n")},t.hextoposhex=Ue,t.intarystrtohex=function(e){e=(e=(e=e.replace(/^\s*\[\s*/,"")).replace(/\s*\]\s*$/,"")).replace(/\s*/g,"");try{return e.split(/,/).map((function(e,t,r){var n=parseInt(e);if(n<0||255<n)throw"integer not in range 0-255";return("00"+n.toString(16)).slice(-2)})).join("")}catch(e){throw"malformed integer array string: "+e}},t.strdiffidx=function(e,t){var r=e.length;e.length>t.length&&(r=t.length);for(var n=0;n<r;n++)if(e.charCodeAt(n)!=t.charCodeAt(n))return n;return e.length!=t.length?r:-1},t.KJUR=ce;var Qe=ce.crypto;t.crypto=Qe;var et=ce.asn1;t.asn1=et;var tt=ce.jws;t.jws=tt;var rt=ce.lang;t.lang=rt}).call(this,r(28).Buffer)},function(e,t,r){"use strict";(function(e){var n=r(30),i=r(31),o=r(32);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=c.prototype:(null===e&&(e=new c(t)),e.length=t),e}function c(e,t,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return u(this,e,t,r)}function u(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),c.TYPED_ARRAY_SUPPORT?(e=t).__proto__=c.prototype:e=p(e,t),e}(e,t,r,n):"string"==typeof t?function(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|h(t,r),i=(e=s(e,n)).write(t,r);return i!==n&&(e=e.slice(0,i)),e}(e,t,r):function(e,t){if(c.isBuffer(t)){var r=0|f(t.length);return 0===(e=s(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||function(e){return e!=e}(t.length)?s(e,0):p(e,t);if("Buffer"===t.type&&o(t.data))return p(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t){if(l(t),e=s(e,t<0?0:0|f(t)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function p(e,t){var r=t.length<0?0:0|f(t.length);e=s(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function f(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(e).length;default:if(n)return H(e).length;t=(""+t).toLowerCase(),n=!0}}function m(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return T(this,t,r);case"latin1":case"binary":return O(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){var o,a=1,s=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=r;o<s;o++)if(u(e,o)===u(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===c)return l*a}else-1!==l&&(o-=o-l),l=-1}else for(r+c>s&&(r=s-c),o=r;o>=0;o--){for(var d=!0,p=0;p<c;p++)if(u(e,o+p)!==u(t,p)){d=!1;break}if(d)return o}return-1}function b(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[r+a]=s}return a}function w(e,t,r,n){return K(H(t,e.length-r),e,r,n)}function x(e,t,r,n){return K(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function _(e,t,r,n){return x(e,t,r,n)}function E(e,t,r,n){return K(q(t),e,r,n)}function k(e,t,r,n){return K(function(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function S(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function A(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,a,s,c,u=e[i],l=null,d=u>239?4:u>223?3:u>191?2:1;if(i+d<=r)switch(d){case 1:u<128&&(l=u);break;case 2:128==(192&(o=e[i+1]))&&(c=(31&u)<<6|63&o)>127&&(l=c);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(c=(15&u)<<12|(63&o)<<6|63&a)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(c=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&c<1114112&&(l=c)}null===l?(l=65533,d=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=d}return function(e){var t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=C));return r}(n)}t.Buffer=c,t.SlowBuffer=function(e){return+e!=e&&(e=0),c.alloc(+e)},t.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),c.poolSize=8192,c._augment=function(e){return e.__proto__=c.prototype,e},c.from=function(e,t,r){return u(null,e,t,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(e,t,r){return function(e,t,r,n){return l(t),t<=0?s(e,t):void 0!==r?"string"==typeof n?s(e,t).fill(r,n):s(e,t).fill(r):s(e,t)}(null,e,t,r)},c.allocUnsafe=function(e){return d(null,e)},c.allocUnsafeSlow=function(e){return d(null,e)},c.isBuffer=function(e){return!(null==e||!e._isBuffer)},c.compare=function(e,t){if(!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=c.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var a=e[r];if(!c.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},c.byteLength=h,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},c.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},c.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},c.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?A(this,0,e):m.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},c.prototype.compare=function(e,t,r,n,i){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(n,i),l=e.slice(t,r),d=0;d<s;++d)if(u[d]!==l[d]){o=u[d],a=l[d];break}return o<a?-1:a<o?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return x(this,e,t,r);case"latin1":case"binary":return _(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function T(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function O(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function P(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=B(e[o]);return i}function F(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function I(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function j(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function R(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function L(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,n,o){return o||L(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function M(e,t,r,n,o){return o||L(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=c.prototype;else{var i=t-e;r=new c(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},c.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},c.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUInt8=function(e,t){return t||I(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||I(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||I(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||I(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){t||I(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||I(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||I(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||I(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||I(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUIntBE=function(e,t,r,n){e=+e,t|=0,r|=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):R(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):R(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return M(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return M(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var a=c.isBuffer(e)?e:H(new c(e,n).toString()),s=a.length;for(o=0;o<r-t;++o)this[o+t]=a[o%s]}return this};var U=/[^+\/0-9A-Za-z-_]/g;function B(e){return e<16?"0"+e.toString(16):e.toString(16)}function H(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function q(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(29))},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=u(e),a=n[0],s=n[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),l=0,d=s>0?a-4:a;for(r=0;r<d;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=16383,s=0,c=r-i;s<c;s+=a)o.push(l(e,s,s+a>c?c:s+a));return 1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,c=a.length;s<c;++s)n[s]=a[s],i[a.charCodeAt(s)]=s;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,r){for(var i,o,a=[],s=t;s<r;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,c=(1<<s)-1,u=c>>1,l=-7,d=r?i-1:0,p=r?-1:1,f=e[t+d];for(d+=p,o=f&(1<<-l)-1,f>>=-l,l+=s;l>0;o=256*o+e[t+d],d+=p,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+e[t+d],d+=p,l-=8);if(0===o)o=1-u;else{if(o===c)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=u}return(f?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,c,u=8*o-i-1,l=(1<<u)-1,d=l>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,h=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+d>=1?p/c:p*Math.pow(2,1-d))*c>=2&&(a++,c/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*c-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[r+f]=255&s,f+=h,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;e[r+f]=255&a,f+=h,a/=256,u-=8);e[r+f-h]|=128*m}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.jws,r=e.KeyUtil,i=e.X509,o=e.crypto,a=e.hextob64u,s=e.b64tohex,c=e.AllowedSigningAlgs;return function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.parseJwt=function e(r){n.Log.debug("JoseUtil.parseJwt");try{var i=t.JWS.parse(r);return{header:i.headerObj,payload:i.payloadObj}}catch(e){n.Log.error(e)}},e.validateJwt=function(t,o,a,c,u,l,d){n.Log.debug("JoseUtil.validateJwt");try{if("RSA"===o.kty)if(o.e&&o.n)o=r.getKey(o);else{if(!o.x5c||!o.x5c.length)return n.Log.error("JoseUtil.validateJwt: RSA key missing key material",o),Promise.reject(new Error("RSA key missing key material"));var p=s(o.x5c[0]);o=i.getPublicKeyFromCertHex(p)}else{if("EC"!==o.kty)return n.Log.error("JoseUtil.validateJwt: Unsupported key type",o&&o.kty),Promise.reject(new Error(o.kty));if(!(o.crv&&o.x&&o.y))return n.Log.error("JoseUtil.validateJwt: EC key missing key material",o),Promise.reject(new Error("EC key missing key material"));o=r.getKey(o)}return e._validateJwt(t,o,a,c,u,l,d)}catch(e){return n.Log.error(e&&e.message||e),Promise.reject("JWT validation failed")}},e.validateJwtAttributes=function(t,r,i,o,a,s){o||(o=0),a||(a=parseInt(Date.now()/1e3));var c=e.parseJwt(t).payload;if(!c.iss)return n.Log.error("JoseUtil._validateJwt: issuer was not provided"),Promise.reject(new Error("issuer was not provided"));if(c.iss!==r)return n.Log.error("JoseUtil._validateJwt: Invalid issuer in token",c.iss),Promise.reject(new Error("Invalid issuer in token: "+c.iss));if(!c.aud)return n.Log.error("JoseUtil._validateJwt: aud was not provided"),Promise.reject(new Error("aud was not provided"));if(!(c.aud===i||Array.isArray(c.aud)&&c.aud.indexOf(i)>=0))return n.Log.error("JoseUtil._validateJwt: Invalid audience in token",c.aud),Promise.reject(new Error("Invalid audience in token: "+c.aud));if(c.azp&&c.azp!==i)return n.Log.error("JoseUtil._validateJwt: Invalid azp in token",c.azp),Promise.reject(new Error("Invalid azp in token: "+c.azp));if(!s){var u=a+o,l=a-o;if(!c.iat)return n.Log.error("JoseUtil._validateJwt: iat was not provided"),Promise.reject(new Error("iat was not provided"));if(u<c.iat)return n.Log.error("JoseUtil._validateJwt: iat is in the future",c.iat),Promise.reject(new Error("iat is in the future: "+c.iat));if(c.nbf&&u<c.nbf)return n.Log.error("JoseUtil._validateJwt: nbf is in the future",c.nbf),Promise.reject(new Error("nbf is in the future: "+c.nbf));if(!c.exp)return n.Log.error("JoseUtil._validateJwt: exp was not provided"),Promise.reject(new Error("exp was not provided"));if(c.exp<l)return n.Log.error("JoseUtil._validateJwt: exp is in the past",c.exp),Promise.reject(new Error("exp is in the past:"+c.exp))}return Promise.resolve(c)},e._validateJwt=function(r,i,o,a,s,u,l){return e.validateJwtAttributes(r,o,a,s,u,l).then((function(e){try{return t.JWS.verify(r,i,c)?e:(n.Log.error("JoseUtil._validateJwt: signature validation failed"),Promise.reject(new Error("signature validation failed")))}catch(e){return n.Log.error(e&&e.message||e),Promise.reject(new Error("signature validation failed"))}}))},e.hashString=function e(t,r){try{return o.Util.hashString(t,r)}catch(e){n.Log.error(e)}},e.hexToBase64Url=function e(t){try{return a(t)}catch(e){n.Log.error(e)}},e}()};var n=r(0);e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SigninResponse=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(3);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.SigninResponse=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#";o(this,e);var n=i.UrlUtility.parseUrlFragment(t,r);this.error=n.error,this.error_description=n.error_description,this.error_uri=n.error_uri,this.code=n.code,this.state=n.state,this.id_token=n.id_token,this.session_state=n.session_state,this.access_token=n.access_token,this.token_type=n.token_type,this.scope=n.scope,this.profile=void 0,this.expires_in=n.expires_in}return n(e,[{key:"expires_in",get:function(){if(this.expires_at){var e=parseInt(Date.now()/1e3);return this.expires_at-e}},set:function(e){var t=parseInt(e);if("number"==typeof t&&t>0){var r=parseInt(Date.now()/1e3);this.expires_at=r+t}}},{key:"expired",get:function(){var e=this.expires_in;if(void 0!==e)return e<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}},{key:"isOpenIdConnect",get:function(){return this.scopes.indexOf("openid")>=0||!!this.id_token}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignoutRequest=void 0;var n=r(0),i=r(3),o=r(9);t.SignoutRequest=function e(t){var r=t.url,a=t.id_token_hint,s=t.post_logout_redirect_uri,c=t.data,u=t.extraQueryParams,l=t.request_type;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!r)throw n.Log.error("SignoutRequest.ctor: No url passed"),new Error("url");for(var d in a&&(r=i.UrlUtility.addQueryParam(r,"id_token_hint",a)),s&&(r=i.UrlUtility.addQueryParam(r,"post_logout_redirect_uri",s),c&&(this.state=new o.State({data:c,request_type:l}),r=i.UrlUtility.addQueryParam(r,"state",this.state.id))),u)r=i.UrlUtility.addQueryParam(r,d,u[d]);this.url=r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignoutResponse=void 0;var n=r(3);t.SignoutResponse=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var r=n.UrlUtility.parseUrlFragment(t,"?");this.error=r.error,this.error_description=r.error_description,this.error_uri=r.error_uri,this.state=r.state}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InMemoryWebStorage=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0);t.InMemoryWebStorage=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._data={}}return e.prototype.getItem=function(e){return i.Log.debug("InMemoryWebStorage.getItem",e),this._data[e]},e.prototype.setItem=function(e,t){i.Log.debug("InMemoryWebStorage.setItem",e),this._data[e]=t},e.prototype.removeItem=function(e){i.Log.debug("InMemoryWebStorage.removeItem",e),delete this._data[e]},e.prototype.key=function(e){return Object.getOwnPropertyNames(this._data)[e]},n(e,[{key:"length",get:function(){return Object.getOwnPropertyNames(this._data).length}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserManager=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),o=r(10),a=r(39),s=r(15),c=r(45),u=r(47),l=r(18),d=r(8),p=r(20),f=r(11),h=r(4);function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}t.UserManager=function(e){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.SilentRenewService,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.SessionMonitor,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:p.TokenRevocationClient,d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:f.TokenClient,v=arguments.length>5&&void 0!==arguments[5]?arguments[5]:h.JoseUtil;m(this,t),r instanceof a.UserManagerSettings||(r=new a.UserManagerSettings(r));var y=g(this,e.call(this,r));return y._events=new c.UserManagerEvents(r),y._silentRenewService=new n(y),y.settings.automaticSilentRenew&&(i.Log.debug("UserManager.ctor: automaticSilentRenew is configured, setting up silent renew"),y.startSilentRenew()),y.settings.monitorSession&&(i.Log.debug("UserManager.ctor: monitorSession is configured, setting up session monitor"),y._sessionMonitor=new o(y)),y._tokenRevocationClient=new s(y._settings),y._tokenClient=new d(y._settings),y._joseUtil=v,y}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getUser=function(){var e=this;return this._loadUser().then((function(t){return t?(i.Log.info("UserManager.getUser: user loaded"),e._events.load(t,!1),t):(i.Log.info("UserManager.getUser: user not found in storage"),null)}))},t.prototype.removeUser=function(){var e=this;return this.storeUser(null).then((function(){i.Log.info("UserManager.removeUser: user removed from storage"),e._events.unload()}))},t.prototype.signinRedirect=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="si:r";var t={useReplaceToNavigate:e.useReplaceToNavigate};return this._signinStart(e,this._redirectNavigator,t).then((function(){i.Log.info("UserManager.signinRedirect: successful")}))},t.prototype.signinRedirectCallback=function(e){return this._signinEnd(e||this._redirectNavigator.url).then((function(e){return e.profile&&e.profile.sub?i.Log.info("UserManager.signinRedirectCallback: successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinRedirectCallback: no sub"),e}))},t.prototype.signinPopup=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="si:p";var t=e.redirect_uri||this.settings.popup_redirect_uri||this.settings.redirect_uri;return t?(e.redirect_uri=t,e.display="popup",this._signin(e,this._popupNavigator,{startUrl:t,popupWindowFeatures:e.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:e.popupWindowTarget||this.settings.popupWindowTarget}).then((function(e){return e&&(e.profile&&e.profile.sub?i.Log.info("UserManager.signinPopup: signinPopup successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinPopup: no sub")),e}))):(i.Log.error("UserManager.signinPopup: No popup_redirect_uri or redirect_uri configured"),Promise.reject(new Error("No popup_redirect_uri or redirect_uri configured")))},t.prototype.signinPopupCallback=function(e){return this._signinCallback(e,this._popupNavigator).then((function(e){return e&&(e.profile&&e.profile.sub?i.Log.info("UserManager.signinPopupCallback: successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinPopupCallback: no sub")),e})).catch((function(e){i.Log.error(e.message)}))},t.prototype.signinSilent=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=Object.assign({},t),this._loadUser().then((function(r){return r&&r.refresh_token?(t.refresh_token=r.refresh_token,e._useRefreshToken(t)):(t.request_type="si:s",t.id_token_hint=t.id_token_hint||e.settings.includeIdTokenInSilentRenew&&r&&r.id_token,r&&e._settings.validateSubOnSilentRenew&&(i.Log.debug("UserManager.signinSilent, subject prior to silent renew: ",r.profile.sub),t.current_sub=r.profile.sub),e._signinSilentIframe(t))}))},t.prototype._useRefreshToken=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._tokenClient.exchangeRefreshToken(t).then((function(t){return t?t.access_token?e._loadUser().then((function(r){if(r){var n=Promise.resolve();return t.id_token&&(n=e._validateIdTokenFromTokenRefreshToken(r.profile,t.id_token)),n.then((function(){return i.Log.debug("UserManager._useRefreshToken: refresh token response success"),r.id_token=t.id_token||r.id_token,r.access_token=t.access_token,r.refresh_token=t.refresh_token||r.refresh_token,r.expires_in=t.expires_in,e.storeUser(r).then((function(){return e._events.load(r),r}))}))}return null})):(i.Log.error("UserManager._useRefreshToken: No access token returned from token endpoint"),Promise.reject("No access token returned from token endpoint")):(i.Log.error("UserManager._useRefreshToken: No response returned from token endpoint"),Promise.reject("No response returned from token endpoint"))}))},t.prototype._validateIdTokenFromTokenRefreshToken=function(e,t){var r=this;return this._metadataService.getIssuer().then((function(n){return r.settings.getEpochTime().then((function(o){return r._joseUtil.validateJwtAttributes(t,n,r._settings.client_id,r._settings.clockSkew,o).then((function(t){return t?t.sub!==e.sub?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: sub in id_token does not match current sub"),Promise.reject(new Error("sub in id_token does not match current sub"))):t.auth_time&&t.auth_time!==e.auth_time?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: auth_time in id_token does not match original auth_time"),Promise.reject(new Error("auth_time in id_token does not match original auth_time"))):t.azp&&t.azp!==e.azp?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: azp in id_token does not match original azp"),Promise.reject(new Error("azp in id_token does not match original azp"))):!t.azp&&e.azp?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: azp not in id_token, but present in original id_token"),Promise.reject(new Error("azp not in id_token, but present in original id_token"))):void 0:(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: Failed to validate id_token"),Promise.reject(new Error("Failed to validate id_token")))}))}))}))},t.prototype._signinSilentIframe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return t?(e.redirect_uri=t,e.prompt=e.prompt||"none",this._signin(e,this._iframeNavigator,{startUrl:t,silentRequestTimeout:e.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(e){return e&&(e.profile&&e.profile.sub?i.Log.info("UserManager.signinSilent: successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinSilent: no sub")),e}))):(i.Log.error("UserManager.signinSilent: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},t.prototype.signinSilentCallback=function(e){return this._signinCallback(e,this._iframeNavigator).then((function(e){return e&&(e.profile&&e.profile.sub?i.Log.info("UserManager.signinSilentCallback: successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinSilentCallback: no sub")),e}))},t.prototype.signinCallback=function(e){var t=this;return this.readSigninResponseState(e).then((function(r){var n=r.state;return r.response,"si:r"===n.request_type?t.signinRedirectCallback(e):"si:p"===n.request_type?t.signinPopupCallback(e):"si:s"===n.request_type?t.signinSilentCallback(e):Promise.reject(new Error("invalid response_type in state"))}))},t.prototype.signoutCallback=function(e,t){var r=this;return this.readSignoutResponseState(e).then((function(n){var i=n.state,o=n.response;return i?"so:r"===i.request_type?r.signoutRedirectCallback(e):"so:p"===i.request_type?r.signoutPopupCallback(e,t):Promise.reject(new Error("invalid response_type in state")):o}))},t.prototype.querySessionStatus=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="si:s";var r=t.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return r?(t.redirect_uri=r,t.prompt="none",t.response_type=t.response_type||this.settings.query_status_response_type,t.scope=t.scope||"openid",t.skipUserInfo=!0,this._signinStart(t,this._iframeNavigator,{startUrl:r,silentRequestTimeout:t.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(t){return e.processSigninResponse(t.url).then((function(e){if(i.Log.debug("UserManager.querySessionStatus: got signin response"),e.session_state&&e.profile.sub)return i.Log.info("UserManager.querySessionStatus: querySessionStatus success for sub: ",e.profile.sub),{session_state:e.session_state,sub:e.profile.sub,sid:e.profile.sid};i.Log.info("querySessionStatus successful, user not authenticated")})).catch((function(t){if(t.session_state&&e.settings.monitorAnonymousSession&&("login_required"==t.message||"consent_required"==t.message||"interaction_required"==t.message||"account_selection_required"==t.message))return i.Log.info("UserManager.querySessionStatus: querySessionStatus success for anonymous user"),{session_state:t.session_state};throw t}))}))):(i.Log.error("UserManager.querySessionStatus: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},t.prototype._signin=function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signinStart(e,t,n).then((function(t){return r._signinEnd(t.url,e)}))},t.prototype._signinStart=function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.prepare(n).then((function(t){return i.Log.debug("UserManager._signinStart: got navigator window handle"),r.createSigninRequest(e).then((function(e){return i.Log.debug("UserManager._signinStart: got signin request"),n.url=e.url,n.id=e.state.id,t.navigate(n)})).catch((function(e){throw t.close&&(i.Log.debug("UserManager._signinStart: Error after preparing navigator, closing navigator window"),t.close()),e}))}))},t.prototype._signinEnd=function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.processSigninResponse(e).then((function(e){i.Log.debug("UserManager._signinEnd: got signin response");var n=new s.User(e);if(r.current_sub){if(r.current_sub!==n.profile.sub)return i.Log.debug("UserManager._signinEnd: current user does not match user returned from signin. sub from signin: ",n.profile.sub),Promise.reject(new Error("login_required"));i.Log.debug("UserManager._signinEnd: current user matches user returned from signin")}return t.storeUser(n).then((function(){return i.Log.debug("UserManager._signinEnd: user stored"),t._events.load(n),n}))}))},t.prototype._signinCallback=function(e,t){i.Log.debug("UserManager._signinCallback");var r="query"===this._settings.response_mode||!this._settings.response_mode&&d.SigninRequest.isCode(this._settings.response_type)?"?":"#";return t.callback(e,void 0,r)},t.prototype.signoutRedirect=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="so:r";var t=e.post_logout_redirect_uri||this.settings.post_logout_redirect_uri;t&&(e.post_logout_redirect_uri=t);var r={useReplaceToNavigate:e.useReplaceToNavigate};return this._signoutStart(e,this._redirectNavigator,r).then((function(){i.Log.info("UserManager.signoutRedirect: successful")}))},t.prototype.signoutRedirectCallback=function(e){return this._signoutEnd(e||this._redirectNavigator.url).then((function(e){return i.Log.info("UserManager.signoutRedirectCallback: successful"),e}))},t.prototype.signoutPopup=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="so:p";var t=e.post_logout_redirect_uri||this.settings.popup_post_logout_redirect_uri||this.settings.post_logout_redirect_uri;return e.post_logout_redirect_uri=t,e.display="popup",e.post_logout_redirect_uri&&(e.state=e.state||{}),this._signout(e,this._popupNavigator,{startUrl:t,popupWindowFeatures:e.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:e.popupWindowTarget||this.settings.popupWindowTarget}).then((function(){i.Log.info("UserManager.signoutPopup: successful")}))},t.prototype.signoutPopupCallback=function(e,t){return void 0===t&&"boolean"==typeof e&&(t=e,e=null),this._popupNavigator.callback(e,t,"?").then((function(){i.Log.info("UserManager.signoutPopupCallback: successful")}))},t.prototype._signout=function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signoutStart(e,t,n).then((function(e){return r._signoutEnd(e.url)}))},t.prototype._signoutStart=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this,r=arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.prepare(n).then((function(r){return i.Log.debug("UserManager._signoutStart: got navigator window handle"),t._loadUser().then((function(o){return i.Log.debug("UserManager._signoutStart: loaded current user from storage"),(t._settings.revokeAccessTokenOnSignout?t._revokeInternal(o):Promise.resolve()).then((function(){var a=e.id_token_hint||o&&o.id_token;return a&&(i.Log.debug("UserManager._signoutStart: Setting id_token into signout request"),e.id_token_hint=a),t.removeUser().then((function(){return i.Log.debug("UserManager._signoutStart: user removed, creating signout request"),t.createSignoutRequest(e).then((function(e){return i.Log.debug("UserManager._signoutStart: got signout request"),n.url=e.url,e.state&&(n.id=e.state.id),r.navigate(n)}))}))}))})).catch((function(e){throw r.close&&(i.Log.debug("UserManager._signoutStart: Error after preparing navigator, closing navigator window"),r.close()),e}))}))},t.prototype._signoutEnd=function(e){return this.processSignoutResponse(e).then((function(e){return i.Log.debug("UserManager._signoutEnd: got signout response"),e}))},t.prototype.revokeAccessToken=function(){var e=this;return this._loadUser().then((function(t){return e._revokeInternal(t,!0).then((function(r){if(r)return i.Log.debug("UserManager.revokeAccessToken: removing token properties from user and re-storing"),t.access_token=null,t.refresh_token=null,t.expires_at=null,t.token_type=null,e.storeUser(t).then((function(){i.Log.debug("UserManager.revokeAccessToken: user stored"),e._events.load(t)}))}))})).then((function(){i.Log.info("UserManager.revokeAccessToken: access token revoked successfully")}))},t.prototype._revokeInternal=function(e,t){var r=this;if(e){var n=e.access_token,o=e.refresh_token;return this._revokeAccessTokenInternal(n,t).then((function(e){return r._revokeRefreshTokenInternal(o,t).then((function(t){return e||t||i.Log.debug("UserManager.revokeAccessToken: no need to revoke due to no token(s), or JWT format"),e||t}))}))}return Promise.resolve(!1)},t.prototype._revokeAccessTokenInternal=function(e,t){return!e||e.indexOf(".")>=0?Promise.resolve(!1):this._tokenRevocationClient.revoke(e,t).then((function(){return!0}))},t.prototype._revokeRefreshTokenInternal=function(e,t){return e?this._tokenRevocationClient.revoke(e,t,"refresh_token").then((function(){return!0})):Promise.resolve(!1)},t.prototype.startSilentRenew=function(){this._silentRenewService.start()},t.prototype.stopSilentRenew=function(){this._silentRenewService.stop()},t.prototype._loadUser=function(){return this._userStore.get(this._userStoreKey).then((function(e){return e?(i.Log.debug("UserManager._loadUser: user storageString loaded"),s.User.fromStorageString(e)):(i.Log.debug("UserManager._loadUser: no user storageString"),null)}))},t.prototype.storeUser=function(e){if(e){i.Log.debug("UserManager.storeUser: storing user");var t=e.toStorageString();return this._userStore.set(this._userStoreKey,t)}return i.Log.debug("storeUser.storeUser: removing user"),this._userStore.remove(this._userStoreKey)},n(t,[{key:"_redirectNavigator",get:function(){return this.settings.redirectNavigator}},{key:"_popupNavigator",get:function(){return this.settings.popupNavigator}},{key:"_iframeNavigator",get:function(){return this.settings.iframeNavigator}},{key:"_userStore",get:function(){return this.settings.userStore}},{key:"events",get:function(){return this._events}},{key:"_userStoreKey",get:function(){return"user:"+this.settings.authority+":"+this.settings.client_id}}]),t}(o.OidcClient)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserManagerSettings=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=(r(0),r(5)),o=r(40),a=r(41),s=r(43),c=r(6),u=r(1),l=r(8);function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}t.UserManagerSettings=function(e){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.popup_redirect_uri,i=r.popup_post_logout_redirect_uri,f=r.popupWindowFeatures,h=r.popupWindowTarget,m=r.silent_redirect_uri,g=r.silentRequestTimeout,v=r.automaticSilentRenew,y=void 0!==v&&v,b=r.validateSubOnSilentRenew,w=void 0!==b&&b,x=r.includeIdTokenInSilentRenew,_=void 0===x||x,E=r.monitorSession,k=void 0===E||E,S=r.monitorAnonymousSession,A=void 0!==S&&S,C=r.checkSessionInterval,T=void 0===C?2e3:C,O=r.stopCheckSessionOnError,P=void 0===O||O,F=r.query_status_response_type,I=r.revokeAccessTokenOnSignout,N=void 0!==I&&I,j=r.accessTokenExpiringNotificationTime,R=void 0===j?60:j,L=r.redirectNavigator,D=void 0===L?new o.RedirectNavigator:L,M=r.popupNavigator,U=void 0===M?new a.PopupNavigator:M,B=r.iframeNavigator,H=void 0===B?new s.IFrameNavigator:B,q=r.userStore,K=void 0===q?new c.WebStorageStateStore({store:u.Global.sessionStorage}):q;d(this,t);var W=p(this,e.call(this,arguments[0]));return W._popup_redirect_uri=n,W._popup_post_logout_redirect_uri=i,W._popupWindowFeatures=f,W._popupWindowTarget=h,W._silent_redirect_uri=m,W._silentRequestTimeout=g,W._automaticSilentRenew=y,W._validateSubOnSilentRenew=w,W._includeIdTokenInSilentRenew=_,W._accessTokenExpiringNotificationTime=R,W._monitorSession=k,W._monitorAnonymousSession=A,W._checkSessionInterval=T,W._stopCheckSessionOnError=P,F?W._query_status_response_type=F:arguments[0]&&arguments[0].response_type?W._query_status_response_type=l.SigninRequest.isOidc(arguments[0].response_type)?"id_token":"code":W._query_status_response_type="id_token",W._revokeAccessTokenOnSignout=N,W._redirectNavigator=D,W._popupNavigator=U,W._iframeNavigator=H,W._userStore=K,W}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"popup_redirect_uri",get:function(){return this._popup_redirect_uri}},{key:"popup_post_logout_redirect_uri",get:function(){return this._popup_post_logout_redirect_uri}},{key:"popupWindowFeatures",get:function(){return this._popupWindowFeatures}},{key:"popupWindowTarget",get:function(){return this._popupWindowTarget}},{key:"silent_redirect_uri",get:function(){return this._silent_redirect_uri}},{key:"silentRequestTimeout",get:function(){return this._silentRequestTimeout}},{key:"automaticSilentRenew",get:function(){return this._automaticSilentRenew}},{key:"validateSubOnSilentRenew",get:function(){return this._validateSubOnSilentRenew}},{key:"includeIdTokenInSilentRenew",get:function(){return this._includeIdTokenInSilentRenew}},{key:"accessTokenExpiringNotificationTime",get:function(){return this._accessTokenExpiringNotificationTime}},{key:"monitorSession",get:function(){return this._monitorSession}},{key:"monitorAnonymousSession",get:function(){return this._monitorAnonymousSession}},{key:"checkSessionInterval",get:function(){return this._checkSessionInterval}},{key:"stopCheckSessionOnError",get:function(){return this._stopCheckSessionOnError}},{key:"query_status_response_type",get:function(){return this._query_status_response_type}},{key:"revokeAccessTokenOnSignout",get:function(){return this._revokeAccessTokenOnSignout}},{key:"redirectNavigator",get:function(){return this._redirectNavigator}},{key:"popupNavigator",get:function(){return this._popupNavigator}},{key:"iframeNavigator",get:function(){return this._iframeNavigator}},{key:"userStore",get:function(){return this._userStore}}]),t}(i.OidcClientSettings)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RedirectNavigator=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0);t.RedirectNavigator=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.prototype.prepare=function(){return Promise.resolve(this)},e.prototype.navigate=function(e){return e&&e.url?(e.useReplaceToNavigate?window.location.replace(e.url):window.location=e.url,Promise.resolve()):(i.Log.error("RedirectNavigator.navigate: No url provided"),Promise.reject(new Error("No url provided")))},n(e,[{key:"url",get:function(){return window.location.href}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PopupNavigator=void 0;var n=r(0),i=r(42);t.PopupNavigator=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.prototype.prepare=function(e){var t=new i.PopupWindow(e);return Promise.resolve(t)},e.prototype.callback=function e(t,r,o){n.Log.debug("PopupNavigator.callback");try{return i.PopupWindow.notifyOpener(t,r,o),Promise.resolve()}catch(e){return Promise.reject(e)}},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PopupWindow=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),o=r(3);t.PopupWindow=function(){function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._promise=new Promise((function(e,t){r._resolve=e,r._reject=t}));var n=t.popupWindowTarget||"_blank",o=t.popupWindowFeatures||"location=no,toolbar=no,width=500,height=500,left=100,top=100;";this._popup=window.open("",n,o),this._popup&&(i.Log.debug("PopupWindow.ctor: popup successfully created"),this._checkForPopupClosedTimer=window.setInterval(this._checkForPopupClosed.bind(this),500))}return e.prototype.navigate=function(e){return this._popup?e&&e.url?(i.Log.debug("PopupWindow.navigate: Setting URL in popup"),this._id=e.id,this._id&&(window["popupCallback_"+e.id]=this._callback.bind(this)),this._popup.focus(),this._popup.window.location=e.url):(this._error("PopupWindow.navigate: no url provided"),this._error("No url provided")):this._error("PopupWindow.navigate: Error opening popup window"),this.promise},e.prototype._success=function(e){i.Log.debug("PopupWindow.callback: Successful response from popup window"),this._cleanup(),this._resolve(e)},e.prototype._error=function(e){i.Log.error("PopupWindow.error: ",e),this._cleanup(),this._reject(new Error(e))},e.prototype.close=function(){this._cleanup(!1)},e.prototype._cleanup=function(e){i.Log.debug("PopupWindow.cleanup"),window.clearInterval(this._checkForPopupClosedTimer),this._checkForPopupClosedTimer=null,delete window["popupCallback_"+this._id],this._popup&&!e&&this._popup.close(),this._popup=null},e.prototype._checkForPopupClosed=function(){this._popup&&!this._popup.closed||this._error("Popup window closed")},e.prototype._callback=function(e,t){this._cleanup(t),e?(i.Log.debug("PopupWindow.callback success"),this._success({url:e})):(i.Log.debug("PopupWindow.callback: Invalid response from popup"),this._error("Invalid response from popup"))},e.notifyOpener=function(e,t,r){if(window.opener){if(e=e||window.location.href){var n=o.UrlUtility.parseUrlFragment(e,r);if(n.state){var a="popupCallback_"+n.state,s=window.opener[a];s?(i.Log.debug("PopupWindow.notifyOpener: passing url message to opener"),s(e,t)):i.Log.warn("PopupWindow.notifyOpener: no matching callback found on opener")}else i.Log.warn("PopupWindow.notifyOpener: no state found in response url")}}else i.Log.warn("PopupWindow.notifyOpener: no window.opener. Can't complete notification.")},n(e,[{key:"promise",get:function(){return this._promise}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IFrameNavigator=void 0;var n=r(0),i=r(44);t.IFrameNavigator=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.prototype.prepare=function(e){var t=new i.IFrameWindow(e);return Promise.resolve(t)},e.prototype.callback=function e(t){n.Log.debug("IFrameNavigator.callback");try{return i.IFrameWindow.notifyParent(t),Promise.resolve()}catch(e){return Promise.reject(e)}},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IFrameWindow=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0);t.IFrameWindow=function(){function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._promise=new Promise((function(e,t){r._resolve=e,r._reject=t})),this._boundMessageEvent=this._message.bind(this),window.addEventListener("message",this._boundMessageEvent,!1),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.width=0,this._frame.height=0,window.document.body.appendChild(this._frame)}return e.prototype.navigate=function(e){if(e&&e.url){var t=e.silentRequestTimeout||1e4;i.Log.debug("IFrameWindow.navigate: Using timeout of:",t),this._timer=window.setTimeout(this._timeout.bind(this),t),this._frame.src=e.url}else this._error("No url provided");return this.promise},e.prototype._success=function(e){this._cleanup(),i.Log.debug("IFrameWindow: Successful response from frame window"),this._resolve(e)},e.prototype._error=function(e){this._cleanup(),i.Log.error(e),this._reject(new Error(e))},e.prototype.close=function(){this._cleanup()},e.prototype._cleanup=function(){this._frame&&(i.Log.debug("IFrameWindow: cleanup"),window.removeEventListener("message",this._boundMessageEvent,!1),window.clearTimeout(this._timer),window.document.body.removeChild(this._frame),this._timer=null,this._frame=null,this._boundMessageEvent=null)},e.prototype._timeout=function(){i.Log.debug("IFrameWindow.timeout"),this._error("Frame window timed out")},e.prototype._message=function(e){if(i.Log.debug("IFrameWindow.message"),this._timer&&e.origin===this._origin&&e.source===this._frame.contentWindow&&"string"==typeof e.data&&(e.data.startsWith("http://")||e.data.startsWith("https://"))){var t=e.data;t?this._success({url:t}):this._error("Invalid response from frame")}},e.notifyParent=function(e){i.Log.debug("IFrameWindow.notifyParent"),(e=e||window.location.href)&&(i.Log.debug("IFrameWindow.notifyParent: posting url message to parent"),window.parent.postMessage(e,location.protocol+"//"+location.host))},n(e,[{key:"promise",get:function(){return this._promise}},{key:"_origin",get:function(){return location.protocol+"//"+location.host}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserManagerEvents=void 0;var n=r(0),i=r(16),o=r(17);t.UserManagerEvents=function(e){function t(r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,r));return n._userLoaded=new o.Event("User loaded"),n._userUnloaded=new o.Event("User unloaded"),n._silentRenewError=new o.Event("Silent renew error"),n._userSignedIn=new o.Event("User signed in"),n._userSignedOut=new o.Event("User signed out"),n._userSessionChanged=new o.Event("User session changed"),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.load=function(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];n.Log.debug("UserManagerEvents.load"),e.prototype.load.call(this,t),r&&this._userLoaded.raise(t)},t.prototype.unload=function(){n.Log.debug("UserManagerEvents.unload"),e.prototype.unload.call(this),this._userUnloaded.raise()},t.prototype.addUserLoaded=function(e){this._userLoaded.addHandler(e)},t.prototype.removeUserLoaded=function(e){this._userLoaded.removeHandler(e)},t.prototype.addUserUnloaded=function(e){this._userUnloaded.addHandler(e)},t.prototype.removeUserUnloaded=function(e){this._userUnloaded.removeHandler(e)},t.prototype.addSilentRenewError=function(e){this._silentRenewError.addHandler(e)},t.prototype.removeSilentRenewError=function(e){this._silentRenewError.removeHandler(e)},t.prototype._raiseSilentRenewError=function(e){n.Log.debug("UserManagerEvents._raiseSilentRenewError",e.message),this._silentRenewError.raise(e)},t.prototype.addUserSignedIn=function(e){this._userSignedIn.addHandler(e)},t.prototype.removeUserSignedIn=function(e){this._userSignedIn.removeHandler(e)},t.prototype._raiseUserSignedIn=function(){n.Log.debug("UserManagerEvents._raiseUserSignedIn"),this._userSignedIn.raise()},t.prototype.addUserSignedOut=function(e){this._userSignedOut.addHandler(e)},t.prototype.removeUserSignedOut=function(e){this._userSignedOut.removeHandler(e)},t.prototype._raiseUserSignedOut=function(){n.Log.debug("UserManagerEvents._raiseUserSignedOut"),this._userSignedOut.raise()},t.prototype.addUserSessionChanged=function(e){this._userSessionChanged.addHandler(e)},t.prototype.removeUserSessionChanged=function(e){this._userSessionChanged.removeHandler(e)},t.prototype._raiseUserSessionChanged=function(){n.Log.debug("UserManagerEvents._raiseUserSessionChanged"),this._userSessionChanged.raise()},t}(i.AccessTokenEvents)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Timer=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),o=r(1),a=r(17);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}t.Timer=function(e){function t(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.Global.timer,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;s(this,t);var a=c(this,e.call(this,r));return a._timer=n,a._nowFunc=i||function(){return Date.now()/1e3},a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.init=function(e){e<=0&&(e=1),e=parseInt(e);var t=this.now+e;if(this.expiration===t&&this._timerHandle)i.Log.debug("Timer.init timer "+this._name+" skipping initialization since already initialized for expiration:",this.expiration);else{this.cancel(),i.Log.debug("Timer.init timer "+this._name+" for duration:",e),this._expiration=t;var r=5;e<r&&(r=e),this._timerHandle=this._timer.setInterval(this._callback.bind(this),1e3*r)}},t.prototype.cancel=function(){this._timerHandle&&(i.Log.debug("Timer.cancel: ",this._name),this._timer.clearInterval(this._timerHandle),this._timerHandle=null)},t.prototype._callback=function(){var t=this._expiration-this.now;i.Log.debug("Timer.callback; "+this._name+" timer expires in:",t),this._expiration<=this.now&&(this.cancel(),e.prototype.raise.call(this))},n(t,[{key:"now",get:function(){return parseInt(this._nowFunc())}},{key:"expiration",get:function(){return this._expiration}}]),t}(a.Event)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SilentRenewService=void 0;var n=r(0);t.SilentRenewService=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._userManager=t}return e.prototype.start=function(){this._callback||(this._callback=this._tokenExpiring.bind(this),this._userManager.events.addAccessTokenExpiring(this._callback),this._userManager.getUser().then((function(e){})).catch((function(e){n.Log.error("SilentRenewService.start: Error from getUser:",e.message)})))},e.prototype.stop=function(){this._callback&&(this._userManager.events.removeAccessTokenExpiring(this._callback),delete this._callback)},e.prototype._tokenExpiring=function(){var e=this;this._userManager.signinSilent().then((function(e){n.Log.debug("SilentRenewService._tokenExpiring: Silent token renewal successful")}),(function(t){n.Log.error("SilentRenewService._tokenExpiring: Error from signinSilent:",t.message),e._userManager.events._raiseSilentRenewError(t)}))},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CordovaPopupNavigator=void 0;var n=r(21);t.CordovaPopupNavigator=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.prototype.prepare=function(e){var t=new n.CordovaPopupWindow(e);return Promise.resolve(t)},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CordovaIFrameNavigator=void 0;var n=r(21);t.CordovaIFrameNavigator=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.prototype.prepare=function(e){e.popupWindowFeatures="hidden=yes";var t=new n.CordovaPopupWindow(e);return Promise.resolve(t)},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Version="1.11.6"}])},e.exports=t()},143:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(835),i=r(854),o=r(5036),a=(e,t)=>(0,i.fetch)(e,t);t.default=class{constructor(e,t,r,i,s){this.loginHandler=e,this.redirectHandler=t,this.logoutHandler=r,this.sessionInfoManager=i,this.issuerConfigFetcher=s,this.login=async(e,t)=>{var r,i;await this.sessionInfoManager.clear(e.sessionId);const a=null!==(r=e.redirectUrl)&&void 0!==r?r:(0,o.removeOidcQueryParam)(window.location.href);if(!(0,n.isValidRedirectUrl)(a))throw new Error(`${a} is not a valid redirect URL, it is either a malformed IRI or it includes a hash fragment.`);await this.loginHandler.handle({...e,redirectUrl:a,clientName:null!==(i=e.clientName)&&void 0!==i?i:e.clientId,eventEmitter:t})},this.fetch=a,this.logout=async e=>{await this.logoutHandler.handle(e),this.fetch=a},this.getSessionInfo=async e=>this.sessionInfoManager.get(e),this.getAllSessionInfo=async()=>this.sessionInfoManager.getAll(),this.validateCurrentSession=async e=>{const t=await this.sessionInfoManager.get(e);return void 0===t||void 0===t.clientAppId||void 0===t.issuer?null:t},this.handleIncomingRedirect=async(e,t)=>{try{const r=await this.redirectHandler.handle(e,t);return this.fetch=r.fetch.bind(window),this.cleanUrlAfterRedirect(e),{isLoggedIn:r.isLoggedIn,webId:r.webId,sessionId:r.sessionId,expirationDate:r.expirationDate}}catch(r){return this.cleanUrlAfterRedirect(e),void t.emit(n.EVENTS.ERROR,"redirect",r)}}}cleanUrlAfterRedirect(e){const t=new URL(e);t.searchParams.delete("state"),t.searchParams.delete("code"),t.searchParams.delete("id_token"),t.searchParams.delete("access_token"),t.searchParams.delete("error"),t.searchParams.delete("error_description"),t.searchParams.delete("iss"),window.history.replaceState(null,"",t.toString())}}},3598:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Session=t.silentlyAuthenticate=void 0;const i=r(835),o=r(3438),a=n(r(7187)),s=r(3537),c=r(3783);async function u(e,t,r){var n;const i=await t.validateCurrentSession(e);return null!==i&&(window.localStorage.setItem(c.KEY_CURRENT_URL,window.location.href),await t.login({sessionId:e,prompt:"none",oidcIssuer:i.issuer,redirectUrl:i.redirectUrl,clientId:i.clientAppId,clientSecret:i.clientAppSecret,tokenType:null!==(n=i.tokenType)&&void 0!==n?n:"DPoP"},r.events),!0)}t.silentlyAuthenticate=u;class l extends a.default{constructor(e={},t){super(),this.tokenRequestInProgress=!1,this.login=async e=>{var t;return await this.clientAuthentication.login({sessionId:this.info.sessionId,...e,tokenType:null!==(t=e.tokenType)&&void 0!==t?t:"DPoP"},this.events),new Promise((()=>{}))},this.fetch=async(e,t)=>this.clientAuthentication.fetch(e,t),this.internalLogout=async e=>{window.localStorage.removeItem(c.KEY_CURRENT_SESSION),await this.clientAuthentication.logout(this.info.sessionId),this.info.isLoggedIn=!1,e&&this.events.emit(i.EVENTS.LOGOUT)},this.logout=async()=>this.internalLogout(!0),this.handleIncomingRedirect=async(e={})=>{var t;if(this.info.isLoggedIn)return this.info;if(this.tokenRequestInProgress)return;const r="string"==typeof e?{url:e}:e,n=null!==(t=r.url)&&void 0!==t?t:window.location.href;this.tokenRequestInProgress=!0;const o=await this.clientAuthentication.handleIncomingRedirect(n,this.events);if(function(e){return!!(null==e?void 0:e.isLoggedIn)}(o)){this.setSessionInfo(o);const e=window.localStorage.getItem(c.KEY_CURRENT_URL);null===e?this.events.emit(i.EVENTS.LOGIN):(window.localStorage.removeItem(c.KEY_CURRENT_URL),this.events.emit(i.EVENTS.SESSION_RESTORED,e))}else if(!0===r.restorePreviousSession){const e=window.localStorage.getItem(c.KEY_CURRENT_SESSION);if(null!==e&&await u(e,this.clientAuthentication,this))return new Promise((()=>{}))}return this.tokenRequestInProgress=!1,o},this.events=new Proxy(this,(0,i.buildProxyHandler)(l.prototype,"events only implements ISessionEventListener")),e.clientAuthentication?this.clientAuthentication=e.clientAuthentication:e.secureStorage&&e.insecureStorage?this.clientAuthentication=(0,s.getClientAuthenticationWithDependencies)({secureStorage:e.secureStorage,insecureStorage:e.insecureStorage}):this.clientAuthentication=(0,s.getClientAuthenticationWithDependencies)({}),e.sessionInfo?this.info={sessionId:e.sessionInfo.sessionId,isLoggedIn:!1,webId:e.sessionInfo.webId}:this.info={sessionId:null!=t?t:(0,o.v4)(),isLoggedIn:!1},this.events.on(i.EVENTS.LOGIN,(()=>window.localStorage.setItem(c.KEY_CURRENT_SESSION,this.info.sessionId))),this.events.on(i.EVENTS.SESSION_EXPIRED,(()=>this.internalLogout(!1))),this.events.on(i.EVENTS.ERROR,(()=>this.internalLogout(!1)))}onLogin(e){this.events.on(i.EVENTS.LOGIN,e)}onLogout(e){this.events.on(i.EVENTS.LOGOUT,e)}onError(e){this.events.on(i.EVENTS.ERROR,e)}onSessionRestore(e){this.events.on(i.EVENTS.SESSION_RESTORED,e)}onSessionExpiration(e){this.events.on(i.EVENTS.SESSION_EXPIRED,e)}setSessionInfo(e){this.info.isLoggedIn=e.isLoggedIn,this.info.webId=e.webId,this.info.sessionId=e.sessionId,this.info.expirationDate=e.expirationDate,this.events.on(i.EVENTS.SESSION_EXTENDED,(e=>{this.info.expirationDate=Date.now()+1e3*e}))}}t.Session=l},3783:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KEY_CURRENT_URL=t.KEY_CURRENT_SESSION=void 0;const n=r(835);t.KEY_CURRENT_SESSION=`${n.SOLID_CLIENT_AUTHN_KEY_PREFIX}currentSession`,t.KEY_CURRENT_URL=`${n.SOLID_CLIENT_AUTHN_KEY_PREFIX}currentUrl`},7814:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.events=t.onSessionRestore=t.onLogout=t.onLogin=t.handleIncomingRedirect=t.logout=t.login=t.fetch=t.getDefaultSession=void 0;const n=r(3598);let i;function o(){return void 0===i&&(i=new n.Session),i}t.getDefaultSession=o,t.fetch=(...e)=>o().fetch(...e),t.login=(...e)=>o().login(...e),t.logout=(...e)=>o().logout(...e),t.handleIncomingRedirect=(...e)=>o().handleIncomingRedirect(...e),t.onLogin=(...e)=>o().onLogin(...e),t.onLogout=(...e)=>o().onLogout(...e),t.onSessionRestore=(...e)=>o().onSessionRestore(...e),t.events=()=>o().events},3537:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getClientAuthenticationWithDependencies=void 0;const i=r(835),o=n(r(437)),a=n(r(143)),s=n(r(2018)),c=n(r(1590)),u=n(r(4377)),l=r(9582),d=n(r(2186)),p=r(3624),f=r(1272),h=n(r(2056)),m=n(r(5394)),g=n(r(2536)),v=n(r(7826)),y=r(7927),b=n(r(6066));t.getClientAuthenticationWithDependencies=function(e){const t=new i.InMemoryStorage,r=e.secureStorage||t,n=e.insecureStorage||new m.default,w=new o.default(r,n),x=new u.default(w),_=new v.default(w),E=new p.SessionInfoManager(w),k=new b.default(w,x,_),S=new s.default(w,new c.default(w,new g.default),x,_),A=new h.default([new y.ErrorOidcHandler,new f.AuthCodeRedirectHandler(w,E,x,_,k),new l.FallbackRedirectHandler]);return new a.default(S,A,new d.default(E),E,x)}},4305:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.EVENTS=t.InMemoryStorage=t.ConfigurationError=t.NotImplementedError=t.getClientAuthenticationWithDependencies=t.Session=void 0;var o=r(3598);Object.defineProperty(t,"Session",{enumerable:!0,get:function(){return o.Session}});var a=r(3537);Object.defineProperty(t,"getClientAuthenticationWithDependencies",{enumerable:!0,get:function(){return a.getClientAuthenticationWithDependencies}}),i(r(7814),t);var s=r(835);Object.defineProperty(t,"NotImplementedError",{enumerable:!0,get:function(){return s.NotImplementedError}}),Object.defineProperty(t,"ConfigurationError",{enumerable:!0,get:function(){return s.ConfigurationError}}),Object.defineProperty(t,"InMemoryStorage",{enumerable:!0,get:function(){return s.InMemoryStorage}}),Object.defineProperty(t,"EVENTS",{enumerable:!0,get:function(){return s.EVENTS}})},2056:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(835);class i extends n.AggregateHandler{constructor(e){super(e)}}t.default=i},7826:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5036);t.default=class{constructor(e){this.storageUtility=e}async getClient(e,t){const[r,i]=await Promise.all([this.storageUtility.getForUser(e.sessionId,"clientId",{secure:!1}),this.storageUtility.getForUser(e.sessionId,"clientSecret",{secure:!1})]);if(r)return{clientId:r,clientSecret:i,clientType:"dynamic"};try{const r=await(0,n.registerClient)(e,t),i={clientId:r.clientId};return r.clientSecret&&(i.clientSecret=r.clientSecret),r.idTokenSignedResponseAlg&&(i.idTokenSignedResponseAlg=r.idTokenSignedResponseAlg),await this.storageUtility.setForUser(e.sessionId,i,{secure:!1}),r}catch(e){throw new Error(`Client registration failed: [${e}]`)}}}},4377:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WELL_KNOWN_OPENID_CONFIG=void 0;const n=r(835),i=r(854);t.WELL_KNOWN_OPENID_CONFIG=".well-known/openid-configuration";const o={issuer:{toKey:"issuer",convertToUrl:!0},authorization_endpoint:{toKey:"authorizationEndpoint",convertToUrl:!0},token_endpoint:{toKey:"tokenEndpoint",convertToUrl:!0},userinfo_endpoint:{toKey:"userinfoEndpoint",convertToUrl:!0},jwks_uri:{toKey:"jwksUri",convertToUrl:!0},registration_endpoint:{toKey:"registrationEndpoint",convertToUrl:!0},scopes_supported:{toKey:"scopesSupported"},response_types_supported:{toKey:"responseTypesSupported"},response_modes_supported:{toKey:"responseModesSupported"},grant_types_supported:{toKey:"grantTypesSupported"},acr_values_supported:{toKey:"acrValuesSupported"},subject_types_supported:{toKey:"subjectTypesSupported"},id_token_signing_alg_values_supported:{toKey:"idTokenSigningAlgValuesSupported"},id_token_encryption_alg_values_supported:{toKey:"idTokenEncryptionAlgValuesSupported"},id_token_encryption_enc_values_supported:{toKey:"idTokenEncryptionEncValuesSupported"},userinfo_signing_alg_values_supported:{toKey:"userinfoSigningAlgValuesSupported"},userinfo_encryption_alg_values_supported:{toKey:"userinfoEncryptionAlgValuesSupported"},userinfo_encryption_enc_values_supported:{toKey:"userinfoEncryptionEncValuesSupported"},request_object_signing_alg_values_supported:{toKey:"requestObjectSigningAlgValuesSupported"},request_object_encryption_alg_values_supported:{toKey:"requestObjectEncryptionAlgValuesSupported"},request_object_encryption_enc_values_supported:{toKey:"requestObjectEncryptionEncValuesSupported"},token_endpoint_auth_methods_supported:{toKey:"tokenEndpointAuthMethodsSupported"},token_endpoint_auth_signing_alg_values_supported:{toKey:"tokenEndpointAuthSigningAlgValuesSupported"},display_values_supported:{toKey:"displayValuesSupported"},claim_types_supported:{toKey:"claimTypesSupported"},claims_supported:{toKey:"claimsSupported"},service_documentation:{toKey:"serviceDocumentation"},claims_locales_supported:{toKey:"claimsLocalesSupported"},ui_locales_supported:{toKey:"uiLocalesSupported"},claims_parameter_supported:{toKey:"claimsParameterSupported"},request_parameter_supported:{toKey:"requestParameterSupported"},request_uri_parameter_supported:{toKey:"requestUriParameterSupported"},require_request_uri_registration:{toKey:"requireRequestUriRegistration"},op_policy_uri:{toKey:"opPolicyUri",convertToUrl:!0},op_tos_uri:{toKey:"opTosUri",convertToUrl:!0}};class a{constructor(e){this.storageUtility=e}static getLocalStorageKey(e){return`issuerConfig:${e}`}async fetchConfig(e){let r;const s=new URL(t.WELL_KNOWN_OPENID_CONFIG,e.endsWith("/")?e:`${e}/`).href,c=await(0,i.fetch)(s);try{r=function(e){const t={};return Object.keys(e).forEach((r=>{o[r]&&(t[o[r].toKey]=e[r])})),Array.isArray(t.scopesSupported)||(t.scopesSupported=["openid"]),t}(await c.json())}catch(t){throw new n.ConfigurationError(`[${e.toString()}] has an invalid configuration: ${t.message}`)}return await this.storageUtility.set(a.getLocalStorageKey(e),JSON.stringify(r)),r}}t.default=a},2018:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(835);function i(e){return"string"==typeof e.oidcIssuer}function o(e){return"string"==typeof e.redirectUrl}t.default=class{constructor(e,t,r,n){this.storageUtility=e,this.oidcHandler=t,this.issuerConfigFetcher=r,this.clientRegistrar=n}async canHandle(e){return i(e)&&o(e)}async handle(e){if(!i(e))throw new n.ConfigurationError(`OidcLoginHandler requires an OIDC issuer: missing property 'oidcIssuer' in ${JSON.stringify(e)}`);if(!o(e))throw new n.ConfigurationError(`OidcLoginHandler requires a redirect URL: missing property 'redirectUrl' in ${JSON.stringify(e)}`);const t=await this.issuerConfigFetcher.fetchConfig(e.oidcIssuer),r=await(0,n.handleRegistration)(e,t,this.storageUtility,this.clientRegistrar),a={issuer:t.issuer,dpop:"dpop"===e.tokenType.toLowerCase(),...e,issuerConfiguration:t,client:r};return this.oidcHandler.handle(a)}}},2536:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{redirect(e,t){t&&t.handleRedirect?t.handleRedirect(e):t&&t.redirectByReplacingState?window.history.replaceState({},"",e):window.location.href=e}}},1272:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AuthCodeRedirectHandler=void 0;const n=r(854),i=r(835),o=r(5036);t.AuthCodeRedirectHandler=class{constructor(e,t,r,n,i){this.storageUtility=e,this.sessionInfoManager=t,this.issuerConfigFetcher=r,this.clientRegistrar=n,this.tokerRefresher=i}async canHandle(e){try{const t=new URL(e);return null!==t.searchParams.get("code")&&null!==t.searchParams.get("state")}catch(t){throw new Error(`[${e}] is not a valid URL, and cannot be used as a redirect URL: ${t}`)}}async handle(e,t){if(!await this.canHandle(e))throw new Error(`AuthCodeRedirectHandler cannot handle [${e}]: it is missing one of [code, state].`);const r=new URL(e),a=r.searchParams.get("state"),s=await this.storageUtility.getForUser(a,"sessionId",{errorIfNull:!0}),{issuerConfig:c,codeVerifier:u,redirectUrl:l,dpop:d}=await(0,i.loadOidcContextFromStorage)(s,this.storageUtility,this.issuerConfigFetcher),p=r.searchParams.get("iss");if("string"==typeof p&&p!==c.issuer)throw new Error(`The value of the iss parameter (${p}) does not match the issuer identifier of the authorization server (${c.issuer}). See [rfc9207](https://www.rfc-editor.org/rfc/rfc9207.html#section-2.3-3.1.1)`);if(void 0===u)throw new Error(`The code verifier for session ${s} is missing from storage.`);if(void 0===l)throw new Error(`The redirect URL for session ${s} is missing from storage.`);const f=await this.clientRegistrar.getClient({sessionId:s},c);let h;const m=Date.now();let g;d?(h=await(0,o.getDpopToken)(c,f,{grantType:"authorization_code",code:r.searchParams.get("code"),codeVerifier:u,redirectUrl:l}),window.localStorage.removeItem(`oidc.${a}`)):h=await(0,o.getBearerToken)(r.toString()),void 0!==h.refreshToken&&(g={sessionId:s,refreshToken:h.refreshToken,tokenRefresher:this.tokerRefresher});const v=await(0,i.buildAuthenticatedFetch)(n.fetch,h.accessToken,{dpopKey:h.dpopKey,refreshOptions:g,eventEmitter:t,expiresIn:h.expiresIn});await this.storageUtility.setForUser(s,{webId:h.webId,isLoggedIn:"true"},{secure:!0});const y=await this.sessionInfoManager.get(s);if(!y)throw new Error(`Could not retrieve session: [${s}].`);return Object.assign(y,{fetch:v,expirationDate:"number"==typeof h.expiresIn?m+1e3*h.expiresIn:null})}}},7927:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorOidcHandler=void 0;const n=r(835),i=r(3624);t.ErrorOidcHandler=class{async canHandle(e){try{return new URL(e).searchParams.has("error")}catch(t){throw new Error(`[${e}] is not a valid URL, and cannot be used as a redirect URL: ${t}`)}}async handle(e,t){if(void 0!==t){const r=new URL(e),i=r.searchParams.get("error"),o=r.searchParams.get("error_description");t.emit(n.EVENTS.ERROR,i,o)}return(0,i.getUnauthenticatedSession)()}}},9582:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FallbackRedirectHandler=void 0;const n=r(3624);t.FallbackRedirectHandler=class{async canHandle(e){try{return new URL(e),!0}catch(t){throw new Error(`[${e}] is not a valid URL, and cannot be used as a redirect URL: ${t}`)}}async handle(e){return(0,n.getUnauthenticatedSession)()}}},1590:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(835),i=r(5036);t.default=class{constructor(e,t){this.storageUtility=e,this.redirector=t}async canHandle(e){return!!(e.issuerConfiguration.grantTypesSupported&&e.issuerConfiguration.grantTypesSupported.indexOf("authorization_code")>-1)}async handle(e){var t;const r={authority:e.issuer.toString(),client_id:e.client.clientId,client_secret:e.client.clientSecret,redirect_uri:e.redirectUrl.toString(),post_logout_redirect_uri:e.redirectUrl.toString(),response_type:"code",scope:n.DEFAULT_SCOPES,filterProtocolClaims:!0,loadUserInfo:!1,code_verifier:!0,prompt:null!==(t=e.prompt)&&void 0!==t?t:"consent"},o=new i.OidcClient(r),{redirector:a}=this,s=this.storageUtility;try{const t=await o.createSigninRequest();await Promise.all([s.setForUser(t.state._id,{sessionId:e.sessionId}),s.setForUser(e.sessionId,{codeVerifier:t.state._code_verifier,issuer:e.issuer.toString(),redirectUrl:e.redirectUrl,dpop:e.dpop?"true":"false"})]),a.redirect(t.url.toString(),{handleRedirect:e.handleRedirect})}catch(e){console.error(e)}}}},6066:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(835),i=r(5036);t.default=class{constructor(e,t,r){this.storageUtility=e,this.issuerConfigFetcher=t,this.clientRegistrar=r}async refresh(e,t,r,o){const a=await(0,n.loadOidcContextFromStorage)(e,this.storageUtility,this.issuerConfigFetcher),s=await this.clientRegistrar.getClient({sessionId:e},a.issuerConfig);if(void 0===t)throw new Error(`Session [${e}] has no refresh token to allow it to refresh its access token.`);if(a.dpop&&void 0===r)throw new Error(`For session [${e}], the key bound to the DPoP access token must be provided to refresh said access token.`);const c=await(0,i.refresh)(t,a.issuerConfig,s,r);return void 0!==c.refreshToken&&(null==o||o.emit(n.EVENTS.NEW_REFRESH_TOKEN,c.refreshToken),await this.storageUtility.setForUser(e,{refreshToken:c.refreshToken})),c}}},2186:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(e){this.sessionInfoManager=e}async canHandle(){return!0}async handle(e){await this.sessionInfoManager.clear(e)}}},3624:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionInfoManager=t.clear=t.getUnauthenticatedSession=void 0;const n=r(835),i=r(3438),o=r(5036),a=r(854);async function s(e,t){await Promise.all([t.deleteAllUserData(e,{secure:!1}),t.deleteAllUserData(e,{secure:!0}),t.delete("clientKey",{secure:!1})]),await(0,o.clearOidcPersistentStorage)()}t.getUnauthenticatedSession=function(){return{isLoggedIn:!1,sessionId:(0,i.v4)(),fetch:a.fetch}},t.clear=s,t.SessionInfoManager=class{constructor(e){this.storageUtility=e}update(e,t){throw new Error("Not Implemented")}async get(e){var t;const r=await this.storageUtility.getForUser(e,"isLoggedIn",{secure:!0}),i=await this.storageUtility.getForUser(e,"webId",{secure:!0}),o=await this.storageUtility.getForUser(e,"clientId",{secure:!1}),a=await this.storageUtility.getForUser(e,"clientSecret",{secure:!1}),s=await this.storageUtility.getForUser(e,"redirectUrl",{secure:!1}),c=await this.storageUtility.getForUser(e,"refreshToken",{secure:!0}),u=await this.storageUtility.getForUser(e,"issuer",{secure:!1}),l=null!==(t=await this.storageUtility.getForUser(e,"tokenType",{secure:!1}))&&void 0!==t?t:"DPoP";if(!(0,n.isSupportedTokenType)(l))throw new Error(`Tokens of type [${l}] are not supported.`);if(void 0!==o||void 0!==r||void 0!==i||void 0!==c)return{sessionId:e,webId:i,isLoggedIn:"true"===r,redirectUrl:s,refreshToken:c,issuer:u,clientAppId:o,clientAppSecret:a,tokenType:l}}async getAll(){throw new Error("Not implemented")}async clear(e){return s(e,this.storageUtility)}async register(e){throw new Error("Not implemented")}async getRegisteredSessionIdAll(){throw new Error("Not implemented")}async clearAll(){throw new Error("Not implemented")}}},5394:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{get storage(){return window.localStorage}async get(e){return this.storage.getItem(e)||void 0}async set(e,t){this.storage.setItem(e,t)}async delete(e){this.storage.removeItem(e)}}},437:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(835);class i extends n.StorageUtility{constructor(e,t){super(e,t)}}t.default=i},3438:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"v1",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"v5",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return c.default}});var n=p(r(206)),i=p(r(6672)),o=p(r(1129)),a=p(r(6561)),s=p(r(6163)),c=p(r(2556)),u=p(r(7231)),l=p(r(3490)),d=p(r(8027));function p(e){return e&&e.__esModule?e:{default:e}}},1246:(e,t)=>{"use strict";function r(e){return 14+(e+64>>>9<<4)+1}function n(e,t){const r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function i(e,t,r,i,o,a){return n((s=n(n(t,e),n(i,a)))<<(c=o)|s>>>32-c,r);var s,c}function o(e,t,r,n,o,a,s){return i(t&r|~t&n,e,t,o,a,s)}function a(e,t,r,n,o,a,s){return i(t&n|r&~n,e,t,o,a,s)}function s(e,t,r,n,o,a,s){return i(t^r^n,e,t,o,a,s)}function c(e,t,r,n,o,a,s){return i(r^(t|~n),e,t,o,a,s)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function(e){const t=[],r=32*e.length,n="0123456789abcdef";for(let i=0;i<r;i+=8){const r=e[i>>5]>>>i%32&255,o=parseInt(n.charAt(r>>>4&15)+n.charAt(15&r),16);t.push(o)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[r(t)-1]=t;let i=1732584193,u=-271733879,l=-1732584194,d=271733878;for(let t=0;t<e.length;t+=16){const r=i,p=u,f=l,h=d;i=o(i,u,l,d,e[t],7,-680876936),d=o(d,i,u,l,e[t+1],12,-389564586),l=o(l,d,i,u,e[t+2],17,606105819),u=o(u,l,d,i,e[t+3],22,-1044525330),i=o(i,u,l,d,e[t+4],7,-176418897),d=o(d,i,u,l,e[t+5],12,1200080426),l=o(l,d,i,u,e[t+6],17,-1473231341),u=o(u,l,d,i,e[t+7],22,-45705983),i=o(i,u,l,d,e[t+8],7,1770035416),d=o(d,i,u,l,e[t+9],12,-1958414417),l=o(l,d,i,u,e[t+10],17,-42063),u=o(u,l,d,i,e[t+11],22,-1990404162),i=o(i,u,l,d,e[t+12],7,1804603682),d=o(d,i,u,l,e[t+13],12,-40341101),l=o(l,d,i,u,e[t+14],17,-1502002290),u=o(u,l,d,i,e[t+15],22,1236535329),i=a(i,u,l,d,e[t+1],5,-165796510),d=a(d,i,u,l,e[t+6],9,-1069501632),l=a(l,d,i,u,e[t+11],14,643717713),u=a(u,l,d,i,e[t],20,-373897302),i=a(i,u,l,d,e[t+5],5,-701558691),d=a(d,i,u,l,e[t+10],9,38016083),l=a(l,d,i,u,e[t+15],14,-660478335),u=a(u,l,d,i,e[t+4],20,-405537848),i=a(i,u,l,d,e[t+9],5,568446438),d=a(d,i,u,l,e[t+14],9,-1019803690),l=a(l,d,i,u,e[t+3],14,-187363961),u=a(u,l,d,i,e[t+8],20,1163531501),i=a(i,u,l,d,e[t+13],5,-1444681467),d=a(d,i,u,l,e[t+2],9,-51403784),l=a(l,d,i,u,e[t+7],14,1735328473),u=a(u,l,d,i,e[t+12],20,-1926607734),i=s(i,u,l,d,e[t+5],4,-378558),d=s(d,i,u,l,e[t+8],11,-2022574463),l=s(l,d,i,u,e[t+11],16,1839030562),u=s(u,l,d,i,e[t+14],23,-35309556),i=s(i,u,l,d,e[t+1],4,-1530992060),d=s(d,i,u,l,e[t+4],11,1272893353),l=s(l,d,i,u,e[t+7],16,-155497632),u=s(u,l,d,i,e[t+10],23,-1094730640),i=s(i,u,l,d,e[t+13],4,681279174),d=s(d,i,u,l,e[t],11,-358537222),l=s(l,d,i,u,e[t+3],16,-722521979),u=s(u,l,d,i,e[t+6],23,76029189),i=s(i,u,l,d,e[t+9],4,-640364487),d=s(d,i,u,l,e[t+12],11,-421815835),l=s(l,d,i,u,e[t+15],16,530742520),u=s(u,l,d,i,e[t+2],23,-995338651),i=c(i,u,l,d,e[t],6,-198630844),d=c(d,i,u,l,e[t+7],10,1126891415),l=c(l,d,i,u,e[t+14],15,-1416354905),u=c(u,l,d,i,e[t+5],21,-57434055),i=c(i,u,l,d,e[t+12],6,1700485571),d=c(d,i,u,l,e[t+3],10,-1894986606),l=c(l,d,i,u,e[t+10],15,-1051523),u=c(u,l,d,i,e[t+1],21,-2054922799),i=c(i,u,l,d,e[t+8],6,1873313359),d=c(d,i,u,l,e[t+15],10,-30611744),l=c(l,d,i,u,e[t+6],15,-1560198380),u=c(u,l,d,i,e[t+13],21,1309151649),i=c(i,u,l,d,e[t+4],6,-145523070),d=c(d,i,u,l,e[t+11],10,-1120210379),l=c(l,d,i,u,e[t+2],15,718787259),u=c(u,l,d,i,e[t+9],21,-343485551),i=n(i,r),u=n(u,p),l=n(l,f),d=n(d,h)}return[i,u,l,d]}(function(e){if(0===e.length)return[];const t=8*e.length,n=new Uint32Array(r(t));for(let r=0;r<t;r+=8)n[r>>5]|=(255&e[r/8])<<r%32;return n}(e),8*e.length))}},2770:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};t.default=r},6163:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default="00000000-0000-0000-0000-000000000000"},8027:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(7231))&&n.__esModule?n:{default:n};t.default=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");let t;const r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r}},9094:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},1617:(e,t)=>{"use strict";let r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(n)};const n=new Uint8Array(16)},9342:(e,t)=>{"use strict";function r(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function n(e,t){return e<<t|e>>>32-t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){const t=[1518500249,1859775393,2400959708,3395469782],i=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const o=e.length/4+2,a=Math.ceil(o/16),s=new Array(a);for(let t=0;t<a;++t){const r=new Uint32Array(16);for(let n=0;n<16;++n)r[n]=e[64*t+4*n]<<24|e[64*t+4*n+1]<<16|e[64*t+4*n+2]<<8|e[64*t+4*n+3];s[t]=r}s[a-1][14]=8*(e.length-1)/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<a;++e){const o=new Uint32Array(80);for(let t=0;t<16;++t)o[t]=s[e][t];for(let e=16;e<80;++e)o[e]=n(o[e-3]^o[e-8]^o[e-14]^o[e-16],1);let a=i[0],c=i[1],u=i[2],l=i[3],d=i[4];for(let e=0;e<80;++e){const i=Math.floor(e/20),s=n(a,5)+r(i,c,u,l)+d+t[i]+o[e]>>>0;d=l,l=u,u=n(c,30)>>>0,c=a,a=s}i[0]=i[0]+a>>>0,i[1]=i[1]+c>>>0,i[2]=i[2]+u>>>0,i[3]=i[3]+l>>>0,i[4]=i[4]+d>>>0}return[i[0]>>24&255,i[0]>>16&255,i[0]>>8&255,255&i[0],i[1]>>24&255,i[1]>>16&255,i[1]>>8&255,255&i[1],i[2]>>24&255,i[2]>>16&255,i[2]>>8&255,255&i[2],i[3]>>24&255,i[3]>>16&255,i[3]>>8&255,255&i[3],i[4]>>24&255,i[4]>>16&255,i[4]>>8&255,255&i[4]]}},3490:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.unsafeStringify=a;var n,i=(n=r(7231))&&n.__esModule?n:{default:n};const o=[];for(let e=0;e<256;++e)o.push((e+256).toString(16).slice(1));function a(e,t=0){return(o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]).toLowerCase()}t.default=function(e,t=0){const r=a(e,t);if(!(0,i.default)(r))throw TypeError("Stringified UUID is invalid");return r}},206:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(1617))&&n.__esModule?n:{default:n},o=r(3490);let a,s,c=0,u=0;t.default=function(e,t,r){let n=t&&r||0;const l=t||new Array(16);let d=(e=e||{}).node||a,p=void 0!==e.clockseq?e.clockseq:s;if(null==d||null==p){const t=e.random||(e.rng||i.default)();null==d&&(d=a=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==p&&(p=s=16383&(t[6]<<8|t[7]))}let f=void 0!==e.msecs?e.msecs:Date.now(),h=void 0!==e.nsecs?e.nsecs:u+1;const m=f-c+(h-u)/1e4;if(m<0&&void 0===e.clockseq&&(p=p+1&16383),(m<0||f>c)&&void 0===e.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");c=f,u=h,s=p,f+=122192928e5;const g=(1e4*(268435455&f)+h)%4294967296;l[n++]=g>>>24&255,l[n++]=g>>>16&255,l[n++]=g>>>8&255,l[n++]=255&g;const v=f/4294967296*1e4&268435455;l[n++]=v>>>8&255,l[n++]=255&v,l[n++]=v>>>24&15|16,l[n++]=v>>>16&255,l[n++]=p>>>8|128,l[n++]=255&p;for(let e=0;e<6;++e)l[n+e]=d[e];return t||(0,o.unsafeStringify)(l)}},6672:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o(r(418)),i=o(r(1246));function o(e){return e&&e.__esModule?e:{default:e}}var a=(0,n.default)("v3",48,i.default);t.default=a},418:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0,t.default=function(e,t,r){function n(e,n,a,s){var c;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=(0,o.default)(n)),16!==(null===(c=n)||void 0===c?void 0:c.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+e.length);if(u.set(n),u.set(e,n.length),u=r(u),u[6]=15&u[6]|t,u[8]=63&u[8]|128,a){s=s||0;for(let e=0;e<16;++e)a[s+e]=u[e];return a}return(0,i.unsafeStringify)(u)}try{n.name=e}catch(e){}return n.DNS=a,n.URL=s,n};var n,i=r(3490),o=(n=r(8027))&&n.__esModule?n:{default:n};const a="6ba7b810-9dad-11d1-80b4-00c04fd430c8";t.DNS=a;const s="6ba7b811-9dad-11d1-80b4-00c04fd430c8";t.URL=s},1129:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(r(2770)),i=a(r(1617)),o=r(3490);function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t,r){if(n.default.randomUUID&&!t&&!e)return n.default.randomUUID();const a=(e=e||{}).random||(e.rng||i.default)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=a[e];return t}return(0,o.unsafeStringify)(a)}},6561:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o(r(418)),i=o(r(9342));function o(e){return e&&e.__esModule?e:{default:e}}var a=(0,n.default)("v5",80,i.default);t.default=a},7231:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(9094))&&n.__esModule?n:{default:n};t.default=function(e){return"string"==typeof e&&i.default.test(e)}},2556:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(7231))&&n.__esModule?n:{default:n};t.default=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}},835:(e,t,r)=>{"use strict";var n=r(7187),i=r(854),o=r(1548),a=r(5334);const s=["ES256","RS256"],c={ERROR:"error",LOGIN:"login",LOGOUT:"logout",NEW_REFRESH_TOKEN:"newRefreshToken",SESSION_EXPIRED:"sessionExpired",SESSION_EXTENDED:"sessionExtended",SESSION_RESTORED:"sessionRestore",TIMEOUT_SET:"timeoutSet"},u=["openid","offline_access","webid"].join(" ");async function l(e,t){const r=await i.fetch(e);if(200!==r.status)throw new Error(`Could not fetch JWKS for [${t}] at [${e}]: ${r.status} ${r.statusText}`);let n;try{n=(await r.json()).keys[0]}catch(r){throw new Error(`Malformed JWKS for [${t}] at [${e}]: ${r.message}`)}return n}function d(e){try{return new URL(e),!0}catch(e){return!1}}class p{constructor(e,t){this.secureStorage=e,this.insecureStorage=t}getKey(e){return`solidClientAuthenticationUser:${e}`}async getUserData(e,t){const r=await(t?this.secureStorage:this.insecureStorage).get(this.getKey(e));if(void 0===r)return{};try{return JSON.parse(r)}catch(n){throw new Error(`Data for user [${e}] in [${t?"secure":"unsecure"}] storage is corrupted - expected valid JSON, but got: ${r}`)}}async setUserData(e,t,r){await(r?this.secureStorage:this.insecureStorage).set(this.getKey(e),JSON.stringify(t))}async get(e,t){const r=await((null==t?void 0:t.secure)?this.secureStorage:this.insecureStorage).get(e);if(void 0===r&&(null==t?void 0:t.errorIfNull))throw new Error(`[${e}] is not stored`);return r}async set(e,t,r){return((null==r?void 0:r.secure)?this.secureStorage:this.insecureStorage).set(e,t)}async delete(e,t){return((null==t?void 0:t.secure)?this.secureStorage:this.insecureStorage).delete(e)}async getForUser(e,t,r){const n=await this.getUserData(e,null==r?void 0:r.secure);let i;if(n&&n[t]||(i=void 0),i=n[t],void 0===i&&(null==r?void 0:r.errorIfNull))throw new Error(`Field [${t}] for user [${e}] is not stored`);return i||void 0}async setForUser(e,t,r){let n;try{n=await this.getUserData(e,null==r?void 0:r.secure)}catch(e){n={}}await this.setUserData(e,{...n,...t},null==r?void 0:r.secure)}async deleteForUser(e,t,r){const n=await this.getUserData(e,null==r?void 0:r.secure);delete n[t],await this.setUserData(e,n,null==r?void 0:r.secure)}async deleteAllUserData(e,t){await((null==t?void 0:t.secure)?this.secureStorage:this.insecureStorage).delete(this.getKey(e))}}class f extends Error{constructor(e){super(e)}}class h extends Error{constructor(e){super(`[${e}] is not implemented`)}}class m extends Error{constructor(e){super(`Invalid response from OIDC provider: missing fields ${e}`),this.missingFields=e}}class g extends Error{constructor(e,t,r){super(e),this.error=t,this.errorDescription=r}}function v(e){const t=new URL(e);return new URL(t.pathname,t.origin).toString()}async function y(e,t,r){return new o.SignJWT({htu:v(e),htm:t.toUpperCase(),jti:a.v4()}).setProtectedHeader({alg:s[0],jwk:r.publicKey,typ:"dpop+jwt"}).setIssuedAt().sign(r.privateKey,{})}async function b(e,t,r,n,o){return e(r,await async function(e,t,r,n){if(void 0!==r)return async function(e,t,r,n){var o;const a=new i.Headers(null==n?void 0:n.headers);return a.set("Authorization",`DPoP ${t}`),a.set("DPoP",await y(e,null!==(o=null==n?void 0:n.method)&&void 0!==o?o:"get",r)),{...n,headers:a}}(e,t,r,n);const o=new i.Headers(null==n?void 0:n.headers);return o.set("Authorization",`Bearer ${t}`),{...n,headers:o}}(r.toString(),t,o,n))}const w=e=>void 0!==e?e-5>0?e-5:e:600,x="getResponse",_={get:async(e,t)=>x,set:async(e,t)=>{},delete:async e=>{},getForUser:async(e,t,r)=>x,setForUser:async(e,t,r)=>{},deleteForUser:async(e,t,r)=>{},deleteAllUserData:async(e,t)=>{}},E=e=>{const t=e;return{get:async e=>{if(void 0!==t[e])return"string"==typeof t[e]?t[e]:JSON.stringify(t[e])},set:async(e,r)=>{t[e]=r},delete:async e=>{delete t[e]}}};t.AggregateHandler=class{constructor(e){this.handleables=e}async getProperHandler(e){const t=await Promise.all(this.handleables.map((t=>t.canHandle(...e))));for(let e=0;e<t.length;e+=1)if(t[e])return this.handleables[e];return null}async canHandle(...e){return null!==await this.getProperHandler(e)}async handle(...e){const t=await this.getProperHandler(e);if(t)return t.handle(...e);throw new Error(`[${this.constructor.name}] cannot find a suitable handler for: ${e.map((e=>{try{return JSON.stringify(e)}catch(t){return e.toString()}})).join(", ")}`)}},t.ConfigurationError=f,t.DEFAULT_SCOPES=u,t.EVENTS=c,t.InMemoryStorage=class{constructor(){this.map={}}async get(e){return this.map[e]||void 0}async set(e,t){this.map[e]=t}async delete(e){delete this.map[e]}},t.InvalidResponseError=m,t.NotImplementedError=h,t.OidcProviderError=g,t.PREFERRED_SIGNING_ALG=s,t.REFRESH_BEFORE_EXPIRATION_SECONDS=5,t.SOLID_CLIENT_AUTHN_KEY_PREFIX="solidClientAuthn:",t.StorageUtility=p,t.StorageUtilityGetResponse=x,t.StorageUtilityMock=_,t.USER_SESSION_PREFIX="solidClientAuthenticationUser",t.buildAuthenticatedFetch=async function(e,t,r){var n;let i,o=t;const a=null==r?void 0:r.refreshOptions;if(void 0!==a){const e=async()=>{var t,n,s,u;try{const{accessToken:n,refreshToken:s,expiresIn:u}=await async function(e,t,r){var n;const i=await e.tokenRefresher.refresh(e.sessionId,e.refreshToken,t);return null==r||r.emit(c.SESSION_EXTENDED,null!==(n=i.expiresIn)&&void 0!==n?n:600),"string"==typeof i.refreshToken&&(null==r||r.emit(c.NEW_REFRESH_TOKEN,i.refreshToken)),{accessToken:i.accessToken,refreshToken:i.refreshToken,expiresIn:i.expiresIn}}(a,r.dpopKey,r.eventEmitter);o=n,void 0!==s&&(a.refreshToken=s),clearTimeout(i),i=setTimeout(e,1e3*w(u)),null===(t=r.eventEmitter)||void 0===t||t.emit(c.TIMEOUT_SET,i)}catch(e){e instanceof g&&(null===(n=null==r?void 0:r.eventEmitter)||void 0===n||n.emit(c.ERROR,e.error,e.errorDescription),null===(s=null==r?void 0:r.eventEmitter)||void 0===s||s.emit(c.SESSION_EXPIRED)),e instanceof m&&e.missingFields.includes("access_token")&&(null===(u=null==r?void 0:r.eventEmitter)||void 0===u||u.emit(c.SESSION_EXPIRED))}};i=setTimeout(e,1e3*w(r.expiresIn)),null===(n=r.eventEmitter)||void 0===n||n.emit(c.TIMEOUT_SET,i)}else if(void 0!==r&&void 0!==r.eventEmitter){const e=setTimeout((()=>{r.eventEmitter.emit(c.SESSION_EXPIRED)}),1e3*w(r.expiresIn));r.eventEmitter.emit(c.TIMEOUT_SET,e)}return async(t,n)=>{let i=await b(e,o,t,n,null==r?void 0:r.dpopKey);const a=!i.ok&&(s=i.status,![401,403].includes(s));var s;return i.ok||a||i.url!==t&&void 0!==(null==r?void 0:r.dpopKey)&&(i=await b(e,o,i.url,n,r.dpopKey)),i}},t.buildProxyHandler=(e,t)=>({get(r,i,o){if(!Object.getOwnPropertyNames(n.EventEmitter).includes(i)&&Object.getOwnPropertyNames(e).includes(i))throw new Error(`${t}: [${i}] is not supported`);return Reflect.get(r,i,o)}}),t.createDpopHeader=y,t.determineSigningAlg=function(e,t){var r;return null!==(r=t.find((t=>e.includes(t))))&&void 0!==r?r:null},t.fetchJwks=l,t.generateDpopKeyPair=async function(){const{privateKey:e,publicKey:t}=await o.generateKeyPair(s[0]),r={privateKey:e,publicKey:await o.exportJWK(t)};return[r.publicKey.alg]=s,r},t.getSessionIdFromOauthState=async function(e,t){return e.getForUser(t,"sessionId")},t.getWebidFromTokenPayload=async function(e,t,r,n){const i=await l(t,r);let a;try{const{payload:t}=await o.jwtVerify(e,await o.importJWK(i),{issuer:r,audience:n});a=t}catch(e){throw new Error(`Token verification failed: ${e.stack}`)}if("string"==typeof a.webid)return a.webid;if("string"!=typeof a.sub)throw new Error(`The token ${JSON.stringify(a)} is invalid: it has no 'webid' claim and no 'sub' claim.`);try{return new URL(a.sub),a.sub}catch(e){throw new Error(`The token has no 'webid' claim, and its 'sub' claim of [${a.sub}] is invalid as a URL - error [${e}].`)}},t.handleRegistration=async function(e,t,r,n){const i=function(e,t){return void 0===e.clientId||d(e.clientId)?t.scopesSupported.includes("webid")&&void 0!==e.clientId&&d(e.clientId)?"solid-oidc":"dynamic":"static"}(e,t);return"dynamic"===i?n.getClient({sessionId:e.sessionId,clientName:e.clientName,redirectUrl:e.redirectUrl},t):(await r.setForUser(e.sessionId,{clientId:e.clientId}),e.clientSecret&&await r.setForUser(e.sessionId,{clientSecret:e.clientSecret}),e.clientName&&await r.setForUser(e.sessionId,{clientName:e.clientName}),{clientId:e.clientId,clientSecret:e.clientSecret,clientName:e.clientName,clientType:i})},t.isSupportedTokenType=function(e){return"string"==typeof e&&["DPoP","Bearer"].includes(e)},t.isValidRedirectUrl=function(e){try{return""===new URL(e).hash}catch(e){return!1}},t.loadOidcContextFromStorage=async function(e,t,r){try{const[n,i,o,a]=await Promise.all([t.getForUser(e,"issuer",{errorIfNull:!0}),t.getForUser(e,"codeVerifier"),t.getForUser(e,"redirectUrl"),t.getForUser(e,"dpop",{errorIfNull:!0})]);return await t.deleteForUser(e,"codeVerifier"),{codeVerifier:i,redirectUrl:o,issuerConfig:await r.fetchConfig(n),dpop:"true"===a}}catch(t){throw new Error(`Failed to retrieve OIDC context from storage associated with session [${e}]: ${t}`)}},t.mockStorage=E,t.mockStorageUtility=(e,t=!1)=>t?new p(E(e),E({})):new p(E({}),E(e)),t.saveSessionInfoToStorage=async function(e,t,r,n,i,a,s){void 0!==i&&await e.setForUser(t,{refreshToken:i},{secure:a}),void 0!==r&&await e.setForUser(t,{webId:r},{secure:a}),void 0!==n&&await e.setForUser(t,{isLoggedIn:n},{secure:a}),void 0!==s&&await e.setForUser(t,{publicKey:JSON.stringify(s.publicKey),privateKey:JSON.stringify(await o.exportJWK(s.privateKey))},{secure:a})}},5334:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"v1",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"v5",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return c.default}});var n=p(r(6024)),i=p(r(3167)),o=p(r(134)),a=p(r(689)),s=p(r(4277)),c=p(r(3136)),u=p(r(5377)),l=p(r(9028)),d=p(r(3480));function p(e){return e&&e.__esModule?e:{default:e}}},1814:(e,t)=>{"use strict";function r(e){return 14+(e+64>>>9<<4)+1}function n(e,t){const r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function i(e,t,r,i,o,a){return n((s=n(n(t,e),n(i,a)))<<(c=o)|s>>>32-c,r);var s,c}function o(e,t,r,n,o,a,s){return i(t&r|~t&n,e,t,o,a,s)}function a(e,t,r,n,o,a,s){return i(t&n|r&~n,e,t,o,a,s)}function s(e,t,r,n,o,a,s){return i(t^r^n,e,t,o,a,s)}function c(e,t,r,n,o,a,s){return i(r^(t|~n),e,t,o,a,s)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function(e){const t=[],r=32*e.length,n="0123456789abcdef";for(let i=0;i<r;i+=8){const r=e[i>>5]>>>i%32&255,o=parseInt(n.charAt(r>>>4&15)+n.charAt(15&r),16);t.push(o)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[r(t)-1]=t;let i=1732584193,u=-271733879,l=-1732584194,d=271733878;for(let t=0;t<e.length;t+=16){const r=i,p=u,f=l,h=d;i=o(i,u,l,d,e[t],7,-680876936),d=o(d,i,u,l,e[t+1],12,-389564586),l=o(l,d,i,u,e[t+2],17,606105819),u=o(u,l,d,i,e[t+3],22,-1044525330),i=o(i,u,l,d,e[t+4],7,-176418897),d=o(d,i,u,l,e[t+5],12,1200080426),l=o(l,d,i,u,e[t+6],17,-1473231341),u=o(u,l,d,i,e[t+7],22,-45705983),i=o(i,u,l,d,e[t+8],7,1770035416),d=o(d,i,u,l,e[t+9],12,-1958414417),l=o(l,d,i,u,e[t+10],17,-42063),u=o(u,l,d,i,e[t+11],22,-1990404162),i=o(i,u,l,d,e[t+12],7,1804603682),d=o(d,i,u,l,e[t+13],12,-40341101),l=o(l,d,i,u,e[t+14],17,-1502002290),u=o(u,l,d,i,e[t+15],22,1236535329),i=a(i,u,l,d,e[t+1],5,-165796510),d=a(d,i,u,l,e[t+6],9,-1069501632),l=a(l,d,i,u,e[t+11],14,643717713),u=a(u,l,d,i,e[t],20,-373897302),i=a(i,u,l,d,e[t+5],5,-701558691),d=a(d,i,u,l,e[t+10],9,38016083),l=a(l,d,i,u,e[t+15],14,-660478335),u=a(u,l,d,i,e[t+4],20,-405537848),i=a(i,u,l,d,e[t+9],5,568446438),d=a(d,i,u,l,e[t+14],9,-1019803690),l=a(l,d,i,u,e[t+3],14,-187363961),u=a(u,l,d,i,e[t+8],20,1163531501),i=a(i,u,l,d,e[t+13],5,-1444681467),d=a(d,i,u,l,e[t+2],9,-51403784),l=a(l,d,i,u,e[t+7],14,1735328473),u=a(u,l,d,i,e[t+12],20,-1926607734),i=s(i,u,l,d,e[t+5],4,-378558),d=s(d,i,u,l,e[t+8],11,-2022574463),l=s(l,d,i,u,e[t+11],16,1839030562),u=s(u,l,d,i,e[t+14],23,-35309556),i=s(i,u,l,d,e[t+1],4,-1530992060),d=s(d,i,u,l,e[t+4],11,1272893353),l=s(l,d,i,u,e[t+7],16,-155497632),u=s(u,l,d,i,e[t+10],23,-1094730640),i=s(i,u,l,d,e[t+13],4,681279174),d=s(d,i,u,l,e[t],11,-358537222),l=s(l,d,i,u,e[t+3],16,-722521979),u=s(u,l,d,i,e[t+6],23,76029189),i=s(i,u,l,d,e[t+9],4,-640364487),d=s(d,i,u,l,e[t+12],11,-421815835),l=s(l,d,i,u,e[t+15],16,530742520),u=s(u,l,d,i,e[t+2],23,-995338651),i=c(i,u,l,d,e[t],6,-198630844),d=c(d,i,u,l,e[t+7],10,1126891415),l=c(l,d,i,u,e[t+14],15,-1416354905),u=c(u,l,d,i,e[t+5],21,-57434055),i=c(i,u,l,d,e[t+12],6,1700485571),d=c(d,i,u,l,e[t+3],10,-1894986606),l=c(l,d,i,u,e[t+10],15,-1051523),u=c(u,l,d,i,e[t+1],21,-2054922799),i=c(i,u,l,d,e[t+8],6,1873313359),d=c(d,i,u,l,e[t+15],10,-30611744),l=c(l,d,i,u,e[t+6],15,-1560198380),u=c(u,l,d,i,e[t+13],21,1309151649),i=c(i,u,l,d,e[t+4],6,-145523070),d=c(d,i,u,l,e[t+11],10,-1120210379),l=c(l,d,i,u,e[t+2],15,718787259),u=c(u,l,d,i,e[t+9],21,-343485551),i=n(i,r),u=n(u,p),l=n(l,f),d=n(d,h)}return[i,u,l,d]}(function(e){if(0===e.length)return[];const t=8*e.length,n=new Uint32Array(r(t));for(let r=0;r<t;r+=8)n[r>>5]|=(255&e[r/8])<<r%32;return n}(e),8*e.length))}},178:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};t.default=r},4277:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default="00000000-0000-0000-0000-000000000000"},3480:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(5377))&&n.__esModule?n:{default:n};t.default=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");let t;const r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r}},8399:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},7353:(e,t)=>{"use strict";let r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(n)};const n=new Uint8Array(16)},4399:(e,t)=>{"use strict";function r(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function n(e,t){return e<<t|e>>>32-t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){const t=[1518500249,1859775393,2400959708,3395469782],i=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const o=e.length/4+2,a=Math.ceil(o/16),s=new Array(a);for(let t=0;t<a;++t){const r=new Uint32Array(16);for(let n=0;n<16;++n)r[n]=e[64*t+4*n]<<24|e[64*t+4*n+1]<<16|e[64*t+4*n+2]<<8|e[64*t+4*n+3];s[t]=r}s[a-1][14]=8*(e.length-1)/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<a;++e){const o=new Uint32Array(80);for(let t=0;t<16;++t)o[t]=s[e][t];for(let e=16;e<80;++e)o[e]=n(o[e-3]^o[e-8]^o[e-14]^o[e-16],1);let a=i[0],c=i[1],u=i[2],l=i[3],d=i[4];for(let e=0;e<80;++e){const i=Math.floor(e/20),s=n(a,5)+r(i,c,u,l)+d+t[i]+o[e]>>>0;d=l,l=u,u=n(c,30)>>>0,c=a,a=s}i[0]=i[0]+a>>>0,i[1]=i[1]+c>>>0,i[2]=i[2]+u>>>0,i[3]=i[3]+l>>>0,i[4]=i[4]+d>>>0}return[i[0]>>24&255,i[0]>>16&255,i[0]>>8&255,255&i[0],i[1]>>24&255,i[1]>>16&255,i[1]>>8&255,255&i[1],i[2]>>24&255,i[2]>>16&255,i[2]>>8&255,255&i[2],i[3]>>24&255,i[3]>>16&255,i[3]>>8&255,255&i[3],i[4]>>24&255,i[4]>>16&255,i[4]>>8&255,255&i[4]]}},9028:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.unsafeStringify=a;var n,i=(n=r(5377))&&n.__esModule?n:{default:n};const o=[];for(let e=0;e<256;++e)o.push((e+256).toString(16).slice(1));function a(e,t=0){return(o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]).toLowerCase()}t.default=function(e,t=0){const r=a(e,t);if(!(0,i.default)(r))throw TypeError("Stringified UUID is invalid");return r}},6024:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(7353))&&n.__esModule?n:{default:n},o=r(9028);let a,s,c=0,u=0;t.default=function(e,t,r){let n=t&&r||0;const l=t||new Array(16);let d=(e=e||{}).node||a,p=void 0!==e.clockseq?e.clockseq:s;if(null==d||null==p){const t=e.random||(e.rng||i.default)();null==d&&(d=a=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==p&&(p=s=16383&(t[6]<<8|t[7]))}let f=void 0!==e.msecs?e.msecs:Date.now(),h=void 0!==e.nsecs?e.nsecs:u+1;const m=f-c+(h-u)/1e4;if(m<0&&void 0===e.clockseq&&(p=p+1&16383),(m<0||f>c)&&void 0===e.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");c=f,u=h,s=p,f+=122192928e5;const g=(1e4*(268435455&f)+h)%4294967296;l[n++]=g>>>24&255,l[n++]=g>>>16&255,l[n++]=g>>>8&255,l[n++]=255&g;const v=f/4294967296*1e4&268435455;l[n++]=v>>>8&255,l[n++]=255&v,l[n++]=v>>>24&15|16,l[n++]=v>>>16&255,l[n++]=p>>>8|128,l[n++]=255&p;for(let e=0;e<6;++e)l[n+e]=d[e];return t||(0,o.unsafeStringify)(l)}},3167:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o(r(7670)),i=o(r(1814));function o(e){return e&&e.__esModule?e:{default:e}}var a=(0,n.default)("v3",48,i.default);t.default=a},7670:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0,t.default=function(e,t,r){function n(e,n,a,s){var c;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=(0,o.default)(n)),16!==(null===(c=n)||void 0===c?void 0:c.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+e.length);if(u.set(n),u.set(e,n.length),u=r(u),u[6]=15&u[6]|t,u[8]=63&u[8]|128,a){s=s||0;for(let e=0;e<16;++e)a[s+e]=u[e];return a}return(0,i.unsafeStringify)(u)}try{n.name=e}catch(e){}return n.DNS=a,n.URL=s,n};var n,i=r(9028),o=(n=r(3480))&&n.__esModule?n:{default:n};const a="6ba7b810-9dad-11d1-80b4-00c04fd430c8";t.DNS=a;const s="6ba7b811-9dad-11d1-80b4-00c04fd430c8";t.URL=s},134:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(r(178)),i=a(r(7353)),o=r(9028);function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t,r){if(n.default.randomUUID&&!t&&!e)return n.default.randomUUID();const a=(e=e||{}).random||(e.rng||i.default)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=a[e];return t}return(0,o.unsafeStringify)(a)}},689:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o(r(7670)),i=o(r(4399));function o(e){return e&&e.__esModule?e:{default:e}}var a=(0,n.default)("v5",80,i.default);t.default=a},5377:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(8399))&&n.__esModule?n:{default:n};t.default=function(e){return"string"==typeof e&&i.default.test(e)}},3136:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(5377))&&n.__esModule?n:{default:n};t.default=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}},854:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=globalThis.fetch;const{fetch:n,Response:i,Request:o,Headers:a}=globalThis;t.Headers=a,t.Request=o,t.Response=i,t.default=r,t.fetch=n},9082:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCurve=t.getHash=void 0;const n=r(9569),i=r(8089),o=r(6551);function a(e){return{hash:e,hmac:(t,...r)=>(0,n.hmac)(e,t,(0,i.concatBytes)(...r)),randomBytes:i.randomBytes}}t.getHash=a,t.createCurve=function(e,t){const r=t=>(0,o.weierstrass)({...e,...a(t)});return Object.freeze({...r(t),create:r})}},1525:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateBasic=t.wNAF=void 0;const n=r(4632),i=r(219),o=BigInt(0),a=BigInt(1);t.wNAF=function(e,t){const r=(e,t)=>{const r=t.negate();return e?r:t},n=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:r,unsafeLadder(t,r){let n=e.ZERO,i=t;for(;r>o;)r&a&&(n=n.add(i)),i=i.double(),r>>=a;return n},precomputeWindow(e,t){const{windows:r,windowSize:i}=n(t),o=[];let a=e,s=a;for(let e=0;e<r;e++){s=a,o.push(s);for(let e=1;e<i;e++)s=s.add(a),o.push(s);a=s.double()}return o},wNAF(t,i,o){const{windows:s,windowSize:c}=n(t);let u=e.ZERO,l=e.BASE;const d=BigInt(2**t-1),p=2**t,f=BigInt(t);for(let e=0;e<s;e++){const t=e*c;let n=Number(o&d);o>>=f,n>c&&(n-=p,o+=a);const s=t,h=t+Math.abs(n)-1,m=e%2!=0,g=n<0;0===n?l=l.add(r(m,i[s])):u=u.add(r(g,i[h]))}return{p:u,f:l}},wNAFCached(e,t,r,n){const i=e._WINDOW_SIZE||1;let o=t.get(e);return o||(o=this.precomputeWindow(e,i),1!==i&&t.set(e,n(o))),this.wNAF(i,o,r)}}},t.validateBasic=function(e){return(0,n.validateField)(e.Fp),(0,i.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,n.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}},5134:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createHasher=t.isogenyMap=t.hash_to_field=t.expand_message_xof=t.expand_message_xmd=void 0;const n=r(4632),i=r(219),o=i.bytesToNumberBE;function a(e,t){if(e<0||e>=1<<8*t)throw new Error(`bad I2OSP call: value=${e} length=${t}`);const r=Array.from({length:t}).fill(0);for(let n=t-1;n>=0;n--)r[n]=255&e,e>>>=8;return new Uint8Array(r)}function s(e,t){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e[n]^t[n];return r}function c(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected")}function u(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function l(e,t,r,n){c(e),c(t),u(r),t.length>255&&(t=n((0,i.concatBytes)((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));const{outputLen:o,blockLen:l}=n,d=Math.ceil(r/o);if(d>255)throw new Error("Invalid xmd length");const p=(0,i.concatBytes)(t,a(t.length,1)),f=a(0,l),h=a(r,2),m=new Array(d),g=n((0,i.concatBytes)(f,e,h,a(0,1),p));m[0]=n((0,i.concatBytes)(g,a(1,1),p));for(let e=1;e<=d;e++){const t=[s(g,m[e-1]),a(e+1,1),p];m[e]=n((0,i.concatBytes)(...t))}return(0,i.concatBytes)(...m).slice(0,r)}function d(e,t,r,n,o){if(c(e),c(t),u(r),t.length>255){const e=Math.ceil(2*n/8);t=o.create({dkLen:e}).update((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return o.create({dkLen:r}).update(e).update(a(r,2)).update(t).update(a(t.length,1)).digest()}function p(e,t,r){(0,i.validateObject)(r,{DST:"string",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:a,k:s,m:p,hash:f,expand:h,DST:m}=r;c(e),u(t);const g=function(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return(0,i.utf8ToBytes)(e);throw new Error("DST must be Uint8Array or string")}(m),v=a.toString(2).length,y=Math.ceil((v+s)/8),b=t*p*y;let w;if("xmd"===h)w=l(e,g,b,f);else if("xof"===h)w=d(e,g,b,s,f);else{if("_internal_pass"!==h)throw new Error('expand must be "xmd" or "xof"');w=e}const x=new Array(t);for(let e=0;e<t;e++){const t=new Array(p);for(let r=0;r<p;r++){const i=y*(r+e*p),s=w.subarray(i,i+y);t[r]=(0,n.mod)(o(s),a)}x[e]=t}return x}t.expand_message_xmd=l,t.expand_message_xof=d,t.hash_to_field=p,t.isogenyMap=function(e,t){const r=t.map((e=>Array.from(e).reverse()));return(t,n)=>{const[i,o,a,s]=r.map((r=>r.reduce(((r,n)=>e.add(e.mul(r,t),n)))));return t=e.div(i,o),n=e.mul(n,e.div(a,s)),{x:t,y:n}}},t.createHasher=function(e,t,r){if("function"!=typeof t)throw new Error("mapToCurve() must be defined");return{hashToCurve(n,i){const o=p(n,2,{...r,DST:r.DST,...i}),a=e.fromAffine(t(o[0])),s=e.fromAffine(t(o[1])),c=a.add(s).clearCofactor();return c.assertValidity(),c},encodeToCurve(n,i){const o=p(n,1,{...r,DST:r.encodeDST,...i}),a=e.fromAffine(t(o[0])).clearCofactor();return a.assertValidity(),a}}}},4632:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hashToPrivateScalar=t.FpSqrtEven=t.FpSqrtOdd=t.Field=t.nLength=t.FpIsSquare=t.FpDiv=t.FpInvertBatch=t.FpPow=t.validateField=t.isNegativeLE=t.FpSqrt=t.tonelliShanks=t.invert=t.pow2=t.pow=t.mod=void 0;const n=r(219),i=BigInt(0),o=BigInt(1),a=BigInt(2),s=BigInt(3),c=BigInt(4),u=BigInt(5),l=BigInt(8);function d(e,t){const r=e%t;return r>=i?r:t+r}function p(e,t,r){if(r<=i||t<i)throw new Error("Expected power/modulo > 0");if(r===o)return i;let n=o;for(;t>i;)t&o&&(n=n*e%r),e=e*e%r,t>>=o;return n}function f(e,t){if(e===i||t<=i)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=d(e,t),n=t,a=i,s=o,c=o,u=i;for(;r!==i;){const e=n/r,t=n%r,i=a-c*e,o=s-u*e;n=r,r=t,a=c,s=u,c=i,u=o}if(n!==o)throw new Error("invert: does not exist");return d(a,t)}function h(e){const t=(e-o)/a;let r,n,s;for(r=e-o,n=0;r%a===i;r/=a,n++);for(s=a;s<e&&p(s,t,e)!==e-o;s++);if(1===n){const t=(e+o)/c;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}const u=(r+o)/a;return function(e,i){if(e.pow(i,t)===e.neg(e.ONE))throw new Error("Cannot find square root");let a=n,c=e.pow(e.mul(e.ONE,s),r),l=e.pow(i,u),d=e.pow(i,r);for(;!e.eql(d,e.ONE);){if(e.eql(d,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(d);t<a&&!e.eql(r,e.ONE);t++)r=e.sqr(r);const r=e.pow(c,o<<BigInt(a-t-1));c=e.sqr(r),l=e.mul(l,r),d=e.mul(d,c),a=t}return l}}function m(e){if(e%c===s){const t=(e+o)/c;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}if(e%l===u){const t=(e-u)/l;return function(e,r){const n=e.mul(r,a),i=e.pow(n,t),o=e.mul(r,i),s=e.mul(e.mul(o,a),i),c=e.mul(o,e.sub(s,e.ONE));if(!e.eql(e.sqr(c),r))throw new Error("Cannot find square root");return c}}return h(e)}BigInt(9),BigInt(16),t.mod=d,t.pow=p,t.pow2=function(e,t,r){let n=e;for(;t-- >i;)n*=n,n%=r;return n},t.invert=f,t.tonelliShanks=h,t.FpSqrt=m,t.isNegativeLE=(e,t)=>(d(e,t)&o)===o;const g=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function v(e,t,r){if(r<i)throw new Error("Expected power > 0");if(r===i)return e.ONE;if(r===o)return t;let n=e.ONE,a=t;for(;r>i;)r&o&&(n=e.mul(n,a)),a=e.sqr(a),r>>=o;return n}function y(e,t){const r=new Array(t.length),n=t.reduce(((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n))),e.ONE),i=e.inv(n);return t.reduceRight(((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n))),i),r}function b(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}t.validateField=function(e){const t=g.reduce(((e,t)=>(e[t]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,n.validateObject)(e,t)},t.FpPow=v,t.FpInvertBatch=y,t.FpDiv=function(e,t,r){return e.mul(t,"bigint"==typeof r?f(r,e.ORDER):e.inv(r))},t.FpIsSquare=function(e){const t=(e.ORDER-o)/a;return r=>{const n=e.pow(r,t);return e.eql(n,e.ZERO)||e.eql(n,e.ONE)}},t.nLength=b,t.Field=function(e,t,r=!1,a={}){if(e<=i)throw new Error(`Expected Fp ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:c}=b(e,t);if(c>2048)throw new Error("Field lengths over 2048 bytes are not supported");const u=m(e),l=Object.freeze({ORDER:e,BITS:s,BYTES:c,MASK:(0,n.bitMask)(s),ZERO:i,ONE:o,create:t=>d(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("Invalid field element: expected bigint, got "+typeof t);return i<=t&&t<e},is0:e=>e===i,isOdd:e=>(e&o)===o,neg:t=>d(-t,e),eql:(e,t)=>e===t,sqr:t=>d(t*t,e),add:(t,r)=>d(t+r,e),sub:(t,r)=>d(t-r,e),mul:(t,r)=>d(t*r,e),pow:(e,t)=>v(l,e,t),div:(t,r)=>d(t*f(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>f(t,e),sqrt:a.sqrt||(e=>u(l,e)),invertBatch:e=>y(l,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?(0,n.numberToBytesLE)(e,c):(0,n.numberToBytesBE)(e,c),fromBytes:e=>{if(e.length!==c)throw new Error(`Fp.fromBytes: expected ${c}, got ${e.length}`);return r?(0,n.bytesToNumberLE)(e):(0,n.bytesToNumberBE)(e)}});return Object.freeze(l)},t.FpSqrtOdd=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?r:e.neg(r)},t.FpSqrtEven=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r},t.hashToPrivateScalar=function(e,t,r=!1){const i=(e=(0,n.ensureBytes)("privateHash",e)).length,a=b(t).nByteLength+8;if(a<24||i<a||i>1024)throw new Error(`hashToPrivateScalar: expected ${a}-1024 bytes of input, got ${i}`);return d(r?(0,n.bytesToNumberLE)(e):(0,n.bytesToNumberBE)(e),t-o)+o}},219:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateObject=t.createHmacDrbg=t.bitMask=t.bitSet=t.bitGet=t.bitLen=t.utf8ToBytes=t.equalBytes=t.concatBytes=t.ensureBytes=t.numberToVarBytesBE=t.numberToBytesLE=t.numberToBytesBE=t.bytesToNumberLE=t.bytesToNumberBE=t.hexToBytes=t.hexToNumber=t.numberToHexUnpadded=t.bytesToHex=void 0;const r=BigInt(0),n=BigInt(1),i=BigInt(2),o=e=>e instanceof Uint8Array,a=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function s(e){if(!o(e))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=a[e[r]];return t}function c(e){const t=e.toString(16);return 1&t.length?`0${t}`:t}function u(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return BigInt(""===e?"0":`0x${e}`)}function l(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(e.length%2)throw new Error("hex string is invalid: unpadded "+e.length);const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("invalid byte sequence");t[r]=o}return t}function d(...e){const t=new Uint8Array(e.reduce(((e,t)=>e+t.length),0));let r=0;return e.forEach((e=>{if(!o(e))throw new Error("Uint8Array expected");t.set(e,r),r+=e.length})),t}t.bytesToHex=s,t.numberToHexUnpadded=c,t.hexToNumber=u,t.hexToBytes=l,t.bytesToNumberBE=function(e){return u(s(e))},t.bytesToNumberLE=function(e){if(!o(e))throw new Error("Uint8Array expected");return u(s(Uint8Array.from(e).reverse()))},t.numberToBytesBE=(e,t)=>l(e.toString(16).padStart(2*t,"0")),t.numberToBytesLE=(e,r)=>(0,t.numberToBytesBE)(e,r).reverse(),t.numberToVarBytesBE=e=>l(c(e)),t.ensureBytes=function(e,t,r){let n;if("string"==typeof t)try{n=l(t)}catch(r){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${r}`)}else{if(!o(t))throw new Error(`${e} must be hex string or Uint8Array`);n=Uint8Array.from(t)}const i=n.length;if("number"==typeof r&&i!==r)throw new Error(`${e} expected ${r} bytes, got ${i}`);return n},t.concatBytes=d,t.equalBytes=function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0},t.utf8ToBytes=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return(new TextEncoder).encode(e)},t.bitLen=function(e){let t;for(t=0;e>r;e>>=n,t+=1);return t},t.bitGet=(e,t)=>e>>BigInt(t)&n,t.bitSet=(e,t,i)=>e|(i?n:r)<<BigInt(t),t.bitMask=e=>(i<<BigInt(e-1))-n;const p=e=>new Uint8Array(e),f=e=>Uint8Array.from(e);t.createHmacDrbg=function(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let n=p(e),i=p(e),o=0;const a=()=>{n.fill(1),i.fill(0),o=0},s=(...e)=>r(i,n,...e),c=(e=p())=>{i=s(f([0]),e),n=s(),0!==e.length&&(i=s(f([1]),e),n=s())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const r=[];for(;e<t;){n=s();const t=n.slice();r.push(t),e+=n.length}return d(...r)};return(e,t)=>{let r;for(a(),c(e);!(r=t(u()));)c();return a(),r}};const h={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};t.validateObject=function(e,t,r={}){const n=(t,r,n)=>{const i=h[r];if("function"!=typeof i)throw new Error(`Invalid validator "${r}", expected function`);const o=e[t];if(!(n&&void 0===o||i(o,e)))throw new Error(`Invalid param ${String(t)}=${o} (${typeof o}), expected ${r}`)};for(const[e,r]of Object.entries(t))n(e,r,!1);for(const[e,t]of Object.entries(r))n(e,t,!0);return e}},6551:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapToCurveSimpleSWU=t.SWUFpSqrtRatio=t.weierstrass=t.weierstrassPoints=t.DER=void 0;const n=r(4632),i=r(219),o=r(219),a=r(1525),{bytesToNumberBE:s,hexToBytes:c}=i;t.DER={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){const{Err:r}=t.DER;if(e.length<2||2!==e[0])throw new r("Invalid signature integer tag");const n=e[1],i=e.subarray(2,n+2);if(!n||i.length!==n)throw new r("Invalid signature integer: wrong length");if(128&i[0])throw new r("Invalid signature integer: negative");if(0===i[0]&&!(128&i[1]))throw new r("Invalid signature integer: unnecessary leading zero");return{d:s(i),l:e.subarray(n+2)}},toSig(e){const{Err:r}=t.DER,n="string"==typeof e?c(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let i=n.length;if(i<2||48!=n[0])throw new r("Invalid signature tag");if(n[1]!==i-2)throw new r("Invalid signature: incorrect length");const{d:o,l:a}=t.DER._parseInt(n.subarray(2)),{d:s,l:u}=t.DER._parseInt(a);if(u.length)throw new r("Invalid signature: left bytes after parsing");return{r:o,s}},hexFromSig(e){const t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,r=e=>{const t=e.toString(16);return 1&t.length?`0${t}`:t},n=t(r(e.s)),i=t(r(e.r)),o=n.length/2,a=i.length/2,s=r(o),c=r(a);return`30${r(a+o+4)}02${c}${i}02${s}${n}`}};const u=BigInt(0),l=BigInt(1),d=BigInt(2),p=BigInt(3),f=BigInt(4);function h(e){const t=function(e){const t=(0,a.validateBasic)(e);i.validateObject(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:o}=t;if(r){if(!n.eql(o,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:r}=t,s=t.toBytes||((e,t,n)=>{const o=t.toAffine();return i.concatBytes(Uint8Array.from([4]),r.toBytes(o.x),r.toBytes(o.y))}),c=t.fromBytes||(e=>{const t=e.subarray(1);return{x:r.fromBytes(t.subarray(0,r.BYTES)),y:r.fromBytes(t.subarray(r.BYTES,2*r.BYTES))}});function d(e){const{a:n,b:i}=t,o=r.sqr(e),a=r.mul(o,e);return r.add(r.add(a,r.mul(e,n)),i)}if(!r.eql(r.sqr(t.Gy),d(t.Gx)))throw new Error("bad generator point: equation left != right");function f(e){return"bigint"==typeof e&&u<e&&e<t.n}function h(e){if(!f(e))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function m(e){const{allowedPrivateKeyLengths:r,nByteLength:a,wrapPrivateKey:s,n:c}=t;if(r&&"bigint"!=typeof e){if(e instanceof Uint8Array&&(e=i.bytesToHex(e)),"string"!=typeof e||!r.includes(e.length))throw new Error("Invalid key");e=e.padStart(2*a,"0")}let u;try{u="bigint"==typeof e?e:i.bytesToNumberBE((0,o.ensureBytes)("private key",e,a))}catch(t){throw new Error(`private key must be ${a} bytes, hex or bigint, not ${typeof e}`)}return s&&(u=n.mod(u,c)),h(u),u}const g=new Map;function v(e){if(!(e instanceof y))throw new Error("ProjectivePoint expected")}class y{constructor(e,t,n){if(this.px=e,this.py=t,this.pz=n,null==e||!r.isValid(e))throw new Error("x required");if(null==t||!r.isValid(t))throw new Error("y required");if(null==n||!r.isValid(n))throw new Error("z required")}static fromAffine(e){const{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw new Error("invalid affine point");if(e instanceof y)throw new Error("projective point not allowed");const i=e=>r.eql(e,r.ZERO);return i(t)&&i(n)?y.ZERO:new y(t,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=r.invertBatch(e.map((e=>e.pz)));return e.map(((e,r)=>e.toAffine(t[r]))).map(y.fromAffine)}static fromHex(e){const t=y.fromAffine(c((0,o.ensureBytes)("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return y.BASE.multiply(m(e))}_setWindowSize(e){this._WINDOW_SIZE=e,g.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:e,y:n}=this.toAffine();if(!r.isValid(e)||!r.isValid(n))throw new Error("bad point: x or y not FE");const i=r.sqr(n),o=d(e);if(!r.eql(i,o))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(r.isOdd)return!r.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){v(e);const{px:t,py:n,pz:i}=this,{px:o,py:a,pz:s}=e,c=r.eql(r.mul(t,s),r.mul(o,i)),u=r.eql(r.mul(n,s),r.mul(a,i));return c&&u}negate(){return new y(this.px,r.neg(this.py),this.pz)}double(){const{a:e,b:n}=t,i=r.mul(n,p),{px:o,py:a,pz:s}=this;let c=r.ZERO,u=r.ZERO,l=r.ZERO,d=r.mul(o,o),f=r.mul(a,a),h=r.mul(s,s),m=r.mul(o,a);return m=r.add(m,m),l=r.mul(o,s),l=r.add(l,l),c=r.mul(e,l),u=r.mul(i,h),u=r.add(c,u),c=r.sub(f,u),u=r.add(f,u),u=r.mul(c,u),c=r.mul(m,c),l=r.mul(i,l),h=r.mul(e,h),m=r.sub(d,h),m=r.mul(e,m),m=r.add(m,l),l=r.add(d,d),d=r.add(l,d),d=r.add(d,h),d=r.mul(d,m),u=r.add(u,d),h=r.mul(a,s),h=r.add(h,h),d=r.mul(h,m),c=r.sub(c,d),l=r.mul(h,f),l=r.add(l,l),l=r.add(l,l),new y(c,u,l)}add(e){v(e);const{px:n,py:i,pz:o}=this,{px:a,py:s,pz:c}=e;let u=r.ZERO,l=r.ZERO,d=r.ZERO;const f=t.a,h=r.mul(t.b,p);let m=r.mul(n,a),g=r.mul(i,s),b=r.mul(o,c),w=r.add(n,i),x=r.add(a,s);w=r.mul(w,x),x=r.add(m,g),w=r.sub(w,x),x=r.add(n,o);let _=r.add(a,c);return x=r.mul(x,_),_=r.add(m,b),x=r.sub(x,_),_=r.add(i,o),u=r.add(s,c),_=r.mul(_,u),u=r.add(g,b),_=r.sub(_,u),d=r.mul(f,x),u=r.mul(h,b),d=r.add(u,d),u=r.sub(g,d),d=r.add(g,d),l=r.mul(u,d),g=r.add(m,m),g=r.add(g,m),b=r.mul(f,b),x=r.mul(h,x),g=r.add(g,b),b=r.sub(m,b),b=r.mul(f,b),x=r.add(x,b),m=r.mul(g,x),l=r.add(l,m),m=r.mul(_,x),u=r.mul(w,u),u=r.sub(u,m),m=r.mul(w,g),d=r.mul(_,d),d=r.add(d,m),new y(u,l,d)}subtract(e){return this.add(e.negate())}is0(){return this.equals(y.ZERO)}wNAF(e){return w.wNAFCached(this,g,e,(e=>{const t=r.invertBatch(e.map((e=>e.pz)));return e.map(((e,r)=>e.toAffine(t[r]))).map(y.fromAffine)}))}multiplyUnsafe(e){const n=y.ZERO;if(e===u)return n;if(h(e),e===l)return this;const{endo:i}=t;if(!i)return w.unsafeLadder(this,e);let{k1neg:o,k1:a,k2neg:s,k2:c}=i.splitScalar(e),d=n,p=n,f=this;for(;a>u||c>u;)a&l&&(d=d.add(f)),c&l&&(p=p.add(f)),f=f.double(),a>>=l,c>>=l;return o&&(d=d.negate()),s&&(p=p.negate()),p=new y(r.mul(p.px,i.beta),p.py,p.pz),d.add(p)}multiply(e){h(e);let n,i,o=e;const{endo:a}=t;if(a){const{k1neg:e,k1:t,k2neg:s,k2:c}=a.splitScalar(o);let{p:u,f:l}=this.wNAF(t),{p:d,f:p}=this.wNAF(c);u=w.constTimeNegate(e,u),d=w.constTimeNegate(s,d),d=new y(r.mul(d.px,a.beta),d.py,d.pz),n=u.add(d),i=l.add(p)}else{const{p:e,f:t}=this.wNAF(o);n=e,i=t}return y.normalizeZ([n,i])[0]}multiplyAndAddUnsafe(e,t,r){const n=y.BASE,i=(e,t)=>t!==u&&t!==l&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),o=i(this,t).add(i(e,r));return o.is0()?void 0:o}toAffine(e){const{px:t,py:n,pz:i}=this,o=this.is0();null==e&&(e=o?r.ONE:r.inv(i));const a=r.mul(t,e),s=r.mul(n,e),c=r.mul(i,e);if(o)return{x:r.ZERO,y:r.ZERO};if(!r.eql(c,r.ONE))throw new Error("invZ was invalid");return{x:a,y:s}}isTorsionFree(){const{h:e,isTorsionFree:r}=t;if(e===l)return!0;if(r)return r(y,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:r}=t;return e===l?this:r?r(y,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return this.assertValidity(),s(y,this,e)}toHex(e=!0){return i.bytesToHex(this.toRawBytes(e))}}y.BASE=new y(t.Gx,t.Gy,r.ONE),y.ZERO=new y(r.ZERO,r.ONE,r.ZERO);const b=t.nBitLength,w=(0,a.wNAF)(y,t.endo?Math.ceil(b/2):b);return{CURVE:t,ProjectivePoint:y,normPrivateKeyToScalar:m,weierstrassEquation:d,isWithinCurveOrder:f}}function m(e,t){const r=e.ORDER;let n=u;for(let e=r-l;e%d===u;e/=d)n+=l;const i=n,o=(r-l)/d**i,a=(o-l)/d,s=d**i-l,c=d**(i-l),h=e.pow(t,o),m=e.pow(t,(o+l)/d);let g=(t,r)=>{let n=h,o=e.pow(r,s),u=e.sqr(o);u=e.mul(u,r);let p=e.mul(t,u);p=e.pow(p,a),p=e.mul(p,o),o=e.mul(p,r),u=e.mul(p,t);let f=e.mul(u,o);p=e.pow(f,c);let g=e.eql(p,e.ONE);o=e.mul(u,m),p=e.mul(f,n),u=e.cmov(o,u,g),f=e.cmov(p,f,g);for(let t=i;t>l;t--){let r=d**(t-d),i=e.pow(f,r);const a=e.eql(i,e.ONE);o=e.mul(u,n),n=e.mul(n,n),i=e.mul(f,n),u=e.cmov(o,u,a),f=e.cmov(i,f,a)}return{isValid:g,value:u}};if(e.ORDER%f===p){const r=(e.ORDER-p)/f,n=e.sqrt(e.neg(t));g=(t,i)=>{let o=e.sqr(i);const a=e.mul(t,i);o=e.mul(o,a);let s=e.pow(o,r);s=e.mul(s,a);const c=e.mul(s,n),u=e.mul(e.sqr(s),i),l=e.eql(u,t);return{isValid:l,value:e.cmov(c,s,l)}}}return g}t.weierstrassPoints=h,t.weierstrass=function(e){const r=function(e){const t=(0,a.validateBasic)(e);return i.validateObject(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:s,n:c}=r,d=s.BYTES+1,p=2*s.BYTES+1;function f(e){return n.mod(e,c)}function m(e){return n.invert(e,c)}const{ProjectivePoint:g,normPrivateKeyToScalar:v,weierstrassEquation:y,isWithinCurveOrder:b}=h({...r,toBytes(e,t,r){const n=t.toAffine(),o=s.toBytes(n.x),a=i.concatBytes;return r?a(Uint8Array.from([t.hasEvenY()?2:3]),o):a(Uint8Array.from([4]),o,s.toBytes(n.y))},fromBytes(e){const t=e.length,r=e[0],n=e.subarray(1);if(t!==d||2!==r&&3!==r){if(t===p&&4===r)return{x:s.fromBytes(n.subarray(0,s.BYTES)),y:s.fromBytes(n.subarray(s.BYTES,2*s.BYTES))};throw new Error(`Point of length ${t} was invalid. Expected ${d} compressed bytes or ${p} uncompressed bytes`)}{const e=i.bytesToNumberBE(n);if(!(u<(o=e)&&o<s.ORDER))throw new Error("Point is not on curve");const t=y(e);let a=s.sqrt(t);return 1==(1&r)!=((a&l)===l)&&(a=s.neg(a)),{x:e,y:a}}var o}}),w=e=>i.bytesToHex(i.numberToBytesBE(e,r.nByteLength));function x(e){return e>c>>l}const _=(e,t,r)=>i.bytesToNumberBE(e.slice(t,r));class E{constructor(e,t,r){this.r=e,this.s=t,this.recovery=r,this.assertValidity()}static fromCompact(e){const t=r.nByteLength;return e=(0,o.ensureBytes)("compactSignature",e,2*t),new E(_(e,0,t),_(e,t,2*t))}static fromDER(e){const{r,s:n}=t.DER.toSig((0,o.ensureBytes)("DER",e));return new E(r,n)}assertValidity(){if(!b(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!b(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new E(this.r,this.s,e)}recoverPublicKey(e){const{r:t,s:n,recovery:i}=this,a=C((0,o.ensureBytes)("msgHash",e));if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");const c=2===i||3===i?t+r.n:t;if(c>=s.ORDER)throw new Error("recovery id 2 or 3 invalid");const u=0==(1&i)?"02":"03",l=g.fromHex(u+w(c)),d=m(c),p=f(-a*d),h=f(n*d),v=g.BASE.multiplyAndAddUnsafe(l,p,h);if(!v)throw new Error("point at infinify");return v.assertValidity(),v}hasHighS(){return x(this.s)}normalizeS(){return this.hasHighS()?new E(this.r,f(-this.s),this.recovery):this}toDERRawBytes(){return i.hexToBytes(this.toDERHex())}toDERHex(){return t.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return i.hexToBytes(this.toCompactHex())}toCompactHex(){return w(this.r)+w(this.s)}}const k={isValidPrivateKey(e){try{return v(e),!0}catch(e){return!1}},normPrivateKeyToScalar:v,randomPrivateKey:()=>{const e=r.randomBytes(s.BYTES+8),t=n.hashToPrivateScalar(e,c);return i.numberToBytesBE(t,r.nByteLength)},precompute:(e=8,t=g.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};function S(e){const t=e instanceof Uint8Array,r="string"==typeof e,n=(t||r)&&e.length;return t?n===d||n===p:r?n===2*d||n===2*p:e instanceof g}const A=r.bits2int||function(e){const t=i.bytesToNumberBE(e),n=8*e.length-r.nBitLength;return n>0?t>>BigInt(n):t},C=r.bits2int_modN||function(e){return f(A(e))},T=i.bitMask(r.nBitLength);function O(e){if("bigint"!=typeof e)throw new Error("bigint expected");if(!(u<=e&&e<T))throw new Error(`bigint expected < 2^${r.nBitLength}`);return i.numberToBytesBE(e,r.nByteLength)}const P={lowS:r.lowS,prehash:!1},F={lowS:r.lowS,prehash:!1};return g.BASE._setWindowSize(8),{CURVE:r,getPublicKey:function(e,t=!0){return g.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,r=!0){if(S(e))throw new Error("first arg must be private key");if(!S(t))throw new Error("second arg must be public key");return g.fromHex(t).multiply(v(e)).toRawBytes(r)},sign:function(e,t,n=P){const{seed:a,k2sig:c}=function(e,t,n=P){if(["recovered","canonical"].some((e=>e in n)))throw new Error("sign() legacy options not supported");const{hash:a,randomBytes:c}=r;let{lowS:d,prehash:p,extraEntropy:h}=n;null==d&&(d=!0),e=(0,o.ensureBytes)("msgHash",e),p&&(e=(0,o.ensureBytes)("prehashed msgHash",a(e)));const y=C(e),w=v(t),_=[O(w),O(y)];if(null!=h){const e=!0===h?c(s.BYTES):h;_.push((0,o.ensureBytes)("extraEntropy",e,s.BYTES))}const k=i.concatBytes(..._),S=y;return{seed:k,k2sig:function(e){const t=A(e);if(!b(t))return;const r=m(t),n=g.BASE.multiply(t).toAffine(),i=f(n.x);if(i===u)return;const o=f(r*f(S+i*w));if(o===u)return;let a=(n.x===i?0:2)|Number(n.y&l),s=o;return d&&x(o)&&(s=function(e){return x(e)?f(-e):e}(o),a^=1),new E(i,s,a)}}}(e,t,n);return i.createHmacDrbg(r.hash.outputLen,r.nByteLength,r.hmac)(a,c)},verify:function(e,n,i,a=F){const s=e;if(n=(0,o.ensureBytes)("msgHash",n),i=(0,o.ensureBytes)("publicKey",i),"strict"in a)throw new Error("options.strict was renamed to lowS");const{lowS:c,prehash:u}=a;let l,d;try{if("string"==typeof s||s instanceof Uint8Array)try{l=E.fromDER(s)}catch(e){if(!(e instanceof t.DER.Err))throw e;l=E.fromCompact(s)}else{if("object"!=typeof s||"bigint"!=typeof s.r||"bigint"!=typeof s.s)throw new Error("PARSE");{const{r:e,s:t}=s;l=new E(e,t)}}d=g.fromHex(i)}catch(e){if("PARSE"===e.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(c&&l.hasHighS())return!1;u&&(n=r.hash(n));const{r:p,s:h}=l,v=C(n),y=m(h),b=f(v*y),w=f(p*y),x=g.BASE.multiplyAndAddUnsafe(d,b,w)?.toAffine();return!!x&&f(x.x)===p},ProjectivePoint:g,Signature:E,utils:k}},t.SWUFpSqrtRatio=m,t.mapToCurveSimpleSWU=function(e,t){if(n.validateField(e),!e.isValid(t.A)||!e.isValid(t.B)||!e.isValid(t.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const r=m(e,t.Z);if(!e.isOdd)throw new Error("Fp.isOdd is not implemented!");return n=>{let i,o,a,s,c,u,l,d;i=e.sqr(n),i=e.mul(i,t.Z),o=e.sqr(i),o=e.add(o,i),a=e.add(o,e.ONE),a=e.mul(a,t.B),s=e.cmov(t.Z,e.neg(o),!e.eql(o,e.ZERO)),s=e.mul(s,t.A),o=e.sqr(a),u=e.sqr(s),c=e.mul(u,t.A),o=e.add(o,c),o=e.mul(o,a),u=e.mul(u,s),c=e.mul(u,t.B),o=e.add(o,c),l=e.mul(i,a);const{isValid:p,value:f}=r(o,u);d=e.mul(i,n),d=e.mul(d,f),l=e.cmov(l,a,p),d=e.cmov(d,f,p);const h=e.isOdd(n)===e.isOdd(d);return d=e.cmov(e.neg(d),d,h),l=e.div(l,s),{x:l,y:d}}}},3497:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.encodeToCurve=t.hashToCurve=t.schnorr=t.secp256k1=void 0;const i=r(3061),o=r(8089),a=r(4632),s=r(6551),c=r(219),u=r(5134),l=r(9082),d=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),p=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),f=BigInt(1),h=BigInt(2),m=(e,t)=>(e+t/h)/t;function g(e){const t=d,r=BigInt(3),n=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),c=BigInt(44),u=BigInt(88),l=e*e*e%t,p=l*l*e%t,f=(0,a.pow2)(p,r,t)*p%t,m=(0,a.pow2)(f,r,t)*p%t,g=(0,a.pow2)(m,h,t)*l%t,y=(0,a.pow2)(g,i,t)*g%t,b=(0,a.pow2)(y,o,t)*y%t,w=(0,a.pow2)(b,c,t)*b%t,x=(0,a.pow2)(w,u,t)*w%t,_=(0,a.pow2)(x,c,t)*b%t,E=(0,a.pow2)(_,r,t)*p%t,k=(0,a.pow2)(E,s,t)*y%t,S=(0,a.pow2)(k,n,t)*l%t,A=(0,a.pow2)(S,h,t);if(!v.eql(v.sqr(A),e))throw new Error("Cannot find square root");return A}const v=(0,a.Field)(d,void 0,void 0,{sqrt:g});t.secp256k1=(0,l.createCurve)({a:BigInt(0),b:BigInt(7),Fp:v,n:p,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=p,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-f*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,s=BigInt("0x100000000000000000000000000000000"),c=m(o*e,t),u=m(-n*e,t);let l=(0,a.mod)(e-c*r-u*i,t),d=(0,a.mod)(-c*n-u*o,t);const h=l>s,g=d>s;if(h&&(l=t-l),g&&(d=t-d),l>s||d>s)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:h,k1:l,k2neg:g,k2:d}}}},i.sha256);const y=BigInt(0),b=e=>"bigint"==typeof e&&y<e&&e<d,w={};function x(e,...t){let r=w[e];if(void 0===r){const t=(0,i.sha256)(Uint8Array.from(e,(e=>e.charCodeAt(0))));r=(0,c.concatBytes)(t,t),w[e]=r}return(0,i.sha256)((0,c.concatBytes)(r,...t))}const _=e=>e.toRawBytes(!0).slice(1),E=e=>(0,c.numberToBytesBE)(e,32),k=e=>(0,a.mod)(e,d),S=e=>(0,a.mod)(e,p),A=t.secp256k1.ProjectivePoint;function C(e){let r=t.secp256k1.utils.normPrivateKeyToScalar(e),n=A.fromPrivateKey(r);return{scalar:n.hasEvenY()?r:S(-r),bytes:_(n)}}function T(e){if(!b(e))throw new Error("bad x: need 0 < x < p");const t=k(e*e);let r=g(k(t*e+BigInt(7)));r%h!==y&&(r=k(-r));const n=new A(e,r,f);return n.assertValidity(),n}function O(...e){return S((0,c.bytesToNumberBE)(x("BIP0340/challenge",...e)))}function P(e,t,r){const n=(0,c.ensureBytes)("signature",e,64),i=(0,c.ensureBytes)("message",t),o=(0,c.ensureBytes)("publicKey",r,32);try{const e=T((0,c.bytesToNumberBE)(o)),t=(0,c.bytesToNumberBE)(n.subarray(0,32));if(!b(t))return!1;const r=(0,c.bytesToNumberBE)(n.subarray(32,64));if(!("bigint"==typeof(l=r)&&y<l&&l<p))return!1;const d=O(E(t),_(e),i),f=(a=e,s=r,u=S(-d),A.BASE.multiplyAndAddUnsafe(a,s,u));return!(!f||!f.hasEvenY()||f.toAffine().x!==t)}catch(e){return!1}var a,s,u,l}t.schnorr={getPublicKey:function(e){return C(e).bytes},sign:function(e,t,r=(0,o.randomBytes)(32)){const n=(0,c.ensureBytes)("message",e),{bytes:i,scalar:a}=C(t),s=(0,c.ensureBytes)("auxRand",r,32),u=E(a^(0,c.bytesToNumberBE)(x("BIP0340/aux",s))),l=x("BIP0340/nonce",u,i,n),d=S((0,c.bytesToNumberBE)(l));if(d===y)throw new Error("sign failed: k is zero");const{bytes:p,scalar:f}=C(d),h=O(p,i,n),m=new Uint8Array(64);if(m.set(p,0),m.set(E(S(f+h*a)),32),!P(m,n,i))throw new Error("sign: Invalid signature produced");return m},verify:P,utils:{randomPrivateKey:t.secp256k1.utils.randomPrivateKey,lift_x:T,pointToBytes:_,numberToBytesBE:c.numberToBytesBE,bytesToNumberBE:c.bytesToNumberBE,taggedHash:x,mod:a.mod}};const F=u.isogenyMap(v,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map((e=>e.map((e=>BigInt(e)))))),I=(0,s.mapToCurveSimpleSWU)(v,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:v.create(BigInt("-11"))});n=u.createHasher(t.secp256k1.ProjectivePoint,(e=>{const{x:t,y:r}=I(v.create(e[0]));return F(t,r)}),{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:v.ORDER,m:1,k:128,expand:"xmd",hash:i.sha256}),t.hashToCurve=n.hashToCurve,t.encodeToCurve=n.encodeToCurve},7320:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function n(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)}function i(e,...t){if(!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function o(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function a(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function s(e,t){i(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=void 0,t.number=r,t.bool=n,t.bytes=i,t.hash=o,t.exists=a,t.output=s;const c={number:r,bool:n,bytes:i,hash:o,exists:a,output:s};t.default=c},7505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;const n=r(7320),i=r(8089);class o extends i.Hash{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,i.createView)(this.buffer)}update(e){n.default.exists(this);const{view:t,buffer:r,blockLen:o}=this,a=(e=(0,i.toBytes)(e)).length;for(let n=0;n<a;){const s=Math.min(o-this.pos,a-n);if(s!==o)r.set(e.subarray(n,n+s),this.pos),this.pos+=s,n+=s,this.pos===o&&(this.process(t,0),this.pos=0);else{const t=(0,i.createView)(e);for(;o<=a-n;n+=o)this.process(t,n)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){n.default.exists(this),n.default.output(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:o,isLE:a}=this;let{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>o-s&&(this.process(r,0),s=0);for(let e=s;e<o;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),a=Number(r>>i&o),s=Number(r&o),c=n?4:0,u=n?0:4;e.setUint32(t+c,a,n),e.setUint32(t+u,s,n)}(r,o-8,BigInt(8*this.length),a),this.process(r,0);const c=(0,i.createView)(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=u/4,d=this.get();if(l>d.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<l;e++)c.setUint32(4*e,d[e],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:a}=this;return e.length=n,e.pos=a,e.finished=i,e.destroyed=o,n%t&&e.buffer.set(r),e}}t.SHA2=o},1945:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},9569:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=void 0;const n=r(7320),i=r(8089);class o extends i.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,n.default.hash(e);const r=(0,i.toBytes)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new TypeError("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,a=new Uint8Array(o);a.set(r.length>o?e.create().update(r).digest():r);for(let e=0;e<a.length;e++)a[e]^=54;this.iHash.update(a),this.oHash=e.create();for(let e=0;e<a.length;e++)a[e]^=106;this.oHash.update(a),a.fill(0)}update(e){return n.default.exists(this),this.iHash.update(e),this}digestInto(e){n.default.exists(this),n.default.bytes(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:o,outputLen:a}=this;return e.finished=n,e.destroyed=i,e.blockLen=o,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.hmac=(e,t,r)=>new o(e,t).update(r).digest(),t.hmac.create=(e,t)=>new o(e,t)},3061:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=void 0;const n=r(7505),i=r(8089),o=(e,t,r)=>e&t^e&r^t&r,a=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),s=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint32Array(64);class u extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|s[0],this.B=0|s[1],this.C=0|s[2],this.D=0|s[3],this.E=0|s[4],this.F=0|s[5],this.G=0|s[6],this.H=0|s[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:o,G:a,H:s}=this;return[e,t,r,n,i,o,a,s]}set(e,t,r,n,i,o,a,s){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|a,this.H=0|s}process(e,t){for(let r=0;r<16;r++,t+=4)c[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=c[e-15],r=c[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,o=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;c[e]=o+c[e-7]+n+c[e-16]|0}let{A:r,B:n,C:s,D:u,E:l,F:d,G:p,H:f}=this;for(let e=0;e<64;e++){const t=f+((0,i.rotr)(l,6)^(0,i.rotr)(l,11)^(0,i.rotr)(l,25))+((h=l)&d^~h&p)+a[e]+c[e]|0,m=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+o(r,n,s)|0;f=p,p=d,d=l,l=u+t|0,u=s,s=n,n=r,r=t+m|0}var h;r=r+this.A|0,n=n+this.B|0,s=s+this.C|0,u=u+this.D|0,l=l+this.E|0,d=d+this.F|0,p=p+this.G|0,f=f+this.H|0,this.set(r,n,s,u,l,d,p,f)}roundClean(){c.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class l extends u{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}t.sha256=(0,i.wrapConstructor)((()=>new u)),t.sha224=(0,i.wrapConstructor)((()=>new l))},8089:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const n=r(1945);if(t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),t.rotr=(e,t)=>e<<32-t|e>>>t,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");const i=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function o(e){if("string"!=typeof e)throw new TypeError("utf8ToBytes expected string, got "+typeof e);return(new TextEncoder).encode(e)}function a(e){if("string"==typeof e&&(e=o(e)),!(e instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}t.bytesToHex=function(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=i[e[r]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");t[r]=o}return t},t.nextTick=async()=>{},t.asyncLoop=async function(e,r,n){let i=Date.now();for(let o=0;o<e;o++){n(o);const e=Date.now()-i;e>=0&&e<r||(await(0,t.nextTick)(),i+=e)}},t.utf8ToBytes=o,t.toBytes=a,t.concatBytes=function(...e){if(!e.every((e=>e instanceof Uint8Array)))throw new Error("Uint8Array list expected");if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r},t.Hash=class{clone(){return this._cloneInto()}},t.checkOpts=function(e,t){if(void 0!==t&&("object"!=typeof t||(r=t,"[object Object]"!==Object.prototype.toString.call(r)||r.constructor!==Object)))throw new TypeError("Options should be object or undefined");var r;return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(a(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(a(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},2167:(e,t)=>{"use strict";function r(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.freeze?t.freeze(e):e}var n=r({HTML:"text/html",isHTML:function(e){return e===n.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),i=r({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===i.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});t.assign=function(e,t){if(null===e||"object"!=typeof e)throw new TypeError("target is not an object");for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},t.find=function(e,t,r){if(void 0===r&&(r=Array.prototype),e&&"function"==typeof r.find)return r.find.call(e,t);for(var n=0;n<e.length;n++)if(Object.prototype.hasOwnProperty.call(e,n)){var i=e[n];if(t.call(void 0,i,n,e))return i}},t.freeze=r,t.MIME_TYPE=n,t.NAMESPACE=i},6129:(e,t,r)=>{var n=r(2167),i=r(1146),o=r(1045),a=r(6925),s=i.DOMImplementation,c=n.NAMESPACE,u=a.ParseError,l=a.XMLReader;function d(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function p(e){this.options=e||{locator:{}}}function f(){this.cdata=!1}function h(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function m(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function g(e,t,r){return"string"==typeof e?e.substr(t,r):e.length>=t+r||t?new java.lang.String(e,t,r)+"":e}function v(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}p.prototype.parseFromString=function(e,t){var r=this.options,n=new l,i=r.domBuilder||new f,a=r.errorHandler,s=r.locator,u=r.xmlns||{},p=/\/x?html?$/.test(t),h=p?o.HTML_ENTITIES:o.XML_ENTITIES;s&&i.setDocumentLocator(s),n.errorHandler=function(e,t,r){if(!e){if(t instanceof f)return t;e=t}var n={},i=e instanceof Function;function o(t){var o=e[t];!o&&i&&(o=2==e.length?function(r){e(t,r)}:e),n[t]=o&&function(e){o("[xmldom "+t+"]\t"+e+m(r))}||function(){}}return r=r||{},o("warning"),o("error"),o("fatalError"),n}(a,i,s),n.domBuilder=r.domBuilder||i,p&&(u[""]=c.HTML),u.xml=u.xml||c.XML;var g=r.normalizeLineEndings||d;return e&&"string"==typeof e?n.parse(g(e),u,h):n.errorHandler.error("invalid doc source"),i.doc},f.prototype={startDocument:function(){this.doc=(new s).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,r,n){var i=this.doc,o=i.createElementNS(e,r||t),a=n.length;v(this,o),this.currentElement=o,this.locator&&h(this.locator,o);for(var s=0;s<a;s++){e=n.getURI(s);var c=n.getValue(s),u=(r=n.getQName(s),i.createAttributeNS(e,r));this.locator&&h(n.getLocator(s),u),u.value=u.nodeValue=c,o.setAttributeNode(u)}},endElement:function(e,t,r){var n=this.currentElement;n.tagName,this.currentElement=n.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var r=this.doc.createProcessingInstruction(e,t);this.locator&&h(this.locator,r),v(this,r)},ignorableWhitespace:function(e,t,r){},characters:function(e,t,r){if(e=g.apply(this,arguments)){if(this.cdata)var n=this.doc.createCDATASection(e);else n=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(e)&&this.doc.appendChild(n),this.locator&&h(this.locator,n)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,r){e=g.apply(this,arguments);var n=this.doc.createComment(e);this.locator&&h(this.locator,n),v(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,r){var n=this.doc.implementation;if(n&&n.createDocumentType){var i=n.createDocumentType(e,t,r);this.locator&&h(this.locator,i),v(this,i),this.doc.doctype=i}},warning:function(e){console.warn("[xmldom warning]\t"+e,m(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,m(this.locator))},fatalError:function(e){throw new u(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(e){f.prototype[e]=function(){return null}})),t.DOMParser=p},1146:(e,t,r)=>{var n=r(2167),i=n.find,o=n.NAMESPACE;function a(e){return""!==e}function s(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function c(e){if(!e)return[];var t=function(e){return e?e.split(/[\t\n\f\r ]+/).filter(a):[]}(e);return Object.keys(t.reduce(s,{}))}function u(e,t){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}function l(e,t){var r=e.prototype;if(!(r instanceof t)){function n(){}n.prototype=t.prototype,u(r,n=new n),e.prototype=r=n}r.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),r.constructor=e)}var d={},p=d.ELEMENT_NODE=1,f=d.ATTRIBUTE_NODE=2,h=d.TEXT_NODE=3,m=d.CDATA_SECTION_NODE=4,g=d.ENTITY_REFERENCE_NODE=5,v=d.ENTITY_NODE=6,y=d.PROCESSING_INSTRUCTION_NODE=7,b=d.COMMENT_NODE=8,w=d.DOCUMENT_NODE=9,x=d.DOCUMENT_TYPE_NODE=10,_=d.DOCUMENT_FRAGMENT_NODE=11,E=d.NOTATION_NODE=12,k={},S={},A=(k.INDEX_SIZE_ERR=(S[1]="Index size error",1),k.DOMSTRING_SIZE_ERR=(S[2]="DOMString size error",2),k.HIERARCHY_REQUEST_ERR=(S[3]="Hierarchy request error",3)),C=(k.WRONG_DOCUMENT_ERR=(S[4]="Wrong document",4),k.INVALID_CHARACTER_ERR=(S[5]="Invalid character",5),k.NO_DATA_ALLOWED_ERR=(S[6]="No data allowed",6),k.NO_MODIFICATION_ALLOWED_ERR=(S[7]="No modification allowed",7),k.NOT_FOUND_ERR=(S[8]="Not found",8)),T=(k.NOT_SUPPORTED_ERR=(S[9]="Not supported",9),k.INUSE_ATTRIBUTE_ERR=(S[10]="Attribute in use",10));function O(e,t){if(t instanceof Error)var r=t;else r=this,Error.call(this,S[e]),this.message=S[e],Error.captureStackTrace&&Error.captureStackTrace(this,O);return r.code=e,t&&(this.message=this.message+": "+t),r}function P(){}function F(e,t){this._node=e,this._refresh=t,I(this)}function I(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var r=e._refresh(e._node);ye(e,"length",r.length),u(r,e),e._inc=t}}function N(){}function j(e,t){for(var r=e.length;r--;)if(e[r]===t)return r}function R(e,t,r,n){if(n?t[j(t,n)]=r:t[t.length++]=r,e){r.ownerElement=e;var i=e.ownerDocument;i&&(n&&q(i,e,n),function(e,t,r){e&&e._inc++,r.namespaceURI===o.XMLNS&&(t._nsMap[r.prefix?r.localName:""]=r.value)}(i,e,r))}}function L(e,t,r){var n=j(t,r);if(!(n>=0))throw new O(C,new Error(e.tagName+"@"+r));for(var i=t.length-1;n<i;)t[n]=t[++n];if(t.length=i,e){var o=e.ownerDocument;o&&(q(o,e,r),r.ownerElement=null)}}function D(){}function M(){}function U(e){return("<"==e?"&lt;":">"==e&&"&gt;")||"&"==e&&"&amp;"||'"'==e&&"&quot;"||"&#"+e.charCodeAt()+";"}function B(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(B(e,t))return!0}while(e=e.nextSibling)}function H(){this.ownerDocument=this}function q(e,t,r,n){e&&e._inc++,r.namespaceURI===o.XMLNS&&delete t._nsMap[r.prefix?r.localName:""]}function K(e,t,r){if(e&&e._inc){e._inc++;var n=t.childNodes;if(r)n[n.length++]=r;else{for(var i=t.firstChild,o=0;i;)n[o++]=i,i=i.nextSibling;n.length=o,delete n[n.length]}}}function W(e,t){var r=t.previousSibling,n=t.nextSibling;return r?r.nextSibling=n:e.firstChild=n,n?n.previousSibling=r:e.lastChild=r,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,K(e.ownerDocument,e),t}function V(e){return e&&e.nodeType===M.DOCUMENT_TYPE_NODE}function z(e){return e&&e.nodeType===M.ELEMENT_NODE}function J(e){return e&&e.nodeType===M.TEXT_NODE}function Z(e,t){var r=e.childNodes||[];if(i(r,z)||V(t))return!1;var n=i(r,V);return!(t&&n&&r.indexOf(n)>r.indexOf(t))}function $(e,t){var r=e.childNodes||[];if(i(r,(function(e){return z(e)&&e!==t})))return!1;var n=i(r,V);return!(t&&n&&r.indexOf(n)>r.indexOf(t))}function G(e,t,r){var n=e.childNodes||[],o=t.childNodes||[];if(t.nodeType===M.DOCUMENT_FRAGMENT_NODE){var a=o.filter(z);if(a.length>1||i(o,J))throw new O(A,"More than one element or text in fragment");if(1===a.length&&!Z(e,r))throw new O(A,"Element in fragment can not be inserted before doctype")}if(z(t)&&!Z(e,r))throw new O(A,"Only one element can be added and only after doctype");if(V(t)){if(i(n,V))throw new O(A,"Only one doctype is allowed");var s=i(n,z);if(r&&n.indexOf(s)<n.indexOf(r))throw new O(A,"Doctype can only be inserted before an element");if(!r&&s)throw new O(A,"Doctype can not be appended since element is present")}}function X(e,t,r){var n=e.childNodes||[],o=t.childNodes||[];if(t.nodeType===M.DOCUMENT_FRAGMENT_NODE){var a=o.filter(z);if(a.length>1||i(o,J))throw new O(A,"More than one element or text in fragment");if(1===a.length&&!$(e,r))throw new O(A,"Element in fragment can not be inserted before doctype")}if(z(t)&&!$(e,r))throw new O(A,"Only one element can be added and only after doctype");if(V(t)){if(i(n,(function(e){return V(e)&&e!==r})))throw new O(A,"Only one doctype is allowed");var s=i(n,z);if(r&&n.indexOf(s)<n.indexOf(r))throw new O(A,"Doctype can only be inserted before an element")}}function Y(e,t,r,n){(function(e,t,r){if(!function(e){return e&&(e.nodeType===M.DOCUMENT_NODE||e.nodeType===M.DOCUMENT_FRAGMENT_NODE||e.nodeType===M.ELEMENT_NODE)}(e))throw new O(A,"Unexpected parent node type "+e.nodeType);if(r&&r.parentNode!==e)throw new O(C,"child not in parent");if(!function(e){return e&&(z(e)||J(e)||V(e)||e.nodeType===M.DOCUMENT_FRAGMENT_NODE||e.nodeType===M.COMMENT_NODE||e.nodeType===M.PROCESSING_INSTRUCTION_NODE)}(t)||V(t)&&e.nodeType!==M.DOCUMENT_NODE)throw new O(A,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)})(e,t,r),e.nodeType===M.DOCUMENT_NODE&&(n||G)(e,t,r);var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===_){var o=t.firstChild;if(null==o)return t;var a=t.lastChild}else o=a=t;var s=r?r.previousSibling:e.lastChild;o.previousSibling=s,a.nextSibling=r,s?s.nextSibling=o:e.firstChild=o,null==r?e.lastChild=a:r.previousSibling=a;do{o.parentNode=e}while(o!==a&&(o=o.nextSibling));return K(e.ownerDocument||e,e),t.nodeType==_&&(t.firstChild=t.lastChild=null),t}function Q(){this._nsMap={}}function ee(){}function te(){}function re(){}function ne(){}function ie(){}function oe(){}function ae(){}function se(){}function ce(){}function ue(){}function le(){}function de(){}function pe(e,t){var r=[],n=9==this.nodeType&&this.documentElement||this,i=n.prefix,o=n.namespaceURI;if(o&&null==i&&null==(i=n.lookupPrefix(o)))var a=[{namespace:o,prefix:null}];return me(this,r,e,t,a),r.join("")}function fe(e,t,r){var n=e.prefix||"",i=e.namespaceURI;if(!i)return!1;if("xml"===n&&i===o.XML||i===o.XMLNS)return!1;for(var a=r.length;a--;){var s=r[a];if(s.prefix===n)return s.namespace!==i}return!0}function he(e,t,r){e.push(" ",t,'="',r.replace(/[<>&"\t\n\r]/g,U),'"')}function me(e,t,r,n,i){if(i||(i=[]),n){if(!(e=n(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case p:var a=e.attributes,s=a.length,c=e.firstChild,u=e.tagName,l=u;if(!(r=o.isHTML(e.namespaceURI)||r)&&!e.prefix&&e.namespaceURI){for(var d,v=0;v<a.length;v++)if("xmlns"===a.item(v).name){d=a.item(v).value;break}if(!d)for(var E=i.length-1;E>=0;E--)if(""===(k=i[E]).prefix&&k.namespace===e.namespaceURI){d=k.namespace;break}if(d!==e.namespaceURI)for(E=i.length-1;E>=0;E--){var k;if((k=i[E]).namespace===e.namespaceURI){k.prefix&&(l=k.prefix+":"+u);break}}}t.push("<",l);for(var S=0;S<s;S++)"xmlns"==(A=a.item(S)).prefix?i.push({prefix:A.localName,namespace:A.value}):"xmlns"==A.nodeName&&i.push({prefix:"",namespace:A.value});for(S=0;S<s;S++){var A,C,T;fe(A=a.item(S),0,i)&&(he(t,(C=A.prefix||"")?"xmlns:"+C:"xmlns",T=A.namespaceURI),i.push({prefix:C,namespace:T})),me(A,t,r,n,i)}if(u===l&&fe(e,0,i)&&(he(t,(C=e.prefix||"")?"xmlns:"+C:"xmlns",T=e.namespaceURI),i.push({prefix:C,namespace:T})),c||r&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(t.push(">"),r&&/^script$/i.test(u))for(;c;)c.data?t.push(c.data):me(c,t,r,n,i.slice()),c=c.nextSibling;else for(;c;)me(c,t,r,n,i.slice()),c=c.nextSibling;t.push("</",l,">")}else t.push("/>");return;case w:case _:for(c=e.firstChild;c;)me(c,t,r,n,i.slice()),c=c.nextSibling;return;case f:return he(t,e.name,e.value);case h:return t.push(e.data.replace(/[<&>]/g,U));case m:return t.push("<![CDATA[",e.data,"]]>");case b:return t.push("\x3c!--",e.data,"--\x3e");case x:var O=e.publicId,P=e.systemId;if(t.push("<!DOCTYPE ",e.name),O)t.push(" PUBLIC ",O),P&&"."!=P&&t.push(" ",P),t.push(">");else if(P&&"."!=P)t.push(" SYSTEM ",P,">");else{var F=e.internalSubset;F&&t.push(" [",F,"]"),t.push(">")}return;case y:return t.push("<?",e.target," ",e.data,"?>");case g:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function ge(e,t,r){var n;switch(t.nodeType){case p:(n=t.cloneNode(!1)).ownerDocument=e;case _:break;case f:r=!0}if(n||(n=t.cloneNode(!1)),n.ownerDocument=e,n.parentNode=null,r)for(var i=t.firstChild;i;)n.appendChild(ge(e,i,r)),i=i.nextSibling;return n}function ve(e,t,r){var n=new t.constructor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=t[i];"object"!=typeof o&&o!=n[i]&&(n[i]=o)}switch(t.childNodes&&(n.childNodes=new P),n.ownerDocument=e,n.nodeType){case p:var a=t.attributes,s=n.attributes=new N,c=a.length;s._ownerElement=n;for(var u=0;u<c;u++)n.setAttributeNode(ve(e,a.item(u),!0));break;case f:r=!0}if(r)for(var l=t.firstChild;l;)n.appendChild(ve(e,l,r)),l=l.nextSibling;return n}function ye(e,t,r){e[t]=r}k.INVALID_STATE_ERR=(S[11]="Invalid state",11),k.SYNTAX_ERR=(S[12]="Syntax error",12),k.INVALID_MODIFICATION_ERR=(S[13]="Invalid modification",13),k.NAMESPACE_ERR=(S[14]="Invalid namespace",14),k.INVALID_ACCESS_ERR=(S[15]="Invalid access",15),O.prototype=Error.prototype,u(k,O),P.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var r=[],n=0;n<this.length;n++)me(this[n],r,e,t);return r.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},F.prototype.item=function(e){return I(this),this[e]},l(F,P),N.prototype={length:0,item:P.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var r=this[t];if(r.nodeName==e)return r}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new O(T);var r=this.getNamedItem(e.nodeName);return R(this._ownerElement,this,e,r),r},setNamedItemNS:function(e){var t,r=e.ownerElement;if(r&&r!=this._ownerElement)throw new O(T);return t=this.getNamedItemNS(e.namespaceURI,e.localName),R(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return L(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var r=this.getNamedItemNS(e,t);return L(this._ownerElement,this,r),r},getNamedItemNS:function(e,t){for(var r=this.length;r--;){var n=this[r];if(n.localName==t&&n.namespaceURI==e)return n}return null}},D.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,r){var n=new H;if(n.implementation=this,n.childNodes=new P,n.doctype=r||null,r&&n.appendChild(r),t){var i=n.createElementNS(e,t);n.appendChild(i)}return n},createDocumentType:function(e,t,r){var n=new oe;return n.name=e,n.nodeName=e,n.publicId=t||"",n.systemId=r||"",n}},M.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return Y(this,e,t)},replaceChild:function(e,t){Y(this,e,t,X),t&&this.removeChild(t)},removeChild:function(e){return W(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return ve(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==h&&e.nodeType==h?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var r=t._nsMap;if(r)for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&r[n]===e)return n;t=t.nodeType==f?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var r=t._nsMap;if(r&&Object.prototype.hasOwnProperty.call(r,e))return r[e];t=t.nodeType==f?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},u(d,M),u(d,M.prototype),H.prototype={nodeName:"#document",nodeType:w,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==_){for(var r=e.firstChild;r;){var n=r.nextSibling;this.insertBefore(r,t),r=n}return e}return Y(this,e,t),e.ownerDocument=this,null===this.documentElement&&e.nodeType===p&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),W(this,e)},replaceChild:function(e,t){Y(this,e,t,X),e.ownerDocument=this,t&&this.removeChild(t),z(e)&&(this.documentElement=e)},importNode:function(e,t){return ge(this,e,t)},getElementById:function(e){var t=null;return B(this.documentElement,(function(r){if(r.nodeType==p&&r.getAttribute("id")==e)return t=r,!0})),t},getElementsByClassName:function(e){var t=c(e);return new F(this,(function(r){var n=[];return t.length>0&&B(r.documentElement,(function(i){if(i!==r&&i.nodeType===p){var o=i.getAttribute("class");if(o){var a=e===o;if(!a){var s=c(o);a=t.every((u=s,function(e){return u&&-1!==u.indexOf(e)}))}a&&n.push(i)}}var u})),n}))},createElement:function(e){var t=new Q;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new P,(t.attributes=new N)._ownerElement=t,t},createDocumentFragment:function(){var e=new ue;return e.ownerDocument=this,e.childNodes=new P,e},createTextNode:function(e){var t=new re;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new ne;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new ie;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var r=new le;return r.ownerDocument=this,r.tagName=r.target=e,r.nodeValue=r.data=t,r},createAttribute:function(e){var t=new ee;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new ce;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var r=new Q,n=t.split(":"),i=r.attributes=new N;return r.childNodes=new P,r.ownerDocument=this,r.nodeName=t,r.tagName=t,r.namespaceURI=e,2==n.length?(r.prefix=n[0],r.localName=n[1]):r.localName=t,i._ownerElement=r,r},createAttributeNS:function(e,t){var r=new ee,n=t.split(":");return r.ownerDocument=this,r.nodeName=t,r.name=t,r.namespaceURI=e,r.specified=!0,2==n.length?(r.prefix=n[0],r.localName=n[1]):r.localName=t,r}},l(H,M),Q.prototype={nodeType:p,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var r=this.ownerDocument.createAttribute(e);r.value=r.nodeValue=""+t,this.setAttributeNode(r)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===_?this.insertBefore(e,null):function(e,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=e,t.previousSibling=e.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,e.lastChild=t,K(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var r=this.getAttributeNodeNS(e,t);r&&this.removeAttributeNode(r)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var r=this.getAttributeNodeNS(e,t);return r&&r.value||""},setAttributeNS:function(e,t,r){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+r,this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new F(this,(function(t){var r=[];return B(t,(function(n){n===t||n.nodeType!=p||"*"!==e&&n.tagName!=e||r.push(n)})),r}))},getElementsByTagNameNS:function(e,t){return new F(this,(function(r){var n=[];return B(r,(function(i){i===r||i.nodeType!==p||"*"!==e&&i.namespaceURI!==e||"*"!==t&&i.localName!=t||n.push(i)})),n}))}},H.prototype.getElementsByTagName=Q.prototype.getElementsByTagName,H.prototype.getElementsByTagNameNS=Q.prototype.getElementsByTagNameNS,l(Q,M),ee.prototype.nodeType=f,l(ee,M),te.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(S[A])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,r){r=this.data.substring(0,e)+r+this.data.substring(e+t),this.nodeValue=this.data=r,this.length=r.length}},l(te,M),re.prototype={nodeName:"#text",nodeType:h,splitText:function(e){var t=this.data,r=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(r);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},l(re,te),ne.prototype={nodeName:"#comment",nodeType:b},l(ne,te),ie.prototype={nodeName:"#cdata-section",nodeType:m},l(ie,te),oe.prototype.nodeType=x,l(oe,M),ae.prototype.nodeType=E,l(ae,M),se.prototype.nodeType=v,l(se,M),ce.prototype.nodeType=g,l(ce,M),ue.prototype.nodeName="#document-fragment",ue.prototype.nodeType=_,l(ue,M),le.prototype.nodeType=y,l(le,M),de.prototype.serializeToString=function(e,t,r){return pe.call(e,t,r)},M.prototype.toString=pe;try{if(Object.defineProperty){function be(e){switch(e.nodeType){case p:case _:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(be(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(F.prototype,"length",{get:function(){return I(this),this.$$length}}),Object.defineProperty(M.prototype,"textContent",{get:function(){return be(this)},set:function(e){switch(this.nodeType){case p:case _:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),ye=function(e,t,r){e["$$"+t]=r}}}catch(we){}t.DocumentType=oe,t.DOMException=O,t.DOMImplementation=D,t.Element=Q,t.Node=M,t.NodeList=P,t.XMLSerializer=de},1045:(e,t,r)=>{var n=r(2167).freeze;t.XML_ENTITIES=n({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=n({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}),t.entityMap=t.HTML_ENTITIES},3969:(e,t,r)=>{var n=r(1146);n.DOMImplementation,n.XMLSerializer,t.DOMParser=r(6129).DOMParser},6925:(e,t,r)=>{var n=r(2167).NAMESPACE,i=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,o=new RegExp("[\\-\\.0-9"+i.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),a=new RegExp("^"+i.source+o.source+"*(?::"+i.source+o.source+"*)?$");function s(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,s)}function c(){}function u(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function l(e,t,r,i,o,a){function s(e,t,n){r.attributeNames.hasOwnProperty(e)&&a.fatalError("Attribute "+e+" redefined"),r.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,o),n)}for(var c,u=++t,l=0;;){var d=e.charAt(u);switch(d){case"=":if(1===l)c=e.slice(t,u),l=3;else{if(2!==l)throw new Error("attribute equal must after attrName");l=3}break;case"'":case'"':if(3===l||1===l){if(1===l&&(a.warning('attribute value must after "="'),c=e.slice(t,u)),t=u+1,!((u=e.indexOf(d,t))>0))throw new Error("attribute value no end '"+d+"' match");s(c,p=e.slice(t,u),t-1),l=5}else{if(4!=l)throw new Error('attribute value must after "="');s(c,p=e.slice(t,u),t),a.warning('attribute "'+c+'" missed start quot('+d+")!!"),t=u+1,l=5}break;case"/":switch(l){case 0:r.setTagName(e.slice(t,u));case 5:case 6:case 7:l=7,r.closed=!0;case 4:case 1:break;case 2:r.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),0==l&&r.setTagName(e.slice(t,u)),u;case">":switch(l){case 0:r.setTagName(e.slice(t,u));case 5:case 6:case 7:break;case 4:case 1:"/"===(p=e.slice(t,u)).slice(-1)&&(r.closed=!0,p=p.slice(0,-1));case 2:2===l&&(p=c),4==l?(a.warning('attribute "'+p+'" missed quot(")!'),s(c,p,t)):(n.isHTML(i[""])&&p.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+p+'" missed value!! "'+p+'" instead!!'),s(p,p,t));break;case 3:throw new Error("attribute value missed!!")}return u;case"€":d=" ";default:if(d<=" ")switch(l){case 0:r.setTagName(e.slice(t,u)),l=6;break;case 1:c=e.slice(t,u),l=2;break;case 4:var p=e.slice(t,u);a.warning('attribute "'+p+'" missed quot(")!!'),s(c,p,t);case 5:l=6}else switch(l){case 2:r.tagName,n.isHTML(i[""])&&c.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+c+'" missed value!! "'+c+'" instead2!!'),s(c,c,t),t=u,l=1;break;case 5:a.warning('attribute space is required"'+c+'"!!');case 6:l=1,t=u;break;case 3:l=4,t=u;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}u++}}function d(e,t,r){for(var i=e.tagName,o=null,a=e.length;a--;){var s=e[a],c=s.qName,u=s.value;if((f=c.indexOf(":"))>0)var l=s.prefix=c.slice(0,f),d=c.slice(f+1),p="xmlns"===l&&d;else d=c,l=null,p="xmlns"===c&&"";s.localName=d,!1!==p&&(null==o&&(o={},h(r,r={})),r[p]=o[p]=u,s.uri=n.XMLNS,t.startPrefixMapping(p,u))}for(a=e.length;a--;)(l=(s=e[a]).prefix)&&("xml"===l&&(s.uri=n.XML),"xmlns"!==l&&(s.uri=r[l||""]));var f;(f=i.indexOf(":"))>0?(l=e.prefix=i.slice(0,f),d=e.localName=i.slice(f+1)):(l=null,d=e.localName=i);var m=e.uri=r[l||""];if(t.startElement(m,d,i,e),!e.closed)return e.currentNSMap=r,e.localNSMap=o,!0;if(t.endElement(m,d,i),o)for(l in o)Object.prototype.hasOwnProperty.call(o,l)&&t.endPrefixMapping(l)}function p(e,t,r,n,i){if(/^(?:script|textarea)$/i.test(r)){var o=e.indexOf("</"+r+">",t),a=e.substring(t+1,o);if(/[&<]/.test(a))return/^script$/i.test(r)?(i.characters(a,0,a.length),o):(a=a.replace(/&#?\w+;/g,n),i.characters(a,0,a.length),o)}return t+1}function f(e,t,r,n){var i=n[r];return null==i&&((i=e.lastIndexOf("</"+r+">"))<t&&(i=e.lastIndexOf("</"+r)),n[r]=i),i<t}function h(e,t){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}function m(e,t,r,n){if("-"===e.charAt(t+2))return"-"===e.charAt(t+3)?(i=e.indexOf("--\x3e",t+4))>t?(r.comment(e,t+4,i-t-4),i+3):(n.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(t+3,6)){var i=e.indexOf("]]>",t+9);return r.startCDATA(),r.characters(e,t+9,i-t-9),r.endCDATA(),i+3}var o=function(e,t){var r,n=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=t,i.exec(e);r=i.exec(e);)if(n.push(r),r[1])return n}(e,t),a=o.length;if(a>1&&/!doctype/i.test(o[0][0])){var s=o[1][0],c=!1,u=!1;a>3&&(/^public$/i.test(o[2][0])?(c=o[3][0],u=a>4&&o[4][0]):/^system$/i.test(o[2][0])&&(u=o[3][0]));var l=o[a-1];return r.startDTD(s,c,u),r.endDTD(),l.index+l[0].length}return-1}function g(e,t,r){var n=e.indexOf("?>",t);if(n){var i=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return i?(i[0].length,r.processingInstruction(i[1],i[2]),n+2):-1}return-1}function v(){this.attributeNames={}}s.prototype=new Error,s.prototype.name=s.name,c.prototype={parse:function(e,t,r){var i=this.domBuilder;i.startDocument(),h(t,t={}),function(e,t,r,i,o){function a(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(r,t)?r[t]:"#"===t.charAt(0)?function(e){if(e>65535){var t=55296+((e-=65536)>>10),r=56320+(1023&e);return String.fromCharCode(t,r)}return String.fromCharCode(e)}(parseInt(t.substr(1).replace("x","0x"))):(o.error("entity not found:"+e),e)}function c(t){if(t>k){var r=e.substring(k,t).replace(/&#?\w+;/g,a);x&&h(k),i.characters(r,0,t-k),k=t}}function h(t,r){for(;t>=b&&(r=w.exec(e));)y=r.index,b=y+r[0].length,x.lineNumber++;x.columnNumber=t-y+1}for(var y=0,b=0,w=/.*(?:\r\n?|\n)|.*$/g,x=i.locator,_=[{currentNSMap:t}],E={},k=0;;){try{var S=e.indexOf("<",k);if(S<0){if(!e.substr(k).match(/^\s*$/)){var A=i.doc,C=A.createTextNode(e.substr(k));A.appendChild(C),i.currentElement=C}return}switch(S>k&&c(S),e.charAt(S+1)){case"/":var T=e.indexOf(">",S+3),O=e.substring(S+2,T).replace(/[ \t\n\r]+$/g,""),P=_.pop();T<0?(O=e.substring(S+2).replace(/[\s<].*/,""),o.error("end tag name: "+O+" is not complete:"+P.tagName),T=S+1+O.length):O.match(/\s</)&&(O=O.replace(/[\s<].*/,""),o.error("end tag name: "+O+" maybe not complete"),T=S+1+O.length);var F=P.localNSMap,I=P.tagName==O;if(I||P.tagName&&P.tagName.toLowerCase()==O.toLowerCase()){if(i.endElement(P.uri,P.localName,O),F)for(var N in F)Object.prototype.hasOwnProperty.call(F,N)&&i.endPrefixMapping(N);I||o.fatalError("end tag name: "+O+" is not match the current start tagName:"+P.tagName)}else _.push(P);T++;break;case"?":x&&h(S),T=g(e,S,i);break;case"!":x&&h(S),T=m(e,S,i,o);break;default:x&&h(S);var j=new v,R=_[_.length-1].currentNSMap,L=(T=l(e,S,j,R,a,o),j.length);if(!j.closed&&f(e,T,j.tagName,E)&&(j.closed=!0,r.nbsp||o.warning("unclosed xml attribute")),x&&L){for(var D=u(x,{}),M=0;M<L;M++){var U=j[M];h(U.offset),U.locator=u(x,{})}i.locator=D,d(j,i,R)&&_.push(j),i.locator=x}else d(j,i,R)&&_.push(j);n.isHTML(j.uri)&&!j.closed?T=p(e,T,j.tagName,a,i):T++}}catch(e){if(e instanceof s)throw e;o.error("element parse error: "+e),T=-1}T>k?k=T:c(Math.max(S,k)+1)}}(e,t,r,i,this.errorHandler),i.endDocument()}},v.prototype={setTagName:function(e){if(!a.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,r){if(!a.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:r}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},t.XMLReader=c,t.ParseError=s},4098:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,a="ArrayBuffer"in e;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function u(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function p(e){this.map={},e instanceof p?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function f(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function h(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function m(e){var t=new FileReader,r=h(t);return t.readAsArrayBuffer(e),r}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||c(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(m)}),this.text=function(){var e,t,r,n=f(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=h(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}p.prototype.append=function(e,t){e=u(e),t=l(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},p.prototype.delete=function(e){delete this.map[u(e)]},p.prototype.get=function(e){return e=u(e),this.has(e)?this.map[e]:null},p.prototype.has=function(e){return this.map.hasOwnProperty(u(e))},p.prototype.set=function(e,t){this.map[u(e)]=l(t)},p.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},p.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),d(e)},p.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),d(e)},p.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),d(e)},n&&(p.prototype[Symbol.iterator]=p.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var r,n,i=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new p(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new p(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),y.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function x(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},x.error=function(){var e=new x(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];x.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new x(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function E(e,r){return new Promise((function(n,o){var a=new b(e,r);if(a.signal&&a.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function c(){s.abort()}s.onload=function(){var e,t,r={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new p,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;n(new x(i,r))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",c),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",c)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}E.polyfill=!0,e.fetch||(e.fetch=E,e.Headers=p,e.Request=b,e.Response=x),t.Headers=p,t.Request=b,t.Response=x,t.fetch=E,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},5573:e=>{"use strict";var t=/["'&<>]/;e.exports=function(e){var r,n=""+e,i=t.exec(n);if(!i)return n;var o="",a=0,s=0;for(a=i.index;a<n.length;a++){switch(n.charCodeAt(a)){case 34:r="&quot;";break;case 38:r="&amp;";break;case 39:r="&#39;";break;case 60:r="&lt;";break;case 62:r="&gt;";break;default:continue}s!==a&&(o+=n.substring(s,a)),s=a+1,o+=r}return s!==a?o+n.substring(s,a):o}},7187:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}m(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&m(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function u(e,t,r,n){var i,o,a,u;if(s(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=c(e))>0&&a.length>i&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,u=l,console&&console.warn&&console.warn(u)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):h(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function h(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function m(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var u=c.length,l=h(c,u);for(r=0;r<u;++r)n(l[r],this,t)}return!0},o.prototype.addListener=function(e,t){return u(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return u(this,e,t,!0)},o.prototype.once=function(e,t){return s(t),this.on(e,d(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,d(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,a;if(s(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return p(this,e,!0)},o.prototype.rawListeners=function(e){return p(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},5234:(e,t,r)=>{e.exports=r(3765)},983:(e,t,r)=>{"use strict";var n,i,o,a=r(5234),s=r(9421).extname,c=/^\s*([^;\s]*)(?:;|\s|$)/,u=/^text\//i;function l(e){if(!e||"string"!=typeof e)return!1;var t=c.exec(e),r=t&&a[t[1].toLowerCase()];return r&&r.charset?r.charset:!(!t||!u.test(t[1]))&&"UTF-8"}t.charset=l,t.charsets={lookup:l},t.contentType=function(e){if(!e||"string"!=typeof e)return!1;var r=-1===e.indexOf("/")?t.lookup(e):e;if(!r)return!1;if(-1===r.indexOf("charset")){var n=t.charset(r);n&&(r+="; charset="+n.toLowerCase())}return r},t.extension=function(e){if(!e||"string"!=typeof e)return!1;var r=c.exec(e),n=r&&t.extensions[r[1].toLowerCase()];return!(!n||!n.length)&&n[0]},t.extensions=Object.create(null),t.lookup=function(e){if(!e||"string"!=typeof e)return!1;var r=s("x."+e).toLowerCase().substr(1);return r&&t.types[r]||!1},t.types=Object.create(null),n=t.extensions,i=t.types,o=["nginx","apache",void 0,"iana"],Object.keys(a).forEach((function(e){var t=a[e],r=t.extensions;if(r&&r.length){n[e]=r;for(var s=0;s<r.length;s++){var c=r[s];if(i[c]){var u=o.indexOf(a[i[c]].source),l=o.indexOf(t.source);if("application/octet-stream"!==i[c]&&(u>l||u===l&&"application/"===i[c].substr(0,12)))continue}i[c]=e}}}))},2587:e=>{"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,r,n,i){r=r||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;var a=/\+/g;e=e.split(r);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var c=e.length;s>0&&c>s&&(c=s);for(var u=0;u<c;++u){var l,d,p,f,h=e[u].replace(a,"%20"),m=h.indexOf(n);m>=0?(l=h.substr(0,m),d=h.substr(m+1)):(l=h,d=""),p=decodeURIComponent(l),f=decodeURIComponent(d),t(o,p)?Array.isArray(o[p])?o[p].push(f):o[p]=[o[p],f]:o[p]=f}return o}},2361:e=>{"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,r,n,i){return r=r||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(i){var o=encodeURIComponent(t(i))+n;return Array.isArray(e[i])?e[i].map((function(e){return o+encodeURIComponent(t(e))})).join(r):o+encodeURIComponent(t(e[i]))})).join(r):i?encodeURIComponent(t(i))+n+encodeURIComponent(t(e)):""}},7673:(e,t,r)=>{"use strict";t.decode=t.parse=r(2587),t.encode=t.stringify=r(2361)},4375:(e,t,r)=>{let n;e.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):e=>(n||(n=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))},1897:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n={Literal:1,Collection:3,Graph:4,NamedNode:5,BlankNode:6,Variable:7}},6022:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BlankNode:()=>f,Collection:()=>w,ConnectedStore:()=>Tr,DataFactory:()=>sr,Empty:()=>x,Fetcher:()=>Xt,Formula:()=>ee,IndexedFormula:()=>fe,Literal:()=>y,LiveStore:()=>Or,N3Parser:()=>De,NamedNode:()=>m.Z,Namespace:()=>U,NextId:()=>Cr,Node:()=>te,Query:()=>ne,RDFParser:()=>Tt,RDFaProcessor:()=>At,SPARQLToQuery:()=>er,Serializer:()=>V,Statement:()=>P,Store:()=>fe,UpdateManager:()=>nr,UpdatesSocket:()=>cr,UpdatesVia:()=>ur,Util:()=>B,Variable:()=>N,blankNode:()=>br,defaultGraph:()=>wr,fetcher:()=>fr,fromNT:()=>Sr,graph:()=>hr,isBlankNode:()=>g.B2,isCollection:()=>g.uZ,isGraph:()=>g.NA,isLiteral:()=>g.n_,isNamedNode:()=>g.NX,isPredicate:()=>g.lx,isQuad:()=>g.PY,isRDFObject:()=>g.lt,isRDFlibObject:()=>g.Uc,isRDFlibPredicate:()=>g.nq,isRDFlibSubject:()=>g.f,isStatement:()=>g.Yi,isStore:()=>g.Pv,isSubject:()=>g.zz,isTerm:()=>g.jt,isVariable:()=>g.cG,jsonParser:()=>Yt,lit:()=>mr,literal:()=>xr,log:()=>M.Z,namedNode:()=>vr,parse:()=>Pt,quad:()=>_r,queryToSPARQL:()=>Qt,serialize:()=>J,sparqlUpdateParser:()=>Ot,st:()=>gr,sym:()=>vr,term:()=>Ar,termValue:()=>Nt._,triple:()=>Er,uri:()=>F,variable:()=>yr});var n=r(3144),i=r(5671),o=r(7326),a=r(9340),s=r(2963),c=r(1120),u=r(4942),l=r(1897),d=r(566),p=r(8946);var f=function(e){(0,a.Z)(f,e);var t,r,d=(t=f,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,c.Z)(t);if(r){var i=(0,c.Z)(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return(0,s.Z)(this,e)});function f(e){var t;return(0,i.Z)(this,f),t=d.call(this,f.getId(e)),(0,u.Z)((0,o.Z)(t),"termType",p.V1),(0,u.Z)((0,o.Z)(t),"classOrder",l.Z.BlankNode),(0,u.Z)((0,o.Z)(t),"isBlank",1),(0,u.Z)((0,o.Z)(t),"isVar",1),t}return(0,n.Z)(f,[{key:"id",get:function(){return this.value},set:function(e){this.value=e}},{key:"compareTerm",value:function(e){return this.classOrder<e.classOrder?-1:this.classOrder>e.classOrder?1:this.id<e.id?-1:this.id>e.id?1:0}},{key:"copy",value:function(e){var t=new f;return e.copyTo(this,t),t}},{key:"toCanonical",value:function(){return f.NTAnonymousNodePrefix+this.value}},{key:"toString",value:function(){return f.NTAnonymousNodePrefix+this.id}}],[{key:"getId",value:function(e){if(e){if("string"!=typeof e)throw new Error("Bad id argument to new blank node: "+e);if(e.includes("#")){var t=e.split("#");return t[t.length-1]}return e}return"n"+f.nextId++}}]),f}(d.Z);(0,u.Z)(f,"nextId",0),(0,u.Z)(f,"NTAnonymousNodePrefix","_:");var h=r(1002),m=r(8967),g=r(6680);const v={boolean:new m.Z("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:new m.Z("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:new m.Z("http://www.w3.org/2001/XMLSchema#decimal"),double:new m.Z("http://www.w3.org/2001/XMLSchema#double"),integer:new m.Z("http://www.w3.org/2001/XMLSchema#integer"),langString:new m.Z("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:new m.Z("http://www.w3.org/2001/XMLSchema#string")};var y=function(e){(0,a.Z)(f,e);var t,r,d=(t=f,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,c.Z)(t);if(r){var i=(0,c.Z)(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return(0,s.Z)(this,e)});function f(e,t,r){var n;return(0,i.Z)(this,f),n=d.call(this,e),(0,u.Z)((0,o.Z)(n),"termType",p.xH),(0,u.Z)((0,o.Z)(n),"classOrder",l.Z.Literal),(0,u.Z)((0,o.Z)(n),"datatype",v.string),(0,u.Z)((0,o.Z)(n),"isVar",0),(0,u.Z)((0,o.Z)(n),"language",""),t?(n.language=t,n.datatype=v.langString):n.datatype=r?m.Z.fromValue(r):v.string,n}return(0,n.Z)(f,[{key:"copy",value:function(){return new f(this.value,this.lang,this.datatype)}},{key:"equals",value:function(e){return!!e&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&(!this.datatype&&!e.datatype||this.datatype&&this.datatype.equals(e.datatype))}},{key:"lang",get:function(){return this.language},set:function(e){this.language=e||""}},{key:"toNT",value:function(){return f.toNT(this)}},{key:"toString",value:function(){return""+this.value}}],[{key:"toNT",value:function(e){if("number"==typeof e.value)return""+e.value;if("string"!=typeof e.value)throw new Error("Value of RDF literal is not string or number: "+e.value);var t=e.value;return t='"'+(t=(t=(t=(t=t.replace(/\\/g,"\\\\")).replace(/\"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r"))+'"',e.language?t+="@"+e.language:e.datatype.equals(v.string)||(t+="^^"+e.datatype.toCanonical()),t}},{key:"fromBoolean",value:function(e){return new f(e?"1":"0",null,v.boolean)}},{key:"fromDate",value:function(e){if(!(e instanceof Date))throw new TypeError("Invalid argument to Literal.fromDate()");var t=function(e){return(""+(100+e)).slice(1,3)};return new f(e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"Z",null,v.dateTime)}},{key:"fromNumber",value:function(e){if("number"!=typeof e)throw new TypeError("Invalid argument to Literal.fromNumber()");var t,r=e.toString();return t=r.indexOf("e")<0&&Math.abs(e)<=Number.MAX_SAFE_INTEGER?Number.isInteger(e)?v.integer:v.decimal:v.double,new f(r,null,t)}},{key:"fromValue",value:function(e){if((0,g.n_)(e))return e;switch((0,h.Z)(e)){case"object":if(e instanceof Date)return f.fromDate(e);case"boolean":return f.fromBoolean(e);case"number":return f.fromNumber(e);case"string":return new f(e)}throw new Error("Can't make literal from "+e+" of type "+(0,h.Z)(e))}}]),f}(d.Z);function b(e){return null==e||(0,g.jt)(e)?e:Array.isArray(e)?new w(e):y.fromValue(e)}var w=function(e){(0,a.Z)(h,e);var t,r,d=(t=h,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,c.Z)(t);if(r){var i=(0,c.Z)(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return(0,s.Z)(this,e)});function h(e){var t;return(0,i.Z)(this,h),t=d.call(this,(f.nextId++).toString()),(0,u.Z)((0,o.Z)(t),"termType",p.fb),(0,u.Z)((0,o.Z)(t),"classOrder",l.Z.Collection),(0,u.Z)((0,o.Z)(t),"closed",!1),(0,u.Z)((0,o.Z)(t),"compareTerm",f.prototype.compareTerm),(0,u.Z)((0,o.Z)(t),"elements",[]),(0,u.Z)((0,o.Z)(t),"isVar",0),e&&e.length>0&&e.forEach((function(e){t.elements.push(b(e))})),t}return(0,n.Z)(h,[{key:"id",get:function(){return this.value},set:function(e){this.value=e}},{key:"append",value:function(e){return this.elements.push(e)}},{key:"close",value:function(){return this.closed=!0,this.closed}},{key:"shift",value:function(){return this.elements.shift()}},{key:"substitute",value:function(e){return new h(this.elements.map((function(t){return t.substitute(e)})))}},{key:"toNT",value:function(){return h.toNT(this)}},{key:"toString",value:function(){return"("+this.elements.join(" ")+")"}},{key:"unshift",value:function(e){return this.elements.unshift(e)}}],[{key:"toNT",value:function(e){return f.NTAnonymousNodePrefix+e.id}}]),h}(d.Z);(0,u.Z)(w,"termType",p.fb);var x=function(e){(0,a.Z)(d,e);var t,r,l=(t=d,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,c.Z)(t);if(r){var i=(0,c.Z)(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return(0,s.Z)(this,e)});function d(){var e;return(0,i.Z)(this,d),e=l.call(this,""),(0,u.Z)((0,o.Z)(e),"termType",p.ls),e}return(0,n.Z)(d,[{key:"toString",value:function(){return"()"}}]),d}(d.Z);function _(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}function E(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){_(o,n,i,a,s,"next",e)}function s(e){_(o,n,i,a,s,"throw",e)}a(void 0)}))}}var k=r(4687),S=r.n(k),A="chrome:theSession";new m.Z(A);var C=function(e){(0,a.Z)(d,e);var t,r,l=(t=d,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,c.Z)(t);if(r){var i=(0,c.Z)(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return(0,s.Z)(this,e)});function d(){var e;return(0,i.Z)(this,d),e=l.call(this,""),(0,u.Z)((0,o.Z)(e),"value",""),(0,u.Z)((0,o.Z)(e),"termType",p.NK),(0,u.Z)((0,o.Z)(e),"uri",A),e}return(0,n.Z)(d,[{key:"toCanonical",value:function(){return this.value}},{key:"toString",value:function(){return"DefaultGraph"}}]),d}(d.Z);function T(e){return!!e&&e.termType===p.NK}var O=new C,P=function(){function e(t,r,n,o){(0,i.Z)(this,e),(0,u.Z)(this,"subject",void 0),(0,u.Z)(this,"predicate",void 0),(0,u.Z)(this,"object",void 0),(0,u.Z)(this,"graph",void 0),this.subject=d.Z.fromValue(t),this.predicate=d.Z.fromValue(r),this.object=d.Z.fromValue(n),this.graph=null==o?O:d.Z.fromValue(o)}return(0,n.Z)(e,[{key:"why",get:function(){return this.graph},set:function(e){this.graph=e}},{key:"equals",value:function(e){return e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}},{key:"substitute",value:function(t){return new e(this.subject.substitute(t),this.predicate.substitute(t),this.object.substitute(t),T(this.graph)?this.graph:this.graph.substitute(t))}},{key:"toCanonical",value:function(){var e=[this.subject.toCanonical(),this.predicate.toCanonical(),this.object.toCanonical()];return this.graph&&this.graph.termType!==p.NK&&e.push(this.graph.toCanonical()),e.join(" ")+" ."}},{key:"toNT",value:function(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT()].join(" ")+" ."}},{key:"toNQ",value:function(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT(),T(this.graph)?"":this.graph.toNT()].join(" ")+" ."}},{key:"toString",value:function(){return this.toNT()}}]),e}(),F=r(1609);var I,N=function(e){(0,a.Z)(f,e);var t,r,d=(t=f,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,c.Z)(t);if(r){var i=(0,c.Z)(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return(0,s.Z)(this,e)});function f(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,i.Z)(this,f),e=d.call(this,t),(0,u.Z)((0,o.Z)(e),"termType",p.UH),(0,u.Z)((0,o.Z)(e),"base","varid:"),(0,u.Z)((0,o.Z)(e),"classOrder",l.Z.Variable),(0,u.Z)((0,o.Z)(e),"isVar",1),(0,u.Z)((0,o.Z)(e),"uri",void 0),e.base="varid:",e.uri=F.join(t,e.base),e}return(0,n.Z)(f,[{key:"equals",value:function(e){return!!e&&this.termType===e.termType&&this.value===e.value}},{key:"hashString",value:function(){return this.toString()}},{key:"substitute",value:function(e){var t;return null!=(t=e[this.toNT()])?t:this}},{key:"toString",value:function(){return f.toString(this)}}],[{key:"toString",value:function(e){return e.uri.slice(0,e.base.length)===e.base?"?".concat(e.uri.slice(e.base.length)):"?".concat(e.uri)}}]),f}(d.Z),j=function(e){return e.collections="COLLECTIONS",e.defaultGraphType="DEFAULT_GRAPH_TYPE",e.equalsMethod="EQUALS_METHOD",e.id="ID",e.identity="IDENTITY",e.reversibleId="REVERSIBLE_ID",e.variableType="VARIABLE_TYPE",e}({}),R=new C,L={supports:(I={},(0,u.Z)(I,j.collections,!1),(0,u.Z)(I,j.defaultGraphType,!1),(0,u.Z)(I,j.equalsMethod,!0),(0,u.Z)(I,j.identity,!1),(0,u.Z)(I,j.id,!0),(0,u.Z)(I,j.reversibleId,!1),(0,u.Z)(I,j.variableType,!0),I),blankNode:function(e){return new f(e)},defaultGraph:function(){return R},equals:function(e,t){return e===t||!e||!t||((0,g.PY)(e)||(0,g.PY)(t)?!(!(0,g.PY)(e)||!(0,g.PY)(t))&&this.equals(e.subject,t.subject)&&this.equals(e.predicate,t.predicate)&&this.equals(e.object,t.object)&&this.equals(e.graph,t.graph):!(!(0,g.jt)(e)||!(0,g.jt)(t))&&this.id(e)===this.id(t))},id:function(e){if(!e)return"undefined";if((0,g.PY)(e))return this.quadToNQ(e);switch(e.termType){case p.NK:return"defaultGraph";case p.UH:return N.toString(e);default:var t=this.termToNQ(e);if(t)return t;throw new Error("Can't id term with type '".concat(e.termType,"'"))}},isQuad:function(e){return e instanceof P},literal:function(e,t){if("string"!=typeof e&&!t)return y.fromValue(e);var r="string"==typeof e?e:""+e;return"string"==typeof t?-1===t.indexOf(":")?new y(r,t):new y(r,null,this.namedNode(t)):new y(r,null,t)},namedNode:function(e){return new m.Z(e)},quad:function(e,t,r,n){return new P(e,t,r,n||R)},triple:function(e,t,r,n){return this.quad(e,t,r,n)},quadToNQ:function(e){return"".concat(this.termToNQ(e.subject)," ").concat(this.termToNQ(e.predicate)," ").concat(this.termToNQ(e.object)," ").concat(this.termToNQ(e.graph)," .")},termToNQ:function(e){var t=this;switch(e.termType){case p.V1:return"_:"+e.value;case p.NK:return"";case p.ls:return"<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil>";case p.xH:return y.toNT(e);case p._A:case p.XM:return"<"+e.value+">";case p.fb:return"("+e.elements.map((function(e){return t.termToNQ(e)})).join(" ")+")";default:throw new Error("Can't serialize nonstandard term type (was '".concat(e.termType,"')"))}},toNQ:function(e){return this.isQuad(e)?this.quadToNQ(e):this.termToNQ(e)},variable:function(e){return new N(e)}};const D=L;var M=r(1369);function U(e,t){var r=t||{namedNode:function(e){return new m.Z(e)}};return function(t){return r.namedNode(e+(t||""))}}var B=r(1048);function H(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D;return{boolean:e.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:e.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:e.namedNode("http://www.w3.org/2001/XMLSchema#decimal"),double:e.namedNode("http://www.w3.org/2001/XMLSchema#double"),integer:e.namedNode("http://www.w3.org/2001/XMLSchema#integer"),langString:e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:e.namedNode("http://www.w3.org/2001/XMLSchema#string")}}H(D);var q=r(3180),K=r.n(q),W=r(6913);function V(e){return new z(e)}var z=function(){function e(t){(0,i.Z)(this,e),(0,u.Z)(this,"_notQNameChars","\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~"),(0,u.Z)(this,"_notNameChars",this._notQNameChars+":"),(0,u.Z)(this,"validPrefix",new RegExp(/^[a-zA-Z][a-zA-Z0-9]*$/)),(0,u.Z)(this,"forbidden1",new RegExp(/[\\"\b\f\r\v\t\n\u0080-\uffff]/gm)),(0,u.Z)(this,"forbidden3",new RegExp(/[\\"\b\f\r\v\u0080-\uffff]/gm)),this.flags="",this.base=null,this.prefixes=[],this.namespaces=[];var r=Object.keys(K()());for(var n in r){var o=K()()[r[n]](""),a=r[n];this.prefixes[o]=a,this.namespaces[a]=o}this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.suggestPrefix("xml","reserved:reservedForFutureUse"),this.namespacesUsed=[],this.keywords=["a"],this.prefixchars="abcdefghijklmnopqustuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",this.incoming=null,this.formulas=[],this.store=t,this.rdfFactory=t.rdfFactory||D,this.xsd=H(this.rdfFactory)}return(0,n.Z)(e,[{key:"setBase",value:function(e){return this.base=e,this}},{key:"setFlags",value:function(e){return this.flags=e||"",this}},{key:"toStr",value:function(e){var t=e.toNT();return"Graph"===e.termType&&(this.formulas[t]=e),t}},{key:"fromStr",value:function(e){if("{"===e[0]){var t=this.formulas[e];return t||console.log("No formula object for "+e),t}return this.store.fromNT(e)}},{key:"setNamespaces",value:function(e){for(var t in e)this.setPrefix(t,e[t]);return this}},{key:"setPrefix",value:function(e,t){if("default"!==e.slice(0,7)&&"ns"!==e.slice(0,2)&&e&&t){for(var r in this.prefixes)this.prefixes[r]==e&&delete this.prefixes[r];this.prefixes[t]=e,this.namespaces[e]=t}}},{key:"suggestPrefix",value:function(e,t){"default"!==e.slice(0,7)&&"ns"!==e.slice(0,2)&&e&&t&&(e in this.namespaces||t in this.prefixes||(this.prefixes[t]=e,this.namespaces[e]=t))}},{key:"suggestNamespaces",value:function(e){for(var t in e)this.suggestPrefix(t,e[t]);return this}},{key:"checkIntegrity",value:function(){var e,t;for(e in this.namespaces)if(this.prefixes[this.namespaces[e]]!==e)throw new Error("Serializer integity error 1: "+e+", "+this.namespaces[e]+", "+this.prefixes[this.namespaces[e]]+"!");for(t in this.prefixes)if(this.namespaces[this.prefixes[t]]!==t)throw new Error("Serializer integity error 2: "+t+", "+this.prefixs[t]+", "+this.namespaces[this.prefixes[t]]+"!")}},{key:"makeUpPrefix",value:function(e){var t=e,r=function(t){return!!this.validPrefix.test(t)&&"ns"!==t&&!(t in this.namespaces)&&(this.prefixes[e]=t,this.namespaces[t]=e,t)}.bind(this);"#/".indexOf(t[t.length-1])>=0&&(t=t.slice(0,-1));var n=t.lastIndexOf("/");n>=0&&(t=t.slice(n+1));for(var i=0;i<t.length&&this.prefixchars.indexOf(t[i]);)i++;if((t=t.slice(0,i)).length<6&&r(t))return t;if(r(t.slice(0,3)))return t.slice(0,3);if(r(t.slice(0,2)))return t.slice(0,2);if(r(t.slice(0,4)))return t.slice(0,4);if(r(t.slice(0,1)))return t.slice(0,1);if(r(t.slice(0,5)))return t.slice(0,5);this.validPrefix.test(t)||(t="n");for(var o=0;;o++)if(r(t.slice(0,3)+o))return t.slice(0,3)+o}},{key:"rootSubjects",value:function(e){for(var t={},r={},n={},i=0;i<e.length;i++){var o=e[i],a=function(e){t.hasOwnProperty(e)||(t[e]=[]),t[e].push(o.subject)};[o.subject,o.predicate,o.object].map((function(e){"BlankNode"===e.termType?n[e.toNT()]=!0:"Collection"===e.termType&&e.elements.forEach((function(e){a(e)}))})),a(e[i].object);var s=r[this.toStr(o.subject)];s||(s=[]),s.push(o),r[this.toStr(o.subject)]=s}var c=[];for(var u in r)if(r.hasOwnProperty(u)){var l=this.fromStr(u);"BlankNode"===l.termType&&t[l]&&1===t[l].length||c.push(l)}this.incoming=t;for(var d={},p=0;p<c.length;p++)d[c[p].toNT()]=!0;return{roots:c,subjects:r,rootsHash:d,incoming:t}}},{key:"toN3",value:function(e){return this.statementsToN3(e.statements)}},{key:"explicitURI",value:function(e){return"<"+(e=this.flags.indexOf("r")<0&&this.base?F.refTo(this.base,e):this.flags.indexOf("u")>=0?function(e){for(var t,r="",n=0;n<e.length;n++)r+=(t=e.charCodeAt(n))>65535?"\\U"+("00000000"+t.toString(16)).slice(-8):t>126?"\\u"+("0000"+t.toString(16)).slice(-4):e[n];return r}(e):encodeURI(e))+">"}},{key:"statementsToNTriples",value:function(e){var t=e.slice();t.sort();for(var r="",n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i=this,o=this.store,a=this.rdfFactory,s=function e(t){if("Collection"!==t.termType)return i.atomicTermToN3(t);for(var s=t.elements,c=o.sym(n+"nill"),u=s.length-1;u>=0;u--){var l=a.blankNode();r+=e(l)+" "+e(o.sym(n+"first"))+" "+e(s[u])+".\n",r+=e(l)+" "+e(o.sym(n+"rest"))+" "+e(c)+".\n",c=l}return i.atomicTermToN3(c)},c=0;c<t.length;c++){var u=t[c],l="";l+=s(u.subject)+" ",l+=s(u.predicate)+" ",l+=s(u.object)+" ",this.flags.indexOf("q")>=0&&(l+=s(u.why)+" "),r+=l+=".\n"}return r}},{key:"statementsToN3",value:function(t){var r=this.store,n={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":"aaa:00"};t.sort((function(e,t){return B.heavyCompareSPO(e,t,r,n)})),this.base&&!this.defaultNamespace&&(this.defaultNamespace=this.base+"#");var i={};this.flags.indexOf("s")<0&&(i["http://www.w3.org/2002/07/owl#sameAs"]="="),this.flags.indexOf("t")<0&&(i["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"]="a"),this.flags.indexOf("i")<0&&(i["http://www.w3.org/2000/10/swap/log#implies"]="=>");var o=function(e){for(var t="",r=0;r<e;r++)t+=" ";return t},a=function e(t){for(var r="",n=0;n<t.length;n++){var i=t[n],o="string"==typeof i?i:e(i);if(0!==n){var a=r.slice(-1)||" ";","===o||";"===o||("."!==o||"0123456789.:".includes(a))&&(r+=" ")}r+=o}return r},s=function(e){for(var t=this.rootSubjects(e),r=t.roots,n=[],i=0;i<r.length;i++){var o=r[i];n.push(c(o,t))}return n}.bind(this);function c(e,t){return"BlankNode"!==e.termType||t.incoming[e]?[d(e,t)].concat([u(e,t)]).concat(["."]):l(e,t,!0).concat(["."])}var u=function(e,t){var r=[],n=null,o=t.subjects[this.toStr(e)]||[];if(void 0===o)throw new Error("Cant find statements for "+e);for(var a=[],s=0;s<o.length;s++){var c=o[s];c.predicate.uri===n?a.push(","):(n&&(r=r.concat([a]).concat([";"]),a=[]),r.push(i[c.predicate.uri]?i[c.predicate.uri]:d(c.predicate,t))),n=c.predicate.uri,a.push(l(c.object,t))}return r.concat([a])}.bind(this),l=function(e,t,r){return"BlankNode"!==e.termType||!r&&void 0!==t.rootsHash[e.toNT()]?d(e,t):t.subjects[this.toStr(e)]?["[",u(e,t),"]"]:"[]"}.bind(this);e.prototype.termToN3=d;var d=function(e,t){var r,n;switch(e.termType){case"Graph":return(n=(n=["{"]).concat(s(e.statements))).concat(["}"]);case"Collection":for(n=["("],r=0;r<e.elements.length;r++)n.push([l(e.elements[r],t)]);return n.push(")"),n;default:return this.atomicTermToN3(e)}}.bind(this),p=function(){var e="";for(var t in this.flags.indexOf("d")<0&&this.defaultNamespace&&(e+="@prefix : "+this.explicitURI(this.defaultNamespace)+".\n"),this.prefixes)this.prefixes.hasOwnProperty(t)&&this.namespacesUsed[t]&&(e+="@prefix "+this.prefixes[t]+": "+this.explicitURI(t)+".\n");return e+"\n"}.bind(this),f=s(t);return p()+function e(t,r){var n="",i=1e5;void 0===r&&(r=-1);for(var s=0;s<t.length;s++){var c=t[s];if("string"!=typeof c){var u=e(c,r+1);if(u.length<10*(80-4*r)&&u.indexOf('"""')<0){var l=a(c);l.length<80-4*r&&(c=l,u="")}u&&(i=1e4),n+=u}if("string"==typeof c){if(1===c.length&&"\n"===n.slice(-1)&&",.;".indexOf(c)>=0){n=n.slice(0,-1),"."==c&&"0123456789.:".includes(n.charAt(n.length-1))&&(n+=" ",i+=1),n+=c+"\n",i+=1;continue}if(i<4*r+4||i+c.length+1<80&&";.".indexOf(n[n.length-2])<0)n=n.slice(0,-1)+" "+c+"\n",i+=c.length+1;else{var d=o(4*r)+c;n+=d+"\n",i=d.length,r<0&&(n+="\n",i=1e5)}}}return n}(f)}},{key:"atomicTermToN3",value:function(e,t){switch(e.termType){case"BlankNode":case"Variable":return e.toNT();case"Literal":var r=e.value;if("string"!=typeof r)throw new TypeError("Value of RDF literal node must be a string");if(e.datatype&&this.flags.indexOf("x")<0)switch(e.datatype.uri){case"http://www.w3.org/2001/XMLSchema#integer":return r;case"http://www.w3.org/2001/XMLSchema#decimal":return r.indexOf(".")<0&&(r+=".0"),r;case"http://www.w3.org/2001/XMLSchema#double":var n=r.toLowerCase().indexOf("e")>0;return r.indexOf(".")<0&&!n&&(r+=".0"),n||(r+="e0"),r;case"http://www.w3.org/2001/XMLSchema#boolean":return"1"===e.value?"true":"false"}var i=this.stringToN3(e.value);return e.language?i+="@"+e.language:e.datatype.equals(this.xsd.string)||(i+="^^"+this.atomicTermToN3(e.datatype,t)),i;case"NamedNode":return this.symbolToN3(e);case"DefaultGraph":return"";default:throw new Error("Internal: atomicTermToN3 cannot handle "+e+" of termType: "+e.termType)}}},{key:"stringToN3",value:function(e,t){t||(t="e");var r,n,i,o,a,s="";for(e.length>20&&'"'!==e.slice(-1)&&t.indexOf("n")<0&&(e.indexOf("\n")>0||e.indexOf('"')>0)?(o='"""',a=this.forbidden3):(o='"',a=this.forbidden1),r=0;r<e.length&&(a.lastIndex=0,null!=a.exec(e.slice(r)));){n=r+a.lastIndex-1,s+=e.slice(r,n);var c=e[n];'"'===c&&'"""'===o&&'"""'!==e.slice(n,n+3)?s+=c:(i='\b\f\r\t\v\n\\"'.indexOf(c))>=0?s+="\\"+'bfrtvn\\"'[i]:t.indexOf("e")>=0?s+="\\u"+("000"+c.charCodeAt(0).toString(16).toLowerCase()).slice(-4):s+=c,r=n+1}return o+s+e.slice(r)+o}},{key:"symbolToN3",value:function(e){var t=e.uri,r=t.indexOf("#");if(r<0&&this.flags.indexOf("/")<0&&(r=t.lastIndexOf("/")),r>=0&&this.flags.indexOf("p")<0&&(0===t.indexOf("http")||0===t.indexOf("ws")||0===t.indexOf("file"))){for(var n=!0,i=r+1;i<t.length;i++)if(this._notNameChars.indexOf(t[i])>=0){n=!1;break}if(n){var o=t.slice(r+1),a=t.slice(0,r+1);if(this.defaultNamespace&&this.defaultNamespace===a&&this.flags.indexOf("d")<0)return this.flags.indexOf("k")>=0&&this.keyords.indexOf(o)<0?o:":"+o;var s=this.prefixes[a];if(s||(s=this.makeUpPrefix(a)),s)return this.namespacesUsed[a]=!0,s+":"+o}}return this.explicitURI(t)}},{key:"writeStore",value:function(e){var t=this.store,r=t.fetcher,n=r&&r.appNode,i=this.store.index[3];for(var o in i){var a=t.fromNT(o);n&&a.equals(n)||e("\n"+this.atomicTermToN3(a)+" "+this.atomicTermToN3(t.sym("http://www.w3.org/2000/10/swap/log#semantics"))+" { "+this.statementsToN3(t.statementsMatching(void 0,void 0,void 0,a))+" }.\n")}t.statementsMatching(void 0,t.sym("http://www.w3.org/2007/ont/link#requestedURI")).map((function(r){e("\n<"+r.object.value+"> log:metadata {\n");var n=t.statementsMatching(void 0,void 0,void 0,r.subject);e(this.statementsToN3(this.statementsToN3(n))),e("}.\n")}));var s=[];n&&s.push(n);var c=[];s.map((function(e){c=c.concat(t.statementsMatching(void 0,void 0,void 0,e))})),e(this.statementsToN3(c))}},{key:"statementsToXML",value:function(e){var t=[];t["http://www.w3.org/1999/02/22-rdf-syntax-ns#"]=!0;var r="http://www.w3.org/1999/02/22-rdf-syntax-ns#_",n=function(e){for(var t="",r=0;r<e;r++)t+=" ";return t},i=function e(t){for(var r="",n=0;n<t.length;n++){var i=t[n];r+="string"==typeof i?i:e(i)}return r},o=function(e){this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");for(var t=this.rootSubjects(e),r=t.roots,n=[],i=0;i<r.length;i++){var o=r[i];n.push(c(o,t))}return n}.bind(this);function a(e){return void 0===e?"@@@undefined@@@@":e.replace(/[&<"]/g,(function(e){switch(e[0]){case"&":return"&amp;";case"<":return"&lt;";case'"':return"&quot;"}}))}var s=function(e){return a(this.base?F.refTo(this.base,e.uri):e.uri)}.bind(this),c=function(e,t){var n,i,o,p,f=[],h=t.subjects[this.toStr(e)];if(void 0===h)return l(e,t);h.sort((function(e,t){var n=e.predicate.uri,i=t.predicate.uri;if(n.substring(0,r.length)===r||i.substring(0,r.length)===r)return n.localeCompare(i);var o=n.substring(r.length),a=i.substring(r.length),s=parseInt(o,10),c=parseInt(a,10);return isNaN(s)||isNaN(c)||s!==o||c!==a?n.localeCompare(i):s-c}));for(var m=0;m<h.length;m++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"!==(o=h[m]).predicate.uri||n||"NamedNode"!==o.object.termType){if((p=o.predicate).uri.substr(0,r.length)===r){var g=p.uri.substr(r.length);g===parseInt(g,10).toString()&&(p=this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#li"))}switch(i=d(p),o.object.termType){case"BlankNode":f=1===t.incoming[o.object].length?f.concat(["<"+i+' rdf:parseType="Resource">',c(o.object,t),"</"+i+">"]):f.concat(["<"+i+' rdf:nodeID="'+o.object.toNT().slice(2)+'"/>']);break;case"NamedNode":f=f.concat(["<"+i+' rdf:resource="'+s(o.object)+'"/>']);break;case"Literal":f=f.concat(["<"+i+(o.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+a(o.object.datatype.uri)+'"')+(o.object.language?' xml:lang="'+o.object.language+'"':"")+">"+a(o.object.value)+"</"+i+">"]);break;case"Collection":f=f.concat(["<"+i+' rdf:parseType="Collection">',u(o.object,t),"</"+i+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}else n=o.object;var v=n?d(n):"rdf:Description",y="";return"BlankNode"===e.termType?t.incoming[e]&&1===t.incoming[e].length||(y=' rdf:nodeID="'+e.toNT().slice(2)+'"'):y=' rdf:about="'+s(e)+'"',["<"+v+y+">"].concat([f]).concat(["</"+v+">"])}.bind(this);function u(e,t){for(var r=[],n=0;n<e.elements.length;n++)r.push(c(e.elements[n],t));return r}var l=function(e,t){var r=[],n=t.subjects[this.toStr(e)];if(!n)return r;n.sort();for(var i=0;i<n.length;i++){var o=n[i];switch(o.object.termType){case"BlankNode":r=t.rootsHash[o.object.toNT()]?r.concat(["<"+d(o.predicate)+' rdf:nodeID="'+o.object.toNT().slice(2)+'">',"</"+d(o.predicate)+">"]):r.concat(["<"+d(o.predicate)+' rdf:parseType="Resource">',l(o.object,t),"</"+d(o.predicate)+">"]);break;case"NamedNode":r=r.concat(["<"+d(o.predicate)+' rdf:resource="'+s(o.object)+'"/>']);break;case"Literal":r=r.concat(["<"+d(o.predicate)+(o.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+a(o.object.datatype.value)+'"')+(o.object.language?' xml:lang="'+o.object.language+'"':"")+">"+a(o.object.value)+"</"+d(o.predicate)+">"]);break;case"Collection":r=r.concat(["<"+d(o.predicate)+' rdf:parseType="Collection">',u(o.object,t),"</"+d(o.predicate)+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}return r}.bind(this),d=function(e){var r=e.uri,n=r.indexOf("#");if(n<0&&this.flags.indexOf("/")<0&&(n=r.lastIndexOf("/")),n<0)throw new Error("Cannot make qname out of <"+r+">");for(var i=n+1;i<r.length;i++)if(this._notNameChars.indexOf(r[i])>=0)throw new Error('Invalid character "'+r[i]+'" cannot be in XML qname for URI: '+r);var o=r.slice(n+1),a=r.slice(0,n+1);if(this.defaultNamespace&&this.defaultNamespace===a&&this.flags.indexOf("d")<0)return o;var s=this.prefixes[a];return s||(s=this.makeUpPrefix(a)),t[a]=!0,s+":"+o}.bind(this),p=o(e),f="<rdf:RDF";for(var h in this.defaultNamespace&&(f+=' xmlns="'+a(this.defaultNamespace)+'"'),t)if(t.hasOwnProperty(h)){var m=this.base&&this.flags.includes("z")?F.refTo(this.base,h):h;f+="\n xmlns:"+this.prefixes[h]+'="'+a(m)+'"'}return function e(t,r){var o,a="",s=1e5;r||(r=0);for(var c=0;c<t.length;c++){var u=t[c];if("string"!=typeof u){var l=e(u,r+1);l.length<10*(80-4*r)&&l.indexOf('"""')<0&&(o=i(u)).length<80-4*r&&(u=" "+o,l=""),l&&(s=1e4),a+=l}"string"==typeof u&&(s<4*r+4?(a=a.slice(0,-1)+" "+u+"\n",s+=u.length+1):(a+=(o=n(4*r)+u)+"\n",s=o.length))}return a}([f+=">",p,"</rdf:RDF>"],-1)}},{key:"statementsToJsonld",value:function(e){var t=this.statementsToN3(e),r=W.parse(t);return JSON.stringify(r,null,2)}}]),e}();function J(e,t,r,n,i,o){r=r||(null==e?void 0:e.value);var a=o||{};n=n||p.z8;try{var s=V(t);a.flags&&s.setFlags(a.flags);var c=t.statementsMatching(void 0,void 0,void 0,e);switch("namespaces"in t&&s.suggestNamespaces(t.namespaces),a.namespaces&&s.setNamespaces(a.namespaces),s.setBase(r),n){case p.Is:return u(null,s.statementsToXML(c));case p.qS:case p.sZ:return u(null,s.statementsToN3(c));case p.z8:case p.Eo:return s.setFlags("si"),u(null,s.statementsToN3(c));case p.aV:return s.setFlags("deinprstux"),u(null,s.statementsToNTriples(c));case p.ui:return s.setFlags("si dr"),u(null,s.statementsToJsonld(c));case p.b4:case p.lL:return s.setFlags("deinprstux q"),u(null,s.statementsToNTriples(c));default:throw new Error("Serialize: Content-type "+n+" not supported for data write.")}}catch(e){if(i)return i(e,void 0);throw e}function u(e,t){return i?void i(e,t):t}}var Z=["blankNode","defaultGraph","literal","namedNode","quad","variable","supports"],$="http://www.w3.org/1999/02/22-rdf-syntax-ns#rest";function G(e,t,r){var n=[];return r.reduce((function(t,r,i,o){var a;return n.push(e.quad(t,e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),o[i])),i<o.length-1?(a=e.blankNode(),n.push(e.quad(t,e.namedNode($),a))):n.push(e.quad(t,e.namedNode($),e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"))),a}),t),n}function X(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=e.length;for(r<0&&(r=n+r);r<n;r++)if(e[r]===t)return r;return-1}function Y(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Q(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Q(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ee=function(e){(0,a.Z)(h,e);var t,r,f=(t=h,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,c.Z)(t);if(r){var i=(0,c.Z)(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return(0,s.Z)(this,e)});function h(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};(0,i.Z)(this,h),(e=f.call(this,"")).statements=t,e.constraints=r,e.initBindings=n,e.optional=a,(0,u.Z)((0,o.Z)(e),"termType",p._A),(0,u.Z)((0,o.Z)(e),"classOrder",l.Z.Graph),(0,u.Z)((0,o.Z)(e),"fetcher",void 0),(0,u.Z)((0,o.Z)(e),"isVar",0),(0,u.Z)((0,o.Z)(e),"ns",U),(0,u.Z)((0,o.Z)(e),"rdfFactory",void 0),e.rdfFactory=s&&s.rdfFactory||D;var c,d=Y(Z);try{var m=function(){var t=c.value;e[t]=function(){var r;return(r=e.rdfFactory)[t].apply(r,arguments)}};for(d.s();!(c=d.n()).done;)m()}catch(e){d.e(e)}finally{d.f()}return e}return(0,n.Z)(h,[{key:"add",value:function(e,t,r,n){var i=this;return 1===arguments.length&&e.forEach((function(e){return i.add(e.subject,e.predicate,e.object,e.graph)})),this.statements.push(this.rdfFactory.quad(e,t,r,n))}},{key:"addStatement",value:function(e){return this.add(e)}},{key:"bnode",value:function(e){return this.rdfFactory.blankNode(e)}},{key:"addAll",value:function(e){var t=this;e.forEach((function(e){t.add(e.subject,e.predicate,e.object,e.graph)}))}},{key:"any",value:function(e,t,r,n){var i=this.anyStatementMatching(e,t,r,n);return null==i?null:null==e?i.subject:null==t?i.predicate:null==r?i.object:null}},{key:"anyValue",value:function(e,t,r,n){var i=this.any(e,t,r,n);return i?i.value:void 0}},{key:"anyJS",value:function(e,t,r,n){var i=this.any(e,t,r,n);return i?d.Z.toJS(i):void 0}},{key:"anyStatementMatching",value:function(e,t,r,n){var i=this.statementsMatching(e,t,r,n,!0);if(i&&0!==i.length)return i[0]}},{key:"id",value:function(e){return this.rdfFactory.id(e)}},{key:"statementsMatching",value:function(e,t,r,n,i){var o=this.statements.filter((function(i){return(!e||e.equals(i.subject))&&(!t||t.equals(i.predicate))&&(!r||r.equals(i.object))&&(!n||n.equals(i.graph))}));return i?0===o.length?[]:[o[0]]:o}},{key:"bottomTypeURIs",value:function(e){var t,r,n,i,o,a;for(var s in t=[],e)if(e.hasOwnProperty(s)){for(a=e[s],r=!0,n=0,i=(o=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),this.rdfFactory.namedNode(s))).length;n<i;n++)if(o[n].uri in e){r=!1;break}r&&(t[s]=a)}return t}},{key:"collection",value:function(){return new w}},{key:"each",value:function(e,t,r,n){var i=[],o=this.statementsMatching(e,t,r,n,!1);if(null==e)for(var a=0,s=o.length;a<s;a++)i.push(o[a].subject);else if(null==t)for(var c=0,u=o.length;c<u;c++)i.push(o[c].predicate);else if(null==r)for(var l=0,d=o.length;l<d;l++)i.push(o[l].object);else if(null==n)for(var p=0,f=o.length;p<f;p++)i.push(new m.Z(o[p].graph.value));return i}},{key:"equals",value:function(e){return!!e&&this.hashString()===e.hashString()}},{key:"findMembersNT",value:function(e){var t,r,n,i,o,a,s,c,u,l,d,p,f,h;for(var m in(p={})[e.toNT()]=!0,i={},a=this.transitiveClosure(p,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0))if(a.hasOwnProperty(m)){for(var g=0,v=(s=this.statementsMatching(void 0,this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.fromNT(m))).length;g<v;g++)i[(f=s[g]).subject.toNT()]=f;for(var y=0,b=(c=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"),this.fromNT(m))).length;y<b;y++)for(o=c[y],n=0,t=(u=this.statementsMatching(void 0,o)).length;n<t;n++)i[(f=u[n]).subject.toNT()]=f;for(var w=0,x=(l=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"),this.fromNT(m))).length;w<x;w++)for(o=l[w],h=0,r=(d=this.statementsMatching(void 0,o)).length;h<r;h++)i[(f=d[h]).object.toNT()]=f}return i}},{key:"findMemberURIs",value:function(e){return this.NTtoURI(this.findMembersNT(e))}},{key:"findSubClassesNT",value:function(e){var t={};return t[e.toNT()]=!0,this.transitiveClosure(t,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0)}},{key:"findSuperClassesNT",value:function(e){var t={};return t[e.toNT()]=!0,this.transitiveClosure(t,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}},{key:"findTypesNT",value:function(e){var t,r,n,i,o,a;a=[];for(var s=0,c=(t=this.statementsMatching(e,void 0,void 0)).length;s<c;s++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===(o=t[s]).predicate.uri)a[o.object.toNT()]=o;else for(var u=0,l=(r=this.each(o.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"))).length;u<l;u++)a[r[u].toNT()]=o;for(var d=0,p=(n=this.statementsMatching(void 0,void 0,e)).length;d<p;d++){o=n[d];for(var f=0,h=(i=this.each(o.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"))).length;f<h;f++)a[i[f].toNT()]=o}return this.transitiveClosure(a,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}},{key:"findTypeURIs",value:function(e){return this.NTtoURI(this.findTypesNT(e))}},{key:"connectedStatements",value:function(e,t,r){r=r||[];for(var n=[e],i={},o={},a=[],s=this,c=function(e){var c=function(e){"BlankNode"!==e.termType||i[e.value]||(i[e.value]=!0,n.push(e))},u=s.statementsMatching(null,null,e,t).concat(s.statementsMatching(e,null,null,t));u=u.filter((function(e){if(r[e.predicate.value])return!1;var t=e.toNT();return!o[t]&&(o[t]=!0,!0)})),u.forEach((function(e){c(e.subject),c(e.object)})),a=a.concat(u)};n.length;)c(n.shift());return a}},{key:"formula",value:function(e){return new h}},{key:"fromNT",value:function(e){var t,r,n;switch(e[0]){case"<":return this.sym(e.slice(1,-1));case'"':if(n=void 0,t=void 0,(r=e.lastIndexOf('"'))<e.length-1)if("@"===e[r+1])n=e.slice(r+2);else{if("^^"!==e.slice(r+1,r+3))throw new Error("Can't convert string from NT: "+e);t=this.fromNT(e.slice(r+3))}return e=(e=(e=(e=e.slice(1,r)).replace(/\\"/g,'"')).replace(/\\n/g,"\n")).replace(/\\\\/g,"\\"),this.rdfFactory.literal(e,n||t);case"_":return this.rdfFactory.blankNode(e.slice(2));case"?":return new N(e.slice(1))}throw new Error("Can't convert from NT: "+e)}},{key:"holds",value:function(e,t,r,n){var i;if(1===arguments.length){if(!e)return!0;if(e instanceof Array){for(i=0;i<e.length;i++)if(!this.holds(e[i]))return!1;return!0}if((0,g.Yi)(e))return this.holds(e.subject,e.predicate,e.object,e.graph);if(e.statements)return this.holds(e.statements)}var o=this.anyStatementMatching(e,t,r,n);return null!=o}},{key:"holdsStatement",value:function(e){return this.holds(e.subject,e.predicate,e.object,e.graph)}},{key:"list",value:function(e,t){if(t.rdfFactory.supports.COLLECTIONS){var r=t.rdfFactory.collection();return e.forEach((function(e){r.append(e)})),r}var n=t.rdfFactory.blankNode(),i=G(t.rdfFactory,n,e);return t.addAll(i),n}},{key:"NTtoURI",value:function(e){var t,r,n={};for(t in e)e.hasOwnProperty(t)&&(r=e[t],"<"===t[0]&&(n[t.slice(1,-1)]=r));return n}},{key:"serialize",value:function(e,t,r,n){return J(r,this,e,t,void 0,n)}},{key:"substitute",value:function(e){var t=this.statements.map((function(t){return t.substitute(e)})),r=new h;return r.addAll(t),r}},{key:"sym",value:function(e,t){if(t)throw new Error("This feature (kb.sym with 2 args) is removed. Do not assume prefix mappings.");return this.rdfFactory.namedNode(e)}},{key:"the",value:function(e,t,r,n){var i=this.any(e,t,r,n);return null==i&&M.Z.error("No value found for the() {"+e+" "+t+" "+r+"}."),i}},{key:"transitiveClosure",value:function(e,t,r){var n,i,o,a,s,c={};Object.assign(c,e);for(var u={};;){if(null==(s=function(){for(var e in c)if(c.hasOwnProperty(e))return e}()))return u;for(n=0,i=(a=r?this.each(void 0,t,this.fromNT(s)):this.each(this.fromNT(s),t)).length;n<i;n++)(o=a[n].toNT())in u||o in c||(c[o]=c[s]);u[s]=c[s],delete c[s]}}},{key:"topTypeURIs",value:function(e){var t,r,n,i,o,a,s;for(r in a=[],e)if(e.hasOwnProperty(r)){for(s=e[r],i=0,t=0,n=(o=this.each(this.rdfFactory.namedNode(r),this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"))).length;t<n;t++)if("http://www.w3.org/2000/01/rdf-schema#Resource"!==o[t].uri){i++;break}i||(a[r]=s)}return a["http://www.w3.org/2000/01/rdf-schema#Resource"]&&delete a["http://www.w3.org/2000/01/rdf-schema#Resource"],a["http://www.w3.org/2002/07/owl#Thing"]&&delete a["http://www.w3.org/2002/07/owl#Thing"],a}},{key:"toString",value:function(){return"{"+this.statements.join("\n")+"}"}},{key:"variable",value:function(e){return new N(e)}},{key:"whether",value:function(e,t,r,n){return this.statementsMatching(e,t,r,n,!1).length}}]),h}(d.Z);d.Z.fromValue=b;const te=d.Z;var re={xsd:U("http://www.w3.org/2001/XMLSchema#")};d.Z.toJS=function(e){return(0,g.uZ)(e)?e.elements.map(d.Z.toJS):(0,g.n_)(e)?e.datatype.equals(re.xsd("boolean"))?"1"===e.value||"true"===e.value:e.datatype.equals(re.xsd("dateTime"))||e.datatype.equals(re.xsd("date"))?new Date(e.value):e.datatype.equals(re.xsd("integer"))||e.datatype.equals(re.xsd("float"))||e.datatype.equals(re.xsd("decimal"))?Number(e.value):e.value:e};var ne=(0,n.Z)((function e(t,r){(0,i.Z)(this,e),this.pat=new fe,this.vars=[],this.name=t,this.id=r}));function ie(e,t,r,n){function i(e){var t,r="";for(t in e)e.hasOwnProperty(t)&&(r+=" "+t+" -> "+e[t]);return r}function o(e){var t,r="Bindings: ",n=e.length;for(t=0;t<n;t++)r+=i(e[t][0])+";\n\t";return r}function a(e,t,r,n){var i;if(e.length!==t.length)return[];if(!e.length)return[[[],null]];var o=function(e,t,r,n){var i=r[e];if(void 0===i){if(e.isVar){var o=[];return o[e]=t,[[o,null]]}i=e}if(!i.complexType)return n.redirections[i]&&(i=n.redirections[i]),n.redirections[t]&&(t=n.redirections[t]),i.equals(t)||i.uri&&i.uri===A?[[[],null]]:[];if(e instanceof Array)return t instanceof Array?a(e,t,r):[];throw new Error("query.js: oops - code not written yet")}(e[0],t[0],r,n);if(0===o.length)return o;var s,c,u,l,d,p,f,h=[],m=o.length;for(s=0;s<m;s++){for(d in f=[],c=o[s][0])c.hasOwnProperty(d)&&(f[d]=c[d]);for(d in r)r.hasOwnProperty(d)&&(f[d]=r[d]);for(l=(i=a(e.slice(1),t.slice(1),f,n)).length,u=0;u<l;u++){for(d in p=i[u][0],c)c.hasOwnProperty(d)&&(p[d]=c[d]);h.push([p,null])}}return h}function s(e,t){var r,n={};for(r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n}function c(e,t){return this.trunkBindings=t,this.originalCallback=e,this.branches=[],this}function u(e,t){return this.count=0,this.success=!1,this.done=!1,this.callback=e,this.onDone=t,this}c.prototype.checkAllDone=function(){var e;for(e=0;e<this.branches.length;e++)if(!this.branches[e].done)return;M.Z.debug("OPTIONAL BIDNINGS ALL DONE:"),this.doCallBacks(this.branches.length-1,this.trunkBindings)},c.prototype.doCallBacks=function(e,t){var r;if(e<0)return this.originalCallback(t);for(r=0;r<this.branches[e].results.length;r++)this.doCallBacks(e-1,s(t,this.branches[e].results[r]))},u.prototype.reportMatch=function(e){this.callback(e),this.success=!0},u.prototype.reportDone=function(){this.done=!0,M.Z.info("Mandatory query branch finished.***"),void 0!==this.onDone&&this.onDone()};var l=function(e){return this.count=0,this.done=!1,this.results=[],this.junction=e,e.branches.push(this),this};function d(e,t,r){var n,i,o,a,s,c;for(t.nvars=0,t.index=null,n=[t.subject,t.predicate,t.object,t.why],a=[e.subjectIndex,e.predicateIndex,e.objectIndex,e.whyIndex],o=0;o<4;o++){var u=n[o];if(u.uri&&u.uri===A);else if(u.isVar&&void 0===r[u])t.nvars++;else{if(void 0,u=void 0===(c=r[s=n[o]])?s:c,e.redirections[e.id(u)]&&(u=e.redirections[e.id(u)]),!(i=a[o][e.id(u)]))return t.index=[],!1;(null===t.index||t.index.length>i.length)&&(t.index=i)}}return null===t.index&&(t.index=e.statements),!0}function p(e,t){return e.nvars!==t.nvars?e.nvars-t.nvars:e.index.length-t.index.length}l.prototype.reportMatch=function(e){this.results.push(e)},l.prototype.reportDone=function(){M.Z.debug("Optional branch finished - results.length = "+this.results.length),0===this.results.length&&(this.results.push({}),M.Z.debug("Optional branch FAILED - that's OK.")),this.done=!0,this.junction.checkAllDone()};var f=function e(r,n,o,a,s,u,d){M.Z.debug("Match begins, Branch count now: "+d.count+" for "+d.pattern_debug);var p,f,h=n.statements;if(0===h.length){if(M.Z.debug("FOUND MATCH WITH BINDINGS:"+i(o)),0===n.optional.length)d.reportMatch(o);else{M.Z.debug("OPTIONAL: "+n.optional);var g,v=new c(t,o),y=[];for(g=0;g<n.optional.length;g++)y[g]=new l(v),y[g].pattern_debug=n.optional[g];for(g=0;g<n.optional.length;g++)y[g].count=y[g].count+1,e(r,n.optional[g],o,"",s,t,y[g])}return d.count--,void M.Z.debug("Match ends -- success , Branch count now: "+d.count+" for "+d.pattern_debug)}var b=h.length;if(s){var w=function(t,i){var c=t.uri.split("#")[0];s.nowOrWhenFetched(c,void 0,(function(i,c,l){i||console.log("Error following link to <"+t.uri+"> in query: "+c),e(r,n,o,a,s,u,d)}))};for(f=0;f<b;f++){if(p=h[f],void 0!==o[p.subject]&&o[p.subject].uri&&s&&"unrequested"===s.getState((0,F.docpart)(o[p.subject].uri)))return void w(o[p.subject]);if(void 0!==o[p.object]&&o[p.object].uri&&s&&"unrequested"===s.getState((0,F.docpart)(o[p.object].uri)))return void w(o[p.object])}}m(r,n,o,a,s,u,d)},h=function(e,t){var r,n,i=!0;for(r in e)e.hasOwnProperty(r)&&t[r]&&(n=t[r].test)&&!n(e[r])&&(i=!1);return i},m=function(e,t,r,n,s,c,u){var l,m,g,v,y,b,w,x=t.statements,_=x.length;for(l=0;l<_;l++)d(e,w=x[l],r);x.sort(p),w=x[0];var E,k=e.formula();k.optional=t.optional,k.constraints=t.constraints,k.statements=x.slice(1),M.Z.debug(n+"match2 searching "+w.index.length+" for "+w+"; bindings so far="+i(r));var S,A,C=w.index.length,T=0;for(E=0;E<C;E++)for(A=w.index[E],S=a([w.subject,w.predicate,w.object,w.why],[A.subject,A.predicate,A.object,A.why],r,e),M.Z.info(n+" From first: "+S.length+": "+o(S)),g=S.length,m=0;m<g;m++)if(y=[],b=S[m][0],h(b,t.constraints)){for(v in b)b.hasOwnProperty(v)&&(y[v]=b[v]);for(v in r)r.hasOwnProperty(v)&&(y[v]=r[v]);u.count++,T++,f(e,k,y,n+" ",s,c,u)}else M.Z.debug("Branch count CS: "+u.count);u.count--,0===T&&M.Z.debug("Match2 fails completely on "+w),M.Z.debug("Match2 ends, Branch count: "+u.count+" for "+u.pattern_debug),0===u.count&&(M.Z.debug("Branch finished."),u.reportDone())},g=this;M.Z.debug("Query on "+this.statements.length);var v=new u(t,n);v.count++,e.sync?f(g,e.pat,e.pat.initBindings,"",r,t,v):setTimeout((function(){f(g,e.pat,e.pat.initBindings,"",r,t,v)}),0)}function oe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ae(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(r),!0).forEach((function(t){(0,u.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function se(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return ce(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ce(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ue="http://www.w3.org/2002/07/owl#";function le(e,t,r,n){var i=e.any(t,r,void 0);return!!i&&(e.equate(i,n),!0)}function de(e,t,r,n){var i=e.any(void 0,r,n);return!!i&&(e.equate(i,t),!0)}function pe(e,t,r,n,i){e.typeCallback&&e.typeCallback(e,n,i);var o=e.classActions[e.id(n)],a=!1;if(o)for(var s=0;s<o.length;s++)a=a||o[s](e,t,r,n,i);return a}var fe=function(e){(0,a.Z)(h,e);var t,r,d=(t=h,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,c.Z)(t);if(r){var i=(0,c.Z)(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return(0,s.Z)(this,e)});function h(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,i.Z)(this,h),t=d.call(this,void 0,void 0,void 0,void 0,r),(0,u.Z)((0,o.Z)(t),"updater",void 0),(0,u.Z)((0,o.Z)(t),"namespaces",void 0),(0,u.Z)((0,o.Z)(t),"classActions",void 0),(0,u.Z)((0,o.Z)(t),"propertyActions",void 0),(0,u.Z)((0,o.Z)(t),"redirections",void 0),(0,u.Z)((0,o.Z)(t),"aliases",void 0),(0,u.Z)((0,o.Z)(t),"HTTPRedirects",void 0),(0,u.Z)((0,o.Z)(t),"subjectIndex",void 0),(0,u.Z)((0,o.Z)(t),"predicateIndex",void 0),(0,u.Z)((0,o.Z)(t),"objectIndex",void 0),(0,u.Z)((0,o.Z)(t),"whyIndex",void 0),(0,u.Z)((0,o.Z)(t),"index",void 0),(0,u.Z)((0,o.Z)(t),"features",void 0),(0,u.Z)((0,o.Z)(t),"_universalVariables",void 0),(0,u.Z)((0,o.Z)(t),"_existentialVariables",void 0),(0,u.Z)((0,o.Z)(t),"rdfArrayRemove",void 0),(0,u.Z)((0,o.Z)(t),"dataCallbacks",void 0),t.propertyActions={},t.classActions={},t.redirections=[],t.aliases=[],t.HTTPRedirects=[],t.subjectIndex=[],t.predicateIndex=[],t.objectIndex=[],t.whyIndex=[],t.index=[t.subjectIndex,t.predicateIndex,t.objectIndex,t.whyIndex],t.namespaces={},t.features=e||[],t.rdfArrayRemove=r.rdfArrayRemove||B.RDFArrayRemove,r.dataCallback&&(t.dataCallbacks=[r.dataCallback]),t.initPropertyActions(t.features),t}return(0,n.Z)(h,[{key:"substitute",value:function(e){var t=this.statements.map((function(t){return t.substitute(e)})),r=new h;return r.add(t),r}},{key:"addDataCallback",value:function(e){this.dataCallbacks||(this.dataCallbacks=[]),this.dataCallbacks.push(e)}},{key:"applyPatch",value:function(e,t,r){var n,i=this,o=null;function a(a){if(e.delete){n=e.delete,o&&(n=n.substitute(o)),n=n.statements;var s=[],c=n.map((function(e){var r=i.statementsMatching(e.subject,e.predicate,e.object,t);return 0===r.length?(s.push(e),null):r[0]}));if(s.length)return r("Could not find to delete: "+s.join("\n or "));c.map((function(e){i.remove(e)}))}e.insert&&(n=e.insert,o&&(n=n.substitute(o)),(n=n.statements).map((function(e){e.graph=t,i.add(e.subject,e.predicate,e.object,e.graph)}))),a()}if(e.where){var s=new ne("patch");s.pat=e.where,s.pat.statements.map((function(e){e.graph=vr(t.value)})),s.sync=!0;var c=[];i.query(s,(function(e){c.push(e)}),i.fetcher,(function(){return 0===c.length?r("No match found to be patched:"+e.where):c.length>1?r("Patch ambiguous. No patch done."):(o=c[0],void a(r))}))}else a(r)}},{key:"declareExistential",value:function(e){return this._existentialVariables||(this._existentialVariables=[]),this._existentialVariables.push(e),e}},{key:"initPropertyActions",value:function(e){this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"))]=[pe],X(e,"sameAs")>=0&&(this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(ue,"sameAs")))]=[function(e,t,r,n,i){return e.equate(t,n),!0}]),X(e,"InverseFunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(ue,"InverseFunctionalProperty")))]=[function(e,t,r,n,i){return e.newPropertyAction(t,de)}]),X(e,"FunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(ue,"FunctionalProperty")))]=[function(e,t,r,n,i){return e.newPropertyAction(t,le)}])}},{key:"addStatement",value:function(e){return this.add(e.subject,e.predicate,e.object,e.graph),this.statements.length}},{key:"add",value:function(e,t,r,n){var i,o,a;if(1===arguments.length){if(e instanceof Array)for(i=0;i<e.length;i++)this.add(e[i]);else(0,g.PY)(e)?this.add(e.subject,e.predicate,e.object,e.graph):(0,g.Pv)(e)&&this.add(e.statements);return this}n||(n=this.fetcher?this.fetcher.appNode:this.rdfFactory.defaultGraph()),"string"==typeof e&&(e=this.rdfFactory.namedNode(e)),t=te.fromValue(t);var s=te.fromValue(r);if(n=te.fromValue(n),!(0,g.f)(e))throw new Error("Subject is not a subject type");if(!(0,g.nq)(t))throw new Error("Predicate ".concat(t," is not a predicate type"));if(!(0,g.Uc)(s))throw new Error("Object ".concat(s," is not an object type"));if(!(0,g.NA)(n))throw new Error("Why is not a graph type");this.predicateCallback&&this.predicateCallback(this,t,n);var c=this.id(this.canon(t)),u=!1;if(o=this.propertyActions[c])for(i=0;i<o.length;i++)u=u||o[i](this,e,t,s,n);if(this.holds(e,t,s,n))return null;var l=[this.id(this.canon(e)),c,this.id(this.canon(s)),this.id(this.canon(n))];for(a=this.rdfFactory.quad(e,t,s,n),i=0;i<4;i++){var d=this.index[i],p=l[i];d[p]||(d[p]=[]),d[p].push(a)}if(this.statements.push(a),this.dataCallbacks){var f,h=se(this.dataCallbacks);try{for(h.s();!(f=h.n()).done;){var m=f.value;m(a)}}catch(e){h.e(e)}finally{h.f()}}return a}},{key:"canon",value:function(e){if(!e)return e;var t=this.redirections[this.id(e)];if(t)return t;switch(e.termType){case p.V1:return new f(e.value);case p.fb:return e;case p.NK:return new C;case p.ls:case p._A:return e;case p.xH:return new y(e.value,e.language,e.datatype);case p.XM:return new m.Z(e.value);case p.UH:return new N(e.value);default:throw new Error("Term Type not recognized for canonization: ".concat(e.termType))}}},{key:"check",value:function(){this.checkStatementList(this.statements);for(var e=0;e<4;e++){var t=this.index[e];for(var r in t)t.hasOwnProperty(r)&&this.checkStatementList(t[r],e)}}},{key:"checkStatementList",value:function(e,t){void 0===t&&(t=0);for(var r,n=" found in "+["subject","predicate","object","why"][t]+" index.",i=0;i<e.length;i++){for(var o=[(r=e[i]).subject,r.predicate,r.object,r.graph],a=function(e,t){for(var r=0;r<e.length;r++)if(e[r].subject.equals(t.subject)&&e[r].predicate.equals(t.predicate)&&e[r].object.equals(t.object)&&e[r].why.equals(t.graph))return!0},s=0;s<4;s++){var c=this.canon(o[s]),u=this.id(c);this.index[s][u]&&a(this.index[s][u],r)}if(!a(this.statements,r))throw new Error("Statement list does not statement "+r+"@"+r.graph+n)}}},{key:"close",value:function(){return this}},{key:"compareTerms",value:function(e,t){return Object.prototype.hasOwnProperty.call(e,"compareTerm")?e.compareTerm(t):l.Z[e.termType]<l.Z[t.termType]?-1:l.Z[e.termType]>l.Z[t.termType]?1:e.value<t.value?-1:e.value>t.value?1:0}},{key:"copyTo",value:function(e,t,r){r||(r=[]);var n=this.statementsMatching(e);-1!==X(r,"two-direction")&&n.concat(this.statementsMatching(void 0,void 0,e));for(var i=0;i<n.length;i++){var o=n[i];switch(o.object.termType){case"NamedNode":this.add(t,o.predicate,o.object);break;case"Literal":case"BlankNode":case"Collection":this.add(t,o.predicate,o.object.copy(this))}-1!==X(r,"delete")&&this.remove(o)}}},{key:"equate",value:function(e,t){var r=this.canon(e),n=this.canon(t),i=this.compareTerms(r,n);return!i||(i<0?this.replaceWith(n,r):this.replaceWith(r,n))}},{key:"formula",value:function(e){return new h(e)}},{key:"length",get:function(){return this.statements.length}},{key:"match",value:function(e,t,r,n){return this.statementsMatching(te.fromValue(e),te.fromValue(t),te.fromValue(r),te.fromValue(n))}},{key:"mentionsURI",value:function(e){var t="<"+e+">";return!!this.subjectIndex[t]||!!this.objectIndex[t]||!!this.predicateIndex[t]}},{key:"newExistential",value:function(e){if(!e)return this.bnode();var t=this.sym(e);return this.declareExistential(t)}},{key:"newPropertyAction",value:function(e,t){var r=this.id(e);this.propertyActions[r]||(this.propertyActions[r]=[]),this.propertyActions[r].push(t);for(var n=this.statementsMatching(void 0,e,void 0),i=!1,o=0;o<n.length;o++)i=i||t(this,n[o].subject,e,n[o].object);return i}},{key:"newUniversal",value:function(e){var t=this.sym(e);return this._universalVariables||(this._universalVariables=[]),this._universalVariables.push(t),t}},{key:"variable",value:function(e){return new N(e)}},{key:"nextSymbol",value:function(e){for(var t=0;;t++){var r=e.value+"#n"+t;if(!this.mentionsURI(r))return this.sym(r)}}},{key:"query",value:function(e,t,r,n){return ie.call(this,e,t,r,n)}},{key:"querySync",value:function(e){var t=[],r=!1;if(e.sync=!0,ie.call(this,e,(function(e){t.push(e)}),null,(function(){r=!0})),!r)throw new Error("Sync query should have called done function");return t}},{key:"remove",value:function(e){if(e instanceof Array){for(var t=0;t<e.length;t++)this.remove(e[t]);return this}if((0,g.Pv)(e))return this.remove(e.statements);var r=this.statementsMatching(e.subject,e.predicate,e.object,e.graph);if(!r.length)throw new Error("Statement to be removed is not on store: "+e);return this.removeStatement(r[0]),this}},{key:"removeDocument",value:function(e){for(var t=this.sym("chrome://TheCurrentSession"),r="http://www.w3.org/2007/ont/link#",n=this.statementsMatching(void 0,this.sym("".concat(r,"requestedURI")),this.rdfFactory.literal(e.value),t).map((function(e){return e.subject})),i=0;i<n.length;i++){var o=n[i];if(void 0!==o){this.removeMatches(o,null,null,t);var a=this.any(o,this.sym("".concat(r,"response")),null,t);void 0!==a&&this.removeMatches(a,null,null,t)}}this.removeMatches(this.sym(e.value),null,null,t);for(var s=this.statementsMatching(void 0,void 0,void 0,e).slice(),c=0;c<s.length;c++)this.removeStatement(s[c]);return this}},{key:"removeMany",value:function(e,t,r,n,i){for(var o=this.statementsMatching(e,t,r,n,!1),a=[],s=0;s<o.length;s++)a.push(o[s]);for(i&&(a=a.slice(0,i)),s=0;s<a.length;s++)this.remove(a[s])}},{key:"removeMatches",value:function(e,t,r,n){return this.removeMany(e,t,r,n),this}},{key:"removeStatement",value:function(e){for(var t=[e.subject,e.predicate,e.object,e.graph],r=0;r<4;r++){var n=this.canon(t[r]),i=this.id(n);this.index[r][i]&&this.rdfArrayRemove(this.index[r][i],e)}return this.rdfArrayRemove(this.statements,e),this}},{key:"removeStatements",value:function(e){for(var t=0;t<e.length;t++)this.remove(e[t]);return this}},{key:"replaceWith",value:function(e,t){for(var r=this.id(e),n=this.id(t),i=function(e){var t=e[r];if(t){var i=e[n];e[n]=i?t.concat(i):t,delete e[r]}},o=0;o<4;o++)i(this.index[o]);if(this.redirections[r]=t,e.value){if(this.aliases[n]||(this.aliases[n]=[]),this.aliases[n].push(e),this.aliases[r])for(o=0;o<this.aliases[r].length;o++)this.redirections[this.id(this.aliases[r][o])]=t,this.aliases[n].push(this.aliases[r][o]);this.add(t,this.sym("http://www.w3.org/2007/ont/link#uri"),e),this.fetcher&&this.fetcher.nowKnownAs(e,t)}return i(this.classActions),i(this.propertyActions),!0}},{key:"allAliases",value:function(e){var t=this.aliases[this.id(this.canon(e))]||[];return t.push(this.canon(e)),t}},{key:"sameThings",value:function(e,t){if(e.equals(t))return!0;var r=this.canon(e);if(!r)return!1;var n=this.canon(t);return!!n&&r.value===n.value}},{key:"setPrefixForURI",value:function(e,t){if(("tab"!==e||!this.namespaces.tab)&&"ns"!==e.slice(0,2)&&"default"!==e.slice(0,7)){for(var r in this.namespaces)this.namespaces[r]==t&&delete this.namespaces[r];this.namespaces[e]=t}}},{key:"statementsMatching",value:function(e,t,r,n,i){var o,a,s=[e,t,r,n],c=[],u=[],l=[],d=[];for(o=0;o<4;o++)c[o]=this.canon(te.fromValue(s[o])),c[o]?(d.push(o),u[o]=this.id(c[o])):l.push(o);if(0===d.length)return this.statements;if(1===d.length)return o=d[0],(a=this.index[o][u[o]])&&i&&a.length>1&&(a=a.slice(0,1)),a||[];var p,f,h=1e10;for(f=0;f<d.length;f++){if(o=d[f],!(a=this.index[o][u[o]]))return[];a.length<h&&(h=a.length,p=f)}for(var m=d[p],g=this.index[m][u[m]],v=d.slice(0,p).concat(d.slice(p+1)),y=[],b=["subject","predicate","object","why"],w=0;w<g.length;w++){var x=g[w];for(f=0;f<v.length;f++)if(o=v[f],!this.canon(x[b[o]]).equals(c[o])){x=null;break}if(null!=x&&(y.push(x),i))break}return y}},{key:"uris",value:function(e){var t=this.canon(e),r=this.aliases[this.id(t)];if(!t.value)return[];var n=[t.value];if(r)for(var i=0;i<r.length;i++)n.push(r[i].uri);return n}},{key:"serialize",value:function(e,t,r,n){var i,o=null!==(i=n)&&void 0!==i&&i.namespaces?ae(ae({},this.namespaces),n.namespaces):ae({},this.namespaces);return J(r,this,e,t,void 0,n=ae(ae({},n||{}),{},{namespaces:o}))}}],[{key:"defaultGraphURI",get:function(){return A}}]),h}(ee);function he(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return me(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?me(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function me(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}(0,u.Z)(fe,"handleRDFType",void 0),fe.handleRDFType=pe;var ge=U("http://www.w3.org/1999/02/22-rdf-syntax-ns#");function ve(e,t){function r(n,i,o){var a=e.statementsMatching(n,ge("rest"),null,t);if(1!==a.length)throw new Error("Bad list structure: no rest at ".concat(n));var s=e.statementsMatching(n,ge("first"),null,t);if(1!==s.length)throw new Error("Bad list structure: rest but ".concat(s.length," firsts at ").concat(n));var c=[s[0].object].concat(i),u=o.concat(a).concat(s),l=e.statementsMatching(null,ge("rest"),n,t);if(0===l.length){var d=new w(c);return e.remove(u),void function(e,t,r,n){var i,o=he(e.statementsMatching(r,null,null,n));try{for(o.s();!(i=o.n()).done;){var a=i.value,s=new P(t,a.predicate,a.object,n);e.remove(a),e.add(s)}}catch(e){o.e(e)}finally{o.f()}var c,u=he(e.statementsMatching(null,r,null,n));try{for(u.s();!(c=u.n()).done;){var l=c.value;e.remove(l),e.add(new P(l.subject,t,l.object,n))}}catch(e){u.e(e)}finally{u.f()}var d,p=he(e.statementsMatching(null,null,r,n));try{for(p.s();!(d=p.n()).done;){var f=d.value;e.remove(f),e.add(new P(f.subject,f.predicate,t,n))}}catch(e){p.e(e)}finally{p.f()}}(e,d,n,t)}if(1!==l.length)throw new Error("Bad list structure: ".concat(l.length," pres at ").concat(n));var p=l[0].subject;if("BlankNode"!==p.termType)throw new Error("Bad list element node ".concat(p," type: ").concat(p.termType," "));r(p,c,u)}!function(e,t){var r,n=ge("nil"),i=he(e.statementsMatching(n,null,null,t));try{for(i.s();!(r=i.n()).done;){var o=r.value;e.remove(o);var a=new w;e.add(new P(a,o.predicate,o.object,t))}}catch(e){i.e(e)}finally{i.f()}var s,c=he(e.statementsMatching(null,null,n,t));try{for(c.s();!(s=c.n()).done;){var u=s.value;if(!u.predicate.sameTerm(ge("rest"))){e.remove(u);var l=new w;e.add(new P(u.subject,u.predicate,l,t))}}}catch(e){c.e(e)}finally{c.f()}}(e,t),e.statementsMatching(null,ge("rest"),ge("nil"),t).forEach((function(e){if("BlankNode"!==e.subject.termType)throw new Error("Bad list element node ".concat(e.subject," type: ").concat(e.subject.termType," "));r(e.subject,[],[])}))}var ye="http://www.w3.org/2000/10/swap/log#",be=function(e){return e},we=function(e){return e},xe=function(e){if(e.length>0)throw"missing.js: oops nnonempty dict not imp";return[]},_e=function(e){return e.length},Ee=function(e,t,r){if(void 0===e.slice)throw"@@ mising.js: No .slice function for "+e+" of type "+(0,h.Z)(e);return void 0===r||null==r?e.slice(t):e.slice(t,r)},ke=Error("dummy error stop iteration"),Se=function(e){return this.last=0,this.li=e,this.next=function(){if(this.last==this.li.length)throw ke;return this.li[this.last++]},this},Ae=function(e,t){return e.indexOf(t)},Ce=function(e,t){if(!e){if(t)throw"python Assertion failed: "+t;throw"(python) Assertion failed."}};String.prototype.encode=function(e){if("utf-8"!=e)throw"UTF8_converter: can only do utf-8";return function(e){e=e.replace(/\r\n/g,"\n");for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r);n<128?t+=String.fromCharCode(n):n>127&&n<2048?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t}(this)},String.prototype.decode=function(e){if("utf-8"!=e)throw"UTF8_converter: can only do utf-8";return this};var Te=function(e,t){return F.join(t,e)},Oe="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil",Pe="http://www.w3.org/2002/07/owl#sameAs",Fe="\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~",Ie=Fe+":",Ne=new RegExp("^([-+]?[0-9]+)(\\.[0-9]+)?(e[-+]?[0-9]+)?","g"),je=new RegExp("^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9](T[0-9][0-9]:[0-9][0-9](:[0-9][0-9](\\.[0-9]*)?)?)?Z?"),Re=new RegExp('[\\\\\\r\\n\\"]',"g"),Le=new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*","g");const De=function(e,t,r,n,i,o,a,s){return new Ue(e,t,r,n,i,o,a,s)};var Me,Ue=function(){function e(t,r,n,o,a,s,c,u){(0,i.Z)(this,e),void 0===r&&(r=null),void 0===n&&(n=""),void 0===o&&(o=null),void 0===a&&(a=""),void 0===s&&(s=null),void 0===c&&(c=""),void 0===u&&(u=null),this._bindings=new xe([]),this._flags=c,""!=n&&(Ce(n.indexOf(":")>=0,"Document URI not absolute: "+n),this._bindings[""]=n+"#"),this._store=t,a&&t.setGenPrefix(a),this._thisDoc=n,this.source=t.sym(n),this.lines=0,this.statementCount=0,this.hasNil=!1,this.startOfLine=0,this.previousLine=0,this._genPrefix=a,this.keywords=new we(["a","this","bind","has","is","of","true","false"]),this.keywordsSet=0,this._anonymousNodes=new xe([]),this._variables=new xe([]),this._parentVariables=new xe([]),this._reason=u,this._reason2=null,this._baseURI=o||n||null,Ce(!this._baseURI||this._baseURI.indexOf(":")>=0),this._genPrefix||(this._thisDoc?this._genPrefix=this._thisDoc+"#_g":this._genPrefix=RDFSink_uniqueURI()),null==r?this._thisDoc?this._formula=t.formula(n+"#_formula"):this._formula=t.formula():this._formula=r,this._context=this._formula,this._parentContext=null}return(0,n.Z)(e,[{key:"here",value:function(e){return this._genPrefix+"_L"+this.lines+"C"+(e-this.startOfLine+1)}},{key:"formula",value:function(){return this._formula}},{key:"loadStream",value:function(e){return this.loadBuf(e.read())}},{key:"loadBuf",value:function(e){return this.startDoc(),this.feed(e),this.endDoc()}},{key:"feed",value:function(e){for(var t=e.decode("utf-8"),r=0;r>=0;){var n=this.skipSpace(t,r);if(n<0)return;if((r=this.directiveOrStatement(t,n))<0)throw Be(this._thisDoc,this.lines,t,n,"expected directive or statement")}}},{key:"directiveOrStatement",value:function(e,t){var r,n=this.skipSpace(e,t);return n<0?n:(r=this.directive(e,n))>=0||(r=this.statement(e,n))>=0?this.checkDot(e,r):r}},{key:"tok",value:function(e,t,r){if("@"==t.slice(r,r+1))r+=1;else if(X(this.keywords,e)<0)return-1;var n=r+_e(e);return t.slice(r,n)==e&&Fe.indexOf(t.charAt(n))>=0?n:-1}},{key:"directive",value:function(e,t){if((o=this.skipSpace(e,t))<0)return o;var r=new we([]);if((o=this.tok("bind",e,t))>0)throw Be(this._thisDoc,this.lines,e,t,"keyword bind is obsolete: use @prefix");if((o=this.tok("keywords",e,t))>0){if((t=this.commaSeparatedList(e,o,r,!1))<0)throw Be(this._thisDoc,this.lines,e,t,"'@keywords' needs comma separated list of words");return this.setKeywords(Ee(r,null,null)),t}if((o=this.tok("forAll",e,t))>0){if((t=this.commaSeparatedList(e,o,r,!0))<0)throw Be(this._thisDoc,this.lines,e,t,"Bad variable list after @forAll");var n=new Se(r);try{for(;;){var i=n.next();(X(this._variables,i)<0||X(this._parentVariables,i)>=0)&&(this._variables[i]=this._context.newUniversal(i))}}catch(e){if(e!=ke)throw e}return t}if((o=this.tok("forSome",e,t))>0){if((t=this.commaSeparatedList(e,o,r,this.uri_ref2))<0)throw Be(this._thisDoc,this.lines,e,t,"Bad variable list after @forSome");n=new Se(r);try{for(;;)i=n.next(),this._context.declareExistential(i)}catch(e){if(e!=ke)throw e}return t}if((o=this.tok("prefix",e,t))>=0){var o,a=new we([]);if((t=this.qname(e,o,a))<0)throw Be(this._thisDoc,this.lines,e,o,"expected qname after @prefix");if((o=this.uri_ref2(e,t,a))<0)throw Be(this._thisDoc,this.lines,e,t,"expected <uriref> after @prefix _qname_");var s=a[1].uri;return this._baseURI?s=Te(this._baseURI,s):Ce(s.indexOf(":")>=0,"With no base URI, cannot handle relative URI for NS"),Ce(s.indexOf(":")>=0),this._bindings[a[0][0]]=s,this.bind(a[0][0],function(e){return encodeURI(e)}(s)),o}if((o=this.tok("base",e,t))>=0){if(a=new we([]),(t=this.uri_ref2(e,o,a))<0)throw Be(this._thisDoc,this.lines,e,o,"expected <uri> after @base ");if(s=a[0].uri,!this._baseURI)throw Be(this._thisDoc,this.lines,e,o,"With no previous base URI, cannot use relative URI in @base <"+s+">");return s=Te(this._baseURI,s),Ce(s.indexOf(":")>=0),this._baseURI=s,t}return-1}},{key:"bind",value:function(e,t){""==e||this._store.setPrefixForURI(e,t)}},{key:"setKeywords",value:function(e){null==e?this.keywordsSet=0:(this.keywords=e,this.keywordsSet=1)}},{key:"startDoc",value:function(){}},{key:"endDoc",value:function(){return this.hasNil&&this._store.rdfFactory.supports.COLLECTIONS&&ve(this._store,this.source),this._formula}},{key:"makeStatement",value:function(e){e[0].add(e[2],e[1],e[3],this.source),(e[2].uri&&e[2].uri===Oe||e[3].uri&&e[3].uri===Oe)&&(this.hasNil=!0),this.statementCount+=1}},{key:"statement",value:function(e,t){var r=new we([]);if((t=this.object(e,t,r))<0)return t;var n=this.property_list(e,t,r[0]);if(n<0)throw Be(this._thisDoc,this.lines,e,t,"expected propertylist");return n}},{key:"subject",value:function(e,t,r){return this.item(e,t,r)}},{key:"verb",value:function(e,t,r){if((i=this.skipSpace(e,t))<0)return i;var n=new we([]);if((i=this.tok("has",e,t))>=0){if((t=this.prop(e,i,n))<0)throw Be(this._thisDoc,this.lines,e,i,"expected property after 'has'");return r.push(new be(["->",n[0]])),t}if((i=this.tok("is",e,t))>=0){if((t=this.prop(e,i,n))<0)throw Be(this._thisDoc,this.lines,e,i,"expected <property> after 'is'");if((i=this.skipSpace(e,t))<0)throw Be(this._thisDoc,this.lines,e,t,"End of file found, expected property after 'is'");var i;if(t=i,(i=this.tok("of",e,t))<0)throw Be(this._thisDoc,this.lines,e,t,"expected 'of' after 'is' <prop>");return r.push(new be(["<-",n[0]])),i}if((i=this.tok("a",e,t))>=0)return r.push(new be(["->",this._store.sym("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")])),i;if("<="==e.slice(t,t+2))return r.push(new be(["<-",this._store.sym(ye+"implies")])),t+2;if("="==e.slice(t,t+1))return">"==e.slice(t+1,t+2)?(r.push(new be(["->",this._store.sym(ye+"implies")])),t+2):(r.push(new be(["->",this._store.sym(Pe)])),t+1);if(":="==e.slice(t,t+2))return r.push(new be(["->",ye+"becomes"])),t+2;if((i=this.prop(e,t,n))>=0)return r.push(new be(["->",n[0]])),i;if(">-"==e.slice(t,t+2)||"<-"==e.slice(t,t+2))throw Be(this._thisDoc,this.lines,e,i,">- ... -> syntax is obsolete.");return-1}},{key:"prop",value:function(e,t,r){return this.item(e,t,r)}},{key:"item",value:function(e,t,r){return this.path(e,t,r)}},{key:"blankNode",value:function(e){return this._context.bnode(e,this._reason2)}},{key:"path",value:function(e,t,r){if((o=this.nodeOrLiteral(e,t,r))<0)return o;for(;"!^.".indexOf(e.slice(o,o+1))>=0;){var n=e.slice(o,o+1);if("."==n){var i=e.slice(o+1,o+2);if(!i||Ie.indexOf(i)>=0&&":?<[{(".indexOf(i)<0)break}var o,a=r.pop(),s=this.blankNode(this.here(o));if((o=this.node(e,o+1,r))<0)throw Be(this._thisDoc,this.lines,e,o,"EOF found in middle of path syntax");var c=r.pop();"^"==n?this.makeStatement(new be([this._context,c,s,a])):this.makeStatement(new be([this._context,c,a,s])),r.push(s)}return o}},{key:"anonymousNode",value:function(e){if(t=this._anonymousNodes[e])return t;var t=this._store.bnode(e);return this._anonymousNodes[e]=t,t}},{key:"node",value:function(e,t,r,n){void 0===n&&(n=null);var i=n;if((l=this.skipSpace(e,t))<0)return l;t=l;var o=e.slice(t,t+1);if("["==o){var a=this.here(t);if((l=this.skipSpace(e,t+1))<0)throw Be(this._thisDoc,this.lines,e,t,"EOF after '['");if("="==e.slice(l,l+1)){t=l+1;var s=new we([]);if(!((l=this.objectList(e,t,s))>=0))throw Be(this._thisDoc,this.lines,e,t,"objectList expected after [= ");if(i=s[0],_e(s)>1){var c=new Se(s);try{for(;;){var u=c.next();this.makeStatement(new be([this._context,this._store.sym(Pe),i,u]))}}catch(e){if(e!=ke)throw e}}if((l=this.skipSpace(e,l))<0)throw Be(this._thisDoc,this.lines,e,t,"EOF when objectList expected after [ = ");if(";"==e.slice(l,l+1))var l=l+1}if(null==i&&(i=this.blankNode(a)),(t=this.property_list(e,l,i))<0)throw Be(this._thisDoc,this.lines,e,l,"property_list expected");if((l=this.skipSpace(e,t))<0)throw Be(this._thisDoc,this.lines,e,t,"EOF when ']' expected after [ <propertyList>");if("]"!=e.slice(l,l+1))throw Be(this._thisDoc,this.lines,e,l,"']' expected");return r.push(i),l+1}if("{"==o){if("$"==e.slice(t+1,t+2)){l=(t+=1)+1;for(var d=new we([]),p=!0;;){if((t=this.skipSpace(e,l))<0)throw Be(this._thisDoc,this.lines,e,t,"needed '$}', found end.");if("$}"==e.slice(t,t+2)){l=t+2;break}if(p)p=!1;else{if(","!=e.slice(t,t+1))throw Be(this._thisDoc,this.lines,e,t,"expected: ','");t+=1}var f=new we([]);if((l=this.item(e,t,f))<0)throw Be(this._thisDoc,this.lines,e,t,"expected item in set or '$}'");d.push(f[0])}return r.push(this._store.newSet(d,this._context)),l}l=t+1;var h=this._parentContext;this._parentContext=this._context;var m=this._anonymousNodes,g=this._parentVariables;this._parentVariables=this._variables,this._anonymousNodes=new xe([]),this._variables=this._variables.slice();var v=this._reason2;for(this._reason2=null,null==i&&(i=this._store.formula()),this._context=i;;){if((t=this.skipSpace(e,l))<0)throw Be(this._thisDoc,this.lines,e,t,"needed '}', found end.");if("}"==e.slice(t,t+1)){l=t+1;break}if((l=this.directiveOrStatement(e,t))<0)throw Be(this._thisDoc,this.lines,e,t,"expected statement or '}'")}return this._anonymousNodes=m,this._variables=this._parentVariables,this._parentVariables=g,this._context=this._parentContext,this._reason2=v,this._parentContext=h,r.push(i.close()),l}if("("==o){var y=this._store.list;for("$"==e.slice(t+1,t+2)&&(y=this._store.newSet,t+=1),l=t+1,d=new we([]);;){if((t=this.skipSpace(e,l))<0)throw Be(this._thisDoc,this.lines,e,t,"needed ')', found end.");if(")"==e.slice(t,t+1)){l=t+1;break}if(f=new we([]),(l=this.item(e,t,f))<0)throw Be(this._thisDoc,this.lines,e,t,"expected item in list or ')'");d.push(f[0])}return r.push(y(d,this._context)),l}if((l=this.tok("this",e,t))>=0)throw Be(this._thisDoc,this.lines,e,t,"Keyword 'this' was ancient N3. Now use @forSome and @forAll keywords.");return(l=this.tok("true",e,t))>=0?(r.push(!0),l):(l=this.tok("false",e,t))>=0?(r.push(!1),l):null==i&&(l=this.uri_ref2(e,t,r))>=0?l:-1}},{key:"property_list",value:function(e,t,r){for(;;){if((l=this.skipSpace(e,t))<0)throw Be(this._thisDoc,this.lines,e,t,"EOF found when expected verb in property list");if(":-"!=e.slice(l,l+2)){t=l;var n=new we([]);if((l=this.verb(e,t,n))<=0)return t;var i=new we([]);if((t=this.objectList(e,l,i))<0)throw Be(this._thisDoc,this.lines,e,l,"objectList expected");var o=new Se(i);try{for(;;){var a=o.next(),s=n[0],c=s[0],u=s[1];"->"==c?this.makeStatement(new be([this._context,u,r,a])):this.makeStatement(new be([this._context,u,a,r]))}}catch(e){if(e!=ke)throw e}if((l=this.skipSpace(e,t))<0)throw Be(this._thisDoc,this.lines,e,l,"EOF found in list of objects");if(";"!=e.slice(t,t+1))return t;t+=1}else{t=l+2;var l,d=new we([]);if((l=this.node(e,t,d,r))<0)throw Be(this._thisDoc,this.lines,e,t,"bad {} or () or [] node after :- ");t=l}}}},{key:"commaSeparatedList",value:function(e,t,r,n){if((i=this.skipSpace(e,t))<0)throw Be(this._thisDoc,this.lines,e,i,"EOF found expecting comma sep list");if("."==e.charAt(i))return t;if(n)var i=this.uri_ref2(e,i,r);else i=this.bareWord(e,i,r);if(i<0)return-1;for(;;){if((t=this.skipSpace(e,i))<0)return t;var o=e.slice(t,t+1);if(","!=o)return"."!=o?-1:t;if((i=n?this.uri_ref2(e,t+1,r):this.bareWord(e,t+1,r))<0)throw Be(this._thisDoc,this.lines,e,i,"bad list content")}}},{key:"objectList",value:function(e,t,r){if((t=this.object(e,t,r))<0)return-1;for(;;){var n=this.skipSpace(e,t);if(n<0)throw Be(this._thisDoc,this.lines,e,n,"EOF found after object");if(","!=e.slice(n,n+1))return n;if((t=this.object(e,n+1,r))<0)return t}}},{key:"checkDot",value:function(e,t){var r=this.skipSpace(e,t);if(r<0)return r;if("."==e.slice(r,r+1))return r+1;if("}"==e.slice(r,r+1))return r;if("]"==e.slice(r,r+1))return r;throw Be(this._thisDoc,this.lines,e,r,"expected '.' or '}' or ']' at end of statement")}},{key:"uri_ref2",value:function(e,t,r){var n=new we([]);if((p=this.qname(e,t,n))>=0){var i=n[0],o=i[0],a=i[1];if(null==o){Ce(0,"not used?");var s=this._baseURI+"#"}else if(!(s=this._bindings[o])){if("_"==o)return r.push(this.anonymousNode(a)),p;throw Be(this._thisDoc,this.lines,e,t,"Prefix "+o+" not bound.")}var c=this._store.sym(s+a);return X(this._variables,c)>=0?r.push(this._variables[c]):r.push(c),p}if((t=this.skipSpace(e,t))<0)return-1;if("?"==e.charAt(t)){var u=new we([]);return(p=this.variable(e,t,u))>0?(r.push(u[0]),p):-1}if("<"==e.charAt(t)){for(var l=t+=1;t<_e(e);){if(">"==e.charAt(t)){var d=e.slice(l,t);return this._baseURI?d=Te(this._baseURI,d):Ce(d.indexOf(":")>=0,"With no base URI, cannot deal with relative URIs"),"#"==e.slice(t-1,t)&&"#"!=Ee(d,-1,null)&&(d+="#"),c=this._store.sym(d),X(this._variables,c)>=0?r.push(this._variables[c]):r.push(c),t+1}t+=1}throw Be(this._thisDoc,this.lines,e,p,"unterminated URI reference")}if(this.keywordsSet){var p;if(u=new we([]),(p=this.bareWord(e,t,u))<0)return-1;if(X(this.keywords,u[0])>=0)throw Be(this._thisDoc,this.lines,e,t,'Keyword "'+u[0]+'" not allowed here.');return r.push(this._store.sym(this._bindings[""]+u[0])),p}return-1}},{key:"skipSpace",value:function(e,t){for(var r=t||0;r<e.length;r++){var n=e.charAt(r);if(" \n\r\t\f\v            ​\u2028\u2029 ".indexOf(n)<0){if("#"!==e.charAt(r))return r;for(;;r++){if(r===e.length)return-1;if("\n"===e.charAt(r)){this.lines=this.lines+1;break}}}else"\n"===e.charAt(r)&&(this.lines=this.lines+1)}return-1}},{key:"variable",value:function(e,t,r){if((n=this.skipSpace(e,t))<0)return-1;if("?"!=e.slice(n,n+1))return-1;var n;if(t=n+=1,"0123456789-".indexOf(e.charAt(n))>=0)throw Be(this._thisDoc,this.lines,e,n,"Varible name can't start with '"+e.charAt(n)+"s'");for(;t<_e(e)&&Ie.indexOf(e.charAt(t))<0;)t+=1;if(null==this._parentContext)throw Be(this._thisDoc,this.lines,e,n,"Can't use ?xxx syntax for variable in outermost level: "+e.slice(n-1,t));return r.push(this._store.variable(e.slice(n,t))),t}},{key:"bareWord",value:function(e,t,r){var n=this.skipSpace(e,t);if(n<0)return-1;var i=e.charAt(n);if("0123456789-".indexOf(i)>=0)return-1;if(Ie.indexOf(i)>=0)return-1;for(t=n;t<_e(e)&&Ie.indexOf(e.charAt(t))<0;)t+=1;return r.push(e.slice(n,t)),t}},{key:"qname",value:function(e,t,r){if((t=this.skipSpace(e,t))<0)return-1;var n=e.charAt(t);if("0123456789-+".indexOf(n)>=0)return-1;if(Ie.indexOf(n)<0){var i=n;for(t+=1;t<_e(e)&&(n=e.charAt(t),Ie.indexOf(n)<0);)i+=n,t+=1}else i="";if(t<_e(e)&&":"==e.charAt(t)){var o=i;for(t+=1,i="";t<_e(e)&&(n=e.charAt(t),Ie.indexOf(n)<0);)i+=n,t+=1;return r.push(new be([o,i])),t}return i&&this.keywordsSet&&X(this.keywords,i)<0?(r.push(new be(["",i])),t):-1}},{key:"object",value:function(e,t,r){if((a=this.subject(e,t,r))>=0)return a;if((a=this.skipSpace(e,t))<0)return-1;t=a;var n=null,i=e.charAt(t);if('"'==i||"'"==i){n=e.slice(t,t+3==i+i)?i+i+i:i,t+=_e(n);var o=this.strconst(e,t,n),a=o[0],s=o[1];return r.push(this._store.literal(s)),a}return-1}},{key:"nodeOrLiteral",value:function(e,t,r){if((c=this.node(e,t,r))>=0)return c;if((c=this.skipSpace(e,t))<0)return-1;t=c;var n=e.charAt(t);if("-+0987654321".indexOf(n)>=0){if(je.lastIndex=0,null!=(d=je.exec(e.slice(t))))c=t+(i=d[0]).length,i.indexOf("T")>=0?r.push(this._store.literal(i,this._store.sym("http://www.w3.org/2001/XMLSchema#dateTime"))):r.push(this._store.literal(i,this._store.sym("http://www.w3.org/2001/XMLSchema#date")));else{var i;if(Ne.lastIndex=0,null==(d=Ne.exec(e.slice(t))))throw Be(this._thisDoc,this.lines,e,t,"Bad number or date syntax");c=t+Ne.lastIndex,(i=e.slice(t,c)).indexOf("e")>=0?r.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#double"))):e.slice(t,c).indexOf(".")>=0?r.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#decimal"))):r.push(this._store.literal(parseInt(i),this._store.sym("http://www.w3.org/2001/XMLSchema#integer")))}return c}if('"'==e.charAt(t)){if('"""'==e.slice(t,t+3))var o='"""';else o='"';t+=_e(o);var a=null,s=this.strconst(e,t,o),c=s[0],u=s[1],l=null;if("@"==e.slice(c,c+1)){var d;if(Le.lastIndex=0,null==(d=Le.exec(e.slice(c+1))))throw Be(this._thisDoc,startline,e,t,"Bad language code syntax on string literal, after @");t=Le.lastIndex+c+1,l=e.slice(c+1,t),c=t}if("^^"==e.slice(c,c+2)){var p=new we([]);c=this.uri_ref2(e,c+2,p),a=p[0]}return r.push(this._store.literal(u,l||a)),c}return-1}},{key:"strconst",value:function(e,t,r){for(var n=t,i="",o=this.lines;n<_e(e);){if(t=n+_e(r),e.slice(n,t)==r)return new be([t,i]);if('"'!=e.charAt(n)){if(Re.lastIndex=0,!Re.exec(e.slice(n)))throw Be(this._thisDoc,o,e,n,"Closing quote missing in string at ^ in "+e.slice(n-20,n)+"^"+e.slice(n,n+20));if(t=n+Re.lastIndex-1,i+=e.slice(n,t),'"'!=(c=e.charAt(t)))if("\r"!=c){if("\n"==c){if('"'==r)throw Be(this._thisDoc,o,e,t,"newline found in string literal");this.lines=this.lines+1,i+=c,n=t+1,this.previousLine=this.startOfLine,this.startOfLine=n}else if("\\"==c){if(n=t+1,!(c=e.slice(n,n+1)))throw Be(this._thisDoc,o,e,t,"unterminated string literal (2)");var a=Ae('abfrtvn\\"',c);if(a>=0)i+='a\b\f\r\t\v\n\\"'.charAt(a),n+=1;else if("u"==c)n=(s=this.uEscape(e,n+1,o))[0],i+=c=s[1];else{if("U"!=c)throw Be(this._thisDoc,this.lines,e,t,"bad escape");var s,c;n=(s=this.UEscape(e,n+1,o))[0],i+=c=s[1]}}}else n=t+1;else n=t}else i=i+'"',n=n+1}throw Be(this._thisDoc,this.lines,e,t,"unterminated string literal")}},{key:"uEscape",value:function(e,t,r){for(var n=t,i=0,o=0;i<4;){var a=e.slice(n,n+1).toLowerCase();if(n+=1,""==a)throw Be(this._thisDoc,r,e,t,"unterminated string literal(3)");var s=Ae("0123456789abcdef",a);if(s<0)throw Be(this._thisDoc,r,e,t,"bad string literal hex escape");o=16*o+s,i+=1}var c=String.fromCharCode(o);return new be([n,c])}},{key:"UEscape",value:function(e,t,r){for(var n=t,i=0,o="\\U";i<8;){var a=e.slice(n,n+1).toLowerCase();if(n+=1,""==a)throw Be(this._thisDoc,r,e,t,"unterminated string literal(3)");if(Ae("0123456789abcdef",a)<0)throw Be(this._thisDoc,r,e,t,"bad string literal hex escape");o+=a,i+=1}var s,c=(s="0x"+Ee(o,2,10)-0,String.fromCharCode(s));return new be([n,c])}}]),e}();function Be(e,t,r,n,i){var o=t+1,a="Line "+o+" of <"+e+">: Bad syntax: "+i+'\nat: "'+r.slice(n,n+30)+'"',s=new SyntaxError(a,e,o);return s.lineNo=o,s.characterInFile=n,s.syntaxProblem=i,s}function He(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function qe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?He(Object(r),!0).forEach((function(t){(0,u.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):He(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ke=qe(qe({},D),{},{supports:(Me={},(0,u.Z)(Me,j.collections,!0),(0,u.Z)(Me,j.defaultGraphType,!1),(0,u.Z)(Me,j.equalsMethod,!0),(0,u.Z)(Me,j.identity,!1),(0,u.Z)(Me,j.id,!0),(0,u.Z)(Me,j.reversibleId,!1),(0,u.Z)(Me,j.variableType,!0),Me),collection:function(e){return new w(e)},id:function(e){var t=this;return(0,g.uZ)(e)?"( ".concat(e.elements.map((function(e){return t.id(e)})).join(", ")," )"):(0,g.cG)(e)?N.toString(e):D.id(e)},termToNQ:function(e){return e.termType===p.fb?w.toNT(e):D.termToNQ(e)}});const We=Ke;function Ve(e,t){return"string"==typeof t?e.rdfFactory.literal(t):Object.prototype.hasOwnProperty.call(t,"@list")?!0===e.rdfFactory.supports.COLLECTIONS?function(e,t){if(!Array.isArray(t))throw new TypeError("Object must be an array");return e.rdfFactory.collection(t.map((function(t){return Ve(e,t)})))}(e,t["@list"]):function(e,t){var r=t["@id"]?Je(e,t):e.rdfFactory.blankNode(),n=t["@list"].map((function(t){return Ve(e,t)})),i=G(e.rdfFactory,r,n);return e.addAll(i),r}(e,t):Object.prototype.hasOwnProperty.call(t,"@id")?Je(e,t):Object.prototype.hasOwnProperty.call(t,"@language")?e.rdfFactory.literal(t["@value"],t["@language"]):Object.prototype.hasOwnProperty.call(t,"@type")?e.rdfFactory.literal(t["@value"],e.rdfFactory.namedNode(t["@type"])):Object.prototype.hasOwnProperty.call(t,"@value")?e.rdfFactory.literal(t["@value"]):e.rdfFactory.literal(t)}function ze(e,t,n,i){var o=n&&Object.prototype.hasOwnProperty.call(n,"termType")?n.value:n;return Promise.all([r.e(805),r.e(670)]).then(r.t.bind(r,6805,23)).then((function(t){return t.flatten(JSON.parse(e),null,{base:o})})).then((function(e){return e.reduce((function(e,r){return t=Ze(t,n,r)}),t)})).then(i).catch(i)}function Je(e,t){return t["@id"].startsWith("_:")?e.rdfFactory.blankNode(t["@id"].substring(2)):e.rdfFactory.namedNode(t["@id"])}function Ze(e,t,r){for(var n=r["@id"]?Je(e,r):e.rdfFactory.blankNode(),i=0,o=Object.keys(r);i<o.length;i++){var a=o[i];if("@id"!==a){if("@graph"==a)for(var s=n,c=r[a],u=0;u<c.length;u++)e=Ze(e,s,c[u]);var l=r[a];if(Array.isArray(l))for(var d=0;d<l.length;d++)e.addStatement($e(e,n,a,l[d],t));else e.addStatement($e(e,n,a,l,t))}}return e}function $e(e,t,r,n,i){var o,a;return"@type"===r?(o=e.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),a=e.rdfFactory.namedNode(n)):(o=e.rdfFactory.namedNode(r),a=Ve(e,n)),e.rdfFactory.quad(t,o,a,e.rdfFactory.namedNode(i))}const Ge="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Xe="http://www.w3.org/2001/XMLSchema#",Ye="http://www.w3.org/2000/10/swap/",Qe={xsd:{decimal:`${Xe}decimal`,boolean:`${Xe}boolean`,double:`${Xe}double`,integer:`${Xe}integer`,string:`${Xe}string`},rdf:{type:`${Ge}type`,nil:`${Ge}nil`,first:`${Ge}first`,rest:`${Ge}rest`,langString:`${Ge}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${Ye}reify#forSome`,forAll:`${Ye}reify#forAll`},log:{implies:`${Ye}log#implies`}};var et=r(4375),tt=r.n(et);const{xsd:rt}=Qe,nt=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,it={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},ot=/[\x00-\x20<>\\"\{\}\|\^\`]/,at={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},st=/$0^/;class ct{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const e in this)!(e in at)&&this[e]instanceof RegExp&&(this[e]=st)}else this._n3Mode=!1!==e.n3;this._comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let r=this._input,n=r.length;for(;;){let e,a;for(;e=this._newline.exec(r);)this._comments&&(a=this._comment.exec(e[0]))&&i("comment",a[1],"",this._line,e[0].length),r=r.substr(e[0].length,r.length),n=r.length,this._line++;if(!e&&(e=this._whitespace.exec(r))&&(r=r.substr(e[0].length,r.length)),this._endOfFile.test(r))return t&&(this._comments&&(a=this._comment.exec(r))&&i("comment",a[1],"",this._line,r.length),r=null,i("eof","","",this._line,0)),this._input=r;const s=this._line,c=r[0];let u="",l="",d="",p=null,f=0,h=!1;switch(c){case"^":if(r.length<3)break;if("^"!==r[1]){this._n3Mode&&(f=1,u="^");break}if(this._previousMarker="^^",r=r.substr(2),"<"!==r[0]){h=!0;break}case"<":if(p=this._unescapedIri.exec(r))u="IRI",l=p[1];else if(p=this._iri.exec(r)){if(l=this._unescape(p[1]),null===l||ot.test(l))return o(this);u="IRI"}else r.length>1&&"<"===r[1]?(u="<<",f=2):this._n3Mode&&r.length>1&&"="===r[1]&&(u="inverse",f=2,l=">");break;case">":r.length>1&&">"===r[1]&&(u=">>",f=2);break;case"_":((p=this._blank.exec(r))||t&&(p=this._blank.exec(`${r} `)))&&(u="blank",d="_",l=p[1]);break;case'"':if(p=this._simpleQuotedString.exec(r))l=p[1];else if(({value:l,matchLength:f}=this._parseLiteral(r)),null===l)return o(this);null===p&&0===f||(u="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(p=this._simpleApostropheString.exec(r))l=p[1];else if(({value:l,matchLength:f}=this._parseLiteral(r)),null===l)return o(this);null===p&&0===f||(u="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(p=this._variable.exec(r))&&(u="var",l=p[0]);break;case"@":"literal"===this._previousMarker&&(p=this._langcode.exec(r))?(u="langcode",l=p[1]):(p=this._keyword.exec(r))&&(u=p[0]);break;case".":if(1===r.length?t:r[1]<"0"||r[1]>"9"){u=".",f=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(p=this._number.exec(r)||t&&(p=this._number.exec(`${r} `)))&&(u="literal",l=p[0],d="string"==typeof p[1]?rt.double:"string"==typeof p[2]?rt.decimal:rt.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(p=this._sparqlKeyword.exec(r))?u=p[0].toUpperCase():h=!0;break;case"f":case"t":(p=this._boolean.exec(r))?(u="literal",l=p[0],d=rt.boolean):h=!0;break;case"a":(p=this._shortPredicates.exec(r))?(u="abbreviation",l="a"):h=!0;break;case"=":this._n3Mode&&r.length>1&&(u="abbreviation",">"!==r[1]?(f=1,l="="):(f=2,l=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(f=1,u=c);break;default:h=!0}if(h&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(p=this._prefix.exec(r))?((p=this._prefixed.exec(r))||t&&(p=this._prefixed.exec(`${r} `)))&&(u="prefixed",d=p[1]||"",l=this._unescape(p[2])):(u="prefix",l=p[1]||"")),"^^"===this._previousMarker)switch(u){case"prefixed":u="type";break;case"IRI":u="typeIRI";break;default:u=""}if(!u)return t||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?o(this):this._input=r;const m=f||p[0].length,g=i(u,l,d,s,m);this.previousToken=g,this._previousMarker=u,r=r.substr(m,r.length)}function i(t,i,o,a,s){const c=r?n-r.length:n,u={type:t,value:i,prefix:o,line:a,start:c,end:c+s};return e(null,u),u}function o(t){e(t._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(e){let t=!1;const r=e.replace(nt,((e,r,n,i)=>{if("string"==typeof r)return String.fromCharCode(Number.parseInt(r,16));if("string"==typeof n){let e=Number.parseInt(n,16);return e<=65535?String.fromCharCode(Number.parseInt(n,16)):String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e))}return i in it?it[i]:(t=!0,"")}));return t?null:r}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],r=t.length;let n=Math.max(this._literalClosingPos,r);for(;(n=e.indexOf(t,n))>0;){let t=0;for(;"\\"===e[n-t-1];)t++;if(t%2==0){const t=e.substring(r,n),i=t.split(/\r\n|\r|\n/).length-1,o=n+r;if(1===r&&0!==i||3===r&&this._lineMode)break;return this._line+=i,{value:this._unescape(t),matchLength:o}}n++}this._literalClosingPos=e.length-r+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\ufeff")?e.substr(1):e}tokenize(e,t){if(this._line=1,"string"==typeof e){if(this._input=this._readStartingBom(e),"function"!=typeof t){const e=[];let t;if(this._tokenizeToEnd(((r,n)=>r?t=r:e.push(n)),!0),t)throw t;return e}tt()((()=>this._tokenizeToEnd(t,!0)))}else this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",(e=>{null!==this._input&&0!==e.length&&(this._pendingBuffer&&(e=Buffer.concat([this._pendingBuffer,e]),this._pendingBuffer=null),128&e[e.length-1]?this._pendingBuffer=e:(void 0===this._input?this._input=this._readStartingBom("string"==typeof e?e:e.toString()):this._input+=e,this._tokenizeToEnd(t,!1)))})),e.on("end",(()=>{"string"==typeof this._input&&this._tokenizeToEnd(t,!0)})),e.on("error",t)}}const{rdf:ut,xsd:lt}=Qe;let dt,pt=0;const ft={namedNode:function(e){return new mt(e)},blankNode:function(e){return new vt(e||"n3-"+pt++)},variable:function(e){return new yt(e)},literal:function(e,t){if("string"==typeof t)return new gt(`"${e}"@${t.toLowerCase()}`);let r=t?t.value:"";return""===r&&("boolean"==typeof e?r=lt.boolean:"number"==typeof e&&(Number.isFinite(e)?r=Number.isInteger(e)?lt.integer:lt.double:(r=lt.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),""===r||r===lt.string?new gt(`"${e}"`):new gt(`"${e}"^^${r}`)},defaultGraph:function(){return dt},quad:wt,triple:wt};class ht{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof ht?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class mt extends ht{get termType(){return"NamedNode"}}class gt extends ht{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let t=e.lastIndexOf('"')+1;return t<e.length&&"@"===e[t++]?e.substr(t).toLowerCase():""}get datatype(){return new mt(this.datatypeString)}get datatypeString(){const e=this.id,t=e.lastIndexOf('"')+1,r=t<e.length?e[t]:"";return"^"===r?e.substr(t+2):"@"!==r?lt.string:ut.langString}equals(e){return e instanceof gt?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class vt extends ht{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class yt extends ht{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}dt=new class extends ht{constructor(){return super(""),dt||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};class bt extends ht{constructor(e,t,r,n){super(""),this._subject=e,this._predicate=t,this._object=r,this._graph=n||dt}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}}function wt(e,t,r,n){return new bt(e,t,r,n)}let xt=0;class _t{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&kt(this,e.factory);const t="string"==typeof e.format?e.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(t),n=/trig/.test(t),i=/triple/.test(t),o=/quad/.test(t),a=this._n3Mode=/n3/.test(t),s=i||o;(this._supportsNamedGraphs=!(r||a))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||n||i||a),this._supportsRDFStar=""===t||/star|\*$/.test(t),s&&(this._resolveRelativeIRI=e=>null),this._blankNodePrefix="string"!=typeof e.blankNodePrefix?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new ct({lineMode:s,n3:a}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){xt=0}_setBase(e){if(e){const t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}_saveContext(e,t,r,n,i){const o=this._n3Mode;this._contextStack.push({type:e,subject:r,predicate:n,object:i,graph:t,inverse:!!o&&this._inversePredicate,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,t){const r=this._contextStack.pop();if(!r||r.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=r.subject,this._predicate=r.predicate,this._object=r.object,this._graph=r.graph,this._n3Mode&&(this._inversePredicate=r.inverse,this._prefixes._=r.blankPrefix,this._quantified=r.quantified)}_readInTopContext(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,t){let r;switch(e.type){case"IRI":case"typeIRI":const t=this._resolveIRI(e.value);if(null===t)return this._error("Invalid IRI",e);r=this._namedNode(t);break;case"type":case"prefixed":const n=this._prefixes[e.prefix];if(void 0===n)return this._error(`Undefined prefix "${e.prefix}:"`,e);r=this._namedNode(n+e.value);break;case"blank":r=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":r=this._variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&r.id in this._quantified&&(r=this._quantified[r.id]),r}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(0===e.prefix.length)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${t}`,e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(0===e.prefix.length)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._object=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return"{"!==e.type?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const t=null===this._predicate;return this._restoreContext("blank",e),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,r=null,n=this._readListItem;const i=this._subject,o=this._contextStack,a=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,r=this._blankNode(),this.RDF_FIRST,this._subject=t=this._blankNode()),n=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,r=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),0!==o.length&&"list"===o[o.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(n=this._readPredicate,this._subject===this.RDF_NIL)return n}else if(n=this._getContextEndReader(),this._object===this.RDF_NIL)return n;r=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,n=this._readListItemDataTypeOrLang):(t=this._literal(e.value,this._namedNode(e.prefix)),n=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if(void 0===(t=this._readEntity(e)))return}if(null===r&&(this._subject=r=this._blankNode()),null===i?null===a.predicate?a.subject=r:a.object=r:this._emit(i,this.RDF_REST,r,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))return this._saveContext("item",this._graph,r,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,t,this._graph)}return n}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const r=this._readEntity(e);if(void 0===r)return;t=this._literal(this._literalValue,r),e=null;break;case"langcode":t=this._literal(this._literalValue,e.value),e=null}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const r=this._completeLiteral(e);if(r)return this._object=r.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===r.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(r.token))}_readFormulaTail(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,r=this._graph;const n=this._subject,i=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(r=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(null!==n){const e=this._predicate,t=this._object;i?this._emit(t,e,n,r):this._emit(n,e,t,r)}return t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if("IRI"!==e.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return","===e.type?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const t=this._contextStack,r=t.length&&t[t.length-1];if(r&&"item"===r.type){const t=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,t,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,r;const n=this._blankNode();if(void 0!==(r=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=n):(t=this._object,this._object=n),this._emit(t,r,n,this._graph),this._readPath}_readBackwardPath(e){const t=this._blankNode();let r,n;if(void 0!==(r=this._readEntity(e)))return null===this._predicate?(n=this._subject,this._subject=t):(n=this._object,this._object=t),this._emit(t,r,n,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return">>"!==e.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(e))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(">>"!==e.type)return this._error(`Expected >> but got ${e.type}`,e);const t=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,r,n){this._callback(null,this._quad(e,t,r,n||this.DEFAULTGRAPH))}_error(e,t){const r=new Error(`${e} on line ${t.line}.`);r.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=Et}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const t=e.length;let r="",n=-1,i=-1,o=0,a="/";for(;n<t;){switch(a){case":":if(i<0&&"/"===e[++n]&&"/"===e[++n])for(;(i=n+1)<t&&"/"!==e[i];)n=i;break;case"?":case"#":n=t;break;case"/":if("."===e[n+1])switch(a=e[1+ ++n],a){case"/":r+=e.substring(o,n-1),o=n+1;break;case void 0:case"?":case"#":return r+e.substring(o,n)+e.substr(n+1);case".":if(a=e[1+ ++n],void 0===a||"/"===a||"?"===a||"#"===a){if(r+=e.substring(o,n-2),(o=r.lastIndexOf("/"))>=i&&(r=r.substr(0,o)),"/"!==a)return`${r}/${e.substr(n+1)}`;o=n+1}}}a=e[++n]}return r+e.substring(o)}parse(e,t,r){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${xt++}_`,this._prefixCallback=r||Et,this._inversePredicate=!1,this._quantified=Object.create(null),!t){const t=[];let r;if(this._callback=(e,n)=>{e?r=e:n&&t.push(n)},this._lexer.tokenize(e).every((e=>this._readCallback=this._readCallback(e))),r)throw r;return t}this._callback=t,this._lexer.tokenize(e,((e,t)=>{null!==e?(this._callback(e),this._callback=Et):this._readCallback&&(this._readCallback=this._readCallback(t))}))}}function Et(){}function kt(e,t){const r=t.namedNode;e._namedNode=r,e._blankNode=t.blankNode,e._literal=t.literal,e._variable=t.variable,e._quad=t.quad,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=r(Qe.rdf.first),e.RDF_REST=r(Qe.rdf.rest),e.RDF_NIL=r(Qe.rdf.nil),e.N3_FORALL=r(Qe.r.forAll),e.N3_FORSOME=r(Qe.r.forSome),e.ABBREVIATIONS={a:r(Qe.rdf.type),"=":r(Qe.owl.sameAs),">":r(Qe.log.implies)},e.QUANTIFIERS_GRAPH=r("urn:n3:quantifiers")}if(kt(_t.prototype,ft),void 0===St)var St={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12};var At=function(){function e(t,r){(0,i.Z)(this,e),this.options=r||{},this.kb=t,this.target=r.target||{graph:{subjects:{},prefixes:{},terms:{}}},this.blankNodes=[],this.htmlOptions={selfClosing:"br img input area base basefont col colgroup source wbr isindex link meta param hr"},this.theOne="_:"+(new Date).getTime(),this.language=null,this.vocabulary=null,this.blankCounter=0,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"}],this.inXHTMLMode=!1,this.absURIRE=/[\w\_\-]+:\S+/,this.finishedHandlers=[],this.init()}return(0,n.Z)(e,[{key:"addTriple",value:function(e,t,r,n){var i,o,a,s;i=void 0===t?D.namedNode(this.options.base):this.toRDFNodeObject(t),a=this.toRDFNodeObject(r),o=this.toRDFNodeObject(n),s=D.namedNode(this.options.base),this.kb.add(i,a,o,s)}},{key:"ancestorPath",value:function(e){for(var t="";e&&e.nodeType!==St.DOCUMENT_NODE;)t="/"+e.localName+t,e=e.parentNode;return t}},{key:"copyMappings",value:function(e){var t={};for(var r in e)t[r]=e[r];return t}},{key:"copyProperties",value:function(){}},{key:"deriveDateTimeType",value:function(t){for(var r=0;r<e.dateTimeTypes.length;r++){var n=e.dateTimeTypes[r].pattern.exec(t);if(n&&n[0].length===t.length)return e.dateTimeTypes[r].type}return null}},{key:"init",value:function(){}},{key:"newBlankNode",value:function(){return this.blankCounter++,"_:"+this.blankCounter}},{key:"newSubjectOrigin",value:function(e,t){}},{key:"parseCURIE",value:function(t,r,n){var i,o=t.indexOf(":");if(o>=0){var a=t.substring(0,o);if(""===a)return(i=r[""])?i+t.substring(o+1):null;if("_"===a)return"_:"+t.substring(o+1);if(e.NCNAME.test(a)&&(i=r[a]))return i+t.substring(o+1)}return null}},{key:"parseCURIEOrURI",value:function(e,t,r){return this.parseCURIE(e,t,r)||this.resolveAndNormalize(r,e)}},{key:"parsePredicate",value:function(e,t,r,n,i,o){if(""===e)return null;var a=this.parseTermOrCURIEOrAbsURI(e,t,o?null:r,n,i);return a&&0===a.indexOf("_:")?null:a}},{key:"parsePrefixMappings",value:function(e,t){for(var r=this.tokenize(e),n=null,i=0;i<r.length;i++)":"===r[i][r[i].length-1]?n=r[i].substring(0,r[i].length-1):n&&(t[n]=this.options.base?F.join(r[i],this.options.base):r[i],n=null)}},{key:"parseSafeCURIEOrCURIEOrURI",value:function(e,t,r){return"["===(e=this.trim(e)).charAt(0)&&"]"===e.charAt(e.length-1)?0===(e=(e=e.substring(1,e.length-1)).trim(e)).length?null:"_:"===e?this.theOne:this.parseCURIE(e,t,r):this.parseCURIEOrURI(e,t,r)}},{key:"parseTermOrCURIEOrAbsURI",value:function(e,t,r,n,i){e=this.trim(e);var o=this.parseCURIE(e,n,i);if(o)return o;if(r){if(t&&!this.absURIRE.exec(e))return t+e;var a=r[e];if(a)return a;if(a=r[e.toLowerCase()])return a}return this.absURIRE.exec(e)?this.resolveAndNormalize(i,e):null}},{key:"parseTermOrCURIEOrURI",value:function(e,t,r,n,i){e=this.trim(e);var o=this.parseCURIE(e,n,i);if(o)return o;var a=r[e];return a||((a=r[e.toLowerCase()])?a:t&&!this.absURIRE.exec(e)?t+e:this.resolveAndNormalize(i,e))}},{key:"parseURI",value:function(e){return e}},{key:"process",value:function(t,r){var n;r=r||{},t.nodeType===St.DOCUMENT_NODE?(t.baseURI&&!r.baseURI&&(r.baseURI=t.baseURI),n=t.baseURI,(t=t.documentElement).baseURI||(t.baseURI=n),this.setContext(t)):t.parentNode.nodeType===St.DOCUMENT_NODE&&this.setContext(t);var i=[],o=function(e){if(!e&&r&&r.baseURI)return r.baseURI;var t=e.indexOf("#");return t>=0&&(e=e.substring(0,t)),r&&r.baseURIMap&&(e=r.baseURIMap(e)),e};for(i.push({current:t,context:this.push(null,o(t.baseURI))});i.length>0;){var a=i.shift();if(a.parent){if(a.context.parent&&a.context.parent.listMapping===a.listMapping)continue;for(var s in a.listMapping){var c=a.listMapping[s];if(0!==c.length){for(var u=[],l=0;l<c.length;l++)u.push(this.newBlankNode());for(var d=0;d<u.length;d++)this.addTriple(a.parent,u[d],"http://www.w3.org/1999/02/22-rdf-syntax-ns#first",c[d]),this.addTriple(a.parent,u[d],"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",{type:e.objectURI,value:d+1<u.length?u[d+1]:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"});this.addTriple(a.parent,a.subject,s,{type:e.objectURI,value:u[0]})}else this.addTriple(a.parent,a.subject,s,{type:e.objectURI,value:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"})}}else{var p=a.current,f=a.context,h=!1,m=null,g=null,v=null,y=f.prefixes,b=!1,w=[],x=f.listMapping,_=!f.parent,E=f.language,k=f.vocabulary;n=this.parseURI(o(p.baseURI)),p.item=null;var S=p.getAttributeNode("vocab");if(S){var A=this.trim(S.value);if(A.length>0){k=A;var C=n.spec;this.addTriple(p,C,"http://www.w3.org/ns/rdfa#usesVocabulary",{type:e.objectURI,value:k})}else k=this.vocabulary}for(var T=0;T<p.attributes.length;T++){var O=p.attributes[T];if("x"===O.nodeName.charAt(0)&&0===O.nodeName.indexOf("xmlns:")){b||(y=this.copyMappings(y),b=!0);var P=O.nodeName.substring(6),I=e.trim(O.value);y[P]=this.options.base?F.join(I,this.options.base):I}}var N=p.getAttributeNode("prefix");N&&(b||(y=this.copyMappings(y),b=!0),this.parsePrefixMappings(N.value,y));for(var j=null,R=0;!j&&R<this.langAttributes.length;R++)j=p.getAttributeNodeNS(this.langAttributes[R].namespaceURI,this.langAttributes[R].localName);if(j){var L=e.trim(j.value);E=L.length>0?L:null}var D,M,U=p.getAttributeNode("rel"),B=p.getAttributeNode("rev"),H=p.getAttributeNode("typeof"),q=p.getAttributeNode("property"),K=p.getAttributeNode("datatype"),W=this.inHTMLMode?p.getAttributeNode("datetime"):null,V=p.getAttributeNode("content"),z=p.getAttributeNode("about"),J=p.getAttributeNode("src"),Z=p.getAttributeNode("resource"),$=p.getAttributeNode("href"),G=p.getAttributeNode("inlist"),X=[];if(U){M=this.tokenize(U.value);for(var Y=0;Y<M.length;Y++)(D=this.parsePredicate(M[Y],k,f.terms,y,n,this.inHTMLMode&&null!==q))&&X.push(D)}var Q=[];if(B){M=this.tokenize(B.value);for(var ee=0;ee<M.length;ee++)(D=this.parsePredicate(M[ee],k,f.terms,y,n,this.inHTMLMode&&q))&&Q.push(D)}if(this.inHTMLMode&&(U||B)&&q&&(0===X.length&&(U=null),0===Q.length&&(B=null)),U||B?(z&&(m=this.parseSafeCURIEOrCURIEOrURI(z.value,y,n)),H&&(v=m),m||(p.parentNode.nodeType===St.DOCUMENT_NODE?m=o(p.baseURI):f.parentObject&&(m=o(p.parentNode.baseURI)===f.parentObject?o(p.baseURI):f.parentObject)),Z&&(g=this.parseSafeCURIEOrCURIEOrURI(Z.value,y,n)),g||($?g=this.resolveAndNormalize(n,encodeURI($.value)):J?g=this.resolveAndNormalize(n,encodeURI(J.value)):!H||z||this.inXHTMLMode&&("head"===p.localName||"body"===p.localName)||(g=this.newBlankNode())),!H||z||!this.inXHTMLMode||"head"!==p.localName&&"body"!==p.localName?H&&!z&&(v=g):v=m):!q||V||K?(z&&(m=this.parseSafeCURIEOrCURIEOrURI(z.value,y,n)),!m&&Z&&(m=this.parseSafeCURIEOrCURIEOrURI(Z.value,y,n)),!m&&$&&(m=this.resolveAndNormalize(n,encodeURI($.value))),!m&&J&&(m=this.resolveAndNormalize(n,encodeURI(J.value))),m||(p.parentNode.nodeType===St.DOCUMENT_NODE?m=o(p.baseURI):!this.inXHTMLMode&&!this.inHTMLMode||"head"!==p.localName&&"body"!==p.localName?H?m=this.newBlankNode():f.parentObject&&(m=o(p.parentNode.baseURI)===f.parentObject?o(p.baseURI):f.parentObject,q||(h=!0)):m=o(p.parentNode.baseURI)===f.parentObject?o(p.baseURI):f.parentObject),H&&(v=m)):(z&&(m=this.parseSafeCURIEOrCURIEOrURI(z.value,y,n),H&&(v=m)),m||p.parentNode.nodeType!==St.DOCUMENT_NODE?!m&&f.parentObject&&(m=o(p.parentNode.baseURI)===f.parentObject?o(p.baseURI):f.parentObject):(m=o(p.baseURI),H&&(v=m)),H&&!v&&(Z&&(v=this.parseSafeCURIEOrCURIEOrURI(Z.value,y,n)),!v&&$&&(v=this.resolveAndNormalize(n,encodeURI($.value))),!v&&J&&(v=this.resolveAndNormalize(n,encodeURI(J.value))),v||!this.inXHTMLMode&&!this.inHTMLMode||"head"!==p.localName&&"body"!==p.localName||(v=m),v||(v=this.newBlankNode()),g=v)),m&&(z||Z||v)){var te=m;H&&!z&&!Z&&g&&(te=g),this.newSubjectOrigin(p,te)}if(v){M=this.tokenize(H.value);for(var re=0;re<M.length;re++){var ne=this.parseTermOrCURIEOrAbsURI(M[re],k,f.terms,y,n);ne&&this.addTriple(p,v,e.typeURI,{type:e.objectURI,value:ne})}}if(m&&m!==f.parentObject&&(x={},_=!0),g){if(U&&G)for(var ie=0;ie<X.length;ie++){var oe=x[X[ie]];oe||(oe=[],x[X[ie]]=oe),oe.push({type:e.objectURI,value:g})}else if(U)for(var ae=0;ae<X.length;ae++)this.addTriple(p,m,X[ae],{type:e.objectURI,value:g});if(B)for(var se=0;se<Q.length;se++)this.addTriple(p,g,Q[se],{type:e.objectURI,value:m})}else{if(m&&!g&&(U||B)&&(g=this.newBlankNode()),U&&G)for(var ce=0;ce<X.length;ce++){var ue=x[X[ce]];ue||(ue=[],x[D]=ue),w.push({predicate:X[ce],list:ue})}else if(U)for(var le=0;le<X.length;le++)w.push({predicate:X[le],forward:!0});if(B)for(var de=0;de<Q.length;de++)w.push({predicate:Q[de],forward:!1})}if(q){var pe=null,fe=null;K?(pe=""===K.value?e.PlainLiteralURI:this.parseTermOrCURIEOrAbsURI(K.value,k,f.terms,y,n),fe=W&&!V?W.value:pe===e.XMLLiteralURI||pe===e.HTMLLiteralURI?null:V?V.value:p.textContent):V?(pe=e.PlainLiteralURI,fe=V.value):W?(fe=W.value,(pe=e.deriveDateTimeType(fe))||(pe=e.PlainLiteralURI)):U||B||(Z&&(fe=this.parseSafeCURIEOrCURIEOrURI(Z.value,y,n)),!fe&&$?fe=this.resolveAndNormalize(n,encodeURI($.value)):!fe&&J&&(fe=this.resolveAndNormalize(n,encodeURI(J.value))),fe&&(pe=e.objectURI)),pe||(H&&!z?(pe=e.objectURI,fe=v):(fe=p.textContent,this.inHTMLMode&&"time"===p.localName&&(pe=e.deriveDateTimeType(fe)),pe||(pe=e.PlainLiteralURI))),M=this.tokenize(q.value);for(var he=0;he<M.length;he++){var me=this.parsePredicate(M[he],k,f.terms,y,n);if(me)if(G){var ge=x[me];ge||(ge=[],x[me]=ge),ge.push(pe===e.XMLLiteralURI||pe===e.HTMLLiteralURI?{type:pe,value:p.childNodes}:{type:pe||e.PlainLiteralURI,value:fe,language:E})}else pe===e.XMLLiteralURI||pe===e.HTMLLiteralURI?this.addTriple(p,m,me,{type:pe,value:p.childNodes}):this.addTriple(p,m,me,{type:pe||e.PlainLiteralURI,value:fe,language:E})}}if(m&&!h)for(var ve=0;ve<f.incomplete.length;ve++)f.incomplete[ve].list?f.incomplete[ve].list.push({type:e.objectURI,value:m}):f.incomplete[ve].forward?this.addTriple(p,f.subject,f.incomplete[ve].predicate,{type:e.objectURI,value:m}):this.addTriple(p,m,f.incomplete[ve].predicate,{type:e.objectURI,value:f.subject});var ye=null,be=m;h?((ye=this.push(f,f.subject)).parentObject=o(p.parentNode.baseURI)===f.parentObject?o(p.baseURI):f.parentObject,ye.incomplete=f.incomplete,ye.language=E,ye.prefixes=y,ye.vocabulary=k):((ye=this.push(f,m)).parentObject=g||m||f.subject,ye.prefixes=y,ye.incomplete=w,g&&(be=g,x={},_=!0),ye.listMapping=x,ye.language=E,ye.vocabulary=k),_&&i.unshift({parent:p,context:f,subject:be,listMapping:x});for(var we=p.lastChild;we;we=we.previousSibling)we.nodeType===St.ELEMENT_NODE&&i.unshift({current:we,context:ye})}}this.inHTMLMode&&this.copyProperties();for(var xe=0;xe<this.finishedHandlers.length;xe++)this.finishedHandlers[xe](t)}},{key:"push",value:function(e,t){return{parent:e,subject:t||(e?e.subject:null),parentObject:null,incomplete:[],listMapping:e?e.listMapping:{},language:e?e.language:this.language,prefixes:e?e.prefixes:this.target.graph.prefixes,terms:e?e.terms:this.target.graph.terms,vocabulary:e?e.vocabulary:this.vocabulary}}},{key:"resolveAndNormalize",value:function(e,t){return F.join(t,e)}},{key:"setContext",value:function(e){"html"===e.localName&&"XHTML+RDFa 1.1"===e.getAttribute("version")?this.setXHTMLContext():"html"===e.localName||"http://www.w3.org/1999/xhtml"===e.namespaceURI?"undefined"!=typeof document&&document.doctype?"-//W3C//DTD XHTML+RDFa 1.0//EN"===document.doctype.publicId&&"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"===document.doctype.systemId?(console.log("WARNING: RDF 1.0 is not supported. Defaulting to HTML5 mode."),this.setHTMLContext()):"-//W3C//DTD XHTML+RDFa 1.1//EN"===document.doctype.publicId&&"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd"===document.doctype.systemId?this.setXHTMLContext():this.setHTMLContext():this.setHTMLContext():this.setXMLContext()}},{key:"setHTMLContext",value:function(){this.setInitialContext(),this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"},{namespaceURI:null,localName:"lang"}],this.inXHTMLMode=!1,this.inHTMLMode=!0}},{key:"setInitialContext",value:function(){this.vocabulary=null,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"}]}},{key:"setXHTMLContext",value:function(){this.setInitialContext(),this.inXHTMLMode=!0,this.inHTMLMode=!1,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"},{namespaceURI:null,localName:"lang"}],this.target.graph.terms.alternate="http://www.w3.org/1999/xhtml/vocab#alternate",this.target.graph.terms.appendix="http://www.w3.org/1999/xhtml/vocab#appendix",this.target.graph.terms.bookmark="http://www.w3.org/1999/xhtml/vocab#bookmark",this.target.graph.terms.cite="http://www.w3.org/1999/xhtml/vocab#cite",this.target.graph.terms.chapter="http://www.w3.org/1999/xhtml/vocab#chapter",this.target.graph.terms.contents="http://www.w3.org/1999/xhtml/vocab#contents",this.target.graph.terms.copyright="http://www.w3.org/1999/xhtml/vocab#copyright",this.target.graph.terms.first="http://www.w3.org/1999/xhtml/vocab#first",this.target.graph.terms.glossary="http://www.w3.org/1999/xhtml/vocab#glossary",this.target.graph.terms.help="http://www.w3.org/1999/xhtml/vocab#help",this.target.graph.terms.icon="http://www.w3.org/1999/xhtml/vocab#icon",this.target.graph.terms.index="http://www.w3.org/1999/xhtml/vocab#index",this.target.graph.terms.last="http://www.w3.org/1999/xhtml/vocab#last",this.target.graph.terms.license="http://www.w3.org/1999/xhtml/vocab#license",this.target.graph.terms.meta="http://www.w3.org/1999/xhtml/vocab#meta",this.target.graph.terms.next="http://www.w3.org/1999/xhtml/vocab#next",this.target.graph.terms.prev="http://www.w3.org/1999/xhtml/vocab#prev",this.target.graph.terms.previous="http://www.w3.org/1999/xhtml/vocab#previous",this.target.graph.terms.section="http://www.w3.org/1999/xhtml/vocab#section",this.target.graph.terms.stylesheet="http://www.w3.org/1999/xhtml/vocab#stylesheet",this.target.graph.terms.subsection="http://www.w3.org/1999/xhtml/vocab#subsection",this.target.graph.terms.start="http://www.w3.org/1999/xhtml/vocab#start",this.target.graph.terms.top="http://www.w3.org/1999/xhtml/vocab#top",this.target.graph.terms.up="http://www.w3.org/1999/xhtml/vocab#up",this.target.graph.terms.p3pv1="http://www.w3.org/1999/xhtml/vocab#p3pv1",this.target.graph.terms.related="http://www.w3.org/1999/xhtml/vocab#related",this.target.graph.terms.role="http://www.w3.org/1999/xhtml/vocab#role",this.target.graph.terms.transformation="http://www.w3.org/1999/xhtml/vocab#transformation"}},{key:"setXMLContext",value:function(){this.setInitialContext(),this.inXHTMLMode=!1,this.inHTMLMode=!1}},{key:"tokenize",value:function(e){return this.trim(e).split(/\s+/)}},{key:"toRDFNodeObject",value:function(t){var r=this;if(void 0!==t){if("string"==typeof t)return"_:"===t.substring(0,2)?(void 0===this.blankNodes[t.substring(2)]&&(this.blankNodes[t.substring(2)]=new f(t.substring(2))),this.blankNodes[t.substring(2)]):D.namedNode(t);switch(t.type){case e.objectURI:return"_:"===t.value.substring(0,2)?(void 0===this.blankNodes[t.value.substring(2)]&&(this.blankNodes[t.value.substring(2)]=new f(t.value.substring(2))),this.blankNodes[t.value.substring(2)]):D.namedNode(t.value);case e.PlainLiteralURI:return new y(t.value,t.language||"");case e.XMLLiteralURI:case e.HTMLLiteralURI:var n="";return Object.keys(t.value).forEach((function(e){n+=B.domToString(t.value[e],r.htmlOptions)})),new y(n,"",new m.Z(t.type));default:return new y(t.value,"",new m.Z(t.type))}}}},{key:"trim",value:function(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}],[{key:"parseRDFaDOM",value:function(t,r,n){var i=new e(r,{base:n});t.baseURI||(t.baseURI=n),i.process(t,{baseURI:n})}},{key:"tokenize",value:function(e){return this.trim(e).split(/\s+/)}},{key:"trim",value:function(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}]),e}();At.XMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",At.HTMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",At.PlainLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral",At.objectURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#object",At.typeURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",At.nameChar="[-A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�က0-F.0-9·̀-ͯ‿-⁀]",At.nameStartChar="[A-Za-zÀ-ÖØ-öø-ÿĀ-ıĴ-ľŁ-ňŊ-žƀ-ǃǍ-ǰǴ-ǵǺ-ȗɐ-ʨʻ-ˁΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϖϚϜϞϠϢ-ϳЁ-ЌЎ-яё-ќў-ҁҐ-ӄӇ-ӈӋ-ӌӐ-ӫӮ-ӵӸ-ӹԱ-Ֆՙա-ֆא-תװ-ײء-غف-يٱ-ڷں-ھۀ-ێې-ۓەۥ-ۦअ-हऽक़-ॡঅ-ঌএ-ঐও-নপ-রলশ-হড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઋઍએ-ઑઓ-નપ-રલ-ળવ-હઽૠଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଶ-ହଽଡ଼-ଢ଼ୟ-ୡஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-வஷ-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡก-ฮะา-ำเ-ๅກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ຮະາ-ຳຽເ-ໄཀ-ཇཉ-ཀྵႠ-Ⴥა-ჶᄀᄂ-ᄃᄅ-ᄇᄉᄋ-ᄌᄎ-ᄒᄼᄾᅀᅌᅎᅐᅔ-ᅕᅙᅟ-ᅡᅣᅥᅧᅩᅭ-ᅮᅲ-ᅳᅵᆞᆨᆫᆮ-ᆯᆷ-ᆸᆺᆼ-ᇂᇫᇰᇹḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼΩK-Å℮ↀ-ↂぁ-ゔァ-ヺㄅ-ㄬ가-힣一-龥〇〡-〩_]",At.NCNAME=new RegExp("^"+At.nameStartChar+At.nameChar+"*$"),At.dateTimeTypes=[{pattern:/-?P(?:[0-9]+Y)?(?:[0-9]+M)?(?:[0-9]+D)?(?:T(?:[0-9]+H)?(?:[0-9]+M)?(?:[0-9]+(?:\.[0-9]+)?S)?)?/,type:"http://www.w3.org/2001/XMLSchema#duration"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]-[0-9][0-9]T(?:[0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?(?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#dateTime"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]-[0-9][0-9](?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#date"},{pattern:/(?:[0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?(?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#time"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]/,type:"http://www.w3.org/2001/XMLSchema#gYearMonth"},{pattern:/-?[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9]/,type:"http://www.w3.org/2001/XMLSchema#gYear"}];var Ct=At.parseRDFaDOM,Tt=function(){function e(t){(0,i.Z)(this,e),this.store=t,this.bnodes={},this.why=null,this.reify=!1}return(0,n.Z)(e,[{key:"frameFactory",value:function(t,r,n){return{NODE:1,ARC:2,parent:r,parser:t,store:t.store,element:n,lastChild:0,base:null,lang:null,node:null,nodeType:null,listIndex:1,rdfid:null,datatype:null,collection:!1,terminateFrame:function(){this.collection&&this.node.close()},addSymbol:function(e,t){t=F.join(t,this.base),this.node=this.store.sym(t),this.nodeType=e},loadTriple:function(){if(this.parent.parent.collection?this.parent.parent.node.append(this.node):this.store.add(this.parent.parent.node,this.parent.node,this.node,this.parser.why),null!=this.parent.rdfid){var t=this.store.sym(F.join("#"+this.parent.rdfid,this.base));this.store.add(t,this.store.sym(e.ns.RDF+"type"),this.store.sym(e.ns.RDF+"Statement"),this.parser.why),this.store.add(t,this.store.sym(e.ns.RDF+"subject"),this.parent.parent.node,this.parser.why),this.store.add(t,this.store.sym(e.ns.RDF+"predicate"),this.parent.node,this.parser.why),this.store.add(t,this.store.sym(e.ns.RDF+"object"),this.node,this.parser.why)}},isTripleToLoad:function(){return null!=this.parent&&null!=this.parent.parent&&this.nodeType===this.NODE&&this.parent.nodeType===this.ARC&&this.parent.parent.nodeType===this.NODE},addNode:function(e){this.addSymbol(this.NODE,e),this.isTripleToLoad()&&this.loadTriple()},addCollection:function(){this.nodeType=this.NODE,this.node=this.store.collection(),this.collection=!0,this.isTripleToLoad()&&this.loadTriple()},addCollectionArc:function(){this.nodeType=this.ARC},addBNode:function(e){null!=e?null!=this.parser.bnodes[e]?this.node=this.parser.bnodes[e]:this.node=this.parser.bnodes[e]=this.store.bnode():this.node=this.store.bnode(),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()},addArc:function(t){t===e.ns.RDF+"li"&&(t=e.ns.RDF+"_"+this.parent.listIndex,this.parent.listIndex++),this.addSymbol(this.ARC,t)},addLiteral:function(t){this.parent.datatype&&this.parent.datatype!==e.ns.RDF+"langString"?this.node=this.store.literal(t,this.store.sym(this.parent.datatype)):this.node=this.store.literal(t,this.lang),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()}}}},{key:"getAttributeNodeNS",value:function(e,t,r){var n=null;if(e.getAttributeNodeNS)n=e.getAttributeNodeNS(t,r);else for(var i,o=e.attributes,a=0;a<o.length;++a)if((i=o[a]).namespaceURI===t&&(i.prefix?i.prefix+":"+r:r)===i.nodeName){n=i;break}return n}},{key:"parse",value:function(t,r,n){var i,o=t.childNodes;if(this.cleanParser(),t.nodeType===e.nodeType.DOCUMENT){for(var a=0;a<o.length;a++)if(o[a].nodeType===e.nodeType.ELEMENT){i=o[a];break}}else{if(t.nodeType!==e.nodeType.ELEMENT)throw new Error("RDFParser: can't find root in "+r+". Halting. ");i=t}this.why=n;var s=this.frameFactory(this);return this.base=r,s.base=r,s.lang=null,this.parseDOM(this.buildFrame(s,i)),!0}},{key:"parseDOM",value:function(t){for(var r,n=function(e){var t="";if(null==e.namespaceURI)throw new Error("RDF/XML syntax error: No namespace for "+e.localName+" in "+this.base);return e.namespaceURI&&(t+=e.namespaceURI),e.localName?t+=e.localName:e.nodeName&&(e.nodeName.indexOf(":")>=0?t+=e.nodeName.split(":")[1]:t+=e.nodeName),t}.bind(this),i=!0;t.parent;){var o=t.element,a=o.attributes;if(o.nodeType===e.nodeType.TEXT||o.nodeType===e.nodeType.CDATA_SECTION)t.parent.nodeType===t.NODE&&(t.addArc(e.ns.RDF+"value"),t=this.buildFrame(t)),t.addLiteral(o.nodeValue);else if(n(o)!==e.ns.RDF+"RDF")if(t.parent&&t.parent.collection&&(t.addCollectionArc(),(t=this.buildFrame(t,t.element)).parent.element=null),t.parent&&t.parent.nodeType&&t.parent.nodeType!==t.ARC){t.addArc(n(o)),this.reify&&(r=this.getAttributeNodeNS(o,e.ns.RDF,"ID"))&&(t.rdfid=r.nodeValue,o.removeAttributeNode(r));var s=this.getAttributeNodeNS(o,e.ns.RDF,"parseType"),c=this.getAttributeNodeNS(o,e.ns.RDF,"datatype");if(c&&(t.datatype=c.nodeValue,o.removeAttributeNode(c)),s){var u=s.nodeValue;"Literal"===u?(t.datatype=e.ns.RDF+"XMLLiteral",(t=this.buildFrame(t)).addLiteral(o.childNodes),i=!1):"Resource"===u?((t=this.buildFrame(t,t.element)).parent.element=null,t.addBNode()):"Collection"===u&&((t=this.buildFrame(t,t.element)).parent.element=null,t.addCollection()),o.removeAttributeNode(s)}if(0!==a.length){var l=this.getAttributeNodeNS(o,e.ns.RDF,"resource"),d=this.getAttributeNodeNS(o,e.ns.RDF,"nodeID");t=this.buildFrame(t),l?(t.addNode(l.nodeValue),o.removeAttributeNode(l)):d?(t.addBNode(d.nodeValue),o.removeAttributeNode(d)):t.addBNode();for(var p=a.length-1;p>=0;p--){var f=this.buildFrame(t);f.addArc(n(a[p])),n(a[p])===e.ns.RDF+"type"?this.buildFrame(f).addNode(a[p].nodeValue):this.buildFrame(f).addLiteral(a[p].nodeValue)}}else 0===o.childNodes.length&&this.buildFrame(t).addLiteral("")}else{var h=this.getAttributeNodeNS(o,e.ns.RDF,"about");if(r=this.getAttributeNodeNS(o,e.ns.RDF,"ID"),h&&r)throw new Error("RDFParser: "+o.nodeName+" has both rdf:id and rdf:about. Halting. Only one of these properties may be specified on a node.");if(!h&&r)t.addNode("#"+r.nodeValue),o.removeAttributeNode(r);else if(null==h&&null==r){var m=this.getAttributeNodeNS(o,e.ns.RDF,"nodeID");m?(t.addBNode(m.nodeValue),o.removeAttributeNode(m)):t.addBNode()}else t.addNode(h.nodeValue),o.removeAttributeNode(h);var g=this.getAttributeNodeNS(o,e.ns.RDF,"type");e.ns.RDF+"Description"!==n(o)&&(g={nodeValue:n(o)}),null!=g&&(this.store.add(t.node,this.store.sym(e.ns.RDF+"type"),this.store.sym(F.join(g.nodeValue,t.base)),this.why),g.nodeName&&o.removeAttributeNode(g));for(var v=a.length-1;v>=0;v--)this.store.add(t.node,this.store.sym(n(a[v])),this.store.literal(a[v].nodeValue,t.lang),this.why)}for(o=t.element;t.parent;){for(var y=t;null==o;)o=(t=t.parent).element;var b=o.childNodes&&o.childNodes[t.lastChild];if(b&&i){if((b.nodeType===e.nodeType.ELEMENT||b.nodeType===e.nodeType.TEXT||b.nodeType===e.nodeType.CDATA_SECTION)&&(b.nodeType!==e.nodeType.TEXT&&b.nodeType!==e.nodeType.CDATA_SECTION||1===o.childNodes.length)){t.lastChild++,t=this.buildFrame(y,o.childNodes[t.lastChild-1]);break}t.lastChild++}else{if(t.terminateFrame(),!(t=t.parent))break;o=t.element,i=!0}}}}},{key:"cleanParser",value:function(){this.bnodes={},this.why=null}},{key:"buildFrame",value:function(t,r){var n=this.frameFactory(this,t,r);if(t&&(n.base=t.base,n.lang=t.lang),!r||r.nodeType===e.nodeType.TEXT||r.nodeType===e.nodeType.CDATA_SECTION)return n;var i=r.attributes,o=r.getAttributeNode("xml:base");null!=o&&(n.base=o.nodeValue,r.removeAttribute("xml:base"));var a=r.getAttributeNode("xml:lang");null!=a&&(n.lang=a.nodeValue,r.removeAttribute("xml:lang"));for(var s=i.length-1;s>=0;s--)if("xml"===i[s].nodeName.substr(0,3)){if("xmlns:"===i[s].name.slice(0,6)){var c=i[s].nodeValue;this.base&&(c=F.join(c,this.base)),this.store.setPrefixForURI(i[s].name.slice(6),c)}r.removeAttributeNode(i[s])}return n}}]),e}();function Ot(e,t,r){var n,i,o,a=["INSERT","DELETE","WHERE"],s=U("http://www.w3.org/ns/pim/patch#"),c=De(t,t,r,r,null,null,"",null),u={},l=function(e,t,r,n,i){return"Line "+(t+1)+" of <"+e+">: Bad syntax:\n "+i+'\n at: "'+r.slice(n,n+30)+'"'};n=0;var d=t.sym(r+"#query");for(u.query=d;;){if((i=c.skipSpace(e,n))<0)return u;if(";"===e[i]){if((n=c.skipSpace(e,i+1))<0)return u;i=n}var p=!1;for(o=0;o<a.length;o++){var f=a[o];if(e.slice(i,i+f.length)===f){if((n=c.skipSpace(e,i+f.length))<0)throw l(c._thisDoc,c.lines,e,i+f.length,"found EOF, needed {...} after "+f);if(("INSERT"===f||"DELETE"===f)&&"DATA"===e.slice(n,n+4)){if((i=c.skipSpace(e,n+4))<0)throw l(c._thisDoc,c.lines,e,n+4,"needed {...} after INSERT DATA "+f);n=i}var h=[];if((i=c.node(e,n,h))<0)throw l(c._thisDoc,c.lines,e,n,"bad syntax or EOF in {...} after "+f);u[f.toLowerCase()]=h[0],t.add(d,s(f.toLowerCase()),h[0]),p=!0,n=i}}if(!p&&"@prefix"===e.slice(i,i+7)){if((n=c.directive(e,i))<0)throw l(c._thisDoc,c.lines,e,n,"bad syntax or EOF after @prefix ");n=c.checkDot(e,n),p=!0}if(!p)throw l(c._thisDoc,c.lines,e,i,"Unknown syntax at start of statememt: '"+e.slice(i).slice(0,20)+"'")}}function Pt(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"text/turtle",i=arguments.length>4?arguments[4]:void 0;n=(n=n||p.z8).split(";")[0];try{if(n===p.qS||n===p.z8){var o=De(t,t,r,r,null,null,"",null);o.loadBuf(e),c()}else if(n===p.Is){var a=new Tt(t);a.parse(B.parseXML(e),r,t.sym(r)),c()}else if(n===p.D7)Ct(B.parseXML(e,{contentType:p.D7}),t,r),c();else if(n===p.us)Ct(B.parseXML(e,{contentType:p.us}),t,r),c();else if(n===p.oW||n===p.xm)Ot(e,t,r),c();else if(n===p.ui)ze(e,t,r,c);else{if(n!==p.b4&&n!==p.lL)throw void 0===n?new Error("contentType is undefined"):new Error("Don't know how to parse "+n+" yet");var s=new _t({factory:We});l(null,e)}}catch(e){u(e)}function c(){i&&i(null,t)}function u(e){if(n!==p.ui||n!==p.b4||n!==p.lL){if(!i){var o=new Error(e+" while trying to parse <"+r+"> as "+n);throw o.cause=e,o}i(e,t)}}function l(e,r){e&&i(e,t);try{s.parse(r,d)}catch(e){i(e,t)}}function d(e,r){r?t.add(r.subject,r.predicate,r.object,r.graph):i(e,t)}Pt.handled={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/sparql-update":!0,"application/sparql-update-single-match":!0,"application/ld+json":!0,"application/nquads":!0,"application/n-quads":!0}}(0,u.Z)(Tt,"ns",{RDF:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",RDFS:"http://www.w3.org/2000/01/rdf-schema#"}),(0,u.Z)(Tt,"nodeType",{ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12});var Ft=r(4098),It=r.n(Ft),Nt=r(8918);function jt(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Rt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Rt(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Rt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Lt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,c.Z)(e);if(t){var i=(0,c.Z)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,s.Z)(this,r)}}var Dt={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/ld+json":!0},Mt={rdf:p.Is,owl:p.Is,n3:"text/n3",ttl:"text/turtle",nt:"text/n3",acl:"text/n3",html:"text/html",xml:"text/xml"},Ut=function(e){return{link:U("http://www.w3.org/2007/ont/link#",e),http:U("http://www.w3.org/2007/ont/http#",e),httph:U("http://www.w3.org/2007/ont/httph#",e),rdf:U("http://www.w3.org/1999/02/22-rdf-syntax-ns#",e),rdfs:U("http://www.w3.org/2000/01/rdf-schema#",e),dc:U("http://purl.org/dc/elements/1.1/",e),ldp:U("http://www.w3.org/ns/ldp#",e)}},Bt=Ut(),Ht=(0,n.Z)((function e(t,r){(0,i.Z)(this,e),(0,u.Z)(this,"response",void 0),(0,u.Z)(this,"dom",void 0),this.response=t,this.dom=r}));(0,u.Z)(Ht,"pattern",void 0);var qt=function(e){(0,a.Z)(r,e);var t=Lt(r);function r(){return(0,i.Z)(this,r),t.apply(this,arguments)}return(0,n.Z)(r,[{key:"parse",value:function(e,t,r){var n=e.store;if(this.dom||(this.dom=B.parseXML(t)),"parsererror"===this.dom.documentElement.nodeName)return e.failFetch(r,"Badly formed XML in "+r.resource.value,"parse_error");var i=new Tt(n);try{i.parse(this.dom,r.original.value,r.original)}catch(t){return e.failFetch(r,"Syntax error parsing RDF/XML! "+t,"parse_error")}return r.noMeta||n.add(r.original,Bt.rdf("type"),Bt.link("RDFDocument"),e.appNode),e.doneFetch(r,this.response)}}],[{key:"toString",value:function(){return"RDFXMLHandler"}},{key:"register",value:function(e){e.mediatypes[p.Is]={q:.9}}}]),r}(Ht);qt.pattern=new RegExp("application/rdf\\+xml");var Kt=function(e){(0,a.Z)(r,e);var t=Lt(r);function r(){return(0,i.Z)(this,r),t.apply(this,arguments)}return(0,n.Z)(r,[{key:"parse",value:function(e,t,r){var n,i;this.dom||(this.dom=B.parseXML(t));var o=e.store,a=this.dom.getElementsByTagName("title");a.length>0&&o.add(r.resource,Bt.dc("title"),o.rdfFactory.literal(a[0].textContent),r.resource);for(var s=this.dom.getElementsByTagName("link"),c=s.length-1;c>=0;c--)i=!1,(n=s[c].getAttribute("rel"))||(n=s[c].getAttribute("rev"),i=!0),n&&e.linkData(r.original,n,s[c].getAttribute("href"),r.resource,i);for(var u=this.dom.getElementsByTagName("script"),l=0;l<u.length;l++){var d=u[l].getAttribute("type");Dt[d]&&(Pt(u[l].textContent,o,r.original.value,d),Pt(u[l].textContent,o,r.original.value,d))}if(r.noMeta||o.add(r.resource,Bt.rdf("type"),Bt.link("WebPage"),e.appNode),!r.noRDFa&&Ct)try{Ct(this.dom,o,r.original.value)}catch(t){var p="Error trying to parse "+r.resource+" as RDFa:\n"+t+":\n"+t.stack;return e.failFetch(r,p,"parse_error")}return e.doneFetch(r,this.response)}}],[{key:"toString",value:function(){return"XHTMLHandler"}},{key:"register",value:function(e){e.mediatypes[p.D7]={}}}]),r}(Ht);Kt.pattern=new RegExp("application/xhtml");var Wt=function(e){(0,a.Z)(r,e);var t=Lt(r);function r(){return(0,i.Z)(this,r),t.apply(this,arguments)}return(0,n.Z)(r,[{key:"parse",value:function(e,t,n){for(var i=B.parseXML(t),o=0;o<i.childNodes.length;o++){var a=i.childNodes[o];if(r.isElement(a)){var s=a.namespaceURI;if(s&&s===s.rdf)return e.addStatus(n.req,"Has XML root element in the RDF namespace, so assume RDF/XML."),new qt(this.response,i).parse(e,t,n);break}}if(i.doctype&&"html"===i.doctype.name&&i.doctype.publicId.match(/^-\/\/W3C\/\/DTD XHTML/)&&i.doctype.systemId.match(/http:\/\/www.w3.org\/TR\/xhtml/))return e.addStatus(n.req,"Has XHTML DOCTYPE. Switching to XHTML Handler.\n"),new Kt(this.response,i).parse(e,t,n);var c=i.getElementsByTagName("html")[0];if(c){var u=c.getAttribute("xmlns");if(u&&u.match(/^http:\/\/www.w3.org\/1999\/xhtml/))return e.addStatus(n.req,"Has a default namespace for XHTML. Switching to XHTMLHandler.\n"),new Kt(this.response,i).parse(e,t,n)}return e.failFetch(n,"Unsupported dialect of XML: not RDF or XHTML namespace, etc.\n"+t.slice(0,80),901)}}],[{key:"toString",value:function(){return"XMLHandler"}},{key:"register",value:function(e){e.mediatypes["text/xml"]={q:.5},e.mediatypes["application/xml"]={q:.5}}},{key:"isElement",value:function(e){return e.nodeType===Node.ELEMENT_NODE}}]),r}(Ht);Wt.pattern=new RegExp("(text|application)/(.*)xml");var Vt=function(e){(0,a.Z)(r,e);var t=Lt(r);function r(){return(0,i.Z)(this,r),t.apply(this,arguments)}return(0,n.Z)(r,[{key:"parse",value:function(e,t,r){var n=e.store;if(Gt(t))return e.addStatus(r.req,"Has an XML declaration. We'll assume it's XHTML as the content-type was text/html.\n"),new Kt(this.response).parse(e,t,r);if(function(e){var t=e.indexOf("<!DOCTYPE html"),r=e.indexOf(">");return!(-1===t||-1===r||t>r)&&-1!==e.substr(t,r-t).indexOf("XHTML")}(t))return e.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTMLHandler.\n"),new Kt(this.response).parse(e,t,r);if(function(e){return!!e.match(/[^(<html)]*<html\s+[^<]*xmlns=['"]http:\/\/www.w3.org\/1999\/xhtml["'][^<]*>/)}(t))return e.addStatus(r.req,"Has default namespace for XHTML, so switching to XHTMLHandler.\n"),new Kt(this.response).parse(e,t,r);var i=new RegExp("<title>([\\s\\S]+?)</title>","im").exec(t);return i&&n.add(r.resource,Bt.dc("title"),n.rdfFactory.literal(i[1]),r.resource),n.add(r.resource,Bt.rdf("type"),Bt.link("WebPage"),e.appNode),e.addStatus(r.req,"non-XML HTML document, not parsed for data."),e.doneFetch(r,this.response)}}],[{key:"toString",value:function(){return"HTMLHandler"}},{key:"register",value:function(e){e.mediatypes["text/html"]={q:.9}}}]),r}(Ht);Vt.pattern=new RegExp("text/html");var zt=function(e){(0,a.Z)(r,e);var t=Lt(r);function r(){return(0,i.Z)(this,r),t.apply(this,arguments)}return(0,n.Z)(r,[{key:"parse",value:function(e,t,r,n){var i=e.store;return new Promise((function(o,a){try{ze(t,i,r.original.value,(function(){o(e.doneFetch(r,n))}))}catch(t){var s="Error trying to parse "+r.resource+" as JSON-LD:\n"+t;o(e.failFetch(r,s,"parse_error",n))}}))}}],[{key:"toString",value:function(){return"JsonLdHandler"}},{key:"register",value:function(e){e.mediatypes["application/ld+json"]={q:.9}}}]),r}(Ht);zt.pattern=/application\/ld\+json/;var Jt=function(e){(0,a.Z)(r,e);var t=Lt(r);function r(){return(0,i.Z)(this,r),t.apply(this,arguments)}return(0,n.Z)(r,[{key:"parse",value:function(e,t,r){return Gt(t)?(e.addStatus(r.req,"Warning: "+r.resource+" has an XML declaration. We'll assume it's XML but its content-type wasn't XML.\n"),new Wt(this.response).parse(e,t,r)):t.slice(0,500).match(/xmlns:/)?(e.addStatus(r.req,"May have an XML namespace. We'll assume it's XML but its content-type wasn't XML.\n"),new Wt(this.response).parse(e,t,r)):(e.addStatus(r.req,"Plain text document, no known RDF semantics."),e.doneFetch(r,this.response))}}],[{key:"toString",value:function(){return"TextHandler"}},{key:"register",value:function(e){e.mediatypes["text/plain"]={q:.5}}}]),r}(Ht);Jt.pattern=new RegExp("text/plain");var Zt=function(e){(0,a.Z)(r,e);var t=Lt(r);function r(){return(0,i.Z)(this,r),t.apply(this,arguments)}return(0,n.Z)(r,[{key:"parse",value:function(e,t,r,n){var i=e.store,o=De(i,i,r.original.value,r.original.value,null,null,"",null);try{o.loadBuf(t)}catch(t){var a="Error trying to parse "+r.resource+" as Notation3:\n"+t;return e.failFetch(r,a,"parse_error",n)}return e.addStatus(r.req,"N3 parsed: "+o.statementCount+" triples in "+o.lines+" lines."),e.store.add(r.original,Bt.rdf("type"),Bt.link("RDFDocument"),e.appNode),e.doneFetch(r,this.response)}}],[{key:"toString",value:function(){return"N3Handler"}},{key:"register",value:function(e){e.mediatypes["text/n3"]={q:"1.0"},e.mediatypes["text/turtle"]={q:1}}}]),r}(Ht);Zt.pattern=new RegExp("(application|text)/(x-)?(rdf\\+)?(n3|turtle)");var $t={RDFXMLHandler:qt,XHTMLHandler:Kt,XMLHandler:Wt,HTMLHandler:Vt,TextHandler:Jt,N3Handler:Zt,JsonLdHandler:zt};function Gt(e){return!!e.match(/\s*<\?xml\s+version\s*=[^<>]+\?>/)}var Xt=function(){function e(t){var n=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,i.Z)(this,e),(0,u.Z)(this,"store",void 0),(0,u.Z)(this,"timeout",void 0),(0,u.Z)(this,"_fetch",void 0),(0,u.Z)(this,"mediatypes",void 0),(0,u.Z)(this,"appNode",void 0),(0,u.Z)(this,"requested",void 0),(0,u.Z)(this,"timeouts",void 0),(0,u.Z)(this,"redirectedTo",void 0),(0,u.Z)(this,"fetchQueue",void 0),(0,u.Z)(this,"fetchCallbacks",void 0),(0,u.Z)(this,"nonexistent",void 0),(0,u.Z)(this,"lookedUp",void 0),(0,u.Z)(this,"handlers",void 0),(0,u.Z)(this,"ns",void 0),(0,u.Z)(this,"fireCallbacks",void 0),this.store=t||new fe,this.ns=Ut(this.store.rdfFactory),this.timeout=o.timeout||3e4,this._fetch=o.fetch||void 0!==r.g&&(r.g.solidFetcher||r.g.solidFetch)||"undefined"!=typeof window&&(window.solidFetcher||window.solidFetch)||It(),!this._fetch)throw new Error("No _fetch function available for Fetcher");this.appNode=this.store.sym("chrome://TheCurrentSession"),this.store.fetcher=this,this.requested={},this.timeouts={},this.redirectedTo={},this.fetchQueue={},this.fetchCallbacks={},this.nonexistent={},this.lookedUp={},this.handlers=[],this.mediatypes={"image/*":{q:.9},"*/*":{q:.1}},B.callbackify(this,["request","fail","refresh","retract","done"]),Object.keys(o.handlers||$t).map((function(e){return n.addHandler($t[e])}))}var t,o;return(0,n.Z)(e,[{key:"load",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r=Object.assign({},r),e instanceof Array)return Promise.all(e.map((function(e){return t.load(e,Object.assign({},r))})));var n=e,i=(0,Nt._)(n);i=i.split("#")[0],r=this.initFetchOptions(i,r);var o,a=this.appNode,s=this.store,c=s.statementsMatching(void 0,this.ns.link("requestedURI"),s.sym(i),a).map((function(e){return e.subject})),u=jt(c);try{for(u.s();!(o=u.n()).done;){var l=o.value,d=s.any(l,this.ns.link("response"),null,a);if(void 0!==d){var p=s.statementsMatching(d,this.ns.link("outOfDate"),!0,a);s.remove(p),r.force=!0,r.clearPreviousData=!0}}}catch(e){u.e(e)}finally{u.f()}var f=this.initFetchOptions(i,r);return this.pendingFetchPromise(i,f.baseURI,f)}},{key:"pendingFetchPromise",value:(o=E(S().mark((function e(t,r,n){var i,o=this;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=!n.force,!e.t0){e.next=5;break}return e.next=4,this.fetchQueue[r];case 4:e.t0=e.sent;case 5:if(!e.t0){e.next=9;break}i=this.fetchQueue[r],e.next=12;break;case 9:i=Promise.race([this.setRequestTimeout(t,n),this.fetchUri(t,n)]),this.fetchQueue[r]=i,this.cleanupFetchRequest(r,void 0,this.timeout);case 12:return e.abrupt("return",i.then((function(e){return t in o.timeouts&&(o.timeouts[t].forEach(clearTimeout),delete o.timeouts[t]),e})));case 13:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return o.apply(this,arguments)})},{key:"cleanupFetchRequest",value:function(e,t,r){var n=this;void 0!==t&&console.warn("_options is deprecated"),this.timeouts[e]=(this.timeouts[e]||[]).concat(setTimeout((function(){n.isPending(e)||delete n.fetchQueue[e]}),r))}},{key:"initFetchOptions",value:function(t,r){var n=this.store;!r.method||"GET"===r.method.toUpperCase()||(r.force=!0),r.resource=n.rdfFactory.namedNode(t),r.baseURI=r.baseURI||t,r.original=n.rdfFactory.namedNode(r.baseURI),r.req=n.bnode(),r.headers=r.headers||new Ft.Headers,r.contentType&&(r.headers["content-type"]=r.contentType),r.force&&(r.cache="no-cache");var i=this.acceptString();r.headers.accept=i;var o=e.offlineOverride(t);r.requestedURI=o,e.setCredentials(o,r);var a=e.proxyIfNecessary(o);return o!==a&&(r.proxyUsed=!0),r.actualProxyURI=a,r}},{key:"fetchUri",value:function(t,r){var n=this;if(!t)return Promise.reject(new Error("Cannot fetch an empty uri"));if(e.unsupportedProtocol(t))return this.failFetch(r,"fetcher: Unsupported protocol","unsupported_protocol");var i=this.getState(t);if(r.force)delete this.nonexistent[t];else{if("fetched"===i)return Promise.resolve(this.doneFetch(r,{status:200,ok:!0,statusText:"Already loaded into quadstore."}));if("failed"===i&&404===this.requested[t]){var o="Previously failed: "+this.requested[t],a={url:t,status:this.requested[t],statusText:o,responseText:o,headers:new Ft.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return this.failFetch(r,o,this.requested[t],a)}}this.fireCallbacks("request",[t]),this.requested[t]=!0,r.noMeta||this.saveRequestMetadata(t,r);var s=r.actualProxyURI;return this._fetch(s,r).then((function(e){return n.handleResponse(e,t,r)}),(function(e){var i={url:s,status:999,statusText:(e.name||"network failure")+": "+(e.errno||e.code||e.type),responseText:e.message,headers:new Ft.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return n.handleError(i,t,r)}))}},{key:"nowOrWhenFetched",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=(0,Nt._)(e);"function"==typeof t?r=t:void 0===t||((0,g.NX)(t)?n.referringTerm=t:n=t),this.load(i,n).then((function(e){if(r)if(e)if(e.ok)r(!0,"OK",e);else{var t="HTTP error: Status "+e.status+" ("+e.statusText+")";e.responseText&&(t+=" "+e.responseText),r(!1,t,e)}else r(!1,"@@ nowOrWhenFetched: no response object!")}),(function(e){var t=e.message||e.statusText;t="Failed to load <"+i+"> "+t,e.response&&e.response.status&&(t+=" status: "+e.response.status),r(!1,t,e.response)}))}},{key:"addStatus",value:function(e,t){var r=new Date;t="["+r.getHours()+":"+r.getMinutes()+":"+r.getSeconds()+"."+r.getMilliseconds()+"] "+t;var n=this.store,i=n.the(e,this.ns.link("status"));(0,g.uZ)(i)?i.append(n.rdfFactory.literal(t)):M.Z.warn("web.js: No list to add to: "+i+","+t)}},{key:"failFetch",value:function(e,t,r,n){this.addStatus(e.req,t),e.noMeta||this.store.add(e.original,this.ns.link("error"),this.store.rdfFactory.literal(t));var i=(e.method||"GET").toUpperCase();("GET"===i||"HEAD"===i)&&(e.resource.equals(e.original),this.requested[F.docpart(e.original.value)]=r,this.fireCallbacks("fail",[e.original.value,t]));var o=new Error("Fetcher: "+t);return o.status=r,o.statusText=t,o.response=n,Promise.reject(o)}},{key:"linkData",value:function(e,t,r,n,i){if(r){var o,a=this.store,s=a.rdfFactory.namedNode(F.join(r,e.value));if("alternate"===t||"seeAlso"===t||"meta"===t||"describedby"===t){if(s.value===e.value)return;o=this.ns.rdfs("seeAlso")}else o="type"===t?a.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"):a.rdfFactory.namedNode(F.join(encodeURIComponent(t),"http://www.iana.org/assignments/link-relations/"));i?a.add(s,o,e,n):a.add(e,o,s,n)}}},{key:"parseLinkHeader",value:function(e,t,r){if(e){var n=/[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g,i=e.match(/<[^>]*>\s*(\s*;\s*[^()<>@,;:"/[\]?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g);if(null!=i)for(var o=0;o<i.length;o++){var a=i[o].split(">"),s=a[0].substring(1),c=a[1].match(n);if(null==c)return;for(var u=0;u<c.length;u++){var l=c[u].split("=")[1].replace(/["']/g,"");this.linkData(t,l,s,r)}}}}},{key:"doneFetch",value:function(e,t){return this.addStatus(e.req,"Done."),this.requested[e.original.value]="done",this.fireCallbacks("done",[e.original.value]),t.req=e.req,t}},{key:"nowKnownAs",value:function(e,t){this.lookedUp[e.value]?this.lookedUp[t.value]||this.lookUpThing(t,e):this.lookedUp[t.value]&&(this.lookedUp[e.value]||this.lookUpThing(e,t))}},{key:"putBack",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,Nt._)(e),i=new m.Z(n).doc();return r.contentType=r["content-type"]||r["Content-Type"]||r.contentType||p.z8,"application/ld+json"===r.contentType?new Promise((function(n,o){J(i,t.store,i.uri,r.contentType,(function(i,a){i?o(i):(r.data=a,t.webOperation("PUT",e,r).then((function(e){return n(e)})).catch((function(e){return o(e)})))}))})):(r.data=J(i,this.store,i.value,r.contentType),this.webOperation("PUT",n,r))}},{key:"webCopy",value:function(e,t,r){var n=this;return this.webOperation("GET",e).then((function(e){return n.webOperation("PUT",t,{data:e.responseText,contentType:r})}))}},{key:"delete",value:function(e,t){var r=this;return this.webOperation("DELETE",e,t).then((function(t){return r.requested[e]=404,r.nonexistent[e]=!0,r.unload(r.store.rdfFactory.namedNode(e)),t}))}},{key:"createIfNotExists",value:(t=E(S().mark((function e(t){var r,n,i,o,a=arguments;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:p.z8,n=a.length>2&&void 0!==a[2]?a[2]:"",i=this,e.prev=3,e.next=6,i.load(t);case 6:o=e.sent,e.next=26;break;case 9:if(e.prev=9,e.t0=e.catch(3),404!==e.t0.response.status){e.next=25;break}return e.prev=12,e.next=15,i.webOperation("PUT",t.value,{data:n,contentType:r});case 15:o=e.sent,e.next=21;break;case 18:throw e.prev=18,e.t1=e.catch(12),e.t1;case 21:return delete i.requested[t.value],e.abrupt("return",o);case 25:throw e.t0;case 26:return e.abrupt("return",o);case 27:case"end":return e.stop()}}),e,this,[[3,9],[12,18]])}))),function(e){return t.apply(this,arguments)})},{key:"createContainer",value:function(e,t,r){var n={"content-type":p.z8,link:this.ns.ldp("BasicContainer")+'; rel="type"'};t&&(n.slug=t);var i={headers:n};return r&&(i.body=r),this.webOperation("POST",e,i)}},{key:"invalidateCache",value:function(e){var t=(0,Nt._)(e),r=this;if(r.fetchQueue&&r.fetchQueue[t]&&(r.fetchQueue[t].PromiseStatus,delete r.fetchQueue[t]),r.requested[t]&&"done"!==r.requested[t]&&"failed"!==r.requested[t]&&404!==r.requested[t]){var n="Rdflib: fetcher: Destructive operation on <".concat(r.requested[t],"> file being fetched! ")+t;console.error(n)}else delete r.requested[t],delete r.nonexistent[t]}},{key:"webOperation",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=(0,Nt._)(r);n.method=t,n.body=n.data||n.body,n.force=!0;var o=this;if(n.body&&!n.contentType)throw new Error("Web operation sending data must have a defined contentType.");return n.contentType&&(n.headers=n.headers||{},n.headers["content-type"]=n.contentType),e.setCredentials(i,n),new Promise((function(e,r){o._fetch(i,n).then((function(n){if(n.ok)"PUT"!==t&&"PATCH"!==t&&"POST"!==t&&"DELETE"!==t||o.invalidateCache(i),n.text?n.text().then((function(t){n.responseText=t,e(n)})):e(n);else{var a="Web error: "+n.status;n.statusText&&(a+=" ("+n.statusText+")"),a+=" on "+t+" of <"+i+">",n.responseText&&(a+=": "+n.responseText);var s=new Error(a);s.response=n,r(s)}}),(function(e){r(new Error("Fetch error for "+t+" of <"+i+">:"+e))}))}))}},{key:"lookUpThing",value:function(e,t){var r=this,n=this.store.uris(e);return(n=n.map((function(e){return F.docpart(e)}))).forEach((function(e){r.lookedUp[e]=!0})),this.load(n,{referringTerm:t})}},{key:"getHeader",value:function(e,t){for(var r=this.store,n=e.value,i=r.each(void 0,this.ns.link("requestedURI"),r.rdfFactory.literal(n)),o=0;o<i.length;o++){var a=i[o];if(void 0!==a){var s=r.any(a,this.ns.link("response"));if(void 0!==s&&r.anyValue(s,this.ns.http("status"))&&r.anyValue(s,this.ns.http("status")).startsWith("2")){var c=r.each(s,this.ns.httph(t.toLowerCase()));return c.length?c.map((function(e){return e.value})):[]}}}}},{key:"saveRequestMetadata",value:function(e,t){var r=t.req,n=this.store,i=t.referringTerm;this.addStatus(t.req,"Accept: "+t.headers.accept),(0,g.NX)(i)&&n.add(n.rdfFactory.namedNode(e),this.ns.link("requestedBy"),i,this.appNode),t.original&&t.original.value!==e&&n.add(r,this.ns.link("orginalURI"),n.rdfFactory.literal(t.original.value),this.appNode);var o=new Date,a="["+o.getHours()+":"+o.getMinutes()+":"+o.getSeconds()+"] ";n.add(r,this.ns.rdfs("label"),n.rdfFactory.literal(a+" Request for "+e),this.appNode),n.add(r,this.ns.link("requestedURI"),n.rdfFactory.literal(e),this.appNode),n.add(r,this.ns.link("status"),n.collection(),this.appNode)}},{key:"saveResponseMetadata",value:function(e,t){var r=this,n=this.store,i=n.bnode();return n.add(t.req,this.ns.link("response"),i,this.appNode),n.add(i,this.ns.http("status"),n.rdfFactory.literal(e.status),this.appNode),n.add(i,this.ns.http("statusText"),n.rdfFactory.literal(e.statusText),this.appNode),e.headers.forEach((function(e,o){n.add(i,r.ns.httph(o),r.store.rdfFactory.literal(e),r.appNode),"content-type"===o&&n.add(t.resource,r.ns.rdf("type"),n.rdfFactory.namedNode(B.mediaTypeClass(e).value),r.appNode)})),i}},{key:"objectRefresh",value:function(e){var t=this.store.uris(e);if(void 0!==t)for(var r=0;r<t.length;r++)this.refresh(this.store.rdfFactory.namedNode(F.docpart(t[r])))}},{key:"refresh",value:function(e,t){this.fireCallbacks("refresh",arguments),this.nowOrWhenFetched(e,{force:!0,clearPreviousData:!0},t)}},{key:"refreshIfExpired",value:function(e,t){var r=this.getHeader(e,"Expires");!r||new Date(r[0]).getTime()<=(new Date).getTime()?this.refresh(e,t):t(!0,"Not expired",{})}},{key:"retract",value:function(e){this.store.removeMany(void 0,void 0,void 0,e),e.value&&delete this.requested[F.docpart(e.value)],this.fireCallbacks("retract",arguments)}},{key:"getState",value:function(e){return void 0===this.requested[e]?"unrequested":!0===this.requested[e]?"requested":"done"===this.requested[e]?"fetched":"redirected"===this.requested[e]?this.getState(this.redirectedTo[e]):"failed"}},{key:"isPending",value:function(e){return!0===this.requested[e]}},{key:"unload",value:function(e){this.store.removeDocument(e),delete this.requested[e.value]}},{key:"addHandler",value:function(e){this.handlers.push(e),e.register(this)}},{key:"retryNoCredentials",value:function(e,t){t.retriedWithNoCredentials=!0,delete this.requested[e],delete this.fetchQueue[e];var r=Object.assign({},t,{credentials:"omit"});return this.addStatus(t.req,"Abort: Will retry with credentials SUPPRESSED to see if that helps"),this.load(e,r)}},{key:"isCrossSite",value:function(e){if("undefined"==typeof document||!document.location)return!1;var t=F.hostpart,r=""+document.location;return(t(r)&&t(e)&&t(r))!==t(e)}},{key:"handleError",value:function(t,r,n){if(this.isCrossSite(r)){if(n.credentials&&"include"===n.credentials&&!n.retriedWithNoCredentials)return this.retryNoCredentials(r,n);var i=e.crossSiteProxy(r);if(i&&!n.proxyUsed)return this.redirectToProxy(i,n)}var o;return t instanceof Error?o="Fetch error: "+t.message:(o=t.statusText,t.responseText&&(o+=" ".concat(t.responseText))),this.failFetch(n,o,t.status||998,t)}},{key:"addType",value:function(e,t,r,n){var i=t;if(n){var o=r.any(i,this.ns.link("requestedURI"));o&&o.value!==n&&r.add(r.rdfFactory.namedNode(n),this.ns.rdf("type"),e,this.appNode)}for(;;){var a=r.any(i,this.ns.link("requestedURI"));if(a&&a.value&&r.add(r.rdfFactory.namedNode(a.value),this.ns.rdf("type"),e,this.appNode),!(i=r.any(void 0,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#redirectedRequest"),i)))break;var s=r.any(i,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#response"));if(!s)break;var c=r.any(s,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/http#status"));if(!c)break;if("301"!==c&&"302"!==c)break}}},{key:"handleResponse",value:function(e,t,r){var n=this,i=this.store,o=e.headers,a=r.req,s=this.saveResponseMetadata(e,r),c=this.normalizedContentType(r,o)||"",u=o.get("content-location");if(0===e.status)return this.handleError(e,t,r);if(e.status>=400)return 404===e.status&&(this.nonexistent[r.original.value]=!0,this.nonexistent[t]=!0),this.saveErrorResponse(e,s).then((function(){var t=r.resource+" "+e.statusText;return n.failFetch(r,t,e.status,e)}));var l=null,d=null;if(u&&(d=F.join(u,t))!==t&&(l=d),200===e.status){this.addType(this.ns.link("Document"),a,i,t),l&&this.addType(this.ns.link("Document"),a,i,l),r.clearPreviousData&&i.removeDocument(r.resource);var p=c.includes("image/")||c.includes("application/pdf");c&&p&&(this.addType(i.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),a,i,t),l&&this.addType(i.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),a,i,l))}if(u){if(!r.force&&l&&"done"===this.requested[d])return this.doneFetch(r,e);this.requested[d]=!0}this.parseLinkHeader(o.get("link"),r.original,a);var f=this.handlerForContentType(c,e);return f?e.text().then((function(t){return e.responseText=t,f.parse(n,t,r,e)})):(this.addStatus(a,"Fetch over. No data handled."),this.doneFetch(r,e))}},{key:"saveErrorResponse",value:function(e,t){var r=this,n=this.store;return e.text().then((function(e){e.length>10&&n.add(t,r.ns.http("content"),n.rdfFactory.literal(e),t)}))}},{key:"handlerForContentType",value:function(e,t){if(!e)return null;var r=this.handlers.find((function(t){return e.match(t.pattern)}));return r?new r(t):null}},{key:"guessContentType",value:function(e){return Mt[e.split(".").pop()]}},{key:"normalizedContentType",value:function(e,t){if(e.forceContentType)return e.forceContentType;var r=t.get("content-type");if(!r||r.includes("application/octet-stream")){var n=this.guessContentType(e.resource.value);if(n)return n}var i=F.protocol(e.resource.value);return!r&&["file","chrome"].includes(i)?"text/xml":r}},{key:"redirectToProxy",value:function(e,t){var r=this;this.addStatus(t.req,"BLOCKED -> Cross-site Proxy to <"+e+">"),t.proxyUsed=!0;var n=this.store,i=t.req;t.noMeta||(n.add(i,this.ns.link("redirectedTo"),n.rdfFactory.namedNode(e),i),this.addStatus(i,"redirected to new request")),this.requested[t.resource.value]="redirected",this.redirectedTo[t.resource.value]=e;var o=Object.assign({},t);return o.baseURI=t.resource.value,this.fetchUri(e,o).then((function(e){return o.noMeta||n.add(i,r.ns.link("redirectedRequest"),o.req,r.appNode),e}))}},{key:"setRequestTimeout",value:function(e,t){var r=this;return new Promise((function(n){r.timeouts[e]=(r.timeouts[e]||[]).concat(setTimeout((function(){!r.isPending(e)||t.retriedWithNoCredentials||t.proxyUsed||n(r.failFetch(t,"Request to ".concat(e," timed out"),"timeout"))}),r.timeout))}))}},{key:"addFetchCallback",value:function(e,t){this.fetchCallbacks[e]?this.fetchCallbacks[e].push(t):this.fetchCallbacks[e]=[t]}},{key:"acceptString",value:function(){var e="";for(var t in this.mediatypes)for(var r in""!==e&&(e+=", "),e+=t,this.mediatypes[t])e+=";"+r+"="+this.mediatypes[t][r];return e}}],[{key:"crossSiteProxy",value:function(t){return e.crossSiteProxyTemplate?e.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(t)):void 0}},{key:"offlineOverride",value:function(e){var t,r=e;return"undefined"!=typeof window&&window.panes&&(t=window.panes.UI)&&t.preferences&&t.preferences.get("offlineModeUsingLocalhost")&&"http://"===r.slice(0,7)&&"localhost/"!==r.slice(7,17)&&(r="http://localhost/"+r.slice(7),M.Z.warn("Localhost kludge for offline use: actually getting <"+r+">")),r}},{key:"proxyIfNecessary",value:function(t){var r;if("undefined"!=typeof window&&window.panes&&(r=window.panes.UI)&&r.isExtension)return t;if("undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.localSiteMap){var n=function e(t,r){var n=r[t.shift()];return n?"string"==typeof n?n+t.join("/"):t?e(t,n):null:null}(t.split("/").slice(2),$SolidTestEnvironment.localSiteMap);if(n)return n}return e.crossSiteProxyTemplate&&"undefined"!=typeof document&&document.location&&"https:"===(""+document.location).slice(0,6)&&"http:"===t.slice(0,5)?e.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(t)):t}},{key:"unsupportedProtocol",value:function(e){var t=F.protocol(e);return"tel"===t||"mailto"===t||"urn"===t}},{key:"setCredentials",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};void 0===t.credentials&&(void 0!==t.withCredentials?t.credentials=t.withCredentials?"include":"omit":t.credentials="include")}}]),e}();(0,u.Z)(Xt,"HANDLERS",void 0),(0,u.Z)(Xt,"CONTENT_TYPE_BY_EXT",void 0),(0,u.Z)(Xt,"crossSiteProxyTemplate",void 0),Xt.HANDLERS=$t,Xt.CONTENT_TYPE_BY_EXT=Mt;const Yt={parseJSON:function(e,t,r){var n,i,o,a={},s=r.sym(t);for(var c in e){0===c.indexOf("_:")?a[c]?n=a[c]:(n=r.bnode(c),a[c]=n):n=r.sym(c);var u=e[c];for(var l in u){var d=u[l];for(var p in i=r.sym(l),d){var f=d[p];if("uri"===f.type)o=r.sym(f.value),r.add(n,i,o,s);else if("BlankNode"===f.type)a[f.value]?o=a[f.value]:(o=r.bnode(f.value),a[f.value]=o),r.add(n,i,o,s);else{if("Literal"!==f.type)throw new Error("error: unexpected termtype: "+p.type);o=f.datatype?r.literal(f.value,void 0,r.sym(f.datatype)):f.lang?r.literal(f.value,f.lang):r.literal(f.value),r.add(n,i,o,s)}}}}}};function Qt(e){var t=0;function r(e){var t="",r=e.statements;for(var n in r)M.Z.debug("Found statement: "+r),t+=a()+r[n]+"\n";return t}function n(e){var t="";for(var r in e.constraints){var n=e.constraints[r];t+=a()+"FILTER ( "+n.describe(r)+" ) \n"}return t}function i(e){for(var o="",s=0;s<e.optional.length;s++)M.Z.debug("Found optional query"),o+=a()+"OPTIONAL { \n",t++,o+=r(e.optional[s]),o+=n(e.optional[s]),o+=i(e.optional[s]),t--,o+=a()+"}\n";return o}function o(e){var o=a()+"WHERE \n{ \n";return t++,o+=r(e),o+=n(e),o+=i(e),t--,o+"}"}function a(){for(var e="",r=0;r<t;r++)e+=" ";return e}return function(e){return function(e){for(var t=a()+"SELECT ",r=0;r<e.vars.length;r++)t+=e.vars[r]+" ";return t+"\n"}(e)+o(e.pat)}(e)}function er(e,t,r){var n=[];function i(e){if(n[e])return n[e];var t=r.variable(e);return n[e]=t,t}function o(e){return"string"==typeof e&&e.match(/[^ \n\t]/)}function a(e){return"string"==typeof e&&e.match(/^[\?\$]/)}function s(e){return"string"==typeof e?e.replace(/^&lt;/,"<").replace(/&gt;$/,">"):e}function c(e){return"string"==typeof e&&e.match(/^<[^>]*>$/)}function u(e){return"string"==typeof e&&(e.match(/^_:/)||e.match(/^$/))}function l(e){return"string"==typeof e&&e.match(/:$/)}function d(e){return"string"==typeof e&&e.match(/^:|^[^_][^:]*:/)}function p(e){return e.split(":")[0]}function f(e){return e.split(":")[1]}function h(e){return c(e)?e.slice(1,e.length-1):e}function m(e){var t=-1===e.indexOf("'")?null:e.indexOf("'"),n=-1===e.indexOf('"')?null:e.indexOf('"');if(!t&&!n){var i=new Array(1);return i[0]=e,i}var o,a,s=new Array(2);if(!t||n&&n<t)o='"',a=n;else{if(n&&!(t&&t<n))return M.Z.error("SQARQL QUERY OOPS!"),s;o="'",a=t}s[0]=e.slice(0,a);var c,u=e.slice(a+1).indexOf(o);return-1===u?(M.Z.error("SPARQL parsing error: no matching parentheses in literal "+e),e):(e.slice(u+a+2).match(/^\^\^/)?(c=e.slice(u+a+2).indexOf(" "),s[1]=r.literal(e.slice(a+1,a+1+u),r.sym(h(e.slice(a+4+u,a+2+u+c)))),s=s.concat(m(e.slice(u+a+3+c)))):e.slice(u+a+2).match(/^@/)?(c=e.slice(u+a+2).indexOf(" "),s[1]=r.literal(e.slice(a+1,a+1+u),e.slice(a+3+u,a+2+u+c),null),s=s.concat(m(e.slice(u+a+2+c)))):(s[1]=r.literal(e.slice(a+1,a+1+u)),M.Z.info("Literal found: "+s[1]),s=s.concat(m(e.slice(u+a+2)))),s)}function g(e){e=e.replace(/\(/g," ( ").replace(/\)/g," ) ").replace(/</g," <").replace(/>/g,"> ").replace(/{/g," { ").replace(/}/g," } ").replace(/[\t\n\r]/g," ").replace(/; /g," ; ").replace(/\. /g," . ").replace(/, /g," , "),M.Z.info("New str into spaceDelimit: \n"+e);var t=[],r=e.split(" ");for(var n in r)o(r[n])&&(t=t.concat(r[n]));return t}function v(e,t){for(var r=0;r<t.length;r++)if("string"==typeof t[r]&&t[r].toLowerCase()===e.toLowerCase())return r;return null}function y(e,t){for(var r=[],n=0;n<t.length;n++)"string"==typeof t[n]&&t[n].toLowerCase()===e.toLowerCase()&&r.push(n);return r}function b(e,t,r){M.Z.info("Looking for a close bracket of type "+r+" in "+e);for(var n=0,i=0;i<e.length;i++)if(e[i]===t&&n++,e[i]===r&&n--,n<0)return i;return M.Z.error("Statement had no close parenthesis in SPARQL query"),0}function w(e){return this.describe=function(t){return t+" = "+e.toNT()},this.test=function(t){return e.equals(t)},this}function x(e){this.describe=function(t){return"REGEXP( '"+e+"' , "+t+" )"},this.test=function(t){var r=new RegExp(e);return!!t.value&&r.test(t.value)}}function _(e,t){3!==e.length||"Variable"!==e[0].termType||"NamedNode"!==e[2].termType&&"Literal"!==e[2].termType?6===e.length&&"string"==typeof e[0]&&"regexp"===e[0].toLowerCase()&&"("===e[1]&&")"===e[5]&&","===e[3]&&"Variable"===e[4].termType&&"Literal"===e[2].termType&&(M.Z.debug("Constraint added: "+e),t.constraints[e[4]]=new x(e[2].value)):"="===e[1]||">"===e[1]||"<"===e[1]?(M.Z.debug("Constraint added: "+e),t.constraints[e[0]]=new w(e[2])):M.Z.warn("I don't know how to handle the constraint: "+e)}function E(e,t){M.Z.debug("Optional query: "+e+" not yet implemented.");var n=r.formula();k(e,n),t.optional.push(n)}function k(e,t){var n,o,l=function(e){for(var t=[],n=0;n<e.length;n++)"string"==typeof e[n]?(e[n]=s(e[n]),a(e[n])?t[n]=i(e[n].slice(1)):u(e[n])?(M.Z.info(e[n]+" was identified as a bnode."),t[n]=r.bnode()):c(e[n])?(M.Z.info(e[n]+" was identified as a symbol."),t[n]=r.sym(h(e[n]))):d(e[n])?(M.Z.info(e[n]+" was identified as a prefixed symbol"),C[p(e[n])]?t[n]=r.sym(e[n]=C[p(e[n])]+f(e[n])):(M.Z.error("SPARQL error: "+e[n]+" with prefix "+p(e[n])+" does not have a correct prefix entry."),t[n]=e[n])):t[n]=e[n]):t[n]=e[n];return t}(e);for(M.Z.debug("WHERE: "+l);v("OPTIONAL",l);)o=v("OPTIONAL",l),M.Z.debug("OPT: "+o+" "+l[o]+" in "+l),"{"!==l[o+1]&&M.Z.warn("Bad optional opening bracket in word "+o),-1===(n=b(l.slice(o+2),"{","}"))?M.Z.error("No matching bracket in word "+o):(E(l.slice(o+2,o+2+n),t),o=v("OPTIONAL",l),n=b(l.slice(o+2),"{","}"),l.splice(o,n+3));for(M.Z.debug("WHERE after optionals: "+l);v("FILTER",l);){var m=v("FILTER",l);"("!==l[m+1]&&M.Z.warn("Bad filter opening bracket in word "+m),-1===(n=b(l.slice(m+2),"(",")"))?M.Z.error("No matching bracket in word "+m):(_(l.slice(m+2,m+2+n),t),m=v("FILTER",l),n=b(l.slice(m+2),"(",")"),l.splice(m,n+3))}M.Z.debug("WHERE after filters and optionals: "+l),function(e,t){var r=new Array(1);r[0]=-1;for(var n=r.concat(y(".",e)),i=[],o=0;o<n.length-1;o++)i[o]=e.slice(n[o]+1,n[o+1]);for(o in i){M.Z.info("s+p+o "+o+" = "+i[o]);var a=i[o][0];i[o].splice(0,1);var s=r.concat(y(";",i[o]));s.push(i[o].length);for(var c=[],u=0;u<s.length-1;u++)c[u]=i[o].slice(s[u]+1,s[u+1]);for(o in c){M.Z.info("p+o "+o+" = "+i[o]);var l=c[o][0];c[o].splice(0,1);var d=r.concat(y(",",c[o]));d.push(c[o].length);var p=[];for(u=0;u<d.length-1;u++)p[u]=c[o].slice(d[u]+1,d[u+1]);for(o in p){var f=p[o][0];M.Z.info("Subj="+a+" Pred="+l+" Obj="+f),t.add(a,l,f)}}}}(l,t)}M.Z.info("SPARQL input: \n"+e);var S=new ne,A=function(e){var t=m(e),r=[];for(var n in t)r="string"==typeof t[n]?r.concat(g(t[n])):r.concat(t[n]);return r=function(e){for(var t=e,r=0;r<t.length;r++)if("a"===t[r]&&(t[r]="<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>"),"is"===t[r]&&"of"===t[r+2]){t.splice(r,1),t.splice(r+1,1);var n=t[r-1];t[r-1]=t[r+1],t[r+1]=n}return t}(r),M.Z.info("SPARQL Tokens: "+r),r}(e),C=function(e){var t=y("PREFIX",e),r=[];for(var n in t){var i=e[t[n]+1],o=e[t[n]+2];if(l(i))if(c(o)){M.Z.info("Prefix found: "+i+" -> "+o);var a=p(i),s=h(o);r[a]=s}else M.Z.error("Invalid SPARQL symbol: "+o);else M.Z.error("Invalid SPARQL prefix: "+i)}return r}(A);C.rdf||(C.rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"),C.rdfs||(C.rdfs="http://www.w3.org/2000/01/rdf-schema#");var T=v("SELECT",A),O=v("WHERE",A);if(T<0||O<0||T>O)return M.Z.error("Invalid or nonexistent SELECT and WHERE tags in SPARQL query"),!1;if(function(e,t){for(var r in M.Z.info("SPARQL vars: "+e),e)if(a(e[r])){M.Z.info("Added "+e[r]+" to query variables from SPARQL");var n=i(e[r].slice(1));t.vars.push(n),n.label=e[r].slice(1)}else M.Z.warn("Incorrect SPARQL variable in SELECT: "+e[r])}(A.slice(T+1,O),S),k(A.slice(O+2,A.length-1),S.pat),t)return S;for(var P in S.pat.statements){var F=S.pat.statements[P];"NamedNode"===F.subject.termType&&r.fetcher&&r.fetcher.lookUpThing(F.subject,"sparql:"+F.subject),"NamedNode"===F.object.termType&&r.fetcher&&r.fetcher.lookUpThing(F.object,"sparql:"+F.object)}return S}function tr(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return rr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?rr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function rr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var nr=function(){function e(t){if((0,i.Z)(this,e),(0,u.Z)(this,"store",void 0),(0,u.Z)(this,"ifps",void 0),(0,u.Z)(this,"fps",void 0),(0,u.Z)(this,"patchControl",void 0),(0,u.Z)(this,"ns",void 0),(t=t||new fe).updater)throw new Error("You can't have two UpdateManagers for the same store");t.fetcher||(t.fetcher=new Xt(t)),this.store=t,t.updater=this,this.ifps={},this.fps={},this.ns={},this.ns.link=U("http://www.w3.org/2007/ont/link#"),this.ns.http=U("http://www.w3.org/2007/ont/http#"),this.ns.httph=U("http://www.w3.org/2007/ont/httph#"),this.ns.ldp=U("http://www.w3.org/ns/ldp#"),this.ns.rdf=U("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.rdfs=U("http://www.w3.org/2000/01/rdf-schema#"),this.ns.rdf=U("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.owl=U("http://www.w3.org/2002/07/owl#"),this.patchControl=[]}var t;return(0,n.Z)(e,[{key:"patchControlFor",value:function(e){return this.patchControl[e.value]||(this.patchControl[e.value]=[]),this.patchControl[e.value]}},{key:"isHttpUri",value:function(e){return"http"===e.slice(0,4)}},{key:"flagAuthorizationMetadata",value:function(e){var t;e||(e=this.store);var r,n=null===(t=e.fetcher)||void 0===t?void 0:t.appNode,i=e.statementsMatching(void 0,this.ns.link("requestedURI"),void 0,n).map((function(e){return e.subject})),o=tr(i);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=e.any(a,this.ns.link("response"),null,n);void 0!==s&&e.add(s,this.ns.link("outOfDate"),!0,n)}}catch(e){o.e(e)}finally{o.f()}}},{key:"checkEditable",value:(t=E(S().mark((function e(t,r){var n,i,o;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",!1);case 2:if(r||(r=this.store),void 0===(i=this.editable(t,r))){e.next=6;break}return e.abrupt("return",i);case 6:return e.next=8,null===(n=r.fetcher)||void 0===n?void 0:n.load(t);case 8:return o=this.editable(t,r),e.abrupt("return",o);case 10:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})},{key:"editable",value:function(e,t){var r,n;if(!e)return!1;if(t||(t=this.store),e=(0,Nt._)(e),!this.isHttpUri(e)&&t.holds(t.rdfFactory.namedNode(e),t.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),t.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#MachineEditableDocument")))return"LOCALFILE";for(var i,o=!1,a=null===(r=t.fetcher)||void 0===r?void 0:r.appNode,s=t.each(void 0,this.ns.link("requestedURI"),(0,F.docpart)(e),a),c=0;c<s.length;c++)if(void 0!==(n=s[c])){var u=t.any(n,this.ns.link("response"),null,a);if(void 0!==u){if(t.anyJS(u,this.ns.link("outOfDate"),null,a))continue;var l=t.anyValue(u,this.ns.httph("wac-allow"));if(l){var d,p=tr(l.split(","));try{for(p.s();!(d=p.n()).done;){var f=d.value.split("=");if(f[0].includes("user")&&!f[1].includes("write")&&!f[1].includes("append"))return!1}}catch(e){p.e(e)}finally{p.f()}}var h=t.each(u,this.ns.httph("accept-patch"));if(h.length)for(var m=0;m<h.length;m++){if((i=h[m].value.trim()).indexOf("application/sparql-update")>=0)return"SPARQL";if(i.indexOf("application/sparql-update-single-match")>=0)return"SPARQL"}var g=t.each(u,this.ns.httph("ms-author-via"));if(g.length)for(var v=0;v<g.length;v++){if((i=g[v].value.trim()).indexOf("SPARQL")>=0)return"SPARQL";if(i.indexOf("DAV")>=0)return"DAV"}if(!this.isHttpUri(e))return!!l&&"LOCALFILE";var y=t.each(u,this.ns.http("status"));if(y.length)for(var b=0;b<y.length;b++)200!==y[b]&&404!==y[b]||(o=!0)}}if(0===s.length);else if(o)return!1}},{key:"anonymize",value:function(e){return"_:"===e.toNT().substr(0,2)&&this.mentioned(e)?"?"+e.toNT().substr(2):e.toNT()}},{key:"anonymizeNT",value:function(e){return this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" ."}},{key:"nTriples",value:function(e){return"".concat(e.subject.toNT()," ").concat(e.predicate.toNT()," ").concat(e.object.toNT()," .")}},{key:"statementBnodes",value:function(e){return[e.subject,e.predicate,e.object].filter((function(e){return(0,g.B2)(e)}))}},{key:"statementArrayBnodes",value:function(e){for(var t=[],r=0;r<e.length;r++)t=t.concat(this.statementBnodes(e[r]));t.sort();for(var n=[],i=0;i<t.length;i++)0!==i&&t[i].equals(t[i-1])||n.push(t[i]);return n}},{key:"cacheIfps",value:function(){this.ifps={};for(var e=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("InverseFunctionalProperty")),t=0;t<e.length;t++)this.ifps[e[t].value]=!0;this.fps={},e=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("FunctionalProperty"));for(var r=0;r<e.length;r++)this.fps[e[r].value]=!0}},{key:"bnodeContext2",value:function(e,t,r){for(var n,i,o=this.store.statementsMatching(void 0,void 0,e,t),a=0;a<o.length;a++)if(this.fps[o[a].predicate.value]){if(!(n=o[a].subject).isBlank)return[o[a]];if(r&&(i=this.bnodeContext2(n,t,r-1)))return i.concat([o[a]])}o=this.store.statementsMatching(e,void 0,void 0,t);for(var s=0;s<o.length;s++)if(this.ifps[o[s].predicate.value]){if(!(n=o[s].object).isBlank)return[o[s]];if(r&&(i=this.bnodeContext2(n,t,r-1)))return i.concat([o[s]])}return null}},{key:"bnodeContext1",value:function(e,t){for(var r=0;r<3;r++){var n=this.bnodeContext2(e,t,r);if(null!==n)return n}return this.store.connectedStatements(e,t)}},{key:"mentioned",value:function(e){return 0!==this.store.statementsMatching(e,null,null,null).length||0!==this.store.statementsMatching(null,e).length||0!==this.store.statementsMatching(null,null,e).length}},{key:"bnodeContext",value:function(e,t){var r=[];if(e.length){this.cacheIfps();for(var n=0;n<e.length;n++){var i=e[n];this.mentioned(i)&&(r=r.concat(this.bnodeContext1(i,t)))}}return r}},{key:"statementContext",value:function(e){var t=this.statementBnodes(e);return this.bnodeContext(t,e.graph)}},{key:"contextWhere",value:function(e){var t=this;return e&&0!==e.length?"WHERE { "+e.map((function(e){return t.anonymizeNT(e)})).join("\n")+" }\n":""}},{key:"fire",value:function(e,t,r){var n=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Promise.resolve().then((function(){if(!e)throw new Error("No URI given for remote editing operation: "+t);return i.noMeta=!0,i.contentType="application/sparql-update",i.body=t,n.store.fetcher.webOperation("PATCH",e,i)})).then((function(n){if(!n.ok){var i="UpdateManager: update failed for <"+e+"> status="+n.status+", "+n.statusText+"\n for query: "+t;throw new Error(i)}r(e,n.ok,n.responseText,n)})).catch((function(t){r(e,!1,t.message,t)}))}},{key:"update_statement",value:function(e){if(!e||e.graph){var t=this,r=this.statementContext(e);return{statement:e?[e.subject,e.predicate,e.object,e.graph]:void 0,statementNT:e?this.anonymizeNT(e):void 0,where:t.contextWhere(r),set_object:function(e,r){var n=this.where;n+="DELETE DATA { "+this.statementNT+" } ;\n",n+="INSERT DATA { "+this.anonymize(this.statement[0])+" "+this.anonymize(this.statement[1])+" "+this.anonymize(e)+" . }\n",t.fire(this.statement[3].value,n,r)}}}}},{key:"insert_statement",value:function(e,t){var r=e instanceof Array?e[0]:e,n=this.contextWhere(this.statementContext(r));if(e instanceof Array){for(var i="",o=0;o<e.length;o++)i+=e[o]+"\n";n+="INSERT DATA { "+i+" }\n"}else n+="INSERT DATA { "+this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" . }\n";this.fire(r.graph.value,n,t)}},{key:"delete_statement",value:function(e,t){var r=e instanceof Array?e[0]:e,n=this.contextWhere(this.statementContext(r));if(e instanceof Array){for(var i="",o=0;o<e.length;o++)i+=e[o]+"\n";n+="DELETE DATA { "+i+" }\n"}else n+="DELETE DATA { "+this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" . }\n";this.fire(r.graph.value,n,t)}},{key:"requestDownstreamAction",value:function(e,t){var r=this.patchControlFor(e);if(r.pendingUpstream)if(r.downstreamAction){if(""+r.downstreamAction!=""+t)throw new Error("Can't wait for > 1 different downstream actions")}else r.downstreamAction=t;else t(e)}},{key:"clearUpstreamCount",value:function(e){this.patchControlFor(e).upstreamCount=0}},{key:"getUpdatesVia",value:function(e){var t=this.store.fetcher.getHeader(e,"updates-via");return t&&t.length?t[0].trim():null}},{key:"addDownstreamChangeListener",value:function(e,t){var r=this,n=this.patchControlFor(e);n.downstreamChangeListeners||(n.downstreamChangeListeners=[]),n.downstreamChangeListeners.push(t),this.setRefreshHandler(e,(function(e){r.reloadAndSync(e)}))}},{key:"reloadAndSync",value:function(e){var t=this.patchControlFor(e),r=this;if(t.reloading)t.outOfDate=!0;else{t.reloading=!0;var n=1e3;!function i(){r.reload(r.store,e,(function(e,r,o){if(e){if(t.downstreamChangeListeners)for(var a=0;a<t.downstreamChangeListeners.length;a++)t.downstreamChangeListeners[a]();t.reloading=!1,t.outOfDate&&(t.outOfDate=!1,i())}else t.reloading=!1,0===o.status&&(t.reloading=!0,setTimeout(i,n*=2))}))}()}}},{key:"setRefreshHandler",value:function(e,t){var r=this.getUpdatesVia(e),n=t,i=this,o=this,a=1500,s=0;if(!r)return!1;var c=(r=(0,F.join)(r,e.value)).replace(/^http:/,"ws:").replace(/^https:/,"wss:");return function t(){var r;if("undefined"!=typeof WebSocket)r=new WebSocket(c);else{if("undefined"==typeof window||!window.WebSocket)return;r=window.WebSocket(c)}r.onopen=function(){a=1500,this.send("sub "+e.value),s&&o.requestDownstreamAction(e,n)};var u=i.patchControlFor(e);u.upstreamCount=0,r.onerror=function(e){},r.onclose=function(e){a*=2,s+=1,setTimeout((function(){t()}),a)},r.onmessage=function(t){if(t.data&&"pub"===t.data.slice(0,3)){if("upstreamCount"in u&&(u.upstreamCount-=1,u.upstreamCount>=0))return;u.upstreamCount=0,i.requestDownstreamAction(e,n)}}}(),!0}},{key:"updateMany",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=e.concat(t).map((function(e){return e.why})),n=this,i=[];r.forEach((function(e){i.find((function(t){return t.equals(e)}))||i.push(e)}));var o=i.map((function(r){return n.update(e.filter((function(e){return e.why.equals(r)})),t.filter((function(e){return e.why.equals(r)})))}));return o.length,Promise.all(o)}},{key:"update",value:function(e,t,r,n){var i=this,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(!r){var a=this;return new Promise((function(r,i){a.update(e,t,(function(e,t,n){t?r():i(new Error(n))}),n,o)}))}try{var s=this.store,c=e?(0,g.Pv)(e)?e.statements:e instanceof Array?e:[e]:[],u=t?(0,g.Pv)(t)?t.statements:t instanceof Array?t:[t]:[];if(!(c instanceof Array))throw new Error("Type Error "+(0,h.Z)(c)+": "+c);if(!(u instanceof Array))throw new Error("Type Error "+(0,h.Z)(u)+": "+u);if(0===c.length&&0===u.length)return r(null,!0);var l=c.length?c[0].graph:u[0].graph;if(!l){var d="Error patching: statement does not specify which document to patch:"+c[0]+", "+u[0];throw new Error(d)}if("NamedNode"!==l.termType){var p="Error patching: document not a NamedNode:"+c[0]+", "+u[0];throw new Error(p)}var f=this.patchControlFor(l),m=Date.now(),v=["subject","predicate","object","why"],y=["insert","delete"],b={delete:c,insert:u};y.map((function(e){b[e].map((function(e){if(!l.equals(e.graph))throw new Error("update: destination "+l+" inconsistent with delete quad "+e.graph);v.map((function(t){if(void 0===e[t])throw new Error("update: undefined "+t+" of statement.")}))}))}));var w=this.editable(l.value,s);if(!1===w)throw new Error("Update: Can't make changes in uneditable "+l);if(void 0===w){if(n)throw new Error("Update: Loaded "+l+"but stil can't figure out what editing protcol it supports.");return void this.store.fetcher.load(l).then((function(n){i.update(e,t,r,!0,o)}),(function(n){if(404!==n.response.status)throw new Error("Update: Can't get updatability status ".concat(l," before patching: ").concat(n));i.update(e,t,r,!0,o)}))}if(w.indexOf("SPARQL")>=0){var x=[];c.length&&(x=this.statementArrayBnodes(c)),u.length&&(x=x.concat(this.statementArrayBnodes(u)));var _=this.bnodeContext(x,l),E=this.contextWhere(_),k="";if(E.length){if(c.length){k+="DELETE { ";for(var S=0;S<c.length;S++)k+=this.anonymizeNT(c[S])+"\n";k+=" }\n"}if(u.length){k+="INSERT { ";for(var A=0;A<u.length;A++)k+=this.anonymizeNT(u[A])+"\n";k+=" }\n"}k+=E}else{if(c.length){k+="DELETE DATA { ";for(var C=0;C<c.length;C++)k+=this.anonymizeNT(c[C])+"\n";k+=" } \n"}if(u.length){c.length&&(k+=" ; "),k+="INSERT DATA { ";for(var T=0;T<u.length;T++)k+=this.nTriples(u[T])+"\n";k+=" }\n"}}f.pendingUpstream=f.pendingUpstream?f.pendingUpstream+1:1,"upstreamCount"in f&&(f.upstreamCount+=1),this.fire(l.value,k,(function(e,t,n,i){if(i.elapsedTimeMs=Date.now()-m,t){try{s.remove(c)}catch(e){t=!1,n="Remote Ok BUT error deleting "+c.length+" from store!!! "+e}for(var o=0;o<u.length;o++)s.add(u[o].subject,u[o].predicate,u[o].object,l)}if(r(e,t,n,i),f.pendingUpstream-=1,0===f.pendingUpstream&&f.downstreamAction){var a=f.downstreamAction;delete f.downstreamAction,a(l)}}),o)}else if(w.indexOf("DAV")>=0)this.updateDav(l,c,u,r,o);else{if(!(w.indexOf("LOCALFILE")>=0))throw new Error("Unhandled edit method: '"+w+"' for "+l);try{this.updateLocalFile(l,c,u,r,o)}catch(e){r(l.value,!1,"Exception trying to write back file <"+l.value+">\n")}}}catch(e){r(void 0,!1,"Exception in update: "+e+"\n"+B.stackString(e))}}},{key:"updateDav",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=this.store,a=o.any(e,this.ns.link("request"));if(!a)throw new Error("No record of our HTTP GET request for document: "+e);var s=o.any(a,this.ns.link("response"));if(!s)return null;for(var c=o.the(s,this.ns.httph("content-type")).value,u=o.statementsMatching(void 0,void 0,void 0,e).slice(),l=0;l<t.length;l++)B.RDFArrayRemove(u,t[l]);for(var d=0;d<r.length;d++)u.push(r[d]);var p,f=this.serialize(e.value,u,c),h=o.the(s,this.ns.httph("content-location"));return h&&(p=(0,F.join)(h.value,p)),i.contentType=c,i.noMeta=!0,i.body=f,o.fetcher.webOperation("PUT",p,i).then((function(i){if(!i.ok)throw new Error(i.error);for(var a=0;a<t.length;a++)o.remove(t[a]);for(var s=0;s<r.length;s++)o.add(r[s].subject,r[s].predicate,r[s].object,e);n(e.value,i.ok,i.responseText,i)})).catch((function(t){n(e.value,!1,t.message,t)}))}},{key:"updateLocalFile",value:function(e,t,r,n){for(var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=this.store,a=o.statementsMatching(void 0,void 0,void 0,e).slice(),s=0;s<t.length;s++)B.RDFArrayRemove(a,t[s]);for(var c=0;c<r.length;c++)a.push(r[c]);var u=e.value.lastIndexOf(".");if(u<1)throw new Error("Rewriting file: No filename extension: "+e.value);var l=e.value.slice(u+1),d=Xt.CONTENT_TYPE_BY_EXT[l];if(!d)throw new Error("File extension ."+l+" not supported for data write");i.body=this.serialize(e.value,a,d),i.contentType=d,o.fetcher.webOperation("PUT",e.value,i).then((function(i){if(!i.ok)return n(e.value,!1,i.error);for(var a=0;a<t.length;a++)o.remove(t[a]);for(var s=0;s<r.length;s++)o.add(r[s].subject,r[s].predicate,r[s].object,e);n(e.value,!0,"")}))}},{key:"serialize",value:function(e,t,r){var n,i=this.store;if("string"==typeof t)return t;var o=V(i);switch(o.suggestNamespaces(i.namespaces),o.setBase(e),r){case"text/xml":case"application/rdf+xml":n=o.statementsToXML(t);break;case"text/n3":case"text/turtle":case"application/x-turtle":case"application/n3":n=o.statementsToN3(t);break;default:throw new Error("Content-type "+r+" not supported for data serialization")}return n}},{key:"put",value:function(e,t,r,n){var i,o=this,a=this.store;return Promise.resolve().then((function(){return i=o.serialize(e.value,t,r),a.fetcher.webOperation("PUT",e.value,{contentType:r,body:i})})).then((function(r){if(!r.ok)return n(e.value,r.ok,r.error,r);delete a.fetcher.nonexistent[e.value],delete a.fetcher.requested[e.value],"string"!=typeof t&&t.map((function(e){a.addStatement(e)})),n(e.value,r.ok,"",r)})).catch((function(t){n(e.value,!1,t.message)}))}},{key:"reload",value:function(e,t,r){var n=Date.now();e.fetcher.nowOrWhenFetched(t.value,{force:!0,noMeta:!0,clearPreviousData:!0},(function(e,i,o){if(e)if(o.onErrorWasCalled||200!==o.status)r(!1,"Non-HTTP error reloading data: "+i,o);else{var a=Date.now()-n;t.reloadTimeTotal||(t.reloadTimeTotal=0),t.reloadTimeCount||(t.reloadTimeCount=0),t.reloadTimeTotal+=a,t.reloadTimeCount+=1,r(!0)}else r(!1,"Error reloading data: "+i,o)}))}}]),e}();function ir(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function or(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ir(Object(r),!0).forEach((function(t){(0,u.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ir(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ar=or(or({},We),{},{fetcher:function(e,t){return new Xt(e,t)},graph:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return new fe(e,t||{rdfFactory:We})},lit:function(e,t,r){return this.literal(""+e,t||r)},st:function(e,t,r,n){return this.quad(e,t,r,n)}});const sr=ar;var cr=function(){function e(t,r){(0,i.Z)(this,e),this.parent=t,this.via=r,this.connected=!1,this.pending={},this.subscribed={},this.socket={};try{this.socket=new WebSocket(r),this.socket.onopen=this.onOpen,this.socket.onclose=this.onClose,this.socket.onmessage=this.onMessage,this.socket.onerror=this.onError}catch(e){this.onError(e)}}return(0,n.Z)(e,[{key:"_decode",value:function(e){var t,r,n,i,o,a,s;for(r in i={},o=function(){var r,n,i,o;for(o=[],r=0,n=(i=e.split("&")).length;r<n;r++)t=i[r],o.push(t.split("="));return o}())t=o[r],s=(a=[decodeURIComponent(t[0]),decodeURIComponent(t[1])])[1],null==i[n=a[0]]&&(i[n]=[]),i[n].push(s);return i}},{key:"_send",value:function(e,t,r){var n,i;return i=[e,t,r].join(" "),"function"==typeof(n=this.socket).send?n.send(i):void 0}},{key:"_subscribe",value:function(e){return this._send("sub",e,""),this.subscribed[e]=!0,this.subscribed[e]}},{key:"onClose",value:function(e){var t;for(t in this.connected=!1,this.subscribed)this.pending[t]=!0;return this.subscribed={},this.subscribed}},{key:"onError",value:function(e){throw new Error("onError"+e)}},{key:"onMessage",value:function(e){var t,r;return"ping"===(r=e.data.split(" "))[0]?"function"==typeof(t=this.socket).send?t.send("pong "+r.slice(1).join(" ")):void 0:"pub"===r[0]?this.parent.onUpdate(r[1],this._decode(r[2])):void 0}},{key:"onOpen",value:function(e){var t,r;for(r in this.connected=!0,t=[],this.pending)delete this.pending[r],t.push(this._subscribe(r));return t}},{key:"subscribe",value:function(e){return this.connected?this._subscribe(e):(this.pending[e]=!0,this.pending[e])}}]),e}(),ur=function(){function e(t){(0,i.Z)(this,e),this.fetcher=t,this.graph={},this.via={},this.fetcher.addCallback("headers",this.onHeaders)}return(0,n.Z)(e,[{key:"onHeaders",value:function(e){var t,r,n;return null==e.headers||"undefined"==typeof WebSocket||null===WebSocket||(t=e.headers.etag,n=e.headers["updates-via"],r=e.uri,t&&n&&(this.graph[r]={etag:t,via:n},this.register(n,r))),!0}},{key:"onUpdate",value:function(e,t){return this.fetcher.refresh(sr.namedNode(e))}},{key:"register",value:function(e,t){return null==this.via[e]&&(this.via[e]=new cr(this,e)),this.via[e].subscribe(t)}}]),e}();function lr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,c.Z)(e);if(t){var i=(0,c.Z)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,s.Z)(this,r)}}var dr={};for(var pr in sr)"function"==typeof sr[pr]&&(dr[pr]=sr[pr].bind(sr));var fr=dr.fetcher,hr=dr.graph,mr=dr.lit,gr=dr.st,vr=dr.namedNode,yr=dr.variable,br=dr.blankNode,wr=dr.defaultGraph,xr=dr.literal,_r=dr.quad,Er=dr.triple,kr=new ee,Sr=function(e){return kr.fromNT(e)},Ar=te.fromValue,Cr=f.nextId,Tr=function(e){(0,a.Z)(r,e);var t=lr(r);function r(e){var n;return(0,i.Z)(this,r),n=t.call(this,e),(0,u.Z)((0,o.Z)(n),"fetcher",void 0),n.fetcher=new Xt((0,o.Z)(n),{}),n}return(0,n.Z)(r)}(fe),Or=function(e){(0,a.Z)(r,e);var t=lr(r);function r(e){var n;return(0,i.Z)(this,r),n=t.call(this,e),(0,u.Z)((0,o.Z)(n),"updater",void 0),n.updater=new nr((0,o.Z)(n)),n}return(0,n.Z)(r)}(Tr)},1369:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n={debug:function(e){},warn:function(e){},info:function(e){},error:function(e){},success:function(e){},msg:function(e){}}},8967:(e,t,r)=>{"use strict";r.d(t,{Z:()=>m});var n=r(5671),i=r(3144),o=r(7326),a=r(9340),s=r(2963),c=r(1120),u=r(4942),l=r(1897),d=r(566),p=r(8946),f=r(8918),h=r(6680);var m=function(e){(0,a.Z)(m,e);var t,r,d=(t=m,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,c.Z)(t);if(r){var i=(0,c.Z)(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return(0,s.Z)(this,e)});function m(e){var t;if((0,n.Z)(this,m),t=d.call(this,(0,f._)(e)),(0,u.Z)((0,o.Z)(t),"termType",p.XM),(0,u.Z)((0,o.Z)(t),"classOrder",l.Z.NamedNode),!t.value)throw new Error("Missing IRI for NamedNode");if(!t.value.includes(":"))throw new Error('NamedNode IRI "'+e+'" must be absolute.');if(t.value.includes(" "))throw new Error('Error: NamedNode IRI "'+e+'" must not contain unencoded spaces.');return t}return(0,i.Z)(m,[{key:"dir",value:function(){var e=this.value.split("#")[0],t=e.slice(0,-1).lastIndexOf("/"),r=e.indexOf("//");return r>=0&&t<r+2||t<0?null:new m(e.slice(0,t+1))}},{key:"site",value:function(){var e=this.value.split("#")[0],t=e.indexOf("//");if(t<0)throw new Error("This URI does not have a web site part (origin)");var r=e.indexOf("/",t+2);return new m(r<0?e.slice(0)+"/":e.slice(0,r+1))}},{key:"doc",value:function(){return this.value.indexOf("#")<0?this:new m(this.value.split("#")[0])}},{key:"toString",value:function(){return"<"+this.value+">"}},{key:"id",value:function(){return this.value.split("#")[1]}},{key:"uri",get:function(){return this.value},set:function(e){this.value=e}}],[{key:"fromValue",value:function(e){return null==e||(0,h.jt)(e)?e:new m(e)}}]),m}(d.Z)},566:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(5671),i=r(3144),o=r(4942),a=function(){function e(t){(0,n.Z)(this,e),(0,o.Z)(this,"termType",void 0),(0,o.Z)(this,"classOrder",void 0),(0,o.Z)(this,"value",void 0),this.value=t}return(0,i.Z)(e,[{key:"substitute",value:function(e){return this}},{key:"compareTerm",value:function(e){return this.classOrder<e.classOrder?-1:this.classOrder>e.classOrder?1:this.value<e.value?-1:this.value>e.value?1:0}},{key:"equals",value:function(e){return!!e&&this.termType===e.termType&&this.value===e.value}},{key:"hashString",value:function(){return this.toCanonical()}},{key:"sameTerm",value:function(e){return this.equals(e)}},{key:"toCanonical",value:function(){return this.toNT()}},{key:"toNT",value:function(){return this.toString()}},{key:"toNQ",value:function(){return this.toNT()}},{key:"toString",value:function(){throw new Error("Node.toString() is abstract - see the subclasses instead")}}]),e}();(0,o.Z)(a,"fromValue",void 0),(0,o.Z)(a,"toJS",void 0)},8946:(e,t,r)=>{"use strict";r.d(t,{D7:()=>E,Eo:()=>_,Is:()=>y,NK:()=>s,UH:()=>a,V1:()=>i,XM:()=>n,_A:()=>l,aV:()=>v,b4:()=>g,fb:()=>c,lL:()=>m,ls:()=>u,oW:()=>b,qS:()=>f,sZ:()=>h,ui:()=>p,us:()=>d,xH:()=>o,xm:()=>w,z8:()=>x});var n="NamedNode",i="BlankNode",o="Literal",a="Variable",s="DefaultGraph",c="Collection",u="Empty",l="Graph",d="text/html",p="application/ld+json",f="text/n3",h="application/n3",m="application/nquads",g="application/n-quads",v="application/n-triples",y="application/rdf+xml",b="application/sparql-update",w="application/sparql-update-single-match",x="text/turtle",_="application/x-turtle",E="application/xhtml+xml"},1609:(e,t,r)=>{"use strict";r.r(t),r.d(t,{docpart:()=>o,document:()=>a,hostpart:()=>s,join:()=>c,protocol:()=>u,refTo:()=>l});var n=r(8967),i=i||console.log;function o(e){var t;return(t=e.indexOf("#"))<0?e:e.slice(0,t)}function a(e){return new n.Z(o(e))}function s(e){var t=/[^\/]*\/\/([^\/]*)\//.exec(e);return t?t[1]:""}function c(e,t){var r,n,o,a,s,c=t.indexOf("#");if(c>0&&(t=t.slice(0,c)),0===e.length)return t;if(0===e.indexOf("#"))return t+e;if(e.indexOf(":")>=0)return e;if(r=t.indexOf(":"),0===t.length)return e;if(r<0)return i("Invalid base: "+t+" in join with given: "+e),e;if(n=t.slice(0,+r+1||9e9),0===e.indexOf("//"))return n+e;if(t.indexOf("//",r)===r+1){if((o=t.indexOf("/",r+3))<0)return t.length-r-3>0?t+"/"+e:n+e}else if((o=t.indexOf("/",r+1))<0)return t.length-r-1>0?t+"/"+e:n+e;if(0===e.indexOf("/"))return t.slice(0,o)+e;if((a=(s=t.slice(o)).lastIndexOf("/"))<0)return n+e;for(a>=0&&a<s.length-1&&(s=s.slice(0,+a+1||9e9)),s+=e;s.match(/[^\/]*\/\.\.\//);)s=s.replace(/[^\/]*\/\.\.\//,"");return s=(s=s.replace(/\.\//g,"")).replace(/\/\.$/,"/"),t.slice(0,o)+s}function u(e){var t=e.indexOf(":");return t<0?null:e.slice(0,t)}function l(e,t){var r,n,i,o,a,s,c,u,l,d,p,f,h=new RegExp("^[-_a-zA-Z0-9.]+:(//[^/]*)?/[^/]*$");if(!e)return t;if(e===t)return"";for(r=c=0,o=t.length;c<o&&t[r]===e[r];r=++c);if(e.slice(0,r).match(h)&&((n=t.indexOf("//"))<0&&(n=-2),i=t.indexOf("/",n+2),"/"!==t[i+1]&&"/"!==e[i+1]&&t.slice(0,i)===e.slice(0,i)))return t.slice(i);if("#"===t[r]&&e.length===r)return t.slice(r);for(;r>0&&"/"!==t[r-1];)r--;if(r<3)return t;if(e.indexOf("//",r-2)>0||t.indexOf("//",r-2)>0)return t;if(e.indexOf(":",r)>0)return t;for(s=0,u=0,a=(d=e.slice(r)).length;u<a;u++)"/"===d[u]&&s++;if(0===s&&r<t.length&&"#"===t[r])return"./"+t.slice(r);if(0===s&&r===t.length)return"./";if(f="",s>0)for(l=1,p=s;p>=1?l<=p:l>=p;p>=1?++l:--l)f+="../";return f+t.slice(r)}},1048:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DOMParserFactory:()=>d,RDFArrayRemove:()=>b,callbackify:()=>l,domToString:()=>p,dtstamp:()=>h,dumpNode:()=>f,heavyCompare:()=>m,heavyCompareSPO:()=>g,linkRelationProperty:()=>u,log:()=>n.Z,mediaTypeClass:()=>c,output:()=>v,parseXML:()=>y,stackString:()=>x,string:()=>s,string_startswith:()=>w,uri:()=>i});var n=r(1369),i=r(1609),o=r(8967),a=r(3969);e=r.hmd(e);var s={template:function(e,t){for(var r=e.split("%s"),n="",i=0;i<t.length;i++)t[i]+="",n+=r[i]+t[i];return n+r.slice(t.length).join()}};function c(e){return e=e.split(";")[0].trim(),new o.Z("http://www.w3.org/ns/iana/media-types/"+e+"#Resource")}function u(e){return new o.Z("http://www.w3.org/ns/iana/link-relations/relation#"+e.trim())}function l(e,t){e.callbacks={};for(var r=t.length-1;r>=0;r--)e.callbacks[t[r]]=[];e.addHook=function(t){e.callbacks[t]||(e.callbacks[t]=[])},e.addCallback=function(t,r){e.callbacks[t].push(r)},e.removeCallback=function(t,r){for(var n=0;n<e.callbacks[t].length;n++)if(e.callbacks[t][n].name===r)return e.callbacks[t].splice(n,1),!0;return!1},e.insertCallback=function(t,r){e.callbacks[t].unshift(r)},e.fireCallbacks=function(t,r){var n,i,o=[],a=[],s=e.callbacks[t].length;for(n=s-1;n>=0;n--)(i=e.callbacks[t][n])&&i.apply(e,r)&&o.push(i);for(n=o.length-1;n>=0;n--)a.push(o[n]);for(n=s;n<e.callbacks[t].length;n++)a.push(e.callbacks[t][n]);e.callbacks[t]=a}}function d(){return window.DOMParser?new a.DOMParser:!!window.ActiveXObject&&new ActiveXObject("Microsoft.XMLDOM")}function p(e,t){var r=[];(t=t||{})&&t.selfClosing&&t.selfClosing.split(" ").forEach((function(e){r[e]=!0}));var n=[];return t&&t.skipAttributes&&t.skipAttributes.split(" ").forEach((function(e){n[e]=!0})),f(e,t,r,n)}function f(e,t,r,n){var i,o="",a=[!1];if(void 0===e.nodeType)return o;if(1===e.nodeType){if(e.hasAttribute("class")&&t&&t.classWithChildText&&e.matches(t.classWithChildText.class))o+=e.querySelector(t.classWithChildText.element).textContent;else if(!(t&&t.skipNodeWithClass&&e.matches("."+t.skipNodeWithClass))){var s=e.nodeName.toLowerCase();o+="<"+s;var c=[];for(i=e.attributes.length-1;i>=0;i--){var u=e.attributes[i];if(!(n&&n.length>0&&n[u.name]||/^\d+$/.test(u.name))){if("class"===u.name&&t&&t.replaceClassItemWith&&u.value.split(" ").indexOf(t.replaceClassItemWith.source)>-1){var l=new RegExp(t.replaceClassItemWith.source,"g");u.value=u.value.replace(l,t.replaceClassItemWith.target).trim()}"class"===u.name&&t&&t.skipClassWithValue&&t.skipClassWithValue===u.value||c.push(u.name+"='"+u.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&quot;")+"'")}}if(c.length>0&&(t&&t.sortAttributes&&c.sort((function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())})),o+=" "+c.join(" ")),r&&r.ename)o+=" />";else{for(o+=">",o+="html"===s?"\n ":"",a.push("style"===s||"script"===s),i=0;i<e.childNodes.length;i++)o+=f(e.childNodes[i]);a.pop(),o+="body"===s?"</"+s+">\n":"</"+s+">"}}}else if(8===e.nodeType)o+="\x3c!--"+e.nodeValue+"--\x3e";else if(3===e.nodeType||4===e.nodeType){var d=e.nodeValue.replace(/\n+$/,"");o+=a[a.length-1]?d:d.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}else console.log("Warning; Cannot handle serialising nodes of type: "+e.nodeType),console.log(e);return o}function h(){var e=new Date,t=e.getYear()+1900,r=e.getMonth()+1,n=e.getDate(),i=e.getUTCHours(),o=e.getUTCMinutes(),a=e.getSeconds();return r<10&&(r="0"+r),n<10&&(n="0"+n),i<10&&(i="0"+i),o<10&&(o="0"+o),a<10&&(a="0"+a),t+"-"+r+"-"+n+"T"+i+":"+o+":"+a+"Z"}function m(e,t,r,n){var i=function(e){return"BlankNode"===e.termType?null:e},o=function(e){var t=r.statementsMatching(e).map((function(e){return i(e.subject)+" "+i(e.predicate)+" "+i(e.object)})).concat(r.statementsMatching(void 0,void 0,e).map((function(e){return i(e.subject)+" "+i(e.predicate)+" "+i(e.object)})));return t.sort(),t.join("\n")},a=Object.prototype.hasOwnProperty.call(r,"compareTerms")?r.compareTerms(e,t):e.compareTerm(t);return"BlankNode"===e.termType&&"BlankNode"===t.termType?0===a?0:o(e)>o(t)?1:o(e)<o(t)?-1:a:n&&e.uri&&t.uri?(n[e.uri]||e.uri).localeCompare(n[t.uri]||t.uri):a}function g(e,t,r,n){return m(e.subject,t.subject,r,n)||m(e.predicate,t.predicate,r,n)||m(e.object,t.object,r,n)}function v(e){var t=document.createElement("div");t.textContent=e,document.body.appendChild(t)}function y(t,r){return r=r||{},e&&e.exports?(new a.DOMParser).parseFromString(t,r.contentType||"application/xhtml+xml"):("undefined"!=typeof window&&window.DOMParser?new window.DOMParser:new a.DOMParser).parseFromString(t,"application/xml")}function b(e,t){for(var r=0;r<e.length;r++)if(e[r].subject.equals(t.subject)&&e[r].predicate.equals(t.predicate)&&e[r].object.equals(t.object)&&e[r].why.equals(t.why))return void e.splice(r,1);throw new Error("RDFArrayRemove: Array did not contain "+t+" "+t.why)}function w(e,t){return e.slice(0,t.length)===t}function x(e){var t=e+"\n";if(!e.stack)return t+"No stack available.\n";for(var r=e.stack.toString().split("\n"),n=[],i=0;i<r.length;i++){var o=r[i];if(o.indexOf("ecmaunit.js")>-1)break;"("==o.charAt(0)&&(o="function"+o);var a=o.split("@");n.push(a)}for(i=0;i<n.length;i++)t+=" "+n[i][1]+"\n "+n[i][0];return t}},8918:(e,t,r)=>{"use strict";function n(e){return"string"==typeof e?e:e.value}r.d(t,{_:()=>n})},6680:(e,t,r)=>{"use strict";r.d(t,{B2:()=>g,NA:()=>w,NX:()=>m,PY:()=>h,Pv:()=>a,Uc:()=>c,Yi:()=>o,cG:()=>d,f:()=>u,jt:()=>p,lt:()=>b,lx:()=>y,n_:()=>f,nq:()=>l,uZ:()=>s,zz:()=>v});var n=r(1002),i=r(8946);function o(e){return"object"===(0,n.Z)(e)&&null!==e&&"subject"in e}function a(e){return"object"===(0,n.Z)(e)&&null!==e&&"statements"in e}function s(e){return p(e)&&e.termType===i.fb}function c(e){return e&&Object.prototype.hasOwnProperty.call(e,"termType")&&(e.termType===i.XM||e.termType===i.UH||e.termType===i.V1||e.termType===i.fb||e.termType===i.xH||e.termType===i._A)}function u(e){return e&&Object.prototype.hasOwnProperty.call(e,"termType")&&(e.termType===i.XM||e.termType===i.UH||e.termType===i.V1||e.termType===i.fb||e.termType===i.xH||e.termType===i._A)}function l(e){return p(e)&&(e.termType===i.XM||e.termType===i.V1||e.termType===i.UH)}function d(e){return p(e)&&e.termType===i.UH}function p(e){return"object"===(0,n.Z)(e)&&null!==e&&"termType"in e}function f(e){return e.termType===i.xH}function h(e){return"object"===(0,n.Z)(e)&&null!==e&&"subject"in e&&"predicate"in e&&"object"in e}function m(e){return p(e)&&"NamedNode"===e.termType}function g(e){return p(e)&&"termType"in e&&"BlankNode"===e.termType}function v(e){return p(e)&&(e.termType===i.XM||e.termType===i.UH||e.termType===i.V1)}function y(e){return p(e)&&(e.termType===i.XM||e.termType===i.UH)}function b(e){return p(e)&&(e.termType===i.XM||e.termType===i.UH||e.termType===i.V1||e.termType===i.xH)}function w(e){return p(e)&&(e.termType===i.XM||e.termType===i.UH||e.termType===i.V1||e.termType===i.NK)}},3119:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.createAclLogic=t.ACL_LINK=void 0;var o=r(6022),a=r(563);t.ACL_LINK=(0,o.sym)("http://www.iana.org/assignments/link-relations/acl"),t.createAclLogic=function(e){var r=a.ns;function s(e,t,n,i){void 0===i&&(i={});var a=i.public||[],s=(0,o.graph)(),c=(0,o.Namespace)("http://www.w3.org/ns/auth/acl#"),u=s.sym("".concat(n,"#a1")),l=s.sym(n),d=s.sym(e);if(s.add(u,r.rdf("type"),c("Authorization"),l),s.add(u,c("accessTo"),d,l),i.defaultForNew&&s.add(u,c("default"),d,l),s.add(u,c("agent"),t,l),s.add(u,c("mode"),c("Read"),l),s.add(u,c("mode"),c("Write"),l),s.add(u,c("mode"),c("Control"),l),a.length){u=s.sym("".concat(n,"#a2")),s.add(u,r.rdf("type"),c("Authorization"),l),s.add(u,c("accessTo"),d,l),s.add(u,c("agentClass"),r.foaf("Agent"),l);for(var p=0;p<a.length;p++)s.add(u,c("mode"),c(a[p]),l)}return(0,o.serialize)(l,s,n)}return{findAclDocUrl:function(r){return n(this,void 0,void 0,(function(){var n;return i(this,(function(i){switch(i.label){case 0:return[4,e.fetcher.load(r)];case 1:if(i.sent(),!(n=e.any(r,t.ACL_LINK)))throw new Error("No ACL link discovered for ".concat(r));return[2,n.value]}}))}))},setACLUserPublic:function(r,n,i){var o=e.any(e.sym(r),t.ACL_LINK);return Promise.resolve().then((function(){return o||function(r){var n=e.fetcher;if(!n)throw new Error("Cannot fetch ACL rel, store has no fetcher");return n.load(r).then((function(n){if(!n.ok)throw new Error("fetchACLRel: While loading:"+n.error);var i=e.any(e.sym(r),t.ACL_LINK);if(!i)throw new Error("fetchACLRel: No Link rel=ACL header for "+r);return i}))}(r).catch((function(e){throw new Error("Error fetching rel=ACL header for ".concat(r,": ").concat(e))}))})).then((function(t){var o=s(r,n,t.uri,i);if(!e.fetcher)throw new Error("Cannot PUT this, store has no fetcher");return e.fetcher.webOperation("PUT",t.uri,{data:o,contentType:"text/turtle"}).then((function(e){if(!e.ok)throw new Error("Error writing ACL text: "+e.error);return t}))}))},genACLText:s}}},2165:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.authSession=void 0;var n=r(4305);t.authSession=new n.Session({clientAuthentication:(0,n.getClientAuthenticationWithDependencies)({})},"mySession")},3804:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.SolidAuthnLogic=void 0;var c=r(6022),u=r(8865),l=o(r(3581)),d=function(){function e(e){this.session=e}return Object.defineProperty(e.prototype,"authSession",{get:function(){return this.session},enumerable:!1,configurable:!0}),e.prototype.currentUser=function(){var e=(0,u.appContext)();return e.viewingNoAuthPage?(0,c.sym)(e.webId):this&&this.session&&this.session.info&&this.session.info.webId&&this.session.info.isLoggedIn?(0,c.sym)(this.session.info.webId):(0,u.offlineTestID)()},e.prototype.checkUser=function(e){return a(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return(t=new URL(window.location.href).hash)&&window.localStorage.setItem("preLoginRedirectHash",t),this.session.onSessionRestore((function(e){document.location.toString()!==e&&history.replaceState(null,"",e)})),(r=new URL(window.location.href)).hash="",[4,this.session.handleIncomingRedirect({restorePreviousSession:!0,url:r.href})];case 1:return s.sent(),(n=window.localStorage.getItem("preLoginRedirectHash"))&&((i=new URL(window.location.href)).hash!==n&&(history.pushState?history.pushState(null,document.title,n):location.hash=n,i.hash=n),window.localStorage.setItem("preLoginRedirectHash","")),(o=(0,u.offlineTestID)())||((a=this.webIdFromSession(this.session.info))&&(o=this.saveUser(a)),o&&l.log("(Logged in as ".concat(o," by authentication)"))),[2,Promise.resolve(e?e(o):o)]}}))}))},e.prototype.saveUser=function(e,t){var r;if(e){r="string"==typeof e?e:e.uri;var n=(0,c.namedNode)(r);return t&&(t.me=n),n}return null},e.prototype.webIdFromSession=function(e){return(null==e?void 0:e.webId)&&e.isLoggedIn?e.webId:null},e}();t.SolidAuthnLogic=d},8865:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.offlineTestID=t.appContext=void 0;var a=r(6022),s=o(r(3581));t.appContext=function(){var e=window.SolidAppContext;if(e||(e={}),e.viewingNoAuthPage=!1,e.noAuth&&window.document&&window.document.location.href.startsWith(e.noAuth)){e.viewingNoAuthPage=!0;var t=new URLSearchParams(window.document.location.search);if(t){var r=e.viewedPage=t.get("uri")||null;if(r&&!(r=decodeURI(r)).startsWith(e.noAuth)){var n=r.split(/\//);e.idp=n[0]+"//"+n[2],e.viewingNoAuthPage=!1}}}return e},t.offlineTestID=function(){var e=window.$SolidTestEnvironment;if(void 0!==e&&e.username)return s.log("Assuming the user is "+e.username),(0,a.sym)(e.username);if("undefined"!=typeof document&&document.location&&"http://localhost"===(""+document.location).slice(0,16)){var t=document.getElementById("appTarget");if(!t)return null;var r=t.getAttribute("testID");return r?(s.log("Assuming user is "+r),(0,a.sym)(r)):null}return null}},6833:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.createChatLogic=void 0;var a=r(6022),s=r(563),c=r(9690),u="index.ttl#this";t.createChatLogic=function(e,t){var r=s.ns;function l(t,r,n){return i(this,void 0,void 0,(function(){var i,s;return o(this,(function(o){switch(o.label){case 0:return[4,e.fetcher.load(t)];case 1:if(o.sent(),!(i=e.any(t,new a.NamedNode("http://www.iana.org/assignments/link-relations/acl"))))throw new Error("Chat ACL doc not found!");return s="\n @prefix acl: <http://www.w3.org/ns/auth/acl#>.\n <#owner>\n a acl:Authorization;\n acl:agent <".concat(r.value,">;\n acl:accessTo <.>;\n acl:default <.>;\n acl:mode\n acl:Read, acl:Write, acl:Control.\n <#invitee>\n a acl:Authorization;\n acl:agent <").concat(n.value,">;\n acl:accessTo <.>;\n acl:default <.>;\n acl:mode\n acl:Read, acl:Append.\n "),[4,e.fetcher.webOperation("PUT",i.value,{data:s,contentType:"text/turtle"})];case 2:return o.sent(),[2]}}))}))}function d(t,n){return i(this,void 0,void 0,(function(){var i,s,u;return o(this,(function(o){switch(o.label){case 0:if(!(i=e.any(n,r.solid("privateTypeIndex"))))throw new Error("Private type index not found!");return[4,e.fetcher.load(i)];case 1:return o.sent(),s=(0,c.newThing)(i),u=[(0,a.st)(s,r.rdf("type"),r.solid("TypeRegistration"),i.doc()),(0,a.st)(s,r.solid("forClass"),r.meeting("LongChat"),i.doc()),(0,a.st)(s,r.solid("instance"),t,i.doc())],[4,new Promise((function(t,r){e.updater.update([],u,(function(e,n,i){n?t(null):r(new Error(i))}))}))];case 2:return o.sent(),[2]}}))}))}function p(r){return i(this,void 0,void 0,(function(){var n,i,s,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.loadMe()];case 1:return n=o.sent(),[4,t.getPodRoot(n)];case 2:i=o.sent(),s=(0,c.determineChatContainer)(r,i),u=!0,o.label=3;case 3:return o.trys.push([3,5,,6]),[4,e.fetcher.load(new a.NamedNode(s.value+"index.ttl#this"))];case 4:return o.sent(),[3,6];case 5:return o.sent(),u=!1,[3,6];case 6:return[2,{me:n,chatContainer:s,exists:u}]}}))}))}function f(e,t){return i(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return[4,h({me:t,newBase:e.value})];case 1:return[2,r.sent().newInstance]}}))}))}function h(t){var i=e,o=i.updater;if(t.me&&!t.me.uri)throw new Error("chat mintNew: Invalid userid "+t.me);var s=t.newInstance=t.newInstance||i.sym(t.newBase+u),c=s.doc();return i.add(s,r.rdf("type"),r.meeting("LongChat"),c),i.add(s,r.dc("title"),"Chat channel",c),i.add(s,r.dc("created"),(0,a.term)(new Date(Date.now())),c),t.me&&i.add(s,r.dc("author"),t.me,c),new Promise((function(e,r){null==o||o.put(c,i.statementsMatching(void 0,void 0,void 0,c),"text/turtle",(function(i,o,a){o?e(n(n({},t),{newInstance:s})):r(new Error("FAILED to save new chat channel at: "+i+" : "+a))}))}))}function m(t,n){var a;return i(this,void 0,void 0,(function(){var i,s,c;return o(this,(function(o){switch(o.label){case 0:return[4,e.fetcher.load(t.doc())];case 1:if(o.sent(),!(i=e.any(t,r.ldp("inbox"),void 0,t.doc())))throw new Error("Invitee inbox not found! ".concat(t.value));return s="\n <> a <http://www.w3.org/ns/pim/meeting#LongChatInvite> ;\n ".concat(r.rdf("seeAlso")," <").concat(n.value,"> .\n "),[4,null===(a=e.fetcher)||void 0===a?void 0:a.webOperation("POST",i.value,{data:s,contentType:"text/turtle"})];case 2:if(!(null==(c=o.sent())?void 0:c.headers.get("location")))throw new Error("Invite sending returned a ".concat(null==c?void 0:c.status));return[2]}}))}))}return{setAcl:l,addToPrivateTypeIndex:d,findChat:p,createChatThing:f,getChat:function(e,t){return void 0===t&&(t=!0),i(this,void 0,void 0,(function(){var r,n,i,s;return o(this,(function(o){switch(o.label){case 0:return[4,p(e)];case 1:return r=o.sent(),n=r.me,i=r.chatContainer,r.exists?[2,new a.NamedNode(i.value+u)]:t?[4,f(i,n)]:[3,6];case 2:return s=o.sent(),[4,m(e,s)];case 3:return o.sent(),[4,l(i,n,e)];case 4:return o.sent(),[4,d(s,n)];case 5:return o.sent(),[2,s];case 6:return[2,null]}}))}))},sendInvite:m,mintNew:h}}},9674:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.createInboxLogic=void 0;var o=r(9690);t.createInboxLogic=function(e,t,r,a,s){return{createInboxFor:function(e,o){return n(this,void 0,void 0,(function(){var n,s,c;return i(this,(function(i){switch(i.label){case 0:return[4,t.loadMe()];case 1:return n=i.sent(),[4,t.getPodRoot(n)];case 2:return s=i.sent(),c="".concat(s.value,"p2p-inboxes/").concat(encodeURIComponent(o),"/"),[4,a.createContainer(c)];case 3:return i.sent(),[4,r.setSinglePeerAccess({ownerWebId:n.value,peerWebId:e,accessToModes:"acl:Append",target:c})];case 4:return i.sent(),[2,c]}}))}))},getNewMessages:function(e){return n(this,void 0,void 0,(function(){var r;return i(this,(function(n){switch(n.label){case 0:return e?[3,2]:[4,t.loadMe()];case 1:e=n.sent(),n.label=2;case 2:return[4,t.getMainInbox(e)];case 3:return r=n.sent(),[4,a.getContainerMembers(r)];case 4:return[2,n.sent().filter((function(e){return!a.isContainer(e)}))]}}))}))},markAsRead:function(t,r){return n(this,void 0,void 0,(function(){var n,a,s,c;return i(this,(function(i){switch(i.label){case 0:return[4,e.fetcher._fetch(t)];case 1:if(200!==(n=i.sent()).status)throw new Error("Not OK! ".concat(t));return a=(0,o.getArchiveUrl)(t,r),c={method:"PUT"},[4,n.text()];case 2:return c.body=i.sent(),c.headers=[["Content-Type",n.headers.get("Content-Type")||"application/octet-stream"]],s=c,[4,e.fetcher._fetch(a,s)];case 3:return"2"!==i.sent().status.toString()[0]?[3,5]:[4,e.fetcher._fetch(t,{method:"DELETE"})];case 4:i.sent(),i.label=5;case 5:return[2]}}))}))}}}},166:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.authSession=t.authn=t.store=t.solidLogicSingleton=t.WebOperationError=t.NotEditableError=t.FetchError=t.NotFoundError=t.SameOriginForbiddenError=t.CrossOriginForbiddenError=t.UnauthorizedError=t.getSuggestedIssuers=t.appContext=t.offlineTestID=t.ACL_LINK=void 0;var n=r(720);Object.defineProperty(t,"solidLogicSingleton",{enumerable:!0,get:function(){return n.solidLogicSingleton}});var i=n.solidLogicSingleton.authn;t.authn=i;var o=n.solidLogicSingleton.authn.authSession;t.authSession=o;var a=n.solidLogicSingleton.store;t.store=a;var s=r(3119);Object.defineProperty(t,"ACL_LINK",{enumerable:!0,get:function(){return s.ACL_LINK}});var c=r(8865);Object.defineProperty(t,"offlineTestID",{enumerable:!0,get:function(){return c.offlineTestID}}),Object.defineProperty(t,"appContext",{enumerable:!0,get:function(){return c.appContext}});var u=r(1896);Object.defineProperty(t,"getSuggestedIssuers",{enumerable:!0,get:function(){return u.getSuggestedIssuers}});var l=r(7611);Object.defineProperty(t,"UnauthorizedError",{enumerable:!0,get:function(){return l.UnauthorizedError}}),Object.defineProperty(t,"CrossOriginForbiddenError",{enumerable:!0,get:function(){return l.CrossOriginForbiddenError}}),Object.defineProperty(t,"SameOriginForbiddenError",{enumerable:!0,get:function(){return l.SameOriginForbiddenError}}),Object.defineProperty(t,"NotFoundError",{enumerable:!0,get:function(){return l.NotFoundError}}),Object.defineProperty(t,"FetchError",{enumerable:!0,get:function(){return l.FetchError}}),Object.defineProperty(t,"NotEditableError",{enumerable:!0,get:function(){return l.NotEditableError}}),Object.defineProperty(t,"WebOperationError",{enumerable:!0,get:function(){return l.WebOperationError}})},1896:function(e,t){"use strict";var r=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.getSuggestedIssuers=void 0;var n=[{name:"Solid Community",uri:"https://solidcommunity.net"},{name:"Solid Web",uri:"https://solidweb.org"},{name:"Inrupt.net",uri:"https://inrupt.net"},{name:"pod.Inrupt.com",uri:"https://login.inrupt.com"}];t.getSuggestedIssuers=function(){var e=r([],n,!0),t=new URL(location.href),i=t.host,o=t.origin,a=e.map((function(e){var t=e.uri;return new URL(t).host}));return a.includes(i)||a.some((function(e){return r=e,(n=(t=i).length-r.length-1)>0&&"."===t[n]&&t.endsWith(r);var t,r,n}))||e.unshift({name:i,uri:o}),e}},7611:function(e,t){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.FetchError=t.WebOperationError=t.NotEditableError=t.NotFoundError=t.SameOriginForbiddenError=t.CrossOriginForbiddenError=t.UnauthorizedError=void 0;var i=function(e){function t(t){var r=this.constructor,n=e.call(this,t)||this;return Object.setPrototypeOf(n,r.prototype),n.name=r.name,n}return n(t,e),t}(Error),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i);t.UnauthorizedError=o;var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i);t.CrossOriginForbiddenError=a;var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i);t.SameOriginForbiddenError=s;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i);t.NotFoundError=c;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i);t.NotEditableError=u;var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i);t.WebOperationError=l;var d=function(e){function t(t,r){var n=e.call(this,r)||this;return n.status=t,n}return n(t,e),t}(i);t.FetchError=d},6947:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.createSolidLogic=void 0;var a=o(r(6022)),s=r(3119),c=r(3804),u=r(6833),l=r(9674),d=r(6659),p=r(6609),f=r(7947),h=r(7721),m=o(r(3581));t.createSolidLogic=function(e,t){m.log("SolidLogic: Unique instance created. There should only be one of these.");var r=a.graph();a.fetcher(r,{fetch:e.fetch}),r.updater=new a.UpdateManager(r),r.features=[];var n=new c.SolidAuthnLogic(t),i=(0,s.createAclLogic)(r),o=(0,f.createContainerLogic)(r),g=(0,h.createUtilityLogic)(r,i,o),v=(0,d.createProfileLogic)(r,n,g),y=(0,u.createChatLogic)(r,v),b=(0,l.createInboxLogic)(r,v,g,o,i),w=(0,p.createTypeIndexLogic)(r,n,v,g);return m.log("SolidAuthnLogic initialized"),{store:r,authn:n,acl:i,inbox:b,chat:y,profile:v,typeIndex:w,load:function(e){return r.fetcher.load(e)},updatePromise:function(e,t){return void 0===t&&(t=[]),new Promise((function(n,i){r.updater.update(e,t,(function(e,t,r){t?n():i(new Error(r))}))}))},clearStore:function(){r.statements.slice().forEach(r.remove.bind(r))}}}},720:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.solidLogicSingleton=void 0;var c=o(r(3581)),u=r(2165),l=(0,r(6947).createSolidLogic)({fetch:function(e,t){return a(void 0,void 0,void 0,(function(){var r;return s(this,(function(n){return r=t&&t.credentials&&"omit"==t.credentials,u.authSession.info.webId&&!r?[2,u.authSession.fetch(e,t)]:[2,window.fetch(e,t)]}))}))}},u.authSession);t.solidLogicSingleton=l,c.log("Unique quadstore initialized.")},6659:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.createProfileLogic=void 0;var c=r(7611),u=o(r(3581)),l=r(563),d=r(9690);t.createProfileLogic=function(e,t,r){var n=l.ns;function i(t){return a(this,void 0,void 0,(function(){var i,a,l,p,f,h;return s(this,(function(s){switch(s.label){case 0:return[4,o(t)];case 1:s.sent(),i=(0,d.suggestPreferencesFile)(t),s.label=2;case 2:return s.trys.push([2,4,,5]),[4,r.followOrCreateLink(t,n.space("preferencesFile"),i,t.doc())];case 3:return a=s.sent(),[3,5];case 4:if(l=s.sent(),p="User ".concat(t," has no pointer in profile to preferences file."),u.warn(p),l instanceof c.NotEditableError)throw l;if(l instanceof c.WebOperationError)throw l;if(l instanceof c.UnauthorizedError)throw l;if(l instanceof c.CrossOriginForbiddenError)throw l;if(l instanceof c.SameOriginForbiddenError)throw l;if(l instanceof c.FetchError)throw l;throw l;case 5:return s.trys.push([5,7,,8]),[4,e.fetcher.load(a)];case 6:return s.sent(),[3,8];case 7:if(f=s.sent(),h="Unable to load preference of user ".concat(t,": ").concat(f),u.warn(h),401===f.response.status)throw new c.UnauthorizedError;if(403===f.response.status){if((0,d.differentOrigin)(a))throw new c.CrossOriginForbiddenError;throw new c.SameOriginForbiddenError}throw new Error(h);case 8:return[2,a]}}))}))}function o(t){return a(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:if(!t)throw new Error("loadProfile: no user given.");n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e.fetcher.load(t.doc())];case 2:return n.sent(),[3,4];case 3:throw r=n.sent(),new Error("Unable to load profile of user ".concat(t,": ").concat(r));case 4:return[2,t.doc()]}}))}))}function p(t){return e.any(t,n.space("storage"),void 0,t.doc())}return{loadMe:function(){return a(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:if(null===(r=t.currentUser()))throw new Error("Current user not found! Not logged in?");return[4,e.fetcher.load(r.doc())];case 1:return n.sent(),[2,r]}}))}))},getPodRoot:function(e){var t=p(e);if(!t)throw new Error("User pod root not found!");return t},getMainInbox:function(t){return a(this,void 0,void 0,(function(){var r;return s(this,(function(i){switch(i.label){case 0:return[4,e.fetcher.load(t)];case 1:if(i.sent(),!(r=e.any(t,n.ldp("inbox"),void 0,t.doc())))throw new Error("User main inbox not found!");return[2,r]}}))}))},findStorage:p,loadPreferences:i,loadProfile:o,silencedLoadPreferences:function(e){return a(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,i(e)];case 1:return[2,t.sent()];case 2:return t.sent(),[2,void 0];case 3:return[2]}}))}))}}}},6609:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.createTypeIndexLogic=void 0;var c=r(6022),u=o(r(3581)),l=r(563),d=r(9690);t.createTypeIndexLogic=function(e,t,r,n){var i=l.ns;function o(t){return a(this,void 0,void 0,(function(){var o,a,c,l,d,p,f,h,v,y,b,w,x;return s(this,(function(s){switch(s.label){case 0:if(!t)throw new Error("loadTypeIndexesFor: No user given");return[4,r.loadProfile(t)];case 1:o=s.sent(),a=m(t),s.label=2;case 2:return s.trys.push([2,4,,5]),[4,n.followOrCreateLink(t,i.solid("publicTypeIndex"),a,o)];case 3:return c=s.sent(),[3,5];case 4:return s.sent(),y="User ".concat(t," has no pointer in profile to publicTypeIndex file."),u.warn(y),[3,5];case 5:l=c?[{label:"public",index:c,agent:t}]:[],s.label=6;case 6:return s.trys.push([6,8,,9]),[4,r.silencedLoadPreferences(t)];case 7:return d=s.sent(),[3,9];case 8:return s.sent(),d=null,[3,9];case 9:if(!d)return[3,15];f=g(d),h=void 0,s.label=10;case 10:return s.trys.push([10,13,,14]),(v=e.any(t,i.solid("privateTypeIndex"),void 0,o))?[3,12]:[4,n.followOrCreateLink(t,i.solid("privateTypeIndex"),f,d)];case 11:v=s.sent(),s.label=12;case 12:return h=v,[3,14];case 13:return s.sent(),y="User ".concat(t," has no pointer in preference file to privateTypeIndex file."),u.warn(y),[3,14];case 14:return p=h?[{label:"private",index:h,agent:t}]:[],[3,16];case 15:p=[],s.label=16;case 16:if(0===(b=l.concat(p)).length)return[2,b];w=b.map((function(e){return e.index})),s.label=17;case 17:return s.trys.push([17,19,,20]),[4,e.fetcher.load(w)];case 18:return s.sent(),[3,20];case 19:return x=s.sent(),u.warn("Problems loading type index: ",x),[3,20];case 20:return[2,b]}}))}))}function p(t){return a(this,void 0,void 0,(function(){var n,a,c,l,d,p,f,h,m;return s(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,r.silencedLoadPreferences(t)];case 1:return n=s.sent(),[3,3];case 2:return s.sent(),a="User ".concat(t," has no pointer in profile to preferences file."),u.warn(a),[3,3];case 3:if(!n)return[3,8];c=e.each(t,i.solid("community"),void 0,n).concat(e.each(t,i.solid("community"),void 0,t.doc())),l=[],d=0,p=c,s.label=4;case 4:return d<p.length?(f=p[d],m=(h=l).concat,[4,o(f)]):[3,7];case 5:l=m.apply(h,[s.sent()]),s.label=6;case 6:return d++,[3,4];case 7:return[2,l];case 8:return[2,[]]}}))}))}function f(e){return a(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return[4,o(e)];case 1:return r=(t=n.sent()).concat,[4,p(e)];case 2:return[2,r.apply(t,[n.sent().flat()])]}}))}))}function h(e,t){return a(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return[4,f(t)];case 1:r=s.sent(),n=[],i=0,o=r,s.label=2;case 2:return i<o.length?[4,v(o[i],e)]:[3,5];case 3:a=s.sent(),n=n.concat(a),s.label=4;case 4:return i++,[3,2];case 5:return[2,n]}}))}))}function m(e){var t;return(0,c.sym)((null===(t=e.doc().dir())||void 0===t?void 0:t.uri)+"publicTypeIndex.ttl")}function g(e){var t;return(0,c.sym)((null===(t=e.doc().dir())||void 0===t?void 0:t.uri)+"privateTypeIndex.ttl")}function v(t,r){return a(this,void 0,void 0,(function(){var n,o,a,u,l,d,p,f,h,m,g,v,y,b;return s(this,(function(s){switch(s.label){case 0:n=t.index,o=[],a=e.statementsMatching(null,i.solid("instance"),null,n).concat(e.statementsMatching(null,i.solid("instanceContainer"),null,n)).map((function(e){return e.subject})),u=0,l=a,s.label=1;case 1:if(!(u<l.length))return[3,6];if(d=l[u],p=e.any(d,i.solid("forClass"),null,n),r&&!p.sameTerm(r))return[3,5];for(f=e.each(d,i.solid("instance"),null,n),h=0,m=f;h<m.length;h++)b=m[h],o.push({instance:b,type:p,scope:t});g=e.each(d,i.solid("instanceContainer"),null,n),v=0,y=g,s.label=2;case 2:return v<y.length?(b=y[v],[4,e.fetcher.load(b)]):[3,5];case 3:s.sent(),o.push({instance:(0,c.sym)(b.value),type:p,scope:t}),s.label=4;case 4:return v++,[3,2];case 5:return u++,[3,1];case 6:return[2,o]}}))}))}return{registerInTypeIndex:function(t,r,n){return a(this,void 0,void 0,(function(){var o,a,u,l;return s(this,(function(s){switch(s.label){case 0:o=(0,d.newThing)(r),a=[(0,c.st)(o,i.rdf("type"),i.solid("TypeRegistration"),r),(0,c.st)(o,i.solid("forClass"),n,r),(0,c.st)(o,i.solid("instance"),t,r)],s.label=1;case 1:return s.trys.push([1,3,,4]),[4,e.updater.update([],a)];case 2:return s.sent(),[3,4];case 3:return u=s.sent(),l="Unable to register ".concat(t," in index ").concat(r,": ").concat(u),console.warn(l),[2,null];case 4:return[2,o]}}))}))},getRegistrations:function(t,r){return e.each(void 0,i.solid("instance"),t).filter((function(t){return e.holds(t,i.solid("forClass"),r)}))},loadTypeIndexesFor:o,loadCommunityTypeIndexes:p,loadAllTypeIndexes:f,getScopedAppInstances:h,getAppInstances:function(e){return a(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:if(!(r=t.currentUser()))throw new Error("getAppInstances: Must be logged in to find apps.");return[4,h(e,r)];case 1:return[2,n.sent().map((function(e){return e.instance}))]}}))}))},suggestPublicTypeIndex:m,suggestPrivateTypeIndex:g,deleteTypeIndexRegistration:function(t){return a(this,void 0,void 0,(function(){var r,n;return s(this,(function(o){switch(o.label){case 0:if(!(r=e.the(null,i.solid("instance"),t.instance,t.scope.index)))throw new Error("deleteTypeIndexRegistration: No registration found for ".concat(t.instance));return n=e.statementsMatching(r,null,null,t.scope.index),[4,e.updater.update(n,[])];case 1:return o.sent(),[2]}}))}))},getScopedAppsFromIndex:v}}},7947:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.createContainerLogic=void 0;var o=r(6022);t.createContainerLogic=function(e){function t(t){return e.statementsMatching(t,(0,o.sym)("http://www.w3.org/ns/ldp#contains"),void 0).map((function(e){return e.object}))}function r(e){var t=e.value;return"/"===t.charAt(t.length-1)}return{isContainer:r,createContainer:function(t){return n(this,void 0,void 0,(function(){var n;return i(this,(function(i){switch(i.label){case 0:if(!r((0,o.sym)(t)))throw new Error("Not a container URL ".concat(t));return[4,e.fetcher._fetch(t,{method:"PUT",headers:{"Content-Type":"text/turtle","If-None-Match":"*",Link:'<http://www.w3.org/ns/ldp#BasicContainer>; rel="type"'},body:" "})];case 1:if("2"!==(n=i.sent()).status.toString()[0])throw new Error("Not OK: got ".concat(n.status," response while creating container at ").concat(t));return[2]}}))}))},getContainerElements:t,getContainerMembers:function(r){return n(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,e.fetcher.load(r)];case 1:return n.sent(),[2,t(r)]}}))}))}}}},3581:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trace=t.error=t.warn=t.log=void 0,t.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.log.apply(console,e)},t.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.warn.apply(console,e)},t.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.error.apply(console,e)},t.trace=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.trace.apply(console,e)}},563:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ns=void 0;var s=a(r(3180)),c=o(r(6022));t.ns=(0,s.default)(c)},7721:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.createUtilityLogic=void 0;var c=r(6022),u=r(7611),l=o(r(3581)),d=r(9690);t.createUtilityLogic=function(e,t,r){function n(t){return a(this,void 0,void 0,(function(){var r,n,i,o;return s(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,10]),[4,e.fetcher.load(t)];case 1:return r=a.sent(),[3,10];case 2:if(404!==(n=a.sent()).response.status)return[3,8];a.label=3;case 3:return a.trys.push([3,5,,6]),[4,e.fetcher.webOperation("PUT",t,{data:"",contentType:"text/turtle"})];case 4:return a.sent(),[3,6];case 5:throw i=a.sent(),o="createIfNotExists: PUT FAILED: "+t+": "+i,new u.WebOperationError(o);case 6:return[4,e.fetcher.load(t)];case 7:return a.sent(),[3,9];case 8:if(401===n.response.status)throw new u.UnauthorizedError;if(403===n.response.status){if((0,d.differentOrigin)(t))throw new u.CrossOriginForbiddenError;throw new u.SameOriginForbiddenError}throw o="createIfNotExists doc load error NOT 404: "+t+": "+n,new u.FetchError(n.status,n.message+o);case 9:return[3,10];case 10:return[2,r]}}))}))}return{recursiveDelete:function n(i){return a(this,void 0,void 0,(function(){var o,a,c;return s(this,(function(s){switch(s.label){case 0:return s.trys.push([0,6,,7]),r.isContainer(i)?[4,t.findAclDocUrl(i)]:[3,5];case 1:return o=s.sent(),[4,e.fetcher._fetch(o,{method:"DELETE"})];case 2:return s.sent(),[4,r.getContainerMembers(i)];case 3:return a=s.sent(),[4,Promise.all(a.map((function(e){return n(e)})))];case 4:s.sent(),s.label=5;case 5:return c=i.value,[2,e.fetcher._fetch(c,{method:"DELETE"})];case 6:return s.sent(),[3,7];case 7:return[2]}}))}))},setSinglePeerAccess:function(r){return a(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return n=["@prefix acl: <http://www.w3.org/ns/auth/acl#>.","","<#alice> a acl:Authorization;\n acl:agent <".concat(r.ownerWebId,">;")," acl:accessTo <".concat(r.target,">;")," acl:default <".concat(r.target,">;")," acl:mode acl:Read, acl:Write, acl:Control.",""].join("\n"),r.accessToModes&&(n+=["<#bobAccessTo> a acl:Authorization;"," acl:agent <".concat(r.peerWebId,">;")," acl:accessTo <".concat(r.target,">;")," acl:mode ".concat(r.accessToModes,"."),""].join("\n")),r.defaultModes&&(n+=["<#bobDefault> a acl:Authorization;"," acl:agent <".concat(r.peerWebId,">;")," acl:default <".concat(r.target,">;")," acl:mode ".concat(r.defaultModes,"."),""].join("\n")),[4,t.findAclDocUrl((0,c.sym)(r.target))];case 1:return i=o.sent(),[2,e.fetcher._fetch(i,{method:"PUT",body:n,headers:[["Content-Type","text/turtle"]]})]}}))}))},createEmptyRdfDoc:function(t,r){return a(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,e.fetcher.webOperation("PUT",t.uri,{data:"# ".concat(new Date," ").concat(r,"\n "),contentType:"text/turtle"})];case 1:return n.sent(),[2]}}))}))},followOrCreateLink:function(t,r,i,o){return a(this,void 0,void 0,(function(){var a,d,p,f;return s(this,(function(s){switch(s.label){case 0:return[4,e.fetcher.load(o)];case 1:if(s.sent(),a=e.any(t,r,null,o))return[2,a];if(!e.updater.editable(o))throw p="followOrCreateLink: cannot edit ".concat(o.value),l.warn(p),new u.NotEditableError(p);s.label=2;case 2:return s.trys.push([2,4,,5]),[4,e.updater.update([],[(0,c.st)(t,r,i,o)])];case 3:return s.sent(),[3,5];case 4:throw d=s.sent(),p="followOrCreateLink: Error making link in ".concat(o," to ").concat(i,": ").concat(d),l.warn(p),new u.WebOperationError(d);case 5:return s.trys.push([5,7,,8]),[4,n(i)];case 6:return s.sent(),[3,8];case 7:throw f=s.sent(),l.warn("followOrCreateLink: Error loading or saving new linked document: ".concat(i,": ").concat(f)),f;case 8:return[2,i]}}))}))},loadOrCreateIfNotExists:n}}},9690:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.determineChatContainer=t.suggestPreferencesFile=t.differentOrigin=t.getArchiveUrl=t.uniqueNodes=t.newThing=void 0;var n=r(6022);t.newThing=function(e){return(0,n.sym)(e.uri+"#id"+Date.now())},t.uniqueNodes=function(e){var t=e.map((function(e){return e.uri})),r=new Set(t);return Array.from(r).map((function(e){return new n.NamedNode(e)}))},t.getArchiveUrl=function(e,t){var r=t.getUTCFullYear(),n=("0"+(t.getUTCMonth()+1)).slice(-2),i=("0"+t.getUTCDate()).slice(-2),o=e.split("/"),a=o[o.length-1];return new URL("./archive/".concat(r,"/").concat(n,"/").concat(i,"/").concat(a),e).toString()},t.differentOrigin=function(e){return!e||"".concat(window.location.origin,"/")!==new URL(e.value).origin},t.suggestPreferencesFile=function(e){var t=e.uri.replace("/profile/","/").replace("/public/","/").split("/").slice(0,-1).join("/")+"/Settings/Preferences.ttl";return(0,n.sym)(t)},t.determineChatContainer=function(e,t){var r=new URL("IndividualChats/".concat(new URL(e.value).host,"/"),t.value).toString();return new n.NamedNode(r)}},3180:e=>{const t={acl:"http://www.w3.org/ns/auth/acl#",arg:"http://www.w3.org/ns/pim/arg#",as:"https://www.w3.org/ns/activitystreams#",cal:"http://www.w3.org/2002/12/cal/ical#",cert:"http://www.w3.org/ns/auth/cert#",contact:"http://www.w3.org/2000/10/swap/pim/contact#",dc:"http://purl.org/dc/elements/1.1/",dct:"http://purl.org/dc/terms/",doap:"http://usefulinc.com/ns/doap#",foaf:"http://xmlns.com/foaf/0.1/",geo:"http://www.w3.org/2003/01/geo/wgs84_pos#",gpx:"http://www.w3.org/ns/pim/gpx#",http:"http://www.w3.org/2007/ont/http#",httph:"http://www.w3.org/2007/ont/httph#",icalTZ:"http://www.w3.org/2002/12/cal/icaltzd#",ldp:"http://www.w3.org/ns/ldp#",link:"http://www.w3.org/2007/ont/link#",log:"http://www.w3.org/2000/10/swap/log#",meeting:"http://www.w3.org/ns/pim/meeting#",mo:"http://purl.org/ontology/mo/",org:"http://www.w3.org/ns/org#",owl:"http://www.w3.org/2002/07/owl#",pad:"http://www.w3.org/ns/pim/pad#",patch:"http://www.w3.org/ns/pim/patch#",prov:"http://www.w3.org/ns/prov#",qu:"http://www.w3.org/2000/10/swap/pim/qif#",trip:"http://www.w3.org/ns/pim/trip#",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",rss:"http://purl.org/rss/1.0/",sched:"http://www.w3.org/ns/pim/schedule#",schema:"http://schema.org/",sioc:"http://rdfs.org/sioc/ns#",solid:"http://www.w3.org/ns/solid/terms#",space:"http://www.w3.org/ns/pim/space#",stat:"http://www.w3.org/ns/posix/stat#",tab:"http://www.w3.org/2007/ont/link#",tabont:"http://www.w3.org/2007/ont/link#",ui:"http://www.w3.org/ns/ui#",vcard:"http://www.w3.org/2006/vcard/ns#",wf:"http://www.w3.org/2005/01/wf/flow#",xsd:"http://www.w3.org/2001/XMLSchema#",cco:"http://www.ontologyrepository.com/CommonCoreOntologies/",skos:"http://www.w3.org/2004/02/skos/core#",bookmark:"http://www.w3.org/2002/01/bookmark#",vann:"http://purl.org/vocab/vann/"};e.exports=function(e={namedNode:e=>e}){const r={};for(const n in t){const i=t[n];r[n]=function(t=""){return e.namedNode(i+t)}}return r}},2511:function(e,t,r){var n;e=r.nmd(e),function(i){t&&t.nodeType,e&&e.nodeType;var o="object"==typeof r.g&&r.g;o.global!==o&&o.window!==o&&o.self;var a,s=2147483647,c=36,u=/^xn--/,l=/[^\x20-\x7E]/,d=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,h=String.fromCharCode;function m(e){throw RangeError(p[e])}function g(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function v(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+g((e=e.replace(d,".")).split("."),t).join(".")}function y(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function b(e){return g(e,(function(e){var t="";return e>65535&&(t+=h((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+h(e)})).join("")}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function x(e,t,r){var n=0;for(e=r?f(e/700):e>>1,e+=f(e/t);e>455;n+=c)e=f(e/35);return f(n+36*e/(e+38))}function _(e){var t,r,n,i,o,a,u,l,d,p,h,g=[],v=e.length,y=0,w=128,_=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&m("not-basic"),g.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<v;){for(o=y,a=1,u=c;i>=v&&m("invalid-input"),((l=(h=e.charCodeAt(i++))-48<10?h-22:h-65<26?h-65:h-97<26?h-97:c)>=c||l>f((s-y)/a))&&m("overflow"),y+=l*a,!(l<(d=u<=_?1:u>=_+26?26:u-_));u+=c)a>f(s/(p=c-d))&&m("overflow"),a*=p;_=x(y-o,t=g.length+1,0==o),f(y/t)>s-w&&m("overflow"),w+=f(y/t),y%=t,g.splice(y++,0,w)}return b(g)}function E(e){var t,r,n,i,o,a,u,l,d,p,g,v,b,_,E,k=[];for(v=(e=y(e)).length,t=128,r=0,o=72,a=0;a<v;++a)(g=e[a])<128&&k.push(h(g));for(n=i=k.length,i&&k.push("-");n<v;){for(u=s,a=0;a<v;++a)(g=e[a])>=t&&g<u&&(u=g);for(u-t>f((s-r)/(b=n+1))&&m("overflow"),r+=(u-t)*b,t=u,a=0;a<v;++a)if((g=e[a])<t&&++r>s&&m("overflow"),g==t){for(l=r,d=c;!(l<(p=d<=o?1:d>=o+26?26:d-o));d+=c)E=l-p,_=c-p,k.push(h(w(p+E%_,0))),l=f(E/_);k.push(h(w(l,0))),o=x(r,b,n==i),r=0,++n}++r,++t}return k.join("")}a={version:"1.3.2",ucs2:{decode:y,encode:b},decode:_,encode:E,toASCII:function(e){return v(e,(function(e){return l.test(e)?"xn--"+E(e):e}))},toUnicode:function(e){return v(e,(function(e){return u.test(e)?_(e.slice(4).toLowerCase()):e}))}},void 0===(n=function(){return a}.call(t,r,t,e))||(e.exports=n)}()},8575:(e,t,r)=>{"use strict";var n=r(2511),i=r(2502);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(u),d=["%","/","?",";","#"].concat(l),p=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=r(7673);o.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),s=-1!==o&&o<e.indexOf("#")?"?":"#",u=e.split(s);u[0]=u[0].replace(/\\/g,"/");var b=e=u.join(s);if(b=b.trim(),!r&&1===e.split("#").length){var w=c.exec(b);if(w)return this.path=b,this.href=b,this.pathname=w[1],w[2]?(this.search=w[2],this.query=t?y.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var x=a.exec(b);if(x){var _=(x=x[0]).toLowerCase();this.protocol=_,b=b.substr(x.length)}if(r||x||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var E="//"===b.substr(0,2);!E||x&&g[x]||(b=b.substr(2),this.slashes=!0)}if(!g[x]&&(E||x&&!v[x])){for(var k,S,A=-1,C=0;C<p.length;C++)-1!==(T=b.indexOf(p[C]))&&(-1===A||T<A)&&(A=T);for(-1!==(S=-1===A?b.lastIndexOf("@"):b.lastIndexOf("@",A))&&(k=b.slice(0,S),b=b.slice(S+1),this.auth=decodeURIComponent(k)),A=-1,C=0;C<d.length;C++){var T;-1!==(T=b.indexOf(d[C]))&&(-1===A||T<A)&&(A=T)}-1===A&&(A=b.length),this.host=b.slice(0,A),b=b.slice(A),this.parseHost(),this.hostname=this.hostname||"";var O="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!O)for(var P=this.hostname.split(/\./),F=(C=0,P.length);C<F;C++){var I=P[C];if(I&&!I.match(f)){for(var N="",j=0,R=I.length;j<R;j++)I.charCodeAt(j)>127?N+="x":N+=I[j];if(!N.match(f)){var L=P.slice(0,C),D=P.slice(C+1),M=I.match(h);M&&(L.push(M[1]),D.unshift(M[2])),D.length&&(b="/"+D.join(".")+b),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),O||(this.hostname=n.toASCII(this.hostname));var U=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+U,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[_])for(C=0,F=l.length;C<F;C++){var H=l[C];if(-1!==b.indexOf(H)){var q=encodeURIComponent(H);q===H&&(q=escape(H)),b=b.split(H).join(q)}}var K=b.indexOf("#");-1!==K&&(this.hash=b.substr(K),b=b.slice(0,K));var W=b.indexOf("?");if(-1!==W?(this.search=b.substr(W),this.query=b.substr(W+1),t&&(this.query=y.parse(this.query)),b=b.slice(0,W)):t&&(this.search="",this.query={}),b&&(this.pathname=b),v[_]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){U=this.pathname||"";var V=this.search||"";this.path=U+V}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,a="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(a=y.stringify(this.query));var s=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||v[t])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+o+(r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+n},o.prototype.resolve=function(e){return this.resolveObject(function(e,t,r){if(e&&i.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if(i.isString(e)){var t=new o;t.parse(e,!1,!0),e=t}for(var r=new o,n=Object.keys(this),a=0;a<n.length;a++){var s=n[a];r[s]=this[s]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var c=Object.keys(e),u=0;u<c.length;u++){var l=c[u];"protocol"!==l&&(r[l]=e[l])}return v[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!v[e.protocol]){for(var d=Object.keys(e),p=0;p<d.length;p++){var f=d[p];r[f]=e[f]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||g[e.protocol])r.pathname=e.pathname;else{for(var h=(e.pathname||"").split("/");h.length&&!(e.host=h.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==h[0]&&h.unshift(""),h.length<2&&h.unshift(""),r.pathname=h.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var m=r.pathname||"",y=r.search||"";r.path=m+y}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var b=r.pathname&&"/"===r.pathname.charAt(0),w=e.host||e.pathname&&"/"===e.pathname.charAt(0),x=w||b||r.host&&e.pathname,_=x,E=r.pathname&&r.pathname.split("/")||[],k=(h=e.pathname&&e.pathname.split("/")||[],r.protocol&&!v[r.protocol]);if(k&&(r.hostname="",r.port=null,r.host&&(""===E[0]?E[0]=r.host:E.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===h[0]?h[0]=e.host:h.unshift(e.host)),e.host=null),x=x&&(""===h[0]||""===E[0])),w)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,E=h;else if(h.length)E||(E=[]),E.pop(),E=E.concat(h),r.search=e.search,r.query=e.query;else if(!i.isNullOrUndefined(e.search))return k&&(r.hostname=r.host=E.shift(),(O=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=O.shift(),r.host=r.hostname=O.shift())),r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!E.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var S=E.slice(-1)[0],A=(r.host||e.host||E.length>1)&&("."===S||".."===S)||""===S,C=0,T=E.length;T>=0;T--)"."===(S=E[T])?E.splice(T,1):".."===S?(E.splice(T,1),C++):C&&(E.splice(T,1),C--);if(!x&&!_)for(;C--;C)E.unshift("..");!x||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),A&&"/"!==E.join("/").substr(-1)&&E.push("");var O,P=""===E[0]||E[0]&&"/"===E[0].charAt(0);return k&&(r.hostname=r.host=P?"":E.length?E.shift():"",(O=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=O.shift(),r.host=r.hostname=O.shift())),(x=x||r.host&&E.length)&&!P&&E.unshift(""),E.length?r.pathname=E.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},2502:e=>{"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},1614:(e,t,r)=>{"use strict";var n;r.r(t),r.d(t,{NIL:()=>P,parse:()=>g,stringify:()=>l,v1:()=>m,v3:()=>S,v4:()=>A,v5:()=>O,validate:()=>s,version:()=>F});var i=new Uint8Array(16);function o(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)}const a=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,s=function(e){return"string"==typeof e&&a.test(e)};for(var c=[],u=0;u<256;++u)c.push((u+256).toString(16).substr(1));const l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(c[e[t+0]]+c[e[t+1]]+c[e[t+2]]+c[e[t+3]]+"-"+c[e[t+4]]+c[e[t+5]]+"-"+c[e[t+6]]+c[e[t+7]]+"-"+c[e[t+8]]+c[e[t+9]]+"-"+c[e[t+10]]+c[e[t+11]]+c[e[t+12]]+c[e[t+13]]+c[e[t+14]]+c[e[t+15]]).toLowerCase();if(!s(r))throw TypeError("Stringified UUID is invalid");return r};var d,p,f=0,h=0;const m=function(e,t,r){var n=t&&r||0,i=t||new Array(16),a=(e=e||{}).node||d,s=void 0!==e.clockseq?e.clockseq:p;if(null==a||null==s){var c=e.random||(e.rng||o)();null==a&&(a=d=[1|c[0],c[1],c[2],c[3],c[4],c[5]]),null==s&&(s=p=16383&(c[6]<<8|c[7]))}var u=void 0!==e.msecs?e.msecs:Date.now(),m=void 0!==e.nsecs?e.nsecs:h+1,g=u-f+(m-h)/1e4;if(g<0&&void 0===e.clockseq&&(s=s+1&16383),(g<0||u>f)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");f=u,h=m,p=s;var v=(1e4*(268435455&(u+=122192928e5))+m)%4294967296;i[n++]=v>>>24&255,i[n++]=v>>>16&255,i[n++]=v>>>8&255,i[n++]=255&v;var y=u/4294967296*1e4&268435455;i[n++]=y>>>8&255,i[n++]=255&y,i[n++]=y>>>24&15|16,i[n++]=y>>>16&255,i[n++]=s>>>8|128,i[n++]=255&s;for(var b=0;b<6;++b)i[n+b]=a[b];return t||l(i)},g=function(e){if(!s(e))throw TypeError("Invalid UUID");var t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r};function v(e,t,r){function n(e,n,i,o){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=g(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var a=new Uint8Array(16+e.length);if(a.set(n),a.set(e,n.length),(a=r(a))[6]=15&a[6]|t,a[8]=63&a[8]|128,i){o=o||0;for(var s=0;s<16;++s)i[o+s]=a[s];return i}return l(a)}try{n.name=e}catch(e){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}function y(e){return 14+(e+64>>>9<<4)+1}function b(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function w(e,t,r,n,i,o){return b((a=b(b(t,e),b(n,o)))<<(s=i)|a>>>32-s,r);var a,s}function x(e,t,r,n,i,o,a){return w(t&r|~t&n,e,t,i,o,a)}function _(e,t,r,n,i,o,a){return w(t&n|r&~n,e,t,i,o,a)}function E(e,t,r,n,i,o,a){return w(t^r^n,e,t,i,o,a)}function k(e,t,r,n,i,o,a){return w(r^(t|~n),e,t,i,o,a)}const S=v("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function(e){for(var t=[],r=32*e.length,n="0123456789abcdef",i=0;i<r;i+=8){var o=e[i>>5]>>>i%32&255,a=parseInt(n.charAt(o>>>4&15)+n.charAt(15&o),16);t.push(a)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[y(t)-1]=t;for(var r=1732584193,n=-271733879,i=-1732584194,o=271733878,a=0;a<e.length;a+=16){var s=r,c=n,u=i,l=o;r=x(r,n,i,o,e[a],7,-680876936),o=x(o,r,n,i,e[a+1],12,-389564586),i=x(i,o,r,n,e[a+2],17,606105819),n=x(n,i,o,r,e[a+3],22,-1044525330),r=x(r,n,i,o,e[a+4],7,-176418897),o=x(o,r,n,i,e[a+5],12,1200080426),i=x(i,o,r,n,e[a+6],17,-1473231341),n=x(n,i,o,r,e[a+7],22,-45705983),r=x(r,n,i,o,e[a+8],7,1770035416),o=x(o,r,n,i,e[a+9],12,-1958414417),i=x(i,o,r,n,e[a+10],17,-42063),n=x(n,i,o,r,e[a+11],22,-1990404162),r=x(r,n,i,o,e[a+12],7,1804603682),o=x(o,r,n,i,e[a+13],12,-40341101),i=x(i,o,r,n,e[a+14],17,-1502002290),r=_(r,n=x(n,i,o,r,e[a+15],22,1236535329),i,o,e[a+1],5,-165796510),o=_(o,r,n,i,e[a+6],9,-1069501632),i=_(i,o,r,n,e[a+11],14,643717713),n=_(n,i,o,r,e[a],20,-373897302),r=_(r,n,i,o,e[a+5],5,-701558691),o=_(o,r,n,i,e[a+10],9,38016083),i=_(i,o,r,n,e[a+15],14,-660478335),n=_(n,i,o,r,e[a+4],20,-405537848),r=_(r,n,i,o,e[a+9],5,568446438),o=_(o,r,n,i,e[a+14],9,-1019803690),i=_(i,o,r,n,e[a+3],14,-187363961),n=_(n,i,o,r,e[a+8],20,1163531501),r=_(r,n,i,o,e[a+13],5,-1444681467),o=_(o,r,n,i,e[a+2],9,-51403784),i=_(i,o,r,n,e[a+7],14,1735328473),r=E(r,n=_(n,i,o,r,e[a+12],20,-1926607734),i,o,e[a+5],4,-378558),o=E(o,r,n,i,e[a+8],11,-2022574463),i=E(i,o,r,n,e[a+11],16,1839030562),n=E(n,i,o,r,e[a+14],23,-35309556),r=E(r,n,i,o,e[a+1],4,-1530992060),o=E(o,r,n,i,e[a+4],11,1272893353),i=E(i,o,r,n,e[a+7],16,-155497632),n=E(n,i,o,r,e[a+10],23,-1094730640),r=E(r,n,i,o,e[a+13],4,681279174),o=E(o,r,n,i,e[a],11,-358537222),i=E(i,o,r,n,e[a+3],16,-722521979),n=E(n,i,o,r,e[a+6],23,76029189),r=E(r,n,i,o,e[a+9],4,-640364487),o=E(o,r,n,i,e[a+12],11,-421815835),i=E(i,o,r,n,e[a+15],16,530742520),r=k(r,n=E(n,i,o,r,e[a+2],23,-995338651),i,o,e[a],6,-198630844),o=k(o,r,n,i,e[a+7],10,1126891415),i=k(i,o,r,n,e[a+14],15,-1416354905),n=k(n,i,o,r,e[a+5],21,-57434055),r=k(r,n,i,o,e[a+12],6,1700485571),o=k(o,r,n,i,e[a+3],10,-1894986606),i=k(i,o,r,n,e[a+10],15,-1051523),n=k(n,i,o,r,e[a+1],21,-2054922799),r=k(r,n,i,o,e[a+8],6,1873313359),o=k(o,r,n,i,e[a+15],10,-30611744),i=k(i,o,r,n,e[a+6],15,-1560198380),n=k(n,i,o,r,e[a+13],21,1309151649),r=k(r,n,i,o,e[a+4],6,-145523070),o=k(o,r,n,i,e[a+11],10,-1120210379),i=k(i,o,r,n,e[a+2],15,718787259),n=k(n,i,o,r,e[a+9],21,-343485551),r=b(r,s),n=b(n,c),i=b(i,u),o=b(o,l)}return[r,n,i,o]}(function(e){if(0===e.length)return[];for(var t=8*e.length,r=new Uint32Array(y(t)),n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))})),A=function(e,t,r){var n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return l(n)};function C(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function T(e,t){return e<<t|e>>>32-t}const O=v("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var n=unescape(encodeURIComponent(e));e=[];for(var i=0;i<n.length;++i)e.push(n.charCodeAt(i))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var o=e.length/4+2,a=Math.ceil(o/16),s=new Array(a),c=0;c<a;++c){for(var u=new Uint32Array(16),l=0;l<16;++l)u[l]=e[64*c+4*l]<<24|e[64*c+4*l+1]<<16|e[64*c+4*l+2]<<8|e[64*c+4*l+3];s[c]=u}s[a-1][14]=8*(e.length-1)/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=8*(e.length-1)&4294967295;for(var d=0;d<a;++d){for(var p=new Uint32Array(80),f=0;f<16;++f)p[f]=s[d][f];for(var h=16;h<80;++h)p[h]=T(p[h-3]^p[h-8]^p[h-14]^p[h-16],1);for(var m=r[0],g=r[1],v=r[2],y=r[3],b=r[4],w=0;w<80;++w){var x=Math.floor(w/20),_=T(m,5)+C(x,g,v,y)+b+t[x]+p[w]>>>0;b=y,y=v,v=T(g,30)>>>0,g=m,m=_}r[0]=r[0]+m>>>0,r[1]=r[1]+g>>>0,r[2]=r[2]+v>>>0,r[3]=r[3]+y>>>0,r[4]=r[4]+b>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),P="00000000-0000-0000-0000-000000000000",F=function(e){if(!s(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}},9421:()=>{},3897:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},5372:e=>{e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},3405:(e,t,r)=>{var n=r(3897);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports},6115:e=>{e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},7156:e=>{function t(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(i,o){var a=e.apply(r,n);function s(e){t(a,i,o,s,c,"next",e)}function c(e){t(a,i,o,s,c,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},6690:e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},3515:(e,t,r)=>{var n=r(6015),i=r(9617);function o(t,r,a){return i()?(e.exports=o=Reflect.construct.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=o=function(e,t,r){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return r&&n(o,r.prototype),o},e.exports.__esModule=!0,e.exports.default=e.exports),o.apply(null,arguments)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},9728:(e,t,r)=>{var n=r(4062);function i(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,n(i.key),i)}}e.exports=function(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},8416:(e,t,r)=>{var n=r(4062);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},3808:e=>{function t(r){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},1655:(e,t,r)=>{var n=r(6015);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},4836:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},6035:e=>{e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")},e.exports.__esModule=!0,e.exports.default=e.exports},9617:e=>{e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.__esModule=!0,e.exports.default=e.exports},9498:e=>{e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},8872:e=>{e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],c=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports},2218:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},2281:e=>{e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},4993:(e,t,r)=>{var n=r(8698).default,i=r(6115);e.exports=function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return i(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7061:(e,t,r)=>{var n=r(8698).default;function i(){"use strict";e.exports=i=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function d(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var i=t&&t.prototype instanceof m?t:m,o=Object.create(i.prototype),s=new T(n||[]);return a(o,"_invoke",{value:k(e,r,s)}),o}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var h={};function m(){}function g(){}function v(){}var y={};d(y,c,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(O([])));w&&w!==r&&o.call(w,c)&&(y=w);var x=v.prototype=m.prototype=Object.create(y);function _(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(i,a,s,c){var u=f(e[i],e,a);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==n(d)&&o.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):t.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}})}function k(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return{value:void 0,done:!0}}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=f(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function S(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=f(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function O(e){if(e){var t=e[c];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(o.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:P}}function P(){return{value:void 0,done:!0}}return g.prototype=v,a(x,"constructor",{value:v,configurable:!0}),a(v,"constructor",{value:g,configurable:!0}),g.displayName=d(v,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,d(e,l,"GeneratorFunction")),e.prototype=Object.create(x),e},t.awrap=function(e){return{__await:e}},_(E.prototype),d(E.prototype,u,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new E(p(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},_(x),d(x,l,"Generator"),d(x,c,(function(){return this})),d(x,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=O,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},6015:e=>{function t(r,n){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},7424:(e,t,r)=>{var n=r(5372),i=r(8872),o=r(6116),a=r(2218);e.exports=function(e,t){return n(e)||i(e,t)||o(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},9400:e=>{e.exports=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))},e.exports.__esModule=!0,e.exports.default=e.exports},861:(e,t,r)=>{var n=r(3405),i=r(9498),o=r(6116),a=r(2281);e.exports=function(e){return n(e)||i(e)||o(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},7946:(e,t,r)=>{var n=r(8698).default;e.exports=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},4062:(e,t,r)=>{var n=r(8698).default,i=r(7946);e.exports=function(e){var t=i(e,"string");return"symbol"===n(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},8698:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},6116:(e,t,r)=>{var n=r(3897);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},3496:(e,t,r)=>{var n=r(3808),i=r(6015),o=r(6035),a=r(3515);function s(t){var r="function"==typeof Map?new Map:void 0;return e.exports=s=function(e){if(null===e||!o(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return a(e,arguments,n(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,s(t)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports},4687:(e,t,r)=>{var n=r(7061)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},7326:(e,t,r)=>{"use strict";function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r.d(t,{Z:()=>n})},5671:(e,t,r)=>{"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.d(t,{Z:()=>n})},3144:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(9142);function i(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(0,n.Z)(i.key),i)}}function o(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}},4942:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(9142);function i(e,t,r){return(t=(0,n.Z)(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},1120:(e,t,r)=>{"use strict";function n(e){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},n(e)}r.d(t,{Z:()=>n})},9340:(e,t,r)=>{"use strict";function n(e,t){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},n(e,t)}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)}r.d(t,{Z:()=>i})},2963:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(1002),i=r(7326);function o(e,t){if(t&&("object"===(0,n.Z)(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return(0,i.Z)(e)}},9142:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(1002);function i(e){var t=function(e,t){if("object"!==(0,n.Z)(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!==(0,n.Z)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===(0,n.Z)(t)?t:String(t)}},1002:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}r.d(t,{Z:()=>n})},1548:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CompactEncrypt:()=>Qe,CompactSign:()=>tt,EmbeddedJWK:()=>lt,EncryptJWT:()=>at,FlattenedEncrypt:()=>Me,FlattenedSign:()=>et,GeneralEncrypt:()=>Be,GeneralSign:()=>nt,SignJWT:()=>ot,UnsecuredJWT:()=>yt,base64url:()=>i,calculateJwkThumbprint:()=>ct,calculateJwkThumbprintUri:()=>ut,compactDecrypt:()=>Fe,compactVerify:()=>We,createLocalJWKSet:()=>mt,createRemoteJWKSet:()=>vt,decodeJwt:()=>_t,decodeProtectedHeader:()=>xt,errors:()=>n,exportJWK:()=>Re,exportPKCS8:()=>je,exportSPKI:()=>Ne,flattenedDecrypt:()=>Pe,flattenedVerify:()=>Ke,generalDecrypt:()=>Ie,generalVerify:()=>Ve,generateKeyPair:()=>kt,generateSecret:()=>St,importJWK:()=>Se,importPKCS8:()=>ke,importSPKI:()=>_e,importX509:()=>Ee,jwtDecrypt:()=>Ye,jwtVerify:()=>Xe});var n={};r.r(n),r.d(n,{JOSEAlgNotAllowed:()=>E,JOSEError:()=>w,JOSENotSupported:()=>k,JWEDecryptionFailed:()=>S,JWEInvalid:()=>A,JWKInvalid:()=>O,JWKSInvalid:()=>P,JWKSMultipleMatchingKeys:()=>I,JWKSNoMatchingKey:()=>F,JWKSTimeout:()=>N,JWSInvalid:()=>C,JWSSignatureVerificationFailed:()=>j,JWTClaimValidationFailed:()=>x,JWTExpired:()=>_,JWTInvalid:()=>T});var i={};r.r(i),r.d(i,{decode:()=>wt,encode:()=>bt});const o=crypto,a=e=>e instanceof CryptoKey,s=async(e,t)=>{const r=`SHA-${e.slice(-3)}`;return new Uint8Array(await o.subtle.digest(r,t))},c=new TextEncoder,u=new TextDecoder,l=2**32;function d(...e){const t=e.reduce(((e,{length:t})=>e+t),0),r=new Uint8Array(t);let n=0;return e.forEach((e=>{r.set(e,n),n+=e.length})),r}function p(e,t,r){if(t<0||t>=l)throw new RangeError(`value must be >= 0 and <= 4294967295. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function f(e){const t=Math.floor(e/l),r=e%l,n=new Uint8Array(8);return p(n,t,0),p(n,r,4),n}function h(e){const t=new Uint8Array(4);return p(t,e),t}function m(e){return d(h(e.length),e)}const g=e=>{let t=e;"string"==typeof t&&(t=c.encode(t));const r=[];for(let e=0;e<t.length;e+=32768)r.push(String.fromCharCode.apply(null,t.subarray(e,e+32768)));return btoa(r.join(""))},v=e=>g(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),y=e=>{const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r},b=e=>{let t=e;t instanceof Uint8Array&&(t=u.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return y(t)}catch(e){throw new TypeError("The input to be decoded is not correctly encoded.")}};class w extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var t;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,this.constructor)}}class x extends w{static get code(){return"ERR_JWT_CLAIM_VALIDATION_FAILED"}constructor(e,t="unspecified",r="unspecified"){super(e),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=t,this.reason=r}}class _ extends w{static get code(){return"ERR_JWT_EXPIRED"}constructor(e,t="unspecified",r="unspecified"){super(e),this.code="ERR_JWT_EXPIRED",this.claim=t,this.reason=r}}class E extends w{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}static get code(){return"ERR_JOSE_ALG_NOT_ALLOWED"}}class k extends w{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}static get code(){return"ERR_JOSE_NOT_SUPPORTED"}}class S extends w{constructor(){super(...arguments),this.code="ERR_JWE_DECRYPTION_FAILED",this.message="decryption operation failed"}static get code(){return"ERR_JWE_DECRYPTION_FAILED"}}class A extends w{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}static get code(){return"ERR_JWE_INVALID"}}class C extends w{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}static get code(){return"ERR_JWS_INVALID"}}class T extends w{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}class O extends w{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}static get code(){return"ERR_JWK_INVALID"}}class P extends w{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}static get code(){return"ERR_JWKS_INVALID"}}class F extends w{constructor(){super(...arguments),this.code="ERR_JWKS_NO_MATCHING_KEY",this.message="no applicable key found in the JSON Web Key Set"}static get code(){return"ERR_JWKS_NO_MATCHING_KEY"}}class I extends w{constructor(){super(...arguments),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS",this.message="multiple matching keys found in the JSON Web Key Set"}static get code(){return"ERR_JWKS_MULTIPLE_MATCHING_KEYS"}}Symbol.asyncIterator;class N extends w{constructor(){super(...arguments),this.code="ERR_JWKS_TIMEOUT",this.message="request timed out"}static get code(){return"ERR_JWKS_TIMEOUT"}}class j extends w{constructor(){super(...arguments),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED",this.message="signature verification failed"}static get code(){return"ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}const R=o.getRandomValues.bind(o);function L(e){switch(e){case"A128GCM":case"A128GCMKW":case"A192GCM":case"A192GCMKW":case"A256GCM":case"A256GCMKW":return 96;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return 128;default:throw new k(`Unsupported JWE Algorithm: ${e}`)}}const D=e=>R(new Uint8Array(L(e)>>3)),M=(e,t)=>{if(t.length<<3!==L(e))throw new A("Invalid Initialization Vector length")},U=(e,t)=>{const r=e.byteLength<<3;if(r!==t)throw new A(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)};function B(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function H(e,t){return e.name===t}function q(e){return parseInt(e.name.slice(4),10)}function K(e,t){if(t.length&&!t.some((t=>e.usages.includes(t)))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw new TypeError(e)}}function W(e,t,...r){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!H(e.algorithm,"AES-GCM"))throw B("AES-GCM");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw B(r,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!H(e.algorithm,"AES-KW"))throw B("AES-KW");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw B(r,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw B("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!H(e.algorithm,"PBKDF2"))throw B("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!H(e.algorithm,"RSA-OAEP"))throw B("RSA-OAEP");const r=parseInt(t.slice(9),10)||1;if(q(e.algorithm.hash)!==r)throw B(`SHA-${r}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}K(e,r)}function V(e,t,...r){if(r.length>2){const t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}const z=(e,...t)=>V("Key must be ",e,...t);function J(e,t,...r){return V(`Key for the ${e} algorithm must be `,t,...r)}const Z=e=>a(e),$=["CryptoKey"],G=async(e,t,r,n,i,s)=>{if(!(a(t)||t instanceof Uint8Array))throw new TypeError(z(t,...$,"Uint8Array"));switch(M(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&U(t,parseInt(e.slice(-3),10)),async function(e,t,r,n,i,a){if(!(t instanceof Uint8Array))throw new TypeError(z(t,"Uint8Array"));const s=parseInt(e.slice(1,4),10),c=await o.subtle.importKey("raw",t.subarray(s>>3),"AES-CBC",!1,["decrypt"]),u=await o.subtle.importKey("raw",t.subarray(0,s>>3),{hash:"SHA-"+(s<<1),name:"HMAC"},!1,["sign"]),l=d(a,n,r,f(a.length<<3)),p=new Uint8Array((await o.subtle.sign("HMAC",u,l)).slice(0,s>>3));let h,m;try{h=((e,t)=>{if(!(e instanceof Uint8Array))throw new TypeError("First argument must be a buffer");if(!(t instanceof Uint8Array))throw new TypeError("Second argument must be a buffer");if(e.length!==t.length)throw new TypeError("Input buffers must have the same length");const r=e.length;let n=0,i=-1;for(;++i<r;)n|=e[i]^t[i];return 0===n})(i,p)}catch(e){}if(!h)throw new S;try{m=new Uint8Array(await o.subtle.decrypt({iv:n,name:"AES-CBC"},c,r))}catch(e){}if(!m)throw new S;return m}(e,t,r,n,i,s);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&U(t,parseInt(e.slice(1,4),10)),async function(e,t,r,n,i,a){let s;t instanceof Uint8Array?s=await o.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):(W(t,e,"decrypt"),s=t);try{return new Uint8Array(await o.subtle.decrypt({additionalData:a,iv:n,name:"AES-GCM",tagLength:128},s,d(r,i)))}catch(e){throw new S}}(e,t,r,n,i,s);default:throw new k("Unsupported JWE Content Encryption Algorithm")}},X=async()=>{throw new k('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `inflateRaw` decrypt option to provide Inflate Raw implementation.')},Y=async()=>{throw new k('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `deflateRaw` encrypt option to provide Deflate Raw implementation.')},Q=(...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let r;for(const e of t){const t=Object.keys(e);if(r&&0!==r.size)for(const e of t){if(r.has(e))return!1;r.add(e)}else r=new Set(t)}return!0};function ee(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let r=e;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}const te=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]];function re(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${t}`)}function ne(e,t,r){if(a(e))return W(e,t,r),e;if(e instanceof Uint8Array)return o.subtle.importKey("raw",e,"AES-KW",!0,[r]);throw new TypeError(z(e,...$,"Uint8Array"))}const ie=async(e,t,r)=>{const n=await ne(t,e,"wrapKey");re(n,e);const i=await o.subtle.importKey("raw",r,...te);return new Uint8Array(await o.subtle.wrapKey("raw",i,n,"AES-KW"))},oe=async(e,t,r)=>{const n=await ne(t,e,"unwrapKey");re(n,e);const i=await o.subtle.unwrapKey("raw",r,n,"AES-KW",...te);return new Uint8Array(await o.subtle.exportKey("raw",i))};async function ae(e,t,r,n,i=new Uint8Array(0),u=new Uint8Array(0)){if(!a(e))throw new TypeError(z(e,...$));if(W(e,"ECDH"),!a(t))throw new TypeError(z(t,...$));W(t,"ECDH","deriveBits");const l=d(m(c.encode(r)),m(i),m(u),h(n));let p;return p="X25519"===e.algorithm.name?256:"X448"===e.algorithm.name?448:Math.ceil(parseInt(e.algorithm.namedCurve.substr(-3),10)/8)<<3,async function(e,t,r){const n=Math.ceil((t>>3)/32),i=new Uint8Array(32*n);for(let t=0;t<n;t++){const n=new Uint8Array(4+e.length+r.length);n.set(h(t+1)),n.set(e,4),n.set(r,4+e.length),i.set(await s("sha256",n),32*t)}return i.slice(0,t>>3)}(new Uint8Array(await o.subtle.deriveBits({name:e.algorithm.name,public:e},t,p)),n,l)}function se(e){if(!a(e))throw new TypeError(z(e,...$));return["P-256","P-384","P-521"].includes(e.algorithm.namedCurve)||"X25519"===e.algorithm.name||"X448"===e.algorithm.name}async function ce(e,t,r,n){!function(e){if(!(e instanceof Uint8Array)||e.length<8)throw new A("PBES2 Salt Input must be 8 or more octets")}(e);const i=function(e,t){return d(c.encode(e),new Uint8Array([0]),t)}(t,e),s=parseInt(t.slice(13,16),10),u={hash:`SHA-${t.slice(8,11)}`,iterations:r,name:"PBKDF2",salt:i},l={length:s,name:"AES-KW"},p=await function(e,t){if(e instanceof Uint8Array)return o.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]);if(a(e))return W(e,t,"deriveBits","deriveKey"),e;throw new TypeError(z(e,...$,"Uint8Array"))}(n,t);if(p.usages.includes("deriveBits"))return new Uint8Array(await o.subtle.deriveBits(u,p,s));if(p.usages.includes("deriveKey"))return o.subtle.deriveKey(u,p,l,!1,["wrapKey","unwrapKey"]);throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}function ue(e){switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new k(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}const le=(e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}};function de(e){switch(e){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new k(`Unsupported JWE Algorithm: ${e}`)}}const pe=e=>R(new Uint8Array(de(e)>>3)),fe=(e,t)=>`-----BEGIN ${t}-----\n${(e.match(/.{1,64}/g)||[]).join("\n")}\n-----END ${t}-----`,he=async(e,t,r)=>{if(!a(r))throw new TypeError(z(r,...$));if(!r.extractable)throw new TypeError("CryptoKey is not extractable");if(r.type!==e)throw new TypeError(`key is not a ${e} key`);return fe(g(new Uint8Array(await o.subtle.exportKey(t,r))),`${e.toUpperCase()} KEY`)},me=(e,t,r=0)=>{0===r&&(t.unshift(t.length),t.unshift(6));let n=e.indexOf(t[0],r);if(-1===n)return!1;const i=e.subarray(n,n+t.length);return i.length===t.length&&(i.every(((e,r)=>e===t[r]))||me(e,t,n+1))},ge=e=>{switch(!0){case me(e,[42,134,72,206,61,3,1,7]):return"P-256";case me(e,[43,129,4,0,34]):return"P-384";case me(e,[43,129,4,0,35]):return"P-521";case me(e,[43,101,110]):return"X25519";case me(e,[43,101,111]):return"X448";case me(e,[43,101,112]):return"Ed25519";case me(e,[43,101,113]):return"Ed448";default:throw new k("Invalid or unsupported EC Key Curve or OKP Key Sub Type")}},ve=async(e,t,r,n,i)=>{var a;let s,c;const u=new Uint8Array(atob(r.replace(e,"")).split("").map((e=>e.charCodeAt(0)))),l="spki"===t;switch(n){case"PS256":case"PS384":case"PS512":s={name:"RSA-PSS",hash:`SHA-${n.slice(-3)}`},c=l?["verify"]:["sign"];break;case"RS256":case"RS384":case"RS512":s={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${n.slice(-3)}`},c=l?["verify"]:["sign"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s={name:"RSA-OAEP",hash:`SHA-${parseInt(n.slice(-3),10)||1}`},c=l?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":s={name:"ECDSA",namedCurve:"P-256"},c=l?["verify"]:["sign"];break;case"ES384":s={name:"ECDSA",namedCurve:"P-384"},c=l?["verify"]:["sign"];break;case"ES512":s={name:"ECDSA",namedCurve:"P-521"},c=l?["verify"]:["sign"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{const e=ge(u);s=e.startsWith("P-")?{name:"ECDH",namedCurve:e}:{name:e},c=l?[]:["deriveBits"];break}case"EdDSA":s={name:ge(u)},c=l?["verify"]:["sign"];break;default:throw new k('Invalid or unsupported "alg" (Algorithm) value')}return o.subtle.importKey(t,u,s,null!==(a=null==i?void 0:i.extractable)&&void 0!==a&&a,c)},ye=(e,t,r)=>ve(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,"spki",e,t,r);function be(e){let t=[],r=0;for(;r<e.length;){let n=we(e.subarray(r));t.push(n),r+=n.byteLength}return t}function we(e){let t=0,r=31&e[0];if(t++,31===r){for(r=0;e[t]>=128;)r=128*r+e[t]-128,t++;r=128*r+e[t]-128,t++}let n=0;if(e[t]<128)n=e[t],t++;else{if(128===n){for(n=0;0!==e[t+n]||0!==e[t+n+1];){if(n>e.byteLength)throw new TypeError("invalid indefinite form length");n++}const r=t+n+2;return{byteLength:r,contents:e.subarray(t,t+n),raw:e.subarray(0,r)}}{let r=127&e[t];t++,n=0;for(let i=0;i<r;i++)n=256*n+e[t],t++}}const i=t+n;return{byteLength:i,contents:e.subarray(t,i),raw:e.subarray(0,i)}}const xe=async e=>{var t,r;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:n,keyUsages:i}=function(e){let t,r;switch(e.kty){case"oct":switch(e.alg){case"HS256":case"HS384":case"HS512":t={name:"HMAC",hash:`SHA-${e.alg.slice(-3)}`},r=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new k(`${e.alg} keys cannot be imported as CryptoKey instances`);case"A128GCM":case"A192GCM":case"A256GCM":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":t={name:"AES-GCM"},r=["encrypt","decrypt"];break;case"A128KW":case"A192KW":case"A256KW":t={name:"AES-KW"},r=["wrapKey","unwrapKey"];break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":t={name:"PBKDF2"},r=["deriveBits"];break;default:throw new k('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new k('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new k('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"EdDSA":t={name:e.crv},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new k('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new k('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),a=[n,null!==(t=e.ext)&&void 0!==t&&t,null!==(r=e.key_ops)&&void 0!==r?r:i];if("PBKDF2"===n.name)return o.subtle.importKey("raw",b(e.k),...a);const s={...e};return delete s.alg,delete s.use,o.subtle.importKey("jwk",s,...a)};async function _e(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PUBLIC KEY-----"))throw new TypeError('"spki" must be SPKI formatted string');return ye(e,t,r)}async function Ee(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN CERTIFICATE-----"))throw new TypeError('"x509" must be X.509 formatted string');return((e,t,r)=>{let n;try{n=function(e){const t=e.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g,""),r=y(t);return fe(function(e){const t=be(be(we(e).contents)[0].contents);return g(t[160===t[0].raw[0]?6:5].raw)}(r),"PUBLIC KEY")}(e)}catch(e){throw new TypeError("failed to parse the X.509 certificate",{cause:e})}return ye(n,t,r)})(e,t,r)}async function ke(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return((e,t,r)=>ve(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,"pkcs8",e,t,r))(e,t,r)}async function Se(e,t,r){var n;if(!ee(e))throw new TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return null!=r||(r=!0!==e.ext),r?xe({...e,alg:t,ext:null!==(n=e.ext)&&void 0!==n&&n}):b(e.k);case"RSA":if(void 0!==e.oth)throw new k('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return xe({...e,alg:t});default:throw new k('Unsupported "kty" (Key Type) Parameter value')}}const Ae=(e,t,r)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?((e,t)=>{if(!(t instanceof Uint8Array)){if(!Z(t))throw new TypeError(J(e,t,...$,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${$.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,r)=>{if(!Z(t))throw new TypeError(J(e,t,...$));if("secret"===t.type)throw new TypeError(`${$.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${$.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${$.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${$.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${$.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,r)},Ce=async(e,t,r,n,i)=>{if(!(a(r)||r instanceof Uint8Array))throw new TypeError(z(r,...$,"Uint8Array"));switch(M(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r instanceof Uint8Array&&U(r,parseInt(e.slice(-3),10)),async function(e,t,r,n,i){if(!(r instanceof Uint8Array))throw new TypeError(z(r,"Uint8Array"));const a=parseInt(e.slice(1,4),10),s=await o.subtle.importKey("raw",r.subarray(a>>3),"AES-CBC",!1,["encrypt"]),c=await o.subtle.importKey("raw",r.subarray(0,a>>3),{hash:"SHA-"+(a<<1),name:"HMAC"},!1,["sign"]),u=new Uint8Array(await o.subtle.encrypt({iv:n,name:"AES-CBC"},s,t)),l=d(i,n,u,f(i.length<<3));return{ciphertext:u,tag:new Uint8Array((await o.subtle.sign("HMAC",c,l)).slice(0,a>>3))}}(e,t,r,n,i);case"A128GCM":case"A192GCM":case"A256GCM":return r instanceof Uint8Array&&U(r,parseInt(e.slice(1,4),10)),async function(e,t,r,n,i){let a;r instanceof Uint8Array?a=await o.subtle.importKey("raw",r,"AES-GCM",!1,["encrypt"]):(W(r,e,"encrypt"),a=r);const s=new Uint8Array(await o.subtle.encrypt({additionalData:i,iv:n,name:"AES-GCM",tagLength:128},a,t)),c=s.slice(-16);return{ciphertext:s.slice(0,-16),tag:c}}(e,t,r,n,i);default:throw new k("Unsupported JWE Content Encryption Algorithm")}},Te=function(e,t,r,n,i){if(void 0!==i.crit&&void 0===n.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some((e=>"string"!=typeof e||0===e.length)))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let o;o=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t;for(const t of n.crit){if(!o.has(t))throw new k(`Extension Header Parameter "${t}" is not recognized`);if(void 0===i[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(o.get(t)&&void 0===n[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(n.crit)},Oe=(e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some((e=>"string"!=typeof e))))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};async function Pe(e,t,r){var n;if(!ee(e))throw new A("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new A("JOSE Header missing");if("string"!=typeof e.iv)throw new A("JWE Initialization Vector missing or incorrect type");if("string"!=typeof e.ciphertext)throw new A("JWE Ciphertext missing or incorrect type");if("string"!=typeof e.tag)throw new A("JWE Authentication Tag missing or incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new A("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new A("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new A("JWE AAD incorrect type");if(void 0!==e.header&&!ee(e.header))throw new A("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!ee(e.unprotected))throw new A("JWE Per-Recipient Unprotected Header incorrect type");let i;if(e.protected)try{const t=b(e.protected);i=JSON.parse(u.decode(t))}catch(e){throw new A("JWE Protected Header is invalid")}if(!Q(i,e.header,e.unprotected))throw new A("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");const s={...i,...e.header,...e.unprotected};if(Te(A,new Map,null==r?void 0:r.crit,i,s),void 0!==s.zip){if(!i||!i.zip)throw new A('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==s.zip)throw new k('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:l,enc:p}=s;if("string"!=typeof l||!l)throw new A("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof p||!p)throw new A("missing JWE Encryption Algorithm (enc) in JWE Header");const f=r&&Oe("keyManagementAlgorithms",r.keyManagementAlgorithms),h=r&&Oe("contentEncryptionAlgorithms",r.contentEncryptionAlgorithms);if(f&&!f.has(l))throw new E('"alg" (Algorithm) Header Parameter not allowed');if(h&&!h.has(p))throw new E('"enc" (Encryption Algorithm) Header Parameter not allowed');let m;void 0!==e.encrypted_key&&(m=b(e.encrypted_key));let g,v=!1;"function"==typeof t&&(t=await t(i,e),v=!0);try{g=await async function(e,t,r,n,i){switch(Ae(e,t,"decrypt"),e){case"dir":if(void 0!==r)throw new A("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==r)throw new A("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!ee(n.epk))throw new A('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!se(t))throw new k("ECDH with the provided key is not allowed or not supported by your javascript runtime");const i=await Se(n.epk,e);let o,a;if(void 0!==n.apu){if("string"!=typeof n.apu)throw new A('JOSE Header "apu" (Agreement PartyUInfo) invalid');o=b(n.apu)}if(void 0!==n.apv){if("string"!=typeof n.apv)throw new A('JOSE Header "apv" (Agreement PartyVInfo) invalid');a=b(n.apv)}const s=await ae(i,t,"ECDH-ES"===e?n.enc:e,"ECDH-ES"===e?de(n.enc):parseInt(e.slice(-5,-2),10),o,a);if("ECDH-ES"===e)return s;if(void 0===r)throw new A("JWE Encrypted Key missing");return oe(e.slice(-6),s,r)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":if(void 0===r)throw new A("JWE Encrypted Key missing");return(async(e,t,r)=>{if(!a(t))throw new TypeError(z(t,...$));if(W(t,e,"decrypt","unwrapKey"),le(e,t),t.usages.includes("decrypt"))return new Uint8Array(await o.subtle.decrypt(ue(e),t,r));if(t.usages.includes("unwrapKey")){const n=await o.subtle.unwrapKey("raw",r,t,ue(e),...te);return new Uint8Array(await o.subtle.exportKey("raw",n))}throw new TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')})(e,t,r);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{if(void 0===r)throw new A("JWE Encrypted Key missing");if("number"!=typeof n.p2c)throw new A('JOSE Header "p2c" (PBES2 Count) missing or invalid');const o=(null==i?void 0:i.maxPBES2Count)||1e4;if(n.p2c>o)throw new A('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof n.p2s)throw new A('JOSE Header "p2s" (PBES2 Salt) missing or invalid');return(async(e,t,r,n,i)=>{const o=await ce(i,e,n,t);return oe(e.slice(-6),o,r)})(e,t,r,n.p2c,b(n.p2s))}case"A128KW":case"A192KW":case"A256KW":if(void 0===r)throw new A("JWE Encrypted Key missing");return oe(e,t,r);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":if(void 0===r)throw new A("JWE Encrypted Key missing");if("string"!=typeof n.iv)throw new A('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof n.tag)throw new A('JOSE Header "tag" (Authentication Tag) missing or invalid');return async function(e,t,r,n,i){const o=e.slice(0,7);return G(o,t,r,n,i,new Uint8Array(0))}(e,t,r,b(n.iv),b(n.tag));default:throw new k('Invalid or unsupported "alg" (JWE Algorithm) header value')}}(l,t,m,s,r)}catch(e){if(e instanceof TypeError||e instanceof A||e instanceof k)throw e;g=pe(p)}const y=b(e.iv),w=b(e.tag),x=c.encode(null!==(n=e.protected)&&void 0!==n?n:"");let _;_=void 0!==e.aad?d(x,c.encode("."),c.encode(e.aad)):x;let S=await G(p,g,b(e.ciphertext),y,w,_);"DEF"===s.zip&&(S=await((null==r?void 0:r.inflateRaw)||X)(S));const C={plaintext:S};return void 0!==e.protected&&(C.protectedHeader=i),void 0!==e.aad&&(C.additionalAuthenticatedData=b(e.aad)),void 0!==e.unprotected&&(C.sharedUnprotectedHeader=e.unprotected),void 0!==e.header&&(C.unprotectedHeader=e.header),v?{...C,key:t}:C}async function Fe(e,t,r){if(e instanceof Uint8Array&&(e=u.decode(e)),"string"!=typeof e)throw new A("Compact JWE must be a string or Uint8Array");const{0:n,1:i,2:o,3:a,4:s,length:c}=e.split(".");if(5!==c)throw new A("Invalid Compact JWE");const l=await Pe({ciphertext:a,iv:o||void 0,protected:n||void 0,tag:s||void 0,encrypted_key:i||void 0},t,r),d={plaintext:l.plaintext,protectedHeader:l.protectedHeader};return"function"==typeof t?{...d,key:l.key}:d}async function Ie(e,t,r){if(!ee(e))throw new A("General JWE must be an object");if(!Array.isArray(e.recipients)||!e.recipients.every(ee))throw new A("JWE Recipients missing or incorrect type");if(!e.recipients.length)throw new A("JWE Recipients has no members");for(const n of e.recipients)try{return await Pe({aad:e.aad,ciphertext:e.ciphertext,encrypted_key:n.encrypted_key,header:n.header,iv:e.iv,protected:e.protected,tag:e.tag,unprotected:e.unprotected},t,r)}catch(e){}throw new S}async function Ne(e){return(e=>he("public","spki",e))(e)}async function je(e){return(e=>he("private","pkcs8",e))(e)}async function Re(e){return(async e=>{if(e instanceof Uint8Array)return{kty:"oct",k:v(e)};if(!a(e))throw new TypeError(z(e,...$,"Uint8Array"));if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");const{ext:t,key_ops:r,alg:n,use:i,...s}=await o.subtle.exportKey("jwk",e);return s})(e)}const Le=async function(e,t,r,n,i={}){let s,c,u;switch(Ae(e,r,"encrypt"),e){case"dir":u=r;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!se(r))throw new k("ECDH with the provided key is not allowed or not supported by your javascript runtime");const{apu:l,apv:d}=i;let{epk:p}=i;p||(p=(await async function(e){if(!a(e))throw new TypeError(z(e,...$));return o.subtle.generateKey(e.algorithm,!0,["deriveBits"])}(r)).privateKey);const{x:f,y:h,crv:m,kty:g}=await Re(p),y=await ae(r,p,"ECDH-ES"===e?t:e,"ECDH-ES"===e?de(t):parseInt(e.slice(-5,-2),10),l,d);if(c={epk:{x:f,crv:m,kty:g}},"EC"===g&&(c.epk.y=h),l&&(c.apu=v(l)),d&&(c.apv=v(d)),"ECDH-ES"===e){u=y;break}u=n||pe(t);const b=e.slice(-6);s=await ie(b,y,u);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":u=n||pe(t),s=await(async(e,t,r)=>{if(!a(t))throw new TypeError(z(t,...$));if(W(t,e,"encrypt","wrapKey"),le(e,t),t.usages.includes("encrypt"))return new Uint8Array(await o.subtle.encrypt(ue(e),t,r));if(t.usages.includes("wrapKey")){const n=await o.subtle.importKey("raw",r,...te);return new Uint8Array(await o.subtle.wrapKey("raw",n,t,ue(e)))}throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')})(e,r,u);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{u=n||pe(t);const{p2c:o,p2s:a}=i;({encryptedKey:s,...c}=await(async(e,t,r,n=2048,i=R(new Uint8Array(16)))=>{const o=await ce(i,e,n,t);return{encryptedKey:await ie(e.slice(-6),o,r),p2c:n,p2s:v(i)}})(e,r,u,o,a));break}case"A128KW":case"A192KW":case"A256KW":u=n||pe(t),s=await ie(e,r,u);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{u=n||pe(t);const{iv:o}=i;({encryptedKey:s,...c}=await async function(e,t,r,n){const i=e.slice(0,7);n||(n=D(i));const{ciphertext:o,tag:a}=await Ce(i,r,t,n,new Uint8Array(0));return{encryptedKey:o,iv:v(n),tag:v(a)}}(e,r,u,o));break}default:throw new k('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:u,encryptedKey:s,parameters:c}},De=Symbol();class Me{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this._plaintext=e}setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this}async encrypt(e,t){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new A("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!Q(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new A("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(Te(A,new Map,null==t?void 0:t.crit,this._protectedHeader,r),void 0!==r.zip){if(!this._protectedHeader||!this._protectedHeader.zip)throw new A('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==r.zip)throw new k('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:n,enc:i}=r;if("string"!=typeof n||!n)throw new A('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof i||!i)throw new A('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let o,a,s,l,p,f,h;if("dir"===n){if(this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Encryption")}else if("ECDH-ES"===n&&this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Key Agreement");{let r;({cek:a,encryptedKey:o,parameters:r}=await Le(n,i,e,this._cek,this._keyManagementParameters)),r&&(t&&De in t?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...r}:this.setUnprotectedHeader(r):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...r}:this.setProtectedHeader(r))}if(this._iv||(this._iv=D(i)),l=this._protectedHeader?c.encode(v(JSON.stringify(this._protectedHeader))):c.encode(""),this._aad?(p=v(this._aad),s=d(l,c.encode("."),c.encode(p))):s=l,"DEF"===r.zip){const e=await((null==t?void 0:t.deflateRaw)||Y)(this._plaintext);({ciphertext:f,tag:h}=await Ce(i,e,a,this._iv,s))}else({ciphertext:f,tag:h}=await Ce(i,this._plaintext,a,this._iv,s));const m={ciphertext:v(f),iv:v(this._iv),tag:v(h)};return o&&(m.encrypted_key=v(o)),p&&(m.aad=p),this._protectedHeader&&(m.protected=u.decode(l)),this._sharedUnprotectedHeader&&(m.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(m.header=this._unprotectedHeader),m}}class Ue{constructor(e,t,r){this.parent=e,this.key=t,this.options=r}setUnprotectedHeader(e){if(this.unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=e,this}addRecipient(...e){return this.parent.addRecipient(...e)}encrypt(...e){return this.parent.encrypt(...e)}done(){return this.parent}}class Be{constructor(e){this._recipients=[],this._plaintext=e}addRecipient(e,t){const r=new Ue(this,e,{crit:null==t?void 0:t.crit});return this._recipients.push(r),r}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}async encrypt(e){var t,r,n;if(!this._recipients.length)throw new A("at least one recipient must be added");if(e={deflateRaw:null==e?void 0:e.deflateRaw},1===this._recipients.length){const[t]=this._recipients,r=await new Me(this._plaintext).setAdditionalAuthenticatedData(this._aad).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(t.unprotectedHeader).encrypt(t.key,{...t.options,...e});let n={ciphertext:r.ciphertext,iv:r.iv,recipients:[{}],tag:r.tag};return r.aad&&(n.aad=r.aad),r.protected&&(n.protected=r.protected),r.unprotected&&(n.unprotected=r.unprotected),r.encrypted_key&&(n.recipients[0].encrypted_key=r.encrypted_key),r.header&&(n.recipients[0].header=r.header),n}let i;for(let e=0;e<this._recipients.length;e++){const t=this._recipients[e];if(!Q(this._protectedHeader,this._unprotectedHeader,t.unprotectedHeader))throw new A("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader,...t.unprotectedHeader},{alg:n}=r;if("string"!=typeof n||!n)throw new A('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("dir"===n||"ECDH-ES"===n)throw new A('"dir" and "ECDH-ES" alg may only be used with a single recipient');if("string"!=typeof r.enc||!r.enc)throw new A('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');if(i){if(i!==r.enc)throw new A('JWE "enc" (Encryption Algorithm) Header Parameter must be the same for all recipients')}else i=r.enc;if(Te(A,new Map,t.options.crit,this._protectedHeader,r),!(void 0===r.zip||this._protectedHeader&&this._protectedHeader.zip))throw new A('JWE "zip" (Compression Algorithm) Header MUST be integrity protected')}const o=pe(i);let a={ciphertext:"",iv:"",recipients:[],tag:""};for(let s=0;s<this._recipients.length;s++){const c=this._recipients[s],u={};a.recipients.push(u);const l={...this._protectedHeader,...this._unprotectedHeader,...c.unprotectedHeader}.alg.startsWith("PBES2")?2048+s:void 0;if(0===s){const t=await new Me(this._plaintext).setAdditionalAuthenticatedData(this._aad).setContentEncryptionKey(o).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(c.unprotectedHeader).setKeyManagementParameters({p2c:l}).encrypt(c.key,{...c.options,...e,[De]:!0});a.ciphertext=t.ciphertext,a.iv=t.iv,a.tag=t.tag,t.aad&&(a.aad=t.aad),t.protected&&(a.protected=t.protected),t.unprotected&&(a.unprotected=t.unprotected),u.encrypted_key=t.encrypted_key,t.header&&(u.header=t.header);continue}const{encryptedKey:d,parameters:p}=await Le((null===(t=c.unprotectedHeader)||void 0===t?void 0:t.alg)||(null===(r=this._protectedHeader)||void 0===r?void 0:r.alg)||(null===(n=this._unprotectedHeader)||void 0===n?void 0:n.alg),i,c.key,o,{p2c:l});u.encrypted_key=v(d),(c.unprotectedHeader||p)&&(u.header={...c.unprotectedHeader,...p})}return a}}function He(e,t){const r=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};case"EdDSA":return{name:t.name};default:throw new k(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}function qe(e,t,r){if(a(t))return function(e,t,...r){switch(t){case"HS256":case"HS384":case"HS512":{if(!H(e.algorithm,"HMAC"))throw B("HMAC");const r=parseInt(t.slice(2),10);if(q(e.algorithm.hash)!==r)throw B(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!H(e.algorithm,"RSASSA-PKCS1-v1_5"))throw B("RSASSA-PKCS1-v1_5");const r=parseInt(t.slice(2),10);if(q(e.algorithm.hash)!==r)throw B(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!H(e.algorithm,"RSA-PSS"))throw B("RSA-PSS");const r=parseInt(t.slice(2),10);if(q(e.algorithm.hash)!==r)throw B(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name)throw B("Ed25519 or Ed448");break;case"ES256":case"ES384":case"ES512":{if(!H(e.algorithm,"ECDSA"))throw B("ECDSA");const r=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(t);if(e.algorithm.namedCurve!==r)throw B(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}K(e,r)}(t,e,r),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(z(t,...$));return o.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}throw new TypeError(z(t,...$,"Uint8Array"))}async function Ke(e,t,r){var n;if(!ee(e))throw new C("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new C('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new C("JWS Protected Header incorrect type");if(void 0===e.payload)throw new C("JWS Payload missing");if("string"!=typeof e.signature)throw new C("JWS Signature missing or incorrect type");if(void 0!==e.header&&!ee(e.header))throw new C("JWS Unprotected Header incorrect type");let i={};if(e.protected)try{const t=b(e.protected);i=JSON.parse(u.decode(t))}catch(e){throw new C("JWS Protected Header is invalid")}if(!Q(i,e.header))throw new C("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const a={...i,...e.header};let s=!0;if(Te(C,new Map([["b64",!0]]),null==r?void 0:r.crit,i,a).has("b64")&&(s=i.b64,"boolean"!=typeof s))throw new C('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:l}=a;if("string"!=typeof l||!l)throw new C('JWS "alg" (Algorithm) Header Parameter missing or invalid');const p=r&&Oe("algorithms",r.algorithms);if(p&&!p.has(l))throw new E('"alg" (Algorithm) Header Parameter not allowed');if(s){if("string"!=typeof e.payload)throw new C("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new C("JWS Payload must be a string or an Uint8Array instance");let f=!1;"function"==typeof t&&(t=await t(i,e),f=!0),Ae(l,t,"verify");const h=d(c.encode(null!==(n=e.protected)&&void 0!==n?n:""),c.encode("."),"string"==typeof e.payload?c.encode(e.payload):e.payload),m=b(e.signature);if(!await(async(e,t,r,n)=>{const i=await qe(e,t,"verify");le(e,i);const a=He(e,i.algorithm);try{return await o.subtle.verify(a,i,r,n)}catch(e){return!1}})(l,t,m,h))throw new j;let g;g=s?b(e.payload):"string"==typeof e.payload?c.encode(e.payload):e.payload;const v={payload:g};return void 0!==e.protected&&(v.protectedHeader=i),void 0!==e.header&&(v.unprotectedHeader=e.header),f?{...v,key:t}:v}async function We(e,t,r){if(e instanceof Uint8Array&&(e=u.decode(e)),"string"!=typeof e)throw new C("Compact JWS must be a string or Uint8Array");const{0:n,1:i,2:o,length:a}=e.split(".");if(3!==a)throw new C("Invalid Compact JWS");const s=await Ke({payload:i,protected:n,signature:o},t,r),c={payload:s.payload,protectedHeader:s.protectedHeader};return"function"==typeof t?{...c,key:s.key}:c}async function Ve(e,t,r){if(!ee(e))throw new C("General JWS must be an object");if(!Array.isArray(e.signatures)||!e.signatures.every(ee))throw new C("JWS Signatures missing or incorrect type");for(const n of e.signatures)try{return await Ke({header:n.header,payload:e.payload,protected:n.protected,signature:n.signature},t,r)}catch(e){}throw new j}const ze=e=>Math.floor(e.getTime()/1e3),Je=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i,Ze=e=>{const t=Je.exec(e);if(!t)throw new TypeError("Invalid time period format");const r=parseFloat(t[1]);switch(t[2].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":return Math.round(r);case"minute":case"minutes":case"min":case"mins":case"m":return Math.round(60*r);case"hour":case"hours":case"hr":case"hrs":case"h":return Math.round(3600*r);case"day":case"days":case"d":return Math.round(86400*r);case"week":case"weeks":case"w":return Math.round(604800*r);default:return Math.round(31557600*r)}},$e=e=>e.toLowerCase().replace(/^application\//,""),Ge=(e,t,r={})=>{const{typ:n}=r;if(n&&("string"!=typeof e.typ||$e(e.typ)!==$e(n)))throw new x('unexpected "typ" JWT header value',"typ","check_failed");let i;try{i=JSON.parse(u.decode(t))}catch(e){}if(!ee(i))throw new T("JWT Claims Set must be a top-level JSON object");const{requiredClaims:o=[],issuer:a,subject:s,audience:c,maxTokenAge:l}=r;void 0!==l&&o.push("iat"),void 0!==c&&o.push("aud"),void 0!==s&&o.push("sub"),void 0!==a&&o.push("iss");for(const e of new Set(o.reverse()))if(!(e in i))throw new x(`missing required "${e}" claim`,e,"missing");if(a&&!(Array.isArray(a)?a:[a]).includes(i.iss))throw new x('unexpected "iss" claim value',"iss","check_failed");if(s&&i.sub!==s)throw new x('unexpected "sub" claim value',"sub","check_failed");if(c&&(p="string"==typeof c?[c]:c,!("string"==typeof(d=i.aud)?p.includes(d):Array.isArray(d)&&p.some(Set.prototype.has.bind(new Set(d))))))throw new x('unexpected "aud" claim value',"aud","check_failed");var d,p;let f;switch(typeof r.clockTolerance){case"string":f=Ze(r.clockTolerance);break;case"number":f=r.clockTolerance;break;case"undefined":f=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:h}=r,m=ze(h||new Date);if((void 0!==i.iat||l)&&"number"!=typeof i.iat)throw new x('"iat" claim must be a number',"iat","invalid");if(void 0!==i.nbf){if("number"!=typeof i.nbf)throw new x('"nbf" claim must be a number',"nbf","invalid");if(i.nbf>m+f)throw new x('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==i.exp){if("number"!=typeof i.exp)throw new x('"exp" claim must be a number',"exp","invalid");if(i.exp<=m-f)throw new _('"exp" claim timestamp check failed',"exp","check_failed")}if(l){const e=m-i.iat;if(e-f>("number"==typeof l?l:Ze(l)))throw new _('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-f)throw new x('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return i};async function Xe(e,t,r){var n;const i=await We(e,t,r);if((null===(n=i.protectedHeader.crit)||void 0===n?void 0:n.includes("b64"))&&!1===i.protectedHeader.b64)throw new T("JWTs MUST NOT use unencoded payload");const o={payload:Ge(i.protectedHeader,i.payload,r),protectedHeader:i.protectedHeader};return"function"==typeof t?{...o,key:i.key}:o}async function Ye(e,t,r){const n=await Fe(e,t,r),i=Ge(n.protectedHeader,n.plaintext,r),{protectedHeader:o}=n;if(void 0!==o.iss&&o.iss!==i.iss)throw new x('replicated "iss" claim header parameter mismatch',"iss","mismatch");if(void 0!==o.sub&&o.sub!==i.sub)throw new x('replicated "sub" claim header parameter mismatch',"sub","mismatch");if(void 0!==o.aud&&JSON.stringify(o.aud)!==JSON.stringify(i.aud))throw new x('replicated "aud" claim header parameter mismatch',"aud","mismatch");const a={payload:i,protectedHeader:o};return"function"==typeof t?{...a,key:n.key}:a}class Qe{constructor(e){this._flattened=new Me(e)}setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this}setInitializationVector(e){return this._flattened.setInitializationVector(e),this}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this}async encrypt(e,t){const r=await this._flattened.encrypt(e,t);return[r.protected,r.encrypted_key,r.iv,r.ciphertext,r.tag].join(".")}}class et{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}async sign(e,t){if(!this._protectedHeader&&!this._unprotectedHeader)throw new C("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!Q(this._protectedHeader,this._unprotectedHeader))throw new C("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader};let n=!0;if(Te(C,new Map([["b64",!0]]),null==t?void 0:t.crit,this._protectedHeader,r).has("b64")&&(n=this._protectedHeader.b64,"boolean"!=typeof n))throw new C('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:i}=r;if("string"!=typeof i||!i)throw new C('JWS "alg" (Algorithm) Header Parameter missing or invalid');Ae(i,e,"sign");let a,s=this._payload;n&&(s=c.encode(v(s))),a=this._protectedHeader?c.encode(v(JSON.stringify(this._protectedHeader))):c.encode("");const l=d(a,c.encode("."),s),p=await(async(e,t,r)=>{const n=await qe(e,t,"sign");le(e,n);const i=await o.subtle.sign(He(e,n.algorithm),n,r);return new Uint8Array(i)})(i,e,l),f={signature:v(p),payload:""};return n&&(f.payload=u.decode(s)),this._unprotectedHeader&&(f.header=this._unprotectedHeader),this._protectedHeader&&(f.protected=u.decode(a)),f}}class tt{constructor(e){this._flattened=new et(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,t){const r=await this._flattened.sign(e,t);if(void 0===r.payload)throw new TypeError("use the flattened module for creating JWS with b64: false");return`${r.protected}.${r.payload}.${r.signature}`}}class rt{constructor(e,t,r){this.parent=e,this.key=t,this.options=r}setProtectedHeader(e){if(this.protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this.protectedHeader=e,this}setUnprotectedHeader(e){if(this.unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=e,this}addSignature(...e){return this.parent.addSignature(...e)}sign(...e){return this.parent.sign(...e)}done(){return this.parent}}class nt{constructor(e){this._signatures=[],this._payload=e}addSignature(e,t){const r=new rt(this,e,t);return this._signatures.push(r),r}async sign(){if(!this._signatures.length)throw new C("at least one signature must be added");const e={signatures:[],payload:""};for(let t=0;t<this._signatures.length;t++){const r=this._signatures[t],n=new et(this._payload);n.setProtectedHeader(r.protectedHeader),n.setUnprotectedHeader(r.unprotectedHeader);const{payload:i,...o}=await n.sign(r.key,r.options);if(0===t)e.payload=i;else if(e.payload!==i)throw new C("inconsistent use of JWS Unencoded Payload (RFC7797)");e.signatures.push(o)}return e}}class it{constructor(e){if(!ee(e))throw new TypeError("JWT Claims Set MUST be an object");this._payload=e}setIssuer(e){return this._payload={...this._payload,iss:e},this}setSubject(e){return this._payload={...this._payload,sub:e},this}setAudience(e){return this._payload={...this._payload,aud:e},this}setJti(e){return this._payload={...this._payload,jti:e},this}setNotBefore(e){return this._payload="number"==typeof e?{...this._payload,nbf:e}:{...this._payload,nbf:ze(new Date)+Ze(e)},this}setExpirationTime(e){return this._payload="number"==typeof e?{...this._payload,exp:e}:{...this._payload,exp:ze(new Date)+Ze(e)},this}setIssuedAt(e){return this._payload=void 0===e?{...this._payload,iat:ze(new Date)}:{...this._payload,iat:e},this}}class ot extends it{setProtectedHeader(e){return this._protectedHeader=e,this}async sign(e,t){var r;const n=new tt(c.encode(JSON.stringify(this._payload)));if(n.setProtectedHeader(this._protectedHeader),Array.isArray(null===(r=this._protectedHeader)||void 0===r?void 0:r.crit)&&this._protectedHeader.crit.includes("b64")&&!1===this._protectedHeader.b64)throw new T("JWTs MUST NOT use unencoded payload");return n.sign(e,t)}}class at extends it{setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this}replicateIssuerAsHeader(){return this._replicateIssuerAsHeader=!0,this}replicateSubjectAsHeader(){return this._replicateSubjectAsHeader=!0,this}replicateAudienceAsHeader(){return this._replicateAudienceAsHeader=!0,this}async encrypt(e,t){const r=new Qe(c.encode(JSON.stringify(this._payload)));return this._replicateIssuerAsHeader&&(this._protectedHeader={...this._protectedHeader,iss:this._payload.iss}),this._replicateSubjectAsHeader&&(this._protectedHeader={...this._protectedHeader,sub:this._payload.sub}),this._replicateAudienceAsHeader&&(this._protectedHeader={...this._protectedHeader,aud:this._payload.aud}),r.setProtectedHeader(this._protectedHeader),this._iv&&r.setInitializationVector(this._iv),this._cek&&r.setContentEncryptionKey(this._cek),this._keyManagementParameters&&r.setKeyManagementParameters(this._keyManagementParameters),r.encrypt(e,t)}}const st=(e,t)=>{if("string"!=typeof e||!e)throw new O(`${t} missing or invalid`)};async function ct(e,t){if(!ee(e))throw new TypeError("JWK must be an object");if(null!=t||(t="sha256"),"sha256"!==t&&"sha384"!==t&&"sha512"!==t)throw new TypeError('digestAlgorithm must one of "sha256", "sha384", or "sha512"');let r;switch(e.kty){case"EC":st(e.crv,'"crv" (Curve) Parameter'),st(e.x,'"x" (X Coordinate) Parameter'),st(e.y,'"y" (Y Coordinate) Parameter'),r={crv:e.crv,kty:e.kty,x:e.x,y:e.y};break;case"OKP":st(e.crv,'"crv" (Subtype of Key Pair) Parameter'),st(e.x,'"x" (Public Key) Parameter'),r={crv:e.crv,kty:e.kty,x:e.x};break;case"RSA":st(e.e,'"e" (Exponent) Parameter'),st(e.n,'"n" (Modulus) Parameter'),r={e:e.e,kty:e.kty,n:e.n};break;case"oct":st(e.k,'"k" (Key Value) Parameter'),r={k:e.k,kty:e.kty};break;default:throw new k('"kty" (Key Type) Parameter missing or unsupported')}const n=c.encode(JSON.stringify(r));return v(await s(t,n))}async function ut(e,t){null!=t||(t="sha256");const r=await ct(e,t);return`urn:ietf:params:oauth:jwk-thumbprint:sha-${t.slice(-3)}:${r}`}async function lt(e,t){const r={...e,...null==t?void 0:t.header};if(!ee(r.jwk))throw new C('"jwk" (JSON Web Key) Header Parameter must be a JSON object');const n=await Se({...r.jwk,ext:!0},r.alg,!0);if(n instanceof Uint8Array||"public"!==n.type)throw new C('"jwk" (JSON Web Key) Header Parameter must be a public key');return n}function dt(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(pt)}function pt(e){return ee(e)}class ft{constructor(e){if(this._cached=new WeakMap,!dt(e))throw new P("JSON Web Key Set malformed");var t;this._jwks=(t=e,"function"==typeof structuredClone?structuredClone(t):JSON.parse(JSON.stringify(t)))}async getKey(e,t){const{alg:r,kid:n}={...e,...null==t?void 0:t.header},i=function(e){switch("string"==typeof e&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";default:throw new k('Unsupported "alg" value for a JSON Web Key Set')}}(r),o=this._jwks.keys.filter((e=>{let t=i===e.kty;if(t&&"string"==typeof n&&(t=n===e.kid),t&&"string"==typeof e.alg&&(t=r===e.alg),t&&"string"==typeof e.use&&(t="sig"===e.use),t&&Array.isArray(e.key_ops)&&(t=e.key_ops.includes("verify")),t&&"EdDSA"===r&&(t="Ed25519"===e.crv||"Ed448"===e.crv),t)switch(r){case"ES256":t="P-256"===e.crv;break;case"ES256K":t="secp256k1"===e.crv;break;case"ES384":t="P-384"===e.crv;break;case"ES512":t="P-521"===e.crv}return t})),{0:a,length:s}=o;if(0===s)throw new F;if(1!==s){const e=new I,{_cached:t}=this;throw e[Symbol.asyncIterator]=async function*(){for(const e of o)try{yield await ht(t,e,r)}catch(e){continue}},e}return ht(this._cached,a,r)}}async function ht(e,t,r){const n=e.get(t)||e.set(t,{}).get(t);if(void 0===n[r]){const e=await Se({...t,ext:!0},r);if(e instanceof Uint8Array||"public"!==e.type)throw new P("JSON Web Key Set members must be public keys");n[r]=e}return n[r]}function mt(e){const t=new ft(e);return async function(e,r){return t.getKey(e,r)}}class gt extends ft{constructor(e,t){if(super({keys:[]}),this._jwks=void 0,!(e instanceof URL))throw new TypeError("url must be an instance of URL");this._url=new URL(e.href),this._options={agent:null==t?void 0:t.agent,headers:null==t?void 0:t.headers},this._timeoutDuration="number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3,this._cooldownDuration="number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4,this._cacheMaxAge="number"==typeof(null==t?void 0:t.cacheMaxAge)?null==t?void 0:t.cacheMaxAge:6e5}coolingDown(){return"number"==typeof this._jwksTimestamp&&Date.now()<this._jwksTimestamp+this._cooldownDuration}fresh(){return"number"==typeof this._jwksTimestamp&&Date.now()<this._jwksTimestamp+this._cacheMaxAge}async getKey(e,t){this._jwks&&this.fresh()||await this.reload();try{return await super.getKey(e,t)}catch(r){if(r instanceof F&&!1===this.coolingDown())return await this.reload(),super.getKey(e,t);throw r}}async reload(){this._pendingFetch&&("undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime)&&(this._pendingFetch=void 0),this._pendingFetch||(this._pendingFetch=(async(e,t,r)=>{let n,i,o=!1;"function"==typeof AbortController&&(n=new AbortController,i=setTimeout((()=>{o=!0,n.abort()}),t));const a=await fetch(e.href,{signal:n?n.signal:void 0,redirect:"manual",headers:r.headers}).catch((e=>{if(o)throw new N;throw e}));if(void 0!==i&&clearTimeout(i),200!==a.status)throw new w("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await a.json()}catch(e){throw new w("Failed to parse the JSON Web Key Set HTTP response as JSON")}})(this._url,this._timeoutDuration,this._options).then((e=>{if(!dt(e))throw new P("JSON Web Key Set malformed");this._jwks={keys:e.keys},this._jwksTimestamp=Date.now(),this._pendingFetch=void 0})).catch((e=>{throw this._pendingFetch=void 0,e}))),await this._pendingFetch}}function vt(e,t){const r=new gt(e,t);return async function(e,t){return r.getKey(e,t)}}class yt extends it{encode(){return`${v(JSON.stringify({alg:"none"}))}.${v(JSON.stringify(this._payload))}.`}static decode(e,t){if("string"!=typeof e)throw new T("Unsecured JWT must be a string");const{0:r,1:n,2:i,length:o}=e.split(".");if(3!==o||""!==i)throw new T("Invalid Unsecured JWT");let a;try{if(a=JSON.parse(u.decode(b(r))),"none"!==a.alg)throw new Error}catch(e){throw new T("Invalid Unsecured JWT")}return{payload:Ge(a,b(n),t),header:a}}}const bt=v,wt=b;function xt(e){let t;if("string"==typeof e){const r=e.split(".");3!==r.length&&5!==r.length||([t]=r)}else if("object"==typeof e&&e){if(!("protected"in e))throw new TypeError("Token does not contain a Protected Header");t=e.protected}try{if("string"!=typeof t||!t)throw new Error;const e=JSON.parse(u.decode(wt(t)));if(!ee(e))throw new Error;return e}catch(e){throw new TypeError("Invalid Token or Protected Header formatting")}}function _t(e){if("string"!=typeof e)throw new T("JWTs must use Compact JWS serialization, JWT must be a string");const{1:t,length:r}=e.split(".");if(5===r)throw new T("Only JWTs using Compact JWS serialization can be decoded");if(3!==r)throw new T("Invalid JWT");if(!t)throw new T("JWTs must contain a payload");let n,i;try{n=wt(t)}catch(e){throw new T("Failed to parse the base64url encoded payload")}try{i=JSON.parse(u.decode(n))}catch(e){throw new T("Failed to parse the decoded payload as JSON")}if(!ee(i))throw new T("Invalid JWT Claims Set");return i}function Et(e){var t;const r=null!==(t=null==e?void 0:e.modulusLength)&&void 0!==t?t:2048;if("number"!=typeof r||r<2048)throw new k("Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used");return r}async function kt(e,t){return async function(e,t){var r,n,i;let a,s;switch(e){case"PS256":case"PS384":case"PS512":a={name:"RSA-PSS",hash:`SHA-${e.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:Et(t)},s=["sign","verify"];break;case"RS256":case"RS384":case"RS512":a={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:Et(t)},s=["sign","verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":a={name:"RSA-OAEP",hash:`SHA-${parseInt(e.slice(-3),10)||1}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:Et(t)},s=["decrypt","unwrapKey","encrypt","wrapKey"];break;case"ES256":a={name:"ECDSA",namedCurve:"P-256"},s=["sign","verify"];break;case"ES384":a={name:"ECDSA",namedCurve:"P-384"},s=["sign","verify"];break;case"ES512":a={name:"ECDSA",namedCurve:"P-521"},s=["sign","verify"];break;case"EdDSA":s=["sign","verify"];const i=null!==(r=null==t?void 0:t.crv)&&void 0!==r?r:"Ed25519";switch(i){case"Ed25519":case"Ed448":a={name:i};break;default:throw new k("Invalid or unsupported crv option provided")}break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{s=["deriveKey","deriveBits"];const e=null!==(n=null==t?void 0:t.crv)&&void 0!==n?n:"P-256";switch(e){case"P-256":case"P-384":case"P-521":a={name:"ECDH",namedCurve:e};break;case"X25519":case"X448":a={name:e};break;default:throw new k("Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448")}break}default:throw new k('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return o.subtle.generateKey(a,null!==(i=null==t?void 0:t.extractable)&&void 0!==i&&i,s)}(e,t)}async function St(e,t){return async function(e,t){var r;let n,i,a;switch(e){case"HS256":case"HS384":case"HS512":n=parseInt(e.slice(-3),10),i={name:"HMAC",hash:`SHA-${n}`,length:n},a=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return n=parseInt(e.slice(-3),10),R(new Uint8Array(n>>3));case"A128KW":case"A192KW":case"A256KW":n=parseInt(e.slice(1,4),10),i={name:"AES-KW",length:n},a=["wrapKey","unwrapKey"];break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":case"A128GCM":case"A192GCM":case"A256GCM":n=parseInt(e.slice(1,4),10),i={name:"AES-GCM",length:n},a=["encrypt","decrypt"];break;default:throw new k('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return o.subtle.generateKey(i,null!==(r=null==t?void 0:t.extractable)&&void 0!==r&&r,a)}(e,t)}},3765:e=>{"use strict";e.exports=JSON.parse('{"application/1d-interleaved-parityfec":{"source":"iana"},"application/3gpdash-qoe-report+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/3gpp-ims+xml":{"source":"iana","compressible":true},"application/3gpphal+json":{"source":"iana","compressible":true},"application/3gpphalforms+json":{"source":"iana","compressible":true},"application/a2l":{"source":"iana"},"application/ace+cbor":{"source":"iana"},"application/activemessage":{"source":"iana"},"application/activity+json":{"source":"iana","compressible":true},"application/alto-costmap+json":{"source":"iana","compressible":true},"application/alto-costmapfilter+json":{"source":"iana","compressible":true},"application/alto-directory+json":{"source":"iana","compressible":true},"application/alto-endpointcost+json":{"source":"iana","compressible":true},"application/alto-endpointcostparams+json":{"source":"iana","compressible":true},"application/alto-endpointprop+json":{"source":"iana","compressible":true},"application/alto-endpointpropparams+json":{"source":"iana","compressible":true},"application/alto-error+json":{"source":"iana","compressible":true},"application/alto-networkmap+json":{"source":"iana","compressible":true},"application/alto-networkmapfilter+json":{"source":"iana","compressible":true},"application/alto-updatestreamcontrol+json":{"source":"iana","compressible":true},"application/alto-updatestreamparams+json":{"source":"iana","compressible":true},"application/aml":{"source":"iana"},"application/andrew-inset":{"source":"iana","extensions":["ez"]},"application/applefile":{"source":"iana"},"application/applixware":{"source":"apache","extensions":["aw"]},"application/at+jwt":{"source":"iana"},"application/atf":{"source":"iana"},"application/atfx":{"source":"iana"},"application/atom+xml":{"source":"iana","compressible":true,"extensions":["atom"]},"application/atomcat+xml":{"source":"iana","compressible":true,"extensions":["atomcat"]},"application/atomdeleted+xml":{"source":"iana","compressible":true,"extensions":["atomdeleted"]},"application/atomicmail":{"source":"iana"},"application/atomsvc+xml":{"source":"iana","compressible":true,"extensions":["atomsvc"]},"application/atsc-dwd+xml":{"source":"iana","compressible":true,"extensions":["dwd"]},"application/atsc-dynamic-event-message":{"source":"iana"},"application/atsc-held+xml":{"source":"iana","compressible":true,"extensions":["held"]},"application/atsc-rdt+json":{"source":"iana","compressible":true},"application/atsc-rsat+xml":{"source":"iana","compressible":true,"extensions":["rsat"]},"application/atxml":{"source":"iana"},"application/auth-policy+xml":{"source":"iana","compressible":true},"application/bacnet-xdd+zip":{"source":"iana","compressible":false},"application/batch-smtp":{"source":"iana"},"application/bdoc":{"compressible":false,"extensions":["bdoc"]},"application/beep+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/calendar+json":{"source":"iana","compressible":true},"application/calendar+xml":{"source":"iana","compressible":true,"extensions":["xcs"]},"application/call-completion":{"source":"iana"},"application/cals-1840":{"source":"iana"},"application/captive+json":{"source":"iana","compressible":true},"application/cbor":{"source":"iana"},"application/cbor-seq":{"source":"iana"},"application/cccex":{"source":"iana"},"application/ccmp+xml":{"source":"iana","compressible":true},"application/ccxml+xml":{"source":"iana","compressible":true,"extensions":["ccxml"]},"application/cdfx+xml":{"source":"iana","compressible":true,"extensions":["cdfx"]},"application/cdmi-capability":{"source":"iana","extensions":["cdmia"]},"application/cdmi-container":{"source":"iana","extensions":["cdmic"]},"application/cdmi-domain":{"source":"iana","extensions":["cdmid"]},"application/cdmi-object":{"source":"iana","extensions":["cdmio"]},"application/cdmi-queue":{"source":"iana","extensions":["cdmiq"]},"application/cdni":{"source":"iana"},"application/cea":{"source":"iana"},"application/cea-2018+xml":{"source":"iana","compressible":true},"application/cellml+xml":{"source":"iana","compressible":true},"application/cfw":{"source":"iana"},"application/city+json":{"source":"iana","compressible":true},"application/clr":{"source":"iana"},"application/clue+xml":{"source":"iana","compressible":true},"application/clue_info+xml":{"source":"iana","compressible":true},"application/cms":{"source":"iana"},"application/cnrp+xml":{"source":"iana","compressible":true},"application/coap-group+json":{"source":"iana","compressible":true},"application/coap-payload":{"source":"iana"},"application/commonground":{"source":"iana"},"application/conference-info+xml":{"source":"iana","compressible":true},"application/cose":{"source":"iana"},"application/cose-key":{"source":"iana"},"application/cose-key-set":{"source":"iana"},"application/cpl+xml":{"source":"iana","compressible":true,"extensions":["cpl"]},"application/csrattrs":{"source":"iana"},"application/csta+xml":{"source":"iana","compressible":true},"application/cstadata+xml":{"source":"iana","compressible":true},"application/csvm+json":{"source":"iana","compressible":true},"application/cu-seeme":{"source":"apache","extensions":["cu"]},"application/cwt":{"source":"iana"},"application/cybercash":{"source":"iana"},"application/dart":{"compressible":true},"application/dash+xml":{"source":"iana","compressible":true,"extensions":["mpd"]},"application/dash-patch+xml":{"source":"iana","compressible":true,"extensions":["mpp"]},"application/dashdelta":{"source":"iana"},"application/davmount+xml":{"source":"iana","compressible":true,"extensions":["davmount"]},"application/dca-rft":{"source":"iana"},"application/dcd":{"source":"iana"},"application/dec-dx":{"source":"iana"},"application/dialog-info+xml":{"source":"iana","compressible":true},"application/dicom":{"source":"iana"},"application/dicom+json":{"source":"iana","compressible":true},"application/dicom+xml":{"source":"iana","compressible":true},"application/dii":{"source":"iana"},"application/dit":{"source":"iana"},"application/dns":{"source":"iana"},"application/dns+json":{"source":"iana","compressible":true},"application/dns-message":{"source":"iana"},"application/docbook+xml":{"source":"apache","compressible":true,"extensions":["dbk"]},"application/dots+cbor":{"source":"iana"},"application/dskpp+xml":{"source":"iana","compressible":true},"application/dssc+der":{"source":"iana","extensions":["dssc"]},"application/dssc+xml":{"source":"iana","compressible":true,"extensions":["xdssc"]},"application/dvcs":{"source":"iana"},"application/ecmascript":{"source":"iana","compressible":true,"extensions":["es","ecma"]},"application/edi-consent":{"source":"iana"},"application/edi-x12":{"source":"iana","compressible":false},"application/edifact":{"source":"iana","compressible":false},"application/efi":{"source":"iana"},"application/elm+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/elm+xml":{"source":"iana","compressible":true},"application/emergencycalldata.cap+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/emergencycalldata.comment+xml":{"source":"iana","compressible":true},"application/emergencycalldata.control+xml":{"source":"iana","compressible":true},"application/emergencycalldata.deviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.ecall.msd":{"source":"iana"},"application/emergencycalldata.providerinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.serviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.subscriberinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.veds+xml":{"source":"iana","compressible":true},"application/emma+xml":{"source":"iana","compressible":true,"extensions":["emma"]},"application/emotionml+xml":{"source":"iana","compressible":true,"extensions":["emotionml"]},"application/encaprtp":{"source":"iana"},"application/epp+xml":{"source":"iana","compressible":true},"application/epub+zip":{"source":"iana","compressible":false,"extensions":["epub"]},"application/eshop":{"source":"iana"},"application/exi":{"source":"iana","extensions":["exi"]},"application/expect-ct-report+json":{"source":"iana","compressible":true},"application/express":{"source":"iana","extensions":["exp"]},"application/fastinfoset":{"source":"iana"},"application/fastsoap":{"source":"iana"},"application/fdt+xml":{"source":"iana","compressible":true,"extensions":["fdt"]},"application/fhir+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/fhir+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/fido.trusted-apps+json":{"compressible":true},"application/fits":{"source":"iana"},"application/flexfec":{"source":"iana"},"application/font-sfnt":{"source":"iana"},"application/font-tdpfr":{"source":"iana","extensions":["pfr"]},"application/font-woff":{"source":"iana","compressible":false},"application/framework-attributes+xml":{"source":"iana","compressible":true},"application/geo+json":{"source":"iana","compressible":true,"extensions":["geojson"]},"application/geo+json-seq":{"source":"iana"},"application/geopackage+sqlite3":{"source":"iana"},"application/geoxacml+xml":{"source":"iana","compressible":true},"application/gltf-buffer":{"source":"iana"},"application/gml+xml":{"source":"iana","compressible":true,"extensions":["gml"]},"application/gpx+xml":{"source":"apache","compressible":true,"extensions":["gpx"]},"application/gxf":{"source":"apache","extensions":["gxf"]},"application/gzip":{"source":"iana","compressible":false,"extensions":["gz"]},"application/h224":{"source":"iana"},"application/held+xml":{"source":"iana","compressible":true},"application/hjson":{"extensions":["hjson"]},"application/http":{"source":"iana"},"application/hyperstudio":{"source":"iana","extensions":["stk"]},"application/ibe-key-request+xml":{"source":"iana","compressible":true},"application/ibe-pkg-reply+xml":{"source":"iana","compressible":true},"application/ibe-pp-data":{"source":"iana"},"application/iges":{"source":"iana"},"application/im-iscomposing+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/index":{"source":"iana"},"application/index.cmd":{"source":"iana"},"application/index.obj":{"source":"iana"},"application/index.response":{"source":"iana"},"application/index.vnd":{"source":"iana"},"application/inkml+xml":{"source":"iana","compressible":true,"extensions":["ink","inkml"]},"application/iotp":{"source":"iana"},"application/ipfix":{"source":"iana","extensions":["ipfix"]},"application/ipp":{"source":"iana"},"application/isup":{"source":"iana"},"application/its+xml":{"source":"iana","compressible":true,"extensions":["its"]},"application/java-archive":{"source":"apache","compressible":false,"extensions":["jar","war","ear"]},"application/java-serialized-object":{"source":"apache","compressible":false,"extensions":["ser"]},"application/java-vm":{"source":"apache","compressible":false,"extensions":["class"]},"application/javascript":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["js","mjs"]},"application/jf2feed+json":{"source":"iana","compressible":true},"application/jose":{"source":"iana"},"application/jose+json":{"source":"iana","compressible":true},"application/jrd+json":{"source":"iana","compressible":true},"application/jscalendar+json":{"source":"iana","compressible":true},"application/json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["json","map"]},"application/json-patch+json":{"source":"iana","compressible":true},"application/json-seq":{"source":"iana"},"application/json5":{"extensions":["json5"]},"application/jsonml+json":{"source":"apache","compressible":true,"extensions":["jsonml"]},"application/jwk+json":{"source":"iana","compressible":true},"application/jwk-set+json":{"source":"iana","compressible":true},"application/jwt":{"source":"iana"},"application/kpml-request+xml":{"source":"iana","compressible":true},"application/kpml-response+xml":{"source":"iana","compressible":true},"application/ld+json":{"source":"iana","compressible":true,"extensions":["jsonld"]},"application/lgr+xml":{"source":"iana","compressible":true,"extensions":["lgr"]},"application/link-format":{"source":"iana"},"application/load-control+xml":{"source":"iana","compressible":true},"application/lost+xml":{"source":"iana","compressible":true,"extensions":["lostxml"]},"application/lostsync+xml":{"source":"iana","compressible":true},"application/lpf+zip":{"source":"iana","compressible":false},"application/lxf":{"source":"iana"},"application/mac-binhex40":{"source":"iana","extensions":["hqx"]},"application/mac-compactpro":{"source":"apache","extensions":["cpt"]},"application/macwriteii":{"source":"iana"},"application/mads+xml":{"source":"iana","compressible":true,"extensions":["mads"]},"application/manifest+json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["webmanifest"]},"application/marc":{"source":"iana","extensions":["mrc"]},"application/marcxml+xml":{"source":"iana","compressible":true,"extensions":["mrcx"]},"application/mathematica":{"source":"iana","extensions":["ma","nb","mb"]},"application/mathml+xml":{"source":"iana","compressible":true,"extensions":["mathml"]},"application/mathml-content+xml":{"source":"iana","compressible":true},"application/mathml-presentation+xml":{"source":"iana","compressible":true},"application/mbms-associated-procedure-description+xml":{"source":"iana","compressible":true},"application/mbms-deregister+xml":{"source":"iana","compressible":true},"application/mbms-envelope+xml":{"source":"iana","compressible":true},"application/mbms-msk+xml":{"source":"iana","compressible":true},"application/mbms-msk-response+xml":{"source":"iana","compressible":true},"application/mbms-protection-description+xml":{"source":"iana","compressible":true},"application/mbms-reception-report+xml":{"source":"iana","compressible":true},"application/mbms-register+xml":{"source":"iana","compressible":true},"application/mbms-register-response+xml":{"source":"iana","compressible":true},"application/mbms-schedule+xml":{"source":"iana","compressible":true},"application/mbms-user-service-description+xml":{"source":"iana","compressible":true},"application/mbox":{"source":"iana","extensions":["mbox"]},"application/media-policy-dataset+xml":{"source":"iana","compressible":true,"extensions":["mpf"]},"application/media_control+xml":{"source":"iana","compressible":true},"application/mediaservercontrol+xml":{"source":"iana","compressible":true,"extensions":["mscml"]},"application/merge-patch+json":{"source":"iana","compressible":true},"application/metalink+xml":{"source":"apache","compressible":true,"extensions":["metalink"]},"application/metalink4+xml":{"source":"iana","compressible":true,"extensions":["meta4"]},"application/mets+xml":{"source":"iana","compressible":true,"extensions":["mets"]},"application/mf4":{"source":"iana"},"application/mikey":{"source":"iana"},"application/mipc":{"source":"iana"},"application/missing-blocks+cbor-seq":{"source":"iana"},"application/mmt-aei+xml":{"source":"iana","compressible":true,"extensions":["maei"]},"application/mmt-usd+xml":{"source":"iana","compressible":true,"extensions":["musd"]},"application/mods+xml":{"source":"iana","compressible":true,"extensions":["mods"]},"application/moss-keys":{"source":"iana"},"application/moss-signature":{"source":"iana"},"application/mosskey-data":{"source":"iana"},"application/mosskey-request":{"source":"iana"},"application/mp21":{"source":"iana","extensions":["m21","mp21"]},"application/mp4":{"source":"iana","extensions":["mp4s","m4p"]},"application/mpeg4-generic":{"source":"iana"},"application/mpeg4-iod":{"source":"iana"},"application/mpeg4-iod-xmt":{"source":"iana"},"application/mrb-consumer+xml":{"source":"iana","compressible":true},"application/mrb-publish+xml":{"source":"iana","compressible":true},"application/msc-ivr+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msc-mixer+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msword":{"source":"iana","compressible":false,"extensions":["doc","dot"]},"application/mud+json":{"source":"iana","compressible":true},"application/multipart-core":{"source":"iana"},"application/mxf":{"source":"iana","extensions":["mxf"]},"application/n-quads":{"source":"iana","extensions":["nq"]},"application/n-triples":{"source":"iana","extensions":["nt"]},"application/nasdata":{"source":"iana"},"application/news-checkgroups":{"source":"iana","charset":"US-ASCII"},"application/news-groupinfo":{"source":"iana","charset":"US-ASCII"},"application/news-transmission":{"source":"iana"},"application/nlsml+xml":{"source":"iana","compressible":true},"application/node":{"source":"iana","extensions":["cjs"]},"application/nss":{"source":"iana"},"application/oauth-authz-req+jwt":{"source":"iana"},"application/oblivious-dns-message":{"source":"iana"},"application/ocsp-request":{"source":"iana"},"application/ocsp-response":{"source":"iana"},"application/octet-stream":{"source":"iana","compressible":false,"extensions":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{"source":"iana","extensions":["oda"]},"application/odm+xml":{"source":"iana","compressible":true},"application/odx":{"source":"iana"},"application/oebps-package+xml":{"source":"iana","compressible":true,"extensions":["opf"]},"application/ogg":{"source":"iana","compressible":false,"extensions":["ogx"]},"application/omdoc+xml":{"source":"apache","compressible":true,"extensions":["omdoc"]},"application/onenote":{"source":"apache","extensions":["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{"source":"iana","compressible":true},"application/oscore":{"source":"iana"},"application/oxps":{"source":"iana","extensions":["oxps"]},"application/p21":{"source":"iana"},"application/p21+zip":{"source":"iana","compressible":false},"application/p2p-overlay+xml":{"source":"iana","compressible":true,"extensions":["relo"]},"application/parityfec":{"source":"iana"},"application/passport":{"source":"iana"},"application/patch-ops-error+xml":{"source":"iana","compressible":true,"extensions":["xer"]},"application/pdf":{"source":"iana","compressible":false,"extensions":["pdf"]},"application/pdx":{"source":"iana"},"application/pem-certificate-chain":{"source":"iana"},"application/pgp-encrypted":{"source":"iana","compressible":false,"extensions":["pgp"]},"application/pgp-keys":{"source":"iana","extensions":["asc"]},"application/pgp-signature":{"source":"iana","extensions":["asc","sig"]},"application/pics-rules":{"source":"apache","extensions":["prf"]},"application/pidf+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pidf-diff+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pkcs10":{"source":"iana","extensions":["p10"]},"application/pkcs12":{"source":"iana"},"application/pkcs7-mime":{"source":"iana","extensions":["p7m","p7c"]},"application/pkcs7-signature":{"source":"iana","extensions":["p7s"]},"application/pkcs8":{"source":"iana","extensions":["p8"]},"application/pkcs8-encrypted":{"source":"iana"},"application/pkix-attr-cert":{"source":"iana","extensions":["ac"]},"application/pkix-cert":{"source":"iana","extensions":["cer"]},"application/pkix-crl":{"source":"iana","extensions":["crl"]},"application/pkix-pkipath":{"source":"iana","extensions":["pkipath"]},"application/pkixcmp":{"source":"iana","extensions":["pki"]},"application/pls+xml":{"source":"iana","compressible":true,"extensions":["pls"]},"application/poc-settings+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/postscript":{"source":"iana","compressible":true,"extensions":["ai","eps","ps"]},"application/ppsp-tracker+json":{"source":"iana","compressible":true},"application/problem+json":{"source":"iana","compressible":true},"application/problem+xml":{"source":"iana","compressible":true},"application/provenance+xml":{"source":"iana","compressible":true,"extensions":["provx"]},"application/prs.alvestrand.titrax-sheet":{"source":"iana"},"application/prs.cww":{"source":"iana","extensions":["cww"]},"application/prs.cyn":{"source":"iana","charset":"7-BIT"},"application/prs.hpub+zip":{"source":"iana","compressible":false},"application/prs.nprend":{"source":"iana"},"application/prs.plucker":{"source":"iana"},"application/prs.rdf-xml-crypt":{"source":"iana"},"application/prs.xsf+xml":{"source":"iana","compressible":true},"application/pskc+xml":{"source":"iana","compressible":true,"extensions":["pskcxml"]},"application/pvd+json":{"source":"iana","compressible":true},"application/qsig":{"source":"iana"},"application/raml+yaml":{"compressible":true,"extensions":["raml"]},"application/raptorfec":{"source":"iana"},"application/rdap+json":{"source":"iana","compressible":true},"application/rdf+xml":{"source":"iana","compressible":true,"extensions":["rdf","owl"]},"application/reginfo+xml":{"source":"iana","compressible":true,"extensions":["rif"]},"application/relax-ng-compact-syntax":{"source":"iana","extensions":["rnc"]},"application/remote-printing":{"source":"iana"},"application/reputon+json":{"source":"iana","compressible":true},"application/resource-lists+xml":{"source":"iana","compressible":true,"extensions":["rl"]},"application/resource-lists-diff+xml":{"source":"iana","compressible":true,"extensions":["rld"]},"application/rfc+xml":{"source":"iana","compressible":true},"application/riscos":{"source":"iana"},"application/rlmi+xml":{"source":"iana","compressible":true},"application/rls-services+xml":{"source":"iana","compressible":true,"extensions":["rs"]},"application/route-apd+xml":{"source":"iana","compressible":true,"extensions":["rapd"]},"application/route-s-tsid+xml":{"source":"iana","compressible":true,"extensions":["sls"]},"application/route-usd+xml":{"source":"iana","compressible":true,"extensions":["rusd"]},"application/rpki-ghostbusters":{"source":"iana","extensions":["gbr"]},"application/rpki-manifest":{"source":"iana","extensions":["mft"]},"application/rpki-publication":{"source":"iana"},"application/rpki-roa":{"source":"iana","extensions":["roa"]},"application/rpki-updown":{"source":"iana"},"application/rsd+xml":{"source":"apache","compressible":true,"extensions":["rsd"]},"application/rss+xml":{"source":"apache","compressible":true,"extensions":["rss"]},"application/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"application/rtploopback":{"source":"iana"},"application/rtx":{"source":"iana"},"application/samlassertion+xml":{"source":"iana","compressible":true},"application/samlmetadata+xml":{"source":"iana","compressible":true},"application/sarif+json":{"source":"iana","compressible":true},"application/sarif-external-properties+json":{"source":"iana","compressible":true},"application/sbe":{"source":"iana"},"application/sbml+xml":{"source":"iana","compressible":true,"extensions":["sbml"]},"application/scaip+xml":{"source":"iana","compressible":true},"application/scim+json":{"source":"iana","compressible":true},"application/scvp-cv-request":{"source":"iana","extensions":["scq"]},"application/scvp-cv-response":{"source":"iana","extensions":["scs"]},"application/scvp-vp-request":{"source":"iana","extensions":["spq"]},"application/scvp-vp-response":{"source":"iana","extensions":["spp"]},"application/sdp":{"source":"iana","extensions":["sdp"]},"application/secevent+jwt":{"source":"iana"},"application/senml+cbor":{"source":"iana"},"application/senml+json":{"source":"iana","compressible":true},"application/senml+xml":{"source":"iana","compressible":true,"extensions":["senmlx"]},"application/senml-etch+cbor":{"source":"iana"},"application/senml-etch+json":{"source":"iana","compressible":true},"application/senml-exi":{"source":"iana"},"application/sensml+cbor":{"source":"iana"},"application/sensml+json":{"source":"iana","compressible":true},"application/sensml+xml":{"source":"iana","compressible":true,"extensions":["sensmlx"]},"application/sensml-exi":{"source":"iana"},"application/sep+xml":{"source":"iana","compressible":true},"application/sep-exi":{"source":"iana"},"application/session-info":{"source":"iana"},"application/set-payment":{"source":"iana"},"application/set-payment-initiation":{"source":"iana","extensions":["setpay"]},"application/set-registration":{"source":"iana"},"application/set-registration-initiation":{"source":"iana","extensions":["setreg"]},"application/sgml":{"source":"iana"},"application/sgml-open-catalog":{"source":"iana"},"application/shf+xml":{"source":"iana","compressible":true,"extensions":["shf"]},"application/sieve":{"source":"iana","extensions":["siv","sieve"]},"application/simple-filter+xml":{"source":"iana","compressible":true},"application/simple-message-summary":{"source":"iana"},"application/simplesymbolcontainer":{"source":"iana"},"application/sipc":{"source":"iana"},"application/slate":{"source":"iana"},"application/smil":{"source":"iana"},"application/smil+xml":{"source":"iana","compressible":true,"extensions":["smi","smil"]},"application/smpte336m":{"source":"iana"},"application/soap+fastinfoset":{"source":"iana"},"application/soap+xml":{"source":"iana","compressible":true},"application/sparql-query":{"source":"iana","extensions":["rq"]},"application/sparql-results+xml":{"source":"iana","compressible":true,"extensions":["srx"]},"application/spdx+json":{"source":"iana","compressible":true},"application/spirits-event+xml":{"source":"iana","compressible":true},"application/sql":{"source":"iana"},"application/srgs":{"source":"iana","extensions":["gram"]},"application/srgs+xml":{"source":"iana","compressible":true,"extensions":["grxml"]},"application/sru+xml":{"source":"iana","compressible":true,"extensions":["sru"]},"application/ssdl+xml":{"source":"apache","compressible":true,"extensions":["ssdl"]},"application/ssml+xml":{"source":"iana","compressible":true,"extensions":["ssml"]},"application/stix+json":{"source":"iana","compressible":true},"application/swid+xml":{"source":"iana","compressible":true,"extensions":["swidtag"]},"application/tamp-apex-update":{"source":"iana"},"application/tamp-apex-update-confirm":{"source":"iana"},"application/tamp-community-update":{"source":"iana"},"application/tamp-community-update-confirm":{"source":"iana"},"application/tamp-error":{"source":"iana"},"application/tamp-sequence-adjust":{"source":"iana"},"application/tamp-sequence-adjust-confirm":{"source":"iana"},"application/tamp-status-query":{"source":"iana"},"application/tamp-status-response":{"source":"iana"},"application/tamp-update":{"source":"iana"},"application/tamp-update-confirm":{"source":"iana"},"application/tar":{"compressible":true},"application/taxii+json":{"source":"iana","compressible":true},"application/td+json":{"source":"iana","compressible":true},"application/tei+xml":{"source":"iana","compressible":true,"extensions":["tei","teicorpus"]},"application/tetra_isi":{"source":"iana"},"application/thraud+xml":{"source":"iana","compressible":true,"extensions":["tfi"]},"application/timestamp-query":{"source":"iana"},"application/timestamp-reply":{"source":"iana"},"application/timestamped-data":{"source":"iana","extensions":["tsd"]},"application/tlsrpt+gzip":{"source":"iana"},"application/tlsrpt+json":{"source":"iana","compressible":true},"application/tnauthlist":{"source":"iana"},"application/token-introspection+jwt":{"source":"iana"},"application/toml":{"compressible":true,"extensions":["toml"]},"application/trickle-ice-sdpfrag":{"source":"iana"},"application/trig":{"source":"iana","extensions":["trig"]},"application/ttml+xml":{"source":"iana","compressible":true,"extensions":["ttml"]},"application/tve-trigger":{"source":"iana"},"application/tzif":{"source":"iana"},"application/tzif-leap":{"source":"iana"},"application/ubjson":{"compressible":false,"extensions":["ubj"]},"application/ulpfec":{"source":"iana"},"application/urc-grpsheet+xml":{"source":"iana","compressible":true},"application/urc-ressheet+xml":{"source":"iana","compressible":true,"extensions":["rsheet"]},"application/urc-targetdesc+xml":{"source":"iana","compressible":true,"extensions":["td"]},"application/urc-uisocketdesc+xml":{"source":"iana","compressible":true},"application/vcard+json":{"source":"iana","compressible":true},"application/vcard+xml":{"source":"iana","compressible":true},"application/vemmi":{"source":"iana"},"application/vividence.scriptfile":{"source":"apache"},"application/vnd.1000minds.decision-model+xml":{"source":"iana","compressible":true,"extensions":["1km"]},"application/vnd.3gpp-prose+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose-pc3ch+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-v2x-local-service-information":{"source":"iana"},"application/vnd.3gpp.5gnas":{"source":"iana"},"application/vnd.3gpp.access-transfer-events+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.bsf+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gmop+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gtpc":{"source":"iana"},"application/vnd.3gpp.interworking-data":{"source":"iana"},"application/vnd.3gpp.lpp":{"source":"iana"},"application/vnd.3gpp.mc-signalling-ear":{"source":"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-payload":{"source":"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-signalling":{"source":"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-floor-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-signed+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-init-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-transmission-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mid-call+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ngap":{"source":"iana"},"application/vnd.3gpp.pfcp":{"source":"iana"},"application/vnd.3gpp.pic-bw-large":{"source":"iana","extensions":["plb"]},"application/vnd.3gpp.pic-bw-small":{"source":"iana","extensions":["psb"]},"application/vnd.3gpp.pic-bw-var":{"source":"iana","extensions":["pvb"]},"application/vnd.3gpp.s1ap":{"source":"iana"},"application/vnd.3gpp.sms":{"source":"iana"},"application/vnd.3gpp.sms+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-ext+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.state-and-event-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ussd+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.bcmcsinfo+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.sms":{"source":"iana"},"application/vnd.3gpp2.tcap":{"source":"iana","extensions":["tcap"]},"application/vnd.3lightssoftware.imagescal":{"source":"iana"},"application/vnd.3m.post-it-notes":{"source":"iana","extensions":["pwn"]},"application/vnd.accpac.simply.aso":{"source":"iana","extensions":["aso"]},"application/vnd.accpac.simply.imp":{"source":"iana","extensions":["imp"]},"application/vnd.acucobol":{"source":"iana","extensions":["acu"]},"application/vnd.acucorp":{"source":"iana","extensions":["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{"source":"apache","compressible":false,"extensions":["air"]},"application/vnd.adobe.flash.movie":{"source":"iana"},"application/vnd.adobe.formscentral.fcdt":{"source":"iana","extensions":["fcdt"]},"application/vnd.adobe.fxp":{"source":"iana","extensions":["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{"source":"iana"},"application/vnd.adobe.xdp+xml":{"source":"iana","compressible":true,"extensions":["xdp"]},"application/vnd.adobe.xfdf":{"source":"iana","extensions":["xfdf"]},"application/vnd.aether.imp":{"source":"iana"},"application/vnd.afpc.afplinedata":{"source":"iana"},"application/vnd.afpc.afplinedata-pagedef":{"source":"iana"},"application/vnd.afpc.cmoca-cmresource":{"source":"iana"},"application/vnd.afpc.foca-charset":{"source":"iana"},"application/vnd.afpc.foca-codedfont":{"source":"iana"},"application/vnd.afpc.foca-codepage":{"source":"iana"},"application/vnd.afpc.modca":{"source":"iana"},"application/vnd.afpc.modca-cmtable":{"source":"iana"},"application/vnd.afpc.modca-formdef":{"source":"iana"},"application/vnd.afpc.modca-mediummap":{"source":"iana"},"application/vnd.afpc.modca-objectcontainer":{"source":"iana"},"application/vnd.afpc.modca-overlay":{"source":"iana"},"application/vnd.afpc.modca-pagesegment":{"source":"iana"},"application/vnd.age":{"source":"iana","extensions":["age"]},"application/vnd.ah-barcode":{"source":"iana"},"application/vnd.ahead.space":{"source":"iana","extensions":["ahead"]},"application/vnd.airzip.filesecure.azf":{"source":"iana","extensions":["azf"]},"application/vnd.airzip.filesecure.azs":{"source":"iana","extensions":["azs"]},"application/vnd.amadeus+json":{"source":"iana","compressible":true},"application/vnd.amazon.ebook":{"source":"apache","extensions":["azw"]},"application/vnd.amazon.mobi8-ebook":{"source":"iana"},"application/vnd.americandynamics.acc":{"source":"iana","extensions":["acc"]},"application/vnd.amiga.ami":{"source":"iana","extensions":["ami"]},"application/vnd.amundsen.maze+xml":{"source":"iana","compressible":true},"application/vnd.android.ota":{"source":"iana"},"application/vnd.android.package-archive":{"source":"apache","compressible":false,"extensions":["apk"]},"application/vnd.anki":{"source":"iana"},"application/vnd.anser-web-certificate-issue-initiation":{"source":"iana","extensions":["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{"source":"apache","extensions":["fti"]},"application/vnd.antix.game-component":{"source":"iana","extensions":["atx"]},"application/vnd.apache.arrow.file":{"source":"iana"},"application/vnd.apache.arrow.stream":{"source":"iana"},"application/vnd.apache.thrift.binary":{"source":"iana"},"application/vnd.apache.thrift.compact":{"source":"iana"},"application/vnd.apache.thrift.json":{"source":"iana"},"application/vnd.api+json":{"source":"iana","compressible":true},"application/vnd.aplextor.warrp+json":{"source":"iana","compressible":true},"application/vnd.apothekende.reservation+json":{"source":"iana","compressible":true},"application/vnd.apple.installer+xml":{"source":"iana","compressible":true,"extensions":["mpkg"]},"application/vnd.apple.keynote":{"source":"iana","extensions":["key"]},"application/vnd.apple.mpegurl":{"source":"iana","extensions":["m3u8"]},"application/vnd.apple.numbers":{"source":"iana","extensions":["numbers"]},"application/vnd.apple.pages":{"source":"iana","extensions":["pages"]},"application/vnd.apple.pkpass":{"compressible":false,"extensions":["pkpass"]},"application/vnd.arastra.swi":{"source":"iana"},"application/vnd.aristanetworks.swi":{"source":"iana","extensions":["swi"]},"application/vnd.artisan+json":{"source":"iana","compressible":true},"application/vnd.artsquare":{"source":"iana"},"application/vnd.astraea-software.iota":{"source":"iana","extensions":["iota"]},"application/vnd.audiograph":{"source":"iana","extensions":["aep"]},"application/vnd.autopackage":{"source":"iana"},"application/vnd.avalon+json":{"source":"iana","compressible":true},"application/vnd.avistar+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmml+xml":{"source":"iana","compressible":true,"extensions":["bmml"]},"application/vnd.balsamiq.bmpr":{"source":"iana"},"application/vnd.banana-accounting":{"source":"iana"},"application/vnd.bbf.usp.error":{"source":"iana"},"application/vnd.bbf.usp.msg":{"source":"iana"},"application/vnd.bbf.usp.msg+json":{"source":"iana","compressible":true},"application/vnd.bekitzur-stech+json":{"source":"iana","compressible":true},"application/vnd.bint.med-content":{"source":"iana"},"application/vnd.biopax.rdf+xml":{"source":"iana","compressible":true},"application/vnd.blink-idb-value-wrapper":{"source":"iana"},"application/vnd.blueice.multipass":{"source":"iana","extensions":["mpm"]},"application/vnd.bluetooth.ep.oob":{"source":"iana"},"application/vnd.bluetooth.le.oob":{"source":"iana"},"application/vnd.bmi":{"source":"iana","extensions":["bmi"]},"application/vnd.bpf":{"source":"iana"},"application/vnd.bpf3":{"source":"iana"},"application/vnd.businessobjects":{"source":"iana","extensions":["rep"]},"application/vnd.byu.uapi+json":{"source":"iana","compressible":true},"application/vnd.cab-jscript":{"source":"iana"},"application/vnd.canon-cpdl":{"source":"iana"},"application/vnd.canon-lips":{"source":"iana"},"application/vnd.capasystems-pg+json":{"source":"iana","compressible":true},"application/vnd.cendio.thinlinc.clientconf":{"source":"iana"},"application/vnd.century-systems.tcp_stream":{"source":"iana"},"application/vnd.chemdraw+xml":{"source":"iana","compressible":true,"extensions":["cdxml"]},"application/vnd.chess-pgn":{"source":"iana"},"application/vnd.chipnuts.karaoke-mmd":{"source":"iana","extensions":["mmd"]},"application/vnd.ciedi":{"source":"iana"},"application/vnd.cinderella":{"source":"iana","extensions":["cdy"]},"application/vnd.cirpack.isdn-ext":{"source":"iana"},"application/vnd.citationstyles.style+xml":{"source":"iana","compressible":true,"extensions":["csl"]},"application/vnd.claymore":{"source":"iana","extensions":["cla"]},"application/vnd.cloanto.rp9":{"source":"iana","extensions":["rp9"]},"application/vnd.clonk.c4group":{"source":"iana","extensions":["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{"source":"iana","extensions":["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{"source":"iana","extensions":["c11amz"]},"application/vnd.coffeescript":{"source":"iana"},"application/vnd.collabio.xodocuments.document":{"source":"iana"},"application/vnd.collabio.xodocuments.document-template":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation-template":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{"source":"iana"},"application/vnd.collection+json":{"source":"iana","compressible":true},"application/vnd.collection.doc+json":{"source":"iana","compressible":true},"application/vnd.collection.next+json":{"source":"iana","compressible":true},"application/vnd.comicbook+zip":{"source":"iana","compressible":false},"application/vnd.comicbook-rar":{"source":"iana"},"application/vnd.commerce-battelle":{"source":"iana"},"application/vnd.commonspace":{"source":"iana","extensions":["csp"]},"application/vnd.contact.cmsg":{"source":"iana","extensions":["cdbcmsg"]},"application/vnd.coreos.ignition+json":{"source":"iana","compressible":true},"application/vnd.cosmocaller":{"source":"iana","extensions":["cmc"]},"application/vnd.crick.clicker":{"source":"iana","extensions":["clkx"]},"application/vnd.crick.clicker.keyboard":{"source":"iana","extensions":["clkk"]},"application/vnd.crick.clicker.palette":{"source":"iana","extensions":["clkp"]},"application/vnd.crick.clicker.template":{"source":"iana","extensions":["clkt"]},"application/vnd.crick.clicker.wordbank":{"source":"iana","extensions":["clkw"]},"application/vnd.criticaltools.wbs+xml":{"source":"iana","compressible":true,"extensions":["wbs"]},"application/vnd.cryptii.pipe+json":{"source":"iana","compressible":true},"application/vnd.crypto-shade-file":{"source":"iana"},"application/vnd.cryptomator.encrypted":{"source":"iana"},"application/vnd.cryptomator.vault":{"source":"iana"},"application/vnd.ctc-posml":{"source":"iana","extensions":["pml"]},"application/vnd.ctct.ws+xml":{"source":"iana","compressible":true},"application/vnd.cups-pdf":{"source":"iana"},"application/vnd.cups-postscript":{"source":"iana"},"application/vnd.cups-ppd":{"source":"iana","extensions":["ppd"]},"application/vnd.cups-raster":{"source":"iana"},"application/vnd.cups-raw":{"source":"iana"},"application/vnd.curl":{"source":"iana"},"application/vnd.curl.car":{"source":"apache","extensions":["car"]},"application/vnd.curl.pcurl":{"source":"apache","extensions":["pcurl"]},"application/vnd.cyan.dean.root+xml":{"source":"iana","compressible":true},"application/vnd.cybank":{"source":"iana"},"application/vnd.cyclonedx+json":{"source":"iana","compressible":true},"application/vnd.cyclonedx+xml":{"source":"iana","compressible":true},"application/vnd.d2l.coursepackage1p0+zip":{"source":"iana","compressible":false},"application/vnd.d3m-dataset":{"source":"iana"},"application/vnd.d3m-problem":{"source":"iana"},"application/vnd.dart":{"source":"iana","compressible":true,"extensions":["dart"]},"application/vnd.data-vision.rdz":{"source":"iana","extensions":["rdz"]},"application/vnd.datapackage+json":{"source":"iana","compressible":true},"application/vnd.dataresource+json":{"source":"iana","compressible":true},"application/vnd.dbf":{"source":"iana","extensions":["dbf"]},"application/vnd.debian.binary-package":{"source":"iana"},"application/vnd.dece.data":{"source":"iana","extensions":["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{"source":"iana","compressible":true,"extensions":["uvt","uvvt"]},"application/vnd.dece.unspecified":{"source":"iana","extensions":["uvx","uvvx"]},"application/vnd.dece.zip":{"source":"iana","extensions":["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{"source":"iana","extensions":["fe_launch"]},"application/vnd.desmume.movie":{"source":"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{"source":"iana"},"application/vnd.dm.delegation+xml":{"source":"iana","compressible":true},"application/vnd.dna":{"source":"iana","extensions":["dna"]},"application/vnd.document+json":{"source":"iana","compressible":true},"application/vnd.dolby.mlp":{"source":"apache","extensions":["mlp"]},"application/vnd.dolby.mobile.1":{"source":"iana"},"application/vnd.dolby.mobile.2":{"source":"iana"},"application/vnd.doremir.scorecloud-binary-document":{"source":"iana"},"application/vnd.dpgraph":{"source":"iana","extensions":["dpg"]},"application/vnd.dreamfactory":{"source":"iana","extensions":["dfac"]},"application/vnd.drive+json":{"source":"iana","compressible":true},"application/vnd.ds-keypoint":{"source":"apache","extensions":["kpxx"]},"application/vnd.dtg.local":{"source":"iana"},"application/vnd.dtg.local.flash":{"source":"iana"},"application/vnd.dtg.local.html":{"source":"iana"},"application/vnd.dvb.ait":{"source":"iana","extensions":["ait"]},"application/vnd.dvb.dvbisl+xml":{"source":"iana","compressible":true},"application/vnd.dvb.dvbj":{"source":"iana"},"application/vnd.dvb.esgcontainer":{"source":"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess2":{"source":"iana"},"application/vnd.dvb.ipdcesgpdd":{"source":"iana"},"application/vnd.dvb.ipdcroaming":{"source":"iana"},"application/vnd.dvb.iptv.alfec-base":{"source":"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{"source":"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-container+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-generic+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-msglist+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-request+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-response+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-init+xml":{"source":"iana","compressible":true},"application/vnd.dvb.pfr":{"source":"iana"},"application/vnd.dvb.service":{"source":"iana","extensions":["svc"]},"application/vnd.dxr":{"source":"iana"},"application/vnd.dynageo":{"source":"iana","extensions":["geo"]},"application/vnd.dzr":{"source":"iana"},"application/vnd.easykaraoke.cdgdownload":{"source":"iana"},"application/vnd.ecdis-update":{"source":"iana"},"application/vnd.ecip.rlp":{"source":"iana"},"application/vnd.eclipse.ditto+json":{"source":"iana","compressible":true},"application/vnd.ecowin.chart":{"source":"iana","extensions":["mag"]},"application/vnd.ecowin.filerequest":{"source":"iana"},"application/vnd.ecowin.fileupdate":{"source":"iana"},"application/vnd.ecowin.series":{"source":"iana"},"application/vnd.ecowin.seriesrequest":{"source":"iana"},"application/vnd.ecowin.seriesupdate":{"source":"iana"},"application/vnd.efi.img":{"source":"iana"},"application/vnd.efi.iso":{"source":"iana"},"application/vnd.emclient.accessrequest+xml":{"source":"iana","compressible":true},"application/vnd.enliven":{"source":"iana","extensions":["nml"]},"application/vnd.enphase.envoy":{"source":"iana"},"application/vnd.eprints.data+xml":{"source":"iana","compressible":true},"application/vnd.epson.esf":{"source":"iana","extensions":["esf"]},"application/vnd.epson.msf":{"source":"iana","extensions":["msf"]},"application/vnd.epson.quickanime":{"source":"iana","extensions":["qam"]},"application/vnd.epson.salt":{"source":"iana","extensions":["slt"]},"application/vnd.epson.ssf":{"source":"iana","extensions":["ssf"]},"application/vnd.ericsson.quickcall":{"source":"iana"},"application/vnd.espass-espass+zip":{"source":"iana","compressible":false},"application/vnd.eszigno3+xml":{"source":"iana","compressible":true,"extensions":["es3","et3"]},"application/vnd.etsi.aoc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.asic-e+zip":{"source":"iana","compressible":false},"application/vnd.etsi.asic-s+zip":{"source":"iana","compressible":false},"application/vnd.etsi.cug+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvcommand+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-bc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-cod+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-npvr+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvservice+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsync+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvueprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mcid+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mheg5":{"source":"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{"source":"iana","compressible":true},"application/vnd.etsi.pstn+xml":{"source":"iana","compressible":true},"application/vnd.etsi.sci+xml":{"source":"iana","compressible":true},"application/vnd.etsi.simservs+xml":{"source":"iana","compressible":true},"application/vnd.etsi.timestamp-token":{"source":"iana"},"application/vnd.etsi.tsl+xml":{"source":"iana","compressible":true},"application/vnd.etsi.tsl.der":{"source":"iana"},"application/vnd.eu.kasparian.car+json":{"source":"iana","compressible":true},"application/vnd.eudora.data":{"source":"iana"},"application/vnd.evolv.ecig.profile":{"source":"iana"},"application/vnd.evolv.ecig.settings":{"source":"iana"},"application/vnd.evolv.ecig.theme":{"source":"iana"},"application/vnd.exstream-empower+zip":{"source":"iana","compressible":false},"application/vnd.exstream-package":{"source":"iana"},"application/vnd.ezpix-album":{"source":"iana","extensions":["ez2"]},"application/vnd.ezpix-package":{"source":"iana","extensions":["ez3"]},"application/vnd.f-secure.mobile":{"source":"iana"},"application/vnd.familysearch.gedcom+zip":{"source":"iana","compressible":false},"application/vnd.fastcopy-disk-image":{"source":"iana"},"application/vnd.fdf":{"source":"iana","extensions":["fdf"]},"application/vnd.fdsn.mseed":{"source":"iana","extensions":["mseed"]},"application/vnd.fdsn.seed":{"source":"iana","extensions":["seed","dataless"]},"application/vnd.ffsns":{"source":"iana"},"application/vnd.ficlab.flb+zip":{"source":"iana","compressible":false},"application/vnd.filmit.zfc":{"source":"iana"},"application/vnd.fints":{"source":"iana"},"application/vnd.firemonkeys.cloudcell":{"source":"iana"},"application/vnd.flographit":{"source":"iana","extensions":["gph"]},"application/vnd.fluxtime.clip":{"source":"iana","extensions":["ftc"]},"application/vnd.font-fontforge-sfd":{"source":"iana"},"application/vnd.framemaker":{"source":"iana","extensions":["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{"source":"iana","extensions":["fnc"]},"application/vnd.frogans.ltf":{"source":"iana","extensions":["ltf"]},"application/vnd.fsc.weblaunch":{"source":"iana","extensions":["fsc"]},"application/vnd.fujifilm.fb.docuworks":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.container":{"source":"iana"},"application/vnd.fujifilm.fb.jfi+xml":{"source":"iana","compressible":true},"application/vnd.fujitsu.oasys":{"source":"iana","extensions":["oas"]},"application/vnd.fujitsu.oasys2":{"source":"iana","extensions":["oa2"]},"application/vnd.fujitsu.oasys3":{"source":"iana","extensions":["oa3"]},"application/vnd.fujitsu.oasysgp":{"source":"iana","extensions":["fg5"]},"application/vnd.fujitsu.oasysprs":{"source":"iana","extensions":["bh2"]},"application/vnd.fujixerox.art-ex":{"source":"iana"},"application/vnd.fujixerox.art4":{"source":"iana"},"application/vnd.fujixerox.ddd":{"source":"iana","extensions":["ddd"]},"application/vnd.fujixerox.docuworks":{"source":"iana","extensions":["xdw"]},"application/vnd.fujixerox.docuworks.binder":{"source":"iana","extensions":["xbd"]},"application/vnd.fujixerox.docuworks.container":{"source":"iana"},"application/vnd.fujixerox.hbpl":{"source":"iana"},"application/vnd.fut-misnet":{"source":"iana"},"application/vnd.futoin+cbor":{"source":"iana"},"application/vnd.futoin+json":{"source":"iana","compressible":true},"application/vnd.fuzzysheet":{"source":"iana","extensions":["fzs"]},"application/vnd.genomatix.tuxedo":{"source":"iana","extensions":["txd"]},"application/vnd.gentics.grd+json":{"source":"iana","compressible":true},"application/vnd.geo+json":{"source":"iana","compressible":true},"application/vnd.geocube+xml":{"source":"iana","compressible":true},"application/vnd.geogebra.file":{"source":"iana","extensions":["ggb"]},"application/vnd.geogebra.slides":{"source":"iana"},"application/vnd.geogebra.tool":{"source":"iana","extensions":["ggt"]},"application/vnd.geometry-explorer":{"source":"iana","extensions":["gex","gre"]},"application/vnd.geonext":{"source":"iana","extensions":["gxt"]},"application/vnd.geoplan":{"source":"iana","extensions":["g2w"]},"application/vnd.geospace":{"source":"iana","extensions":["g3w"]},"application/vnd.gerber":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt-response":{"source":"iana"},"application/vnd.gmx":{"source":"iana","extensions":["gmx"]},"application/vnd.google-apps.document":{"compressible":false,"extensions":["gdoc"]},"application/vnd.google-apps.presentation":{"compressible":false,"extensions":["gslides"]},"application/vnd.google-apps.spreadsheet":{"compressible":false,"extensions":["gsheet"]},"application/vnd.google-earth.kml+xml":{"source":"iana","compressible":true,"extensions":["kml"]},"application/vnd.google-earth.kmz":{"source":"iana","compressible":false,"extensions":["kmz"]},"application/vnd.gov.sk.e-form+xml":{"source":"iana","compressible":true},"application/vnd.gov.sk.e-form+zip":{"source":"iana","compressible":false},"application/vnd.gov.sk.xmldatacontainer+xml":{"source":"iana","compressible":true},"application/vnd.grafeq":{"source":"iana","extensions":["gqf","gqs"]},"application/vnd.gridmp":{"source":"iana"},"application/vnd.groove-account":{"source":"iana","extensions":["gac"]},"application/vnd.groove-help":{"source":"iana","extensions":["ghf"]},"application/vnd.groove-identity-message":{"source":"iana","extensions":["gim"]},"application/vnd.groove-injector":{"source":"iana","extensions":["grv"]},"application/vnd.groove-tool-message":{"source":"iana","extensions":["gtm"]},"application/vnd.groove-tool-template":{"source":"iana","extensions":["tpl"]},"application/vnd.groove-vcard":{"source":"iana","extensions":["vcg"]},"application/vnd.hal+json":{"source":"iana","compressible":true},"application/vnd.hal+xml":{"source":"iana","compressible":true,"extensions":["hal"]},"application/vnd.handheld-entertainment+xml":{"source":"iana","compressible":true,"extensions":["zmm"]},"application/vnd.hbci":{"source":"iana","extensions":["hbci"]},"application/vnd.hc+json":{"source":"iana","compressible":true},"application/vnd.hcl-bireports":{"source":"iana"},"application/vnd.hdt":{"source":"iana"},"application/vnd.heroku+json":{"source":"iana","compressible":true},"application/vnd.hhe.lesson-player":{"source":"iana","extensions":["les"]},"application/vnd.hl7cda+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.hl7v2+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.hp-hpgl":{"source":"iana","extensions":["hpgl"]},"application/vnd.hp-hpid":{"source":"iana","extensions":["hpid"]},"application/vnd.hp-hps":{"source":"iana","extensions":["hps"]},"application/vnd.hp-jlyt":{"source":"iana","extensions":["jlt"]},"application/vnd.hp-pcl":{"source":"iana","extensions":["pcl"]},"application/vnd.hp-pclxl":{"source":"iana","extensions":["pclxl"]},"application/vnd.httphone":{"source":"iana"},"application/vnd.hydrostatix.sof-data":{"source":"iana","extensions":["sfd-hdstx"]},"application/vnd.hyper+json":{"source":"iana","compressible":true},"application/vnd.hyper-item+json":{"source":"iana","compressible":true},"application/vnd.hyperdrive+json":{"source":"iana","compressible":true},"application/vnd.hzn-3d-crossword":{"source":"iana"},"application/vnd.ibm.afplinedata":{"source":"iana"},"application/vnd.ibm.electronic-media":{"source":"iana"},"application/vnd.ibm.minipay":{"source":"iana","extensions":["mpy"]},"application/vnd.ibm.modcap":{"source":"iana","extensions":["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{"source":"iana","extensions":["irm"]},"application/vnd.ibm.secure-container":{"source":"iana","extensions":["sc"]},"application/vnd.iccprofile":{"source":"iana","extensions":["icc","icm"]},"application/vnd.ieee.1905":{"source":"iana"},"application/vnd.igloader":{"source":"iana","extensions":["igl"]},"application/vnd.imagemeter.folder+zip":{"source":"iana","compressible":false},"application/vnd.imagemeter.image+zip":{"source":"iana","compressible":false},"application/vnd.immervision-ivp":{"source":"iana","extensions":["ivp"]},"application/vnd.immervision-ivu":{"source":"iana","extensions":["ivu"]},"application/vnd.ims.imsccv1p1":{"source":"iana"},"application/vnd.ims.imsccv1p2":{"source":"iana"},"application/vnd.ims.imsccv1p3":{"source":"iana"},"application/vnd.ims.lis.v2.result+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy.id+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings.simple+json":{"source":"iana","compressible":true},"application/vnd.informedcontrol.rms+xml":{"source":"iana","compressible":true},"application/vnd.informix-visionary":{"source":"iana"},"application/vnd.infotech.project":{"source":"iana"},"application/vnd.infotech.project+xml":{"source":"iana","compressible":true},"application/vnd.innopath.wamp.notification":{"source":"iana"},"application/vnd.insors.igm":{"source":"iana","extensions":["igm"]},"application/vnd.intercon.formnet":{"source":"iana","extensions":["xpw","xpx"]},"application/vnd.intergeo":{"source":"iana","extensions":["i2g"]},"application/vnd.intertrust.digibox":{"source":"iana"},"application/vnd.intertrust.nncp":{"source":"iana"},"application/vnd.intu.qbo":{"source":"iana","extensions":["qbo"]},"application/vnd.intu.qfx":{"source":"iana","extensions":["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.conceptitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.knowledgeitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsmessage+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.packageitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.planningitem+xml":{"source":"iana","compressible":true},"application/vnd.ipunplugged.rcprofile":{"source":"iana","extensions":["rcprofile"]},"application/vnd.irepository.package+xml":{"source":"iana","compressible":true,"extensions":["irp"]},"application/vnd.is-xpr":{"source":"iana","extensions":["xpr"]},"application/vnd.isac.fcs":{"source":"iana","extensions":["fcs"]},"application/vnd.iso11783-10+zip":{"source":"iana","compressible":false},"application/vnd.jam":{"source":"iana","extensions":["jam"]},"application/vnd.japannet-directory-service":{"source":"iana"},"application/vnd.japannet-jpnstore-wakeup":{"source":"iana"},"application/vnd.japannet-payment-wakeup":{"source":"iana"},"application/vnd.japannet-registration":{"source":"iana"},"application/vnd.japannet-registration-wakeup":{"source":"iana"},"application/vnd.japannet-setstore-wakeup":{"source":"iana"},"application/vnd.japannet-verification":{"source":"iana"},"application/vnd.japannet-verification-wakeup":{"source":"iana"},"application/vnd.jcp.javame.midlet-rms":{"source":"iana","extensions":["rms"]},"application/vnd.jisp":{"source":"iana","extensions":["jisp"]},"application/vnd.joost.joda-archive":{"source":"iana","extensions":["joda"]},"application/vnd.jsk.isdn-ngn":{"source":"iana"},"application/vnd.kahootz":{"source":"iana","extensions":["ktz","ktr"]},"application/vnd.kde.karbon":{"source":"iana","extensions":["karbon"]},"application/vnd.kde.kchart":{"source":"iana","extensions":["chrt"]},"application/vnd.kde.kformula":{"source":"iana","extensions":["kfo"]},"application/vnd.kde.kivio":{"source":"iana","extensions":["flw"]},"application/vnd.kde.kontour":{"source":"iana","extensions":["kon"]},"application/vnd.kde.kpresenter":{"source":"iana","extensions":["kpr","kpt"]},"application/vnd.kde.kspread":{"source":"iana","extensions":["ksp"]},"application/vnd.kde.kword":{"source":"iana","extensions":["kwd","kwt"]},"application/vnd.kenameaapp":{"source":"iana","extensions":["htke"]},"application/vnd.kidspiration":{"source":"iana","extensions":["kia"]},"application/vnd.kinar":{"source":"iana","extensions":["kne","knp"]},"application/vnd.koan":{"source":"iana","extensions":["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{"source":"iana","extensions":["sse"]},"application/vnd.las":{"source":"iana"},"application/vnd.las.las+json":{"source":"iana","compressible":true},"application/vnd.las.las+xml":{"source":"iana","compressible":true,"extensions":["lasxml"]},"application/vnd.laszip":{"source":"iana"},"application/vnd.leap+json":{"source":"iana","compressible":true},"application/vnd.liberty-request+xml":{"source":"iana","compressible":true},"application/vnd.llamagraphics.life-balance.desktop":{"source":"iana","extensions":["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{"source":"iana","compressible":true,"extensions":["lbe"]},"application/vnd.logipipe.circuit+zip":{"source":"iana","compressible":false},"application/vnd.loom":{"source":"iana"},"application/vnd.lotus-1-2-3":{"source":"iana","extensions":["123"]},"application/vnd.lotus-approach":{"source":"iana","extensions":["apr"]},"application/vnd.lotus-freelance":{"source":"iana","extensions":["pre"]},"application/vnd.lotus-notes":{"source":"iana","extensions":["nsf"]},"application/vnd.lotus-organizer":{"source":"iana","extensions":["org"]},"application/vnd.lotus-screencam":{"source":"iana","extensions":["scm"]},"application/vnd.lotus-wordpro":{"source":"iana","extensions":["lwp"]},"application/vnd.macports.portpkg":{"source":"iana","extensions":["portpkg"]},"application/vnd.mapbox-vector-tile":{"source":"iana","extensions":["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.conftoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.license+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.mdcf":{"source":"iana"},"application/vnd.mason+json":{"source":"iana","compressible":true},"application/vnd.maxar.archive.3tz+zip":{"source":"iana","compressible":false},"application/vnd.maxmind.maxmind-db":{"source":"iana"},"application/vnd.mcd":{"source":"iana","extensions":["mcd"]},"application/vnd.medcalcdata":{"source":"iana","extensions":["mc1"]},"application/vnd.mediastation.cdkey":{"source":"iana","extensions":["cdkey"]},"application/vnd.meridian-slingshot":{"source":"iana"},"application/vnd.mfer":{"source":"iana","extensions":["mwf"]},"application/vnd.mfmp":{"source":"iana","extensions":["mfm"]},"application/vnd.micro+json":{"source":"iana","compressible":true},"application/vnd.micrografx.flo":{"source":"iana","extensions":["flo"]},"application/vnd.micrografx.igx":{"source":"iana","extensions":["igx"]},"application/vnd.microsoft.portable-executable":{"source":"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{"source":"iana"},"application/vnd.miele+json":{"source":"iana","compressible":true},"application/vnd.mif":{"source":"iana","extensions":["mif"]},"application/vnd.minisoft-hp3000-save":{"source":"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{"source":"iana"},"application/vnd.mobius.daf":{"source":"iana","extensions":["daf"]},"application/vnd.mobius.dis":{"source":"iana","extensions":["dis"]},"application/vnd.mobius.mbk":{"source":"iana","extensions":["mbk"]},"application/vnd.mobius.mqy":{"source":"iana","extensions":["mqy"]},"application/vnd.mobius.msl":{"source":"iana","extensions":["msl"]},"application/vnd.mobius.plc":{"source":"iana","extensions":["plc"]},"application/vnd.mobius.txf":{"source":"iana","extensions":["txf"]},"application/vnd.mophun.application":{"source":"iana","extensions":["mpn"]},"application/vnd.mophun.certificate":{"source":"iana","extensions":["mpc"]},"application/vnd.motorola.flexsuite":{"source":"iana"},"application/vnd.motorola.flexsuite.adsi":{"source":"iana"},"application/vnd.motorola.flexsuite.fis":{"source":"iana"},"application/vnd.motorola.flexsuite.gotap":{"source":"iana"},"application/vnd.motorola.flexsuite.kmr":{"source":"iana"},"application/vnd.motorola.flexsuite.ttc":{"source":"iana"},"application/vnd.motorola.flexsuite.wem":{"source":"iana"},"application/vnd.motorola.iprm":{"source":"iana"},"application/vnd.mozilla.xul+xml":{"source":"iana","compressible":true,"extensions":["xul"]},"application/vnd.ms-3mfdocument":{"source":"iana"},"application/vnd.ms-artgalry":{"source":"iana","extensions":["cil"]},"application/vnd.ms-asf":{"source":"iana"},"application/vnd.ms-cab-compressed":{"source":"iana","extensions":["cab"]},"application/vnd.ms-color.iccprofile":{"source":"apache"},"application/vnd.ms-excel":{"source":"iana","compressible":false,"extensions":["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{"source":"iana","extensions":["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{"source":"iana","extensions":["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{"source":"iana","extensions":["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{"source":"iana","extensions":["xltm"]},"application/vnd.ms-fontobject":{"source":"iana","compressible":true,"extensions":["eot"]},"application/vnd.ms-htmlhelp":{"source":"iana","extensions":["chm"]},"application/vnd.ms-ims":{"source":"iana","extensions":["ims"]},"application/vnd.ms-lrm":{"source":"iana","extensions":["lrm"]},"application/vnd.ms-office.activex+xml":{"source":"iana","compressible":true},"application/vnd.ms-officetheme":{"source":"iana","extensions":["thmx"]},"application/vnd.ms-opentype":{"source":"apache","compressible":true},"application/vnd.ms-outlook":{"compressible":false,"extensions":["msg"]},"application/vnd.ms-package.obfuscated-opentype":{"source":"apache"},"application/vnd.ms-pki.seccat":{"source":"apache","extensions":["cat"]},"application/vnd.ms-pki.stl":{"source":"apache","extensions":["stl"]},"application/vnd.ms-playready.initiator+xml":{"source":"iana","compressible":true},"application/vnd.ms-powerpoint":{"source":"iana","compressible":false,"extensions":["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{"source":"iana","extensions":["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"source":"iana","extensions":["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{"source":"iana","extensions":["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"source":"iana","extensions":["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{"source":"iana","extensions":["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{"source":"iana","compressible":true},"application/vnd.ms-printing.printticket+xml":{"source":"apache","compressible":true},"application/vnd.ms-printschematicket+xml":{"source":"iana","compressible":true},"application/vnd.ms-project":{"source":"iana","extensions":["mpp","mpt"]},"application/vnd.ms-tnef":{"source":"iana"},"application/vnd.ms-windows.devicepairing":{"source":"iana"},"application/vnd.ms-windows.nwprinting.oob":{"source":"iana"},"application/vnd.ms-windows.printerpairing":{"source":"iana"},"application/vnd.ms-windows.wsd.oob":{"source":"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.lic-resp":{"source":"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.meter-resp":{"source":"iana"},"application/vnd.ms-word.document.macroenabled.12":{"source":"iana","extensions":["docm"]},"application/vnd.ms-word.template.macroenabled.12":{"source":"iana","extensions":["dotm"]},"application/vnd.ms-works":{"source":"iana","extensions":["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{"source":"iana","extensions":["wpl"]},"application/vnd.ms-xpsdocument":{"source":"iana","compressible":false,"extensions":["xps"]},"application/vnd.msa-disk-image":{"source":"iana"},"application/vnd.mseq":{"source":"iana","extensions":["mseq"]},"application/vnd.msign":{"source":"iana"},"application/vnd.multiad.creator":{"source":"iana"},"application/vnd.multiad.creator.cif":{"source":"iana"},"application/vnd.music-niff":{"source":"iana"},"application/vnd.musician":{"source":"iana","extensions":["mus"]},"application/vnd.muvee.style":{"source":"iana","extensions":["msty"]},"application/vnd.mynfc":{"source":"iana","extensions":["taglet"]},"application/vnd.nacamar.ybrid+json":{"source":"iana","compressible":true},"application/vnd.ncd.control":{"source":"iana"},"application/vnd.ncd.reference":{"source":"iana"},"application/vnd.nearst.inv+json":{"source":"iana","compressible":true},"application/vnd.nebumind.line":{"source":"iana"},"application/vnd.nervana":{"source":"iana"},"application/vnd.netfpx":{"source":"iana"},"application/vnd.neurolanguage.nlu":{"source":"iana","extensions":["nlu"]},"application/vnd.nimn":{"source":"iana"},"application/vnd.nintendo.nitro.rom":{"source":"iana"},"application/vnd.nintendo.snes.rom":{"source":"iana"},"application/vnd.nitf":{"source":"iana","extensions":["ntf","nitf"]},"application/vnd.noblenet-directory":{"source":"iana","extensions":["nnd"]},"application/vnd.noblenet-sealer":{"source":"iana","extensions":["nns"]},"application/vnd.noblenet-web":{"source":"iana","extensions":["nnw"]},"application/vnd.nokia.catalogs":{"source":"iana"},"application/vnd.nokia.conml+wbxml":{"source":"iana"},"application/vnd.nokia.conml+xml":{"source":"iana","compressible":true},"application/vnd.nokia.iptv.config+xml":{"source":"iana","compressible":true},"application/vnd.nokia.isds-radio-presets":{"source":"iana"},"application/vnd.nokia.landmark+wbxml":{"source":"iana"},"application/vnd.nokia.landmark+xml":{"source":"iana","compressible":true},"application/vnd.nokia.landmarkcollection+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.ac+xml":{"source":"iana","compressible":true,"extensions":["ac"]},"application/vnd.nokia.n-gage.data":{"source":"iana","extensions":["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{"source":"iana","extensions":["n-gage"]},"application/vnd.nokia.ncd":{"source":"iana"},"application/vnd.nokia.pcd+wbxml":{"source":"iana"},"application/vnd.nokia.pcd+xml":{"source":"iana","compressible":true},"application/vnd.nokia.radio-preset":{"source":"iana","extensions":["rpst"]},"application/vnd.nokia.radio-presets":{"source":"iana","extensions":["rpss"]},"application/vnd.novadigm.edm":{"source":"iana","extensions":["edm"]},"application/vnd.novadigm.edx":{"source":"iana","extensions":["edx"]},"application/vnd.novadigm.ext":{"source":"iana","extensions":["ext"]},"application/vnd.ntt-local.content-share":{"source":"iana"},"application/vnd.ntt-local.file-transfer":{"source":"iana"},"application/vnd.ntt-local.ogw_remote-access":{"source":"iana"},"application/vnd.ntt-local.sip-ta_remote":{"source":"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{"source":"iana"},"application/vnd.oasis.opendocument.chart":{"source":"iana","extensions":["odc"]},"application/vnd.oasis.opendocument.chart-template":{"source":"iana","extensions":["otc"]},"application/vnd.oasis.opendocument.database":{"source":"iana","extensions":["odb"]},"application/vnd.oasis.opendocument.formula":{"source":"iana","extensions":["odf"]},"application/vnd.oasis.opendocument.formula-template":{"source":"iana","extensions":["odft"]},"application/vnd.oasis.opendocument.graphics":{"source":"iana","compressible":false,"extensions":["odg"]},"application/vnd.oasis.opendocument.graphics-template":{"source":"iana","extensions":["otg"]},"application/vnd.oasis.opendocument.image":{"source":"iana","extensions":["odi"]},"application/vnd.oasis.opendocument.image-template":{"source":"iana","extensions":["oti"]},"application/vnd.oasis.opendocument.presentation":{"source":"iana","compressible":false,"extensions":["odp"]},"application/vnd.oasis.opendocument.presentation-template":{"source":"iana","extensions":["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{"source":"iana","compressible":false,"extensions":["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{"source":"iana","extensions":["ots"]},"application/vnd.oasis.opendocument.text":{"source":"iana","compressible":false,"extensions":["odt"]},"application/vnd.oasis.opendocument.text-master":{"source":"iana","extensions":["odm"]},"application/vnd.oasis.opendocument.text-template":{"source":"iana","extensions":["ott"]},"application/vnd.oasis.opendocument.text-web":{"source":"iana","extensions":["oth"]},"application/vnd.obn":{"source":"iana"},"application/vnd.ocf+cbor":{"source":"iana"},"application/vnd.oci.image.manifest.v1+json":{"source":"iana","compressible":true},"application/vnd.oftn.l10n+json":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessdownload+xml":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessstreaming+xml":{"source":"iana","compressible":true},"application/vnd.oipf.cspg-hexbinary":{"source":"iana"},"application/vnd.oipf.dae.svg+xml":{"source":"iana","compressible":true},"application/vnd.oipf.dae.xhtml+xml":{"source":"iana","compressible":true},"application/vnd.oipf.mippvcontrolmessage+xml":{"source":"iana","compressible":true},"application/vnd.oipf.pae.gem":{"source":"iana"},"application/vnd.oipf.spdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.oipf.spdlist+xml":{"source":"iana","compressible":true},"application/vnd.oipf.ueprofile+xml":{"source":"iana","compressible":true},"application/vnd.oipf.userprofile+xml":{"source":"iana","compressible":true},"application/vnd.olpc-sugar":{"source":"iana","extensions":["xo"]},"application/vnd.oma-scws-config":{"source":"iana"},"application/vnd.oma-scws-http-request":{"source":"iana"},"application/vnd.oma-scws-http-response":{"source":"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.drm-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.imd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.ltkm":{"source":"iana"},"application/vnd.oma.bcast.notification+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.provisioningtrigger":{"source":"iana"},"application/vnd.oma.bcast.sgboot":{"source":"iana"},"application/vnd.oma.bcast.sgdd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sgdu":{"source":"iana"},"application/vnd.oma.bcast.simple-symbol-container":{"source":"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sprov+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.stkm":{"source":"iana"},"application/vnd.oma.cab-address-book+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-feature-handler+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-pcc+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-subs-invite+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-user-prefs+xml":{"source":"iana","compressible":true},"application/vnd.oma.dcd":{"source":"iana"},"application/vnd.oma.dcdc":{"source":"iana"},"application/vnd.oma.dd2+xml":{"source":"iana","compressible":true,"extensions":["dd2"]},"application/vnd.oma.drm.risd+xml":{"source":"iana","compressible":true},"application/vnd.oma.group-usage-list+xml":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+cbor":{"source":"iana"},"application/vnd.oma.lwm2m+json":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+tlv":{"source":"iana"},"application/vnd.oma.pal+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.detailed-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.final-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.groups+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.invocation-descriptor+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.optimized-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.push":{"source":"iana"},"application/vnd.oma.scidm.messages+xml":{"source":"iana","compressible":true},"application/vnd.oma.xcap-directory+xml":{"source":"iana","compressible":true},"application/vnd.omads-email+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-file+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-folder+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omaloc-supl-init":{"source":"iana"},"application/vnd.onepager":{"source":"iana"},"application/vnd.onepagertamp":{"source":"iana"},"application/vnd.onepagertamx":{"source":"iana"},"application/vnd.onepagertat":{"source":"iana"},"application/vnd.onepagertatp":{"source":"iana"},"application/vnd.onepagertatx":{"source":"iana"},"application/vnd.openblox.game+xml":{"source":"iana","compressible":true,"extensions":["obgx"]},"application/vnd.openblox.game-binary":{"source":"iana"},"application/vnd.openeye.oeb":{"source":"iana"},"application/vnd.openofficeorg.extension":{"source":"apache","extensions":["oxt"]},"application/vnd.openstreetmap.data+xml":{"source":"iana","compressible":true,"extensions":["osm"]},"application/vnd.opentimestamps.ots":{"source":"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawing+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"source":"iana","compressible":false,"extensions":["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slide":{"source":"iana","extensions":["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"source":"iana","extensions":["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.template":{"source":"iana","extensions":["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"source":"iana","compressible":false,"extensions":["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"source":"iana","extensions":["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.theme+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.vmldrawing":{"source":"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"source":"iana","compressible":false,"extensions":["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"source":"iana","extensions":["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.core-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.relationships+xml":{"source":"iana","compressible":true},"application/vnd.oracle.resource+json":{"source":"iana","compressible":true},"application/vnd.orange.indata":{"source":"iana"},"application/vnd.osa.netdeploy":{"source":"iana"},"application/vnd.osgeo.mapguide.package":{"source":"iana","extensions":["mgp"]},"application/vnd.osgi.bundle":{"source":"iana"},"application/vnd.osgi.dp":{"source":"iana","extensions":["dp"]},"application/vnd.osgi.subsystem":{"source":"iana","extensions":["esa"]},"application/vnd.otps.ct-kip+xml":{"source":"iana","compressible":true},"application/vnd.oxli.countgraph":{"source":"iana"},"application/vnd.pagerduty+json":{"source":"iana","compressible":true},"application/vnd.palm":{"source":"iana","extensions":["pdb","pqa","oprc"]},"application/vnd.panoply":{"source":"iana"},"application/vnd.paos.xml":{"source":"iana"},"application/vnd.patentdive":{"source":"iana"},"application/vnd.patientecommsdoc":{"source":"iana"},"application/vnd.pawaafile":{"source":"iana","extensions":["paw"]},"application/vnd.pcos":{"source":"iana"},"application/vnd.pg.format":{"source":"iana","extensions":["str"]},"application/vnd.pg.osasli":{"source":"iana","extensions":["ei6"]},"application/vnd.piaccess.application-licence":{"source":"iana"},"application/vnd.picsel":{"source":"iana","extensions":["efif"]},"application/vnd.pmi.widget":{"source":"iana","extensions":["wg"]},"application/vnd.poc.group-advertisement+xml":{"source":"iana","compressible":true},"application/vnd.pocketlearn":{"source":"iana","extensions":["plf"]},"application/vnd.powerbuilder6":{"source":"iana","extensions":["pbd"]},"application/vnd.powerbuilder6-s":{"source":"iana"},"application/vnd.powerbuilder7":{"source":"iana"},"application/vnd.powerbuilder7-s":{"source":"iana"},"application/vnd.powerbuilder75":{"source":"iana"},"application/vnd.powerbuilder75-s":{"source":"iana"},"application/vnd.preminet":{"source":"iana"},"application/vnd.previewsystems.box":{"source":"iana","extensions":["box"]},"application/vnd.proteus.magazine":{"source":"iana","extensions":["mgz"]},"application/vnd.psfs":{"source":"iana"},"application/vnd.publishare-delta-tree":{"source":"iana","extensions":["qps"]},"application/vnd.pvi.ptid1":{"source":"iana","extensions":["ptid"]},"application/vnd.pwg-multiplexed":{"source":"iana"},"application/vnd.pwg-xhtml-print+xml":{"source":"iana","compressible":true},"application/vnd.qualcomm.brew-app-res":{"source":"iana"},"application/vnd.quarantainenet":{"source":"iana"},"application/vnd.quark.quarkxpress":{"source":"iana","extensions":["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{"source":"iana"},"application/vnd.radisys.moml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conn+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-stream+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-base+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-detect+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-group+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-speech+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-transform+xml":{"source":"iana","compressible":true},"application/vnd.rainstor.data":{"source":"iana"},"application/vnd.rapid":{"source":"iana"},"application/vnd.rar":{"source":"iana","extensions":["rar"]},"application/vnd.realvnc.bed":{"source":"iana","extensions":["bed"]},"application/vnd.recordare.musicxml":{"source":"iana","extensions":["mxl"]},"application/vnd.recordare.musicxml+xml":{"source":"iana","compressible":true,"extensions":["musicxml"]},"application/vnd.renlearn.rlprint":{"source":"iana"},"application/vnd.resilient.logic":{"source":"iana"},"application/vnd.restful+json":{"source":"iana","compressible":true},"application/vnd.rig.cryptonote":{"source":"iana","extensions":["cryptonote"]},"application/vnd.rim.cod":{"source":"apache","extensions":["cod"]},"application/vnd.rn-realmedia":{"source":"apache","extensions":["rm"]},"application/vnd.rn-realmedia-vbr":{"source":"apache","extensions":["rmvb"]},"application/vnd.route66.link66+xml":{"source":"iana","compressible":true,"extensions":["link66"]},"application/vnd.rs-274x":{"source":"iana"},"application/vnd.ruckus.download":{"source":"iana"},"application/vnd.s3sms":{"source":"iana"},"application/vnd.sailingtracker.track":{"source":"iana","extensions":["st"]},"application/vnd.sar":{"source":"iana"},"application/vnd.sbm.cid":{"source":"iana"},"application/vnd.sbm.mid2":{"source":"iana"},"application/vnd.scribus":{"source":"iana"},"application/vnd.sealed.3df":{"source":"iana"},"application/vnd.sealed.csf":{"source":"iana"},"application/vnd.sealed.doc":{"source":"iana"},"application/vnd.sealed.eml":{"source":"iana"},"application/vnd.sealed.mht":{"source":"iana"},"application/vnd.sealed.net":{"source":"iana"},"application/vnd.sealed.ppt":{"source":"iana"},"application/vnd.sealed.tiff":{"source":"iana"},"application/vnd.sealed.xls":{"source":"iana"},"application/vnd.sealedmedia.softseal.html":{"source":"iana"},"application/vnd.sealedmedia.softseal.pdf":{"source":"iana"},"application/vnd.seemail":{"source":"iana","extensions":["see"]},"application/vnd.seis+json":{"source":"iana","compressible":true},"application/vnd.sema":{"source":"iana","extensions":["sema"]},"application/vnd.semd":{"source":"iana","extensions":["semd"]},"application/vnd.semf":{"source":"iana","extensions":["semf"]},"application/vnd.shade-save-file":{"source":"iana"},"application/vnd.shana.informed.formdata":{"source":"iana","extensions":["ifm"]},"application/vnd.shana.informed.formtemplate":{"source":"iana","extensions":["itp"]},"application/vnd.shana.informed.interchange":{"source":"iana","extensions":["iif"]},"application/vnd.shana.informed.package":{"source":"iana","extensions":["ipk"]},"application/vnd.shootproof+json":{"source":"iana","compressible":true},"application/vnd.shopkick+json":{"source":"iana","compressible":true},"application/vnd.shp":{"source":"iana"},"application/vnd.shx":{"source":"iana"},"application/vnd.sigrok.session":{"source":"iana"},"application/vnd.simtech-mindmapper":{"source":"iana","extensions":["twd","twds"]},"application/vnd.siren+json":{"source":"iana","compressible":true},"application/vnd.smaf":{"source":"iana","extensions":["mmf"]},"application/vnd.smart.notebook":{"source":"iana"},"application/vnd.smart.teacher":{"source":"iana","extensions":["teacher"]},"application/vnd.snesdev-page-table":{"source":"iana"},"application/vnd.software602.filler.form+xml":{"source":"iana","compressible":true,"extensions":["fo"]},"application/vnd.software602.filler.form-xml-zip":{"source":"iana"},"application/vnd.solent.sdkm+xml":{"source":"iana","compressible":true,"extensions":["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{"source":"iana","extensions":["dxp"]},"application/vnd.spotfire.sfs":{"source":"iana","extensions":["sfs"]},"application/vnd.sqlite3":{"source":"iana"},"application/vnd.sss-cod":{"source":"iana"},"application/vnd.sss-dtf":{"source":"iana"},"application/vnd.sss-ntf":{"source":"iana"},"application/vnd.stardivision.calc":{"source":"apache","extensions":["sdc"]},"application/vnd.stardivision.draw":{"source":"apache","extensions":["sda"]},"application/vnd.stardivision.impress":{"source":"apache","extensions":["sdd"]},"application/vnd.stardivision.math":{"source":"apache","extensions":["smf"]},"application/vnd.stardivision.writer":{"source":"apache","extensions":["sdw","vor"]},"application/vnd.stardivision.writer-global":{"source":"apache","extensions":["sgl"]},"application/vnd.stepmania.package":{"source":"iana","extensions":["smzip"]},"application/vnd.stepmania.stepchart":{"source":"iana","extensions":["sm"]},"application/vnd.street-stream":{"source":"iana"},"application/vnd.sun.wadl+xml":{"source":"iana","compressible":true,"extensions":["wadl"]},"application/vnd.sun.xml.calc":{"source":"apache","extensions":["sxc"]},"application/vnd.sun.xml.calc.template":{"source":"apache","extensions":["stc"]},"application/vnd.sun.xml.draw":{"source":"apache","extensions":["sxd"]},"application/vnd.sun.xml.draw.template":{"source":"apache","extensions":["std"]},"application/vnd.sun.xml.impress":{"source":"apache","extensions":["sxi"]},"application/vnd.sun.xml.impress.template":{"source":"apache","extensions":["sti"]},"application/vnd.sun.xml.math":{"source":"apache","extensions":["sxm"]},"application/vnd.sun.xml.writer":{"source":"apache","extensions":["sxw"]},"application/vnd.sun.xml.writer.global":{"source":"apache","extensions":["sxg"]},"application/vnd.sun.xml.writer.template":{"source":"apache","extensions":["stw"]},"application/vnd.sus-calendar":{"source":"iana","extensions":["sus","susp"]},"application/vnd.svd":{"source":"iana","extensions":["svd"]},"application/vnd.swiftview-ics":{"source":"iana"},"application/vnd.sycle+xml":{"source":"iana","compressible":true},"application/vnd.syft+json":{"source":"iana","compressible":true},"application/vnd.symbian.install":{"source":"apache","extensions":["sis","sisx"]},"application/vnd.syncml+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xsm"]},"application/vnd.syncml.dm+wbxml":{"source":"iana","charset":"UTF-8","extensions":["bdm"]},"application/vnd.syncml.dm+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xdm"]},"application/vnd.syncml.dm.notification":{"source":"iana"},"application/vnd.syncml.dmddf+wbxml":{"source":"iana"},"application/vnd.syncml.dmddf+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{"source":"iana"},"application/vnd.syncml.dmtnds+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.syncml.ds.notification":{"source":"iana"},"application/vnd.tableschema+json":{"source":"iana","compressible":true},"application/vnd.tao.intent-module-archive":{"source":"iana","extensions":["tao"]},"application/vnd.tcpdump.pcap":{"source":"iana","extensions":["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{"source":"iana","compressible":true},"application/vnd.tmd.mediaflex.api+xml":{"source":"iana","compressible":true},"application/vnd.tml":{"source":"iana"},"application/vnd.tmobile-livetv":{"source":"iana","extensions":["tmo"]},"application/vnd.tri.onesource":{"source":"iana"},"application/vnd.trid.tpt":{"source":"iana","extensions":["tpt"]},"application/vnd.triscape.mxs":{"source":"iana","extensions":["mxs"]},"application/vnd.trueapp":{"source":"iana","extensions":["tra"]},"application/vnd.truedoc":{"source":"iana"},"application/vnd.ubisoft.webplayer":{"source":"iana"},"application/vnd.ufdl":{"source":"iana","extensions":["ufd","ufdl"]},"application/vnd.uiq.theme":{"source":"iana","extensions":["utz"]},"application/vnd.umajin":{"source":"iana","extensions":["umj"]},"application/vnd.unity":{"source":"iana","extensions":["unityweb"]},"application/vnd.uoml+xml":{"source":"iana","compressible":true,"extensions":["uoml"]},"application/vnd.uplanet.alert":{"source":"iana"},"application/vnd.uplanet.alert-wbxml":{"source":"iana"},"application/vnd.uplanet.bearer-choice":{"source":"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{"source":"iana"},"application/vnd.uplanet.cacheop":{"source":"iana"},"application/vnd.uplanet.cacheop-wbxml":{"source":"iana"},"application/vnd.uplanet.channel":{"source":"iana"},"application/vnd.uplanet.channel-wbxml":{"source":"iana"},"application/vnd.uplanet.list":{"source":"iana"},"application/vnd.uplanet.list-wbxml":{"source":"iana"},"application/vnd.uplanet.listcmd":{"source":"iana"},"application/vnd.uplanet.listcmd-wbxml":{"source":"iana"},"application/vnd.uplanet.signal":{"source":"iana"},"application/vnd.uri-map":{"source":"iana"},"application/vnd.valve.source.material":{"source":"iana"},"application/vnd.vcx":{"source":"iana","extensions":["vcx"]},"application/vnd.vd-study":{"source":"iana"},"application/vnd.vectorworks":{"source":"iana"},"application/vnd.vel+json":{"source":"iana","compressible":true},"application/vnd.verimatrix.vcas":{"source":"iana"},"application/vnd.veritone.aion+json":{"source":"iana","compressible":true},"application/vnd.veryant.thin":{"source":"iana"},"application/vnd.ves.encrypted":{"source":"iana"},"application/vnd.vidsoft.vidconference":{"source":"iana"},"application/vnd.visio":{"source":"iana","extensions":["vsd","vst","vss","vsw"]},"application/vnd.visionary":{"source":"iana","extensions":["vis"]},"application/vnd.vividence.scriptfile":{"source":"iana"},"application/vnd.vsf":{"source":"iana","extensions":["vsf"]},"application/vnd.wap.sic":{"source":"iana"},"application/vnd.wap.slc":{"source":"iana"},"application/vnd.wap.wbxml":{"source":"iana","charset":"UTF-8","extensions":["wbxml"]},"application/vnd.wap.wmlc":{"source":"iana","extensions":["wmlc"]},"application/vnd.wap.wmlscriptc":{"source":"iana","extensions":["wmlsc"]},"application/vnd.webturbo":{"source":"iana","extensions":["wtb"]},"application/vnd.wfa.dpp":{"source":"iana"},"application/vnd.wfa.p2p":{"source":"iana"},"application/vnd.wfa.wsc":{"source":"iana"},"application/vnd.windows.devicepairing":{"source":"iana"},"application/vnd.wmc":{"source":"iana"},"application/vnd.wmf.bootstrap":{"source":"iana"},"application/vnd.wolfram.mathematica":{"source":"iana"},"application/vnd.wolfram.mathematica.package":{"source":"iana"},"application/vnd.wolfram.player":{"source":"iana","extensions":["nbp"]},"application/vnd.wordperfect":{"source":"iana","extensions":["wpd"]},"application/vnd.wqd":{"source":"iana","extensions":["wqd"]},"application/vnd.wrq-hp3000-labelled":{"source":"iana"},"application/vnd.wt.stf":{"source":"iana","extensions":["stf"]},"application/vnd.wv.csp+wbxml":{"source":"iana"},"application/vnd.wv.csp+xml":{"source":"iana","compressible":true},"application/vnd.wv.ssp+xml":{"source":"iana","compressible":true},"application/vnd.xacml+json":{"source":"iana","compressible":true},"application/vnd.xara":{"source":"iana","extensions":["xar"]},"application/vnd.xfdl":{"source":"iana","extensions":["xfdl"]},"application/vnd.xfdl.webform":{"source":"iana"},"application/vnd.xmi+xml":{"source":"iana","compressible":true},"application/vnd.xmpie.cpkg":{"source":"iana"},"application/vnd.xmpie.dpkg":{"source":"iana"},"application/vnd.xmpie.plan":{"source":"iana"},"application/vnd.xmpie.ppkg":{"source":"iana"},"application/vnd.xmpie.xlim":{"source":"iana"},"application/vnd.yamaha.hv-dic":{"source":"iana","extensions":["hvd"]},"application/vnd.yamaha.hv-script":{"source":"iana","extensions":["hvs"]},"application/vnd.yamaha.hv-voice":{"source":"iana","extensions":["hvp"]},"application/vnd.yamaha.openscoreformat":{"source":"iana","extensions":["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{"source":"iana","compressible":true,"extensions":["osfpvg"]},"application/vnd.yamaha.remote-setup":{"source":"iana"},"application/vnd.yamaha.smaf-audio":{"source":"iana","extensions":["saf"]},"application/vnd.yamaha.smaf-phrase":{"source":"iana","extensions":["spf"]},"application/vnd.yamaha.through-ngn":{"source":"iana"},"application/vnd.yamaha.tunnel-udpencap":{"source":"iana"},"application/vnd.yaoweme":{"source":"iana"},"application/vnd.yellowriver-custom-menu":{"source":"iana","extensions":["cmp"]},"application/vnd.youtube.yt":{"source":"iana"},"application/vnd.zul":{"source":"iana","extensions":["zir","zirz"]},"application/vnd.zzazz.deck+xml":{"source":"iana","compressible":true,"extensions":["zaz"]},"application/voicexml+xml":{"source":"iana","compressible":true,"extensions":["vxml"]},"application/voucher-cms+json":{"source":"iana","compressible":true},"application/vq-rtcpxr":{"source":"iana"},"application/wasm":{"source":"iana","compressible":true,"extensions":["wasm"]},"application/watcherinfo+xml":{"source":"iana","compressible":true,"extensions":["wif"]},"application/webpush-options+json":{"source":"iana","compressible":true},"application/whoispp-query":{"source":"iana"},"application/whoispp-response":{"source":"iana"},"application/widget":{"source":"iana","extensions":["wgt"]},"application/winhlp":{"source":"apache","extensions":["hlp"]},"application/wita":{"source":"iana"},"application/wordperfect5.1":{"source":"iana"},"application/wsdl+xml":{"source":"iana","compressible":true,"extensions":["wsdl"]},"application/wspolicy+xml":{"source":"iana","compressible":true,"extensions":["wspolicy"]},"application/x-7z-compressed":{"source":"apache","compressible":false,"extensions":["7z"]},"application/x-abiword":{"source":"apache","extensions":["abw"]},"application/x-ace-compressed":{"source":"apache","extensions":["ace"]},"application/x-amf":{"source":"apache"},"application/x-apple-diskimage":{"source":"apache","extensions":["dmg"]},"application/x-arj":{"compressible":false,"extensions":["arj"]},"application/x-authorware-bin":{"source":"apache","extensions":["aab","x32","u32","vox"]},"application/x-authorware-map":{"source":"apache","extensions":["aam"]},"application/x-authorware-seg":{"source":"apache","extensions":["aas"]},"application/x-bcpio":{"source":"apache","extensions":["bcpio"]},"application/x-bdoc":{"compressible":false,"extensions":["bdoc"]},"application/x-bittorrent":{"source":"apache","extensions":["torrent"]},"application/x-blorb":{"source":"apache","extensions":["blb","blorb"]},"application/x-bzip":{"source":"apache","compressible":false,"extensions":["bz"]},"application/x-bzip2":{"source":"apache","compressible":false,"extensions":["bz2","boz"]},"application/x-cbr":{"source":"apache","extensions":["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{"source":"apache","extensions":["vcd"]},"application/x-cfs-compressed":{"source":"apache","extensions":["cfs"]},"application/x-chat":{"source":"apache","extensions":["chat"]},"application/x-chess-pgn":{"source":"apache","extensions":["pgn"]},"application/x-chrome-extension":{"extensions":["crx"]},"application/x-cocoa":{"source":"nginx","extensions":["cco"]},"application/x-compress":{"source":"apache"},"application/x-conference":{"source":"apache","extensions":["nsc"]},"application/x-cpio":{"source":"apache","extensions":["cpio"]},"application/x-csh":{"source":"apache","extensions":["csh"]},"application/x-deb":{"compressible":false},"application/x-debian-package":{"source":"apache","extensions":["deb","udeb"]},"application/x-dgc-compressed":{"source":"apache","extensions":["dgc"]},"application/x-director":{"source":"apache","extensions":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{"source":"apache","extensions":["wad"]},"application/x-dtbncx+xml":{"source":"apache","compressible":true,"extensions":["ncx"]},"application/x-dtbook+xml":{"source":"apache","compressible":true,"extensions":["dtb"]},"application/x-dtbresource+xml":{"source":"apache","compressible":true,"extensions":["res"]},"application/x-dvi":{"source":"apache","compressible":false,"extensions":["dvi"]},"application/x-envoy":{"source":"apache","extensions":["evy"]},"application/x-eva":{"source":"apache","extensions":["eva"]},"application/x-font-bdf":{"source":"apache","extensions":["bdf"]},"application/x-font-dos":{"source":"apache"},"application/x-font-framemaker":{"source":"apache"},"application/x-font-ghostscript":{"source":"apache","extensions":["gsf"]},"application/x-font-libgrx":{"source":"apache"},"application/x-font-linux-psf":{"source":"apache","extensions":["psf"]},"application/x-font-pcf":{"source":"apache","extensions":["pcf"]},"application/x-font-snf":{"source":"apache","extensions":["snf"]},"application/x-font-speedo":{"source":"apache"},"application/x-font-sunos-news":{"source":"apache"},"application/x-font-type1":{"source":"apache","extensions":["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{"source":"apache"},"application/x-freearc":{"source":"apache","extensions":["arc"]},"application/x-futuresplash":{"source":"apache","extensions":["spl"]},"application/x-gca-compressed":{"source":"apache","extensions":["gca"]},"application/x-glulx":{"source":"apache","extensions":["ulx"]},"application/x-gnumeric":{"source":"apache","extensions":["gnumeric"]},"application/x-gramps-xml":{"source":"apache","extensions":["gramps"]},"application/x-gtar":{"source":"apache","extensions":["gtar"]},"application/x-gzip":{"source":"apache"},"application/x-hdf":{"source":"apache","extensions":["hdf"]},"application/x-httpd-php":{"compressible":true,"extensions":["php"]},"application/x-install-instructions":{"source":"apache","extensions":["install"]},"application/x-iso9660-image":{"source":"apache","extensions":["iso"]},"application/x-iwork-keynote-sffkey":{"extensions":["key"]},"application/x-iwork-numbers-sffnumbers":{"extensions":["numbers"]},"application/x-iwork-pages-sffpages":{"extensions":["pages"]},"application/x-java-archive-diff":{"source":"nginx","extensions":["jardiff"]},"application/x-java-jnlp-file":{"source":"apache","compressible":false,"extensions":["jnlp"]},"application/x-javascript":{"compressible":true},"application/x-keepass2":{"extensions":["kdbx"]},"application/x-latex":{"source":"apache","compressible":false,"extensions":["latex"]},"application/x-lua-bytecode":{"extensions":["luac"]},"application/x-lzh-compressed":{"source":"apache","extensions":["lzh","lha"]},"application/x-makeself":{"source":"nginx","extensions":["run"]},"application/x-mie":{"source":"apache","extensions":["mie"]},"application/x-mobipocket-ebook":{"source":"apache","extensions":["prc","mobi"]},"application/x-mpegurl":{"compressible":false},"application/x-ms-application":{"source":"apache","extensions":["application"]},"application/x-ms-shortcut":{"source":"apache","extensions":["lnk"]},"application/x-ms-wmd":{"source":"apache","extensions":["wmd"]},"application/x-ms-wmz":{"source":"apache","extensions":["wmz"]},"application/x-ms-xbap":{"source":"apache","extensions":["xbap"]},"application/x-msaccess":{"source":"apache","extensions":["mdb"]},"application/x-msbinder":{"source":"apache","extensions":["obd"]},"application/x-mscardfile":{"source":"apache","extensions":["crd"]},"application/x-msclip":{"source":"apache","extensions":["clp"]},"application/x-msdos-program":{"extensions":["exe"]},"application/x-msdownload":{"source":"apache","extensions":["exe","dll","com","bat","msi"]},"application/x-msmediaview":{"source":"apache","extensions":["mvb","m13","m14"]},"application/x-msmetafile":{"source":"apache","extensions":["wmf","wmz","emf","emz"]},"application/x-msmoney":{"source":"apache","extensions":["mny"]},"application/x-mspublisher":{"source":"apache","extensions":["pub"]},"application/x-msschedule":{"source":"apache","extensions":["scd"]},"application/x-msterminal":{"source":"apache","extensions":["trm"]},"application/x-mswrite":{"source":"apache","extensions":["wri"]},"application/x-netcdf":{"source":"apache","extensions":["nc","cdf"]},"application/x-ns-proxy-autoconfig":{"compressible":true,"extensions":["pac"]},"application/x-nzb":{"source":"apache","extensions":["nzb"]},"application/x-perl":{"source":"nginx","extensions":["pl","pm"]},"application/x-pilot":{"source":"nginx","extensions":["prc","pdb"]},"application/x-pkcs12":{"source":"apache","compressible":false,"extensions":["p12","pfx"]},"application/x-pkcs7-certificates":{"source":"apache","extensions":["p7b","spc"]},"application/x-pkcs7-certreqresp":{"source":"apache","extensions":["p7r"]},"application/x-pki-message":{"source":"iana"},"application/x-rar-compressed":{"source":"apache","compressible":false,"extensions":["rar"]},"application/x-redhat-package-manager":{"source":"nginx","extensions":["rpm"]},"application/x-research-info-systems":{"source":"apache","extensions":["ris"]},"application/x-sea":{"source":"nginx","extensions":["sea"]},"application/x-sh":{"source":"apache","compressible":true,"extensions":["sh"]},"application/x-shar":{"source":"apache","extensions":["shar"]},"application/x-shockwave-flash":{"source":"apache","compressible":false,"extensions":["swf"]},"application/x-silverlight-app":{"source":"apache","extensions":["xap"]},"application/x-sql":{"source":"apache","extensions":["sql"]},"application/x-stuffit":{"source":"apache","compressible":false,"extensions":["sit"]},"application/x-stuffitx":{"source":"apache","extensions":["sitx"]},"application/x-subrip":{"source":"apache","extensions":["srt"]},"application/x-sv4cpio":{"source":"apache","extensions":["sv4cpio"]},"application/x-sv4crc":{"source":"apache","extensions":["sv4crc"]},"application/x-t3vm-image":{"source":"apache","extensions":["t3"]},"application/x-tads":{"source":"apache","extensions":["gam"]},"application/x-tar":{"source":"apache","compressible":true,"extensions":["tar"]},"application/x-tcl":{"source":"apache","extensions":["tcl","tk"]},"application/x-tex":{"source":"apache","extensions":["tex"]},"application/x-tex-tfm":{"source":"apache","extensions":["tfm"]},"application/x-texinfo":{"source":"apache","extensions":["texinfo","texi"]},"application/x-tgif":{"source":"apache","extensions":["obj"]},"application/x-ustar":{"source":"apache","extensions":["ustar"]},"application/x-virtualbox-hdd":{"compressible":true,"extensions":["hdd"]},"application/x-virtualbox-ova":{"compressible":true,"extensions":["ova"]},"application/x-virtualbox-ovf":{"compressible":true,"extensions":["ovf"]},"application/x-virtualbox-vbox":{"compressible":true,"extensions":["vbox"]},"application/x-virtualbox-vbox-extpack":{"compressible":false,"extensions":["vbox-extpack"]},"application/x-virtualbox-vdi":{"compressible":true,"extensions":["vdi"]},"application/x-virtualbox-vhd":{"compressible":true,"extensions":["vhd"]},"application/x-virtualbox-vmdk":{"compressible":true,"extensions":["vmdk"]},"application/x-wais-source":{"source":"apache","extensions":["src"]},"application/x-web-app-manifest+json":{"compressible":true,"extensions":["webapp"]},"application/x-www-form-urlencoded":{"source":"iana","compressible":true},"application/x-x509-ca-cert":{"source":"iana","extensions":["der","crt","pem"]},"application/x-x509-ca-ra-cert":{"source":"iana"},"application/x-x509-next-ca-cert":{"source":"iana"},"application/x-xfig":{"source":"apache","extensions":["fig"]},"application/x-xliff+xml":{"source":"apache","compressible":true,"extensions":["xlf"]},"application/x-xpinstall":{"source":"apache","compressible":false,"extensions":["xpi"]},"application/x-xz":{"source":"apache","extensions":["xz"]},"application/x-zmachine":{"source":"apache","extensions":["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{"source":"iana"},"application/xacml+xml":{"source":"iana","compressible":true},"application/xaml+xml":{"source":"apache","compressible":true,"extensions":["xaml"]},"application/xcap-att+xml":{"source":"iana","compressible":true,"extensions":["xav"]},"application/xcap-caps+xml":{"source":"iana","compressible":true,"extensions":["xca"]},"application/xcap-diff+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/xcap-el+xml":{"source":"iana","compressible":true,"extensions":["xel"]},"application/xcap-error+xml":{"source":"iana","compressible":true},"application/xcap-ns+xml":{"source":"iana","compressible":true,"extensions":["xns"]},"application/xcon-conference-info+xml":{"source":"iana","compressible":true},"application/xcon-conference-info-diff+xml":{"source":"iana","compressible":true},"application/xenc+xml":{"source":"iana","compressible":true,"extensions":["xenc"]},"application/xhtml+xml":{"source":"iana","compressible":true,"extensions":["xhtml","xht"]},"application/xhtml-voice+xml":{"source":"apache","compressible":true},"application/xliff+xml":{"source":"iana","compressible":true,"extensions":["xlf"]},"application/xml":{"source":"iana","compressible":true,"extensions":["xml","xsl","xsd","rng"]},"application/xml-dtd":{"source":"iana","compressible":true,"extensions":["dtd"]},"application/xml-external-parsed-entity":{"source":"iana"},"application/xml-patch+xml":{"source":"iana","compressible":true},"application/xmpp+xml":{"source":"iana","compressible":true},"application/xop+xml":{"source":"iana","compressible":true,"extensions":["xop"]},"application/xproc+xml":{"source":"apache","compressible":true,"extensions":["xpl"]},"application/xslt+xml":{"source":"iana","compressible":true,"extensions":["xsl","xslt"]},"application/xspf+xml":{"source":"apache","compressible":true,"extensions":["xspf"]},"application/xv+xml":{"source":"iana","compressible":true,"extensions":["mxml","xhvml","xvml","xvm"]},"application/yang":{"source":"iana","extensions":["yang"]},"application/yang-data+json":{"source":"iana","compressible":true},"application/yang-data+xml":{"source":"iana","compressible":true},"application/yang-patch+json":{"source":"iana","compressible":true},"application/yang-patch+xml":{"source":"iana","compressible":true},"application/yin+xml":{"source":"iana","compressible":true,"extensions":["yin"]},"application/zip":{"source":"iana","compressible":false,"extensions":["zip"]},"application/zlib":{"source":"iana"},"application/zstd":{"source":"iana"},"audio/1d-interleaved-parityfec":{"source":"iana"},"audio/32kadpcm":{"source":"iana"},"audio/3gpp":{"source":"iana","compressible":false,"extensions":["3gpp"]},"audio/3gpp2":{"source":"iana"},"audio/aac":{"source":"iana"},"audio/ac3":{"source":"iana"},"audio/adpcm":{"source":"apache","extensions":["adp"]},"audio/amr":{"source":"iana","extensions":["amr"]},"audio/amr-wb":{"source":"iana"},"audio/amr-wb+":{"source":"iana"},"audio/aptx":{"source":"iana"},"audio/asc":{"source":"iana"},"audio/atrac-advanced-lossless":{"source":"iana"},"audio/atrac-x":{"source":"iana"},"audio/atrac3":{"source":"iana"},"audio/basic":{"source":"iana","compressible":false,"extensions":["au","snd"]},"audio/bv16":{"source":"iana"},"audio/bv32":{"source":"iana"},"audio/clearmode":{"source":"iana"},"audio/cn":{"source":"iana"},"audio/dat12":{"source":"iana"},"audio/dls":{"source":"iana"},"audio/dsr-es201108":{"source":"iana"},"audio/dsr-es202050":{"source":"iana"},"audio/dsr-es202211":{"source":"iana"},"audio/dsr-es202212":{"source":"iana"},"audio/dv":{"source":"iana"},"audio/dvi4":{"source":"iana"},"audio/eac3":{"source":"iana"},"audio/encaprtp":{"source":"iana"},"audio/evrc":{"source":"iana"},"audio/evrc-qcp":{"source":"iana"},"audio/evrc0":{"source":"iana"},"audio/evrc1":{"source":"iana"},"audio/evrcb":{"source":"iana"},"audio/evrcb0":{"source":"iana"},"audio/evrcb1":{"source":"iana"},"audio/evrcnw":{"source":"iana"},"audio/evrcnw0":{"source":"iana"},"audio/evrcnw1":{"source":"iana"},"audio/evrcwb":{"source":"iana"},"audio/evrcwb0":{"source":"iana"},"audio/evrcwb1":{"source":"iana"},"audio/evs":{"source":"iana"},"audio/flexfec":{"source":"iana"},"audio/fwdred":{"source":"iana"},"audio/g711-0":{"source":"iana"},"audio/g719":{"source":"iana"},"audio/g722":{"source":"iana"},"audio/g7221":{"source":"iana"},"audio/g723":{"source":"iana"},"audio/g726-16":{"source":"iana"},"audio/g726-24":{"source":"iana"},"audio/g726-32":{"source":"iana"},"audio/g726-40":{"source":"iana"},"audio/g728":{"source":"iana"},"audio/g729":{"source":"iana"},"audio/g7291":{"source":"iana"},"audio/g729d":{"source":"iana"},"audio/g729e":{"source":"iana"},"audio/gsm":{"source":"iana"},"audio/gsm-efr":{"source":"iana"},"audio/gsm-hr-08":{"source":"iana"},"audio/ilbc":{"source":"iana"},"audio/ip-mr_v2.5":{"source":"iana"},"audio/isac":{"source":"apache"},"audio/l16":{"source":"iana"},"audio/l20":{"source":"iana"},"audio/l24":{"source":"iana","compressible":false},"audio/l8":{"source":"iana"},"audio/lpc":{"source":"iana"},"audio/melp":{"source":"iana"},"audio/melp1200":{"source":"iana"},"audio/melp2400":{"source":"iana"},"audio/melp600":{"source":"iana"},"audio/mhas":{"source":"iana"},"audio/midi":{"source":"apache","extensions":["mid","midi","kar","rmi"]},"audio/mobile-xmf":{"source":"iana","extensions":["mxmf"]},"audio/mp3":{"compressible":false,"extensions":["mp3"]},"audio/mp4":{"source":"iana","compressible":false,"extensions":["m4a","mp4a"]},"audio/mp4a-latm":{"source":"iana"},"audio/mpa":{"source":"iana"},"audio/mpa-robust":{"source":"iana"},"audio/mpeg":{"source":"iana","compressible":false,"extensions":["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{"source":"iana"},"audio/musepack":{"source":"apache"},"audio/ogg":{"source":"iana","compressible":false,"extensions":["oga","ogg","spx","opus"]},"audio/opus":{"source":"iana"},"audio/parityfec":{"source":"iana"},"audio/pcma":{"source":"iana"},"audio/pcma-wb":{"source":"iana"},"audio/pcmu":{"source":"iana"},"audio/pcmu-wb":{"source":"iana"},"audio/prs.sid":{"source":"iana"},"audio/qcelp":{"source":"iana"},"audio/raptorfec":{"source":"iana"},"audio/red":{"source":"iana"},"audio/rtp-enc-aescm128":{"source":"iana"},"audio/rtp-midi":{"source":"iana"},"audio/rtploopback":{"source":"iana"},"audio/rtx":{"source":"iana"},"audio/s3m":{"source":"apache","extensions":["s3m"]},"audio/scip":{"source":"iana"},"audio/silk":{"source":"apache","extensions":["sil"]},"audio/smv":{"source":"iana"},"audio/smv-qcp":{"source":"iana"},"audio/smv0":{"source":"iana"},"audio/sofa":{"source":"iana"},"audio/sp-midi":{"source":"iana"},"audio/speex":{"source":"iana"},"audio/t140c":{"source":"iana"},"audio/t38":{"source":"iana"},"audio/telephone-event":{"source":"iana"},"audio/tetra_acelp":{"source":"iana"},"audio/tetra_acelp_bb":{"source":"iana"},"audio/tone":{"source":"iana"},"audio/tsvcis":{"source":"iana"},"audio/uemclip":{"source":"iana"},"audio/ulpfec":{"source":"iana"},"audio/usac":{"source":"iana"},"audio/vdvi":{"source":"iana"},"audio/vmr-wb":{"source":"iana"},"audio/vnd.3gpp.iufp":{"source":"iana"},"audio/vnd.4sb":{"source":"iana"},"audio/vnd.audiokoz":{"source":"iana"},"audio/vnd.celp":{"source":"iana"},"audio/vnd.cisco.nse":{"source":"iana"},"audio/vnd.cmles.radio-events":{"source":"iana"},"audio/vnd.cns.anp1":{"source":"iana"},"audio/vnd.cns.inf1":{"source":"iana"},"audio/vnd.dece.audio":{"source":"iana","extensions":["uva","uvva"]},"audio/vnd.digital-winds":{"source":"iana","extensions":["eol"]},"audio/vnd.dlna.adts":{"source":"iana"},"audio/vnd.dolby.heaac.1":{"source":"iana"},"audio/vnd.dolby.heaac.2":{"source":"iana"},"audio/vnd.dolby.mlp":{"source":"iana"},"audio/vnd.dolby.mps":{"source":"iana"},"audio/vnd.dolby.pl2":{"source":"iana"},"audio/vnd.dolby.pl2x":{"source":"iana"},"audio/vnd.dolby.pl2z":{"source":"iana"},"audio/vnd.dolby.pulse.1":{"source":"iana"},"audio/vnd.dra":{"source":"iana","extensions":["dra"]},"audio/vnd.dts":{"source":"iana","extensions":["dts"]},"audio/vnd.dts.hd":{"source":"iana","extensions":["dtshd"]},"audio/vnd.dts.uhd":{"source":"iana"},"audio/vnd.dvb.file":{"source":"iana"},"audio/vnd.everad.plj":{"source":"iana"},"audio/vnd.hns.audio":{"source":"iana"},"audio/vnd.lucent.voice":{"source":"iana","extensions":["lvp"]},"audio/vnd.ms-playready.media.pya":{"source":"iana","extensions":["pya"]},"audio/vnd.nokia.mobile-xmf":{"source":"iana"},"audio/vnd.nortel.vbk":{"source":"iana"},"audio/vnd.nuera.ecelp4800":{"source":"iana","extensions":["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{"source":"iana","extensions":["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{"source":"iana","extensions":["ecelp9600"]},"audio/vnd.octel.sbc":{"source":"iana"},"audio/vnd.presonus.multitrack":{"source":"iana"},"audio/vnd.qcelp":{"source":"iana"},"audio/vnd.rhetorex.32kadpcm":{"source":"iana"},"audio/vnd.rip":{"source":"iana","extensions":["rip"]},"audio/vnd.rn-realaudio":{"compressible":false},"audio/vnd.sealedmedia.softseal.mpeg":{"source":"iana"},"audio/vnd.vmx.cvsd":{"source":"iana"},"audio/vnd.wave":{"compressible":false},"audio/vorbis":{"source":"iana","compressible":false},"audio/vorbis-config":{"source":"iana"},"audio/wav":{"compressible":false,"extensions":["wav"]},"audio/wave":{"compressible":false,"extensions":["wav"]},"audio/webm":{"source":"apache","compressible":false,"extensions":["weba"]},"audio/x-aac":{"source":"apache","compressible":false,"extensions":["aac"]},"audio/x-aiff":{"source":"apache","extensions":["aif","aiff","aifc"]},"audio/x-caf":{"source":"apache","compressible":false,"extensions":["caf"]},"audio/x-flac":{"source":"apache","extensions":["flac"]},"audio/x-m4a":{"source":"nginx","extensions":["m4a"]},"audio/x-matroska":{"source":"apache","extensions":["mka"]},"audio/x-mpegurl":{"source":"apache","extensions":["m3u"]},"audio/x-ms-wax":{"source":"apache","extensions":["wax"]},"audio/x-ms-wma":{"source":"apache","extensions":["wma"]},"audio/x-pn-realaudio":{"source":"apache","extensions":["ram","ra"]},"audio/x-pn-realaudio-plugin":{"source":"apache","extensions":["rmp"]},"audio/x-realaudio":{"source":"nginx","extensions":["ra"]},"audio/x-tta":{"source":"apache"},"audio/x-wav":{"source":"apache","extensions":["wav"]},"audio/xm":{"source":"apache","extensions":["xm"]},"chemical/x-cdx":{"source":"apache","extensions":["cdx"]},"chemical/x-cif":{"source":"apache","extensions":["cif"]},"chemical/x-cmdf":{"source":"apache","extensions":["cmdf"]},"chemical/x-cml":{"source":"apache","extensions":["cml"]},"chemical/x-csml":{"source":"apache","extensions":["csml"]},"chemical/x-pdb":{"source":"apache"},"chemical/x-xyz":{"source":"apache","extensions":["xyz"]},"font/collection":{"source":"iana","extensions":["ttc"]},"font/otf":{"source":"iana","compressible":true,"extensions":["otf"]},"font/sfnt":{"source":"iana"},"font/ttf":{"source":"iana","compressible":true,"extensions":["ttf"]},"font/woff":{"source":"iana","extensions":["woff"]},"font/woff2":{"source":"iana","extensions":["woff2"]},"image/aces":{"source":"iana","extensions":["exr"]},"image/apng":{"compressible":false,"extensions":["apng"]},"image/avci":{"source":"iana","extensions":["avci"]},"image/avcs":{"source":"iana","extensions":["avcs"]},"image/avif":{"source":"iana","compressible":false,"extensions":["avif"]},"image/bmp":{"source":"iana","compressible":true,"extensions":["bmp"]},"image/cgm":{"source":"iana","extensions":["cgm"]},"image/dicom-rle":{"source":"iana","extensions":["drle"]},"image/emf":{"source":"iana","extensions":["emf"]},"image/fits":{"source":"iana","extensions":["fits"]},"image/g3fax":{"source":"iana","extensions":["g3"]},"image/gif":{"source":"iana","compressible":false,"extensions":["gif"]},"image/heic":{"source":"iana","extensions":["heic"]},"image/heic-sequence":{"source":"iana","extensions":["heics"]},"image/heif":{"source":"iana","extensions":["heif"]},"image/heif-sequence":{"source":"iana","extensions":["heifs"]},"image/hej2k":{"source":"iana","extensions":["hej2"]},"image/hsj2":{"source":"iana","extensions":["hsj2"]},"image/ief":{"source":"iana","extensions":["ief"]},"image/jls":{"source":"iana","extensions":["jls"]},"image/jp2":{"source":"iana","compressible":false,"extensions":["jp2","jpg2"]},"image/jpeg":{"source":"iana","compressible":false,"extensions":["jpeg","jpg","jpe"]},"image/jph":{"source":"iana","extensions":["jph"]},"image/jphc":{"source":"iana","extensions":["jhc"]},"image/jpm":{"source":"iana","compressible":false,"extensions":["jpm"]},"image/jpx":{"source":"iana","compressible":false,"extensions":["jpx","jpf"]},"image/jxr":{"source":"iana","extensions":["jxr"]},"image/jxra":{"source":"iana","extensions":["jxra"]},"image/jxrs":{"source":"iana","extensions":["jxrs"]},"image/jxs":{"source":"iana","extensions":["jxs"]},"image/jxsc":{"source":"iana","extensions":["jxsc"]},"image/jxsi":{"source":"iana","extensions":["jxsi"]},"image/jxss":{"source":"iana","extensions":["jxss"]},"image/ktx":{"source":"iana","extensions":["ktx"]},"image/ktx2":{"source":"iana","extensions":["ktx2"]},"image/naplps":{"source":"iana"},"image/pjpeg":{"compressible":false},"image/png":{"source":"iana","compressible":false,"extensions":["png"]},"image/prs.btif":{"source":"iana","extensions":["btif"]},"image/prs.pti":{"source":"iana","extensions":["pti"]},"image/pwg-raster":{"source":"iana"},"image/sgi":{"source":"apache","extensions":["sgi"]},"image/svg+xml":{"source":"iana","compressible":true,"extensions":["svg","svgz"]},"image/t38":{"source":"iana","extensions":["t38"]},"image/tiff":{"source":"iana","compressible":false,"extensions":["tif","tiff"]},"image/tiff-fx":{"source":"iana","extensions":["tfx"]},"image/vnd.adobe.photoshop":{"source":"iana","compressible":true,"extensions":["psd"]},"image/vnd.airzip.accelerator.azv":{"source":"iana","extensions":["azv"]},"image/vnd.cns.inf2":{"source":"iana"},"image/vnd.dece.graphic":{"source":"iana","extensions":["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{"source":"iana","extensions":["djvu","djv"]},"image/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"image/vnd.dwg":{"source":"iana","extensions":["dwg"]},"image/vnd.dxf":{"source":"iana","extensions":["dxf"]},"image/vnd.fastbidsheet":{"source":"iana","extensions":["fbs"]},"image/vnd.fpx":{"source":"iana","extensions":["fpx"]},"image/vnd.fst":{"source":"iana","extensions":["fst"]},"image/vnd.fujixerox.edmics-mmr":{"source":"iana","extensions":["mmr"]},"image/vnd.fujixerox.edmics-rlc":{"source":"iana","extensions":["rlc"]},"image/vnd.globalgraphics.pgb":{"source":"iana"},"image/vnd.microsoft.icon":{"source":"iana","compressible":true,"extensions":["ico"]},"image/vnd.mix":{"source":"iana"},"image/vnd.mozilla.apng":{"source":"iana"},"image/vnd.ms-dds":{"compressible":true,"extensions":["dds"]},"image/vnd.ms-modi":{"source":"iana","extensions":["mdi"]},"image/vnd.ms-photo":{"source":"apache","extensions":["wdp"]},"image/vnd.net-fpx":{"source":"iana","extensions":["npx"]},"image/vnd.pco.b16":{"source":"iana","extensions":["b16"]},"image/vnd.radiance":{"source":"iana"},"image/vnd.sealed.png":{"source":"iana"},"image/vnd.sealedmedia.softseal.gif":{"source":"iana"},"image/vnd.sealedmedia.softseal.jpg":{"source":"iana"},"image/vnd.svf":{"source":"iana"},"image/vnd.tencent.tap":{"source":"iana","extensions":["tap"]},"image/vnd.valve.source.texture":{"source":"iana","extensions":["vtf"]},"image/vnd.wap.wbmp":{"source":"iana","extensions":["wbmp"]},"image/vnd.xiff":{"source":"iana","extensions":["xif"]},"image/vnd.zbrush.pcx":{"source":"iana","extensions":["pcx"]},"image/webp":{"source":"apache","extensions":["webp"]},"image/wmf":{"source":"iana","extensions":["wmf"]},"image/x-3ds":{"source":"apache","extensions":["3ds"]},"image/x-cmu-raster":{"source":"apache","extensions":["ras"]},"image/x-cmx":{"source":"apache","extensions":["cmx"]},"image/x-freehand":{"source":"apache","extensions":["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{"source":"apache","compressible":true,"extensions":["ico"]},"image/x-jng":{"source":"nginx","extensions":["jng"]},"image/x-mrsid-image":{"source":"apache","extensions":["sid"]},"image/x-ms-bmp":{"source":"nginx","compressible":true,"extensions":["bmp"]},"image/x-pcx":{"source":"apache","extensions":["pcx"]},"image/x-pict":{"source":"apache","extensions":["pic","pct"]},"image/x-portable-anymap":{"source":"apache","extensions":["pnm"]},"image/x-portable-bitmap":{"source":"apache","extensions":["pbm"]},"image/x-portable-graymap":{"source":"apache","extensions":["pgm"]},"image/x-portable-pixmap":{"source":"apache","extensions":["ppm"]},"image/x-rgb":{"source":"apache","extensions":["rgb"]},"image/x-tga":{"source":"apache","extensions":["tga"]},"image/x-xbitmap":{"source":"apache","extensions":["xbm"]},"image/x-xcf":{"compressible":false},"image/x-xpixmap":{"source":"apache","extensions":["xpm"]},"image/x-xwindowdump":{"source":"apache","extensions":["xwd"]},"message/cpim":{"source":"iana"},"message/delivery-status":{"source":"iana"},"message/disposition-notification":{"source":"iana","extensions":["disposition-notification"]},"message/external-body":{"source":"iana"},"message/feedback-report":{"source":"iana"},"message/global":{"source":"iana","extensions":["u8msg"]},"message/global-delivery-status":{"source":"iana","extensions":["u8dsn"]},"message/global-disposition-notification":{"source":"iana","extensions":["u8mdn"]},"message/global-headers":{"source":"iana","extensions":["u8hdr"]},"message/http":{"source":"iana","compressible":false},"message/imdn+xml":{"source":"iana","compressible":true},"message/news":{"source":"iana"},"message/partial":{"source":"iana","compressible":false},"message/rfc822":{"source":"iana","compressible":true,"extensions":["eml","mime"]},"message/s-http":{"source":"iana"},"message/sip":{"source":"iana"},"message/sipfrag":{"source":"iana"},"message/tracking-status":{"source":"iana"},"message/vnd.si.simp":{"source":"iana"},"message/vnd.wfa.wsc":{"source":"iana","extensions":["wsc"]},"model/3mf":{"source":"iana","extensions":["3mf"]},"model/e57":{"source":"iana"},"model/gltf+json":{"source":"iana","compressible":true,"extensions":["gltf"]},"model/gltf-binary":{"source":"iana","compressible":true,"extensions":["glb"]},"model/iges":{"source":"iana","compressible":false,"extensions":["igs","iges"]},"model/mesh":{"source":"iana","compressible":false,"extensions":["msh","mesh","silo"]},"model/mtl":{"source":"iana","extensions":["mtl"]},"model/obj":{"source":"iana","extensions":["obj"]},"model/step":{"source":"iana"},"model/step+xml":{"source":"iana","compressible":true,"extensions":["stpx"]},"model/step+zip":{"source":"iana","compressible":false,"extensions":["stpz"]},"model/step-xml+zip":{"source":"iana","compressible":false,"extensions":["stpxz"]},"model/stl":{"source":"iana","extensions":["stl"]},"model/vnd.collada+xml":{"source":"iana","compressible":true,"extensions":["dae"]},"model/vnd.dwf":{"source":"iana","extensions":["dwf"]},"model/vnd.flatland.3dml":{"source":"iana"},"model/vnd.gdl":{"source":"iana","extensions":["gdl"]},"model/vnd.gs-gdl":{"source":"apache"},"model/vnd.gs.gdl":{"source":"iana"},"model/vnd.gtw":{"source":"iana","extensions":["gtw"]},"model/vnd.moml+xml":{"source":"iana","compressible":true},"model/vnd.mts":{"source":"iana","extensions":["mts"]},"model/vnd.opengex":{"source":"iana","extensions":["ogex"]},"model/vnd.parasolid.transmit.binary":{"source":"iana","extensions":["x_b"]},"model/vnd.parasolid.transmit.text":{"source":"iana","extensions":["x_t"]},"model/vnd.pytha.pyox":{"source":"iana"},"model/vnd.rosette.annotated-data-model":{"source":"iana"},"model/vnd.sap.vds":{"source":"iana","extensions":["vds"]},"model/vnd.usdz+zip":{"source":"iana","compressible":false,"extensions":["usdz"]},"model/vnd.valve.source.compiled-map":{"source":"iana","extensions":["bsp"]},"model/vnd.vtu":{"source":"iana","extensions":["vtu"]},"model/vrml":{"source":"iana","compressible":false,"extensions":["wrl","vrml"]},"model/x3d+binary":{"source":"apache","compressible":false,"extensions":["x3db","x3dbz"]},"model/x3d+fastinfoset":{"source":"iana","extensions":["x3db"]},"model/x3d+vrml":{"source":"apache","compressible":false,"extensions":["x3dv","x3dvz"]},"model/x3d+xml":{"source":"iana","compressible":true,"extensions":["x3d","x3dz"]},"model/x3d-vrml":{"source":"iana","extensions":["x3dv"]},"multipart/alternative":{"source":"iana","compressible":false},"multipart/appledouble":{"source":"iana"},"multipart/byteranges":{"source":"iana"},"multipart/digest":{"source":"iana"},"multipart/encrypted":{"source":"iana","compressible":false},"multipart/form-data":{"source":"iana","compressible":false},"multipart/header-set":{"source":"iana"},"multipart/mixed":{"source":"iana"},"multipart/multilingual":{"source":"iana"},"multipart/parallel":{"source":"iana"},"multipart/related":{"source":"iana","compressible":false},"multipart/report":{"source":"iana"},"multipart/signed":{"source":"iana","compressible":false},"multipart/vnd.bint.med-plus":{"source":"iana"},"multipart/voice-message":{"source":"iana"},"multipart/x-mixed-replace":{"source":"iana"},"text/1d-interleaved-parityfec":{"source":"iana"},"text/cache-manifest":{"source":"iana","compressible":true,"extensions":["appcache","manifest"]},"text/calendar":{"source":"iana","extensions":["ics","ifb"]},"text/calender":{"compressible":true},"text/cmd":{"compressible":true},"text/coffeescript":{"extensions":["coffee","litcoffee"]},"text/cql":{"source":"iana"},"text/cql-expression":{"source":"iana"},"text/cql-identifier":{"source":"iana"},"text/css":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["css"]},"text/csv":{"source":"iana","compressible":true,"extensions":["csv"]},"text/csv-schema":{"source":"iana"},"text/directory":{"source":"iana"},"text/dns":{"source":"iana"},"text/ecmascript":{"source":"iana"},"text/encaprtp":{"source":"iana"},"text/enriched":{"source":"iana"},"text/fhirpath":{"source":"iana"},"text/flexfec":{"source":"iana"},"text/fwdred":{"source":"iana"},"text/gff3":{"source":"iana"},"text/grammar-ref-list":{"source":"iana"},"text/html":{"source":"iana","compressible":true,"extensions":["html","htm","shtml"]},"text/jade":{"extensions":["jade"]},"text/javascript":{"source":"iana","compressible":true},"text/jcr-cnd":{"source":"iana"},"text/jsx":{"compressible":true,"extensions":["jsx"]},"text/less":{"compressible":true,"extensions":["less"]},"text/markdown":{"source":"iana","compressible":true,"extensions":["markdown","md"]},"text/mathml":{"source":"nginx","extensions":["mml"]},"text/mdx":{"compressible":true,"extensions":["mdx"]},"text/mizar":{"source":"iana"},"text/n3":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["n3"]},"text/parameters":{"source":"iana","charset":"UTF-8"},"text/parityfec":{"source":"iana"},"text/plain":{"source":"iana","compressible":true,"extensions":["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{"source":"iana","charset":"UTF-8"},"text/prs.fallenstein.rst":{"source":"iana"},"text/prs.lines.tag":{"source":"iana","extensions":["dsc"]},"text/prs.prop.logic":{"source":"iana"},"text/raptorfec":{"source":"iana"},"text/red":{"source":"iana"},"text/rfc822-headers":{"source":"iana"},"text/richtext":{"source":"iana","compressible":true,"extensions":["rtx"]},"text/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"text/rtp-enc-aescm128":{"source":"iana"},"text/rtploopback":{"source":"iana"},"text/rtx":{"source":"iana"},"text/sgml":{"source":"iana","extensions":["sgml","sgm"]},"text/shaclc":{"source":"iana"},"text/shex":{"source":"iana","extensions":["shex"]},"text/slim":{"extensions":["slim","slm"]},"text/spdx":{"source":"iana","extensions":["spdx"]},"text/strings":{"source":"iana"},"text/stylus":{"extensions":["stylus","styl"]},"text/t140":{"source":"iana"},"text/tab-separated-values":{"source":"iana","compressible":true,"extensions":["tsv"]},"text/troff":{"source":"iana","extensions":["t","tr","roff","man","me","ms"]},"text/turtle":{"source":"iana","charset":"UTF-8","extensions":["ttl"]},"text/ulpfec":{"source":"iana"},"text/uri-list":{"source":"iana","compressible":true,"extensions":["uri","uris","urls"]},"text/vcard":{"source":"iana","compressible":true,"extensions":["vcard"]},"text/vnd.a":{"source":"iana"},"text/vnd.abc":{"source":"iana"},"text/vnd.ascii-art":{"source":"iana"},"text/vnd.curl":{"source":"iana","extensions":["curl"]},"text/vnd.curl.dcurl":{"source":"apache","extensions":["dcurl"]},"text/vnd.curl.mcurl":{"source":"apache","extensions":["mcurl"]},"text/vnd.curl.scurl":{"source":"apache","extensions":["scurl"]},"text/vnd.debian.copyright":{"source":"iana","charset":"UTF-8"},"text/vnd.dmclientscript":{"source":"iana"},"text/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"text/vnd.esmertec.theme-descriptor":{"source":"iana","charset":"UTF-8"},"text/vnd.familysearch.gedcom":{"source":"iana","extensions":["ged"]},"text/vnd.ficlab.flt":{"source":"iana"},"text/vnd.fly":{"source":"iana","extensions":["fly"]},"text/vnd.fmi.flexstor":{"source":"iana","extensions":["flx"]},"text/vnd.gml":{"source":"iana"},"text/vnd.graphviz":{"source":"iana","extensions":["gv"]},"text/vnd.hans":{"source":"iana"},"text/vnd.hgl":{"source":"iana"},"text/vnd.in3d.3dml":{"source":"iana","extensions":["3dml"]},"text/vnd.in3d.spot":{"source":"iana","extensions":["spot"]},"text/vnd.iptc.newsml":{"source":"iana"},"text/vnd.iptc.nitf":{"source":"iana"},"text/vnd.latex-z":{"source":"iana"},"text/vnd.motorola.reflex":{"source":"iana"},"text/vnd.ms-mediapackage":{"source":"iana"},"text/vnd.net2phone.commcenter.command":{"source":"iana"},"text/vnd.radisys.msml-basic-layout":{"source":"iana"},"text/vnd.senx.warpscript":{"source":"iana"},"text/vnd.si.uricatalogue":{"source":"iana"},"text/vnd.sosi":{"source":"iana"},"text/vnd.sun.j2me.app-descriptor":{"source":"iana","charset":"UTF-8","extensions":["jad"]},"text/vnd.trolltech.linguist":{"source":"iana","charset":"UTF-8"},"text/vnd.wap.si":{"source":"iana"},"text/vnd.wap.sl":{"source":"iana"},"text/vnd.wap.wml":{"source":"iana","extensions":["wml"]},"text/vnd.wap.wmlscript":{"source":"iana","extensions":["wmls"]},"text/vtt":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["vtt"]},"text/x-asm":{"source":"apache","extensions":["s","asm"]},"text/x-c":{"source":"apache","extensions":["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{"source":"nginx","extensions":["htc"]},"text/x-fortran":{"source":"apache","extensions":["f","for","f77","f90"]},"text/x-gwt-rpc":{"compressible":true},"text/x-handlebars-template":{"extensions":["hbs"]},"text/x-java-source":{"source":"apache","extensions":["java"]},"text/x-jquery-tmpl":{"compressible":true},"text/x-lua":{"extensions":["lua"]},"text/x-markdown":{"compressible":true,"extensions":["mkd"]},"text/x-nfo":{"source":"apache","extensions":["nfo"]},"text/x-opml":{"source":"apache","extensions":["opml"]},"text/x-org":{"compressible":true,"extensions":["org"]},"text/x-pascal":{"source":"apache","extensions":["p","pas"]},"text/x-processing":{"compressible":true,"extensions":["pde"]},"text/x-sass":{"extensions":["sass"]},"text/x-scss":{"extensions":["scss"]},"text/x-setext":{"source":"apache","extensions":["etx"]},"text/x-sfv":{"source":"apache","extensions":["sfv"]},"text/x-suse-ymp":{"compressible":true,"extensions":["ymp"]},"text/x-uuencode":{"source":"apache","extensions":["uu"]},"text/x-vcalendar":{"source":"apache","extensions":["vcs"]},"text/x-vcard":{"source":"apache","extensions":["vcf"]},"text/xml":{"source":"iana","compressible":true,"extensions":["xml"]},"text/xml-external-parsed-entity":{"source":"iana"},"text/yaml":{"compressible":true,"extensions":["yaml","yml"]},"video/1d-interleaved-parityfec":{"source":"iana"},"video/3gpp":{"source":"iana","extensions":["3gp","3gpp"]},"video/3gpp-tt":{"source":"iana"},"video/3gpp2":{"source":"iana","extensions":["3g2"]},"video/av1":{"source":"iana"},"video/bmpeg":{"source":"iana"},"video/bt656":{"source":"iana"},"video/celb":{"source":"iana"},"video/dv":{"source":"iana"},"video/encaprtp":{"source":"iana"},"video/ffv1":{"source":"iana"},"video/flexfec":{"source":"iana"},"video/h261":{"source":"iana","extensions":["h261"]},"video/h263":{"source":"iana","extensions":["h263"]},"video/h263-1998":{"source":"iana"},"video/h263-2000":{"source":"iana"},"video/h264":{"source":"iana","extensions":["h264"]},"video/h264-rcdo":{"source":"iana"},"video/h264-svc":{"source":"iana"},"video/h265":{"source":"iana"},"video/iso.segment":{"source":"iana","extensions":["m4s"]},"video/jpeg":{"source":"iana","extensions":["jpgv"]},"video/jpeg2000":{"source":"iana"},"video/jpm":{"source":"apache","extensions":["jpm","jpgm"]},"video/jxsv":{"source":"iana"},"video/mj2":{"source":"iana","extensions":["mj2","mjp2"]},"video/mp1s":{"source":"iana"},"video/mp2p":{"source":"iana"},"video/mp2t":{"source":"iana","extensions":["ts"]},"video/mp4":{"source":"iana","compressible":false,"extensions":["mp4","mp4v","mpg4"]},"video/mp4v-es":{"source":"iana"},"video/mpeg":{"source":"iana","compressible":false,"extensions":["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{"source":"iana"},"video/mpv":{"source":"iana"},"video/nv":{"source":"iana"},"video/ogg":{"source":"iana","compressible":false,"extensions":["ogv"]},"video/parityfec":{"source":"iana"},"video/pointer":{"source":"iana"},"video/quicktime":{"source":"iana","compressible":false,"extensions":["qt","mov"]},"video/raptorfec":{"source":"iana"},"video/raw":{"source":"iana"},"video/rtp-enc-aescm128":{"source":"iana"},"video/rtploopback":{"source":"iana"},"video/rtx":{"source":"iana"},"video/scip":{"source":"iana"},"video/smpte291":{"source":"iana"},"video/smpte292m":{"source":"iana"},"video/ulpfec":{"source":"iana"},"video/vc1":{"source":"iana"},"video/vc2":{"source":"iana"},"video/vnd.cctv":{"source":"iana"},"video/vnd.dece.hd":{"source":"iana","extensions":["uvh","uvvh"]},"video/vnd.dece.mobile":{"source":"iana","extensions":["uvm","uvvm"]},"video/vnd.dece.mp4":{"source":"iana"},"video/vnd.dece.pd":{"source":"iana","extensions":["uvp","uvvp"]},"video/vnd.dece.sd":{"source":"iana","extensions":["uvs","uvvs"]},"video/vnd.dece.video":{"source":"iana","extensions":["uvv","uvvv"]},"video/vnd.directv.mpeg":{"source":"iana"},"video/vnd.directv.mpeg-tts":{"source":"iana"},"video/vnd.dlna.mpeg-tts":{"source":"iana"},"video/vnd.dvb.file":{"source":"iana","extensions":["dvb"]},"video/vnd.fvt":{"source":"iana","extensions":["fvt"]},"video/vnd.hns.video":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.ttsavc":{"source":"iana"},"video/vnd.iptvforum.ttsmpeg2":{"source":"iana"},"video/vnd.motorola.video":{"source":"iana"},"video/vnd.motorola.videop":{"source":"iana"},"video/vnd.mpegurl":{"source":"iana","extensions":["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{"source":"iana","extensions":["pyv"]},"video/vnd.nokia.interleaved-multimedia":{"source":"iana"},"video/vnd.nokia.mp4vr":{"source":"iana"},"video/vnd.nokia.videovoip":{"source":"iana"},"video/vnd.objectvideo":{"source":"iana"},"video/vnd.radgamettools.bink":{"source":"iana"},"video/vnd.radgamettools.smacker":{"source":"iana"},"video/vnd.sealed.mpeg1":{"source":"iana"},"video/vnd.sealed.mpeg4":{"source":"iana"},"video/vnd.sealed.swf":{"source":"iana"},"video/vnd.sealedmedia.softseal.mov":{"source":"iana"},"video/vnd.uvvu.mp4":{"source":"iana","extensions":["uvu","uvvu"]},"video/vnd.vivo":{"source":"iana","extensions":["viv"]},"video/vnd.youtube.yt":{"source":"iana"},"video/vp8":{"source":"iana"},"video/vp9":{"source":"iana"},"video/webm":{"source":"apache","compressible":false,"extensions":["webm"]},"video/x-f4v":{"source":"apache","extensions":["f4v"]},"video/x-fli":{"source":"apache","extensions":["fli"]},"video/x-flv":{"source":"apache","compressible":false,"extensions":["flv"]},"video/x-m4v":{"source":"apache","extensions":["m4v"]},"video/x-matroska":{"source":"apache","compressible":false,"extensions":["mkv","mk3d","mks"]},"video/x-mng":{"source":"apache","extensions":["mng"]},"video/x-ms-asf":{"source":"apache","extensions":["asf","asx"]},"video/x-ms-vob":{"source":"apache","extensions":["vob"]},"video/x-ms-wm":{"source":"apache","extensions":["wm"]},"video/x-ms-wmv":{"source":"apache","compressible":false,"extensions":["wmv"]},"video/x-ms-wmx":{"source":"apache","extensions":["wmx"]},"video/x-ms-wvx":{"source":"apache","extensions":["wvx"]},"video/x-msvideo":{"source":"apache","extensions":["avi"]},"video/x-sgi-movie":{"source":"apache","extensions":["movie"]},"video/x-smv":{"source":"apache","extensions":["smv"]},"x-conference/x-cooltalk":{"source":"apache","extensions":["ice"]},"x-shader/x-fragment":{"compressible":true},"x-shader/x-vertex":{"compressible":true}}')}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={id:e,loaded:!1,exports:{}};return i[e].call(r.exports,r,r.exports,a),r.loaded=!0,r.exports}return a.m=i,a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"==typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"==typeof r.then)return r}var i=Object.create(null);a.r(i);var o={};e=e||[null,t({}),t([]),t(t)];for(var s=2&n&&r;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((e=>o[e]=()=>r[e]));return o.default=()=>r,a.d(i,o),i},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,r)=>(a.f[r](e,t),t)),[])),a.u=e=>e+".solid-ui.min.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r={},n="solid-ui:",a.l=(e,t,i,o)=>{if(r[e])r[e].push(t);else{var s,c;if(void 0!==i)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++){var d=u[l];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==n+i){s=d;break}}s||(c=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,a.nc&&s.setAttribute("nonce",a.nc),s.setAttribute("data-webpack",n+i),s.src=e),r[e]=[t];var p=(t,n)=>{s.onerror=s.onload=null,clearTimeout(f);var i=r[e];if(delete r[e],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((e=>e(n))),t)return t(n)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=p.bind(null,s.onerror),s.onload=p.bind(null,s.onload),c&&document.head.appendChild(s)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),a.p="",(()=>{var e={179:0};a.f.j=(t,r)=>{var n=a.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise(((r,i)=>n=e[t]=[r,i]));r.push(n[2]=i);var o=a.p+a.u(t),s=new Error;a.l(o,(r=>{if(a.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+i+": "+o+")",s.name="ChunkLoadError",s.type=i,s.request=o,n[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var n,i,[o,s,c]=r,u=0;if(o.some((t=>0!==e[t]))){for(n in s)a.o(s,n)&&(a.m[n]=s[n]);c&&c(a)}for(t&&t(r);u<o.length;u++)i=o[u],a.o(e,i)&&e[i]&&e[i][0](),e[i]=0},r=self.webpackChunksolid_ui=self.webpackChunksolid_ui||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})(),a(1568)})()));
3
+ //# sourceMappingURL=solid-ui.min.js.map